@kong-ui-public/dashboard-renderer 0.32.2 → 0.32.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,27 +1,27 @@
1
- import { ref as A, watchEffect as pe, inject as j, defineComponent as x, onUnmounted as oe, computed as v, watch as ye, resolveComponent as L, unref as u, openBlock as d, createBlock as g, withCtx as b, createTextVNode as B, toDisplayString as F, renderSlot as H, createCommentVNode as w, useCssVars as M, createElementVNode as P, createVNode as I, mergeProps as ae, createSlots as ie, createElementBlock as R, normalizeProps as he, guardReactiveProps as me, resolveDynamicComponent as fe, onMounted as ge, Fragment as ve, renderList as be, normalizeClass as _e, normalizeStyle as ee } from "vue";
2
- import { SimpleChart as qe, AnalyticsChart as Ce, TopNTable as Se, CsvExportModal as Ee, ChartMetricDisplay as xe } from "@kong-ui-public/analytics-chart";
3
- import Te from "swrv";
1
+ import { ref as I, watchEffect as ye, inject as N, defineComponent as S, onUnmounted as ae, computed as v, watch as he, resolveComponent as F, unref as c, openBlock as d, createBlock as b, withCtx as _, createTextVNode as U, toDisplayString as O, renderSlot as G, createCommentVNode as k, useCssVars as K, createElementVNode as L, createVNode as T, mergeProps as ie, createSlots as se, createElementBlock as E, normalizeProps as me, guardReactiveProps as fe, resolveDynamicComponent as ge, onMounted as ve, Fragment as be, renderList as _e, normalizeClass as qe, normalizeStyle as X } from "vue";
2
+ import { SimpleChart as Ce, AnalyticsChart as Ee, TopNTable as Se, CsvExportModal as xe, ChartMetricDisplay as Te } from "@kong-ui-public/analytics-chart";
3
+ import Ae from "swrv";
4
4
  import "axios";
