react-semaphor 0.1.548 → 0.1.550

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 (51) hide show
  1. package/dist/assistant-context/index.js +1 -1
  2. package/dist/brand-studio/index.js +1 -1
  3. package/dist/briefings/index.js +1 -1
  4. package/dist/chunks/{assistant-chat-DCcWsoGm.js → assistant-chat-ClAvjeNe.js} +1834 -1849
  5. package/dist/chunks/{custom-visual-inputs-BTRnwsfd.js → custom-visual-inputs-CwAcigQS.js} +1 -1
  6. package/dist/chunks/{dashboard-BZHL9a-z.js → dashboard-DDQgKoss.js} +1 -1
  7. package/dist/chunks/dashboard-briefing-launcher-CCYs8E4j.js +3844 -0
  8. package/dist/chunks/{dashboard-controls-BGoBTPS7.js → dashboard-controls-DfSkQBsk.js} +982 -935
  9. package/dist/chunks/{dashboard-json-iHPsdn3j.js → dashboard-json-BPhyn9pl.js} +2 -2
  10. package/dist/chunks/{document-dashboard-inputs-B2AqPfrq.js → document-dashboard-inputs-DPQ_wUGD.js} +2 -2
  11. package/dist/chunks/{edit-dashboard-visual-CLEFFf2T.js → edit-dashboard-visual-G7EmLuR0.js} +280 -280
  12. package/dist/chunks/{filter-reach-copy-ByzGadUk.js → filter-reach-copy-8vnDYToV.js} +95 -93
  13. package/dist/chunks/{global-date-filter-utils-CeeFJ1CP.js → global-date-filter-utils-CnumW4j2.js} +1656 -1651
  14. package/dist/chunks/{index-DeDHr3iz.js → index-DzsdV1o4.js} +3 -3
  15. package/dist/chunks/{raw-temporal-presentation-CrUM2I_o.js → raw-temporal-presentation-CBKeEPYA.js} +1 -1
  16. package/dist/chunks/report-preferences-dialog-D_fEDaS4.js +2261 -0
  17. package/dist/chunks/{resolve-dashboard-input-context-BmWF9hSl.js → resolve-dashboard-input-context-DVWF7p5C.js} +1 -1
  18. package/dist/chunks/{saved-dashboard-context-qtfzl9Eb.js → saved-dashboard-context-BMqMzNAo.js} +4 -4
  19. package/dist/chunks/{semaphor-ready-indicator-Ol6VcaR7.js → semaphor-ready-indicator-Bz5BxITW.js} +25406 -25106
  20. package/dist/chunks/{shelf-drop-preview-context-C2SEC3I9.js → shelf-drop-preview-context-B8kNwpWQ.js} +4 -4
  21. package/dist/chunks/{switch-CEBOR4n7.js → switch-wJP6O7ZT.js} +2 -2
  22. package/dist/chunks/{use-create-flow-overlay-state-CbGIjaVD.js → use-create-flow-overlay-state-RzJa7G8S.js} +3 -3
  23. package/dist/dashboard/index.js +1 -1
  24. package/dist/dashboard-authoring/index.js +7 -7
  25. package/dist/index.js +187 -172
  26. package/dist/live-channel/index.js +124 -0
  27. package/dist/style.css +1 -1
  28. package/dist/surfboard/index.js +1 -1
  29. package/dist/types/components/assistant/assistant-entry-points.d.ts +4 -1
  30. package/dist/types/components/dashboard/favorites/dashboard-favorite-toggle.d.ts +11 -0
  31. package/dist/types/components/dashboard/favorites/favorite-star-button.d.ts +16 -0
  32. package/dist/types/components/index.d.ts +8 -0
  33. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +16 -0
  34. package/dist/types/components/surfboard/dashboard-plus.d.ts +1 -1
  35. package/dist/types/components/surfboard/toolbar/toolbar-context.d.ts +86 -0
  36. package/dist/types/components/surfboard/toolbar/toolbar-overflow.d.ts +14 -0
  37. package/dist/types/lib/dashboard-viewer/viewer-store-state.d.ts +7 -0
  38. package/dist/types/lib/hooks/use-dashboard-favorite.d.ts +24 -0
  39. package/dist/types/lib/hooks/use-dashboard-query.d.ts +2 -0
  40. package/dist/types/lib/hooks/use-default-dashboard-toggle.d.ts +12 -0
  41. package/dist/types/lib/stores/dashboard-store.d.ts +9 -0
  42. package/dist/types/lib/types/common-types.d.ts +26 -1
  43. package/dist/types/live-channel.d.ts +2 -0
  44. package/dist/types/shared/assistant-protocol/parts.d.ts +11 -0
  45. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +14 -44
  46. package/dist/types/shared/dashboard-viewer/viewer-contract.d.ts +18 -0
  47. package/dist/types/shared/live-channel/index.d.ts +1 -0
  48. package/dist/types/shared/live-channel/live-channel-contract.d.ts +126 -0
  49. package/package.json +5 -1
  50. package/dist/chunks/dashboard-briefing-launcher-DML-cAzB.js +0 -3734
  51. package/dist/chunks/report-preferences-dialog-CM7kXmXp.js +0 -1977
@@ -1,38 +1,38 @@
1
- import { jsx as e, jsxs as s, Fragment as $ } from "react/jsx-runtime";
2
- import { bJ as Hr, u as C, bK as zr, bL as qr, bM as nt, bN as Kr, bO as Qr, bP as Wr, bQ as Yr, bR as Jr, bS as Xr, b2 as Y, b0 as xe, bT as ve, bD as D, bU as Zr, bE as zt, bF as qt, bH as Ze, bI as et, bV as Kt, aO as ot, aX as re, bW as ea, bX as ta, bY as Qt, bZ as ra, b_ as Wt, bG as aa, b$ as na, c0 as R, c1 as oa, c2 as sa, c3 as ia, az as da, be as ca, c4 as la, c5 as ua, c6 as ma, j as ha, P as pa, a3 as Ct, i as Oe, p as fa, k as We, c7 as ba, c8 as ga, c9 as xa, ca as va, N as ya, cb as wa, s as Na, cc as Sa, cd as ka, bh as Ca, ce as Da, cf as Ea, cg as Dt, ch as Et, ci as It, cj as Ia, ck as Aa, cl as La, cm as Oa, cn as Me, co as Ma, cp as Pa, cq as Ye, cr as _a, cs as At, o as Ra, ct as Ta, cu as Ua, cv as $a, cw as Ba, cx as Fa, cy as Ga, cz as Va, cA as ja, cB as Lt } from "./semaphor-ready-indicator-Ol6VcaR7.js";
3
- import { B as U, Z as Ha, _ as za, $ as tt, L as _e, l as qa, r as Ka, s as Qa, t as Wa, u as Ya, v as Ja, P as Xa, a as Za, b as en, m as Ot, n as Mt, o as Pt, p as _t, I as tn } from "./switch-CEBOR4n7.js";
4
- import { c as ye, X as Yt, C as rn } from "./x-4f5U2XwU.js";
1
+ import { jsx as e, jsxs as o, Fragment as $ } from "react/jsx-runtime";
2
+ import { bQ as Br, u as C, bR as Fr, bS as Gr, bT as st, bU as Vr, bV as jr, bW as zr, bX as Hr, bY as qr, bZ as Kr, b5 as J, b3 as ve, b_ as ye, bK as D, b$ as Qr, bL as Ft, bM as Gt, bO as et, bP as tt, c0 as Vt, aR as ot, a_ as re, c1 as Wr, c2 as Yr, c3 as jt, c4 as Jr, c5 as zt, bN as Xr, c6 as Zr, c7 as P, c8 as ea, c9 as ta, ca as ra, aC as aa, bh as na, by as sa, cb as oa, bz as ia, j as da, W as ca, a6 as Ct, i as _e, p as la, k as Je, cc as ua, cd as ma, Q as ha, ce as pa, s as fa, cf as ba, cg as ga, bk as xa, ch as va, ci as Dt, cj as Ht, ck as Et, cl as ya, bA as wa, cm as Na, cn as Sa, co as be, cp as Pe, cq as ka, cr as Ca, cs as Da, ct as It, o as Ea, cu as Ia, cv as Aa, cw as Oa, cx as La, cy as Ma, cz as _a, cA as Pa, cB as Ta, cC as At, cD as Ra } from "./semaphor-ready-indicator-Bz5BxITW.js";
3
+ import { B as G, Z as Ua, _ as $a, $ as rt, L as Re, l as Ba, r as Fa, s as Ga, t as Va, u as ja, v as za, P as Ha, a as qa, b as Ka, m as Qa, n as Wa, o as Ya, I as Ja, p as Xa, c as qt } from "./switch-wJP6O7ZT.js";
4
+ import { c as we, X as Kt, C as Za } from "./x-4f5U2XwU.js";
5
5
  import * as A from "react";
6
- import Jt, { useMemo as j, useState as N, useEffect as be, useRef as Rt, useLayoutEffect as an } from "react";
6
+ import Qt, { useMemo as V, useState as N, useEffect as ge, useRef as Ot, useLayoutEffect as en } from "react";
7
7
  import "./index-CuHybtft.js";
8
8
  import "./validators-C-aOQlTB.js";
9
9
  import "./matrix-operation-contract-D6vYkZK4.js";
10
10
  import "./analytics-base-schemas-BKs3flFS.js";
11
11
  import "zod";
12
12
  import "../value-format-preferences/index.js";
13
- import { c as ge } from "./_commonjsHelpers-DimLPMtv.js";
14
- import { u as nn, A as on, a as sn, f as dn, V as cn, b as ln, c as un, S as mn, i as hn, g as pn, U as fn } from "./dashboard-briefing-launcher-DML-cAzB.js";
15
- import { I as bn } from "./use-create-flow-overlay-state-CbGIjaVD.js";
16
- import { h as gn, R as xn } from "./report-preferences-dialog-CM7kXmXp.js";
17
- import { createPortal as vn } from "react-dom";
18
- import { dr as we, ds as st, dt as Xt, as as yn } from "./global-date-filter-utils-CeeFJ1CP.js";
19
- import { S as wn, C as Nn } from "./selection-reducer-CJzkTZio.js";
20
- import { o as Zt } from "./matrix-formatter-DWEeC0_c.js";
21
- import { ac as Tt, ad as Sn, ae as kn, a as rt } from "./resolve-dashboard-input-context-BmWF9hSl.js";
22
- import { r as Cn } from "./export-file-format-C-tJsxsf.js";
23
- import { u as Dn, s as En } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
24
- import { K as Re, u as Ut } from "./table-settings-WysCBj62.js";
25
- import { l as In, h as $t, e as An } from "./document-dashboard-inputs-B2AqPfrq.js";
26
- import { S as Ln } from "./save-CfJpQQ68.js";
27
- import { P as On } from "./palette-D10o_yYX.js";
28
- import { B as Mn } from "./braces-o9UiRQes.js";
13
+ import { c as xe } from "./_commonjsHelpers-DimLPMtv.js";
14
+ import { u as tn, d as rn, c as an, D as nn, A as sn, a as on, j as dn, V as cn, b as ln, e as un, S as mn, T as hn, i as pn, k as fn, U as bn } from "./dashboard-briefing-launcher-CCYs8E4j.js";
15
+ import { I as gn } from "./use-create-flow-overlay-state-RzJa7G8S.js";
16
+ import { u as xn, h as vn, R as yn, l as Wt } from "./report-preferences-dialog-D_fEDaS4.js";
17
+ import { createPortal as wn } from "react-dom";
18
+ import { dr as Ne, ds as it, dt as Yt, as as Nn } from "./global-date-filter-utils-CnumW4j2.js";
19
+ import { S as Sn, C as kn } from "./selection-reducer-CJzkTZio.js";
20
+ import { o as Jt } from "./matrix-formatter-DWEeC0_c.js";
21
+ import { ac as Lt, ad as Cn, ae as Dn, a as at } from "./resolve-dashboard-input-context-DVWF7p5C.js";
22
+ import { r as En } from "./export-file-format-C-tJsxsf.js";
23
+ import { u as In, s as An } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
24
+ import { K as Ue, u as Mt } from "./table-settings-WysCBj62.js";
25
+ import { l as On, h as _t, e as Ln } from "./document-dashboard-inputs-DPQ_wUGD.js";
26
+ import { S as Mn } from "./save-CfJpQQ68.js";
27
+ import { P as _n } from "./palette-D10o_yYX.js";
28
+ import { B as Pn } from "./braces-o9UiRQes.js";
29
29
  /**
30
30
  * @license lucide-react v0.453.0 - ISC
31
31
  *
32
32
  * This source code is licensed under the ISC license.
33
33
  * See the LICENSE file in the root directory of this source tree.
34
34
  */
