@burdenoff/microfe-bigconsole 2026.1122.1 → 2026.1122.3

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.
@@ -12,57 +12,58 @@ import ce from "../../hooks/useDrilldown.js";
12
12
  import { getWidgetDefinition as le } from "./WidgetRegistry.js";
13
13
  import { resolveTextData as ue } from "./text-widget/textData.js";
14
14
  import { WidgetHeader as de } from "./WidgetHeader.js";
15
- import { useAsOf as fe } from "../../asof/AsOfProvider.js";
16
- import { formatWhen as pe } from "../../asof/AsOfControl.js";
15
+ import { asOfFileStamp as fe } from "../../asof/asOfParam.js";
16
+ import { useAsOf as pe } from "../../asof/AsOfProvider.js";
17
+ import { formatWhen as me } from "../../asof/AsOfControl.js";
17
18
  import { asOfUnavailableMessage as i } from "../../asof/asOfMessage.js";
18
19
  import { WidgetMenu as a } from "./WidgetMenu.js";
19
- import { useBigConsoleSettings as me } from "../../hooks/useBigConsoleSettings.js";
20
+ import { useBigConsoleSettings as he } from "../../hooks/useBigConsoleSettings.js";
20
21
  import "../../asof/index.js";
21
- import { compareWidget as he, isCompareSupported as ge } from "../../compare/compareEngine.js";
22
- import { readCompareSide as _e } from "../../compare/compareSide.js";
23
- import { WidgetCompareView as ve } from "./WidgetCompareView.js";
22
+ import { compareWidget as ge, isCompareSupported as _e } from "../../compare/compareEngine.js";
23
+ import { readCompareSide as ve } from "../../compare/compareSide.js";
24
+ import { WidgetCompareView as ye } from "./WidgetCompareView.js";
24
25
  import { WidgetLoadingState as o } from "./states/LoadingState.js";
25
26
  import { WidgetErrorState as s } from "./states/ErrorState.js";
26
- import { WidgetEmptyState as ye } from "./states/EmptyState.js";
27
- import { WidgetErrorBoundary as be } from "./WidgetErrorBoundary.js";
28
- import { FilterNotAppliedNotice as xe } from "./FilterNotAppliedNotice.js";
29
- import { hasCustomIframeConfig as Se, hasRenderableCustomConfig as Ce } from "./custom/config.js";
30
- import { getBindingForWidget as we } from "../../utils/widgetBinding.js";
31
- import { filterMetaFromDashboard as Te, findInapplicableFilters as Ee } from "../../utils/globalFilterMatching.js";
32
- import { applyGlobalFilters as De } from "../../utils/applyGlobalFilters.js";
33
- import { resolveMetricCardData as Oe } from "./metric-card/metricCardData.js";
34
- import { extractOutlierSeries as ke } from "../insights/outlierSeries.js";
35
- import { OutlierSpottingDialog as Ae } from "../insights/OutlierSpottingDialog.js";
36
- import { canReconcileWidget as je } from "../reconcile/reconcileModel.js";
37
- import { canExplainKpiChange as Me, readsAnalyzableSource as Ne } from "../kpi-change/kpiChangeModel.js";
38
- import { KpiChangeDialog as Pe } from "../kpi-change/KpiChangeDialog.js";
39
- import { resolveWidgetDataPath as Fe, resolveWidgetDisplayData as Ie, widgetDataSourcePolicy as Le, widgetExportRows as Re } from "../../utils/widgetDisplayData.js";
40
- import { WidgetRendererFactory as ze } from "../../renderers/factory/WidgetRendererFactory.js";
41
- import { WidgetActions as Be } from "./widget-actions/WidgetActions.js";
27
+ import { WidgetEmptyState as be } from "./states/EmptyState.js";
28
+ import { WidgetErrorBoundary as xe } from "./WidgetErrorBoundary.js";
29
+ import { FilterNotAppliedNotice as Se } from "./FilterNotAppliedNotice.js";
30
+ import { hasCustomIframeConfig as Ce, hasRenderableCustomConfig as we } from "./custom/config.js";
31
+ import { getBindingForWidget as Te } from "../../utils/widgetBinding.js";
32
+ import { filterMetaFromDashboard as Ee, findInapplicableFilters as De } from "../../utils/globalFilterMatching.js";
33
+ import { applyGlobalFilters as Oe } from "../../utils/applyGlobalFilters.js";
34
+ import { resolveMetricCardData as ke } from "./metric-card/metricCardData.js";
35
+ import { extractOutlierSeries as Ae } from "../insights/outlierSeries.js";
36
+ import { OutlierSpottingDialog as je } from "../insights/OutlierSpottingDialog.js";
37
+ import { canReconcileWidget as Me } from "../reconcile/reconcileModel.js";
38
+ import { canExplainKpiChange as Ne, readsAnalyzableSource as Pe } from "../kpi-change/kpiChangeModel.js";
39
+ import { KpiChangeDialog as Fe } from "../kpi-change/KpiChangeDialog.js";
40
+ import { resolveWidgetDataPath as Ie, resolveWidgetDisplayData as Le, widgetDataSourcePolicy as Re, widgetExportRows as ze } from "../../utils/widgetDisplayData.js";
41
+ import { WidgetRendererFactory as Be } from "../../renderers/factory/WidgetRendererFactory.js";
42
+ import { WidgetActions as Ve } from "./widget-actions/WidgetActions.js";
42
43
  import "./widget-actions/index.js";
