@burdenoff/microfe-bigconsole 2026.1118.9 → 2026.1119.1

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.
Files changed (46) hide show
  1. package/dist/bigconsole/asof/AsOfBanner.d.ts +3 -0
  2. package/dist/bigconsole/asof/AsOfBanner.js +38 -0
  3. package/dist/bigconsole/asof/AsOfControl.d.ts +4 -0
  4. package/dist/bigconsole/asof/AsOfControl.js +96 -0
  5. package/dist/bigconsole/asof/AsOfProvider.d.ts +24 -0
  6. package/dist/bigconsole/asof/AsOfProvider.js +76 -0
  7. package/dist/bigconsole/asof/asOfMessage.d.ts +12 -0
  8. package/dist/bigconsole/asof/asOfMessage.js +12 -0
  9. package/dist/bigconsole/asof/asOfParam.d.ts +48 -0
  10. package/dist/bigconsole/asof/asOfParam.js +34 -0
  11. package/dist/bigconsole/asof/index.d.ts +7 -0
  12. package/dist/bigconsole/asof/index.js +6 -0
  13. package/dist/bigconsole/components/dashboard/BoardMigrationReport.d.ts +7 -0
  14. package/dist/bigconsole/components/dashboard/BoardMigrationReport.js +136 -0
  15. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +142 -138
  16. package/dist/bigconsole/components/dashboard/DashboardToolbar.js +97 -92
  17. package/dist/bigconsole/components/dashboard/ImportFromToolDialog.d.ts +8 -0
  18. package/dist/bigconsole/components/dashboard/ImportFromToolDialog.js +464 -0
  19. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +78 -74
  20. package/dist/bigconsole/components/dashboard/index.d.ts +2 -0
  21. package/dist/bigconsole/components/dashboard/index.js +2 -0
  22. package/dist/bigconsole/components/widgets/WidgetMenu.js +98 -96
  23. package/dist/bigconsole/components/widgets/WidgetWrapper.js +345 -306
  24. package/dist/bigconsole/constants/backendErrors.js +1 -0
  25. package/dist/bigconsole/hooks/index.d.ts +1 -0
  26. package/dist/bigconsole/hooks/index.js +14 -13
  27. package/dist/bigconsole/hooks/useBoardMigrationPreview.d.ts +22 -0
  28. package/dist/bigconsole/hooks/useBoardMigrationPreview.js +62 -0
  29. package/dist/bigconsole/hooks/useFilterFieldValues.js +52 -22
  30. package/dist/bigconsole/hooks/useWidgetData.d.ts +7 -0
  31. package/dist/bigconsole/hooks/useWidgetData.js +53 -43
  32. package/dist/bigconsole/pages/DashboardViewPage.d.ts +7 -1
  33. package/dist/bigconsole/pages/DashboardViewPage.js +300 -278
  34. package/dist/bigconsole/pages/DashboardsPage.js +396 -376
  35. package/dist/bigconsole/pages/index.d.ts +1 -1
  36. package/dist/bigconsole/types/index.d.ts +13 -0
  37. package/dist/bigconsole/utils/backendError.js +46 -24
  38. package/dist/bigconsole/utils/boardMigration.d.ts +53 -0
  39. package/dist/bigconsole/utils/boardMigration.js +92 -0
  40. package/dist/bigconsole/utils/widgetDisplayData.d.ts +6 -0
  41. package/dist/bigconsole/utils/widgetDisplayData.js +4 -0
  42. package/dist/generated/wspace-operations.d.ts +116 -0
  43. package/dist/generated/wspace-operations.js +793 -183
  44. package/dist/generated/wspace-types.d.ts +78 -0
  45. package/dist/generated/wspace-types.js +12 -10
  46. package/package.json +1 -1
@@ -9,51 +9,55 @@ import ae from "../../hooks/useWidgetComments.js";
9
9
  import oe from "../../hooks/useWidgetExport.js";
10
10
  import se from "../../hooks/useDrilldown.js";
11
11
  import { getWidgetDefinition as ce } from "./WidgetRegistry.js";
12
- import { resolveTextData as le } from "./text-widget/textData.js";
13
- import { WidgetHeader as ue } from "./WidgetHeader.js";
14
- import { WidgetMenu as i } from "./WidgetMenu.js";
15
- import { useBigConsoleSettings as de } from "../../hooks/useBigConsoleSettings.js";
16
- import { WidgetLoadingState as a } from "./states/LoadingState.js";
17
- import { WidgetErrorState as fe } from "./states/ErrorState.js";
18
- import { WidgetEmptyState as o } from "./states/EmptyState.js";
19
- import { WidgetErrorBoundary as pe } from "./WidgetErrorBoundary.js";
20
- import { hasCustomIframeConfig as me, hasRenderableCustomConfig as he } from "./custom/config.js";
21
- import { getBindingForWidget as ge } from "../../utils/widgetBinding.js";
22
- import { filterMetaFromDashboard as _e, findInapplicableFilters as ve } from "../../utils/globalFilterMatching.js";
23
- import { applyGlobalFilters as ye } from "../../utils/applyGlobalFilters.js";
24
- import { extractOutlierSeries as be } from "../insights/outlierSeries.js";
25
- import { OutlierSpottingDialog as xe } from "../insights/OutlierSpottingDialog.js";
26
- import { canReconcileWidget as Se } from "../reconcile/reconcileModel.js";
27
- import { isUsableWidgetData as Ce, resolveWidgetDisplayData as we, widgetDataSourcePolicy as Te, widgetExportRows as Ee } from "../../utils/widgetDisplayData.js";
28
- import { WidgetRendererFactory as De } from "../../renderers/factory/WidgetRendererFactory.js";
29
- import { WidgetActions as Oe } from "./widget-actions/WidgetActions.js";
12
+ import { resolveTextData as i } from "./text-widget/textData.js";
13
+ import { useAsOf as a } from "../../asof/AsOfProvider.js";
14
+ import { asOfUnavailableMessage as o } from "../../asof/asOfMessage.js";
15
+ import { WidgetHeader as le } from "./WidgetHeader.js";
16
+ import { WidgetMenu as s } from "./WidgetMenu.js";
17
+ import { useBigConsoleSettings as ue } from "../../hooks/useBigConsoleSettings.js";
18
+ import "../../asof/index.js";
19
+ import { WidgetLoadingState as c } from "./states/LoadingState.js";
20
+ import { WidgetErrorState as l } from "./states/ErrorState.js";
21
+ import { WidgetEmptyState as u } from "./states/EmptyState.js";
22
+ import { WidgetErrorBoundary as de } from "./WidgetErrorBoundary.js";
23
+ import { hasCustomIframeConfig as fe, hasRenderableCustomConfig as pe } from "./custom/config.js";
24
+ import { getBindingForWidget as me } from "../../utils/widgetBinding.js";
25
+ import { filterMetaFromDashboard as he, findInapplicableFilters as ge } from "../../utils/globalFilterMatching.js";
26
+ import { applyGlobalFilters as _e } from "../../utils/applyGlobalFilters.js";
27
+ import { extractOutlierSeries as ve } from "../insights/outlierSeries.js";
28
+ import { OutlierSpottingDialog as ye } from "../insights/OutlierSpottingDialog.js";
29
+ import { canReconcileWidget as be } from "../reconcile/reconcileModel.js";
30
+ import { isUsableWidgetData as xe, resolveWidgetDisplayData as Se, widgetDataSourcePolicy as Ce, widgetExportRows as we } from "../../utils/widgetDisplayData.js";
31
+ import { WidgetRendererFactory as Te } from "../../renderers/factory/WidgetRendererFactory.js";
32
+ import { WidgetActions as Ee } from "./widget-actions/WidgetActions.js";
30
33
  import "./widget-actions/index.js";
