@grafana/scenes 5.3.9--canary.824.9873640037.0 → 5.3.9--canary.830.9908208124.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. package/dist/esm/components/layout/LazyLoader.js +12 -8
  2. package/dist/esm/components/layout/LazyLoader.js.map +1 -1
  3. package/dist/esm/index.js +1 -0
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/esm/querying/SceneQueryRunner.js +1 -2
  6. package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
  7. package/dist/esm/querying/layers/annotations/AnnotationsDataLayer.js +1 -4
  8. package/dist/esm/querying/layers/annotations/AnnotationsDataLayer.js.map +1 -1
  9. package/dist/esm/querying/layers/annotations/standardAnnotationQuery.js +1 -2
  10. package/dist/esm/querying/layers/annotations/standardAnnotationQuery.js.map +1 -1
  11. package/dist/esm/variables/adhoc/AdHocCombobox.js +374 -0
  12. package/dist/esm/variables/adhoc/AdHocCombobox.js.map +1 -0
  13. package/dist/esm/variables/adhoc/AdHocFiltersVariable.js +2 -7
  14. package/dist/esm/variables/adhoc/AdHocFiltersVariable.js.map +1 -1
  15. package/dist/esm/variables/adhoc/AdHocFiltersVariableV2.js +58 -0
  16. package/dist/esm/variables/adhoc/AdHocFiltersVariableV2.js.map +1 -0
  17. package/dist/esm/variables/groupby/GroupByVariable.js +5 -8
  18. package/dist/esm/variables/groupby/GroupByVariable.js.map +1 -1
  19. package/dist/esm/variables/variants/query/QueryVariable.js +2 -3
  20. package/dist/esm/variables/variants/query/QueryVariable.js.map +1 -1
  21. package/dist/index.d.ts +6 -1
  22. package/dist/index.js +1028 -626
  23. package/dist/index.js.map +1 -1
  24. package/package.json +3 -2
  25. package/dist/esm/utils/proxifyScopedVarSceneObject.js +0 -14
  26. package/dist/esm/utils/proxifyScopedVarSceneObject.js.map +0 -1
package/dist/index.js CHANGED
@@ -16,6 +16,8 @@ var css = require('@emotion/css');
16
16
  var uFuzzy = require('@leeoniya/ufuzzy');
17
17
  var reactUse = require('react-use');
18
18
  var operators = require('rxjs/operators');
19
+ var react = require('@floating-ui/react');
20
+ var reactDom = require('react-dom');
19
21
  var ReactGridLayout = require('react-grid-layout');
20
22
  var AutoSizer = require('react-virtualized-auto-sizer');
21
23
  var BarChartPanelCfg_types_gen = require('@grafana/schema/dist/esm/raw/composable/barchart/panelcfg/x/BarChartPanelCfg_types.gen');
@@ -41,19 +43,19 @@ var uFuzzy__default = /*#__PURE__*/_interopDefaultLegacy(uFuzzy);
41
43
  var ReactGridLayout__default = /*#__PURE__*/_interopDefaultLegacy(ReactGridLayout);
42
44
  var AutoSizer__default = /*#__PURE__*/_interopDefaultLegacy(AutoSizer);
43
45
 
