@burdenoff/microfe-bigconsole 2026.1116.1 → 2026.1117.2

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