31
- import { dashboardSuggestAnchorProps as ke } from "../../proactive/entities.js";
32
- import { Suspense as s, lazy as c, memo as l, useCallback as u, useEffect as Ae, useMemo as d, useRef as f, useState as p } from "react";
33
- import { useI18n as je } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
34
- import { useQuery as Me } from "@apollo/client/react";
35
- import { jsx as m, jsxs as Ne } from "react/jsx-runtime";
34
+ import { dashboardSuggestAnchorProps as De } from "../../proactive/entities.js";
35
+ import { Suspense as d, lazy as f, memo as p, useCallback as m, useEffect as Oe, useMemo as h, useRef as g, useState as _ } from "react";
36
+ import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
37
+ import { useQuery as ke } from "@apollo/client/react";
38
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
36
39
  // src/bigconsole/components/widgets/WidgetWrapper.tsx
37
- var Pe = c(() => import("../reconcile/KpiReconcileDialog.js").then((e) => ({ default: e.KpiReconcileDialog }))), Fe = c(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), Ie = c(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), Le = c(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), Re = c(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), ze = c(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), Be = c(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), Ve = c(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), He = c(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), Ue = c(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), We = c(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), Ge = c(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), Ke = c(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), qe = c(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), Je = c(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), Ye = c(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), Xe = c(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), Ze = c(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget })));
38
- c(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget })));
39
- var Qe = c(() => import("./form/index.js").then((e) => ({ default: e.FormWidget }))), $e = c(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.SankeyWidget }))), et = c(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.BoxPlotWidget }))), tt = c(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.WaterfallWidget }))), nt = c(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments }))), rt = /* @__PURE__ */ new Set([
40
+ var Ae = f(() => import("../reconcile/KpiReconcileDialog.js").then((e) => ({ default: e.KpiReconcileDialog }))), je = f(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), Me = f(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), Ne = f(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), Pe = f(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), Fe = f(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), Ie = f(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), Le = f(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), Re = f(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), ze = f(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), Be = f(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), Ve = f(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), He = f(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), Ue = f(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), We = f(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), Ge = f(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), Ke = f(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), qe = f(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget })));
41
+ f(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget })));
42
+ var Je = f(() => import("./form/index.js").then((e) => ({ default: e.FormWidget }))), Ye = f(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.SankeyWidget }))), Xe = f(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.BoxPlotWidget }))), Ze = f(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.WaterfallWidget }))), Qe = f(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments }))), $e = /* @__PURE__ */ new Set([
40
43
  "text",
41
44
  "iframe",
42
45
  "form",
43
46
  "adaptive_card"
44
47
  ]);
