@object-ui/plugin-report 6.1.0 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,57 +2,57 @@ import { ComponentRegistry as e } from "@object-ui/core";
2
2
  import * as t from "react";
3
3
  import n, { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
4
4
  import { isJoinedSpecReport as c, isSpecReport as l } from "@object-ui/types";
5
- import { Badge as u, Button as d, Card as f, CardContent as p, CardDescription as m, CardHeader as h, CardTitle as g, Checkbox as _, ConfigPanelRenderer as v, Dialog as y, DialogContent as b, DialogDescription as x, DialogFooter as S, DialogHeader as C, DialogTitle as w, DialogTrigger as T, Input as E, Label as D, Skeleton as O, Tabs as k, TabsContent as A, TabsList as j, TabsTrigger as M, cn as N, useConfigDraft as ee } from "@object-ui/components";
6
- import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
7
- import { useTranslation as L } from "react-i18next";
8
- import { ObjectGrid as R } from "@object-ui/plugin-grid";
9
- import { useSafeFieldLabel as z } from "@object-ui/i18n";
10
- import { SchemaRenderer as B } from "@object-ui/react";
11
- import { AlertTriangle as V, ArrowDown as H, ArrowUp as U, Calendar as te, ChevronDown as ne, ChevronRight as re, Clock as ie, Download as ae, Filter as oe, Layers as se, Mail as ce, Plus as W, Printer as le, RefreshCw as ue, Save as de, Search as fe, Settings as pe, Trash2 as G } from "lucide-react";
12
- import { getCellRenderer as me, resolveCellRendererType as he } from "@object-ui/fields";
5
+ import { SchemaRenderer as u, SchemaRendererContext as d } from "@object-ui/react";
6
+ import { Badge as f, Button as p, Card as m, CardContent as h, CardDescription as g, CardHeader as _, CardTitle as v, Checkbox as y, ConfigPanelRenderer as b, Dialog as x, DialogContent as S, DialogDescription as C, DialogFooter as w, DialogHeader as T, DialogTitle as E, DialogTrigger as D, Input as O, Label as k, Skeleton as A, Tabs as j, TabsContent as M, TabsList as ee, TabsTrigger as N, cn as P, useConfigDraft as F } from "@object-ui/components";
7
+ import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
8
+ import { useTranslation as z } from "react-i18next";
9
+ import { ObjectGrid as B } from "@object-ui/plugin-grid";
10
+ import { useSafeFieldLabel as V } from "@object-ui/i18n";
11
+ import { AlertTriangle as H, ArrowDown as U, ArrowUp as te, Calendar as ne, ChevronDown as re, ChevronRight as ie, Clock as ae, Download as oe, Filter as se, Layers as ce, Mail as le, Plus as W, Printer as ue, RefreshCw as de, Save as fe, Search as pe, Settings as me, Trash2 as G } from "lucide-react";
12
+ import { getCellRenderer as he, resolveCellRendererType as ge } from "@object-ui/fields";
13
13
  //#region src/LegacyReportRenderer.tsx
14
- var ge = ({ schema: t }) => {
14
+ var _e = ({ schema: t }) => {
15
15
  let { title: n, description: r, data: i, columns: a } = t;
16
16
  t.chart?.type;
17
17
  let o = !!t.chart;
18
- return /* @__PURE__ */ I(f, {
18
+ return /* @__PURE__ */ R(m, {
19
19
  className: `h-full flex flex-col ${t.className || ""}`,
20
- children: [/* @__PURE__ */ I(h, { children: [n && /* @__PURE__ */ F(g, { children: n }), r && /* @__PURE__ */ F(m, { children: r })] }), /* @__PURE__ */ I(p, {
20
+ children: [/* @__PURE__ */ R(_, { children: [n && /* @__PURE__ */ L(v, { children: n }), r && /* @__PURE__ */ L(g, { children: r })] }), /* @__PURE__ */ R(h, {
21
21
  className: "flex-1 overflow-auto space-y-4",
22
22
  children: [o && (() => {
23
23
  let n = t.chart?.type, r = n ? e.get(n) : null;
24
- return r ||= e.get("chart"), r ? /* @__PURE__ */ F("div", {
24
+ return r ||= e.get("chart"), r ? /* @__PURE__ */ L("div", {
25
25
  className: "min-h-[300px] border rounded-lg p-4 bg-background/50",
26
- children: /* @__PURE__ */ F(r, { schema: {
26
+ children: /* @__PURE__ */ L(r, { schema: {
27
27
  ...t.chart,
28
28
  data: t.chart.data || i
29
29
  } })
30
- }) : /* @__PURE__ */ I("div", {
30
+ }) : /* @__PURE__ */ R("div", {
31
31
  className: "min-h-[100px] border rounded-md p-4 bg-muted/20 text-muted-foreground flex items-center justify-center",
32
32
  children: ["Unknown component type: ", n || "chart"]
33
33
  });
34
- })(), i && i.length > 0 && /* @__PURE__ */ F("div", {
34
+ })(), i && i.length > 0 && /* @__PURE__ */ L("div", {
35
35
  className: "border rounded-lg",
36
36
  children: (() => {
37
37
  let t = e.get("grid") || e.get("table");
38
- return t ? /* @__PURE__ */ F(t, { schema: {
38
+ return t ? /* @__PURE__ */ L(t, { schema: {
39
39
  type: "grid",
40
40
  rowData: i,
41
41
  columnDefs: a,
42
42
  domLayout: "autoHeight"
43
- } }) : /* @__PURE__ */ F("div", {
43
+ } }) : /* @__PURE__ */ L("div", {
44
44
  className: "overflow-x-auto",
45
- children: /* @__PURE__ */ I("table", {
45
+ children: /* @__PURE__ */ R("table", {
46
46
  className: "w-full text-sm text-left",
47
- children: [/* @__PURE__ */ F("thead", {
47
+ children: [/* @__PURE__ */ L("thead", {
48
48
  className: "text-xs uppercase bg-muted",
49
- children: /* @__PURE__ */ F("tr", { children: a?.map((e) => /* @__PURE__ */ F("th", {
49
+ children: /* @__PURE__ */ L("tr", { children: a?.map((e) => /* @__PURE__ */ L("th", {
50
50
  className: "px-6 py-3",
51
51
  children: e.headerName || e.label || e.field
52
52
  }, e.field)) })
53
- }), /* @__PURE__ */ F("tbody", { children: i.map((e, t) => /* @__PURE__ */ F("tr", {
53
+ }), /* @__PURE__ */ L("tbody", { children: i.map((e, t) => /* @__PURE__ */ L("tr", {
54
54
  className: "bg-background border-b",
55
- children: a?.map((t) => /* @__PURE__ */ F("td", {
55
+ children: a?.map((t) => /* @__PURE__ */ L("td", {
56
56
  className: "px-6 py-4",
57
57
  children: e[t.field]
58
58
  }, t.field))
@@ -69,7 +69,7 @@ var ge = ({ schema: t }) => {
69
69
  function K(e) {
70
70
  return e.aggregate ? `${e.field}__${e.aggregate}` : e.field;
71
71
  }
72
- function _e(e, t) {
72
+ function ve(e, t) {
73
73
  if (e == null) return null;
74
74
  let n = e instanceof Date ? e : new Date(String(e));
75
75
  if (Number.isNaN(n.getTime())) return null;
@@ -90,7 +90,7 @@ function _e(e, t) {
90
90
  }
91
91
  function q(e, t) {
92
92
  let n = e[t.field];
93
- return t.dateGranularity ? _e(n, t.dateGranularity) ?? "(empty)" : n == null || n === "" ? "(empty)" : String(n);
93
+ return t.dateGranularity ? ve(n, t.dateGranularity) ?? "(empty)" : n == null || n === "" ? "(empty)" : String(n);
94
94
  }
95
95
  function J(e, t) {
96
96
  let n = {};
@@ -152,7 +152,7 @@ function J(e, t) {
152
152
  }
153
153
  return n;
154
154
  }
155
- function ve(e, t, n, r = {}, i = []) {
155
+ function ye(e, t, n, r = {}, i = []) {
156
156
  if (t.length === 0) return [];
157
157
  let [a, ...o] = t, s = /* @__PURE__ */ new Map();
158
158
  for (let t of e) {
@@ -164,7 +164,7 @@ function ve(e, t, n, r = {}, i = []) {
164
164
  let s = {
165
165
  ...r,
166
166
  [a.field]: e
167
- }, l = [...i, e], u = J(t, n), d = o.length > 0 ? ve(t, o, n, s, l) : void 0;
167
+ }, l = [...i, e], u = J(t, n), d = o.length > 0 ? ye(t, o, n, s, l) : void 0;
168
168
  c.push({
169
169
  groupKey: s,
170
170
  groupPath: l,
@@ -179,19 +179,19 @@ function ve(e, t, n, r = {}, i = []) {
179
179
  return n.localeCompare(r) * l;
180
180
  }), typeof a.limit == "number" && a.limit > 0 ? c.slice(0, a.limit) : c;
181
181
  }
182
- function ye(e, t, n, r) {
183
- let i = be(e, n), a = be(e, r), o = {}, s = {}, c = {};
182
+ function be(e, t, n, r) {
183
+ let i = xe(e, n), a = xe(e, r), o = {}, s = {}, c = {};
184
184
  for (let c of i) {
185
185
  o[c.id] = {};
186
- let i = xe(e, c.key, n);
186
+ let i = Se(e, c.key, n);
187
187
  s[c.id] = J(i, t);
188
188
  for (let e of a) {
189
- let n = xe(i, e.key, r);
189
+ let n = Se(i, e.key, r);
190
190
  n.length !== 0 && (o[c.id][e.id] = J(n, t));
191
191
  }
192
192
  }
193
193
  for (let n of a) {
194
- let i = xe(e, n.key, r);
194
+ let i = Se(e, n.key, r);
195
195
  c[n.id] = J(i, t);
196
196
  }
197
197
  return {
@@ -206,7 +206,7 @@ function ye(e, t, n, r) {
206
206
  acrossGroupings: r
207
207
  };
208
208
  }
209
- function be(e, t) {
209
+ function xe(e, t) {
210
210
  if (t.length === 0) return [{
211
211
  key: {},
212
212
  path: [],
@@ -242,7 +242,7 @@ function be(e, t) {
242
242
  }
243
243
  return r;
244
244
  }
245
- function xe(e, t, n) {
245
+ function Se(e, t, n) {
246
246
  let r = Object.entries(t);
247
247
  if (r.length === 0) return e;
248
248
  let i = /* @__PURE__ */ new Map();
@@ -268,14 +268,14 @@ function Y(e, t) {
268
268
  }
269
269
  return n;
270
270
  }
271
- function Se(e, t, n, r) {
272
- let i = Ce(e, n), a = Ce(e, r), o = {}, s = {}, c = {};
271
+ function Ce(e, t, n, r) {
272
+ let i = we(e, n), a = we(e, r), o = {}, s = {}, c = {};
273
273
  for (let n of i) {
274
274
  o[n.id] = {};
275
- let r = e.filter((e) => we(e, n.key));
275
+ let r = e.filter((e) => Te(e, n.key));
276
276
  s[n.id] = Y(r, t);
277
277
  for (let e of a) {
278
- let i = r.filter((t) => we(t, e.key));
278
+ let i = r.filter((t) => Te(t, e.key));
279
279
  if (i.length === 0) continue;
280
280
  let a = {};
281
281
  for (let e of t) {
@@ -287,7 +287,7 @@ function Se(e, t, n, r) {
287
287
  }
288
288
  }
289
289
  for (let n of a) {
290
- let r = e.filter((e) => we(e, n.key));
290
+ let r = e.filter((e) => Te(e, n.key));
291
291
  c[n.id] = Y(r, t);
292
292
  }
293
293
  return {
@@ -302,7 +302,7 @@ function Se(e, t, n, r) {
302
302
  acrossGroupings: r
303
303
  };
304
304
  }
305
- function Ce(e, t) {
305
+ function we(e, t) {
306
306
  if (t.length === 0) return [{
307
307
  key: {},
308
308
  path: [],
@@ -331,7 +331,7 @@ function Ce(e, t) {
331
331
  return 0;
332
332
  }), r;
333
333
  }
334
- function we(e, t) {
334
+ function Te(e, t) {
335
335
  for (let [n, r] of Object.entries(t)) if ((e[n] == null ? "(null)" : String(e[n])) !== String(r)) return !1;
336
336
  return !0;
337
337
  }
@@ -341,7 +341,7 @@ function X(e, t) {
341
341
  if (n) return e;
342
342
  if (r) return t;
343
343
  }
344
- function Te(e) {
344
+ function Ee(e) {
345
345
  let t = /* @__PURE__ */ new Set();
346
346
  for (let n of e.groupingsDown ?? []) t.add(n.field);
347
347
  for (let n of e.groupingsAcross ?? []) t.add(n.field);
@@ -349,7 +349,7 @@ function Te(e) {
349
349
  for (let n of e.sort ?? []) t.add(n.field);
350
350
  return Array.from(t);
351
351
  }
352
- function Ee(e, t, n) {
352
+ function De(e, t, n) {
353
353
  let r = [...e.groupingsDown ?? [], ...e.groupingsAcross ?? []], i = (e.columns ?? []).filter((e) => !!e.aggregate);
354
354
  if (r.length === 0 && i.length === 0) return null;
355
355
  let a = r.map((e) => e.dateGranularity ? {
@@ -365,7 +365,7 @@ function Ee(e, t, n) {
365
365
  };
366
366
  return a.length > 0 && (c.groupBy = a), o.length > 0 && (c.aggregations = o), s && (c.where = s), c;
367
367
  }
368
- function De(e, t, n) {
368
+ function Oe(e, t, n) {
369
369
  for (let [r, i] of Object.entries(t)) {
370
370
  let t = n.find((e) => e.field === r);
371
371
  if ((t ? q(e, t) : String(e[r] ?? "(empty)")) !== String(i)) return !1;
@@ -373,7 +373,7 @@ function De(e, t, n) {
373
373
  return !0;
374
374
  }
375
375
  var Z = [];
376
- function Oe(e, t = {}) {
376
+ function ke(e, t = {}) {
377
377
  let { dataSource: n, runtimeFilter: c, maxRows: l = 5e3, enabled: u = !0, rows: d, preferServerAggregation: f = !0 } = t, [p, m] = s(d ?? Z), [h, g] = s(!1), [_, v] = s(() => d ? !1 : !!(e && u && n)), [y, b] = s(null), x = o(0), S = r(async () => {
378
378
  if (!e || !u) return;
379
379
  if (d) {
@@ -387,9 +387,9 @@ function Oe(e, t = {}) {
387
387
  let t = ++x.current;
388
388
  v(!0), b(null);
389
389
  try {
390
- let r = f ? Ee(e, c, l) : null;
390
+ let r = f ? De(e, c, l) : null;
391
391
  if (r && typeof n.aggregate == "function") try {
392
- let i = ke(await n.aggregate(e.objectName, r));
392
+ let i = Ae(await n.aggregate(e.objectName, r));
393
393
  if (t !== x.current) return;
394
394
  m(i), g(!0);
395
395
  return;
@@ -400,9 +400,9 @@ function Oe(e, t = {}) {
400
400
  m(Z), g(!1);
401
401
  return;
402
402
  }
403
- let i = X(e.filter, c), a = Te(e), o = { $top: l };
403
+ let i = X(e.filter, c), a = Ee(e), o = { $top: l };
404
404
  i && (o.$filter = i), a.length > 0 && (o.$select = a), e.sort && e.sort.length > 0 && (o.$orderBy = e.sort.map((e) => `${e.field} ${e.direction ?? "asc"}`).join(","));
405
- let s = ke(await n.find(e.objectName, o));
405
+ let s = Ae(await n.find(e.objectName, o));
406
406
  if (t !== x.current) return;
407
407
  m(s), g(!1);
408
408
  } catch (e) {
@@ -445,7 +445,7 @@ function Oe(e, t = {}) {
445
445
  values: i,
446
446
  count: 1
447
447
  };
448
- }), o = Y(p, r), s = i ? Se(p, r, t, n) : null;
448
+ }), o = Y(p, r), s = i ? Ce(p, r, t, n) : null;
449
449
  return {
450
450
  rows: i && s ? s.rowHeaders.map((e) => ({
451
451
  groupKey: e.key,
@@ -459,14 +459,14 @@ function Oe(e, t = {}) {
459
459
  }
460
460
  let a = i ? t : [...t, ...n];
461
461
  return {
462
- rows: a.length > 0 ? ve(p, a, r) : p.map((e) => ({
462
+ rows: a.length > 0 ? ye(p, a, r) : p.map((e) => ({
463
463
  groupKey: {},
464
464
  groupPath: [],
465
465
  values: r.length > 0 ? J([e], r) : { ...e },
466
466
  count: 1
467
467
  })),
468
468
  totals: J(p, r),
469
- pivot: i ? ye(p, r, t, n) : null
469
+ pivot: i ? be(p, r, t, n) : null
470
470
  };
471
471
  }, [
472
472
  e,
@@ -485,11 +485,11 @@ function Oe(e, t = {}) {
485
485
  drillDown: r((t) => {
486
486
  if (!e) return [];
487
487
  let n = [...e.groupingsDown ?? [], ...e.groupingsAcross ?? []];
488
- return p.filter((e) => De(e, t, n));
488
+ return p.filter((e) => Oe(e, t, n));
489
489
  }, [e, p])
490
490
  };
491
491
  }
492
- function ke(e) {
492
+ function Ae(e) {
493
493
  if (Array.isArray(e)) return e;
494
494
  if (e && typeof e == "object") {
495
495
  let t = e;
@@ -502,16 +502,16 @@ function ke(e) {
502
502
  }
503
503
  //#endregion
504
504
  //#region src/buildChartData.ts
505
- function Ae(e) {
505
+ function je(e) {
506
506
  return e.aggregate ? `${e.field}__${e.aggregate}` : e.field;
507
507
  }
508
- function je(e) {
508
+ function Me(e) {
509
509
  let t = [], n = (e) => {
510
510
  e.children && e.children.length > 0 ? e.children.forEach(n) : t.push(e);
511
511
  };
512
512
  return e.forEach(n), t;
513
513
  }
514
- function Me({ report: e, rows: t, labels: n }) {
514
+ function Ne({ report: e, rows: t, labels: n }) {
515
515
  let r = e.chart;
516
516
  if (!r || !r.type) return { schema: null };
517
517
  let i = e.groupingsDown ?? [], a = r.xAxis || (i.length > 0 ? i[0]?.field : void 0);
@@ -522,9 +522,9 @@ function Me({ report: e, rows: t, labels: n }) {
522
522
  let o = e.columns ?? [], s = r.yAxis, c = "count", l = "Count", u = !0;
523
523
  if (s) {
524
524
  let e = o.find((e) => e.field === s && e.aggregate);
525
- e ? (c = Ae(e), l = n?.resolveColumnLabel?.(e) ?? (typeof e.label == "string" ? e.label : `${e.aggregate}(${e.field})`), u = !1) : (c = "count", l = n?.resolveCountLabel?.(s) ?? `Count of ${s}`);
525
+ e ? (c = je(e), l = n?.resolveColumnLabel?.(e) ?? (typeof e.label == "string" ? e.label : `${e.aggregate}(${e.field})`), u = !1) : (c = "count", l = n?.resolveCountLabel?.(s) ?? `Count of ${s}`);
526
526
  }
527
- let d = je(t), f = /* @__PURE__ */ new Map();
527
+ let d = Me(t), f = /* @__PURE__ */ new Map();
528
528
  for (let e of d) {
529
529
  let t = e.groupKey[a];
530
530
  if (t === void 0) continue;
@@ -558,7 +558,7 @@ function Me({ report: e, rows: t, labels: n }) {
558
558
  }
559
559
  //#endregion
560
560
  //#region src/drill.ts
561
- function Ne(e, t, n = {}) {
561
+ function Pe(e, t, n = {}) {
562
562
  let r = X(X(e.filter, n.runtimeFilter), Object.keys(t).length > 0 ? t : void 0);
563
563
  return {
564
564
  type: "drill",
@@ -570,12 +570,12 @@ function Ne(e, t, n = {}) {
570
570
  openIn: n.openIn ?? "current"
571
571
  };
572
572
  }
573
- function Pe(e) {
573
+ function Fe(e) {
574
574
  return !!e && e.type === "drill";
575
575
  }
576
- function Fe(e) {
576
+ function Ie(e) {
577
577
  return async (t) => {
578
- if (!Pe(t)) return {
578
+ if (!Fe(t)) return {
579
579
  success: !1,
580
580
  error: "drill handler invoked with non-drill action"
581
581
  };
@@ -595,80 +595,80 @@ function Fe(e) {
595
595
  }
596
596
  };
597
597
  }
598
- function Ie(e, t) {
599
- return e.registerHandler("drill", Fe(t)), () => e.unregisterHandler("drill");
598
+ function Le(e, t) {
599
+ return e.registerHandler("drill", Ie(t)), () => e.unregisterHandler("drill");
600
600
  }
601
601
  //#endregion
602
602
  //#region src/SpecReportGrid.tsx
603
- function Le(e) {
603
+ function Re(e) {
604
604
  return e ? e === "unique" ? "count_distinct" : e : null;
605
605
  }
606
- function Re(e) {
606
+ function ze(e) {
607
607
  if (!(!e || e.length === 0)) return { fields: e.map((e) => ({
608
608
  field: e.field,
609
609
  order: e.sort ?? "asc",
610
610
  collapsed: !1
611
611
  })) };
612
612
  }
613
- function ze(e) {
613
+ function Be(e) {
614
614
  return (e.columns ?? []).map((e) => {
615
615
  let t = { field: e.field };
616
616
  return e.label && (t.label = typeof e.label == "string" ? e.label : String(e.label)), e.format && (t.format = e.format), e.width && (t.width = e.width), t;
617
617
  });
618
618
  }
619
- var Be = {
619
+ var Ve = {
620
620
  padding: "12px 16px",
621
621
  border: "1px dashed rgb(203 213 225)",
622
622
  borderRadius: 8,
623
623
  color: "rgb(100 116 139)",
624
624
  fontSize: 14
625
- }, Ve = ({ report: e, dataSource: n, rows: r, runtimeFilter: i, onDrillDown: a, actionRunner: o, drillView: s, drillOpenIn: c, className: l }) => {
626
- let u = e.type ?? "tabular", { t: d } = L(), { fieldLabel: f, translateOptions: p } = z(), [m, h] = t.useState(null);
625
+ }, He = ({ report: e, dataSource: n, rows: r, runtimeFilter: i, onDrillDown: a, actionRunner: o, drillView: s, drillOpenIn: c, className: l }) => {
626
+ let d = e.type ?? "tabular", { t: f } = z(), { fieldLabel: p, translateOptions: m } = V(), [h, g] = t.useState(null);
627
627
  t.useEffect(() => {
628
628
  let t = n;
629
629
  if (!t || typeof t.getObjectSchema != "function" || !e.objectName) return;
630
630
  let r = !1;
631
631
  return t.getObjectSchema(e.objectName).then((e) => {
632
- r || h(e ?? null);
632
+ r || g(e ?? null);
633
633
  }).catch(() => {}), () => {
634
634
  r = !0;
635
635
  };
636
636
  }, [n, e.objectName]);
637
- let g = t.useCallback((t) => {
637
+ let _ = t.useCallback((t) => {
638
638
  if (t.label) return String(t.label);
639
- let n = m?.fields?.[t.field]?.label ?? t.field, r = f(e.objectName, t.field, n);
640
- return t.aggregate ? `${r} · ${d(`report.aggregate.${t.aggregate}`, t.aggregate)}` : r;
639
+ let n = h?.fields?.[t.field]?.label ?? t.field, r = p(e.objectName, t.field, n);
640
+ return t.aggregate ? `${r} · ${f(`report.aggregate.${t.aggregate}`, t.aggregate)}` : r;
641
641
  }, [
642
- m,
642
+ h,
643
643
  e.objectName,
644
- f,
645
- d
646
- ]), _ = t.useCallback((t, n) => {
644
+ p,
645
+ f
646
+ ]), v = t.useCallback((t, n) => {
647
647
  if (n == null) return;
648
- let r = m?.fields?.[t];
648
+ let r = h?.fields?.[t];
649
649
  if (!r || !(r.type === "select" || r.type === "status") || !Array.isArray(r.options) || r.options.length === 0) return;
650
- let i = p(e.objectName, t, r.options), a = String(n);
650
+ let i = m(e.objectName, t, r.options), a = String(n);
651
651
  for (let e of i) if (e && e.value !== void 0 && e.value !== null && String(e.value) === a) return e.label == null ? a : String(e.label);
652
652
  }, [
653
- m,
653
+ h,
654
654
  e.objectName,
655
- p
656
- ]), { rawRows: v, rows: y, totals: b, serverAggregated: x, loading: S, error: C, drillDown: w } = Oe(e, {
655
+ m
656
+ ]), { rawRows: y, rows: b, totals: x, serverAggregated: S, loading: C, error: w, drillDown: T } = ke(e, {
657
657
  dataSource: n,
658
658
  rows: r,
659
659
  runtimeFilter: i
660
660
  });
661
- if (u === "matrix" || u === "joined") return /* @__PURE__ */ I("div", {
661
+ if (d === "matrix" || d === "joined") return /* @__PURE__ */ R("div", {
662
662
  className: l,
663
- style: Be,
663
+ style: Ve,
664
664
  children: [
665
665
  "Report type ",
666
- /* @__PURE__ */ F("code", { children: u }),
666
+ /* @__PURE__ */ L("code", { children: d }),
667
667
  " is not yet supported by SpecReportGrid. It will be rendered by a dedicated component in M2 (matrix) / M3 (joined)."
668
668
  ]
669
669
  });
670
- let T = t.useMemo(() => {
671
- if (x) {
670
+ let E = t.useMemo(() => {
671
+ if (S) {
672
672
  let t = (e.groupingsDown ?? []).map((e) => ({
673
673
  field: e.field,
674
674
  label: e.field.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase())
@@ -683,8 +683,8 @@ var Be = {
683
683
  columns: [...t, ...n]
684
684
  };
685
685
  }
686
- let t = u === "summary" ? Re(e.groupingsDown) : void 0, n = (e.columns ?? []).map((e) => {
687
- let t = Le(e.aggregate);
686
+ let t = d === "summary" ? ze(e.groupingsDown) : void 0, n = (e.columns ?? []).map((e) => {
687
+ let t = Re(e.aggregate);
688
688
  return t ? {
689
689
  field: e.field,
690
690
  type: t
@@ -693,111 +693,111 @@ var Be = {
693
693
  return {
694
694
  type: "object-grid",
695
695
  objectName: e.objectName,
696
- columns: ze(e),
696
+ columns: Be(e),
697
697
  grouping: t,
698
698
  aggregations: n.length > 0 ? n : void 0
699
699
  };
700
700
  }, [
701
701
  e,
702
- u,
703
- x
704
- ]), E = v, D = t.useCallback((t) => {
702
+ d,
703
+ S
704
+ ]), D = y, O = t.useCallback((t) => {
705
705
  let n = e.groupingsDown ?? [], r = {};
706
706
  for (let e of n) r[e.field] = t[e.field];
707
707
  if (o) {
708
- let t = Ne(e, r, {
708
+ let t = Pe(e, r, {
709
709
  runtimeFilter: i,
710
710
  view: s,
711
711
  openIn: c
712
712
  });
713
713
  o.execute(t);
714
714
  }
715
- a && a(r, w(r));
715
+ a && a(r, T(r));
716
716
  }, [
717
717
  o,
718
- w,
718
+ T,
719
719
  c,
720
720
  s,
721
721
  a,
722
722
  e,
723
723
  i
724
- ]), O = !!a || !!o, k = (e.columns ?? []).filter((e) => e.aggregate), A = k.length > 0 && b && Object.keys(b).length > 0, j = t.useMemo(() => u !== "summary" || !e.chart || !e.chart.type ? null : Me({
724
+ ]), k = !!a || !!o, A = (e.columns ?? []).filter((e) => e.aggregate), j = A.length > 0 && x && Object.keys(x).length > 0, M = t.useMemo(() => d !== "summary" || !e.chart || !e.chart.type ? null : Ne({
725
725
  report: e,
726
- rows: y,
726
+ rows: b,
727
727
  labels: {
728
- resolveColumnLabel: g,
728
+ resolveColumnLabel: _,
729
729
  resolveCountLabel: (t) => {
730
- let n = m?.fields?.[t]?.label ?? t;
731
- return `${f(e.objectName, t, n)} · ${d("report.aggregate.count", "Count")}`;
730
+ let n = h?.fields?.[t]?.label ?? t;
731
+ return `${p(e.objectName, t, n)} · ${f("report.aggregate.count", "Count")}`;
732
732
  },
733
- resolveAxisValue: _
733
+ resolveAxisValue: v
734
734
  }
735
735
  }).schema, [
736
736
  e,
737
- y,
738
- u,
739
- g,
737
+ b,
738
+ d,
740
739
  _,
741
- m,
742
- f,
743
- d
740
+ v,
741
+ h,
742
+ p,
743
+ f
744
744
  ]);
745
- return /* @__PURE__ */ I("div", {
745
+ return /* @__PURE__ */ R("div", {
746
746
  className: l,
747
747
  "data-testid": "spec-report-grid",
748
- "aria-busy": S || void 0,
748
+ "aria-busy": C || void 0,
749
749
  children: [
750
- C ? /* @__PURE__ */ F("div", {
750
+ w ? /* @__PURE__ */ L("div", {
751
751
  role: "alert",
752
752
  style: {
753
- ...Be,
753
+ ...Ve,
754
754
  color: "rgb(190 18 60)"
755
755
  },
756
- children: C.message
756
+ children: w.message
757
757
  }) : null,
758
- A ? /* @__PURE__ */ I("div", {
758
+ j ? /* @__PURE__ */ R("div", {
759
759
  "data-testid": "spec-report-totals",
760
760
  className: "mb-3 flex flex-wrap items-baseline gap-x-6 gap-y-1 rounded-md border bg-muted/40 px-3 py-2 text-sm",
761
- children: [/* @__PURE__ */ F("span", {
761
+ children: [/* @__PURE__ */ L("span", {
762
762
  className: "text-xs font-medium uppercase tracking-wide text-muted-foreground",
763
- children: d("report.totals", "Totals")
764
- }), k.map((e) => {
765
- let t = K(e), n = b[t], r = g(e), i = typeof n == "number" ? n.toLocaleString(void 0, { maximumFractionDigits: 2 }) : String(n ?? "—");
766
- return /* @__PURE__ */ I("span", {
763
+ children: f("report.totals", "Totals")
764
+ }), A.map((e) => {
765
+ let t = K(e), n = x[t], r = _(e), i = typeof n == "number" ? n.toLocaleString(void 0, { maximumFractionDigits: 2 }) : String(n ?? "—");
766
+ return /* @__PURE__ */ R("span", {
767
767
  "data-testid": `spec-report-total-${t}`,
768
768
  className: "inline-flex items-baseline gap-1.5",
769
- children: [/* @__PURE__ */ I("span", {
769
+ children: [/* @__PURE__ */ R("span", {
770
770
  className: "text-muted-foreground",
771
771
  children: [r, ":"]
772
- }), /* @__PURE__ */ F("span", {
772
+ }), /* @__PURE__ */ L("span", {
773
773
  className: "font-mono font-medium tabular-nums",
774
774
  children: i
775
775
  })]
776
776
  }, t);
777
777
  })]
778
778
  }) : null,
779
- j ? /* @__PURE__ */ F("div", {
779
+ M ? /* @__PURE__ */ L("div", {
780
780
  className: "mb-4",
781
781
  "data-testid": "spec-report-chart",
782
- children: /* @__PURE__ */ F(B, { schema: j })
782
+ children: /* @__PURE__ */ L(u, { schema: M })
783
783
  }) : null,
784
- /* @__PURE__ */ F(R, {
785
- schema: T,
786
- data: E,
784
+ /* @__PURE__ */ L(B, {
785
+ schema: E,
786
+ data: D,
787
787
  dataSource: n,
788
- onRowClick: O ? D : void 0
788
+ onRowClick: k ? O : void 0
789
789
  })
790
790
  ]
791
791
  });
792
792
  };
793
- Ve.displayName = "SpecReportGrid";
793
+ He.displayName = "SpecReportGrid";
794
794
  //#endregion
795
795
  //#region src/MatrixRenderer.tsx
796
- var He = "—";
797
- function Ue(e) {
798
- return e == null ? He : typeof e == "number" ? e.toLocaleString() : String(e);
796
+ var Ue = "—";
797
+ function We(e) {
798
+ return e == null ? Ue : typeof e == "number" ? e.toLocaleString() : String(e);
799
799
  }
800
- function We(e, t, n) {
800
+ function Ge(e, t, n) {
801
801
  if (e == null || e === "" || e === "(null)") return n;
802
802
  let r = t?.options;
803
803
  if (r) {
@@ -806,18 +806,18 @@ function We(e, t, n) {
806
806
  }
807
807
  return e;
808
808
  }
809
- function Ge({ header: e, groupings: t, metaByField: n, fallback: r, emptyLabel: i }) {
810
- return e.path.length === 0 ? /* @__PURE__ */ F(P, { children: r }) : /* @__PURE__ */ F(P, { children: e.path.map((e, r) => {
809
+ function Ke({ header: e, groupings: t, metaByField: n, fallback: r, emptyLabel: i }) {
810
+ return e.path.length === 0 ? /* @__PURE__ */ L(I, { children: r }) : /* @__PURE__ */ L(I, { children: e.path.map((e, r) => {
811
811
  let a = t[r]?.field;
812
- return We(e, a ? n.get(a) : void 0, i);
812
+ return Ge(e, a ? n.get(a) : void 0, i);
813
813
  }).join(" / ") });
814
814
  }
815
- var Ke = ({ report: e, dataSource: n, rows: r, runtimeFilter: i, onCellClick: a, actionRunner: o, drillView: s, drillOpenIn: c, className: l, emptyCellText: u = He }) => {
816
- let { pivot: d, loading: f, error: p } = Oe(e, {
815
+ var qe = ({ report: e, dataSource: n, rows: r, runtimeFilter: i, onCellClick: a, actionRunner: o, drillView: s, drillOpenIn: c, className: l, emptyCellText: u = Ue }) => {
816
+ let { pivot: d, loading: f, error: p } = ke(e, {
817
817
  dataSource: n,
818
818
  rows: r,
819
819
  runtimeFilter: i
820
- }), m = e.columns ?? [], h = m.length > 1, { fieldLabel: g, translateOptions: _ } = z(), { t: v } = L(), y = v("report.emptyLabel", "(Empty)"), b = v("report.allLabel", "(All)"), [x, S] = t.useState(null);
820
+ }), m = e.columns ?? [], h = m.length > 1, { fieldLabel: g, translateOptions: _ } = V(), { t: v } = z(), y = v("report.emptyLabel", "(Empty)"), b = v("report.allLabel", "(All)"), [x, S] = t.useState(null);
821
821
  t.useEffect(() => {
822
822
  let t = n;
823
823
  if (!t || typeof t.getObjectSchema != "function" || !e.objectName) return;
@@ -877,7 +877,7 @@ var Ke = ({ report: e, dataSource: n, rows: r, runtimeFilter: i, onCellClick: a,
877
877
  ...n.key
878
878
  };
879
879
  if (o) {
880
- let t = Ne(e, l, {
880
+ let t = Pe(e, l, {
881
881
  runtimeFilter: i,
882
882
  view: s,
883
883
  openIn: c
@@ -898,14 +898,14 @@ var Ke = ({ report: e, dataSource: n, rows: r, runtimeFilter: i, onCellClick: a,
898
898
  e,
899
899
  i
900
900
  ]);
901
- if (p) return /* @__PURE__ */ F("div", {
902
- className: N("rounded-md border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive", l),
901
+ if (p) return /* @__PURE__ */ L("div", {
902
+ className: P("rounded-md border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive", l),
903
903
  role: "alert",
904
904
  "data-testid": "matrix-error",
905
905
  children: v("report.failedToLoad", "Failed to load matrix: {{message}}", { message: p.message })
906
906
  });
907
- if (!d) return /* @__PURE__ */ F("div", {
908
- className: N("rounded-md border border-dashed border-border bg-muted/30 px-4 py-6 text-center text-sm text-muted-foreground", l),
907
+ if (!d) return /* @__PURE__ */ L("div", {
908
+ className: P("rounded-md border border-dashed border-border bg-muted/30 px-4 py-6 text-center text-sm text-muted-foreground", l),
909
909
  "aria-busy": f || void 0,
910
910
  "data-testid": "matrix-empty",
911
911
  children: f ? v("report.loading", "Loading…") : v("report.needsAcross", "Matrix report requires at least one `groupingsAcross` field.")
@@ -920,38 +920,38 @@ var Ke = ({ report: e, dataSource: n, rows: r, runtimeFilter: i, onCellClick: a,
920
920
  let t = e[j];
921
921
  return typeof t != "number" || t <= 0 ? 0 : Math.min(1, t / M);
922
922
  };
923
- return /* @__PURE__ */ F("div", {
924
- className: N("overflow-auto rounded-lg border border-border bg-card shadow-sm", l),
923
+ return /* @__PURE__ */ L("div", {
924
+ className: P("overflow-auto rounded-lg border border-border bg-card shadow-sm", l),
925
925
  "data-testid": "matrix-renderer",
926
926
  "aria-busy": f || void 0,
927
- children: /* @__PURE__ */ I("table", {
927
+ children: /* @__PURE__ */ R("table", {
928
928
  role: "table",
929
929
  className: "w-full border-separate border-spacing-0 text-sm",
930
930
  children: [
931
- /* @__PURE__ */ F("thead", { children: /* @__PURE__ */ I("tr", { children: [
932
- /* @__PURE__ */ I("th", {
931
+ /* @__PURE__ */ L("thead", { children: /* @__PURE__ */ R("tr", { children: [
932
+ /* @__PURE__ */ R("th", {
933
933
  scope: "col",
934
- className: N("sticky left-0 top-0 z-30 border-b border-r border-border bg-muted/60", "px-3 py-2 text-left text-xs font-semibold uppercase tracking-wide text-muted-foreground"),
934
+ className: P("sticky left-0 top-0 z-30 border-b border-r border-border bg-muted/60", "px-3 py-2 text-left text-xs font-semibold uppercase tracking-wide text-muted-foreground"),
935
935
  "aria-label": `${k} \u2192 ${A}`,
936
936
  children: [
937
- /* @__PURE__ */ F("span", {
937
+ /* @__PURE__ */ L("span", {
938
938
  className: "text-muted-foreground/70",
939
939
  children: k
940
940
  }),
941
- /* @__PURE__ */ F("span", {
941
+ /* @__PURE__ */ L("span", {
942
942
  className: "mx-1 text-muted-foreground/40",
943
943
  children: "\\"
944
944
  }),
945
- /* @__PURE__ */ F("span", {
945
+ /* @__PURE__ */ L("span", {
946
946
  className: "text-foreground/80",
947
947
  children: A
948
948
  })
949
949
  ]
950
950
  }),
951
- d.colHeaders.map((e) => /* @__PURE__ */ F("th", {
951
+ d.colHeaders.map((e) => /* @__PURE__ */ L("th", {
952
952
  scope: "col",
953
953
  className: "sticky top-0 z-20 whitespace-nowrap border-b border-border bg-muted/60 px-3 py-2 text-right text-xs font-semibold text-foreground",
954
- children: /* @__PURE__ */ F(Ge, {
954
+ children: /* @__PURE__ */ L(Ke, {
955
955
  header: e,
956
956
  groupings: w,
957
957
  metaByField: T,
@@ -959,19 +959,19 @@ var Ke = ({ report: e, dataSource: n, rows: r, runtimeFilter: i, onCellClick: a,
959
959
  emptyLabel: y
960
960
  })
961
961
  }, `col-${e.id}`)),
962
- /* @__PURE__ */ F("th", {
962
+ /* @__PURE__ */ L("th", {
963
963
  scope: "col",
964
964
  className: "sticky top-0 z-20 whitespace-nowrap border-b border-l border-border bg-muted px-3 py-2 text-right text-xs font-semibold uppercase tracking-wide text-foreground",
965
965
  children: v("report.rowTotal", "Row Total")
966
966
  })
967
967
  ] }) }),
968
- /* @__PURE__ */ F("tbody", { children: d.rowHeaders.map((e, t) => /* @__PURE__ */ I("tr", {
968
+ /* @__PURE__ */ L("tbody", { children: d.rowHeaders.map((e, t) => /* @__PURE__ */ R("tr", {
969
969
  className: "group",
970
970
  children: [
971
- /* @__PURE__ */ F("th", {
971
+ /* @__PURE__ */ L("th", {
972
972
  scope: "row",
973
- className: N("sticky left-0 z-10 whitespace-nowrap border-b border-r border-border bg-card px-3 py-2 text-left text-sm font-medium text-foreground", "group-hover:bg-muted/50", t === 0 && "border-t-0"),
974
- children: /* @__PURE__ */ F(Ge, {
973
+ className: P("sticky left-0 z-10 whitespace-nowrap border-b border-r border-border bg-card px-3 py-2 text-left text-sm font-medium text-foreground", "group-hover:bg-muted/50", t === 0 && "border-t-0"),
974
+ children: /* @__PURE__ */ L(Ke, {
975
975
  header: e,
976
976
  groupings: C,
977
977
  metaByField: T,
@@ -981,64 +981,64 @@ var Ke = ({ report: e, dataSource: n, rows: r, runtimeFilter: i, onCellClick: a,
981
981
  }),
982
982
  d.colHeaders.map((t) => {
983
983
  let n = d.cells[e.id]?.[t.id], r = !n, i = ee(n);
984
- return /* @__PURE__ */ F("td", {
985
- className: N("border-b border-border px-3 py-2 text-right tabular-nums transition-colors", r ? "text-muted-foreground/40" : "text-foreground", O && !r && "cursor-pointer hover:outline hover:outline-2 hover:-outline-offset-2 hover:outline-primary/50", "group-hover:bg-muted/30"),
984
+ return /* @__PURE__ */ L("td", {
985
+ className: P("border-b border-border px-3 py-2 text-right tabular-nums transition-colors", r ? "text-muted-foreground/40" : "text-foreground", O && !r && "cursor-pointer hover:outline hover:outline-2 hover:-outline-offset-2 hover:outline-primary/50", "group-hover:bg-muted/30"),
986
986
  style: i > 0 ? { backgroundColor: `rgba(59, 130, 246, ${.06 + i * .28})` } : void 0,
987
987
  onClick: O && !r ? () => D(e, t, n) : void 0,
988
988
  "data-row": e.id,
989
989
  "data-col": t.id,
990
- children: r ? u : qe(m, n, h, E)
990
+ children: r ? u : Je(m, n, h, E)
991
991
  }, `cell-${e.id}-${t.id}`);
992
992
  }),
993
- /* @__PURE__ */ F("td", {
994
- className: N("border-b border-l border-border bg-muted/40 px-3 py-2 text-right text-sm font-semibold tabular-nums text-foreground", "group-hover:bg-muted/60"),
995
- children: qe(m, d.rowTotals[e.id] ?? {}, h, E)
993
+ /* @__PURE__ */ L("td", {
994
+ className: P("border-b border-l border-border bg-muted/40 px-3 py-2 text-right text-sm font-semibold tabular-nums text-foreground", "group-hover:bg-muted/60"),
995
+ children: Je(m, d.rowTotals[e.id] ?? {}, h, E)
996
996
  })
997
997
  ]
998
998
  }, `row-${e.id}`)) }),
999
- /* @__PURE__ */ F("tfoot", { children: /* @__PURE__ */ I("tr", { children: [
1000
- /* @__PURE__ */ F("th", {
999
+ /* @__PURE__ */ L("tfoot", { children: /* @__PURE__ */ R("tr", { children: [
1000
+ /* @__PURE__ */ L("th", {
1001
1001
  scope: "row",
1002
1002
  className: "sticky left-0 z-10 whitespace-nowrap border-t-2 border-r border-border bg-muted px-3 py-2 text-left text-xs font-semibold uppercase tracking-wide text-foreground",
1003
1003
  children: v("report.columnTotal", "Column Total")
1004
1004
  }),
1005
- d.colHeaders.map((e) => /* @__PURE__ */ F("td", {
1005
+ d.colHeaders.map((e) => /* @__PURE__ */ L("td", {
1006
1006
  className: "border-t-2 border-border bg-muted/40 px-3 py-2 text-right text-sm font-semibold tabular-nums text-foreground",
1007
- children: qe(m, d.colTotals[e.id] ?? {}, h, E)
1007
+ children: Je(m, d.colTotals[e.id] ?? {}, h, E)
1008
1008
  }, `coltotal-${e.id}`)),
1009
- /* @__PURE__ */ F("td", {
1009
+ /* @__PURE__ */ L("td", {
1010
1010
  className: "border-l border-t-2 border-border bg-primary/10 px-3 py-2 text-right text-sm font-bold tabular-nums text-foreground",
1011
- children: qe(m, d.grandTotal, h, E)
1011
+ children: Je(m, d.grandTotal, h, E)
1012
1012
  })
1013
1013
  ] }) })
1014
1014
  ]
1015
1015
  })
1016
1016
  });
1017
1017
  };
1018
- function qe(e, t, n, r) {
1019
- return e.length ? n ? /* @__PURE__ */ F("div", {
1018
+ function Je(e, t, n, r) {
1019
+ return e.length ? n ? /* @__PURE__ */ L("div", {
1020
1020
  className: "flex flex-col gap-0.5",
1021
1021
  children: e.map((e) => {
1022
1022
  let n = K(e);
1023
- return /* @__PURE__ */ I("div", {
1023
+ return /* @__PURE__ */ R("div", {
1024
1024
  className: "flex items-baseline justify-between gap-2",
1025
- children: [/* @__PURE__ */ F("span", {
1025
+ children: [/* @__PURE__ */ L("span", {
1026
1026
  className: "text-xs text-muted-foreground",
1027
1027
  children: r?.get(n) ?? e.label ?? n
1028
- }), /* @__PURE__ */ F("span", {
1028
+ }), /* @__PURE__ */ L("span", {
1029
1029
  className: "tabular-nums",
1030
- children: Ue(t[n])
1030
+ children: We(t[n])
1031
1031
  })]
1032
1032
  }, n);
1033
1033
  })
1034
- }) : Ue(t[K(e[0])]) : He;
1034
+ }) : We(t[K(e[0])]) : Ue;
1035
1035
  }
1036
1036
  //#endregion
1037
1037
  //#region src/JoinedReportRenderer.tsx
1038
- function Je(e, t) {
1038
+ function Ye(e, t) {
1039
1039
  return e ? typeof e == "string" ? e : typeof e == "object" && typeof e.default == "string" ? e.default : t : t;
1040
1040
  }
1041
- function Ye(e, t) {
1041
+ function Xe(e, t) {
1042
1042
  if (!t || Object.keys(t).length === 0) return e;
1043
1043
  let n = X(t, e.filter);
1044
1044
  return {
@@ -1046,8 +1046,8 @@ function Ye(e, t) {
1046
1046
  filter: n
1047
1047
  };
1048
1048
  }
1049
- var Xe = ({ report: e, dataSource: t, runtimeFilter: n, actionRunner: r, drillView: i, drillOpenIn: a, className: o, renderBlock: s }) => {
1050
- if (!c(e)) return /* @__PURE__ */ I("div", {
1049
+ var Ze = ({ report: e, dataSource: t, runtimeFilter: n, actionRunner: r, drillView: i, drillOpenIn: a, className: o, renderBlock: s }) => {
1050
+ if (!c(e)) return /* @__PURE__ */ R("div", {
1051
1051
  className: o,
1052
1052
  "data-testid": "joined-report-invalid",
1053
1053
  style: {
@@ -1057,14 +1057,14 @@ var Xe = ({ report: e, dataSource: t, runtimeFilter: n, actionRunner: r, drillVi
1057
1057
  },
1058
1058
  children: [
1059
1059
  "JoinedReportRenderer requires a report with ",
1060
- /* @__PURE__ */ F("code", { children: "type: 'joined'" }),
1060
+ /* @__PURE__ */ L("code", { children: "type: 'joined'" }),
1061
1061
  " and a ",
1062
- /* @__PURE__ */ F("code", { children: "blocks" }),
1062
+ /* @__PURE__ */ L("code", { children: "blocks" }),
1063
1063
  " array."
1064
1064
  ]
1065
1065
  });
1066
1066
  let l = e.blocks ?? [], u = e.filter, d = e.objectName;
1067
- return /* @__PURE__ */ F("div", {
1067
+ return /* @__PURE__ */ L("div", {
1068
1068
  className: o,
1069
1069
  "data-testid": "joined-report",
1070
1070
  "data-report-name": e.name,
@@ -1074,12 +1074,12 @@ var Xe = ({ report: e, dataSource: t, runtimeFilter: n, actionRunner: r, drillVi
1074
1074
  gap: 24
1075
1075
  },
1076
1076
  children: l.map((e, o) => {
1077
- let c = e.objectName ?? d ?? "", l = Ye({
1077
+ let c = e.objectName ?? d ?? "", l = Xe({
1078
1078
  ...e,
1079
1079
  objectName: c,
1080
1080
  type: e.type ?? "tabular",
1081
1081
  columns: e.columns ?? []
1082
- }, u), f = Je(e.label, e.name), p = e.description ? Je(e.description, "") : "", m = e.name ?? `block-${o}`, h = /* @__PURE__ */ I("section", {
1082
+ }, u), f = Ye(e.label, e.name), p = e.description ? Ye(e.description, "") : "", m = e.name ?? `block-${o}`, h = /* @__PURE__ */ R("section", {
1083
1083
  "data-testid": "joined-report-block",
1084
1084
  "data-block-id": m,
1085
1085
  style: {
@@ -1091,20 +1091,20 @@ var Xe = ({ report: e, dataSource: t, runtimeFilter: n, actionRunner: r, drillVi
1091
1091
  padding: 16,
1092
1092
  background: "var(--color-card, #ffffff)"
1093
1093
  },
1094
- children: [/* @__PURE__ */ I("header", {
1094
+ children: [/* @__PURE__ */ R("header", {
1095
1095
  style: {
1096
1096
  display: "flex",
1097
1097
  flexDirection: "column",
1098
1098
  gap: 2
1099
1099
  },
1100
- children: [/* @__PURE__ */ F("h3", {
1100
+ children: [/* @__PURE__ */ L("h3", {
1101
1101
  style: {
1102
1102
  margin: 0,
1103
1103
  fontSize: 16,
1104
1104
  fontWeight: 600
1105
1105
  },
1106
1106
  children: f
1107
- }), p ? /* @__PURE__ */ F("p", {
1107
+ }), p ? /* @__PURE__ */ L("p", {
1108
1108
  style: {
1109
1109
  margin: 0,
1110
1110
  fontSize: 13,
@@ -1112,7 +1112,7 @@ var Xe = ({ report: e, dataSource: t, runtimeFilter: n, actionRunner: r, drillVi
1112
1112
  },
1113
1113
  children: p
1114
1114
  }) : null]
1115
- }), /* @__PURE__ */ F(Qe, {
1115
+ }), /* @__PURE__ */ L($e, {
1116
1116
  schema: l,
1117
1117
  dataSource: t,
1118
1118
  runtimeFilter: n,
@@ -1124,79 +1124,79 @@ var Xe = ({ report: e, dataSource: t, runtimeFilter: n, actionRunner: r, drillVi
1124
1124
  return s ? s(e, o, h) : h;
1125
1125
  })
1126
1126
  });
1127
- }, Ze = {
1127
+ }, Qe = {
1128
1128
  border: "1px dashed var(--color-border, #d4d4d8)",
1129
1129
  borderRadius: 8,
1130
1130
  padding: 16,
1131
1131
  color: "var(--color-muted-foreground, #71717a)",
1132
1132
  background: "var(--color-muted, #f4f4f5)",
1133
1133
  fontSize: 13
1134
- }, Qe = (e) => {
1135
- let { dataSource: t, rows: n, runtimeFilter: r, actionRunner: i, drillView: a, drillOpenIn: o, className: s } = e, u = e.schema;
1136
- if (u && typeof u == "object" && u.type === "spec-report" && u.report && typeof u.report == "object" && (u = u.report), l(u)) {
1137
- let e = u.type ?? "tabular";
1138
- return e === "matrix" ? /* @__PURE__ */ F(Ke, {
1139
- report: u,
1140
- dataSource: t,
1141
- rows: n,
1142
- runtimeFilter: r,
1143
- actionRunner: i,
1144
- drillView: a,
1145
- drillOpenIn: o,
1146
- className: s
1147
- }) : e === "joined" ? c(u) ? /* @__PURE__ */ F(Xe, {
1148
- report: u,
1149
- dataSource: t,
1150
- runtimeFilter: r,
1151
- actionRunner: i,
1152
- drillView: a,
1153
- drillOpenIn: o,
1154
- className: s
1155
- }) : /* @__PURE__ */ I("div", {
1156
- className: s,
1157
- style: Ze,
1134
+ }, $e = (e) => {
1135
+ let { dataSource: n, rows: r, runtimeFilter: i, actionRunner: a, drillView: o, drillOpenIn: s, className: u } = e, f = t.useContext(d), p = n ?? f?.dataSource, m = e.schema;
1136
+ if (m && typeof m == "object" && m.type === "spec-report" && m.report && typeof m.report == "object" && (m = m.report), l(m)) {
1137
+ let e = m.type ?? "tabular";
1138
+ return e === "matrix" ? /* @__PURE__ */ L(qe, {
1139
+ report: m,
1140
+ dataSource: p,
1141
+ rows: r,
1142
+ runtimeFilter: i,
1143
+ actionRunner: a,
1144
+ drillView: o,
1145
+ drillOpenIn: s,
1146
+ className: u
1147
+ }) : e === "joined" ? c(m) ? /* @__PURE__ */ L(Ze, {
1148
+ report: m,
1149
+ dataSource: p,
1150
+ runtimeFilter: i,
1151
+ actionRunner: a,
1152
+ drillView: o,
1153
+ drillOpenIn: s,
1154
+ className: u
1155
+ }) : /* @__PURE__ */ R("div", {
1156
+ className: u,
1157
+ style: Qe,
1158
1158
  "data-testid": "report-joined-placeholder",
1159
1159
  children: [
1160
1160
  "Joined report (",
1161
- /* @__PURE__ */ F("code", { children: u.name }),
1161
+ /* @__PURE__ */ L("code", { children: m.name }),
1162
1162
  ") is missing a ",
1163
- /* @__PURE__ */ F("code", { children: "blocks" }),
1163
+ /* @__PURE__ */ L("code", { children: "blocks" }),
1164
1164
  " array."
1165
1165
  ]
1166
- }) : /* @__PURE__ */ F(Ve, {
1167
- report: u,
1168
- dataSource: t,
1169
- rows: n,
1170
- runtimeFilter: r,
1171
- actionRunner: i,
1172
- drillView: a,
1173
- drillOpenIn: o,
1174
- className: s
1166
+ }) : /* @__PURE__ */ L(He, {
1167
+ report: m,
1168
+ dataSource: p,
1169
+ rows: r,
1170
+ runtimeFilter: i,
1171
+ actionRunner: a,
1172
+ drillView: o,
1173
+ drillOpenIn: s,
1174
+ className: u
1175
1175
  });
1176
1176
  }
1177
- return /* @__PURE__ */ F(ge, { schema: u });
1177
+ return /* @__PURE__ */ L(_e, { schema: m });
1178
1178
  };
1179
1179
  //#endregion
1180
1180
  //#region src/ReportExportEngine.ts
1181
- function $e(e, t, n) {
1181
+ function et(e, t, n) {
1182
1182
  let r = e.fields || [], i = r.map((e) => e.label || e.name), a = t.map((e) => r.map((t) => {
1183
1183
  let n = e[t.name];
1184
- return n = at(n), typeof n == "string" && (n.includes(",") || n.includes("\"") || n.includes("\n")) ? `"${n.replace(/"/g, "\"\"")}"` : n ?? "";
1184
+ return n = ot(n), typeof n == "string" && (n.includes(",") || n.includes("\"") || n.includes("\n")) ? `"${n.replace(/"/g, "\"\"")}"` : n ?? "";
1185
1185
  }));
1186
- ct([...n?.includeHeaders === !1 ? [] : [i.join(",")], ...a.map((e) => e.join(","))].join("\n"), n?.filename || `${e.title || "report"}.csv`, "text/csv");
1186
+ lt([...n?.includeHeaders === !1 ? [] : [i.join(",")], ...a.map((e) => e.join(","))].join("\n"), n?.filename || `${e.title || "report"}.csv`, "text/csv");
1187
1187
  }
1188
- function et(e, t, n) {
1188
+ function tt(e, t, n) {
1189
1189
  let r = {
1190
1190
  title: e.title,
1191
1191
  description: e.description,
1192
1192
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
1193
1193
  data: t
1194
1194
  };
1195
- ct(JSON.stringify(r, null, 2), n?.filename || `${e.title || "report"}.json`, "application/json");
1195
+ lt(JSON.stringify(r, null, 2), n?.filename || `${e.title || "report"}.json`, "application/json");
1196
1196
  }
1197
- function tt(e, t, n) {
1198
- let r = e.fields || [], i = st(n?.orientation), a = ot(n?.pageSize);
1199
- ct(`<!DOCTYPE html>
1197
+ function nt(e, t, n) {
1198
+ let r = e.fields || [], i = ct(n?.orientation), a = st(n?.pageSize);
1199
+ lt(`<!DOCTYPE html>
1200
1200
  <html>
1201
1201
  <head>
1202
1202
  <meta charset="utf-8">
@@ -1224,10 +1224,10 @@ ${e.description ? `<p class="description">${Q(e.description)}</p>` : ""}
1224
1224
  </body>
1225
1225
  </html>`, n?.filename || `${e.title || "report"}.html`, "text/html");
1226
1226
  }
1227
- function nt(e, t, n) {
1228
- let r = e.fields || [], i = st(n?.orientation), a = ot(n?.pageSize), o = window.open("", "_blank");
1227
+ function rt(e, t, n) {
1228
+ let r = e.fields || [], i = ct(n?.orientation), a = st(n?.pageSize), o = window.open("", "_blank");
1229
1229
  if (!o) {
1230
- tt(e, t, {
1230
+ nt(e, t, {
1231
1231
  ...n,
1232
1232
  format: "html",
1233
1233
  filename: n?.filename?.replace(/\.pdf$/, ".html") || `${e.title || "report"}.html`
@@ -1265,29 +1265,29 @@ ${e.description ? `<p class="description">${Q(e.description)}</p>` : ""}
1265
1265
  o.print();
1266
1266
  };
1267
1267
  }
1268
- function rt(e, t, n) {
1268
+ function it(e, t, n) {
1269
1269
  let r = e.fields || [], i = r.map((e) => e.label || e.name), a = t.map((e) => r.map((t) => {
1270
1270
  let n = e[t.name];
1271
- return n = at(n), typeof n == "string" && (n.includes(",") || n.includes("\"") || n.includes("\n") || n.includes(" ")) ? `"${n.replace(/"/g, "\"\"")}"` : n ?? "";
1271
+ return n = ot(n), typeof n == "string" && (n.includes(",") || n.includes("\"") || n.includes("\n") || n.includes(" ")) ? `"${n.replace(/"/g, "\"\"")}"` : n ?? "";
1272
1272
  }));
1273
- ct("" + [...n?.includeHeaders === !1 ? [] : [i.join(" ")], ...a.map((e) => e.join(" "))].join("\n"), n?.filename || `${e.title || "report"}.tsv`, "text/tab-separated-values");
1273
+ lt("" + [...n?.includeHeaders === !1 ? [] : [i.join(" ")], ...a.map((e) => e.join(" "))].join("\n"), n?.filename || `${e.title || "report"}.tsv`, "text/tab-separated-values");
1274
1274
  }
1275
- function it(e, t, n, r) {
1275
+ function at(e, t, n, r) {
1276
1276
  switch (e) {
1277
1277
  case "csv":
1278
- $e(t, n, r);
1278
+ et(t, n, r);
1279
1279
  break;
1280
1280
  case "json":
1281
- et(t, n, r);
1281
+ tt(t, n, r);
1282
1282
  break;
1283
1283
  case "html":
1284
- tt(t, n, r);
1284
+ nt(t, n, r);
1285
1285
  break;
1286
1286
  case "pdf":
1287
- nt(t, n, r);
1287
+ rt(t, n, r);
1288
1288
  break;
1289
1289
  case "excel":
1290
- rt(t, n, r);
1290
+ it(t, n, r);
1291
1291
  break;
1292
1292
  default: console.warn(`Unsupported export format: ${e}`);
1293
1293
  }
@@ -1295,14 +1295,14 @@ function it(e, t, n, r) {
1295
1295
  function Q(e) {
1296
1296
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
1297
1297
  }
1298
- function at(e) {
1298
+ function ot(e) {
1299
1299
  if (typeof e == "string" && e.length > 0) {
1300
1300
  let t = e.charAt(0);
1301
1301
  if (t === "=" || t === "+" || t === "-" || t === "@" || t === "|") return `\t${e}`;
1302
1302
  }
1303
1303
  return e;
1304
1304
  }
1305
- function ot(e) {
1305
+ function st(e) {
1306
1306
  return [
1307
1307
  "A4",
1308
1308
  "A3",
@@ -1310,19 +1310,19 @@ function ot(e) {
1310
1310
  "Legal"
1311
1311
  ].includes(e || "") ? e : "A4";
1312
1312
  }
1313
- function st(e) {
1313
+ function ct(e) {
1314
1314
  return e === "landscape" ? "landscape" : "portrait";
1315
1315
  }
1316
- function ct(e, t, n) {
1316
+ function lt(e, t, n) {
1317
1317
  let r = new Blob([e], { type: `${n};charset=utf-8` }), i = URL.createObjectURL(r), a = document.createElement("a");
1318
1318
  a.href = i, a.download = t, document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(i);
1319
1319
  }
1320
1320
  //#endregion
1321
1321
  //#region src/formatValue.ts
1322
- function lt(e, t) {
1322
+ function ut(e, t) {
1323
1323
  if (e == null || e === "") return "";
1324
1324
  let n = t?.type, r = t?.format;
1325
- if (n === "date" || r === "date" || ut(e)) return dt(e);
1325
+ if (n === "date" || r === "date" || dt(e)) return ft(e);
1326
1326
  if (n === "number" || typeof e == "number") {
1327
1327
  let t = typeof e == "number" ? e : Number(e);
1328
1328
  return isNaN(t) ? String(e) : r === "currency" || r === "currency_cny" ? `¥${t.toLocaleString("en-US", {
@@ -1338,10 +1338,10 @@ function lt(e, t) {
1338
1338
  }
1339
1339
  return String(e);
1340
1340
  }
1341
- function ut(e) {
1341
+ function dt(e) {
1342
1342
  return typeof e == "string" ? /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2})?/.test(e) : !1;
1343
1343
  }
1344
- function dt(e) {
1344
+ function ft(e) {
1345
1345
  try {
1346
1346
  let t = new Date(e);
1347
1347
  return isNaN(t.getTime()) ? String(e) : `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`;
@@ -1351,7 +1351,7 @@ function dt(e) {
1351
1351
  }
1352
1352
  //#endregion
1353
1353
  //#region src/ReportViewer.tsx
1354
- function ft(e, t) {
1354
+ function pt(e, t) {
1355
1355
  if (!t || t.length === 0 || !e || e.length === 0) return null;
1356
1356
  let n = t[0], r = n.field, i = /* @__PURE__ */ new Map();
1357
1357
  for (let t of e) {
@@ -1367,18 +1367,18 @@ function ft(e, t) {
1367
1367
  let o = n.sort === "desc" ? -1 : 1;
1368
1368
  return a.sort((e, t) => e.key.localeCompare(t.key) * o), a;
1369
1369
  }
1370
- var pt = ({ schema: t, onRefresh: r }) => {
1371
- let { report: i, data: a, showToolbar: o = !0, allowExport: s = !0, allowPrint: c = !0, loading: l = !1 } = t, _ = (e) => {
1370
+ var mt = ({ schema: t, onRefresh: r }) => {
1371
+ let { report: i, data: a, showToolbar: o = !0, allowExport: s = !0, allowPrint: c = !0, loading: l = !1 } = t, d = (e) => {
1372
1372
  if (!i) {
1373
1373
  console.warn("ReportViewer: Cannot export, no report defined");
1374
1374
  return;
1375
1375
  }
1376
- it(e, i, a || [], i.exportConfigs?.[e]);
1377
- }, v = () => {
1378
- window.print();
1376
+ at(e, i, a || [], i.exportConfigs?.[e]);
1379
1377
  }, y = () => {
1378
+ window.print();
1379
+ }, b = () => {
1380
1380
  r?.();
1381
- }, b = (e, t) => {
1381
+ }, x = (e, t) => {
1382
1382
  if (!a) return 0;
1383
1383
  let n = a.map((t) => Number(t[e]) || 0);
1384
1384
  switch (t) {
@@ -1389,7 +1389,7 @@ var pt = ({ schema: t, onRefresh: r }) => {
1389
1389
  case "max": return n.length > 0 ? Math.max(...n) : 0;
1390
1390
  default: return "";
1391
1391
  }
1392
- }, x = (e, t) => {
1392
+ }, S = (e, t) => {
1393
1393
  let n = i?.conditionalFormatting;
1394
1394
  if (!(!n || !Array.isArray(n))) for (let r of n) {
1395
1395
  if (r.field !== e) continue;
@@ -1416,127 +1416,127 @@ var pt = ({ schema: t, onRefresh: r }) => {
1416
1416
  return r.backgroundColor && (e.backgroundColor = r.backgroundColor), r.textColor && (e.color = r.textColor), e;
1417
1417
  }
1418
1418
  }
1419
- }, S = (e, t) => {
1419
+ }, C = (e, t) => {
1420
1420
  if (e == null || e === "") return "";
1421
- if (t.renderAs === "badge" && (!t.type || t.type === "string" || t.type === "text")) return /* @__PURE__ */ F(u, {
1421
+ if (t.renderAs === "badge" && (!t.type || t.type === "string" || t.type === "text")) return /* @__PURE__ */ L(f, {
1422
1422
  className: t.colorMap?.[String(e)] || "",
1423
1423
  children: String(e)
1424
1424
  });
1425
- if (t.aggregation) return lt(e, t);
1425
+ if (t.aggregation) return ut(e, t);
1426
1426
  if (t.type) {
1427
1427
  let n = { ...t };
1428
1428
  return t.colorMap && !n.options && (n.options = Object.entries(t.colorMap).map(([e, t]) => ({
1429
1429
  value: e,
1430
1430
  label: e,
1431
1431
  color: t
1432
- }))), /* @__PURE__ */ F(me(he(n)), {
1432
+ }))), /* @__PURE__ */ L(he(ge(n)), {
1433
1433
  value: e,
1434
1434
  field: n
1435
1435
  });
1436
1436
  }
1437
- return lt(e, t);
1437
+ return ut(e, t);
1438
1438
  };
1439
- return i ? /* @__PURE__ */ I("div", {
1439
+ return i ? /* @__PURE__ */ R("div", {
1440
1440
  className: "space-y-4",
1441
- children: [o && /* @__PURE__ */ I("div", {
1441
+ children: [o && /* @__PURE__ */ R("div", {
1442
1442
  className: "flex items-center justify-between gap-2 p-4 bg-card rounded-lg border",
1443
- children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("h2", {
1443
+ children: [/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("h2", {
1444
1444
  className: "text-lg font-semibold",
1445
1445
  children: i.title
1446
- }), i.description && /* @__PURE__ */ F("p", {
1446
+ }), i.description && /* @__PURE__ */ L("p", {
1447
1447
  className: "text-sm text-muted-foreground",
1448
1448
  children: i.description
1449
- })] }), /* @__PURE__ */ I("div", {
1449
+ })] }), /* @__PURE__ */ R("div", {
1450
1450
  className: "flex items-center gap-2",
1451
1451
  children: [
1452
- i.refreshInterval && /* @__PURE__ */ I(d, {
1452
+ i.refreshInterval && /* @__PURE__ */ R(p, {
1453
1453
  variant: "outline",
1454
1454
  size: "sm",
1455
- onClick: y,
1456
- children: [/* @__PURE__ */ F(ue, { className: "h-4 w-4 mr-2" }), "Refresh"]
1455
+ onClick: b,
1456
+ children: [/* @__PURE__ */ L(de, { className: "h-4 w-4 mr-2" }), "Refresh"]
1457
1457
  }),
1458
- c && /* @__PURE__ */ I(d, {
1458
+ c && /* @__PURE__ */ R(p, {
1459
1459
  variant: "outline",
1460
1460
  size: "sm",
1461
- onClick: v,
1462
- children: [/* @__PURE__ */ F(le, { className: "h-4 w-4 mr-2" }), "Print"]
1461
+ onClick: y,
1462
+ children: [/* @__PURE__ */ L(ue, { className: "h-4 w-4 mr-2" }), "Print"]
1463
1463
  }),
1464
- s && i.showExportButtons && /* @__PURE__ */ I("div", {
1464
+ s && i.showExportButtons && /* @__PURE__ */ R("div", {
1465
1465
  className: "flex items-center gap-1",
1466
1466
  children: [
1467
- /* @__PURE__ */ I(d, {
1467
+ /* @__PURE__ */ R(p, {
1468
1468
  variant: "outline",
1469
1469
  size: "sm",
1470
- onClick: () => _("pdf"),
1471
- children: [/* @__PURE__ */ F(ae, { className: "h-4 w-4 mr-2" }), "PDF"]
1470
+ onClick: () => d("pdf"),
1471
+ children: [/* @__PURE__ */ L(oe, { className: "h-4 w-4 mr-2" }), "PDF"]
1472
1472
  }),
1473
- /* @__PURE__ */ I(d, {
1473
+ /* @__PURE__ */ R(p, {
1474
1474
  variant: "outline",
1475
1475
  size: "sm",
1476
- onClick: () => _("excel"),
1477
- children: [/* @__PURE__ */ F(ae, { className: "h-4 w-4 mr-2" }), "Excel"]
1476
+ onClick: () => d("excel"),
1477
+ children: [/* @__PURE__ */ L(oe, { className: "h-4 w-4 mr-2" }), "Excel"]
1478
1478
  }),
1479
- /* @__PURE__ */ I(d, {
1479
+ /* @__PURE__ */ R(p, {
1480
1480
  variant: "outline",
1481
1481
  size: "sm",
1482
- onClick: () => _("csv"),
1483
- children: [/* @__PURE__ */ F(ae, { className: "h-4 w-4 mr-2" }), "CSV"]
1482
+ onClick: () => d("csv"),
1483
+ children: [/* @__PURE__ */ L(oe, { className: "h-4 w-4 mr-2" }), "CSV"]
1484
1484
  })
1485
1485
  ]
1486
1486
  })
1487
1487
  ]
1488
1488
  })]
1489
- }), /* @__PURE__ */ I(f, { children: [/* @__PURE__ */ I(h, { children: [!o && i.title && /* @__PURE__ */ F(g, { children: i.title }), !o && i.description && /* @__PURE__ */ F(m, { children: i.description })] }), /* @__PURE__ */ I(p, {
1489
+ }), /* @__PURE__ */ R(m, { children: [/* @__PURE__ */ R(_, { children: [!o && i.title && /* @__PURE__ */ L(v, { children: i.title }), !o && i.description && /* @__PURE__ */ L(g, { children: i.description })] }), /* @__PURE__ */ R(h, {
1490
1490
  className: "space-y-6",
1491
1491
  children: [
1492
- l && /* @__PURE__ */ I("div", {
1492
+ l && /* @__PURE__ */ R("div", {
1493
1493
  className: "space-y-6",
1494
- children: [/* @__PURE__ */ F("div", {
1494
+ children: [/* @__PURE__ */ L("div", {
1495
1495
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
1496
1496
  children: [
1497
1497
  1,
1498
1498
  2,
1499
1499
  3
1500
- ].map((e) => /* @__PURE__ */ F(f, { children: /* @__PURE__ */ I(p, {
1500
+ ].map((e) => /* @__PURE__ */ L(m, { children: /* @__PURE__ */ R(h, {
1501
1501
  className: "p-4 space-y-2",
1502
- children: [/* @__PURE__ */ F(O, { className: "h-4 w-20" }), /* @__PURE__ */ F(O, { className: "h-8 w-28" })]
1502
+ children: [/* @__PURE__ */ L(A, { className: "h-4 w-20" }), /* @__PURE__ */ L(A, { className: "h-8 w-28" })]
1503
1503
  }) }, e))
1504
- }), /* @__PURE__ */ I("div", {
1504
+ }), /* @__PURE__ */ R("div", {
1505
1505
  className: "space-y-2",
1506
- children: [/* @__PURE__ */ F(O, { className: "h-10 w-full" }), [
1506
+ children: [/* @__PURE__ */ L(A, { className: "h-10 w-full" }), [
1507
1507
  1,
1508
1508
  2,
1509
1509
  3,
1510
1510
  4,
1511
1511
  5
1512
- ].map((e) => /* @__PURE__ */ F(O, { className: "h-8 w-full" }, e))]
1512
+ ].map((e) => /* @__PURE__ */ L(A, { className: "h-8 w-full" }, e))]
1513
1513
  })]
1514
1514
  }),
1515
- !l && i.sections?.map((t, r) => t.visible === !1 ? null : /* @__PURE__ */ I("div", {
1515
+ !l && i.sections?.map((t, r) => t.visible === !1 ? null : /* @__PURE__ */ R("div", {
1516
1516
  className: "space-y-2",
1517
1517
  children: [
1518
- t.title && t.type !== "header" && /* @__PURE__ */ F("h3", {
1518
+ t.title && t.type !== "header" && /* @__PURE__ */ L("h3", {
1519
1519
  className: "text-lg font-semibold border-b pb-2",
1520
1520
  children: t.title
1521
1521
  }),
1522
- t.type === "header" && t.title && /* @__PURE__ */ F("div", {
1522
+ t.type === "header" && t.title && /* @__PURE__ */ L("div", {
1523
1523
  className: "text-2xl font-bold py-4",
1524
1524
  children: t.title
1525
1525
  }),
1526
- t.type === "summary" && /* @__PURE__ */ F("div", {
1526
+ t.type === "summary" && /* @__PURE__ */ L("div", {
1527
1527
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
1528
- children: i.fields?.filter((e) => e.showInSummary).map((e, t) => /* @__PURE__ */ F(f, { children: /* @__PURE__ */ I(p, {
1528
+ children: i.fields?.filter((e) => e.showInSummary).map((e, t) => /* @__PURE__ */ L(m, { children: /* @__PURE__ */ R(h, {
1529
1529
  className: "p-4",
1530
- children: [/* @__PURE__ */ F("div", {
1530
+ children: [/* @__PURE__ */ L("div", {
1531
1531
  className: "text-sm text-muted-foreground",
1532
1532
  children: e.label || e.name
1533
- }), /* @__PURE__ */ F("div", {
1533
+ }), /* @__PURE__ */ L("div", {
1534
1534
  className: "text-2xl font-bold",
1535
- children: lt(b(e.name, e.aggregation), e)
1535
+ children: ut(x(e.name, e.aggregation), e)
1536
1536
  })]
1537
1537
  }) }, t))
1538
1538
  }),
1539
- t.type === "chart" && t.chart && /* @__PURE__ */ F("div", {
1539
+ t.type === "chart" && t.chart && /* @__PURE__ */ L("div", {
1540
1540
  className: "min-h-[300px]",
1541
1541
  children: (() => {
1542
1542
  let n = t.chart.type, r = !!t.chart.chartType;
@@ -1546,7 +1546,7 @@ var pt = ({ schema: t, onRefresh: r }) => {
1546
1546
  series: t.chart.series || (t.chart.yAxisFields ? t.chart.yAxisFields.map((e) => ({ dataKey: e })) : []),
1547
1547
  chartType: t.chart.chartType || "bar"
1548
1548
  } : {};
1549
- return /* @__PURE__ */ F(B, { schema: {
1549
+ return /* @__PURE__ */ L(u, { schema: {
1550
1550
  ...t.chart,
1551
1551
  type: n,
1552
1552
  ...i,
@@ -1555,21 +1555,21 @@ var pt = ({ schema: t, onRefresh: r }) => {
1555
1555
  } });
1556
1556
  })()
1557
1557
  }),
1558
- t.type === "table" && /* @__PURE__ */ F("div", {
1558
+ t.type === "table" && /* @__PURE__ */ L("div", {
1559
1559
  className: "border rounded-lg overflow-x-auto",
1560
- children: /* @__PURE__ */ I("table", {
1560
+ children: /* @__PURE__ */ R("table", {
1561
1561
  className: "w-full text-sm min-w-[600px]",
1562
- children: [/* @__PURE__ */ F("thead", {
1562
+ children: [/* @__PURE__ */ L("thead", {
1563
1563
  className: "bg-muted",
1564
- children: /* @__PURE__ */ F("tr", { children: t.columns?.map((e, t) => /* @__PURE__ */ F("th", {
1564
+ children: /* @__PURE__ */ L("tr", { children: t.columns?.map((e, t) => /* @__PURE__ */ L("th", {
1565
1565
  className: `px-4 py-2 font-medium ${e.type === "number" ? "text-right" : "text-left"}`,
1566
1566
  children: e.label || e.name
1567
1567
  }, t)) })
1568
- }), /* @__PURE__ */ F("tbody", { children: (() => {
1569
- let e = ft(a || [], i.groupBy || []);
1570
- return e ? e.map((e) => /* @__PURE__ */ I(n.Fragment, { children: [/* @__PURE__ */ F("tr", {
1568
+ }), /* @__PURE__ */ L("tbody", { children: (() => {
1569
+ let e = pt(a || [], i.groupBy || []);
1570
+ return e ? e.map((e) => /* @__PURE__ */ R(n.Fragment, { children: [/* @__PURE__ */ L("tr", {
1571
1571
  className: "bg-muted/60",
1572
- children: /* @__PURE__ */ I("td", {
1572
+ children: /* @__PURE__ */ R("td", {
1573
1573
  colSpan: t.columns?.length || 1,
1574
1574
  className: "px-4 py-2 font-semibold text-sm",
1575
1575
  children: [
@@ -1579,59 +1579,59 @@ var pt = ({ schema: t, onRefresh: r }) => {
1579
1579
  ")"
1580
1580
  ]
1581
1581
  })
1582
- }), e.rows.map((e, n) => /* @__PURE__ */ F("tr", {
1582
+ }), e.rows.map((e, n) => /* @__PURE__ */ L("tr", {
1583
1583
  className: "border-t hover:bg-muted/50 even:bg-muted/20",
1584
- children: t.columns?.map((t, n) => /* @__PURE__ */ F("td", {
1584
+ children: t.columns?.map((t, n) => /* @__PURE__ */ L("td", {
1585
1585
  className: `px-4 py-2 ${t.type === "number" ? "text-right tabular-nums" : ""}`,
1586
- style: x(t.name, e[t.name]),
1587
- children: S(e[t.name], t)
1586
+ style: S(t.name, e[t.name]),
1587
+ children: C(e[t.name], t)
1588
1588
  }, n))
1589
- }, n))] }, e.key)) : a?.map((e, n) => /* @__PURE__ */ F("tr", {
1589
+ }, n))] }, e.key)) : a?.map((e, n) => /* @__PURE__ */ L("tr", {
1590
1590
  className: "border-t hover:bg-muted/50 even:bg-muted/20",
1591
- children: t.columns?.map((t, n) => /* @__PURE__ */ F("td", {
1591
+ children: t.columns?.map((t, n) => /* @__PURE__ */ L("td", {
1592
1592
  className: `px-4 py-2 ${t.type === "number" ? "text-right tabular-nums" : ""}`,
1593
- style: x(t.name, e[t.name]),
1594
- children: S(e[t.name], t)
1593
+ style: S(t.name, e[t.name]),
1594
+ children: C(e[t.name], t)
1595
1595
  }, n))
1596
1596
  }, n));
1597
1597
  })() })]
1598
1598
  })
1599
1599
  }),
1600
- t.type === "text" && t.text && /* @__PURE__ */ F("div", {
1600
+ t.type === "text" && t.text && /* @__PURE__ */ L("div", {
1601
1601
  className: "prose max-w-none",
1602
- children: /* @__PURE__ */ F("p", { children: t.text })
1602
+ children: /* @__PURE__ */ L("p", { children: t.text })
1603
1603
  }),
1604
- t.type === "page-break" && /* @__PURE__ */ F("div", { className: "border-t-2 border-dashed my-8 print:page-break-after-always" }),
1605
- t.content && /* @__PURE__ */ F(B, { schema: t.content })
1604
+ t.type === "page-break" && /* @__PURE__ */ L("div", { className: "border-t-2 border-dashed my-8 print:page-break-after-always" }),
1605
+ t.content && /* @__PURE__ */ L(u, { schema: t.content })
1606
1606
  ]
1607
1607
  }, r)),
1608
- !i.sections && a && a.length > 0 && /* @__PURE__ */ F("div", {
1608
+ !i.sections && a && a.length > 0 && /* @__PURE__ */ L("div", {
1609
1609
  className: "border rounded-lg overflow-x-auto",
1610
- children: /* @__PURE__ */ I("table", {
1610
+ children: /* @__PURE__ */ R("table", {
1611
1611
  className: "w-full text-sm min-w-[600px]",
1612
- children: [/* @__PURE__ */ F("thead", {
1612
+ children: [/* @__PURE__ */ L("thead", {
1613
1613
  className: "bg-muted",
1614
- children: /* @__PURE__ */ F("tr", { children: i.fields?.map((e, t) => /* @__PURE__ */ F("th", {
1614
+ children: /* @__PURE__ */ L("tr", { children: i.fields?.map((e, t) => /* @__PURE__ */ L("th", {
1615
1615
  className: `px-4 py-2 font-medium ${e.type === "number" ? "text-right" : "text-left"}`,
1616
1616
  children: e.label || e.name
1617
1617
  }, t)) })
1618
- }), /* @__PURE__ */ F("tbody", { children: a.map((e, t) => /* @__PURE__ */ F("tr", {
1618
+ }), /* @__PURE__ */ L("tbody", { children: a.map((e, t) => /* @__PURE__ */ L("tr", {
1619
1619
  className: "border-t hover:bg-muted/50 even:bg-muted/20",
1620
- children: i.fields?.map((t, n) => /* @__PURE__ */ F("td", {
1620
+ children: i.fields?.map((t, n) => /* @__PURE__ */ L("td", {
1621
1621
  className: `px-4 py-2 ${t.type === "number" ? "text-right tabular-nums" : ""}`,
1622
- style: x(t.name, e[t.name]),
1623
- children: S(e[t.name], t)
1622
+ style: S(t.name, e[t.name]),
1623
+ children: C(e[t.name], t)
1624
1624
  }, n))
1625
1625
  }, t)) })]
1626
1626
  })
1627
1627
  })
1628
1628
  ]
1629
1629
  })] })]
1630
- }) : /* @__PURE__ */ F(f, { children: /* @__PURE__ */ F(p, {
1630
+ }) : /* @__PURE__ */ L(m, { children: /* @__PURE__ */ L(h, {
1631
1631
  className: "p-8 text-center text-muted-foreground",
1632
1632
  children: "No report to display"
1633
1633
  }) });
1634
- }, mt = ({ schedule: e, onChange: t }) => {
1634
+ }, ht = ({ schedule: e, onChange: t }) => {
1635
1635
  let [n, r] = s(e || {
1636
1636
  enabled: !1,
1637
1637
  frequency: "weekly",
@@ -1646,27 +1646,27 @@ var pt = ({ schema: t, onRefresh: r }) => {
1646
1646
  };
1647
1647
  r(i), t?.(i);
1648
1648
  };
1649
- return /* @__PURE__ */ I(f, { children: [/* @__PURE__ */ F(h, { children: /* @__PURE__ */ I(g, {
1649
+ return /* @__PURE__ */ R(m, { children: [/* @__PURE__ */ L(_, { children: /* @__PURE__ */ R(v, {
1650
1650
  className: "flex items-center gap-2",
1651
- children: [/* @__PURE__ */ F(te, { className: "h-5 w-5" }), "Schedule Configuration"]
1652
- }) }), /* @__PURE__ */ I(p, {
1651
+ children: [/* @__PURE__ */ L(ne, { className: "h-5 w-5" }), "Schedule Configuration"]
1652
+ }) }), /* @__PURE__ */ R(h, {
1653
1653
  className: "space-y-4",
1654
- children: [/* @__PURE__ */ I("div", {
1654
+ children: [/* @__PURE__ */ R("div", {
1655
1655
  className: "flex items-center gap-2",
1656
- children: [/* @__PURE__ */ F("input", {
1656
+ children: [/* @__PURE__ */ L("input", {
1657
1657
  type: "checkbox",
1658
1658
  id: "schedule-enabled",
1659
1659
  checked: n.enabled || !1,
1660
1660
  onChange: (e) => i({ enabled: e.target.checked }),
1661
1661
  className: "rounded"
1662
- }), /* @__PURE__ */ F(D, {
1662
+ }), /* @__PURE__ */ L(k, {
1663
1663
  htmlFor: "schedule-enabled",
1664
1664
  children: "Enable Scheduled Report"
1665
1665
  })]
1666
- }), n.enabled && /* @__PURE__ */ I(P, { children: [
1667
- /* @__PURE__ */ I("div", {
1666
+ }), n.enabled && /* @__PURE__ */ R(I, { children: [
1667
+ /* @__PURE__ */ R("div", {
1668
1668
  className: "space-y-2",
1669
- children: [/* @__PURE__ */ F(D, { children: "Frequency" }), /* @__PURE__ */ F("select", {
1669
+ children: [/* @__PURE__ */ L(k, { children: "Frequency" }), /* @__PURE__ */ L("select", {
1670
1670
  className: "w-full border rounded-md p-2 bg-background",
1671
1671
  value: n.frequency || "weekly",
1672
1672
  onChange: (e) => i({ frequency: e.target.value }),
@@ -1695,15 +1695,15 @@ var pt = ({ schema: t, onRefresh: r }) => {
1695
1695
  value: "yearly",
1696
1696
  label: "Yearly"
1697
1697
  }
1698
- ].map((e) => /* @__PURE__ */ F("option", {
1698
+ ].map((e) => /* @__PURE__ */ L("option", {
1699
1699
  value: e.value,
1700
1700
  children: e.label
1701
1701
  }, e.value))
1702
1702
  })]
1703
1703
  }),
1704
- n.frequency === "weekly" && /* @__PURE__ */ I("div", {
1704
+ n.frequency === "weekly" && /* @__PURE__ */ R("div", {
1705
1705
  className: "space-y-2",
1706
- children: [/* @__PURE__ */ F(D, { children: "Day of Week" }), /* @__PURE__ */ F("select", {
1706
+ children: [/* @__PURE__ */ L(k, { children: "Day of Week" }), /* @__PURE__ */ L("select", {
1707
1707
  className: "w-full border rounded-md p-2 bg-background",
1708
1708
  value: n.dayOfWeek ?? 1,
1709
1709
  onChange: (e) => i({ dayOfWeek: Number(e.target.value) }),
@@ -1736,15 +1736,15 @@ var pt = ({ schema: t, onRefresh: r }) => {
1736
1736
  value: 6,
1737
1737
  label: "Saturday"
1738
1738
  }
1739
- ].map((e) => /* @__PURE__ */ F("option", {
1739
+ ].map((e) => /* @__PURE__ */ L("option", {
1740
1740
  value: e.value,
1741
1741
  children: e.label
1742
1742
  }, e.value))
1743
1743
  })]
1744
1744
  }),
1745
- n.frequency === "monthly" && /* @__PURE__ */ I("div", {
1745
+ n.frequency === "monthly" && /* @__PURE__ */ R("div", {
1746
1746
  className: "space-y-2",
1747
- children: [/* @__PURE__ */ F(D, { children: "Day of Month" }), /* @__PURE__ */ F(E, {
1747
+ children: [/* @__PURE__ */ L(k, { children: "Day of Month" }), /* @__PURE__ */ L(O, {
1748
1748
  type: "number",
1749
1749
  min: 1,
1750
1750
  max: 31,
@@ -1752,28 +1752,28 @@ var pt = ({ schema: t, onRefresh: r }) => {
1752
1752
  onChange: (e) => i({ dayOfMonth: Number(e.target.value) })
1753
1753
  })]
1754
1754
  }),
1755
- /* @__PURE__ */ I("div", {
1755
+ /* @__PURE__ */ R("div", {
1756
1756
  className: "space-y-2",
1757
- children: [/* @__PURE__ */ I(D, {
1757
+ children: [/* @__PURE__ */ R(k, {
1758
1758
  className: "flex items-center gap-2",
1759
- children: [/* @__PURE__ */ F(ie, { className: "h-4 w-4" }), "Time"]
1760
- }), /* @__PURE__ */ F(E, {
1759
+ children: [/* @__PURE__ */ L(ae, { className: "h-4 w-4" }), "Time"]
1760
+ }), /* @__PURE__ */ L(O, {
1761
1761
  type: "time",
1762
1762
  value: n.time || "09:00",
1763
1763
  onChange: (e) => i({ time: e.target.value })
1764
1764
  })]
1765
1765
  }),
1766
- /* @__PURE__ */ I("div", {
1766
+ /* @__PURE__ */ R("div", {
1767
1767
  className: "space-y-2",
1768
- children: [/* @__PURE__ */ F(D, { children: "Timezone" }), /* @__PURE__ */ F(E, {
1768
+ children: [/* @__PURE__ */ L(k, { children: "Timezone" }), /* @__PURE__ */ L(O, {
1769
1769
  value: n.timezone || "",
1770
1770
  onChange: (e) => i({ timezone: e.target.value }),
1771
1771
  placeholder: "e.g. America/New_York"
1772
1772
  })]
1773
1773
  }),
1774
- /* @__PURE__ */ I("div", {
1774
+ /* @__PURE__ */ R("div", {
1775
1775
  className: "space-y-2",
1776
- children: [/* @__PURE__ */ F(D, { children: "Export Formats" }), /* @__PURE__ */ F("div", {
1776
+ children: [/* @__PURE__ */ L(k, { children: "Export Formats" }), /* @__PURE__ */ L("div", {
1777
1777
  className: "flex flex-wrap gap-2",
1778
1778
  children: [
1779
1779
  {
@@ -1792,9 +1792,9 @@ var pt = ({ schema: t, onRefresh: r }) => {
1792
1792
  value: "html",
1793
1793
  label: "HTML"
1794
1794
  }
1795
- ].map((e) => /* @__PURE__ */ I("label", {
1795
+ ].map((e) => /* @__PURE__ */ R("label", {
1796
1796
  className: "flex items-center gap-1.5 px-3 py-1.5 border rounded-md cursor-pointer hover:bg-muted/50",
1797
- children: [/* @__PURE__ */ F("input", {
1797
+ children: [/* @__PURE__ */ L("input", {
1798
1798
  type: "checkbox",
1799
1799
  checked: n.formats?.includes(e.value) || !1,
1800
1800
  onChange: (t) => {
@@ -1802,27 +1802,27 @@ var pt = ({ schema: t, onRefresh: r }) => {
1802
1802
  i({ formats: t.target.checked ? [...r, e.value] : r.filter((t) => t !== e.value) });
1803
1803
  },
1804
1804
  className: "rounded"
1805
- }), /* @__PURE__ */ F("span", {
1805
+ }), /* @__PURE__ */ L("span", {
1806
1806
  className: "text-sm",
1807
1807
  children: e.label
1808
1808
  })]
1809
1809
  }, e.value))
1810
1810
  })]
1811
1811
  }),
1812
- /* @__PURE__ */ I("div", {
1812
+ /* @__PURE__ */ R("div", {
1813
1813
  className: "space-y-2",
1814
- children: [/* @__PURE__ */ I(D, {
1814
+ children: [/* @__PURE__ */ R(k, {
1815
1815
  className: "flex items-center gap-2",
1816
- children: [/* @__PURE__ */ F(ce, { className: "h-4 w-4" }), "Email Recipients"]
1817
- }), /* @__PURE__ */ F(E, {
1816
+ children: [/* @__PURE__ */ L(le, { className: "h-4 w-4" }), "Email Recipients"]
1817
+ }), /* @__PURE__ */ L(O, {
1818
1818
  placeholder: "email1@example.com, email2@example.com",
1819
1819
  value: n.recipients?.join(", ") || "",
1820
1820
  onChange: (e) => i({ recipients: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
1821
1821
  })]
1822
1822
  }),
1823
- /* @__PURE__ */ I("div", {
1823
+ /* @__PURE__ */ R("div", {
1824
1824
  className: "space-y-2",
1825
- children: [/* @__PURE__ */ F(D, { children: "Email Subject" }), /* @__PURE__ */ F(E, {
1825
+ children: [/* @__PURE__ */ L(k, { children: "Email Subject" }), /* @__PURE__ */ L(O, {
1826
1826
  value: n.subject || "",
1827
1827
  onChange: (e) => i({ subject: e.target.value }),
1828
1828
  placeholder: "Scheduled Report: {report_title}"
@@ -1830,7 +1830,7 @@ var pt = ({ schema: t, onRefresh: r }) => {
1830
1830
  })
1831
1831
  ] })]
1832
1832
  })] });
1833
- }, ht = ({ schema: e }) => {
1833
+ }, gt = ({ schema: e }) => {
1834
1834
  let { report: t, dataSources: n = [], availableFields: r = [], showPreview: i = !0, onSave: a, onCancel: o } = e, [c, l] = s(t || {
1835
1835
  type: "report",
1836
1836
  title: "New Report",
@@ -1840,12 +1840,12 @@ var pt = ({ schema: t, onRefresh: r }) => {
1840
1840
  sections: [],
1841
1841
  showExportButtons: !0,
1842
1842
  showPrintButton: !0
1843
- }), [u, _] = s(c.fields || []), [v, y] = s(c.filters || []), [b, x] = s(c.groupBy || []), [S, C] = s(c.sections || []), w = () => {
1843
+ }), [u, d] = s(c.fields || []), [f, y] = s(c.filters || []), [b, x] = s(c.groupBy || []), [S, C] = s(c.sections || []), w = () => {
1844
1844
  if (r.length > 0 && u.length < r.length) {
1845
1845
  let e = r.find((e) => !u.some((t) => t.name === e.name));
1846
1846
  if (e) {
1847
1847
  let t = [...u, e];
1848
- _(t), l({
1848
+ d(t), l({
1849
1849
  ...c,
1850
1850
  fields: t
1851
1851
  });
@@ -1853,39 +1853,39 @@ var pt = ({ schema: t, onRefresh: r }) => {
1853
1853
  }
1854
1854
  }, T = (e) => {
1855
1855
  let t = u.filter((t, n) => n !== e);
1856
- _(t), l({
1856
+ d(t), l({
1857
1857
  ...c,
1858
1858
  fields: t
1859
1859
  });
1860
- }, O = (e, t) => {
1860
+ }, E = (e, t) => {
1861
1861
  let n = [...u];
1862
- n[e] = t, _(n), l({
1862
+ n[e] = t, d(n), l({
1863
1863
  ...c,
1864
1864
  fields: n
1865
1865
  });
1866
- }, N = () => {
1866
+ }, D = () => {
1867
1867
  let e = {
1868
1868
  field: r[0]?.name || "",
1869
1869
  operator: "equals",
1870
1870
  value: ""
1871
- }, t = [...v, e];
1871
+ }, t = [...f, e];
1872
1872
  y(t), l({
1873
1873
  ...c,
1874
1874
  filters: t
1875
1875
  });
1876
- }, ee = (e) => {
1877
- let t = v.filter((t, n) => n !== e);
1876
+ }, A = (e) => {
1877
+ let t = f.filter((t, n) => n !== e);
1878
1878
  y(t), l({
1879
1879
  ...c,
1880
1880
  filters: t
1881
1881
  });
1882
- }, L = (e, t) => {
1883
- let n = [...v];
1882
+ }, P = (e, t) => {
1883
+ let n = [...f];
1884
1884
  n[e] = t, y(n), l({
1885
1885
  ...c,
1886
1886
  filters: n
1887
1887
  });
1888
- }, R = () => {
1888
+ }, F = () => {
1889
1889
  let e = {
1890
1890
  field: r[0]?.name || "",
1891
1891
  sort: "asc"
@@ -1928,53 +1928,53 @@ var pt = ({ schema: t, onRefresh: r }) => {
1928
1928
  sections: n
1929
1929
  });
1930
1930
  };
1931
- return /* @__PURE__ */ I("div", {
1931
+ return /* @__PURE__ */ R("div", {
1932
1932
  className: "space-y-4",
1933
- children: [/* @__PURE__ */ I(f, { children: [/* @__PURE__ */ I(h, { children: [/* @__PURE__ */ F(g, { children: "Report Builder" }), /* @__PURE__ */ F(m, { children: "Configure your report settings, fields, filters, and sections" })] }), /* @__PURE__ */ I(p, { children: [/* @__PURE__ */ I(k, {
1933
+ children: [/* @__PURE__ */ R(m, { children: [/* @__PURE__ */ R(_, { children: [/* @__PURE__ */ L(v, { children: "Report Builder" }), /* @__PURE__ */ L(g, { children: "Configure your report settings, fields, filters, and sections" })] }), /* @__PURE__ */ R(h, { children: [/* @__PURE__ */ R(j, {
1934
1934
  defaultValue: "basic",
1935
1935
  className: "w-full",
1936
1936
  children: [
1937
- /* @__PURE__ */ I(j, {
1937
+ /* @__PURE__ */ R(ee, {
1938
1938
  className: "grid w-full grid-cols-6",
1939
1939
  children: [
1940
- /* @__PURE__ */ I(M, {
1940
+ /* @__PURE__ */ R(N, {
1941
1941
  value: "basic",
1942
- children: [/* @__PURE__ */ F(pe, { className: "h-4 w-4 mr-2" }), "Basic"]
1942
+ children: [/* @__PURE__ */ L(me, { className: "h-4 w-4 mr-2" }), "Basic"]
1943
1943
  }),
1944
- /* @__PURE__ */ I(M, {
1944
+ /* @__PURE__ */ R(N, {
1945
1945
  value: "fields",
1946
- children: [/* @__PURE__ */ F(se, { className: "h-4 w-4 mr-2" }), "Fields"]
1946
+ children: [/* @__PURE__ */ L(ce, { className: "h-4 w-4 mr-2" }), "Fields"]
1947
1947
  }),
1948
- /* @__PURE__ */ I(M, {
1948
+ /* @__PURE__ */ R(N, {
1949
1949
  value: "filters",
1950
- children: [/* @__PURE__ */ F(oe, { className: "h-4 w-4 mr-2" }), "Filters"]
1950
+ children: [/* @__PURE__ */ L(se, { className: "h-4 w-4 mr-2" }), "Filters"]
1951
1951
  }),
1952
- /* @__PURE__ */ I(M, {
1952
+ /* @__PURE__ */ R(N, {
1953
1953
  value: "grouping",
1954
- children: [/* @__PURE__ */ F(se, { className: "h-4 w-4 mr-2" }), "Group By"]
1954
+ children: [/* @__PURE__ */ L(ce, { className: "h-4 w-4 mr-2" }), "Group By"]
1955
1955
  }),
1956
- /* @__PURE__ */ I(M, {
1956
+ /* @__PURE__ */ R(N, {
1957
1957
  value: "sections",
1958
- children: [/* @__PURE__ */ F(se, { className: "h-4 w-4 mr-2" }), "Sections"]
1958
+ children: [/* @__PURE__ */ L(ce, { className: "h-4 w-4 mr-2" }), "Sections"]
1959
1959
  }),
1960
- /* @__PURE__ */ I(M, {
1960
+ /* @__PURE__ */ R(N, {
1961
1961
  value: "schedule",
1962
- children: [/* @__PURE__ */ F(te, { className: "h-4 w-4 mr-2" }), "Schedule"]
1962
+ children: [/* @__PURE__ */ L(ne, { className: "h-4 w-4 mr-2" }), "Schedule"]
1963
1963
  })
1964
1964
  ]
1965
1965
  }),
1966
- /* @__PURE__ */ F(A, {
1966
+ /* @__PURE__ */ L(M, {
1967
1967
  value: "basic",
1968
1968
  className: "space-y-4 mt-4",
1969
- children: /* @__PURE__ */ I("div", {
1969
+ children: /* @__PURE__ */ R("div", {
1970
1970
  className: "space-y-4",
1971
1971
  children: [
1972
- /* @__PURE__ */ I("div", {
1972
+ /* @__PURE__ */ R("div", {
1973
1973
  className: "space-y-2",
1974
- children: [/* @__PURE__ */ F(D, {
1974
+ children: [/* @__PURE__ */ L(k, {
1975
1975
  htmlFor: "report-title",
1976
1976
  children: "Report Title"
1977
- }), /* @__PURE__ */ F(E, {
1977
+ }), /* @__PURE__ */ L(O, {
1978
1978
  id: "report-title",
1979
1979
  value: c.title || "",
1980
1980
  onChange: (e) => l({
@@ -1984,12 +1984,12 @@ var pt = ({ schema: t, onRefresh: r }) => {
1984
1984
  placeholder: "Enter report title"
1985
1985
  })]
1986
1986
  }),
1987
- /* @__PURE__ */ I("div", {
1987
+ /* @__PURE__ */ R("div", {
1988
1988
  className: "space-y-2",
1989
- children: [/* @__PURE__ */ F(D, {
1989
+ children: [/* @__PURE__ */ L(k, {
1990
1990
  htmlFor: "report-description",
1991
1991
  children: "Description"
1992
- }), /* @__PURE__ */ F(E, {
1992
+ }), /* @__PURE__ */ L(O, {
1993
1993
  id: "report-description",
1994
1994
  value: c.description || "",
1995
1995
  onChange: (e) => l({
@@ -1999,58 +1999,58 @@ var pt = ({ schema: t, onRefresh: r }) => {
1999
1999
  placeholder: "Enter report description"
2000
2000
  })]
2001
2001
  }),
2002
- n.length > 0 && /* @__PURE__ */ I("div", {
2002
+ n.length > 0 && /* @__PURE__ */ R("div", {
2003
2003
  className: "space-y-2",
2004
- children: [/* @__PURE__ */ F(D, { children: "Data Source" }), /* @__PURE__ */ I("select", {
2004
+ children: [/* @__PURE__ */ L(k, { children: "Data Source" }), /* @__PURE__ */ R("select", {
2005
2005
  className: "w-full border rounded-md p-2",
2006
- children: [/* @__PURE__ */ F("option", {
2006
+ children: [/* @__PURE__ */ L("option", {
2007
2007
  value: "",
2008
2008
  children: "Select a data source"
2009
- }), n.map((e, t) => /* @__PURE__ */ I("option", {
2009
+ }), n.map((e, t) => /* @__PURE__ */ R("option", {
2010
2010
  value: t,
2011
2011
  children: ["Data Source ", t + 1]
2012
2012
  }, t))]
2013
2013
  })]
2014
2014
  }),
2015
- /* @__PURE__ */ I("div", {
2015
+ /* @__PURE__ */ R("div", {
2016
2016
  className: "space-y-2",
2017
- children: [/* @__PURE__ */ F(D, { children: "Export Options" }), /* @__PURE__ */ I("div", {
2017
+ children: [/* @__PURE__ */ L(k, { children: "Export Options" }), /* @__PURE__ */ R("div", {
2018
2018
  className: "flex items-center gap-4",
2019
- children: [/* @__PURE__ */ I("label", {
2019
+ children: [/* @__PURE__ */ R("label", {
2020
2020
  className: "flex items-center gap-2",
2021
- children: [/* @__PURE__ */ F("input", {
2021
+ children: [/* @__PURE__ */ L("input", {
2022
2022
  type: "checkbox",
2023
2023
  checked: c.showExportButtons || !1,
2024
2024
  onChange: (e) => l({
2025
2025
  ...c,
2026
2026
  showExportButtons: e.target.checked
2027
2027
  })
2028
- }), /* @__PURE__ */ F("span", {
2028
+ }), /* @__PURE__ */ L("span", {
2029
2029
  className: "text-sm",
2030
2030
  children: "Show Export Buttons"
2031
2031
  })]
2032
- }), /* @__PURE__ */ I("label", {
2032
+ }), /* @__PURE__ */ R("label", {
2033
2033
  className: "flex items-center gap-2",
2034
- children: [/* @__PURE__ */ F("input", {
2034
+ children: [/* @__PURE__ */ L("input", {
2035
2035
  type: "checkbox",
2036
2036
  checked: c.showPrintButton || !1,
2037
2037
  onChange: (e) => l({
2038
2038
  ...c,
2039
2039
  showPrintButton: e.target.checked
2040
2040
  })
2041
- }), /* @__PURE__ */ F("span", {
2041
+ }), /* @__PURE__ */ L("span", {
2042
2042
  className: "text-sm",
2043
2043
  children: "Show Print Button"
2044
2044
  })]
2045
2045
  })]
2046
2046
  })]
2047
2047
  }),
2048
- /* @__PURE__ */ I("div", {
2048
+ /* @__PURE__ */ R("div", {
2049
2049
  className: "space-y-2",
2050
- children: [/* @__PURE__ */ F(D, {
2050
+ children: [/* @__PURE__ */ L(k, {
2051
2051
  htmlFor: "export-format",
2052
2052
  children: "Default Export Format"
2053
- }), /* @__PURE__ */ I("select", {
2053
+ }), /* @__PURE__ */ R("select", {
2054
2054
  id: "export-format",
2055
2055
  className: "w-full border rounded-md p-2",
2056
2056
  value: c.defaultExportFormat || "pdf",
@@ -2059,23 +2059,23 @@ var pt = ({ schema: t, onRefresh: r }) => {
2059
2059
  defaultExportFormat: e.target.value
2060
2060
  }),
2061
2061
  children: [
2062
- /* @__PURE__ */ F("option", {
2062
+ /* @__PURE__ */ L("option", {
2063
2063
  value: "pdf",
2064
2064
  children: "PDF"
2065
2065
  }),
2066
- /* @__PURE__ */ F("option", {
2066
+ /* @__PURE__ */ L("option", {
2067
2067
  value: "excel",
2068
2068
  children: "Excel"
2069
2069
  }),
2070
- /* @__PURE__ */ F("option", {
2070
+ /* @__PURE__ */ L("option", {
2071
2071
  value: "csv",
2072
2072
  children: "CSV"
2073
2073
  }),
2074
- /* @__PURE__ */ F("option", {
2074
+ /* @__PURE__ */ L("option", {
2075
2075
  value: "json",
2076
2076
  children: "JSON"
2077
2077
  }),
2078
- /* @__PURE__ */ F("option", {
2078
+ /* @__PURE__ */ L("option", {
2079
2079
  value: "html",
2080
2080
  children: "HTML"
2081
2081
  })
@@ -2085,305 +2085,305 @@ var pt = ({ schema: t, onRefresh: r }) => {
2085
2085
  ]
2086
2086
  })
2087
2087
  }),
2088
- /* @__PURE__ */ I(A, {
2088
+ /* @__PURE__ */ R(M, {
2089
2089
  value: "fields",
2090
2090
  className: "space-y-4 mt-4",
2091
- children: [/* @__PURE__ */ I("div", {
2091
+ children: [/* @__PURE__ */ R("div", {
2092
2092
  className: "flex items-center justify-between",
2093
- children: [/* @__PURE__ */ F(D, { children: "Report Fields" }), /* @__PURE__ */ I(d, {
2093
+ children: [/* @__PURE__ */ L(k, { children: "Report Fields" }), /* @__PURE__ */ R(p, {
2094
2094
  size: "sm",
2095
2095
  variant: "outline",
2096
2096
  onClick: w,
2097
2097
  disabled: u.length >= r.length,
2098
- children: [/* @__PURE__ */ F(W, { className: "h-4 w-4 mr-2" }), "Add Field"]
2098
+ children: [/* @__PURE__ */ L(W, { className: "h-4 w-4 mr-2" }), "Add Field"]
2099
2099
  })]
2100
- }), /* @__PURE__ */ I("div", {
2100
+ }), /* @__PURE__ */ R("div", {
2101
2101
  className: "space-y-2",
2102
- children: [u.map((e, t) => /* @__PURE__ */ F("div", {
2102
+ children: [u.map((e, t) => /* @__PURE__ */ L("div", {
2103
2103
  className: "flex items-center gap-2 p-3 border rounded-lg",
2104
- children: /* @__PURE__ */ I("div", {
2104
+ children: /* @__PURE__ */ R("div", {
2105
2105
  className: "flex-1 grid grid-cols-4 gap-2",
2106
2106
  children: [
2107
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(D, {
2107
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(k, {
2108
2108
  className: "text-xs",
2109
2109
  children: "Field Name"
2110
- }), /* @__PURE__ */ F("div", {
2110
+ }), /* @__PURE__ */ L("div", {
2111
2111
  className: "text-sm font-medium",
2112
2112
  children: e.name
2113
2113
  })] }),
2114
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(D, {
2114
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(k, {
2115
2115
  className: "text-xs",
2116
2116
  children: "Label"
2117
- }), /* @__PURE__ */ F(E, {
2117
+ }), /* @__PURE__ */ L(O, {
2118
2118
  className: "h-8 text-sm",
2119
2119
  value: e.label || e.name,
2120
- onChange: (n) => O(t, {
2120
+ onChange: (n) => E(t, {
2121
2121
  ...e,
2122
2122
  label: n.target.value
2123
2123
  })
2124
2124
  })] }),
2125
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(D, {
2125
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(k, {
2126
2126
  className: "text-xs",
2127
2127
  children: "Aggregation"
2128
- }), /* @__PURE__ */ I("select", {
2128
+ }), /* @__PURE__ */ R("select", {
2129
2129
  className: "w-full border rounded-md h-8 text-sm px-2",
2130
2130
  value: e.aggregation || "",
2131
- onChange: (n) => O(t, {
2131
+ onChange: (n) => E(t, {
2132
2132
  ...e,
2133
2133
  aggregation: n.target.value
2134
2134
  }),
2135
2135
  children: [
2136
- /* @__PURE__ */ F("option", {
2136
+ /* @__PURE__ */ L("option", {
2137
2137
  value: "",
2138
2138
  children: "None"
2139
2139
  }),
2140
- /* @__PURE__ */ F("option", {
2140
+ /* @__PURE__ */ L("option", {
2141
2141
  value: "sum",
2142
2142
  children: "Sum"
2143
2143
  }),
2144
- /* @__PURE__ */ F("option", {
2144
+ /* @__PURE__ */ L("option", {
2145
2145
  value: "count",
2146
2146
  children: "Count"
2147
2147
  }),
2148
- /* @__PURE__ */ F("option", {
2148
+ /* @__PURE__ */ L("option", {
2149
2149
  value: "avg",
2150
2150
  children: "Average"
2151
2151
  }),
2152
- /* @__PURE__ */ F("option", {
2152
+ /* @__PURE__ */ L("option", {
2153
2153
  value: "min",
2154
2154
  children: "Min"
2155
2155
  }),
2156
- /* @__PURE__ */ F("option", {
2156
+ /* @__PURE__ */ L("option", {
2157
2157
  value: "max",
2158
2158
  children: "Max"
2159
2159
  })
2160
2160
  ]
2161
2161
  })] }),
2162
- /* @__PURE__ */ F("div", {
2162
+ /* @__PURE__ */ L("div", {
2163
2163
  className: "flex items-end justify-end",
2164
- children: /* @__PURE__ */ F(d, {
2164
+ children: /* @__PURE__ */ L(p, {
2165
2165
  size: "sm",
2166
2166
  variant: "ghost",
2167
2167
  className: "text-red-500 hover:text-red-700 hover:bg-red-50",
2168
2168
  onClick: () => T(t),
2169
- children: /* @__PURE__ */ F(G, { className: "h-4 w-4" })
2169
+ children: /* @__PURE__ */ L(G, { className: "h-4 w-4" })
2170
2170
  })
2171
2171
  })
2172
2172
  ]
2173
2173
  })
2174
- }, t)), u.length === 0 && /* @__PURE__ */ F("div", {
2174
+ }, t)), u.length === 0 && /* @__PURE__ */ L("div", {
2175
2175
  className: "text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",
2176
2176
  children: "No fields selected. Click \"Add Field\" to begin."
2177
2177
  })]
2178
2178
  })]
2179
2179
  }),
2180
- /* @__PURE__ */ I(A, {
2180
+ /* @__PURE__ */ R(M, {
2181
2181
  value: "filters",
2182
2182
  className: "space-y-4 mt-4",
2183
- children: [/* @__PURE__ */ I("div", {
2183
+ children: [/* @__PURE__ */ R("div", {
2184
2184
  className: "flex items-center justify-between",
2185
- children: [/* @__PURE__ */ F(D, { children: "Report Filters" }), /* @__PURE__ */ I(d, {
2185
+ children: [/* @__PURE__ */ L(k, { children: "Report Filters" }), /* @__PURE__ */ R(p, {
2186
2186
  size: "sm",
2187
2187
  variant: "outline",
2188
- onClick: N,
2189
- children: [/* @__PURE__ */ F(W, { className: "h-4 w-4 mr-2" }), "Add Filter"]
2188
+ onClick: D,
2189
+ children: [/* @__PURE__ */ L(W, { className: "h-4 w-4 mr-2" }), "Add Filter"]
2190
2190
  })]
2191
- }), /* @__PURE__ */ I("div", {
2191
+ }), /* @__PURE__ */ R("div", {
2192
2192
  className: "space-y-2",
2193
- children: [v.map((e, t) => /* @__PURE__ */ I("div", {
2193
+ children: [f.map((e, t) => /* @__PURE__ */ R("div", {
2194
2194
  className: "flex items-center gap-2 p-3 border rounded-lg",
2195
- children: [/* @__PURE__ */ I("div", {
2195
+ children: [/* @__PURE__ */ R("div", {
2196
2196
  className: "flex-1 grid grid-cols-3 gap-2",
2197
2197
  children: [
2198
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(D, {
2198
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(k, {
2199
2199
  className: "text-xs",
2200
2200
  children: "Field"
2201
- }), /* @__PURE__ */ F("select", {
2201
+ }), /* @__PURE__ */ L("select", {
2202
2202
  className: "w-full border rounded-md h-8 text-sm px-2",
2203
2203
  value: e.field,
2204
- onChange: (n) => L(t, {
2204
+ onChange: (n) => P(t, {
2205
2205
  ...e,
2206
2206
  field: n.target.value
2207
2207
  }),
2208
- children: r.map((e, t) => /* @__PURE__ */ F("option", {
2208
+ children: r.map((e, t) => /* @__PURE__ */ L("option", {
2209
2209
  value: e.name,
2210
2210
  children: e.label || e.name
2211
2211
  }, t))
2212
2212
  })] }),
2213
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(D, {
2213
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(k, {
2214
2214
  className: "text-xs",
2215
2215
  children: "Operator"
2216
- }), /* @__PURE__ */ I("select", {
2216
+ }), /* @__PURE__ */ R("select", {
2217
2217
  className: "w-full border rounded-md h-8 text-sm px-2",
2218
2218
  value: e.operator,
2219
- onChange: (n) => L(t, {
2219
+ onChange: (n) => P(t, {
2220
2220
  ...e,
2221
2221
  operator: n.target.value
2222
2222
  }),
2223
2223
  children: [
2224
- /* @__PURE__ */ F("option", {
2224
+ /* @__PURE__ */ L("option", {
2225
2225
  value: "equals",
2226
2226
  children: "Equals"
2227
2227
  }),
2228
- /* @__PURE__ */ F("option", {
2228
+ /* @__PURE__ */ L("option", {
2229
2229
  value: "contains",
2230
2230
  children: "Contains"
2231
2231
  }),
2232
- /* @__PURE__ */ F("option", {
2232
+ /* @__PURE__ */ L("option", {
2233
2233
  value: "gt",
2234
2234
  children: "Greater Than"
2235
2235
  }),
2236
- /* @__PURE__ */ F("option", {
2236
+ /* @__PURE__ */ L("option", {
2237
2237
  value: "lt",
2238
2238
  children: "Less Than"
2239
2239
  }),
2240
- /* @__PURE__ */ F("option", {
2240
+ /* @__PURE__ */ L("option", {
2241
2241
  value: "between",
2242
2242
  children: "Between"
2243
2243
  })
2244
2244
  ]
2245
2245
  })] }),
2246
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(D, {
2246
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(k, {
2247
2247
  className: "text-xs",
2248
2248
  children: "Value"
2249
- }), /* @__PURE__ */ F(E, {
2249
+ }), /* @__PURE__ */ L(O, {
2250
2250
  className: "h-8 text-sm",
2251
2251
  value: String(e.value),
2252
- onChange: (n) => L(t, {
2252
+ onChange: (n) => P(t, {
2253
2253
  ...e,
2254
2254
  value: n.target.value
2255
2255
  })
2256
2256
  })] })
2257
2257
  ]
2258
- }), /* @__PURE__ */ F(d, {
2258
+ }), /* @__PURE__ */ L(p, {
2259
2259
  size: "sm",
2260
2260
  variant: "ghost",
2261
2261
  className: "text-red-500 hover:text-red-700 hover:bg-red-50 self-end",
2262
- onClick: () => ee(t),
2263
- children: /* @__PURE__ */ F(G, { className: "h-4 w-4" })
2262
+ onClick: () => A(t),
2263
+ children: /* @__PURE__ */ L(G, { className: "h-4 w-4" })
2264
2264
  })]
2265
- }, t)), v.length === 0 && /* @__PURE__ */ F("div", {
2265
+ }, t)), f.length === 0 && /* @__PURE__ */ L("div", {
2266
2266
  className: "text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",
2267
2267
  children: "No filters defined."
2268
2268
  })]
2269
2269
  })]
2270
2270
  }),
2271
- /* @__PURE__ */ I(A, {
2271
+ /* @__PURE__ */ R(M, {
2272
2272
  value: "grouping",
2273
2273
  className: "space-y-4 mt-4",
2274
- children: [/* @__PURE__ */ I("div", {
2274
+ children: [/* @__PURE__ */ R("div", {
2275
2275
  className: "flex items-center justify-between",
2276
- children: [/* @__PURE__ */ F(D, { children: "Grouping Rules" }), /* @__PURE__ */ I(d, {
2276
+ children: [/* @__PURE__ */ L(k, { children: "Grouping Rules" }), /* @__PURE__ */ R(p, {
2277
2277
  size: "sm",
2278
2278
  variant: "outline",
2279
- onClick: R,
2280
- children: [/* @__PURE__ */ F(W, { className: "h-4 w-4 mr-2" }), "Add Group"]
2279
+ onClick: F,
2280
+ children: [/* @__PURE__ */ L(W, { className: "h-4 w-4 mr-2" }), "Add Group"]
2281
2281
  })]
2282
- }), /* @__PURE__ */ I("div", {
2282
+ }), /* @__PURE__ */ R("div", {
2283
2283
  className: "space-y-2",
2284
- children: [b.map((e, t) => /* @__PURE__ */ I("div", {
2284
+ children: [b.map((e, t) => /* @__PURE__ */ R("div", {
2285
2285
  className: "flex items-center gap-2 p-3 border rounded-lg",
2286
- children: [/* @__PURE__ */ I("div", {
2286
+ children: [/* @__PURE__ */ R("div", {
2287
2287
  className: "flex-1 grid grid-cols-2 gap-2",
2288
- children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(D, {
2288
+ children: [/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(k, {
2289
2289
  className: "text-xs",
2290
2290
  children: "Field"
2291
- }), /* @__PURE__ */ F("select", {
2291
+ }), /* @__PURE__ */ L("select", {
2292
2292
  className: "w-full border rounded-md h-8 text-sm px-2",
2293
2293
  value: e.field,
2294
2294
  onChange: (n) => B(t, {
2295
2295
  ...e,
2296
2296
  field: n.target.value
2297
2297
  }),
2298
- children: r.map((e, t) => /* @__PURE__ */ F("option", {
2298
+ children: r.map((e, t) => /* @__PURE__ */ L("option", {
2299
2299
  value: e.name,
2300
2300
  children: e.label || e.name
2301
2301
  }, t))
2302
- })] }), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(D, {
2302
+ })] }), /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(k, {
2303
2303
  className: "text-xs",
2304
2304
  children: "Sort Order"
2305
- }), /* @__PURE__ */ I("select", {
2305
+ }), /* @__PURE__ */ R("select", {
2306
2306
  className: "w-full border rounded-md h-8 text-sm px-2",
2307
2307
  value: e.sort || "asc",
2308
2308
  onChange: (n) => B(t, {
2309
2309
  ...e,
2310
2310
  sort: n.target.value
2311
2311
  }),
2312
- children: [/* @__PURE__ */ F("option", {
2312
+ children: [/* @__PURE__ */ L("option", {
2313
2313
  value: "asc",
2314
2314
  children: "Ascending"
2315
- }), /* @__PURE__ */ F("option", {
2315
+ }), /* @__PURE__ */ L("option", {
2316
2316
  value: "desc",
2317
2317
  children: "Descending"
2318
2318
  })]
2319
2319
  })] })]
2320
- }), /* @__PURE__ */ F(d, {
2320
+ }), /* @__PURE__ */ L(p, {
2321
2321
  size: "sm",
2322
2322
  variant: "ghost",
2323
2323
  className: "text-red-500 hover:text-red-700 hover:bg-red-50 self-end",
2324
2324
  onClick: () => z(t),
2325
- children: /* @__PURE__ */ F(G, { className: "h-4 w-4" })
2325
+ children: /* @__PURE__ */ L(G, { className: "h-4 w-4" })
2326
2326
  })]
2327
- }, t)), b.length === 0 && /* @__PURE__ */ F("div", {
2327
+ }, t)), b.length === 0 && /* @__PURE__ */ L("div", {
2328
2328
  className: "text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",
2329
2329
  children: "No grouping rules applied."
2330
2330
  })]
2331
2331
  })]
2332
2332
  }),
2333
- /* @__PURE__ */ I(A, {
2333
+ /* @__PURE__ */ R(M, {
2334
2334
  value: "sections",
2335
2335
  className: "space-y-4 mt-4",
2336
- children: [/* @__PURE__ */ I("div", {
2336
+ children: [/* @__PURE__ */ R("div", {
2337
2337
  className: "flex items-center justify-between",
2338
- children: [/* @__PURE__ */ F(D, { children: "Report Sections" }), /* @__PURE__ */ I("div", {
2338
+ children: [/* @__PURE__ */ L(k, { children: "Report Sections" }), /* @__PURE__ */ R("div", {
2339
2339
  className: "flex gap-2",
2340
2340
  children: [
2341
- /* @__PURE__ */ I(d, {
2341
+ /* @__PURE__ */ R(p, {
2342
2342
  size: "sm",
2343
2343
  variant: "outline",
2344
2344
  onClick: () => V("header"),
2345
- children: [/* @__PURE__ */ F(W, { className: "h-4 w-4 mr-2" }), "Header"]
2345
+ children: [/* @__PURE__ */ L(W, { className: "h-4 w-4 mr-2" }), "Header"]
2346
2346
  }),
2347
- /* @__PURE__ */ I(d, {
2347
+ /* @__PURE__ */ R(p, {
2348
2348
  size: "sm",
2349
2349
  variant: "outline",
2350
2350
  onClick: () => V("chart"),
2351
- children: [/* @__PURE__ */ F(W, { className: "h-4 w-4 mr-2" }), "Chart"]
2351
+ children: [/* @__PURE__ */ L(W, { className: "h-4 w-4 mr-2" }), "Chart"]
2352
2352
  }),
2353
- /* @__PURE__ */ I(d, {
2353
+ /* @__PURE__ */ R(p, {
2354
2354
  size: "sm",
2355
2355
  variant: "outline",
2356
2356
  onClick: () => V("table"),
2357
- children: [/* @__PURE__ */ F(W, { className: "h-4 w-4 mr-2" }), "Table"]
2357
+ children: [/* @__PURE__ */ L(W, { className: "h-4 w-4 mr-2" }), "Table"]
2358
2358
  })
2359
2359
  ]
2360
2360
  })]
2361
- }), /* @__PURE__ */ I("div", {
2361
+ }), /* @__PURE__ */ R("div", {
2362
2362
  className: "space-y-2",
2363
- children: [S.map((e, t) => /* @__PURE__ */ I("div", {
2363
+ children: [S.map((e, t) => /* @__PURE__ */ R("div", {
2364
2364
  className: "p-3 border rounded-lg space-y-2",
2365
- children: [/* @__PURE__ */ I("div", {
2365
+ children: [/* @__PURE__ */ R("div", {
2366
2366
  className: "flex items-center justify-between",
2367
- children: [/* @__PURE__ */ I("div", {
2367
+ children: [/* @__PURE__ */ R("div", {
2368
2368
  className: "font-medium flex items-center gap-2",
2369
- children: [/* @__PURE__ */ F("div", {
2369
+ children: [/* @__PURE__ */ L("div", {
2370
2370
  className: "text-xs bg-muted px-2 py-0.5 rounded uppercase",
2371
2371
  children: e.type
2372
2372
  }), e.title]
2373
- }), /* @__PURE__ */ F(d, {
2373
+ }), /* @__PURE__ */ L(p, {
2374
2374
  size: "sm",
2375
2375
  variant: "ghost",
2376
2376
  className: "text-red-500 hover:text-red-700 hover:bg-red-50",
2377
2377
  onClick: () => H(t),
2378
- children: /* @__PURE__ */ F(G, { className: "h-4 w-4" })
2378
+ children: /* @__PURE__ */ L(G, { className: "h-4 w-4" })
2379
2379
  })]
2380
- }), /* @__PURE__ */ I("div", {
2380
+ }), /* @__PURE__ */ R("div", {
2381
2381
  className: "grid grid-cols-2 gap-2",
2382
2382
  children: [
2383
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(D, {
2383
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(k, {
2384
2384
  className: "text-xs",
2385
2385
  children: "Title"
2386
- }), /* @__PURE__ */ F(E, {
2386
+ }), /* @__PURE__ */ L(O, {
2387
2387
  className: "h-8 text-sm",
2388
2388
  value: e.title || "",
2389
2389
  onChange: (n) => U(t, {
@@ -2391,12 +2391,12 @@ var pt = ({ schema: t, onRefresh: r }) => {
2391
2391
  title: n.target.value
2392
2392
  })
2393
2393
  })] }),
2394
- e.type === "text" && /* @__PURE__ */ I("div", {
2394
+ e.type === "text" && /* @__PURE__ */ R("div", {
2395
2395
  className: "col-span-2",
2396
- children: [/* @__PURE__ */ F(D, {
2396
+ children: [/* @__PURE__ */ L(k, {
2397
2397
  className: "text-xs",
2398
2398
  children: "Content"
2399
- }), /* @__PURE__ */ F(E, {
2399
+ }), /* @__PURE__ */ L(O, {
2400
2400
  className: "h-8 text-sm",
2401
2401
  value: e.text || "",
2402
2402
  onChange: (n) => U(t, {
@@ -2405,20 +2405,20 @@ var pt = ({ schema: t, onRefresh: r }) => {
2405
2405
  })
2406
2406
  })]
2407
2407
  }),
2408
- e.type === "chart" && /* @__PURE__ */ I("div", {
2408
+ e.type === "chart" && /* @__PURE__ */ R("div", {
2409
2409
  className: "col-span-2 grid grid-cols-2 gap-2 mt-2 p-2 bg-muted/20 rounded",
2410
2410
  children: [
2411
- /* @__PURE__ */ F("div", {
2411
+ /* @__PURE__ */ L("div", {
2412
2412
  className: "col-span-2",
2413
- children: /* @__PURE__ */ F(D, {
2413
+ children: /* @__PURE__ */ L(k, {
2414
2414
  className: "text-xs font-semibold",
2415
2415
  children: "Chart Configuration"
2416
2416
  })
2417
2417
  }),
2418
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(D, {
2418
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(k, {
2419
2419
  className: "text-xs",
2420
2420
  children: "Chart Type"
2421
- }), /* @__PURE__ */ I("select", {
2421
+ }), /* @__PURE__ */ R("select", {
2422
2422
  className: "flex h-8 w-full rounded-md border border-input bg-background px-3 py-1 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
2423
2423
  value: e.chart?.chartType || "bar",
2424
2424
  onChange: (n) => U(t, {
@@ -2430,28 +2430,28 @@ var pt = ({ schema: t, onRefresh: r }) => {
2430
2430
  }
2431
2431
  }),
2432
2432
  children: [
2433
- /* @__PURE__ */ F("option", {
2433
+ /* @__PURE__ */ L("option", {
2434
2434
  value: "bar",
2435
2435
  children: "Bar"
2436
2436
  }),
2437
- /* @__PURE__ */ F("option", {
2437
+ /* @__PURE__ */ L("option", {
2438
2438
  value: "line",
2439
2439
  children: "Line"
2440
2440
  }),
2441
- /* @__PURE__ */ F("option", {
2441
+ /* @__PURE__ */ L("option", {
2442
2442
  value: "area",
2443
2443
  children: "Area"
2444
2444
  }),
2445
- /* @__PURE__ */ F("option", {
2445
+ /* @__PURE__ */ L("option", {
2446
2446
  value: "pie",
2447
2447
  children: "Pie"
2448
2448
  })
2449
2449
  ]
2450
2450
  })] }),
2451
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(D, {
2451
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(k, {
2452
2452
  className: "text-xs",
2453
2453
  children: "X-Axis Field"
2454
- }), /* @__PURE__ */ I("select", {
2454
+ }), /* @__PURE__ */ R("select", {
2455
2455
  className: "flex h-8 w-full rounded-md border border-input bg-background px-3 py-1 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
2456
2456
  value: e.chart?.xAxisField || "",
2457
2457
  onChange: (n) => U(t, {
@@ -2463,29 +2463,29 @@ var pt = ({ schema: t, onRefresh: r }) => {
2463
2463
  }
2464
2464
  }),
2465
2465
  children: [
2466
- /* @__PURE__ */ F("option", {
2466
+ /* @__PURE__ */ L("option", {
2467
2467
  value: "",
2468
2468
  children: "Select Field..."
2469
2469
  }),
2470
- r.map((e) => /* @__PURE__ */ F("option", {
2470
+ r.map((e) => /* @__PURE__ */ L("option", {
2471
2471
  value: e.name,
2472
2472
  children: e.label || e.name
2473
2473
  }, e.name)),
2474
- r.length === 0 && /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("option", {
2474
+ r.length === 0 && /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("option", {
2475
2475
  value: "name",
2476
2476
  children: "Name"
2477
- }), /* @__PURE__ */ F("option", {
2477
+ }), /* @__PURE__ */ L("option", {
2478
2478
  value: "month",
2479
2479
  children: "Month"
2480
2480
  })] })
2481
2481
  ]
2482
2482
  })] }),
2483
- /* @__PURE__ */ I("div", {
2483
+ /* @__PURE__ */ R("div", {
2484
2484
  className: "col-span-2",
2485
- children: [/* @__PURE__ */ F(D, {
2485
+ children: [/* @__PURE__ */ L(k, {
2486
2486
  className: "text-xs",
2487
2487
  children: "Y-Axis Fields (comma separated)"
2488
- }), /* @__PURE__ */ F(E, {
2488
+ }), /* @__PURE__ */ L(O, {
2489
2489
  className: "h-8 text-sm",
2490
2490
  placeholder: "e.g. value, count",
2491
2491
  value: e.chart?.yAxisFields?.join(", ") || "",
@@ -2503,16 +2503,16 @@ var pt = ({ schema: t, onRefresh: r }) => {
2503
2503
  })
2504
2504
  ]
2505
2505
  })]
2506
- }, t)), S.length === 0 && /* @__PURE__ */ F("div", {
2506
+ }, t)), S.length === 0 && /* @__PURE__ */ L("div", {
2507
2507
  className: "text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",
2508
2508
  children: "No customized sections. The default report layout will be used."
2509
2509
  })]
2510
2510
  })]
2511
2511
  }),
2512
- /* @__PURE__ */ F(A, {
2512
+ /* @__PURE__ */ L(M, {
2513
2513
  value: "schedule",
2514
2514
  className: "space-y-4 mt-4",
2515
- children: /* @__PURE__ */ F(mt, {
2515
+ children: /* @__PURE__ */ L(ht, {
2516
2516
  schedule: c.schedule,
2517
2517
  onChange: (e) => l({
2518
2518
  ...c,
@@ -2521,36 +2521,36 @@ var pt = ({ schema: t, onRefresh: r }) => {
2521
2521
  })
2522
2522
  })
2523
2523
  ]
2524
- }), /* @__PURE__ */ I("div", {
2524
+ }), /* @__PURE__ */ R("div", {
2525
2525
  className: "flex items-center justify-end gap-2 mt-6 pt-4 border-t",
2526
- children: [/* @__PURE__ */ F(d, {
2526
+ children: [/* @__PURE__ */ L(p, {
2527
2527
  variant: "outline",
2528
2528
  onClick: () => {
2529
2529
  o && console.log("Report cancelled:", o);
2530
2530
  },
2531
2531
  children: "Cancel"
2532
- }), /* @__PURE__ */ I(d, {
2532
+ }), /* @__PURE__ */ R(p, {
2533
2533
  onClick: () => {
2534
2534
  console.log("Saving report:", c), a && alert("Report saved! (Handler: " + a + ")");
2535
2535
  },
2536
- children: [/* @__PURE__ */ F(de, { className: "h-4 w-4 mr-2" }), "Save Report"]
2536
+ children: [/* @__PURE__ */ L(fe, { className: "h-4 w-4 mr-2" }), "Save Report"]
2537
2537
  })]
2538
- })] })] }), i && /* @__PURE__ */ I(f, {
2538
+ })] })] }), i && /* @__PURE__ */ R(m, {
2539
2539
  className: "mt-8 border-2 border-blue-100",
2540
- children: [/* @__PURE__ */ F(h, {
2540
+ children: [/* @__PURE__ */ L(_, {
2541
2541
  className: "bg-blue-50/50",
2542
- children: /* @__PURE__ */ F(g, {
2542
+ children: /* @__PURE__ */ L(v, {
2543
2543
  className: "text-blue-900 text-sm uppercase tracking-wide",
2544
2544
  children: "Live Preview"
2545
2545
  })
2546
- }), /* @__PURE__ */ F(p, {
2546
+ }), /* @__PURE__ */ L(h, {
2547
2547
  className: "pt-6",
2548
- children: /* @__PURE__ */ F(pt, { schema: {
2548
+ children: /* @__PURE__ */ L(mt, { schema: {
2549
2549
  type: "report-viewer",
2550
2550
  report: {
2551
2551
  ...c,
2552
2552
  fields: u,
2553
- filters: v,
2553
+ filters: f,
2554
2554
  groupBy: b,
2555
2555
  sections: S
2556
2556
  },
@@ -2578,12 +2578,12 @@ var pt = ({ schema: t, onRefresh: r }) => {
2578
2578
  })]
2579
2579
  })]
2580
2580
  });
2581
- }, gt = [
2581
+ }, _t = [
2582
2582
  "tabular",
2583
2583
  "summary",
2584
2584
  "matrix"
2585
2585
  ];
2586
- function _t(e) {
2586
+ function vt(e) {
2587
2587
  let t = e.length + 1, n = new Set(e.map((e) => e.name).filter(Boolean)), r = `block_${t}`;
2588
2588
  for (; n.has(r);) t += 1, r = `block_${t}`;
2589
2589
  return {
@@ -2592,36 +2592,36 @@ function _t(e) {
2592
2592
  columns: []
2593
2593
  };
2594
2594
  }
2595
- function vt(e) {
2595
+ function yt(e) {
2596
2596
  return typeof e.label == "string" ? e.label : e.label && typeof e.label == "object" ? e.label.default ?? "" : "";
2597
2597
  }
2598
- function yt(e) {
2598
+ function bt(e) {
2599
2599
  return typeof e.description == "string" ? e.description : e.description && typeof e.description == "object" ? e.description.default ?? "" : "";
2600
2600
  }
2601
- function bt({ block: e, index: n, total: r, availableFields: i, t: a, duplicateName: o, onChange: s, onRemove: c, onMove: l }) {
2602
- let [u, f] = t.useState(n === 0), p = e.type ?? "tabular", m = p === "summary", h = p === "matrix", g = m || h, _ = !e.name || !e.name.trim(), v = _ || o, y = (t) => s({
2601
+ function xt({ block: e, index: n, total: r, availableFields: i, t: a, duplicateName: o, onChange: s, onRemove: c, onMove: l }) {
2602
+ let [u, d] = t.useState(n === 0), f = e.type ?? "tabular", m = f === "summary", h = f === "matrix", g = m || h, _ = !e.name || !e.name.trim(), v = _ || o, y = (t) => s({
2603
2603
  ...e,
2604
2604
  ...t
2605
2605
  });
2606
- return /* @__PURE__ */ I("div", {
2606
+ return /* @__PURE__ */ R("div", {
2607
2607
  className: "border rounded-md bg-card text-card-foreground",
2608
2608
  "data-testid": `joined-block-${n}`,
2609
2609
  children: [
2610
- /* @__PURE__ */ I("div", {
2610
+ /* @__PURE__ */ R("div", {
2611
2611
  className: "flex items-center gap-1 p-1.5 border-b bg-muted/30",
2612
2612
  children: [
2613
- /* @__PURE__ */ F(d, {
2613
+ /* @__PURE__ */ L(p, {
2614
2614
  type: "button",
2615
2615
  size: "sm",
2616
2616
  variant: "ghost",
2617
2617
  className: "h-6 w-6 p-0 shrink-0",
2618
- onClick: () => f((e) => !e),
2618
+ onClick: () => d((e) => !e),
2619
2619
  "aria-label": u ? "Collapse block" : "Expand block",
2620
2620
  "aria-expanded": u,
2621
2621
  "data-testid": `joined-block-toggle-${n}`,
2622
- children: F(u ? ne : re, { className: "h-3.5 w-3.5" })
2622
+ children: L(u ? re : ie, { className: "h-3.5 w-3.5" })
2623
2623
  }),
2624
- /* @__PURE__ */ F("input", {
2624
+ /* @__PURE__ */ L("input", {
2625
2625
  type: "text",
2626
2626
  className: `h-6 text-xs border rounded px-1.5 bg-background flex-1 min-w-0 ${v ? "border-destructive" : ""}`,
2627
2627
  value: e.name ?? "",
@@ -2631,36 +2631,36 @@ function bt({ block: e, index: n, total: r, availableFields: i, t: a, duplicateN
2631
2631
  "aria-invalid": v,
2632
2632
  "data-testid": `joined-block-name-${n}`
2633
2633
  }),
2634
- /* @__PURE__ */ F("select", {
2634
+ /* @__PURE__ */ L("select", {
2635
2635
  className: "h-6 text-xs border rounded px-1 bg-background shrink-0",
2636
- value: p,
2636
+ value: f,
2637
2637
  onChange: (e) => y({ type: e.target.value }),
2638
2638
  "aria-label": a("report.editor.type"),
2639
2639
  "data-testid": `joined-block-type-${n}`,
2640
- children: gt.map((e) => /* @__PURE__ */ F("option", {
2640
+ children: _t.map((e) => /* @__PURE__ */ L("option", {
2641
2641
  value: e,
2642
2642
  children: a(`report.editor.type${e.charAt(0).toUpperCase()}${e.slice(1)}`)
2643
2643
  }, e))
2644
2644
  }),
2645
- /* @__PURE__ */ I("div", {
2645
+ /* @__PURE__ */ R("div", {
2646
2646
  className: "flex flex-col gap-0.5 shrink-0",
2647
- children: [/* @__PURE__ */ F("button", {
2647
+ children: [/* @__PURE__ */ L("button", {
2648
2648
  type: "button",
2649
2649
  className: "text-muted-foreground hover:text-foreground disabled:opacity-30",
2650
2650
  disabled: n === 0,
2651
2651
  onClick: () => l(-1),
2652
2652
  "aria-label": "Move block up",
2653
- children: /* @__PURE__ */ F(U, { className: "h-2.5 w-2.5" })
2654
- }), /* @__PURE__ */ F("button", {
2653
+ children: /* @__PURE__ */ L(te, { className: "h-2.5 w-2.5" })
2654
+ }), /* @__PURE__ */ L("button", {
2655
2655
  type: "button",
2656
2656
  className: "text-muted-foreground hover:text-foreground disabled:opacity-30",
2657
2657
  disabled: n === r - 1,
2658
2658
  onClick: () => l(1),
2659
2659
  "aria-label": "Move block down",
2660
- children: /* @__PURE__ */ F(H, { className: "h-2.5 w-2.5" })
2660
+ children: /* @__PURE__ */ L(U, { className: "h-2.5 w-2.5" })
2661
2661
  })]
2662
2662
  }),
2663
- /* @__PURE__ */ F(d, {
2663
+ /* @__PURE__ */ L(p, {
2664
2664
  type: "button",
2665
2665
  size: "sm",
2666
2666
  variant: "ghost",
@@ -2668,38 +2668,38 @@ function bt({ block: e, index: n, total: r, availableFields: i, t: a, duplicateN
2668
2668
  onClick: c,
2669
2669
  "aria-label": a("report.editor.removeBlock"),
2670
2670
  "data-testid": `joined-block-remove-${n}`,
2671
- children: /* @__PURE__ */ F(G, { className: "h-3 w-3" })
2671
+ children: /* @__PURE__ */ L(G, { className: "h-3 w-3" })
2672
2672
  })
2673
2673
  ]
2674
2674
  }),
2675
- v && /* @__PURE__ */ I("div", {
2675
+ v && /* @__PURE__ */ R("div", {
2676
2676
  className: "flex items-center gap-1 px-2 py-1 text-[10px] text-destructive bg-destructive/5 border-b",
2677
- children: [/* @__PURE__ */ F(V, { className: "h-3 w-3" }), a(_ ? "report.editor.validationBlockNameRequired" : "report.editor.validationBlockNameDuplicate")]
2677
+ children: [/* @__PURE__ */ L(H, { className: "h-3 w-3" }), a(_ ? "report.editor.validationBlockNameRequired" : "report.editor.validationBlockNameDuplicate")]
2678
2678
  }),
2679
- u && /* @__PURE__ */ I("div", {
2679
+ u && /* @__PURE__ */ R("div", {
2680
2680
  className: "p-2 space-y-2 text-xs",
2681
2681
  children: [
2682
- /* @__PURE__ */ I("div", {
2682
+ /* @__PURE__ */ R("div", {
2683
2683
  className: "grid grid-cols-2 gap-2",
2684
- children: [/* @__PURE__ */ I("label", {
2684
+ children: [/* @__PURE__ */ R("label", {
2685
2685
  className: "flex flex-col gap-0.5",
2686
- children: [/* @__PURE__ */ F("span", {
2686
+ children: [/* @__PURE__ */ L("span", {
2687
2687
  className: "text-[10px] text-muted-foreground",
2688
2688
  children: a("report.editor.blockLabel")
2689
- }), /* @__PURE__ */ F("input", {
2689
+ }), /* @__PURE__ */ L("input", {
2690
2690
  type: "text",
2691
2691
  className: "h-6 text-xs border rounded px-1.5 bg-background",
2692
- value: vt(e),
2692
+ value: yt(e),
2693
2693
  onChange: (e) => y({ label: e.target.value || void 0 }),
2694
2694
  placeholder: a("report.editor.blockLabelPlaceholder"),
2695
2695
  "data-testid": `joined-block-label-${n}`
2696
2696
  })]
2697
- }), /* @__PURE__ */ I("label", {
2697
+ }), /* @__PURE__ */ R("label", {
2698
2698
  className: "flex flex-col gap-0.5",
2699
- children: [/* @__PURE__ */ F("span", {
2699
+ children: [/* @__PURE__ */ L("span", {
2700
2700
  className: "text-[10px] text-muted-foreground",
2701
2701
  children: a("report.editor.objectName")
2702
- }), /* @__PURE__ */ F("input", {
2702
+ }), /* @__PURE__ */ L("input", {
2703
2703
  type: "text",
2704
2704
  className: "h-6 text-xs border rounded px-1.5 bg-background",
2705
2705
  value: e.objectName ?? "",
@@ -2709,62 +2709,62 @@ function bt({ block: e, index: n, total: r, availableFields: i, t: a, duplicateN
2709
2709
  })]
2710
2710
  })]
2711
2711
  }),
2712
- /* @__PURE__ */ I("label", {
2712
+ /* @__PURE__ */ R("label", {
2713
2713
  className: "flex flex-col gap-0.5",
2714
- children: [/* @__PURE__ */ F("span", {
2714
+ children: [/* @__PURE__ */ L("span", {
2715
2715
  className: "text-[10px] text-muted-foreground",
2716
2716
  children: a("report.editor.blockDescription")
2717
- }), /* @__PURE__ */ F("textarea", {
2717
+ }), /* @__PURE__ */ L("textarea", {
2718
2718
  className: "text-xs border rounded px-1.5 py-1 bg-background resize-y min-h-[2rem]",
2719
2719
  rows: 2,
2720
- value: yt(e),
2720
+ value: bt(e),
2721
2721
  onChange: (e) => y({ description: e.target.value || void 0 }),
2722
2722
  placeholder: a("report.editor.blockDescriptionPlaceholder"),
2723
2723
  "data-testid": `joined-block-description-${n}`
2724
2724
  })]
2725
2725
  }),
2726
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("div", {
2726
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("div", {
2727
2727
  className: "text-[10px] text-muted-foreground mb-0.5",
2728
2728
  children: a("report.editor.columns")
2729
- }), /* @__PURE__ */ F(zt, {
2729
+ }), /* @__PURE__ */ L(Bt, {
2730
2730
  availableFields: i,
2731
2731
  value: e.columns,
2732
2732
  onChange: (e) => y({ columns: e }),
2733
2733
  t: a
2734
2734
  })] }),
2735
- (m || h) && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("div", {
2735
+ (m || h) && /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("div", {
2736
2736
  className: "text-[10px] text-muted-foreground mb-0.5",
2737
2737
  children: a("report.editor.rows")
2738
- }), /* @__PURE__ */ F(Bt, {
2738
+ }), /* @__PURE__ */ L(Vt, {
2739
2739
  availableFields: i,
2740
2740
  value: e.groupingsDown,
2741
2741
  onChange: (e) => y({ groupingsDown: e }),
2742
2742
  t: a
2743
2743
  })] }),
2744
- h && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("div", {
2744
+ h && /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("div", {
2745
2745
  className: "text-[10px] text-muted-foreground mb-0.5",
2746
2746
  children: a("report.editor.columnsAxis")
2747
- }), /* @__PURE__ */ F(Bt, {
2747
+ }), /* @__PURE__ */ L(Vt, {
2748
2748
  availableFields: i,
2749
2749
  value: e.groupingsAcross,
2750
2750
  onChange: (e) => y({ groupingsAcross: e }),
2751
2751
  t: a
2752
2752
  })] }),
2753
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("div", {
2753
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("div", {
2754
2754
  className: "text-[10px] text-muted-foreground mb-0.5",
2755
2755
  children: a("report.editor.filters")
2756
- }), /* @__PURE__ */ F(Mt, {
2756
+ }), /* @__PURE__ */ L(Nt, {
2757
2757
  availableFields: i,
2758
2758
  value: e.filter,
2759
2759
  onChange: (e) => y({ filter: e }),
2760
2760
  t: a
2761
2761
  })] }),
2762
- g && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("div", {
2762
+ g && /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("div", {
2763
2763
  className: "text-[10px] text-muted-foreground mb-0.5",
2764
2764
  children: a("report.editor.chart")
2765
- }), /* @__PURE__ */ F(Vt, {
2765
+ }), /* @__PURE__ */ L(Ht, {
2766
2766
  availableFields: i,
2767
- columns: Rt(e.columns),
2767
+ columns: zt(e.columns),
2768
2768
  value: e.chart,
2769
2769
  onChange: (e) => y({ chart: e }),
2770
2770
  t: a
@@ -2774,7 +2774,7 @@ function bt({ block: e, index: n, total: r, availableFields: i, t: a, duplicateN
2774
2774
  ]
2775
2775
  });
2776
2776
  }
2777
- function xt(e) {
2777
+ function St(e) {
2778
2778
  return Array.isArray(e) ? e.map((e) => {
2779
2779
  let t = e ?? {};
2780
2780
  return {
@@ -2785,28 +2785,28 @@ function xt(e) {
2785
2785
  };
2786
2786
  }) : [];
2787
2787
  }
2788
- function St({ value: e, onChange: t, availableFields: n, getFieldsForObject: r, containerObjectName: i, t: a }) {
2789
- let o = xt(e), s = (e) => r ? r(e.objectName ?? i) ?? n : n, c = {};
2788
+ function Ct({ value: e, onChange: t, availableFields: n, getFieldsForObject: r, containerObjectName: i, t: a }) {
2789
+ let o = St(e), s = (e) => r ? r(e.objectName ?? i) ?? n : n, c = {};
2790
2790
  for (let e of o) e.name && (c[e.name] = (c[e.name] ?? 0) + 1);
2791
2791
  let l = (e, n) => {
2792
2792
  t(o.map((t, r) => r === e ? n : t));
2793
2793
  }, u = (e) => {
2794
2794
  t(o.filter((t, n) => n !== e));
2795
- }, f = (e, n) => {
2795
+ }, d = (e, n) => {
2796
2796
  let r = e + n;
2797
2797
  if (r < 0 || r >= o.length) return;
2798
2798
  let i = [...o];
2799
2799
  [i[e], i[r]] = [i[r], i[e]], t(i);
2800
2800
  };
2801
- return /* @__PURE__ */ I("div", {
2801
+ return /* @__PURE__ */ R("div", {
2802
2802
  className: "space-y-2",
2803
2803
  "data-testid": "joined-blocks-editor",
2804
2804
  children: [
2805
- o.length === 0 && /* @__PURE__ */ F("div", {
2805
+ o.length === 0 && /* @__PURE__ */ L("div", {
2806
2806
  className: "text-[10px] text-muted-foreground italic px-1",
2807
2807
  children: a("report.editor.validationJoinedNeedsBlocks")
2808
2808
  }),
2809
- o.map((e, t) => /* @__PURE__ */ F(bt, {
2809
+ o.map((e, t) => /* @__PURE__ */ L(xt, {
2810
2810
  block: e,
2811
2811
  index: t,
2812
2812
  total: o.length,
@@ -2815,23 +2815,23 @@ function St({ value: e, onChange: t, availableFields: n, getFieldsForObject: r,
2815
2815
  duplicateName: !!e.name && (c[e.name] ?? 0) > 1,
2816
2816
  onChange: (e) => l(t, e),
2817
2817
  onRemove: () => u(t),
2818
- onMove: (e) => f(t, e)
2818
+ onMove: (e) => d(t, e)
2819
2819
  }, t)),
2820
- /* @__PURE__ */ I(d, {
2820
+ /* @__PURE__ */ R(p, {
2821
2821
  type: "button",
2822
2822
  size: "sm",
2823
2823
  variant: "outline",
2824
2824
  className: "h-7 text-xs w-full",
2825
2825
  onClick: () => {
2826
- t([...o, _t(o)]);
2826
+ t([...o, vt(o)]);
2827
2827
  },
2828
2828
  "data-testid": "joined-block-add",
2829
- children: [/* @__PURE__ */ F(W, { className: "h-3 w-3 mr-1" }), a("report.editor.addBlock")]
2829
+ children: [/* @__PURE__ */ L(W, { className: "h-3 w-3 mr-1" }), a("report.editor.addBlock")]
2830
2830
  })
2831
2831
  ]
2832
2832
  });
2833
2833
  }
2834
- function Ct(e, t) {
2834
+ function wt(e, t) {
2835
2835
  let n = [];
2836
2836
  if (!Array.isArray(e) || e.length === 0) return n.push(t("report.editor.validationJoinedNeedsBlocks")), n;
2837
2837
  let r = /* @__PURE__ */ new Map(), i = !1, a = !1, o = !1;
@@ -2848,7 +2848,7 @@ function Ct(e, t) {
2848
2848
  }
2849
2849
  //#endregion
2850
2850
  //#region src/specFilterAdapter.tsx
2851
- var wt = {
2851
+ var Tt = {
2852
2852
  $eq: "equals",
2853
2853
  $ne: "notEquals",
2854
2854
  $gt: "greaterThan",
@@ -2860,7 +2860,7 @@ var wt = {
2860
2860
  $contains: "contains",
2861
2861
  $notContains: "notContains",
2862
2862
  $exists: "isNotEmpty"
2863
- }, Tt = {
2863
+ }, Et = {
2864
2864
  equals: "$eq",
2865
2865
  notEquals: "$ne",
2866
2866
  greaterThan: "$gt",
@@ -2871,18 +2871,18 @@ var wt = {
2871
2871
  notIn: "$nin",
2872
2872
  contains: "$contains",
2873
2873
  notContains: "$notContains"
2874
- }, Et = () => ({
2874
+ }, Dt = () => ({
2875
2875
  id: "root",
2876
2876
  logic: "and",
2877
2877
  conditions: []
2878
2878
  });
2879
- function Dt(e) {
2879
+ function Ot(e) {
2880
2880
  return !!e && typeof e == "object" && !Array.isArray(e);
2881
2881
  }
2882
2882
  function $() {
2883
2883
  return Math.random().toString(36).slice(2, 10);
2884
2884
  }
2885
- function Ot(e, t) {
2885
+ function kt(e, t) {
2886
2886
  if (typeof t != "object" || !t || Array.isArray(t)) return [{
2887
2887
  id: $(),
2888
2888
  field: e,
@@ -2909,8 +2909,8 @@ function Ot(e, t) {
2909
2909
  });
2910
2910
  continue;
2911
2911
  }
2912
- let t = wt[r];
2913
- if (!t || Dt(i) && "$field" in i) return null;
2912
+ let t = Tt[r];
2913
+ if (!t || Ot(i) && "$field" in i) return null;
2914
2914
  n.push({
2915
2915
  id: $(),
2916
2916
  field: e,
@@ -2920,25 +2920,25 @@ function Ot(e, t) {
2920
2920
  }
2921
2921
  return n.length > 0 ? n : null;
2922
2922
  }
2923
- function kt(e) {
2923
+ function At(e) {
2924
2924
  if (e == null) return {
2925
- group: Et(),
2925
+ group: Dt(),
2926
2926
  complex: !1
2927
2927
  };
2928
- if (!Dt(e)) return {
2929
- group: Et(),
2928
+ if (!Ot(e)) return {
2929
+ group: Dt(),
2930
2930
  complex: !0
2931
2931
  };
2932
2932
  let t = Object.keys(e);
2933
2933
  if (t.length === 1 && (t[0] === "$and" || t[0] === "$or")) {
2934
2934
  let n = t[0] === "$or" ? "or" : "and", r = e[t[0]];
2935
2935
  if (!Array.isArray(r)) return {
2936
- group: Et(),
2936
+ group: Dt(),
2937
2937
  complex: !0
2938
2938
  };
2939
2939
  let i = [], a = !1;
2940
2940
  for (let e of r) {
2941
- if (!Dt(e)) {
2941
+ if (!Ot(e)) {
2942
2942
  a = !0;
2943
2943
  continue;
2944
2944
  }
@@ -2947,7 +2947,7 @@ function kt(e) {
2947
2947
  continue;
2948
2948
  }
2949
2949
  for (let [t, n] of Object.entries(e)) {
2950
- let e = Ot(t, n);
2950
+ let e = kt(t, n);
2951
2951
  e ? i.push(...e) : a = !0;
2952
2952
  }
2953
2953
  }
@@ -2961,12 +2961,12 @@ function kt(e) {
2961
2961
  };
2962
2962
  }
2963
2963
  if (t.includes("$not") || t.includes("$and") || t.includes("$or")) return {
2964
- group: Et(),
2964
+ group: Dt(),
2965
2965
  complex: !0
2966
2966
  };
2967
2967
  let n = [], r = !1;
2968
2968
  for (let [t, i] of Object.entries(e)) {
2969
- let e = Ot(t, i);
2969
+ let e = kt(t, i);
2970
2970
  e ? n.push(...e) : r = !0;
2971
2971
  }
2972
2972
  return {
@@ -2978,34 +2978,34 @@ function kt(e) {
2978
2978
  complex: r
2979
2979
  };
2980
2980
  }
2981
- function At(e) {
2981
+ function jt(e) {
2982
2982
  if (!e || !Array.isArray(e.conditions) || e.conditions.length === 0) return;
2983
- let t = e.conditions.filter((e) => e.field).map((e) => jt(e));
2983
+ let t = e.conditions.filter((e) => e.field).map((e) => Mt(e));
2984
2984
  if (t.length !== 0) return t.length === 1 ? t[0] : { [e.logic === "or" ? "$or" : "$and"]: t };
2985
2985
  }
2986
- function jt(e) {
2986
+ function Mt(e) {
2987
2987
  let { field: t, operator: n, value: r } = e;
2988
2988
  if (n === "isEmpty") return { [t]: { $exists: !1 } };
2989
2989
  if (n === "isNotEmpty") return { [t]: { $exists: !0 } };
2990
2990
  if (n === "equals") return { [t]: r };
2991
- let i = Tt[n];
2991
+ let i = Et[n];
2992
2992
  return i ? { [t]: { [i]: r } } : { [t]: r };
2993
2993
  }
2994
- function Mt({ availableFields: e, value: n, onChange: r, t: i }) {
2995
- let a = t.useMemo(() => JSON.stringify(n ?? null), [n]), o = t.useMemo(() => kt(n), [a]), [s, c] = t.useState(o.group), l = t.useRef(a);
2994
+ function Nt({ availableFields: e, value: n, onChange: r, t: i }) {
2995
+ let a = t.useMemo(() => JSON.stringify(n ?? null), [n]), o = t.useMemo(() => At(n), [a]), [s, c] = t.useState(o.group), l = t.useRef(a);
2996
2996
  t.useEffect(() => {
2997
2997
  l.current !== a && (c(o.group), l.current = a);
2998
2998
  }, [a, o.group]);
2999
2999
  let u = (e) => {
3000
3000
  c(e);
3001
- let t = At(e);
3001
+ let t = jt(e);
3002
3002
  l.current = JSON.stringify(t ?? null), r(t);
3003
3003
  };
3004
- if (o.complex) return /* @__PURE__ */ I("div", {
3004
+ if (o.complex) return /* @__PURE__ */ R("div", {
3005
3005
  className: "flex items-start gap-2 p-2 rounded border border-amber-300 bg-amber-50 text-amber-900 text-[11px]",
3006
- children: [/* @__PURE__ */ F(V, { className: "h-3.5 w-3.5 mt-0.5 shrink-0" }), /* @__PURE__ */ F("span", { children: i("report.editor.filtersComplex") })]
3006
+ children: [/* @__PURE__ */ L(H, { className: "h-3.5 w-3.5 mt-0.5 shrink-0" }), /* @__PURE__ */ L("span", { children: i("report.editor.filtersComplex") })]
3007
3007
  });
3008
- let f = () => {
3008
+ let d = () => {
3009
3009
  u({
3010
3010
  ...s,
3011
3011
  conditions: [...s.conditions, {
@@ -3015,7 +3015,7 @@ function Mt({ availableFields: e, value: n, onChange: r, t: i }) {
3015
3015
  value: ""
3016
3016
  }]
3017
3017
  });
3018
- }, p = (e) => {
3018
+ }, f = (e) => {
3019
3019
  u({
3020
3020
  ...s,
3021
3021
  conditions: s.conditions.filter((t) => t.id !== e)
@@ -3074,13 +3074,13 @@ function Mt({ availableFields: e, value: n, onChange: r, t: i }) {
3074
3074
  label: i("report.editor.opIsNotEmpty", "is not empty")
3075
3075
  }
3076
3076
  ];
3077
- return /* @__PURE__ */ I("div", {
3077
+ return /* @__PURE__ */ R("div", {
3078
3078
  className: "space-y-1.5 py-1",
3079
3079
  "data-testid": "spec-filter-adapter",
3080
3080
  children: [
3081
- s.conditions.length > 1 && /* @__PURE__ */ I("div", {
3081
+ s.conditions.length > 1 && /* @__PURE__ */ R("div", {
3082
3082
  className: "flex items-center gap-2 text-[10px] text-muted-foreground",
3083
- children: [/* @__PURE__ */ F("span", { children: i("report.editor.combineLogic", "Combine with") }), /* @__PURE__ */ I("select", {
3083
+ children: [/* @__PURE__ */ L("span", { children: i("report.editor.combineLogic", "Combine with") }), /* @__PURE__ */ R("select", {
3084
3084
  className: "h-5 text-[10px] border rounded px-1 bg-background",
3085
3085
  value: s.logic,
3086
3086
  onChange: (e) => u({
@@ -3088,39 +3088,39 @@ function Mt({ availableFields: e, value: n, onChange: r, t: i }) {
3088
3088
  logic: e.target.value
3089
3089
  }),
3090
3090
  "data-testid": "filter-logic-select",
3091
- children: [/* @__PURE__ */ F("option", {
3091
+ children: [/* @__PURE__ */ L("option", {
3092
3092
  value: "and",
3093
3093
  children: "AND"
3094
- }), /* @__PURE__ */ F("option", {
3094
+ }), /* @__PURE__ */ L("option", {
3095
3095
  value: "or",
3096
3096
  children: "OR"
3097
3097
  })]
3098
3098
  })]
3099
3099
  }),
3100
- s.conditions.map((t) => /* @__PURE__ */ I("div", {
3100
+ s.conditions.map((t) => /* @__PURE__ */ R("div", {
3101
3101
  className: "flex items-center gap-1 text-[10px] p-1 border rounded bg-muted/20",
3102
3102
  children: [
3103
- /* @__PURE__ */ F("select", {
3103
+ /* @__PURE__ */ L("select", {
3104
3104
  className: "h-5 text-[10px] border rounded px-1 bg-background flex-1 min-w-0",
3105
3105
  value: t.field,
3106
3106
  onChange: (e) => m(t.id, { field: e.target.value }),
3107
3107
  "data-testid": `filter-field-${t.id}`,
3108
- children: e.map((e) => /* @__PURE__ */ F("option", {
3108
+ children: e.map((e) => /* @__PURE__ */ L("option", {
3109
3109
  value: e.value,
3110
3110
  children: e.label
3111
3111
  }, e.value))
3112
3112
  }),
3113
- /* @__PURE__ */ F("select", {
3113
+ /* @__PURE__ */ L("select", {
3114
3114
  className: "h-5 text-[10px] border rounded px-1 bg-background w-20 shrink-0",
3115
3115
  value: t.operator,
3116
3116
  onChange: (e) => m(t.id, { operator: e.target.value }),
3117
3117
  "data-testid": `filter-op-${t.id}`,
3118
- children: h.map((e) => /* @__PURE__ */ F("option", {
3118
+ children: h.map((e) => /* @__PURE__ */ L("option", {
3119
3119
  value: e.value,
3120
3120
  children: e.label
3121
3121
  }, e.value))
3122
3122
  }),
3123
- t.operator !== "isEmpty" && t.operator !== "isNotEmpty" && /* @__PURE__ */ F("input", {
3123
+ t.operator !== "isEmpty" && t.operator !== "isNotEmpty" && /* @__PURE__ */ L("input", {
3124
3124
  className: "h-5 text-[10px] border rounded px-1 bg-background w-24 shrink-0",
3125
3125
  value: Array.isArray(t.value) ? t.value.join(",") : (t.value ?? "").toString(),
3126
3126
  placeholder: "value",
@@ -3130,37 +3130,37 @@ function Mt({ availableFields: e, value: n, onChange: r, t: i }) {
3130
3130
  },
3131
3131
  "data-testid": `filter-value-${t.id}`
3132
3132
  }),
3133
- /* @__PURE__ */ F(d, {
3133
+ /* @__PURE__ */ L(p, {
3134
3134
  type: "button",
3135
3135
  size: "sm",
3136
3136
  variant: "ghost",
3137
3137
  className: "h-5 w-5 p-0 shrink-0",
3138
- onClick: () => p(t.id),
3138
+ onClick: () => f(t.id),
3139
3139
  "data-testid": `filter-remove-${t.id}`,
3140
- children: /* @__PURE__ */ F(G, { className: "h-3 w-3" })
3140
+ children: /* @__PURE__ */ L(G, { className: "h-3 w-3" })
3141
3141
  })
3142
3142
  ]
3143
3143
  }, t.id)),
3144
- /* @__PURE__ */ I(d, {
3144
+ /* @__PURE__ */ R(p, {
3145
3145
  type: "button",
3146
3146
  size: "sm",
3147
3147
  variant: "outline",
3148
3148
  className: "h-6 text-[10px] w-full",
3149
- onClick: f,
3149
+ onClick: d,
3150
3150
  disabled: e.length === 0,
3151
3151
  "data-testid": "filter-add",
3152
- children: [/* @__PURE__ */ F(W, { className: "h-3 w-3 mr-1" }), i("report.editor.addCondition", "Add condition")]
3152
+ children: [/* @__PURE__ */ L(W, { className: "h-3 w-3 mr-1" }), i("report.editor.addCondition", "Add condition")]
3153
3153
  })
3154
3154
  ]
3155
3155
  });
3156
3156
  }
3157
3157
  //#endregion
3158
3158
  //#region src/editorTypes.ts
3159
- var Nt = new Set([
3159
+ var Pt = new Set([
3160
3160
  "date",
3161
3161
  "datetime",
3162
3162
  "time"
3163
- ]), Pt = new Set([
3163
+ ]), Ft = new Set([
3164
3164
  "number",
3165
3165
  "currency",
3166
3166
  "percent",
@@ -3169,12 +3169,12 @@ var Nt = new Set([
3169
3169
  ]);
3170
3170
  //#endregion
3171
3171
  //#region src/FieldPickerDialog.tsx
3172
- function Ft({ availableFields: e, selectedValues: n, onAdd: r, t: i, triggerLabel: a, title: o, description: s, testIdPrefix: c = "field-picker", singleSelect: l = !1, commitOnSelect: u = !1, disabled: f = !1, triggerClassName: p, trigger: m }) {
3173
- let [h, g] = t.useState(!1), [v, E] = t.useState(""), [D, O] = t.useState(/* @__PURE__ */ new Set()), k = t.useMemo(() => new Set(n), [n]);
3172
+ function It({ availableFields: e, selectedValues: n, onAdd: r, t: i, triggerLabel: a, title: o, description: s, testIdPrefix: c = "field-picker", singleSelect: l = !1, commitOnSelect: u = !1, disabled: d = !1, triggerClassName: f, trigger: m }) {
3173
+ let [h, g] = t.useState(!1), [_, v] = t.useState(""), [b, O] = t.useState(/* @__PURE__ */ new Set()), k = t.useMemo(() => new Set(n), [n]);
3174
3174
  t.useEffect(() => {
3175
- h && (E(""), O(/* @__PURE__ */ new Set()));
3175
+ h && (v(""), O(/* @__PURE__ */ new Set()));
3176
3176
  }, [h]);
3177
- let A = v.trim().toLowerCase(), j = e.filter((e) => !k.has(e.value)), M = A ? j.filter((e) => e.label.toLowerCase().includes(A) || e.value.toLowerCase().includes(A)) : j, N = (e) => {
3177
+ let A = _.trim().toLowerCase(), j = e.filter((e) => !k.has(e.value)), M = A ? j.filter((e) => e.label.toLowerCase().includes(A) || e.value.toLowerCase().includes(A)) : j, ee = (e) => {
3178
3178
  if (l && u) {
3179
3179
  r([e]), g(!1);
3180
3180
  return;
@@ -3183,54 +3183,54 @@ function Ft({ availableFields: e, selectedValues: n, onAdd: r, t: i, triggerLabe
3183
3183
  let n = new Set(l ? [] : t);
3184
3184
  return t.has(e) ? n.delete(e) : n.add(e), n;
3185
3185
  });
3186
- }, ee = () => {
3187
- if (D.size === 0) {
3186
+ }, N = () => {
3187
+ if (b.size === 0) {
3188
3188
  g(!1);
3189
3189
  return;
3190
3190
  }
3191
- r(j.map((e) => e.value).filter((e) => D.has(e))), g(!1);
3191
+ r(j.map((e) => e.value).filter((e) => b.has(e))), g(!1);
3192
3192
  }, P = () => {
3193
3193
  g(!1);
3194
- }, L = e.length === 0, R = !L && j.length === 0, z = a ?? i("report.editor.addColumns", "Add fields"), B = o ?? i("report.editor.fieldPickerTitle", "Select fields"), V = s ?? i("report.editor.fieldPickerDescription", "Pick one or more fields to add. Use the search box to narrow the list.");
3195
- return /* @__PURE__ */ I(y, {
3194
+ }, F = e.length === 0, I = !F && j.length === 0, z = a ?? i("report.editor.addColumns", "Add fields"), B = o ?? i("report.editor.fieldPickerTitle", "Select fields"), V = s ?? i("report.editor.fieldPickerDescription", "Pick one or more fields to add. Use the search box to narrow the list.");
3195
+ return /* @__PURE__ */ R(x, {
3196
3196
  open: h,
3197
3197
  onOpenChange: g,
3198
- children: [/* @__PURE__ */ F(T, {
3198
+ children: [/* @__PURE__ */ L(D, {
3199
3199
  asChild: !0,
3200
- children: m ?? /* @__PURE__ */ I(d, {
3200
+ children: m ?? /* @__PURE__ */ R(p, {
3201
3201
  type: "button",
3202
3202
  variant: "outline",
3203
3203
  size: "sm",
3204
- className: p ?? "h-8 gap-1.5",
3205
- disabled: f || L || R,
3204
+ className: f ?? "h-8 gap-1.5",
3205
+ disabled: d || F || I,
3206
3206
  "data-testid": `${c}-trigger`,
3207
- children: [/* @__PURE__ */ F(W, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ F("span", { children: z })]
3207
+ children: [/* @__PURE__ */ L(W, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ L("span", { children: z })]
3208
3208
  })
3209
- }), /* @__PURE__ */ I(b, {
3209
+ }), /* @__PURE__ */ R(S, {
3210
3210
  className: "sm:max-w-md max-w-[92vw] gap-3",
3211
3211
  "data-testid": `${c}-dialog`,
3212
3212
  children: [
3213
- /* @__PURE__ */ I(C, { children: [/* @__PURE__ */ F(w, { children: B }), /* @__PURE__ */ F(x, { children: V })] }),
3214
- /* @__PURE__ */ I("div", {
3213
+ /* @__PURE__ */ R(T, { children: [/* @__PURE__ */ L(E, { children: B }), /* @__PURE__ */ L(C, { children: V })] }),
3214
+ /* @__PURE__ */ R("div", {
3215
3215
  className: "relative",
3216
- children: [/* @__PURE__ */ F(fe, { className: "pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }), /* @__PURE__ */ F("input", {
3216
+ children: [/* @__PURE__ */ L(pe, { className: "pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }), /* @__PURE__ */ L("input", {
3217
3217
  type: "text",
3218
3218
  className: "h-9 w-full text-sm border rounded pl-7 pr-2 bg-background",
3219
3219
  placeholder: i("report.editor.searchFields", "Search fields…"),
3220
- value: v,
3221
- onChange: (e) => E(e.target.value),
3220
+ value: _,
3221
+ onChange: (e) => v(e.target.value),
3222
3222
  "data-testid": `${c}-search`,
3223
3223
  autoFocus: !0
3224
3224
  })]
3225
3225
  }),
3226
- /* @__PURE__ */ I("div", {
3226
+ /* @__PURE__ */ R("div", {
3227
3227
  className: "text-[11px] text-muted-foreground flex items-center justify-between",
3228
- children: [/* @__PURE__ */ I("span", { children: [
3228
+ children: [/* @__PURE__ */ R("span", { children: [
3229
3229
  M.length,
3230
3230
  "/",
3231
3231
  j.length,
3232
- D.size > 0 ? ` · ${i("report.editor.fieldPickerSelected", "{n} selected").replace("{n}", String(D.size))}` : ""
3233
- ] }), D.size > 0 && /* @__PURE__ */ F("button", {
3232
+ b.size > 0 ? ` · ${i("report.editor.fieldPickerSelected", "{n} selected").replace("{n}", String(b.size))}` : ""
3233
+ ] }), b.size > 0 && /* @__PURE__ */ L("button", {
3234
3234
  type: "button",
3235
3235
  className: "text-[11px] underline-offset-2 hover:underline text-muted-foreground",
3236
3236
  onClick: () => O(/* @__PURE__ */ new Set()),
@@ -3238,35 +3238,35 @@ function Ft({ availableFields: e, selectedValues: n, onAdd: r, t: i, triggerLabe
3238
3238
  children: i("report.editor.fieldPickerClear", "Clear selection")
3239
3239
  })]
3240
3240
  }),
3241
- /* @__PURE__ */ F("div", {
3241
+ /* @__PURE__ */ L("div", {
3242
3242
  className: "max-h-72 overflow-auto border rounded bg-background/40 p-1 space-y-0.5",
3243
3243
  "data-testid": `${c}-list`,
3244
- children: L ? /* @__PURE__ */ F("div", {
3244
+ children: F ? /* @__PURE__ */ L("div", {
3245
3245
  className: "text-xs text-muted-foreground px-2 py-3 text-center",
3246
3246
  children: i("report.editor.noFields", "No fields available — pick a data source first.")
3247
- }) : R ? /* @__PURE__ */ F("div", {
3247
+ }) : I ? /* @__PURE__ */ L("div", {
3248
3248
  className: "text-xs text-muted-foreground px-2 py-3 text-center",
3249
3249
  children: i("report.editor.noFieldsAvailable", "All fields already added.")
3250
- }) : M.length === 0 ? /* @__PURE__ */ F("div", {
3250
+ }) : M.length === 0 ? /* @__PURE__ */ L("div", {
3251
3251
  className: "text-xs text-muted-foreground px-2 py-3 text-center",
3252
3252
  children: i("report.editor.noMatchingFields", "No fields match your search.")
3253
3253
  }) : M.map((e) => {
3254
- let t = D.has(e.value);
3255
- return /* @__PURE__ */ I("label", {
3254
+ let t = b.has(e.value);
3255
+ return /* @__PURE__ */ R("label", {
3256
3256
  className: "flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted/50 text-sm cursor-pointer",
3257
3257
  "data-testid": `${c}-row-${e.value}`,
3258
3258
  children: [
3259
- /* @__PURE__ */ F(_, {
3259
+ /* @__PURE__ */ L(y, {
3260
3260
  checked: t,
3261
- onCheckedChange: () => N(e.value),
3261
+ onCheckedChange: () => ee(e.value),
3262
3262
  "data-testid": `${c}-toggle-${e.value}`
3263
3263
  }),
3264
- /* @__PURE__ */ F("span", {
3264
+ /* @__PURE__ */ L("span", {
3265
3265
  className: "flex-1 truncate",
3266
3266
  title: e.label,
3267
3267
  children: e.label
3268
3268
  }),
3269
- e.type && /* @__PURE__ */ F("span", {
3269
+ e.type && /* @__PURE__ */ L("span", {
3270
3270
  className: "text-[10px] text-muted-foreground shrink-0",
3271
3271
  children: e.type
3272
3272
  })
@@ -3274,22 +3274,22 @@ function Ft({ availableFields: e, selectedValues: n, onAdd: r, t: i, triggerLabe
3274
3274
  }, e.value);
3275
3275
  })
3276
3276
  }),
3277
- !(l && u) && /* @__PURE__ */ I(S, {
3277
+ !(l && u) && /* @__PURE__ */ R(w, {
3278
3278
  className: "gap-2 sm:gap-2",
3279
- children: [/* @__PURE__ */ F(d, {
3279
+ children: [/* @__PURE__ */ L(p, {
3280
3280
  type: "button",
3281
3281
  variant: "ghost",
3282
3282
  size: "sm",
3283
3283
  onClick: P,
3284
3284
  "data-testid": `${c}-cancel`,
3285
3285
  children: i("common.cancel", "Cancel")
3286
- }), /* @__PURE__ */ F(d, {
3286
+ }), /* @__PURE__ */ L(p, {
3287
3287
  type: "button",
3288
3288
  size: "sm",
3289
- onClick: ee,
3290
- disabled: D.size === 0,
3289
+ onClick: N,
3290
+ disabled: b.size === 0,
3291
3291
  "data-testid": `${c}-confirm`,
3292
- children: D.size > 0 ? i("report.editor.fieldPickerAddN", "Add {n}").replace("{n}", String(D.size)) : i("report.editor.fieldPickerAdd", "Add")
3292
+ children: b.size > 0 ? i("report.editor.fieldPickerAddN", "Add {n}").replace("{n}", String(b.size)) : i("report.editor.fieldPickerAdd", "Add")
3293
3293
  })]
3294
3294
  })
3295
3295
  ]
@@ -3298,7 +3298,7 @@ function Ft({ availableFields: e, selectedValues: n, onAdd: r, t: i, triggerLabe
3298
3298
  }
3299
3299
  //#endregion
3300
3300
  //#region src/ColumnsEditor.tsx
3301
- function It(e) {
3301
+ function Lt(e) {
3302
3302
  return [
3303
3303
  {
3304
3304
  value: "",
@@ -3330,7 +3330,7 @@ function It(e) {
3330
3330
  }
3331
3331
  ];
3332
3332
  }
3333
- function Lt(e) {
3333
+ function Rt(e) {
3334
3334
  return [
3335
3335
  {
3336
3336
  value: "",
@@ -3358,7 +3358,7 @@ function Lt(e) {
3358
3358
  }
3359
3359
  ];
3360
3360
  }
3361
- function Rt(e) {
3361
+ function zt(e) {
3362
3362
  return Array.isArray(e) ? e.map((e) => typeof e == "string" ? {
3363
3363
  field: e,
3364
3364
  label: e,
@@ -3371,8 +3371,8 @@ function Rt(e) {
3371
3371
  format: e.format
3372
3372
  }) : [];
3373
3373
  }
3374
- function zt({ availableFields: e, value: t, onChange: n, t: r }) {
3375
- let i = Rt(t), a = new Set(i.map((e) => e.field)), o = It(r), s = Lt(r), c = (t) => {
3374
+ function Bt({ availableFields: e, value: t, onChange: n, t: r }) {
3375
+ let i = zt(t), a = new Set(i.map((e) => e.field)), o = Lt(r), s = Rt(r), c = (t) => {
3376
3376
  if (t.length === 0) return;
3377
3377
  let r = t.filter((e) => !a.has(e)).map((t) => {
3378
3378
  let n = e.find((e) => e.value === t);
@@ -3390,47 +3390,47 @@ function zt({ availableFields: e, value: t, onChange: n, t: r }) {
3390
3390
  ...n,
3391
3391
  ...t
3392
3392
  } : n));
3393
- }, f = (e, t) => {
3393
+ }, d = (e, t) => {
3394
3394
  let r = [...i], a = e + t;
3395
3395
  a < 0 || a >= r.length || ([r[e], r[a]] = [r[a], r[e]], n(r));
3396
3396
  };
3397
- return e.length === 0 ? /* @__PURE__ */ F("div", {
3397
+ return e.length === 0 ? /* @__PURE__ */ L("div", {
3398
3398
  className: "text-xs text-muted-foreground py-2",
3399
3399
  "data-testid": "columns-editor-empty",
3400
3400
  children: r("report.editor.noFields", "No fields available — pick a data source first.")
3401
- }) : /* @__PURE__ */ I("div", {
3401
+ }) : /* @__PURE__ */ R("div", {
3402
3402
  className: "space-y-2 py-1",
3403
3403
  "data-testid": "columns-editor",
3404
- children: [i.length > 0 && /* @__PURE__ */ F("div", {
3404
+ children: [i.length > 0 && /* @__PURE__ */ L("div", {
3405
3405
  className: "space-y-1.5",
3406
3406
  "data-testid": "columns-selected",
3407
3407
  children: i.map((t, n) => {
3408
3408
  let a = e.find((e) => e.value === t.field);
3409
- return /* @__PURE__ */ I("div", {
3409
+ return /* @__PURE__ */ R("div", {
3410
3410
  className: "grid grid-cols-[auto_1fr_auto] gap-1.5 p-1.5 border rounded bg-muted/30 text-xs",
3411
3411
  "data-testid": `column-row-${t.field}`,
3412
3412
  children: [
3413
- /* @__PURE__ */ I("div", {
3413
+ /* @__PURE__ */ R("div", {
3414
3414
  className: "row-span-2 flex flex-col items-center justify-center gap-0.5",
3415
- children: [/* @__PURE__ */ F("button", {
3415
+ children: [/* @__PURE__ */ L("button", {
3416
3416
  type: "button",
3417
3417
  className: "text-muted-foreground hover:text-foreground disabled:opacity-30",
3418
3418
  disabled: n === 0,
3419
- onClick: () => f(n, -1),
3419
+ onClick: () => d(n, -1),
3420
3420
  "aria-label": "Move up",
3421
3421
  "data-testid": `column-up-${t.field}`,
3422
- children: /* @__PURE__ */ F(U, { className: "h-3 w-3" })
3423
- }), /* @__PURE__ */ F("button", {
3422
+ children: /* @__PURE__ */ L(te, { className: "h-3 w-3" })
3423
+ }), /* @__PURE__ */ L("button", {
3424
3424
  type: "button",
3425
3425
  className: "text-muted-foreground hover:text-foreground disabled:opacity-30",
3426
3426
  disabled: n === i.length - 1,
3427
- onClick: () => f(n, 1),
3427
+ onClick: () => d(n, 1),
3428
3428
  "aria-label": "Move down",
3429
3429
  "data-testid": `column-down-${t.field}`,
3430
- children: /* @__PURE__ */ F(H, { className: "h-3 w-3" })
3430
+ children: /* @__PURE__ */ L(U, { className: "h-3 w-3" })
3431
3431
  })]
3432
3432
  }),
3433
- /* @__PURE__ */ F("input", {
3433
+ /* @__PURE__ */ L("input", {
3434
3434
  className: "h-7 text-xs border rounded px-2 bg-background min-w-0 w-full",
3435
3435
  value: t.label ?? "",
3436
3436
  placeholder: a?.label ?? t.field,
@@ -3438,7 +3438,7 @@ function zt({ availableFields: e, value: t, onChange: n, t: r }) {
3438
3438
  "data-testid": `column-label-${t.field}`,
3439
3439
  title: a?.label ?? t.field
3440
3440
  }),
3441
- /* @__PURE__ */ F(d, {
3441
+ /* @__PURE__ */ L(p, {
3442
3442
  type: "button",
3443
3443
  size: "sm",
3444
3444
  variant: "ghost",
@@ -3446,36 +3446,36 @@ function zt({ availableFields: e, value: t, onChange: n, t: r }) {
3446
3446
  onClick: () => l(t.field),
3447
3447
  "data-testid": `column-remove-${t.field}`,
3448
3448
  "aria-label": "Remove column",
3449
- children: /* @__PURE__ */ F(G, { className: "h-3.5 w-3.5" })
3449
+ children: /* @__PURE__ */ L(G, { className: "h-3.5 w-3.5" })
3450
3450
  }),
3451
- /* @__PURE__ */ I("div", {
3451
+ /* @__PURE__ */ R("div", {
3452
3452
  className: "grid grid-cols-2 gap-1.5",
3453
- children: [/* @__PURE__ */ I("label", {
3453
+ children: [/* @__PURE__ */ R("label", {
3454
3454
  className: "flex flex-col gap-0.5 min-w-0",
3455
- children: [/* @__PURE__ */ F("span", {
3455
+ children: [/* @__PURE__ */ L("span", {
3456
3456
  className: "text-[10px] text-muted-foreground uppercase tracking-wide",
3457
3457
  children: r("report.editor.aggregateColumn", "Aggregate")
3458
- }), /* @__PURE__ */ F("select", {
3458
+ }), /* @__PURE__ */ L("select", {
3459
3459
  className: "h-7 text-xs border rounded px-1 bg-background w-full min-w-0",
3460
3460
  value: t.aggregate ?? "",
3461
3461
  onChange: (e) => u(t.field, { aggregate: e.target.value === "" ? void 0 : e.target.value }),
3462
3462
  "data-testid": `column-agg-${t.field}`,
3463
- children: o.map((e) => /* @__PURE__ */ F("option", {
3463
+ children: o.map((e) => /* @__PURE__ */ L("option", {
3464
3464
  value: e.value,
3465
3465
  children: e.label
3466
3466
  }, e.value))
3467
3467
  })]
3468
- }), /* @__PURE__ */ I("label", {
3468
+ }), /* @__PURE__ */ R("label", {
3469
3469
  className: "flex flex-col gap-0.5 min-w-0",
3470
- children: [/* @__PURE__ */ F("span", {
3470
+ children: [/* @__PURE__ */ L("span", {
3471
3471
  className: "text-[10px] text-muted-foreground uppercase tracking-wide",
3472
3472
  children: r("report.editor.formatColumn", "Format")
3473
- }), /* @__PURE__ */ F("select", {
3473
+ }), /* @__PURE__ */ L("select", {
3474
3474
  className: "h-7 text-xs border rounded px-1 bg-background w-full min-w-0",
3475
3475
  value: t.format ?? "",
3476
3476
  onChange: (e) => u(t.field, { format: e.target.value === "" ? void 0 : e.target.value }),
3477
3477
  "data-testid": `column-fmt-${t.field}`,
3478
- children: s.map((e) => /* @__PURE__ */ F("option", {
3478
+ children: s.map((e) => /* @__PURE__ */ L("option", {
3479
3479
  value: e.value,
3480
3480
  children: e.label
3481
3481
  }, e.value))
@@ -3485,12 +3485,12 @@ function zt({ availableFields: e, value: t, onChange: n, t: r }) {
3485
3485
  ]
3486
3486
  }, t.field);
3487
3487
  })
3488
- }), /* @__PURE__ */ I("div", {
3488
+ }), /* @__PURE__ */ R("div", {
3489
3489
  className: "flex items-center justify-between gap-2 pt-1",
3490
- children: [/* @__PURE__ */ F("div", {
3490
+ children: [/* @__PURE__ */ L("div", {
3491
3491
  className: "text-xs text-muted-foreground",
3492
3492
  children: i.length > 0 ? r("report.editor.columnsCount", "{n} column(s) selected").replace("{n}", String(i.length)) : r("report.editor.columnsEmpty", "No columns selected yet.")
3493
- }), /* @__PURE__ */ F(Ft, {
3493
+ }), /* @__PURE__ */ L(It, {
3494
3494
  availableFields: e,
3495
3495
  selectedValues: i.map((e) => e.field),
3496
3496
  onAdd: c,
@@ -3503,7 +3503,7 @@ function zt({ availableFields: e, value: t, onChange: n, t: r }) {
3503
3503
  }
3504
3504
  //#endregion
3505
3505
  //#region src/GroupingsBuilder.tsx
3506
- function Bt({ availableFields: e, value: t, onChange: n, t: r, testIdPrefix: i = "grouping" }) {
3506
+ function Vt({ availableFields: e, value: t, onChange: n, t: r, testIdPrefix: i = "grouping" }) {
3507
3507
  let a = Array.isArray(t) ? t.map((e) => ({
3508
3508
  field: e.field ?? "",
3509
3509
  sortOrder: e.sortOrder ?? e.sort ?? "asc",
@@ -3543,95 +3543,95 @@ function Bt({ availableFields: e, value: t, onChange: n, t: r, testIdPrefix: i =
3543
3543
  }, u = (e, t) => {
3544
3544
  let r = [...a], i = e + t;
3545
3545
  i < 0 || i >= r.length || ([r[e], r[i]] = [r[i], r[e]], n(r));
3546
- }, f = (e) => {
3546
+ }, d = (e) => {
3547
3547
  if (e.length === 0) return;
3548
3548
  let t = e.map((e) => ({
3549
3549
  field: e,
3550
3550
  sortOrder: "asc"
3551
3551
  }));
3552
3552
  n([...a, ...t]);
3553
- }, p = (t, n) => {
3553
+ }, f = (t, n) => {
3554
3554
  let r = n[0];
3555
3555
  if (!r) return;
3556
3556
  let i = e.find((e) => e.value === r);
3557
3557
  l(t, {
3558
3558
  field: r,
3559
- dateGranularity: i && Nt.has(i.type ?? "") ? a[t]?.dateGranularity : void 0
3559
+ dateGranularity: i && Pt.has(i.type ?? "") ? a[t]?.dateGranularity : void 0
3560
3560
  });
3561
3561
  };
3562
- return /* @__PURE__ */ I("div", {
3562
+ return /* @__PURE__ */ R("div", {
3563
3563
  className: "space-y-1.5 py-1",
3564
3564
  "data-testid": `${i}s-builder`,
3565
3565
  children: [a.map((t, n) => {
3566
- let f = e.find((e) => e.value === t.field), m = f && Nt.has(f.type ?? ""), h = f?.label ?? t.field ?? r("report.editor.fieldPickerEmpty", "(pick field)");
3567
- return /* @__PURE__ */ I("div", {
3566
+ let d = e.find((e) => e.value === t.field), m = d && Pt.has(d.type ?? ""), h = d?.label ?? t.field ?? r("report.editor.fieldPickerEmpty", "(pick field)");
3567
+ return /* @__PURE__ */ R("div", {
3568
3568
  className: "flex items-center gap-1.5 p-1.5 border rounded bg-muted/20 text-xs",
3569
3569
  "data-testid": `${i}-row-${n}`,
3570
3570
  children: [
3571
- /* @__PURE__ */ I("div", {
3571
+ /* @__PURE__ */ R("div", {
3572
3572
  className: "flex flex-col gap-0.5 shrink-0",
3573
- children: [/* @__PURE__ */ F("button", {
3573
+ children: [/* @__PURE__ */ L("button", {
3574
3574
  type: "button",
3575
3575
  className: "text-muted-foreground hover:text-foreground disabled:opacity-30",
3576
3576
  disabled: n === 0,
3577
3577
  onClick: () => u(n, -1),
3578
3578
  "aria-label": "Move up",
3579
3579
  "data-testid": `${i}-up-${n}`,
3580
- children: /* @__PURE__ */ F(U, { className: "h-3 w-3" })
3581
- }), /* @__PURE__ */ F("button", {
3580
+ children: /* @__PURE__ */ L(te, { className: "h-3 w-3" })
3581
+ }), /* @__PURE__ */ L("button", {
3582
3582
  type: "button",
3583
3583
  className: "text-muted-foreground hover:text-foreground disabled:opacity-30",
3584
3584
  disabled: n === a.length - 1,
3585
3585
  onClick: () => u(n, 1),
3586
3586
  "aria-label": "Move down",
3587
3587
  "data-testid": `${i}-down-${n}`,
3588
- children: /* @__PURE__ */ F(H, { className: "h-3 w-3" })
3588
+ children: /* @__PURE__ */ L(U, { className: "h-3 w-3" })
3589
3589
  })]
3590
3590
  }),
3591
- /* @__PURE__ */ F(Ft, {
3591
+ /* @__PURE__ */ L(It, {
3592
3592
  availableFields: e,
3593
3593
  selectedValues: s.filter((e) => e !== t.field),
3594
- onAdd: (e) => p(n, e),
3594
+ onAdd: (e) => f(n, e),
3595
3595
  t: r,
3596
3596
  singleSelect: !0,
3597
3597
  commitOnSelect: !0,
3598
3598
  testIdPrefix: `${i}-field-picker-${n}`,
3599
3599
  title: r("report.editor.fieldPickerChangeTitle", "Change field"),
3600
- trigger: /* @__PURE__ */ I("button", {
3600
+ trigger: /* @__PURE__ */ R("button", {
3601
3601
  type: "button",
3602
3602
  className: "h-7 flex-1 min-w-0 text-left text-xs border rounded px-2 bg-background hover:bg-muted/40 inline-flex items-center justify-between gap-1.5",
3603
3603
  "data-testid": `${i}-field-${n}`,
3604
3604
  title: h,
3605
- children: [/* @__PURE__ */ F("span", {
3605
+ children: [/* @__PURE__ */ L("span", {
3606
3606
  className: "truncate",
3607
3607
  children: h
3608
- }), /* @__PURE__ */ F(ne, { className: "h-3 w-3 text-muted-foreground shrink-0" })]
3608
+ }), /* @__PURE__ */ L(re, { className: "h-3 w-3 text-muted-foreground shrink-0" })]
3609
3609
  })
3610
3610
  }),
3611
- /* @__PURE__ */ I("select", {
3611
+ /* @__PURE__ */ R("select", {
3612
3612
  className: "h-7 text-xs border rounded px-1.5 bg-background w-20 shrink-0",
3613
3613
  value: t.sortOrder ?? "asc",
3614
3614
  onChange: (e) => l(n, { sortOrder: e.target.value }),
3615
3615
  "data-testid": `${i}-sort-${n}`,
3616
- children: [/* @__PURE__ */ F("option", {
3616
+ children: [/* @__PURE__ */ L("option", {
3617
3617
  value: "asc",
3618
3618
  children: r("report.editor.sortAsc")
3619
- }), /* @__PURE__ */ F("option", {
3619
+ }), /* @__PURE__ */ L("option", {
3620
3620
  value: "desc",
3621
3621
  children: r("report.editor.sortDesc")
3622
3622
  })]
3623
3623
  }),
3624
- m && /* @__PURE__ */ F("select", {
3624
+ m && /* @__PURE__ */ L("select", {
3625
3625
  className: "h-7 text-xs border rounded px-1.5 bg-background w-24 shrink-0",
3626
3626
  value: t.dateGranularity ?? "",
3627
3627
  onChange: (e) => l(n, { dateGranularity: e.target.value || void 0 }),
3628
3628
  "data-testid": `${i}-granularity-${n}`,
3629
- children: o.map((e) => /* @__PURE__ */ F("option", {
3629
+ children: o.map((e) => /* @__PURE__ */ L("option", {
3630
3630
  value: e.value,
3631
3631
  children: e.label
3632
3632
  }, e.value))
3633
3633
  }),
3634
- /* @__PURE__ */ F(d, {
3634
+ /* @__PURE__ */ L(p, {
3635
3635
  type: "button",
3636
3636
  size: "sm",
3637
3637
  variant: "ghost",
@@ -3639,14 +3639,14 @@ function Bt({ availableFields: e, value: t, onChange: n, t: r, testIdPrefix: i =
3639
3639
  onClick: () => c(n),
3640
3640
  "aria-label": "Remove grouping",
3641
3641
  "data-testid": `${i}-remove-${n}`,
3642
- children: /* @__PURE__ */ F(G, { className: "h-3.5 w-3.5" })
3642
+ children: /* @__PURE__ */ L(G, { className: "h-3.5 w-3.5" })
3643
3643
  })
3644
3644
  ]
3645
3645
  }, n);
3646
- }), /* @__PURE__ */ F(Ft, {
3646
+ }), /* @__PURE__ */ L(It, {
3647
3647
  availableFields: e,
3648
3648
  selectedValues: s,
3649
- onAdd: f,
3649
+ onAdd: d,
3650
3650
  t: r,
3651
3651
  singleSelect: !0,
3652
3652
  commitOnSelect: !0,
@@ -3659,7 +3659,7 @@ function Bt({ availableFields: e, value: t, onChange: n, t: r, testIdPrefix: i =
3659
3659
  }
3660
3660
  //#endregion
3661
3661
  //#region src/ChartConfig.tsx
3662
- function Vt({ availableFields: e, columns: t, value: n, onChange: r, t: i }) {
3662
+ function Ht({ availableFields: e, columns: t, value: n, onChange: r, t: i }) {
3663
3663
  let a = n || {}, o = a.type ?? a.chartType ?? "", s = a.xAxis ?? a.xAxisField ?? "", c = a.yAxis ?? a.yAxisFields?.[0] ?? "", l = (e) => {
3664
3664
  let t = {
3665
3665
  ...a,
@@ -3696,14 +3696,14 @@ function Vt({ availableFields: e, columns: t, value: n, onChange: r, t: i }) {
3696
3696
  value: "funnel",
3697
3697
  label: i("report.editor.chartFunnel")
3698
3698
  }
3699
- ], f = t.filter((e) => e.aggregate).map((e) => e.field), p = e.filter((e) => Pt.has(e.type ?? "")).map((e) => e.value), m = new Set([...f, ...p]), h = e.filter((e) => m.has(e.value));
3700
- return /* @__PURE__ */ I("div", {
3699
+ ], f = t.filter((e) => e.aggregate).map((e) => e.field), p = e.filter((e) => Ft.has(e.type ?? "")).map((e) => e.value), m = new Set([...f, ...p]), h = e.filter((e) => m.has(e.value));
3700
+ return /* @__PURE__ */ R("div", {
3701
3701
  className: "space-y-2 py-1",
3702
3702
  "data-testid": "chart-config",
3703
- children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
3703
+ children: [/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("label", {
3704
3704
  className: "text-[10px] text-muted-foreground",
3705
3705
  children: i("report.editor.chartType")
3706
- }), /* @__PURE__ */ F("select", {
3706
+ }), /* @__PURE__ */ L("select", {
3707
3707
  className: "w-full h-7 text-xs border rounded px-2 bg-background",
3708
3708
  value: o,
3709
3709
  onChange: (e) => {
@@ -3711,75 +3711,75 @@ function Vt({ availableFields: e, columns: t, value: n, onChange: r, t: i }) {
3711
3711
  t ? l({ type: t }) : u();
3712
3712
  },
3713
3713
  "data-testid": "chart-type-select",
3714
- children: d.map((e) => /* @__PURE__ */ F("option", {
3714
+ children: d.map((e) => /* @__PURE__ */ L("option", {
3715
3715
  value: e.value,
3716
3716
  children: e.label
3717
3717
  }, e.value))
3718
- })] }), o && /* @__PURE__ */ I(P, { children: [
3719
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
3718
+ })] }), o && /* @__PURE__ */ R(I, { children: [
3719
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("label", {
3720
3720
  className: "text-[10px] text-muted-foreground",
3721
3721
  children: i("report.editor.chartTitle")
3722
- }), /* @__PURE__ */ F("input", {
3722
+ }), /* @__PURE__ */ L("input", {
3723
3723
  className: "w-full h-7 text-xs border rounded px-2 bg-background",
3724
3724
  value: a.title ?? "",
3725
3725
  placeholder: i("report.editor.chartTitlePlaceholder"),
3726
3726
  onChange: (e) => l({ title: e.target.value || void 0 }),
3727
3727
  "data-testid": "chart-title"
3728
3728
  })] }),
3729
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
3729
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("label", {
3730
3730
  className: "text-[10px] text-muted-foreground",
3731
3731
  children: i("report.editor.chartXAxis")
3732
- }), /* @__PURE__ */ I("select", {
3732
+ }), /* @__PURE__ */ R("select", {
3733
3733
  className: "w-full h-7 text-xs border rounded px-2 bg-background",
3734
3734
  value: s,
3735
3735
  onChange: (e) => l({ xAxis: e.target.value || void 0 }),
3736
3736
  "data-testid": "chart-x-field",
3737
- children: [/* @__PURE__ */ F("option", {
3737
+ children: [/* @__PURE__ */ L("option", {
3738
3738
  value: "",
3739
3739
  children: "—"
3740
- }), e.map((e) => /* @__PURE__ */ F("option", {
3740
+ }), e.map((e) => /* @__PURE__ */ L("option", {
3741
3741
  value: e.value,
3742
3742
  children: e.label
3743
3743
  }, e.value))]
3744
3744
  })] }),
3745
- /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("label", {
3745
+ /* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("label", {
3746
3746
  className: "text-[10px] text-muted-foreground",
3747
3747
  children: i("report.editor.chartYAxis")
3748
- }), /* @__PURE__ */ I("select", {
3748
+ }), /* @__PURE__ */ R("select", {
3749
3749
  className: "w-full h-7 text-xs border rounded px-2 bg-background",
3750
3750
  value: c,
3751
3751
  onChange: (e) => l({ yAxis: e.target.value || void 0 }),
3752
3752
  "data-testid": "chart-y-field",
3753
- children: [/* @__PURE__ */ F("option", {
3753
+ children: [/* @__PURE__ */ L("option", {
3754
3754
  value: "",
3755
3755
  children: "—"
3756
- }), (h.length > 0 ? h : e).map((e) => /* @__PURE__ */ F("option", {
3756
+ }), (h.length > 0 ? h : e).map((e) => /* @__PURE__ */ L("option", {
3757
3757
  value: e.value,
3758
3758
  children: e.label
3759
3759
  }, e.value))]
3760
3760
  })] }),
3761
- /* @__PURE__ */ I("label", {
3761
+ /* @__PURE__ */ R("label", {
3762
3762
  className: "flex items-center gap-2 text-[10px]",
3763
- children: [/* @__PURE__ */ F(_, {
3763
+ children: [/* @__PURE__ */ L(y, {
3764
3764
  checked: a.showLegend !== !1,
3765
3765
  onCheckedChange: (e) => l({ showLegend: e === !0 }),
3766
3766
  "data-testid": "chart-show-legend"
3767
- }), /* @__PURE__ */ F("span", { children: i("report.editor.chartShowLegend") })]
3767
+ }), /* @__PURE__ */ L("span", { children: i("report.editor.chartShowLegend") })]
3768
3768
  }),
3769
- /* @__PURE__ */ I("label", {
3769
+ /* @__PURE__ */ R("label", {
3770
3770
  className: "flex items-center gap-2 text-[10px]",
3771
- children: [/* @__PURE__ */ F(_, {
3771
+ children: [/* @__PURE__ */ L(y, {
3772
3772
  checked: !!a.showDataLabels,
3773
3773
  onCheckedChange: (e) => l({ showDataLabels: e === !0 }),
3774
3774
  "data-testid": "chart-show-data-labels"
3775
- }), /* @__PURE__ */ F("span", { children: i("report.editor.chartShowDataLabels") })]
3775
+ }), /* @__PURE__ */ L("span", { children: i("report.editor.chartShowDataLabels") })]
3776
3776
  })
3777
3777
  ] })]
3778
3778
  });
3779
3779
  }
3780
3780
  //#endregion
3781
3781
  //#region src/ReportConfigPanel.tsx
3782
- function Ht(e, t, n) {
3782
+ function Ut(e, t, n) {
3783
3783
  let r = (e) => e.type === "summary", i = (e) => e.type === "matrix", a = (e) => e.type === "summary" || e.type === "matrix", o = [
3784
3784
  {
3785
3785
  key: "basic",
@@ -3851,7 +3851,7 @@ function Ht(e, t, n) {
3851
3851
  key: "groupingsDown",
3852
3852
  label: t("report.editor.grouping"),
3853
3853
  type: "custom",
3854
- render: (n, r) => /* @__PURE__ */ F(Bt, {
3854
+ render: (n, r) => /* @__PURE__ */ L(Vt, {
3855
3855
  availableFields: e,
3856
3856
  value: n,
3857
3857
  onChange: r,
@@ -3870,7 +3870,7 @@ function Ht(e, t, n) {
3870
3870
  key: "groupingsAcross",
3871
3871
  label: t("report.editor.grouping"),
3872
3872
  type: "custom",
3873
- render: (n, r) => /* @__PURE__ */ F(Bt, {
3873
+ render: (n, r) => /* @__PURE__ */ L(Vt, {
3874
3874
  availableFields: e,
3875
3875
  value: n,
3876
3876
  onChange: r,
@@ -3889,7 +3889,7 @@ function Ht(e, t, n) {
3889
3889
  key: "columns",
3890
3890
  label: t("report.editor.columns"),
3891
3891
  type: "custom",
3892
- render: (n, r) => /* @__PURE__ */ F(zt, {
3892
+ render: (n, r) => /* @__PURE__ */ L(Bt, {
3893
3893
  availableFields: e,
3894
3894
  value: n,
3895
3895
  onChange: r,
@@ -3907,7 +3907,7 @@ function Ht(e, t, n) {
3907
3907
  key: "columns",
3908
3908
  label: t("report.editor.values"),
3909
3909
  type: "custom",
3910
- render: (n, r) => /* @__PURE__ */ F(zt, {
3910
+ render: (n, r) => /* @__PURE__ */ L(Bt, {
3911
3911
  availableFields: e,
3912
3912
  value: n,
3913
3913
  onChange: r,
@@ -3925,7 +3925,7 @@ function Ht(e, t, n) {
3925
3925
  key: "filter",
3926
3926
  label: t("report.editor.filters"),
3927
3927
  type: "custom",
3928
- render: (n, r) => /* @__PURE__ */ F(Mt, {
3928
+ render: (n, r) => /* @__PURE__ */ L(Nt, {
3929
3929
  availableFields: e,
3930
3930
  value: n,
3931
3931
  onChange: r,
@@ -3943,7 +3943,7 @@ function Ht(e, t, n) {
3943
3943
  key: "blocks",
3944
3944
  label: t("report.editor.blocks"),
3945
3945
  type: "custom",
3946
- render: (r, i, a) => /* @__PURE__ */ F(St, {
3946
+ render: (r, i, a) => /* @__PURE__ */ L(Ct, {
3947
3947
  value: r,
3948
3948
  onChange: i,
3949
3949
  availableFields: e,
@@ -3964,9 +3964,9 @@ function Ht(e, t, n) {
3964
3964
  key: "chart",
3965
3965
  label: t("report.editor.chart"),
3966
3966
  type: "custom",
3967
- render: (n, r, i) => /* @__PURE__ */ F(Vt, {
3967
+ render: (n, r, i) => /* @__PURE__ */ L(Ht, {
3968
3968
  availableFields: e,
3969
- columns: Rt(i.columns),
3969
+ columns: zt(i.columns),
3970
3970
  value: n,
3971
3971
  onChange: r,
3972
3972
  t
@@ -3979,7 +3979,7 @@ function Ht(e, t, n) {
3979
3979
  sections: o
3980
3980
  };
3981
3981
  }
3982
- function Ut(e, t) {
3982
+ function Wt(e, t) {
3983
3983
  let n = [], r = e.type ?? "tabular", i = Array.isArray(e.groupingsDown) ? e.groupingsDown.length : 0, a = Array.isArray(e.groupingsAcross) ? e.groupingsAcross.length : 0, o = Array.isArray(e.columns) ? e.columns.length : 0;
3984
3984
  if (e.objectName || n.push({
3985
3985
  level: o > 0 ? "error" : "warning",
@@ -3990,31 +3990,31 @@ function Ut(e, t) {
3990
3990
  }), r === "summary" && i === 0 && n.push({
3991
3991
  level: "error",
3992
3992
  message: t("report.editor.validationSummaryNeedsRows")
3993
- }), r === "joined") for (let r of Ct(e.blocks, t)) n.push({
3993
+ }), r === "joined") for (let r of wt(e.blocks, t)) n.push({
3994
3994
  level: "error",
3995
3995
  message: r
3996
3996
  });
3997
3997
  return n;
3998
3998
  }
3999
- function Wt({ problems: e }) {
4000
- return e.length === 0 ? null : /* @__PURE__ */ F("div", {
3999
+ function Gt({ problems: e }) {
4000
+ return e.length === 0 ? null : /* @__PURE__ */ L("div", {
4001
4001
  className: "space-y-1 p-2 border-b",
4002
4002
  "data-testid": "report-validation-banner",
4003
- children: e.map((e, t) => /* @__PURE__ */ I("div", {
4003
+ children: e.map((e, t) => /* @__PURE__ */ R("div", {
4004
4004
  className: "flex items-start gap-2 text-[11px] rounded px-2 py-1 " + (e.level === "error" ? "bg-red-50 border border-red-200 text-red-900" : "bg-amber-50 border border-amber-200 text-amber-900"),
4005
- children: [/* @__PURE__ */ F(V, { className: "h-3.5 w-3.5 mt-0.5 shrink-0" }), /* @__PURE__ */ F("span", { children: e.message })]
4005
+ children: [/* @__PURE__ */ L(H, { className: "h-3.5 w-3.5 mt-0.5 shrink-0" }), /* @__PURE__ */ L("span", { children: e.message })]
4006
4006
  }, t))
4007
4007
  });
4008
4008
  }
4009
- function Gt({ open: e, onClose: n, config: r, onSave: i, onFieldChange: a, availableFields: o, getFieldsForObject: s }) {
4010
- let { t: c } = L(), l = t.useCallback((e, t, n) => t === void 0 ? c(e, n) : c(e, {
4009
+ function Kt({ open: e, onClose: n, config: r, onSave: i, onFieldChange: a, availableFields: o, getFieldsForObject: s }) {
4010
+ let { t: c } = z(), l = t.useCallback((e, t, n) => t === void 0 ? c(e, n) : c(e, {
4011
4011
  defaultValue: t,
4012
4012
  ...n || {}
4013
- }), [c]), u = o ?? [], d = t.useMemo(() => Ht(u, l, s), [
4013
+ }), [c]), u = o ?? [], d = t.useMemo(() => Ut(u, l, s), [
4014
4014
  u,
4015
4015
  l,
4016
4016
  s
4017
- ]), { draft: f, isDirty: p, updateField: m, discard: h } = ee(t.useMemo(() => r ?? {}, [r])), g = t.useCallback((e, t) => {
4017
+ ]), { draft: f, isDirty: p, updateField: m, discard: h } = F(t.useMemo(() => r ?? {}, [r])), g = t.useCallback((e, t) => {
4018
4018
  m(e, t), a?.(e, t, {
4019
4019
  ...f,
4020
4020
  [e]: t
@@ -4029,8 +4029,8 @@ function Gt({ open: e, onClose: n, config: r, onSave: i, onFieldChange: a, avail
4029
4029
  f,
4030
4030
  i,
4031
4031
  n
4032
- ]), y = t.useMemo(() => Ut(f, l), [f, l]);
4033
- return e ? /* @__PURE__ */ F(v, {
4032
+ ]), v = t.useMemo(() => Wt(f, l), [f, l]);
4033
+ return e ? /* @__PURE__ */ L(b, {
4034
4034
  open: e,
4035
4035
  onClose: n,
4036
4036
  schema: d,
@@ -4039,17 +4039,17 @@ function Gt({ open: e, onClose: n, config: r, onSave: i, onFieldChange: a, avail
4039
4039
  onFieldChange: g,
4040
4040
  onSave: _,
4041
4041
  onDiscard: h,
4042
- headerExtra: /* @__PURE__ */ F(Wt, { problems: y }),
4042
+ headerExtra: /* @__PURE__ */ L(Gt, { problems: v }),
4043
4043
  style: { "--config-panel-width": "440px" }
4044
4044
  }) : null;
4045
4045
  }
4046
4046
  //#endregion
4047
4047
  //#region src/LiveReportExporter.ts
4048
- async function Kt(e, t) {
4048
+ async function qt(e, t) {
4049
4049
  let { dataSource: n, resource: r, queryParams: i, format: a, exportConfig: o } = t, s = a || e.defaultExportFormat || "pdf";
4050
4050
  try {
4051
4051
  let t = (await n.find(r, i)).data || [];
4052
- return it(s, e, t, {
4052
+ return at(s, e, t, {
4053
4053
  format: s,
4054
4054
  ...e.exportConfigs?.[s],
4055
4055
  ...o
@@ -4067,17 +4067,17 @@ async function Kt(e, t) {
4067
4067
  };
4068
4068
  }
4069
4069
  }
4070
- function qt(e, t, n = {}) {
4071
- let { columns: r, filename: i, includeAggregationRow: a = !1 } = n, o = r || (e.fields || []).map(Yt), s = o.map((e) => e.header), c = t.map((e, t) => o.map((n) => {
4070
+ function Jt(e, t, n = {}) {
4071
+ let { columns: r, filename: i, includeAggregationRow: a = !1 } = n, o = r || (e.fields || []).map(Xt), s = o.map((e) => e.header), c = t.map((e, t) => o.map((n) => {
4072
4072
  if (n.formula) return n.formula.replace(/\{ROW\}/g, String(t + 2));
4073
4073
  let r = e[n.name];
4074
- return Xt(r, n.numberFormat);
4074
+ return Zt(r, n.numberFormat);
4075
4075
  }));
4076
4076
  if (a && t.length > 0) {
4077
4077
  let n = o.map((n, r) => {
4078
4078
  let i = (e.fields || []).find((e) => e.name === n.name);
4079
4079
  if (i?.aggregation) {
4080
- let e = Qt(r), n = t.length + 1;
4080
+ let e = $t(r), n = t.length + 1;
4081
4081
  switch (i.aggregation) {
4082
4082
  case "sum": return `=SUM(${e}2:${e}${n})`;
4083
4083
  case "avg": return `=AVERAGE(${e}2:${e}${n})`;
@@ -4091,15 +4091,15 @@ function qt(e, t, n = {}) {
4091
4091
  });
4092
4092
  c.push(n);
4093
4093
  }
4094
- en("" + [s.join(" "), ...c.map((e) => e.join(" "))].join("\n"), i || `${e.title || "report"}.tsv`, "text/tab-separated-values");
4094
+ tn("" + [s.join(" "), ...c.map((e) => e.join(" "))].join("\n"), i || `${e.title || "report"}.tsv`, "text/tab-separated-values");
4095
4095
  }
4096
- function Jt(e, t, n, r) {
4096
+ function Yt(e, t, n, r) {
4097
4097
  return async () => {
4098
4098
  let i = e.schedule;
4099
4099
  if (!i?.enabled) return [];
4100
4100
  let a = i.formats || [e.defaultExportFormat || "pdf"], o = [];
4101
4101
  for (let r of a) {
4102
- let i = await Kt(e, {
4102
+ let i = await qt(e, {
4103
4103
  dataSource: t,
4104
4104
  resource: n,
4105
4105
  format: r
@@ -4109,16 +4109,16 @@ function Jt(e, t, n, r) {
4109
4109
  return r(e, i), o;
4110
4110
  };
4111
4111
  }
4112
- function Yt(e) {
4112
+ function Xt(e) {
4113
4113
  return {
4114
4114
  name: e.name,
4115
4115
  header: e.label || e.name
4116
4116
  };
4117
4117
  }
4118
- function Xt(e, t) {
4119
- return e == null ? "" : typeof e == "number" && t ? e.toLocaleString("en-US", Zt(t)) : $t(String(e));
4118
+ function Zt(e, t) {
4119
+ return e == null ? "" : typeof e == "number" && t ? e.toLocaleString("en-US", Qt(t)) : en(String(e));
4120
4120
  }
4121
- function Zt(e) {
4121
+ function Qt(e) {
4122
4122
  if (e.includes("%")) return {
4123
4123
  style: "percent",
4124
4124
  minimumFractionDigits: 0
@@ -4129,23 +4129,23 @@ function Zt(e) {
4129
4129
  maximumFractionDigits: Math.max(0, t - 1)
4130
4130
  };
4131
4131
  }
4132
- function Qt(e) {
4132
+ function $t(e) {
4133
4133
  let t = "", n = e;
4134
4134
  for (; n >= 0;) t = String.fromCharCode(n % 26 + 65) + t, n = Math.floor(n / 26) - 1;
4135
4135
  return t;
4136
4136
  }
4137
- function $t(e) {
4137
+ function en(e) {
4138
4138
  if (e.length > 0) {
4139
4139
  let t = e.charAt(0);
4140
4140
  if (t === "=" || t === "+" || t === "-" || t === "@" || t === "|") return `'${e}`;
4141
4141
  }
4142
4142
  return e;
4143
4143
  }
4144
- function en(e, t, n) {
4144
+ function tn(e, t, n) {
4145
4145
  let r = new Blob([e], { type: `${n};charset=utf-8` }), i = URL.createObjectURL(r), a = document.createElement("a");
4146
4146
  a.href = i, a.download = t, document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(i);
4147
4147
  }
4148
- e.register("report", Qe, {
4148
+ e.register("report", $e, {
4149
4149
  namespace: "report",
4150
4150
  label: "Report",
4151
4151
  category: "Report",
@@ -4166,7 +4166,7 @@ e.register("report", Qe, {
4166
4166
  label: "Chart Configuration"
4167
4167
  }
4168
4168
  ]
4169
- }), e.register("spec-report", Qe, {
4169
+ }), e.register("spec-report", $e, {
4170
4170
  namespace: "report",
4171
4171
  label: "Spec Report",
4172
4172
  category: "Report",
@@ -4179,7 +4179,7 @@ e.register("report", Qe, {
4179
4179
  type: "string",
4180
4180
  label: "Report Type"
4181
4181
  }]
4182
- }), e.register("report-viewer", pt, {
4182
+ }), e.register("report-viewer", mt, {
4183
4183
  namespace: "report",
4184
4184
  label: "Report Viewer",
4185
4185
  category: "Report",
@@ -4192,7 +4192,7 @@ e.register("report", Qe, {
4192
4192
  type: "boolean",
4193
4193
  label: "Show Toolbar"
4194
4194
  }]
4195
- }), e.register("report-builder", ht, {
4195
+ }), e.register("report-builder", gt, {
4196
4196
  namespace: "report",
4197
4197
  label: "Report Builder",
4198
4198
  category: "Report",
@@ -4203,4 +4203,4 @@ e.register("report", Qe, {
4203
4203
  }]
4204
4204
  });
4205
4205
  //#endregion
4206
- export { St as JoinedBlocksEditor, Xe as JoinedReportRenderer, ge as LegacyReportRenderer, Ke as MatrixRenderer, ht as ReportBuilder, Gt as ReportConfigPanel, Qe as ReportRenderer, pt as ReportViewer, mt as ScheduleConfig, Ve as SpecReportGrid, J as aggregateRows, _e as bucketDate, Ee as buildAggregateQuery, Ne as buildDrillAction, Te as collectFields, K as columnKey, Fe as createDrillHandler, Jt as createScheduleTrigger, $e as exportAsCSV, rt as exportAsExcel, tt as exportAsHTML, et as exportAsJSON, nt as exportAsPDF, qt as exportExcelWithFormulas, it as exportReport, Kt as exportWithLiveData, lt as formatValue, ve as groupAndAggregate, q as groupingValue, Pe as isDrillAction, X as mergeFilters, ye as pivotRows, Ie as registerDrillHandler, Oe as useReportData, Ct as validateJoinedBlocks };
4206
+ export { Ct as JoinedBlocksEditor, Ze as JoinedReportRenderer, _e as LegacyReportRenderer, qe as MatrixRenderer, gt as ReportBuilder, Kt as ReportConfigPanel, $e as ReportRenderer, mt as ReportViewer, ht as ScheduleConfig, He as SpecReportGrid, J as aggregateRows, ve as bucketDate, De as buildAggregateQuery, Pe as buildDrillAction, Ee as collectFields, K as columnKey, Ie as createDrillHandler, Yt as createScheduleTrigger, et as exportAsCSV, it as exportAsExcel, nt as exportAsHTML, tt as exportAsJSON, rt as exportAsPDF, Jt as exportExcelWithFormulas, at as exportReport, qt as exportWithLiveData, ut as formatValue, ye as groupAndAggregate, q as groupingValue, Fe as isDrillAction, X as mergeFilters, be as pivotRows, Le as registerDrillHandler, ke as useReportData, wt as validateJoinedBlocks };