react-semaphor 0.1.303 → 0.1.305

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 (49) hide show
  1. package/dist/brand-studio/index.cjs +1 -1
  2. package/dist/brand-studio/index.js +4 -4
  3. package/dist/chunks/common-types-C6cAQgyh.js +9 -0
  4. package/dist/chunks/common-types-nBuCd3u2.js +1 -0
  5. package/dist/chunks/dashboard-controls-BcwXajYv.js +47 -0
  6. package/dist/chunks/{dashboard-controls-BCJZOzrL.js → dashboard-controls-DjOO0fkG.js} +799 -774
  7. package/dist/chunks/{dashboard-filter-controls-button-C-e7230k.js → dashboard-filter-controls-button-CR0_duPw.js} +3 -3
  8. package/dist/chunks/{dashboard-filter-controls-button-Cfbac4Jw.js → dashboard-filter-controls-button-YvRfoUuN.js} +142 -142
  9. package/dist/chunks/{dashboard-json-BzvLPhGM.js → dashboard-json-BYLaWi0-.js} +2 -2
  10. package/dist/chunks/{dashboard-json-BM5ywMgp.js → dashboard-json-tOsNVccY.js} +1 -1
  11. package/dist/chunks/{dashboard-summary-settings-dialog-ChK3344r.js → dashboard-summary-settings-dialog-CMxi2arh.js} +2 -2
  12. package/dist/chunks/{dashboard-summary-settings-dialog-BdxKl1UF.js → dashboard-summary-settings-dialog-DioOegLQ.js} +1 -1
  13. package/dist/chunks/{edit-dashboard-visual-nNaZ2IK1.js → edit-dashboard-visual-331vOmKT.js} +2 -2
  14. package/dist/chunks/{edit-dashboard-visual-D725CWD5.js → edit-dashboard-visual-ClLcFLD_.js} +164 -164
  15. package/dist/chunks/index-BOGpMmRo.js +1360 -0
  16. package/dist/chunks/{index-CYWgnME0.js → index-DJFckbGE.js} +42308 -40062
  17. package/dist/chunks/{palette-B9DJXMGo.js → palette-BqJlrRto.js} +1 -1
  18. package/dist/chunks/{palette-DGOzbtsn.js → palette-DD-i7bNS.js} +1 -1
  19. package/dist/chunks/{resource-management-panel-CE0-NcLL.js → resource-management-panel-BS9nfJbb.js} +65 -65
  20. package/dist/chunks/{resource-management-panel-mJmc5dMT.js → resource-management-panel-CoHy6cOi.js} +1 -1
  21. package/dist/chunks/{rotate-ccw-Bs7YJn10.js → rotate-ccw-CdGW8Rxm.js} +1 -1
  22. package/dist/chunks/{rotate-ccw-YsjQwpKm.js → rotate-ccw-X8MbX_hF.js} +1 -1
  23. package/dist/chunks/{save-Bj1y1rug.js → save-CFBIhbHD.js} +1 -1
  24. package/dist/chunks/{save-CUrexoNl.js → save-j-clxFtx.js} +1 -1
  25. package/dist/chunks/{switch-oojO-gal.js → switch-BFhVVwh9.js} +4248 -3243
  26. package/dist/chunks/switch-BH17qlxH.js +163 -0
  27. package/dist/chunks/use-create-flow-overlay-state-BSUi4chy.js +16 -0
  28. package/dist/chunks/{use-create-flow-overlay-state-BHDKxe7I.js → use-create-flow-overlay-state-Lmk-mIkA.js} +318 -316
  29. package/dist/chunks/{use-visual-utils-DYDXMl5v.js → use-visual-utils-CR9nLyEz.js} +1 -1
  30. package/dist/chunks/{use-visual-utils-CjFzlR0P.js → use-visual-utils-CikIkKb2.js} +2 -2
  31. package/dist/dashboard/index.cjs +1 -1
  32. package/dist/dashboard/index.js +5 -5
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.js +60 -59
  35. package/dist/style.css +1 -1
  36. package/dist/surfboard/index.cjs +1 -1
  37. package/dist/surfboard/index.js +6 -6
  38. package/dist/types/dashboard.d.ts +168 -0
  39. package/dist/types/index.cjs +1 -1
  40. package/dist/types/index.js +8 -11
  41. package/dist/types/main.d.ts +194 -2
  42. package/dist/types/shared.d.ts +120 -0
  43. package/dist/types/surfboard.d.ts +168 -0
  44. package/dist/types/types.d.ts +168 -0
  45. package/package.json +1 -1
  46. package/dist/chunks/dashboard-controls-CVFoOPti.js +0 -47
  47. package/dist/chunks/index-BWjB_9uz.js +0 -1356
  48. package/dist/chunks/switch-CiEX68py.js +0 -163
  49. package/dist/chunks/use-create-flow-overlay-state-D2I2wNey.js +0 -16
@@ -1,9 +1,9 @@
1
1
  import Se, { useState as T, useRef as X, useCallback as $, useEffect as O, useContext as Ae } from "react";