43
- import { dashboardSuggestAnchorProps as Ve } from "../../proactive/entities.js";
44
- import { Suspense as c, lazy as l, memo as u, useCallback as d, useEffect as He, useMemo as f, useRef as p, useState as m } from "react";
45
- import { useI18n as Ue } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
46
- import { useQuery as We } from "@apollo/client/react";
47
- import { jsx as h, jsxs as Ge } from "react/jsx-runtime";
44
+ import { dashboardSuggestAnchorProps as He } from "../../proactive/entities.js";
45
+ import { Suspense as c, lazy as l, memo as u, useCallback as d, useEffect as Ue, useMemo as f, useRef as p, useState as m } from "react";
46
+ import { useI18n as We } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
47
+ import { useQuery as Ge } from "@apollo/client/react";
48
+ import { jsx as h, jsxs as Ke } from "react/jsx-runtime";
48
49
  // src/bigconsole/components/widgets/WidgetWrapper.tsx
49
- var Ke = l(() => import("../reconcile/KpiReconcileDialog.js").then((e) => ({ default: e.KpiReconcileDialog }))), qe = l(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), Je = l(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), Ye = l(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), Xe = l(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), Ze = l(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), Qe = l(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), $e = l(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), et = l(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), tt = l(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), nt = l(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), rt = l(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), it = l(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), at = l(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), ot = l(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), st = l(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), ct = l(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), lt = l(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget })));
50
+ var qe = l(() => import("../reconcile/KpiReconcileDialog.js").then((e) => ({ default: e.KpiReconcileDialog }))), Je = l(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), Ye = l(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), Xe = l(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), Ze = l(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), Qe = l(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), $e = l(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), et = l(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), tt = l(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), nt = l(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), rt = l(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), it = l(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), at = l(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), ot = l(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), st = l(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), ct = l(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), lt = l(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), ut = l(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget })));
50
51
  l(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget })));
51
- var ut = l(() => import("./form/index.js").then((e) => ({ default: e.FormWidget }))), dt = l(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.SankeyWidget }))), ft = l(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.BoxPlotWidget }))), pt = l(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.WaterfallWidget }))), mt = l(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments }))), ht = /* @__PURE__ */ new Set([
52
+ var dt = l(() => import("./form/index.js").then((e) => ({ default: e.FormWidget }))), ft = l(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.SankeyWidget }))), pt = l(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.BoxPlotWidget }))), mt = l(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.WaterfallWidget }))), ht = l(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments }))), gt = /* @__PURE__ */ new Set([
52
53
  "text",
53
54
  "iframe",
54
55
  "form",
55
56
  "adaptive_card"
56
57
  ]);
