react-semaphor 0.1.437 → 0.1.438

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 (31) hide show
  1. package/dist/brand-studio/index.js +1 -1
  2. package/dist/chunks/{code-editor-C8zzmSgt.js → code-editor-25d16KDV.js} +34 -34
  3. package/dist/chunks/{dashboard-BJr7m1TP.js → dashboard-Cm4D_4sW.js} +167 -167
  4. package/dist/chunks/{dashboard--OqogTLn.js → dashboard-H2ONqclF.js} +16132 -16124
  5. package/dist/chunks/{dashboard-briefing-launcher-Cegf8sog.js → dashboard-briefing-launcher-B2ktS4sN.js} +881 -882
  6. package/dist/chunks/dashboard-briefing-launcher-BevUTBG_.js +31 -0
  7. package/dist/chunks/dashboard-controls-8G5EZjyA.js +36 -0
  8. package/dist/chunks/{dashboard-controls-BjWzQbOT.js → dashboard-controls-BMy5GxU5.js} +926 -906
  9. package/dist/chunks/{dashboard-json-BYHE2Xi7.js → dashboard-json-BLxeyDM2.js} +2 -2
  10. package/dist/chunks/{dashboard-json-D3rtzp8l.js → dashboard-json-DWF407Fp.js} +1 -1
  11. package/dist/chunks/{edit-dashboard-visual-3rc-aeNO.js → edit-dashboard-visual-C0-7PJ0V.js} +9 -9
  12. package/dist/chunks/{edit-dashboard-visual-BKTpoR38.js → edit-dashboard-visual-DCx9r7g2.js} +3168 -3147
  13. package/dist/chunks/{report-preferences-dialog-VVM61k5R.js → report-preferences-dialog-D98RpVTB.js} +2 -2
  14. package/dist/chunks/{report-preferences-dialog-CoYKKbFc.js → report-preferences-dialog-Sl3VZLDC.js} +1 -1
  15. package/dist/chunks/{use-create-flow-overlay-state-Doo8NeYf.js → use-create-flow-overlay-state-B7nbDg72.js} +1 -1
  16. package/dist/chunks/{use-create-flow-overlay-state-CpH9832I.js → use-create-flow-overlay-state-D2y57BqL.js} +2 -2
  17. package/dist/dashboard/index.cjs +1 -1
  18. package/dist/dashboard/index.js +1 -1
  19. package/dist/data-app-builder/index.cjs +1 -1
  20. package/dist/data-app-builder/index.js +2 -2
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +6 -6
  23. package/dist/surfboard/index.cjs +1 -1
  24. package/dist/surfboard/index.js +2 -2
  25. package/dist/types/dashboard.d.ts +4 -1
  26. package/dist/types/main.d.ts +4 -1
  27. package/dist/types/surfboard.d.ts +4 -1
  28. package/dist/types/types.d.ts +4 -1
  29. package/package.json +1 -1
  30. package/dist/chunks/dashboard-briefing-launcher-BRjtoHFz.js +0 -31
  31. package/dist/chunks/dashboard-controls-DbOKYwbJ.js +0 -36
@@ -1,31 +1,31 @@
1
- import { jsx as e, jsxs as n, Fragment as G } from "react/jsx-runtime";
2
- import { u as D, B as R, aw as ct, A as ta, O as ja, Z as Ka, c as ve, ax as ut, ay as Qa, az as Wa, aA as aa, aB as ye, aC as mt, aD as ra, L as $e, aE as sa, aF as Ja, E as zt, Q as Ya, V as Xa, W as Za, Y as er, o as tr, aG as ar } from "./code-editor-C8zzmSgt.js";
3
- import { bC as rr, bD as sr, az as _, aH as na, bE as nr, aZ as H, aI as oa, aJ as or, aK as ot, aL as it, aF as ir, bF as xe, bG as Be, bH as dr, bI as _t, bJ as ia, bK as da, bL as lr, bM as ht, bN as cr, bO as ur, bP as mr, bQ as hr, bR as pr, bS as fr, b8 as we, bT as Ne, aG as I, bU as gr, bV as la, br as pt, bW as br, bX as xr, bY as ca, bZ as vr, b_ as ua, b$ as T, c0 as yr, aj as wr, c1 as Nr, c2 as Dr, c3 as Cr, an as kr, av as Te, aw as Sr, w as st, c4 as Ir, c5 as Mr, c6 as Er, c7 as Lr, ai as Ar, c8 as Pr, c9 as Ur, I as qt, ca as Rr, cb as Vr, cc as Fr, cd as Or, ce as Tr, cf as Ht, cg as jt, ch as Kt, ci as Gr, cj as Br, ck as $r, cl as zr, b1 as Qt, cm as _r, cn as qr, co as Hr, y as jr, cp as Kr, aP as Qr, aS as Wr, aT as Jr, aU as Yr, aV as Xr, aW as Zr, aX as es, aY as Wt, g as dt } from "./dashboard--OqogTLn.js";
4
- import { c as Z, X as ma, C as ts } from "./index-xHCrHprY.js";
1
+ import { jsx as e, jsxs as s, Fragment as T } from "react/jsx-runtime";
2
+ import { u as w, B as V, aw as dt, A as aa, O as Wa, Z as Ja, c as be, ax as lt, ay as Xa, az as Ya, aA as ra, aB as xe, aC as ct, aD as na, L as ze, aE as sa, aF as Za, E as Gt, Q as Bt, V as $t, W as zt, Y as _t, X as er, o as tr, aG as ar } from "./code-editor-25d16KDV.js";
3
+ import { bC as rr, bD as nr, az as j, aH as oa, bE as sr, aZ as K, aI as ia, aJ as or, aK as nt, aL as st, aF as ir, bF as ge, bG as $e, bH as dr, bI as qt, bJ as da, bK as la, bL as lr, bM as ut, bN as cr, bO as ur, bP as mr, bQ as hr, bR as pr, bS as fr, b8 as ve, bT as ye, aG as C, bU as gr, bV as ca, br as mt, bW as br, bX as xr, bY as ua, bZ as vr, b_ as ma, b$ as O, c0 as yr, aj as wr, c1 as Nr, c2 as Dr, c3 as Cr, c4 as kr, an as Sr, av as Ge, aw as Ir, w as at, c5 as Mr, c6 as Er, c7 as Lr, c8 as Ar, ai as Pr, c9 as Ur, ca as Rr, I as Ht, cb as Vr, cc as Fr, cd as Or, ce as Tr, cf as Gr, cg as jt, ch as Kt, ci as Qt, cj as Br, ck as $r, cl as zr, cm as _r, b1 as Wt, cn as qr, co as Hr, cp as jr, y as Kr, cq as Qr, aP as Wr, aS as Jr, aT as Xr, aU as Yr, aV as Zr, aW as en, aX as tn, aY as Jt, g as ot } from "./dashboard-H2ONqclF.js";
4
+ import { c as ee, X as ha, C as an } from "./index-xHCrHprY.js";
5
5
  import "./analyze-result-contract-CfOBEwaC.js";
6
6
  import "../value-format-preferences/index.js";
7
7
  import * as U from "react";
8
- import { useState as v, useMemo as X, useEffect as ze, useRef as Jt, useLayoutEffect as as, useCallback as rs } from "react";
8
+ import { useState as y, useMemo as Z, useEffect as _e, useRef as Xt, useLayoutEffect as rn, useCallback as nn } from "react";
9
9
  import "./index-If0wlXGi.js";
10
10
  import "./comparison-document-migration-Dj6xZMCb.js";
11
- import { createPortal as ss } from "react-dom";
11
+ import { createPortal as sn } from "react-dom";
12
12
  import "../briefings/index.js";
13
- import { g as ns, u as os, A as is, V as ds, c as ls, f as cs, N as us, D as ms, U as hs } from "./dashboard-briefing-launcher-Cegf8sog.js";
14
- import { S as ps, C as fs } from "./search-DHZCro8B.js";
15
- import { d as ha } from "./index-CnujJ3fa.js";
16
- import { R as gs } from "./report-preferences-dialog-VVM61k5R.js";
17
- import { u as bs } from "./use-debounced-dirty-check-BwAbnX_5.js";
18
- import { s as nt } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
13
+ import { g as on, u as dn, A as ln, V as cn, c as un, f as mn, N as hn, D as pn, U as fn } from "./dashboard-briefing-launcher-B2ktS4sN.js";
14
+ import { S as gn, C as bn } from "./search-DHZCro8B.js";
15
+ import { d as pa } from "./index-CnujJ3fa.js";
16
+ import { R as xn } from "./report-preferences-dialog-D98RpVTB.js";
17
+ import { u as vn } from "./use-debounced-dirty-check-BwAbnX_5.js";
18
+ import { s as rt } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
19
19
  import { S as Yt } from "./save-HCJjjzdX.js";
20
- import { P as xs } from "./palette-jqaAcwiQ.js";
21
- import { B as vs } from "./braces-BdbUk_r9.js";
20
+ import { P as yn } from "./palette-jqaAcwiQ.js";
21
+ import { B as wn } from "./braces-BdbUk_r9.js";
22
22
  /**
23
23
  * @license lucide-react v0.453.0 - ISC
24
24
  *
25
25
  * This source code is licensed under the ISC license.
26
26
  * See the LICENSE file in the root directory of this source tree.
27
27
  */