2
- import { u as Q, ae as z, aZ as W, aV as le, aW as q, af as ce, aU as Ie, b as de, c as ue, d as me, e as he, f as pe, cg as Fe, o as Le, t as Te, v as ke, b8 as fe, ch as Pe, p as P, b9 as G, W as Ue, bN as ve, bO as ge, bQ as be, bR as R, bV as Ve, bE as Me, ci as Be, cj as Oe, c0 as ze, c1 as Re, c2 as $e, c3 as _e, c4 as je, c5 as He, c6 as Xe, a$ as Ge, ck as Qe, cl as We, bK as qe, aX as J, M as Ke, ah as Ze, cm as Ye, cn as Je, co as et, cp as tt, cq as at, cr as ee, cs as st } from "./index-CYWgnME0.js";
2
+ import { u as W, ae as z, aZ as q, aV as le, aW as K, af as de, aU as Ie, b as ce, c as ue, d as me, e as he, f as pe, bV as Fe, o as Le, t as Te, v as Pe, b8 as fe, bW as ke, p as k, b9 as G, W as Ue, bq as ve, br as ge, bt as be, bu as R, by as Ve, bl as Me, bX as Be, bY as Oe, bF as ze, bG as Re, bH as $e, bI as _e, bJ as He, bK as je, bL as Xe, a$ as Ge, bZ as We, b_ as qe, bn as Ke, aX as J, M as Qe, ah as Ze, b$ as Ye, c0 as Je, c1 as et, c2 as tt, c3 as ee, c4 as at } from "./index-DJFckbGE.js";
3
3
  import { jsx as t, jsxs as s, Fragment as _ } from "react/jsx-runtime";
4
- import { c as xe, L as te, I as rt, B as I, f as K, n as H, u as B, m as Z, ag as ae, ae as ye, G as we, e as ot, l as nt, a as j, p as Y, X as it, P as Ce, b as Ne, d as De, ah as lt } from "./switch-oojO-gal.js";
5
- import { V as ct, E as se, a as re, b as dt, c as ut, L as mt, d as ht, C as pt, u as ft, e as vt } from "./use-create-flow-overlay-state-BHDKxe7I.js";
6
- import { u as Ee } from "./use-visual-utils-CjFzlR0P.js";
4
+ import { c as xe, L as te, I as st, B as I, f as Q, n as j, u as B, m as Z, aE as ae, ae as ye, G as we, e as rt, l as ot, a as H, p as Y, X as nt, P as Ce, b as De, d as Ne, aF as it, aG as lt } from "./switch-BFhVVwh9.js";
5
+ 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-Lmk-mIkA.js";
6
+ import { u as Ee } from "./use-visual-utils-CikIkKb2.js";
7
7
  import { k as oe } from "./date-formatter-DyIOb6uC.js";
8
8
  /**
9
9
  * @license lucide-react v0.453.0 - ISC
@@ -28,17 +28,17 @@ const gt = xe("FilterX", [
28
28
  ["path", { d: "m22 3-5 5", key: "12jva0" }],
29
29
  ["path", { d: "m17 3 5 5", key: "k36vhe" }]
30
30
  ]), bt = 1e4, xt = 15e3, yt = 3e4, wt = 3e4, Ct = 12e4, ie = 2 * 60 * 60 * 1e3;
31
- function Nt(e) {
31
+ function Dt(e) {
32
32
  const a = Date.now() - e.getTime();
33
33
  return a < wt ? bt : a < Ct ? xt : yt;
34
34
  }
35
35
  function Bt() {
36
- const { authToken: e, tokenProps: a } = Q(), v = z((h) => h.activeExports), [l, n] = T(
36
+ const { authToken: e, tokenProps: a } = W(), v = z((h) => h.activeExports), [l, n] = T(
37
37
  typeof document < "u" ? !document.hidden : !0
38
- ), c = X(null), d = X(!1), m = X(void 0), i = a == null ? void 0 : a.apiServiceUrl, r = e == null ? void 0 : e.accessToken, p = $(() => {
38
+ ), 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 = $(() => {
39
39
  const h = z.getState().activeExports;
40
40
  return Array.from(h.values()).filter(
41
- (y) => W(y.status)
41
+ (y) => q(y.status)
42
42
  );
43
43
  }, []);
44
44
  O(() => {
@@ -52,12 +52,12 @@ function Bt() {
52
52
  }, []);
53
53
  const b = $(async () => {
54
54
  if (!i || !r) {
55
- d.current = !1;
55
+ c.current = !1;
56
56
  return;
57
57
  }
58
58
  const h = p();
59
59
  if (h.length === 0) {
60
- d.current = !1;
60
+ c.current = !1;
61
61
  return;
62
62
  }
63
63
  const y = Date.now(), E = h.filter(
@@ -76,17 +76,17 @@ function Bt() {
76
76
  (o) => y - o.startedAt.getTime() <= ie
77
77
  );
78
78
  if (f.length === 0) {
79
- d.current = !1;
79
+ c.current = !1;
80
80
  return;
81
81
  }
82
82
  const w = await Promise.allSettled(
83
83
  f.map(async (o) => {
84
84
  try {
85
85
  const x = await le(i, r, o.id);
86
- let D;
86
+ let N;
87
87
  if (x.status === "completed")
88
88
  try {
89
- D = await q(i, r, o.id);
89
+ N = await K(i, r, o.id);
90
90
  } catch (F) {
91
91
  console.error(
92
92
  `[useExportPolling] Failed to get download URL for ${o.id}:`,
@@ -102,7 +102,7 @@ function Bt() {
102
102
  lastUpdatedAt: /* @__PURE__ */ new Date(),
103
103
  fileSize: x.fileSize,
104
104
  error: x.error,
105
- downloadUrl: D
105
+ downloadUrl: N
106
106
  };
