@gravitee/gamma-lib-observability 2.2.2 → 2.2.3-fix-obs-60-keep-dirty-draft-on-failed-refetch.8c485f0

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.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v, y } from "./filter-providers-context.js";
2
- import { AlertCircleIcon as b, AlignRightIcon as x, ArrowLeftIcon as S, ArrowRightIcon as C, BarChart3Icon as w, BoxesIcon as ee, BrainCircuitIcon as te, CableIcon as T, CalendarIcon as ne, ChartLineIcon as re, CheckIcon as ie, ChevronDownIcon as ae, ChevronRightIcon as oe, CircleDotIcon as se, CircleHelpIcon as ce, ClockIcon as le, CopyIcon as E, ExpandIcon as ue, FileTextIcon as de, FilterIcon as fe, FunnelXIcon as pe, GlobeIcon as me, InfoIcon as he, LayoutDashboardIcon as ge, LayoutGridIcon as _e, ListIcon as ve, LockIcon as ye, MessageSquareIcon as be, MoreVerticalIcon as xe, NetworkIcon as Se, PanelLeftIcon as Ce, PencilIcon as we, PlusIcon as Te, RefreshCwIcon as Ee, Trash2Icon as De, TrendingUpIcon as Oe, WebhookIcon as ke, XIcon as Ae } from "@gravitee/graphene-core/icons";
2
+ import { AlertCircleIcon as b, AlignRightIcon as x, ArrowLeftIcon as S, ArrowRightIcon as C, BarChart3Icon as w, BoxesIcon as ee, BrainCircuitIcon as te, CableIcon as ne, CalendarIcon as re, ChartLineIcon as T, CheckIcon as ie, ChevronDownIcon as ae, ChevronRightIcon as oe, CircleDotIcon as se, CircleHelpIcon as ce, ClockIcon as le, CopyIcon as E, ExpandIcon as ue, FileTextIcon as de, FilterIcon as fe, FunnelXIcon as pe, GlobeIcon as me, InfoIcon as he, LayoutDashboardIcon as ge, LayoutGridIcon as _e, ListIcon as ve, LockIcon as ye, MessageSquareIcon as be, MoreVerticalIcon as xe, NetworkIcon as Se, PanelLeftIcon as Ce, PencilIcon as we, PlusIcon as Te, RefreshCwIcon as Ee, Trash2Icon as De, TrendingUpIcon as Oe, WebhookIcon as ke, XIcon as Ae } from "@gravitee/graphene-core/icons";
3
3
  import { Component as je, Fragment as Me, Suspense as Ne, createContext as Pe, createElement as Fe, forwardRef as Ie, lazy as Le, memo as Re, useCallback as D, useContext as ze, useEffect as O, useId as Be, useLayoutEffect as Ve, useMemo as k, useReducer as He, useRef as A, useState as j } from "react";
4
4
  import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
5
5
  import { keepPreviousData as Ue, useInfiniteQuery as We, useMutation as Ge, useQueries as Ke, useQuery as F, useQueryClient as qe } from "@tanstack/react-query";
