@kong-ui-public/dashboard-renderer 8.9.10 → 8.9.11

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,39 +1,39 @@
1
- var mi = Object.defineProperty;
2
- var wt = (a) => {
1
+ var Ei = Object.defineProperty;
2
+ var Ct = (a) => {
3
3
  throw TypeError(a);
4
4
  };
5
- var pi = (a, e, t) => e in a ? mi(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
6
- var Et = (a, e, t) => pi(a, typeof e != "symbol" ? e + "" : e, t), st = (a, e, t) => e.has(a) || wt("Cannot " + t);
7
- var _ = (a, e, t) => (st(a, e, "read from private field"), t ? t.call(a) : e.get(a)), F = (a, e, t) => e.has(a) ? wt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, t), $ = (a, e, t, i) => (st(a, e, "write to private field"), i ? i.call(a, t) : e.set(a, t), t), U = (a, e, t) => (st(a, e, "access private method"), t);
5
+ var xi = (a, e, t) => e in a ? Ei(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
6
+ var Rt = (a, e, t) => xi(a, typeof e != "symbol" ? e + "" : e, t), nt = (a, e, t) => e.has(a) || Ct("Cannot " + t);
7
+ var _ = (a, e, t) => (nt(a, e, "read from private field"), t ? t.call(a) : e.get(a)), U = (a, e, t) => e.has(a) ? Ct("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, t), B = (a, e, t, i) => (nt(a, e, "write to private field"), i ? i.call(a, t) : e.set(a, t), t), G = (a, e, t) => (nt(a, e, "access private method"), t);
8
8
  var Ne = (a, e, t, i) => ({
9
9
  set _(s) {
10
- $(a, e, s, t);
10
+ B(a, e, s, t);
11
11
  },
12
12
  get _() {
13
13
  return _(a, e, i);
14
14
  }
15
15
  });
16
- import { ref as A, watchEffect as Mt, inject as _e, provide as yi, onMounted as Je, computed as k, watch as Le, onUnmounted as et, getCurrentInstance as vi, defineComponent as J, resolveComponent as de, unref as x, openBlock as C, createBlock as L, createSlots as tt, withCtx as P, createElementVNode as Z, toDisplayString as ie, renderSlot as Ae, createCommentVNode as Y, normalizeStyle as nt, normalizeClass as De, createVNode as le, mergeProps as qt, createTextVNode as ht, createElementBlock as G, normalizeProps as _i, guardReactiveProps as bi, defineAsyncComponent as Pt, useCssVars as ut, useModel as $t, readonly as rt, toRef as Oe, nextTick as dt, resolveDynamicComponent as Bt, toHandlers as wi, mergeModels as Ke, Fragment as Ft, renderList as Ut, useTemplateRef as xt } from "vue";
17
- import { msToGranularity as ot, getFieldDataSources as Gt, stripUnknownFilters as Ei, TimePeriods as xi, TIMEFRAME_LOOKUP as Ci, formatTime as Ct, EXPORT_RECORD_LIMIT as Ri } from "@kong-ui-public/analytics-utilities";
18
- import { handleQueryError as Ti, SimpleChart as ki, AnalyticsChart as Si, TopNTable as zi, CsvExportModal as Di } from "@kong-ui-public/analytics-chart";
19
- import Ni from "swrv";
16
+ import { ref as M, watchEffect as Gt, inject as pe, provide as Ci, toRaw as Ri, computed as R, isRef as ki, isReactive as Ti, toRef as De, hasInjectionContext as kt, onMounted as et, watch as Le, onUnmounted as tt, getCurrentInstance as Si, defineComponent as Z, resolveComponent as ue, unref as x, openBlock as C, createBlock as I, createSlots as it, withCtx as P, createElementVNode as X, toDisplayString as ee, renderSlot as Ae, createCommentVNode as V, normalizeStyle as at, normalizeClass as ze, createVNode as oe, mergeProps as Wt, createTextVNode as dt, createElementBlock as W, normalizeProps as Di, guardReactiveProps as zi, defineAsyncComponent as Kt, useCssVars as ct, useModel as Vt, readonly as ot, nextTick as ft, resolveDynamicComponent as Qt, toHandlers as Ni, mergeModels as Ve, Fragment as Yt, renderList as jt, useTemplateRef as Tt } from "vue";
17
+ import { msToGranularity as lt, TimePeriods as Li, TIMEFRAME_LOOKUP as Ai, formatTime as St, EXPORT_RECORD_LIMIT as Oi } from "@kong-ui-public/analytics-utilities";
18
+ import { handleQueryError as Hi, SimpleChart as Ii, AnalyticsChart as Mi, TopNTable as qi, CsvExportModal as Pi } from "@kong-ui-public/analytics-chart";
19
+ import $i from "swrv";
20
20
  import "axios";
21
- import { createI18n as Li, i18nTComponent as Ai } from "@kong-ui-public/i18n";
22
- import { useAnalyticsConfigStore as Be } from "@kong-ui-public/analytics-config-store";
23
- import { VisibilityOffIcon as Oi, WarningOutlineIcon as Hi, WarningIcon as Ii, ProgressIcon as Mi, RefreshIcon as qi, EditIcon as Pi, MoreIcon as $i } from "@kong/icons";
24
- import { MetricsProvider as Bi, MetricsConsumer as Fi } from "@kong-ui-public/analytics-metric-provider";
25
- var Wt = /* @__PURE__ */ ((a) => (a.VALIDATING = "VALIDATING", a.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", a.PENDING = "PENDING", a.SUCCESS = "SUCCESS", a.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", a.ERROR = "ERROR", a.STALE_IF_ERROR = "STALE_IF_ERROR", a))(Wt || {});
26
- const Ui = (a) => {
21
+ import { createI18n as Bi, i18nTComponent as Fi } from "@kong-ui-public/i18n";
22
+ import { useAnalyticsConfigStore as $e, useDatasourceConfigStore as gt } from "@kong-ui-public/analytics-config-store";
23
+ import { VisibilityOffIcon as Ui, WarningOutlineIcon as Gi, WarningIcon as Wi, ProgressIcon as Ki, RefreshIcon as Vi, EditIcon as Qi, MoreIcon as Yi } from "@kong/icons";
24
+ import { MetricsProvider as ji, MetricsConsumer as Xi } from "@kong-ui-public/analytics-metric-provider";
25
+ var Xt = /* @__PURE__ */ ((a) => (a.VALIDATING = "VALIDATING", a.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", a.PENDING = "PENDING", a.SUCCESS = "SUCCESS", a.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", a.ERROR = "ERROR", a.STALE_IF_ERROR = "STALE_IF_ERROR", a))(Xt || {});
26
+ const Zi = (a) => {
27
27
  var e, t, i, s, r;
28
28
  return a ? !!// TODO: revisit: currently only the first check ever matters?
29
29
  ((e = Object.keys(a)) != null && e.length || (t = a.data) != null && t.length || (s = (i = a.data) == null ? void 0 : i.data) != null && s.length || !((r = a.data) != null && r.data) && typeof a.data == "object" && Object.keys(a == null ? void 0 : a.data).length) : !1;
30
30
  };
31
- function Gi(a = A({}), e, t, i = Ui) {
32
- const s = A(
31
+ function Ji(a = M({}), e, t, i = Zi) {
32
+ const s = M(
33
33
  "PENDING"
34
34
  /* PENDING */
35
35
  );
36
- return Mt(() => {
36
+ return Gt(() => {
37
37
  const r = i(a.value);
38
38
  if (a.value && r && t.value) {
39
39
  s.value = "VALIDATING_HAS_DATA";
@@ -62,10 +62,10 @@ function Gi(a = A({}), e, t, i = Ui) {
62
62
  a.value === void 0 && e && (s.value = "ERROR");
63
63
  }), {
64
64
  state: s,
65
- swrvState: Wt
65
+ swrvState: Xt
66
66
  };
67
67
  }
68
- const Wi = {
68
+ const es = {
69
69
  not_configured: {
70
70
  title: "Chart is not fully configured",
71
71
  description: "Begin by choosing at least one metric"
@@ -83,10 +83,10 @@ const Wi = {
83
83
  fullscreen: "Fullscreen",
84
84
  remove: "Remove",
85
85
  delete: "Delete"
86
- }, Ki = {
86
+ }, ts = {
87
87
  defaultFilename: "Chart export",
88
88
  exportAsCsv: "Export as CSV"
89
- }, Qi = "Explore", Vi = "View requests", Yi = "This tile was configured with {savedGranularity} granularity, which is no longer available. It now shows {currentGranularity} data, the closest available granularity.", Xi = {
89
+ }, is = "Explore", ss = "View requests", rs = "This tile was configured with {savedGranularity} granularity, which is no longer available. It now shows {currentGranularity} data, the closest available granularity.", ns = {
90
90
  daily: "1 day",
91
91
  fiveMinutely: "5 minutes",
92
92
  hourly: "1 hour",
@@ -99,154 +99,154 @@ const Wi = {
99
99
  twoHourly: "2 hours",
100
100
  weekly: "1 week",
101
101
  unknown: "Unknown"
102
- }, ji = {
103
- renderer: Wi,
104
- csvExport: Ki,
105
- jumpToExplore: Qi,
106
- jumpToRequests: Vi,
107
- query_aged_out_warning: Yi,
108
- granularities: Xi
102
+ }, os = {
103
+ renderer: es,
104
+ csvExport: ts,
105
+ jumpToExplore: is,
106
+ jumpToRequests: ss,
107
+ query_aged_out_warning: rs,
108
+ granularities: ns
109
109
  };
110
- function Zi() {
111
- const a = Li("en-us", ji);
110
+ function as() {
111
+ const a = Bi("en-us", os);
112
112
  return {
113
113
  i18n: a,
114
- i18nT: Ai(a)
114
+ i18nT: Fi(a)
115
115
  // Translation component <i18n-t>
116
116
  };
117
117
  }
118
- const Fe = 170, ct = 6, ve = "analytics-query-provider", Rt = "{entity-id}", Ji = "{cp-id}", es = "{timeframe}", ts = 30 * 1e3, is = 3e5, ss = 36e5;
119
- function rs() {
120
- const a = _e(ve);
118
+ const Be = 170, mt = 6, ve = "analytics-query-provider", Dt = "{entity-id}", ls = "{cp-id}", hs = "{timeframe}", us = 30 * 1e3, ds = 3e5, cs = 36e5;
119
+ function fs() {
120
+ const a = pe(ve);
121
121
  return {
122
122
  evaluateFeatureFlag: (t, i) => a ? a.evaluateFeatureFlagFn(t, i) : i
123
123
  };
124
124
  }
125
- function ns(a) {
125
+ function gs(a) {
126
126
  return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
127
127
  }
128
- var Kt = { exports: {} };
128
+ var Zt = { exports: {} };
129
129
  (function(a) {
130
130
  var e = Object.prototype.hasOwnProperty, t = "~";
131
131
  function i() {
132
132
  }
133
133
  Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (t = !1));
134
- function s(d, u, h) {
135
- this.fn = d, this.context = u, this.once = h || !1;
134
+ function s(d, h, u) {
135
+ this.fn = d, this.context = h, this.once = u || !1;
136
136
  }
137
- function r(d, u, h, l, f) {
138
- if (typeof h != "function")
137
+ function r(d, h, u, l, f) {
138
+ if (typeof u != "function")
139
139
  throw new TypeError("The listener must be a function");
140
- var m = new s(h, l || d, f), p = t ? t + u : u;
141
- return d._events[p] ? d._events[p].fn ? d._events[p] = [d._events[p], m] : d._events[p].push(m) : (d._events[p] = m, d._eventsCount++), d;
140
+ var g = new s(u, l || d, f), p = t ? t + h : h;
141
+ return d._events[p] ? d._events[p].fn ? d._events[p] = [d._events[p], g] : d._events[p].push(g) : (d._events[p] = g, d._eventsCount++), d;
142
142
  }
143
- function o(d, u) {
144
- --d._eventsCount === 0 ? d._events = new i() : delete d._events[u];
143
+ function o(d, h) {
144
+ --d._eventsCount === 0 ? d._events = new i() : delete d._events[h];
145
145
  }
146
146
  function n() {
147
147
  this._events = new i(), this._eventsCount = 0;
148
148
  }
149
149
  n.prototype.eventNames = function() {
150
- var u = [], h, l;
151
- if (this._eventsCount === 0) return u;
152
- for (l in h = this._events)
153
- e.call(h, l) && u.push(t ? l.slice(1) : l);
154
- return Object.getOwnPropertySymbols ? u.concat(Object.getOwnPropertySymbols(h)) : u;
155
- }, n.prototype.listeners = function(u) {
156
- var h = t ? t + u : u, l = this._events[h];
150
+ var h = [], u, l;
151
+ if (this._eventsCount === 0) return h;
152
+ for (l in u = this._events)
153
+ e.call(u, l) && h.push(t ? l.slice(1) : l);
154
+ return Object.getOwnPropertySymbols ? h.concat(Object.getOwnPropertySymbols(u)) : h;
155
+ }, n.prototype.listeners = function(h) {
156
+ var u = t ? t + h : h, l = this._events[u];
157
157
  if (!l) return [];
158
158
  if (l.fn) return [l.fn];
159
- for (var f = 0, m = l.length, p = new Array(m); f < m; f++)
159
+ for (var f = 0, g = l.length, p = new Array(g); f < g; f++)
160
160
  p[f] = l[f].fn;
161
161
  return p;
162
- }, n.prototype.listenerCount = function(u) {
163
- var h = t ? t + u : u, l = this._events[h];
162
+ }, n.prototype.listenerCount = function(h) {
163
+ var u = t ? t + h : h, l = this._events[u];
164
164
  return l ? l.fn ? 1 : l.length : 0;
165
- }, n.prototype.emit = function(u, h, l, f, m, p) {
166
- var y = t ? t + u : u;
165
+ }, n.prototype.emit = function(h, u, l, f, g, p) {
166
+ var y = t ? t + h : h;
167
167
  if (!this._events[y]) return !1;
168
- var g = this._events[y], T = arguments.length, M, w;
169
- if (g.fn) {
170
- switch (g.once && this.removeListener(u, g.fn, void 0, !0), T) {
168
+ var m = this._events[y], k = arguments.length, L, w;
169
+ if (m.fn) {
170
+ switch (m.once && this.removeListener(h, m.fn, void 0, !0), k) {
171
171
  case 1:
172
- return g.fn.call(g.context), !0;
172
+ return m.fn.call(m.context), !0;
173
173
  case 2:
174
- return g.fn.call(g.context, h), !0;
174
+ return m.fn.call(m.context, u), !0;
175
175
  case 3:
176
- return g.fn.call(g.context, h, l), !0;
176
+ return m.fn.call(m.context, u, l), !0;
177
177
  case 4:
178
- return g.fn.call(g.context, h, l, f), !0;
178
+ return m.fn.call(m.context, u, l, f), !0;
179
179
  case 5:
180
- return g.fn.call(g.context, h, l, f, m), !0;
180
+ return m.fn.call(m.context, u, l, f, g), !0;
181
181
  case 6:
182
- return g.fn.call(g.context, h, l, f, m, p), !0;
182
+ return m.fn.call(m.context, u, l, f, g, p), !0;
183
183
  }
184
- for (w = 1, M = new Array(T - 1); w < T; w++)
185
- M[w - 1] = arguments[w];
186
- g.fn.apply(g.context, M);
184
+ for (w = 1, L = new Array(k - 1); w < k; w++)
185
+ L[w - 1] = arguments[w];
186
+ m.fn.apply(m.context, L);
187
187
  } else {
188
- var I = g.length, O;
189
- for (w = 0; w < I; w++)
190
- switch (g[w].once && this.removeListener(u, g[w].fn, void 0, !0), T) {
188
+ var q = m.length, A;
189
+ for (w = 0; w < q; w++)
190
+ switch (m[w].once && this.removeListener(h, m[w].fn, void 0, !0), k) {
191
191
  case 1:
192
- g[w].fn.call(g[w].context);
192
+ m[w].fn.call(m[w].context);
193
193
  break;
194
194
  case 2:
195
- g[w].fn.call(g[w].context, h);
195
+ m[w].fn.call(m[w].context, u);
196
196
  break;
197
197
  case 3:
198
- g[w].fn.call(g[w].context, h, l);
198
+ m[w].fn.call(m[w].context, u, l);
199
199
  break;
200
200
  case 4:
201
- g[w].fn.call(g[w].context, h, l, f);
201
+ m[w].fn.call(m[w].context, u, l, f);
202
202
  break;
203
203
  default:
204
- if (!M) for (O = 1, M = new Array(T - 1); O < T; O++)
205
- M[O - 1] = arguments[O];
206
- g[w].fn.apply(g[w].context, M);
204
+ if (!L) for (A = 1, L = new Array(k - 1); A < k; A++)
205
+ L[A - 1] = arguments[A];
206
+ m[w].fn.apply(m[w].context, L);
207
207
  }
208
208
  }
209
209
  return !0;
210
- }, n.prototype.on = function(u, h, l) {
211
- return r(this, u, h, l, !1);
212
- }, n.prototype.once = function(u, h, l) {
213
- return r(this, u, h, l, !0);
214
- }, n.prototype.removeListener = function(u, h, l, f) {
215
- var m = t ? t + u : u;
216
- if (!this._events[m]) return this;
217
- if (!h)
218
- return o(this, m), this;
219
- var p = this._events[m];
210
+ }, n.prototype.on = function(h, u, l) {
211
+ return r(this, h, u, l, !1);
212
+ }, n.prototype.once = function(h, u, l) {
213
+ return r(this, h, u, l, !0);
214
+ }, n.prototype.removeListener = function(h, u, l, f) {
215
+ var g = t ? t + h : h;
216
+ if (!this._events[g]) return this;
217
+ if (!u)
218
+ return o(this, g), this;
219
+ var p = this._events[g];
220
220
  if (p.fn)
221
- p.fn === h && (!f || p.once) && (!l || p.context === l) && o(this, m);
221
+ p.fn === u && (!f || p.once) && (!l || p.context === l) && o(this, g);
222
222
  else {
223
- for (var y = 0, g = [], T = p.length; y < T; y++)
224
- (p[y].fn !== h || f && !p[y].once || l && p[y].context !== l) && g.push(p[y]);
225
- g.length ? this._events[m] = g.length === 1 ? g[0] : g : o(this, m);
223
+ for (var y = 0, m = [], k = p.length; y < k; y++)
224
+ (p[y].fn !== u || f && !p[y].once || l && p[y].context !== l) && m.push(p[y]);
225
+ m.length ? this._events[g] = m.length === 1 ? m[0] : m : o(this, g);
226
226
  }
227
227
  return this;
228
- }, n.prototype.removeAllListeners = function(u) {
229
- var h;
230
- return u ? (h = t ? t + u : u, this._events[h] && o(this, h)) : (this._events = new i(), this._eventsCount = 0), this;
228
+ }, n.prototype.removeAllListeners = function(h) {
229
+ var u;
230
+ return h ? (u = t ? t + h : h, this._events[u] && o(this, u)) : (this._events = new i(), this._eventsCount = 0), this;
231
231
  }, n.prototype.off = n.prototype.removeListener, n.prototype.addListener = n.prototype.on, n.prefixed = t, n.EventEmitter = n, a.exports = n;
232
- })(Kt);
233
- var os = Kt.exports;
234
- const as = /* @__PURE__ */ ns(os);
235
- class Qt extends Error {
232
+ })(Zt);
233
+ var ms = Zt.exports;
234
+ const ps = /* @__PURE__ */ gs(ms);
235
+ class Jt extends Error {
236
236
  constructor(e) {
237
237
  super(e), this.name = "TimeoutError";
238
238
  }
239
239
  }
240
- class ls extends Error {
240
+ class ys extends Error {
241
241
  constructor(e) {
242
242
  super(), this.name = "AbortError", this.message = e;
243
243
  }
244
244
  }
245
- const Tt = (a) => globalThis.DOMException === void 0 ? new ls(a) : new DOMException(a), kt = (a) => {
246
- const e = a.reason === void 0 ? Tt("This operation was aborted.") : a.reason;
247
- return e instanceof Error ? e : Tt(e);
245
+ const zt = (a) => globalThis.DOMException === void 0 ? new ys(a) : new DOMException(a), Nt = (a) => {
246
+ const e = a.reason === void 0 ? zt("This operation was aborted.") : a.reason;
247
+ return e instanceof Error ? e : zt(e);
248
248
  };
249
- function hs(a, e) {
249
+ function vs(a, e) {
250
250
  const {
251
251
  milliseconds: t,
252
252
  fallback: i,
@@ -254,45 +254,45 @@ function hs(a, e) {
254
254
  customTimers: r = { setTimeout, clearTimeout }
255
255
  } = e;
256
256
  let o, n;
257
- const u = new Promise((h, l) => {
257
+ const h = new Promise((u, l) => {
258
258
  if (typeof t != "number" || Math.sign(t) !== 1)
259
259
  throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);
260
260
  if (e.signal) {
261
- const { signal: m } = e;
262
- m.aborted && l(kt(m)), n = () => {
263
- l(kt(m));
264
- }, m.addEventListener("abort", n, { once: !0 });
261
+ const { signal: g } = e;
262
+ g.aborted && l(Nt(g)), n = () => {
263
+ l(Nt(g));
264
+ }, g.addEventListener("abort", n, { once: !0 });
265
265
  }
266
266
  if (t === Number.POSITIVE_INFINITY) {
267
- a.then(h, l);
267
+ a.then(u, l);
268
268
  return;
269
269
  }
270
- const f = new Qt();
270
+ const f = new Jt();
271
271
  o = r.setTimeout.call(void 0, () => {
272
272
  if (i) {
273
273
  try {
274
- h(i());
275
- } catch (m) {
276
- l(m);
274
+ u(i());
275
+ } catch (g) {
276
+ l(g);
277
277
  }
278
278
  return;
279
279
  }
280
- typeof a.cancel == "function" && a.cancel(), s === !1 ? h() : s instanceof Error ? l(s) : (f.message = s ?? `Promise timed out after ${t} milliseconds`, l(f));
280
+ typeof a.cancel == "function" && a.cancel(), s === !1 ? u() : s instanceof Error ? l(s) : (f.message = s ?? `Promise timed out after ${t} milliseconds`, l(f));
281
281
  }, t), (async () => {
282
282
  try {
283
- h(await a);
284
- } catch (m) {
285
- l(m);
283
+ u(await a);
284
+ } catch (g) {
285
+ l(g);
286
286
  }
287
287
  })();
288
288
  }).finally(() => {
289
- u.clear(), n && e.signal && e.signal.removeEventListener("abort", n);
289
+ h.clear(), n && e.signal && e.signal.removeEventListener("abort", n);
290
290
  });
291
- return u.clear = () => {
291
+ return h.clear = () => {
292
292
  r.clearTimeout.call(void 0, o), o = void 0;
293
- }, u;
293
+ }, h;
294
294
  }
295
- function us(a, e, t) {
295
+ function _s(a, e, t) {
296
296
  let i = 0, s = a.length;
297
297
  for (; s > 0; ) {
298
298
  const r = Math.trunc(s / 2);
@@ -301,10 +301,10 @@ function us(a, e, t) {
301
301
  }
302
302
  return i;
303
303
  }
304
- var re;
305
- class ds {
304
+ var te;
305
+ class bs {
306
306
  constructor() {
307
- F(this, re, []);
307
+ U(this, te, []);
308
308
  }
309
309
  enqueue(e, t) {
310
310
  t = {
@@ -316,83 +316,83 @@ class ds {
316
316
  id: t.id,
317
317
  run: e
318
318
  };
319
- if (this.size === 0 || _(this, re)[this.size - 1].priority >= t.priority) {
320
- _(this, re).push(i);
319
+ if (this.size === 0 || _(this, te)[this.size - 1].priority >= t.priority) {
320
+ _(this, te).push(i);
321
321
  return;
322
322
  }
323
- const s = us(_(this, re), i, (r, o) => o.priority - r.priority);
324
- _(this, re).splice(s, 0, i);
323
+ const s = _s(_(this, te), i, (r, o) => o.priority - r.priority);
324
+ _(this, te).splice(s, 0, i);
325
325
  }
326
326
  setPriority(e, t) {
327
- const i = _(this, re).findIndex((r) => r.id === e);
327
+ const i = _(this, te).findIndex((r) => r.id === e);
328
328
  if (i === -1)
329
329
  throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);
330
- const [s] = _(this, re).splice(i, 1);
330
+ const [s] = _(this, te).splice(i, 1);
331
331
  this.enqueue(s.run, { priority: t, id: e });
332
332
  }
333
333
  dequeue() {
334
- const e = _(this, re).shift();
334
+ const e = _(this, te).shift();
335
335
  return e == null ? void 0 : e.run;
336
336
  }
337
337
  filter(e) {
338
- return _(this, re).filter((t) => t.priority === e.priority).map((t) => t.run);
338
+ return _(this, te).filter((t) => t.priority === e.priority).map((t) => t.run);
339
339
  }
340
340
  get size() {
341
- return _(this, re).length;
341
+ return _(this, te).length;
342
342
  }
343
343
  }
344
- re = new WeakMap();
345
- var Re, Te, ye, Me, ke, qe, ne, Se, X, Pe, oe, ze, ge, $e, Ze, z, Vt, Yt, Xt, jt, Zt, Ue, at, lt, Ge, Jt, We;
346
- class cs extends as {
344
+ te = new WeakMap();
345
+ var Ce, Re, ye, Ie, ke, Me, ie, Te, Q, qe, se, Se, me, Pe, Je, D, ei, ti, ii, si, ri, Ge, ht, ut, We, ni, Ke;
346
+ class ws extends ps {
347
347
  // TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
348
348
  constructor(t) {
349
349
  var i, s;
350
350
  super();
351
- F(this, z);
352
- F(this, Re);
353
- F(this, Te);
354
- F(this, ye, 0);
355
- F(this, Me);
356
- F(this, ke);
357
- F(this, qe, 0);
358
- F(this, ne);
359
- F(this, Se);
360
- F(this, X);
361
- F(this, Pe);
362
- F(this, oe, 0);
351
+ U(this, D);
352
+ U(this, Ce);
353
+ U(this, Re);
354
+ U(this, ye, 0);
355
+ U(this, Ie);
356
+ U(this, ke);
357
+ U(this, Me, 0);
358
+ U(this, ie);
359
+ U(this, Te);
360
+ U(this, Q);
361
+ U(this, qe);
362
+ U(this, se, 0);
363
363
  // The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
364
- F(this, ze);
365
- F(this, ge);
366
- F(this, $e);
364
+ U(this, Se);
365
+ U(this, me);
366
+ U(this, Pe);
367
367
  // Use to assign a unique identifier to a promise function, if not explicitly specified
368
- F(this, Ze, 1n);
368
+ U(this, Je, 1n);
369
369
  /**
370
370
  Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
371
371
 
372
372
  Applies to each future operation.
373
373
  */
374
- Et(this, "timeout");
374
+ Rt(this, "timeout");
375
375
  if (t = {
376
376
  carryoverConcurrencyCount: !1,
377
377
  intervalCap: Number.POSITIVE_INFINITY,
378
378
  interval: 0,
379
379
  concurrency: Number.POSITIVE_INFINITY,
380
380
  autoStart: !0,
381
- queueClass: ds,
381
+ queueClass: bs,
382
382
  ...t
383
383
  }, !(typeof t.intervalCap == "number" && t.intervalCap >= 1))
384
384
  throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${((i = t.intervalCap) == null ? void 0 : i.toString()) ?? ""}\` (${typeof t.intervalCap})`);
385
385
  if (t.interval === void 0 || !(Number.isFinite(t.interval) && t.interval >= 0))
386
386
  throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${((s = t.interval) == null ? void 0 : s.toString()) ?? ""}\` (${typeof t.interval})`);
387
- $(this, Re, t.carryoverConcurrencyCount), $(this, Te, t.intervalCap === Number.POSITIVE_INFINITY || t.interval === 0), $(this, Me, t.intervalCap), $(this, ke, t.interval), $(this, X, new t.queueClass()), $(this, Pe, t.queueClass), this.concurrency = t.concurrency, this.timeout = t.timeout, $(this, $e, t.throwOnTimeout === !0), $(this, ge, t.autoStart === !1);
387
+ B(this, Ce, t.carryoverConcurrencyCount), B(this, Re, t.intervalCap === Number.POSITIVE_INFINITY || t.interval === 0), B(this, Ie, t.intervalCap), B(this, ke, t.interval), B(this, Q, new t.queueClass()), B(this, qe, t.queueClass), this.concurrency = t.concurrency, this.timeout = t.timeout, B(this, Pe, t.throwOnTimeout === !0), B(this, me, t.autoStart === !1);
388
388
  }
389
389
  get concurrency() {
390
- return _(this, ze);
390
+ return _(this, Se);
391
391
  }
392
392
  set concurrency(t) {
393
393
  if (!(typeof t == "number" && t >= 1))
394
394
  throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);
395
- $(this, ze, t), U(this, z, Ge).call(this);
395
+ B(this, Se, t), G(this, D, We).call(this);
396
396
  }
397
397
  /**
398
398
  Updates the priority of a promise function by its id, affecting its execution order. Requires a defined concurrency limit to take effect.
@@ -431,33 +431,33 @@ class cs extends as {
431
431
  Here, the promise function with `id: '🦀'` executes last.
432
432
  */
433
433
  setPriority(t, i) {
434
- _(this, X).setPriority(t, i);
434
+ _(this, Q).setPriority(t, i);
435
435
  }
436
436
  async add(t, i = {}) {
437
- return i.id ?? (i.id = (Ne(this, Ze)._++).toString()), i = {
437
+ return i.id ?? (i.id = (Ne(this, Je)._++).toString()), i = {
438
438
  timeout: this.timeout,
439
- throwOnTimeout: _(this, $e),
439
+ throwOnTimeout: _(this, Pe),
440
440
  ...i
441
441
  }, new Promise((s, r) => {
442
- _(this, X).enqueue(async () => {
442
+ _(this, Q).enqueue(async () => {
443
443
  var o;
444
- Ne(this, oe)._++;
444
+ Ne(this, se)._++;
445
445
  try {
446
446
  (o = i.signal) == null || o.throwIfAborted(), Ne(this, ye)._++;
447
447
  let n = t({ signal: i.signal });
448
- i.timeout && (n = hs(Promise.resolve(n), { milliseconds: i.timeout })), i.signal && (n = Promise.race([n, U(this, z, Jt).call(this, i.signal)]));
448
+ i.timeout && (n = vs(Promise.resolve(n), { milliseconds: i.timeout })), i.signal && (n = Promise.race([n, G(this, D, ni).call(this, i.signal)]));
449
449
  const d = await n;
450
450
  s(d), this.emit("completed", d);
451
451
  } catch (n) {
452
- if (n instanceof Qt && !i.throwOnTimeout) {
452
+ if (n instanceof Jt && !i.throwOnTimeout) {
453
453
  s();
454
454
  return;
455
455
  }
456
456
  r(n), this.emit("error", n);
457
457
  } finally {
458
- U(this, z, Xt).call(this);
458
+ G(this, D, ii).call(this);
459
459
  }
460
- }, i), this.emit("add"), U(this, z, Ue).call(this);
460
+ }, i), this.emit("add"), G(this, D, Ge).call(this);
461
461
  });
462
462
  }
463
463
  async addAll(t, i) {
@@ -467,19 +467,19 @@ class cs extends as {
467
467
  Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
468
468
  */
469
469
  start() {
470
- return _(this, ge) ? ($(this, ge, !1), U(this, z, Ge).call(this), this) : this;
470
+ return _(this, me) ? (B(this, me, !1), G(this, D, We).call(this), this) : this;
471
471
  }
472
472
  /**
473
473
  Put queue execution on hold.
474
474
  */
475
475
  pause() {
476
- $(this, ge, !0);
476
+ B(this, me, !0);
477
477
  }
478
478
  /**
479
479
  Clear the queue.
480
480
  */
481
481
  clear() {
482
- $(this, X, new (_(this, Pe))());
482
+ B(this, Q, new (_(this, qe))());
483
483
  }
484
484
  /**
485
485
  Can be called multiple times. Useful if you for example add additional items at a later time.
@@ -487,7 +487,7 @@ class cs extends as {
487
487
  @returns A promise that settles when the queue becomes empty.
488
488
  */
489
489
  async onEmpty() {
490
- _(this, X).size !== 0 && await U(this, z, We).call(this, "empty");
490
+ _(this, Q).size !== 0 && await G(this, D, Ke).call(this, "empty");
491
491
  }
492
492
  /**
493
493
  @returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
@@ -497,7 +497,7 @@ class cs extends as {
497
497
  Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation.
498
498
  */
499
499
  async onSizeLessThan(t) {
500
- _(this, X).size < t || await U(this, z, We).call(this, "next", () => _(this, X).size < t);
500
+ _(this, Q).size < t || await G(this, D, Ke).call(this, "next", () => _(this, Q).size < t);
501
501
  }
502
502
  /**
503
503
  The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
@@ -505,13 +505,13 @@ class cs extends as {
505
505
  @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
506
506
  */
507
507
  async onIdle() {
508
- _(this, oe) === 0 && _(this, X).size === 0 || await U(this, z, We).call(this, "idle");
508
+ _(this, se) === 0 && _(this, Q).size === 0 || await G(this, D, Ke).call(this, "idle");
509
509
  }
510
510
  /**
511
511
  Size of the queue, the number of queued items waiting to run.
512
512
  */
513
513
  get size() {
514
- return _(this, X).size;
514
+ return _(this, Q).size;
515
515
  }
516
516
  /**
517
517
  Size of the queue, filtered by the given options.
@@ -519,71 +519,71 @@ class cs extends as {
519
519
  For example, this can be used to find the number of items remaining in the queue with a specific priority level.
520
520
  */
521
521
  sizeBy(t) {
522
- return _(this, X).filter(t).length;
522
+ return _(this, Q).filter(t).length;
523
523
  }
524
524
  /**
525
525
  Number of running items (no longer in the queue).
526
526
  */
527
527
  get pending() {
528
- return _(this, oe);
528
+ return _(this, se);
529
529
  }
530
530
  /**
531
531
  Whether the queue is currently paused.
532
532
  */
533
533
  get isPaused() {
534
- return _(this, ge);
534
+ return _(this, me);
535
535
  }
536
536
  }
537
- Re = new WeakMap(), Te = new WeakMap(), ye = new WeakMap(), Me = new WeakMap(), ke = new WeakMap(), qe = new WeakMap(), ne = new WeakMap(), Se = new WeakMap(), X = new WeakMap(), Pe = new WeakMap(), oe = new WeakMap(), ze = new WeakMap(), ge = new WeakMap(), $e = new WeakMap(), Ze = new WeakMap(), z = new WeakSet(), Vt = function() {
538
- return _(this, Te) || _(this, ye) < _(this, Me);
539
- }, Yt = function() {
540
- return _(this, oe) < _(this, ze);
541
- }, Xt = function() {
542
- Ne(this, oe)._--, U(this, z, Ue).call(this), this.emit("next");
543
- }, jt = function() {
544
- U(this, z, lt).call(this), U(this, z, at).call(this), $(this, Se, void 0);
545
- }, Zt = function() {
537
+ Ce = new WeakMap(), Re = new WeakMap(), ye = new WeakMap(), Ie = new WeakMap(), ke = new WeakMap(), Me = new WeakMap(), ie = new WeakMap(), Te = new WeakMap(), Q = new WeakMap(), qe = new WeakMap(), se = new WeakMap(), Se = new WeakMap(), me = new WeakMap(), Pe = new WeakMap(), Je = new WeakMap(), D = new WeakSet(), ei = function() {
538
+ return _(this, Re) || _(this, ye) < _(this, Ie);
539
+ }, ti = function() {
540
+ return _(this, se) < _(this, Se);
541
+ }, ii = function() {
542
+ Ne(this, se)._--, G(this, D, Ge).call(this), this.emit("next");
543
+ }, si = function() {
544
+ G(this, D, ut).call(this), G(this, D, ht).call(this), B(this, Te, void 0);
545
+ }, ri = function() {
546
546
  const t = Date.now();
547
- if (_(this, ne) === void 0) {
548
- const i = _(this, qe) - t;
547
+ if (_(this, ie) === void 0) {
548
+ const i = _(this, Me) - t;
549
549
  if (i < 0)
550
- $(this, ye, _(this, Re) ? _(this, oe) : 0);
550
+ B(this, ye, _(this, Ce) ? _(this, se) : 0);
551
551
  else
552
- return _(this, Se) === void 0 && $(this, Se, setTimeout(() => {
553
- U(this, z, jt).call(this);
552
+ return _(this, Te) === void 0 && B(this, Te, setTimeout(() => {
553
+ G(this, D, si).call(this);
554
554
  }, i)), !0;
555
555
  }
556
556
  return !1;
557
- }, Ue = function() {
558
- if (_(this, X).size === 0)
559
- return _(this, ne) && clearInterval(_(this, ne)), $(this, ne, void 0), this.emit("empty"), _(this, oe) === 0 && this.emit("idle"), !1;
560
- if (!_(this, ge)) {
561
- const t = !_(this, z, Zt);
562
- if (_(this, z, Vt) && _(this, z, Yt)) {
563
- const i = _(this, X).dequeue();
564
- return i ? (this.emit("active"), i(), t && U(this, z, at).call(this), !0) : !1;
557
+ }, Ge = function() {
558
+ if (_(this, Q).size === 0)
559
+ return _(this, ie) && clearInterval(_(this, ie)), B(this, ie, void 0), this.emit("empty"), _(this, se) === 0 && this.emit("idle"), !1;
560
+ if (!_(this, me)) {
561
+ const t = !_(this, D, ri);
562
+ if (_(this, D, ei) && _(this, D, ti)) {
563
+ const i = _(this, Q).dequeue();
564
+ return i ? (this.emit("active"), i(), t && G(this, D, ht).call(this), !0) : !1;
565
565
  }
566
566
  }
567
567
  return !1;
568
- }, at = function() {
569
- _(this, Te) || _(this, ne) !== void 0 || ($(this, ne, setInterval(() => {
570
- U(this, z, lt).call(this);
571
- }, _(this, ke))), $(this, qe, Date.now() + _(this, ke)));
572
- }, lt = function() {
573
- _(this, ye) === 0 && _(this, oe) === 0 && _(this, ne) && (clearInterval(_(this, ne)), $(this, ne, void 0)), $(this, ye, _(this, Re) ? _(this, oe) : 0), U(this, z, Ge).call(this);
568
+ }, ht = function() {
569
+ _(this, Re) || _(this, ie) !== void 0 || (B(this, ie, setInterval(() => {
570
+ G(this, D, ut).call(this);
571
+ }, _(this, ke))), B(this, Me, Date.now() + _(this, ke)));
572
+ }, ut = function() {
573
+ _(this, ye) === 0 && _(this, se) === 0 && _(this, ie) && (clearInterval(_(this, ie)), B(this, ie, void 0)), B(this, ye, _(this, Ce) ? _(this, se) : 0), G(this, D, We).call(this);
574
574
  }, /**
575
575
  Executes all queued functions until it reaches the limit.
576
576
  */
577
- Ge = function() {
578
- for (; U(this, z, Ue).call(this); )
577
+ We = function() {
578
+ for (; G(this, D, Ge).call(this); )
579
579
  ;
580
- }, Jt = async function(t) {
580
+ }, ni = async function(t) {
581
581
  return new Promise((i, s) => {
582
582
  t.addEventListener("abort", () => {
583
583
  s(t.reason);
584
584
  }, { once: !0 });
585
585
  });
586
- }, We = async function(t, i) {
586
+ }, Ke = async function(t, i) {
587
587
  return new Promise((s) => {
588
588
  const r = () => {
589
589
  i && !i() || (this.off(t, r), s());
@@ -591,15 +591,15 @@ Ge = function() {
591
591
  this.on(t, r);
592
592
  });
593
593
  };
594
- const fs = () => {
595
- const a = Be(), e = _e(ve);
594
+ const Es = () => {
595
+ const a = $e(), e = pe(ve);
596
596
  if (!e)
597
597
  return;
598
598
  if (e.queryFnOverride) {
599
599
  console.warn("Detected incorrect use of useRequestQueue. This composable should not be used in nested components. Please discuss with team-data or report an issue if you feel you have a use case.");
600
600
  return;
601
601
  }
602
- const t = new cs({
602
+ const t = new ws({
603
603
  carryoverConcurrencyCount: !0,
604
604
  concurrency: a.maxParallelRequests,
605
605
  interval: a.requestInterval,
@@ -609,8 +609,44 @@ const fs = () => {
609
609
  queryFnOverride: !0,
610
610
  queryFn: (s, r) => t.add(() => e.queryFn(s, r), { throwOnTimeout: !0 })
611
611
  };
612
- yi(ve, i);
613
- }, gs = [
612
+ Ci(ve, i);
613
+ };
614
+ /*!
615
+ * pinia v3.0.4
616
+ * (c) 2025 Eduardo San Martin Morote
617
+ * @license MIT
618
+ */
619
+ const xs = typeof window < "u";
620
+ let Lt;
621
+ process.env.NODE_ENV;
622
+ const At = process.env.NODE_ENV !== "production" ? Symbol("pinia") : (
623
+ /* istanbul ignore next */
624
+ Symbol()
625
+ );
626
+ var Ot;
627
+ (function(a) {
628
+ a.direct = "direct", a.patchObject = "patch object", a.patchFunction = "patch function";
629
+ })(Ot || (Ot = {}));
630
+ process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
631
+ /* istanbul ignore next */
632
+ Symbol()
633
+ );
634
+ function oi(a) {
635
+ const e = Ri(a), t = {};
636
+ for (const i in e) {
637
+ const s = e[i];
638
+ s.effect ? t[i] = // ...
639
+ R({
640
+ get: () => a[i],
641
+ set(r) {
642
+ a[i] = r;
643
+ }
644
+ }) : (ki(s) || Ti(s)) && (t[i] = // ---
645
+ De(a, i));
646
+ }
647
+ return t;
648
+ }
649
+ const Cs = [
614
650
  "basic",
615
651
  "api_usage",
616
652
  "llm_usage",
@@ -618,169 +654,174 @@ const fs = () => {
618
654
  "platform",
619
655
  void 0
620
656
  ];
621
- function ms({
657
+ function Rs({
622
658
  queryBridge: a,
623
659
  context: e,
624
660
  definition: t,
625
661
  chartData: i
626
662
  }) {
627
- const s = A(""), r = A(""), o = A(void 0), n = A(void 0), d = Be();
628
- Je(async () => {
629
- var R, q;
630
- s.value = await ((R = a == null ? void 0 : a.exploreBaseUrl) == null ? void 0 : R.call(a)) ?? "", r.value = await ((q = a == null ? void 0 : a.requestsBaseUrl) == null ? void 0 : q.call(a)) ?? "";
663
+ const s = M(""), r = M(""), o = M(void 0), n = M(void 0), d = $e(), h = gt(), { stripUnknownFilters: u, loading: l } = oi(h);
664
+ et(async () => {
665
+ var T, z;
666
+ s.value = await ((T = a == null ? void 0 : a.exploreBaseUrl) == null ? void 0 : T.call(a)) ?? "", r.value = await ((z = a == null ? void 0 : a.requestsBaseUrl) == null ? void 0 : z.call(a)) ?? "";
631
667
  });
632
- const u = k(() => d.analytics && d.percentiles), h = k(() => {
633
- const R = t.value.chart.type;
634
- return ["golden_signals", "gauge"].includes(R) ? !1 : R === "top_n" ? e.value.editable || e.value.showTileActions : !0;
635
- }), l = k(() => r.value && t.value.query && t.value.query.datasource !== "llm_usage" && u.value), f = k(() => s.value && t.value.query && gs.includes(t.value.query.datasource) && u.value), m = k(() => i.value ? ot(i.value.meta.granularity_ms) : void 0), p = k(() => {
636
- var se;
637
- const R = [...e.value.filters, ...t.value.query.filters ?? []], q = ((se = t.value.query) == null ? void 0 : se.datasource) ?? "api_usage";
638
- return R.filter((me) => Gt(me.field).some((pe) => q === pe));
639
- }), y = k(() => {
640
- if (!f.value || !h.value)
668
+ const f = R(() => d.analytics && d.percentiles), g = R(() => {
669
+ const T = t.value.chart.type;
670
+ return ["golden_signals", "gauge"].includes(T) ? !1 : T === "top_n" ? e.value.editable || e.value.showTileActions : !0;
671
+ }), p = R(() => r.value && t.value.query && t.value.query.datasource !== "llm_usage" && t.value.query.datasource !== "platform" && f.value && !l.value), y = R(() => s.value && t.value.query && Cs.includes(t.value.query.datasource) && f.value && !l.value), m = R(() => i.value ? lt(i.value.meta.granularity_ms) : void 0), k = R(() => {
672
+ var ge;
673
+ const T = [...e.value.filters, ...t.value.query.filters ?? []], z = t.value.query.metrics, re = ((ge = t.value.query) == null ? void 0 : ge.datasource) ?? "api_usage";
674
+ return u.value({
675
+ datasource: re,
676
+ filters: T,
677
+ metrics: z
678
+ });
679
+ }), L = R(() => {
680
+ if (!y.value || !g.value)
641
681
  return "";
642
- const R = p.value, q = t.value.query.time_range || e.value.timeSpec, se = I(q, R);
643
- return O(se);
644
- }), g = k(() => {
645
- if (!l.value || !h.value)
682
+ const T = k.value, z = t.value.query.time_range || e.value.timeSpec, re = we(z, T);
683
+ return _e(re);
684
+ }), w = R(() => {
685
+ if (!p.value || !g.value)
646
686
  return "";
647
- const R = p.value, q = M(
687
+ const T = k.value, z = A(
648
688
  t.value.query.time_range || e.value.timeSpec,
649
- R
689
+ T
650
690
  );
651
- return T(q);
652
- }), T = (R) => l.value ? `${r.value}?q=${JSON.stringify(R)}` : "", M = (R, q) => {
653
- var j, pe, we, Ee;
654
- const se = (pe = (j = i.value) == null ? void 0 : j.meta) != null && pe.start ? new Date(i.value.meta.start) : void 0, me = (Ee = (we = i.value) == null ? void 0 : we.meta) != null && Ee.end ? new Date(i.value.meta.end) : void 0;
691
+ return q(z);
692
+ }), q = (T) => p.value ? `${r.value}?q=${JSON.stringify(T)}` : "", A = (T, z) => {
693
+ var Ee, S, O, $;
694
+ const re = (S = (Ee = i.value) == null ? void 0 : Ee.meta) != null && S.start ? new Date(i.value.meta.start) : void 0, ge = ($ = (O = i.value) == null ? void 0 : O.meta) != null && $.end ? new Date(i.value.meta.end) : void 0;
655
695
  return {
656
- filter: q,
696
+ filter: z,
657
697
  timeframe: {
658
- timePeriodsKey: R.type === "relative" ? R.time_range : "custom",
659
- start: R.type === "absolute" ? se : void 0,
660
- end: R.type === "absolute" ? me : void 0
698
+ timePeriodsKey: T.type === "relative" ? T.time_range : "custom",
699
+ start: T.type === "absolute" ? re : void 0,
700
+ end: T.type === "absolute" ? ge : void 0
661
701
  }
662
702
  };
663
- }, w = (R, q) => ({
664
- filter: q,
703
+ }, fe = (T, z) => ({
704
+ filter: z,
665
705
  timeframe: {
666
- timePeriodsKey: R.type === "relative" ? R.time_range : "custom",
667
- start: R.type === "absolute" ? R.start : void 0,
668
- end: R.type === "absolute" ? R.end : void 0
706
+ timePeriodsKey: T.type === "relative" ? T.time_range : "custom",
707
+ start: T.type === "absolute" ? T.start : void 0,
708
+ end: T.type === "absolute" ? T.end : void 0
669
709
  }
670
- }), I = (R, q) => {
671
- const se = t.value.query.dimensions ?? [];
710
+ }), we = (T, z) => {
711
+ const re = t.value.query.dimensions ?? [];
672
712
  return {
673
- filters: q,
713
+ filters: z,
674
714
  metrics: t.value.query.metrics ?? [],
675
- dimensions: se,
676
- time_range: R,
715
+ dimensions: re,
716
+ time_range: T,
677
717
  granularity: t.value.query.granularity || m.value
678
718
  };
679
- }, O = (R) => {
680
- if (!f.value)
719
+ }, _e = (T) => {
720
+ if (!y.value)
681
721
  return "";
682
- const q = ["api_usage", "llm_usage", "agentic_usage"].includes(t.value.query.datasource) ? t.value.query.datasource : "api_usage";
683
- return `${s.value}?q=${JSON.stringify(R)}&d=${q}&c=${t.value.chart.type}`;
722
+ const z = t.value.query.datasource && t.value.query.datasource !== "basic" ? t.value.query.datasource : "api_usage";
723
+ return `${s.value}?q=${JSON.stringify(T)}&d=${z}&c=${t.value.chart.type}`;
684
724
  };
685
- return Le([l, f], ([R, q]) => {
686
- R && (o.value = { href: "" }), q && (n.value = { href: "" });
725
+ return Le([p, y], ([T, z]) => {
726
+ T && (o.value = { href: "" }), z && (n.value = { href: "" });
687
727
  }), {
688
- exploreLinkKebabMenu: y,
689
- requestsLinkKebabMenu: g,
690
- canShowKebabMenu: h,
691
- canGenerateRequestsLink: l,
692
- canGenerateExploreLink: f,
728
+ exploreLinkKebabMenu: L,
729
+ requestsLinkKebabMenu: w,
730
+ canShowKebabMenu: g,
731
+ canGenerateRequestsLink: p,
732
+ canGenerateExploreLink: y,
693
733
  requestsLinkZoomActions: o,
694
734
  exploreLinkZoomActions: n,
695
- buildExploreQuery: I,
696
- buildRequestsQueryZoomActions: w,
697
- buildExploreLink: O,
698
- buildRequestLink: T
735
+ buildExploreQuery: we,
736
+ buildRequestsQueryZoomActions: fe,
737
+ buildExploreLink: _e,
738
+ buildRequestLink: q
699
739
  };
700
740
  }
701
- const ps = (a, e, t) => {
702
- const i = [];
703
- return e && i.push(...e), i.push(...Ei(a, t)), i;
704
- };
705
- function ys() {
706
- const a = _e(ve), e = new AbortController();
707
- return et(() => {
708
- e.abort();
709
- }), { issueQuery: async (i, s, r) => {
741
+ function ks() {
742
+ const a = pe(ve), e = gt(), t = new AbortController();
743
+ return tt(() => {
744
+ t.abort();
745
+ }), { issueQuery: async (s, r, o) => {
710
746
  if (!a)
711
747
  throw new Error("Query bridge is not defined");
748
+ await e.isReady();
712
749
  const {
713
- datasource: o,
714
- limit: n,
715
- ...d
716
- } = i, u = o || "basic", h = ps(u, i.filters, s.filters);
717
- let l = i.time_range;
718
- l ? l.tz || (l = {
719
- ...l,
720
- tz: s.tz
721
- }) : l = {
722
- ...s.timeSpec,
723
- tz: s.tz
750
+ datasource: n,
751
+ limit: d,
752
+ ...h
753
+ } = s, u = n || "basic", l = [];
754
+ s.filters && l.push(...s.filters), l.push(...e.stripUnknownFilters({
755
+ datasource: u,
756
+ filters: r.filters
757
+ }));
758
+ let f = s.time_range;
759
+ f ? f.tz || (f = {
760
+ ...f,
761
+ tz: r.tz
762
+ }) : f = {
763
+ ...r.timeSpec,
764
+ tz: r.tz
724
765
  };
725
- const f = {
766
+ const g = {
726
767
  datasource: u,
727
768
  query: {
728
- ...d,
729
- time_range: l,
730
- filters: h,
731
- limit: r ?? n
769
+ ...h,
770
+ time_range: f,
771
+ filters: l,
772
+ limit: o ?? d
732
773
  }
733
774
  };
734
- return a.queryFn(f, e);
775
+ return a.queryFn(g, t);
735
776
  } };
736
777
  }
737
- function vs({
778
+ function Ts({
738
779
  context: a,
739
- globalFilters: e = A([]),
740
- isFullscreen: t = A(!1)
780
+ globalFilters: e = M([]),
781
+ isFullscreen: t = M(!1)
741
782
  }) {
742
- const i = Be(), s = k(() => a.value.timeSpec ? a.value.timeSpec : {
783
+ const i = $e(), s = R(() => a.value.timeSpec ? a.value.timeSpec : {
743
784
  type: "relative",
744
785
  time_range: i.defaultQueryTimeForOrg
745
786
  });
746
787
  return {
747
- internalContext: k(() => {
748
- var f, m, p;
749
- let { tz: o, refreshInterval: n, editable: d, showTileActions: u } = a.value;
750
- const h = [...a.value.filters ?? [], ...e.value];
751
- if (o || (o = new Intl.DateTimeFormat().resolvedOptions().timeZone), n === void 0 && (n = ts), t.value) {
788
+ internalContext: R(() => {
789
+ var f, g, p;
790
+ let { tz: o, refreshInterval: n, editable: d, showTileActions: h } = a.value;
791
+ const u = [...a.value.filters ?? [], ...e.value];
792
+ if (o || (o = new Intl.DateTimeFormat().resolvedOptions().timeZone), n === void 0 && (n = us), t.value) {
752
793
  let y = !1;
753
794
  if (s.value.type === "relative")
754
795
  y = ["15m", "1h", "6h", "12h", "24h"].includes(s.value.time_range);
755
796
  else {
756
- const M = s.value.start.getTime(), w = s.value.end.getTime();
757
- y = Math.abs(w - M) <= 864e5;
797
+ const L = s.value.start.getTime(), w = s.value.end.getTime();
798
+ y = Math.abs(w - L) <= 864e5;
758
799
  }
759
- const g = (/* @__PURE__ */ new Date()).getTime();
760
- s.value.type === "absolute" && s.value.end.getTime() < g || s.value.type === "relative" && ["previous_week", "previous_month"].includes(s.value.time_range) ? n = 0 : y ? n = is : n = ss;
800
+ const m = (/* @__PURE__ */ new Date()).getTime();
801
+ s.value.type === "absolute" && s.value.end.getTime() < m || s.value.type === "relative" && ["previous_week", "previous_month"].includes(s.value.time_range) ? n = 0 : y ? n = ds : n = cs;
761
802
  }
762
- d === void 0 && (d = !1), u === void 0 && (u = !0);
763
- const l = !!((p = (m = (f = vi()) == null ? void 0 : f.vnode) == null ? void 0 : m.props) != null && p.onTileTimeRangeZoom);
803
+ d === void 0 && (d = !1), h === void 0 && (h = !0);
804
+ const l = !!((p = (g = (f = Si()) == null ? void 0 : f.vnode) == null ? void 0 : g.props) != null && p.onTileTimeRangeZoom);
764
805
  return {
765
- filters: h,
806
+ filters: u,
766
807
  tz: o,
767
808
  timeSpec: s.value,
768
809
  refreshInterval: n,
769
810
  editable: d,
770
- showTileActions: u,
811
+ showTileActions: h,
771
812
  zoomable: l
772
813
  };
773
814
  })
774
815
  };
775
816
  }
776
- const ue = {
777
- useContextLinks: ms,
778
- useDashboardInternalContext: vs,
779
- useEvaluateFeatureFlag: rs,
780
- useI18n: Zi,
781
- useIssueQuery: ys,
782
- useRequestQueue: fs
783
- }, ft = /* @__PURE__ */ J({
817
+ const le = {
818
+ useContextLinks: Rs,
819
+ useDashboardInternalContext: Ts,
820
+ useEvaluateFeatureFlag: fs,
821
+ useI18n: as,
822
+ useIssueQuery: ks,
823
+ useRequestQueue: Es
824
+ }, pt = /* @__PURE__ */ Z({
784
825
  __name: "QueryDataProvider",
785
826
  props: {
786
827
  context: {},
@@ -791,12 +832,12 @@ const ue = {
791
832
  },
792
833
  emits: ["chart-data", "queryComplete"],
793
834
  setup(a, { emit: e }) {
794
- const t = a, i = e, { i18n: s } = ue.useI18n(), { issueQuery: r } = ue.useIssueQuery(), o = _e(ve), n = () => t.queryReady && o ? JSON.stringify([t.query, t.context, t.refreshCounter]) : null, { data: d, error: u, isValidating: h } = Ni(n, async () => {
835
+ const t = a, i = e, { i18n: s } = le.useI18n(), { issueQuery: r } = le.useIssueQuery(), o = pe(ve), n = () => t.queryReady && o ? JSON.stringify([t.query, t.context, t.refreshCounter]) : null, { data: d, error: h, isValidating: u } = $i(n, async () => {
795
836
  try {
796
- const g = await r(t.query, t.context, t.limitOverride);
797
- return m.value = null, g;
798
- } catch (g) {
799
- throw m.value = Ti(g), g;
837
+ const m = await r(t.query, t.context, t.limitOverride);
838
+ return g.value = null, m;
839
+ } catch (m) {
840
+ throw g.value = Hi(m), m;
800
841
  } finally {
801
842
  i("queryComplete");
802
843
  }
@@ -804,49 +845,49 @@ const ue = {
804
845
  refreshInterval: t.context.refreshInterval,
805
846
  revalidateOnFocus: !1,
806
847
  shouldRetryOnError: !1
807
- }), { state: l, swrvState: f } = Gi(d, u, h), m = A(null), p = k(() => l.value === f.ERROR || !!m.value), y = k(() => !t.queryReady || l.value === f.PENDING);
808
- return Le([() => d.value, () => l.value], ([g, T]) => {
809
- g && (T === "SUCCESS_HAS_DATA" || T === "SUCCESS") && i("chart-data", g);
810
- }), (g, T) => {
811
- var I;
812
- const M = de("KSkeleton"), w = de("KEmptyState");
813
- return y.value || !x(d) && !p.value ? (C(), L(M, {
848
+ }), { state: l, swrvState: f } = Ji(d, h, u), g = M(null), p = R(() => l.value === f.ERROR || !!g.value), y = R(() => !t.queryReady || l.value === f.PENDING);
849
+ return Le([() => d.value, () => l.value], ([m, k]) => {
850
+ m && (k === "SUCCESS_HAS_DATA" || k === "SUCCESS") && i("chart-data", m);
851
+ }), (m, k) => {
852
+ var q;
853
+ const L = ue("KSkeleton"), w = ue("KEmptyState");
854
+ return y.value || !x(d) && !p.value ? (C(), I(L, {
814
855
  key: 0,
815
856
  class: "chart-skeleton",
816
857
  type: "table"
817
- })) : p.value ? (C(), L(w, {
858
+ })) : p.value ? (C(), I(w, {
818
859
  key: 1,
819
860
  "action-button-visible": !1,
820
861
  "data-testid": "chart-empty-state"
821
- }, tt({
862
+ }, it({
822
863
  icon: P(() => {
823
- var O;
864
+ var A;
824
865
  return [
825
- ((O = m.value) == null ? void 0 : O.type) === "forbidden" ? (C(), L(x(Oi), { key: 0 })) : (C(), L(x(Hi), { key: 1 }))
866
+ ((A = g.value) == null ? void 0 : A.type) === "forbidden" ? (C(), I(x(Ui), { key: 0 })) : (C(), I(x(Gi), { key: 1 }))
826
867
  ];
827
868
  }),
828
869
  title: P(() => {
829
- var O;
870
+ var A;
830
871
  return [
831
- Z("p", null, ie(((O = m.value) == null ? void 0 : O.message) || x(s).t("renderer.unexpectedError")), 1)
872
+ X("p", null, ee(((A = g.value) == null ? void 0 : A.message) || x(s).t("renderer.unexpectedError")), 1)
832
873
  ];
833
874
  }),
834
875
  _: 2
835
876
  }, [
836
- (I = m.value) != null && I.details ? {
877
+ (q = g.value) != null && q.details ? {
837
878
  name: "default",
838
879
  fn: P(() => [
839
- Z("p", null, ie(m.value.details), 1)
880
+ X("p", null, ee(g.value.details), 1)
840
881
  ]),
841
882
  key: "0"
842
883
  } : void 0
843
- ]), 1024)) : x(d) ? Ae(g.$slots, "default", {
884
+ ]), 1024)) : x(d) ? Ae(m.$slots, "default", {
844
885
  key: 2,
845
886
  data: x(d)
846
- }) : Y("", !0);
887
+ }) : V("", !0);
847
888
  };
848
889
  }
849
- }), _s = /* @__PURE__ */ J({
890
+ }), Ss = /* @__PURE__ */ Z({
850
891
  __name: "SimpleChartRenderer",
851
892
  props: {
852
893
  query: {},
@@ -859,19 +900,19 @@ const ue = {
859
900
  exploreLink: {}
860
901
  },
861
902
  setup(a) {
862
- const e = a, t = k(() => e.chartOptions.type === "single_value");
863
- return (i, s) => (C(), L(ft, {
903
+ const e = a, t = R(() => e.chartOptions.type === "single_value");
904
+ return (i, s) => (C(), I(pt, {
864
905
  context: a.context,
865
906
  query: a.query,
866
907
  "query-ready": a.queryReady,
867
908
  "refresh-counter": a.refreshCounter
868
909
  }, {
869
910
  default: P(({ data: r }) => [
870
- Z("div", {
871
- class: De(["analytics-chart", { "single-value": t.value }]),
872
- style: nt(t.value ? void 0 : { height: `${a.height}px` })
911
+ X("div", {
912
+ class: ze(["analytics-chart", { "single-value": t.value }]),
913
+ style: at(t.value ? void 0 : { height: `${a.height}px` })
873
914
  }, [
874
- le(x(ki), {
915
+ oe(x(Ii), {
875
916
  "chart-data": r,
876
917
  "chart-options": a.chartOptions,
877
918
  "synthetics-data-key": t.value ? void 0 : a.chartOptions.synthetics_data_key
@@ -886,7 +927,7 @@ const ue = {
886
927
  for (const [i, s] of e)
887
928
  t[i] = s;
888
929
  return t;
889
- }, St = /* @__PURE__ */ be(_s, [["__scopeId", "data-v-d4c69df4"]]), bs = { class: "analytics-chart" }, ws = /* @__PURE__ */ J({
930
+ }, Ht = /* @__PURE__ */ be(Ss, [["__scopeId", "data-v-d4c69df4"]]), Ds = { class: "analytics-chart" }, zs = /* @__PURE__ */ Z({
890
931
  __name: "BaseAnalyticsChartRenderer",
891
932
  props: {
892
933
  query: {},
@@ -901,20 +942,20 @@ const ue = {
901
942
  },
902
943
  emits: ["edit-tile", "chart-data", "zoom-time-range", "view-requests", "select-chart-range"],
903
944
  setup(a, { emit: e }) {
904
- const t = a, i = e, { i18n: s } = ue.useI18n(), r = k(() => ({
945
+ const t = a, i = e, { i18n: s } = le.useI18n(), r = R(() => ({
905
946
  type: t.chartOptions.type,
906
947
  stacked: t.chartOptions.stacked ?? !1,
907
948
  chartDatasetColors: t.chartOptions.chart_dataset_colors,
908
949
  threshold: t.chartOptions.threshold,
909
950
  hideTruncationWarning: t.query.limit !== void 0 && t.query.limit > 0
910
- })), o = k(() => t.context.zoomable), n = () => {
951
+ })), o = R(() => t.context.zoomable), n = () => {
911
952
  i("edit-tile");
912
- }, d = (u) => {
913
- i("chart-data", u);
953
+ }, d = (h) => {
954
+ i("chart-data", h);
914
955
  };
915
- return (u, h) => {
916
- const l = de("KDropdownItem");
917
- return C(), L(ft, {
956
+ return (h, u) => {
957
+ const l = ue("KDropdownItem");
958
+ return C(), I(pt, {
918
959
  context: a.context,
919
960
  query: a.query,
920
961
  "query-ready": a.queryReady,
@@ -922,8 +963,8 @@ const ue = {
922
963
  onChartData: d
923
964
  }, {
924
965
  default: P(({ data: f }) => [
925
- Z("div", bs, [
926
- le(x(Si), qt({
966
+ X("div", Ds, [
967
+ oe(x(Mi), Wt({
927
968
  "chart-data": f,
928
969
  "chart-options": r.value,
929
970
  "explore-link": a.exploreLink,
@@ -933,15 +974,15 @@ const ue = {
933
974
  "timeseries-zoom": o.value,
934
975
  "tooltip-title": ""
935
976
  }, a.extraProps, {
936
- onSelectChartRange: h[0] || (h[0] = (m) => i("select-chart-range", m)),
937
- onZoomTimeRange: h[1] || (h[1] = (m) => i("zoom-time-range", m))
938
- }), tt({ _: 2 }, [
977
+ onSelectChartRange: u[0] || (u[0] = (g) => i("select-chart-range", g)),
978
+ onZoomTimeRange: u[1] || (u[1] = (g) => i("zoom-time-range", g))
979
+ }), it({ _: 2 }, [
939
980
  a.context.editable ? {
940
981
  name: "menu-items",
941
982
  fn: P(() => [
942
- le(l, { onClick: n }, {
983
+ oe(l, { onClick: n }, {
943
984
  default: P(() => [
944
- ht(ie(x(s).t("renderer.edit")), 1)
985
+ dt(ee(x(s).t("renderer.edit")), 1)
945
986
  ]),
946
987
  _: 1
947
988
  })
@@ -955,7 +996,7 @@ const ue = {
955
996
  }, 8, ["context", "query", "query-ready", "refresh-counter"]);
956
997
  };
957
998
  }
958
- }), gt = /* @__PURE__ */ be(ws, [["__scopeId", "data-v-52357845"]]), zt = /* @__PURE__ */ J({
999
+ }), yt = /* @__PURE__ */ be(zs, [["__scopeId", "data-v-52357845"]]), It = /* @__PURE__ */ Z({
959
1000
  __name: "BarChartRenderer",
960
1001
  props: {
961
1002
  query: {},
@@ -968,7 +1009,7 @@ const ue = {
968
1009
  exploreLink: {}
969
1010
  },
970
1011
  setup(a) {
971
- return (e, t) => (C(), L(gt, {
1012
+ return (e, t) => (C(), I(yt, {
972
1013
  "chart-options": a.chartOptions,
973
1014
  context: a.context,
974
1015
  "extra-props": { showAnnotations: !1 },
@@ -978,7 +1019,7 @@ const ue = {
978
1019
  "refresh-counter": a.refreshCounter
979
1020
  }, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
980
1021
  }
981
- }), Dt = /* @__PURE__ */ J({
1022
+ }), Mt = /* @__PURE__ */ Z({
982
1023
  __name: "TimeseriesChartRenderer",
983
1024
  props: {
984
1025
  query: {},
@@ -993,7 +1034,7 @@ const ue = {
993
1034
  emits: ["zoom-time-range", "select-chart-range"],
994
1035
  setup(a, { emit: e }) {
995
1036
  const t = e;
996
- return (i, s) => (C(), L(gt, {
1037
+ return (i, s) => (C(), I(yt, {
997
1038
  "chart-options": a.chartOptions,
998
1039
  context: a.context,
999
1040
  "explore-link": a.exploreLink,
@@ -1006,7 +1047,7 @@ const ue = {
1006
1047
  onZoomTimeRange: s[1] || (s[1] = (r) => t("zoom-time-range", r))
1007
1048
  }, null, 8, ["chart-options", "context", "explore-link", "height", "query", "query-ready", "refresh-counter", "requests-link"]));
1008
1049
  }
1009
- }), Es = /* @__PURE__ */ J({
1050
+ }), Ns = /* @__PURE__ */ Z({
1010
1051
  __name: "GoldenSignalsRenderer",
1011
1052
  props: {
1012
1053
  query: {},
@@ -1019,7 +1060,7 @@ const ue = {
1019
1060
  exploreLink: {}
1020
1061
  },
1021
1062
  setup(a) {
1022
- const e = a, t = k(() => {
1063
+ const e = a, t = R(() => {
1023
1064
  var s, r;
1024
1065
  const i = (s = e.query) == null ? void 0 : s.datasource;
1025
1066
  if (i && i !== "api_usage" && i !== "basic")
@@ -1036,29 +1077,29 @@ const ue = {
1036
1077
  refreshCounter: e.refreshCounter
1037
1078
  };
1038
1079
  });
1039
- return (i, s) => (C(), G("div", {
1040
- class: De(["metric-card-tile-wrapper", { titled: !!e.chartOptions.chart_title }])
1080
+ return (i, s) => (C(), W("div", {
1081
+ class: ze(["metric-card-tile-wrapper", { titled: !!e.chartOptions.chart_title }])
1041
1082
  }, [
1042
- le(x(Bi), _i(bi(t.value)), {
1083
+ oe(x(ji), Di(zi(t.value)), {
1043
1084
  default: P(() => [
1044
- le(x(Fi))
1085
+ oe(x(Xi))
1045
1086
  ]),
1046
1087
  _: 1
1047
1088
  }, 16)
1048
1089
  ], 2));
1049
1090
  }
1050
- }), xs = /* @__PURE__ */ be(Es, [["__scopeId", "data-v-8a51fd28"]]), Cs = {
1091
+ }), Ls = /* @__PURE__ */ be(Ns, [["__scopeId", "data-v-8a51fd28"]]), As = {
1051
1092
  class: "fallback-entity-link",
1052
1093
  "data-testid": "entity-link-parent"
1053
- }, Nt = /* @__PURE__ */ J({
1094
+ }, qt = /* @__PURE__ */ Z({
1054
1095
  __name: "FallbackEntityLink",
1055
1096
  props: {
1056
1097
  entityLinkData: {}
1057
1098
  },
1058
1099
  setup(a) {
1059
- return (e, t) => (C(), G("div", Cs, ie(a.entityLinkData.label), 1));
1100
+ return (e, t) => (C(), W("div", As, ee(a.entityLinkData.label), 1));
1060
1101
  }
1061
- }), Rs = /* @__PURE__ */ J({
1102
+ }), Os = /* @__PURE__ */ Z({
1062
1103
  __name: "TopNTableRenderer",
1063
1104
  props: {
1064
1105
  query: {},
@@ -1071,39 +1112,39 @@ const ue = {
1071
1112
  exploreLink: {}
1072
1113
  },
1073
1114
  setup(a) {
1074
- const e = a, t = _e(ve), i = Pt(async () => {
1115
+ const e = a, t = pe(ve), i = Kt(async () => {
1075
1116
  if (t != null && t.fetchComponent)
1076
1117
  try {
1077
1118
  return await t.fetchComponent("EntityLink");
1078
1119
  } catch {
1079
- return Nt;
1120
+ return qt;
1080
1121
  }
1081
- return Nt;
1122
+ return qt;
1082
1123
  }), s = (r) => {
1083
1124
  var o;
1084
1125
  if ((o = e.chartOptions) != null && o.entity_link)
1085
1126
  if (r.id.includes(":")) {
1086
1127
  const [n, d] = r.id.split(":");
1087
- return e.chartOptions.entity_link.replace(Ji, n).replace(Rt, d);
1128
+ return e.chartOptions.entity_link.replace(ls, n).replace(Dt, d);
1088
1129
  } else
1089
- return e.chartOptions.entity_link.replace(Rt, r.id);
1130
+ return e.chartOptions.entity_link.replace(Dt, r.id);
1090
1131
  return "";
1091
1132
  };
1092
- return (r, o) => (C(), L(ft, {
1133
+ return (r, o) => (C(), I(pt, {
1093
1134
  context: a.context,
1094
1135
  query: a.query,
1095
1136
  "query-ready": a.queryReady,
1096
1137
  "refresh-counter": a.refreshCounter
1097
1138
  }, {
1098
1139
  default: P(({ data: n }) => [
1099
- le(x(zi), {
1140
+ oe(x(qi), {
1100
1141
  data: n,
1101
1142
  "synthetics-data-key": a.chartOptions.synthetics_data_key
1102
- }, tt({ _: 2 }, [
1143
+ }, it({ _: 2 }, [
1103
1144
  e.chartOptions.entity_link ? {
1104
1145
  name: "name",
1105
1146
  fn: P(({ record: d }) => [
1106
- le(x(i), {
1147
+ oe(x(i), {
1107
1148
  "entity-link-data": {
1108
1149
  id: d.id,
1109
1150
  label: d.name,
@@ -1119,7 +1160,7 @@ const ue = {
1119
1160
  _: 1
1120
1161
  }, 8, ["context", "query", "query-ready", "refresh-counter"]));
1121
1162
  }
1122
- }), Lt = "#6c7489", Ts = "12px", At = "20px", Ot = "32px", ei = "20px", ks = /* @__PURE__ */ J({
1163
+ }), Pt = "#6c7489", Hs = "12px", $t = "20px", Bt = "32px", ai = "20px", Is = /* @__PURE__ */ Z({
1123
1164
  __name: "DonutChartRenderer",
1124
1165
  props: {
1125
1166
  query: {},
@@ -1132,7 +1173,7 @@ const ue = {
1132
1173
  exploreLink: {}
1133
1174
  },
1134
1175
  setup(a) {
1135
- return (e, t) => (C(), L(gt, {
1176
+ return (e, t) => (C(), I(yt, {
1136
1177
  "chart-options": a.chartOptions,
1137
1178
  context: a.context,
1138
1179
  height: a.height,
@@ -1141,15 +1182,15 @@ const ue = {
1141
1182
  "refresh-counter": a.refreshCounter
1142
1183
  }, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
1143
1184
  }
1144
- }), Ss = ["data-testid"], zs = {
1185
+ }), Ms = ["data-testid"], qs = {
1145
1186
  key: 0,
1146
1187
  class: "tile-header"
1147
- }, Ds = { class: "badge-container" }, Ns = { class: "badge-text" }, Ls = { key: 0 }, As = ["data-testid"], Os = ["data-testid"], Hs = { class: "delete-option" }, Is = ["data-testid"], Ms = ["data-testid"], qs = /* @__PURE__ */ J({
1188
+ }, Ps = { class: "badge-container" }, $s = { class: "badge-text" }, Bs = { key: 0 }, Fs = ["data-testid"], Us = ["data-testid"], Gs = { class: "delete-option" }, Ws = ["data-testid"], Ks = ["data-testid"], Vs = /* @__PURE__ */ Z({
1148
1189
  __name: "DashboardTile",
1149
- props: /* @__PURE__ */ Ke({
1190
+ props: /* @__PURE__ */ Ve({
1150
1191
  context: {},
1151
1192
  definition: {},
1152
- height: { default: Fe },
1193
+ height: { default: Be },
1153
1194
  isFullscreen: { type: Boolean },
1154
1195
  hideActions: { type: Boolean, default: !1 },
1155
1196
  queryReady: { type: Boolean },
@@ -1159,60 +1200,60 @@ const ue = {
1159
1200
  refreshCounter: { default: 0 },
1160
1201
  refreshCounterModifiers: {}
1161
1202
  }),
1162
- emits: /* @__PURE__ */ Ke(["chart-data", "edit-tile", "duplicate-tile", "remove-tile", "tile-time-range-zoom", "tile-bounds-change"], ["update:refreshCounter"]),
1203
+ emits: /* @__PURE__ */ Ve(["chart-data", "edit-tile", "duplicate-tile", "remove-tile", "tile-time-range-zoom", "tile-bounds-change"], ["update:refreshCounter"]),
1163
1204
  setup(a, { expose: e, emit: t }) {
1164
- ut((v) => ({
1165
- a3979a26: `${v.height}px`
1205
+ ct((v) => ({
1206
+ v57da23f2: `${v.height}px`
1166
1207
  }));
1167
- const i = parseInt(ei, 10), s = a, r = $t(a, "refreshCounter"), o = () => {
1168
- g.value = !0, r.value++;
1169
- }, n = t, d = Pt(() => import("./GeoMapRenderer-DwpwiD-Y.js")), u = _e(ve), { i18n: h } = ue.useI18n(), l = A(), f = A({ status: "loading" }), m = A(!1), p = A(), y = A(!1), g = A(!0), {
1170
- exploreLinkKebabMenu: T,
1171
- requestsLinkKebabMenu: M,
1172
- canShowKebabMenu: w,
1173
- canGenerateRequestsLink: I,
1174
- canGenerateExploreLink: O,
1175
- requestsLinkZoomActions: R,
1176
- exploreLinkZoomActions: q,
1177
- buildExploreQuery: se,
1178
- buildExploreLink: me,
1179
- buildRequestLink: j,
1180
- buildRequestsQueryZoomActions: pe
1181
- } = ue.useContextLinks({
1182
- queryBridge: u,
1183
- chartData: rt(l),
1184
- definition: rt(Oe(s, "definition")),
1185
- context: rt(Oe(s, "context"))
1186
- }), { issueQuery: we } = ue.useIssueQuery();
1187
- Le(() => s.definition, async (v, D) => {
1188
- await dt(), p.value && (y.value = p.value.scrollWidth > p.value.clientWidth);
1208
+ const i = parseInt(ai, 10), s = a, r = Vt(a, "refreshCounter"), o = () => {
1209
+ L.value = !0, r.value++;
1210
+ }, n = t, d = Kt(() => import("./GeoMapRenderer-CTei4zeC.js")), h = pe(ve), u = gt(), { stripUnknownFilters: l } = oi(u), { i18n: f } = le.useI18n(), g = M(), p = M({ status: "loading" }), y = M(!1), m = M(), k = M(!1), L = M(!0), {
1211
+ exploreLinkKebabMenu: w,
1212
+ requestsLinkKebabMenu: q,
1213
+ canShowKebabMenu: A,
1214
+ canGenerateRequestsLink: fe,
1215
+ canGenerateExploreLink: we,
1216
+ requestsLinkZoomActions: _e,
1217
+ exploreLinkZoomActions: T,
1218
+ buildExploreQuery: z,
1219
+ buildExploreLink: re,
1220
+ buildRequestLink: ge,
1221
+ buildRequestsQueryZoomActions: Ee
1222
+ } = le.useContextLinks({
1223
+ queryBridge: h,
1224
+ chartData: ot(g),
1225
+ definition: ot(De(s, "definition")),
1226
+ context: ot(De(s, "context"))
1227
+ }), { issueQuery: S } = le.useIssueQuery();
1228
+ Le(() => s.definition, async (v, N) => {
1229
+ await ft(), m.value && (k.value = m.value.scrollWidth > m.value.clientWidth);
1189
1230
  try {
1190
- JSON.stringify(v == null ? void 0 : v.query) !== JSON.stringify(D == null ? void 0 : D.query) && (g.value = !0);
1231
+ JSON.stringify(v == null ? void 0 : v.query) !== JSON.stringify(N == null ? void 0 : N.query) && (L.value = !0);
1191
1232
  } catch {
1192
1233
  }
1193
1234
  }, { immediate: !0, deep: !0 });
1194
- const Ee = k(() => h.t("csvExport.defaultFilename")), S = k(() => w.value && !s.hideActions && (H.value || s.context.editable)), H = k(() => !!T.value || ("allow_csv_export" in s.definition.chart ? s.definition.chart.allow_csv_export : !0) || s.context.editable), B = {
1195
- timeseries_line: Dt,
1196
- timeseries_bar: Dt,
1197
- horizontal_bar: zt,
1198
- vertical_bar: zt,
1199
- gauge: St,
1200
- donut: ks,
1201
- golden_signals: xs,
1202
- top_n: Rs,
1235
+ const O = R(() => f.t("csvExport.defaultFilename")), $ = R(() => A.value && !s.hideActions && (F.value || s.context.editable)), F = R(() => !!w.value || ("allow_csv_export" in s.definition.chart ? s.definition.chart.allow_csv_export : !0) || s.context.editable), ne = {
1236
+ timeseries_line: Mt,
1237
+ timeseries_bar: Mt,
1238
+ horizontal_bar: It,
1239
+ vertical_bar: It,
1240
+ gauge: Ht,
1241
+ donut: Is,
1242
+ golden_signals: Ls,
1243
+ top_n: Os,
1203
1244
  slottable: void 0,
1204
- single_value: St,
1245
+ single_value: Ht,
1205
1246
  choropleth_map: d
1206
- }, W = k(() => {
1207
- var v, D, N;
1247
+ }, Fe = R(() => {
1248
+ var v, N, H;
1208
1249
  return {
1209
- ...(v = K.value) != null && v.rendererEvents.supportsRequests ? { "select-chart-range": gi } : {},
1210
- ...(D = K.value) != null && D.rendererEvents.supportsZoom ? { "zoom-time-range": ci } : {},
1211
- ...(N = K.value) != null && N.rendererEvents.supportsBounds ? { "bounds-change": fi } : {}
1250
+ ...(v = xe.value) != null && v.rendererEvents.supportsRequests ? { "select-chart-range": wi } : {},
1251
+ ...(N = xe.value) != null && N.rendererEvents.supportsZoom ? { "zoom-time-range": _i } : {},
1252
+ ...(H = xe.value) != null && H.rendererEvents.supportsBounds ? { "bounds-change": bi } : {}
1212
1253
  };
1213
- }), K = k(() => {
1214
- var ee, ae;
1215
- const v = B[s.definition.chart.type], D = !!((ee = v == null ? void 0 : v.emits) != null && ee.includes("select-chart-range")), N = !!((ae = v == null ? void 0 : v.emits) != null && ae.includes("zoom-time-range")), Q = s.definition.chart.type === "choropleth_map";
1254
+ }), xe = R(() => {
1255
+ var j, he;
1256
+ const v = ne[s.definition.chart.type], N = !!((j = v == null ? void 0 : v.emits) != null && j.includes("select-chart-range")), H = !!((he = v == null ? void 0 : v.emits) != null && he.includes("zoom-time-range")), Y = s.definition.chart.type === "choropleth_map";
1216
1257
  return v && {
1217
1258
  component: v,
1218
1259
  rendererProps: {
@@ -1222,260 +1263,264 @@ const ue = {
1222
1263
  chartOptions: s.definition.chart,
1223
1264
  height: s.height - i * 2,
1224
1265
  refreshCounter: r.value,
1225
- requestsLink: R.value,
1226
- exploreLink: q.value
1266
+ requestsLink: _e.value,
1267
+ exploreLink: T.value
1227
1268
  },
1228
1269
  rendererEvents: {
1229
- supportsRequests: D,
1230
- supportsZoom: N,
1231
- supportsBounds: Q
1270
+ supportsRequests: N,
1271
+ supportsZoom: H,
1272
+ supportsBounds: Y
1232
1273
  }
1233
1274
  };
1234
- }), xe = k(() => {
1235
- var D;
1236
- const v = (D = s.definition.query) == null ? void 0 : D.time_range;
1275
+ }), rt = R(() => {
1276
+ var N;
1277
+ const v = (N = s.definition.query) == null ? void 0 : N.time_range;
1237
1278
  if ((v == null ? void 0 : v.type) === "relative") {
1238
- const N = xi.get(Ci[v.time_range]);
1239
- return N ? N.display : (console.warn("Did not recognize the given relative time range:", v.time_range), v.time_range);
1279
+ const H = Li.get(Ai[v.time_range]);
1280
+ return H ? H.display : (console.warn("Did not recognize the given relative time range:", v.time_range), v.time_range);
1240
1281
  } else if ((v == null ? void 0 : v.type) === "absolute") {
1241
- const N = v.tz || "Etc/UTC";
1242
- return `${Ct(v.start, { short: !0, tz: N })} - ${Ct(v.end, { short: !0, tz: N })}`;
1282
+ const H = v.tz || "Etc/UTC";
1283
+ return `${St(v.start, { short: !0, tz: H })} - ${St(v.end, { short: !0, tz: H })}`;
1243
1284
  }
1244
1285
  return null;
1245
- }), yt = k(() => {
1286
+ }), bt = R(() => {
1246
1287
  if (s.definition.chart.type === "slottable")
1247
1288
  return !1;
1248
- const v = !!s.definition.chart.chart_title, D = s.definition.chart.type === "golden_signals" && !!s.definition.chart.description, N = s.showRefresh, Q = S.value && H.value && !s.isFullscreen, ee = !!xe.value;
1249
- return v || Q || ee || D || N;
1250
- }), vt = k(() => l.value ? ot(l.value.meta.granularity_ms) : void 0), si = k(() => ["timeseries_line", "timeseries_bar"].includes(s.definition.chart.type)), _t = k(() => {
1251
- var D, N;
1252
- if (!si.value || !s.queryReady || g.value)
1289
+ const v = !!s.definition.chart.chart_title, N = s.definition.chart.type === "golden_signals" && !!s.definition.chart.description, H = s.showRefresh, Y = $.value && F.value && !s.isFullscreen, j = !!rt.value;
1290
+ return v || Y || j || N || H;
1291
+ }), wt = R(() => g.value ? lt(g.value.meta.granularity_ms) : void 0), ui = R(() => ["timeseries_line", "timeseries_bar"].includes(s.definition.chart.type)), Et = R(() => {
1292
+ var N, H;
1293
+ if (!ui.value || !s.queryReady || L.value)
1253
1294
  return !1;
1254
- const v = (N = (D = s.definition) == null ? void 0 : D.query) == null ? void 0 : N.granularity;
1255
- return !v || !vt.value ? !1 : v !== vt.value;
1256
- }), ri = k(() => {
1257
- var N, Q, ee;
1258
- const v = ot(((N = l.value) == null ? void 0 : N.meta.granularity_ms) ?? 0) ?? "unknown", D = ((ee = (Q = s.definition) == null ? void 0 : Q.query) == null ? void 0 : ee.granularity) ?? "unknown";
1259
- return h.t("query_aged_out_warning", {
1260
- currentGranularity: h.t(`granularities.${v}`),
1261
- savedGranularity: h.t(`granularities.${D}`)
1295
+ const v = (H = (N = s.definition) == null ? void 0 : N.query) == null ? void 0 : H.granularity;
1296
+ return !v || !wt.value ? !1 : v !== wt.value;
1297
+ }), di = R(() => {
1298
+ var H, Y, j;
1299
+ const v = lt(((H = g.value) == null ? void 0 : H.meta.granularity_ms) ?? 0) ?? "unknown", N = ((j = (Y = s.definition) == null ? void 0 : Y.query) == null ? void 0 : j.granularity) ?? "unknown";
1300
+ return f.t("query_aged_out_warning", {
1301
+ currentGranularity: f.t(`granularities.${v}`),
1302
+ savedGranularity: f.t(`granularities.${N}`)
1262
1303
  });
1263
- }), ni = k(() => {
1264
- var N, Q;
1265
- const v = [...s.context.filters, ...s.definition.query.filters ?? []], D = ((Q = (N = s.definition) == null ? void 0 : N.query) == null ? void 0 : Q.datasource) ?? "api_usage";
1266
- return v.filter((ee) => Gt(ee.field).some((Ce) => D === Ce));
1267
- }), oi = () => {
1304
+ }), ci = R(() => {
1305
+ var Y, j;
1306
+ const v = [...s.context.filters, ...s.definition.query.filters ?? []], N = s.definition.query.metrics, H = ((j = (Y = s.definition) == null ? void 0 : Y.query) == null ? void 0 : j.datasource) ?? "api_usage";
1307
+ return l.value({
1308
+ datasource: H,
1309
+ filters: v,
1310
+ metrics: N
1311
+ });
1312
+ }), fi = () => {
1268
1313
  n("edit-tile", s.definition);
1269
- }, ai = () => {
1314
+ }, gi = () => {
1270
1315
  n("duplicate-tile", s.definition);
1271
- }, li = () => {
1316
+ }, mi = () => {
1272
1317
  n("remove-tile", s.definition);
1273
- }, hi = (v) => {
1274
- l.value = v, g.value = !1, n("chart-data", v);
1275
- }, ui = () => {
1276
- m.value = !1;
1277
- }, bt = () => {
1278
- var N, Q;
1279
- const v = (N = s.definition.query.datasource) == null ? void 0 : N.startsWith("goap");
1280
- return ((Q = u == null ? void 0 : u.staticConfig) == null ? void 0 : Q.increaseCsvExportLimit) !== !1 && !v ? we(s.definition.query, s.context, Ri) : l.value ? Promise.resolve(l.value) : new Promise((ee) => {
1281
- const ae = Le(l, (Ce) => {
1282
- Ce && (ee(Ce), ae());
1318
+ }, pi = (v) => {
1319
+ g.value = v, L.value = !1, n("chart-data", v);
1320
+ }, yi = () => {
1321
+ y.value = !1;
1322
+ }, xt = () => {
1323
+ var H, Y;
1324
+ const v = (H = s.definition.query.datasource) == null ? void 0 : H.startsWith("goap");
1325
+ return ((Y = h == null ? void 0 : h.staticConfig) == null ? void 0 : Y.increaseCsvExportLimit) !== !1 && !v ? S(s.definition.query, s.context, Oi) : g.value ? Promise.resolve(g.value) : new Promise((j) => {
1326
+ const he = Le(g, (Ue) => {
1327
+ Ue && (j(Ue), he());
1283
1328
  });
1284
1329
  });
1285
- }, di = async () => {
1286
- m.value = !0, f.value = { status: "loading" };
1330
+ }, vi = async () => {
1331
+ y.value = !0, p.value = { status: "loading" };
1287
1332
  try {
1288
- const v = await bt();
1289
- f.value = { status: "success", chartData: v };
1333
+ const v = await xt();
1334
+ p.value = { status: "success", chartData: v };
1290
1335
  } catch (v) {
1291
- f.value = { status: "error", error: v };
1336
+ p.value = { status: "error", error: v };
1292
1337
  }
1293
- }, ci = (v) => {
1294
- const D = {
1338
+ }, _i = (v) => {
1339
+ const N = {
1295
1340
  tileId: s.tileId.toString(),
1296
1341
  timeRange: v
1297
1342
  };
1298
- n("tile-time-range-zoom", D);
1299
- }, fi = (v) => {
1300
- const D = {
1343
+ n("tile-time-range-zoom", N);
1344
+ }, bi = (v) => {
1345
+ const N = {
1301
1346
  tileId: s.tileId.toString(),
1302
1347
  bounds: v
1303
1348
  };
1304
- n("tile-bounds-change", D);
1305
- }, gi = (v) => {
1306
- const D = ni.value, N = pe(v, D), Q = se(v, D);
1307
- R.value = I.value ? { href: j(N) } : void 0, q.value = O.value ? { href: me(Q) } : void 0;
1349
+ n("tile-bounds-change", N);
1350
+ }, wi = (v) => {
1351
+ const N = ci.value, H = z(v, N);
1352
+ T.value = we.value ? { href: re(H) } : void 0, _e.value = fe.value ? { href: ge(Ee(v, N)) } : void 0;
1308
1353
  };
1309
- return e({ getExportData: bt }), (v, D) => {
1310
- const N = de("KTooltip"), Q = de("KBadge"), ee = de("KButton"), ae = de("KDropdownItem"), Ce = de("KDropdown");
1311
- return C(), G("div", {
1312
- class: De(["tile-boundary", {
1354
+ return e({ getExportData: xt }), (v, N) => {
1355
+ const H = ue("KTooltip"), Y = ue("KBadge"), j = ue("KButton"), he = ue("KDropdownItem"), Ue = ue("KDropdown");
1356
+ return C(), W("div", {
1357
+ class: ze(["tile-boundary", {
1313
1358
  editable: a.context.editable,
1314
- headless: !yt.value
1359
+ headless: !bt.value
1315
1360
  }]),
1316
1361
  "data-testid": `tile-${a.tileId}`
1317
1362
  }, [
1318
- yt.value && a.definition.chart.type !== "slottable" ? (C(), G("div", zs, [
1319
- le(N, {
1363
+ bt.value && a.definition.chart.type !== "slottable" ? (C(), W("div", qs, [
1364
+ oe(H, {
1320
1365
  class: "title-tooltip",
1321
- disabled: !y.value,
1366
+ disabled: !k.value,
1322
1367
  "max-width": "500",
1323
1368
  text: a.definition.chart.chart_title
1324
1369
  }, {
1325
1370
  default: P(() => [
1326
- Z("div", {
1371
+ X("div", {
1327
1372
  ref_key: "titleRef",
1328
- ref: p,
1373
+ ref: m,
1329
1374
  class: "title"
1330
- }, ie(a.definition.chart.chart_title), 513)
1375
+ }, ee(a.definition.chart.chart_title), 513)
1331
1376
  ]),
1332
1377
  _: 1
1333
1378
  }, 8, ["disabled", "text"]),
1334
- Z("div", Ds, [
1335
- xe.value ? (C(), L(Q, {
1379
+ X("div", Ps, [
1380
+ rt.value ? (C(), I(Y, {
1336
1381
  key: 0,
1337
1382
  "data-testid": "time-range-badge",
1338
- tooltip: _t.value ? ri.value : void 0,
1383
+ tooltip: Et.value ? di.value : void 0,
1339
1384
  "tooltip-attributes": { maxWidth: "320px" }
1340
- }, tt({
1385
+ }, it({
1341
1386
  default: P(() => [
1342
- Z("span", Ns, ie(xe.value), 1)
1387
+ X("span", $s, ee(rt.value), 1)
1343
1388
  ]),
1344
1389
  _: 2
1345
1390
  }, [
1346
- _t.value ? {
1391
+ Et.value ? {
1347
1392
  name: "icon",
1348
1393
  fn: P(() => [
1349
- le(x(Ii), { size: x(Ts) }, null, 8, ["size"])
1394
+ oe(x(Wi), { size: x(Hs) }, null, 8, ["size"])
1350
1395
  ]),
1351
1396
  key: "0"
1352
1397
  } : void 0
1353
- ]), 1032, ["tooltip"])) : Y("", !0)
1398
+ ]), 1032, ["tooltip"])) : V("", !0)
1354
1399
  ]),
1355
- a.showRefresh ? (C(), G("div", Ls, [
1356
- le(ee, {
1400
+ a.showRefresh ? (C(), W("div", Bs, [
1401
+ oe(j, {
1357
1402
  appearance: "secondary",
1358
1403
  class: "refresh-button",
1359
1404
  "data-testid": `tile-refresh-button-${a.tileId}`,
1360
- disabled: g.value,
1405
+ disabled: L.value,
1361
1406
  icon: "",
1362
1407
  size: "small",
1363
1408
  onClick: o
1364
1409
  }, {
1365
1410
  default: P(() => [
1366
- g.value ? (C(), L(x(Mi), {
1411
+ L.value ? (C(), I(x(Ki), {
1367
1412
  key: 0,
1368
1413
  role: "button",
1369
- size: x(Ot),
1414
+ size: x(Bt),
1370
1415
  tabindex: "0"
1371
- }, null, 8, ["size"])) : (C(), L(x(qi), {
1416
+ }, null, 8, ["size"])) : (C(), I(x(Vi), {
1372
1417
  key: 1,
1373
1418
  role: "button",
1374
- size: x(Ot),
1419
+ size: x(Bt),
1375
1420
  tabindex: "0"
1376
1421
  }, null, 8, ["size"]))
1377
1422
  ]),
1378
1423
  _: 1
1379
1424
  }, 8, ["data-testid", "disabled"])
1380
- ])) : Y("", !0),
1381
- S.value ? (C(), G("div", {
1425
+ ])) : V("", !0),
1426
+ $.value ? (C(), W("div", {
1382
1427
  key: 1,
1383
1428
  class: "tile-actions",
1384
1429
  "data-testid": `tile-actions-${a.tileId}`
1385
1430
  }, [
1386
- x(w) && a.context.editable && !a.isFullscreen ? (C(), L(x(Pi), {
1431
+ x(A) && a.context.editable && !a.isFullscreen ? (C(), I(x(Qi), {
1387
1432
  key: 0,
1388
1433
  class: "edit-icon",
1389
- color: x(Lt),
1434
+ color: x(Pt),
1390
1435
  "data-testid": `edit-tile-${a.tileId}`,
1391
- size: x(At),
1392
- onClick: oi
1393
- }, null, 8, ["color", "data-testid", "size"])) : Y("", !0),
1394
- x(w) && H.value && !a.isFullscreen ? (C(), L(Ce, {
1436
+ size: x($t),
1437
+ onClick: fi
1438
+ }, null, 8, ["color", "data-testid", "size"])) : V("", !0),
1439
+ x(A) && F.value && !a.isFullscreen ? (C(), I(Ue, {
1395
1440
  key: 1,
1396
1441
  class: "dropdown",
1397
1442
  "data-testid": `chart-action-menu-${a.tileId}`,
1398
1443
  "kpop-attributes": { placement: "bottom-end" }
1399
1444
  }, {
1400
1445
  items: P(() => [
1401
- x(T) ? (C(), L(ae, {
1446
+ x(w) ? (C(), I(he, {
1402
1447
  key: 0,
1403
1448
  "data-testid": `chart-jump-to-explore-${a.tileId}`,
1404
- item: { label: x(h).t("jumpToExplore"), to: x(T) }
1405
- }, null, 8, ["data-testid", "item"])) : Y("", !0),
1406
- x(M) ? (C(), L(ae, {
1449
+ item: { label: x(f).t("jumpToExplore"), to: x(w) }
1450
+ }, null, 8, ["data-testid", "item"])) : V("", !0),
1451
+ x(q) ? (C(), I(he, {
1407
1452
  key: 1,
1408
1453
  "data-testid": `chart-jump-to-requests-${a.tileId}`,
1409
- item: { label: x(h).t("jumpToRequests"), to: x(M) }
1410
- }, null, 8, ["data-testid", "item"])) : Y("", !0),
1411
- !("allow_csv_export" in a.definition.chart) || a.definition.chart.allow_csv_export ? (C(), L(ae, {
1454
+ item: { label: x(f).t("jumpToRequests"), to: x(q) }
1455
+ }, null, 8, ["data-testid", "item"])) : V("", !0),
1456
+ !("allow_csv_export" in a.definition.chart) || a.definition.chart.allow_csv_export ? (C(), I(he, {
1412
1457
  key: 2,
1413
1458
  class: "chart-export-button",
1414
1459
  "data-testid": `chart-csv-export-${a.tileId}`,
1415
- onClick: di
1460
+ onClick: vi
1416
1461
  }, {
1417
1462
  default: P(() => [
1418
- Z("span", {
1463
+ X("span", {
1419
1464
  class: "chart-export-trigger",
1420
1465
  "data-testid": `csv-export-button-${a.tileId}`
1421
- }, ie(x(h).t("csvExport.exportAsCsv")), 9, Os)
1466
+ }, ee(x(f).t("csvExport.exportAsCsv")), 9, Us)
1422
1467
  ]),
1423
1468
  _: 1
1424
- }, 8, ["data-testid"])) : Y("", !0),
1425
- a.context.editable ? (C(), L(ae, {
1469
+ }, 8, ["data-testid"])) : V("", !0),
1470
+ a.context.editable ? (C(), I(he, {
1426
1471
  key: 3,
1427
1472
  "data-testid": `duplicate-tile-${a.tileId}`,
1428
- onClick: ai
1473
+ onClick: gi
1429
1474
  }, {
1430
1475
  default: P(() => [
1431
- ht(ie(x(h).t("renderer.duplicateTile")), 1)
1476
+ dt(ee(x(f).t("renderer.duplicateTile")), 1)
1432
1477
  ]),
1433
1478
  _: 1
1434
- }, 8, ["data-testid"])) : Y("", !0),
1435
- a.context.editable ? (C(), L(ae, {
1479
+ }, 8, ["data-testid"])) : V("", !0),
1480
+ a.context.editable ? (C(), I(he, {
1436
1481
  key: 4,
1437
1482
  "data-testid": `remove-tile-${a.tileId}`,
1438
- onClick: li
1483
+ onClick: mi
1439
1484
  }, {
1440
1485
  default: P(() => [
1441
- Z("span", Hs, ie(x(h).t("renderer.delete")), 1)
1486
+ X("span", Gs, ee(x(f).t("renderer.delete")), 1)
1442
1487
  ]),
1443
1488
  _: 1
1444
- }, 8, ["data-testid"])) : Y("", !0)
1489
+ }, 8, ["data-testid"])) : V("", !0)
1445
1490
  ]),
1446
1491
  default: P(() => [
1447
- le(x($i), {
1492
+ oe(x(Yi), {
1448
1493
  class: "kebab-action-menu",
1449
- color: x(Lt),
1494
+ color: x(Pt),
1450
1495
  "data-testid": `kebab-action-menu-${a.tileId}`,
1451
- size: x(At)
1496
+ size: x($t)
1452
1497
  }, null, 8, ["color", "data-testid", "size"])
1453
1498
  ]),
1454
1499
  _: 1
1455
- }, 8, ["data-testid"])) : Y("", !0)
1456
- ], 8, As)) : "description" in a.definition.chart ? (C(), G("div", {
1500
+ }, 8, ["data-testid"])) : V("", !0)
1501
+ ], 8, Fs)) : "description" in a.definition.chart ? (C(), W("div", {
1457
1502
  key: 2,
1458
1503
  class: "header-description",
1459
1504
  "data-testid": `tile-description-${a.tileId}`
1460
- }, ie(a.definition.chart.description), 9, Is)) : Y("", !0),
1461
- m.value ? (C(), L(x(Di), {
1505
+ }, ee(a.definition.chart.description), 9, Ws)) : V("", !0),
1506
+ y.value ? (C(), I(x(Pi), {
1462
1507
  key: 3,
1463
1508
  "data-testid": `csv-export-modal-${a.tileId}`,
1464
- "export-state": f.value,
1465
- filename: Ee.value,
1466
- onCloseModal: ui
1467
- }, null, 8, ["data-testid", "export-state", "filename"])) : Y("", !0)
1468
- ])) : Y("", !0),
1469
- Z("div", {
1470
- class: De(["tile-content", `type-${a.definition.chart.type}`]),
1509
+ "export-state": p.value,
1510
+ filename: O.value,
1511
+ onCloseModal: yi
1512
+ }, null, 8, ["data-testid", "export-state", "filename"])) : V("", !0)
1513
+ ])) : V("", !0),
1514
+ X("div", {
1515
+ class: ze(["tile-content", `type-${a.definition.chart.type}`]),
1471
1516
  "data-testid": `tile-content-${a.tileId}`
1472
1517
  }, [
1473
- K.value ? (C(), L(Bt(K.value.component), qt({ key: 0 }, K.value.rendererProps, wi(W.value), { onChartData: hi }), null, 16)) : Y("", !0)
1474
- ], 10, Ms)
1475
- ], 10, Ss);
1518
+ xe.value ? (C(), I(Qt(xe.value.component), Wt({ key: 0 }, xe.value.rendererProps, Ni(Fe.value), { onChartData: pi }), null, 16)) : V("", !0)
1519
+ ], 10, Ks)
1520
+ ], 10, Ms);
1476
1521
  };
1477
1522
  }
1478
- }), ti = /* @__PURE__ */ be(qs, [["__scopeId", "data-v-5513f736"]]), Ps = (a, e) => {
1523
+ }), li = /* @__PURE__ */ be(Vs, [["__scopeId", "data-v-0b9bb668"]]), Qs = (a, e) => {
1479
1524
  let t = 0;
1480
1525
  const i = /* @__PURE__ */ new Map();
1481
1526
  e.forEach((r) => {
@@ -1486,13 +1531,13 @@ const ue = {
1486
1531
  for (let r = 0; r < t; r++)
1487
1532
  i.get(r) ? s.push("auto") : s.push(`${a}px`);
1488
1533
  return s;
1489
- }, $s = /* @__PURE__ */ J({
1534
+ }, Ys = /* @__PURE__ */ Z({
1490
1535
  __name: "GridLayout",
1491
1536
  props: {
1492
1537
  tileHeight: {
1493
1538
  type: Number,
1494
1539
  required: !1,
1495
- default: () => Fe
1540
+ default: () => Be
1496
1541
  },
1497
1542
  tiles: {
1498
1543
  type: Array,
@@ -1500,21 +1545,21 @@ const ue = {
1500
1545
  }
1501
1546
  },
1502
1547
  setup(a) {
1503
- ut((n) => ({
1504
- v2a38e79e: x(ct),
1548
+ ct((n) => ({
1549
+ v2a38e79e: x(mt),
1505
1550
  v4cc71de6: r.value
1506
1551
  }));
1507
- const e = a, t = A(null), i = A(0), s = new ResizeObserver((n) => {
1552
+ const e = a, t = M(null), i = M(0), s = new ResizeObserver((n) => {
1508
1553
  window.requestAnimationFrame(() => {
1509
1554
  !Array.isArray(n) || !n.length || (i.value = n[0].contentRect.width);
1510
1555
  });
1511
1556
  });
1512
- Je(() => {
1557
+ et(() => {
1513
1558
  t.value && s.observe(t.value);
1514
- }), et(() => {
1559
+ }), tt(() => {
1515
1560
  t.value && s.unobserve(t.value);
1516
1561
  });
1517
- const r = k(() => Ps(e.tileHeight, e.tiles).join(" ")), o = k(() => e.tiles.map((n, d) => ({
1562
+ const r = R(() => Qs(e.tileHeight, e.tiles).join(" ")), o = R(() => e.tiles.map((n, d) => ({
1518
1563
  key: `tile-${d}`,
1519
1564
  tile: n,
1520
1565
  style: {
@@ -1524,27 +1569,27 @@ const ue = {
1524
1569
  "grid-row-end": n.layout.position.row + 1 + n.layout.size.rows
1525
1570
  }
1526
1571
  })));
1527
- return (n, d) => (C(), G("div", {
1572
+ return (n, d) => (C(), W("div", {
1528
1573
  ref_key: "gridContainer",
1529
1574
  ref: t,
1530
1575
  class: "kong-ui-public-grid-layout"
1531
1576
  }, [
1532
- (C(!0), G(Ft, null, Ut(o.value, (u) => (C(), G("div", {
1533
- key: u.key,
1534
- class: De(["grid-cell", {
1535
- "empty-cell": !u.tile
1577
+ (C(!0), W(Yt, null, jt(o.value, (h) => (C(), W("div", {
1578
+ key: h.key,
1579
+ class: ze(["grid-cell", {
1580
+ "empty-cell": !h.tile
1536
1581
  }]),
1537
- style: nt(u.style)
1582
+ style: at(h.style)
1538
1583
  }, [
1539
1584
  Ae(n.$slots, "tile", {
1540
- style: nt(u.style),
1541
- tile: u.tile
1585
+ style: at(h.style),
1586
+ tile: h.tile
1542
1587
  }, void 0, !0)
1543
1588
  ], 6))), 128))
1544
1589
  ], 512));
1545
1590
  }
1546
- }), Bs = /* @__PURE__ */ be($s, [["__scopeId", "data-v-354b7177"]]);
1547
- function Fs(a, e, t, i, s) {
1591
+ }), js = /* @__PURE__ */ be(Ys, [["__scopeId", "data-v-354b7177"]]);
1592
+ function Xs(a, e, t, i, s) {
1548
1593
  const r = (...o) => (console.warn("gridstack.js: Function `" + t + "` is deprecated in " + s + " and has been replaced with `" + i + "`. It will be **removed** in a future release"), e.apply(a, o));
1549
1594
  return r.prototype = e.prototype, r;
1550
1595
  }
@@ -1753,8 +1798,8 @@ class c {
1753
1798
  if (s.top < 0 || s.bottom > r) {
1754
1799
  const o = s.bottom - r, n = s.top, d = this.getScrollElement(e);
1755
1800
  if (d !== null) {
1756
- const u = d.scrollTop;
1757
- s.top < 0 && i < 0 ? e.offsetHeight > r ? d.scrollTop += i : d.scrollTop += Math.abs(n) > Math.abs(i) ? i : n : i > 0 && (e.offsetHeight > r ? d.scrollTop += i : d.scrollTop += o > i ? i : o), t.top += d.scrollTop - u;
1801
+ const h = d.scrollTop;
1802
+ s.top < 0 && i < 0 ? e.offsetHeight > r ? d.scrollTop += i : d.scrollTop += Math.abs(n) > Math.abs(i) ? i : n : i > 0 && (e.offsetHeight > r ? d.scrollTop += i : d.scrollTop += o > i ? i : o), t.top += d.scrollTop - h;
1758
1803
  }
1759
1804
  }
1760
1805
  }
@@ -1766,8 +1811,8 @@ class c {
1766
1811
  * @param distance Distance from the V edges to start scrolling
1767
1812
  */
1768
1813
  static updateScrollResize(e, t, i) {
1769
- const s = this.getScrollElement(t), r = s.clientHeight, o = s === this.getScrollElement() ? 0 : s.getBoundingClientRect().top, n = e.clientY - o, d = n < i, u = n > r - i;
1770
- d ? s.scrollBy({ behavior: "smooth", top: n - i }) : u && s.scrollBy({ behavior: "smooth", top: i - (r - n) });
1814
+ const s = this.getScrollElement(t), r = s.clientHeight, o = s === this.getScrollElement() ? 0 : s.getBoundingClientRect().top, n = e.clientY - o, d = n < i, h = n > r - i;
1815
+ d ? s.scrollBy({ behavior: "smooth", top: n - i }) : h && s.scrollBy({ behavior: "smooth", top: i - (r - n) });
1771
1816
  }
1772
1817
  /** single level clone, returning a new object with same top fields. This will share sub objects and arrays */
1773
1818
  static clone(e) {
@@ -1884,7 +1929,7 @@ class c {
1884
1929
  return !(!e || e.w === e.h || e.locked || e.noResize || (t = e.grid) != null && t.opts.disableResize || e.minW && e.minW === e.maxW || e.minH && e.minH === e.maxH);
1885
1930
  }
1886
1931
  }
1887
- class ce {
1932
+ class de {
1888
1933
  constructor(e = {}) {
1889
1934
  this.addedNodes = [], this.removedNodes = [], this.defaultColumn = 12, this.column = e.column || this.defaultColumn, this.column > this.defaultColumn && (this.defaultColumn = this.column), this.maxRow = e.maxRow, this._float = e.float, this.nodes = e.nodes || [], this.onChange = e.onChange;
1890
1935
  }
@@ -1910,15 +1955,15 @@ class ce {
1910
1955
  for (; i = i || this.collide(e, r, s.skip); ) {
1911
1956
  if (d++ > this.nodes.length * 2)
1912
1957
  throw new Error("Infinite collide check");
1913
- let u;
1958
+ let h;
1914
1959
  if (i.locked || this._loading || e._moving && !e._skipDown && t.y > e.y && !this.float && // can take space we had, or before where we're going
1915
1960
  (!this.collide(i, { ...i, y: e.y }, e) || !this.collide(i, { ...i, y: t.y - i.h }, e))) {
1916
1961
  e._skipDown = e._skipDown || t.y > e.y;
1917
- const h = { ...t, y: i.y + i.h, ...n };
1918
- u = this._loading && c.samePos(e, h) ? !0 : this.moveNode(e, h), (i.locked || this._loading) && u ? c.copyPos(t, e) : !i.locked && u && s.pack && (this._packNodes(), t.y = i.y + i.h, c.copyPos(e, t)), o = o || u;
1962
+ const u = { ...t, y: i.y + i.h, ...n };
1963
+ h = this._loading && c.samePos(e, u) ? !0 : this.moveNode(e, u), (i.locked || this._loading) && h ? c.copyPos(t, e) : !i.locked && h && s.pack && (this._packNodes(), t.y = i.y + i.h, c.copyPos(e, t)), o = o || h;
1919
1964
  } else
1920
- u = this.moveNode(i, { ...i, y: t.y + t.h, skip: e, ...n });
1921
- if (!u)
1965
+ h = this.moveNode(i, { ...i, y: t.y + t.h, skip: e, ...n });
1966
+ if (!h)
1922
1967
  return o;
1923
1968
  i = void 0;
1924
1969
  }
@@ -1943,10 +1988,10 @@ class ce {
1943
1988
  for (let d of i) {
1944
1989
  if (d.locked || !d._rect)
1945
1990
  break;
1946
- const u = d._rect;
1947
- let h = Number.MAX_VALUE, l = Number.MAX_VALUE;
1948
- s.y < u.y ? h = (r.y + r.h - u.y) / u.h : s.y + s.h > u.y + u.h && (h = (u.y + u.h - r.y) / u.h), s.x < u.x ? l = (r.x + r.w - u.x) / u.w : s.x + s.w > u.x + u.w && (l = (u.x + u.w - r.x) / u.w);
1949
- const f = Math.min(l, h);
1991
+ const h = d._rect;
1992
+ let u = Number.MAX_VALUE, l = Number.MAX_VALUE;
1993
+ s.y < h.y ? u = (r.y + r.h - h.y) / h.h : s.y + s.h > h.y + h.h && (u = (h.y + h.h - r.y) / h.h), s.x < h.x ? l = (r.x + r.w - h.x) / h.w : s.x + s.w > h.x + h.w && (l = (h.x + h.w - r.x) / h.w);
1994
+ const f = Math.min(l, u);
1950
1995
  f > n && (n = f, o = d);
1951
1996
  }
1952
1997
  return t.collide = o, o;
@@ -2022,8 +2067,8 @@ class ce {
2022
2067
  s || (this._inColumnResize = !0);
2023
2068
  const r = this.nodes;
2024
2069
  return this.nodes = [], r.forEach((o, n, d) => {
2025
- let u;
2026
- o.locked || (o.autoPosition = !0, e === "list" && n && (u = d[n - 1])), this.addNode(o, !1, u);
2070
+ let h;
2071
+ o.locked || (o.autoPosition = !0, e === "list" && n && (h = d[n - 1])), this.addNode(o, !1, h);
2027
2072
  }), s || delete this._inColumnResize, i || this.batchUpdate(!1), this;
2028
2073
  }
2029
2074
  /** enable/disable floating widgets (default: `false`) See [example](http://gridstackjs.com/demo/float.html) */
@@ -2062,7 +2107,7 @@ class ce {
2062
2107
  * @param resizing if out of bound, resize down or move into the grid to fit ?
2063
2108
  */
2064
2109
  prepareNode(e, t) {
2065
- e._id = e._id ?? ce._idSeq++;
2110
+ e._id = e._id ?? de._idSeq++;
2066
2111
  const i = e.id;
2067
2112
  if (i) {
2068
2113
  let r = 1;
@@ -2121,11 +2166,11 @@ class ce {
2121
2166
  const r = s ? s.y * i + (s.x + s.w) : 0;
2122
2167
  let o = !1;
2123
2168
  for (let n = r; !o; ++n) {
2124
- const d = n % i, u = Math.floor(n / i);
2169
+ const d = n % i, h = Math.floor(n / i);
2125
2170
  if (d + e.w > i)
2126
2171
  continue;
2127
- const h = { x: d, y: u, w: e.w, h: e.h };
2128
- t.find((l) => c.isIntercepted(h, l)) || ((e.x !== d || e.y !== u) && (e._dirty = !0), e.x = d, e.y = u, delete e.autoPosition, o = !0);
2172
+ const u = { x: d, y: h, w: e.w, h: e.h };
2173
+ t.find((l) => c.isIntercepted(u, l)) || ((e.x !== d || e.y !== h) && (e._dirty = !0), e.x = d, e.y = h, delete e.autoPosition, o = !0);
2129
2174
  }
2130
2175
  return o;
2131
2176
  }
@@ -2157,7 +2202,7 @@ class ce {
2157
2202
  if (t.pack = !0, !this.maxRow)
2158
2203
  return this.moveNode(e, t);
2159
2204
  let i;
2160
- const s = new ce({
2205
+ const s = new de({
2161
2206
  column: this.column,
2162
2207
  float: this.float,
2163
2208
  nodes: this.nodes.map((o) => o._id === e._id ? (i = { ...o }, i) : { ...o })
@@ -2179,7 +2224,7 @@ class ce {
2179
2224
  willItFit(e) {
2180
2225
  if (delete e._willFitPos, !this.maxRow)
2181
2226
  return !0;
2182
- const t = new ce({
2227
+ const t = new de({
2183
2228
  column: this.column,
2184
2229
  float: this.float,
2185
2230
  nodes: this.nodes.map((s) => ({ ...s }))
@@ -2192,7 +2237,7 @@ class ce {
2192
2237
  }
2193
2238
  /** return true if the passed in node was actually moved (checks for no-op and locked) */
2194
2239
  moveNode(e, t) {
2195
- var u, h;
2240
+ var h, u;
2196
2241
  if (!e || /*node.locked ||*/
2197
2242
  !t)
2198
2243
  return !1;
@@ -2206,9 +2251,9 @@ class ce {
2206
2251
  if (n.length) {
2207
2252
  const l = e._moving && !t.nested;
2208
2253
  let f = l ? this.directionCollideCoverage(e, t, n) : n[0];
2209
- if (l && f && ((h = (u = e.grid) == null ? void 0 : u.opts) != null && h.subGridDynamic) && !e.grid._isTemp) {
2210
- const m = c.areaIntercept(t.rect, f._rect), p = c.area(t.rect), y = c.area(f._rect);
2211
- m / (p < y ? p : y) > 0.8 && (f.grid.makeSubGrid(f.el, void 0, e), f = void 0);
2254
+ if (l && f && ((u = (h = e.grid) == null ? void 0 : h.opts) != null && u.subGridDynamic) && !e.grid._isTemp) {
2255
+ const g = c.areaIntercept(t.rect, f._rect), p = c.area(t.rect), y = c.area(f._rect);
2256
+ g / (p < y ? p : y) > 0.8 && (f.grid.makeSubGrid(f.el, void 0, e), f = void 0);
2212
2257
  }
2213
2258
  f ? d = !this._fixCollisions(e, r, f, t) : (d = !1, i && delete t.pack);
2214
2259
  }
@@ -2230,8 +2275,8 @@ class ce {
2230
2275
  var o;
2231
2276
  const i = (o = this._layouts) == null ? void 0 : o.length, s = i && this.column !== i - 1 ? this._layouts[i - 1] : null, r = [];
2232
2277
  return this.sortNodes(), this.nodes.forEach((n) => {
2233
- const d = s == null ? void 0 : s.find((h) => h._id === n._id), u = { ...n, ...d || {} };
2234
- c.removeInternalForSave(u, !e), t && t(n, u), r.push(u);
2278
+ const d = s == null ? void 0 : s.find((u) => u._id === n._id), h = { ...n, ...d || {} };
2279
+ c.removeInternalForSave(h, !e), t && t(n, h), r.push(h);
2235
2280
  }), r;
2236
2281
  }
2237
2282
  /** @internal called whenever a node is added or moved - updates the cached layouts */
@@ -2270,19 +2315,19 @@ class ce {
2270
2315
  s && this.sortNodes(1), t < e && this.cacheLayout(this.nodes, e), this.batchUpdate();
2271
2316
  let r = [], o = s ? this.nodes : c.sort(this.nodes, -1);
2272
2317
  if (t > e && this._layouts) {
2273
- const d = this._layouts[t] || [], u = this._layouts.length - 1;
2274
- !d.length && e !== u && ((n = this._layouts[u]) != null && n.length) && (e = u, this._layouts[u].forEach((h) => {
2275
- const l = o.find((f) => f._id === h._id);
2276
- l && (!s && !h.autoPosition && (l.x = h.x ?? l.x, l.y = h.y ?? l.y), l.w = h.w ?? l.w, (h.x == null || h.y === void 0) && (l.autoPosition = !0));
2277
- })), d.forEach((h) => {
2278
- const l = o.findIndex((f) => f._id === h._id);
2318
+ const d = this._layouts[t] || [], h = this._layouts.length - 1;
2319
+ !d.length && e !== h && ((n = this._layouts[h]) != null && n.length) && (e = h, this._layouts[h].forEach((u) => {
2320
+ const l = o.find((f) => f._id === u._id);
2321
+ l && (!s && !u.autoPosition && (l.x = u.x ?? l.x, l.y = u.y ?? l.y), l.w = u.w ?? l.w, (u.x == null || u.y === void 0) && (l.autoPosition = !0));
2322
+ })), d.forEach((u) => {
2323
+ const l = o.findIndex((f) => f._id === u._id);
2279
2324
  if (l !== -1) {
2280
2325
  const f = o[l];
2281
2326
  if (s) {
2282
- f.w = h.w;
2327
+ f.w = u.w;
2283
2328
  return;
2284
2329
  }
2285
- (h.autoPosition || isNaN(h.x) || isNaN(h.y)) && this.findEmptyPosition(h, r), h.autoPosition || (f.x = h.x ?? f.x, f.y = h.y ?? f.y, f.w = h.w ?? f.w, r.push(f)), o.splice(l, 1);
2330
+ (u.autoPosition || isNaN(u.x) || isNaN(u.y)) && this.findEmptyPosition(u, r), u.autoPosition || (f.x = u.x ?? f.x, f.y = u.y ?? f.y, f.w = u.w ?? f.w, r.push(f)), o.splice(l, 1);
2286
2331
  }
2287
2332
  });
2288
2333
  }
@@ -2293,9 +2338,9 @@ class ce {
2293
2338
  if (typeof i == "function")
2294
2339
  i(t, e, r, o);
2295
2340
  else {
2296
- const d = s || i === "none" ? 1 : t / e, u = i === "move" || i === "moveScale", h = i === "scale" || i === "moveScale";
2341
+ const d = s || i === "none" ? 1 : t / e, h = i === "move" || i === "moveScale", u = i === "scale" || i === "moveScale";
2297
2342
  o.forEach((l) => {
2298
- l.x = t === 1 ? 0 : u ? Math.round(l.x * d) : Math.min(l.x, t - 1), l.w = t === 1 || e === 1 ? 1 : h ? Math.round(l.w * d) || 1 : Math.min(l.w, t), r.push(l);
2343
+ l.x = t === 1 ? 0 : h ? Math.round(l.x * d) : Math.min(l.x, t - 1), l.w = t === 1 || e === 1 ? 1 : u ? Math.round(l.w * d) || 1 : Math.min(l.w, t), r.push(l);
2299
2344
  }), o = [];
2300
2345
  }
2301
2346
  r = c.sort(r, -1), this._inColumnResize = !0, this.nodes = [], r.forEach((d) => {
@@ -2315,7 +2360,7 @@ class ce {
2315
2360
  return e.forEach((r, o) => {
2316
2361
  if (r._id === void 0) {
2317
2362
  const n = r.id ? this.nodes.find((d) => d.id === r.id) : void 0;
2318
- r._id = (n == null ? void 0 : n._id) ?? ce._idSeq++;
2363
+ r._id = (n == null ? void 0 : n._id) ?? de._idSeq++;
2319
2364
  }
2320
2365
  s[o] = { x: r.x, y: r.y, w: r.w, _id: r._id };
2321
2366
  }), this._layouts = i ? [] : this._layouts || [], this._layouts[t] = s, this;
@@ -2326,7 +2371,7 @@ class ce {
2326
2371
  * @param column corresponding column index to save it under
2327
2372
  */
2328
2373
  cacheOneLayout(e, t) {
2329
- e._id = e._id ?? ce._idSeq++;
2374
+ e._id = e._id ?? de._idSeq++;
2330
2375
  const i = { x: e.x, y: e.y, w: e.w, _id: e._id };
2331
2376
  (e.autoPosition || e.x === void 0) && (delete i.x, delete i.y, e.autoPosition && (i.autoPosition = !0)), this._layouts = this._layouts || [], this._layouts[t] = this._layouts[t] || [];
2332
2377
  const s = this.findCacheLayout(e, t);
@@ -2350,8 +2395,8 @@ class ce {
2350
2395
  return this;
2351
2396
  }
2352
2397
  }
2353
- ce._idSeq = 0;
2354
- const te = {
2398
+ de._idSeq = 0;
2399
+ const J = {
2355
2400
  alwaysShowResizeHandle: "mobile",
2356
2401
  animate: !0,
2357
2402
  auto: !0,
@@ -2383,55 +2428,55 @@ const te = {
2383
2428
  };
2384
2429
  class E {
2385
2430
  }
2386
- const he = typeof window < "u" && typeof document < "u" && ("ontouchstart" in document || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
2387
- class fe {
2431
+ const ae = typeof window < "u" && typeof document < "u" && ("ontouchstart" in document || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
2432
+ class ce {
2388
2433
  }
2389
2434
  function Qe(a, e) {
2390
2435
  a.touches.length > 1 || (a.cancelable && a.preventDefault(), c.simulateMouseEvent(a.changedTouches[0], e));
2391
2436
  }
2392
- function ii(a, e) {
2437
+ function hi(a, e) {
2393
2438
  a.cancelable && a.preventDefault(), c.simulateMouseEvent(a, e);
2394
2439
  }
2395
- function Ve(a) {
2396
- fe.touchHandled || (fe.touchHandled = !0, Qe(a, "mousedown"));
2397
- }
2398
2440
  function Ye(a) {
2399
- fe.touchHandled && Qe(a, "mousemove");
2441
+ ce.touchHandled || (ce.touchHandled = !0, Qe(a, "mousedown"));
2442
+ }
2443
+ function je(a) {
2444
+ ce.touchHandled && Qe(a, "mousemove");
2400
2445
  }
2401
2446
  function Xe(a) {
2402
- if (!fe.touchHandled)
2447
+ if (!ce.touchHandled)
2403
2448
  return;
2404
- fe.pointerLeaveTimeout && (window.clearTimeout(fe.pointerLeaveTimeout), delete fe.pointerLeaveTimeout);
2449
+ ce.pointerLeaveTimeout && (window.clearTimeout(ce.pointerLeaveTimeout), delete ce.pointerLeaveTimeout);
2405
2450
  const e = !!E.dragElement;
2406
- Qe(a, "mouseup"), e || Qe(a, "click"), fe.touchHandled = !1;
2451
+ Qe(a, "mouseup"), e || Qe(a, "click"), ce.touchHandled = !1;
2407
2452
  }
2408
- function je(a) {
2453
+ function Ze(a) {
2409
2454
  a.pointerType !== "mouse" && a.target.releasePointerCapture(a.pointerId);
2410
2455
  }
2411
- function Ht(a) {
2412
- E.dragElement && a.pointerType !== "mouse" && ii(a, "mouseenter");
2456
+ function Ft(a) {
2457
+ E.dragElement && a.pointerType !== "mouse" && hi(a, "mouseenter");
2413
2458
  }
2414
- function It(a) {
2415
- E.dragElement && a.pointerType !== "mouse" && (fe.pointerLeaveTimeout = window.setTimeout(() => {
2416
- delete fe.pointerLeaveTimeout, ii(a, "mouseleave");
2459
+ function Ut(a) {
2460
+ E.dragElement && a.pointerType !== "mouse" && (ce.pointerLeaveTimeout = window.setTimeout(() => {
2461
+ delete ce.pointerLeaveTimeout, hi(a, "mouseleave");
2417
2462
  }, 10));
2418
2463
  }
2419
- class it {
2464
+ class st {
2420
2465
  constructor(e, t, i) {
2421
2466
  this.host = e, this.dir = t, this.option = i, this.moving = !1, this._mouseDown = this._mouseDown.bind(this), this._mouseMove = this._mouseMove.bind(this), this._mouseUp = this._mouseUp.bind(this), this._keyEvent = this._keyEvent.bind(this), this._init();
2422
2467
  }
2423
2468
  /** @internal */
2424
2469
  _init() {
2425
2470
  const e = this.el = document.createElement("div");
2426
- return e.classList.add("ui-resizable-handle"), e.classList.add(`${it.prefix}${this.dir}`), e.style.zIndex = "100", e.style.userSelect = "none", this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown), he && (this.el.addEventListener("touchstart", Ve), this.el.addEventListener("pointerdown", je)), this;
2471
+ return e.classList.add("ui-resizable-handle"), e.classList.add(`${st.prefix}${this.dir}`), e.style.zIndex = "100", e.style.userSelect = "none", this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown), ae && (this.el.addEventListener("touchstart", Ye), this.el.addEventListener("pointerdown", Ze)), this;
2427
2472
  }
2428
2473
  /** call this when resize handle needs to be removed and cleaned up */
2429
2474
  destroy() {
2430
- return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), he && (this.el.removeEventListener("touchstart", Ve), this.el.removeEventListener("pointerdown", je)), this.host.removeChild(this.el), delete this.el, delete this.host, this;
2475
+ return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), ae && (this.el.removeEventListener("touchstart", Ye), this.el.removeEventListener("pointerdown", Ze)), this.host.removeChild(this.el), delete this.el, delete this.host, this;
2431
2476
  }
2432
2477
  /** @internal called on mouse down on us: capture move on the entire document (mouse might not stay on us) until we release the mouse */
2433
2478
  _mouseDown(e) {
2434
- this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), he && (this.el.addEventListener("touchmove", Ye), this.el.addEventListener("touchend", Xe)), e.stopPropagation(), e.preventDefault();
2479
+ this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), ae && (this.el.addEventListener("touchmove", je), this.el.addEventListener("touchend", Xe)), e.stopPropagation(), e.preventDefault();
2435
2480
  }
2436
2481
  /** @internal */
2437
2482
  _mouseMove(e) {
@@ -2440,7 +2485,7 @@ class it {
2440
2485
  }
2441
2486
  /** @internal */
2442
2487
  _mouseUp(e) {
2443
- this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), he && (this.el.removeEventListener("touchmove", Ye), this.el.removeEventListener("touchend", Xe)), delete this.moving, delete this.mouseDownEvent, e.stopPropagation(), e.preventDefault();
2488
+ this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), ae && (this.el.removeEventListener("touchmove", je), this.el.removeEventListener("touchend", Xe)), delete this.moving, delete this.mouseDownEvent, e.stopPropagation(), e.preventDefault();
2444
2489
  }
2445
2490
  /** @internal call when keys are being pressed - use Esc to cancel */
2446
2491
  _keyEvent(e) {
@@ -2452,8 +2497,8 @@ class it {
2452
2497
  return this.option[e] && this.option[e](t), this;
2453
2498
  }
2454
2499
  }
2455
- it.prefix = "ui-resizable-";
2456
- class mt {
2500
+ st.prefix = "ui-resizable-";
2501
+ class vt {
2457
2502
  constructor() {
2458
2503
  this._eventRegister = {};
2459
2504
  }
@@ -2481,7 +2526,7 @@ class mt {
2481
2526
  return this._eventRegister[e](t);
2482
2527
  }
2483
2528
  }
2484
- class He extends mt {
2529
+ class Oe extends vt {
2485
2530
  // have to be public else complains for HTMLElementExtendOpt ?
2486
2531
  constructor(e, t = {}) {
2487
2532
  super(), this.el = e, this.option = t, this.rectScale = { x: 1, y: 1 }, this._ui = () => {
@@ -2551,7 +2596,7 @@ class He extends mt {
2551
2596
  }
2552
2597
  /** @internal */
2553
2598
  _setupHandlers() {
2554
- return this.handlers = this.option.handles.split(",").map((e) => e.trim()).map((e) => new it(this.el, e, {
2599
+ return this.handlers = this.option.handles.split(",").map((e) => e.trim()).map((e) => new st(this.el, e, {
2555
2600
  start: (t) => {
2556
2601
  this._resizeStart(t);
2557
2602
  },
@@ -2582,7 +2627,7 @@ class He extends mt {
2582
2627
  }
2583
2628
  /** @internal */
2584
2629
  _setupHelper() {
2585
- this.elOriginStyleVal = He._originStyleProp.map((i) => this.el.style[i]), this.parentOriginStylePosition = this.el.parentElement.style.position;
2630
+ this.elOriginStyleVal = Oe._originStyleProp.map((i) => this.el.style[i]), this.parentOriginStylePosition = this.el.parentElement.style.position;
2586
2631
  const e = this.el.parentElement, t = c.getValuesFromTransformedElement(e);
2587
2632
  return this.rectScale = {
2588
2633
  x: t.xScale,
@@ -2591,7 +2636,7 @@ class He extends mt {
2591
2636
  }
2592
2637
  /** @internal */
2593
2638
  _cleanHelper() {
2594
- return He._originStyleProp.forEach((e, t) => {
2639
+ return Oe._originStyleProp.forEach((e, t) => {
2595
2640
  this.el.style[e] = this.elOriginStyleVal[t] || null;
2596
2641
  }), this.el.parentElement.style.position = this.parentOriginStylePosition || null, this;
2597
2642
  }
@@ -2605,13 +2650,13 @@ class He extends mt {
2605
2650
  }, r = e.clientX - i.clientX, o = this.sizeToContent ? 0 : e.clientY - i.clientY;
2606
2651
  let n, d;
2607
2652
  t.indexOf("e") > -1 ? s.width += r : t.indexOf("w") > -1 && (s.width -= r, s.left += r, n = !0), t.indexOf("s") > -1 ? s.height += o : t.indexOf("n") > -1 && (s.height -= o, s.top += o, d = !0);
2608
- const u = this._constrainSize(s.width, s.height, n, d);
2609
- return Math.round(s.width) !== Math.round(u.width) && (t.indexOf("w") > -1 && (s.left += s.width - u.width), s.width = u.width), Math.round(s.height) !== Math.round(u.height) && (t.indexOf("n") > -1 && (s.top += s.height - u.height), s.height = u.height), s;
2653
+ const h = this._constrainSize(s.width, s.height, n, d);
2654
+ return Math.round(s.width) !== Math.round(h.width) && (t.indexOf("w") > -1 && (s.left += s.width - h.width), s.width = h.width), Math.round(s.height) !== Math.round(h.height) && (t.indexOf("n") > -1 && (s.top += s.height - h.height), s.height = h.height), s;
2610
2655
  }
2611
2656
  /** @internal constrain the size to the set min/max values */
2612
2657
  _constrainSize(e, t, i, s) {
2613
- const r = this.option, o = (i ? r.maxWidthMoveLeft : r.maxWidth) || Number.MAX_SAFE_INTEGER, n = r.minWidth / this.rectScale.x || e, d = (s ? r.maxHeightMoveUp : r.maxHeight) || Number.MAX_SAFE_INTEGER, u = r.minHeight / this.rectScale.y || t, h = Math.min(o, Math.max(n, e)), l = Math.min(d, Math.max(u, t));
2614
- return { width: h, height: l };
2658
+ const r = this.option, o = (i ? r.maxWidthMoveLeft : r.maxWidth) || Number.MAX_SAFE_INTEGER, n = r.minWidth / this.rectScale.x || e, d = (s ? r.maxHeightMoveUp : r.maxHeight) || Number.MAX_SAFE_INTEGER, h = r.minHeight / this.rectScale.y || t, u = Math.min(o, Math.max(n, e)), l = Math.min(d, Math.max(h, t));
2659
+ return { width: u, height: l };
2615
2660
  }
2616
2661
  /** @internal */
2617
2662
  _applyChange() {
@@ -2630,9 +2675,9 @@ class He extends mt {
2630
2675
  return this.handlers.forEach((e) => e.destroy()), delete this.handlers, this;
2631
2676
  }
2632
2677
  }
2633
- He._originStyleProp = ["width", "height", "position", "left", "top", "opacity", "zIndex"];
2634
- const Us = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';
2635
- class Ie extends mt {
2678
+ Oe._originStyleProp = ["width", "height", "position", "left", "top", "opacity", "zIndex"];
2679
+ const Zs = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';
2680
+ class He extends vt {
2636
2681
  constructor(e, t = {}) {
2637
2682
  var r;
2638
2683
  super(), this.el = e, this.option = t, this.dragTransform = {
@@ -2652,12 +2697,12 @@ class Ie extends mt {
2652
2697
  }
2653
2698
  enable() {
2654
2699
  this.disabled !== !1 && (super.enable(), this.dragEls.forEach((e) => {
2655
- e.addEventListener("mousedown", this._mouseDown), he && (e.addEventListener("touchstart", Ve), e.addEventListener("pointerdown", je));
2700
+ e.addEventListener("mousedown", this._mouseDown), ae && (e.addEventListener("touchstart", Ye), e.addEventListener("pointerdown", Ze));
2656
2701
  }), this.el.classList.remove("ui-draggable-disabled"));
2657
2702
  }
2658
2703
  disable(e = !1) {
2659
2704
  this.disabled !== !0 && (super.disable(), this.dragEls.forEach((t) => {
2660
- t.removeEventListener("mousedown", this._mouseDown), he && (t.removeEventListener("touchstart", Ve), t.removeEventListener("pointerdown", je));
2705
+ t.removeEventListener("mousedown", this._mouseDown), ae && (t.removeEventListener("touchstart", Ye), t.removeEventListener("pointerdown", Ze));
2661
2706
  }), e || this.el.classList.add("ui-draggable-disabled"));
2662
2707
  }
2663
2708
  destroy() {
@@ -2669,7 +2714,7 @@ class Ie extends mt {
2669
2714
  /** @internal call when mouse goes down before a dragstart happens */
2670
2715
  _mouseDown(e) {
2671
2716
  if (!E.mouseHandled)
2672
- return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(Us) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete E.dragElement, delete E.dropElement, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), he && (e.currentTarget.addEventListener("touchmove", Ye), e.currentTarget.addEventListener("touchend", Xe)), e.preventDefault(), document.activeElement && document.activeElement.blur(), E.mouseHandled = !0), !0;
2717
+ return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(Zs) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete E.dragElement, delete E.dropElement, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), ae && (e.currentTarget.addEventListener("touchmove", je), e.currentTarget.addEventListener("touchend", Xe)), e.preventDefault(), document.activeElement && document.activeElement.blur(), E.mouseHandled = !0), !0;
2673
2718
  }
2674
2719
  /** @internal method to call actual drag event */
2675
2720
  _callDrag(e) {
@@ -2700,7 +2745,7 @@ class Ie extends mt {
2700
2745
  /** @internal call when the mouse gets released to drop the item at current location */
2701
2746
  _mouseUp(e) {
2702
2747
  var t, i;
2703
- if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), he && e.currentTarget && (e.currentTarget.removeEventListener("touchmove", Ye, !0), e.currentTarget.removeEventListener("touchend", Xe, !0)), this.dragging) {
2748
+ if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), ae && e.currentTarget && (e.currentTarget.removeEventListener("touchmove", je, !0), e.currentTarget.removeEventListener("touchend", Xe, !0)), this.dragging) {
2704
2749
  delete this.dragging, (t = this.el.gridstackNode) == null || delete t._origRotate, document.removeEventListener("keydown", this._keyEvent), ((i = E.dropElement) == null ? void 0 : i.el) === this.el.parentElement && delete E.dropElement, this.helperContainment.style.position = this.parentOriginStylePosition || null, this.helper !== this.el && this.helper.remove(), this._removeHelperStyle();
2705
2750
  const s = c.initEvent(e, { target: this.el, type: "dragstop" });
2706
2751
  this.option.stop && this.option.stop(s), this.triggerEvent("dragstop", s), E.dropElement && E.dropElement.drop(e);
@@ -2722,7 +2767,7 @@ class Ie extends mt {
2722
2767
  /** @internal create a clone copy (or user defined method) of the original drag item if set */
2723
2768
  _createHelper() {
2724
2769
  let e = this.el;
2725
- return typeof this.option.helper == "function" ? e = this.option.helper(this.el) : this.option.helper === "clone" && (e = c.cloneNode(this.el)), e.parentElement || c.appendTo(e, this.option.appendTo === "parent" ? this.el.parentElement : this.option.appendTo), this.dragElementOriginStyle = Ie.originStyleProp.map((t) => this.el.style[t]), e;
2770
+ return typeof this.option.helper == "function" ? e = this.option.helper(this.el) : this.option.helper === "clone" && (e = c.cloneNode(this.el)), e.parentElement || c.appendTo(e, this.option.appendTo === "parent" ? this.el.parentElement : this.option.appendTo), this.dragElementOriginStyle = He.originStyleProp.map((t) => this.el.style[t]), e;
2726
2771
  }
2727
2772
  /** @internal set the fix position of the dragged item */
2728
2773
  _setupHelperStyle(e) {
@@ -2739,7 +2784,7 @@ class Ie extends mt {
2739
2784
  const e = (t = this.helper) == null ? void 0 : t.gridstackNode;
2740
2785
  if (!(e != null && e._isAboutToRemove) && this.dragElementOriginStyle) {
2741
2786
  const i = this.helper, s = this.dragElementOriginStyle.transition || null;
2742
- i.style.transition = this.dragElementOriginStyle.transition = "none", Ie.originStyleProp.forEach((r) => i.style[r] = this.dragElementOriginStyle[r] || null), setTimeout(() => i.style.transition = s, 50);
2787
+ i.style.transition = this.dragElementOriginStyle.transition = "none", He.originStyleProp.forEach((r) => i.style[r] = this.dragElementOriginStyle[r] || null), setTimeout(() => i.style.transition = s, 50);
2743
2788
  }
2744
2789
  return delete this.dragElementOriginStyle, this;
2745
2790
  }
@@ -2781,8 +2826,8 @@ class Ie extends mt {
2781
2826
  };
2782
2827
  }
2783
2828
  }
2784
- Ie.originStyleProp = ["width", "height", "transform", "transform-origin", "transition", "pointerEvents", "position", "left", "top", "minWidth", "willChange"];
2785
- class Gs extends mt {
2829
+ He.originStyleProp = ["width", "height", "transform", "transform-origin", "transition", "pointerEvents", "position", "left", "top", "minWidth", "willChange"];
2830
+ class Js extends vt {
2786
2831
  constructor(e, t = {}) {
2787
2832
  super(), this.el = e, this.option = t, this._mouseEnter = this._mouseEnter.bind(this), this._mouseLeave = this._mouseLeave.bind(this), this.enable(), this._setupAccept();
2788
2833
  }
@@ -2793,10 +2838,10 @@ class Gs extends mt {
2793
2838
  super.off(e);
2794
2839
  }
2795
2840
  enable() {
2796
- this.disabled !== !1 && (super.enable(), this.el.classList.add("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), this.el.addEventListener("mouseenter", this._mouseEnter), this.el.addEventListener("mouseleave", this._mouseLeave), he && (this.el.addEventListener("pointerenter", Ht), this.el.addEventListener("pointerleave", It)));
2841
+ this.disabled !== !1 && (super.enable(), this.el.classList.add("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), this.el.addEventListener("mouseenter", this._mouseEnter), this.el.addEventListener("mouseleave", this._mouseLeave), ae && (this.el.addEventListener("pointerenter", Ft), this.el.addEventListener("pointerleave", Ut)));
2797
2842
  }
2798
2843
  disable(e = !1) {
2799
- this.disabled !== !0 && (super.disable(), this.el.classList.remove("ui-droppable"), e || this.el.classList.add("ui-droppable-disabled"), this.el.removeEventListener("mouseenter", this._mouseEnter), this.el.removeEventListener("mouseleave", this._mouseLeave), he && (this.el.removeEventListener("pointerenter", Ht), this.el.removeEventListener("pointerleave", It)));
2844
+ this.disabled !== !0 && (super.disable(), this.el.classList.remove("ui-droppable"), e || this.el.classList.add("ui-droppable-disabled"), this.el.removeEventListener("mouseenter", this._mouseEnter), this.el.removeEventListener("mouseleave", this._mouseLeave), ae && (this.el.removeEventListener("pointerenter", Ft), this.el.removeEventListener("pointerleave", Ut)));
2800
2845
  }
2801
2846
  destroy() {
2802
2847
  this.disable(!0), this.el.classList.remove("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), super.destroy();
@@ -2848,9 +2893,9 @@ class Gs extends mt {
2848
2893
  };
2849
2894
  }
2850
2895
  }
2851
- class pt {
2896
+ class _t {
2852
2897
  static init(e) {
2853
- return e.ddElement || (e.ddElement = new pt(e)), e.ddElement;
2898
+ return e.ddElement || (e.ddElement = new _t(e)), e.ddElement;
2854
2899
  }
2855
2900
  constructor(e) {
2856
2901
  this.el = e;
@@ -2862,25 +2907,25 @@ class pt {
2862
2907
  return this.ddDraggable && ["drag", "dragstart", "dragstop"].indexOf(e) > -1 ? this.ddDraggable.off(e) : this.ddDroppable && ["drop", "dropover", "dropout"].indexOf(e) > -1 ? this.ddDroppable.off(e) : this.ddResizable && ["resizestart", "resize", "resizestop"].indexOf(e) > -1 && this.ddResizable.off(e), this;
2863
2908
  }
2864
2909
  setupDraggable(e) {
2865
- return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new Ie(this.el, e), this;
2910
+ return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new He(this.el, e), this;
2866
2911
  }
2867
2912
  cleanDraggable() {
2868
2913
  return this.ddDraggable && (this.ddDraggable.destroy(), delete this.ddDraggable), this;
2869
2914
  }
2870
2915
  setupResizable(e) {
2871
- return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new He(this.el, e), this;
2916
+ return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new Oe(this.el, e), this;
2872
2917
  }
2873
2918
  cleanResizable() {
2874
2919
  return this.ddResizable && (this.ddResizable.destroy(), delete this.ddResizable), this;
2875
2920
  }
2876
2921
  setupDroppable(e) {
2877
- return this.ddDroppable ? this.ddDroppable.updateOption(e) : this.ddDroppable = new Gs(this.el, e), this;
2922
+ return this.ddDroppable ? this.ddDroppable.updateOption(e) : this.ddDroppable = new Js(this.el, e), this;
2878
2923
  }
2879
2924
  cleanDroppable() {
2880
2925
  return this.ddDroppable && (this.ddDroppable.destroy(), delete this.ddDroppable), this;
2881
2926
  }
2882
2927
  }
2883
- class Ws {
2928
+ class er {
2884
2929
  resizable(e, t, i, s) {
2885
2930
  return this._getDDElements(e, t).forEach((r) => {
2886
2931
  if (t === "disable" || t === "enable")
@@ -2893,11 +2938,11 @@ class Ws {
2893
2938
  const n = r.el.gridstackNode.grid;
2894
2939
  let d = r.el.getAttribute("gs-resize-handles") || n.opts.resizable.handles || "e,s,se";
2895
2940
  d === "all" && (d = "n,e,s,w,se,sw,ne,nw");
2896
- const u = !n.opts.alwaysShowResizeHandle;
2941
+ const h = !n.opts.alwaysShowResizeHandle;
2897
2942
  r.setupResizable({
2898
2943
  ...n.opts.resizable,
2899
2944
  handles: d,
2900
- autoHide: u,
2945
+ autoHide: h,
2901
2946
  start: t.start,
2902
2947
  stop: t.stop,
2903
2948
  resize: t.resize
@@ -2959,7 +3004,7 @@ class Ws {
2959
3004
  /** @internal returns a list of DD elements, creating them on the fly by default unless option is to destroy or disable */
2960
3005
  _getDDElements(e, t) {
2961
3006
  const i = e.gridstack || t !== "destroy" && t !== "disable", s = c.getElements(e);
2962
- return s.length ? s.map((o) => o.ddElement || (i ? pt.init(o) : null)).filter((o) => o) : [];
3007
+ return s.length ? s.map((o) => o.ddElement || (i ? _t.init(o) : null)).filter((o) => o) : [];
2963
3008
  }
2964
3009
  }
2965
3010
  /*!
@@ -2969,7 +3014,7 @@ class Ws {
2969
3014
  * Copyright (c) 2021-2024 Alain Dumesny
2970
3015
  * see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
2971
3016
  */
2972
- const V = new Ws();
3017
+ const K = new er();
2973
3018
  class b {
2974
3019
  /**
2975
3020
  * initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
@@ -3034,7 +3079,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3034
3079
  /** @internal create placeholder DIV as needed */
3035
3080
  get placeholder() {
3036
3081
  if (!this._placeholder) {
3037
- this._placeholder = c.createDiv([this.opts.placeholderClass, te.itemClass, this.opts.itemClass]);
3082
+ this._placeholder = c.createDiv([this.opts.placeholderClass, J.itemClass, this.opts.itemClass]);
3038
3083
  const e = c.createDiv(["placeholder-content"], this._placeholder);
3039
3084
  this.opts.placeholderText && (e.textContent = this.opts.placeholderText);
3040
3085
  }
@@ -3046,7 +3091,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3046
3091
  * @param opts grid options - public for classes to access, but use methods to modify!
3047
3092
  */
3048
3093
  constructor(e, t = {}) {
3049
- var l, f, m;
3094
+ var l, f, g;
3050
3095
  this.el = e, this.opts = t, this.animationDelay = 310, this._gsEventHandler = {}, this._extraDragRow = 0, this.dragTransform = { xScale: 1, yScale: 1, xOffset: 0, yOffset: 0 }, e.gridstack = this, this.opts = t = t || {}, e.classList.contains("grid-stack") || this.el.classList.add("grid-stack"), t.row && (t.minRow = t.maxRow = t.row, delete t.row);
3051
3096
  const i = c.toNumber(e.getAttribute("gs-row"));
3052
3097
  t.column === "auto" && delete t.column, t.alwaysShowResizeHandle !== void 0 && (t._alwaysShowResizeHandle = t.alwaysShowResizeHandle);
@@ -3055,48 +3100,48 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3055
3100
  if (r.oneColumnModeDomSort && (delete r.oneColumnModeDomSort, console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")), r.oneColumnSize || r.disableOneColumnMode === !1) {
3056
3101
  const p = r.oneColumnSize || 768;
3057
3102
  delete r.oneColumnSize, delete r.disableOneColumnMode, t.columnOpts = t.columnOpts || {}, s = t.columnOpts.breakpoints = t.columnOpts.breakpoints || [];
3058
- let y = s.find((g) => g.c === 1);
3103
+ let y = s.find((m) => m.c === 1);
3059
3104
  y ? y.w = p : (y = { c: 1, w: p }, s.push(y, { c: 12, w: p + 1 }));
3060
3105
  }
3061
3106
  const o = t.columnOpts;
3062
3107
  o && (!o.columnWidth && !((f = o.breakpoints) != null && f.length) ? (delete t.columnOpts, s = void 0) : o.columnMax = o.columnMax || 12), (s == null ? void 0 : s.length) > 1 && s.sort((p, y) => (y.w || 0) - (p.w || 0));
3063
3108
  const n = {
3064
- ...c.cloneDeep(te),
3065
- column: c.toNumber(e.getAttribute("gs-column")) || te.column,
3066
- minRow: i || c.toNumber(e.getAttribute("gs-min-row")) || te.minRow,
3067
- maxRow: i || c.toNumber(e.getAttribute("gs-max-row")) || te.maxRow,
3068
- staticGrid: c.toBool(e.getAttribute("gs-static")) || te.staticGrid,
3109
+ ...c.cloneDeep(J),
3110
+ column: c.toNumber(e.getAttribute("gs-column")) || J.column,
3111
+ minRow: i || c.toNumber(e.getAttribute("gs-min-row")) || J.minRow,
3112
+ maxRow: i || c.toNumber(e.getAttribute("gs-max-row")) || J.maxRow,
3113
+ staticGrid: c.toBool(e.getAttribute("gs-static")) || J.staticGrid,
3069
3114
  sizeToContent: c.toBool(e.getAttribute("gs-size-to-content")) || void 0,
3070
3115
  draggable: {
3071
- handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") || te.draggable.handle
3116
+ handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") || J.draggable.handle
3072
3117
  },
3073
3118
  removableOptions: {
3074
- accept: t.itemClass || te.removableOptions.accept,
3075
- decline: te.removableOptions.decline
3119
+ accept: t.itemClass || J.removableOptions.accept,
3120
+ decline: J.removableOptions.decline
3076
3121
  }
3077
3122
  };
3078
3123
  e.getAttribute("gs-animate") && (n.animate = c.toBool(e.getAttribute("gs-animate"))), t = c.defaults(t, n), this._initMargin(), this.checkDynamicColumn(), this.el.classList.add("gs-" + t.column), t.rtl === "auto" && (t.rtl = e.style.direction === "rtl"), t.rtl && this.el.classList.add("grid-stack-rtl");
3079
- const d = this.el.closest("." + te.itemClass), u = d == null ? void 0 : d.gridstackNode;
3080
- u && (u.subGrid = this, this.parentGridNode = u, this.el.classList.add("grid-stack-nested"), u.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = t.cellHeight === "auto", this._isAutoCellHeight || t.cellHeight === "initial" ? this.cellHeight(void 0, !1) : (typeof t.cellHeight == "number" && t.cellHeightUnit && t.cellHeightUnit !== te.cellHeightUnit && (t.cellHeight = t.cellHeight + t.cellHeightUnit, delete t.cellHeightUnit), this.cellHeight(t.cellHeight, !1)), t.alwaysShowResizeHandle === "mobile" && (t.alwaysShowResizeHandle = he), this._styleSheetClass = "gs-id-" + ce._idSeq++, this.el.classList.add(this._styleSheetClass), this._setStaticClass();
3081
- const h = t.engineClass || b.engineClass || ce;
3082
- if (this.engine = new h({
3124
+ const d = this.el.closest("." + J.itemClass), h = d == null ? void 0 : d.gridstackNode;
3125
+ h && (h.subGrid = this, this.parentGridNode = h, this.el.classList.add("grid-stack-nested"), h.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = t.cellHeight === "auto", this._isAutoCellHeight || t.cellHeight === "initial" ? this.cellHeight(void 0, !1) : (typeof t.cellHeight == "number" && t.cellHeightUnit && t.cellHeightUnit !== J.cellHeightUnit && (t.cellHeight = t.cellHeight + t.cellHeightUnit, delete t.cellHeightUnit), this.cellHeight(t.cellHeight, !1)), t.alwaysShowResizeHandle === "mobile" && (t.alwaysShowResizeHandle = ae), this._styleSheetClass = "gs-id-" + de._idSeq++, this.el.classList.add(this._styleSheetClass), this._setStaticClass();
3126
+ const u = t.engineClass || b.engineClass || de;
3127
+ if (this.engine = new u({
3083
3128
  column: this.getColumn(),
3084
3129
  float: t.float,
3085
3130
  maxRow: t.maxRow,
3086
3131
  onChange: (p) => {
3087
3132
  let y = 0;
3088
- this.engine.nodes.forEach((g) => {
3089
- y = Math.max(y, g.y + g.h);
3090
- }), p.forEach((g) => {
3091
- const T = g.el;
3092
- T && (g._removeDOM ? (T && T.remove(), delete g._removeDOM) : this._writePosAttr(T, g));
3133
+ this.engine.nodes.forEach((m) => {
3134
+ y = Math.max(y, m.y + m.h);
3135
+ }), p.forEach((m) => {
3136
+ const k = m.el;
3137
+ k && (m._removeDOM ? (k && k.remove(), delete m._removeDOM) : this._writePosAttr(k, m));
3093
3138
  }), this._updateStyles(!1, y);
3094
3139
  }
3095
3140
  }), this._updateStyles(!1, 0), t.auto && (this.batchUpdate(), this.engine._loading = !0, this.getGridItems().forEach((p) => this._prepareElement(p)), delete this.engine._loading, this.batchUpdate(!1)), t.children) {
3096
3141
  const p = t.children;
3097
3142
  delete t.children, p.length && this.load(p);
3098
3143
  }
3099
- this.setAnimation(), t.subGridDynamic && !E.pauseDrag && (E.pauseDrag = !0), ((m = t.draggable) == null ? void 0 : m.pause) !== void 0 && (E.pauseDrag = t.draggable.pause), this._setupRemoveDrop(), this._setupAcceptWidget(), this._updateResizeEvent();
3144
+ this.setAnimation(), t.subGridDynamic && !E.pauseDrag && (E.pauseDrag = !0), ((g = t.draggable) == null ? void 0 : g.pause) !== void 0 && (E.pauseDrag = t.draggable.pause), this._setupRemoveDrop(), this._setupAcceptWidget(), this._updateResizeEvent();
3100
3145
  }
3101
3146
  /**
3102
3147
  * add a new widget and returns it.
@@ -3147,9 +3192,9 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3147
3192
  * @returns newly created grid
3148
3193
  */
3149
3194
  makeSubGrid(e, t, i, s = !0) {
3150
- var m, p, y;
3195
+ var g, p, y;
3151
3196
  let r = e.gridstackNode;
3152
- if (r || (r = this.makeWidget(e).gridstackNode), (m = r.subGrid) != null && m.el)
3197
+ if (r || (r = this.makeWidget(e).gridstackNode), (g = r.subGrid) != null && g.el)
3153
3198
  return r.subGrid;
3154
3199
  let o, n = this;
3155
3200
  for (; n && !o; )
@@ -3168,13 +3213,13 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3168
3213
  }), r.subGridOpts = t;
3169
3214
  let d;
3170
3215
  t.column === "auto" && (d = !0, t.column = Math.max(r.w || 1, (i == null ? void 0 : i.w) || 1), delete t.columnOpts);
3171
- let u = r.el.querySelector(".grid-stack-item-content"), h, l;
3172
- if (s && (this._removeDD(r.el), l = { ...r, x: 0, y: 0 }, c.removeInternalForSave(l), delete l.subGridOpts, r.content && (l.content = r.content, delete r.content), b.addRemoveCB ? h = b.addRemoveCB(this.el, l, !0, !1) : (h = c.createDiv(["grid-stack-item"]), h.appendChild(u), u = c.createDiv(["grid-stack-item-content"], r.el)), this.prepareDragDrop(r.el)), i) {
3173
- const g = d ? t.column : r.w, T = r.h + i.h, M = r.el.style;
3174
- M.transition = "none", this.update(r.el, { w: g, h: T }), setTimeout(() => M.transition = null);
3216
+ let h = r.el.querySelector(".grid-stack-item-content"), u, l;
3217
+ if (s && (this._removeDD(r.el), l = { ...r, x: 0, y: 0 }, c.removeInternalForSave(l), delete l.subGridOpts, r.content && (l.content = r.content, delete r.content), b.addRemoveCB ? u = b.addRemoveCB(this.el, l, !0, !1) : (u = c.createDiv(["grid-stack-item"]), u.appendChild(h), h = c.createDiv(["grid-stack-item-content"], r.el)), this.prepareDragDrop(r.el)), i) {
3218
+ const m = d ? t.column : r.w, k = r.h + i.h, L = r.el.style;
3219
+ L.transition = "none", this.update(r.el, { w: m, h: k }), setTimeout(() => L.transition = null);
3175
3220
  }
3176
- const f = r.subGrid = b.addGrid(u, t);
3177
- return i != null && i._moving && (f._isTemp = !0), d && (f._autoColumn = !0), s && f.makeWidget(h, l), i && (i._moving ? window.setTimeout(() => c.simulateMouseEvent(i._event, "mouseenter", f.el), 0) : f.makeWidget(r.el, r)), this.resizeToContentCheck(!1, r), f;
3221
+ const f = r.subGrid = b.addGrid(h, t);
3222
+ return i != null && i._moving && (f._isTemp = !0), d && (f._autoColumn = !0), s && f.makeWidget(u, l), i && (i._moving ? window.setTimeout(() => c.simulateMouseEvent(i._event, "mouseenter", f.el), 0) : f.makeWidget(r.el, r)), this.resizeToContentCheck(!1, r), f;
3178
3223
  }
3179
3224
  /**
3180
3225
  * called when an item was converted into a nested grid to accommodate a dragged over item, but then item leaves - return back
@@ -3212,7 +3257,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3212
3257
  const r = c.cloneDeep(this.opts);
3213
3258
  r.marginBottom === r.marginTop && r.marginRight === r.marginLeft && r.marginTop === r.marginRight && (r.margin = r.marginTop, delete r.marginTop, delete r.marginRight, delete r.marginBottom, delete r.marginLeft), r.rtl === (this.el.style.direction === "rtl") && (r.rtl = "auto"), this._isAutoCellHeight && (r.cellHeight = "auto"), this._autoColumn && (r.column = "auto");
3214
3259
  const o = r._alwaysShowResizeHandle;
3215
- return delete r._alwaysShowResizeHandle, o !== void 0 ? r.alwaysShowResizeHandle = o : delete r.alwaysShowResizeHandle, c.removeInternalAndSame(r, te), r.children = s, r;
3260
+ return delete r._alwaysShowResizeHandle, o !== void 0 ? r.alwaysShowResizeHandle = o : delete r.alwaysShowResizeHandle, c.removeInternalAndSame(r, J), r.children = s, r;
3216
3261
  }
3217
3262
  return s;
3218
3263
  }
@@ -3227,15 +3272,15 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3227
3272
  * see http://gridstackjs.com/demo/serialization.html
3228
3273
  */
3229
3274
  load(e, t = b.addRemoveCB || !0) {
3230
- var u;
3275
+ var h;
3231
3276
  e = c.cloneDeep(e);
3232
3277
  const i = this.getColumn();
3233
- e.forEach((h) => {
3234
- h.w = h.w || 1, h.h = h.h || 1;
3278
+ e.forEach((u) => {
3279
+ u.w = u.w || 1, u.h = u.h || 1;
3235
3280
  }), e = c.sort(e), this.engine.skipCacheUpdate = this._ignoreLayoutsNodeChange = !0;
3236
3281
  let s = 0;
3237
- e.forEach((h) => {
3238
- s = Math.max(s, (h.x || 0) + h.w);
3282
+ e.forEach((u) => {
3283
+ s = Math.max(s, (u.x || 0) + u.w);
3239
3284
  }), s > this.engine.defaultColumn && (this.engine.defaultColumn = s), s > i && this.engine.cacheLayout(e, s, !0);
3240
3285
  const r = b.addRemoveCB;
3241
3286
  typeof t == "function" && (b.addRemoveCB = t);
@@ -3248,16 +3293,16 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3248
3293
  c.find(e, l.id) || (b.addRemoveCB && b.addRemoveCB(this.el, l, !1, !1), o.push(l), this.removeWidget(l.el, !0, !1));
3249
3294
  }), this.engine._loading = !0;
3250
3295
  const d = [];
3251
- return this.engine.nodes = this.engine.nodes.filter((h) => c.find(e, h.id) ? (d.push(h), !1) : !0), e.forEach((h) => {
3296
+ return this.engine.nodes = this.engine.nodes.filter((u) => c.find(e, u.id) ? (d.push(u), !1) : !0), e.forEach((u) => {
3252
3297
  var f;
3253
- const l = c.find(d, h.id);
3298
+ const l = c.find(d, u.id);
3254
3299
  if (l) {
3255
- if (c.shouldSizeToContent(l) && (h.h = l.h), this.engine.nodeBoundFix(h), (h.autoPosition || h.x === void 0 || h.y === void 0) && (h.w = h.w || l.w, h.h = h.h || l.h, this.engine.findEmptyPosition(h)), this.engine.nodes.push(l), c.samePos(l, h) && this.engine.nodes.length > 1 && (this.moveNode(l, { ...h, forceCollide: !0 }), c.copyPos(h, l)), this.update(l.el, h), (f = h.subGridOpts) != null && f.children) {
3256
- const m = l.el.querySelector(".grid-stack");
3257
- m && m.gridstack && m.gridstack.load(h.subGridOpts.children);
3300
+ if (c.shouldSizeToContent(l) && (u.h = l.h), this.engine.nodeBoundFix(u), (u.autoPosition || u.x === void 0 || u.y === void 0) && (u.w = u.w || l.w, u.h = u.h || l.h, this.engine.findEmptyPosition(u)), this.engine.nodes.push(l), c.samePos(l, u) && this.engine.nodes.length > 1 && (this.moveNode(l, { ...u, forceCollide: !0 }), c.copyPos(u, l)), this.update(l.el, u), (f = u.subGridOpts) != null && f.children) {
3301
+ const g = l.el.querySelector(".grid-stack");
3302
+ g && g.gridstack && g.gridstack.load(u.subGridOpts.children);
3258
3303
  }
3259
- } else t && this.addWidget(h);
3260
- }), delete this.engine._loading, this.engine.removedNodes = o, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ? b.addRemoveCB = r : delete b.addRemoveCB, n && ((u = this.opts) != null && u.animate) && this.setAnimation(this.opts.animate, !0), this;
3304
+ } else t && this.addWidget(u);
3305
+ }), delete this.engine._loading, this.engine.removedNodes = o, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ? b.addRemoveCB = r : delete b.addRemoveCB, n && ((h = this.opts) != null && h.animate) && this.setAnimation(this.opts.animate, !0), this;
3261
3306
  }
3262
3307
  /**
3263
3308
  * use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
@@ -3538,7 +3583,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3538
3583
  */
3539
3584
  update(e, t) {
3540
3585
  return b.getElements(e).forEach((i) => {
3541
- var h;
3586
+ var u;
3542
3587
  const s = i == null ? void 0 : i.gridstackNode;
3543
3588
  if (!s)
3544
3589
  return;
@@ -3550,16 +3595,16 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3550
3595
  n[l] = r[l] !== void 0 ? r[l] : s[l], delete r[l];
3551
3596
  })), !n && (r.minW || r.minH || r.maxW || r.maxH) && (n = {}), r.content !== void 0) {
3552
3597
  const l = i.querySelector(".grid-stack-item-content");
3553
- l && l.textContent !== r.content && (s.content = r.content, b.renderCB(l, r), (h = s.subGrid) != null && h.el && (l.appendChild(s.subGrid.el), s.subGrid.opts.styleInHead || s.subGrid._updateStyles(!0))), delete r.content;
3598
+ l && l.textContent !== r.content && (s.content = r.content, b.renderCB(l, r), (u = s.subGrid) != null && u.el && (l.appendChild(s.subGrid.el), s.subGrid.opts.styleInHead || s.subGrid._updateStyles(!0))), delete r.content;
3554
3599
  }
3555
- let d = !1, u = !1;
3600
+ let d = !1, h = !1;
3556
3601
  for (const l in r)
3557
- l[0] !== "_" && s[l] !== r[l] && (s[l] = r[l], d = !0, u = u || !this.opts.staticGrid && (l === "noResize" || l === "noMove" || l === "locked"));
3602
+ l[0] !== "_" && s[l] !== r[l] && (s[l] = r[l], d = !0, h = h || !this.opts.staticGrid && (l === "noResize" || l === "noMove" || l === "locked"));
3558
3603
  if (c.sanitizeMinMax(s), n) {
3559
3604
  const l = n.w !== void 0 && n.w !== s.w;
3560
3605
  this.moveNode(s, n), l && s.subGrid ? s.subGrid.onResize(this.hasAnimationCSS() ? s.w : void 0) : this.resizeToContentCheck(l, s), delete s._orig;
3561
3606
  }
3562
- (n || d) && this._writeAttr(i, s), u && this.prepareDragDrop(s.el);
3607
+ (n || d) && this._writeAttr(i, s), h && this.prepareDragDrop(s.el);
3563
3608
  }), this;
3564
3609
  }
3565
3610
  moveNode(e, t) {
@@ -3573,7 +3618,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3573
3618
  * @param useNodeH set to true if GridStackNode.h should be used instead of actual container height when we don't need to wait for animation to finish to get actual DOM heights
3574
3619
  */
3575
3620
  resizeToContent(e) {
3576
- var f, m;
3621
+ var f, g;
3577
3622
  if (!e || (e.classList.remove("size-to-content-max"), !e.clientHeight))
3578
3623
  return;
3579
3624
  const t = e.gridstackNode;
@@ -3589,13 +3634,13 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3589
3634
  if (t.resizeToContentParent && (o = e.querySelector(t.resizeToContentParent)), o || (o = e.querySelector(b.resizeToContentParent)), !o)
3590
3635
  return;
3591
3636
  const n = e.clientHeight - o.clientHeight, d = t.h ? t.h * s - n : o.clientHeight;
3592
- let u;
3637
+ let h;
3593
3638
  if (t.subGrid) {
3594
- u = t.subGrid.getRow() * t.subGrid.getCellHeight(!0);
3639
+ h = t.subGrid.getRow() * t.subGrid.getCellHeight(!0);
3595
3640
  const p = t.subGrid.el.getBoundingClientRect(), y = t.subGrid.el.parentElement.getBoundingClientRect();
3596
- u += p.top - y.top;
3641
+ h += p.top - y.top;
3597
3642
  } else {
3598
- if ((m = (f = t.subGridOpts) == null ? void 0 : f.children) != null && m.length)
3643
+ if ((g = (f = t.subGridOpts) == null ? void 0 : f.children) != null && g.length)
3599
3644
  return;
3600
3645
  {
3601
3646
  const p = o.firstElementChild;
@@ -3603,15 +3648,15 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3603
3648
  console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${b.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);
3604
3649
  return;
3605
3650
  }
3606
- u = p.getBoundingClientRect().height || d;
3651
+ h = p.getBoundingClientRect().height || d;
3607
3652
  }
3608
3653
  }
3609
- if (d === u)
3654
+ if (d === h)
3610
3655
  return;
3611
- r += u - d;
3612
- let h = Math.ceil(r / s);
3656
+ r += h - d;
3657
+ let u = Math.ceil(r / s);
3613
3658
  const l = Number.isInteger(t.sizeToContent) ? t.sizeToContent : 0;
3614
- l && h > l && (h = l, e.classList.add("size-to-content-max")), t.minH && h < t.minH ? h = t.minH : t.maxH && h > t.maxH && (h = t.maxH), h !== t.h && (i._ignoreLayoutsNodeChange = !0, i.moveNode(t, { h }), delete i._ignoreLayoutsNodeChange);
3659
+ l && u > l && (u = l, e.classList.add("size-to-content-max")), t.minH && u < t.minH ? u = t.minH : t.maxH && u > t.maxH && (u = t.maxH), u !== t.h && (i._ignoreLayoutsNodeChange = !0, i.moveNode(t, { h: u }), delete i._ignoreLayoutsNodeChange);
3615
3660
  }
3616
3661
  /** call the user resize (so they can do extra work) else our build in version */
3617
3662
  resizeToContentCBCheck(e) {
@@ -3732,8 +3777,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3732
3777
  }), !this._styles)
3733
3778
  return this;
3734
3779
  this._styles._max = 0, c.addCSSRule(this._styles, r, `height: ${i}${s}`);
3735
- const n = this.opts.marginTop + this.opts.marginUnit, d = this.opts.marginBottom + this.opts.marginUnit, u = this.opts.marginRight + this.opts.marginUnit, h = this.opts.marginLeft + this.opts.marginUnit, l = `${r} > .grid-stack-item-content`, f = `.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;
3736
- c.addCSSRule(this._styles, l, `top: ${n}; right: ${u}; bottom: ${d}; left: ${h};`), c.addCSSRule(this._styles, f, `top: ${n}; right: ${u}; bottom: ${d}; left: ${h};`), c.addCSSRule(this._styles, `${r} > .ui-resizable-n`, `top: ${n};`), c.addCSSRule(this._styles, `${r} > .ui-resizable-s`, `bottom: ${d}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-ne`, `right: ${u}; top: ${n}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-e`, `right: ${u}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-se`, `right: ${u}; bottom: ${d}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-nw`, `left: ${h}; top: ${n}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-w`, `left: ${h}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-sw`, `left: ${h}; bottom: ${d}`);
3780
+ const n = this.opts.marginTop + this.opts.marginUnit, d = this.opts.marginBottom + this.opts.marginUnit, h = this.opts.marginRight + this.opts.marginUnit, u = this.opts.marginLeft + this.opts.marginUnit, l = `${r} > .grid-stack-item-content`, f = `.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;
3781
+ c.addCSSRule(this._styles, l, `top: ${n}; right: ${h}; bottom: ${d}; left: ${u};`), c.addCSSRule(this._styles, f, `top: ${n}; right: ${h}; bottom: ${d}; left: ${u};`), c.addCSSRule(this._styles, `${r} > .ui-resizable-n`, `top: ${n};`), c.addCSSRule(this._styles, `${r} > .ui-resizable-s`, `bottom: ${d}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-ne`, `right: ${h}; top: ${n}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-e`, `right: ${h}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-se`, `right: ${h}; bottom: ${d}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-nw`, `left: ${u}; top: ${n}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-w`, `left: ${u}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-sw`, `left: ${u}; bottom: ${d}`);
3737
3782
  }
3738
3783
  if (t = t || this._styles._max, t > this._styles._max) {
3739
3784
  const o = (n) => i * n + s;
@@ -3763,7 +3808,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3763
3808
  }
3764
3809
  /** @internal */
3765
3810
  _prepareElement(e, t = !1, i) {
3766
- i = i || this._readAttr(e), e.gridstackNode = i, i.el = e, i.grid = this, i = this.engine.addNode(i, t), this._writeAttr(e, i), e.classList.add(te.itemClass, this.opts.itemClass);
3811
+ i = i || this._readAttr(e), e.gridstackNode = i, i.el = e, i.grid = this, i = this.engine.addNode(i, t), this._writeAttr(e, i), e.classList.add(J.itemClass, this.opts.itemClass);
3767
3812
  const s = c.shouldSizeToContent(i);
3768
3813
  return s ? e.classList.add("size-to-content") : e.classList.remove("size-to-content"), s && this.resizeToContentCheck(!1, i), c.lazyLoad(i) || this.prepareDragDrop(i.el), this;
3769
3814
  }
@@ -3869,7 +3914,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3869
3914
  */
3870
3915
  /** get the global (but static to this code) DD implementation */
3871
3916
  static getDD() {
3872
- return V;
3917
+ return K;
3873
3918
  }
3874
3919
  /**
3875
3920
  * call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.
@@ -3882,7 +3927,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3882
3927
  */
3883
3928
  static setupDragIn(e, t, i, s = document) {
3884
3929
  (t == null ? void 0 : t.pause) !== void 0 && (E.pauseDrag = t.pause), t = { appendTo: "body", helper: "clone", ...t || {} }, (typeof e == "string" ? c.getElements(e, s) : e).forEach((o, n) => {
3885
- V.isDraggable(o) || V.dragIn(o, t), i != null && i[n] && (o.gridstackNode = i[n]);
3930
+ K.isDraggable(o) || K.dragIn(o, t), i != null && i[n] && (o.gridstackNode = i[n]);
3886
3931
  });
3887
3932
  }
3888
3933
  /**
@@ -3961,12 +4006,12 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3961
4006
  }
3962
4007
  /** @internal removes any drag&drop present (called during destroy) */
3963
4008
  _removeDD(e) {
3964
- return V.draggable(e, "destroy").resizable(e, "destroy"), e.gridstackNode && delete e.gridstackNode._initDD, delete e.ddElement, this;
4009
+ return K.draggable(e, "destroy").resizable(e, "destroy"), e.gridstackNode && delete e.gridstackNode._initDD, delete e.ddElement, this;
3965
4010
  }
3966
4011
  /** @internal called to add drag over to support widgets being added externally */
3967
4012
  _setupAcceptWidget() {
3968
4013
  if (this.opts.staticGrid || !this.opts.acceptWidgets && !this.opts.removable)
3969
- return V.droppable(this.el, "destroy"), this;
4014
+ return K.droppable(this.el, "destroy"), this;
3970
4015
  let e, t;
3971
4016
  const i = (s, r, o) => {
3972
4017
  var f;
@@ -3976,22 +4021,22 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
3976
4021
  return;
3977
4022
  if (!((f = n.grid) != null && f.el)) {
3978
4023
  o.style.transform = `scale(${1 / this.dragTransform.xScale},${1 / this.dragTransform.yScale})`;
3979
- const m = o.getBoundingClientRect();
3980
- o.style.left = m.x + (this.dragTransform.xScale - 1) * (s.clientX - m.x) / this.dragTransform.xScale + "px", o.style.top = m.y + (this.dragTransform.yScale - 1) * (s.clientY - m.y) / this.dragTransform.yScale + "px", o.style.transformOrigin = "0px 0px";
4024
+ const g = o.getBoundingClientRect();
4025
+ o.style.left = g.x + (this.dragTransform.xScale - 1) * (s.clientX - g.x) / this.dragTransform.xScale + "px", o.style.top = g.y + (this.dragTransform.yScale - 1) * (s.clientY - g.y) / this.dragTransform.yScale + "px", o.style.transformOrigin = "0px 0px";
3981
4026
  }
3982
- let { top: d, left: u } = o.getBoundingClientRect();
3983
- const h = this.el.getBoundingClientRect();
3984
- u -= h.left, d -= h.top;
4027
+ let { top: d, left: h } = o.getBoundingClientRect();
4028
+ const u = this.el.getBoundingClientRect();
4029
+ h -= u.left, d -= u.top;
3985
4030
  const l = {
3986
4031
  position: {
3987
4032
  top: d * this.dragTransform.xScale,
3988
- left: u * this.dragTransform.yScale
4033
+ left: h * this.dragTransform.yScale
3989
4034
  }
3990
4035
  };
3991
4036
  if (n._temporaryRemoved) {
3992
- if (n.x = Math.max(0, Math.round(u / t)), n.y = Math.max(0, Math.round(d / e)), delete n.autoPosition, this.engine.nodeBoundFix(n), !this.engine.willItFit(n)) {
4037
+ if (n.x = Math.max(0, Math.round(h / t)), n.y = Math.max(0, Math.round(d / e)), delete n.autoPosition, this.engine.nodeBoundFix(n), !this.engine.willItFit(n)) {
3993
4038
  if (n.autoPosition = !0, !this.engine.willItFit(n)) {
3994
- V.off(r, "drag");
4039
+ K.off(r, "drag");
3995
4040
  return;
3996
4041
  }
3997
4042
  n._willFitPos && (c.copyPos(n, n._willFitPos), delete n._willFitPos);
@@ -4000,7 +4045,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
4000
4045
  } else
4001
4046
  this._dragOrResize(o, s, l, n, t, e);
4002
4047
  };
4003
- return V.droppable(this.el, {
4048
+ return K.droppable(this.el, {
4004
4049
  accept: (s) => {
4005
4050
  const r = s.gridstackNode || this._readAttr(s, !1);
4006
4051
  if ((r == null ? void 0 : r.grid) === this)
@@ -4025,42 +4070,42 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
4025
4070
  if ((n == null ? void 0 : n.grid) === this && !n._temporaryRemoved)
4026
4071
  return !1;
4027
4072
  if (n != null && n._sidebarOrig && (n.w = n._sidebarOrig.w, n.h = n._sidebarOrig.h), n != null && n.grid && n.grid !== this && !n._temporaryRemoved && n.grid._leave(r, o), o = o || r, t = this.cellWidth(), e = this.getCellHeight(!0), !n) {
4028
- const h = o.getAttribute("data-gs-widget") || o.getAttribute("gridstacknode");
4029
- if (h) {
4073
+ const u = o.getAttribute("data-gs-widget") || o.getAttribute("gridstacknode");
4074
+ if (u) {
4030
4075
  try {
4031
- n = JSON.parse(h);
4076
+ n = JSON.parse(u);
4032
4077
  } catch {
4033
- console.error("Gridstack dropover: Bad JSON format: ", h);
4078
+ console.error("Gridstack dropover: Bad JSON format: ", u);
4034
4079
  }
4035
4080
  o.removeAttribute("data-gs-widget"), o.removeAttribute("gridstacknode");
4036
4081
  }
4037
4082
  n || (n = this._readAttr(o)), n._sidebarOrig = { w: n.w, h: n.h };
4038
4083
  }
4039
4084
  n.grid || (n.el || (n = { ...n }), n._isExternal = !0, o.gridstackNode = n);
4040
- const d = n.w || Math.round(o.offsetWidth / t) || 1, u = n.h || Math.round(o.offsetHeight / e) || 1;
4041
- return n.grid && n.grid !== this ? (r._gridstackNodeOrig || (r._gridstackNodeOrig = n), r.gridstackNode = n = { ...n, w: d, h: u, grid: this }, delete n.x, delete n.y, this.engine.cleanupNode(n).nodeBoundFix(n), n._initDD = n._isExternal = // DOM needs to be re-parented on a drop
4042
- n._temporaryRemoved = !0) : (n.w = d, n.h = u, n._temporaryRemoved = !0), b._itemRemoving(n.el, !1), V.on(r, "drag", i), i(s, r, o), !1;
4085
+ const d = n.w || Math.round(o.offsetWidth / t) || 1, h = n.h || Math.round(o.offsetHeight / e) || 1;
4086
+ return n.grid && n.grid !== this ? (r._gridstackNodeOrig || (r._gridstackNodeOrig = n), r.gridstackNode = n = { ...n, w: d, h, grid: this }, delete n.x, delete n.y, this.engine.cleanupNode(n).nodeBoundFix(n), n._initDD = n._isExternal = // DOM needs to be re-parented on a drop
4087
+ n._temporaryRemoved = !0) : (n.w = d, n.h = h, n._temporaryRemoved = !0), b._itemRemoving(n.el, !1), K.on(r, "drag", i), i(s, r, o), !1;
4043
4088
  }).on(this.el, "dropout", (s, r, o) => {
4044
4089
  const n = (o == null ? void 0 : o.gridstackNode) || r.gridstackNode;
4045
4090
  return n && (!n.grid || n.grid === this) && (this._leave(r, o), this._isTemp && this.removeAsSubGrid(n)), !1;
4046
4091
  }).on(this.el, "drop", (s, r, o) => {
4047
- var m, p, y;
4092
+ var g, p, y;
4048
4093
  const n = (o == null ? void 0 : o.gridstackNode) || r.gridstackNode;
4049
4094
  if ((n == null ? void 0 : n.grid) === this && !n._isExternal)
4050
4095
  return !1;
4051
- const d = !!this.placeholder.parentElement, u = r !== o;
4096
+ const d = !!this.placeholder.parentElement, h = r !== o;
4052
4097
  this.placeholder.remove(), delete this.placeholder.gridstackNode;
4053
- const h = d && this.opts.animate;
4054
- h && this.setAnimation(!1);
4098
+ const u = d && this.opts.animate;
4099
+ u && this.setAnimation(!1);
4055
4100
  const l = r._gridstackNodeOrig;
4056
4101
  if (delete r._gridstackNodeOrig, d && (l != null && l.grid) && l.grid !== this) {
4057
- const g = l.grid;
4058
- g.engine.removeNodeFromLayoutCache(l), g.engine.removedNodes.push(l), g._triggerRemoveEvent()._triggerChangeEvent(), g.parentGridNode && !g.engine.nodes.length && g.opts.subGridDynamic && g.removeAsSubGrid();
4102
+ const m = l.grid;
4103
+ m.engine.removeNodeFromLayoutCache(l), m.engine.removedNodes.push(l), m._triggerRemoveEvent()._triggerChangeEvent(), m.parentGridNode && !m.engine.nodes.length && m.opts.subGridDynamic && m.removeAsSubGrid();
4059
4104
  }
4060
- if (!n || (d && (this.engine.cleanupNode(n), n.grid = this), (m = n.grid) == null || delete m._isTemp, V.off(r, "drag"), o !== r ? (o.remove(), r = o) : r.remove(), this._removeDD(r), !d))
4105
+ if (!n || (d && (this.engine.cleanupNode(n), n.grid = this), (g = n.grid) == null || delete g._isTemp, K.off(r, "drag"), o !== r ? (o.remove(), r = o) : r.remove(), this._removeDD(r), !d))
4061
4106
  return !1;
4062
4107
  const f = (y = (p = n.subGrid) == null ? void 0 : p.el) == null ? void 0 : y.gridstack;
4063
- return c.copyPos(n, this._readAttr(this.placeholder)), c.removePositioningStyles(r), u && (n.content || n.subGridOpts || b.addRemoveCB) ? (delete n.el, r = this.addWidget(n)) : (this._prepareElement(r, !0, n), this.el.appendChild(r), this.resizeToContentCheck(!1, n), f && (f.parentGridNode = n, f.opts.styleInHead || f._updateStyles(!0)), this._updateContainerHeight()), this.engine.addedNodes.push(n), this._triggerAddEvent(), this._triggerChangeEvent(), this.engine.endUpdate(), this._gsEventHandler.dropped && this._gsEventHandler.dropped({ ...s, type: "dropped" }, l && l.grid ? l : void 0, n), h && this.setAnimation(this.opts.animate, !0), !1;
4108
+ return c.copyPos(n, this._readAttr(this.placeholder)), c.removePositioningStyles(r), h && (n.content || n.subGridOpts || b.addRemoveCB) ? (delete n.el, r = this.addWidget(n)) : (this._prepareElement(r, !0, n), this.el.appendChild(r), this.resizeToContentCheck(!1, n), f && (f.parentGridNode = n, f.opts.styleInHead || f._updateStyles(!0)), this._updateContainerHeight()), this.engine.addedNodes.push(n), this._triggerAddEvent(), this._triggerChangeEvent(), this.engine.endUpdate(), this._gsEventHandler.dropped && this._gsEventHandler.dropped({ ...s, type: "dropped" }, l && l.grid ? l : void 0, n), u && this.setAnimation(this.opts.animate, !0), !1;
4064
4109
  }), this;
4065
4110
  }
4066
4111
  /** @internal mark item for removal */
@@ -4075,7 +4120,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
4075
4120
  if (typeof this.opts.removable != "string")
4076
4121
  return this;
4077
4122
  const e = document.querySelector(this.opts.removable);
4078
- return e ? (!this.opts.staticGrid && !V.isDroppable(e) && V.droppable(e, this.opts.removableOptions).on(e, "dropover", (t, i) => b._itemRemoving(i, !0)).on(e, "dropout", (t, i) => b._itemRemoving(i, !1)), this) : this;
4123
+ return e ? (!this.opts.staticGrid && !K.isDroppable(e) && K.droppable(e, this.opts.removableOptions).on(e, "dropover", (t, i) => b._itemRemoving(i, !0)).on(e, "dropout", (t, i) => b._itemRemoving(i, !1)), this) : this;
4079
4124
  }
4080
4125
  /**
4081
4126
  * prepares the element for drag&drop - this is normally called by makeWidget() unless are are delay loading
@@ -4091,33 +4136,33 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
4091
4136
  return this;
4092
4137
  if (!i._initDD) {
4093
4138
  let n, d;
4094
- const u = (f, m) => {
4095
- this._gsEventHandler[f.type] && this._gsEventHandler[f.type](f, f.target), n = this.cellWidth(), d = this.getCellHeight(!0), this._onStartMoving(e, f, m, i, n, d);
4096
- }, h = (f, m) => {
4097
- this._dragOrResize(e, f, m, i, n, d);
4139
+ const h = (f, g) => {
4140
+ this._gsEventHandler[f.type] && this._gsEventHandler[f.type](f, f.target), n = this.cellWidth(), d = this.getCellHeight(!0), this._onStartMoving(e, f, g, i, n, d);
4141
+ }, u = (f, g) => {
4142
+ this._dragOrResize(e, f, g, i, n, d);
4098
4143
  }, l = (f) => {
4099
4144
  this.placeholder.remove(), delete this.placeholder.gridstackNode, delete i._moving, delete i._event, delete i._lastTried;
4100
- const m = i.w !== i._orig.w, p = f.target;
4145
+ const g = i.w !== i._orig.w, p = f.target;
4101
4146
  if (!(!p.gridstackNode || p.gridstackNode.grid !== this)) {
4102
4147
  if (i.el = p, i._isAboutToRemove) {
4103
4148
  const y = e.gridstackNode.grid;
4104
4149
  y._gsEventHandler[f.type] && y._gsEventHandler[f.type](f, p), y.engine.nodes.push(i), y.removeWidget(e, !0, !0);
4105
4150
  } else
4106
4151
  c.removePositioningStyles(p), i._temporaryRemoved ? (c.copyPos(i, i._orig), this._writePosAttr(p, i), this.engine.addNode(i)) : this._writePosAttr(p, i), this._gsEventHandler[f.type] && this._gsEventHandler[f.type](f, p);
4107
- this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), f.type === "resizestop" && (Number.isInteger(i.sizeToContent) && (i.sizeToContent = i.h), this.resizeToContentCheck(m, i));
4152
+ this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), f.type === "resizestop" && (Number.isInteger(i.sizeToContent) && (i.sizeToContent = i.h), this.resizeToContentCheck(g, i));
4108
4153
  }
4109
4154
  };
4110
- V.draggable(e, {
4111
- start: u,
4155
+ K.draggable(e, {
4156
+ start: h,
4112
4157
  stop: l,
4113
- drag: h
4158
+ drag: u
4114
4159
  }).resizable(e, {
4115
- start: u,
4160
+ start: h,
4116
4161
  stop: l,
4117
- resize: h
4162
+ resize: u
4118
4163
  }), i._initDD = !0;
4119
4164
  }
4120
- return V.draggable(e, s ? "disable" : "enable").resizable(e, r ? "disable" : "enable"), this;
4165
+ return K.draggable(e, s ? "disable" : "enable").resizable(e, r ? "disable" : "enable"), this;
4121
4166
  }
4122
4167
  /** @internal handles actual drag/resize start */
4123
4168
  _onStartMoving(e, t, i, s, r, o) {
@@ -4135,48 +4180,48 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
4135
4180
  yOffset: 0
4136
4181
  };
4137
4182
  if (s.el = this.placeholder, s._lastUiPosition = i.position, s._prevYPix = i.position.top, s._moving = t.type === "dragstart", delete s._lastTried, t.type === "dropover" && s._temporaryRemoved && (this.engine.addNode(s), s._moving = !0), this.engine.cacheRects(r, o, this.opts.marginTop, this.opts.marginRight, this.opts.marginBottom, this.opts.marginLeft), t.type === "resizestart") {
4138
- const d = this.getColumn() - s.x, u = (this.opts.maxRow || Number.MAX_SAFE_INTEGER) - s.y;
4139
- V.resizable(e, "option", "minWidth", r * Math.min(s.minW || 1, d)).resizable(e, "option", "minHeight", o * Math.min(s.minH || 1, u)).resizable(e, "option", "maxWidth", r * Math.min(s.maxW || Number.MAX_SAFE_INTEGER, d)).resizable(e, "option", "maxWidthMoveLeft", r * Math.min(s.maxW || Number.MAX_SAFE_INTEGER, s.x + s.w)).resizable(e, "option", "maxHeight", o * Math.min(s.maxH || Number.MAX_SAFE_INTEGER, u)).resizable(e, "option", "maxHeightMoveUp", o * Math.min(s.maxH || Number.MAX_SAFE_INTEGER, s.y + s.h));
4183
+ const d = this.getColumn() - s.x, h = (this.opts.maxRow || Number.MAX_SAFE_INTEGER) - s.y;
4184
+ K.resizable(e, "option", "minWidth", r * Math.min(s.minW || 1, d)).resizable(e, "option", "minHeight", o * Math.min(s.minH || 1, h)).resizable(e, "option", "maxWidth", r * Math.min(s.maxW || Number.MAX_SAFE_INTEGER, d)).resizable(e, "option", "maxWidthMoveLeft", r * Math.min(s.maxW || Number.MAX_SAFE_INTEGER, s.x + s.w)).resizable(e, "option", "maxHeight", o * Math.min(s.maxH || Number.MAX_SAFE_INTEGER, h)).resizable(e, "option", "maxHeightMoveUp", o * Math.min(s.maxH || Number.MAX_SAFE_INTEGER, s.y + s.h));
4140
4185
  }
4141
4186
  }
4142
4187
  /** @internal handles actual drag/resize */
4143
4188
  _dragOrResize(e, t, i, s, r, o) {
4144
4189
  const n = { ...s._orig };
4145
- let d, u = this.opts.marginLeft, h = this.opts.marginRight, l = this.opts.marginTop, f = this.opts.marginBottom;
4146
- const m = Math.round(o * 0.1), p = Math.round(r * 0.1);
4147
- if (u = Math.min(u, p), h = Math.min(h, p), l = Math.min(l, m), f = Math.min(f, m), t.type === "drag") {
4190
+ let d, h = this.opts.marginLeft, u = this.opts.marginRight, l = this.opts.marginTop, f = this.opts.marginBottom;
4191
+ const g = Math.round(o * 0.1), p = Math.round(r * 0.1);
4192
+ if (h = Math.min(h, p), u = Math.min(u, p), l = Math.min(l, g), f = Math.min(f, g), t.type === "drag") {
4148
4193
  if (s._temporaryRemoved)
4149
4194
  return;
4150
- const g = i.position.top - s._prevYPix;
4151
- s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && c.updateScrollPosition(e, i.position, g);
4152
- const T = i.position.left + (i.position.left > s._lastUiPosition.left ? -h : u), M = i.position.top + (i.position.top > s._lastUiPosition.top ? -f : l);
4153
- n.x = Math.round(T / r), n.y = Math.round(M / o);
4195
+ const m = i.position.top - s._prevYPix;
4196
+ s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && c.updateScrollPosition(e, i.position, m);
4197
+ const k = i.position.left + (i.position.left > s._lastUiPosition.left ? -u : h), L = i.position.top + (i.position.top > s._lastUiPosition.top ? -f : l);
4198
+ n.x = Math.round(k / r), n.y = Math.round(L / o);
4154
4199
  const w = this._extraDragRow;
4155
4200
  if (this.engine.collide(s, n)) {
4156
- const I = this.getRow();
4157
- let O = Math.max(0, n.y + s.h - I);
4158
- this.opts.maxRow && I + O > this.opts.maxRow && (O = Math.max(0, this.opts.maxRow - I)), this._extraDragRow = O;
4201
+ const q = this.getRow();
4202
+ let A = Math.max(0, n.y + s.h - q);
4203
+ this.opts.maxRow && q + A > this.opts.maxRow && (A = Math.max(0, this.opts.maxRow - q)), this._extraDragRow = A;
4159
4204
  } else
4160
4205
  this._extraDragRow = 0;
4161
4206
  if (this._extraDragRow !== w && this._updateContainerHeight(), s.x === n.x && s.y === n.y)
4162
4207
  return;
4163
4208
  } else if (t.type === "resize") {
4164
- if (n.x < 0 || (c.updateScrollResize(t, e, o), n.w = Math.round((i.size.width - u) / r), n.h = Math.round((i.size.height - l) / o), s.w === n.w && s.h === n.h) || s._lastTried && s._lastTried.w === n.w && s._lastTried.h === n.h)
4209
+ if (n.x < 0 || (c.updateScrollResize(t, e, o), n.w = Math.round((i.size.width - h) / r), n.h = Math.round((i.size.height - l) / o), s.w === n.w && s.h === n.h) || s._lastTried && s._lastTried.w === n.w && s._lastTried.h === n.h)
4165
4210
  return;
4166
- const g = i.position.left + u, T = i.position.top + l;
4167
- n.x = Math.round(g / r), n.y = Math.round(T / o), d = !0;
4211
+ const m = i.position.left + h, k = i.position.top + l;
4212
+ n.x = Math.round(m / r), n.y = Math.round(k / o), d = !0;
4168
4213
  }
4169
4214
  s._event = t, s._lastTried = n;
4170
4215
  const y = {
4171
- x: i.position.left + u,
4216
+ x: i.position.left + h,
4172
4217
  y: i.position.top + l,
4173
- w: (i.size ? i.size.width : s.w * r) - u - h,
4218
+ w: (i.size ? i.size.width : s.w * r) - h - u,
4174
4219
  h: (i.size ? i.size.height : s.h * o) - l - f
4175
4220
  };
4176
4221
  if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight: o, rect: y, resizing: d })) {
4177
- s._lastUiPosition = i.position, this.engine.cacheRects(r, o, l, h, f, u), delete s._skipDown, d && s.subGrid && s.subGrid.onResize(), this._extraDragRow = 0, this._updateContainerHeight();
4178
- const g = t.target;
4179
- s._sidebarOrig || this._writePosAttr(g, s), this._gsEventHandler[t.type] && this._gsEventHandler[t.type](t, g);
4222
+ s._lastUiPosition = i.position, this.engine.cacheRects(r, o, l, u, f, h), delete s._skipDown, d && s.subGrid && s.subGrid.onResize(), this._extraDragRow = 0, this._updateContainerHeight();
4223
+ const m = t.target;
4224
+ s._sidebarOrig || this._writePosAttr(m, s), this._gsEventHandler[t.type] && this._gsEventHandler[t.type](t, m);
4180
4225
  }
4181
4226
  }
4182
4227
  /** @internal called when item leaving our area by either cursor dropout event
@@ -4186,7 +4231,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
4186
4231
  _leave(e, t) {
4187
4232
  t = t || e;
4188
4233
  const i = t.gridstackNode;
4189
- if (!i || (t.style.transform = t.style.transformOrigin = null, V.off(e, "drag"), i._temporaryRemoved))
4234
+ if (!i || (t.style.transform = t.style.transformOrigin = null, K.off(e, "drag"), i._temporaryRemoved))
4190
4235
  return;
4191
4236
  i._temporaryRemoved = !0, this.engine.removeNode(i), i.el = i._isExternal && t ? t : e;
4192
4237
  const s = i._sidebarOrig;
@@ -4194,7 +4239,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
4194
4239
  }
4195
4240
  // legacy method removed
4196
4241
  commit() {
4197
- return Fs(this, this.batchUpdate(!1), "commit", "batchUpdate", "5.2"), this;
4242
+ return Xs(this, this.batchUpdate(!1), "commit", "batchUpdate", "5.2"), this;
4198
4243
  }
4199
4244
  }
4200
4245
  b.renderCB = (a, e) => {
@@ -4202,21 +4247,21 @@ b.renderCB = (a, e) => {
4202
4247
  };
4203
4248
  b.resizeToContentParent = ".grid-stack-item-content";
4204
4249
  b.Utils = c;
4205
- b.Engine = ce;
4250
+ b.Engine = de;
4206
4251
  b.GDRev = "11.5.1";
4207
- const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { class: "grid-stack-item-content" }, Vs = /* @__PURE__ */ J({
4252
+ const tr = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], ir = { class: "grid-stack-item-content" }, sr = /* @__PURE__ */ Z({
4208
4253
  __name: "DraggableGridLayout",
4209
4254
  props: {
4210
4255
  tiles: {},
4211
- tileHeight: { default: Fe }
4256
+ tileHeight: { default: Be }
4212
4257
  },
4213
4258
  emits: ["update-tiles"],
4214
4259
  setup(a, { expose: e, emit: t }) {
4215
- const i = a, s = t, r = A(null), o = A(new Map(i.tiles.map((m) => [`${m.id}`, m])));
4260
+ const i = a, s = t, r = M(null), o = M(new Map(i.tiles.map((g) => [`${g.id}`, g])));
4216
4261
  let n = null;
4217
- const d = (m) => `[data-id="${m}"]`, u = (m) => m.map((p) => {
4218
- var g;
4219
- const y = o.value.get(`${(g = p.el) == null ? void 0 : g.getAttribute("data-id")}`);
4262
+ const d = (g) => `[data-id="${g}"]`, h = (g) => g.map((p) => {
4263
+ var m;
4264
+ const y = o.value.get(`${(m = p.el) == null ? void 0 : m.getAttribute("data-id")}`);
4220
4265
  if (y)
4221
4266
  return {
4222
4267
  ...y,
@@ -4225,53 +4270,53 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
4225
4270
  size: { cols: Number(p.w), rows: Number(p.h) }
4226
4271
  }
4227
4272
  };
4228
- }).filter((p) => p !== void 0), h = (m, p) => {
4229
- n && (u(p).forEach((g) => {
4230
- o.value.set(`${g.id}`, g);
4273
+ }).filter((p) => p !== void 0), u = (g, p) => {
4274
+ n && (h(p).forEach((m) => {
4275
+ o.value.set(`${m.id}`, m);
4231
4276
  }), s("update-tiles", Array.from(o.value.values())));
4232
- }, l = (m, p) => {
4277
+ }, l = (g, p) => {
4233
4278
  p.forEach((y) => {
4234
- var g;
4235
- o.value.delete(`${(g = y.el) == null ? void 0 : g.getAttribute("data-id")}`);
4279
+ var m;
4280
+ o.value.delete(`${(m = y.el) == null ? void 0 : m.getAttribute("data-id")}`);
4236
4281
  }), s("update-tiles", Array.from(o.value.values()));
4237
4282
  };
4238
- Je(() => {
4283
+ et(() => {
4239
4284
  r.value && (n = b.init({
4240
4285
  margin: 10,
4241
- column: ct,
4286
+ column: mt,
4242
4287
  cellHeight: i.tileHeight,
4243
4288
  resizable: { handles: "se, sw" },
4244
4289
  handle: ".tile-header"
4245
- }, r.value), n.on("change", h), n.on("added", h), n.on("removed", l));
4246
- }), et(() => {
4290
+ }, r.value), n.on("change", u), n.on("added", u), n.on("removed", l));
4291
+ }), tt(() => {
4247
4292
  n && n.destroy(!1);
4248
4293
  });
4249
- const f = (m) => {
4294
+ const f = (g) => {
4250
4295
  if (n && r.value) {
4251
- const p = r.value.querySelector(d(m));
4296
+ const p = r.value.querySelector(d(g));
4252
4297
  p && n.removeWidget(p);
4253
4298
  }
4254
4299
  };
4255
- return Le(() => i.tiles.length, async (m, p) => {
4256
- if (m > p && n) {
4300
+ return Le(() => i.tiles.length, async (g, p) => {
4301
+ if (g > p && n) {
4257
4302
  const y = i.tiles.slice(p);
4258
- for (const g of y)
4259
- o.value.set(`${g.id}`, g), await dt(), n.makeWidget(d(g.id), {
4303
+ for (const m of y)
4304
+ o.value.set(`${m.id}`, m), await ft(), n.makeWidget(d(m.id), {
4260
4305
  autoPosition: !0,
4261
- w: g.layout.size.cols,
4262
- h: g.layout.size.rows
4306
+ w: m.layout.size.cols,
4307
+ h: m.layout.size.rows
4263
4308
  });
4264
4309
  }
4265
- }), Mt(() => {
4266
- i.tiles.forEach((m) => {
4267
- o.value.set(`${m.id}`, m);
4310
+ }), Gt(() => {
4311
+ i.tiles.forEach((g) => {
4312
+ o.value.set(`${g.id}`, g);
4268
4313
  });
4269
- }), e({ removeWidget: f }), (m, p) => (C(), G("div", {
4314
+ }), e({ removeWidget: f }), (g, p) => (C(), W("div", {
4270
4315
  ref_key: "gridContainer",
4271
4316
  ref: r,
4272
4317
  class: "grid-stack"
4273
4318
  }, [
4274
- (C(!0), G(Ft, null, Ut(i.tiles, (y) => (C(), G("div", {
4319
+ (C(!0), W(Yt, null, jt(i.tiles, (y) => (C(), W("div", {
4275
4320
  key: y.id,
4276
4321
  class: "grid-stack-item",
4277
4322
  "data-id": `${y.id}`,
@@ -4282,52 +4327,52 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
4282
4327
  "gs-x": y.layout.position.col,
4283
4328
  "gs-y": y.layout.position.row
4284
4329
  }, [
4285
- Z("div", Qs, [
4286
- Ae(m.$slots, "tile", { tile: y }, void 0, !0)
4330
+ X("div", ir, [
4331
+ Ae(g.$slots, "tile", { tile: y }, void 0, !0)
4287
4332
  ])
4288
- ], 8, Ks))), 128))
4333
+ ], 8, tr))), 128))
4289
4334
  ], 512));
4290
4335
  }
4291
- }), Ys = /* @__PURE__ */ be(Vs, [["__scopeId", "data-v-a68d6821"]]), Xs = {
4336
+ }), rr = /* @__PURE__ */ be(sr, [["__scopeId", "data-v-a68d6821"]]), nr = {
4292
4337
  key: 0,
4293
4338
  class: "fullscreen-header"
4294
- }, js = {
4339
+ }, or = {
4295
4340
  key: 0,
4296
4341
  class: "tile-container slottable-tile"
4297
- }, Zs = /* @__PURE__ */ J({
4342
+ }, ar = /* @__PURE__ */ Z({
4298
4343
  __name: "DashboardRenderer",
4299
- props: /* @__PURE__ */ Ke({
4344
+ props: /* @__PURE__ */ Ve({
4300
4345
  context: {}
4301
4346
  }, {
4302
4347
  modelValue: { required: !0 },
4303
4348
  modelModifiers: {}
4304
4349
  }),
4305
- emits: /* @__PURE__ */ Ke(["edit-tile", "tile-time-range-zoom"], ["update:modelValue"]),
4350
+ emits: /* @__PURE__ */ Ve(["edit-tile", "tile-time-range-zoom"], ["update:modelValue"]),
4306
4351
  setup(a, { expose: e, emit: t }) {
4307
- ut((S) => ({
4352
+ ct((S) => ({
4308
4353
  v3a012eda: l.value
4309
4354
  }));
4310
- const i = a, s = t, r = $t(a, "modelValue"), { i18n: o } = ue.useI18n(), n = A(0), d = A(null), u = A(), h = A(), l = A("scale(1)"), f = _e(ve);
4311
- f || (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")), ue.useRequestQueue();
4312
- const m = Be(), p = k(() => i.context.timeSpec ? i.context.timeSpec : {
4355
+ const i = a, s = t, r = Vt(a, "modelValue"), { i18n: o } = le.useI18n(), n = M(0), d = M(null), h = M(), u = M(), l = M("scale(1)"), f = pe(ve);
4356
+ f || (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")), le.useRequestQueue();
4357
+ const g = $e(), p = R(() => i.context.timeSpec ? i.context.timeSpec : {
4313
4358
  type: "relative",
4314
- time_range: m.defaultQueryTimeForOrg
4315
- }), y = k(() => !!i.context.timeSpec || !m.loading), g = (S, H) => {
4316
- const B = S.layout.position.row - H.layout.position.row;
4317
- return B !== 0 ? B : S.layout.position.col - H.layout.position.col;
4318
- }, T = k(() => r.value.tiles.map((S) => {
4319
- var B;
4320
- let H = S.definition;
4321
- if ("description" in H.chart) {
4322
- const W = (B = H.chart.description) == null ? void 0 : B.replace(es, () => {
4323
- const xe = `renderer.trendRange.${p.value.type === "absolute" ? "custom" : p.value.time_range}`;
4324
- return o.te(xe) ? o.t(xe) : "";
4359
+ time_range: g.defaultQueryTimeForOrg
4360
+ }), y = R(() => !!i.context.timeSpec || !g.loading), m = (S, O) => {
4361
+ const $ = S.layout.position.row - O.layout.position.row;
4362
+ return $ !== 0 ? $ : S.layout.position.col - O.layout.position.col;
4363
+ }, k = R(() => r.value.tiles.map((S) => {
4364
+ var $;
4365
+ let O = S.definition;
4366
+ if ("description" in O.chart) {
4367
+ const F = ($ = O.chart.description) == null ? void 0 : $.replace(hs, () => {
4368
+ const Fe = `renderer.trendRange.${p.value.type === "absolute" ? "custom" : p.value.time_range}`;
4369
+ return o.te(Fe) ? o.t(Fe) : "";
4325
4370
  });
4326
- H = {
4327
- ...H,
4371
+ O = {
4372
+ ...O,
4328
4373
  chart: {
4329
- ...H.chart,
4330
- description: W
4374
+ ...O.chart,
4375
+ description: F
4331
4376
  }
4332
4377
  };
4333
4378
  }
@@ -4337,24 +4382,24 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
4337
4382
  S
4338
4383
  ), {
4339
4384
  layout: S.layout,
4340
- meta: H,
4385
+ meta: O,
4341
4386
  type: S.type,
4342
4387
  // Add a unique key to each tile internally.
4343
4388
  id: S.id ?? crypto.randomUUID()
4344
4389
  };
4345
- })), M = (S) => {
4390
+ })), L = (S) => {
4346
4391
  s("edit-tile", S);
4347
- }, w = (S) => S.type === "slottable", I = (S) => {
4392
+ }, w = (S) => S.type === "slottable", q = (S) => {
4348
4393
  try {
4349
- const H = w(S.meta.chart) ? { ...S.meta.chart } : {
4394
+ const O = w(S.meta.chart) ? { ...S.meta.chart } : {
4350
4395
  ...S.meta.chart,
4351
4396
  chart_title: S.meta.chart.chart_title ? `Copy of ${S.meta.chart.chart_title}` : ""
4352
- }, B = {
4397
+ }, $ = {
4353
4398
  id: crypto.randomUUID(),
4354
4399
  type: "chart",
4355
4400
  definition: {
4356
4401
  ...S.meta,
4357
- chart: H
4402
+ chart: O
4358
4403
  },
4359
4404
  layout: {
4360
4405
  position: {
@@ -4364,90 +4409,90 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
4364
4409
  size: S.layout.size
4365
4410
  }
4366
4411
  };
4367
- r.value.tiles.push(JSON.parse(JSON.stringify(B)));
4368
- } catch (H) {
4369
- console.warn(H);
4412
+ r.value.tiles.push(JSON.parse(JSON.stringify($)));
4413
+ } catch (O) {
4414
+ console.warn(O);
4370
4415
  }
4371
- }, O = (S) => {
4416
+ }, A = (S) => {
4372
4417
  d.value && d.value.removeWidget(S.id);
4373
- }, R = () => {
4418
+ }, fe = () => {
4374
4419
  n.value++;
4375
- }, q = (S) => {
4376
- const H = S.map((B) => ({
4377
- id: B.id,
4378
- type: B.type,
4379
- layout: B.layout,
4380
- definition: B.meta
4420
+ }, we = (S) => {
4421
+ const O = S.map(($) => ({
4422
+ id: $.id,
4423
+ type: $.type,
4424
+ layout: $.layout,
4425
+ definition: $.meta
4381
4426
  }));
4382
- r.value.tiles = H.sort(g);
4383
- }, se = async () => {
4384
- if (l.value = "scale(1)", await dt(), h.value) {
4385
- const { availWidth: S, availHeight: H } = window.screen, { width: B, height: W } = h.value.getBoundingClientRect(), K = Math.min(H / W, S / B);
4386
- l.value = `scale(${K})`;
4427
+ r.value.tiles = O.sort(m);
4428
+ }, _e = async () => {
4429
+ if (l.value = "scale(1)", await ft(), u.value) {
4430
+ const { availWidth: S, availHeight: O } = window.screen, { width: $, height: F } = u.value.getBoundingClientRect(), ne = Math.min(O / F, S / $);
4431
+ l.value = `scale(${ne})`;
4387
4432
  }
4388
- }, me = () => {
4389
- u.value && (document.fullscreenElement ? document.exitFullscreen() : u.value.requestFullscreen());
4390
- }, j = A(!1), pe = () => {
4391
- j.value = document.fullscreenElement !== null, j.value && se();
4392
- }, we = k(() => r.value.preset_filters ?? []), { internalContext: Ee } = ue.useDashboardInternalContext({
4393
- globalFilters: we,
4394
- context: Oe(i, "context"),
4395
- isFullscreen: j
4433
+ }, T = () => {
4434
+ h.value && (document.fullscreenElement ? document.exitFullscreen() : h.value.requestFullscreen());
4435
+ }, z = M(!1), re = () => {
4436
+ z.value = document.fullscreenElement !== null, z.value && _e();
4437
+ }, ge = R(() => r.value.preset_filters ?? []), { internalContext: Ee } = le.useDashboardInternalContext({
4438
+ globalFilters: ge,
4439
+ context: De(i, "context"),
4440
+ isFullscreen: z
4396
4441
  });
4397
4442
  return e({
4398
- refresh: R,
4399
- toggleFullscreen: me
4400
- }), (S, H) => {
4401
- const B = de("KAlert");
4402
- return C(), G("div", {
4443
+ refresh: fe,
4444
+ toggleFullscreen: T
4445
+ }), (S, O) => {
4446
+ const $ = ue("KAlert");
4447
+ return C(), W("div", {
4403
4448
  ref_key: "dashboardContainer",
4404
- ref: u,
4405
- class: De(["kong-ui-public-dashboard-renderer", { "is-fullscreen": j.value }]),
4406
- onFullscreenchange: pe
4449
+ ref: h,
4450
+ class: ze(["kong-ui-public-dashboard-renderer", { "is-fullscreen": z.value }]),
4451
+ onFullscreenchange: re
4407
4452
  }, [
4408
- Z("div", {
4453
+ X("div", {
4409
4454
  ref_key: "layoutContainer",
4410
- ref: h,
4455
+ ref: u,
4411
4456
  class: "layout"
4412
4457
  }, [
4413
- x(f) && j.value ? (C(), G("div", Xs, [
4458
+ x(f) && z.value ? (C(), W("div", nr, [
4414
4459
  Ae(S.$slots, "fullscreenHeader", {}, void 0, !0)
4415
- ])) : Y("", !0),
4416
- x(f) ? (C(), L(Bt(a.context.editable && !j.value ? Ys : Bs), {
4460
+ ])) : V("", !0),
4461
+ x(f) ? (C(), I(Qt(a.context.editable && !z.value ? rr : js), {
4417
4462
  key: 2,
4418
4463
  ref_key: "gridLayoutRef",
4419
4464
  ref: d,
4420
4465
  "tile-height": r.value.tile_height,
4421
- tiles: T.value,
4422
- onUpdateTiles: q
4466
+ tiles: k.value,
4467
+ onUpdateTiles: we
4423
4468
  }, {
4424
- tile: P(({ tile: W }) => [
4425
- W.meta.chart.type === "slottable" ? (C(), G("div", js, [
4426
- Ae(S.$slots, W.meta.chart.id, {}, void 0, !0)
4427
- ])) : (C(), L(ti, {
4428
- key: j.value ? `${W.id}-tile` : `${W.id}-tile-fullscreen`,
4469
+ tile: P(({ tile: F }) => [
4470
+ F.meta.chart.type === "slottable" ? (C(), W("div", or, [
4471
+ Ae(S.$slots, F.meta.chart.id, {}, void 0, !0)
4472
+ ])) : (C(), I(li, {
4473
+ key: z.value ? `${F.id}-tile` : `${F.id}-tile-fullscreen`,
4429
4474
  "refresh-counter": n.value,
4430
- "onUpdate:refreshCounter": H[0] || (H[0] = (K) => n.value = K),
4475
+ "onUpdate:refreshCounter": O[0] || (O[0] = (ne) => n.value = ne),
4431
4476
  class: "tile-container",
4432
4477
  context: x(Ee),
4433
- definition: W.meta,
4434
- height: W.layout.size.rows * (r.value.tile_height || x(Fe)) + parseInt(x(ei), 10),
4435
- "is-fullscreen": j.value,
4478
+ definition: F.meta,
4479
+ height: F.layout.size.rows * (r.value.tile_height || x(Be)) + parseInt(x(ai), 10),
4480
+ "is-fullscreen": z.value,
4436
4481
  "query-ready": y.value,
4437
- "tile-id": W.id,
4438
- onDuplicateTile: (K) => I(W),
4439
- onEditTile: (K) => M(W),
4440
- onRemoveTile: (K) => O(W),
4441
- onTileTimeRangeZoom: H[1] || (H[1] = (K) => s("tile-time-range-zoom", K))
4482
+ "tile-id": F.id,
4483
+ onDuplicateTile: (ne) => q(F),
4484
+ onEditTile: (ne) => L(F),
4485
+ onRemoveTile: (ne) => A(F),
4486
+ onTileTimeRangeZoom: O[1] || (O[1] = (ne) => s("tile-time-range-zoom", ne))
4442
4487
  }, null, 8, ["refresh-counter", "context", "definition", "height", "is-fullscreen", "query-ready", "tile-id", "onDuplicateTile", "onEditTile", "onRemoveTile"]))
4443
4488
  ]),
4444
4489
  _: 3
4445
- }, 40, ["tile-height", "tiles"])) : (C(), L(B, {
4490
+ }, 40, ["tile-height", "tiles"])) : (C(), I($, {
4446
4491
  key: 1,
4447
4492
  appearance: "danger"
4448
4493
  }, {
4449
4494
  default: P(() => [
4450
- ht(ie(x(o).t("renderer.noQueryBridge")), 1)
4495
+ dt(ee(x(o).t("renderer.noQueryBridge")), 1)
4451
4496
  ]),
4452
4497
  _: 1
4453
4498
  }))
@@ -4455,7 +4500,7 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
4455
4500
  ], 34);
4456
4501
  };
4457
4502
  }
4458
- }), cr = /* @__PURE__ */ be(Zs, [["__scopeId", "data-v-50c8588f"]]), fr = /* @__PURE__ */ J({
4503
+ }), wr = /* @__PURE__ */ be(ar, [["__scopeId", "data-v-50c8588f"]]), Er = /* @__PURE__ */ Z({
4459
4504
  __name: "DashboardTilePreview",
4460
4505
  props: {
4461
4506
  context: {},
@@ -4464,61 +4509,61 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
4464
4509
  },
4465
4510
  emits: ["chart-data", "tile-time-range-zoom", "tile-bounds-change"],
4466
4511
  setup(a, { expose: e, emit: t }) {
4467
- const i = xt("root"), s = xt("dashboard-tile"), r = crypto.randomUUID(), o = t, n = (w) => {
4512
+ const i = Tt("root"), s = Tt("dashboard-tile"), r = crypto.randomUUID(), o = t, n = (w) => {
4468
4513
  o("tile-time-range-zoom", w);
4469
4514
  }, d = (w) => {
4470
4515
  o("chart-data", w);
4471
- }, u = (w) => {
4516
+ }, h = (w) => {
4472
4517
  o("tile-bounds-change", w);
4473
- }, { i18n: h } = ue.useI18n(), { internalContext: l } = ue.useDashboardInternalContext({
4474
- globalFilters: Oe(() => a.globalFilters),
4475
- context: Oe(() => a.context)
4476
- }), f = Be(), m = k(() => !!a.context.timeSpec || !f.loading), p = k(() => {
4477
- var w, I;
4478
- return !((I = (w = a.definition) == null ? void 0 : w.query) != null && I.metrics) || a.definition.query.metrics.length === 0;
4479
- }), y = A(Fe);
4480
- let g;
4481
- Je(() => {
4482
- var I;
4483
- const w = (I = i.value) == null ? void 0 : I.parentElement;
4484
- w && (y.value = w.getBoundingClientRect().height, g = new ResizeObserver(([O]) => {
4485
- const { height: R } = O.contentRect;
4486
- y.value = R;
4487
- }), g.observe(w));
4488
- }), et(() => g == null ? void 0 : g.disconnect());
4489
- const T = A(0);
4518
+ }, { i18n: u } = le.useI18n(), { internalContext: l } = le.useDashboardInternalContext({
4519
+ globalFilters: De(() => a.globalFilters),
4520
+ context: De(() => a.context)
4521
+ }), f = $e(), g = R(() => !!a.context.timeSpec || !f.loading), p = R(() => {
4522
+ var w, q;
4523
+ return !((q = (w = a.definition) == null ? void 0 : w.query) != null && q.metrics) || a.definition.query.metrics.length === 0;
4524
+ }), y = M(Be);
4525
+ let m;
4526
+ et(() => {
4527
+ var q;
4528
+ const w = (q = i.value) == null ? void 0 : q.parentElement;
4529
+ w && (y.value = w.getBoundingClientRect().height, m = new ResizeObserver(([A]) => {
4530
+ const { height: fe } = A.contentRect;
4531
+ y.value = fe;
4532
+ }), m.observe(w));
4533
+ }), tt(() => m == null ? void 0 : m.disconnect());
4534
+ const k = M(0);
4490
4535
  return e({
4491
4536
  refresh: () => {
4492
- T.value++;
4537
+ k.value++;
4493
4538
  },
4494
4539
  getExportData: () => {
4495
4540
  var w;
4496
4541
  return (w = s.value) == null ? void 0 : w.getExportData();
4497
4542
  }
4498
- }), (w, I) => {
4499
- const O = de("KEmptyState");
4500
- return C(), G("div", {
4543
+ }), (w, q) => {
4544
+ const A = ue("KEmptyState");
4545
+ return C(), W("div", {
4501
4546
  ref_key: "root",
4502
4547
  ref: i,
4503
4548
  "data-testid": "dashboard-tile-preview-root"
4504
4549
  }, [
4505
- p.value ? (C(), L(O, {
4550
+ p.value ? (C(), I(A, {
4506
4551
  key: 0,
4507
4552
  "action-button-visible": !1,
4508
4553
  "data-testid": "chart-not-configured-empty-state"
4509
4554
  }, {
4510
4555
  title: P(() => [
4511
- Z("p", null, ie(x(h).t("renderer.not_configured.title")), 1)
4556
+ X("p", null, ee(x(u).t("renderer.not_configured.title")), 1)
4512
4557
  ]),
4513
4558
  default: P(() => [
4514
- Z("p", null, ie(x(h).t("renderer.not_configured.description")), 1)
4559
+ X("p", null, ee(x(u).t("renderer.not_configured.description")), 1)
4515
4560
  ]),
4516
4561
  _: 1
4517
- })) : (C(), L(ti, {
4562
+ })) : (C(), I(li, {
4518
4563
  key: 1,
4519
4564
  ref: "dashboard-tile",
4520
- "refresh-counter": T.value,
4521
- "onUpdate:refreshCounter": I[0] || (I[0] = (R) => T.value = R),
4565
+ "refresh-counter": k.value,
4566
+ "onUpdate:refreshCounter": q[0] || (q[0] = (fe) => k.value = fe),
4522
4567
  context: {
4523
4568
  ...x(l),
4524
4569
  editable: !1
@@ -4526,17 +4571,17 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
4526
4571
  definition: a.definition,
4527
4572
  height: y.value,
4528
4573
  "hide-actions": "",
4529
- "query-ready": m.value,
4574
+ "query-ready": g.value,
4530
4575
  "show-refresh": "",
4531
4576
  "tile-id": x(r),
4532
4577
  onChartData: d,
4533
- onTileBoundsChange: u,
4578
+ onTileBoundsChange: h,
4534
4579
  onTileTimeRangeZoom: n
4535
4580
  }, null, 8, ["refresh-counter", "context", "definition", "height", "query-ready", "tile-id"]))
4536
4581
  ], 512);
4537
4582
  };
4538
4583
  }
4539
- }), Js = (a) => {
4584
+ }), lr = (a) => {
4540
4585
  var t;
4541
4586
  const e = (t = a.definition) == null ? void 0 : t.query;
4542
4587
  if (!e)
@@ -4546,7 +4591,7 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
4546
4591
  return;
4547
4592
  }
4548
4593
  return a;
4549
- }, er = (a) => {
4594
+ }, hr = (a) => {
4550
4595
  var i;
4551
4596
  const e = (i = a.definition) == null ? void 0 : i.query;
4552
4597
  if (!e)
@@ -4562,56 +4607,56 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
4562
4607
  query: t
4563
4608
  }
4564
4609
  };
4565
- }, tr = (a) => {
4566
- var r, o, n, d, u;
4610
+ }, ur = (a) => {
4611
+ var r, o, n, d, h;
4567
4612
  if (!a.length)
4568
4613
  return [];
4569
4614
  let e = 0, t = 0, i = 0;
4570
4615
  const s = [];
4571
- for (const h of a) {
4572
- const l = ((o = (r = h.layout) == null ? void 0 : r.size) == null ? void 0 : o.cols) ?? 1, f = ((d = (n = h.layout) == null ? void 0 : n.size) == null ? void 0 : d.rows) ?? 1;
4573
- t + l > ct && (e += i, t = 0, i = 0);
4574
- const m = {
4575
- ...h,
4616
+ for (const u of a) {
4617
+ const l = ((o = (r = u.layout) == null ? void 0 : r.size) == null ? void 0 : o.cols) ?? 1, f = ((d = (n = u.layout) == null ? void 0 : n.size) == null ? void 0 : d.rows) ?? 1;
4618
+ t + l > mt && (e += i, t = 0, i = 0);
4619
+ const g = {
4620
+ ...u,
4576
4621
  layout: {
4577
- ...h.layout,
4622
+ ...u.layout,
4578
4623
  position: {
4579
- ...((u = h.layout) == null ? void 0 : u.position) ?? {},
4624
+ ...((h = u.layout) == null ? void 0 : h.position) ?? {},
4580
4625
  col: t,
4581
4626
  row: e
4582
4627
  }
4583
4628
  }
4584
4629
  };
4585
- s.push(m), t += l, i = Math.max(i, f);
4630
+ s.push(g), t += l, i = Math.max(i, f);
4586
4631
  }
4587
4632
  return s;
4588
- }, gr = (a, e) => {
4633
+ }, xr = (a, e) => {
4589
4634
  if (e) {
4590
- const s = a.tiles.map(er);
4635
+ const s = a.tiles.map(hr);
4591
4636
  return {
4592
4637
  ...a,
4593
4638
  tiles: s
4594
4639
  };
4595
4640
  }
4596
- const t = a.tiles.map(Js).filter((s) => s !== void 0), i = tr(t);
4641
+ const t = a.tiles.map(lr).filter((s) => s !== void 0), i = ur(t);
4597
4642
  return {
4598
4643
  ...a,
4599
4644
  tiles: i
4600
4645
  };
4601
4646
  };
4602
4647
  export {
4603
- Ji as C,
4604
- ct as D,
4605
- Rt as E,
4606
- ss as F,
4607
- Bs as G,
4648
+ ls as C,
4649
+ mt as D,
4650
+ Dt as E,
4651
+ cs as F,
4652
+ js as G,
4608
4653
  ve as I,
4609
- es as T,
4610
- ft as _,
4611
- Fe as a,
4612
- ts as b,
4613
- cr as c,
4614
- fr as d,
4615
- is as e,
4616
- gr as f
4654
+ hs as T,
4655
+ pt as _,
4656
+ Be as a,
4657
+ us as b,
4658
+ wr as c,
4659
+ Er as d,
4660
+ ds as e,
4661
+ xr as f
4617
4662
  };