@kong-ui-public/dashboard-renderer 0.29.2 → 0.30.0

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