react-semaphor 0.1.487 → 0.1.488

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