@burdenoff/microfe-bigconsole 2026.1124.6 → 2026.1124.7

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.
@@ -7,38 +7,40 @@ import i from "../../hooks/useWidgetOperations.js";
7
7
  import a from "../../hooks/useWidgetActions.js";
8
8
  import o from "../../hooks/useDrilldownOperations.js";
9
9
  import { getWidgetDefinition as s } from "./WidgetRegistry.js";
10
- import { ActionConfigDialog as ee } from "./ActionConfigDialog.js";
11
- import c from "../../hooks/useEventWebhooks.js";
10
+ import { ActionConfigDialog as c } from "./ActionConfigDialog.js";
11
+ import ee from "../../hooks/useEventWebhooks.js";
12
12
  import "./webhook-config/index.js";
13
13
  import "./event-logs/index.js";
14
- import { DrilldownConfigPanel as l } from "./DrilldownConfigPanel.js";
15
- import u from "../../hooks/useDataSinkOperations.js";
16
- import te from "../../hooks/useParserOperations.js";
17
- import { WebhookConfigPanel as ne } from "./webhook-config/WebhookConfigPanel.js";
14
+ import { DrilldownConfigPanel as te } from "./DrilldownConfigPanel.js";
15
+ import l from "../../hooks/useDataSinkOperations.js";
16
+ import ne from "../../hooks/useParserOperations.js";
18
17
  import "../builder/inspector/index.js";
19
- import { EventLogViewer as re } from "./event-logs/EventLogViewer.js";
20
- import { DEFAULT_GRID_CONFIG as ie } from "../../utils/widgetPositioning.js";
18
+ import { WebhookConfigPanel as u } from "./webhook-config/WebhookConfigPanel.js";
19
+ import { DEFAULT_GRID_CONFIG as re } from "../../utils/widgetPositioning.js";
20
+ import { EventLogViewer as ie } from "./event-logs/EventLogViewer.js";
21
21
  import { isWidgetFormEdited as ae, withInferredDataSink as oe } from "../../utils/widgetFormDirty.js";
22
- import { AdvancedSection as se } from "../builder/inspector/AdvancedSection.js";
23
- import { AppearanceSection as ce } from "../builder/inspector/AppearanceSection.js";
24
- import { GeneralSection as le } from "../builder/inspector/GeneralSection.js";
25
- import { DataBindingSection as ue } from "../builder/inspector/DataBindingSection.js";
26
- import { LayoutSection as de } from "../builder/inspector/LayoutSection.js";
27
- import { positionToSave as fe, positionsEqual as pe, readWidgetPosition as me } from "../../utils/widgetPanelPosition.js";
22
+ import { positionToSave as se, positionsEqual as ce, readWidgetPosition as le } from "../../utils/widgetPanelPosition.js";
23
+ import { AdvancedSection as ue } from "../builder/inspector/AdvancedSection.js";
24
+ import { AppearanceSection as de } from "../builder/inspector/AppearanceSection.js";
25
+ import { GeneralSection as fe } from "../builder/inspector/GeneralSection.js";
26
+ import { DataBindingSection as pe } from "../builder/inspector/DataBindingSection.js";
27
+ import { LayoutSection as me } from "../builder/inspector/LayoutSection.js";
28
28
  import "../common/index.js";
29
29
  import { ChartFieldMappings as he } from "./chart/ChartFieldMappings.js";
