react-semaphor 0.1.295 → 0.1.297

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.
Files changed (40) hide show
  1. package/dist/chunks/{braces-DWldEFn5.js → braces-BT-cB4J_.js} +1 -1
  2. package/dist/chunks/{braces-BdoTYzuj.js → braces-CSunPeAg.js} +1 -1
  3. package/dist/chunks/dashboard-controls-C6254Ugx.js +2219 -0
  4. package/dist/chunks/dashboard-controls-Za3WPtTh.js +47 -0
  5. package/dist/chunks/{dashboard-filter-controls-button-XwenlcXw.js → dashboard-filter-controls-button-DZnR5IgP.js} +487 -513
  6. package/dist/chunks/dashboard-filter-controls-button-dYWccDmw.js +11 -0
  7. package/dist/chunks/{dashboard-json-CU55qPXj.js → dashboard-json-CuI5gkwY.js} +1 -1
  8. package/dist/chunks/{dashboard-json-V6m6lJ_c.js → dashboard-json-DjpkfbSZ.js} +1 -1
  9. package/dist/chunks/{dashboard-summary-settings-dialog-DRLPzp1P.js → dashboard-summary-settings-dialog-C6FUhXQy.js} +1 -1
  10. package/dist/chunks/{dashboard-summary-settings-dialog-0CIiWsKc.js → dashboard-summary-settings-dialog-vC2shhM-.js} +1 -1
  11. package/dist/chunks/edit-dashboard-visual-CoG-tE_T.js +188 -0
  12. package/dist/chunks/{edit-dashboard-visual-8ha6EM_g.js → edit-dashboard-visual-TBI9_Pyh.js} +6351 -6452
  13. package/dist/chunks/index--CoasbAE.js +1523 -0
  14. package/dist/chunks/{index-14M0TnH6.js → index-D0iNspb-.js} +102960 -87712
  15. package/dist/chunks/{resource-management-panel-CcDAn86l.js → resource-management-panel-Cf4FTR33.js} +2 -2
  16. package/dist/chunks/{resource-management-panel-BL5-5ouC.js → resource-management-panel-HOWOJUap.js} +31 -30
  17. package/dist/chunks/{use-create-flow-overlay-state-D3PxfjYv.js → use-create-flow-overlay-state-B7bE6z5B.js} +572 -568
  18. package/dist/chunks/use-create-flow-overlay-state-BqiJrgeK.js +21 -0
  19. package/dist/chunks/use-visual-utils-DP6ty2_T.js +1 -0
  20. package/dist/chunks/{use-visual-utils-CdIOq4nt.js → use-visual-utils-DyvrB6Zh.js} +70 -68
  21. package/dist/dashboard/index.cjs +1 -1
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +113 -112
  25. package/dist/style.css +1 -1
  26. package/dist/surfboard/index.cjs +1 -1
  27. package/dist/surfboard/index.js +2 -2
  28. package/dist/types/dashboard.d.ts +245 -1
  29. package/dist/types/main.d.ts +317 -12
  30. package/dist/types/shared.d.ts +214 -1
  31. package/dist/types/surfboard.d.ts +245 -1
  32. package/dist/types/types.d.ts +245 -1
  33. package/package.json +7 -1
  34. package/dist/chunks/dashboard-controls-B3lrnI_r.js +0 -47
  35. package/dist/chunks/dashboard-controls-D7U6E1sB.js +0 -2014
  36. package/dist/chunks/dashboard-filter-controls-button-D0AsV28-.js +0 -11
  37. package/dist/chunks/edit-dashboard-visual-sSLAkmgf.js +0 -183
  38. package/dist/chunks/index-Ze8VskG1.js +0 -1435
  39. package/dist/chunks/use-create-flow-overlay-state-BbQVNDCj.js +0 -21
  40. package/dist/chunks/use-visual-utils-kh8p2QFm.js +0 -1
@@ -1,16 +1,16 @@
1
- import De, { useState as L, useRef as H, useCallback as z, useEffect as V, useContext as Ee } from "react";
2
- import { c as ne, d as W, aE as M, bL as q, bH as ie, bI as Q, aF as le, bG as Ae, e as de, f as ce, g as ue, h as me, i as he, L as Z, I as Se, db as Ie, w as Fe, B as A, x as J, W as j, M as Le, u as P, N as Te, Q as K, b_ as pe, dc as ke, dd as ee, y as T, c1 as fe, c0 as G, ai as Pe, cF as ve, cG as ge, a9 as be, cI as xe, cJ as B, t as Ue, cN as Ve, cw as Me, O as Be, de as Oe, b as O, df as Y, dg as ze, cV as Re, cW as _e, cX as $e, cY as He, cZ as je, c_ as Xe, c$ as Ge, bN as We, X as qe, dh as Qe, di as Je, cC as Ke, bJ as te, ab as Ye, aH as Ze, P as we, k as ye, dj as et, m as Ce, dk as tt, dl as at, dm as st, dn as rt, dp as ot, dq as ae, dr as nt } from "./index-14M0TnH6.js";
3
- import { jsx as t, jsxs as s, Fragment as R } from "react/jsx-runtime";
4
- import { V as it, E as lt, a as dt, b as ct, L as ut, c as mt, d as ht, C as pt, u as ft, e as vt } from "./use-create-flow-overlay-state-D3PxfjYv.js";
5
- import { u as Ne } from "./use-visual-utils-CdIOq4nt.js";
6
- import { k as se } from "./date-formatter-vkCj9Ct-.js";
1
+ import Se, { useState as T, useRef as X, useCallback as $, useEffect as B, useContext as Ae } from "react";
2
+ import { c as le, d as K, aF as z, bM as Q, bI as de, bJ as W, aG as ce, bH as Ie, e as ue, f as me, g as he, h as pe, i as fe, L as Z, I as Fe, dc as Le, w as Te, B as I, x as q, W as j, M as ke, u as O, N as Pe, Q as J, c0 as ve, dd as Ue, de as ee, y as P, c2 as ge, c1 as G, ai as Me, cG as be, cH as xe, a9 as ye, cJ as we, cK as R, t as Ve, cO as Oe, cx as Be, O as ze, df as Re, b as H, dg as Y, dh as $e, cW as _e, cX as He, cY as je, cZ as Xe, c_ as Ge, c$ as Ke, d0 as Qe, bO as We, X as qe, di as Je, dj as Ye, cD as Ze, bK as te, ab as et, aI as tt, P as Ce, k as De, dk as at, m as Ne, dl as st, dm as rt, dn as ot, dp as nt, dq as it, dr as ae, ds as lt } from "./index-D0iNspb-.js";
3
+ import { jsx as t, jsxs as s, Fragment as _ } from "react/jsx-runtime";
4
+ import { V as dt, E as se, a as re, b as ct, c as ut, L as mt, d as ht, C as pt, u as ft, e as vt } from "./use-create-flow-overlay-state-B7bE6z5B.js";
5
+ import { u as Ee } from "./use-visual-utils-DyvrB6Zh.js";
6
+ import { k as oe } from "./date-formatter-vkCj9Ct-.js";
7
7
  /**
8
8
  * @license lucide-react v0.453.0 - ISC
9
9
  *
10
10
  * This source code is licensed under the ISC license.
11
11
  * See the LICENSE file in the root directory of this source tree.
12
12
  */
