@object-ui/plugin-report 3.1.5 → 3.3.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
@@ -3,12 +3,9 @@ import * as t from "react";
3
3
  import n, { useState as r } from "react";
4
4
  import { Badge as i, Button as a, Card as o, CardContent as s, CardDescription as c, CardHeader as l, CardTitle as u, Checkbox as d, ConfigPanelRenderer as f, Input as p, Label as m, Skeleton as h, Tabs as g, TabsContent as _, TabsList as v, TabsTrigger as y, useConfigDraft as b } from "@object-ui/components";
5
5
  import { SchemaRenderer as x } from "@object-ui/react";
6
- import { Calendar as S, Clock as C, Download as w, Filter as T, Layers as E, Mail as D, Plus as O, Printer as k, RefreshCw as A, Save as j, Settings as M, Trash2 as N } from "lucide-react";
6
+ import { Calendar as S, Clock as C, Download as w, Filter as T, Layers as E, Mail as D, Plus as O, Printer as k, RefreshCw as A, Save as ee, Settings as j, Trash2 as M } from "lucide-react";
7
7
  //#region \0rolldown/runtime.js
8
- var P = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), F = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
9
- if (typeof require < "u") return require.apply(this, arguments);
10
- throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
11
- }), I = /* @__PURE__ */ P(((e) => {
8
+ var N = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), P = /* @__PURE__ */ N(((e) => {
12
9
  var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
13
10
  function r(e, n, r) {
14
11
  var i = null;
@@ -23,208 +20,50 @@ var P = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), F
23
20
  };
24
21
  }
25
22
  e.Fragment = n, e.jsx = r, e.jsxs = r;
26
- })), L = /* @__PURE__ */ P(((e) => {
27
- process.env.NODE_ENV !== "production" && (function() {
28
- function t(e) {
29
- if (e == null) return null;
30
- if (typeof e == "function") return e.$$typeof === O ? null : e.displayName || e.name || null;
31
- if (typeof e == "string") return e;
32
- switch (e) {
33
- case _: return "Fragment";
34
- case y: return "Profiler";
35
- case v: return "StrictMode";
36
- case C: return "Suspense";
37
- case w: return "SuspenseList";
38
- case D: return "Activity";
39
- }
40
- if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
41
- case g: return "Portal";
42
- case x: return e.displayName || "Context";
43
- case b: return (e._context.displayName || "Context") + ".Consumer";
44
- case S:
45
- var n = e.render;
46
- return e = e.displayName, e ||= (e = n.displayName || n.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
47
- case T: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
48
- case E:
49
- n = e._payload, e = e._init;
50
- try {
51
- return t(e(n));
52
- } catch {}
53
- }
54
- return null;
55
- }
56
- function n(e) {
57
- return "" + e;
58
- }
59
- function r(e) {
60
- try {
61
- n(e);
62
- var t = !1;
63
- } catch {
64
- t = !0;
65
- }
66
- if (t) {
67
- t = console;
68
- var r = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
69
- return r.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), n(e);
70
- }
71
- }
72
- function i(e) {
73
- if (e === _) return "<>";
74
- if (typeof e == "object" && e && e.$$typeof === E) return "<...>";
75
- try {
76
- var n = t(e);
77
- return n ? "<" + n + ">" : "<...>";
78
- } catch {
79
- return "<...>";
80
- }
81
- }
82
- function a() {
83
- var e = k.A;
84
- return e === null ? null : e.getOwner();
85
- }
86
- function o() {
87
- return Error("react-stack-top-frame");
88
- }
89
- function s(e) {
90
- if (A.call(e, "key")) {
91
- var t = Object.getOwnPropertyDescriptor(e, "key").get;
92
- if (t && t.isReactWarning) return !1;
93
- }
94
- return e.key !== void 0;
95
- }
96
- function c(e, t) {
97
- function n() {
98
- N || (N = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
99
- }
100
- n.isReactWarning = !0, Object.defineProperty(e, "key", {
101
- get: n,
102
- configurable: !0
103
- });
104
- }
105
- function l() {
106
- var e = t(this.type);
107
- return P[e] || (P[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
108
- }
109
- function u(e, t, n, r, i, a) {
110
- var o = n.ref;
111
- return e = {
112
- $$typeof: h,
113
- type: e,
114
- key: t,
115
- props: n,
116
- _owner: r
117
- }, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
118
- enumerable: !1,
119
- value: null
120
- }) : Object.defineProperty(e, "ref", {
121
- enumerable: !1,
122
- get: l
123
- }), e._store = {}, Object.defineProperty(e._store, "validated", {
124
- configurable: !1,
125
- enumerable: !1,
126
- writable: !0,
127
- value: 0
128
- }), Object.defineProperty(e, "_debugInfo", {
129
- configurable: !1,
130
- enumerable: !1,
131
- writable: !0,
132
- value: null
133
- }), Object.defineProperty(e, "_debugStack", {
134
- configurable: !1,
135
- enumerable: !1,
136
- writable: !0,
137
- value: i
138
- }), Object.defineProperty(e, "_debugTask", {
139
- configurable: !1,
140
- enumerable: !1,
141
- writable: !0,
142
- value: a
143
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
144
- }
145
- function d(e, n, i, o, l, d) {
146
- var p = n.children;
147
- if (p !== void 0) if (o) if (j(p)) {
148
- for (o = 0; o < p.length; o++) f(p[o]);
149
- Object.freeze && Object.freeze(p);
150
- } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
151
- else f(p);
152
- if (A.call(n, "key")) {
153
- p = t(e);
154
- var m = Object.keys(n).filter(function(e) {
155
- return e !== "key";
156
- });
157
- o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", R[p + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, p, m, p), R[p + o] = !0);
158
- }
159
- if (p = null, i !== void 0 && (r(i), p = "" + i), s(n) && (r(n.key), p = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
160
- else i = n;
161
- return p && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), u(e, p, i, a(), l, d);
162
- }
163
- function f(e) {
164
- p(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === E && (e._payload.status === "fulfilled" ? p(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
165
- }
166
- function p(e) {
167
- return typeof e == "object" && !!e && e.$$typeof === h;
168
- }
169
- var m = F("react"), h = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), x = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), O = Symbol.for("react.client.reference"), k = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, j = Array.isArray, M = console.createTask ? console.createTask : function() {
170
- return null;
171
- };
172
- m = { react_stack_bottom_frame: function(e) {
173
- return e();
174
- } };
175
- var N, P = {}, I = m.react_stack_bottom_frame.bind(m, o)(), L = M(i(o)), R = {};
176
- e.Fragment = _, e.jsx = function(e, t, n) {
177
- var r = 1e4 > k.recentlyCreatedOwnerStacks++;
178
- return d(e, t, n, !1, r ? Error("react-stack-top-frame") : I, r ? M(i(e)) : L);
179
- }, e.jsxs = function(e, t, n) {
180
- var r = 1e4 > k.recentlyCreatedOwnerStacks++;
181
- return d(e, t, n, !0, r ? Error("react-stack-top-frame") : I, r ? M(i(e)) : L);
182
- };
183
- })();
184
- })), R = (/* @__PURE__ */ P(((e, t) => {
185
- process.env.NODE_ENV === "production" ? t.exports = I() : t.exports = L();
186
- })))(), z = ({ schema: t }) => {
23
+ })), F = (/* @__PURE__ */ N(((e, t) => {
24
+ t.exports = P();
25
+ })))(), I = ({ schema: t }) => {
187
26
  let { title: n, description: r, data: i, columns: a } = t;
188
27
  t.chart?.type;
189
- let d = !!t.chart, f = process.env.NODE_ENV !== "test";
190
- return /* @__PURE__ */ (0, R.jsxs)(o, {
28
+ let d = !!t.chart;
29
+ return /* @__PURE__ */ (0, F.jsxs)(o, {
191
30
  className: `h-full flex flex-col ${t.className || ""}`,
192
- children: [/* @__PURE__ */ (0, R.jsxs)(l, { children: [n && /* @__PURE__ */ (0, R.jsx)(u, { children: n }), r && /* @__PURE__ */ (0, R.jsx)(c, { children: r })] }), /* @__PURE__ */ (0, R.jsxs)(s, {
31
+ children: [/* @__PURE__ */ (0, F.jsxs)(l, { children: [n && /* @__PURE__ */ (0, F.jsx)(u, { children: n }), r && /* @__PURE__ */ (0, F.jsx)(c, { children: r })] }), /* @__PURE__ */ (0, F.jsxs)(s, {
193
32
  className: "flex-1 overflow-auto space-y-4",
194
33
  children: [d && (() => {
195
34
  let n = t.chart?.type, r = n ? e.get(n) : null;
196
- return r ||= e.get("chart"), r ? /* @__PURE__ */ (0, R.jsx)("div", {
35
+ return r ||= e.get("chart"), r ? /* @__PURE__ */ (0, F.jsx)("div", {
197
36
  className: "min-h-[300px] border rounded-lg p-4 bg-background/50",
198
- children: /* @__PURE__ */ (0, R.jsx)(r, { schema: {
37
+ children: /* @__PURE__ */ (0, F.jsx)(r, { schema: {
199
38
  ...t.chart,
200
39
  data: t.chart.data || i
201
40
  } })
202
- }) : /* @__PURE__ */ (0, R.jsxs)("div", {
41
+ }) : /* @__PURE__ */ (0, F.jsxs)("div", {
203
42
  className: "min-h-[100px] border rounded-md p-4 bg-muted/20 text-muted-foreground flex items-center justify-center",
204
43
  children: ["Unknown component type: ", n || "chart"]
205
44
  });
206
- })(), i && i.length > 0 && /* @__PURE__ */ (0, R.jsx)("div", {
45
+ })(), i && i.length > 0 && /* @__PURE__ */ (0, F.jsx)("div", {
207
46
  className: "border rounded-lg",
208
47
  children: (() => {
209
- let t = f ? e.get("aggrid") || e.get("table") : null;
210
- return t ? /* @__PURE__ */ (0, R.jsx)(t, { schema: {
48
+ let t = e.get("aggrid") || e.get("table");
49
+ return t ? /* @__PURE__ */ (0, F.jsx)(t, { schema: {
211
50
  type: "aggrid",
212
51
  rowData: i,
213
52
  columnDefs: a,
214
53
  domLayout: "autoHeight"
215
- } }) : /* @__PURE__ */ (0, R.jsx)("div", {
54
+ } }) : /* @__PURE__ */ (0, F.jsx)("div", {
216
55
  className: "overflow-x-auto",
217
- children: /* @__PURE__ */ (0, R.jsxs)("table", {
56
+ children: /* @__PURE__ */ (0, F.jsxs)("table", {
218
57
  className: "w-full text-sm text-left",
219
- children: [/* @__PURE__ */ (0, R.jsx)("thead", {
58
+ children: [/* @__PURE__ */ (0, F.jsx)("thead", {
220
59
  className: "text-xs uppercase bg-muted",
221
- children: /* @__PURE__ */ (0, R.jsx)("tr", { children: a?.map((e) => /* @__PURE__ */ (0, R.jsx)("th", {
60
+ children: /* @__PURE__ */ (0, F.jsx)("tr", { children: a?.map((e) => /* @__PURE__ */ (0, F.jsx)("th", {
222
61
  className: "px-6 py-3",
223
62
  children: e.headerName || e.label || e.field
224
63
  }, e.field)) })
225
- }), /* @__PURE__ */ (0, R.jsx)("tbody", { children: i.map((e, t) => /* @__PURE__ */ (0, R.jsx)("tr", {
64
+ }), /* @__PURE__ */ (0, F.jsx)("tbody", { children: i.map((e, t) => /* @__PURE__ */ (0, F.jsx)("tr", {
226
65
  className: "bg-background border-b",
227
- children: a?.map((t) => /* @__PURE__ */ (0, R.jsx)("td", {
66
+ children: a?.map((t) => /* @__PURE__ */ (0, F.jsx)("td", {
228
67
  className: "px-6 py-4",
229
68
  children: e[t.field]
230
69
  }, t.field))
@@ -238,29 +77,29 @@ var P = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), F
238
77
  };
239
78
  //#endregion
240
79
  //#region src/ReportExportEngine.ts
241
- function B(e, t, n) {
80
+ function L(e, t, n) {
242
81
  let r = e.fields || [], i = r.map((e) => e.label || e.name), a = t.map((e) => r.map((t) => {
243
82
  let n = e[t.name];
244
- return n = q(n), typeof n == "string" && (n.includes(",") || n.includes("\"") || n.includes("\n")) ? `"${n.replace(/"/g, "\"\"")}"` : n ?? "";
83
+ return n = W(n), typeof n == "string" && (n.includes(",") || n.includes("\"") || n.includes("\n")) ? `"${n.replace(/"/g, "\"\"")}"` : n ?? "";
245
84
  }));
246
- X([...n?.includeHeaders === !1 ? [] : [i.join(",")], ...a.map((e) => e.join(","))].join("\n"), n?.filename || `${e.title || "report"}.csv`, "text/csv");
85
+ q([...n?.includeHeaders === !1 ? [] : [i.join(",")], ...a.map((e) => e.join(","))].join("\n"), n?.filename || `${e.title || "report"}.csv`, "text/csv");
247
86
  }
248
- function V(e, t, n) {
87
+ function R(e, t, n) {
249
88
  let r = {
250
89
  title: e.title,
251
90
  description: e.description,
252
91
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
253
92
  data: t
254
93
  };
255
- X(JSON.stringify(r, null, 2), n?.filename || `${e.title || "report"}.json`, "application/json");
94
+ q(JSON.stringify(r, null, 2), n?.filename || `${e.title || "report"}.json`, "application/json");
256
95
  }
257
- function H(e, t, n) {
258
- let r = e.fields || [], i = Y(n?.orientation), a = J(n?.pageSize);
259
- X(`<!DOCTYPE html>
96
+ function z(e, t, n) {
97
+ let r = e.fields || [], i = K(n?.orientation), a = G(n?.pageSize);
98
+ q(`<!DOCTYPE html>
260
99
  <html>
261
100
  <head>
262
101
  <meta charset="utf-8">
263
- <title>${K(e.title || "Report")}</title>
102
+ <title>${U(e.title || "Report")}</title>
264
103
  <style>
265
104
  @page { size: ${a} ${i}; margin: 20mm; }
266
105
  body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #333; }
@@ -274,20 +113,20 @@ function H(e, t, n) {
274
113
  </style>
275
114
  </head>
276
115
  <body>
277
- <h1>${K(e.title || "Report")}</h1>
278
- ${e.description ? `<p class="description">${K(e.description)}</p>` : ""}
116
+ <h1>${U(e.title || "Report")}</h1>
117
+ ${e.description ? `<p class="description">${U(e.description)}</p>` : ""}
279
118
  <p class="meta">Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}</p>
280
119
  <table>
281
- <thead><tr>${r.map((e) => `<th>${K(e.label || e.name)}</th>`).join("")}</tr></thead>
282
- <tbody>${t.map((e) => `<tr>${r.map((t) => `<td>${K(String(e[t.name] ?? ""))}</td>`).join("")}</tr>`).join("")}</tbody>
120
+ <thead><tr>${r.map((e) => `<th>${U(e.label || e.name)}</th>`).join("")}</tr></thead>
121
+ <tbody>${t.map((e) => `<tr>${r.map((t) => `<td>${U(String(e[t.name] ?? ""))}</td>`).join("")}</tr>`).join("")}</tbody>
283
122
  </table>
284
123
  </body>
285
124
  </html>`, n?.filename || `${e.title || "report"}.html`, "text/html");
286
125
  }
287
- function U(e, t, n) {
288
- let r = e.fields || [], i = Y(n?.orientation), a = J(n?.pageSize), o = window.open("", "_blank");
126
+ function B(e, t, n) {
127
+ let r = e.fields || [], i = K(n?.orientation), a = G(n?.pageSize), o = window.open("", "_blank");
289
128
  if (!o) {
290
- H(e, t, {
129
+ z(e, t, {
291
130
  ...n,
292
131
  format: "html",
293
132
  filename: n?.filename?.replace(/\.pdf$/, ".html") || `${e.title || "report"}.html`
@@ -298,7 +137,7 @@ function U(e, t, n) {
298
137
  <html>
299
138
  <head>
300
139
  <meta charset="utf-8">
301
- <title>${K(e.title || "Report")}</title>
140
+ <title>${U(e.title || "Report")}</title>
302
141
  <style>
303
142
  @page { size: ${a} ${i}; margin: 20mm; }
304
143
  @media print { .no-print { display: none; } }
@@ -313,56 +152,56 @@ function U(e, t, n) {
313
152
  </style>
314
153
  </head>
315
154
  <body>
316
- <h1>${K(e.title || "Report")}</h1>
317
- ${e.description ? `<p class="description">${K(e.description)}</p>` : ""}
155
+ <h1>${U(e.title || "Report")}</h1>
156
+ ${e.description ? `<p class="description">${U(e.description)}</p>` : ""}
318
157
  <p class="meta">Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}</p>
319
158
  <table>
320
- <thead><tr>${r.map((e) => `<th>${K(e.label || e.name)}</th>`).join("")}</tr></thead>
321
- <tbody>${t.map((e) => `<tr>${r.map((t) => `<td>${K(String(e[t.name] ?? ""))}</td>`).join("")}</tr>`).join("")}</tbody>
159
+ <thead><tr>${r.map((e) => `<th>${U(e.label || e.name)}</th>`).join("")}</tr></thead>
160
+ <tbody>${t.map((e) => `<tr>${r.map((t) => `<td>${U(String(e[t.name] ?? ""))}</td>`).join("")}</tr>`).join("")}</tbody>
322
161
  </table>
323
162
  </body>
324
163
  </html>`), o.document.close(), o.onload = () => {
325
164
  o.print();
326
165
  };
327
166
  }
328
- function W(e, t, n) {
167
+ function V(e, t, n) {
329
168
  let r = e.fields || [], i = r.map((e) => e.label || e.name), a = t.map((e) => r.map((t) => {
330
169
  let n = e[t.name];
331
- return n = q(n), typeof n == "string" && (n.includes(",") || n.includes("\"") || n.includes("\n") || n.includes(" ")) ? `"${n.replace(/"/g, "\"\"")}"` : n ?? "";
170
+ return n = W(n), typeof n == "string" && (n.includes(",") || n.includes("\"") || n.includes("\n") || n.includes(" ")) ? `"${n.replace(/"/g, "\"\"")}"` : n ?? "";
332
171
  }));
333
- X("" + [...n?.includeHeaders === !1 ? [] : [i.join(" ")], ...a.map((e) => e.join(" "))].join("\n"), n?.filename || `${e.title || "report"}.tsv`, "text/tab-separated-values");
172
+ q("" + [...n?.includeHeaders === !1 ? [] : [i.join(" ")], ...a.map((e) => e.join(" "))].join("\n"), n?.filename || `${e.title || "report"}.tsv`, "text/tab-separated-values");
334
173
  }
335
- function G(e, t, n, r) {
174
+ function H(e, t, n, r) {
336
175
  switch (e) {
337
176
  case "csv":
338
- B(t, n, r);
177
+ L(t, n, r);
339
178
  break;
340
179
  case "json":
341
- V(t, n, r);
180
+ R(t, n, r);
342
181
  break;
343
182
  case "html":
344
- H(t, n, r);
183
+ z(t, n, r);
345
184
  break;
346
185
  case "pdf":
347
- U(t, n, r);
186
+ B(t, n, r);
348
187
  break;
349
188
  case "excel":
350
- W(t, n, r);
189
+ V(t, n, r);
351
190
  break;
352
191
  default: console.warn(`Unsupported export format: ${e}`);
353
192
  }
354
193
  }
355
- function K(e) {
194
+ function U(e) {
356
195
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
357
196
  }
358
- function q(e) {
197
+ function W(e) {
359
198
  if (typeof e == "string" && e.length > 0) {
360
199
  let t = e.charAt(0);
361
200
  if (t === "=" || t === "+" || t === "-" || t === "@" || t === "|") return `\t${e}`;
362
201
  }
363
202
  return e;
364
203
  }
365
- function J(e) {
204
+ function G(e) {
366
205
  return [
367
206
  "A4",
368
207
  "A3",
@@ -370,19 +209,19 @@ function J(e) {
370
209
  "Legal"
371
210
  ].includes(e || "") ? e : "A4";
372
211
  }
373
- function Y(e) {
212
+ function K(e) {
374
213
  return e === "landscape" ? "landscape" : "portrait";
375
214
  }
376
- function X(e, t, n) {
215
+ function q(e, t, n) {
377
216
  let r = new Blob([e], { type: `${n};charset=utf-8` }), i = URL.createObjectURL(r), a = document.createElement("a");
378
217
  a.href = i, a.download = t, document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(i);
379
218
  }
380
219
  //#endregion
381
220
  //#region src/formatValue.ts
382
- function Z(e, t) {
221
+ function J(e, t) {
383
222
  if (e == null || e === "") return "";
384
223
  let n = t?.type, r = t?.format;
385
- if (n === "date" || r === "date" || ee(e)) return te(e);
224
+ if (n === "date" || r === "date" || te(e)) return ne(e);
386
225
  if (n === "number" || typeof e == "number") {
387
226
  let t = typeof e == "number" ? e : Number(e);
388
227
  return isNaN(t) ? String(e) : r === "currency" || r === "currency_cny" ? `¥${t.toLocaleString("en-US", {
@@ -398,10 +237,10 @@ function Z(e, t) {
398
237
  }
399
238
  return String(e);
400
239
  }
401
- function ee(e) {
240
+ function te(e) {
402
241
  return typeof e == "string" ? /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2})?/.test(e) : !1;
403
242
  }
404
- function te(e) {
243
+ function ne(e) {
405
244
  try {
406
245
  let t = new Date(e);
407
246
  return isNaN(t.getTime()) ? String(e) : `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`;
@@ -411,7 +250,7 @@ function te(e) {
411
250
  }
412
251
  //#endregion
413
252
  //#region src/ReportViewer.tsx
414
- function ne(e, t) {
253
+ function re(e, t) {
415
254
  if (!t || t.length === 0 || !e || e.length === 0) return null;
416
255
  let n = t[0], r = n.field, i = /* @__PURE__ */ new Map();
417
256
  for (let t of e) {
@@ -427,13 +266,13 @@ function ne(e, t) {
427
266
  let o = n.sort === "desc" ? -1 : 1;
428
267
  return a.sort((e, t) => e.key.localeCompare(t.key) * o), a;
429
268
  }
430
- var Q = ({ schema: t, onRefresh: r }) => {
269
+ var Y = ({ schema: t, onRefresh: r }) => {
431
270
  let { report: d, data: f, showToolbar: p = !0, allowExport: m = !0, allowPrint: g = !0, loading: _ = !1 } = t, v = (e) => {
432
271
  if (!d) {
433
272
  console.warn("ReportViewer: Cannot export, no report defined");
434
273
  return;
435
274
  }
436
- G(e, d, f || [], d.exportConfigs?.[e]);
275
+ H(e, d, f || [], d.exportConfigs?.[e]);
437
276
  }, y = () => {
438
277
  window.print();
439
278
  }, b = () => {
@@ -476,111 +315,111 @@ var Q = ({ schema: t, onRefresh: r }) => {
476
315
  return r.backgroundColor && (e.backgroundColor = r.backgroundColor), r.textColor && (e.color = r.textColor), e;
477
316
  }
478
317
  }
479
- }, T = (e, t) => e == null || e === "" ? "" : t.renderAs === "badge" ? /* @__PURE__ */ (0, R.jsx)(i, {
318
+ }, T = (e, t) => e == null || e === "" ? "" : t.renderAs === "badge" ? /* @__PURE__ */ (0, F.jsx)(i, {
480
319
  className: t.colorMap?.[String(e)] || "",
481
320
  children: String(e)
482
- }) : Z(e, t);
483
- return d ? /* @__PURE__ */ (0, R.jsxs)("div", {
321
+ }) : J(e, t);
322
+ return d ? /* @__PURE__ */ (0, F.jsxs)("div", {
484
323
  className: "space-y-4",
485
- children: [p && /* @__PURE__ */ (0, R.jsxs)("div", {
324
+ children: [p && /* @__PURE__ */ (0, F.jsxs)("div", {
486
325
  className: "flex items-center justify-between gap-2 p-4 bg-card rounded-lg border",
487
- children: [/* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)("h2", {
326
+ children: [/* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)("h2", {
488
327
  className: "text-lg font-semibold",
489
328
  children: d.title
490
- }), d.description && /* @__PURE__ */ (0, R.jsx)("p", {
329
+ }), d.description && /* @__PURE__ */ (0, F.jsx)("p", {
491
330
  className: "text-sm text-muted-foreground",
492
331
  children: d.description
493
- })] }), /* @__PURE__ */ (0, R.jsxs)("div", {
332
+ })] }), /* @__PURE__ */ (0, F.jsxs)("div", {
494
333
  className: "flex items-center gap-2",
495
334
  children: [
496
- d.refreshInterval && /* @__PURE__ */ (0, R.jsxs)(a, {
335
+ d.refreshInterval && /* @__PURE__ */ (0, F.jsxs)(a, {
497
336
  variant: "outline",
498
337
  size: "sm",
499
338
  onClick: b,
500
- children: [/* @__PURE__ */ (0, R.jsx)(A, { className: "h-4 w-4 mr-2" }), "Refresh"]
339
+ children: [/* @__PURE__ */ (0, F.jsx)(A, { className: "h-4 w-4 mr-2" }), "Refresh"]
501
340
  }),
502
- g && /* @__PURE__ */ (0, R.jsxs)(a, {
341
+ g && /* @__PURE__ */ (0, F.jsxs)(a, {
503
342
  variant: "outline",
504
343
  size: "sm",
505
344
  onClick: y,
506
- children: [/* @__PURE__ */ (0, R.jsx)(k, { className: "h-4 w-4 mr-2" }), "Print"]
345
+ children: [/* @__PURE__ */ (0, F.jsx)(k, { className: "h-4 w-4 mr-2" }), "Print"]
507
346
  }),
508
- m && d.showExportButtons && /* @__PURE__ */ (0, R.jsxs)("div", {
347
+ m && d.showExportButtons && /* @__PURE__ */ (0, F.jsxs)("div", {
509
348
  className: "flex items-center gap-1",
510
349
  children: [
511
- /* @__PURE__ */ (0, R.jsxs)(a, {
350
+ /* @__PURE__ */ (0, F.jsxs)(a, {
512
351
  variant: "outline",
513
352
  size: "sm",
514
353
  onClick: () => v("pdf"),
515
- children: [/* @__PURE__ */ (0, R.jsx)(w, { className: "h-4 w-4 mr-2" }), "PDF"]
354
+ children: [/* @__PURE__ */ (0, F.jsx)(w, { className: "h-4 w-4 mr-2" }), "PDF"]
516
355
  }),
517
- /* @__PURE__ */ (0, R.jsxs)(a, {
356
+ /* @__PURE__ */ (0, F.jsxs)(a, {
518
357
  variant: "outline",
519
358
  size: "sm",
520
359
  onClick: () => v("excel"),
521
- children: [/* @__PURE__ */ (0, R.jsx)(w, { className: "h-4 w-4 mr-2" }), "Excel"]
360
+ children: [/* @__PURE__ */ (0, F.jsx)(w, { className: "h-4 w-4 mr-2" }), "Excel"]
522
361
  }),
523
- /* @__PURE__ */ (0, R.jsxs)(a, {
362
+ /* @__PURE__ */ (0, F.jsxs)(a, {
524
363
  variant: "outline",
525
364
  size: "sm",
526
365
  onClick: () => v("csv"),
527
- children: [/* @__PURE__ */ (0, R.jsx)(w, { className: "h-4 w-4 mr-2" }), "CSV"]
366
+ children: [/* @__PURE__ */ (0, F.jsx)(w, { className: "h-4 w-4 mr-2" }), "CSV"]
528
367
  })
529
368
  ]
530
369
  })
531
370
  ]
532
371
  })]
533
- }), /* @__PURE__ */ (0, R.jsxs)(o, { children: [/* @__PURE__ */ (0, R.jsxs)(l, { children: [!p && d.title && /* @__PURE__ */ (0, R.jsx)(u, { children: d.title }), !p && d.description && /* @__PURE__ */ (0, R.jsx)(c, { children: d.description })] }), /* @__PURE__ */ (0, R.jsxs)(s, {
372
+ }), /* @__PURE__ */ (0, F.jsxs)(o, { children: [/* @__PURE__ */ (0, F.jsxs)(l, { children: [!p && d.title && /* @__PURE__ */ (0, F.jsx)(u, { children: d.title }), !p && d.description && /* @__PURE__ */ (0, F.jsx)(c, { children: d.description })] }), /* @__PURE__ */ (0, F.jsxs)(s, {
534
373
  className: "space-y-6",
535
374
  children: [
536
- _ && /* @__PURE__ */ (0, R.jsxs)("div", {
375
+ _ && /* @__PURE__ */ (0, F.jsxs)("div", {
537
376
  className: "space-y-6",
538
- children: [/* @__PURE__ */ (0, R.jsx)("div", {
377
+ children: [/* @__PURE__ */ (0, F.jsx)("div", {
539
378
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
540
379
  children: [
541
380
  1,
542
381
  2,
543
382
  3
544
- ].map((e) => /* @__PURE__ */ (0, R.jsx)(o, { children: /* @__PURE__ */ (0, R.jsxs)(s, {
383
+ ].map((e) => /* @__PURE__ */ (0, F.jsx)(o, { children: /* @__PURE__ */ (0, F.jsxs)(s, {
545
384
  className: "p-4 space-y-2",
546
- children: [/* @__PURE__ */ (0, R.jsx)(h, { className: "h-4 w-20" }), /* @__PURE__ */ (0, R.jsx)(h, { className: "h-8 w-28" })]
385
+ children: [/* @__PURE__ */ (0, F.jsx)(h, { className: "h-4 w-20" }), /* @__PURE__ */ (0, F.jsx)(h, { className: "h-8 w-28" })]
547
386
  }) }, e))
548
- }), /* @__PURE__ */ (0, R.jsxs)("div", {
387
+ }), /* @__PURE__ */ (0, F.jsxs)("div", {
549
388
  className: "space-y-2",
550
- children: [/* @__PURE__ */ (0, R.jsx)(h, { className: "h-10 w-full" }), [
389
+ children: [/* @__PURE__ */ (0, F.jsx)(h, { className: "h-10 w-full" }), [
551
390
  1,
552
391
  2,
553
392
  3,
554
393
  4,
555
394
  5
556
- ].map((e) => /* @__PURE__ */ (0, R.jsx)(h, { className: "h-8 w-full" }, e))]
395
+ ].map((e) => /* @__PURE__ */ (0, F.jsx)(h, { className: "h-8 w-full" }, e))]
557
396
  })]
558
397
  }),
559
- !_ && d.sections?.map((t, r) => t.visible === !1 ? null : /* @__PURE__ */ (0, R.jsxs)("div", {
398
+ !_ && d.sections?.map((t, r) => t.visible === !1 ? null : /* @__PURE__ */ (0, F.jsxs)("div", {
560
399
  className: "space-y-2",
561
400
  children: [
562
- t.title && t.type !== "header" && /* @__PURE__ */ (0, R.jsx)("h3", {
401
+ t.title && t.type !== "header" && /* @__PURE__ */ (0, F.jsx)("h3", {
563
402
  className: "text-lg font-semibold border-b pb-2",
564
403
  children: t.title
565
404
  }),
566
- t.type === "header" && t.title && /* @__PURE__ */ (0, R.jsx)("div", {
405
+ t.type === "header" && t.title && /* @__PURE__ */ (0, F.jsx)("div", {
567
406
  className: "text-2xl font-bold py-4",
568
407
  children: t.title
569
408
  }),
570
- t.type === "summary" && /* @__PURE__ */ (0, R.jsx)("div", {
409
+ t.type === "summary" && /* @__PURE__ */ (0, F.jsx)("div", {
571
410
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
572
- children: d.fields?.filter((e) => e.showInSummary).map((e, t) => /* @__PURE__ */ (0, R.jsx)(o, { children: /* @__PURE__ */ (0, R.jsxs)(s, {
411
+ children: d.fields?.filter((e) => e.showInSummary).map((e, t) => /* @__PURE__ */ (0, F.jsx)(o, { children: /* @__PURE__ */ (0, F.jsxs)(s, {
573
412
  className: "p-4",
574
- children: [/* @__PURE__ */ (0, R.jsx)("div", {
413
+ children: [/* @__PURE__ */ (0, F.jsx)("div", {
575
414
  className: "text-sm text-muted-foreground",
576
415
  children: e.label || e.name
577
- }), /* @__PURE__ */ (0, R.jsx)("div", {
416
+ }), /* @__PURE__ */ (0, F.jsx)("div", {
578
417
  className: "text-2xl font-bold",
579
- children: Z(S(e.name, e.aggregation), e)
418
+ children: J(S(e.name, e.aggregation), e)
580
419
  })]
581
420
  }) }, t))
582
421
  }),
583
- t.type === "chart" && t.chart && /* @__PURE__ */ (0, R.jsx)("div", {
422
+ t.type === "chart" && t.chart && /* @__PURE__ */ (0, F.jsx)("div", {
584
423
  className: "min-h-[300px]",
585
424
  children: (() => {
586
425
  let n = t.chart.type, r = !!t.chart.chartType;
@@ -590,7 +429,7 @@ var Q = ({ schema: t, onRefresh: r }) => {
590
429
  series: t.chart.series || (t.chart.yAxisFields ? t.chart.yAxisFields.map((e) => ({ dataKey: e })) : []),
591
430
  chartType: t.chart.chartType || "bar"
592
431
  } : {};
593
- return /* @__PURE__ */ (0, R.jsx)(x, { schema: {
432
+ return /* @__PURE__ */ (0, F.jsx)(x, { schema: {
594
433
  ...t.chart,
595
434
  type: n,
596
435
  ...i,
@@ -599,21 +438,21 @@ var Q = ({ schema: t, onRefresh: r }) => {
599
438
  } });
600
439
  })()
601
440
  }),
602
- t.type === "table" && /* @__PURE__ */ (0, R.jsx)("div", {
441
+ t.type === "table" && /* @__PURE__ */ (0, F.jsx)("div", {
603
442
  className: "border rounded-lg overflow-x-auto",
604
- children: /* @__PURE__ */ (0, R.jsxs)("table", {
443
+ children: /* @__PURE__ */ (0, F.jsxs)("table", {
605
444
  className: "w-full text-sm min-w-[600px]",
606
- children: [/* @__PURE__ */ (0, R.jsx)("thead", {
445
+ children: [/* @__PURE__ */ (0, F.jsx)("thead", {
607
446
  className: "bg-muted",
608
- children: /* @__PURE__ */ (0, R.jsx)("tr", { children: t.columns?.map((e, t) => /* @__PURE__ */ (0, R.jsx)("th", {
447
+ children: /* @__PURE__ */ (0, F.jsx)("tr", { children: t.columns?.map((e, t) => /* @__PURE__ */ (0, F.jsx)("th", {
609
448
  className: `px-4 py-2 font-medium ${e.type === "number" ? "text-right" : "text-left"}`,
610
449
  children: e.label || e.name
611
450
  }, t)) })
612
- }), /* @__PURE__ */ (0, R.jsx)("tbody", { children: (() => {
613
- let e = ne(f || [], d.groupBy || []);
614
- return e ? e.map((e) => /* @__PURE__ */ (0, R.jsxs)(n.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)("tr", {
451
+ }), /* @__PURE__ */ (0, F.jsx)("tbody", { children: (() => {
452
+ let e = re(f || [], d.groupBy || []);
453
+ return e ? e.map((e) => /* @__PURE__ */ (0, F.jsxs)(n.Fragment, { children: [/* @__PURE__ */ (0, F.jsx)("tr", {
615
454
  className: "bg-muted/60",
616
- children: /* @__PURE__ */ (0, R.jsxs)("td", {
455
+ children: /* @__PURE__ */ (0, F.jsxs)("td", {
617
456
  colSpan: t.columns?.length || 1,
618
457
  className: "px-4 py-2 font-semibold text-sm",
619
458
  children: [
@@ -623,16 +462,16 @@ var Q = ({ schema: t, onRefresh: r }) => {
623
462
  ")"
624
463
  ]
625
464
  })
626
- }), e.rows.map((e, n) => /* @__PURE__ */ (0, R.jsx)("tr", {
465
+ }), e.rows.map((e, n) => /* @__PURE__ */ (0, F.jsx)("tr", {
627
466
  className: "border-t hover:bg-muted/50 even:bg-muted/20",
628
- children: t.columns?.map((t, n) => /* @__PURE__ */ (0, R.jsx)("td", {
467
+ children: t.columns?.map((t, n) => /* @__PURE__ */ (0, F.jsx)("td", {
629
468
  className: `px-4 py-2 ${t.type === "number" ? "text-right tabular-nums" : ""}`,
630
469
  style: C(t.name, e[t.name]),
631
470
  children: T(e[t.name], t)
632
471
  }, n))
633
- }, n))] }, e.key)) : f?.map((e, n) => /* @__PURE__ */ (0, R.jsx)("tr", {
472
+ }, n))] }, e.key)) : f?.map((e, n) => /* @__PURE__ */ (0, F.jsx)("tr", {
634
473
  className: "border-t hover:bg-muted/50 even:bg-muted/20",
635
- children: t.columns?.map((t, n) => /* @__PURE__ */ (0, R.jsx)("td", {
474
+ children: t.columns?.map((t, n) => /* @__PURE__ */ (0, F.jsx)("td", {
636
475
  className: `px-4 py-2 ${t.type === "number" ? "text-right tabular-nums" : ""}`,
637
476
  style: C(t.name, e[t.name]),
638
477
  children: T(e[t.name], t)
@@ -641,27 +480,27 @@ var Q = ({ schema: t, onRefresh: r }) => {
641
480
  })() })]
642
481
  })
643
482
  }),
644
- t.type === "text" && t.text && /* @__PURE__ */ (0, R.jsx)("div", {
483
+ t.type === "text" && t.text && /* @__PURE__ */ (0, F.jsx)("div", {
645
484
  className: "prose max-w-none",
646
- children: /* @__PURE__ */ (0, R.jsx)("p", { children: t.text })
485
+ children: /* @__PURE__ */ (0, F.jsx)("p", { children: t.text })
647
486
  }),
648
- t.type === "page-break" && /* @__PURE__ */ (0, R.jsx)("div", { className: "border-t-2 border-dashed my-8 print:page-break-after-always" }),
649
- t.content && /* @__PURE__ */ (0, R.jsx)(x, { schema: t.content })
487
+ t.type === "page-break" && /* @__PURE__ */ (0, F.jsx)("div", { className: "border-t-2 border-dashed my-8 print:page-break-after-always" }),
488
+ t.content && /* @__PURE__ */ (0, F.jsx)(x, { schema: t.content })
650
489
  ]
651
490
  }, r)),
652
- !d.sections && f && f.length > 0 && /* @__PURE__ */ (0, R.jsx)("div", {
491
+ !d.sections && f && f.length > 0 && /* @__PURE__ */ (0, F.jsx)("div", {
653
492
  className: "border rounded-lg overflow-x-auto",
654
- children: /* @__PURE__ */ (0, R.jsxs)("table", {
493
+ children: /* @__PURE__ */ (0, F.jsxs)("table", {
655
494
  className: "w-full text-sm min-w-[600px]",
656
- children: [/* @__PURE__ */ (0, R.jsx)("thead", {
495
+ children: [/* @__PURE__ */ (0, F.jsx)("thead", {
657
496
  className: "bg-muted",
658
- children: /* @__PURE__ */ (0, R.jsx)("tr", { children: d.fields?.map((e, t) => /* @__PURE__ */ (0, R.jsx)("th", {
497
+ children: /* @__PURE__ */ (0, F.jsx)("tr", { children: d.fields?.map((e, t) => /* @__PURE__ */ (0, F.jsx)("th", {
659
498
  className: `px-4 py-2 font-medium ${e.type === "number" ? "text-right" : "text-left"}`,
660
499
  children: e.label || e.name
661
500
  }, t)) })
662
- }), /* @__PURE__ */ (0, R.jsx)("tbody", { children: f.map((e, t) => /* @__PURE__ */ (0, R.jsx)("tr", {
501
+ }), /* @__PURE__ */ (0, F.jsx)("tbody", { children: f.map((e, t) => /* @__PURE__ */ (0, F.jsx)("tr", {
663
502
  className: "border-t hover:bg-muted/50 even:bg-muted/20",
664
- children: d.fields?.map((t, n) => /* @__PURE__ */ (0, R.jsx)("td", {
503
+ children: d.fields?.map((t, n) => /* @__PURE__ */ (0, F.jsx)("td", {
665
504
  className: `px-4 py-2 ${t.type === "number" ? "text-right tabular-nums" : ""}`,
666
505
  style: C(t.name, e[t.name]),
667
506
  children: T(e[t.name], t)
@@ -671,11 +510,11 @@ var Q = ({ schema: t, onRefresh: r }) => {
671
510
  })
672
511
  ]
673
512
  })] })]
674
- }) : /* @__PURE__ */ (0, R.jsx)(o, { children: /* @__PURE__ */ (0, R.jsx)(s, {
513
+ }) : /* @__PURE__ */ (0, F.jsx)(o, { children: /* @__PURE__ */ (0, F.jsx)(s, {
675
514
  className: "p-8 text-center text-muted-foreground",
676
515
  children: "No report to display"
677
516
  }) });
678
- }, $ = ({ schedule: e, onChange: t }) => {
517
+ }, X = ({ schedule: e, onChange: t }) => {
679
518
  let [n, i] = r(e || {
680
519
  enabled: !1,
681
520
  frequency: "weekly",
@@ -690,27 +529,27 @@ var Q = ({ schema: t, onRefresh: r }) => {
690
529
  };
691
530
  i(r), t?.(r);
692
531
  };
693
- return /* @__PURE__ */ (0, R.jsxs)(o, { children: [/* @__PURE__ */ (0, R.jsx)(l, { children: /* @__PURE__ */ (0, R.jsxs)(u, {
532
+ return /* @__PURE__ */ (0, F.jsxs)(o, { children: [/* @__PURE__ */ (0, F.jsx)(l, { children: /* @__PURE__ */ (0, F.jsxs)(u, {
694
533
  className: "flex items-center gap-2",
695
- children: [/* @__PURE__ */ (0, R.jsx)(S, { className: "h-5 w-5" }), "Schedule Configuration"]
696
- }) }), /* @__PURE__ */ (0, R.jsxs)(s, {
534
+ children: [/* @__PURE__ */ (0, F.jsx)(S, { className: "h-5 w-5" }), "Schedule Configuration"]
535
+ }) }), /* @__PURE__ */ (0, F.jsxs)(s, {
697
536
  className: "space-y-4",
698
- children: [/* @__PURE__ */ (0, R.jsxs)("div", {
537
+ children: [/* @__PURE__ */ (0, F.jsxs)("div", {
699
538
  className: "flex items-center gap-2",
700
- children: [/* @__PURE__ */ (0, R.jsx)("input", {
539
+ children: [/* @__PURE__ */ (0, F.jsx)("input", {
701
540
  type: "checkbox",
702
541
  id: "schedule-enabled",
703
542
  checked: n.enabled || !1,
704
543
  onChange: (e) => a({ enabled: e.target.checked }),
705
544
  className: "rounded"
706
- }), /* @__PURE__ */ (0, R.jsx)(m, {
545
+ }), /* @__PURE__ */ (0, F.jsx)(m, {
707
546
  htmlFor: "schedule-enabled",
708
547
  children: "Enable Scheduled Report"
709
548
  })]
710
- }), n.enabled && /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [
711
- /* @__PURE__ */ (0, R.jsxs)("div", {
549
+ }), n.enabled && /* @__PURE__ */ (0, F.jsxs)(F.Fragment, { children: [
550
+ /* @__PURE__ */ (0, F.jsxs)("div", {
712
551
  className: "space-y-2",
713
- children: [/* @__PURE__ */ (0, R.jsx)(m, { children: "Frequency" }), /* @__PURE__ */ (0, R.jsx)("select", {
552
+ children: [/* @__PURE__ */ (0, F.jsx)(m, { children: "Frequency" }), /* @__PURE__ */ (0, F.jsx)("select", {
714
553
  className: "w-full border rounded-md p-2 bg-background",
715
554
  value: n.frequency || "weekly",
716
555
  onChange: (e) => a({ frequency: e.target.value }),
@@ -739,15 +578,15 @@ var Q = ({ schema: t, onRefresh: r }) => {
739
578
  value: "yearly",
740
579
  label: "Yearly"
741
580
  }
742
- ].map((e) => /* @__PURE__ */ (0, R.jsx)("option", {
581
+ ].map((e) => /* @__PURE__ */ (0, F.jsx)("option", {
743
582
  value: e.value,
744
583
  children: e.label
745
584
  }, e.value))
746
585
  })]
747
586
  }),
748
- n.frequency === "weekly" && /* @__PURE__ */ (0, R.jsxs)("div", {
587
+ n.frequency === "weekly" && /* @__PURE__ */ (0, F.jsxs)("div", {
749
588
  className: "space-y-2",
750
- children: [/* @__PURE__ */ (0, R.jsx)(m, { children: "Day of Week" }), /* @__PURE__ */ (0, R.jsx)("select", {
589
+ children: [/* @__PURE__ */ (0, F.jsx)(m, { children: "Day of Week" }), /* @__PURE__ */ (0, F.jsx)("select", {
751
590
  className: "w-full border rounded-md p-2 bg-background",
752
591
  value: n.dayOfWeek ?? 1,
753
592
  onChange: (e) => a({ dayOfWeek: Number(e.target.value) }),
@@ -780,15 +619,15 @@ var Q = ({ schema: t, onRefresh: r }) => {
780
619
  value: 6,
781
620
  label: "Saturday"
782
621
  }
783
- ].map((e) => /* @__PURE__ */ (0, R.jsx)("option", {
622
+ ].map((e) => /* @__PURE__ */ (0, F.jsx)("option", {
784
623
  value: e.value,
785
624
  children: e.label
786
625
  }, e.value))
787
626
  })]
788
627
  }),
789
- n.frequency === "monthly" && /* @__PURE__ */ (0, R.jsxs)("div", {
628
+ n.frequency === "monthly" && /* @__PURE__ */ (0, F.jsxs)("div", {
790
629
  className: "space-y-2",
791
- children: [/* @__PURE__ */ (0, R.jsx)(m, { children: "Day of Month" }), /* @__PURE__ */ (0, R.jsx)(p, {
630
+ children: [/* @__PURE__ */ (0, F.jsx)(m, { children: "Day of Month" }), /* @__PURE__ */ (0, F.jsx)(p, {
792
631
  type: "number",
793
632
  min: 1,
794
633
  max: 31,
@@ -796,28 +635,28 @@ var Q = ({ schema: t, onRefresh: r }) => {
796
635
  onChange: (e) => a({ dayOfMonth: Number(e.target.value) })
797
636
  })]
798
637
  }),
799
- /* @__PURE__ */ (0, R.jsxs)("div", {
638
+ /* @__PURE__ */ (0, F.jsxs)("div", {
800
639
  className: "space-y-2",
801
- children: [/* @__PURE__ */ (0, R.jsxs)(m, {
640
+ children: [/* @__PURE__ */ (0, F.jsxs)(m, {
802
641
  className: "flex items-center gap-2",
803
- children: [/* @__PURE__ */ (0, R.jsx)(C, { className: "h-4 w-4" }), "Time"]
804
- }), /* @__PURE__ */ (0, R.jsx)(p, {
642
+ children: [/* @__PURE__ */ (0, F.jsx)(C, { className: "h-4 w-4" }), "Time"]
643
+ }), /* @__PURE__ */ (0, F.jsx)(p, {
805
644
  type: "time",
806
645
  value: n.time || "09:00",
807
646
  onChange: (e) => a({ time: e.target.value })
808
647
  })]
809
648
  }),
810
- /* @__PURE__ */ (0, R.jsxs)("div", {
649
+ /* @__PURE__ */ (0, F.jsxs)("div", {
811
650
  className: "space-y-2",
812
- children: [/* @__PURE__ */ (0, R.jsx)(m, { children: "Timezone" }), /* @__PURE__ */ (0, R.jsx)(p, {
651
+ children: [/* @__PURE__ */ (0, F.jsx)(m, { children: "Timezone" }), /* @__PURE__ */ (0, F.jsx)(p, {
813
652
  value: n.timezone || "",
814
653
  onChange: (e) => a({ timezone: e.target.value }),
815
654
  placeholder: "e.g. America/New_York"
816
655
  })]
817
656
  }),
818
- /* @__PURE__ */ (0, R.jsxs)("div", {
657
+ /* @__PURE__ */ (0, F.jsxs)("div", {
819
658
  className: "space-y-2",
820
- children: [/* @__PURE__ */ (0, R.jsx)(m, { children: "Export Formats" }), /* @__PURE__ */ (0, R.jsx)("div", {
659
+ children: [/* @__PURE__ */ (0, F.jsx)(m, { children: "Export Formats" }), /* @__PURE__ */ (0, F.jsx)("div", {
821
660
  className: "flex flex-wrap gap-2",
822
661
  children: [
823
662
  {
@@ -836,9 +675,9 @@ var Q = ({ schema: t, onRefresh: r }) => {
836
675
  value: "html",
837
676
  label: "HTML"
838
677
  }
839
- ].map((e) => /* @__PURE__ */ (0, R.jsxs)("label", {
678
+ ].map((e) => /* @__PURE__ */ (0, F.jsxs)("label", {
840
679
  className: "flex items-center gap-1.5 px-3 py-1.5 border rounded-md cursor-pointer hover:bg-muted/50",
841
- children: [/* @__PURE__ */ (0, R.jsx)("input", {
680
+ children: [/* @__PURE__ */ (0, F.jsx)("input", {
842
681
  type: "checkbox",
843
682
  checked: n.formats?.includes(e.value) || !1,
844
683
  onChange: (t) => {
@@ -846,27 +685,27 @@ var Q = ({ schema: t, onRefresh: r }) => {
846
685
  a({ formats: t.target.checked ? [...r, e.value] : r.filter((t) => t !== e.value) });
847
686
  },
848
687
  className: "rounded"
849
- }), /* @__PURE__ */ (0, R.jsx)("span", {
688
+ }), /* @__PURE__ */ (0, F.jsx)("span", {
850
689
  className: "text-sm",
851
690
  children: e.label
852
691
  })]
853
692
  }, e.value))
854
693
  })]
855
694
  }),
856
- /* @__PURE__ */ (0, R.jsxs)("div", {
695
+ /* @__PURE__ */ (0, F.jsxs)("div", {
857
696
  className: "space-y-2",
858
- children: [/* @__PURE__ */ (0, R.jsxs)(m, {
697
+ children: [/* @__PURE__ */ (0, F.jsxs)(m, {
859
698
  className: "flex items-center gap-2",
860
- children: [/* @__PURE__ */ (0, R.jsx)(D, { className: "h-4 w-4" }), "Email Recipients"]
861
- }), /* @__PURE__ */ (0, R.jsx)(p, {
699
+ children: [/* @__PURE__ */ (0, F.jsx)(D, { className: "h-4 w-4" }), "Email Recipients"]
700
+ }), /* @__PURE__ */ (0, F.jsx)(p, {
862
701
  placeholder: "email1@example.com, email2@example.com",
863
702
  value: n.recipients?.join(", ") || "",
864
703
  onChange: (e) => a({ recipients: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
865
704
  })]
866
705
  }),
867
- /* @__PURE__ */ (0, R.jsxs)("div", {
706
+ /* @__PURE__ */ (0, F.jsxs)("div", {
868
707
  className: "space-y-2",
869
- children: [/* @__PURE__ */ (0, R.jsx)(m, { children: "Email Subject" }), /* @__PURE__ */ (0, R.jsx)(p, {
708
+ children: [/* @__PURE__ */ (0, F.jsx)(m, { children: "Email Subject" }), /* @__PURE__ */ (0, F.jsx)(p, {
870
709
  value: n.subject || "",
871
710
  onChange: (e) => a({ subject: e.target.value }),
872
711
  placeholder: "Scheduled Report: {report_title}"
@@ -874,7 +713,7 @@ var Q = ({ schema: t, onRefresh: r }) => {
874
713
  })
875
714
  ] })]
876
715
  })] });
877
- }, re = ({ schema: e }) => {
716
+ }, Z = ({ schema: e }) => {
878
717
  let { report: t, dataSources: n = [], availableFields: i = [], showPreview: d = !0, onSave: f, onCancel: h } = e, [b, x] = r(t || {
879
718
  type: "report",
880
719
  title: "New Report",
@@ -884,7 +723,7 @@ var Q = ({ schema: t, onRefresh: r }) => {
884
723
  sections: [],
885
724
  showExportButtons: !0,
886
725
  showPrintButton: !0
887
- }), [C, w] = r(b.fields || []), [D, k] = r(b.filters || []), [A, P] = r(b.groupBy || []), [F, I] = r(b.sections || []), L = () => {
726
+ }), [C, w] = r(b.fields || []), [D, k] = r(b.filters || []), [A, N] = r(b.groupBy || []), [P, I] = r(b.sections || []), L = () => {
888
727
  if (i.length > 0 && C.length < i.length) {
889
728
  let e = i.find((e) => !C.some((t) => t.name === e.name));
890
729
  if (e) {
@@ -895,19 +734,19 @@ var Q = ({ schema: t, onRefresh: r }) => {
895
734
  });
896
735
  }
897
736
  }
898
- }, z = (e) => {
737
+ }, R = (e) => {
899
738
  let t = C.filter((t, n) => n !== e);
900
739
  w(t), x({
901
740
  ...b,
902
741
  fields: t
903
742
  });
904
- }, B = (e, t) => {
743
+ }, z = (e, t) => {
905
744
  let n = [...C];
906
745
  n[e] = t, w(n), x({
907
746
  ...b,
908
747
  fields: n
909
748
  });
910
- }, V = () => {
749
+ }, B = () => {
911
750
  let e = {
912
751
  field: i[0]?.name || "",
913
752
  operator: "equals",
@@ -917,108 +756,108 @@ var Q = ({ schema: t, onRefresh: r }) => {
917
756
  ...b,
918
757
  filters: t
919
758
  });
920
- }, H = (e) => {
759
+ }, V = (e) => {
921
760
  let t = D.filter((t, n) => n !== e);
922
761
  k(t), x({
923
762
  ...b,
924
763
  filters: t
925
764
  });
926
- }, U = (e, t) => {
765
+ }, H = (e, t) => {
927
766
  let n = [...D];
928
767
  n[e] = t, k(n), x({
929
768
  ...b,
930
769
  filters: n
931
770
  });
932
- }, W = () => {
771
+ }, U = () => {
933
772
  let e = {
934
773
  field: i[0]?.name || "",
935
774
  sort: "asc"
936
775
  }, t = [...A, e];
937
- P(t), x({
776
+ N(t), x({
938
777
  ...b,
939
778
  groupBy: t
940
779
  });
941
- }, G = (e) => {
780
+ }, W = (e) => {
942
781
  let t = A.filter((t, n) => n !== e);
943
- P(t), x({
782
+ N(t), x({
944
783
  ...b,
945
784
  groupBy: t
946
785
  });
947
- }, K = (e, t) => {
786
+ }, G = (e, t) => {
948
787
  let n = [...A];
949
- n[e] = t, P(n), x({
788
+ n[e] = t, N(n), x({
950
789
  ...b,
951
790
  groupBy: n
952
791
  });
953
- }, q = (e) => {
792
+ }, K = (e) => {
954
793
  let t = {
955
794
  type: e,
956
795
  title: `New ${e} Section`
957
- }, n = [...F, t];
796
+ }, n = [...P, t];
958
797
  I(n), x({
959
798
  ...b,
960
799
  sections: n
961
800
  });
962
- }, J = (e) => {
963
- let t = F.filter((t, n) => n !== e);
801
+ }, q = (e) => {
802
+ let t = P.filter((t, n) => n !== e);
964
803
  I(t), x({
965
804
  ...b,
966
805
  sections: t
967
806
  });
968
- }, Y = (e, t) => {
969
- let n = [...F];
807
+ }, J = (e, t) => {
808
+ let n = [...P];
970
809
  n[e] = t, I(n), x({
971
810
  ...b,
972
811
  sections: n
973
812
  });
974
813
  };
975
- return /* @__PURE__ */ (0, R.jsxs)("div", {
814
+ return /* @__PURE__ */ (0, F.jsxs)("div", {
976
815
  className: "space-y-4",
977
- children: [/* @__PURE__ */ (0, R.jsxs)(o, { children: [/* @__PURE__ */ (0, R.jsxs)(l, { children: [/* @__PURE__ */ (0, R.jsx)(u, { children: "Report Builder" }), /* @__PURE__ */ (0, R.jsx)(c, { children: "Configure your report settings, fields, filters, and sections" })] }), /* @__PURE__ */ (0, R.jsxs)(s, { children: [/* @__PURE__ */ (0, R.jsxs)(g, {
816
+ children: [/* @__PURE__ */ (0, F.jsxs)(o, { children: [/* @__PURE__ */ (0, F.jsxs)(l, { children: [/* @__PURE__ */ (0, F.jsx)(u, { children: "Report Builder" }), /* @__PURE__ */ (0, F.jsx)(c, { children: "Configure your report settings, fields, filters, and sections" })] }), /* @__PURE__ */ (0, F.jsxs)(s, { children: [/* @__PURE__ */ (0, F.jsxs)(g, {
978
817
  defaultValue: "basic",
979
818
  className: "w-full",
980
819
  children: [
981
- /* @__PURE__ */ (0, R.jsxs)(v, {
820
+ /* @__PURE__ */ (0, F.jsxs)(v, {
982
821
  className: "grid w-full grid-cols-6",
983
822
  children: [
984
- /* @__PURE__ */ (0, R.jsxs)(y, {
823
+ /* @__PURE__ */ (0, F.jsxs)(y, {
985
824
  value: "basic",
986
- children: [/* @__PURE__ */ (0, R.jsx)(M, { className: "h-4 w-4 mr-2" }), "Basic"]
825
+ children: [/* @__PURE__ */ (0, F.jsx)(j, { className: "h-4 w-4 mr-2" }), "Basic"]
987
826
  }),
988
- /* @__PURE__ */ (0, R.jsxs)(y, {
827
+ /* @__PURE__ */ (0, F.jsxs)(y, {
989
828
  value: "fields",
990
- children: [/* @__PURE__ */ (0, R.jsx)(E, { className: "h-4 w-4 mr-2" }), "Fields"]
829
+ children: [/* @__PURE__ */ (0, F.jsx)(E, { className: "h-4 w-4 mr-2" }), "Fields"]
991
830
  }),
992
- /* @__PURE__ */ (0, R.jsxs)(y, {
831
+ /* @__PURE__ */ (0, F.jsxs)(y, {
993
832
  value: "filters",
994
- children: [/* @__PURE__ */ (0, R.jsx)(T, { className: "h-4 w-4 mr-2" }), "Filters"]
833
+ children: [/* @__PURE__ */ (0, F.jsx)(T, { className: "h-4 w-4 mr-2" }), "Filters"]
995
834
  }),
996
- /* @__PURE__ */ (0, R.jsxs)(y, {
835
+ /* @__PURE__ */ (0, F.jsxs)(y, {
997
836
  value: "grouping",
998
- children: [/* @__PURE__ */ (0, R.jsx)(E, { className: "h-4 w-4 mr-2" }), "Group By"]
837
+ children: [/* @__PURE__ */ (0, F.jsx)(E, { className: "h-4 w-4 mr-2" }), "Group By"]
999
838
  }),
1000
- /* @__PURE__ */ (0, R.jsxs)(y, {
839
+ /* @__PURE__ */ (0, F.jsxs)(y, {
1001
840
  value: "sections",
1002
- children: [/* @__PURE__ */ (0, R.jsx)(E, { className: "h-4 w-4 mr-2" }), "Sections"]
841
+ children: [/* @__PURE__ */ (0, F.jsx)(E, { className: "h-4 w-4 mr-2" }), "Sections"]
1003
842
  }),
1004
- /* @__PURE__ */ (0, R.jsxs)(y, {
843
+ /* @__PURE__ */ (0, F.jsxs)(y, {
1005
844
  value: "schedule",
1006
- children: [/* @__PURE__ */ (0, R.jsx)(S, { className: "h-4 w-4 mr-2" }), "Schedule"]
845
+ children: [/* @__PURE__ */ (0, F.jsx)(S, { className: "h-4 w-4 mr-2" }), "Schedule"]
1007
846
  })
1008
847
  ]
1009
848
  }),
1010
- /* @__PURE__ */ (0, R.jsx)(_, {
849
+ /* @__PURE__ */ (0, F.jsx)(_, {
1011
850
  value: "basic",
1012
851
  className: "space-y-4 mt-4",
1013
- children: /* @__PURE__ */ (0, R.jsxs)("div", {
852
+ children: /* @__PURE__ */ (0, F.jsxs)("div", {
1014
853
  className: "space-y-4",
1015
854
  children: [
1016
- /* @__PURE__ */ (0, R.jsxs)("div", {
855
+ /* @__PURE__ */ (0, F.jsxs)("div", {
1017
856
  className: "space-y-2",
1018
- children: [/* @__PURE__ */ (0, R.jsx)(m, {
857
+ children: [/* @__PURE__ */ (0, F.jsx)(m, {
1019
858
  htmlFor: "report-title",
1020
859
  children: "Report Title"
1021
- }), /* @__PURE__ */ (0, R.jsx)(p, {
860
+ }), /* @__PURE__ */ (0, F.jsx)(p, {
1022
861
  id: "report-title",
1023
862
  value: b.title || "",
1024
863
  onChange: (e) => x({
@@ -1028,12 +867,12 @@ var Q = ({ schema: t, onRefresh: r }) => {
1028
867
  placeholder: "Enter report title"
1029
868
  })]
1030
869
  }),
1031
- /* @__PURE__ */ (0, R.jsxs)("div", {
870
+ /* @__PURE__ */ (0, F.jsxs)("div", {
1032
871
  className: "space-y-2",
1033
- children: [/* @__PURE__ */ (0, R.jsx)(m, {
872
+ children: [/* @__PURE__ */ (0, F.jsx)(m, {
1034
873
  htmlFor: "report-description",
1035
874
  children: "Description"
1036
- }), /* @__PURE__ */ (0, R.jsx)(p, {
875
+ }), /* @__PURE__ */ (0, F.jsx)(p, {
1037
876
  id: "report-description",
1038
877
  value: b.description || "",
1039
878
  onChange: (e) => x({
@@ -1043,58 +882,58 @@ var Q = ({ schema: t, onRefresh: r }) => {
1043
882
  placeholder: "Enter report description"
1044
883
  })]
1045
884
  }),
1046
- n.length > 0 && /* @__PURE__ */ (0, R.jsxs)("div", {
885
+ n.length > 0 && /* @__PURE__ */ (0, F.jsxs)("div", {
1047
886
  className: "space-y-2",
1048
- children: [/* @__PURE__ */ (0, R.jsx)(m, { children: "Data Source" }), /* @__PURE__ */ (0, R.jsxs)("select", {
887
+ children: [/* @__PURE__ */ (0, F.jsx)(m, { children: "Data Source" }), /* @__PURE__ */ (0, F.jsxs)("select", {
1049
888
  className: "w-full border rounded-md p-2",
1050
- children: [/* @__PURE__ */ (0, R.jsx)("option", {
889
+ children: [/* @__PURE__ */ (0, F.jsx)("option", {
1051
890
  value: "",
1052
891
  children: "Select a data source"
1053
- }), n.map((e, t) => /* @__PURE__ */ (0, R.jsxs)("option", {
892
+ }), n.map((e, t) => /* @__PURE__ */ (0, F.jsxs)("option", {
1054
893
  value: t,
1055
894
  children: ["Data Source ", t + 1]
1056
895
  }, t))]
1057
896
  })]
1058
897
  }),
1059
- /* @__PURE__ */ (0, R.jsxs)("div", {
898
+ /* @__PURE__ */ (0, F.jsxs)("div", {
1060
899
  className: "space-y-2",
1061
- children: [/* @__PURE__ */ (0, R.jsx)(m, { children: "Export Options" }), /* @__PURE__ */ (0, R.jsxs)("div", {
900
+ children: [/* @__PURE__ */ (0, F.jsx)(m, { children: "Export Options" }), /* @__PURE__ */ (0, F.jsxs)("div", {
1062
901
  className: "flex items-center gap-4",
1063
- children: [/* @__PURE__ */ (0, R.jsxs)("label", {
902
+ children: [/* @__PURE__ */ (0, F.jsxs)("label", {
1064
903
  className: "flex items-center gap-2",
1065
- children: [/* @__PURE__ */ (0, R.jsx)("input", {
904
+ children: [/* @__PURE__ */ (0, F.jsx)("input", {
1066
905
  type: "checkbox",
1067
906
  checked: b.showExportButtons || !1,
1068
907
  onChange: (e) => x({
1069
908
  ...b,
1070
909
  showExportButtons: e.target.checked
1071
910
  })
1072
- }), /* @__PURE__ */ (0, R.jsx)("span", {
911
+ }), /* @__PURE__ */ (0, F.jsx)("span", {
1073
912
  className: "text-sm",
1074
913
  children: "Show Export Buttons"
1075
914
  })]
1076
- }), /* @__PURE__ */ (0, R.jsxs)("label", {
915
+ }), /* @__PURE__ */ (0, F.jsxs)("label", {
1077
916
  className: "flex items-center gap-2",
1078
- children: [/* @__PURE__ */ (0, R.jsx)("input", {
917
+ children: [/* @__PURE__ */ (0, F.jsx)("input", {
1079
918
  type: "checkbox",
1080
919
  checked: b.showPrintButton || !1,
1081
920
  onChange: (e) => x({
1082
921
  ...b,
1083
922
  showPrintButton: e.target.checked
1084
923
  })
1085
- }), /* @__PURE__ */ (0, R.jsx)("span", {
924
+ }), /* @__PURE__ */ (0, F.jsx)("span", {
1086
925
  className: "text-sm",
1087
926
  children: "Show Print Button"
1088
927
  })]
1089
928
  })]
1090
929
  })]
1091
930
  }),
1092
- /* @__PURE__ */ (0, R.jsxs)("div", {
931
+ /* @__PURE__ */ (0, F.jsxs)("div", {
1093
932
  className: "space-y-2",
1094
- children: [/* @__PURE__ */ (0, R.jsx)(m, {
933
+ children: [/* @__PURE__ */ (0, F.jsx)(m, {
1095
934
  htmlFor: "export-format",
1096
935
  children: "Default Export Format"
1097
- }), /* @__PURE__ */ (0, R.jsxs)("select", {
936
+ }), /* @__PURE__ */ (0, F.jsxs)("select", {
1098
937
  id: "export-format",
1099
938
  className: "w-full border rounded-md p-2",
1100
939
  value: b.defaultExportFormat || "pdf",
@@ -1103,23 +942,23 @@ var Q = ({ schema: t, onRefresh: r }) => {
1103
942
  defaultExportFormat: e.target.value
1104
943
  }),
1105
944
  children: [
1106
- /* @__PURE__ */ (0, R.jsx)("option", {
945
+ /* @__PURE__ */ (0, F.jsx)("option", {
1107
946
  value: "pdf",
1108
947
  children: "PDF"
1109
948
  }),
1110
- /* @__PURE__ */ (0, R.jsx)("option", {
949
+ /* @__PURE__ */ (0, F.jsx)("option", {
1111
950
  value: "excel",
1112
951
  children: "Excel"
1113
952
  }),
1114
- /* @__PURE__ */ (0, R.jsx)("option", {
953
+ /* @__PURE__ */ (0, F.jsx)("option", {
1115
954
  value: "csv",
1116
955
  children: "CSV"
1117
956
  }),
1118
- /* @__PURE__ */ (0, R.jsx)("option", {
957
+ /* @__PURE__ */ (0, F.jsx)("option", {
1119
958
  value: "json",
1120
959
  children: "JSON"
1121
960
  }),
1122
- /* @__PURE__ */ (0, R.jsx)("option", {
961
+ /* @__PURE__ */ (0, F.jsx)("option", {
1123
962
  value: "html",
1124
963
  children: "HTML"
1125
964
  })
@@ -1129,343 +968,343 @@ var Q = ({ schema: t, onRefresh: r }) => {
1129
968
  ]
1130
969
  })
1131
970
  }),
1132
- /* @__PURE__ */ (0, R.jsxs)(_, {
971
+ /* @__PURE__ */ (0, F.jsxs)(_, {
1133
972
  value: "fields",
1134
973
  className: "space-y-4 mt-4",
1135
- children: [/* @__PURE__ */ (0, R.jsxs)("div", {
974
+ children: [/* @__PURE__ */ (0, F.jsxs)("div", {
1136
975
  className: "flex items-center justify-between",
1137
- children: [/* @__PURE__ */ (0, R.jsx)(m, { children: "Report Fields" }), /* @__PURE__ */ (0, R.jsxs)(a, {
976
+ children: [/* @__PURE__ */ (0, F.jsx)(m, { children: "Report Fields" }), /* @__PURE__ */ (0, F.jsxs)(a, {
1138
977
  size: "sm",
1139
978
  variant: "outline",
1140
979
  onClick: L,
1141
980
  disabled: C.length >= i.length,
1142
- children: [/* @__PURE__ */ (0, R.jsx)(O, { className: "h-4 w-4 mr-2" }), "Add Field"]
981
+ children: [/* @__PURE__ */ (0, F.jsx)(O, { className: "h-4 w-4 mr-2" }), "Add Field"]
1143
982
  })]
1144
- }), /* @__PURE__ */ (0, R.jsxs)("div", {
983
+ }), /* @__PURE__ */ (0, F.jsxs)("div", {
1145
984
  className: "space-y-2",
1146
- children: [C.map((e, t) => /* @__PURE__ */ (0, R.jsx)("div", {
985
+ children: [C.map((e, t) => /* @__PURE__ */ (0, F.jsx)("div", {
1147
986
  className: "flex items-center gap-2 p-3 border rounded-lg",
1148
- children: /* @__PURE__ */ (0, R.jsxs)("div", {
987
+ children: /* @__PURE__ */ (0, F.jsxs)("div", {
1149
988
  className: "flex-1 grid grid-cols-4 gap-2",
1150
989
  children: [
1151
- /* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)(m, {
990
+ /* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)(m, {
1152
991
  className: "text-xs",
1153
992
  children: "Field Name"
1154
- }), /* @__PURE__ */ (0, R.jsx)("div", {
993
+ }), /* @__PURE__ */ (0, F.jsx)("div", {
1155
994
  className: "text-sm font-medium",
1156
995
  children: e.name
1157
996
  })] }),
1158
- /* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)(m, {
997
+ /* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)(m, {
1159
998
  className: "text-xs",
1160
999
  children: "Label"
1161
- }), /* @__PURE__ */ (0, R.jsx)(p, {
1000
+ }), /* @__PURE__ */ (0, F.jsx)(p, {
1162
1001
  className: "h-8 text-sm",
1163
1002
  value: e.label || e.name,
1164
- onChange: (n) => B(t, {
1003
+ onChange: (n) => z(t, {
1165
1004
  ...e,
1166
1005
  label: n.target.value
1167
1006
  })
1168
1007
  })] }),
1169
- /* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)(m, {
1008
+ /* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)(m, {
1170
1009
  className: "text-xs",
1171
1010
  children: "Aggregation"
1172
- }), /* @__PURE__ */ (0, R.jsxs)("select", {
1011
+ }), /* @__PURE__ */ (0, F.jsxs)("select", {
1173
1012
  className: "w-full border rounded-md h-8 text-sm px-2",
1174
1013
  value: e.aggregation || "",
1175
- onChange: (n) => B(t, {
1014
+ onChange: (n) => z(t, {
1176
1015
  ...e,
1177
1016
  aggregation: n.target.value
1178
1017
  }),
1179
1018
  children: [
1180
- /* @__PURE__ */ (0, R.jsx)("option", {
1019
+ /* @__PURE__ */ (0, F.jsx)("option", {
1181
1020
  value: "",
1182
1021
  children: "None"
1183
1022
  }),
1184
- /* @__PURE__ */ (0, R.jsx)("option", {
1023
+ /* @__PURE__ */ (0, F.jsx)("option", {
1185
1024
  value: "sum",
1186
1025
  children: "Sum"
1187
1026
  }),
1188
- /* @__PURE__ */ (0, R.jsx)("option", {
1027
+ /* @__PURE__ */ (0, F.jsx)("option", {
1189
1028
  value: "count",
1190
1029
  children: "Count"
1191
1030
  }),
1192
- /* @__PURE__ */ (0, R.jsx)("option", {
1031
+ /* @__PURE__ */ (0, F.jsx)("option", {
1193
1032
  value: "avg",
1194
1033
  children: "Average"
1195
1034
  }),
1196
- /* @__PURE__ */ (0, R.jsx)("option", {
1035
+ /* @__PURE__ */ (0, F.jsx)("option", {
1197
1036
  value: "min",
1198
1037
  children: "Min"
1199
1038
  }),
1200
- /* @__PURE__ */ (0, R.jsx)("option", {
1039
+ /* @__PURE__ */ (0, F.jsx)("option", {
1201
1040
  value: "max",
1202
1041
  children: "Max"
1203
1042
  })
1204
1043
  ]
1205
1044
  })] }),
1206
- /* @__PURE__ */ (0, R.jsx)("div", {
1045
+ /* @__PURE__ */ (0, F.jsx)("div", {
1207
1046
  className: "flex items-end justify-end",
1208
- children: /* @__PURE__ */ (0, R.jsx)(a, {
1047
+ children: /* @__PURE__ */ (0, F.jsx)(a, {
1209
1048
  size: "sm",
1210
1049
  variant: "ghost",
1211
1050
  className: "text-red-500 hover:text-red-700 hover:bg-red-50",
1212
- onClick: () => z(t),
1213
- children: /* @__PURE__ */ (0, R.jsx)(N, { className: "h-4 w-4" })
1051
+ onClick: () => R(t),
1052
+ children: /* @__PURE__ */ (0, F.jsx)(M, { className: "h-4 w-4" })
1214
1053
  })
1215
1054
  })
1216
1055
  ]
1217
1056
  })
1218
- }, t)), C.length === 0 && /* @__PURE__ */ (0, R.jsx)("div", {
1057
+ }, t)), C.length === 0 && /* @__PURE__ */ (0, F.jsx)("div", {
1219
1058
  className: "text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",
1220
1059
  children: "No fields selected. Click \"Add Field\" to begin."
1221
1060
  })]
1222
1061
  })]
1223
1062
  }),
1224
- /* @__PURE__ */ (0, R.jsxs)(_, {
1063
+ /* @__PURE__ */ (0, F.jsxs)(_, {
1225
1064
  value: "filters",
1226
1065
  className: "space-y-4 mt-4",
1227
- children: [/* @__PURE__ */ (0, R.jsxs)("div", {
1066
+ children: [/* @__PURE__ */ (0, F.jsxs)("div", {
1228
1067
  className: "flex items-center justify-between",
1229
- children: [/* @__PURE__ */ (0, R.jsx)(m, { children: "Report Filters" }), /* @__PURE__ */ (0, R.jsxs)(a, {
1068
+ children: [/* @__PURE__ */ (0, F.jsx)(m, { children: "Report Filters" }), /* @__PURE__ */ (0, F.jsxs)(a, {
1230
1069
  size: "sm",
1231
1070
  variant: "outline",
1232
- onClick: V,
1233
- children: [/* @__PURE__ */ (0, R.jsx)(O, { className: "h-4 w-4 mr-2" }), "Add Filter"]
1071
+ onClick: B,
1072
+ children: [/* @__PURE__ */ (0, F.jsx)(O, { className: "h-4 w-4 mr-2" }), "Add Filter"]
1234
1073
  })]
1235
- }), /* @__PURE__ */ (0, R.jsxs)("div", {
1074
+ }), /* @__PURE__ */ (0, F.jsxs)("div", {
1236
1075
  className: "space-y-2",
1237
- children: [D.map((e, t) => /* @__PURE__ */ (0, R.jsxs)("div", {
1076
+ children: [D.map((e, t) => /* @__PURE__ */ (0, F.jsxs)("div", {
1238
1077
  className: "flex items-center gap-2 p-3 border rounded-lg",
1239
- children: [/* @__PURE__ */ (0, R.jsxs)("div", {
1078
+ children: [/* @__PURE__ */ (0, F.jsxs)("div", {
1240
1079
  className: "flex-1 grid grid-cols-3 gap-2",
1241
1080
  children: [
1242
- /* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)(m, {
1081
+ /* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)(m, {
1243
1082
  className: "text-xs",
1244
1083
  children: "Field"
1245
- }), /* @__PURE__ */ (0, R.jsx)("select", {
1084
+ }), /* @__PURE__ */ (0, F.jsx)("select", {
1246
1085
  className: "w-full border rounded-md h-8 text-sm px-2",
1247
1086
  value: e.field,
1248
- onChange: (n) => U(t, {
1087
+ onChange: (n) => H(t, {
1249
1088
  ...e,
1250
1089
  field: n.target.value
1251
1090
  }),
1252
- children: i.map((e, t) => /* @__PURE__ */ (0, R.jsx)("option", {
1091
+ children: i.map((e, t) => /* @__PURE__ */ (0, F.jsx)("option", {
1253
1092
  value: e.name,
1254
1093
  children: e.label || e.name
1255
1094
  }, t))
1256
1095
  })] }),
1257
- /* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)(m, {
1096
+ /* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)(m, {
1258
1097
  className: "text-xs",
1259
1098
  children: "Operator"
1260
- }), /* @__PURE__ */ (0, R.jsxs)("select", {
1099
+ }), /* @__PURE__ */ (0, F.jsxs)("select", {
1261
1100
  className: "w-full border rounded-md h-8 text-sm px-2",
1262
1101
  value: e.operator,
1263
- onChange: (n) => U(t, {
1102
+ onChange: (n) => H(t, {
1264
1103
  ...e,
1265
1104
  operator: n.target.value
1266
1105
  }),
1267
1106
  children: [
1268
- /* @__PURE__ */ (0, R.jsx)("option", {
1107
+ /* @__PURE__ */ (0, F.jsx)("option", {
1269
1108
  value: "equals",
1270
1109
  children: "Equals"
1271
1110
  }),
1272
- /* @__PURE__ */ (0, R.jsx)("option", {
1111
+ /* @__PURE__ */ (0, F.jsx)("option", {
1273
1112
  value: "contains",
1274
1113
  children: "Contains"
1275
1114
  }),
1276
- /* @__PURE__ */ (0, R.jsx)("option", {
1115
+ /* @__PURE__ */ (0, F.jsx)("option", {
1277
1116
  value: "gt",
1278
1117
  children: "Greater Than"
1279
1118
  }),
1280
- /* @__PURE__ */ (0, R.jsx)("option", {
1119
+ /* @__PURE__ */ (0, F.jsx)("option", {
1281
1120
  value: "lt",
1282
1121
  children: "Less Than"
1283
1122
  }),
1284
- /* @__PURE__ */ (0, R.jsx)("option", {
1123
+ /* @__PURE__ */ (0, F.jsx)("option", {
1285
1124
  value: "between",
1286
1125
  children: "Between"
1287
1126
  })
1288
1127
  ]
1289
1128
  })] }),
1290
- /* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)(m, {
1129
+ /* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)(m, {
1291
1130
  className: "text-xs",
1292
1131
  children: "Value"
1293
- }), /* @__PURE__ */ (0, R.jsx)(p, {
1132
+ }), /* @__PURE__ */ (0, F.jsx)(p, {
1294
1133
  className: "h-8 text-sm",
1295
1134
  value: String(e.value),
1296
- onChange: (n) => U(t, {
1135
+ onChange: (n) => H(t, {
1297
1136
  ...e,
1298
1137
  value: n.target.value
1299
1138
  })
1300
1139
  })] })
1301
1140
  ]
1302
- }), /* @__PURE__ */ (0, R.jsx)(a, {
1141
+ }), /* @__PURE__ */ (0, F.jsx)(a, {
1303
1142
  size: "sm",
1304
1143
  variant: "ghost",
1305
1144
  className: "text-red-500 hover:text-red-700 hover:bg-red-50 self-end",
1306
- onClick: () => H(t),
1307
- children: /* @__PURE__ */ (0, R.jsx)(N, { className: "h-4 w-4" })
1145
+ onClick: () => V(t),
1146
+ children: /* @__PURE__ */ (0, F.jsx)(M, { className: "h-4 w-4" })
1308
1147
  })]
1309
- }, t)), D.length === 0 && /* @__PURE__ */ (0, R.jsx)("div", {
1148
+ }, t)), D.length === 0 && /* @__PURE__ */ (0, F.jsx)("div", {
1310
1149
  className: "text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",
1311
1150
  children: "No filters defined."
1312
1151
  })]
1313
1152
  })]
1314
1153
  }),
1315
- /* @__PURE__ */ (0, R.jsxs)(_, {
1154
+ /* @__PURE__ */ (0, F.jsxs)(_, {
1316
1155
  value: "grouping",
1317
1156
  className: "space-y-4 mt-4",
1318
- children: [/* @__PURE__ */ (0, R.jsxs)("div", {
1157
+ children: [/* @__PURE__ */ (0, F.jsxs)("div", {
1319
1158
  className: "flex items-center justify-between",
1320
- children: [/* @__PURE__ */ (0, R.jsx)(m, { children: "Grouping Rules" }), /* @__PURE__ */ (0, R.jsxs)(a, {
1159
+ children: [/* @__PURE__ */ (0, F.jsx)(m, { children: "Grouping Rules" }), /* @__PURE__ */ (0, F.jsxs)(a, {
1321
1160
  size: "sm",
1322
1161
  variant: "outline",
1323
- onClick: W,
1324
- children: [/* @__PURE__ */ (0, R.jsx)(O, { className: "h-4 w-4 mr-2" }), "Add Group"]
1162
+ onClick: U,
1163
+ children: [/* @__PURE__ */ (0, F.jsx)(O, { className: "h-4 w-4 mr-2" }), "Add Group"]
1325
1164
  })]
1326
- }), /* @__PURE__ */ (0, R.jsxs)("div", {
1165
+ }), /* @__PURE__ */ (0, F.jsxs)("div", {
1327
1166
  className: "space-y-2",
1328
- children: [A.map((e, t) => /* @__PURE__ */ (0, R.jsxs)("div", {
1167
+ children: [A.map((e, t) => /* @__PURE__ */ (0, F.jsxs)("div", {
1329
1168
  className: "flex items-center gap-2 p-3 border rounded-lg",
1330
- children: [/* @__PURE__ */ (0, R.jsxs)("div", {
1169
+ children: [/* @__PURE__ */ (0, F.jsxs)("div", {
1331
1170
  className: "flex-1 grid grid-cols-2 gap-2",
1332
- children: [/* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)(m, {
1171
+ children: [/* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)(m, {
1333
1172
  className: "text-xs",
1334
1173
  children: "Field"
1335
- }), /* @__PURE__ */ (0, R.jsx)("select", {
1174
+ }), /* @__PURE__ */ (0, F.jsx)("select", {
1336
1175
  className: "w-full border rounded-md h-8 text-sm px-2",
1337
1176
  value: e.field,
1338
- onChange: (n) => K(t, {
1177
+ onChange: (n) => G(t, {
1339
1178
  ...e,
1340
1179
  field: n.target.value
1341
1180
  }),
1342
- children: i.map((e, t) => /* @__PURE__ */ (0, R.jsx)("option", {
1181
+ children: i.map((e, t) => /* @__PURE__ */ (0, F.jsx)("option", {
1343
1182
  value: e.name,
1344
1183
  children: e.label || e.name
1345
1184
  }, t))
1346
- })] }), /* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)(m, {
1185
+ })] }), /* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)(m, {
1347
1186
  className: "text-xs",
1348
1187
  children: "Sort Order"
1349
- }), /* @__PURE__ */ (0, R.jsxs)("select", {
1188
+ }), /* @__PURE__ */ (0, F.jsxs)("select", {
1350
1189
  className: "w-full border rounded-md h-8 text-sm px-2",
1351
1190
  value: e.sort || "asc",
1352
- onChange: (n) => K(t, {
1191
+ onChange: (n) => G(t, {
1353
1192
  ...e,
1354
1193
  sort: n.target.value
1355
1194
  }),
1356
- children: [/* @__PURE__ */ (0, R.jsx)("option", {
1195
+ children: [/* @__PURE__ */ (0, F.jsx)("option", {
1357
1196
  value: "asc",
1358
1197
  children: "Ascending"
1359
- }), /* @__PURE__ */ (0, R.jsx)("option", {
1198
+ }), /* @__PURE__ */ (0, F.jsx)("option", {
1360
1199
  value: "desc",
1361
1200
  children: "Descending"
1362
1201
  })]
1363
1202
  })] })]
1364
- }), /* @__PURE__ */ (0, R.jsx)(a, {
1203
+ }), /* @__PURE__ */ (0, F.jsx)(a, {
1365
1204
  size: "sm",
1366
1205
  variant: "ghost",
1367
1206
  className: "text-red-500 hover:text-red-700 hover:bg-red-50 self-end",
1368
- onClick: () => G(t),
1369
- children: /* @__PURE__ */ (0, R.jsx)(N, { className: "h-4 w-4" })
1207
+ onClick: () => W(t),
1208
+ children: /* @__PURE__ */ (0, F.jsx)(M, { className: "h-4 w-4" })
1370
1209
  })]
1371
- }, t)), A.length === 0 && /* @__PURE__ */ (0, R.jsx)("div", {
1210
+ }, t)), A.length === 0 && /* @__PURE__ */ (0, F.jsx)("div", {
1372
1211
  className: "text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",
1373
1212
  children: "No grouping rules applied."
1374
1213
  })]
1375
1214
  })]
1376
1215
  }),
1377
- /* @__PURE__ */ (0, R.jsxs)(_, {
1216
+ /* @__PURE__ */ (0, F.jsxs)(_, {
1378
1217
  value: "sections",
1379
1218
  className: "space-y-4 mt-4",
1380
- children: [/* @__PURE__ */ (0, R.jsxs)("div", {
1219
+ children: [/* @__PURE__ */ (0, F.jsxs)("div", {
1381
1220
  className: "flex items-center justify-between",
1382
- children: [/* @__PURE__ */ (0, R.jsx)(m, { children: "Report Sections" }), /* @__PURE__ */ (0, R.jsxs)("div", {
1221
+ children: [/* @__PURE__ */ (0, F.jsx)(m, { children: "Report Sections" }), /* @__PURE__ */ (0, F.jsxs)("div", {
1383
1222
  className: "flex gap-2",
1384
1223
  children: [
1385
- /* @__PURE__ */ (0, R.jsxs)(a, {
1224
+ /* @__PURE__ */ (0, F.jsxs)(a, {
1386
1225
  size: "sm",
1387
1226
  variant: "outline",
1388
- onClick: () => q("header"),
1389
- children: [/* @__PURE__ */ (0, R.jsx)(O, { className: "h-4 w-4 mr-2" }), "Header"]
1227
+ onClick: () => K("header"),
1228
+ children: [/* @__PURE__ */ (0, F.jsx)(O, { className: "h-4 w-4 mr-2" }), "Header"]
1390
1229
  }),
1391
- /* @__PURE__ */ (0, R.jsxs)(a, {
1230
+ /* @__PURE__ */ (0, F.jsxs)(a, {
1392
1231
  size: "sm",
1393
1232
  variant: "outline",
1394
- onClick: () => q("chart"),
1395
- children: [/* @__PURE__ */ (0, R.jsx)(O, { className: "h-4 w-4 mr-2" }), "Chart"]
1233
+ onClick: () => K("chart"),
1234
+ children: [/* @__PURE__ */ (0, F.jsx)(O, { className: "h-4 w-4 mr-2" }), "Chart"]
1396
1235
  }),
1397
- /* @__PURE__ */ (0, R.jsxs)(a, {
1236
+ /* @__PURE__ */ (0, F.jsxs)(a, {
1398
1237
  size: "sm",
1399
1238
  variant: "outline",
1400
- onClick: () => q("table"),
1401
- children: [/* @__PURE__ */ (0, R.jsx)(O, { className: "h-4 w-4 mr-2" }), "Table"]
1239
+ onClick: () => K("table"),
1240
+ children: [/* @__PURE__ */ (0, F.jsx)(O, { className: "h-4 w-4 mr-2" }), "Table"]
1402
1241
  })
1403
1242
  ]
1404
1243
  })]
1405
- }), /* @__PURE__ */ (0, R.jsxs)("div", {
1244
+ }), /* @__PURE__ */ (0, F.jsxs)("div", {
1406
1245
  className: "space-y-2",
1407
- children: [F.map((e, t) => /* @__PURE__ */ (0, R.jsxs)("div", {
1246
+ children: [P.map((e, t) => /* @__PURE__ */ (0, F.jsxs)("div", {
1408
1247
  className: "p-3 border rounded-lg space-y-2",
1409
- children: [/* @__PURE__ */ (0, R.jsxs)("div", {
1248
+ children: [/* @__PURE__ */ (0, F.jsxs)("div", {
1410
1249
  className: "flex items-center justify-between",
1411
- children: [/* @__PURE__ */ (0, R.jsxs)("div", {
1250
+ children: [/* @__PURE__ */ (0, F.jsxs)("div", {
1412
1251
  className: "font-medium flex items-center gap-2",
1413
- children: [/* @__PURE__ */ (0, R.jsx)("div", {
1252
+ children: [/* @__PURE__ */ (0, F.jsx)("div", {
1414
1253
  className: "text-xs bg-muted px-2 py-0.5 rounded uppercase",
1415
1254
  children: e.type
1416
1255
  }), e.title]
1417
- }), /* @__PURE__ */ (0, R.jsx)(a, {
1256
+ }), /* @__PURE__ */ (0, F.jsx)(a, {
1418
1257
  size: "sm",
1419
1258
  variant: "ghost",
1420
1259
  className: "text-red-500 hover:text-red-700 hover:bg-red-50",
1421
- onClick: () => J(t),
1422
- children: /* @__PURE__ */ (0, R.jsx)(N, { className: "h-4 w-4" })
1260
+ onClick: () => q(t),
1261
+ children: /* @__PURE__ */ (0, F.jsx)(M, { className: "h-4 w-4" })
1423
1262
  })]
1424
- }), /* @__PURE__ */ (0, R.jsxs)("div", {
1263
+ }), /* @__PURE__ */ (0, F.jsxs)("div", {
1425
1264
  className: "grid grid-cols-2 gap-2",
1426
1265
  children: [
1427
- /* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)(m, {
1266
+ /* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)(m, {
1428
1267
  className: "text-xs",
1429
1268
  children: "Title"
1430
- }), /* @__PURE__ */ (0, R.jsx)(p, {
1269
+ }), /* @__PURE__ */ (0, F.jsx)(p, {
1431
1270
  className: "h-8 text-sm",
1432
1271
  value: e.title || "",
1433
- onChange: (n) => Y(t, {
1272
+ onChange: (n) => J(t, {
1434
1273
  ...e,
1435
1274
  title: n.target.value
1436
1275
  })
1437
1276
  })] }),
1438
- e.type === "text" && /* @__PURE__ */ (0, R.jsxs)("div", {
1277
+ e.type === "text" && /* @__PURE__ */ (0, F.jsxs)("div", {
1439
1278
  className: "col-span-2",
1440
- children: [/* @__PURE__ */ (0, R.jsx)(m, {
1279
+ children: [/* @__PURE__ */ (0, F.jsx)(m, {
1441
1280
  className: "text-xs",
1442
1281
  children: "Content"
1443
- }), /* @__PURE__ */ (0, R.jsx)(p, {
1282
+ }), /* @__PURE__ */ (0, F.jsx)(p, {
1444
1283
  className: "h-8 text-sm",
1445
1284
  value: e.text || "",
1446
- onChange: (n) => Y(t, {
1285
+ onChange: (n) => J(t, {
1447
1286
  ...e,
1448
1287
  text: n.target.value
1449
1288
  })
1450
1289
  })]
1451
1290
  }),
1452
- e.type === "chart" && /* @__PURE__ */ (0, R.jsxs)("div", {
1291
+ e.type === "chart" && /* @__PURE__ */ (0, F.jsxs)("div", {
1453
1292
  className: "col-span-2 grid grid-cols-2 gap-2 mt-2 p-2 bg-muted/20 rounded",
1454
1293
  children: [
1455
- /* @__PURE__ */ (0, R.jsx)("div", {
1294
+ /* @__PURE__ */ (0, F.jsx)("div", {
1456
1295
  className: "col-span-2",
1457
- children: /* @__PURE__ */ (0, R.jsx)(m, {
1296
+ children: /* @__PURE__ */ (0, F.jsx)(m, {
1458
1297
  className: "text-xs font-semibold",
1459
1298
  children: "Chart Configuration"
1460
1299
  })
1461
1300
  }),
1462
- /* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)(m, {
1301
+ /* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)(m, {
1463
1302
  className: "text-xs",
1464
1303
  children: "Chart Type"
1465
- }), /* @__PURE__ */ (0, R.jsxs)("select", {
1304
+ }), /* @__PURE__ */ (0, F.jsxs)("select", {
1466
1305
  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",
1467
1306
  value: e.chart?.chartType || "bar",
1468
- onChange: (n) => Y(t, {
1307
+ onChange: (n) => J(t, {
1469
1308
  ...e,
1470
1309
  chart: {
1471
1310
  ...e.chart,
@@ -1474,31 +1313,31 @@ var Q = ({ schema: t, onRefresh: r }) => {
1474
1313
  }
1475
1314
  }),
1476
1315
  children: [
1477
- /* @__PURE__ */ (0, R.jsx)("option", {
1316
+ /* @__PURE__ */ (0, F.jsx)("option", {
1478
1317
  value: "bar",
1479
1318
  children: "Bar"
1480
1319
  }),
1481
- /* @__PURE__ */ (0, R.jsx)("option", {
1320
+ /* @__PURE__ */ (0, F.jsx)("option", {
1482
1321
  value: "line",
1483
1322
  children: "Line"
1484
1323
  }),
1485
- /* @__PURE__ */ (0, R.jsx)("option", {
1324
+ /* @__PURE__ */ (0, F.jsx)("option", {
1486
1325
  value: "area",
1487
1326
  children: "Area"
1488
1327
  }),
1489
- /* @__PURE__ */ (0, R.jsx)("option", {
1328
+ /* @__PURE__ */ (0, F.jsx)("option", {
1490
1329
  value: "pie",
1491
1330
  children: "Pie"
1492
1331
  })
1493
1332
  ]
1494
1333
  })] }),
1495
- /* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)(m, {
1334
+ /* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)(m, {
1496
1335
  className: "text-xs",
1497
1336
  children: "X-Axis Field"
1498
- }), /* @__PURE__ */ (0, R.jsxs)("select", {
1337
+ }), /* @__PURE__ */ (0, F.jsxs)("select", {
1499
1338
  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",
1500
1339
  value: e.chart?.xAxisField || "",
1501
- onChange: (n) => Y(t, {
1340
+ onChange: (n) => J(t, {
1502
1341
  ...e,
1503
1342
  chart: {
1504
1343
  ...e.chart,
@@ -1507,33 +1346,33 @@ var Q = ({ schema: t, onRefresh: r }) => {
1507
1346
  }
1508
1347
  }),
1509
1348
  children: [
1510
- /* @__PURE__ */ (0, R.jsx)("option", {
1349
+ /* @__PURE__ */ (0, F.jsx)("option", {
1511
1350
  value: "",
1512
1351
  children: "Select Field..."
1513
1352
  }),
1514
- i.map((e) => /* @__PURE__ */ (0, R.jsx)("option", {
1353
+ i.map((e) => /* @__PURE__ */ (0, F.jsx)("option", {
1515
1354
  value: e.name,
1516
1355
  children: e.label || e.name
1517
1356
  }, e.name)),
1518
- i.length === 0 && /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)("option", {
1357
+ i.length === 0 && /* @__PURE__ */ (0, F.jsxs)(F.Fragment, { children: [/* @__PURE__ */ (0, F.jsx)("option", {
1519
1358
  value: "name",
1520
1359
  children: "Name"
1521
- }), /* @__PURE__ */ (0, R.jsx)("option", {
1360
+ }), /* @__PURE__ */ (0, F.jsx)("option", {
1522
1361
  value: "month",
1523
1362
  children: "Month"
1524
1363
  })] })
1525
1364
  ]
1526
1365
  })] }),
1527
- /* @__PURE__ */ (0, R.jsxs)("div", {
1366
+ /* @__PURE__ */ (0, F.jsxs)("div", {
1528
1367
  className: "col-span-2",
1529
- children: [/* @__PURE__ */ (0, R.jsx)(m, {
1368
+ children: [/* @__PURE__ */ (0, F.jsx)(m, {
1530
1369
  className: "text-xs",
1531
1370
  children: "Y-Axis Fields (comma separated)"
1532
- }), /* @__PURE__ */ (0, R.jsx)(p, {
1371
+ }), /* @__PURE__ */ (0, F.jsx)(p, {
1533
1372
  className: "h-8 text-sm",
1534
1373
  placeholder: "e.g. value, count",
1535
1374
  value: e.chart?.yAxisFields?.join(", ") || "",
1536
- onChange: (n) => Y(t, {
1375
+ onChange: (n) => J(t, {
1537
1376
  ...e,
1538
1377
  chart: {
1539
1378
  ...e.chart,
@@ -1547,16 +1386,16 @@ var Q = ({ schema: t, onRefresh: r }) => {
1547
1386
  })
1548
1387
  ]
1549
1388
  })]
1550
- }, t)), F.length === 0 && /* @__PURE__ */ (0, R.jsx)("div", {
1389
+ }, t)), P.length === 0 && /* @__PURE__ */ (0, F.jsx)("div", {
1551
1390
  className: "text-center py-8 text-muted-foreground border-2 border-dashed rounded-lg",
1552
1391
  children: "No customized sections. The default report layout will be used."
1553
1392
  })]
1554
1393
  })]
1555
1394
  }),
1556
- /* @__PURE__ */ (0, R.jsx)(_, {
1395
+ /* @__PURE__ */ (0, F.jsx)(_, {
1557
1396
  value: "schedule",
1558
1397
  className: "space-y-4 mt-4",
1559
- children: /* @__PURE__ */ (0, R.jsx)($, {
1398
+ children: /* @__PURE__ */ (0, F.jsx)(X, {
1560
1399
  schedule: b.schedule,
1561
1400
  onChange: (e) => x({
1562
1401
  ...b,
@@ -1565,38 +1404,38 @@ var Q = ({ schema: t, onRefresh: r }) => {
1565
1404
  })
1566
1405
  })
1567
1406
  ]
1568
- }), /* @__PURE__ */ (0, R.jsxs)("div", {
1407
+ }), /* @__PURE__ */ (0, F.jsxs)("div", {
1569
1408
  className: "flex items-center justify-end gap-2 mt-6 pt-4 border-t",
1570
- children: [/* @__PURE__ */ (0, R.jsx)(a, {
1409
+ children: [/* @__PURE__ */ (0, F.jsx)(a, {
1571
1410
  variant: "outline",
1572
1411
  onClick: () => {
1573
1412
  h && console.log("Report cancelled:", h);
1574
1413
  },
1575
1414
  children: "Cancel"
1576
- }), /* @__PURE__ */ (0, R.jsxs)(a, {
1415
+ }), /* @__PURE__ */ (0, F.jsxs)(a, {
1577
1416
  onClick: () => {
1578
1417
  console.log("Saving report:", b), f && alert("Report saved! (Handler: " + f + ")");
1579
1418
  },
1580
- children: [/* @__PURE__ */ (0, R.jsx)(j, { className: "h-4 w-4 mr-2" }), "Save Report"]
1419
+ children: [/* @__PURE__ */ (0, F.jsx)(ee, { className: "h-4 w-4 mr-2" }), "Save Report"]
1581
1420
  })]
1582
- })] })] }), d && /* @__PURE__ */ (0, R.jsxs)(o, {
1421
+ })] })] }), d && /* @__PURE__ */ (0, F.jsxs)(o, {
1583
1422
  className: "mt-8 border-2 border-blue-100",
1584
- children: [/* @__PURE__ */ (0, R.jsx)(l, {
1423
+ children: [/* @__PURE__ */ (0, F.jsx)(l, {
1585
1424
  className: "bg-blue-50/50",
1586
- children: /* @__PURE__ */ (0, R.jsx)(u, {
1425
+ children: /* @__PURE__ */ (0, F.jsx)(u, {
1587
1426
  className: "text-blue-900 text-sm uppercase tracking-wide",
1588
1427
  children: "Live Preview"
1589
1428
  })
1590
- }), /* @__PURE__ */ (0, R.jsx)(s, {
1429
+ }), /* @__PURE__ */ (0, F.jsx)(s, {
1591
1430
  className: "pt-6",
1592
- children: /* @__PURE__ */ (0, R.jsx)(Q, { schema: {
1431
+ children: /* @__PURE__ */ (0, F.jsx)(Y, { schema: {
1593
1432
  type: "report-viewer",
1594
1433
  report: {
1595
1434
  ...b,
1596
1435
  fields: C,
1597
1436
  filters: D,
1598
1437
  groupBy: A,
1599
- sections: F
1438
+ sections: P
1600
1439
  },
1601
1440
  data: [
1602
1441
  {
@@ -1677,40 +1516,40 @@ function ae({ availableFields: e, value: t, onChange: n }) {
1677
1516
  showInSummary: !!t
1678
1517
  } : n));
1679
1518
  };
1680
- return e.length === 0 ? /* @__PURE__ */ (0, R.jsx)("div", {
1519
+ return e.length === 0 ? /* @__PURE__ */ (0, F.jsx)("div", {
1681
1520
  className: "text-xs text-muted-foreground py-2",
1682
1521
  "data-testid": "field-picker-empty",
1683
1522
  children: "No fields available"
1684
- }) : /* @__PURE__ */ (0, R.jsx)("div", {
1523
+ }) : /* @__PURE__ */ (0, F.jsx)("div", {
1685
1524
  className: "space-y-1 py-1",
1686
1525
  "data-testid": "field-picker",
1687
1526
  children: e.map((e) => {
1688
1527
  let t = i.includes(e.value), n = r.find((t) => t.name === e.value);
1689
- return /* @__PURE__ */ (0, R.jsxs)("div", {
1528
+ return /* @__PURE__ */ (0, F.jsxs)("div", {
1690
1529
  className: "flex items-center gap-2 px-1 py-0.5 rounded hover:bg-muted/50 text-xs",
1691
- children: [/* @__PURE__ */ (0, R.jsxs)("label", {
1530
+ children: [/* @__PURE__ */ (0, F.jsxs)("label", {
1692
1531
  className: "flex items-center gap-2 flex-1 cursor-pointer",
1693
1532
  children: [
1694
- /* @__PURE__ */ (0, R.jsx)(d, {
1533
+ /* @__PURE__ */ (0, F.jsx)(d, {
1695
1534
  checked: t,
1696
1535
  onCheckedChange: () => a(e.value),
1697
1536
  "data-testid": `field-picker-${e.value}`
1698
1537
  }),
1699
- /* @__PURE__ */ (0, R.jsx)("span", {
1538
+ /* @__PURE__ */ (0, F.jsx)("span", {
1700
1539
  className: "flex-1",
1701
1540
  children: e.label
1702
1541
  }),
1703
- e.type && /* @__PURE__ */ (0, R.jsx)("span", {
1542
+ e.type && /* @__PURE__ */ (0, F.jsx)("span", {
1704
1543
  className: "text-[10px] text-muted-foreground",
1705
1544
  children: e.type
1706
1545
  })
1707
1546
  ]
1708
- }), t && /* @__PURE__ */ (0, R.jsx)("select", {
1547
+ }), t && /* @__PURE__ */ (0, F.jsx)("select", {
1709
1548
  className: "h-5 text-[10px] border rounded px-1 bg-background",
1710
1549
  value: n?.aggregation || "",
1711
1550
  onChange: (t) => o(e.value, t.target.value),
1712
1551
  "data-testid": `field-agg-${e.value}`,
1713
- children: ie.map((e) => /* @__PURE__ */ (0, R.jsx)("option", {
1552
+ children: ie.map((e) => /* @__PURE__ */ (0, F.jsx)("option", {
1714
1553
  value: e.value,
1715
1554
  children: e.label
1716
1555
  }, e.value))
@@ -1754,48 +1593,48 @@ function se({ availableFields: e, value: t, onChange: n }) {
1754
1593
  ...r,
1755
1594
  ...e
1756
1595
  });
1757
- return /* @__PURE__ */ (0, R.jsxs)("div", {
1596
+ return /* @__PURE__ */ (0, F.jsxs)("div", {
1758
1597
  className: "space-y-2 py-1",
1759
1598
  "data-testid": "chart-config",
1760
- children: [/* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)("label", {
1599
+ children: [/* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)("label", {
1761
1600
  className: "text-[10px] text-muted-foreground",
1762
1601
  children: "Chart type"
1763
- }), /* @__PURE__ */ (0, R.jsx)("select", {
1602
+ }), /* @__PURE__ */ (0, F.jsx)("select", {
1764
1603
  className: "w-full h-7 text-xs border rounded px-2 bg-background",
1765
1604
  value: r.chartType || "",
1766
1605
  onChange: (e) => i({ chartType: e.target.value || void 0 }),
1767
1606
  "data-testid": "chart-type-select",
1768
- children: oe.map((e) => /* @__PURE__ */ (0, R.jsx)("option", {
1607
+ children: oe.map((e) => /* @__PURE__ */ (0, F.jsx)("option", {
1769
1608
  value: e.value,
1770
1609
  children: e.label
1771
1610
  }, e.value))
1772
- })] }), r.chartType && /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)("label", {
1611
+ })] }), r.chartType && /* @__PURE__ */ (0, F.jsxs)(F.Fragment, { children: [/* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)("label", {
1773
1612
  className: "text-[10px] text-muted-foreground",
1774
1613
  children: "X-axis field"
1775
- }), /* @__PURE__ */ (0, R.jsxs)("select", {
1614
+ }), /* @__PURE__ */ (0, F.jsxs)("select", {
1776
1615
  className: "w-full h-7 text-xs border rounded px-2 bg-background",
1777
1616
  value: r.xAxisField || "",
1778
1617
  onChange: (e) => i({ xAxisField: e.target.value || void 0 }),
1779
1618
  "data-testid": "chart-x-field",
1780
- children: [/* @__PURE__ */ (0, R.jsx)("option", {
1619
+ children: [/* @__PURE__ */ (0, F.jsx)("option", {
1781
1620
  value: "",
1782
1621
  children: "Select field…"
1783
- }), e.map((e) => /* @__PURE__ */ (0, R.jsx)("option", {
1622
+ }), e.map((e) => /* @__PURE__ */ (0, F.jsx)("option", {
1784
1623
  value: e.value,
1785
1624
  children: e.label
1786
1625
  }, e.value))]
1787
- })] }), /* @__PURE__ */ (0, R.jsxs)("div", { children: [/* @__PURE__ */ (0, R.jsx)("label", {
1626
+ })] }), /* @__PURE__ */ (0, F.jsxs)("div", { children: [/* @__PURE__ */ (0, F.jsx)("label", {
1788
1627
  className: "text-[10px] text-muted-foreground",
1789
1628
  children: "Y-axis field"
1790
- }), /* @__PURE__ */ (0, R.jsxs)("select", {
1629
+ }), /* @__PURE__ */ (0, F.jsxs)("select", {
1791
1630
  className: "w-full h-7 text-xs border rounded px-2 bg-background",
1792
1631
  value: r.yAxisFields?.[0] || "",
1793
1632
  onChange: (e) => i({ yAxisFields: e.target.value ? [e.target.value] : [] }),
1794
1633
  "data-testid": "chart-y-field",
1795
- children: [/* @__PURE__ */ (0, R.jsx)("option", {
1634
+ children: [/* @__PURE__ */ (0, F.jsx)("option", {
1796
1635
  value: "",
1797
1636
  children: "Select field…"
1798
- }), e.filter((e) => e.type === "number").map((e) => /* @__PURE__ */ (0, R.jsx)("option", {
1637
+ }), e.filter((e) => e.type === "number").map((e) => /* @__PURE__ */ (0, F.jsx)("option", {
1799
1638
  value: e.value,
1800
1639
  children: e.label
1801
1640
  }, e.value))]
@@ -1841,63 +1680,63 @@ function le({ availableFields: e, value: t, onChange: n }) {
1841
1680
  ...t
1842
1681
  } : n));
1843
1682
  };
1844
- return /* @__PURE__ */ (0, R.jsxs)("div", {
1683
+ return /* @__PURE__ */ (0, F.jsxs)("div", {
1845
1684
  className: "space-y-2 py-1",
1846
1685
  "data-testid": "conditional-format-rules",
1847
- children: [r.map((t, n) => /* @__PURE__ */ (0, R.jsxs)("div", {
1686
+ children: [r.map((t, n) => /* @__PURE__ */ (0, F.jsxs)("div", {
1848
1687
  className: "flex items-center gap-1 text-[10px] p-1 border rounded bg-muted/20",
1849
1688
  children: [
1850
- /* @__PURE__ */ (0, R.jsx)("select", {
1689
+ /* @__PURE__ */ (0, F.jsx)("select", {
1851
1690
  className: "h-5 text-[10px] border rounded px-1 bg-background flex-1",
1852
1691
  value: t.field,
1853
1692
  onChange: (e) => s(n, { field: e.target.value }),
1854
1693
  "data-testid": `cf-rule-field-${n}`,
1855
- children: e.map((e) => /* @__PURE__ */ (0, R.jsx)("option", {
1694
+ children: e.map((e) => /* @__PURE__ */ (0, F.jsx)("option", {
1856
1695
  value: e.value,
1857
1696
  children: e.label
1858
1697
  }, e.value))
1859
1698
  }),
1860
- /* @__PURE__ */ (0, R.jsx)("select", {
1699
+ /* @__PURE__ */ (0, F.jsx)("select", {
1861
1700
  className: "h-5 text-[10px] border rounded px-1 bg-background w-12",
1862
1701
  value: t.operator,
1863
1702
  onChange: (e) => s(n, { operator: e.target.value }),
1864
- children: ce.map((e) => /* @__PURE__ */ (0, R.jsx)("option", {
1703
+ children: ce.map((e) => /* @__PURE__ */ (0, F.jsx)("option", {
1865
1704
  value: e.value,
1866
1705
  children: e.label
1867
1706
  }, e.value))
1868
1707
  }),
1869
- /* @__PURE__ */ (0, R.jsx)("input", {
1708
+ /* @__PURE__ */ (0, F.jsx)("input", {
1870
1709
  className: "h-5 text-[10px] border rounded px-1 bg-background w-16",
1871
1710
  value: t.value,
1872
1711
  placeholder: "value",
1873
1712
  onChange: (e) => s(n, { value: e.target.value }),
1874
1713
  "data-testid": `cf-rule-value-${n}`
1875
1714
  }),
1876
- /* @__PURE__ */ (0, R.jsx)("input", {
1715
+ /* @__PURE__ */ (0, F.jsx)("input", {
1877
1716
  type: "color",
1878
1717
  className: "h-5 w-5 rounded border cursor-pointer",
1879
1718
  value: t.backgroundColor || "#fef9c3",
1880
1719
  onChange: (e) => s(n, { backgroundColor: e.target.value }),
1881
1720
  title: "Background color"
1882
1721
  }),
1883
- /* @__PURE__ */ (0, R.jsx)(a, {
1722
+ /* @__PURE__ */ (0, F.jsx)(a, {
1884
1723
  type: "button",
1885
1724
  size: "sm",
1886
1725
  variant: "ghost",
1887
1726
  className: "h-5 w-5 p-0",
1888
1727
  onClick: () => o(n),
1889
1728
  "data-testid": `cf-rule-remove-${n}`,
1890
- children: /* @__PURE__ */ (0, R.jsx)(N, { className: "h-3 w-3" })
1729
+ children: /* @__PURE__ */ (0, F.jsx)(M, { className: "h-3 w-3" })
1891
1730
  })
1892
1731
  ]
1893
- }, n)), /* @__PURE__ */ (0, R.jsxs)(a, {
1732
+ }, n)), /* @__PURE__ */ (0, F.jsxs)(a, {
1894
1733
  type: "button",
1895
1734
  size: "sm",
1896
1735
  variant: "outline",
1897
1736
  className: "h-6 text-[10px] w-full",
1898
1737
  onClick: i,
1899
1738
  "data-testid": "cf-add-rule",
1900
- children: [/* @__PURE__ */ (0, R.jsx)(O, { className: "h-3 w-3 mr-1" }), "Add Rule"]
1739
+ children: [/* @__PURE__ */ (0, F.jsx)(O, { className: "h-3 w-3 mr-1" }), "Add Rule"]
1901
1740
  })]
1902
1741
  });
1903
1742
  }
@@ -1943,22 +1782,22 @@ function de({ value: e, onChange: t }) {
1943
1782
  let a = [...n];
1944
1783
  [a[e], a[i]] = [a[i], a[e]], t(a);
1945
1784
  };
1946
- return /* @__PURE__ */ (0, R.jsxs)("div", {
1785
+ return /* @__PURE__ */ (0, F.jsxs)("div", {
1947
1786
  className: "space-y-2 py-1",
1948
1787
  "data-testid": "section-manager",
1949
- children: [n.map((e, t) => /* @__PURE__ */ (0, R.jsxs)("div", {
1788
+ children: [n.map((e, t) => /* @__PURE__ */ (0, F.jsxs)("div", {
1950
1789
  className: "flex items-center gap-1 text-[10px] p-1.5 border rounded bg-muted/20",
1951
1790
  children: [
1952
- /* @__PURE__ */ (0, R.jsxs)("div", {
1791
+ /* @__PURE__ */ (0, F.jsxs)("div", {
1953
1792
  className: "flex flex-col gap-0.5 mr-1",
1954
- children: [/* @__PURE__ */ (0, R.jsx)("button", {
1793
+ children: [/* @__PURE__ */ (0, F.jsx)("button", {
1955
1794
  type: "button",
1956
1795
  className: "text-muted-foreground hover:text-foreground disabled:opacity-30",
1957
1796
  disabled: t === 0,
1958
1797
  onClick: () => s(t, -1),
1959
1798
  "data-testid": `section-up-${t}`,
1960
1799
  children: "▲"
1961
- }), /* @__PURE__ */ (0, R.jsx)("button", {
1800
+ }), /* @__PURE__ */ (0, F.jsx)("button", {
1962
1801
  type: "button",
1963
1802
  className: "text-muted-foreground hover:text-foreground disabled:opacity-30",
1964
1803
  disabled: t === n.length - 1,
@@ -1967,37 +1806,37 @@ function de({ value: e, onChange: t }) {
1967
1806
  children: "▼"
1968
1807
  })]
1969
1808
  }),
1970
- /* @__PURE__ */ (0, R.jsx)("span", {
1809
+ /* @__PURE__ */ (0, F.jsx)("span", {
1971
1810
  className: "text-[9px] bg-muted px-1.5 py-0.5 rounded uppercase font-medium shrink-0",
1972
1811
  children: e.type
1973
1812
  }),
1974
- /* @__PURE__ */ (0, R.jsx)("input", {
1813
+ /* @__PURE__ */ (0, F.jsx)("input", {
1975
1814
  className: "h-5 text-[10px] border rounded px-1 bg-background flex-1 min-w-0",
1976
1815
  value: e.title || "",
1977
1816
  placeholder: "Section title",
1978
1817
  onChange: (e) => o(t, { title: e.target.value }),
1979
1818
  "data-testid": `section-title-${t}`
1980
1819
  }),
1981
- /* @__PURE__ */ (0, R.jsx)(a, {
1820
+ /* @__PURE__ */ (0, F.jsx)(a, {
1982
1821
  type: "button",
1983
1822
  size: "sm",
1984
1823
  variant: "ghost",
1985
1824
  className: "h-5 w-5 p-0 shrink-0",
1986
1825
  onClick: () => i(t),
1987
1826
  "data-testid": `section-remove-${t}`,
1988
- children: /* @__PURE__ */ (0, R.jsx)(N, { className: "h-3 w-3" })
1827
+ children: /* @__PURE__ */ (0, F.jsx)(M, { className: "h-3 w-3" })
1989
1828
  })
1990
1829
  ]
1991
- }, t)), /* @__PURE__ */ (0, R.jsx)("div", {
1830
+ }, t)), /* @__PURE__ */ (0, F.jsx)("div", {
1992
1831
  className: "flex gap-1 flex-wrap",
1993
- children: ue.map((e) => /* @__PURE__ */ (0, R.jsxs)(a, {
1832
+ children: ue.map((e) => /* @__PURE__ */ (0, F.jsxs)(a, {
1994
1833
  type: "button",
1995
1834
  size: "sm",
1996
1835
  variant: "outline",
1997
1836
  className: "h-6 text-[10px]",
1998
1837
  onClick: () => r(e.value),
1999
1838
  "data-testid": `section-add-${e.value}`,
2000
- children: [/* @__PURE__ */ (0, R.jsx)(O, { className: "h-3 w-3 mr-0.5" }), e.label]
1839
+ children: [/* @__PURE__ */ (0, F.jsx)(O, { className: "h-3 w-3 mr-0.5" }), e.label]
2001
1840
  }, e.value))
2002
1841
  })]
2003
1842
  });
@@ -2072,7 +1911,7 @@ function fe(e = []) {
2072
1911
  key: "fields",
2073
1912
  label: "Report columns",
2074
1913
  type: "custom",
2075
- render: (t, n) => /* @__PURE__ */ (0, R.jsx)(ae, {
1914
+ render: (t, n) => /* @__PURE__ */ (0, F.jsx)(ae, {
2076
1915
  availableFields: e,
2077
1916
  value: t,
2078
1917
  onChange: n
@@ -2112,7 +1951,7 @@ function fe(e = []) {
2112
1951
  key: "chartConfig",
2113
1952
  label: "Chart",
2114
1953
  type: "custom",
2115
- render: (t, n) => /* @__PURE__ */ (0, R.jsx)(se, {
1954
+ render: (t, n) => /* @__PURE__ */ (0, F.jsx)(se, {
2116
1955
  availableFields: e,
2117
1956
  value: t,
2118
1957
  onChange: n
@@ -2129,7 +1968,7 @@ function fe(e = []) {
2129
1968
  key: "conditionalFormatting",
2130
1969
  label: "Rules",
2131
1970
  type: "custom",
2132
- render: (t, n) => /* @__PURE__ */ (0, R.jsx)(le, {
1971
+ render: (t, n) => /* @__PURE__ */ (0, F.jsx)(le, {
2133
1972
  availableFields: e,
2134
1973
  value: t,
2135
1974
  onChange: n
@@ -2146,7 +1985,7 @@ function fe(e = []) {
2146
1985
  key: "sections",
2147
1986
  label: "Report sections",
2148
1987
  type: "custom",
2149
- render: (e, t) => /* @__PURE__ */ (0, R.jsx)(de, {
1988
+ render: (e, t) => /* @__PURE__ */ (0, F.jsx)(de, {
2150
1989
  value: e,
2151
1990
  onChange: t
2152
1991
  })
@@ -2209,7 +2048,7 @@ function fe(e = []) {
2209
2048
  key: "schedule",
2210
2049
  label: "Schedule",
2211
2050
  type: "custom",
2212
- render: (e, t) => /* @__PURE__ */ (0, R.jsx)($, {
2051
+ render: (e, t) => /* @__PURE__ */ (0, F.jsx)(X, {
2213
2052
  schedule: e,
2214
2053
  onChange: t
2215
2054
  })
@@ -2255,7 +2094,7 @@ function fe(e = []) {
2255
2094
  }
2256
2095
  function pe({ open: e, onClose: n, config: r, onSave: i, onFieldChange: a, availableFields: o }) {
2257
2096
  let { draft: s, isDirty: c, updateField: l, discard: u, undo: d, redo: p, canUndo: m, canRedo: h } = b(r, { onUpdate: a });
2258
- return /* @__PURE__ */ (0, R.jsx)(f, {
2097
+ return /* @__PURE__ */ (0, F.jsx)(f, {
2259
2098
  open: e,
2260
2099
  onClose: n,
2261
2100
  schema: t.useMemo(() => fe(o), [o]),
@@ -2272,11 +2111,11 @@ function pe({ open: e, onClose: n, config: r, onSave: i, onFieldChange: a, avail
2272
2111
  }
2273
2112
  //#endregion
2274
2113
  //#region src/LiveReportExporter.ts
2275
- async function me(e, t) {
2114
+ async function Q(e, t) {
2276
2115
  let { dataSource: n, resource: r, queryParams: i, format: a, exportConfig: o } = t, s = a || e.defaultExportFormat || "pdf";
2277
2116
  try {
2278
2117
  let t = (await n.find(r, i)).data || [];
2279
- return G(s, e, t, {
2118
+ return H(s, e, t, {
2280
2119
  format: s,
2281
2120
  ...e.exportConfigs?.[s],
2282
2121
  ...o
@@ -2294,17 +2133,17 @@ async function me(e, t) {
2294
2133
  };
2295
2134
  }
2296
2135
  }
2297
- function he(e, t, n = {}) {
2298
- let { columns: r, filename: i, includeAggregationRow: a = !1 } = n, o = r || (e.fields || []).map(_e), s = o.map((e) => e.header), c = t.map((e, t) => o.map((n) => {
2136
+ function me(e, t, n = {}) {
2137
+ let { columns: r, filename: i, includeAggregationRow: a = !1 } = n, o = r || (e.fields || []).map(he), s = o.map((e) => e.header), c = t.map((e, t) => o.map((n) => {
2299
2138
  if (n.formula) return n.formula.replace(/\{ROW\}/g, String(t + 2));
2300
2139
  let r = e[n.name];
2301
- return ve(r, n.numberFormat);
2140
+ return ge(r, n.numberFormat);
2302
2141
  }));
2303
2142
  if (a && t.length > 0) {
2304
2143
  let n = o.map((n, r) => {
2305
2144
  let i = (e.fields || []).find((e) => e.name === n.name);
2306
2145
  if (i?.aggregation) {
2307
- let e = be(r), n = t.length + 1;
2146
+ let e = ve(r), n = t.length + 1;
2308
2147
  switch (i.aggregation) {
2309
2148
  case "sum": return `=SUM(${e}2:${e}${n})`;
2310
2149
  case "avg": return `=AVERAGE(${e}2:${e}${n})`;
@@ -2318,15 +2157,15 @@ function he(e, t, n = {}) {
2318
2157
  });
2319
2158
  c.push(n);
2320
2159
  }
2321
- Se("" + [s.join(" "), ...c.map((e) => e.join(" "))].join("\n"), i || `${e.title || "report"}.tsv`, "text/tab-separated-values");
2160
+ be("" + [s.join(" "), ...c.map((e) => e.join(" "))].join("\n"), i || `${e.title || "report"}.tsv`, "text/tab-separated-values");
2322
2161
  }
2323
- function ge(e, t, n, r) {
2162
+ function $(e, t, n, r) {
2324
2163
  return async () => {
2325
2164
  let i = e.schedule;
2326
2165
  if (!i?.enabled) return [];
2327
2166
  let a = i.formats || [e.defaultExportFormat || "pdf"], o = [];
2328
2167
  for (let r of a) {
2329
- let i = await me(e, {
2168
+ let i = await Q(e, {
2330
2169
  dataSource: t,
2331
2170
  resource: n,
2332
2171
  format: r
@@ -2336,16 +2175,16 @@ function ge(e, t, n, r) {
2336
2175
  return r(e, i), o;
2337
2176
  };
2338
2177
  }
2339
- function _e(e) {
2178
+ function he(e) {
2340
2179
  return {
2341
2180
  name: e.name,
2342
2181
  header: e.label || e.name
2343
2182
  };
2344
2183
  }
2345
- function ve(e, t) {
2346
- return e == null ? "" : typeof e == "number" && t ? e.toLocaleString("en-US", ye(t)) : xe(String(e));
2184
+ function ge(e, t) {
2185
+ return e == null ? "" : typeof e == "number" && t ? e.toLocaleString("en-US", _e(t)) : ye(String(e));
2347
2186
  }
2348
- function ye(e) {
2187
+ function _e(e) {
2349
2188
  if (e.includes("%")) return {
2350
2189
  style: "percent",
2351
2190
  minimumFractionDigits: 0
@@ -2356,23 +2195,23 @@ function ye(e) {
2356
2195
  maximumFractionDigits: Math.max(0, t - 1)
2357
2196
  };
2358
2197
  }
2359
- function be(e) {
2198
+ function ve(e) {
2360
2199
  let t = "", n = e;
2361
2200
  for (; n >= 0;) t = String.fromCharCode(n % 26 + 65) + t, n = Math.floor(n / 26) - 1;
2362
2201
  return t;
2363
2202
  }
2364
- function xe(e) {
2203
+ function ye(e) {
2365
2204
  if (e.length > 0) {
2366
2205
  let t = e.charAt(0);
2367
2206
  if (t === "=" || t === "+" || t === "-" || t === "@" || t === "|") return `'${e}`;
2368
2207
  }
2369
2208
  return e;
2370
2209
  }
2371
- function Se(e, t, n) {
2210
+ function be(e, t, n) {
2372
2211
  let r = new Blob([e], { type: `${n};charset=utf-8` }), i = URL.createObjectURL(r), a = document.createElement("a");
2373
2212
  a.href = i, a.download = t, document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(i);
2374
2213
  }
2375
- e.register("report", z, {
2214
+ e.register("report", I, {
2376
2215
  namespace: "report",
2377
2216
  label: "Report",
2378
2217
  category: "Report",
@@ -2393,7 +2232,7 @@ e.register("report", z, {
2393
2232
  label: "Chart Configuration"
2394
2233
  }
2395
2234
  ]
2396
- }), e.register("report-viewer", Q, {
2235
+ }), e.register("report-viewer", Y, {
2397
2236
  namespace: "report",
2398
2237
  label: "Report Viewer",
2399
2238
  category: "Report",
@@ -2406,7 +2245,7 @@ e.register("report", z, {
2406
2245
  type: "boolean",
2407
2246
  label: "Show Toolbar"
2408
2247
  }]
2409
- }), e.register("report-builder", re, {
2248
+ }), e.register("report-builder", Z, {
2410
2249
  namespace: "report",
2411
2250
  label: "Report Builder",
2412
2251
  category: "Report",
@@ -2417,4 +2256,4 @@ e.register("report", z, {
2417
2256
  }]
2418
2257
  });
2419
2258
  //#endregion
2420
- export { re as ReportBuilder, pe as ReportConfigPanel, z as ReportRenderer, Q as ReportViewer, $ as ScheduleConfig, ge as createScheduleTrigger, B as exportAsCSV, W as exportAsExcel, H as exportAsHTML, V as exportAsJSON, U as exportAsPDF, he as exportExcelWithFormulas, G as exportReport, me as exportWithLiveData, Z as formatValue };
2259
+ export { Z as ReportBuilder, pe as ReportConfigPanel, I as ReportRenderer, Y as ReportViewer, X as ScheduleConfig, $ as createScheduleTrigger, L as exportAsCSV, V as exportAsExcel, z as exportAsHTML, R as exportAsJSON, B as exportAsPDF, me as exportExcelWithFormulas, H as exportReport, Q as exportWithLiveData, J as formatValue };