44
- var __defProp$K = Object.defineProperty;
45
- var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
46
- var __hasOwnProp$K = Object.prototype.hasOwnProperty;
47
- var __propIsEnum$K = Object.prototype.propertyIsEnumerable;
48
- var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
49
- var __spreadValues$K = (a, b) => {
46
+ var __defProp$L = Object.defineProperty;
47
+ var __getOwnPropSymbols$L = Object.getOwnPropertySymbols;
48
+ var __hasOwnProp$L = Object.prototype.hasOwnProperty;
49
+ var __propIsEnum$L = Object.prototype.propertyIsEnumerable;
50
+ var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
51
+ var __spreadValues$L = (a, b) => {
50
52
  for (var prop in b || (b = {}))
51
- if (__hasOwnProp$K.call(b, prop))
52
- __defNormalProp$K(a, prop, b[prop]);
53
- if (__getOwnPropSymbols$K)
54
- for (var prop of __getOwnPropSymbols$K(b)) {
55
- if (__propIsEnum$K.call(b, prop))
56
- __defNormalProp$K(a, prop, b[prop]);
53
+ if (__hasOwnProp$L.call(b, prop))
54
+ __defNormalProp$L(a, prop, b[prop]);
55
+ if (__getOwnPropSymbols$L)
56
+ for (var prop of __getOwnPropSymbols$L(b)) {
57
+ if (__propIsEnum$L.call(b, prop))
58
+ __defNormalProp$L(a, prop, b[prop]);
57
59
  }
58
60
  return a;
59
61
  };
@@ -62,7 +64,7 @@ function useAppQueryParams() {
62
64
  return runtime.locationSearchToObject(location.search || "");
63
65
  }
64
66
  function getUrlWithAppState(path, preserveParams) {
65
- const paramsCopy = __spreadValues$K({}, runtime.locationService.getSearchObject());
67
+ const paramsCopy = __spreadValues$L({}, runtime.locationService.getSearchObject());
66
68
  if (preserveParams) {
67
69
  for (const key of Object.keys(paramsCopy)) {
68
70
  if (!preserveParams.includes(key)) {
@@ -76,31 +78,31 @@ function renderSceneComponentWithRouteProps(sceneObject, routeProps) {
76
78
  return React__default["default"].createElement(sceneObject.Component, { model: sceneObject, routeProps });
77
79
  }
78
80
 
79
- var __defProp$J = Object.defineProperty;
80
- var __defProps$t = Object.defineProperties;
81
- var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
82
- var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
83
- var __hasOwnProp$J = Object.prototype.hasOwnProperty;
84
- var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
85
- var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
86
- var __spreadValues$J = (a, b) => {
81
+ var __defProp$K = Object.defineProperty;
82
+ var __defProps$u = Object.defineProperties;
83
+ var __getOwnPropDescs$u = Object.getOwnPropertyDescriptors;
84
+ var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
85
+ var __hasOwnProp$K = Object.prototype.hasOwnProperty;
86
+ var __propIsEnum$K = Object.prototype.propertyIsEnumerable;
87
+ var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
88
+ var __spreadValues$K = (a, b) => {
87
89
  for (var prop in b || (b = {}))
88
- if (__hasOwnProp$J.call(b, prop))
89
- __defNormalProp$J(a, prop, b[prop]);
90
- if (__getOwnPropSymbols$J)
91
- for (var prop of __getOwnPropSymbols$J(b)) {
92
- if (__propIsEnum$J.call(b, prop))
93
- __defNormalProp$J(a, prop, b[prop]);
90
+ if (__hasOwnProp$K.call(b, prop))
91
+ __defNormalProp$K(a, prop, b[prop]);
92
+ if (__getOwnPropSymbols$K)
93
+ for (var prop of __getOwnPropSymbols$K(b)) {
94
+ if (__propIsEnum$K.call(b, prop))
95
+ __defNormalProp$K(a, prop, b[prop]);
94
96
  }
95
97
  return a;
96
98
  };
97
- var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
99
+ var __spreadProps$u = (a, b) => __defProps$u(a, __getOwnPropDescs$u(b));
98
100
  const runtimePanelPlugins = /* @__PURE__ */ new Map();
99
101
  function registerRuntimePanelPlugin({ pluginId, plugin }) {
100
102
  if (runtimePanelPlugins.has(pluginId)) {
101
103
  throw new Error(`A runtime panel plugin with id ${pluginId} has already been registered`);
102
104
  }
103
- plugin.meta = __spreadProps$t(__spreadValues$J({}, plugin.meta), {
105
+ plugin.meta = __spreadProps$u(__spreadValues$K({}, plugin.meta), {
104
106
  id: pluginId,
105
107
  name: pluginId,
106
108
  module: "runtime plugin",
@@ -128,39 +130,39 @@ function loadPanelPluginSync(pluginId) {
128
130
  return (_a = getPanelPluginFromCache(pluginId)) != null ? _a : runtimePanelPlugins.get(pluginId);
129
131
  }
130
132
 
131
- var __defProp$I = Object.defineProperty;
132
- var __defProps$s = Object.defineProperties;
133
- var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
134
- var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
135
- var __hasOwnProp$I = Object.prototype.hasOwnProperty;
136
- var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
137
- var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
138
- var __spreadValues$I = (a, b) => {
133
+ var __defProp$J = Object.defineProperty;
134
+ var __defProps$t = Object.defineProperties;
135
+ var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
136
+ var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
137
+ var __hasOwnProp$J = Object.prototype.hasOwnProperty;
138
+ var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
139
+ var __defNormalProp$J = (obj, key, value) => key in obj ? __defProp$J(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
140
+ var __spreadValues$J = (a, b) => {
139
141
  for (var prop in b || (b = {}))
140
- if (__hasOwnProp$I.call(b, prop))
141
- __defNormalProp$I(a, prop, b[prop]);
142
- if (__getOwnPropSymbols$I)
143
- for (var prop of __getOwnPropSymbols$I(b)) {
144
- if (__propIsEnum$I.call(b, prop))
145
- __defNormalProp$I(a, prop, b[prop]);
142
+ if (__hasOwnProp$J.call(b, prop))
143
+ __defNormalProp$J(a, prop, b[prop]);
144
+ if (__getOwnPropSymbols$J)
145
+ for (var prop of __getOwnPropSymbols$J(b)) {
146
+ if (__propIsEnum$J.call(b, prop))
147
+ __defNormalProp$J(a, prop, b[prop]);
146
148
  }
147
149
  return a;
148
150
  };
149
- var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
150
- var __objRest$4 = (source, exclude) => {
151
+ var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
152
+ var __objRest$5 = (source, exclude) => {
151
153
  var target = {};
152
154
  for (var prop in source)
153
- if (__hasOwnProp$I.call(source, prop) && exclude.indexOf(prop) < 0)
155
+ if (__hasOwnProp$J.call(source, prop) && exclude.indexOf(prop) < 0)
154
156
  target[prop] = source[prop];
155
- if (source != null && __getOwnPropSymbols$I)
156
- for (var prop of __getOwnPropSymbols$I(source)) {
157
- if (exclude.indexOf(prop) < 0 && __propIsEnum$I.call(source, prop))
157
+ if (source != null && __getOwnPropSymbols$J)
158
+ for (var prop of __getOwnPropSymbols$J(source)) {
159
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$J.call(source, prop))
158
160
  target[prop] = source[prop];
159
161
  }
160
162
  return target;
161
163
  };
162
164
  function SceneComponentWrapperWithoutMemo(_a) {
163
- var _b = _a, { model } = _b, otherProps = __objRest$4(_b, ["model"]);
165
+ var _b = _a, { model } = _b, otherProps = __objRest$5(_b, ["model"]);
164
166
  var _a2;
165
167
  const Component = (_a2 = model.constructor["Component"]) != null ? _a2 : EmptyRenderer;
166
168
  const [_, setValue] = React.useState(0);
@@ -172,7 +174,7 @@ function SceneComponentWrapperWithoutMemo(_a) {
172
174
  if (!model.isActive) {
173
175
  return null;
174
176
  }
175
- return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$s(__spreadValues$I({}, otherProps), {
177
+ return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$t(__spreadValues$J({}, otherProps), {
176
178
  model
177
179
  }));
178
180
  }
@@ -218,19 +220,19 @@ class SceneObjectRef {
218
220
  }
219
221
  _ref = new WeakMap();
220
222
 
221
- var __defProp$H = Object.defineProperty;
222
- var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
223
- var __hasOwnProp$H = Object.prototype.hasOwnProperty;
224
- var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
225
- var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
226
- var __spreadValues$H = (a, b) => {
223
+ var __defProp$I = Object.defineProperty;
224
+ var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
225
+ var __hasOwnProp$I = Object.prototype.hasOwnProperty;
226
+ var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
227
+ var __defNormalProp$I = (obj, key, value) => key in obj ? __defProp$I(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
228
+ var __spreadValues$I = (a, b) => {
227
229
  for (var prop in b || (b = {}))
228
- if (__hasOwnProp$H.call(b, prop))
229
- __defNormalProp$H(a, prop, b[prop]);
230
- if (__getOwnPropSymbols$H)
231
- for (var prop of __getOwnPropSymbols$H(b)) {
232
- if (__propIsEnum$H.call(b, prop))
233
- __defNormalProp$H(a, prop, b[prop]);
230
+ if (__hasOwnProp$I.call(b, prop))
231
+ __defNormalProp$I(a, prop, b[prop]);
232
+ if (__getOwnPropSymbols$I)
233
+ for (var prop of __getOwnPropSymbols$I(b)) {
234
+ if (__propIsEnum$I.call(b, prop))
235
+ __defNormalProp$I(a, prop, b[prop]);
234
236
  }
235
237
  return a;
236
238
  };
@@ -290,7 +292,7 @@ class SceneObjectBase {
290
292
  }
291
293
  setState(update) {
292
294
  const prevState = this._state;
293
- const newState = __spreadValues$H(__spreadValues$H({}, this._state), update);
295
+ const newState = __spreadValues$I(__spreadValues$I({}, this._state), update);
294
296
  this._state = Object.freeze(newState);
295
297
  this._setParent(update);
296
298
  this._handleActivationOfChangedStateProps(prevState, newState);
@@ -486,19 +488,19 @@ function forEachChild(state, callback) {
486
488
  }
487
489
  }
488
490
 
489
- var __defProp$G = Object.defineProperty;
490
- var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
491
- var __hasOwnProp$G = Object.prototype.hasOwnProperty;
492
- var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
493
- var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
494
- var __spreadValues$G = (a, b) => {
491
+ var __defProp$H = Object.defineProperty;
492
+ var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
493
+ var __hasOwnProp$H = Object.prototype.hasOwnProperty;
494
+ var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
495
+ var __defNormalProp$H = (obj, key, value) => key in obj ? __defProp$H(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
496
+ var __spreadValues$H = (a, b) => {
495
497
  for (var prop in b || (b = {}))
496
- if (__hasOwnProp$G.call(b, prop))
497
- __defNormalProp$G(a, prop, b[prop]);
498
- if (__getOwnPropSymbols$G)
499
- for (var prop of __getOwnPropSymbols$G(b)) {
500
- if (__propIsEnum$G.call(b, prop))
501
- __defNormalProp$G(a, prop, b[prop]);
498
+ if (__hasOwnProp$H.call(b, prop))
499
+ __defNormalProp$H(a, prop, b[prop]);
500
+ if (__getOwnPropSymbols$H)
501
+ for (var prop of __getOwnPropSymbols$H(b)) {
502
+ if (__propIsEnum$H.call(b, prop))
503
+ __defNormalProp$H(a, prop, b[prop]);
502
504
  }
503
505
  return a;
504
506
  };
@@ -507,7 +509,7 @@ function cloneSceneObject(sceneObject, withState) {
507
509
  return new sceneObject.constructor(clonedState);
508
510
  }
509
511
  function cloneSceneObjectState(sceneState, withState) {
510
- const clonedState = __spreadValues$G({}, sceneState);
512
+ const clonedState = __spreadValues$H({}, sceneState);
511
513
  for (const key in clonedState) {
512
514
  const propValue = clonedState[key];
513
515
  if (propValue instanceof SceneObjectBase) {
@@ -604,25 +606,25 @@ function lookupVariable(name, sceneObject) {
604
606
  return null;
605
607
  }
606
608
 
607
- var __defProp$F = Object.defineProperty;
608
- var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
609
- var __hasOwnProp$F = Object.prototype.hasOwnProperty;
610
- var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
611
- var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
612
- var __spreadValues$F = (a, b) => {
609
+ var __defProp$G = Object.defineProperty;
610
+ var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
611
+ var __hasOwnProp$G = Object.prototype.hasOwnProperty;
612
+ var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
613
+ var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
614
+ var __spreadValues$G = (a, b) => {
613
615
  for (var prop in b || (b = {}))
614
- if (__hasOwnProp$F.call(b, prop))
615
- __defNormalProp$F(a, prop, b[prop]);
616
- if (__getOwnPropSymbols$F)
617
- for (var prop of __getOwnPropSymbols$F(b)) {
618
- if (__propIsEnum$F.call(b, prop))
619
- __defNormalProp$F(a, prop, b[prop]);
616
+ if (__hasOwnProp$G.call(b, prop))
617
+ __defNormalProp$G(a, prop, b[prop]);
618
+ if (__getOwnPropSymbols$G)
619
+ for (var prop of __getOwnPropSymbols$G(b)) {
620
+ if (__propIsEnum$G.call(b, prop))
621
+ __defNormalProp$G(a, prop, b[prop]);
620
622
  }
621
623
  return a;
622
624
  };
623
625
  class SceneDataNode extends SceneObjectBase {
624
626
  constructor(state) {
625
- super(__spreadValues$F({
627
+ super(__spreadValues$G({
626
628
  data: emptyPanelData
627
629
  }, state));
628
630
  }
@@ -703,19 +705,19 @@ function evaluateTimeRange(from, to, timeZone, fiscalYearStartMonth, delay) {
703
705
  };
704
706
  }
705
707
 
706
- var __defProp$E = Object.defineProperty;
707
- var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
708
- var __hasOwnProp$E = Object.prototype.hasOwnProperty;
709
- var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
710
- var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
711
- var __spreadValues$E = (a, b) => {
708
+ var __defProp$F = Object.defineProperty;
709
+ var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
710
+ var __hasOwnProp$F = Object.prototype.hasOwnProperty;
711
+ var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
712
+ var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
713
+ var __spreadValues$F = (a, b) => {
712
714
  for (var prop in b || (b = {}))
713
- if (__hasOwnProp$E.call(b, prop))
714
- __defNormalProp$E(a, prop, b[prop]);
715
- if (__getOwnPropSymbols$E)
716
- for (var prop of __getOwnPropSymbols$E(b)) {
717
- if (__propIsEnum$E.call(b, prop))
718
- __defNormalProp$E(a, prop, b[prop]);
715
+ if (__hasOwnProp$F.call(b, prop))
716
+ __defNormalProp$F(a, prop, b[prop]);
717
+ if (__getOwnPropSymbols$F)
718
+ for (var prop of __getOwnPropSymbols$F(b)) {
719
+ if (__propIsEnum$F.call(b, prop))
720
+ __defNormalProp$F(a, prop, b[prop]);
719
721
  }
720
722
  return a;
721
723
  };
@@ -732,7 +734,7 @@ class SceneTimeRange extends SceneObjectBase {
732
734
  state.fiscalYearStartMonth,
733
735
  state.UNSAFE_nowDelay
734
736
  );
735
- super(__spreadValues$E({ from, to, timeZone, value }, state));
737
+ super(__spreadValues$F({ from, to, timeZone, value }, state));
736
738
  this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["from", "to", "timezone"] });
737
739
  this.onTimeRangeChange = (timeRange) => {
738
740
  const update = {};
@@ -1362,25 +1364,25 @@ function collectAllVariables(sceneObject, record = {}) {
1362
1364
  return record;
1363
1365
  }
1364
1366
 
1365
- var __defProp$D = Object.defineProperty;
1366
- var __defProps$r = Object.defineProperties;
1367
- var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
1368
- var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
1369
- var __hasOwnProp$D = Object.prototype.hasOwnProperty;
1370
- var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
1371
- var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1372
- var __spreadValues$D = (a, b) => {
1367
+ var __defProp$E = Object.defineProperty;
1368
+ var __defProps$s = Object.defineProperties;
1369
+ var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
1370
+ var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
1371
+ var __hasOwnProp$E = Object.prototype.hasOwnProperty;
1372
+ var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
1373
+ var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1374
+ var __spreadValues$E = (a, b) => {
1373
1375
  for (var prop in b || (b = {}))
1374
- if (__hasOwnProp$D.call(b, prop))
1375
- __defNormalProp$D(a, prop, b[prop]);
1376
- if (__getOwnPropSymbols$D)
1377
- for (var prop of __getOwnPropSymbols$D(b)) {
1378
- if (__propIsEnum$D.call(b, prop))
1379
- __defNormalProp$D(a, prop, b[prop]);
1376
+ if (__hasOwnProp$E.call(b, prop))
1377
+ __defNormalProp$E(a, prop, b[prop]);
1378
+ if (__getOwnPropSymbols$E)
1379
+ for (var prop of __getOwnPropSymbols$E(b)) {
1380
+ if (__propIsEnum$E.call(b, prop))
1381
+ __defNormalProp$E(a, prop, b[prop]);
1380
1382
  }
1381
1383
  return a;
1382
1384
  };
1383
- var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
1385
+ var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
1384
1386
  function getTemplateProxyForField(field, frame, frames) {
1385
1387
  return new Proxy(
1386
1388
  {},
@@ -1396,7 +1398,7 @@ function getTemplateProxyForField(field, frame, frames) {
1396
1398
  if (!field.labels) {
1397
1399
  return "";
1398
1400
  }
1399
- return __spreadProps$r(__spreadValues$D({}, field.labels), {
1401
+ return __spreadProps$s(__spreadValues$E({}, field.labels), {
1400
1402
  __values: Object.values(field.labels).sort().join(", "),
1401
1403
  toString: () => {
1402
1404
  return data.formatLabels(field.labels, "", true);
@@ -2281,25 +2283,25 @@ function isExtraQueryProvider(obj) {
2281
2283
  return typeof obj === "object" && "getExtraQueries" in obj;
2282
2284
  }
2283
2285
 
2284
- var __defProp$C = Object.defineProperty;
2285
- var __defProps$q = Object.defineProperties;
2286
- var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
2287
- var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
2288
- var __hasOwnProp$C = Object.prototype.hasOwnProperty;
2289
- var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
2290
- var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2291
- var __spreadValues$C = (a, b) => {
2286
+ var __defProp$D = Object.defineProperty;
2287
+ var __defProps$r = Object.defineProperties;
2288
+ var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
2289
+ var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
2290
+ var __hasOwnProp$D = Object.prototype.hasOwnProperty;
2291
+ var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
2292
+ var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2293
+ var __spreadValues$D = (a, b) => {
2292
2294
  for (var prop in b || (b = {}))
2293
- if (__hasOwnProp$C.call(b, prop))
2294
- __defNormalProp$C(a, prop, b[prop]);
2295
- if (__getOwnPropSymbols$C)
2296
- for (var prop of __getOwnPropSymbols$C(b)) {
2297
- if (__propIsEnum$C.call(b, prop))
2298
- __defNormalProp$C(a, prop, b[prop]);
2295
+ if (__hasOwnProp$D.call(b, prop))
2296
+ __defNormalProp$D(a, prop, b[prop]);
2297
+ if (__getOwnPropSymbols$D)
2298
+ for (var prop of __getOwnPropSymbols$D(b)) {
2299
+ if (__propIsEnum$D.call(b, prop))
2300
+ __defNormalProp$D(a, prop, b[prop]);
2299
2301
  }
2300
2302
  return a;
2301
2303
  };
2302
- var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
2304
+ var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
2303
2305
  const passthroughProcessor = (_, secondary) => rxjs.of(secondary);
2304
2306
  const extraQueryProcessingOperator = (processors) => (data) => {
2305
2307
  return data.pipe(
@@ -2312,7 +2314,7 @@ const extraQueryProcessingOperator = (processors) => (data) => {
2312
2314
  }),
2313
2315
  rxjs.map(([primary, ...processedSecondaries]) => {
2314
2316
  var _a;
2315
- return __spreadProps$q(__spreadValues$C({}, primary), {
2317
+ return __spreadProps$r(__spreadValues$D({}, primary), {
2316
2318
  series: [...primary.series, ...processedSecondaries.flatMap((s) => s.series)],
2317
2319
  annotations: [...(_a = primary.annotations) != null ? _a : [], ...processedSecondaries.flatMap((s) => {
2318
2320
  var _a2;
@@ -2323,25 +2325,25 @@ const extraQueryProcessingOperator = (processors) => (data) => {
2323
2325
  );
2324
2326
  };
2325
2327
 
2326
- var __defProp$B = Object.defineProperty;
2327
- var __defProps$p = Object.defineProperties;
2328
- var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
2329
- var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
2330
- var __hasOwnProp$B = Object.prototype.hasOwnProperty;
2331
- var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
2332
- var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2333
- var __spreadValues$B = (a, b) => {
2328
+ var __defProp$C = Object.defineProperty;
2329
+ var __defProps$q = Object.defineProperties;
2330
+ var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
2331
+ var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
2332
+ var __hasOwnProp$C = Object.prototype.hasOwnProperty;
2333
+ var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
2334
+ var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2335
+ var __spreadValues$C = (a, b) => {
2334
2336
  for (var prop in b || (b = {}))
2335
- if (__hasOwnProp$B.call(b, prop))
2336
- __defNormalProp$B(a, prop, b[prop]);
2337
- if (__getOwnPropSymbols$B)
2338
- for (var prop of __getOwnPropSymbols$B(b)) {
2339
- if (__propIsEnum$B.call(b, prop))
2340
- __defNormalProp$B(a, prop, b[prop]);
2337
+ if (__hasOwnProp$C.call(b, prop))
2338
+ __defNormalProp$C(a, prop, b[prop]);
2339
+ if (__getOwnPropSymbols$C)
2340
+ for (var prop of __getOwnPropSymbols$C(b)) {
2341
+ if (__propIsEnum$C.call(b, prop))
2342
+ __defNormalProp$C(a, prop, b[prop]);
2341
2343
  }
2342
2344
  return a;
2343
2345
  };
2344
- var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
2346
+ var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
2345
2347
  function filterAnnotations(data, filters) {
2346
2348
  var _a;
2347
2349
  if (!Array.isArray(data) || data.length === 0) {
@@ -2392,11 +2394,11 @@ function filterAnnotations(data, filters) {
2392
2394
  continue;
2393
2395
  }
2394
2396
  }
2395
- fields.push(__spreadProps$p(__spreadValues$B({}, field), {
2397
+ fields.push(__spreadProps$q(__spreadValues$C({}, field), {
2396
2398
  values: buffer
2397
2399
  }));
2398
2400
  }
2399
- processed.push(__spreadProps$p(__spreadValues$B({}, frame), {
2401
+ processed.push(__spreadProps$q(__spreadValues$C({}, frame), {
2400
2402
  fields,
2401
2403
  length: frameLength
2402
2404
  }));
@@ -2822,33 +2824,33 @@ function getOptionSearcher(options, includeAll) {
2822
2824
  };
2823
2825
  }
2824
2826
 
2825
- var __defProp$A = Object.defineProperty;
2826
- var __defProps$o = Object.defineProperties;
2827
- var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
2828
- var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
2829
- var __hasOwnProp$A = Object.prototype.hasOwnProperty;
2830
- var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
2831
- var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2832
- var __spreadValues$A = (a, b) => {
2827
+ var __defProp$B = Object.defineProperty;
2828
+ var __defProps$p = Object.defineProperties;
2829
+ var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
2830
+ var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
2831
+ var __hasOwnProp$B = Object.prototype.hasOwnProperty;
2832
+ var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
2833
+ var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2834
+ var __spreadValues$B = (a, b) => {
2833
2835
  for (var prop in b || (b = {}))
2834
- if (__hasOwnProp$A.call(b, prop))
2835
- __defNormalProp$A(a, prop, b[prop]);
2836
- if (__getOwnPropSymbols$A)
2837
- for (var prop of __getOwnPropSymbols$A(b)) {
2838
- if (__propIsEnum$A.call(b, prop))
2839
- __defNormalProp$A(a, prop, b[prop]);
2836
+ if (__hasOwnProp$B.call(b, prop))
2837
+ __defNormalProp$B(a, prop, b[prop]);
2838
+ if (__getOwnPropSymbols$B)
2839
+ for (var prop of __getOwnPropSymbols$B(b)) {
2840
+ if (__propIsEnum$B.call(b, prop))
2841
+ __defNormalProp$B(a, prop, b[prop]);
2840
2842
  }
2841
2843
  return a;
2842
2844
  };
2843
- var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
2844
- var __objRest$3 = (source, exclude) => {
2845
+ var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
2846
+ var __objRest$4 = (source, exclude) => {
2845
2847
  var target = {};
2846
2848
  for (var prop in source)
2847
- if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
2849
+ if (__hasOwnProp$B.call(source, prop) && exclude.indexOf(prop) < 0)
2848
2850
  target[prop] = source[prop];
2849
- if (source != null && __getOwnPropSymbols$A)
2850
- for (var prop of __getOwnPropSymbols$A(source)) {
2851
- if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
2851
+ if (source != null && __getOwnPropSymbols$B)
2852
+ for (var prop of __getOwnPropSymbols$B(source)) {
2853
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$B.call(source, prop))
2852
2854
  target[prop] = source[prop];
2853
2855
  }
2854
2856
  return target;
@@ -2976,11 +2978,11 @@ const OptionWithCheckbox = ({
2976
2978
  renderOptionLabel
2977
2979
  }) => {
2978
2980
  var _b;
2979
- const _a = innerProps, rest = __objRest$3(_a, ["onMouseMove", "onMouseOver"]);
2981
+ const _a = innerProps, rest = __objRest$4(_a, ["onMouseMove", "onMouseOver"]);
2980
2982
  const theme = ui.useTheme2();
2981
2983
  const selectStyles = ui.getSelectStyles(theme);
2982
2984
  const optionStyles = ui.useStyles2(getOptionStyles);
2983
- return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$o(__spreadValues$A({
2985
+ return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$p(__spreadValues$B({
2984
2986
  ref: innerRef,
2985
2987
  className: css.cx(selectStyles.option, isFocused && selectStyles.optionFocused)
2986
2988
  }, rest), {
@@ -3082,40 +3084,28 @@ function getEnrichedFiltersRequest(sourceRunner) {
3082
3084
  return null;
3083
3085
  }
3084
3086
 
3085
- const handler = {
3086
- get(target, prop) {
3087
- if (prop === "__proxiedObject") {
3088
- return target;
3089
- }
3090
- return "_r";
3091
- }
3092
- };
3093
- function proxifyScopedVarSceneObject(target) {
3094
- return new Proxy(target, handler);
3095
- }
3096
-
3097
- var __defProp$z = Object.defineProperty;
3098
- var __defProps$n = Object.defineProperties;
3099
- var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
3100
- var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
3101
- var __hasOwnProp$z = Object.prototype.hasOwnProperty;
3102
- var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
3103
- var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3104
- var __spreadValues$z = (a, b) => {
3087
+ var __defProp$A = Object.defineProperty;
3088
+ var __defProps$o = Object.defineProperties;
3089
+ var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
3090
+ var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
3091
+ var __hasOwnProp$A = Object.prototype.hasOwnProperty;
3092
+ var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
3093
+ var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3094
+ var __spreadValues$A = (a, b) => {
3105
3095
  for (var prop in b || (b = {}))
3106
- if (__hasOwnProp$z.call(b, prop))
3107
- __defNormalProp$z(a, prop, b[prop]);
3108
- if (__getOwnPropSymbols$z)
3109
- for (var prop of __getOwnPropSymbols$z(b)) {
3110
- if (__propIsEnum$z.call(b, prop))
3111
- __defNormalProp$z(a, prop, b[prop]);
3096
+ if (__hasOwnProp$A.call(b, prop))
3097
+ __defNormalProp$A(a, prop, b[prop]);
3098
+ if (__getOwnPropSymbols$A)
3099
+ for (var prop of __getOwnPropSymbols$A(b)) {
3100
+ if (__propIsEnum$A.call(b, prop))
3101
+ __defNormalProp$A(a, prop, b[prop]);
3112
3102
  }
3113
3103
  return a;
3114
3104
  };
3115
- var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
3105
+ var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
3116
3106
  class GroupByVariable extends MultiValueVariable {
3117
3107
  constructor(initialState) {
3118
- super(__spreadProps$n(__spreadValues$z({
3108
+ super(__spreadProps$o(__spreadValues$A({
3119
3109
  isMulti: true,
3120
3110
  name: "",
3121
3111
  value: [],
@@ -3138,7 +3128,9 @@ class GroupByVariable extends MultiValueVariable {
3138
3128
  return override.values;
3139
3129
  }
3140
3130
  if (this.state.defaultOptions) {
3141
- return this.state.defaultOptions.concat(dataFromResponse((_c = override == null ? void 0 : override.values) != null ? _c : []));
3131
+ return this.state.defaultOptions.concat(
3132
+ dataFromResponse((_c = override == null ? void 0 : override.values) != null ? _c : [])
3133
+ );
3142
3134
  }
3143
3135
  if (!ds.getTagKeys) {
3144
3136
  return [];
@@ -3146,11 +3138,7 @@ class GroupByVariable extends MultiValueVariable {
3146
3138
  const queries = getQueriesForVariables(this);
3147
3139
  const otherFilters = this.state.baseFilters || [];
3148
3140
  const timeRange = sceneGraph.getTimeRange(this).state.value;
3149
- const response = await ds.getTagKeys(__spreadValues$z({
3150
- filters: otherFilters,
3151
- queries,
3152
- timeRange
3153
- }, getEnrichedFiltersRequest(this)));
3141
+ const response = await ds.getTagKeys(__spreadValues$A({ filters: otherFilters, queries, timeRange }, getEnrichedFiltersRequest(this)));
3154
3142
  if (responseHasError(response)) {
3155
3143
  this.setState({ error: response.error.message });
3156
3144
  }
@@ -3199,7 +3187,7 @@ class GroupByVariable extends MultiValueVariable {
3199
3187
  this.setState({ loading: true, error: null });
3200
3188
  return rxjs.from(
3201
3189
  getDataSource(this.state.datasource, {
3202
- __sceneObject: { text: "__sceneObject", value: proxifyScopedVarSceneObject(this) }
3190
+ __sceneObject: { text: "__sceneObject", value: this }
3203
3191
  })
3204
3192
  ).pipe(
3205
3193
  rxjs.mergeMap((ds) => {
@@ -3325,7 +3313,7 @@ function LoadingIndicator(props) {
3325
3313
  }
3326
3314
 
3327
3315
  function ControlsLabel(props) {
3328
- const styles = ui.useStyles2(getStyles$9);
3316
+ const styles = ui.useStyles2(getStyles$a);
3329
3317
  const theme = ui.useTheme2();
3330
3318
  const isVertical = props.layout === "vertical";
3331
3319
  const loadingIndicator = Boolean(props.isLoading) ? /* @__PURE__ */ React__default["default"].createElement("div", {
@@ -3388,7 +3376,7 @@ function ControlsLabel(props) {
3388
3376
  }
3389
3377
  return labelElement;
3390
3378
  }
3391
- const getStyles$9 = (theme) => ({
3379
+ const getStyles$a = (theme) => ({
3392
3380
  horizontalLabel: css.css({
3393
3381
  background: theme.isDark ? theme.colors.background.primary : theme.colors.background.secondary,
3394
3382
  display: `flex`,
@@ -3487,7 +3475,7 @@ function keyLabelToOption(key, label) {
3487
3475
  const filterNoOp = () => true;
3488
3476
  function AdHocFilterRenderer({ filter, model }) {
3489
3477
  var _a, _b;
3490
- const styles = ui.useStyles2(getStyles$8);
3478
+ const styles = ui.useStyles2(getStyles$9);
3491
3479
  const [keys, setKeys] = React.useState([]);
3492
3480
  const [values, setValues] = React.useState([]);
3493
3481
  const [isKeysLoading, setIsKeysLoading] = React.useState(false);
@@ -3631,7 +3619,7 @@ function AdHocFilterRenderer({ filter, model }) {
3631
3619
  onClick: () => model._removeFilter(filter)
3632
3620
  }));
3633
3621
  }
3634
- const getStyles$8 = (theme) => ({
3622
+ const getStyles$9 = (theme) => ({
3635
3623
  field: css.css({
3636
3624
  marginBottom: 0
3637
3625
  }),
@@ -3769,29 +3757,29 @@ function isFilter(filter) {
3769
3757
  return filter !== null && typeof filter.key === "string" && typeof filter.value === "string";
3770
3758
  }
3771
3759
 
3772
- var __defProp$y = Object.defineProperty;
3773
- var __defProps$m = Object.defineProperties;
3774
- var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
3775
- var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
3776
- var __hasOwnProp$y = Object.prototype.hasOwnProperty;
3777
- var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
3778
- var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3779
- var __spreadValues$y = (a, b) => {
3760
+ var __defProp$z = Object.defineProperty;
3761
+ var __defProps$n = Object.defineProperties;
3762
+ var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
3763
+ var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
3764
+ var __hasOwnProp$z = Object.prototype.hasOwnProperty;
3765
+ var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
3766
+ var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3767
+ var __spreadValues$z = (a, b) => {
3780
3768
  for (var prop in b || (b = {}))
3781
- if (__hasOwnProp$y.call(b, prop))
3782
- __defNormalProp$y(a, prop, b[prop]);
3783
- if (__getOwnPropSymbols$y)
3784
- for (var prop of __getOwnPropSymbols$y(b)) {
3785
- if (__propIsEnum$y.call(b, prop))
3786
- __defNormalProp$y(a, prop, b[prop]);
3769
+ if (__hasOwnProp$z.call(b, prop))
3770
+ __defNormalProp$z(a, prop, b[prop]);
3771
+ if (__getOwnPropSymbols$z)
3772
+ for (var prop of __getOwnPropSymbols$z(b)) {
3773
+ if (__propIsEnum$z.call(b, prop))
3774
+ __defNormalProp$z(a, prop, b[prop]);
3787
3775
  }
3788
3776
  return a;
3789
3777
  };
3790
- var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
3778
+ var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
3791
3779
  class AdHocFiltersVariable extends SceneObjectBase {
3792
3780
  constructor(state) {
3793
3781
  var _a, _b;
3794
- super(__spreadValues$y({
3782
+ super(__spreadValues$z({
3795
3783
  type: "adhoc",
3796
3784
  name: (_a = state.name) != null ? _a : "Filters",
3797
3785
  filters: [],
@@ -3799,7 +3787,7 @@ class AdHocFiltersVariable extends SceneObjectBase {
3799
3787
  applyMode: "auto",
3800
3788
  filterExpression: (_b = state.filterExpression) != null ? _b : renderExpression(state.expressionBuilder, state.filters)
3801
3789
  }, state));
3802
- this._scopedVars = { __sceneObject: { value: proxifyScopedVarSceneObject(this) } };
3790
+ this._scopedVars = { __sceneObject: { value: this } };
3803
3791
  this._dataSourceSrv = runtime.getDataSourceSrv();
3804
3792
  this._urlSync = new AdHocFiltersVariableUrlSyncHandler(this);
3805
3793
  if (this.state.applyMode === "auto") {
@@ -3828,15 +3816,15 @@ class AdHocFiltersVariable extends SceneObjectBase {
3828
3816
  const propLabelKey = `${prop}Label`;
3829
3817
  if (filter === _wip) {
3830
3818
  if (prop === "value") {
3831
- this.setState({ filters: [...filters, __spreadProps$m(__spreadValues$y({}, _wip), { [prop]: value, [propLabelKey]: label })], _wip: void 0 });
3819
+ this.setState({ filters: [...filters, __spreadProps$n(__spreadValues$z({}, _wip), { [prop]: value, [propLabelKey]: label })], _wip: void 0 });
3832
3820
  } else {
3833
- this.setState({ _wip: __spreadProps$m(__spreadValues$y({}, filter), { [prop]: value, [propLabelKey]: label }) });
3821
+ this.setState({ _wip: __spreadProps$n(__spreadValues$z({}, filter), { [prop]: value, [propLabelKey]: label }) });
3834
3822
  }
3835
3823
  return;
3836
3824
  }
3837
3825
  const updatedFilters = this.state.filters.map((f) => {
3838
3826
  if (f === filter) {
3839
- const updatedFilter = __spreadProps$m(__spreadValues$y({}, f), { [prop]: value, [propLabelKey]: label });
3827
+ const updatedFilter = __spreadProps$n(__spreadValues$z({}, f), { [prop]: value, [propLabelKey]: label });
3840
3828
  if (prop === "key" && filter[prop] !== value) {
3841
3829
  updatedFilter.value = "";
3842
3830
  updatedFilter.valueLabel = "";
@@ -3870,11 +3858,7 @@ class AdHocFiltersVariable extends SceneObjectBase {
3870
3858
  const otherFilters = this.state.filters.filter((f) => f.key !== currentKey).concat((_c = this.state.baseFilters) != null ? _c : []);
3871
3859
  const timeRange = sceneGraph.getTimeRange(this).state.value;
3872
3860
  const queries = this.state.useQueriesAsFilterForOptions ? getQueriesForVariables(this) : void 0;
3873
- const response = await ds.getTagKeys(__spreadValues$y({
3874
- filters: otherFilters,
3875
- queries,
3876
- timeRange
3877
- }, getEnrichedFiltersRequest(this)));
3861
+ const response = await ds.getTagKeys(__spreadValues$z({ filters: otherFilters, queries, timeRange }, getEnrichedFiltersRequest(this)));
3878
3862
  if (responseHasError(response)) {
3879
3863
  this.setState({ error: response.error.message });
3880
3864
  }
@@ -3901,7 +3885,7 @@ class AdHocFiltersVariable extends SceneObjectBase {
3901
3885
  const otherFilters = this.state.filters.filter((f) => f.key !== filter.key).concat((_c = this.state.baseFilters) != null ? _c : []);
3902
3886
  const timeRange = sceneGraph.getTimeRange(this).state.value;
3903
3887
  const queries = this.state.useQueriesAsFilterForOptions ? getQueriesForVariables(this) : void 0;
3904
- const response = await ds.getTagValues(__spreadValues$y({
3888
+ const response = await ds.getTagValues(__spreadValues$z({
3905
3889
  key: filter.key,
3906
3890
  filters: otherFilters,
3907
3891
  timeRange,
@@ -3934,7 +3918,7 @@ function renderExpression(builder, filters) {
3934
3918
  }
3935
3919
  function AdHocFiltersVariableRenderer({ model }) {
3936
3920
  const { filters, readOnly, addFilterButtonText } = model.useState();
3937
- const styles = ui.useStyles2(getStyles$7);
3921
+ const styles = ui.useStyles2(getStyles$8);
3938
3922
  return /* @__PURE__ */ React__default["default"].createElement("div", {
3939
3923
  className: styles.wrapper
3940
3924
  }, filters.map((filter, index) => /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, {
@@ -3948,7 +3932,7 @@ function AdHocFiltersVariableRenderer({ model }) {
3948
3932
  addFilterButtonText
3949
3933
  }));
3950
3934
  }
3951
- const getStyles$7 = (theme) => ({
3935
+ const getStyles$8 = (theme) => ({
3952
3936
  wrapper: css.css({
3953
3937
  display: "flex",
3954
3938
  flexWrap: "wrap",
@@ -4018,25 +4002,25 @@ function areDifferentLayers(a, b) {
4018
4002
  return false;
4019
4003
  }
4020
4004
 
4021
- var __defProp$x = Object.defineProperty;
4022
- var __defProps$l = Object.defineProperties;
4023
- var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
4024
- var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
4025
- var __hasOwnProp$x = Object.prototype.hasOwnProperty;
4026
- var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
4027
- var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4028
- var __spreadValues$x = (a, b) => {
4005
+ var __defProp$y = Object.defineProperty;
4006
+ var __defProps$m = Object.defineProperties;
4007
+ var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
4008
+ var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
4009
+ var __hasOwnProp$y = Object.prototype.hasOwnProperty;
4010
+ var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
4011
+ var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4012
+ var __spreadValues$y = (a, b) => {
4029
4013
  for (var prop in b || (b = {}))
4030
- if (__hasOwnProp$x.call(b, prop))
4031
- __defNormalProp$x(a, prop, b[prop]);
4032
- if (__getOwnPropSymbols$x)
4033
- for (var prop of __getOwnPropSymbols$x(b)) {
4034
- if (__propIsEnum$x.call(b, prop))
4035
- __defNormalProp$x(a, prop, b[prop]);
4014
+ if (__hasOwnProp$y.call(b, prop))
4015
+ __defNormalProp$y(a, prop, b[prop]);
4016
+ if (__getOwnPropSymbols$y)
4017
+ for (var prop of __getOwnPropSymbols$y(b)) {
4018
+ if (__propIsEnum$y.call(b, prop))
4019
+ __defNormalProp$y(a, prop, b[prop]);
4036
4020
  }
4037
4021
  return a;
4038
4022
  };
4039
- var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
4023
+ var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
4040
4024
  let counter$1 = 100;
4041
4025
  function getNextRequestId$1() {
4042
4026
  return "SQR" + counter$1++;
@@ -4047,7 +4031,7 @@ class SceneQueryRunner extends SceneObjectBase {
4047
4031
  this._dataLayersMerger = new DataLayersMerger();
4048
4032
  this._variableValueRecorder = new VariableValueRecorder();
4049
4033
  this._results = new rxjs.ReplaySubject(1);
4050
- this._scopedVars = { __sceneObject: { value: proxifyScopedVarSceneObject(this), text: "__sceneObject" } };
4034
+ this._scopedVars = { __sceneObject: { value: this, text: "__sceneObject" } };
4051
4035
  this._variableDependency = new VariableDependencyConfig(this, {
4052
4036
  statePaths: ["queries", "datasource"],
4053
4037
  onVariableUpdateCompleted: this.onVariableUpdatesCompleted.bind(this),
@@ -4134,9 +4118,9 @@ class SceneQueryRunner extends SceneObjectBase {
4134
4118
  return;
4135
4119
  }
4136
4120
  this._layerAnnotations = annotations;
4137
- const baseStateUpdate = this.state.data ? this.state.data : __spreadProps$l(__spreadValues$x({}, emptyPanelData), { timeRange: timeRange.state.value });
4121
+ const baseStateUpdate = this.state.data ? this.state.data : __spreadProps$m(__spreadValues$y({}, emptyPanelData), { timeRange: timeRange.state.value });
4138
4122
  this.setState({
4139
- data: __spreadProps$l(__spreadValues$x({}, baseStateUpdate), {
4123
+ data: __spreadProps$m(__spreadValues$y({}, baseStateUpdate), {
4140
4124
  annotations: [...(_d = this._resultAnnotations) != null ? _d : [], ...annotations],
4141
4125
  alertState: alertState != null ? alertState : (_e = this.state.data) == null ? void 0 : _e.alertState
4142
4126
  })
@@ -4255,7 +4239,7 @@ class SceneQueryRunner extends SceneObjectBase {
4255
4239
  this._dataLayersSub = void 0;
4256
4240
  }
4257
4241
  this.setState({
4258
- data: __spreadProps$l(__spreadValues$x({}, this.state.data), { state: schema.LoadingState.Done })
4242
+ data: __spreadProps$m(__spreadValues$y({}, this.state.data), { state: schema.LoadingState.Done })
4259
4243
  });
4260
4244
  }
4261
4245
  async runWithTimeRange(timeRange) {
@@ -4269,7 +4253,7 @@ class SceneQueryRunner extends SceneObjectBase {
4269
4253
  (_a = this._querySub) == null ? void 0 : _a.unsubscribe();
4270
4254
  if (this._variableDependency.hasDependencyInLoadingState()) {
4271
4255
  writeSceneLog("SceneQueryRunner", "Variable dependency is in loading state, skipping query execution");
4272
- this.setState({ data: __spreadProps$l(__spreadValues$x({}, (_b = this.state.data) != null ? _b : emptyPanelData), { state: schema.LoadingState.Loading }) });
4256
+ this.setState({ data: __spreadProps$m(__spreadValues$y({}, (_b = this.state.data) != null ? _b : emptyPanelData), { state: schema.LoadingState.Loading }) });
4273
4257
  return;
4274
4258
  }
4275
4259
  const { queries } = this.state;
@@ -4301,7 +4285,7 @@ class SceneQueryRunner extends SceneObjectBase {
4301
4285
  this._querySub = stream.subscribe(this.onDataReceived);
4302
4286
  } catch (err) {
4303
4287
  console.error("PanelQueryRunner Error", err);
4304
- this.onDataReceived(__spreadProps$l(__spreadValues$x(__spreadValues$x({}, emptyPanelData), this.state.data), {
4288
+ this.onDataReceived(__spreadProps$m(__spreadValues$y(__spreadValues$y({}, emptyPanelData), this.state.data), {
4305
4289
  state: schema.LoadingState.Error,
4306
4290
  errors: [runtime.toDataQueryError(err)]
4307
4291
  }));
@@ -4311,10 +4295,10 @@ class SceneQueryRunner extends SceneObjectBase {
4311
4295
  var _a;
4312
4296
  const clone = super.clone(withState);
4313
4297
  if (this._resultAnnotations) {
4314
- clone["_resultAnnotations"] = this._resultAnnotations.map((frame) => __spreadValues$x({}, frame));
4298
+ clone["_resultAnnotations"] = this._resultAnnotations.map((frame) => __spreadValues$y({}, frame));
4315
4299
  }
4316
4300
  if (this._layerAnnotations) {
4317
- clone["_layerAnnotations"] = this._layerAnnotations.map((frame) => __spreadValues$x({}, frame));
4301
+ clone["_layerAnnotations"] = this._layerAnnotations.map((frame) => __spreadValues$y({}, frame));
4318
4302
  }
4319
4303
  clone["_variableValueRecorder"] = this._variableValueRecorder.cloneAndRecordCurrentValuesForSceneObject(this);
4320
4304
  clone["_containerWidth"] = this._containerWidth;
@@ -4324,7 +4308,7 @@ class SceneQueryRunner extends SceneObjectBase {
4324
4308
  prepareRequests(timeRange, ds) {
4325
4309
  var _a;
4326
4310
  const { minInterval, queries } = this.state;
4327
- let request = __spreadValues$x({
4311
+ let request = __spreadValues$y({
4328
4312
  app: "scenes",
4329
4313
  requestId: getNextRequestId$1(),
4330
4314
  timezone: timeRange.getTimeZone(),
@@ -4370,7 +4354,7 @@ class SceneQueryRunner extends SceneObjectBase {
4370
4354
  for (const provider of (_a = this.getClosestExtraQueryProviders()) != null ? _a : []) {
4371
4355
  for (const { req, processor } of provider.getExtraQueries(request)) {
4372
4356
  const requestId = getNextRequestId$1();
4373
- secondaryRequests.push(__spreadProps$l(__spreadValues$x({}, req), { requestId }));
4357
+ secondaryRequests.push(__spreadProps$m(__spreadValues$y({}, req), { requestId }));
4374
4358
  secondaryProcessors.set(requestId, processor != null ? processor : passthroughProcessor);
4375
4359
  }
4376
4360
  }
@@ -4612,28 +4596,28 @@ class ActWhenVariableChanged extends SceneObjectBase {
4612
4596
  }
4613
4597
  }
4614
4598
 
4615
- var __defProp$w = Object.defineProperty;
4616
- var __defProps$k = Object.defineProperties;
4617
- var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
4618
- var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
4619
- var __hasOwnProp$w = Object.prototype.hasOwnProperty;
4620
- var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
4621
- var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4622
- var __spreadValues$w = (a, b) => {
4599
+ var __defProp$x = Object.defineProperty;
4600
+ var __defProps$l = Object.defineProperties;
4601
+ var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
4602
+ var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
4603
+ var __hasOwnProp$x = Object.prototype.hasOwnProperty;
4604
+ var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
4605
+ var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4606
+ var __spreadValues$x = (a, b) => {
4623
4607
  for (var prop in b || (b = {}))
4624
- if (__hasOwnProp$w.call(b, prop))
4625
- __defNormalProp$w(a, prop, b[prop]);
4626
- if (__getOwnPropSymbols$w)
4627
- for (var prop of __getOwnPropSymbols$w(b)) {
4628
- if (__propIsEnum$w.call(b, prop))
4629
- __defNormalProp$w(a, prop, b[prop]);
4608
+ if (__hasOwnProp$x.call(b, prop))
4609
+ __defNormalProp$x(a, prop, b[prop]);
4610
+ if (__getOwnPropSymbols$x)
4611
+ for (var prop of __getOwnPropSymbols$x(b)) {
4612
+ if (__propIsEnum$x.call(b, prop))
4613
+ __defNormalProp$x(a, prop, b[prop]);
4630
4614
  }
4631
4615
  return a;
4632
4616
  };
4633
- var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
4617
+ var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
4634
4618
  class CursorSync extends SceneObjectBase {
4635
4619
  constructor(state) {
4636
- super(__spreadProps$k(__spreadValues$w({}, state), {
4620
+ super(__spreadProps$l(__spreadValues$x({}, state), {
4637
4621
  sync: state.sync || schema.DashboardCursorSync.Off
4638
4622
  }));
4639
4623
  this.getEventsBus = (panel) => {
@@ -4897,25 +4881,25 @@ const getAlertStateStyles = (theme) => {
4897
4881
  };
4898
4882
  };
4899
4883
 
4900
- var __defProp$v = Object.defineProperty;
4901
- var __defProps$j = Object.defineProperties;
4902
- var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
4903
- var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
4904
- var __hasOwnProp$v = Object.prototype.hasOwnProperty;
4905
- var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
4906
- var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4907
- var __spreadValues$v = (a, b) => {
4884
+ var __defProp$w = Object.defineProperty;
4885
+ var __defProps$k = Object.defineProperties;
4886
+ var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
4887
+ var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
4888
+ var __hasOwnProp$w = Object.prototype.hasOwnProperty;
4889
+ var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
4890
+ var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4891
+ var __spreadValues$w = (a, b) => {
4908
4892
  for (var prop in b || (b = {}))
4909
- if (__hasOwnProp$v.call(b, prop))
4910
- __defNormalProp$v(a, prop, b[prop]);
4911
- if (__getOwnPropSymbols$v)
4912
- for (var prop of __getOwnPropSymbols$v(b)) {
4913
- if (__propIsEnum$v.call(b, prop))
4914
- __defNormalProp$v(a, prop, b[prop]);
4893
+ if (__hasOwnProp$w.call(b, prop))
4894
+ __defNormalProp$w(a, prop, b[prop]);
4895
+ if (__getOwnPropSymbols$w)
4896
+ for (var prop of __getOwnPropSymbols$w(b)) {
4897
+ if (__propIsEnum$w.call(b, prop))
4898
+ __defNormalProp$w(a, prop, b[prop]);
4915
4899
  }
4916
4900
  return a;
4917
4901
  };
4918
- var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
4902
+ var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
4919
4903
  const displayOverrideRef = "hideSeriesFrom";
4920
4904
  const isHideSeriesOverride = data.isSystemOverrideWithRef(displayOverrideRef);
4921
4905
  function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
@@ -4925,13 +4909,13 @@ function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
4925
4909
  if (currentIndex < 0) {
4926
4910
  if (mode === ui.SeriesVisibilityChangeMode.ToggleSelection) {
4927
4911
  const override3 = createOverride$1([displayName, ...getNamesOfHiddenFields(overrides, data)]);
4928
- return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
4912
+ return __spreadProps$k(__spreadValues$w({}, fieldConfig), {
4929
4913
  overrides: [...fieldConfig.overrides, override3]
4930
4914
  });
4931
4915
  }
4932
4916
  const displayNames = getDisplayNames(data, displayName);
4933
4917
  const override2 = createOverride$1(displayNames);
4934
- return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
4918
+ return __spreadProps$k(__spreadValues$w({}, fieldConfig), {
4935
4919
  overrides: [...fieldConfig.overrides, override2]
4936
4920
  });
4937
4921
  }
@@ -4944,22 +4928,22 @@ function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
4944
4928
  existing = existing.filter((el) => nameOfHiddenFields.indexOf(el) < 0);
4945
4929
  }
4946
4930
  if (existing[0] === displayName && existing.length === 1) {
4947
- return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
4931
+ return __spreadProps$k(__spreadValues$w({}, fieldConfig), {
4948
4932
  overrides: overridesCopy
4949
4933
  });
4950
4934
  }
4951
4935
  const override2 = createOverride$1([displayName, ...nameOfHiddenFields]);
4952
- return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
4936
+ return __spreadProps$k(__spreadValues$w({}, fieldConfig), {
4953
4937
  overrides: [...overridesCopy, override2]
4954
4938
  });
4955
4939
  }
4956
4940
  const override = createExtendedOverride(current, displayName);
4957
4941
  if (allFieldsAreExcluded(override, data)) {
4958
- return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
4942
+ return __spreadProps$k(__spreadValues$w({}, fieldConfig), {
4959
4943
  overrides: overridesCopy
4960
4944
  });
4961
4945
  }
4962
- return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
4946
+ return __spreadProps$k(__spreadValues$w({}, fieldConfig), {
4963
4947
  overrides: [...overridesCopy, override]
4964
4948
  });
4965
4949
  }
@@ -4984,7 +4968,7 @@ function createOverride$1(names, mode = data.ByNamesMatcherMode.exclude, propert
4984
4968
  }
4985
4969
  },
4986
4970
  properties: [
4987
- __spreadProps$j(__spreadValues$v({}, property), {
4971
+ __spreadProps$k(__spreadValues$w({}, property), {
4988
4972
  value: {
4989
4973
  viz: true,
4990
4974
  legend: false,
@@ -5056,32 +5040,32 @@ const getNamesOfHiddenFields = (overrides, data$1) => {
5056
5040
  return names;
5057
5041
  };
5058
5042
 
5059
- var __defProp$u = Object.defineProperty;
5060
- var __defProps$i = Object.defineProperties;
5061
- var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
5062
- var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
5063
- var __hasOwnProp$u = Object.prototype.hasOwnProperty;
5064
- var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
5065
- var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5066
- var __spreadValues$u = (a, b) => {
5043
+ var __defProp$v = Object.defineProperty;
5044
+ var __defProps$j = Object.defineProperties;
5045
+ var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
5046
+ var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
5047
+ var __hasOwnProp$v = Object.prototype.hasOwnProperty;
5048
+ var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
5049
+ var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5050
+ var __spreadValues$v = (a, b) => {
5067
5051
  for (var prop in b || (b = {}))
5068
- if (__hasOwnProp$u.call(b, prop))
5069
- __defNormalProp$u(a, prop, b[prop]);
5070
- if (__getOwnPropSymbols$u)
5071
- for (var prop of __getOwnPropSymbols$u(b)) {
5072
- if (__propIsEnum$u.call(b, prop))
5073
- __defNormalProp$u(a, prop, b[prop]);
5052
+ if (__hasOwnProp$v.call(b, prop))
5053
+ __defNormalProp$v(a, prop, b[prop]);
5054
+ if (__getOwnPropSymbols$v)
5055
+ for (var prop of __getOwnPropSymbols$v(b)) {
5056
+ if (__propIsEnum$v.call(b, prop))
5057
+ __defNormalProp$v(a, prop, b[prop]);
5074
5058
  }
5075
5059
  return a;
5076
5060
  };
5077
- var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
5061
+ var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
5078
5062
  const changeSeriesColorConfigFactory = (label, color, fieldConfig) => {
5079
5063
  const { overrides } = fieldConfig;
5080
5064
  const currentIndex = fieldConfig.overrides.findIndex((override) => {
5081
5065
  return override.matcher.id === data.FieldMatcherID.byName && override.matcher.options === label;
5082
5066
  });
5083
5067
  if (currentIndex < 0) {
5084
- return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
5068
+ return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
5085
5069
  overrides: [...fieldConfig.overrides, createOverride(label, color)]
5086
5070
  });
5087
5071
  }
@@ -5089,19 +5073,19 @@ const changeSeriesColorConfigFactory = (label, color, fieldConfig) => {
5089
5073
  const existing = overridesCopy[currentIndex];
5090
5074
  const propertyIndex = existing.properties.findIndex((p) => p.id === "color");
5091
5075
  if (propertyIndex < 0) {
5092
- overridesCopy[currentIndex] = __spreadProps$i(__spreadValues$u({}, existing), {
5076
+ overridesCopy[currentIndex] = __spreadProps$j(__spreadValues$v({}, existing), {
5093
5077
  properties: [...existing.properties, createProperty(color)]
5094
5078
  });
5095
- return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
5079
+ return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
5096
5080
  overrides: overridesCopy
5097
5081
  });
5098
5082
  }
5099
5083
  const propertiesCopy = Array.from(existing.properties);
5100
5084
  propertiesCopy[propertyIndex] = createProperty(color);
5101
- overridesCopy[currentIndex] = __spreadProps$i(__spreadValues$u({}, existing), {
5085
+ overridesCopy[currentIndex] = __spreadProps$j(__spreadValues$v({}, existing), {
5102
5086
  properties: propertiesCopy
5103
5087
  });
5104
- return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
5088
+ return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
5105
5089
  overrides: overridesCopy
5106
5090
  });
5107
5091
  };
@@ -5124,29 +5108,29 @@ const createProperty = (color) => {
5124
5108
  };
5125
5109
  };
5126
5110
 
5127
- var __defProp$t = Object.defineProperty;
5128
- var __defProps$h = Object.defineProperties;
5129
- var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
5130
- var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
5131
- var __hasOwnProp$t = Object.prototype.hasOwnProperty;
5132
- var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
5133
- var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5134
- var __spreadValues$t = (a, b) => {
5111
+ var __defProp$u = Object.defineProperty;
5112
+ var __defProps$i = Object.defineProperties;
5113
+ var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
5114
+ var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
5115
+ var __hasOwnProp$u = Object.prototype.hasOwnProperty;
5116
+ var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
5117
+ var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5118
+ var __spreadValues$u = (a, b) => {
5135
5119
  for (var prop in b || (b = {}))
5136
- if (__hasOwnProp$t.call(b, prop))
5137
- __defNormalProp$t(a, prop, b[prop]);
5138
- if (__getOwnPropSymbols$t)
5139
- for (var prop of __getOwnPropSymbols$t(b)) {
5140
- if (__propIsEnum$t.call(b, prop))
5141
- __defNormalProp$t(a, prop, b[prop]);
5120
+ if (__hasOwnProp$u.call(b, prop))
5121
+ __defNormalProp$u(a, prop, b[prop]);
5122
+ if (__getOwnPropSymbols$u)
5123
+ for (var prop of __getOwnPropSymbols$u(b)) {
5124
+ if (__propIsEnum$u.call(b, prop))
5125
+ __defNormalProp$u(a, prop, b[prop]);
5142
5126
  }
5143
5127
  return a;
5144
5128
  };
5145
- var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
5129
+ var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
5146
5130
  class VizPanel extends SceneObjectBase {
5147
5131
  constructor(state) {
5148
5132
  var _a;
5149
- super(__spreadValues$t({
5133
+ super(__spreadValues$u({
5150
5134
  options: {},
5151
5135
  fieldConfig: { defaults: {}, overrides: [] },
5152
5136
  title: "Title",
@@ -5263,7 +5247,7 @@ class VizPanel extends SceneObjectBase {
5263
5247
  };
5264
5248
  this._onInstanceStateChange = (state) => {
5265
5249
  if (this._panelContext) {
5266
- this._panelContext = __spreadProps$h(__spreadValues$t({}, this._panelContext), {
5250
+ this._panelContext = __spreadProps$i(__spreadValues$u({}, this._panelContext), {
5267
5251
  instanceState: state
5268
5252
  });
5269
5253
  }
@@ -5287,8 +5271,8 @@ class VizPanel extends SceneObjectBase {
5287
5271
  sortBy = sortKey;
5288
5272
  }
5289
5273
  this.onOptionsChange(
5290
- __spreadProps$h(__spreadValues$t({}, this.state.options), {
5291
- legend: __spreadProps$h(__spreadValues$t({}, legendOptions), { sortBy, sortDesc })
5274
+ __spreadProps$i(__spreadValues$u({}, this.state.options), {
5275
+ legend: __spreadProps$i(__spreadValues$u({}, legendOptions), { sortBy, sortDesc })
5292
5276
  }),
5293
5277
  true
5294
5278
  );
@@ -5398,7 +5382,7 @@ class VizPanel extends SceneObjectBase {
5398
5382
  if (!data.compareArrayValues(newFrames, prevFrames, data.compareDataFrameStructures)) {
5399
5383
  this._structureRev++;
5400
5384
  }
5401
- this._dataWithFieldConfig = __spreadProps$h(__spreadValues$t({}, rawData), {
5385
+ this._dataWithFieldConfig = __spreadProps$i(__spreadValues$u({}, rawData), {
5402
5386
  structureRev: this._structureRev,
5403
5387
  series: newFrames
5404
5388
  });
@@ -5541,25 +5525,25 @@ function getMessageFromError(err) {
5541
5525
  return JSON.stringify(err);
5542
5526
  }
5543
5527
 
5544
- var __defProp$s = Object.defineProperty;
5545
- var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
5546
- var __hasOwnProp$s = Object.prototype.hasOwnProperty;
5547
- var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
5548
- var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5549
- var __spreadValues$s = (a, b) => {
5528
+ var __defProp$t = Object.defineProperty;
5529
+ var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
5530
+ var __hasOwnProp$t = Object.prototype.hasOwnProperty;
5531
+ var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
5532
+ var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5533
+ var __spreadValues$t = (a, b) => {
5550
5534
  for (var prop in b || (b = {}))
5551
- if (__hasOwnProp$s.call(b, prop))
5552
- __defNormalProp$s(a, prop, b[prop]);
5553
- if (__getOwnPropSymbols$s)
5554
- for (var prop of __getOwnPropSymbols$s(b)) {
5555
- if (__propIsEnum$s.call(b, prop))
5556
- __defNormalProp$s(a, prop, b[prop]);
5535
+ if (__hasOwnProp$t.call(b, prop))
5536
+ __defNormalProp$t(a, prop, b[prop]);
5537
+ if (__getOwnPropSymbols$t)
5538
+ for (var prop of __getOwnPropSymbols$t(b)) {
5539
+ if (__propIsEnum$t.call(b, prop))
5540
+ __defNormalProp$t(a, prop, b[prop]);
5557
5541
  }
5558
5542
  return a;
5559
5543
  };
5560
5544
  class SceneDataLayerBase extends SceneObjectBase {
5561
5545
  constructor(initialState, variableDependencyStatePaths = []) {
5562
- super(__spreadValues$s({
5546
+ super(__spreadValues$t({
5563
5547
  isEnabled: true
5564
5548
  }, initialState));
5565
5549
  this._results = new rxjs.ReplaySubject(1);
@@ -5684,33 +5668,33 @@ function DataLayerControlSwitch({ layer }) {
5684
5668
  }
5685
5669
  const containerStyle$1 = css.css({ display: "flex" });
5686
5670
 
5687
- var __defProp$r = Object.defineProperty;
5688
- var __defProps$g = Object.defineProperties;
5689
- var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
5690
- var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
5691
- var __hasOwnProp$r = Object.prototype.hasOwnProperty;
5692
- var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
5693
- var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5694
- var __spreadValues$r = (a, b) => {
5671
+ var __defProp$s = Object.defineProperty;
5672
+ var __defProps$h = Object.defineProperties;
5673
+ var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
5674
+ var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
5675
+ var __hasOwnProp$s = Object.prototype.hasOwnProperty;
5676
+ var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
5677
+ var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5678
+ var __spreadValues$s = (a, b) => {
5695
5679
  for (var prop in b || (b = {}))
5696
- if (__hasOwnProp$r.call(b, prop))
5697
- __defNormalProp$r(a, prop, b[prop]);
5698
- if (__getOwnPropSymbols$r)
5699
- for (var prop of __getOwnPropSymbols$r(b)) {
5700
- if (__propIsEnum$r.call(b, prop))
5701
- __defNormalProp$r(a, prop, b[prop]);
5680
+ if (__hasOwnProp$s.call(b, prop))
5681
+ __defNormalProp$s(a, prop, b[prop]);
5682
+ if (__getOwnPropSymbols$s)
5683
+ for (var prop of __getOwnPropSymbols$s(b)) {
5684
+ if (__propIsEnum$s.call(b, prop))
5685
+ __defNormalProp$s(a, prop, b[prop]);
5702
5686
  }
5703
5687
  return a;
5704
5688
  };
5705
- var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
5706
- var __objRest$2 = (source, exclude) => {
5689
+ var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
5690
+ var __objRest$3 = (source, exclude) => {
5707
5691
  var target = {};
5708
5692
  for (var prop in source)
5709
- if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
5693
+ if (__hasOwnProp$s.call(source, prop) && exclude.indexOf(prop) < 0)
5710
5694
  target[prop] = source[prop];
5711
- if (source != null && __getOwnPropSymbols$r)
5712
- for (var prop of __getOwnPropSymbols$r(source)) {
5713
- if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
5695
+ if (source != null && __getOwnPropSymbols$s)
5696
+ for (var prop of __getOwnPropSymbols$s(source)) {
5697
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$s.call(source, prop))
5714
5698
  target[prop] = source[prop];
5715
5699
  }
5716
5700
  return target;
@@ -5718,8 +5702,8 @@ var __objRest$2 = (source, exclude) => {
5718
5702
  const standardAnnotationSupport = {
5719
5703
  prepareAnnotation: (json) => {
5720
5704
  if (lodash.isString(json == null ? void 0 : json.query)) {
5721
- const _a = json, { query } = _a, rest = __objRest$2(_a, ["query"]);
5722
- return __spreadProps$g(__spreadValues$r({}, rest), {
5705
+ const _a = json, { query } = _a, rest = __objRest$3(_a, ["query"]);
5706
+ return __spreadProps$h(__spreadValues$s({}, rest), {
5723
5707
  target: {
5724
5708
  refId: "annotation_query",
5725
5709
  query
@@ -5887,25 +5871,25 @@ function shouldUseLegacyRunner(datasource) {
5887
5871
  return !datasource.annotations || legacyRunner.includes(type);
5888
5872
  }
5889
5873
 
5890
- var __defProp$q = Object.defineProperty;
5891
- var __defProps$f = Object.defineProperties;
5892
- var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
5893
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
5894
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
5895
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
5896
- var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5897
- var __spreadValues$q = (a, b) => {
5874
+ var __defProp$r = Object.defineProperty;
5875
+ var __defProps$g = Object.defineProperties;
5876
+ var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
5877
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
5878
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
5879
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
5880
+ var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5881
+ var __spreadValues$r = (a, b) => {
5898
5882
  for (var prop in b || (b = {}))
5899
- if (__hasOwnProp$q.call(b, prop))
5900
- __defNormalProp$q(a, prop, b[prop]);
5901
- if (__getOwnPropSymbols$q)
5902
- for (var prop of __getOwnPropSymbols$q(b)) {
5903
- if (__propIsEnum$q.call(b, prop))
5904
- __defNormalProp$q(a, prop, b[prop]);
5883
+ if (__hasOwnProp$r.call(b, prop))
5884
+ __defNormalProp$r(a, prop, b[prop]);
5885
+ if (__getOwnPropSymbols$r)
5886
+ for (var prop of __getOwnPropSymbols$r(b)) {
5887
+ if (__propIsEnum$r.call(b, prop))
5888
+ __defNormalProp$r(a, prop, b[prop]);
5905
5889
  }
5906
5890
  return a;
5907
5891
  };
5908
- var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
5892
+ var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
5909
5893
  let counter = 100;
5910
5894
  function getNextRequestId() {
5911
5895
  return "AQ" + counter++;
@@ -5928,8 +5912,8 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
5928
5912
  }))
5929
5913
  );
5930
5914
  }
5931
- const processor = __spreadValues$q(__spreadValues$q({}, standardAnnotationSupport), datasource.annotations);
5932
- const annotationWithDefaults = __spreadValues$q(__spreadValues$q({}, (_a = processor.getDefaultQuery) == null ? void 0 : _a.call(processor)), query);
5915
+ const processor = __spreadValues$r(__spreadValues$r({}, standardAnnotationSupport), datasource.annotations);
5916
+ const annotationWithDefaults = __spreadValues$r(__spreadValues$r({}, (_a = processor.getDefaultQuery) == null ? void 0 : _a.call(processor)), query);
5933
5917
  const annotation = processor.prepareAnnotation(annotationWithDefaults);
5934
5918
  if (!annotation) {
5935
5919
  return rxjs.of({
@@ -5950,9 +5934,9 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
5950
5934
  __interval: { text: interval.interval, value: interval.interval },
5951
5935
  __interval_ms: { text: interval.intervalMs.toString(), value: interval.intervalMs },
5952
5936
  __annotation: { text: annotation.name, value: annotation },
5953
- __sceneObject: { text: "__sceneObject", value: proxifyScopedVarSceneObject(layer) }
5937
+ __sceneObject: { text: "__sceneObject", value: layer }
5954
5938
  };
5955
- const queryRequest = __spreadValues$q(__spreadProps$f(__spreadValues$q({
5939
+ const queryRequest = __spreadValues$r(__spreadProps$g(__spreadValues$r({
5956
5940
  startTime: Date.now(),
5957
5941
  requestId: getNextRequestId(),
5958
5942
  range: timeRange.state.value,
@@ -5962,7 +5946,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
5962
5946
  app: data.CoreApp.Dashboard,
5963
5947
  timezone: timeRange.getTimeZone(),
5964
5948
  targets: [
5965
- __spreadProps$f(__spreadValues$q({}, processedQuery), {
5949
+ __spreadProps$g(__spreadValues$r({}, processedQuery), {
5966
5950
  refId: "Anno"
5967
5951
  })
5968
5952
  ]
@@ -5980,7 +5964,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
5980
5964
  data$1.forEach((frame) => {
5981
5965
  var _a2;
5982
5966
  if (!((_a2 = frame.meta) == null ? void 0 : _a2.dataTopic)) {
5983
- frame.meta = __spreadProps$f(__spreadValues$q({}, frame.meta || {}), { dataTopic: data.DataTopic.Annotations });
5967
+ frame.meta = __spreadProps$g(__spreadValues$r({}, frame.meta || {}), { dataTopic: data.DataTopic.Annotations });
5984
5968
  }
5985
5969
  });
5986
5970
  return processor.processEvents(annotation, data$1).pipe(
@@ -5995,19 +5979,19 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
5995
5979
  );
5996
5980
  }
5997
5981
 
5998
- var __defProp$p = Object.defineProperty;
5999
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
6000
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
6001
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
6002
- var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6003
- var __spreadValues$p = (a, b) => {
5982
+ var __defProp$q = Object.defineProperty;
5983
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
5984
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
5985
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
5986
+ var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5987
+ var __spreadValues$q = (a, b) => {
6004
5988
  for (var prop in b || (b = {}))
6005
- if (__hasOwnProp$p.call(b, prop))
6006
- __defNormalProp$p(a, prop, b[prop]);
6007
- if (__getOwnPropSymbols$p)
6008
- for (var prop of __getOwnPropSymbols$p(b)) {
6009
- if (__propIsEnum$p.call(b, prop))
6010
- __defNormalProp$p(a, prop, b[prop]);
5989
+ if (__hasOwnProp$q.call(b, prop))
5990
+ __defNormalProp$q(a, prop, b[prop]);
5991
+ if (__getOwnPropSymbols$q)
5992
+ for (var prop of __getOwnPropSymbols$q(b)) {
5993
+ if (__propIsEnum$q.call(b, prop))
5994
+ __defNormalProp$q(a, prop, b[prop]);
6011
5995
  }
6012
5996
  return a;
6013
5997
  };
@@ -6018,7 +6002,7 @@ function postProcessQueryResult(annotation, results) {
6018
6002
  }
6019
6003
  const processed = results.map((item) => {
6020
6004
  var _a;
6021
- const processedItem = __spreadValues$p({}, item);
6005
+ const processedItem = __spreadValues$q({}, item);
6022
6006
  processedItem.source = annotation;
6023
6007
  processedItem.color = runtime.config.theme2.visualization.getColorByName(annotation.iconColor);
6024
6008
  processedItem.type = annotation.name;
@@ -6067,36 +6051,34 @@ function isPanelAlert(event) {
6067
6051
  return event.eventType === "panel-alert";
6068
6052
  }
6069
6053
 
6070
- var __defProp$o = Object.defineProperty;
6071
- var __defProps$e = Object.defineProperties;
6072
- var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
6073
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
6074
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
6075
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
6076
- var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6077
- var __spreadValues$o = (a, b) => {
6054
+ var __defProp$p = Object.defineProperty;
6055
+ var __defProps$f = Object.defineProperties;
6056
+ var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
6057
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
6058
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
6059
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
6060
+ var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6061
+ var __spreadValues$p = (a, b) => {
6078
6062
  for (var prop in b || (b = {}))
6079
- if (__hasOwnProp$o.call(b, prop))
6080
- __defNormalProp$o(a, prop, b[prop]);
6081
- if (__getOwnPropSymbols$o)
6082
- for (var prop of __getOwnPropSymbols$o(b)) {
6083
- if (__propIsEnum$o.call(b, prop))
6084
- __defNormalProp$o(a, prop, b[prop]);
6063
+ if (__hasOwnProp$p.call(b, prop))
6064
+ __defNormalProp$p(a, prop, b[prop]);
6065
+ if (__getOwnPropSymbols$p)
6066
+ for (var prop of __getOwnPropSymbols$p(b)) {
6067
+ if (__propIsEnum$p.call(b, prop))
6068
+ __defNormalProp$p(a, prop, b[prop]);
6085
6069
  }
6086
6070
  return a;
6087
6071
  };
6088
- var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
6072
+ var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
6089
6073
  class AnnotationsDataLayer extends SceneDataLayerBase {
6090
6074
  constructor(initialState) {
6091
6075
  super(
6092
- __spreadValues$o({
6076
+ __spreadValues$p({
6093
6077
  isEnabled: true
6094
6078
  }, initialState),
6095
6079
  ["query"]
6096
6080
  );
6097
- this._scopedVars = {
6098
- __sceneObject: { value: proxifyScopedVarSceneObject(this), text: "__sceneObject" }
6099
- };
6081
+ this._scopedVars = { __sceneObject: { value: this, text: "__sceneObject" } };
6100
6082
  }
6101
6083
  onEnable() {
6102
6084
  const timeRange = sceneGraph.getTimeRange(this);
@@ -6139,7 +6121,7 @@ class AnnotationsDataLayer extends SceneDataLayerBase {
6139
6121
  this.publishResults(stateUpdate);
6140
6122
  });
6141
6123
  } catch (e) {
6142
- this.publishResults(__spreadProps$e(__spreadValues$o({}, emptyPanelData), {
6124
+ this.publishResults(__spreadProps$f(__spreadValues$p({}, emptyPanelData), {
6143
6125
  state: schema.LoadingState.Error,
6144
6126
  errors: [
6145
6127
  {
@@ -6156,9 +6138,9 @@ class AnnotationsDataLayer extends SceneDataLayerBase {
6156
6138
  processEvents(query, events) {
6157
6139
  let processedEvents = postProcessQueryResult(query, events.events || []);
6158
6140
  processedEvents = dedupAnnotations(processedEvents);
6159
- const stateUpdate = __spreadProps$e(__spreadValues$o({}, emptyPanelData), { state: events.state });
6141
+ const stateUpdate = __spreadProps$f(__spreadValues$p({}, emptyPanelData), { state: events.state });
6160
6142
  const df = data.arrayToDataFrame(processedEvents);
6161
- df.meta = __spreadProps$e(__spreadValues$o({}, df.meta), {
6143
+ df.meta = __spreadProps$f(__spreadValues$p({}, df.meta), {
6162
6144
  dataTopic: data.DataTopic.Annotations
6163
6145
  });
6164
6146
  stateUpdate.series = [df];
@@ -6211,28 +6193,28 @@ class SceneTimeRangeTransformerBase extends SceneObjectBase {
6211
6193
  }
6212
6194
  }
6213
6195
 
6214
- var __defProp$n = Object.defineProperty;
6215
- var __defProps$d = Object.defineProperties;
6216
- var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
6217
- var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
6218
- var __hasOwnProp$n = Object.prototype.hasOwnProperty;
6219
- var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
6220
- var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6221
- var __spreadValues$n = (a, b) => {
6196
+ var __defProp$o = Object.defineProperty;
6197
+ var __defProps$e = Object.defineProperties;
6198
+ var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
6199
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
6200
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
6201
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
6202
+ var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6203
+ var __spreadValues$o = (a, b) => {
6222
6204
  for (var prop in b || (b = {}))
6223
- if (__hasOwnProp$n.call(b, prop))
6224
- __defNormalProp$n(a, prop, b[prop]);
6225
- if (__getOwnPropSymbols$n)
6226
- for (var prop of __getOwnPropSymbols$n(b)) {
6227
- if (__propIsEnum$n.call(b, prop))
6228
- __defNormalProp$n(a, prop, b[prop]);
6205
+ if (__hasOwnProp$o.call(b, prop))
6206
+ __defNormalProp$o(a, prop, b[prop]);
6207
+ if (__getOwnPropSymbols$o)
6208
+ for (var prop of __getOwnPropSymbols$o(b)) {
6209
+ if (__propIsEnum$o.call(b, prop))
6210
+ __defNormalProp$o(a, prop, b[prop]);
6229
6211
  }
6230
6212
  return a;
6231
6213
  };
6232
- var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
6214
+ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
6233
6215
  class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
6234
6216
  constructor(state) {
6235
- super(__spreadProps$d(__spreadValues$n({}, state), {
6217
+ super(__spreadProps$e(__spreadValues$o({}, state), {
6236
6218
  timeZone: state.timeZone,
6237
6219
  from: "now-6h",
6238
6220
  to: "now",
@@ -6240,7 +6222,7 @@ class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
6240
6222
  }));
6241
6223
  }
6242
6224
  ancestorTimeRangeChanged(timeRange) {
6243
- this.setState(__spreadProps$d(__spreadValues$n({}, timeRange), {
6225
+ this.setState(__spreadProps$e(__spreadValues$o({}, timeRange), {
6244
6226
  timeZone: this.state.timeZone,
6245
6227
  value: evaluateTimeRange(
6246
6228
  timeRange.from,
@@ -6268,25 +6250,25 @@ class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
6268
6250
  }
6269
6251
  }
6270
6252
 
6271
- var __defProp$m = Object.defineProperty;
6272
- var __defProps$c = Object.defineProperties;
6273
- var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
6274
- var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
6275
- var __hasOwnProp$m = Object.prototype.hasOwnProperty;
6276
- var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
6277
- var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6278
- var __spreadValues$m = (a, b) => {
6253
+ var __defProp$n = Object.defineProperty;
6254
+ var __defProps$d = Object.defineProperties;
6255
+ var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
6256
+ var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
6257
+ var __hasOwnProp$n = Object.prototype.hasOwnProperty;
6258
+ var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
6259
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6260
+ var __spreadValues$n = (a, b) => {
6279
6261
  for (var prop in b || (b = {}))
6280
- if (__hasOwnProp$m.call(b, prop))
6281
- __defNormalProp$m(a, prop, b[prop]);
6282
- if (__getOwnPropSymbols$m)
6283
- for (var prop of __getOwnPropSymbols$m(b)) {
6284
- if (__propIsEnum$m.call(b, prop))
6285
- __defNormalProp$m(a, prop, b[prop]);
6262
+ if (__hasOwnProp$n.call(b, prop))
6263
+ __defNormalProp$n(a, prop, b[prop]);
6264
+ if (__getOwnPropSymbols$n)
6265
+ for (var prop of __getOwnPropSymbols$n(b)) {
6266
+ if (__propIsEnum$n.call(b, prop))
6267
+ __defNormalProp$n(a, prop, b[prop]);
6286
6268
  }
6287
6269
  return a;
6288
6270
  };
6289
- var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
6271
+ var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
6290
6272
  class SceneDataLayerSetBase extends SceneObjectBase {
6291
6273
  constructor() {
6292
6274
  super(...arguments);
@@ -6310,7 +6292,7 @@ class SceneDataLayerSetBase extends SceneObjectBase {
6310
6292
  series = series.concat(result.data.series);
6311
6293
  }
6312
6294
  }
6313
- const combinedData = __spreadProps$c(__spreadValues$m({}, emptyPanelData), { series });
6295
+ const combinedData = __spreadProps$d(__spreadValues$n({}, emptyPanelData), { series });
6314
6296
  this._results.next({ origin: this, data: combinedData });
6315
6297
  this.setStateHelper({ data: combinedData });
6316
6298
  }
@@ -6359,25 +6341,25 @@ SceneDataLayerSet.Component = ({ model }) => {
6359
6341
  })));
6360
6342
  };
6361
6343
 
6362
- var __defProp$l = Object.defineProperty;
6363
- var __defProps$b = Object.defineProperties;
6364
- var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
6365
- var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
6366
- var __hasOwnProp$l = Object.prototype.hasOwnProperty;
6367
- var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
6368
- var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6369
- var __spreadValues$l = (a, b) => {
6344
+ var __defProp$m = Object.defineProperty;
6345
+ var __defProps$c = Object.defineProperties;
6346
+ var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
6347
+ var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
6348
+ var __hasOwnProp$m = Object.prototype.hasOwnProperty;
6349
+ var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
6350
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6351
+ var __spreadValues$m = (a, b) => {
6370
6352
  for (var prop in b || (b = {}))
6371
- if (__hasOwnProp$l.call(b, prop))
6372
- __defNormalProp$l(a, prop, b[prop]);
6373
- if (__getOwnPropSymbols$l)
6374
- for (var prop of __getOwnPropSymbols$l(b)) {
6375
- if (__propIsEnum$l.call(b, prop))
6376
- __defNormalProp$l(a, prop, b[prop]);
6353
+ if (__hasOwnProp$m.call(b, prop))
6354
+ __defNormalProp$m(a, prop, b[prop]);
6355
+ if (__getOwnPropSymbols$m)
6356
+ for (var prop of __getOwnPropSymbols$m(b)) {
6357
+ if (__propIsEnum$m.call(b, prop))
6358
+ __defNormalProp$m(a, prop, b[prop]);
6377
6359
  }
6378
6360
  return a;
6379
6361
  };
6380
- var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
6362
+ var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
6381
6363
  class SceneDataTransformer extends SceneObjectBase {
6382
6364
  constructor(state) {
6383
6365
  super(state);
@@ -6454,7 +6436,7 @@ class SceneDataTransformer extends SceneObjectBase {
6454
6436
  const { series, annotations } = this._prevDataFromSource;
6455
6437
  if (data.series === series && data.annotations === annotations) {
6456
6438
  if (this.state.data && data.state !== this.state.data.state) {
6457
- this.setState({ data: __spreadProps$b(__spreadValues$l({}, this.state.data), { state: data.state }) });
6439
+ this.setState({ data: __spreadProps$c(__spreadValues$m({}, this.state.data), { state: data.state }) });
6458
6440
  }
6459
6441
  return true;
6460
6442
  }
@@ -6502,7 +6484,7 @@ class SceneDataTransformer extends SceneObjectBase {
6502
6484
  rxjs.map((values) => {
6503
6485
  const transformedSeries = values[0];
6504
6486
  const transformedAnnotations = values[1];
6505
- return __spreadProps$b(__spreadValues$l({}, data$1), {
6487
+ return __spreadProps$c(__spreadValues$m({}, data$1), {
6506
6488
  series: transformedSeries,
6507
6489
  annotations: transformedAnnotations != null ? transformedAnnotations : data$1.annotations
6508
6490
  });
@@ -6513,7 +6495,7 @@ class SceneDataTransformer extends SceneObjectBase {
6513
6495
  const sourceErr = ((_a2 = this.getSourceData().state.data) == null ? void 0 : _a2.errors) || [];
6514
6496
  const transformationError = runtime.toDataQueryError(err);
6515
6497
  transformationError.message = `Error transforming data: ${transformationError.message}`;
6516
- const result = __spreadProps$b(__spreadValues$l({}, data$1), {
6498
+ const result = __spreadProps$c(__spreadValues$m({}, data$1), {
6517
6499
  state: data.LoadingState.Error,
6518
6500
  errors: [...sourceErr, transformationError]
6519
6501
  });
@@ -6848,28 +6830,28 @@ class SceneVariableSetVariableDependencyHandler {
6848
6830
  }
6849
6831
  }
6850
6832
 
6851
- var __defProp$k = Object.defineProperty;
6852
- var __defProps$a = Object.defineProperties;
6853
- var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
6854
- var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
6855
- var __hasOwnProp$k = Object.prototype.hasOwnProperty;
6856
- var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
6857
- var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6858
- var __spreadValues$k = (a, b) => {
6859
- for (var prop in b || (b = {}))
6860
- if (__hasOwnProp$k.call(b, prop))
6861
- __defNormalProp$k(a, prop, b[prop]);
6862
- if (__getOwnPropSymbols$k)
6863
- for (var prop of __getOwnPropSymbols$k(b)) {
6864
- if (__propIsEnum$k.call(b, prop))
6865
- __defNormalProp$k(a, prop, b[prop]);
6833
+ var __defProp$l = Object.defineProperty;
6834
+ var __defProps$b = Object.defineProperties;
6835
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
6836
+ var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
6837
+ var __hasOwnProp$l = Object.prototype.hasOwnProperty;
6838
+ var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
6839
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6840
+ var __spreadValues$l = (a, b) => {
6841
+ for (var prop in b || (b = {}))
6842
+ if (__hasOwnProp$l.call(b, prop))
6843
+ __defNormalProp$l(a, prop, b[prop]);
6844
+ if (__getOwnPropSymbols$l)
6845
+ for (var prop of __getOwnPropSymbols$l(b)) {
6846
+ if (__propIsEnum$l.call(b, prop))
6847
+ __defNormalProp$l(a, prop, b[prop]);
6866
6848
  }
6867
6849
  return a;
6868
6850
  };
6869
- var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
6851
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
6870
6852
  class ConstantVariable extends SceneObjectBase {
6871
6853
  constructor(initialState) {
6872
- super(__spreadProps$a(__spreadValues$k({
6854
+ super(__spreadProps$b(__spreadValues$l({
6873
6855
  type: "constant",
6874
6856
  value: "",
6875
6857
  name: ""
@@ -6882,25 +6864,25 @@ class ConstantVariable extends SceneObjectBase {
6882
6864
  }
6883
6865
  }
6884
6866
 
6885
- var __defProp$j = Object.defineProperty;
6886
- var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
6887
- var __hasOwnProp$j = Object.prototype.hasOwnProperty;
6888
- var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
6889
- var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6890
- var __spreadValues$j = (a, b) => {
6867
+ var __defProp$k = Object.defineProperty;
6868
+ var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
6869
+ var __hasOwnProp$k = Object.prototype.hasOwnProperty;
6870
+ var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
6871
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6872
+ var __spreadValues$k = (a, b) => {
6891
6873
  for (var prop in b || (b = {}))
6892
- if (__hasOwnProp$j.call(b, prop))
6893
- __defNormalProp$j(a, prop, b[prop]);
6894
- if (__getOwnPropSymbols$j)
6895
- for (var prop of __getOwnPropSymbols$j(b)) {
6896
- if (__propIsEnum$j.call(b, prop))
6897
- __defNormalProp$j(a, prop, b[prop]);
6874
+ if (__hasOwnProp$k.call(b, prop))
6875
+ __defNormalProp$k(a, prop, b[prop]);
6876
+ if (__getOwnPropSymbols$k)
6877
+ for (var prop of __getOwnPropSymbols$k(b)) {
6878
+ if (__propIsEnum$k.call(b, prop))
6879
+ __defNormalProp$k(a, prop, b[prop]);
6898
6880
  }
6899
6881
  return a;
6900
6882
  };
6901
6883
  class CustomVariable extends MultiValueVariable {
6902
6884
  constructor(initialState) {
6903
- super(__spreadValues$j({
6885
+ super(__spreadValues$k({
6904
6886
  type: "custom",
6905
6887
  query: "",
6906
6888
  value: "",
@@ -6934,25 +6916,25 @@ CustomVariable.Component = ({ model }) => {
6934
6916
  return renderSelectForVariable(model);
6935
6917
  };
6936
6918
 
6937
- var __defProp$i = Object.defineProperty;
6938
- var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
6939
- var __hasOwnProp$i = Object.prototype.hasOwnProperty;
6940
- var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
6941
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6942
- var __spreadValues$i = (a, b) => {
6919
+ var __defProp$j = Object.defineProperty;
6920
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
6921
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
6922
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
6923
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6924
+ var __spreadValues$j = (a, b) => {
6943
6925
  for (var prop in b || (b = {}))
6944
- if (__hasOwnProp$i.call(b, prop))
6945
- __defNormalProp$i(a, prop, b[prop]);
6946
- if (__getOwnPropSymbols$i)
6947
- for (var prop of __getOwnPropSymbols$i(b)) {
6948
- if (__propIsEnum$i.call(b, prop))
6949
- __defNormalProp$i(a, prop, b[prop]);
6926
+ if (__hasOwnProp$j.call(b, prop))
6927
+ __defNormalProp$j(a, prop, b[prop]);
6928
+ if (__getOwnPropSymbols$j)
6929
+ for (var prop of __getOwnPropSymbols$j(b)) {
6930
+ if (__propIsEnum$j.call(b, prop))
6931
+ __defNormalProp$j(a, prop, b[prop]);
6950
6932
  }
6951
6933
  return a;
6952
6934
  };
6953
6935
  class DataSourceVariable extends MultiValueVariable {
6954
6936
  constructor(initialState) {
6955
- super(__spreadValues$i({
6937
+ super(__spreadValues$j({
6956
6938
  type: "datasource",
6957
6939
  value: "",
6958
6940
  text: "",
@@ -7036,25 +7018,25 @@ const hasCustomVariableSupport = (datasource) => {
7036
7018
  return "query" in variableSupport && "editor" in variableSupport && Boolean(variableSupport.query) && Boolean(variableSupport.editor);
7037
7019
  };
7038
7020
 
7039
- var __defProp$h = Object.defineProperty;
7040
- var __defProps$9 = Object.defineProperties;
7041
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
7042
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
7043
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
7044
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
7045
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7046
- var __spreadValues$h = (a, b) => {
7021
+ var __defProp$i = Object.defineProperty;
7022
+ var __defProps$a = Object.defineProperties;
7023
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
7024
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
7025
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
7026
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
7027
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7028
+ var __spreadValues$i = (a, b) => {
7047
7029
  for (var prop in b || (b = {}))
7048
- if (__hasOwnProp$h.call(b, prop))
7049
- __defNormalProp$h(a, prop, b[prop]);
7050
- if (__getOwnPropSymbols$h)
7051
- for (var prop of __getOwnPropSymbols$h(b)) {
7052
- if (__propIsEnum$h.call(b, prop))
7053
- __defNormalProp$h(a, prop, b[prop]);
7030
+ if (__hasOwnProp$i.call(b, prop))
7031
+ __defNormalProp$i(a, prop, b[prop]);
7032
+ if (__getOwnPropSymbols$i)
7033
+ for (var prop of __getOwnPropSymbols$i(b)) {
7034
+ if (__propIsEnum$i.call(b, prop))
7035
+ __defNormalProp$i(a, prop, b[prop]);
7054
7036
  }
7055
7037
  return a;
7056
7038
  };
7057
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
7039
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
7058
7040
  class StandardQueryRunner {
7059
7041
  constructor(datasource, _runRequest = runtime.getRunRequest()) {
7060
7042
  this.datasource = datasource;
@@ -7091,7 +7073,7 @@ class LegacyQueryRunner {
7091
7073
  return getEmptyMetricFindValueObservable();
7092
7074
  }
7093
7075
  return rxjs.from(
7094
- this.datasource.metricFindQuery(variable.state.query, __spreadProps$9(__spreadValues$h({}, request), {
7076
+ this.datasource.metricFindQuery(variable.state.query, __spreadProps$a(__spreadValues$i({}, request), {
7095
7077
  variable: {
7096
7078
  name: variable.state.name,
7097
7079
  type: variable.state.type
@@ -7153,7 +7135,7 @@ function ensureVariableQueryModelIsADataQuery(variable) {
7153
7135
  return { query, refId: `variable-${variable.state.name}` };
7154
7136
  }
7155
7137
  if (query.refId == null) {
7156
- return __spreadProps$9(__spreadValues$h({}, query), { refId: `variable-${variable.state.name}` });
7138
+ return __spreadProps$a(__spreadValues$i({}, query), { refId: `variable-${variable.state.name}` });
7157
7139
  }
7158
7140
  return variable.state.query;
7159
7141
  }
@@ -7368,25 +7350,25 @@ function areMetricFindValues(data$1) {
7368
7350
  return false;
7369
7351
  }
7370
7352
 
7371
- var __defProp$g = Object.defineProperty;
7372
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
7373
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
7374
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
7375
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7376
- var __spreadValues$g = (a, b) => {
7353
+ var __defProp$h = Object.defineProperty;
7354
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
7355
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
7356
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
7357
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7358
+ var __spreadValues$h = (a, b) => {
7377
7359
  for (var prop in b || (b = {}))
7378
- if (__hasOwnProp$g.call(b, prop))
7379
- __defNormalProp$g(a, prop, b[prop]);
7380
- if (__getOwnPropSymbols$g)
7381
- for (var prop of __getOwnPropSymbols$g(b)) {
7382
- if (__propIsEnum$g.call(b, prop))
7383
- __defNormalProp$g(a, prop, b[prop]);
7360
+ if (__hasOwnProp$h.call(b, prop))
7361
+ __defNormalProp$h(a, prop, b[prop]);
7362
+ if (__getOwnPropSymbols$h)
7363
+ for (var prop of __getOwnPropSymbols$h(b)) {
7364
+ if (__propIsEnum$h.call(b, prop))
7365
+ __defNormalProp$h(a, prop, b[prop]);
7384
7366
  }
7385
7367
  return a;
7386
7368
  };
7387
7369
  class QueryVariable extends MultiValueVariable {
7388
7370
  constructor(initialState) {
7389
- super(__spreadValues$g({
7371
+ super(__spreadValues$h({
7390
7372
  type: "query",
7391
7373
  name: "",
7392
7374
  value: "",
@@ -7419,7 +7401,7 @@ class QueryVariable extends MultiValueVariable {
7419
7401
  this.setState({ loading: true, error: null });
7420
7402
  return rxjs.from(
7421
7403
  getDataSource(this.state.datasource, {
7422
- __sceneObject: { text: "__sceneObject", value: proxifyScopedVarSceneObject(this) }
7404
+ __sceneObject: { text: "__sceneObject", value: this }
7423
7405
  })
7424
7406
  ).pipe(
7425
7407
  rxjs.mergeMap((ds) => {
@@ -7460,7 +7442,7 @@ class QueryVariable extends MultiValueVariable {
7460
7442
  }
7461
7443
  getRequest(target, searchFilter) {
7462
7444
  const scopedVars = {
7463
- __sceneObject: { text: "__sceneObject", value: proxifyScopedVarSceneObject(this) }
7445
+ __sceneObject: { text: "__sceneObject", value: this }
7464
7446
  };
7465
7447
  if (searchFilter) {
7466
7448
  scopedVars.__searchFilter = { value: searchFilter, text: searchFilter };
@@ -7539,25 +7521,25 @@ function queryMetricTree(query) {
7539
7521
  return queryTree(children, query.split("."), 0);
7540
7522
  }
7541
7523
 
7542
- var __defProp$f = Object.defineProperty;
7543
- var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
7544
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
7545
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
7546
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7547
- var __spreadValues$f = (a, b) => {
7524
+ var __defProp$g = Object.defineProperty;
7525
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
7526
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
7527
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
7528
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7529
+ var __spreadValues$g = (a, b) => {
7548
7530
  for (var prop in b || (b = {}))
7549
- if (__hasOwnProp$f.call(b, prop))
7550
- __defNormalProp$f(a, prop, b[prop]);
7551
- if (__getOwnPropSymbols$f)
7552
- for (var prop of __getOwnPropSymbols$f(b)) {
7553
- if (__propIsEnum$f.call(b, prop))
7554
- __defNormalProp$f(a, prop, b[prop]);
7531
+ if (__hasOwnProp$g.call(b, prop))
7532
+ __defNormalProp$g(a, prop, b[prop]);
7533
+ if (__getOwnPropSymbols$g)
7534
+ for (var prop of __getOwnPropSymbols$g(b)) {
7535
+ if (__propIsEnum$g.call(b, prop))
7536
+ __defNormalProp$g(a, prop, b[prop]);
7555
7537
  }
7556
7538
  return a;
7557
7539
  };
7558
7540
  class TestVariable extends MultiValueVariable {
7559
7541
  constructor(initialState, isLazy = false) {
7560
- super(__spreadValues$f({
7542
+ super(__spreadValues$g({
7561
7543
  type: "custom",
7562
7544
  name: "Test",
7563
7545
  value: "Value",
@@ -7666,25 +7648,25 @@ function VariableValueInput({ model }) {
7666
7648
  });
7667
7649
  }
7668
7650
 
7669
- var __defProp$e = Object.defineProperty;
7670
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
7671
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
7672
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
7673
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7674
- var __spreadValues$e = (a, b) => {
7651
+ var __defProp$f = Object.defineProperty;
7652
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
7653
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
7654
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
7655
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7656
+ var __spreadValues$f = (a, b) => {
7675
7657
  for (var prop in b || (b = {}))
7676
- if (__hasOwnProp$e.call(b, prop))
7677
- __defNormalProp$e(a, prop, b[prop]);
7678
- if (__getOwnPropSymbols$e)
7679
- for (var prop of __getOwnPropSymbols$e(b)) {
7680
- if (__propIsEnum$e.call(b, prop))
7681
- __defNormalProp$e(a, prop, b[prop]);
7658
+ if (__hasOwnProp$f.call(b, prop))
7659
+ __defNormalProp$f(a, prop, b[prop]);
7660
+ if (__getOwnPropSymbols$f)
7661
+ for (var prop of __getOwnPropSymbols$f(b)) {
7662
+ if (__propIsEnum$f.call(b, prop))
7663
+ __defNormalProp$f(a, prop, b[prop]);
7682
7664
  }
7683
7665
  return a;
7684
7666
  };
7685
7667
  class TextBoxVariable extends SceneObjectBase {
7686
7668
  constructor(initialState) {
7687
- super(__spreadValues$e({
7669
+ super(__spreadValues$f({
7688
7670
  type: "textbox",
7689
7671
  value: "",
7690
7672
  name: ""
@@ -7721,28 +7703,28 @@ TextBoxVariable.Component = ({ model }) => {
7721
7703
  });
7722
7704
  };
7723
7705
 
7724
- var __defProp$d = Object.defineProperty;
7725
- var __defProps$8 = Object.defineProperties;
7726
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
7727
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
7728
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
7729
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
7730
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7731
- var __spreadValues$d = (a, b) => {
7706
+ var __defProp$e = Object.defineProperty;
7707
+ var __defProps$9 = Object.defineProperties;
7708
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
7709
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
7710
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
7711
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
7712
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7713
+ var __spreadValues$e = (a, b) => {
7732
7714
  for (var prop in b || (b = {}))
7733
- if (__hasOwnProp$d.call(b, prop))
7734
- __defNormalProp$d(a, prop, b[prop]);
7735
- if (__getOwnPropSymbols$d)
7736
- for (var prop of __getOwnPropSymbols$d(b)) {
7737
- if (__propIsEnum$d.call(b, prop))
7738
- __defNormalProp$d(a, prop, b[prop]);
7715
+ if (__hasOwnProp$e.call(b, prop))
7716
+ __defNormalProp$e(a, prop, b[prop]);
7717
+ if (__getOwnPropSymbols$e)
7718
+ for (var prop of __getOwnPropSymbols$e(b)) {
7719
+ if (__propIsEnum$e.call(b, prop))
7720
+ __defNormalProp$e(a, prop, b[prop]);
7739
7721
  }
7740
7722
  return a;
7741
7723
  };
7742
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
7724
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
7743
7725
  class LocalValueVariable extends SceneObjectBase {
7744
7726
  constructor(initialState) {
7745
- super(__spreadProps$8(__spreadValues$d({
7727
+ super(__spreadProps$9(__spreadValues$e({
7746
7728
  type: "system",
7747
7729
  value: "",
7748
7730
  text: "",
@@ -7774,25 +7756,25 @@ class LocalValueVariable extends SceneObjectBase {
7774
7756
  }
7775
7757
  }
7776
7758
 
7777
- var __defProp$c = Object.defineProperty;
7778
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
7779
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
7780
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
7781
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7782
- var __spreadValues$c = (a, b) => {
7759
+ var __defProp$d = Object.defineProperty;
7760
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
7761
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
7762
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
7763
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7764
+ var __spreadValues$d = (a, b) => {
7783
7765
  for (var prop in b || (b = {}))
7784
- if (__hasOwnProp$c.call(b, prop))
7785
- __defNormalProp$c(a, prop, b[prop]);
7786
- if (__getOwnPropSymbols$c)
7787
- for (var prop of __getOwnPropSymbols$c(b)) {
7788
- if (__propIsEnum$c.call(b, prop))
7789
- __defNormalProp$c(a, prop, b[prop]);
7766
+ if (__hasOwnProp$d.call(b, prop))
7767
+ __defNormalProp$d(a, prop, b[prop]);
7768
+ if (__getOwnPropSymbols$d)
7769
+ for (var prop of __getOwnPropSymbols$d(b)) {
7770
+ if (__propIsEnum$d.call(b, prop))
7771
+ __defNormalProp$d(a, prop, b[prop]);
7790
7772
  }
7791
7773
  return a;
7792
7774
  };
7793
7775
  class IntervalVariable extends SceneObjectBase {
7794
7776
  constructor(initialState) {
7795
- super(__spreadValues$c({
7777
+ super(__spreadValues$d({
7796
7778
  type: "interval",
7797
7779
  value: "",
7798
7780
  intervals: ["1m", "10m", "30m", "1h", "6h", "12h", "1d", "7d", "14d", "30d"],
@@ -7878,6 +7860,422 @@ IntervalVariable.Component = ({ model }) => {
7878
7860
  });
7879
7861
  };
7880
7862
 
7863
+ var __defProp$c = Object.defineProperty;
7864
+ var __defProps$8 = Object.defineProperties;
7865
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
7866
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
7867
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
7868
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
7869
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7870
+ var __spreadValues$c = (a, b) => {
7871
+ for (var prop in b || (b = {}))
7872
+ if (__hasOwnProp$c.call(b, prop))
7873
+ __defNormalProp$c(a, prop, b[prop]);
7874
+ if (__getOwnPropSymbols$c)
7875
+ for (var prop of __getOwnPropSymbols$c(b)) {
7876
+ if (__propIsEnum$c.call(b, prop))
7877
+ __defNormalProp$c(a, prop, b[prop]);
7878
+ }
7879
+ return a;
7880
+ };
7881
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
7882
+ var __objRest$2 = (source, exclude) => {
7883
+ var target = {};
7884
+ for (var prop in source)
7885
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
7886
+ target[prop] = source[prop];
7887
+ if (source != null && __getOwnPropSymbols$c)
7888
+ for (var prop of __getOwnPropSymbols$c(source)) {
7889
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
7890
+ target[prop] = source[prop];
7891
+ }
7892
+ return target;
7893
+ };
7894
+ const Item = React.forwardRef(
7895
+ (_a, ref) => {
7896
+ var _b = _a, { children, active } = _b, rest = __objRest$2(_b, ["children", "active"]);
7897
+ const theme = ui.useTheme2();
7898
+ const selectStyles = ui.getSelectStyles(theme);
7899
+ const id = react.useId();
7900
+ return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$c({
7901
+ ref,
7902
+ role: "option",
7903
+ id,
7904
+ "aria-selected": active,
7905
+ className: css.cx(selectStyles.option, active && selectStyles.optionFocused)
7906
+ }, rest), /* @__PURE__ */ React__default["default"].createElement("div", {
7907
+ className: selectStyles.optionBody,
7908
+ "data-testid": `data-testid ad hoc filter option value ${children}`
7909
+ }, /* @__PURE__ */ React__default["default"].createElement("span", null, children)));
7910
+ }
7911
+ );
7912
+ function AdHocCombobox({ filter, model, wip, handleChangeViewMode }) {
7913
+ var _a;
7914
+ const [open, setOpen] = React.useState(false);
7915
+ const [options, setOptions] = React.useState([]);
7916
+ const [inputValue, setInputValue] = React.useState("");
7917
+ const [activeIndex, setActiveIndex] = React.useState(null);
7918
+ const [inputType, setInputType] = React.useState(!wip ? "value" : "key");
7919
+ const styles = ui.useStyles2(getStyles2$1);
7920
+ const listRef = React.useRef([]);
7921
+ const { _wip } = model.useState();
7922
+ const filterToUse = filter || _wip;
7923
+ const { refs, floatingStyles, context } = react.useFloating({
7924
+ whileElementsMounted: react.autoUpdate,
7925
+ open,
7926
+ onOpenChange: (nextOpen, _, reason) => {
7927
+ setOpen(nextOpen);
7928
+ if (reason === "outside-press") {
7929
+ handleChangeViewMode == null ? void 0 : handleChangeViewMode();
7930
+ }
7931
+ },
7932
+ middleware: [
7933
+ react.flip({ padding: 10 }),
7934
+ react.size({
7935
+ apply({ rects, availableHeight, elements }) {
7936
+ Object.assign(elements.floating.style, {
7937
+ width: `${rects.reference.width}px`,
7938
+ maxHeight: `${availableHeight > 256 ? 256 : availableHeight}px`
7939
+ });
7940
+ },
7941
+ padding: 10
7942
+ })
7943
+ ]
7944
+ });
7945
+ const role = react.useRole(context, { role: "listbox" });
7946
+ const dismiss = react.useDismiss(context, {
7947
+ outsidePress: (event) => {
7948
+ var _a2;
7949
+ return !event.currentTarget.classList.contains(
7950
+ `${(_a2 = filterToUse == null ? void 0 : filterToUse.key) != null ? _a2 : ""}-operator`
7951
+ );
7952
+ }
7953
+ });
7954
+ const listNav = react.useListNavigation(context, {
7955
+ listRef,
7956
+ activeIndex,
7957
+ onNavigate: setActiveIndex,
7958
+ virtual: true,
7959
+ loop: true
7960
+ });
7961
+ const { getReferenceProps, getFloatingProps, getItemProps } = react.useInteractions([role, dismiss, listNav]);
7962
+ function onChange(event) {
7963
+ const value = event.target.value;
7964
+ setInputValue(value);
7965
+ setActiveIndex(0);
7966
+ }
7967
+ const items = options.filter(
7968
+ (item) => {
7969
+ var _a2, _b;
7970
+ return (_b = (_a2 = item.label) != null ? _a2 : item.value) == null ? void 0 : _b.toLocaleLowerCase().startsWith(inputValue.toLowerCase());
7971
+ }
7972
+ );
7973
+ React.useEffect(() => {
7974
+ if (wip && !_wip) {
7975
+ model._addWip();
7976
+ }
7977
+ }, [_wip]);
7978
+ React.useEffect(() => {
7979
+ if (!wip && refs.domReference.current) {
7980
+ setInputType("value");
7981
+ setInputValue("");
7982
+ refs.domReference.current.focus();
7983
+ }
7984
+ }, []);
7985
+ return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, filterToUse ? /* @__PURE__ */ React__default["default"].createElement("div", {
7986
+ className: styles.pillWrapper
7987
+ }, (filterToUse == null ? void 0 : filterToUse.key) ? /* @__PURE__ */ React__default["default"].createElement("div", {
7988
+ className: css.cx(styles.basePill, styles.keyPill)
7989
+ }, filterToUse.key) : null, (filterToUse == null ? void 0 : filterToUse.key) && (filterToUse == null ? void 0 : filterToUse.operator) && inputType !== "operator" ? /* @__PURE__ */ React__default["default"].createElement("div", {
7990
+ className: css.cx(styles.basePill, `${(_a = filterToUse == null ? void 0 : filterToUse.key) != null ? _a : ""}-operator`),
7991
+ role: "button",
7992
+ "aria-label": "Edit filter operator",
7993
+ tabIndex: 0,
7994
+ onClick: () => {
7995
+ var _a2;
7996
+ reactDom.flushSync(() => {
7997
+ setInputType("operator");
7998
+ });
7999
+ (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
8000
+ },
8001
+ onKeyDown: (e) => {
8002
+ var _a2;
8003
+ if (e.key === "Enter") {
8004
+ reactDom.flushSync(() => {
8005
+ setInputType("operator");
8006
+ });
8007
+ (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
8008
+ }
8009
+ }
8010
+ }, filterToUse.operator) : null, (filterToUse == null ? void 0 : filterToUse.key) && (filterToUse == null ? void 0 : filterToUse.operator) && (filterToUse == null ? void 0 : filterToUse.value) && !["operator", "value"].includes(inputType) ? /* @__PURE__ */ React__default["default"].createElement("div", {
8011
+ className: css.cx(styles.basePill, styles.valuePill)
8012
+ }, filterToUse.value) : null) : null, /* @__PURE__ */ React__default["default"].createElement("input", __spreadProps$8(__spreadValues$c({}, getReferenceProps({
8013
+ ref: refs.setReference,
8014
+ onChange,
8015
+ value: inputValue,
8016
+ placeholder: !wip ? inputType === "operator" ? `${filterToUse[inputType]} ${filterToUse.value || ""}` : filterToUse[inputType] : "Filter by label values",
8017
+ "aria-autocomplete": "list",
8018
+ onKeyDown(event) {
8019
+ var _a2;
8020
+ if (event.key === "Enter" && activeIndex != null && items[activeIndex]) {
8021
+ model._updateFilter(filterToUse, inputType, items[activeIndex]);
8022
+ setInputValue("");
8023
+ reactDom.flushSync(() => {
8024
+ if (inputType === "key") {
8025
+ setInputType("operator");
8026
+ } else if (inputType === "operator") {
8027
+ setInputType("value");
8028
+ } else if (inputType === "value") {
8029
+ setInputType("key");
8030
+ handleChangeViewMode == null ? void 0 : handleChangeViewMode();
8031
+ }
8032
+ });
8033
+ (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
8034
+ }
8035
+ }
8036
+ })), {
8037
+ className: styles.inputStyle,
8038
+ key: inputType,
8039
+ onFocus: async () => {
8040
+ let options2 = [];
8041
+ if (inputType === "key") {
8042
+ options2 = await model._getKeys(null);
8043
+ } else if (inputType === "operator") {
8044
+ options2 = model._getOperators();
8045
+ } else if (inputType === "value") {
8046
+ options2 = await model._getValuesFor(filterToUse);
8047
+ }
8048
+ setActiveIndex(0);
8049
+ setOptions(options2);
8050
+ setOpen(true);
8051
+ }
8052
+ })), /* @__PURE__ */ React__default["default"].createElement(react.FloatingPortal, null, open && /* @__PURE__ */ React__default["default"].createElement(react.FloatingFocusManager, {
8053
+ context,
8054
+ initialFocus: -1,
8055
+ visuallyHiddenDismiss: true
8056
+ }, /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$8(__spreadValues$c({}, getFloatingProps({
8057
+ ref: refs.setFloating,
8058
+ style: __spreadProps$8(__spreadValues$c({}, floatingStyles), {
8059
+ overflowY: "auto"
8060
+ })
8061
+ })), {
8062
+ className: styles.dropdownWrapper
8063
+ }), items.map((item, index) => {
8064
+ var _a2;
8065
+ return /* @__PURE__ */ React__default["default"].createElement(Item, __spreadProps$8(__spreadValues$c({}, getItemProps({
8066
+ key: item.value,
8067
+ ref(node) {
8068
+ listRef.current[index] = node;
8069
+ },
8070
+ onClick() {
8071
+ var _a3;
8072
+ model._updateFilter(filterToUse, inputType, item);
8073
+ setInputValue("");
8074
+ reactDom.flushSync(() => {
8075
+ if (inputType === "key") {
8076
+ setInputType("operator");
8077
+ } else if (inputType === "operator") {
8078
+ setInputType("value");
8079
+ } else if (inputType === "value") {
8080
+ setInputType("key");
8081
+ handleChangeViewMode == null ? void 0 : handleChangeViewMode();
8082
+ }
8083
+ });
8084
+ (_a3 = refs.domReference.current) == null ? void 0 : _a3.focus();
8085
+ }
8086
+ })), {
8087
+ active: activeIndex === index
8088
+ }), (_a2 = item.label) != null ? _a2 : item.value);
8089
+ })))));
8090
+ }
8091
+ const getStyles2$1 = (theme) => ({
8092
+ pillWrapper: css.css({
8093
+ display: "flex",
8094
+ alignItems: "center",
8095
+ whiteSpace: "nowrap"
8096
+ }),
8097
+ basePill: css.css(__spreadProps$8(__spreadValues$c({
8098
+ display: "flex",
8099
+ alignItems: "center",
8100
+ background: theme.colors.action.disabledBackground,
8101
+ border: `1px solid ${theme.colors.border.weak}`,
8102
+ padding: theme.spacing(0.125, 1, 0.125, 1),
8103
+ color: theme.colors.text.primary,
8104
+ overflow: "hidden",
8105
+ whiteSpace: "nowrap",
8106
+ minHeight: "22px"
8107
+ }, theme.typography.bodySmall), {
8108
+ cursor: "pointer"
8109
+ })),
8110
+ keyPill: css.css({
8111
+ fontWeight: theme.typography.fontWeightBold,
8112
+ cursor: "default"
8113
+ }),
8114
+ valuePill: css.css({
8115
+ background: theme.colors.action.selected
8116
+ }),
8117
+ dropdownWrapper: css.css({
8118
+ backgroundColor: theme.colors.background.primary,
8119
+ color: theme.colors.text.primary,
8120
+ boxShadow: theme.shadows.z2
8121
+ }),
8122
+ inputStyle: css.css({
8123
+ paddingBlock: 0,
8124
+ "&:focus": {
8125
+ outline: "none"
8126
+ }
8127
+ })
8128
+ });
8129
+ function AdHocFilterEditSwitch({ filter, model }) {
8130
+ const styles = ui.useStyles2(getStyles3);
8131
+ const [viewMode, setViewMode] = React.useState(true);
8132
+ const wrapRef = React.useRef(null);
8133
+ const handleChangeViewMode = React.useCallback(() => {
8134
+ reactDom.flushSync(() => {
8135
+ setViewMode((mode) => !mode);
8136
+ });
8137
+ if (wrapRef.current) {
8138
+ wrapRef.current.focus();
8139
+ }
8140
+ }, []);
8141
+ if (viewMode) {
8142
+ return /* @__PURE__ */ React__default["default"].createElement("div", {
8143
+ className: styles.combinedFilterPill,
8144
+ onClick: handleChangeViewMode,
8145
+ onKeyDown: (e) => {
8146
+ if (e.key === "Enter") {
8147
+ handleChangeViewMode();
8148
+ }
8149
+ },
8150
+ role: "button",
8151
+ "aria-label": "Edit filter",
8152
+ tabIndex: 0,
8153
+ ref: wrapRef
8154
+ }, /* @__PURE__ */ React__default["default"].createElement("span", null, filter.key, " ", filter.operator, " ", filter.value), /* @__PURE__ */ React__default["default"].createElement(ui.IconButton, {
8155
+ onClick: (e) => {
8156
+ e.stopPropagation();
8157
+ model._removeFilter(filter);
8158
+ },
8159
+ onKeyDown: (e) => {
8160
+ if (e.key === "Enter") {
8161
+ e.stopPropagation();
8162
+ model._removeFilter(filter);
8163
+ }
8164
+ },
8165
+ name: "times",
8166
+ size: "md",
8167
+ className: styles.removeButton,
8168
+ tooltip: "Remove filter"
8169
+ }));
8170
+ }
8171
+ return /* @__PURE__ */ React__default["default"].createElement(AdHocCombobox, {
8172
+ filter,
8173
+ model,
8174
+ handleChangeViewMode
8175
+ });
8176
+ }
8177
+ const getStyles3 = (theme) => ({
8178
+ wrapper: css.css({
8179
+ display: "flex",
8180
+ flexWrap: "wrap",
8181
+ alignItems: "center",
8182
+ columnGap: theme.spacing(1),
8183
+ rowGap: theme.spacing(1),
8184
+ minHeight: theme.spacing(4),
8185
+ backgroundColor: theme.components.input.background,
8186
+ border: `1px solid ${theme.colors.border.strong}`,
8187
+ borderRadius: theme.shape.radius.default,
8188
+ paddingInline: theme.spacing(1),
8189
+ "&:focus-within": {
8190
+ outline: "2px dotted transparent",
8191
+ outlineOffset: "2px",
8192
+ boxShadow: `0 0 0 2px ${theme.colors.background.canvas}, 0 0 0px 4px ${theme.colors.primary.main}`,
8193
+ transitionTimingFunction: `cubic-bezier(0.19, 1, 0.22, 1)`,
8194
+ transitionDuration: "0.2s",
8195
+ transitionProperty: "outline, outline-offset, box-shadow"
8196
+ }
8197
+ }),
8198
+ filterIcon: css.css({
8199
+ color: theme.colors.text.secondary,
8200
+ alignSelf: "center"
8201
+ }),
8202
+ combinedFilterPill: css.css(__spreadProps$8(__spreadValues$c({
8203
+ display: "flex",
8204
+ alignItems: "center",
8205
+ background: theme.colors.action.selected,
8206
+ borderRadius: theme.shape.radius.default,
8207
+ border: `1px solid ${theme.colors.border.weak}`,
8208
+ padding: theme.spacing(0.125, 0, 0.125, 1),
8209
+ color: theme.colors.text.primary,
8210
+ overflow: "hidden",
8211
+ whiteSpace: "nowrap",
8212
+ minHeight: "22px"
8213
+ }, theme.typography.bodySmall), {
8214
+ fontWeight: theme.typography.fontWeightBold,
8215
+ cursor: "pointer",
8216
+ "&:hover": {
8217
+ background: theme.colors.emphasize(theme.colors.background.secondary)
8218
+ }
8219
+ })),
8220
+ removeButton: css.css({
8221
+ marginInline: theme.spacing(0.5),
8222
+ cursor: "pointer",
8223
+ "&:hover": {
8224
+ color: theme.colors.text.primary
8225
+ }
8226
+ })
8227
+ });
8228
+
8229
+ class AdHocFiltersVariableV2 extends AdHocFiltersVariable {
8230
+ }
8231
+ AdHocFiltersVariableV2.Component = AdHocFiltersVariableRendererV2;
8232
+ function AdHocFiltersVariableRendererV2({ model }) {
8233
+ const { filters } = model.useState();
8234
+ const styles = ui.useStyles2(getStyles2);
8235
+ return /* @__PURE__ */ React__default["default"].createElement("div", {
8236
+ className: styles.wrapper
8237
+ }, /* @__PURE__ */ React__default["default"].createElement(ui.Icon, {
8238
+ name: "filter",
8239
+ className: styles.filterIcon,
8240
+ size: "lg"
8241
+ }), filters.map((filter, index) => /* @__PURE__ */ React__default["default"].createElement(AdHocFilterEditSwitch, {
8242
+ key: index,
8243
+ filter,
8244
+ model
8245
+ })), /* @__PURE__ */ React__default["default"].createElement(AdHocCombobox, {
8246
+ model,
8247
+ wip: true
8248
+ }));
8249
+ }
8250
+ const getStyles2 = (theme) => ({
8251
+ wrapper: css.css({
8252
+ display: "flex",
8253
+ flexWrap: "wrap",
8254
+ alignItems: "center",
8255
+ columnGap: theme.spacing(1),
8256
+ rowGap: theme.spacing(0.5),
8257
+ minHeight: theme.spacing(4),
8258
+ backgroundColor: theme.components.input.background,
8259
+ border: `1px solid ${theme.colors.border.strong}`,
8260
+ borderRadius: theme.shape.radius.default,
8261
+ paddingInline: theme.spacing(1),
8262
+ paddingBlock: theme.spacing(0.5),
8263
+ flexGrow: 1,
8264
+ "&:focus-within": {
8265
+ outline: "2px dotted transparent",
8266
+ outlineOffset: "2px",
8267
+ boxShadow: `0 0 0 2px ${theme.colors.background.canvas}, 0 0 0px 4px ${theme.colors.primary.main}`,
8268
+ transitionTimingFunction: `cubic-bezier(0.19, 1, 0.22, 1)`,
8269
+ transitionDuration: "0.2s",
8270
+ transitionProperty: "outline, outline-offset, box-shadow"
8271
+ }
8272
+ }),
8273
+ filterIcon: css.css({
8274
+ color: theme.colors.text.secondary,
8275
+ alignSelf: "center"
8276
+ })
8277
+ });
8278
+
7881
8279
  var __accessCheck = (obj, member, msg) => {
7882
8280
  if (!member.has(obj))
7883
8281
  throw TypeError("Cannot " + msg);
@@ -8052,7 +8450,7 @@ class EmbeddedScene extends SceneObjectBase {
8052
8450
  EmbeddedScene.Component = EmbeddedSceneRenderer;
8053
8451
  function EmbeddedSceneRenderer({ model }) {
8054
8452
  const { body, controls } = model.useState();
8055
- const styles = ui.useStyles2(getStyles$6);
8453
+ const styles = ui.useStyles2(getStyles$7);
8056
8454
  return /* @__PURE__ */ React__default["default"].createElement("div", {
8057
8455
  className: styles.container
8058
8456
  }, controls && /* @__PURE__ */ React__default["default"].createElement("div", {
@@ -8066,7 +8464,7 @@ function EmbeddedSceneRenderer({ model }) {
8066
8464
  model: body
8067
8465
  })));
8068
8466
  }
8069
- const getStyles$6 = (theme) => {
8467
+ const getStyles$7 = (theme) => {
8070
8468
  return {
8071
8469
  container: css.css({
8072
8470
  flexGrow: 1,
@@ -8207,7 +8605,7 @@ const LazyLoader = React__default["default"].forwardRef(
8207
8605
  (_a, ref) => {
8208
8606
  var _b = _a, { children, onLoad, onChange, className } = _b, rest = __objRest$1(_b, ["children", "onLoad", "onChange", "className"]);
8209
8607
  const id = useUniqueId();
8210
- const style = useStyle();
8608
+ const { hideEmpty } = ui.useStyles2(getStyles$6);
8211
8609
  const [loaded, setLoaded] = React.useState(false);
8212
8610
  const [isInView, setIsInView] = React.useState(false);
8213
8611
  const innerRef = React.useRef(null);
@@ -8233,19 +8631,22 @@ const LazyLoader = React__default["default"].forwardRef(
8233
8631
  }
8234
8632
  };
8235
8633
  });
8634
+ const classes = `${loaded ? hideEmpty : ""} ${className}`;
8236
8635
  return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$b({
8237
8636
  id,
8238
8637
  ref: innerRef,
8239
- className: `${loaded ? style : ""} ${className}`
8638
+ className: classes
8240
8639
  }, rest), loaded && (typeof children === "function" ? children({ isInView }) : children));
8241
8640
  }
8242
8641
  );
8243
- function useStyle() {
8244
- return css.css({
8245
- "&:empty": {
8246
- display: "none"
8247
- }
8248
- });
8642
+ function getStyles$6() {
8643
+ return {
8644
+ hideEmpty: css.css({
8645
+ "&:empty": {
8646
+ display: "none"
8647
+ }
8648
+ })
8649
+ };
8249
8650
  }
8250
8651
  LazyLoader.displayName = "LazyLoader";
8251
8652
  LazyLoader.callbacks = {};
@@ -11554,6 +11955,7 @@ const sceneUtils = {
11554
11955
  };
11555
11956
 
11556
11957
  exports.AdHocFiltersVariable = AdHocFiltersVariable;
11958
+ exports.AdHocFiltersVariableV2 = AdHocFiltersVariableV2;
11557
11959
  exports.ConstantVariable = ConstantVariable;
11558
11960
  exports.CustomVariable = CustomVariable;
11559
11961
  exports.DataSourceVariable = DataSourceVariable;