react-semaphor 0.1.114 → 0.1.116

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 (26) hide show
  1. package/dist/chunks/{dashboard-controls-BdvApPn1.js → dashboard-controls-CRc6gw-F.js} +4 -4
  2. package/dist/chunks/{dashboard-controls-Dx3SP8_O.js → dashboard-controls-CqcS1J54.js} +252 -239
  3. package/dist/chunks/{dashboard-json-CLmj5Xgn.js → dashboard-json-BOlcQgKG.js} +1 -1
  4. package/dist/chunks/{dashboard-json-BBUvHSx-.js → dashboard-json-D-75FAgQ.js} +1 -1
  5. package/dist/chunks/{edit-dashboard-visual-F01R1pb1.js → edit-dashboard-visual-COf6UbOg.js} +3 -3
  6. package/dist/chunks/{edit-dashboard-visual-DYXisS8S.js → edit-dashboard-visual-tRQ806YP.js} +1 -1
  7. package/dist/chunks/{editor-action-buttons-D-aEUYpS.js → editor-action-buttons-2B96j5tL.js} +1 -1
  8. package/dist/chunks/{editor-action-buttons-CCki6g0i.js → editor-action-buttons-Bh-TPwiy.js} +2 -2
  9. package/dist/chunks/{index-BB_Q9BeP.js → index-CRDKevb0.js} +9175 -9202
  10. package/dist/chunks/{index-C2IITrDh.js → index-F4v-XjnM.js} +158 -158
  11. package/dist/chunks/resource-management-panel-CwGyO8S9.js +6 -0
  12. package/dist/chunks/resource-management-panel-DtwM8NVN.js +895 -0
  13. package/dist/chunks/{schedule-dashboard-Bcu7Wcl2.js → schedule-dashboard-CtXspopT.js} +3 -3
  14. package/dist/chunks/{schedule-dashboard-CNmepTOh.js → schedule-dashboard-DWh6NWL5.js} +1 -1
  15. package/dist/chunks/{use-visual-utils-CQb_-z3Z.js → use-visual-utils-Ce0Sq8Hn.js} +1 -1
  16. package/dist/chunks/{use-visual-utils-VFO0nbRa.js → use-visual-utils-DyKq-_On.js} +1 -1
  17. package/dist/dashboard/index.cjs +1 -1
  18. package/dist/dashboard/index.js +1 -1
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.js +4 -4
  21. package/dist/style.css +1 -1
  22. package/dist/surfboard/index.cjs +1 -1
  23. package/dist/surfboard/index.js +1 -1
  24. package/package.json +1 -1
  25. package/dist/chunks/resource-management-panel-BWpWiCnv.js +0 -11
  26. package/dist/chunks/resource-management-panel-C6G5vwpR.js +0 -924
@@ -1,17 +1,17 @@
1
- import { jsxs as r, jsx as e, Fragment as E } from "react/jsx-runtime";
2
- import { b as J, bp as vs, bq as Ns, u as y, aC as Ce, aD as Se, B as k, aF as Me, aG as W, br as ke, g as Ve, aj as R, ao as oe, bs as ys, aU as Le, ap as ie, aq as le, ar as ce, as as Pe, at as te, bt as Q, ax as Qe, I as V, bu as ws, aW as xs, bv as Ds, bw as qe, bx as He, c as X, by as Be, bz as Cs, bA as Ss, bB as Ms, bC as ks, bD as Ls, l as C, O as ze, h as de, bE as ue, bF as Ke, av as Ps, bG as As, L as H, aR as $, bH as Is, bI as Es, bJ as Fs, bK as We, bL as Je, bM as re, bN as ne, bj as be, aM as ve, bO as Ne, aX as Xe, bP as ye, aw as Ye, a$ as Ze, bQ as Ts, b3 as Gs, b4 as Rs, b5 as Os, b6 as Us, b7 as qs, b8 as zs, b9 as $s, ba as js, bR as _s, aO as Vs, be as Qs, bS as Hs, bT as Bs, f as $e, aA as se, bU as Ks, R as fe, bV as Ws, bW as Js, bX as Xs, bY as Ys, N as Zs, bZ as ea, b_ as sa, b$ as aa, c0 as ta, J as ra } from "./index-BB_Q9BeP.js";
1
+ import { jsxs as r, jsx as e, Fragment as P } from "react/jsx-runtime";
2
+ import { b as J, bp as vs, bq as Ns, u as y, aC as Ce, aD as Se, B as M, aF as ke, aG as W, br as Me, g as Qe, aj as R, ao as oe, bs as ys, aP as Le, ap as ie, aq as le, ar as ce, as as Pe, at as te, bt as V, ax as Ve, I as _, bu as ws, aT as xs, bv as Ds, bw as qe, bx as He, c as X, by as Be, bz as Cs, bA as Ss, bB as ks, bC as Ms, bD as Ls, l as w, O as ze, h as de, bE as ue, bF as Ke, av as Ps, bG as As, L as H, aS as $, bH as Is, bI as Es, bJ as Fs, bK as We, bL as Je, bM as re, bN as ne, bm as be, a_ as ve, bO as Ne, aU as Xe, bP as ye, aw as Ye, aY as Ze, bQ as Ts, b1 as Gs, b2 as Rs, b3 as Os, b4 as Us, b5 as qs, b6 as zs, b7 as _s, b8 as $s, bR as js, aN as Qs, bh as Vs, bS as Hs, bT as Bs, f as _e, aA as se, bU as Ks, R as fe, bV as Ws, bW as Js, bX as Xs, bY as Ys, aQ as Zs, N as ea, bZ as sa, b_ as aa, b$ as ta, c0 as ra, J as na } from "./index-CRDKevb0.js";
3
3
  import * as S from "react";
4
- import { useState as w, useMemo as ae, useEffect as na } from "react";
4
+ import { useState as x, useMemo as ae, useEffect as oa } from "react";
5
5
  import "react-dom";
6
- import { g as we, A as oa, V as ia, S as la } from "./schedule-dashboard-Bcu7Wcl2.js";
7
- import { S as je } from "./editor-action-buttons-CCki6g0i.js";
6
+ import { g as we, A as ia, V as la, S as ca } from "./schedule-dashboard-CtXspopT.js";
7
+ import { S as $e } from "./editor-action-buttons-Bh-TPwiy.js";
8
8
  /**
9
9
  * @license lucide-react v0.453.0 - ISC
10
10
  *
11
11
  * This source code is licensed under the ISC license.
12
12
  * See the LICENSE file in the root directory of this source tree.
13
13
  */