13
- const re = ne("FileDown", [
13
+ const ne = le("FileDown", [
14
14
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
15
15
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
16
16
  ["path", { d: "M12 18v-6", key: "17g6i2" }],
@@ -22,158 +22,158 @@ const re = ne("FileDown", [
22
22
  * This source code is licensed under the ISC license.
23
23
  * See the LICENSE file in the root directory of this source tree.
24
24
  */
25
- const gt = ne("FilterX", [
25
+ const gt = le("FilterX", [
26
26
  ["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
27
27
  ["path", { d: "m22 3-5 5", key: "12jva0" }],
28
28
  ["path", { d: "m17 3 5 5", key: "k36vhe" }]
29
- ]), bt = 1e4, xt = 15e3, wt = 3e4, yt = 3e4, Ct = 12e4, oe = 2 * 60 * 60 * 1e3;
30
- function Nt(e) {
29
+ ]), bt = 1e4, xt = 15e3, yt = 3e4, wt = 3e4, Ct = 12e4, ie = 2 * 60 * 60 * 1e3;
30
+ function Dt(e) {
31
31
  const a = Date.now() - e.getTime();
32
- return a < yt ? bt : a < Ct ? xt : wt;
32
+ return a < wt ? bt : a < Ct ? xt : yt;
33
33
  }
34
- function Mt() {
35
- const { authToken: e, tokenProps: a } = W(), f = M((p) => p.activeExports), [d, i] = L(
34
+ function Vt() {
35
+ const { authToken: e, tokenProps: a } = K(), v = z((h) => h.activeExports), [l, n] = T(
36
36
  typeof document < "u" ? !document.hidden : !0
37
- ), m = H(null), c = H(!1), h = H(void 0), o = a == null ? void 0 : a.apiServiceUrl, r = e == null ? void 0 : e.accessToken, v = z(() => {
38
- const p = M.getState().activeExports;
39
- return Array.from(p.values()).filter(
40
- (b) => q(b.status)
37
+ ), d = X(null), c = X(!1), m = X(void 0), i = a == null ? void 0 : a.apiServiceUrl, r = e == null ? void 0 : e.accessToken, p = $(() => {
38
+ const h = z.getState().activeExports;
39
+ return Array.from(h.values()).filter(
40
+ (y) => Q(y.status)
41
41
  );
42
42
  }, []);
43
- V(() => {
43
+ B(() => {
44
44
  if (typeof document > "u") return;
45
- const p = () => {
46
- i(!document.hidden);
45
+ const h = () => {
46
+ n(!document.hidden);
47
47
  };
48
- return document.addEventListener("visibilitychange", p), () => {
49
- document.removeEventListener("visibilitychange", p);
48
+ return document.addEventListener("visibilitychange", h), () => {
49
+ document.removeEventListener("visibilitychange", h);
50
50
  };
51
51
  }, []);
52
- const x = z(async () => {
53
- if (!o || !r) {
52
+ const b = $(async () => {
53
+ if (!i || !r) {
54
54
  c.current = !1;
55
55
  return;
56
56
  }
57
- const p = v();
58
- if (p.length === 0) {
57
+ const h = p();
58
+ if (h.length === 0) {
59
59
  c.current = !1;
60
60
  return;
61
61
  }
62
- const b = Date.now(), D = p.filter(
63
- (n) => b - n.startedAt.getTime() > oe
62
+ const y = Date.now(), E = h.filter(
63
+ (o) => y - o.startedAt.getTime() > ie
64
64
  );
65
- if (D.length > 0) {
66
- const { updateExport: n } = M.getState().actions;
67
- for (const w of D)
68
- n(w.id, {
65
+ if (E.length > 0) {
66
+ const { updateExport: o } = z.getState().actions;
67
+ for (const x of E)
68
+ o(x.id, {
69
69
  status: "failed",
70
70
  error: "Export timed out. Please try again or contact support.",
71
71
  lastUpdatedAt: /* @__PURE__ */ new Date()
72
72
  });
73
73
  }
74
- const g = p.filter(
75
- (n) => b - n.startedAt.getTime() <= oe
74
+ const f = h.filter(
75
+ (o) => y - o.startedAt.getTime() <= ie
76
76
  );
77
- if (g.length === 0) {
77
+ if (f.length === 0) {
78
78
  c.current = !1;
79
79
  return;
80
80
  }
81
- const C = await Promise.allSettled(
82
- g.map(async (n) => {
81
+ const w = await Promise.allSettled(
82
+ f.map(async (o) => {
83
83
  try {
84
- const w = await ie(o, r, n.id);
85
- let y;
86
- if (w.status === "completed")
84
+ const x = await de(i, r, o.id);
85
+ let N;
86
+ if (x.status === "completed")
87
87
  try {
88
- y = await Q(o, r, n.id);
88
+ N = await W(i, r, o.id);
89
89
  } catch (F) {
90
90
  console.error(
91
- `[useExportPolling] Failed to get download URL for ${n.id}:`,
91
+ `[useExportPolling] Failed to get download URL for ${o.id}:`,
92
92
  F
93
93
  );
94
94
  }
95
95
  return {
96
- id: n.id,
97
- status: w.status,
98
- progress: w.progress,
99
- completedChunks: w.completedChunks,
100
- completedAt: w.completedAt ? new Date(w.completedAt) : void 0,
96
+ id: o.id,
97
+ status: x.status,
98
+ progress: x.progress,
99
+ completedChunks: x.completedChunks,
100
+ completedAt: x.completedAt ? new Date(x.completedAt) : void 0,
101
101
  lastUpdatedAt: /* @__PURE__ */ new Date(),
102
- fileSize: w.fileSize,
103
- error: w.error,
104
- downloadUrl: y
102
+ fileSize: x.fileSize,
103
+ error: x.error,
104
+ downloadUrl: N
105
105
  };
106
- } catch (w) {
106
+ } catch (x) {
107
107
  return console.error(
108
- `[useExportPolling] Failed to poll export ${n.id}:`,
109
- w
108
+ `[useExportPolling] Failed to poll export ${o.id}:`,
109
+ x
110
110
  ), null;
111
111
  }
112
112
  })
113
- ), { updateExport: E } = M.getState().actions;
114
- for (const n of C)
115
- n.status === "fulfilled" && n.value && E(n.value.id, n.value);
116
- const N = v();
117
- if (N.length > 0 && !document.hidden) {
118
- const n = N.reduce(
119
- (y, F) => F.startedAt < y ? F.startedAt : y,
120
- N[0].startedAt
121
- ), w = Nt(n);
122
- m.current && clearTimeout(m.current), m.current = setTimeout(() => {
123
- var y;
124
- (y = h.current) == null || y.call(h);
125
- }, w);
113
+ ), { updateExport: S } = z.getState().actions;
114
+ for (const o of w)
115
+ o.status === "fulfilled" && o.value && S(o.value.id, o.value);
116
+ const C = p();
117
+ if (C.length > 0 && !document.hidden) {
118
+ const o = C.reduce(
119
+ (N, F) => F.startedAt < N ? F.startedAt : N,
120
+ C[0].startedAt
121
+ ), x = Dt(o);
122
+ d.current && clearTimeout(d.current), d.current = setTimeout(() => {
123
+ var N;
124
+ (N = m.current) == null || N.call(m);
125
+ }, x);
126
126
  } else
127
127
  c.current = !1;
128
- }, [o, r, v]);
129
- return V(() => {
130
- h.current = x;
131
- }, [x]), V(() => {
132
- var b;
133
- v().length > 0 && d && !c.current && (c.current = !0, (b = h.current) == null || b.call(h));
134
- }, [f, d, v]), V(() => {
135
- var b;
136
- const p = v();
137
- d && p.length > 0 && !c.current && (c.current = !0, (b = h.current) == null || b.call(h));
138
- }, [d, v]), V(() => {
139
- !d && m.current && (clearTimeout(m.current), m.current = null, c.current = !1);
140
- }, [d]), V(() => () => {
141
- m.current && (clearTimeout(m.current), m.current = null);
128
+ }, [i, r, p]);
129
+ return B(() => {
130
+ m.current = b;
131
+ }, [b]), B(() => {
132
+ var y;
133
+ p().length > 0 && l && !c.current && (c.current = !0, (y = m.current) == null || y.call(m));
134
+ }, [v, l, p]), B(() => {
135
+ var y;
136
+ const h = p();
137
+ l && h.length > 0 && !c.current && (c.current = !0, (y = m.current) == null || y.call(m));
138
+ }, [l, p]), B(() => {
139
+ !l && d.current && (clearTimeout(d.current), d.current = null, c.current = !1);
140
+ }, [l]), B(() => () => {
141
+ d.current && (clearTimeout(d.current), d.current = null);
142
142
  }, []), {
143
143
  isPolling: c.current,
144
- isTabVisible: d,
145
- inProgressCount: v().length
144
+ isTabVisible: l,
145
+ inProgressCount: p().length
146
146
  };
147
147
  }
148
- function Bt() {
149
- const { authToken: e, tokenProps: a } = W(), f = M((h) => h.activeExports), { addExport: d } = le(), i = H(!1), m = a == null ? void 0 : a.apiServiceUrl, c = e == null ? void 0 : e.accessToken;
150
- V(() => {
151
- if (i.current || !m || !c) return;
148
+ function Ot() {
149
+ const { authToken: e, tokenProps: a } = K(), v = z((m) => m.activeExports), { addExport: l } = ce(), n = X(!1), d = a == null ? void 0 : a.apiServiceUrl, c = e == null ? void 0 : e.accessToken;
150
+ B(() => {
151
+ if (n.current || !d || !c) return;
152
152
  (async () => {
153
153
  try {
154
- const { exports: o } = await Ae(m, c, {
154
+ const { exports: i } = await Ie(d, c, {
155
155
  status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
156
156
  limit: 20
157
157
  // Limit to recent exports
158
158
  });
159
- for (const r of o) {
160
- if (f.has(r.id)) continue;
161
- const v = r.totalChunks ? Math.round(r.completedChunks / r.totalChunks * 100) : 0;
162
- let x;
159
+ for (const r of i) {
160
+ if (v.has(r.id)) continue;
161
+ const p = r.totalChunks ? Math.round(r.completedChunks / r.totalChunks * 100) : 0;
162
+ let b;
163
163
  if (r.status === "completed")
164
164
  try {
165
- x = await Q(m, c, r.id);
166
- } catch (b) {
165
+ b = await W(d, c, r.id);
166
+ } catch (y) {
167
167
  console.error(
168
168
  `[useExportRecovery] Failed to get download URL for ${r.id}:`,
169
- b
169
+ y
170
170
  );
171
171
  }
172
- const p = {
172
+ const h = {
173
173
  id: r.id,
174
174
  status: r.status,
175
- progress: v,
176
- title: Dt(r),
175
+ progress: p,
176
+ title: Nt(r),
177
177
  totalRows: r.totalRows,
178
178
  totalChunks: r.totalChunks,
179
179
  completedChunks: r.completedChunks,
@@ -183,46 +183,46 @@ function Bt() {
183
183
  fileSize: r.fileSize,
184
184
  error: r.error,
185
185
  expiresAt: new Date(r.expiresAt),
186
- downloadUrl: x
186
+ downloadUrl: b
187
187
  };
188
- d(p);
188
+ l(h);
189
189
  }
190
- i.current = !0;
191
- } catch (o) {
192
- console.error("[useExportRecovery] Failed to recover exports:", o), i.current = !0;
190
+ n.current = !0;
191
+ } catch (i) {
192
+ console.error("[useExportRecovery] Failed to recover exports:", i), n.current = !0;
193
193
  }
194
194
  })();
195
- }, [m, c, d, f]);
195
+ }, [d, c, l, v]);
196
196
  }
197
- function Dt(e) {
198
- return e.title ? e.title : q(
197
+ function Nt(e) {
198
+ return e.title ? e.title : Q(
199
199
  e.status
200
200
  ) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
201
201
  }
202
202
  function Et({
203
203
  open: e,
204
204
  onOpenChange: a,
205
- isLibraryVisual: f,
206
- currentVisualName: d,
207
- isSaving: i = !1,
208
- destinationMode: m = "both",
205
+ isLibraryVisual: v,
206
+ currentVisualName: l,
207
+ isSaving: n = !1,
208
+ destinationMode: d = "both",
209
209
  onConfirm: c
210
210
  }) {
211
- const [h, o] = L(
212
- f && d ? `Copy of ${d}` : d || ""
213
- ), [r, v] = L("");
214
- De.useEffect(() => {
215
- e && (o(
216
- f && d ? `Copy of ${d}` : d || ""
217
- ), v(""));
218
- }, [e, f, d]);
219
- const x = !!h.trim(), p = m === "local" ? {
211
+ const [m, i] = T(
212
+ v && l ? `Copy of ${l}` : l || ""
213
+ ), [r, p] = T("");
214
+ Se.useEffect(() => {
215
+ e && (i(
216
+ v && l ? `Copy of ${l}` : l || ""
217
+ ), p(""));
218
+ }, [e, v, l]);
219
+ const b = !!m.trim(), h = d === "local" ? {
220
220
  saveToLibrary: !1,
221
221
  saveToCurrentDashboard: !0,
222
222
  badgeType: "local",
223
223
  description: "Creates a local copy on the current dashboard.",
224
224
  actionLabel: "Add to Dashboard (Local)"
225
- } : m === "library" ? {
225
+ } : d === "library" ? {
226
226
  saveToLibrary: !0,
227
227
  saveToCurrentDashboard: !1,
228
228
  badgeType: "library",
@@ -234,152 +234,152 @@ function Et({
234
234
  badgeType: "linked",
235
235
  description: "Creates a new library visual and adds a linked copy to this dashboard.",
236
236
  actionLabel: "Save Copy as Linked Visual"
237
- }, b = () => {
238
- !x || i || c({
239
- name: h.trim(),
237
+ }, y = () => {
238
+ !b || n || c({
239
+ name: m.trim(),
240
240
  description: r.trim() || void 0,
241
- saveToLibrary: p.saveToLibrary,
242
- saveToCurrentDashboard: p.saveToCurrentDashboard
241
+ saveToLibrary: h.saveToLibrary,
242
+ saveToCurrentDashboard: h.saveToCurrentDashboard
243
243
  });
244
244
  };
245
- return /* @__PURE__ */ t(de, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(ce, { className: "sm:max-w-[500px]", children: [
246
- /* @__PURE__ */ s(ue, { children: [
247
- /* @__PURE__ */ s(me, { className: "flex items-center gap-2", children: [
245
+ return /* @__PURE__ */ t(ue, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(me, { className: "sm:max-w-[500px]", children: [
246
+ /* @__PURE__ */ s(he, { children: [
247
+ /* @__PURE__ */ s(pe, { className: "flex items-center gap-2", children: [
248
248
  /* @__PURE__ */ t("span", { children: "Save Visual As" }),
249
- p.badgeType !== "local" && /* @__PURE__ */ t(
250
- it,
249
+ h.badgeType !== "local" && /* @__PURE__ */ t(
250
+ dt,
251
251
  {
252
- type: p.badgeType,
252
+ type: h.badgeType,
253
253
  showLabel: !0,
254
254
  className: "px-2 py-0.5"
255
255
  }
256
256
  )
257
257
  ] }),
258
- /* @__PURE__ */ t(he, { children: p.description })
258
+ /* @__PURE__ */ t(fe, { children: h.description })
259
259
  ] }),
260
260
  /* @__PURE__ */ s("div", { className: "grid gap-4 py-4", children: [
261
261
  /* @__PURE__ */ s("div", { className: "grid gap-2", children: [
262
262
  /* @__PURE__ */ t(Z, { htmlFor: "name", children: "Name" }),
263
263
  /* @__PURE__ */ t(
264
- Se,
264
+ Fe,
265
265
  {
266
266
  id: "name",
267
- value: h,
268
- onChange: (D) => o(D.target.value),
267
+ value: m,
268
+ onChange: (E) => i(E.target.value),
269
269
  placeholder: "Enter visual name",
270
- disabled: i
270
+ disabled: n
271
271
  }
272
272
  )
273
273
  ] }),
274
274
  /* @__PURE__ */ s("div", { className: "grid gap-2", children: [
275
275
  /* @__PURE__ */ t(Z, { htmlFor: "description", children: "Description (optional)" }),
276
276
  /* @__PURE__ */ t(
277
- Ie,
277
+ Le,
278
278
  {
279
279
  id: "description",
280
280
  value: r,
281
- onChange: (D) => v(D.target.value),
281
+ onChange: (E) => p(E.target.value),
282
282
  placeholder: "Enter visual description",
283
283
  rows: 3,
284
- disabled: i
284
+ disabled: n
285
285
  }
286
286
  )
287
287
  ] })
288
288
  ] }),
289
- /* @__PURE__ */ s(Fe, { children: [
289
+ /* @__PURE__ */ s(Te, { children: [
290
290
  /* @__PURE__ */ t(
291
- A,
291
+ I,
292
292
  {
293
293
  variant: "outline",
294
294
  onClick: () => a(!1),
295
- disabled: i,
295
+ disabled: n,
296
296
  children: "Cancel"
297
297
  }
298
298
  ),
299
- /* @__PURE__ */ s(A, { onClick: b, disabled: !x || i, children: [
300
- i && /* @__PURE__ */ t(J, { className: "mr-2 h-4 w-4 animate-spin" }),
301
- p.actionLabel
299
+ /* @__PURE__ */ s(I, { onClick: y, disabled: !b || n, children: [
300
+ n && /* @__PURE__ */ t(q, { className: "mr-2 h-4 w-4 animate-spin" }),
301
+ h.actionLabel
302
302
  ] })
303
303
  ] })
304
304
  ] }) });
305
305
  }
306
- function At() {
307
- const [e, a] = L(!1), [f, d] = L(!1), [i, m] = L(null), [c, h] = L(null), o = j((u) => u.frame), r = j((u) => u.card), v = Le(), x = P((u) => u.selectedSheetId), p = P((u) => u.dashboard), b = P(
306
+ function St() {
307
+ const [e, a] = T(!1), [v, l] = T(!1), [n, d] = T(null), [c, m] = T(null), i = j((u) => u.frame), r = j((u) => u.card), p = ke(), b = O((u) => u.selectedSheetId), h = O((u) => u.dashboard), y = O(
308
308
  (u) => u.actions.setIsDashboardPanelOpen
309
- ), { getUpdatedFrame: D } = Ne(), { selectVisual: g } = Te(), { addFrame: C, setSelectedFrameId: E, setIsVisualEditing: N } = K(), n = pe(), w = !!(o != null && o.visualId), y = (() => {
310
- var u, l;
311
- return ((u = o == null ? void 0 : o.cards) == null ? void 0 : u.length) === 1 && ((l = o.cards[0]) != null && l.title) ? o.cards[0].title : v != null && v.title ? v.title : (r == null ? void 0 : r.title) || "Untitled Visual";
312
- })(), F = ke((u) => {
313
- u != null && u.id && (g(u), f && i && c && x && (async () => {
309
+ ), { getUpdatedFrame: E } = Ee(), { selectVisual: f } = Pe(), { addFrame: w, setSelectedFrameId: S, setIsVisualEditing: C } = J(), o = ve(), x = !!(i != null && i.visualId), N = (() => {
310
+ var u, g;
311
+ return ((u = i == null ? void 0 : i.cards) == null ? void 0 : u.length) === 1 && ((g = i.cards[0]) != null && g.title) ? i.cards[0].title : p != null && p.title ? p.title : (r == null ? void 0 : r.title) || "Untitled Visual";
312
+ })(), F = Ue((u) => {
313
+ u != null && u.id && (f(u), v && n && c && b && (async () => {
314
314
  try {
315
- const l = {
316
- ...i,
315
+ const g = {
316
+ ...n,
317
317
  id: ee(),
318
318
  visualId: u.id
319
319
  // Link to the newly created library visual
320
320
  };
321
- C(x, l, {
321
+ w(b, g, {
322
322
  position: "end",
323
323
  semanticExecutionPayload: c
324
- }), E(l.id), d(!1), m(null), h(null), N(!1);
325
- } catch (l) {
324
+ }), S(g.id), l(!1), d(null), m(null), C(!1);
325
+ } catch (g) {
326
326
  console.error(
327
327
  "Failed to promote semantic metadata for saved visual:",
328
- l
329
- ), T.error(
330
- l instanceof Error ? l.message : "Failed to prepare semantic metadata for the saved visual"
328
+ g
329
+ ), P.error(
330
+ g instanceof Error ? g.message : "Failed to prepare semantic metadata for the saved visual"
331
331
  );
332
332
  }
333
- })(), b(!0), a(!1));
333
+ })(), y(!0), a(!1));
334
334
  });
335
335
  return {
336
336
  saveAsDialogOpen: e,
337
337
  setSaveAsDialogOpen: a,
338
338
  handleSaveAs: async (u) => {
339
- if (!x) {
340
- T.error("No sheet selected");
339
+ if (!b) {
340
+ P.error("No sheet selected");
341
341
  return;
342
342
  }
343
- const l = D(), S = fe(l);
344
- if (S) {
345
- T.error(S);
343
+ const g = E(), A = ge(g);
344
+ if (A) {
345
+ P.error(A);
346
346
  return;
347
347
  }
348
- const k = l.cards.length === 1 ? {
349
- ...l,
350
- cards: l.cards.map((I) => ({
351
- ...I,
348
+ const k = g.cards.length === 1 ? {
349
+ ...g,
350
+ cards: g.cards.map((L) => ({
351
+ ...L,
352
352
  title: u.name
353
353
  // Use visual name as card title
354
354
  }))
355
- } : l;
355
+ } : g;
356
356
  if (u.saveToLibrary) {
357
- let I = null;
357
+ let L = null;
358
358
  if (u.saveToCurrentDashboard)
359
359
  try {
360
- I = await n(k, {
361
- previousFrame: G(p, k.id)
360
+ L = await o(k, {
361
+ previousFrame: G(h, k.id)
362
362
  });
363
- } catch (X) {
363
+ } catch (V) {
364
364
  console.error(
365
365
  "Failed to prepare semantic metadata before saving visual:",
366
- X
367
- ), T.error(
368
- X instanceof Error ? X.message : "Failed to prepare semantic metadata for the saved visual"
366
+ V
367
+ ), P.error(
368
+ V instanceof Error ? V.message : "Failed to prepare semantic metadata for the saved visual"
369
369
  );
370
370
  return;
371
371
  }
372
- d(u.saveToCurrentDashboard), m(k), h(I);
373
- const U = {
372
+ l(u.saveToCurrentDashboard), d(k), m(L);
373
+ const M = {
374
374
  title: u.name,
375
375
  description: u.description,
376
376
  frameObject: k,
377
377
  // Card title synced for single-card frames
378
378
  isPrivate: !1
379
379
  };
380
- F.mutate(U);
380
+ F.mutate(M);
381
381
  } else if (u.saveToCurrentDashboard) {
382
- const I = {
382
+ const L = {
383
383
  ...k,
384
384
  // Card title already synced
385
385
  id: ee(),
@@ -387,146 +387,152 @@ function At() {
387
387
  // Explicitly no visualId for local visuals
388
388
  };
389
389
  try {
390
- const U = await n(k, {
391
- previousFrame: G(p, k.id)
390
+ const M = await o(k, {
391
+ previousFrame: G(h, k.id)
392
392
  });
393
- C(x, I, {
393
+ w(b, L, {
394
394
  position: "end",
395
- semanticExecutionPayload: U
396
- }), E(I.id), T.success("Visual saved to dashboard"), a(!1), N(!1);
397
- } catch (U) {
398
- console.error("Failed to save visual to dashboard:", U), T.error(
399
- U instanceof Error ? U.message : "Failed to prepare semantic metadata for the visual"
395
+ semanticExecutionPayload: M
396
+ }), S(L.id), P.success("Visual saved to dashboard"), a(!1), C(!1);
397
+ } catch (M) {
398
+ console.error("Failed to save visual to dashboard:", M), P.error(
399
+ M instanceof Error ? M.message : "Failed to prepare semantic metadata for the visual"
400
400
  );
401
401
  }
402
402
  }
403
403
  },
404
- isLibraryVisual: w,
405
- currentVisualName: y,
404
+ isLibraryVisual: x,
405
+ currentVisualName: N,
406
406
  isSaving: F.isPending
407
407
  };
408
408
  }
409
- function Ot(e = {}) {
410
- const a = j((l) => l.frame), f = Pe((l) => l.selectedVisual), d = P((l) => l.selectedFrameId), i = P((l) => l.selectedSheetId), m = P((l) => l.dashboard), { setIsVisualEditing: c, updateFrame: h } = K(), [o, r] = L(!1), [v, x] = L("both"), p = pe(), b = !!(a != null && a.visualId || f != null && f.id), D = !!(a != null && a.visualId && d), g = b && !D, {
409
+ function Bt(e = {}) {
410
+ const a = j((D) => D.frame), v = j((D) => D.editorContext), l = Me((D) => D.selectedVisual), n = O((D) => D.selectedFrameId), d = O((D) => D.selectedSheetId), c = O((D) => D.dashboard), { setIsVisualEditing: m, updateFrame: i } = J(), [r, p] = T(!1), [b, h] = T("both"), y = ve(), E = (v == null ? void 0 : v.type) === "documentSection", f = !!(a != null && a.visualId || l != null && l.id), w = !!(a != null && a.visualId && n), S = f && !w, {
411
411
  saveAsDialogOpen: C,
412
- setSaveAsDialogOpen: E,
413
- handleSaveAs: N,
414
- isLibraryVisual: n,
415
- currentVisualName: w,
416
- isSaving: y
417
- } = At(), { getUpdatedFrame: F } = Ne(), _ = async () => {
418
- if (!i) {
419
- T.error("No sheet selected");
412
+ setSaveAsDialogOpen: o,
413
+ handleSaveAs: x,
414
+ isLibraryVisual: N,
415
+ currentVisualName: F,
416
+ isSaving: U
417
+ } = St(), { getUpdatedFrame: u } = Ee();
418
+ if (E)
419
+ return /* @__PURE__ */ s(_, { children: [
420
+ /* @__PURE__ */ t(se, { className: "rounded-[5px]", variant: "default" }),
421
+ /* @__PURE__ */ t(re, {})
422
+ ] });
423
+ const g = async () => {
424
+ if (!d) {
425
+ P.error("No sheet selected");
420
426
  return;
421
427
  }
422
- if (o) return;
423
- r(!0);
424
- const l = F(), S = fe(l);
425
- if (S) {
426
- r(!1), T.error(S);
428
+ if (r) return;
429
+ p(!0);
430
+ const D = u(), k = ge(D);
431
+ if (k) {
432
+ p(!1), P.error(k);
427
433
  return;
428
434
  }
429
- const $ = {
430
- ...l,
435
+ const L = {
436
+ ...D,
431
437
  visualId: void 0
432
- }, k = G(m, $.id);
438
+ }, M = G(c, L.id);
433
439
  try {
434
- const I = await p($, {
435
- previousFrame: k
440
+ const V = await y(L, {
441
+ previousFrame: M
436
442
  });
437
- h(i, $, {
438
- semanticExecutionPayload: I
443
+ i(d, L, {
444
+ semanticExecutionPayload: V
439
445
  });
440
- } catch (I) {
441
- console.error("Failed to apply local semantic metadata:", I), r(!1), T.error(
442
- I instanceof Error ? I.message : "Failed to prepare semantic metadata for this visual"
446
+ } catch (V) {
447
+ console.error("Failed to apply local semantic metadata:", V), p(!1), P.error(
448
+ V instanceof Error ? V.message : "Failed to prepare semantic metadata for this visual"
443
449
  );
444
450
  return;
445
451
  }
446
452
  setTimeout(() => {
447
- r(!1), T.success("Changes applied. Visual is now local to this dashboard"), c(!1);
453
+ p(!1), P.success("Changes applied. Visual is now local to this dashboard"), m(!1);
448
454
  }, 300);
449
- }, u = (l) => {
450
- x(l), E(!0);
455
+ }, A = (D) => {
456
+ h(D), o(!0);
451
457
  };
452
- return /* @__PURE__ */ s(R, { children: [
458
+ return /* @__PURE__ */ s(_, { children: [
453
459
  /* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-[5px]", children: [
454
- !b && /* @__PURE__ */ t(
455
- lt,
460
+ !f && /* @__PURE__ */ t(
461
+ se,
456
462
  {
457
463
  className: "rounded-none",
458
464
  variant: "default"
459
465
  }
460
466
  ),
461
- b && g && /* @__PURE__ */ t(
462
- dt,
467
+ f && S && /* @__PURE__ */ t(
468
+ ct,
463
469
  {
464
470
  className: "rounded-none",
465
471
  variant: "default"
466
472
  }
467
473
  ),
468
- b && D && /* @__PURE__ */ t(ct, { className: "rounded-none" }),
469
- /* @__PURE__ */ s(ve, { modal: !1, children: [
470
- /* @__PURE__ */ t(ge, { asChild: !0, children: /* @__PURE__ */ t(
471
- A,
474
+ f && w && /* @__PURE__ */ t(ut, { className: "rounded-none" }),
475
+ /* @__PURE__ */ s(be, { modal: !1, children: [
476
+ /* @__PURE__ */ t(xe, { asChild: !0, children: /* @__PURE__ */ t(
477
+ I,
472
478
  {
473
479
  variant: "default",
474
480
  size: "xs",
475
481
  className: "w-7 rounded-none border-l border-primary-foreground/20 px-0",
476
482
  "aria-label": "Open visual save options",
477
- disabled: y || o,
478
- children: /* @__PURE__ */ t(be, { className: "h-3.5 w-3.5" })
483
+ disabled: U || r,
484
+ children: /* @__PURE__ */ t(ye, { className: "h-3.5 w-3.5" })
479
485
  }
480
486
  ) }),
481
487
  /* @__PURE__ */ s(
482
- xe,
488
+ we,
483
489
  {
484
490
  align: "end",
485
491
  className: "min-w-[220px] rounded-[6px] border border-border/60 p-1 shadow-sm",
486
492
  children: [
487
- D && /* @__PURE__ */ s(R, { children: [
493
+ w && /* @__PURE__ */ s(_, { children: [
488
494
  /* @__PURE__ */ s(
489
- B,
495
+ R,
490
496
  {
491
- onClick: _,
492
- disabled: o,
497
+ onClick: g,
498
+ disabled: r,
493
499
  children: [
494
- /* @__PURE__ */ t(Ue, { className: "h-3.5 w-3.5" }),
495
- o ? "Applying..." : "Apply Locally"
500
+ /* @__PURE__ */ t(Ve, { className: "h-3.5 w-3.5" }),
501
+ r ? "Applying..." : "Apply Locally"
496
502
  ]
497
503
  }
498
504
  ),
499
- /* @__PURE__ */ t(Ve, {})
505
+ /* @__PURE__ */ t(Oe, {})
500
506
  ] }),
501
507
  /* @__PURE__ */ s(
502
- B,
508
+ R,
503
509
  {
504
- onClick: () => u("local"),
505
- disabled: y,
510
+ onClick: () => A("local"),
511
+ disabled: U,
506
512
  children: [
507
- /* @__PURE__ */ t(Me, { className: "h-3.5 w-3.5" }),
513
+ /* @__PURE__ */ t(Be, { className: "h-3.5 w-3.5" }),
508
514
  "Add to Dashboard (Local)"
509
515
  ]
510
516
  }
511
517
  ),
512
518
  /* @__PURE__ */ s(
513
- B,
519
+ R,
514
520
  {
515
- onClick: () => u("library"),
516
- disabled: y,
521
+ onClick: () => A("library"),
522
+ disabled: U,
517
523
  children: [
518
- /* @__PURE__ */ t(ut, { className: "h-3.5 w-3.5" }),
524
+ /* @__PURE__ */ t(mt, { className: "h-3.5 w-3.5" }),
519
525
  "Save as Library Visual"
520
526
  ]
521
527
  }
522
528
  ),
523
529
  /* @__PURE__ */ s(
524
- B,
530
+ R,
525
531
  {
526
- onClick: () => u("both"),
527
- disabled: y,
532
+ onClick: () => A("both"),
533
+ disabled: U,
528
534
  children: [
529
- /* @__PURE__ */ t(mt, { className: "h-3.5 w-3.5" }),
535
+ /* @__PURE__ */ t(ht, { className: "h-3.5 w-3.5" }),
530
536
  "Save Copy as Linked Visual"
531
537
  ]
532
538
  }
@@ -536,74 +542,42 @@ function Ot(e = {}) {
536
542
  )
537
543
  ] })
538
544
  ] }),
539
- /* @__PURE__ */ t(ht, {}),
545
+ /* @__PURE__ */ t(re, {}),
540
546
  /* @__PURE__ */ t(
541
547
  Et,
542
548
  {
543
549
  open: C,
544
- onOpenChange: (l) => {
545
- y || E(l);
550
+ onOpenChange: (D) => {
551
+ U || o(D);
546
552
  },
547
- isLibraryVisual: n,
548
- currentVisualName: w,
549
- isSaving: y,
550
- destinationMode: v,
551
- onConfirm: N
553
+ isLibraryVisual: N,
554
+ currentVisualName: F,
555
+ isSaving: U,
556
+ destinationMode: b,
557
+ onConfirm: x
552
558
  }
553
559
  )
554
560
  ] });
555
561
  }
556
562
  function zt({ className: e }) {
557
- const a = j((o) => o.isDevMode), f = P((o) => o.isVisualEditing), { setIsDevMode: d } = Be(), { config: i } = Ee(Oe).tokenProps, m = (i == null ? void 0 : i.showAdvancedMode) !== !1;
558
- if (!f || !m)
563
+ const a = j((r) => r.isDevMode), v = O((r) => r.isVisualEditing), { setIsDevMode: l } = ze(), { config: n } = Ae(Re).tokenProps, d = (n == null ? void 0 : n.showAdvancedMode) !== !1;
564
+ if (!v || !d)
559
565
  return null;
560
- const c = "h-full rounded-none border-0 bg-transparent px-2.5 shadow-none text-muted-foreground hover:bg-accent/50 hover:text-foreground", h = "bg-muted text-foreground hover:bg-muted";
566
+ const c = a ? Y : $e, m = a ? "Drag & drop" : "SQL", i = a ? "Switch to drag-and-drop mode" : "Switch to SQL mode";
561
567
  return /* @__PURE__ */ s(
562
- "div",
568
+ "button",
563
569
  {
564
- role: "radiogroup",
565
- "aria-label": "Editor mode",
566
- className: O(
567
- "inline-flex h-7 items-stretch overflow-hidden rounded-[5px] border border-input bg-background",
570
+ type: "button",
571
+ "aria-label": i,
572
+ title: i,
573
+ onClick: () => l(!a),
574
+ className: H(
575
+ "inline-flex h-7 items-center gap-1.5 rounded-[5px] border border-border bg-background px-2 text-[12px] font-medium text-foreground transition-colors hover:bg-muted/40",
568
576
  e
569
577
  ),
570
578
  children: [
571
- /* @__PURE__ */ s(
572
- A,
573
- {
574
- type: "button",
575
- variant: "ghost",
576
- size: "xs",
577
- role: "radio",
578
- "aria-checked": !a,
579
- className: O(c, !a && h),
580
- onClick: () => d(!1),
581
- children: [
582
- /* @__PURE__ */ t(Y, { className: "h-3.5 w-3.5" }),
583
- "Drag & drop"
584
- ]
585
- }
586
- ),
587
- /* @__PURE__ */ s(
588
- A,
589
- {
590
- type: "button",
591
- variant: "ghost",
592
- size: "xs",
593
- role: "radio",
594
- "aria-checked": a,
595
- className: O(
596
- c,
597
- "border-l border-border/60",
598
- a && h
599
- ),
600
- onClick: () => d(!0),
601
- children: [
602
- /* @__PURE__ */ t(ze, { className: "h-3.5 w-3.5" }),
603
- "SQL"
604
- ]
605
- }
606
- )
579
+ /* @__PURE__ */ t(c, { className: "h-3 w-3 text-muted-foreground" }),
580
+ m
607
581
  ]
608
582
  }
609
583
  );
@@ -611,61 +585,61 @@ function zt({ className: e }) {
611
585
  function Rt({
612
586
  open: e,
613
587
  onOpenChange: a,
614
- onSave: f,
615
- onDiscard: d,
616
- isSaving: i,
617
- title: m = "Unsaved changes",
588
+ onSave: v,
589
+ onDiscard: l,
590
+ isSaving: n,
591
+ title: d = "Unsaved changes",
618
592
  description: c = "You have unsaved changes to this dashboard. What would you like to do?",
619
- cancelLabel: h = "Cancel",
620
- discardLabel: o = "Discard",
593
+ cancelLabel: m = "Cancel",
594
+ discardLabel: i = "Discard",
621
595
  saveLabel: r = "Save"
622
596
  }) {
623
- return /* @__PURE__ */ t(Re, { open: e, onOpenChange: (x) => {
624
- !x && i || a(x);
625
- }, children: /* @__PURE__ */ s(_e, { children: [
626
- /* @__PURE__ */ s($e, { children: [
627
- /* @__PURE__ */ t(He, { children: m }),
628
- /* @__PURE__ */ t(je, { children: c })
597
+ return /* @__PURE__ */ t(_e, { open: e, onOpenChange: (b) => {
598
+ !b && n || a(b);
599
+ }, children: /* @__PURE__ */ s(He, { children: [
600
+ /* @__PURE__ */ s(je, { children: [
601
+ /* @__PURE__ */ t(Xe, { children: d }),
602
+ /* @__PURE__ */ t(Ge, { children: c })
629
603
  ] }),
630
- /* @__PURE__ */ s(Xe, { children: [
604
+ /* @__PURE__ */ s(Ke, { children: [
631
605
  /* @__PURE__ */ t(
632
- A,
606
+ I,
633
607
  {
634
608
  type: "button",
635
609
  size: "xs",
636
- onClick: d,
637
- disabled: i,
610
+ onClick: l,
611
+ disabled: n,
638
612
  variant: "ghost",
639
613
  className: "mr-auto text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",
640
- children: o
614
+ children: i
641
615
  }
642
616
  ),
643
- /* @__PURE__ */ t(Ge, { disabled: i, children: h }),
644
- /* @__PURE__ */ t(A, { type: "button", size: "xs", onClick: f, disabled: i, children: i ? /* @__PURE__ */ s(R, { children: [
645
- /* @__PURE__ */ t(J, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
617
+ /* @__PURE__ */ t(Qe, { disabled: n, children: m }),
618
+ /* @__PURE__ */ t(I, { type: "button", size: "xs", onClick: v, disabled: n, children: n ? /* @__PURE__ */ s(_, { children: [
619
+ /* @__PURE__ */ t(q, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
646
620
  "Saving..."
647
621
  ] }) : r })
648
622
  ] })
649
623
  ] }) });
650
624
  }
651
- function St({
625
+ function At({
652
626
  export: e,
653
627
  onRemove: a
654
628
  }) {
655
- const f = () => {
629
+ const v = () => {
656
630
  e.downloadUrl && window.open(e.downloadUrl, "_blank");
657
- }, d = (h) => {
658
- h.stopPropagation(), a == null || a(e.id);
659
- }, i = () => {
631
+ }, l = (m) => {
632
+ m.stopPropagation(), a == null || a(e.id);
633
+ }, n = () => {
660
634
  switch (e.status) {
661
635
  case "completed":
662
- return /* @__PURE__ */ t(Ke, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
636
+ return /* @__PURE__ */ t(Ze, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
663
637
  case "failed":
664
638
  return /* @__PURE__ */ t(pt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
665
639
  default:
666
- return /* @__PURE__ */ t(J, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
640
+ return /* @__PURE__ */ t(q, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
667
641
  }
668
- }, m = q(e.status), c = (() => {
642
+ }, d = Q(e.status), c = (() => {
669
643
  switch (e.status) {
670
644
  case "pending":
671
645
  return "Queued...";
@@ -682,7 +656,7 @@ function St({
682
656
  return /* @__PURE__ */ s("div", { className: "group p-4 transition-colors hover:bg-muted/50", children: [
683
657
  /* @__PURE__ */ s("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
684
658
  /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
685
- i(),
659
+ n(),
686
660
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
687
661
  /* @__PURE__ */ t("h4", { className: "mb-1 truncate text-sm font-medium", children: e.title }),
688
662
  e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
@@ -690,22 +664,22 @@ function St({
690
664
  e.totalRows.toLocaleString(),
691
665
  " rows"
692
666
  ] }),
693
- e.fileSize && /* @__PURE__ */ s(R, { children: [
667
+ e.fileSize && /* @__PURE__ */ s(_, { children: [
694
668
  /* @__PURE__ */ t("span", { children: "•" }),
695
669
  /* @__PURE__ */ t("span", { children: We(e.fileSize) })
696
670
  ] })
697
671
  ] }),
698
- m && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: c }),
672
+ d && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: c }),
699
673
  e.status === "failed" && /* @__PURE__ */ t("div", { className: "line-clamp-2 text-xs text-destructive", children: e.error || "Export failed" })
700
674
  ] })
701
675
  ] }),
702
676
  /* @__PURE__ */ t(
703
- A,
677
+ I,
704
678
  {
705
679
  variant: "ghost",
706
680
  size: "icon",
707
681
  className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
708
- onClick: d,
682
+ onClick: l,
709
683
  "aria-label": "Remove notification",
710
684
  children: /* @__PURE__ */ t(qe, { className: "h-4 w-4" })
711
685
  }
@@ -713,188 +687,188 @@ function St({
713
687
  ] }),
714
688
  /* @__PURE__ */ s("div", { className: "ml-8", children: [
715
689
  e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
716
- /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: se(e.startedAt, { addSuffix: !0 }) }),
690
+ /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: oe(e.startedAt, { addSuffix: !0 }) }),
717
691
  e.downloadUrl && /* @__PURE__ */ s(
718
- A,
692
+ I,
719
693
  {
720
694
  size: "sm",
721
695
  variant: "outline",
722
696
  className: "h-8 bg-transparent",
723
- onClick: f,
697
+ onClick: v,
724
698
  children: [
725
- /* @__PURE__ */ t(Qe, { className: "mr-1.5 h-3.5 w-3.5" }),
699
+ /* @__PURE__ */ t(Je, { className: "mr-1.5 h-3.5 w-3.5" }),
726
700
  "Download"
727
701
  ]
728
702
  }
729
703
  )
730
704
  ] }),
731
- m && /* @__PURE__ */ s("div", { children: [
732
- /* @__PURE__ */ t(Je, { value: e.progress, className: "h-1.5" }),
705
+ d && /* @__PURE__ */ s("div", { children: [
706
+ /* @__PURE__ */ t(Ye, { value: e.progress, className: "h-1.5" }),
733
707
  /* @__PURE__ */ s("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
734
708
  e.progress,
735
709
  "% complete"
736
710
  ] })
737
711
  ] }),
738
- e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: se(e.startedAt, { addSuffix: !0 }) })
712
+ e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: oe(e.startedAt, { addSuffix: !0 }) })
739
713
  ] })
740
714
  ] });
741
715
  }
742
716
  function It() {
743
- const { authToken: e, tokenProps: a } = W(), f = M((g) => g.activeExports), { clearCompleted: d, removeExport: i, updateExport: m } = le(), [c, h] = L(!1), [o, r] = L(!1), v = Array.from(f.values()).sort(
744
- (g, C) => C.startedAt.getTime() - g.startedAt.getTime()
745
- ), x = v.some(
746
- (g) => g.status === "completed" || g.status === "failed"
747
- ), p = z(async () => {
748
- const g = a == null ? void 0 : a.apiServiceUrl, C = e == null ? void 0 : e.accessToken;
749
- if (!(!g || !C)) {
750
- h(!0);
717
+ const { authToken: e, tokenProps: a } = K(), v = z((f) => f.activeExports), { clearCompleted: l, removeExport: n, updateExport: d } = ce(), [c, m] = T(!1), [i, r] = T(!1), p = Array.from(v.values()).sort(
718
+ (f, w) => w.startedAt.getTime() - f.startedAt.getTime()
719
+ ), b = p.some(
720
+ (f) => f.status === "completed" || f.status === "failed"
721
+ ), h = $(async () => {
722
+ const f = a == null ? void 0 : a.apiServiceUrl, w = e == null ? void 0 : e.accessToken;
723
+ if (!(!f || !w)) {
724
+ m(!0);
751
725
  try {
752
- const E = Array.from(f.values());
726
+ const S = Array.from(v.values());
753
727
  await Promise.all(
754
- E.map(async (N) => {
728
+ S.map(async (C) => {
755
729
  try {
756
- const n = await ie(g, C, N.id);
757
- let w;
758
- if (n.status === "completed")
730
+ const o = await de(f, w, C.id);
731
+ let x;
732
+ if (o.status === "completed")
759
733
  try {
760
- w = await Q(
761
- g,
762
- C,
763
- N.id
734
+ x = await W(
735
+ f,
736
+ w,
737
+ C.id
764
738
  );
765
- } catch (y) {
766
- console.error(`Failed to get download URL for ${N.id}:`, y);
739
+ } catch (N) {
740
+ console.error(`Failed to get download URL for ${C.id}:`, N);
767
741
  }
768
- m(N.id, {
769
- status: n.status,
770
- progress: n.progress,
771
- completedChunks: n.completedChunks,
772
- completedAt: n.completedAt ? new Date(n.completedAt) : void 0,
742
+ d(C.id, {
743
+ status: o.status,
744
+ progress: o.progress,
745
+ completedChunks: o.completedChunks,
746
+ completedAt: o.completedAt ? new Date(o.completedAt) : void 0,
773
747
  lastUpdatedAt: /* @__PURE__ */ new Date(),
774
- fileSize: n.fileSize,
775
- error: n.error,
776
- downloadUrl: w
748
+ fileSize: o.fileSize,
749
+ error: o.error,
750
+ downloadUrl: x
777
751
  });
778
- } catch (n) {
779
- console.error(`Failed to refresh export ${N.id}:`, n);
752
+ } catch (o) {
753
+ console.error(`Failed to refresh export ${C.id}:`, o);
780
754
  }
781
755
  })
782
756
  );
783
757
  } finally {
784
- h(!1);
758
+ m(!1);
785
759
  }
786
760
  }
787
761
  }, [
788
- f,
762
+ v,
789
763
  e == null ? void 0 : e.accessToken,
790
764
  a == null ? void 0 : a.apiServiceUrl,
791
- m
792
- ]), b = z(async () => {
793
- const g = a == null ? void 0 : a.apiServiceUrl, C = e == null ? void 0 : e.accessToken;
794
- if (!g || !C) {
795
- d();
765
+ d
766
+ ]), y = $(async () => {
767
+ const f = a == null ? void 0 : a.apiServiceUrl, w = e == null ? void 0 : e.accessToken;
768
+ if (!f || !w) {
769
+ l();
796
770
  return;
797
771
  }
798
772
  r(!0);
799
773
  try {
800
- const E = v.filter(
801
- (n) => n.status === "completed" || n.status === "failed"
802
- ), N = await Promise.allSettled(
803
- E.map(async (n) => (await te(g, C, n.id), n.id))
774
+ const S = p.filter(
775
+ (o) => o.status === "completed" || o.status === "failed"
776
+ ), C = await Promise.allSettled(
777
+ S.map(async (o) => (await te(f, w, o.id), o.id))
804
778
  );
805
- for (const n of N)
806
- n.status === "fulfilled" ? i(n.value) : console.error("Failed to delete export:", n.reason);
779
+ for (const o of C)
780
+ o.status === "fulfilled" ? n(o.value) : console.error("Failed to delete export:", o.reason);
807
781
  } finally {
808
782
  r(!1);
809
783
  }
810
784
  }, [
811
- v,
785
+ p,
812
786
  a == null ? void 0 : a.apiServiceUrl,
813
787
  e == null ? void 0 : e.accessToken,
814
- d,
815
- i
816
- ]), D = z(
817
- async (g) => {
818
- const C = a == null ? void 0 : a.apiServiceUrl, E = e == null ? void 0 : e.accessToken;
819
- if (C && E)
788
+ l,
789
+ n
790
+ ]), E = $(
791
+ async (f) => {
792
+ const w = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
793
+ if (w && S)
820
794
  try {
821
- await te(C, E, g), i(g);
795
+ await te(w, S, f), n(f);
822
796
  return;
823
- } catch (N) {
824
- console.error(`Failed to cancel export ${g}:`, N);
797
+ } catch (C) {
798
+ console.error(`Failed to cancel export ${f}:`, C);
825
799
  }
826
- i(g);
800
+ n(f);
827
801
  },
828
- [a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, i]
802
+ [a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, n]
829
803
  );
830
- return v.length === 0 ? /* @__PURE__ */ s("div", { className: "p-6 text-center", children: [
831
- /* @__PURE__ */ t(re, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
804
+ return p.length === 0 ? /* @__PURE__ */ s("div", { className: "p-6 text-center", children: [
805
+ /* @__PURE__ */ t(ne, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
832
806
  /* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: "No active exports" }),
833
807
  /* @__PURE__ */ t("p", { className: "mt-1 text-xs text-muted-foreground", children: "Large exports will appear here" })
834
808
  ] }) : /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
835
809
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between border-b px-4 py-3", children: [
836
810
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
837
- /* @__PURE__ */ t(re, { className: "h-5 w-5 text-muted-foreground" }),
811
+ /* @__PURE__ */ t(ne, { className: "h-5 w-5 text-muted-foreground" }),
838
812
  /* @__PURE__ */ t("h4", { className: "font-semibold", children: "Exports" })
839
813
  ] }),
840
814
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
841
815
  /* @__PURE__ */ t(
842
- A,
816
+ I,
843
817
  {
844
818
  variant: "ghost",
845
819
  size: "sm",
846
820
  className: "h-7 w-7 p-0",
847
- onClick: p,
821
+ onClick: h,
848
822
  disabled: c,
849
823
  title: "Refresh status",
850
824
  children: /* @__PURE__ */ t(
851
- Ye,
825
+ et,
852
826
  {
853
827
  className: `h-4 w-4 ${c ? "animate-spin" : ""}`
854
828
  }
855
829
  )
856
830
  }
857
831
  ),
858
- x && /* @__PURE__ */ t(
859
- A,
832
+ b && /* @__PURE__ */ t(
833
+ I,
860
834
  {
861
835
  variant: "ghost",
862
836
  size: "sm",
863
837
  className: "h-7 px-2 text-sm",
864
- onClick: b,
865
- disabled: o,
866
- children: o ? "Clearing..." : "Clear all"
838
+ onClick: y,
839
+ disabled: i,
840
+ children: i ? "Clearing..." : "Clear all"
867
841
  }
868
842
  )
869
843
  ] })
870
844
  ] }),
871
- /* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: v.map((g) => /* @__PURE__ */ t(
872
- St,
845
+ /* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: p.map((f) => /* @__PURE__ */ t(
846
+ At,
873
847
  {
874
- export: g,
875
- onRemove: D
848
+ export: f,
849
+ onRemove: E
876
850
  },
877
- g.id
851
+ f.id
878
852
  )) }) })
879
853
  ] });
880
854
  }
881
- function _t({
855
+ function $t({
882
856
  variant: e
883
857
  }) {
884
- const a = M((o) => o.activeExports), f = Ze(), d = a.size > 0, i = Array.from(a.values()).some(
885
- (o) => o.status === "completed" || o.status === "failed"
886
- ), c = f > 0 ? f > 9 ? "9+" : String(f) : null;
887
- return /* @__PURE__ */ s(we, { children: [
888
- /* @__PURE__ */ t(ye, { asChild: !0, children: /* @__PURE__ */ s(
889
- A,
858
+ const a = z((i) => i.activeExports), v = tt(), l = a.size > 0, n = Array.from(a.values()).some(
859
+ (i) => i.status === "completed" || i.status === "failed"
860
+ ), c = v > 0 ? v > 9 ? "9+" : String(v) : null;
861
+ return /* @__PURE__ */ s(Ce, { children: [
862
+ /* @__PURE__ */ t(De, { asChild: !0, children: /* @__PURE__ */ s(
863
+ I,
890
864
  {
891
865
  variant: e ?? "ghost",
892
866
  size: "xs",
893
867
  className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
894
868
  "aria-label": "Export notifications",
895
869
  children: [
896
- /* @__PURE__ */ t(et, { className: "h-3.5 w-3.5" }),
897
- d && /* @__PURE__ */ t(
870
+ /* @__PURE__ */ t(at, { className: "h-3.5 w-3.5" }),
871
+ l && /* @__PURE__ */ t(
898
872
  "span",
899
873
  {
900
874
  className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${c ? "-right-0.5 -top-0.5 h-3.5 min-w-3.5 px-0.5 text-[9px] font-semibold" : "right-1 top-1 h-1.5 w-1.5"}`,
@@ -904,7 +878,7 @@ function _t({
904
878
  ]
905
879
  }
906
880
  ) }),
907
- /* @__PURE__ */ t(Ce, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(It, {}) })
881
+ /* @__PURE__ */ t(Ne, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(It, {}) })
908
882
  ] });
909
883
  }
910
884
  function Ft(e) {
@@ -916,140 +890,140 @@ function Ft(e) {
916
890
  affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
917
891
  };
918
892
  }
919
- function $t({
893
+ function _t({
920
894
  open: e,
921
895
  onOpenChange: a,
922
- trigger: f,
923
- showTrigger: d = !0,
924
- initialMode: i = "manage"
896
+ trigger: v,
897
+ showTrigger: l = !0,
898
+ initialMode: n = "manage"
925
899
  }) {
926
- const m = i === "create", {
900
+ const d = n === "create", {
927
901
  forceClose: c,
928
- handleOpenChange: h,
929
- isCreateFlowActive: o,
902
+ handleOpenChange: m,
903
+ isCreateFlowActive: i,
930
904
  preventPassiveDismissDuringCreate: r,
931
- resolvedOpen: v,
932
- setIsCreateFlowActive: x
905
+ resolvedOpen: p,
906
+ setIsCreateFlowActive: b
933
907
  } = ft({
934
908
  open: e,
935
909
  onOpenChange: a,
936
- initialCreateFlowActive: i === "create",
910
+ initialCreateFlowActive: n === "create",
937
911
  // Dialog mode renders a built-in X close button — allow explicit
938
912
  // closes through `handleOpenChange`. Popover mode has no X; its
939
913
  // only close-via-trigger path is a re-click that would silently
940
914
  // wipe the in-progress create flow, so block everything during
941
915
  // create and make consumers use `forceClose()` from a dedicated
942
916
  // button.
943
- dismissMode: d ? "passive" : "explicit-only"
944
- }), p = P((u) => u.dashboard), { setDashboardControlsModel: b } = K(), { participants: D } = tt(at(p)), g = Array.from(
917
+ dismissMode: l ? "passive" : "explicit-only"
918
+ }), h = O((u) => u.dashboard), { setDashboardControlsModel: y } = J(), { participants: E } = st(rt(h)), f = Array.from(
945
919
  new Map(
946
- D.flatMap(
947
- (u) => u.fieldChoices.map((l) => {
948
- var S;
920
+ E.flatMap(
921
+ (u) => u.fieldChoices.map((g) => {
922
+ var A;
949
923
  return [
950
- l.value,
924
+ g.value,
951
925
  {
952
- option: l,
953
- target: (S = u.fieldTargetMap) == null ? void 0 : S[l.value]
926
+ option: g,
927
+ target: (A = u.fieldTargetMap) == null ? void 0 : A[g.value]
954
928
  }
955
929
  ];
956
930
  })
957
931
  )
958
932
  ).values()
959
- ), C = Array.from(
933
+ ), w = Array.from(
960
934
  new Map(
961
- D.flatMap(
962
- (u) => u.metricChoices.map((l) => {
963
- var S;
935
+ E.flatMap(
936
+ (u) => u.metricChoices.map((g) => {
937
+ var A;
964
938
  return [
965
- l.value,
939
+ g.value,
966
940
  {
967
- option: l,
968
- target: (S = u.metricTargetMap) == null ? void 0 : S[l.value]
941
+ option: g,
942
+ target: (A = u.metricTargetMap) == null ? void 0 : A[g.value]
969
943
  }
970
944
  ];
971
945
  })
972
946
  )
973
947
  ).values()
974
- ), E = st({
975
- ...p || {},
948
+ ), S = ot({
949
+ ...h || {},
976
950
  controls: []
977
- }), N = rt(p), n = (u, l, S) => {
978
- b(
951
+ }), C = nt(h), o = (u, g, A) => {
952
+ y(
979
953
  u,
980
- l,
981
- Ft(S)
954
+ g,
955
+ Ft(A)
982
956
  );
983
- }, w = z(() => {
984
- if (m) {
957
+ }, x = $(() => {
958
+ if (d) {
985
959
  c();
986
960
  return;
987
961
  }
988
- x(!1);
989
- }, [m, c, x]), y = /* @__PURE__ */ t(
962
+ b(!1);
963
+ }, [d, c, b]), N = /* @__PURE__ */ t(
990
964
  vt,
991
965
  {
992
966
  scope: "dashboard",
993
- controls: p.controls || [],
994
- reservedControlIds: E,
995
- defaultValues: p.defaultControlValues || {},
996
- usageByControlId: ot(p),
997
- availableFieldChoices: g,
998
- availableMetricChoices: C,
999
- structuralParticipants: D,
1000
- structuralParticipantIdsByControlId: N,
1001
- initialCreateFlow: i === "create",
1002
- onCreateFlowActiveChange: x,
1003
- onCreateFlowComplete: w,
1004
- onChange: n,
967
+ controls: h.controls || [],
968
+ reservedControlIds: S,
969
+ defaultValues: h.defaultControlValues || {},
970
+ usageByControlId: it(h),
971
+ availableFieldChoices: f,
972
+ availableMetricChoices: w,
973
+ structuralParticipants: E,
974
+ structuralParticipantIdsByControlId: C,
975
+ initialCreateFlow: n === "create",
976
+ onCreateFlowActiveChange: b,
977
+ onCreateFlowComplete: x,
978
+ onChange: o,
1005
979
  emptyMessage: "No dashboard controls yet."
1006
980
  }
1007
- ), F = o ? "Add dashboard control" : "Dashboard Controls", _ = /* @__PURE__ */ s(R, { children: [
981
+ ), F = i ? "Add dashboard control" : "Dashboard Controls", U = /* @__PURE__ */ s(_, { children: [
1008
982
  /* @__PURE__ */ s("div", { className: "space-y-1", children: [
1009
983
  /* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
1010
984
  /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
1011
985
  ] }),
1012
- y
986
+ N
1013
987
  ] });
1014
- return d ? /* @__PURE__ */ s(we, { open: v, onOpenChange: h, children: [
1015
- /* @__PURE__ */ t(ye, { asChild: !0, children: f || /* @__PURE__ */ s(A, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
988
+ return l ? /* @__PURE__ */ s(Ce, { open: p, onOpenChange: m, children: [
989
+ /* @__PURE__ */ t(De, { asChild: !0, children: v || /* @__PURE__ */ s(I, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
1016
990
  /* @__PURE__ */ t(Y, { className: "mr-2 h-4 w-4" }),
1017
991
  "Controls"
1018
992
  ] }) }),
1019
993
  /* @__PURE__ */ t(
1020
- Ce,
994
+ Ne,
1021
995
  {
1022
996
  className: "w-[620px] max-w-[95vw] space-y-4",
1023
997
  align: "end",
1024
998
  onEscapeKeyDown: r,
1025
999
  onPointerDownOutside: r,
1026
- children: _
1000
+ children: U
1027
1001
  }
1028
1002
  )
1029
- ] }) : /* @__PURE__ */ t(de, { open: v, onOpenChange: h, children: /* @__PURE__ */ s(
1030
- ce,
1003
+ ] }) : /* @__PURE__ */ t(ue, { open: p, onOpenChange: m, children: /* @__PURE__ */ s(
1004
+ me,
1031
1005
  {
1032
1006
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
1033
1007
  onEscapeKeyDown: r,
1034
1008
  onPointerDownOutside: r,
1035
1009
  children: [
1036
1010
  /* @__PURE__ */ s(
1037
- ue,
1011
+ he,
1038
1012
  {
1039
- className: o ? "space-y-0" : void 0,
1013
+ className: i ? "space-y-0" : void 0,
1040
1014
  children: [
1041
- /* @__PURE__ */ t(me, { className: "text-[15px]", children: F }),
1015
+ /* @__PURE__ */ t(pe, { className: "text-[15px]", children: F }),
1042
1016
  /* @__PURE__ */ t(
1043
- he,
1017
+ fe,
1044
1018
  {
1045
- className: o ? "sr-only" : "text-[13px]",
1046
- children: o ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
1019
+ className: i ? "sr-only" : "text-[13px]",
1020
+ children: i ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
1047
1021
  }
1048
1022
  )
1049
1023
  ]
1050
1024
  }
1051
1025
  ),
1052
- /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: y })
1026
+ /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: N })
1053
1027
  ]
1054
1028
  }
1055
1029
  ) });
@@ -1057,36 +1031,36 @@ function $t({
1057
1031
  function Ht({
1058
1032
  showFilters: e,
1059
1033
  onToggleFilters: a,
1060
- onAddFilter: f,
1061
- onAddControl: d,
1062
- onManageControls: i,
1063
- size: m = "default",
1034
+ onAddFilter: v,
1035
+ onAddControl: l,
1036
+ onManageControls: n,
1037
+ size: d = "default",
1064
1038
  className: c,
1065
- primaryButtonClassName: h,
1066
- secondaryButtonClassName: o,
1039
+ primaryButtonClassName: m,
1040
+ secondaryButtonClassName: i,
1067
1041
  dropdownContentClassName: r
1068
1042
  }) {
1069
1043
  return /* @__PURE__ */ s(
1070
1044
  "div",
1071
1045
  {
1072
- className: O(
1046
+ className: H(
1073
1047
  // Height lives on the shell so the outer border is part of the
1074
1048
  // h-7 box (matches regular `size="xs"` buttons). Inner buttons
1075
1049
  // stretch to fill via `h-full`, avoiding the 2px stack-up that
1076
1050
  // makes the combo taller than a sibling `<Button size="xs">`.
1077
1051
  "relative inline-flex items-stretch overflow-hidden rounded-[5px] border border-input bg-background",
1078
- m === "toolbar" ? "h-8" : "h-7",
1052
+ d === "toolbar" ? "h-8" : "h-7",
1079
1053
  c
1080
1054
  ),
1081
1055
  children: [
1082
1056
  /* @__PURE__ */ s(
1083
- A,
1057
+ I,
1084
1058
  {
1085
1059
  variant: "ghost",
1086
1060
  size: "xs",
1087
- className: O(
1061
+ className: H(
1088
1062
  "h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50",
1089
- h
1063
+ m
1090
1064
  ),
1091
1065
  onClick: a,
1092
1066
  children: [
@@ -1095,39 +1069,39 @@ function Ht({
1095
1069
  ]
1096
1070
  }
1097
1071
  ),
1098
- /* @__PURE__ */ s(ve, { children: [
1099
- /* @__PURE__ */ t(ge, { asChild: !0, children: /* @__PURE__ */ t(
1100
- A,
1072
+ /* @__PURE__ */ s(be, { children: [
1073
+ /* @__PURE__ */ t(xe, { asChild: !0, children: /* @__PURE__ */ t(
1074
+ I,
1101
1075
  {
1102
1076
  variant: "ghost",
1103
1077
  size: "xs",
1104
- className: O(
1078
+ className: H(
1105
1079
  "h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50",
1106
- o
1080
+ i
1107
1081
  ),
1108
1082
  "aria-label": "Filter and control actions",
1109
- children: /* @__PURE__ */ t(be, { className: "h-3.5 w-3.5" })
1083
+ children: /* @__PURE__ */ t(ye, { className: "h-3.5 w-3.5" })
1110
1084
  }
1111
1085
  ) }),
1112
1086
  /* @__PURE__ */ s(
1113
- xe,
1087
+ we,
1114
1088
  {
1115
1089
  align: "start",
1116
- className: O(
1090
+ className: H(
1117
1091
  "min-w-[180px] rounded-[6px] border border-border/60 p-1 shadow-sm",
1118
1092
  r
1119
1093
  ),
1120
1094
  children: [
1121
- /* @__PURE__ */ s(B, { onSelect: f, children: [
1095
+ /* @__PURE__ */ s(R, { onSelect: v, children: [
1122
1096
  /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5" }),
1123
1097
  "Add filter"
1124
1098
  ] }),
1125
- /* @__PURE__ */ s(B, { onSelect: d, children: [
1099
+ /* @__PURE__ */ s(R, { onSelect: l, children: [
1126
1100
  /* @__PURE__ */ t(Y, { className: "h-3.5 w-3.5" }),
1127
1101
  "Add control"
1128
1102
  ] }),
1129
- /* @__PURE__ */ s(B, { onSelect: i, children: [
1130
- /* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
1103
+ /* @__PURE__ */ s(R, { onSelect: n, children: [
1104
+ /* @__PURE__ */ t(lt, { className: "h-3.5 w-3.5" }),
1131
1105
  "Manage controls"
1132
1106
  ] })
1133
1107
  ]
@@ -1140,13 +1114,13 @@ function Ht({
1140
1114
  }
1141
1115
  export {
1142
1116
  zt as A,
1143
- $t as D,
1117
+ _t as D,
1144
1118
  It as E,
1145
- _t as N,
1119
+ $t as N,
1146
1120
  Rt as U,
1147
- Ot as V,
1148
- St as a,
1149
- Bt as b,
1121
+ Bt as V,
1122
+ At as a,
1123
+ Ot as b,
1150
1124
  Ht as c,
1151
- Mt as u
1125
+ Vt as u
1152
1126
  };