30
- import { describeWidgetShape as ge, getWidgetSampleExample as _e } from "../../utils/widgetSampleShapes.js";
31
- import { UnsupportedDataSourceNotice as ve } from "./UnsupportedDataSourceNotice.js";
32
- import { getWidgetBinding as d, getWidgetBindingStatus as ye, parserTestOutcome as be, reconcilePanelConfig as xe, serializeWidgetBinding as Se } from "../../utils/widgetBinding.js";
33
- import { memo as f, useCallback as p, useEffect as m, useMemo as Ce, useRef as h, useState as g } from "react";
34
- import { Check as we, ChevronDown as Te, ChevronUp as Ee, ExternalLink as De, Info as Oe, Pencil as ke, Plus as Ae, Trash2 as je, X as Me } from "lucide-react";
35
- import { Button as _, Card as Ne, CardContent as Pe, Input as v, Label as y, Select as Fe, SelectContent as Ie, SelectItem as b, SelectTrigger as Le, SelectValue as Re, Sheet as ze, SheetContent as Be, SheetDescription as Ve, SheetHeader as He, SheetTitle as Ue, Spinner as We, Tabs as Ge, TabsContent as Ke, TabsList as qe, TabsTrigger as Je, Textarea as x } from "@burdenoff/fe-libs/ui";
36
- import { useUnsavedChanges as Ye } from "@burdenoff/fe-libs/shared/hooks";
37
- import { useI18n as Xe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
38
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
39
- import { toast as Ze } from "sonner";
30
+ import { QuerySection as ge } from "../builder/inspector/QuerySection.js";
31
+ import { applyQueryToConfig as _e, detectFields as ve, previewRows as ye, queryProblem as be, queryRendererProblem as xe, readQuery as Se, supportsQuery as Ce, supportsQuerySeries as we } from "../../utils/widgetQuery.js";
32
+ import { describeWidgetShape as Te, getWidgetSampleExample as Ee } from "../../utils/widgetSampleShapes.js";
33
+ import { UnsupportedDataSourceNotice as De } from "./UnsupportedDataSourceNotice.js";
34
+ import { getWidgetBinding as Oe, getWidgetBindingStatus as ke, parserTestOutcome as Ae, reconcilePanelConfig as je, serializeWidgetBinding as Me } from "../../utils/widgetBinding.js";
35
+ import { memo as d, useCallback as f, useEffect as p, useMemo as Ne, useRef as m, useState as h } from "react";
36
+ import { Check as Pe, ChevronDown as Fe, ChevronUp as Ie, ExternalLink as Le, Info as Re, Pencil as ze, Plus as Be, Trash2 as Ve, X as He } from "lucide-react";
37
+ import { Button as g, Card as Ue, CardContent as We, Input as _, Label as v, Select as Ge, SelectContent as Ke, SelectItem as y, SelectTrigger as qe, SelectValue as Je, Sheet as Ye, SheetContent as Xe, SheetDescription as Ze, SheetHeader as Qe, SheetTitle as $e, Spinner as et, Tabs as tt, TabsContent as nt, TabsList as rt, TabsTrigger as it, Textarea as b } from "@burdenoff/fe-libs/ui";
38
+ import { useUnsavedChanges as at } from "@burdenoff/fe-libs/shared/hooks";
39
+ import { useI18n as ot } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
40
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
41
+ import { toast as st } from "sonner";
40
42
  // src/bigconsole/components/widgets/PropertiesPanel.tsx
41
- var Qe = [
43
+ var ct = [
42
44
  {
43
45
  value: "BIGCONSOLE",
44
46
  labelKey: "bigconsole.widget.properties.renderer.bigconsole.label",
@@ -67,7 +69,7 @@ var Qe = [
67
69
  descriptionKey: "bigconsole.widget.properties.renderer.custom.description",
68
70
  description: "Custom React component"
69
71
  }
70
- ], $e = [
72
+ ], lt = [
71
73
  {
72
74
  value: "DATASINK",
73
75
  labelKey: "bigconsole.widget.properties.dataSourceType.datasink.label",
@@ -111,23 +113,23 @@ var Qe = [
111
113
  description: "Manually enter sample JSON data"
112
114
  }
113
115
  ];
114
- function et(e) {
116
+ function ut(e) {
115
117
  return `widget:${e.toLowerCase().replace(/\s+/g, "_")}:clicked`;
116
118
  }
117
- var tt = {
119
+ var dt = {
118
120
  PRIMARY: "bg-action-primary-bg",
119
121
  SECONDARY: "bg-[var(--color-text-muted)]",
120
122
  SUCCESS: "bg-status-success-bg",
121
123
  WARNING: "bg-status-warning-bg",
122
124
  DANGER: "bg-status-error-bg"
123
- }, nt = "bg-[var(--color-text-muted)]", rt = {
125
+ }, ft = "bg-[var(--color-text-muted)]", pt = {
124
126
  fontWeight: "var(--font-weight-semibold)",
125
127
  fontSize: "var(--font-size-body-sm)",
126
128
  padding: "6px 10px",
127
129
  minHeight: "var(--size-controlHeight-md)",
128
130
  flexShrink: 0
129
131
  };
130
- function it(e) {
132
+ function mt(e) {
131
133
  if (!e) return {};
132
134
  let t = Array.isArray(e) ? e[0] : e;
133
135
  if (!t || typeof t != "object") return {};
@@ -171,17 +173,17 @@ function it(e) {
171
173
  xAxisField: a
172
174
  };
173
175
  }
174
- var at = f(function({ widget: e, onSave: t }) {
175
- let { t: r } = Xe(), [i, a] = g(""), [o, s] = g(null), ee = h(!1);
176
- m(() => {
176
+ var ht = d(function({ widget: e, onSave: t }) {
177
+ let { t: r } = ot(), [i, a] = h(""), [o, s] = h(null), c = m(!1);
178
+ p(() => {
177
179
  try {
178
180
  let t = e.template && typeof e.template == "object" ? JSON.stringify(e.template, null, 2) : "";
179
- a(t), s(null), ee.current = !0;
181
+ a(t), s(null), c.current = !0;
180
182
  } catch {
181
183
  a("");
182
184
  }
183
185
  }, [e.id, e.template]);
184
- let c = p((e) => {
186
+ let ee = f((e) => {
185
187
  let n = e.target.value;
186
188
  if (a(n), n.trim() === "") s(null), t({});
187
189
  else try {
@@ -190,7 +192,7 @@ var at = f(function({ widget: e, onSave: t }) {
190
192
  } catch (e) {
191
193
  s(e.message);
192
194
  }
193
- }, [t]), l = p(() => {
195
+ }, [t]), te = f(() => {
194
196
  try {
195
197
  let e = JSON.parse(i), n = JSON.stringify(e, null, 2);
196
198
  a(n), s(null), t(e);
@@ -198,23 +200,23 @@ var at = f(function({ widget: e, onSave: t }) {
198
200
  s(e.message);
199
201
  }
200
202
  }, [i, t]);
201
- return /* @__PURE__ */ C(n, {
203
+ return /* @__PURE__ */ S(n, {
202
204
  emphasis: "muted",
203
205
  padding: "compact",
204
206
  headingLevel: 4,
205
207
  title: r("bigconsole.widget.properties.template.label", "Template (JSON)"),
206
208
  description: `The ${e.renderer} payload this widget renders.`,
207
209
  tone: o ? "danger" : "neutral",
208
- meta: o ? /* @__PURE__ */ S("span", {
210
+ meta: o ? /* @__PURE__ */ x("span", {
209
211
  className: "text-xs font-medium text-[var(--color-status-error-text)]",
210
212
  children: r("bigconsole.widget.properties.template.invalidJson", "Invalid JSON")
211
213
  }) : void 0,
212
214
  className: "mt-form-gap",
213
215
  "data-testid": "widget-inspector-template",
214
216
  children: [
215
- /* @__PURE__ */ S(x, {
217
+ /* @__PURE__ */ x(b, {
216
218
  value: i,
217
- onChange: c,
219
+ onChange: ee,
218
220
  spellCheck: !1,
219
221
  placeholder: r("bigconsole.widget.properties.template.placeholder", "Enter {{renderer}} template JSON...", { renderer: e.renderer ?? "" }),
220
222
  style: {
@@ -225,7 +227,7 @@ var at = f(function({ widget: e, onSave: t }) {
225
227
  resize: "vertical"
226
228
  }
227
229
  }),
228
- o && /* @__PURE__ */ S("p", {
230
+ o && /* @__PURE__ */ x("p", {
229
231
  style: {
230
232
  fontSize: "var(--font-size-body-sm)",
231
233
  color: "var(--color-status-error-text)",
@@ -236,19 +238,19 @@ var at = f(function({ widget: e, onSave: t }) {
236
238
  },
237
239
  children: o
238
240
  }),
239
- /* @__PURE__ */ C("div", {
241
+ /* @__PURE__ */ S("div", {
240
242
  className: "mt-control-gap flex flex-wrap items-center gap-control-gap",
241
- children: [/* @__PURE__ */ S(_, {
243
+ children: [/* @__PURE__ */ x(g, {
242
244
  variant: "outline",
243
245
  size: "sm",
244
- onClick: l,
246
+ onClick: te,
245
247
  disabled: !!o || i.trim() === "",
246
248
  style: {
247
249
  height: "var(--size-controlHeight-sm)",
248
250
  fontWeight: "var(--font-weight-semibold)"
249
251
  },
250
252
  children: r("bigconsole.widget.properties.template.format", "Format")
251
- }), !o && i.trim() !== "" && /* @__PURE__ */ C("span", {
253
+ }), !o && i.trim() !== "" && /* @__PURE__ */ S("span", {
252
254
  style: {
253
255
  fontSize: "var(--font-size-body-sm)",
254
256
  color: "var(--color-status-success-text)",
@@ -256,20 +258,20 @@ var at = f(function({ widget: e, onSave: t }) {
256
258
  alignItems: "center",
257
259
  gap: "4px"
258
260
  },
259
- children: [/* @__PURE__ */ S(we, { style: {
261
+ children: [/* @__PURE__ */ x(Pe, { style: {
260
262
  width: "12px",
261
263
  height: "12px"
262
264
  } }), r("bigconsole.widget.properties.template.validJson", "Valid JSON")]
263
265
  })]
264
266
  }),
265
- /* @__PURE__ */ C("div", {
267
+ /* @__PURE__ */ S("div", {
266
268
  className: "mt-control-gap flex flex-wrap items-center justify-between gap-x-4 gap-y-1 border-t border-[var(--color-border-subtle)] pt-control-gap text-xs text-text-muted",
267
269
  children: [
268
- /* @__PURE__ */ S("span", {
270
+ /* @__PURE__ */ x("span", {
269
271
  className: "font-medium",
270
272
  children: r("bigconsole.widget.properties.template.ctrlSToSave", "Ctrl+S to save")
271
273
  }),
272
- e.renderer === "ADAPTIVE_CARD" && /* @__PURE__ */ C("a", {
274
+ e.renderer === "ADAPTIVE_CARD" && /* @__PURE__ */ S("a", {
273
275
  href: "https://adaptivecards.io/designer/",
274
276
  target: "_blank",
275
277
  rel: "noopener noreferrer",
@@ -282,12 +284,12 @@ var at = f(function({ widget: e, onSave: t }) {
282
284
  fontWeight: "var(--font-weight-medium)",
283
285
  textDecoration: "none"
284
286
  },
285
- children: [r("bigconsole.widget.properties.template.designer", "Designer"), /* @__PURE__ */ S(De, { style: {
287
+ children: [r("bigconsole.widget.properties.template.designer", "Designer"), /* @__PURE__ */ x(Le, { style: {
286
288
  height: "var(--size-icon-sm)",
287
289
  width: "var(--size-icon-sm)"
288
290
  } })]
289
291
  }),
290
- e.renderer === "BLOCKKIT" && /* @__PURE__ */ C("a", {
292
+ e.renderer === "BLOCKKIT" && /* @__PURE__ */ S("a", {
291
293
  href: "https://app.slack.com/block-kit-builder",
292
294
  target: "_blank",
293
295
  rel: "noopener noreferrer",
@@ -300,7 +302,7 @@ var at = f(function({ widget: e, onSave: t }) {
300
302
  fontWeight: "var(--font-weight-medium)",
301
303
  textDecoration: "none"
302
304
  },
303
- children: [r("bigconsole.widget.properties.template.blockKitBuilder", "Block Kit Builder"), /* @__PURE__ */ S(De, { style: {
305
+ children: [r("bigconsole.widget.properties.template.blockKitBuilder", "Block Kit Builder"), /* @__PURE__ */ x(Le, { style: {
304
306
  height: "var(--size-icon-sm)",
305
307
  width: "var(--size-icon-sm)"
306
308
  } })]
@@ -310,8 +312,8 @@ var at = f(function({ widget: e, onSave: t }) {
310
312
  ]
311
313
  });
312
314
  });
313
- function ot(e) {
314
- let t = e, n = d({
315
+ function gt(e) {
316
+ let t = e, n = Oe({
315
317
  dataSinkId: t.dataSinkId,
316
318
  parserId: t.parserId,
317
319
  config: e.config || {}
@@ -338,199 +340,199 @@ function ot(e) {
338
340
  } : void 0
339
341
  };
340
342
  }
341
- var w = f(function({ isOpen: f, onClose: De }) {
342
- let { t: w } = Xe(), [st, ct] = g("general"), [T, E] = g("idle"), [D, O] = g(null), [k, A] = g(!1), [lt, j] = g(null);
343
- Ye({
343
+ var C = d(function({ isOpen: d, onClose: Le }) {
344
+ let { t: C } = ot(), [_t, vt] = h("general"), [w, T] = h("idle"), [E, D] = h(null), [O, k] = h(!1), [A, j] = h(null);
345
+ at({
344
346
  id: "dashboard-widget-properties",
345
- label: w("bigconsole.assistant.unsaved.widgetProperties", "the widget properties"),
346
- dirty: ae(D, lt)
347
+ label: C("bigconsole.assistant.unsaved.widgetProperties", "the widget properties"),
348
+ dirty: ae(E, A)
347
349
  });
348
- let M = e((e) => e.selectedWidgetId), ut = e((e) => e.widgets), N = e((e) => e.updateWidget), P = e((e) => e.updateWidgetPosition), dt = t(), F = M ? ut.get(M) : void 0, ft = F ? me(F) : null, I = h(null), pt = h(null), mt = h({}), ht = h(0), L = p(() => {
349
- ht.current += 1, A(!0);
350
- }, []), gt = p((e) => {
351
- M && (P(M, e), L());
350
+ let M = e((e) => e.selectedWidgetId), yt = e((e) => e.widgets), N = e((e) => e.updateWidget), bt = e((e) => e.updateWidgetPosition), xt = t(), P = M ? yt.get(M) : void 0, St = P ? le(P) : null, F = m(null), Ct = m(null), wt = m({}), Tt = m(0), I = f(() => {
351
+ Tt.current += 1, k(!0);
352
+ }, []), Et = f((e) => {
353
+ M && (bt(M, e), I());
352
354
  }, [
353
355
  M,
354
- P,
355
- L
356
+ bt,
357
+ I
356
358
  ]);
357
- m(() => {
359
+ p(() => {
358
360
  if (!M) {
359
- pt.current = null, I.current = null, O(null), j(null), A(!1), E("idle");
361
+ Ct.current = null, F.current = null, D(null), j(null), k(!1), T("idle");
360
362
  return;
361
363
  }
362
- let e = pt.current !== M;
363
- if (pt.current = M, F) {
364
- if (k && !e) return;
365
- let t = ot(F);
366
- O(t), j(t), mt.current = F.config || {}, I.current = me(F), A(!1), E("idle");
367
- } else I.current = null, O(null), j(null), A(!1), E("idle");
364
+ let e = Ct.current !== M;
365
+ if (Ct.current = M, P) {
366
+ if (O && !e) return;
367
+ let t = gt(P);
368
+ D(t), j(t), wt.current = P.config || {}, F.current = le(P), k(!1), T("idle");
369
+ } else F.current = null, D(null), j(null), k(!1), T("idle");
368
370
  }, [
369
371
  M,
370
- F,
371
- k
372
+ P,
373
+ O
372
374
  ]);
373
- let { updateWidget: _t } = i(F?.pageId, F?.dashboardId, { skipFetch: !0 }), { createDrilldown: vt, updateDrilldown: yt, deleteDrilldown: bt } = o(), { dataSinks: R } = u({ skipFetch: !1 }), [xt, St] = g(null), { executeParser: Ct, fetchParser: wt } = te({
374
- consoleId: F?.dashboardId,
375
+ let { updateWidget: Dt } = i(P?.pageId, P?.dashboardId, { skipFetch: !0 }), { createDrilldown: Ot, updateDrilldown: kt, deleteDrilldown: At } = o(), { dataSinks: L } = l({ skipFetch: !1 }), [jt, Mt] = h(null), { executeParser: Nt, fetchParser: Pt } = ne({
376
+ consoleId: P?.dashboardId,
375
377
  skipFetch: !0
376
- }), [z, Tt] = g(null), [Et, Dt] = g(!1), B = D?.parserId;
377
- m(() => {
378
+ }), [R, Ft] = h(null), [It, Lt] = h(!1), z = E?.parserId;
379
+ p(() => {
378
380
  let e = !1;
379
- if (Tt(null), !f || !B) Dt(!1);
380
- else return Dt(!0), wt(B).then((t) => {
381
- e || (Tt(t), Dt(!1));
381
+ if (Ft(null), !d || !z) Lt(!1);
382
+ else return Lt(!0), Pt(z).then((t) => {
383
+ e || (Ft(t), Lt(!1));
382
384
  }), () => {
383
385
  e = !0;
384
386
  };
385
387
  }, [
386
- f,
387
- B,
388
+ d,
389
+ z,
388
390
  M,
389
- wt
391
+ Pt
390
392
  ]);
391
- let [Ot, V] = g(!1), [kt, H] = g(), [At, U] = g(!1), [jt, W] = g(null), G = M && B ? `${M}:${B}` : null, Mt = kt?.key === G ? kt.value : void 0, K = h(null);
392
- m(() => {
393
- K.current = null, H(void 0), U(!1), W(null), V(!1);
394
- }, [M]), m(() => {
395
- if (!f || st !== "data" || !B || !G || K.current?.key === G) return;
396
- let e = { key: G };
397
- K.current = e;
398
- let t = w("bigconsole.widget.properties.parser.previewFailed", "The parser could not produce a preview.");
399
- V(!0), Ct(B).then((n) => {
400
- if (K.current !== e) return;
401
- let r = be(n, t);
402
- H({
393
+ let [Rt, B] = h(!1), [zt, V] = h(), [Bt, H] = h(!1), [Vt, U] = h(null), W = M && z ? `${M}:${z}` : null, G = zt?.key === W ? zt.value : void 0, Ht = E !== null && A !== null && E.parserId === A.parserId && E.dataSinkId === A.dataSinkId && E.parserRules === A.parserRules && E.datasetId === A.datasetId, Ut = Ne(() => ye(G), [G]), K = Se(E?.config), Wt = we(P?.type, E?.config), Gt = Ce(P?.type, E?.config), Kt = JSON.stringify(K) !== JSON.stringify(Se(P?.config)), qt = (K ? xe(K, P?.type, E?.config) : null) ?? (K && (Kt || !Ht || !Gt || K.series && !Wt) ? be(K, Ut ? ve(Ut) : [], Wt, Gt) : null), q = m(null);
394
+ p(() => {
395
+ q.current = null, V(void 0), H(!1), U(null), B(!1);
396
+ }, [M]), p(() => {
397
+ if (!d || _t !== "data" || !z || !W || q.current?.key === W) return;
398
+ let e = { key: W };
399
+ q.current = e;
400
+ let t = C("bigconsole.widget.properties.parser.previewFailed", "The parser could not produce a preview.");
401
+ B(!0), Nt(z).then((n) => {
402
+ if (q.current !== e) return;
403
+ let r = Ae(n, t);
404
+ V({
403
405
  key: e.key,
404
406
  value: r.preview
405
- }), W(r.error), U(!0);
407
+ }), U(r.error), H(!0);
406
408
  }).catch((n) => {
407
- K.current === e && (W(n instanceof Error ? n.message : t), U(!0));
409
+ q.current === e && (U(n instanceof Error ? n.message : t), H(!0));
408
410
  }).finally(() => {
409
- K.current === e && V(!1);
411
+ q.current === e && B(!1);
410
412
  });
411
413
  }, [
412
- f,
413
- st,
414
- G,
415
- B,
416
- Ct,
417
- w
414
+ d,
415
+ _t,
416
+ W,
417
+ z,
418
+ Nt,
419
+ C
418
420
  ]);
419
- let { actions: q, loading: Nt, error: Pt, refetch: Ft, createAction: It, updateAction: Lt, deleteAction: Rt, reorderActions: zt } = a(M || void 0), { webhooks: Bt, loading: Vt, error: Ht, createWebhook: Ut, updateWebhook: Wt, deleteWebhook: Gt, refetch: Kt } = c({
421
+ let { actions: J, loading: Jt, error: Yt, refetch: Xt, createAction: Zt, updateAction: Qt, deleteAction: $t, reorderActions: en } = a(M || void 0), { webhooks: tn, loading: nn, error: rn, createWebhook: an, updateWebhook: on, deleteWebhook: sn, refetch: cn } = ee({
420
422
  widgetId: M || void 0,
421
423
  skipFetch: !M
422
- }), qt = p((e, t) => {
423
- let n = et(t);
424
+ }), ln = f((e, t) => {
425
+ let n = ut(t);
424
426
  return e.find((e) => e.widgetId === M && e.eventPattern === n) ?? null;
425
- }, [M]), J = p((e) => qt(Bt, e), [qt, Bt]), Jt = p(async (e, t) => {
427
+ }, [M]), Y = f((e) => ln(tn, e), [ln, tn]), un = f(async (e, t) => {
426
428
  if (!M || t === void 0) return !0;
427
- if (Ht) return !1;
428
- let n = et(e), r = J(e);
429
- if (!r && Vt) {
430
- let t = (await Kt())?.data?.listEventWebhookMappings ?? [];
431
- r = qt(t, e);
429
+ if (rn) return !1;
430
+ let n = ut(e), r = Y(e);
431
+ if (!r && nn) {
432
+ let t = (await cn())?.data?.listEventWebhookMappings ?? [];
433
+ r = ln(t, e);
432
434
  }
433
- return t && t.url ? r ? await Wt({
435
+ return t && t.url ? r ? await on({
434
436
  id: r.id,
435
437
  eventPattern: n,
436
438
  webhookUrl: t.url,
437
439
  method: t.method,
438
440
  isActive: !0
439
- }) !== null : await Ut({
441
+ }) !== null : await an({
440
442
  widgetId: M,
441
443
  eventPattern: n,
442
444
  webhookUrl: t.url,
443
445
  method: t.method
444
- }) !== null : t === null && r ? Gt(r.id) : !0;
446
+ }) !== null : t === null && r ? sn(r.id) : !0;
445
447
  }, [
446
448
  M,
447
- J,
448
- Vt,
449
- Ht,
450
- Kt,
451
- qt,
452
- Ut,
453
- Wt,
454
- Gt
455
- ]), [Yt, Xt] = g(!1), [Zt, Y] = g(void 0), [Qt, $t] = g(!1), [en, X] = g(void 0), [tn, Z] = g(null), nn = Ce(() => {
456
- if (!Zt) return null;
457
- let e = J(Zt.name);
449
+ Y,
450
+ nn,
451
+ rn,
452
+ cn,
453
+ ln,
454
+ an,
455
+ on,
456
+ sn
457
+ ]), [dn, fn] = h(!1), [pn, X] = h(void 0), [mn, hn] = h(!1), [gn, _n] = h(void 0), [vn, Z] = h(null), yn = Ne(() => {
458
+ if (!pn) return null;
459
+ let e = Y(pn.name);
458
460
  return e ? {
459
461
  url: e.webhookUrl,
460
462
  method: e.method
461
463
  } : null;
462
- }, [Zt, J]), rn = en === void 0 ? nn : en, an = Ce(() => {
464
+ }, [pn, Y]), bn = gn === void 0 ? yn : gn, xn = Ne(() => {
463
465
  let e = /* @__PURE__ */ new Map();
464
- for (let t of q) {
465
- let n = J(t.name);
466
+ for (let t of J) {
467
+ let n = Y(t.name);
466
468
  n && e.set(t.name, n);
467
469
  }
468
470
  return e;
469
- }, [q, J]), on = p(() => {
470
- X(void 0), Z(null), Y(void 0), Xt(!0);
471
- }, []), sn = p((e) => {
472
- X(void 0), Z(null), Y(e), Xt(!0);
473
- }, []), cn = p(async (e, t) => {
471
+ }, [J, Y]), Sn = f(() => {
472
+ _n(void 0), Z(null), X(void 0), fn(!0);
473
+ }, []), Cn = f((e) => {
474
+ _n(void 0), Z(null), X(e), fn(!0);
475
+ }, []), wn = f(async (e, t) => {
474
476
  if (M) {
475
- if (Pt) Z(w("bigconsole.widget.properties.actions.readFailed", "Buttons could not be verified. Retry before saving."));
476
- else if (Ht) Z(w("bigconsole.widget.properties.action.webhookReadFailed", "Webhook mappings could not be verified. Retry the webhook read before saving."));
477
+ if (Yt) Z(C("bigconsole.widget.properties.actions.readFailed", "Buttons could not be verified. Retry before saving."));
478
+ else if (rn) Z(C("bigconsole.widget.properties.action.webhookReadFailed", "Webhook mappings could not be verified. Retry the webhook read before saving."));
477
479
  else {
478
- $t(!0), Z(null);
480
+ hn(!0), Z(null);
479
481
  try {
480
482
  let n = "id" in e && !!e.id, r = null;
481
- if (r = n ? await Lt(e) : await It(e), r) {
482
- let e = [...q];
483
+ if (r = n ? await Qt(e) : await Zt(e), r) {
484
+ let e = [...J];
483
485
  if (n) {
484
486
  let t = e.findIndex((e) => e.id === r?.id);
485
487
  t >= 0 && (e[t] = r);
486
488
  } else e.push(r);
487
489
  let i = e.sort((e, t) => e.order - t.order);
488
- if (N(M, { actions: i }), !await Jt(r.name, t)) {
489
- X(t), Z(t ? w("bigconsole.widget.properties.action.webhookSaveFailed", "The button was saved, but its webhook could not be saved. Check the URL and try again.") : w("bigconsole.widget.properties.action.webhookRemoveFailed", "The button was saved, but its old webhook could not be removed. Try again.")), Y(r);
490
+ if (N(M, { actions: i }), !await un(r.name, t)) {
491
+ _n(t), Z(t ? C("bigconsole.widget.properties.action.webhookSaveFailed", "The button was saved, but its webhook could not be saved. Check the URL and try again.") : C("bigconsole.widget.properties.action.webhookRemoveFailed", "The button was saved, but its old webhook could not be removed. Try again.")), X(r);
490
492
  return;
491
493
  }
492
- X(void 0), Z(null), Xt(!1), Y(void 0);
494
+ _n(void 0), Z(null), fn(!1), X(void 0);
493
495
  }
494
496
  } catch (e) {
495
- console.warn("Failed to save widget action:", e), Z(e instanceof Error ? e.message : w("bigconsole.widget.properties.action.saveFailed", "Could not save the button. Please try again."));
497
+ console.warn("Failed to save widget action:", e), Z(e instanceof Error ? e.message : C("bigconsole.widget.properties.action.saveFailed", "Could not save the button. Please try again."));
496
498
  } finally {
497
- $t(!1);
499
+ hn(!1);
498
500
  }
499
501
  }
500
502
  }
501
503
  }, [
502
504
  M,
503
- Ht,
504
- Pt,
505
- q,
506
- It,
507
- Lt,
505
+ rn,
506
+ Yt,
507
+ J,
508
+ Zt,
509
+ Qt,
508
510
  N,
509
- Jt,
510
- w
511
- ]), ln = p(async (e) => {
512
- if (M && window.confirm(w("bigconsole.widget.properties.action.deleteConfirm", "Are you sure you want to delete this action?"))) {
513
- let t = q.find((t) => t.id === e);
514
- if (await Rt(e)) {
515
- let n = q.filter((t) => t.id !== e);
511
+ un,
512
+ C
513
+ ]), Tn = f(async (e) => {
514
+ if (M && window.confirm(C("bigconsole.widget.properties.action.deleteConfirm", "Are you sure you want to delete this action?"))) {
515
+ let t = J.find((t) => t.id === e);
516
+ if (await $t(e)) {
517
+ let n = J.filter((t) => t.id !== e);
516
518
  if (N(M, { actions: n }), t) {
517
- let e = J(t.name);
518
- e && await Gt(e.id);
519
+ let e = Y(t.name);
520
+ e && await sn(e.id);
519
521
  }
520
522
  }
521
523
  }
522
524
  }, [
523
525
  M,
524
- q,
525
- Rt,
526
- N,
527
526
  J,
528
- Gt,
529
- w
530
- ]), un = p(async (e) => {
527
+ $t,
528
+ N,
529
+ Y,
530
+ sn,
531
+ C
532
+ ]), En = f(async (e) => {
531
533
  if (!M || e === 0) return;
532
- let t = [...q].sort((e, t) => e.order - t.order), n = t.map((e) => e.id);
533
- if ([n[e - 1], n[e]] = [n[e], n[e - 1]], await zt(n)) {
534
+ let t = [...J].sort((e, t) => e.order - t.order), n = t.map((e) => e.id);
535
+ if ([n[e - 1], n[e]] = [n[e], n[e - 1]], await en(n)) {
534
536
  let e = t.map((e, t) => ({
535
537
  ...e,
536
538
  order: n.indexOf(e.id)
@@ -539,15 +541,15 @@ var w = f(function({ isOpen: f, onClose: De }) {
539
541
  }
540
542
  }, [
541
543
  M,
542
- q,
543
- zt,
544
+ J,
545
+ en,
544
546
  N
545
- ]), dn = p(async (e) => {
547
+ ]), Dn = f(async (e) => {
546
548
  if (!M) return;
547
- let t = [...q].sort((e, t) => e.order - t.order);
549
+ let t = [...J].sort((e, t) => e.order - t.order);
548
550
  if (e === t.length - 1) return;
549
551
  let n = t.map((e) => e.id);
550
- if ([n[e], n[e + 1]] = [n[e + 1], n[e]], await zt(n)) {
552
+ if ([n[e], n[e + 1]] = [n[e + 1], n[e]], await en(n)) {
551
553
  let e = t.map((e, t) => ({
552
554
  ...e,
553
555
  order: n.indexOf(e.id)
@@ -556,138 +558,138 @@ var w = f(function({ isOpen: f, onClose: De }) {
556
558
  }
557
559
  }, [
558
560
  M,
559
- q,
560
- zt,
561
+ J,
562
+ en,
561
563
  N
562
564
  ]);
563
- m(() => {
564
- M && q.length >= 0 && !Nt && N(M, { actions: q });
565
+ p(() => {
566
+ M && J.length >= 0 && !Jt && N(M, { actions: J });
565
567
  }, [
566
568
  M,
567
- q,
568
- Nt,
569
+ J,
570
+ Jt,
569
571
  N
570
572
  ]);
571
- let Q = p((e, t) => {
572
- O((n) => n && {
573
+ let Q = f((e, t) => {
574
+ D((n) => n && {
573
575
  ...n,
574
576
  [e]: t
575
- }), L();
576
- }, [L]), $ = p((e) => {
577
- O((t) => t && {
577
+ }), I();
578
+ }, [I]), $ = f((e) => {
579
+ D((t) => t && {
578
580
  ...t,
579
581
  config: e
580
- }), L();
581
- }, [L]);
582
- m(() => {
583
- if (!D) {
584
- St(null);
582
+ }), I();
583
+ }, [I]);
584
+ p(() => {
585
+ if (!E) {
586
+ Mt(null);
585
587
  return;
586
588
  }
587
- if (D.dataSinkId) {
588
- St(R.find((e) => e.id === D.dataSinkId)?.key ?? null);
589
+ if (E.dataSinkId) {
590
+ Mt(L.find((e) => e.id === E.dataSinkId)?.key ?? null);
589
591
  return;
590
592
  }
591
- let e = d({
592
- parserId: D.parserId,
593
- config: D.config
594
- }), t = z?.id === D.parserId ? z : null, n = e.source.kind === "DATASINK" && !e.source.ref && t ? R.find((e) => e.key === t.inputSinkKey) : void 0;
595
- St(n?.key ?? null), n && t && (O((e) => oe(e, t.id, n.id)), j((e) => oe(e, t.id, n.id)));
593
+ let e = Oe({
594
+ parserId: E.parserId,
595
+ config: E.config
596
+ }), t = R?.id === E.parserId ? R : null, n = e.source.kind === "DATASINK" && !e.source.ref && t ? L.find((e) => e.key === t.inputSinkKey) : void 0;
597
+ Mt(n?.key ?? null), n && t && (D((e) => oe(e, t.id, n.id)), j((e) => oe(e, t.id, n.id)));
596
598
  }, [
597
- D,
598
- R,
599
- z
599
+ E,
600
+ L,
601
+ R
600
602
  ]);
601
- let fn = p((e) => {
602
- if (K.current = null, H(void 0), U(!1), W(null), V(!1), St(e), e) {
603
- let t = R.find((t) => t.key === e);
604
- t && (Q("dataSinkId", t.id), O((t) => t && {
603
+ let On = f((e) => {
604
+ if (q.current = null, V(void 0), H(!1), U(null), B(!1), Mt(e), e) {
605
+ let t = L.find((t) => t.key === e);
606
+ t && (Q("dataSinkId", t.id), D((t) => t && {
605
607
  ...t,
606
608
  config: {
607
609
  ...t.config,
608
610
  dataSinkKey: e
609
611
  }
610
- }), L());
611
- } else Q("dataSinkId", void 0), O((e) => e && {
612
+ }), I());
613
+ } else Q("dataSinkId", void 0), D((e) => e && {
612
614
  ...e,
613
615
  config: {
614
616
  ...e.config,
615
617
  dataSinkKey: void 0
616
618
  },
617
619
  parserId: void 0
618
- }), L();
620
+ }), I();
619
621
  }, [
620
- R,
622
+ L,
621
623
  Q,
622
- L
623
- ]), pn = p(async (e) => {
624
+ I
625
+ ]), kn = f(async (e) => {
624
626
  Q("parserId", e || void 0);
625
627
  let t = e && M ? { key: `${M}:${e}` } : null;
626
- if (K.current = t, H(void 0), U(!1), W(null), V(!!t), e && t) try {
627
- let n = await Ct(e);
628
- if (K.current !== t) return;
628
+ if (q.current = t, V(void 0), H(!1), U(null), B(!!t), e && t) try {
629
+ let n = await Nt(e);
630
+ if (q.current !== t) return;
629
631
  if (n?.success) {
630
- H({
632
+ V({
631
633
  key: t.key,
632
634
  value: n.output
633
- }), U(!0);
634
- let r = it(n.output);
635
- (r.labelField || r.valueField) && (O((t) => {
635
+ }), H(!0);
636
+ let r = mt(n.output);
637
+ (r.labelField || r.valueField) && (D((t) => {
636
638
  if (!t || t.parserId !== e) return t;
637
639
  let n = t.config || {}, i = { ...n };
638
640
  return r.labelField && !n.labelField && (i.labelField = r.labelField), r.valueField && !n.valueField && (i.valueField = r.valueField), r.xAxisField && !n.xAxisField && (i.xAxisField = r.xAxisField), {
639
641
  ...t,
640
642
  config: i
641
643
  };
642
- }), L());
643
- } else U(!0), W(n?.error || w("bigconsole.widget.properties.parser.previewFailed", "The parser could not produce a preview."));
644
+ }), I());
645
+ } else H(!0), U(n?.error || C("bigconsole.widget.properties.parser.previewFailed", "The parser could not produce a preview."));
644
646
  } catch (e) {
645
- if (K.current !== t) return;
646
- U(!0), W(e instanceof Error ? e.message : w("bigconsole.widget.properties.parser.previewFailed", "The parser could not produce a preview.")), console.warn("Failed to auto-detect parser fields:", e);
647
+ if (q.current !== t) return;
648
+ H(!0), U(e instanceof Error ? e.message : C("bigconsole.widget.properties.parser.previewFailed", "The parser could not produce a preview.")), console.warn("Failed to auto-detect parser fields:", e);
647
649
  } finally {
648
- K.current === t && V(!1);
650
+ q.current === t && B(!1);
649
651
  }
650
652
  }, [
651
653
  Q,
652
- Ct,
654
+ Nt,
653
655
  M,
654
- L,
655
- w
656
- ]), mn = p(async () => {
657
- if (!F || !D) return;
658
- let t = ht.current;
659
- E("saving");
656
+ I,
657
+ C
658
+ ]), An = f(async () => {
659
+ if (!P || !E || qt) return;
660
+ let t = Tt.current;
661
+ T("saving");
660
662
  try {
661
663
  let n = {
662
- ...F.metadata || {},
663
- description: D.description || ""
664
- }, r = e.getState().widgets.get(F.id)?.config ?? {}, i = xe(r, mt.current, D.config), a = d({
665
- dataSinkId: D.dataSinkId,
666
- parserId: D.parserId,
664
+ ...P.metadata || {},
665
+ description: E.description || ""
666
+ }, r = e.getState().widgets.get(P.id)?.config ?? {}, i = je(r, wt.current, E.config), a = Se(i), o = a ? _e(i, P.type, a) : i, s = Oe({
667
+ dataSinkId: E.dataSinkId,
668
+ parserId: E.parserId,
667
669
  config: {
668
- ...i,
670
+ ...o,
669
671
  binding: void 0
670
672
  }
671
- }), o = Se(a, i), s = fe(e.getState().widgets.get(F.id), I.current), ee = await _t({
672
- id: F.id,
673
- title: D.title,
674
- position: s,
675
- renderer: D.renderer,
676
- template: D.template,
677
- config: o.config,
678
- refreshInterval: D.refreshInterval,
679
- dataSinkId: o.dataSinkId,
680
- datasetId: D.datasetId,
681
- parserId: o.parserId,
682
- parserRules: D.parserRules,
673
+ }), c = Me(s, o), ee = se(e.getState().widgets.get(P.id), F.current), te = await Dt({
674
+ id: P.id,
675
+ title: E.title,
676
+ position: ee,
677
+ renderer: E.renderer,
678
+ template: E.template,
679
+ config: c.config,
680
+ refreshInterval: E.refreshInterval,
681
+ dataSinkId: c.dataSinkId,
682
+ datasetId: E.datasetId,
683
+ parserId: c.parserId,
684
+ parserRules: E.parserRules,
683
685
  metadata: n
684
- }), c = F.drilldown, l = null, u = F.drilldown?.id;
686
+ }), l = P.drilldown, ne = null, u = P.drilldown?.id;
685
687
  try {
686
- if (D.drilldownConfig) {
687
- let { enabled: e, targetDashboardId: t, targetPageId: n, navigationMode: r, parameterMapping: i, passGlobalFilters: a, maxDepth: o } = D.drilldownConfig;
688
- if (u && !e) await bt(u), c = void 0;
688
+ if (E.drilldownConfig) {
689
+ let { enabled: e, targetDashboardId: t, targetPageId: n, navigationMode: r, parameterMapping: i, passGlobalFilters: a, maxDepth: o } = E.drilldownConfig;
690
+ if (u && !e) await At(u), l = void 0;
689
691
  else if (u) {
690
- let s = await yt({
692
+ let s = await kt({
691
693
  id: u,
692
694
  targetDashboardId: t,
693
695
  targetPageId: n,
@@ -697,10 +699,10 @@ var w = f(function({ isOpen: f, onClose: De }) {
697
699
  passGlobalFilters: a,
698
700
  maxDepth: o
699
701
  });
700
- s && (c = s);
702
+ s && (l = s);
701
703
  } else if (e && t) {
702
- let e = await vt({
703
- sourceWidgetId: F.id,
704
+ let e = await Ot({
705
+ sourceWidgetId: P.id,
704
706
  targetDashboardId: t,
705
707
  targetPageId: n,
706
708
  parameterMapping: i || {},
@@ -708,70 +710,71 @@ var w = f(function({ isOpen: f, onClose: De }) {
708
710
  passGlobalFilters: a,
709
711
  maxDepth: o
710
712
  });
711
- e && (c = e);
713
+ e && (l = e);
712
714
  }
713
715
  }
714
716
  } catch (e) {
715
- l = e instanceof Error ? e : Error(String(e));
717
+ ne = e instanceof Error ? e : Error(String(e));
716
718
  }
717
- if (ee) {
718
- if (N(F.id, {
719
- title: D.title,
720
- description: D.description,
721
- renderer: D.renderer,
722
- template: D.template,
723
- config: o.config,
724
- refreshInterval: D.refreshInterval,
725
- dataSinkId: o.dataSinkId,
726
- datasetId: D.datasetId,
727
- parserId: o.parserId,
728
- parserRules: D.parserRules,
729
- drilldown: c,
719
+ if (te) {
720
+ if (N(P.id, {
721
+ title: E.title,
722
+ description: E.description,
723
+ renderer: E.renderer,
724
+ template: E.template,
725
+ config: c.config,
726
+ refreshInterval: E.refreshInterval,
727
+ dataSinkId: c.dataSinkId,
728
+ datasetId: E.datasetId,
729
+ parserId: c.parserId,
730
+ parserRules: E.parserRules,
731
+ drilldown: l,
730
732
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
731
- }), l) {
732
- E("error"), Ze.error(w("bigconsole.widget.drilldown.saveFailed", "Drilldown not saved"), { description: l.message });
733
+ }), ne) {
734
+ T("error"), st.error(C("bigconsole.widget.drilldown.saveFailed", "Drilldown not saved"), { description: ne.message });
733
735
  return;
734
736
  }
735
- E("saved"), j(D), ht.current === t && A(!1), setTimeout(() => E("idle"), 2e3);
736
- } else E("error");
737
+ T("saved"), j(E), Tt.current === t && k(!1), setTimeout(() => T("idle"), 2e3);
738
+ } else T("error");
737
739
  } catch {
738
- E("error");
740
+ T("error");
739
741
  }
740
742
  }, [
741
- F,
742
- D,
743
- _t,
743
+ P,
744
+ E,
745
+ qt,
746
+ Dt,
744
747
  N,
745
- vt,
746
- yt,
747
- bt,
748
- w
749
- ]), hn = p(() => {
750
- if (!F) return;
751
- let e = I.current;
752
- e && !pe(me(F), e) && P(F.id, e);
753
- let t = ot(F);
754
- O(t), j(t), mt.current = F.config || {}, A(!1), E("idle");
755
- }, [F, P]), gn = p((e) => {
748
+ Ot,
749
+ kt,
750
+ At,
751
+ C
752
+ ]), jn = f(() => {
753
+ if (!P) return;
754
+ let e = F.current;
755
+ e && !ce(le(P), e) && bt(P.id, e);
756
+ let t = gt(P);
757
+ D(t), j(t), wt.current = P.config || {}, k(!1), T("idle");
758
+ }, [P, bt]), Mn = f((e) => {
756
759
  $(e);
757
- }, [$]), _n = p((e) => {
758
- O((t) => t && {
760
+ }, [$]), Nn = f((e) => {
761
+ D((t) => t && {
759
762
  ...t,
760
763
  drilldownConfig: e
761
- }), L();
762
- }, [L]), vn = F ? s(F.type) : null, yn = Ce(() => Qe.map((e) => ({
764
+ }), I();
765
+ }, [I]), Pn = P ? s(P.type) : null, Fn = Ne(() => ct.map((e) => ({
763
766
  value: e.value,
764
- label: w(e.labelKey, e.label),
765
- description: w(e.descriptionKey, e.description)
766
- })), [w]), bn = Ce(() => $e.map((e) => ({
767
+ label: C(e.labelKey, e.label),
768
+ description: C(e.descriptionKey, e.description)
769
+ })), [C]), In = Ne(() => lt.map((e) => ({
767
770
  value: e.value,
768
- label: w(e.labelKey, e.label)
769
- })), [w]);
770
- return /* @__PURE__ */ S(ze, {
771
- open: f,
772
- onOpenChange: (e) => !e && De(),
771
+ label: C(e.labelKey, e.label)
772
+ })), [C]);
773
+ return /* @__PURE__ */ x(Ye, {
774
+ open: d,
775
+ onOpenChange: (e) => !e && Le(),
773
776
  modal: !1,
774
- children: /* @__PURE__ */ C(Be, {
777
+ children: /* @__PURE__ */ S(Xe, {
775
778
  style: {
776
779
  width: "min(420px, 100vw)",
777
780
  maxWidth: "100vw",
@@ -782,20 +785,20 @@ var w = f(function({ isOpen: f, onClose: De }) {
782
785
  overflow: "hidden"
783
786
  },
784
787
  children: [
785
- /* @__PURE__ */ S(He, {
788
+ /* @__PURE__ */ x(Qe, {
786
789
  style: {
787
790
  padding: "var(--space-cardPadding)",
788
791
  borderBottom: "1px solid var(--color-border-subtle)",
789
792
  backgroundColor: "var(--color-bg-surface)",
790
793
  flexShrink: 0
791
794
  },
792
- children: /* @__PURE__ */ C("div", {
795
+ children: /* @__PURE__ */ S("div", {
793
796
  style: {
794
797
  display: "flex",
795
798
  alignItems: "center",
796
799
  gap: "var(--space-controlGap)"
797
800
  },
798
- children: [/* @__PURE__ */ S("div", {
801
+ children: [/* @__PURE__ */ x("div", {
799
802
  style: {
800
803
  display: "flex",
801
804
  height: "var(--size-controlHeight-lg)",
@@ -807,62 +810,62 @@ var w = f(function({ isOpen: f, onClose: De }) {
807
810
  boxShadow: "var(--shadow-elevation-2)",
808
811
  flexShrink: 0
809
812
  },
810
- children: /* @__PURE__ */ S(Oe, { style: {
813
+ children: /* @__PURE__ */ x(Re, { style: {
811
814
  height: "var(--size-icon-md)",
812
815
  width: "var(--size-icon-md)",
813
816
  color: "var(--color-action-primary-text)"
814
817
  } })
815
- }), /* @__PURE__ */ C("div", {
818
+ }), /* @__PURE__ */ S("div", {
816
819
  style: {
817
820
  flex: 1,
818
821
  minWidth: 0
819
822
  },
820
- children: [/* @__PURE__ */ C("div", {
823
+ children: [/* @__PURE__ */ S("div", {
821
824
  style: {
822
825
  display: "flex",
823
826
  alignItems: "center",
824
827
  gap: "var(--space-iconGap)"
825
828
  },
826
829
  children: [
827
- /* @__PURE__ */ S(Ue, {
830
+ /* @__PURE__ */ x($e, {
828
831
  style: {
829
832
  fontSize: "var(--font-size-body-md)",
830
833
  fontWeight: "var(--font-weight-bold)",
831
834
  color: "var(--color-text-primary)",
832
835
  margin: 0
833
836
  },
834
- children: F ? w("bigconsole.widget.properties.header.widgetProperties", "Widget Properties") : w("bigconsole.widget.properties.header.properties", "Properties")
837
+ children: P ? C("bigconsole.widget.properties.header.widgetProperties", "Widget Properties") : C("bigconsole.widget.properties.header.properties", "Properties")
835
838
  }),
836
- T === "saving" && /* @__PURE__ */ S(We, { style: {
839
+ w === "saving" && /* @__PURE__ */ x(et, { style: {
837
840
  height: "var(--size-icon-sm)",
838
841
  width: "var(--size-icon-sm)"
839
842
  } }),
840
- T === "saved" && /* @__PURE__ */ S(we, { style: {
843
+ w === "saved" && /* @__PURE__ */ x(Pe, { style: {
841
844
  height: "var(--size-icon-sm)",
842
845
  width: "var(--size-icon-sm)",
843
846
  color: "var(--color-status-success-bg)"
844
847
  } }),
845
- T === "error" && /* @__PURE__ */ S(Me, { style: {
848
+ w === "error" && /* @__PURE__ */ x(He, { style: {
846
849
  height: "var(--size-icon-sm)",
847
850
  width: "var(--size-icon-sm)",
848
851
  color: "var(--color-status-error-bg)"
849
852
  } })
850
853
  ]
851
- }), vn && /* @__PURE__ */ S(Ve, {
854
+ }), Pn && /* @__PURE__ */ x(Ze, {
852
855
  style: {
853
856
  fontSize: "var(--font-size-body-sm)",
854
857
  color: "var(--color-text-secondary)",
855
858
  margin: "var(--space-controlGap) 0 0 0",
856
859
  fontWeight: "var(--font-weight-medium)"
857
860
  },
858
- children: vn.name
861
+ children: Pn.name
859
862
  })]
860
863
  })]
861
864
  })
862
865
  }),
863
- F ? /* @__PURE__ */ C(Ge, {
864
- value: st,
865
- onValueChange: (e) => ct(e),
866
+ P ? /* @__PURE__ */ S(tt, {
867
+ value: _t,
868
+ onValueChange: (e) => vt(e),
866
869
  style: {
867
870
  flex: 1,
868
871
  display: "flex",
@@ -870,7 +873,7 @@ var w = f(function({ isOpen: f, onClose: De }) {
870
873
  minHeight: 0,
871
874
  overflow: "hidden"
872
875
  },
873
- children: [/* @__PURE__ */ C(qe, {
876
+ children: [/* @__PURE__ */ S(rt, {
874
877
  style: {
875
878
  width: "100%",
876
879
  display: "flex",
@@ -886,28 +889,28 @@ var w = f(function({ isOpen: f, onClose: De }) {
886
889
  gap: "2px"
887
890
  },
888
891
  children: [
889
- /* @__PURE__ */ S(Je, {
892
+ /* @__PURE__ */ x(it, {
890
893
  value: "general",
891
- style: rt,
892
- children: w("bigconsole.widget.properties.tab.general", "General")
894
+ style: pt,
895
+ children: C("bigconsole.widget.properties.tab.general", "General")
893
896
  }),
894
- /* @__PURE__ */ S(Je, {
897
+ /* @__PURE__ */ x(it, {
895
898
  value: "data",
896
- style: rt,
897
- children: w("bigconsole.widget.properties.tab.data", "Data")
899
+ style: pt,
900
+ children: C("bigconsole.widget.properties.tab.data", "Data")
898
901
  }),
899
- /* @__PURE__ */ S(Je, {
902
+ /* @__PURE__ */ x(it, {
900
903
  value: "advanced",
901
- style: rt,
902
- children: w("bigconsole.widget.properties.tab.advanced", "Advanced")
904
+ style: pt,
905
+ children: C("bigconsole.widget.properties.tab.advanced", "Advanced")
903
906
  }),
904
- /* @__PURE__ */ S(Je, {
907
+ /* @__PURE__ */ x(it, {
905
908
  value: "appearance",
906
- style: rt,
907
- children: w("bigconsole.widget.properties.tab.style", "Style")
909
+ style: pt,
910
+ children: C("bigconsole.widget.properties.tab.style", "Style")
908
911
  })
909
912
  ]
910
- }), /* @__PURE__ */ C("div", {
913
+ }), /* @__PURE__ */ S("div", {
911
914
  style: {
912
915
  flex: 1,
913
916
  overflow: "auto",
@@ -915,104 +918,104 @@ var w = f(function({ isOpen: f, onClose: De }) {
915
918
  minHeight: 0
916
919
  },
917
920
  children: [
918
- /* @__PURE__ */ S(Ke, {
921
+ /* @__PURE__ */ x(nt, {
919
922
  value: "general",
920
923
  className: "mt-0",
921
- children: D && /* @__PURE__ */ C(r, { children: [
922
- /* @__PURE__ */ S(le, {
923
- title: D.title,
924
- description: D.description,
925
- refreshInterval: D.refreshInterval,
924
+ children: E && /* @__PURE__ */ S(r, { children: [
925
+ /* @__PURE__ */ x(fe, {
926
+ title: E.title,
927
+ description: E.description,
928
+ refreshInterval: E.refreshInterval,
926
929
  onTitleChange: (e) => Q("title", e),
927
930
  onDescriptionChange: (e) => Q("description", e),
928
931
  onRefreshIntervalChange: (e) => Q("refreshInterval", e)
929
932
  }),
930
- /* @__PURE__ */ S(n, {
931
- title: w("bigconsole.widget.properties.actions.heading", "Buttons"),
932
- description: w("bigconsole.widget.properties.actions.subheading", "Configure buttons on this widget"),
933
+ /* @__PURE__ */ x(n, {
934
+ title: C("bigconsole.widget.properties.actions.heading", "Buttons"),
935
+ description: C("bigconsole.widget.properties.actions.subheading", "Configure buttons on this widget"),
933
936
  headingLevel: 3,
934
- meta: q.length > 0 ? /* @__PURE__ */ S("span", {
937
+ meta: J.length > 0 ? /* @__PURE__ */ x("span", {
935
938
  className: "rounded-pill bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
936
- children: q.length
939
+ children: J.length
937
940
  }) : void 0,
938
- actions: !Pt && /* @__PURE__ */ C(_, {
941
+ actions: !Yt && /* @__PURE__ */ S(g, {
939
942
  size: "sm",
940
- onClick: on,
941
- children: [/* @__PURE__ */ S(Ae, { className: "size-4" }), w("bigconsole.widget.properties.actions.add", "Add button")]
943
+ onClick: Sn,
944
+ children: [/* @__PURE__ */ x(Be, { className: "size-4" }), C("bigconsole.widget.properties.actions.add", "Add button")]
942
945
  }),
943
946
  "data-testid": "widget-inspector-actions",
944
- children: Pt ? /* @__PURE__ */ C("div", {
947
+ children: Yt ? /* @__PURE__ */ S("div", {
945
948
  role: "alert",
946
- children: [/* @__PURE__ */ S("p", { children: w("bigconsole.widget.properties.actions.readFailed", "Buttons could not be verified. Retry before saving.") }), /* @__PURE__ */ S(_, {
949
+ children: [/* @__PURE__ */ x("p", { children: C("bigconsole.widget.properties.actions.readFailed", "Buttons could not be verified. Retry before saving.") }), /* @__PURE__ */ x(g, {
947
950
  size: "sm",
948
- disabled: Nt,
949
- onClick: () => void Promise.resolve(Ft()).catch(() => {}),
950
- children: w("bigconsole.widget.properties.actions.retry", "Retry")
951
+ disabled: Jt,
952
+ onClick: () => void Promise.resolve(Xt()).catch(() => {}),
953
+ children: C("bigconsole.widget.properties.actions.retry", "Retry")
951
954
  })]
952
- }) : Nt ? /* @__PURE__ */ S("div", {
955
+ }) : Jt ? /* @__PURE__ */ x("div", {
953
956
  className: "flex justify-center py-8",
954
- children: /* @__PURE__ */ S(We, { className: "size-6" })
955
- }) : q.length === 0 ? /* @__PURE__ */ S("p", {
957
+ children: /* @__PURE__ */ x(et, { className: "size-6" })
958
+ }) : J.length === 0 ? /* @__PURE__ */ x("p", {
956
959
  className: "text-sm text-text-secondary",
957
- children: w("bigconsole.widget.properties.actions.empty", "No buttons yet — add one to let viewers take an action.")
958
- }) : /* @__PURE__ */ S("div", {
960
+ children: C("bigconsole.widget.properties.actions.empty", "No buttons yet — add one to let viewers take an action.")
961
+ }) : /* @__PURE__ */ x("div", {
959
962
  className: "space-y-2",
960
- children: [...q].sort((e, t) => e.order - t.order).map((e, t) => /* @__PURE__ */ S(Ne, {
963
+ children: [...J].sort((e, t) => e.order - t.order).map((e, t) => /* @__PURE__ */ x(Ue, {
961
964
  className: e.disabled ? "opacity-60" : "",
962
- children: /* @__PURE__ */ C(Pe, {
965
+ children: /* @__PURE__ */ S(We, {
963
966
  className: "p-3 flex items-center gap-2",
964
967
  children: [
965
- /* @__PURE__ */ C("div", {
968
+ /* @__PURE__ */ S("div", {
966
969
  className: "flex flex-col gap-0.5",
967
- children: [/* @__PURE__ */ S(_, {
970
+ children: [/* @__PURE__ */ x(g, {
968
971
  variant: "ghost",
969
972
  size: "icon-sm",
970
- onClick: () => un(t),
973
+ onClick: () => En(t),
971
974
  disabled: t === 0,
972
975
  className: "h-5 w-5",
973
- children: /* @__PURE__ */ S(Ee, { className: "size-3" })
974
- }), /* @__PURE__ */ S(_, {
976
+ children: /* @__PURE__ */ x(Ie, { className: "size-3" })
977
+ }), /* @__PURE__ */ x(g, {
975
978
  variant: "ghost",
976
979
  size: "icon-sm",
977
- onClick: () => dn(t),
978
- disabled: t === q.length - 1,
980
+ onClick: () => Dn(t),
981
+ disabled: t === J.length - 1,
979
982
  className: "h-5 w-5",
980
- children: /* @__PURE__ */ S(Te, { className: "size-3" })
983
+ children: /* @__PURE__ */ x(Fe, { className: "size-3" })
981
984
  })]
982
985
  }),
983
- /* @__PURE__ */ C("div", {
986
+ /* @__PURE__ */ S("div", {
984
987
  className: "flex-1 min-w-0",
985
- children: [/* @__PURE__ */ C("div", {
988
+ children: [/* @__PURE__ */ S("div", {
986
989
  className: "flex items-center gap-2",
987
- children: [/* @__PURE__ */ S("span", {
990
+ children: [/* @__PURE__ */ x("span", {
988
991
  "aria-hidden": "true",
989
- className: `size-2 shrink-0 rounded-full ${tt[e.style] || nt}`
990
- }), /* @__PURE__ */ S("span", {
992
+ className: `size-2 shrink-0 rounded-full ${dt[e.style] || ft}`
993
+ }), /* @__PURE__ */ x("span", {
991
994
  className: "text-sm font-medium truncate",
992
995
  children: e.label
993
996
  })]
994
- }), /* @__PURE__ */ S("p", {
997
+ }), /* @__PURE__ */ x("p", {
995
998
  className: "text-xs text-text-secondary truncate",
996
- children: an.has(e.name) ? w("bigconsole.widget.properties.actions.webhookSummary", "→ {{method}} {{url}}", {
997
- method: an.get(e.name)?.method ?? "",
998
- url: an.get(e.name)?.webhookUrl ?? ""
999
- }) : w("bigconsole.widget.properties.actions.emitsEvent", "Emits an event")
999
+ children: xn.has(e.name) ? C("bigconsole.widget.properties.actions.webhookSummary", "→ {{method}} {{url}}", {
1000
+ method: xn.get(e.name)?.method ?? "",
1001
+ url: xn.get(e.name)?.webhookUrl ?? ""
1002
+ }) : C("bigconsole.widget.properties.actions.emitsEvent", "Emits an event")
1000
1003
  })]
1001
1004
  }),
1002
- /* @__PURE__ */ C("div", {
1005
+ /* @__PURE__ */ S("div", {
1003
1006
  className: "flex shrink-0 gap-1",
1004
- children: [/* @__PURE__ */ S(_, {
1007
+ children: [/* @__PURE__ */ x(g, {
1005
1008
  variant: "ghost",
1006
1009
  size: "icon-sm",
1007
1010
  "aria-label": `Edit ${e.label}`,
1008
- onClick: () => sn(e),
1009
- children: /* @__PURE__ */ S(ke, { className: "size-4" })
1010
- }), /* @__PURE__ */ S(_, {
1011
+ onClick: () => Cn(e),
1012
+ children: /* @__PURE__ */ x(ze, { className: "size-4" })
1013
+ }), /* @__PURE__ */ x(g, {
1011
1014
  variant: "ghost",
1012
1015
  size: "icon-sm",
1013
1016
  "aria-label": `Delete ${e.label}`,
1014
- onClick: () => ln(e.id),
1015
- children: /* @__PURE__ */ S(je, { className: "size-4" })
1017
+ onClick: () => Tn(e.id),
1018
+ children: /* @__PURE__ */ x(Ve, { className: "size-4" })
1016
1019
  })]
1017
1020
  })
1018
1021
  ]
@@ -1020,430 +1023,443 @@ var w = f(function({ isOpen: f, onClose: De }) {
1020
1023
  }, e.id))
1021
1024
  })
1022
1025
  }),
1023
- dt && ft && /* @__PURE__ */ S(de, {
1024
- position: ft,
1025
- columns: ie.cols,
1026
- onChange: gt
1026
+ xt && St && /* @__PURE__ */ x(me, {
1027
+ position: St,
1028
+ columns: re.cols,
1029
+ onChange: Et
1027
1030
  })
1028
1031
  ] })
1029
1032
  }),
1030
- /* @__PURE__ */ S(Ke, {
1033
+ /* @__PURE__ */ x(nt, {
1031
1034
  value: "data",
1032
1035
  className: "mt-0",
1033
- children: D && /* @__PURE__ */ C(r, { children: [(() => {
1034
- let e = d({
1035
- dataSinkId: D.dataSinkId,
1036
- parserId: D.parserId,
1037
- config: {
1038
- ...D.config,
1039
- binding: void 0
1040
- }
1041
- }), t = ye({
1042
- binding: e,
1043
- loading: Ot || Et,
1044
- error: jt,
1045
- preview: Mt,
1046
- previewComplete: At,
1047
- widgetType: F?.type,
1048
- mockData: D.config?.mockData,
1049
- hasParser: !!D.parserId,
1050
- config: D.config
1051
- }), n = z && z.id === D.parserId && (!xt || z.inputSinkKey === xt) && At && !Ot && !jt ? Mt : void 0;
1052
- return /* @__PURE__ */ S(ue, {
1053
- consoleId: F?.dashboardId || "",
1054
- binding: e,
1055
- resolvedParser: z ?? void 0,
1056
- dataSinkKey: xt,
1057
- dataPath: typeof D.config.dataPath == "string" ? D.config.dataPath : void 0,
1058
- status: t.status,
1059
- resolving: Et,
1060
- missingFields: t.missingFields,
1061
- preview: Mt,
1062
- fieldMappings: F?.type === "chart" || F?.type === "funnel_chart" ? /* @__PURE__ */ S(he, {
1063
- config: D.config,
1064
- funnel: F.type === "funnel_chart",
1065
- preview: n,
1066
- onChange: (e, t) => $({
1067
- ...D.config,
1068
- [e]: t
1036
+ children: E && /* @__PURE__ */ S(r, { children: [
1037
+ (() => {
1038
+ let e = Oe({
1039
+ dataSinkId: E.dataSinkId,
1040
+ parserId: E.parserId,
1041
+ config: {
1042
+ ...E.config,
1043
+ binding: void 0
1044
+ }
1045
+ }), t = ke({
1046
+ binding: e,
1047
+ loading: Rt || It,
1048
+ error: Vt,
1049
+ preview: G,
1050
+ previewComplete: Bt,
1051
+ widgetType: P?.type,
1052
+ mockData: E.config?.mockData,
1053
+ hasParser: !!E.parserId,
1054
+ config: E.config
1055
+ }), n = R && R.id === E.parserId && (!jt || R.inputSinkKey === jt) && Bt && !Rt && !Vt ? G : void 0;
1056
+ return /* @__PURE__ */ x(pe, {
1057
+ consoleId: P?.dashboardId || "",
1058
+ binding: e,
1059
+ resolvedParser: R ?? void 0,
1060
+ dataSinkKey: jt,
1061
+ dataPath: typeof E.config.dataPath == "string" ? E.config.dataPath : void 0,
1062
+ status: t.status,
1063
+ resolving: It,
1064
+ missingFields: t.missingFields,
1065
+ preview: G,
1066
+ fieldMappings: !K && (P?.type === "chart" || P?.type === "funnel_chart") ? /* @__PURE__ */ x(he, {
1067
+ config: E.config,
1068
+ funnel: P.type === "funnel_chart",
1069
+ preview: n,
1070
+ onChange: (e, t) => $({
1071
+ ...E.config,
1072
+ [e]: t
1073
+ })
1074
+ }, M) : void 0,
1075
+ error: Vt,
1076
+ onDataSinkChange: On,
1077
+ onParserChange: kn,
1078
+ onDataPathChange: (e) => $({
1079
+ ...E.config,
1080
+ dataPath: e
1069
1081
  })
1070
- }, M) : void 0,
1071
- error: jt,
1072
- onDataSinkChange: fn,
1073
- onParserChange: pn,
1074
- onDataPathChange: (e) => $({
1075
- ...D.config,
1076
- dataPath: e
1077
- })
1078
- });
1079
- })(), /* @__PURE__ */ S(n, {
1080
- emphasis: "muted",
1081
- title: w("bigconsole.widget.properties.data.alternativeSources", "Alternative Data Sources"),
1082
- description: "Skip the DataSink pipeline and fetch straight from an API, a GraphQL endpoint or sample JSON.",
1083
- headingLevel: 3,
1084
- "data-testid": "widget-inspector-alt-sources",
1085
- children: /* @__PURE__ */ C("div", {
1086
- className: "flex flex-col gap-form-gap",
1087
- children: [
1088
- /* @__PURE__ */ C("div", {
1089
- className: "space-y-2",
1090
- children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.data.sourceTypeLabel", "Data Source Type") }), /* @__PURE__ */ C(Fe, {
1091
- value: D.config?.dataSourceType || "",
1092
- onValueChange: (e) => $({
1093
- ...D.config,
1094
- dataSourceType: e || void 0
1095
- }),
1096
- children: [/* @__PURE__ */ S(Le, {
1097
- style: {
1098
- height: "var(--size-controlHeight-md)",
1099
- fontSize: "var(--font-size-body-sm)"
1100
- },
1101
- children: /* @__PURE__ */ S(Re, { placeholder: w("bigconsole.widget.properties.data.selectTypePlaceholder", "Select type...") })
1102
- }), /* @__PURE__ */ S(Ie, {
1103
- position: "popper",
1104
- side: "bottom",
1105
- sideOffset: 4,
1106
- align: "start",
1107
- style: {
1108
- zIndex: 9999,
1109
- maxHeight: "200px",
1110
- backgroundColor: "var(--color-overlay-popoverBg, var(--color-bg-surface))",
1111
- border: "1px solid var(--color-border-subtle)",
1112
- boxShadow: "var(--shadow-elevation-3)",
1113
- borderRadius: "var(--radius-button)"
1114
- },
1115
- children: bn.map((e) => /* @__PURE__ */ S(b, {
1116
- value: e.value,
1117
- children: e.label
1118
- }, e.value))
1119
- })]
1120
- })]
1121
- }),
1122
- /* @__PURE__ */ S(ve, {
1123
- dataSourceType: D.config?.dataSourceType,
1124
- t: w
1125
- }),
1126
- D.config?.dataSourceType === "REST_API" && /* @__PURE__ */ C("div", {
1127
- className: "space-y-3",
1128
- children: [
1129
- /* @__PURE__ */ C("div", {
1130
- className: "space-y-2",
1131
- children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.rest.endpointUrlLabel", "Endpoint URL *") }), /* @__PURE__ */ S(v, {
1132
- value: D.config?.endpointUrl || "",
1133
- onChange: (e) => $({
1134
- ...D.config,
1135
- endpointUrl: e.target.value || void 0
1136
- }),
1137
- placeholder: "https://api.example.com/data"
1082
+ });
1083
+ })(),
1084
+ P && (Gt || K && Ce(P.type)) && (K || E.parserId || E.dataSinkId) && /* @__PURE__ */ x(ge, {
1085
+ widget: {
1086
+ ...P,
1087
+ config: E.config
1088
+ },
1089
+ rows: Ut,
1090
+ query: K,
1091
+ sourceSaved: Ht,
1092
+ onChange: (e) => $(_e(E.config, P.type, e))
1093
+ }),
1094
+ /* @__PURE__ */ x(n, {
1095
+ emphasis: "muted",
1096
+ title: C("bigconsole.widget.properties.data.alternativeSources", "Alternative Data Sources"),
1097
+ description: "Skip the DataSink pipeline and fetch straight from an API, a GraphQL endpoint or sample JSON.",
1098
+ headingLevel: 3,
1099
+ "data-testid": "widget-inspector-alt-sources",
1100
+ children: /* @__PURE__ */ S("div", {
1101
+ className: "flex flex-col gap-form-gap",
1102
+ children: [
1103
+ /* @__PURE__ */ S("div", {
1104
+ className: "space-y-2",
1105
+ children: [/* @__PURE__ */ x(v, { children: C("bigconsole.widget.properties.data.sourceTypeLabel", "Data Source Type") }), /* @__PURE__ */ S(Ge, {
1106
+ value: E.config?.dataSourceType || "",
1107
+ onValueChange: (e) => $({
1108
+ ...E.config,
1109
+ dataSourceType: e || void 0
1110
+ }),
1111
+ children: [/* @__PURE__ */ x(qe, {
1112
+ style: {
1113
+ height: "var(--size-controlHeight-md)",
1114
+ fontSize: "var(--font-size-body-sm)"
1115
+ },
1116
+ children: /* @__PURE__ */ x(Je, { placeholder: C("bigconsole.widget.properties.data.selectTypePlaceholder", "Select type...") })
1117
+ }), /* @__PURE__ */ x(Ke, {
1118
+ position: "popper",
1119
+ side: "bottom",
1120
+ sideOffset: 4,
1121
+ align: "start",
1122
+ style: {
1123
+ zIndex: 9999,
1124
+ maxHeight: "200px",
1125
+ backgroundColor: "var(--color-overlay-popoverBg, var(--color-bg-surface))",
1126
+ border: "1px solid var(--color-border-subtle)",
1127
+ boxShadow: "var(--shadow-elevation-3)",
1128
+ borderRadius: "var(--radius-button)"
1129
+ },
1130
+ children: In.map((e) => /* @__PURE__ */ x(y, {
1131
+ value: e.value,
1132
+ children: e.label
1133
+ }, e.value))
1138
1134
  })]
1139
- }),
1140
- /* @__PURE__ */ C("div", {
1141
- className: "space-y-2",
1142
- children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.rest.httpMethodLabel", "HTTP Method") }), /* @__PURE__ */ C(Fe, {
1143
- value: D.config?.httpMethod || "GET",
1144
- onValueChange: (e) => $({
1145
- ...D.config,
1146
- httpMethod: e
1147
- }),
1148
- children: [/* @__PURE__ */ S(Le, {
1149
- style: { height: "var(--size-controlHeight-md)" },
1150
- children: /* @__PURE__ */ S(Re, {})
1151
- }), /* @__PURE__ */ C(Ie, {
1152
- position: "popper",
1153
- side: "bottom",
1154
- sideOffset: 4,
1155
- children: [
1156
- /* @__PURE__ */ S(b, {
1157
- value: "GET",
1158
- children: "GET"
1159
- }),
1160
- /* @__PURE__ */ S(b, {
1161
- value: "POST",
1162
- children: "POST"
1163
- }),
1164
- /* @__PURE__ */ S(b, {
1165
- value: "PUT",
1166
- children: "PUT"
1167
- }),
1168
- /* @__PURE__ */ S(b, {
1169
- value: "DELETE",
1170
- children: "DELETE"
1171
- })
1172
- ]
1135
+ })]
1136
+ }),
1137
+ /* @__PURE__ */ x(De, {
1138
+ dataSourceType: E.config?.dataSourceType,
1139
+ t: C
1140
+ }),
1141
+ E.config?.dataSourceType === "REST_API" && /* @__PURE__ */ S("div", {
1142
+ className: "space-y-3",
1143
+ children: [
1144
+ /* @__PURE__ */ S("div", {
1145
+ className: "space-y-2",
1146
+ children: [/* @__PURE__ */ x(v, { children: C("bigconsole.widget.properties.rest.endpointUrlLabel", "Endpoint URL *") }), /* @__PURE__ */ x(_, {
1147
+ value: E.config?.endpointUrl || "",
1148
+ onChange: (e) => $({
1149
+ ...E.config,
1150
+ endpointUrl: e.target.value || void 0
1151
+ }),
1152
+ placeholder: "https://api.example.com/data"
1173
1153
  })]
1174
- })]
1175
- }),
1176
- /* @__PURE__ */ C("div", {
1177
- className: "space-y-2",
1178
- children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.rest.headersLabel", "Headers (JSON)") }), /* @__PURE__ */ S(x, {
1179
- value: D.config?.headers || "",
1180
- onChange: (e) => $({
1181
- ...D.config,
1182
- headers: e.target.value || void 0
1183
- }),
1184
- rows: 3,
1185
- placeholder: "{\"Authorization\": \"Bearer token\", \"Content-Type\": \"application/json\"}",
1186
- className: "font-mono text-xs"
1187
- })]
1188
- }),
1189
- /* @__PURE__ */ C("div", {
1190
- className: "space-y-2",
1191
- children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.rest.authenticationLabel", "Authentication") }), /* @__PURE__ */ C(Fe, {
1192
- value: D.config?.authType || "none",
1193
- onValueChange: (e) => $({
1194
- ...D.config,
1195
- authType: e
1196
- }),
1197
- children: [/* @__PURE__ */ S(Le, {
1198
- style: { height: "var(--size-controlHeight-md)" },
1199
- children: /* @__PURE__ */ S(Re, {})
1200
- }), /* @__PURE__ */ C(Ie, {
1201
- position: "popper",
1202
- side: "bottom",
1203
- sideOffset: 4,
1204
- children: [
1205
- /* @__PURE__ */ S(b, {
1206
- value: "none",
1207
- children: w("bigconsole.widget.properties.rest.authNone", "None")
1208
- }),
1209
- /* @__PURE__ */ S(b, {
1210
- value: "api_key",
1211
- children: w("bigconsole.widget.properties.rest.authApiKey", "API Key")
1212
- }),
1213
- /* @__PURE__ */ S(b, {
1214
- value: "bearer",
1215
- children: w("bigconsole.widget.properties.rest.authBearer", "Bearer Token")
1154
+ }),
1155
+ /* @__PURE__ */ S("div", {
1156
+ className: "space-y-2",
1157
+ children: [/* @__PURE__ */ x(v, { children: C("bigconsole.widget.properties.rest.httpMethodLabel", "HTTP Method") }), /* @__PURE__ */ S(Ge, {
1158
+ value: E.config?.httpMethod || "GET",
1159
+ onValueChange: (e) => $({
1160
+ ...E.config,
1161
+ httpMethod: e
1162
+ }),
1163
+ children: [/* @__PURE__ */ x(qe, {
1164
+ style: { height: "var(--size-controlHeight-md)" },
1165
+ children: /* @__PURE__ */ x(Je, {})
1166
+ }), /* @__PURE__ */ S(Ke, {
1167
+ position: "popper",
1168
+ side: "bottom",
1169
+ sideOffset: 4,
1170
+ children: [
1171
+ /* @__PURE__ */ x(y, {
1172
+ value: "GET",
1173
+ children: "GET"
1174
+ }),
1175
+ /* @__PURE__ */ x(y, {
1176
+ value: "POST",
1177
+ children: "POST"
1178
+ }),
1179
+ /* @__PURE__ */ x(y, {
1180
+ value: "PUT",
1181
+ children: "PUT"
1182
+ }),
1183
+ /* @__PURE__ */ x(y, {
1184
+ value: "DELETE",
1185
+ children: "DELETE"
1186
+ })
1187
+ ]
1188
+ })]
1189
+ })]
1190
+ }),
1191
+ /* @__PURE__ */ S("div", {
1192
+ className: "space-y-2",
1193
+ children: [/* @__PURE__ */ x(v, { children: C("bigconsole.widget.properties.rest.headersLabel", "Headers (JSON)") }), /* @__PURE__ */ x(b, {
1194
+ value: E.config?.headers || "",
1195
+ onChange: (e) => $({
1196
+ ...E.config,
1197
+ headers: e.target.value || void 0
1198
+ }),
1199
+ rows: 3,
1200
+ placeholder: "{\"Authorization\": \"Bearer token\", \"Content-Type\": \"application/json\"}",
1201
+ className: "font-mono text-xs"
1202
+ })]
1203
+ }),
1204
+ /* @__PURE__ */ S("div", {
1205
+ className: "space-y-2",
1206
+ children: [/* @__PURE__ */ x(v, { children: C("bigconsole.widget.properties.rest.authenticationLabel", "Authentication") }), /* @__PURE__ */ S(Ge, {
1207
+ value: E.config?.authType || "none",
1208
+ onValueChange: (e) => $({
1209
+ ...E.config,
1210
+ authType: e
1211
+ }),
1212
+ children: [/* @__PURE__ */ x(qe, {
1213
+ style: { height: "var(--size-controlHeight-md)" },
1214
+ children: /* @__PURE__ */ x(Je, {})
1215
+ }), /* @__PURE__ */ S(Ke, {
1216
+ position: "popper",
1217
+ side: "bottom",
1218
+ sideOffset: 4,
1219
+ children: [
1220
+ /* @__PURE__ */ x(y, {
1221
+ value: "none",
1222
+ children: C("bigconsole.widget.properties.rest.authNone", "None")
1223
+ }),
1224
+ /* @__PURE__ */ x(y, {
1225
+ value: "api_key",
1226
+ children: C("bigconsole.widget.properties.rest.authApiKey", "API Key")
1227
+ }),
1228
+ /* @__PURE__ */ x(y, {
1229
+ value: "bearer",
1230
+ children: C("bigconsole.widget.properties.rest.authBearer", "Bearer Token")
1231
+ }),
1232
+ /* @__PURE__ */ x(y, {
1233
+ value: "basic",
1234
+ children: C("bigconsole.widget.properties.rest.authBasic", "Basic Auth")
1235
+ })
1236
+ ]
1237
+ })]
1238
+ })]
1239
+ }),
1240
+ !!(E.config?.authType && E.config.authType !== "none") && /* @__PURE__ */ S("div", {
1241
+ className: "space-y-2",
1242
+ children: [/* @__PURE__ */ x(v, { children: String(E.config.authType) === "basic" ? C("bigconsole.widget.properties.rest.credentialsLabel", "Credentials (user:pass)") : C("bigconsole.widget.properties.rest.tokenKeyLabel", "Token/Key") }), /* @__PURE__ */ x(_, {
1243
+ type: "password",
1244
+ value: E.config?.authValue || "",
1245
+ onChange: (e) => $({
1246
+ ...E.config,
1247
+ authValue: e.target.value || void 0
1248
+ }),
1249
+ placeholder: E.config.authType === "basic" ? C("bigconsole.widget.properties.rest.credentialsPlaceholder", "username:password") : C("bigconsole.widget.properties.rest.tokenKeyPlaceholder", "Enter token or API key")
1250
+ })]
1251
+ }),
1252
+ (E.config?.httpMethod === "POST" || E.config?.httpMethod === "PUT") && /* @__PURE__ */ S("div", {
1253
+ className: "space-y-2",
1254
+ children: [/* @__PURE__ */ x(v, { children: C("bigconsole.widget.properties.rest.requestBodyLabel", "Request Body (JSON)") }), /* @__PURE__ */ x(b, {
1255
+ value: E.config?.requestBody || "",
1256
+ onChange: (e) => $({
1257
+ ...E.config,
1258
+ requestBody: e.target.value || void 0
1259
+ }),
1260
+ rows: 4,
1261
+ placeholder: "{\"key\": \"value\"}",
1262
+ className: "font-mono text-xs"
1263
+ })]
1264
+ }),
1265
+ /* @__PURE__ */ S("div", {
1266
+ className: "space-y-2",
1267
+ children: [
1268
+ /* @__PURE__ */ x(v, { children: C("bigconsole.widget.properties.dataPath.label", "Data Path (optional)") }),
1269
+ /* @__PURE__ */ x(_, {
1270
+ value: E.config?.dataPath || "",
1271
+ onChange: (e) => $({
1272
+ ...E.config,
1273
+ dataPath: e.target.value || void 0
1216
1274
  }),
1217
- /* @__PURE__ */ S(b, {
1218
- value: "basic",
1219
- children: w("bigconsole.widget.properties.rest.authBasic", "Basic Auth")
1220
- })
1221
- ]
1275
+ placeholder: "$.data.items or .data.items"
1276
+ }),
1277
+ /* @__PURE__ */ x("p", {
1278
+ className: "text-xs text-text-secondary",
1279
+ children: C("bigconsole.widget.properties.dataPath.restHelp", "JSONPath or dot notation to extract data from response")
1280
+ })
1281
+ ]
1282
+ })
1283
+ ]
1284
+ }),
1285
+ E.config?.dataSourceType === "GRAPHQL" && /* @__PURE__ */ S("div", {
1286
+ className: "space-y-3",
1287
+ children: [
1288
+ /* @__PURE__ */ S("div", {
1289
+ className: "space-y-2",
1290
+ children: [/* @__PURE__ */ x(v, { children: C("bigconsole.widget.properties.graphql.endpointLabel", "GraphQL Endpoint *") }), /* @__PURE__ */ x(_, {
1291
+ value: E.config?.graphqlEndpoint || "",
1292
+ onChange: (e) => $({
1293
+ ...E.config,
1294
+ graphqlEndpoint: e.target.value || void 0
1295
+ }),
1296
+ placeholder: "https://api.example.com/graphql"
1222
1297
  })]
1223
- })]
1224
- }),
1225
- !!(D.config?.authType && D.config.authType !== "none") && /* @__PURE__ */ C("div", {
1226
- className: "space-y-2",
1227
- children: [/* @__PURE__ */ S(y, { children: String(D.config.authType) === "basic" ? w("bigconsole.widget.properties.rest.credentialsLabel", "Credentials (user:pass)") : w("bigconsole.widget.properties.rest.tokenKeyLabel", "Token/Key") }), /* @__PURE__ */ S(v, {
1228
- type: "password",
1229
- value: D.config?.authValue || "",
1230
- onChange: (e) => $({
1231
- ...D.config,
1232
- authValue: e.target.value || void 0
1233
- }),
1234
- placeholder: D.config.authType === "basic" ? w("bigconsole.widget.properties.rest.credentialsPlaceholder", "username:password") : w("bigconsole.widget.properties.rest.tokenKeyPlaceholder", "Enter token or API key")
1235
- })]
1236
- }),
1237
- (D.config?.httpMethod === "POST" || D.config?.httpMethod === "PUT") && /* @__PURE__ */ C("div", {
1238
- className: "space-y-2",
1239
- children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.rest.requestBodyLabel", "Request Body (JSON)") }), /* @__PURE__ */ S(x, {
1240
- value: D.config?.requestBody || "",
1241
- onChange: (e) => $({
1242
- ...D.config,
1243
- requestBody: e.target.value || void 0
1244
- }),
1245
- rows: 4,
1246
- placeholder: "{\"key\": \"value\"}",
1247
- className: "font-mono text-xs"
1248
- })]
1249
- }),
1250
- /* @__PURE__ */ C("div", {
1251
- className: "space-y-2",
1252
- children: [
1253
- /* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.dataPath.label", "Data Path (optional)") }),
1254
- /* @__PURE__ */ S(v, {
1255
- value: D.config?.dataPath || "",
1298
+ }),
1299
+ /* @__PURE__ */ S("div", {
1300
+ className: "space-y-2",
1301
+ children: [/* @__PURE__ */ x(v, { children: C("bigconsole.widget.properties.graphql.queryLabel", "Query *") }), /* @__PURE__ */ x(b, {
1302
+ value: E.config?.graphqlQuery || "",
1256
1303
  onChange: (e) => $({
1257
- ...D.config,
1258
- dataPath: e.target.value || void 0
1304
+ ...E.config,
1305
+ graphqlQuery: e.target.value || void 0
1259
1306
  }),
1260
- placeholder: "$.data.items or .data.items"
1261
- }),
1262
- /* @__PURE__ */ S("p", {
1263
- className: "text-xs text-text-secondary",
1264
- children: w("bigconsole.widget.properties.dataPath.restHelp", "JSONPath or dot notation to extract data from response")
1265
- })
1266
- ]
1267
- })
1268
- ]
1269
- }),
1270
- D.config?.dataSourceType === "GRAPHQL" && /* @__PURE__ */ C("div", {
1271
- className: "space-y-3",
1272
- children: [
1273
- /* @__PURE__ */ C("div", {
1274
- className: "space-y-2",
1275
- children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.graphql.endpointLabel", "GraphQL Endpoint *") }), /* @__PURE__ */ S(v, {
1276
- value: D.config?.graphqlEndpoint || "",
1277
- onChange: (e) => $({
1278
- ...D.config,
1279
- graphqlEndpoint: e.target.value || void 0
1280
- }),
1281
- placeholder: "https://api.example.com/graphql"
1282
- })]
1283
- }),
1284
- /* @__PURE__ */ C("div", {
1285
- className: "space-y-2",
1286
- children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.graphql.queryLabel", "Query *") }), /* @__PURE__ */ S(x, {
1287
- value: D.config?.graphqlQuery || "",
1288
- onChange: (e) => $({
1289
- ...D.config,
1290
- graphqlQuery: e.target.value || void 0
1291
- }),
1292
- rows: 6,
1293
- placeholder: "query GetData($limit: Int) {\n items(limit: $limit) {\n id\n name\n value\n }\n}",
1294
- className: "font-mono text-xs"
1295
- })]
1296
- }),
1297
- /* @__PURE__ */ C("div", {
1298
- className: "space-y-2",
1299
- children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.graphql.variablesLabel", "Variables (JSON, optional)") }), /* @__PURE__ */ S(x, {
1300
- value: D.config?.graphqlVariables || "",
1301
- onChange: (e) => $({
1302
- ...D.config,
1303
- graphqlVariables: e.target.value || void 0
1304
- }),
1305
- rows: 3,
1306
- placeholder: "{\"limit\": 10, \"offset\": 0}",
1307
- className: "font-mono text-xs"
1308
- })]
1309
- }),
1310
- /* @__PURE__ */ C("div", {
1311
- className: "space-y-2",
1312
- children: [/* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.graphql.headersLabel", "Headers (JSON, optional)") }), /* @__PURE__ */ S(x, {
1313
- value: D.config?.headers || "",
1314
- onChange: (e) => $({
1315
- ...D.config,
1316
- headers: e.target.value || void 0
1317
- }),
1318
- rows: 2,
1319
- placeholder: "{\"Authorization\": \"Bearer token\"}",
1320
- className: "font-mono text-xs"
1321
- })]
1322
- }),
1323
- /* @__PURE__ */ C("div", {
1324
- className: "space-y-2",
1325
- children: [
1326
- /* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.dataPath.label", "Data Path (optional)") }),
1327
- /* @__PURE__ */ S(v, {
1328
- value: D.config?.dataPath || "",
1307
+ rows: 6,
1308
+ placeholder: "query GetData($limit: Int) {\n items(limit: $limit) {\n id\n name\n value\n }\n}",
1309
+ className: "font-mono text-xs"
1310
+ })]
1311
+ }),
1312
+ /* @__PURE__ */ S("div", {
1313
+ className: "space-y-2",
1314
+ children: [/* @__PURE__ */ x(v, { children: C("bigconsole.widget.properties.graphql.variablesLabel", "Variables (JSON, optional)") }), /* @__PURE__ */ x(b, {
1315
+ value: E.config?.graphqlVariables || "",
1329
1316
  onChange: (e) => $({
1330
- ...D.config,
1331
- dataPath: e.target.value || void 0
1317
+ ...E.config,
1318
+ graphqlVariables: e.target.value || void 0
1319
+ }),
1320
+ rows: 3,
1321
+ placeholder: "{\"limit\": 10, \"offset\": 0}",
1322
+ className: "font-mono text-xs"
1323
+ })]
1324
+ }),
1325
+ /* @__PURE__ */ S("div", {
1326
+ className: "space-y-2",
1327
+ children: [/* @__PURE__ */ x(v, { children: C("bigconsole.widget.properties.graphql.headersLabel", "Headers (JSON, optional)") }), /* @__PURE__ */ x(b, {
1328
+ value: E.config?.headers || "",
1329
+ onChange: (e) => $({
1330
+ ...E.config,
1331
+ headers: e.target.value || void 0
1332
+ }),
1333
+ rows: 2,
1334
+ placeholder: "{\"Authorization\": \"Bearer token\"}",
1335
+ className: "font-mono text-xs"
1336
+ })]
1337
+ }),
1338
+ /* @__PURE__ */ S("div", {
1339
+ className: "space-y-2",
1340
+ children: [
1341
+ /* @__PURE__ */ x(v, { children: C("bigconsole.widget.properties.dataPath.label", "Data Path (optional)") }),
1342
+ /* @__PURE__ */ x(_, {
1343
+ value: E.config?.dataPath || "",
1344
+ onChange: (e) => $({
1345
+ ...E.config,
1346
+ dataPath: e.target.value || void 0
1347
+ }),
1348
+ placeholder: ".data.items"
1332
1349
  }),
1333
- placeholder: ".data.items"
1350
+ /* @__PURE__ */ x("p", {
1351
+ className: "text-xs text-text-secondary",
1352
+ children: C("bigconsole.widget.properties.dataPath.graphqlHelp", "Path to extract data from GraphQL response")
1353
+ })
1354
+ ]
1355
+ })
1356
+ ]
1357
+ }),
1358
+ E.config?.dataSourceType === "MOCK" && /* @__PURE__ */ S("div", {
1359
+ className: "space-y-2",
1360
+ children: [
1361
+ /* @__PURE__ */ x(v, { children: C("bigconsole.widget.properties.mock.sampleDataLabel", "Sample Data (JSON)") }),
1362
+ /* @__PURE__ */ x(b, {
1363
+ value: E.config?.mockData || "",
1364
+ onChange: (e) => $({
1365
+ ...E.config,
1366
+ mockData: e.target.value || void 0
1334
1367
  }),
1335
- /* @__PURE__ */ S("p", {
1336
- className: "text-xs text-text-secondary",
1337
- children: w("bigconsole.widget.properties.dataPath.graphqlHelp", "Path to extract data from GraphQL response")
1338
- })
1339
- ]
1340
- })
1341
- ]
1342
- }),
1343
- D.config?.dataSourceType === "MOCK" && /* @__PURE__ */ C("div", {
1344
- className: "space-y-2",
1345
- children: [
1346
- /* @__PURE__ */ S(y, { children: w("bigconsole.widget.properties.mock.sampleDataLabel", "Sample Data (JSON)") }),
1347
- /* @__PURE__ */ S(x, {
1348
- value: D.config?.mockData || "",
1349
- onChange: (e) => $({
1350
- ...D.config,
1351
- mockData: e.target.value || void 0
1368
+ rows: 6,
1369
+ placeholder: JSON.stringify(Ee(P?.type) ?? { value: 100 }, null, 2),
1370
+ className: "font-mono text-sm"
1352
1371
  }),
1353
- rows: 6,
1354
- placeholder: JSON.stringify(_e(F?.type) ?? { value: 100 }, null, 2),
1355
- className: "font-mono text-sm"
1356
- }),
1357
- ge(F?.type) && /* @__PURE__ */ S("p", {
1358
- className: "text-xs text-text-secondary",
1359
- children: w("bigconsole.widget.properties.mock.shapeHelp", "This widget needs {{shape}}.", { shape: ge(F?.type) ?? "" })
1360
- })
1361
- ]
1362
- })
1363
- ]
1372
+ Te(P?.type) && /* @__PURE__ */ x("p", {
1373
+ className: "text-xs text-text-secondary",
1374
+ children: C("bigconsole.widget.properties.mock.shapeHelp", "This widget needs {{shape}}.", { shape: Te(P?.type) ?? "" })
1375
+ })
1376
+ ]
1377
+ })
1378
+ ]
1379
+ })
1364
1380
  })
1365
- })] })
1381
+ ] })
1366
1382
  }),
1367
- /* @__PURE__ */ S(Ke, {
1383
+ /* @__PURE__ */ x(nt, {
1368
1384
  value: "advanced",
1369
1385
  className: "mt-0",
1370
- children: /* @__PURE__ */ C(r, { children: [
1371
- D && /* @__PURE__ */ S(se, {
1372
- renderer: D.renderer,
1373
- rendererOptions: yn,
1386
+ children: /* @__PURE__ */ S(r, { children: [
1387
+ E && /* @__PURE__ */ x(ue, {
1388
+ renderer: E.renderer,
1389
+ rendererOptions: Fn,
1374
1390
  onRendererChange: (e) => {
1375
1391
  Q("renderer", e), e === "BIGCONSOLE" && Q("template", void 0);
1376
1392
  },
1377
- templateEditor: D.renderer === "BIGCONSOLE" ? void 0 : /* @__PURE__ */ S(at, {
1393
+ templateEditor: E.renderer === "BIGCONSOLE" ? void 0 : /* @__PURE__ */ x(ht, {
1378
1394
  widget: {
1379
- ...F,
1380
- template: D.template,
1381
- renderer: D.renderer
1395
+ ...P,
1396
+ template: E.template,
1397
+ renderer: E.renderer
1382
1398
  },
1383
1399
  onSave: (e) => Q("template", e)
1384
1400
  })
1385
1401
  }),
1386
- /* @__PURE__ */ S(n, {
1387
- title: w("bigconsole.widget.properties.section.drilldown", "Drilldown"),
1402
+ /* @__PURE__ */ x(n, {
1403
+ title: C("bigconsole.widget.properties.section.drilldown", "Drilldown"),
1388
1404
  description: "Where a click on this widget's data takes the viewer.",
1389
1405
  headingLevel: 3,
1390
1406
  "data-testid": "widget-inspector-drilldown",
1391
- children: /* @__PURE__ */ S(l, {
1392
- widget: F,
1393
- onChange: _n
1407
+ children: /* @__PURE__ */ x(te, {
1408
+ widget: P,
1409
+ onChange: Nn
1394
1410
  })
1395
1411
  }),
1396
- /* @__PURE__ */ S(n, {
1397
- title: w("bigconsole.widget.properties.section.webhooks", "Webhooks"),
1412
+ /* @__PURE__ */ x(n, {
1413
+ title: C("bigconsole.widget.properties.section.webhooks", "Webhooks"),
1398
1414
  description: "HTTP endpoints called when this widget emits an event.",
1399
1415
  headingLevel: 3,
1400
1416
  "data-testid": "widget-inspector-webhooks",
1401
- children: /* @__PURE__ */ S(ne, {
1402
- dashboardId: F.dashboardId,
1403
- widgetId: F.id
1417
+ children: /* @__PURE__ */ x(u, {
1418
+ dashboardId: P.dashboardId,
1419
+ widgetId: P.id
1404
1420
  })
1405
1421
  }),
1406
- /* @__PURE__ */ S(n, {
1422
+ /* @__PURE__ */ x(n, {
1407
1423
  emphasis: "muted",
1408
- title: w("bigconsole.widget.properties.section.events", "Events"),
1424
+ title: C("bigconsole.widget.properties.section.events", "Events"),
1409
1425
  description: "Recent deliveries for this widget, newest first. Supporting detail — nothing here changes the widget.",
1410
1426
  headingLevel: 3,
1411
1427
  "data-testid": "widget-inspector-events",
1412
- children: /* @__PURE__ */ S(re, {
1413
- dashboardId: F.dashboardId,
1414
- widgetId: F.id,
1428
+ children: /* @__PURE__ */ x(ie, {
1429
+ dashboardId: P.dashboardId,
1430
+ widgetId: P.id,
1415
1431
  maxHeight: "min(50vh, 360px)"
1416
1432
  })
1417
1433
  })
1418
1434
  ] })
1419
1435
  }),
1420
- /* @__PURE__ */ S(Ke, {
1436
+ /* @__PURE__ */ x(nt, {
1421
1437
  value: "appearance",
1422
1438
  className: "mt-0",
1423
- children: D && /* @__PURE__ */ S(ce, {
1424
- widgetType: F.type,
1425
- config: D.config || {},
1426
- onChange: gn
1439
+ children: E && /* @__PURE__ */ x(de, {
1440
+ widgetType: P.type,
1441
+ config: E.config || {},
1442
+ onChange: Mn
1427
1443
  })
1428
1444
  })
1429
1445
  ]
1430
1446
  })]
1431
- }) : /* @__PURE__ */ S("div", {
1447
+ }) : /* @__PURE__ */ x("div", {
1432
1448
  className: "flex min-h-0 flex-1 items-center justify-center p-card-padding",
1433
- children: /* @__PURE__ */ S(n, {
1449
+ children: /* @__PURE__ */ x(n, {
1434
1450
  tone: "info",
1435
- title: w("bigconsole.widget.properties.emptyState", "Select a widget to edit"),
1451
+ title: C("bigconsole.widget.properties.emptyState", "Select a widget to edit"),
1436
1452
  headingLevel: 3,
1437
- icon: /* @__PURE__ */ S(Oe, { className: "h-icon-md w-icon-md" }),
1453
+ icon: /* @__PURE__ */ x(Re, { className: "h-icon-md w-icon-md" }),
1438
1454
  className: "w-full max-w-sm",
1439
1455
  "data-testid": "widget-inspector-empty",
1440
- children: /* @__PURE__ */ S("p", {
1456
+ children: /* @__PURE__ */ x("p", {
1441
1457
  className: "text-sm text-text-secondary",
1442
1458
  children: "Pick a widget on the canvas and its identity, data binding, actions and style options appear here."
1443
1459
  })
1444
1460
  })
1445
1461
  }),
1446
- F && /* @__PURE__ */ C("div", {
1462
+ P && /* @__PURE__ */ S("div", {
1447
1463
  style: {
1448
1464
  padding: "var(--space-cardPadding)",
1449
1465
  borderTop: "1px solid var(--color-border-subtle)",
@@ -1451,93 +1467,98 @@ var w = f(function({ isOpen: f, onClose: De }) {
1451
1467
  flexShrink: 0
1452
1468
  },
1453
1469
  children: [
1454
- k && /* @__PURE__ */ S(n, {
1470
+ O && /* @__PURE__ */ x(n, {
1455
1471
  tone: "warning",
1456
1472
  padding: "compact",
1457
- title: w("bigconsole.widget.properties.footer.unsavedChanges", "You have unsaved changes"),
1473
+ title: C("bigconsole.widget.properties.footer.unsavedChanges", "You have unsaved changes"),
1458
1474
  headingLevel: 3,
1459
1475
  className: "mb-control-gap",
1460
1476
  "data-testid": "widget-inspector-save-unsaved"
1461
1477
  }),
1462
- T === "saved" && !k && /* @__PURE__ */ S(n, {
1478
+ w === "saved" && !O && /* @__PURE__ */ x(n, {
1463
1479
  tone: "success",
1464
1480
  padding: "compact",
1465
- title: w("bigconsole.widget.properties.footer.allSaved", "All changes saved"),
1481
+ title: C("bigconsole.widget.properties.footer.allSaved", "All changes saved"),
1466
1482
  headingLevel: 3,
1467
- icon: /* @__PURE__ */ S(we, { className: "h-icon-sm w-icon-sm" }),
1483
+ icon: /* @__PURE__ */ x(Pe, { className: "h-icon-sm w-icon-sm" }),
1468
1484
  className: "mb-control-gap",
1469
1485
  "data-testid": "widget-inspector-save-saved"
1470
1486
  }),
1471
- T === "error" && /* @__PURE__ */ S(n, {
1487
+ w === "error" && /* @__PURE__ */ x(n, {
1472
1488
  tone: "danger",
1473
1489
  padding: "compact",
1474
- title: w("bigconsole.widget.properties.footer.saveFailed", "Failed to save changes"),
1490
+ title: C("bigconsole.widget.properties.footer.saveFailed", "Failed to save changes"),
1475
1491
  headingLevel: 3,
1476
- icon: /* @__PURE__ */ S(Me, { className: "h-icon-sm w-icon-sm" }),
1492
+ icon: /* @__PURE__ */ x(He, { className: "h-icon-sm w-icon-sm" }),
1477
1493
  className: "mb-control-gap",
1478
1494
  "data-testid": "widget-inspector-save-error"
1479
1495
  }),
1480
- /* @__PURE__ */ C("div", {
1496
+ qt && _t !== "data" && /* @__PURE__ */ x("p", {
1497
+ role: "status",
1498
+ className: "mb-control-gap text-xs text-text-secondary",
1499
+ children: C("bigconsole.widget.query.fixBeforeSave", "Fix the query on the Data tab before saving.")
1500
+ }),
1501
+ /* @__PURE__ */ S("div", {
1481
1502
  className: "flex flex-wrap gap-control-gap",
1482
- children: [/* @__PURE__ */ S(_, {
1483
- onClick: mn,
1484
- disabled: T === "saving" || !k,
1503
+ children: [/* @__PURE__ */ x(g, {
1504
+ onClick: An,
1505
+ disabled: w === "saving" || !O || qt !== null,
1485
1506
  style: {
1486
1507
  flex: 1,
1487
1508
  height: "var(--size-controlHeight-md)",
1488
- backgroundColor: k ? "var(--color-action-primary-bg)" : void 0,
1489
- opacity: k ? 1 : .5
1509
+ backgroundColor: O ? "var(--color-action-primary-bg)" : void 0,
1510
+ opacity: O ? 1 : .5
1490
1511
  },
1491
- children: T === "saving" ? /* @__PURE__ */ C("span", {
1512
+ children: w === "saving" ? /* @__PURE__ */ S("span", {
1492
1513
  style: {
1493
1514
  display: "flex",
1494
1515
  alignItems: "center",
1495
1516
  gap: "var(--space-iconGap)"
1496
1517
  },
1497
- children: [/* @__PURE__ */ S(We, { style: {
1518
+ children: [/* @__PURE__ */ x(et, { style: {
1498
1519
  width: "var(--size-icon-sm)",
1499
1520
  height: "var(--size-icon-sm)"
1500
- } }), w("bigconsole.widget.properties.footer.saving", "Saving...")]
1501
- }) : /* @__PURE__ */ C("span", {
1521
+ } }), C("bigconsole.widget.properties.footer.saving", "Saving...")]
1522
+ }) : /* @__PURE__ */ S("span", {
1502
1523
  style: {
1503
1524
  display: "flex",
1504
1525
  alignItems: "center",
1505
1526
  gap: "var(--space-iconGap)"
1506
1527
  },
1507
- children: [/* @__PURE__ */ S(we, { style: {
1528
+ children: [/* @__PURE__ */ x(Pe, { style: {
1508
1529
  width: "var(--size-icon-sm)",
1509
1530
  height: "var(--size-icon-sm)"
1510
- } }), w("bigconsole.widget.properties.footer.saveChanges", "Save Changes")]
1531
+ } }), C("bigconsole.widget.properties.footer.saveChanges", "Save Changes")]
1511
1532
  })
1512
- }), /* @__PURE__ */ C(_, {
1533
+ }), /* @__PURE__ */ S(g, {
1513
1534
  variant: "outline",
1514
- onClick: hn,
1515
- disabled: T === "saving" || !k,
1535
+ onClick: jn,
1536
+ disabled: w === "saving" || !O,
1516
1537
  style: {
1517
1538
  height: "var(--size-controlHeight-md)",
1518
- opacity: k ? 1 : .5
1539
+ opacity: O ? 1 : .5
1519
1540
  },
1520
- children: [/* @__PURE__ */ S(Me, { style: {
1541
+ children: [/* @__PURE__ */ x(He, { style: {
1521
1542
  width: "var(--size-icon-sm)",
1522
1543
  height: "var(--size-icon-sm)"
1523
- } }), w("bigconsole.widget.properties.footer.discard", "Discard")]
1544
+ } }), C("bigconsole.widget.properties.footer.discard", "Discard")]
1524
1545
  })]
1525
1546
  })
1526
1547
  ]
1527
1548
  }),
1528
- /* @__PURE__ */ S(ee, {
1529
- isOpen: Yt,
1530
- action: Zt,
1531
- initialWebhook: rn,
1532
- isLoading: Qt,
1533
- saveError: tn,
1549
+ /* @__PURE__ */ x(c, {
1550
+ isOpen: dn,
1551
+ action: pn,
1552
+ initialWebhook: bn,
1553
+ isLoading: mn,
1554
+ saveError: vn,
1534
1555
  onClose: () => {
1535
- Xt(!1), Y(void 0), X(void 0), Z(null);
1556
+ fn(!1), X(void 0), _n(void 0), Z(null);
1536
1557
  },
1537
- onSave: cn
1558
+ onSave: wn
1538
1559
  })
1539
1560
  ]
1540
1561
  })
1541
1562
  });
1542
1563
  });
1543
- export { w as PropertiesPanel, w as default };
1564
+ export { C as PropertiesPanel, C as default };