@@ -26,7 +26,7 @@ var Hn = [
26
26
  {
27
27
  id: "MCP",
28
28
  label: "MCP",
29
- icon: T,
29
+ icon: ne,
30
30
  colorClass: "text-chart-5",
31
31
  bgClass: "bg-chart-5/10"
32
32
  },
@@ -79,7 +79,7 @@ var qn = [
79
79
  {
80
80
  id: "ANALYTICS",
81
81
  label: "Analytics",
82
- icon: re,
82
+ icon: T,
83
83
  colorClass: "text-chart-2"
84
84
  },
85
85
  {
@@ -1047,7 +1047,7 @@ function ki({ value: e, onChange: t, disabled: n = !1, showTimezone: r = !1, cla
1047
1047
  "aria-haspopup": "dialog",
1048
1048
  "aria-expanded": c,
1049
1049
  className: Y("justify-between gap-2 font-normal", i),
1050
- children: [Ei(e, r), /* @__PURE__ */ N(ne, {
1050
+ children: [Ei(e, r), /* @__PURE__ */ N(re, {
1051
1051
  "aria-hidden": "true",
1052
1052
  className: "size-4 shrink-0"
1053
1053
  })]
@@ -1691,19 +1691,19 @@ function ya({ existingCondition: e, onApply: t, onCancel: n, providers: r, activ
1691
1691
  selectedOptions: h,
1692
1692
  freeText: _
1693
1693
  }), ee = S === "enum" && b?.options || b?.valueLoader ? h.length === 0 : _.trim() === "", te = w || a && !!b && !!f && ee;
1694
- function T(e) {
1694
+ function ne(e) {
1695
1695
  if (!e) {
1696
1696
  u && (y.current = u), d(null);
1697
1697
  return;
1698
1698
  }
1699
1699
  e.field !== u && (d(e.field), e.field !== y.current && (y.current = null, p(f && e.operators.includes(f) ? f : e.operators[0] ?? null), g([]), v("")));
1700
1700
  }
1701
- function ne(e) {
1701
+ function re(e) {
1702
1702
  if (!b?.operators.includes(e)) return;
1703
1703
  let t = e;
1704
1704
  p(t), aa(t) ? !la(b, t) && h.length > 1 && g(h.slice(0, 1)) : (g([]), v(""));
1705
1705
  }
1706
- function re(e) {
1706
+ function T(e) {
1707
1707
  let t = x ? e : e.slice(0, 1);
1708
1708
  if (g(t), b && f) {
1709
1709
  let e = ua(b, f, t.length);
@@ -1734,12 +1734,12 @@ function ya({ existingCondition: e, onApply: t, onCancel: n, providers: r, activ
1734
1734
  /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Filter by" }), /* @__PURE__ */ N(Ki, {
1735
1735
  providers: l,
1736
1736
  selectedField: u,
1737
- onFieldChange: T,
1737
+ onFieldChange: ne,
1738
1738
  activeScopes: i
1739
1739
  })] }),
1740
1740
  /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Choose operator" }), /* @__PURE__ */ P(B, {
1741
1741
  value: f ?? void 0,
1742
- onValueChange: ne,
1742
+ onValueChange: re,
1743
1743
  disabled: !b,
1744
1744
  children: [/* @__PURE__ */ N(U, {
1745
1745
  className: "w-full",
@@ -1756,7 +1756,7 @@ function ya({ existingCondition: e, onApply: t, onCancel: n, providers: r, activ
1756
1756
  provider: b,
1757
1757
  operator: f,
1758
1758
  selected: h,
1759
- onSelectedChange: re,
1759
+ onSelectedChange: T,
1760
1760
  multiple: x,
1761
1761
  freeText: _,
1762
1762
  onFreeTextChange: v,
@@ -2079,13 +2079,13 @@ function Ha({ filters: e, onFiltersChange: t, editable: n = !0, scopeFilterField
2079
2079
  }
2080
2080
  t(Ba(e, n, c.find((e) => e.field === n.field))), w();
2081
2081
  }
2082
- function T(n) {
2082
+ function ne(n) {
2083
2083
  t(e.filter((e, t) => t !== n));
2084
2084
  }
2085
- function ne() {
2085
+ function re() {
2086
2086
  w(), t([]);
2087
2087
  }
2088
- function re(e) {
2088
+ function T(e) {
2089
2089
  e.preventDefault(), requestAnimationFrame(() => {
2090
2090
  let e = h.current;
2091
2091
  e && (e.querySelector("[data-autofocus]") ?? e.querySelector("input:not([disabled])"))?.focus();
@@ -2114,7 +2114,7 @@ function Ha({ filters: e, onFiltersChange: t, editable: n = !0, scopeFilterField
2114
2114
  active: r,
2115
2115
  signals: i?.signals,
2116
2116
  onEdit: () => S(t),
2117
- onRemove: () => T(t)
2117
+ onRemove: () => ne(t)
2118
2118
  }, Na(e));
2119
2119
  }),
2120
2120
  n ? /* @__PURE__ */ P(L, {
@@ -2132,7 +2132,7 @@ function Ha({ filters: e, onFiltersChange: t, editable: n = !0, scopeFilterField
2132
2132
  }) : null,
2133
2133
  n && e.length > 0 ? /* @__PURE__ */ N("button", {
2134
2134
  type: "button",
2135
- onClick: ne,
2135
+ onClick: re,
2136
2136
  className: "ml-1 shrink-0 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
2137
2137
  "aria-label": "Clear all filters",
2138
2138
  children: /* @__PURE__ */ N(pe, { className: "size-3.5" })
@@ -2146,7 +2146,7 @@ function Ha({ filters: e, onFiltersChange: t, editable: n = !0, scopeFilterField
2146
2146
  align: "start",
2147
2147
  sideOffset: 8,
2148
2148
  className: "w-auto p-0",
2149
- onOpenAutoFocus: re,
2149
+ onOpenAutoFocus: T,
2150
2150
  children: v ? /* @__PURE__ */ N(ya, {
2151
2151
  providers: c,
2152
2152
  existingCondition: y,
@@ -7107,13 +7107,13 @@ function rd(e) {
7107
7107
  });
7108
7108
  }
7109
7109
  function id() {
7110
- return cd((e, t) => e.createDashboard(t));
7110
+ return ld((e, t) => e.createDashboard(t));
7111
7111
  }
7112
7112
  function ad() {
7113
- return cd((e, t) => e.updateDashboard(t));
7113
+ return ld((e, t) => e.updateDashboard(t));
7114
7114
  }
7115
7115
  function od() {
7116
- return cd((e, t) => e.updateDashboard(t, void 0, { force: !0 }));
7116
+ return ld((e, t) => e.updateDashboard(t, void 0, { force: !0 }));
7117
7117
  }
7118
7118
  function sd() {
7119
7119
  let e = s(), t = qe();
@@ -7121,7 +7121,13 @@ function sd() {
7121
7121
  e?.adoptCurrentRevision?.(n.id), t.setQueryData(Z.customDashboard(n.id), n), t.invalidateQueries({ queryKey: Z.customDashboards() });
7122
7122
  }, [e, t]);
7123
7123
  }
7124
- function cd(e) {
7124
+ function cd() {
7125
+ let e = s();
7126
+ return D((t) => {
7127
+ e?.takeReadRevision?.(t);
7128
+ }, [e]);
7129
+ }
7130
+ function ld(e) {
7125
7131
  let t = s(), n = qe();
7126
7132
  return Ge({
7127
7133
  mutationFn: (n) => t ? e(t, n) : Promise.reject(/* @__PURE__ */ Error("No dashboard persistence configured.")),
@@ -7130,7 +7136,7 @@ function cd(e) {
7130
7136
  }
7131
7137
  });
7132
7138
  }
7133
- function ld() {
7139
+ function ud() {
7134
7140
  let e = s(), t = qe();
7135
7141
  return Ge({
7136
7142
  mutationFn: (t) => e ? e.deleteDashboard(t) : Promise.reject(/* @__PURE__ */ Error("No dashboard persistence configured.")),
@@ -7141,23 +7147,23 @@ function ld() {
7141
7147
  }
7142
7148
  //#endregion
7143
7149
  //#region src/dashboards/editor/DashboardConflictDialog.tsx
7144
- function ud({ open: e, theirDashboard: t, deleted: n = !1, pending: r = null, onResolve: i, onCancel: a }) {
7150
+ function dd({ open: e, theirDashboard: t, deleted: n = !1, pending: r = null, onResolve: i, onCancel: a }) {
7145
7151
  let [o, s] = j(!1), [c, l] = j(e), u = r !== null;
7146
7152
  return e !== c && (l(e), e && s(!1)), /* @__PURE__ */ N(ht, {
7147
7153
  open: e,
7148
7154
  onOpenChange: (e) => {
7149
7155
  !e && !u && a();
7150
7156
  },
7151
- children: /* @__PURE__ */ N(_t, { children: n ? /* @__PURE__ */ N(pd, {
7157
+ children: /* @__PURE__ */ N(_t, { children: n ? /* @__PURE__ */ N(md, {
7152
7158
  busy: u,
7153
7159
  pending: r,
7154
7160
  onResolve: i,
7155
7161
  onCancel: a
7156
- }) : o ? /* @__PURE__ */ N(fd, {
7162
+ }) : o ? /* @__PURE__ */ N(pd, {
7157
7163
  busy: u,
7158
7164
  onResolve: i,
7159
7165
  onBack: () => s(!1)
7160
- }) : /* @__PURE__ */ N(dd, {
7166
+ }) : /* @__PURE__ */ N(fd, {
7161
7167
  theirDashboard: t,
7162
7168
  busy: u,
7163
7169
  pending: r,
@@ -7167,27 +7173,27 @@ function ud({ open: e, theirDashboard: t, deleted: n = !1, pending: r = null, on
7167
7173
  }) })
7168
7174
  });
7169
7175
  }
7170
- function dd({ theirDashboard: e, busy: t, pending: n, onResolve: r, onTakeTheirs: i, onCancel: a }) {
7176
+ function fd({ theirDashboard: e, busy: t, pending: n, onResolve: r, onTakeTheirs: i, onCancel: a }) {
7171
7177
  return /* @__PURE__ */ P(M, { children: [
7172
7178
  /* @__PURE__ */ P(bt, { children: [/* @__PURE__ */ N(xt, { children: "Someone else updated this dashboard while you were editing" }), /* @__PURE__ */ N(vt, { children: "Nothing was saved and nothing was lost: your changes are still in the editor behind this dialog, and their version is still on the server. Pick what should happen to each." })] }),
7173
- e && /* @__PURE__ */ N(md, { dashboard: e }),
7179
+ e && /* @__PURE__ */ N(hd, { dashboard: e }),
7174
7180
  /* @__PURE__ */ P("div", {
7175
7181
  className: "flex flex-col gap-2",
7176
7182
  children: [
7177
- /* @__PURE__ */ N(hd, {
7183
+ /* @__PURE__ */ N(gd, {
7178
7184
  label: "Overwrite their version",
7179
7185
  description: "Saves your changes over theirs. What they saved is lost.",
7180
7186
  loading: n === "overwrite",
7181
7187
  disabled: t,
7182
7188
  onClick: () => r("overwrite")
7183
7189
  }),
7184
- /* @__PURE__ */ N(hd, {
7190
+ /* @__PURE__ */ N(gd, {
7185
7191
  label: "Take their version",
7186
7192
  description: "Replaces what is on your screen with theirs. Your changes are lost.",
7187
7193
  disabled: t,
7188
7194
  onClick: i
7189
7195
  }),
7190
- /* @__PURE__ */ N(hd, {
7196
+ /* @__PURE__ */ N(gd, {
7191
7197
  label: "Save as a copy",
7192
7198
  description: "Keeps both: your changes go to a new dashboard, theirs stays untouched.",
7193
7199
  loading: n === "save-as-copy",
@@ -7204,7 +7210,7 @@ function dd({ theirDashboard: e, busy: t, pending: n, onResolve: r, onTakeTheirs
7204
7210
  }) })
7205
7211
  ] });
7206
7212
  }
7207
- function fd({ busy: e, onResolve: t, onBack: n }) {
7213
+ function pd({ busy: e, onResolve: t, onBack: n }) {
7208
7214
  return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P(bt, { children: [/* @__PURE__ */ N(xt, { children: "Discard your changes?" }), /* @__PURE__ */ N(vt, { children: "Everything you edited since you opened this dashboard is replaced by the version the other author saved. It was never sent to the server, so this cannot be undone." })] }), /* @__PURE__ */ P(yt, { children: [/* @__PURE__ */ N(L, {
7209
7215
  variant: "outline",
7210
7216
  disabled: e,
@@ -7217,7 +7223,7 @@ function fd({ busy: e, onResolve: t, onBack: n }) {
7217
7223
  children: "Discard and take their version"
7218
7224
  })] })] });
7219
7225
  }
7220
- function pd({ busy: e, pending: t, onResolve: n, onCancel: r }) {
7226
+ function md({ busy: e, pending: t, onResolve: n, onCancel: r }) {
7221
7227
  return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P(bt, { children: [/* @__PURE__ */ N(xt, { children: "This dashboard no longer exists" }), /* @__PURE__ */ N(vt, { children: "It was deleted while you were editing, so there is nothing left to save it to. Your changes are still here and can be kept as a new dashboard." })] }), /* @__PURE__ */ P(yt, { children: [/* @__PURE__ */ N(L, {
7222
7228
  variant: "ghost",
7223
7229
  disabled: e,
@@ -7229,7 +7235,7 @@ function pd({ busy: e, pending: t, onResolve: n, onCancel: r }) {
7229
7235
  children: t === "save-as-copy" ? "Saving…" : "Save as a copy"
7230
7236
  })] })] });
7231
7237
  }
7232
- function md({ dashboard: e }) {
7238
+ function hd({ dashboard: e }) {
7233
7239
  return /* @__PURE__ */ P("div", {
7234
7240
  className: "flex flex-col gap-0.5 rounded-lg border border-border bg-muted/50 p-3",
7235
7241
  children: [
@@ -7248,7 +7254,7 @@ function md({ dashboard: e }) {
7248
7254
  ]
7249
7255
  });
7250
7256
  }
7251
- function hd({ label: e, description: t, loading: n = !1, disabled: r, onClick: i }) {
7257
+ function gd({ label: e, description: t, loading: n = !1, disabled: r, onClick: i }) {
7252
7258
  return /* @__PURE__ */ P(L, {
7253
7259
  variant: "outline",
7254
7260
  className: "h-auto w-full flex-col items-start gap-0.5 py-3 text-left whitespace-normal",
@@ -7265,26 +7271,26 @@ function hd({ label: e, description: t, loading: n = !1, disabled: r, onClick: i
7265
7271
  }
7266
7272
  //#endregion
7267
7273
  //#region src/dashboards/dashboard-filters.ts
7268
- function gd(e) {
7274
+ function _d(e) {
7269
7275
  return e.editable !== !0 && e.value.length > 0;
7270
7276
  }
7271
- function _d(e) {
7272
- return !gd(e);
7277
+ function vd(e) {
7278
+ return !_d(e);
7273
7279
  }
7274
- function vd(e, t) {
7280
+ function yd(e, t) {
7275
7281
  return e || !t;
7276
7282
  }
7277
- function yd(e, t) {
7283
+ function bd(e, t) {
7278
7284
  return t < 2 ? e : e === "eq" ? "in" : e === "neq" ? "not_in" : e;
7279
7285
  }
7280
- function bd(e, t) {
7281
- let n = e.filter(gd), r = e.filter(_d), i = new Set(e.map((e) => e.field)), a = new Map(r.map((e) => [e.field, e])), o = t.flatMap((e) => {
7286
+ function xd(e, t) {
7287
+ let n = e.filter(_d), r = e.filter(vd), i = new Set(e.map((e) => e.field)), a = new Map(r.map((e) => [e.field, e])), o = t.flatMap((e) => {
7282
7288
  let t = a.get(e.field);
7283
7289
  if (!t) return [];
7284
7290
  let { valueLabels: n, ...r } = t;
7285
7291
  return [{
7286
7292
  ...r,
7287
- operator: yd(t.operator, e.value.length),
7293
+ operator: bd(t.operator, e.value.length),
7288
7294
  value: e.value,
7289
7295
  ...e.valueLabels ? { valueLabels: e.valueLabels } : {}
7290
7296
  }];
@@ -7301,7 +7307,7 @@ function bd(e, t) {
7301
7307
  }
7302
7308
  //#endregion
7303
7309
  //#region src/dashboards/DashboardFilterChip.tsx
7304
- var xd = Ie(function({ condition: e, revaluable: t, changedByReader: n, editable: r, active: i, onEdit: a, onRemove: o }, s) {
7310
+ var Sd = Ie(function({ condition: e, revaluable: t, changedByReader: n, editable: r, active: i, onEdit: a, onRemove: o }, s) {
7305
7311
  return /* @__PURE__ */ N(ka, {
7306
7312
  ref: s,
7307
7313
  condition: e,
@@ -7326,13 +7332,13 @@ var xd = Ie(function({ condition: e, revaluable: t, changedByReader: n, editable
7326
7332
  });
7327
7333
  //#endregion
7328
7334
  //#region src/dashboards/DashboardFilterChipPopover.tsx
7329
- function Sd({ condition: e, revaluable: t, changedByReader: n, onRemove: r, renderForm: i }) {
7335
+ function Cd({ condition: e, revaluable: t, changedByReader: n, onRemove: r, renderForm: i }) {
7330
7336
  let [a, o] = j(!1), s = A(null), c = A({ getBoundingClientRect: () => s.current?.getBoundingClientRect() ?? new DOMRect() });
7331
7337
  return /* @__PURE__ */ P(Lt, {
7332
7338
  open: a,
7333
7339
  onOpenChange: o,
7334
7340
  children: [
7335
- /* @__PURE__ */ N(xd, {
7341
+ /* @__PURE__ */ N(Sd, {
7336
7342
  ref: s,
7337
7343
  condition: e,
7338
7344
  revaluable: t,
@@ -7352,9 +7358,9 @@ function Sd({ condition: e, revaluable: t, changedByReader: n, onRemove: r, rend
7352
7358
  }
7353
7359
  //#endregion
7354
7360
  //#region src/dashboards/editor/DashboardFiltersEditor.tsx
7355
- var Cd = ["ANALYTICS"];
7356
- function wd({ filters: e, scopeFilterField: t, onChange: n }) {
7357
- let r = ji(void 0, Cd), i = ji(t, Cd), a = Ma(t), o = new Set(e.map((e) => e.field)), s = i.filter((e) => !o.has(e.field));
7361
+ var wd = ["ANALYTICS"];
7362
+ function Td({ filters: e, scopeFilterField: t, onChange: n }) {
7363
+ let r = ji(void 0, wd), i = ji(t, wd), a = Ma(t), o = new Set(e.map((e) => e.field)), s = i.filter((e) => !o.has(e.field));
7358
7364
  return /* @__PURE__ */ N(J, { children: /* @__PURE__ */ P("div", {
7359
7365
  className: "flex flex-wrap items-center gap-1.5",
7360
7366
  children: [
@@ -7362,7 +7368,7 @@ function wd({ filters: e, scopeFilterField: t, onChange: n }) {
7362
7368
  className: "text-xs font-medium text-muted-foreground",
7363
7369
  children: "Dashboard filters"
7364
7370
  }),
7365
- e.map((t, i) => /* @__PURE__ */ N(Td, {
7371
+ e.map((t, i) => /* @__PURE__ */ N(Ed, {
7366
7372
  condition: {
7367
7373
  ...t,
7368
7374
  label: Aa(t, r)
@@ -7373,7 +7379,7 @@ function wd({ filters: e, scopeFilterField: t, onChange: n }) {
7373
7379
  onChange: (t) => n(e.map((e, n) => n === i ? t : e)),
7374
7380
  onRemove: () => n(e.filter((e, t) => t !== i))
7375
7381
  }, i)),
7376
- /* @__PURE__ */ N(Ed, {
7382
+ /* @__PURE__ */ N(Dd, {
7377
7383
  addableProviders: s,
7378
7384
  activeApiTypes: a,
7379
7385
  onAdd: (t) => n([...e, t])
@@ -7381,13 +7387,13 @@ function wd({ filters: e, scopeFilterField: t, onChange: n }) {
7381
7387
  ]
7382
7388
  }) });
7383
7389
  }
7384
- function Td({ condition: e, own: t, addableProviders: n, activeApiTypes: r, onChange: i, onRemove: a }) {
7390
+ function Ed({ condition: e, own: t, addableProviders: n, activeApiTypes: r, onChange: i, onRemove: a }) {
7385
7391
  let o = k(() => t ? [t, ...n.filter((e) => e.field !== t.field)] : n, [t, n]);
7386
- return /* @__PURE__ */ N(Sd, {
7392
+ return /* @__PURE__ */ N(Cd, {
7387
7393
  condition: e,
7388
- revaluable: _d(e),
7394
+ revaluable: vd(e),
7389
7395
  onRemove: a,
7390
- renderForm: (t) => /* @__PURE__ */ N(Dd, {
7396
+ renderForm: (t) => /* @__PURE__ */ N(Od, {
7391
7397
  existingCondition: e,
7392
7398
  providers: o,
7393
7399
  activeApiTypes: r,
@@ -7401,7 +7407,7 @@ function Td({ condition: e, own: t, addableProviders: n, activeApiTypes: r, onCh
7401
7407
  })
7402
7408
  });
7403
7409
  }
7404
- function Ed({ addableProviders: e, activeApiTypes: t, onAdd: n }) {
7410
+ function Dd({ addableProviders: e, activeApiTypes: t, onAdd: n }) {
7405
7411
  let [r, i] = j(!1);
7406
7412
  return /* @__PURE__ */ P(Lt, {
7407
7413
  open: r,
@@ -7418,7 +7424,7 @@ function Ed({ addableProviders: e, activeApiTypes: t, onAdd: n }) {
7418
7424
  }), /* @__PURE__ */ N(zt, {
7419
7425
  align: "start",
7420
7426
  className: "w-auto p-0",
7421
- children: /* @__PURE__ */ N(Dd, {
7427
+ children: /* @__PURE__ */ N(Od, {
7422
7428
  providers: e,
7423
7429
  activeApiTypes: t,
7424
7430
  onApply: (e) => {
@@ -7429,8 +7435,8 @@ function Ed({ addableProviders: e, activeApiTypes: t, onAdd: n }) {
7429
7435
  })]
7430
7436
  });
7431
7437
  }
7432
- function Dd({ existingCondition: e, providers: t, activeApiTypes: n, onApply: r, onCancel: i, onRemove: a }) {
7433
- let o = Be(), [s, c] = j(e ? _d(e) : !0);
7438
+ function Od({ existingCondition: e, providers: t, activeApiTypes: n, onApply: r, onCancel: i, onRemove: a }) {
7439
+ let o = Be(), [s, c] = j(e ? vd(e) : !0);
7434
7440
  return /* @__PURE__ */ N(ya, {
7435
7441
  existingCondition: e,
7436
7442
  providers: t,
@@ -7458,33 +7464,33 @@ function Dd({ existingCondition: e, providers: t, activeApiTypes: n, onApply: r,
7458
7464
  onRemove: a,
7459
7465
  onApply: (e) => r({
7460
7466
  ...e,
7461
- editable: vd(s, e.value.length > 0)
7467
+ editable: yd(s, e.value.length > 0)
7462
7468
  }),
7463
7469
  onCancel: i
7464
7470
  });
7465
7471
  }
7466
7472
  //#endregion
7467
7473
  //#region src/dashboards/editor/is-json-equal.ts
7468
- function Od(e, t) {
7474
+ function kd(e, t) {
7469
7475
  if (e === t) return !0;
7470
7476
  if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
7471
- if (Array.isArray(e) || Array.isArray(t)) return !Array.isArray(e) || !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => Od(e, t[n]));
7477
+ if (Array.isArray(e) || Array.isArray(t)) return !Array.isArray(e) || !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => kd(e, t[n]));
7472
7478
  let n = e, r = t;
7473
- for (let e of new Set([...Object.keys(n), ...Object.keys(r)])) if (!Od(n[e], r[e])) return !1;
7479
+ for (let e of new Set([...Object.keys(n), ...Object.keys(r)])) if (!kd(n[e], r[e])) return !1;
7474
7480
  return !0;
7475
7481
  }
7476
7482
  //#endregion
7477
7483
  //#region src/dashboards/editor/dashboard-editor-state.ts
7478
- function kd(e) {
7484
+ function Ad(e) {
7479
7485
  return {
7480
7486
  draft: e,
7481
7487
  baseline: e
7482
7488
  };
7483
7489
  }
7484
- function Ad(e) {
7485
- return !Od(e.draft, e.baseline);
7490
+ function jd(e) {
7491
+ return !kd(e.draft, e.baseline);
7486
7492
  }
7487
- function jd(e, t) {
7493
+ function Md(e, t) {
7488
7494
  return {
7489
7495
  ...e,
7490
7496
  draft: {
@@ -7493,19 +7499,19 @@ function jd(e, t) {
7493
7499
  }
7494
7500
  };
7495
7501
  }
7496
- function Md(e, t) {
7502
+ function Nd(e, t) {
7497
7503
  switch (t.type) {
7498
- case "init": return kd(t.dashboard);
7504
+ case "init": return Ad(t.dashboard);
7499
7505
  case "markSaved": return {
7500
7506
  draft: t.dashboard,
7501
7507
  baseline: t.dashboard
7502
7508
  };
7503
- case "setTitle": return jd(e, { title: t.title });
7504
- case "setDescription": return jd(e, { description: t.description.length > 0 ? t.description : void 0 });
7505
- case "setTimeRange": return jd(e, { timeRange: t.timeRange });
7506
- case "setFilters": return jd(e, { filters: t.filters });
7507
- case "upsertWidget": return jd(e, { widgets: e.draft.widgets.some((e) => e.id === t.widget.id) ? e.draft.widgets.map((e) => e.id === t.widget.id ? t.widget : e) : [...e.draft.widgets, t.widget] });
7508
- case "removeWidget": return jd(e, { widgets: e.draft.widgets.filter((e) => e.id !== t.widgetId) });
7509
+ case "setTitle": return Md(e, { title: t.title });
7510
+ case "setDescription": return Md(e, { description: t.description.length > 0 ? t.description : void 0 });
7511
+ case "setTimeRange": return Md(e, { timeRange: t.timeRange });
7512
+ case "setFilters": return Md(e, { filters: t.filters });
7513
+ case "upsertWidget": return Md(e, { widgets: e.draft.widgets.some((e) => e.id === t.widget.id) ? e.draft.widgets.map((e) => e.id === t.widget.id ? t.widget : e) : [...e.draft.widgets, t.widget] });
7514
+ case "removeWidget": return Md(e, { widgets: e.draft.widgets.filter((e) => e.id !== t.widgetId) });
7509
7515
  case "duplicateWidget": {
7510
7516
  let n = e.draft.widgets.find((e) => e.id === t.widgetId);
7511
7517
  if (!n) return e;
@@ -7518,7 +7524,7 @@ function Md(e, t) {
7518
7524
  y: n.layout.y + n.layout.rows
7519
7525
  }
7520
7526
  };
7521
- return jd(e, { widgets: [...e.draft.widgets, r] });
7527
+ return Md(e, { widgets: [...e.draft.widgets, r] });
7522
7528
  }
7523
7529
  case "applyLayouts": {
7524
7530
  let n = !1, r = e.draft.widgets.map((e) => {
@@ -7528,9 +7534,9 @@ function Md(e, t) {
7528
7534
  layout: r
7529
7535
  });
7530
7536
  });
7531
- return n ? jd(e, { widgets: r }) : e;
7537
+ return n ? Md(e, { widgets: r }) : e;
7532
7538
  }
7533
- case "replaceEditable": return jd(e, {
7539
+ case "replaceEditable": return Md(e, {
7534
7540
  title: t.fields.title,
7535
7541
  description: t.fields.description,
7536
7542
  widgets: t.fields.widgets,
@@ -7539,20 +7545,20 @@ function Md(e, t) {
7539
7545
  });
7540
7546
  }
7541
7547
  }
7542
- function Nd() {
7548
+ function Pd() {
7543
7549
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `w-${crypto.randomUUID().slice(0, 8)}` : `w-${Math.random().toString(36).slice(2, 10)}`;
7544
7550
  }
7545
- function Pd() {
7551
+ function Fd() {
7546
7552
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
7547
7553
  }
7548
- function Fd(e) {
7554
+ function Id(e) {
7549
7555
  return {
7550
7556
  ...e,
7551
- id: Pd(),
7557
+ id: Fd(),
7552
7558
  title: `${e.title} (copy)`
7553
7559
  };
7554
7560
  }
7555
- var Id = "stacked", Ld = {
7561
+ var Ld = "stacked", Rd = {
7556
7562
  metric: {
7557
7563
  cols: 3,
7558
7564
  rows: 1
@@ -7578,17 +7584,17 @@ var Id = "stacked", Ld = {
7578
7584
  rows: 2
7579
7585
  }
7580
7586
  };
7581
- function Rd(e) {
7587
+ function zd(e) {
7582
7588
  return e.reduce((e, t) => Math.max(e, t.layout.y + t.layout.rows), 0);
7583
7589
  }
7584
- function zd(e, t, n) {
7590
+ function Bd(e, t, n) {
7585
7591
  let r = {
7586
7592
  id: t,
7587
7593
  title: "",
7588
7594
  layout: {
7589
7595
  x: 0,
7590
- y: Rd(n),
7591
- ...Ld[e]
7596
+ y: zd(n),
7597
+ ...Rd[e]
7592
7598
  }
7593
7599
  };
7594
7600
  switch (e) {
@@ -7637,7 +7643,7 @@ function zd(e, t, n) {
7637
7643
  measure: "COUNT",
7638
7644
  order: "DESC"
7639
7645
  }],
7640
- variant: Id
7646
+ variant: Ld
7641
7647
  };
7642
7648
  case "metric": return {
7643
7649
  ...r,
@@ -7658,7 +7664,7 @@ function zd(e, t, n) {
7658
7664
  };
7659
7665
  }
7660
7666
  }
7661
- function Bd(e) {
7667
+ function Vd(e) {
7662
7668
  return `New dashboard · ${e.toLocaleDateString(void 0, {
7663
7669
  month: "short",
7664
7670
  day: "numeric"
@@ -7667,10 +7673,10 @@ function Bd(e) {
7667
7673
  minute: "2-digit"
7668
7674
  })}`;
7669
7675
  }
7670
- function Vd(e = /* @__PURE__ */ new Date()) {
7676
+ function Hd(e = /* @__PURE__ */ new Date()) {
7671
7677
  return {
7672
- id: Pd(),
7673
- title: Bd(e),
7678
+ id: Fd(),
7679
+ title: Vd(e),
7674
7680
  widgets: [],
7675
7681
  filters: [],
7676
7682
  timeRange: {
@@ -7683,15 +7689,15 @@ function Vd(e = /* @__PURE__ */ new Date()) {
7683
7689
  }
7684
7690
  //#endregion
7685
7691
  //#region src/dashboards/editor/dashboard-json.ts
7686
- var Hd = new Set([
7692
+ var Ud = new Set([
7687
7693
  "cartesian",
7688
7694
  "doughnut",
7689
7695
  "bar",
7690
7696
  "breakdown",
7691
7697
  "metric",
7692
7698
  "metric-group"
7693
- ]), Ud = new Set(ci), Wd = new Set(Xu), Gd = 12;
7694
- function Kd(e) {
7699
+ ]), Wd = new Set(ci), Gd = new Set(Xu), Kd = 12;
7700
+ function qd(e) {
7695
7701
  let { title: t, description: n, filters: r, timeRange: i, widgets: a } = e;
7696
7702
  return JSON.stringify({
7697
7703
  title: t,
@@ -7701,7 +7707,7 @@ function Kd(e) {
7701
7707
  widgets: a
7702
7708
  }, null, 2);
7703
7709
  }
7704
- function qd(e) {
7710
+ function Jd(e) {
7705
7711
  let t;
7706
7712
  try {
7707
7713
  t = JSON.parse(e);
@@ -7719,7 +7725,7 @@ function qd(e) {
7719
7725
  i || r.push("\"title\" must be a non-empty string.");
7720
7726
  let a;
7721
7727
  n.description !== void 0 && (typeof n.description == "string" ? a = n.description : r.push("\"description\" must be a string."));
7722
- let o = Jd(n.timeRange, r), s = Yd(n.filters, "filters", r), c = Zd(n.widgets, r);
7728
+ let o = Yd(n.timeRange, r), s = Xd(n.filters, "filters", r), c = Qd(n.widgets, r);
7723
7729
  return r.length > 0 || !i || !o || !s || !c ? {
7724
7730
  ok: !1,
7725
7731
  errors: r
@@ -7734,15 +7740,15 @@ function qd(e) {
7734
7740
  }
7735
7741
  };
7736
7742
  }
7737
- function Jd(e, t) {
7743
+ function Yd(e, t) {
7738
7744
  if (typeof e != "object" || !e) {
7739
7745
  t.push("\"timeRange\" must be an object like { \"type\": \"relative\", \"period\": \"24h\" }.");
7740
7746
  return;
7741
7747
  }
7742
7748
  let n = e;
7743
7749
  if (n.type === "relative") {
7744
- if (typeof n.period != "string" || !Ud.has(n.period)) {
7745
- t.push(`"timeRange.period" must be one of: ${[...Ud].join(", ")}.`);
7750
+ if (typeof n.period != "string" || !Wd.has(n.period)) {
7751
+ t.push(`"timeRange.period" must be one of: ${[...Wd].join(", ")}.`);
7746
7752
  return;
7747
7753
  }
7748
7754
  return {
@@ -7763,7 +7769,7 @@ function Jd(e, t) {
7763
7769
  }
7764
7770
  t.push("\"timeRange.type\" must be \"relative\" or \"absolute\".");
7765
7771
  }
7766
- function Yd(e, t, n) {
7772
+ function Xd(e, t, n) {
7767
7773
  if (e === void 0) return [];
7768
7774
  if (!Array.isArray(e)) {
7769
7775
  n.push(`"${t}" must be an array.`);
@@ -7771,7 +7777,7 @@ function Yd(e, t, n) {
7771
7777
  }
7772
7778
  let r = n.length, i = [], a = /* @__PURE__ */ new Set();
7773
7779
  for (let [r, o] of e.entries()) {
7774
- let e = Xd(o, `${t}[${r}]`, n);
7780
+ let e = Zd(o, `${t}[${r}]`, n);
7775
7781
  if (e) {
7776
7782
  if (a.has(e.field)) {
7777
7783
  n.push(`${t}[${r}].field duplicates "${e.field}". One condition per field.`);
@@ -7782,7 +7788,7 @@ function Yd(e, t, n) {
7782
7788
  }
7783
7789
  return n.length === r ? i : void 0;
7784
7790
  }
7785
- function Xd(e, t, n) {
7791
+ function Zd(e, t, n) {
7786
7792
  if (typeof e != "object" || !e) {
7787
7793
  n.push(`${t} must be an object.`);
7788
7794
  return;
@@ -7792,8 +7798,8 @@ function Xd(e, t, n) {
7792
7798
  n.push(`${t}.field must be a non-empty string.`);
7793
7799
  return;
7794
7800
  }
7795
- if (typeof r.operator != "string" || !Wd.has(r.operator)) {
7796
- n.push(`${t}.operator must be one of: ${[...Wd].join(", ")}.`);
7801
+ if (typeof r.operator != "string" || !Gd.has(r.operator)) {
7802
+ n.push(`${t}.operator must be one of: ${[...Gd].join(", ")}.`);
7797
7803
  return;
7798
7804
  }
7799
7805
  if (!Array.isArray(r.value) || !r.value.every((e) => typeof e == "string")) {
@@ -7814,7 +7820,7 @@ function Xd(e, t, n) {
7814
7820
  ...Array.isArray(r.valueLabels) && r.valueLabels.every((e) => typeof e == "string") ? { valueLabels: r.valueLabels } : {}
7815
7821
  };
7816
7822
  }
7817
- function Zd(e, t) {
7823
+ function Qd(e, t) {
7818
7824
  if (e === void 0) return [];
7819
7825
  if (!Array.isArray(e)) {
7820
7826
  t.push("\"widgets\" must be an array.");
@@ -7828,23 +7834,23 @@ function Zd(e, t) {
7828
7834
  continue;
7829
7835
  }
7830
7836
  let o = a;
7831
- if (typeof o.type != "string" || !Hd.has(o.type)) {
7832
- t.push(`${e}.type must be one of: ${[...Hd].join(", ")}.`);
7837
+ if (typeof o.type != "string" || !Ud.has(o.type)) {
7838
+ t.push(`${e}.type must be one of: ${[...Ud].join(", ")}.`);
7833
7839
  continue;
7834
7840
  }
7835
7841
  if (typeof o.title != "string") {
7836
7842
  t.push(`${e}.title must be a string.`);
7837
7843
  continue;
7838
7844
  }
7839
- let s = Qd(o.layout, e, t);
7845
+ let s = $d(o.layout, e, t);
7840
7846
  if (!s) continue;
7841
- let c = typeof o.id == "string" && o.id.length > 0 ? o.id : Nd();
7847
+ let c = typeof o.id == "string" && o.id.length > 0 ? o.id : Pd();
7842
7848
  if (i.has(c)) {
7843
7849
  t.push(`${e}.id "${c}" is duplicated. Widget ids must be unique.`);
7844
7850
  continue;
7845
7851
  }
7846
7852
  i.add(c);
7847
- let l = o.filters === void 0 ? void 0 : Yd(o.filters, `${e}.filters`, t);
7853
+ let l = o.filters === void 0 ? void 0 : Xd(o.filters, `${e}.filters`, t);
7848
7854
  o.filters !== void 0 && !l || r.push({
7849
7855
  ...o,
7850
7856
  id: c,
@@ -7854,7 +7860,7 @@ function Zd(e, t) {
7854
7860
  }
7855
7861
  return t.length === n ? r : void 0;
7856
7862
  }
7857
- function Qd(e, t, n) {
7863
+ function $d(e, t, n) {
7858
7864
  if (typeof e != "object" || !e) {
7859
7865
  n.push(`${t}.layout must be an object with numeric x, y, cols, rows.`);
7860
7866
  return;
@@ -7864,8 +7870,8 @@ function Qd(e, t, n) {
7864
7870
  n.push(`${t}.layout needs integer x, y, cols, rows.`);
7865
7871
  return;
7866
7872
  }
7867
- if (r < 0 || r >= Gd || a < 1 || a > Gd || r + a > Gd || i < 0 || o < 1) {
7868
- n.push(`${t}.layout is out of bounds for the ${Gd}-column grid.`);
7873
+ if (r < 0 || r >= Kd || a < 1 || a > Kd || r + a > Kd || i < 0 || o < 1) {
7874
+ n.push(`${t}.layout is out of bounds for the ${Kd}-column grid.`);
7869
7875
  return;
7870
7876
  }
7871
7877
  return {
@@ -7877,9 +7883,9 @@ function Qd(e, t, n) {
7877
7883
  }
7878
7884
  //#endregion
7879
7885
  //#region src/dashboards/editor/DashboardJsonTab.tsx
7880
- var $d = "calc(100vh - 16rem)", ef = "min-h-[24rem]", tf = Le(() => import("@gravitee/graphene-core/code-editor").then((e) => ({ default: e.CodeEditor })));
7881
- function nf({ text: e, onTextChange: t, dirty: n, onApply: r }) {
7882
- let i = k(() => qd(e), [e]), a = async () => {
7886
+ var ef = "calc(100vh - 16rem)", tf = "min-h-[24rem]", nf = Le(() => import("@gravitee/graphene-core/code-editor").then((e) => ({ default: e.CodeEditor })));
7887
+ function rf({ text: e, onTextChange: t, dirty: n, onApply: r }) {
7888
+ let i = k(() => Jd(e), [e]), a = async () => {
7883
7889
  try {
7884
7890
  await navigator.clipboard.writeText(e), X.success("Dashboard JSON copied to clipboard");
7885
7891
  } catch {
@@ -7919,16 +7925,16 @@ function nf({ text: e, onTextChange: t, dirty: n, onApply: r }) {
7919
7925
  }) })]
7920
7926
  }),
7921
7927
  /* @__PURE__ */ N("div", {
7922
- className: ef,
7923
- style: { height: $d },
7924
- children: /* @__PURE__ */ N(af, {
7925
- fallback: /* @__PURE__ */ N(rf, {
7928
+ className: tf,
7929
+ style: { height: ef },
7930
+ children: /* @__PURE__ */ N(of, {
7931
+ fallback: /* @__PURE__ */ N(af, {
7926
7932
  text: e,
7927
7933
  onTextChange: t
7928
7934
  }),
7929
7935
  children: /* @__PURE__ */ N(Ne, {
7930
7936
  fallback: /* @__PURE__ */ N(G, { className: "size-full" }),
7931
- children: /* @__PURE__ */ N(tf, {
7937
+ children: /* @__PURE__ */ N(nf, {
7932
7938
  language: "json",
7933
7939
  height: "100%",
7934
7940
  value: e,
@@ -7940,7 +7946,7 @@ function nf({ text: e, onTextChange: t, dirty: n, onApply: r }) {
7940
7946
  ]
7941
7947
  });
7942
7948
  }
7943
- function rf({ text: e, onTextChange: t }) {
7949
+ function af({ text: e, onTextChange: t }) {
7944
7950
  return /* @__PURE__ */ P("div", {
7945
7951
  className: "flex h-full flex-col gap-2",
7946
7952
  children: [/* @__PURE__ */ P("p", {
@@ -7958,7 +7964,7 @@ function rf({ text: e, onTextChange: t }) {
7958
7964
  })]
7959
7965
  });
7960
7966
  }
7961
- var af = class extends je {
7967
+ var of = class extends je {
7962
7968
  state = { hasError: !1 };
7963
7969
  static getDerivedStateFromError() {
7964
7970
  return { hasError: !0 };
@@ -7972,7 +7978,7 @@ var af = class extends je {
7972
7978
  };
7973
7979
  //#endregion
7974
7980
  //#region src/dashboards/editor/EmptyDashboardState.tsx
7975
- function of({ onAddWidget: e }) {
7981
+ function sf({ onAddWidget: e }) {
7976
7982
  return /* @__PURE__ */ N("button", {
7977
7983
  type: "button",
7978
7984
  onClick: e,
@@ -7993,7 +7999,7 @@ function of({ onAddWidget: e }) {
7993
7999
  }
7994
8000
  //#endregion
7995
8001
  //#region src/dashboards/editor/InlineEditableText.tsx
7996
- function sf({ value: e, onChange: t, placeholder: n, ariaLabel: r, textClassName: i, inputClassName: a }) {
8002
+ function cf({ value: e, onChange: t, placeholder: n, ariaLabel: r, textClassName: i, inputClassName: a }) {
7997
8003
  let [o, s] = j(!1), [c, l] = j(e), u = A(null);
7998
8004
  O(() => {
7999
8005
  o && (u.current?.focus(), u.current?.select());
@@ -8029,7 +8035,7 @@ function sf({ value: e, onChange: t, placeholder: n, ariaLabel: r, textClassName
8029
8035
  }
8030
8036
  //#endregion
8031
8037
  //#region src/dashboards/editor/CartesianDisplayFields.tsx
8032
- function cf({ widget: e, onChange: t }) {
8038
+ function lf({ widget: e, onChange: t }) {
8033
8039
  let n = Be(), r = e.showTotal ?? !1, i = e.series.length < 2 && !e.series[0]?.by?.length;
8034
8040
  return /* @__PURE__ */ P(M, { children: [
8035
8041
  /* @__PURE__ */ N(Mt, { children: "Adds a total row to the tooltip, summing every series at the hovered point. Useful when the series are parts of one whole." }),
@@ -8067,7 +8073,7 @@ function cf({ widget: e, onChange: t }) {
8067
8073
  }
8068
8074
  //#endregion
8069
8075
  //#region src/dashboards/editor/LabelledRow.tsx
8070
- function lf({ cols: e, labels: t, className: n, children: r }) {
8076
+ function uf({ cols: e, labels: t, className: n, children: r }) {
8071
8077
  return /* @__PURE__ */ P("div", {
8072
8078
  className: n,
8073
8079
  children: [/* @__PURE__ */ N("div", {
@@ -8081,14 +8087,14 @@ function lf({ cols: e, labels: t, className: n, children: r }) {
8081
8087
  }
8082
8088
  //#endregion
8083
8089
  //#region src/dashboards/editor/facet-display-cols.ts
8084
- var uf = "grid grid-cols-2";
8090
+ var df = "grid grid-cols-2";
8085
8091
  //#endregion
8086
8092
  //#region src/dashboards/editor/DoughnutCentreFields.tsx
8087
- function df(e) {
8093
+ function ff(e) {
8088
8094
  return e.centerValue === void 0 ? e.centerTotal ? "total" : "none" : "custom";
8089
8095
  }
8090
- function ff({ widget: e, onChange: t }) {
8091
- let n = df(e), r = (n) => {
8096
+ function pf({ widget: e, onChange: t }) {
8097
+ let n = ff(e), r = (n) => {
8092
8098
  if (n === "none") {
8093
8099
  t({
8094
8100
  ...e,
@@ -8111,8 +8117,8 @@ function ff({ widget: e, onChange: t }) {
8111
8117
  centerValue: e.centerValue ?? ""
8112
8118
  });
8113
8119
  };
8114
- return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P(lf, {
8115
- cols: uf,
8120
+ return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P(uf, {
8121
+ cols: df,
8116
8122
  labels: ["Centre", "Custom value"],
8117
8123
  children: [/* @__PURE__ */ P(B, {
8118
8124
  value: n,
@@ -8145,8 +8151,8 @@ function ff({ widget: e, onChange: t }) {
8145
8151
  centerValue: n.target.value
8146
8152
  })
8147
8153
  })]
8148
- }), /* @__PURE__ */ N(lf, {
8149
- cols: uf,
8154
+ }), /* @__PURE__ */ N(uf, {
8155
+ cols: df,
8150
8156
  labels: ["Caption"],
8151
8157
  children: /* @__PURE__ */ N(z, {
8152
8158
  "aria-label": "Centre caption",
@@ -8162,7 +8168,7 @@ function ff({ widget: e, onChange: t }) {
8162
8168
  }
8163
8169
  //#endregion
8164
8170
  //#region src/dashboards/editor/SentimentSelect.tsx
8165
- var pf = [
8171
+ var mf = [
8166
8172
  {
8167
8173
  value: "neutral",
8168
8174
  label: "Neutral"
@@ -8175,10 +8181,10 @@ var pf = [
8175
8181
  value: "lower-is-better",
8176
8182
  label: "Lower is better"
8177
8183
  }
8178
- ], mf = "higher-is-better";
8179
- function hf({ value: e, onChange: t, id: n, disabled: r }) {
8184
+ ], hf = "higher-is-better";
8185
+ function gf({ value: e, onChange: t, id: n, disabled: r }) {
8180
8186
  return /* @__PURE__ */ P(B, {
8181
- value: e ?? mf,
8187
+ value: e ?? hf,
8182
8188
  onValueChange: (e) => e && t(e),
8183
8189
  disabled: r,
8184
8190
  children: [/* @__PURE__ */ N(U, {
@@ -8186,7 +8192,7 @@ function hf({ value: e, onChange: t, id: n, disabled: r }) {
8186
8192
  className: "w-full",
8187
8193
  "aria-label": "Trend sentiment",
8188
8194
  children: /* @__PURE__ */ N(W, {})
8189
- }), /* @__PURE__ */ N(V, { children: pf.map((e) => /* @__PURE__ */ N(H, {
8195
+ }), /* @__PURE__ */ N(V, { children: mf.map((e) => /* @__PURE__ */ N(H, {
8190
8196
  value: e.value,
8191
8197
  children: e.label
8192
8198
  }, e.value)) })]
@@ -8194,9 +8200,9 @@ function hf({ value: e, onChange: t, id: n, disabled: r }) {
8194
8200
  }
8195
8201
  //#endregion
8196
8202
  //#region src/dashboards/editor/FacetDisplayFields.tsx
8197
- function gf({ widget: e, onChange: t }) {
8198
- if (e.type === "bar") return /* @__PURE__ */ P(lf, {
8199
- cols: uf,
8203
+ function _f({ widget: e, onChange: t }) {
8204
+ if (e.type === "bar") return /* @__PURE__ */ P(uf, {
8205
+ cols: df,
8200
8206
  labels: ["Orientation", "Value label"],
8201
8207
  children: [/* @__PURE__ */ P(B, {
8202
8208
  value: e.barLayout ?? "vertical",
@@ -8225,14 +8231,14 @@ function gf({ widget: e, onChange: t }) {
8225
8231
  })
8226
8232
  })]
8227
8233
  });
8228
- if (e.type === "doughnut") return /* @__PURE__ */ N(ff, {
8234
+ if (e.type === "doughnut") return /* @__PURE__ */ N(pf, {
8229
8235
  widget: e,
8230
8236
  onChange: t
8231
8237
  });
8232
8238
  let n = e.showTrend ?? !1, r = e.variant === "stacked";
8233
8239
  return /* @__PURE__ */ P(M, { children: [
8234
- /* @__PURE__ */ P(lf, {
8235
- cols: uf,
8240
+ /* @__PURE__ */ P(uf, {
8241
+ cols: df,
8236
8242
  labels: ["Representation", "Row order"],
8237
8243
  children: [/* @__PURE__ */ P(B, {
8238
8244
  value: e.variant ?? "list",
@@ -8320,7 +8326,7 @@ function gf({ widget: e, onChange: t }) {
8320
8326
  })
8321
8327
  ]
8322
8328
  }),
8323
- !r && /* @__PURE__ */ P(lf, {
8329
+ !r && /* @__PURE__ */ P(uf, {
8324
8330
  cols: "grid grid-cols-2",
8325
8331
  labels: n ? ["Collapse after", "Trend sentiment"] : ["Collapse after"],
8326
8332
  children: [/* @__PURE__ */ N(z, {
@@ -8337,7 +8343,7 @@ function gf({ widget: e, onChange: t }) {
8337
8343
  maxItems: Number.isNaN(r) ? void 0 : Math.max(1, Math.min(i, r))
8338
8344
  });
8339
8345
  }
8340
- }), n && /* @__PURE__ */ N(hf, {
8346
+ }), n && /* @__PURE__ */ N(gf, {
8341
8347
  value: e.trendSentiment,
8342
8348
  onChange: (n) => t({
8343
8349
  ...e,
@@ -8349,13 +8355,13 @@ function gf({ widget: e, onChange: t }) {
8349
8355
  }
8350
8356
  //#endregion
8351
8357
  //#region src/dashboards/editor/DimensionSelect.tsx
8352
- var _f = "__none__";
8353
- function vf({ value: e, onChange: t, id: n, allowNone: r = !1, disabled: i, ariaLabel: a = "Dimension" }) {
8358
+ var vf = "__none__";
8359
+ function yf({ value: e, onChange: t, id: n, allowNone: r = !1, disabled: i, ariaLabel: a = "Dimension" }) {
8354
8360
  let o = e !== void 0 && Go(e) !== void 0;
8355
8361
  return /* @__PURE__ */ P(B, {
8356
- value: e ?? (r ? _f : void 0),
8362
+ value: e ?? (r ? vf : void 0),
8357
8363
  onValueChange: (e) => {
8358
- e && t(e === _f ? void 0 : e);
8364
+ e && t(e === vf ? void 0 : e);
8359
8365
  },
8360
8366
  disabled: i,
8361
8367
  children: [/* @__PURE__ */ N(U, {
@@ -8366,7 +8372,7 @@ function vf({ value: e, onChange: t, id: n, allowNone: r = !1, disabled: i, aria
8366
8372
  children: /* @__PURE__ */ N(W, { placeholder: "Select a dimension" })
8367
8373
  }), /* @__PURE__ */ P(V, { children: [
8368
8374
  r && /* @__PURE__ */ N(H, {
8369
- value: _f,
8375
+ value: vf,
8370
8376
  children: "None"
8371
8377
  }),
8372
8378
  Vo.map((e) => /* @__PURE__ */ N(H, {
@@ -8392,11 +8398,11 @@ function vf({ value: e, onChange: t, id: n, allowNone: r = !1, disabled: i, aria
8392
8398
  }
8393
8399
  //#endregion
8394
8400
  //#region src/dashboards/editor/MeasureSelect.tsx
8395
- function yf(e, t, n) {
8401
+ function bf(e, t, n) {
8396
8402
  if (t) return `${e[0]} is the only measure available for this metric`;
8397
8403
  if (!n) return "This measure is not among the ones the metric is known to support";
8398
8404
  }
8399
- function bf({ value: e, onChange: t, id: n, metric: r }) {
8405
+ function xf({ value: e, onChange: t, id: n, metric: r }) {
8400
8406
  let i = (r === void 0 ? void 0 : qo(r)) ?? Ro, a = e === void 0 || i.includes(e), o = a || e === void 0 ? i : [...i, e], s = o.length === 1;
8401
8407
  return /* @__PURE__ */ P(B, {
8402
8408
  value: e ?? (s ? o[0] : void 0),
@@ -8406,7 +8412,7 @@ function bf({ value: e, onChange: t, id: n, metric: r }) {
8406
8412
  id: n,
8407
8413
  className: "w-full",
8408
8414
  "aria-label": "Measure",
8409
- title: yf(o, s, a),
8415
+ title: bf(o, s, a),
8410
8416
  children: /* @__PURE__ */ N(W, { placeholder: "Measure" })
8411
8417
  }), /* @__PURE__ */ N(V, { children: o.map((e) => /* @__PURE__ */ N(H, {
8412
8418
  value: e,
@@ -8416,7 +8422,7 @@ function bf({ value: e, onChange: t, id: n, metric: r }) {
8416
8422
  }
8417
8423
  //#endregion
8418
8424
  //#region src/dashboards/editor/MetricSelect.tsx
8419
- function xf({ value: e, onChange: t, id: n }) {
8425
+ function Sf({ value: e, onChange: t, id: n }) {
8420
8426
  let r = Wo(e) !== void 0;
8421
8427
  return /* @__PURE__ */ P(B, {
8422
8428
  value: e,
@@ -8448,8 +8454,8 @@ function xf({ value: e, onChange: t, id: n }) {
8448
8454
  }
8449
8455
  //#endregion
8450
8456
  //#region src/dashboards/editor/FacetQueryFields.tsx
8451
- var Sf = "grid grid-cols-[minmax(0,1.7fr)_minmax(0,0.9fr)_minmax(0,1.2fr)_minmax(0,0.8fr)_minmax(0,1.1fr)]", Cf = "grid grid-cols-[minmax(0,0.35fr)_minmax(0,1.4fr)_minmax(0,1.1fr)]", wf = "COUNT";
8452
- function Tf({ widget: e, onChange: t }) {
8457
+ var Cf = "grid grid-cols-[minmax(0,1.7fr)_minmax(0,0.9fr)_minmax(0,1.2fr)_minmax(0,0.8fr)_minmax(0,1.1fr)]", wf = "grid grid-cols-[minmax(0,0.35fr)_minmax(0,1.4fr)_minmax(0,1.1fr)]", Tf = "COUNT";
8458
+ function Ef({ widget: e, onChange: t }) {
8453
8459
  let n = (n) => {
8454
8460
  let r = Jo(n, e.measure), i = e.sorts && r !== void 0 ? e.sorts.map((e) => ({
8455
8461
  ...e,
@@ -8472,7 +8478,7 @@ function Tf({ widget: e, onChange: t }) {
8472
8478
  sorts: r
8473
8479
  });
8474
8480
  }, i = e.sorts?.[0]?.order ?? "DESC", a = (n) => {
8475
- let r = e.measure ?? wf;
8481
+ let r = e.measure ?? Tf;
8476
8482
  t({
8477
8483
  ...e,
8478
8484
  sorts: [{
@@ -8481,8 +8487,8 @@ function Tf({ widget: e, onChange: t }) {
8481
8487
  }]
8482
8488
  });
8483
8489
  };
8484
- return /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ P(lf, {
8485
- cols: Sf,
8490
+ return /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ P(uf, {
8491
+ cols: Cf,
8486
8492
  labels: [
8487
8493
  "Metric",
8488
8494
  "Measure",
@@ -8491,16 +8497,16 @@ function Tf({ widget: e, onChange: t }) {
8491
8497
  "Keep"
8492
8498
  ],
8493
8499
  children: [
8494
- /* @__PURE__ */ N(xf, {
8500
+ /* @__PURE__ */ N(Sf, {
8495
8501
  value: e.metric ?? "HTTP_REQUESTS",
8496
8502
  onChange: n
8497
8503
  }),
8498
- /* @__PURE__ */ N(bf, {
8504
+ /* @__PURE__ */ N(xf, {
8499
8505
  value: e.measure,
8500
8506
  metric: e.metric ?? "HTTP_REQUESTS",
8501
8507
  onChange: r
8502
8508
  }),
8503
- /* @__PURE__ */ N(vf, {
8509
+ /* @__PURE__ */ N(yf, {
8504
8510
  ariaLabel: "Group by",
8505
8511
  value: e.by[0],
8506
8512
  onChange: (n) => n && t({
@@ -8540,16 +8546,16 @@ function Tf({ widget: e, onChange: t }) {
8540
8546
  })] })]
8541
8547
  })
8542
8548
  ]
8543
- }), e.type === "breakdown" && /* @__PURE__ */ N(Ef, {
8549
+ }), e.type === "breakdown" && /* @__PURE__ */ N(Df, {
8544
8550
  widget: e,
8545
8551
  onChange: t
8546
8552
  })] });
8547
8553
  }
8548
- function Ef({ widget: e, onChange: t }) {
8554
+ function Df({ widget: e, onChange: t }) {
8549
8555
  let n = e.showTooltip ?? !0;
8550
- return /* @__PURE__ */ P(lf, {
8556
+ return /* @__PURE__ */ P(uf, {
8551
8557
  className: "mt-2",
8552
- cols: Cf,
8558
+ cols: wf,
8553
8559
  labels: [
8554
8560
  "On hover",
8555
8561
  "Break down by",
@@ -8564,7 +8570,7 @@ function Ef({ widget: e, onChange: t }) {
8564
8570
  showTooltip: n
8565
8571
  })
8566
8572
  }),
8567
- /* @__PURE__ */ N(vf, {
8573
+ /* @__PURE__ */ N(yf, {
8568
8574
  allowNone: !0,
8569
8575
  ariaLabel: "Hover breakdown dimension",
8570
8576
  disabled: !n,
@@ -8598,8 +8604,8 @@ function Ef({ widget: e, onChange: t }) {
8598
8604
  }
8599
8605
  //#endregion
8600
8606
  //#region src/dashboards/editor/MetricGroupItemsEditor.tsx
8601
- var Df = "grid-cols-[minmax(0,1.5fr)_minmax(0,0.8fr)_minmax(0,1.1fr)_minmax(0,1.1fr)_minmax(0,0.45fr)_minmax(0,1.1fr)_2rem]";
8602
- function Of({ items: e, onChange: t }) {
8607
+ var Of = "grid-cols-[minmax(0,1.5fr)_minmax(0,0.8fr)_minmax(0,1.1fr)_minmax(0,1.1fr)_minmax(0,0.45fr)_minmax(0,1.1fr)_2rem]";
8608
+ function kf({ items: e, onChange: t }) {
8603
8609
  let n = (n, r) => {
8604
8610
  t(e.map((e, t) => t === n ? {
8605
8611
  ...e,
@@ -8625,7 +8631,7 @@ function Of({ items: e, onChange: t }) {
8625
8631
  className: "flex flex-col gap-1.5",
8626
8632
  children: [
8627
8633
  /* @__PURE__ */ P("div", {
8628
- className: `grid ${Df} gap-1.5 text-xs font-medium text-muted-foreground`,
8634
+ className: `grid ${Of} gap-1.5 text-xs font-medium text-muted-foreground`,
8629
8635
  children: [
8630
8636
  /* @__PURE__ */ N("span", { children: "Metric" }),
8631
8637
  /* @__PURE__ */ N("span", { children: "Measure" }),
@@ -8639,13 +8645,13 @@ function Of({ items: e, onChange: t }) {
8639
8645
  e.map((t, i) => {
8640
8646
  let o = t.showTrend ?? !0;
8641
8647
  return /* @__PURE__ */ P("div", {
8642
- className: `grid ${Df} items-center gap-1.5`,
8648
+ className: `grid ${Of} items-center gap-1.5`,
8643
8649
  children: [
8644
- /* @__PURE__ */ N(xf, {
8650
+ /* @__PURE__ */ N(Sf, {
8645
8651
  value: t.metric,
8646
8652
  onChange: (e) => r(i, e)
8647
8653
  }),
8648
- /* @__PURE__ */ N(bf, {
8654
+ /* @__PURE__ */ N(xf, {
8649
8655
  value: t.measure,
8650
8656
  metric: t.metric,
8651
8657
  onChange: (e) => n(i, { measure: e })
@@ -8667,7 +8673,7 @@ function Of({ items: e, onChange: t }) {
8667
8673
  checked: o,
8668
8674
  onCheckedChange: (e) => n(i, { showTrend: e })
8669
8675
  }),
8670
- /* @__PURE__ */ N(hf, {
8676
+ /* @__PURE__ */ N(gf, {
8671
8677
  value: t.sentiment,
8672
8678
  disabled: !o,
8673
8679
  onChange: (e) => n(i, { sentiment: e })
@@ -8698,11 +8704,11 @@ function Of({ items: e, onChange: t }) {
8698
8704
  }
8699
8705
  //#endregion
8700
8706
  //#region src/dashboards/editor/MetricQueryFields.tsx
8701
- var kf = "grid grid-cols-[minmax(0,1.6fr)_minmax(0,0.9fr)_minmax(0,1.3fr)_minmax(0,0.5fr)_minmax(0,0.6fr)_minmax(0,1.2fr)]";
8702
- function Af({ widget: e, onChange: t }) {
8707
+ var Af = "grid grid-cols-[minmax(0,1.6fr)_minmax(0,0.9fr)_minmax(0,1.3fr)_minmax(0,0.5fr)_minmax(0,0.6fr)_minmax(0,1.2fr)]";
8708
+ function jf({ widget: e, onChange: t }) {
8703
8709
  let n = e.showTrend ?? !1;
8704
- return /* @__PURE__ */ N(R, { children: /* @__PURE__ */ P(lf, {
8705
- cols: kf,
8710
+ return /* @__PURE__ */ N(R, { children: /* @__PURE__ */ P(uf, {
8711
+ cols: Af,
8706
8712
  labels: [
8707
8713
  "Metric",
8708
8714
  "Measure",
@@ -8712,7 +8718,7 @@ function Af({ widget: e, onChange: t }) {
8712
8718
  "Sentiment"
8713
8719
  ],
8714
8720
  children: [
8715
- /* @__PURE__ */ N(xf, {
8721
+ /* @__PURE__ */ N(Sf, {
8716
8722
  value: e.metric,
8717
8723
  onChange: (n) => t({
8718
8724
  ...e,
@@ -8720,7 +8726,7 @@ function Af({ widget: e, onChange: t }) {
8720
8726
  measure: Jo(n, e.measure)
8721
8727
  })
8722
8728
  }),
8723
- /* @__PURE__ */ N(bf, {
8729
+ /* @__PURE__ */ N(xf, {
8724
8730
  value: e.measure,
8725
8731
  metric: e.metric,
8726
8732
  onChange: (n) => t({
@@ -8753,7 +8759,7 @@ function Af({ widget: e, onChange: t }) {
8753
8759
  showSparkline: n
8754
8760
  })
8755
8761
  }),
8756
- /* @__PURE__ */ N(hf, {
8762
+ /* @__PURE__ */ N(gf, {
8757
8763
  value: e.sentiment,
8758
8764
  disabled: !n,
8759
8765
  onChange: (n) => t({
@@ -8766,7 +8772,7 @@ function Af({ widget: e, onChange: t }) {
8766
8772
  }
8767
8773
  //#endregion
8768
8774
  //#region src/dashboards/editor/SeriesListEditor.tsx
8769
- var jf = "stack", Mf = [
8775
+ var Mf = "stack", Nf = [
8770
8776
  {
8771
8777
  value: "line",
8772
8778
  label: "Line"
@@ -8779,9 +8785,9 @@ var jf = "stack", Mf = [
8779
8785
  value: "bar",
8780
8786
  label: "Bars"
8781
8787
  }
8782
- ], Nf = "grid grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)_minmax(0,1.2fr)_minmax(0,0.9fr)_minmax(0,1.1fr)_2rem]", Pf = "grid grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)_minmax(0,1.2fr)_minmax(0,0.9fr)_minmax(0,1.1fr)_minmax(0,0.8fr)_2rem]";
8783
- function Ff({ series: e, onChange: t }) {
8784
- let n = e.length > 1, r = n ? Pf : Nf, i = (n, r) => {
8788
+ ], Pf = "grid grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)_minmax(0,1.2fr)_minmax(0,0.9fr)_minmax(0,1.1fr)_2rem]", Ff = "grid grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)_minmax(0,1.2fr)_minmax(0,0.9fr)_minmax(0,1.1fr)_minmax(0,0.8fr)_2rem]";
8789
+ function If({ series: e, onChange: t }) {
8790
+ let n = e.length > 1, r = n ? Ff : Pf, i = (n, r) => {
8785
8791
  t(e.map((e, t) => t === n ? {
8786
8792
  ...e,
8787
8793
  ...r
@@ -8796,7 +8802,7 @@ function Ff({ series: e, onChange: t }) {
8796
8802
  }, o = (e, t) => {
8797
8803
  i(e, { axisId: t === "right" ? "right" : void 0 });
8798
8804
  }, s = (e, t) => {
8799
- i(e, { stackId: t ? jf : void 0 });
8805
+ i(e, { stackId: t ? Mf : void 0 });
8800
8806
  }, c = (e, t) => {
8801
8807
  i(e, {
8802
8808
  representation: t,
@@ -8834,16 +8840,16 @@ function Ff({ series: e, onChange: t }) {
8834
8840
  e.map((t, l) => /* @__PURE__ */ P("div", {
8835
8841
  className: `${r} items-center gap-1.5`,
8836
8842
  children: [
8837
- /* @__PURE__ */ N(xf, {
8843
+ /* @__PURE__ */ N(Sf, {
8838
8844
  value: t.metric,
8839
8845
  onChange: (e) => a(l, e)
8840
8846
  }),
8841
- /* @__PURE__ */ N(bf, {
8847
+ /* @__PURE__ */ N(xf, {
8842
8848
  value: t.measure,
8843
8849
  metric: t.metric,
8844
8850
  onChange: (e) => i(l, { measure: e })
8845
8851
  }),
8846
- /* @__PURE__ */ N(vf, {
8852
+ /* @__PURE__ */ N(yf, {
8847
8853
  allowNone: !0,
8848
8854
  value: t.by?.[0],
8849
8855
  onChange: (e) => i(l, { by: e ? [e] : void 0 })
@@ -8855,7 +8861,7 @@ function Ff({ series: e, onChange: t }) {
8855
8861
  className: "w-full",
8856
8862
  "aria-label": "Representation",
8857
8863
  children: /* @__PURE__ */ N(W, {})
8858
- }), /* @__PURE__ */ N(V, { children: Mf.map((e) => /* @__PURE__ */ N(H, {
8864
+ }), /* @__PURE__ */ N(V, { children: Nf.map((e) => /* @__PURE__ */ N(H, {
8859
8865
  value: e.value,
8860
8866
  children: e.label
8861
8867
  }, e.value)) })]
@@ -8917,12 +8923,12 @@ function Ff({ series: e, onChange: t }) {
8917
8923
  }
8918
8924
  //#endregion
8919
8925
  //#region src/dashboards/editor/VisualizationTypePicker.tsx
8920
- var If = [
8926
+ var Lf = [
8921
8927
  {
8922
8928
  type: "cartesian",
8923
8929
  label: "Timeseries",
8924
8930
  description: "Lines, bars or areas over time",
8925
- icon: re
8931
+ icon: T
8926
8932
  },
8927
8933
  {
8928
8934
  type: "bar",
@@ -8955,7 +8961,7 @@ var If = [
8955
8961
  icon: _e
8956
8962
  }
8957
8963
  ];
8958
- function Lf({ value: e, onChange: t }) {
8964
+ function Rf({ value: e, onChange: t }) {
8959
8965
  return /* @__PURE__ */ N(nn, {
8960
8966
  type: "single",
8961
8967
  value: e,
@@ -8963,7 +8969,7 @@ function Lf({ value: e, onChange: t }) {
8963
8969
  variant: "outline",
8964
8970
  "aria-label": "Visualization type",
8965
8971
  className: "grid grid-cols-3 gap-2 sm:grid-cols-6",
8966
- children: If.map((e) => {
8972
+ children: Lf.map((e) => {
8967
8973
  let t = e.icon;
8968
8974
  return /* @__PURE__ */ P(rn, {
8969
8975
  value: e.type,
@@ -8979,12 +8985,12 @@ function Lf({ value: e, onChange: t }) {
8979
8985
  }
8980
8986
  //#endregion
8981
8987
  //#region src/dashboards/editor/convert-widget-type.ts
8982
- var Rf = "HTTP_REQUESTS", zf = "COUNT", Bf = "API";
8983
- function Vf(e) {
8988
+ var zf = "HTTP_REQUESTS", Bf = "COUNT", Vf = "API";
8989
+ function Hf(e) {
8984
8990
  if (Xn(e)) {
8985
8991
  let t = e.series[0];
8986
8992
  return {
8987
- metric: t?.metric ?? Rf,
8993
+ metric: t?.metric ?? zf,
8988
8994
  measure: t?.measure,
8989
8995
  by: t?.by?.[0]
8990
8996
  };
@@ -8997,20 +9003,20 @@ function Vf(e) {
8997
9003
  if (e.type === "metric-group") {
8998
9004
  let t = e.items[0];
8999
9005
  return {
9000
- metric: t?.metric ?? Rf,
9006
+ metric: t?.metric ?? zf,
9001
9007
  measure: t?.measure,
9002
9008
  by: void 0
9003
9009
  };
9004
9010
  }
9005
9011
  return {
9006
- metric: e.metric ?? Rf,
9012
+ metric: e.metric ?? zf,
9007
9013
  measure: e.measure,
9008
9014
  by: e.by[0]
9009
9015
  };
9010
9016
  }
9011
- function Hf(e, t) {
9017
+ function Uf(e, t) {
9012
9018
  if (e.type === t) return e;
9013
- let { metric: n, measure: r, by: i } = Vf(e), a = {
9019
+ let { metric: n, measure: r, by: i } = Hf(e), a = {
9014
9020
  id: e.id,
9015
9021
  title: e.title,
9016
9022
  ...e.description !== void 0 && { description: e.description },
@@ -9023,7 +9029,7 @@ function Hf(e, t) {
9023
9029
  type: t,
9024
9030
  series: [{
9025
9031
  metric: n,
9026
- measure: r ?? zf,
9032
+ measure: r ?? Bf,
9027
9033
  representation: "line",
9028
9034
  ...i !== void 0 && { by: [i] },
9029
9035
  ...Wo(n)?.unit !== void 0 && { unit: Wo(n)?.unit }
@@ -9032,45 +9038,45 @@ function Hf(e, t) {
9032
9038
  case "bar": return {
9033
9039
  ...a,
9034
9040
  type: t,
9035
- by: [i ?? Bf],
9041
+ by: [i ?? Vf],
9036
9042
  metric: n,
9037
- measure: r ?? zf,
9043
+ measure: r ?? Bf,
9038
9044
  limit: 5,
9039
9045
  sorts: [{
9040
- measure: r ?? zf,
9046
+ measure: r ?? Bf,
9041
9047
  order: "DESC"
9042
9048
  }]
9043
9049
  };
9044
9050
  case "doughnut": return {
9045
9051
  ...a,
9046
9052
  type: t,
9047
- by: [i ?? Bf],
9053
+ by: [i ?? Vf],
9048
9054
  metric: n,
9049
- measure: r ?? zf,
9055
+ measure: r ?? Bf,
9050
9056
  limit: 5,
9051
9057
  sorts: [{
9052
- measure: r ?? zf,
9058
+ measure: r ?? Bf,
9053
9059
  order: "DESC"
9054
9060
  }]
9055
9061
  };
9056
9062
  case "breakdown": return {
9057
9063
  ...a,
9058
9064
  type: t,
9059
- by: [i ?? Bf],
9065
+ by: [i ?? Vf],
9060
9066
  metric: n,
9061
- measure: r ?? zf,
9067
+ measure: r ?? Bf,
9062
9068
  limit: 5,
9063
9069
  sorts: [{
9064
- measure: r ?? zf,
9070
+ measure: r ?? Bf,
9065
9071
  order: "DESC"
9066
9072
  }],
9067
- variant: Id
9073
+ variant: Ld
9068
9074
  };
9069
9075
  case "metric": return {
9070
9076
  ...a,
9071
9077
  type: t,
9072
9078
  metric: n,
9073
- measure: r ?? zf,
9079
+ measure: r ?? Bf,
9074
9080
  showTrend: !0,
9075
9081
  sentiment: "neutral"
9076
9082
  };
@@ -9079,7 +9085,7 @@ function Hf(e, t) {
9079
9085
  type: t,
9080
9086
  items: [{
9081
9087
  metric: n,
9082
- measure: r ?? zf,
9088
+ measure: r ?? Bf,
9083
9089
  sentiment: "neutral"
9084
9090
  }]
9085
9091
  };
@@ -9087,7 +9093,7 @@ function Hf(e, t) {
9087
9093
  }
9088
9094
  //#endregion
9089
9095
  //#region src/dashboards/editor/widget-auto-scope.ts
9090
- function Uf(e) {
9096
+ function Wf(e) {
9091
9097
  switch (e.type) {
9092
9098
  case "cartesian": return {
9093
9099
  metrics: e.series.map((e) => e.metric),
@@ -9107,13 +9113,13 @@ function Uf(e) {
9107
9113
  };
9108
9114
  }
9109
9115
  }
9110
- function Wf(e, t) {
9111
- let n = Uf(e), r = Uf(t);
9116
+ function Gf(e, t) {
9117
+ let n = Wf(e), r = Wf(t);
9112
9118
  return n.metrics.join() === r.metrics.join() && n.dimensions.join() === r.dimensions.join();
9113
9119
  }
9114
- function Gf(e, t) {
9115
- if (Wf(e, t)) return t;
9116
- let n = Qo(t.filters, Uf(t));
9120
+ function Kf(e, t) {
9121
+ if (Gf(e, t)) return t;
9122
+ let n = Qo(t.filters, Wf(t));
9117
9123
  return n === t.filters ? t : {
9118
9124
  ...t,
9119
9125
  ...n === void 0 ? {} : { filters: n }
@@ -9121,14 +9127,14 @@ function Gf(e, t) {
9121
9127
  }
9122
9128
  //#endregion
9123
9129
  //#region src/dashboards/editor/WidgetConfigForm.tsx
9124
- var Kf = "flex flex-col gap-5 pt-4";
9125
- function qf(e) {
9130
+ var qf = "flex flex-col gap-5 pt-4";
9131
+ function Jf(e) {
9126
9132
  return e !== "metric-group" && e !== "metric";
9127
9133
  }
9128
- function Jf({ widget: e, onChange: t }) {
9129
- let [n, r] = j("data"), i = qf(e.type), a = e.filters?.length ?? 0;
9134
+ function Yf({ widget: e, onChange: t }) {
9135
+ let [n, r] = j("data"), i = Jf(e.type), a = e.filters?.length ?? 0;
9130
9136
  n === "display" && !i && r("data");
9131
- let o = (n) => t(Gf(e, n)), s = (t) => o(Hf(e, t)), c = (n) => {
9137
+ let o = (n) => t(Kf(e, n)), s = (t) => o(Uf(e, t)), c = (n) => {
9132
9138
  t({
9133
9139
  ...e,
9134
9140
  ...n.length > 0 ? { filters: n } : { filters: void 0 }
@@ -9136,7 +9142,7 @@ function Jf({ widget: e, onChange: t }) {
9136
9142
  };
9137
9143
  return /* @__PURE__ */ P("div", {
9138
9144
  className: "flex flex-col gap-5",
9139
- children: [/* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Visualization" }), /* @__PURE__ */ N(Lf, {
9145
+ children: [/* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Visualization" }), /* @__PURE__ */ N(Rf, {
9140
9146
  value: e.type,
9141
9147
  onChange: s
9142
9148
  })] }), /* @__PURE__ */ P(Zt, {
@@ -9166,23 +9172,23 @@ function Jf({ widget: e, onChange: t }) {
9166
9172
  }),
9167
9173
  /* @__PURE__ */ N(Qt, {
9168
9174
  value: "data",
9169
- className: Kf,
9170
- children: /* @__PURE__ */ N(Yf, {
9175
+ className: qf,
9176
+ children: /* @__PURE__ */ N(Xf, {
9171
9177
  widget: e,
9172
9178
  onChange: o
9173
9179
  })
9174
9180
  }),
9175
9181
  i && /* @__PURE__ */ N(Qt, {
9176
9182
  value: "display",
9177
- className: Kf,
9178
- children: /* @__PURE__ */ N(Xf, {
9183
+ className: qf,
9184
+ children: /* @__PURE__ */ N(Zf, {
9179
9185
  widget: e,
9180
9186
  onChange: o
9181
9187
  })
9182
9188
  }),
9183
9189
  /* @__PURE__ */ N(Qt, {
9184
9190
  value: "filters",
9185
- className: Kf,
9191
+ className: qf,
9186
9192
  children: /* @__PURE__ */ P(R, { children: [
9187
9193
  /* @__PURE__ */ N(Ft, { children: "Widget filters" }),
9188
9194
  /* @__PURE__ */ N(Mt, { children: "Applied only to this widget, on top of the dashboard filters." }),
@@ -9197,41 +9203,41 @@ function Jf({ widget: e, onChange: t }) {
9197
9203
  })]
9198
9204
  });
9199
9205
  }
9200
- function Yf({ widget: e, onChange: t }) {
9206
+ function Xf({ widget: e, onChange: t }) {
9201
9207
  switch (e.type) {
9202
- case "cartesian": return /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Series" }), /* @__PURE__ */ N(Ff, {
9208
+ case "cartesian": return /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Series" }), /* @__PURE__ */ N(If, {
9203
9209
  series: e.series,
9204
9210
  onChange: (n) => t({
9205
9211
  ...e,
9206
9212
  series: n
9207
9213
  })
9208
9214
  })] });
9209
- case "metric": return /* @__PURE__ */ N(Af, {
9215
+ case "metric": return /* @__PURE__ */ N(jf, {
9210
9216
  widget: e,
9211
9217
  onChange: t
9212
9218
  });
9213
- case "metric-group": return /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Metrics" }), /* @__PURE__ */ N(Of, {
9219
+ case "metric-group": return /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Metrics" }), /* @__PURE__ */ N(kf, {
9214
9220
  items: e.items,
9215
9221
  onChange: (n) => t({
9216
9222
  ...e,
9217
9223
  items: n
9218
9224
  })
9219
9225
  })] });
9220
- default: return /* @__PURE__ */ N(Tf, {
9226
+ default: return /* @__PURE__ */ N(Ef, {
9221
9227
  widget: e,
9222
9228
  onChange: t
9223
9229
  });
9224
9230
  }
9225
9231
  }
9226
- function Xf({ widget: e, onChange: t }) {
9232
+ function Zf({ widget: e, onChange: t }) {
9227
9233
  switch (e.type) {
9228
- case "cartesian": return /* @__PURE__ */ N(cf, {
9234
+ case "cartesian": return /* @__PURE__ */ N(lf, {
9229
9235
  widget: e,
9230
9236
  onChange: t
9231
9237
  });
9232
9238
  case "metric":
9233
9239
  case "metric-group": return null;
9234
- default: return /* @__PURE__ */ N(gf, {
9240
+ default: return /* @__PURE__ */ N(_f, {
9235
9241
  widget: e,
9236
9242
  onChange: t
9237
9243
  });
@@ -9239,7 +9245,7 @@ function Xf({ widget: e, onChange: t }) {
9239
9245
  }
9240
9246
  //#endregion
9241
9247
  //#region src/dashboards/editor/WidgetIdentityFields.tsx
9242
- function Zf({ widget: e, onChange: t }) {
9248
+ function Qf({ widget: e, onChange: t }) {
9243
9249
  let n = Be(), r = Be();
9244
9250
  return /* @__PURE__ */ P(Pt, { children: [/* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, {
9245
9251
  htmlFor: n,
@@ -9270,7 +9276,7 @@ function Zf({ widget: e, onChange: t }) {
9270
9276
  }
9271
9277
  //#endregion
9272
9278
  //#region src/dashboards/editor/suggest-widget-title.ts
9273
- function Qf(e) {
9279
+ function $f(e) {
9274
9280
  switch (e.type) {
9275
9281
  case "cartesian": {
9276
9282
  let t = e.series[0];
@@ -9288,7 +9294,7 @@ function Qf(e) {
9288
9294
  }
9289
9295
  //#endregion
9290
9296
  //#region src/dashboards/editor/use-debounced-value.ts
9291
- function $f(e, t) {
9297
+ function ep(e, t) {
9292
9298
  let [n, r] = j(e);
9293
9299
  return O(() => {
9294
9300
  let n = setTimeout(() => r(e), t);
@@ -9297,15 +9303,15 @@ function $f(e, t) {
9297
9303
  }
9298
9304
  //#endregion
9299
9305
  //#region src/dashboards/editor/WidgetPreview.tsx
9300
- var ep = 450, tp = 150, np = 16, rp = .86, ip = 229, ap = 458;
9301
- function op(e) {
9302
- let t = e * tp + Math.max(0, e - 1) * np;
9303
- return Math.min(ap, Math.max(ip, Math.round(t * rp)));
9306
+ var tp = 450, np = 150, rp = 16, ip = .86, ap = 229, op = 458;
9307
+ function sp(e) {
9308
+ let t = e * np + Math.max(0, e - 1) * rp;
9309
+ return Math.min(op, Math.max(ap, Math.round(t * ip)));
9304
9310
  }
9305
- function sp({ widget: e, timeRange: t, dashboardFilters: n }) {
9306
- let r = $f(e, ep), i = k(() => Or(n), [n]), a = r.title.trim() || Qf(r), o = r.type === "cartesian" || r.type === "doughnut" || r.type === "bar";
9311
+ function cp({ widget: e, timeRange: t, dashboardFilters: n }) {
9312
+ let r = ep(e, tp), i = k(() => Or(n), [n]), a = r.title.trim() || $f(r), o = r.type === "cartesian" || r.type === "doughnut" || r.type === "bar";
9307
9313
  return /* @__PURE__ */ N("div", {
9308
- style: { height: op(r.layout.rows) },
9314
+ style: { height: sp(r.layout.rows) },
9309
9315
  children: /* @__PURE__ */ N(Nn, {
9310
9316
  title: a,
9311
9317
  subtitle: r.description,
@@ -9320,11 +9326,11 @@ function sp({ widget: e, timeRange: t, dashboardFilters: n }) {
9320
9326
  }
9321
9327
  //#endregion
9322
9328
  //#region src/dashboards/editor/normalize-widget-for-editor.ts
9323
- var cp = "neutral";
9324
- function lp(e) {
9329
+ var lp = "neutral";
9330
+ function up(e) {
9325
9331
  switch (e.type) {
9326
9332
  case "metric": {
9327
- let t = e.sentiment ?? cp;
9333
+ let t = e.sentiment ?? lp;
9328
9334
  return t === e.sentiment ? e : {
9329
9335
  ...e,
9330
9336
  sentiment: t
@@ -9332,7 +9338,7 @@ function lp(e) {
9332
9338
  }
9333
9339
  case "metric-group": {
9334
9340
  let t = !1, n = e.items.map((e) => {
9335
- let n = e.sentiment ?? cp;
9341
+ let n = e.sentiment ?? lp;
9336
9342
  return n === e.sentiment ? e : (t = !0, {
9337
9343
  ...e,
9338
9344
  sentiment: n
@@ -9348,14 +9354,14 @@ function lp(e) {
9348
9354
  }
9349
9355
  //#endregion
9350
9356
  //#region src/dashboards/editor/WidgetEditorPanel.tsx
9351
- function up({ open: e, widget: t, isNew: n, timeRange: r, dashboardFilters: i, onSave: a, onCancel: o, onDirtyChange: s }) {
9352
- let [c, l] = j(() => t ? lp(t) : null), [u, d] = j(c), [f, p] = j(!1), [m, h] = j(t);
9357
+ function dp({ open: e, widget: t, isNew: n, timeRange: r, dashboardFilters: i, onSave: a, onCancel: o, onDirtyChange: s }) {
9358
+ let [c, l] = j(() => t ? up(t) : null), [u, d] = j(c), [f, p] = j(!1), [m, h] = j(t);
9353
9359
  if (t !== m) {
9354
- let e = t ? lp(t) : null;
9360
+ let e = t ? up(t) : null;
9355
9361
  h(t), l(e), d(e);
9356
9362
  }
9357
9363
  !e && f && p(!1);
9358
- let g = e && !Od(u, c);
9364
+ let g = e && !kd(u, c);
9359
9365
  O(() => {
9360
9366
  s?.(g);
9361
9367
  }, [g, s]);
@@ -9363,7 +9369,7 @@ function up({ open: e, widget: t, isNew: n, timeRange: r, dashboardFilters: i, o
9363
9369
  p(!1), o();
9364
9370
  }, [o]), v = D(() => {
9365
9371
  if (!u) return;
9366
- let e = u.title.trim() || Qf(u);
9372
+ let e = u.title.trim() || $f(u);
9367
9373
  a({
9368
9374
  ...u,
9369
9375
  title: e
@@ -9427,14 +9433,14 @@ function up({ open: e, widget: t, isNew: n, timeRange: r, dashboardFilters: i, o
9427
9433
  children: [
9428
9434
  /* @__PURE__ */ N("div", {
9429
9435
  className: "px-4 pt-4 pb-3",
9430
- children: /* @__PURE__ */ N(Zf, {
9436
+ children: /* @__PURE__ */ N(Qf, {
9431
9437
  widget: u,
9432
9438
  onChange: d
9433
9439
  })
9434
9440
  }),
9435
9441
  /* @__PURE__ */ N("div", {
9436
9442
  className: "sticky top-0 z-10 border-y border-border bg-background/95 px-4 py-3 backdrop-blur-sm",
9437
- children: /* @__PURE__ */ N(sp, {
9443
+ children: /* @__PURE__ */ N(cp, {
9438
9444
  widget: u,
9439
9445
  timeRange: r,
9440
9446
  dashboardFilters: i
@@ -9442,7 +9448,7 @@ function up({ open: e, widget: t, isNew: n, timeRange: r, dashboardFilters: i, o
9442
9448
  }),
9443
9449
  /* @__PURE__ */ N("div", {
9444
9450
  className: "p-4",
9445
- children: /* @__PURE__ */ N(Jf, {
9451
+ children: /* @__PURE__ */ N(Yf, {
9446
9452
  widget: u,
9447
9453
  onChange: d
9448
9454
  })
@@ -9466,13 +9472,13 @@ function up({ open: e, widget: t, isNew: n, timeRange: r, dashboardFilters: i, o
9466
9472
  }
9467
9473
  //#endregion
9468
9474
  //#region src/dashboards/editor/locked-filter-conflicts.ts
9469
- function dp(e, t) {
9470
- let n = new Map(e.filter(gd).map((e) => [e.field, e]));
9475
+ function fp(e, t) {
9476
+ let n = new Map(e.filter(_d).map((e) => [e.field, e]));
9471
9477
  if (n.size === 0) return [];
9472
9478
  let r = [];
9473
9479
  for (let e of t) for (let t of e.filters ?? []) {
9474
9480
  let i = n.get(t.field);
9475
- !i || fp(i.value, t.value) || r.push({
9481
+ !i || pp(i.value, t.value) || r.push({
9476
9482
  widgetId: e.id,
9477
9483
  widgetTitle: e.title || e.id,
9478
9484
  field: t.field,
@@ -9485,32 +9491,32 @@ function dp(e, t) {
9485
9491
  }
9486
9492
  return r;
9487
9493
  }
9488
- function fp(e, t) {
9494
+ function pp(e, t) {
9489
9495
  if (e.length !== t.length) return !1;
9490
9496
  let n = [...t].sort();
9491
9497
  return [...e].sort().every((e, t) => e === n[t]);
9492
9498
  }
9493
9499
  //#endregion
9494
9500
  //#region src/dashboards/editor/DashboardEditorPage.tsx
9495
- function pp({ scopeFilterField: e }) {
9501
+ function mp({ scopeFilterField: e }) {
9496
9502
  let { dashboardId: t } = Bn();
9497
9503
  return /* @__PURE__ */ N(ar, {
9498
9504
  config: { defaultEnabled: !1 },
9499
- children: t ? /* @__PURE__ */ N(hp, {
9505
+ children: t ? /* @__PURE__ */ N(gp, {
9500
9506
  dashboardId: t,
9501
9507
  scopeFilterField: e
9502
- }) : /* @__PURE__ */ N(mp, { scopeFilterField: e })
9508
+ }) : /* @__PURE__ */ N(hp, { scopeFilterField: e })
9503
9509
  });
9504
9510
  }
9505
- function mp({ scopeFilterField: e }) {
9506
- let [t] = j(() => Vd());
9507
- return /* @__PURE__ */ N(gp, {
9511
+ function hp({ scopeFilterField: e }) {
9512
+ let [t] = j(() => Hd());
9513
+ return /* @__PURE__ */ N(_p, {
9508
9514
  initial: t,
9509
9515
  mode: "create",
9510
9516
  scopeFilterField: e
9511
9517
  });
9512
9518
  }
9513
- function hp({ dashboardId: e, scopeFilterField: t }) {
9519
+ function gp({ dashboardId: e, scopeFilterField: t }) {
9514
9520
  let { data: n, isLoading: r, isError: i } = rd(e);
9515
9521
  return r ? /* @__PURE__ */ P("div", {
9516
9522
  className: "flex flex-col gap-4 p-4",
@@ -9526,53 +9532,61 @@ function hp({ dashboardId: e, scopeFilterField: t }) {
9526
9532
  e,
9527
9533
  "\" was not found. It may have been deleted."
9528
9534
  ]
9529
- }) : /* @__PURE__ */ N(gp, {
9535
+ }) : /* @__PURE__ */ N(_p, {
9530
9536
  initial: n,
9531
9537
  mode: "edit",
9532
9538
  scopeFilterField: t
9533
9539
  }, n.id);
9534
9540
  }
9535
- function gp({ initial: e, mode: t, scopeFilterField: n }) {
9536
- let r = zn(), [i, a] = He(Md, e, kd), [o, s] = j(null), [c, l] = j("builder"), [u, d] = j(""), [f, p] = j(!1), [m] = Vn(), [h, g] = j(() => bi(m.get("q"), m.get("v"), { defaultTimeRange: e.timeRange }).timeRange), _ = A(!1), [v, y] = j(null), b = D((e) => {
9541
+ function _p({ initial: e, mode: t, scopeFilterField: n }) {
9542
+ let r = zn(), [i, a] = He(Nd, e, Ad), [o, s] = j(null), [c, l] = j("builder"), [u, d] = j(""), [f, p] = j(!1), [m] = Vn(), [h, g] = j(() => bi(m.get("q"), m.get("v"), { defaultTimeRange: e.timeRange }).timeRange), _ = A(!1), [v, y] = j(null), b = D((e) => {
9537
9543
  if (o && _.current) {
9538
9544
  y({ target: e });
9539
9545
  return;
9540
9546
  }
9541
9547
  s(e);
9542
- }, [o]), x = id(), C = ad(), w = od(), ee = sd(), te = x.isPending || C.isPending || w.isPending, T = i.draft, ne = Ad(i), [re, ae] = j(null);
9548
+ }, [o]), x = cd(), C = A(!1);
9549
+ Ve(() => {
9550
+ t !== "edit" || C.current || (C.current = !0, x(e.id));
9551
+ }, [
9552
+ t,
9553
+ e.id,
9554
+ x
9555
+ ]);
9556
+ let w = id(), ee = ad(), te = od(), ne = sd(), re = w.isPending || ee.isPending || te.isPending, T = i.draft, ae = jd(i), [oe, se] = j(null);
9543
9557
  O(() => {
9544
- if (!ne) return;
9558
+ if (!ae) return;
9545
9559
  let e = (e) => {
9546
9560
  e.preventDefault();
9547
9561
  };
9548
9562
  return window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
9549
- }, [ne]);
9550
- let oe = D((e = "..") => {
9563
+ }, [ae]);
9564
+ let ce = D((e = "..") => {
9551
9565
  r(e, { relative: "path" });
9552
- }, [r]), se = D(() => {
9553
- if (ne) {
9566
+ }, [r]), ue = D(() => {
9567
+ if (ae) {
9554
9568
  p(!0);
9555
9569
  return;
9556
9570
  }
9557
- oe();
9558
- }, [ne, oe]), ce = (e) => t === "create" ? `../${e}` : `../../${e}`, ue = (e, t) => {
9571
+ ce();
9572
+ }, [ae, ce]), de = (e) => t === "create" ? `../${e}` : `../../${e}`, fe = (e, t) => {
9559
9573
  a({
9560
9574
  type: "markSaved",
9561
9575
  dashboard: e
9562
- }), X.success(t), oe(ce(e.id));
9563
- }, de = () => {
9564
- (t === "create" ? x : C).mutate(T, {
9565
- onSuccess: (e) => ue(e, t === "create" ? "Dashboard created" : "Dashboard saved"),
9576
+ }), X.success(t), ce(de(e.id));
9577
+ }, pe = () => {
9578
+ (t === "create" ? w : ee).mutate(T, {
9579
+ onSuccess: (e) => fe(e, t === "create" ? "Dashboard created" : "Dashboard saved"),
9566
9580
  onError: (e) => {
9567
9581
  if (e instanceof Gu) {
9568
- ae({
9582
+ se({
9569
9583
  theirs: e.currentDashboard,
9570
9584
  deleted: !1
9571
9585
  });
9572
9586
  return;
9573
9587
  }
9574
9588
  if (t === "edit" && e instanceof Wu) {
9575
- ae({
9589
+ se({
9576
9590
  theirs: null,
9577
9591
  deleted: !0
9578
9592
  });
@@ -9581,14 +9595,14 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9581
9595
  X.error(`Could not save the dashboard: ${e.message}`);
9582
9596
  }
9583
9597
  });
9584
- }, fe = () => {
9585
- w.mutate(T, {
9598
+ }, me = () => {
9599
+ te.mutate(T, {
9586
9600
  onSuccess: (e) => {
9587
- ae(null), ue(e, "Dashboard saved over the other version");
9601
+ se(null), fe(e, "Dashboard saved over the other version");
9588
9602
  },
9589
9603
  onError: (e) => {
9590
9604
  if (e instanceof Wu) {
9591
- ae((e) => e && {
9605
+ se((e) => e && {
9592
9606
  ...e,
9593
9607
  deleted: !0
9594
9608
  });
@@ -9597,26 +9611,26 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9597
9611
  X.error(`Could not overwrite the dashboard: ${e.message}`);
9598
9612
  }
9599
9613
  });
9600
- }, pe = () => {
9601
- let e = re?.theirs;
9602
- e && (ee(e), a({
9614
+ }, he = () => {
9615
+ let e = oe?.theirs;
9616
+ e && (ne(e), a({
9603
9617
  type: "init",
9604
9618
  dashboard: e
9605
- }), d(Kd(e)), s(null), y(null), ae(null), X.success("Showing the version saved by the other author"));
9606
- }, me = () => {
9607
- x.mutate(Fd(T), {
9619
+ }), d(qd(e)), s(null), y(null), se(null), X.success("Showing the version saved by the other author"));
9620
+ }, ge = () => {
9621
+ w.mutate(Id(T), {
9608
9622
  onSuccess: (e) => {
9609
- ae(null), ue(e, `Saved as "${e.title}"`);
9623
+ se(null), fe(e, `Saved as "${e.title}"`);
9610
9624
  },
9611
9625
  onError: (e) => X.error(`Could not save a copy: ${e.message}`)
9612
9626
  });
9613
- }, he = (e) => e === "overwrite" ? fe() : e === "take-theirs" ? pe() : me(), ge = () => w.isPending ? "overwrite" : x.isPending ? "save-as-copy" : null, _e = (e) => {
9627
+ }, _e = (e) => e === "overwrite" ? me() : e === "take-theirs" ? he() : ge(), ve = () => te.isPending ? "overwrite" : w.isPending ? "save-as-copy" : null, ye = (e) => {
9614
9628
  if (s(null), y(null), e === "json") {
9615
- d(Kd(T)), l("json");
9629
+ d(qd(T)), l("json");
9616
9630
  return;
9617
9631
  }
9618
- if (u !== Kd(T)) {
9619
- let e = qd(u);
9632
+ if (u !== qd(T)) {
9633
+ let e = Jd(u);
9620
9634
  if (!e.ok) {
9621
9635
  X.error("Fix the JSON errors (or copy your changes) before going back to the builder.");
9622
9636
  return;
@@ -9627,25 +9641,25 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9627
9641
  }), X.success("JSON applied to the dashboard");
9628
9642
  }
9629
9643
  l("builder");
9630
- }, ve = (e) => {
9644
+ }, be = (e) => {
9631
9645
  a({
9632
9646
  type: "replaceEditable",
9633
9647
  fields: e
9634
- }), d(Kd({
9648
+ }), d(qd({
9635
9649
  ...T,
9636
9650
  ...e
9637
9651
  }));
9638
- }, ye = () => {
9652
+ }, Se = () => {
9639
9653
  b({
9640
- widget: zd("cartesian", Nd(), T.widgets),
9654
+ widget: Bd("cartesian", Pd(), T.widgets),
9641
9655
  isNew: !0
9642
9656
  });
9643
- }, be = (e) => {
9657
+ }, Ce = (e) => {
9644
9658
  a({
9645
9659
  type: "upsertWidget",
9646
9660
  widget: e
9647
9661
  }), s(null);
9648
- }, Se = D((e) => /* @__PURE__ */ P("div", {
9662
+ }, Ee = D((e) => /* @__PURE__ */ P("div", {
9649
9663
  className: "flex items-center gap-0.5",
9650
9664
  children: [/* @__PURE__ */ N(L, {
9651
9665
  variant: "ghost",
@@ -9679,7 +9693,7 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9679
9693
  onSelect: () => a({
9680
9694
  type: "duplicateWidget",
9681
9695
  widgetId: e.id,
9682
- newWidgetId: Nd()
9696
+ newWidgetId: Pd()
9683
9697
  }),
9684
9698
  children: [/* @__PURE__ */ N(E, { className: "size-4" }), "Duplicate"]
9685
9699
  }),
@@ -9694,13 +9708,13 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9694
9708
  })
9695
9709
  ]
9696
9710
  })] })]
9697
- }), [b]), Ce = k(() => Yu([...T.filters ?? [], ...T.widgets.flatMap((e) => e.filters ?? [])]), [T.filters, T.widgets]), Ee = ja(T.filters), Oe = k(() => dp(Ee, T.widgets), [Ee, T.widgets]), ke = k(() => Od(h, T.timeRange), [h, T.timeRange]);
9711
+ }), [b]), Oe = k(() => Yu([...T.filters ?? [], ...T.widgets.flatMap((e) => e.filters ?? [])]), [T.filters, T.widgets]), ke = ja(T.filters), Ae = k(() => fp(ke, T.widgets), [ke, T.widgets]), je = k(() => kd(h, T.timeRange), [h, T.timeRange]);
9698
9712
  return /* @__PURE__ */ P("div", {
9699
9713
  className: "flex flex-col gap-4 p-4",
9700
9714
  children: [
9701
9715
  /* @__PURE__ */ P(Zt, {
9702
9716
  value: c,
9703
- onValueChange: _e,
9717
+ onValueChange: ye,
9704
9718
  className: "flex flex-col gap-4",
9705
9719
  children: [
9706
9720
  /* @__PURE__ */ P("div", {
@@ -9711,11 +9725,11 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9711
9725
  variant: "ghost",
9712
9726
  size: "icon",
9713
9727
  "aria-label": "Back",
9714
- onClick: se,
9728
+ onClick: ue,
9715
9729
  children: /* @__PURE__ */ N(S, { className: "size-4" })
9716
9730
  }), /* @__PURE__ */ P("div", {
9717
9731
  className: "flex min-w-0 flex-col gap-0.5",
9718
- children: [/* @__PURE__ */ N(sf, {
9732
+ children: [/* @__PURE__ */ N(cf, {
9719
9733
  value: T.title,
9720
9734
  onChange: (e) => a({
9721
9735
  type: "setTitle",
@@ -9725,7 +9739,7 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9725
9739
  ariaLabel: "Dashboard title",
9726
9740
  textClassName: "text-lg font-semibold",
9727
9741
  inputClassName: "h-8 w-96 text-lg font-semibold"
9728
- }), /* @__PURE__ */ N(sf, {
9742
+ }), /* @__PURE__ */ N(cf, {
9729
9743
  value: T.description ?? "",
9730
9744
  onChange: (e) => a({
9731
9745
  type: "setDescription",
@@ -9749,13 +9763,13 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9749
9763
  })] }),
9750
9764
  /* @__PURE__ */ N(L, {
9751
9765
  variant: "outline",
9752
- onClick: se,
9766
+ onClick: ue,
9753
9767
  children: "Cancel"
9754
9768
  }),
9755
9769
  /* @__PURE__ */ N(L, {
9756
- onClick: de,
9757
- disabled: te || !ne && t === "edit",
9758
- children: te ? "Saving…" : "Save"
9770
+ onClick: pe,
9771
+ disabled: re || !ae && t === "edit",
9772
+ children: re ? "Saving…" : "Save"
9759
9773
  })
9760
9774
  ]
9761
9775
  })]
@@ -9769,7 +9783,7 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9769
9783
  children: [
9770
9784
  /* @__PURE__ */ N("div", {
9771
9785
  className: "flex flex-1 items-center gap-2",
9772
- children: /* @__PURE__ */ N(wd, {
9786
+ children: /* @__PURE__ */ N(Td, {
9773
9787
  filters: T.filters,
9774
9788
  scopeFilterField: n,
9775
9789
  onChange: (e) => a({
@@ -9781,7 +9795,7 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9781
9795
  /* @__PURE__ */ P("div", {
9782
9796
  className: "flex items-center gap-1.5",
9783
9797
  children: [
9784
- !ke && /* @__PURE__ */ P(L, {
9798
+ !je && /* @__PURE__ */ P(L, {
9785
9799
  variant: "ghost",
9786
9800
  size: "sm",
9787
9801
  className: "text-xs",
@@ -9794,7 +9808,7 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9794
9808
  },
9795
9809
  children: [/* @__PURE__ */ N(le, { className: "size-3.5" }), "Set as default"]
9796
9810
  }),
9797
- ke && /* @__PURE__ */ P("span", {
9811
+ je && /* @__PURE__ */ P("span", {
9798
9812
  className: "flex items-center gap-1 text-xs text-muted-foreground",
9799
9813
  title: "This is the dashboard default range",
9800
9814
  children: [/* @__PURE__ */ N(ie, { className: "size-3.5" }), "Default"]
@@ -9806,25 +9820,25 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9806
9820
  ]
9807
9821
  }),
9808
9822
  /* @__PURE__ */ P(L, {
9809
- onClick: ye,
9823
+ onClick: Se,
9810
9824
  children: [/* @__PURE__ */ N(Te, { className: "size-4" }), "Add widget"]
9811
9825
  })
9812
9826
  ]
9813
9827
  }),
9814
- Ce.length > 0 && /* @__PURE__ */ P(Qe, {
9828
+ Oe.length > 0 && /* @__PURE__ */ P(Qe, {
9815
9829
  variant: "destructive",
9816
9830
  children: [/* @__PURE__ */ N(et, { children: "These dashboard filters cannot be queried" }), /* @__PURE__ */ P($e, { children: [
9817
- Ce.map((e) => `${e.label || e.field} (${e.operator})`).join(", "),
9831
+ Oe.map((e) => `${e.label || e.field} (${e.operator})`).join(", "),
9818
9832
  ". The analytics API only accepts ",
9819
9833
  Xu.join(", "),
9820
9834
  ". The affected widgets stay empty until the operator is changed, from a widget's Filters tab or from the JSON tab."
9821
9835
  ] })]
9822
9836
  }),
9823
- Oe.length > 0 && /* @__PURE__ */ P(Qe, {
9837
+ Ae.length > 0 && /* @__PURE__ */ P(Qe, {
9824
9838
  variant: "warning",
9825
9839
  children: [/* @__PURE__ */ N(et, { children: "These widgets ignore a locked dashboard filter" }), /* @__PURE__ */ P($e, { children: [/* @__PURE__ */ N("ul", {
9826
9840
  className: "list-inside list-disc",
9827
- children: Oe.map((e) => /* @__PURE__ */ P("li", { children: [
9841
+ children: Ae.map((e) => /* @__PURE__ */ P("li", { children: [
9828
9842
  /* @__PURE__ */ N("span", {
9829
9843
  className: "font-medium",
9830
9844
  children: e.widgetTitle
@@ -9833,15 +9847,15 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9833
9847
  e.label,
9834
9848
  " on",
9835
9849
  " ",
9836
- _p(e.widgetValue, e.widgetValueLabels),
9850
+ vp(e.widgetValue, e.widgetValueLabels),
9837
9851
  ", the dashboard locks it to",
9838
9852
  " ",
9839
- _p(e.dashboardValue, e.dashboardValueLabels),
9853
+ vp(e.dashboardValue, e.dashboardValueLabels),
9840
9854
  "."
9841
9855
  ] }, `${e.widgetId}-${e.field}`))
9842
9856
  }), "A widget's own filter wins, so the widget value is what gets queried, within whatever scope this module is mounted with. Readers still see the locked chip. Either change the widget's filter or unlock the dashboard one."] })]
9843
9857
  }),
9844
- T.widgets.length === 0 ? /* @__PURE__ */ N(of, { onAddWidget: ye }) : /* @__PURE__ */ N(zs, {
9858
+ T.widgets.length === 0 ? /* @__PURE__ */ N(sf, { onAddWidget: Se }) : /* @__PURE__ */ N(zs, {
9845
9859
  dashboard: T,
9846
9860
  timeRange: h,
9847
9861
  filters: T.filters,
@@ -9850,41 +9864,41 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9850
9864
  type: "applyLayouts",
9851
9865
  layouts: e
9852
9866
  }),
9853
- widgetActions: Se,
9867
+ widgetActions: Ee,
9854
9868
  highlightedWidgetId: o && !o.isNew ? o.widget.id : void 0
9855
9869
  })
9856
9870
  ]
9857
9871
  }),
9858
9872
  /* @__PURE__ */ N(Qt, {
9859
9873
  value: "json",
9860
- children: /* @__PURE__ */ N(nf, {
9874
+ children: /* @__PURE__ */ N(rf, {
9861
9875
  text: u,
9862
9876
  onTextChange: d,
9863
- dirty: u !== Kd(T),
9864
- onApply: ve
9877
+ dirty: u !== qd(T),
9878
+ onApply: be
9865
9879
  })
9866
9880
  })
9867
9881
  ]
9868
9882
  }),
9869
- /* @__PURE__ */ N(up, {
9883
+ /* @__PURE__ */ N(dp, {
9870
9884
  open: o !== null,
9871
9885
  widget: o?.widget ?? null,
9872
9886
  isNew: o?.isNew ?? !1,
9873
9887
  timeRange: h,
9874
9888
  dashboardFilters: T.filters,
9875
- onSave: be,
9889
+ onSave: Ce,
9876
9890
  onCancel: () => s(null),
9877
9891
  onDirtyChange: (e) => {
9878
9892
  _.current = e;
9879
9893
  }
9880
9894
  }),
9881
- /* @__PURE__ */ N(ud, {
9882
- open: re !== null,
9883
- theirDashboard: re?.theirs ?? null,
9884
- deleted: re?.deleted ?? !1,
9885
- pending: re ? ge() : null,
9886
- onResolve: he,
9887
- onCancel: () => ae(null)
9895
+ /* @__PURE__ */ N(dd, {
9896
+ open: oe !== null,
9897
+ theirDashboard: oe?.theirs ?? null,
9898
+ deleted: oe?.deleted ?? !1,
9899
+ pending: oe ? ve() : null,
9900
+ onResolve: _e,
9901
+ onCancel: () => se(null)
9888
9902
  }),
9889
9903
  /* @__PURE__ */ N(ht, {
9890
9904
  open: v !== null,
@@ -9916,7 +9930,7 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9916
9930
  }), /* @__PURE__ */ N(L, {
9917
9931
  variant: "destructive",
9918
9932
  onClick: () => {
9919
- p(!1), oe();
9933
+ p(!1), ce();
9920
9934
  },
9921
9935
  children: "Discard changes"
9922
9936
  })] })] })
@@ -9924,45 +9938,58 @@ function gp({ initial: e, mode: t, scopeFilterField: n }) {
9924
9938
  ]
9925
9939
  });
9926
9940
  }
9927
- function _p(e, t) {
9941
+ function vp(e, t) {
9928
9942
  return e.length === 0 ? "all values" : e.map((e, n) => t?.[n] ?? e).join(", ");
9929
9943
  }
9930
9944
  //#endregion
9931
9945
  //#region src/data-sources/dashboard-revision-store.ts
9932
- function vp() {
9933
- let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
9946
+ function yp() {
9947
+ let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
9948
+ function r(n, r) {
9949
+ e.set(n, r), t.set(n, r);
9950
+ }
9951
+ function i(t, n) {
9952
+ e.has(t) || n && e.set(t, n);
9953
+ }
9934
9954
  return {
9935
9955
  current(t) {
9936
9956
  return e.get(t);
9937
9957
  },
9938
- refresh(n, r) {
9939
- r && e.set(n, r), t.delete(n);
9958
+ refresh(e, t) {
9959
+ t && r(e, t), n.delete(e);
9940
9960
  },
9941
- seed(t, n) {
9942
- e.has(t) || n && e.set(t, n);
9961
+ seed(e, t) {
9962
+ i(e, t);
9943
9963
  },
9944
- offer(e, n) {
9945
- n && t.set(e, n);
9964
+ sight(e, n) {
9965
+ i(e, n), n && t.set(e, n);
9946
9966
  },
9947
- adopt(n) {
9967
+ take(n) {
9948
9968
  let r = t.get(n);
9949
- r && (t.delete(n), e.set(n, r));
9969
+ r && e.set(n, r);
9970
+ },
9971
+ offer(e, t) {
9972
+ t && n.set(e, t);
9950
9973
  },
9951
- forget(n) {
9952
- e.delete(n), t.delete(n);
9974
+ adopt(e) {
9975
+ let t = n.get(e);
9976
+ t && (n.delete(e), r(e, t));
9977
+ },
9978
+ forget(r) {
9979
+ e.delete(r), t.delete(r), n.delete(r);
9953
9980
  }
9954
9981
  };
9955
9982
  }
9956
9983
  //#endregion
9957
9984
  //#region src/data-sources/dashboard-wire.ts
9958
- var yp = {
9985
+ var bp = {
9959
9986
  type: "relative",
9960
9987
  period: "24h"
9961
9988
  };
9962
- function bp(e) {
9989
+ function xp(e) {
9963
9990
  return e.toLowerCase();
9964
9991
  }
9965
- function xp(e) {
9992
+ function Sp(e) {
9966
9993
  return {
9967
9994
  name: e.field,
9968
9995
  ...e.label === void 0 ? {} : { label: e.label },
@@ -9971,17 +9998,17 @@ function xp(e) {
9971
9998
  editable: e.editable === !0
9972
9999
  };
9973
10000
  }
9974
- function Sp(e) {
10001
+ function Cp(e) {
9975
10002
  let t = e.label ?? void 0;
9976
10003
  return {
9977
10004
  field: e.name,
9978
10005
  ...t === void 0 ? {} : { label: t },
9979
- operator: bp(e.operator),
10006
+ operator: xp(e.operator),
9980
10007
  value: e.value ?? [],
9981
10008
  editable: e.editable === !0
9982
10009
  };
9983
10010
  }
9984
- function Cp(e) {
10011
+ function wp(e) {
9985
10012
  return e.type === "relative" ? {
9986
10013
  type: "relative",
9987
10014
  period: e.period
@@ -9991,50 +10018,50 @@ function Cp(e) {
9991
10018
  to: e.to
9992
10019
  };
9993
10020
  }
9994
- function wp(e) {
9995
- if (!e) return yp;
10021
+ function Tp(e) {
10022
+ if (!e) return bp;
9996
10023
  if (e.type === "absolute") {
9997
10024
  let t = e.from ?? void 0, n = e.to ?? void 0;
9998
- return t === void 0 || n === void 0 ? yp : {
10025
+ return t === void 0 || n === void 0 ? bp : {
9999
10026
  type: "absolute",
10000
10027
  from: t,
10001
10028
  to: n
10002
10029
  };
10003
10030
  }
10004
10031
  let t = e.period ?? void 0;
10005
- return t === void 0 ? yp : {
10032
+ return t === void 0 ? bp : {
10006
10033
  type: "relative",
10007
10034
  period: t
10008
10035
  };
10009
10036
  }
10010
- function Tp(e) {
10037
+ function Ep(e) {
10011
10038
  let t = e.description ?? void 0;
10012
10039
  return {
10013
10040
  id: e.id,
10014
10041
  title: e.title,
10015
10042
  ...t === void 0 ? {} : { description: t },
10016
10043
  widgets: e.widgets ?? [],
10017
- filters: (e.filters ?? []).map(Sp),
10018
- timeRange: wp(e.timeRange),
10044
+ filters: (e.filters ?? []).map(Cp),
10045
+ timeRange: Tp(e.timeRange),
10019
10046
  createdAt: e.createdAt ?? 0,
10020
10047
  updatedAt: e.updatedAt ?? e.createdAt ?? 0
10021
10048
  };
10022
10049
  }
10023
- function Ep(e, t) {
10050
+ function Dp(e, t) {
10024
10051
  return {
10025
10052
  ...t.includeId ? { id: e.id } : {},
10026
10053
  title: e.title,
10027
10054
  ...e.description === void 0 ? {} : { description: e.description },
10028
- filters: e.filters.map(xp),
10029
- timeRange: Cp(e.timeRange),
10055
+ filters: e.filters.map(Sp),
10056
+ timeRange: wp(e.timeRange),
10030
10057
  widgets: e.widgets
10031
10058
  };
10032
10059
  }
10033
10060
  //#endregion
10034
10061
  //#region src/data-sources/http-dashboard-persistence.ts
10035
- var Dp = "/observability/dashboards", Op = 100, kp = "*";
10036
- function Ap(e, t) {
10037
- let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.dashboardsPath ?? Dp, a = `${e}${i}`, o = (e) => `${a}/${encodeURIComponent(e)}`, s = t?.revisionStore ?? vp();
10062
+ var Op = "/observability/dashboards", kp = 100, Ap = "*";
10063
+ function jp(e, t) {
10064
+ let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.dashboardsPath ?? Op, a = `${e}${i}`, o = (e) => `${a}/${encodeURIComponent(e)}`, s = t?.revisionStore ?? yp();
10038
10065
  function c(e, n) {
10039
10066
  let i = {
10040
10067
  method: e,
@@ -10070,7 +10097,7 @@ function Ap(e, t) {
10070
10097
  case 412:
10071
10098
  if (r?.dashboard) {
10072
10099
  let t = r.dashboard, n = u(e.headers.get("ETag"), r.currentVersion ?? t.version);
10073
- return s.offer(t.id, n), new Gu(i, Tp(t), r.currentVersion ?? t.version ?? void 0);
10100
+ return s.offer(t.id, n), new Gu(i, Ep(t), r.currentVersion ?? t.version ?? void 0);
10074
10101
  }
10075
10102
  return new Hu(e.status, i);
10076
10103
  default: return new Hu(e.status, i);
@@ -10078,39 +10105,42 @@ function Ap(e, t) {
10078
10105
  }
10079
10106
  async function m(e, t) {
10080
10107
  let n = await e.json();
10081
- return d(n.id, e.headers.get("ETag"), n.version, t), Tp(n);
10108
+ return d(n.id, e.headers.get("ETag"), n.version, t), Ep(n);
10082
10109
  }
10083
10110
  async function h(e, t) {
10084
10111
  let r = await n(o(e), c("GET", t ? { signal: t } : void 0));
10085
10112
  if (!r.ok) throw await p(r, `GET ${i}/{dashboardId}`, e);
10086
- return m(r, "seed");
10113
+ return m(r, "sight");
10087
10114
  }
10088
10115
  async function g(e, t) {
10089
- return s.current(e) || (console.warn(`[gamma-lib-observability] Saving dashboard "${e}" that this persistence never read. Its current revision is read back first, so an edit saved in between is overwritten without a conflict. Read or create the dashboard through the same instance before saving, or pass a shared \`revisionStore\` if the adapter is being rebuilt.`), await h(e, t), s.current(e) ?? kp);
10116
+ return s.current(e) || (console.warn(`[gamma-lib-observability] Saving dashboard "${e}" that this persistence never read. Its current revision is read back first, so an edit saved in between is overwritten without a conflict. Read or create the dashboard through the same instance before saving, or pass a shared \`revisionStore\` if the adapter is being rebuilt.`), await h(e, t), s.current(e) ?? Ap);
10090
10117
  }
10091
10118
  return {
10092
10119
  fetchDashboard: h,
10093
10120
  adoptCurrentRevision(e) {
10094
10121
  s.adopt(e);
10095
10122
  },
10123
+ takeReadRevision(e) {
10124
+ s.take(e);
10125
+ },
10096
10126
  async fetchDashboards(e) {
10097
10127
  let t = [];
10098
10128
  for (let r = 1;; r += 1) {
10099
- let o = await n(`${a}?page=${r}&perPage=${Op}`, c("GET", e ? { signal: e } : void 0));
10129
+ let o = await n(`${a}?page=${r}&perPage=${kp}`, c("GET", e ? { signal: e } : void 0));
10100
10130
  if (!o.ok) throw await p(o, `GET ${i}`);
10101
10131
  let s = await o.json(), l = s.data ?? [];
10102
- for (let e of l) d(e.id, null, e.version, "seed"), t.push(Tp(e));
10132
+ for (let e of l) d(e.id, null, e.version, "seed"), t.push(Ep(e));
10103
10133
  let u = s.pagination?.pageCount ?? 0;
10104
10134
  if (l.length === 0 || r >= u) return t;
10105
10135
  }
10106
10136
  },
10107
10137
  async createDashboard(e, t) {
10108
- let r = await n(a, l("POST", Ep(e, { includeId: !0 }), t));
10138
+ let r = await n(a, l("POST", Dp(e, { includeId: !0 }), t));
10109
10139
  if (!r.ok) throw await p(r, `POST ${i}`, e.id);
10110
10140
  return m(r, "refresh");
10111
10141
  },
10112
10142
  async updateDashboard(e, t, r) {
10113
- let a = r?.force ? kp : await g(e.id, t), s = await n(o(e.id), l("PUT", Ep(e, { includeId: !1 }), t, { "If-Match": a }));
10143
+ let a = r?.force ? Ap : await g(e.id, t), s = await n(o(e.id), l("PUT", Dp(e, { includeId: !1 }), t, { "If-Match": a }));
10114
10144
  if (!s.ok) throw await p(s, `PUT ${i}/{dashboardId}`, e.id);
10115
10145
  return m(s, "refresh");
10116
10146
  },
@@ -10122,23 +10152,23 @@ function Ap(e, t) {
10122
10152
  }
10123
10153
  //#endregion
10124
10154
  //#region src/data-sources/http-data-source.ts
10125
- var jp = {
10155
+ var Mp = {
10126
10156
  name: "HTTP_REQUESTS",
10127
10157
  measures: [tr]
10128
10158
  };
10129
- function Mp(e) {
10159
+ function Np(e) {
10130
10160
  return e.metrics.map((e) => ({
10131
10161
  name: e.name,
10132
10162
  unit: e.unit,
10133
10163
  measures: e.measures ?? []
10134
10164
  }));
10135
10165
  }
10136
- function Np(e, t = "", n = "") {
10166
+ function Pp(e, t = "", n = "") {
10137
10167
  let r = [];
10138
10168
  for (let i of e) {
10139
10169
  let e = t ? `${t} / ${i.key}` : i.key, a = n ? `${n}${qa}${i.name ?? i.key}` : i.name ?? i.key;
10140
10170
  if (i.type === "GROUP" && i.buckets?.length) {
10141
- r.push(...Np(i.buckets, e, a));
10171
+ r.push(...Pp(i.buckets, e, a));
10142
10172
  continue;
10143
10173
  }
10144
10174
  r.push({
@@ -10149,12 +10179,12 @@ function Np(e, t = "", n = "") {
10149
10179
  }
10150
10180
  return r;
10151
10181
  }
10152
- function Pp(e) {
10182
+ function Fp(e) {
10153
10183
  let t = [];
10154
- for (let n of e.metrics) n.buckets && t.push(...Np(n.buckets));
10184
+ for (let n of e.metrics) n.buckets && t.push(...Pp(n.buckets));
10155
10185
  return t;
10156
10186
  }
10157
- function Fp(e) {
10187
+ function Ip(e) {
10158
10188
  let t = [];
10159
10189
  for (let n of e.metrics) if (n.buckets) if (n.buckets.some((e) => e.type === "GROUP" && e.buckets?.length)) {
10160
10190
  let e = /* @__PURE__ */ new Map();
@@ -10191,42 +10221,42 @@ function Fp(e) {
10191
10221
  }
10192
10222
  return t;
10193
10223
  }
10194
- function Ip(e) {
10224
+ function Lp(e) {
10195
10225
  return {
10196
10226
  ...e,
10197
10227
  measures: e.measures?.length ? e.measures : [tr]
10198
10228
  };
10199
10229
  }
10200
- function Lp(e) {
10201
- let t = Bp(e);
10202
- return t.metrics = e.metrics.map(Vp), t;
10203
- }
10204
10230
  function Rp(e) {
10205
- let t = Bp(e);
10206
- return t.interval = e.interval, t.metrics = e.metrics.map(Vp), e.by?.length && (t.by = e.by), e.ranges?.length && (t.ranges = e.ranges), e.limit !== void 0 && (t.limit = e.limit), t;
10231
+ let t = Vp(e);
10232
+ return t.metrics = e.metrics.map(Hp), t;
10233
+ }
10234
+ function zp(e) {
10235
+ let t = Vp(e);
10236
+ return t.interval = e.interval, t.metrics = e.metrics.map(Hp), e.by?.length && (t.by = e.by), e.ranges?.length && (t.ranges = e.ranges), e.limit !== void 0 && (t.limit = e.limit), t;
10207
10237
  }
10208
- function zp(e, t) {
10209
- let n = Bp(e);
10210
- return n.by = e.by, n.metrics = (e.metrics?.length ? e.metrics : [t]).map(Vp), e.ranges?.length && (n.ranges = e.ranges), e.limit !== void 0 && (n.limit = e.limit), n;
10238
+ function Bp(e, t) {
10239
+ let n = Vp(e);
10240
+ return n.by = e.by, n.metrics = (e.metrics?.length ? e.metrics : [t]).map(Hp), e.ranges?.length && (n.ranges = e.ranges), e.limit !== void 0 && (n.limit = e.limit), n;
10211
10241
  }
10212
- function Bp(e) {
10242
+ function Vp(e) {
10213
10243
  let t = Ur(e.timeRange), n = { timeRange: {
10214
10244
  from: new Date(t.from).toISOString(),
10215
10245
  to: new Date(t.to).toISOString()
10216
10246
  } }, r = td(e.filters);
10217
10247
  return r && (n.filters = r), n;
10218
10248
  }
10219
- function Vp(e) {
10220
- let t = Ip(e), n = {
10249
+ function Hp(e) {
10250
+ let t = Lp(e), n = {
10221
10251
  name: t.name,
10222
10252
  measures: t.measures
10223
10253
  }, r = td(e.filters);
10224
10254
  return r && (n.filters = r), "sorts" in e && e.sorts?.length && (n.sorts = e.sorts), n;
10225
10255
  }
10226
- function Hp(e, t) {
10256
+ function Up(e, t) {
10227
10257
  let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = {
10228
- name: t?.defaultFacetMetric?.name ?? jp.name,
10229
- measures: t?.defaultFacetMetric?.measures?.length ? [...t.defaultFacetMetric.measures] : [...jp.measures]
10258
+ name: t?.defaultFacetMetric?.name ?? Mp.name,
10259
+ measures: t?.defaultFacetMetric?.measures?.length ? [...t.defaultFacetMetric.measures] : [...Mp.measures]
10230
10260
  };
10231
10261
  async function a(i, a, o) {
10232
10262
  let s = {
@@ -10242,19 +10272,19 @@ function Hp(e, t) {
10242
10272
  }
10243
10273
  return {
10244
10274
  async fetchTimeSeries(e) {
10245
- return Fp(await a("/observability/analytics/time-series", Rp(e), e.signal));
10275
+ return Ip(await a("/observability/analytics/time-series", zp(e), e.signal));
10246
10276
  },
10247
10277
  async fetchFacets(e) {
10248
- return Pp(await a("/observability/analytics/facets", zp(e, i), e.signal));
10278
+ return Fp(await a("/observability/analytics/facets", Bp(e, i), e.signal));
10249
10279
  },
10250
10280
  async fetchMeasures(e) {
10251
- return Mp(await a("/observability/analytics/measures", Lp(e), e.signal));
10281
+ return Np(await a("/observability/analytics/measures", Rp(e), e.signal));
10252
10282
  }
10253
10283
  };
10254
10284
  }
10255
10285
  //#endregion
10256
10286
  //#region src/data-sources/http-filter-source.ts
10257
- function Up(e) {
10287
+ function Wp(e) {
10258
10288
  return {
10259
10289
  EQ: "eq",
10260
10290
  IN: "in",
@@ -10267,10 +10297,10 @@ function Up(e) {
10267
10297
  CONTAINS: "contains"
10268
10298
  }[e] ?? e.toLowerCase();
10269
10299
  }
10270
- function Wp(e) {
10300
+ function Gp(e) {
10271
10301
  return e.toUpperCase() === "ENUM" ? "enum" : "async";
10272
10302
  }
10273
- function Gp(e, t) {
10303
+ function Kp(e, t) {
10274
10304
  let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials;
10275
10305
  function i(e) {
10276
10306
  let n = { ...e }, i = dr(t?.headers);
@@ -10300,7 +10330,7 @@ function Gp(e, t) {
10300
10330
  let r = await n(`${e}/observability/filters/definition`, i({ signal: t }));
10301
10331
  if (!r.ok) throw Error(`[gamma-lib-observability] HTTP ${r.status} on GET filters/definition`);
10302
10332
  return (await r.json()).data.map((e) => {
10303
- let t = Wp(e.type), n = e.operators.map(Up), r = e.type.toUpperCase(), i = e.apiTypes, o = e.signals;
10333
+ let t = Gp(e.type), n = e.operators.map(Wp), r = e.type.toUpperCase(), i = e.apiTypes, o = e.signals;
10304
10334
  if (t === "enum") {
10305
10335
  let r = (e.enumValues ?? []).map((e) => typeof e == "string" ? {
10306
10336
  value: e,
@@ -10355,9 +10385,9 @@ function Gp(e, t) {
10355
10385
  }
10356
10386
  //#endregion
10357
10387
  //#region src/data-sources/http-logs-source.ts
10358
- var Kp = "/observability/logs/search";
10359
- function qp(e, t) {
10360
- let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.searchPath ?? Kp;
10388
+ var qp = "/observability/logs/search";
10389
+ function Jp(e, t) {
10390
+ let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.searchPath ?? qp;
10361
10391
  function a(e) {
10362
10392
  let n = {
10363
10393
  method: "POST",
@@ -10411,30 +10441,30 @@ function qp(e, t) {
10411
10441
  }
10412
10442
  //#endregion
10413
10443
  //#region src/data-sources/http-traces-source.ts
10414
- var Jp = "/observability/traces/search";
10415
- function Yp(e) {
10444
+ var Yp = "/observability/traces/search";
10445
+ function Xp(e) {
10416
10446
  return e / 1e6;
10417
10447
  }
10418
- function Xp(e) {
10448
+ function Zp(e) {
10419
10449
  return e;
10420
10450
  }
10421
- function Zp(e) {
10451
+ function Qp(e) {
10422
10452
  return {
10423
10453
  name: e.name,
10424
10454
  timestampEpochMs: e.timestampEpochMs,
10425
- attributes: Xp(e.attributes)
10455
+ attributes: Zp(e.attributes)
10426
10456
  };
10427
10457
  }
10428
- function Qp(e) {
10458
+ function $p(e) {
10429
10459
  return {
10430
10460
  timestampEpochMs: e.timestampEpochMs,
10431
10461
  body: e.body,
10432
10462
  severity: e.severity,
10433
- attributes: Xp(e.attributes)
10463
+ attributes: Zp(e.attributes)
10434
10464
  };
10435
10465
  }
10436
- function $p(e) {
10437
- let t = Yp(e.durationNanos);
10466
+ function em(e) {
10467
+ let t = Xp(e.durationNanos);
10438
10468
  return {
10439
10469
  traceId: e.traceId,
10440
10470
  rootOperationName: e.rootOperationName,
@@ -10445,8 +10475,8 @@ function $p(e) {
10445
10475
  status: e.status
10446
10476
  };
10447
10477
  }
10448
- function em(e) {
10449
- let t = e.startTimeEpochMs, n = Yp(e.durationNanos);
10478
+ function tm(e) {
10479
+ let t = e.startTimeEpochMs, n = Xp(e.durationNanos);
10450
10480
  return {
10451
10481
  traceId: e.traceId,
10452
10482
  spanId: e.spanId,
@@ -10459,23 +10489,23 @@ function em(e) {
10459
10489
  status: e.status,
10460
10490
  kind: e.kind,
10461
10491
  attributes: e.attributes,
10462
- events: e.events.map(Zp),
10463
- payloadLogs: e.payloadLogs.map(Qp)
10492
+ events: e.events.map(Qp),
10493
+ payloadLogs: e.payloadLogs.map($p)
10464
10494
  };
10465
10495
  }
10466
- function tm(e) {
10467
- let t = e.spans.map(em);
10496
+ function nm(e) {
10497
+ let t = e.spans.map(tm);
10468
10498
  return {
10469
- ...$p(e),
10499
+ ...em(e),
10470
10500
  spanCount: t.length,
10471
10501
  spans: t
10472
10502
  };
10473
10503
  }
10474
- function nm(e) {
10504
+ function rm(e) {
10475
10505
  return e.endsWith("/search") ? e.slice(0, -7) : e;
10476
10506
  }
10477
- function rm(e, t) {
10478
- let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.searchPath ?? Jp, a = nm(i);
10507
+ function im(e, t) {
10508
+ let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.searchPath ?? Yp, a = rm(i);
10479
10509
  function o(e) {
10480
10510
  let n = {
10481
10511
  method: e,
@@ -10508,7 +10538,7 @@ function rm(e, t) {
10508
10538
  if (!u.ok) throw Error(`[gamma-lib-observability] HTTP ${u.status} on POST ${i}`);
10509
10539
  let d = await u.json();
10510
10540
  return {
10511
- entries: (d.data ?? []).map($p),
10541
+ entries: (d.data ?? []).map(em),
10512
10542
  totalCount: d.pagination?.totalCount,
10513
10543
  page: d.pagination?.page,
10514
10544
  pageCount: d.pagination?.pageCount
@@ -10519,13 +10549,13 @@ function rm(e, t) {
10519
10549
  t.signal && (i.signal = t.signal);
10520
10550
  let s = await n(r, i);
10521
10551
  if (!s.ok) throw Error(`[gamma-lib-observability] HTTP ${s.status} on GET ${a}/${t.traceId}`);
10522
- return tm(await s.json());
10552
+ return nm(await s.json());
10523
10553
  }
10524
10554
  };
10525
10555
  }
10526
10556
  //#endregion
10527
10557
  //#region src/routing/DashboardListPage.tsx
10528
- function im(e) {
10558
+ function am(e) {
10529
10559
  return new Date(e).toLocaleDateString(void 0, {
10530
10560
  month: "short",
10531
10561
  day: "numeric",
@@ -10533,7 +10563,7 @@ function im(e) {
10533
10563
  minute: "2-digit"
10534
10564
  });
10535
10565
  }
10536
- function am({ templates: t }) {
10566
+ function om({ templates: t }) {
10537
10567
  let n = e(), r = v("observability.dashboards.write"), i = s(), a = nd(), o = zn(), c = r && i !== null, l = k(() => Gs(t, n), [t, n]), u = k(() => {
10538
10568
  let e = l.map((e) => ({
10539
10569
  id: e.id,
@@ -10586,13 +10616,13 @@ function am({ templates: t }) {
10586
10616
  header: "Last updated",
10587
10617
  cell: ({ row: e }) => /* @__PURE__ */ N("span", {
10588
10618
  className: "text-muted-foreground",
10589
- children: e.original.updatedAt === void 0 ? "—" : im(e.original.updatedAt)
10619
+ children: e.original.updatedAt === void 0 ? "—" : am(e.original.updatedAt)
10590
10620
  })
10591
10621
  },
10592
10622
  {
10593
10623
  id: "actions",
10594
10624
  header: "",
10595
- cell: ({ row: e }) => /* @__PURE__ */ N(om, {
10625
+ cell: ({ row: e }) => /* @__PURE__ */ N(sm, {
10596
10626
  row: e.original,
10597
10627
  capabilities: n
10598
10628
  })
@@ -10617,17 +10647,17 @@ function am({ templates: t }) {
10617
10647
  })]
10618
10648
  });
10619
10649
  }
10620
- function om({ row: e, capabilities: t }) {
10621
- let n = zn(), r = v("observability.dashboards.write"), i = s(), a = id(), o = ld(), [c, l] = j(!1), u = r && i !== null, d = () => e.kind === "custom" ? e.dashboard ?? null : e.template ? Ws(e.template, { capabilities: t }) : null, f = async () => {
10650
+ function sm({ row: e, capabilities: t }) {
10651
+ let n = zn(), r = v("observability.dashboards.write"), i = s(), a = id(), o = ud(), [c, l] = j(!1), u = r && i !== null, d = () => e.kind === "custom" ? e.dashboard ?? null : e.template ? Ws(e.template, { capabilities: t }) : null, f = async () => {
10622
10652
  let e = d();
10623
10653
  if (e) try {
10624
- await navigator.clipboard.writeText(Kd(e)), X.success("Dashboard JSON copied to clipboard");
10654
+ await navigator.clipboard.writeText(qd(e)), X.success("Dashboard JSON copied to clipboard");
10625
10655
  } catch {
10626
10656
  X.error("Could not copy to clipboard");
10627
10657
  }
10628
10658
  }, p = () => {
10629
10659
  let e = d();
10630
- e && a.mutate(Fd(e), {
10660
+ e && a.mutate(Id(e), {
10631
10661
  onSuccess: (e) => {
10632
10662
  X.success(`Duplicated as "${e.title}"`), n(`${e.id}/edit`, { relative: "path" });
10633
10663
  },
@@ -10696,7 +10726,7 @@ function om({ row: e, capabilities: t }) {
10696
10726
  }
10697
10727
  //#endregion
10698
10728
  //#region src/routing/detail-filter.ts
10699
- function sm(e, t, n) {
10729
+ function cm(e, t, n) {
10700
10730
  let r = e.filter((e) => e.field !== t);
10701
10731
  return r.push({
10702
10732
  field: t,
@@ -10704,7 +10734,7 @@ function sm(e, t, n) {
10704
10734
  value: [n]
10705
10735
  }), r;
10706
10736
  }
10707
- function cm(e, t) {
10737
+ function lm(e, t) {
10708
10738
  let n = yi({
10709
10739
  conditions: [...e],
10710
10740
  timeRange: t
@@ -10713,9 +10743,9 @@ function cm(e, t) {
10713
10743
  }
10714
10744
  //#endregion
10715
10745
  //#region src/routing/LogsRouteElement.tsx
10716
- function lm({ columns: e, getRowId: t, getApiId: n, onRowClickOverride: r, detailConfig: i, detailMode: a, pageSize: o, scopeFilterField: s, columnVisibilityStorageKey: c, widget: l }) {
10746
+ function um({ columns: e, getRowId: t, getApiId: n, onRowClickOverride: r, detailConfig: i, detailMode: a, pageSize: o, scopeFilterField: s, columnVisibilityStorageKey: c, widget: l }) {
10717
10747
  let u = !r && !!i && !!t;
10718
- return u && a === "drawer" && i && t ? /* @__PURE__ */ N(um, {
10748
+ return u && a === "drawer" && i && t ? /* @__PURE__ */ N(dm, {
10719
10749
  columns: e,
10720
10750
  getRowId: t,
10721
10751
  getApiId: n,
@@ -10724,7 +10754,7 @@ function lm({ columns: e, getRowId: t, getApiId: n, onRowClickOverride: r, detai
10724
10754
  scopeFilterField: s,
10725
10755
  columnVisibilityStorageKey: c,
10726
10756
  widget: l
10727
- }) : /* @__PURE__ */ N(dm, {
10757
+ }) : /* @__PURE__ */ N(fm, {
10728
10758
  columns: e,
10729
10759
  getRowId: t,
10730
10760
  getApiId: n,
@@ -10736,7 +10766,7 @@ function lm({ columns: e, getRowId: t, getApiId: n, onRowClickOverride: r, detai
10736
10766
  widget: l
10737
10767
  });
10738
10768
  }
10739
- function um({ columns: e, getRowId: t, getApiId: n, detailConfig: r, pageSize: i, scopeFilterField: a, columnVisibilityStorageKey: o, widget: s }) {
10769
+ function dm({ columns: e, getRowId: t, getApiId: n, detailConfig: r, pageSize: i, scopeFilterField: a, columnVisibilityStorageKey: o, widget: s }) {
10740
10770
  let [c, l] = j(void 0), [u, d] = j(void 0), [f, p] = j([]), { filters: m, setFilters: h } = ic(), g = k(() => c ? f.findIndex((e) => t(e) === c) : -1, [
10741
10771
  c,
10742
10772
  f,
@@ -10744,7 +10774,7 @@ function um({ columns: e, getRowId: t, getApiId: n, detailConfig: r, pageSize: i
10744
10774
  ]), _ = D((e) => {
10745
10775
  l(t(e)), d(n?.(e));
10746
10776
  }, [t, n]), v = D((e, t) => {
10747
- h(sm(m, e, t)), l(void 0), d(void 0);
10777
+ h(cm(m, e, t)), l(void 0), d(void 0);
10748
10778
  }, [m, h]), y = D(() => {
10749
10779
  let e = f[g - 1];
10750
10780
  e && (l(t(e)), d(n?.(e)));
@@ -10786,7 +10816,7 @@ function um({ columns: e, getRowId: t, getApiId: n, detailConfig: r, pageSize: i
10786
10816
  hasNext: g >= 0 && g < f.length - 1
10787
10817
  })] });
10788
10818
  }
10789
- function dm({ columns: e, getRowId: t, getApiId: n, onRowClickOverride: r, builtInDetailEnabled: i, pageSize: a, scopeFilterField: o, columnVisibilityStorageKey: s, widget: c }) {
10819
+ function fm({ columns: e, getRowId: t, getApiId: n, onRowClickOverride: r, builtInDetailEnabled: i, pageSize: a, scopeFilterField: o, columnVisibilityStorageKey: s, widget: c }) {
10790
10820
  let l = zn(), { pathname: u } = Rn();
10791
10821
  return /* @__PURE__ */ N(Sc, {
10792
10822
  columns: e,
@@ -10816,7 +10846,7 @@ function dm({ columns: e, getRowId: t, getApiId: n, onRowClickOverride: r, built
10816
10846
  }
10817
10847
  //#endregion
10818
10848
  //#region src/dashboards/DashboardFilterValueForm.tsx
10819
- function fm({ condition: e, provider: t, activeApiTypes: n, onReset: r, onApply: i, onCancel: a }) {
10849
+ function pm({ condition: e, provider: t, activeApiTypes: n, onReset: r, onApply: i, onCancel: a }) {
10820
10850
  let [o, s] = j(() => ma(e.value, e.valueLabels)), [c, l] = j(e.value.join(", ")), u = !!(t?.kind === "enum" && t.options || t?.valueLoader), d = u ? o.length === 0 : c.trim() === "", f = t ? la(t, e.operator) : !1, p = Ea(e);
10821
10851
  function m() {
10822
10852
  let t = {
@@ -10894,13 +10924,13 @@ function fm({ condition: e, provider: t, activeApiTypes: n, onReset: r, onApply:
10894
10924
  }
10895
10925
  //#endregion
10896
10926
  //#region src/dashboards/DashboardFilterChips.tsx
10897
- function pm(e, t) {
10927
+ function mm(e, t) {
10898
10928
  if (e.length !== t.length) return !1;
10899
10929
  let n = [...t].sort();
10900
10930
  return [...e].sort().every((e, t) => e === n[t]);
10901
10931
  }
10902
- function mm({ lockedFilters: e, revaluableFilters: t, revaluableDefaults: n, providers: r, activeApiTypes: i, onRevalue: a, onResetRevalue: o }) {
10903
- return e.length === 0 && t.length === 0 ? null : /* @__PURE__ */ P(M, { children: [e.map((e) => /* @__PURE__ */ N(xd, {
10932
+ function hm({ lockedFilters: e, revaluableFilters: t, revaluableDefaults: n, providers: r, activeApiTypes: i, onRevalue: a, onResetRevalue: o }) {
10933
+ return e.length === 0 && t.length === 0 ? null : /* @__PURE__ */ P(M, { children: [e.map((e) => /* @__PURE__ */ N(Sd, {
10904
10934
  condition: {
10905
10935
  ...e,
10906
10936
  label: Aa(e, r)
@@ -10911,12 +10941,12 @@ function mm({ lockedFilters: e, revaluableFilters: t, revaluableDefaults: n, pro
10911
10941
  let s = r.find((t) => t.field === e.field), c = {
10912
10942
  ...e,
10913
10943
  label: Aa(e, r)
10914
- }, l = n?.[t], u = !!(l && !pm(l.value, e.value));
10915
- return /* @__PURE__ */ N(Sd, {
10944
+ }, l = n?.[t], u = !!(l && !mm(l.value, e.value));
10945
+ return /* @__PURE__ */ N(Cd, {
10916
10946
  condition: c,
10917
10947
  revaluable: !0,
10918
10948
  changedByReader: u,
10919
- renderForm: (t) => /* @__PURE__ */ N(fm, {
10949
+ renderForm: (t) => /* @__PURE__ */ N(pm, {
10920
10950
  condition: c,
10921
10951
  provider: s,
10922
10952
  activeApiTypes: i,
@@ -10933,20 +10963,20 @@ function mm({ lockedFilters: e, revaluableFilters: t, revaluableDefaults: n, pro
10933
10963
  }
10934
10964
  //#endregion
10935
10965
  //#region src/routing/ObservabilityDashboardPage.tsx
10936
- var hm = ["ANALYTICS"];
10937
- function gm(e) {
10966
+ var gm = ["ANALYTICS"];
10967
+ function _m(e) {
10938
10968
  let [t] = Vn(), n = qe(), r = t.get("live");
10939
10969
  return /* @__PURE__ */ N(ar, {
10940
10970
  config: {
10941
10971
  defaultEnabled: r === "1" || r === "true",
10942
10972
  onResume: D(() => n.invalidateQueries({ queryKey: Z.all }), [n])
10943
10973
  },
10944
- children: /* @__PURE__ */ N(_m, { ...e })
10974
+ children: /* @__PURE__ */ N(vm, { ...e })
10945
10975
  });
10946
10976
  }
10947
- function _m(t) {
10977
+ function vm(t) {
10948
10978
  let { dashboardId: n } = Bn(), r = e(), i = s(), a = k(() => Gs(t.templates, r), [t.templates, r]).find((e) => e.id === n), o = rd(a || !i ? void 0 : n), c = k(() => a ? Ws(a, { capabilities: r }) : null, [a, r]);
10949
- return a && c ? /* @__PURE__ */ N(vm, {
10979
+ return a && c ? /* @__PURE__ */ N(ym, {
10950
10980
  ...t,
10951
10981
  dashboard: c,
10952
10982
  kind: "template"
@@ -10957,7 +10987,7 @@ function _m(t) {
10957
10987
  /* @__PURE__ */ N(G, { className: "h-10 w-full" }),
10958
10988
  /* @__PURE__ */ N(G, { className: "h-[420px] w-full" })
10959
10989
  ]
10960
- }) : o.data ? /* @__PURE__ */ N(vm, {
10990
+ }) : o.data ? /* @__PURE__ */ N(ym, {
10961
10991
  ...t,
10962
10992
  dashboard: o.data,
10963
10993
  kind: "custom"
@@ -10966,14 +10996,14 @@ function _m(t) {
10966
10996
  children: n ? `Dashboard "${n}" not found.` : "No dashboard available."
10967
10997
  });
10968
10998
  }
10969
- function vm({ dashboard: e, kind: t, scopeFilterField: n, externalLinks: r }) {
10999
+ function ym({ dashboard: e, kind: t, scopeFilterField: n, externalLinks: r }) {
10970
11000
  let i = sr(), [, a] = Vn(), { timeRange: o, filters: s, setTimeRange: c, setFilters: l } = ic({ defaultTimeRange: t === "custom" ? e.timeRange : void 0 }), u = ur(), d = m(), { analyticsFilters: f, excludedFilters: p } = k(() => {
10971
11001
  let { matching: e, excluded: t } = Ri(s, d, "ANALYTICS");
10972
11002
  return {
10973
11003
  analyticsFilters: e,
10974
11004
  excludedFilters: t
10975
11005
  };
10976
- }, [s, d]), h = ei(k(() => [...e.filters, ...f], [e.filters, f]), u), _ = k(() => bd(h.slice(0, e.filters.length), h.slice(e.filters.length)), [h, e.filters.length]), { lockedChips: v, revaluableChips: y, userOwnFilters: b } = _, x = _.effectiveFilters, S = k(() => _.governedFields.size === 0 ? d : d.filter((e) => !_.governedFields.has(e.field)), [d, _.governedFields]), C = Ma(n), w = D((e) => {
11006
+ }, [s, d]), h = ei(k(() => [...e.filters, ...f], [e.filters, f]), u), _ = k(() => xd(h.slice(0, e.filters.length), h.slice(e.filters.length)), [h, e.filters.length]), { lockedChips: v, revaluableChips: y, userOwnFilters: b } = _, x = _.effectiveFilters, S = k(() => _.governedFields.size === 0 ? d : d.filter((e) => !_.governedFields.has(e.field)), [d, _.governedFields]), C = Ma(n), w = D((e) => {
10977
11007
  l([
10978
11008
  ...e,
10979
11009
  ..._.userRevalues,
@@ -10987,22 +11017,22 @@ function vm({ dashboard: e, kind: t, scopeFilterField: n, externalLinks: r }) {
10987
11017
  l(s.filter((t) => t.field !== e));
10988
11018
  }, [s, l]), te = D((e, t) => {
10989
11019
  l([...s.filter((t) => t.field !== e), t]);
10990
- }, [s, l]), T = i?.isLive ?? !1;
11020
+ }, [s, l]), ne = i?.isLive ?? !1;
10991
11021
  O(() => {
10992
11022
  a((e) => {
10993
11023
  let t = e.has("live");
10994
- if (T && !t) {
11024
+ if (ne && !t) {
10995
11025
  let t = new URLSearchParams(e);
10996
11026
  return t.set("live", "1"), t;
10997
11027
  }
10998
- if (!T && t) {
11028
+ if (!ne && t) {
10999
11029
  let t = new URLSearchParams(e);
11000
11030
  return t.delete("live"), t;
11001
11031
  }
11002
11032
  return e;
11003
11033
  }, { replace: !0 });
11004
- }, [T, a]);
11005
- let ne = D((e) => {
11034
+ }, [ne, a]);
11035
+ let re = D((e) => {
11006
11036
  e.type === "absolute" && i?.isLive && i.toggle(), c(e);
11007
11037
  }, [c, i]);
11008
11038
  return /* @__PURE__ */ P("div", {
@@ -11025,7 +11055,7 @@ function vm({ dashboard: e, kind: t, scopeFilterField: n, externalLinks: r }) {
11025
11055
  className: "mt-0.5 truncate text-xs text-muted-foreground",
11026
11056
  children: e.description
11027
11057
  })]
11028
- }), /* @__PURE__ */ N(ym, {
11058
+ }), /* @__PURE__ */ N(bm, {
11029
11059
  dashboard: e,
11030
11060
  kind: t
11031
11061
  })]
@@ -11041,8 +11071,8 @@ function vm({ dashboard: e, kind: t, scopeFilterField: n, externalLinks: r }) {
11041
11071
  filters: b,
11042
11072
  onFiltersChange: w,
11043
11073
  scopeFilterField: n,
11044
- visibleSignals: hm,
11045
- leadingChips: /* @__PURE__ */ N(mm, {
11074
+ visibleSignals: gm,
11075
+ leadingChips: /* @__PURE__ */ N(hm, {
11046
11076
  lockedFilters: v,
11047
11077
  revaluableFilters: y,
11048
11078
  revaluableDefaults: _.revaluableDefaults,
@@ -11062,7 +11092,7 @@ function vm({ dashboard: e, kind: t, scopeFilterField: n, externalLinks: r }) {
11062
11092
  /* @__PURE__ */ N(J, { children: /* @__PURE__ */ N(rc, {}) }),
11063
11093
  /* @__PURE__ */ N(ki, {
11064
11094
  value: o,
11065
- onChange: ne
11095
+ onChange: re
11066
11096
  })
11067
11097
  ]
11068
11098
  }),
@@ -11074,15 +11104,15 @@ function vm({ dashboard: e, kind: t, scopeFilterField: n, externalLinks: r }) {
11074
11104
  ]
11075
11105
  });
11076
11106
  }
11077
- function ym({ dashboard: e, kind: t }) {
11078
- let n = zn(), r = Rn(), i = v("observability.dashboards.write"), a = s(), o = id(), c = ld(), [l, u] = j(!1), d = i && a !== null, f = async () => {
11107
+ function bm({ dashboard: e, kind: t }) {
11108
+ let n = zn(), r = Rn(), i = v("observability.dashboards.write"), a = s(), o = id(), c = ud(), [l, u] = j(!1), d = i && a !== null, f = async () => {
11079
11109
  try {
11080
- await navigator.clipboard.writeText(Kd(e)), X.success("Dashboard JSON copied to clipboard");
11110
+ await navigator.clipboard.writeText(qd(e)), X.success("Dashboard JSON copied to clipboard");
11081
11111
  } catch {
11082
11112
  X.error("Could not copy to clipboard");
11083
11113
  }
11084
11114
  }, p = () => {
11085
- o.mutate(Fd(e), {
11115
+ o.mutate(Id(e), {
11086
11116
  onSuccess: (e) => {
11087
11117
  X.success(`Duplicated as "${e.title}"`), n(`../${e.id}/edit`, { relative: "path" });
11088
11118
  },
@@ -11153,7 +11183,7 @@ function ym({ dashboard: e, kind: t }) {
11153
11183
  }
11154
11184
  //#endregion
11155
11185
  //#region src/data-sources/http-traces-filter-source.ts
11156
- function bm(e) {
11186
+ function xm(e) {
11157
11187
  return {
11158
11188
  EQ: "eq",
11159
11189
  IN: "in",
@@ -11166,11 +11196,11 @@ function bm(e) {
11166
11196
  CONTAINS: "contains"
11167
11197
  }[e] ?? e.toLowerCase();
11168
11198
  }
11169
- function xm(e) {
11199
+ function Sm(e) {
11170
11200
  let t = e.toUpperCase();
11171
11201
  return t === "ENUM" || t === "BOOLEAN" ? "enum" : "async";
11172
11202
  }
11173
- function Sm(e, t) {
11203
+ function Cm(e, t) {
11174
11204
  let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.module;
11175
11205
  function a(e) {
11176
11206
  let n = { ...e }, i = dr(t?.headers);
@@ -11200,7 +11230,7 @@ function Sm(e, t) {
11200
11230
  let r = await n(`${e}/observability/traces/filters/definition`, a({ signal: t }));
11201
11231
  if (!r.ok) throw Error(`[gamma-lib-observability] HTTP ${r.status} on GET traces/filters/definition`);
11202
11232
  return (await r.json()).data.map((e) => {
11203
- let t = xm(e.type), n = e.operators.map(bm), r = e.type.toUpperCase();
11233
+ let t = Sm(e.type), n = e.operators.map(xm), r = e.type.toUpperCase();
11204
11234
  if (r === "BOOLEAN") return {
11205
11235
  field: e.name,
11206
11236
  label: e.label,
@@ -11250,8 +11280,8 @@ function Sm(e, t) {
11250
11280
  }
11251
11281
  //#endregion
11252
11282
  //#region src/routing/TracingFilterProvider.tsx
11253
- function Cm({ baseUrl: e, http: t, module: n, children: r }) {
11254
- let i = k(() => Sm(e, {
11283
+ function wm({ baseUrl: e, http: t, module: n, children: r }) {
11284
+ let i = k(() => Cm(e, {
11255
11285
  ...t,
11256
11286
  module: n
11257
11287
  }), [
@@ -11273,15 +11303,15 @@ function Cm({ baseUrl: e, http: t, module: n, children: r }) {
11273
11303
  }
11274
11304
  //#endregion
11275
11305
  //#region src/routing/TracesRouteElement.tsx
11276
- function wm({ detailMode: e, pageSize: t, columnVisibilityStorageKey: n, toolbarStart: r, emptyVariant: i }) {
11277
- return N(e === "drawer" ? Tm : Em, {
11306
+ function Tm({ detailMode: e, pageSize: t, columnVisibilityStorageKey: n, toolbarStart: r, emptyVariant: i }) {
11307
+ return N(e === "drawer" ? Em : Dm, {
11278
11308
  pageSize: t,
11279
11309
  columnVisibilityStorageKey: n,
11280
11310
  toolbarStart: r,
11281
11311
  emptyVariant: i
11282
11312
  });
11283
11313
  }
11284
- function Tm({ pageSize: e, columnVisibilityStorageKey: t, toolbarStart: n, emptyVariant: r }) {
11314
+ function Em({ pageSize: e, columnVisibilityStorageKey: t, toolbarStart: n, emptyVariant: r }) {
11285
11315
  let { apiId: i } = Bn(), [a, o] = j(void 0), [s, c] = j([]), l = k(() => a ? s.findIndex((e) => e.traceId === a) : -1, [a, s]), u = D((e) => o(e.traceId), []), d = D(() => o(void 0), []), f = D(() => {
11286
11316
  let e = s[l - 1];
11287
11317
  e && o(e.traceId);
@@ -11307,7 +11337,7 @@ function Tm({ pageSize: e, columnVisibilityStorageKey: t, toolbarStart: n, empty
11307
11337
  hasNext: l >= 0 && l < s.length - 1
11308
11338
  })] });
11309
11339
  }
11310
- function Em({ pageSize: e, columnVisibilityStorageKey: t, toolbarStart: n, emptyVariant: r }) {
11340
+ function Dm({ pageSize: e, columnVisibilityStorageKey: t, toolbarStart: n, emptyVariant: r }) {
11311
11341
  let i = zn(), { pathname: a } = Rn(), { apiId: o } = Bn();
11312
11342
  return /* @__PURE__ */ N(Ll, {
11313
11343
  onRowClick: k(() => {
@@ -11327,7 +11357,7 @@ function Em({ pageSize: e, columnVisibilityStorageKey: t, toolbarStart: n, empty
11327
11357
  }
11328
11358
  //#endregion
11329
11359
  //#region src/routing/TracingScreen.tsx
11330
- function Dm(e) {
11360
+ function Om(e) {
11331
11361
  let t = e !== void 0 && Xl(e), n = F({
11332
11362
  queryKey: Z.tracingApis(),
11333
11363
  queryFn: ({ signal: t }) => e(t),
@@ -11351,19 +11381,19 @@ function Dm(e) {
11351
11381
  refetch: () => {}
11352
11382
  };
11353
11383
  }
11354
- function Om(e) {
11384
+ function km(e) {
11355
11385
  return k(() => {
11356
11386
  if (!(e === void 0 || !Ql(e))) return Zl(e);
11357
11387
  }, [e]);
11358
11388
  }
11359
- function km({ loadTracingApis: e, detailMode: t = "drawer", pageSize: n, columnVisibilityStorageKey: r }) {
11360
- let { apiId: i } = Bn(), a = zn(), { pathname: o } = Rn(), { options: s, loading: c, error: l, refetch: u } = Dm(e), d = Om(e), f = e !== void 0, p = k(() => {
11389
+ function Am({ loadTracingApis: e, detailMode: t = "drawer", pageSize: n, columnVisibilityStorageKey: r }) {
11390
+ let { apiId: i } = Bn(), a = zn(), { pathname: o } = Rn(), { options: s, loading: c, error: l, refetch: u } = Om(e), d = km(e), f = e !== void 0, p = k(() => {
11361
11391
  let e = o.replace(/\/+$/, "");
11362
11392
  if (!i) return e;
11363
11393
  let t = e.lastIndexOf("/");
11364
11394
  return t > 0 ? e.slice(0, t) : e;
11365
11395
  }, [o, i]), m = D((e) => a(`${p}/${encodeURIComponent(e)}`), [a, p]);
11366
- return /* @__PURE__ */ N(wm, {
11396
+ return /* @__PURE__ */ N(Tm, {
11367
11397
  detailMode: t,
11368
11398
  pageSize: n,
11369
11399
  columnVisibilityStorageKey: r,
@@ -11385,9 +11415,9 @@ function km({ loadTracingApis: e, detailMode: t = "drawer", pageSize: n, columnV
11385
11415
  }
11386
11416
  //#endregion
11387
11417
  //#region src/routing/ObservabilityRoutes.tsx
11388
- var Am = [];
11389
- function jm(e, t) {
11390
- let n = e?.scopeApiTypes ?? t, r = e?.contextFilters ?? Am, i = e?.scopeFilterField;
11418
+ var jm = [];
11419
+ function Mm(e, t) {
11420
+ let n = e?.scopeApiTypes ?? t, r = e?.contextFilters ?? jm, i = e?.scopeFilterField;
11391
11421
  return n?.length && (i ||= "API_TYPE", r.some((e) => e.field === "API_TYPE") || (r = [{
11392
11422
  field: "API_TYPE",
11393
11423
  operator: "in",
@@ -11397,28 +11427,28 @@ function jm(e, t) {
11397
11427
  scopeFilterField: i
11398
11428
  };
11399
11429
  }
11400
- function Mm(e, t, n) {
11430
+ function Nm(e, t, n) {
11401
11431
  return e ? /* @__PURE__ */ N(_, {
11402
11432
  dataSource: t,
11403
11433
  children: n
11404
11434
  }) : n;
11405
11435
  }
11406
- function Nm(e, t, n) {
11436
+ function Pm(e, t, n) {
11407
11437
  return e ? /* @__PURE__ */ N(c, {
11408
11438
  dataSource: t,
11409
11439
  children: n
11410
11440
  }) : n;
11411
11441
  }
11412
- function Pm({ children: e }) {
11442
+ function Fm({ children: e }) {
11413
11443
  let t = ur(), { data: n, isLoading: r, isError: i } = F({
11414
11444
  queryKey: ["observability", "filter-definitions"],
11415
11445
  queryFn: ({ signal: e }) => t.fetchFilterDefinitions(e),
11416
11446
  enabled: !!t,
11417
11447
  staleTime: 300 * 1e3
11418
11448
  });
11419
- return r ? /* @__PURE__ */ N(Fm, {}) : i || !n ? /* @__PURE__ */ N(M, { children: e([]) }) : /* @__PURE__ */ N(M, { children: e(n) });
11449
+ return r ? /* @__PURE__ */ N(Im, {}) : i || !n ? /* @__PURE__ */ N(M, { children: e([]) }) : /* @__PURE__ */ N(M, { children: e(n) });
11420
11450
  }
11421
- function Fm() {
11451
+ function Im() {
11422
11452
  return /* @__PURE__ */ P("div", {
11423
11453
  className: "flex items-center gap-2 p-4",
11424
11454
  children: [
@@ -11428,26 +11458,26 @@ function Fm() {
11428
11458
  ]
11429
11459
  });
11430
11460
  }
11431
- function Im({ baseUrl: e, http: t, children: n }) {
11461
+ function Lm({ baseUrl: e, http: t, children: n }) {
11432
11462
  let { apiId: r } = Bn();
11433
- return /* @__PURE__ */ N(Cm, {
11463
+ return /* @__PURE__ */ N(wm, {
11434
11464
  baseUrl: e,
11435
11465
  http: t,
11436
11466
  module: r,
11437
11467
  children: n
11438
11468
  });
11439
11469
  }
11440
- function Lm({ templates: t, contextFilters: n }) {
11470
+ function Rm({ templates: t, contextFilters: n }) {
11441
11471
  let r = e(), i = s(), a = nd(), o = k(() => Gs(t, r), [t, r]), c = r["observability.dashboards.write"] && i !== null, l = i !== null && a.isLoading, u = (a.data?.length ?? 0) > 0;
11442
11472
  return !c && !l && !u && o.length === 1 && o[0] ? /* @__PURE__ */ N(Fn, {
11443
11473
  to: `./${o[0].id}`,
11444
11474
  replace: !0
11445
11475
  }) : l && !c ? null : /* @__PURE__ */ N(Mr, {
11446
11476
  filters: n,
11447
- children: /* @__PURE__ */ N(am, { templates: t })
11477
+ children: /* @__PURE__ */ N(om, { templates: t })
11448
11478
  });
11449
11479
  }
11450
- function Rm({ contextFilters: t, scopeFilterField: n }) {
11480
+ function zm({ contextFilters: t, scopeFilterField: n }) {
11451
11481
  let r = e(), i = s();
11452
11482
  return !r["observability.dashboards.write"] || i === null ? /* @__PURE__ */ N(Fn, {
11453
11483
  to: "..",
@@ -11455,27 +11485,27 @@ function Rm({ contextFilters: t, scopeFilterField: n }) {
11455
11485
  relative: "path"
11456
11486
  }) : /* @__PURE__ */ N(Mr, {
11457
11487
  filters: t,
11458
- children: /* @__PURE__ */ N(pp, { scopeFilterField: n })
11488
+ children: /* @__PURE__ */ N(mp, { scopeFilterField: n })
11459
11489
  });
11460
11490
  }
11461
- function zm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProviders: c, logsPage: u, logsDataSource: d, logsColumns: f, logsOnRowClick: m, logsGetRowId: _, logsGetApiId: v, logsDetailBasePath: y, tracesDataSource: b, loadTracingApis: x, config: S }) {
11462
- let C = hr(), w = gr(i ?? C), ee = e(), te = l(), T = k(() => Hp(n, w), [n, w]), ne = o !== void 0 || te === null, re = o ?? te ?? T, ie = k(() => Gp(n, w), [n, w]), ae = a(), oe = k(() => S.features.logs?.enabled ? qp(n, w) : void 0, [
11491
+ function Bm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProviders: c, logsPage: u, logsDataSource: d, logsColumns: f, logsOnRowClick: m, logsGetRowId: _, logsGetApiId: v, logsDetailBasePath: y, tracesDataSource: b, loadTracingApis: x, config: S }) {
11492
+ let C = hr(), w = gr(i ?? C), ee = e(), te = l(), ne = k(() => Up(n, w), [n, w]), re = o !== void 0 || te === null, T = o ?? te ?? ne, ie = k(() => Kp(n, w), [n, w]), ae = a(), oe = k(() => S.features.logs?.enabled ? Jp(n, w) : void 0, [
11463
11493
  n,
11464
11494
  w,
11465
11495
  S.features.logs?.enabled
11466
- ]), se = d ?? ae ?? oe, ce = d !== void 0 || ae === null, le = t(), E = r ?? n, ue = k(() => S.features.tracing?.enabled ? rm(E, w) : void 0, [
11496
+ ]), se = d ?? ae ?? oe, ce = d !== void 0 || ae === null, le = t(), E = r ?? n, ue = k(() => S.features.tracing?.enabled ? im(E, w) : void 0, [
11467
11497
  E,
11468
11498
  w,
11469
11499
  S.features.tracing?.enabled
11470
11500
  ]), de = b ?? le ?? ue, fe = b !== void 0 || le === null, pe = S.features.dashboards, me = s(), [he, ge] = j(() => ({
11471
11501
  baseUrl: n,
11472
- store: vp()
11502
+ store: yp()
11473
11503
  }));
11474
11504
  he.baseUrl !== n && ge({
11475
11505
  baseUrl: n,
11476
- store: vp()
11506
+ store: yp()
11477
11507
  });
11478
- let _e = k(() => pe?.enabled ? Ap(n, {
11508
+ let _e = k(() => pe?.enabled ? jp(n, {
11479
11509
  ...w,
11480
11510
  revisionStore: he.store
11481
11511
  }) : void 0, [
@@ -11483,7 +11513,7 @@ function zm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
11483
11513
  w,
11484
11514
  pe?.enabled,
11485
11515
  he
11486
- ]), ve = me ?? _e, ye = me === null, be = S.features.logs, xe = S.features.tracing, Se = jm(pe, S.scopeApiTypes), Ce = jm(be, S.scopeApiTypes), we = be?.enabled, Te = be?.logDetail, Ee = k(() => {
11516
+ ]), ve = me ?? _e, ye = me === null, be = S.features.logs, xe = S.features.tracing, Se = Mm(pe, S.scopeApiTypes), Ce = Mm(be, S.scopeApiTypes), we = be?.enabled, Te = be?.logDetail, Ee = k(() => {
11487
11517
  if (we) return Te || rl({ basePath: y ?? "" });
11488
11518
  }, [
11489
11519
  we,
@@ -11495,21 +11525,21 @@ function zm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
11495
11525
  pe?.enabled && /* @__PURE__ */ P(M, { children: [
11496
11526
  /* @__PURE__ */ N(In, {
11497
11527
  path: "dashboards",
11498
- element: /* @__PURE__ */ N(Lm, {
11528
+ element: /* @__PURE__ */ N(Rm, {
11499
11529
  templates: pe.templates,
11500
11530
  contextFilters: Se.contextFilters
11501
11531
  })
11502
11532
  }),
11503
11533
  /* @__PURE__ */ N(In, {
11504
11534
  path: "dashboards/new",
11505
- element: /* @__PURE__ */ N(Rm, {
11535
+ element: /* @__PURE__ */ N(zm, {
11506
11536
  contextFilters: Se.contextFilters,
11507
11537
  scopeFilterField: Se.scopeFilterField
11508
11538
  })
11509
11539
  }),
11510
11540
  /* @__PURE__ */ N(In, {
11511
11541
  path: "dashboards/:dashboardId/edit",
11512
- element: /* @__PURE__ */ N(Rm, {
11542
+ element: /* @__PURE__ */ N(zm, {
11513
11543
  contextFilters: Se.contextFilters,
11514
11544
  scopeFilterField: Se.scopeFilterField
11515
11545
  })
@@ -11518,7 +11548,7 @@ function zm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
11518
11548
  path: "dashboards/:dashboardId",
11519
11549
  element: /* @__PURE__ */ N(Mr, {
11520
11550
  filters: Se.contextFilters,
11521
- children: /* @__PURE__ */ N(gm, {
11551
+ children: /* @__PURE__ */ N(_m, {
11522
11552
  templates: pe.templates,
11523
11553
  scopeFilterField: Se.scopeFilterField,
11524
11554
  externalLinks: pe.externalLinks
@@ -11530,7 +11560,7 @@ function zm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
11530
11560
  path: "logs",
11531
11561
  element: /* @__PURE__ */ N(Mr, {
11532
11562
  filters: Ce.contextFilters,
11533
- children: u ?? (se ? Mm(ce, se, /* @__PURE__ */ N(lm, {
11563
+ children: u ?? (se ? Nm(ce, se, /* @__PURE__ */ N(um, {
11534
11564
  columns: Oe,
11535
11565
  getRowId: ke,
11536
11566
  getApiId: Ae,
@@ -11551,16 +11581,16 @@ function zm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
11551
11581
  path: "logs/:logId",
11552
11582
  element: /* @__PURE__ */ N(Mr, {
11553
11583
  filters: Ce.contextFilters,
11554
- children: Mm(ce, se, /* @__PURE__ */ N(Bm, { config: Ee }))
11584
+ children: Nm(ce, se, /* @__PURE__ */ N(Vm, { config: Ee }))
11555
11585
  })
11556
11586
  }),
11557
11587
  xe?.enabled && ee["observability.traces.read"] && de && /* @__PURE__ */ P(M, { children: [
11558
11588
  /* @__PURE__ */ N(In, {
11559
11589
  path: "tracing",
11560
- element: Nm(fe, de, /* @__PURE__ */ N(Im, {
11590
+ element: Pm(fe, de, /* @__PURE__ */ N(Lm, {
11561
11591
  baseUrl: E,
11562
11592
  http: w,
11563
- children: /* @__PURE__ */ N(km, {
11593
+ children: /* @__PURE__ */ N(Am, {
11564
11594
  loadTracingApis: x,
11565
11595
  detailMode: xe.detailMode ?? "drawer",
11566
11596
  pageSize: xe.pageSize,
@@ -11570,10 +11600,10 @@ function zm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
11570
11600
  }),
11571
11601
  /* @__PURE__ */ N(In, {
11572
11602
  path: "tracing/:apiId",
11573
- element: Nm(fe, de, /* @__PURE__ */ N(Im, {
11603
+ element: Pm(fe, de, /* @__PURE__ */ N(Lm, {
11574
11604
  baseUrl: E,
11575
11605
  http: w,
11576
- children: /* @__PURE__ */ N(km, {
11606
+ children: /* @__PURE__ */ N(Am, {
11577
11607
  loadTracingApis: x,
11578
11608
  detailMode: xe.detailMode ?? "drawer",
11579
11609
  pageSize: xe.pageSize,
@@ -11583,7 +11613,7 @@ function zm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
11583
11613
  }),
11584
11614
  /* @__PURE__ */ N(In, {
11585
11615
  path: "tracing/:apiId/:traceId",
11586
- element: Nm(fe, de, /* @__PURE__ */ N(zu, {}))
11616
+ element: Pm(fe, de, /* @__PURE__ */ N(zu, {}))
11587
11617
  })
11588
11618
  ] }),
11589
11619
  /* @__PURE__ */ N(In, {
@@ -11605,24 +11635,24 @@ function zm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
11605
11635
  ] })
11606
11636
  }), Me = /* @__PURE__ */ N(ar, { children: pe?.enabled || be?.enabled ? /* @__PURE__ */ N(lr, {
11607
11637
  source: ie,
11608
- children: c ? je(c) : /* @__PURE__ */ N(Pm, { children: (e) => je(e) })
11638
+ children: c ? je(c) : /* @__PURE__ */ N(Fm, { children: (e) => je(e) })
11609
11639
  }) : je(c ?? []) }), Ne = ye && ve ? /* @__PURE__ */ N(p, {
11610
11640
  persistence: ve,
11611
11641
  children: Me
11612
11642
  }) : Me;
11613
- return ne ? /* @__PURE__ */ N(h, {
11614
- dataSource: re,
11643
+ return re ? /* @__PURE__ */ N(h, {
11644
+ dataSource: T,
11615
11645
  children: Ne
11616
11646
  }) : Ne;
11617
11647
  }
11618
- function Bm({ config: e }) {
11648
+ function Vm({ config: e }) {
11619
11649
  let t = zn(), { filters: n, timeRange: r } = ic();
11620
11650
  return /* @__PURE__ */ N(Dl, {
11621
11651
  config: e,
11622
11652
  onFilter: D((e, i) => {
11623
11653
  t({
11624
11654
  pathname: "..",
11625
- search: cm(sm(n, e, i), r)
11655
+ search: lm(cm(n, e, i), r)
11626
11656
  }, { relative: "path" });
11627
11657
  }, [
11628
11658
  n,
@@ -11633,9 +11663,9 @@ function Bm({ config: e }) {
11633
11663
  }
11634
11664
  //#endregion
11635
11665
  //#region src/routing/define-observability-features.ts
11636
- var Vm = {
11666
+ var Hm = {
11637
11667
  dashboards: {
11638
- icon: re,
11668
+ icon: T,
11639
11669
  title: "Dashboards",
11640
11670
  order: 0,
11641
11671
  showInNav: !0
@@ -11653,10 +11683,10 @@ var Vm = {
11653
11683
  showInNav: !0
11654
11684
  }
11655
11685
  };
11656
- function Hm(e) {
11657
- let t = e.basePath ?? "observe", n = Um(e), r = Wm(e, n, t), i = n.map((e) => `${t}/${e}`), a = Gm(n, t);
11686
+ function Um(e) {
11687
+ let t = e.basePath ?? "observe", n = Wm(e), r = Gm(e, n, t), i = n.map((e) => `${t}/${e}`), a = Km(n, t);
11658
11688
  function o(t) {
11659
- return Fe(zm, {
11689
+ return Fe(Bm, {
11660
11690
  ...t,
11661
11691
  config: e
11662
11692
  });
@@ -11685,13 +11715,13 @@ function Hm(e) {
11685
11715
  breadcrumbSegments: c
11686
11716
  };
11687
11717
  }
11688
- function Um(e) {
11718
+ function Wm(e) {
11689
11719
  let t = [];
11690
- return e.features.dashboards?.enabled && t.push("dashboards"), e.features.logs?.enabled && t.push("logs"), e.features.tracing?.enabled && t.push("tracing"), t.sort((e, t) => Vm[e].order - Vm[t].order);
11720
+ return e.features.dashboards?.enabled && t.push("dashboards"), e.features.logs?.enabled && t.push("logs"), e.features.tracing?.enabled && t.push("tracing"), t.sort((e, t) => Hm[e].order - Hm[t].order);
11691
11721
  }
11692
- function Wm(e, t, n) {
11693
- let r = t.filter((e) => Vm[e].showInNav).map((t) => {
11694
- let r = Vm[t], i = e.nav.overrides?.[t];
11722
+ function Gm(e, t, n) {
11723
+ let r = t.filter((e) => Hm[e].showInNav).map((t) => {
11724
+ let r = Hm[t], i = e.nav.overrides?.[t];
11695
11725
  return {
11696
11726
  key: `${n}/${t}`,
11697
11727
  title: i?.title ?? r.title,
@@ -11703,10 +11733,10 @@ function Wm(e, t, n) {
11703
11733
  items: r
11704
11734
  };
11705
11735
  }
11706
- function Gm(e, t) {
11736
+ function Km(e, t) {
11707
11737
  let n = {};
11708
11738
  for (let r of e) {
11709
- let e = Vm[r], i = `${t}/${r}`;
11739
+ let e = Hm[r], i = `${t}/${r}`;
11710
11740
  n[i] = {
11711
11741
  path: `${t}/${r}`,
11712
11742
  label: e.title
@@ -11716,7 +11746,7 @@ function Gm(e, t) {
11716
11746
  }
11717
11747
  //#endregion
11718
11748
  //#region src/build-observability-base-url.ts
11719
- function Km(e, t, n, r) {
11749
+ function qm(e, t, n, r) {
11720
11750
  let i = e;
11721
11751
  if (r?.useDevProxy) try {
11722
11752
  i = new URL(i).pathname;
@@ -11725,21 +11755,21 @@ function Km(e, t, n, r) {
11725
11755
  }
11726
11756
  //#endregion
11727
11757
  //#region src/build-traces-base-url.ts
11728
- function qm(e, t, n, r) {
11729
- return Km(e, t, n, r);
11758
+ function Jm(e, t, n, r) {
11759
+ return qm(e, t, n, r);
11730
11760
  }
11731
11761
  //#endregion
11732
11762
  //#region src/persistence/local-storage-dashboard-persistence.ts
11733
- var Jm = "observability.custom-dashboards", Ym = 1;
11734
- function Xm(e = {}) {
11735
- let t = e.storageKey ?? Jm, n = () => {
11763
+ var Ym = "observability.custom-dashboards", Xm = 1;
11764
+ function Zm(e = {}) {
11765
+ let t = e.storageKey ?? Ym, n = () => {
11736
11766
  if (e.storage) return e.storage;
11737
11767
  if (typeof window > "u" || !window.localStorage) throw Error("[gamma-lib-observability] localStorage is not available in this environment.");
11738
11768
  return window.localStorage;
11739
11769
  }, r = () => {
11740
11770
  let e = n().getItem(t);
11741
11771
  if (!e) return {
11742
- version: Ym,
11772
+ version: Xm,
11743
11773
  dashboards: {}
11744
11774
  };
11745
11775
  let r = JSON.parse(e);
@@ -11802,4 +11832,4 @@ function Xm(e = {}) {
11802
11832
  };
11803
11833
  }
11804
11834
  //#endregion
11805
- export { Hn as API_TYPE_REGISTRY, xo as BarPresentation, pi as CODEC_VERSION, o as CapabilityProvider, ls as CartesianPresentation, Mr as ContextFiltersProvider, ss as DASHBOARD_BUCKET_TARGET, y as DEFAULT_CAPABILITIES, tr as DEFAULT_MEASURE, oi as DEFAULT_PERIOD, rr as DEFAULT_REFRESH_INTERVAL_MS, _r as DEFAULT_STALE_TIME, mi as DEFAULT_TIME_RANGE, Gu as DashboardConflictError, Uu as DashboardForbiddenError, Wu as DashboardNotFoundError, Hu as DashboardPersistenceError, p as DashboardPersistenceProvider, qs as DashboardTemplatesProvider, zs as DashboardView, gs as DoughnutPresentation, ec as ExplorerTable, n as FILTER_OPERATORS, Pi as FILTER_SCOPES, Ha as FilterBar, ka as FilterChip, ya as FilterPopoverForm, Ki as FilterPropertyCombobox, g as FilterProvidersProvider, $a as HTTP_STATUS_PALETTE, mr as HttpProvider, rc as LiveIndicator, ar as LiveRefreshProvider, Q as LogDetailCodeBlock, cl as LogDetailContextChart, Tl as LogDetailDrawer, pl as LogDetailDrawerShell, Ac as LogDetailEmptyField, _l as LogDetailHeader, jc as LogDetailHeadersTable, Mc as LogDetailJsonTree, $ as LogDetailKeyValueGrid, vl as LogDetailMetrics, Dl as LogDetailPage, xl as LogDetailSection, bl as LogDetailSections, cc as LogSeverityBadge, vc as LogTable, _ as LogsDataSourceProvider, Sc as LogsExplorerPage, xs as MetricGroupPresentation, Es as MetricPresentation, h as MetricsDataSourceProvider, ui as PERIOD_DISPLAY_LABELS, li as PERIOD_LABELS, cu as POLICY_POST_EVENT, su as POLICY_PRE_EVENT, si as PRESET_CATEGORIES, iu as PolicyAttributeDiff, tc as QueryErrorBanner, ci as RELATIVE_PERIODS, Ni as SCOPE_COMMON, Mi as SIGNAL_DATA_TYPES, qn as SIGNAL_REGISTRY, gu as SpanDetailPanel, ki as TimeRangePicker, Bu as TraceDetailDrawer, zu as TraceDetailPage, Pu as TraceDetailShell, Ll as TraceExplorerPage, Eu as TraceLineage, kl as TraceStatusBadge, Fl as TraceTable, Mu as TraceTimeline, c as TracesDataSourceProvider, ql as TracingApiSelector, km as TracingScreen, Hs as WidgetGroup, Fs as WidgetItem, Ec as buildApiTypeLink, Ta as buildChipLabel, Ea as buildChipLabelParts, Da as buildChipTooltip, Dc as buildDefaultConnectionLogColumns, rl as buildDefaultLogDetailConfig, Hi as buildFilterScopes, Cc as buildLogsDeepLink, Km as buildObservabilityBaseUrl, Ii as buildScopeFromId, qm as buildTracesBaseUrl, $l as buildTracesDeepLink, js as clearWidgetRenderers, cs as computeBucketInterval, pu as computePolicyAttributeDiff, jo as computePreviousTimeRange, To as computeTrend, Ic as connectionLogPreset, vp as createDashboardRevisionStore, Ap as createHttpDashboardPersistence, Hp as createHttpDataSource, Gp as createHttpFilterSource, qp as createHttpLogsSource, Sm as createHttpTracesFilterSource, rm as createHttpTracesSource, Xm as createLocalStorageDashboardPersistence, bi as decodeObservabilityState, Us as defineDashboardTemplate, Ai as defineFilterProvider, el as defineLogDetail, Hm as defineObservabilityFeatures, yi as encodeObservabilityState, Co as extractMeasureValue, Eo as extractSparklineData, Qa as facetsToBar, Xa as facetsToDoughnut, jl as formatDuration, Al as formatTraceTime, Wn as getApiType, Kn as getApiTypeOrFallback, Pr as getLocaleWeekStart, Yn as getSignal, As as getWidgetRenderer, Qn as isBarWidget, Xn as isCartesianWidget, Zn as isDoughnutWidget, er as isMetricGroupWidget, $n as isMetricWidget, la as isMultiSelectForFilter, to as isStatusFacetField, Xl as isTracingApiLegacyLoader, Ql as isTracingApiPaginatedLoad, Yl as isTracingApiPaginatedLoader, Jl as isTracingApiPaginatedLoaderConfig, wo as measureResultToMetric, Or as mergeFilters, ts as mergeTimeSeriesToCartesian, Hc as messageLogPreset, ua as normalizeMembershipOperatorForValues, no as normalizeStatusGroupKey, Z as observabilityQueryKeys, ia as operatorLabel, aa as operatorNeedsValue, qd as parseDashboardJson, Ns as registerDefaultRenderers, ks as registerWidgetRenderer, Ws as resolveDashboardFromTemplate, Gi as resolveDataTypeIds, oo as resolveGroupColor, tl as resolveLogDetailVariant, nr as resolveMeasure, nl as resolvePreset, Vr as resolveRelativePeriod, Ur as resolveStableTimeRange, ro as resolveStatusPaletteColor, Zl as resolveTracingApiPaginatedLoader, Kd as serializeDashboard, Ui as toFilterItems, sd as useAdoptServerDashboard, e as useCapabilities, v as useCapability, Nr as useContextFilters, id as useCreateDashboardMutation, rd as useCustomDashboardQuery, nd as useCustomDashboardsQuery, u as useDashboardPersistence, Ys as useDashboardTemplate, Js as useDashboardTemplates, ld as useDeleteDashboardMutation, qr as useFacetsQuery, d as useFilterProvider, m as useFilterProviders, hr as useHttpOptions, wr as useInfiniteOptions, or as useLiveRefresh, ul as useLogDetailDrawerExpand, Jr as useLogDetailQuery, i as useLogsDataSource, Qr as useLogsPagedQuery, Yr as useLogsQuery, $r as useMeasuresQuery, co as useMergedWidgetFilters, r as useMetricsDataSource, s as useOptionalDashboardPersistence, sr as useOptionalLiveRefresh, a as useOptionalLogsDataSource, l as useOptionalMetricsDataSource, t as useOptionalTracesDataSource, od as useOverwriteDashboardMutation, gr as useStableHttpOptions, Gr as useStableTimeRange, ti as useTimeSeriesQuery, ni as useTraceDetailQuery, f as useTracesDataSource, ai as useTracesPagedQuery, ad as useUpdateDashboardMutation, Ka as useWidgetGroupContext, qc as webhookLogPreset };
11835
+ export { Hn as API_TYPE_REGISTRY, xo as BarPresentation, pi as CODEC_VERSION, o as CapabilityProvider, ls as CartesianPresentation, Mr as ContextFiltersProvider, ss as DASHBOARD_BUCKET_TARGET, y as DEFAULT_CAPABILITIES, tr as DEFAULT_MEASURE, oi as DEFAULT_PERIOD, rr as DEFAULT_REFRESH_INTERVAL_MS, _r as DEFAULT_STALE_TIME, mi as DEFAULT_TIME_RANGE, Gu as DashboardConflictError, Uu as DashboardForbiddenError, Wu as DashboardNotFoundError, Hu as DashboardPersistenceError, p as DashboardPersistenceProvider, qs as DashboardTemplatesProvider, zs as DashboardView, gs as DoughnutPresentation, ec as ExplorerTable, n as FILTER_OPERATORS, Pi as FILTER_SCOPES, Ha as FilterBar, ka as FilterChip, ya as FilterPopoverForm, Ki as FilterPropertyCombobox, g as FilterProvidersProvider, $a as HTTP_STATUS_PALETTE, mr as HttpProvider, rc as LiveIndicator, ar as LiveRefreshProvider, Q as LogDetailCodeBlock, cl as LogDetailContextChart, Tl as LogDetailDrawer, pl as LogDetailDrawerShell, Ac as LogDetailEmptyField, _l as LogDetailHeader, jc as LogDetailHeadersTable, Mc as LogDetailJsonTree, $ as LogDetailKeyValueGrid, vl as LogDetailMetrics, Dl as LogDetailPage, xl as LogDetailSection, bl as LogDetailSections, cc as LogSeverityBadge, vc as LogTable, _ as LogsDataSourceProvider, Sc as LogsExplorerPage, xs as MetricGroupPresentation, Es as MetricPresentation, h as MetricsDataSourceProvider, ui as PERIOD_DISPLAY_LABELS, li as PERIOD_LABELS, cu as POLICY_POST_EVENT, su as POLICY_PRE_EVENT, si as PRESET_CATEGORIES, iu as PolicyAttributeDiff, tc as QueryErrorBanner, ci as RELATIVE_PERIODS, Ni as SCOPE_COMMON, Mi as SIGNAL_DATA_TYPES, qn as SIGNAL_REGISTRY, gu as SpanDetailPanel, ki as TimeRangePicker, Bu as TraceDetailDrawer, zu as TraceDetailPage, Pu as TraceDetailShell, Ll as TraceExplorerPage, Eu as TraceLineage, kl as TraceStatusBadge, Fl as TraceTable, Mu as TraceTimeline, c as TracesDataSourceProvider, ql as TracingApiSelector, Am as TracingScreen, Hs as WidgetGroup, Fs as WidgetItem, Ec as buildApiTypeLink, Ta as buildChipLabel, Ea as buildChipLabelParts, Da as buildChipTooltip, Dc as buildDefaultConnectionLogColumns, rl as buildDefaultLogDetailConfig, Hi as buildFilterScopes, Cc as buildLogsDeepLink, qm as buildObservabilityBaseUrl, Ii as buildScopeFromId, Jm as buildTracesBaseUrl, $l as buildTracesDeepLink, js as clearWidgetRenderers, cs as computeBucketInterval, pu as computePolicyAttributeDiff, jo as computePreviousTimeRange, To as computeTrend, Ic as connectionLogPreset, yp as createDashboardRevisionStore, jp as createHttpDashboardPersistence, Up as createHttpDataSource, Kp as createHttpFilterSource, Jp as createHttpLogsSource, Cm as createHttpTracesFilterSource, im as createHttpTracesSource, Zm as createLocalStorageDashboardPersistence, bi as decodeObservabilityState, Us as defineDashboardTemplate, Ai as defineFilterProvider, el as defineLogDetail, Um as defineObservabilityFeatures, yi as encodeObservabilityState, Co as extractMeasureValue, Eo as extractSparklineData, Qa as facetsToBar, Xa as facetsToDoughnut, jl as formatDuration, Al as formatTraceTime, Wn as getApiType, Kn as getApiTypeOrFallback, Pr as getLocaleWeekStart, Yn as getSignal, As as getWidgetRenderer, Qn as isBarWidget, Xn as isCartesianWidget, Zn as isDoughnutWidget, er as isMetricGroupWidget, $n as isMetricWidget, la as isMultiSelectForFilter, to as isStatusFacetField, Xl as isTracingApiLegacyLoader, Ql as isTracingApiPaginatedLoad, Yl as isTracingApiPaginatedLoader, Jl as isTracingApiPaginatedLoaderConfig, wo as measureResultToMetric, Or as mergeFilters, ts as mergeTimeSeriesToCartesian, Hc as messageLogPreset, ua as normalizeMembershipOperatorForValues, no as normalizeStatusGroupKey, Z as observabilityQueryKeys, ia as operatorLabel, aa as operatorNeedsValue, Jd as parseDashboardJson, Ns as registerDefaultRenderers, ks as registerWidgetRenderer, Ws as resolveDashboardFromTemplate, Gi as resolveDataTypeIds, oo as resolveGroupColor, tl as resolveLogDetailVariant, nr as resolveMeasure, nl as resolvePreset, Vr as resolveRelativePeriod, Ur as resolveStableTimeRange, ro as resolveStatusPaletteColor, Zl as resolveTracingApiPaginatedLoader, qd as serializeDashboard, Ui as toFilterItems, sd as useAdoptServerDashboard, e as useCapabilities, v as useCapability, Nr as useContextFilters, id as useCreateDashboardMutation, rd as useCustomDashboardQuery, nd as useCustomDashboardsQuery, u as useDashboardPersistence, Ys as useDashboardTemplate, Js as useDashboardTemplates, ud as useDeleteDashboardMutation, qr as useFacetsQuery, d as useFilterProvider, m as useFilterProviders, hr as useHttpOptions, wr as useInfiniteOptions, or as useLiveRefresh, ul as useLogDetailDrawerExpand, Jr as useLogDetailQuery, i as useLogsDataSource, Qr as useLogsPagedQuery, Yr as useLogsQuery, $r as useMeasuresQuery, co as useMergedWidgetFilters, r as useMetricsDataSource, s as useOptionalDashboardPersistence, sr as useOptionalLiveRefresh, a as useOptionalLogsDataSource, l as useOptionalMetricsDataSource, t as useOptionalTracesDataSource, od as useOverwriteDashboardMutation, gr as useStableHttpOptions, Gr as useStableTimeRange, cd as useTakeReadDashboardRevision, ti as useTimeSeriesQuery, ni as useTraceDetailQuery, f as useTracesDataSource, ai as useTracesPagedQuery, ad as useUpdateDashboardMutation, Ka as useWidgetGroupContext, qc as webhookLogPreset };