@grafana/scenes 4.26.3 → 4.27.0--canary.766.9367073867.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/CHANGELOG.md +0 -41
  2. package/README.md +0 -2
  3. package/dist/esm/components/SceneTimeRangeCompare.js +1 -55
  4. package/dist/esm/components/SceneTimeRangeCompare.js.map +1 -1
  5. package/dist/esm/components/VizPanel/VizPanel.js +0 -3
  6. package/dist/esm/components/VizPanel/VizPanel.js.map +1 -1
  7. package/dist/esm/core/types.js.map +1 -1
  8. package/dist/esm/index.js +1 -4
  9. package/dist/esm/index.js.map +1 -1
  10. package/dist/esm/querying/SceneQueryRunner.js +88 -85
  11. package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
  12. package/dist/esm/querying/timeShiftQueryResponseOperator.js +60 -0
  13. package/dist/esm/querying/timeShiftQueryResponseOperator.js.map +1 -0
  14. package/dist/esm/utils/writeSceneLog.js +1 -5
  15. package/dist/esm/utils/writeSceneLog.js.map +1 -1
  16. package/dist/esm/variables/adhoc/AdHocFilterRenderer.js +40 -3
  17. package/dist/esm/variables/adhoc/AdHocFilterRenderer.js.map +1 -1
  18. package/dist/esm/variables/components/VariableValueSelect.js +5 -6
  19. package/dist/esm/variables/components/VariableValueSelect.js.map +1 -1
  20. package/dist/esm/variables/interpolation/sceneInterpolator.js +3 -3
  21. package/dist/esm/variables/interpolation/sceneInterpolator.js.map +1 -1
  22. package/dist/esm/variables/utils.js.map +1 -1
  23. package/dist/esm/variables/variants/query/QueryVariable.js.map +1 -1
  24. package/dist/index.d.ts +146 -256
  25. package/dist/index.js +931 -1116
  26. package/dist/index.js.map +1 -1
  27. package/package.json +8 -5
  28. package/dist/esm/core/PanelBuilders/VizConfigBuilder.js +0 -78
  29. package/dist/esm/core/PanelBuilders/VizConfigBuilder.js.map +0 -1
  30. package/dist/esm/core/PanelBuilders/VizConfigBuilders.js +0 -114
  31. package/dist/esm/core/PanelBuilders/VizConfigBuilders.js.map +0 -1
  32. package/dist/esm/querying/ExtraQueryProvider.js +0 -6
  33. package/dist/esm/querying/ExtraQueryProvider.js.map +0 -1
  34. package/dist/esm/querying/extraQueryProcessingOperator.js +0 -46
  35. package/dist/esm/querying/extraQueryProcessingOperator.js.map +0 -1
package/dist/index.js CHANGED
@@ -11,8 +11,8 @@ var uuid = require('uuid');
11
11
  var lodash = require('lodash');
12
12
  var schema = require('@grafana/schema');
13
13
  var ui = require('@grafana/ui');
14
- var e2eSelectors = require('@grafana/e2e-selectors');
15
14
  var css = require('@emotion/css');
15
+ var e2eSelectors = require('@grafana/e2e-selectors');
16
16
  var uFuzzy = require('@leeoniya/ufuzzy');
17
17
  var reactUse = require('react-use');
18
18
  var operators = require('rxjs/operators');
@@ -77,8 +77,8 @@ function renderSceneComponentWithRouteProps(sceneObject, routeProps) {
77
77
  }
78
78
 
79
79
  var __defProp$J = Object.defineProperty;
80
- var __defProps$t = Object.defineProperties;
81
- var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
80
+ var __defProps$s = Object.defineProperties;
81
+ var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
82
82
  var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
83
83
  var __hasOwnProp$J = Object.prototype.hasOwnProperty;
84
84
  var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
@@ -94,13 +94,13 @@ var __spreadValues$J = (a, b) => {
94
94
  }
95
95
  return a;
96
96
  };
97
- var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
97
+ var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
98
98
  const runtimePanelPlugins = /* @__PURE__ */ new Map();
