Repository: VictoriaMetrics/VictoriaMetrics
Pull request #1923 (2021-12-10 11:02:33)

vmui: add a label for the Query field
- Add a label for the Query field
- Highlighting invalid form inputs

<img src="https://i.imgur.com/hS9qGJ7.png"/>

#1900 

codecov[bot]: # [Codecov](https://codecov.io/gh/VictoriaMetrics/VictoriaMetrics/pull/1923?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics) Report
> Merging [#1923](https://codecov.io/gh/VictoriaMetrics/VictoriaMetrics/pull/1923?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics) (1154147) into [master](https://codecov.io/gh/VictoriaMetrics/VictoriaMetrics/commit/c1fd93e8a03292eb770923c3bc2eca3f769ba662?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics) (c1fd93e) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/VictoriaMetrics/VictoriaMetrics/pull/1923/graphs/tree.svg?width=650&height=150&src=pr&token=YND8dYVcXn&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics)](https://codecov.io/gh/VictoriaMetrics/VictoriaMetrics/pull/1923?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics)

```diff
@@            Coverage Diff             @@
##           master    #1923      +/-   ##
==========================================
- Coverage   60.70%   60.69%   -0.02%     
==========================================
  Files         237      237              
  Lines       39760    39760              
==========================================
- Hits        24138    24134       -4     
- Misses      14031    14035       +4     
  Partials     1591     1591              
```


| [Impacted Files](https://codecov.io/gh/VictoriaMetrics/VictoriaMetrics/pull/1923?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics) | Coverage Δ | |
|---|---|---|
| [app/vmselect/promql/aggr\_incremental.go](https://codecov.io/gh/VictoriaMetrics/VictoriaMetrics/pull/1923/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics#diff-YXBwL3Ztc2VsZWN0L3Byb21xbC9hZ2dyX2luY3JlbWVudGFsLmdv) | `85.24% <0.00%> (-2.41%)` | :arrow_down: |
| [lib/bloomfilter/filter.go](https://codecov.io/gh/VictoriaMetrics/VictoriaMetrics/pull/1923/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics#diff-bGliL2Jsb29tZmlsdGVyL2ZpbHRlci5nbw==) | `98.00% <0.00%> (-2.00%)` | :arrow_down: |
| [lib/mergeset/table.go](https://codecov.io/gh/VictoriaMetrics/VictoriaMetrics/pull/1923/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics#diff-bGliL21lcmdlc2V0L3RhYmxlLmdv) | `65.63% <0.00%> (-0.30%)` | :arrow_down: |
| [app/vmalert/remotewrite/remotewrite.go](https://codecov.io/gh/VictoriaMetrics/VictoriaMetrics/pull/1923/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics#diff-YXBwL3ZtYWxlcnQvcmVtb3Rld3JpdGUvcmVtb3Rld3JpdGUuZ28=) | `64.82% <0.00%> (+5.51%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/VictoriaMetrics/VictoriaMetrics/pull/1923?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/VictoriaMetrics/VictoriaMetrics/pull/1923?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics). Last update [52eb9c9...1154147](https://codecov.io/gh/VictoriaMetrics/VictoriaMetrics/pull/1923?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VictoriaMetrics).


Patch:
diff --git a/app/vmselect/promql/aggr.go b/app/vmselect/promql/aggr.go
index 316e27117..e2b435c1c 100644
--- a/app/vmselect/promql/aggr.go
+++ b/app/vmselect/promql/aggr.go
@@ -29,7 +29,6 @@ var aggrFuncs = map[string]aggrFunc{
 	"geomean":        newAggrFunc(aggrFuncGeomean),
 	"group":          newAggrFunc(aggrFuncGroup),
 	"histogram":      newAggrFunc(aggrFuncHistogram),
-	"limit_offset":   aggrFuncLimitOffset,
 	"limitk":         aggrFuncLimitK,
 	"mad":            newAggrFunc(aggrFuncMAD),
 	"max":            newAggrFunc(aggrFuncMax),
@@ -1005,37 +1004,12 @@ func aggrFuncLimitK(afa *aggrFuncArg) ([]*timeseries, error) {
 	if len(limits) > 0 {
 		limit = int(limits[0])
 	}
-	afe := newLimitOffsetAggrFunc(limit, 0)
-	return aggrFuncExt(afe, args[1], &afa.ae.Modifier, afa.ae.Limit, true)
-}
-
-func aggrFuncLimitOffset(afa *aggrFuncArg) ([]*timeseries, error) {
-	args := afa.args
-	if err := expectTransformArgsNum(args, 3); err != nil {
-		return nil, err
-	}
-	limit, err := getIntNumber(args[0], 0)
-	if err != nil {
-		return nil, fmt.Errorf("cannot obtain limit arg: %w", err)
-	}
-	offset, err := getIntNumber(args[1], 1)
-	if err != nil {
-		return nil, fmt.Errorf("cannot obtain offset arg: %w", err)
-	}
-	afe := newLimitOffsetAggrFunc(limit, offset)
-	return aggrFuncExt(afe, args[2], &afa.ae.Modifier, afa.ae.Limit, true)
-}
-
-func newLimitOffsetAggrFunc(limit, offset int) func(tss []*timeseries, modifier *metricsql.ModifierExpr) []*timeseries {
-	if offset < 0 {
-		offset = 0
-	}
 	if limit < 0 {
 		limit = 0
 	}
-	return func(tss []*timeseries, modifier *metricsql.ModifierExpr) []*timeseries {
+	afe := func(tss []*timeseries, modifier *metricsql.ModifierExpr) []*timeseries {
 		// Sort series by metricName hash in order to get consistent set of output series
-		// across multiple calls to limitk() and limit_offset() functions.
+		// across multiple calls to limitk() function.
 		// Sort series by hash in order to guarantee uniform selection across series.
 		type hashSeries struct {
 			h  uint64
@@ -1056,15 +1030,12 @@ func newLimitOffsetAggrFunc(limit, offset int) func(tss []*timeseries, modifier
 		for i, hs := range hss {
 			tss[i] = hs.ts
 		}
-		if offset > len(tss) {
-			return nil
-		}
-		tss = tss[offset:]
 		if limit < len(tss) {
 			tss = tss[:limit]
 		}
 		return tss
 	}
+	return aggrFuncExt(afe, args[1], &afa.ae.Modifier, afa.ae.Limit, true)
 }
 
 func getHash(d *xxhash.Digest, mn *storage.MetricName) uint64 {
diff --git a/app/vmselect/promql/transform.go b/app/vmselect/promql/transform.go
index b10de0eec..b47ac7a0c 100644
--- a/app/vmselect/promql/transform.go
+++ b/app/vmselect/promql/transform.go
@@ -70,6 +70,7 @@ var transformFuncs = map[string]transformFunc{
 	"label_transform":      transformLabelTransform,
 	"label_uppercase":      transformLabelUppercase,
 	"label_value":          transformLabelValue,
+	"limit_offset":         transformLimitOffset,
 	"ln":                   newTransformFuncOneArg(transformLn),
 	"log2":                 newTransformFuncOneArg(transformLog2),
 	"log10":                newTransformFuncOneArg(transformLog10),
@@ -1771,6 +1772,29 @@ func transformLabelGraphiteGroup(tfa *transformFuncArg) ([]*timeseries, error) {
 
 var dotSeparator = []byte(".")
 
+func transformLimitOffset(tfa *transformFuncArg) ([]*timeseries, error) {
+	args := tfa.args
+	if err := expectTransformArgsNum(args, 3); err != nil {
+		return nil, err
+	}
+	limit, err := getIntNumber(args[0], 0)
+	if err != nil {
+		return nil, fmt.Errorf("cannot obtain limit arg: %w", err)
+	}
+	offset, err := getIntNumber(args[1], 1)
+	if err != nil {
+		return nil, fmt.Errorf("cannot obtain offset arg: %w", err)
+	}
+	rvs := args[2]
+	if len(rvs) >= offset {
+		rvs = rvs[offset:]
+	}
+	if len(rvs) > limit {
+		rvs = rvs[:limit]
+	}
+	return rvs, nil
+}
+
 func transformLn(v float64) float64 {
 	return math.Log(v)
 }
diff --git a/app/vmselect/vmui/asset-manifest.json b/app/vmselect/vmui/asset-manifest.json
index 3d6941218..e0277698e 100644
--- a/app/vmselect/vmui/asset-manifest.json
+++ b/app/vmselect/vmui/asset-manifest.json
@@ -1,7 +1,7 @@
 {
   "files": {
-    "main.css": "./static/css/main.1b10b1ed.chunk.css",
-    "main.js": "./static/js/main.9f03a409.chunk.js",
+    "main.css": "./static/css/main.83d9ae2d.chunk.css",
+    "main.js": "./static/js/main.20dd555e.chunk.js",
     "runtime-main.js": "./static/js/runtime-main.66a19bd8.js",
     "static/css/2.77671664.chunk.css": "./static/css/2.77671664.chunk.css",
     "static/js/2.bc8706fc.chunk.js": "./static/js/2.bc8706fc.chunk.js",
@@ -13,7 +13,7 @@
     "static/js/runtime-main.66a19bd8.js",
     "static/css/2.77671664.chunk.css",
     "static/js/2.bc8706fc.chunk.js",
-    "static/css/main.1b10b1ed.chunk.css",
-    "static/js/main.9f03a409.chunk.js"
+    "static/css/main.83d9ae2d.chunk.css",
+    "static/js/main.20dd555e.chunk.js"
   ]
 }
\ No newline at end of file
diff --git a/app/vmselect/vmui/index.html b/app/vmselect/vmui/index.html
index 4e8a614a5..2dea67468 100644
--- a/app/vmselect/vmui/index.html
+++ b/app/vmselect/vmui/index.html
@@ -1,1 +1,1 @@
-<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="VM-UI is a metric explorer for Victoria Metrics"/><link rel="apple-touch-icon" href="./apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="./favicon-32x32.png"><link rel="manifest" href="./manifest.json"/><title>VM UI</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/><link href="./static/css/2.77671664.chunk.css" rel="stylesheet"><link href="./static/css/main.1b10b1ed.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"7c3472dc"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="./",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpvmui=this.webpackJsonpvmui||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="./static/js/2.bc8706fc.chunk.js"></script><script src="./static/js/main.9f03a409.chunk.js"></script></body></html>
\ No newline at end of file
+<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="VM-UI is a metric explorer for Victoria Metrics"/><link rel="apple-touch-icon" href="./apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="./favicon-32x32.png"><link rel="manifest" href="./manifest.json"/><title>VM UI</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/><link href="./static/css/2.77671664.chunk.css" rel="stylesheet"><link href="./static/css/main.83d9ae2d.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,a=1;a<t.length;a++){var c=t[a];0!==o[c]&&(n=!1)}n&&(u.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},o={1:0},u=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"7c3472dc"}[e]+".chunk.js"}(e);var c=new Error;u=function(r){a.onerror=a.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="./",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpvmui=this.webpackJsonpvmui||[],c=a.push.bind(a);a.push=r,a=a.slice();for(var l=0;l<a.length;l++)r(a[l]);var f=c;t()}([])</script><script src="./static/js/2.bc8706fc.chunk.js"></script><script src="./static/js/main.20dd555e.chunk.js"></script></body></html>
\ No newline at end of file
diff --git a/app/vmselect/vmui/static/css/main.1b10b1ed.chunk.css b/app/vmselect/vmui/static/css/main.1b10b1ed.chunk.css
deleted file mode 100644
index bbd66b0ae..000000000
--- a/app/vmselect/vmui/static/css/main.1b10b1ed.chunk.css
+++ /dev/null
@@ -1,1 +0,0 @@
-body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.MuiAccordionSummary-content{margin:0!important}.cm-activeLine{background-color:inherit!important}.cm-editor{border-radius:4px;border:1px solid #b9b9b9;font-size:10px}.one-line-scroll .cm-editor{height:40px}.cm-gutters{border-radius:4px 0 0 4px;height:100%}.multi-line-scroll .cm-content,.multi-line-scroll .cm-gutters{min-height:38px!important}.one-line-scroll .cm-content,.one-line-scroll .cm-gutters{min-height:auto}.u-tooltip{position:absolute;display:none;grid-gap:12px;max-width:300px;padding:8px;border-radius:4px;background:rgba(57,57,57,.9);color:#fff;font-size:10px;line-height:1.4em;font-weight:500;word-wrap:break-word;font-family:monospace;pointer-events:none;z-index:100}.u-tooltip-data{display:flex;flex-wrap:wrap;align-items:center;font-size:11px;line-height:150%}.u-tooltip-data__value{padding:4px;font-weight:700}.u-tooltip__info{display:grid;grid-gap:4px}.u-tooltip__marker{width:12px;height:12px;margin-right:4px}.legendWrapper{display:grid;grid-template-columns:repeat(auto-fit,minmax(400px,1fr));grid-gap:20px;margin-top:20px;cursor:default}.legendGroup{margin-bottom:24px}.legendGroupTitle{display:flex;align-items:center;padding:10px 0 5px;font-size:11px}.legendGroupLine{margin:0 10px}.legendItem{display:inline-grid;grid-template-columns:auto auto;grid-gap:6px;align-items:start;justify-content:start;padding:5px 10px;background-color:#fff;cursor:pointer;transition:.2s ease}.legendItemHide{text-decoration:line-through;opacity:.5}.legendItem:hover{background-color:rgba(0,0,0,.1)}.legendMarker{width:12px;height:12px;border-width:2px;border-style:solid;box-sizing:border-box;transition:.2s ease;margin:3px 0}.legendLabel{font-size:11px;font-weight:400}
\ No newline at end of file
diff --git a/app/vmselect/vmui/static/css/main.83d9ae2d.chunk.css b/app/vmselect/vmui/static/css/main.83d9ae2d.chunk.css
new file mode 100644
index 000000000..eb7942157
--- /dev/null
+++ b/app/vmselect/vmui/static/css/main.83d9ae2d.chunk.css
@@ -0,0 +1,1 @@
+body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}.MuiAccordionSummary-content{margin:0!important}.cm-activeLine{background-color:inherit!important}.cm-editor{border:none;border-radius:4px;font-size:10px}.cm-gutters{border-radius:4px 0 0 4px;height:100%;overflow:hidden;border:none!important}.cm-activeLineGutter,.cm-gutters{background-color:#fff!important}.query-editor .cm-scroller{align-items:center!important}.query-editor .cm-editor.cm-focused{outline:none}.query-editor-container{position:relative;padding:12px;border:1px solid #b9b9b9;border-radius:4px}.query-editor-container_focus{border:1px solid #3f51b5}.query-editor-container_error{border-color:#ff4141}.query-editor-container-one-line .query-editor .cm-editor{height:22px}.query-editor-container-one-line{padding:6px}.query-editor-label{font-weight:400;font-size:12px;line-height:1;letter-spacing:normal;color:rgba(0,0,0,.6);padding:0 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(133% - 24px);position:absolute;left:4px;top:-.71875em;z-index:1;background-color:#fff;-webkit-transform:scale(.75);transform:scale(.75)}.query-editor-container_error .query-editor-label{color:#ff4141}.u-tooltip{position:absolute;display:none;grid-gap:12px;max-width:300px;padding:8px;border-radius:4px;background:rgba(57,57,57,.9);color:#fff;font-size:10px;line-height:1.4em;font-weight:500;word-wrap:break-word;font-family:monospace;pointer-events:none;z-index:100}.u-tooltip-data{display:flex;flex-wrap:wrap;align-items:center;font-size:11px;line-height:150%}.u-tooltip-data__value{padding:4px;font-weight:700}.u-tooltip__info{display:grid;grid-gap:4px}.u-tooltip__marker{width:12px;height:12px;margin-right:4px}.legendWrapper{display:grid;grid-template-columns:repeat(auto-fit,minmax(400px,1fr));grid-gap:20px;margin-top:20px;cursor:default}.legendGroup{margin-bottom:24px}.legendGroupTitle{display:flex;align-items:center;padding:10px 0 5px;font-size:11px}.legendGroupLine{margin:0 10px}.legendItem{display:inline-grid;grid-template-columns:auto auto;grid-gap:6px;align-items:start;justify-content:start;padding:5px 10px;background-color:#fff;cursor:pointer;transition:.2s ease}.legendItemHide{text-decoration:line-through;opacity:.5}.legendItem:hover{background-color:rgba(0,0,0,.1)}.legendMarker{width:12px;height:12px;border-width:2px;border-style:solid;box-sizing:border-box;transition:.2s ease;margin:3px 0}.legendLabel{font-size:11px;font-weight:400}
\ No newline at end of file
diff --git a/app/vmselect/vmui/static/js/main.20dd555e.chunk.js b/app/vmselect/vmui/static/js/main.20dd555e.chunk.js
new file mode 100644
index 000000000..97ba01a01
--- /dev/null
+++ b/app/vmselect/vmui/static/js/main.20dd555e.chunk.js
@@ -0,0 +1,1 @@
+(this.webpackJsonpvmui=this.webpackJsonpvmui||[]).push([[0],{204:function(e,t,n){},219:function(e,t){},223:function(e,t,n){},224:function(e,t,n){},234:function(e,t,n){"use strict";n.r(t);var a=n(1),r=n.n(a),c=n(53),i=n.n(c),o=(n(204),n(9)),s=n(317),l=n(316),u=n(0),d=Object(a.createContext)({showInfoMessage:function(){}}),j=function(e){var t=e.children,n=Object(a.useState)({}),r=Object(o.a)(n,2),c=r[0],i=r[1],j=Object(a.useState)(!1),b=Object(o.a)(j,2),O=b[0],h=b[1],p=Object(a.useState)(void 0),f=Object(o.a)(p,2),x=f[0],v=f[1];Object(a.useEffect)((function(){x&&(i({message:x,key:(new Date).getTime()}),h(!0))}),[x]);return Object(u.jsxs)(d.Provider,{value:{showInfoMessage:v},children:[Object(u.jsx)(s.a,{open:O,autoHideDuration:4e3,onClose:function(e,t){"clickaway"!==t&&(v(void 0),h(!1))},children:Object(u.jsx)(l.a,{children:c.message})},c.key),t]})},b=n(351),O=n(352),h=n(327),p=n(245),f=n(343),x=n(241),v=n(328),m=n(330),y=n(322),g=n(326),S=n(148),E=n.n(S),_=n(3),w=n(17),T=n(39),C=n.n(T),A=n(144),R=n.n(A),I=n(145),k=n.n(I),U=n(105),H=n.n(U);C.a.extend(R.a),C.a.extend(k.a);var D,M=window.innerWidth/2,N=1,L=1578e8,q="YYYY-MM-DD[T]HH:mm:ss",Y=[{long:"days",short:"d",possible:"day"},{long:"weeks",short:"w",possible:"week"},{long:"months",short:"M",possible:"mon"},{long:"years",short:"y",possible:"year"},{long:"hours",short:"h",possible:"hour"},{long:"minutes",short:"m",possible:"min"},{long:"seconds",short:"s",possible:"sec"},{long:"milliseconds",short:"ms",possible:"millisecond"}],B=Y.map((function(e){return e.short})),P=function(e){return+H()(e).format("0.000")},F=function(e){var t=e.match(/\d+/g),n=e.match(/[a-zA-Z]+/g);if(n&&t&&B.includes(n[0]))return Object(_.a)({},n[0],t[0])},z=function(e,t){var n=(t||new Date).valueOf()/1e3,a=e.trim().split(" ").reduce((function(e,t){var n=F(t);return n?Object(w.a)(Object(w.a)({},e),n):Object(w.a)({},e)}),{}),r=C.a.duration(a).asSeconds();return{start:n-r,end:n,step:P(r/M)||.001,date:Q(t||new Date)}},Q=function(e){return C()(e).utc().format(q)},G=function(e){var t=Math.floor(e%1e3),n=Math.floor(e/1e3%60),a=Math.floor(e/1e3/60%60),r=Math.floor(e/1e3/3600%24),c=Math.floor(e/864e5),i=["d","h","m","s","ms"];return[c,r,a,n,t].map((function(e,t){return e?"".concat(e).concat(i[t]):""})).filter((function(e){return e})).join(" ")},W=function(e){return new Date(1e3*e)},J=function(e,t){t?window.localStorage.setItem(e,JSON.stringify({value:t})):K([e])},V=function(e){var t=window.localStorage.getItem(e);if(null!==t)try{var n;return null===(n=JSON.parse(t))||void 0===n?void 0:n.value}catch(a){return t}},K=function(e){return e.forEach((function(e){return window.localStorage.removeItem(e)}))},X=["BASIC_AUTH_DATA","BEARER_AUTH_DATA"],Z=n(146),$=n.n(Z),ee=n(116),te=n.n(ee),ne={"time.duration":"range_input","time.period.date":"end_input","time.period.step":"step_input",displayType:"tab"},ae=function(e){var t=new Map(Object.entries(ne)),n=te()(e,"query",""),a=[];n.forEach((function(n,r){t.forEach((function(t,n){var c=te()(e,n,"");if(c){var i=encodeURIComponent(c);a.push("g".concat(r,".").concat(t,"=").concat(i))}})),a.push("g".concat(r,".expr=").concat(n))})),function(e){var t=window;if(t){var n="".concat(t.location.protocol,"//").concat(t.location.host).concat(t.location.pathname,"?").concat(e);t.history.pushState({path:n},"",n)}}(a.join("&"))},re=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.location.search,a=$.a.parse(n,{ignoreQueryPrefix:!0});return te()(a,e,t||"")},ce=re("g0.range_input","1h"),ie=(D=re("g0.end_input",new Date(C()().utc().format(q))),C()(D).utcOffset(0,!0).local().format(q)),oe=function(){var e,t=(null===(e=window.location.search.match(/g\d+.expr/gim))||void 0===e?void 0:e.length)||1;return new Array(t).fill(1).map((function(e,t){return re("g".concat(t,".expr"),"")}))}(),se={serverUrl:window.location.href.replace(/\/(?:prometheus\/)?(?:graph|vmui)\/.*/,"/prometheus/"),displayType:re("tab","chart"),query:oe,queryHistory:oe.map((function(e){return{index:0,values:[e]}})),time:{duration:ce,period:z(ce,new Date(ie))},queryControls:{autoRefresh:!1,autocomplete:V("AUTOCOMPLETE")||!1,nocache:V("NO_CACHE")||!1}};function le(e,t){switch(t.type){case"SET_DISPLAY_TYPE":return Object(w.a)(Object(w.a)({},e),{},{displayType:t.payload});case"SET_SERVER":return Object(w.a)(Object(w.a)({},e),{},{serverUrl:t.payload});case"SET_QUERY":return Object(w.a)(Object(w.a)({},e),{},{query:t.payload});case"SET_QUERY_HISTORY":return Object(w.a)(Object(w.a)({},e),{},{queryHistory:t.payload});case"SET_QUERY_HISTORY_BY_INDEX":return Object(w.a)(Object(w.a)({},e),{},{queryHistory:e.queryHistory.splice(t.payload.queryNumber,1,t.payload.value)});case"SET_DURATION":return Object(w.a)(Object(w.a)({},e),{},{time:Object(w.a)(Object(w.a)({},e.time),{},{duration:t.payload,period:z(t.payload,W(e.time.period.end))})});case"SET_UNTIL":return Object(w.a)(Object(w.a)({},e),{},{time:Object(w.a)(Object(w.a)({},e.time),{},{period:z(e.time.duration,t.payload)})});case"SET_PERIOD":var n=function(e){var t=e.to.valueOf()-e.from.valueOf();return G(t)}(t.payload);return Object(w.a)(Object(w.a)({},e),{},{queryControls:Object(w.a)(Object(w.a)({},e.queryControls),{},{autoRefresh:!1}),time:Object(w.a)(Object(w.a)({},e.time),{},{duration:n,period:z(n,t.payload.to)})});case"TOGGLE_AUTOREFRESH":return Object(w.a)(Object(w.a)({},e),{},{queryControls:Object(w.a)(Object(w.a)({},e.queryControls),{},{autoRefresh:!e.queryControls.autoRefresh})});case"TOGGLE_AUTOCOMPLETE":return Object(w.a)(Object(w.a)({},e),{},{queryControls:Object(w.a)(Object(w.a)({},e.queryControls),{},{autocomplete:!e.queryControls.autocomplete})});case"NO_CACHE":return Object(w.a)(Object(w.a)({},e),{},{queryControls:Object(w.a)(Object(w.a)({},e.queryControls),{},{nocache:!e.queryControls.nocache})});case"RUN_QUERY":return Object(w.a)(Object(w.a)({},e),{},{time:Object(w.a)(Object(w.a)({},e.time),{},{period:z(e.time.duration,W(e.time.period.end))})});case"RUN_QUERY_TO_NOW":return Object(w.a)(Object(w.a)({},e),{},{time:Object(w.a)(Object(w.a)({},e.time),{},{period:z(e.time.duration)})});default:throw new Error}}var ue=Object(a.createContext)({}),de=function(){return Object(a.useContext)(ue).state},je=function(){return Object(a.useContext)(ue).dispatch},be=Object.entries(se).reduce((function(e,t){var n=Object(o.a)(t,2),a=n[0],r=n[1];return Object(w.a)(Object(w.a)({},e),{},Object(_.a)({},a,re(a)||r))}),{}),Oe=function(e){var t=e.children,n=Object(a.useReducer)(le,be),r=Object(o.a)(n,2),c=r[0],i=r[1];Object(a.useEffect)((function(){ae(c)}),[c]);var s=Object(a.useMemo)((function(){return{state:c,dispatch:i}}),[c,i]);return Object(u.jsx)(ue.Provider,{value:s,children:t})},he=function(e){return Object(u.jsxs)(h.a,{position:"relative",display:"inline-flex",children:[Object(u.jsx)(v.a,Object(w.a)({variant:"determinate"},e)),Object(u.jsx)(h.a,{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",children:Object(u.jsx)(p.a,{variant:"caption",component:"div",children:"".concat(e.label,"s")})})]})},pe=n(313),fe=n(10),xe=n(329),ve=Object(fe.a)(xe.a)((function(){return{padding:10,"& .MuiSwitch-track":{borderRadius:14,"&:before, &:after":{content:'""',position:"absolute",top:"50%",transform:"translateY(-50%)",width:14,height:14}},"& .MuiSwitch-thumb":{boxShadow:"none",width:12,height:12,margin:4}}})),me=Object(pe.a)({colorizing:{color:"white"}}),ye=function(){var e=me(),t=je(),n=de().queryControls.autoRefresh,c=Object(a.useState)(5),i=Object(o.a)(c,2),s=i[0],l=i[1],d=Object(a.useState)(),j=Object(o.a)(d,2),b=j[0],O=j[1],p=r.a.useState(100),f=Object(o.a)(p,2),x=f[0],v=f[1];Object(a.useEffect)((function(){var e;return n&&(O((new Date).valueOf()),e=setInterval((function(){O((new Date).valueOf()),t({type:"RUN_QUERY_TO_NOW"})}),1e3*s)),function(){e&&clearInterval(e)}}),[s,n]),Object(a.useEffect)((function(){var e=setInterval((function(){if(n&&b){var e=((new Date).valueOf()-b)/1e3,t=Math.floor(e/s*100);v(t)}}),16);return function(){clearInterval(e)}}),[n,b,s]);var S=function(){l((function(e){switch(e){case 1:return 2;default:return 5;case 5:return 1}}))};return Object(u.jsxs)(h.a,{display:"flex",alignItems:"center",children:[Object(u.jsx)(m.a,{control:Object(u.jsx)(ve,{className:e.colorizing,checked:n,onChange:function(){t({type:"TOGGLE_AUTOREFRESH"})}}),label:"Auto-refresh"}),n&&Object(u.jsxs)(u.Fragment,{children:[Object(u.jsx)(he,{className:e.colorizing,label:s,value:x,onClick:function(){S()}}),Object(u.jsx)(y.a,{title:"Change delay refresh",children:Object(u.jsx)(h.a,{ml:1,children:Object(u.jsx)(g.a,{onClick:function(){S()},children:Object(u.jsx)(E.a,{style:{color:"white"}})})})})]})]})},ge=n(151),Se=n.n(ge),Ee=n(149),_e=n.n(Ee),we=n(150),Te=n.n(we),Ce=n(332),Ae=n(323),Re=n(331),Ie=Object(Re.a)({root:{display:"grid",gridTemplateColumns:"18px auto",gridGap:6,padding:"8px 12px",color:"white",lineHeight:"19px","&.Mui-selected":{color:"white"}}})(Ce.a),ke=function(){var e=de().displayType,t=je();return Object(u.jsxs)(Ae.a,{value:e,exclusive:!0,onChange:function(n,a){return t({type:"SET_DISPLAY_TYPE",payload:null!==a&&void 0!==a?a:e})},children:[Object(u.jsxs)(Ie,{value:"chart","aria-label":"display as chart",children:[Object(u.jsx)(_e.a,{}),Object(u.jsx)("span",{children:"Query Range as Chart"})]}),Object(u.jsxs)(Ie,{value:"code","aria-label":"display as code",children:[Object(u.jsx)(Te.a,{}),Object(u.jsx)("span",{children:"Instant Query as JSON"})]}),Object(u.jsxs)(Ie,{value:"table","aria-label":"display as table",children:[Object(u.jsx)(Se.a,{}),Object(u.jsx)("span",{children:"Instant Query as Table"})]})]})},Ue=n(21),He=n(152),De={yaxis:{limits:{enable:!1,range:{1:[0,0]}}}};function Me(e,t){switch(t.type){case"TOGGLE_ENABLE_YAXIS_LIMITS":return Object(w.a)(Object(w.a)({},e),{},{yaxis:Object(w.a)(Object(w.a)({},e.yaxis),{},{limits:Object(w.a)(Object(w.a)({},e.yaxis.limits),{},{enable:!e.yaxis.limits.enable})})});case"SET_YAXIS_LIMITS":return Object(w.a)(Object(w.a)({},e),{},{yaxis:Object(w.a)(Object(w.a)({},e.yaxis),{},{limits:Object(w.a)(Object(w.a)({},e.yaxis.limits),{},{range:t.payload})})});default:throw new Error}}var Ne,Le=Object(a.createContext)({}),qe=function(){return Object(a.useContext)(Le).state},Ye=function(){return Object(a.useContext)(Le).dispatch},Be=function(e){var t=e.children,n=Object(a.useReducer)(Me,De),r=Object(o.a)(n,2),c=r[0],i=r[1],s=Object(a.useMemo)((function(){return{state:c,dispatch:i}}),[c,i]);return Object(u.jsx)(Le.Provider,{value:s,children:t})},Pe=function(e){if(7!=e.length)return"0, 0, 0";var t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16);return"".concat(t,", ").concat(n,", ").concat(a)},Fe={height:500,legend:{show:!1},cursor:{drag:{x:!1,y:!1},focus:{prox:30},bind:{mouseup:function(){return null},mousedown:function(){return null},click:function(){return null},dblclick:function(){return null},mouseenter:function(){return null}}}},ze=function(e,t){return t.map((function(e){return e>1e3?H()(e).format("0.0a"):e}))},Qe=function(e,t){return function(e){for(var t=0,n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);for(var a="#",r=0;r<3;r++)a+=("00"+(t>>8*r&255).toString(16)).substr(-2);return a}("".concat(e).concat(t))},Ge=function(e){return e<=1?[]:[4*e,1.2*e]},We=function(e){for(var t=e.length,n=-1/0;t--;)e[t]>n&&(n=e[t]);return n},Je=function(e){for(var t=e.length,n=1/0;t--;)e[t]<n&&(n=e[t]);return n},Ve=function(e){return Array.from(new Set(e.map((function(e){return e.scale})))).map((function(e){var t={scale:e,show:!0,font:"10px Arial",values:ze};return e?Number(e)%2?t:Object(w.a)(Object(w.a)({},t),{},{side:1}):{space:80}}))},Ke=function(e){var t,n,a=e.u,r=e.tooltipIdx,c=e.metrics,i=e.series,o=e.tooltip,s=e.tooltipOffset,l=r.seriesIdx,u=r.dataIdx,d=a.data[l][u],j=a.data[0][u],b=(null===(t=c[l-1])||void 0===t?void 0:t.metric)||{},O=Qe(Number(i[l].scale||0),i[l].label||""),h=a.over.getBoundingClientRect(),p=h.width,f=h.height,x=a.valToPos(d||0,(null===(n=i[l])||void 0===n?void 0:n.scale)||"1"),v=a.valToPos(j,"x"),m=o.getBoundingClientRect(),y=m.width,g=m.height,S=v+y>=p,E=x+g>=f;o.style.display="grid",o.style.top="".concat(s.top+x+10-(E?g+10:0),"px"),o.style.left="".concat(s.left+v+10-(S?y+20:0),"px");var _=C()(new Date(1e3*j)).format("YYYY-MM-DD HH:mm:ss:SSS (Z)"),w=Object.keys(b).filter((function(e){return"__name__"!==e})).map((function(e){return"<div><b>".concat(e,"</b>: ").concat(b[e],"</div>")})).join(""),T='<div class="u-tooltip__marker" style="background: '.concat(O,'"></div>');o.innerHTML="<div>".concat(_,'</div>\n                       <div class="u-tooltip-data">\n                         ').concat(T).concat(b.__name__||"",': <b class="u-tooltip-data__value">').concat(d,'</b>\n                       </div>\n                       <div class="u-tooltip__info">').concat(w,"</div>")},Xe=n(153),Ze=n.n(Xe);n(222),n(223);!function(e){e.xRange="xRange",e.yRange="yRange",e.data="data"}(Ne||(Ne={}));var $e,et=function(e){var t=e.data,n=e.series,r=e.metrics,c=void 0===r?[]:r,i=e.limits,s=je(),l=de().time.period,d=qe().yaxis,j=Object(a.useRef)(null),b=Object(a.useRef)(null),O=Object(a.useState)(!1),h=Object(o.a)(O,2),p=h[0],f=h[1],x=Object(a.useState)(0),v=Object(o.a)(x,2),m=v[0],y=v[1],g=Object(a.useState)({min:l.start,max:l.end}),S=Object(o.a)(g,2),E=S[0],_=S[1],T=Object(a.useState)(),C=Object(o.a)(T,2),A=C[0],R=C[1],I=document.createElement("div");I.className="u-tooltip";var k={seriesIdx:1,dataIdx:0},U={left:0,top:0},H=Object(a.useCallback)(Ze()((function(e){var t=e.min,n=e.max;s({type:"SET_PERIOD",payload:{from:new Date(1e3*t),to:new Date(1e3*n)}})}),500),[]),D=function(e){var t=e.u,n=e.min,a=e.max,r=1e3*(a-n);r<N||r>L||(t.setScale("x",{min:n,max:a}),_({min:n,max:a}),H({min:n,max:a}))},M=function(){return[E.min,E.max]},q=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3?arguments[3]:void 0;return d.limits.enable?d.limits.range[a]:t&&n?[t-.05*t,n+.05*n]:i[a]},Y=Object(w.a)(Object(w.a)({},Fe),{},{series:n,axes:Ve(n),scales:Object(w.a)({},function(){var e={x:{range:M}};return Object.keys(d.limits.range).forEach((function(t){e[t]={range:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return q(e,n,a,t)}}})),e}()),width:j.current?j.current.offsetWidth:400,plugins:[{hooks:{ready:function(e){var t,n=.85;U.left=parseFloat(e.over.style.left),U.top=parseFloat(e.over.style.top),null===(t=e.root.querySelector(".u-wrap"))||void 0===t||t.appendChild(I),e.over.addEventListener("mousedown",(function(t){return function(e){var t=e.e,n=e.factor,a=void 0===n?.85:n,r=e.u,c=e.setPanning,i=e.setPlotScale;if(0===t.button){t.preventDefault(),c(!0);var o=t.clientX,s=r.posToVal(1,"x")-r.posToVal(0,"x"),l=r.scales.x.min||0,u=r.scales.x.max||0,d=function(e){e.preventDefault();var t=s*((e.clientX-o)*a);i({u:r,min:l-t,max:u-t})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",(function e(){c(!1),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",e)}))}}({u:e,e:t,setPanning:f,setPlotScale:D,factor:n})})),e.over.addEventListener("wheel",(function(t){if(t.ctrlKey||t.metaKey){t.preventDefault();var a=e.over.getBoundingClientRect().width;e.cursor.left&&e.cursor.left>0&&y(e.cursor.left);var r=e.posToVal(m,"x"),c=(e.scales.x.max||0)-(e.scales.x.min||0),i=t.deltaY<0?c*n:c/n,o=r-m/a*i,s=o+i;e.batch((function(){return D({u:e,min:o,max:s})}))}}))},setCursor:function(e){k.dataIdx!==e.cursor.idx&&(k.dataIdx=e.cursor.idx||0,k.seriesIdx&&k.dataIdx&&Ke({u:e,tooltipIdx:k,metrics:c,series:n,tooltip:I,tooltipOffset:U}))},setSeries:function(e,t){k.seriesIdx!==t&&(k.seriesIdx=t||0,t&&k.dataIdx?Ke({u:e,tooltipIdx:k,metrics:c,series:n,tooltip:I,tooltipOffset:U}):I.style.display="none")}}}]}),B=function(e){if(A){switch(e){case Ne.xRange:A.scales.x.range=M;break;case Ne.yRange:Object.keys(d.limits.range).forEach((function(e){A.scales[e]&&(A.scales[e].range=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return q(t,n,a,e)})}));break;case Ne.data:A.setData(t)}A.redraw()}};return Object(a.useEffect)((function(){return _({min:l.start,max:l.end})}),[l]),Object(a.useEffect)((function(){if(b.current){var e=new He.a(Y,t,b.current);return R(e),_({min:l.start,max:l.end}),e.destroy}}),[b.current,n]),Object(a.useEffect)((function(){return B(Ne.data)}),[t]),Object(a.useEffect)((function(){return B(Ne.xRange)}),[E]),Object(a.useEffect)((function(){return B(Ne.yRange)}),[d]),Object(u.jsx)("div",{ref:j,style:{pointerEvents:p?"none":"auto",height:"500px"},children:Object(u.jsx)("div",{ref:b})})},tt=(n(224),function(e){var t=e.labels,n=e.onChange,r=de().query,c=Object(a.useMemo)((function(){return Array.from(new Set(t.map((function(e){return e.group}))))}),[t]);return Object(u.jsx)("div",{className:"legendWrapper",children:c.map((function(e){return Object(u.jsxs)("div",{className:"legendGroup",children:[Object(u.jsxs)("div",{className:"legendGroupTitle",children:[Object(u.jsx)("svg",{className:"legendGroupLine",width:"33",height:"3",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:Object(u.jsx)("line",{strokeWidth:"3",x1:"0",y1:"0",x2:"33",y2:"0",stroke:"#363636",strokeDasharray:Ge(e).join(",")})}),Object(u.jsxs)("b",{children:['"',r[e-1],'"']}),":"]}),Object(u.jsx)("div",{children:t.filter((function(t){return t.group===e})).map((function(e){return Object(u.jsxs)("div",{className:e.checked?"legendItem":"legendItem legendItemHide",onClick:function(t){return n(e,t.ctrlKey||t.metaKey)},children:[Object(u.jsx)("div",{className:"legendMarker",style:{borderColor:e.color,backgroundColor:"rgba(".concat(Pe(e.color),", 0.1)")}}),Object(u.jsx)("div",{className:"legendLabel",children:e.label})]},"".concat(e.group,".").concat(e.label))}))})]},e)}))})}),nt=n(114),at=["__name__"],rt=function(e,t){var n=function(e){if(0===Object.keys(e.metric).length)return"Query result";var t=e.metric,n=t.__name__,a=Object(nt.a)(t,at);return"".concat(n||""," {").concat(Object.entries(a).map((function(e){return"".concat(e[0],": ").concat(e[1])})).join(", "),"}")}(e);return{label:n,dash:Ge(e.group),width:1.5,stroke:Qe(e.group,n),show:!it(n,e.group,t),scale:String(e.group)}},ct=function(e,t){return{group:t,label:e.label||"",color:e.stroke,checked:e.show||!1}},it=function(e,t,n){return n.includes("".concat(t,".").concat(e))},ot=n(156),st=n.n(ot),lt=n(314),ut=n(154),dt=n.n(ut),jt=function(){var e=qe().yaxis,t=Ye(),n=Object(a.useMemo)((function(){return Object.keys(e.limits.range)}),[e.limits.range]),r=Object(a.useCallback)(dt()((function(n,a,r){var c=e.limits.range;c[a][r]=+n.target.value,t({type:"SET_YAXIS_LIMITS",payload:c})}),500),[e.limits.range]);return Object(u.jsxs)(h.a,{display:"grid",alignItems:"center",gap:2,children:[Object(u.jsx)(m.a,{control:Object(u.jsx)(ve,{checked:e.limits.enable,onChange:function(){t({type:"TOGGLE_ENABLE_YAXIS_LIMITS"})}}),label:"Fix the limits for y-axis"}),Object(u.jsx)(h.a,{display:"grid",alignItems:"center",gap:4,children:n.map((function(t){return Object(u.jsxs)(h.a,{display:"grid",gridTemplateColumns:"120px 120px",gap:1,children:[Object(u.jsx)(lt.a,{label:"Min ".concat(t),type:"number",size:"small",variant:"outlined",disabled:!e.limits.enable,defaultValue:e.limits.range[t][0],onChange:function(e){return r(e,t,0)}}),Object(u.jsx)(lt.a,{label:"Max ".concat(t),type:"number",size:"small",variant:"outlined",disabled:!e.limits.enable,defaultValue:e.limits.range[t][1],onChange:function(e){return r(e,t,1)}})]},t)}))})]})},bt=n(324),Ot=n(178),ht=n(155),pt=n.n(ht),ft=n(157),xt=n.n(ft),vt=Object(pe.a)({popover:{position:"absolute",display:"grid",gridGap:"16px",padding:"0 0 25px",zIndex:2},popoverHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"#3F51B5",padding:"6px 6px 6px 12px",borderRadius:"4px 4px 0 0",color:"#FFF",cursor:"move"},popoverBody:{padding:"0 14px"}}),mt=function(){var e=Object(a.useState)(!1),t=Object(o.a)(e,2),n=t[0],r=t[1],c=Object(a.useRef)(null),i=vt();return Object(u.jsxs)(h.a,{display:"flex",px:2,children:[Object(u.jsxs)(bt.a,{onClick:function(){return r((function(e){return!e}))},variant:"outlined",children:[Object(u.jsx)(st.a,{sx:{fontSize:16,marginRight:"4px"}}),Object(u.jsxs)("span",{style:{lineHeight:1,paddingTop:"1px"},children:[n?"Hide":"Show"," graph settings"]})]}),n&&Object(u.jsx)(pt.a,{nodeRef:c,defaultPosition:{x:173,y:0},handle:"#handle",children:Object(u.jsxs)(Ot.a,{elevation:3,className:i.popover,ref:c,children:[Object(u.jsxs)("div",{id:"handle",className:i.popoverHeader,children:[Object(u.jsx)(p.a,{variant:"body1",children:Object(u.jsx)("b",{children:"Graph Settings"})}),Object(u.jsx)(g.a,{size:"small",onClick:function(){return r(!1)},children:Object(u.jsx)(xt.a,{style:{color:"white"}})})]}),Object(u.jsx)(h.a,{className:i.popoverBody,children:Object(u.jsx)(jt,{})})]})})]})},yt=function(e){var t=e.data,n=void 0===t?[]:t,r=Ye(),c=Object(a.useState)([[]]),i=Object(o.a)(c,2),s=i[0],l=i[1],d=Object(a.useState)([]),j=Object(o.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)([]),p=Object(o.a)(h,2),f=p[0],x=p[1],v=Object(a.useState)([]),m=Object(o.a)(v,2),y=m[0],g=m[1],S=Object(a.useState)({1:[0,1]}),E=Object(o.a)(S,2),_=E[0],w=E[1],T=function(e){var t=function(e){var t={};for(var n in e){var a=e[n],r=Je(a),c=We(a);t[n]=[r-.05*r,c+.05*c]}return t}(e);w(t),r({type:"SET_YAXIS_LIMITS",payload:t})};return Object(a.useEffect)((function(){var e=[],t={},a=[],r=[];null===n||void 0===n||n.forEach((function(n){var c=rt(n,y);r.push(c),a.push(ct(c,n.group)),n.values.forEach((function(a){e.push(a[0]),t[n.group]?t[n.group].push(+a[1]):t[n.group]=[+a[1]]}))}));var c=function(e){var t=Array.from(new Set(e)).sort((function(e,t){return e-t})),n=Je(t.map((function(e,n){return t[n+1]-e}))),a=t[0]||0;return new Array(t.length).fill(a).map((function(e,t){return P(e+n*t)}))}(e);l([c].concat(Object(Ue.a)(n.map((function(e){return new Array(c.length).fill(1).map((function(t,n){return e.values[n]?+e.values[n][1]:null}))}))))),T(t);var i=[{}].concat(r);JSON.stringify(i)!==JSON.stringify(b)&&(O(i),x(a))}),[n]),Object(a.useEffect)((function(){var e=[],t=[];null===n||void 0===n||n.forEach((function(n){var a=rt(n,y);t.push(a),e.push(ct(a,n.group))})),O([{}].concat(t)),x(e)}),[y]),Object(u.jsx)(u.Fragment,{children:n.length>0?Object(u.jsxs)("div",{children:[Object(u.jsx)(mt,{}),Object(u.jsx)(et,{data:s,series:b,metrics:n,limits:_}),Object(u.jsx)(tt,{labels:f,onChange:function(e,t){g(function(e){var t=e.hideSeries,n=e.legend,a=e.metaKey,r=e.series,c="".concat(n.group,".").concat(n.label),i=it(n.label,n.group,t),o=r.map((function(e){return"".concat(e.scale,".").concat(e.label)}));return a&&i?Object(Ue.a)(o.filter((function(e){return e!==c}))):a&&!i?t.length>=r.length-1?[]:Object(Ue.a)(o.filter((function(e){return e!==c}))):i?t.filter((function(e){return e!==c})):[].concat(Object(Ue.a)(t),[c])}({hideSeries:y,legend:e,metaKey:t,series:b}))}})]}):Object(u.jsx)("div",{style:{textAlign:"center"},children:"No data to show"})})},gt=n(337),St=n(338),Et=n(339),_t=n(340),wt=n(341),Tt=n(342),Ct=Object(pe.a)({deemphasized:{opacity:.4}}),At=function(e){var t=e.data,n=Ct(),r=function(e){return Object(a.useMemo)((function(){var t={};return e.forEach((function(e){return Object.entries(e.metric).forEach((function(e){return t[e[0]]?t[e[0]].options.add(e[1]):t[e[0]]={options:new Set([e[1]])}}))})),Object.entries(t).map((function(e){return{key:e[0],variations:e[1].options.size}})).sort((function(e,t){return e.variations-t.variations}))}),[e])}(t),c=Object(a.useMemo)((function(){return null===t||void 0===t?void 0:t.map((function(e){return{metadata:r.map((function(t){return e.metric[t.key]||"-"})),value:e.value?e.value[1]:"-"}}))}),[r,t]);return Object(u.jsx)(u.Fragment,{children:c.length>0?Object(u.jsx)(gt.a,{component:Ot.a,children:Object(u.jsxs)(St.a,{"aria-label":"simple table",children:[Object(u.jsx)(Et.a,{children:Object(u.jsxs)(_t.a,{children:[r.map((function(e,t){return Object(u.jsx)(wt.a,{style:{textTransform:"capitalize"},children:e.key},t)})),Object(u.jsx)(wt.a,{align:"right",children:"Value"})]})}),Object(u.jsx)(Tt.a,{children:c.map((function(e,t){return Object(u.jsxs)(_t.a,{children:[e.metadata.map((function(e,a){var r=c[t-1]&&c[t-1].metadata[a];return Object(u.jsx)(wt.a,{className:r===e?n.deemphasized:void 0,children:e},a)})),Object(u.jsx)(wt.a,{align:"right",children:e.value})]},t)}))})]})}):Object(u.jsx)("div",{style:{textAlign:"center"},children:"No data to show"})})},Rt=n(320),It=n(349),kt=n(350),Ut=n(325),Ht=n(6),Dt=n(13),Mt=n(109),Nt=n(172),Lt=n(174);!function(e){e.emptyServer="Please enter Server URL",e.validServer="Please provide a valid Server URL",e.validQuery="Please enter a valid Query and execute it"}($e||($e={}));var qt=function(e){var t=e.index,n=e.query,r=e.queryHistory,c=e.setHistoryIndex,i=e.setQuery,s=e.runQuery,l=e.server,d=e.oneLiner,j=void 0!==d&&d,b=e.autocomplete,O=e.error,h=Object(a.useRef)(null),p=Object(a.useState)(),f=Object(o.a)(p,2),x=f[0],v=f[1],m=Object(a.useState)(!1),y=Object(o.a)(m,2),g=y[0],S=y[1];Object(a.useEffect)((function(){return h.current&&v(new Dt.d({parent:h.current})),function(){return null===x||void 0===x?void 0:x.destroy()}}),[]),Object(a.useEffect)((function(){var e=new Nt.a;e.activateCompletion(b),e.setComplete({remote:{url:l}});var a=Dt.d.updateListener.of((function(e){e.focusChanged&&(null===x||void 0===x?void 0:x.hasFocus)!==g&&S((null===x||void 0===x?void 0:x.hasFocus)||!1),e.docChanged&&i(e.state.doc.toJSON().map((function(e){return e.trim()})).join(""),t)}));null===x||void 0===x||x.setState(Ht.f.create({doc:n,extensions:[Lt.a,Dt.k.of(Mt.a),a,e.asExtension()]}))}),[l,x,b,r]);return Object(u.jsxs)("div",{className:"query-editor-container \n    ".concat(g?"query-editor-container_focus":"","\n    query-editor-container-").concat(j?"one-line":"multi-line","\n    ").concat(O===$e.validQuery?"query-editor-container_error":""),children:[Object(u.jsx)("label",{className:"query-editor-label",children:"Query"}),Object(u.jsx)("div",{className:"query-editor",ref:h,onKeyUp:function(e){var n=e.key,a=e.ctrlKey,r=e.metaKey,i=a||r;"Enter"===n&&i?s():"ArrowUp"===n&&i?c(-1,t):"ArrowDown"===n&&i&&c(1,t)}})]})},Yt=n(335),Bt=n(311),Pt=function(){return Object(u.jsx)(gt.a,{component:Ot.a,children:Object(u.jsxs)(St.a,{"aria-label":"simple table",size:"small",children:[Object(u.jsx)(Et.a,{children:Object(u.jsxs)(_t.a,{children:[Object(u.jsx)(wt.a,{children:"Long"}),Object(u.jsx)(wt.a,{children:"Short"})]})}),Object(u.jsx)(Tt.a,{children:Y.map((function(e,t){return Object(u.jsxs)(_t.a,{children:[Object(u.jsx)(wt.a,{component:"th",scope:"row",children:e.long}),Object(u.jsx)(wt.a,{children:e.short})]},t)}))})]})})},Ft=Object(pe.a)({inlineBtn:{"&:hover":{cursor:"pointer"}}}),zt=function(e){var t=e.handler,n=e.text,a=Ft();return Object(u.jsx)(f.a,{component:"span",className:a.inlineBtn,onClick:t,children:n})},Qt=Object(pe.a)({container:{display:"grid",gridTemplateColumns:"auto auto",height:"100%",padding:"18px 14px",borderRadius:"4px",borderColor:"#b9b9b9",borderStyle:"solid",borderWidth:"1px"}}),Gt=function(e){var t=e.setDuration,n=Qt(),c=Object(a.useState)(!1),i=Object(o.a)(c,2),s=i[0],l=i[1],d=r.a.useState(null),j=Object(o.a)(d,2),b=j[0],O=j[1],f=Object(a.useState)(),x=Object(o.a)(f,2),v=x[0],m=x[1],y=de().time,g=y.period.end,S=y.duration,E=je(),_=Object(a.useState)(S),T=Object(o.a)(_,2),A=T[0],R=T[1];Object(a.useEffect)((function(){R(S)}),[S]),Object(a.useEffect)((function(){m(function(e){return C()(e).format(q)}(W(g)))}),[g]),Object(a.useEffect)((function(){if(!s){var e=function(e){var t=e.trim().split(" ").reduce((function(e,t){var n=F(t);return n?Object(w.a)(Object(w.a)({},e),n):Object(w.a)({},e)}),{}),n=C.a.duration(t).asMilliseconds();return n<N?G(N):n>L?G(L):e}(A);R(e),t(e)}}),[A,s]);var I=function(){O(null)},k=Boolean(b);return Object(u.jsxs)(h.a,{className:n.container,children:[Object(u.jsxs)(h.a,{px:1,children:[Object(u.jsx)(h.a,{children:Object(u.jsx)(lt.a,{label:"Duration",value:A,onChange:function(e){R(e.target.value)},variant:"standard",fullWidth:!0,onKeyUp:function(e){if("Enter"===e.key){var t=e.target;t.blur(),R(t.value)}},onBlur:function(){l(!1)},onFocus:function(){l(!0)}})}),Object(u.jsx)(h.a,{mt:2,children:Object(u.jsxs)(p.a,{variant:"body2",children:[Object(u.jsx)("span",{"aria-owns":k?"mouse-over-popover":void 0,"aria-haspopup":"true",style:{cursor:"pointer"},onMouseEnter:function(e){O(e.currentTarget)},onMouseLeave:I,children:"Possible options:\xa0"}),Object(u.jsx)(Yt.a,{open:k,anchorEl:b,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},style:{pointerEvents:"none"},onClose:I,disableRestoreFocus:!0,children:Object(u.jsx)(Pt,{})}),Object(u.jsx)(zt,{handler:function(){return R("5m")},text:"5m"}),",\xa0",Object(u.jsx)(zt,{handler:function(){return R("1h")},text:"1h"}),",\xa0",Object(u.jsx)(zt,{handler:function(){return R("1h 30m")},text:"1h 30m"})]})})]}),Object(u.jsxs)(h.a,{px:1,children:[Object(u.jsx)(h.a,{children:Object(u.jsx)(Bt.a,{label:"Until",ampm:!1,value:v,onChange:function(e){return E({type:"SET_UNTIL",payload:e})},onError:console.log,inputFormat:"DD/MM/YYYY HH:mm:ss",mask:"__/__/____ __:__:__",renderInput:function(e){return Object(u.jsx)(lt.a,Object(w.a)(Object(w.a)({},e),{},{variant:"standard"}))}})}),Object(u.jsx)(h.a,{mt:2,children:Object(u.jsxs)(p.a,{variant:"body2",children:["Will be changed to current time for auto-refresh mode.\xa0",Object(u.jsx)(zt,{handler:function(){return E({type:"RUN_QUERY_TO_NOW"})},text:"Switch to now"})]})})]})]})},Wt=n(162),Jt=n.n(Wt),Vt=n(164),Kt=n.n(Vt),Xt=n(165),Zt=n.n(Xt),$t=n(163),en=n.n($t),tn=n(301),nn=n(161),an=n.n(nn),rn=n(308),cn=n(306),on=n(346),sn=n(348),ln=n(315),un=n(344),dn=n(334),jn=n(321),bn=n(333),On=n(345),hn=n(319),pn=n(336),fn=n(347),xn=n(307),vn=["children","value","index"],mn=function(e){var t=e.children,n=e.value,a=e.index,r=Object(nt.a)(e,vn);return Object(u.jsx)("div",Object(w.a)(Object(w.a)({role:"tabpanel",hidden:n!==a,id:"auth-config-tabpanel-".concat(a),"aria-labelledby":"auth-config-tab-".concat(a)},r),{},{children:n===a&&Object(u.jsx)(h.a,{py:2,children:t})}))},yn=n(159),gn=n.n(yn),Sn=n(160),En=n.n(Sn),_n={authMethod:"NO_AUTH",saveAuthLocally:!1},wn=V("AUTH_TYPE"),Tn=V("BASIC_AUTH_DATA"),Cn=V("BEARER_AUTH_DATA"),An=Object(w.a)(Object(w.a)({},_n),{},{authMethod:wn||_n.authMethod,basicData:Tn,bearerData:Cn,saveAuthLocally:!(!Tn&&!Cn)}),Rn=function(){K(X)};function In(e,t){switch(t.type){case"SET_BASIC_AUTH":return t.payload.checkbox?J("BASIC_AUTH_DATA",t.payload.value):Rn(),J("AUTH_TYPE","BASIC_AUTH"),Object(w.a)(Object(w.a)({},e),{},{authMethod:"BASIC_AUTH",basicData:t.payload.value});case"SET_BEARER_AUTH":return t.payload.checkbox?J("BEARER_AUTH_DATA",t.payload.value):Rn(),J("AUTH_TYPE","BEARER_AUTH"),Object(w.a)(Object(w.a)({},e),{},{authMethod:"BEARER_AUTH",bearerData:t.payload.value});case"SET_NO_AUTH":return!t.payload.checkbox&&Rn(),J("AUTH_TYPE","NO_AUTH"),Object(w.a)(Object(w.a)({},e),{},{authMethod:"NO_AUTH"});default:throw new Error}}var kn=Object(a.createContext)({}),Un=function(){return Object(a.useContext)(kn).state},Hn=function(e){var t=e.children,n=Object(a.useReducer)(In,An),r=Object(o.a)(n,2),c=r[0],i=r[1],s=Object(a.useMemo)((function(){return{state:c,dispatch:i}}),[c,i]);return Object(u.jsx)(kn.Provider,{value:s,children:t})},Dn=Object(pe.a)((function(){return Object(xn.a)({tabsContent:{height:"200px"}})})),Mn="Bearer ",Nn=[{title:"No auth",id:"NO_AUTH"},{title:"Basic Auth",id:"BASIC_AUTH"},{title:"Bearer Token",id:"BEARER_AUTH"}],Ln=function(e){var t=Dn(),n=e.onClose,r=e.open,c=Un(),i=c.saveAuthLocally,s=c.basicData,l=c.bearerData,d=c.authMethod,j=Object(a.useContext)(kn).dispatch,b=Object(a.useState)(i),O=Object(o.a)(b,2),f=O[0],x=O[1],v=Object(a.useState)(s||{password:"",login:""}),y=Object(o.a)(v,2),g=y[0],S=y[1],E=Object(a.useState)((null===l||void 0===l?void 0:l.token)||Mn),_=Object(o.a)(E,2),T=_[0],C=_[1],A=Object(a.useState)(Nn.findIndex((function(e){return e.id===d}))||0),R=Object(o.a)(A,2),I=R[0],k=R[1],U=function(){n()};return Object(u.jsxs)(cn.a,{onClose:U,"aria-labelledby":"simple-dialog-title",open:r,children:[Object(u.jsx)(rn.a,{id:"simple-dialog-title",children:"Request Auth Settings"}),Object(u.jsxs)(on.a,{children:[Object(u.jsx)(sn.a,{children:"This affects Authorization header sent to the server you specify. Not shown in URL and can be optionally stored on a client side"}),Object(u.jsx)(ln.a,{value:I,onChange:function(e,t){k(t)},indicatorColor:"primary",textColor:"primary",children:Nn.map((function(e){return Object(u.jsx)(un.a,{label:e.title},e.id)}))}),Object(u.jsxs)(h.a,{p:0,display:"flex",flexDirection:"column",className:t.tabsContent,children:[Object(u.jsxs)(h.a,{flexGrow:1,children:[Object(u.jsx)(mn,{value:I,index:0,children:Object(u.jsx)(p.a,{style:{fontStyle:"italic"},children:"No Authorization Header"})}),Object(u.jsxs)(mn,{value:I,index:1,children:[Object(u.jsxs)(dn.a,{margin:"dense",fullWidth:!0,children:[Object(u.jsx)(jn.a,{htmlFor:"basic-login",children:"User"}),Object(u.jsx)(bn.a,{id:"basic-login",startAdornment:Object(u.jsx)(On.a,{position:"start",children:Object(u.jsx)(gn.a,{})}),required:!0,onChange:function(e){return S((function(t){return Object(w.a)(Object(w.a)({},t),{},{login:e.target.value||""})}))},value:(null===g||void 0===g?void 0:g.login)||""})]}),Object(u.jsxs)(dn.a,{margin:"dense",fullWidth:!0,children:[Object(u.jsx)(jn.a,{htmlFor:"basic-pass",children:"Password"}),Object(u.jsx)(bn.a,{id:"basic-pass",startAdornment:Object(u.jsx)(On.a,{position:"start",children:Object(u.jsx)(En.a,{})}),onChange:function(e){return S((function(t){return Object(w.a)(Object(w.a)({},t),{},{password:e.target.value||""})}))},value:(null===g||void 0===g?void 0:g.password)||""})]})]}),Object(u.jsx)(mn,{value:I,index:2,children:Object(u.jsx)(lt.a,{id:"bearer-auth",label:"Bearer token",multiline:!0,fullWidth:!0,value:T,onChange:function(e){var t=e.target.value;t.startsWith(Mn)?C(t):C(Mn)},InputProps:{onPaste:function(e){var t=e.clipboardData.getData("text/plain");t.startsWith(Mn)?C(t):C(Mn+t),e.preventDefault()}},maxRows:6})})]}),Object(u.jsxs)(dn.a,{children:[Object(u.jsx)(m.a,{control:Object(u.jsx)(hn.a,{checked:f,onChange:function(){return x((function(e){return!e}))},name:"checkedB",color:"primary"}),label:"Persist Auth Data Locally"}),Object(u.jsx)(pn.a,{children:f?"Auth Data and the Selected method will be saved to LocalStorage":"Auth Data won't be saved. All previously saved Auth Data will be removed"})]})]})]}),Object(u.jsx)(fn.a,{children:Object(u.jsx)(bt.a,{onClick:function(){switch(I){case 0:j({type:"SET_NO_AUTH",payload:{checkbox:f}});break;case 1:j({type:"SET_BASIC_AUTH",payload:{checkbox:f,value:g}});break;case 2:j({type:"SET_BEARER_AUTH",payload:{checkbox:f,value:{token:T}}})}U()},color:"primary",children:"Apply"})})]})},qn=function(e){var t=e.error,n=de().serverUrl,r=je(),c=Object(a.useState)(!1),i=Object(o.a)(c,2),s=i[0],l=i[1];return Object(u.jsxs)(u.Fragment,{children:[Object(u.jsxs)(h.a,{display:"grid",gridTemplateColumns:"1fr auto",gap:"4px",alignItems:"center",width:"100%",mb:2,minHeight:50,children:[Object(u.jsx)(lt.a,{variant:"outlined",fullWidth:!0,label:"Server URL",value:n,error:t===$e.validServer||t===$e.emptyServer,inputProps:{style:{fontFamily:"Monospace"}},onChange:function(e){var t=e.target.value;r({type:"SET_SERVER",payload:t})}}),Object(u.jsx)(h.a,{children:Object(u.jsx)(y.a,{title:"Request Auth Settings",children:Object(u.jsx)(g.a,{onClick:function(){return l(!0)},children:Object(u.jsx)(an.a,{})})})})]}),Object(u.jsx)(Ln,{open:s,onClose:function(){return l(!1)}})]})},Yn=function(){var e=de().queryControls,t=e.autocomplete,n=e.nocache,a=je();return Object(u.jsxs)(h.a,{display:"flex",alignItems:"center",children:[Object(u.jsx)(h.a,{children:Object(u.jsx)(m.a,{label:"Enable autocomplete",control:Object(u.jsx)(ve,{checked:t,onChange:function(){a({type:"TOGGLE_AUTOCOMPLETE"}),J("AUTOCOMPLETE",!t)}})})}),Object(u.jsx)(h.a,{ml:2,children:Object(u.jsx)(m.a,{label:"Enable cache",control:Object(u.jsx)(ve,{checked:!n,onChange:function(){a({type:"NO_CACHE"}),J("NO_CACHE",!n)}})})})]})},Bn=function(e){var t=e.error,n=de(),r=n.serverUrl,c=n.query,i=n.queryHistory,s=n.time.duration,l=n.queryControls.autocomplete,d=je(),j=Object(a.useState)(!0),b=Object(o.a)(j,2),O=b[0],f=b[1],x=Object(a.useState)(c),v=Object(o.a)(x,2),m=v[0],S=v[1],E=Object(a.useRef)(m),_=Object(a.useRef)(null),w=function(e){E.current=e,S(e)},T=function(){var e=i.map((function(e,t){var n=m[t]===e.values[e.values.length-1];return{index:e.values.length-Number(n),values:n?e.values:[].concat(Object(Ue.a)(e.values),[m[t]])}}));d({type:"RUN_QUERY"}),d({type:"SET_QUERY_HISTORY",payload:e}),d({type:"SET_QUERY",payload:E.current})},C=function(e,t){var n=Object(Ue.a)(E.current);n[t]=e,w(n)},A=function(e,t){var n=i[t],a=n.index,r=n.values,c=a+e;if(!(c<0||c>=r.length)){var o=r[c]||"";C(o,t),d({type:"SET_QUERY_HISTORY_BY_INDEX",payload:{value:{values:r,index:c},queryNumber:t}})}};return Object(u.jsx)(u.Fragment,{children:Object(u.jsxs)(Rt.a,{expanded:O,onChange:function(){return f((function(e){return!e}))},children:[Object(u.jsxs)(It.a,{expandIcon:Object(u.jsx)(g.a,{children:Object(u.jsx)(Jt.a,{})}),"aria-controls":"panel1a-content",id:"panel1a-header",sx:{alignItems:"flex-start",padding:"15px"},children:[Object(u.jsx)(h.a,{mr:2,children:Object(u.jsx)(p.a,{variant:"h6",component:"h2",children:"Query Configuration"})}),Object(u.jsx)(h.a,{flexGrow:1,onClick:function(e){return e.stopPropagation()},onFocusCapture:function(e){return e.stopPropagation()},children:Object(u.jsx)(tn.a,{disablePortal:!O,container:_.current,children:c.map((function(e,n){return Object(u.jsxs)(h.a,{display:"grid",gridTemplateColumns:"1fr auto",gap:"4px",width:"100%",mb:n===c.length-1?0:2,children:[Object(u.jsx)(qt,{server:r,query:m[n],index:n,oneLiner:!O,autocomplete:l,queryHistory:i[n],error:t,setHistoryIndex:A,runQuery:T,setQuery:C}),0===n&&Object(u.jsx)(y.a,{title:"Execute Query",children:Object(u.jsx)(g.a,{onClick:T,children:Object(u.jsx)(en.a,{})})}),n>0&&Object(u.jsx)(y.a,{title:"Remove Query",children:Object(u.jsx)(g.a,{onClick:function(){return function(e){var t=Object(Ue.a)(m);t.splice(e,1),w(t),T()}(n)},children:Object(u.jsx)(Kt.a,{})})})]},"".concat(n,"_").concat(e))}))})})]}),Object(u.jsx)(kt.a,{children:Object(u.jsxs)(Ut.a,{container:!0,columnSpacing:2,children:[Object(u.jsxs)(Ut.a,{item:!0,xs:6,minWidth:400,children:[Object(u.jsx)(qn,{error:t}),Object(u.jsx)("div",{ref:_}),c.length<2&&Object(u.jsx)(h.a,{display:"inline-block",minHeight:"40px",mt:2,children:Object(u.jsxs)(bt.a,{onClick:function(){var e=[].concat(Object(Ue.a)(m),[""]);w(e),d({type:"SET_QUERY",payload:e})},variant:"outlined",children:[Object(u.jsx)(Zt.a,{sx:{fontSize:16,marginRight:"4px"}}),Object(u.jsx)("span",{style:{lineHeight:1,paddingTop:"1px"},children:"Query"})]})})]}),Object(u.jsx)(Ut.a,{item:!0,xs:!0,children:Object(u.jsx)(Gt,{setDuration:function(e){return d({type:"SET_DURATION",payload:e})},duration:s})}),Object(u.jsx)(Ut.a,{item:!0,xs:12,pt:1,children:Object(u.jsx)(Yn,{})})]})})]})})},Pn=n(81),Fn=n.n(Pn),zn=n(166),Qn=n(167),Gn=function(){var e=de(),t=e.query,n=e.displayType,r=e.serverUrl,c=e.time.period,i=e.queryControls.nocache,s=Un(),l=s.basicData,u=s.bearerData,d=s.authMethod,j=Object(a.useState)(!1),b=Object(o.a)(j,2),O=b[0],h=b[1],p=Object(a.useState)(),f=Object(o.a)(p,2),x=f[0],v=f[1],m=Object(a.useState)(),y=Object(o.a)(m,2),g=y[0],S=y[1],E=Object(a.useState)(),_=Object(o.a)(E,2),T=_[0],C=_[1],A=Object(a.useState)(),R=Object(o.a)(A,2),I=R[0],k=R[1];Object(a.useEffect)((function(){T&&(v(void 0),S(void 0))}),[T]);var U=Object(a.useMemo)((function(){if(!I)return!0;var e=(I.end-I.start)/3,t=e/(c.end-c.start)>=.7,n=c.end>I.end+e,a=c.start<I.start-e;return t||n||a}),[c]),H=function(){var e=Object(zn.a)(Fn.a.mark((function e(){var t,a,r,i,o,s;return Fn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===D||void 0===D?void 0:D.length){e.next=2;break}return e.abrupt("return");case 2:return h(!0),k(c),t=new Headers,"BASIC_AUTH"===d&&t.set("Authorization","Basic "+btoa("".concat((null===l||void 0===l?void 0:l.login)||"",":").concat((null===l||void 0===l?void 0:l.password)||""))),"BEARER_AUTH"===d&&t.set("Authorization",(null===u||void 0===u?void 0:u.token)||""),e.prev=7,e.delegateYield(Fn.a.mark((function e(){var c,l,u,d,j,b;return Fn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(D.map((function(e){return fetch(e,{headers:t})})));case 2:c=e.sent,l=[],u=1,a=!1,r=!1,e.prev=7,o=Object(Qn.a)(c);case 9:return e.next=11,o.next();case 11:if(!(a=!(s=e.sent).done)){e.next=39;break}if(!(d=s.value).ok){e.next=22;break}return e.next=16,d.json();case 16:j=e.sent,C(void 0),l.push.apply(l,Object(Ue.a)(j.data.result.map((function(e){return e.group=u,e})))),u++,e.next=36;break;case 22:return e.t0=C,e.next=25,d.json();case 25:if(e.t2=b=e.sent,e.t1=null===e.t2,e.t1){e.next=29;break}e.t1=void 0===b;case 29:if(!e.t1){e.next=33;break}e.t3=void 0,e.next=34;break;case 33:e.t3=b.error;case 34:e.t4=e.t3,(0,e.t0)(e.t4);case 36:a=!1,e.next=9;break;case 39:e.next=45;break;case 41:e.prev=41,e.t5=e.catch(7),r=!0,i=e.t5;case 45:if(e.prev=45,e.prev=46,!a||null==o.return){e.next=50;break}return e.next=50,o.return();case 50:if(e.prev=50,!r){e.next=53;break}throw i;case 53:return e.finish(50);case 54:return e.finish(45);case 55:"chart"===n?v(l):S(l);case 56:case"end":return e.stop()}}),e,null,[[7,41,45,55],[46,,50,54]])}))(),"t0",9);case 9:e.next=14;break;case 11:e.prev=11,e.t1=e.catch(7),e.t1 instanceof Error&&C(e.t1.message);case 14:h(!1);case 15:case"end":return e.stop()}}),e,null,[[7,11]])})));return function(){return e.apply(this,arguments)}}(),D=Object(a.useMemo)((function(){if(c)if(r)if(t.every((function(e){return!e.trim()})))C($e.validQuery);else{if(function(e){var t;try{t=new URL(e)}catch(n){return!1}return"http:"===t.protocol||"https:"===t.protocol}(r)){var e=(c.end-c.start)/2,a=Object(w.a)(Object(w.a)({},c),{},{start:c.start-e,end:c.end+e});return t.filter((function(e){return e.trim()})).map((function(e){return"chart"===n?function(e,t,n,a){return"".concat(e,"/api/v1/query_range?query=").concat(encodeURIComponent(t),"&start=").concat(n.start,"&end=").concat(n.end,"&step=").concat(n.step).concat(a?"&nocache=1":"")}(r,e,a,i):function(e,t,n){return"".concat(e,"/api/v1/query?query=").concat(encodeURIComponent(t),"&start=").concat(n.start,"&end=").concat(n.end,"&step=").concat(n.step)}(r,e,c)}))}C($e.validServer)}else C($e.emptyServer)}),[r,c,n]);return Object(a.useEffect)((function(){k(void 0),H()}),[t]),Object(a.useEffect)((function(){H()}),[r,n]),Object(a.useEffect)((function(){U&&H()}),[c]),{fetchUrl:D,isLoading:O,graphData:x,liveData:g,error:T}},Wn=function(e){var t=e.data,n=Object(a.useContext)(d).showInfoMessage,r=Object(a.useMemo)((function(){return JSON.stringify(t,null,2)}),[t]);return Object(u.jsxs)(h.a,{position:"relative",children:[Object(u.jsx)(h.a,{flexDirection:"column",justifyContent:"flex-end",display:"flex",style:{position:"fixed",right:"16px"},children:Object(u.jsx)(bt.a,{variant:"outlined",onClick:function(e){navigator.clipboard.writeText(r),n("Formatted JSON has been copied"),e.preventDefault()},children:"Copy JSON"})}),Object(u.jsx)("pre",{children:r})]})},Jn=function(){var e=de(),t=e.displayType,n=e.time.period,a=Gn(),r=a.isLoading,c=a.liveData,i=a.graphData,o=a.error;return Object(u.jsxs)(u.Fragment,{children:[Object(u.jsx)(b.a,{position:"static",children:Object(u.jsxs)(O.a,{children:[Object(u.jsxs)(h.a,{display:"flex",children:[Object(u.jsxs)(p.a,{variant:"h5",children:[Object(u.jsx)("span",{style:{fontWeight:"bolder"},children:"VM"}),Object(u.jsx)("span",{style:{fontWeight:"lighter"},children:"UI"})]}),Object(u.jsx)("div",{style:{fontSize:"10px",marginTop:"-2px"},children:Object(u.jsx)("div",{children:"BETA"})})]}),Object(u.jsx)("div",{style:{fontSize:"10px",position:"absolute",top:"40px",opacity:".4"},children:Object(u.jsx)(f.a,{color:"inherit",href:"https://github.com/VictoriaMetrics/VictoriaMetrics/issues/new",target:"_blank",children:"Create an issue"})}),Object(u.jsx)(h.a,{ml:4,flexGrow:1,children:Object(u.jsx)(ye,{})}),Object(u.jsx)(ke,{})]})}),Object(u.jsxs)(h.a,{p:4,display:"grid",gridTemplateRows:"auto 1fr",gap:"20px",style:{minHeight:"calc(100vh - 64px)"},children:[Object(u.jsx)(h.a,{children:Object(u.jsx)(Bn,{error:o})}),Object(u.jsxs)(h.a,{height:"100%",children:[r&&Object(u.jsx)(x.a,{in:r,style:{transitionDelay:r?"300ms":"0ms"},children:Object(u.jsx)(h.a,{alignItems:"center",justifyContent:"center",flexDirection:"column",display:"flex",style:{width:"100%",maxWidth:"calc(100vw - 32px)",position:"absolute",height:"50%",background:"linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.7), rgba(255,255,255,0))"},children:Object(u.jsx)(v.a,{})})}),Object(u.jsxs)(h.a,{height:"100%",bgcolor:"#fff",children:[o&&Object(u.jsx)(l.a,{color:"error",severity:"error",style:{fontSize:"14px"},children:o}),i&&n&&"chart"===t&&Object(u.jsx)(yt,{data:i}),c&&"code"===t&&Object(u.jsx)(Wn,{data:c}),c&&"table"===t&&Object(u.jsx)(At,{data:c})]})]})]})]})},Vn=n(310),Kn=n(353),Xn=n(173),Zn=Object(Xn.a)({palette:{primary:{main:"#3F51B5"},secondary:{main:"#F50057"},error:{main:"#FF4141"}},components:{MuiInputLabel:{styleOverrides:{root:{fontSize:"12px",letterSpacing:"normal",lineHeight:"1"}}},MuiInputBase:{styleOverrides:{root:{"&.Mui-focused fieldset":{borderWidth:"1px !important"}}}},MuiSwitch:{defaultProps:{color:"secondary"}},MuiAccordion:{styleOverrides:{root:{boxShadow:"rgba(0, 0, 0, 0.16) 0px 1px 4px;"}}},MuiPaper:{styleOverrides:{elevation3:{boxShadow:"rgba(0, 0, 0, 0.2) 0px 3px 8px;"}}},MuiIconButton:{defaultProps:{size:"large"},styleOverrides:{sizeLarge:{borderRadius:"20%",height:"40px",width:"41px"},sizeMedium:{borderRadius:"20%"},sizeSmall:{borderRadius:"20%"}}}},typography:{fontSize:10}}),$n=n(309),ea=n(305),ta=n(168),na=function(){return Object(u.jsxs)(u.Fragment,{children:[Object(u.jsx)($n.a,{})," ",Object(u.jsxs)(ea.b,{dateAdapter:ta.a,children:[" ",Object(u.jsx)(Vn.a,{injectFirst:!0,children:Object(u.jsxs)(Kn.a,{theme:Zn,children:["  ",Object(u.jsxs)(Oe,{children:[" ",Object(u.jsxs)(Hn,{children:[" ",Object(u.jsxs)(Be,{children:[" ",Object(u.jsxs)(j,{children:[" ",Object(u.jsx)(Jn,{})]})]})]})]})]})})]})]})},aa=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,355)).then((function(t){var n=t.getCLS,a=t.getFID,r=t.getFCP,c=t.getLCP,i=t.getTTFB;n(e),a(e),r(e),c(e),i(e)}))};i.a.render(Object(u.jsx)(r.a.StrictMode,{children:Object(u.jsx)(na,{})}),document.getElementById("root")),aa()}},[[234,1,2]]]);
\ No newline at end of file
diff --git a/app/vmselect/vmui/static/js/main.9f03a409.chunk.js b/app/vmselect/vmui/static/js/main.9f03a409.chunk.js
deleted file mode 100644
index 11ee4e722..000000000
--- a/app/vmselect/vmui/static/js/main.9f03a409.chunk.js
+++ /dev/null
@@ -1,1 +0,0 @@
-(this.webpackJsonpvmui=this.webpackJsonpvmui||[]).push([[0],{204:function(e,t,n){},219:function(e,t){},223:function(e,t,n){},224:function(e,t,n){},234:function(e,t,n){"use strict";n.r(t);var a=n(1),r=n.n(a),c=n(53),i=n.n(c),o=(n(204),n(9)),s=n(317),l=n(316),u=n(0),d=Object(a.createContext)({showInfoMessage:function(){}}),j=function(e){var t=e.children,n=Object(a.useState)({}),r=Object(o.a)(n,2),c=r[0],i=r[1],j=Object(a.useState)(!1),b=Object(o.a)(j,2),O=b[0],h=b[1],f=Object(a.useState)(void 0),p=Object(o.a)(f,2),x=p[0],v=p[1];Object(a.useEffect)((function(){x&&(i({message:x,key:(new Date).getTime()}),h(!0))}),[x]);return Object(u.jsxs)(d.Provider,{value:{showInfoMessage:v},children:[Object(u.jsx)(s.a,{open:O,autoHideDuration:4e3,onClose:function(e,t){"clickaway"!==t&&(v(void 0),h(!1))},children:Object(u.jsx)(l.a,{children:c.message})},c.key),t]})},b=n(351),O=n(352),h=n(327),f=n(245),p=n(343),x=n(241),v=n(328),m=n(330),g=n(322),y=n(326),E=n(148),S=n.n(E),_=n(3),w=n(17),T=n(39),C=n.n(T),A=n(144),R=n.n(A),I=n(145),k=n.n(I),U=n(105),D=n.n(U);C.a.extend(R.a),C.a.extend(k.a);var H,M=window.innerWidth/2,N=1,L=1578e8,Y="YYYY-MM-DD[T]HH:mm:ss",P=[{long:"days",short:"d",possible:"day"},{long:"weeks",short:"w",possible:"week"},{long:"months",short:"M",possible:"mon"},{long:"years",short:"y",possible:"year"},{long:"hours",short:"h",possible:"hour"},{long:"minutes",short:"m",possible:"min"},{long:"seconds",short:"s",possible:"sec"},{long:"milliseconds",short:"ms",possible:"millisecond"}],B=P.map((function(e){return e.short})),q=function(e){return+D()(e).format("0.000")},F=function(e){var t=e.match(/\d+/g),n=e.match(/[a-zA-Z]+/g);if(n&&t&&B.includes(n[0]))return Object(_.a)({},n[0],t[0])},z=function(e,t){var n=(t||new Date).valueOf()/1e3,a=e.trim().split(" ").reduce((function(e,t){var n=F(t);return n?Object(w.a)(Object(w.a)({},e),n):Object(w.a)({},e)}),{}),r=C.a.duration(a).asSeconds();return{start:n-r,end:n,step:q(r/M)||.001,date:Q(t||new Date)}},Q=function(e){return C()(e).utc().format(Y)},G=function(e){var t=Math.floor(e%1e3),n=Math.floor(e/1e3%60),a=Math.floor(e/1e3/60%60),r=Math.floor(e/1e3/3600%24),c=Math.floor(e/864e5),i=["d","h","m","s","ms"];return[c,r,a,n,t].map((function(e,t){return e?"".concat(e).concat(i[t]):""})).filter((function(e){return e})).join(" ")},W=function(e){return new Date(1e3*e)},J=function(e,t){t?window.localStorage.setItem(e,JSON.stringify({value:t})):K([e])},V=function(e){var t=window.localStorage.getItem(e);if(null!==t)try{var n;return null===(n=JSON.parse(t))||void 0===n?void 0:n.value}catch(a){return t}},K=function(e){return e.forEach((function(e){return window.localStorage.removeItem(e)}))},X=["BASIC_AUTH_DATA","BEARER_AUTH_DATA"],Z=n(146),$=n.n(Z),ee=n(116),te=n.n(ee),ne={"time.duration":"range_input","time.period.date":"end_input","time.period.step":"step_input",displayType:"tab"},ae=function(e){var t=new Map(Object.entries(ne)),n=te()(e,"query",""),a=[];n.forEach((function(n,r){t.forEach((function(t,n){var c=te()(e,n,"");if(c){var i=encodeURIComponent(c);a.push("g".concat(r,".").concat(t,"=").concat(i))}})),a.push("g".concat(r,".expr=").concat(n))})),function(e){var t=window;if(t){var n="".concat(t.location.protocol,"//").concat(t.location.host).concat(t.location.pathname,"?").concat(e);t.history.pushState({path:n},"",n)}}(a.join("&"))},re=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.location.search,a=$.a.parse(n,{ignoreQueryPrefix:!0});return te()(a,e,t||"")},ce=re("g0.range_input","1h"),ie=(H=re("g0.end_input",new Date(C()().utc().format(Y))),C()(H).utcOffset(0,!0).local().format(Y)),oe=function(){var e,t=(null===(e=window.location.search.match(/g\d+.expr/gim))||void 0===e?void 0:e.length)||1;return new Array(t).fill(1).map((function(e,t){return re("g".concat(t,".expr"),"")}))}(),se={serverUrl:window.location.href.replace(/\/(?:prometheus\/)?(?:graph|vmui)\/.*/,"/prometheus/"),displayType:re("tab","chart"),query:oe,queryHistory:oe.map((function(e){return{index:0,values:[e]}})),time:{duration:ce,period:z(ce,new Date(ie))},queryControls:{autoRefresh:!1,autocomplete:V("AUTOCOMPLETE")||!1,nocache:V("NO_CACHE")||!1}};function le(e,t){switch(t.type){case"SET_DISPLAY_TYPE":return Object(w.a)(Object(w.a)({},e),{},{displayType:t.payload});case"SET_SERVER":return Object(w.a)(Object(w.a)({},e),{},{serverUrl:t.payload});case"SET_QUERY":return Object(w.a)(Object(w.a)({},e),{},{query:t.payload});case"SET_QUERY_HISTORY":return Object(w.a)(Object(w.a)({},e),{},{queryHistory:t.payload});case"SET_QUERY_HISTORY_BY_INDEX":return Object(w.a)(Object(w.a)({},e),{},{queryHistory:e.queryHistory.splice(t.payload.queryNumber,1,t.payload.value)});case"SET_DURATION":return Object(w.a)(Object(w.a)({},e),{},{time:Object(w.a)(Object(w.a)({},e.time),{},{duration:t.payload,period:z(t.payload,W(e.time.period.end))})});case"SET_UNTIL":return Object(w.a)(Object(w.a)({},e),{},{time:Object(w.a)(Object(w.a)({},e.time),{},{period:z(e.time.duration,t.payload)})});case"SET_PERIOD":var n=function(e){var t=e.to.valueOf()-e.from.valueOf();return G(t)}(t.payload);return Object(w.a)(Object(w.a)({},e),{},{queryControls:Object(w.a)(Object(w.a)({},e.queryControls),{},{autoRefresh:!1}),time:Object(w.a)(Object(w.a)({},e.time),{},{duration:n,period:z(n,t.payload.to)})});case"TOGGLE_AUTOREFRESH":return Object(w.a)(Object(w.a)({},e),{},{queryControls:Object(w.a)(Object(w.a)({},e.queryControls),{},{autoRefresh:!e.queryControls.autoRefresh})});case"TOGGLE_AUTOCOMPLETE":return Object(w.a)(Object(w.a)({},e),{},{queryControls:Object(w.a)(Object(w.a)({},e.queryControls),{},{autocomplete:!e.queryControls.autocomplete})});case"NO_CACHE":return Object(w.a)(Object(w.a)({},e),{},{queryControls:Object(w.a)(Object(w.a)({},e.queryControls),{},{nocache:!e.queryControls.nocache})});case"RUN_QUERY":return Object(w.a)(Object(w.a)({},e),{},{time:Object(w.a)(Object(w.a)({},e.time),{},{period:z(e.time.duration,W(e.time.period.end))})});case"RUN_QUERY_TO_NOW":return Object(w.a)(Object(w.a)({},e),{},{time:Object(w.a)(Object(w.a)({},e.time),{},{period:z(e.time.duration)})});default:throw new Error}}var ue=Object(a.createContext)({}),de=function(){return Object(a.useContext)(ue).state},je=function(){return Object(a.useContext)(ue).dispatch},be=Object.entries(se).reduce((function(e,t){var n=Object(o.a)(t,2),a=n[0],r=n[1];return Object(w.a)(Object(w.a)({},e),{},Object(_.a)({},a,re(a)||r))}),{}),Oe=function(e){var t=e.children,n=Object(a.useReducer)(le,be),r=Object(o.a)(n,2),c=r[0],i=r[1];Object(a.useEffect)((function(){ae(c)}),[c]);var s=Object(a.useMemo)((function(){return{state:c,dispatch:i}}),[c,i]);return Object(u.jsx)(ue.Provider,{value:s,children:t})},he=function(e){return Object(u.jsxs)(h.a,{position:"relative",display:"inline-flex",children:[Object(u.jsx)(v.a,Object(w.a)({variant:"determinate"},e)),Object(u.jsx)(h.a,{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",children:Object(u.jsx)(f.a,{variant:"caption",component:"div",children:"".concat(e.label,"s")})})]})},fe=n(313),pe=n(10),xe=n(329),ve=Object(pe.a)(xe.a)((function(){return{padding:10,"& .MuiSwitch-track":{borderRadius:14,"&:before, &:after":{content:'""',position:"absolute",top:"50%",transform:"translateY(-50%)",width:14,height:14}},"& .MuiSwitch-thumb":{boxShadow:"none",width:12,height:12,margin:4}}})),me=Object(fe.a)({colorizing:{color:"white"}}),ge=function(){var e=me(),t=je(),n=de().queryControls.autoRefresh,c=Object(a.useState)(5),i=Object(o.a)(c,2),s=i[0],l=i[1],d=Object(a.useState)(),j=Object(o.a)(d,2),b=j[0],O=j[1],f=r.a.useState(100),p=Object(o.a)(f,2),x=p[0],v=p[1];Object(a.useEffect)((function(){var e;return n&&(O((new Date).valueOf()),e=setInterval((function(){O((new Date).valueOf()),t({type:"RUN_QUERY_TO_NOW"})}),1e3*s)),function(){e&&clearInterval(e)}}),[s,n]),Object(a.useEffect)((function(){var e=setInterval((function(){if(n&&b){var e=((new Date).valueOf()-b)/1e3,t=Math.floor(e/s*100);v(t)}}),16);return function(){clearInterval(e)}}),[n,b,s]);var E=function(){l((function(e){switch(e){case 1:return 2;default:return 5;case 5:return 1}}))};return Object(u.jsxs)(h.a,{display:"flex",alignItems:"center",children:[Object(u.jsx)(m.a,{control:Object(u.jsx)(ve,{className:e.colorizing,checked:n,onChange:function(){t({type:"TOGGLE_AUTOREFRESH"})}}),label:"Auto-refresh"}),n&&Object(u.jsxs)(u.Fragment,{children:[Object(u.jsx)(he,{className:e.colorizing,label:s,value:x,onClick:function(){E()}}),Object(u.jsx)(g.a,{title:"Change delay refresh",children:Object(u.jsx)(h.a,{ml:1,children:Object(u.jsx)(y.a,{onClick:function(){E()},children:Object(u.jsx)(S.a,{style:{color:"white"}})})})})]})]})},ye=n(151),Ee=n.n(ye),Se=n(149),_e=n.n(Se),we=n(150),Te=n.n(we),Ce=n(332),Ae=n(323),Re=n(331),Ie=Object(Re.a)({root:{display:"grid",gridTemplateColumns:"18px auto",gridGap:6,padding:"8px 12px",color:"white",lineHeight:"19px","&.Mui-selected":{color:"white"}}})(Ce.a),ke=function(){var e=de().displayType,t=je();return Object(u.jsxs)(Ae.a,{value:e,exclusive:!0,onChange:function(n,a){return t({type:"SET_DISPLAY_TYPE",payload:null!==a&&void 0!==a?a:e})},children:[Object(u.jsxs)(Ie,{value:"chart","aria-label":"display as chart",children:[Object(u.jsx)(_e.a,{}),Object(u.jsx)("span",{children:"Query Range as Chart"})]}),Object(u.jsxs)(Ie,{value:"code","aria-label":"display as code",children:[Object(u.jsx)(Te.a,{}),Object(u.jsx)("span",{children:"Instant Query as JSON"})]}),Object(u.jsxs)(Ie,{value:"table","aria-label":"display as table",children:[Object(u.jsx)(Ee.a,{}),Object(u.jsx)("span",{children:"Instant Query as Table"})]})]})},Ue=n(21),De=n(152),He={yaxis:{limits:{enable:!1,range:{1:[0,0]}}}};function Me(e,t){switch(t.type){case"TOGGLE_ENABLE_YAXIS_LIMITS":return Object(w.a)(Object(w.a)({},e),{},{yaxis:Object(w.a)(Object(w.a)({},e.yaxis),{},{limits:Object(w.a)(Object(w.a)({},e.yaxis.limits),{},{enable:!e.yaxis.limits.enable})})});case"SET_YAXIS_LIMITS":return Object(w.a)(Object(w.a)({},e),{},{yaxis:Object(w.a)(Object(w.a)({},e.yaxis),{},{limits:Object(w.a)(Object(w.a)({},e.yaxis.limits),{},{range:t.payload})})});default:throw new Error}}var Ne,Le=Object(a.createContext)({}),Ye=function(){return Object(a.useContext)(Le).state},Pe=function(){return Object(a.useContext)(Le).dispatch},Be=function(e){var t=e.children,n=Object(a.useReducer)(Me,He),r=Object(o.a)(n,2),c=r[0],i=r[1],s=Object(a.useMemo)((function(){return{state:c,dispatch:i}}),[c,i]);return Object(u.jsx)(Le.Provider,{value:s,children:t})},qe=function(e){if(7!=e.length)return"0, 0, 0";var t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16);return"".concat(t,", ").concat(n,", ").concat(a)},Fe={height:500,legend:{show:!1},cursor:{drag:{x:!1,y:!1},focus:{prox:30},bind:{mouseup:function(){return null},mousedown:function(){return null},click:function(){return null},dblclick:function(){return null},mouseenter:function(){return null}}}},ze=function(e,t){return t.map((function(e){return e>1e3?D()(e).format("0.0a"):e}))},Qe=function(e,t){return function(e){for(var t=0,n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);for(var a="#",r=0;r<3;r++)a+=("00"+(t>>8*r&255).toString(16)).substr(-2);return a}("".concat(e).concat(t))},Ge=function(e){return e<=1?[]:[4*e,1.2*e]},We=function(e){for(var t=e.length,n=-1/0;t--;)e[t]>n&&(n=e[t]);return n},Je=function(e){for(var t=e.length,n=1/0;t--;)e[t]<n&&(n=e[t]);return n},Ve=function(e){return Array.from(new Set(e.map((function(e){return e.scale})))).map((function(e){var t={scale:e,show:!0,font:"10px Arial",values:ze};return e?Number(e)%2?t:Object(w.a)(Object(w.a)({},t),{},{side:1}):{space:80}}))},Ke=function(e){var t,n,a=e.u,r=e.tooltipIdx,c=e.metrics,i=e.series,o=e.tooltip,s=e.tooltipOffset,l=r.seriesIdx,u=r.dataIdx,d=a.data[l][u],j=a.data[0][u],b=(null===(t=c[l-1])||void 0===t?void 0:t.metric)||{},O=Qe(Number(i[l].scale||0),i[l].label||""),h=a.over.getBoundingClientRect(),f=h.width,p=h.height,x=a.valToPos(d||0,(null===(n=i[l])||void 0===n?void 0:n.scale)||"1"),v=a.valToPos(j,"x"),m=o.getBoundingClientRect(),g=m.width,y=m.height,E=v+g>=f,S=x+y>=p;o.style.display="grid",o.style.top="".concat(s.top+x+10-(S?y+10:0),"px"),o.style.left="".concat(s.left+v+10-(E?g+20:0),"px");var _=C()(new Date(1e3*j)).format("YYYY-MM-DD HH:mm:ss:SSS (Z)"),w=Object.keys(b).filter((function(e){return"__name__"!==e})).map((function(e){return"<div><b>".concat(e,"</b>: ").concat(b[e],"</div>")})).join(""),T='<div class="u-tooltip__marker" style="background: '.concat(O,'"></div>');o.innerHTML="<div>".concat(_,'</div>\n                       <div class="u-tooltip-data">\n                         ').concat(T).concat(b.__name__||"",': <b class="u-tooltip-data__value">').concat(d,'</b>\n                       </div>\n                       <div class="u-tooltip__info">').concat(w,"</div>")},Xe=n(153),Ze=n.n(Xe);n(222),n(223);!function(e){e.xRange="xRange",e.yRange="yRange",e.data="data"}(Ne||(Ne={}));var $e=function(e){var t=e.data,n=e.series,r=e.metrics,c=void 0===r?[]:r,i=e.limits,s=je(),l=de().time.period,d=Ye().yaxis,j=Object(a.useRef)(null),b=Object(a.useRef)(null),O=Object(a.useState)(!1),h=Object(o.a)(O,2),f=h[0],p=h[1],x=Object(a.useState)(0),v=Object(o.a)(x,2),m=v[0],g=v[1],y=Object(a.useState)({min:l.start,max:l.end}),E=Object(o.a)(y,2),S=E[0],_=E[1],T=Object(a.useState)(),C=Object(o.a)(T,2),A=C[0],R=C[1],I=document.createElement("div");I.className="u-tooltip";var k={seriesIdx:1,dataIdx:0},U={left:0,top:0},D=Object(a.useCallback)(Ze()((function(e){var t=e.min,n=e.max;s({type:"SET_PERIOD",payload:{from:new Date(1e3*t),to:new Date(1e3*n)}})}),500),[]),H=function(e){var t=e.u,n=e.min,a=e.max,r=1e3*(a-n);r<N||r>L||(t.setScale("x",{min:n,max:a}),_({min:n,max:a}),D({min:n,max:a}))},M=function(){return[S.min,S.max]},Y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3?arguments[3]:void 0;return d.limits.enable?d.limits.range[a]:t&&n?[t-.05*t,n+.05*n]:i[a]},P=Object(w.a)(Object(w.a)({},Fe),{},{series:n,axes:Ve(n),scales:Object(w.a)({},function(){var e={x:{range:M}};return Object.keys(d.limits.range).forEach((function(t){e[t]={range:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Y(e,n,a,t)}}})),e}()),width:j.current?j.current.offsetWidth:400,plugins:[{hooks:{ready:function(e){var t,n=.85;U.left=parseFloat(e.over.style.left),U.top=parseFloat(e.over.style.top),null===(t=e.root.querySelector(".u-wrap"))||void 0===t||t.appendChild(I),e.over.addEventListener("mousedown",(function(t){return function(e){var t=e.e,n=e.factor,a=void 0===n?.85:n,r=e.u,c=e.setPanning,i=e.setPlotScale;if(0===t.button){t.preventDefault(),c(!0);var o=t.clientX,s=r.posToVal(1,"x")-r.posToVal(0,"x"),l=r.scales.x.min||0,u=r.scales.x.max||0,d=function(e){e.preventDefault();var t=s*((e.clientX-o)*a);i({u:r,min:l-t,max:u-t})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",(function e(){c(!1),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",e)}))}}({u:e,e:t,setPanning:p,setPlotScale:H,factor:n})})),e.over.addEventListener("wheel",(function(t){if(t.ctrlKey||t.metaKey){t.preventDefault();var a=e.over.getBoundingClientRect().width;e.cursor.left&&e.cursor.left>0&&g(e.cursor.left);var r=e.posToVal(m,"x"),c=(e.scales.x.max||0)-(e.scales.x.min||0),i=t.deltaY<0?c*n:c/n,o=r-m/a*i,s=o+i;e.batch((function(){return H({u:e,min:o,max:s})}))}}))},setCursor:function(e){k.dataIdx!==e.cursor.idx&&(k.dataIdx=e.cursor.idx||0,k.seriesIdx&&k.dataIdx&&Ke({u:e,tooltipIdx:k,metrics:c,series:n,tooltip:I,tooltipOffset:U}))},setSeries:function(e,t){k.seriesIdx!==t&&(k.seriesIdx=t||0,t&&k.dataIdx?Ke({u:e,tooltipIdx:k,metrics:c,series:n,tooltip:I,tooltipOffset:U}):I.style.display="none")}}}]}),B=function(e){if(A){switch(e){case Ne.xRange:A.scales.x.range=M;break;case Ne.yRange:Object.keys(d.limits.range).forEach((function(e){A.scales[e]&&(A.scales[e].range=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Y(t,n,a,e)})}));break;case Ne.data:A.setData(t)}A.redraw()}};return Object(a.useEffect)((function(){return _({min:l.start,max:l.end})}),[l]),Object(a.useEffect)((function(){if(b.current){var e=new De.a(P,t,b.current);return R(e),_({min:l.start,max:l.end}),e.destroy}}),[b.current,n]),Object(a.useEffect)((function(){return B(Ne.data)}),[t]),Object(a.useEffect)((function(){return B(Ne.xRange)}),[S]),Object(a.useEffect)((function(){return B(Ne.yRange)}),[d]),Object(u.jsx)("div",{ref:j,style:{pointerEvents:f?"none":"auto",height:"500px"},children:Object(u.jsx)("div",{ref:b})})},et=(n(224),function(e){var t=e.labels,n=e.onChange,r=de().query,c=Object(a.useMemo)((function(){return Array.from(new Set(t.map((function(e){return e.group}))))}),[t]);return Object(u.jsx)("div",{className:"legendWrapper",children:c.map((function(e){return Object(u.jsxs)("div",{className:"legendGroup",children:[Object(u.jsxs)("div",{className:"legendGroupTitle",children:[Object(u.jsx)("svg",{className:"legendGroupLine",width:"33",height:"3",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:Object(u.jsx)("line",{strokeWidth:"3",x1:"0",y1:"0",x2:"33",y2:"0",stroke:"#363636",strokeDasharray:Ge(e).join(",")})}),Object(u.jsxs)("b",{children:['"',r[e-1],'"']}),":"]}),Object(u.jsx)("div",{children:t.filter((function(t){return t.group===e})).map((function(e){return Object(u.jsxs)("div",{className:e.checked?"legendItem":"legendItem legendItemHide",onClick:function(t){return n(e,t.ctrlKey||t.metaKey)},children:[Object(u.jsx)("div",{className:"legendMarker",style:{borderColor:e.color,backgroundColor:"rgba(".concat(qe(e.color),", 0.1)")}}),Object(u.jsx)("div",{className:"legendLabel",children:e.label})]},"".concat(e.group,".").concat(e.label))}))})]},e)}))})}),tt=n(114),nt=["__name__"],at=function(e,t){var n=function(e){if(0===Object.keys(e.metric).length)return"Query result";var t=e.metric,n=t.__name__,a=Object(tt.a)(t,nt);return"".concat(n||""," {").concat(Object.entries(a).map((function(e){return"".concat(e[0],": ").concat(e[1])})).join(", "),"}")}(e);return{label:n,dash:Ge(e.group),width:1.5,stroke:Qe(e.group,n),show:!ct(n,e.group,t),scale:String(e.group)}},rt=function(e,t){return{group:t,label:e.label||"",color:e.stroke,checked:e.show||!1}},ct=function(e,t,n){return n.includes("".concat(t,".").concat(e))},it=n(156),ot=n.n(it),st=n(314),lt=n(154),ut=n.n(lt),dt=function(){var e=Ye().yaxis,t=Pe(),n=Object(a.useMemo)((function(){return Object.keys(e.limits.range)}),[e.limits.range]),r=Object(a.useCallback)(ut()((function(n,a,r){var c=e.limits.range;c[a][r]=+n.target.value,t({type:"SET_YAXIS_LIMITS",payload:c})}),500),[e.limits.range]);return Object(u.jsxs)(h.a,{display:"grid",alignItems:"center",gap:2,children:[Object(u.jsx)(m.a,{control:Object(u.jsx)(ve,{checked:e.limits.enable,onChange:function(){t({type:"TOGGLE_ENABLE_YAXIS_LIMITS"})}}),label:"Fix the limits for y-axis"}),Object(u.jsx)(h.a,{display:"grid",alignItems:"center",gap:4,children:n.map((function(t){return Object(u.jsxs)(h.a,{display:"grid",gridTemplateColumns:"120px 120px",gap:1,children:[Object(u.jsx)(st.a,{label:"Min ".concat(t),type:"number",size:"small",variant:"outlined",disabled:!e.limits.enable,defaultValue:e.limits.range[t][0],onChange:function(e){return r(e,t,0)}}),Object(u.jsx)(st.a,{label:"Max ".concat(t),type:"number",size:"small",variant:"outlined",disabled:!e.limits.enable,defaultValue:e.limits.range[t][1],onChange:function(e){return r(e,t,1)}})]},t)}))})]})},jt=n(324),bt=n(178),Ot=n(155),ht=n.n(Ot),ft=n(157),pt=n.n(ft),xt=Object(fe.a)({popover:{position:"absolute",display:"grid",gridGap:"16px",padding:"0 0 25px",zIndex:2},popoverHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"#3F51B5",padding:"6px 6px 6px 12px",borderRadius:"4px 4px 0 0",color:"#FFF",cursor:"move"},popoverBody:{padding:"0 14px"}}),vt=function(){var e=Object(a.useState)(!1),t=Object(o.a)(e,2),n=t[0],r=t[1],c=Object(a.useRef)(null),i=xt();return Object(u.jsxs)(h.a,{display:"flex",px:2,children:[Object(u.jsxs)(jt.a,{onClick:function(){return r((function(e){return!e}))},variant:"outlined",children:[Object(u.jsx)(ot.a,{sx:{fontSize:16,marginRight:"4px"}}),Object(u.jsxs)("span",{style:{lineHeight:1,paddingTop:"1px"},children:[n?"Hide":"Show"," graph settings"]})]}),n&&Object(u.jsx)(ht.a,{nodeRef:c,defaultPosition:{x:173,y:0},handle:"#handle",children:Object(u.jsxs)(bt.a,{elevation:3,className:i.popover,ref:c,children:[Object(u.jsxs)("div",{id:"handle",className:i.popoverHeader,children:[Object(u.jsx)(f.a,{variant:"body1",children:Object(u.jsx)("b",{children:"Graph Settings"})}),Object(u.jsx)(y.a,{size:"small",onClick:function(){return r(!1)},children:Object(u.jsx)(pt.a,{style:{color:"white"}})})]}),Object(u.jsx)(h.a,{className:i.popoverBody,children:Object(u.jsx)(dt,{})})]})})]})},mt=function(e){var t=e.data,n=void 0===t?[]:t,r=Pe(),c=Object(a.useState)([[]]),i=Object(o.a)(c,2),s=i[0],l=i[1],d=Object(a.useState)([]),j=Object(o.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)([]),f=Object(o.a)(h,2),p=f[0],x=f[1],v=Object(a.useState)([]),m=Object(o.a)(v,2),g=m[0],y=m[1],E=Object(a.useState)({1:[0,1]}),S=Object(o.a)(E,2),_=S[0],w=S[1],T=function(e){var t=function(e){var t={};for(var n in e){var a=e[n],r=Je(a),c=We(a);t[n]=[r-.05*r,c+.05*c]}return t}(e);w(t),r({type:"SET_YAXIS_LIMITS",payload:t})};return Object(a.useEffect)((function(){var e=[],t={},a=[],r=[];null===n||void 0===n||n.forEach((function(n){var c=at(n,g);r.push(c),a.push(rt(c,n.group)),n.values.forEach((function(a){e.push(a[0]),t[n.group]?t[n.group].push(+a[1]):t[n.group]=[+a[1]]}))}));var c=function(e){var t=Array.from(new Set(e)).sort((function(e,t){return e-t})),n=Je(t.map((function(e,n){return t[n+1]-e}))),a=t[0]||0;return new Array(t.length).fill(a).map((function(e,t){return q(e+n*t)}))}(e);l([c].concat(Object(Ue.a)(n.map((function(e){return new Array(c.length).fill(1).map((function(t,n){return e.values[n]?+e.values[n][1]:null}))}))))),T(t);var i=[{}].concat(r);JSON.stringify(i)!==JSON.stringify(b)&&(O(i),x(a))}),[n]),Object(a.useEffect)((function(){var e=[],t=[];null===n||void 0===n||n.forEach((function(n){var a=at(n,g);t.push(a),e.push(rt(a,n.group))})),O([{}].concat(t)),x(e)}),[g]),Object(u.jsx)(u.Fragment,{children:n.length>0?Object(u.jsxs)("div",{children:[Object(u.jsx)(vt,{}),Object(u.jsx)($e,{data:s,series:b,metrics:n,limits:_}),Object(u.jsx)(et,{labels:p,onChange:function(e,t){y(function(e){var t=e.hideSeries,n=e.legend,a=e.metaKey,r=e.series,c="".concat(n.group,".").concat(n.label),i=ct(n.label,n.group,t),o=r.map((function(e){return"".concat(e.scale,".").concat(e.label)}));return a&&i?Object(Ue.a)(o.filter((function(e){return e!==c}))):a&&!i?t.length>=r.length-1?[]:Object(Ue.a)(o.filter((function(e){return e!==c}))):i?t.filter((function(e){return e!==c})):[].concat(Object(Ue.a)(t),[c])}({hideSeries:g,legend:e,metaKey:t,series:b}))}})]}):Object(u.jsx)("div",{style:{textAlign:"center"},children:"No data to show"})})},gt=n(337),yt=n(338),Et=n(339),St=n(340),_t=n(341),wt=n(342),Tt=Object(fe.a)({deemphasized:{opacity:.4}}),Ct=function(e){var t=e.data,n=Tt(),r=function(e){return Object(a.useMemo)((function(){var t={};return e.forEach((function(e){return Object.entries(e.metric).forEach((function(e){return t[e[0]]?t[e[0]].options.add(e[1]):t[e[0]]={options:new Set([e[1]])}}))})),Object.entries(t).map((function(e){return{key:e[0],variations:e[1].options.size}})).sort((function(e,t){return e.variations-t.variations}))}),[e])}(t),c=Object(a.useMemo)((function(){return null===t||void 0===t?void 0:t.map((function(e){return{metadata:r.map((function(t){return e.metric[t.key]||"-"})),value:e.value?e.value[1]:"-"}}))}),[r,t]);return Object(u.jsx)(u.Fragment,{children:c.length>0?Object(u.jsx)(gt.a,{component:bt.a,children:Object(u.jsxs)(yt.a,{"aria-label":"simple table",children:[Object(u.jsx)(Et.a,{children:Object(u.jsxs)(St.a,{children:[r.map((function(e,t){return Object(u.jsx)(_t.a,{style:{textTransform:"capitalize"},children:e.key},t)})),Object(u.jsx)(_t.a,{align:"right",children:"Value"})]})}),Object(u.jsx)(wt.a,{children:c.map((function(e,t){return Object(u.jsxs)(St.a,{children:[e.metadata.map((function(e,a){var r=c[t-1]&&c[t-1].metadata[a];return Object(u.jsx)(_t.a,{className:r===e?n.deemphasized:void 0,children:e},a)})),Object(u.jsx)(_t.a,{align:"right",children:e.value})]},t)}))})]})}):Object(u.jsx)("div",{style:{textAlign:"center"},children:"No data to show"})})},At=n(320),Rt=n(349),It=n(350),kt=n(325),Ut=n(6),Dt=n(13),Ht=n(109),Mt=n(172),Nt=n(174),Lt=function(e){var t=e.index,n=e.query,r=e.queryHistory,c=e.setHistoryIndex,i=e.setQuery,s=e.runQuery,l=e.server,d=e.oneLiner,j=void 0!==d&&d,b=e.autocomplete,O=Object(a.useRef)(null),h=Object(a.useState)(),f=Object(o.a)(h,2),p=f[0],x=f[1];Object(a.useEffect)((function(){return O.current&&x(new Dt.d({parent:O.current})),function(){return null===p||void 0===p?void 0:p.destroy()}}),[]),Object(a.useEffect)((function(){var e=new Mt.a;e.activateCompletion(b),e.setComplete({remote:{url:l}});var a=Dt.d.updateListener.of((function(e){e.docChanged&&i(e.state.doc.toJSON().map((function(e){return e.trim()})).join(""),t)}));null===p||void 0===p||p.setState(Ut.f.create({doc:n,extensions:[Nt.a,Dt.k.of(Ht.a),a,e.asExtension()]}))}),[l,p,b,r]);return Object(u.jsx)(u.Fragment,{children:Object(u.jsx)("div",{ref:O,className:j?"one-line-scroll":"multi-line-scroll",onKeyUp:function(e){var n=e.key,a=e.ctrlKey,r=e.metaKey,i=a||r;"Enter"===n&&i?s():"ArrowUp"===n&&i?c(-1,t):"ArrowDown"===n&&i&&c(1,t)}})})},Yt=n(335),Pt=n(311),Bt=function(){return Object(u.jsx)(gt.a,{component:bt.a,children:Object(u.jsxs)(yt.a,{"aria-label":"simple table",size:"small",children:[Object(u.jsx)(Et.a,{children:Object(u.jsxs)(St.a,{children:[Object(u.jsx)(_t.a,{children:"Long"}),Object(u.jsx)(_t.a,{children:"Short"})]})}),Object(u.jsx)(wt.a,{children:P.map((function(e,t){return Object(u.jsxs)(St.a,{children:[Object(u.jsx)(_t.a,{component:"th",scope:"row",children:e.long}),Object(u.jsx)(_t.a,{children:e.short})]},t)}))})]})})},qt=Object(fe.a)({inlineBtn:{"&:hover":{cursor:"pointer"}}}),Ft=function(e){var t=e.handler,n=e.text,a=qt();return Object(u.jsx)(p.a,{component:"span",className:a.inlineBtn,onClick:t,children:n})},zt=Object(fe.a)({container:{display:"grid",gridTemplateColumns:"auto auto",height:"100%",padding:"18px 14px",borderRadius:"4px",borderColor:"#b9b9b9",borderStyle:"solid",borderWidth:"1px"}}),Qt=function(e){var t=e.setDuration,n=zt(),c=Object(a.useState)(!1),i=Object(o.a)(c,2),s=i[0],l=i[1],d=r.a.useState(null),j=Object(o.a)(d,2),b=j[0],O=j[1],p=Object(a.useState)(),x=Object(o.a)(p,2),v=x[0],m=x[1],g=de().time,y=g.period.end,E=g.duration,S=je(),_=Object(a.useState)(E),T=Object(o.a)(_,2),A=T[0],R=T[1];Object(a.useEffect)((function(){R(E)}),[E]),Object(a.useEffect)((function(){m(function(e){return C()(e).format(Y)}(W(y)))}),[y]),Object(a.useEffect)((function(){if(!s){var e=function(e){var t=e.trim().split(" ").reduce((function(e,t){var n=F(t);return n?Object(w.a)(Object(w.a)({},e),n):Object(w.a)({},e)}),{}),n=C.a.duration(t).asMilliseconds();return n<N?G(N):n>L?G(L):e}(A);R(e),t(e)}}),[A,s]);var I=function(){O(null)},k=Boolean(b);return Object(u.jsxs)(h.a,{className:n.container,children:[Object(u.jsxs)(h.a,{px:1,children:[Object(u.jsx)(h.a,{children:Object(u.jsx)(st.a,{label:"Duration",value:A,onChange:function(e){R(e.target.value)},variant:"standard",fullWidth:!0,onKeyUp:function(e){if("Enter"===e.key){var t=e.target;t.blur(),R(t.value)}},onBlur:function(){l(!1)},onFocus:function(){l(!0)}})}),Object(u.jsx)(h.a,{mt:2,children:Object(u.jsxs)(f.a,{variant:"body2",children:[Object(u.jsx)("span",{"aria-owns":k?"mouse-over-popover":void 0,"aria-haspopup":"true",style:{cursor:"pointer"},onMouseEnter:function(e){O(e.currentTarget)},onMouseLeave:I,children:"Possible options:\xa0"}),Object(u.jsx)(Yt.a,{open:k,anchorEl:b,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},style:{pointerEvents:"none"},onClose:I,disableRestoreFocus:!0,children:Object(u.jsx)(Bt,{})}),Object(u.jsx)(Ft,{handler:function(){return R("5m")},text:"5m"}),",\xa0",Object(u.jsx)(Ft,{handler:function(){return R("1h")},text:"1h"}),",\xa0",Object(u.jsx)(Ft,{handler:function(){return R("1h 30m")},text:"1h 30m"})]})})]}),Object(u.jsxs)(h.a,{px:1,children:[Object(u.jsx)(h.a,{children:Object(u.jsx)(Pt.a,{label:"Until",ampm:!1,value:v,onChange:function(e){return S({type:"SET_UNTIL",payload:e})},onError:console.log,inputFormat:"DD/MM/YYYY HH:mm:ss",mask:"__/__/____ __:__:__",renderInput:function(e){return Object(u.jsx)(st.a,Object(w.a)(Object(w.a)({},e),{},{variant:"standard"}))}})}),Object(u.jsx)(h.a,{mt:2,children:Object(u.jsxs)(f.a,{variant:"body2",children:["Will be changed to current time for auto-refresh mode.\xa0",Object(u.jsx)(Ft,{handler:function(){return S({type:"RUN_QUERY_TO_NOW"})},text:"Switch to now"})]})})]})]})},Gt=n(162),Wt=n.n(Gt),Jt=n(164),Vt=n.n(Jt),Kt=n(165),Xt=n.n(Kt),Zt=n(163),$t=n.n(Zt),en=n(301),tn=n(161),nn=n.n(tn),an=n(308),rn=n(306),cn=n(346),on=n(348),sn=n(315),ln=n(344),un=n(334),dn=n(321),jn=n(333),bn=n(345),On=n(319),hn=n(336),fn=n(347),pn=n(307),xn=["children","value","index"],vn=function(e){var t=e.children,n=e.value,a=e.index,r=Object(tt.a)(e,xn);return Object(u.jsx)("div",Object(w.a)(Object(w.a)({role:"tabpanel",hidden:n!==a,id:"auth-config-tabpanel-".concat(a),"aria-labelledby":"auth-config-tab-".concat(a)},r),{},{children:n===a&&Object(u.jsx)(h.a,{py:2,children:t})}))},mn=n(159),gn=n.n(mn),yn=n(160),En=n.n(yn),Sn={authMethod:"NO_AUTH",saveAuthLocally:!1},_n=V("AUTH_TYPE"),wn=V("BASIC_AUTH_DATA"),Tn=V("BEARER_AUTH_DATA"),Cn=Object(w.a)(Object(w.a)({},Sn),{},{authMethod:_n||Sn.authMethod,basicData:wn,bearerData:Tn,saveAuthLocally:!(!wn&&!Tn)}),An=function(){K(X)};function Rn(e,t){switch(t.type){case"SET_BASIC_AUTH":return t.payload.checkbox?J("BASIC_AUTH_DATA",t.payload.value):An(),J("AUTH_TYPE","BASIC_AUTH"),Object(w.a)(Object(w.a)({},e),{},{authMethod:"BASIC_AUTH",basicData:t.payload.value});case"SET_BEARER_AUTH":return t.payload.checkbox?J("BEARER_AUTH_DATA",t.payload.value):An(),J("AUTH_TYPE","BEARER_AUTH"),Object(w.a)(Object(w.a)({},e),{},{authMethod:"BEARER_AUTH",bearerData:t.payload.value});case"SET_NO_AUTH":return!t.payload.checkbox&&An(),J("AUTH_TYPE","NO_AUTH"),Object(w.a)(Object(w.a)({},e),{},{authMethod:"NO_AUTH"});default:throw new Error}}var In=Object(a.createContext)({}),kn=function(){return Object(a.useContext)(In).state},Un=function(e){var t=e.children,n=Object(a.useReducer)(Rn,Cn),r=Object(o.a)(n,2),c=r[0],i=r[1],s=Object(a.useMemo)((function(){return{state:c,dispatch:i}}),[c,i]);return Object(u.jsx)(In.Provider,{value:s,children:t})},Dn=Object(fe.a)((function(){return Object(pn.a)({tabsContent:{height:"200px"}})})),Hn="Bearer ",Mn=[{title:"No auth",id:"NO_AUTH"},{title:"Basic Auth",id:"BASIC_AUTH"},{title:"Bearer Token",id:"BEARER_AUTH"}],Nn=function(e){var t=Dn(),n=e.onClose,r=e.open,c=kn(),i=c.saveAuthLocally,s=c.basicData,l=c.bearerData,d=c.authMethod,j=Object(a.useContext)(In).dispatch,b=Object(a.useState)(i),O=Object(o.a)(b,2),p=O[0],x=O[1],v=Object(a.useState)(s||{password:"",login:""}),g=Object(o.a)(v,2),y=g[0],E=g[1],S=Object(a.useState)((null===l||void 0===l?void 0:l.token)||Hn),_=Object(o.a)(S,2),T=_[0],C=_[1],A=Object(a.useState)(Mn.findIndex((function(e){return e.id===d}))||0),R=Object(o.a)(A,2),I=R[0],k=R[1],U=function(){n()};return Object(u.jsxs)(rn.a,{onClose:U,"aria-labelledby":"simple-dialog-title",open:r,children:[Object(u.jsx)(an.a,{id:"simple-dialog-title",children:"Request Auth Settings"}),Object(u.jsxs)(cn.a,{children:[Object(u.jsx)(on.a,{children:"This affects Authorization header sent to the server you specify. Not shown in URL and can be optionally stored on a client side"}),Object(u.jsx)(sn.a,{value:I,onChange:function(e,t){k(t)},indicatorColor:"primary",textColor:"primary",children:Mn.map((function(e){return Object(u.jsx)(ln.a,{label:e.title},e.id)}))}),Object(u.jsxs)(h.a,{p:0,display:"flex",flexDirection:"column",className:t.tabsContent,children:[Object(u.jsxs)(h.a,{flexGrow:1,children:[Object(u.jsx)(vn,{value:I,index:0,children:Object(u.jsx)(f.a,{style:{fontStyle:"italic"},children:"No Authorization Header"})}),Object(u.jsxs)(vn,{value:I,index:1,children:[Object(u.jsxs)(un.a,{margin:"dense",fullWidth:!0,children:[Object(u.jsx)(dn.a,{htmlFor:"basic-login",children:"User"}),Object(u.jsx)(jn.a,{id:"basic-login",startAdornment:Object(u.jsx)(bn.a,{position:"start",children:Object(u.jsx)(gn.a,{})}),required:!0,onChange:function(e){return E((function(t){return Object(w.a)(Object(w.a)({},t),{},{login:e.target.value||""})}))},value:(null===y||void 0===y?void 0:y.login)||""})]}),Object(u.jsxs)(un.a,{margin:"dense",fullWidth:!0,children:[Object(u.jsx)(dn.a,{htmlFor:"basic-pass",children:"Password"}),Object(u.jsx)(jn.a,{id:"basic-pass",startAdornment:Object(u.jsx)(bn.a,{position:"start",children:Object(u.jsx)(En.a,{})}),onChange:function(e){return E((function(t){return Object(w.a)(Object(w.a)({},t),{},{password:e.target.value||""})}))},value:(null===y||void 0===y?void 0:y.password)||""})]})]}),Object(u.jsx)(vn,{value:I,index:2,children:Object(u.jsx)(st.a,{id:"bearer-auth",label:"Bearer token",multiline:!0,fullWidth:!0,value:T,onChange:function(e){var t=e.target.value;t.startsWith(Hn)?C(t):C(Hn)},InputProps:{onPaste:function(e){var t=e.clipboardData.getData("text/plain");t.startsWith(Hn)?C(t):C(Hn+t),e.preventDefault()}},maxRows:6})})]}),Object(u.jsxs)(un.a,{children:[Object(u.jsx)(m.a,{control:Object(u.jsx)(On.a,{checked:p,onChange:function(){return x((function(e){return!e}))},name:"checkedB",color:"primary"}),label:"Persist Auth Data Locally"}),Object(u.jsx)(hn.a,{children:p?"Auth Data and the Selected method will be saved to LocalStorage":"Auth Data won't be saved. All previously saved Auth Data will be removed"})]})]})]}),Object(u.jsx)(fn.a,{children:Object(u.jsx)(jt.a,{onClick:function(){switch(I){case 0:j({type:"SET_NO_AUTH",payload:{checkbox:p}});break;case 1:j({type:"SET_BASIC_AUTH",payload:{checkbox:p,value:y}});break;case 2:j({type:"SET_BEARER_AUTH",payload:{checkbox:p,value:{token:T}}})}U()},color:"primary",children:"Apply"})})]})},Ln=function(){var e=de().serverUrl,t=je(),n=Object(a.useState)(!1),r=Object(o.a)(n,2),c=r[0],i=r[1];return Object(u.jsxs)(u.Fragment,{children:[Object(u.jsxs)(h.a,{display:"grid",gridTemplateColumns:"1fr auto",gap:"4px",alignItems:"center",width:"100%",mb:2,minHeight:50,children:[Object(u.jsx)(st.a,{variant:"outlined",fullWidth:!0,label:"Server URL",value:e,inputProps:{style:{fontFamily:"Monospace"}},onChange:function(e){var n=e.target.value;t({type:"SET_SERVER",payload:n})}}),Object(u.jsx)(h.a,{children:Object(u.jsx)(g.a,{title:"Request Auth Settings",children:Object(u.jsx)(y.a,{onClick:function(){return i(!0)},children:Object(u.jsx)(nn.a,{})})})})]}),Object(u.jsx)(Nn,{open:c,onClose:function(){return i(!1)}})]})},Yn=function(){var e=de().queryControls,t=e.autocomplete,n=e.nocache,a=je();return Object(u.jsxs)(h.a,{display:"flex",alignItems:"center",children:[Object(u.jsx)(h.a,{children:Object(u.jsx)(m.a,{label:"Enable autocomplete",control:Object(u.jsx)(ve,{checked:t,onChange:function(){a({type:"TOGGLE_AUTOCOMPLETE"}),J("AUTOCOMPLETE",!t)}})})}),Object(u.jsx)(h.a,{ml:2,children:Object(u.jsx)(m.a,{label:"Enable cache",control:Object(u.jsx)(ve,{checked:!n,onChange:function(){a({type:"NO_CACHE"}),J("NO_CACHE",!n)}})})})]})},Pn=function(){var e=de(),t=e.serverUrl,n=e.query,r=e.queryHistory,c=e.time.duration,i=e.queryControls.autocomplete,s=je(),l=Object(a.useState)(!0),d=Object(o.a)(l,2),j=d[0],b=d[1],O=Object(a.useState)(n),p=Object(o.a)(O,2),x=p[0],v=p[1],m=Object(a.useRef)(x),E=Object(a.useRef)(null),S=function(e){m.current=e,v(e)},_=function(){var e=r.map((function(e,t){var n=x[t]===e.values[e.values.length-1];return{index:e.values.length-Number(n),values:n?e.values:[].concat(Object(Ue.a)(e.values),[x[t]])}}));s({type:"RUN_QUERY"}),s({type:"SET_QUERY_HISTORY",payload:e}),s({type:"SET_QUERY",payload:m.current})},w=function(e,t){var n=Object(Ue.a)(m.current);n[t]=e,S(n)},T=function(e,t){var n=r[t],a=n.index,c=n.values,i=a+e;if(!(i<0||i>=c.length)){var o=c[i]||"";w(o,t),s({type:"SET_QUERY_HISTORY_BY_INDEX",payload:{value:{values:c,index:i},queryNumber:t}})}};return Object(u.jsx)(u.Fragment,{children:Object(u.jsxs)(At.a,{expanded:j,onChange:function(){return b((function(e){return!e}))},children:[Object(u.jsxs)(Rt.a,{expandIcon:Object(u.jsx)(y.a,{children:Object(u.jsx)(Wt.a,{})}),"aria-controls":"panel1a-content",id:"panel1a-header",sx:{alignItems:"flex-start",padding:"15px"},children:[Object(u.jsx)(h.a,{mr:2,children:Object(u.jsx)(f.a,{variant:"h6",component:"h2",children:"Query Configuration"})}),Object(u.jsx)(h.a,{flexGrow:1,onClick:function(e){return e.stopPropagation()},onFocusCapture:function(e){return e.stopPropagation()},children:Object(u.jsx)(en.a,{disablePortal:!j,container:E.current,children:n.map((function(e,a){return Object(u.jsxs)(h.a,{display:"grid",gridTemplateColumns:"1fr auto",gap:"4px",width:"100%",mb:a===n.length-1?0:2,children:[Object(u.jsx)(Lt,{server:t,query:x[a],index:a,oneLiner:!j,autocomplete:i,queryHistory:r[a],setHistoryIndex:T,runQuery:_,setQuery:w}),0===a&&Object(u.jsx)(g.a,{title:"Execute Query",children:Object(u.jsx)(y.a,{onClick:_,children:Object(u.jsx)($t.a,{})})}),a>0&&Object(u.jsx)(g.a,{title:"Remove Query",children:Object(u.jsx)(y.a,{onClick:function(){return function(e){var t=Object(Ue.a)(x);t.splice(e,1),S(t),_()}(a)},children:Object(u.jsx)(Vt.a,{})})})]},"".concat(a,"_").concat(e))}))})})]}),Object(u.jsx)(It.a,{children:Object(u.jsxs)(kt.a,{container:!0,columnSpacing:2,children:[Object(u.jsxs)(kt.a,{item:!0,xs:6,minWidth:400,children:[Object(u.jsx)(Ln,{}),Object(u.jsx)("div",{ref:E}),n.length<2&&Object(u.jsx)(h.a,{display:"inline-block",minHeight:"40px",mt:2,children:Object(u.jsxs)(jt.a,{onClick:function(){var e=[].concat(Object(Ue.a)(x),[""]);S(e),s({type:"SET_QUERY",payload:e})},variant:"outlined",children:[Object(u.jsx)(Xt.a,{sx:{fontSize:16,marginRight:"4px"}}),Object(u.jsx)("span",{style:{lineHeight:1,paddingTop:"1px"},children:"Query"})]})})]}),Object(u.jsx)(kt.a,{item:!0,xs:!0,children:Object(u.jsx)(Qt,{setDuration:function(e){return s({type:"SET_DURATION",payload:e})},duration:c})}),Object(u.jsx)(kt.a,{item:!0,xs:12,pt:1,children:Object(u.jsx)(Yn,{})})]})})]})})},Bn=n(81),qn=n.n(Bn),Fn=n(166),zn=n(167),Qn=function(){var e=de(),t=e.query,n=e.displayType,r=e.serverUrl,c=e.time.period,i=e.queryControls.nocache,s=kn(),l=s.basicData,u=s.bearerData,d=s.authMethod,j=Object(a.useState)(!1),b=Object(o.a)(j,2),O=b[0],h=b[1],f=Object(a.useState)(),p=Object(o.a)(f,2),x=p[0],v=p[1],m=Object(a.useState)(),g=Object(o.a)(m,2),y=g[0],E=g[1],S=Object(a.useState)(),_=Object(o.a)(S,2),T=_[0],C=_[1],A=Object(a.useState)(),R=Object(o.a)(A,2),I=R[0],k=R[1];Object(a.useEffect)((function(){T&&(v(void 0),E(void 0))}),[T]);var U=Object(a.useMemo)((function(){if(!I)return!0;var e=(I.end-I.start)/3,t=e/(c.end-c.start)>=.7,n=c.end>I.end+e,a=c.start<I.start-e;return t||n||a}),[c]),D=function(){var e=Object(Fn.a)(qn.a.mark((function e(){var t,a,r,i,o,s;return qn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===H||void 0===H?void 0:H.length){e.next=2;break}return e.abrupt("return");case 2:return h(!0),k(c),t=new Headers,"BASIC_AUTH"===d&&t.set("Authorization","Basic "+btoa("".concat((null===l||void 0===l?void 0:l.login)||"",":").concat((null===l||void 0===l?void 0:l.password)||""))),"BEARER_AUTH"===d&&t.set("Authorization",(null===u||void 0===u?void 0:u.token)||""),e.prev=7,e.delegateYield(qn.a.mark((function e(){var c,l,u,d,j,b;return qn.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(H.map((function(e){return fetch(e,{headers:t})})));case 2:c=e.sent,l=[],u=1,a=!1,r=!1,e.prev=7,o=Object(zn.a)(c);case 9:return e.next=11,o.next();case 11:if(!(a=!(s=e.sent).done)){e.next=39;break}if(!(d=s.value).ok){e.next=22;break}return e.next=16,d.json();case 16:j=e.sent,C(void 0),l.push.apply(l,Object(Ue.a)(j.data.result.map((function(e){return e.group=u,e})))),u++,e.next=36;break;case 22:return e.t0=C,e.next=25,d.json();case 25:if(e.t2=b=e.sent,e.t1=null===e.t2,e.t1){e.next=29;break}e.t1=void 0===b;case 29:if(!e.t1){e.next=33;break}e.t3=void 0,e.next=34;break;case 33:e.t3=b.error;case 34:e.t4=e.t3,(0,e.t0)(e.t4);case 36:a=!1,e.next=9;break;case 39:e.next=45;break;case 41:e.prev=41,e.t5=e.catch(7),r=!0,i=e.t5;case 45:if(e.prev=45,e.prev=46,!a||null==o.return){e.next=50;break}return e.next=50,o.return();case 50:if(e.prev=50,!r){e.next=53;break}throw i;case 53:return e.finish(50);case 54:return e.finish(45);case 55:"chart"===n?v(l):E(l);case 56:case"end":return e.stop()}}),e,null,[[7,41,45,55],[46,,50,54]])}))(),"t0",9);case 9:e.next=14;break;case 11:e.prev=11,e.t1=e.catch(7),e.t1 instanceof Error&&C(e.t1.message);case 14:h(!1);case 15:case"end":return e.stop()}}),e,null,[[7,11]])})));return function(){return e.apply(this,arguments)}}(),H=Object(a.useMemo)((function(){if(c)if(r)if(t.every((function(e){return!e.trim()})))C("Please enter a valid Query and execute it");else{if(function(e){var t;try{t=new URL(e)}catch(n){return!1}return"http:"===t.protocol||"https:"===t.protocol}(r)){var e=(c.end-c.start)/2,a=Object(w.a)(Object(w.a)({},c),{},{start:c.start-e,end:c.end+e});return t.filter((function(e){return e.trim()})).map((function(e){return"chart"===n?function(e,t,n,a){return"".concat(e,"/api/v1/query_range?query=").concat(encodeURIComponent(t),"&start=").concat(n.start,"&end=").concat(n.end,"&step=").concat(n.step).concat(a?"&nocache=1":"")}(r,e,a,i):function(e,t,n){return"".concat(e,"/api/v1/query?query=").concat(encodeURIComponent(t),"&start=").concat(n.start,"&end=").concat(n.end,"&step=").concat(n.step)}(r,e,c)}))}C("Please provide a valid URL")}else C("Please enter Server URL")}),[r,c,n]);return Object(a.useEffect)((function(){k(void 0),D()}),[t]),Object(a.useEffect)((function(){D()}),[r,n]),Object(a.useEffect)((function(){U&&D()}),[c]),{fetchUrl:H,isLoading:O,graphData:x,liveData:y,error:T}},Gn=function(e){var t=e.data,n=Object(a.useContext)(d).showInfoMessage,r=Object(a.useMemo)((function(){return JSON.stringify(t,null,2)}),[t]);return Object(u.jsxs)(h.a,{position:"relative",children:[Object(u.jsx)(h.a,{flexDirection:"column",justifyContent:"flex-end",display:"flex",style:{position:"fixed",right:"16px"},children:Object(u.jsx)(jt.a,{variant:"outlined",onClick:function(e){navigator.clipboard.writeText(r),n("Formatted JSON has been copied"),e.preventDefault()},children:"Copy JSON"})}),Object(u.jsx)("pre",{children:r})]})},Wn=function(){var e=de(),t=e.displayType,n=e.time.period,a=Qn(),r=a.isLoading,c=a.liveData,i=a.graphData,o=a.error;return Object(u.jsxs)(u.Fragment,{children:[Object(u.jsx)(b.a,{position:"static",children:Object(u.jsxs)(O.a,{children:[Object(u.jsxs)(h.a,{display:"flex",children:[Object(u.jsxs)(f.a,{variant:"h5",children:[Object(u.jsx)("span",{style:{fontWeight:"bolder"},children:"VM"}),Object(u.jsx)("span",{style:{fontWeight:"lighter"},children:"UI"})]}),Object(u.jsx)("div",{style:{fontSize:"10px",marginTop:"-2px"},children:Object(u.jsx)("div",{children:"BETA"})})]}),Object(u.jsx)("div",{style:{fontSize:"10px",position:"absolute",top:"40px",opacity:".4"},children:Object(u.jsx)(p.a,{color:"inherit",href:"https://github.com/VictoriaMetrics/VictoriaMetrics/issues/new",target:"_blank",children:"Create an issue"})}),Object(u.jsx)(h.a,{ml:4,flexGrow:1,children:Object(u.jsx)(ge,{})}),Object(u.jsx)(ke,{})]})}),Object(u.jsxs)(h.a,{p:4,display:"grid",gridTemplateRows:"auto 1fr",gap:"20px",style:{minHeight:"calc(100vh - 64px)"},children:[Object(u.jsx)(h.a,{children:Object(u.jsx)(Pn,{})}),Object(u.jsxs)(h.a,{height:"100%",children:[r&&Object(u.jsx)(x.a,{in:r,style:{transitionDelay:r?"300ms":"0ms"},children:Object(u.jsx)(h.a,{alignItems:"center",justifyContent:"center",flexDirection:"column",display:"flex",style:{width:"100%",maxWidth:"calc(100vw - 32px)",position:"absolute",height:"50%",background:"linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.7), rgba(255,255,255,0))"},children:Object(u.jsx)(v.a,{})})}),Object(u.jsxs)(h.a,{height:"100%",bgcolor:"#fff",children:[o&&Object(u.jsx)(l.a,{color:"error",severity:"error",style:{fontSize:"14px"},children:o}),i&&n&&"chart"===t&&Object(u.jsx)(mt,{data:i}),c&&"code"===t&&Object(u.jsx)(Gn,{data:c}),c&&"table"===t&&Object(u.jsx)(Ct,{data:c})]})]})]})]})},Jn=n(310),Vn=n(353),Kn=n(173),Xn=Object(Kn.a)({palette:{primary:{main:"#3F51B5"},secondary:{main:"#F50057"}},components:{MuiSwitch:{defaultProps:{color:"secondary"}},MuiAccordion:{styleOverrides:{root:{boxShadow:"rgba(0, 0, 0, 0.16) 0px 1px 4px;"}}},MuiPaper:{styleOverrides:{elevation3:{boxShadow:"rgba(0, 0, 0, 0.2) 0px 3px 8px;"}}},MuiIconButton:{defaultProps:{size:"large"},styleOverrides:{sizeLarge:{borderRadius:"20%",height:"40px",width:"41px"},sizeMedium:{borderRadius:"20%"},sizeSmall:{borderRadius:"20%"}}}},typography:{fontSize:10}}),Zn=n(309),$n=n(305),ea=n(168),ta=function(){return Object(u.jsxs)(u.Fragment,{children:[Object(u.jsx)(Zn.a,{})," ",Object(u.jsxs)($n.b,{dateAdapter:ea.a,children:[" ",Object(u.jsx)(Jn.a,{injectFirst:!0,children:Object(u.jsxs)(Vn.a,{theme:Xn,children:["  ",Object(u.jsxs)(Oe,{children:[" ",Object(u.jsxs)(Un,{children:[" ",Object(u.jsxs)(Be,{children:[" ",Object(u.jsxs)(j,{children:[" ",Object(u.jsx)(Wn,{})]})]})]})]})]})})]})]})},na=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,355)).then((function(t){var n=t.getCLS,a=t.getFID,r=t.getFCP,c=t.getLCP,i=t.getTTFB;n(e),a(e),r(e),c(e),i(e)}))};i.a.render(Object(u.jsx)(r.a.StrictMode,{children:Object(u.jsx)(ta,{})}),document.getElementById("root")),na()}},[[234,1,2]]]);
\ No newline at end of file
diff --git a/app/vmui/packages/vmui/package-lock.json b/app/vmui/packages/vmui/package-lock.json
index ddc5b49fc..ec71e7634 100644
--- a/app/vmui/packages/vmui/package-lock.json
+++ b/app/vmui/packages/vmui/package-lock.json
@@ -5954,6 +5954,15 @@
         "node": ">=8"
       }
     },
+    "node_modules/bindings": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
+      "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+      "optional": true,
+      "dependencies": {
+        "file-uri-to-path": "1.0.0"
+      }
+    },
     "node_modules/bluebird": {
       "version": "3.7.2",
       "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
@@ -9639,6 +9648,12 @@
         "url": "https://opencollective.com/webpack"
       }
     },
+    "node_modules/file-uri-to-path": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
+      "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
+      "optional": true
+    },
     "node_modules/filesize": {
       "version": "6.1.0",
       "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz",
@@ -14398,6 +14413,12 @@
       "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz",
       "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE="
     },
+    "node_modules/nan": {
+      "version": "2.15.0",
+      "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz",
+      "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==",
+      "optional": true
+    },
     "node_modules/nanoid": {
       "version": "3.1.30",
       "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.30.tgz",
@@ -26667,6 +26688,15 @@
       "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
       "optional": true
     },
+    "bindings": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
+      "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+      "optional": true,
+      "requires": {
+        "file-uri-to-path": "1.0.0"
+      }
+    },
     "bluebird": {
       "version": "3.7.2",
       "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
@@ -29554,6 +29584,12 @@
         }
       }
     },
+    "file-uri-to-path": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
+      "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
+      "optional": true
+    },
     "filesize": {
       "version": "6.1.0",
       "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz",
@@ -33250,6 +33286,12 @@
       "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz",
       "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE="
     },
+    "nan": {
+      "version": "2.15.0",
+      "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz",
+      "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==",
+      "optional": true
+    },
     "nanoid": {
       "version": "3.1.30",
       "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.30.tgz",
diff --git a/app/vmui/packages/vmui/src/components/Home/Configurator/Query/QueryConfigurator.tsx b/app/vmui/packages/vmui/src/components/Home/Configurator/Query/QueryConfigurator.tsx
index 3497118fe..bbe6d50a7 100644
--- a/app/vmui/packages/vmui/src/components/Home/Configurator/Query/QueryConfigurator.tsx
+++ b/app/vmui/packages/vmui/src/components/Home/Configurator/Query/QueryConfigurator.tsx
@@ -12,8 +12,13 @@ import PlayCircleOutlineIcon from "@mui/icons-material/PlayCircleOutline";
 import Portal from "@mui/material/Portal";
 import ServerConfigurator from "./ServerConfigurator";
 import AdditionalSettings from "./AdditionalSettings";
+import {ErrorTypes} from "../../../../types";
 
-const QueryConfigurator: FC = () => {
+export interface QueryConfiguratorProps {
+  error?: ErrorTypes | string;
+}
+
+const QueryConfigurator: FC<QueryConfiguratorProps> = ({error}) => {
 
   const {serverUrl, query, queryHistory, time: {duration}, queryControls: {autocomplete}} = useAppState();
   const dispatch = useAppDispatch();
@@ -90,10 +95,8 @@ const QueryConfigurator: FC = () => {
               <Box key={`${i}_${q}`} display="grid" gridTemplateColumns="1fr auto" gap="4px" width="100%"
                 mb={i === query.length-1 ? 0 : 2}>
                 <QueryEditor server={serverUrl} query={queryString[i]} index={i} oneLiner={!expanded}
-                  autocomplete={autocomplete}
-                  queryHistory={queryHistory[i]} setHistoryIndex={setHistoryIndex}
-                  runQuery={onRunQuery}
-                  setQuery={onSetQuery}/>
+                  autocomplete={autocomplete} queryHistory={queryHistory[i]} error={error}
+                  setHistoryIndex={setHistoryIndex} runQuery={onRunQuery} setQuery={onSetQuery}/>
                 {i === 0 && <Tooltip title="Execute Query">
                   <IconButton onClick={onRunQuery}>
                     <PlayCircleOutlineIcon/>
@@ -111,7 +114,7 @@ const QueryConfigurator: FC = () => {
       <AccordionDetails>
         <Grid container columnSpacing={2}>
           <Grid item xs={6} minWidth={400}>
-            <ServerConfigurator/>
+            <ServerConfigurator error={error}/>
             {/* for portal QueryEditor */}
             <div ref={queryContainer}/>
             {query.length < 2 && <Box display="inline-block" minHeight="40px" mt={2}>
diff --git a/app/vmui/packages/vmui/src/components/Home/Configurator/Query/QueryEditor.tsx b/app/vmui/packages/vmui/src/components/Home/Configurator/Query/QueryEditor.tsx
index 035ad20fc..7ab2e4d8a 100644
--- a/app/vmui/packages/vmui/src/components/Home/Configurator/Query/QueryEditor.tsx
+++ b/app/vmui/packages/vmui/src/components/Home/Configurator/Query/QueryEditor.tsx
@@ -2,20 +2,22 @@ import {EditorState} from "@codemirror/state";
 import {EditorView, keymap} from "@codemirror/view";
 import {defaultKeymap} from "@codemirror/commands";
 import React, {FC, useEffect, useRef, useState} from "react";
-import { PromQLExtension } from "codemirror-promql";
-import { basicSetup } from "@codemirror/basic-setup";
+import {PromQLExtension} from "codemirror-promql";
+import {basicSetup} from "@codemirror/basic-setup";
 import {QueryHistory} from "../../../../state/common/reducer";
+import {ErrorTypes} from "../../../../types";
 
 export interface QueryEditorProps {
   setHistoryIndex: (step: number, index: number) => void;
   setQuery: (query: string, index: number) => void;
   runQuery: () => void;
-  query: string,
+  query: string;
   index: number;
   queryHistory: QueryHistory;
   server: string;
   oneLiner?: boolean;
-  autocomplete: boolean
+  autocomplete: boolean;
+  error?: ErrorTypes | string;
 }
 
 const QueryEditor: FC<QueryEditorProps> = ({
@@ -27,12 +29,14 @@ const QueryEditor: FC<QueryEditorProps> = ({
   runQuery,
   server,
   oneLiner = false,
-  autocomplete
+  autocomplete,
+  error
 }) => {
 
   const ref = useRef<HTMLDivElement>(null);
 
   const [editorView, setEditorView] = useState<EditorView>();
+  const [focusEditor, setFocusEditor] = useState(false);
 
   // init editor view on load
   useEffect(() => {
@@ -53,6 +57,9 @@ const QueryEditor: FC<QueryEditorProps> = ({
     promQL.setComplete({ remote: { url: server } });
 
     const listenerExtension = EditorView.updateListener.of(editorUpdate => {
+      if (editorUpdate.focusChanged && editorView?.hasFocus !== focusEditor) {
+        setFocusEditor(editorView?.hasFocus || false);
+      }
       if (editorUpdate.docChanged) {
         setQuery(editorUpdate.state.doc.toJSON().map(el => el.trim()).join(""), index);
       }
@@ -81,12 +88,14 @@ const QueryEditor: FC<QueryEditorProps> = ({
     }
   };
 
-  return (
-    <>
-      {/*Class one-line-scroll and other codemirror styles are declared in index.css*/}
-      <div ref={ref} className={oneLiner ? "one-line-scroll" : "multi-line-scroll"} onKeyUp={onKeyUp}/>
-    </>
-  );
+  return <div className={`query-editor-container 
+    ${focusEditor ? "query-editor-container_focus" : ""}
+    query-editor-container-${oneLiner ? "one-line" : "multi-line"}
+    ${error === ErrorTypes.validQuery ? "query-editor-container_error" : ""}`}>
+    {/*Class one-line-scroll and other codemirror styles are declared in index.css*/}
+    <label className="query-editor-label">Query</label>
+    <div className="query-editor" ref={ref} onKeyUp={onKeyUp}/>
+  </div>;
 };
 
 export default QueryEditor;
\ No newline at end of file
diff --git a/app/vmui/packages/vmui/src/components/Home/Configurator/Query/ServerConfigurator.tsx b/app/vmui/packages/vmui/src/components/Home/Configurator/Query/ServerConfigurator.tsx
index bcdf0161a..aa9f4e832 100644
--- a/app/vmui/packages/vmui/src/components/Home/Configurator/Query/ServerConfigurator.tsx
+++ b/app/vmui/packages/vmui/src/components/Home/Configurator/Query/ServerConfigurator.tsx
@@ -3,9 +3,13 @@ import {Box, TextField, Tooltip, IconButton} from "@mui/material";
 import SecurityIcon from "@mui/icons-material/Security";
 import {useAppDispatch, useAppState} from "../../../../state/common/StateContext";
 import {AuthDialog} from "../Auth/AuthDialog";
+import {ErrorTypes} from "../../../../types";
 
+export interface ServerConfiguratorProps {
+  error?: ErrorTypes | string;
+}
 
-const ServerConfigurator: FC = () => {
+const ServerConfigurator: FC<ServerConfiguratorProps> = ({error}) => {
 
   const {serverUrl} = useAppState();
   const dispatch = useAppDispatch();
@@ -18,6 +22,7 @@ const ServerConfigurator: FC = () => {
   return <>
     <Box display="grid" gridTemplateColumns="1fr auto" gap="4px" alignItems="center" width="100%" mb={2} minHeight={50}>
       <TextField variant="outlined" fullWidth label="Server URL" value={serverUrl}
+        error={error === ErrorTypes.validServer || error === ErrorTypes.emptyServer}
         inputProps={{style: {fontFamily: "Monospace"}}}
         onChange={onSetServer}/>
       <Box>
diff --git a/app/vmui/packages/vmui/src/components/Home/Configurator/Query/useFetchQuery.ts b/app/vmui/packages/vmui/src/components/Home/Configurator/Query/useFetchQuery.ts
index 54b37aa5d..7a919302d 100644
--- a/app/vmui/packages/vmui/src/components/Home/Configurator/Query/useFetchQuery.ts
+++ b/app/vmui/packages/vmui/src/components/Home/Configurator/Query/useFetchQuery.ts
@@ -4,14 +4,14 @@ import {useAppState} from "../../../../state/common/StateContext";
 import {InstantMetricResult, MetricBase, MetricResult} from "../../../../api/types";
 import {isValidHttpUrl} from "../../../../utils/url";
 import {useAuthState} from "../../../../state/auth/AuthStateContext";
-import {TimeParams} from "../../../../types";
+import {ErrorTypes, TimeParams} from "../../../../types";
 
 export const useFetchQuery = (): {
   fetchUrl?: string[],
   isLoading: boolean,
   graphData?: MetricResult[],
   liveData?: InstantMetricResult[],
-  error?: string,
+  error?: ErrorTypes | string,
 } => {
   const {query, displayType, serverUrl, time: {period}, queryControls: {nocache}} = useAppState();
 
@@ -20,7 +20,7 @@ export const useFetchQuery = (): {
   const [isLoading, setIsLoading] = useState(false);
   const [graphData, setGraphData] = useState<MetricResult[]>();
   const [liveData, setLiveData] = useState<InstantMetricResult[]>();
-  const [error, setError] = useState<string>();
+  const [error, setError] = useState<ErrorTypes | string>();
   const [prevPeriod, setPrevPeriod] = useState<TimeParams>();
 
   useEffect(() => {
@@ -80,9 +80,9 @@ export const useFetchQuery = (): {
   const fetchUrl = useMemo(() => {
     if (!period) return;
     if (!serverUrl) {
-      setError("Please enter Server URL");
+      setError(ErrorTypes.emptyServer);
     } else if (query.every(q => !q.trim())) {
-      setError("Please enter a valid Query and execute it");
+      setError(ErrorTypes.validQuery);
     } else if (isValidHttpUrl(serverUrl)) {
       const duration = (period.end - period.start) / 2;
       const bufferPeriod = {...period, start: period.start - duration, end: period.end + duration};
@@ -90,7 +90,7 @@ export const useFetchQuery = (): {
         ? getQueryRangeUrl(serverUrl, q, bufferPeriod, nocache)
         : getQueryUrl(serverUrl, q, period));
     } else {
-      setError("Please provide a valid URL");
+      setError(ErrorTypes.validServer);
     }
   },
   [serverUrl, period, displayType]);
diff --git a/app/vmui/packages/vmui/src/components/Home/HomeLayout.tsx b/app/vmui/packages/vmui/src/components/Home/HomeLayout.tsx
index 7839afe42..ea900501d 100644
--- a/app/vmui/packages/vmui/src/components/Home/HomeLayout.tsx
+++ b/app/vmui/packages/vmui/src/components/Home/HomeLayout.tsx
@@ -49,7 +49,7 @@ const HomeLayout: FC = () => {
       </AppBar>
       <Box p={4} display="grid" gridTemplateRows="auto 1fr" gap={"20px"} style={{minHeight: "calc(100vh - 64px)"}}>
         <Box>
-          <QueryConfigurator/>
+          <QueryConfigurator error={error}/>
         </Box>
         <Box height={"100%"}>
           {isLoading && <Fade in={isLoading} style={{
diff --git a/app/vmui/packages/vmui/src/index.css b/app/vmui/packages/vmui/src/index.css
index 7db81ff07..d0c869b55 100644
--- a/app/vmui/packages/vmui/src/index.css
+++ b/app/vmui/packages/vmui/src/index.css
@@ -7,8 +7,7 @@ body {
 }
 
 code {
-  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
-    monospace;
+  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
 }
 
 /*Material UI global classes*/
@@ -17,33 +16,80 @@ code {
   margin: 0 !important;
 }
 
+/*Codemirror classes*/
+
 /* TODO: find better way to override codemirror styles */
 .cm-activeLine {
   background-color: inherit !important;
 }
 .cm-editor {
+  border: none;
   border-radius: 4px;
-  border-color: #b9b9b9;
-  border-style: solid;
-  border-width: 1px;
   font-size: 10px;
 }
 
-.one-line-scroll .cm-editor {
-  height: 40px;
-}
-
 .cm-gutters {
   border-radius: 4px 0 0 4px;
   height: 100%;
+  overflow: hidden;
+  background-color: #FFFFFF !important;
+  border: none !important;
+}
+
+.cm-activeLineGutter {
+  background-color: #FFFFFF !important;
+}
+
+.query-editor .cm-scroller {
+  align-items: center !important;
+}
+
+.query-editor .cm-editor.cm-focused {
+  outline: none;
+}
+
+.query-editor-container {
+  position: relative;
+  padding: 12px;
+  border: 1px solid #b9b9b9;
+  border-radius: 4px;
+}
+
+.query-editor-container_focus {
+  border: 1px solid #3F51B5;
+}
+
+.query-editor-container_error {
+  border-color: #FF4141;
+}
+
+.query-editor-container-one-line .query-editor .cm-editor {
+  height: 22px;
+}
+
+.query-editor-container-one-line {
+  padding: 6px;
 }
 
-.multi-line-scroll .cm-content,
-.multi-line-scroll .cm-gutters {
-  min-height: 38px !important;
+.query-editor-label {
+  font-weight: 400;
+  font-size: 12px;
+  line-height: 1;
+  letter-spacing: normal;
+  color: rgba(0, 0, 0, 0.6);
+  padding: 0 5px;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  max-width: calc(133% - 24px);
+  position: absolute;
+  left: 4px;
+  top: -0.71875em;
+  z-index: 1;
+  background-color: #FFFFFF;
+  transform: scale(0.75);
 }
 
-.one-line-scroll .cm-content,
-.one-line-scroll .cm-gutters {
-  min-height: auto;
+.query-editor-container_error .query-editor-label {
+  color: #FF4141;
 }
diff --git a/app/vmui/packages/vmui/src/theme/theme.ts b/app/vmui/packages/vmui/src/theme/theme.ts
index e9e1f9c5c..c110abfca 100644
--- a/app/vmui/packages/vmui/src/theme/theme.ts
+++ b/app/vmui/packages/vmui/src/theme/theme.ts
@@ -7,9 +7,30 @@ const THEME = createTheme({
     },
     secondary: {
       main: "#F50057"
+    },
+    error: {
+      main: "#FF4141"
     }
   },
   components: {
+    MuiInputLabel: {
+      styleOverrides: {
+        root: {
+          fontSize: "12px",
+          letterSpacing: "normal",
+          lineHeight: "1"
+        }
+      }
+    },
+    MuiInputBase: {
+      styleOverrides: {
+        "root": {
+          "&.Mui-focused fieldset": {
+            "borderWidth": "1px !important"
+          }
+        }
+      }
+    },
     MuiSwitch: {
       defaultProps: {
         color: "secondary"
diff --git a/app/vmui/packages/vmui/src/types/index.ts b/app/vmui/packages/vmui/src/types/index.ts
index 5b8b1271a..966f0b828 100644
--- a/app/vmui/packages/vmui/src/types/index.ts
+++ b/app/vmui/packages/vmui/src/types/index.ts
@@ -24,8 +24,13 @@ export interface DataSeries extends MetricBase{
   values: DataValue[]; // sorted by key which is timestamp
 }
 
-
 export interface InstantDataSeries {
   metadata: string[]; // just ordered columns
   value: string;
+}
+
+export enum ErrorTypes {
+  emptyServer = "Please enter Server URL",
+  validServer = "Please provide a valid Server URL",
+  validQuery = "Please enter a valid Query and execute it"
 }
\ No newline at end of file
diff --git a/deployment/docker/Makefile b/deployment/docker/Makefile
index c2a42ac02..70e014899 100644
--- a/deployment/docker/Makefile
+++ b/deployment/docker/Makefile
@@ -4,7 +4,7 @@ DOCKER_NAMESPACE := victoriametrics
 
 ROOT_IMAGE ?= alpine:3.15.0
 CERTS_IMAGE := alpine:3.15.0
-GO_BUILDER_IMAGE := golang:1.17.4-alpine
+GO_BUILDER_IMAGE := golang:1.17.5-alpine
 BUILDER_IMAGE := local/builder:2.0.0-$(shell echo $(GO_BUILDER_IMAGE) | tr :/ __)
 BASE_IMAGE := local/base:1.1.3-$(shell echo $(ROOT_IMAGE) | tr :/ __)-$(shell echo $(CERTS_IMAGE) | tr :/ __)
 
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 70a987250..800450cac 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -12,6 +12,7 @@ sort: 15
 * FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent.html): allow specifying `http` and `https` urls in the following command-line flags: `-promscrape.config`, `-remoteWrite.relabelConfig` and `-remoteWrite.urlRelabelConfig`.
 * FEATURE: vminsert: allow specifying `http` and `https` urls in `-relabelConfig` command-line flag.
 * FEATURE: vminsert: add `-maxLabelValueLen` command-line flag for the ability to configure the maximum length of label value. See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1908).
+* FEATURE: preserve the order of time series passed to [limit_offset](https://docs.victoriametrics.com/MetricsQL.html#limit_offset) function. This allows implementing series paging via `limit_offset(limit, offset, sort_by_label(...))`. See [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1920) and [this](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/951) issues.
 
 * BUGFIX: fix `unaligned 64-bit atomic operation` panic on 32-bit architectures, which has been introduced in v1.70.0.
 * BUGFIX: [vmalert](https://docs.victoriametrics.com/vmalert.html): restore the ability to use `{{ $labels.alertname }}` in labels templating. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1921).
diff --git a/docs/MetricsQL.md b/docs/MetricsQL.md
index 0bde60d12..6ad67f3a6 100644
--- a/docs/MetricsQL.md
+++ b/docs/MetricsQL.md
@@ -487,6 +487,10 @@ See also [implicit query conversions](#implicit-query-conversions).
 
 `keep_next_value(q)` fills gaps with the value of the next non-empty point in every time series returned by `q`. See also [keep_last_value](#keep_last_value) and [interpolate](#interpolate).
 
+#### limit_offset
+
+`limit_offset(limit, offset, q)` skips `offset` time series from series returned by `q` and then returns up to `limit` of the remaining time series per each group. This allows implementing simple paging for `q` time series. See also [limitk](#limitk).
+
 #### ln
 
 `ln(q)` calculates `ln(v)` for every point `v` of every time series returned by `q`. Metric names are stripped from the resulting series. This function is supported by PromQL. See also [exp](#exp) and [log2](#log2).
@@ -823,11 +827,6 @@ See also [implicit query conversions](#implicit-query-conversions).
 
 `histogram(q)` calculates [VictoriaMetrics histogram](https://valyala.medium.com/improving-histogram-usability-for-prometheus-and-grafana-bc7e5df0e350) per each group of points with the same timestamp. Useful for visualizing big number of time series via a heatmap. See [this article](https://medium.com/@valyala/improving-histogram-usability-for-prometheus-and-grafana-bc7e5df0e350) for more details.
 
-#### limit_offset
-
-`limit_offset(limit, offset, q)` skips `offset` time series from series returned by `q` and then returns up to `limit` of the remaining time series. This allows implementing simple paging for `q` time series. See also [limitk](#limitk).
-
-
 #### limitk
 
 `limitk(k, q) by (group_labels)` returns up to `k` time series per each `group_labels` out of time series returned by `q`. The returned set of time series remain the same across calls. See also [limit_offset](#limit_offset).
diff --git a/go.mod b/go.mod
index c8741746d..4332258fe 100644
--- a/go.mod
+++ b/go.mod
@@ -1,7 +1,7 @@
 module github.com/VictoriaMetrics/VictoriaMetrics
 
 require (
-	cloud.google.com/go v0.98.0 // indirect
+	cloud.google.com/go v0.99.0 // indirect
 	cloud.google.com/go/storage v1.18.2
 	github.com/VictoriaMetrics/fastcache v1.8.0
 
@@ -9,9 +9,9 @@ require (
 	// like https://github.com/valyala/fasthttp/commit/996610f021ff45fdc98c2ce7884d5fa4e7f9199b
 	github.com/VictoriaMetrics/fasthttp v1.1.0
 	github.com/VictoriaMetrics/metrics v1.18.1
-	github.com/VictoriaMetrics/metricsql v0.31.0
+	github.com/VictoriaMetrics/metricsql v0.32.0
 	github.com/VividCortex/ewma v1.2.0 // indirect
-	github.com/aws/aws-sdk-go v1.42.19
+	github.com/aws/aws-sdk-go v1.42.22
 	github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect
 	github.com/cespare/xxhash/v2 v2.1.2
 	github.com/cheggaaa/pb/v3 v3.0.8
@@ -34,11 +34,11 @@ require (
 	github.com/valyala/fasttemplate v1.2.1
 	github.com/valyala/gozstd v1.14.2
 	github.com/valyala/quicktemplate v1.7.0
-	golang.org/x/net v0.0.0-20211205041911-012df41ee64c
+	golang.org/x/net v0.0.0-20211209124913-491a49abca63
 	golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
-	golang.org/x/sys v0.0.0-20211205182925-97ca703d548d
-	google.golang.org/api v0.61.0
-	google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9 // indirect
+	golang.org/x/sys v0.0.0-20211210111614-af8b64212486
+	google.golang.org/api v0.62.0
+	google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
 	google.golang.org/grpc v1.42.0 // indirect
 	gopkg.in/yaml.v2 v2.4.0
 )
diff --git a/go.sum b/go.sum
index 33e57ebe0..c6e1c36ca 100644
--- a/go.sum
+++ b/go.sum
@@ -27,8 +27,9 @@ cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aD
 cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI=
 cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4=
 cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
-cloud.google.com/go v0.98.0 h1:w6LozQJyDDEyhf64Uusu1LCcnLt0I1VMLiJC2kV+eXk=
 cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM=
+cloud.google.com/go v0.99.0 h1:y/cM2iqGgGi5D5DQZl6D9STN/3dR/Vx5Mp8s752oJTY=
+cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA=
 cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
 cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
 cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
@@ -109,8 +110,8 @@ github.com/VictoriaMetrics/fasthttp v1.1.0/go.mod h1:/7DMcogqd+aaD3G3Hg5kFgoFwlR
 github.com/VictoriaMetrics/metrics v1.12.2/go.mod h1:Z1tSfPfngDn12bTfZSCqArT3OPY3u88J12hSoOhuiRE=
 github.com/VictoriaMetrics/metrics v1.18.1 h1:OZ0+kTTto8oPfHnVAnTOoyl0XlRhRkoQrD2n2cOuRw0=
 github.com/VictoriaMetrics/metrics v1.18.1/go.mod h1:ArjwVz7WpgpegX/JpB0zpNF2h2232kErkEnzH1sxMmA=
-github.com/VictoriaMetrics/metricsql v0.31.0 h1:7cpjby64WVcRNBiMieEytuvAcU/jOOz+39RLigENz4E=
-github.com/VictoriaMetrics/metricsql v0.31.0/go.mod h1:ylO7YITho/Iw6P71oEaGyHbO94bGoGtzWfLGqFhMIg8=
+github.com/VictoriaMetrics/metricsql v0.32.0 h1:yTZFB1FvbOsD5ahl6mxKYprHpZ248nVk3s8Kl7UBg5c=
+github.com/VictoriaMetrics/metricsql v0.32.0/go.mod h1:ylO7YITho/Iw6P71oEaGyHbO94bGoGtzWfLGqFhMIg8=
 github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
 github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
 github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
@@ -155,8 +156,8 @@ github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZve
 github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48=
 github.com/aws/aws-sdk-go v1.35.31/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
 github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q=
-github.com/aws/aws-sdk-go v1.42.19 h1:L/aM1QwsqVia9qIqexTHwYN+lgLYuOtf11VDgz0YIyw=
-github.com/aws/aws-sdk-go v1.42.19/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q=
+github.com/aws/aws-sdk-go v1.42.22 h1:EwcM7/+Ytg6xK+jbeM2+f9OELHqPiEiEKetT/GgAr7I=
+github.com/aws/aws-sdk-go v1.42.22/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q=
 github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
 github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4=
 github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o=
@@ -1180,8 +1181,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx
 golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20211205041911-012df41ee64c h1:7SfqwP5fxEtl/P02w5IhKc86ziJ+A25yFrkVgoy2FT8=
-golang.org/x/net v0.0.0-20211205041911-012df41ee64c/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY=
+golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -1308,8 +1309,9 @@ golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E=
 golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211210111614-af8b64212486 h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk=
+golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -1457,8 +1459,9 @@ google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqiv
 google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
 google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI=
 google.golang.org/api v0.58.0/go.mod h1:cAbP2FsxoGVNwtgNAmmn3y5G1TWAiVYRmg4yku3lv+E=
-google.golang.org/api v0.61.0 h1:TXXKS1slM3b2bZNJwD5DV/Tp6/M2cLzLOLh9PjDhrw8=
 google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I=
+google.golang.org/api v0.62.0 h1:PhGymJMXfGBzc4lBRmrx9+1w4w2wEzURHNGF/sD/xGc=
+google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw=
 google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
 google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -1533,8 +1536,10 @@ google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ6
 google.golang.org/genproto v0.0.0-20211016002631-37fc39342514/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
 google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
 google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
-google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9 h1:fU3FNfL/oBU2D5DvGqiuyVqqn40DdxvaTFHq7aivA3k=
 google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0=
+google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
 google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
 google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
 google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=
@@ -1567,6 +1572,7 @@ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ
 google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
 google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
 google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
+google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
 google.golang.org/grpc v1.42.0 h1:XT2/MFpuPFsEX2fWh3YQtHkZ+WYZFQRfaUgLZYj/p6A=
 google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
diff --git a/vendor/cloud.google.com/go/CHANGES.md b/vendor/cloud.google.com/go/CHANGES.md
index 37374c2d4..7cc5bb1a0 100644
--- a/vendor/cloud.google.com/go/CHANGES.md
+++ b/vendor/cloud.google.com/go/CHANGES.md
@@ -1,5 +1,12 @@
 # Changes
 
+## [0.99.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.98.0...v0.99.0) (2021-12-06)
+
+
+### Features
+
+* **dialogflow/cx:** added `TelephonyTransferCall` in response message ([fe27098](https://www.github.com/googleapis/google-cloud-go/commit/fe27098e5d429911428821ded57384353e699774))
+
 ## [0.98.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.97.0...v0.98.0) (2021-12-03)
 
 
diff --git a/vendor/cloud.google.com/go/go.mod b/vendor/cloud.google.com/go/go.mod
index 1921460b6..7c2a432c0 100644
--- a/vendor/cloud.google.com/go/go.mod
+++ b/vendor/cloud.google.com/go/go.mod
@@ -12,7 +12,7 @@ require (
 	golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
 	golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
 	google.golang.org/api v0.61.0
-	google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12
+	google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0
 	google.golang.org/grpc v1.40.0
 	google.golang.org/protobuf v1.27.1
 )
diff --git a/vendor/cloud.google.com/go/go.sum b/vendor/cloud.google.com/go/go.sum
index 13488dfe8..ad0035f42 100644
--- a/vendor/cloud.google.com/go/go.sum
+++ b/vendor/cloud.google.com/go/go.sum
@@ -511,8 +511,8 @@ google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEc
 google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
 google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
 google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
-google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12 h1:DN5b3HU13J4sMd/QjDx34U6afpaexKTDdop+26pdjdk=
-google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0 h1:c7yRRmuQiVMo+YppNj5MUREXUyc2lPo3DrtYMwaWQ28=
+google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
 google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
 google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
 google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
diff --git a/vendor/github.com/VictoriaMetrics/metricsql/aggr.go b/vendor/github.com/VictoriaMetrics/metricsql/aggr.go
index dacecc006..5dfe5ae79 100644
--- a/vendor/github.com/VictoriaMetrics/metricsql/aggr.go
+++ b/vendor/github.com/VictoriaMetrics/metricsql/aggr.go
@@ -19,7 +19,6 @@ var aggrFuncs = map[string]bool{
 	"geomean":        true,
 	"group":          true,
 	"histogram":      true,
-	"limit_offset":   true,
 	"limitk":         true,
 	"mad":            true,
 	"max":            true,
diff --git a/vendor/github.com/VictoriaMetrics/metricsql/transform.go b/vendor/github.com/VictoriaMetrics/metricsql/transform.go
index af3b3463e..b0bdc2527 100644
--- a/vendor/github.com/VictoriaMetrics/metricsql/transform.go
+++ b/vendor/github.com/VictoriaMetrics/metricsql/transform.go
@@ -56,6 +56,7 @@ var transformFuncs = map[string]bool{
 	"label_transform":      true,
 	"label_uppercase":      true,
 	"label_value":          true,
+	"limit_offset":         true,
 	"ln":                   true,
 	"log2":                 true,
 	"log10":                true,
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
index 64435c7bd..e5af04c08 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
@@ -14076,6 +14076,73 @@ var awsPartition = partition{
 				}: endpoint{},
 			},
 		},
+		"pi": service{
+			Endpoints: serviceEndpoints{
+				endpointKey{
+					Region: "af-south-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "ap-east-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "ap-northeast-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "ap-northeast-2",
+				}: endpoint{},
+				endpointKey{
+					Region: "ap-northeast-3",
+				}: endpoint{},
+				endpointKey{
+					Region: "ap-south-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "ap-southeast-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "ap-southeast-2",
+				}: endpoint{},
+				endpointKey{
+					Region: "ca-central-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "eu-central-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "eu-north-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "eu-south-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "eu-west-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "eu-west-2",
+				}: endpoint{},
+				endpointKey{
+					Region: "eu-west-3",
+				}: endpoint{},
+				endpointKey{
+					Region: "me-south-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "sa-east-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "us-east-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "us-east-2",
+				}: endpoint{},
+				endpointKey{
+					Region: "us-west-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "us-west-2",
+				}: endpoint{},
+			},
+		},
 		"pinpoint": service{
 			Defaults: endpointDefaults{
 				defaultKey{}: endpoint{
@@ -22153,6 +22220,16 @@ var awscnPartition = partition{
 				}: endpoint{},
 			},
 		},
+		"pi": service{
+			Endpoints: serviceEndpoints{
+				endpointKey{
+					Region: "cn-north-1",
+				}: endpoint{},
+				endpointKey{
+					Region: "cn-northwest-1",
+				}: endpoint{},
+			},
+		},
 		"polly": service{
 			Endpoints: serviceEndpoints{
 				endpointKey{
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go
index e10cae5cd..c483cebcc 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/version.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go
@@ -5,4 +5,4 @@ package aws
 const SDKName = "aws-sdk-go"
 
 // SDKVersion is the version of this SDK
-const SDKVersion = "1.42.19"
+const SDKVersion = "1.42.22"
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go
index 92f8b4d9a..c26fbfa5a 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go
@@ -140,7 +140,7 @@ func unmarshalLocationElements(resp *http.Response, v reflect.Value, lowerCaseHe
 				prefix := field.Tag.Get("locationName")
 				err := unmarshalHeaderMap(m, resp.Header, prefix, lowerCaseHeaderMaps)
 				if err != nil {
-					awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err)
+					return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err)
 				}
 			}
 		}
diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go
index c67e9b7f5..d219dc4c7 100644
--- a/vendor/golang.org/x/net/http2/server.go
+++ b/vendor/golang.org/x/net/http2/server.go
@@ -719,7 +719,15 @@ func (sc *serverConn) canonicalHeader(v string) string {
 		sc.canonHeader = make(map[string]string)
 	}
 	cv = http.CanonicalHeaderKey(v)
-	sc.canonHeader[v] = cv
+	// maxCachedCanonicalHeaders is an arbitrarily-chosen limit on the number of
+	// entries in the canonHeader cache. This should be larger than the number
+	// of unique, uncommon header keys likely to be sent by the peer, while not
+	// so high as to permit unreaasonable memory usage if the peer sends an unbounded
+	// number of unique header keys.
+	const maxCachedCanonicalHeaders = 32
+	if len(sc.canonHeader) < maxCachedCanonicalHeaders {
+		sc.canonHeader[v] = cv
+	}
 	return cv
 }
 
diff --git a/vendor/golang.org/x/net/http2/writesched.go b/vendor/golang.org/x/net/http2/writesched.go
index f24d2b1e7..c7cd00173 100644
--- a/vendor/golang.org/x/net/http2/writesched.go
+++ b/vendor/golang.org/x/net/http2/writesched.go
@@ -32,7 +32,8 @@ type WriteScheduler interface {
 
 	// Pop dequeues the next frame to write. Returns false if no frames can
 	// be written. Frames with a given wr.StreamID() are Pop'd in the same
-	// order they are Push'd. No frames should be discarded except by CloseStream.
+	// order they are Push'd, except RST_STREAM frames. No frames should be
+	// discarded except by CloseStream.
 	Pop() (wr FrameWriteRequest, ok bool)
 }
 
@@ -52,6 +53,7 @@ type FrameWriteRequest struct {
 
 	// stream is the stream on which this frame will be written.
 	// nil for non-stream frames like PING and SETTINGS.
+	// nil for RST_STREAM streams, which use the StreamError.StreamID field instead.
 	stream *stream
 
 	// done, if non-nil, must be a buffered channel with space for
diff --git a/vendor/golang.org/x/net/http2/writesched_random.go b/vendor/golang.org/x/net/http2/writesched_random.go
index 9a7b9e581..f2e55e05c 100644
--- a/vendor/golang.org/x/net/http2/writesched_random.go
+++ b/vendor/golang.org/x/net/http2/writesched_random.go
@@ -45,11 +45,11 @@ func (ws *randomWriteScheduler) AdjustStream(streamID uint32, priority PriorityP
 }
 
 func (ws *randomWriteScheduler) Push(wr FrameWriteRequest) {
-	id := wr.StreamID()
-	if id == 0 {
+	if wr.isControl() {
 		ws.zero.push(wr)
 		return
 	}
+	id := wr.StreamID()
 	q, ok := ws.sq[id]
 	if !ok {
 		q = ws.queuePool.get()
@@ -59,7 +59,7 @@ func (ws *randomWriteScheduler) Push(wr FrameWriteRequest) {
 }
 
 func (ws *randomWriteScheduler) Pop() (FrameWriteRequest, bool) {
-	// Control frames first.
+	// Control and RST_STREAM frames first.
 	if !ws.zero.empty() {
 		return ws.zero.shift(), true
 	}
diff --git a/vendor/golang.org/x/sys/unix/syscall_aix.go b/vendor/golang.org/x/sys/unix/syscall_aix.go
index 6192750ce..4f55c8d99 100644
--- a/vendor/golang.org/x/sys/unix/syscall_aix.go
+++ b/vendor/golang.org/x/sys/unix/syscall_aix.go
@@ -519,8 +519,10 @@ func Pipe(p []int) (err error) {
 	}
 	var pp [2]_C_int
 	err = pipe(&pp)
-	p[0] = int(pp[0])
-	p[1] = int(pp[1])
+	if err == nil {
+		p[0] = int(pp[0])
+		p[1] = int(pp[1])
+	}
 	return
 }
 
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go
index 8826f4143..0eaab9131 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go
@@ -159,8 +159,10 @@ func Pipe(p []int) (err error) {
 	}
 	var x [2]int32
 	err = pipe(&x)
-	p[0] = int(x[0])
-	p[1] = int(x[1])
+	if err == nil {
+		p[0] = int(x[0])
+		p[1] = int(x[1])
+	}
 	return
 }
 
diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
index 5af108a50..2e37c3167 100644
--- a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
+++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
@@ -101,7 +101,10 @@ func Pipe(p []int) (err error) {
 	if len(p) != 2 {
 		return EINVAL
 	}
-	p[0], p[1], err = pipe()
+	r, w, err := pipe()
+	if err == nil {
+		p[0], p[1] = r, w
+	}
 	return
 }
 
@@ -114,7 +117,10 @@ func Pipe2(p []int, flags int) (err error) {
 	var pp [2]_C_int
 	// pipe2 on dragonfly takes an fds array as an argument, but still
 	// returns the file descriptors.
-	p[0], p[1], err = pipe2(&pp, flags)
+	r, w, err := pipe2(&pp, flags)
+	if err == nil {
+		p[0], p[1] = r, w
+	}
 	return err
 }
 
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/vendor/golang.org/x/sys/unix/syscall_freebsd.go
index 18c392cf3..2f650ae66 100644
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_freebsd.go
@@ -110,8 +110,10 @@ func Pipe2(p []int, flags int) error {
 	}
 	var pp [2]_C_int
 	err := pipe2(&pp, flags)
-	p[0] = int(pp[0])
-	p[1] = int(pp[1])
+	if err == nil {
+		p[0] = int(pp[0])
+		p[1] = int(pp[1])
+	}
 	return err
 }
 
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go
index 4bc5baf77..f432b0684 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux.go
@@ -131,8 +131,10 @@ func Pipe2(p []int, flags int) error {
 	}
 	var pp [2]_C_int
 	err := pipe2(&pp, flags)
-	p[0] = int(pp[0])
-	p[1] = int(pp[1])
+	if err == nil {
+		p[0] = int(pp[0])
+		p[1] = int(pp[1])
+	}
 	return err
 }
 
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/vendor/golang.org/x/sys/unix/syscall_netbsd.go
index 853d5f0f4..696fed496 100644
--- a/vendor/golang.org/x/sys/unix/syscall_netbsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_netbsd.go
@@ -110,14 +110,8 @@ func direntNamlen(buf []byte) (uint64, bool) {
 	return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
 }
 
-//sysnb	pipe() (fd1 int, fd2 int, err error)
-
 func Pipe(p []int) (err error) {
-	if len(p) != 2 {
-		return EINVAL
-	}
-	p[0], p[1], err = pipe()
-	return
+	return Pipe2(p, 0)
 }
 
 //sysnb	pipe2(p *[2]_C_int, flags int) (err error)
@@ -128,8 +122,10 @@ func Pipe2(p []int, flags int) error {
 	}
 	var pp [2]_C_int
 	err := pipe2(&pp, flags)
-	p[0] = int(pp[0])
-	p[1] = int(pp[1])
+	if err == nil {
+		p[0] = int(pp[0])
+		p[1] = int(pp[1])
+	}
 	return err
 }
 
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go
index 22b550385..11b1d419d 100644
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go
@@ -87,8 +87,10 @@ func Pipe2(p []int, flags int) error {
 	}
 	var pp [2]_C_int
 	err := pipe2(&pp, flags)
-	p[0] = int(pp[0])
-	p[1] = int(pp[1])
+	if err == nil {
+		p[0] = int(pp[0])
+		p[1] = int(pp[1])
+	}
 	return err
 }
 
diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go
index 8b88ac213..5c813921e 100644
--- a/vendor/golang.org/x/sys/unix/syscall_solaris.go
+++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go
@@ -66,8 +66,10 @@ func Pipe(p []int) (err error) {
 	if n != 0 {
 		return err
 	}
-	p[0] = int(pp[0])
-	p[1] = int(pp[1])
+	if err == nil {
+		p[0] = int(pp[0])
+		p[1] = int(pp[1])
+	}
 	return nil
 }
 
@@ -79,8 +81,10 @@ func Pipe2(p []int, flags int) error {
 	}
 	var pp [2]_C_int
 	err := pipe2(&pp, flags)
-	p[0] = int(pp[0])
-	p[1] = int(pp[1])
+	if err == nil {
+		p[0] = int(pp[0])
+		p[1] = int(pp[1])
+	}
 	return err
 }
 
diff --git a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
index 5fb76a146..f8616f454 100644
--- a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
+++ b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
@@ -579,8 +579,10 @@ func Pipe(p []int) (err error) {
 	}
 	var pp [2]_C_int
 	err = pipe(&pp)
-	p[0] = int(pp[0])
-	p[1] = int(pp[1])
+	if err == nil {
+		p[0] = int(pp[0])
+		p[1] = int(pp[1])
+	}
 	return
 }
 
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go
index 4726ab30a..51d0c0742 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go
@@ -351,18 +351,6 @@ func Munlockall() (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func pipe() (fd1 int, fd2 int, err error) {
-	r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
-	fd1 = int(r0)
-	fd2 = int(r1)
-	if e1 != 0 {
-		err = errnoErr(e1)
-	}
-	return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
 func pipe2(p *[2]_C_int, flags int) (err error) {
 	_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
 	if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go
index fe71456db..df2efb6db 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go
@@ -351,18 +351,6 @@ func Munlockall() (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func pipe() (fd1 int, fd2 int, err error) {
-	r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
-	fd1 = int(r0)
-	fd2 = int(r1)
-	if e1 != 0 {
-		err = errnoErr(e1)
-	}
-	return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
 func pipe2(p *[2]_C_int, flags int) (err error) {
 	_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
 	if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go
index 0b5b2f014..c8536c2c9 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go
@@ -351,18 +351,6 @@ func Munlockall() (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func pipe() (fd1 int, fd2 int, err error) {
-	r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
-	fd1 = int(r0)
-	fd2 = int(r1)
-	if e1 != 0 {
-		err = errnoErr(e1)
-	}
-	return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
 func pipe2(p *[2]_C_int, flags int) (err error) {
 	_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
 	if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go
index bfca28648..8b981bfc2 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go
@@ -351,18 +351,6 @@ func Munlockall() (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func pipe() (fd1 int, fd2 int, err error) {
-	r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
-	fd1 = int(r0)
-	fd2 = int(r1)
-	if e1 != 0 {
-		err = errnoErr(e1)
-	}
-	return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
 func pipe2(p *[2]_C_int, flags int) (err error) {
 	_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
 	if e1 != 0 {
diff --git a/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go b/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go
index 0e12eb0c4..6211cdc8b 100644
--- a/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go
+++ b/vendor/google.golang.org/api/iamcredentials/v1/iamcredentials-gen.go
@@ -553,7 +553,7 @@ func (c *ProjectsServiceAccountsGenerateAccessTokenCall) Header() http.Header {
 
 func (c *ProjectsServiceAccountsGenerateAccessTokenCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -700,7 +700,7 @@ func (c *ProjectsServiceAccountsGenerateIdTokenCall) Header() http.Header {
 
 func (c *ProjectsServiceAccountsGenerateIdTokenCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -847,7 +847,7 @@ func (c *ProjectsServiceAccountsSignBlobCall) Header() http.Header {
 
 func (c *ProjectsServiceAccountsSignBlobCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -994,7 +994,7 @@ func (c *ProjectsServiceAccountsSignJwtCall) Header() http.Header {
 
 func (c *ProjectsServiceAccountsSignJwtCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
diff --git a/vendor/google.golang.org/api/storage/v1/storage-api.json b/vendor/google.golang.org/api/storage/v1/storage-api.json
index 10383aa7b..2ab3afeea 100644
--- a/vendor/google.golang.org/api/storage/v1/storage-api.json
+++ b/vendor/google.golang.org/api/storage/v1/storage-api.json
@@ -26,7 +26,7 @@
   "description": "Stores and retrieves potentially large, immutable data objects.",
   "discoveryVersion": "v1",
   "documentationLink": "https://developers.google.com/storage/docs/json_api/",
-  "etag": "\"3133363930393533313437363430303131373733\"",
+  "etag": "\"3137363332383633313735343831303635323033\"",
   "icons": {
     "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png",
     "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png"
@@ -3230,7 +3230,7 @@
       }
     }
   },
-  "revision": "20211018",
+  "revision": "20211201",
   "rootUrl": "https://storage.googleapis.com/",
   "schemas": {
     "Bucket": {
@@ -3366,7 +3366,7 @@
               "type": "object"
             },
             "publicAccessPrevention": {
-              "description": "The bucket's Public Access Prevention configuration. Currently, 'unspecified' and 'enforced' are supported.",
+              "description": "The bucket's Public Access Prevention configuration. Currently, 'inherited' and 'enforced' are supported.",
               "type": "string"
             },
             "uniformBucketLevelAccess": {
diff --git a/vendor/google.golang.org/api/storage/v1/storage-gen.go b/vendor/google.golang.org/api/storage/v1/storage-gen.go
index 1200f119a..0984c599c 100644
--- a/vendor/google.golang.org/api/storage/v1/storage-gen.go
+++ b/vendor/google.golang.org/api/storage/v1/storage-gen.go
@@ -612,7 +612,7 @@ type BucketIamConfiguration struct {
 	BucketPolicyOnly *BucketIamConfigurationBucketPolicyOnly `json:"bucketPolicyOnly,omitempty"`
 
 	// PublicAccessPrevention: The bucket's Public Access Prevention
-	// configuration. Currently, 'unspecified' and 'enforced' are supported.
+	// configuration. Currently, 'inherited' and 'enforced' are supported.
 	PublicAccessPrevention string `json:"publicAccessPrevention,omitempty"`
 
 	// UniformBucketLevelAccess: The bucket's uniform bucket-level access
@@ -2520,7 +2520,7 @@ func (c *BucketAccessControlsDeleteCall) Header() http.Header {
 
 func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -2673,7 +2673,7 @@ func (c *BucketAccessControlsGetCall) Header() http.Header {
 
 func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -2842,7 +2842,7 @@ func (c *BucketAccessControlsInsertCall) Header() http.Header {
 
 func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -3017,7 +3017,7 @@ func (c *BucketAccessControlsListCall) Header() http.Header {
 
 func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -3183,7 +3183,7 @@ func (c *BucketAccessControlsPatchCall) Header() http.Header {
 
 func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -3362,7 +3362,7 @@ func (c *BucketAccessControlsUpdateCall) Header() http.Header {
 
 func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -3550,7 +3550,7 @@ func (c *BucketsDeleteCall) Header() http.Header {
 
 func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -3731,7 +3731,7 @@ func (c *BucketsGetCall) Header() http.Header {
 
 func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -3939,7 +3939,7 @@ func (c *BucketsGetIamPolicyCall) Header() http.Header {
 
 func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -4158,7 +4158,7 @@ func (c *BucketsInsertCall) Header() http.Header {
 
 func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -4417,7 +4417,7 @@ func (c *BucketsListCall) Header() http.Header {
 
 func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -4631,7 +4631,7 @@ func (c *BucketsLockRetentionPolicyCall) Header() http.Header {
 
 func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -4868,7 +4868,7 @@ func (c *BucketsPatchCall) Header() http.Header {
 
 func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -5099,7 +5099,7 @@ func (c *BucketsSetIamPolicyCall) Header() http.Header {
 
 func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -5277,7 +5277,7 @@ func (c *BucketsTestIamPermissionsCall) Header() http.Header {
 
 func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -5519,7 +5519,7 @@ func (c *BucketsUpdateCall) Header() http.Header {
 
 func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -5731,7 +5731,7 @@ func (c *ChannelsStopCall) Header() http.Header {
 
 func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -5853,7 +5853,7 @@ func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header {
 
 func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -6006,7 +6006,7 @@ func (c *DefaultObjectAccessControlsGetCall) Header() http.Header {
 
 func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -6176,7 +6176,7 @@ func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header {
 
 func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -6368,7 +6368,7 @@ func (c *DefaultObjectAccessControlsListCall) Header() http.Header {
 
 func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -6546,7 +6546,7 @@ func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header {
 
 func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -6725,7 +6725,7 @@ func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header {
 
 func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -6900,7 +6900,7 @@ func (c *NotificationsDeleteCall) Header() http.Header {
 
 func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -7051,7 +7051,7 @@ func (c *NotificationsGetCall) Header() http.Header {
 
 func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -7223,7 +7223,7 @@ func (c *NotificationsInsertCall) Header() http.Header {
 
 func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -7400,7 +7400,7 @@ func (c *NotificationsListCall) Header() http.Header {
 
 func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -7580,7 +7580,7 @@ func (c *ObjectAccessControlsDeleteCall) Header() http.Header {
 
 func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -7759,7 +7759,7 @@ func (c *ObjectAccessControlsGetCall) Header() http.Header {
 
 func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -7954,7 +7954,7 @@ func (c *ObjectAccessControlsInsertCall) Header() http.Header {
 
 func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -8155,7 +8155,7 @@ func (c *ObjectAccessControlsListCall) Header() http.Header {
 
 func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -8347,7 +8347,7 @@ func (c *ObjectAccessControlsPatchCall) Header() http.Header {
 
 func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -8552,7 +8552,7 @@ func (c *ObjectAccessControlsUpdateCall) Header() http.Header {
 
 func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -8795,7 +8795,7 @@ func (c *ObjectsComposeCall) Header() http.Header {
 
 func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -9151,7 +9151,7 @@ func (c *ObjectsCopyCall) Header() http.Header {
 
 func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -9483,7 +9483,7 @@ func (c *ObjectsDeleteCall) Header() http.Header {
 
 func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -9720,7 +9720,7 @@ func (c *ObjectsGetCall) Header() http.Header {
 
 func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -9974,7 +9974,7 @@ func (c *ObjectsGetIamPolicyCall) Header() http.Header {
 
 func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -10294,7 +10294,7 @@ func (c *ObjectsInsertCall) Header() http.Header {
 
 func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -10669,7 +10669,7 @@ func (c *ObjectsListCall) Header() http.Header {
 
 func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -10990,7 +10990,7 @@ func (c *ObjectsPatchCall) Header() http.Header {
 
 func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -11395,7 +11395,7 @@ func (c *ObjectsRewriteCall) Header() http.Header {
 
 func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -11702,7 +11702,7 @@ func (c *ObjectsSetIamPolicyCall) Header() http.Header {
 
 func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -11907,7 +11907,7 @@ func (c *ObjectsTestIamPermissionsCall) Header() http.Header {
 
 func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -12172,7 +12172,7 @@ func (c *ObjectsUpdateCall) Header() http.Header {
 
 func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -12492,7 +12492,7 @@ func (c *ObjectsWatchAllCall) Header() http.Header {
 
 func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -12711,7 +12711,7 @@ func (c *ProjectsHmacKeysCreateCall) Header() http.Header {
 
 func (c *ProjectsHmacKeysCreateCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -12864,7 +12864,7 @@ func (c *ProjectsHmacKeysDeleteCall) Header() http.Header {
 
 func (c *ProjectsHmacKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -13003,7 +13003,7 @@ func (c *ProjectsHmacKeysGetCall) Header() http.Header {
 
 func (c *ProjectsHmacKeysGetCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -13205,7 +13205,7 @@ func (c *ProjectsHmacKeysListCall) Header() http.Header {
 
 func (c *ProjectsHmacKeysListCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -13404,7 +13404,7 @@ func (c *ProjectsHmacKeysUpdateCall) Header() http.Header {
 
 func (c *ProjectsHmacKeysUpdateCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
@@ -13583,7 +13583,7 @@ func (c *ProjectsServiceAccountGetCall) Header() http.Header {
 
 func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) {
 	reqHeaders := make(http.Header)
-	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201")
+	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211207")
 	for k, v := range c.header_ {
 		reqHeaders[k] = v
 	}
diff --git a/vendor/google.golang.org/api/transport/grpc/dial.go b/vendor/google.golang.org/api/transport/grpc/dial.go
index 0334ef4f6..d6a34fc6f 100644
--- a/vendor/google.golang.org/api/transport/grpc/dial.go
+++ b/vendor/google.golang.org/api/transport/grpc/dial.go
@@ -142,7 +142,7 @@ func dial(ctx context.Context, insecure bool, o *internal.DialSettings) (*grpc.C
 		// Attempt Direct Path:
 		if o.EnableDirectPath && checkDirectPathEndPoint(endpoint) && isTokenSourceDirectPathCompatible(creds.TokenSource, o) && metadata.OnGCE() {
 			grpcOpts = []grpc.DialOption{
-				grpc.WithCredentialsBundle(grpcgoogle.NewComputeEngineCredentials())}
+				grpc.WithCredentialsBundle(grpcgoogle.NewDefaultCredentialsWithOptions(grpcgoogle.DefaultCredentialsOptions{oauth.TokenSource{creds.TokenSource}}))}
 			if timeoutDialerOption != nil {
 				grpcOpts = append(grpcOpts, timeoutDialerOption)
 			}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index f4c913093..ba4e6b2f3 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -1,4 +1,4 @@
-# cloud.google.com/go v0.98.0
+# cloud.google.com/go v0.99.0
 ## explicit
 cloud.google.com/go
 cloud.google.com/go/compute/metadata
@@ -22,14 +22,14 @@ github.com/VictoriaMetrics/fasthttp/stackless
 # github.com/VictoriaMetrics/metrics v1.18.1
 ## explicit
 github.com/VictoriaMetrics/metrics
-# github.com/VictoriaMetrics/metricsql v0.31.0
+# github.com/VictoriaMetrics/metricsql v0.32.0
 ## explicit
 github.com/VictoriaMetrics/metricsql
 github.com/VictoriaMetrics/metricsql/binaryop
 # github.com/VividCortex/ewma v1.2.0
 ## explicit
 github.com/VividCortex/ewma
-# github.com/aws/aws-sdk-go v1.42.19
+# github.com/aws/aws-sdk-go v1.42.22
 ## explicit
 github.com/aws/aws-sdk-go/aws
 github.com/aws/aws-sdk-go/aws/arn
@@ -305,7 +305,7 @@ go.opencensus.io/trace/propagation
 go.opencensus.io/trace/tracestate
 # go.uber.org/atomic v1.9.0
 go.uber.org/atomic
-# golang.org/x/net v0.0.0-20211205041911-012df41ee64c
+# golang.org/x/net v0.0.0-20211209124913-491a49abca63
 ## explicit
 golang.org/x/net/context
 golang.org/x/net/context/ctxhttp
@@ -329,7 +329,7 @@ golang.org/x/oauth2/jws
 golang.org/x/oauth2/jwt
 # golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
 golang.org/x/sync/errgroup
-# golang.org/x/sys v0.0.0-20211205182925-97ca703d548d
+# golang.org/x/sys v0.0.0-20211210111614-af8b64212486
 ## explicit
 golang.org/x/sys/internal/unsafeheader
 golang.org/x/sys/unix
@@ -342,7 +342,7 @@ golang.org/x/text/unicode/norm
 # golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
 golang.org/x/xerrors
 golang.org/x/xerrors/internal
-# google.golang.org/api v0.61.0
+# google.golang.org/api v0.62.0
 ## explicit
 google.golang.org/api/googleapi
 google.golang.org/api/googleapi/transport
@@ -374,7 +374,7 @@ google.golang.org/appengine/internal/socket
 google.golang.org/appengine/internal/urlfetch
 google.golang.org/appengine/socket
 google.golang.org/appengine/urlfetch
-# google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9
+# google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa
 ## explicit
 google.golang.org/genproto/googleapis/api/annotations
 google.golang.org/genproto/googleapis/api/expr/v1alpha1


Test patch:
diff --git a/app/vmselect/promql/exec_test.go b/app/vmselect/promql/exec_test.go
index 75a846a52..cfd76878a 100644
--- a/app/vmselect/promql/exec_test.go
+++ b/app/vmselect/promql/exec_test.go
@@ -2055,6 +2055,24 @@ func TestExecSuccess(t *testing.T) {
 		resultExpected := []netstorage.Result{r1, r2, r3}
 		f(q, resultExpected)
 	})
+	t.Run(`limit_offset`, func(t *testing.T) {
+		t.Parallel()
+		q := `limit_offset(1, 1, sort_by_label((
+			label_set(time()*1, "foo", "y"),
+			label_set(time()*2, "foo", "a"),
+			label_set(time()*3, "foo", "x"),
+		), "foo"))`
+		r := netstorage.Result{
+			Values:     []float64{3000, 3600, 4200, 4800, 5400, 6000},
+			Timestamps: timestampsExpected,
+		}
+		r.MetricName.Tags = []storage.Tag{{
+			Key:   []byte("foo"),
+			Value: []byte("x"),
+		}}
+		resultExpected := []netstorage.Result{r}
+		f(q, resultExpected)
+	})
 	t.Run(`sum(label_graphite_group)`, func(t *testing.T) {
 		t.Parallel()
 		q := `sort(sum by (__name__) (
@@ -5161,21 +5179,6 @@ func TestExecSuccess(t *testing.T) {
 		resultExpected := []netstorage.Result{r1}
 		f(q, resultExpected)
 	})
-	t.Run(`limit_offset()`, func(t *testing.T) {
-		t.Parallel()
-		q := `limit_offset(1, 0, (label_set(10, "foo", "bar"), label_set(time()/150, "xbaz", "sss")))`
-		r1 := netstorage.Result{
-			MetricName: metricNameExpected,
-			Values:     []float64{10, 10, 10, 10, 10, 10},
-			Timestamps: timestampsExpected,
-		}
-		r1.MetricName.Tags = []storage.Tag{{
-			Key:   []byte("foo"),
-			Value: []byte("bar"),
-		}}
-		resultExpected := []netstorage.Result{r1}
-		f(q, resultExpected)
-	})
 	t.Run(`limitk(10)`, func(t *testing.T) {
 		t.Parallel()
 		q := `sort(limitk(10, label_set(10, "foo", "bar") or label_set(time()/150, "baz", "sss")))`