57
- function gt(e, t) {
58
+ function _t(e, t) {
58
59
  return e.previewOnly === t.previewOnly && e.observeOnly === t.observeOnly && 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;
59
60
  }
60
- var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoading: _t, error: g, onRefresh: _, onDrilldown: vt, actions: v, onAction: y, filterValues: b, onToggleNarrative: yt, narrativeOpen: bt = !1, narrativePanel: xt, previewOnly: x = !1, observeOnly: St = !1 }) {
61
- let S = me(), Ct = r((e) => e.viewMode === "edit"), C = !x && Ct, w = t((e) => e.selectWidget), T = e(a.id), wt = n(a.id), E = ee(), { t: D } = Ue(), Tt = a.dashboardId, { data: Et } = We(re, {
62
- variables: { id: Tt ?? "" },
63
- skip: !Tt,
61
+ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoading: vt, error: g, onRefresh: _, onDrilldown: yt, actions: v, onAction: y, filterValues: b, onToggleNarrative: bt, narrativeOpen: xt = !1, narrativePanel: St, previewOnly: x = !1, observeOnly: Ct = !1 }) {
62
+ let S = he(), wt = r((e) => e.viewMode === "edit"), C = !x && wt, w = t((e) => e.selectWidget), T = e(a.id), Tt = n(a.id), E = ee(), { t: D } = We(), Et = a.dashboardId, { data: Dt } = Ge(re, {
63
+ variables: { id: Et ?? "" },
64
+ skip: !Et,
64
65
  fetchPolicy: "cache-only"
65
- }), Dt = Et?.getDashboard?.globalFilters, O = f(() => Te(Dt), [Dt]), k = f(() => Object.fromEntries(Object.entries(O).map(([e, t]) => [e, t.field])), [O]), A = f(() => we(a), [a]), { hasDataSource: j, allowSamples: Ot, mockSource: M } = Le(a, A), { asOf: N, compareTo: P } = fe(), { data: F, loading: kt, error: At, asOfInfo: jt } = te(a.id, {
66
+ }), Ot = Dt?.getDashboard?.globalFilters, O = f(() => Ee(Ot), [Ot]), k = f(() => Object.fromEntries(Object.entries(O).map(([e, t]) => [e, t.field])), [O]), A = f(() => Te(a), [a]), { hasDataSource: j, allowSamples: kt, mockSource: M } = Re(a, A), { asOf: N, compareTo: P } = pe(), { data: F, loading: At, error: jt, asOfInfo: Mt } = te(a.id, {
66
67
  skip: x || !j,
67
68
  pollInterval: N ? 0 : (a.refreshInterval ?? 0) * 1e3 || 0,
68
69
  asOf: N
@@ -82,25 +83,25 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
82
83
  I,
83
84
  E,
84
85
  b
85
- ]), R = Object.keys(L).length > 0, z = _t ?? (kt && !F) ?? wt.isLoading, Mt = N ? i(jt, D) : null, B = g ?? Mt ?? At?.message ?? (N ? null : wt.errorMessage), Nt = le(a.type), V = p(_);
86
- He(() => {
86
+ ]), R = Object.keys(L).length > 0, z = vt ?? (At && !F) ?? Tt.isLoading, Nt = N ? i(Mt, D) : null, B = g ?? Nt ?? jt?.message ?? (N ? null : Tt.errorMessage), Pt = le(a.type), V = p(_);
87
+ Ue(() => {
87
88
  V.current = _;
88
89
  }, [_]);
89
- let Pt = d(async () => {
90
+ let Ft = d(async () => {
90
91
  V.current && await V.current();
91
- }, []), { timeUntilRefresh: Ft, isPaused: It } = ae({
92
+ }, []), { timeUntilRefresh: It, isPaused: Lt } = ae({
92
93
  widgetId: a.id,
93
94
  refreshInterval: a.refreshInterval,
94
- onRefresh: Pt,
95
+ onRefresh: Ft,
95
96
  enabled: !x && !C && !!a.refreshInterval && !N
96
- }), Lt = p(null), [Rt, zt] = m(!1), [Bt, Vt] = m(!1), { count: Ht } = oe(a.id, Bt), Ut = d(() => {
97
- Vt(!0), zt((e) => !e);
98
- }, []), H = f(() => Ie({
97
+ }), Rt = p(null), [zt, Bt] = m(!1), [Vt, Ht] = m(!1), { count: Ut } = oe(a.id, Vt && !N), Wt = d(() => {
98
+ Ht(!0), Bt((e) => !e);
99
+ }, []), H = f(() => Le({
99
100
  explicit: u,
100
101
  fetched: F,
101
102
  persisted: a.data,
102
103
  config: a.config,
103
- allowSamples: Ot,
104
+ allowSamples: kt,
104
105
  mockSource: M,
105
106
  widgetType: a.type,
106
107
  asOf: N !== null
@@ -108,13 +109,13 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
108
109
  u,
109
110
  F,
110
111
  a,
111
- Ot,
112
+ kt,
112
113
  M,
113
114
  N
114
115
  ]), U = f(() => {
115
116
  let e = H.data;
116
- return Fe(e, a.config);
117
- }, [H, a.config]), W = f(() => R ? De(U, {
117
+ return Ie(e, a.config);
118
+ }, [H, a.config]), W = f(() => R ? Oe(U, {
118
119
  filterValues: L,
119
120
  filterFieldMap: k,
120
121
  widgetType: a.type
@@ -124,7 +125,7 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
124
125
  L,
125
126
  k,
126
127
  a.type
127
- ]), G = N !== null && P !== null && ge(a.type), K = ne(a.id, P, x || !j || !G), q = d((e) => R ? De(e, {
128
+ ]), G = N !== null && P !== null && _e(a.type), K = ne(a.id, P, x || !j || !G), q = d((e) => R ? Oe(e, {
128
129
  filterValues: L,
129
130
  filterFieldMap: k,
130
131
  widgetType: a.type
@@ -133,14 +134,14 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
133
134
  L,
134
135
  k,
135
136
  a.type
136
- ]), Wt = f(() => {
137
+ ]), Gt = f(() => {
137
138
  if (!G) return null;
138
139
  let e = a.config;
139
- return he({
140
+ return ge({
140
141
  widgetType: a.type,
141
142
  config: e,
142
- from: _e(F, e, q),
143
- to: _e(K.data, e, q)
143
+ from: ve(F, e, q),
144
+ to: ve(K.data, e, q)
144
145
  });
145
146
  }, [
146
147
  G,
@@ -150,30 +151,30 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
150
151
  K.data,
151
152
  q
152
153
  ]), J = f(() => ({
153
- from: N ? pe(N) : "",
154
- to: P instanceof Date ? pe(P) : D("bigconsole.compare.label.now", "Now")
154
+ from: N ? me(N) : "",
155
+ to: P instanceof Date ? me(P) : D("bigconsole.compare.label.now", "Now")
155
156
  }), [
156
157
  N,
157
158
  P,
158
159
  D
159
- ]), Gt = W !== null && H.isSample, Kt = f(() => {
160
- if (ht.has(a.type)) return [];
161
- let e = a.type === "metric_card" && Oe(U, a.config).source === "scalar";
162
- return Ee(U, O, L, a.type, { precomputedValue: e });
160
+ ]), Kt = W !== null && H.isSample, qt = f(() => {
161
+ if (gt.has(a.type)) return [];
162
+ let e = a.type === "metric_card" && ke(U, a.config).source === "scalar";
163
+ return De(U, O, L, a.type, { precomputedValue: e });
163
164
  }, [
164
165
  U,
165
166
  O,
166
167
  L,
167
168
  a.type,
168
169
  a.config
169
- ]), qt = f(() => Re(W, a.type), [W, a.type]), Jt = f(() => {
170
+ ]), Jt = f(() => ze(W, a.type), [W, a.type]), Yt = f(() => {
170
171
  let e = a.config;
171
- return ke(W, {
172
+ return Ae(W, {
172
173
  xAxisKey: typeof e?.xAxisKey == "string" ? e.xAxisKey : void 0,
173
174
  selectedFields: Array.isArray(e?.selectedFields) ? e.selectedFields.filter((e) => typeof e == "string") : void 0
174
175
  });
175
- }, [W, a.config]), [Yt, Xt] = m(!1), [Zt, Qt] = m(!1), $t = je(a.type, x), [en, tn] = m(!1), nn = Me(a.type, x || St, {
176
- readsDataSink: j && !M && Ne({
176
+ }, [W, a.config]), [Xt, Zt] = m(!1), [Qt, $t] = m(!1), en = Me(a.type, x), [tn, nn] = m(!1), rn = Ne(a.type, x || Ct, {
177
+ readsDataSink: j && !M && Pe({
177
178
  kind: A.source.kind,
178
179
  ref: A.source.ref,
179
180
  parserId: A.parserId ?? a.parserId,
@@ -182,16 +183,16 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
182
183
  }),
183
184
  internalType: a.config?._internalWidgetType,
184
185
  filtered: R
185
- }), { exportCSV: rn, exportPNG: an } = se(a, {
186
- data: qt,
187
- containerRef: Lt
188
- }), { executeDrilldown: on, canDrilldown: sn } = ce({ onDrilldown: (e, t) => {
189
- vt?.(e);
190
- } }), Y = f(() => sn(a) && !N, [
186
+ }), { exportCSV: an, exportPNG: on } = se(a, {
187
+ data: Jt,
188
+ containerRef: Rt
189
+ }), { executeDrilldown: sn, canDrilldown: cn } = ce({ onDrilldown: (e, t) => {
190
+ yt?.(e);
191
+ } }), Y = f(() => cn(a) && !N, [
191
192
  a,
192
- sn,
193
+ cn,
193
194
  N
194
- ]), cn = d((e) => {
195
+ ]), ln = d((e) => {
195
196
  if (!a.drilldown?.enabled) return;
196
197
  let t = {
197
198
  selectedData: e || {},
@@ -204,18 +205,18 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
204
205
  },
205
206
  sourceDashboardId: a.dashboardId
206
207
  };
207
- on(a.drilldown, t);
208
+ sn(a.drilldown, t);
208
209
  }, [
209
210
  a,
210
211
  W,
211
212
  E,
212
- on
213
- ]), X = Y && !C && !N ? cn : void 0, Z = p(null), ln = d((e) => {
213
+ sn
214
+ ]), X = Y && !C && !N ? ln : void 0, Z = p(null), un = d((e) => {
214
215
  Z.current = {
215
216
  x: e.clientX,
216
217
  y: e.clientY
217
218
  };
218
- }, []), un = d((e) => {
219
+ }, []), dn = d((e) => {
219
220
  if (e.stopPropagation(), Z.current) {
220
221
  let t = Math.abs(e.clientX - Z.current.x), n = Math.abs(e.clientY - Z.current.y);
221
222
  if (t > 5 || n > 5) {
@@ -228,20 +229,20 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
228
229
  C,
229
230
  w,
230
231
  a.id
231
- ]), dn = d((e) => {
232
+ ]), fn = d((e) => {
232
233
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), C && w(a.id));
233
234
  }, [
234
235
  C,
235
236
  w,
236
237
  a.id
237
- ]), fn = f(() => a.type === "custom" && Ce(a.config), [a.type, a.config]), pn = f(() => a.type === "custom" && Se(a.config), [a.type, a.config]), Q = Y && !pn, mn = a.type === "iframe" || a.type === "custom", hn = f(() => a.type === "text" && ue(a.config, W).hasContent, [
238
+ ]), pn = f(() => a.type === "custom" && we(a.config), [a.type, a.config]), mn = f(() => a.type === "custom" && Ce(a.config), [a.type, a.config]), Q = Y && !mn, hn = a.type === "iframe" || a.type === "custom", gn = f(() => a.type === "text" && ue(a.config, W).hasContent, [
238
239
  a.type,
239
240
  a.config,
240
241
  W
241
- ]), gn = !z && !B && !W && !fn && !hn, $ = f(() => a.renderer, [a]), _n = f(() => $ && $ !== "BIGCONSOLE", [$]), vn = f(() => ({
242
+ ]), _n = !z && !B && !W && !pn && !gn, $ = f(() => a.renderer, [a]), vn = f(() => $ && $ !== "BIGCONSOLE", [$]), yn = f(() => ({
242
243
  widgetId: a.id,
243
244
  data: W || {}
244
- }), [a.id, W]), yn = d((e, t) => {
245
+ }), [a.id, W]), bn = d((e, t) => {
245
246
  if (!y || N) return;
246
247
  let n = v?.find((t) => t.name === e.name);
247
248
  y(n || e, t);
@@ -249,7 +250,7 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
249
250
  y,
250
251
  v,
251
252
  N
252
- ]), bn = d(() => {
253
+ ]), xn = d(() => {
253
254
  let e = (() => {
254
255
  if (!W) return W;
255
256
  if (a.type === "pivot_table") {
@@ -300,7 +301,7 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
300
301
  widget: a,
301
302
  onDrilldown: X
302
303
  };
303
- if (_n) {
304
+ if (vn) {
304
305
  let e = {};
305
306
  if (W && typeof W == "object" && !Array.isArray(W) && Object.keys(W).length > 0 && (e = { ...W }), a.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
306
307
  let t = a.config?.valueField;
@@ -315,7 +316,7 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
315
316
  };
316
317
  }
317
318
  }
318
- return /* @__PURE__ */ h(ze, {
319
+ return /* @__PURE__ */ h(Be, {
319
320
  widget: a,
320
321
  data: e,
321
322
  isEditMode: C,
@@ -323,118 +324,118 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
323
324
  isLoading: z,
324
325
  error: B,
325
326
  onDrilldown: X,
326
- onAction: N ? void 0 : yn
327
+ onAction: N ? void 0 : bn
327
328
  });
328
329
  }
329
330
  switch (a.type?.toLowerCase() || "") {
330
- case "metric_card": return /* @__PURE__ */ h(qe, {
331
+ case "metric_card": return /* @__PURE__ */ h(Je, {
331
332
  ...t,
332
333
  data: e
333
334
  });
334
- case "kpi_card_comparison": return /* @__PURE__ */ h(at, {
335
+ case "kpi_card_comparison": return /* @__PURE__ */ h(ot, {
335
336
  ...t,
336
337
  data: e
337
338
  });
338
339
  case "chart":
339
- case "funnel_chart": return /* @__PURE__ */ h(Je, {
340
+ case "funnel_chart": return /* @__PURE__ */ h(Ye, {
340
341
  ...t,
341
342
  data: e
342
343
  });
343
- case "waterfall": return /* @__PURE__ */ h(pt, {
344
+ case "waterfall": return /* @__PURE__ */ h(mt, {
344
345
  ...t,
345
346
  data: e
346
347
  });
347
- case "sankey": return /* @__PURE__ */ h(dt, {
348
+ case "sankey": return /* @__PURE__ */ h(ft, {
348
349
  ...t,
349
350
  data: e
350
351
  });
351
- case "box_plot": return /* @__PURE__ */ h(ft, {
352
+ case "box_plot": return /* @__PURE__ */ h(pt, {
352
353
  ...t,
353
354
  data: e
354
355
  });
355
- case "table": return /* @__PURE__ */ h(Ye, {
356
+ case "table": return /* @__PURE__ */ h(Xe, {
356
357
  ...t,
357
358
  data: e
358
359
  });
359
- case "pivot_table": return /* @__PURE__ */ h(Xe, {
360
+ case "pivot_table": return /* @__PURE__ */ h(Ze, {
360
361
  ...t,
361
362
  data: e
362
363
  });
363
- case "gauge": return /* @__PURE__ */ h(Ze, {
364
+ case "gauge": return /* @__PURE__ */ h(Qe, {
364
365
  ...t,
365
366
  data: e
366
367
  });
367
- case "progress": return /* @__PURE__ */ h(Qe, {
368
+ case "progress": return /* @__PURE__ */ h($e, {
368
369
  ...t,
369
370
  data: e
370
371
  });
371
- case "list": return /* @__PURE__ */ h($e, {
372
+ case "list": return /* @__PURE__ */ h(et, {
372
373
  ...t,
373
374
  data: e
374
375
  });
375
- case "heatmap": return /* @__PURE__ */ h(et, {
376
+ case "heatmap": return /* @__PURE__ */ h(tt, {
376
377
  ...t,
377
378
  data: e
378
379
  });
379
- case "retention": return /* @__PURE__ */ h(tt, {
380
+ case "retention": return /* @__PURE__ */ h(nt, {
380
381
  ...t,
381
382
  data: e
382
383
  });
383
- case "calendar": return /* @__PURE__ */ h(nt, {
384
+ case "calendar": return /* @__PURE__ */ h(rt, {
384
385
  ...t,
385
386
  data: e
386
387
  });
387
- case "timeline": return /* @__PURE__ */ h(it, {
388
+ case "timeline": return /* @__PURE__ */ h(at, {
388
389
  ...t,
389
390
  data: e
390
391
  });
391
- case "kanban": return /* @__PURE__ */ h(rt, {
392
+ case "kanban": return /* @__PURE__ */ h(it, {
392
393
  ...t,
393
394
  data: e
394
395
  });
395
- case "form": return /* @__PURE__ */ h(ut, {
396
+ case "form": return /* @__PURE__ */ h(dt, {
396
397
  ...t,
397
398
  data: e
398
399
  });
399
- case "text": return /* @__PURE__ */ h(ot, {
400
+ case "text": return /* @__PURE__ */ h(st, {
400
401
  ...t,
401
402
  data: e
402
403
  });
403
- case "iframe": return /* @__PURE__ */ h(ct, {
404
+ case "iframe": return /* @__PURE__ */ h(lt, {
404
405
  ...t,
405
406
  data: e
406
407
  });
407
- case "map": return /* @__PURE__ */ h(st, {
408
+ case "map": return /* @__PURE__ */ h(ct, {
408
409
  ...t,
409
410
  data: e
410
411
  });
411
- case "custom": return /* @__PURE__ */ h(lt, {
412
+ case "custom": return /* @__PURE__ */ h(ut, {
412
413
  ...t,
413
414
  data: e
414
415
  });
415
- default: return l || /* @__PURE__ */ h(ye, { widgetType: a.type });
416
+ default: return l || /* @__PURE__ */ h(be, { widgetType: a.type });
416
417
  }
417
418
  }, [
418
419
  a,
419
420
  W,
420
421
  l,
421
422
  X,
422
- _n,
423
+ vn,
423
424
  C,
424
425
  T,
425
426
  z,
426
427
  B,
427
- yn,
428
+ bn,
428
429
  N
429
- ]), xn = () => {
430
- if (N && mn) {
430
+ ]), Sn = () => {
431
+ if (N && hn) {
431
432
  let e = i({
432
433
  historyAvailable: !1,
433
434
  reason: "HISTORY_NOT_AVAILABLE"
434
435
  }, D);
435
436
  return /* @__PURE__ */ h(s, { error: e ?? "" });
436
437
  }
437
- if (N && P && !ge(a.type)) return /* @__PURE__ */ h(ve, {
438
+ if (N && P && !_e(a.type)) return /* @__PURE__ */ h(ye, {
438
439
  result: {
439
440
  kind: "unsupported",
440
441
  widgetType: a.type
@@ -442,11 +443,11 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
442
443
  fromLabel: J.from,
443
444
  toLabel: J.to
444
445
  });
445
- if (Wt) {
446
+ if (Gt) {
446
447
  if (z || K.loading) return /* @__PURE__ */ h(o, {});
447
- let e = At?.message ?? K.error?.message ?? g;
448
- return e ? /* @__PURE__ */ h(s, { error: e }) : /* @__PURE__ */ h(ve, {
449
- result: Wt,
448
+ let e = jt?.message ?? K.error?.message ?? g;
449
+ return e ? /* @__PURE__ */ h(s, { error: e }) : /* @__PURE__ */ h(ye, {
450
+ result: Gt,
450
451
  fromLabel: J.from,
451
452
  toLabel: J.to,
452
453
  config: a.config
@@ -457,7 +458,7 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
457
458
  error: B,
458
459
  onRetry: N ? void 0 : _
459
460
  });
460
- if (gn && !l) return /* @__PURE__ */ h(ye, {
461
+ if (_n && !l) return /* @__PURE__ */ h(be, {
461
462
  widgetType: a.type,
462
463
  hideEditHint: x,
463
464
  hasDataSource: j,
@@ -465,20 +466,20 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
465
466
  templateSlot: typeof a.metadata?.templateDataSinkSlot == "string" ? a.metadata.templateDataSinkSlot : null
466
467
  });
467
468
  let e = `${A.source.kind}|${A.source.ref ?? ""}|${A.parserId ?? ""}|${a.updatedAt ?? ""}`;
468
- return /* @__PURE__ */ h(be, {
469
+ return /* @__PURE__ */ h(xe, {
469
470
  widgetId: a.id,
470
471
  widgetType: a.type,
471
472
  widgetTitle: a.title,
472
473
  resetKey: e,
473
474
  children: l ?? /* @__PURE__ */ h(c, {
474
475
  fallback: /* @__PURE__ */ h(o, {}),
475
- children: bn()
476
+ children: xn()
476
477
  })
477
478
  });
478
479
  };
479
- return /* @__PURE__ */ Ge("div", {
480
- ref: Lt,
481
- ...x ? {} : Ve(a.dashboardId, a.id),
480
+ return /* @__PURE__ */ Ke("div", {
481
+ ref: Rt,
482
+ ...x ? {} : He(a.dashboardId, a.id),
482
483
  className: `
483
484
  group relative flex flex-col
484
485
  h-full w-full min-w-0
@@ -488,11 +489,11 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
488
489
  ${S.animationsEnabled ? "motion-safe:transition-[box-shadow,border-color] motion-safe:duration-200" : ""}
489
490
  ${T && C ? "border-[var(--color-action-primary-border)] ring-2 ring-[var(--color-action-primary-border)]/30 shadow-[var(--shadow-elevation-2)]" : S.showWidgetBorders ? "border-[var(--color-border-subtle)] hover:border-action-primary-bg hover:shadow-[var(--shadow-elevation-2)]" : "border-transparent"}
490
491
  ${C ? "cursor-pointer" : ""}
491
- ${gt}
492
+ ${_t}
492
493
  `,
493
- onMouseDown: ln,
494
- onClick: un,
495
- onKeyDown: dn,
494
+ onMouseDown: un,
495
+ onClick: dn,
496
+ onKeyDown: fn,
496
497
  tabIndex: C ? 0 : -1,
497
498
  role: C ? "button" : void 0,
498
499
  "aria-selected": T,
@@ -503,35 +504,35 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
503
504
  /* @__PURE__ */ h(de, {
504
505
  widget: a,
505
506
  previewOnly: x,
506
- definition: Nt,
507
+ definition: Pt,
507
508
  isSelected: T,
508
509
  isEditMode: C,
509
510
  isLoading: z,
510
- isSampleData: Gt,
511
- timeUntilRefresh: a.refreshInterval && !It ? ie(Ft) : void 0,
511
+ isSampleData: Kt,
512
+ timeUntilRefresh: a.refreshInterval && !Lt ? ie(It) : void 0,
512
513
  hasDrilldown: Y,
513
514
  onRefresh: N ? void 0 : _,
514
- onExportCSV: qt ? rn : void 0,
515
- onExportPNG: an,
515
+ onExportCSV: Jt ? N ? () => an(`${a.title.replace(/\s+/g, "_").toLowerCase()}_${fe(N)}.csv`) : an : void 0,
516
+ onExportPNG: N ? void 0 : on,
516
517
  onDrilldown: X ? () => X() : void 0,
517
- onToggleComments: x ? void 0 : Ut,
518
- commentsOpen: Rt,
519
- commentCount: Bt ? Ht : void 0,
520
- onExplain: x || N ? void 0 : yt,
521
- explainOpen: bt,
522
- onSpotOutliers: Jt.length > 0 ? () => Xt(!0) : void 0,
523
- onReconcile: $t && !N ? () => Qt(!0) : void 0,
524
- onWhyDidItMove: nn && !N ? () => tn((e) => !e) : void 0,
525
- whyDidItMoveOpen: en
518
+ onToggleComments: x || N ? void 0 : Wt,
519
+ commentsOpen: zt,
520
+ commentCount: Vt ? Ut : void 0,
521
+ onExplain: x || N ? void 0 : bt,
522
+ explainOpen: xt,
523
+ onSpotOutliers: Yt.length > 0 ? () => Zt(!0) : void 0,
524
+ onReconcile: en && !N ? () => $t(!0) : void 0,
525
+ onWhyDidItMove: rn && !N ? () => nn((e) => !e) : void 0,
526
+ whyDidItMoveOpen: tn
526
527
  }),
527
- bt && !N && xt,
528
- en && !N && /* @__PURE__ */ h(Pe, {
528
+ xt && !N && St,
529
+ tn && !N && /* @__PURE__ */ h(Fe, {
529
530
  widgetId: a.id,
530
531
  open: !0,
531
- onClose: () => tn(!1)
532
+ onClose: () => nn(!1)
532
533
  }),
533
- /* @__PURE__ */ h(xe, {
534
- filters: Kt,
534
+ /* @__PURE__ */ h(Se, {
535
+ filters: qt,
535
536
  t: D
536
537
  }),
537
538
  /* @__PURE__ */ h("div", {
@@ -543,15 +544,15 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
543
544
  title: Q && !C ? "Click data to drill down" : void 0,
544
545
  children: /* @__PURE__ */ h("div", {
545
546
  className: "h-full min-w-0 overflow-auto",
546
- children: xn()
547
+ children: Sn()
547
548
  })
548
549
  }),
549
550
  v && v.length > 0 && !z && !B && !N && /* @__PURE__ */ h("div", {
550
551
  className: "min-w-0 border-t border-[var(--color-border-subtle)] bg-bg-sunken px-3 py-2 sm:px-4",
551
552
  style: { flexShrink: 0 },
552
- children: /* @__PURE__ */ h(Be, {
553
+ children: /* @__PURE__ */ h(Ve, {
553
554
  actions: v,
554
- context: vn,
555
+ context: yn,
555
556
  onAction: y,
556
557
  disabled: C,
557
558
  layout: "horizontal",
@@ -574,30 +575,30 @@ var _t = u(function({ widget: a, children: l, data: u, className: gt = "", isLoa
574
575
  })
575
576
  })
576
577
  }),
577
- Rt && /* @__PURE__ */ h(c, {
578
+ zt && !N && /* @__PURE__ */ h(c, {
578
579
  fallback: null,
579
- children: /* @__PURE__ */ h(mt, {
580
+ children: /* @__PURE__ */ h(ht, {
580
581
  widgetId: a.id,
581
- onClose: () => zt(!1)
582
+ onClose: () => Bt(!1)
582
583
  })
583
584
  }),
584
- /* @__PURE__ */ h(Ae, {
585
- open: Yt,
586
- onClose: () => Xt(!1),
585
+ /* @__PURE__ */ h(je, {
586
+ open: Xt,
587
+ onClose: () => Zt(!1),
587
588
  widgetTitle: a.title,
588
- series: Jt
589
+ series: Yt
589
590
  }),
590
- Zt && !N && /* @__PURE__ */ h(c, {
591
+ Qt && !N && /* @__PURE__ */ h(c, {
591
592
  fallback: null,
592
- children: /* @__PURE__ */ h(Ke, {
593
- open: Zt,
594
- onClose: () => Qt(!1),
593
+ children: /* @__PURE__ */ h(qe, {
594
+ open: Qt,
595
+ onClose: () => $t(!1),
595
596
  widget: a
596
597
  })
597
598
  })
598
599
  ]
599
600
  });
600
- }, gt), g = l(() => import("../explore/SavedQueryWidget.js").then((e) => ({ default: e.SavedQueryWidget })));
601
+ }, _t), g = l(() => import("../explore/SavedQueryWidget.js").then((e) => ({ default: e.SavedQueryWidget })));
601
602
  function _({ widget: e }) {
602
603
  return r((e) => e.viewMode === "edit") ? /* @__PURE__ */ h("div", {
603
604
  className: "float-right ml-2",
@@ -607,12 +608,12 @@ function _({ widget: e }) {
607
608
  })
608
609
  }) : null;
609
610
  }
610
- function vt({ title: e }) {
611
- let { t } = Ue(), n = i({
611
+ function yt({ title: e }) {
612
+ let { t } = We(), n = i({
612
613
  historyAvailable: !1,
613
614
  reason: "HISTORY_NOT_AVAILABLE"
614
615
  }, t);
615
- return /* @__PURE__ */ Ge("section", {
616
+ return /* @__PURE__ */ Ke("section", {
616
617
  "aria-label": e ?? void 0,
617
618
  "data-testid": "saved-query-history-unavailable",
618
619
  className: "h-full min-w-0 rounded-lg border border-[var(--color-border-subtle)] bg-bg-surface p-3",
@@ -623,8 +624,8 @@ function vt({ title: e }) {
623
624
  });
624
625
  }
625
626
  var v = (e) => {
626
- let { asOf: t } = fe();
627
- return e.widget.savedQueryId ? t ? /* @__PURE__ */ h(vt, { title: e.widget.title }) : /* @__PURE__ */ h(c, {
627
+ let { asOf: t } = pe();
628
+ return e.widget.savedQueryId ? t ? /* @__PURE__ */ h(yt, { title: e.widget.title }) : /* @__PURE__ */ h(c, {
628
629
  fallback: /* @__PURE__ */ h("span", {
629
630
  role: "status",
630
631
  children: "Loading widget…"
@@ -634,6 +635,6 @@ var v = (e) => {
634
635
  title: e.widget.title,
635
636
  controls: e.previewOnly ? void 0 : /* @__PURE__ */ h(_, { widget: e.widget })
636
637
  })
637
- }) : /* @__PURE__ */ h(_t, { ...e });
638
+ }) : /* @__PURE__ */ h(vt, { ...e });
638
639
  };
639
640
  export { v as WidgetWrapper, v as default };