35
- const Pn = ye("Moon", [
35
+ const Tn = we("Moon", [
36
36
  ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
37
37
  ]);
38
38
  /**
@@ -41,7 +41,7 @@ const Pn = ye("Moon", [
41
41
  * This source code is licensed under the ISC license.
42
42
  * See the LICENSE file in the root directory of this source tree.
43
43
  */
44
- const _n = ye("ShieldX", [
44
+ const Rn = we("ShieldX", [
45
45
  [
46
46
  "path",
47
47
  {
@@ -58,7 +58,7 @@ const _n = ye("ShieldX", [
58
58
  * This source code is licensed under the ISC license.
59
59
  * See the LICENSE file in the root directory of this source tree.
60
60
  */
61
- const Rn = ye("Sun", [
61
+ const Un = we("Sun", [
62
62
  ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
63
63
  ["path", { d: "M12 2v2", key: "tus03m" }],
64
64
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -75,7 +75,7 @@ const Rn = ye("Sun", [
75
75
  * This source code is licensed under the ISC license.
76
76
  * See the LICENSE file in the root directory of this source tree.
77
77
  */
78
- const Tn = ye("UserPlus", [
78
+ const $n = we("UserPlus", [
79
79
  ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
80
80
  ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
81
81
  ["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
@@ -87,11 +87,11 @@ const Tn = ye("UserPlus", [
87
87
  * This source code is licensed under the ISC license.
88
88
  * See the LICENSE file in the root directory of this source tree.
89
89
  */
90
- const er = ye("UserRound", [
90
+ const Xt = we("UserRound", [
91
91
  ["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
92
92
  ["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
93
93
  ]);
94
- var at = { exports: {} }, Je = {};
94
+ var nt = { exports: {} }, Xe = {};
95
95
  /**
96
96
  * @license React
97
97
  * use-sync-external-store-shim.production.js
@@ -101,23 +101,23 @@ var at = { exports: {} }, Je = {};
101
101
  * This source code is licensed under the MIT license found in the
102
102
  * LICENSE file in the root directory of this source tree.
103
103
  */
104
- var Bt;
105
- function Un() {
106
- if (Bt) return Je;
107
- Bt = 1;
108
- var t = Jt;
109
- function n(c, u) {
104
+ var Pt;
105
+ function Bn() {
106
+ if (Pt) return Xe;
107
+ Pt = 1;
108
+ var t = Qt;
109
+ function a(c, u) {
110
110
  return c === u && (c !== 0 || 1 / c === 1 / u) || c !== c && u !== u;
111
111
  }
112
- var a = typeof Object.is == "function" ? Object.is : n, r = t.useState, o = t.useEffect, d = t.useLayoutEffect, f = t.useDebugValue;
113
- function m(c, u) {
112
+ var n = typeof Object.is == "function" ? Object.is : a, r = t.useState, s = t.useEffect, d = t.useLayoutEffect, f = t.useDebugValue;
113
+ function h(c, u) {
114
114
  var l = u(), p = r({ inst: { value: l, getSnapshot: u } }), x = p[0].inst, w = p[1];
115
115
  return d(
116
116
  function() {
117
117
  x.value = l, x.getSnapshot = u, g(x) && w({ inst: x });
118
118
  },
119
119
  [c, l, u]
120
- ), o(
120
+ ), s(
121
121
  function() {
122
122
  return g(x) && w({ inst: x }), c(function() {
123
123
  g(x) && w({ inst: x });
@@ -131,7 +131,7 @@ function Un() {
131
131
  c = c.value;
132
132
  try {
133
133
  var l = u();
134
- return !a(c, l);
134
+ return !n(c, l);
135
135
  } catch {
136
136
  return !0;
137
137
  }
@@ -139,10 +139,10 @@ function Un() {
139
139
  function v(c, u) {
140
140
  return u();
141
141
  }
142
- var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : m;
143
- return Je.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : h, Je;
142
+ var m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : h;
143
+ return Xe.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : m, Xe;
144
144
  }
145
- var Xe = {};
145
+ var Ze = {};
146
146
  /**
147
147
  * @license React
148
148
  * use-sync-external-store-shim.development.js
@@ -152,14 +152,14 @@ var Xe = {};
152
152
  * This source code is licensed under the MIT license found in the
153
153
  * LICENSE file in the root directory of this source tree.
154
154
  */
155
- var Ft;
156
- function $n() {
157
- return Ft || (Ft = 1, process.env.NODE_ENV !== "production" && function() {
155
+ var Tt;
156
+ function Fn() {
157
+ return Tt || (Tt = 1, process.env.NODE_ENV !== "production" && function() {
158
158
  function t(l, p) {
159
159
  return l === p && (l !== 0 || 1 / l === 1 / p) || l !== l && p !== p;
160
160
  }
161
- function n(l, p) {
162
- h || o.startTransition === void 0 || (h = !0, console.error(
161
+ function a(l, p) {
162
+ m || s.startTransition === void 0 || (m = !0, console.error(
163
163
  "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
164
164
  ));
165
165
  var x = p();
@@ -175,19 +175,19 @@ function $n() {
175
175
  var S = w[0].inst, b = w[1];
176
176
  return g(
177
177
  function() {
178
- S.value = x, S.getSnapshot = p, a(S) && b({ inst: S });
178
+ S.value = x, S.getSnapshot = p, n(S) && b({ inst: S });
179
179
  },
180
180
  [l, x, p]
181
- ), m(
181
+ ), h(
182
182
  function() {
183
- return a(S) && b({ inst: S }), l(function() {
184
- a(S) && b({ inst: S });
183
+ return n(S) && b({ inst: S }), l(function() {
184
+ n(S) && b({ inst: S });
185
185
  });
186
186
  },
187
187
  [l]
188
188
  ), v(x), x;
189
189
  }
190
- function a(l) {
190
+ function n(l) {
191
191
  var p = l.getSnapshot;
192
192
  l = l.value;
193
193
  try {
@@ -201,113 +201,113 @@ function $n() {
201
201
  return p();
202
202
  }
203
203
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
204
- var o = Jt, d = typeof Object.is == "function" ? Object.is : t, f = o.useState, m = o.useEffect, g = o.useLayoutEffect, v = o.useDebugValue, h = !1, c = !1, u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
205
- Xe.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : u, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
206
- }()), Xe;
204
+ var s = Qt, d = typeof Object.is == "function" ? Object.is : t, f = s.useState, h = s.useEffect, g = s.useLayoutEffect, v = s.useDebugValue, m = !1, c = !1, u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : a;
205
+ Ze.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : u, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
206
+ }()), Ze;
207
207
  }
208
- process.env.NODE_ENV === "production" ? at.exports = Un() : at.exports = $n();
209
- var Bn = at.exports;
210
- const Pe = ["light", "dark", "system"];
211
- function Fn() {
212
- const { theme: t, setTheme: n } = Hr(), a = C(
208
+ process.env.NODE_ENV === "production" ? nt.exports = Bn() : nt.exports = Fn();
209
+ var Gn = nt.exports;
210
+ const Te = ["light", "dark", "system"];
211
+ function Vn() {
212
+ const { theme: t, setTheme: a } = Br(), n = C(
213
213
  (f) => f.actions.setDashboardTheme
214
214
  );
215
215
  function r() {
216
- const f = Pe.includes(t) ? t : "system", m = Pe[(Pe.indexOf(f) + 1) % Pe.length];
217
- n(m), a(m);
216
+ const f = Te.includes(t) ? t : "system", h = Te[(Te.indexOf(f) + 1) % Te.length];
217
+ a(h), n(h);
218
218
  }
219
- const o = t === "light" ? Rn : t === "dark" ? Pn : zr, d = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
219
+ const s = t === "light" ? Un : t === "dark" ? Tn : Fr, d = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
220
220
  return /* @__PURE__ */ e(
221
- U,
221
+ G,
222
222
  {
223
223
  type: "button",
224
224
  variant: "ghost",
225
225
  size: "xs",
226
- className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
226
+ className: "h-7 w-7 p-0",
227
227
  onClick: r,
228
228
  "aria-label": d,
229
229
  title: d,
230
- children: /* @__PURE__ */ e(o, { className: "h-3.5 w-3.5", strokeWidth: 1.5 })
230
+ children: /* @__PURE__ */ e(s, { className: "h-3.5 w-3.5", strokeWidth: 1.5 })
231
231
  }
232
232
  );
233
233
  }
234
- function Gn() {
235
- const { displayPreferences: t, shouldShowElement: n } = qr(), { currentUser: a, userContext: r } = nt(), o = j(
236
- () => Kr(a),
237
- [a]
238
- ), d = j(() => (m) => o && o[m] !== void 0 && o[m] === !1 ? !1 : n(m), [o, n, t]), f = j(
234
+ function jn() {
235
+ const { displayPreferences: t, shouldShowElement: a } = Gr(), { currentUser: n, userContext: r } = st(), s = V(
236
+ () => Vr(n),
237
+ [n]
238
+ ), d = V(() => (h) => s && s[h] !== void 0 && s[h] === !1 ? !1 : a(h), [s, a, t]), f = V(
239
239
  () => {
240
- var m, g, v, h, c;
240
+ var h, g, v, m, c;
241
241
  return {
242
- canEdit: ((m = r == null ? void 0 : r.permissions) == null ? void 0 : m.canEdit) ?? Xr(a),
243
- canUseFilters: ((g = r == null ? void 0 : r.permissions) == null ? void 0 : g.canEdit) ?? Jr(a),
244
- canManageDashboards: ((v = r == null ? void 0 : r.permissions) == null ? void 0 : v.canCreateDashboard) ?? Yr(a),
245
- canCreateDashboards: ((h = r == null ? void 0 : r.permissions) == null ? void 0 : h.canCreateDashboard) ?? Wr(a),
246
- canAccessVisuals: ((c = r == null ? void 0 : r.permissions) == null ? void 0 : c.canEdit) ?? Qr(a)
242
+ canEdit: ((h = r == null ? void 0 : r.permissions) == null ? void 0 : h.canEdit) ?? Kr(n),
243
+ canUseFilters: ((g = r == null ? void 0 : r.permissions) == null ? void 0 : g.canEdit) ?? qr(n),
244
+ canManageDashboards: ((v = r == null ? void 0 : r.permissions) == null ? void 0 : v.canCreateDashboard) ?? Hr(n),
245
+ canCreateDashboards: ((m = r == null ? void 0 : r.permissions) == null ? void 0 : m.canCreateDashboard) ?? zr(n),
246
+ canAccessVisuals: ((c = r == null ? void 0 : r.permissions) == null ? void 0 : c.canEdit) ?? jr(n)
247
247
  };
248
248
  },
249
- [a, r]
249
+ [n, r]
250
250
  );
251
251
  return {
252
252
  displayPreferences: t,
253
253
  shouldShowElement: d,
254
254
  permissions: f,
255
- currentUser: a
255
+ currentUser: n
256
256
  };
257
257
  }
258
- function Vn(t, n = []) {
259
- let a = [];
258
+ function zn(t, a = []) {
259
+ let n = [];
260
260
  function r(d, f) {
261
- const m = A.createContext(f);
262
- m.displayName = d + "Context";
263
- const g = a.length;
264
- a = [...a, f];
261
+ const h = A.createContext(f);
262
+ h.displayName = d + "Context";
263
+ const g = n.length;
264
+ n = [...n, f];
265
265
  const v = (c) => {
266
266
  var S;
267
- const { scope: u, children: l, ...p } = c, x = ((S = u == null ? void 0 : u[t]) == null ? void 0 : S[g]) || m, w = A.useMemo(() => p, Object.values(p));
267
+ const { scope: u, children: l, ...p } = c, x = ((S = u == null ? void 0 : u[t]) == null ? void 0 : S[g]) || h, w = A.useMemo(() => p, Object.values(p));
268
268
  return /* @__PURE__ */ e(x.Provider, { value: w, children: l });
269
269
  };
270
270
  v.displayName = d + "Provider";
271
- function h(c, u) {
271
+ function m(c, u) {
272
272
  var x;
273
- const l = ((x = u == null ? void 0 : u[t]) == null ? void 0 : x[g]) || m, p = A.useContext(l);
273
+ const l = ((x = u == null ? void 0 : u[t]) == null ? void 0 : x[g]) || h, p = A.useContext(l);
274
274
  if (p) return p;
275
275
  if (f !== void 0) return f;
276
276
  throw new Error(`\`${c}\` must be used within \`${d}\``);
277
277
  }
278
- return [v, h];
278
+ return [v, m];
279
279
  }
280
- const o = () => {
281
- const d = a.map((f) => A.createContext(f));
282
- return function(m) {
283
- const g = (m == null ? void 0 : m[t]) || d;
280
+ const s = () => {
281
+ const d = n.map((f) => A.createContext(f));
282
+ return function(h) {
283
+ const g = (h == null ? void 0 : h[t]) || d;
284
284
  return A.useMemo(
285
- () => ({ [`__scope${t}`]: { ...m, [t]: g } }),
286
- [m, g]
285
+ () => ({ [`__scope${t}`]: { ...h, [t]: g } }),
286
+ [h, g]
287
287
  );
288
288
  };
289
289
  };
290
- return o.scopeName = t, [r, jn(o, ...n)];
290
+ return s.scopeName = t, [r, Hn(s, ...a)];
291
291
  }
292
- function jn(...t) {
293
- const n = t[0];
294
- if (t.length === 1) return n;
295
- const a = () => {
296
- const r = t.map((o) => ({
297
- useScope: o(),
298
- scopeName: o.scopeName
292
+ function Hn(...t) {
293
+ const a = t[0];
294
+ if (t.length === 1) return a;
295
+ const n = () => {
296
+ const r = t.map((s) => ({
297
+ useScope: s(),
298
+ scopeName: s.scopeName
299
299
  }));
300
300
  return function(d) {
301
- const f = r.reduce((m, { useScope: g, scopeName: v }) => {
301
+ const f = r.reduce((h, { useScope: g, scopeName: v }) => {
302
302
  const c = g(d)[`__scope${v}`];
303
- return { ...m, ...c };
303
+ return { ...h, ...c };
304
304
  }, {});
305
- return A.useMemo(() => ({ [`__scope${n.scopeName}`]: f }), [f]);
305
+ return A.useMemo(() => ({ [`__scope${a.scopeName}`]: f }), [f]);
306
306
  };
307
307
  };
308
- return a.scopeName = n.scopeName, a;
308
+ return n.scopeName = a.scopeName, n;
309
309
  }
310
- var Hn = [
310
+ var qn = [
311
311
  "a",
312
312
  "button",
313
313
  "div",
@@ -325,233 +325,233 @@ var Hn = [
325
325
  "span",
326
326
  "svg",
327
327
  "ul"
328
- ], it = Hn.reduce((t, n) => {
329
- const a = Ha(`Primitive.${n}`), r = A.forwardRef((o, d) => {
330
- const { asChild: f, ...m } = o, g = f ? a : n;
331
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(g, { ...m, ref: d });
328
+ ], dt = qn.reduce((t, a) => {
329
+ const n = Ua(`Primitive.${a}`), r = A.forwardRef((s, d) => {
330
+ const { asChild: f, ...h } = s, g = f ? n : a;
331
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(g, { ...h, ref: d });
332
332
  });
333
- return r.displayName = `Primitive.${n}`, { ...t, [n]: r };
333
+ return r.displayName = `Primitive.${a}`, { ...t, [a]: r };
334
334
  }, {});
335
- function zn() {
336
- return Bn.useSyncExternalStore(
337
- qn,
335
+ function Kn() {
336
+ return Gn.useSyncExternalStore(
337
+ Qn,
338
338
  () => !0,
339
339
  () => !1
340
340
  );
341
341
  }
342
- function qn() {
342
+ function Qn() {
343
343
  return () => {
344
344
  };
345
345
  }
346
- var dt = "Avatar", [Kn] = Vn(dt), [Qn, tr] = Kn(dt), rr = A.forwardRef(
347
- (t, n) => {
348
- const { __scopeAvatar: a, ...r } = t, [o, d] = A.useState("idle");
346
+ var ct = "Avatar", [Wn] = zn(ct), [Yn, Zt] = Wn(ct), er = A.forwardRef(
347
+ (t, a) => {
348
+ const { __scopeAvatar: n, ...r } = t, [s, d] = A.useState("idle");
349
349
  return /* @__PURE__ */ e(
350
- Qn,
350
+ Yn,
351
351
  {
352
- scope: a,
353
- imageLoadingStatus: o,
352
+ scope: n,
353
+ imageLoadingStatus: s,
354
354
  onImageLoadingStatusChange: d,
355
- children: /* @__PURE__ */ e(it.span, { ...r, ref: n })
355
+ children: /* @__PURE__ */ e(dt.span, { ...r, ref: a })
356
356
  }
357
357
  );
358
358
  }
359
359
  );
360
- rr.displayName = dt;
361
- var ar = "AvatarImage", nr = A.forwardRef(
362
- (t, n) => {
363
- const { __scopeAvatar: a, src: r, onLoadingStatusChange: o = () => {
364
- }, ...d } = t, f = tr(ar, a), m = Wn(r, d), g = za((v) => {
365
- o(v), f.onImageLoadingStatusChange(v);
360
+ er.displayName = ct;
361
+ var tr = "AvatarImage", rr = A.forwardRef(
362
+ (t, a) => {
363
+ const { __scopeAvatar: n, src: r, onLoadingStatusChange: s = () => {
364
+ }, ...d } = t, f = Zt(tr, n), h = Jn(r, d), g = $a((v) => {
365
+ s(v), f.onImageLoadingStatusChange(v);
366
366
  });
367
- return tt(() => {
368
- m !== "idle" && g(m);
369
- }, [m, g]), m === "loaded" ? /* @__PURE__ */ e(it.img, { ...d, ref: n, src: r }) : null;
367
+ return rt(() => {
368
+ h !== "idle" && g(h);
369
+ }, [h, g]), h === "loaded" ? /* @__PURE__ */ e(dt.img, { ...d, ref: a, src: r }) : null;
370
370
  }
371
371
  );
372
- nr.displayName = ar;
373
- var or = "AvatarFallback", sr = A.forwardRef(
374
- (t, n) => {
375
- const { __scopeAvatar: a, delayMs: r, ...o } = t, d = tr(or, a), [f, m] = A.useState(r === void 0);
372
+ rr.displayName = tr;
373
+ var ar = "AvatarFallback", nr = A.forwardRef(
374
+ (t, a) => {
375
+ const { __scopeAvatar: n, delayMs: r, ...s } = t, d = Zt(ar, n), [f, h] = A.useState(r === void 0);
376
376
  return A.useEffect(() => {
377
377
  if (r !== void 0) {
378
- const g = window.setTimeout(() => m(!0), r);
378
+ const g = window.setTimeout(() => h(!0), r);
379
379
  return () => window.clearTimeout(g);
380
380
  }
381
- }, [r]), f && d.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(it.span, { ...o, ref: n }) : null;
381
+ }, [r]), f && d.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(dt.span, { ...s, ref: a }) : null;
382
382
  }
383
383
  );
384
- sr.displayName = or;
385
- function Gt(t, n) {
386
- return t ? n ? (t.src !== n && (t.src = n), t.complete && t.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
384
+ nr.displayName = ar;
385
+ function Rt(t, a) {
386
+ return t ? a ? (t.src !== a && (t.src = a), t.complete && t.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
387
387
  }
388
- function Wn(t, { referrerPolicy: n, crossOrigin: a }) {
389
- const r = zn(), o = A.useRef(null), d = r ? (o.current || (o.current = new window.Image()), o.current) : null, [f, m] = A.useState(
390
- () => Gt(d, t)
388
+ function Jn(t, { referrerPolicy: a, crossOrigin: n }) {
389
+ const r = Kn(), s = A.useRef(null), d = r ? (s.current || (s.current = new window.Image()), s.current) : null, [f, h] = A.useState(
390
+ () => Rt(d, t)
391
391
  );
392
- return tt(() => {
393
- m(Gt(d, t));
394
- }, [d, t]), tt(() => {
392
+ return rt(() => {
393
+ h(Rt(d, t));
394
+ }, [d, t]), rt(() => {
395
395
  const g = (c) => () => {
396
- m(c);
396
+ h(c);
397
397
  };
398
398
  if (!d) return;
399
- const v = g("loaded"), h = g("error");
400
- return d.addEventListener("load", v), d.addEventListener("error", h), n && (d.referrerPolicy = n), typeof a == "string" && (d.crossOrigin = a), () => {
401
- d.removeEventListener("load", v), d.removeEventListener("error", h);
399
+ const v = g("loaded"), m = g("error");
400
+ return d.addEventListener("load", v), d.addEventListener("error", m), a && (d.referrerPolicy = a), typeof n == "string" && (d.crossOrigin = n), () => {
401
+ d.removeEventListener("load", v), d.removeEventListener("error", m);
402
402
  };
403
- }, [d, a, n]), f;
403
+ }, [d, n, a]), f;
404
404
  }
405
- var ir = rr, dr = nr, cr = sr;
406
- const lr = A.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
407
- ir,
405
+ var sr = er, or = rr, ir = nr;
406
+ const dr = A.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
407
+ sr,
408
408
  {
409
- ref: a,
410
- className: ge(
409
+ ref: n,
410
+ className: xe(
411
411
  "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
412
412
  t
413
413
  ),
414
- ...n
414
+ ...a
415
415
  }
416
416
  ));
417
- lr.displayName = ir.displayName;
418
- const Yn = A.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
419
- dr,
417
+ dr.displayName = sr.displayName;
418
+ const Xn = A.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
419
+ or,
420
420
  {
421
- ref: a,
422
- className: ge("aspect-square h-full w-full", t),
423
- ...n
421
+ ref: n,
422
+ className: xe("aspect-square h-full w-full", t),
423
+ ...a
424
424
  }
425
425
  ));
426
- Yn.displayName = dr.displayName;
427
- const ur = A.forwardRef(({ className: t, ...n }, a) => /* @__PURE__ */ e(
428
- cr,
426
+ Xn.displayName = or.displayName;
427
+ const cr = A.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
428
+ ir,
429
429
  {
430
- ref: a,
431
- className: ge(
430
+ ref: n,
431
+ className: xe(
432
432
  "flex h-full w-full items-center justify-center rounded-full bg-muted",
433
433
  t
434
434
  ),
435
- ...n
435
+ ...a
436
436
  }
437
437
  ));
438
- ur.displayName = cr.displayName;
439
- const Jn = async (t, n, a) => {
438
+ cr.displayName = ir.displayName;
439
+ const Zn = async (t, a, n) => {
440
440
  const r = `${t}/management/v1/groups`;
441
- return await Xt(r, n, a);
442
- }, Xn = async (t, n, a, r) => {
443
- const o = `${t}/management/v1/groups/${a}`;
444
- return st(o, n, "PATCH", r);
445
- }, Zn = async (t, n, a) => {
446
- const r = `${t}/management/v1/groups/${a}`;
447
- await st(r, n, "DELETE");
448
- }, eo = async (t, n, a, r) => {
449
- const o = `${t}/management/v1/groups/${a}/members`;
450
- return await Xt(o, n, r);
451
- }, to = async (t, n, a, r) => {
452
- const o = `${t}/management/v1/groups/${a}/members`;
453
- await st(o, n, "DELETE", r);
441
+ return await Yt(r, a, n);
442
+ }, es = async (t, a, n, r) => {
443
+ const s = `${t}/management/v1/groups/${n}`;
444
+ return it(s, a, "PATCH", r);
445
+ }, ts = async (t, a, n) => {
446
+ const r = `${t}/management/v1/groups/${n}`;
447
+ await it(r, a, "DELETE");
448
+ }, rs = async (t, a, n, r) => {
449
+ const s = `${t}/management/v1/groups/${n}/members`;
450
+ return await Yt(s, a, r);
451
+ }, as = async (t, a, n, r) => {
452
+ const s = `${t}/management/v1/groups/${n}/members`;
453
+ await it(s, a, "DELETE", r);
454
454
  };
455
- function ro() {
456
- const { authToken: t, tokenProps: n } = Y(), a = xe();
457
- return ve({
458
- mutationFn: (r) => Jn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
455
+ function ns() {
456
+ const { authToken: t, tokenProps: a } = J(), n = ve();
457
+ return ye({
458
+ mutationFn: (r) => Zn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
459
459
  onSuccess: () => {
460
- a.invalidateQueries({ queryKey: ["groups"] }), D.success("Group created successfully");
460
+ n.invalidateQueries({ queryKey: ["groups"] }), D.success("Group created successfully");
461
461
  },
462
462
  onError: (r) => {
463
463
  console.error("Failed to create group:", r), D.error("Failed to create group", {
464
- description: we(r, "Failed to create group")
464
+ description: Ne(r, "Failed to create group")
465
465
  });
466
466
  }
467
467
  });
468
468
  }
469
- function ao() {
470
- const { authToken: t, tokenProps: n } = Y(), a = xe();
471
- return ve({
469
+ function ss() {
470
+ const { authToken: t, tokenProps: a } = J(), n = ve();
471
+ return ye({
472
472
  mutationFn: ({
473
473
  groupId: r,
474
- data: o
475
- }) => Xn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, o),
476
- onSuccess: (r, o) => {
477
- a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({ queryKey: ["groups"] }), D.success("Group updated successfully");
474
+ data: s
475
+ }) => es(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, s),
476
+ onSuccess: (r, s) => {
477
+ n.invalidateQueries({ queryKey: ["group", s.groupId] }), n.invalidateQueries({ queryKey: ["groups"] }), D.success("Group updated successfully");
478
478
  },
479
479
  onError: (r) => {
480
480
  console.error("Failed to update group:", r), D.error("Failed to update group", {
481
- description: we(r, "Failed to update group")
481
+ description: Ne(r, "Failed to update group")
482
482
  });
483
483
  }
484
484
  });
485
485
  }
486
- function no() {
487
- const { authToken: t, tokenProps: n } = Y(), a = xe();
488
- return ve({
489
- mutationFn: (r) => Zn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
490
- onSuccess: (r, o) => {
491
- a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", o] }), D.success("Group deleted successfully");
486
+ function os() {
487
+ const { authToken: t, tokenProps: a } = J(), n = ve();
488
+ return ye({
489
+ mutationFn: (r) => ts(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
490
+ onSuccess: (r, s) => {
491
+ n.invalidateQueries({ queryKey: ["groups"] }), n.removeQueries({ queryKey: ["group", s] }), D.success("Group deleted successfully");
492
492
  },
493
493
  onError: (r) => {
494
494
  console.error("Failed to delete group:", r), D.error("Failed to delete group", {
495
- description: we(r, "Failed to delete group")
495
+ description: Ne(r, "Failed to delete group")
496
496
  });
497
497
  }
498
498
  });
499
499
  }
500
- function oo() {
501
- const { authToken: t, tokenProps: n } = Y(), a = xe();
502
- return ve({
500
+ function is() {
501
+ const { authToken: t, tokenProps: a } = J(), n = ve();
502
+ return ye({
503
503
  mutationFn: ({
504
504
  groupId: r,
505
- data: o
506
- }) => eo(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, o),
507
- onSuccess: (r, o) => {
508
- a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({
509
- queryKey: ["group-members", o.groupId]
510
- }), a.invalidateQueries({ queryKey: ["groups"] }), D.success("Members added successfully");
505
+ data: s
506
+ }) => rs(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, s),
507
+ onSuccess: (r, s) => {
508
+ n.invalidateQueries({ queryKey: ["group", s.groupId] }), n.invalidateQueries({
509
+ queryKey: ["group-members", s.groupId]
510
+ }), n.invalidateQueries({ queryKey: ["groups"] }), D.success("Members added successfully");
511
511
  },
512
512
  onError: (r) => {
513
513
  console.error("Failed to add group members:", r), D.error("Failed to add members", {
514
- description: we(r, "Failed to add members")
514
+ description: Ne(r, "Failed to add members")
515
515
  });
516
516
  }
517
517
  });
518
518
  }
519
- function so() {
520
- const { authToken: t, tokenProps: n } = Y(), a = xe();
521
- return ve({
519
+ function ds() {
520
+ const { authToken: t, tokenProps: a } = J(), n = ve();
521
+ return ye({
522
522
  mutationFn: ({
523
523
  groupId: r,
524
- data: o
525
- }) => to(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, o),
526
- onSuccess: (r, o) => {
527
- a.invalidateQueries({ queryKey: ["group", o.groupId] }), a.invalidateQueries({
528
- queryKey: ["group-members", o.groupId]
529
- }), a.invalidateQueries({ queryKey: ["groups"] }), D.success("Members removed successfully");
524
+ data: s
525
+ }) => as(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, s),
526
+ onSuccess: (r, s) => {
527
+ n.invalidateQueries({ queryKey: ["group", s.groupId] }), n.invalidateQueries({
528
+ queryKey: ["group-members", s.groupId]
529
+ }), n.invalidateQueries({ queryKey: ["groups"] }), D.success("Members removed successfully");
530
530
  },
531
531
  onError: (r) => {
532
532
  console.error("Failed to remove group members:", r), D.error("Failed to remove members", {
533
- description: we(r, "Failed to remove members")
533
+ description: Ne(r, "Failed to remove members")
534
534
  });
535
535
  }
536
536
  });
537
537
  }
538
- const io = [];
539
- function co({
538
+ const cs = [];
539
+ function ls({
540
540
  open: t,
541
- onOpenChange: n
541
+ onOpenChange: a
542
542
  }) {
543
- var b, L, O;
544
- const { tokenProps: a } = Y(), { currentUser: r } = nt(), o = (r == null ? void 0 : r.type) === "tenant", d = a == null ? void 0 : a.tenantId, {
543
+ var b, L, M;
544
+ const { tokenProps: n } = J(), { currentUser: r } = st(), s = (r == null ? void 0 : r.type) === "tenant", d = n == null ? void 0 : n.tenantId, {
545
545
  groups: f,
546
- isLoading: m,
546
+ isLoading: h,
547
547
  error: g,
548
548
  refetch: v
549
- } = Zr({
550
- type: o ? "TENANT_GROUP" : "all",
551
- tenantId: o ? d : void 0,
549
+ } = Qr({
550
+ type: s ? "TENANT_GROUP" : "all",
551
+ tenantId: s ? d : void 0,
552
552
  includeMembers: !1
553
- }), h = g ? mr(g, "Unable to load groups.") : null, [c, u] = N({ kind: "list" }), [l, p] = N(null), x = no();
554
- be(() => {
553
+ }), m = g ? lr(g, "Unable to load groups.") : null, [c, u] = N({ kind: "list" }), [l, p] = N(null), x = os();
554
+ ge(() => {
555
555
  t || (u({ kind: "list" }), p(null));
556
556
  }, [t]);
557
557
  const w = c.kind === "members" && f.find((k) => k.id === c.groupId) || null, S = async () => {
@@ -561,11 +561,11 @@ function co({
561
561
  } catch {
562
562
  }
563
563
  };
564
- return /* @__PURE__ */ e(zt, { open: t, onOpenChange: n, children: /* @__PURE__ */ s(qt, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
565
- c.kind === "list" ? /* @__PURE__ */ s("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
566
- /* @__PURE__ */ e(Ze, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
567
- /* @__PURE__ */ e(et, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
568
- ] }) : c.kind === "create" ? /* @__PURE__ */ s("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
564
+ return /* @__PURE__ */ e(Ft, { open: t, onOpenChange: a, children: /* @__PURE__ */ o(Gt, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
565
+ c.kind === "list" ? /* @__PURE__ */ o("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
566
+ /* @__PURE__ */ e(et, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
567
+ /* @__PURE__ */ e(tt, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
568
+ ] }) : c.kind === "create" ? /* @__PURE__ */ o("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
569
569
  /* @__PURE__ */ e(
570
570
  "button",
571
571
  {
@@ -573,18 +573,18 @@ function co({
573
573
  onClick: () => u({ kind: "list" }),
574
574
  "aria-label": "Back",
575
575
  className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
576
- children: /* @__PURE__ */ e(Kt, { className: "h-3.5 w-3.5" })
576
+ children: /* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5" })
577
577
  }
578
578
  ),
579
- /* @__PURE__ */ e(Ze, { className: "truncate text-[13px] font-medium", children: "New group" }),
580
- /* @__PURE__ */ e(et, { className: "sr-only", children: "Create a new group to organize members." })
579
+ /* @__PURE__ */ e(et, { className: "truncate text-[13px] font-medium", children: "New group" }),
580
+ /* @__PURE__ */ e(tt, { className: "sr-only", children: "Create a new group to organize members." })
581
581
  ] }) : null,
582
582
  c.kind === "list" && /* @__PURE__ */ e(
583
- lo,
583
+ us,
584
584
  {
585
585
  groups: f,
586
- isLoading: m,
587
- errorMessage: h,
586
+ isLoading: h,
587
+ errorMessage: m,
588
588
  onRetry: () => v(),
589
589
  currentUserId: r == null ? void 0 : r.id,
590
590
  onOpenGroup: (k) => u({ kind: "members", groupId: k }),
@@ -593,13 +593,13 @@ function co({
593
593
  }
594
594
  ),
595
595
  c.kind === "members" && w && /* @__PURE__ */ e(
596
- ho,
596
+ ps,
597
597
  {
598
598
  group: w,
599
- isTenantViewer: o,
599
+ isTenantViewer: s,
600
600
  canEdit: ((b = w.permissions) == null ? void 0 : b.canEdit) ?? w.createdBy === (r == null ? void 0 : r.id),
601
601
  canDelete: ((L = w.permissions) == null ? void 0 : L.canDelete) ?? w.createdBy === (r == null ? void 0 : r.id),
602
- canManageMembers: ((O = w.permissions) == null ? void 0 : O.canManageMembers) ?? w.createdBy === (r == null ? void 0 : r.id),
602
+ canManageMembers: ((M = w.permissions) == null ? void 0 : M.canManageMembers) ?? w.createdBy === (r == null ? void 0 : r.id),
603
603
  onBack: () => u({ kind: "list" }),
604
604
  onMembersChanged: v,
605
605
  onUpdated: v,
@@ -608,9 +608,9 @@ function co({
608
608
  w.id
609
609
  ),
610
610
  c.kind === "create" && /* @__PURE__ */ e(
611
- po,
611
+ fs,
612
612
  {
613
- isTenantUser: o,
613
+ isTenantUser: s,
614
614
  tenantId: d,
615
615
  onCancel: () => u({ kind: "list" }),
616
616
  onCreated: (k) => {
@@ -618,14 +618,14 @@ function co({
618
618
  }
619
619
  }
620
620
  ),
621
- l && /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center justify-between gap-3 border-t border-border bg-muted/40 px-5 py-2.5", children: [
622
- /* @__PURE__ */ s("div", { className: "min-w-0 text-[12px] text-foreground", children: [
621
+ l && /* @__PURE__ */ o("div", { className: "flex shrink-0 items-center justify-between gap-3 border-t border-border bg-muted/40 px-5 py-2.5", children: [
622
+ /* @__PURE__ */ o("div", { className: "min-w-0 text-[12px] text-foreground", children: [
623
623
  "Delete ",
624
624
  /* @__PURE__ */ e("span", { className: "font-medium", children: l.name }),
625
625
  "?",
626
626
  /* @__PURE__ */ e("span", { className: "ml-2 text-muted-foreground", children: "Members lose any access granted via this group." })
627
627
  ] }),
628
- /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-1.5", children: [
628
+ /* @__PURE__ */ o("div", { className: "flex shrink-0 items-center gap-1.5", children: [
629
629
  /* @__PURE__ */ e(
630
630
  "button",
631
631
  {
@@ -636,7 +636,7 @@ function co({
636
636
  children: "Cancel"
637
637
  }
638
638
  ),
639
- /* @__PURE__ */ s(
639
+ /* @__PURE__ */ o(
640
640
  "button",
641
641
  {
642
642
  type: "button",
@@ -644,7 +644,7 @@ function co({
644
644
  disabled: x.isPending,
645
645
  className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-rose-600 px-2.5 text-[12px] font-medium text-white hover:bg-rose-700 disabled:opacity-60",
646
646
  children: [
647
- x.isPending ? /* @__PURE__ */ e(_e, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(ot, { className: "h-3 w-3" }),
647
+ x.isPending ? /* @__PURE__ */ e(Re, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(ot, { className: "h-3 w-3" }),
648
648
  "Delete group"
649
649
  ]
650
650
  }
@@ -653,26 +653,26 @@ function co({
653
653
  ] })
654
654
  ] }) });
655
655
  }
656
- function lo({
656
+ function us({
657
657
  groups: t,
658
- isLoading: n,
659
- errorMessage: a,
658
+ isLoading: a,
659
+ errorMessage: n,
660
660
  onRetry: r,
661
- currentUserId: o,
661
+ currentUserId: s,
662
662
  onOpenGroup: d,
663
663
  onCreate: f,
664
- onDeleteRequest: m
664
+ onDeleteRequest: h
665
665
  }) {
666
- const [g, v] = N(""), h = j(
666
+ const [g, v] = N(""), m = V(
667
667
  () => t.filter(
668
668
  (c) => !g.trim() || c.name.toLowerCase().includes(g.toLowerCase()) || (c.description || "").toLowerCase().includes(g.toLowerCase())
669
669
  ),
670
670
  [t, g]
671
671
  );
672
- return /* @__PURE__ */ s("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
673
- /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-5 py-2.5", children: [
674
- /* @__PURE__ */ s("div", { className: "flex flex-1 items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40", children: [
675
- /* @__PURE__ */ e(wn, { className: "h-3 w-3 text-muted-foreground" }),
672
+ return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
673
+ /* @__PURE__ */ o("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-5 py-2.5", children: [
674
+ /* @__PURE__ */ o("div", { className: "flex flex-1 items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40", children: [
675
+ /* @__PURE__ */ e(Sn, { className: "h-3 w-3 text-muted-foreground" }),
676
676
  /* @__PURE__ */ e(
677
677
  "input",
678
678
  {
@@ -688,11 +688,11 @@ function lo({
688
688
  type: "button",
689
689
  onClick: () => v(""),
690
690
  className: "flex h-4 w-4 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
691
- children: /* @__PURE__ */ e(Yt, { className: "h-2.5 w-2.5" })
691
+ children: /* @__PURE__ */ e(Kt, { className: "h-2.5 w-2.5" })
692
692
  }
693
693
  )
694
694
  ] }),
695
- /* @__PURE__ */ s(
695
+ /* @__PURE__ */ o(
696
696
  "button",
697
697
  {
698
698
  type: "button",
@@ -705,85 +705,85 @@ function lo({
705
705
  }
706
706
  )
707
707
  ] }),
708
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: n ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((c) => /* @__PURE__ */ e(
708
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: a ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((c) => /* @__PURE__ */ e(
709
709
  "div",
710
710
  {
711
711
  className: "h-12 animate-pulse rounded-[4px] bg-muted/60"
712
712
  },
713
713
  c
714
- )) }) : a ? /* @__PURE__ */ e(
715
- hr,
714
+ )) }) : n ? /* @__PURE__ */ e(
715
+ ur,
716
716
  {
717
717
  title: "Can't load groups",
718
- message: a,
718
+ message: n,
719
719
  onRetry: r
720
720
  }
721
- ) : h.length === 0 && t.length === 0 ? /* @__PURE__ */ e(mo, { onCreate: f }) : h.length === 0 ? /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
722
- /* @__PURE__ */ s("div", { className: "text-[12px] text-foreground", children: [
721
+ ) : m.length === 0 && t.length === 0 ? /* @__PURE__ */ e(hs, { onCreate: f }) : m.length === 0 ? /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
722
+ /* @__PURE__ */ o("div", { className: "text-[12px] text-foreground", children: [
723
723
  'No groups match "',
724
724
  g,
725
725
  '"'
726
726
  ] }),
727
727
  /* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: "Try a different search." })
728
- ] }) : h.map((c) => {
728
+ ] }) : m.map((c) => {
729
729
  var u;
730
730
  return /* @__PURE__ */ e(
731
- uo,
731
+ ms,
732
732
  {
733
733
  group: c,
734
- canDelete: ((u = c.permissions) == null ? void 0 : u.canDelete) ?? c.createdBy === o,
734
+ canDelete: ((u = c.permissions) == null ? void 0 : u.canDelete) ?? c.createdBy === s,
735
735
  onClick: () => d(c.id),
736
- onDelete: () => m(c)
736
+ onDelete: () => h(c)
737
737
  },
738
738
  c.id
739
739
  );
740
740
  }) })
741
741
  ] });
742
742
  }
743
- function uo({
743
+ function ms({
744
744
  group: t,
745
- canDelete: n,
746
- onClick: a,
745
+ canDelete: a,
746
+ onClick: n,
747
747
  onDelete: r
748
748
  }) {
749
- let o = "";
749
+ let s = "";
750
750
  try {
751
- o = Zt(new Date(t.createdAt), "MMM d, yyyy");
751
+ s = Jt(new Date(t.createdAt), "MMM d, yyyy");
752
752
  } catch {
753
- o = "";
753
+ s = "";
754
754
  }
755
- return /* @__PURE__ */ s(
755
+ return /* @__PURE__ */ o(
756
756
  "button",
757
757
  {
758
758
  type: "button",
759
- onClick: a,
759
+ onClick: n,
760
760
  className: "group flex w-full items-center gap-3 border-b border-border/60 px-5 py-2.5 text-left hover:bg-accent/40",
761
761
  children: [
762
- /* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(ra, { className: "h-3.5 w-3.5" }) }),
763
- /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
762
+ /* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(Jr, { className: "h-3.5 w-3.5" }) }),
763
+ /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
764
764
  /* @__PURE__ */ e("div", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
765
- /* @__PURE__ */ s("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
766
- /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1", children: [
767
- /* @__PURE__ */ e(er, { className: "h-2.5 w-2.5" }),
765
+ /* @__PURE__ */ o("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
766
+ /* @__PURE__ */ o("span", { className: "inline-flex items-center gap-1", children: [
767
+ /* @__PURE__ */ e(Xt, { className: "h-2.5 w-2.5" }),
768
768
  t.memberCount,
769
769
  " member",
770
770
  t.memberCount === 1 ? "" : "s"
771
771
  ] }),
772
- o && /* @__PURE__ */ s($, { children: [
772
+ s && /* @__PURE__ */ o($, { children: [
773
773
  /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
774
- /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1", children: [
775
- /* @__PURE__ */ e(Wt, { className: "h-2.5 w-2.5" }),
776
- o
774
+ /* @__PURE__ */ o("span", { className: "inline-flex items-center gap-1", children: [
775
+ /* @__PURE__ */ e(zt, { className: "h-2.5 w-2.5" }),
776
+ s
777
777
  ] })
778
778
  ] }),
779
- t.description && /* @__PURE__ */ s($, { children: [
779
+ t.description && /* @__PURE__ */ o($, { children: [
780
780
  /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
781
781
  /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: t.description })
782
782
  ] })
783
783
  ] })
784
784
  ] }),
785
- /* @__PURE__ */ s("div", { className: "flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100", children: [
786
- n && /* @__PURE__ */ e(
785
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100", children: [
786
+ a && /* @__PURE__ */ e(
787
787
  "span",
788
788
  {
789
789
  role: "button",
@@ -799,18 +799,18 @@ function uo({
799
799
  children: /* @__PURE__ */ e(ot, { className: "h-3 w-3" })
800
800
  }
801
801
  ),
802
- /* @__PURE__ */ e(Nn, { className: "h-3.5 w-3.5 text-muted-foreground" })
802
+ /* @__PURE__ */ e(kn, { className: "h-3.5 w-3.5 text-muted-foreground" })
803
803
  ] })
804
804
  ]
805
805
  }
806
806
  );
807
807
  }
808
- function mo({ onCreate: t }) {
809
- return /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
810
- /* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(Qt, { className: "h-4 w-4" }) }),
808
+ function hs({ onCreate: t }) {
809
+ return /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
810
+ /* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(jt, { className: "h-4 w-4" }) }),
811
811
  /* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: "No groups yet" }),
812
812
  /* @__PURE__ */ e("div", { className: "max-w-[320px] text-[11.5px] leading-[1.55] text-muted-foreground", children: "Groups let you grant shared access to dashboards. Create one and add members." }),
813
- /* @__PURE__ */ s(
813
+ /* @__PURE__ */ o(
814
814
  "button",
815
815
  {
816
816
  type: "button",
@@ -824,58 +824,58 @@ function mo({ onCreate: t }) {
824
824
  )
825
825
  ] });
826
826
  }
827
- function ho({
827
+ function ps({
828
828
  group: t,
829
- isTenantViewer: n,
830
- canEdit: a,
829
+ isTenantViewer: a,
830
+ canEdit: n,
831
831
  canDelete: r,
832
- canManageMembers: o,
832
+ canManageMembers: s,
833
833
  onBack: d,
834
834
  onMembersChanged: f,
835
- onUpdated: m,
835
+ onUpdated: h,
836
836
  onRequestDelete: g
837
837
  }) {
838
838
  const {
839
839
  data: v,
840
- isLoading: h,
840
+ isLoading: m,
841
841
  error: c,
842
842
  refetch: u
843
- } = ea(t.id), l = (v == null ? void 0 : v.members) ?? io, p = c ? mr(c, "Unable to load members for this group.") : null, x = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: w } = ta({
843
+ } = Wr(t.id), l = (v == null ? void 0 : v.members) ?? cs, p = c ? lr(c, "Unable to load members for this group.") : null, x = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: w } = Yr({
844
844
  type: x,
845
845
  tenantId: t.tenantId || void 0,
846
846
  active: !0,
847
847
  limit: 200
848
- }), S = j(
848
+ }), S = V(
849
849
  () => new Set(l.map((y) => y.userId)),
850
850
  [l]
851
- ), b = oo(), L = so(), O = ao(), [k, E] = N(!1), [I, J] = N(t.name), [Te, H] = N(!1), [ae, z] = N(t.description || ""), [ne, oe] = N(""), [Ue, se] = N(!1), Ne = j(() => {
851
+ ), b = is(), L = ds(), M = ss(), [k, E] = N(!1), [I, X] = N(t.name), [$e, j] = N(!1), [ae, z] = N(t.description || ""), [ne, se] = N(""), [Be, oe] = N(!1), Se = V(() => {
852
852
  const y = ne.trim().toLowerCase();
853
853
  return w.filter((B) => !S.has(B.id)).filter(
854
854
  (B) => !y || (B.name || "").toLowerCase().includes(y) || (B.email || "").toLowerCase().includes(y)
855
855
  ).slice(0, 50);
856
- }, [w, S, ne]), X = async () => {
856
+ }, [w, S, ne]), Z = async () => {
857
857
  const y = I.trim();
858
858
  if (E(!1), y.length >= 3 && y !== t.name)
859
859
  try {
860
- await O.mutateAsync({
860
+ await M.mutateAsync({
861
861
  groupId: t.id,
862
862
  data: { name: y }
863
- }), m();
863
+ }), h();
864
864
  } catch {
865
865
  }
866
866
  }, ie = async () => {
867
867
  const y = ae.trim();
868
- if (H(!1), y !== (t.description || ""))
868
+ if (j(!1), y !== (t.description || ""))
869
869
  try {
870
- await O.mutateAsync({
870
+ await M.mutateAsync({
871
871
  groupId: t.id,
872
872
  data: { description: y }
873
- }), m();
873
+ }), h();
874
874
  } catch {
875
875
  }
876
- }, Se = async (y) => {
877
- if (o) {
878
- oe(""), se(!1);
876
+ }, ke = async (y) => {
877
+ if (s) {
878
+ se(""), oe(!1);
879
879
  try {
880
880
  await b.mutateAsync({
881
881
  groupId: t.id,
@@ -887,8 +887,8 @@ function ho({
887
887
  } catch {
888
888
  }
889
889
  }
890
- }, ke = async (y) => {
891
- if (o)
890
+ }, Ce = async (y) => {
891
+ if (s)
892
892
  try {
893
893
  await L.mutateAsync({
894
894
  groupId: t.id,
@@ -897,14 +897,14 @@ function ho({
897
897
  } catch {
898
898
  }
899
899
  };
900
- let Z = "";
900
+ let ee = "";
901
901
  try {
902
- Z = Zt(new Date(t.createdAt), "MMM d, yyyy");
902
+ ee = Jt(new Date(t.createdAt), "MMM d, yyyy");
903
903
  } catch {
904
- Z = "";
904
+ ee = "";
905
905
  }
906
- return /* @__PURE__ */ s("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
907
- /* @__PURE__ */ s("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
906
+ return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
907
+ /* @__PURE__ */ o("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
908
908
  /* @__PURE__ */ e(
909
909
  "button",
910
910
  {
@@ -912,7 +912,7 @@ function ho({
912
912
  onClick: d,
913
913
  "aria-label": "Back",
914
914
  className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
915
- children: /* @__PURE__ */ e(Kt, { className: "h-3.5 w-3.5" })
915
+ children: /* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5" })
916
916
  }
917
917
  ),
918
918
  k ? /* @__PURE__ */ e(
@@ -920,10 +920,10 @@ function ho({
920
920
  {
921
921
  autoFocus: !0,
922
922
  value: I,
923
- onChange: (y) => J(y.target.value),
924
- onBlur: X,
923
+ onChange: (y) => X(y.target.value),
924
+ onBlur: Z,
925
925
  onKeyDown: (y) => {
926
- y.key === "Enter" && X(), y.key === "Escape" && (J(t.name), E(!1));
926
+ y.key === "Enter" && Z(), y.key === "Escape" && (X(t.name), E(!1));
927
927
  },
928
928
  className: "h-6 min-w-0 flex-1 rounded-[3px] border border-border bg-background px-1.5 text-[13px] font-medium text-foreground focus:border-foreground/40 focus:outline-none"
929
929
  }
@@ -932,22 +932,22 @@ function ho({
932
932
  {
933
933
  type: "button",
934
934
  onClick: () => {
935
- a && (J(t.name), E(!0));
935
+ n && (X(t.name), E(!0));
936
936
  },
937
- title: a ? "Click to rename" : t.name,
938
- disabled: !a,
937
+ title: n ? "Click to rename" : t.name,
938
+ disabled: !n,
939
939
  className: "truncate rounded-[3px] px-1 text-[13px] font-medium text-foreground enabled:hover:bg-accent disabled:cursor-default",
940
940
  children: t.name
941
941
  }
942
942
  ),
943
- /* @__PURE__ */ s("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
944
- /* @__PURE__ */ e(er, { className: "h-2.5 w-2.5" }),
943
+ /* @__PURE__ */ o("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
944
+ /* @__PURE__ */ e(Xt, { className: "h-2.5 w-2.5" }),
945
945
  l.length,
946
946
  " member",
947
947
  l.length === 1 ? "" : "s"
948
948
  ] })
949
949
  ] }),
950
- /* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: Te ? /* @__PURE__ */ s("div", { children: [
950
+ /* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: $e ? /* @__PURE__ */ o("div", { children: [
951
951
  /* @__PURE__ */ e(
952
952
  "textarea",
953
953
  {
@@ -957,24 +957,24 @@ function ho({
957
957
  onChange: (y) => z(y.target.value),
958
958
  maxLength: 200,
959
959
  onKeyDown: (y) => {
960
- y.key === "Escape" && (z(t.description || ""), H(!1)), y.key === "Enter" && (y.metaKey || y.ctrlKey) && ie();
960
+ y.key === "Escape" && (z(t.description || ""), j(!1)), y.key === "Enter" && (y.metaKey || y.ctrlKey) && ie();
961
961
  },
962
962
  placeholder: "What is this group for?",
963
963
  className: "block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
964
964
  }
965
965
  ),
966
- /* @__PURE__ */ s("div", { className: "mt-1.5 flex items-center justify-between", children: [
967
- /* @__PURE__ */ s("span", { className: "text-[10.5px] text-muted-foreground", children: [
966
+ /* @__PURE__ */ o("div", { className: "mt-1.5 flex items-center justify-between", children: [
967
+ /* @__PURE__ */ o("span", { className: "text-[10.5px] text-muted-foreground", children: [
968
968
  ae.length,
969
969
  "/200 · Esc to cancel · ⌘↩ to save"
970
970
  ] }),
971
- /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
971
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-1.5", children: [
972
972
  /* @__PURE__ */ e(
973
973
  "button",
974
974
  {
975
975
  type: "button",
976
976
  onClick: () => {
977
- z(t.description || ""), H(!1);
977
+ z(t.description || ""), j(!1);
978
978
  },
979
979
  className: "h-6 rounded-[5px] px-2 text-[11px] font-medium text-foreground/80 hover:bg-accent",
980
980
  children: "Cancel"
@@ -991,76 +991,76 @@ function ho({
991
991
  )
992
992
  ] })
993
993
  ] })
994
- ] }) : /* @__PURE__ */ s(
994
+ ] }) : /* @__PURE__ */ o(
995
995
  "button",
996
996
  {
997
997
  type: "button",
998
998
  onClick: () => {
999
- a && (z(t.description || ""), H(!0));
999
+ n && (z(t.description || ""), j(!0));
1000
1000
  },
1001
- disabled: !a,
1002
- title: a ? "Click to edit description" : void 0,
1001
+ disabled: !n,
1002
+ title: n ? "Click to edit description" : void 0,
1003
1003
  className: "block w-full rounded-[3px] px-1 py-0.5 text-left enabled:hover:bg-accent/40 disabled:cursor-default",
1004
1004
  children: [
1005
- t.description ? /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: t.description }) : /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children: a ? "Add a description…" : "No description" }),
1006
- /* @__PURE__ */ s("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
1007
- Z ? `Created ${Z}` : "Recently created",
1008
- a ? " · You can edit this group" : ""
1005
+ t.description ? /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: t.description }) : /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children: n ? "Add a description…" : "No description" }),
1006
+ /* @__PURE__ */ o("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
1007
+ ee ? `Created ${ee}` : "Recently created",
1008
+ n ? " · You can edit this group" : ""
1009
1009
  ] })
1010
1010
  ]
1011
1011
  }
1012
1012
  ) }),
1013
- o && /* @__PURE__ */ e(
1014
- fo,
1013
+ s && /* @__PURE__ */ e(
1014
+ bs,
1015
1015
  {
1016
1016
  query: ne,
1017
- setQuery: oe,
1018
- open: Ue,
1019
- setOpen: se,
1020
- candidates: Ne,
1021
- showKindChip: !n,
1022
- onAdd: Se,
1017
+ setQuery: se,
1018
+ open: Be,
1019
+ setOpen: oe,
1020
+ candidates: Se,
1021
+ showKindChip: !a,
1022
+ onAdd: ke,
1023
1023
  busy: b.isPending
1024
1024
  }
1025
1025
  ),
1026
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: h ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((y) => /* @__PURE__ */ e(
1026
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: m ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((y) => /* @__PURE__ */ e(
1027
1027
  "div",
1028
1028
  {
1029
1029
  className: "h-10 animate-pulse rounded-[4px] bg-muted/60"
1030
1030
  },
1031
1031
  y
1032
1032
  )) }) : p ? /* @__PURE__ */ e(
1033
- hr,
1033
+ ur,
1034
1034
  {
1035
1035
  title: "Can't load members",
1036
1036
  message: p,
1037
1037
  onRetry: () => u()
1038
1038
  }
1039
- ) : l.length === 0 ? /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
1039
+ ) : l.length === 0 ? /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
1040
1040
  /* @__PURE__ */ e("div", { className: "text-[12px] text-foreground", children: "No members yet" }),
1041
- /* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: o ? "Search above to add people to this group." : "This group does not have any members." })
1041
+ /* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: s ? "Search above to add people to this group." : "This group does not have any members." })
1042
1042
  ] }) : l.map((y) => {
1043
- var B, q, K, Q, de, W;
1044
- return /* @__PURE__ */ s(
1043
+ var B, H, q, K, de, Q;
1044
+ return /* @__PURE__ */ o(
1045
1045
  "div",
1046
1046
  {
1047
1047
  className: "group flex items-center gap-2 border-b border-border/60 px-5 py-2",
1048
1048
  children: [
1049
- /* @__PURE__ */ e(pr, { name: ((B = y.user) == null ? void 0 : B.name) || ((q = y.user) == null ? void 0 : q.email) || "?" }),
1050
- /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
1051
- /* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((K = y.user) == null ? void 0 : K.name) || ((Q = y.user) == null ? void 0 : Q.email) || "Unknown" }),
1049
+ /* @__PURE__ */ e(mr, { name: ((B = y.user) == null ? void 0 : B.name) || ((H = y.user) == null ? void 0 : H.email) || "?" }),
1050
+ /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
1051
+ /* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((q = y.user) == null ? void 0 : q.name) || ((K = y.user) == null ? void 0 : K.email) || "Unknown" }),
1052
1052
  ((de = y.user) == null ? void 0 : de.email) && y.user.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: y.user.email })
1053
1053
  ] }),
1054
- !n && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: y.userType }),
1054
+ !a && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: y.userType }),
1055
1055
  /* @__PURE__ */ e(
1056
1056
  "button",
1057
1057
  {
1058
1058
  type: "button",
1059
- onClick: () => ke(y.userId),
1060
- disabled: !o || L.isPending,
1061
- "aria-label": `Remove ${((W = y.user) == null ? void 0 : W.name) || "member"}`,
1059
+ onClick: () => Ce(y.userId),
1060
+ disabled: !s || L.isPending,
1061
+ "aria-label": `Remove ${((Q = y.user) == null ? void 0 : Q.name) || "member"}`,
1062
1062
  className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover:opacity-100 disabled:opacity-30",
1063
- children: /* @__PURE__ */ e(Yt, { className: "h-3 w-3" })
1063
+ children: /* @__PURE__ */ e(Kt, { className: "h-3 w-3" })
1064
1064
  }
1065
1065
  )
1066
1066
  ]
@@ -1068,7 +1068,7 @@ function ho({
1068
1068
  y.id
1069
1069
  );
1070
1070
  }) }),
1071
- r && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: /* @__PURE__ */ s(
1071
+ r && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: /* @__PURE__ */ o(
1072
1072
  "button",
1073
1073
  {
1074
1074
  type: "button",
@@ -1082,36 +1082,36 @@ function ho({
1082
1082
  ) })
1083
1083
  ] });
1084
1084
  }
1085
- function po({
1085
+ function fs({
1086
1086
  isTenantUser: t,
1087
- tenantId: n,
1088
- onCancel: a,
1087
+ tenantId: a,
1088
+ onCancel: n,
1089
1089
  onCreated: r
1090
1090
  }) {
1091
- const [o, d] = N(""), [f, m] = N(""), [g, v] = N(null), h = ro(), c = o.trim().length >= 3 && o.trim().length <= 50, u = async () => {
1091
+ const [s, d] = N(""), [f, h] = N(""), [g, v] = N(null), m = ns(), c = s.trim().length >= 3 && s.trim().length <= 50, u = async () => {
1092
1092
  if (!c) return;
1093
1093
  v(null);
1094
1094
  const l = {
1095
- name: o.trim(),
1095
+ name: s.trim(),
1096
1096
  description: f.trim() || void 0,
1097
1097
  type: t ? "TENANT_GROUP" : "ORG_GROUP",
1098
- ...t && n ? { tenantId: n } : {}
1098
+ ...t && a ? { tenantId: a } : {}
1099
1099
  };
1100
1100
  try {
1101
- const p = await h.mutateAsync(l), x = p == null ? void 0 : p.id;
1102
- x ? r(x) : a();
1101
+ const p = await m.mutateAsync(l), x = p == null ? void 0 : p.id;
1102
+ x ? r(x) : n();
1103
1103
  } catch (p) {
1104
1104
  v(p instanceof Error ? p.message : "Failed to create group");
1105
1105
  }
1106
1106
  };
1107
- return /* @__PURE__ */ s("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
1108
- /* @__PURE__ */ s("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
1109
- /* @__PURE__ */ e(Vt, { children: "Name" }),
1107
+ return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
1108
+ /* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
1109
+ /* @__PURE__ */ e(Ut, { children: "Name" }),
1110
1110
  /* @__PURE__ */ e(
1111
1111
  "input",
1112
1112
  {
1113
1113
  autoFocus: !0,
1114
- value: o,
1114
+ value: s,
1115
1115
  onChange: (l) => d(l.target.value),
1116
1116
  placeholder: "Marketing leads, North America sales, …",
1117
1117
  maxLength: 50,
@@ -1119,33 +1119,33 @@ function po({
1119
1119
  }
1120
1120
  ),
1121
1121
  /* @__PURE__ */ e("div", { className: "mt-1 text-[10.5px] text-muted-foreground", children: "3–50 characters." }),
1122
- /* @__PURE__ */ s("div", { className: "mt-4", children: [
1123
- /* @__PURE__ */ e(Vt, { children: "Description (optional)" }),
1122
+ /* @__PURE__ */ o("div", { className: "mt-4", children: [
1123
+ /* @__PURE__ */ e(Ut, { children: "Description (optional)" }),
1124
1124
  /* @__PURE__ */ e(
1125
1125
  "textarea",
1126
1126
  {
1127
1127
  rows: 2,
1128
1128
  value: f,
1129
- onChange: (l) => m(l.target.value),
1129
+ onChange: (l) => h(l.target.value),
1130
1130
  maxLength: 200,
1131
1131
  placeholder: "What is this group for?",
1132
1132
  className: "mt-1 block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
1133
1133
  }
1134
1134
  ),
1135
- /* @__PURE__ */ s("div", { className: "mt-1 flex justify-end text-[10.5px] text-muted-foreground", children: [
1135
+ /* @__PURE__ */ o("div", { className: "mt-1 flex justify-end text-[10.5px] text-muted-foreground", children: [
1136
1136
  f.length,
1137
1137
  "/200"
1138
1138
  ] })
1139
1139
  ] }),
1140
1140
  g && /* @__PURE__ */ e("div", { className: "mt-3 rounded-[5px] border border-rose-200 bg-rose-50 px-2 py-1.5 text-[11.5px] text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/30 dark:text-rose-300", children: g })
1141
1141
  ] }),
1142
- /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: [
1142
+ /* @__PURE__ */ o("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: [
1143
1143
  /* @__PURE__ */ e(
1144
1144
  "button",
1145
1145
  {
1146
1146
  type: "button",
1147
- onClick: a,
1148
- disabled: h.isPending,
1147
+ onClick: n,
1148
+ disabled: m.isPending,
1149
1149
  className: "h-7 rounded-[5px] px-2.5 text-[12px] font-medium text-foreground/80 hover:bg-accent",
1150
1150
  children: "Cancel"
1151
1151
  }
@@ -1155,12 +1155,12 @@ function po({
1155
1155
  {
1156
1156
  type: "button",
1157
1157
  onClick: u,
1158
- disabled: !c || h.isPending,
1158
+ disabled: !c || m.isPending,
1159
1159
  className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",
1160
- children: h.isPending ? /* @__PURE__ */ s($, { children: [
1161
- /* @__PURE__ */ e(_e, { className: "h-3 w-3 animate-spin" }),
1160
+ children: m.isPending ? /* @__PURE__ */ o($, { children: [
1161
+ /* @__PURE__ */ e(Re, { className: "h-3 w-3 animate-spin" }),
1162
1162
  "Creating…"
1163
- ] }) : /* @__PURE__ */ s($, { children: [
1163
+ ] }) : /* @__PURE__ */ o($, { children: [
1164
1164
  /* @__PURE__ */ e(re, { className: "h-3 w-3" }),
1165
1165
  "Create group"
1166
1166
  ] })
@@ -1169,19 +1169,19 @@ function po({
1169
1169
  ] })
1170
1170
  ] });
1171
1171
  }
1172
- function fo({
1172
+ function bs({
1173
1173
  query: t,
1174
- setQuery: n,
1175
- open: a,
1174
+ setQuery: a,
1175
+ open: n,
1176
1176
  setOpen: r,
1177
- candidates: o,
1177
+ candidates: s,
1178
1178
  showKindChip: d,
1179
1179
  onAdd: f,
1180
- busy: m
1180
+ busy: h
1181
1181
  }) {
1182
- const g = Rt(null), v = Rt(null), [h, c] = N(null);
1183
- an(() => {
1184
- if (!a) {
1182
+ const g = Ot(null), v = Ot(null), [m, c] = N(null);
1183
+ en(() => {
1184
+ if (!n) {
1185
1185
  c(null);
1186
1186
  return;
1187
1187
  }
@@ -1199,62 +1199,62 @@ function fo({
1199
1199
  return l(), window.addEventListener("resize", l), window.addEventListener("scroll", l, !0), () => {
1200
1200
  window.removeEventListener("resize", l), window.removeEventListener("scroll", l, !0);
1201
1201
  };
1202
- }, [a, o.length]), be(() => {
1203
- if (!a) return;
1202
+ }, [n, s.length]), ge(() => {
1203
+ if (!n) return;
1204
1204
  const l = (p) => {
1205
1205
  var w, S;
1206
1206
  const x = p.target;
1207
1207
  (w = g.current) != null && w.contains(x) || (S = v.current) != null && S.contains(x) || r(!1);
1208
1208
  };
1209
1209
  return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
1210
- }, [a, r]);
1211
- const u = a && o.length > 0 && h;
1212
- return /* @__PURE__ */ s("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: [
1213
- /* @__PURE__ */ s(
1210
+ }, [n, r]);
1211
+ const u = n && s.length > 0 && m;
1212
+ return /* @__PURE__ */ o("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: [
1213
+ /* @__PURE__ */ o(
1214
1214
  "div",
1215
1215
  {
1216
1216
  ref: g,
1217
1217
  className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40",
1218
1218
  children: [
1219
- /* @__PURE__ */ e(Tn, { className: "h-3 w-3 text-muted-foreground" }),
1219
+ /* @__PURE__ */ e($n, { className: "h-3 w-3 text-muted-foreground" }),
1220
1220
  /* @__PURE__ */ e(
1221
1221
  "input",
1222
1222
  {
1223
1223
  value: t,
1224
1224
  onChange: (l) => {
1225
- n(l.target.value), r(!0);
1225
+ a(l.target.value), r(!0);
1226
1226
  },
1227
1227
  onFocus: () => r(!0),
1228
1228
  placeholder: "Add a member by name or email…",
1229
- disabled: m,
1229
+ disabled: h,
1230
1230
  className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed"
1231
1231
  }
1232
1232
  )
1233
1233
  ]
1234
1234
  }
1235
1235
  ),
1236
- u && typeof document < "u" && vn(
1236
+ u && typeof document < "u" && wn(
1237
1237
  /* @__PURE__ */ e(
1238
1238
  "div",
1239
1239
  {
1240
1240
  ref: v,
1241
1241
  style: {
1242
1242
  position: "fixed",
1243
- left: h.left,
1244
- top: h.top,
1245
- width: h.width,
1246
- transform: h.above ? "translateY(-100%)" : void 0
1243
+ left: m.left,
1244
+ top: m.top,
1245
+ width: m.width,
1246
+ transform: m.above ? "translateY(-100%)" : void 0
1247
1247
  },
1248
1248
  className: "z-[60] max-h-[240px] overflow-y-auto rounded-[5px] border border-border bg-background shadow-[0_8px_24px_-12px_rgba(0,0,0,0.18)]",
1249
- children: o.map((l) => /* @__PURE__ */ s(
1249
+ children: s.map((l) => /* @__PURE__ */ o(
1250
1250
  "button",
1251
1251
  {
1252
1252
  type: "button",
1253
1253
  onClick: () => f(l),
1254
1254
  className: "flex w-full items-center gap-2 border-b border-border/60 px-2.5 py-2 text-left last:border-b-0 hover:bg-accent",
1255
1255
  children: [
1256
- /* @__PURE__ */ e(pr, { name: l.name || l.email || "?" }),
1257
- /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
1256
+ /* @__PURE__ */ e(mr, { name: l.name || l.email || "?" }),
1257
+ /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
1258
1258
  /* @__PURE__ */ e("div", { className: "truncate text-[12px] font-medium text-foreground", children: l.name || l.email || "Unknown" }),
1259
1259
  l.email && l.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: l.email })
1260
1260
  ] }),
@@ -1269,221 +1269,221 @@ function fo({
1269
1269
  )
1270
1270
  ] });
1271
1271
  }
1272
- function mr(t, n) {
1273
- if (!t) return n;
1272
+ function lr(t, a) {
1273
+ if (!t) return a;
1274
1274
  if (t instanceof Error) {
1275
- const a = t.message || "", r = a.match(/\{[\s\S]*"error"\s*:\s*"([^"]+)"[\s\S]*\}/);
1276
- return r ? r[1] : a || n;
1275
+ const n = t.message || "", r = n.match(/\{[\s\S]*"error"\s*:\s*"([^"]+)"[\s\S]*\}/);
1276
+ return r ? r[1] : n || a;
1277
1277
  }
1278
- return typeof t == "string" ? t : n;
1278
+ return typeof t == "string" ? t : a;
1279
1279
  }
1280
- function hr({
1280
+ function ur({
1281
1281
  title: t,
1282
- message: n,
1283
- onRetry: a
1282
+ message: a,
1283
+ onRetry: n
1284
1284
  }) {
1285
- return /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center gap-2 px-6 py-10 text-center", children: [
1285
+ return /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-2 px-6 py-10 text-center", children: [
1286
1286
  /* @__PURE__ */ e("div", { className: "text-[12.5px] font-medium text-foreground", children: t }),
1287
- /* @__PURE__ */ e("div", { className: "max-w-[360px] text-[11.5px] leading-[1.55] text-muted-foreground", children: n }),
1288
- a && /* @__PURE__ */ e(
1287
+ /* @__PURE__ */ e("div", { className: "max-w-[360px] text-[11.5px] leading-[1.55] text-muted-foreground", children: a }),
1288
+ n && /* @__PURE__ */ e(
1289
1289
  "button",
1290
1290
  {
1291
1291
  type: "button",
1292
- onClick: a,
1292
+ onClick: n,
1293
1293
  className: "mt-1 inline-flex h-7 items-center rounded-[5px] border border-border bg-background px-2.5 text-[11.5px] font-medium text-foreground hover:bg-accent",
1294
1294
  children: "Try again"
1295
1295
  }
1296
1296
  )
1297
1297
  ] });
1298
1298
  }
1299
- function Vt({ children: t }) {
1299
+ function Ut({ children: t }) {
1300
1300
  return /* @__PURE__ */ e("label", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: t });
1301
1301
  }
1302
- function pr({ name: t }) {
1303
- const n = t.split(" ").map((a) => a[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
1304
- return /* @__PURE__ */ e(lr, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ e(ur, { className: "text-[9px] font-semibold", children: n || "?" }) });
1302
+ function mr({ name: t }) {
1303
+ const a = t.split(" ").map((n) => n[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
1304
+ return /* @__PURE__ */ e(dr, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ e(cr, { className: "text-[9px] font-semibold", children: a || "?" }) });
1305
1305
  }
1306
- const bo = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
1307
- function go({
1306
+ const gs = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
1307
+ function xs({
1308
1308
  open: t,
1309
- onOpenChange: n
1309
+ onOpenChange: a
1310
1310
  }) {
1311
- const a = C(
1312
- (o) => {
1311
+ const n = C(
1312
+ (s) => {
1313
1313
  var d, f;
1314
- return Cn({
1315
- dashboardDefault: (f = (d = o.dashboard) == null ? void 0 : d.exportDefaults) == null ? void 0 : f.csvEncoding
1314
+ return En({
1315
+ dashboardDefault: (f = (d = s.dashboard) == null ? void 0 : d.exportDefaults) == null ? void 0 : f.csvEncoding
1316
1316
  });
1317
1317
  }
1318
1318
  ), { setDashboardExportDefaults: r } = C(
1319
- (o) => o.actions
1319
+ (s) => s.actions
1320
1320
  );
1321
- return /* @__PURE__ */ e(zt, { open: t, onOpenChange: n, children: /* @__PURE__ */ s(qt, { className: "rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control", children: [
1322
- /* @__PURE__ */ s(aa, { children: [
1323
- /* @__PURE__ */ e(Ze, { className: "text-[15px]", children: "Download settings" }),
1324
- /* @__PURE__ */ e(et, { className: "text-[13px] leading-5", children: "Applies to every CSV downloaded or delivered from this dashboard. People can still change it for a single download." })
1321
+ return /* @__PURE__ */ e(Ft, { open: t, onOpenChange: a, children: /* @__PURE__ */ o(Gt, { className: "rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control", children: [
1322
+ /* @__PURE__ */ o(Xr, { children: [
1323
+ /* @__PURE__ */ e(et, { className: "text-[15px]", children: "Download settings" }),
1324
+ /* @__PURE__ */ e(tt, { className: "text-[13px] leading-5", children: "Applies to every CSV downloaded or delivered from this dashboard. People can still change it for a single download." })
1325
1325
  ] }),
1326
- /* @__PURE__ */ s("div", { className: "space-y-2", children: [
1327
- /* @__PURE__ */ e(qa, { htmlFor: "dashboard-csv-encoding", className: bo, children: "CSV encoding" }),
1328
- /* @__PURE__ */ s(
1329
- Ka,
1326
+ /* @__PURE__ */ o("div", { className: "space-y-2", children: [
1327
+ /* @__PURE__ */ e(Ba, { htmlFor: "dashboard-csv-encoding", className: gs, children: "CSV encoding" }),
1328
+ /* @__PURE__ */ o(
1329
+ Fa,
1330
1330
  {
1331
- value: a,
1332
- onValueChange: (o) => r({ csvEncoding: o }),
1331
+ value: n,
1332
+ onValueChange: (s) => r({ csvEncoding: s }),
1333
1333
  children: [
1334
- /* @__PURE__ */ e(Qa, { id: "dashboard-csv-encoding", size: "sm", children: /* @__PURE__ */ e(Wa, {}) }),
1335
- /* @__PURE__ */ e(Ya, { children: na.map((o) => /* @__PURE__ */ e(Ja, { value: o.value, children: o.label }, o.value)) })
1334
+ /* @__PURE__ */ e(Ga, { id: "dashboard-csv-encoding", size: "sm", children: /* @__PURE__ */ e(Va, {}) }),
1335
+ /* @__PURE__ */ e(ja, { children: Zr.map((s) => /* @__PURE__ */ e(za, { value: s.value, children: s.label }, s.value)) })
1336
1336
  ]
1337
1337
  }
1338
1338
  )
1339
1339
  ] })
1340
1340
  ] }) });
1341
1341
  }
1342
- function pe(t, n, a) {
1342
+ function pe(t, a, n) {
1343
1343
  var d, f;
1344
1344
  const r = (t.controls || []).find(
1345
- (m) => m.id === a
1345
+ (h) => h.id === n
1346
1346
  );
1347
1347
  if (r)
1348
1348
  return r.label;
1349
- const o = (f = (d = Re(t, n)) == null ? void 0 : d.controls) == null ? void 0 : f.find(
1350
- (m) => m.id === a
1349
+ const s = (f = (d = Ue(t, a)) == null ? void 0 : d.controls) == null ? void 0 : f.find(
1350
+ (h) => h.id === n
1351
1351
  );
1352
- return (o == null ? void 0 : o.label) || a;
1352
+ return (s == null ? void 0 : s.label) || n;
1353
1353
  }
1354
- function fe(t, n) {
1355
- var a;
1356
- return ((a = Re(t, n)) == null ? void 0 : a.title) || n;
1354
+ function fe(t, a) {
1355
+ var n;
1356
+ return ((n = Ue(t, a)) == null ? void 0 : n.title) || a;
1357
1357
  }
1358
- function xo(t) {
1359
- const { errors: n, dashboard: a } = t;
1360
- if (!a)
1361
- return n;
1358
+ function vs(t) {
1359
+ const { errors: a, dashboard: n } = t;
1360
+ if (!n)
1361
+ return a;
1362
1362
  const r = /* @__PURE__ */ new Map();
1363
- for (const o of n) {
1364
- const d = o.match(
1363
+ for (const s of a) {
1364
+ const d = s.match(
1365
1365
  /^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
1366
1366
  );
1367
1367
  if (d) {
1368
- const [, h, c] = d, u = `${h}:${c}:missing-metric`;
1368
+ const [, m, c] = d, u = `${m}:${c}:missing-metric`;
1369
1369
  r.has(u) || r.set(
1370
1370
  u,
1371
- `"${fe(a, h)}" has an outdated "${pe(
1372
- a,
1373
- h,
1371
+ `"${fe(n, m)}" has an outdated "${pe(
1372
+ n,
1373
+ m,
1374
1374
  c
1375
1375
  )}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
1376
1376
  );
1377
1377
  continue;
1378
1378
  }
1379
- const f = o.match(
1379
+ const f = s.match(
1380
1380
  /^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
1381
1381
  );
1382
1382
  if (f) {
1383
- const [, h, c] = f, u = `${h}:${c}:missing-group-by`;
1383
+ const [, m, c] = f, u = `${m}:${c}:missing-group-by`;
1384
1384
  r.has(u) || r.set(
1385
1385
  u,
1386
- `"${fe(a, h)}" has an outdated "${pe(
1387
- a,
1388
- h,
1386
+ `"${fe(n, m)}" has an outdated "${pe(
1387
+ n,
1388
+ m,
1389
1389
  c
1390
1390
  )}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
1391
1391
  );
1392
1392
  continue;
1393
1393
  }
1394
- const m = o.match(
1394
+ const h = s.match(
1395
1395
  /^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
1396
1396
  );
1397
- if (m) {
1398
- const [, h, c] = m, u = `${h}:${c}:invalid-metric`;
1397
+ if (h) {
1398
+ const [, m, c] = h, u = `${m}:${c}:invalid-metric`;
1399
1399
  r.has(u) || r.set(
1400
1400
  u,
1401
- `"${fe(a, h)}" has an invalid "${pe(
1402
- a,
1403
- h,
1401
+ `"${fe(n, m)}" has an invalid "${pe(
1402
+ n,
1403
+ m,
1404
1404
  c
1405
1405
  )}" metric mapping. Open the card controls and choose a valid metric for each option.`
1406
1406
  );
1407
1407
  continue;
1408
1408
  }
1409
- const g = o.match(
1409
+ const g = s.match(
1410
1410
  /^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
1411
1411
  );
1412
1412
  if (g) {
1413
- const [, h, c] = g, u = `${h}:${c}:invalid-group-by`;
1413
+ const [, m, c] = g, u = `${m}:${c}:invalid-group-by`;
1414
1414
  r.has(u) || r.set(
1415
1415
  u,
1416
- `"${fe(a, h)}" has an invalid "${pe(
1417
- a,
1418
- h,
1416
+ `"${fe(n, m)}" has an invalid "${pe(
1417
+ n,
1418
+ m,
1419
1419
  c
1420
1420
  )}" field mapping. Open the card controls and choose a valid field for each option.`
1421
1421
  );
1422
1422
  continue;
1423
1423
  }
1424
- const v = o.match(
1424
+ const v = s.match(
1425
1425
  /^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
1426
1426
  );
1427
1427
  if (v) {
1428
- const [, h, c] = v, u = `${h}:${c}:missing-temporal-group-by`;
1428
+ const [, m, c] = v, u = `${m}:${c}:missing-temporal-group-by`;
1429
1429
  r.has(u) || r.set(
1430
1430
  u,
1431
- `"${fe(a, h)}" can no longer use "${pe(
1432
- a,
1433
- h,
1431
+ `"${fe(n, m)}" can no longer use "${pe(
1432
+ n,
1433
+ m,
1434
1434
  c
1435
1435
  )}" for time grain because the card does not currently group by a date field.`
1436
1436
  );
1437
1437
  continue;
1438
1438
  }
1439
- r.set(o, o);
1439
+ r.set(s, s);
1440
1440
  }
1441
1441
  return Array.from(r.values());
1442
1442
  }
1443
- function vo({
1443
+ function ys({
1444
1444
  visible: t,
1445
- onSelect: n
1445
+ onSelect: a
1446
1446
  }) {
1447
- return t ? /* @__PURE__ */ s(R, { onSelect: n, children: [
1448
- /* @__PURE__ */ e(oa, { className: "h-3.5 w-3.5" }),
1447
+ return t ? /* @__PURE__ */ o(P, { onSelect: a, children: [
1448
+ /* @__PURE__ */ e(ea, { className: "h-3.5 w-3.5" }),
1449
1449
  "Schedule email report"
1450
1450
  ] }) : null;
1451
1451
  }
1452
- function yo({
1452
+ function ws({
1453
1453
  scheduleReportVisible: t,
1454
- analyticalBriefingVisible: n,
1455
- onScheduleReport: a,
1454
+ analyticalBriefingVisible: a,
1455
+ onScheduleReport: n,
1456
1456
  onCreateAnalyticalBriefing: r
1457
1457
  }) {
1458
- return /* @__PURE__ */ s($, { children: [
1458
+ return /* @__PURE__ */ o($, { children: [
1459
1459
  /* @__PURE__ */ e(
1460
- vo,
1460
+ ys,
1461
1461
  {
1462
1462
  visible: t,
1463
- onSelect: a
1463
+ onSelect: n
1464
1464
  }
1465
1465
  ),
1466
- n ? /* @__PURE__ */ s(R, { onSelect: r, children: [
1466
+ a ? /* @__PURE__ */ o(P, { onSelect: r, children: [
1467
1467
  /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
1468
1468
  "Create analytical briefing"
1469
1469
  ] }) : null
1470
1470
  ] });
1471
1471
  }
1472
- function wo(t) {
1473
- var v, h, c;
1474
- const { saved: n, draft: a, usage: r } = t, o = [], d = In(n);
1472
+ function Ns(t) {
1473
+ var v, m, c;
1474
+ const { saved: a, draft: n, usage: r } = t, s = [], d = On(a);
1475
1475
  for (const [u, l] of Object.entries(r.inputs))
1476
- !l || !$t(n, u) || $t(a, u) || o.push({
1476
+ !l || !_t(a, u) || _t(n, u) || s.push({
1477
1477
  target: "input",
1478
1478
  id: u,
1479
- label: An(n, d, u),
1479
+ label: Ln(a, d, u),
1480
1480
  bookmarks: l,
1481
1481
  remembered: 0
1482
1482
  });
1483
- const f = new Set((a.sheets ?? []).map((u) => u.id));
1484
- for (const u of n.sheets ?? []) {
1483
+ const f = new Set((n.sheets ?? []).map((u) => u.id));
1484
+ for (const u of a.sheets ?? []) {
1485
1485
  const l = r.sheets[u.id] ?? 0;
1486
- !l || f.has(u.id) || o.push({
1486
+ !l || f.has(u.id) || s.push({
1487
1487
  target: "sheet",
1488
1488
  id: u.id,
1489
1489
  label: ((v = u.title) == null ? void 0 : v.trim()) || "Untitled sheet",
@@ -1491,12 +1491,12 @@ function wo(t) {
1491
1491
  remembered: 0
1492
1492
  });
1493
1493
  }
1494
- const m = Ut(n), g = Ut(a);
1494
+ const h = Mt(a), g = Mt(n);
1495
1495
  for (const [u, l] of Object.entries(r.tables)) {
1496
- if (!m.has(u)) continue;
1497
- const p = Re(n, u), x = ((h = p == null ? void 0 : p.title) == null ? void 0 : h.trim()) || "Untitled table";
1496
+ if (!h.has(u)) continue;
1497
+ const p = Ue(a, u), x = ((m = p == null ? void 0 : p.title) == null ? void 0 : m.trim()) || "Untitled table";
1498
1498
  if (!g.has(u)) {
1499
- o.push({
1499
+ s.push({
1500
1500
  target: "table",
1501
1501
  id: u,
1502
1502
  label: x,
@@ -1505,76 +1505,76 @@ function wo(t) {
1505
1505
  });
1506
1506
  continue;
1507
1507
  }
1508
- const w = p ? Tt(p) : void 0, S = Re(a, u), b = S ? Tt(S) : void 0;
1508
+ const w = p ? Lt(p) : void 0, S = Ue(n, u), b = S ? Lt(S) : void 0;
1509
1509
  if (!(!p || !w || !b))
1510
- for (const [L, O] of Object.entries(l.columns)) {
1511
- if (!(O.bookmarks || O.remembered) || Sn(L) || !w.has(L) || b.has(L))
1510
+ for (const [L, M] of Object.entries(l.columns)) {
1511
+ if (!(M.bookmarks || M.remembered) || Cn(L) || !w.has(L) || b.has(L))
1512
1512
  continue;
1513
- const k = kn(p, L), E = ((c = k == null ? void 0 : k.label) == null ? void 0 : c.trim()) || (k == null ? void 0 : k.name);
1514
- o.push({
1513
+ const k = Dn(p, L), E = ((c = k == null ? void 0 : k.label) == null ? void 0 : c.trim()) || (k == null ? void 0 : k.name);
1514
+ s.push({
1515
1515
  target: "column",
1516
1516
  id: L,
1517
1517
  cardId: u,
1518
1518
  label: E ? `${E} in ${x}` : `A column in ${x}`,
1519
- bookmarks: O.bookmarks,
1520
- remembered: O.remembered
1519
+ bookmarks: M.bookmarks,
1520
+ remembered: M.remembered
1521
1521
  });
1522
1522
  }
1523
1523
  }
1524
- return o;
1524
+ return s;
1525
1525
  }
1526
- const No = "dashboard-bookmark-usage";
1527
- function So(t) {
1526
+ const Ss = "dashboard-bookmark-usage";
1527
+ function ks(t) {
1528
1528
  var g;
1529
- const n = C((v) => v.viewerStateClient), a = (g = t.saved) == null ? void 0 : g.id, o = sa({
1529
+ const a = C((v) => v.viewerStateClient), n = (g = t.saved) == null ? void 0 : g.id, s = ta({
1530
1530
  // Keyed by the viewer, never by the client object (TanStack drops functions when hashing).
1531
- queryKey: [No, (n == null ? void 0 : n.viewerKey) ?? null],
1532
- queryFn: () => n.bookmarks.usage(),
1533
- enabled: t.enabled && !!n && !!a,
1531
+ queryKey: [Ss, (a == null ? void 0 : a.viewerKey) ?? null],
1532
+ queryFn: () => a.bookmarks.usage(),
1533
+ enabled: t.enabled && !!a && !!n,
1534
1534
  staleTime: 5 * 6e4,
1535
1535
  retry: !1
1536
- }).data, { saved: d, draft: f, enabled: m } = t;
1537
- return j(() => !m || !d || !o ? [] : !o.bookmarks && !Object.keys(o.tables).length ? [] : wo({ saved: d, draft: f, usage: o }), [f, m, d, o]);
1536
+ }).data, { saved: d, draft: f, enabled: h } = t;
1537
+ return V(() => !h || !d || !s ? [] : !s.bookmarks && !Object.keys(s.tables).length ? [] : Ns({ saved: d, draft: f, usage: s }), [f, h, d, s]);
1538
1538
  }
1539
- function jt(t, n, a) {
1540
- return `${t} ${t === 1 ? n : a}`;
1539
+ function $t(t, a, n) {
1540
+ return `${t} ${t === 1 ? a : n}`;
1541
1541
  }
1542
- function ko(t) {
1543
- const n = [
1544
- t.bookmarks ? jt(t.bookmarks, "bookmark", "bookmarks") : null,
1545
- t.remembered ? jt(t.remembered, "remembered layout", "remembered layouts") : null
1542
+ function Cs(t) {
1543
+ const a = [
1544
+ t.bookmarks ? $t(t.bookmarks, "bookmark", "bookmarks") : null,
1545
+ t.remembered ? $t(t.remembered, "remembered layout", "remembered layouts") : null
1546
1546
  ].filter(Boolean).join(", ");
1547
- return t.target === "sheet" ? { name: `${t.label} sheet`, uses: n } : t.target === "table" ? { name: `${t.label} table`, uses: n } : { name: t.label, uses: n };
1547
+ return t.target === "sheet" ? { name: `${t.label} sheet`, uses: a } : t.target === "table" ? { name: `${t.label} table`, uses: a } : { name: t.label, uses: a };
1548
1548
  }
1549
- function Co({
1549
+ function Ds({
1550
1550
  saved: t,
1551
- draft: n,
1552
- enabled: a
1551
+ draft: a,
1552
+ enabled: n
1553
1553
  }) {
1554
- const r = So({ saved: t, draft: n, enabled: a });
1555
- return r.length ? /* @__PURE__ */ s(Xa, { children: [
1556
- /* @__PURE__ */ e(Za, { asChild: !0, children: /* @__PURE__ */ s(
1557
- U,
1554
+ const r = ks({ saved: t, draft: a, enabled: n });
1555
+ return r.length ? /* @__PURE__ */ o(Ha, { children: [
1556
+ /* @__PURE__ */ e(qa, { asChild: !0, children: /* @__PURE__ */ o(
1557
+ G,
1558
1558
  {
1559
1559
  variant: "ghost",
1560
1560
  size: "xs",
1561
1561
  className: "gap-1 text-muted-foreground hover:text-foreground",
1562
1562
  children: [
1563
- /* @__PURE__ */ e(ia, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
1563
+ /* @__PURE__ */ e(ra, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
1564
1564
  "Affects saved views"
1565
1565
  ]
1566
1566
  }
1567
1567
  ) }),
1568
- /* @__PURE__ */ s(en, { align: "end", className: "w-[320px] p-3 text-[12px]", children: [
1568
+ /* @__PURE__ */ o(Ka, { align: "end", className: "w-[320px] p-3 text-[12px]", children: [
1569
1569
  /* @__PURE__ */ e("p", { className: "text-foreground", children: "This edit removes parts of the dashboard that viewers saved. Their views still open, with a note about what no longer applies." }),
1570
1570
  /* @__PURE__ */ e(
1571
1571
  "ul",
1572
1572
  {
1573
1573
  "aria-label": "Affected saved views",
1574
1574
  className: "mt-2 grid gap-1 border-t border-border/60 pt-2",
1575
- children: r.map((o) => {
1576
- const { name: d, uses: f } = ko(o);
1577
- return /* @__PURE__ */ s(
1575
+ children: r.map((s) => {
1576
+ const { name: d, uses: f } = Cs(s);
1577
+ return /* @__PURE__ */ o(
1578
1578
  "li",
1579
1579
  {
1580
1580
  className: "flex items-baseline justify-between gap-3",
@@ -1583,7 +1583,7 @@ function Co({
1583
1583
  /* @__PURE__ */ e("span", { className: "shrink-0 text-[11.5px] text-muted-foreground", children: f })
1584
1584
  ]
1585
1585
  },
1586
- `${o.target}:${o.cardId ?? ""}:${o.id}`
1586
+ `${s.target}:${s.cardId ?? ""}:${s.id}`
1587
1587
  );
1588
1588
  })
1589
1589
  }
@@ -1591,60 +1591,60 @@ function Co({
1591
1591
  ] })
1592
1592
  ] }) : null;
1593
1593
  }
1594
- function Ht(t, n) {
1594
+ function Bt(t, a) {
1595
1595
  return {
1596
- dashboard: rt(t),
1597
- semanticExecutionPayload: rt(n)
1596
+ dashboard: at(t),
1597
+ semanticExecutionPayload: at(a)
1598
1598
  };
1599
1599
  }
1600
- function es() {
1601
- var yt, wt, Nt, St, kt;
1600
+ function ao() {
1601
+ var wt, Nt, St, kt;
1602
1602
  const {
1603
1603
  authToken: t,
1604
- tokenProps: n,
1605
- id: a,
1604
+ tokenProps: a,
1605
+ id: n,
1606
1606
  showBriefings: r
1607
- } = Y(), o = da(), { isLocalDev: d, isConsoleMode: f } = ca(), {
1608
- canEditDashboard: m,
1607
+ } = J(), s = aa(), { isLocalDev: d, isConsoleMode: f } = na(), {
1608
+ canEditDashboard: h,
1609
1609
  hasInspectionUser: g,
1610
1610
  inspectionMessage: v,
1611
- isInspectionMode: h,
1611
+ isInspectionMode: m,
1612
1612
  isInspectionSurface: c
1613
- } = la(), { openBrandStudioPreview: u } = ua(), { permissions: l } = Gn(), p = ma(), { isLoading: x } = ha(), w = C((i) => i.theme), S = C((i) => i.isDownloadingPdf), b = C((i) => i.dashboard), L = C((i) => i.selectedSheetId), O = (yt = b == null ? void 0 : b.sheets) == null ? void 0 : yt.find(
1613
+ } = sa(), { openBrandStudioPreview: u } = oa(), { permissions: l } = jn(), p = ia(), { isLoading: x } = da(), w = C((i) => i.theme), S = C((i) => i.isDownloadingPdf), b = C((i) => i.dashboard), L = C((i) => i.selectedSheetId), M = (wt = b == null ? void 0 : b.sheets) == null ? void 0 : wt.find(
1614
1614
  (i) => i.id === L
1615
- ), k = yn(O), E = k ? (wt = O == null ? void 0 : O.document) == null ? void 0 : wt.page : void 0, I = C(
1615
+ ), k = Nn(M), E = k ? (Nt = M == null ? void 0 : M.document) == null ? void 0 : Nt.page : void 0, I = C(
1616
1616
  (i) => i.isDashboardEditing
1617
- ), { setDashboardTitle: J } = C((i) => i.actions), [Te, H] = N(!1), [ae, z] = N(!1), [ne, oe] = N(!1), [Ue, se] = N(!1), [Ne, X] = N(null), [ie, Se] = N(null), { registerBriefingViewer: ke } = pa();
1618
- be(
1619
- () => ke((i) => Se(i)),
1620
- [ke]
1617
+ ), { setDashboardTitle: X } = C((i) => i.actions), [$e, j] = N(!1), [ae, z] = N(!1), [ne, se] = N(!1), [Be, oe] = N(!1), [Se, Z] = N(null), [ie, ke] = N(null), { registerBriefingViewer: Ce } = ca();
1618
+ ge(
1619
+ () => Ce((i) => ke(i)),
1620
+ [Ce]
1621
1621
  );
1622
- const [Z, y] = N(!1), [B, q] = N(!1), [K, Q] = N(null), [de, W] = N([]), [ct, Ce] = N(!1), [fr, lt] = N(!1), T = C((i) => i.isVisualEditing);
1622
+ const [ee, y] = N(!1), [B, H] = N(!1), [q, K] = N(null), [de, Q] = N([]), [lt, De] = N(!1), [hr, ut] = N(!1), U = C((i) => i.isVisualEditing);
1623
1623
  Ct((i) => i.card);
1624
- const br = Oe(
1624
+ const pr = _e(
1625
1625
  (i) => i.selectedDashboard
1626
- ), gr = Oe(
1626
+ ), fr = _e(
1627
1627
  (i) => i.initialDashboard
1628
1628
  );
1629
- Oe((i) => i.selectedVisual), C((i) => i.selectedFrameId), Ct((i) => i.frame);
1630
- const ut = C(
1629
+ _e((i) => i.selectedVisual), C((i) => i.selectedFrameId), Ct((i) => i.frame);
1630
+ const mt = C(
1631
1631
  (i) => i.showDashboardJSON
1632
1632
  );
1633
1633
  C((i) => i.onSaveFunction);
1634
- const { setIsDashboardEditing: mt, setShowDashboardJSON: ht } = C(
1634
+ const { setIsDashboardEditing: ht, setShowDashboardJSON: pt, markDashboardSaved: br } = C(
1635
1635
  (i) => i.actions
1636
- ), { setInitialDashboard: pt, clearSelectedDashboard: $e } = Oe(
1636
+ ), { setInitialDashboard: ft, clearSelectedDashboard: Fe } = _e(
1637
1637
  (i) => i.actions
1638
- ), ce = !!n.orgUserId || !!(n.tenantId && n.endUserId && n.endUserEmail), { resources: De } = fa(We.DASHBOARD), { data: Be } = ba(), xr = ((Nt = Be == null ? void 0 : Be.preference) == null ? void 0 : Nt.defaultDashboardId) || null, { mutate: vr, isPending: yr } = ga(), { currentUser: wr } = nt(), Nr = xa(wr), F = br || gr, V = va({
1639
- config: n.config,
1638
+ ), ce = !!a.orgUserId || !!(a.tenantId && a.endUserId && a.endUserEmail), { resources: Ee } = la(Je.DASHBOARD), O = xn(), { currentUser: gr } = st(), xr = ua(gr), F = pr || fr, W = ma({
1639
+ config: a.config,
1640
1640
  canNavigateDashboardHub: ce,
1641
1641
  canShareDashboard: ((St = F == null ? void 0 : F.permissions) == null ? void 0 : St.canShare) === !0,
1642
- canManageGroups: Nr
1643
- }), ft = F ? {
1642
+ canManageGroups: xr
1643
+ }), bt = F ? {
1644
1644
  id: F.id,
1645
1645
  title: (b == null ? void 0 : b.title) || F.title || "Dashboard"
1646
- } : null, { handleAddNewFrame: Sr } = ya(), [Fe, Ge] = N(!1), [kr, le] = N(!1), [Ve, Ee] = N("close"), ue = wa(We.DASHBOARD), [M, me] = N(null), Cr = async (i, _) => {
1647
- if (!h) {
1646
+ } : null, { handleAddNewFrame: vr } = ha(), [Ge, Ve] = N(!1), [yr, le] = N(!1), [je, Ie] = N("close"), ue = pa(Je.DASHBOARD), [_, me] = N(null), wr = async (i, R) => {
1647
+ if (!m) {
1648
1648
  if (!(b != null && b.id)) {
1649
1649
  console.log("No dashboard ID found");
1650
1650
  return;
@@ -1652,7 +1652,7 @@ function es() {
1652
1652
  console.log("Updating dashboard title:", {
1653
1653
  dashboardId: b.id,
1654
1654
  newTitle: i,
1655
- previousTitle: _
1655
+ previousTitle: R
1656
1656
  }), ue.mutate(
1657
1657
  {
1658
1658
  resourceId: b.id,
@@ -1661,36 +1661,36 @@ function es() {
1661
1661
  {
1662
1662
  onSuccess: () => {
1663
1663
  me(
1664
- (P) => (P == null ? void 0 : P.dashboard.id) === b.id ? {
1665
- ...P,
1666
- dashboard: { ...P.dashboard, title: i }
1667
- } : P
1664
+ (T) => (T == null ? void 0 : T.dashboard.id) === b.id ? {
1665
+ ...T,
1666
+ dashboard: { ...T.dashboard, title: i }
1667
+ } : T
1668
1668
  ), D.success("Dashboard title updated");
1669
1669
  },
1670
- onError: (P) => {
1671
- console.error("Failed to update dashboard title:", P), D.error("Failed to update dashboard title");
1670
+ onError: (T) => {
1671
+ console.error("Failed to update dashboard title:", T), D.error("Failed to update dashboard title");
1672
1672
  const te = C.getState().dashboard;
1673
- (te == null ? void 0 : te.id) === b.id && te.title === i && J(_);
1673
+ (te == null ? void 0 : te.id) === b.id && te.title === i && X(R);
1674
1674
  }
1675
1675
  }
1676
1676
  );
1677
1677
  }
1678
1678
  };
1679
- be(() => {
1680
- if (De && De.length > 0) {
1679
+ ge(() => {
1680
+ if (Ee && Ee.length > 0) {
1681
1681
  const i = b == null ? void 0 : b.id;
1682
1682
  if (i) {
1683
- const _ = De.find(
1684
- (P) => P.id === i
1683
+ const R = Ee.find(
1684
+ (T) => T.id === i
1685
1685
  );
1686
- _ && pt(_);
1686
+ R && ft(R);
1687
1687
  }
1688
1688
  }
1689
- }, [De, b == null ? void 0 : b.id, pt]);
1690
- const Dr = n.orgUserId || n.tenantId, je = j(
1691
- () => Do({
1689
+ }, [Ee, b == null ? void 0 : b.id, ft]);
1690
+ const Nr = a.orgUserId || a.tenantId, ze = V(
1691
+ () => As({
1692
1692
  accessToken: t == null ? void 0 : t.accessToken,
1693
- dashboardId: (b == null ? void 0 : b.id) || a || n.dashboard_id,
1693
+ dashboardId: (b == null ? void 0 : b.id) || n || a.dashboard_id,
1694
1694
  selectedSheetId: k ? L : void 0,
1695
1695
  pageSize: E == null ? void 0 : E.size,
1696
1696
  orientation: E == null ? void 0 : E.orientation,
@@ -1698,158 +1698,158 @@ function es() {
1698
1698
  }),
1699
1699
  [
1700
1700
  t == null ? void 0 : t.accessToken,
1701
- a,
1701
+ n,
1702
1702
  b == null ? void 0 : b.id,
1703
1703
  k,
1704
1704
  E == null ? void 0 : E.orientation,
1705
1705
  E == null ? void 0 : E.size,
1706
1706
  L,
1707
1707
  w,
1708
- n.dashboard_id
1708
+ a.dashboard_id
1709
1709
  ]
1710
- ), He = I && !T && !h && Dr && m, { setDashboard: ze } = C((i) => i.actions), Er = C(
1710
+ ), He = I && !U && !m && Nr && h, { setDashboard: qe } = C((i) => i.actions), Sr = C(
1711
1711
  (i) => i.semanticExecutionPayload
1712
- ), Ir = () => {
1713
- mt(!0);
1714
- }, Ie = () => {
1715
- mt(!1), ht(!1), me(null);
1712
+ ), kr = () => {
1713
+ ht(!0);
1714
+ }, Ae = () => {
1715
+ ht(!1), pt(!1), me(null);
1716
1716
  };
1717
- be(() => {
1717
+ ge(() => {
1718
1718
  if (!I) {
1719
- M && me(null);
1719
+ _ && me(null);
1720
1720
  return;
1721
1721
  }
1722
- if (M || !b || x)
1722
+ if (_ || !b || x)
1723
1723
  return;
1724
- const i = Na(C.getState());
1724
+ const i = fa(C.getState());
1725
1725
  me(
1726
- Ht(i.dashboard, i.semanticExecutionPayload)
1726
+ Bt(i.dashboard, i.semanticExecutionPayload)
1727
1727
  );
1728
1728
  }, [
1729
1729
  b,
1730
- M,
1730
+ _,
1731
1731
  I,
1732
1732
  x,
1733
- Er
1733
+ Sr
1734
1734
  ]);
1735
- const qe = (M == null ? void 0 : M.dashboard) ?? null, { isDirty: Ke, isDirtyPending: Ar, resetDirty: he } = Dn(
1735
+ const Ke = (_ == null ? void 0 : _.dashboard) ?? null, { isDirty: Qe, isDirtyPending: Cr, resetDirty: he } = In(
1736
1736
  b,
1737
- qe,
1737
+ Ke,
1738
1738
  300,
1739
1739
  1e3,
1740
- En
1741
- ), bt = nn(
1742
- qe,
1743
- h,
1744
- m
1745
- ), gt = Ke || Ar, Ae = Fe || ue.isPending, Lr = () => {
1746
- if (h) {
1747
- M && ze(M.dashboard, {
1748
- semanticExecutionPayload: M.semanticExecutionPayload
1749
- }), Ie(), he();
1740
+ An
1741
+ ), gt = tn(
1742
+ Ke,
1743
+ m,
1744
+ h
1745
+ ), xt = Qe || Cr, Oe = Ge || ue.isPending, Dr = () => {
1746
+ if (m) {
1747
+ _ && qe(_.dashboard, {
1748
+ semanticExecutionPayload: _.semanticExecutionPayload
1749
+ }), Ae(), he();
1750
1750
  return;
1751
1751
  }
1752
- bt() ? (Ee("close"), le(!0)) : (Ie(), he());
1753
- }, Or = async () => {
1754
- await Qe({
1752
+ gt() ? (Ie("close"), le(!0)) : (Ae(), he());
1753
+ }, Er = async () => {
1754
+ await We({
1755
1755
  closeAfterSave: !0,
1756
- navigateHomeAfterSave: Ve === "home"
1756
+ navigateHomeAfterSave: je === "home"
1757
1757
  });
1758
- }, Mr = () => {
1759
- const i = Ve === "home" && !!ce;
1760
- M && ze(M.dashboard, {
1761
- semanticExecutionPayload: M.semanticExecutionPayload
1762
- }), Ie(), i && $e(), Ee("close"), le(!1), he();
1763
- }, Pr = () => {
1764
- M && (ze(M.dashboard, {
1765
- semanticExecutionPayload: M.semanticExecutionPayload
1758
+ }, Ir = () => {
1759
+ const i = je === "home" && !!ce;
1760
+ _ && qe(_.dashboard, {
1761
+ semanticExecutionPayload: _.semanticExecutionPayload
1762
+ }), Ae(), i && Fe(), Ie("close"), le(!1), he();
1763
+ }, Ar = () => {
1764
+ _ && (qe(_.dashboard, {
1765
+ semanticExecutionPayload: _.semanticExecutionPayload
1766
1766
  }), he());
1767
- }, _r = () => {
1767
+ }, Or = () => {
1768
1768
  if (ce) {
1769
- if (I && bt()) {
1770
- Ee("home"), le(!0);
1769
+ if (I && gt()) {
1770
+ Ie("home"), le(!0);
1771
1771
  return;
1772
1772
  }
1773
- $e();
1773
+ Fe();
1774
1774
  }
1775
1775
  };
1776
- async function Qe(i) {
1777
- if (h)
1776
+ async function We(i) {
1777
+ if (m)
1778
1778
  return;
1779
- const _ = C.getState().dashboard;
1780
- if (!_)
1779
+ const R = C.getState().dashboard;
1780
+ if (!R)
1781
1781
  return;
1782
- const P = (i == null ? void 0 : i.closeAfterSave) ?? ct, te = (i == null ? void 0 : i.navigateHomeAfterSave) ?? !1;
1783
- Ce(P), P && le(!1);
1784
- const Br = rt(_);
1785
- q(!0), Q(null), W([]), Ge(!0);
1786
- const Fr = {
1787
- template: _
1782
+ const T = (i == null ? void 0 : i.closeAfterSave) ?? lt, te = (i == null ? void 0 : i.navigateHomeAfterSave) ?? !1;
1783
+ De(T), T && le(!1);
1784
+ const Pr = at(R);
1785
+ H(!0), K(null), Q([]), Ve(!0);
1786
+ const Tr = {
1787
+ template: R
1788
1788
  };
1789
1789
  ue.mutate(
1790
1790
  {
1791
- resourceId: _.id,
1792
- data: Fr
1791
+ resourceId: R.id,
1792
+ data: Tr
1793
1793
  },
1794
1794
  {
1795
1795
  onSuccess: () => {
1796
- Ge(!1), D.success("Dashboard saved!"), me(
1797
- Ht(
1798
- Br,
1796
+ Ve(!1), br(), D.success("Dashboard saved!"), me(
1797
+ Bt(
1798
+ Pr,
1799
1799
  C.getState().semanticExecutionPayload
1800
1800
  )
1801
- ), q(!1), Ce(!1), P && (Ie(), he(), te && ce && $e()), Ee("close");
1801
+ ), H(!1), De(!1), T && (Ae(), he(), te && ce && Fe()), Ie("close");
1802
1802
  },
1803
- onError: (Gr) => {
1804
- Ge(!1), Q("Failed to save dashboard. Please try again.");
1805
- const Le = Gr.details, Vr = Array.isArray(
1806
- Le == null ? void 0 : Le.errors
1807
- ) ? (Le.errors || []).filter(
1808
- (jr) => typeof jr == "string"
1803
+ onError: (Rr) => {
1804
+ Ve(!1), K("Failed to save dashboard. Please try again.");
1805
+ const Me = Rr.details, Ur = Array.isArray(
1806
+ Me == null ? void 0 : Me.errors
1807
+ ) ? (Me.errors || []).filter(
1808
+ ($r) => typeof $r == "string"
1809
1809
  ) : [];
1810
- W(
1811
- xo({
1812
- errors: Vr,
1813
- dashboard: _ || void 0
1810
+ Q(
1811
+ vs({
1812
+ errors: Ur,
1813
+ dashboard: R || void 0
1814
1814
  })
1815
1815
  ), D.error("Failed to save dashboard");
1816
1816
  }
1817
1817
  }
1818
1818
  );
1819
1819
  }
1820
- const xt = b.title;
1820
+ const vt = b.title;
1821
1821
  ue.isPending && console.log("Title during update:", {
1822
- title: xt,
1822
+ title: vt,
1823
1823
  dashboardStateTitle: b.title,
1824
1824
  dashboardId: b == null ? void 0 : b.id
1825
1825
  });
1826
- const Rr = ce && !!(t != null && t.accessToken) && !!(n != null && n.apiServiceUrl), Tr = !h && V.showDashboardHub && Rr, Ur = !h && p && V.showDashboardHub, G = (b == null ? void 0 : b.id) || null, vt = Sa(
1827
- (kt = n.config) == null ? void 0 : kt.showBriefings,
1826
+ const Lr = ce && !!(t != null && t.accessToken) && !!(a != null && a.apiServiceUrl), Mr = !m && W.showDashboardHub && Lr, _r = !m && p && W.showDashboardHub, Y = (b == null ? void 0 : b.id) || null, yt = ba(
1827
+ (kt = a.config) == null ? void 0 : kt.showBriefings,
1828
1828
  r
1829
- ), ee = !!G && xr === G, $r = () => {
1830
- !G || h || vr({
1831
- dashboardId: ee ? null : G
1832
- });
1833
- };
1834
- return !p && !T ? null : /* @__PURE__ */ s(
1829
+ ), Le = rn(Y);
1830
+ if (!p && !U)
1831
+ return null;
1832
+ const Ye = !U && p && !m;
1833
+ return /* @__PURE__ */ e(an, { width: O.width, hasOverflowMenu: Ye, children: /* @__PURE__ */ o(
1835
1834
  "div",
1836
1835
  {
1837
- className: "flex min-h-11 shrink-0 items-center justify-between gap-2 overflow-x-auto border-b px-4 py-1.5",
1836
+ ref: O.measure,
1837
+ className: "flex min-h-11 shrink-0 items-center gap-2 border-b px-3 py-1.5",
1838
1838
  role: "dashboard-controls",
1839
1839
  children: [
1840
- /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
1841
- Ur && !T && /* @__PURE__ */ e(
1842
- bn,
1840
+ /* @__PURE__ */ o("div", { className: "flex min-w-[80px] flex-1 items-center gap-2", children: [
1841
+ _r && !U && /* @__PURE__ */ e(
1842
+ gn,
1843
1843
  {
1844
1844
  "aria-label": "Dashboard Hub",
1845
1845
  tooltip: "Dashboard Hub",
1846
- onClick: _r,
1846
+ onClick: Or,
1847
1847
  className: "h-7 w-7 px-0",
1848
1848
  buttonProps: { size: "xs" },
1849
- children: /* @__PURE__ */ e(ka, { className: "h-3.5 w-3.5" })
1849
+ children: /* @__PURE__ */ e(ga, { className: "h-3.5 w-3.5" })
1850
1850
  }
1851
1851
  ),
1852
- !T && p && (x ? /* @__PURE__ */ e(
1852
+ !U && p && (x ? /* @__PURE__ */ e(
1853
1853
  "div",
1854
1854
  {
1855
1855
  className: "h-4 w-28 animate-pulse rounded-md bg-muted/70",
@@ -1857,23 +1857,23 @@ function es() {
1857
1857
  role: "status",
1858
1858
  children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Loading dashboard title" })
1859
1859
  }
1860
- ) : /* @__PURE__ */ s($, { children: [
1860
+ ) : /* @__PURE__ */ o("div", { className: "flex min-w-0 items-center gap-1", children: [
1861
1861
  /* @__PURE__ */ e(
1862
- Ca,
1862
+ xa,
1863
1863
  {
1864
- value: xt || "Untitled Dashboard",
1864
+ value: vt || "Untitled Dashboard",
1865
1865
  onSave: (i) => {
1866
1866
  console.log("EditableText onSave called:", {
1867
1867
  newTitle: i,
1868
- canEditDashboard: m,
1868
+ canEditDashboard: h,
1869
1869
  dashboardId: b == null ? void 0 : b.id
1870
1870
  });
1871
- const _ = (b == null ? void 0 : b.title) || "";
1872
- J(i), Cr(i, _);
1871
+ const R = (b == null ? void 0 : b.title) || "";
1872
+ X(i), wr(i, R);
1873
1873
  },
1874
- isEditable: Da({
1874
+ isEditable: va({
1875
1875
  isDashboardEditing: I,
1876
- canEditDashboard: m === !0 && !h
1876
+ canEditDashboard: h === !0 && !m
1877
1877
  }),
1878
1878
  displayClassName: "text-[13px] font-medium",
1879
1879
  inputClassName: "text-[13px] font-medium",
@@ -1881,228 +1881,241 @@ function es() {
1881
1881
  isPending: ue.isPending
1882
1882
  }
1883
1883
  ),
1884
- V.showDashboardHub && ee && /* @__PURE__ */ e(
1885
- "span",
1886
- {
1887
- className: "shrink-0 rounded-[4px] border border-border/60 px-1.5 py-px text-[10px] font-medium uppercase tracking-[0.06em] text-muted-foreground",
1888
- title: "Default dashboard",
1889
- children: "Default"
1890
- }
1891
- ),
1892
- Tr && G && /* @__PURE__ */ e(Ot, { children: /* @__PURE__ */ s(Mt, { children: [
1893
- /* @__PURE__ */ e(Pt, { asChild: !0, children: /* @__PURE__ */ e(
1894
- U,
1895
- {
1896
- variant: "ghost",
1897
- size: "xs",
1898
- onClick: $r,
1899
- disabled: yr || !(t != null && t.accessToken) || !(n != null && n.apiServiceUrl),
1900
- className: ge(
1901
- "w-7 px-0",
1902
- ee ? "bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary focus-visible:bg-primary/15" : "text-muted-foreground hover:text-foreground"
1903
- ),
1904
- "aria-pressed": ee,
1905
- "aria-label": ee ? "Remove as default dashboard" : "Set as default dashboard",
1906
- children: /* @__PURE__ */ e(Ea, { className: "h-3.5 w-3.5" })
1907
- }
1908
- ) }),
1909
- /* @__PURE__ */ e(_t, { children: /* @__PURE__ */ e("p", { children: ee ? "Remove as default dashboard" : "Set as default dashboard" }) })
1910
- ] }) })
1884
+ !m && Y && /* @__PURE__ */ e(nn, { dashboardId: Y })
1911
1885
  ] }))
1912
1886
  ] }),
1913
- /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
1914
- T && /* @__PURE__ */ s($, { children: [
1915
- /* @__PURE__ */ e(on, {}),
1916
- /* @__PURE__ */ e(sn, {})
1917
- ] }),
1918
- p && !h && /* @__PURE__ */ e(gn, {}),
1919
- !T && I && !h && l.canUseFilters && p && /* @__PURE__ */ e(dn, {}),
1920
- I && !T && !h && p && !k && /* @__PURE__ */ s("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
1921
- /* @__PURE__ */ s(
1922
- U,
1923
- {
1924
- variant: "ghost",
1925
- size: "xs",
1926
- disabled: !I,
1927
- onClick: () => void Sr(),
1928
- className: "h-full rounded-none border-0 shadow-none hover:bg-accent",
1929
- children: [
1930
- /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
1931
- "Visual"
1932
- ]
1933
- }
1934
- ),
1935
- /* @__PURE__ */ s(Dt, { modal: !1, children: [
1936
- /* @__PURE__ */ e(Et, { asChild: !0, children: /* @__PURE__ */ e(
1937
- U,
1887
+ /* @__PURE__ */ o("div", { className: "flex min-w-0 items-center gap-1.5", children: [
1888
+ /* @__PURE__ */ o("div", { className: "-m-1 flex min-w-0 items-center gap-1.5 overflow-x-auto p-1 [scrollbar-width:thin] [&>*]:shrink-0", children: [
1889
+ U && /* @__PURE__ */ o($, { children: [
1890
+ /* @__PURE__ */ e(sn, {}),
1891
+ /* @__PURE__ */ e(on, {})
1892
+ ] }),
1893
+ p && !m && /* @__PURE__ */ e(vn, {}),
1894
+ !U && I && !m && l.canUseFilters && p && /* @__PURE__ */ e(dn, {}),
1895
+ I && !U && !m && p && !k && /* @__PURE__ */ o("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
1896
+ /* @__PURE__ */ o(
1897
+ G,
1938
1898
  {
1939
1899
  variant: "ghost",
1940
1900
  size: "xs",
1941
- className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
1942
- "aria-label": "Open visual options",
1943
1901
  disabled: !I,
1944
- children: /* @__PURE__ */ e(rn, { className: "h-3.5 w-3.5" })
1902
+ onClick: () => void vr(),
1903
+ "aria-label": O.width === "sm" ? "Add visual" : void 0,
1904
+ title: O.width === "sm" ? "Add visual" : void 0,
1905
+ className: xe(
1906
+ "h-full rounded-none border-0 shadow-none hover:bg-accent",
1907
+ O.width === "sm" && "w-7 px-0"
1908
+ ),
1909
+ children: [
1910
+ /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
1911
+ O.width !== "sm" && "Visual"
1912
+ ]
1945
1913
  }
1946
- ) }),
1914
+ ),
1915
+ /* @__PURE__ */ o(Dt, { modal: !1, children: [
1916
+ /* @__PURE__ */ e(Ht, { asChild: !0, children: /* @__PURE__ */ e(
1917
+ G,
1918
+ {
1919
+ variant: "ghost",
1920
+ size: "xs",
1921
+ className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
1922
+ "aria-label": "Open visual options",
1923
+ disabled: !I,
1924
+ children: /* @__PURE__ */ e(Za, { className: "h-3.5 w-3.5" })
1925
+ }
1926
+ ) }),
1927
+ /* @__PURE__ */ e(
1928
+ Et,
1929
+ {
1930
+ align: "end",
1931
+ className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm",
1932
+ children: /* @__PURE__ */ o(P, { onClick: () => ut(!0), children: [
1933
+ /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
1934
+ "From library..."
1935
+ ] })
1936
+ }
1937
+ )
1938
+ ] }),
1947
1939
  /* @__PURE__ */ e(
1948
- It,
1940
+ cn,
1949
1941
  {
1950
- align: "end",
1951
- className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm",
1952
- children: /* @__PURE__ */ s(R, { onClick: () => lt(!0), children: [
1953
- /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
1954
- "From library..."
1955
- ] })
1942
+ open: hr,
1943
+ onOpenChange: ut
1956
1944
  }
1957
1945
  )
1958
1946
  ] }),
1959
- /* @__PURE__ */ e(
1960
- cn,
1947
+ !m && p && /* @__PURE__ */ e(ln, {}),
1948
+ !U && !I && (h || m) && (!c || !g || h !== void 0) && p && /* @__PURE__ */ o("div", { className: "inline-flex items-center gap-1", children: [
1949
+ /* @__PURE__ */ o(
1950
+ G,
1951
+ {
1952
+ size: "xs",
1953
+ onClick: kr,
1954
+ "aria-label": m ? "Inspect" : "Edit",
1955
+ title: O.width === "sm" ? m ? "Inspect" : "Edit" : void 0,
1956
+ className: O.width === "sm" ? "w-7 px-0" : void 0,
1957
+ children: [
1958
+ /* @__PURE__ */ e(ya, { className: "h-3.5 w-3.5" }),
1959
+ O.width !== "sm" && (m ? "Inspect" : "Edit")
1960
+ ]
1961
+ }
1962
+ ),
1963
+ v ? /* @__PURE__ */ e(Qa, { children: /* @__PURE__ */ o(Wa, { children: [
1964
+ /* @__PURE__ */ e(Ya, { asChild: !0, children: /* @__PURE__ */ e(
1965
+ "button",
1966
+ {
1967
+ type: "button",
1968
+ "aria-label": v,
1969
+ className: "inline-flex size-6 items-center justify-center rounded-control text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
1970
+ children: /* @__PURE__ */ e(Ja, { "aria-hidden": "true", className: "size-3.5" })
1971
+ }
1972
+ ) }),
1973
+ /* @__PURE__ */ e(Xa, { children: /* @__PURE__ */ e("p", { children: v }) })
1974
+ ] }) }) : null
1975
+ ] }),
1976
+ He && p && Qe && /* @__PURE__ */ e(
1977
+ Ds,
1978
+ {
1979
+ saved: Ke,
1980
+ draft: b,
1981
+ enabled: I && !m
1982
+ }
1983
+ ),
1984
+ He && p && Qe && /* @__PURE__ */ o(
1985
+ G,
1986
+ {
1987
+ variant: "outline",
1988
+ size: "xs",
1989
+ onClick: Ar,
1990
+ disabled: Oe,
1991
+ "aria-label": "Undo",
1992
+ title: O.width === "sm" ? "Undo" : void 0,
1993
+ className: O.width === "sm" ? "w-7 px-0" : void 0,
1994
+ children: [
1995
+ /* @__PURE__ */ e(wa, { className: "h-3.5 w-3.5" }),
1996
+ O.width !== "sm" && "Undo"
1997
+ ]
1998
+ }
1999
+ ),
2000
+ He && p && /* @__PURE__ */ o(
2001
+ G,
1961
2002
  {
1962
- open: fr,
1963
- onOpenChange: lt
2003
+ size: "xs",
2004
+ className: xe(!xt && "opacity-60"),
2005
+ disabled: Oe || !xt,
2006
+ onClick: () => We(),
2007
+ children: [
2008
+ Oe ? /* @__PURE__ */ e(Re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Mn, { className: "h-3.5 w-3.5" }),
2009
+ Oe ? "Saving..." : "Save"
2010
+ ]
2011
+ }
2012
+ ),
2013
+ I && !U && p && /* @__PURE__ */ o(
2014
+ G,
2015
+ {
2016
+ variant: "outline",
2017
+ size: "xs",
2018
+ onClick: Dr,
2019
+ "aria-label": "Close",
2020
+ title: O.width === "sm" ? "Close" : void 0,
2021
+ className: O.width === "sm" ? "w-7 px-0" : void 0,
2022
+ children: [
2023
+ /* @__PURE__ */ e(Na, { className: "h-3.5 w-3.5" }),
2024
+ O.width !== "sm" && "Close"
2025
+ ]
1964
2026
  }
1965
2027
  )
1966
2028
  ] }),
1967
- !h && p && /* @__PURE__ */ e(ln, {}),
1968
- !T && !I && (m || h) && (!c || !g || m !== void 0) && p && /* @__PURE__ */ s("div", { className: "inline-flex items-center gap-1", children: [
1969
- /* @__PURE__ */ s(U, { size: "xs", onClick: Ir, children: [
1970
- /* @__PURE__ */ e(Ia, { className: "h-3.5 w-3.5" }),
1971
- h ? "Inspect" : "Edit"
1972
- ] }),
1973
- v ? /* @__PURE__ */ e(Ot, { children: /* @__PURE__ */ s(Mt, { children: [
1974
- /* @__PURE__ */ e(Pt, { asChild: !0, children: /* @__PURE__ */ e(
1975
- "button",
1976
- {
1977
- type: "button",
1978
- "aria-label": v,
1979
- className: "inline-flex size-6 items-center justify-center rounded-control text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
1980
- children: /* @__PURE__ */ e(tn, { "aria-hidden": "true", className: "size-3.5" })
1981
- }
1982
- ) }),
1983
- /* @__PURE__ */ e(_t, { children: /* @__PURE__ */ e("p", { children: v }) })
1984
- ] }) }) : null
1985
- ] }),
1986
- He && p && Ke && /* @__PURE__ */ e(
1987
- Co,
1988
- {
1989
- saved: qe,
1990
- draft: b,
1991
- enabled: I && !h
1992
- }
1993
- ),
1994
- He && p && Ke && /* @__PURE__ */ s(
1995
- U,
1996
- {
1997
- variant: "outline",
1998
- size: "xs",
1999
- onClick: Pr,
2000
- disabled: Ae,
2001
- children: [
2002
- /* @__PURE__ */ e(Aa, { className: "h-3.5 w-3.5" }),
2003
- "Undo"
2004
- ]
2005
- }
2006
- ),
2007
- He && p && /* @__PURE__ */ s(
2008
- U,
2009
- {
2010
- size: "xs",
2011
- className: ge(!gt && "opacity-60"),
2012
- disabled: Ae || !gt,
2013
- onClick: () => Qe(),
2014
- children: [
2015
- Ae ? /* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Ln, { className: "h-3.5 w-3.5" }),
2016
- Ae ? "Saving..." : "Save"
2017
- ]
2018
- }
2019
- ),
2020
- I && !T && p && /* @__PURE__ */ s(U, { variant: "outline", size: "xs", onClick: Lr, children: [
2021
- /* @__PURE__ */ e(La, { className: "h-3.5 w-3.5" }),
2022
- "Close"
2023
- ] }),
2024
- !T && p && /* @__PURE__ */ s("div", { className: "ml-2 flex items-center", children: [
2029
+ !U && p && /* @__PURE__ */ o($, { children: [
2025
2030
  /* @__PURE__ */ e(un, {}),
2026
- f && m === !0 && !h && /* @__PURE__ */ e(mn, {})
2031
+ f && h === !0 && !m && /* @__PURE__ */ e(mn, {})
2027
2032
  ] }),
2028
- !T && d && /* @__PURE__ */ e(Fn, {}),
2029
- !T && p && !h && /* @__PURE__ */ s(Dt, { children: [
2030
- /* @__PURE__ */ e(Et, { asChild: !0, children: /* @__PURE__ */ e(
2031
- U,
2032
- {
2033
- variant: "ghost",
2034
- size: "xs",
2035
- className: "w-7 px-0 text-muted-foreground hover:text-foreground",
2036
- "aria-label": "More dashboard options",
2037
- children: /* @__PURE__ */ e(Oa, { className: "h-3.5 w-3.5" })
2038
- }
2039
- ) }),
2040
- /* @__PURE__ */ s(
2041
- It,
2033
+ !U && d && O.width === "lg" && /* @__PURE__ */ e(Vn, {}),
2034
+ Ye && /* @__PURE__ */ e(hn, {}),
2035
+ Ye && /* @__PURE__ */ o(Dt, { children: [
2036
+ /* @__PURE__ */ e(Es, {}),
2037
+ /* @__PURE__ */ o(
2038
+ Et,
2042
2039
  {
2043
2040
  align: "end",
2044
2041
  className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
2045
2042
  children: [
2046
- /* @__PURE__ */ e(Me, { children: "Reports & briefings" }),
2047
- /* @__PURE__ */ s(
2048
- R,
2043
+ /* @__PURE__ */ e(Is, {}),
2044
+ Le.available && Mr && /* @__PURE__ */ o($, { children: [
2045
+ /* @__PURE__ */ o(
2046
+ P,
2047
+ {
2048
+ disabled: Le.disabled,
2049
+ onSelect: Le.toggle,
2050
+ children: [
2051
+ /* @__PURE__ */ e(Sa, { className: "h-3.5 w-3.5" }),
2052
+ /* @__PURE__ */ e("span", { className: "flex-1", children: "Default dashboard" }),
2053
+ Le.isDefault && /* @__PURE__ */ e(qt, { className: "h-3.5 w-3.5" })
2054
+ ]
2055
+ }
2056
+ ),
2057
+ /* @__PURE__ */ e(be, {})
2058
+ ] }),
2059
+ /* @__PURE__ */ e(Pe, { children: "Reports & briefings" }),
2060
+ /* @__PURE__ */ o(
2061
+ P,
2049
2062
  {
2050
2063
  disabled: S,
2051
2064
  onSelect: () => y(!0),
2052
2065
  children: [
2053
- /* @__PURE__ */ e(Ma, { className: "h-3.5 w-3.5" }),
2066
+ /* @__PURE__ */ e(ka, { className: "h-3.5 w-3.5" }),
2054
2067
  "Export"
2055
2068
  ]
2056
2069
  }
2057
2070
  ),
2058
2071
  /* @__PURE__ */ e(
2059
- yo,
2072
+ ws,
2060
2073
  {
2061
- scheduleReportVisible: !!(vt && o.surfaceVisible && G && !I),
2062
- analyticalBriefingVisible: !!(vt && o.surfaceVisible && G && !I),
2063
- onScheduleReport: () => X("scheduled_report"),
2064
- onCreateAnalyticalBriefing: () => X("analytical_briefing")
2074
+ scheduleReportVisible: !!(yt && s.surfaceVisible && Y && !I),
2075
+ analyticalBriefingVisible: !!(yt && s.surfaceVisible && Y && !I),
2076
+ onScheduleReport: () => Z("scheduled_report"),
2077
+ onCreateAnalyticalBriefing: () => Z("analytical_briefing")
2065
2078
  }
2066
2079
  ),
2067
- I && /* @__PURE__ */ s(
2068
- R,
2080
+ I && /* @__PURE__ */ o(
2081
+ P,
2069
2082
  {
2070
- onSelect: () => se(!0),
2083
+ onSelect: () => oe(!0),
2071
2084
  children: [
2072
- /* @__PURE__ */ e(Pa, { className: "h-3.5 w-3.5" }),
2085
+ /* @__PURE__ */ e(Ca, { className: "h-3.5 w-3.5" }),
2073
2086
  "Download settings"
2074
2087
  ]
2075
2088
  }
2076
2089
  ),
2077
- /* @__PURE__ */ e(Ye, {}),
2078
- (V.showDashboardSharing || V.showGroupManagement) && /* @__PURE__ */ s($, { children: [
2079
- /* @__PURE__ */ e(Me, { children: "Access" }),
2080
- V.showDashboardSharing && /* @__PURE__ */ s(R, { onSelect: () => H(!0), children: [
2081
- /* @__PURE__ */ e(_a, { className: "h-3.5 w-3.5" }),
2090
+ /* @__PURE__ */ e(be, {}),
2091
+ (W.showDashboardSharing || W.showGroupManagement) && /* @__PURE__ */ o($, { children: [
2092
+ /* @__PURE__ */ e(Pe, { children: "Access" }),
2093
+ W.showDashboardSharing && /* @__PURE__ */ o(P, { onSelect: () => j(!0), children: [
2094
+ /* @__PURE__ */ e(Da, { className: "h-3.5 w-3.5" }),
2082
2095
  "Share"
2083
2096
  ] }),
2084
- V.showGroupManagement && /* @__PURE__ */ s(
2085
- R,
2097
+ W.showGroupManagement && /* @__PURE__ */ o(
2098
+ P,
2086
2099
  {
2087
2100
  onClick: () => z(!0),
2088
2101
  children: [
2089
- /* @__PURE__ */ e(Qt, { className: "h-3.5 w-3.5" }),
2102
+ /* @__PURE__ */ e(jt, { className: "h-3.5 w-3.5" }),
2090
2103
  "Manage Groups"
2091
2104
  ]
2092
2105
  }
2093
2106
  ),
2094
- /* @__PURE__ */ e(Ye, {})
2107
+ /* @__PURE__ */ e(be, {})
2095
2108
  ] }),
2096
- /* @__PURE__ */ e(Me, { children: "Preferences" }),
2097
- /* @__PURE__ */ s(R, { onClick: () => oe(!0), children: [
2098
- /* @__PURE__ */ e(Wt, { className: "h-3.5 w-3.5" }),
2109
+ /* @__PURE__ */ e(Pe, { children: "Preferences" }),
2110
+ /* @__PURE__ */ o(P, { onClick: () => se(!0), children: [
2111
+ /* @__PURE__ */ e(zt, { className: "h-3.5 w-3.5" }),
2099
2112
  "Report preferences"
2100
2113
  ] }),
2101
- d && p && /* @__PURE__ */ s($, { children: [
2102
- /* @__PURE__ */ e(Ye, {}),
2103
- /* @__PURE__ */ e(Me, { children: "Developer" }),
2104
- /* @__PURE__ */ s(
2105
- R,
2114
+ d && p && /* @__PURE__ */ o($, { children: [
2115
+ /* @__PURE__ */ e(be, {}),
2116
+ /* @__PURE__ */ e(Pe, { children: "Developer" }),
2117
+ /* @__PURE__ */ o(
2118
+ P,
2106
2119
  {
2107
2120
  onSelect: () => {
2108
2121
  var i;
@@ -2111,24 +2124,24 @@ function es() {
2111
2124
  ).catch(() => D.error("Unable to copy token")) : D.error("Clipboard not available"));
2112
2125
  },
2113
2126
  children: [
2114
- /* @__PURE__ */ e(At, { className: "h-3.5 w-3.5" }),
2127
+ /* @__PURE__ */ e(It, { className: "h-3.5 w-3.5" }),
2115
2128
  "Copy token"
2116
2129
  ]
2117
2130
  }
2118
2131
  ),
2119
- k && /* @__PURE__ */ s(
2120
- R,
2132
+ k && /* @__PURE__ */ o(
2133
+ P,
2121
2134
  {
2122
- disabled: !je,
2135
+ disabled: !ze,
2123
2136
  onSelect: () => {
2124
2137
  var i;
2125
- if (!je) {
2138
+ if (!ze) {
2126
2139
  D.error(
2127
2140
  "Open a document sheet with a token to copy the local PDF URL"
2128
2141
  );
2129
2142
  return;
2130
2143
  }
2131
- (i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(je).then(
2144
+ (i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(ze).then(
2132
2145
  () => D.success(
2133
2146
  "Local document PDF URL copied to clipboard"
2134
2147
  )
@@ -2139,32 +2152,32 @@ function es() {
2139
2152
  ) : D.error("Clipboard not available");
2140
2153
  },
2141
2154
  children: [
2142
- /* @__PURE__ */ e(At, { className: "h-3.5 w-3.5" }),
2155
+ /* @__PURE__ */ e(It, { className: "h-3.5 w-3.5" }),
2143
2156
  "Copy local document PDF URL"
2144
2157
  ]
2145
2158
  }
2146
2159
  ),
2147
- /* @__PURE__ */ s(
2148
- R,
2160
+ /* @__PURE__ */ o(
2161
+ P,
2149
2162
  {
2150
- onSelect: () => hn(n.apiServiceUrl),
2163
+ onSelect: () => pn(a.apiServiceUrl),
2151
2164
  children: [
2152
- /* @__PURE__ */ e(_n, { className: "h-3.5 w-3.5" }),
2165
+ /* @__PURE__ */ e(Rn, { className: "h-3.5 w-3.5" }),
2153
2166
  "Invalidate token"
2154
2167
  ]
2155
2168
  }
2156
2169
  ),
2157
- /* @__PURE__ */ s(R, { onSelect: u, children: [
2158
- /* @__PURE__ */ e(On, { className: "h-3.5 w-3.5" }),
2170
+ /* @__PURE__ */ o(P, { onSelect: u, children: [
2171
+ /* @__PURE__ */ e(_n, { className: "h-3.5 w-3.5" }),
2159
2172
  "Brand Studio"
2160
2173
  ] }),
2161
- I && /* @__PURE__ */ s(
2162
- R,
2174
+ I && /* @__PURE__ */ o(
2175
+ P,
2163
2176
  {
2164
- onSelect: () => ht(!ut),
2177
+ onSelect: () => pt(!mt),
2165
2178
  children: [
2166
- /* @__PURE__ */ e(Mn, { className: "h-3.5 w-3.5" }),
2167
- ut ? "Hide dashboard JSON" : "Show dashboard JSON"
2179
+ /* @__PURE__ */ e(Pn, { className: "h-3.5 w-3.5" }),
2180
+ mt ? "Hide dashboard JSON" : "Show dashboard JSON"
2168
2181
  ]
2169
2182
  }
2170
2183
  )
@@ -2173,111 +2186,111 @@ function es() {
2173
2186
  }
2174
2187
  )
2175
2188
  ] }),
2176
- Te && ft && /* @__PURE__ */ e(
2177
- Ra,
2189
+ $e && bt && /* @__PURE__ */ e(
2190
+ Ea,
2178
2191
  {
2179
- resource: ft,
2180
- resourceType: We.DASHBOARD,
2181
- onClose: () => H(!1)
2192
+ resource: bt,
2193
+ resourceType: Je.DASHBOARD,
2194
+ onClose: () => j(!1)
2182
2195
  }
2183
2196
  ),
2184
- V.showGroupManagement && /* @__PURE__ */ e(
2185
- co,
2197
+ W.showGroupManagement && /* @__PURE__ */ e(
2198
+ ls,
2186
2199
  {
2187
2200
  open: ae,
2188
2201
  onOpenChange: z
2189
2202
  }
2190
2203
  ),
2191
2204
  /* @__PURE__ */ e(
2192
- xn,
2205
+ yn,
2193
2206
  {
2194
2207
  open: ne,
2195
- onOpenChange: oe
2208
+ onOpenChange: se
2196
2209
  }
2197
2210
  ),
2198
2211
  /* @__PURE__ */ e(
2199
- go,
2212
+ xs,
2200
2213
  {
2201
- open: Ue,
2202
- onOpenChange: se
2214
+ open: Be,
2215
+ onOpenChange: oe
2203
2216
  }
2204
2217
  ),
2205
- G && (Ne || ie) ? /* @__PURE__ */ e(
2206
- pn,
2218
+ Y && (Se || ie) ? /* @__PURE__ */ e(
2219
+ fn,
2207
2220
  {
2208
- dashboardId: G,
2221
+ dashboardId: Y,
2209
2222
  dashboardTitle: (b == null ? void 0 : b.title) || (F == null ? void 0 : F.title),
2210
2223
  open: !0,
2211
2224
  onOpenChange: (i) => {
2212
- i || (X(null), Se(null));
2225
+ i || (Z(null), ke(null));
2213
2226
  },
2214
2227
  hideTrigger: !0,
2215
- workflowIntent: Ne ?? void 0,
2228
+ workflowIntent: Se ?? void 0,
2216
2229
  openRun: ie ?? void 0
2217
2230
  }
2218
2231
  ) : null,
2219
2232
  p && /* @__PURE__ */ e(
2220
- Ta,
2233
+ Ia,
2221
2234
  {
2222
- open: Z,
2235
+ open: ee,
2223
2236
  onOpenChange: y
2224
2237
  }
2225
2238
  ),
2226
2239
  /* @__PURE__ */ e(
2227
- Ua,
2240
+ Aa,
2228
2241
  {
2229
2242
  open: B,
2230
2243
  onOpenChange: (i) => {
2231
- !i && Fe && !K || (q(i), i || (Q(null), W([]), Ce(!1)));
2244
+ !i && Ge && !q || (H(i), i || (K(null), Q([]), De(!1)));
2232
2245
  },
2233
- children: /* @__PURE__ */ s($a, { className: "max-w-sm", children: [
2234
- /* @__PURE__ */ s(Ba, { children: [
2235
- /* @__PURE__ */ e(Fa, { children: K ? "Save failed" : "Saving dashboard" }),
2236
- /* @__PURE__ */ e(Ga, { className: "pt-2", children: K ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
2237
- de.length > 0 && /* @__PURE__ */ s("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
2246
+ children: /* @__PURE__ */ o(Oa, { className: "max-w-sm", children: [
2247
+ /* @__PURE__ */ o(La, { children: [
2248
+ /* @__PURE__ */ e(Ma, { children: q ? "Save failed" : "Saving dashboard" }),
2249
+ /* @__PURE__ */ e(_a, { className: "pt-2", children: q ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
2250
+ de.length > 0 && /* @__PURE__ */ o("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
2238
2251
  /* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
2239
2252
  /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: de.slice(0, 5).map((i) => /* @__PURE__ */ e("li", { children: i }, i)) })
2240
2253
  ] })
2241
2254
  ] }),
2242
- /* @__PURE__ */ e(Va, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: K ? /* @__PURE__ */ s($, { children: [
2255
+ /* @__PURE__ */ e(Pa, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: q ? /* @__PURE__ */ o($, { children: [
2243
2256
  /* @__PURE__ */ e(
2244
- ja,
2257
+ Ta,
2245
2258
  {
2246
2259
  onClick: () => {
2247
- q(!1), Q(null), W([]), Ce(!1);
2260
+ H(!1), K(null), Q([]), De(!1);
2248
2261
  },
2249
2262
  className: "m-0",
2250
2263
  children: "Close"
2251
2264
  }
2252
2265
  ),
2253
2266
  /* @__PURE__ */ e(
2254
- Lt,
2267
+ At,
2255
2268
  {
2256
- onClick: () => Qe({
2257
- closeAfterSave: ct,
2258
- navigateHomeAfterSave: Ve === "home"
2269
+ onClick: () => We({
2270
+ closeAfterSave: lt,
2271
+ navigateHomeAfterSave: je === "home"
2259
2272
  }),
2260
2273
  className: "m-0",
2261
2274
  children: "Retry"
2262
2275
  }
2263
2276
  )
2264
- ] }) : /* @__PURE__ */ s(Lt, { disabled: !0, className: "m-0 cursor-default", children: [
2265
- /* @__PURE__ */ e(_e, { className: "mr-2 h-4 w-4 animate-spin" }),
2277
+ ] }) : /* @__PURE__ */ o(At, { disabled: !0, className: "m-0 cursor-default", children: [
2278
+ /* @__PURE__ */ e(Re, { className: "mr-2 h-4 w-4 animate-spin" }),
2266
2279
  "Saving..."
2267
2280
  ] }) })
2268
2281
  ] })
2269
2282
  }
2270
2283
  ),
2271
2284
  /* @__PURE__ */ e(
2272
- fn,
2285
+ bn,
2273
2286
  {
2274
- open: kr,
2287
+ open: yr,
2275
2288
  onOpenChange: (i) => {
2276
2289
  le(i);
2277
2290
  },
2278
- onSave: Or,
2279
- onDiscard: Mr,
2280
- isSaving: Fe,
2291
+ onSave: Er,
2292
+ onDiscard: Ir,
2293
+ isSaving: Ge,
2281
2294
  saveLabel: "Save",
2282
2295
  discardLabel: "Discard changes"
2283
2296
  }
@@ -2285,23 +2298,57 @@ function es() {
2285
2298
  ] })
2286
2299
  ]
2287
2300
  }
2288
- );
2301
+ ) });
2302
+ }
2303
+ function Es() {
2304
+ const t = Wt();
2305
+ return /* @__PURE__ */ e(Ht, { asChild: !0, children: /* @__PURE__ */ o(
2306
+ G,
2307
+ {
2308
+ variant: "ghost",
2309
+ size: "xs",
2310
+ className: "relative w-7 px-0",
2311
+ "aria-label": "More dashboard options",
2312
+ children: [
2313
+ /* @__PURE__ */ e(Ra, { className: "h-3.5 w-3.5" }),
2314
+ t.length > 0 && /* @__PURE__ */ e(
2315
+ "span",
2316
+ {
2317
+ "aria-hidden": !0,
2318
+ className: "pointer-events-none absolute right-0.5 top-0.5 h-1.5 w-1.5 rounded-full bg-muted-foreground/70"
2319
+ }
2320
+ )
2321
+ ]
2322
+ }
2323
+ ) });
2324
+ }
2325
+ function Is() {
2326
+ const t = Wt();
2327
+ return t.length === 0 ? null : /* @__PURE__ */ o($, { children: [
2328
+ t.map((a) => /* @__PURE__ */ o(P, { onSelect: a.onSelect, children: [
2329
+ a.icon,
2330
+ /* @__PURE__ */ e("span", { className: "flex-1", children: a.label }),
2331
+ a.hint && /* @__PURE__ */ e("span", { className: "text-[11px] text-muted-foreground", children: a.hint }),
2332
+ a.checked && /* @__PURE__ */ e(qt, { className: "h-3.5 w-3.5" })
2333
+ ] }, a.id)),
2334
+ /* @__PURE__ */ e(be, {})
2335
+ ] });
2289
2336
  }
2290
- function Do({
2337
+ function As({
2291
2338
  accessToken: t,
2292
- dashboardId: n,
2293
- selectedSheetId: a,
2339
+ dashboardId: a,
2340
+ selectedSheetId: n,
2294
2341
  pageSize: r,
2295
- orientation: o,
2342
+ orientation: s,
2296
2343
  theme: d
2297
2344
  }) {
2298
- if (!t || !a)
2345
+ if (!t || !n)
2299
2346
  return null;
2300
2347
  const f = new URL("http://localhost:5173/print-document");
2301
- f.searchParams.set("token", t), n && f.searchParams.set("dashboardId", n), f.searchParams.set("selectedSheetId", a), d && f.searchParams.set("theme", d);
2302
- const m = new URL("http://127.0.0.1:3002/");
2303
- return m.searchParams.set("pdfMode", "document"), m.searchParams.set("pageSize", r || "letter"), m.searchParams.set("orientation", o || "portrait"), m.searchParams.set("url", f.toString()), m.toString();
2348
+ f.searchParams.set("token", t), a && f.searchParams.set("dashboardId", a), f.searchParams.set("selectedSheetId", n), d && f.searchParams.set("theme", d);
2349
+ const h = new URL("http://127.0.0.1:3002/");
2350
+ return h.searchParams.set("pdfMode", "document"), h.searchParams.set("pageSize", r || "letter"), h.searchParams.set("orientation", s || "portrait"), h.searchParams.set("url", f.toString()), h.toString();
2304
2351
  }
2305
2352
  export {
2306
- es as default
2353
+ ao as default
2307
2354
  };