99
99
  function registerRuntimePanelPlugin({ pluginId, plugin }) {
100
100
  if (runtimePanelPlugins.has(pluginId)) {
101
101
  throw new Error(`A runtime panel plugin with id ${pluginId} has already been registered`);
102
102
  }
103
- plugin.meta = __spreadProps$t(__spreadValues$J({}, plugin.meta), {
103
+ plugin.meta = __spreadProps$s(__spreadValues$J({}, plugin.meta), {
104
104
  id: pluginId,
105
105
  name: pluginId,
106
106
  module: "runtime plugin",
@@ -129,8 +129,8 @@ function loadPanelPluginSync(pluginId) {
129
129
  }
130
130
 
131
131
  var __defProp$I = Object.defineProperty;
132
- var __defProps$s = Object.defineProperties;
133
- var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
132
+ var __defProps$r = Object.defineProperties;
133
+ var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
134
134
  var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
135
135
  var __hasOwnProp$I = Object.prototype.hasOwnProperty;
136
136
  var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
@@ -146,7 +146,7 @@ var __spreadValues$I = (a, b) => {
146
146
  }
147
147
  return a;
148
148
  };
149
- var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
149
+ var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
150
150
  var __objRest$4 = (source, exclude) => {
151
151
  var target = {};
152
152
  for (var prop in source)
@@ -172,7 +172,7 @@ function SceneComponentWrapperWithoutMemo(_a) {
172
172
  if (!model.isActive) {
173
173
  return null;
174
174
  }
175
- return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$s(__spreadValues$I({}, otherProps), {
175
+ return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$r(__spreadValues$I({}, otherProps), {
176
176
  model
177
177
  }));
178
178
  }
@@ -1347,7 +1347,7 @@ function sceneInterpolator(sceneObject, target, scopedVars, format, interpolatio
1347
1347
  }
1348
1348
  return match;
1349
1349
  }
1350
- const value = formatValue(sceneObject, variable, variable.getValue(fieldPath), fmt);
1350
+ const value = formatValue(variable, variable.getValue(fieldPath), fmt);
1351
1351
  if (interpolations) {
1352
1352
  interpolations.push({ match, variableName, fieldPath, format: fmt, value, found: value !== match });
1353
1353
  }
@@ -1368,12 +1368,12 @@ function lookupFormatVariable(name, match, scopedVars, sceneObject) {
1368
1368
  }
1369
1369
  return null;
1370
1370
  }
1371
- function formatValue(context, variable, value, formatNameOrFn) {
1371
+ function formatValue(variable, value, formatNameOrFn) {
1372
1372
  if (value === null || value === void 0) {
1373
1373
  return "";
1374
1374
  }
1375
1375
  if (isCustomVariableValue(value)) {
1376
- return sceneInterpolator(context, value.formatter(formatNameOrFn));
1376
+ return value.formatter(formatNameOrFn);
1377
1377
  }
1378
1378
  if (!Array.isArray(value) && typeof value === "object") {
1379
1379
  value = `${value}`;
@@ -1749,8 +1749,8 @@ function collectAllVariables(sceneObject, record = {}) {
1749
1749
  }
1750
1750
 
1751
1751
  var __defProp$D = Object.defineProperty;
1752
- var __defProps$r = Object.defineProperties;
1753
- var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
1752
+ var __defProps$q = Object.defineProperties;
1753
+ var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
1754
1754
  var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
1755
1755
  var __hasOwnProp$D = Object.prototype.hasOwnProperty;
1756
1756
  var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
@@ -1766,7 +1766,7 @@ var __spreadValues$D = (a, b) => {
1766
1766
  }
1767
1767
  return a;
1768
1768
  };
1769
- var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
1769
+ var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
1770
1770
  function getTemplateProxyForField(field, frame, frames) {
1771
1771
  return new Proxy(
1772
1772
  {},
@@ -1782,7 +1782,7 @@ function getTemplateProxyForField(field, frame, frames) {
1782
1782
  if (!field.labels) {
1783
1783
  return "";
1784
1784
  }
1785
- return __spreadProps$r(__spreadValues$D({}, field.labels), {
1785
+ return __spreadProps$q(__spreadValues$D({}, field.labels), {
1786
1786
  __values: Object.values(field.labels).sort().join(", "),
1787
1787
  toString: () => {
1788
1788
  return data.formatLabels(field.labels, "", true);
@@ -2071,11 +2071,7 @@ async function getDataSource(datasource, scopedVars) {
2071
2071
  }
2072
2072
 
2073
2073
  function writeSceneLog(logger, message, ...rest) {
2074
- let loggingEnabled = false;
2075
- if (typeof window !== "undefined") {
2076
- loggingEnabled = localStorage.getItem("grafana.debug.scenes") === "true";
2077
- }
2078
- if (loggingEnabled) {
2074
+ if (window.grafanaSceneLogging) {
2079
2075
  console.log(`${logger}: `, message, ...rest);
2080
2076
  }
2081
2077
  }
@@ -2259,13 +2255,7 @@ class VariableValueRecorder {
2259
2255
  }
2260
2256
  }
2261
2257
 
2262
- function isExtraQueryProvider(obj) {
2263
- return typeof obj === "object" && "getExtraQueries" in obj;
2264
- }
2265
-
2266
2258
  var __defProp$C = Object.defineProperty;
2267
- var __defProps$q = Object.defineProperties;
2268
- var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
2269
2259
  var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
2270
2260
  var __hasOwnProp$C = Object.prototype.hasOwnProperty;
2271
2261
  var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
@@ -2281,29 +2271,166 @@ var __spreadValues$C = (a, b) => {
2281
2271
  }
2282
2272
  return a;
2283
2273
  };
2284
- var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
2285
- const passthroughProcessor = (_, secondary) => rxjs.of(secondary);
2286
- const extraQueryProcessingOperator = (processors) => (data) => {
2287
- return data.pipe(
2288
- rxjs.mergeMap(([primary, ...secondaries]) => {
2289
- const processedSecondaries = secondaries.flatMap((s) => {
2290
- var _a, _b;
2291
- return (_b = (_a = processors.get(s.request.requestId)) == null ? void 0 : _a(primary, s)) != null ? _b : rxjs.of(s);
2292
- });
2293
- return rxjs.forkJoin([rxjs.of(primary), ...processedSecondaries]);
2294
- }),
2295
- rxjs.map(([primary, ...processedSecondaries]) => {
2296
- var _a;
2297
- return __spreadProps$q(__spreadValues$C({}, primary), {
2298
- series: [...primary.series, ...processedSecondaries.flatMap((s) => s.series)],
2299
- annotations: [...(_a = primary.annotations) != null ? _a : [], ...processedSecondaries.flatMap((s) => {
2300
- var _a2;
2301
- return (_a2 = s.annotations) != null ? _a2 : [];
2302
- })]
2274
+ const PREVIOUS_PERIOD_VALUE = "__previousPeriod";
2275
+ const NO_PERIOD_VALUE = "__noPeriod";
2276
+ const PREVIOUS_PERIOD_COMPARE_OPTION = {
2277
+ label: "Previous period",
2278
+ value: PREVIOUS_PERIOD_VALUE
2279
+ };
2280
+ const NO_COMPARE_OPTION = {
2281
+ label: "No comparison",
2282
+ value: NO_PERIOD_VALUE
2283
+ };
2284
+ const DEFAULT_COMPARE_OPTIONS = [
2285
+ { label: "Day before", value: "24h" },
2286
+ { label: "Week before", value: "1w" },
2287
+ { label: "Month before", value: "1M" }
2288
+ ];
2289
+ class SceneTimeRangeCompare extends SceneObjectBase {
2290
+ constructor(state) {
2291
+ super(__spreadValues$C({ compareOptions: DEFAULT_COMPARE_OPTIONS }, state));
2292
+ this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["compareWith"] });
2293
+ this._onActivate = () => {
2294
+ const sceneTimeRange = sceneGraph.getTimeRange(this);
2295
+ this.setState({ compareOptions: this.getCompareOptions(sceneTimeRange.state.value) });
2296
+ this._subs.add(
2297
+ sceneTimeRange.subscribeToState((timeRange) => {
2298
+ const compareOptions = this.getCompareOptions(timeRange.value);
2299
+ const stateUpdate = { compareOptions };
2300
+ if (Boolean(this.state.compareWith) && !compareOptions.find(({ value }) => value === this.state.compareWith)) {
2301
+ stateUpdate.compareWith = PREVIOUS_PERIOD_VALUE;
2302
+ }
2303
+ this.setState(stateUpdate);
2304
+ })
2305
+ );
2306
+ };
2307
+ this.getCompareOptions = (timeRange) => {
2308
+ const diffDays = Math.ceil(timeRange.to.diff(timeRange.from));
2309
+ const matchIndex = DEFAULT_COMPARE_OPTIONS.findIndex(({ value }) => {
2310
+ const intervalInMs = data.rangeUtil.intervalToMs(value);
2311
+ return intervalInMs >= diffDays;
2303
2312
  });
2313
+ return [
2314
+ NO_COMPARE_OPTION,
2315
+ PREVIOUS_PERIOD_COMPARE_OPTION,
2316
+ ...DEFAULT_COMPARE_OPTIONS.slice(matchIndex).map(({ label, value }) => ({ label, value }))
2317
+ ];
2318
+ };
2319
+ this.onCompareWithChanged = (compareWith) => {
2320
+ if (compareWith === NO_PERIOD_VALUE) {
2321
+ this.onClearCompare();
2322
+ } else {
2323
+ this.setState({ compareWith });
2324
+ }
2325
+ };
2326
+ this.onClearCompare = () => {
2327
+ this.setState({ compareWith: void 0 });
2328
+ };
2329
+ this.addActivationHandler(this._onActivate);
2330
+ }
2331
+ getCompareTimeRange(timeRange) {
2332
+ let compareFrom;
2333
+ let compareTo;
2334
+ if (this.state.compareWith) {
2335
+ if (this.state.compareWith === PREVIOUS_PERIOD_VALUE) {
2336
+ const diffMs = timeRange.to.diff(timeRange.from);
2337
+ compareFrom = data.dateTime(timeRange.from).subtract(diffMs);
2338
+ compareTo = data.dateTime(timeRange.to).subtract(diffMs);
2339
+ } else {
2340
+ compareFrom = data.dateTime(timeRange.from).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
2341
+ compareTo = data.dateTime(timeRange.to).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
2342
+ }
2343
+ return {
2344
+ from: compareFrom,
2345
+ to: compareTo,
2346
+ raw: {
2347
+ from: compareFrom,
2348
+ to: compareTo
2349
+ }
2350
+ };
2351
+ }
2352
+ return void 0;
2353
+ }
2354
+ getUrlState() {
2355
+ return {
2356
+ compareWith: this.state.compareWith
2357
+ };
2358
+ }
2359
+ updateFromUrl(values) {
2360
+ if (!values.compareWith) {
2361
+ return;
2362
+ }
2363
+ const compareWith = parseUrlParam(values.compareWith);
2364
+ if (compareWith) {
2365
+ const compareOptions = this.getCompareOptions(sceneGraph.getTimeRange(this).state.value);
2366
+ if (compareOptions.find(({ value }) => value === compareWith)) {
2367
+ this.setState({
2368
+ compareWith
2369
+ });
2370
+ } else {
2371
+ this.setState({
2372
+ compareWith: "__previousPeriod"
2373
+ });
2374
+ }
2375
+ }
2376
+ }
2377
+ }
2378
+ SceneTimeRangeCompare.Component = SceneTimeRangeCompareRenderer;
2379
+ function SceneTimeRangeCompareRenderer({ model }) {
2380
+ var _a;
2381
+ const styles = ui.useStyles2(getStyles$9);
2382
+ const { compareWith, compareOptions } = model.useState();
2383
+ const [previousCompare, setPreviousCompare] = React__default["default"].useState(compareWith);
2384
+ const previousValue = (_a = compareOptions.find(({ value: value2 }) => value2 === previousCompare)) != null ? _a : PREVIOUS_PERIOD_COMPARE_OPTION;
2385
+ const value = compareOptions.find(({ value: value2 }) => value2 === compareWith);
2386
+ const enabled = Boolean(value);
2387
+ const onClick = () => {
2388
+ if (enabled) {
2389
+ setPreviousCompare(compareWith);
2390
+ model.onClearCompare();
2391
+ } else if (!enabled) {
2392
+ model.onCompareWithChanged(previousValue.value);
2393
+ }
2394
+ };
2395
+ return /* @__PURE__ */ React__default["default"].createElement(ui.ButtonGroup, null, /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
2396
+ variant: "canvas",
2397
+ tooltip: "Enable time frame comparison",
2398
+ onClick: (e) => {
2399
+ e.stopPropagation();
2400
+ e.preventDefault();
2401
+ onClick();
2402
+ }
2403
+ }, /* @__PURE__ */ React__default["default"].createElement(ui.Checkbox, {
2404
+ label: " ",
2405
+ value: enabled,
2406
+ onClick
2407
+ }), "Comparison"), enabled ? /* @__PURE__ */ React__default["default"].createElement(ui.ButtonSelect, {
2408
+ variant: "canvas",
2409
+ value,
2410
+ options: compareOptions,
2411
+ onChange: (v) => {
2412
+ model.onCompareWithChanged(v.value);
2413
+ }
2414
+ }) : /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
2415
+ className: styles.previewButton,
2416
+ disabled: true,
2417
+ variant: "canvas",
2418
+ isOpen: false
2419
+ }, previousValue.label));
2420
+ }
2421
+ function getStyles$9(theme) {
2422
+ return {
2423
+ previewButton: css.css({
2424
+ "&:disabled": {
2425
+ border: `1px solid ${theme.colors.secondary.border}`,
2426
+ color: theme.colors.text.disabled,
2427
+ opacity: 1
2428
+ }
2304
2429
  })
2305
- );
2306
- };
2430
+ };
2431
+ }
2432
+
2433
+ const getCompareSeriesRefId = (refId) => `${refId}-compare`;
2307
2434
 
2308
2435
  var __defProp$B = Object.defineProperty;
2309
2436
  var __defProps$p = Object.defineProperties;
@@ -2324,6 +2451,59 @@ var __spreadValues$B = (a, b) => {
2324
2451
  return a;
2325
2452
  };
2326
2453
  var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
2454
+ function timeShiftQueryResponseOperator(data$1) {
2455
+ return data$1.pipe(
2456
+ rxjs.map(([p, s]) => {
2457
+ const diff = s.timeRange.from.diff(p.timeRange.from);
2458
+ s.series.forEach((series) => {
2459
+ series.refId = getCompareSeriesRefId(series.refId || "");
2460
+ series.meta = __spreadProps$p(__spreadValues$B({}, series.meta), {
2461
+ timeCompare: {
2462
+ diffMs: diff,
2463
+ isTimeShiftQuery: true
2464
+ }
2465
+ });
2466
+ series.fields.forEach((field) => {
2467
+ if (field.type === data.FieldType.time) {
2468
+ field.values = field.values.map((v) => {
2469
+ return diff < 0 ? v - diff : v + diff;
2470
+ });
2471
+ }
2472
+ field.config = __spreadProps$p(__spreadValues$B({}, field.config), {
2473
+ color: {
2474
+ mode: "fixed",
2475
+ fixedColor: runtime.config.theme.palette.gray60
2476
+ }
2477
+ });
2478
+ return field;
2479
+ });
2480
+ });
2481
+ return __spreadProps$p(__spreadValues$B({}, p), {
2482
+ series: [...p.series, ...s.series]
2483
+ });
2484
+ })
2485
+ );
2486
+ }
2487
+
2488
+ var __defProp$A = Object.defineProperty;
2489
+ var __defProps$o = Object.defineProperties;
2490
+ var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
2491
+ var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
2492
+ var __hasOwnProp$A = Object.prototype.hasOwnProperty;
2493
+ var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
2494
+ var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2495
+ var __spreadValues$A = (a, b) => {
2496
+ for (var prop in b || (b = {}))
2497
+ if (__hasOwnProp$A.call(b, prop))
2498
+ __defNormalProp$A(a, prop, b[prop]);
2499
+ if (__getOwnPropSymbols$A)
2500
+ for (var prop of __getOwnPropSymbols$A(b)) {
2501
+ if (__propIsEnum$A.call(b, prop))
2502
+ __defNormalProp$A(a, prop, b[prop]);
2503
+ }
2504
+ return a;
2505
+ };
2506
+ var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
2327
2507
  function filterAnnotations(data, filters) {
2328
2508
  var _a;
2329
2509
  if (!Array.isArray(data) || data.length === 0) {
@@ -2374,11 +2554,11 @@ function filterAnnotations(data, filters) {
2374
2554
  continue;
2375
2555
  }
2376
2556
  }
2377
- fields.push(__spreadProps$p(__spreadValues$B({}, field), {
2557
+ fields.push(__spreadProps$o(__spreadValues$A({}, field), {
2378
2558
  values: buffer
2379
2559
  }));
2380
2560
  }
2381
- processed.push(__spreadProps$p(__spreadValues$B({}, frame), {
2561
+ processed.push(__spreadProps$o(__spreadValues$A({}, frame), {
2382
2562
  fields,
2383
2563
  length: frameLength
2384
2564
  }));
@@ -2810,33 +2990,33 @@ function getOptionSearcher(options, includeAll, value, text) {
2810
2990
  };
2811
2991
  }
2812
2992
 
2813
- var __defProp$A = Object.defineProperty;
2814
- var __defProps$o = Object.defineProperties;
2815
- var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
2816
- var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
2817
- var __hasOwnProp$A = Object.prototype.hasOwnProperty;
2818
- var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
2819
- var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2820
- var __spreadValues$A = (a, b) => {
2993
+ var __defProp$z = Object.defineProperty;
2994
+ var __defProps$n = Object.defineProperties;
2995
+ var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
2996
+ var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
2997
+ var __hasOwnProp$z = Object.prototype.hasOwnProperty;
2998
+ var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
2999
+ var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3000
+ var __spreadValues$z = (a, b) => {
2821
3001
  for (var prop in b || (b = {}))
2822
- if (__hasOwnProp$A.call(b, prop))
2823
- __defNormalProp$A(a, prop, b[prop]);
2824
- if (__getOwnPropSymbols$A)
2825
- for (var prop of __getOwnPropSymbols$A(b)) {
2826
- if (__propIsEnum$A.call(b, prop))
2827
- __defNormalProp$A(a, prop, b[prop]);
3002
+ if (__hasOwnProp$z.call(b, prop))
3003
+ __defNormalProp$z(a, prop, b[prop]);
3004
+ if (__getOwnPropSymbols$z)
3005
+ for (var prop of __getOwnPropSymbols$z(b)) {
3006
+ if (__propIsEnum$z.call(b, prop))
3007
+ __defNormalProp$z(a, prop, b[prop]);
2828
3008
  }
2829
3009
  return a;
2830
3010
  };
2831
- var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
3011
+ var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
2832
3012
  var __objRest$3 = (source, exclude) => {
2833
3013
  var target = {};
2834
3014
  for (var prop in source)
2835
- if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
3015
+ if (__hasOwnProp$z.call(source, prop) && exclude.indexOf(prop) < 0)
2836
3016
  target[prop] = source[prop];
2837
- if (source != null && __getOwnPropSymbols$A)
2838
- for (var prop of __getOwnPropSymbols$A(source)) {
2839
- if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
3017
+ if (source != null && __getOwnPropSymbols$z)
3018
+ for (var prop of __getOwnPropSymbols$z(source)) {
3019
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$z.call(source, prop))
2840
3020
  target[prop] = source[prop];
2841
3021
  }
2842
3022
  return target;
@@ -2959,26 +3139,25 @@ const OptionWithCheckbox = ({
2959
3139
  isSelected,
2960
3140
  renderOptionLabel
2961
3141
  }) => {
2962
- var _b;
2963
3142
  const _a = innerProps, rest = __objRest$3(_a, ["onMouseMove", "onMouseOver"]);
2964
3143
  const theme = ui.useTheme2();
2965
3144
  const selectStyles = ui.getSelectStyles(theme);
2966
3145
  const optionStyles = ui.useStyles2(getOptionStyles);
2967
- return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$o(__spreadValues$A({
3146
+ return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$n(__spreadValues$z({
2968
3147
  ref: innerRef,
2969
3148
  className: css.cx(selectStyles.option, isFocused && selectStyles.optionFocused)
2970
3149
  }, rest), {
2971
- "data-testid": e2eSelectors.selectors.components.Select.option,
3150
+ "aria-label": "Select option",
3151
+ "data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(
3152
+ data.label || String(data.value)
3153
+ ),
2972
3154
  title: data.title
2973
3155
  }), /* @__PURE__ */ React__default["default"].createElement("div", {
2974
3156
  className: optionStyles.checkbox
2975
3157
  }, /* @__PURE__ */ React__default["default"].createElement(ui.Checkbox, {
2976
3158
  value: isSelected
2977
3159
  })), /* @__PURE__ */ React__default["default"].createElement("div", {
2978
- className: selectStyles.optionBody,
2979
- "data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(
2980
- (_b = data.label) != null ? _b : String(data.value)
2981
- )
3160
+ className: selectStyles.optionBody
2982
3161
  }, /* @__PURE__ */ React__default["default"].createElement("span", null, children)));
2983
3162
  };
2984
3163
  OptionWithCheckbox.displayName = "SelectMenuOptions";
@@ -3058,28 +3237,28 @@ function fromUrlValues(urlValues) {
3058
3237
  );
3059
3238
  }
3060
3239
 
3061
- var __defProp$z = Object.defineProperty;
3062
- var __defProps$n = Object.defineProperties;
3063
- var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
3064
- var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
3065
- var __hasOwnProp$z = Object.prototype.hasOwnProperty;
3066
- var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
3067
- var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3068
- var __spreadValues$z = (a, b) => {
3240
+ var __defProp$y = Object.defineProperty;
3241
+ var __defProps$m = Object.defineProperties;
3242
+ var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
3243
+ var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
3244
+ var __hasOwnProp$y = Object.prototype.hasOwnProperty;
3245
+ var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
3246
+ var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3247
+ var __spreadValues$y = (a, b) => {
3069
3248
  for (var prop in b || (b = {}))
3070
- if (__hasOwnProp$z.call(b, prop))
3071
- __defNormalProp$z(a, prop, b[prop]);
3072
- if (__getOwnPropSymbols$z)
3073
- for (var prop of __getOwnPropSymbols$z(b)) {
3074
- if (__propIsEnum$z.call(b, prop))
3075
- __defNormalProp$z(a, prop, b[prop]);
3249
+ if (__hasOwnProp$y.call(b, prop))
3250
+ __defNormalProp$y(a, prop, b[prop]);
3251
+ if (__getOwnPropSymbols$y)
3252
+ for (var prop of __getOwnPropSymbols$y(b)) {
3253
+ if (__propIsEnum$y.call(b, prop))
3254
+ __defNormalProp$y(a, prop, b[prop]);
3076
3255
  }
3077
3256
  return a;
3078
3257
  };
3079
- var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
3258
+ var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
3080
3259
  class GroupByVariable extends MultiValueVariable {
3081
3260
  constructor(initialState) {
3082
- super(__spreadProps$n(__spreadValues$z({
3261
+ super(__spreadProps$m(__spreadValues$y({
3083
3262
  isMulti: true,
3084
3263
  name: "",
3085
3264
  value: [],
@@ -3278,7 +3457,7 @@ function LoadingIndicator(props) {
3278
3457
  }
3279
3458
 
3280
3459
  function ControlsLabel(props) {
3281
- const styles = ui.useStyles2(getStyles$9);
3460
+ const styles = ui.useStyles2(getStyles$8);
3282
3461
  const theme = ui.useTheme2();
3283
3462
  const isVertical = props.layout === "vertical";
3284
3463
  const loadingIndicator = Boolean(props.isLoading) ? /* @__PURE__ */ React__default["default"].createElement("div", {
@@ -3341,7 +3520,7 @@ function ControlsLabel(props) {
3341
3520
  }
3342
3521
  return labelElement;
3343
3522
  }
3344
- const getStyles$9 = (theme) => ({
3523
+ const getStyles$8 = (theme) => ({
3345
3524
  horizontalLabel: css.css({
3346
3525
  background: theme.isDark ? theme.colors.background.primary : theme.colors.background.secondary,
3347
3526
  display: `flex`,
@@ -3376,6 +3555,13 @@ const getStyles$9 = (theme) => ({
3376
3555
  })
3377
3556
  });
3378
3557
 
3558
+ function selectableValueToVariableValueOption(value) {
3559
+ var _a;
3560
+ return {
3561
+ label: (_a = value.label) != null ? _a : String(value.value),
3562
+ value: value.value
3563
+ };
3564
+ }
3379
3565
  function keyLabelToOption(key, label) {
3380
3566
  return key !== "" ? {
3381
3567
  value: key,
@@ -3384,16 +3570,33 @@ function keyLabelToOption(key, label) {
3384
3570
  }
3385
3571
  function AdHocFilterRenderer({ filter, model }) {
3386
3572
  var _a, _b;
3387
- const styles = ui.useStyles2(getStyles$8);
3573
+ const styles = ui.useStyles2(getStyles$7);
3388
3574
  const [keys, setKeys] = React.useState([]);
3389
3575
  const [values, setValues] = React.useState([]);
3390
3576
  const [isKeysLoading, setIsKeysLoading] = React.useState(false);
3391
3577
  const [isValuesLoading, setIsValuesLoading] = React.useState(false);
3392
3578
  const [isKeysOpen, setIsKeysOpen] = React.useState(false);
3393
3579
  const [isValuesOpen, setIsValuesOpen] = React.useState(false);
3580
+ const [valueInputValue, setValueInputValue] = React.useState("");
3581
+ const [valueHasCustomValue, setValueHasCustomValue] = React.useState(false);
3394
3582
  const keyValue = keyLabelToOption(filter.key, filter.keyLabel);
3395
3583
  const valueValue = keyLabelToOption(filter.value, filter.valueLabel);
3584
+ const optionSearcher = React.useMemo(
3585
+ () => {
3586
+ var _a2, _b2;
3587
+ return getOptionSearcher(values.map(selectableValueToVariableValueOption), void 0, (_a2 = valueValue == null ? void 0 : valueValue.value) != null ? _a2 : "", (_b2 = valueValue == null ? void 0 : valueValue.label) != null ? _b2 : "");
3588
+ },
3589
+ [values, valueValue == null ? void 0 : valueValue.value, valueValue == null ? void 0 : valueValue.label]
3590
+ );
3591
+ const onValueInputChange = (value, { action }) => {
3592
+ if (action === "input-change") {
3593
+ setValueInputValue(value);
3594
+ }
3595
+ return value;
3596
+ };
3597
+ const filteredValueOptions = optionSearcher(valueInputValue);
3396
3598
  const valueSelect = /* @__PURE__ */ React__default["default"].createElement(ui.Select, {
3599
+ virtualized: true,
3397
3600
  allowCustomValue: true,
3398
3601
  isValidNewOption: (inputValue) => inputValue.trim().length > 0,
3399
3602
  allowCreateWhileLoading: true,
@@ -3403,21 +3606,33 @@ function AdHocFilterRenderer({ filter, model }) {
3403
3606
  width: "auto",
3404
3607
  value: valueValue,
3405
3608
  placeholder: "Select value",
3406
- options: values,
3407
- onChange: (v) => model._updateFilter(filter, "value", v),
3609
+ options: filteredValueOptions,
3610
+ inputValue: valueInputValue,
3611
+ onInputChange: onValueInputChange,
3612
+ onChange: (v) => {
3613
+ model._updateFilter(filter, "value", v);
3614
+ if (valueHasCustomValue !== v.__isNew__) {
3615
+ setValueHasCustomValue(v.__isNew__);
3616
+ }
3617
+ },
3408
3618
  isOpen: isValuesOpen && !isValuesLoading,
3409
3619
  isLoading: isValuesLoading,
3410
3620
  autoFocus: filter.key !== "" && filter.value === "",
3411
3621
  openMenuOnFocus: true,
3412
3622
  onOpenMenu: async () => {
3623
+ var _a2;
3413
3624
  setIsValuesLoading(true);
3414
3625
  setIsValuesOpen(true);
3415
3626
  const values2 = await model._getValuesFor(filter);
3416
3627
  setIsValuesLoading(false);
3417
3628
  setValues(values2);
3629
+ if (valueHasCustomValue) {
3630
+ setValueInputValue((_a2 = valueValue == null ? void 0 : valueValue.label) != null ? _a2 : "");
3631
+ }
3418
3632
  },
3419
3633
  onCloseMenu: () => {
3420
3634
  setIsValuesOpen(false);
3635
+ setValueInputValue("");
3421
3636
  }
3422
3637
  });
3423
3638
  const keySelect = /* @__PURE__ */ React__default["default"].createElement(ui.Select, {
@@ -3489,7 +3704,7 @@ function AdHocFilterRenderer({ filter, model }) {
3489
3704
  onClick: () => model._removeFilter(filter)
3490
3705
  }));
3491
3706
  }
3492
- const getStyles$8 = (theme) => ({
3707
+ const getStyles$7 = (theme) => ({
3493
3708
  field: css.css({
3494
3709
  marginBottom: 0
3495
3710
  }),
@@ -3627,29 +3842,29 @@ function isFilter(filter) {
3627
3842
  return filter !== null && typeof filter.key === "string" && typeof filter.value === "string";
3628
3843
  }
3629
3844
 
3630
- var __defProp$y = Object.defineProperty;
3631
- var __defProps$m = Object.defineProperties;
3632
- var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
3633
- var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
3634
- var __hasOwnProp$y = Object.prototype.hasOwnProperty;
3635
- var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
3636
- var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3637
- var __spreadValues$y = (a, b) => {
3845
+ var __defProp$x = Object.defineProperty;
3846
+ var __defProps$l = Object.defineProperties;
3847
+ var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
3848
+ var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
3849
+ var __hasOwnProp$x = Object.prototype.hasOwnProperty;
3850
+ var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
3851
+ var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3852
+ var __spreadValues$x = (a, b) => {
3638
3853
  for (var prop in b || (b = {}))
3639
- if (__hasOwnProp$y.call(b, prop))
3640
- __defNormalProp$y(a, prop, b[prop]);
3641
- if (__getOwnPropSymbols$y)
3642
- for (var prop of __getOwnPropSymbols$y(b)) {
3643
- if (__propIsEnum$y.call(b, prop))
3644
- __defNormalProp$y(a, prop, b[prop]);
3854
+ if (__hasOwnProp$x.call(b, prop))
3855
+ __defNormalProp$x(a, prop, b[prop]);
3856
+ if (__getOwnPropSymbols$x)
3857
+ for (var prop of __getOwnPropSymbols$x(b)) {
3858
+ if (__propIsEnum$x.call(b, prop))
3859
+ __defNormalProp$x(a, prop, b[prop]);
3645
3860
  }
3646
3861
  return a;
3647
3862
  };
3648
- var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
3863
+ var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
3649
3864
  class AdHocFiltersVariable extends SceneObjectBase {
3650
3865
  constructor(state) {
3651
3866
  var _a, _b;
3652
- super(__spreadValues$y({
3867
+ super(__spreadValues$x({
3653
3868
  type: "adhoc",
3654
3869
  name: (_a = state.name) != null ? _a : "Filters",
3655
3870
  filters: [],
@@ -3686,15 +3901,15 @@ class AdHocFiltersVariable extends SceneObjectBase {
3686
3901
  const propLabelKey = `${prop}Label`;
3687
3902
  if (filter === _wip) {
3688
3903
  if (prop === "value") {
3689
- this.setState({ filters: [...filters, __spreadProps$m(__spreadValues$y({}, _wip), { [prop]: value, [propLabelKey]: label })], _wip: void 0 });
3904
+ this.setState({ filters: [...filters, __spreadProps$l(__spreadValues$x({}, _wip), { [prop]: value, [propLabelKey]: label })], _wip: void 0 });
3690
3905
  } else {
3691
- this.setState({ _wip: __spreadProps$m(__spreadValues$y({}, filter), { [prop]: value, [propLabelKey]: label }) });
3906
+ this.setState({ _wip: __spreadProps$l(__spreadValues$x({}, filter), { [prop]: value, [propLabelKey]: label }) });
3692
3907
  }
3693
3908
  return;
3694
3909
  }
3695
3910
  const updatedFilters = this.state.filters.map((f) => {
3696
3911
  if (f === filter) {
3697
- const updatedFilter = __spreadProps$m(__spreadValues$y({}, f), { [prop]: value, [propLabelKey]: label });
3912
+ const updatedFilter = __spreadProps$l(__spreadValues$x({}, f), { [prop]: value, [propLabelKey]: label });
3698
3913
  if (prop === "key" && filter[prop] !== value) {
3699
3914
  updatedFilter.value = "";
3700
3915
  updatedFilter.valueLabel = "";
@@ -3775,7 +3990,7 @@ function renderExpression(builder, filters) {
3775
3990
  }
3776
3991
  function AdHocFiltersVariableRenderer({ model }) {
3777
3992
  const { filters, readOnly, addFilterButtonText } = model.useState();
3778
- const styles = ui.useStyles2(getStyles$7);
3993
+ const styles = ui.useStyles2(getStyles$6);
3779
3994
  return /* @__PURE__ */ React__default["default"].createElement("div", {
3780
3995
  className: styles.wrapper
3781
3996
  }, filters.map((filter, index) => /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, {
@@ -3789,7 +4004,7 @@ function AdHocFiltersVariableRenderer({ model }) {
3789
4004
  addFilterButtonText
3790
4005
  }));
3791
4006
  }
3792
- const getStyles$7 = (theme) => ({
4007
+ const getStyles$6 = (theme) => ({
3793
4008
  wrapper: css.css({
3794
4009
  display: "flex",
3795
4010
  flexWrap: "wrap",
@@ -3873,25 +4088,25 @@ function areDifferentLayers(a, b) {
3873
4088
  return false;
3874
4089
  }
3875
4090
 
3876
- var __defProp$x = Object.defineProperty;
3877
- var __defProps$l = Object.defineProperties;
3878
- var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
3879
- var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
3880
- var __hasOwnProp$x = Object.prototype.hasOwnProperty;
3881
- var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
3882
- var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3883
- var __spreadValues$x = (a, b) => {
4091
+ var __defProp$w = Object.defineProperty;
4092
+ var __defProps$k = Object.defineProperties;
4093
+ var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
4094
+ var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
4095
+ var __hasOwnProp$w = Object.prototype.hasOwnProperty;
4096
+ var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
4097
+ var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4098
+ var __spreadValues$w = (a, b) => {
3884
4099
  for (var prop in b || (b = {}))
3885
- if (__hasOwnProp$x.call(b, prop))
3886
- __defNormalProp$x(a, prop, b[prop]);
3887
- if (__getOwnPropSymbols$x)
3888
- for (var prop of __getOwnPropSymbols$x(b)) {
3889
- if (__propIsEnum$x.call(b, prop))
3890
- __defNormalProp$x(a, prop, b[prop]);
4100
+ if (__hasOwnProp$w.call(b, prop))
4101
+ __defNormalProp$w(a, prop, b[prop]);
4102
+ if (__getOwnPropSymbols$w)
4103
+ for (var prop of __getOwnPropSymbols$w(b)) {
4104
+ if (__propIsEnum$w.call(b, prop))
4105
+ __defNormalProp$w(a, prop, b[prop]);
3891
4106
  }
3892
4107
  return a;
3893
4108
  };
3894
- var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
4109
+ var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
3895
4110
  let counter$1 = 100;
3896
4111
  function getNextRequestId$1() {
3897
4112
  return "SQR" + counter$1++;
@@ -3908,6 +4123,70 @@ class SceneQueryRunner extends SceneObjectBase {
3908
4123
  onVariableUpdateCompleted: this.onVariableUpdatesCompleted.bind(this),
3909
4124
  onAnyVariableChanged: this.onAnyVariableChanged.bind(this)
3910
4125
  });
4126
+ this.prepareRequests = (timeRange, ds) => {
4127
+ const comparer = this.getTimeCompare();
4128
+ const { minInterval, queries } = this.state;
4129
+ let secondaryRequest;
4130
+ let request = __spreadValues$w({
4131
+ app: "scenes",
4132
+ requestId: getNextRequestId$1(),
4133
+ timezone: timeRange.getTimeZone(),
4134
+ panelId: 1,
4135
+ range: timeRange.state.value,
4136
+ interval: "1s",
4137
+ intervalMs: 1e3,
4138
+ targets: lodash.cloneDeep(queries),
4139
+ maxDataPoints: this.getMaxDataPoints(),
4140
+ scopedVars: this._scopedVars,
4141
+ startTime: Date.now(),
4142
+ liveStreaming: this.state.liveStreaming,
4143
+ rangeRaw: {
4144
+ from: timeRange.state.from,
4145
+ to: timeRange.state.to
4146
+ },
4147
+ cacheTimeout: this.state.cacheTimeout,
4148
+ queryCachingTTL: this.state.queryCachingTTL
4149
+ }, getEnrichedDataRequest(this));
4150
+ if (this._adhocFiltersVar) {
4151
+ request.filters = this._adhocFiltersVar.state.filters.filter(isFilterComplete);
4152
+ }
4153
+ if (this._groupByVar) {
4154
+ request.groupByKeys = this._groupByVar.state.value;
4155
+ }
4156
+ request.targets = request.targets.map((query) => {
4157
+ var _a;
4158
+ if (!query.datasource || query.datasource.uid !== ds.uid && !((_a = ds.meta) == null ? void 0 : _a.mixed) && runtime.isExpressionReference && !runtime.isExpressionReference(query.datasource)) {
4159
+ query.datasource = ds.getRef();
4160
+ }
4161
+ return query;
4162
+ });
4163
+ const lowerIntervalLimit = minInterval ? minInterval : ds.interval;
4164
+ const norm = data.rangeUtil.calculateInterval(timeRange.state.value, request.maxDataPoints, lowerIntervalLimit);
4165
+ request.scopedVars = Object.assign({}, request.scopedVars, {
4166
+ __interval: { text: norm.interval, value: norm.interval },
4167
+ __interval_ms: { text: norm.intervalMs.toString(), value: norm.intervalMs }
4168
+ });
4169
+ request.interval = norm.interval;
4170
+ request.intervalMs = norm.intervalMs;
4171
+ const primaryTimeRange = timeRange.state.value;
4172
+ if (comparer) {
4173
+ const secondaryTimeRange = comparer.getCompareTimeRange(primaryTimeRange);
4174
+ if (secondaryTimeRange) {
4175
+ const secondaryTargets = request.targets.filter((query) => query.timeRangeCompare !== false);
4176
+ if (secondaryTargets.length) {
4177
+ secondaryRequest = __spreadProps$k(__spreadValues$w({}, request), {
4178
+ targets: secondaryTargets,
4179
+ range: secondaryTimeRange,
4180
+ requestId: getNextRequestId$1()
4181
+ });
4182
+ }
4183
+ request = __spreadProps$k(__spreadValues$w({}, request), {
4184
+ range: primaryTimeRange
4185
+ });
4186
+ }
4187
+ }
4188
+ return [request, secondaryRequest];
4189
+ };
3911
4190
  this.onDataReceived = (data$1) => {
3912
4191
  const preProcessedData = data.preProcessPanelData(data$1, this.state.data);
3913
4192
  this._resultAnnotations = data$1.annotations;
@@ -3926,11 +4205,11 @@ class SceneQueryRunner extends SceneObjectBase {
3926
4205
  }
3927
4206
  _onActivate() {
3928
4207
  const timeRange = sceneGraph.getTimeRange(this);
3929
- const providers = this.getClosestExtraQueryProviders();
3930
- for (const provider of providers) {
4208
+ const comparer = this.getTimeCompare();
4209
+ if (comparer) {
3931
4210
  this._subs.add(
3932
- provider.subscribeToState((n, p) => {
3933
- if (provider.shouldRerun(p, n)) {
4211
+ comparer.subscribeToState((n, p) => {
4212
+ if (n.compareWith !== p.compareWith) {
3934
4213
  this.runQueries();
3935
4214
  }
3936
4215
  })
@@ -3989,9 +4268,9 @@ class SceneQueryRunner extends SceneObjectBase {
3989
4268
  return;
3990
4269
  }
3991
4270
  this._layerAnnotations = annotations;
3992
- const baseStateUpdate = this.state.data ? this.state.data : __spreadProps$l(__spreadValues$x({}, emptyPanelData), { timeRange: timeRange.state.value });
4271
+ const baseStateUpdate = this.state.data ? this.state.data : __spreadProps$k(__spreadValues$w({}, emptyPanelData), { timeRange: timeRange.state.value });
3993
4272
  this.setState({
3994
- data: __spreadProps$l(__spreadValues$x({}, baseStateUpdate), {
4273
+ data: __spreadProps$k(__spreadValues$w({}, baseStateUpdate), {
3995
4274
  annotations: [...(_d = this._resultAnnotations) != null ? _d : [], ...annotations],
3996
4275
  alertState: alertState != null ? alertState : (_e = this.state.data) == null ? void 0 : _e.alertState
3997
4276
  })
@@ -4110,7 +4389,7 @@ class SceneQueryRunner extends SceneObjectBase {
4110
4389
  this._dataLayersSub = void 0;
4111
4390
  }
4112
4391
  this.setState({
4113
- data: __spreadProps$l(__spreadValues$x({}, this.state.data), { state: schema.LoadingState.Done })
4392
+ data: __spreadProps$k(__spreadValues$w({}, this.state.data), { state: schema.LoadingState.Done })
4114
4393
  });
4115
4394
  }
4116
4395
  async runWithTimeRange(timeRange) {
@@ -4124,7 +4403,6 @@ class SceneQueryRunner extends SceneObjectBase {
4124
4403
  (_a = this._querySub) == null ? void 0 : _a.unsubscribe();
4125
4404
  if (this._variableDependency.hasDependencyInLoadingState()) {
4126
4405
  writeSceneLog("SceneQueryRunner", "Variable dependency is in loading state, skipping query execution");
4127
- this.setState({ data: __spreadProps$l(__spreadValues$x({}, this.state.data), { state: schema.LoadingState.Loading }) });
4128
4406
  return;
4129
4407
  }
4130
4408
  const { queries } = this.state;
@@ -4137,18 +4415,16 @@ class SceneQueryRunner extends SceneObjectBase {
4137
4415
  const ds = await getDataSource(datasource, this._scopedVars);
4138
4416
  this.findAndSubscribeToAdHocFilters(datasource == null ? void 0 : datasource.uid);
4139
4417
  const runRequest = runtime.getRunRequest();
4140
- const { primary, secondaries, processors } = this.prepareRequests(timeRange, ds);
4418
+ const [request, secondaryRequest] = this.prepareRequests(timeRange, ds);
4141
4419
  writeSceneLog("SceneQueryRunner", "Starting runRequest", this.state.key);
4142
- let stream = runRequest(ds, primary);
4143
- if (secondaries.length > 0) {
4144
- const secondaryStreams = secondaries.map((r) => runRequest(ds, r));
4145
- const op = extraQueryProcessingOperator(processors);
4146
- stream = rxjs.forkJoin([stream, ...secondaryStreams]).pipe(op);
4420
+ let stream = runRequest(ds, request);
4421
+ if (secondaryRequest) {
4422
+ stream = rxjs.forkJoin([stream, runRequest(ds, secondaryRequest)]).pipe(timeShiftQueryResponseOperator);
4147
4423
  }
4148
4424
  stream = stream.pipe(
4149
4425
  registerQueryWithController({
4150
4426
  type: "data",
4151
- request: primary,
4427
+ request,
4152
4428
  origin: this,
4153
4429
  cancel: () => this.cancelQuery()
4154
4430
  })
@@ -4156,7 +4432,7 @@ class SceneQueryRunner extends SceneObjectBase {
4156
4432
  this._querySub = stream.subscribe(this.onDataReceived);
4157
4433
  } catch (err) {
4158
4434
  console.error("PanelQueryRunner Error", err);
4159
- this.onDataReceived(__spreadProps$l(__spreadValues$x(__spreadValues$x({}, emptyPanelData), this.state.data), {
4435
+ this.onDataReceived(__spreadProps$k(__spreadValues$w(__spreadValues$w({}, emptyPanelData), this.state.data), {
4160
4436
  state: schema.LoadingState.Error,
4161
4437
  errors: [runtime.toDataQueryError(err)]
4162
4438
  }));
@@ -4166,73 +4442,16 @@ class SceneQueryRunner extends SceneObjectBase {
4166
4442
  var _a;
4167
4443
  const clone = super.clone(withState);
4168
4444
  if (this._resultAnnotations) {
4169
- clone["_resultAnnotations"] = this._resultAnnotations.map((frame) => __spreadValues$x({}, frame));
4445
+ clone["_resultAnnotations"] = this._resultAnnotations.map((frame) => __spreadValues$w({}, frame));
4170
4446
  }
4171
4447
  if (this._layerAnnotations) {
4172
- clone["_layerAnnotations"] = this._layerAnnotations.map((frame) => __spreadValues$x({}, frame));
4448
+ clone["_layerAnnotations"] = this._layerAnnotations.map((frame) => __spreadValues$w({}, frame));
4173
4449
  }
4174
4450
  clone["_variableValueRecorder"] = this._variableValueRecorder.cloneAndRecordCurrentValuesForSceneObject(this);
4175
4451
  clone["_containerWidth"] = this._containerWidth;
4176
4452
  clone["_results"].next({ origin: this, data: (_a = this.state.data) != null ? _a : emptyPanelData });
4177
4453
  return clone;
4178
4454
  }
4179
- prepareRequests(timeRange, ds) {
4180
- var _a;
4181
- const { minInterval, queries } = this.state;
4182
- let request = __spreadValues$x({
4183
- app: "scenes",
4184
- requestId: getNextRequestId$1(),
4185
- timezone: timeRange.getTimeZone(),
4186
- panelId: 1,
4187
- range: timeRange.state.value,
4188
- interval: "1s",
4189
- intervalMs: 1e3,
4190
- targets: lodash.cloneDeep(queries),
4191
- maxDataPoints: this.getMaxDataPoints(),
4192
- scopedVars: this._scopedVars,
4193
- startTime: Date.now(),
4194
- liveStreaming: this.state.liveStreaming,
4195
- rangeRaw: {
4196
- from: timeRange.state.from,
4197
- to: timeRange.state.to
4198
- },
4199
- cacheTimeout: this.state.cacheTimeout,
4200
- queryCachingTTL: this.state.queryCachingTTL
4201
- }, getEnrichedDataRequest(this));
4202
- if (this._adhocFiltersVar) {
4203
- request.filters = this._adhocFiltersVar.state.filters.filter(isFilterComplete);
4204
- }
4205
- if (this._groupByVar) {
4206
- request.groupByKeys = this._groupByVar.state.value;
4207
- }
4208
- request.targets = request.targets.map((query) => {
4209
- var _a2;
4210
- if (!query.datasource || query.datasource.uid !== ds.uid && !((_a2 = ds.meta) == null ? void 0 : _a2.mixed) && runtime.isExpressionReference && !runtime.isExpressionReference(query.datasource)) {
4211
- query.datasource = ds.getRef();
4212
- }
4213
- return query;
4214
- });
4215
- const lowerIntervalLimit = minInterval ? minInterval : ds.interval;
4216
- const norm = data.rangeUtil.calculateInterval(timeRange.state.value, request.maxDataPoints, lowerIntervalLimit);
4217
- request.scopedVars = Object.assign({}, request.scopedVars, {
4218
- __interval: { text: norm.interval, value: norm.interval },
4219
- __interval_ms: { text: norm.intervalMs.toString(), value: norm.intervalMs }
4220
- });
4221
- request.interval = norm.interval;
4222
- request.intervalMs = norm.intervalMs;
4223
- const primaryTimeRange = timeRange.state.value;
4224
- let secondaryRequests = [];
4225
- let secondaryProcessors = /* @__PURE__ */ new Map();
4226
- for (const provider of (_a = this.getClosestExtraQueryProviders()) != null ? _a : []) {
4227
- for (const { req, processor } of provider.getExtraQueries(request)) {
4228
- const requestId = getNextRequestId$1();
4229
- secondaryRequests.push(__spreadProps$l(__spreadValues$x({}, req), { requestId }));
4230
- secondaryProcessors.set(requestId, processor != null ? processor : passthroughProcessor);
4231
- }
4232
- }
4233
- request.range = primaryTimeRange;
4234
- return { primary: request, secondaries: secondaryRequests, processors: secondaryProcessors };
4235
- }
4236
4455
  _combineDataLayers(data) {
4237
4456
  if (this._layerAnnotations && this._layerAnnotations.length > 0) {
4238
4457
  data.annotations = (data.annotations || []).concat(this._layerAnnotations);
@@ -4247,23 +4466,22 @@ class SceneQueryRunner extends SceneObjectBase {
4247
4466
  this.setState({ data: emptyPanelData });
4248
4467
  }
4249
4468
  }
4250
- getClosestExtraQueryProviders() {
4251
- const found = /* @__PURE__ */ new Map();
4469
+ getTimeCompare() {
4252
4470
  if (!this.parent) {
4253
- return [];
4471
+ return null;
4254
4472
  }
4255
- getClosest(this.parent, (s) => {
4256
- if (isExtraQueryProvider(s) && !found.has(s.constructor)) {
4257
- found.set(s.constructor, s);
4473
+ return getClosest(this.parent, (s) => {
4474
+ let found = null;
4475
+ if (s instanceof SceneTimeRangeCompare) {
4476
+ return s;
4258
4477
  }
4259
4478
  s.forEachChild((child) => {
4260
- if (isExtraQueryProvider(child) && !found.has(child.constructor)) {
4261
- found.set(child.constructor, child);
4479
+ if (child instanceof SceneTimeRangeCompare) {
4480
+ found = child;
4262
4481
  }
4263
4482
  });
4264
- return null;
4483
+ return found;
4265
4484
  });
4266
- return Array.from(found.values());
4267
4485
  }
4268
4486
  findAndSubscribeToAdHocFilters(uid) {
4269
4487
  const filtersVar = findActiveAdHocFilterVariableByUid(uid);
@@ -4462,28 +4680,28 @@ class ActWhenVariableChanged extends SceneObjectBase {
4462
4680
  }
4463
4681
  }
4464
4682
 
4465
- var __defProp$w = Object.defineProperty;
4466
- var __defProps$k = Object.defineProperties;
4467
- var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
4468
- var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
4469
- var __hasOwnProp$w = Object.prototype.hasOwnProperty;
4470
- var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
4471
- var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4472
- var __spreadValues$w = (a, b) => {
4683
+ var __defProp$v = Object.defineProperty;
4684
+ var __defProps$j = Object.defineProperties;
4685
+ var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
4686
+ var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
4687
+ var __hasOwnProp$v = Object.prototype.hasOwnProperty;
4688
+ var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
4689
+ var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4690
+ var __spreadValues$v = (a, b) => {
4473
4691
  for (var prop in b || (b = {}))
4474
- if (__hasOwnProp$w.call(b, prop))
4475
- __defNormalProp$w(a, prop, b[prop]);
4476
- if (__getOwnPropSymbols$w)
4477
- for (var prop of __getOwnPropSymbols$w(b)) {
4478
- if (__propIsEnum$w.call(b, prop))
4479
- __defNormalProp$w(a, prop, b[prop]);
4692
+ if (__hasOwnProp$v.call(b, prop))
4693
+ __defNormalProp$v(a, prop, b[prop]);
4694
+ if (__getOwnPropSymbols$v)
4695
+ for (var prop of __getOwnPropSymbols$v(b)) {
4696
+ if (__propIsEnum$v.call(b, prop))
4697
+ __defNormalProp$v(a, prop, b[prop]);
4480
4698
  }
4481
4699
  return a;
4482
4700
  };
4483
- var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
4701
+ var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
4484
4702
  class CursorSync extends SceneObjectBase {
4485
4703
  constructor(state) {
4486
- super(__spreadProps$k(__spreadValues$w({}, state), {
4704
+ super(__spreadProps$j(__spreadValues$v({}, state), {
4487
4705
  sync: state.sync || schema.DashboardCursorSync.Off
4488
4706
  }));
4489
4707
  this.getEventsBus = (panel) => {
@@ -4747,25 +4965,25 @@ const getAlertStateStyles = (theme) => {
4747
4965
  };
4748
4966
  };
4749
4967
 
4750
- var __defProp$v = Object.defineProperty;
4751
- var __defProps$j = Object.defineProperties;
4752
- var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
4753
- var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
4754
- var __hasOwnProp$v = Object.prototype.hasOwnProperty;
4755
- var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
4756
- var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4757
- var __spreadValues$v = (a, b) => {
4968
+ var __defProp$u = Object.defineProperty;
4969
+ var __defProps$i = Object.defineProperties;
4970
+ var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
4971
+ var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
4972
+ var __hasOwnProp$u = Object.prototype.hasOwnProperty;
4973
+ var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
4974
+ var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4975
+ var __spreadValues$u = (a, b) => {
4758
4976
  for (var prop in b || (b = {}))
4759
- if (__hasOwnProp$v.call(b, prop))
4760
- __defNormalProp$v(a, prop, b[prop]);
4761
- if (__getOwnPropSymbols$v)
4762
- for (var prop of __getOwnPropSymbols$v(b)) {
4763
- if (__propIsEnum$v.call(b, prop))
4764
- __defNormalProp$v(a, prop, b[prop]);
4977
+ if (__hasOwnProp$u.call(b, prop))
4978
+ __defNormalProp$u(a, prop, b[prop]);
4979
+ if (__getOwnPropSymbols$u)
4980
+ for (var prop of __getOwnPropSymbols$u(b)) {
4981
+ if (__propIsEnum$u.call(b, prop))
4982
+ __defNormalProp$u(a, prop, b[prop]);
4765
4983
  }
4766
4984
  return a;
4767
4985
  };
4768
- var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
4986
+ var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
4769
4987
  const displayOverrideRef = "hideSeriesFrom";
4770
4988
  const isHideSeriesOverride = data.isSystemOverrideWithRef(displayOverrideRef);
4771
4989
  function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
@@ -4775,13 +4993,13 @@ function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
4775
4993
  if (currentIndex < 0) {
4776
4994
  if (mode === ui.SeriesVisibilityChangeMode.ToggleSelection) {
4777
4995
  const override3 = createOverride$1([displayName, ...getNamesOfHiddenFields(overrides, data)]);
4778
- return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
4996
+ return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
4779
4997
  overrides: [...fieldConfig.overrides, override3]
4780
4998
  });
4781
4999
  }
4782
5000
  const displayNames = getDisplayNames(data, displayName);
4783
5001
  const override2 = createOverride$1(displayNames);
4784
- return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
5002
+ return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
4785
5003
  overrides: [...fieldConfig.overrides, override2]
4786
5004
  });
4787
5005
  }
@@ -4794,22 +5012,22 @@ function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
4794
5012
  existing = existing.filter((el) => nameOfHiddenFields.indexOf(el) < 0);
4795
5013
  }
4796
5014
  if (existing[0] === displayName && existing.length === 1) {
4797
- return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
5015
+ return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
4798
5016
  overrides: overridesCopy
4799
5017
  });
4800
5018
  }
4801
5019
  const override2 = createOverride$1([displayName, ...nameOfHiddenFields]);
4802
- return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
5020
+ return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
4803
5021
  overrides: [...overridesCopy, override2]
4804
5022
  });
4805
5023
  }
4806
5024
  const override = createExtendedOverride(current, displayName);
4807
5025
  if (allFieldsAreExcluded(override, data)) {
4808
- return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
5026
+ return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
4809
5027
  overrides: overridesCopy
4810
5028
  });
4811
5029
  }
4812
- return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
5030
+ return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
4813
5031
  overrides: [...overridesCopy, override]
4814
5032
  });
4815
5033
  }
@@ -4834,7 +5052,7 @@ function createOverride$1(names, mode = data.ByNamesMatcherMode.exclude, propert
4834
5052
  }
4835
5053
  },
4836
5054
  properties: [
4837
- __spreadProps$j(__spreadValues$v({}, property), {
5055
+ __spreadProps$i(__spreadValues$u({}, property), {
4838
5056
  value: {
4839
5057
  viz: true,
4840
5058
  legend: false,
@@ -4906,32 +5124,32 @@ const getNamesOfHiddenFields = (overrides, data$1) => {
4906
5124
  return names;
4907
5125
  };
4908
5126
 
4909
- var __defProp$u = Object.defineProperty;
4910
- var __defProps$i = Object.defineProperties;
4911
- var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
4912
- var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
4913
- var __hasOwnProp$u = Object.prototype.hasOwnProperty;
4914
- var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
4915
- var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4916
- var __spreadValues$u = (a, b) => {
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) => {
4917
5135
  for (var prop in b || (b = {}))
4918
- if (__hasOwnProp$u.call(b, prop))
4919
- __defNormalProp$u(a, prop, b[prop]);
4920
- if (__getOwnPropSymbols$u)
4921
- for (var prop of __getOwnPropSymbols$u(b)) {
4922
- if (__propIsEnum$u.call(b, prop))
4923
- __defNormalProp$u(a, prop, b[prop]);
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]);
4924
5142
  }
4925
5143
  return a;
4926
5144
  };
4927
- var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
5145
+ var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
4928
5146
  const changeSeriesColorConfigFactory = (label, color, fieldConfig) => {
4929
5147
  const { overrides } = fieldConfig;
4930
5148
  const currentIndex = fieldConfig.overrides.findIndex((override) => {
4931
5149
  return override.matcher.id === data.FieldMatcherID.byName && override.matcher.options === label;
4932
5150
  });
4933
5151
  if (currentIndex < 0) {
4934
- return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
5152
+ return __spreadProps$h(__spreadValues$t({}, fieldConfig), {
4935
5153
  overrides: [...fieldConfig.overrides, createOverride(label, color)]
4936
5154
  });
4937
5155
  }
@@ -4939,19 +5157,19 @@ const changeSeriesColorConfigFactory = (label, color, fieldConfig) => {
4939
5157
  const existing = overridesCopy[currentIndex];
4940
5158
  const propertyIndex = existing.properties.findIndex((p) => p.id === "color");
4941
5159
  if (propertyIndex < 0) {
4942
- overridesCopy[currentIndex] = __spreadProps$i(__spreadValues$u({}, existing), {
5160
+ overridesCopy[currentIndex] = __spreadProps$h(__spreadValues$t({}, existing), {
4943
5161
  properties: [...existing.properties, createProperty(color)]
4944
5162
  });
4945
- return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
5163
+ return __spreadProps$h(__spreadValues$t({}, fieldConfig), {
4946
5164
  overrides: overridesCopy
4947
5165
  });
4948
5166
  }
4949
5167
  const propertiesCopy = Array.from(existing.properties);
4950
5168
  propertiesCopy[propertyIndex] = createProperty(color);
4951
- overridesCopy[currentIndex] = __spreadProps$i(__spreadValues$u({}, existing), {
5169
+ overridesCopy[currentIndex] = __spreadProps$h(__spreadValues$t({}, existing), {
4952
5170
  properties: propertiesCopy
4953
5171
  });
4954
- return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
5172
+ return __spreadProps$h(__spreadValues$t({}, fieldConfig), {
4955
5173
  overrides: overridesCopy
4956
5174
  });
4957
5175
  };
@@ -4974,29 +5192,29 @@ const createProperty = (color) => {
4974
5192
  };
4975
5193
  };
4976
5194
 
4977
- var __defProp$t = Object.defineProperty;
4978
- var __defProps$h = Object.defineProperties;
4979
- var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
4980
- var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
4981
- var __hasOwnProp$t = Object.prototype.hasOwnProperty;
4982
- var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
4983
- var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4984
- var __spreadValues$t = (a, b) => {
5195
+ var __defProp$s = Object.defineProperty;
5196
+ var __defProps$g = Object.defineProperties;
5197
+ var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
5198
+ var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
5199
+ var __hasOwnProp$s = Object.prototype.hasOwnProperty;
5200
+ var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
5201
+ var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5202
+ var __spreadValues$s = (a, b) => {
4985
5203
  for (var prop in b || (b = {}))
4986
- if (__hasOwnProp$t.call(b, prop))
4987
- __defNormalProp$t(a, prop, b[prop]);
4988
- if (__getOwnPropSymbols$t)
4989
- for (var prop of __getOwnPropSymbols$t(b)) {
4990
- if (__propIsEnum$t.call(b, prop))
4991
- __defNormalProp$t(a, prop, b[prop]);
5204
+ if (__hasOwnProp$s.call(b, prop))
5205
+ __defNormalProp$s(a, prop, b[prop]);
5206
+ if (__getOwnPropSymbols$s)
5207
+ for (var prop of __getOwnPropSymbols$s(b)) {
5208
+ if (__propIsEnum$s.call(b, prop))
5209
+ __defNormalProp$s(a, prop, b[prop]);
4992
5210
  }
4993
5211
  return a;
4994
5212
  };
4995
- var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
5213
+ var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
4996
5214
  class VizPanel extends SceneObjectBase {
4997
5215
  constructor(state) {
4998
5216
  var _a;
4999
- super(__spreadValues$t({
5217
+ super(__spreadValues$s({
5000
5218
  options: {},
5001
5219
  fieldConfig: { defaults: {}, overrides: [] },
5002
5220
  title: "Title",
@@ -5109,7 +5327,7 @@ class VizPanel extends SceneObjectBase {
5109
5327
  };
5110
5328
  this._onInstanceStateChange = (state) => {
5111
5329
  if (this._panelContext) {
5112
- this._panelContext = __spreadProps$h(__spreadValues$t({}, this._panelContext), {
5330
+ this._panelContext = __spreadProps$g(__spreadValues$s({}, this._panelContext), {
5113
5331
  instanceState: state
5114
5332
  });
5115
5333
  }
@@ -5133,8 +5351,8 @@ class VizPanel extends SceneObjectBase {
5133
5351
  sortBy = sortKey;
5134
5352
  }
5135
5353
  this.onOptionsChange(
5136
- __spreadProps$h(__spreadValues$t({}, this.state.options), {
5137
- legend: __spreadProps$h(__spreadValues$t({}, legendOptions), { sortBy, sortDesc })
5354
+ __spreadProps$g(__spreadValues$s({}, this.state.options), {
5355
+ legend: __spreadProps$g(__spreadValues$s({}, legendOptions), { sortBy, sortDesc })
5138
5356
  }),
5139
5357
  true
5140
5358
  );
@@ -5218,9 +5436,6 @@ class VizPanel extends SceneObjectBase {
5218
5436
  (_a = this._panelContext) != null ? _a : this._panelContext = this.buildPanelContext();
5219
5437
  return this._panelContext;
5220
5438
  }
5221
- clearFieldConfigCache() {
5222
- this._dataWithFieldConfig = void 0;
5223
- }
5224
5439
  applyFieldConfig(rawData) {
5225
5440
  var _a, _b, _c, _d;
5226
5441
  const plugin = this._plugin;
@@ -5244,7 +5459,7 @@ class VizPanel extends SceneObjectBase {
5244
5459
  if (!data.compareArrayValues(newFrames, prevFrames, data.compareDataFrameStructures)) {
5245
5460
  this._structureRev++;
5246
5461
  }
5247
- this._dataWithFieldConfig = __spreadProps$h(__spreadValues$t({}, rawData), {
5462
+ this._dataWithFieldConfig = __spreadProps$g(__spreadValues$s({}, rawData), {
5248
5463
  structureRev: this._structureRev,
5249
5464
  series: newFrames
5250
5465
  });
@@ -5387,25 +5602,25 @@ function getMessageFromError(err) {
5387
5602
  return JSON.stringify(err);
5388
5603
  }
5389
5604
 
5390
- var __defProp$s = Object.defineProperty;
5391
- var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
5392
- var __hasOwnProp$s = Object.prototype.hasOwnProperty;
5393
- var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
5394
- var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5395
- var __spreadValues$s = (a, b) => {
5605
+ var __defProp$r = Object.defineProperty;
5606
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
5607
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
5608
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
5609
+ var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5610
+ var __spreadValues$r = (a, b) => {
5396
5611
  for (var prop in b || (b = {}))
5397
- if (__hasOwnProp$s.call(b, prop))
5398
- __defNormalProp$s(a, prop, b[prop]);
5399
- if (__getOwnPropSymbols$s)
5400
- for (var prop of __getOwnPropSymbols$s(b)) {
5401
- if (__propIsEnum$s.call(b, prop))
5402
- __defNormalProp$s(a, prop, b[prop]);
5612
+ if (__hasOwnProp$r.call(b, prop))
5613
+ __defNormalProp$r(a, prop, b[prop]);
5614
+ if (__getOwnPropSymbols$r)
5615
+ for (var prop of __getOwnPropSymbols$r(b)) {
5616
+ if (__propIsEnum$r.call(b, prop))
5617
+ __defNormalProp$r(a, prop, b[prop]);
5403
5618
  }
5404
5619
  return a;
5405
5620
  };
5406
5621
  class SceneDataLayerBase extends SceneObjectBase {
5407
5622
  constructor(initialState, variableDependencyStatePaths = []) {
5408
- super(__spreadValues$s({
5623
+ super(__spreadValues$r({
5409
5624
  isEnabled: true
5410
5625
  }, initialState));
5411
5626
  this._results = new rxjs.ReplaySubject(1);
@@ -5527,33 +5742,33 @@ function DataLayerControlSwitch({ layer }) {
5527
5742
  }
5528
5743
  const containerStyle$1 = css.css({ display: "flex" });
5529
5744
 
5530
- var __defProp$r = Object.defineProperty;
5531
- var __defProps$g = Object.defineProperties;
5532
- var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
5533
- var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
5534
- var __hasOwnProp$r = Object.prototype.hasOwnProperty;
5535
- var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
5536
- var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5537
- var __spreadValues$r = (a, b) => {
5745
+ var __defProp$q = Object.defineProperty;
5746
+ var __defProps$f = Object.defineProperties;
5747
+ var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
5748
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
5749
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
5750
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
5751
+ var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5752
+ var __spreadValues$q = (a, b) => {
5538
5753
  for (var prop in b || (b = {}))
5539
- if (__hasOwnProp$r.call(b, prop))
5540
- __defNormalProp$r(a, prop, b[prop]);
5541
- if (__getOwnPropSymbols$r)
5542
- for (var prop of __getOwnPropSymbols$r(b)) {
5543
- if (__propIsEnum$r.call(b, prop))
5544
- __defNormalProp$r(a, prop, b[prop]);
5754
+ if (__hasOwnProp$q.call(b, prop))
5755
+ __defNormalProp$q(a, prop, b[prop]);
5756
+ if (__getOwnPropSymbols$q)
5757
+ for (var prop of __getOwnPropSymbols$q(b)) {
5758
+ if (__propIsEnum$q.call(b, prop))
5759
+ __defNormalProp$q(a, prop, b[prop]);
5545
5760
  }
5546
5761
  return a;
5547
5762
  };
5548
- var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
5763
+ var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
5549
5764
  var __objRest$2 = (source, exclude) => {
5550
5765
  var target = {};
5551
5766
  for (var prop in source)
5552
- if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
5767
+ if (__hasOwnProp$q.call(source, prop) && exclude.indexOf(prop) < 0)
5553
5768
  target[prop] = source[prop];
5554
- if (source != null && __getOwnPropSymbols$r)
5555
- for (var prop of __getOwnPropSymbols$r(source)) {
5556
- if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
5769
+ if (source != null && __getOwnPropSymbols$q)
5770
+ for (var prop of __getOwnPropSymbols$q(source)) {
5771
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$q.call(source, prop))
5557
5772
  target[prop] = source[prop];
5558
5773
  }
5559
5774
  return target;
@@ -5562,7 +5777,7 @@ const standardAnnotationSupport = {
5562
5777
  prepareAnnotation: (json) => {
5563
5778
  if (lodash.isString(json == null ? void 0 : json.query)) {
5564
5779
  const _a = json, { query } = _a, rest = __objRest$2(_a, ["query"]);
5565
- return __spreadProps$g(__spreadValues$r({}, rest), {
5780
+ return __spreadProps$f(__spreadValues$q({}, rest), {
5566
5781
  target: {
5567
5782
  refId: "annotation_query",
5568
5783
  query
@@ -5730,25 +5945,25 @@ function shouldUseLegacyRunner(datasource) {
5730
5945
  return !datasource.annotations || legacyRunner.includes(type);
5731
5946
  }
5732
5947
 
5733
- var __defProp$q = Object.defineProperty;
5734
- var __defProps$f = Object.defineProperties;
5735
- var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
5736
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
5737
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
5738
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
5739
- var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5740
- var __spreadValues$q = (a, b) => {
5948
+ var __defProp$p = Object.defineProperty;
5949
+ var __defProps$e = Object.defineProperties;
5950
+ var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
5951
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
5952
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
5953
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
5954
+ var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5955
+ var __spreadValues$p = (a, b) => {
5741
5956
  for (var prop in b || (b = {}))
5742
- if (__hasOwnProp$q.call(b, prop))
5743
- __defNormalProp$q(a, prop, b[prop]);
5744
- if (__getOwnPropSymbols$q)
5745
- for (var prop of __getOwnPropSymbols$q(b)) {
5746
- if (__propIsEnum$q.call(b, prop))
5747
- __defNormalProp$q(a, prop, b[prop]);
5957
+ if (__hasOwnProp$p.call(b, prop))
5958
+ __defNormalProp$p(a, prop, b[prop]);
5959
+ if (__getOwnPropSymbols$p)
5960
+ for (var prop of __getOwnPropSymbols$p(b)) {
5961
+ if (__propIsEnum$p.call(b, prop))
5962
+ __defNormalProp$p(a, prop, b[prop]);
5748
5963
  }
5749
5964
  return a;
5750
5965
  };
5751
- var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
5966
+ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
5752
5967
  let counter = 100;
5753
5968
  function getNextRequestId() {
5754
5969
  return "AQ" + counter++;
@@ -5771,8 +5986,8 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
5771
5986
  }))
5772
5987
  );
5773
5988
  }
5774
- const processor = __spreadValues$q(__spreadValues$q({}, standardAnnotationSupport), datasource.annotations);
5775
- const annotationWithDefaults = __spreadValues$q(__spreadValues$q({}, (_a = processor.getDefaultQuery) == null ? void 0 : _a.call(processor)), query);
5989
+ const processor = __spreadValues$p(__spreadValues$p({}, standardAnnotationSupport), datasource.annotations);
5990
+ const annotationWithDefaults = __spreadValues$p(__spreadValues$p({}, (_a = processor.getDefaultQuery) == null ? void 0 : _a.call(processor)), query);
5776
5991
  const annotation = processor.prepareAnnotation(annotationWithDefaults);
5777
5992
  if (!annotation) {
5778
5993
  return rxjs.of({
@@ -5795,7 +6010,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
5795
6010
  __annotation: { text: annotation.name, value: annotation },
5796
6011
  __sceneObject: { text: "__sceneObject", value: layer }
5797
6012
  };
5798
- const queryRequest = __spreadValues$q(__spreadProps$f(__spreadValues$q({
6013
+ const queryRequest = __spreadValues$p(__spreadProps$e(__spreadValues$p({
5799
6014
  startTime: Date.now(),
5800
6015
  requestId: getNextRequestId(),
5801
6016
  range: timeRange.state.value,
@@ -5805,7 +6020,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
5805
6020
  app: data.CoreApp.Dashboard,
5806
6021
  timezone: timeRange.getTimeZone(),
5807
6022
  targets: [
5808
- __spreadProps$f(__spreadValues$q({}, processedQuery), {
6023
+ __spreadProps$e(__spreadValues$p({}, processedQuery), {
5809
6024
  refId: "Anno"
5810
6025
  })
5811
6026
  ]
@@ -5823,7 +6038,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
5823
6038
  data$1.forEach((frame) => {
5824
6039
  var _a2;
5825
6040
  if (!((_a2 = frame.meta) == null ? void 0 : _a2.dataTopic)) {
5826
- frame.meta = __spreadProps$f(__spreadValues$q({}, frame.meta || {}), { dataTopic: data.DataTopic.Annotations });
6041
+ frame.meta = __spreadProps$e(__spreadValues$p({}, frame.meta || {}), { dataTopic: data.DataTopic.Annotations });
5827
6042
  }
5828
6043
  });
5829
6044
  return processor.processEvents(annotation, data$1).pipe(
@@ -5838,19 +6053,19 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
5838
6053
  );
5839
6054
  }
5840
6055
 
5841
- var __defProp$p = Object.defineProperty;
5842
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
5843
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
5844
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
5845
- var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5846
- var __spreadValues$p = (a, b) => {
6056
+ var __defProp$o = Object.defineProperty;
6057
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
6058
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
6059
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
6060
+ var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6061
+ var __spreadValues$o = (a, b) => {
5847
6062
  for (var prop in b || (b = {}))
5848
- if (__hasOwnProp$p.call(b, prop))
5849
- __defNormalProp$p(a, prop, b[prop]);
5850
- if (__getOwnPropSymbols$p)
5851
- for (var prop of __getOwnPropSymbols$p(b)) {
5852
- if (__propIsEnum$p.call(b, prop))
5853
- __defNormalProp$p(a, prop, b[prop]);
6063
+ if (__hasOwnProp$o.call(b, prop))
6064
+ __defNormalProp$o(a, prop, b[prop]);
6065
+ if (__getOwnPropSymbols$o)
6066
+ for (var prop of __getOwnPropSymbols$o(b)) {
6067
+ if (__propIsEnum$o.call(b, prop))
6068
+ __defNormalProp$o(a, prop, b[prop]);
5854
6069
  }
5855
6070
  return a;
5856
6071
  };
@@ -5861,7 +6076,7 @@ function postProcessQueryResult(annotation, results) {
5861
6076
  }
5862
6077
  const processed = results.map((item) => {
5863
6078
  var _a;
5864
- const processedItem = __spreadValues$p({}, item);
6079
+ const processedItem = __spreadValues$o({}, item);
5865
6080
  processedItem.source = annotation;
5866
6081
  processedItem.color = runtime.config.theme2.visualization.getColorByName(annotation.iconColor);
5867
6082
  processedItem.type = annotation.name;
@@ -5910,29 +6125,29 @@ function isPanelAlert(event) {
5910
6125
  return event.eventType === "panel-alert";
5911
6126
  }
5912
6127
 
5913
- var __defProp$o = Object.defineProperty;
5914
- var __defProps$e = Object.defineProperties;
5915
- var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
5916
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
5917
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
5918
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
5919
- var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5920
- var __spreadValues$o = (a, b) => {
6128
+ var __defProp$n = Object.defineProperty;
6129
+ var __defProps$d = Object.defineProperties;
6130
+ var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
6131
+ var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
6132
+ var __hasOwnProp$n = Object.prototype.hasOwnProperty;
6133
+ var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
6134
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6135
+ var __spreadValues$n = (a, b) => {
5921
6136
  for (var prop in b || (b = {}))
5922
- if (__hasOwnProp$o.call(b, prop))
5923
- __defNormalProp$o(a, prop, b[prop]);
5924
- if (__getOwnPropSymbols$o)
5925
- for (var prop of __getOwnPropSymbols$o(b)) {
5926
- if (__propIsEnum$o.call(b, prop))
5927
- __defNormalProp$o(a, prop, b[prop]);
6137
+ if (__hasOwnProp$n.call(b, prop))
6138
+ __defNormalProp$n(a, prop, b[prop]);
6139
+ if (__getOwnPropSymbols$n)
6140
+ for (var prop of __getOwnPropSymbols$n(b)) {
6141
+ if (__propIsEnum$n.call(b, prop))
6142
+ __defNormalProp$n(a, prop, b[prop]);
5928
6143
  }
5929
6144
  return a;
5930
6145
  };
5931
- var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
6146
+ var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
5932
6147
  class AnnotationsDataLayer extends SceneDataLayerBase {
5933
6148
  constructor(initialState) {
5934
6149
  super(
5935
- __spreadValues$o({
6150
+ __spreadValues$n({
5936
6151
  isEnabled: true
5937
6152
  }, initialState),
5938
6153
  ["query"]
@@ -5980,7 +6195,7 @@ class AnnotationsDataLayer extends SceneDataLayerBase {
5980
6195
  this.publishResults(stateUpdate);
5981
6196
  });
5982
6197
  } catch (e) {
5983
- this.publishResults(__spreadProps$e(__spreadValues$o({}, emptyPanelData), {
6198
+ this.publishResults(__spreadProps$d(__spreadValues$n({}, emptyPanelData), {
5984
6199
  state: schema.LoadingState.Error,
5985
6200
  errors: [
5986
6201
  {
@@ -5997,9 +6212,9 @@ class AnnotationsDataLayer extends SceneDataLayerBase {
5997
6212
  processEvents(query, events) {
5998
6213
  let processedEvents = postProcessQueryResult(query, events.events || []);
5999
6214
  processedEvents = dedupAnnotations(processedEvents);
6000
- const stateUpdate = __spreadProps$e(__spreadValues$o({}, emptyPanelData), { state: events.state });
6215
+ const stateUpdate = __spreadProps$d(__spreadValues$n({}, emptyPanelData), { state: events.state });
6001
6216
  const df = data.arrayToDataFrame(processedEvents);
6002
- df.meta = __spreadProps$e(__spreadValues$o({}, df.meta), {
6217
+ df.meta = __spreadProps$d(__spreadValues$n({}, df.meta), {
6003
6218
  dataTopic: data.DataTopic.Annotations
6004
6219
  });
6005
6220
  stateUpdate.series = [df];
@@ -6052,28 +6267,28 @@ class SceneTimeRangeTransformerBase extends SceneObjectBase {
6052
6267
  }
6053
6268
  }
6054
6269
 
6055
- var __defProp$n = Object.defineProperty;
6056
- var __defProps$d = Object.defineProperties;
6057
- var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
6058
- var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
6059
- var __hasOwnProp$n = Object.prototype.hasOwnProperty;
6060
- var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
6061
- var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6062
- var __spreadValues$n = (a, b) => {
6270
+ var __defProp$m = Object.defineProperty;
6271
+ var __defProps$c = Object.defineProperties;
6272
+ var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
6273
+ var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
6274
+ var __hasOwnProp$m = Object.prototype.hasOwnProperty;
6275
+ var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
6276
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6277
+ var __spreadValues$m = (a, b) => {
6063
6278
  for (var prop in b || (b = {}))
6064
- if (__hasOwnProp$n.call(b, prop))
6065
- __defNormalProp$n(a, prop, b[prop]);
6066
- if (__getOwnPropSymbols$n)
6067
- for (var prop of __getOwnPropSymbols$n(b)) {
6068
- if (__propIsEnum$n.call(b, prop))
6069
- __defNormalProp$n(a, prop, b[prop]);
6279
+ if (__hasOwnProp$m.call(b, prop))
6280
+ __defNormalProp$m(a, prop, b[prop]);
6281
+ if (__getOwnPropSymbols$m)
6282
+ for (var prop of __getOwnPropSymbols$m(b)) {
6283
+ if (__propIsEnum$m.call(b, prop))
6284
+ __defNormalProp$m(a, prop, b[prop]);
6070
6285
  }
6071
6286
  return a;
6072
6287
  };
6073
- var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
6288
+ var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
6074
6289
  class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
6075
6290
  constructor(state) {
6076
- super(__spreadProps$d(__spreadValues$n({}, state), {
6291
+ super(__spreadProps$c(__spreadValues$m({}, state), {
6077
6292
  timeZone: state.timeZone,
6078
6293
  from: "now-6h",
6079
6294
  to: "now",
@@ -6081,7 +6296,7 @@ class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
6081
6296
  }));
6082
6297
  }
6083
6298
  ancestorTimeRangeChanged(timeRange) {
6084
- this.setState(__spreadProps$d(__spreadValues$n({}, timeRange), {
6299
+ this.setState(__spreadProps$c(__spreadValues$m({}, timeRange), {
6085
6300
  timeZone: this.state.timeZone,
6086
6301
  value: evaluateTimeRange(
6087
6302
  timeRange.from,
@@ -6109,25 +6324,25 @@ class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
6109
6324
  }
6110
6325
  }
6111
6326
 
6112
- var __defProp$m = Object.defineProperty;
6113
- var __defProps$c = Object.defineProperties;
6114
- var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
6115
- var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
6116
- var __hasOwnProp$m = Object.prototype.hasOwnProperty;
6117
- var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
6118
- var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6119
- var __spreadValues$m = (a, b) => {
6327
+ var __defProp$l = Object.defineProperty;
6328
+ var __defProps$b = Object.defineProperties;
6329
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
6330
+ var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
6331
+ var __hasOwnProp$l = Object.prototype.hasOwnProperty;
6332
+ var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
6333
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6334
+ var __spreadValues$l = (a, b) => {
6120
6335
  for (var prop in b || (b = {}))
6121
- if (__hasOwnProp$m.call(b, prop))
6122
- __defNormalProp$m(a, prop, b[prop]);
6123
- if (__getOwnPropSymbols$m)
6124
- for (var prop of __getOwnPropSymbols$m(b)) {
6125
- if (__propIsEnum$m.call(b, prop))
6126
- __defNormalProp$m(a, prop, b[prop]);
6336
+ if (__hasOwnProp$l.call(b, prop))
6337
+ __defNormalProp$l(a, prop, b[prop]);
6338
+ if (__getOwnPropSymbols$l)
6339
+ for (var prop of __getOwnPropSymbols$l(b)) {
6340
+ if (__propIsEnum$l.call(b, prop))
6341
+ __defNormalProp$l(a, prop, b[prop]);
6127
6342
  }
6128
6343
  return a;
6129
6344
  };
6130
- var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
6345
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
6131
6346
  class SceneDataLayerSetBase extends SceneObjectBase {
6132
6347
  constructor() {
6133
6348
  super(...arguments);
@@ -6151,7 +6366,7 @@ class SceneDataLayerSetBase extends SceneObjectBase {
6151
6366
  series = series.concat(result.data.series);
6152
6367
  }
6153
6368
  }
6154
- const combinedData = __spreadProps$c(__spreadValues$m({}, emptyPanelData), { series });
6369
+ const combinedData = __spreadProps$b(__spreadValues$l({}, emptyPanelData), { series });
6155
6370
  this._results.next({ origin: this, data: combinedData });
6156
6371
  this.setStateHelper({ data: combinedData });
6157
6372
  }
@@ -6200,25 +6415,25 @@ SceneDataLayerSet.Component = ({ model }) => {
6200
6415
  })));
6201
6416
  };
6202
6417
 
6203
- var __defProp$l = Object.defineProperty;
6204
- var __defProps$b = Object.defineProperties;
6205
- var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
6206
- var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
6207
- var __hasOwnProp$l = Object.prototype.hasOwnProperty;
6208
- var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
6209
- var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6210
- var __spreadValues$l = (a, b) => {
6418
+ var __defProp$k = Object.defineProperty;
6419
+ var __defProps$a = Object.defineProperties;
6420
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
6421
+ var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
6422
+ var __hasOwnProp$k = Object.prototype.hasOwnProperty;
6423
+ var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
6424
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6425
+ var __spreadValues$k = (a, b) => {
6211
6426
  for (var prop in b || (b = {}))
6212
- if (__hasOwnProp$l.call(b, prop))
6213
- __defNormalProp$l(a, prop, b[prop]);
6214
- if (__getOwnPropSymbols$l)
6215
- for (var prop of __getOwnPropSymbols$l(b)) {
6216
- if (__propIsEnum$l.call(b, prop))
6217
- __defNormalProp$l(a, prop, b[prop]);
6427
+ if (__hasOwnProp$k.call(b, prop))
6428
+ __defNormalProp$k(a, prop, b[prop]);
6429
+ if (__getOwnPropSymbols$k)
6430
+ for (var prop of __getOwnPropSymbols$k(b)) {
6431
+ if (__propIsEnum$k.call(b, prop))
6432
+ __defNormalProp$k(a, prop, b[prop]);
6218
6433
  }
6219
6434
  return a;
6220
6435
  };
6221
- var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
6436
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
6222
6437
  class SceneDataTransformer extends SceneObjectBase {
6223
6438
  constructor(state) {
6224
6439
  super(state);
@@ -6295,7 +6510,7 @@ class SceneDataTransformer extends SceneObjectBase {
6295
6510
  const { series, annotations } = this._prevDataFromSource;
6296
6511
  if (data.series === series && data.annotations === annotations) {
6297
6512
  if (this.state.data && data.state !== this.state.data.state) {
6298
- this.setState({ data: __spreadProps$b(__spreadValues$l({}, this.state.data), { state: data.state }) });
6513
+ this.setState({ data: __spreadProps$a(__spreadValues$k({}, this.state.data), { state: data.state }) });
6299
6514
  }
6300
6515
  return true;
6301
6516
  }
@@ -6343,7 +6558,7 @@ class SceneDataTransformer extends SceneObjectBase {
6343
6558
  rxjs.map((values) => {
6344
6559
  const transformedSeries = values[0];
6345
6560
  const transformedAnnotations = values[1];
6346
- return __spreadProps$b(__spreadValues$l({}, data$1), {
6561
+ return __spreadProps$a(__spreadValues$k({}, data$1), {
6347
6562
  series: transformedSeries,
6348
6563
  annotations: transformedAnnotations != null ? transformedAnnotations : data$1.annotations
6349
6564
  });
@@ -6354,7 +6569,7 @@ class SceneDataTransformer extends SceneObjectBase {
6354
6569
  const sourceErr = ((_a2 = this.getSourceData().state.data) == null ? void 0 : _a2.errors) || [];
6355
6570
  const transformationError = runtime.toDataQueryError(err);
6356
6571
  transformationError.message = `Error transforming data: ${transformationError.message}`;
6357
- const result = __spreadProps$b(__spreadValues$l({}, data$1), {
6572
+ const result = __spreadProps$a(__spreadValues$k({}, data$1), {
6358
6573
  state: data.LoadingState.Error,
6359
6574
  errors: [...sourceErr, transformationError]
6360
6575
  });
@@ -6687,28 +6902,28 @@ class SceneVariableSetVariableDependencyHandler {
6687
6902
  }
6688
6903
  }
6689
6904
 
6690
- var __defProp$k = Object.defineProperty;
6691
- var __defProps$a = Object.defineProperties;
6692
- var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
6693
- var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
6694
- var __hasOwnProp$k = Object.prototype.hasOwnProperty;
6695
- var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
6696
- var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6697
- var __spreadValues$k = (a, b) => {
6698
- for (var prop in b || (b = {}))
6699
- if (__hasOwnProp$k.call(b, prop))
6700
- __defNormalProp$k(a, prop, b[prop]);
6701
- if (__getOwnPropSymbols$k)
6702
- for (var prop of __getOwnPropSymbols$k(b)) {
6703
- if (__propIsEnum$k.call(b, prop))
6704
- __defNormalProp$k(a, prop, b[prop]);
6905
+ var __defProp$j = Object.defineProperty;
6906
+ var __defProps$9 = Object.defineProperties;
6907
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
6908
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
6909
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
6910
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
6911
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6912
+ var __spreadValues$j = (a, b) => {
6913
+ for (var prop in b || (b = {}))
6914
+ if (__hasOwnProp$j.call(b, prop))
6915
+ __defNormalProp$j(a, prop, b[prop]);
6916
+ if (__getOwnPropSymbols$j)
6917
+ for (var prop of __getOwnPropSymbols$j(b)) {
6918
+ if (__propIsEnum$j.call(b, prop))
6919
+ __defNormalProp$j(a, prop, b[prop]);
6705
6920
  }
6706
6921
  return a;
6707
6922
  };
6708
- var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
6923
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
6709
6924
  class ConstantVariable extends SceneObjectBase {
6710
6925
  constructor(initialState) {
6711
- super(__spreadProps$a(__spreadValues$k({
6926
+ super(__spreadProps$9(__spreadValues$j({
6712
6927
  type: "constant",
6713
6928
  value: "",
6714
6929
  name: ""
@@ -6721,25 +6936,25 @@ class ConstantVariable extends SceneObjectBase {
6721
6936
  }
6722
6937
  }
6723
6938
 
6724
- var __defProp$j = Object.defineProperty;
6725
- var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
6726
- var __hasOwnProp$j = Object.prototype.hasOwnProperty;
6727
- var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
6728
- var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6729
- var __spreadValues$j = (a, b) => {
6939
+ var __defProp$i = Object.defineProperty;
6940
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
6941
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
6942
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
6943
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6944
+ var __spreadValues$i = (a, b) => {
6730
6945
  for (var prop in b || (b = {}))
6731
- if (__hasOwnProp$j.call(b, prop))
6732
- __defNormalProp$j(a, prop, b[prop]);
6733
- if (__getOwnPropSymbols$j)
6734
- for (var prop of __getOwnPropSymbols$j(b)) {
6735
- if (__propIsEnum$j.call(b, prop))
6736
- __defNormalProp$j(a, prop, b[prop]);
6946
+ if (__hasOwnProp$i.call(b, prop))
6947
+ __defNormalProp$i(a, prop, b[prop]);
6948
+ if (__getOwnPropSymbols$i)
6949
+ for (var prop of __getOwnPropSymbols$i(b)) {
6950
+ if (__propIsEnum$i.call(b, prop))
6951
+ __defNormalProp$i(a, prop, b[prop]);
6737
6952
  }
6738
6953
  return a;
6739
6954
  };
6740
6955
  class CustomVariable extends MultiValueVariable {
6741
6956
  constructor(initialState) {
6742
- super(__spreadValues$j({
6957
+ super(__spreadValues$i({
6743
6958
  type: "custom",
6744
6959
  query: "",
6745
6960
  value: "",
@@ -6773,25 +6988,25 @@ CustomVariable.Component = ({ model }) => {
6773
6988
  return renderSelectForVariable(model);
6774
6989
  };
6775
6990
 
6776
- var __defProp$i = Object.defineProperty;
6777
- var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
6778
- var __hasOwnProp$i = Object.prototype.hasOwnProperty;
6779
- var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
6780
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6781
- var __spreadValues$i = (a, b) => {
6991
+ var __defProp$h = Object.defineProperty;
6992
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
6993
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
6994
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
6995
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6996
+ var __spreadValues$h = (a, b) => {
6782
6997
  for (var prop in b || (b = {}))
6783
- if (__hasOwnProp$i.call(b, prop))
6784
- __defNormalProp$i(a, prop, b[prop]);
6785
- if (__getOwnPropSymbols$i)
6786
- for (var prop of __getOwnPropSymbols$i(b)) {
6787
- if (__propIsEnum$i.call(b, prop))
6788
- __defNormalProp$i(a, prop, b[prop]);
6998
+ if (__hasOwnProp$h.call(b, prop))
6999
+ __defNormalProp$h(a, prop, b[prop]);
7000
+ if (__getOwnPropSymbols$h)
7001
+ for (var prop of __getOwnPropSymbols$h(b)) {
7002
+ if (__propIsEnum$h.call(b, prop))
7003
+ __defNormalProp$h(a, prop, b[prop]);
6789
7004
  }
6790
7005
  return a;
6791
7006
  };
6792
7007
  class DataSourceVariable extends MultiValueVariable {
6793
7008
  constructor(initialState) {
6794
- super(__spreadValues$i({
7009
+ super(__spreadValues$h({
6795
7010
  type: "datasource",
6796
7011
  value: "",
6797
7012
  text: "",
@@ -6875,25 +7090,25 @@ const hasCustomVariableSupport = (datasource) => {
6875
7090
  return "query" in variableSupport && "editor" in variableSupport && Boolean(variableSupport.query) && Boolean(variableSupport.editor);
6876
7091
  };
6877
7092
 
6878
- var __defProp$h = Object.defineProperty;
6879
- var __defProps$9 = Object.defineProperties;
6880
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
6881
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
6882
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
6883
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
6884
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6885
- var __spreadValues$h = (a, b) => {
7093
+ var __defProp$g = Object.defineProperty;
7094
+ var __defProps$8 = Object.defineProperties;
7095
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
7096
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
7097
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
7098
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
7099
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7100
+ var __spreadValues$g = (a, b) => {
6886
7101
  for (var prop in b || (b = {}))
6887
- if (__hasOwnProp$h.call(b, prop))
6888
- __defNormalProp$h(a, prop, b[prop]);
6889
- if (__getOwnPropSymbols$h)
6890
- for (var prop of __getOwnPropSymbols$h(b)) {
6891
- if (__propIsEnum$h.call(b, prop))
6892
- __defNormalProp$h(a, prop, b[prop]);
7102
+ if (__hasOwnProp$g.call(b, prop))
7103
+ __defNormalProp$g(a, prop, b[prop]);
7104
+ if (__getOwnPropSymbols$g)
7105
+ for (var prop of __getOwnPropSymbols$g(b)) {
7106
+ if (__propIsEnum$g.call(b, prop))
7107
+ __defNormalProp$g(a, prop, b[prop]);
6893
7108
  }
6894
7109
  return a;
6895
7110
  };
6896
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
7111
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
6897
7112
  class StandardQueryRunner {
6898
7113
  constructor(datasource, _runRequest = runtime.getRunRequest()) {
6899
7114
  this.datasource = datasource;
@@ -6930,7 +7145,7 @@ class LegacyQueryRunner {
6930
7145
  return getEmptyMetricFindValueObservable();
6931
7146
  }
6932
7147
  return rxjs.from(
6933
- this.datasource.metricFindQuery(variable.state.query, __spreadProps$9(__spreadValues$h({}, request), {
7148
+ this.datasource.metricFindQuery(variable.state.query, __spreadProps$8(__spreadValues$g({}, request), {
6934
7149
  variable: {
6935
7150
  name: variable.state.name,
6936
7151
  type: variable.state.type
@@ -6992,7 +7207,7 @@ function ensureVariableQueryModelIsADataQuery(variable) {
6992
7207
  return { query, refId: `variable-${variable.state.name}` };
6993
7208
  }
6994
7209
  if (query.refId == null) {
6995
- return __spreadProps$9(__spreadValues$h({}, query), { refId: `variable-${variable.state.name}` });
7210
+ return __spreadProps$8(__spreadValues$g({}, query), { refId: `variable-${variable.state.name}` });
6996
7211
  }
6997
7212
  return variable.state.query;
6998
7213
  }
@@ -7207,25 +7422,25 @@ function areMetricFindValues(data$1) {
7207
7422
  return false;
7208
7423
  }
7209
7424
 
7210
- var __defProp$g = Object.defineProperty;
7211
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
7212
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
7213
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
7214
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7215
- var __spreadValues$g = (a, b) => {
7425
+ var __defProp$f = Object.defineProperty;
7426
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
7427
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
7428
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
7429
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7430
+ var __spreadValues$f = (a, b) => {
7216
7431
  for (var prop in b || (b = {}))
7217
- if (__hasOwnProp$g.call(b, prop))
7218
- __defNormalProp$g(a, prop, b[prop]);
7219
- if (__getOwnPropSymbols$g)
7220
- for (var prop of __getOwnPropSymbols$g(b)) {
7221
- if (__propIsEnum$g.call(b, prop))
7222
- __defNormalProp$g(a, prop, b[prop]);
7432
+ if (__hasOwnProp$f.call(b, prop))
7433
+ __defNormalProp$f(a, prop, b[prop]);
7434
+ if (__getOwnPropSymbols$f)
7435
+ for (var prop of __getOwnPropSymbols$f(b)) {
7436
+ if (__propIsEnum$f.call(b, prop))
7437
+ __defNormalProp$f(a, prop, b[prop]);
7223
7438
  }
7224
7439
  return a;
7225
7440
  };
7226
7441
  class QueryVariable extends MultiValueVariable {
7227
7442
  constructor(initialState) {
7228
- super(__spreadValues$g({
7443
+ super(__spreadValues$f({
7229
7444
  type: "query",
7230
7445
  name: "",
7231
7446
  value: "",
@@ -7378,25 +7593,25 @@ function queryMetricTree(query) {
7378
7593
  return queryTree(children, query.split("."), 0);
7379
7594
  }
7380
7595
 
7381
- var __defProp$f = Object.defineProperty;
7382
- var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
7383
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
7384
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
7385
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7386
- var __spreadValues$f = (a, b) => {
7596
+ var __defProp$e = Object.defineProperty;
7597
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
7598
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
7599
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
7600
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7601
+ var __spreadValues$e = (a, b) => {
7387
7602
  for (var prop in b || (b = {}))
7388
- if (__hasOwnProp$f.call(b, prop))
7389
- __defNormalProp$f(a, prop, b[prop]);
7390
- if (__getOwnPropSymbols$f)
7391
- for (var prop of __getOwnPropSymbols$f(b)) {
7392
- if (__propIsEnum$f.call(b, prop))
7393
- __defNormalProp$f(a, prop, b[prop]);
7603
+ if (__hasOwnProp$e.call(b, prop))
7604
+ __defNormalProp$e(a, prop, b[prop]);
7605
+ if (__getOwnPropSymbols$e)
7606
+ for (var prop of __getOwnPropSymbols$e(b)) {
7607
+ if (__propIsEnum$e.call(b, prop))
7608
+ __defNormalProp$e(a, prop, b[prop]);
7394
7609
  }
7395
7610
  return a;
7396
7611
  };
7397
7612
  class TestVariable extends MultiValueVariable {
7398
7613
  constructor(initialState, isLazy = false) {
7399
- super(__spreadValues$f({
7614
+ super(__spreadValues$e({
7400
7615
  type: "custom",
7401
7616
  name: "Test",
7402
7617
  value: "Value",
@@ -7505,25 +7720,25 @@ function VariableValueInput({ model }) {
7505
7720
  });
7506
7721
  }
7507
7722
 
7508
- var __defProp$e = Object.defineProperty;
7509
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
7510
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
7511
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
7512
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7513
- var __spreadValues$e = (a, b) => {
7723
+ var __defProp$d = Object.defineProperty;
7724
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
7725
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
7726
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
7727
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7728
+ var __spreadValues$d = (a, b) => {
7514
7729
  for (var prop in b || (b = {}))
7515
- if (__hasOwnProp$e.call(b, prop))
7516
- __defNormalProp$e(a, prop, b[prop]);
7517
- if (__getOwnPropSymbols$e)
7518
- for (var prop of __getOwnPropSymbols$e(b)) {
7519
- if (__propIsEnum$e.call(b, prop))
7520
- __defNormalProp$e(a, prop, b[prop]);
7730
+ if (__hasOwnProp$d.call(b, prop))
7731
+ __defNormalProp$d(a, prop, b[prop]);
7732
+ if (__getOwnPropSymbols$d)
7733
+ for (var prop of __getOwnPropSymbols$d(b)) {
7734
+ if (__propIsEnum$d.call(b, prop))
7735
+ __defNormalProp$d(a, prop, b[prop]);
7521
7736
  }
7522
7737
  return a;
7523
7738
  };
7524
7739
  class TextBoxVariable extends SceneObjectBase {
7525
7740
  constructor(initialState) {
7526
- super(__spreadValues$e({
7741
+ super(__spreadValues$d({
7527
7742
  type: "textbox",
7528
7743
  value: "",
7529
7744
  name: ""
@@ -7560,28 +7775,28 @@ TextBoxVariable.Component = ({ model }) => {
7560
7775
  });
7561
7776
  };
7562
7777
 
7563
- var __defProp$d = Object.defineProperty;
7564
- var __defProps$8 = Object.defineProperties;
7565
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
7566
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
7567
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
7568
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
7569
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7570
- var __spreadValues$d = (a, b) => {
7778
+ var __defProp$c = Object.defineProperty;
7779
+ var __defProps$7 = Object.defineProperties;
7780
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
7781
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
7782
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
7783
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
7784
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7785
+ var __spreadValues$c = (a, b) => {
7571
7786
  for (var prop in b || (b = {}))
7572
- if (__hasOwnProp$d.call(b, prop))
7573
- __defNormalProp$d(a, prop, b[prop]);
7574
- if (__getOwnPropSymbols$d)
7575
- for (var prop of __getOwnPropSymbols$d(b)) {
7576
- if (__propIsEnum$d.call(b, prop))
7577
- __defNormalProp$d(a, prop, b[prop]);
7787
+ if (__hasOwnProp$c.call(b, prop))
7788
+ __defNormalProp$c(a, prop, b[prop]);
7789
+ if (__getOwnPropSymbols$c)
7790
+ for (var prop of __getOwnPropSymbols$c(b)) {
7791
+ if (__propIsEnum$c.call(b, prop))
7792
+ __defNormalProp$c(a, prop, b[prop]);
7578
7793
  }
7579
7794
  return a;
7580
7795
  };
7581
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
7796
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
7582
7797
  class LocalValueVariable extends SceneObjectBase {
7583
7798
  constructor(initialState) {
7584
- super(__spreadProps$8(__spreadValues$d({
7799
+ super(__spreadProps$7(__spreadValues$c({
7585
7800
  type: "system",
7586
7801
  value: "",
7587
7802
  text: "",
@@ -7613,25 +7828,25 @@ class LocalValueVariable extends SceneObjectBase {
7613
7828
  }
7614
7829
  }
7615
7830
 
7616
- var __defProp$c = Object.defineProperty;
7617
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
7618
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
7619
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
7620
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7621
- var __spreadValues$c = (a, b) => {
7831
+ var __defProp$b = Object.defineProperty;
7832
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
7833
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
7834
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
7835
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7836
+ var __spreadValues$b = (a, b) => {
7622
7837
  for (var prop in b || (b = {}))
7623
- if (__hasOwnProp$c.call(b, prop))
7624
- __defNormalProp$c(a, prop, b[prop]);
7625
- if (__getOwnPropSymbols$c)
7626
- for (var prop of __getOwnPropSymbols$c(b)) {
7627
- if (__propIsEnum$c.call(b, prop))
7628
- __defNormalProp$c(a, prop, b[prop]);
7838
+ if (__hasOwnProp$b.call(b, prop))
7839
+ __defNormalProp$b(a, prop, b[prop]);
7840
+ if (__getOwnPropSymbols$b)
7841
+ for (var prop of __getOwnPropSymbols$b(b)) {
7842
+ if (__propIsEnum$b.call(b, prop))
7843
+ __defNormalProp$b(a, prop, b[prop]);
7629
7844
  }
7630
7845
  return a;
7631
7846
  };
7632
7847
  class IntervalVariable extends SceneObjectBase {
7633
7848
  constructor(initialState) {
7634
- super(__spreadValues$c({
7849
+ super(__spreadValues$b({
7635
7850
  type: "interval",
7636
7851
  value: "",
7637
7852
  intervals: ["1m", "10m", "30m", "1h", "6h", "12h", "1d", "7d", "14d", "30d"],
@@ -7839,7 +8054,7 @@ class EmbeddedScene extends SceneObjectBase {
7839
8054
  EmbeddedScene.Component = EmbeddedSceneRenderer;
7840
8055
  function EmbeddedSceneRenderer({ model }) {
7841
8056
  const { body, controls } = model.useState();
7842
- const styles = ui.useStyles2(getStyles$6);
8057
+ const styles = ui.useStyles2(getStyles$5);
7843
8058
  return /* @__PURE__ */ React__default["default"].createElement("div", {
7844
8059
  className: styles.container
7845
8060
  }, controls && /* @__PURE__ */ React__default["default"].createElement("div", {
@@ -7853,7 +8068,7 @@ function EmbeddedSceneRenderer({ model }) {
7853
8068
  model: body
7854
8069
  })));
7855
8070
  }
7856
- const getStyles$6 = (theme) => {
8071
+ const getStyles$5 = (theme) => {
7857
8072
  return {
7858
8073
  container: css.css({
7859
8074
  flexGrow: 1,
@@ -7956,31 +8171,31 @@ function isSceneGridLayout(child) {
7956
8171
  return child instanceof SceneGridLayout;
7957
8172
  }
7958
8173
 
7959
- var __defProp$b = Object.defineProperty;
7960
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
7961
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
7962
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
7963
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7964
- var __spreadValues$b = (a, b) => {
8174
+ var __defProp$a = Object.defineProperty;
8175
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
8176
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
8177
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
8178
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8179
+ var __spreadValues$a = (a, b) => {
7965
8180
  for (var prop in b || (b = {}))
7966
- if (__hasOwnProp$b.call(b, prop))
7967
- __defNormalProp$b(a, prop, b[prop]);
7968
- if (__getOwnPropSymbols$b)
7969
- for (var prop of __getOwnPropSymbols$b(b)) {
7970
- if (__propIsEnum$b.call(b, prop))
7971
- __defNormalProp$b(a, prop, b[prop]);
8181
+ if (__hasOwnProp$a.call(b, prop))
8182
+ __defNormalProp$a(a, prop, b[prop]);
8183
+ if (__getOwnPropSymbols$a)
8184
+ for (var prop of __getOwnPropSymbols$a(b)) {
8185
+ if (__propIsEnum$a.call(b, prop))
8186
+ __defNormalProp$a(a, prop, b[prop]);
7972
8187
  }
7973
8188
  return a;
7974
8189
  };
7975
8190
  var __objRest$1 = (source, exclude) => {
7976
8191
  var target = {};
7977
8192
  for (var prop in source)
7978
- if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
8193
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
7979
8194
  target[prop] = source[prop];
7980
- if (source != null && __getOwnPropSymbols$b)
7981
- for (var prop of __getOwnPropSymbols$b(source)) {
7982
- if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
7983
- target[prop] = source[prop];
8195
+ if (source != null && __getOwnPropSymbols$a)
8196
+ for (var prop of __getOwnPropSymbols$a(source)) {
8197
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
8198
+ target[prop] = source[prop];
7984
8199
  }
7985
8200
  return target;
7986
8201
  };
@@ -8019,7 +8234,7 @@ const LazyLoader = React__default["default"].forwardRef(
8019
8234
  }
8020
8235
  };
8021
8236
  });
8022
- return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$b({
8237
+ return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$a({
8023
8238
  id,
8024
8239
  ref: innerRef
8025
8240
  }, rest), loaded && (typeof children === "function" ? children({ isInView }) : children));
@@ -8037,33 +8252,33 @@ LazyLoader.observer = new IntersectionObserver(
8037
8252
  { rootMargin: "100px" }
8038
8253
  );
8039
8254
 
8040
- var __defProp$a = Object.defineProperty;
8041
- var __defProps$7 = Object.defineProperties;
8042
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
8043
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
8044
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
8045
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
8046
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8047
- var __spreadValues$a = (a, b) => {
8255
+ var __defProp$9 = Object.defineProperty;
8256
+ var __defProps$6 = Object.defineProperties;
8257
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
8258
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
8259
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
8260
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
8261
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8262
+ var __spreadValues$9 = (a, b) => {
8048
8263
  for (var prop in b || (b = {}))
8049
- if (__hasOwnProp$a.call(b, prop))
8050
- __defNormalProp$a(a, prop, b[prop]);
8051
- if (__getOwnPropSymbols$a)
8052
- for (var prop of __getOwnPropSymbols$a(b)) {
8053
- if (__propIsEnum$a.call(b, prop))
8054
- __defNormalProp$a(a, prop, b[prop]);
8264
+ if (__hasOwnProp$9.call(b, prop))
8265
+ __defNormalProp$9(a, prop, b[prop]);
8266
+ if (__getOwnPropSymbols$9)
8267
+ for (var prop of __getOwnPropSymbols$9(b)) {
8268
+ if (__propIsEnum$9.call(b, prop))
8269
+ __defNormalProp$9(a, prop, b[prop]);
8055
8270
  }
8056
8271
  return a;
8057
8272
  };
8058
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
8273
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
8059
8274
  var __objRest = (source, exclude) => {
8060
8275
  var target = {};
8061
8276
  for (var prop in source)
8062
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
8277
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
8063
8278
  target[prop] = source[prop];
8064
- if (source != null && __getOwnPropSymbols$a)
8065
- for (var prop of __getOwnPropSymbols$a(source)) {
8066
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
8279
+ if (source != null && __getOwnPropSymbols$9)
8280
+ for (var prop of __getOwnPropSymbols$9(source)) {
8281
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
8067
8282
  target[prop] = source[prop];
8068
8283
  }
8069
8284
  return target;
@@ -8122,7 +8337,7 @@ const GridItemWrapper = React__default["default"].forwardRef((props, ref) => {
8122
8337
  key: sceneChild.state.key
8123
8338
  });
8124
8339
  if (isLazy) {
8125
- return /* @__PURE__ */ React__default["default"].createElement(LazyLoader, __spreadProps$7(__spreadValues$a({}, divProps), {
8340
+ return /* @__PURE__ */ React__default["default"].createElement(LazyLoader, __spreadProps$6(__spreadValues$9({}, divProps), {
8126
8341
  key: sceneChild.state.key,
8127
8342
  "data-griditem-key": sceneChild.state.key,
8128
8343
  className: css.cx(className, props.className),
@@ -8130,7 +8345,7 @@ const GridItemWrapper = React__default["default"].forwardRef((props, ref) => {
8130
8345
  ref
8131
8346
  }), innerContent, children);
8132
8347
  }
8133
- return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$7(__spreadValues$a({}, divProps), {
8348
+ return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$6(__spreadValues$9({}, divProps), {
8134
8349
  ref,
8135
8350
  key: sceneChild.state.key,
8136
8351
  "data-griditem-key": sceneChild.state.key,
@@ -8160,7 +8375,7 @@ function updateAnimationClass(ref, isDraggable, retry) {
8160
8375
  const ResizeHandle = React__default["default"].forwardRef((_a, ref) => {
8161
8376
  var _b = _a, divProps = __objRest(_b, ["handleAxis"]);
8162
8377
  const customCssClass = ui.useStyles2(getResizeHandleStyles);
8163
- return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$7(__spreadValues$a({
8378
+ return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$6(__spreadValues$9({
8164
8379
  ref
8165
8380
  }, divProps), {
8166
8381
  className: `${customCssClass} scene-resize-handle`
@@ -8200,60 +8415,60 @@ function getResizeHandleStyles(theme) {
8200
8415
  });
8201
8416
  }
8202
8417
 
8203
- var __defProp$9 = Object.defineProperty;
8204
- var __defProps$6 = Object.defineProperties;
8205
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
8206
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
8207
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
8208
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
8209
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8210
- var __spreadValues$9 = (a, b) => {
8418
+ var __defProp$8 = Object.defineProperty;
8419
+ var __defProps$5 = Object.defineProperties;
8420
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
8421
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
8422
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
8423
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
8424
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8425
+ var __spreadValues$8 = (a, b) => {
8211
8426
  for (var prop in b || (b = {}))
8212
- if (__hasOwnProp$9.call(b, prop))
8213
- __defNormalProp$9(a, prop, b[prop]);
8214
- if (__getOwnPropSymbols$9)
8215
- for (var prop of __getOwnPropSymbols$9(b)) {
8216
- if (__propIsEnum$9.call(b, prop))
8217
- __defNormalProp$9(a, prop, b[prop]);
8427
+ if (__hasOwnProp$8.call(b, prop))
8428
+ __defNormalProp$8(a, prop, b[prop]);
8429
+ if (__getOwnPropSymbols$8)
8430
+ for (var prop of __getOwnPropSymbols$8(b)) {
8431
+ if (__propIsEnum$8.call(b, prop))
8432
+ __defNormalProp$8(a, prop, b[prop]);
8218
8433
  }
8219
8434
  return a;
8220
8435
  };
8221
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
8436
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
8222
8437
  function fitPanelsInHeight(cells, height) {
8223
8438
  const visibleHeight = height - GRID_CELL_VMARGIN * 4;
8224
8439
  const currentGridHeight = Math.max(...cells.map((cell) => cell.h + cell.y));
8225
8440
  const visibleGridHeight = Math.floor(visibleHeight / (GRID_CELL_HEIGHT + GRID_CELL_VMARGIN));
8226
8441
  const scaleFactor = currentGridHeight / visibleGridHeight;
8227
8442
  return cells.map((cell) => {
8228
- return __spreadProps$6(__spreadValues$9({}, cell), {
8443
+ return __spreadProps$5(__spreadValues$8({}, cell), {
8229
8444
  y: Math.round(cell.y / scaleFactor) || 0,
8230
8445
  h: Math.round(cell.h / scaleFactor) || 1
8231
8446
  });
8232
8447
  });
8233
8448
  }
8234
8449
 
8235
- var __defProp$8 = Object.defineProperty;
8236
- var __defProps$5 = Object.defineProperties;
8237
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
8238
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
8239
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
8240
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
8241
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8242
- var __spreadValues$8 = (a, b) => {
8450
+ var __defProp$7 = Object.defineProperty;
8451
+ var __defProps$4 = Object.defineProperties;
8452
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
8453
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
8454
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
8455
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
8456
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8457
+ var __spreadValues$7 = (a, b) => {
8243
8458
  for (var prop in b || (b = {}))
8244
- if (__hasOwnProp$8.call(b, prop))
8245
- __defNormalProp$8(a, prop, b[prop]);
8246
- if (__getOwnPropSymbols$8)
8247
- for (var prop of __getOwnPropSymbols$8(b)) {
8248
- if (__propIsEnum$8.call(b, prop))
8249
- __defNormalProp$8(a, prop, b[prop]);
8459
+ if (__hasOwnProp$7.call(b, prop))
8460
+ __defNormalProp$7(a, prop, b[prop]);
8461
+ if (__getOwnPropSymbols$7)
8462
+ for (var prop of __getOwnPropSymbols$7(b)) {
8463
+ if (__propIsEnum$7.call(b, prop))
8464
+ __defNormalProp$7(a, prop, b[prop]);
8250
8465
  }
8251
8466
  return a;
8252
8467
  };
8253
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
8468
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
8254
8469
  const _SceneGridLayout = class extends SceneObjectBase {
8255
8470
  constructor(state) {
8256
- super(__spreadProps$5(__spreadValues$8({}, state), {
8471
+ super(__spreadProps$4(__spreadValues$7({}, state), {
8257
8472
  children: sortChildrenByPosition(state.children)
8258
8473
  }));
8259
8474
  this._skipOnLayoutChange = false;
@@ -8277,7 +8492,7 @@ const _SceneGridLayout = class extends SceneObjectBase {
8277
8492
  height: item.h
8278
8493
  };
8279
8494
  if (!isItemSizeEqual(child.state, nextSize)) {
8280
- child.setState(__spreadValues$8({}, nextSize));
8495
+ child.setState(__spreadValues$7({}, nextSize));
8281
8496
  }
8282
8497
  }
8283
8498
  this.setState({ children: sortChildrenByPosition(this.state.children) });
@@ -8351,7 +8566,7 @@ const _SceneGridLayout = class extends SceneObjectBase {
8351
8566
  const yDiff = firstPanelYPos - (rowY + 1);
8352
8567
  let yMax = rowY;
8353
8568
  for (const panel of rowChildren) {
8354
- const newSize = __spreadValues$8({}, panel.state);
8569
+ const newSize = __spreadValues$7({}, panel.state);
8355
8570
  newSize.y = (_b = newSize.y) != null ? _b : rowY;
8356
8571
  newSize.y -= yDiff;
8357
8572
  if (newSize.y !== panel.state.y) {
@@ -8478,7 +8693,7 @@ const _SceneGridLayout = class extends SceneObjectBase {
8478
8693
  }
8479
8694
  if (width < 768) {
8480
8695
  this._skipOnLayoutChange = true;
8481
- return cells.map((cell) => __spreadProps$5(__spreadValues$8({}, cell), { w: 24 }));
8696
+ return cells.map((cell) => __spreadProps$4(__spreadValues$7({}, cell), { w: 24 }));
8482
8697
  }
8483
8698
  this._skipOnLayoutChange = false;
8484
8699
  return cells;
@@ -8503,28 +8718,28 @@ function sortGridLayout(layout) {
8503
8718
  return [...layout].sort((a, b) => a.y - b.y || a.x - b.x);
8504
8719
  }
8505
8720
 
8506
- var __defProp$7 = Object.defineProperty;
8507
- var __defProps$4 = Object.defineProperties;
8508
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
8509
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
8510
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
8511
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
8512
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8513
- var __spreadValues$7 = (a, b) => {
8721
+ var __defProp$6 = Object.defineProperty;
8722
+ var __defProps$3 = Object.defineProperties;
8723
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
8724
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
8725
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
8726
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
8727
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8728
+ var __spreadValues$6 = (a, b) => {
8514
8729
  for (var prop in b || (b = {}))
8515
- if (__hasOwnProp$7.call(b, prop))
8516
- __defNormalProp$7(a, prop, b[prop]);
8517
- if (__getOwnPropSymbols$7)
8518
- for (var prop of __getOwnPropSymbols$7(b)) {
8519
- if (__propIsEnum$7.call(b, prop))
8520
- __defNormalProp$7(a, prop, b[prop]);
8730
+ if (__hasOwnProp$6.call(b, prop))
8731
+ __defNormalProp$6(a, prop, b[prop]);
8732
+ if (__getOwnPropSymbols$6)
8733
+ for (var prop of __getOwnPropSymbols$6(b)) {
8734
+ if (__propIsEnum$6.call(b, prop))
8735
+ __defNormalProp$6(a, prop, b[prop]);
8521
8736
  }
8522
8737
  return a;
8523
8738
  };
8524
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
8739
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
8525
8740
  class SceneGridRow extends SceneObjectBase {
8526
8741
  constructor(state) {
8527
- super(__spreadProps$4(__spreadValues$7({
8742
+ super(__spreadProps$3(__spreadValues$6({
8528
8743
  children: state.children || [],
8529
8744
  isCollapsible: state.isCollapsible || true,
8530
8745
  title: state.title || ""
@@ -8689,7 +8904,7 @@ NestedScene.Component = NestedSceneRenderer;
8689
8904
  function NestedSceneRenderer({ model }) {
8690
8905
  const { title, isCollapsed, canCollapse, canRemove, body, controls } = model.useState();
8691
8906
  const gridRow = ui.useStyles2(getSceneGridRowStyles);
8692
- const styles = ui.useStyles2(getStyles$5);
8907
+ const styles = ui.useStyles2(getStyles$4);
8693
8908
  const toolbarControls = (controls != null ? controls : []).map((action) => /* @__PURE__ */ React__default["default"].createElement(action.Component, {
8694
8909
  key: action.state.key,
8695
8910
  model: action
@@ -8724,7 +8939,7 @@ function NestedSceneRenderer({ model }) {
8724
8939
  model: body
8725
8940
  }));
8726
8941
  }
8727
- const getStyles$5 = (theme) => ({
8942
+ const getStyles$4 = (theme) => ({
8728
8943
  wrapper: css.css({
8729
8944
  display: "flex",
8730
8945
  flexDirection: "column",
@@ -8891,30 +9106,30 @@ function getShiftedTimeRange(dir, timeRange, upperLimit) {
8891
9106
  };
8892
9107
  }
8893
9108
 
8894
- var __defProp$6 = Object.defineProperty;
8895
- var __defProps$3 = Object.defineProperties;
8896
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
8897
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
8898
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
8899
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
8900
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8901
- var __spreadValues$6 = (a, b) => {
9109
+ var __defProp$5 = Object.defineProperty;
9110
+ var __defProps$2 = Object.defineProperties;
9111
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
9112
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
9113
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
9114
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
9115
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9116
+ var __spreadValues$5 = (a, b) => {
8902
9117
  for (var prop in b || (b = {}))
8903
- if (__hasOwnProp$6.call(b, prop))
8904
- __defNormalProp$6(a, prop, b[prop]);
8905
- if (__getOwnPropSymbols$6)
8906
- for (var prop of __getOwnPropSymbols$6(b)) {
8907
- if (__propIsEnum$6.call(b, prop))
8908
- __defNormalProp$6(a, prop, b[prop]);
9118
+ if (__hasOwnProp$5.call(b, prop))
9119
+ __defNormalProp$5(a, prop, b[prop]);
9120
+ if (__getOwnPropSymbols$5)
9121
+ for (var prop of __getOwnPropSymbols$5(b)) {
9122
+ if (__propIsEnum$5.call(b, prop))
9123
+ __defNormalProp$5(a, prop, b[prop]);
8909
9124
  }
8910
9125
  return a;
8911
9126
  };
8912
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
9127
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
8913
9128
  const DEFAULT_INTERVALS = ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"];
8914
9129
  class SceneRefreshPicker extends SceneObjectBase {
8915
9130
  constructor(state) {
8916
9131
  var _a, _b, _c;
8917
- super(__spreadProps$3(__spreadValues$6({
9132
+ super(__spreadProps$2(__spreadValues$5({
8918
9133
  refresh: ""
8919
9134
  }, state), {
8920
9135
  autoValue: void 0,
@@ -8991,287 +9206,59 @@ class SceneRefreshPicker extends SceneObjectBase {
8991
9206
  }
8992
9207
  (_a2 = this._autoTimeRangeListener) == null ? void 0 : _a2.unsubscribe();
8993
9208
  };
8994
- });
8995
- }
8996
- getUrlState() {
8997
- return {
8998
- refresh: this.state.refresh
8999
- };
9000
- }
9001
- updateFromUrl(values) {
9002
- const refresh = values.refresh;
9003
- if (refresh && typeof refresh === "string") {
9004
- this.setState({
9005
- refresh
9006
- });
9007
- }
9008
- }
9009
- }
9010
- SceneRefreshPicker.Component = SceneRefreshPickerRenderer;
9011
- function SceneRefreshPickerRenderer({ model }) {
9012
- var _a;
9013
- const { refresh, intervals, autoEnabled, autoValue, isOnCanvas, primary, withText } = model.useState();
9014
- const isRunning = useQueryControllerState(model);
9015
- let text = refresh === ((_a = ui.RefreshPicker.autoOption) == null ? void 0 : _a.value) ? autoValue : withText ? "Refresh" : void 0;
9016
- let tooltip;
9017
- let width;
9018
- if (isRunning) {
9019
- tooltip = "Cancel all queries";
9020
- if (withText) {
9021
- text = "Cancel";
9022
- }
9023
- }
9024
- if (withText) {
9025
- width = "96px";
9026
- }
9027
- return /* @__PURE__ */ React__default["default"].createElement(ui.RefreshPicker, {
9028
- showAutoInterval: autoEnabled,
9029
- value: refresh,
9030
- intervals,
9031
- tooltip,
9032
- width,
9033
- text,
9034
- onRefresh: model.onRefresh,
9035
- primary,
9036
- onIntervalChanged: model.onIntervalChanged,
9037
- isLoading: isRunning,
9038
- isOnCanvas: isOnCanvas != null ? isOnCanvas : true
9039
- });
9040
- }
9041
- function useQueryControllerState(model) {
9042
- const queryController = sceneGraph.getQueryController(model);
9043
- if (!queryController) {
9044
- return false;
9045
- }
9046
- return queryController.useState().isRunning;
9047
- }
9048
-
9049
- const getCompareSeriesRefId = (refId) => `${refId}-compare`;
9050
-
9051
- var __defProp$5 = Object.defineProperty;
9052
- var __defProps$2 = Object.defineProperties;
9053
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
9054
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
9055
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
9056
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
9057
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9058
- var __spreadValues$5 = (a, b) => {
9059
- for (var prop in b || (b = {}))
9060
- if (__hasOwnProp$5.call(b, prop))
9061
- __defNormalProp$5(a, prop, b[prop]);
9062
- if (__getOwnPropSymbols$5)
9063
- for (var prop of __getOwnPropSymbols$5(b)) {
9064
- if (__propIsEnum$5.call(b, prop))
9065
- __defNormalProp$5(a, prop, b[prop]);
9066
- }
9067
- return a;
9068
- };
9069
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
9070
- const PREVIOUS_PERIOD_VALUE = "__previousPeriod";
9071
- const NO_PERIOD_VALUE = "__noPeriod";
9072
- const PREVIOUS_PERIOD_COMPARE_OPTION = {
9073
- label: "Previous period",
9074
- value: PREVIOUS_PERIOD_VALUE
9075
- };
9076
- const NO_COMPARE_OPTION = {
9077
- label: "No comparison",
9078
- value: NO_PERIOD_VALUE
9079
- };
9080
- const DEFAULT_COMPARE_OPTIONS = [
9081
- { label: "Day before", value: "24h" },
9082
- { label: "Week before", value: "1w" },
9083
- { label: "Month before", value: "1M" }
9084
- ];
9085
- class SceneTimeRangeCompare extends SceneObjectBase {
9086
- constructor(state) {
9087
- super(__spreadValues$5({ compareOptions: DEFAULT_COMPARE_OPTIONS }, state));
9088
- this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["compareWith"] });
9089
- this._onActivate = () => {
9090
- const sceneTimeRange = sceneGraph.getTimeRange(this);
9091
- this.setState({ compareOptions: this.getCompareOptions(sceneTimeRange.state.value) });
9092
- this._subs.add(
9093
- sceneTimeRange.subscribeToState((timeRange) => {
9094
- const compareOptions = this.getCompareOptions(timeRange.value);
9095
- const stateUpdate = { compareOptions };
9096
- if (Boolean(this.state.compareWith) && !compareOptions.find(({ value }) => value === this.state.compareWith)) {
9097
- stateUpdate.compareWith = PREVIOUS_PERIOD_VALUE;
9098
- }
9099
- this.setState(stateUpdate);
9100
- })
9101
- );
9102
- };
9103
- this.getCompareOptions = (timeRange) => {
9104
- const diffDays = Math.ceil(timeRange.to.diff(timeRange.from));
9105
- const matchIndex = DEFAULT_COMPARE_OPTIONS.findIndex(({ value }) => {
9106
- const intervalInMs = data.rangeUtil.intervalToMs(value);
9107
- return intervalInMs >= diffDays;
9108
- });
9109
- return [
9110
- NO_COMPARE_OPTION,
9111
- PREVIOUS_PERIOD_COMPARE_OPTION,
9112
- ...DEFAULT_COMPARE_OPTIONS.slice(matchIndex).map(({ label, value }) => ({ label, value }))
9113
- ];
9114
- };
9115
- this.onCompareWithChanged = (compareWith) => {
9116
- if (compareWith === NO_PERIOD_VALUE) {
9117
- this.onClearCompare();
9118
- } else {
9119
- this.setState({ compareWith });
9120
- }
9121
- };
9122
- this.onClearCompare = () => {
9123
- this.setState({ compareWith: void 0 });
9124
- };
9125
- this.addActivationHandler(this._onActivate);
9126
- }
9127
- getExtraQueries(request) {
9128
- const extraQueries = [];
9129
- const compareRange = this.getCompareTimeRange(request.range);
9130
- if (!compareRange) {
9131
- return extraQueries;
9132
- }
9133
- const targets = request.targets.filter((query) => query.timeRangeCompare !== false);
9134
- if (targets.length) {
9135
- extraQueries.push({
9136
- req: __spreadProps$2(__spreadValues$5({}, request), {
9137
- targets,
9138
- range: compareRange
9139
- }),
9140
- processor: timeShiftAlignmentProcessor
9141
- });
9142
- }
9143
- return extraQueries;
9144
- }
9145
- shouldRerun(prev, next) {
9146
- return prev.compareWith !== next.compareWith;
9147
- }
9148
- getCompareTimeRange(timeRange) {
9149
- let compareFrom;
9150
- let compareTo;
9151
- if (this.state.compareWith) {
9152
- if (this.state.compareWith === PREVIOUS_PERIOD_VALUE) {
9153
- const diffMs = timeRange.to.diff(timeRange.from);
9154
- compareFrom = data.dateTime(timeRange.from).subtract(diffMs);
9155
- compareTo = data.dateTime(timeRange.to).subtract(diffMs);
9156
- } else {
9157
- compareFrom = data.dateTime(timeRange.from).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
9158
- compareTo = data.dateTime(timeRange.to).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
9159
- }
9160
- return {
9161
- from: compareFrom,
9162
- to: compareTo,
9163
- raw: {
9164
- from: compareFrom,
9165
- to: compareTo
9166
- }
9167
- };
9168
- }
9169
- return void 0;
9209
+ });
9170
9210
  }
9171
9211
  getUrlState() {
9172
9212
  return {
9173
- compareWith: this.state.compareWith
9213
+ refresh: this.state.refresh
9174
9214
  };
9175
9215
  }
9176
9216
  updateFromUrl(values) {
9177
- if (!values.compareWith) {
9178
- return;
9179
- }
9180
- const compareWith = parseUrlParam(values.compareWith);
9181
- if (compareWith) {
9182
- const compareOptions = this.getCompareOptions(sceneGraph.getTimeRange(this).state.value);
9183
- if (compareOptions.find(({ value }) => value === compareWith)) {
9184
- this.setState({
9185
- compareWith
9186
- });
9187
- } else {
9188
- this.setState({
9189
- compareWith: "__previousPeriod"
9190
- });
9191
- }
9217
+ const refresh = values.refresh;
9218
+ if (refresh && typeof refresh === "string") {
9219
+ this.setState({
9220
+ refresh
9221
+ });
9192
9222
  }
9193
9223
  }
9194
9224
  }
9195
- SceneTimeRangeCompare.Component = SceneTimeRangeCompareRenderer;
9196
- const timeShiftAlignmentProcessor = (primary, secondary) => {
9197
- const diff = secondary.timeRange.from.diff(primary.timeRange.from);
9198
- secondary.series.forEach((series) => {
9199
- series.refId = getCompareSeriesRefId(series.refId || "");
9200
- series.meta = __spreadProps$2(__spreadValues$5({}, series.meta), {
9201
- timeCompare: {
9202
- diffMs: diff,
9203
- isTimeShiftQuery: true
9204
- }
9205
- });
9206
- series.fields.forEach((field) => {
9207
- if (field.type === data.FieldType.time) {
9208
- field.values = field.values.map((v) => {
9209
- return diff < 0 ? v - diff : v + diff;
9210
- });
9211
- }
9212
- field.config = __spreadProps$2(__spreadValues$5({}, field.config), {
9213
- color: {
9214
- mode: "fixed",
9215
- fixedColor: runtime.config.theme.palette.gray60
9216
- }
9217
- });
9218
- return field;
9219
- });
9220
- });
9221
- return rxjs.of(secondary);
9222
- };
9223
- function SceneTimeRangeCompareRenderer({ model }) {
9225
+ SceneRefreshPicker.Component = SceneRefreshPickerRenderer;
9226
+ function SceneRefreshPickerRenderer({ model }) {
9224
9227
  var _a;
9225
- const styles = ui.useStyles2(getStyles$4);
9226
- const { compareWith, compareOptions } = model.useState();
9227
- const [previousCompare, setPreviousCompare] = React__default["default"].useState(compareWith);
9228
- const previousValue = (_a = compareOptions.find(({ value: value2 }) => value2 === previousCompare)) != null ? _a : PREVIOUS_PERIOD_COMPARE_OPTION;
9229
- const value = compareOptions.find(({ value: value2 }) => value2 === compareWith);
9230
- const enabled = Boolean(value);
9231
- const onClick = () => {
9232
- if (enabled) {
9233
- setPreviousCompare(compareWith);
9234
- model.onClearCompare();
9235
- } else if (!enabled) {
9236
- model.onCompareWithChanged(previousValue.value);
9237
- }
9238
- };
9239
- return /* @__PURE__ */ React__default["default"].createElement(ui.ButtonGroup, null, /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
9240
- variant: "canvas",
9241
- tooltip: "Enable time frame comparison",
9242
- onClick: (e) => {
9243
- e.stopPropagation();
9244
- e.preventDefault();
9245
- onClick();
9246
- }
9247
- }, /* @__PURE__ */ React__default["default"].createElement(ui.Checkbox, {
9248
- label: " ",
9249
- value: enabled,
9250
- onClick
9251
- }), "Comparison"), enabled ? /* @__PURE__ */ React__default["default"].createElement(ui.ButtonSelect, {
9252
- variant: "canvas",
9253
- value,
9254
- options: compareOptions,
9255
- onChange: (v) => {
9256
- model.onCompareWithChanged(v.value);
9228
+ const { refresh, intervals, autoEnabled, autoValue, isOnCanvas, primary, withText } = model.useState();
9229
+ const isRunning = useQueryControllerState(model);
9230
+ let text = refresh === ((_a = ui.RefreshPicker.autoOption) == null ? void 0 : _a.value) ? autoValue : withText ? "Refresh" : void 0;
9231
+ let tooltip;
9232
+ let width;
9233
+ if (isRunning) {
9234
+ tooltip = "Cancel all queries";
9235
+ if (withText) {
9236
+ text = "Cancel";
9257
9237
  }
9258
- }) : /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
9259
- className: styles.previewButton,
9260
- disabled: true,
9261
- variant: "canvas",
9262
- isOpen: false
9263
- }, previousValue.label));
9238
+ }
9239
+ if (withText) {
9240
+ width = "96px";
9241
+ }
9242
+ return /* @__PURE__ */ React__default["default"].createElement(ui.RefreshPicker, {
9243
+ showAutoInterval: autoEnabled,
9244
+ value: refresh,
9245
+ intervals,
9246
+ tooltip,
9247
+ width,
9248
+ text,
9249
+ onRefresh: model.onRefresh,
9250
+ primary,
9251
+ onIntervalChanged: model.onIntervalChanged,
9252
+ isLoading: isRunning,
9253
+ isOnCanvas: isOnCanvas != null ? isOnCanvas : true
9254
+ });
9264
9255
  }
9265
- function getStyles$4(theme) {
9266
- return {
9267
- previewButton: css.css({
9268
- "&:disabled": {
9269
- border: `1px solid ${theme.colors.secondary.border}`,
9270
- color: theme.colors.text.disabled,
9271
- opacity: 1
9272
- }
9273
- })
9274
- };
9256
+ function useQueryControllerState(model) {
9257
+ const queryController = sceneGraph.getQueryController(model);
9258
+ if (!queryController) {
9259
+ return false;
9260
+ }
9261
+ return queryController.useState().isRunning;
9275
9262
  }
9276
9263
 
9277
9264
  class SceneByFrameRepeater extends SceneObjectBase {
@@ -11138,174 +11125,6 @@ const PanelBuilders = {
11138
11125
  }
11139
11126
  };
11140
11127
 
11141
- class VizConfigBuilder {
11142
- constructor(pluginId, pluginVersion, defaultOptions, defaultFieldConfig) {
11143
- this._pluginId = pluginId;
11144
- this._pluginVersion = pluginVersion;
11145
- this._fieldConfigBuilder = new FieldConfigBuilder(defaultFieldConfig);
11146
- this._panelOptionsBuilder = new PanelOptionsBuilder(defaultOptions);
11147
- }
11148
- setColor(color) {
11149
- this._fieldConfigBuilder.setColor(color);
11150
- return this;
11151
- }
11152
- setDecimals(decimals) {
11153
- this._fieldConfigBuilder.setDecimals(decimals);
11154
- return this;
11155
- }
11156
- setDisplayName(displayName) {
11157
- this._fieldConfigBuilder.setDisplayName(displayName);
11158
- return this;
11159
- }
11160
- setFilterable(filterable) {
11161
- this._fieldConfigBuilder.setFilterable(filterable);
11162
- return this;
11163
- }
11164
- setLinks(links) {
11165
- this._fieldConfigBuilder.setLinks(links);
11166
- return this;
11167
- }
11168
- setMappings(mappings) {
11169
- this._fieldConfigBuilder.setMappings(mappings);
11170
- return this;
11171
- }
11172
- setMax(max) {
11173
- this._fieldConfigBuilder.setMax(max);
11174
- return this;
11175
- }
11176
- setMin(min) {
11177
- this._fieldConfigBuilder.setMin(min);
11178
- return this;
11179
- }
11180
- setNoValue(noValue) {
11181
- this._fieldConfigBuilder.setNoValue(noValue);
11182
- return this;
11183
- }
11184
- setThresholds(thresholds) {
11185
- this._fieldConfigBuilder.setThresholds(thresholds);
11186
- return this;
11187
- }
11188
- setUnit(unit) {
11189
- this._fieldConfigBuilder.setUnit(unit);
11190
- return this;
11191
- }
11192
- setCustomFieldConfig(id, value) {
11193
- this._fieldConfigBuilder.setCustomFieldConfig(id, value);
11194
- return this;
11195
- }
11196
- setOverrides(builder) {
11197
- this._fieldConfigBuilder.setOverrides(builder);
11198
- return this;
11199
- }
11200
- setOption(id, value) {
11201
- this._panelOptionsBuilder.setOption(id, value);
11202
- return this;
11203
- }
11204
- build() {
11205
- return {
11206
- pluginId: this._pluginId,
11207
- pluginVersion: this._pluginVersion,
11208
- options: this._panelOptionsBuilder.build(),
11209
- fieldConfig: this._fieldConfigBuilder.build()
11210
- };
11211
- }
11212
- }
11213
-
11214
- const VizConfigBuilders = {
11215
- barchart() {
11216
- return new VizConfigBuilder(
11217
- "barchart",
11218
- "10.0.0",
11219
- () => BarChartPanelCfg_types_gen.defaultOptions,
11220
- () => BarChartPanelCfg_types_gen.defaultFieldConfig
11221
- );
11222
- },
11223
- bargauge() {
11224
- return new VizConfigBuilder("bargauge", "10.0.0", () => BarGaugePanelCfg_types_gen.defaultOptions);
11225
- },
11226
- datagrid() {
11227
- return new VizConfigBuilder("datagrid", "10.0.0", () => DatagridPanelCfg_types_gen.defaultOptions);
11228
- },
11229
- flamegraph() {
11230
- return new VizConfigBuilder("flamegraph", "10.0.0");
11231
- },
11232
- gauge() {
11233
- return new VizConfigBuilder("gauge", "10.0.0", () => GaugePanelCfg_types_gen.defaultOptions);
11234
- },
11235
- geomap() {
11236
- return new VizConfigBuilder("geomap", "10.0.0", () => GeomapPanelCfg_types_gen.defaultOptions);
11237
- },
11238
- heatmap() {
11239
- return new VizConfigBuilder("heatmap", "10.0.0", () => HeatmapPanelCfg_types_gen.defaultOptions);
11240
- },
11241
- histogram() {
11242
- return new VizConfigBuilder(
11243
- "histogram",
11244
- "10.0.0",
11245
- () => HistogramPanelCfg_types_gen.defaultOptions,
11246
- () => HistogramPanelCfg_types_gen.defaultFieldConfig
11247
- );
11248
- },
11249
- logs() {
11250
- return new VizConfigBuilder("logs", "10.0.0");
11251
- },
11252
- news() {
11253
- return new VizConfigBuilder("news", "10.0.0", () => NewsPanelCfg_types_gen.defaultOptions);
11254
- },
11255
- nodegraph() {
11256
- return new VizConfigBuilder("nodeGraph", "10.0.0");
11257
- },
11258
- piechart() {
11259
- return new VizConfigBuilder(
11260
- "piechart",
11261
- "10.0.0",
11262
- () => PieChartPanelCfg_types_gen.defaultOptions
11263
- );
11264
- },
11265
- stat() {
11266
- return new VizConfigBuilder("stat", "10.0.0", () => StatPanelCfg_types_gen.defaultOptions);
11267
- },
11268
- statetimeline() {
11269
- return new VizConfigBuilder(
11270
- "state-timeline",
11271
- "10.0.0",
11272
- () => StateTimelinePanelCfg_types_gen.defaultOptions,
11273
- () => StateTimelinePanelCfg_types_gen.defaultFieldConfig
11274
- );
11275
- },
11276
- statushistory() {
11277
- return new VizConfigBuilder(
11278
- "status-history",
11279
- "10.0.0",
11280
- () => StatusHistoryPanelCfg_types_gen.defaultOptions,
11281
- () => StatusHistoryPanelCfg_types_gen.defaultFieldConfig
11282
- );
11283
- },
11284
- table() {
11285
- return new VizConfigBuilder("table", "10.0.0", () => TablePanelCfg_types_gen.defaultOptions);
11286
- },
11287
- text() {
11288
- return new VizConfigBuilder("text", "10.0.0", () => TextPanelCfg_types_gen.defaultOptions);
11289
- },
11290
- timeseries() {
11291
- return new VizConfigBuilder("timeseries", "10.0.0");
11292
- },
11293
- trend() {
11294
- return new VizConfigBuilder("trend", "10.0.0");
11295
- },
11296
- traces() {
11297
- return new VizConfigBuilder("traces", "10.0.0");
11298
- },
11299
- xychart() {
11300
- return new VizConfigBuilder(
11301
- "xychart",
11302
- "10.0.0",
11303
- () => XYChartPanelCfg_types_gen.defaultOptions,
11304
- () => XYChartPanelCfg_types_gen.defaultFieldConfig
11305
- );
11306
- }
11307
- };
11308
-
11309
11128
  const sceneUtils = {
11310
11129
  getUrlWithAppState,
11311
11130
  registerRuntimePanelPlugin,
@@ -11330,7 +11149,6 @@ exports.ConstantVariable = ConstantVariable;
11330
11149
  exports.CustomVariable = CustomVariable;
11331
11150
  exports.DataSourceVariable = DataSourceVariable;
11332
11151
  exports.EmbeddedScene = EmbeddedScene;
11333
- exports.FieldConfigBuilder = FieldConfigBuilder;
11334
11152
  exports.FieldConfigBuilders = FieldConfigBuilders;
11335
11153
  exports.FieldConfigOverridesBuilder = FieldConfigOverridesBuilder;
11336
11154
  exports.GroupByVariable = GroupByVariable;
@@ -11385,10 +11203,7 @@ exports.UrlSyncManager = UrlSyncManager;
11385
11203
  exports.UserActionEvent = UserActionEvent;
11386
11204
  exports.VariableDependencyConfig = VariableDependencyConfig;
11387
11205
  exports.VariableValueControl = VariableValueControl;
11388
- exports.VariableValueSelectWrapper = VariableValueSelectWrapper;
11389
11206
  exports.VariableValueSelectors = VariableValueSelectors;
11390
- exports.VizConfigBuilder = VizConfigBuilder;
11391
- exports.VizConfigBuilders = VizConfigBuilders;
11392
11207
  exports.VizPanel = VizPanel;
11393
11208
  exports.VizPanelBuilder = VizPanelBuilder;
11394
11209
  exports.VizPanelMenu = VizPanelMenu;