react-semaphor 0.1.531 → 0.1.533

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 (35) hide show
  1. package/dist/brand-studio/index.js +1 -1
  2. package/dist/chunks/{dashboard-BHMHze_t.js → dashboard-DUCg1mNJ.js} +1 -1
  3. package/dist/chunks/{dashboard-briefing-launcher-nHbT_XPG.js → dashboard-briefing-launcher-B0PuQUiR.js} +1401 -1383
  4. package/dist/chunks/{dashboard-controls-Chv8n1oV.js → dashboard-controls-Cl3fLg9W.js} +39 -39
  5. package/dist/chunks/{dashboard-json-XgY8U_hG.js → dashboard-json-BSOgXGwr.js} +1 -1
  6. package/dist/chunks/{edit-dashboard-visual-CcxZN7C6.js → edit-dashboard-visual-CQDyMxM7.js} +516 -516
  7. package/dist/chunks/{editor-action-buttons-CCzvDROJ.js → editor-action-buttons-BKVrZnRQ.js} +2 -2
  8. package/dist/chunks/{matrix-formatter-DDjECnMd.js → matrix-formatter-DY1y9odV.js} +2 -1
  9. package/dist/chunks/{pivot-header-presentation-BTOXdU6S.js → pivot-header-presentation-Bb6b3Ch2.js} +232 -210
  10. package/dist/chunks/{report-preferences-dialog-D2Tz_5WT.js → report-preferences-dialog-WDM7qWxV.js} +16 -16
  11. package/dist/chunks/{semaphor-ready-indicator-CpbyewzC.js → semaphor-ready-indicator-yZ0JtL4D.js} +36174 -36148
  12. package/dist/chunks/{slider-p0D5yTI_.js → slider-0mB67Lls.js} +3 -3
  13. package/dist/chunks/{switch-JmX27lNB.js → switch-D95vek6N.js} +1690 -1683
  14. package/dist/dashboard/index.js +1 -1
  15. package/dist/data-app-sdk/index.js +1 -1
  16. package/dist/format-utils/index.js +90 -89
  17. package/dist/index.js +120 -119
  18. package/dist/surfboard/index.js +1 -1
  19. package/dist/types/components/surfboard/filter/date-range-filter-v2.d.ts +2 -2
  20. package/dist/types/components/surfboard/filter/types.d.ts +9 -0
  21. package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -6
  22. package/dist/types/lib/api/exports-api.d.ts +30 -3
  23. package/dist/types/lib/csv-download.d.ts +4 -2
  24. package/dist/types/lib/export-messages.d.ts +47 -0
  25. package/dist/types/lib/exports/bounded-request.d.ts +12 -0
  26. package/dist/types/lib/exports/export-status.d.ts +2 -0
  27. package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
  28. package/dist/types/lib/hooks/use-export-polling.d.ts +9 -1
  29. package/dist/types/lib/matrix-table/submit-matrix-delivery.d.ts +14 -2
  30. package/dist/types/lib/matrix-table/use-matrix.d.ts +4 -0
  31. package/dist/types/lib/stores/export-store.d.ts +11 -0
  32. package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -0
  33. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +6 -0
  34. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +28 -4
  35. package/package.json +1 -1
@@ -1,26 +1,26 @@
1
- import { jsx as t, jsxs as r, Fragment as $ } from "react/jsx-runtime";
2
- import Nt, { useState as A, useEffect as Y, useMemo as X, useCallback as W, useLayoutEffect as xt, useRef as ce, useContext as qt } from "react";
3
- import { B as T, m as Ne, r as et, L as re, k as St, d as Dt, aj as z, c as G, j as Gt, u as L, a2 as me, a0 as be, aN as tt, a3 as kt, P as Me, a as _e, b as Oe, aW as Kt, aX as Yt, S as Et, aY as Qt, aZ as Xt, a_ as Zt, a$ as Jt, ah as er } from "./switch-JmX27lNB.js";
4
- import { cg as rt, aY as Se, aZ as De, a$ as ke, b5 as At, aN as tr, ch as rr, ci as ar, bm as ge, bW as It, bd as ze, q as nr, m as sr, cj as or, c8 as at, c9 as nt, ca as st, cb as ot, cc as it, cd as lt, ce as dt, cf as Ft, bb as ct, ck as ir, cl as lr, cm as Qe, bX as We, bY as He, cn as Lt, bZ as qe, bI as q, c6 as dr, c5 as $e, co as cr, bG as ur, a_ as ut, b0 as ht, cp as hr, aX as mr, b4 as pr, bp as Bt, cq as fr, bK as gr, u as br, cr as xr, cs as vr, aB as Ge, L as he, au as mt, aq as Tt, ar as je, N as Ut, ap as yr, aw as Cr, R as Rt, ct as wr, cu as Nr, as as vt, P as Sr, cv as Dr, cw as kr, cx as Er, cy as Ar, cz as Ir, cA as Fr, cB as Vt, cC as Lr, cD as Br, cE as Tr, b_ as Pt, cF as Ur, cG as Rr, cH as Re, cI as Vr, cJ as Pr, cK as Mr, am as _r, an as Or, a2 as zr, a1 as $r, a0 as jr, $ as Wr, Y as Hr, W as qr, cL as Gr, cM as Kr, cN as Yr, cO as Qr, cP as Xr, ak as Zr, cQ as Jr, cR as ea, a8 as ta, cS as ra, cT as aa, cU as na } from "./semaphor-ready-indicator-CpbyewzC.js";
5
- import { L as pt } from "./layout-grid-CiubineE.js";
6
- import { c as Ee, X as Ke, C as Mt } from "./x-CXDkqdur.js";
7
- import { a as ft, V as sa, E as Xe, b as Ze, c as oa, d as ia, L as la, e as da, g as _t, C as Ot, F as ca, h as ua } from "./editor-action-buttons-CCzvDROJ.js";
1
+ import { jsx as t, jsxs as r, Fragment as j } from "react/jsx-runtime";
2
+ import Dt, { useState as E, useEffect as Y, useMemo as Q, useCallback as H, useLayoutEffect as yt, useRef as ue, useContext as Xt } from "react";
3
+ import { B as R, m as ke, r as at, L as ae, k as kt, d as Et, aj as $, c as X, j as Kt, u as T, a2 as fe, a0 as ve, aN as nt, a3 as At, P as ze, a as $e, b as je, aW as Yt, aX as Zt, S as It, aY as Qt, aZ as Jt, a_ as er, a$ as tr, ah as rr } from "./switch-D95vek6N.js";
4
+ import { ch as st, aZ as Ee, a_ as Ae, b0 as Ie, b6 as Lt, aO as ar, ci as nr, cj as sr, bn as xe, bX as Ft, be as We, q as or, m as ir, ck as lr, c9 as ot, ca as it, cb as lt, cc as dt, cd as ct, ce as ut, cf as ht, cg as Tt, bc as mt, cl as dr, cm as cr, cn as Je, bY as Ge, bZ as Xe, co as Bt, b_ as Ke, bJ as G, c7 as ur, c6 as He, cp as hr, bH as mr, a$ as pt, b1 as ft, cq as pr, aY as fr, b5 as gr, bq as Rt, cr as br, bL as xr, u as vr, cs as yr, ct as Cr, aC as Ye, L as me, av as De, ar as Ut, as as qe, cu as z, N as Vt, aq as wr, cv as Nr, ax as Sr, R as Pt, cw as Dr, cx as kr, at as Ct, P as Er, cy as Ar, cz as Ir, cA as Lr, cB as Fr, cC as Tr, cD as Br, cE as _t, cF as Rr, cG as Ur, cH as Vr, b$ as Mt, cI as Pr, cJ as _r, cK as _e, cL as Mr, cM as Or, cN as zr, am as $r, an as jr, a2 as Wr, a1 as Hr, a0 as qr, $ as Gr, Y as Xr, W as Kr, cO as Yr, cP as Zr, cQ as Qr, cR as Jr, cS as ea, ak as ta, cT as ra, cU as aa, a8 as na, cV as sa, cW as oa, cX as ia } from "./semaphor-ready-indicator-yZ0JtL4D.js";
5
+ import { L as gt } from "./layout-grid-CiubineE.js";
6
+ import { c as Le, X as Ze, C as Ot } from "./x-CXDkqdur.js";
7
+ import { a as bt, V as la, E as et, b as tt, c as da, d as ca, L as ua, e as ha, g as zt, C as $t, F as ma, h as pa } from "./editor-action-buttons-BKVrZnRQ.js";
8
8
  import "./validators-BS521dum.js";
9
9
  import "./matrix-operation-contract-BotZ-6zT.js";
10
10
  import "zod";
11
11
  import "../value-format-preferences/index.js";
12
- import { S as ha } from "./selection-reducer-DQok8gsC.js";
13
- import { s as Ve } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
14
- import { v as yt, s as ma } from "./card-config-utils-DqyASiD_.js";
15
- import { l as pa } from "./matrix-formatter-DDjECnMd.js";
16
- import { d as se, e as fa, h as ga } from "./index-BpAM7UE0.js";
12
+ import { S as fa } from "./selection-reducer-DQok8gsC.js";
13
+ import { s as Me } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
14
+ import { v as wt, s as ga } from "./card-config-utils-DqyASiD_.js";
15
+ import { l as Nt } from "./matrix-formatter-DY1y9odV.js";
16
+ import { d as oe, e as ba, h as xa } from "./index-BpAM7UE0.js";
17
17
  /**
18
18
  * @license lucide-react v0.453.0 - ISC
19
19
  *
20
20
  * This source code is licensed under the ISC license.
21
21
  * See the LICENSE file in the root directory of this source tree.
22
22
  */