14
- const ca = J("Glasses", [
14
+ const da = J("Glasses", [
15
15
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
16
16
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
17
17
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -24,7 +24,7 @@ const ca = J("Glasses", [
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
26
  */
27
- const da = J("Menu", [
27
+ const ua = J("Menu", [
28
28
  ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
29
29
  ["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
30
30
  ["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
@@ -35,7 +35,7 @@ const da = J("Menu", [
35
35
  * This source code is licensed under the ISC license.
36
36
  * See the LICENSE file in the root directory of this source tree.
37
37
  */
38
- const ua = J("Moon", [
38
+ const ma = J("Moon", [
39
39
  ["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
40
40
  ]);
41
41
  /**
@@ -44,7 +44,7 @@ const ua = J("Moon", [
44
44
  * This source code is licensed under the ISC license.
45
45
  * See the LICENSE file in the root directory of this source tree.
46
46
  */
47
- const ma = J("ShieldX", [
47
+ const ha = J("ShieldX", [
48
48
  [
49
49
  "path",
50
50
  {
@@ -61,7 +61,7 @@ const ma = J("ShieldX", [
61
61
  * This source code is licensed under the ISC license.
62
62
  * See the LICENSE file in the root directory of this source tree.
63
63
  */
64
- const ha = J("Sun", [
64
+ const pa = J("Sun", [
65
65
  ["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
66
66
  ["path", { d: "M12 2v2", key: "tus03m" }],
67
67
  ["path", { d: "M12 20v2", key: "1lh1kg" }],
@@ -72,22 +72,22 @@ const ha = J("Sun", [
72
72
  ["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
73
73
  ["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
74
74
  ]);
75
- var pa = vs();
76
- function ga() {
75
+ var ga = vs();
76
+ function fa() {
77
77
  const { setTheme: s } = Ns(), n = y(
78
78
  (a) => a.actions.setDashboardTheme
79
79
  );
80
80
  return /* @__PURE__ */ r(Ce, { children: [
81
- /* @__PURE__ */ e(Se, { asChild: !0, children: /* @__PURE__ */ r(k, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
81
+ /* @__PURE__ */ e(Se, { asChild: !0, children: /* @__PURE__ */ r(M, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
82
82
  /* @__PURE__ */ e(
83
- ha,
83
+ pa,
84
84
  {
85
85
  strokeWidth: 1.5,
86
86
  className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
87
87
  }
88
88
  ),
89
89
  /* @__PURE__ */ e(
90
- ua,
90
+ ma,
91
91
  {
92
92
  strokeWidth: 1.5,
93
93
  className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
@@ -95,7 +95,7 @@ function ga() {
95
95
  ),
96
96
  /* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle theme" })
97
97
  ] }) }),
98
- /* @__PURE__ */ r(Me, { align: "end", children: [
98
+ /* @__PURE__ */ r(ke, { align: "end", children: [
99
99
  /* @__PURE__ */ e(
100
100
  W,
101
101
  {
@@ -126,11 +126,11 @@ function ga() {
126
126
  ] })
127
127
  ] });
128
128
  }
129
- async function fa(s, n, a, t, i) {
129
+ async function ba(s, n, a, t, i) {
130
130
  if (!i)
131
131
  return null;
132
132
  const o = JSON.stringify(a), l = `${s}/v1/lens`;
133
- return await ke(l, i, {
133
+ return await Me(l, i, {
134
134
  name: n,
135
135
  template: o,
136
136
  filterValues: t,
@@ -141,7 +141,7 @@ async function xe(s, n, a) {
141
141
  if (!a)
142
142
  return null;
143
143
  const { id: t, template: i, filterValues: o, isDefault: l, shared: m } = n, h = `${s}/v1/lens`;
144
- return await ke(h, a, {
144
+ return await Me(h, a, {
145
145
  lensId: t,
146
146
  template: i,
147
147
  filterValues: o,
@@ -150,33 +150,33 @@ async function xe(s, n, a) {
150
150
  operation: "update"
151
151
  });
152
152
  }
153
- async function ba(s, n, a) {
153
+ async function va(s, n, a) {
154
154
  if (!a)
155
155
  return null;
156
156
  const t = `${s}/v1/lens`;
157
- return await ke(t, a, {
157
+ return await Me(t, a, {
158
158
  operation: "delete",
159
159
  lensId: n
160
160
  });
161
161
  }
162
- function va() {
163
- const [s, n] = w(""), [a, t] = w(!1), i = y((M) => M.lenses), { setLenses: o, setSelectedLensId: l } = Ve(), [m, h] = w(!1), [f, u] = w(!1), c = y((M) => M.dashboard), p = y((M) => M.filterValues), { authToken: b, tokenProps: v } = R();
164
- async function x() {
162
+ function Na() {
163
+ const [s, n] = x(""), [a, t] = x(!1), i = y((k) => k.lenses), { setLenses: o, setSelectedLensId: l } = Qe(), [m, h] = x(!1), [f, u] = x(!1), c = y((k) => k.dashboard), p = y((k) => k.filterValues), { authToken: b, tokenProps: v } = R();
164
+ async function D() {
165
165
  h(!0);
166
- const M = we(
166
+ const k = we(
167
167
  c
168
- ), P = await fa(
168
+ ), A = await ba(
169
169
  v.apiServiceUrl,
170
170
  s,
171
- M,
171
+ k,
172
172
  p,
173
173
  b == null ? void 0 : b.accessToken
174
174
  );
175
- P && (o([...i || [], P]), l(P.id), u(!1)), h(!1);
175
+ A && (o([...i || [], A]), l(A.id), u(!1)), h(!1);
176
176
  }
177
177
  return /* @__PURE__ */ r(oe, { open: f, onOpenChange: u, children: [
178
178
  /* @__PURE__ */ e(ys, { asChild: !0, children: /* @__PURE__ */ r(
179
- k,
179
+ M,
180
180
  {
181
181
  variant: "secondary",
182
182
  className: "h-7 p-2",
@@ -195,11 +195,11 @@ function va() {
195
195
  /* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ r("div", { className: "grid grid-cols-8 items-center gap-4", children: [
196
196
  /* @__PURE__ */ e(te, { className: "text-right", children: "Name" }),
197
197
  /* @__PURE__ */ e(
198
- Q,
198
+ V,
199
199
  {
200
200
  value: s,
201
- onChange: (M) => {
202
- n(M.target.value);
201
+ onChange: (k) => {
202
+ n(k.target.value);
203
203
  },
204
204
  id: "name",
205
205
  className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
@@ -207,13 +207,13 @@ function va() {
207
207
  )
208
208
  ] }) }),
209
209
  a && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
210
- /* @__PURE__ */ e(Qe, { children: /* @__PURE__ */ e(
211
- k,
210
+ /* @__PURE__ */ e(Ve, { children: /* @__PURE__ */ e(
211
+ M,
212
212
  {
213
213
  size: "sm",
214
214
  variant: "outline",
215
215
  type: "submit",
216
- onClick: x,
216
+ onClick: D,
217
217
  disabled: m,
218
218
  children: m ? "Creating..." : "Add"
219
219
  }
@@ -221,23 +221,23 @@ function va() {
221
221
  ] })
222
222
  ] });
223
223
  }
224
- function Na() {
225
- const [s, n] = w(!1), a = y((c) => c.lenses), t = y((c) => c.selectedLensId), { setLenses: i, setSelectedLensId: o } = Ve(), { authToken: l, tokenProps: m } = R();
224
+ function ya() {
225
+ const [s, n] = x(!1), a = y((c) => c.lenses), t = y((c) => c.selectedLensId), { setLenses: i, setSelectedLensId: o } = Qe(), { authToken: l, tokenProps: m } = R();
226
226
  async function h(c) {
227
227
  o(c);
228
228
  }
229
229
  async function f(c) {
230
- if (await ba(m.apiServiceUrl, c, l == null ? void 0 : l.accessToken)) {
230
+ if (await va(m.apiServiceUrl, c, l == null ? void 0 : l.accessToken)) {
231
231
  const b = a == null ? void 0 : a.filter((v) => v.id !== c);
232
232
  i(b || []), o("original");
233
233
  }
234
234
  }
235
235
  async function u(c) {
236
- const p = a == null ? void 0 : a.map((x) => x.id === c.id ? {
237
- ...x,
236
+ const p = a == null ? void 0 : a.map((D) => D.id === c.id ? {
237
+ ...D,
238
238
  isDefault: !c.isDefault
239
239
  } : {
240
- ...x,
240
+ ...D,
241
241
  isDefault: !1
242
242
  });
243
243
  i(p || []);
@@ -246,18 +246,18 @@ function Na() {
246
246
  isDefault: !c.isDefault
247
247
  };
248
248
  await xe(m.apiServiceUrl, b, l == null ? void 0 : l.accessToken);
249
- const v = a == null ? void 0 : a.find((x) => x.isDefault);
249
+ const v = a == null ? void 0 : a.find((D) => D.isDefault);
250
250
  if (v && v.id !== c.id) {
251
- const x = {
251
+ const D = {
252
252
  ...v,
253
253
  isDefault: !1
254
254
  };
255
- await xe(m.apiServiceUrl, x, l == null ? void 0 : l.accessToken);
255
+ await xe(m.apiServiceUrl, D, l == null ? void 0 : l.accessToken);
256
256
  }
257
257
  }
258
258
  return /* @__PURE__ */ r(Ce, { open: s, onOpenChange: n, children: [
259
- /* @__PURE__ */ e(Se, { asChild: !0, children: /* @__PURE__ */ e(V, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(ca, { className: "h-4 w-4" }) }) }),
260
- /* @__PURE__ */ r(Me, { align: "end", className: "w-60", children: [
259
+ /* @__PURE__ */ e(Se, { asChild: !0, children: /* @__PURE__ */ e(_, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(da, { className: "h-4 w-4" }) }) }),
260
+ /* @__PURE__ */ r(ke, { align: "end", className: "w-60", children: [
261
261
  /* @__PURE__ */ e(ws, { className: "px-3", children: "Lenses" }),
262
262
  /* @__PURE__ */ e(xs, {}),
263
263
  /* @__PURE__ */ r(
@@ -312,20 +312,20 @@ function Na() {
312
312
  ] })
313
313
  ] });
314
314
  }
315
- function ya({
315
+ function wa({
316
316
  iconClassName: s
317
317
  }) {
318
- const [n, a] = w(!1), [t, i] = w(""), [o, l] = w(!1), m = y((c) => c.isDownloadingPdf), { tokenProps: h } = R();
318
+ const [n, a] = x(!1), [t, i] = x(""), [o, l] = x(!1), m = y((c) => c.isDownloadingPdf), { tokenProps: h } = R();
319
319
  async function f() {
320
- const c = C.loading(
320
+ const c = w.loading(
321
321
  "Generating PDF... may take up to 60 seconds"
322
322
  );
323
323
  try {
324
- await ze(h.apiServiceUrl), C.dismiss(c), C.success("PDF downloaded successfully!", {
324
+ await ze(h.apiServiceUrl), w.dismiss(c), w.success("PDF downloaded successfully!", {
325
325
  duration: 2e3
326
326
  });
327
327
  } catch (p) {
328
- C.dismiss(c), C.error("Failed to download PDF", {
328
+ w.dismiss(c), w.error("Failed to download PDF", {
329
329
  description: "Please try again or contact support.",
330
330
  richColors: !0
331
331
  }), console.error("PDF download error:", p);
@@ -334,22 +334,22 @@ function ya({
334
334
  async function u() {
335
335
  if (!t) return;
336
336
  a(!1), i(""), l(!1);
337
- const c = C.loading(
337
+ const c = w.loading(
338
338
  "Generating protected PDF... may take up to 60 seconds"
339
339
  );
340
340
  try {
341
- await ze(h.apiServiceUrl, t), C.dismiss(c), C.success("Protected PDF downloaded successfully!", {
341
+ await ze(h.apiServiceUrl, t), w.dismiss(c), w.success("Protected PDF downloaded successfully!", {
342
342
  duration: 2e3,
343
343
  position: "top-right"
344
344
  });
345
345
  } catch (p) {
346
- C.dismiss(c), C.error("Failed to download protected PDF. Please try again."), console.error("Protected PDF download error:", p);
346
+ w.dismiss(c), w.error("Failed to download protected PDF. Please try again."), console.error("Protected PDF download error:", p);
347
347
  }
348
348
  }
349
- return /* @__PURE__ */ r(E, { children: [
349
+ return /* @__PURE__ */ r(P, { children: [
350
350
  /* @__PURE__ */ r(Ce, { modal: !1, children: [
351
351
  /* @__PURE__ */ e(Se, { asChild: !0, children: /* @__PURE__ */ e(
352
- k,
352
+ M,
353
353
  {
354
354
  variant: "ghost",
355
355
  size: "sm",
@@ -358,13 +358,13 @@ function ya({
358
358
  children: /* @__PURE__ */ e(Cs, { className: X("size-4", s) })
359
359
  }
360
360
  ) }),
361
- /* @__PURE__ */ r(Me, { align: "end", children: [
361
+ /* @__PURE__ */ r(ke, { align: "end", children: [
362
362
  /* @__PURE__ */ r(W, { onClick: f, children: [
363
363
  /* @__PURE__ */ e(Ss, { className: "mr-2 h-4 w-4" }),
364
364
  "Download PDF"
365
365
  ] }),
366
366
  /* @__PURE__ */ r(W, { onClick: () => a(!0), children: [
367
- /* @__PURE__ */ e(Ms, { className: "mr-2 h-4 w-4" }),
367
+ /* @__PURE__ */ e(ks, { className: "mr-2 h-4 w-4" }),
368
368
  "Download Protected PDF"
369
369
  ] })
370
370
  ] })
@@ -383,7 +383,7 @@ function ya({
383
383
  /* @__PURE__ */ e(te, { htmlFor: "password", children: "Password" }),
384
384
  /* @__PURE__ */ r("div", { className: "relative", children: [
385
385
  /* @__PURE__ */ e(
386
- Q,
386
+ V,
387
387
  {
388
388
  id: "password",
389
389
  type: o ? "text" : "password",
@@ -397,38 +397,38 @@ function ya({
397
397
  }
398
398
  ),
399
399
  /* @__PURE__ */ e(
400
- k,
400
+ M,
401
401
  {
402
402
  type: "button",
403
403
  variant: "ghost",
404
404
  size: "sm",
405
405
  className: "absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",
406
406
  onClick: () => l(!o),
407
- children: o ? /* @__PURE__ */ e(ks, { className: "h-4 w-4 text-muted-foreground" }) : /* @__PURE__ */ e(Ls, { className: "h-4 w-4 text-muted-foreground" })
407
+ children: o ? /* @__PURE__ */ e(Ms, { className: "h-4 w-4 text-muted-foreground" }) : /* @__PURE__ */ e(Ls, { className: "h-4 w-4 text-muted-foreground" })
408
408
  }
409
409
  )
410
410
  ] })
411
411
  ] }) }),
412
- /* @__PURE__ */ r(Qe, { children: [
412
+ /* @__PURE__ */ r(Ve, { children: [
413
413
  /* @__PURE__ */ e(
414
- k,
414
+ M,
415
415
  {
416
416
  variant: "outline",
417
417
  onClick: () => a(!1),
418
418
  children: "Cancel"
419
419
  }
420
420
  ),
421
- /* @__PURE__ */ e(k, { onClick: u, disabled: !t, children: "Download" })
421
+ /* @__PURE__ */ e(M, { onClick: u, disabled: !t, children: "Download" })
422
422
  ] })
423
423
  ] })
424
424
  }
425
425
  )
426
426
  ] });
427
427
  }
428
- const wa = async (s, n, a) => {
428
+ const xa = async (s, n, a) => {
429
429
  const t = `${s}/management/v1/groups`;
430
430
  return await Ke(t, n, a);
431
- }, xa = async (s, n, a) => {
431
+ }, Da = async (s, n, a) => {
432
432
  const t = `${s}/management/v1/groups/${a}`, i = await fetch(t, {
433
433
  method: "DELETE",
434
434
  headers: {
@@ -439,10 +439,10 @@ const wa = async (s, n, a) => {
439
439
  const o = await i.text();
440
440
  throw new Error(o || "Failed to delete group");
441
441
  }
442
- }, Da = async (s, n, a, t) => {
442
+ }, Ca = async (s, n, a, t) => {
443
443
  const i = `${s}/management/v1/groups/${a}/members`;
444
444
  return await Ke(i, n, t);
445
- }, Ca = async (s, n, a, t) => {
445
+ }, Sa = async (s, n, a, t) => {
446
446
  const i = `${s}/management/v1/groups/${a}/members`, o = await fetch(i, {
447
447
  method: "DELETE",
448
448
  headers: {
@@ -456,15 +456,15 @@ const wa = async (s, n, a) => {
456
456
  throw new Error(l || "Failed to remove group members");
457
457
  }
458
458
  };
459
- function Sa() {
459
+ function ka() {
460
460
  const { authToken: s, tokenProps: n } = R(), a = de();
461
461
  return ue({
462
- mutationFn: (t) => wa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
462
+ mutationFn: (t) => xa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
463
463
  onSuccess: () => {
464
- a.invalidateQueries({ queryKey: ["groups"] }), C.success("Group created successfully");
464
+ a.invalidateQueries({ queryKey: ["groups"] }), w.success("Group created successfully");
465
465
  },
466
466
  onError: (t) => {
467
- console.error("Failed to create group:", t), C.error("Failed to create group", {
467
+ console.error("Failed to create group:", t), w.error("Failed to create group", {
468
468
  description: t.message
469
469
  });
470
470
  }
@@ -473,61 +473,61 @@ function Sa() {
473
473
  function Ma() {
474
474
  const { authToken: s, tokenProps: n } = R(), a = de();
475
475
  return ue({
476
- mutationFn: (t) => xa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
476
+ mutationFn: (t) => Da(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
477
477
  onSuccess: (t, i) => {
478
- a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", i] }), C.success("Group deleted successfully");
478
+ a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", i] }), w.success("Group deleted successfully");
479
479
  },
480
480
  onError: (t) => {
481
- console.error("Failed to delete group:", t), C.error("Failed to delete group", {
481
+ console.error("Failed to delete group:", t), w.error("Failed to delete group", {
482
482
  description: t.message
483
483
  });
484
484
  }
485
485
  });
486
486
  }
487
- function ka() {
487
+ function La() {
488
488
  const { authToken: s, tokenProps: n } = R(), a = de();
489
489
  return ue({
490
490
  mutationFn: ({
491
491
  groupId: t,
492
492
  data: i
493
- }) => Da(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, i),
493
+ }) => Ca(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, i),
494
494
  onSuccess: (t, i) => {
495
495
  a.invalidateQueries({ queryKey: ["group", i.groupId] }), a.invalidateQueries({
496
496
  queryKey: ["group-members", i.groupId]
497
- }), a.invalidateQueries({ queryKey: ["groups"] }), C.success("Members added successfully");
497
+ }), a.invalidateQueries({ queryKey: ["groups"] }), w.success("Members added successfully");
498
498
  },
499
499
  onError: (t) => {
500
- console.error("Failed to add group members:", t), C.error("Failed to add members", {
500
+ console.error("Failed to add group members:", t), w.error("Failed to add members", {
501
501
  description: t.message
502
502
  });
503
503
  }
504
504
  });
505
505
  }
506
- function La() {
506
+ function Pa() {
507
507
  const { authToken: s, tokenProps: n } = R(), a = de();
508
508
  return ue({
509
509
  mutationFn: ({
510
510
  groupId: t,
511
511
  data: i
512
- }) => Ca(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, i),
512
+ }) => Sa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, i),
513
513
  onSuccess: (t, i) => {
514
514
  a.invalidateQueries({ queryKey: ["group", i.groupId] }), a.invalidateQueries({
515
515
  queryKey: ["group-members", i.groupId]
516
- }), a.invalidateQueries({ queryKey: ["groups"] }), C.success("Members removed successfully");
516
+ }), a.invalidateQueries({ queryKey: ["groups"] }), w.success("Members removed successfully");
517
517
  },
518
518
  onError: (t) => {
519
- console.error("Failed to remove group members:", t), C.error("Failed to remove members", {
519
+ console.error("Failed to remove group members:", t), w.error("Failed to remove members", {
520
520
  description: t.message
521
521
  });
522
522
  }
523
523
  });
524
524
  }
525
- function Pa({
525
+ function Aa({
526
526
  onSuccess: s,
527
527
  tenantId: n,
528
528
  isTenantUser: a
529
529
  }) {
530
- const [t, i] = w(""), [o, l] = w(""), [m, h] = w({}), f = Sa(), u = () => {
530
+ const [t, i] = x(""), [o, l] = x(""), [m, h] = x({}), f = ka(), u = () => {
531
531
  const p = {};
532
532
  return t.trim() ? t.length < 3 ? p.name = "Group name must be at least 3 characters" : t.length > 50 && (p.name = "Group name must be less than 50 characters") : p.name = "Group name is required", o && o.length > 200 && (p.description = "Description must be less than 200 characters"), h(p), Object.keys(p).length === 0;
533
533
  };
@@ -552,7 +552,7 @@ function Pa({
552
552
  /* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
553
553
  ] }),
554
554
  /* @__PURE__ */ e(
555
- Q,
555
+ V,
556
556
  {
557
557
  id: "group-name",
558
558
  placeholder: "e.g., Marketing Team, Engineering Squad",
@@ -598,7 +598,7 @@ function Pa({
598
598
  ] }),
599
599
  /* @__PURE__ */ r("div", { className: "flex justify-end gap-3", children: [
600
600
  /* @__PURE__ */ e(
601
- k,
601
+ M,
602
602
  {
603
603
  type: "button",
604
604
  variant: "outline",
@@ -610,14 +610,14 @@ function Pa({
610
610
  }
611
611
  ),
612
612
  /* @__PURE__ */ e(
613
- k,
613
+ M,
614
614
  {
615
615
  type: "submit",
616
616
  disabled: f.isPending || !t.trim(),
617
- children: f.isPending ? /* @__PURE__ */ r(E, { children: [
617
+ children: f.isPending ? /* @__PURE__ */ r(P, { children: [
618
618
  /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
619
619
  "Creating..."
620
- ] }) : /* @__PURE__ */ r(E, { children: [
620
+ ] }) : /* @__PURE__ */ r(P, { children: [
621
621
  /* @__PURE__ */ e($, { className: "mr-2 h-4 w-4" }),
622
622
  "Create Group"
623
623
  ] })
@@ -626,20 +626,20 @@ function Pa({
626
626
  ] })
627
627
  ] });
628
628
  }
629
- function Aa(s, n = []) {
629
+ function Ia(s, n = []) {
630
630
  let a = [];
631
631
  function t(o, l) {
632
632
  const m = S.createContext(l), h = a.length;
633
633
  a = [...a, l];
634
634
  const f = (c) => {
635
- var P;
636
- const { scope: p, children: b, ...v } = c, x = ((P = p == null ? void 0 : p[s]) == null ? void 0 : P[h]) || m, M = S.useMemo(() => v, Object.values(v));
637
- return /* @__PURE__ */ e(x.Provider, { value: M, children: b });
635
+ var A;
636
+ const { scope: p, children: b, ...v } = c, D = ((A = p == null ? void 0 : p[s]) == null ? void 0 : A[h]) || m, k = S.useMemo(() => v, Object.values(v));
637
+ return /* @__PURE__ */ e(D.Provider, { value: k, children: b });
638
638
  };
639
639
  f.displayName = o + "Provider";
640
640
  function u(c, p) {
641
- var x;
642
- const b = ((x = p == null ? void 0 : p[s]) == null ? void 0 : x[h]) || m, v = S.useContext(b);
641
+ var D;
642
+ const b = ((D = p == null ? void 0 : p[s]) == null ? void 0 : D[h]) || m, v = S.useContext(b);
643
643
  if (v) return v;
644
644
  if (l !== void 0) return l;
645
645
  throw new Error(`\`${c}\` must be used within \`${o}\``);
@@ -656,9 +656,9 @@ function Aa(s, n = []) {
656
656
  );
657
657
  };
658
658
  };
659
- return i.scopeName = s, [t, Ia(i, ...n)];
659
+ return i.scopeName = s, [t, Ea(i, ...n)];
660
660
  }
661
- function Ia(...s) {
661
+ function Ea(...s) {
662
662
  const n = s[0];
663
663
  if (s.length === 1) return n;
664
664
  const a = () => {
@@ -676,7 +676,7 @@ function Ia(...s) {
676
676
  };
677
677
  return a.scopeName = n.scopeName, a;
678
678
  }
679
- function Ea(s) {
679
+ function Fa(s) {
680
680
  const n = S.useRef(s);
681
681
  return S.useEffect(() => {
682
682
  n.current = s;
@@ -686,7 +686,7 @@ function Ea(s) {
686
686
  }, []);
687
687
  }
688
688
  var De = globalThis != null && globalThis.document ? S.useLayoutEffect : () => {
689
- }, Fa = [
689
+ }, Ta = [
690
690
  "a",
691
691
  "button",
692
692
  "div",
@@ -704,29 +704,29 @@ var De = globalThis != null && globalThis.document ? S.useLayoutEffect : () => {
704
704
  "span",
705
705
  "svg",
706
706
  "ul"
707
- ], Ae = Fa.reduce((s, n) => {
707
+ ], Ae = Ta.reduce((s, n) => {
708
708
  const a = Is(`Primitive.${n}`), t = S.forwardRef((i, o) => {
709
709
  const { asChild: l, ...m } = i, h = l ? a : n;
710
710
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(h, { ...m, ref: o });
711
711
  });
712
712
  return t.displayName = `Primitive.${n}`, { ...s, [n]: t };
713
713
  }, {});
714
- function Ta() {
715
- return pa.useSyncExternalStore(
716
- Ga,
714
+ function Ga() {
715
+ return ga.useSyncExternalStore(
716
+ Ra,
717
717
  () => !0,
718
718
  () => !1
719
719
  );
720
720
  }
721
- function Ga() {
721
+ function Ra() {
722
722
  return () => {
723
723
  };
724
724
  }
725
- var Ie = "Avatar", [Ra] = Aa(Ie), [Oa, es] = Ra(Ie), ss = S.forwardRef(
725
+ var Ie = "Avatar", [Oa] = Ia(Ie), [Ua, es] = Oa(Ie), ss = S.forwardRef(
726
726
  (s, n) => {
727
727
  const { __scopeAvatar: a, ...t } = s, [i, o] = S.useState("idle");
728
728
  return /* @__PURE__ */ e(
729
- Oa,
729
+ Ua,
730
730
  {
731
731
  scope: a,
732
732
  imageLoadingStatus: i,
@@ -740,7 +740,7 @@ ss.displayName = Ie;
740
740
  var as = "AvatarImage", ts = S.forwardRef(
741
741
  (s, n) => {
742
742
  const { __scopeAvatar: a, src: t, onLoadingStatusChange: i = () => {
743
- }, ...o } = s, l = es(as, a), m = Ua(t, o), h = Ea((f) => {
743
+ }, ...o } = s, l = es(as, a), m = qa(t, o), h = Fa((f) => {
744
744
  i(f), l.onImageLoadingStatusChange(f);
745
745
  });
746
746
  return De(() => {
@@ -761,15 +761,15 @@ var rs = "AvatarFallback", ns = S.forwardRef(
761
761
  }
762
762
  );
763
763
  ns.displayName = rs;
764
- function _e(s, n) {
764
+ function je(s, n) {
765
765
  return s ? n ? (s.src !== n && (s.src = n), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
766
766
  }
767
- function Ua(s, { referrerPolicy: n, crossOrigin: a }) {
768
- const t = Ta(), i = S.useRef(null), o = t ? (i.current || (i.current = new window.Image()), i.current) : null, [l, m] = S.useState(
769
- () => _e(o, s)
767
+ function qa(s, { referrerPolicy: n, crossOrigin: a }) {
768
+ const t = Ga(), i = S.useRef(null), o = t ? (i.current || (i.current = new window.Image()), i.current) : null, [l, m] = S.useState(
769
+ () => je(o, s)
770
770
  );
771
771
  return De(() => {
772
- m(_e(o, s));
772
+ m(je(o, s));
773
773
  }, [o, s]), De(() => {
774
774
  const h = (c) => () => {
775
775
  m(c);
@@ -794,7 +794,7 @@ const Ee = S.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
794
794
  }
795
795
  ));
796
796
  Ee.displayName = os.displayName;
797
- const qa = S.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
797
+ const za = S.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
798
798
  is,
799
799
  {
800
800
  ref: a,
@@ -802,7 +802,7 @@ const qa = S.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
802
802
  ...n
803
803
  }
804
804
  ));
805
- qa.displayName = is.displayName;
805
+ za.displayName = is.displayName;
806
806
  const Fe = S.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
807
807
  ls,
808
808
  {
@@ -815,43 +815,43 @@ const Fe = S.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
815
815
  }
816
816
  ));
817
817
  Fe.displayName = ls.displayName;
818
- function za({
818
+ function _a({
819
819
  open: s,
820
820
  onOpenChange: n,
821
821
  group: a,
822
822
  onUpdate: t
823
823
  }) {
824
- const [i, o] = w("members"), [l, m] = w(""), [h, f] = w([]), [u, c] = w([]), { data: p, isLoading: b, refetch: v } = Es(a.id), x = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: M, isLoading: P } = Fs({
825
- type: x,
824
+ const [i, o] = x("members"), [l, m] = x(""), [h, f] = x([]), [u, c] = x([]), { data: p, isLoading: b, refetch: v } = Es(a.id), D = a.type === "TENANT_GROUP" ? "tenant" : "organization", { users: k, isLoading: A } = Fs({
825
+ type: D,
826
826
  tenantId: a.tenantId || void 0,
827
827
  active: !0,
828
828
  limit: 100
829
- }), O = ka(), G = La(), A = (p == null ? void 0 : p.members) || [], j = ae(() => new Set(A.map((g) => g.userId)), [A]), N = ae(() => M.filter((g) => !j.has(g.id)), [M, j]), T = ae(() => {
829
+ }), O = La(), G = Pa(), I = (p == null ? void 0 : p.members) || [], j = ae(() => new Set(I.map((g) => g.userId)), [I]), N = ae(() => k.filter((g) => !j.has(g.id)), [k, j]), T = ae(() => {
830
830
  if (!l) return N;
831
831
  const g = l.toLowerCase();
832
832
  return N.filter(
833
833
  (L) => {
834
- var I, q;
835
- return ((I = L.name) == null ? void 0 : I.toLowerCase().includes(g)) || ((q = L.email) == null ? void 0 : q.toLowerCase().includes(g));
834
+ var E, q;
835
+ return ((E = L.name) == null ? void 0 : E.toLowerCase().includes(g)) || ((q = L.email) == null ? void 0 : q.toLowerCase().includes(g));
836
836
  }
837
837
  );
838
- }, [N, l]), D = ae(() => {
839
- if (!l) return A;
838
+ }, [N, l]), C = ae(() => {
839
+ if (!l) return I;
840
840
  const g = l.toLowerCase();
841
- return A.filter(
841
+ return I.filter(
842
842
  (L) => {
843
- var I, q, Y, z;
844
- return ((q = (I = L.user) == null ? void 0 : I.name) == null ? void 0 : q.toLowerCase().includes(g)) || ((z = (Y = L.user) == null ? void 0 : Y.email) == null ? void 0 : z.toLowerCase().includes(g));
843
+ var E, q, Y, z;
844
+ return ((q = (E = L.user) == null ? void 0 : E.name) == null ? void 0 : q.toLowerCase().includes(g)) || ((z = (Y = L.user) == null ? void 0 : Y.email) == null ? void 0 : z.toLowerCase().includes(g));
845
845
  }
846
846
  );
847
- }, [A, l]), U = async () => {
847
+ }, [I, l]), U = async () => {
848
848
  if (h.length !== 0)
849
849
  try {
850
850
  await O.mutateAsync({
851
851
  groupId: a.id,
852
852
  data: {
853
853
  userIds: h,
854
- userType: x === "tenant" ? "tenant" : "org"
854
+ userType: D === "tenant" ? "tenant" : "org"
855
855
  }
856
856
  }), f([]), o("members"), v(), t == null || t();
857
857
  } catch (g) {
@@ -871,20 +871,20 @@ function za({
871
871
  }
872
872
  }, he = (g) => {
873
873
  f(
874
- (L) => L.includes(g) ? L.filter((I) => I !== g) : [...L, g]
874
+ (L) => L.includes(g) ? L.filter((E) => E !== g) : [...L, g]
875
875
  );
876
876
  }, B = (g) => {
877
877
  c(
878
- (L) => L.includes(g) ? L.filter((I) => I !== g) : [...L, g]
878
+ (L) => L.includes(g) ? L.filter((E) => E !== g) : [...L, g]
879
879
  );
880
880
  };
881
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(oe, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(ie, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
881
+ return /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(oe, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(ie, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
882
882
  /* @__PURE__ */ r(le, { children: [
883
883
  /* @__PURE__ */ e(ce, { children: a.name }),
884
884
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: [
885
- A.length,
885
+ I.length,
886
886
  " ",
887
- A.length === 1 ? "member" : "members"
887
+ I.length === 1 ? "member" : "members"
888
888
  ] }) }),
889
889
  /* @__PURE__ */ r("p", { id: "group-members-description", className: "sr-only", children: [
890
890
  "Add or remove members from the ",
@@ -903,7 +903,7 @@ function za({
903
903
  /* @__PURE__ */ r("div", { className: "relative", children: [
904
904
  /* @__PURE__ */ e(be, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
905
905
  /* @__PURE__ */ e(
906
- Q,
906
+ V,
907
907
  {
908
908
  placeholder: "Search members...",
909
909
  value: l,
@@ -912,11 +912,11 @@ function za({
912
912
  }
913
913
  )
914
914
  ] }),
915
- /* @__PURE__ */ e(ve, { className: u.length > 0 ? "h-[300px]" : "h-[350px]", children: b ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ne, { className: "h-16 w-full" }, g)) }) : D.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
915
+ /* @__PURE__ */ e(ve, { className: u.length > 0 ? "h-[300px]" : "h-[350px]", children: b ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ne, { className: "h-16 w-full" }, g)) }) : C.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
916
916
  /* @__PURE__ */ e($, { className: "h-12 w-12 mb-3 opacity-50" }),
917
917
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: l ? "No members found" : "No members yet" }),
918
918
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
919
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: D.map((g) => /* @__PURE__ */ e(
919
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: C.map((g) => /* @__PURE__ */ e(
920
920
  $a,
921
921
  {
922
922
  member: g,
@@ -933,16 +933,16 @@ function za({
933
933
  " selected"
934
934
  ] }),
935
935
  /* @__PURE__ */ e(
936
- k,
936
+ M,
937
937
  {
938
938
  variant: "destructive",
939
939
  size: "sm",
940
940
  onClick: me,
941
941
  disabled: G.isPending,
942
- children: G.isPending ? /* @__PURE__ */ r(E, { children: [
942
+ children: G.isPending ? /* @__PURE__ */ r(P, { children: [
943
943
  /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
944
944
  "Removing..."
945
- ] }) : /* @__PURE__ */ r(E, { children: [
945
+ ] }) : /* @__PURE__ */ r(P, { children: [
946
946
  /* @__PURE__ */ e(Xe, { className: "mr-2 h-4 w-4" }),
947
947
  "Remove Selected"
948
948
  ] })
@@ -954,7 +954,7 @@ function za({
954
954
  /* @__PURE__ */ r("div", { className: "relative", children: [
955
955
  /* @__PURE__ */ e(be, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
956
956
  /* @__PURE__ */ e(
957
- Q,
957
+ V,
958
958
  {
959
959
  placeholder: "Search users to add...",
960
960
  value: l,
@@ -963,7 +963,7 @@ function za({
963
963
  }
964
964
  )
965
965
  ] }),
966
- /* @__PURE__ */ e(ve, { className: "h-[300px]", children: P ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ne, { className: "h-16 w-full" }, g)) }) : T.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
966
+ /* @__PURE__ */ e(ve, { className: "h-[300px]", children: A ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ne, { className: "h-16 w-full" }, g)) }) : T.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
967
967
  /* @__PURE__ */ e(ye, { className: "h-12 w-12 mb-3 opacity-50" }),
968
968
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
969
969
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "All eligible users are already members" })
@@ -984,14 +984,14 @@ function za({
984
984
  " selected"
985
985
  ] }),
986
986
  /* @__PURE__ */ e(
987
- k,
987
+ M,
988
988
  {
989
989
  onClick: U,
990
990
  disabled: O.isPending,
991
- children: O.isPending ? /* @__PURE__ */ r(E, { children: [
991
+ children: O.isPending ? /* @__PURE__ */ r(P, { children: [
992
992
  /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
993
993
  "Adding..."
994
- ] }) : /* @__PURE__ */ r(E, { children: [
994
+ ] }) : /* @__PURE__ */ r(P, { children: [
995
995
  /* @__PURE__ */ e(ye, { className: "mr-2 h-4 w-4" }),
996
996
  "Add Members"
997
997
  ] })
@@ -1048,32 +1048,32 @@ function ja({
1048
1048
  }
1049
1049
  );
1050
1050
  }
1051
- function _a({
1051
+ function Qa({
1052
1052
  open: s,
1053
1053
  onOpenChange: n
1054
1054
  }) {
1055
- const [a, t] = w("groups"), [i, o] = w(""), [l, m] = w(null), [h, f] = w(!1), [u, c] = w(null), { tokenProps: p } = R(), { currentUser: b } = Ze(), v = Ma(), x = (b == null ? void 0 : b.type) === "tenant", M = p == null ? void 0 : p.tenantId, { groups: P, isLoading: O, refetch: G } = Ts({
1056
- type: x ? "TENANT_GROUP" : "all",
1057
- tenantId: x ? M : void 0,
1055
+ const [a, t] = x("groups"), [i, o] = x(""), [l, m] = x(null), [h, f] = x(!1), [u, c] = x(null), { tokenProps: p } = R(), { currentUser: b } = Ze(), v = Ma(), D = (b == null ? void 0 : b.type) === "tenant", k = p == null ? void 0 : p.tenantId, { groups: A, isLoading: O, refetch: G } = Ts({
1056
+ type: D ? "TENANT_GROUP" : "all",
1057
+ tenantId: D ? k : void 0,
1058
1058
  includeMembers: !1
1059
- }), A = P.filter(
1060
- (D) => {
1059
+ }), I = A.filter(
1060
+ (C) => {
1061
1061
  var U;
1062
- return D.name.toLowerCase().includes(i.toLowerCase()) || ((U = D.description) == null ? void 0 : U.toLowerCase().includes(i.toLowerCase()));
1062
+ return C.name.toLowerCase().includes(i.toLowerCase()) || ((U = C.description) == null ? void 0 : U.toLowerCase().includes(i.toLowerCase()));
1063
1063
  }
1064
1064
  ), j = async () => {
1065
1065
  if (u)
1066
1066
  try {
1067
1067
  await v.mutateAsync(u.id), c(null), G();
1068
- } catch (D) {
1069
- console.error("Failed to delete group:", D);
1068
+ } catch (C) {
1069
+ console.error("Failed to delete group:", C);
1070
1070
  }
1071
- }, N = (D) => {
1072
- m(D), f(!0);
1071
+ }, N = (C) => {
1072
+ m(C), f(!0);
1073
1073
  }, T = () => {
1074
1074
  t("groups"), G();
1075
1075
  };
1076
- return /* @__PURE__ */ r(E, { children: [
1076
+ return /* @__PURE__ */ r(P, { children: [
1077
1077
  /* @__PURE__ */ e(oe, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(ie, { className: "max-w-4xl max-h-[80vh]", children: [
1078
1078
  /* @__PURE__ */ r(le, { children: [
1079
1079
  /* @__PURE__ */ r(ce, { className: "flex items-center gap-2", children: [
@@ -1097,42 +1097,42 @@ function _a({
1097
1097
  /* @__PURE__ */ r("div", { className: "relative", children: [
1098
1098
  /* @__PURE__ */ e(be, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
1099
1099
  /* @__PURE__ */ e(
1100
- Q,
1100
+ V,
1101
1101
  {
1102
1102
  placeholder: "Search groups...",
1103
1103
  value: i,
1104
- onChange: (D) => o(D.target.value),
1104
+ onChange: (C) => o(C.target.value),
1105
1105
  className: "pl-10"
1106
1106
  }
1107
1107
  )
1108
1108
  ] }),
1109
- /* @__PURE__ */ e(ve, { className: "h-[400px]", children: O ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((D) => /* @__PURE__ */ e(Ne, { className: "h-24 w-full" }, D)) }) : A.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1109
+ /* @__PURE__ */ e(ve, { className: "h-[400px]", children: O ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((C) => /* @__PURE__ */ e(Ne, { className: "h-24 w-full" }, C)) }) : I.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1110
1110
  /* @__PURE__ */ e($, { className: "h-12 w-12 mb-3 opacity-50" }),
1111
1111
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
1112
1112
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: i ? "Try a different search" : "Create your first group to get started" })
1113
- ] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: A.map((D) => /* @__PURE__ */ e(
1113
+ ] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: I.map((C) => /* @__PURE__ */ e(
1114
1114
  Va,
1115
1115
  {
1116
- group: D,
1117
- onManageMembers: () => N(D),
1118
- onDelete: () => c(D),
1116
+ group: C,
1117
+ onManageMembers: () => N(C),
1118
+ onDelete: () => c(C),
1119
1119
  currentUserId: b == null ? void 0 : b.id
1120
1120
  },
1121
- D.id
1121
+ C.id
1122
1122
  )) }) })
1123
1123
  ] }) }),
1124
1124
  /* @__PURE__ */ e(ne, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
1125
- Pa,
1125
+ Aa,
1126
1126
  {
1127
1127
  onSuccess: T,
1128
- tenantId: M,
1129
- isTenantUser: x
1128
+ tenantId: k,
1129
+ isTenantUser: D
1130
1130
  }
1131
1131
  ) })
1132
1132
  ] })
1133
1133
  ] }) }),
1134
1134
  l && /* @__PURE__ */ e(
1135
- za,
1135
+ _a,
1136
1136
  {
1137
1137
  open: h,
1138
1138
  onOpenChange: f,
@@ -1155,14 +1155,14 @@ function _a({
1155
1155
  ] })
1156
1156
  ] }),
1157
1157
  /* @__PURE__ */ r(zs, { children: [
1158
- /* @__PURE__ */ e($s, { children: "Cancel" }),
1158
+ /* @__PURE__ */ e(_s, { children: "Cancel" }),
1159
1159
  /* @__PURE__ */ e(
1160
- js,
1160
+ $s,
1161
1161
  {
1162
1162
  onClick: j,
1163
1163
  disabled: v.isPending,
1164
1164
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
1165
- children: v.isPending ? /* @__PURE__ */ r(E, { children: [
1165
+ children: v.isPending ? /* @__PURE__ */ r(P, { children: [
1166
1166
  /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }),
1167
1167
  "Deleting..."
1168
1168
  ] }) : "Delete Group"
@@ -1196,13 +1196,13 @@ function Va({
1196
1196
  ] }),
1197
1197
  /* @__PURE__ */ r("span", { children: [
1198
1198
  "Created ",
1199
- _s(new Date(s.createdAt), "MMM d, yyyy")
1199
+ js(new Date(s.createdAt), "MMM d, yyyy")
1200
1200
  ] })
1201
1201
  ] })
1202
1202
  ] }),
1203
1203
  /* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
1204
1204
  /* @__PURE__ */ e(
1205
- k,
1205
+ M,
1206
1206
  {
1207
1207
  variant: "ghost",
1208
1208
  size: "sm",
@@ -1212,7 +1212,7 @@ function Va({
1212
1212
  }
1213
1213
  ),
1214
1214
  i && /* @__PURE__ */ e(
1215
- k,
1215
+ M,
1216
1216
  {
1217
1217
  variant: "ghost",
1218
1218
  size: "sm",
@@ -1225,40 +1225,40 @@ function Va({
1225
1225
  ] })
1226
1226
  ] }) });
1227
1227
  }
1228
- function Ya() {
1228
+ function Za() {
1229
1229
  var Re, Oe, Ue;
1230
1230
  const {
1231
1231
  authToken: s,
1232
1232
  tokenProps: n,
1233
1233
  id: a
1234
- } = R(), { isLocalDev: t } = Vs(), { permissions: i } = Qs(), o = Hs(), { isLoading: l } = Bs();
1234
+ } = R(), { isLocalDev: t } = Qs(), { permissions: i } = Vs(), o = Hs(), { isLoading: l } = Bs();
1235
1235
  y((d) => d.theme);
1236
1236
  const m = y((d) => d.lenses), h = y((d) => d.selectedLensId), f = m == null ? void 0 : m.find((d) => d.id === h), u = y((d) => d.dashboard);
1237
1237
  y((d) => d.selectedSheetId);
1238
1238
  const c = y(
1239
1239
  (d) => d.isDashboardEditing
1240
- ), { setDashboardTitle: p } = y((d) => d.actions), [b, v] = w(!1), [x, M] = w(!1), [P, O] = w(!1), G = y((d) => d.isDashboardPanelOpen), A = y(
1240
+ ), { setDashboardTitle: p } = y((d) => d.actions), [b, v] = x(!1), [D, k] = x(!1), [A, O] = x(!1), G = y((d) => d.isDashboardPanelOpen), I = y(
1241
1241
  (d) => d.actions.setIsDashboardPanelOpen
1242
1242
  ), j = y((d) => d.filterValues), N = y((d) => d.isVisualEditing);
1243
- $e((d) => d.card);
1243
+ _e((d) => d.card);
1244
1244
  const T = se(
1245
1245
  (d) => d.selectedDashboard
1246
- ), D = se(
1246
+ ), C = se(
1247
1247
  (d) => d.initialDashboard
1248
1248
  );
1249
- se((d) => d.selectedVisual), y((d) => d.selectedFrameId), $e((d) => d.frame);
1250
- const U = T ? (Oe = T == null ? void 0 : T.permissions) == null ? void 0 : Oe.canEdit : (Re = D == null ? void 0 : D.permissions) == null ? void 0 : Re.canEdit, me = y((d) => d.showFilters), he = y(
1249
+ se((d) => d.selectedVisual), y((d) => d.selectedFrameId), _e((d) => d.frame);
1250
+ const U = T ? (Oe = T == null ? void 0 : T.permissions) == null ? void 0 : Oe.canEdit : (Re = C == null ? void 0 : C.permissions) == null ? void 0 : Re.canEdit, me = y((d) => d.showFilters), he = y(
1251
1251
  (d) => d.showDashboardJSON
1252
1252
  ), B = y((d) => d.onSaveFunction), g = y(
1253
1253
  (d) => d.actions.setShowFilters
1254
- ), { setIsDashboardEditing: L, setShowDashboardJSON: I } = y(
1254
+ ), { setIsDashboardEditing: L, setShowDashboardJSON: E } = y(
1255
1255
  (d) => d.actions
1256
1256
  ), { setInitialDashboard: q, clearSelectedDashboard: Y } = se(
1257
1257
  (d) => d.actions
1258
- ), { resources: z } = Ks(fe.DASHBOARD), { currentUser: cs } = Ze(), ds = Ws(cs), _ = T || D, Te = _ ? {
1259
- id: _.id,
1260
- title: (u == null ? void 0 : u.title) || _.title || "Dashboard"
1261
- } : null, { handleAddNewFrame: us } = Js(), [pe, ge] = w(!1), Z = Xs(fe.DASHBOARD), ms = async (d, F) => {
1258
+ ), { resources: z } = Ks(fe.DASHBOARD), { currentUser: cs } = Ze(), ds = Ws(cs), Q = T || C, Te = Q ? {
1259
+ id: Q.id,
1260
+ title: (u == null ? void 0 : u.title) || Q.title || "Dashboard"
1261
+ } : null, { handleAddNewFrame: us } = Js(), [pe, ge] = x(!1), Z = Xs(fe.DASHBOARD), ms = async (d, F) => {
1262
1262
  if (!(u != null && u.id)) {
1263
1263
  console.log("No dashboard ID found");
1264
1264
  return;
@@ -1274,15 +1274,15 @@ function Ya() {
1274
1274
  },
1275
1275
  {
1276
1276
  onSuccess: () => {
1277
- console.log("Dashboard title updated successfully"), C.success("Dashboard title updated");
1277
+ console.log("Dashboard title updated successfully"), w.success("Dashboard title updated");
1278
1278
  },
1279
1279
  onError: (K) => {
1280
- console.error("Failed to update dashboard title:", K), C.error("Failed to update dashboard title"), p(F);
1280
+ console.error("Failed to update dashboard title:", K), w.error("Failed to update dashboard title"), p(F);
1281
1281
  }
1282
1282
  }
1283
1283
  );
1284
1284
  };
1285
- na(() => {
1285
+ oa(() => {
1286
1286
  if (z && z.length > 0) {
1287
1287
  const d = u == null ? void 0 : u.id;
1288
1288
  if (d) {
@@ -1311,10 +1311,10 @@ function Ya() {
1311
1311
  },
1312
1312
  {
1313
1313
  onSuccess: () => {
1314
- ge(!1), C.success("Dashboard saved!");
1314
+ ge(!1), w.success("Dashboard saved!");
1315
1315
  },
1316
1316
  onError: () => {
1317
- ge(!1), C.error("Failed to save dashboard");
1317
+ ge(!1), w.error("Failed to save dashboard");
1318
1318
  }
1319
1319
  }
1320
1320
  );
@@ -1332,7 +1332,7 @@ function Ya() {
1332
1332
  n.apiServiceUrl,
1333
1333
  K,
1334
1334
  s == null ? void 0 : s.accessToken
1335
- ), C.success("Lens saved"), B == null || B(d), v(!1);
1335
+ ), w.success("Lens saved"), B == null || B(d), v(!1);
1336
1336
  }
1337
1337
  const Ge = (f == null ? void 0 : f.name) || u.title;
1338
1338
  Z.isPending && console.log("Title during update:", {
@@ -1349,21 +1349,21 @@ function Ya() {
1349
1349
  role: "dashboard-controls",
1350
1350
  children: [
1351
1351
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1352
- bs && /* @__PURE__ */ r(E, { children: [
1352
+ bs && /* @__PURE__ */ r(P, { children: [
1353
1353
  /* @__PURE__ */ e(
1354
- V,
1354
+ _,
1355
1355
  {
1356
1356
  "aria-label": "Manage Dashboards",
1357
1357
  tooltip: "Manage Dashboards",
1358
1358
  onClick: () => {
1359
- A(!G);
1359
+ I(!G);
1360
1360
  },
1361
1361
  className: "h-7 p-2",
1362
- children: /* @__PURE__ */ e(da, { className: "h-4 w-4" })
1362
+ children: /* @__PURE__ */ e(ua, { className: "h-4 w-4" })
1363
1363
  }
1364
1364
  ),
1365
1365
  o && !N && /* @__PURE__ */ e(
1366
- V,
1366
+ _,
1367
1367
  {
1368
1368
  "aria-label": "Dashboard Hub",
1369
1369
  tooltip: "Dashboard Hub",
@@ -1398,23 +1398,36 @@ function Ya() {
1398
1398
  ))
1399
1399
  ] }),
1400
1400
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1401
- N && /* @__PURE__ */ r(E, { children: [
1402
- /* @__PURE__ */ e(oa, { className: "mr-2" }),
1403
- /* @__PURE__ */ e(ia, { className: "h-7" })
1401
+ N && /* @__PURE__ */ r(P, { children: [
1402
+ /* @__PURE__ */ e(ia, { className: "mr-2" }),
1403
+ /* @__PURE__ */ e(la, { className: "h-7" })
1404
1404
  ] }),
1405
- t && !N && /* @__PURE__ */ e(
1406
- V,
1407
- {
1408
- tooltip: "Invalidate Token",
1409
- onClick: () => Zs(n.apiServiceUrl),
1410
- className: "h-7 p-2",
1411
- children: /* @__PURE__ */ e(ma, { className: "h-4 w-4" })
1412
- }
1413
- ),
1414
- !N && o && /* @__PURE__ */ e(ya, {}),
1415
- !N && o && /* @__PURE__ */ e(la, {}),
1405
+ t && !N && /* @__PURE__ */ r(P, { children: [
1406
+ /* @__PURE__ */ e(
1407
+ _,
1408
+ {
1409
+ tooltip: "Copy Token",
1410
+ onClick: () => {
1411
+ s != null && s.accessToken && (navigator.clipboard.writeText(s.accessToken), w.success("Token copied to clipboard"));
1412
+ },
1413
+ className: "h-7 p-2",
1414
+ children: /* @__PURE__ */ e(Zs, { className: "h-4 w-4" })
1415
+ }
1416
+ ),
1417
+ /* @__PURE__ */ e(
1418
+ _,
1419
+ {
1420
+ tooltip: "Invalidate Token",
1421
+ onClick: () => ea(n.apiServiceUrl),
1422
+ className: "h-7 p-2",
1423
+ children: /* @__PURE__ */ e(ha, { className: "h-4 w-4" })
1424
+ }
1425
+ )
1426
+ ] }),
1427
+ !N && o && /* @__PURE__ */ e(wa, {}),
1428
+ !N && o && /* @__PURE__ */ e(ca, {}),
1416
1429
  !N && o && ds && /* @__PURE__ */ e(
1417
- V,
1430
+ _,
1418
1431
  {
1419
1432
  tooltip: "Manage Groups",
1420
1433
  onClick: () => O(!0),
@@ -1422,29 +1435,29 @@ function Ya() {
1422
1435
  children: /* @__PURE__ */ e($, { className: "h-4 w-4" })
1423
1436
  }
1424
1437
  ),
1425
- !N && o && ((Ue = _ == null ? void 0 : _.permissions) == null ? void 0 : Ue.canShare) && /* @__PURE__ */ e(
1426
- V,
1438
+ !N && o && ((Ue = Q == null ? void 0 : Q.permissions) == null ? void 0 : Ue.canShare) && /* @__PURE__ */ e(
1439
+ _,
1427
1440
  {
1428
1441
  tooltip: "Share Dashboard",
1429
- onClick: () => M(!0),
1442
+ onClick: () => k(!0),
1430
1443
  className: "h-7 p-2",
1431
- children: /* @__PURE__ */ e(ea, { className: "h-4 w-4" })
1444
+ children: /* @__PURE__ */ e(sa, { className: "h-4 w-4" })
1432
1445
  }
1433
1446
  ),
1434
1447
  !me && !N && c && i.canUseFilters && o && /* @__PURE__ */ e(
1435
- k,
1448
+ M,
1436
1449
  {
1437
1450
  className: "h-7 p-2",
1438
1451
  variant: "outline",
1439
1452
  onClick: () => g(!0),
1440
1453
  size: "sm",
1441
- children: /* @__PURE__ */ e(sa, { className: "h-4 w-4" })
1454
+ children: /* @__PURE__ */ e(aa, { className: "h-4 w-4" })
1442
1455
  }
1443
1456
  ),
1444
- c && !N && ee && t && o && /* @__PURE__ */ e(va, {}),
1445
- !N && ee && t && o && /* @__PURE__ */ e(Na, {}),
1457
+ c && !N && ee && t && o && /* @__PURE__ */ e(Na, {}),
1458
+ !N && ee && t && o && /* @__PURE__ */ e(ya, {}),
1446
1459
  c && !N && ee && f && t && o && /* @__PURE__ */ r(
1447
- k,
1460
+ M,
1448
1461
  {
1449
1462
  className: "h-7 p-2",
1450
1463
  variant: "secondary",
@@ -1452,13 +1465,13 @@ function Ya() {
1452
1465
  onClick: fs,
1453
1466
  size: "sm",
1454
1467
  children: [
1455
- /* @__PURE__ */ e(je, { className: "mr-2 h-4 w-4" }),
1468
+ /* @__PURE__ */ e($e, { className: "mr-2 h-4 w-4" }),
1456
1469
  "Save Lens"
1457
1470
  ]
1458
1471
  }
1459
1472
  ),
1460
1473
  c && !N && o && /* @__PURE__ */ r(
1461
- k,
1474
+ M,
1462
1475
  {
1463
1476
  variant: "outline",
1464
1477
  className: "h-7 p-2",
@@ -1472,49 +1485,49 @@ function Ya() {
1472
1485
  }
1473
1486
  ),
1474
1487
  !N && !c && i.canEdit && o && /* @__PURE__ */ r(
1475
- k,
1488
+ M,
1476
1489
  {
1477
1490
  variant: "outline",
1478
1491
  className: "h-7 p-2",
1479
1492
  onClick: ps,
1480
1493
  size: "sm",
1481
1494
  children: [
1482
- /* @__PURE__ */ e(aa, { className: "mr-2 h-4 w-4" }),
1495
+ /* @__PURE__ */ e(ta, { className: "mr-2 h-4 w-4" }),
1483
1496
  "Edit"
1484
1497
  ]
1485
1498
  }
1486
1499
  ),
1487
1500
  hs && o && /* @__PURE__ */ r(
1488
- k,
1501
+ M,
1489
1502
  {
1490
1503
  className: "h-7 p-2",
1491
1504
  disabled: pe,
1492
1505
  onClick: gs,
1493
1506
  size: "sm",
1494
1507
  children: [
1495
- pe ? /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(je, { className: "mr-2 h-4 w-4" }),
1508
+ pe ? /* @__PURE__ */ e(H, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e($e, { className: "mr-2 h-4 w-4" }),
1496
1509
  pe ? "Saving..." : "Save"
1497
1510
  ]
1498
1511
  }
1499
1512
  ),
1500
1513
  !N && c && t && o && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
1501
- k,
1514
+ M,
1502
1515
  {
1503
1516
  className: "h-7 p-2",
1504
- onClick: () => I(!he),
1517
+ onClick: () => E(!he),
1505
1518
  size: "sm",
1506
1519
  variant: "ghost",
1507
- children: /* @__PURE__ */ e(ta, { className: "h-4 w-4" })
1520
+ children: /* @__PURE__ */ e(ra, { className: "h-4 w-4" })
1508
1521
  }
1509
1522
  ) }),
1510
- !N && t && /* @__PURE__ */ e(ga, {}),
1523
+ !N && t && /* @__PURE__ */ e(fa, {}),
1511
1524
  c && !N && o && /* @__PURE__ */ r(
1512
- k,
1525
+ M,
1513
1526
  {
1514
1527
  variant: "outline",
1515
1528
  className: "h-7 p-2",
1516
1529
  onClick: () => {
1517
- L(!1), I(!1);
1530
+ L(!1), E(!1);
1518
1531
  },
1519
1532
  children: [
1520
1533
  /* @__PURE__ */ e(Be, { className: "mr-2 h-4 w-4" }),
@@ -1522,18 +1535,18 @@ function Ya() {
1522
1535
  ]
1523
1536
  }
1524
1537
  ),
1525
- x && Te && /* @__PURE__ */ e(
1526
- ra,
1538
+ D && Te && /* @__PURE__ */ e(
1539
+ na,
1527
1540
  {
1528
1541
  resource: Te,
1529
1542
  resourceType: fe.DASHBOARD,
1530
- onClose: () => M(!1)
1543
+ onClose: () => k(!1)
1531
1544
  }
1532
1545
  ),
1533
1546
  /* @__PURE__ */ e(
1534
- _a,
1547
+ Qa,
1535
1548
  {
1536
- open: P,
1549
+ open: A,
1537
1550
  onOpenChange: O
1538
1551
  }
1539
1552
  )
@@ -1543,5 +1556,5 @@ function Ya() {
1543
1556
  );
1544
1557
  }
1545
1558
  export {
1546
- Ya as default
1559
+ Za as default
1547
1560
  };