28
- const ys = Z("Glasses", [
28
+ const Nn = ee("Glasses", [
29
29
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
30
30
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
31
31
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -38,7 +38,7 @@ const ys = Z("Glasses", [
38
38
  * This source code is licensed under the ISC license.
39
39
  * See the LICENSE file in the root directory of this source tree.
40
40
  */
41
- const ws = Z("Monitor", [
41
+ const Dn = ee("Monitor", [
42
42
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
43
43
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
44
44
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
@@ -49,7 +49,7 @@ const ws = Z("Monitor", [
49
49
  * This source code is licensed under the ISC license.
50
50
  * See the LICENSE file in the root directory of this source tree.
51
51
  */
52
- const Ns = Z("Moon", [
52
+ const Cn = ee("Moon", [
53
53
  ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
54
54
  ]);
55
55
  /**
@@ -58,7 +58,7 @@ const Ns = Z("Moon", [
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 Ds = Z("ShieldX", [
61
+ const kn = ee("ShieldX", [
62
62
  [
63
63
  "path",
64
64
  {
@@ -75,7 +75,7 @@ const Ds = Z("ShieldX", [
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 Cs = Z("Sun", [
78
+ const Sn = ee("Sun", [
79
79
  ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
80
80
  ["path", { d: "M12 2v2", key: "tus03m" }],
81
81
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -92,7 +92,7 @@ const Cs = Z("Sun", [
92
92
  * This source code is licensed under the ISC license.
93
93
  * See the LICENSE file in the root directory of this source tree.
94
94
  */
95
- const ks = Z("UserPlus", [
95
+ const In = ee("UserPlus", [
96
96
  ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
97
97
  ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
98
98
  ["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
@@ -104,21 +104,21 @@ const ks = Z("UserPlus", [
104
104
  * This source code is licensed under the ISC license.
105
105
  * See the LICENSE file in the root directory of this source tree.
106
106
  */
107
- const pa = Z("UserRound", [
107
+ const fa = ee("UserRound", [
108
108
  ["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
109
109
  ["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
110
- ]), Ge = ["light", "dark", "system"];
111
- function Ss() {
112
- const { theme: t, setTheme: s } = rr(), r = D(
113
- (h) => h.actions.setDashboardTheme
110
+ ]), Be = ["light", "dark", "system"];
111
+ function Mn() {
112
+ const { theme: t, setTheme: n } = rr(), r = w(
113
+ (m) => m.actions.setDashboardTheme
114
114
  );
115
115
  function a() {
116
- const h = Ge.includes(t) ? t : "system", l = Ge[(Ge.indexOf(h) + 1) % Ge.length];
117
- s(l), r(l);
116
+ const m = Be.includes(t) ? t : "system", p = Be[(Be.indexOf(m) + 1) % Be.length];
117
+ n(p), r(p);
118
118
  }
119
- const o = t === "light" ? Cs : t === "dark" ? Ns : ws, c = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
119
+ const o = t === "light" ? Sn : t === "dark" ? Cn : Dn, c = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
120
120
  return /* @__PURE__ */ e(
121
- R,
121
+ V,
122
122
  {
123
123
  type: "button",
124
124
  variant: "ghost",
@@ -131,13 +131,13 @@ function Ss() {
131
131
  }
132
132
  );
133
133
  }
134
- function fa(t) {
135
- const s = (/* @__PURE__ */ new Date()).toISOString(), r = sr({
134
+ function ga(t) {
135
+ const n = (/* @__PURE__ */ new Date()).toISOString(), r = nr({
136
136
  dashboard: t.dashboard,
137
137
  sheetIds: (t.dashboard.sheets || []).filter((a) => a.kind !== "document").map((a) => a.id),
138
138
  sheetKind: "dashboard",
139
139
  mode: "dashboard",
140
- generatedAt: s,
140
+ generatedAt: n,
141
141
  runtimeValues: {
142
142
  dashboardInputValues: t.dashboardInputValues,
143
143
  filterValues: t.filterValues,
@@ -147,180 +147,180 @@ function fa(t) {
147
147
  }
148
148
  }).snapshot;
149
149
  return {
150
- generatedAt: s,
150
+ generatedAt: n,
151
151
  dashboardInputValues: r.dashboardInputValues
152
152
  };
153
153
  }
154
- async function Is(t, s, r, a, o, c) {
154
+ async function En(t, n, r, a, o, c) {
155
155
  if (!c)
156
156
  return null;
157
- const h = JSON.stringify(r), l = `${t}/v1/lens`;
158
- return await ct(l, c, {
159
- name: s,
160
- template: h,
157
+ const m = JSON.stringify(r), p = `${t}/v1/lens`;
158
+ return await dt(p, c, {
159
+ name: n,
160
+ template: m,
161
161
  filterValues: a,
162
162
  inputValues: o,
163
163
  operation: "create"
164
164
  });
165
165
  }
166
- async function lt(t, s, r) {
166
+ async function it(t, n, r) {
167
167
  if (!r)
168
168
  return null;
169
169
  const {
170
170
  id: a,
171
171
  template: o,
172
172
  filterValues: c,
173
- inputValues: h,
174
- isDefault: l,
173
+ inputValues: m,
174
+ isDefault: p,
175
175
  shared: b
176
- } = s, x = `${t}/v1/lens`;
177
- return await ct(x, r, {
176
+ } = n, f = `${t}/v1/lens`;
177
+ return await dt(f, r, {
178
178
  lensId: a,
179
179
  template: o,
180
180
  filterValues: c,
181
- inputValues: h,
182
- isDefault: l,
181
+ inputValues: m,
182
+ isDefault: p,
183
183
  shared: b,
184
184
  operation: "update"
185
185
  });
186
186
  }
187
- async function Ms(t, s, r) {
187
+ async function Ln(t, n, r) {
188
188
  if (!r)
189
189
  return null;
190
190
  const a = `${t}/v1/lens`;
191
- return await ct(a, r, {
191
+ return await dt(a, r, {
192
192
  operation: "delete",
193
- lensId: s
193
+ lensId: n
194
194
  });
195
195
  }
196
- const Es = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
197
- function Ls({
196
+ const An = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
197
+ function Pn({
198
198
  open: t,
199
- onOpenChange: s
199
+ onOpenChange: n
200
200
  } = {}) {
201
- const [r, a] = v(""), [o, c] = v(!1), h = D((w) => w.lenses), { setLenses: l, setSelectedLensId: b } = ta(), [x, d] = v(!1), [u, g] = v(!1), p = t !== void 0, y = p ? t : u, N = (w) => {
202
- p || g(w), s == null || s(w);
203
- }, C = D((w) => w.dashboard), S = D((w) => w.filterValues), { authToken: m, tokenProps: B } = _();
204
- async function V() {
201
+ const [r, a] = y(""), [o, c] = y(!1), m = w((l) => l.lenses), { setLenses: p, setSelectedLensId: b } = aa(), [f, d] = y(!1), [h, x] = y(!1), u = t !== void 0, v = u ? t : h, N = (l) => {
202
+ u || x(l), n == null || n(l);
203
+ }, D = w((l) => l.dashboard), R = w((l) => l.filterValues), { authToken: I, tokenProps: B } = j();
204
+ async function S() {
205
205
  d(!0);
206
- const w = D.getState(), M = fa({
207
- dashboard: C,
208
- dashboardInputValues: w.dashboardInputValues,
209
- filterValues: S,
210
- controlValues: w.controlValues,
211
- inlineFilterValuesMap: w.inlineFilterValuesMap,
212
- cardControlValuesMap: w.cardControlValuesMap
213
- }), k = await Is(
206
+ const l = w.getState(), $ = ga({
207
+ dashboard: D,
208
+ dashboardInputValues: l.dashboardInputValues,
209
+ filterValues: R,
210
+ controlValues: l.controlValues,
211
+ inlineFilterValuesMap: l.inlineFilterValuesMap,
212
+ cardControlValuesMap: l.cardControlValuesMap
213
+ }), G = await En(
214
214
  B.apiServiceUrl,
215
215
  r,
216
- C,
217
- S,
218
- M,
219
- m == null ? void 0 : m.accessToken
216
+ D,
217
+ R,
218
+ $,
219
+ I == null ? void 0 : I.accessToken
220
220
  );
221
- k && (l([...h || [], k]), b(k.id), N(!1)), d(!1);
221
+ G && (p([...m || [], G]), b(G.id), N(!1)), d(!1);
222
222
  }
223
- return /* @__PURE__ */ n(na, { open: y, onOpenChange: N, children: [
224
- p ? null : /* @__PURE__ */ e(nr, { asChild: !0, children: /* @__PURE__ */ n(R, { variant: "secondary", size: "xs", children: [
225
- /* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
223
+ return /* @__PURE__ */ s(oa, { open: v, onOpenChange: N, children: [
224
+ u ? null : /* @__PURE__ */ e(sr, { asChild: !0, children: /* @__PURE__ */ s(V, { variant: "secondary", size: "xs", children: [
225
+ /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5" }),
226
226
  "Lens"
227
227
  ] }) }),
228
- /* @__PURE__ */ n(oa, { className: "rounded-control border-border/60 sm:max-w-[420px] sm:rounded-control", children: [
229
- /* @__PURE__ */ n(or, { children: [
230
- /* @__PURE__ */ e(ot, { className: "text-[15px]", children: "Create lens" }),
231
- /* @__PURE__ */ e(it, { className: "text-[13px] leading-5", children: "Lenses are private by default and are only visible to you." })
228
+ /* @__PURE__ */ s(ia, { className: "rounded-control border-border/60 sm:max-w-[420px] sm:rounded-control", children: [
229
+ /* @__PURE__ */ s(or, { children: [
230
+ /* @__PURE__ */ e(nt, { className: "text-[15px]", children: "Create lens" }),
231
+ /* @__PURE__ */ e(st, { className: "text-[13px] leading-5", children: "Lenses are private by default and are only visible to you." })
232
232
  ] }),
233
- /* @__PURE__ */ n("div", { className: "space-y-1.5 py-1", children: [
234
- /* @__PURE__ */ e(ja, { htmlFor: "lens-name", className: Es, children: "Name" }),
233
+ /* @__PURE__ */ s("div", { className: "space-y-1.5 py-1", children: [
234
+ /* @__PURE__ */ e(Wa, { htmlFor: "lens-name", className: An, children: "Name" }),
235
235
  /* @__PURE__ */ e(
236
- Ka,
236
+ Ja,
237
237
  {
238
238
  id: "lens-name",
239
239
  size: "xs",
240
240
  value: r,
241
241
  placeholder: "Monthly review, West region, …",
242
- onChange: (w) => a(w.target.value)
242
+ onChange: (l) => a(l.target.value)
243
243
  }
244
244
  ),
245
245
  o && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: "A lens with this name already exists. Pick a different one." })
246
246
  ] }),
247
- /* @__PURE__ */ n(ir, { children: [
248
- /* @__PURE__ */ e(R, { variant: "outline", size: "xs", onClick: () => N(!1), children: "Cancel" }),
247
+ /* @__PURE__ */ s(ir, { children: [
248
+ /* @__PURE__ */ e(V, { variant: "outline", size: "xs", onClick: () => N(!1), children: "Cancel" }),
249
249
  /* @__PURE__ */ e(
250
- R,
250
+ V,
251
251
  {
252
252
  size: "xs",
253
253
  type: "submit",
254
- onClick: V,
255
- disabled: x || !r.trim(),
256
- children: x ? "Creating…" : "Create"
254
+ onClick: S,
255
+ disabled: f || !r.trim(),
256
+ children: f ? "Creating…" : "Create"
257
257
  }
258
258
  )
259
259
  ] })
260
260
  ] })
261
261
  ] });
262
262
  }
263
- function As({ includeLabel: t = !1 } = {}) {
264
- const s = D((d) => d.lenses), r = D((d) => d.selectedLensId), { setLenses: a, setSelectedLensId: o } = ta(), { authToken: c, tokenProps: h } = _();
265
- async function l(d) {
263
+ function Un({ includeLabel: t = !1 } = {}) {
264
+ const n = w((d) => d.lenses), r = w((d) => d.selectedLensId), { setLenses: a, setSelectedLensId: o } = aa(), { authToken: c, tokenProps: m } = j();
265
+ async function p(d) {
266
266
  o(d);
267
267
  }
268
268
  async function b(d) {
269
- if (await Ms(h.apiServiceUrl, d, c == null ? void 0 : c.accessToken)) {
270
- const g = s == null ? void 0 : s.filter((p) => p.id !== d);
271
- a(g || []), o("original");
269
+ if (await Ln(m.apiServiceUrl, d, c == null ? void 0 : c.accessToken)) {
270
+ const x = n == null ? void 0 : n.filter((u) => u.id !== d);
271
+ a(x || []), o("original");
272
272
  }
273
273
  }
274
- async function x(d) {
275
- const u = s == null ? void 0 : s.map((y) => y.id === d.id ? {
276
- ...y,
274
+ async function f(d) {
275
+ const h = n == null ? void 0 : n.map((v) => v.id === d.id ? {
276
+ ...v,
277
277
  isDefault: !d.isDefault
278
278
  } : {
279
- ...y,
279
+ ...v,
280
280
  isDefault: !1
281
281
  });
282
- a(u || []);
283
- const g = {
282
+ a(h || []);
283
+ const x = {
284
284
  ...d,
285
285
  isDefault: !d.isDefault
286
286
  };
287
- await lt(h.apiServiceUrl, g, c == null ? void 0 : c.accessToken);
288
- const p = s == null ? void 0 : s.find((y) => y.isDefault);
289
- if (p && p.id !== d.id) {
290
- const y = {
291
- ...p,
287
+ await it(m.apiServiceUrl, x, c == null ? void 0 : c.accessToken);
288
+ const u = n == null ? void 0 : n.find((v) => v.isDefault);
289
+ if (u && u.id !== d.id) {
290
+ const v = {
291
+ ...u,
292
292
  isDefault: !1
293
293
  };
294
- await lt(h.apiServiceUrl, y, c == null ? void 0 : c.accessToken);
294
+ await it(m.apiServiceUrl, v, c == null ? void 0 : c.accessToken);
295
295
  }
296
296
  }
297
- return /* @__PURE__ */ n(G, { children: [
298
- t ? /* @__PURE__ */ n(G, { children: [
299
- /* @__PURE__ */ e(xe, { className: "px-3", children: "Lenses" }),
300
- /* @__PURE__ */ e(Be, {})
297
+ return /* @__PURE__ */ s(T, { children: [
298
+ t ? /* @__PURE__ */ s(T, { children: [
299
+ /* @__PURE__ */ e(ge, { className: "px-3", children: "Lenses" }),
300
+ /* @__PURE__ */ e($e, {})
301
301
  ] }) : null,
302
- /* @__PURE__ */ n(
302
+ /* @__PURE__ */ s(
303
303
  dr,
304
304
  {
305
305
  value: r,
306
- onValueChange: l,
306
+ onValueChange: p,
307
307
  children: [
308
- /* @__PURE__ */ e(_t, { value: "original", children: "Original" }),
309
- s == null ? void 0 : s.map((d) => /* @__PURE__ */ n(
310
- _t,
308
+ /* @__PURE__ */ e(qt, { value: "original", children: "Original" }),
309
+ n == null ? void 0 : n.map((d) => /* @__PURE__ */ s(
310
+ qt,
311
311
  {
312
312
  className: "group flex justify-between gap-2",
313
313
  value: d.id,
314
314
  children: [
315
315
  /* @__PURE__ */ e("p", { children: d.name }),
316
- /* @__PURE__ */ n("span", { className: "flex items-center gap-3", children: [
316
+ /* @__PURE__ */ s("span", { className: "flex items-center gap-3", children: [
317
317
  /* @__PURE__ */ e(
318
- ia,
318
+ da,
319
319
  {
320
- onClick: (u) => {
321
- u.preventDefault(), x(d);
320
+ onClick: (h) => {
321
+ h.preventDefault(), f(d);
322
322
  },
323
- className: ve(
323
+ className: be(
324
324
  "size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
325
325
  {
326
326
  invisible: !d.isDefault,
@@ -331,10 +331,10 @@ function As({ includeLabel: t = !1 } = {}) {
331
331
  }
332
332
  ),
333
333
  /* @__PURE__ */ e(
334
- da,
334
+ la,
335
335
  {
336
- onClick: (u) => {
337
- u.preventDefault(), b(d.id);
336
+ onClick: (h) => {
337
+ h.preventDefault(), b(d.id);
338
338
  },
339
339
  className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
340
340
  strokeWidth: 1.5
@@ -350,19 +350,19 @@ function As({ includeLabel: t = !1 } = {}) {
350
350
  )
351
351
  ] });
352
352
  }
353
- function Ps() {
354
- const { displayPreferences: t, shouldShowElement: s } = lr(), { currentUser: r, userContext: a } = ht(), o = X(
353
+ function Rn() {
354
+ const { displayPreferences: t, shouldShowElement: n } = lr(), { currentUser: r, userContext: a } = ut(), o = Z(
355
355
  () => cr(r),
356
356
  [r]
357
- ), c = X(() => (l) => o && o[l] !== void 0 && o[l] === !1 ? !1 : s(l), [o, s, t]), h = X(
357
+ ), c = Z(() => (p) => o && o[p] !== void 0 && o[p] === !1 ? !1 : n(p), [o, n, t]), m = Z(
358
358
  () => {
359
- var l, b, x, d, u;
359
+ var p, b, f, d, h;
360
360
  return {
361
- canEdit: ((l = a == null ? void 0 : a.permissions) == null ? void 0 : l.canEdit) ?? fr(r),
361
+ canEdit: ((p = a == null ? void 0 : a.permissions) == null ? void 0 : p.canEdit) ?? fr(r),
362
362
  canUseFilters: ((b = a == null ? void 0 : a.permissions) == null ? void 0 : b.canEdit) ?? pr(r),
363
- canManageDashboards: ((x = a == null ? void 0 : a.permissions) == null ? void 0 : x.canCreateDashboard) ?? hr(r),
363
+ canManageDashboards: ((f = a == null ? void 0 : a.permissions) == null ? void 0 : f.canCreateDashboard) ?? hr(r),
364
364
  canCreateDashboards: ((d = a == null ? void 0 : a.permissions) == null ? void 0 : d.canCreateDashboard) ?? mr(r),
365
- canAccessVisuals: ((u = a == null ? void 0 : a.permissions) == null ? void 0 : u.canEdit) ?? ur(r)
365
+ canAccessVisuals: ((h = a == null ? void 0 : a.permissions) == null ? void 0 : h.canEdit) ?? ur(r)
366
366
  };
367
367
  },
368
368
  [r, a]
@@ -370,345 +370,345 @@ function Ps() {
370
370
  return {
371
371
  displayPreferences: t,
372
372
  shouldShowElement: c,
373
- permissions: h,
373
+ permissions: m,
374
374
  currentUser: r
375
375
  };
376
376
  }
377
- var ft = "Avatar", [Us] = Qa(ft), Rs = [
377
+ var ht = "Avatar", [Vn] = Xa(ht), Fn = [
378
378
  0,
379
379
  () => {
380
380
  }
381
- ], [Vs, ga] = Us(ft), gt = U.forwardRef(
382
- (t, s) => {
383
- const { __scopeAvatar: r, ...a } = t, [o, c] = U.useState("idle"), [h, l] = Os();
381
+ ], [On, ba] = Vn(ht), pt = U.forwardRef(
382
+ (t, n) => {
383
+ const { __scopeAvatar: r, ...a } = t, [o, c] = U.useState("idle"), [m, p] = Gn();
384
384
  return /* @__PURE__ */ e(
385
- Vs,
385
+ On,
386
386
  {
387
387
  scope: r,
388
388
  imageLoadingStatus: o,
389
389
  setImageLoadingStatus: c,
390
- imageCount: h,
391
- setImageCount: l,
392
- children: /* @__PURE__ */ e(ut.span, { ...a, ref: s })
390
+ imageCount: m,
391
+ setImageCount: p,
392
+ children: /* @__PURE__ */ e(lt.span, { ...a, ref: n })
393
393
  }
394
394
  );
395
395
  }
396
396
  );
397
- gt.displayName = ft;
398
- var ba = "AvatarImage", bt = U.forwardRef(
399
- (t, s) => {
400
- const { __scopeAvatar: r, src: a, onLoadingStatusChange: o, ...c } = t, h = ga(ba, r);
401
- Ts(h.setImageCount);
402
- const l = Fs(a, {
397
+ pt.displayName = ht;
398
+ var xa = "AvatarImage", ft = U.forwardRef(
399
+ (t, n) => {
400
+ const { __scopeAvatar: r, src: a, onLoadingStatusChange: o, ...c } = t, m = ba(xa, r);
401
+ Bn(m.setImageCount);
402
+ const p = Tn(a, {
403
403
  referrerPolicy: c.referrerPolicy,
404
404
  crossOrigin: c.crossOrigin,
405
- loadingStatus: h.imageLoadingStatus,
406
- setLoadingStatus: h.setImageLoadingStatus
407
- }), b = Wa((d) => {
405
+ loadingStatus: m.imageLoadingStatus,
406
+ setLoadingStatus: m.setImageLoadingStatus
407
+ }), b = Ya((d) => {
408
408
  o == null || o(d);
409
- }), x = U.useRef(l);
410
- return aa(() => {
411
- const d = x.current;
412
- x.current = l, l !== d && b(l);
413
- }, [l, b]), l === "loaded" ? /* @__PURE__ */ e(ut.img, { ...c, ref: s, src: a }) : null;
409
+ }), f = U.useRef(p);
410
+ return ra(() => {
411
+ const d = f.current;
412
+ f.current = p, p !== d && b(p);
413
+ }, [p, b]), p === "loaded" ? /* @__PURE__ */ e(lt.img, { ...c, ref: n, src: a }) : null;
414
414
  }
415
415
  );
416
- bt.displayName = ba;
417
- var xa = "AvatarFallback", xt = U.forwardRef(
418
- (t, s) => {
419
- const { __scopeAvatar: r, delayMs: a, ...o } = t, c = ga(xa, r), [h, l] = U.useState(a === void 0);
416
+ ft.displayName = xa;
417
+ var va = "AvatarFallback", gt = U.forwardRef(
418
+ (t, n) => {
419
+ const { __scopeAvatar: r, delayMs: a, ...o } = t, c = ba(va, r), [m, p] = U.useState(a === void 0);
420
420
  return U.useEffect(() => {
421
421
  if (a !== void 0) {
422
- const b = window.setTimeout(() => l(!0), a);
422
+ const b = window.setTimeout(() => p(!0), a);
423
423
  return () => window.clearTimeout(b);
424
424
  }
425
- }, [a]), h && c.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(ut.span, { ...o, ref: s }) : null;
425
+ }, [a]), m && c.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(lt.span, { ...o, ref: n }) : null;
426
426
  }
427
427
  );
428
- xt.displayName = xa;
429
- function Fs(t, {
430
- loadingStatus: s,
428
+ gt.displayName = va;
429
+ function Tn(t, {
430
+ loadingStatus: n,
431
431
  setLoadingStatus: r,
432
432
  referrerPolicy: a,
433
433
  crossOrigin: o
434
434
  }) {
435
- return aa(() => {
435
+ return ra(() => {
436
436
  if (!t) {
437
437
  r("error");
438
438
  return;
439
439
  }
440
- const c = new window.Image(), h = (b) => {
441
- const x = b.currentTarget;
442
- r(Xt(x));
443
- }, l = () => r("error");
444
- return c.addEventListener("load", h), c.addEventListener("error", l), a && (c.referrerPolicy = a), c.crossOrigin = o ?? null, c.src = t, r(Xt(c)), () => {
445
- c.removeEventListener("load", h), c.removeEventListener("error", l), r("idle");
440
+ const c = new window.Image(), m = (b) => {
441
+ const f = b.currentTarget;
442
+ r(Zt(f));
443
+ }, p = () => r("error");
444
+ return c.addEventListener("load", m), c.addEventListener("error", p), a && (c.referrerPolicy = a), c.crossOrigin = o ?? null, c.src = t, r(Zt(c)), () => {
445
+ c.removeEventListener("load", m), c.removeEventListener("error", p), r("idle");
446
446
  };
447
- }, [t, o, a, r]), s;
447
+ }, [t, o, a, r]), n;
448
448
  }
449
- function Xt(t) {
449
+ function Zt(t) {
450
450
  return t.complete ? t.naturalWidth > 0 ? "loaded" : "error" : "loading";
451
451
  }
452
- function Os() {
453
- let t = Rs;
452
+ function Gn() {
453
+ let t = Fn;
454
454
  {
455
455
  t = U.useState(0);
456
- const [s] = t, r = U.useRef(!1);
456
+ const [n] = t, r = U.useRef(!1);
457
457
  U.useEffect(() => {
458
- s > 1 && !r.current && (r.current = !0, console.warn(
458
+ n > 1 && !r.current && (r.current = !0, console.warn(
459
459
  "Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior."
460
460
  ));
461
- }, [s]);
461
+ }, [n]);
462
462
  }
463
463
  return t;
464
464
  }
465
- function Ts(t) {
466
- U.useEffect(() => (t((s) => s + 1), () => {
467
- t((s) => s - 1);
465
+ function Bn(t) {
466
+ U.useEffect(() => (t((n) => n + 1), () => {
467
+ t((n) => n - 1);
468
468
  }), [t]);
469
469
  }
470
- const va = U.forwardRef(({ className: t, ...s }, r) => /* @__PURE__ */ e(
471
- gt,
470
+ const ya = U.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ e(
471
+ pt,
472
472
  {
473
473
  ref: r,
474
- className: ve(
474
+ className: be(
475
475
  "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
476
476
  t
477
477
  ),
478
- ...s
478
+ ...n
479
479
  }
480
480
  ));
481
- va.displayName = gt.displayName;
482
- const Gs = U.forwardRef(({ className: t, ...s }, r) => /* @__PURE__ */ e(
483
- bt,
481
+ ya.displayName = pt.displayName;
482
+ const $n = U.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ e(
483
+ ft,
484
484
  {
485
485
  ref: r,
486
- className: ve("aspect-square h-full w-full", t),
487
- ...s
486
+ className: be("aspect-square h-full w-full", t),
487
+ ...n
488
488
  }
489
489
  ));
490
- Gs.displayName = bt.displayName;
491
- const ya = U.forwardRef(({ className: t, ...s }, r) => /* @__PURE__ */ e(
492
- xt,
490
+ $n.displayName = ft.displayName;
491
+ const wa = U.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ e(
492
+ gt,
493
493
  {
494
494
  ref: r,
495
- className: ve(
495
+ className: be(
496
496
  "flex h-full w-full items-center justify-center rounded-full bg-muted",
497
497
  t
498
498
  ),
499
- ...s
499
+ ...n
500
500
  }
501
501
  ));
502
- ya.displayName = xt.displayName;
503
- const Bs = async (t, s, r) => {
502
+ wa.displayName = gt.displayName;
503
+ const zn = async (t, n, r) => {
504
504
  const a = `${t}/management/v1/groups`;
505
- return await ra(a, s, r);
506
- }, $s = async (t, s, r, a) => {
505
+ return await na(a, n, r);
506
+ }, _n = async (t, n, r, a) => {
507
507
  const o = `${t}/management/v1/groups/${r}`;
508
- return mt(o, s, "PATCH", a);
509
- }, zs = async (t, s, r) => {
508
+ return ct(o, n, "PATCH", a);
509
+ }, qn = async (t, n, r) => {
510
510
  const a = `${t}/management/v1/groups/${r}`;
511
- await mt(a, s, "DELETE");
512
- }, _s = async (t, s, r, a) => {
511
+ await ct(a, n, "DELETE");
512
+ }, Hn = async (t, n, r, a) => {
513
513
  const o = `${t}/management/v1/groups/${r}/members`;
514
- return await ra(o, s, a);
515
- }, qs = async (t, s, r, a) => {
514
+ return await na(o, n, a);
515
+ }, jn = async (t, n, r, a) => {
516
516
  const o = `${t}/management/v1/groups/${r}/members`;
517
- await mt(o, s, "DELETE", a);
517
+ await ct(o, n, "DELETE", a);
518
518
  };
519
- function Hs() {
520
- const { authToken: t, tokenProps: s } = _(), r = we();
521
- return Ne({
522
- mutationFn: (a) => Bs(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a),
519
+ function Kn() {
520
+ const { authToken: t, tokenProps: n } = j(), r = ve();
521
+ return ye({
522
+ mutationFn: (a) => zn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a),
523
523
  onSuccess: () => {
524
- r.invalidateQueries({ queryKey: ["groups"] }), I.success("Group created successfully");
524
+ r.invalidateQueries({ queryKey: ["groups"] }), C.success("Group created successfully");
525
525
  },
526
526
  onError: (a) => {
527
- console.error("Failed to create group:", a), I.error("Failed to create group", {
528
- description: ye(a, "Failed to create group")
527
+ console.error("Failed to create group:", a), C.error("Failed to create group", {
528
+ description: xe(a, "Failed to create group")
529
529
  });
530
530
  }
531
531
  });
532
532
  }
533
- function js() {
534
- const { authToken: t, tokenProps: s } = _(), r = we();
535
- return Ne({
533
+ function Qn() {
534
+ const { authToken: t, tokenProps: n } = j(), r = ve();
535
+ return ye({
536
536
  mutationFn: ({
537
537
  groupId: a,
538
538
  data: o
539
- }) => $s(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, o),
539
+ }) => _n(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, o),
540
540
  onSuccess: (a, o) => {
541
- r.invalidateQueries({ queryKey: ["group", o.groupId] }), r.invalidateQueries({ queryKey: ["groups"] }), I.success("Group updated successfully");
541
+ r.invalidateQueries({ queryKey: ["group", o.groupId] }), r.invalidateQueries({ queryKey: ["groups"] }), C.success("Group updated successfully");
542
542
  },
543
543
  onError: (a) => {
544
- console.error("Failed to update group:", a), I.error("Failed to update group", {
545
- description: ye(a, "Failed to update group")
544
+ console.error("Failed to update group:", a), C.error("Failed to update group", {
545
+ description: xe(a, "Failed to update group")
546
546
  });
547
547
  }
548
548
  });
549
549
  }
550
- function Ks() {
551
- const { authToken: t, tokenProps: s } = _(), r = we();
552
- return Ne({
553
- mutationFn: (a) => zs(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a),
550
+ function Wn() {
551
+ const { authToken: t, tokenProps: n } = j(), r = ve();
552
+ return ye({
553
+ mutationFn: (a) => qn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a),
554
554
  onSuccess: (a, o) => {
555
- r.invalidateQueries({ queryKey: ["groups"] }), r.removeQueries({ queryKey: ["group", o] }), I.success("Group deleted successfully");
555
+ r.invalidateQueries({ queryKey: ["groups"] }), r.removeQueries({ queryKey: ["group", o] }), C.success("Group deleted successfully");
556
556
  },
557
557
  onError: (a) => {
558
- console.error("Failed to delete group:", a), I.error("Failed to delete group", {
559
- description: ye(a, "Failed to delete group")
558
+ console.error("Failed to delete group:", a), C.error("Failed to delete group", {
559
+ description: xe(a, "Failed to delete group")
560
560
  });
561
561
  }
562
562
  });
563
563
  }
564
- function Qs() {
565
- const { authToken: t, tokenProps: s } = _(), r = we();
566
- return Ne({
564
+ function Jn() {
565
+ const { authToken: t, tokenProps: n } = j(), r = ve();
566
+ return ye({
567
567
  mutationFn: ({
568
568
  groupId: a,
569
569
  data: o
570
- }) => _s(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, o),
570
+ }) => Hn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, o),
571
571
  onSuccess: (a, o) => {
572
572
  r.invalidateQueries({ queryKey: ["group", o.groupId] }), r.invalidateQueries({
573
573
  queryKey: ["group-members", o.groupId]
574
- }), r.invalidateQueries({ queryKey: ["groups"] }), I.success("Members added successfully");
574
+ }), r.invalidateQueries({ queryKey: ["groups"] }), C.success("Members added successfully");
575
575
  },
576
576
  onError: (a) => {
577
- console.error("Failed to add group members:", a), I.error("Failed to add members", {
578
- description: ye(a, "Failed to add members")
577
+ console.error("Failed to add group members:", a), C.error("Failed to add members", {
578
+ description: xe(a, "Failed to add members")
579
579
  });
580
580
  }
581
581
  });
582
582
  }
583
- function Ws() {
584
- const { authToken: t, tokenProps: s } = _(), r = we();
585
- return Ne({
583
+ function Xn() {
584
+ const { authToken: t, tokenProps: n } = j(), r = ve();
585
+ return ye({
586
586
  mutationFn: ({
587
587
  groupId: a,
588
588
  data: o
589
- }) => qs(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, o),
589
+ }) => jn(n.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, o),
590
590
  onSuccess: (a, o) => {
591
591
  r.invalidateQueries({ queryKey: ["group", o.groupId] }), r.invalidateQueries({
592
592
  queryKey: ["group-members", o.groupId]
593
- }), r.invalidateQueries({ queryKey: ["groups"] }), I.success("Members removed successfully");
593
+ }), r.invalidateQueries({ queryKey: ["groups"] }), C.success("Members removed successfully");
594
594
  },
595
595
  onError: (a) => {
596
- console.error("Failed to remove group members:", a), I.error("Failed to remove members", {
597
- description: ye(a, "Failed to remove members")
596
+ console.error("Failed to remove group members:", a), C.error("Failed to remove members", {
597
+ description: xe(a, "Failed to remove members")
598
598
  });
599
599
  }
600
600
  });
601
601
  }
602
- const Js = [];
603
- function Ys({
602
+ const Yn = [];
603
+ function Zn({
604
604
  open: t,
605
- onOpenChange: s
605
+ onOpenChange: n
606
606
  }) {
607
- var m, B, V;
608
- const { tokenProps: r } = _(), { currentUser: a } = ht(), o = (a == null ? void 0 : a.type) === "tenant", c = r == null ? void 0 : r.tenantId, {
609
- groups: h,
610
- isLoading: l,
607
+ var I, B, S;
608
+ const { tokenProps: r } = j(), { currentUser: a } = ut(), o = (a == null ? void 0 : a.type) === "tenant", c = r == null ? void 0 : r.tenantId, {
609
+ groups: m,
610
+ isLoading: p,
611
611
  error: b,
612
- refetch: x
612
+ refetch: f
613
613
  } = gr({
614
614
  type: o ? "TENANT_GROUP" : "all",
615
615
  tenantId: o ? c : void 0,
616
616
  includeMembers: !1
617
- }), d = b ? wa(b, "Unable to load groups.") : null, [u, g] = v({ kind: "list" }), [p, y] = v(null), N = Ks();
618
- ze(() => {
619
- t || (g({ kind: "list" }), y(null));
617
+ }), d = b ? Na(b, "Unable to load groups.") : null, [h, x] = y({ kind: "list" }), [u, v] = y(null), N = Wn();
618
+ _e(() => {
619
+ t || (x({ kind: "list" }), v(null));
620
620
  }, [t]);
621
- const C = u.kind === "members" && h.find((w) => w.id === u.groupId) || null, S = async () => {
622
- if (p)
621
+ const D = h.kind === "members" && m.find((l) => l.id === h.groupId) || null, R = async () => {
622
+ if (u)
623
623
  try {
624
- await N.mutateAsync(p.id), y(null), g({ kind: "list" }), x();
624
+ await N.mutateAsync(u.id), v(null), x({ kind: "list" }), f();
625
625
  } catch {
626
626
  }
627
627
  };
628
- return /* @__PURE__ */ e(na, { open: t, onOpenChange: s, children: /* @__PURE__ */ n(oa, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
629
- u.kind === "list" ? /* @__PURE__ */ n("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
630
- /* @__PURE__ */ e(ot, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
631
- /* @__PURE__ */ e(it, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
632
- ] }) : u.kind === "create" ? /* @__PURE__ */ n("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
628
+ return /* @__PURE__ */ e(oa, { open: t, onOpenChange: n, children: /* @__PURE__ */ s(ia, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
629
+ h.kind === "list" ? /* @__PURE__ */ s("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
630
+ /* @__PURE__ */ e(nt, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
631
+ /* @__PURE__ */ e(st, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
632
+ ] }) : h.kind === "create" ? /* @__PURE__ */ s("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
633
633
  /* @__PURE__ */ e(
634
634
  "button",
635
635
  {
636
636
  type: "button",
637
- onClick: () => g({ kind: "list" }),
637
+ onClick: () => x({ kind: "list" }),
638
638
  "aria-label": "Back",
639
639
  className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
640
- children: /* @__PURE__ */ e(la, { className: "h-3.5 w-3.5" })
640
+ children: /* @__PURE__ */ e(ca, { className: "h-3.5 w-3.5" })
641
641
  }
642
642
  ),
643
- /* @__PURE__ */ e(ot, { className: "truncate text-[13px] font-medium", children: "New group" }),
644
- /* @__PURE__ */ e(it, { className: "sr-only", children: "Create a new group to organize members." })
643
+ /* @__PURE__ */ e(nt, { className: "truncate text-[13px] font-medium", children: "New group" }),
644
+ /* @__PURE__ */ e(st, { className: "sr-only", children: "Create a new group to organize members." })
645
645
  ] }) : null,
646
- u.kind === "list" && /* @__PURE__ */ e(
647
- Xs,
646
+ h.kind === "list" && /* @__PURE__ */ e(
647
+ es,
648
648
  {
649
- groups: h,
650
- isLoading: l,
649
+ groups: m,
650
+ isLoading: p,
651
651
  errorMessage: d,
652
- onRetry: () => x(),
652
+ onRetry: () => f(),
653
653
  currentUserId: a == null ? void 0 : a.id,
654
- onOpenGroup: (w) => g({ kind: "members", groupId: w }),
655
- onCreate: () => g({ kind: "create" }),
656
- onDeleteRequest: (w) => y(w)
654
+ onOpenGroup: (l) => x({ kind: "members", groupId: l }),
655
+ onCreate: () => x({ kind: "create" }),
656
+ onDeleteRequest: (l) => v(l)
657
657
  }
658
658
  ),
659
- u.kind === "members" && C && /* @__PURE__ */ e(
660
- tn,
659
+ h.kind === "members" && D && /* @__PURE__ */ e(
660
+ rs,
661
661
  {
662
- group: C,
662
+ group: D,
663
663
  isTenantViewer: o,
664
- canEdit: ((m = C.permissions) == null ? void 0 : m.canEdit) ?? C.createdBy === (a == null ? void 0 : a.id),
665
- canDelete: ((B = C.permissions) == null ? void 0 : B.canDelete) ?? C.createdBy === (a == null ? void 0 : a.id),
666
- canManageMembers: ((V = C.permissions) == null ? void 0 : V.canManageMembers) ?? C.createdBy === (a == null ? void 0 : a.id),
667
- onBack: () => g({ kind: "list" }),
668
- onMembersChanged: x,
669
- onUpdated: x,
670
- onRequestDelete: () => y(C)
664
+ canEdit: ((I = D.permissions) == null ? void 0 : I.canEdit) ?? D.createdBy === (a == null ? void 0 : a.id),
665
+ canDelete: ((B = D.permissions) == null ? void 0 : B.canDelete) ?? D.createdBy === (a == null ? void 0 : a.id),
666
+ canManageMembers: ((S = D.permissions) == null ? void 0 : S.canManageMembers) ?? D.createdBy === (a == null ? void 0 : a.id),
667
+ onBack: () => x({ kind: "list" }),
668
+ onMembersChanged: f,
669
+ onUpdated: f,
670
+ onRequestDelete: () => v(D)
671
671
  },
672
- C.id
672
+ D.id
673
673
  ),
674
- u.kind === "create" && /* @__PURE__ */ e(
675
- an,
674
+ h.kind === "create" && /* @__PURE__ */ e(
675
+ ns,
676
676
  {
677
677
  isTenantUser: o,
678
678
  tenantId: c,
679
- onCancel: () => g({ kind: "list" }),
680
- onCreated: (w) => {
681
- x(), g({ kind: "members", groupId: w });
679
+ onCancel: () => x({ kind: "list" }),
680
+ onCreated: (l) => {
681
+ f(), x({ kind: "members", groupId: l });
682
682
  }
683
683
  }
684
684
  ),
685
- p && /* @__PURE__ */ n("div", { className: "flex shrink-0 items-center justify-between gap-3 border-t border-border bg-muted/40 px-5 py-2.5", children: [
686
- /* @__PURE__ */ n("div", { className: "min-w-0 text-[12px] text-foreground", children: [
685
+ u && /* @__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: [
686
+ /* @__PURE__ */ s("div", { className: "min-w-0 text-[12px] text-foreground", children: [
687
687
  "Delete ",
688
- /* @__PURE__ */ e("span", { className: "font-medium", children: p.name }),
688
+ /* @__PURE__ */ e("span", { className: "font-medium", children: u.name }),
689
689
  "?",
690
690
  /* @__PURE__ */ e("span", { className: "ml-2 text-muted-foreground", children: "Members lose any access granted via this group." })
691
691
  ] }),
692
- /* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-1.5", children: [
692
+ /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-1.5", children: [
693
693
  /* @__PURE__ */ e(
694
694
  "button",
695
695
  {
696
696
  type: "button",
697
- onClick: () => y(null),
697
+ onClick: () => v(null),
698
698
  disabled: N.isPending,
699
699
  className: "h-7 rounded-[5px] px-2.5 text-[12px] font-medium text-foreground/80 hover:bg-background",
700
700
  children: "Cancel"
701
701
  }
702
702
  ),
703
- /* @__PURE__ */ n(
703
+ /* @__PURE__ */ s(
704
704
  "button",
705
705
  {
706
706
  type: "button",
707
- onClick: S,
707
+ onClick: R,
708
708
  disabled: N.isPending,
709
709
  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",
710
710
  children: [
711
- N.isPending ? /* @__PURE__ */ e($e, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(pt, { className: "h-3 w-3" }),
711
+ N.isPending ? /* @__PURE__ */ e(ze, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(mt, { className: "h-3 w-3" }),
712
712
  "Delete group"
713
713
  ]
714
714
  }
@@ -717,31 +717,31 @@ function Ys({
717
717
  ] })
718
718
  ] }) });
719
719
  }
720
- function Xs({
720
+ function es({
721
721
  groups: t,
722
- isLoading: s,
722
+ isLoading: n,
723
723
  errorMessage: r,
724
724
  onRetry: a,
725
725
  currentUserId: o,
726
726
  onOpenGroup: c,
727
- onCreate: h,
728
- onDeleteRequest: l
727
+ onCreate: m,
728
+ onDeleteRequest: p
729
729
  }) {
730
- const [b, x] = v(""), d = X(
730
+ const [b, f] = y(""), d = Z(
731
731
  () => t.filter(
732
- (u) => !b.trim() || u.name.toLowerCase().includes(b.toLowerCase()) || (u.description || "").toLowerCase().includes(b.toLowerCase())
732
+ (h) => !b.trim() || h.name.toLowerCase().includes(b.toLowerCase()) || (h.description || "").toLowerCase().includes(b.toLowerCase())
733
733
  ),
734
734
  [t, b]
735
735
  );
736
- return /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
737
- /* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-5 py-2.5", children: [
738
- /* @__PURE__ */ n("div", { className: "flex flex-1 items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40", children: [
739
- /* @__PURE__ */ e(ps, { className: "h-3 w-3 text-muted-foreground" }),
736
+ return /* @__PURE__ */ s("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
737
+ /* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-5 py-2.5", children: [
738
+ /* @__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: [
739
+ /* @__PURE__ */ e(gn, { className: "h-3 w-3 text-muted-foreground" }),
740
740
  /* @__PURE__ */ e(
741
741
  "input",
742
742
  {
743
743
  value: b,
744
- onChange: (u) => x(u.target.value),
744
+ onChange: (h) => f(h.target.value),
745
745
  placeholder: "Search groups…",
746
746
  className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none"
747
747
  }
@@ -750,73 +750,73 @@ function Xs({
750
750
  "button",
751
751
  {
752
752
  type: "button",
753
- onClick: () => x(""),
753
+ onClick: () => f(""),
754
754
  className: "flex h-4 w-4 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
755
- children: /* @__PURE__ */ e(ma, { className: "h-2.5 w-2.5" })
755
+ children: /* @__PURE__ */ e(ha, { className: "h-2.5 w-2.5" })
756
756
  }
757
757
  )
758
758
  ] }),
759
- /* @__PURE__ */ n(
759
+ /* @__PURE__ */ s(
760
760
  "button",
761
761
  {
762
762
  type: "button",
763
- onClick: h,
763
+ onClick: m,
764
764
  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",
765
765
  children: [
766
- /* @__PURE__ */ e(H, { className: "h-3 w-3" }),
766
+ /* @__PURE__ */ e(K, { className: "h-3 w-3" }),
767
767
  "New group"
768
768
  ]
769
769
  }
770
770
  )
771
771
  ] }),
772
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: s ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((u) => /* @__PURE__ */ e(
772
+ /* @__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((h) => /* @__PURE__ */ e(
773
773
  "div",
774
774
  {
775
775
  className: "h-12 animate-pulse rounded-[4px] bg-muted/60"
776
776
  },
777
- u
777
+ h
778
778
  )) }) : r ? /* @__PURE__ */ e(
779
- Na,
779
+ Da,
780
780
  {
781
781
  title: "Can't load groups",
782
782
  message: r,
783
783
  onRetry: a
784
784
  }
785
- ) : d.length === 0 && t.length === 0 ? /* @__PURE__ */ e(en, { onCreate: h }) : d.length === 0 ? /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
786
- /* @__PURE__ */ n("div", { className: "text-[12px] text-foreground", children: [
785
+ ) : d.length === 0 && t.length === 0 ? /* @__PURE__ */ e(as, { onCreate: m }) : d.length === 0 ? /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
786
+ /* @__PURE__ */ s("div", { className: "text-[12px] text-foreground", children: [
787
787
  'No groups match "',
788
788
  b,
789
789
  '"'
790
790
  ] }),
791
791
  /* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: "Try a different search." })
792
- ] }) : d.map((u) => {
793
- var g;
792
+ ] }) : d.map((h) => {
793
+ var x;
794
794
  return /* @__PURE__ */ e(
795
- Zs,
795
+ ts,
796
796
  {
797
- group: u,
798
- canDelete: ((g = u.permissions) == null ? void 0 : g.canDelete) ?? u.createdBy === o,
799
- onClick: () => c(u.id),
800
- onDelete: () => l(u)
797
+ group: h,
798
+ canDelete: ((x = h.permissions) == null ? void 0 : x.canDelete) ?? h.createdBy === o,
799
+ onClick: () => c(h.id),
800
+ onDelete: () => p(h)
801
801
  },
802
- u.id
802
+ h.id
803
803
  );
804
804
  }) })
805
805
  ] });
806
806
  }
807
- function Zs({
807
+ function ts({
808
808
  group: t,
809
- canDelete: s,
809
+ canDelete: n,
810
810
  onClick: r,
811
811
  onDelete: a
812
812
  }) {
813
813
  let o = "";
814
814
  try {
815
- o = ha(new Date(t.createdAt), "MMM d, yyyy");
815
+ o = pa(new Date(t.createdAt), "MMM d, yyyy");
816
816
  } catch {
817
817
  o = "";
818
818
  }
819
- return /* @__PURE__ */ n(
819
+ return /* @__PURE__ */ s(
820
820
  "button",
821
821
  {
822
822
  type: "button",
@@ -824,30 +824,30 @@ function Zs({
824
824
  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",
825
825
  children: [
826
826
  /* @__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(vr, { className: "h-3.5 w-3.5" }) }),
827
- /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
827
+ /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
828
828
  /* @__PURE__ */ e("div", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
829
- /* @__PURE__ */ n("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
830
- /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1", children: [
831
- /* @__PURE__ */ e(pa, { className: "h-2.5 w-2.5" }),
829
+ /* @__PURE__ */ s("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
830
+ /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1", children: [
831
+ /* @__PURE__ */ e(fa, { className: "h-2.5 w-2.5" }),
832
832
  t.memberCount,
833
833
  " member",
834
834
  t.memberCount === 1 ? "" : "s"
835
835
  ] }),
836
- o && /* @__PURE__ */ n(G, { children: [
836
+ o && /* @__PURE__ */ s(T, { children: [
837
837
  /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
838
- /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1", children: [
839
- /* @__PURE__ */ e(ua, { className: "h-2.5 w-2.5" }),
838
+ /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1", children: [
839
+ /* @__PURE__ */ e(ma, { className: "h-2.5 w-2.5" }),
840
840
  o
841
841
  ] })
842
842
  ] }),
843
- t.description && /* @__PURE__ */ n(G, { children: [
843
+ t.description && /* @__PURE__ */ s(T, { children: [
844
844
  /* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
845
845
  /* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: t.description })
846
846
  ] })
847
847
  ] })
848
848
  ] }),
849
- /* @__PURE__ */ n("div", { className: "flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100", children: [
850
- s && /* @__PURE__ */ e(
849
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100", children: [
850
+ n && /* @__PURE__ */ e(
851
851
  "span",
852
852
  {
853
853
  role: "button",
@@ -860,115 +860,115 @@ function Zs({
860
860
  },
861
861
  "aria-label": `Delete ${t.name}`,
862
862
  className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
863
- children: /* @__PURE__ */ e(pt, { className: "h-3 w-3" })
863
+ children: /* @__PURE__ */ e(mt, { className: "h-3 w-3" })
864
864
  }
865
865
  ),
866
- /* @__PURE__ */ e(fs, { className: "h-3.5 w-3.5 text-muted-foreground" })
866
+ /* @__PURE__ */ e(bn, { className: "h-3.5 w-3.5 text-muted-foreground" })
867
867
  ] })
868
868
  ]
869
869
  }
870
870
  );
871
871
  }
872
- function en({ onCreate: t }) {
873
- return /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
874
- /* @__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(ca, { className: "h-4 w-4" }) }),
872
+ function as({ onCreate: t }) {
873
+ return /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
874
+ /* @__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(ua, { className: "h-4 w-4" }) }),
875
875
  /* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: "No groups yet" }),
876
876
  /* @__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." }),
877
- /* @__PURE__ */ n(
877
+ /* @__PURE__ */ s(
878
878
  "button",
879
879
  {
880
880
  type: "button",
881
881
  onClick: t,
882
882
  className: "mt-1 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",
883
883
  children: [
884
- /* @__PURE__ */ e(H, { className: "h-3 w-3" }),
884
+ /* @__PURE__ */ e(K, { className: "h-3 w-3" }),
885
885
  "New group"
886
886
  ]
887
887
  }
888
888
  )
889
889
  ] });
890
890
  }
891
- function tn({
891
+ function rs({
892
892
  group: t,
893
- isTenantViewer: s,
893
+ isTenantViewer: n,
894
894
  canEdit: r,
895
895
  canDelete: a,
896
896
  canManageMembers: o,
897
897
  onBack: c,
898
- onMembersChanged: h,
899
- onUpdated: l,
898
+ onMembersChanged: m,
899
+ onUpdated: p,
900
900
  onRequestDelete: b
901
901
  }) {
902
902
  const {
903
- data: x,
903
+ data: f,
904
904
  isLoading: d,
905
- error: u,
906
- refetch: g
907
- } = br(t.id), p = (x == null ? void 0 : x.members) ?? Js, y = u ? wa(u, "Unable to load members for this group.") : null, N = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: C } = xr({
905
+ error: h,
906
+ refetch: x
907
+ } = br(t.id), u = (f == null ? void 0 : f.members) ?? Yn, v = h ? Na(h, "Unable to load members for this group.") : null, N = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: D } = xr({
908
908
  type: N,
909
909
  tenantId: t.tenantId || void 0,
910
910
  active: !0,
911
911
  limit: 200
912
- }), S = X(
913
- () => new Set(p.map((f) => f.userId)),
914
- [p]
915
- ), m = Qs(), B = Ws(), V = js(), [w, M] = v(!1), [k, ee] = v(t.name), [_e, q] = v(!1), [re, j] = v(t.description || ""), [se, ne] = v(""), [qe, oe] = v(!1), De = X(() => {
916
- const f = se.trim().toLowerCase();
917
- return C.filter((F) => !S.has(F.id)).filter(
918
- (F) => !f || (F.name || "").toLowerCase().includes(f) || (F.email || "").toLowerCase().includes(f)
912
+ }), R = Z(
913
+ () => new Set(u.map((g) => g.userId)),
914
+ [u]
915
+ ), I = Jn(), B = Xn(), S = Qn(), [l, $] = y(!1), [G, z] = y(t.name), [L, k] = y(!1), [te, ae] = y(t.description || ""), [Q, we] = y(""), [Ne, De] = y(!1), Ce = Z(() => {
916
+ const g = Q.trim().toLowerCase();
917
+ return D.filter((_) => !R.has(_.id)).filter(
918
+ (_) => !g || (_.name || "").toLowerCase().includes(g) || (_.email || "").toLowerCase().includes(g)
919
919
  ).slice(0, 50);
920
- }, [C, S, se]), te = async () => {
921
- const f = k.trim();
922
- if (M(!1), f.length >= 3 && f !== t.name)
920
+ }, [D, R, Q]), ke = async () => {
921
+ const g = G.trim();
922
+ if ($(!1), g.length >= 3 && g !== t.name)
923
923
  try {
924
- await V.mutateAsync({
924
+ await S.mutateAsync({
925
925
  groupId: t.id,
926
- data: { name: f }
927
- }), l();
926
+ data: { name: g }
927
+ }), p();
928
928
  } catch {
929
929
  }
930
- }, Ce = async () => {
931
- const f = re.trim();
932
- if (q(!1), f !== (t.description || ""))
930
+ }, se = async () => {
931
+ const g = te.trim();
932
+ if (k(!1), g !== (t.description || ""))
933
933
  try {
934
- await V.mutateAsync({
934
+ await S.mutateAsync({
935
935
  groupId: t.id,
936
- data: { description: f }
937
- }), l();
936
+ data: { description: g }
937
+ }), p();
938
938
  } catch {
939
939
  }
940
- }, ke = async (f) => {
940
+ }, Se = async (g) => {
941
941
  if (o) {
942
- ne(""), oe(!1);
942
+ we(""), De(!1);
943
943
  try {
944
- await m.mutateAsync({
944
+ await I.mutateAsync({
945
945
  groupId: t.id,
946
946
  data: {
947
- userIds: [f.id],
947
+ userIds: [g.id],
948
948
  userType: N === "tenant" ? "tenant" : "org"
949
949
  }
950
- }), g(), h();
950
+ }), x(), m();
951
951
  } catch {
952
952
  }
953
953
  }
954
- }, He = async (f) => {
954
+ }, oe = async (g) => {
955
955
  if (o)
956
956
  try {
957
957
  await B.mutateAsync({
958
958
  groupId: t.id,
959
- data: { userIds: [f] }
960
- }), g(), h();
959
+ data: { userIds: [g] }
960
+ }), x(), m();
961
961
  } catch {
962
962
  }
963
963
  };
964
- let K = "";
964
+ let re = "";
965
965
  try {
966
- K = ha(new Date(t.createdAt), "MMM d, yyyy");
966
+ re = pa(new Date(t.createdAt), "MMM d, yyyy");
967
967
  } catch {
968
- K = "";
968
+ re = "";
969
969
  }
970
- return /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
971
- /* @__PURE__ */ n("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
970
+ return /* @__PURE__ */ s("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
971
+ /* @__PURE__ */ s("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
972
972
  /* @__PURE__ */ e(
973
973
  "button",
974
974
  {
@@ -976,18 +976,18 @@ function tn({
976
976
  onClick: c,
977
977
  "aria-label": "Back",
978
978
  className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
979
- children: /* @__PURE__ */ e(la, { className: "h-3.5 w-3.5" })
979
+ children: /* @__PURE__ */ e(ca, { className: "h-3.5 w-3.5" })
980
980
  }
981
981
  ),
982
- w ? /* @__PURE__ */ e(
982
+ l ? /* @__PURE__ */ e(
983
983
  "input",
984
984
  {
985
985
  autoFocus: !0,
986
- value: k,
987
- onChange: (f) => ee(f.target.value),
988
- onBlur: te,
989
- onKeyDown: (f) => {
990
- f.key === "Enter" && te(), f.key === "Escape" && (ee(t.name), M(!1));
986
+ value: G,
987
+ onChange: (g) => z(g.target.value),
988
+ onBlur: ke,
989
+ onKeyDown: (g) => {
990
+ g.key === "Enter" && ke(), g.key === "Escape" && (z(t.name), $(!1));
991
991
  },
992
992
  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"
993
993
  }
@@ -996,7 +996,7 @@ function tn({
996
996
  {
997
997
  type: "button",
998
998
  onClick: () => {
999
- r && (ee(t.name), M(!0));
999
+ r && (z(t.name), $(!0));
1000
1000
  },
1001
1001
  title: r ? "Click to rename" : t.name,
1002
1002
  disabled: !r,
@@ -1004,41 +1004,41 @@ function tn({
1004
1004
  children: t.name
1005
1005
  }
1006
1006
  ),
1007
- /* @__PURE__ */ n("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
1008
- /* @__PURE__ */ e(pa, { className: "h-2.5 w-2.5" }),
1009
- p.length,
1007
+ /* @__PURE__ */ s("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
1008
+ /* @__PURE__ */ e(fa, { className: "h-2.5 w-2.5" }),
1009
+ u.length,
1010
1010
  " member",
1011
- p.length === 1 ? "" : "s"
1011
+ u.length === 1 ? "" : "s"
1012
1012
  ] })
1013
1013
  ] }),
1014
- /* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: _e ? /* @__PURE__ */ n("div", { children: [
1014
+ /* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: L ? /* @__PURE__ */ s("div", { children: [
1015
1015
  /* @__PURE__ */ e(
1016
1016
  "textarea",
1017
1017
  {
1018
1018
  autoFocus: !0,
1019
1019
  rows: 2,
1020
- value: re,
1021
- onChange: (f) => j(f.target.value),
1020
+ value: te,
1021
+ onChange: (g) => ae(g.target.value),
1022
1022
  maxLength: 200,
1023
- onKeyDown: (f) => {
1024
- f.key === "Escape" && (j(t.description || ""), q(!1)), f.key === "Enter" && (f.metaKey || f.ctrlKey) && Ce();
1023
+ onKeyDown: (g) => {
1024
+ g.key === "Escape" && (ae(t.description || ""), k(!1)), g.key === "Enter" && (g.metaKey || g.ctrlKey) && se();
1025
1025
  },
1026
1026
  placeholder: "What is this group for?",
1027
1027
  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"
1028
1028
  }
1029
1029
  ),
1030
- /* @__PURE__ */ n("div", { className: "mt-1.5 flex items-center justify-between", children: [
1031
- /* @__PURE__ */ n("span", { className: "text-[10.5px] text-muted-foreground", children: [
1032
- re.length,
1030
+ /* @__PURE__ */ s("div", { className: "mt-1.5 flex items-center justify-between", children: [
1031
+ /* @__PURE__ */ s("span", { className: "text-[10.5px] text-muted-foreground", children: [
1032
+ te.length,
1033
1033
  "/200 · Esc to cancel · ⌘↩ to save"
1034
1034
  ] }),
1035
- /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
1035
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
1036
1036
  /* @__PURE__ */ e(
1037
1037
  "button",
1038
1038
  {
1039
1039
  type: "button",
1040
1040
  onClick: () => {
1041
- j(t.description || ""), q(!1);
1041
+ ae(t.description || ""), k(!1);
1042
1042
  },
1043
1043
  className: "h-6 rounded-[5px] px-2 text-[11px] font-medium text-foreground/80 hover:bg-accent",
1044
1044
  children: "Cancel"
@@ -1048,162 +1048,162 @@ function tn({
1048
1048
  "button",
1049
1049
  {
1050
1050
  type: "button",
1051
- onClick: Ce,
1051
+ onClick: se,
1052
1052
  className: "inline-flex h-6 items-center rounded-[5px] bg-foreground px-2 text-[11px] font-medium text-background hover:opacity-90",
1053
1053
  children: "Save"
1054
1054
  }
1055
1055
  )
1056
1056
  ] })
1057
1057
  ] })
1058
- ] }) : /* @__PURE__ */ n(
1058
+ ] }) : /* @__PURE__ */ s(
1059
1059
  "button",
1060
1060
  {
1061
1061
  type: "button",
1062
1062
  onClick: () => {
1063
- r && (j(t.description || ""), q(!0));
1063
+ r && (ae(t.description || ""), k(!0));
1064
1064
  },
1065
1065
  disabled: !r,
1066
1066
  title: r ? "Click to edit description" : void 0,
1067
1067
  className: "block w-full rounded-[3px] px-1 py-0.5 text-left enabled:hover:bg-accent/40 disabled:cursor-default",
1068
1068
  children: [
1069
1069
  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: r ? "Add a description…" : "No description" }),
1070
- /* @__PURE__ */ n("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
1071
- K ? `Created ${K}` : "Recently created",
1070
+ /* @__PURE__ */ s("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
1071
+ re ? `Created ${re}` : "Recently created",
1072
1072
  r ? " · You can edit this group" : ""
1073
1073
  ] })
1074
1074
  ]
1075
1075
  }
1076
1076
  ) }),
1077
1077
  o && /* @__PURE__ */ e(
1078
- rn,
1078
+ ss,
1079
1079
  {
1080
- query: se,
1081
- setQuery: ne,
1082
- open: qe,
1083
- setOpen: oe,
1084
- candidates: De,
1085
- showKindChip: !s,
1086
- onAdd: ke,
1087
- busy: m.isPending
1080
+ query: Q,
1081
+ setQuery: we,
1082
+ open: Ne,
1083
+ setOpen: De,
1084
+ candidates: Ce,
1085
+ showKindChip: !n,
1086
+ onAdd: Se,
1087
+ busy: I.isPending
1088
1088
  }
1089
1089
  ),
1090
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: d ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((f) => /* @__PURE__ */ e(
1090
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: d ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(
1091
1091
  "div",
1092
1092
  {
1093
1093
  className: "h-10 animate-pulse rounded-[4px] bg-muted/60"
1094
1094
  },
1095
- f
1096
- )) }) : y ? /* @__PURE__ */ e(
1097
- Na,
1095
+ g
1096
+ )) }) : v ? /* @__PURE__ */ e(
1097
+ Da,
1098
1098
  {
1099
1099
  title: "Can't load members",
1100
- message: y,
1101
- onRetry: () => g()
1100
+ message: v,
1101
+ onRetry: () => x()
1102
1102
  }
1103
- ) : p.length === 0 ? /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
1103
+ ) : u.length === 0 ? /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
1104
1104
  /* @__PURE__ */ e("div", { className: "text-[12px] text-foreground", children: "No members yet" }),
1105
1105
  /* @__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." })
1106
- ] }) : p.map((f) => {
1107
- var F, Q, W, ie, J, de;
1108
- return /* @__PURE__ */ n(
1106
+ ] }) : u.map((g) => {
1107
+ var _, ie, Ie, W, J, X;
1108
+ return /* @__PURE__ */ s(
1109
1109
  "div",
1110
1110
  {
1111
1111
  className: "group flex items-center gap-2 border-b border-border/60 px-5 py-2",
1112
1112
  children: [
1113
- /* @__PURE__ */ e(Da, { name: ((F = f.user) == null ? void 0 : F.name) || ((Q = f.user) == null ? void 0 : Q.email) || "?" }),
1114
- /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
1115
- /* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((W = f.user) == null ? void 0 : W.name) || ((ie = f.user) == null ? void 0 : ie.email) || "Unknown" }),
1116
- ((J = f.user) == null ? void 0 : J.email) && f.user.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: f.user.email })
1113
+ /* @__PURE__ */ e(Ca, { name: ((_ = g.user) == null ? void 0 : _.name) || ((ie = g.user) == null ? void 0 : ie.email) || "?" }),
1114
+ /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
1115
+ /* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((Ie = g.user) == null ? void 0 : Ie.name) || ((W = g.user) == null ? void 0 : W.email) || "Unknown" }),
1116
+ ((J = g.user) == null ? void 0 : J.email) && g.user.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: g.user.email })
1117
1117
  ] }),
1118
- !s && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: f.userType }),
1118
+ !n && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: g.userType }),
1119
1119
  /* @__PURE__ */ e(
1120
1120
  "button",
1121
1121
  {
1122
1122
  type: "button",
1123
- onClick: () => He(f.userId),
1123
+ onClick: () => oe(g.userId),
1124
1124
  disabled: !o || B.isPending,
1125
- "aria-label": `Remove ${((de = f.user) == null ? void 0 : de.name) || "member"}`,
1125
+ "aria-label": `Remove ${((X = g.user) == null ? void 0 : X.name) || "member"}`,
1126
1126
  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",
1127
- children: /* @__PURE__ */ e(ma, { className: "h-3 w-3" })
1127
+ children: /* @__PURE__ */ e(ha, { className: "h-3 w-3" })
1128
1128
  }
1129
1129
  )
1130
1130
  ]
1131
1131
  },
1132
- f.id
1132
+ g.id
1133
1133
  );
1134
1134
  }) }),
1135
- a && /* @__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__ */ n(
1135
+ a && /* @__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(
1136
1136
  "button",
1137
1137
  {
1138
1138
  type: "button",
1139
1139
  onClick: b,
1140
1140
  className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] border border-rose-200 bg-background px-2.5 text-[12px] font-medium text-rose-600 hover:bg-rose-50 dark:border-rose-900/60 dark:text-rose-400 dark:hover:bg-rose-950/30",
1141
1141
  children: [
1142
- /* @__PURE__ */ e(pt, { className: "h-3 w-3" }),
1142
+ /* @__PURE__ */ e(mt, { className: "h-3 w-3" }),
1143
1143
  "Delete group"
1144
1144
  ]
1145
1145
  }
1146
1146
  ) })
1147
1147
  ] });
1148
1148
  }
1149
- function an({
1149
+ function ns({
1150
1150
  isTenantUser: t,
1151
- tenantId: s,
1151
+ tenantId: n,
1152
1152
  onCancel: r,
1153
1153
  onCreated: a
1154
1154
  }) {
1155
- const [o, c] = v(""), [h, l] = v(""), [b, x] = v(null), d = Hs(), u = o.trim().length >= 3 && o.trim().length <= 50, g = async () => {
1156
- if (!u) return;
1157
- x(null);
1158
- const p = {
1155
+ const [o, c] = y(""), [m, p] = y(""), [b, f] = y(null), d = Kn(), h = o.trim().length >= 3 && o.trim().length <= 50, x = async () => {
1156
+ if (!h) return;
1157
+ f(null);
1158
+ const u = {
1159
1159
  name: o.trim(),
1160
- description: h.trim() || void 0,
1160
+ description: m.trim() || void 0,
1161
1161
  type: t ? "TENANT_GROUP" : "ORG_GROUP",
1162
- ...t && s ? { tenantId: s } : {}
1162
+ ...t && n ? { tenantId: n } : {}
1163
1163
  };
1164
1164
  try {
1165
- const y = await d.mutateAsync(p), N = y == null ? void 0 : y.id;
1165
+ const v = await d.mutateAsync(u), N = v == null ? void 0 : v.id;
1166
1166
  N ? a(N) : r();
1167
- } catch (y) {
1168
- x(y instanceof Error ? y.message : "Failed to create group");
1167
+ } catch (v) {
1168
+ f(v instanceof Error ? v.message : "Failed to create group");
1169
1169
  }
1170
1170
  };
1171
- return /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
1172
- /* @__PURE__ */ n("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
1173
- /* @__PURE__ */ e(Zt, { children: "Name" }),
1171
+ return /* @__PURE__ */ s("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
1172
+ /* @__PURE__ */ s("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
1173
+ /* @__PURE__ */ e(ea, { children: "Name" }),
1174
1174
  /* @__PURE__ */ e(
1175
1175
  "input",
1176
1176
  {
1177
1177
  autoFocus: !0,
1178
1178
  value: o,
1179
- onChange: (p) => c(p.target.value),
1179
+ onChange: (u) => c(u.target.value),
1180
1180
  placeholder: "Marketing leads, North America sales, …",
1181
1181
  maxLength: 50,
1182
1182
  className: "mt-1 block h-7 w-full rounded-[5px] border border-border bg-background px-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
1183
1183
  }
1184
1184
  ),
1185
1185
  /* @__PURE__ */ e("div", { className: "mt-1 text-[10.5px] text-muted-foreground", children: "3–50 characters." }),
1186
- /* @__PURE__ */ n("div", { className: "mt-4", children: [
1187
- /* @__PURE__ */ e(Zt, { children: "Description (optional)" }),
1186
+ /* @__PURE__ */ s("div", { className: "mt-4", children: [
1187
+ /* @__PURE__ */ e(ea, { children: "Description (optional)" }),
1188
1188
  /* @__PURE__ */ e(
1189
1189
  "textarea",
1190
1190
  {
1191
1191
  rows: 2,
1192
- value: h,
1193
- onChange: (p) => l(p.target.value),
1192
+ value: m,
1193
+ onChange: (u) => p(u.target.value),
1194
1194
  maxLength: 200,
1195
1195
  placeholder: "What is this group for?",
1196
1196
  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"
1197
1197
  }
1198
1198
  ),
1199
- /* @__PURE__ */ n("div", { className: "mt-1 flex justify-end text-[10.5px] text-muted-foreground", children: [
1200
- h.length,
1199
+ /* @__PURE__ */ s("div", { className: "mt-1 flex justify-end text-[10.5px] text-muted-foreground", children: [
1200
+ m.length,
1201
1201
  "/200"
1202
1202
  ] })
1203
1203
  ] }),
1204
1204
  b && /* @__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: b })
1205
1205
  ] }),
1206
- /* @__PURE__ */ n("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: [
1206
+ /* @__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: [
1207
1207
  /* @__PURE__ */ e(
1208
1208
  "button",
1209
1209
  {
@@ -1218,14 +1218,14 @@ function an({
1218
1218
  "button",
1219
1219
  {
1220
1220
  type: "button",
1221
- onClick: g,
1222
- disabled: !u || d.isPending,
1221
+ onClick: x,
1222
+ disabled: !h || d.isPending,
1223
1223
  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",
1224
- children: d.isPending ? /* @__PURE__ */ n(G, { children: [
1225
- /* @__PURE__ */ e($e, { className: "h-3 w-3 animate-spin" }),
1224
+ children: d.isPending ? /* @__PURE__ */ s(T, { children: [
1225
+ /* @__PURE__ */ e(ze, { className: "h-3 w-3 animate-spin" }),
1226
1226
  "Creating…"
1227
- ] }) : /* @__PURE__ */ n(G, { children: [
1228
- /* @__PURE__ */ e(H, { className: "h-3 w-3" }),
1227
+ ] }) : /* @__PURE__ */ s(T, { children: [
1228
+ /* @__PURE__ */ e(K, { className: "h-3 w-3" }),
1229
1229
  "Create group"
1230
1230
  ] })
1231
1231
  }
@@ -1233,75 +1233,75 @@ function an({
1233
1233
  ] })
1234
1234
  ] });
1235
1235
  }
1236
- function rn({
1236
+ function ss({
1237
1237
  query: t,
1238
- setQuery: s,
1238
+ setQuery: n,
1239
1239
  open: r,
1240
1240
  setOpen: a,
1241
1241
  candidates: o,
1242
1242
  showKindChip: c,
1243
- onAdd: h,
1244
- busy: l
1243
+ onAdd: m,
1244
+ busy: p
1245
1245
  }) {
1246
- const b = Jt(null), x = Jt(null), [d, u] = v(null);
1247
- as(() => {
1246
+ const b = Xt(null), f = Xt(null), [d, h] = y(null);
1247
+ rn(() => {
1248
1248
  if (!r) {
1249
- u(null);
1249
+ h(null);
1250
1250
  return;
1251
1251
  }
1252
- const p = () => {
1253
- const y = b.current;
1254
- if (!y) return;
1255
- const N = y.getBoundingClientRect(), C = 240, m = window.innerHeight - N.bottom < C + 16 && N.top > C;
1256
- u({
1252
+ const u = () => {
1253
+ const v = b.current;
1254
+ if (!v) return;
1255
+ const N = v.getBoundingClientRect(), D = 240, I = window.innerHeight - N.bottom < D + 16 && N.top > D;
1256
+ h({
1257
1257
  left: N.left,
1258
- top: m ? N.top - 6 : N.bottom + 6,
1258
+ top: I ? N.top - 6 : N.bottom + 6,
1259
1259
  width: N.width,
1260
- above: m
1260
+ above: I
1261
1261
  });
1262
1262
  };
1263
- return p(), window.addEventListener("resize", p), window.addEventListener("scroll", p, !0), () => {
1264
- window.removeEventListener("resize", p), window.removeEventListener("scroll", p, !0);
1263
+ return u(), window.addEventListener("resize", u), window.addEventListener("scroll", u, !0), () => {
1264
+ window.removeEventListener("resize", u), window.removeEventListener("scroll", u, !0);
1265
1265
  };
1266
- }, [r, o.length]), ze(() => {
1266
+ }, [r, o.length]), _e(() => {
1267
1267
  if (!r) return;
1268
- const p = (y) => {
1269
- var C, S;
1270
- const N = y.target;
1271
- (C = b.current) != null && C.contains(N) || (S = x.current) != null && S.contains(N) || a(!1);
1268
+ const u = (v) => {
1269
+ var D, R;
1270
+ const N = v.target;
1271
+ (D = b.current) != null && D.contains(N) || (R = f.current) != null && R.contains(N) || a(!1);
1272
1272
  };
1273
- return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
1273
+ return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
1274
1274
  }, [r, a]);
1275
- const g = r && o.length > 0 && d;
1276
- return /* @__PURE__ */ n("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: [
1277
- /* @__PURE__ */ n(
1275
+ const x = r && o.length > 0 && d;
1276
+ return /* @__PURE__ */ s("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: [
1277
+ /* @__PURE__ */ s(
1278
1278
  "div",
1279
1279
  {
1280
1280
  ref: b,
1281
1281
  className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40",
1282
1282
  children: [
1283
- /* @__PURE__ */ e(ks, { className: "h-3 w-3 text-muted-foreground" }),
1283
+ /* @__PURE__ */ e(In, { className: "h-3 w-3 text-muted-foreground" }),
1284
1284
  /* @__PURE__ */ e(
1285
1285
  "input",
1286
1286
  {
1287
1287
  value: t,
1288
- onChange: (p) => {
1289
- s(p.target.value), a(!0);
1288
+ onChange: (u) => {
1289
+ n(u.target.value), a(!0);
1290
1290
  },
1291
1291
  onFocus: () => a(!0),
1292
1292
  placeholder: "Add a member by name or email…",
1293
- disabled: l,
1293
+ disabled: p,
1294
1294
  className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed"
1295
1295
  }
1296
1296
  )
1297
1297
  ]
1298
1298
  }
1299
1299
  ),
1300
- g && typeof document < "u" && ss(
1300
+ x && typeof document < "u" && sn(
1301
1301
  /* @__PURE__ */ e(
1302
1302
  "div",
1303
1303
  {
1304
- ref: x,
1304
+ ref: f,
1305
1305
  style: {
1306
1306
  position: "fixed",
1307
1307
  left: d.left,
@@ -1310,22 +1310,22 @@ function rn({
1310
1310
  transform: d.above ? "translateY(-100%)" : void 0
1311
1311
  },
1312
1312
  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)]",
1313
- children: o.map((p) => /* @__PURE__ */ n(
1313
+ children: o.map((u) => /* @__PURE__ */ s(
1314
1314
  "button",
1315
1315
  {
1316
1316
  type: "button",
1317
- onClick: () => h(p),
1317
+ onClick: () => m(u),
1318
1318
  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",
1319
1319
  children: [
1320
- /* @__PURE__ */ e(Da, { name: p.name || p.email || "?" }),
1321
- /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
1322
- /* @__PURE__ */ e("div", { className: "truncate text-[12px] font-medium text-foreground", children: p.name || p.email || "Unknown" }),
1323
- p.email && p.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: p.email })
1320
+ /* @__PURE__ */ e(Ca, { name: u.name || u.email || "?" }),
1321
+ /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
1322
+ /* @__PURE__ */ e("div", { className: "truncate text-[12px] font-medium text-foreground", children: u.name || u.email || "Unknown" }),
1323
+ u.email && u.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: u.email })
1324
1324
  ] }),
1325
- c && p.type && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: p.type === "tenant" ? "tenant" : "org" })
1325
+ c && u.type && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: u.type === "tenant" ? "tenant" : "org" })
1326
1326
  ]
1327
1327
  },
1328
- p.id
1328
+ u.id
1329
1329
  ))
1330
1330
  }
1331
1331
  ),
@@ -1333,22 +1333,22 @@ function rn({
1333
1333
  )
1334
1334
  ] });
1335
1335
  }
1336
- function wa(t, s) {
1337
- if (!t) return s;
1336
+ function Na(t, n) {
1337
+ if (!t) return n;
1338
1338
  if (t instanceof Error) {
1339
1339
  const r = t.message || "", a = r.match(/\{[\s\S]*"error"\s*:\s*"([^"]+)"[\s\S]*\}/);
1340
- return a ? a[1] : r || s;
1340
+ return a ? a[1] : r || n;
1341
1341
  }
1342
- return typeof t == "string" ? t : s;
1342
+ return typeof t == "string" ? t : n;
1343
1343
  }
1344
- function Na({
1344
+ function Da({
1345
1345
  title: t,
1346
- message: s,
1346
+ message: n,
1347
1347
  onRetry: r
1348
1348
  }) {
1349
- return /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-2 px-6 py-10 text-center", children: [
1349
+ return /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center gap-2 px-6 py-10 text-center", children: [
1350
1350
  /* @__PURE__ */ e("div", { className: "text-[12.5px] font-medium text-foreground", children: t }),
1351
- /* @__PURE__ */ e("div", { className: "max-w-[360px] text-[11.5px] leading-[1.55] text-muted-foreground", children: s }),
1351
+ /* @__PURE__ */ e("div", { className: "max-w-[360px] text-[11.5px] leading-[1.55] text-muted-foreground", children: n }),
1352
1352
  r && /* @__PURE__ */ e(
1353
1353
  "button",
1354
1354
  {
@@ -1360,76 +1360,76 @@ function Na({
1360
1360
  )
1361
1361
  ] });
1362
1362
  }
1363
- function Zt({ children: t }) {
1363
+ function ea({ children: t }) {
1364
1364
  return /* @__PURE__ */ e("label", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: t });
1365
1365
  }
1366
- function Da({ name: t }) {
1367
- const s = t.split(" ").map((r) => r[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
1368
- return /* @__PURE__ */ e(va, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ e(ya, { className: "text-[9px] font-semibold", children: s || "?" }) });
1366
+ function Ca({ name: t }) {
1367
+ const n = t.split(" ").map((r) => r[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
1368
+ return /* @__PURE__ */ e(ya, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ e(wa, { className: "text-[9px] font-semibold", children: n || "?" }) });
1369
1369
  }
1370
- function ge(t, s, r) {
1371
- var c, h;
1370
+ function pe(t, n, r) {
1371
+ var c, m;
1372
1372
  const a = (t.controls || []).find(
1373
- (l) => l.id === r
1373
+ (p) => p.id === r
1374
1374
  );
1375
1375
  if (a)
1376
1376
  return a.label;
1377
- const o = (h = (c = sa(t, s)) == null ? void 0 : c.controls) == null ? void 0 : h.find(
1378
- (l) => l.id === r
1377
+ const o = (m = (c = sa(t, n)) == null ? void 0 : c.controls) == null ? void 0 : m.find(
1378
+ (p) => p.id === r
1379
1379
  );
1380
1380
  return (o == null ? void 0 : o.label) || r;
1381
1381
  }
1382
- function be(t, s) {
1382
+ function fe(t, n) {
1383
1383
  var r;
1384
- return ((r = sa(t, s)) == null ? void 0 : r.title) || s;
1384
+ return ((r = sa(t, n)) == null ? void 0 : r.title) || n;
1385
1385
  }
1386
- function sn(t) {
1387
- const { errors: s, dashboard: r } = t;
1386
+ function os(t) {
1387
+ const { errors: n, dashboard: r } = t;
1388
1388
  if (!r)
1389
- return s;
1389
+ return n;
1390
1390
  const a = /* @__PURE__ */ new Map();
1391
- for (const o of s) {
1391
+ for (const o of n) {
1392
1392
  const c = o.match(
1393
1393
  /^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
1394
1394
  );
1395
1395
  if (c) {
1396
- const [, d, u] = c, g = `${d}:${u}:missing-metric`;
1397
- a.has(g) || a.set(
1398
- g,
1399
- `"${be(r, d)}" has an outdated "${ge(
1396
+ const [, d, h] = c, x = `${d}:${h}:missing-metric`;
1397
+ a.has(x) || a.set(
1398
+ x,
1399
+ `"${fe(r, d)}" has an outdated "${pe(
1400
1400
  r,
1401
1401
  d,
1402
- u
1402
+ h
1403
1403
  )}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
1404
1404
  );
1405
1405
  continue;
1406
1406
  }
1407
- const h = o.match(
1407
+ const m = o.match(
1408
1408
  /^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
1409
1409
  );
1410
- if (h) {
1411
- const [, d, u] = h, g = `${d}:${u}:missing-group-by`;
1412
- a.has(g) || a.set(
1413
- g,
1414
- `"${be(r, d)}" has an outdated "${ge(
1410
+ if (m) {
1411
+ const [, d, h] = m, x = `${d}:${h}:missing-group-by`;
1412
+ a.has(x) || a.set(
1413
+ x,
1414
+ `"${fe(r, d)}" has an outdated "${pe(
1415
1415
  r,
1416
1416
  d,
1417
- u
1417
+ h
1418
1418
  )}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
1419
1419
  );
1420
1420
  continue;
1421
1421
  }
1422
- const l = o.match(
1422
+ const p = o.match(
1423
1423
  /^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
1424
1424
  );
1425
- if (l) {
1426
- const [, d, u] = l, g = `${d}:${u}:invalid-metric`;
1427
- a.has(g) || a.set(
1428
- g,
1429
- `"${be(r, d)}" has an invalid "${ge(
1425
+ if (p) {
1426
+ const [, d, h] = p, x = `${d}:${h}:invalid-metric`;
1427
+ a.has(x) || a.set(
1428
+ x,
1429
+ `"${fe(r, d)}" has an invalid "${pe(
1430
1430
  r,
1431
1431
  d,
1432
- u
1432
+ h
1433
1433
  )}" metric mapping. Open the card controls and choose a valid metric for each option.`
1434
1434
  );
1435
1435
  continue;
@@ -1438,28 +1438,28 @@ function sn(t) {
1438
1438
  /^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
1439
1439
  );
1440
1440
  if (b) {
1441
- const [, d, u] = b, g = `${d}:${u}:invalid-group-by`;
1442
- a.has(g) || a.set(
1443
- g,
1444
- `"${be(r, d)}" has an invalid "${ge(
1441
+ const [, d, h] = b, x = `${d}:${h}:invalid-group-by`;
1442
+ a.has(x) || a.set(
1443
+ x,
1444
+ `"${fe(r, d)}" has an invalid "${pe(
1445
1445
  r,
1446
1446
  d,
1447
- u
1447
+ h
1448
1448
  )}" field mapping. Open the card controls and choose a valid field for each option.`
1449
1449
  );
1450
1450
  continue;
1451
1451
  }
1452
- const x = o.match(
1452
+ const f = o.match(
1453
1453
  /^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
1454
1454
  );
1455
- if (x) {
1456
- const [, d, u] = x, g = `${d}:${u}:missing-temporal-group-by`;
1457
- a.has(g) || a.set(
1458
- g,
1459
- `"${be(r, d)}" can no longer use "${ge(
1455
+ if (f) {
1456
+ const [, d, h] = f, x = `${d}:${h}:missing-temporal-group-by`;
1457
+ a.has(x) || a.set(
1458
+ x,
1459
+ `"${fe(r, d)}" can no longer use "${pe(
1460
1460
  r,
1461
1461
  d,
1462
- u
1462
+ h
1463
1463
  )}" for time grain because the card does not currently group by a date field.`
1464
1464
  );
1465
1465
  continue;
@@ -1468,309 +1468,315 @@ function sn(t) {
1468
1468
  }
1469
1469
  return Array.from(a.values());
1470
1470
  }
1471
- function nn({
1471
+ function is({
1472
1472
  visible: t,
1473
- onSelect: s
1473
+ onSelect: n
1474
1474
  }) {
1475
- return t ? /* @__PURE__ */ n(T, { onSelect: s, children: [
1475
+ return t ? /* @__PURE__ */ s(O, { onSelect: n, children: [
1476
1476
  /* @__PURE__ */ e(yr, { className: "h-3.5 w-3.5" }),
1477
1477
  "Schedule email report"
1478
1478
  ] }) : null;
1479
1479
  }
1480
- function on({
1480
+ function ds({
1481
1481
  scheduleReportVisible: t,
1482
- analyticalBriefingVisible: s,
1482
+ analyticalBriefingVisible: n,
1483
1483
  onScheduleReport: r,
1484
1484
  onCreateAnalyticalBriefing: a
1485
1485
  }) {
1486
- return /* @__PURE__ */ n(G, { children: [
1486
+ return /* @__PURE__ */ s(T, { children: [
1487
1487
  /* @__PURE__ */ e(
1488
- nn,
1488
+ is,
1489
1489
  {
1490
1490
  visible: t,
1491
1491
  onSelect: r
1492
1492
  }
1493
1493
  ),
1494
- s ? /* @__PURE__ */ n(T, { onSelect: a, children: [
1495
- /* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
1494
+ n ? /* @__PURE__ */ s(O, { onSelect: a, children: [
1495
+ /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5" }),
1496
1496
  "Create analytical briefing"
1497
1497
  ] }) : null
1498
1498
  ] });
1499
1499
  }
1500
- function ea(t, s) {
1500
+ function ta(t, n) {
1501
1501
  return {
1502
- dashboard: dt(t),
1503
- semanticExecutionPayload: dt(s)
1502
+ dashboard: ot(t),
1503
+ semanticExecutionPayload: ot(n)
1504
1504
  };
1505
1505
  }
1506
- function En() {
1507
- var Ut, Rt, Vt, Ft, Ot, Tt, Gt, Bt;
1508
- ns(), os();
1506
+ function Ls() {
1507
+ var Ut, Rt, Vt, Ft, Ot;
1508
+ on(), dn();
1509
1509
  const {
1510
1510
  authToken: t,
1511
- tokenProps: s,
1511
+ tokenProps: n,
1512
1512
  id: r,
1513
1513
  showBriefings: a
1514
- } = _(), o = wr(), { isLocalDev: c, preferences: h } = Nr(), l = ((Ut = h == null ? void 0 : h.uiMode) == null ? void 0 : Ut.inspection) === !0, { openBrandStudioPreview: b } = Dr(), { permissions: x } = Ps(), d = Cr(), { isLoading: u } = kr(), g = D((i) => i.theme), p = D((i) => i.isDownloadingPdf), y = D(
1514
+ } = j(), o = wr(), { isLocalDev: c } = Nr(), {
1515
+ canEditDashboard: m,
1516
+ hasInspectionUser: p,
1517
+ inspectionMessage: b,
1518
+ isInspectionMode: f,
1519
+ isInspectionSurface: d
1520
+ } = Dr(), { openBrandStudioPreview: h } = Cr(), { permissions: x } = Rn(), u = kr(), { isLoading: v } = Sr(), N = w((i) => i.theme), D = w((i) => i.isDownloadingPdf), R = w(
1515
1521
  (i) => i.dashboardAssistantDraftScopeKey
1516
- ), N = D((i) => i.lenses), C = D((i) => i.selectedLensId), S = N == null ? void 0 : N.find((i) => i.id === C), m = D((i) => i.dashboard), B = D((i) => i.selectedSheetId), V = (Rt = m == null ? void 0 : m.sheets) == null ? void 0 : Rt.find(
1517
- (i) => i.id === B
1518
- ), w = Ja(V), M = w ? (Vt = V == null ? void 0 : V.document) == null ? void 0 : Vt.page : void 0, k = D(
1522
+ ), I = w((i) => i.lenses), B = w((i) => i.selectedLensId), S = I == null ? void 0 : I.find((i) => i.id === B), l = w((i) => i.dashboard), $ = w((i) => i.selectedSheetId), G = (Ut = l == null ? void 0 : l.sheets) == null ? void 0 : Ut.find(
1523
+ (i) => i.id === $
1524
+ ), z = Za(G), L = z ? (Rt = G == null ? void 0 : G.document) == null ? void 0 : Rt.page : void 0, k = w(
1519
1525
  (i) => i.isDashboardEditing
1520
- ), { setDashboardTitle: ee } = D((i) => i.actions), [_e, q] = v(!1), [re, j] = v(!1), [se, ne] = v(!1), [qe, oe] = v(!1), [De, te] = v(null), [Ce, ke] = v(!1), [He, K] = v(!1), [f, F] = v(!1), [Q, W] = v(null), [ie, J] = v([]), [de, Se] = v(!1), [Ca, vt] = v(!1), yt = D((i) => i.filterValues), A = D((i) => i.isVisualEditing);
1521
- zt((i) => i.card);
1522
- const le = Te(
1526
+ ), { setDashboardTitle: te } = w((i) => i.actions), [ae, Q] = y(!1), [we, Ne] = y(!1), [De, Ce] = y(!1), [ke, se] = y(!1), [Se, oe] = y(null), [re, g] = y(!1), [_, ie] = y(!1), [Ie, W] = y(!1), [J, X] = y(null), [bt, Me] = y([]), [xt, Ee] = y(!1), [ka, vt] = y(!1), yt = w((i) => i.filterValues), A = w((i) => i.isVisualEditing);
1527
+ Gt((i) => i.card);
1528
+ const Sa = Ge(
1523
1529
  (i) => i.selectedDashboard
1524
- ), Ie = Te(
1530
+ ), Ia = Ge(
1525
1531
  (i) => i.initialDashboard
1526
1532
  );
1527
- Te((i) => i.selectedVisual), D((i) => i.selectedFrameId), zt((i) => i.frame);
1528
- const Me = le ? (Ot = le == null ? void 0 : le.permissions) == null ? void 0 : Ot.canEdit : (Ft = Ie == null ? void 0 : Ie.permissions) == null ? void 0 : Ft.canEdit, wt = D(
1533
+ Ge((i) => i.selectedVisual), w((i) => i.selectedFrameId), Gt((i) => i.frame);
1534
+ const wt = w(
1529
1535
  (i) => i.showDashboardJSON
1530
- ), je = D((i) => i.onSaveFunction), {
1536
+ ), qe = w((i) => i.onSaveFunction), {
1531
1537
  setIsDashboardEditing: Nt,
1532
1538
  setShowDashboardJSON: Dt
1533
- } = D((i) => i.actions), { setInitialDashboard: Ct, clearSelectedDashboard: Ke } = Te(
1539
+ } = w((i) => i.actions), { setInitialDashboard: Ct, clearSelectedDashboard: He } = Ge(
1534
1540
  (i) => i.actions
1535
- ), ce = !!s.orgUserId || !!(s.tenantId && s.endUserId && s.endUserEmail), { resources: Ee } = Sr(st.DASHBOARD), { data: Qe } = Ir(), ka = ((Tt = Qe == null ? void 0 : Qe.preference) == null ? void 0 : Tt.defaultDashboardId) || null, { mutate: Sa, isPending: Ia } = Mr(), { currentUser: Ma } = ht(), Ea = Er(Ma), $ = le || Ie, ae = Lr({
1536
- config: s.config,
1537
- canNavigateDashboardHub: ce,
1538
- canShareDashboard: ((Gt = $ == null ? void 0 : $.permissions) == null ? void 0 : Gt.canShare) === !0,
1539
- canManageGroups: Ea
1540
- }), kt = $ ? {
1541
- id: $.id,
1542
- title: (m == null ? void 0 : m.title) || $.title || "Dashboard"
1543
- } : null, { handleAddNewFrame: La } = Ar(), [We, Je] = v(!1), [Aa, ue] = v(!1), [Ye, Le] = v("close"), me = Pr(st.DASHBOARD), [L, Ae] = v(null), Pa = async (i, E) => {
1544
- if (!l) {
1545
- if (!(m != null && m.id)) {
1541
+ ), de = !!n.orgUserId || !!(n.tenantId && n.endUserId && n.endUserEmail), { resources: Le } = Ir(at.DASHBOARD), { data: je } = Mr(), Ma = ((Vt = je == null ? void 0 : je.preference) == null ? void 0 : Vt.defaultDashboardId) || null, { mutate: Ea, isPending: La } = Er(), { currentUser: Aa } = ut(), Pa = Lr(Aa), q = Sa || Ia, ne = Ar({
1542
+ config: n.config,
1543
+ canNavigateDashboardHub: de,
1544
+ canShareDashboard: ((Ft = q == null ? void 0 : q.permissions) == null ? void 0 : Ft.canShare) === !0,
1545
+ canManageGroups: Pa
1546
+ }), kt = q ? {
1547
+ id: q.id,
1548
+ title: (l == null ? void 0 : l.title) || q.title || "Dashboard"
1549
+ } : null, { handleAddNewFrame: Ua } = Pr(), [Ke, Qe] = y(!1), [Ra, le] = y(!1), [We, Ae] = y("close"), ce = Ur(at.DASHBOARD), [E, Pe] = y(null), Va = async (i, M) => {
1550
+ if (!f) {
1551
+ if (!(l != null && l.id)) {
1546
1552
  console.log("No dashboard ID found");
1547
1553
  return;
1548
1554
  }
1549
1555
  console.log("Updating dashboard title:", {
1550
- dashboardId: m.id,
1556
+ dashboardId: l.id,
1551
1557
  newTitle: i,
1552
- previousTitle: E
1553
- }), me.mutate(
1558
+ previousTitle: M
1559
+ }), ce.mutate(
1554
1560
  {
1555
- resourceId: m.id,
1561
+ resourceId: l.id,
1556
1562
  data: { title: i }
1557
1563
  },
1558
1564
  {
1559
1565
  onSuccess: () => {
1560
- console.log("Dashboard title updated successfully"), I.success("Dashboard title updated");
1566
+ console.log("Dashboard title updated successfully"), C.success("Dashboard title updated");
1561
1567
  },
1562
- onError: (O) => {
1563
- console.error("Failed to update dashboard title:", O), I.error("Failed to update dashboard title"), ee(E);
1568
+ onError: (F) => {
1569
+ console.error("Failed to update dashboard title:", F), C.error("Failed to update dashboard title"), te(M);
1564
1570
  }
1565
1571
  }
1566
1572
  );
1567
1573
  }
1568
1574
  };
1569
- ze(() => {
1570
- if (Ee && Ee.length > 0) {
1571
- const i = m == null ? void 0 : m.id;
1575
+ _e(() => {
1576
+ if (Le && Le.length > 0) {
1577
+ const i = l == null ? void 0 : l.id;
1572
1578
  if (i) {
1573
- const E = Ee.find(
1574
- (O) => O.id === i
1579
+ const M = Le.find(
1580
+ (F) => F.id === i
1575
1581
  );
1576
- E && Ct(E);
1582
+ M && Ct(M);
1577
1583
  }
1578
1584
  }
1579
- }, [Ee, m == null ? void 0 : m.id, Ct]);
1580
- const he = s.orgUserId || s.tenantId, Xe = X(
1581
- () => dn({
1585
+ }, [Le, l == null ? void 0 : l.id, Ct]);
1586
+ const ue = n.orgUserId || n.tenantId, Je = Z(
1587
+ () => ls({
1582
1588
  accessToken: t == null ? void 0 : t.accessToken,
1583
- dashboardId: (m == null ? void 0 : m.id) || r || s.dashboard_id,
1584
- selectedSheetId: w ? B : void 0,
1585
- pageSize: M == null ? void 0 : M.size,
1586
- orientation: M == null ? void 0 : M.orientation,
1587
- theme: g
1589
+ dashboardId: (l == null ? void 0 : l.id) || r || n.dashboard_id,
1590
+ selectedSheetId: z ? $ : void 0,
1591
+ pageSize: L == null ? void 0 : L.size,
1592
+ orientation: L == null ? void 0 : L.orientation,
1593
+ theme: N
1588
1594
  }),
1589
1595
  [
1590
1596
  t == null ? void 0 : t.accessToken,
1591
1597
  r,
1592
- m == null ? void 0 : m.id,
1593
- w,
1594
- M == null ? void 0 : M.orientation,
1595
- M == null ? void 0 : M.size,
1596
- B,
1597
- g,
1598
- s.dashboard_id
1598
+ l == null ? void 0 : l.id,
1599
+ z,
1600
+ L == null ? void 0 : L.orientation,
1601
+ L == null ? void 0 : L.size,
1602
+ $,
1603
+ N,
1604
+ n.dashboard_id
1599
1605
  ]
1600
- ), St = k && !A && !l && he && Me, { setDashboard: Ze } = D((i) => i.actions), It = D(
1606
+ ), St = k && !A && !f && ue && m, { setDashboard: Xe } = w((i) => i.actions), It = w(
1601
1607
  (i) => i.semanticExecutionPayload
1602
- ), Ua = () => {
1608
+ ), Fa = () => {
1603
1609
  Nt(!0);
1604
- }, Pe = () => {
1605
- Nt(!1), Dt(!1), Ae(null);
1610
+ }, Ue = () => {
1611
+ Nt(!1), Dt(!1), Pe(null);
1606
1612
  };
1607
- ze(() => {
1613
+ _e(() => {
1608
1614
  if (!k) {
1609
- L && Ae(null);
1615
+ E && Pe(null);
1610
1616
  return;
1611
1617
  }
1612
- L || !m || u || Ae(
1613
- ea(
1614
- m,
1618
+ E || !l || v || Pe(
1619
+ ta(
1620
+ l,
1615
1621
  It
1616
1622
  )
1617
1623
  );
1618
1624
  }, [
1619
- m,
1620
- L,
1625
+ l,
1626
+ E,
1621
1627
  k,
1622
- u,
1628
+ v,
1623
1629
  It
1624
1630
  ]);
1625
- const Ue = (L == null ? void 0 : L.dashboard) ?? null, { isDirty: Mt, isDirtyPending: Ra, resetDirty: pe } = bs(
1626
- m,
1627
- Ue,
1631
+ const Re = (E == null ? void 0 : E.dashboard) ?? null, { isDirty: Mt, isDirtyPending: Oa, resetDirty: me } = vn(
1632
+ l,
1633
+ Re,
1628
1634
  300,
1629
1635
  1e3,
1630
- nt
1631
- ), Et = rs(() => Ue ? nt(m) !== nt(Ue) : !1, [m, Ue]), Lt = Mt || Ra, Re = We || me.isPending, Va = () => {
1632
- if (l) {
1633
- L && Ze(L.dashboard, {
1634
- semanticExecutionPayload: L.semanticExecutionPayload
1635
- }), Pe(), pe();
1636
+ rt
1637
+ ), Et = nn(() => Re ? rt(l) !== rt(Re) : !1, [l, Re]), Lt = Mt || Oa, Ve = Ke || ce.isPending, Ta = () => {
1638
+ if (f) {
1639
+ E && Xe(E.dashboard, {
1640
+ semanticExecutionPayload: E.semanticExecutionPayload
1641
+ }), Ue(), me();
1636
1642
  return;
1637
1643
  }
1638
- Et() ? (Le("close"), ue(!0)) : (Pe(), pe());
1639
- }, Fa = async () => {
1640
- await et({
1644
+ Et() ? (Ae("close"), le(!0)) : (Ue(), me());
1645
+ }, Ga = async () => {
1646
+ await Ye({
1641
1647
  closeAfterSave: !0,
1642
- navigateHomeAfterSave: Ye === "home"
1648
+ navigateHomeAfterSave: We === "home"
1643
1649
  });
1644
- }, Oa = () => {
1645
- const i = Ye === "home" && !!ce;
1646
- L && Ze(L.dashboard, {
1647
- semanticExecutionPayload: L.semanticExecutionPayload
1648
- }), Pe(), i && Ke(), Le("close"), ue(!1), pe();
1649
- }, Ta = () => {
1650
- L && (Ze(L.dashboard, {
1651
- semanticExecutionPayload: L.semanticExecutionPayload
1652
- }), pe());
1653
- }, Ga = () => {
1654
- if (ce) {
1650
+ }, Ba = () => {
1651
+ const i = We === "home" && !!de;
1652
+ E && Xe(E.dashboard, {
1653
+ semanticExecutionPayload: E.semanticExecutionPayload
1654
+ }), Ue(), i && He(), Ae("close"), le(!1), me();
1655
+ }, $a = () => {
1656
+ E && (Xe(E.dashboard, {
1657
+ semanticExecutionPayload: E.semanticExecutionPayload
1658
+ }), me());
1659
+ }, za = () => {
1660
+ if (de) {
1655
1661
  if (k && Et()) {
1656
- Le("home"), ue(!0);
1662
+ Ae("home"), le(!0);
1657
1663
  return;
1658
1664
  }
1659
- Ke();
1665
+ He();
1660
1666
  }
1661
1667
  };
1662
- async function et(i) {
1663
- if (l)
1668
+ async function Ye(i) {
1669
+ if (f)
1664
1670
  return;
1665
- const E = D.getState().dashboard;
1666
- if (!E)
1671
+ const M = w.getState().dashboard;
1672
+ if (!M)
1667
1673
  return;
1668
- const O = (i == null ? void 0 : i.closeAfterSave) ?? de, tt = (i == null ? void 0 : i.navigateHomeAfterSave) ?? !1;
1669
- Se(O), O && ue(!1);
1670
- const at = dt(E);
1671
- F(!0), W(null), J([]), Je(!0);
1672
- const Ha = {
1673
- template: E
1674
+ const F = (i == null ? void 0 : i.closeAfterSave) ?? xt, Ze = (i == null ? void 0 : i.navigateHomeAfterSave) ?? !1;
1675
+ Ee(F), F && le(!1);
1676
+ const et = ot(M);
1677
+ W(!0), X(null), Me([]), Qe(!0);
1678
+ const Qa = {
1679
+ template: M
1674
1680
  };
1675
- me.mutate(
1681
+ ce.mutate(
1676
1682
  {
1677
- resourceId: E.id,
1678
- data: Ha
1683
+ resourceId: M.id,
1684
+ data: Qa
1679
1685
  },
1680
1686
  {
1681
1687
  onSuccess: (P) => {
1682
- var Ve, Fe, $t;
1683
- const Y = (P == null ? void 0 : P.id) || ((Ve = P == null ? void 0 : P.dashboard) == null ? void 0 : Ve.id) || ((Fe = P == null ? void 0 : P.resource) == null ? void 0 : Fe.id) || (($t = P == null ? void 0 : P.template) == null ? void 0 : $t.id) || null;
1684
- if (!E.id && Y) {
1685
- const rt = ar.getState(), Oe = rt.pendingDashboardDraftMigration;
1686
- (Oe == null ? void 0 : Oe.scopeKey) === y ? rt.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
1688
+ var Fe, Oe, Tt;
1689
+ const Y = (P == null ? void 0 : P.id) || ((Fe = P == null ? void 0 : P.dashboard) == null ? void 0 : Fe.id) || ((Oe = P == null ? void 0 : P.resource) == null ? void 0 : Oe.id) || ((Tt = P == null ? void 0 : P.template) == null ? void 0 : Tt.id) || null;
1690
+ if (!M.id && Y) {
1691
+ const tt = ar.getState(), Te = tt.pendingDashboardDraftMigration;
1692
+ (Te == null ? void 0 : Te.scopeKey) === R ? tt.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
1687
1693
  Y
1688
- ) : Oe && rt.actions.clearPendingDashboardDraftMigration();
1694
+ ) : Te && tt.actions.clearPendingDashboardDraftMigration();
1689
1695
  }
1690
- Je(!1), I.success("Dashboard saved!"), Ae(
1691
- ea(
1692
- at,
1693
- D.getState().semanticExecutionPayload
1696
+ Qe(!1), C.success("Dashboard saved!"), Pe(
1697
+ ta(
1698
+ et,
1699
+ w.getState().semanticExecutionPayload
1694
1700
  )
1695
- ), F(!1), Se(!1), O && (Pe(), pe(), tt && ce && Ke()), Le("close");
1701
+ ), W(!1), Ee(!1), F && (Ue(), me(), Ze && de && He()), Ae("close");
1696
1702
  },
1697
1703
  onError: (P) => {
1698
- Je(!1), W("Failed to save dashboard. Please try again.");
1699
- const Y = P.details, Ve = Array.isArray(
1704
+ Qe(!1), X("Failed to save dashboard. Please try again.");
1705
+ const Y = P.details, Fe = Array.isArray(
1700
1706
  Y == null ? void 0 : Y.errors
1701
1707
  ) ? (Y.errors || []).filter(
1702
- (Fe) => typeof Fe == "string"
1708
+ (Oe) => typeof Oe == "string"
1703
1709
  ) : [];
1704
- J(
1705
- sn({
1706
- errors: Ve,
1707
- dashboard: E || void 0
1710
+ Me(
1711
+ os({
1712
+ errors: Fe,
1713
+ dashboard: M || void 0
1708
1714
  })
1709
- ), I.error("Failed to save dashboard");
1715
+ ), C.error("Failed to save dashboard");
1710
1716
  }
1711
1717
  }
1712
1718
  );
1713
1719
  }
1714
- async function Ba() {
1715
- if (l || (q(!0), !C || !S)) return;
1716
- const i = D.getState().dashboard;
1720
+ async function _a() {
1721
+ if (f || (Q(!0), !B || !S)) return;
1722
+ const i = w.getState().dashboard;
1717
1723
  if (!i) {
1718
- q(!1);
1724
+ Q(!1);
1719
1725
  return;
1720
1726
  }
1721
- const E = JSON.stringify(i), O = D.getState(), tt = fa({
1727
+ const M = JSON.stringify(i), F = w.getState(), Ze = ga({
1722
1728
  dashboard: i,
1723
- dashboardInputValues: O.dashboardInputValues,
1729
+ dashboardInputValues: F.dashboardInputValues,
1724
1730
  filterValues: yt,
1725
- controlValues: O.controlValues,
1726
- inlineFilterValuesMap: O.inlineFilterValuesMap,
1727
- cardControlValuesMap: O.cardControlValuesMap
1728
- }), at = {
1731
+ controlValues: F.controlValues,
1732
+ inlineFilterValuesMap: F.inlineFilterValuesMap,
1733
+ cardControlValuesMap: F.cardControlValuesMap
1734
+ }), et = {
1729
1735
  ...S,
1730
- template: E,
1736
+ template: M,
1731
1737
  filterValues: yt,
1732
- inputValues: tt
1738
+ inputValues: Ze
1733
1739
  };
1734
- await lt(
1735
- s.apiServiceUrl,
1736
- at,
1740
+ await it(
1741
+ n.apiServiceUrl,
1742
+ et,
1737
1743
  t == null ? void 0 : t.accessToken
1738
- ), I.success("Lens saved"), je == null || je(i), q(!1);
1744
+ ), C.success("Lens saved"), qe == null || qe(i), Q(!1);
1739
1745
  }
1740
- const At = (S == null ? void 0 : S.name) || m.title;
1741
- me.isPending && console.log("Title during update:", {
1746
+ const At = (S == null ? void 0 : S.name) || l.title;
1747
+ ce.isPending && console.log("Title during update:", {
1742
1748
  title: At,
1743
- dashboardStateTitle: m.title,
1744
- dashboardId: m == null ? void 0 : m.id,
1749
+ dashboardStateTitle: l.title,
1750
+ dashboardId: l == null ? void 0 : l.id,
1745
1751
  currentLensName: S == null ? void 0 : S.name
1746
1752
  });
1747
- const $a = ce && !!(t != null && t.accessToken) && !!(s != null && s.apiServiceUrl), za = !l && ae.showDashboardHub && $a, _a = !l && d && ae.showDashboardHub, z = (m == null ? void 0 : m.id) || null, Pt = Ur(
1748
- (Bt = s.config) == null ? void 0 : Bt.showBriefings,
1753
+ const qa = de && !!(t != null && t.accessToken) && !!(n != null && n.apiServiceUrl), Ha = !f && ne.showDashboardHub && qa, ja = !f && u && ne.showDashboardHub, H = (l == null ? void 0 : l.id) || null, Pt = Rr(
1754
+ (Ot = n.config) == null ? void 0 : Ot.showBriefings,
1749
1755
  a
1750
- ), fe = !!z && ka === z, qa = () => {
1751
- !z || l || Sa({
1752
- dashboardId: fe ? null : z
1756
+ ), he = !!H && Ma === H, Ka = () => {
1757
+ !H || f || Ea({
1758
+ dashboardId: he ? null : H
1753
1759
  });
1754
1760
  };
1755
- return !d && !A ? null : /* @__PURE__ */ n(
1761
+ return !u && !A ? null : /* @__PURE__ */ s(
1756
1762
  "div",
1757
1763
  {
1758
1764
  className: "flex h-11 shrink-0 items-center justify-between gap-2 overflow-x-auto border-b px-4 py-2",
1759
1765
  role: "dashboard-controls",
1760
1766
  children: [
1761
- /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1762
- _a && !A && /* @__PURE__ */ e(
1763
- qt,
1767
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
1768
+ ja && !A && /* @__PURE__ */ e(
1769
+ Ht,
1764
1770
  {
1765
1771
  "aria-label": "Dashboard Hub",
1766
1772
  tooltip: "Dashboard Hub",
1767
- onClick: Ga,
1773
+ onClick: za,
1768
1774
  className: "h-7 w-7 px-0",
1769
1775
  buttonProps: { size: "xs" },
1770
- children: /* @__PURE__ */ e(ia, { className: "h-3.5 w-3.5" })
1776
+ children: /* @__PURE__ */ e(da, { className: "h-3.5 w-3.5" })
1771
1777
  }
1772
1778
  ),
1773
- !A && d && (u ? /* @__PURE__ */ e(
1779
+ !A && u && (v ? /* @__PURE__ */ e(
1774
1780
  "div",
1775
1781
  {
1776
1782
  className: "h-4 w-28 animate-pulse rounded-md bg-muted/70",
@@ -1778,32 +1784,32 @@ function En() {
1778
1784
  role: "status",
1779
1785
  children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Loading dashboard title" })
1780
1786
  }
1781
- ) : /* @__PURE__ */ n(G, { children: [
1787
+ ) : /* @__PURE__ */ s(T, { children: [
1782
1788
  /* @__PURE__ */ e(
1783
- Rr,
1789
+ Vr,
1784
1790
  {
1785
1791
  value: At || "Untitled Dashboard",
1786
1792
  onSave: (i) => {
1787
1793
  console.log("EditableText onSave called:", {
1788
1794
  newTitle: i,
1789
- canEditDashboard: Me,
1790
- dashboardId: m == null ? void 0 : m.id
1795
+ canEditDashboard: m,
1796
+ dashboardId: l == null ? void 0 : l.id
1791
1797
  });
1792
- const E = (m == null ? void 0 : m.title) || "";
1793
- ee(i), Pa(i, E);
1798
+ const M = (l == null ? void 0 : l.title) || "";
1799
+ te(i), Va(i, M);
1794
1800
  },
1795
- isEditable: Vr({
1801
+ isEditable: Fr({
1796
1802
  isDashboardEditing: k,
1797
- canEditDashboard: Me === !0 && !l,
1803
+ canEditDashboard: m === !0 && !f,
1798
1804
  hasCurrentLens: !!S
1799
1805
  }),
1800
1806
  displayClassName: "text-[13px] font-medium",
1801
1807
  inputClassName: "text-[13px] font-medium",
1802
1808
  placeholder: "Dashboard Title",
1803
- isPending: me.isPending
1809
+ isPending: ce.isPending
1804
1810
  }
1805
1811
  ),
1806
- ae.showDashboardHub && fe && /* @__PURE__ */ e(
1812
+ ne.showDashboardHub && he && /* @__PURE__ */ e(
1807
1813
  "span",
1808
1814
  {
1809
1815
  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",
@@ -1811,140 +1817,154 @@ function En() {
1811
1817
  children: "Default"
1812
1818
  }
1813
1819
  ),
1814
- za && z && /* @__PURE__ */ e(Ya, { children: /* @__PURE__ */ n(Xa, { children: [
1815
- /* @__PURE__ */ e(Za, { asChild: !0, children: /* @__PURE__ */ e(
1816
- R,
1820
+ Ha && H && /* @__PURE__ */ e(Bt, { children: /* @__PURE__ */ s($t, { children: [
1821
+ /* @__PURE__ */ e(zt, { asChild: !0, children: /* @__PURE__ */ e(
1822
+ V,
1817
1823
  {
1818
1824
  variant: "ghost",
1819
1825
  size: "xs",
1820
- onClick: qa,
1821
- disabled: Ia || !(t != null && t.accessToken) || !(s != null && s.apiServiceUrl),
1826
+ onClick: Ka,
1827
+ disabled: La || !(t != null && t.accessToken) || !(n != null && n.apiServiceUrl),
1822
1828
  className: "w-7 px-0 text-muted-foreground hover:text-foreground",
1823
- "aria-label": fe ? "Clear default dashboard" : "Set as default dashboard",
1824
- children: fe ? /* @__PURE__ */ e(Fr, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(Or, { className: "h-3.5 w-3.5" })
1829
+ "aria-label": he ? "Clear default dashboard" : "Set as default dashboard",
1830
+ children: he ? /* @__PURE__ */ e(Or, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(Tr, { className: "h-3.5 w-3.5" })
1825
1831
  }
1826
1832
  ) }),
1827
- /* @__PURE__ */ e(er, { children: /* @__PURE__ */ e("p", { children: fe ? "Clear default" : "Set as default" }) })
1833
+ /* @__PURE__ */ e(_t, { children: /* @__PURE__ */ e("p", { children: he ? "Clear default" : "Set as default" }) })
1828
1834
  ] }) })
1829
1835
  ] }))
1830
1836
  ] }),
1831
- /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1832
- A && /* @__PURE__ */ n(G, { children: [
1833
- /* @__PURE__ */ e(is, {}),
1834
- /* @__PURE__ */ e(ds, {})
1837
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
1838
+ A && /* @__PURE__ */ s(T, { children: [
1839
+ /* @__PURE__ */ e(ln, {}),
1840
+ /* @__PURE__ */ e(cn, {})
1835
1841
  ] }),
1836
- !A && d && !l && ae.showDashboardSharing && /* @__PURE__ */ n(
1837
- R,
1842
+ !A && u && !f && ne.showDashboardSharing && /* @__PURE__ */ s(
1843
+ V,
1838
1844
  {
1839
1845
  variant: "outline",
1840
1846
  size: "xs",
1841
- onClick: () => j(!0),
1847
+ onClick: () => Ne(!0),
1842
1848
  children: [
1843
- /* @__PURE__ */ e(Tr, { className: "h-3.5 w-3.5" }),
1849
+ /* @__PURE__ */ e(Gr, { className: "h-3.5 w-3.5" }),
1844
1850
  "Share"
1845
1851
  ]
1846
1852
  }
1847
1853
  ),
1848
- !A && k && !l && x.canUseFilters && d && /* @__PURE__ */ e(ls, {}),
1849
- k && !A && !l && he && S && c && d && /* @__PURE__ */ n(
1850
- R,
1854
+ !A && k && !f && x.canUseFilters && u && /* @__PURE__ */ e(un, {}),
1855
+ k && !A && !f && ue && S && c && u && /* @__PURE__ */ s(
1856
+ V,
1851
1857
  {
1852
1858
  variant: "secondary",
1853
1859
  size: "xs",
1854
- disabled: _e,
1855
- onClick: Ba,
1860
+ disabled: ae,
1861
+ onClick: _a,
1856
1862
  children: [
1857
1863
  /* @__PURE__ */ e(Yt, { className: "h-3.5 w-3.5" }),
1858
1864
  "Save Lens"
1859
1865
  ]
1860
1866
  }
1861
1867
  ),
1862
- k && !A && !l && d && !w && /* @__PURE__ */ n("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
1863
- /* @__PURE__ */ n(
1864
- R,
1868
+ k && !A && !f && u && !z && /* @__PURE__ */ s("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
1869
+ /* @__PURE__ */ s(
1870
+ V,
1865
1871
  {
1866
1872
  variant: "ghost",
1867
1873
  size: "xs",
1868
1874
  disabled: !k,
1869
- onClick: () => void La(),
1875
+ onClick: () => void Ua(),
1870
1876
  className: "h-full rounded-none border-0 shadow-none hover:bg-accent",
1871
1877
  children: [
1872
- /* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
1878
+ /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5" }),
1873
1879
  "Visual"
1874
1880
  ]
1875
1881
  }
1876
1882
  ),
1877
- /* @__PURE__ */ n(Ht, { modal: !1, children: [
1878
- /* @__PURE__ */ e(jt, { asChild: !0, children: /* @__PURE__ */ e(
1879
- R,
1883
+ /* @__PURE__ */ s(jt, { modal: !1, children: [
1884
+ /* @__PURE__ */ e(Kt, { asChild: !0, children: /* @__PURE__ */ e(
1885
+ V,
1880
1886
  {
1881
1887
  variant: "ghost",
1882
1888
  size: "xs",
1883
1889
  className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
1884
1890
  "aria-label": "Open visual options",
1885
1891
  disabled: !k,
1886
- children: /* @__PURE__ */ e(ts, { className: "h-3.5 w-3.5" })
1892
+ children: /* @__PURE__ */ e(an, { className: "h-3.5 w-3.5" })
1887
1893
  }
1888
1894
  ) }),
1889
1895
  /* @__PURE__ */ e(
1890
- Kt,
1896
+ Qt,
1891
1897
  {
1892
1898
  align: "end",
1893
1899
  className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm",
1894
- children: /* @__PURE__ */ n(T, { onClick: () => vt(!0), children: [
1895
- /* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
1900
+ children: /* @__PURE__ */ s(O, { onClick: () => vt(!0), children: [
1901
+ /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5" }),
1896
1902
  "From library..."
1897
1903
  ] })
1898
1904
  }
1899
1905
  )
1900
1906
  ] }),
1901
1907
  /* @__PURE__ */ e(
1902
- cs,
1908
+ mn,
1903
1909
  {
1904
- open: Ca,
1910
+ open: ka,
1905
1911
  onOpenChange: vt
1906
1912
  }
1907
1913
  )
1908
1914
  ] }),
1909
- !A && !k && (Me || l) && d && /* @__PURE__ */ n(R, { size: "xs", onClick: Ua, children: [
1910
- /* @__PURE__ */ e(Gr, { className: "h-3.5 w-3.5" }),
1911
- l ? "Inspect" : "Edit"
1915
+ !A && !k && (m || f) && (!d || !p || m !== void 0) && u && /* @__PURE__ */ s("div", { className: "inline-flex items-center gap-1", children: [
1916
+ /* @__PURE__ */ s(V, { size: "xs", onClick: Fa, children: [
1917
+ /* @__PURE__ */ e(Br, { className: "h-3.5 w-3.5" }),
1918
+ f ? "Inspect" : "Edit"
1919
+ ] }),
1920
+ b ? /* @__PURE__ */ e(Bt, { children: /* @__PURE__ */ s($t, { children: [
1921
+ /* @__PURE__ */ e(zt, { asChild: !0, children: /* @__PURE__ */ e(
1922
+ "button",
1923
+ {
1924
+ type: "button",
1925
+ "aria-label": b,
1926
+ 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",
1927
+ children: /* @__PURE__ */ e(er, { "aria-hidden": "true", className: "size-3.5" })
1928
+ }
1929
+ ) }),
1930
+ /* @__PURE__ */ e(_t, { children: /* @__PURE__ */ e("p", { children: b }) })
1931
+ ] }) }) : null
1912
1932
  ] }),
1913
- St && d && Mt && /* @__PURE__ */ n(
1914
- R,
1933
+ St && u && Mt && /* @__PURE__ */ s(
1934
+ V,
1915
1935
  {
1916
1936
  variant: "outline",
1917
1937
  size: "xs",
1918
- onClick: Ta,
1919
- disabled: Re,
1938
+ onClick: $a,
1939
+ disabled: Ve,
1920
1940
  children: [
1921
- /* @__PURE__ */ e(Br, { className: "h-3.5 w-3.5" }),
1941
+ /* @__PURE__ */ e($r, { className: "h-3.5 w-3.5" }),
1922
1942
  "Undo"
1923
1943
  ]
1924
1944
  }
1925
1945
  ),
1926
- St && d && /* @__PURE__ */ n(
1927
- R,
1946
+ St && u && /* @__PURE__ */ s(
1947
+ V,
1928
1948
  {
1929
1949
  size: "xs",
1930
- className: ve(!Lt && "opacity-60"),
1931
- disabled: Re || !Lt,
1932
- onClick: () => et(),
1950
+ className: be(!Lt && "opacity-60"),
1951
+ disabled: Ve || !Lt,
1952
+ onClick: () => Ye(),
1933
1953
  children: [
1934
- Re ? /* @__PURE__ */ e($e, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Yt, { className: "h-3.5 w-3.5" }),
1935
- Re ? "Saving..." : "Save"
1954
+ Ve ? /* @__PURE__ */ e(ze, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Yt, { className: "h-3.5 w-3.5" }),
1955
+ Ve ? "Saving..." : "Save"
1936
1956
  ]
1937
1957
  }
1938
1958
  ),
1939
- k && !A && d && /* @__PURE__ */ n(R, { variant: "outline", size: "xs", onClick: Va, children: [
1940
- /* @__PURE__ */ e(da, { className: "h-3.5 w-3.5" }),
1959
+ k && !A && u && /* @__PURE__ */ s(V, { variant: "outline", size: "xs", onClick: Ta, children: [
1960
+ /* @__PURE__ */ e(la, { className: "h-3.5 w-3.5" }),
1941
1961
  "Close"
1942
1962
  ] }),
1943
- !A && d && /* @__PURE__ */ e("div", { className: "ml-2", children: /* @__PURE__ */ e(us, {}) }),
1944
- !A && c && /* @__PURE__ */ e(Ss, {}),
1945
- !A && d && !l && /* @__PURE__ */ n(Ht, { children: [
1946
- /* @__PURE__ */ e(jt, { asChild: !0, children: /* @__PURE__ */ e(
1947
- qt,
1963
+ !A && u && /* @__PURE__ */ e("div", { className: "ml-2", children: /* @__PURE__ */ e(hn, {}) }),
1964
+ !A && c && /* @__PURE__ */ e(Mn, {}),
1965
+ !A && u && !f && /* @__PURE__ */ s(jt, { children: [
1966
+ /* @__PURE__ */ e(Kt, { asChild: !0, children: /* @__PURE__ */ e(
1967
+ Ht,
1948
1968
  {
1949
1969
  tooltip: "More Options",
1950
1970
  className: "w-7 px-0 text-muted-foreground hover:text-foreground",
@@ -1953,240 +1973,240 @@ function En() {
1953
1973
  variant: "ghost",
1954
1974
  "aria-label": "More dashboard options"
1955
1975
  },
1956
- children: /* @__PURE__ */ e($r, { className: "h-3.5 w-3.5" })
1976
+ children: /* @__PURE__ */ e(zr, { className: "h-3.5 w-3.5" })
1957
1977
  }
1958
1978
  ) }),
1959
- /* @__PURE__ */ n(
1960
- Kt,
1979
+ /* @__PURE__ */ s(
1980
+ Qt,
1961
1981
  {
1962
1982
  align: "end",
1963
1983
  className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
1964
1984
  children: [
1965
- /* @__PURE__ */ e(xe, { children: "Reports & briefings" }),
1966
- /* @__PURE__ */ n(
1967
- T,
1985
+ /* @__PURE__ */ e(ge, { children: "Reports & briefings" }),
1986
+ /* @__PURE__ */ s(
1987
+ O,
1968
1988
  {
1969
- disabled: p,
1970
- onSelect: () => K(!0),
1989
+ disabled: D,
1990
+ onSelect: () => ie(!0),
1971
1991
  children: [
1972
- /* @__PURE__ */ e(zr, { className: "h-3.5 w-3.5" }),
1992
+ /* @__PURE__ */ e(_r, { className: "h-3.5 w-3.5" }),
1973
1993
  "Export"
1974
1994
  ]
1975
1995
  }
1976
1996
  ),
1977
1997
  /* @__PURE__ */ e(
1978
- on,
1998
+ ds,
1979
1999
  {
1980
- scheduleReportVisible: !!(Pt && o.surfaceVisible && z && !k),
1981
- analyticalBriefingVisible: !!(Pt && o.surfaceVisible && z && !k),
1982
- onScheduleReport: () => te("scheduled_report"),
1983
- onCreateAnalyticalBriefing: () => te("analytical_briefing")
2000
+ scheduleReportVisible: !!(Pt && o.surfaceVisible && H && !k),
2001
+ analyticalBriefingVisible: !!(Pt && o.surfaceVisible && H && !k),
2002
+ onScheduleReport: () => oe("scheduled_report"),
2003
+ onCreateAnalyticalBriefing: () => oe("analytical_briefing")
1984
2004
  }
1985
2005
  ),
1986
- /* @__PURE__ */ e(Be, {}),
1987
- ae.showGroupManagement && /* @__PURE__ */ n(G, { children: [
1988
- /* @__PURE__ */ e(xe, { children: "Access" }),
1989
- /* @__PURE__ */ n(
1990
- T,
2006
+ /* @__PURE__ */ e($e, {}),
2007
+ ne.showGroupManagement && /* @__PURE__ */ s(T, { children: [
2008
+ /* @__PURE__ */ e(ge, { children: "Access" }),
2009
+ /* @__PURE__ */ s(
2010
+ O,
1991
2011
  {
1992
- onClick: () => ne(!0),
2012
+ onClick: () => Ce(!0),
1993
2013
  children: [
1994
- /* @__PURE__ */ e(ca, { className: "h-3.5 w-3.5" }),
2014
+ /* @__PURE__ */ e(ua, { className: "h-3.5 w-3.5" }),
1995
2015
  "Manage Groups"
1996
2016
  ]
1997
2017
  }
1998
2018
  ),
1999
- /* @__PURE__ */ e(Be, {})
2019
+ /* @__PURE__ */ e($e, {})
2000
2020
  ] }),
2001
- /* @__PURE__ */ e(xe, { children: "Preferences" }),
2002
- /* @__PURE__ */ n(T, { onClick: () => oe(!0), children: [
2003
- /* @__PURE__ */ e(ua, { className: "h-3.5 w-3.5" }),
2021
+ /* @__PURE__ */ e(ge, { children: "Preferences" }),
2022
+ /* @__PURE__ */ s(O, { onClick: () => se(!0), children: [
2023
+ /* @__PURE__ */ e(ma, { className: "h-3.5 w-3.5" }),
2004
2024
  "Report preferences"
2005
2025
  ] }),
2006
- c && d && /* @__PURE__ */ n(G, { children: [
2007
- /* @__PURE__ */ e(Be, {}),
2008
- /* @__PURE__ */ e(xe, { children: "Developer" }),
2009
- /* @__PURE__ */ n(
2010
- T,
2026
+ c && u && /* @__PURE__ */ s(T, { children: [
2027
+ /* @__PURE__ */ e($e, {}),
2028
+ /* @__PURE__ */ e(ge, { children: "Developer" }),
2029
+ /* @__PURE__ */ s(
2030
+ O,
2011
2031
  {
2012
2032
  onSelect: () => {
2013
2033
  var i;
2014
2034
  t != null && t.accessToken && ((i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(t.accessToken).then(
2015
- () => I.success("Token copied to clipboard")
2016
- ).catch(() => I.error("Unable to copy token")) : I.error("Clipboard not available"));
2035
+ () => C.success("Token copied to clipboard")
2036
+ ).catch(() => C.error("Unable to copy token")) : C.error("Clipboard not available"));
2017
2037
  },
2018
2038
  children: [
2019
- /* @__PURE__ */ e(Qt, { className: "h-3.5 w-3.5" }),
2039
+ /* @__PURE__ */ e(Wt, { className: "h-3.5 w-3.5" }),
2020
2040
  "Copy token"
2021
2041
  ]
2022
2042
  }
2023
2043
  ),
2024
- w && /* @__PURE__ */ n(
2025
- T,
2044
+ z && /* @__PURE__ */ s(
2045
+ O,
2026
2046
  {
2027
- disabled: !Xe,
2047
+ disabled: !Je,
2028
2048
  onSelect: () => {
2029
2049
  var i;
2030
- if (!Xe) {
2031
- I.error(
2050
+ if (!Je) {
2051
+ C.error(
2032
2052
  "Open a document sheet with a token to copy the local PDF URL"
2033
2053
  );
2034
2054
  return;
2035
2055
  }
2036
- (i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(Xe).then(
2037
- () => I.success(
2056
+ (i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(Je).then(
2057
+ () => C.success(
2038
2058
  "Local document PDF URL copied to clipboard"
2039
2059
  )
2040
2060
  ).catch(
2041
- () => I.error(
2061
+ () => C.error(
2042
2062
  "Unable to copy local document PDF URL"
2043
2063
  )
2044
- ) : I.error("Clipboard not available");
2064
+ ) : C.error("Clipboard not available");
2045
2065
  },
2046
2066
  children: [
2047
- /* @__PURE__ */ e(Qt, { className: "h-3.5 w-3.5" }),
2067
+ /* @__PURE__ */ e(Wt, { className: "h-3.5 w-3.5" }),
2048
2068
  "Copy local document PDF URL"
2049
2069
  ]
2050
2070
  }
2051
2071
  ),
2052
- /* @__PURE__ */ n(
2053
- T,
2072
+ /* @__PURE__ */ s(
2073
+ O,
2054
2074
  {
2055
- onSelect: () => tr(s.apiServiceUrl),
2075
+ onSelect: () => tr(n.apiServiceUrl),
2056
2076
  children: [
2057
- /* @__PURE__ */ e(Ds, { className: "h-3.5 w-3.5" }),
2077
+ /* @__PURE__ */ e(kn, { className: "h-3.5 w-3.5" }),
2058
2078
  "Invalidate token"
2059
2079
  ]
2060
2080
  }
2061
2081
  ),
2062
- /* @__PURE__ */ n(T, { onSelect: b, children: [
2063
- /* @__PURE__ */ e(xs, { className: "h-3.5 w-3.5" }),
2082
+ /* @__PURE__ */ s(O, { onSelect: h, children: [
2083
+ /* @__PURE__ */ e(yn, { className: "h-3.5 w-3.5" }),
2064
2084
  "Brand Studio"
2065
2085
  ] }),
2066
- k && /* @__PURE__ */ n(
2067
- T,
2086
+ k && /* @__PURE__ */ s(
2087
+ O,
2068
2088
  {
2069
2089
  onSelect: () => Dt(!wt),
2070
2090
  children: [
2071
- /* @__PURE__ */ e(vs, { className: "h-3.5 w-3.5" }),
2091
+ /* @__PURE__ */ e(wn, { className: "h-3.5 w-3.5" }),
2072
2092
  wt ? "Hide dashboard JSON" : "Show dashboard JSON"
2073
2093
  ]
2074
2094
  }
2075
2095
  ),
2076
- he && k && /* @__PURE__ */ n(T, { onSelect: () => ke(!0), children: [
2077
- /* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
2096
+ ue && k && /* @__PURE__ */ s(O, { onSelect: () => g(!0), children: [
2097
+ /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5" }),
2078
2098
  "Add lens"
2079
2099
  ] }),
2080
- he && /* @__PURE__ */ n(_r, { children: [
2081
- /* @__PURE__ */ n(qr, { children: [
2082
- /* @__PURE__ */ e(ys, { className: "h-3.5 w-3.5" }),
2100
+ ue && /* @__PURE__ */ s(qr, { children: [
2101
+ /* @__PURE__ */ s(Hr, { children: [
2102
+ /* @__PURE__ */ e(Nn, { className: "h-3.5 w-3.5" }),
2083
2103
  "Lenses"
2084
2104
  ] }),
2085
- /* @__PURE__ */ e(Hr, { className: "w-60", children: /* @__PURE__ */ e(As, {}) })
2105
+ /* @__PURE__ */ e(jr, { className: "w-60", children: /* @__PURE__ */ e(Un, {}) })
2086
2106
  ] })
2087
2107
  ] })
2088
2108
  ]
2089
2109
  }
2090
2110
  )
2091
2111
  ] }),
2092
- re && kt && /* @__PURE__ */ e(
2093
- jr,
2112
+ we && kt && /* @__PURE__ */ e(
2113
+ Kr,
2094
2114
  {
2095
2115
  resource: kt,
2096
- resourceType: st.DASHBOARD,
2097
- onClose: () => j(!1)
2116
+ resourceType: at.DASHBOARD,
2117
+ onClose: () => Ne(!1)
2098
2118
  }
2099
2119
  ),
2100
- ae.showGroupManagement && /* @__PURE__ */ e(
2101
- Ys,
2120
+ ne.showGroupManagement && /* @__PURE__ */ e(
2121
+ Zn,
2102
2122
  {
2103
- open: se,
2104
- onOpenChange: ne
2123
+ open: De,
2124
+ onOpenChange: Ce
2105
2125
  }
2106
2126
  ),
2107
2127
  /* @__PURE__ */ e(
2108
- gs,
2128
+ xn,
2109
2129
  {
2110
- open: qe,
2111
- onOpenChange: oe
2130
+ open: ke,
2131
+ onOpenChange: se
2112
2132
  }
2113
2133
  ),
2114
- z && De ? /* @__PURE__ */ e(
2115
- ms,
2134
+ H && Se ? /* @__PURE__ */ e(
2135
+ pn,
2116
2136
  {
2117
- dashboardId: z,
2118
- dashboardTitle: (m == null ? void 0 : m.title) || ($ == null ? void 0 : $.title),
2137
+ dashboardId: H,
2138
+ dashboardTitle: (l == null ? void 0 : l.title) || (q == null ? void 0 : q.title),
2119
2139
  open: !0,
2120
2140
  onOpenChange: (i) => {
2121
- i || te(null);
2141
+ i || oe(null);
2122
2142
  },
2123
2143
  hideTrigger: !0,
2124
- workflowIntent: De
2144
+ workflowIntent: Se
2125
2145
  }
2126
2146
  ) : null,
2127
- c && he && d && /* @__PURE__ */ e(Ls, { open: Ce, onOpenChange: ke }),
2128
- d && /* @__PURE__ */ e(
2129
- Kr,
2147
+ c && ue && u && /* @__PURE__ */ e(Pn, { open: re, onOpenChange: g }),
2148
+ u && /* @__PURE__ */ e(
2149
+ Qr,
2130
2150
  {
2131
- open: He,
2132
- onOpenChange: K
2151
+ open: _,
2152
+ onOpenChange: ie
2133
2153
  }
2134
2154
  ),
2135
2155
  /* @__PURE__ */ e(
2136
- Qr,
2156
+ Wr,
2137
2157
  {
2138
- open: f,
2158
+ open: Ie,
2139
2159
  onOpenChange: (i) => {
2140
- !i && We && !Q || (F(i), i || (W(null), J([]), Se(!1)));
2160
+ !i && Ke && !J || (W(i), i || (X(null), Me([]), Ee(!1)));
2141
2161
  },
2142
- children: /* @__PURE__ */ n(Wr, { className: "max-w-sm", children: [
2143
- /* @__PURE__ */ n(Jr, { children: [
2144
- /* @__PURE__ */ e(Yr, { children: Q ? "Save failed" : "Saving dashboard" }),
2145
- /* @__PURE__ */ e(Xr, { className: "pt-2", children: Q ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
2146
- ie.length > 0 && /* @__PURE__ */ n("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
2162
+ children: /* @__PURE__ */ s(Jr, { className: "max-w-sm", children: [
2163
+ /* @__PURE__ */ s(Xr, { children: [
2164
+ /* @__PURE__ */ e(Yr, { children: J ? "Save failed" : "Saving dashboard" }),
2165
+ /* @__PURE__ */ e(Zr, { className: "pt-2", children: J ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
2166
+ bt.length > 0 && /* @__PURE__ */ s("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
2147
2167
  /* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
2148
- /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: ie.slice(0, 5).map((i) => /* @__PURE__ */ e("li", { children: i }, i)) })
2168
+ /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: bt.slice(0, 5).map((i) => /* @__PURE__ */ e("li", { children: i }, i)) })
2149
2169
  ] })
2150
2170
  ] }),
2151
- /* @__PURE__ */ e(Zr, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: Q ? /* @__PURE__ */ n(G, { children: [
2171
+ /* @__PURE__ */ e(en, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: J ? /* @__PURE__ */ s(T, { children: [
2152
2172
  /* @__PURE__ */ e(
2153
- es,
2173
+ tn,
2154
2174
  {
2155
2175
  onClick: () => {
2156
- F(!1), W(null), J([]), Se(!1);
2176
+ W(!1), X(null), Me([]), Ee(!1);
2157
2177
  },
2158
2178
  className: "m-0",
2159
2179
  children: "Close"
2160
2180
  }
2161
2181
  ),
2162
2182
  /* @__PURE__ */ e(
2163
- Wt,
2183
+ Jt,
2164
2184
  {
2165
- onClick: () => et({
2166
- closeAfterSave: de,
2167
- navigateHomeAfterSave: Ye === "home"
2185
+ onClick: () => Ye({
2186
+ closeAfterSave: xt,
2187
+ navigateHomeAfterSave: We === "home"
2168
2188
  }),
2169
2189
  className: "m-0",
2170
2190
  children: "Retry"
2171
2191
  }
2172
2192
  )
2173
- ] }) : /* @__PURE__ */ n(Wt, { disabled: !0, className: "m-0 cursor-default", children: [
2174
- /* @__PURE__ */ e($e, { className: "mr-2 h-4 w-4 animate-spin" }),
2193
+ ] }) : /* @__PURE__ */ s(Jt, { disabled: !0, className: "m-0 cursor-default", children: [
2194
+ /* @__PURE__ */ e(ze, { className: "mr-2 h-4 w-4 animate-spin" }),
2175
2195
  "Saving..."
2176
2196
  ] }) })
2177
2197
  ] })
2178
2198
  }
2179
2199
  ),
2180
2200
  /* @__PURE__ */ e(
2181
- hs,
2201
+ fn,
2182
2202
  {
2183
- open: Aa,
2203
+ open: Ra,
2184
2204
  onOpenChange: (i) => {
2185
- ue(i);
2205
+ le(i);
2186
2206
  },
2187
- onSave: Fa,
2188
- onDiscard: Oa,
2189
- isSaving: We,
2207
+ onSave: Ga,
2208
+ onDiscard: Ba,
2209
+ isSaving: Ke,
2190
2210
  saveLabel: "Save",
2191
2211
  discardLabel: "Discard"
2192
2212
  }
@@ -2196,9 +2216,9 @@ function En() {
2196
2216
  }
2197
2217
  );
2198
2218
  }
2199
- function dn({
2219
+ function ls({
2200
2220
  accessToken: t,
2201
- dashboardId: s,
2221
+ dashboardId: n,
2202
2222
  selectedSheetId: r,
2203
2223
  pageSize: a,
2204
2224
  orientation: o,
@@ -2206,11 +2226,11 @@ function dn({
2206
2226
  }) {
2207
2227
  if (!t || !r)
2208
2228
  return null;
2209
- const h = new URL("http://localhost:5173/print-document");
2210
- h.searchParams.set("token", t), s && h.searchParams.set("dashboardId", s), h.searchParams.set("selectedSheetId", r), c && h.searchParams.set("theme", c);
2211
- const l = new URL("http://127.0.0.1:3002/");
2212
- return l.searchParams.set("pdfMode", "document"), l.searchParams.set("pageSize", a || "letter"), l.searchParams.set("orientation", o || "portrait"), l.searchParams.set("url", h.toString()), l.toString();
2229
+ const m = new URL("http://localhost:5173/print-document");
2230
+ m.searchParams.set("token", t), n && m.searchParams.set("dashboardId", n), m.searchParams.set("selectedSheetId", r), c && m.searchParams.set("theme", c);
2231
+ const p = new URL("http://127.0.0.1:3002/");
2232
+ return p.searchParams.set("pdfMode", "document"), p.searchParams.set("pageSize", a || "letter"), p.searchParams.set("orientation", o || "portrait"), p.searchParams.set("url", m.toString()), p.toString();
2213
2233
  }
2214
2234
  export {
2215
- En as default
2235
+ Ls as default
2216
2236
  };