23
- const ba = Ee("ArrowUpRight", [
23
+ const va = Le("ArrowUpRight", [
24
24
  ["path", { d: "M7 7h10v10", key: "1tivn9" }],
25
25
  ["path", { d: "M7 17 17 7", key: "1vkiza" }]
26
26
  ]);
@@ -30,7 +30,7 @@ const ba = Ee("ArrowUpRight", [
30
30
  * This source code is licensed under the ISC license.
31
31
  * See the LICENSE file in the root directory of this source tree.
32
32
  */
33
- const xa = Ee("CalendarRange", [
33
+ const ya = Le("CalendarRange", [
34
34
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
35
35
  ["path", { d: "M16 2v4", key: "4m81vk" }],
36
36
  ["path", { d: "M3 10h18", key: "8toen8" }],
@@ -46,7 +46,7 @@ const xa = Ee("CalendarRange", [
46
46
  * This source code is licensed under the ISC license.
47
47
  * See the LICENSE file in the root directory of this source tree.
48
48
  */
49
- const va = Ee("FileDown", [
49
+ const Ca = Le("FileDown", [
50
50
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
51
51
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
52
52
  ["path", { d: "M12 18v-6", key: "17g6i2" }],
@@ -58,7 +58,7 @@ const va = Ee("FileDown", [
58
58
  * This source code is licensed under the ISC license.
59
59
  * See the LICENSE file in the root directory of this source tree.
60
60
  */
61
- const ya = Ee("MousePointer2", [
61
+ const wa = Le("MousePointer2", [
62
62
  [
63
63
  "path",
64
64
  {
@@ -73,7 +73,7 @@ const ya = Ee("MousePointer2", [
73
73
  * This source code is licensed under the ISC license.
74
74
  * See the LICENSE file in the root directory of this source tree.
75
75
  */
76
- const Ca = Ee("Newspaper", [
76
+ const Na = Le("Newspaper", [
77
77
  [
78
78
  "path",
79
79
  {
@@ -85,7 +85,7 @@ const Ca = Ee("Newspaper", [
85
85
  ["path", { d: "M15 18h-5", key: "95g1m2" }],
86
86
  ["path", { d: "M10 6h8v4h-8V6Z", key: "smlsk5" }]
87
87
  ]);
88
- function wa() {
88
+ function Sa() {
89
89
  return /* @__PURE__ */ t("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((e, a) => /* @__PURE__ */ r(
90
90
  "div",
91
91
  {
@@ -101,38 +101,38 @@ function wa() {
101
101
  a
102
102
  )) });
103
103
  }
104
- function Na({
104
+ function Da({
105
105
  open: e,
106
106
  onOpenChange: a,
107
- onSubmit: o,
107
+ onSubmit: i,
108
108
  isCreating: n
109
109
  }) {
110
- const i = rt("interactive"), [s, c] = A(""), [m, l] = A("");
110
+ const l = st("interactive"), [s, u] = E(""), [p, o] = E("");
111
111
  Y(() => {
112
- e || (c(""), l(""));
112
+ e || (u(""), o(""));
113
113
  }, [e]);
114
- const u = () => {
115
- s.trim() && o({ title: s, description: m });
116
- }, d = (p) => {
117
- a(p);
114
+ const c = () => {
115
+ s.trim() && i({ title: s, description: p });
116
+ }, d = (m) => {
117
+ a(m);
118
118
  };
119
- return /* @__PURE__ */ t(Se, { open: e, onOpenChange: d, children: /* @__PURE__ */ r(
120
- De,
119
+ return /* @__PURE__ */ t(Ee, { open: e, onOpenChange: d, children: /* @__PURE__ */ r(
120
+ Ae,
121
121
  {
122
122
  showCloseButton: !1,
123
123
  className: "flex max-w-lg grid-cols-none flex-col gap-0 overflow-hidden rounded-card border-border/60 p-0 shadow-lg sm:rounded-card",
124
- style: i.dialogStyle,
124
+ style: l.dialogStyle,
125
125
  children: [
126
126
  /* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
127
127
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
128
- /* @__PURE__ */ t(pt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
128
+ /* @__PURE__ */ t(gt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
129
129
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
130
- /* @__PURE__ */ t(ke, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
130
+ /* @__PURE__ */ t(Ie, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
131
131
  /* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
132
132
  ] })
133
133
  ] }),
134
134
  /* @__PURE__ */ t(
135
- T,
135
+ R,
136
136
  {
137
137
  size: "xs",
138
138
  variant: "ghost",
@@ -140,39 +140,39 @@ function Na({
140
140
  onClick: () => d(!1),
141
141
  "aria-label": "Close",
142
142
  disabled: n,
143
- children: /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5" })
143
+ children: /* @__PURE__ */ t(Ze, { className: "h-3.5 w-3.5" })
144
144
  }
145
145
  )
146
146
  ] }),
147
147
  /* @__PURE__ */ r("div", { className: "space-y-3 px-4 py-3", children: [
148
148
  /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
149
149
  /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
150
- /* @__PURE__ */ t(Ne, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
150
+ /* @__PURE__ */ t(ke, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
151
151
  /* @__PURE__ */ t(
152
- et,
152
+ at,
153
153
  {
154
154
  id: "visual-title",
155
155
  size: "sm",
156
156
  placeholder: "Untitled visual",
157
157
  value: s,
158
- onChange: (p) => c(p.target.value),
158
+ onChange: (m) => u(m.target.value),
159
159
  disabled: n,
160
- onKeyDown: (p) => {
161
- p.key === "Enter" && !p.shiftKey && (p.preventDefault(), u());
160
+ onKeyDown: (m) => {
161
+ m.key === "Enter" && !m.shiftKey && (m.preventDefault(), c());
162
162
  }
163
163
  }
164
164
  )
165
165
  ] }),
166
166
  /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
167
- /* @__PURE__ */ t(Ne, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
167
+ /* @__PURE__ */ t(ke, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
168
168
  /* @__PURE__ */ t(
169
- et,
169
+ at,
170
170
  {
171
171
  id: "visual-description",
172
172
  size: "sm",
173
173
  placeholder: "Optional",
174
- value: m,
175
- onChange: (p) => l(p.target.value),
174
+ value: p,
175
+ onChange: (m) => o(m.target.value),
176
176
  disabled: n
177
177
  }
178
178
  )
@@ -180,7 +180,7 @@ function Na({
180
180
  ] }),
181
181
  /* @__PURE__ */ r("div", { className: "flex shrink-0 justify-end gap-2 border-t border-border/60 px-4 py-2.5", children: [
182
182
  /* @__PURE__ */ t(
183
- T,
183
+ R,
184
184
  {
185
185
  size: "xs",
186
186
  variant: "outline",
@@ -190,13 +190,13 @@ function Na({
190
190
  }
191
191
  ),
192
192
  /* @__PURE__ */ t(
193
- T,
193
+ R,
194
194
  {
195
195
  size: "xs",
196
- onClick: u,
196
+ onClick: c,
197
197
  disabled: !s.trim() || n,
198
- children: n ? /* @__PURE__ */ r($, { children: [
199
- /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }),
198
+ children: n ? /* @__PURE__ */ r(j, { children: [
199
+ /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin" }),
200
200
  "Creating..."
201
201
  ] }) : "Create library visual"
202
202
  }
@@ -206,195 +206,195 @@ function Na({
206
206
  }
207
207
  ) });
208
208
  }
209
- function zt(e) {
209
+ function jt(e) {
210
210
  return e ? new Date(e).toLocaleDateString("en-US", {
211
211
  month: "short",
212
212
  day: "numeric",
213
213
  year: "numeric"
214
214
  }) : "Unknown";
215
215
  }
216
- function $t(e, a) {
216
+ function Wt(e, a) {
217
217
  var n;
218
- const o = (n = e.ownership.createdBy) == null ? void 0 : n.type;
219
- return o === "tenant" || o === "organization" && a;
218
+ const i = (n = e.ownership.createdBy) == null ? void 0 : n.type;
219
+ return i === "tenant" || i === "organization" && a;
220
220
  }
221
- function gt(e, a) {
222
- var o, n;
223
- return $t(e, a) ? ((o = e.ownership.createdBy) == null ? void 0 : o.name) || ((n = e.createdByTenantUserRel) == null ? void 0 : n.name) || e.lastModifiedBy || "Unknown" : "Organization";
221
+ function xt(e, a) {
222
+ var i, n;
223
+ return Wt(e, a) ? ((i = e.ownership.createdBy) == null ? void 0 : i.name) || ((n = e.createdByTenantUserRel) == null ? void 0 : n.name) || e.lastModifiedBy || "Unknown" : "Organization";
224
224
  }
225
- function Sa(e, a) {
226
- return gt(e, a).split(/\s+/).filter(Boolean).slice(0, 2).map((n) => n.charAt(0).toUpperCase()).join("") || "?";
225
+ function ka(e, a) {
226
+ return xt(e, a).split(/\s+/).filter(Boolean).slice(0, 2).map((n) => n.charAt(0).toUpperCase()).join("") || "?";
227
227
  }
228
- function Da(e) {
228
+ function Ea(e) {
229
229
  const a = (e || "").toLowerCase();
230
- return a.includes("table") ? St : a.includes("pie") || a.includes("donut") ? ir : a.includes("line") ? lr : a.includes("bar") ? Gt : pt;
230
+ return a.includes("table") ? kt : a.includes("pie") || a.includes("donut") ? dr : a.includes("line") ? cr : a.includes("bar") ? Kt : gt;
231
231
  }
232
- function ka({ visual: e }) {
232
+ function Aa({ visual: e }) {
233
233
  const a = e.ownership.status === "public" ? "Public" : e.ownership.status === "shared" || e.ownership.sharedCount > 0 ? "Shared" : "Private";
234
234
  return /* @__PURE__ */ t("span", { className: "inline-flex items-center rounded-[4px] border border-border/60 px-1.5 py-px text-[11px] text-muted-foreground", children: a });
235
235
  }
236
- function _n({
236
+ function Hn({
237
237
  open: e,
238
238
  onOpenChange: a
239
239
  }) {
240
- const o = rt("interactive"), [n, i] = A(""), [s, c] = A(/* @__PURE__ */ new Set()), [m, l] = A(!1), [u, d] = A(
240
+ const i = st("interactive"), [n, l] = E(""), [s, u] = E(/* @__PURE__ */ new Set()), [p, o] = E(!1), [c, d] = E(
241
241
  null
242
- ), [p, h] = A(
242
+ ), [m, h] = E(
243
243
  null
244
- ), [f, g] = A(!1), [k, x] = A(null), [D, S] = A(null), C = () => {
245
- c(/* @__PURE__ */ new Set()), d(null), h(null), g(!1), x(null);
244
+ ), [f, b] = E(!1), [k, I] = E(null), [y, S] = E(null), D = () => {
245
+ u(/* @__PURE__ */ new Set()), d(null), h(null), b(!1), I(null);
246
246
  }, w = () => {
247
- a(!1), C();
248
- }, { selectVisual: E } = At(), { handleAddLibraryVisual: U, handleEditLibraryVisual: b } = ft(), { isConsoleMode: y } = tr(), {
249
- resources: R,
250
- isLoading: I,
251
- isError: H,
252
- createResource: F,
247
+ a(!1), D();
248
+ }, { selectVisual: C } = Lt(), { handleAddLibraryVisual: F, handleEditLibraryVisual: g } = bt(), { isConsoleMode: v } = ar(), {
249
+ resources: U,
250
+ isLoading: A,
251
+ isError: q,
252
+ createResource: L,
253
253
  updateResource: P,
254
- deleteResourceAsync: Z,
255
- duplicateResource: ae,
256
- isCreating: Ae,
257
- isDeleting: oe
258
- } = rr(
254
+ deleteResourceAsync: J,
255
+ duplicateResource: ne,
256
+ isCreating: Fe,
257
+ isDeleting: ie
258
+ } = nr(
259
259
  void 0,
260
- (v) => {
261
- l(!1), v && (E(v), b(v), w());
260
+ (x) => {
261
+ o(!1), x && (C(x), g(x), w());
262
262
  }
263
263
  ), {
264
- startUpdating: Ie,
265
- stopUpdating: Fe,
266
- isUpdating: ie
267
- } = ar(), j = R, J = X(() => {
268
- const v = n.trim().toLowerCase();
269
- return v ? j.filter(
264
+ startUpdating: Te,
265
+ stopUpdating: Be,
266
+ isUpdating: le
267
+ } = sr(), W = U, ee = Q(() => {
268
+ const x = n.trim().toLowerCase();
269
+ return x ? W.filter(
270
270
  (B) => {
271
- var M, te, de;
272
- return ((M = B.title) == null ? void 0 : M.toLowerCase().includes(v)) || ((te = B.description) == null ? void 0 : te.toLowerCase().includes(v)) || ((de = B.kind) == null ? void 0 : de.toLowerCase().includes(v));
271
+ var _, re, ce;
272
+ return ((_ = B.title) == null ? void 0 : _.toLowerCase().includes(x)) || ((re = B.description) == null ? void 0 : re.toLowerCase().includes(x)) || ((ce = B.kind) == null ? void 0 : ce.toLowerCase().includes(x));
273
273
  }
274
- ) : j;
275
- }, [n, j]), le = X(
276
- () => j.filter(
277
- (v) => s.has(v.id)
274
+ ) : W;
275
+ }, [n, W]), de = Q(
276
+ () => W.filter(
277
+ (x) => s.has(x.id)
278
278
  ),
279
- [s, j]
280
- ), ee = le.filter(
281
- (v) => v.permissions.canDelete
282
- ), Le = le.filter(
283
- (v) => v.permissions.canShare
284
- ), xe = J.length > 0 && J.every(
285
- (v) => s.has(v.id)
286
- ), ue = J.some(
287
- (v) => s.has(v.id)
288
- ), pe = (v) => {
279
+ [s, W]
280
+ ), te = de.filter(
281
+ (x) => x.permissions.canDelete
282
+ ), Re = de.filter(
283
+ (x) => x.permissions.canShare
284
+ ), ye = ee.length > 0 && ee.every(
285
+ (x) => s.has(x.id)
286
+ ), he = ee.some(
287
+ (x) => s.has(x.id)
288
+ ), ge = (x) => {
289
289
  const B = new Set(s);
290
- v(B), c(B);
291
- }, Q = (v) => {
292
- pe((B) => {
293
- B.has(v) ? B.delete(v) : B.add(v);
290
+ x(B), u(B);
291
+ }, Z = (x) => {
292
+ ge((B) => {
293
+ B.has(x) ? B.delete(x) : B.add(x);
294
294
  });
295
- }, ve = () => {
296
- c((v) => {
297
- const B = new Set(v);
298
- return xe ? J.forEach(
299
- (M) => B.delete(M.id)
300
- ) : J.forEach(
301
- (M) => B.add(M.id)
295
+ }, Ce = () => {
296
+ u((x) => {
297
+ const B = new Set(x);
298
+ return ye ? ee.forEach(
299
+ (_) => B.delete(_.id)
300
+ ) : ee.forEach(
301
+ (_) => B.add(_.id)
302
302
  ), B;
303
303
  });
304
- }, _ = async (v) => {
305
- (await U(v)).success && w();
304
+ }, M = async (x) => {
305
+ (await F(x)).success && w();
306
306
  }, O = async () => {
307
- const v = le;
308
- if (v.length === 0) return;
307
+ const x = de;
308
+ if (x.length === 0) return;
309
309
  let B = !1;
310
- for (const M of v)
311
- if (!(await U(M)).success) {
310
+ for (const _ of x)
311
+ if (!(await F(_)).success) {
312
312
  B = !0;
313
313
  break;
314
314
  }
315
315
  B || w();
316
- }, ne = (v) => {
317
- b(v), w();
318
- }, fe = (v) => {
319
- S(v), ae(v, {
316
+ }, se = (x) => {
317
+ g(x), w();
318
+ }, be = (x) => {
319
+ S(x), ne(x, {
320
320
  onSettled: () => S(null)
321
321
  });
322
- }, Be = () => {
323
- if (ee.length === 0) {
324
- z.error("Select a visual you can delete");
322
+ }, Ue = () => {
323
+ if (te.length === 0) {
324
+ $.error("Select a visual you can delete");
325
325
  return;
326
326
  }
327
- x(null), g(!0);
328
- }, Ye = async () => {
329
- const v = k ? [k] : ee;
327
+ I(null), b(!0);
328
+ }, Qe = async () => {
329
+ const x = k ? [k] : te;
330
330
  try {
331
- for (const B of v)
332
- await Z(B.id);
333
- c((B) => {
334
- const M = new Set(B);
335
- return v.forEach(
336
- (te) => M.delete(te.id)
337
- ), M;
338
- }), g(!1), x(null);
331
+ for (const B of x)
332
+ await J(B.id);
333
+ u((B) => {
334
+ const _ = new Set(B);
335
+ return x.forEach(
336
+ (re) => _.delete(re.id)
337
+ ), _;
338
+ }), b(!1), I(null);
339
339
  } catch {
340
340
  }
341
- }, ye = () => {
342
- if (le.length !== 1) {
343
- z.error("Select one visual to share");
341
+ }, we = () => {
342
+ if (de.length !== 1) {
343
+ $.error("Select one visual to share");
344
344
  return;
345
345
  }
346
- const [v] = le;
347
- if (!v.permissions.canShare) {
348
- z.error("You do not have permission to share this visual");
346
+ const [x] = de;
347
+ if (!x.permissions.canShare) {
348
+ $.error("You do not have permission to share this visual");
349
349
  return;
350
350
  }
351
- d(v);
352
- }, Ce = ({
353
- title: v,
351
+ d(x);
352
+ }, Ne = ({
353
+ title: x,
354
354
  description: B
355
355
  }) => {
356
- if (!p) return;
357
- const M = {};
358
- if (v !== p.title && (M.title = v), (p.description || "") !== B && (M.description = B), Object.keys(M).length === 0) {
356
+ if (!m) return;
357
+ const _ = {};
358
+ if (x !== m.title && (_.title = x), (m.description || "") !== B && (_.description = B), Object.keys(_).length === 0) {
359
359
  h(null);
360
360
  return;
361
361
  }
362
- const te = Object.keys(M), de = te.length === 1 ? te[0] : void 0;
363
- Ie(p.id, de), P(
362
+ const re = Object.keys(_), ce = re.length === 1 ? re[0] : void 0;
363
+ Te(m.id, ce), P(
364
364
  {
365
- resourceId: p.id,
366
- data: M
365
+ resourceId: m.id,
366
+ data: _
367
367
  },
368
368
  {
369
369
  onSuccess: () => {
370
- Fe(p.id, de), h(null);
370
+ Be(m.id, ce), h(null);
371
371
  },
372
372
  onError: () => {
373
- Fe(p.id, de);
373
+ Be(m.id, ce);
374
374
  }
375
375
  }
376
376
  );
377
- }, K = (v) => {
378
- a(v), v || C();
379
- }, we = k ? 1 : ee.length;
380
- return /* @__PURE__ */ r($, { children: [
381
- /* @__PURE__ */ t(Se, { open: e, onOpenChange: K, children: /* @__PURE__ */ r(
382
- De,
377
+ }, K = (x) => {
378
+ a(x), x || D();
379
+ }, Se = k ? 1 : te.length;
380
+ return /* @__PURE__ */ r(j, { children: [
381
+ /* @__PURE__ */ t(Ee, { open: e, onOpenChange: K, children: /* @__PURE__ */ r(
382
+ Ae,
383
383
  {
384
384
  showCloseButton: !1,
385
385
  className: "flex max-h-[80vh] w-[min(72rem,calc(100vw-2rem))] max-w-none grid-cols-none flex-col gap-0 overflow-hidden rounded-card border-border/60 p-0 shadow-lg sm:rounded-card",
386
- style: o.dialogStyle,
386
+ style: i.dialogStyle,
387
387
  children: [
388
388
  /* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
389
389
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
390
- /* @__PURE__ */ t(St, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
390
+ /* @__PURE__ */ t(kt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
391
391
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
392
- /* @__PURE__ */ t(ke, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
392
+ /* @__PURE__ */ t(Ie, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
393
393
  /* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
394
394
  ] })
395
395
  ] }),
396
396
  /* @__PURE__ */ t(
397
- T,
397
+ R,
398
398
  {
399
399
  size: "xs",
400
400
  variant: "ghost",
@@ -407,13 +407,13 @@ function _n({
407
407
  ] }),
408
408
  /* @__PURE__ */ r("div", { className: "flex shrink-0 items-center gap-2 border-b border-border/60 px-3 py-2", children: [
409
409
  /* @__PURE__ */ r("div", { className: "relative min-w-[12rem] flex-1 md:max-w-md", children: [
410
- /* @__PURE__ */ t(ha, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
410
+ /* @__PURE__ */ t(fa, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
411
411
  /* @__PURE__ */ t(
412
412
  "input",
413
413
  {
414
414
  autoFocus: !0,
415
415
  value: n,
416
- onChange: (v) => i(v.target.value),
416
+ onChange: (x) => l(x.target.value),
417
417
  placeholder: "Search visuals...",
418
418
  className: "h-7 w-full rounded-control border border-input bg-background pl-7 pr-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-ring focus:outline-none",
419
419
  "aria-label": "Search visuals"
@@ -421,93 +421,93 @@ function _n({
421
421
  )
422
422
  ] }),
423
423
  /* @__PURE__ */ r(
424
- T,
424
+ R,
425
425
  {
426
426
  size: "xs",
427
427
  variant: "outline",
428
428
  className: "ml-auto",
429
- onClick: () => l(!0),
429
+ onClick: () => o(!0),
430
430
  children: [
431
- /* @__PURE__ */ t(ge, { className: "h-3.5 w-3.5" }),
431
+ /* @__PURE__ */ t(xe, { className: "h-3.5 w-3.5" }),
432
432
  "New library visual"
433
433
  ]
434
434
  }
435
435
  )
436
436
  ] }),
437
- /* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: I ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(wa, {}) }) : H ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ t("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : J.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
438
- /* @__PURE__ */ t(pt, { className: "h-5 w-5 text-muted-foreground/60" }),
437
+ /* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: A ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(Sa, {}) }) : q ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ t("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : ee.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
438
+ /* @__PURE__ */ t(gt, { className: "h-5 w-5 text-muted-foreground/60" }),
439
439
  /* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: n ? "No visuals found" : "No visuals yet" }),
440
440
  /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: n ? "Try a different search." : "Create a saved visual to add it here." })
441
441
  ] }) : /* @__PURE__ */ t(
442
- Ea,
442
+ Ia,
443
443
  {
444
- visuals: J,
444
+ visuals: ee,
445
445
  selectedIds: s,
446
- allFilteredSelected: xe,
447
- someFilteredSelected: ue,
448
- onSelectAll: ve,
449
- onToggleSelection: Q,
450
- onAddVisual: _,
451
- onOpenVisual: ne,
446
+ allFilteredSelected: ye,
447
+ someFilteredSelected: he,
448
+ onSelectAll: Ce,
449
+ onToggleSelection: Z,
450
+ onAddVisual: M,
451
+ onOpenVisual: se,
452
452
  onEditDetails: h,
453
453
  onShareVisual: d,
454
- onDeleteVisual: (v) => {
455
- x(v), g(!0);
454
+ onDeleteVisual: (x) => {
455
+ I(x), b(!0);
456
456
  },
457
- onDuplicateVisual: fe,
458
- duplicatingId: D,
459
- isDeleting: oe,
460
- isConsoleMode: y
457
+ onDuplicateVisual: be,
458
+ duplicatingId: y,
459
+ isDeleting: ie,
460
+ isConsoleMode: v
461
461
  }
462
462
  ) }),
463
463
  /* @__PURE__ */ r("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
464
- /* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5", children: s.size > 0 && /* @__PURE__ */ r($, { children: [
464
+ /* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5", children: s.size > 0 && /* @__PURE__ */ r(j, { children: [
465
465
  /* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: [
466
466
  /* @__PURE__ */ t("span", { className: "font-medium tabular-nums text-foreground", children: s.size }),
467
467
  " ",
468
468
  "selected"
469
469
  ] }),
470
470
  /* @__PURE__ */ t(
471
- T,
471
+ R,
472
472
  {
473
473
  size: "xs",
474
474
  variant: "ghost",
475
- onClick: () => c(/* @__PURE__ */ new Set()),
475
+ onClick: () => u(/* @__PURE__ */ new Set()),
476
476
  children: "Clear"
477
477
  }
478
478
  ),
479
479
  /* @__PURE__ */ r(
480
- T,
480
+ R,
481
481
  {
482
482
  size: "xs",
483
483
  variant: "outline",
484
- onClick: ye,
485
- disabled: le.length !== 1 || Le.length !== 1,
484
+ onClick: we,
485
+ disabled: de.length !== 1 || Re.length !== 1,
486
486
  children: [
487
- /* @__PURE__ */ t(It, { className: "h-3.5 w-3.5" }),
487
+ /* @__PURE__ */ t(Ft, { className: "h-3.5 w-3.5" }),
488
488
  "Share"
489
489
  ]
490
490
  }
491
491
  ),
492
492
  /* @__PURE__ */ r(
493
- T,
493
+ R,
494
494
  {
495
495
  size: "xs",
496
496
  variant: "outline",
497
497
  className: "text-destructive hover:text-destructive",
498
- onClick: Be,
499
- disabled: ee.length === 0,
498
+ onClick: Ue,
499
+ disabled: te.length === 0,
500
500
  children: [
501
- /* @__PURE__ */ t(ze, { className: "h-3.5 w-3.5" }),
501
+ /* @__PURE__ */ t(We, { className: "h-3.5 w-3.5" }),
502
502
  "Delete ",
503
- ee.length || s.size
503
+ te.length || s.size
504
504
  ]
505
505
  }
506
506
  )
507
507
  ] }) }),
508
508
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
509
509
  /* @__PURE__ */ t(
510
- T,
510
+ R,
511
511
  {
512
512
  size: "xs",
513
513
  variant: "outline",
@@ -516,13 +516,13 @@ function _n({
516
516
  }
517
517
  ),
518
518
  /* @__PURE__ */ r(
519
- T,
519
+ R,
520
520
  {
521
521
  size: "xs",
522
522
  onClick: O,
523
523
  disabled: s.size === 0,
524
524
  children: [
525
- /* @__PURE__ */ t(Dt, { className: "h-3.5 w-3.5" }),
525
+ /* @__PURE__ */ t(Et, { className: "h-3.5 w-3.5" }),
526
526
  s.size === 0 ? "Add to dashboard" : `Add ${s.size} visual${s.size === 1 ? "" : "s"}`
527
527
  ]
528
528
  }
@@ -533,64 +533,64 @@ function _n({
533
533
  }
534
534
  ) }),
535
535
  /* @__PURE__ */ t(
536
- Na,
536
+ Da,
537
537
  {
538
- open: m,
539
- onOpenChange: l,
540
- onSubmit: F,
541
- isCreating: Ae
538
+ open: p,
539
+ onOpenChange: o,
540
+ onSubmit: L,
541
+ isCreating: Fe
542
542
  }
543
543
  ),
544
- u && /* @__PURE__ */ t(
545
- nr,
544
+ c && /* @__PURE__ */ t(
545
+ or,
546
546
  {
547
- resource: u,
548
- resourceType: sr.VISUAL,
547
+ resource: c,
548
+ resourceType: ir.VISUAL,
549
549
  onClose: () => d(null)
550
550
  }
551
551
  ),
552
- p && /* @__PURE__ */ t(
553
- or,
552
+ m && /* @__PURE__ */ t(
553
+ lr,
554
554
  {
555
- open: !!p,
555
+ open: !!m,
556
556
  resourceLabel: "Visual",
557
- initialTitle: p.title || "",
558
- initialDescription: p.description || "",
557
+ initialTitle: m.title || "",
558
+ initialDescription: m.description || "",
559
559
  onClose: () => h(null),
560
- onSave: Ce,
561
- isSaving: ie(p.id)
560
+ onSave: Ne,
561
+ isSaving: le(m.id)
562
562
  }
563
563
  ),
564
564
  /* @__PURE__ */ t(
565
- at,
565
+ ot,
566
566
  {
567
567
  open: f,
568
- onOpenChange: (v) => {
569
- !v && oe || (g(v), v || x(null));
568
+ onOpenChange: (x) => {
569
+ !x && ie || (b(x), x || I(null));
570
570
  },
571
- children: /* @__PURE__ */ r(nt, { children: [
572
- /* @__PURE__ */ r(st, { children: [
573
- /* @__PURE__ */ r(ot, { children: [
571
+ children: /* @__PURE__ */ r(it, { children: [
572
+ /* @__PURE__ */ r(lt, { children: [
573
+ /* @__PURE__ */ r(dt, { children: [
574
574
  "Delete ",
575
- we,
575
+ Se,
576
576
  " visual",
577
- we === 1 ? "" : "s",
577
+ Se === 1 ? "" : "s",
578
578
  "?"
579
579
  ] }),
580
- /* @__PURE__ */ t(it, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
580
+ /* @__PURE__ */ t(ct, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
581
581
  ] }),
582
- /* @__PURE__ */ r(lt, { children: [
583
- /* @__PURE__ */ t(dt, { disabled: oe, children: "Cancel" }),
582
+ /* @__PURE__ */ r(ut, { children: [
583
+ /* @__PURE__ */ t(ht, { disabled: ie, children: "Cancel" }),
584
584
  /* @__PURE__ */ r(
585
- Ft,
585
+ Tt,
586
586
  {
587
- onClick: (v) => {
588
- v.preventDefault(), Ye();
587
+ onClick: (x) => {
588
+ x.preventDefault(), Qe();
589
589
  },
590
- disabled: oe || we === 0,
590
+ disabled: ie || Se === 0,
591
591
  children: [
592
- oe ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(ze, { className: "h-3.5 w-3.5" }),
593
- oe ? "Deleting..." : "Delete"
592
+ ie ? /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(We, { className: "h-3.5 w-3.5" }),
593
+ ie ? "Deleting..." : "Delete"
594
594
  ]
595
595
  }
596
596
  )
@@ -600,30 +600,30 @@ function _n({
600
600
  )
601
601
  ] });
602
602
  }
603
- function Ea({
603
+ function Ia({
604
604
  visuals: e,
605
605
  selectedIds: a,
606
- allFilteredSelected: o,
606
+ allFilteredSelected: i,
607
607
  someFilteredSelected: n,
608
- onSelectAll: i,
608
+ onSelectAll: l,
609
609
  onToggleSelection: s,
610
- onAddVisual: c,
611
- onOpenVisual: m,
612
- onEditDetails: l,
613
- onShareVisual: u,
610
+ onAddVisual: u,
611
+ onOpenVisual: p,
612
+ onEditDetails: o,
613
+ onShareVisual: c,
614
614
  onDeleteVisual: d,
615
- onDuplicateVisual: p,
615
+ onDuplicateVisual: m,
616
616
  duplicatingId: h,
617
617
  isDeleting: f,
618
- isConsoleMode: g
618
+ isConsoleMode: b
619
619
  }) {
620
620
  return /* @__PURE__ */ r("div", { className: "min-w-[48rem]", children: [
621
621
  /* @__PURE__ */ r("div", { className: "grid h-9 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/60 px-3 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: [
622
622
  /* @__PURE__ */ t(
623
- ct,
623
+ mt,
624
624
  {
625
- checked: o ? !0 : n ? "indeterminate" : !1,
626
- onCheckedChange: i,
625
+ checked: i ? !0 : n ? "indeterminate" : !1,
626
+ onCheckedChange: l,
627
627
  "aria-label": "Select all visuals"
628
628
  }
629
629
  ),
@@ -635,56 +635,56 @@ function Ea({
635
635
  /* @__PURE__ */ t("span", { className: "text-right", children: "Actions" })
636
636
  ] }),
637
637
  e.map((k) => /* @__PURE__ */ t(
638
- Aa,
638
+ La,
639
639
  {
640
640
  visual: k,
641
641
  selected: a.has(k.id),
642
642
  onToggleSelection: s,
643
- onAddVisual: c,
644
- onOpenVisual: m,
645
- onEditDetails: l,
646
- onShareVisual: u,
643
+ onAddVisual: u,
644
+ onOpenVisual: p,
645
+ onEditDetails: o,
646
+ onShareVisual: c,
647
647
  onDeleteVisual: d,
648
- onDuplicateVisual: p,
648
+ onDuplicateVisual: m,
649
649
  duplicatingId: h,
650
650
  isDeleting: f,
651
- isConsoleMode: g
651
+ isConsoleMode: b
652
652
  },
653
653
  k.id
654
654
  ))
655
655
  ] });
656
656
  }
657
- function Aa({
657
+ function La({
658
658
  visual: e,
659
659
  selected: a,
660
- onToggleSelection: o,
660
+ onToggleSelection: i,
661
661
  onAddVisual: n,
662
- onOpenVisual: i,
662
+ onOpenVisual: l,
663
663
  onEditDetails: s,
664
- onShareVisual: c,
665
- onDeleteVisual: m,
666
- onDuplicateVisual: l,
667
- duplicatingId: u,
664
+ onShareVisual: u,
665
+ onDeleteVisual: p,
666
+ onDuplicateVisual: o,
667
+ duplicatingId: c,
668
668
  isDeleting: d,
669
- isConsoleMode: p
669
+ isConsoleMode: m
670
670
  }) {
671
- var g;
672
- const h = Da(e.kind), f = () => {
671
+ var b;
672
+ const h = Ea(e.kind), f = () => {
673
673
  n(e);
674
674
  };
675
675
  return /* @__PURE__ */ r(
676
676
  "div",
677
677
  {
678
- className: G(
678
+ className: X(
679
679
  "group grid min-h-12 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/50 px-3 text-[13px] hover:bg-muted/50",
680
680
  a && "bg-muted/70"
681
681
  ),
682
682
  children: [
683
683
  /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
684
- ct,
684
+ mt,
685
685
  {
686
686
  checked: a,
687
- onCheckedChange: () => o(e.id),
687
+ onCheckedChange: () => i(e.id),
688
688
  "aria-label": `Select ${e.title || "visual"}`
689
689
  }
690
690
  ) }),
@@ -706,7 +706,7 @@ function Aa({
706
706
  children: e.title || "Untitled Visual"
707
707
  }
708
708
  ),
709
- ((g = e.description) == null ? void 0 : g.trim()) && /* @__PURE__ */ t(
709
+ ((b = e.description) == null ? void 0 : b.trim()) && /* @__PURE__ */ t(
710
710
  "div",
711
711
  {
712
712
  className: "truncate text-[11px] text-muted-foreground",
@@ -719,122 +719,122 @@ function Aa({
719
719
  }
720
720
  ),
721
721
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
722
- /* @__PURE__ */ t("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: Sa(e, p) }),
723
- /* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: gt(e, p) })
722
+ /* @__PURE__ */ t("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: ka(e, m) }),
723
+ /* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: xt(e, m) })
724
724
  ] }),
725
- /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: zt(e.updatedAt) }),
726
- /* @__PURE__ */ t(ka, { visual: e }),
725
+ /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: jt(e.updatedAt) }),
726
+ /* @__PURE__ */ t(Aa, { visual: e }),
727
727
  /* @__PURE__ */ t("span", { className: "text-right tabular-nums text-muted-foreground", children: e.ownership.sharedCount > 0 ? e.ownership.sharedCount : "—" }),
728
728
  /* @__PURE__ */ t(
729
- Ia,
729
+ Fa,
730
730
  {
731
731
  visual: e,
732
- onOpenVisual: i,
732
+ onOpenVisual: l,
733
733
  onEditDetails: s,
734
- onShareVisual: c,
735
- onDeleteVisual: m,
736
- onDuplicateVisual: l,
737
- duplicatingId: u,
734
+ onShareVisual: u,
735
+ onDeleteVisual: p,
736
+ onDuplicateVisual: o,
737
+ duplicatingId: c,
738
738
  isDeleting: d,
739
- isConsoleMode: p
739
+ isConsoleMode: m
740
740
  }
741
741
  )
742
742
  ]
743
743
  }
744
744
  );
745
745
  }
746
- function Ia({
746
+ function Fa({
747
747
  visual: e,
748
748
  onOpenVisual: a,
749
- onEditDetails: o,
749
+ onEditDetails: i,
750
750
  onShareVisual: n,
751
- onDeleteVisual: i,
751
+ onDeleteVisual: l,
752
752
  onDuplicateVisual: s,
753
- duplicatingId: c,
754
- isDeleting: m,
755
- isConsoleMode: l
753
+ duplicatingId: u,
754
+ isDeleting: p,
755
+ isConsoleMode: o
756
756
  }) {
757
757
  return /* @__PURE__ */ r(
758
758
  "div",
759
759
  {
760
760
  className: "flex items-center justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
761
- onClick: (u) => u.stopPropagation(),
761
+ onClick: (c) => c.stopPropagation(),
762
762
  children: [
763
763
  /* @__PURE__ */ t(
764
- T,
764
+ R,
765
765
  {
766
766
  size: "xs",
767
767
  variant: "ghost",
768
768
  className: "w-7 px-0",
769
769
  onClick: () => a(e),
770
770
  "aria-label": "Edit visual",
771
- children: /* @__PURE__ */ t(Qe, { className: "h-3.5 w-3.5" })
771
+ children: /* @__PURE__ */ t(Je, { className: "h-3.5 w-3.5" })
772
772
  }
773
773
  ),
774
- /* @__PURE__ */ r(We, { modal: !1, children: [
775
- /* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ t(
776
- T,
774
+ /* @__PURE__ */ r(Ge, { modal: !1, children: [
775
+ /* @__PURE__ */ t(Xe, { asChild: !0, children: /* @__PURE__ */ t(
776
+ R,
777
777
  {
778
778
  size: "xs",
779
779
  variant: "ghost",
780
780
  className: "w-7 px-0",
781
781
  "aria-label": "More actions",
782
- children: /* @__PURE__ */ t(Lt, { className: "h-3.5 w-3.5" })
782
+ children: /* @__PURE__ */ t(Bt, { className: "h-3.5 w-3.5" })
783
783
  }
784
784
  ) }),
785
785
  /* @__PURE__ */ r(
786
- qe,
786
+ Ke,
787
787
  {
788
788
  align: "end",
789
789
  className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
790
790
  children: [
791
- /* @__PURE__ */ r(q, { onClick: () => a(e), children: [
792
- /* @__PURE__ */ t(Qe, { className: "h-3.5 w-3.5" }),
791
+ /* @__PURE__ */ r(G, { onClick: () => a(e), children: [
792
+ /* @__PURE__ */ t(Je, { className: "h-3.5 w-3.5" }),
793
793
  "Edit visual"
794
794
  ] }),
795
795
  /* @__PURE__ */ r(
796
- q,
796
+ G,
797
797
  {
798
798
  onClick: () => s(e.id),
799
- disabled: c === e.id,
799
+ disabled: u === e.id,
800
800
  children: [
801
- c === e.id ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(dr, { className: "h-3.5 w-3.5" }),
802
- c === e.id ? "Duplicating..." : "Duplicate"
801
+ u === e.id ? /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(ur, { className: "h-3.5 w-3.5" }),
802
+ u === e.id ? "Duplicating..." : "Duplicate"
803
803
  ]
804
804
  }
805
805
  ),
806
- e.permissions.canEdit && /* @__PURE__ */ r(q, { onClick: () => o(e), children: [
807
- /* @__PURE__ */ t(Qe, { className: "h-3.5 w-3.5" }),
806
+ e.permissions.canEdit && /* @__PURE__ */ r(G, { onClick: () => i(e), children: [
807
+ /* @__PURE__ */ t(Je, { className: "h-3.5 w-3.5" }),
808
808
  "Edit details"
809
809
  ] }),
810
- e.permissions.canShare && /* @__PURE__ */ r(q, { onClick: () => n(e), children: [
811
- /* @__PURE__ */ t(It, { className: "h-3.5 w-3.5" }),
810
+ e.permissions.canShare && /* @__PURE__ */ r(G, { onClick: () => n(e), children: [
811
+ /* @__PURE__ */ t(Ft, { className: "h-3.5 w-3.5" }),
812
812
  "Share"
813
813
  ] }),
814
- e.permissions.canDelete && /* @__PURE__ */ r($, { children: [
815
- /* @__PURE__ */ t($e, {}),
814
+ e.permissions.canDelete && /* @__PURE__ */ r(j, { children: [
815
+ /* @__PURE__ */ t(He, {}),
816
816
  /* @__PURE__ */ r(
817
- q,
817
+ G,
818
818
  {
819
819
  className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
820
- onClick: () => i(e),
821
- disabled: m,
820
+ onClick: () => l(e),
821
+ disabled: p,
822
822
  children: [
823
- /* @__PURE__ */ t(ze, { className: "h-3.5 w-3.5" }),
824
- m ? "Deleting..." : "Delete"
823
+ /* @__PURE__ */ t(We, { className: "h-3.5 w-3.5" }),
824
+ p ? "Deleting..." : "Delete"
825
825
  ]
826
826
  }
827
827
  )
828
828
  ] }),
829
- /* @__PURE__ */ t($e, {}),
829
+ /* @__PURE__ */ t(He, {}),
830
830
  /* @__PURE__ */ r("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
831
- $t(e, l) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
832
- /* @__PURE__ */ t(cr, { className: "h-3 w-3" }),
833
- /* @__PURE__ */ t("span", { className: "truncate", children: gt(e, l) })
831
+ Wt(e, o) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
832
+ /* @__PURE__ */ t(hr, { className: "h-3 w-3" }),
833
+ /* @__PURE__ */ t("span", { className: "truncate", children: xt(e, o) })
834
834
  ] }),
835
835
  /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
836
- /* @__PURE__ */ t(ur, { className: "h-3 w-3" }),
837
- /* @__PURE__ */ t("span", { children: zt(e.updatedAt) })
836
+ /* @__PURE__ */ t(mr, { className: "h-3 w-3" }),
837
+ /* @__PURE__ */ t("span", { children: jt(e.updatedAt) })
838
838
  ] })
839
839
  ] })
840
840
  ]
@@ -845,63 +845,63 @@ function Ia({
845
845
  }
846
846
  );
847
847
  }
848
- function On(e, a, o = !1) {
849
- const n = L((u) => u.dashboard), i = L(
850
- (u) => u.isDashboardEditing
851
- ), s = L(
852
- (u) => u.onDashboardLifecycleEvent
853
- ), c = W(() => {
854
- const u = L.getState().dashboard;
855
- return a || !e || !u || u.id !== e.id ? !1 : Ve(u) !== Ve(e);
848
+ function qn(e, a, i = !1) {
849
+ const n = T((c) => c.dashboard), l = T(
850
+ (c) => c.isDashboardEditing
851
+ ), s = T(
852
+ (c) => c.onDashboardLifecycleEvent
853
+ ), u = H(() => {
854
+ const c = T.getState().dashboard;
855
+ return a || !e || !c || c.id !== e.id ? !1 : Me(c) !== Me(e);
856
856
  }, [e, a]);
857
- xt(() => (L.setState({ checkUnsavedDashboardChanges: c }), () => {
858
- L.getState().checkUnsavedDashboardChanges === c && L.setState({ checkUnsavedDashboardChanges: null });
859
- }), [c]);
860
- const m = X(() => !o || a || !n || i && (!e || n.id !== e.id) ? null : {
857
+ yt(() => (T.setState({ checkUnsavedDashboardChanges: u }), () => {
858
+ T.getState().checkUnsavedDashboardChanges === u && T.setState({ checkUnsavedDashboardChanges: null });
859
+ }), [u]);
860
+ const p = Q(() => !i || a || !n || l && (!e || n.id !== e.id) ? null : {
861
861
  dashboardId: n.id,
862
- dirty: i && e ? Ve(n) !== Ve(e) : !1
862
+ dirty: l && e ? Me(n) !== Me(e) : !1
863
863
  }, [
864
- i,
864
+ l,
865
865
  a,
866
- o,
866
+ i,
867
867
  e,
868
868
  n
869
- ]), l = ce(null);
870
- return xt(() => {
871
- if (!s || !m) {
872
- l.current = null;
869
+ ]), o = ue(null);
870
+ return yt(() => {
871
+ if (!s || !p) {
872
+ o.current = null;
873
873
  return;
874
874
  }
875
- const u = l.current;
876
- (u == null ? void 0 : u.callback) === s && u.dashboardId === m.dashboardId && u.dirty === m.dirty || (l.current = {
875
+ const c = o.current;
876
+ (c == null ? void 0 : c.callback) === s && c.dashboardId === p.dashboardId && c.dirty === p.dirty || (o.current = {
877
877
  callback: s,
878
- dashboardId: m.dashboardId,
879
- dirty: m.dirty
878
+ dashboardId: p.dashboardId,
879
+ dirty: p.dirty
880
880
  }, s({
881
881
  type: "dashboard:dirty-state",
882
- dashboardId: m.dashboardId,
883
- payload: { dirty: m.dirty }
882
+ dashboardId: p.dashboardId,
883
+ payload: { dirty: p.dirty }
884
884
  }));
885
- }, [m, s]), c;
885
+ }, [p, s]), u;
886
886
  }
887
- function Fa({
887
+ function Ta({
888
888
  open: e,
889
889
  onOpenChange: a,
890
- isLibraryVisual: o,
890
+ isLibraryVisual: i,
891
891
  currentVisualName: n,
892
- isSaving: i = !1,
892
+ isSaving: l = !1,
893
893
  destinationMode: s = "both",
894
- onConfirm: c
894
+ onConfirm: u
895
895
  }) {
896
- const [m, l] = A(
897
- o && n ? `Copy of ${n}` : n || ""
898
- ), [u, d] = A("");
899
- Nt.useEffect(() => {
900
- e && (l(
901
- o && n ? `Copy of ${n}` : n || ""
896
+ const [p, o] = E(
897
+ i && n ? `Copy of ${n}` : n || ""
898
+ ), [c, d] = E("");
899
+ Dt.useEffect(() => {
900
+ e && (o(
901
+ i && n ? `Copy of ${n}` : n || ""
902
902
  ), d(""));
903
- }, [e, o, n]);
904
- const p = !!m.trim(), h = s === "local" ? {
903
+ }, [e, i, n]);
904
+ const m = !!p.trim(), h = s === "local" ? {
905
905
  saveToLibrary: !1,
906
906
  saveToCurrentDashboard: !0,
907
907
  badgeType: "local",
@@ -920,19 +920,19 @@ function Fa({
920
920
  description: "Creates a new library visual and adds a linked copy to this dashboard.",
921
921
  actionLabel: "Save Copy as Linked Visual"
922
922
  }, f = () => {
923
- !p || i || c({
924
- name: m.trim(),
925
- description: u.trim() || void 0,
923
+ !m || l || u({
924
+ name: p.trim(),
925
+ description: c.trim() || void 0,
926
926
  saveToLibrary: h.saveToLibrary,
927
927
  saveToCurrentDashboard: h.saveToCurrentDashboard
928
928
  });
929
929
  };
930
- return /* @__PURE__ */ t(Se, { open: e, onOpenChange: a, children: /* @__PURE__ */ r(De, { className: "sm:max-w-[500px]", children: [
931
- /* @__PURE__ */ r(ut, { children: [
932
- /* @__PURE__ */ r(ke, { className: "flex items-center gap-2", children: [
930
+ return /* @__PURE__ */ t(Ee, { open: e, onOpenChange: a, children: /* @__PURE__ */ r(Ae, { className: "sm:max-w-[500px]", children: [
931
+ /* @__PURE__ */ r(pt, { children: [
932
+ /* @__PURE__ */ r(Ie, { className: "flex items-center gap-2", children: [
933
933
  /* @__PURE__ */ t("span", { children: "Save Visual As" }),
934
934
  h.badgeType !== "local" && /* @__PURE__ */ t(
935
- sa,
935
+ la,
936
936
  {
937
937
  type: h.badgeType,
938
938
  showLabel: !0,
@@ -940,77 +940,77 @@ function Fa({
940
940
  }
941
941
  )
942
942
  ] }),
943
- /* @__PURE__ */ t(ht, { children: h.description })
943
+ /* @__PURE__ */ t(ft, { children: h.description })
944
944
  ] }),
945
945
  /* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
946
946
  /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
947
- /* @__PURE__ */ t(Ne, { htmlFor: "name", children: "Name" }),
947
+ /* @__PURE__ */ t(ke, { htmlFor: "name", children: "Name" }),
948
948
  /* @__PURE__ */ t(
949
- et,
949
+ at,
950
950
  {
951
951
  id: "name",
952
- value: m,
953
- onChange: (g) => l(g.target.value),
952
+ value: p,
953
+ onChange: (b) => o(b.target.value),
954
954
  placeholder: "Enter visual name",
955
- disabled: i
955
+ disabled: l
956
956
  }
957
957
  )
958
958
  ] }),
959
959
  /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
960
- /* @__PURE__ */ t(Ne, { htmlFor: "description", children: "Description (optional)" }),
960
+ /* @__PURE__ */ t(ke, { htmlFor: "description", children: "Description (optional)" }),
961
961
  /* @__PURE__ */ t(
962
- hr,
962
+ pr,
963
963
  {
964
964
  id: "description",
965
- value: u,
966
- onChange: (g) => d(g.target.value),
965
+ value: c,
966
+ onChange: (b) => d(b.target.value),
967
967
  placeholder: "Enter visual description",
968
968
  rows: 3,
969
- disabled: i
969
+ disabled: l
970
970
  }
971
971
  )
972
972
  ] })
973
973
  ] }),
974
- /* @__PURE__ */ r(mr, { children: [
974
+ /* @__PURE__ */ r(fr, { children: [
975
975
  /* @__PURE__ */ t(
976
- T,
976
+ R,
977
977
  {
978
978
  variant: "outline",
979
979
  onClick: () => a(!1),
980
- disabled: i,
980
+ disabled: l,
981
981
  children: "Cancel"
982
982
  }
983
983
  ),
984
- /* @__PURE__ */ r(T, { onClick: f, disabled: !p || i, children: [
985
- i && /* @__PURE__ */ t(re, { className: "mr-2 h-4 w-4 animate-spin" }),
984
+ /* @__PURE__ */ r(R, { onClick: f, disabled: !m || l, children: [
985
+ l && /* @__PURE__ */ t(ae, { className: "mr-2 h-4 w-4 animate-spin" }),
986
986
  h.actionLabel
987
987
  ] })
988
988
  ] })
989
989
  ] }) });
990
990
  }
991
- function La() {
992
- const [e, a] = A(!1), [o, n] = A(!1), [i, s] = A(null), [c, m] = A(null), l = me((b) => b.frame), u = me((b) => b.card), d = pr(), p = L((b) => b.selectedSheetId), h = L((b) => b.dashboard), { getUpdatedFrame: f } = ft(), { selectVisual: g } = At(), { addFrame: k, setSelectedFrameId: x, setIsVisualEditing: D } = be(), S = Bt(), C = !!(l != null && l.visualId), w = (() => {
993
- var b, y;
994
- return ((b = l == null ? void 0 : l.cards) == null ? void 0 : b.length) === 1 && ((y = l.cards[0]) != null && y.title) ? l.cards[0].title : d != null && d.title ? d.title : (u == null ? void 0 : u.title) || "Untitled Visual";
995
- })(), E = fr((b) => {
996
- b != null && b.id && (g(b), o && i && c && p && (async () => {
991
+ function Ba() {
992
+ const [e, a] = E(!1), [i, n] = E(!1), [l, s] = E(null), [u, p] = E(null), o = fe((g) => g.frame), c = fe((g) => g.card), d = gr(), m = T((g) => g.selectedSheetId), h = T((g) => g.dashboard), { getUpdatedFrame: f } = bt(), { selectVisual: b } = Lt(), { addFrame: k, setSelectedFrameId: I, setIsVisualEditing: y } = ve(), S = Rt(), D = !!(o != null && o.visualId), w = (() => {
993
+ var g, v;
994
+ return ((g = o == null ? void 0 : o.cards) == null ? void 0 : g.length) === 1 && ((v = o.cards[0]) != null && v.title) ? o.cards[0].title : d != null && d.title ? d.title : (c == null ? void 0 : c.title) || "Untitled Visual";
995
+ })(), C = br((g) => {
996
+ g != null && g.id && (b(g), i && l && u && m && (async () => {
997
997
  try {
998
- const y = {
999
- ...i,
1000
- id: yt(),
1001
- visualId: b.id
998
+ const v = {
999
+ ...l,
1000
+ id: wt(),
1001
+ visualId: g.id
1002
1002
  // Link to the newly created library visual
1003
1003
  };
1004
- k(p, y, {
1004
+ k(m, v, {
1005
1005
  position: "end",
1006
- semanticExecutionPayload: c
1007
- }), x(y.id), n(!1), s(null), m(null), D(!1);
1008
- } catch (y) {
1006
+ semanticExecutionPayload: u
1007
+ }), I(v.id), n(!1), s(null), p(null), y(!1);
1008
+ } catch (v) {
1009
1009
  console.error(
1010
1010
  "Failed to promote semantic metadata for saved visual:",
1011
- y
1012
- ), z.error(
1013
- y instanceof Error ? y.message : "Failed to prepare semantic metadata for the saved visual"
1011
+ v
1012
+ ), $.error(
1013
+ v instanceof Error ? v.message : "Failed to prepare semantic metadata for the saved visual"
1014
1014
  );
1015
1015
  }
1016
1016
  })(), a(!1));
@@ -1018,193 +1018,193 @@ function La() {
1018
1018
  return {
1019
1019
  saveAsDialogOpen: e,
1020
1020
  setSaveAsDialogOpen: a,
1021
- handleSaveAs: async (b) => {
1022
- if (!p) {
1023
- z.error("No sheet selected");
1021
+ handleSaveAs: async (g) => {
1022
+ if (!m) {
1023
+ $.error("No sheet selected");
1024
1024
  return;
1025
1025
  }
1026
- const y = f(), I = y.cards.length === 1 ? {
1027
- ...y,
1028
- cards: y.cards.map((H) => ({
1029
- ...H,
1030
- title: b.name
1026
+ const v = f(), A = v.cards.length === 1 ? {
1027
+ ...v,
1028
+ cards: v.cards.map((q) => ({
1029
+ ...q,
1030
+ title: g.name
1031
1031
  // Use visual name as card title
1032
1032
  }))
1033
- } : y;
1034
- if (b.saveToLibrary) {
1035
- let H = null;
1036
- if (b.saveToCurrentDashboard)
1033
+ } : v;
1034
+ if (g.saveToLibrary) {
1035
+ let q = null;
1036
+ if (g.saveToCurrentDashboard)
1037
1037
  try {
1038
- H = await S(I, {
1039
- previousFrame: tt(h, I.id)
1038
+ q = await S(A, {
1039
+ previousFrame: nt(h, A.id)
1040
1040
  });
1041
1041
  } catch (P) {
1042
1042
  console.error(
1043
1043
  "Failed to prepare semantic metadata before saving visual:",
1044
1044
  P
1045
- ), z.error(
1045
+ ), $.error(
1046
1046
  P instanceof Error ? P.message : "Failed to prepare semantic metadata for the saved visual"
1047
1047
  );
1048
1048
  return;
1049
1049
  }
1050
- n(b.saveToCurrentDashboard), s(I), m(H);
1051
- const F = {
1052
- title: b.name,
1053
- description: b.description,
1054
- frameObject: I,
1050
+ n(g.saveToCurrentDashboard), s(A), p(q);
1051
+ const L = {
1052
+ title: g.name,
1053
+ description: g.description,
1054
+ frameObject: A,
1055
1055
  // Card title synced for single-card frames
1056
1056
  isPrivate: !1
1057
1057
  };
1058
- E.mutate(F);
1059
- } else if (b.saveToCurrentDashboard) {
1060
- const H = {
1061
- ...I,
1058
+ C.mutate(L);
1059
+ } else if (g.saveToCurrentDashboard) {
1060
+ const q = {
1061
+ ...A,
1062
1062
  // Card title already synced
1063
- id: yt(),
1063
+ id: wt(),
1064
1064
  visualId: void 0
1065
1065
  // Explicitly no visualId for local visuals
1066
1066
  };
1067
1067
  try {
1068
- const F = await S(I, {
1069
- previousFrame: tt(h, I.id)
1068
+ const L = await S(A, {
1069
+ previousFrame: nt(h, A.id)
1070
1070
  });
1071
- k(p, H, {
1071
+ k(m, q, {
1072
1072
  position: "end",
1073
- semanticExecutionPayload: F
1074
- }), x(H.id), z.success("Visual saved to dashboard"), a(!1), D(!1);
1075
- } catch (F) {
1076
- console.error("Failed to save visual to dashboard:", F), z.error(
1077
- F instanceof Error ? F.message : "Failed to prepare semantic metadata for the visual"
1073
+ semanticExecutionPayload: L
1074
+ }), I(q.id), $.success("Visual saved to dashboard"), a(!1), y(!1);
1075
+ } catch (L) {
1076
+ console.error("Failed to save visual to dashboard:", L), $.error(
1077
+ L instanceof Error ? L.message : "Failed to prepare semantic metadata for the visual"
1078
1078
  );
1079
1079
  }
1080
1080
  }
1081
1081
  },
1082
- isLibraryVisual: C,
1082
+ isLibraryVisual: D,
1083
1083
  currentVisualName: w,
1084
- isSaving: E.isPending
1084
+ isSaving: C.isPending
1085
1085
  };
1086
1086
  }
1087
- function zn(e = {}) {
1088
- const { isInspectionMode: a } = gr(), o = me((F) => F.frame), n = me((F) => F.editorContext), i = br((F) => F.selectedVisual), s = L((F) => F.selectedFrameId), c = L((F) => F.selectedSheetId), m = L((F) => F.dashboard), { setIsVisualEditing: l, updateFrame: u } = be(), [d, p] = A(!1), [h, f] = A("both"), g = Bt(), k = (n == null ? void 0 : n.type) === "documentSection", x = !!(o != null && o.visualId || i != null && i.id), D = !!(o != null && o.visualId && s), S = x && !D, {
1089
- saveAsDialogOpen: C,
1087
+ function Gn(e = {}) {
1088
+ const { isInspectionMode: a } = xr(), i = fe((L) => L.frame), n = fe((L) => L.editorContext), l = vr((L) => L.selectedVisual), s = T((L) => L.selectedFrameId), u = T((L) => L.selectedSheetId), p = T((L) => L.dashboard), { setIsVisualEditing: o, updateFrame: c } = ve(), [d, m] = E(!1), [h, f] = E("both"), b = Rt(), k = (n == null ? void 0 : n.type) === "documentSection", I = !!(i != null && i.visualId || l != null && l.id), y = !!(i != null && i.visualId && s), S = I && !y, {
1089
+ saveAsDialogOpen: D,
1090
1090
  setSaveAsDialogOpen: w,
1091
- handleSaveAs: E,
1092
- isLibraryVisual: U,
1093
- currentVisualName: b,
1094
- isSaving: y
1095
- } = La(), { getUpdatedFrame: R } = ft();
1091
+ handleSaveAs: C,
1092
+ isLibraryVisual: F,
1093
+ currentVisualName: g,
1094
+ isSaving: v
1095
+ } = Ba(), { getUpdatedFrame: U } = bt();
1096
1096
  if (a)
1097
- return /* @__PURE__ */ r($, { children: [
1097
+ return /* @__PURE__ */ r(j, { children: [
1098
1098
  /* @__PURE__ */ t(
1099
- Xe,
1099
+ et,
1100
1100
  {
1101
1101
  className: "rounded-control",
1102
1102
  variant: "default"
1103
1103
  }
1104
1104
  ),
1105
- /* @__PURE__ */ t(Ze, {})
1105
+ /* @__PURE__ */ t(tt, {})
1106
1106
  ] });
1107
1107
  if (k)
1108
- return /* @__PURE__ */ r($, { children: [
1109
- /* @__PURE__ */ t(Xe, { className: "rounded-control", variant: "default" }),
1110
- /* @__PURE__ */ t(Ze, {})
1108
+ return /* @__PURE__ */ r(j, { children: [
1109
+ /* @__PURE__ */ t(et, { className: "rounded-control", variant: "default" }),
1110
+ /* @__PURE__ */ t(tt, {})
1111
1111
  ] });
1112
- const I = async () => {
1113
- if (!c) {
1114
- z.error("No sheet selected");
1112
+ const A = async () => {
1113
+ if (!u) {
1114
+ $.error("No sheet selected");
1115
1115
  return;
1116
1116
  }
1117
1117
  if (d) return;
1118
- p(!0);
1118
+ m(!0);
1119
1119
  const P = {
1120
- ...R(),
1120
+ ...U(),
1121
1121
  visualId: void 0
1122
- }, Z = tt(m, P.id);
1122
+ }, J = nt(p, P.id);
1123
1123
  try {
1124
- const ae = await g(P, {
1125
- previousFrame: Z
1124
+ const ne = await b(P, {
1125
+ previousFrame: J
1126
1126
  });
1127
- u(c, P, {
1128
- semanticExecutionPayload: ae
1127
+ c(u, P, {
1128
+ semanticExecutionPayload: ne
1129
1129
  });
1130
- } catch (ae) {
1131
- console.error("Failed to apply local semantic metadata:", ae), p(!1), z.error(
1132
- ae instanceof Error ? ae.message : "Failed to prepare semantic metadata for this visual"
1130
+ } catch (ne) {
1131
+ console.error("Failed to apply local semantic metadata:", ne), m(!1), $.error(
1132
+ ne instanceof Error ? ne.message : "Failed to prepare semantic metadata for this visual"
1133
1133
  );
1134
1134
  return;
1135
1135
  }
1136
1136
  setTimeout(() => {
1137
- p(!1), z.success("Changes applied. Visual is now local to this dashboard"), l(!1);
1137
+ m(!1), $.success("Changes applied. Visual is now local to this dashboard"), o(!1);
1138
1138
  }, 300);
1139
- }, H = (F) => {
1140
- f(F), w(!0);
1139
+ }, q = (L) => {
1140
+ f(L), w(!0);
1141
1141
  };
1142
- return /* @__PURE__ */ r($, { children: [
1142
+ return /* @__PURE__ */ r(j, { children: [
1143
1143
  /* @__PURE__ */ r("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
1144
- !x && /* @__PURE__ */ t(Xe, { className: "!rounded-none", variant: "default" }),
1145
- x && S && /* @__PURE__ */ t(oa, { className: "!rounded-none", variant: "default" }),
1146
- x && D && /* @__PURE__ */ t(ia, { className: "!rounded-none" }),
1147
- /* @__PURE__ */ r(We, { modal: !1, children: [
1148
- /* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ t(
1149
- T,
1144
+ !I && /* @__PURE__ */ t(et, { className: "!rounded-none", variant: "default" }),
1145
+ I && S && /* @__PURE__ */ t(da, { className: "!rounded-none", variant: "default" }),
1146
+ I && y && /* @__PURE__ */ t(ca, { className: "!rounded-none" }),
1147
+ /* @__PURE__ */ r(Ge, { modal: !1, children: [
1148
+ /* @__PURE__ */ t(Xe, { asChild: !0, children: /* @__PURE__ */ t(
1149
+ R,
1150
1150
  {
1151
1151
  variant: "default",
1152
1152
  size: "xs",
1153
1153
  className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
1154
1154
  "aria-label": "Open visual save options",
1155
- disabled: y || d,
1156
- children: /* @__PURE__ */ t(Mt, { className: "h-3.5 w-3.5" })
1155
+ disabled: v || d,
1156
+ children: /* @__PURE__ */ t(Ot, { className: "h-3.5 w-3.5" })
1157
1157
  }
1158
1158
  ) }),
1159
1159
  /* @__PURE__ */ r(
1160
- qe,
1160
+ Ke,
1161
1161
  {
1162
1162
  align: "end",
1163
1163
  className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
1164
1164
  children: [
1165
- D && /* @__PURE__ */ r($, { children: [
1165
+ y && /* @__PURE__ */ r(j, { children: [
1166
1166
  /* @__PURE__ */ r(
1167
- q,
1167
+ G,
1168
1168
  {
1169
- onClick: I,
1169
+ onClick: A,
1170
1170
  disabled: d,
1171
1171
  children: [
1172
- /* @__PURE__ */ t(Dt, { className: "h-3.5 w-3.5" }),
1172
+ /* @__PURE__ */ t(Et, { className: "h-3.5 w-3.5" }),
1173
1173
  d ? "Applying..." : "Apply Locally"
1174
1174
  ]
1175
1175
  }
1176
1176
  ),
1177
- /* @__PURE__ */ t($e, {})
1177
+ /* @__PURE__ */ t(He, {})
1178
1178
  ] }),
1179
1179
  /* @__PURE__ */ r(
1180
- q,
1180
+ G,
1181
1181
  {
1182
- onClick: () => H("local"),
1183
- disabled: y,
1182
+ onClick: () => q("local"),
1183
+ disabled: v,
1184
1184
  children: [
1185
- /* @__PURE__ */ t(ge, { className: "h-3.5 w-3.5" }),
1185
+ /* @__PURE__ */ t(xe, { className: "h-3.5 w-3.5" }),
1186
1186
  "Add to Dashboard (Local)"
1187
1187
  ]
1188
1188
  }
1189
1189
  ),
1190
1190
  /* @__PURE__ */ r(
1191
- q,
1191
+ G,
1192
1192
  {
1193
- onClick: () => H("library"),
1194
- disabled: y,
1193
+ onClick: () => q("library"),
1194
+ disabled: v,
1195
1195
  children: [
1196
- /* @__PURE__ */ t(la, { className: "h-3.5 w-3.5" }),
1196
+ /* @__PURE__ */ t(ua, { className: "h-3.5 w-3.5" }),
1197
1197
  "Save as Library Visual"
1198
1198
  ]
1199
1199
  }
1200
1200
  ),
1201
1201
  /* @__PURE__ */ r(
1202
- q,
1202
+ G,
1203
1203
  {
1204
- onClick: () => H("both"),
1205
- disabled: y,
1204
+ onClick: () => q("both"),
1205
+ disabled: v,
1206
1206
  children: [
1207
- /* @__PURE__ */ t(da, { className: "h-3.5 w-3.5" }),
1207
+ /* @__PURE__ */ t(ha, { className: "h-3.5 w-3.5" }),
1208
1208
  "Save Copy as Linked Visual"
1209
1209
  ]
1210
1210
  }
@@ -1214,87 +1214,87 @@ function zn(e = {}) {
1214
1214
  )
1215
1215
  ] })
1216
1216
  ] }),
1217
- /* @__PURE__ */ t(Ze, {}),
1217
+ /* @__PURE__ */ t(tt, {}),
1218
1218
  /* @__PURE__ */ t(
1219
- Fa,
1219
+ Ta,
1220
1220
  {
1221
- open: C,
1222
- onOpenChange: (F) => {
1223
- y || w(F);
1221
+ open: D,
1222
+ onOpenChange: (L) => {
1223
+ v || w(L);
1224
1224
  },
1225
- isLibraryVisual: U,
1226
- currentVisualName: b,
1227
- isSaving: y,
1225
+ isLibraryVisual: F,
1226
+ currentVisualName: g,
1227
+ isSaving: v,
1228
1228
  destinationMode: h,
1229
- onConfirm: E
1229
+ onConfirm: C
1230
1230
  }
1231
1231
  )
1232
1232
  ] });
1233
1233
  }
1234
- function $n({ className: e }) {
1235
- const a = me((d) => d.isDevMode), o = me((d) => d.card.type), n = L((d) => d.isVisualEditing), { setIsDevMode: i } = kt(), { config: s } = qt(xr).tokenProps, c = (s == null ? void 0 : s.showAdvancedMode) !== !1;
1236
- if (!n || !c || !ma(o))
1234
+ function Xn({ className: e }) {
1235
+ const a = fe((d) => d.isDevMode), i = fe((d) => d.card.type), n = T((d) => d.isVisualEditing), { setIsDevMode: l } = At(), { config: s } = Xt(yr).tokenProps, u = (s == null ? void 0 : s.showAdvancedMode) !== !1;
1236
+ if (!n || !u || !ga(i))
1237
1237
  return null;
1238
- const m = a ? ya : vr, l = a ? "Visual editor" : "SQL editor", u = a ? "Switch to visual editor" : "Switch to SQL editor";
1238
+ const p = a ? wa : Cr, o = a ? "Visual editor" : "SQL editor", c = a ? "Switch to visual editor" : "Switch to SQL editor";
1239
1239
  return /* @__PURE__ */ r(
1240
1240
  "button",
1241
1241
  {
1242
1242
  type: "button",
1243
- "aria-label": u,
1244
- title: u,
1245
- onClick: () => i(!a),
1246
- className: G(
1243
+ "aria-label": c,
1244
+ title: c,
1245
+ onClick: () => l(!a),
1246
+ className: X(
1247
1247
  "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",
1248
1248
  e
1249
1249
  ),
1250
1250
  children: [
1251
- /* @__PURE__ */ t(m, { className: "h-3 w-3 text-muted-foreground" }),
1252
- l
1251
+ /* @__PURE__ */ t(p, { className: "h-3 w-3 text-muted-foreground" }),
1252
+ o
1253
1253
  ]
1254
1254
  }
1255
1255
  );
1256
1256
  }
1257
- function jn({
1257
+ function Kn({
1258
1258
  open: e,
1259
1259
  onOpenChange: a,
1260
- onSave: o,
1260
+ onSave: i,
1261
1261
  onDiscard: n,
1262
- isSaving: i,
1262
+ isSaving: l,
1263
1263
  title: s = "Unsaved changes",
1264
- description: c = "You have unsaved changes to this dashboard. What would you like to do?",
1265
- cancelLabel: m = "Cancel",
1266
- discardLabel: l = "Discard changes",
1267
- saveLabel: u = "Save"
1264
+ description: u = "You have unsaved changes to this dashboard. What would you like to do?",
1265
+ cancelLabel: p = "Cancel",
1266
+ discardLabel: o = "Discard changes",
1267
+ saveLabel: c = "Save"
1268
1268
  }) {
1269
- return /* @__PURE__ */ t(at, { open: e, onOpenChange: (p) => {
1270
- !p && i || a(p);
1271
- }, children: /* @__PURE__ */ r(nt, { children: [
1272
- /* @__PURE__ */ r(st, { children: [
1273
- /* @__PURE__ */ t(ot, { children: s }),
1274
- /* @__PURE__ */ t(it, { children: c })
1275
- ] }),
1269
+ return /* @__PURE__ */ t(ot, { open: e, onOpenChange: (m) => {
1270
+ !m && l || a(m);
1271
+ }, children: /* @__PURE__ */ r(it, { children: [
1276
1272
  /* @__PURE__ */ r(lt, { children: [
1273
+ /* @__PURE__ */ t(dt, { children: s }),
1274
+ /* @__PURE__ */ t(ct, { children: u })
1275
+ ] }),
1276
+ /* @__PURE__ */ r(ut, { children: [
1277
1277
  /* @__PURE__ */ t(
1278
- T,
1278
+ R,
1279
1279
  {
1280
1280
  type: "button",
1281
1281
  size: "xs",
1282
1282
  onClick: n,
1283
- disabled: i,
1283
+ disabled: l,
1284
1284
  variant: "outline",
1285
1285
  className: "mr-auto text-destructive hover:border-destructive/40 hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",
1286
- children: l
1286
+ children: o
1287
1287
  }
1288
1288
  ),
1289
- /* @__PURE__ */ t(dt, { disabled: i, children: m }),
1290
- /* @__PURE__ */ t(T, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ r($, { children: [
1291
- /* @__PURE__ */ t(re, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
1289
+ /* @__PURE__ */ t(ht, { disabled: l, children: p }),
1290
+ /* @__PURE__ */ t(R, { type: "button", size: "xs", onClick: i, disabled: l, children: l ? /* @__PURE__ */ r(j, { children: [
1291
+ /* @__PURE__ */ t(ae, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
1292
1292
  "Saving..."
1293
- ] }) : u })
1293
+ ] }) : c })
1294
1294
  ] })
1295
1295
  ] }) });
1296
1296
  }
1297
- function bt(e, a) {
1297
+ function vt(e, a) {
1298
1298
  return {
1299
1299
  id: e.id,
1300
1300
  status: e.status,
@@ -1307,202 +1307,208 @@ function bt(e, a) {
1307
1307
  lastUpdatedAt: /* @__PURE__ */ new Date(),
1308
1308
  fileSize: e.fileSize,
1309
1309
  error: e.error,
1310
+ phase: e.phase,
1311
+ deadlineAt: e.deadlineAt ? new Date(e.deadlineAt) : void 0,
1310
1312
  // A refreshed result replaces prior authorization, including a failed URL fetch.
1311
1313
  downloadUrl: a
1312
1314
  };
1313
1315
  }
1314
- const Ba = 1e4, Ta = 15e3, Ua = 3e4, Ra = 3e4, Va = 12e4, Ct = 2 * 60 * 60 * 1e3;
1315
- function Pa(e) {
1316
+ const Ra = 15e3;
1317
+ function pe(e) {
1318
+ const a = new AbortController();
1319
+ let i;
1320
+ const n = new Promise((l, s) => {
1321
+ i = setTimeout(() => {
1322
+ a.abort(), s(new Error("Export request timed out."));
1323
+ }, Ra);
1324
+ });
1325
+ return Promise.race([e(a.signal), n]).finally(() => clearTimeout(i));
1326
+ }
1327
+ const Ua = 1e4, Va = 15e3, Pa = 3e4, _a = 3e4, Ma = 12e4, Oa = 5 * 6e4, za = 2 * 60 * 60 * 1e3;
1328
+ function $a(e) {
1329
+ return e.deadlineAt ? e.deadlineAt.getTime() + Oa : e.startedAt.getTime() + za;
1330
+ }
1331
+ function ja(e) {
1316
1332
  const a = Date.now() - e.getTime();
1317
- return a < Ra ? Ba : a < Va ? Ta : Ua;
1333
+ return a < _a ? Ua : a < Ma ? Va : Pa;
1318
1334
  }
1319
- function Wn() {
1320
- const { authToken: e, tokenProps: a } = Ge(), o = he((h) => h.activeExports), [n, i] = A(
1335
+ function Yn() {
1336
+ const { authToken: e, tokenProps: a } = Ye(), i = me((h) => h.activeExports), [n, l] = E(
1321
1337
  typeof document < "u" ? !document.hidden : !0
1322
- ), s = ce(null), c = ce(!1), m = ce(void 0), l = a == null ? void 0 : a.apiServiceUrl, u = e == null ? void 0 : e.accessToken, d = W(() => {
1323
- const h = he.getState().activeExports;
1338
+ ), s = ue(null), u = ue(!1), p = ue(void 0), o = a == null ? void 0 : a.apiServiceUrl, c = e == null ? void 0 : e.accessToken, d = H(() => {
1339
+ const h = me.getState().activeExports;
1324
1340
  return Array.from(h.values()).filter(
1325
- (f) => mt(f.status)
1341
+ (f) => De(f.status)
1326
1342
  );
1327
1343
  }, []);
1328
1344
  Y(() => {
1329
1345
  if (typeof document > "u") return;
1330
1346
  const h = () => {
1331
- i(!document.hidden);
1347
+ l(!document.hidden);
1332
1348
  };
1333
1349
  return document.addEventListener("visibilitychange", h), () => {
1334
1350
  document.removeEventListener("visibilitychange", h);
1335
1351
  };
1336
1352
  }, []);
1337
- const p = W(async () => {
1338
- if (!l || !u) {
1339
- c.current = !1;
1353
+ const m = H(async () => {
1354
+ if (!o || !c) {
1355
+ u.current = !1;
1340
1356
  return;
1341
1357
  }
1342
1358
  const h = d();
1343
1359
  if (h.length === 0) {
1344
- c.current = !1;
1360
+ u.current = !1;
1345
1361
  return;
1346
1362
  }
1347
- const f = Date.now(), g = h.filter(
1348
- (C) => f - C.startedAt.getTime() > Ct
1349
- );
1350
- if (g.length > 0) {
1351
- const { updateExport: C } = he.getState().actions;
1352
- for (const w of g)
1353
- C(w.id, {
1354
- status: "failed",
1355
- error: "Export timed out. Please try again or contact support.",
1356
- lastUpdatedAt: /* @__PURE__ */ new Date()
1357
- });
1358
- }
1359
- const k = h.filter(
1360
- (C) => f - C.startedAt.getTime() <= Ct
1361
- );
1362
- if (k.length === 0) {
1363
- c.current = !1;
1364
- return;
1365
- }
1366
- const x = await Promise.allSettled(
1367
- k.map(async (C) => {
1363
+ const f = Date.now(), b = await Promise.allSettled(
1364
+ h.map(async (D) => {
1368
1365
  try {
1369
- const w = await Tt(l, u, C.id);
1370
- let E;
1366
+ const w = await pe((F) => Ut(o, c, D.id, F));
1367
+ let C;
1371
1368
  if (w.status === "completed")
1372
1369
  try {
1373
- E = await je(l, u, C.id);
1374
- } catch (U) {
1370
+ C = await pe((F) => qe(o, c, D.id, F));
1371
+ } catch (F) {
1375
1372
  console.error(
1376
- `[useExportPolling] Failed to get download URL for ${C.id}:`,
1377
- U
1373
+ `[useExportPolling] Failed to get download URL for ${D.id}:`,
1374
+ F
1378
1375
  );
1379
1376
  }
1380
- return bt(w, E);
1377
+ return vt(w, C);
1381
1378
  } catch (w) {
1382
1379
  return console.error(
1383
- `[useExportPolling] Failed to poll export ${C.id}:`,
1380
+ `[useExportPolling] Failed to poll export ${D.id}:`,
1384
1381
  w
1385
1382
  ), null;
1386
1383
  }
1387
1384
  })
1388
- ), { updateExport: D } = he.getState().actions;
1389
- for (const C of x)
1390
- C.status === "fulfilled" && C.value && D(C.value.id, C.value);
1385
+ ), { updateExport: k, applyServerStatus: I } = me.getState().actions, y = (D) => {
1386
+ const w = me.getState().activeExports.get(D);
1387
+ return !!w && De(w.status);
1388
+ };
1389
+ h.forEach((D, w) => {
1390
+ if (!y(D.id)) return;
1391
+ const C = b[w], F = C.status === "fulfilled" ? C.value : null;
1392
+ if (f > $a(D) && !(F && !De(F.status))) {
1393
+ k(D.id, {
1394
+ status: "failed",
1395
+ error: z.unconfirmed,
1396
+ lastUpdatedAt: /* @__PURE__ */ new Date()
1397
+ });
1398
+ return;
1399
+ }
1400
+ F && I(F.id, F);
1401
+ });
1391
1402
  const S = d();
1392
1403
  if (S.length > 0 && !document.hidden) {
1393
- const C = S.reduce(
1394
- (E, U) => U.startedAt < E ? U.startedAt : E,
1404
+ const D = S.reduce(
1405
+ (C, F) => F.startedAt < C ? F.startedAt : C,
1395
1406
  S[0].startedAt
1396
- ), w = Pa(C);
1407
+ ), w = ja(D);
1397
1408
  s.current && clearTimeout(s.current), s.current = setTimeout(() => {
1398
- var E;
1399
- (E = m.current) == null || E.call(m);
1409
+ var C;
1410
+ (C = p.current) == null || C.call(p);
1400
1411
  }, w);
1401
1412
  } else
1402
- c.current = !1;
1403
- }, [l, u, d]);
1413
+ u.current = !1;
1414
+ }, [o, c, d]);
1404
1415
  return Y(() => {
1405
- m.current = p;
1406
- }, [p]), Y(() => {
1416
+ p.current = m;
1417
+ }, [m]), Y(() => {
1407
1418
  var f;
1408
- d().length > 0 && n && !c.current && (c.current = !0, (f = m.current) == null || f.call(m));
1409
- }, [o, n, d]), Y(() => {
1419
+ d().length > 0 && n && !u.current && (u.current = !0, (f = p.current) == null || f.call(p));
1420
+ }, [i, n, d]), Y(() => {
1410
1421
  var f;
1411
1422
  const h = d();
1412
- n && h.length > 0 && !c.current && (c.current = !0, (f = m.current) == null || f.call(m));
1423
+ n && h.length > 0 && !u.current && (u.current = !0, (f = p.current) == null || f.call(p));
1413
1424
  }, [n, d]), Y(() => {
1414
- !n && s.current && (clearTimeout(s.current), s.current = null, c.current = !1);
1425
+ !n && s.current && (clearTimeout(s.current), s.current = null, u.current = !1);
1415
1426
  }, [n]), Y(() => () => {
1416
1427
  s.current && (clearTimeout(s.current), s.current = null);
1417
1428
  }, []), {
1418
- isPolling: c.current,
1429
+ isPolling: u.current,
1419
1430
  isTabVisible: n,
1420
1431
  inProgressCount: d().length
1421
1432
  };
1422
1433
  }
1423
- function Hn() {
1424
- const { authToken: e, tokenProps: a } = Ge(), o = he((m) => m.activeExports), { addExport: n } = Ut(), i = ce(!1), s = a == null ? void 0 : a.apiServiceUrl, c = e == null ? void 0 : e.accessToken;
1434
+ function Zn() {
1435
+ const { authToken: e, tokenProps: a } = Ye(), i = me((p) => p.activeExports), { recoverExport: n } = Vt(), l = ue(!1), s = a == null ? void 0 : a.apiServiceUrl, u = e == null ? void 0 : e.accessToken;
1425
1436
  Y(() => {
1426
- if (i.current || !s || !c) return;
1437
+ if (l.current || !s || !u) return;
1427
1438
  (async () => {
1428
1439
  try {
1429
- const { exports: l } = await yr(s, c, {
1430
- status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
1440
+ const { exports: o } = await pe((c) => wr(s, u, {
1441
+ status: ["pending", "processing", "chunking", "compacting", "completed", "failed", "cancelled"],
1431
1442
  limit: 20
1432
1443
  // Limit to recent exports
1433
- });
1434
- for (const u of l) {
1435
- if (o.has(u.id)) continue;
1444
+ }, c));
1445
+ for (const c of o) {
1446
+ if (i.has(c.id)) continue;
1436
1447
  let d;
1437
- if (u.status === "completed")
1448
+ if (c.status === "completed")
1438
1449
  try {
1439
- d = await je(s, c, u.id);
1450
+ d = await pe((h) => qe(s, u, c.id, h));
1440
1451
  } catch (h) {
1441
1452
  console.error(
1442
- `[useExportRecovery] Failed to get download URL for ${u.id}:`,
1453
+ `[useExportRecovery] Failed to get download URL for ${c.id}:`,
1443
1454
  h
1444
1455
  );
1445
1456
  }
1446
- const p = {
1447
- ...bt(u, d),
1448
- title: Ma(u),
1449
- startedAt: new Date(u.createdAt),
1450
- expiresAt: new Date(u.expiresAt)
1457
+ const m = {
1458
+ ...vt(c, d),
1459
+ title: Wa(c),
1460
+ startedAt: new Date(c.createdAt),
1461
+ expiresAt: new Date(c.expiresAt)
1451
1462
  };
1452
- n(p);
1463
+ n(m);
1453
1464
  }
1454
- i.current = !0;
1455
- } catch (l) {
1456
- console.error("[useExportRecovery] Failed to recover exports:", l), i.current = !0;
1465
+ l.current = !0;
1466
+ } catch (o) {
1467
+ console.error("[useExportRecovery] Failed to recover exports:", o), l.current = !0;
1457
1468
  }
1458
1469
  })();
1459
- }, [s, c, n, o]);
1470
+ }, [s, u, n, i]);
1460
1471
  }
1461
- function Ma(e) {
1462
- return e.title ? e.title : mt(
1472
+ function Wa(e) {
1473
+ return e.title ? e.title : De(
1463
1474
  e.status
1464
1475
  ) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
1465
1476
  }
1466
- function _a({
1477
+ function Ha({
1467
1478
  export: e,
1468
1479
  onRemove: a,
1469
- onDownload: o
1480
+ onDownload: i
1470
1481
  }) {
1471
- const [n, i] = A("idle");
1482
+ const [n, l] = E("idle");
1472
1483
  Y(() => {
1473
- e.downloadUrl && i("idle");
1484
+ e.downloadUrl && l("idle");
1474
1485
  }, [e.downloadUrl]);
1475
1486
  const s = async () => {
1476
- if (!o) {
1487
+ if (!i) {
1477
1488
  e.downloadUrl && window.open(e.downloadUrl, "_blank");
1478
1489
  return;
1479
1490
  }
1480
- i("preparing");
1481
- const g = await o(e);
1482
- i(g === "denied" ? "denied" : "idle");
1483
- }, c = (g) => {
1484
- g.stopPropagation(), a == null || a(e.id);
1485
- }, m = mt(e.status), l = (() => {
1486
- switch (e.status) {
1487
- case "pending":
1488
- return "Queued...";
1489
- case "compacting":
1490
- return "Finalizing...";
1491
- default:
1492
- return "Processing...";
1493
- }
1494
- })(), u = e.status === "completed" ? "bg-emerald-500" : e.status === "failed" ? "bg-destructive" : e.status === "pending" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", d = e.status === "completed" ? "Ready" : e.status === "failed" ? "Failed" : "In progress", p = pa(e.startedAt, { addSuffix: !0 }), h = [
1491
+ l("preparing");
1492
+ const k = await i(e);
1493
+ l(k === "denied" ? "denied" : "idle");
1494
+ }, u = (k) => {
1495
+ k.stopPropagation(), a == null || a(e.id);
1496
+ }, p = De(e.status), o = e.status === "pending" ? { text: z.queued } : e.status === "compacting" || e.phase === "finalizing" ? { text: z.finalizing } : e.phase === "preparing" ? { text: z.preparing } : e.phase === "acquiring" ? { text: z.fetchingRows(e.rowsProcessed ?? 0) } : {
1497
+ text: z.processing,
1498
+ detail: e.progress !== null ? z.percentComplete(e.progress) : e.rowsProcessed !== void 0 ? z.rowsProcessed(e.rowsProcessed) : void 0,
1499
+ bar: e.progress
1500
+ }, c = p && Date.now() - e.startedAt.getTime() >= Nr, d = e.status === "completed" ? "bg-emerald-500" : e.status === "failed" ? "bg-destructive" : e.status === "pending" || e.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", m = e.status === "completed" ? z.ready : e.status === "failed" ? z.failed : e.status === "cancelled" ? z.cancelled : z.inProgress, h = Nt(e.startedAt, { addSuffix: !0 }), f = [
1495
1501
  e.status === "completed" && e.totalRows !== null ? `${e.totalRows.toLocaleString()} rows` : null,
1496
- e.status === "completed" && e.fileSize ? Cr(e.fileSize) : null
1497
- ].filter((g) => !!g), f = /* @__PURE__ */ t("span", { className: "text-muted-foreground/50", children: "·" });
1502
+ e.status === "completed" && e.fileSize ? Sr(e.fileSize) : null
1503
+ ].filter((k) => !!k), b = /* @__PURE__ */ t("span", { className: "text-muted-foreground/50", children: "·" });
1498
1504
  return /* @__PURE__ */ r("div", { className: "group flex items-start gap-2.5 px-3 py-2 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
1499
- /* @__PURE__ */ t("span", { className: "flex h-5 shrink-0 items-center", "aria-hidden": "true", children: /* @__PURE__ */ t("span", { className: `h-1.5 w-1.5 rounded-full ${u}` }) }),
1500
- /* @__PURE__ */ t("span", { className: "sr-only", children: d }),
1505
+ /* @__PURE__ */ t("span", { className: "flex h-5 shrink-0 items-center", "aria-hidden": "true", children: /* @__PURE__ */ t("span", { className: `h-1.5 w-1.5 rounded-full ${d}` }) }),
1506
+ /* @__PURE__ */ t("span", { className: "sr-only", children: m }),
1501
1507
  /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
1502
1508
  /* @__PURE__ */ r("div", { className: "flex h-5 items-center gap-2", children: [
1503
1509
  /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: e.title }),
1504
1510
  e.status === "completed" && n === "preparing" && /* @__PURE__ */ r("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: [
1505
- /* @__PURE__ */ t(Rt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }),
1511
+ /* @__PURE__ */ t(Pt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }),
1506
1512
  "Preparing"
1507
1513
  ] }),
1508
1514
  e.status === "completed" && n !== "preparing" && /* @__PURE__ */ t(
@@ -1515,229 +1521,241 @@ function _a({
1515
1521
  }
1516
1522
  ),
1517
1523
  /* @__PURE__ */ t(
1518
- T,
1524
+ R,
1519
1525
  {
1520
1526
  variant: "ghost",
1521
1527
  size: "xs",
1522
1528
  className: "-mr-1.5 h-5 w-5 shrink-0 px-0 text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100",
1523
- onClick: c,
1529
+ onClick: u,
1524
1530
  "aria-label": "Remove notification",
1525
1531
  title: "Remove",
1526
- children: /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
1532
+ children: /* @__PURE__ */ t(Ze, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
1527
1533
  }
1528
1534
  )
1529
1535
  ] }),
1530
- !m && e.status !== "failed" && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
1531
- h.length > 0 && // Disclosed on hover or focus only; the time is what a reader scans.
1536
+ e.status === "completed" && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
1537
+ f.length > 0 && // Disclosed on hover or focus only; the time is what a reader scans.
1532
1538
  /* @__PURE__ */ r("span", { className: "hidden group-hover:contents group-focus-within:contents", children: [
1533
- h.map((g, k) => /* @__PURE__ */ r(Nt.Fragment, { children: [
1534
- k > 0 && f,
1535
- /* @__PURE__ */ t("span", { children: g })
1536
- ] }, k)),
1537
- f
1539
+ f.map((k, I) => /* @__PURE__ */ r(Dt.Fragment, { children: [
1540
+ I > 0 && b,
1541
+ /* @__PURE__ */ t("span", { children: k })
1542
+ ] }, I)),
1543
+ b
1538
1544
  ] }),
1539
- /* @__PURE__ */ t("span", { children: p })
1545
+ /* @__PURE__ */ t("span", { children: h })
1540
1546
  ] }),
1541
1547
  e.status === "completed" && n === "denied" && /* @__PURE__ */ r("div", { role: "alert", className: "mt-1 flex items-start gap-1.5 text-[12px] leading-4 text-foreground", children: [
1542
- /* @__PURE__ */ t(wr, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
1543
- /* @__PURE__ */ t("span", { children: "This link expired. Refresh the tray to sign the file again." })
1548
+ /* @__PURE__ */ t(Dr, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
1549
+ /* @__PURE__ */ t("span", { children: z.linkExpired })
1544
1550
  ] }),
1545
- m && /* @__PURE__ */ r("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
1546
- l,
1547
- (e.progress !== null || e.rowsProcessed !== void 0) && /* @__PURE__ */ r($, { children: [
1551
+ p && /* @__PURE__ */ r("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
1552
+ /* @__PURE__ */ t("span", { className: "tabular-nums", children: o.text }),
1553
+ o.detail && /* @__PURE__ */ r(j, { children: [
1548
1554
  " ",
1549
- f,
1555
+ b,
1550
1556
  " ",
1551
- /* @__PURE__ */ t("span", { className: "tabular-nums", children: e.progress === null ? `${e.rowsProcessed.toLocaleString()} rows processed` : `${e.progress}% complete` })
1557
+ /* @__PURE__ */ t("span", { className: "tabular-nums", children: o.detail })
1552
1558
  ] }),
1553
- e.progress !== null && /* @__PURE__ */ t(Nr, { value: e.progress, className: "mt-1.5 h-1" })
1559
+ " ",
1560
+ b,
1561
+ " ",
1562
+ /* @__PURE__ */ t("span", { children: z.started(Nt(e.startedAt)) }),
1563
+ o.bar !== void 0 && o.bar !== null && /* @__PURE__ */ t(kr, { value: o.bar, className: "mt-1.5 h-1" }),
1564
+ c && /* @__PURE__ */ t("div", { className: "mt-1", children: z.longRunning })
1554
1565
  ] }),
1555
- e.status === "failed" && /* @__PURE__ */ r($, { children: [
1566
+ e.status === "cancelled" && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
1567
+ /* @__PURE__ */ t("span", { children: z.cancelled }),
1568
+ b,
1569
+ /* @__PURE__ */ t("span", { children: h })
1570
+ ] }),
1571
+ e.status === "failed" && /* @__PURE__ */ r(j, { children: [
1556
1572
  /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
1557
- /* @__PURE__ */ t("span", { children: "Failed" }),
1558
- f,
1559
- /* @__PURE__ */ t("span", { children: p })
1573
+ /* @__PURE__ */ t("span", { children: z.failed }),
1574
+ b,
1575
+ /* @__PURE__ */ t("span", { children: h })
1560
1576
  ] }),
1561
- /* @__PURE__ */ t("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: e.error || "Export failed" })
1577
+ /* @__PURE__ */ t("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: e.error || z.failedFallback })
1562
1578
  ] })
1563
1579
  ] })
1564
1580
  ] });
1565
1581
  }
1566
- function Oa() {
1567
- const { authToken: e, tokenProps: a } = Ge(), o = he((x) => x.activeExports), { clearCompleted: n, removeExport: i, updateExport: s } = Ut(), [c, m] = A(!1), [l, u] = A(!1), d = Array.from(o.values()).sort(
1568
- (x, D) => D.startedAt.getTime() - x.startedAt.getTime()
1569
- ), p = d.some(
1570
- (x) => x.status === "completed" || x.status === "failed"
1571
- ), h = W(async () => {
1572
- const x = a == null ? void 0 : a.apiServiceUrl, D = e == null ? void 0 : e.accessToken;
1573
- if (!(!x || !D)) {
1574
- m(!0);
1582
+ function qa() {
1583
+ const { authToken: e, tokenProps: a } = Ye(), i = me((y) => y.activeExports), { clearCompleted: n, removeExport: l, updateExport: s, applyServerStatus: u } = Vt(), [p, o] = E(!1), [c, d] = E(!1), m = Array.from(i.values()).sort(
1584
+ (y, S) => S.startedAt.getTime() - y.startedAt.getTime()
1585
+ ), h = m.some(
1586
+ (y) => y.status === "completed" || y.status === "failed" || y.status === "cancelled"
1587
+ ), f = H(async () => {
1588
+ const y = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
1589
+ if (!(!y || !S)) {
1590
+ o(!0);
1575
1591
  try {
1576
- const S = Array.from(o.values());
1592
+ const D = Array.from(i.values());
1577
1593
  await Promise.all(
1578
- S.map(async (C) => {
1594
+ D.map(async (w) => {
1579
1595
  try {
1580
- const w = await Tt(x, D, C.id);
1581
- let E;
1582
- if (w.status === "completed")
1596
+ const C = await pe((g) => Ut(y, S, w.id, g));
1597
+ let F;
1598
+ if (C.status === "completed")
1583
1599
  try {
1584
- E = await je(
1585
- x,
1586
- D,
1587
- C.id
1588
- );
1589
- } catch (U) {
1590
- console.error(`Failed to get download URL for ${C.id}:`, U);
1600
+ F = await pe((g) => qe(
1601
+ y,
1602
+ S,
1603
+ w.id,
1604
+ g
1605
+ ));
1606
+ } catch (g) {
1607
+ console.error(`Failed to get download URL for ${w.id}:`, g);
1591
1608
  }
1592
- s(C.id, bt(w, E));
1593
- } catch (w) {
1594
- s(C.id, { downloadUrl: void 0 }), console.error(`Failed to refresh export ${C.id}:`, w);
1609
+ u(w.id, vt(C, F));
1610
+ } catch (C) {
1611
+ s(w.id, { downloadUrl: void 0 }), console.error(`Failed to refresh export ${w.id}:`, C);
1595
1612
  }
1596
1613
  })
1597
1614
  );
1598
1615
  } finally {
1599
- m(!1);
1616
+ o(!1);
1600
1617
  }
1601
1618
  }
1602
1619
  }, [
1603
- o,
1620
+ i,
1604
1621
  e == null ? void 0 : e.accessToken,
1605
1622
  a == null ? void 0 : a.apiServiceUrl,
1606
- s
1607
- ]), f = W(async () => {
1608
- const x = a == null ? void 0 : a.apiServiceUrl, D = e == null ? void 0 : e.accessToken;
1609
- if (!x || !D) {
1623
+ s,
1624
+ u
1625
+ ]), b = H(async () => {
1626
+ const y = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
1627
+ if (!y || !S) {
1610
1628
  n();
1611
1629
  return;
1612
1630
  }
1613
- u(!0);
1631
+ d(!0);
1614
1632
  try {
1615
- const S = d.filter(
1616
- (w) => w.status === "completed" || w.status === "failed"
1617
- ), C = await Promise.allSettled(
1618
- S.map(async (w) => (await vt(x, D, w.id), w.id))
1633
+ const D = m.filter(
1634
+ (C) => C.status === "completed" || C.status === "failed" || C.status === "cancelled"
1635
+ ), w = await Promise.allSettled(
1636
+ D.map(async (C) => (await Ct(y, S, C.id), C.id))
1619
1637
  );
1620
- for (const w of C)
1621
- w.status === "fulfilled" ? i(w.value) : console.error("Failed to delete export:", w.reason);
1638
+ for (const C of w)
1639
+ C.status === "fulfilled" ? l(C.value) : console.error("Failed to delete export:", C.reason);
1622
1640
  } finally {
1623
- u(!1);
1641
+ d(!1);
1624
1642
  }
1625
1643
  }, [
1626
- d,
1644
+ m,
1627
1645
  a == null ? void 0 : a.apiServiceUrl,
1628
1646
  e == null ? void 0 : e.accessToken,
1629
1647
  n,
1630
- i
1631
- ]), g = W(
1632
- async (x) => {
1633
- const D = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
1634
- if (D && S)
1648
+ l
1649
+ ]), k = H(
1650
+ async (y) => {
1651
+ const S = a == null ? void 0 : a.apiServiceUrl, D = e == null ? void 0 : e.accessToken;
1652
+ if (S && D)
1635
1653
  try {
1636
- await vt(D, S, x), i(x);
1654
+ await Ct(S, D, y), l(y);
1637
1655
  return;
1638
- } catch (C) {
1639
- console.error(`Failed to cancel export ${x}:`, C);
1656
+ } catch (w) {
1657
+ console.error(`Failed to cancel export ${y}:`, w);
1640
1658
  }
1641
- i(x);
1659
+ l(y);
1642
1660
  },
1643
- [a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, i]
1644
- ), k = W(
1645
- async (x) => {
1646
- if (x.downloadUrl)
1647
- return window.open(x.downloadUrl, "_blank"), "opened";
1648
- const D = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
1649
- if (!D || !S) return "denied";
1661
+ [a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, l]
1662
+ ), I = H(
1663
+ async (y) => {
1664
+ if (y.downloadUrl)
1665
+ return window.open(y.downloadUrl, "_blank"), "opened";
1666
+ const S = a == null ? void 0 : a.apiServiceUrl, D = e == null ? void 0 : e.accessToken;
1667
+ if (!S || !D) return "denied";
1650
1668
  try {
1651
- const C = await je(D, S, x.id);
1652
- return s(x.id, { downloadUrl: C }), window.open(C, "_blank"), "opened";
1653
- } catch (C) {
1654
- return console.error(`Failed to get download URL for ${x.id}:`, C), s(x.id, { downloadUrl: void 0 }), "denied";
1669
+ const w = await pe((C) => qe(S, D, y.id, C));
1670
+ return s(y.id, { downloadUrl: w }), window.open(w, "_blank"), "opened";
1671
+ } catch (w) {
1672
+ return console.error(`Failed to get download URL for ${y.id}:`, w), s(y.id, { downloadUrl: void 0 }), "denied";
1655
1673
  }
1656
1674
  },
1657
1675
  [a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, s]
1658
1676
  );
1659
- return d.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-1.5 px-6 py-8 text-center", children: [
1660
- /* @__PURE__ */ t("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ t(va, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
1677
+ return m.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-1.5 px-6 py-8 text-center", children: [
1678
+ /* @__PURE__ */ t("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ t(Ca, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
1661
1679
  /* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: "No exports yet" }),
1662
1680
  /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Large exports run in the background and land here." })
1663
1681
  ] }) : /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
1664
1682
  /* @__PURE__ */ r("div", { className: "flex h-8 items-center gap-2 border-b border-border px-3", children: [
1665
1683
  /* @__PURE__ */ t("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Exports" }),
1666
- /* @__PURE__ */ t("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: d.length }),
1684
+ /* @__PURE__ */ t("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: m.length }),
1667
1685
  /* @__PURE__ */ r("div", { className: "ml-auto flex items-center gap-0.5", children: [
1668
- p && /* @__PURE__ */ t(
1669
- T,
1686
+ h && /* @__PURE__ */ t(
1687
+ R,
1670
1688
  {
1671
1689
  variant: "ghost",
1672
1690
  size: "xs",
1673
1691
  className: "h-6 px-1.5 text-[12px] text-muted-foreground hover:text-foreground",
1674
- onClick: f,
1675
- disabled: l,
1676
- children: l ? "Clearing" : "Clear all"
1692
+ onClick: b,
1693
+ disabled: c,
1694
+ children: c ? "Clearing" : "Clear all"
1677
1695
  }
1678
1696
  ),
1679
1697
  /* @__PURE__ */ t(
1680
- T,
1698
+ R,
1681
1699
  {
1682
1700
  variant: "ghost",
1683
1701
  size: "xs",
1684
1702
  className: "h-6 w-6 px-0 text-muted-foreground hover:text-foreground",
1685
- onClick: h,
1686
- disabled: c,
1703
+ onClick: f,
1704
+ disabled: p,
1687
1705
  title: "Refresh status",
1688
1706
  "aria-label": "Refresh status",
1689
1707
  children: /* @__PURE__ */ t(
1690
- Rt,
1708
+ Pt,
1691
1709
  {
1692
1710
  strokeWidth: 1.75,
1693
- className: `h-3.5 w-3.5 ${c ? "animate-spin" : ""}`
1711
+ className: `h-3.5 w-3.5 ${p ? "animate-spin" : ""}`
1694
1712
  }
1695
1713
  )
1696
1714
  }
1697
1715
  )
1698
1716
  ] })
1699
1717
  ] }),
1700
- /* @__PURE__ */ t("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y divide-border/70", children: d.map((x) => /* @__PURE__ */ t(
1701
- _a,
1718
+ /* @__PURE__ */ t("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y divide-border/70", children: m.map((y) => /* @__PURE__ */ t(
1719
+ Ha,
1702
1720
  {
1703
- export: x,
1704
- onRemove: g,
1705
- onDownload: k
1721
+ export: y,
1722
+ onRemove: k,
1723
+ onDownload: I
1706
1724
  },
1707
- x.id
1725
+ y.id
1708
1726
  )) }) })
1709
1727
  ] });
1710
1728
  }
1711
- function qn({
1729
+ function Qn({
1712
1730
  variant: e
1713
1731
  }) {
1714
- const a = he((l) => l.activeExports), o = Sr(), n = a.size > 0, i = Array.from(a.values()).some(
1715
- (l) => l.status === "completed" || l.status === "failed"
1716
- ), c = o > 0 ? o > 9 ? "9+" : String(o) : null;
1717
- return /* @__PURE__ */ r(Me, { children: [
1718
- /* @__PURE__ */ t(_e, { asChild: !0, children: /* @__PURE__ */ r(
1719
- T,
1732
+ const a = me((o) => o.activeExports), i = Er(), n = a.size > 0, l = Array.from(a.values()).some(
1733
+ (o) => o.status === "completed" || o.status === "failed"
1734
+ ), u = i > 0 ? i > 9 ? "9+" : String(i) : null;
1735
+ return /* @__PURE__ */ r(ze, { children: [
1736
+ /* @__PURE__ */ t($e, { asChild: !0, children: /* @__PURE__ */ r(
1737
+ R,
1720
1738
  {
1721
1739
  variant: e ?? "ghost",
1722
1740
  size: "xs",
1723
1741
  className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
1724
1742
  "aria-label": "Export notifications",
1725
1743
  children: [
1726
- /* @__PURE__ */ t(Dr, { className: "h-3.5 w-3.5" }),
1744
+ /* @__PURE__ */ t(Ar, { className: "h-3.5 w-3.5" }),
1727
1745
  n && /* @__PURE__ */ t(
1728
1746
  "span",
1729
1747
  {
1730
- 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"}`,
1731
- children: c
1748
+ className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${u ? "-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"}`,
1749
+ children: u
1732
1750
  }
1733
1751
  )
1734
1752
  ]
1735
1753
  }
1736
1754
  ) }),
1737
- /* @__PURE__ */ t(Oe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(Oa, {}) })
1755
+ /* @__PURE__ */ t(je, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(qa, {}) })
1738
1756
  ] });
1739
1757
  }
1740
- function za(e) {
1758
+ function Ga(e) {
1741
1759
  if (e)
1742
1760
  return {
1743
1761
  renamed: e.type === "rename" ? { oldId: e.oldId, newId: e.newId } : void 0,
@@ -1746,24 +1764,24 @@ function za(e) {
1746
1764
  affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
1747
1765
  };
1748
1766
  }
1749
- function $a({
1767
+ function Xa({
1750
1768
  open: e,
1751
1769
  onOpenChange: a,
1752
- trigger: o,
1770
+ trigger: i,
1753
1771
  showTrigger: n = !0,
1754
- initialMode: i = "manage"
1772
+ initialMode: l = "manage"
1755
1773
  }) {
1756
- const s = i === "create", {
1757
- forceClose: c,
1758
- handleOpenChange: m,
1759
- isCreateFlowActive: l,
1760
- preventPassiveDismissDuringCreate: u,
1774
+ const s = l === "create", {
1775
+ forceClose: u,
1776
+ handleOpenChange: p,
1777
+ isCreateFlowActive: o,
1778
+ preventPassiveDismissDuringCreate: c,
1761
1779
  resolvedOpen: d,
1762
- setIsCreateFlowActive: p
1763
- } = _t({
1780
+ setIsCreateFlowActive: m
1781
+ } = zt({
1764
1782
  open: e,
1765
1783
  onOpenChange: a,
1766
- initialCreateFlowActive: i === "create",
1784
+ initialCreateFlowActive: l === "create",
1767
1785
  // Dialog mode renders a built-in X close button — allow explicit
1768
1786
  // closes through `handleOpenChange`. Popover mode has no X; its
1769
1787
  // only close-via-trigger path is a re-click that would silently
@@ -1771,120 +1789,120 @@ function $a({
1771
1789
  // create and make consumers use `forceClose()` from a dedicated
1772
1790
  // button.
1773
1791
  dismissMode: n ? "passive" : "explicit-only"
1774
- }), h = L((y) => y.dashboard), { setDashboardControlsModel: f } = be(), { participants: g } = kr(Kt(h)), k = Array.from(
1792
+ }), h = T((v) => v.dashboard), { setDashboardControlsModel: f } = ve(), { participants: b } = Ir(Yt(h)), k = Array.from(
1775
1793
  new Map(
1776
- g.flatMap(
1777
- (y) => y.fieldChoices.map((R) => {
1778
- var I;
1794
+ b.flatMap(
1795
+ (v) => v.fieldChoices.map((U) => {
1796
+ var A;
1779
1797
  return [
1780
- R.value,
1798
+ U.value,
1781
1799
  {
1782
- option: R,
1783
- target: (I = y.fieldTargetMap) == null ? void 0 : I[R.value]
1800
+ option: U,
1801
+ target: (A = v.fieldTargetMap) == null ? void 0 : A[U.value]
1784
1802
  }
1785
1803
  ];
1786
1804
  })
1787
1805
  )
1788
1806
  ).values()
1789
- ), x = Array.from(
1807
+ ), I = Array.from(
1790
1808
  new Map(
1791
- g.flatMap(
1792
- (y) => y.metricChoices.map((R) => {
1793
- var I;
1809
+ b.flatMap(
1810
+ (v) => v.metricChoices.map((U) => {
1811
+ var A;
1794
1812
  return [
1795
- R.value,
1813
+ U.value,
1796
1814
  {
1797
- option: R,
1798
- target: (I = y.metricTargetMap) == null ? void 0 : I[R.value]
1815
+ option: U,
1816
+ target: (A = v.metricTargetMap) == null ? void 0 : A[U.value]
1799
1817
  }
1800
1818
  ];
1801
1819
  })
1802
1820
  )
1803
1821
  ).values()
1804
- ), D = Yt({
1822
+ ), y = Zt({
1805
1823
  ...h || {},
1806
1824
  controls: []
1807
- }), S = Er(h), C = (y, R, I) => {
1825
+ }), S = Lr(h), D = (v, U, A) => {
1808
1826
  f(
1809
- y,
1810
- R,
1811
- za(I)
1827
+ v,
1828
+ U,
1829
+ Ga(A)
1812
1830
  );
1813
- }, w = W(() => {
1831
+ }, w = H(() => {
1814
1832
  if (s) {
1815
- c();
1833
+ u();
1816
1834
  return;
1817
1835
  }
1818
- p(!1);
1819
- }, [s, c, p]), E = /* @__PURE__ */ t(
1820
- Ot,
1836
+ m(!1);
1837
+ }, [s, u, m]), C = /* @__PURE__ */ t(
1838
+ $t,
1821
1839
  {
1822
1840
  scope: "dashboard",
1823
1841
  controls: h.controls || [],
1824
- reservedControlIds: D,
1842
+ reservedControlIds: y,
1825
1843
  defaultValues: h.defaultControlValues || {},
1826
- usageByControlId: Ar(h),
1844
+ usageByControlId: Fr(h),
1827
1845
  availableFieldChoices: k,
1828
- availableMetricChoices: x,
1829
- structuralParticipants: g,
1846
+ availableMetricChoices: I,
1847
+ structuralParticipants: b,
1830
1848
  structuralParticipantIdsByControlId: S,
1831
- initialCreateFlow: i === "create",
1832
- onCreateFlowActiveChange: p,
1849
+ initialCreateFlow: l === "create",
1850
+ onCreateFlowActiveChange: m,
1833
1851
  onCreateFlowComplete: w,
1834
- onChange: C,
1852
+ onChange: D,
1835
1853
  emptyMessage: "No dashboard controls yet."
1836
1854
  }
1837
- ), U = l ? "Add dashboard control" : "Dashboard Controls", b = /* @__PURE__ */ r($, { children: [
1855
+ ), F = o ? "Add dashboard control" : "Dashboard Controls", g = /* @__PURE__ */ r(j, { children: [
1838
1856
  /* @__PURE__ */ r("div", { className: "space-y-1", children: [
1839
1857
  /* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
1840
1858
  /* @__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." })
1841
1859
  ] }),
1842
- E
1860
+ C
1843
1861
  ] });
1844
- return n ? /* @__PURE__ */ r(Me, { open: d, onOpenChange: m, children: [
1845
- /* @__PURE__ */ t(_e, { asChild: !0, children: o || /* @__PURE__ */ r(T, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
1846
- /* @__PURE__ */ t(Et, { className: "mr-2 h-4 w-4" }),
1862
+ return n ? /* @__PURE__ */ r(ze, { open: d, onOpenChange: p, children: [
1863
+ /* @__PURE__ */ t($e, { asChild: !0, children: i || /* @__PURE__ */ r(R, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
1864
+ /* @__PURE__ */ t(It, { className: "mr-2 h-4 w-4" }),
1847
1865
  "Controls"
1848
1866
  ] }) }),
1849
1867
  /* @__PURE__ */ t(
1850
- Oe,
1868
+ je,
1851
1869
  {
1852
1870
  className: "w-[620px] max-w-[95vw] space-y-4",
1853
1871
  align: "end",
1854
- onEscapeKeyDown: u,
1855
- onPointerDownOutside: u,
1856
- children: b
1872
+ onEscapeKeyDown: c,
1873
+ onPointerDownOutside: c,
1874
+ children: g
1857
1875
  }
1858
1876
  )
1859
- ] }) : /* @__PURE__ */ t(Se, { open: d, onOpenChange: m, children: /* @__PURE__ */ r(
1860
- De,
1877
+ ] }) : /* @__PURE__ */ t(Ee, { open: d, onOpenChange: p, children: /* @__PURE__ */ r(
1878
+ Ae,
1861
1879
  {
1862
1880
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
1863
- onEscapeKeyDown: u,
1864
- onPointerDownOutside: u,
1881
+ onEscapeKeyDown: c,
1882
+ onPointerDownOutside: c,
1865
1883
  children: [
1866
1884
  /* @__PURE__ */ r(
1867
- ut,
1885
+ pt,
1868
1886
  {
1869
- className: l ? "space-y-0" : void 0,
1887
+ className: o ? "space-y-0" : void 0,
1870
1888
  children: [
1871
- /* @__PURE__ */ t(ke, { className: "text-[15px]", children: U }),
1889
+ /* @__PURE__ */ t(Ie, { className: "text-[15px]", children: F }),
1872
1890
  /* @__PURE__ */ t(
1873
- ht,
1891
+ ft,
1874
1892
  {
1875
- className: l ? "sr-only" : "text-[13px]",
1876
- children: l ? "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."
1893
+ className: o ? "sr-only" : "text-[13px]",
1894
+ 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."
1877
1895
  }
1878
1896
  )
1879
1897
  ]
1880
1898
  }
1881
1899
  ),
1882
- /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: E })
1900
+ /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: C })
1883
1901
  ]
1884
1902
  }
1885
1903
  ) });
1886
1904
  }
1887
- const ja = [
1905
+ const Ka = [
1888
1906
  "enum",
1889
1907
  "multi_enum",
1890
1908
  "text",
@@ -1892,104 +1910,104 @@ const ja = [
1892
1910
  "boolean",
1893
1911
  "date"
1894
1912
  ];
1895
- function Wa({
1913
+ function Ya({
1896
1914
  open: e,
1897
1915
  onOpenChange: a,
1898
- initialMode: o = "manage"
1916
+ initialMode: i = "manage"
1899
1917
  }) {
1900
- var b;
1901
- const n = o === "create", {
1902
- forceClose: i,
1918
+ var g;
1919
+ const n = i === "create", {
1920
+ forceClose: l,
1903
1921
  handleOpenChange: s,
1904
- isCreateFlowActive: c,
1905
- preventPassiveDismissDuringCreate: m,
1906
- resolvedOpen: l,
1907
- setIsCreateFlowActive: u
1908
- } = _t({
1922
+ isCreateFlowActive: u,
1923
+ preventPassiveDismissDuringCreate: p,
1924
+ resolvedOpen: o,
1925
+ setIsCreateFlowActive: c
1926
+ } = zt({
1909
1927
  open: e,
1910
1928
  onOpenChange: a,
1911
- initialCreateFlowActive: o === "create",
1929
+ initialCreateFlowActive: i === "create",
1912
1930
  dismissMode: "explicit-only"
1913
- }), d = L((y) => y.dashboard), p = L((y) => y.selectedSheetId), { setDashboardInputs: h } = be(), f = (b = d.sheets) == null ? void 0 : b.find(
1914
- (y) => y.id === p
1915
- ), g = (f == null ? void 0 : f.kind) === "document" && !!f.document, k = X(
1916
- () => g && (f != null && f.document) ? Ir(d, f.id) : [],
1917
- [d, g, f == null ? void 0 : f.document, f == null ? void 0 : f.id]
1918
- ), x = X(
1931
+ }), d = T((v) => v.dashboard), m = T((v) => v.selectedSheetId), { setDashboardInputs: h } = ve(), f = (g = d.sheets) == null ? void 0 : g.find(
1932
+ (v) => v.id === m
1933
+ ), b = (f == null ? void 0 : f.kind) === "document" && !!f.document, k = Q(
1934
+ () => b && (f != null && f.document) ? Tr(d, f.id) : [],
1935
+ [d, b, f == null ? void 0 : f.document, f == null ? void 0 : f.id]
1936
+ ), I = Q(
1919
1937
  () => k.filter(
1920
- (y) => y.kind === "control"
1938
+ (v) => v.kind === "control"
1921
1939
  ),
1922
1940
  [k]
1923
- ), D = X(
1924
- () => x.map((y) => y.control),
1925
- [x]
1926
- ), S = X(
1927
- () => qa(D),
1928
- [D]
1929
- ), C = X(
1930
- () => Ha(d),
1941
+ ), y = Q(
1942
+ () => I.map((v) => v.control),
1943
+ [I]
1944
+ ), S = Q(
1945
+ () => Qa(y),
1946
+ [y]
1947
+ ), D = Q(
1948
+ () => Za(d),
1931
1949
  [d]
1932
- ), w = W(() => {
1950
+ ), w = H(() => {
1933
1951
  if (n) {
1934
- i();
1952
+ l();
1935
1953
  return;
1936
1954
  }
1937
- u(!1);
1938
- }, [n, i, u]), E = W(
1939
- (y, R, I) => {
1940
- !g || !(f != null && f.document) || h(
1941
- Ka({
1955
+ c(!1);
1956
+ }, [n, l, c]), C = H(
1957
+ (v, U, A) => {
1958
+ !b || !(f != null && f.document) || h(
1959
+ en({
1942
1960
  allInputs: d.inputs || [],
1943
1961
  documentSheetId: f.id,
1944
1962
  currentDocumentInputs: k,
1945
- nextControls: y,
1946
- nextDefaultValues: R,
1947
- change: I
1963
+ nextControls: v,
1964
+ nextDefaultValues: U,
1965
+ change: A
1948
1966
  })
1949
1967
  );
1950
1968
  },
1951
1969
  [
1952
1970
  d.inputs,
1953
1971
  k,
1954
- g,
1972
+ b,
1955
1973
  f,
1956
1974
  h
1957
1975
  ]
1958
1976
  );
1959
- return !g || !(f != null && f.document) ? null : /* @__PURE__ */ t(Se, { open: l, onOpenChange: s, children: /* @__PURE__ */ r(
1960
- De,
1977
+ return !b || !(f != null && f.document) ? null : /* @__PURE__ */ t(Ee, { open: o, onOpenChange: s, children: /* @__PURE__ */ r(
1978
+ Ae,
1961
1979
  {
1962
1980
  className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
1963
- onEscapeKeyDown: m,
1964
- onPointerDownOutside: m,
1981
+ onEscapeKeyDown: p,
1982
+ onPointerDownOutside: p,
1965
1983
  children: [
1966
- /* @__PURE__ */ r(ut, { className: c ? "space-y-0" : void 0, children: [
1967
- /* @__PURE__ */ t(ke, { className: "text-[15px]", children: c ? "Add document control" : "Document Controls" }),
1984
+ /* @__PURE__ */ r(pt, { className: u ? "space-y-0" : void 0, children: [
1985
+ /* @__PURE__ */ t(Ie, { className: "text-[15px]", children: u ? "Add document control" : "Document Controls" }),
1968
1986
  /* @__PURE__ */ t(
1969
- ht,
1987
+ ft,
1970
1988
  {
1971
- className: c ? "sr-only" : "text-[13px]",
1972
- children: c ? "Configure and add a document-local control input." : "Add document-local control inputs. They are stored on this document sheet and are not dashboard controls."
1989
+ className: u ? "sr-only" : "text-[13px]",
1990
+ children: u ? "Configure and add a document-local control input." : "Add document-local control inputs. They are stored on this document sheet and are not dashboard controls."
1973
1991
  }
1974
1992
  )
1975
1993
  ] }),
1976
1994
  /* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ t(
1977
- Ot,
1995
+ $t,
1978
1996
  {
1979
1997
  scope: "dashboard",
1980
- controls: D,
1981
- reservedControlIds: C,
1998
+ controls: y,
1999
+ reservedControlIds: D,
1982
2000
  defaultValues: S,
1983
2001
  usageByControlId: {},
1984
2002
  availableFieldChoices: [],
1985
2003
  availableMetricChoices: [],
1986
2004
  structuralParticipants: [],
1987
2005
  structuralParticipantIdsByControlId: {},
1988
- allowedControlTypes: ja,
1989
- initialCreateFlow: o === "create",
1990
- onCreateFlowActiveChange: u,
2006
+ allowedControlTypes: Ka,
2007
+ initialCreateFlow: i === "create",
2008
+ onCreateFlowActiveChange: c,
1991
2009
  onCreateFlowComplete: w,
1992
- onChange: E,
2010
+ onChange: C,
1993
2011
  emptyMessage: "No document controls yet."
1994
2012
  }
1995
2013
  ) })
@@ -1997,90 +2015,90 @@ function Wa({
1997
2015
  }
1998
2016
  ) });
1999
2017
  }
2000
- function Ha(e) {
2018
+ function Za(e) {
2001
2019
  return (e.controls || []).map((a) => a.id);
2002
2020
  }
2003
- function qa(e) {
2021
+ function Qa(e) {
2004
2022
  const a = {};
2005
- for (const o of e)
2006
- o.defaultValue !== void 0 && (a[o.id] = o.defaultValue);
2023
+ for (const i of e)
2024
+ i.defaultValue !== void 0 && (a[i.id] = i.defaultValue);
2007
2025
  return a;
2008
2026
  }
2009
- function Ga(e, a) {
2027
+ function Ja(e, a) {
2010
2028
  return a ? Object.prototype.hasOwnProperty.call(a, e.id) ? {
2011
2029
  ...e,
2012
2030
  defaultValue: a[e.id]
2013
2031
  } : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 } : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 };
2014
2032
  }
2015
- function Ka({
2033
+ function en({
2016
2034
  allInputs: e,
2017
2035
  documentSheetId: a,
2018
- currentDocumentInputs: o,
2036
+ currentDocumentInputs: i,
2019
2037
  nextControls: n,
2020
- nextDefaultValues: i,
2038
+ nextDefaultValues: l,
2021
2039
  change: s
2022
2040
  }) {
2023
- const c = new Map(
2041
+ const u = new Map(
2024
2042
  n.map((h) => [
2025
2043
  h.id,
2026
- Ga(h, i)
2044
+ Ja(h, l)
2027
2045
  ])
2028
- ), m = (s == null ? void 0 : s.type) === "rename" ? { oldId: s.oldId, newId: s.newId } : null, l = /* @__PURE__ */ new Set(), u = [];
2029
- for (const h of o) {
2046
+ ), p = (s == null ? void 0 : s.type) === "rename" ? { oldId: s.oldId, newId: s.newId } : null, o = /* @__PURE__ */ new Set(), c = [];
2047
+ for (const h of i) {
2030
2048
  if (h.kind !== "control") {
2031
- u.push(h);
2049
+ c.push(h);
2032
2050
  continue;
2033
2051
  }
2034
- const f = c.get(h.control.id) || ((m == null ? void 0 : m.oldId) === h.control.id ? c.get(m.newId) : void 0);
2052
+ const f = u.get(h.control.id) || ((p == null ? void 0 : p.oldId) === h.control.id ? u.get(p.newId) : void 0);
2035
2053
  if (!f)
2036
2054
  continue;
2037
- l.add(f.id);
2038
- const g = Qt(
2055
+ o.add(f.id);
2056
+ const b = Qt(
2039
2057
  f.id,
2040
- [...e, ...u].filter(
2041
- (x) => x.id !== h.id
2058
+ [...e, ...c].filter(
2059
+ (I) => I.id !== h.id
2042
2060
  )
2043
- ), k = f.id === g ? f : { ...f, id: g };
2044
- u.push({
2061
+ ), k = f.id === b ? f : { ...f, id: b };
2062
+ c.push({
2045
2063
  ...h,
2046
2064
  label: k.label,
2047
- variableName: g,
2065
+ variableName: b,
2048
2066
  requiredAtExecution: k.requiredAtExecution,
2049
2067
  control: k
2050
2068
  });
2051
2069
  }
2052
- for (const h of c.values())
2053
- l.has(h.id) || u.push(
2054
- Fr({
2070
+ for (const h of u.values())
2071
+ o.has(h.id) || c.push(
2072
+ Br({
2055
2073
  control: h,
2056
- existingInputs: [...e, ...u],
2074
+ existingInputs: [...e, ...c],
2057
2075
  sheetId: a
2058
2076
  })
2059
2077
  );
2060
2078
  const d = new Set(
2061
- o.map((h) => h.id)
2079
+ i.map((h) => h.id)
2062
2080
  );
2063
2081
  return [...e.filter(
2064
2082
  (h) => !d.has(h.id)
2065
- ), ...u];
2083
+ ), ...c];
2066
2084
  }
2067
- function Ya({
2085
+ function tn({
2068
2086
  showFilters: e,
2069
2087
  onShowFiltersChange: a,
2070
- pickerContent: o,
2088
+ pickerContent: i,
2071
2089
  settingsContent: n,
2072
- size: i = "default",
2090
+ size: l = "default",
2073
2091
  className: s,
2074
- primaryButtonClassName: c,
2075
- secondaryButtonClassName: m,
2076
- pickerContentClassName: l,
2077
- settingsContentClassName: u
2092
+ primaryButtonClassName: u,
2093
+ secondaryButtonClassName: p,
2094
+ pickerContentClassName: o,
2095
+ settingsContentClassName: c
2078
2096
  }) {
2079
- const d = i === "toolbar", [p, h] = A(!1), f = rt("interactive");
2097
+ const d = l === "toolbar", [m, h] = E(!1), f = st("interactive");
2080
2098
  return /* @__PURE__ */ r(
2081
2099
  "div",
2082
2100
  {
2083
- className: G(
2101
+ className: X(
2084
2102
  // Height lives on the shell so the outer border is part of the
2085
2103
  // h-7 box (matches regular `size="xs"` buttons). Inner triggers
2086
2104
  // stretch to fill via `h-full`.
@@ -2089,58 +2107,58 @@ function Ya({
2089
2107
  s
2090
2108
  ),
2091
2109
  children: [
2092
- /* @__PURE__ */ r(Me, { open: e, onOpenChange: a, children: [
2093
- /* @__PURE__ */ t(_e, { asChild: !0, children: /* @__PURE__ */ r(
2094
- T,
2110
+ /* @__PURE__ */ r(ze, { open: e, onOpenChange: a, children: [
2111
+ /* @__PURE__ */ t($e, { asChild: !0, children: /* @__PURE__ */ r(
2112
+ R,
2095
2113
  {
2096
2114
  variant: "ghost",
2097
2115
  size: "xs",
2098
- className: G(
2116
+ className: X(
2099
2117
  "h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
2100
- c
2118
+ u
2101
2119
  ),
2102
2120
  children: [
2103
- e ? /* @__PURE__ */ t(ca, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Vt, { className: "h-3.5 w-3.5" }),
2121
+ e ? /* @__PURE__ */ t(ma, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(_t, { className: "h-3.5 w-3.5" }),
2104
2122
  "Filter"
2105
2123
  ]
2106
2124
  }
2107
2125
  ) }),
2108
2126
  /* @__PURE__ */ t(
2109
- Oe,
2127
+ je,
2110
2128
  {
2111
2129
  align: "end",
2112
2130
  sideOffset: 6,
2113
- className: G(
2131
+ className: X(
2114
2132
  "w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
2115
- l
2133
+ o
2116
2134
  ),
2117
2135
  style: f.contentStyle,
2118
- children: o
2136
+ children: i
2119
2137
  }
2120
2138
  )
2121
2139
  ] }),
2122
- /* @__PURE__ */ r(Me, { open: p, onOpenChange: h, children: [
2123
- /* @__PURE__ */ t(_e, { asChild: !0, children: /* @__PURE__ */ t(
2124
- T,
2140
+ /* @__PURE__ */ r(ze, { open: m, onOpenChange: h, children: [
2141
+ /* @__PURE__ */ t($e, { asChild: !0, children: /* @__PURE__ */ t(
2142
+ R,
2125
2143
  {
2126
2144
  variant: "ghost",
2127
2145
  size: "xs",
2128
- className: G(
2146
+ className: X(
2129
2147
  "h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
2130
- m
2148
+ p
2131
2149
  ),
2132
2150
  "aria-label": "Filter and control actions",
2133
- children: /* @__PURE__ */ t(Mt, { className: "h-3.5 w-3.5" })
2151
+ children: /* @__PURE__ */ t(Ot, { className: "h-3.5 w-3.5" })
2134
2152
  }
2135
2153
  ) }),
2136
2154
  /* @__PURE__ */ t(
2137
- Oe,
2155
+ je,
2138
2156
  {
2139
2157
  align: "end",
2140
2158
  sideOffset: 6,
2141
- className: G(
2159
+ className: X(
2142
2160
  "w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
2143
- u
2161
+ c
2144
2162
  ),
2145
2163
  style: f.contentStyle,
2146
2164
  children: n(() => h(!1))
@@ -2151,41 +2169,41 @@ function Ya({
2151
2169
  }
2152
2170
  );
2153
2171
  }
2154
- function Qa() {
2155
- ua();
2156
- const e = L((l) => l.selectedSheetId), a = L((l) => l.selectedFrameId), o = L((l) => l.dashboard), n = L((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = be(), { setCard: s } = kt(), c = me((l) => l.card.dataSource);
2172
+ function rn() {
2173
+ pa();
2174
+ const e = T((o) => o.selectedSheetId), a = T((o) => o.selectedFrameId), i = T((o) => o.dashboard), n = T((o) => o.actions.getSelectedFrame), { setSelectedFrameId: l } = ve(), { setCard: s } = At(), u = fe((o) => o.card.dataSource);
2157
2175
  return Y(() => {
2158
- var u, d;
2159
- let l = n();
2160
- if (!l) {
2161
- const p = (u = o == null ? void 0 : o.sheets) == null ? void 0 : u.find((f) => f.id === e), h = (d = p == null ? void 0 : p.frames) == null ? void 0 : d[0];
2162
- h && (i(h.id), l = h);
2176
+ var c, d;
2177
+ let o = n();
2178
+ if (!o) {
2179
+ const m = (c = i == null ? void 0 : i.sheets) == null ? void 0 : c.find((f) => f.id === e), h = (d = m == null ? void 0 : m.frames) == null ? void 0 : d[0];
2180
+ h && (l(h.id), o = h);
2163
2181
  }
2164
- if (l) {
2165
- const p = l.cards.find((h) => h.id === l.activeCardId);
2166
- p && s(p);
2182
+ if (o) {
2183
+ const m = o.cards.find((h) => h.id === o.activeCardId);
2184
+ m && s(m);
2167
2185
  }
2168
- }, [n, e, a, o, i, s]), {
2169
- hasEntities: !!(c != null && c.selectedEntities && c.selectedEntities.length > 0)
2186
+ }, [n, e, a, i, l, s]), {
2187
+ hasEntities: !!(u != null && u.selectedEntities && u.selectedEntities.length > 0)
2170
2188
  };
2171
2189
  }
2172
- function Xa() {
2173
- const e = L((l) => l.dashboard), a = L(
2174
- (l) => l.semanticExecutionPayload
2175
- ), o = L((l) => l.actions.addFilter), { hasEntities: n } = Qa(), { isLoading: i } = Lr(), s = X(
2176
- () => Xt(e, a),
2190
+ function an() {
2191
+ const e = T((o) => o.dashboard), a = T(
2192
+ (o) => o.semanticExecutionPayload
2193
+ ), i = T((o) => o.actions.addFilter), { hasEntities: n } = rn(), { isLoading: l } = Rr(), s = Q(
2194
+ () => Jt(e, a),
2177
2195
  [e, a]
2178
- ), m = !Zt(e.filters) && s.hasEligibleCards && !i;
2196
+ ), p = !er(e.filters) && s.hasEligibleCards && !l;
2179
2197
  return /* @__PURE__ */ r("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
2180
- m && /* @__PURE__ */ t("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ r(
2198
+ p && /* @__PURE__ */ t("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ r(
2181
2199
  "button",
2182
2200
  {
2183
2201
  type: "button",
2184
- onClick: () => o(Jt()),
2202
+ onClick: () => i(tr()),
2185
2203
  title: `Applies to ${s.eligibleCardCount} of ${s.totalCardCount} date-aware cards`,
2186
2204
  className: "flex w-full items-start gap-2 rounded-control px-2 py-1.5 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border",
2187
2205
  children: [
2188
- /* @__PURE__ */ t(xa, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
2206
+ /* @__PURE__ */ t(ya, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
2189
2207
  /* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col", children: [
2190
2208
  /* @__PURE__ */ t("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
2191
2209
  /* @__PURE__ */ t("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
@@ -2194,31 +2212,31 @@ function Xa() {
2194
2212
  }
2195
2213
  ) }),
2196
2214
  !n && /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
2197
- /* @__PURE__ */ t(Br, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
2215
+ /* @__PURE__ */ t(Ur, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
2198
2216
  /* @__PURE__ */ t("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
2199
2217
  /* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
2200
2218
  ] }),
2201
- n && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(Tr, { context: "filter" }) })
2219
+ n && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(Vr, { context: "filter" }) })
2202
2220
  ] });
2203
2221
  }
2204
- const wt = !1;
2205
- function Za({
2222
+ const St = !1;
2223
+ function nn({
2206
2224
  onAddFilter: e,
2207
2225
  onAddControl: a,
2208
- onManageControls: o,
2226
+ onManageControls: i,
2209
2227
  onDismiss: n
2210
2228
  }) {
2211
- const i = L(
2212
- (m) => m.dashboard.filterLayout
2213
- ), { setFilterLayout: s } = be();
2214
- i != null && i.displayMode;
2215
- const c = (i == null ? void 0 : i.toolbarWrap) ?? !1;
2216
- return i == null || i.showDownloadButton, /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
2229
+ const l = T(
2230
+ (p) => p.dashboard.filterLayout
2231
+ ), { setFilterLayout: s } = ve();
2232
+ l != null && l.displayMode;
2233
+ const u = (l == null ? void 0 : l.toolbarWrap) ?? !1;
2234
+ return l == null || l.showDownloadButton, /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
2217
2235
  /* @__PURE__ */ r("div", { className: "p-1", children: [
2218
2236
  /* @__PURE__ */ t(
2219
- Je,
2237
+ rt,
2220
2238
  {
2221
- icon: Vt,
2239
+ icon: _t,
2222
2240
  label: "Add filter",
2223
2241
  onClick: () => {
2224
2242
  e(), n();
@@ -2226,9 +2244,9 @@ function Za({
2226
2244
  }
2227
2245
  ),
2228
2246
  /* @__PURE__ */ t(
2229
- Je,
2247
+ rt,
2230
2248
  {
2231
- icon: Et,
2249
+ icon: It,
2232
2250
  label: "Add control",
2233
2251
  onClick: () => {
2234
2252
  a(), n();
@@ -2236,12 +2254,12 @@ function Za({
2236
2254
  }
2237
2255
  ),
2238
2256
  /* @__PURE__ */ t(
2239
- Je,
2257
+ rt,
2240
2258
  {
2241
- icon: Pt,
2259
+ icon: Mt,
2242
2260
  label: "Manage controls",
2243
2261
  onClick: () => {
2244
- o(), n();
2262
+ i(), n();
2245
2263
  }
2246
2264
  }
2247
2265
  )
@@ -2249,30 +2267,30 @@ function Za({
2249
2267
  /* @__PURE__ */ t("div", { className: "border-t border-border/60" }),
2250
2268
  /* @__PURE__ */ r("div", { className: "space-y-1 p-2", children: [
2251
2269
  /* @__PURE__ */ t("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
2252
- wt,
2270
+ St,
2253
2271
  /* @__PURE__ */ t(
2254
- Ja,
2272
+ sn,
2255
2273
  {
2256
2274
  id: "filter-display-wrap",
2257
2275
  label: "Wrap to multiple lines",
2258
- checked: c,
2259
- onCheckedChange: (m) => s({ toolbarWrap: m === !0 })
2276
+ checked: u,
2277
+ onCheckedChange: (p) => s({ toolbarWrap: p === !0 })
2260
2278
  }
2261
2279
  ),
2262
- wt
2280
+ St
2263
2281
  ] })
2264
2282
  ] });
2265
2283
  }
2266
- function Je({
2284
+ function rt({
2267
2285
  icon: e,
2268
2286
  label: a,
2269
- onClick: o
2287
+ onClick: i
2270
2288
  }) {
2271
2289
  return /* @__PURE__ */ r(
2272
2290
  "button",
2273
2291
  {
2274
2292
  type: "button",
2275
- onClick: o,
2293
+ onClick: i,
2276
2294
  className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-[13px] text-foreground outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40",
2277
2295
  children: [
2278
2296
  /* @__PURE__ */ t(e, { className: "h-3.5 w-3.5 text-muted-foreground" }),
@@ -2281,16 +2299,16 @@ function Je({
2281
2299
  }
2282
2300
  );
2283
2301
  }
2284
- function Ja({
2302
+ function sn({
2285
2303
  id: e,
2286
2304
  label: a,
2287
- checked: o,
2305
+ checked: i,
2288
2306
  onCheckedChange: n
2289
2307
  }) {
2290
2308
  return /* @__PURE__ */ r("div", { className: "flex items-center gap-2 rounded-control px-1 py-1 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
2291
- /* @__PURE__ */ t(ct, { id: e, checked: o, onCheckedChange: n }),
2309
+ /* @__PURE__ */ t(mt, { id: e, checked: i, onCheckedChange: n }),
2292
2310
  /* @__PURE__ */ t(
2293
- Ne,
2311
+ ke,
2294
2312
  {
2295
2313
  htmlFor: e,
2296
2314
  className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
@@ -2299,155 +2317,155 @@ function Ja({
2299
2317
  )
2300
2318
  ] });
2301
2319
  }
2302
- function Gn({
2320
+ function Jn({
2303
2321
  size: e,
2304
2322
  className: a,
2305
- primaryButtonClassName: o,
2323
+ primaryButtonClassName: i,
2306
2324
  secondaryButtonClassName: n,
2307
- pickerContentClassName: i,
2325
+ pickerContentClassName: l,
2308
2326
  settingsContentClassName: s
2309
2327
  }) {
2310
- var U;
2311
- const [c, m] = A(null), l = L((b) => b.dashboard), u = L((b) => b.selectedSheetId), d = L((b) => b.showFilters), p = Ur((b) => b.setPanelOpen), h = L((b) => b.actions), { setDocumentPanelTarget: f, setShowFilters: g } = h, k = (U = l.sheets) == null ? void 0 : U.find(
2312
- (b) => b.id === u
2313
- ), x = er(k), D = W((b) => {
2328
+ var F;
2329
+ const [u, p] = E(null), o = T((g) => g.dashboard), c = T((g) => g.selectedSheetId), d = T((g) => g.showFilters), m = Pr((g) => g.setPanelOpen), h = T((g) => g.actions), { setDocumentPanelTarget: f, setShowFilters: b } = h, k = (F = o.sheets) == null ? void 0 : F.find(
2330
+ (g) => g.id === c
2331
+ ), I = rr(k), y = H((g) => {
2314
2332
  window.setTimeout(() => {
2315
- m(b);
2333
+ p(g);
2316
2334
  }, 0);
2317
- }, []), S = W(
2318
- (b) => {
2319
- if (x && u) {
2320
- b && f(u, {
2335
+ }, []), S = H(
2336
+ (g) => {
2337
+ if (I && c) {
2338
+ g && f(c, {
2321
2339
  kind: "document",
2322
2340
  group: "inputs"
2323
2341
  });
2324
2342
  return;
2325
2343
  }
2326
- b && p("dashboard", !1), g(b);
2344
+ g && m("dashboard", !1), b(g);
2327
2345
  },
2328
2346
  [
2329
- x,
2330
- u,
2347
+ I,
2348
+ c,
2331
2349
  f,
2332
- p,
2333
- g
2350
+ m,
2351
+ b
2334
2352
  ]
2335
- ), C = W(() => {
2353
+ ), D = H(() => {
2336
2354
  S(!0);
2337
- }, [S]), w = W(() => {
2338
- D("create");
2339
- }, [D]), E = W(() => {
2340
- D("manage");
2341
- }, [D]);
2342
- return /* @__PURE__ */ r($, { children: [
2355
+ }, [S]), w = H(() => {
2356
+ y("create");
2357
+ }, [y]), C = H(() => {
2358
+ y("manage");
2359
+ }, [y]);
2360
+ return /* @__PURE__ */ r(j, { children: [
2343
2361
  /* @__PURE__ */ t(
2344
- Ya,
2362
+ tn,
2345
2363
  {
2346
- showFilters: x ? !1 : d,
2364
+ showFilters: I ? !1 : d,
2347
2365
  onShowFiltersChange: S,
2348
- pickerContent: /* @__PURE__ */ t(Xa, {}),
2349
- settingsContent: (b) => /* @__PURE__ */ t(
2350
- Za,
2366
+ pickerContent: /* @__PURE__ */ t(an, {}),
2367
+ settingsContent: (g) => /* @__PURE__ */ t(
2368
+ nn,
2351
2369
  {
2352
- onAddFilter: C,
2370
+ onAddFilter: D,
2353
2371
  onAddControl: w,
2354
- onManageControls: E,
2355
- onDismiss: b
2372
+ onManageControls: C,
2373
+ onDismiss: g
2356
2374
  }
2357
2375
  ),
2358
2376
  size: e,
2359
2377
  className: a,
2360
- primaryButtonClassName: o,
2378
+ primaryButtonClassName: i,
2361
2379
  secondaryButtonClassName: n,
2362
- pickerContentClassName: i,
2380
+ pickerContentClassName: l,
2363
2381
  settingsContentClassName: s
2364
2382
  }
2365
2383
  ),
2366
- c ? x ? /* @__PURE__ */ t(
2367
- Wa,
2384
+ u ? I ? /* @__PURE__ */ t(
2385
+ Ya,
2368
2386
  {
2369
2387
  open: !0,
2370
- onOpenChange: (b) => {
2371
- b || m(null);
2388
+ onOpenChange: (g) => {
2389
+ g || p(null);
2372
2390
  },
2373
- initialMode: c
2391
+ initialMode: u
2374
2392
  }
2375
2393
  ) : /* @__PURE__ */ t(
2376
- $a,
2394
+ Xa,
2377
2395
  {
2378
2396
  open: !0,
2379
- onOpenChange: (b) => {
2380
- b || m(null);
2397
+ onOpenChange: (g) => {
2398
+ g || p(null);
2381
2399
  },
2382
2400
  showTrigger: !1,
2383
- initialMode: c
2401
+ initialMode: u
2384
2402
  }
2385
2403
  ) : null
2386
2404
  ] });
2387
2405
  }
2388
- function en({
2406
+ function on({
2389
2407
  disabled: e,
2390
2408
  briefingCount: a,
2391
- className: o,
2409
+ className: i,
2392
2410
  onClick: n
2393
2411
  }) {
2394
- const i = typeof a == "number" && a > 0;
2412
+ const l = typeof a == "number" && a > 0;
2395
2413
  return /* @__PURE__ */ r(
2396
- T,
2414
+ R,
2397
2415
  {
2398
2416
  type: "button",
2399
2417
  size: "xs",
2400
2418
  variant: "outline",
2401
2419
  disabled: e,
2402
- className: G("gap-1.5", o),
2420
+ className: X("gap-1.5", i),
2403
2421
  onClick: n,
2404
2422
  "aria-label": "Reports & briefings",
2405
2423
  children: [
2406
- /* @__PURE__ */ t(Ca, { className: "h-3.5 w-3.5" }),
2424
+ /* @__PURE__ */ t(Na, { className: "h-3.5 w-3.5" }),
2407
2425
  "Reports & briefings",
2408
- i ? /* @__PURE__ */ t("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
2426
+ l ? /* @__PURE__ */ t("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
2409
2427
  ]
2410
2428
  }
2411
2429
  );
2412
2430
  }
2413
- const tn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", jt = "inline-flex h-7 items-center gap-1.5 rounded-control px-2 text-[12px] text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50", Pe = "inline-flex h-7 items-center gap-1.5 rounded-control bg-primary px-3 text-[12px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50";
2414
- function rn(e) {
2431
+ const ln = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", Ht = "inline-flex h-7 items-center gap-1.5 rounded-control px-2 text-[12px] text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50", Oe = "inline-flex h-7 items-center gap-1.5 rounded-control bg-primary px-3 text-[12px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50";
2432
+ function dn(e) {
2415
2433
  return e === "dashboard" ? "This dashboard" : "Project";
2416
2434
  }
2417
- function an(e) {
2435
+ function cn(e) {
2418
2436
  if (!e) return "Never";
2419
2437
  const a = new Date(e);
2420
2438
  if (Number.isNaN(a.getTime())) return "Unknown";
2421
- const o = Date.now() - a.getTime(), n = Math.round(o / 6e4);
2439
+ const i = Date.now() - a.getTime(), n = Math.round(i / 6e4);
2422
2440
  if (n < 1) return "now";
2423
2441
  if (n < 60) return `${n}m ago`;
2424
- const i = Math.round(n / 60);
2425
- if (i < 24) return `${i}h ago`;
2426
- const s = Math.round(i / 24);
2442
+ const l = Math.round(n / 60);
2443
+ if (l < 24) return `${l}h ago`;
2444
+ const s = Math.round(l / 24);
2427
2445
  if (s < 7) return `${s}d ago`;
2428
- const c = Math.round(s / 7);
2429
- return c < 5 ? `${c}w ago` : `${Math.round(s / 30)}mo ago`;
2446
+ const u = Math.round(s / 7);
2447
+ return u < 5 ? `${u}w ago` : `${Math.round(s / 30)}mo ago`;
2430
2448
  }
2431
- function nn(e) {
2432
- return e.scheduleExpr ? fa(
2449
+ function un(e) {
2450
+ return e.scheduleExpr ? ba(
2433
2451
  e.scheduleExpr,
2434
2452
  e.timezone || "UTC"
2435
2453
  ) ?? "Invalid schedule" : "On demand";
2436
2454
  }
2437
- function sn(e) {
2455
+ function hn(e) {
2438
2456
  if (e.lastRunStatus) {
2439
2457
  const a = e.lastRunStatus.toString().toUpperCase();
2440
2458
  return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${e.lastRunStatus.toString().toLowerCase()}`;
2441
2459
  }
2442
2460
  return null;
2443
2461
  }
2444
- function Wt(e) {
2462
+ function qt(e) {
2445
2463
  return e.hasActiveRun ? "Running" : e.lastRunStatus ? `Last run ${e.lastRunStatus.toString().toLowerCase()}` : "Idle";
2446
2464
  }
2447
- function on(e) {
2465
+ function mn(e) {
2448
2466
  return e.source.type === "dashboard" ? "This dashboard" : "Project";
2449
2467
  }
2450
- function ln({
2468
+ function pn({
2451
2469
  activeView: e,
2452
2470
  onChange: a
2453
2471
  }) {
@@ -2457,121 +2475,121 @@ function ln({
2457
2475
  className: "flex shrink-0 items-center gap-1 rounded-control bg-muted p-0.5",
2458
2476
  role: "tablist",
2459
2477
  "aria-label": "Briefing source view",
2460
- children: ["dashboard", "project"].map((o) => {
2461
- const n = e === o;
2478
+ children: ["dashboard", "project"].map((i) => {
2479
+ const n = e === i;
2462
2480
  return /* @__PURE__ */ t(
2463
2481
  "button",
2464
2482
  {
2465
2483
  type: "button",
2466
2484
  role: "tab",
2467
2485
  "aria-selected": n,
2468
- onClick: () => a(o),
2469
- className: G(
2486
+ onClick: () => a(i),
2487
+ className: X(
2470
2488
  "h-6 rounded-[3px] px-2 text-[11px] transition-colors",
2471
2489
  n ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
2472
2490
  ),
2473
- children: rn(o)
2491
+ children: dn(i)
2474
2492
  },
2475
- o
2493
+ i
2476
2494
  );
2477
2495
  })
2478
2496
  }
2479
2497
  );
2480
2498
  }
2481
- function dn({
2499
+ function fn({
2482
2500
  briefings: e,
2483
2501
  dashboardLabel: a,
2484
- sourceView: o,
2502
+ sourceView: i,
2485
2503
  error: n,
2486
- loading: i,
2504
+ loading: l,
2487
2505
  onSourceViewChange: s,
2488
- onClose: c,
2489
- onEdit: m,
2490
- onNew: l,
2491
- canCreate: u,
2506
+ onClose: u,
2507
+ onEdit: p,
2508
+ onNew: o,
2509
+ canCreate: c,
2492
2510
  canCreateScheduledReport: d,
2493
- analyticalBriefingsEnabled: p,
2511
+ analyticalBriefingsEnabled: m,
2494
2512
  onRunNow: h,
2495
2513
  onTogglePause: f,
2496
- onDelete: g,
2514
+ onDelete: b,
2497
2515
  selectingId: k,
2498
- busyId: x,
2499
- manageBriefingsHref: D,
2516
+ busyId: I,
2517
+ manageBriefingsHref: y,
2500
2518
  contentKind: S,
2501
- hideHeader: C = !1
2519
+ hideHeader: D = !1
2502
2520
  }) {
2503
- const w = e.length, E = e.filter((I) => I.status === "ACTIVE").length, U = S === "reports" ? w === 1 ? "report" : "reports" : S === "briefings" ? w === 1 ? "briefing" : "briefings" : w === 1 ? "item" : "items", b = e.find((I) => I.hasActiveRun) ?? null, y = S ?? "reports & briefings", R = o === "dashboard" ? a : `Project ${y}`;
2521
+ const w = e.length, C = e.filter((A) => A.status === "ACTIVE").length, F = S === "reports" ? w === 1 ? "report" : "reports" : S === "briefings" ? w === 1 ? "briefing" : "briefings" : w === 1 ? "item" : "items", g = e.find((A) => A.hasActiveRun) ?? null, v = S ?? "reports & briefings", U = i === "dashboard" ? a : `Project ${v}`;
2504
2522
  return /* @__PURE__ */ r(
2505
2523
  "section",
2506
2524
  {
2507
- "aria-label": `Dashboard ${y.replace("&", "and")}`,
2525
+ "aria-label": `Dashboard ${v.replace("&", "and")}`,
2508
2526
  className: "flex h-full min-h-0 flex-col bg-background text-foreground",
2509
2527
  children: [
2510
- C ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
2528
+ D ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
2511
2529
  /* @__PURE__ */ r("div", { className: "min-w-0", children: [
2512
- /* @__PURE__ */ t("div", { className: tn, children: y }),
2513
- /* @__PURE__ */ t("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: R })
2530
+ /* @__PURE__ */ t("div", { className: ln, children: v }),
2531
+ /* @__PURE__ */ t("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: U })
2514
2532
  ] }),
2515
2533
  /* @__PURE__ */ t(
2516
2534
  "button",
2517
2535
  {
2518
2536
  type: "button",
2519
- onClick: c,
2537
+ onClick: u,
2520
2538
  className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
2521
- "aria-label": `Close ${y.replace("&", "and")} panel`,
2522
- children: /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5" })
2539
+ "aria-label": `Close ${v.replace("&", "and")} panel`,
2540
+ children: /* @__PURE__ */ t(Ze, { className: "h-3.5 w-3.5" })
2523
2541
  }
2524
2542
  )
2525
2543
  ] }),
2526
2544
  /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3 border-b border-border px-4 py-2", children: [
2527
2545
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-3", children: [
2528
2546
  /* @__PURE__ */ t(
2529
- ln,
2547
+ pn,
2530
2548
  {
2531
- activeView: o,
2549
+ activeView: i,
2532
2550
  onChange: s
2533
2551
  }
2534
2552
  ),
2535
- /* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && w === 0 ? /* @__PURE__ */ r("span", { children: [
2553
+ /* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: l && w === 0 ? /* @__PURE__ */ r("span", { children: [
2536
2554
  "Loading ",
2537
- y,
2555
+ v,
2538
2556
  "…"
2539
2557
  ] }) : w === 0 ? /* @__PURE__ */ r("span", { children: [
2540
2558
  "No ",
2541
- y,
2559
+ v,
2542
2560
  " yet"
2543
- ] }) : /* @__PURE__ */ r($, { children: [
2561
+ ] }) : /* @__PURE__ */ r(j, { children: [
2544
2562
  /* @__PURE__ */ r("span", { className: "font-medium text-foreground/80", children: [
2545
2563
  w,
2546
2564
  " ",
2547
- U
2565
+ F
2548
2566
  ] }),
2549
2567
  /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
2550
2568
  /* @__PURE__ */ r("span", { children: [
2551
- E,
2569
+ C,
2552
2570
  " active"
2553
2571
  ] })
2554
2572
  ] }) })
2555
2573
  ] }),
2556
2574
  /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
2557
- i ? (
2575
+ l ? (
2558
2576
  // Auto-refresh on open; surface a quiet spinner near the count
2559
2577
  // when a manual reload is in flight, but don't show a separate
2560
2578
  // refresh button — close+reopen handles the rare "stale list"
2561
2579
  // case without crowding the toolbar.
2562
- /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
2580
+ /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
2563
2581
  ) : null,
2564
- w > 0 && u ? p && d ? /* @__PURE__ */ r(We, { children: [
2565
- /* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Pe, children: [
2566
- /* @__PURE__ */ t(ge, { className: "h-3 w-3" }),
2582
+ w > 0 && c ? m && d ? /* @__PURE__ */ r(Ge, { children: [
2583
+ /* @__PURE__ */ t(Xe, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Oe, children: [
2584
+ /* @__PURE__ */ t(xe, { className: "h-3 w-3" }),
2567
2585
  " New"
2568
2586
  ] }) }),
2569
- /* @__PURE__ */ r(qe, { align: "end", children: [
2570
- /* @__PURE__ */ t(q, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
2587
+ /* @__PURE__ */ r(Ke, { align: "end", children: [
2588
+ /* @__PURE__ */ t(G, { onClick: () => o("scheduled_report"), children: "Schedule a report" }),
2571
2589
  /* @__PURE__ */ t(
2572
- q,
2590
+ G,
2573
2591
  {
2574
- onClick: () => l("analytical_briefing"),
2592
+ onClick: () => o("analytical_briefing"),
2575
2593
  children: "Create analytical briefing"
2576
2594
  }
2577
2595
  )
@@ -2579,66 +2597,66 @@ function dn({
2579
2597
  ] }) : d ? /* @__PURE__ */ r(
2580
2598
  "button",
2581
2599
  {
2582
- onClick: () => l("scheduled_report"),
2583
- className: Pe,
2600
+ onClick: () => o("scheduled_report"),
2601
+ className: Oe,
2584
2602
  children: [
2585
- /* @__PURE__ */ t(ge, { className: "h-3 w-3" }),
2603
+ /* @__PURE__ */ t(xe, { className: "h-3 w-3" }),
2586
2604
  " Schedule report"
2587
2605
  ]
2588
2606
  }
2589
- ) : p ? /* @__PURE__ */ r(
2607
+ ) : m ? /* @__PURE__ */ r(
2590
2608
  "button",
2591
2609
  {
2592
- onClick: () => l("analytical_briefing"),
2593
- className: Pe,
2610
+ onClick: () => o("analytical_briefing"),
2611
+ className: Oe,
2594
2612
  children: [
2595
- /* @__PURE__ */ t(ge, { className: "h-3 w-3" }),
2613
+ /* @__PURE__ */ t(xe, { className: "h-3 w-3" }),
2596
2614
  " New briefing"
2597
2615
  ]
2598
2616
  }
2599
2617
  ) : null : null
2600
2618
  ] })
2601
2619
  ] }),
2602
- b ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
2603
- /* @__PURE__ */ t(re, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
2604
- /* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: b.name }),
2620
+ g ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
2621
+ /* @__PURE__ */ t(ae, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
2622
+ /* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: g.name }),
2605
2623
  /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
2606
- /* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: Wt(b) })
2624
+ /* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: qt(g) })
2607
2625
  ] }) : null,
2608
2626
  /* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: [
2609
2627
  n ? /* @__PURE__ */ t("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: n }) : null,
2610
- !i && e.length === 0 && !n ? /* @__PURE__ */ t(
2611
- cn,
2628
+ !l && e.length === 0 && !n ? /* @__PURE__ */ t(
2629
+ gn,
2612
2630
  {
2613
- onNew: l,
2614
- canCreate: u,
2631
+ onNew: o,
2632
+ canCreate: c,
2615
2633
  canCreateScheduledReport: d,
2616
- analyticalBriefingsEnabled: p,
2634
+ analyticalBriefingsEnabled: m,
2617
2635
  contentKind: S
2618
2636
  }
2619
2637
  ) : null,
2620
- e.map((I) => /* @__PURE__ */ t(
2621
- hn,
2638
+ e.map((A) => /* @__PURE__ */ t(
2639
+ xn,
2622
2640
  {
2623
- briefing: I,
2624
- isOpening: k === I.id,
2625
- isBusy: x === I.id,
2626
- onOpen: () => m(I.id),
2627
- onRunNow: () => h(I),
2628
- onTogglePause: () => f(I),
2629
- onDelete: () => g(I)
2641
+ briefing: A,
2642
+ isOpening: k === A.id,
2643
+ isBusy: I === A.id,
2644
+ onOpen: () => p(A.id),
2645
+ onRunNow: () => h(A),
2646
+ onTogglePause: () => f(A),
2647
+ onDelete: () => b(A)
2630
2648
  },
2631
- I.id
2649
+ A.id
2632
2650
  ))
2633
2651
  ] }),
2634
- D ? /* @__PURE__ */ t("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
2652
+ y ? /* @__PURE__ */ t("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
2635
2653
  "a",
2636
2654
  {
2637
- href: D,
2638
- className: G(jt, "h-6 px-1 text-[11px]"),
2655
+ href: y,
2656
+ className: X(Ht, "h-6 px-1 text-[11px]"),
2639
2657
  children: [
2640
2658
  "Manage all reports & briefings",
2641
- /* @__PURE__ */ t(ba, { className: "h-3 w-3" })
2659
+ /* @__PURE__ */ t(va, { className: "h-3 w-3" })
2642
2660
  ]
2643
2661
  }
2644
2662
  ) }) : null
@@ -2646,32 +2664,32 @@ function dn({
2646
2664
  }
2647
2665
  );
2648
2666
  }
2649
- function cn({
2667
+ function gn({
2650
2668
  onNew: e,
2651
2669
  canCreate: a,
2652
- canCreateScheduledReport: o,
2670
+ canCreateScheduledReport: i,
2653
2671
  analyticalBriefingsEnabled: n,
2654
- contentKind: i
2672
+ contentKind: l
2655
2673
  }) {
2656
- const s = i === "reports" ? {
2674
+ const s = l === "reports" ? {
2657
2675
  title: "No reports yet",
2658
2676
  description: "Schedule an emailed dashboard or visual report to see it here."
2659
- } : i === "briefings" ? {
2677
+ } : l === "briefings" ? {
2660
2678
  title: "No briefings yet",
2661
2679
  description: "Create an analytical briefing to monitor this dashboard and brief your team."
2662
2680
  } : null;
2663
2681
  return /* @__PURE__ */ r("div", { className: "flex h-full flex-col items-center justify-center px-8 py-12 text-center", children: [
2664
- /* @__PURE__ */ t(un, { className: "mb-5 h-[88px] w-[112px] text-border" }),
2682
+ /* @__PURE__ */ t(bn, { className: "mb-5 h-[88px] w-[112px] text-border" }),
2665
2683
  /* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: (s == null ? void 0 : s.title) ?? "Have an analyst brief your team" }),
2666
2684
  /* @__PURE__ */ t("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (s == null ? void 0 : s.description) ?? "Describe what to watch. An analyst digs into this dashboard and the data behind it, then briefs your team on the cadence you choose." }),
2667
2685
  a ? /* @__PURE__ */ r("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
2668
- o ? /* @__PURE__ */ r(
2686
+ i ? /* @__PURE__ */ r(
2669
2687
  "button",
2670
2688
  {
2671
2689
  onClick: () => e("scheduled_report"),
2672
- className: Pe,
2690
+ className: Oe,
2673
2691
  children: [
2674
- /* @__PURE__ */ t(ge, { className: "h-3 w-3" }),
2692
+ /* @__PURE__ */ t(xe, { className: "h-3 w-3" }),
2675
2693
  " Schedule a report"
2676
2694
  ]
2677
2695
  }
@@ -2680,14 +2698,14 @@ function cn({
2680
2698
  "button",
2681
2699
  {
2682
2700
  onClick: () => e("analytical_briefing"),
2683
- className: jt,
2701
+ className: Ht,
2684
2702
  children: "Create analytical briefing"
2685
2703
  }
2686
2704
  ) : null
2687
2705
  ] }) : null
2688
2706
  ] });
2689
2707
  }
2690
- function un({ className: e }) {
2708
+ function bn({ className: e }) {
2691
2709
  return /* @__PURE__ */ r(
2692
2710
  "svg",
2693
2711
  {
@@ -2864,22 +2882,22 @@ function un({ className: e }) {
2864
2882
  }
2865
2883
  );
2866
2884
  }
2867
- function hn({
2885
+ function xn({
2868
2886
  briefing: e,
2869
2887
  isOpening: a,
2870
- isBusy: o,
2888
+ isBusy: i,
2871
2889
  onOpen: n,
2872
- onRunNow: i,
2890
+ onRunNow: l,
2873
2891
  onTogglePause: s,
2874
- onDelete: c
2892
+ onDelete: u
2875
2893
  }) {
2876
- const m = e.status === "PAUSED", l = e.hasActiveRun, u = sn(e), d = an(e.lastRunAt), p = e.lastRunStatus, h = se(e), f = p === "SUCCESS" ? Re.success.dot : p === "FAILED" ? Re.danger.dot : p ? Re.warning.dot : Re.neutral.dot;
2894
+ const p = e.status === "PAUSED", o = e.hasActiveRun, c = hn(e), d = cn(e.lastRunAt), m = e.lastRunStatus, h = oe(e), f = m === "SUCCESS" ? _e.success.dot : m === "FAILED" ? _e.danger.dot : m ? _e.warning.dot : _e.neutral.dot;
2877
2895
  return /* @__PURE__ */ r(
2878
2896
  "div",
2879
2897
  {
2880
- className: G(
2898
+ className: X(
2881
2899
  "group relative border-b border-border/60 px-4 py-3 transition-colors hover:bg-muted/60",
2882
- m && "opacity-70"
2900
+ p && "opacity-70"
2883
2901
  ),
2884
2902
  children: [
2885
2903
  /* @__PURE__ */ r(
@@ -2888,23 +2906,23 @@ function hn({
2888
2906
  role: "button",
2889
2907
  tabIndex: 0,
2890
2908
  onClick: n,
2891
- onKeyDown: (g) => {
2892
- (g.key === "Enter" || g.key === " ") && (g.preventDefault(), n());
2909
+ onKeyDown: (b) => {
2910
+ (b.key === "Enter" || b.key === " ") && (b.preventDefault(), n());
2893
2911
  },
2894
2912
  className: "cursor-pointer pr-8",
2895
2913
  children: [
2896
2914
  /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
2897
2915
  /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.name }),
2898
- m ? /* @__PURE__ */ t("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
2916
+ p ? /* @__PURE__ */ t("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
2899
2917
  ] }),
2900
2918
  /* @__PURE__ */ r("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
2901
2919
  /* @__PURE__ */ t("span", { children: h.typeLabel }),
2902
2920
  /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
2903
- /* @__PURE__ */ t("span", { children: on(e) }),
2921
+ /* @__PURE__ */ t("span", { children: mn(e) }),
2904
2922
  /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
2905
- /* @__PURE__ */ t(Rr, { className: "h-3 w-3" }),
2906
- /* @__PURE__ */ t("span", { className: "truncate", children: nn(e) }),
2907
- e.lastRunAt ? /* @__PURE__ */ r($, { children: [
2923
+ /* @__PURE__ */ t(_r, { className: "h-3 w-3" }),
2924
+ /* @__PURE__ */ t("span", { className: "truncate", children: un(e) }),
2925
+ e.lastRunAt ? /* @__PURE__ */ r(j, { children: [
2908
2926
  /* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
2909
2927
  /* @__PURE__ */ r("span", { children: [
2910
2928
  "Last run ",
@@ -2912,75 +2930,75 @@ function hn({
2912
2930
  ] })
2913
2931
  ] }) : null
2914
2932
  ] }),
2915
- u || l ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
2916
- l ? /* @__PURE__ */ t(re, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ t(
2933
+ c || o ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
2934
+ o ? /* @__PURE__ */ t(ae, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ t(
2917
2935
  "span",
2918
2936
  {
2919
- className: G(
2937
+ className: X(
2920
2938
  "inline-block h-1.5 w-1.5 shrink-0 rounded-full",
2921
2939
  f
2922
2940
  )
2923
2941
  }
2924
2942
  ),
2925
- /* @__PURE__ */ t("span", { className: "truncate", children: l ? Wt(e) : u })
2943
+ /* @__PURE__ */ t("span", { className: "truncate", children: o ? qt(e) : c })
2926
2944
  ] }) : null
2927
2945
  ]
2928
2946
  }
2929
2947
  ),
2930
- /* @__PURE__ */ t("div", { className: "absolute right-3 top-3", children: o ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ r(We, { children: [
2931
- /* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ t(
2948
+ /* @__PURE__ */ t("div", { className: "absolute right-3 top-3", children: i ? /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ r(Ge, { children: [
2949
+ /* @__PURE__ */ t(Xe, { asChild: !0, children: /* @__PURE__ */ t(
2932
2950
  "button",
2933
2951
  {
2934
2952
  type: "button",
2935
- onClick: (g) => g.stopPropagation(),
2953
+ onClick: (b) => b.stopPropagation(),
2936
2954
  className: "inline-flex h-6 w-6 items-center justify-center rounded-control text-muted-foreground/70 opacity-60 hover:bg-muted hover:text-foreground/80 focus-visible:opacity-100 group-hover:opacity-100",
2937
2955
  "aria-label": `${h.noun === "report" ? "Report" : "Briefing"} actions`,
2938
- children: /* @__PURE__ */ t(Lt, { className: "h-3.5 w-3.5" })
2956
+ children: /* @__PURE__ */ t(Bt, { className: "h-3.5 w-3.5" })
2939
2957
  }
2940
2958
  ) }),
2941
- /* @__PURE__ */ r(qe, { align: "end", className: "w-44", children: [
2942
- /* @__PURE__ */ r(q, { onClick: n, children: [
2943
- /* @__PURE__ */ t(Pt, { className: "h-3.5 w-3.5" }),
2959
+ /* @__PURE__ */ r(Ke, { align: "end", className: "w-44", children: [
2960
+ /* @__PURE__ */ r(G, { onClick: n, children: [
2961
+ /* @__PURE__ */ t(Mt, { className: "h-3.5 w-3.5" }),
2944
2962
  "Edit ",
2945
2963
  h.noun
2946
2964
  ] }),
2947
2965
  /* @__PURE__ */ r(
2948
- q,
2966
+ G,
2949
2967
  {
2950
- onClick: (g) => {
2951
- g.preventDefault(), i();
2968
+ onClick: (b) => {
2969
+ b.preventDefault(), l();
2952
2970
  },
2953
2971
  children: [
2954
- /* @__PURE__ */ t(Vr, { className: "h-3.5 w-3.5" }),
2972
+ /* @__PURE__ */ t(Mr, { className: "h-3.5 w-3.5" }),
2955
2973
  "Run now"
2956
2974
  ]
2957
2975
  }
2958
2976
  ),
2959
2977
  e.scheduleExpr ? /* @__PURE__ */ t(
2960
- q,
2978
+ G,
2961
2979
  {
2962
- onClick: (g) => {
2963
- g.preventDefault(), s();
2980
+ onClick: (b) => {
2981
+ b.preventDefault(), s();
2964
2982
  },
2965
- children: m ? /* @__PURE__ */ r($, { children: [
2966
- /* @__PURE__ */ t(Pr, { className: "h-3.5 w-3.5" }),
2983
+ children: p ? /* @__PURE__ */ r(j, { children: [
2984
+ /* @__PURE__ */ t(Or, { className: "h-3.5 w-3.5" }),
2967
2985
  "Resume"
2968
- ] }) : /* @__PURE__ */ r($, { children: [
2969
- /* @__PURE__ */ t(Mr, { className: "h-3.5 w-3.5" }),
2986
+ ] }) : /* @__PURE__ */ r(j, { children: [
2987
+ /* @__PURE__ */ t(zr, { className: "h-3.5 w-3.5" }),
2970
2988
  "Pause"
2971
2989
  ] })
2972
2990
  }
2973
2991
  ) : null,
2974
- /* @__PURE__ */ t($e, {}),
2992
+ /* @__PURE__ */ t(He, {}),
2975
2993
  /* @__PURE__ */ r(
2976
- q,
2994
+ G,
2977
2995
  {
2978
- onClick: (g) => {
2979
- g.preventDefault(), c();
2996
+ onClick: (b) => {
2997
+ b.preventDefault(), u();
2980
2998
  },
2981
2999
  className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
2982
3000
  children: [
2983
- /* @__PURE__ */ t(ze, { className: "h-3.5 w-3.5" }),
3001
+ /* @__PURE__ */ t(We, { className: "h-3.5 w-3.5" }),
2984
3002
  "Delete ",
2985
3003
  h.noun
2986
3004
  ]
@@ -2992,263 +3010,263 @@ function hn({
2992
3010
  }
2993
3011
  );
2994
3012
  }
2995
- const mn = 2e3, pn = 20 * 6e4;
2996
- function fn(e) {
3013
+ const vn = 2e3, yn = 20 * 6e4;
3014
+ function Cn(e) {
2997
3015
  return (e == null ? void 0 : e.trim()) || "This dashboard";
2998
3016
  }
2999
- function gn(e) {
3017
+ function wn(e) {
3000
3018
  return e === "This dashboard" ? "Watch this dashboard" : `Watch ${e}`;
3001
3019
  }
3002
- function bn(e, a, o) {
3020
+ function Nn(e, a, i) {
3003
3021
  return a !== "dashboard" ? e : e.filter(
3004
- (n) => n.source.type === "dashboard" && n.source.dashboardId === o
3022
+ (n) => n.source.type === "dashboard" && n.source.dashboardId === i
3005
3023
  );
3006
3024
  }
3007
- async function xn(e) {
3008
- const o = [];
3009
- let n = 1, i = 0, s = Number.POSITIVE_INFINITY;
3010
- for (; i < s; ) {
3011
- const c = await e.apiClient.listBriefings(
3025
+ async function Sn(e) {
3026
+ const i = [];
3027
+ let n = 1, l = 0, s = Number.POSITIVE_INFINITY;
3028
+ for (; l < s; ) {
3029
+ const u = await e.apiClient.listBriefings(
3012
3030
  e.apiServiceUrl,
3013
3031
  e.token,
3014
3032
  { scope: "organization", page: n, pageSize: 100 }
3015
3033
  );
3016
- if (o.push(...c.briefings), i += c.briefings.length, s = c.total, c.briefings.length === 0 || i >= s) break;
3034
+ if (i.push(...u.briefings), l += u.briefings.length, s = u.total, u.briefings.length === 0 || l >= s) break;
3017
3035
  n += 1;
3018
3036
  }
3019
- return o;
3037
+ return i;
3020
3038
  }
3021
- const vn = {
3022
- listBriefings: qr,
3023
- getBriefing: Hr,
3024
- pauseBriefing: Wr,
3025
- resumeBriefing: jr,
3026
- deleteBriefing: $r,
3027
- runBriefingNow: zr
3039
+ const Dn = {
3040
+ listBriefings: Kr,
3041
+ getBriefing: Xr,
3042
+ pauseBriefing: Gr,
3043
+ resumeBriefing: qr,
3044
+ deleteBriefing: Hr,
3045
+ runBriefingNow: Wr
3028
3046
  };
3029
- function yn({
3047
+ function kn({
3030
3048
  briefingId: e,
3031
3049
  initialRun: a,
3032
- apiServiceUrl: o,
3050
+ apiServiceUrl: i,
3033
3051
  token: n,
3034
- onTerminal: i,
3052
+ onTerminal: l,
3035
3053
  onTimeout: s,
3036
- onExpand: c
3054
+ onExpand: u
3037
3055
  }) {
3038
- const [m, l] = A(a), { startRun: u } = ea({
3039
- apiServiceUrl: o,
3056
+ const [p, o] = E(a), { startRun: c } = aa({
3057
+ apiServiceUrl: i,
3040
3058
  token: n,
3041
- intervalMs: mn,
3042
- timeoutMs: pn,
3059
+ intervalMs: vn,
3060
+ timeoutMs: yn,
3043
3061
  fetchRun: ({
3044
- apiServiceUrl: p,
3062
+ apiServiceUrl: m,
3045
3063
  token: h,
3046
3064
  runId: f
3047
- }) => ta(p, h, e, f),
3048
- onRun: (p) => {
3049
- l(p);
3065
+ }) => na(m, h, e, f),
3066
+ onRun: (m) => {
3067
+ o(m);
3050
3068
  },
3051
- onTerminalRun: (p) => {
3052
- i(p);
3069
+ onTerminalRun: (m) => {
3070
+ l(m);
3053
3071
  },
3054
3072
  onTimeout: () => {
3055
3073
  s();
3056
3074
  }
3057
- }), d = ce(!1);
3075
+ }), d = ue(!1);
3058
3076
  return Y(() => {
3059
- d.current || (d.current = !0, ra(a.status) ? u(a) : aa(a.status) && i(a));
3060
- }, [a, i, u]), /* @__PURE__ */ t(na, { run: m, onExpand: c });
3077
+ d.current || (d.current = !0, sa(a.status) ? c(a) : oa(a.status) && l(a));
3078
+ }, [a, l, c]), /* @__PURE__ */ t(ia, { run: p, onExpand: u });
3061
3079
  }
3062
- function Kn(e) {
3063
- return /* @__PURE__ */ t(_r, { children: /* @__PURE__ */ t(Cn, { ...e }) });
3080
+ function es(e) {
3081
+ return /* @__PURE__ */ t($r, { children: /* @__PURE__ */ t(En, { ...e }) });
3064
3082
  }
3065
- function Cn({
3083
+ function En({
3066
3084
  dashboardId: e,
3067
3085
  dashboardTitle: a,
3068
- apiServiceUrl: o,
3086
+ apiServiceUrl: i,
3069
3087
  token: n,
3070
- disabled: i,
3088
+ disabled: l,
3071
3089
  className: s,
3072
- manageBriefingsHref: c,
3073
- open: m,
3074
- onOpenChange: l,
3075
- hideTrigger: u = !1,
3090
+ manageBriefingsHref: u,
3091
+ open: p,
3092
+ onOpenChange: o,
3093
+ hideTrigger: c = !1,
3076
3094
  workflowIntent: d,
3077
- client: p
3095
+ client: m
3078
3096
  }) {
3079
- const { authToken: h, tokenProps: f } = Ge(), g = Or(), k = !d || g.canCreate && (d === "scheduled_report" || g.analyticalBriefingsEnabled), [x, D] = A(!1), S = m ?? x, C = (N) => {
3080
- m === void 0 && D(N), l == null || l(N);
3081
- }, [w, E] = A(
3097
+ const { authToken: h, tokenProps: f } = Ye(), b = jr(), k = !d || b.canCreate && (d === "scheduled_report" || b.analyticalBriefingsEnabled), [I, y] = E(!1), S = p ?? I, D = (N) => {
3098
+ p === void 0 && y(N), o == null || o(N);
3099
+ }, [w, C] = E(
3082
3100
  d ? "author" : "list"
3083
- ), [U, b] = A(
3101
+ ), [F, g] = E(
3084
3102
  d ?? "analytical_briefing"
3085
- ), [y, R] = A("dashboard"), [I, H] = A(
3103
+ ), [v, U] = E("dashboard"), [A, q] = E(
3086
3104
  []
3087
- ), [F, P] = A(null), Z = d && !k && !F ? "list" : w, [ae, Ae] = A(!1), [oe, Ie] = A(null), [Fe, ie] = A(null), [j, J] = A(
3105
+ ), [L, P] = E(null), J = d && !k && !L ? "list" : w, [ne, Fe] = E(!1), [ie, Te] = E(null), [Be, le] = E(null), [W, ee] = E(
3088
3106
  null
3089
- ), [le, ee] = A(null), Le = ce(null), xe = ce(S);
3107
+ ), [de, te] = E(null), Re = ue(null), ye = ue(S);
3090
3108
  Y(() => {
3091
- const N = S && !xe.current;
3092
- xe.current = S, !(!N || !d) && (P(null), R("dashboard"), b(d), E("author"), ee(null));
3109
+ const N = S && !ye.current;
3110
+ ye.current = S, !(!N || !d) && (P(null), U("dashboard"), g(d), C("author"), te(null));
3093
3111
  }, [S, d]);
3094
- const [ue, pe] = A(
3112
+ const [he, ge] = E(
3095
3113
  null
3096
- ), [Q, ve] = A(null), _ = o ?? (f == null ? void 0 : f.apiServiceUrl), O = n ?? (h == null ? void 0 : h.accessToken), ne = X(() => ({ ...vn, ...p }), [p]), fe = fn(a), Be = X(() => {
3097
- const N = bn(
3098
- I,
3099
- y,
3114
+ ), [Z, Ce] = E(null), M = i ?? (f == null ? void 0 : f.apiServiceUrl), O = n ?? (h == null ? void 0 : h.accessToken), se = Q(() => ({ ...Dn, ...m }), [m]), be = Cn(a), Ue = Q(() => {
3115
+ const N = Nn(
3116
+ A,
3117
+ v,
3100
3118
  e
3101
3119
  );
3102
3120
  if (!d)
3103
3121
  return N;
3104
3122
  const V = d === "scheduled_report" ? "report" : "briefing";
3105
3123
  return N.filter(
3106
- (Te) => se(Te).noun === V
3124
+ (Ve) => oe(Ve).noun === V
3107
3125
  );
3108
- }, [e, I, y, d]), Ye = X(() => y === "dashboard" ? {
3126
+ }, [e, A, v, d]), Qe = Q(() => v === "dashboard" ? {
3109
3127
  source: { type: "dashboard", dashboardId: e },
3110
- label: fe,
3111
- detail: gn(fe)
3128
+ label: be,
3129
+ detail: wn(be)
3112
3130
  } : {
3113
3131
  source: { type: "project" },
3114
3132
  label: "This project",
3115
3133
  detail: "Use any data in this project."
3116
- }, [e, fe, y]), ye = !!(_ && O), Ce = ga({
3117
- canCreate: g.canCreate,
3118
- analyticalBriefingsEnabled: g.analyticalBriefingsEnabled,
3119
- scheduledReportAvailable: y === "dashboard"
3120
- }), K = W(async () => {
3121
- if (!(!_ || !O)) {
3122
- Ae(!0), ee(null);
3134
+ }, [e, be, v]), we = !!(M && O), Ne = xa({
3135
+ canCreate: b.canCreate,
3136
+ analyticalBriefingsEnabled: b.analyticalBriefingsEnabled,
3137
+ scheduledReportAvailable: v === "dashboard"
3138
+ }), K = H(async () => {
3139
+ if (!(!M || !O)) {
3140
+ Fe(!0), te(null);
3123
3141
  try {
3124
- H(
3125
- await xn({
3126
- apiClient: ne,
3127
- apiServiceUrl: _,
3142
+ q(
3143
+ await Sn({
3144
+ apiClient: se,
3145
+ apiServiceUrl: M,
3128
3146
  token: O
3129
3147
  })
3130
3148
  );
3131
3149
  } catch (N) {
3132
- ee(
3150
+ te(
3133
3151
  N instanceof Error ? N.message : "Could not load briefings."
3134
3152
  );
3135
3153
  } finally {
3136
- Ae(!1);
3154
+ Fe(!1);
3137
3155
  }
3138
3156
  }
3139
- }, [ne, _, O]);
3157
+ }, [se, M, O]);
3140
3158
  Y(() => {
3141
- !S || Z !== "list" || !ye || K();
3142
- }, [ye, Z, K, S]);
3143
- const we = () => {
3144
- P(null), R("dashboard"), E("list"), C(!0);
3145
- }, v = (N) => {
3146
- P(null), b(N), E("author");
3159
+ !S || J !== "list" || !we || K();
3160
+ }, [we, J, K, S]);
3161
+ const Se = () => {
3162
+ P(null), U("dashboard"), C("list"), D(!0);
3163
+ }, x = (N) => {
3164
+ P(null), g(N), C("author");
3147
3165
  }, B = async (N) => {
3148
- if (!(!_ || !O)) {
3149
- Ie(N), ee(null);
3166
+ if (!(!M || !O)) {
3167
+ Te(N), te(null);
3150
3168
  try {
3151
- const V = await ne.getBriefing(
3152
- _,
3169
+ const V = await se.getBriefing(
3170
+ M,
3153
3171
  O,
3154
3172
  N
3155
3173
  );
3156
- P(V.briefing), E("author");
3174
+ P(V.briefing), C("author");
3157
3175
  } catch (V) {
3158
- ee(
3176
+ te(
3159
3177
  V instanceof Error ? V.message : "Could not open briefing."
3160
3178
  );
3161
3179
  } finally {
3162
- Ie(null);
3180
+ Te(null);
3163
3181
  }
3164
3182
  }
3165
- }, M = async (N) => {
3166
- if (!(!_ || !O)) {
3167
- ie(N.id);
3183
+ }, _ = async (N) => {
3184
+ if (!(!M || !O)) {
3185
+ le(N.id);
3168
3186
  try {
3169
- await ne.runBriefingNow(
3170
- _,
3187
+ await se.runBriefingNow(
3188
+ M,
3171
3189
  O,
3172
3190
  N.id,
3173
- { requestId: wn() }
3191
+ { requestId: An() }
3174
3192
  ), K();
3175
3193
  } catch (V) {
3176
- z.error(
3194
+ $.error(
3177
3195
  V instanceof Error ? V.message : "Could not start the run."
3178
3196
  );
3179
3197
  } finally {
3180
- ie(null);
3198
+ le(null);
3181
3199
  }
3182
3200
  }
3183
- }, te = async (N) => {
3184
- if (!_ || !O) return;
3185
- const { noun: V } = se(N), Te = V === "report" ? "Report" : "Briefing";
3186
- ie(N.id);
3201
+ }, re = async (N) => {
3202
+ if (!M || !O) return;
3203
+ const { noun: V } = oe(N), Ve = V === "report" ? "Report" : "Briefing";
3204
+ le(N.id);
3187
3205
  try {
3188
- const Ue = N.status === "PAUSED" ? await ne.resumeBriefing(
3189
- _,
3206
+ const Pe = N.status === "PAUSED" ? await se.resumeBriefing(
3207
+ M,
3190
3208
  O,
3191
3209
  N.id
3192
- ) : await ne.pauseBriefing(
3193
- _,
3210
+ ) : await se.pauseBriefing(
3211
+ M,
3194
3212
  O,
3195
3213
  N.id
3196
3214
  );
3197
- z.success(
3198
- Ue.briefing.status === "PAUSED" ? `${Te} paused` : `${Te} resumed`
3215
+ $.success(
3216
+ Pe.briefing.status === "PAUSED" ? `${Ve} paused` : `${Ve} resumed`
3199
3217
  ), K();
3200
- } catch (Ue) {
3201
- z.error(
3202
- Ue instanceof Error ? Ue.message : `Could not update the ${V} status.`
3218
+ } catch (Pe) {
3219
+ $.error(
3220
+ Pe instanceof Error ? Pe.message : `Could not update the ${V} status.`
3203
3221
  );
3204
3222
  } finally {
3205
- ie(null);
3223
+ le(null);
3206
3224
  }
3207
- }, de = async () => {
3208
- if (!j || !_ || !O) return;
3209
- const N = j;
3210
- ie(N.id);
3225
+ }, ce = async () => {
3226
+ if (!W || !M || !O) return;
3227
+ const N = W;
3228
+ le(N.id);
3211
3229
  try {
3212
- await ne.deleteBriefing(
3213
- _,
3230
+ await se.deleteBriefing(
3231
+ M,
3214
3232
  O,
3215
3233
  N.id
3216
3234
  );
3217
- const { noun: V } = se(N);
3218
- z.success(`${V === "report" ? "Report" : "Briefing"} deleted`), J(null), K();
3235
+ const { noun: V } = oe(N);
3236
+ $.success(`${V === "report" ? "Report" : "Briefing"} deleted`), ee(null), K();
3219
3237
  } catch (V) {
3220
- z.error(
3238
+ $.error(
3221
3239
  V instanceof Error ? V.message : "Could not delete the briefing."
3222
3240
  );
3223
3241
  } finally {
3224
- ie(null);
3242
+ le(null);
3225
3243
  }
3226
- }, Ht = Be.length;
3227
- return g.surfaceVisible ? /* @__PURE__ */ r(Gr, { open: S, onOpenChange: C, children: [
3228
- u ? null : /* @__PURE__ */ t(
3229
- en,
3244
+ }, Gt = Ue.length;
3245
+ return b.surfaceVisible ? /* @__PURE__ */ r(Yr, { open: S, onOpenChange: D, children: [
3246
+ c ? null : /* @__PURE__ */ t(
3247
+ on,
3230
3248
  {
3231
- disabled: i || !ye,
3232
- briefingCount: Ht,
3249
+ disabled: l || !we,
3250
+ briefingCount: Gt,
3233
3251
  className: s,
3234
- onClick: we
3252
+ onClick: Se
3235
3253
  }
3236
3254
  ),
3237
3255
  /* @__PURE__ */ r(
3238
- Kr,
3256
+ Zr,
3239
3257
  {
3240
- ref: Le,
3258
+ ref: Re,
3241
3259
  side: "right",
3242
3260
  hideClose: !0,
3243
3261
  className: "flex h-full w-full flex-col overflow-hidden p-0 outline-none sm:max-w-[560px]",
3244
3262
  onOpenAutoFocus: (N) => {
3245
3263
  var V;
3246
- N.preventDefault(), (V = Le.current) == null || V.focus({ preventScroll: !0 });
3264
+ N.preventDefault(), (V = Re.current) == null || V.focus({ preventScroll: !0 });
3247
3265
  },
3248
3266
  children: [
3249
- /* @__PURE__ */ r(Yr, { className: "sr-only", children: [
3250
- /* @__PURE__ */ t(Qr, { children: "Reports & briefings" }),
3251
- /* @__PURE__ */ t(Xr, { children: "Manage reports and briefings for this dashboard." })
3267
+ /* @__PURE__ */ r(Qr, { className: "sr-only", children: [
3268
+ /* @__PURE__ */ t(Jr, { children: "Reports & briefings" }),
3269
+ /* @__PURE__ */ t(ea, { children: "Manage reports and briefings for this dashboard." })
3252
3270
  ] }),
3253
3271
  d ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
3254
3272
  /* @__PURE__ */ r(
@@ -3263,17 +3281,17 @@ function Cn({
3263
3281
  {
3264
3282
  type: "button",
3265
3283
  role: "tab",
3266
- "aria-selected": Z === "author",
3284
+ "aria-selected": J === "author",
3267
3285
  disabled: !k,
3268
- className: G(
3286
+ className: X(
3269
3287
  "-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
3270
- Z === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
3288
+ J === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
3271
3289
  !k && "cursor-not-allowed opacity-50"
3272
3290
  ),
3273
3291
  onClick: () => {
3274
- k && (P(null), b(d), R("dashboard"), E("author"));
3292
+ k && (P(null), g(d), U("dashboard"), C("author"));
3275
3293
  },
3276
- children: F ? `Edit ${se(F).noun}` : d === "scheduled_report" ? "Schedule report" : "Create briefing"
3294
+ children: L ? `Edit ${oe(L).noun}` : d === "scheduled_report" ? "Schedule report" : "Create briefing"
3277
3295
  }
3278
3296
  ),
3279
3297
  /* @__PURE__ */ t(
@@ -3281,12 +3299,12 @@ function Cn({
3281
3299
  {
3282
3300
  type: "button",
3283
3301
  role: "tab",
3284
- "aria-selected": Z === "list",
3285
- className: G(
3302
+ "aria-selected": J === "list",
3303
+ className: X(
3286
3304
  "-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
3287
- Z === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
3305
+ J === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
3288
3306
  ),
3289
- onClick: () => E("list"),
3307
+ onClick: () => C("list"),
3290
3308
  children: d === "scheduled_report" ? "Manage reports" : "Manage briefings"
3291
3309
  }
3292
3310
  )
@@ -3297,63 +3315,63 @@ function Cn({
3297
3315
  "button",
3298
3316
  {
3299
3317
  type: "button",
3300
- onClick: () => C(!1),
3318
+ onClick: () => D(!1),
3301
3319
  className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
3302
3320
  "aria-label": d === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
3303
- children: /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5" })
3321
+ children: /* @__PURE__ */ t(Ze, { className: "h-3.5 w-3.5" })
3304
3322
  }
3305
3323
  )
3306
3324
  ] }) : null,
3307
- Z === "list" ? /* @__PURE__ */ t(
3308
- dn,
3325
+ J === "list" ? /* @__PURE__ */ t(
3326
+ fn,
3309
3327
  {
3310
- briefings: Be,
3311
- dashboardLabel: fe,
3312
- sourceView: y,
3313
- error: le,
3314
- loading: ae,
3315
- onSourceViewChange: R,
3316
- onClose: () => C(!1),
3328
+ briefings: Ue,
3329
+ dashboardLabel: be,
3330
+ sourceView: v,
3331
+ error: de,
3332
+ loading: ne,
3333
+ onSourceViewChange: U,
3334
+ onClose: () => D(!1),
3317
3335
  onEdit: (N) => {
3318
3336
  B(N);
3319
3337
  },
3320
- onNew: v,
3321
- canCreate: !d && Ce.length > 0,
3322
- canCreateScheduledReport: Ce.includes(
3338
+ onNew: x,
3339
+ canCreate: !d && Ne.length > 0,
3340
+ canCreateScheduledReport: Ne.includes(
3323
3341
  "scheduled_report"
3324
3342
  ),
3325
- analyticalBriefingsEnabled: Ce.includes(
3343
+ analyticalBriefingsEnabled: Ne.includes(
3326
3344
  "analytical_briefing"
3327
3345
  ),
3328
3346
  onRunNow: (N) => {
3329
- M(N);
3347
+ _(N);
3330
3348
  },
3331
3349
  onTogglePause: (N) => {
3332
- te(N);
3350
+ re(N);
3333
3351
  },
3334
- onDelete: (N) => J(N),
3335
- selectingId: oe,
3336
- busyId: Fe,
3337
- manageBriefingsHref: c,
3352
+ onDelete: (N) => ee(N),
3353
+ selectingId: ie,
3354
+ busyId: Be,
3355
+ manageBriefingsHref: u,
3338
3356
  contentKind: d === "scheduled_report" ? "reports" : d === "analytical_briefing" ? "briefings" : void 0,
3339
3357
  hideHeader: !!d
3340
3358
  }
3341
3359
  ) : /* @__PURE__ */ t(
3342
- Zr,
3360
+ ta,
3343
3361
  {
3344
- apiServiceUrl: _,
3362
+ apiServiceUrl: M,
3345
3363
  token: O,
3346
- briefing: F,
3347
- intent: U,
3348
- sourceContext: F ? void 0 : Ye,
3349
- title: F ? `Edit ${se(F).noun}` : U === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
3364
+ briefing: L,
3365
+ intent: F,
3366
+ sourceContext: L ? void 0 : Qe,
3367
+ title: L ? `Edit ${oe(L).noun}` : F === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
3350
3368
  hideHeader: !!d,
3351
3369
  className: "h-full min-h-0 max-w-none border-0 shadow-none",
3352
- onBack: d ? void 0 : () => E("list"),
3353
- onCancel: () => C(!1),
3370
+ onBack: d ? void 0 : () => C("list"),
3371
+ onCancel: () => D(!1),
3354
3372
  onDeleted: () => {
3355
- const N = F ? se(F).noun : "briefing";
3356
- z.success(`${N === "report" ? "Report" : "Briefing"} deleted`), P(null), E("list"), K();
3373
+ const N = L ? oe(L).noun : "briefing";
3374
+ $.success(`${N === "report" ? "Report" : "Briefing"} deleted`), P(null), C("list"), K();
3357
3375
  },
3358
3376
  onRunStarted: () => {
3359
3377
  },
@@ -3361,83 +3379,83 @@ function Cn({
3361
3379
  P(N), K();
3362
3380
  },
3363
3381
  onMinimizeRun: ({ briefing: N, run: V }) => {
3364
- pe({ briefing: N, run: V }), C(!1);
3382
+ ge({ briefing: N, run: V }), D(!1);
3365
3383
  }
3366
3384
  }
3367
3385
  )
3368
3386
  ]
3369
3387
  }
3370
3388
  ),
3371
- ue && _ && O ? /* @__PURE__ */ t(
3372
- yn,
3389
+ he && M && O ? /* @__PURE__ */ t(
3390
+ kn,
3373
3391
  {
3374
- briefingId: ue.briefing.id,
3375
- initialRun: ue.run,
3376
- apiServiceUrl: _,
3392
+ briefingId: he.briefing.id,
3393
+ initialRun: he.run,
3394
+ apiServiceUrl: M,
3377
3395
  token: O,
3378
3396
  onTerminal: (N) => {
3379
- ve({
3380
- briefing: ue.briefing,
3397
+ Ce({
3398
+ briefing: he.briefing,
3381
3399
  run: N
3382
- }), pe(null), K();
3400
+ }), ge(null), K();
3383
3401
  },
3384
3402
  onTimeout: () => {
3385
- pe(null), K();
3403
+ ge(null), K();
3386
3404
  },
3387
3405
  onExpand: () => {
3388
- P(ue.briefing), E("author"), pe(null), C(!0);
3406
+ P(he.briefing), C("author"), ge(null), D(!0);
3389
3407
  }
3390
3408
  }
3391
3409
  ) : null,
3392
- Q ? /* @__PURE__ */ t("div", { className: "fixed bottom-4 right-4 z-50 w-[360px]", children: /* @__PURE__ */ t(
3393
- Jr,
3410
+ Z ? /* @__PURE__ */ t("div", { className: "fixed bottom-4 right-4 z-50 w-[360px]", children: /* @__PURE__ */ t(
3411
+ ra,
3394
3412
  {
3395
- title: Q.run.status === "SUCCESS" ? `${Q.briefing.name} is ready` : `${Q.briefing.name} run failed`,
3396
- durationSeconds: Q.run.startedAt && Q.run.completedAt ? Math.max(
3413
+ title: Z.run.status === "SUCCESS" ? `${Z.briefing.name} is ready` : `${Z.briefing.name} run failed`,
3414
+ durationSeconds: Z.run.startedAt && Z.run.completedAt ? Math.max(
3397
3415
  0,
3398
3416
  Math.floor(
3399
- (new Date(Q.run.completedAt).getTime() - new Date(Q.run.startedAt).getTime()) / 1e3
3417
+ (new Date(Z.run.completedAt).getTime() - new Date(Z.run.startedAt).getTime()) / 1e3
3400
3418
  )
3401
3419
  ) : null,
3402
- status: Q.run.status === "SUCCESS" ? "success" : "failed",
3420
+ status: Z.run.status === "SUCCESS" ? "success" : "failed",
3403
3421
  onView: () => {
3404
- P(Q.briefing), E("author"), ve(null), C(!0);
3422
+ P(Z.briefing), C("author"), Ce(null), D(!0);
3405
3423
  },
3406
- onDismiss: () => ve(null)
3424
+ onDismiss: () => Ce(null)
3407
3425
  }
3408
3426
  ) }) : null,
3409
3427
  /* @__PURE__ */ t(
3410
- at,
3428
+ ot,
3411
3429
  {
3412
- open: !!j,
3430
+ open: !!W,
3413
3431
  onOpenChange: (N) => {
3414
- N || J(null);
3432
+ N || ee(null);
3415
3433
  },
3416
- children: /* @__PURE__ */ r(nt, { children: [
3417
- /* @__PURE__ */ r(st, { children: [
3418
- /* @__PURE__ */ r(ot, { children: [
3434
+ children: /* @__PURE__ */ r(it, { children: [
3435
+ /* @__PURE__ */ r(lt, { children: [
3436
+ /* @__PURE__ */ r(dt, { children: [
3419
3437
  "Delete",
3420
3438
  " ",
3421
- j ? se(j).noun : "briefing",
3439
+ W ? oe(W).noun : "briefing",
3422
3440
  "?"
3423
3441
  ] }),
3424
- /* @__PURE__ */ r(it, { children: [
3442
+ /* @__PURE__ */ r(ct, { children: [
3425
3443
  "This permanently deletes ",
3426
- /* @__PURE__ */ t("strong", { children: j == null ? void 0 : j.name }),
3444
+ /* @__PURE__ */ t("strong", { children: W == null ? void 0 : W.name }),
3427
3445
  ". Recipients will stop receiving it."
3428
3446
  ] })
3429
3447
  ] }),
3430
- /* @__PURE__ */ r(lt, { children: [
3431
- /* @__PURE__ */ t(dt, { children: "Cancel" }),
3448
+ /* @__PURE__ */ r(ut, { children: [
3449
+ /* @__PURE__ */ t(ht, { children: "Cancel" }),
3432
3450
  /* @__PURE__ */ r(
3433
- Ft,
3451
+ Tt,
3434
3452
  {
3435
3453
  className: "bg-destructive/90 hover:bg-destructive",
3436
- onClick: de,
3454
+ onClick: ce,
3437
3455
  children: [
3438
3456
  "Delete",
3439
3457
  " ",
3440
- j ? se(j).noun : "briefing"
3458
+ W ? oe(W).noun : "briefing"
3441
3459
  ]
3442
3460
  }
3443
3461
  )
@@ -3447,24 +3465,24 @@ function Cn({
3447
3465
  )
3448
3466
  ] }) : null;
3449
3467
  }
3450
- function wn() {
3468
+ function An() {
3451
3469
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `briefing-run-now-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
3452
3470
  }
3453
3471
  export {
3454
- $n as A,
3455
- $a as D,
3456
- Oa as E,
3457
- qn as N,
3458
- jn as U,
3459
- _n as V,
3460
- en as W,
3461
- zn as a,
3462
- _a as b,
3463
- Wn as c,
3464
- Hn as d,
3465
- Wa as e,
3466
- Ya as f,
3467
- Gn as g,
3468
- Kn as h,
3469
- On as u
3472
+ Xn as A,
3473
+ Xa as D,
3474
+ qa as E,
3475
+ Qn as N,
3476
+ Kn as U,
3477
+ Hn as V,
3478
+ on as W,
3479
+ Gn as a,
3480
+ Ha as b,
3481
+ Yn as c,
3482
+ Zn as d,
3483
+ Ya as e,
3484
+ tn as f,
3485
+ Jn as g,
3486
+ es as h,
3487
+ qn as u
3470
3488
  };