45
- function h(e, t) {
48
+ function x(e, t) {
46
49
  return e.previewOnly === t.previewOnly && e.widget.id === t.widget.id && e.widget.updatedAt === t.widget.updatedAt && e.isLoading === t.isLoading && e.error === t.error && e.actions === t.actions && e.data === t.data && JSON.stringify(e.filterValues) === JSON.stringify(t.filterValues) && e.narrativeOpen === t.narrativeOpen && e.narrativePanel === t.narrativePanel;
47
50
  }
48
- var it = l(function({ widget: i, children: c, data: l, className: h = "", isLoading: it, error: g, onRefresh: _, onDrilldown: v, actions: y, onAction: b, filterValues: x, onToggleNarrative: at, narrativeOpen: ot = !1, narrativePanel: st, previewOnly: S = !1 }) {
49
- let C = de(), ct = r((e) => e.viewMode === "edit"), w = !S && ct, T = t((e) => e.selectWidget), E = e(i.id), D = n(i.id), O = ee(), { t: lt } = je(), k = i.dashboardId, { data: ut } = Me(ne, {
50
- variables: { id: k ?? "" },
51
- skip: !k,
51
+ var S = p(function({ widget: s, children: f, data: p, className: x = "", isLoading: S, error: C, onRefresh: w, onDrilldown: T, actions: E, onAction: D, filterValues: O, onToggleNarrative: et, narrativeOpen: k = !1, narrativePanel: tt, previewOnly: A = !1 }) {
52
+ let j = ue(), nt = r((e) => e.viewMode === "edit"), M = !A && nt, N = t((e) => e.selectWidget), P = e(s.id), rt = n(s.id), F = ee(), { t: I } = v(), it = s.dashboardId, { data: at } = ke(ne, {
53
+ variables: { id: it ?? "" },
54
+ skip: !it,
52
55
  fetchPolicy: "cache-only"
53
- }), A = ut?.getDashboard?.globalFilters, j = d(() => _e(A), [A]), M = d(() => Object.fromEntries(Object.entries(j).map(([e, t]) => [e, t.field])), [j]), N = d(() => ge(i), [i]), { hasDataSource: P, allowSamples: F, mockSource: I } = Te(i, N), { data: L, loading: dt, error: ft } = te(i.id, {
54
- skip: S || !P,
55
- pollInterval: (i.refreshInterval ?? 0) * 1e3 || 0
56
- }), R = d(() => {
56
+ }), ot = at?.getDashboard?.globalFilters, L = h(() => he(ot), [ot]), st = h(() => Object.fromEntries(Object.entries(L).map(([e, t]) => [e, t.field])), [L]), R = h(() => me(s), [s]), { hasDataSource: ct, allowSamples: lt, mockSource: ut } = Ce(s, R), { asOf: z } = a(), { data: B, loading: dt, error: ft, asOfInfo: pt } = te(s.id, {
57
+ skip: A || !ct,
58
+ pollInterval: z ? 0 : (s.refreshInterval ?? 0) * 1e3 || 0,
59
+ asOf: z
60
+ }), V = h(() => {
57
61
  if (typeof window > "u") return {};
58
62
  let e = new URLSearchParams(window.location.search), t = {};
59
63
  return e.forEach((e, n) => {
@@ -62,149 +66,159 @@ var it = l(function({ widget: i, children: c, data: l, className: h = "", isLoad
62
66
  r.startsWith("__") || (t[r] = e);
63
67
  }
64
68
  }), t;
65
- }, []), z = d(() => {
69
+ }, []), H = h(() => {
66
70
  let e = {};
67
- return R && Object.keys(R).length > 0 && Object.assign(e, R), O && Object.keys(O).length > 0 && Object.assign(e, O), x && Object.keys(x).length > 0 && Object.assign(e, x), e;
71
+ return V && Object.keys(V).length > 0 && Object.assign(e, V), F && Object.keys(F).length > 0 && Object.assign(e, F), O && Object.keys(O).length > 0 && Object.assign(e, O), e;
68
72
  }, [
69
- R,
70
- O,
71
- x
72
- ]), B = Object.keys(z).length > 0, V = it ?? (dt && !L) ?? D.isLoading, H = g ?? ft?.message ?? D.errorMessage, pt = ce(i.type), U = f(_);
73
- Ae(() => {
74
- U.current = _;
75
- }, [_]);
76
- let mt = u(async () => {
77
- U.current && await U.current();
78
- }, []), { timeUntilRefresh: ht, isPaused: gt } = ie({
79
- widgetId: i.id,
80
- refreshInterval: i.refreshInterval,
81
- onRefresh: mt,
82
- enabled: !S && !w && !!i.refreshInterval
83
- }), W = f(null), [_t, vt] = p(!1), [yt, bt] = p(!1), { count: xt } = ae(i.id, yt), St = u(() => {
84
- bt(!0), vt((e) => !e);
85
- }, []), G = d(() => we({
86
- explicit: l,
87
- fetched: L,
88
- persisted: i.data,
89
- config: i.config,
90
- allowSamples: F,
91
- mockSource: I,
92
- widgetType: i.type
93
- }), [
94
- l,
95
- L,
96
- i,
73
+ V,
97
74
  F,
98
- I
99
- ]), K = d(() => {
100
- let e = G.data;
75
+ O
76
+ ]), mt = Object.keys(H).length > 0, U = S ?? (dt && !B) ?? rt.isLoading, ht = z ? o(pt, I) : null, W = C ?? ht ?? ft?.message ?? (z ? null : rt.errorMessage), gt = ce(s.type), G = g(w);
77
+ Oe(() => {
78
+ G.current = w;
79
+ }, [w]);
80
+ let _t = m(async () => {
81
+ G.current && await G.current();
82
+ }, []), { timeUntilRefresh: vt, isPaused: yt } = ie({
83
+ widgetId: s.id,
84
+ refreshInterval: s.refreshInterval,
85
+ onRefresh: _t,
86
+ enabled: !A && !M && !!s.refreshInterval && !z
87
+ }), bt = g(null), [xt, St] = _(!1), [Ct, wt] = _(!1), { count: Tt } = ae(s.id, Ct), Et = m(() => {
88
+ wt(!0), St((e) => !e);
89
+ }, []), K = h(() => Se({
90
+ explicit: p,
91
+ fetched: B,
92
+ persisted: s.data,
93
+ config: s.config,
94
+ allowSamples: lt,
95
+ mockSource: ut,
96
+ widgetType: s.type,
97
+ asOf: z !== null
98
+ }), [
99
+ p,
100
+ B,
101
+ s,
102
+ lt,
103
+ ut,
104
+ z
105
+ ]), q = h(() => {
106
+ let e = K.data;
101
107
  if (e && typeof e == "object" && !Array.isArray(e)) {
102
- let t = i.config, n = t?.dataKey ?? t?.dataPath ?? t?.seriesPath;
108
+ let t = s.config, n = t?.dataKey ?? t?.dataPath ?? t?.seriesPath;
103
109
  if (n && typeof n == "string") {
104
110
  let t = n.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
105
- t != null && Ce(t) && (e = t);
111
+ t != null && xe(t) && (e = t);
106
112
  }
107
113
  }
108
114
  return e;
109
- }, [G, i.config]), q = d(() => B ? ye(K, {
110
- filterValues: z,
111
- filterFieldMap: M,
112
- widgetType: i.type
113
- }) : K, [
114
- K,
115
- B,
116
- z,
117
- M,
118
- i.type
119
- ]), Ct = q !== null && G.isSample, wt = d(() => rt.has(i.type) ? [] : ve(K, j, z, i.type), [
120
- K,
121
- j,
122
- z,
123
- i.type
124
- ]), Tt = d(() => Ee(q, i.type), [q, i.type]), Et = d(() => {
125
- let e = i.config;
126
- return be(q, {
115
+ }, [K, s.config]), J = h(() => mt ? _e(q, {
116
+ filterValues: H,
117
+ filterFieldMap: st,
118
+ widgetType: s.type
119
+ }) : q, [
120
+ q,
121
+ mt,
122
+ H,
123
+ st,
124
+ s.type
125
+ ]), Dt = J !== null && K.isSample, Ot = h(() => $e.has(s.type) ? [] : ge(q, L, H, s.type), [
126
+ q,
127
+ L,
128
+ H,
129
+ s.type
130
+ ]), kt = h(() => we(J, s.type), [J, s.type]), At = h(() => {
131
+ let e = s.config;
132
+ return ve(J, {
127
133
  xAxisKey: typeof e?.xAxisKey == "string" ? e.xAxisKey : void 0,
128
134
  selectedFields: Array.isArray(e?.selectedFields) ? e.selectedFields.filter((e) => typeof e == "string") : void 0
129
135
  });
130
- }, [q, i.config]), [Dt, Ot] = p(!1), [kt, At] = p(!1), jt = Se(i.type, S), { exportCSV: Mt, exportPNG: Nt } = oe(i, {
131
- data: Tt,
132
- containerRef: W
133
- }), { executeDrilldown: Pt, canDrilldown: Ft } = se({ onDrilldown: (e, t) => {
134
- v?.(e);
135
- } }), J = d(() => Ft(i), [i, Ft]), It = u((e) => {
136
- if (!i.drilldown?.enabled) return;
136
+ }, [J, s.config]), [jt, Mt] = _(!1), [Nt, Pt] = _(!1), Ft = be(s.type, A), { exportCSV: It, exportPNG: Lt } = oe(s, {
137
+ data: kt,
138
+ containerRef: bt
139
+ }), { executeDrilldown: Rt, canDrilldown: zt } = se({ onDrilldown: (e, t) => {
140
+ T?.(e);
141
+ } }), Y = h(() => zt(s) && !z, [
142
+ s,
143
+ zt,
144
+ z
145
+ ]), Bt = m((e) => {
146
+ if (!s.drilldown?.enabled) return;
137
147
  let t = {
138
148
  selectedData: e || {},
139
- globalFilters: O || {},
140
- widgetData: q || {},
149
+ globalFilters: F || {},
150
+ widgetData: J || {},
141
151
  metadata: {
142
- widgetId: i.id,
143
- widgetType: i.type,
144
- widgetTitle: i.title
152
+ widgetId: s.id,
153
+ widgetType: s.type,
154
+ widgetTitle: s.title
145
155
  },
146
- sourceDashboardId: i.dashboardId
156
+ sourceDashboardId: s.dashboardId
147
157
  };
148
- Pt(i.drilldown, t);
158
+ Rt(s.drilldown, t);
149
159
  }, [
150
- i,
151
- q,
152
- O,
153
- Pt
154
- ]), Y = J && !w ? It : void 0, X = f(null), Lt = u((e) => {
155
- X.current = {
160
+ s,
161
+ J,
162
+ F,
163
+ Rt
164
+ ]), X = Y && !M && !z ? Bt : void 0, Z = g(null), Vt = m((e) => {
165
+ Z.current = {
156
166
  x: e.clientX,
157
167
  y: e.clientY
158
168
  };
159
- }, []), Rt = u((e) => {
160
- if (e.stopPropagation(), X.current) {
161
- let t = Math.abs(e.clientX - X.current.x), n = Math.abs(e.clientY - X.current.y);
169
+ }, []), Ht = m((e) => {
170
+ if (e.stopPropagation(), Z.current) {
171
+ let t = Math.abs(e.clientX - Z.current.x), n = Math.abs(e.clientY - Z.current.y);
162
172
  if (t > 5 || n > 5) {
163
- X.current = null;
173
+ Z.current = null;
164
174
  return;
165
175
  }
166
176
  }
167
- X.current = null, w && T(i.id);
177
+ Z.current = null, M && N(s.id);
168
178
  }, [
169
- w,
170
- T,
171
- i.id
172
- ]), zt = u((e) => {
173
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), w && T(i.id));
179
+ M,
180
+ N,
181
+ s.id
182
+ ]), Ut = m((e) => {
183
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), M && N(s.id));
184
+ }, [
185
+ M,
186
+ N,
187
+ s.id
188
+ ]), Wt = h(() => s.type === "custom" && pe(s.config), [s.type, s.config]), Gt = h(() => s.type === "custom" && fe(s.config), [s.type, s.config]), Q = Y && !Gt, Kt = s.type === "iframe" || s.type === "custom", qt = h(() => s.type === "text" && i(s.config, J).hasContent, [
189
+ s.type,
190
+ s.config,
191
+ J
192
+ ]), Jt = !U && !W && !J && !Wt && !qt, $ = h(() => s.renderer, [s]), Yt = h(() => $ && $ !== "BIGCONSOLE", [$]), Xt = h(() => ({
193
+ widgetId: s.id,
194
+ data: J || {}
195
+ }), [s.id, J]), Zt = m((e, t) => {
196
+ if (!D || z) return;
197
+ let n = E?.find((t) => t.name === e.name);
198
+ D(n || e, t);
174
199
  }, [
175
- w,
176
- T,
177
- i.id
178
- ]), Bt = d(() => i.type === "custom" && he(i.config), [i.type, i.config]), Vt = d(() => i.type === "custom" && me(i.config), [i.type, i.config]), Z = J && !Vt, Ht = d(() => i.type === "text" && le(i.config, q).hasContent, [
179
- i.type,
180
- i.config,
181
- q
182
- ]), Ut = !V && !H && !q && !Bt && !Ht, Q = d(() => i.renderer, [i]), Wt = d(() => Q && Q !== "BIGCONSOLE", [Q]), Gt = d(() => ({
183
- widgetId: i.id,
184
- data: q || {}
185
- }), [i.id, q]), $ = u((e, t) => {
186
- if (!b) return;
187
- let n = y?.find((t) => t.name === e.name);
188
- b(n || e, t);
189
- }, [b, y]), Kt = u(() => {
200
+ D,
201
+ E,
202
+ z
203
+ ]), Qt = m(() => {
190
204
  let e = (() => {
191
- if (!q) return q;
192
- if (i.type === "pivot_table") {
193
- if (Array.isArray(q)) return q;
194
- if (q && typeof q == "object" && "rows" in q) return q.rows;
205
+ if (!J) return J;
206
+ if (s.type === "pivot_table") {
207
+ if (Array.isArray(J)) return J;
208
+ if (J && typeof J == "object" && "rows" in J) return J.rows;
195
209
  }
196
- if (i.type === "list") {
197
- if (Array.isArray(q)) return q;
198
- if (q && typeof q == "object" && "items" in q) return q.items;
210
+ if (s.type === "list") {
211
+ if (Array.isArray(J)) return J;
212
+ if (J && typeof J == "object" && "items" in J) return J.items;
199
213
  }
200
- if (i.type === "funnel_chart") {
201
- if (Array.isArray(q)) return q;
202
- if (q && typeof q == "object" && "stages" in q) return q.stages;
214
+ if (s.type === "funnel_chart") {
215
+ if (Array.isArray(J)) return J;
216
+ if (J && typeof J == "object" && "stages" in J) return J.stages;
203
217
  }
204
- if (i.type === "chart") {
205
- if (Array.isArray(q)) return q;
206
- if (q && typeof q == "object" && "datasets" in q) {
207
- let e = q;
218
+ if (s.type === "chart") {
219
+ if (Array.isArray(J)) return J;
220
+ if (J && typeof J == "object" && "datasets" in J) {
221
+ let e = J;
208
222
  if (e.labels && e.datasets) return e.labels.map((t, n) => {
209
223
  let r = { name: t };
210
224
  return e.datasets?.forEach((e) => {
@@ -213,269 +227,276 @@ var it = l(function({ widget: i, children: c, data: l, className: h = "", isLoad
213
227
  });
214
228
  }
215
229
  }
216
- if (i.type === "text") {
217
- let e = le(i.config, q);
230
+ if (s.type === "text") {
231
+ let e = i(s.config, J);
218
232
  return {
219
233
  content: e.content,
220
234
  format: e.format,
221
235
  alignment: e.alignment
222
236
  };
223
237
  }
224
- if (i.type === "custom") {
225
- let e = i.config?.valueField;
226
- if (e && q && typeof q == "object" && !Array.isArray(q)) {
227
- let t = q;
238
+ if (s.type === "custom") {
239
+ let e = s.config?.valueField;
240
+ if (e && J && typeof J == "object" && !Array.isArray(J)) {
241
+ let t = J;
228
242
  if (e in t) return {
229
243
  value: t[e],
230
- label: i.title,
244
+ label: s.title,
231
245
  data: t
232
246
  };
233
247
  }
234
248
  }
235
- return q;
249
+ return J;
236
250
  })(), t = {
237
- widget: i,
238
- onDrilldown: Y
251
+ widget: s,
252
+ onDrilldown: X
239
253
  };
240
- if (Wt) {
254
+ if (Yt) {
241
255
  let e = {};
242
- if (q && typeof q == "object" && !Array.isArray(q) && Object.keys(q).length > 0 && (e = { ...q }), i.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
243
- let t = i.config?.valueField;
256
+ if (J && typeof J == "object" && !Array.isArray(J) && Object.keys(J).length > 0 && (e = { ...J }), s.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
257
+ let t = s.config?.valueField;
244
258
  if (t && t in e) {
245
259
  let n = e[t], r = typeof n == "number" ? n.toLocaleString() : String(n);
246
260
  e = {
247
261
  ...e,
248
262
  value: n,
249
263
  title: e.title || r,
250
- description: e.description || i.title || "",
264
+ description: e.description || s.title || "",
251
265
  text: e.text || r
252
266
  };
253
267
  }
254
268
  }
255
- return /* @__PURE__ */ m(De, {
256
- widget: i,
269
+ return /* @__PURE__ */ y(Te, {
270
+ widget: s,
257
271
  data: e,
258
- isEditMode: w,
259
- isSelected: E,
260
- isLoading: V,
261
- error: H,
262
- onDrilldown: Y,
263
- onAction: $
272
+ isEditMode: M,
273
+ isSelected: P,
274
+ isLoading: U,
275
+ error: W,
276
+ onDrilldown: X,
277
+ onAction: z ? void 0 : Zt
264
278
  });
265
279
  }
266
- switch (i.type?.toLowerCase() || "") {
267
- case "metric_card": return /* @__PURE__ */ m(Fe, {
280
+ switch (s.type?.toLowerCase() || "") {
281
+ case "metric_card": return /* @__PURE__ */ y(je, {
268
282
  ...t,
269
283
  data: e
270
284
  });
271
- case "kpi_card_comparison": return /* @__PURE__ */ m(qe, {
285
+ case "kpi_card_comparison": return /* @__PURE__ */ y(Ue, {
272
286
  ...t,
273
287
  data: e
274
288
  });
275
289
  case "chart":
276
- case "funnel_chart": return /* @__PURE__ */ m(Ie, {
290
+ case "funnel_chart": return /* @__PURE__ */ y(Me, {
277
291
  ...t,
278
292
  data: e
279
293
  });
280
- case "waterfall": return /* @__PURE__ */ m(tt, {
294
+ case "waterfall": return /* @__PURE__ */ y(Ze, {
281
295
  ...t,
282
296
  data: e
283
297
  });
284
- case "sankey": return /* @__PURE__ */ m($e, {
298
+ case "sankey": return /* @__PURE__ */ y(Ye, {
285
299
  ...t,
286
300
  data: e
287
301
  });
288
- case "box_plot": return /* @__PURE__ */ m(et, {
302
+ case "box_plot": return /* @__PURE__ */ y(Xe, {
289
303
  ...t,
290
304
  data: e
291
305
  });
292
- case "table": return /* @__PURE__ */ m(Le, {
306
+ case "table": return /* @__PURE__ */ y(Ne, {
293
307
  ...t,
294
308
  data: e
295
309
  });
296
- case "pivot_table": return /* @__PURE__ */ m(Re, {
310
+ case "pivot_table": return /* @__PURE__ */ y(Pe, {
297
311
  ...t,
298
312
  data: e
299
313
  });
300
- case "gauge": return /* @__PURE__ */ m(ze, {
314
+ case "gauge": return /* @__PURE__ */ y(Fe, {
301
315
  ...t,
302
316
  data: e
303
317
  });
304
- case "progress": return /* @__PURE__ */ m(Be, {
318
+ case "progress": return /* @__PURE__ */ y(Ie, {
305
319
  ...t,
306
320
  data: e
307
321
  });
308
- case "list": return /* @__PURE__ */ m(Ve, {
322
+ case "list": return /* @__PURE__ */ y(Le, {
309
323
  ...t,
310
324
  data: e
311
325
  });
312
- case "heatmap": return /* @__PURE__ */ m(He, {
326
+ case "heatmap": return /* @__PURE__ */ y(Re, {
313
327
  ...t,
314
328
  data: e
315
329
  });
316
- case "retention": return /* @__PURE__ */ m(Ue, {
330
+ case "retention": return /* @__PURE__ */ y(ze, {
317
331
  ...t,
318
332
  data: e
319
333
  });
320
- case "calendar": return /* @__PURE__ */ m(We, {
334
+ case "calendar": return /* @__PURE__ */ y(Be, {
321
335
  ...t,
322
336
  data: e
323
337
  });
324
- case "timeline": return /* @__PURE__ */ m(Ke, {
338
+ case "timeline": return /* @__PURE__ */ y(He, {
325
339
  ...t,
326
340
  data: e
327
341
  });
328
- case "kanban": return /* @__PURE__ */ m(Ge, {
342
+ case "kanban": return /* @__PURE__ */ y(Ve, {
329
343
  ...t,
330
344
  data: e
331
345
  });
332
- case "form": return /* @__PURE__ */ m(Qe, {
346
+ case "form": return /* @__PURE__ */ y(Je, {
333
347
  ...t,
334
348
  data: e
335
349
  });
336
- case "text": return /* @__PURE__ */ m(Je, {
350
+ case "text": return /* @__PURE__ */ y(We, {
337
351
  ...t,
338
352
  data: e
339
353
  });
340
- case "iframe": return /* @__PURE__ */ m(Xe, {
354
+ case "iframe": return /* @__PURE__ */ y(Ke, {
341
355
  ...t,
342
356
  data: e
343
357
  });
344
- case "map": return /* @__PURE__ */ m(Ye, {
358
+ case "map": return /* @__PURE__ */ y(Ge, {
345
359
  ...t,
346
360
  data: e
347
361
  });
348
- case "custom": return /* @__PURE__ */ m(Ze, {
362
+ case "custom": return /* @__PURE__ */ y(qe, {
349
363
  ...t,
350
364
  data: e
351
365
  });
352
- default: return c || /* @__PURE__ */ m(o, { widgetType: i.type });
366
+ default: return f || /* @__PURE__ */ y(u, { widgetType: s.type });
353
367
  }
354
368
  }, [
355
- i,
356
- q,
357
- c,
358
- Y,
359
- Wt,
360
- w,
361
- E,
362
- V,
363
- H,
364
- $
365
- ]), qt = () => {
366
- if (V) return /* @__PURE__ */ m(a, {});
367
- if (H) return /* @__PURE__ */ m(fe, {
368
- error: H,
369
- onRetry: _
369
+ s,
370
+ J,
371
+ f,
372
+ X,
373
+ Yt,
374
+ M,
375
+ P,
376
+ U,
377
+ W,
378
+ Zt
379
+ ]), $t = () => {
380
+ if (z && Kt) {
381
+ let e = o({
382
+ historyAvailable: !1,
383
+ reason: "HISTORY_NOT_AVAILABLE"
384
+ }, I);
385
+ return /* @__PURE__ */ y(l, { error: e ?? "" });
386
+ }
387
+ if (U) return /* @__PURE__ */ y(c, {});
388
+ if (W) return /* @__PURE__ */ y(l, {
389
+ error: W,
390
+ onRetry: z ? void 0 : w
370
391
  });
371
- if (Ut && !c) return /* @__PURE__ */ m(o, {
372
- widgetType: i.type,
373
- hideEditHint: S,
374
- hasDataSource: P,
375
- compact: (i.position?.height ?? i.positionHeight ?? 4) <= 2,
376
- templateSlot: typeof i.metadata?.templateDataSinkSlot == "string" ? i.metadata.templateDataSinkSlot : null
392
+ if (Jt && !f) return /* @__PURE__ */ y(u, {
393
+ widgetType: s.type,
394
+ hideEditHint: A,
395
+ hasDataSource: ct,
396
+ compact: (s.position?.height ?? s.positionHeight ?? 4) <= 2,
397
+ templateSlot: typeof s.metadata?.templateDataSinkSlot == "string" ? s.metadata.templateDataSinkSlot : null
377
398
  });
378
- let e = `${N.source.kind}|${N.source.ref ?? ""}|${N.parserId ?? ""}|${i.updatedAt ?? ""}`;
379
- return /* @__PURE__ */ m(pe, {
380
- widgetId: i.id,
381
- widgetType: i.type,
382
- widgetTitle: i.title,
399
+ let e = `${R.source.kind}|${R.source.ref ?? ""}|${R.parserId ?? ""}|${s.updatedAt ?? ""}`;
400
+ return /* @__PURE__ */ y(de, {
401
+ widgetId: s.id,
402
+ widgetType: s.type,
403
+ widgetTitle: s.title,
383
404
  resetKey: e,
384
- children: c ?? /* @__PURE__ */ m(s, {
385
- fallback: /* @__PURE__ */ m(a, {}),
386
- children: Kt()
405
+ children: f ?? /* @__PURE__ */ y(d, {
406
+ fallback: /* @__PURE__ */ y(c, {}),
407
+ children: Qt()
387
408
  })
388
409
  });
389
410
  };
390
- return /* @__PURE__ */ Ne("div", {
391
- ref: W,
392
- ...S ? {} : ke(i.dashboardId, i.id),
411
+ return /* @__PURE__ */ b("div", {
412
+ ref: bt,
413
+ ...A ? {} : De(s.dashboardId, s.id),
393
414
  className: `
394
415
  group relative flex flex-col
395
416
  h-full w-full min-w-0
396
417
  rounded-card border
397
418
  bg-bg-surface
398
419
  shadow-[var(--shadow-elevation-1)]
399
- ${C.animationsEnabled ? "motion-safe:transition-[box-shadow,border-color] motion-safe:duration-200" : ""}
400
- ${E && w ? "border-[var(--color-action-primary-border)] ring-2 ring-[var(--color-action-primary-border)]/30 shadow-[var(--shadow-elevation-2)]" : C.showWidgetBorders ? "border-[var(--color-border-subtle)] hover:border-action-primary-bg hover:shadow-[var(--shadow-elevation-2)]" : "border-transparent"}
401
- ${w ? "cursor-pointer" : ""}
402
- ${h}
420
+ ${j.animationsEnabled ? "motion-safe:transition-[box-shadow,border-color] motion-safe:duration-200" : ""}
421
+ ${P && M ? "border-[var(--color-action-primary-border)] ring-2 ring-[var(--color-action-primary-border)]/30 shadow-[var(--shadow-elevation-2)]" : j.showWidgetBorders ? "border-[var(--color-border-subtle)] hover:border-action-primary-bg hover:shadow-[var(--shadow-elevation-2)]" : "border-transparent"}
422
+ ${M ? "cursor-pointer" : ""}
423
+ ${x}
403
424
  `,
404
- onMouseDown: Lt,
405
- onClick: Rt,
406
- onKeyDown: zt,
407
- tabIndex: w ? 0 : -1,
408
- role: w ? "button" : void 0,
409
- "aria-selected": E,
410
- "aria-label": `Widget: ${i.title}`,
411
- "data-widget-id": i.id,
412
- "data-widget-type": i.type,
425
+ onMouseDown: Vt,
426
+ onClick: Ht,
427
+ onKeyDown: Ut,
428
+ tabIndex: M ? 0 : -1,
429
+ role: M ? "button" : void 0,
430
+ "aria-selected": P,
431
+ "aria-label": `Widget: ${s.title}`,
432
+ "data-widget-id": s.id,
433
+ "data-widget-type": s.type,
413
434
  children: [
414
- /* @__PURE__ */ m(ue, {
415
- widget: i,
416
- previewOnly: S,
417
- definition: pt,
418
- isSelected: E,
419
- isEditMode: w,
420
- isLoading: V,
421
- isSampleData: Ct,
422
- timeUntilRefresh: i.refreshInterval && !gt ? re(ht) : void 0,
423
- hasDrilldown: J,
424
- onRefresh: _,
425
- onExportCSV: Tt ? Mt : void 0,
426
- onExportPNG: Nt,
427
- onDrilldown: Y ? () => Y() : void 0,
428
- onToggleComments: S ? void 0 : St,
429
- commentsOpen: _t,
430
- commentCount: yt ? xt : void 0,
431
- onExplain: S ? void 0 : at,
432
- explainOpen: ot,
433
- onSpotOutliers: Et.length > 0 ? () => Ot(!0) : void 0,
434
- onReconcile: jt ? () => At(!0) : void 0
435
+ /* @__PURE__ */ y(le, {
436
+ widget: s,
437
+ previewOnly: A,
438
+ definition: gt,
439
+ isSelected: P,
440
+ isEditMode: M,
441
+ isLoading: U,
442
+ isSampleData: Dt,
443
+ timeUntilRefresh: s.refreshInterval && !yt ? re(vt) : void 0,
444
+ hasDrilldown: Y,
445
+ onRefresh: z ? void 0 : w,
446
+ onExportCSV: kt ? It : void 0,
447
+ onExportPNG: Lt,
448
+ onDrilldown: X ? () => X() : void 0,
449
+ onToggleComments: A ? void 0 : Et,
450
+ commentsOpen: xt,
451
+ commentCount: Ct ? Tt : void 0,
452
+ onExplain: A || z ? void 0 : et,
453
+ explainOpen: k,
454
+ onSpotOutliers: At.length > 0 ? () => Mt(!0) : void 0,
455
+ onReconcile: Ft && !z ? () => Pt(!0) : void 0
435
456
  }),
436
- ot && st,
437
- wt.length > 0 && /* @__PURE__ */ m("div", {
457
+ k && !z && tt,
458
+ Ot.length > 0 && /* @__PURE__ */ y("div", {
438
459
  role: "status",
439
460
  "data-testid": "widget-filter-not-applicable",
440
461
  className: "mx-3 mt-2 rounded bg-status-warning-bg-subtle px-2 py-1 text-xs text-status-warning-text",
441
- children: wt.map((e) => lt("bigconsole.widget.filterNotApplicable", "Filter '{{name}}' does not apply to this widget (no field '{{field}}')", {
462
+ children: Ot.map((e) => I("bigconsole.widget.filterNotApplicable", "Filter '{{name}}' does not apply to this widget (no field '{{field}}')", {
442
463
  name: e.name,
443
464
  field: e.field
444
465
  })).join(" ")
445
466
  }),
446
- /* @__PURE__ */ m("div", {
467
+ /* @__PURE__ */ y("div", {
447
468
  className: `
448
469
  flex-1 overflow-hidden min-h-0 min-w-0
449
- ${C.compactMode ? "p-2" : "p-3 sm:p-4"}
450
- ${Z && !w ? "cursor-pointer" : ""}
470
+ ${j.compactMode ? "p-2" : "p-3 sm:p-4"}
471
+ ${Q && !M ? "cursor-pointer" : ""}
451
472
  `,
452
- title: Z && !w ? "Click data to drill down" : void 0,
453
- children: /* @__PURE__ */ m("div", {
473
+ title: Q && !M ? "Click data to drill down" : void 0,
474
+ children: /* @__PURE__ */ y("div", {
454
475
  className: "h-full min-w-0 overflow-auto",
455
- children: qt()
476
+ children: $t()
456
477
  })
457
478
  }),
458
- y && y.length > 0 && !V && !H && /* @__PURE__ */ m("div", {
479
+ E && E.length > 0 && !U && !W && !z && /* @__PURE__ */ y("div", {
459
480
  className: "min-w-0 border-t border-[var(--color-border-subtle)] bg-bg-sunken px-3 py-2 sm:px-4",
460
481
  style: { flexShrink: 0 },
461
- children: /* @__PURE__ */ m(Oe, {
462
- actions: y,
463
- context: Gt,
464
- onAction: b,
465
- disabled: w,
482
+ children: /* @__PURE__ */ y(Ee, {
483
+ actions: E,
484
+ context: Xt,
485
+ onAction: D,
486
+ disabled: M,
466
487
  layout: "horizontal",
467
488
  size: "sm"
468
489
  })
469
490
  }),
470
- Z && !w && /* @__PURE__ */ m("div", {
491
+ Q && !M && /* @__PURE__ */ y("div", {
471
492
  className: "\n absolute bottom-2 right-2\n opacity-0 group-hover:opacity-100\n transition-opacity duration-200\n ",
472
493
  title: "Click to drill down",
473
- children: /* @__PURE__ */ m("svg", {
494
+ children: /* @__PURE__ */ y("svg", {
474
495
  className: "w-4 h-4 text-text-secondary",
475
496
  fill: "none",
476
497
  stroke: "currentColor",
477
498
  viewBox: "0 0 24 24",
478
- children: /* @__PURE__ */ m("path", {
499
+ children: /* @__PURE__ */ y("path", {
479
500
  strokeLinecap: "round",
480
501
  strokeLinejoin: "round",
481
502
  strokeWidth: 2,
@@ -483,48 +504,66 @@ var it = l(function({ widget: i, children: c, data: l, className: h = "", isLoad
483
504
  })
484
505
  })
485
506
  }),
486
- _t && /* @__PURE__ */ m(s, {
507
+ xt && /* @__PURE__ */ y(d, {
487
508
  fallback: null,
488
- children: /* @__PURE__ */ m(nt, {
489
- widgetId: i.id,
490
- onClose: () => vt(!1)
509
+ children: /* @__PURE__ */ y(Qe, {
510
+ widgetId: s.id,
511
+ onClose: () => St(!1)
491
512
  })
492
513
  }),
493
- /* @__PURE__ */ m(xe, {
494
- open: Dt,
495
- onClose: () => Ot(!1),
496
- widgetTitle: i.title,
497
- series: Et
514
+ /* @__PURE__ */ y(ye, {
515
+ open: jt,
516
+ onClose: () => Mt(!1),
517
+ widgetTitle: s.title,
518
+ series: At
498
519
  }),
499
- kt && /* @__PURE__ */ m(s, {
520
+ Nt && !z && /* @__PURE__ */ y(d, {
500
521
  fallback: null,
501
- children: /* @__PURE__ */ m(Pe, {
502
- open: kt,
503
- onClose: () => At(!1),
504
- widget: i
522
+ children: /* @__PURE__ */ y(Ae, {
523
+ open: Nt,
524
+ onClose: () => Pt(!1),
525
+ widget: s
505
526
  })
506
527
  })
507
528
  ]
508
529
  });
509
- }, h), g = c(() => import("../explore/SavedQueryWidget.js").then((e) => ({ default: e.SavedQueryWidget })));
510
- function _({ widget: e }) {
511
- return r((e) => e.viewMode === "edit") ? /* @__PURE__ */ m("div", {
530
+ }, x), C = f(() => import("../explore/SavedQueryWidget.js").then((e) => ({ default: e.SavedQueryWidget })));
531
+ function w({ widget: e }) {
532
+ return r((e) => e.viewMode === "edit") ? /* @__PURE__ */ y("div", {
512
533
  className: "float-right ml-2",
513
- children: /* @__PURE__ */ m(i, {
534
+ children: /* @__PURE__ */ y(s, {
514
535
  widget: e,
515
536
  isEditMode: !0
516
537
  })
517
538
  }) : null;
518
539
  }
519
- var v = (e) => e.widget.savedQueryId ? /* @__PURE__ */ m(s, {
520
- fallback: /* @__PURE__ */ m("span", {
521
- role: "status",
522
- children: "Loading widget…"
523
- }),
524
- children: /* @__PURE__ */ m(g, {
525
- id: e.widget.id,
526
- title: e.widget.title,
527
- controls: e.previewOnly ? void 0 : /* @__PURE__ */ m(_, { widget: e.widget })
528
- })
529
- }) : /* @__PURE__ */ m(it, { ...e });
530
- export { v as WidgetWrapper, v as default };
540
+ function T({ title: e }) {
541
+ let { t } = v(), n = o({
542
+ historyAvailable: !1,
543
+ reason: "HISTORY_NOT_AVAILABLE"
544
+ }, t);
545
+ return /* @__PURE__ */ b("section", {
546
+ "aria-label": e ?? void 0,
547
+ "data-testid": "saved-query-history-unavailable",
548
+ className: "h-full min-w-0 rounded-lg border border-[var(--color-border-subtle)] bg-bg-surface p-3",
549
+ children: [e && /* @__PURE__ */ y("h3", {
550
+ className: "mb-2 truncate text-sm font-medium text-text-primary",
551
+ children: e
552
+ }), n && /* @__PURE__ */ y(l, { error: n })]
553
+ });
554
+ }
555
+ var E = (e) => {
556
+ let { asOf: t } = a();
557
+ return e.widget.savedQueryId ? t ? /* @__PURE__ */ y(T, { title: e.widget.title }) : /* @__PURE__ */ y(d, {
558
+ fallback: /* @__PURE__ */ y("span", {
559
+ role: "status",
560
+ children: "Loading widget…"
561
+ }),
562
+ children: /* @__PURE__ */ y(C, {
563
+ id: e.widget.id,
564
+ title: e.widget.title,
565
+ controls: e.previewOnly ? void 0 : /* @__PURE__ */ y(w, { widget: e.widget })
566
+ })
567
+ }) : /* @__PURE__ */ y(S, { ...e });
568
+ };
569
+ export { E as WidgetWrapper, E as default };