5
- import { createI18n as Ae, i18nTComponent as Re } from "@kong-ui-public/i18n";
6
- import { stripUnknownFilters as De, Timeframe as ke, TimePeriods as we, granularityValues as Ie, exploreFilterTypesV2 as Oe, exploreAggregations as Fe, queryableExploreDimensions as Pe, filterableExploreDimensions as Le, basicExploreAggregations as Ne, queryableBasicExploreDimensions as $e, filterableBasicExploreDimensions as je, aiExploreAggregations as ze, queryableAiExploreDimensions as Ke, filterableAiExploreDimensions as Be, relativeTimeRangeValuesV4 as Me } from "@kong-ui-public/analytics-utilities";
7
- import { MetricsProvider as Ve, MetricsConsumer as Ue } from "@kong-ui-public/analytics-metric-provider";
8
- import { EntityLink as Ge } from "@kong-ui-public/entities-shared";
9
- import { MoreIcon as He } from "@kong/icons";
10
- import { useAnalyticsConfigStore as Qe } from "@kong-ui-public/analytics-config-store";
11
- var se = /* @__PURE__ */ ((e) => (e.VALIDATING = "VALIDATING", e.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", e.PENDING = "PENDING", e.SUCCESS = "SUCCESS", e.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", e.ERROR = "ERROR", e.STALE_IF_ERROR = "STALE_IF_ERROR", e))(se || {});
12
- const Je = (e) => {
13
- var r, t, n, i, o;
5
+ import { createI18n as Re, i18nTComponent as De } from "@kong-ui-public/i18n";
6
+ import { stripUnknownFilters as ke, Timeframe as Ie, TimePeriods as we, granularityValues as Oe, exploreFilterTypesV2 as Fe, exploreAggregations as Pe, queryableExploreDimensions as Le, filterableExploreDimensions as Ne, basicExploreAggregations as je, queryableBasicExploreDimensions as ze, filterableBasicExploreDimensions as $e, aiExploreAggregations as Ke, queryableAiExploreDimensions as Be, filterableAiExploreDimensions as Ve, relativeTimeRangeValuesV4 as Me } from "@kong-ui-public/analytics-utilities";
7
+ import { MetricsProvider as Ue, MetricsConsumer as Ge } from "@kong-ui-public/analytics-metric-provider";
8
+ import { EntityLink as He } from "@kong-ui-public/entities-shared";
9
+ import { EditIcon as Qe, MoreIcon as Je } from "@kong/icons";
10
+ import { useAnalyticsConfigStore as Ze } from "@kong-ui-public/analytics-config-store";
11
+ var ce = /* @__PURE__ */ ((e) => (e.VALIDATING = "VALIDATING", e.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", e.PENDING = "PENDING", e.SUCCESS = "SUCCESS", e.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", e.ERROR = "ERROR", e.STALE_IF_ERROR = "STALE_IF_ERROR", e))(ce || {});
12
+ const We = (e) => {
13
+ var r, t, o, i, n;
14
14
  return e ? !!// TODO: revisit: currently only the first check ever matters?
15
- ((r = Object.keys(e)) != null && r.length || (t = e.data) != null && t.length || (i = (n = e.data) == null ? void 0 : n.data) != null && i.length || !((o = e.data) != null && o.data) && typeof e.data == "object" && Object.keys(e == null ? void 0 : e.data).length) : !1;
15
+ ((r = Object.keys(e)) != null && r.length || (t = e.data) != null && t.length || (i = (o = e.data) == null ? void 0 : o.data) != null && i.length || !((n = e.data) != null && n.data) && typeof e.data == "object" && Object.keys(e == null ? void 0 : e.data).length) : !1;
16
16
  };
17
- function Ze(e = A({}), r, t, n = Je) {
18
- const i = A(
17
+ function Ye(e = I({}), r, t, o = We) {
18
+ const i = I(
19
19
  "PENDING"
20
20
  /* PENDING */
21
21
  );
22
- return pe(() => {
23
- const o = n(e.value);
24
- if (e.value && o && t.value) {
22
+ return ye(() => {
23
+ const n = o(e.value);
24
+ if (e.value && n && t.value) {
25
25
  i.value = "VALIDATING_HAS_DATA";
26
26
  return;
27
27
  }
@@ -37,7 +37,7 @@ function Ze(e = A({}), r, t, n = Je) {
37
37
  i.value = "PENDING";
38
38
  return;
39
39
  }
40
- if (e.value && !r.value && o) {
40
+ if (e.value && !r.value && n) {
41
41
  i.value = "SUCCESS_HAS_DATA";
42
42
  return;
43
43
  }
@@ -48,10 +48,10 @@ function Ze(e = A({}), r, t, n = Je) {
48
48
  e.value === void 0 && r && (i.value = "ERROR");
49
49
  }), {
50
50
  state: i,
51
- swrvState: se
51
+ swrvState: ce
52
52
  };
53
53
  }
54
- const We = {
54
+ const Xe = {
55
55
  noQueryBridge: "No query bridge provided. Unable to render dashboard.",
56
56
  trendRange: {
57
57
  "24h": "Last 24-Hour Summary",
@@ -59,36 +59,36 @@ const We = {
59
59
  "30d": "Last 30-Day Summary"
60
60
  },
61
61
  edit: "Edit"
62
- }, Ye = {
62
+ }, et = {
63
63
  timeRangeExceeded: "The time range for this report is outside of your organization's data retention period"
64
- }, Xe = {
64
+ }, tt = {
65
65
  defaultFilename: "Chart Export",
66
66
  exportAsCsv: "Export as CSV"
67
- }, et = "Explore", tt = {
68
- renderer: We,
69
- queryDataProvider: Ye,
70
- csvExport: Xe,
71
- jumpToExplore: et
67
+ }, rt = "Explore", ot = {
68
+ renderer: Xe,
69
+ queryDataProvider: et,
70
+ csvExport: tt,
71
+ jumpToExplore: rt
72
72
  };
73
- function rt() {
74
- const e = Ae("en-us", tt);
73
+ function nt() {
74
+ const e = Re("en-us", ot);
75
75
  return {
76
76
  i18n: e,
77
- i18nT: Re(e)
77
+ i18nT: De(e)
78
78
  // Translation component <i18n-t>
79
79
  };
80
80
  }
81
- const V = 170, z = "analytics-query-provider", te = "{entity-id}", nt = "{cp-id}", ot = "{timeframe}", at = 30 * 1e3;
82
- function it() {
83
- const e = j(z);
81
+ const B = 170, j = "analytics-query-provider", ee = "{entity-id}", at = "{cp-id}", it = "{timeframe}", st = 30 * 1e3;
82
+ function ct() {
83
+ const e = N(j);
84
84
  return {
85
- evaluateFeatureFlag: (t, n) => e ? e.evaluateFeatureFlagFn(t, n) : n
85
+ evaluateFeatureFlag: (t, o) => e ? e.evaluateFeatureFlagFn(t, o) : o
86
86
  };
87
87
  }
88
- const O = {
89
- useI18n: rt,
90
- useEvaluateFeatureFlag: it
91
- }, Q = /* @__PURE__ */ x({
88
+ const w = {
89
+ useI18n: nt,
90
+ useEvaluateFeatureFlag: ct
91
+ }, H = /* @__PURE__ */ S({
92
92
  __name: "QueryDataProvider",
93
93
  props: {
94
94
  context: {},
@@ -98,67 +98,67 @@ const O = {
98
98
  },
99
99
  emits: ["chart-data", "queryComplete"],
100
100
  setup(e, { emit: r }) {
101
- const t = e, n = r, { i18n: i } = O.useI18n(), o = j(z), c = () => t.queryReady && o ? JSON.stringify([t.query, t.context, t.refreshCounter]) : null, a = new AbortController();
102
- oe(() => {
101
+ const t = e, o = r, { i18n: i } = w.useI18n(), n = N(j), s = () => t.queryReady && n ? JSON.stringify([t.query, t.context, t.refreshCounter]) : null, a = new AbortController();
102
+ ae(() => {
103
103
  a.abort();
104
104
  });
105
- const l = (p, f, q) => {
106
- const C = [];
107
- return f && C.push(...f), C.push(...De(p, q)), C;
108
- }, { data: h, error: D, isValidating: S } = Te(c, async () => {
109
- var p, f, q, C;
105
+ const l = (p, g, q) => {
106
+ const u = [];
107
+ return g && u.push(...g), u.push(...ke(p, q)), u;
108
+ }, { data: f, error: A, isValidating: R } = Ae(s, async () => {
109
+ var p, g, q, u;
110
110
  try {
111
111
  let {
112
- datasource: s,
113
- ...E
112
+ datasource: h,
113
+ ...$
114
114
  } = t.query;
115
- s || (s = "basic");
116
- const $ = l(s, t.query.filters, t.context.filters), G = {
117
- datasource: s,
115
+ h || (h = "basic");
116
+ const M = l(h, t.query.filters, t.context.filters), Y = {
117
+ datasource: h,
118
118
  query: {
119
- ...E,
119
+ ...$,
120
120
  time_range: {
121
121
  ...t.context.timeSpec,
122
122
  tz: t.context.tz
123
123
  },
124
- filters: $
124
+ filters: M
125
125
  }
126
126
  };
127
- return o == null ? void 0 : o.queryFn(G, a);
128
- } catch (s) {
129
- k.value = ((f = (p = s == null ? void 0 : s.response) == null ? void 0 : p.data) == null ? void 0 : f.message) === "Range not allowed for this tier" ? i.t("queryDataProvider.timeRangeExceeded") : ((C = (q = s == null ? void 0 : s.response) == null ? void 0 : q.data) == null ? void 0 : C.message) || (s == null ? void 0 : s.message);
127
+ return n == null ? void 0 : n.queryFn(Y, a);
128
+ } catch (h) {
129
+ D.value = ((g = (p = h == null ? void 0 : h.response) == null ? void 0 : p.data) == null ? void 0 : g.message) === "Range not allowed for this tier" ? i.t("queryDataProvider.timeRangeExceeded") : ((u = (q = h == null ? void 0 : h.response) == null ? void 0 : q.data) == null ? void 0 : u.message) || (h == null ? void 0 : h.message);
130
130
  } finally {
131
- n("queryComplete");
131
+ o("queryComplete");
132
132
  }
133
133
  }, {
134
134
  refreshInterval: t.context.refreshInterval,
135
135
  revalidateOnFocus: !1
136
- }), { state: y, swrvState: T } = Ze(h, D, S), k = A(null), m = v(() => y.value === T.ERROR || !!k.value), _ = v(() => !t.queryReady || y.value === T.PENDING);
137
- return ye(h, (p) => {
138
- p && n("chart-data", p);
139
- }), (p, f) => {
140
- const q = L("KSkeleton"), C = L("KEmptyState");
141
- return _.value || !u(h) && !m.value ? (d(), g(q, {
136
+ }), { state: m, swrvState: x } = Ye(f, A, R), D = I(null), y = v(() => m.value === x.ERROR || !!D.value), C = v(() => !t.queryReady || m.value === x.PENDING);
137
+ return he(f, (p) => {
138
+ p && o("chart-data", p);
139
+ }), (p, g) => {
140
+ const q = F("KSkeleton"), u = F("KEmptyState");
141
+ return C.value || !c(f) && !y.value ? (d(), b(q, {
142
142
  key: 0,
143
143
  class: "chart-skeleton",
144
144
  type: "table"
145
- })) : m.value ? (d(), g(C, {
145
+ })) : y.value ? (d(), b(u, {
146
146
  key: 1,
147
147
  "action-button-visible": !1,
148
148
  "data-testid": "chart-empty-state",
149
149
  "icon-variant": "error"
150
150
  }, {
151
- default: b(() => [
152
- B(F(k.value), 1)
151
+ default: _(() => [
152
+ U(O(D.value), 1)
153
153
  ]),
154
154
  _: 1
155
- })) : u(h) ? H(p.$slots, "default", {
155
+ })) : c(f) ? G(p.$slots, "default", {
156
156
  key: 2,
157
- data: u(h)
158
- }) : w("", !0);
157
+ data: c(f)
158
+ }) : k("", !0);
159
159
  };
160
160
  }
161
- }), st = { class: "analytics-chart" }, ct = /* @__PURE__ */ x({
161
+ }), lt = { class: "analytics-chart" }, ut = /* @__PURE__ */ S({
162
162
  __name: "SimpleChartRenderer",
163
163
  props: {
164
164
  query: {},
@@ -169,19 +169,19 @@ const O = {
169
169
  refreshCounter: {}
170
170
  },
171
171
  setup(e) {
172
- M((t) => ({
172
+ K((t) => ({
173
173
  bc149350: `${t.height}px`
174
174
  }));
175
175
  const r = e;
176
- return (t, n) => (d(), g(Q, {
176
+ return (t, o) => (d(), b(H, {
177
177
  context: t.context,
178
178
  query: t.query,
179
179
  "query-ready": t.queryReady,
180
180
  "refresh-counter": t.refreshCounter
181
181
  }, {
182
- default: b(({ data: i }) => [
183
- P("div", st, [
184
- I(u(qe), {
182
+ default: _(({ data: i }) => [
183
+ L("div", lt, [
184
+ T(c(Ce), {
185
185
  "chart-data": i,
186
186
  "chart-options": r.chartOptions,
187
187
  "synthetics-data-key": t.chartOptions.syntheticsDataKey
@@ -191,12 +191,12 @@ const O = {
191
191
  _: 1
192
192
  }, 8, ["context", "query", "query-ready", "refresh-counter"]));
193
193
  }
194
- }), N = (e, r) => {
194
+ }), P = (e, r) => {
195
195
  const t = e.__vccOpts || e;
196
- for (const [n, i] of r)
197
- t[n] = i;
196
+ for (const [o, i] of r)
197
+ t[o] = i;
198
198
  return t;
199
- }, lt = /* @__PURE__ */ N(ct, [["__scopeId", "data-v-e770c4a0"]]), ut = { class: "analytics-chart" }, dt = /* @__PURE__ */ x({
199
+ }, dt = /* @__PURE__ */ P(ut, [["__scopeId", "data-v-e770c4a0"]]), pt = { class: "analytics-chart" }, yt = /* @__PURE__ */ S({
200
200
  __name: "BaseAnalyticsChartRenderer",
201
201
  props: {
202
202
  query: {},
@@ -209,55 +209,55 @@ const O = {
209
209
  },
210
210
  emits: ["edit-tile", "chart-data"],
211
211
  setup(e, { emit: r }) {
212
- const t = e, n = r, i = j(z), { i18n: o } = O.useI18n(), { evaluateFeatureFlag: c } = O.useEvaluateFeatureFlag(), a = c("ma-3043-analytics-chart-kebab-menu", !1), l = v(() => ({
212
+ const t = e, o = r, i = N(j), { i18n: n } = w.useI18n(), { evaluateFeatureFlag: s } = w.useEvaluateFeatureFlag(), a = s("ma-3043-analytics-chart-kebab-menu", !1), l = v(() => ({
213
213
  type: t.chartOptions.type,
214
214
  stacked: t.chartOptions.stacked ?? !1,
215
215
  chartDatasetColors: t.chartOptions.chartDatasetColors,
216
216
  threshold: t.chartOptions.threshold
217
- })), h = v(() => {
217
+ })), f = v(() => {
218
218
  if (i && i.exploreBaseUrl) {
219
- const y = {
219
+ const m = {
220
220
  filters: [...t.context.filters, ...t.query.filters ?? []],
221
221
  metrics: t.query.metrics ?? [],
222
222
  dimensions: t.query.dimensions ?? [],
223
223
  time_range: t.query.time_range || t.context.timeSpec
224
- }, T = ["advanced", "ai"].includes(t.query.datasource) ? t.query.datasource : "advanced";
225
- return `${i.exploreBaseUrl()}?q=${JSON.stringify(y)}&d=${T}&c=${t.chartOptions.type}`;
224
+ }, x = ["advanced", "ai"].includes(t.query.datasource) ? t.query.datasource : "advanced";
225
+ return `${i.exploreBaseUrl()}?q=${JSON.stringify(m)}&d=${x}&c=${t.chartOptions.type}`;
226
226
  }
227
227
  return "";
228
- }), D = () => {
229
- n("edit-tile");
230
- }, S = (y) => {
231
- n("chart-data", y);
228
+ }), A = () => {
229
+ o("edit-tile");
230
+ }, R = (m) => {
231
+ o("chart-data", m);
232
232
  };
233
- return (y, T) => {
234
- const k = L("KDropdownItem");
235
- return d(), g(Q, {
236
- context: y.context,
237
- query: y.query,
238
- "query-ready": y.queryReady,
239
- "refresh-counter": y.refreshCounter,
240
- onChartData: S
233
+ return (m, x) => {
234
+ const D = F("KDropdownItem");
235
+ return d(), b(H, {
236
+ context: m.context,
237
+ query: m.query,
238
+ "query-ready": m.queryReady,
239
+ "refresh-counter": m.refreshCounter,
240
+ onChartData: R
241
241
  }, {
242
- default: b(({ data: m }) => [
243
- P("div", ut, [
244
- I(u(Ce), ae({
245
- "allow-csv-export": y.chartOptions.allowCsvExport,
246
- "chart-data": m,
242
+ default: _(({ data: y }) => [
243
+ L("div", pt, [
244
+ T(c(Ee), ie({
245
+ "allow-csv-export": m.chartOptions.allowCsvExport,
246
+ "chart-data": y,
247
247
  "chart-options": l.value,
248
- "chart-title": !u(a) && y.chartOptions.chartTitle || "",
249
- "go-to-explore": h.value,
248
+ "chart-title": !c(a) && m.chartOptions.chartTitle || "",
249
+ "go-to-explore": f.value,
250
250
  "legend-position": "bottom",
251
- "show-menu": y.context.editable,
252
- "synthetics-data-key": y.chartOptions.syntheticsDataKey,
251
+ "show-menu": m.context.editable,
252
+ "synthetics-data-key": m.chartOptions.syntheticsDataKey,
253
253
  "tooltip-title": ""
254
- }, y.extraProps), ie({ _: 2 }, [
255
- y.context.editable ? {
254
+ }, m.extraProps), se({ _: 2 }, [
255
+ m.context.editable ? {
256
256
  name: "menu-items",
257
- fn: b(() => [
258
- I(k, { onClick: D }, {
259
- default: b(() => [
260
- B(F(u(o).t("renderer.edit")), 1)
257
+ fn: _(() => [
258
+ T(D, { onClick: A }, {
259
+ default: _(() => [
260
+ U(O(c(n).t("renderer.edit")), 1)
261
261
  ]),
262
262
  _: 1
263
263
  })
@@ -271,7 +271,7 @@ const O = {
271
271
  }, 8, ["context", "query", "query-ready", "refresh-counter"]);
272
272
  };
273
273
  }
274
- }), ce = /* @__PURE__ */ N(dt, [["__scopeId", "data-v-1bc587d3"]]), re = /* @__PURE__ */ x({
274
+ }), le = /* @__PURE__ */ P(yt, [["__scopeId", "data-v-1bc587d3"]]), te = /* @__PURE__ */ S({
275
275
  __name: "BarChartRenderer",
276
276
  props: {
277
277
  query: {},
@@ -282,7 +282,7 @@ const O = {
282
282
  refreshCounter: {}
283
283
  },
284
284
  setup(e) {
285
- return (r, t) => (d(), g(ce, {
285
+ return (r, t) => (d(), b(le, {
286
286
  "chart-options": r.chartOptions,
287
287
  context: r.context,
288
288
  "extra-props": { showAnnotations: !1 },
@@ -292,7 +292,7 @@ const O = {
292
292
  "refresh-counter": r.refreshCounter
293
293
  }, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
294
294
  }
295
- }), ne = /* @__PURE__ */ x({
295
+ }), re = /* @__PURE__ */ S({
296
296
  __name: "TimeseriesChartRenderer",
297
297
  props: {
298
298
  query: {},
@@ -303,7 +303,7 @@ const O = {
303
303
  refreshCounter: {}
304
304
  },
305
305
  setup(e) {
306
- return (r, t) => (d(), g(ce, {
306
+ return (r, t) => (d(), b(le, {
307
307
  "chart-options": r.chartOptions,
308
308
  context: r.context,
309
309
  height: r.height,
@@ -312,7 +312,7 @@ const O = {
312
312
  "refresh-counter": r.refreshCounter
313
313
  }, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
314
314
  }
315
- }), pt = { class: "metric-card-tile-wrapper" }, yt = /* @__PURE__ */ x({
315
+ }), ht = { class: "metric-card-tile-wrapper" }, mt = /* @__PURE__ */ S({
316
316
  __name: "GoldenSignalsRenderer",
317
317
  props: {
318
318
  query: {},
@@ -323,35 +323,35 @@ const O = {
323
323
  refreshCounter: {}
324
324
  },
325
325
  setup(e) {
326
- M((c) => ({
327
- "3e99e905": u(n) ? "90%" : "100%",
328
- "345e89d8": u(n) ? "auto" : "100%",
329
- "7fa58fd9": u(n) ? "100%" : "none"
326
+ K((s) => ({
327
+ "3e99e905": c(o) ? "90%" : "100%",
328
+ "345e89d8": c(o) ? "auto" : "100%",
329
+ "7fa58fd9": c(o) ? "100%" : "none"
330
330
  }));
331
- const r = e, { evaluateFeatureFlag: t } = O.useEvaluateFeatureFlag(), n = t("ma-3043-analytics-chart-kebab-menu", !1), i = v(() => {
332
- const c = r.context.timeSpec;
333
- if (c.type === "absolute")
334
- return new ke({
331
+ const r = e, { evaluateFeatureFlag: t } = w.useEvaluateFeatureFlag(), o = t("ma-3043-analytics-chart-kebab-menu", !1), i = v(() => {
332
+ const s = r.context.timeSpec;
333
+ if (s.type === "absolute")
334
+ return new Ie({
335
335
  key: "custom",
336
336
  timeframeText: "custom",
337
337
  display: "custom",
338
- startCustom: c.start,
339
- endCustom: c.end,
340
- timeframeLength: () => c.end.getTime() - c.start.getTime(),
338
+ startCustom: s.start,
339
+ endCustom: s.end,
340
+ timeframeLength: () => s.end.getTime() - s.start.getTime(),
341
341
  defaultResponseGranularity: "daily",
342
342
  dataGranularity: "daily",
343
343
  isRelative: !1,
344
344
  allowedTiers: ["free", "plus", "enterprise"]
345
345
  });
346
- const a = we.get(c.time_range);
346
+ const a = we.get(s.time_range);
347
347
  if (!a)
348
348
  throw new Error("Unknown time range");
349
349
  return a;
350
- }), o = v(() => {
350
+ }), n = v(() => {
351
351
  var a, l;
352
- const c = (a = r.query) == null ? void 0 : a.datasource;
353
- if (c && c !== "advanced" && c !== "basic")
354
- throw new Error(`Invalid datasource value: ${c}`);
352
+ const s = (a = r.query) == null ? void 0 : a.datasource;
353
+ if (s && s !== "advanced" && s !== "basic")
354
+ throw new Error(`Invalid datasource value: ${s}`);
355
355
  return {
356
356
  datasource: (l = r.query) == null ? void 0 : l.datasource,
357
357
  overrideTimeframe: i.value,
@@ -359,24 +359,24 @@ const O = {
359
359
  additionalFilter: r.context.filters,
360
360
  // TODO: Decide how to handle metric card filters.
361
361
  longCardTitles: r.chartOptions.longCardTitles,
362
- ...!n && { containerTitle: r.chartOptions.chartTitle },
363
- ...!n && { description: r.chartOptions.description },
362
+ ...!o && { containerTitle: r.chartOptions.chartTitle },
363
+ ...!o && { description: r.chartOptions.description },
364
364
  percentileLatency: r.chartOptions.percentileLatency,
365
365
  refreshInterval: r.context.refreshInterval,
366
366
  queryReady: r.queryReady,
367
367
  refreshCounter: r.refreshCounter
368
368
  };
369
369
  });
370
- return (c, a) => (d(), R("div", pt, [
371
- I(u(Ve), he(me(o.value)), {
372
- default: b(() => [
373
- I(u(Ue))
370
+ return (s, a) => (d(), E("div", ht, [
371
+ T(c(Ue), me(fe(n.value)), {
372
+ default: _(() => [
373
+ T(c(Ge))
374
374
  ]),
375
375
  _: 1
376
376
  }, 16)
377
377
  ]));
378
378
  }
379
- }), ht = /* @__PURE__ */ N(yt, [["__scopeId", "data-v-84c4c1c8"]]), mt = "#6c7489", ft = "20px", le = "20px", gt = /* @__PURE__ */ x({
379
+ }), ft = /* @__PURE__ */ P(mt, [["__scopeId", "data-v-84c4c1c8"]]), oe = "#6c7489", ne = "20px", ue = "20px", gt = /* @__PURE__ */ S({
380
380
  __name: "TopNTableRenderer",
381
381
  props: {
382
382
  query: {},
@@ -387,33 +387,33 @@ const O = {
387
387
  refreshCounter: {}
388
388
  },
389
389
  setup(e) {
390
- const r = e, { evaluateFeatureFlag: t } = O.useEvaluateFeatureFlag(), n = t("ma-3043-analytics-chart-kebab-menu", !1), i = (o) => {
391
- var c;
392
- if ((c = r.chartOptions) != null && c.entityLink)
393
- if (o.id.includes(":")) {
394
- const [a, l] = o.id.split(":");
395
- return r.chartOptions.entityLink.replace(nt, a).replace(te, l);
390
+ const r = e, { evaluateFeatureFlag: t } = w.useEvaluateFeatureFlag(), o = t("ma-3043-analytics-chart-kebab-menu", !1), i = (n) => {
391
+ var s;
392
+ if ((s = r.chartOptions) != null && s.entityLink)
393
+ if (n.id.includes(":")) {
394
+ const [a, l] = n.id.split(":");
395
+ return r.chartOptions.entityLink.replace(at, a).replace(ee, l);
396
396
  } else
397
- return r.chartOptions.entityLink.replace(te, o.id);
397
+ return r.chartOptions.entityLink.replace(ee, n.id);
398
398
  return "";
399
399
  };
400
- return (o, c) => (d(), g(Q, {
401
- context: o.context,
402
- query: o.query,
403
- "query-ready": o.queryReady,
404
- "refresh-counter": o.refreshCounter
400
+ return (n, s) => (d(), b(H, {
401
+ context: n.context,
402
+ query: n.query,
403
+ "query-ready": n.queryReady,
404
+ "refresh-counter": n.refreshCounter
405
405
  }, {
406
- default: b(({ data: a }) => [
407
- I(u(Se), {
406
+ default: _(({ data: a }) => [
407
+ T(c(Se), {
408
408
  data: a,
409
- description: !u(n) && o.chartOptions.description || "",
410
- "synthetics-data-key": o.chartOptions.syntheticsDataKey,
411
- title: !u(n) && o.chartOptions.chartTitle || ""
412
- }, ie({ _: 2 }, [
409
+ description: !c(o) && n.chartOptions.description || "",
410
+ "synthetics-data-key": n.chartOptions.syntheticsDataKey,
411
+ title: !c(o) && n.chartOptions.chartTitle || ""
412
+ }, se({ _: 2 }, [
413
413
  r.chartOptions.entityLink ? {
414
414
  name: "name",
415
- fn: b(({ record: l }) => [
416
- I(u(Ge), {
415
+ fn: _(({ record: l }) => [
416
+ T(c(He), {
417
417
  "entity-link-data": {
418
418
  id: l.id,
419
419
  label: l.name,
@@ -429,153 +429,145 @@ const O = {
429
429
  _: 1
430
430
  }, 8, ["context", "query", "query-ready", "refresh-counter"]));
431
431
  }
432
- }), vt = {
432
+ }), vt = { class: "tile-boundary" }, bt = {
433
433
  key: 0,
434
434
  class: "tile-header"
435
- }, bt = { class: "title" }, _t = {
436
- appearance: "none",
437
- class: "kebab-action-menu",
438
- "data-testid": "kebab-action-menu"
439
- }, qt = {
435
+ }, _t = { class: "title" }, qt = {
436
+ key: 0,
437
+ class: "tile-actions"
438
+ }, Ct = {
440
439
  class: "chart-export-trigger",
441
440
  "data-testid": "csv-export-button"
442
- }, Ct = {
441
+ }, Et = {
443
442
  key: 1,
444
443
  class: "header-description"
445
- }, St = { class: "tile-content" }, Et = /* @__PURE__ */ x({
444
+ }, St = { class: "tile-content" }, xt = /* @__PURE__ */ S({
446
445
  __name: "DashboardTile",
447
446
  props: {
448
447
  definition: {},
449
448
  context: {},
450
- height: { default: V },
449
+ height: { default: B },
451
450
  queryReady: { type: Boolean },
452
451
  refreshCounter: {}
453
452
  },
454
453
  emits: ["edit-tile"],
455
454
  setup(e, { emit: r }) {
456
- M((s) => ({
457
- "6018253a": `${s.height}px`,
458
- "313a3e66": S.value ? 1 : 0,
459
- "7265bedf": S.value ? "visible" : "hidden"
455
+ K((u) => ({
456
+ "550edf72": `${u.height}px`
460
457
  }));
461
- const t = parseInt(le, 10), n = e, i = r, o = j(z), { evaluateFeatureFlag: c } = O.useEvaluateFeatureFlag(), { i18n: a } = O.useI18n(), l = c("ma-3043-analytics-chart-kebab-menu", !1), h = A(), D = A(!1), S = A(!1), y = v(() => {
462
- if (o && o.exploreBaseUrl) {
463
- const s = {
464
- filters: [...n.context.filters, ...n.definition.query.filters ?? []],
465
- metrics: n.definition.query.metrics ?? [],
466
- dimensions: n.definition.query.dimensions ?? [],
467
- time_range: n.definition.query.time_range || n.context.timeSpec
468
- }, E = ["advanced", "ai"].includes(n.definition.query.datasource) ? n.definition.query.datasource : "advanced";
469
- return `${o.exploreBaseUrl()}?q=${JSON.stringify(s)}&d=${E}&c=${n.definition.chart.type}`;
458
+ const t = parseInt(ue, 10), o = e, i = r, n = N(j), { evaluateFeatureFlag: s } = w.useEvaluateFeatureFlag(), { i18n: a } = w.useI18n(), l = s("ma-3043-analytics-chart-kebab-menu", !1), f = I(), A = I(!1), R = v(() => {
459
+ if (n && n.exploreBaseUrl) {
460
+ const u = {
461
+ filters: [...o.context.filters, ...o.definition.query.filters ?? []],
462
+ metrics: o.definition.query.metrics ?? [],
463
+ dimensions: o.definition.query.dimensions ?? [],
464
+ time_range: o.definition.query.time_range || o.context.timeSpec
465
+ }, h = ["advanced", "ai"].includes(o.definition.query.datasource) ? o.definition.query.datasource : "advanced";
466
+ return `${n.exploreBaseUrl()}?q=${JSON.stringify(u)}&d=${h}&c=${o.definition.chart.type}`;
470
467
  }
471
468
  return "";
472
- }), T = v(() => a.t("csvExport.defaultFilename")), k = v(() => l && !["golden_signals", "top_n", "gauge"].includes(n.definition.chart.type)), m = {
473
- timeseries_line: ne,
474
- timeseries_bar: ne,
475
- horizontal_bar: re,
476
- vertical_bar: re,
477
- gauge: lt,
478
- golden_signals: ht,
469
+ }), m = v(() => a.t("csvExport.defaultFilename")), x = v(() => l && !["golden_signals", "top_n", "gauge"].includes(o.definition.chart.type)), D = {
470
+ timeseries_line: re,
471
+ timeseries_bar: re,
472
+ horizontal_bar: te,
473
+ vertical_bar: te,
474
+ gauge: dt,
475
+ golden_signals: ft,
479
476
  top_n: gt,
480
477
  slottable: void 0
481
- }, _ = v(() => {
482
- const s = m[n.definition.chart.type];
483
- return s && {
484
- component: s,
478
+ }, y = v(() => {
479
+ const u = D[o.definition.chart.type];
480
+ return u && {
481
+ component: u,
485
482
  rendererProps: {
486
- query: n.definition.query,
487
- context: n.context,
488
- queryReady: n.queryReady,
489
- chartOptions: n.definition.chart,
490
- height: n.height - t * 2,
491
- refreshCounter: n.refreshCounter
483
+ query: o.definition.query,
484
+ context: o.context,
485
+ queryReady: o.queryReady,
486
+ chartOptions: o.definition.chart,
487
+ height: o.height - t * 2,
488
+ refreshCounter: o.refreshCounter
492
489
  }
493
490
  };
494
- }), p = () => {
495
- i("edit-tile", n.definition);
496
- }, f = (s) => {
497
- h.value = s;
498
- }, q = (s) => {
499
- D.value = s;
500
- }, C = () => {
501
- q(!0);
491
+ }), C = () => {
492
+ i("edit-tile", o.definition);
493
+ }, p = (u) => {
494
+ f.value = u;
495
+ }, g = (u) => {
496
+ A.value = u;
497
+ }, q = () => {
498
+ g(!0);
502
499
  };
503
- return (s, E) => {
504
- const $ = L("KDropdownItem"), G = L("KDropdown");
505
- return d(), R("div", {
506
- class: "tile-boundary",
507
- onMouseenter: E[1] || (E[1] = (X) => S.value = !0),
508
- onMouseleave: E[2] || (E[2] = (X) => S.value = !1)
509
- }, [
510
- u(l) && s.definition.chart.type !== "slottable" ? (d(), R("div", vt, [
511
- P("div", bt, F(s.definition.chart.chartTitle), 1),
512
- k.value ? (d(), g(G, {
513
- key: 0,
514
- class: "dropdown",
515
- "data-testid": "chart-action-menu",
516
- "kpop-attributes": { placement: "bottom-end" }
517
- }, {
518
- items: b(() => [
519
- y.value ? (d(), g($, {
520
- key: 0,
521
- "data-testid": "chart-jump-to-explore",
522
- item: { label: u(a).t("jumpToExplore"), to: y.value }
523
- }, null, 8, ["item"])) : w("", !0),
524
- "allowCsvExport" in s.definition.chart && s.definition.chart.allowCsvExport ? (d(), g($, {
525
- key: 1,
526
- class: "chart-export-button",
527
- "data-testid": "chart-csv-export",
528
- onClick: E[0] || (E[0] = (X) => C())
529
- }, {
530
- default: b(() => [
531
- P("span", qt, F(u(a).t("csvExport.exportAsCsv")), 1)
532
- ]),
533
- _: 1
534
- })) : w("", !0),
535
- s.context.editable ? (d(), g($, {
536
- key: 2,
537
- onClick: p
538
- }, {
539
- default: b(() => [
540
- B(F(u(a).t("renderer.edit")), 1)
541
- ]),
542
- _: 1
543
- })) : w("", !0)
544
- ]),
545
- default: b(() => [
546
- P("button", _t, [
547
- I(u(He), {
548
- color: u(mt),
549
- size: u(ft)
500
+ return (u, h) => {
501
+ const $ = F("KDropdownItem"), M = F("KDropdown");
502
+ return d(), E("div", vt, [
503
+ c(l) && u.definition.chart.type !== "slottable" ? (d(), E("div", bt, [
504
+ L("div", _t, O(u.definition.chart.chartTitle), 1),
505
+ x.value ? (d(), E("div", qt, [
506
+ u.context.editable ? (d(), b(c(Qe), {
507
+ key: 0,
508
+ class: "edit-icon",
509
+ color: c(oe),
510
+ size: c(ne),
511
+ onClick: C
512
+ }, null, 8, ["color", "size"])) : k("", !0),
513
+ T(M, {
514
+ class: "dropdown",
515
+ "data-testid": "chart-action-menu",
516
+ "kpop-attributes": { placement: "bottom-end" }
517
+ }, {
518
+ items: _(() => [
519
+ R.value ? (d(), b($, {
520
+ key: 0,
521
+ "data-testid": "chart-jump-to-explore",
522
+ item: { label: c(a).t("jumpToExplore"), to: R.value }
523
+ }, null, 8, ["item"])) : k("", !0),
524
+ "allowCsvExport" in u.definition.chart && u.definition.chart.allowCsvExport ? (d(), b($, {
525
+ key: 1,
526
+ class: "chart-export-button",
527
+ "data-testid": "chart-csv-export",
528
+ onClick: h[0] || (h[0] = (Y) => q())
529
+ }, {
530
+ default: _(() => [
531
+ L("span", Ct, O(c(a).t("csvExport.exportAsCsv")), 1)
532
+ ]),
533
+ _: 1
534
+ })) : k("", !0)
535
+ ]),
536
+ default: _(() => [
537
+ T(c(Je), {
538
+ class: "kebab-action-menu",
539
+ color: c(oe),
540
+ "data-testid": "kebab-action-menu",
541
+ size: c(ne)
550
542
  }, null, 8, ["color", "size"])
551
- ])
552
- ]),
553
- _: 1
554
- })) : "description" in s.definition.chart ? (d(), R("div", Ct, F(s.definition.chart.description), 1)) : w("", !0),
555
- D.value ? (d(), g(u(Ee), {
543
+ ]),
544
+ _: 1
545
+ })
546
+ ])) : "description" in u.definition.chart ? (d(), E("div", Et, O(u.definition.chart.description), 1)) : k("", !0),
547
+ A.value ? (d(), b(c(xe), {
556
548
  key: 2,
557
- "chart-data": h.value,
558
- filename: T.value,
559
- onToggleModal: q
560
- }, null, 8, ["chart-data", "filename"])) : w("", !0)
561
- ])) : w("", !0),
562
- P("div", St, [
563
- _.value ? (d(), g(fe(_.value.component), ae({ key: 0 }, _.value.rendererProps, { onChartData: f }), null, 16)) : w("", !0)
549
+ "chart-data": f.value,
550
+ filename: m.value,
551
+ onToggleModal: g
552
+ }, null, 8, ["chart-data", "filename"])) : k("", !0)
553
+ ])) : k("", !0),
554
+ L("div", St, [
555
+ y.value ? (d(), b(ge(y.value.component), ie({ key: 0 }, y.value.rendererProps, { onChartData: p }), null, 16)) : k("", !0)
564
556
  ])
565
- ], 32);
557
+ ]);
566
558
  };
567
559
  }
568
- }), xt = /* @__PURE__ */ N(Et, [["__scopeId", "data-v-25af9802"]]), Tt = (e, r, t) => {
569
- const n = /* @__PURE__ */ new Map();
570
- t.forEach((o) => {
571
- const c = o.layout.position.row, a = n.get(c), l = o.layout.size.rows === 1 && !!o.layout.size.fitToContent;
572
- a === void 0 ? n.set(c, l) : n.set(c, a && l);
560
+ }), Tt = /* @__PURE__ */ P(xt, [["__scopeId", "data-v-a0c57f56"]]), At = (e, r, t) => {
561
+ const o = /* @__PURE__ */ new Map();
562
+ t.forEach((n) => {
563
+ const s = n.layout.position.row, a = o.get(s), l = n.layout.size.rows === 1 && !!n.layout.size.fitToContent;
564
+ a === void 0 ? o.set(s, l) : o.set(s, a && l);
573
565
  });
574
566
  const i = [];
575
- for (let o = 0; o < e; o++)
576
- n.get(o) ? i.push("auto") : i.push(`${r}px`);
567
+ for (let n = 0; n < e; n++)
568
+ o.get(n) ? i.push("auto") : i.push(`${r}px`);
577
569
  return i;
578
- }, At = /* @__PURE__ */ x({
570
+ }, Rt = /* @__PURE__ */ S({
579
571
  __name: "GridLayout",
580
572
  props: {
581
573
  gridSize: {
@@ -585,7 +577,7 @@ const O = {
585
577
  tileHeight: {
586
578
  type: Number,
587
579
  required: !1,
588
- default: () => V
580
+ default: () => B
589
581
  },
590
582
  tiles: {
591
583
  type: Array,
@@ -593,24 +585,24 @@ const O = {
593
585
  }
594
586
  },
595
587
  setup(e) {
596
- M((a) => ({
588
+ K((a) => ({
597
589
  "3bc5e939": e.gridSize.cols,
598
- "77aa3028": o.value
590
+ "77aa3028": n.value
599
591
  }));
600
- const r = e, t = A(null), n = A(0), i = new ResizeObserver((a) => {
592
+ const r = e, t = I(null), o = I(0), i = new ResizeObserver((a) => {
601
593
  window.requestAnimationFrame(() => {
602
- !Array.isArray(a) || !a.length || (n.value = a[0].contentRect.width);
594
+ !Array.isArray(a) || !a.length || (o.value = a[0].contentRect.width);
603
595
  });
604
596
  });
605
- ge(() => {
597
+ ve(() => {
606
598
  t.value && i.observe(t.value);
607
- }), oe(() => {
599
+ }), ae(() => {
608
600
  t.value && i.unobserve(t.value);
609
601
  });
610
- const o = v(() => {
602
+ const n = v(() => {
611
603
  var l;
612
- return Tt((l = r.gridSize) == null ? void 0 : l.rows, r.tileHeight, r.tiles).join(" ");
613
- }), c = v(() => r.tiles.map((a, l) => ({
604
+ return At((l = r.gridSize) == null ? void 0 : l.rows, r.tileHeight, r.tiles).join(" ");
605
+ }), s = v(() => r.tiles.map((a, l) => ({
614
606
  key: `tile-${l}`,
615
607
  tile: a,
616
608
  style: {
@@ -620,29 +612,29 @@ const O = {
620
612
  "grid-row-end": a.layout.position.row + 1 + a.layout.size.rows
621
613
  }
622
614
  })));
623
- return (a, l) => (d(), R("div", {
615
+ return (a, l) => (d(), E("div", {
624
616
  ref_key: "gridContainer",
625
617
  ref: t,
626
618
  class: "kong-ui-public-grid-layout"
627
619
  }, [
628
- (d(!0), R(ve, null, be(c.value, (h) => (d(), R("div", {
629
- key: h.key,
630
- class: _e(["grid-cell", {
631
- "empty-cell": !h.tile
620
+ (d(!0), E(be, null, _e(s.value, (f) => (d(), E("div", {
621
+ key: f.key,
622
+ class: qe(["grid-cell", {
623
+ "empty-cell": !f.tile
632
624
  }]),
633
- style: ee(h.style)
625
+ style: X(f.style)
634
626
  }, [
635
- H(a.$slots, "tile", {
636
- style: ee(h.style),
637
- tile: h.tile
627
+ G(a.$slots, "tile", {
628
+ style: X(f.style),
629
+ tile: f.tile
638
630
  }, void 0, !0)
639
631
  ], 6))), 128))
640
632
  ], 512));
641
633
  }
642
- }), Rt = /* @__PURE__ */ N(At, [["__scopeId", "data-v-f43eb7b8"]]), Dt = { class: "kong-ui-public-dashboard-renderer" }, kt = {
634
+ }), Dt = /* @__PURE__ */ P(Rt, [["__scopeId", "data-v-f43eb7b8"]]), kt = { class: "kong-ui-public-dashboard-renderer" }, It = {
643
635
  key: 0,
644
636
  class: "tile-container"
645
- }, wt = /* @__PURE__ */ x({
637
+ }, wt = /* @__PURE__ */ S({
646
638
  __name: "DashboardRenderer",
647
639
  props: {
648
640
  context: {},
@@ -650,18 +642,18 @@ const O = {
650
642
  },
651
643
  emits: ["edit-tile"],
652
644
  setup(e, { expose: r, emit: t }) {
653
- const n = e, i = t, { i18n: o } = O.useI18n(), c = A(0), a = j(z);
645
+ const o = e, i = t, { i18n: n } = w.useI18n(), s = I(0), a = N(j);
654
646
  a || (console.warn("Analytics dashboards require a query bridge supplied via provide / inject."), console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"), console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements"));
655
- const l = Qe(), h = v(() => n.context.timeSpec ? n.context.timeSpec : {
647
+ const l = Ze(), f = v(() => o.context.timeSpec ? o.context.timeSpec : {
656
648
  type: "relative",
657
649
  time_range: l.defaultQueryTimeForOrg
658
- }), D = v(() => !!n.context.timeSpec || !l.loading), S = v(() => n.config.tiles.map((m, _) => {
659
- var f;
660
- let p = m.definition;
650
+ }), A = v(() => !!o.context.timeSpec || !l.loading), R = v(() => o.config.tiles.map((y, C) => {
651
+ var g;
652
+ let p = y.definition;
661
653
  if ("description" in p.chart) {
662
- const q = (f = p.chart.description) == null ? void 0 : f.replace(ot, () => {
663
- const s = `renderer.trendRange.${h.value.type === "absolute" ? "custom" : h.value.time_range}`;
664
- return o.te(s) ? o.t(s) : "";
654
+ const q = (g = p.chart.description) == null ? void 0 : g.replace(it, () => {
655
+ const h = `renderer.trendRange.${f.value.type === "absolute" ? "custom" : f.value.time_range}`;
656
+ return n.te(h) ? n.t(h) : "";
665
657
  });
666
658
  p = {
667
659
  ...p,
@@ -672,62 +664,62 @@ const O = {
672
664
  };
673
665
  }
674
666
  return {
675
- layout: m.layout,
667
+ layout: y.layout,
676
668
  meta: p,
677
669
  // Add a unique key to each tile internally.
678
- id: _
670
+ id: C
679
671
  };
680
- })), y = v(() => {
681
- let { tz: m, refreshInterval: _, editable: p } = n.context;
682
- return m || (m = new Intl.DateTimeFormat().resolvedOptions().timeZone), _ === void 0 && (_ = at), p === void 0 && (p = !1), {
683
- ...n.context,
684
- tz: m,
685
- timeSpec: h.value,
686
- refreshInterval: _,
672
+ })), m = v(() => {
673
+ let { tz: y, refreshInterval: C, editable: p } = o.context;
674
+ return y || (y = new Intl.DateTimeFormat().resolvedOptions().timeZone), C === void 0 && (C = st), p === void 0 && (p = !1), {
675
+ ...o.context,
676
+ tz: y,
677
+ timeSpec: f.value,
678
+ refreshInterval: C,
687
679
  editable: p
688
680
  };
689
- }), T = (m) => {
690
- i("edit-tile", m);
681
+ }), x = (y) => {
682
+ i("edit-tile", y);
691
683
  };
692
684
  return r({ refresh: () => {
693
- c.value++;
694
- } }), (m, _) => {
695
- const p = L("KAlert");
696
- return d(), R("div", Dt, [
697
- u(a) ? (d(), g(Rt, {
685
+ s.value++;
686
+ } }), (y, C) => {
687
+ const p = F("KAlert");
688
+ return d(), E("div", kt, [
689
+ c(a) ? (d(), b(Dt, {
698
690
  key: 1,
699
- "grid-size": m.config.gridSize,
700
- "tile-height": m.config.tileHeight,
701
- tiles: S.value
691
+ "grid-size": y.config.gridSize,
692
+ "tile-height": y.config.tileHeight,
693
+ tiles: R.value
702
694
  }, {
703
- tile: b(({ tile: f }) => [
704
- f.meta.chart.type === "slottable" ? (d(), R("div", kt, [
705
- H(m.$slots, f.meta.chart.id, {}, void 0, !0)
706
- ])) : (d(), g(xt, {
695
+ tile: _(({ tile: g }) => [
696
+ g.meta.chart.type === "slottable" ? (d(), E("div", It, [
697
+ G(y.$slots, g.meta.chart.id, {}, void 0, !0)
698
+ ])) : (d(), b(Tt, {
707
699
  key: 1,
708
700
  class: "tile-container",
709
- context: y.value,
710
- definition: f.meta,
711
- height: f.layout.size.rows * (m.config.tileHeight || u(V)) + parseInt(u(le), 10),
712
- "query-ready": D.value,
713
- "refresh-counter": c.value,
714
- onEditTile: (q) => T(f)
701
+ context: m.value,
702
+ definition: g.meta,
703
+ height: g.layout.size.rows * (y.config.tileHeight || c(B)) + parseInt(c(ue), 10),
704
+ "query-ready": A.value,
705
+ "refresh-counter": s.value,
706
+ onEditTile: (q) => x(g)
715
707
  }, null, 8, ["context", "definition", "height", "query-ready", "refresh-counter", "onEditTile"]))
716
708
  ]),
717
709
  _: 3
718
- }, 8, ["grid-size", "tile-height", "tiles"])) : (d(), g(p, {
710
+ }, 8, ["grid-size", "tile-height", "tiles"])) : (d(), b(p, {
719
711
  key: 0,
720
712
  appearance: "danger"
721
713
  }, {
722
- default: b(() => [
723
- B(F(u(o).t("renderer.noQueryBridge")), 1)
714
+ default: _(() => [
715
+ U(O(c(n).t("renderer.noQueryBridge")), 1)
724
716
  ]),
725
717
  _: 1
726
718
  }))
727
719
  ]);
728
720
  };
729
721
  }
730
- }), nr = /* @__PURE__ */ N(wt, [["__scopeId", "data-v-26130807"]]), or = [
722
+ }), nr = /* @__PURE__ */ P(wt, [["__scopeId", "data-v-26130807"]]), ar = [
731
723
  "horizontal_bar",
732
724
  "vertical_bar",
733
725
  "gauge",
@@ -736,13 +728,13 @@ const O = {
736
728
  "golden_signals",
737
729
  "top_n",
738
730
  "slottable"
739
- ], U = {
731
+ ], V = {
740
732
  type: "string"
741
- }, K = {
733
+ }, z = {
742
734
  type: "string"
743
- }, ue = {
744
- type: "boolean"
745
735
  }, de = {
736
+ type: "boolean"
737
+ }, pe = {
746
738
  type: ["object", "array"],
747
739
  items: {
748
740
  type: "string"
@@ -750,7 +742,7 @@ const O = {
750
742
  additionalProperties: {
751
743
  type: "string"
752
744
  }
753
- }, It = {
745
+ }, Ot = {
754
746
  type: "object",
755
747
  properties: {
756
748
  type: {
@@ -763,7 +755,7 @@ const O = {
763
755
  },
764
756
  required: ["type", "id"],
765
757
  additionalProperties: !1
766
- }, Ot = {
758
+ }, Ft = {
767
759
  type: "object",
768
760
  properties: {
769
761
  type: {
@@ -773,14 +765,14 @@ const O = {
773
765
  stacked: {
774
766
  type: "boolean"
775
767
  },
776
- chartDatasetColors: de,
777
- syntheticsDataKey: U,
778
- chartTitle: K,
779
- allowCsvExport: ue
768
+ chartDatasetColors: pe,
769
+ syntheticsDataKey: V,
770
+ chartTitle: z,
771
+ allowCsvExport: de
780
772
  },
781
773
  required: ["type"],
782
774
  additionalProperties: !1
783
- }, Ft = {
775
+ }, Pt = {
784
776
  type: "object",
785
777
  properties: {
786
778
  type: {
@@ -796,14 +788,14 @@ const O = {
796
788
  type: "number"
797
789
  }
798
790
  },
799
- chartDatasetColors: de,
800
- syntheticsDataKey: U,
801
- chartTitle: K,
802
- allowCsvExport: ue
791
+ chartDatasetColors: pe,
792
+ syntheticsDataKey: V,
793
+ chartTitle: z,
794
+ allowCsvExport: de
803
795
  },
804
796
  required: ["type"],
805
797
  additionalProperties: !1
806
- }, Pt = {
798
+ }, Lt = {
807
799
  type: "object",
808
800
  properties: {
809
801
  type: {
@@ -812,7 +804,7 @@ const O = {
812
804
  },
813
805
  metricDisplay: {
814
806
  type: "string",
815
- enum: Object.values(xe)
807
+ enum: Object.values(Te)
816
808
  },
817
809
  reverseDataset: {
818
810
  type: "boolean"
@@ -820,16 +812,16 @@ const O = {
820
812
  numerator: {
821
813
  type: "number"
822
814
  },
823
- syntheticsDataKey: U,
824
- chartTitle: K
815
+ syntheticsDataKey: V,
816
+ chartTitle: z
825
817
  },
826
818
  required: ["type"],
827
819
  additionalProperties: !1
828
- }, Lt = {
820
+ }, Nt = {
829
821
  type: "object",
830
822
  properties: {
831
- chartTitle: K,
832
- syntheticsDataKey: U,
823
+ chartTitle: z,
824
+ syntheticsDataKey: V,
833
825
  type: {
834
826
  type: "string",
835
827
  enum: ["top_n"]
@@ -843,10 +835,10 @@ const O = {
843
835
  },
844
836
  required: ["type"],
845
837
  additionalProperties: !1
846
- }, Nt = {
838
+ }, jt = {
847
839
  type: "object",
848
840
  properties: {
849
- chartTitle: K,
841
+ chartTitle: z,
850
842
  type: {
851
843
  type: "string",
852
844
  enum: ["golden_signals"]
@@ -863,7 +855,7 @@ const O = {
863
855
  },
864
856
  required: ["type"],
865
857
  additionalProperties: !1
866
- }, $t = {
858
+ }, zt = {
867
859
  type: "object",
868
860
  properties: {
869
861
  tz: {
@@ -887,7 +879,7 @@ const O = {
887
879
  "time_range"
888
880
  ],
889
881
  additionalProperties: !1
890
- }, jt = {
882
+ }, $t = {
891
883
  type: "object",
892
884
  description: "A duration representing an exact start and end time.",
893
885
  properties: {
@@ -913,18 +905,18 @@ const O = {
913
905
  "end"
914
906
  ],
915
907
  additionalProperties: !1
916
- }, J = {
908
+ }, Q = {
917
909
  granularity: {
918
910
  type: "string",
919
911
  description: 'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',
920
- enum: Ie
912
+ enum: Oe
921
913
  },
922
914
  time_range: {
923
915
  type: "object",
924
916
  description: "The time range to query.",
925
917
  anyOf: [
926
- $t,
927
- jt
918
+ zt,
919
+ $t
928
920
  ],
929
921
  default: {
930
922
  type: "relative",
@@ -937,14 +929,14 @@ const O = {
937
929
  meta: {
938
930
  type: "object"
939
931
  }
940
- }, Z = (e) => ({
932
+ }, J = (e) => ({
941
933
  type: "array",
942
934
  description: "List of aggregated metrics to collect across the requested time span.",
943
935
  items: {
944
936
  type: "string",
945
937
  enum: e
946
938
  }
947
- }), W = (e) => ({
939
+ }), Z = (e) => ({
948
940
  type: "array",
949
941
  description: "List of attributes or entity types to group by.",
950
942
  minItems: 0,
@@ -953,7 +945,7 @@ const O = {
953
945
  type: "string",
954
946
  enum: e
955
947
  }
956
- }), Y = (e) => ({
948
+ }), W = (e) => ({
957
949
  type: "array",
958
950
  description: "A list of filters to apply to the query.",
959
951
  items: {
@@ -966,7 +958,7 @@ const O = {
966
958
  },
967
959
  type: {
968
960
  type: "string",
969
- enum: Oe
961
+ enum: Fe
970
962
  },
971
963
  values: {
972
964
  type: "array",
@@ -982,7 +974,7 @@ const O = {
982
974
  ],
983
975
  additionalProperties: !1
984
976
  }
985
- }), zt = {
977
+ }), Kt = {
986
978
  type: "object",
987
979
  description: "A query to launch at the advanced explore API",
988
980
  properties: {
@@ -992,14 +984,14 @@ const O = {
992
984
  "advanced"
993
985
  ]
994
986
  },
995
- metrics: Z(Fe),
996
- dimensions: W(Pe),
997
- filters: Y(Le),
998
- ...J
987
+ metrics: J(Pe),
988
+ dimensions: Z(Le),
989
+ filters: W(Ne),
990
+ ...Q
999
991
  },
1000
992
  required: ["datasource"],
1001
993
  additionalProperties: !1
1002
- }, Kt = {
994
+ }, Bt = {
1003
995
  type: "object",
1004
996
  description: "A query to launch at the basic explore API",
1005
997
  properties: {
@@ -1009,14 +1001,14 @@ const O = {
1009
1001
  "basic"
1010
1002
  ]
1011
1003
  },
1012
- metrics: Z(Ne),
1013
- dimensions: W($e),
1014
- filters: Y(je),
1015
- ...J
1004
+ metrics: J(je),
1005
+ dimensions: Z(ze),
1006
+ filters: W($e),
1007
+ ...Q
1016
1008
  },
1017
1009
  required: ["datasource"],
1018
1010
  additionalProperties: !1
1019
- }, Bt = {
1011
+ }, Vt = {
1020
1012
  type: "object",
1021
1013
  description: "A query to launch at the AI explore API",
1022
1014
  properties: {
@@ -1026,26 +1018,26 @@ const O = {
1026
1018
  "ai"
1027
1019
  ]
1028
1020
  },
1029
- metrics: Z(ze),
1030
- dimensions: W(Ke),
1031
- filters: Y(Be),
1032
- ...J
1021
+ metrics: J(Ke),
1022
+ dimensions: Z(Be),
1023
+ filters: W(Ve),
1024
+ ...Q
1033
1025
  },
1034
1026
  required: ["datasource"],
1035
1027
  additionalProperties: !1
1036
1028
  }, Mt = {
1037
- anyOf: [zt, Kt, Bt]
1038
- }, Vt = {
1029
+ anyOf: [Kt, Bt, Vt]
1030
+ }, Ut = {
1039
1031
  type: "object",
1040
1032
  properties: {
1041
1033
  query: Mt,
1042
1034
  chart: {
1043
- anyOf: [Ot, Pt, Ft, Nt, Lt, It]
1035
+ anyOf: [Ft, Lt, Pt, jt, Nt, Ot]
1044
1036
  }
1045
1037
  },
1046
1038
  required: ["query", "chart"],
1047
1039
  additionalProperties: !1
1048
- }, Ut = {
1040
+ }, Gt = {
1049
1041
  type: "object",
1050
1042
  properties: {
1051
1043
  position: {
@@ -1082,24 +1074,24 @@ const O = {
1082
1074
  },
1083
1075
  required: ["position", "size"],
1084
1076
  additionalProperties: !1
1085
- }, Gt = {
1077
+ }, Ht = {
1086
1078
  type: "object",
1087
1079
  properties: {
1088
- definition: Vt,
1089
- layout: Ut
1080
+ definition: Ut,
1081
+ layout: Gt
1090
1082
  },
1091
1083
  required: ["definition", "layout"],
1092
1084
  additionalProperties: !1
1093
- }, ar = {
1085
+ }, ir = {
1094
1086
  type: "object",
1095
1087
  properties: {
1096
1088
  tiles: {
1097
1089
  type: "array",
1098
- items: Gt
1090
+ items: Ht
1099
1091
  },
1100
1092
  tileHeight: {
1101
1093
  type: "number",
1102
- description: `Height of each tile in pixels. Default: ${V}`
1094
+ description: `Height of each tile in pixels. Default: ${B}`
1103
1095
  },
1104
1096
  gridSize: {
1105
1097
  type: "object",
@@ -1120,27 +1112,27 @@ const O = {
1120
1112
  additionalProperties: !1
1121
1113
  };
1122
1114
  export {
1123
- nt as CP_ID_TOKEN,
1124
- V as DEFAULT_TILE_HEIGHT,
1125
- at as DEFAULT_TILE_REFRESH_INTERVAL_MS,
1115
+ at as CP_ID_TOKEN,
1116
+ B as DEFAULT_TILE_HEIGHT,
1117
+ st as DEFAULT_TILE_REFRESH_INTERVAL_MS,
1126
1118
  nr as DashboardRenderer,
1127
- te as ENTITY_ID_TOKEN,
1128
- Rt as GridLayout,
1129
- z as INJECT_QUERY_PROVIDER,
1130
- ot as TIMEFRAME_TOKEN,
1131
- Bt as aiQuerySchema,
1132
- Ot as barChartSchema,
1133
- Kt as basicQuerySchema,
1134
- ar as dashboardConfigSchema,
1135
- or as dashboardTileTypes,
1136
- zt as exploreV4QuerySchema,
1137
- Pt as gaugeChartSchema,
1138
- Nt as metricCardSchema,
1139
- It as slottableSchema,
1140
- Gt as tileConfigSchema,
1141
- Vt as tileDefinitionSchema,
1142
- Ut as tileLayoutSchema,
1143
- Ft as timeseriesChartSchema,
1144
- Lt as topNTableSchema,
1119
+ ee as ENTITY_ID_TOKEN,
1120
+ Dt as GridLayout,
1121
+ j as INJECT_QUERY_PROVIDER,
1122
+ it as TIMEFRAME_TOKEN,
1123
+ Vt as aiQuerySchema,
1124
+ Ft as barChartSchema,
1125
+ Bt as basicQuerySchema,
1126
+ ir as dashboardConfigSchema,
1127
+ ar as dashboardTileTypes,
1128
+ Kt as exploreV4QuerySchema,
1129
+ Lt as gaugeChartSchema,
1130
+ jt as metricCardSchema,
1131
+ Ot as slottableSchema,
1132
+ Ht as tileConfigSchema,
1133
+ Ut as tileDefinitionSchema,
1134
+ Gt as tileLayoutSchema,
1135
+ Pt as timeseriesChartSchema,
1136
+ Nt as topNTableSchema,
1145
1137
  Mt as validDashboardQuery
1146
1138
  };