107
107
  } catch (x) {
108
108
  return console.error(
@@ -117,42 +117,42 @@ function Bt() {
117
117
  const C = p();
118
118
  if (C.length > 0 && !document.hidden) {
119
119
  const o = C.reduce(
120
- (D, F) => F.startedAt < D ? F.startedAt : D,
120
+ (N, F) => F.startedAt < N ? F.startedAt : N,
121
121
  C[0].startedAt
122
- ), x = Nt(o);
123
- c.current && clearTimeout(c.current), c.current = setTimeout(() => {
124
- var D;
125
- (D = m.current) == null || D.call(m);
122
+ ), x = Dt(o);
123
+ d.current && clearTimeout(d.current), d.current = setTimeout(() => {
124
+ var N;
125
+ (N = m.current) == null || N.call(m);
126
126
  }, x);
127
127
  } else
128
- d.current = !1;
128
+ c.current = !1;
129
129
  }, [i, r, p]);
130
130
  return O(() => {
131
131
  m.current = b;
132
132
  }, [b]), O(() => {
133
133
  var y;
134
- p().length > 0 && l && !d.current && (d.current = !0, (y = m.current) == null || y.call(m));
134
+ p().length > 0 && l && !c.current && (c.current = !0, (y = m.current) == null || y.call(m));
135
135
  }, [v, l, p]), O(() => {
136
136
  var y;
137
137
  const h = p();
138
- l && h.length > 0 && !d.current && (d.current = !0, (y = m.current) == null || y.call(m));
138
+ l && h.length > 0 && !c.current && (c.current = !0, (y = m.current) == null || y.call(m));
139
139
  }, [l, p]), O(() => {
140
- !l && c.current && (clearTimeout(c.current), c.current = null, d.current = !1);
140
+ !l && d.current && (clearTimeout(d.current), d.current = null, c.current = !1);
141
141
  }, [l]), O(() => () => {
142
- c.current && (clearTimeout(c.current), c.current = null);
142
+ d.current && (clearTimeout(d.current), d.current = null);
143
143
  }, []), {
144
- isPolling: d.current,
144
+ isPolling: c.current,
145
145
  isTabVisible: l,
146
146
  inProgressCount: p().length
147
147
  };
148
148
  }
149
149
  function Ot() {
150
- const { authToken: e, tokenProps: a } = Q(), v = z((m) => m.activeExports), { addExport: l } = ce(), n = X(!1), c = a == null ? void 0 : a.apiServiceUrl, d = e == null ? void 0 : e.accessToken;
150
+ const { authToken: e, tokenProps: a } = W(), v = z((m) => m.activeExports), { addExport: l } = de(), n = X(!1), d = a == null ? void 0 : a.apiServiceUrl, c = e == null ? void 0 : e.accessToken;
151
151
  O(() => {
152
- if (n.current || !c || !d) return;
152
+ if (n.current || !d || !c) return;
153
153
  (async () => {
154
154
  try {
155
- const { exports: i } = await Ie(c, d, {
155
+ const { exports: i } = await Ie(d, c, {
156
156
  status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
157
157
  limit: 20
158
158
  // Limit to recent exports
@@ -163,7 +163,7 @@ function Ot() {
163
163
  let b;
164
164
  if (r.status === "completed")
165
165
  try {
166
- b = await q(c, d, r.id);
166
+ b = await K(d, c, r.id);
167
167
  } catch (y) {
168
168
  console.error(
169
169
  `[useExportRecovery] Failed to get download URL for ${r.id}:`,
@@ -174,7 +174,7 @@ function Ot() {
174
174
  id: r.id,
175
175
  status: r.status,
176
176
  progress: p,
177
- title: Dt(r),
177
+ title: Nt(r),
178
178
  totalRows: r.totalRows,
179
179
  totalChunks: r.totalChunks,
180
180
  completedChunks: r.completedChunks,
@@ -193,10 +193,10 @@ function Ot() {
193
193
  console.error("[useExportRecovery] Failed to recover exports:", i), n.current = !0;
194
194
  }
195
195
  })();
196
- }, [c, d, l, v]);
196
+ }, [d, c, l, v]);
197
197
  }
198
- function Dt(e) {
199
- return e.title ? e.title : W(
198
+ function Nt(e) {
199
+ return e.title ? e.title : q(
200
200
  e.status
201
201
  ) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
202
202
  }
@@ -206,8 +206,8 @@ function Et({
206
206
  isLibraryVisual: v,
207
207
  currentVisualName: l,
208
208
  isSaving: n = !1,
209
- destinationMode: c = "both",
210
- onConfirm: d
209
+ destinationMode: d = "both",
210
+ onConfirm: c
211
211
  }) {
212
212
  const [m, i] = T(
213
213
  v && l ? `Copy of ${l}` : l || ""
@@ -217,13 +217,13 @@ function Et({
217
217
  v && l ? `Copy of ${l}` : l || ""
218
218
  ), p(""));
219
219
  }, [e, v, l]);
220
- const b = !!m.trim(), h = c === "local" ? {
220
+ const b = !!m.trim(), h = d === "local" ? {
221
221
  saveToLibrary: !1,
222
222
  saveToCurrentDashboard: !0,
223
223
  badgeType: "local",
224
224
  description: "Creates a local copy on the current dashboard.",
225
225
  actionLabel: "Add to Dashboard (Local)"
226
- } : c === "library" ? {
226
+ } : d === "library" ? {
227
227
  saveToLibrary: !0,
228
228
  saveToCurrentDashboard: !1,
229
229
  badgeType: "library",
@@ -236,19 +236,19 @@ function Et({
236
236
  description: "Creates a new library visual and adds a linked copy to this dashboard.",
237
237
  actionLabel: "Save Copy as Linked Visual"
238
238
  }, y = () => {
239
- !b || n || d({
239
+ !b || n || c({
240
240
  name: m.trim(),
241
241
  description: r.trim() || void 0,
242
242
  saveToLibrary: h.saveToLibrary,
243
243
  saveToCurrentDashboard: h.saveToCurrentDashboard
244
244
  });
245
245
  };
246
- return /* @__PURE__ */ t(de, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(ue, { className: "sm:max-w-[500px]", children: [
246
+ return /* @__PURE__ */ t(ce, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(ue, { className: "sm:max-w-[500px]", children: [
247
247
  /* @__PURE__ */ s(me, { children: [
248
248
  /* @__PURE__ */ s(he, { className: "flex items-center gap-2", children: [
249
249
  /* @__PURE__ */ t("span", { children: "Save Visual As" }),
250
250
  h.badgeType !== "local" && /* @__PURE__ */ t(
251
- ct,
251
+ dt,
252
252
  {
253
253
  type: h.badgeType,
254
254
  showLabel: !0,
@@ -262,7 +262,7 @@ function Et({
262
262
  /* @__PURE__ */ s("div", { className: "grid gap-2", children: [
263
263
  /* @__PURE__ */ t(te, { htmlFor: "name", children: "Name" }),
264
264
  /* @__PURE__ */ t(
265
- rt,
265
+ st,
266
266
  {
267
267
  id: "name",
268
268
  value: m,
@@ -298,20 +298,20 @@ function Et({
298
298
  }
299
299
  ),
300
300
  /* @__PURE__ */ s(I, { onClick: y, disabled: !b || n, children: [
301
- n && /* @__PURE__ */ t(K, { className: "mr-2 h-4 w-4 animate-spin" }),
301
+ n && /* @__PURE__ */ t(Q, { className: "mr-2 h-4 w-4 animate-spin" }),
302
302
  h.actionLabel
303
303
  ] })
304
304
  ] })
305
305
  ] }) });
306
306
  }
307
307
  function St() {
308
- const [e, a] = T(!1), [v, l] = T(!1), [n, c] = T(null), [d, m] = T(null), i = H((u) => u.frame), r = H((u) => u.card), p = Te(), b = B((u) => u.selectedSheetId), h = B((u) => u.dashboard), y = B(
308
+ 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 = Te(), b = B((u) => u.selectedSheetId), h = B((u) => u.dashboard), y = B(
309
309
  (u) => u.actions.setIsDashboardPanelOpen
310
- ), { getUpdatedFrame: E } = Ee(), { selectVisual: f } = ke(), { addFrame: w, setSelectedFrameId: S, setIsVisualEditing: C } = Z(), o = fe(), x = !!(i != null && i.visualId), D = (() => {
310
+ ), { getUpdatedFrame: E } = Ee(), { selectVisual: f } = Pe(), { addFrame: w, setSelectedFrameId: S, setIsVisualEditing: C } = Z(), o = fe(), x = !!(i != null && i.visualId), N = (() => {
311
311
  var u, g;
312
312
  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";
313
- })(), F = Pe((u) => {
314
- u != null && u.id && (f(u), v && n && d && b && (async () => {
313
+ })(), F = ke((u) => {
314
+ u != null && u.id && (f(u), v && n && c && b && (async () => {
315
315
  try {
316
316
  const g = {
317
317
  ...n,
@@ -321,13 +321,13 @@ function St() {
321
321
  };
322
322
  w(b, g, {
323
323
  position: "end",
324
- semanticExecutionPayload: d
325
- }), S(g.id), l(!1), c(null), m(null), C(!1);
324
+ semanticExecutionPayload: c
325
+ }), S(g.id), l(!1), d(null), m(null), C(!1);
326
326
  } catch (g) {
327
327
  console.error(
328
328
  "Failed to promote semantic metadata for saved visual:",
329
329
  g
330
- ), P.error(
330
+ ), k.error(
331
331
  g instanceof Error ? g.message : "Failed to prepare semantic metadata for the saved visual"
332
332
  );
333
333
  }
@@ -338,15 +338,15 @@ function St() {
338
338
  setSaveAsDialogOpen: a,
339
339
  handleSaveAs: async (u) => {
340
340
  if (!b) {
341
- P.error("No sheet selected");
341
+ k.error("No sheet selected");
342
342
  return;
343
343
  }
344
344
  const g = E(), A = ye(g);
345
345
  if (A) {
346
- P.error(A);
346
+ k.error(A);
347
347
  return;
348
348
  }
349
- const k = g.cards.length === 1 ? {
349
+ const P = g.cards.length === 1 ? {
350
350
  ...g,
351
351
  cards: g.cards.map((L) => ({
352
352
  ...L,
@@ -358,61 +358,61 @@ function St() {
358
358
  let L = null;
359
359
  if (u.saveToCurrentDashboard)
360
360
  try {
361
- L = await o(k, {
362
- previousFrame: G(h, k.id)
361
+ L = await o(P, {
362
+ previousFrame: G(h, P.id)
363
363
  });
364
364
  } catch (M) {
365
365
  console.error(
366
366
  "Failed to prepare semantic metadata before saving visual:",
367
367
  M
368
- ), P.error(
368
+ ), k.error(
369
369
  M instanceof Error ? M.message : "Failed to prepare semantic metadata for the saved visual"
370
370
  );
371
371
  return;
372
372
  }
373
- l(u.saveToCurrentDashboard), c(k), m(L);
373
+ l(u.saveToCurrentDashboard), d(P), m(L);
374
374
  const V = {
375
375
  title: u.name,
376
376
  description: u.description,
377
- frameObject: k,
377
+ frameObject: P,
378
378
  // Card title synced for single-card frames
379
379
  isPrivate: !1
380
380
  };
381
381
  F.mutate(V);
382
382
  } else if (u.saveToCurrentDashboard) {
383
383
  const L = {
384
- ...k,
384
+ ...P,
385
385
  // Card title already synced
386
386
  id: ae(),
387
387
  visualId: void 0
388
388
  // Explicitly no visualId for local visuals
389
389
  };
390
390
  try {
391
- const V = await o(k, {
392
- previousFrame: G(h, k.id)
391
+ const V = await o(P, {
392
+ previousFrame: G(h, P.id)
393
393
  });
394
394
  w(b, L, {
395
395
  position: "end",
396
396
  semanticExecutionPayload: V
397
- }), S(L.id), P.success("Visual saved to dashboard"), a(!1), C(!1);
397
+ }), S(L.id), k.success("Visual saved to dashboard"), a(!1), C(!1);
398
398
  } catch (V) {
399
- console.error("Failed to save visual to dashboard:", V), P.error(
399
+ console.error("Failed to save visual to dashboard:", V), k.error(
400
400
  V instanceof Error ? V.message : "Failed to prepare semantic metadata for the visual"
401
401
  );
402
402
  }
403
403
  }
404
404
  },
405
405
  isLibraryVisual: x,
406
- currentVisualName: D,
406
+ currentVisualName: N,
407
407
  isSaving: F.isPending
408
408
  };
409
409
  }
410
410
  function zt(e = {}) {
411
- const a = H((N) => N.frame), v = H((N) => N.editorContext), l = Ue((N) => N.selectedVisual), n = B((N) => N.selectedFrameId), c = B((N) => N.selectedSheetId), d = B((N) => N.dashboard), { setIsVisualEditing: m, updateFrame: i } = Z(), [r, p] = T(!1), [b, h] = T("both"), y = fe(), 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
+ const a = j((D) => D.frame), v = j((D) => D.editorContext), l = Ue((D) => D.selectedVisual), n = B((D) => D.selectedFrameId), d = B((D) => D.selectedSheetId), c = B((D) => D.dashboard), { setIsVisualEditing: m, updateFrame: i } = Z(), [r, p] = T(!1), [b, h] = T("both"), y = fe(), 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, {
412
412
  saveAsDialogOpen: C,
413
413
  setSaveAsDialogOpen: o,
414
414
  handleSaveAs: x,
415
- isLibraryVisual: D,
415
+ isLibraryVisual: N,
416
416
  currentVisualName: F,
417
417
  isSaving: U
418
418
  } = St(), { getUpdatedFrame: u } = Ee();
@@ -422,44 +422,44 @@ function zt(e = {}) {
422
422
  /* @__PURE__ */ t(re, {})
423
423
  ] });
424
424
  const g = async () => {
425
- if (!c) {
426
- P.error("No sheet selected");
425
+ if (!d) {
426
+ k.error("No sheet selected");
427
427
  return;
428
428
  }
429
429
  if (r) return;
430
430
  p(!0);
431
- const N = u(), k = ye(N);
432
- if (k) {
433
- p(!1), P.error(k);
431
+ const D = u(), P = ye(D);
432
+ if (P) {
433
+ p(!1), k.error(P);
434
434
  return;
435
435
  }
436
436
  const L = {
437
- ...N,
437
+ ...D,
438
438
  visualId: void 0
439
- }, V = G(d, L.id);
439
+ }, V = G(c, L.id);
440
440
  try {
441
441
  const M = await y(L, {
442
442
  previousFrame: V
443
443
  });
444
- i(c, L, {
444
+ i(d, L, {
445
445
  semanticExecutionPayload: M
446
446
  });
447
447
  } catch (M) {
448
- console.error("Failed to apply local semantic metadata:", M), p(!1), P.error(
448
+ console.error("Failed to apply local semantic metadata:", M), p(!1), k.error(
449
449
  M instanceof Error ? M.message : "Failed to prepare semantic metadata for this visual"
450
450
  );
451
451
  return;
452
452
  }
453
453
  setTimeout(() => {
454
- p(!1), P.success("Changes applied. Visual is now local to this dashboard"), m(!1);
454
+ p(!1), k.success("Changes applied. Visual is now local to this dashboard"), m(!1);
455
455
  }, 300);
456
- }, A = (N) => {
457
- h(N), o(!0);
456
+ }, A = (D) => {
457
+ h(D), o(!0);
458
458
  };
459
459
  return /* @__PURE__ */ s(_, { children: [
460
460
  /* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
461
461
  !f && /* @__PURE__ */ t(se, { className: "!rounded-none", variant: "default" }),
462
- f && S && /* @__PURE__ */ t(dt, { className: "!rounded-none", variant: "default" }),
462
+ f && S && /* @__PURE__ */ t(ct, { className: "!rounded-none", variant: "default" }),
463
463
  f && w && /* @__PURE__ */ t(ut, { className: "!rounded-none" }),
464
464
  /* @__PURE__ */ s(ve, { modal: !1, children: [
465
465
  /* @__PURE__ */ t(ge, { asChild: !0, children: /* @__PURE__ */ t(
@@ -486,7 +486,7 @@ function zt(e = {}) {
486
486
  onClick: g,
487
487
  disabled: r,
488
488
  children: [
489
- /* @__PURE__ */ t(ot, { className: "h-3.5 w-3.5" }),
489
+ /* @__PURE__ */ t(rt, { className: "h-3.5 w-3.5" }),
490
490
  r ? "Applying..." : "Apply Locally"
491
491
  ]
492
492
  }
@@ -536,10 +536,10 @@ function zt(e = {}) {
536
536
  Et,
537
537
  {
538
538
  open: C,
539
- onOpenChange: (N) => {
540
- U || o(N);
539
+ onOpenChange: (D) => {
540
+ U || o(D);
541
541
  },
542
- isLibraryVisual: D,
542
+ isLibraryVisual: N,
543
543
  currentVisualName: F,
544
544
  isSaving: U,
545
545
  destinationMode: b,
@@ -549,10 +549,10 @@ function zt(e = {}) {
549
549
  ] });
550
550
  }
551
551
  function Rt({ className: e }) {
552
- const a = H((r) => r.isDevMode), v = B((r) => r.isVisualEditing), { setIsDevMode: l } = nt(), { config: n } = Ae(Be).tokenProps, c = (n == null ? void 0 : n.showAdvancedMode) !== !1;
553
- if (!v || !c)
552
+ const a = j((r) => r.isDevMode), v = B((r) => r.isVisualEditing), { setIsDevMode: l } = ot(), { config: n } = Ae(Be).tokenProps, d = (n == null ? void 0 : n.showAdvancedMode) !== !1;
553
+ if (!v || !d)
554
554
  return null;
555
- const d = a ? Y : Oe, m = a ? "Drag & drop" : "SQL", i = a ? "Switch to drag-and-drop mode" : "Switch to SQL mode";
555
+ const c = a ? Y : Oe, m = a ? "Drag & drop" : "SQL", i = a ? "Switch to drag-and-drop mode" : "Switch to SQL mode";
556
556
  return /* @__PURE__ */ s(
557
557
  "button",
558
558
  {
@@ -560,12 +560,12 @@ function Rt({ className: e }) {
560
560
  "aria-label": i,
561
561
  title: i,
562
562
  onClick: () => l(!a),
563
- className: j(
563
+ className: H(
564
564
  "inline-flex h-7 items-center gap-1.5 rounded-control border border-input bg-background px-2 text-[12px] font-medium text-foreground transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:outline-none",
565
565
  e
566
566
  ),
567
567
  children: [
568
- /* @__PURE__ */ t(d, { className: "h-3 w-3 text-muted-foreground" }),
568
+ /* @__PURE__ */ t(c, { className: "h-3 w-3 text-muted-foreground" }),
569
569
  m
570
570
  ]
571
571
  }
@@ -577,8 +577,8 @@ function $t({
577
577
  onSave: v,
578
578
  onDiscard: l,
579
579
  isSaving: n,
580
- title: c = "Unsaved changes",
581
- description: d = "You have unsaved changes to this dashboard. What would you like to do?",
580
+ title: d = "Unsaved changes",
581
+ description: c = "You have unsaved changes to this dashboard. What would you like to do?",
582
582
  cancelLabel: m = "Cancel",
583
583
  discardLabel: i = "Discard",
584
584
  saveLabel: r = "Save"
@@ -587,10 +587,10 @@ function $t({
587
587
  !b && n || a(b);
588
588
  }, children: /* @__PURE__ */ s(Re, { children: [
589
589
  /* @__PURE__ */ s($e, { children: [
590
- /* @__PURE__ */ t(_e, { children: c }),
591
- /* @__PURE__ */ t(je, { children: d })
590
+ /* @__PURE__ */ t(_e, { children: d }),
591
+ /* @__PURE__ */ t(He, { children: c })
592
592
  ] }),
593
- /* @__PURE__ */ s(He, { children: [
593
+ /* @__PURE__ */ s(je, { children: [
594
594
  /* @__PURE__ */ t(
595
595
  I,
596
596
  {
@@ -605,7 +605,7 @@ function $t({
605
605
  ),
606
606
  /* @__PURE__ */ t(Xe, { disabled: n, children: m }),
607
607
  /* @__PURE__ */ t(I, { type: "button", size: "xs", onClick: v, disabled: n, children: n ? /* @__PURE__ */ s(_, { children: [
608
- /* @__PURE__ */ t(K, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
608
+ /* @__PURE__ */ t(Q, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
609
609
  "Saving..."
610
610
  ] }) : r })
611
611
  ] })
@@ -622,13 +622,13 @@ function At({
622
622
  }, n = () => {
623
623
  switch (e.status) {
624
624
  case "completed":
625
- return /* @__PURE__ */ t(qe, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
625
+ return /* @__PURE__ */ t(Ke, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
626
626
  case "failed":
627
627
  return /* @__PURE__ */ t(pt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
628
628
  default:
629
- return /* @__PURE__ */ t(K, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
629
+ return /* @__PURE__ */ t(Q, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
630
630
  }
631
- }, c = W(e.status), d = (() => {
631
+ }, d = q(e.status), c = (() => {
632
632
  switch (e.status) {
633
633
  case "pending":
634
634
  return "Queued...";
@@ -658,7 +658,7 @@ function At({
658
658
  /* @__PURE__ */ t("span", { children: Ge(e.fileSize) })
659
659
  ] })
660
660
  ] }),
661
- c && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: d }),
661
+ d && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: c }),
662
662
  e.status === "failed" && /* @__PURE__ */ t("div", { className: "line-clamp-2 text-xs text-destructive", children: e.error || "Export failed" })
663
663
  ] })
664
664
  ] }),
@@ -670,7 +670,7 @@ function At({
670
670
  className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
671
671
  onClick: l,
672
672
  "aria-label": "Remove notification",
673
- children: /* @__PURE__ */ t(it, { className: "h-4 w-4" })
673
+ children: /* @__PURE__ */ t(nt, { className: "h-4 w-4" })
674
674
  }
675
675
  )
676
676
  ] }),
@@ -685,14 +685,14 @@ function At({
685
685
  className: "h-8 bg-transparent",
686
686
  onClick: v,
687
687
  children: [
688
- /* @__PURE__ */ t(Qe, { className: "mr-1.5 h-3.5 w-3.5" }),
688
+ /* @__PURE__ */ t(We, { className: "mr-1.5 h-3.5 w-3.5" }),
689
689
  "Download"
690
690
  ]
691
691
  }
692
692
  )
693
693
  ] }),
694
- c && /* @__PURE__ */ s("div", { children: [
695
- /* @__PURE__ */ t(We, { value: e.progress, className: "h-1.5" }),
694
+ d && /* @__PURE__ */ s("div", { children: [
695
+ /* @__PURE__ */ t(qe, { value: e.progress, className: "h-1.5" }),
696
696
  /* @__PURE__ */ s("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
697
697
  e.progress,
698
698
  "% complete"
@@ -703,7 +703,7 @@ function At({
703
703
  ] });
704
704
  }
705
705
  function It() {
706
- const { authToken: e, tokenProps: a } = Q(), v = z((f) => f.activeExports), { clearCompleted: l, removeExport: n, updateExport: c } = ce(), [d, m] = T(!1), [i, r] = T(!1), p = Array.from(v.values()).sort(
706
+ const { authToken: e, tokenProps: a } = W(), v = z((f) => f.activeExports), { clearCompleted: l, removeExport: n, updateExport: d } = de(), [c, m] = T(!1), [i, r] = T(!1), p = Array.from(v.values()).sort(
707
707
  (f, w) => w.startedAt.getTime() - f.startedAt.getTime()
708
708
  ), b = p.some(
709
709
  (f) => f.status === "completed" || f.status === "failed"
@@ -720,15 +720,15 @@ function It() {
720
720
  let x;
721
721
  if (o.status === "completed")
722
722
  try {
723
- x = await q(
723
+ x = await K(
724
724
  f,
725
725
  w,
726
726
  C.id
727
727
  );
728
- } catch (D) {
729
- console.error(`Failed to get download URL for ${C.id}:`, D);
728
+ } catch (N) {
729
+ console.error(`Failed to get download URL for ${C.id}:`, N);
730
730
  }
731
- c(C.id, {
731
+ d(C.id, {
732
732
  status: o.status,
733
733
  progress: o.progress,
734
734
  completedChunks: o.completedChunks,
@@ -751,7 +751,7 @@ function It() {
751
751
  v,
752
752
  e == null ? void 0 : e.accessToken,
753
753
  a == null ? void 0 : a.apiServiceUrl,
754
- c
754
+ d
755
755
  ]), y = $(async () => {
756
756
  const f = a == null ? void 0 : a.apiServiceUrl, w = e == null ? void 0 : e.accessToken;
757
757
  if (!f || !w) {
@@ -808,12 +808,12 @@ function It() {
808
808
  size: "sm",
809
809
  className: "h-7 w-7 p-0",
810
810
  onClick: h,
811
- disabled: d,
811
+ disabled: c,
812
812
  title: "Refresh status",
813
813
  children: /* @__PURE__ */ t(
814
- Ke,
814
+ Qe,
815
815
  {
816
- className: `h-4 w-4 ${d ? "animate-spin" : ""}`
816
+ className: `h-4 w-4 ${c ? "animate-spin" : ""}`
817
817
  }
818
818
  )
819
819
  }
@@ -846,9 +846,9 @@ function _t({
846
846
  }) {
847
847
  const a = z((i) => i.activeExports), v = Ze(), l = a.size > 0, n = Array.from(a.values()).some(
848
848
  (i) => i.status === "completed" || i.status === "failed"
849
- ), d = v > 0 ? v > 9 ? "9+" : String(v) : null;
849
+ ), c = v > 0 ? v > 9 ? "9+" : String(v) : null;
850
850
  return /* @__PURE__ */ s(Ce, { children: [
851
- /* @__PURE__ */ t(Ne, { asChild: !0, children: /* @__PURE__ */ s(
851
+ /* @__PURE__ */ t(De, { asChild: !0, children: /* @__PURE__ */ s(
852
852
  I,
853
853
  {
854
854
  variant: e ?? "ghost",
@@ -860,14 +860,14 @@ function _t({
860
860
  l && /* @__PURE__ */ t(
861
861
  "span",
862
862
  {
863
- className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${d ? "-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"}`,
864
- children: d
863
+ 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"}`,
864
+ children: c
865
865
  }
866
866
  )
867
867
  ]
868
868
  }
869
869
  ) }),
870
- /* @__PURE__ */ t(De, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(It, {}) })
870
+ /* @__PURE__ */ t(Ne, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(It, {}) })
871
871
  ] });
872
872
  }
873
873
  function Ft(e) {
@@ -879,15 +879,15 @@ function Ft(e) {
879
879
  affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
880
880
  };
881
881
  }
882
- function jt({
882
+ function Ht({
883
883
  open: e,
884
884
  onOpenChange: a,
885
885
  trigger: v,
886
886
  showTrigger: l = !0,
887
887
  initialMode: n = "manage"
888
888
  }) {
889
- const c = n === "create", {
890
- forceClose: d,
889
+ const d = n === "create", {
890
+ forceClose: c,
891
891
  handleOpenChange: m,
892
892
  isCreateFlowActive: i,
893
893
  preventPassiveDismissDuringCreate: r,
@@ -904,7 +904,7 @@ function jt({
904
904
  // create and make consumers use `forceClose()` from a dedicated
905
905
  // button.
906
906
  dismissMode: l ? "passive" : "explicit-only"
907
- }), h = B((u) => u.dashboard), { setDashboardControlsModel: y } = Z(), { participants: E } = Je(lt(h)), f = Array.from(
907
+ }), h = B((u) => u.dashboard), { setDashboardControlsModel: y } = Z(), { participants: E } = Je(it(h)), f = Array.from(
908
908
  new Map(
909
909
  E.flatMap(
910
910
  (u) => u.fieldChoices.map((g) => {
@@ -934,29 +934,29 @@ function jt({
934
934
  })
935
935
  )
936
936
  ).values()
937
- ), S = et({
937
+ ), S = lt({
938
938
  ...h || {},
939
939
  controls: []
940
- }), C = tt(h), o = (u, g, A) => {
940
+ }), C = et(h), o = (u, g, A) => {
941
941
  y(
942
942
  u,
943
943
  g,
944
944
  Ft(A)
945
945
  );
946
946
  }, x = $(() => {
947
- if (c) {
948
- d();
947
+ if (d) {
948
+ c();
949
949
  return;
950
950
  }
951
951
  b(!1);
952
- }, [c, d, b]), D = /* @__PURE__ */ t(
952
+ }, [d, c, b]), N = /* @__PURE__ */ t(
953
953
  vt,
954
954
  {
955
955
  scope: "dashboard",
956
956
  controls: h.controls || [],
957
957
  reservedControlIds: S,
958
958
  defaultValues: h.defaultControlValues || {},
959
- usageByControlId: at(h),
959
+ usageByControlId: tt(h),
960
960
  availableFieldChoices: f,
961
961
  availableMetricChoices: w,
962
962
  structuralParticipants: E,
@@ -972,15 +972,15 @@ function jt({
972
972
  /* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
973
973
  /* @__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." })
974
974
  ] }),
975
- D
975
+ N
976
976
  ] });
977
977
  return l ? /* @__PURE__ */ s(Ce, { open: p, onOpenChange: m, children: [
978
- /* @__PURE__ */ t(Ne, { asChild: !0, children: v || /* @__PURE__ */ s(I, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
978
+ /* @__PURE__ */ t(De, { asChild: !0, children: v || /* @__PURE__ */ s(I, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
979
979
  /* @__PURE__ */ t(Y, { className: "mr-2 h-4 w-4" }),
980
980
  "Controls"
981
981
  ] }) }),
982
982
  /* @__PURE__ */ t(
983
- De,
983
+ Ne,
984
984
  {
985
985
  className: "w-[620px] max-w-[95vw] space-y-4",
986
986
  align: "end",
@@ -989,7 +989,7 @@ function jt({
989
989
  children: U
990
990
  }
991
991
  )
992
- ] }) : /* @__PURE__ */ t(de, { open: p, onOpenChange: m, children: /* @__PURE__ */ s(
992
+ ] }) : /* @__PURE__ */ t(ce, { open: p, onOpenChange: m, children: /* @__PURE__ */ s(
993
993
  ue,
994
994
  {
995
995
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
@@ -1012,19 +1012,19 @@ function jt({
1012
1012
  ]
1013
1013
  }
1014
1014
  ),
1015
- /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: D })
1015
+ /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: N })
1016
1016
  ]
1017
1017
  }
1018
1018
  ) });
1019
1019
  }
1020
- function Ht({
1020
+ function jt({
1021
1021
  showFilters: e,
1022
1022
  onToggleFilters: a,
1023
1023
  onAddFilter: v,
1024
1024
  onAddControl: l,
1025
1025
  onManageControls: n,
1026
- size: c = "default",
1027
- className: d,
1026
+ size: d = "default",
1027
+ className: c,
1028
1028
  primaryButtonClassName: m,
1029
1029
  secondaryButtonClassName: i,
1030
1030
  dropdownContentClassName: r
@@ -1032,14 +1032,14 @@ function Ht({
1032
1032
  return /* @__PURE__ */ s(
1033
1033
  "div",
1034
1034
  {
1035
- className: j(
1035
+ className: H(
1036
1036
  // Height lives on the shell so the outer border is part of the
1037
1037
  // h-7 box (matches regular `size="xs"` buttons). Inner buttons
1038
1038
  // stretch to fill via `h-full`, avoiding the 2px stack-up that
1039
1039
  // makes the combo taller than a sibling `<Button size="xs">`.
1040
1040
  "relative inline-flex items-stretch overflow-hidden rounded-control border border-input bg-background",
1041
- c === "toolbar" ? "h-8" : "h-7",
1042
- d
1041
+ d === "toolbar" ? "h-8" : "h-7",
1042
+ c
1043
1043
  ),
1044
1044
  children: [
1045
1045
  /* @__PURE__ */ s(
@@ -1047,7 +1047,7 @@ function Ht({
1047
1047
  {
1048
1048
  variant: "ghost",
1049
1049
  size: "xs",
1050
- className: j(
1050
+ className: H(
1051
1051
  "h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50",
1052
1052
  m
1053
1053
  ),
@@ -1064,7 +1064,7 @@ function Ht({
1064
1064
  {
1065
1065
  variant: "ghost",
1066
1066
  size: "xs",
1067
- className: j(
1067
+ className: H(
1068
1068
  "h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50",
1069
1069
  i
1070
1070
  ),
@@ -1076,7 +1076,7 @@ function Ht({
1076
1076
  be,
1077
1077
  {
1078
1078
  align: "start",
1079
- className: j(
1079
+ className: H(
1080
1080
  "min-w-[180px] rounded-control border border-border/60 p-1 shadow-sm",
1081
1081
  r
1082
1082
  ),
@@ -1090,7 +1090,7 @@ function Ht({
1090
1090
  "Add control"
1091
1091
  ] }),
1092
1092
  /* @__PURE__ */ s(R, { onSelect: n, children: [
1093
- /* @__PURE__ */ t(st, { className: "h-3.5 w-3.5" }),
1093
+ /* @__PURE__ */ t(at, { className: "h-3.5 w-3.5" }),
1094
1094
  "Manage controls"
1095
1095
  ] })
1096
1096
  ]
@@ -1103,13 +1103,13 @@ function Ht({
1103
1103
  }
1104
1104
  export {
1105
1105
  Rt as A,
1106
- jt as D,
1106
+ Ht as D,
1107
1107
  It as E,
1108
1108
  _t as N,
1109
1109
  $t as U,
1110
1110
  zt as V,
1111
1111
  At as a,
1112
1112
  Ot as b,
1113
- Ht as c,
1113
+ jt as c,
1114
1114
  Bt as u
1115
1115
  };