react-semaphor 0.1.145 → 0.1.147

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 (24) hide show
  1. package/dist/chunks/{dashboard-controls-DhQZskp-.js → dashboard-controls-BTd2GP5a.js} +1 -1
  2. package/dist/chunks/{dashboard-controls-CK-TP9Qx.js → dashboard-controls-CE8KM6Tg.js} +199 -199
  3. package/dist/chunks/{dashboard-export-dialog-DWHbgRQ2.js → dashboard-export-dialog-D9RPWq-E.js} +26 -26
  4. package/dist/chunks/{dashboard-export-dialog-D2JI5ycD.js → dashboard-export-dialog-DvMsFXpk.js} +1 -1
  5. package/dist/chunks/{dashboard-json-xIJDJDEK.js → dashboard-json-B1RDTwhR.js} +1 -1
  6. package/dist/chunks/{dashboard-json-C_agr9Il.js → dashboard-json-BYlLpF4e.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-CyWgFWeR.js → edit-dashboard-visual-BvFmi5Wg.js} +2246 -2240
  8. package/dist/chunks/{edit-dashboard-visual-DjlER5zs.js → edit-dashboard-visual-DEgGCKtt.js} +13 -13
  9. package/dist/chunks/{editor-action-buttons-DPryoh3-.js → editor-action-buttons-Be2gqSdc.js} +1 -1
  10. package/dist/chunks/{editor-action-buttons-CRGFmZT-.js → editor-action-buttons-CrwUOyJX.js} +2 -2
  11. package/dist/chunks/{index-DB87nSG-.js → index-C4H_NxAd.js} +61 -61
  12. package/dist/chunks/{index-DI6ZxR4E.js → index-Cz1fGuVl.js} +1 -1
  13. package/dist/chunks/{resource-management-panel-BugB44JB.js → resource-management-panel-CBrnB1xs.js} +1 -1
  14. package/dist/chunks/{resource-management-panel-BOJcXuoC.js → resource-management-panel-CmaSAoHN.js} +62 -62
  15. package/dist/chunks/{use-visual-utils-jua7RF1E.js → use-visual-utils-DF-sQ-ZN.js} +1 -1
  16. package/dist/chunks/{use-visual-utils-CpYOpmej.js → use-visual-utils-DHrvE5kS.js} +1 -1
  17. package/dist/dashboard/index.cjs +1 -1
  18. package/dist/dashboard/index.js +1 -1
  19. package/dist/index.cjs +2 -2
  20. package/dist/index.js +26 -25
  21. package/dist/surfboard/index.cjs +1 -1
  22. package/dist/surfboard/index.js +1 -1
  23. package/dist/types/main.d.ts +67 -5
  24. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- import { jsxs as r, jsx as e, Fragment as I } from "react/jsx-runtime";
2
- import { b as X, bC as qs, bD as _s, u as y, aG as Be, aH as Je, B as k, aJ as We, aK as fe, bE as Me, g as Xe, an as U, as as ke, bF as $s, b8 as Le, at as Ae, au as Ie, av as Ee, aw as Ye, ax as be, b1 as W, aB as js, I as q, bG as Vs, bc as Qs, bH as Hs, bI as Ve, bJ as Ze, c as Y, bK as es, b4 as Ks, h as le, bL as ce, l as L, bM as ss, az as Bs, bN as Js, L as _, bb as $, bO as Ws, bP as Xs, bQ as Ys, bR as as, bS as ts, bT as oe, bU as ie, bz as Ne, bj as ye, bV as we, bd as ns, bW as xe, aA as rs, bh as os, bX as Zs, aO as is, aP as ls, aQ as cs, aS as ds, aT as us, aU as ms, aV as hs, aW as Ce, bY as ea, b6 as sa, bu as aa, bZ as ta, A as na, f as Qe, aE as ne, b_ as ra, R as ve, b$ as oa, c0 as ia, c1 as la, c2 as ca, b9 as da, V as ua, c3 as ma, c4 as ha, c5 as pa, c6 as ga, K as fa, T as va } from "./index-DB87nSG-.js";
1
+ import { jsxs as n, jsx as e, Fragment as I } from "react/jsx-runtime";
2
+ import { b as X, bC as qs, bD as _s, u as y, aG as Ke, aH as Je, B as k, aJ as We, aK as fe, bE as Me, g as Xe, ao as U, at as ke, bF as $s, b8 as Le, au as Ae, av as Ie, aw as Ee, ax as Ye, ay as be, b1 as W, aC as js, I as q, bG as Vs, bc as Qs, bH as Hs, bI as Ve, bJ as Ze, c as Y, bK as es, b4 as Bs, h as le, bL as ce, l as L, bM as ss, aA as Ks, bN as Js, L as _, bb as $, bO as Ws, bP as Xs, bQ as Ys, bR as as, bS as ts, bT as oe, bU as ie, bz as Ne, bj as ye, bV as we, bd as rs, bW as xe, aB as ns, bh as os, bX as Zs, aO as is, aP as ls, aQ as cs, aS as ds, aT as us, aU as ms, aV as hs, aW as Ce, bY as ea, b6 as sa, bu as aa, bZ as ta, G as ra, f as Qe, A as re, b_ as na, R as ve, b$ as oa, c0 as ia, c1 as la, c2 as ca, b9 as da, W as ua, c3 as ma, c4 as ha, c5 as pa, c6 as ga, M as fa, V as va } from "./index-C4H_NxAd.js";
3
3
  import * as D from "react";
4
- import { useState as b, useMemo as re, useEffect as ba } from "react";
4
+ import { useState as b, useMemo as ne, useEffect as ba } from "react";
5
5
  import "react-dom";
6
- import { D as Na, u as ya, A as wa, V as xa, S as Ca, U as Da } from "./dashboard-export-dialog-DWHbgRQ2.js";
7
- import { S as He } from "./editor-action-buttons-CRGFmZT-.js";
6
+ import { D as Na, u as ya, A as wa, V as xa, S as Ca, U as Da } from "./dashboard-export-dialog-D9RPWq-E.js";
7
+ import { S as He } from "./editor-action-buttons-CrwUOyJX.js";
8
8
  /**
9
9
  * @license lucide-react v0.453.0 - ISC
10
10
  *
@@ -74,11 +74,11 @@ const Aa = X("Sun", [
74
74
  ]);
75
75
  var Ia = qs();
76
76
  function Ea() {
77
- const { setTheme: s } = _s(), n = y(
77
+ const { setTheme: s } = _s(), r = y(
78
78
  (a) => a.actions.setDashboardTheme
79
79
  );
80
- return /* @__PURE__ */ r(Be, { children: [
81
- /* @__PURE__ */ e(Je, { asChild: !0, children: /* @__PURE__ */ r(k, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
80
+ return /* @__PURE__ */ n(Ke, { children: [
81
+ /* @__PURE__ */ e(Je, { asChild: !0, children: /* @__PURE__ */ n(k, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
82
82
  /* @__PURE__ */ e(
83
83
  Aa,
84
84
  {
@@ -95,12 +95,12 @@ function Ea() {
95
95
  ),
96
96
  /* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle theme" })
97
97
  ] }) }),
98
- /* @__PURE__ */ r(We, { align: "end", children: [
98
+ /* @__PURE__ */ n(We, { align: "end", children: [
99
99
  /* @__PURE__ */ e(
100
100
  fe,
101
101
  {
102
102
  onClick: () => {
103
- s("light"), n("light");
103
+ s("light"), r("light");
104
104
  },
105
105
  children: "Light"
106
106
  }
@@ -109,7 +109,7 @@ function Ea() {
109
109
  fe,
110
110
  {
111
111
  onClick: () => {
112
- s("dark"), n("dark");
112
+ s("dark"), r("dark");
113
113
  },
114
114
  children: "Dark"
115
115
  }
@@ -118,7 +118,7 @@ function Ea() {
118
118
  fe,
119
119
  {
120
120
  onClick: () => {
121
- s("system"), n("system");
121
+ s("system"), r("system");
122
122
  },
123
123
  children: "System"
124
124
  }
@@ -126,21 +126,21 @@ function Ea() {
126
126
  ] })
127
127
  ] });
128
128
  }
129
- async function Ta(s, n, a, t, l) {
129
+ async function Ta(s, r, a, t, l) {
130
130
  if (!l)
131
131
  return null;
132
132
  const o = JSON.stringify(a), c = `${s}/v1/lens`;
133
133
  return await Me(c, l, {
134
- name: n,
134
+ name: r,
135
135
  template: o,
136
136
  filterValues: t,
137
137
  operation: "create"
138
138
  });
139
139
  }
140
- async function De(s, n, a) {
140
+ async function De(s, r, a) {
141
141
  if (!a)
142
142
  return null;
143
- const { id: t, template: l, filterValues: o, isDefault: c, shared: u } = n, p = `${s}/v1/lens`;
143
+ const { id: t, template: l, filterValues: o, isDefault: c, shared: u } = r, p = `${s}/v1/lens`;
144
144
  return await Me(p, a, {
145
145
  lensId: t,
146
146
  template: l,
@@ -150,17 +150,17 @@ async function De(s, n, a) {
150
150
  operation: "update"
151
151
  });
152
152
  }
153
- async function Pa(s, n, a) {
153
+ async function Pa(s, r, a) {
154
154
  if (!a)
155
155
  return null;
156
156
  const t = `${s}/v1/lens`;
157
157
  return await Me(t, a, {
158
158
  operation: "delete",
159
- lensId: n
159
+ lensId: r
160
160
  });
161
161
  }
162
162
  function Ga() {
163
- const [s, n] = b(""), [a, t] = b(!1), l = y((C) => C.lenses), { setLenses: o, setSelectedLensId: c } = Xe(), [u, p] = b(!1), [f, d] = b(!1), m = y((C) => C.dashboard), g = y((C) => C.filterValues), { authToken: v, tokenProps: N } = U();
163
+ const [s, r] = b(""), [a, t] = b(!1), l = y((C) => C.lenses), { setLenses: o, setSelectedLensId: c } = Xe(), [u, p] = b(!1), [f, d] = b(!1), m = y((C) => C.dashboard), g = y((C) => C.filterValues), { authToken: v, tokenProps: N } = U();
164
164
  async function w() {
165
165
  p(!0);
166
166
  const C = await Ta(
@@ -172,8 +172,8 @@ function Ga() {
172
172
  );
173
173
  C && (o([...l || [], C]), c(C.id), d(!1)), p(!1);
174
174
  }
175
- return /* @__PURE__ */ r(ke, { open: f, onOpenChange: d, children: [
176
- /* @__PURE__ */ e($s, { asChild: !0, children: /* @__PURE__ */ r(
175
+ return /* @__PURE__ */ n(ke, { open: f, onOpenChange: d, children: [
176
+ /* @__PURE__ */ e($s, { asChild: !0, children: /* @__PURE__ */ n(
177
177
  k,
178
178
  {
179
179
  variant: "secondary",
@@ -185,19 +185,19 @@ function Ga() {
185
185
  ]
186
186
  }
187
187
  ) }),
188
- /* @__PURE__ */ r(Ae, { className: "sm:max-w-[425px]", children: [
189
- /* @__PURE__ */ r(Ie, { children: [
188
+ /* @__PURE__ */ n(Ae, { className: "sm:max-w-[425px]", children: [
189
+ /* @__PURE__ */ n(Ie, { children: [
190
190
  /* @__PURE__ */ e(Ee, { children: "Create Lens" }),
191
191
  /* @__PURE__ */ e(Ye, { children: "Lenses are private by default and are only visible to you." })
192
192
  ] }),
193
- /* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ r("div", { className: "grid grid-cols-8 items-center gap-4", children: [
193
+ /* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ n("div", { className: "grid grid-cols-8 items-center gap-4", children: [
194
194
  /* @__PURE__ */ e(be, { className: "text-right", children: "Name" }),
195
195
  /* @__PURE__ */ e(
196
196
  W,
197
197
  {
198
198
  value: s,
199
199
  onChange: (C) => {
200
- n(C.target.value);
200
+ r(C.target.value);
201
201
  },
202
202
  id: "name",
203
203
  className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
@@ -220,7 +220,7 @@ function Ga() {
220
220
  ] });
221
221
  }
222
222
  function Fa() {
223
- const [s, n] = b(!1), a = y((m) => m.lenses), t = y((m) => m.selectedLensId), { setLenses: l, setSelectedLensId: o } = Xe(), { authToken: c, tokenProps: u } = U();
223
+ const [s, r] = b(!1), a = y((m) => m.lenses), t = y((m) => m.selectedLensId), { setLenses: l, setSelectedLensId: o } = Xe(), { authToken: c, tokenProps: u } = U();
224
224
  async function p(m) {
225
225
  o(m);
226
226
  }
@@ -253,26 +253,26 @@ function Fa() {
253
253
  await De(u.apiServiceUrl, w, c == null ? void 0 : c.accessToken);
254
254
  }
255
255
  }
256
- return /* @__PURE__ */ r(Be, { open: s, onOpenChange: n, children: [
256
+ return /* @__PURE__ */ n(Ke, { open: s, onOpenChange: r, children: [
257
257
  /* @__PURE__ */ e(Je, { asChild: !0, children: /* @__PURE__ */ e(q, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(Sa, { className: "h-4 w-4" }) }) }),
258
- /* @__PURE__ */ r(We, { align: "end", className: "w-60", children: [
258
+ /* @__PURE__ */ n(We, { align: "end", className: "w-60", children: [
259
259
  /* @__PURE__ */ e(Vs, { className: "px-3", children: "Lenses" }),
260
260
  /* @__PURE__ */ e(Qs, {}),
261
- /* @__PURE__ */ r(
261
+ /* @__PURE__ */ n(
262
262
  Hs,
263
263
  {
264
264
  value: t,
265
265
  onValueChange: p,
266
266
  children: [
267
267
  /* @__PURE__ */ e(Ve, { value: "original", children: "Original" }),
268
- a == null ? void 0 : a.map((m) => /* @__PURE__ */ r(
268
+ a == null ? void 0 : a.map((m) => /* @__PURE__ */ n(
269
269
  Ve,
270
270
  {
271
271
  className: "group flex justify-between gap-2",
272
272
  value: m.id,
273
273
  children: [
274
274
  /* @__PURE__ */ e("p", { children: m.name }),
275
- /* @__PURE__ */ r("span", { className: "flex items-center gap-3", children: [
275
+ /* @__PURE__ */ n("span", { className: "flex items-center gap-3", children: [
276
276
  /* @__PURE__ */ e(
277
277
  Ze,
278
278
  {
@@ -313,8 +313,8 @@ function Fa() {
313
313
  function Oa({
314
314
  iconClassName: s
315
315
  }) {
316
- const [n, a] = b(!1), t = y((l) => l.isDownloadingPdf);
317
- return /* @__PURE__ */ r(I, { children: [
316
+ const [r, a] = b(!1), t = y((l) => l.isDownloadingPdf);
317
+ return /* @__PURE__ */ n(I, { children: [
318
318
  /* @__PURE__ */ e(
319
319
  k,
320
320
  {
@@ -323,41 +323,41 @@ function Oa({
323
323
  className: "h-7 p-2",
324
324
  disabled: t,
325
325
  onClick: () => a(!0),
326
- children: /* @__PURE__ */ e(Ks, { className: Y("size-4", s) })
326
+ children: /* @__PURE__ */ e(Bs, { className: Y("size-4", s) })
327
327
  }
328
328
  ),
329
329
  /* @__PURE__ */ e(
330
330
  Na,
331
331
  {
332
- open: n,
332
+ open: r,
333
333
  onOpenChange: a
334
334
  }
335
335
  )
336
336
  ] });
337
337
  }
338
- const Ra = async (s, n, a) => {
338
+ const Ra = async (s, r, a) => {
339
339
  const t = `${s}/management/v1/groups`;
340
- return await ss(t, n, a);
341
- }, Ua = async (s, n, a) => {
340
+ return await ss(t, r, a);
341
+ }, Ua = async (s, r, a) => {
342
342
  const t = `${s}/management/v1/groups/${a}`, l = await fetch(t, {
343
343
  method: "DELETE",
344
344
  headers: {
345
- Authorization: `Bearer ${n}`
345
+ Authorization: `Bearer ${r}`
346
346
  }
347
347
  });
348
348
  if (!l.ok) {
349
349
  const o = await l.text();
350
350
  throw new Error(o || "Failed to delete group");
351
351
  }
352
- }, za = async (s, n, a, t) => {
352
+ }, za = async (s, r, a, t) => {
353
353
  const l = `${s}/management/v1/groups/${a}/members`;
354
- return await ss(l, n, t);
355
- }, qa = async (s, n, a, t) => {
354
+ return await ss(l, r, t);
355
+ }, qa = async (s, r, a, t) => {
356
356
  const l = `${s}/management/v1/groups/${a}/members`, o = await fetch(l, {
357
357
  method: "DELETE",
358
358
  headers: {
359
359
  "Content-Type": "application/json",
360
- Authorization: `Bearer ${n}`
360
+ Authorization: `Bearer ${r}`
361
361
  },
362
362
  body: JSON.stringify(t)
363
363
  });
@@ -367,9 +367,9 @@ const Ra = async (s, n, a) => {
367
367
  }
368
368
  };
369
369
  function _a() {
370
- const { authToken: s, tokenProps: n } = U(), a = le();
370
+ const { authToken: s, tokenProps: r } = U(), a = le();
371
371
  return ce({
372
- mutationFn: (t) => Ra(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
372
+ mutationFn: (t) => Ra(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
373
373
  onSuccess: () => {
374
374
  a.invalidateQueries({ queryKey: ["groups"] }), L.success("Group created successfully");
375
375
  },
@@ -381,9 +381,9 @@ function _a() {
381
381
  });
382
382
  }
383
383
  function $a() {
384
- const { authToken: s, tokenProps: n } = U(), a = le();
384
+ const { authToken: s, tokenProps: r } = U(), a = le();
385
385
  return ce({
386
- mutationFn: (t) => Ua(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
386
+ mutationFn: (t) => Ua(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
387
387
  onSuccess: (t, l) => {
388
388
  a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", l] }), L.success("Group deleted successfully");
389
389
  },
@@ -395,12 +395,12 @@ function $a() {
395
395
  });
396
396
  }
397
397
  function ja() {
398
- const { authToken: s, tokenProps: n } = U(), a = le();
398
+ const { authToken: s, tokenProps: r } = U(), a = le();
399
399
  return ce({
400
400
  mutationFn: ({
401
401
  groupId: t,
402
402
  data: l
403
- }) => za(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, l),
403
+ }) => za(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, l),
404
404
  onSuccess: (t, l) => {
405
405
  a.invalidateQueries({ queryKey: ["group", l.groupId] }), a.invalidateQueries({
406
406
  queryKey: ["group-members", l.groupId]
@@ -414,12 +414,12 @@ function ja() {
414
414
  });
415
415
  }
416
416
  function Va() {
417
- const { authToken: s, tokenProps: n } = U(), a = le();
417
+ const { authToken: s, tokenProps: r } = U(), a = le();
418
418
  return ce({
419
419
  mutationFn: ({
420
420
  groupId: t,
421
421
  data: l
422
- }) => qa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, l),
422
+ }) => qa(r.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t, l),
423
423
  onSuccess: (t, l) => {
424
424
  a.invalidateQueries({ queryKey: ["group", l.groupId] }), a.invalidateQueries({
425
425
  queryKey: ["group-members", l.groupId]
@@ -434,20 +434,20 @@ function Va() {
434
434
  }
435
435
  function Qa({
436
436
  onSuccess: s,
437
- tenantId: n,
437
+ tenantId: r,
438
438
  isTenantUser: a
439
439
  }) {
440
440
  const [t, l] = b(""), [o, c] = b(""), [u, p] = b({}), f = _a(), d = () => {
441
441
  const g = {};
442
442
  return t.trim() ? t.length < 3 ? g.name = "Group name must be at least 3 characters" : t.length > 50 && (g.name = "Group name must be less than 50 characters") : g.name = "Group name is required", o && o.length > 200 && (g.description = "Description must be less than 200 characters"), p(g), Object.keys(g).length === 0;
443
443
  };
444
- return /* @__PURE__ */ r("form", { onSubmit: async (g) => {
444
+ return /* @__PURE__ */ n("form", { onSubmit: async (g) => {
445
445
  if (g.preventDefault(), !d()) return;
446
446
  const v = {
447
447
  name: t.trim(),
448
448
  description: o.trim() || void 0,
449
449
  type: a ? "TENANT_GROUP" : "ORG_GROUP",
450
- ...a && n ? { tenantId: n } : {}
450
+ ...a && r ? { tenantId: r } : {}
451
451
  };
452
452
  try {
453
453
  await f.mutateAsync(v), l(""), c(""), p({}), s();
@@ -455,9 +455,9 @@ function Qa({
455
455
  console.error("Failed to create group:", N);
456
456
  }
457
457
  }, className: "space-y-6", children: [
458
- /* @__PURE__ */ r("div", { className: "space-y-4", children: [
459
- /* @__PURE__ */ r("div", { className: "space-y-2", children: [
460
- /* @__PURE__ */ r(be, { htmlFor: "group-name", children: [
458
+ /* @__PURE__ */ n("div", { className: "space-y-4", children: [
459
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: [
460
+ /* @__PURE__ */ n(be, { htmlFor: "group-name", children: [
461
461
  "Group Name ",
462
462
  /* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
463
463
  ] }),
@@ -476,13 +476,13 @@ function Qa({
476
476
  ),
477
477
  u.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.name })
478
478
  ] }),
479
- /* @__PURE__ */ r("div", { className: "space-y-2", children: [
480
- /* @__PURE__ */ r(be, { htmlFor: "group-description", children: [
479
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: [
480
+ /* @__PURE__ */ n(be, { htmlFor: "group-description", children: [
481
481
  "Description",
482
482
  /* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: "(optional)" })
483
483
  ] }),
484
484
  /* @__PURE__ */ e(
485
- Bs,
485
+ Ks,
486
486
  {
487
487
  id: "group-description",
488
488
  placeholder: "Describe the purpose of this group...",
@@ -496,17 +496,17 @@ function Qa({
496
496
  }
497
497
  ),
498
498
  u.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.description }),
499
- /* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: [
499
+ /* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground", children: [
500
500
  o.length,
501
501
  "/200 characters"
502
502
  ] })
503
503
  ] }),
504
- /* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ r("div", { className: "flex gap-3", children: [
504
+ /* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ n("div", { className: "flex gap-3", children: [
505
505
  /* @__PURE__ */ e(Js, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
506
506
  /* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground", children: "This group will be accessible to users in your workspace. You can add members after creating the group." })
507
507
  ] }) })
508
508
  ] }),
509
- /* @__PURE__ */ r("div", { className: "flex justify-end gap-3", children: [
509
+ /* @__PURE__ */ n("div", { className: "flex justify-end gap-3", children: [
510
510
  /* @__PURE__ */ e(
511
511
  k,
512
512
  {
@@ -524,10 +524,10 @@ function Qa({
524
524
  {
525
525
  type: "submit",
526
526
  disabled: f.isPending || !t.trim(),
527
- children: f.isPending ? /* @__PURE__ */ r(I, { children: [
527
+ children: f.isPending ? /* @__PURE__ */ n(I, { children: [
528
528
  /* @__PURE__ */ e(_, { className: "mr-2 h-4 w-4 animate-spin" }),
529
529
  "Creating..."
530
- ] }) : /* @__PURE__ */ r(I, { children: [
530
+ ] }) : /* @__PURE__ */ n(I, { children: [
531
531
  /* @__PURE__ */ e($, { className: "mr-2 h-4 w-4" }),
532
532
  "Create Group"
533
533
  ] })
@@ -536,7 +536,7 @@ function Qa({
536
536
  ] })
537
537
  ] });
538
538
  }
539
- function Ha(s, n = []) {
539
+ function Ha(s, r = []) {
540
540
  let a = [];
541
541
  function t(o, c) {
542
542
  const u = D.createContext(c), p = a.length;
@@ -566,11 +566,11 @@ function Ha(s, n = []) {
566
566
  );
567
567
  };
568
568
  };
569
- return l.scopeName = s, [t, Ka(l, ...n)];
569
+ return l.scopeName = s, [t, Ba(l, ...r)];
570
570
  }
571
- function Ka(...s) {
572
- const n = s[0];
573
- if (s.length === 1) return n;
571
+ function Ba(...s) {
572
+ const r = s[0];
573
+ if (s.length === 1) return r;
574
574
  const a = () => {
575
575
  const t = s.map((l) => ({
576
576
  useScope: l(),
@@ -581,18 +581,18 @@ function Ka(...s) {
581
581
  const m = p(o)[`__scope${f}`];
582
582
  return { ...u, ...m };
583
583
  }, {});
584
- return D.useMemo(() => ({ [`__scope${n.scopeName}`]: c }), [c]);
584
+ return D.useMemo(() => ({ [`__scope${r.scopeName}`]: c }), [c]);
585
585
  };
586
586
  };
587
- return a.scopeName = n.scopeName, a;
587
+ return a.scopeName = r.scopeName, a;
588
588
  }
589
- function Ba(s) {
590
- const n = D.useRef(s);
589
+ function Ka(s) {
590
+ const r = D.useRef(s);
591
591
  return D.useEffect(() => {
592
- n.current = s;
592
+ r.current = s;
593
593
  }), D.useMemo(() => (...a) => {
594
594
  var t;
595
- return (t = n.current) == null ? void 0 : t.call(n, ...a);
595
+ return (t = r.current) == null ? void 0 : t.call(r, ...a);
596
596
  }, []);
597
597
  }
598
598
  var Se = globalThis != null && globalThis.document ? D.useLayoutEffect : () => {
@@ -614,12 +614,12 @@ var Se = globalThis != null && globalThis.document ? D.useLayoutEffect : () => {
614
614
  "span",
615
615
  "svg",
616
616
  "ul"
617
- ], Te = Ja.reduce((s, n) => {
618
- const a = Ws(`Primitive.${n}`), t = D.forwardRef((l, o) => {
619
- const { asChild: c, ...u } = l, p = c ? a : n;
617
+ ], Te = Ja.reduce((s, r) => {
618
+ const a = Ws(`Primitive.${r}`), t = D.forwardRef((l, o) => {
619
+ const { asChild: c, ...u } = l, p = c ? a : r;
620
620
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(p, { ...u, ref: o });
621
621
  });
622
- return t.displayName = `Primitive.${n}`, { ...s, [n]: t };
622
+ return t.displayName = `Primitive.${r}`, { ...s, [r]: t };
623
623
  }, {});
624
624
  function Wa() {
625
625
  return Ia.useSyncExternalStore(
@@ -633,7 +633,7 @@ function Xa() {
633
633
  };
634
634
  }
635
635
  var Pe = "Avatar", [Ya] = Ha(Pe), [Za, ps] = Ya(Pe), gs = D.forwardRef(
636
- (s, n) => {
636
+ (s, r) => {
637
637
  const { __scopeAvatar: a, ...t } = s, [l, o] = D.useState("idle");
638
638
  return /* @__PURE__ */ e(
639
639
  Za,
@@ -641,58 +641,58 @@ var Pe = "Avatar", [Ya] = Ha(Pe), [Za, ps] = Ya(Pe), gs = D.forwardRef(
641
641
  scope: a,
642
642
  imageLoadingStatus: l,
643
643
  onImageLoadingStatusChange: o,
644
- children: /* @__PURE__ */ e(Te.span, { ...t, ref: n })
644
+ children: /* @__PURE__ */ e(Te.span, { ...t, ref: r })
645
645
  }
646
646
  );
647
647
  }
648
648
  );
649
649
  gs.displayName = Pe;
650
650
  var fs = "AvatarImage", vs = D.forwardRef(
651
- (s, n) => {
651
+ (s, r) => {
652
652
  const { __scopeAvatar: a, src: t, onLoadingStatusChange: l = () => {
653
- }, ...o } = s, c = ps(fs, a), u = et(t, o), p = Ba((f) => {
653
+ }, ...o } = s, c = ps(fs, a), u = et(t, o), p = Ka((f) => {
654
654
  l(f), c.onImageLoadingStatusChange(f);
655
655
  });
656
656
  return Se(() => {
657
657
  u !== "idle" && p(u);
658
- }, [u, p]), u === "loaded" ? /* @__PURE__ */ e(Te.img, { ...o, ref: n, src: t }) : null;
658
+ }, [u, p]), u === "loaded" ? /* @__PURE__ */ e(Te.img, { ...o, ref: r, src: t }) : null;
659
659
  }
660
660
  );
661
661
  vs.displayName = fs;
662
662
  var bs = "AvatarFallback", Ns = D.forwardRef(
663
- (s, n) => {
663
+ (s, r) => {
664
664
  const { __scopeAvatar: a, delayMs: t, ...l } = s, o = ps(bs, a), [c, u] = D.useState(t === void 0);
665
665
  return D.useEffect(() => {
666
666
  if (t !== void 0) {
667
667
  const p = window.setTimeout(() => u(!0), t);
668
668
  return () => window.clearTimeout(p);
669
669
  }
670
- }, [t]), c && o.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Te.span, { ...l, ref: n }) : null;
670
+ }, [t]), c && o.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Te.span, { ...l, ref: r }) : null;
671
671
  }
672
672
  );
673
673
  Ns.displayName = bs;
674
- function Ke(s, n) {
675
- return s ? n ? (s.src !== n && (s.src = n), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
674
+ function Be(s, r) {
675
+ return s ? r ? (s.src !== r && (s.src = r), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
676
676
  }
677
- function et(s, { referrerPolicy: n, crossOrigin: a }) {
677
+ function et(s, { referrerPolicy: r, crossOrigin: a }) {
678
678
  const t = Wa(), l = D.useRef(null), o = t ? (l.current || (l.current = new window.Image()), l.current) : null, [c, u] = D.useState(
679
- () => Ke(o, s)
679
+ () => Be(o, s)
680
680
  );
681
681
  return Se(() => {
682
- u(Ke(o, s));
682
+ u(Be(o, s));
683
683
  }, [o, s]), Se(() => {
684
684
  const p = (m) => () => {
685
685
  u(m);
686
686
  };
687
687
  if (!o) return;
688
688
  const f = p("loaded"), d = p("error");
689
- return o.addEventListener("load", f), o.addEventListener("error", d), n && (o.referrerPolicy = n), typeof a == "string" && (o.crossOrigin = a), () => {
689
+ return o.addEventListener("load", f), o.addEventListener("error", d), r && (o.referrerPolicy = r), typeof a == "string" && (o.crossOrigin = a), () => {
690
690
  o.removeEventListener("load", f), o.removeEventListener("error", d);
691
691
  };
692
- }, [o, a, n]), c;
692
+ }, [o, a, r]), c;
693
693
  }
694
694
  var ys = gs, ws = vs, xs = Ns;
695
- const Ge = D.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
695
+ const Ge = D.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
696
696
  ys,
697
697
  {
698
698
  ref: a,
@@ -700,20 +700,20 @@ const Ge = D.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
700
700
  "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
701
701
  s
702
702
  ),
703
- ...n
703
+ ...r
704
704
  }
705
705
  ));
706
706
  Ge.displayName = ys.displayName;
707
- const st = D.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
707
+ const st = D.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
708
708
  ws,
709
709
  {
710
710
  ref: a,
711
711
  className: Y("aspect-square h-full w-full", s),
712
- ...n
712
+ ...r
713
713
  }
714
714
  ));
715
715
  st.displayName = ws.displayName;
716
- const Fe = D.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
716
+ const Fe = D.forwardRef(({ className: s, ...r }, a) => /* @__PURE__ */ e(
717
717
  xs,
718
718
  {
719
719
  ref: a,
@@ -721,13 +721,13 @@ const Fe = D.forwardRef(({ className: s, ...n }, a) => /* @__PURE__ */ e(
721
721
  "flex h-full w-full items-center justify-center rounded-full bg-muted",
722
722
  s
723
723
  ),
724
- ...n
724
+ ...r
725
725
  }
726
726
  ));
727
727
  Fe.displayName = xs.displayName;
728
728
  function at({
729
729
  open: s,
730
- onOpenChange: n,
730
+ onOpenChange: r,
731
731
  group: a,
732
732
  onUpdate: t
733
733
  }) {
@@ -736,7 +736,7 @@ function at({
736
736
  tenantId: a.tenantId || void 0,
737
737
  active: !0,
738
738
  limit: 100
739
- }), R = ja(), G = Va(), A = (g == null ? void 0 : g.members) || [], F = re(() => new Set(A.map((h) => h.userId)), [A]), P = re(() => C.filter((h) => !F.has(h.id)), [C, F]), j = re(() => {
739
+ }), R = ja(), G = Va(), A = (g == null ? void 0 : g.members) || [], F = ne(() => new Set(A.map((h) => h.userId)), [A]), P = ne(() => C.filter((h) => !F.has(h.id)), [C, F]), j = ne(() => {
740
740
  if (!c) return P;
741
741
  const h = c.toLowerCase();
742
742
  return P.filter(
@@ -745,7 +745,7 @@ function at({
745
745
  return ((E = M.name) == null ? void 0 : E.toLowerCase().includes(h)) || ((z = M.email) == null ? void 0 : z.toLowerCase().includes(h));
746
746
  }
747
747
  );
748
- }, [P, c]), x = re(() => {
748
+ }, [P, c]), x = ne(() => {
749
749
  if (!c) return A;
750
750
  const h = c.toLowerCase();
751
751
  return A.filter(
@@ -788,29 +788,29 @@ function at({
788
788
  (M) => M.includes(h) ? M.filter((E) => E !== h) : [...M, h]
789
789
  );
790
790
  };
791
- return /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(ke, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(Ae, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
792
- /* @__PURE__ */ r(Ie, { children: [
791
+ return /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(ke, { open: s, onOpenChange: r, children: /* @__PURE__ */ n(Ae, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
792
+ /* @__PURE__ */ n(Ie, { children: [
793
793
  /* @__PURE__ */ e(Ee, { children: a.name }),
794
- /* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: [
794
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ n("p", { className: "text-sm text-muted-foreground", children: [
795
795
  A.length,
796
796
  " ",
797
797
  A.length === 1 ? "member" : "members"
798
798
  ] }) }),
799
- /* @__PURE__ */ r("p", { id: "group-members-description", className: "sr-only", children: [
799
+ /* @__PURE__ */ n("p", { id: "group-members-description", className: "sr-only", children: [
800
800
  "Add or remove members from the ",
801
801
  a.name,
802
802
  " group"
803
803
  ] })
804
804
  ] }),
805
- /* @__PURE__ */ r(as, { value: l, onValueChange: (h) => {
805
+ /* @__PURE__ */ n(as, { value: l, onValueChange: (h) => {
806
806
  o(h), u(""), m([]);
807
807
  }, className: "mt-4", children: [
808
- /* @__PURE__ */ r(ts, { className: "grid w-full grid-cols-2", children: [
808
+ /* @__PURE__ */ n(ts, { className: "grid w-full grid-cols-2", children: [
809
809
  /* @__PURE__ */ e(oe, { value: "members", children: "Current Members" }),
810
810
  /* @__PURE__ */ e(oe, { value: "add", children: "Add Members" })
811
811
  ] }),
812
- /* @__PURE__ */ r(ie, { value: "members", className: "mt-4 space-y-4", children: [
813
- /* @__PURE__ */ r("div", { className: "relative", children: [
812
+ /* @__PURE__ */ n(ie, { value: "members", className: "mt-4 space-y-4", children: [
813
+ /* @__PURE__ */ n("div", { className: "relative", children: [
814
814
  /* @__PURE__ */ e(Ne, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
815
815
  /* @__PURE__ */ e(
816
816
  W,
@@ -822,7 +822,7 @@ function at({
822
822
  }
823
823
  )
824
824
  ] }),
825
- /* @__PURE__ */ e(ye, { className: d.length > 0 ? "h-[300px]" : "h-[350px]", children: v ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((h) => /* @__PURE__ */ e(we, { className: "h-16 w-full" }, h)) }) : x.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
825
+ /* @__PURE__ */ e(ye, { className: d.length > 0 ? "h-[300px]" : "h-[350px]", children: v ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((h) => /* @__PURE__ */ e(we, { className: "h-16 w-full" }, h)) }) : x.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
826
826
  /* @__PURE__ */ e($, { className: "h-12 w-12 mb-3 opacity-50" }),
827
827
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: c ? "No members found" : "No members yet" }),
828
828
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: c ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
@@ -835,8 +835,8 @@ function at({
835
835
  },
836
836
  h.id
837
837
  )) }) }),
838
- d.length > 0 && /* @__PURE__ */ r("div", { className: "flex items-center justify-between pt-4 border-t", children: [
839
- /* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground", children: [
838
+ d.length > 0 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between pt-4 border-t", children: [
839
+ /* @__PURE__ */ n("span", { className: "text-sm text-muted-foreground", children: [
840
840
  d.length,
841
841
  " member",
842
842
  d.length !== 1 ? "s" : "",
@@ -849,19 +849,19 @@ function at({
849
849
  size: "sm",
850
850
  onClick: de,
851
851
  disabled: G.isPending,
852
- children: G.isPending ? /* @__PURE__ */ r(I, { children: [
852
+ children: G.isPending ? /* @__PURE__ */ n(I, { children: [
853
853
  /* @__PURE__ */ e(_, { className: "mr-2 h-4 w-4 animate-spin" }),
854
854
  "Removing..."
855
- ] }) : /* @__PURE__ */ r(I, { children: [
856
- /* @__PURE__ */ e(ns, { className: "mr-2 h-4 w-4" }),
855
+ ] }) : /* @__PURE__ */ n(I, { children: [
856
+ /* @__PURE__ */ e(rs, { className: "mr-2 h-4 w-4" }),
857
857
  "Remove Selected"
858
858
  ] })
859
859
  }
860
860
  )
861
861
  ] })
862
862
  ] }),
863
- /* @__PURE__ */ r(ie, { value: "add", className: "mt-4 space-y-4", children: [
864
- /* @__PURE__ */ r("div", { className: "relative", children: [
863
+ /* @__PURE__ */ n(ie, { value: "add", className: "mt-4 space-y-4", children: [
864
+ /* @__PURE__ */ n("div", { className: "relative", children: [
865
865
  /* @__PURE__ */ e(Ne, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
866
866
  /* @__PURE__ */ e(
867
867
  W,
@@ -873,12 +873,12 @@ function at({
873
873
  }
874
874
  )
875
875
  ] }),
876
- /* @__PURE__ */ e(ye, { className: "h-[300px]", children: O ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((h) => /* @__PURE__ */ e(we, { className: "h-16 w-full" }, h)) }) : j.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
876
+ /* @__PURE__ */ e(ye, { className: "h-[300px]", children: O ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((h) => /* @__PURE__ */ e(we, { className: "h-16 w-full" }, h)) }) : j.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
877
877
  /* @__PURE__ */ e(xe, { className: "h-12 w-12 mb-3 opacity-50" }),
878
878
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
879
879
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: c ? "Try a different search" : "All eligible users are already members" })
880
880
  ] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: j.map((h) => /* @__PURE__ */ e(
881
- nt,
881
+ rt,
882
882
  {
883
883
  user: h,
884
884
  selected: p.includes(h.id),
@@ -886,8 +886,8 @@ function at({
886
886
  },
887
887
  h.id
888
888
  )) }) }),
889
- p.length > 0 && /* @__PURE__ */ r("div", { className: "flex items-center justify-between pt-4 border-t", children: [
890
- /* @__PURE__ */ r("span", { className: "text-sm text-muted-foreground", children: [
889
+ p.length > 0 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between pt-4 border-t", children: [
890
+ /* @__PURE__ */ n("span", { className: "text-sm text-muted-foreground", children: [
891
891
  p.length,
892
892
  " user",
893
893
  p.length !== 1 ? "s" : "",
@@ -898,10 +898,10 @@ function at({
898
898
  {
899
899
  onClick: V,
900
900
  disabled: R.isPending,
901
- children: R.isPending ? /* @__PURE__ */ r(I, { children: [
901
+ children: R.isPending ? /* @__PURE__ */ n(I, { children: [
902
902
  /* @__PURE__ */ e(_, { className: "mr-2 h-4 w-4 animate-spin" }),
903
903
  "Adding..."
904
- ] }) : /* @__PURE__ */ r(I, { children: [
904
+ ] }) : /* @__PURE__ */ n(I, { children: [
905
905
  /* @__PURE__ */ e(xe, { className: "mr-2 h-4 w-4" }),
906
906
  "Add Members"
907
907
  ] })
@@ -914,20 +914,20 @@ function at({
914
914
  }
915
915
  function tt({
916
916
  member: s,
917
- selected: n,
917
+ selected: r,
918
918
  onToggle: a
919
919
  }) {
920
920
  var l, o, c, u;
921
921
  const t = ((o = (l = s.user) == null ? void 0 : l.name) == null ? void 0 : o.split(" ").map((p) => p[0]).join("").toUpperCase()) || "?";
922
- return /* @__PURE__ */ r(
922
+ return /* @__PURE__ */ n(
923
923
  "div",
924
924
  {
925
925
  className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
926
926
  onClick: a,
927
927
  children: [
928
- /* @__PURE__ */ e(rs, { checked: n }),
928
+ /* @__PURE__ */ e(ns, { checked: r }),
929
929
  /* @__PURE__ */ e(Ge, { className: "h-8 w-8", children: /* @__PURE__ */ e(Fe, { className: "text-xs", children: t }) }),
930
- /* @__PURE__ */ r("div", { className: "flex-1", children: [
930
+ /* @__PURE__ */ n("div", { className: "flex-1", children: [
931
931
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((c = s.user) == null ? void 0 : c.name) || "Unknown User" }),
932
932
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (u = s.user) == null ? void 0 : u.email })
933
933
  ] })
@@ -935,22 +935,22 @@ function tt({
935
935
  }
936
936
  );
937
937
  }
938
- function nt({
938
+ function rt({
939
939
  user: s,
940
- selected: n,
940
+ selected: r,
941
941
  onToggle: a
942
942
  }) {
943
943
  var l;
944
944
  const t = ((l = s.name) == null ? void 0 : l.split(" ").map((o) => o[0]).join("").toUpperCase()) || "?";
945
- return /* @__PURE__ */ r(
945
+ return /* @__PURE__ */ n(
946
946
  "div",
947
947
  {
948
948
  className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
949
949
  onClick: a,
950
950
  children: [
951
- /* @__PURE__ */ e(rs, { checked: n }),
951
+ /* @__PURE__ */ e(ns, { checked: r }),
952
952
  /* @__PURE__ */ e(Ge, { className: "h-8 w-8", children: /* @__PURE__ */ e(Fe, { className: "text-xs", children: t }) }),
953
- /* @__PURE__ */ r("div", { className: "flex-1", children: [
953
+ /* @__PURE__ */ n("div", { className: "flex-1", children: [
954
954
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: s.name }),
955
955
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: s.email })
956
956
  ] })
@@ -958,9 +958,9 @@ function nt({
958
958
  }
959
959
  );
960
960
  }
961
- function rt({
961
+ function nt({
962
962
  open: s,
963
- onOpenChange: n
963
+ onOpenChange: r
964
964
  }) {
965
965
  const [a, t] = b("groups"), [l, o] = b(""), [c, u] = b(null), [p, f] = b(!1), [d, m] = b(null), { tokenProps: g } = U(), { currentUser: v } = os(), N = $a(), w = (v == null ? void 0 : v.type) === "tenant", C = g == null ? void 0 : g.tenantId, { groups: O, isLoading: R, refetch: G } = Zs({
966
966
  type: w ? "TENANT_GROUP" : "all",
@@ -983,28 +983,28 @@ function rt({
983
983
  }, j = () => {
984
984
  t("groups"), G();
985
985
  };
986
- return /* @__PURE__ */ r(I, { children: [
987
- /* @__PURE__ */ e(ke, { open: s, onOpenChange: n, children: /* @__PURE__ */ r(Ae, { className: "max-w-4xl max-h-[80vh]", children: [
988
- /* @__PURE__ */ r(Ie, { children: [
989
- /* @__PURE__ */ r(Ee, { className: "flex items-center gap-2", children: [
986
+ return /* @__PURE__ */ n(I, { children: [
987
+ /* @__PURE__ */ e(ke, { open: s, onOpenChange: r, children: /* @__PURE__ */ n(Ae, { className: "max-w-4xl max-h-[80vh]", children: [
988
+ /* @__PURE__ */ n(Ie, { children: [
989
+ /* @__PURE__ */ n(Ee, { className: "flex items-center gap-2", children: [
990
990
  /* @__PURE__ */ e($, { className: "h-5 w-5" }),
991
991
  "Group Management"
992
992
  ] }),
993
993
  /* @__PURE__ */ e(Ye, { children: "Manage your groups, create new groups, and control group membership" })
994
994
  ] }),
995
- /* @__PURE__ */ r(as, { value: a, onValueChange: t, className: "mt-4", children: [
996
- /* @__PURE__ */ r(ts, { className: "grid w-full grid-cols-2", children: [
997
- /* @__PURE__ */ r(oe, { value: "groups", className: "flex items-center gap-2", children: [
995
+ /* @__PURE__ */ n(as, { value: a, onValueChange: t, className: "mt-4", children: [
996
+ /* @__PURE__ */ n(ts, { className: "grid w-full grid-cols-2", children: [
997
+ /* @__PURE__ */ n(oe, { value: "groups", className: "flex items-center gap-2", children: [
998
998
  /* @__PURE__ */ e($, { className: "h-4 w-4" }),
999
999
  "Groups"
1000
1000
  ] }),
1001
- /* @__PURE__ */ r(oe, { value: "create", className: "flex items-center gap-2", children: [
1001
+ /* @__PURE__ */ n(oe, { value: "create", className: "flex items-center gap-2", children: [
1002
1002
  /* @__PURE__ */ e(Le, { className: "h-4 w-4" }),
1003
1003
  "Create Group"
1004
1004
  ] })
1005
1005
  ] }),
1006
- /* @__PURE__ */ e(ie, { value: "groups", className: "mt-4", children: /* @__PURE__ */ r("div", { className: "space-y-4", children: [
1007
- /* @__PURE__ */ r("div", { className: "relative", children: [
1006
+ /* @__PURE__ */ e(ie, { value: "groups", className: "mt-4", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
1007
+ /* @__PURE__ */ n("div", { className: "relative", children: [
1008
1008
  /* @__PURE__ */ e(Ne, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
1009
1009
  /* @__PURE__ */ e(
1010
1010
  W,
@@ -1016,7 +1016,7 @@ function rt({
1016
1016
  }
1017
1017
  )
1018
1018
  ] }),
1019
- /* @__PURE__ */ e(ye, { className: "h-[400px]", children: R ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((x) => /* @__PURE__ */ e(we, { className: "h-24 w-full" }, x)) }) : A.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1019
+ /* @__PURE__ */ e(ye, { className: "h-[400px]", children: R ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((x) => /* @__PURE__ */ e(we, { className: "h-24 w-full" }, x)) }) : A.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
1020
1020
  /* @__PURE__ */ e($, { className: "h-12 w-12 mb-3 opacity-50" }),
1021
1021
  /* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
1022
1022
  /* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
@@ -1055,16 +1055,16 @@ function rt({
1055
1055
  {
1056
1056
  open: !!d,
1057
1057
  onOpenChange: () => m(null),
1058
- children: /* @__PURE__ */ r(ls, { children: [
1059
- /* @__PURE__ */ r(cs, { children: [
1058
+ children: /* @__PURE__ */ n(ls, { children: [
1059
+ /* @__PURE__ */ n(cs, { children: [
1060
1060
  /* @__PURE__ */ e(ds, { children: "Delete Group" }),
1061
- /* @__PURE__ */ r(us, { children: [
1061
+ /* @__PURE__ */ n(us, { children: [
1062
1062
  'Are you sure you want to delete "',
1063
1063
  d == null ? void 0 : d.name,
1064
1064
  '"? This action cannot be undone and will remove all members from the group.'
1065
1065
  ] })
1066
1066
  ] }),
1067
- /* @__PURE__ */ r(ms, { children: [
1067
+ /* @__PURE__ */ n(ms, { children: [
1068
1068
  /* @__PURE__ */ e(hs, { children: "Cancel" }),
1069
1069
  /* @__PURE__ */ e(
1070
1070
  Ce,
@@ -1072,7 +1072,7 @@ function rt({
1072
1072
  onClick: F,
1073
1073
  disabled: N.isPending,
1074
1074
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
1075
- children: N.isPending ? /* @__PURE__ */ r(I, { children: [
1075
+ children: N.isPending ? /* @__PURE__ */ n(I, { children: [
1076
1076
  /* @__PURE__ */ e(_, { className: "mr-2 h-4 w-4 animate-spin" }),
1077
1077
  "Deleting..."
1078
1078
  ] }) : "Delete Group"
@@ -1086,37 +1086,37 @@ function rt({
1086
1086
  }
1087
1087
  function ot({
1088
1088
  group: s,
1089
- onManageMembers: n,
1089
+ onManageMembers: r,
1090
1090
  onDelete: a,
1091
1091
  currentUserId: t
1092
1092
  }) {
1093
1093
  const l = s.createdBy === t;
1094
- return /* @__PURE__ */ e("div", { className: "rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50", children: /* @__PURE__ */ r("div", { className: "flex items-start justify-between gap-3", children: [
1095
- /* @__PURE__ */ r("div", { className: "flex-1 space-y-2", children: [
1096
- /* @__PURE__ */ r("div", { children: [
1094
+ return /* @__PURE__ */ e("div", { className: "rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50", children: /* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-3", children: [
1095
+ /* @__PURE__ */ n("div", { className: "flex-1 space-y-2", children: [
1096
+ /* @__PURE__ */ n("div", { children: [
1097
1097
  /* @__PURE__ */ e("h4", { className: "font-medium", children: s.name }),
1098
1098
  s.description && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mt-1", children: s.description })
1099
1099
  ] }),
1100
- /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
1101
- /* @__PURE__ */ r("span", { className: "flex items-center gap-1", children: [
1100
+ /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
1101
+ /* @__PURE__ */ n("span", { className: "flex items-center gap-1", children: [
1102
1102
  /* @__PURE__ */ e($, { className: "h-3 w-3" }),
1103
1103
  s.memberCount,
1104
1104
  " ",
1105
1105
  s.memberCount === 1 ? "member" : "members"
1106
1106
  ] }),
1107
- /* @__PURE__ */ r("span", { children: [
1107
+ /* @__PURE__ */ n("span", { children: [
1108
1108
  "Created ",
1109
1109
  ea(new Date(s.createdAt), "MMM d, yyyy")
1110
1110
  ] })
1111
1111
  ] })
1112
1112
  ] }),
1113
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
1113
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
1114
1114
  /* @__PURE__ */ e(
1115
1115
  k,
1116
1116
  {
1117
1117
  variant: "ghost",
1118
1118
  size: "sm",
1119
- onClick: n,
1119
+ onClick: r,
1120
1120
  title: "Manage members",
1121
1121
  children: /* @__PURE__ */ e(xe, { className: "h-4 w-4" })
1122
1122
  }
@@ -1129,7 +1129,7 @@ function ot({
1129
1129
  onClick: a,
1130
1130
  title: "Delete group",
1131
1131
  className: "text-destructive hover:text-destructive",
1132
- children: /* @__PURE__ */ e(ns, { className: "h-4 w-4" })
1132
+ children: /* @__PURE__ */ e(rs, { className: "h-4 w-4" })
1133
1133
  }
1134
1134
  )
1135
1135
  ] })
@@ -1139,9 +1139,9 @@ function pt() {
1139
1139
  var _e, $e, je;
1140
1140
  const {
1141
1141
  authToken: s,
1142
- tokenProps: n,
1142
+ tokenProps: r,
1143
1143
  id: a
1144
- } = U(), { isLocalDev: t } = sa(), { permissions: l } = aa(), o = ta(), { isLoading: c } = na();
1144
+ } = U(), { isLocalDev: t } = sa(), { permissions: l } = aa(), o = ta(), { isLoading: c } = ra();
1145
1145
  y((i) => i.theme);
1146
1146
  const u = y((i) => i.lenses), p = y((i) => i.selectedLensId), f = u == null ? void 0 : u.find((i) => i.id === p), d = y((i) => i.dashboard);
1147
1147
  y((i) => i.selectedSheetId);
@@ -1151,24 +1151,24 @@ function pt() {
1151
1151
  (i) => i.actions.setIsDashboardPanelOpen
1152
1152
  ), ue = y((i) => i.filterValues), S = y((i) => i.isVisualEditing);
1153
1153
  Qe((i) => i.card);
1154
- const h = ne(
1154
+ const h = re(
1155
1155
  (i) => i.selectedDashboard
1156
- ), M = ne(
1156
+ ), M = re(
1157
1157
  (i) => i.initialDashboard
1158
1158
  );
1159
- ne((i) => i.selectedVisual), y((i) => i.selectedFrameId), Qe((i) => i.frame);
1159
+ re((i) => i.selectedVisual), y((i) => i.selectedFrameId), Qe((i) => i.frame);
1160
1160
  const E = h ? ($e = h == null ? void 0 : h.permissions) == null ? void 0 : $e.canEdit : (_e = M == null ? void 0 : M.permissions) == null ? void 0 : _e.canEdit, z = y((i) => i.showFilters), Z = y(
1161
1161
  (i) => i.showDashboardJSON
1162
1162
  ), Q = y((i) => i.onSaveFunction), Cs = y(
1163
1163
  (i) => i.actions.setShowFilters
1164
1164
  ), { setIsDashboardEditing: Oe, setShowDashboardJSON: Re } = y(
1165
1165
  (i) => i.actions
1166
- ), { setInitialDashboard: Ue, clearSelectedDashboard: Ds } = ne(
1166
+ ), { setInitialDashboard: Ue, clearSelectedDashboard: Ds } = re(
1167
1167
  (i) => i.actions
1168
- ), { resources: ee } = ra(ve.DASHBOARD), { currentUser: Ss } = os(), Ms = oa(Ss), H = h || M, ze = H ? {
1168
+ ), { resources: ee } = na(ve.DASHBOARD), { currentUser: Ss } = os(), Ms = oa(Ss), H = h || M, ze = H ? {
1169
1169
  id: H.id,
1170
1170
  title: (d == null ? void 0 : d.title) || H.title || "Dashboard"
1171
- } : null, { handleAddNewFrame: ks } = ia(), [K, me] = b(!1), [Ls, se] = b(!1), ae = la(ve.DASHBOARD), [B, he] = b(
1171
+ } : null, { handleAddNewFrame: ks } = ia(), [B, me] = b(!1), [Ls, se] = b(!1), ae = la(ve.DASHBOARD), [K, he] = b(
1172
1172
  null
1173
1173
  ), As = async (i, T) => {
1174
1174
  if (!(d != null && d.id)) {
@@ -1205,7 +1205,7 @@ function pt() {
1205
1205
  }
1206
1206
  }
1207
1207
  }, [ee, d == null ? void 0 : d.id, Ue]);
1208
- const te = n.orgUserId || n.tenantId, Is = m && !S && te && E, { setDashboard: Es } = y((i) => i.actions), Ts = () => {
1208
+ const te = r.orgUserId || r.tenantId, Is = m && !S && te && E, { setDashboard: Es } = y((i) => i.actions), Ts = () => {
1209
1209
  Oe(!0);
1210
1210
  }, pe = () => {
1211
1211
  Oe(!1), Re(!1), he(null);
@@ -1213,15 +1213,15 @@ function pt() {
1213
1213
  ya(
1214
1214
  m,
1215
1215
  d,
1216
- B,
1216
+ K,
1217
1217
  (i) => he(i)
1218
1218
  );
1219
- const Ps = () => B ? JSON.stringify(d) !== JSON.stringify(B) : !1, Gs = () => {
1219
+ const Ps = () => K ? JSON.stringify(d) !== JSON.stringify(K) : !1, Gs = () => {
1220
1220
  Ps() ? se(!0) : pe();
1221
1221
  }, Fs = async () => {
1222
1222
  await ge({ closeAfterSave: !0 });
1223
1223
  }, Os = () => {
1224
- B && Es(B), pe(), se(!1);
1224
+ K && Es(K), pe(), se(!1);
1225
1225
  };
1226
1226
  async function ge(i) {
1227
1227
  const T = (i == null ? void 0 : i.closeAfterSave) ?? j;
@@ -1254,7 +1254,7 @@ function pt() {
1254
1254
  filterValues: ue
1255
1255
  };
1256
1256
  await De(
1257
- n.apiServiceUrl,
1257
+ r.apiServiceUrl,
1258
1258
  T,
1259
1259
  s == null ? void 0 : s.accessToken
1260
1260
  ), L.success("Lens saved"), Q == null || Q(d), N(!1);
@@ -1266,15 +1266,15 @@ function pt() {
1266
1266
  dashboardId: d == null ? void 0 : d.id,
1267
1267
  currentLensName: f == null ? void 0 : f.name
1268
1268
  });
1269
- const Us = n.orgUserId || n.tenantId && n.endUserId && n.endUserEmail;
1270
- return /* @__PURE__ */ r(
1269
+ const Us = r.orgUserId || r.tenantId && r.endUserId && r.endUserEmail;
1270
+ return /* @__PURE__ */ n(
1271
1271
  "div",
1272
1272
  {
1273
1273
  className: "flex h-11 items-center justify-between gap-2 border-b px-4 py-2",
1274
1274
  role: "dashboard-controls",
1275
1275
  children: [
1276
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1277
- Us && /* @__PURE__ */ r(I, { children: [
1276
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1277
+ Us && /* @__PURE__ */ n(I, { children: [
1278
1278
  /* @__PURE__ */ e(
1279
1279
  q,
1280
1280
  {
@@ -1298,7 +1298,7 @@ function pt() {
1298
1298
  }
1299
1299
  )
1300
1300
  ] }),
1301
- !S && o && (c ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1301
+ !S && o && (c ? /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1302
1302
  /* @__PURE__ */ e(_, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
1303
1303
  /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
1304
1304
  ] }) : /* @__PURE__ */ e(
@@ -1322,12 +1322,12 @@ function pt() {
1322
1322
  }
1323
1323
  ))
1324
1324
  ] }),
1325
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
1326
- S && /* @__PURE__ */ r(I, { children: [
1325
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
1326
+ S && /* @__PURE__ */ n(I, { children: [
1327
1327
  /* @__PURE__ */ e(wa, { className: "mr-2" }),
1328
1328
  /* @__PURE__ */ e(xa, { className: "h-7" })
1329
1329
  ] }),
1330
- t && !S && /* @__PURE__ */ r(I, { children: [
1330
+ t && !S && /* @__PURE__ */ n(I, { children: [
1331
1331
  /* @__PURE__ */ e(
1332
1332
  q,
1333
1333
  {
@@ -1344,7 +1344,7 @@ function pt() {
1344
1344
  q,
1345
1345
  {
1346
1346
  tooltip: "Invalidate Token",
1347
- onClick: () => ua(n.apiServiceUrl),
1347
+ onClick: () => ua(r.apiServiceUrl),
1348
1348
  className: "h-7 p-2",
1349
1349
  children: /* @__PURE__ */ e(La, { className: "h-4 w-4" })
1350
1350
  }
@@ -1382,7 +1382,7 @@ function pt() {
1382
1382
  ),
1383
1383
  m && !S && te && t && o && /* @__PURE__ */ e(Ga, {}),
1384
1384
  !S && te && t && o && /* @__PURE__ */ e(Fa, {}),
1385
- m && !S && te && f && t && o && /* @__PURE__ */ r(
1385
+ m && !S && te && f && t && o && /* @__PURE__ */ n(
1386
1386
  k,
1387
1387
  {
1388
1388
  className: "h-7 p-2",
@@ -1396,7 +1396,7 @@ function pt() {
1396
1396
  ]
1397
1397
  }
1398
1398
  ),
1399
- m && !S && o && /* @__PURE__ */ r(
1399
+ m && !S && o && /* @__PURE__ */ n(
1400
1400
  k,
1401
1401
  {
1402
1402
  variant: "outline",
@@ -1410,7 +1410,7 @@ function pt() {
1410
1410
  ]
1411
1411
  }
1412
1412
  ),
1413
- !S && !m && l.canEdit && o && /* @__PURE__ */ r(
1413
+ !S && !m && l.canEdit && o && /* @__PURE__ */ n(
1414
1414
  k,
1415
1415
  {
1416
1416
  variant: "outline",
@@ -1423,16 +1423,16 @@ function pt() {
1423
1423
  ]
1424
1424
  }
1425
1425
  ),
1426
- Is && o && /* @__PURE__ */ r(
1426
+ Is && o && /* @__PURE__ */ n(
1427
1427
  k,
1428
1428
  {
1429
1429
  className: "h-7 p-2",
1430
- disabled: K,
1430
+ disabled: B,
1431
1431
  onClick: () => ge(),
1432
1432
  size: "sm",
1433
1433
  children: [
1434
- K ? /* @__PURE__ */ e(_, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(He, { className: "mr-2 h-4 w-4" }),
1435
- K ? "Saving..." : "Save"
1434
+ B ? /* @__PURE__ */ e(_, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(He, { className: "mr-2 h-4 w-4" }),
1435
+ B ? "Saving..." : "Save"
1436
1436
  ]
1437
1437
  }
1438
1438
  ),
@@ -1447,7 +1447,7 @@ function pt() {
1447
1447
  }
1448
1448
  ) }),
1449
1449
  !S && t && /* @__PURE__ */ e(Ea, {}),
1450
- m && !S && o && /* @__PURE__ */ r(
1450
+ m && !S && o && /* @__PURE__ */ n(
1451
1451
  k,
1452
1452
  {
1453
1453
  variant: "outline",
@@ -1468,7 +1468,7 @@ function pt() {
1468
1468
  }
1469
1469
  ),
1470
1470
  /* @__PURE__ */ e(
1471
- rt,
1471
+ nt,
1472
1472
  {
1473
1473
  open: O,
1474
1474
  onOpenChange: R
@@ -1479,14 +1479,14 @@ function pt() {
1479
1479
  {
1480
1480
  open: G,
1481
1481
  onOpenChange: (i) => {
1482
- !i && K && !F || (A(i), i || (P(null), x(!1)));
1482
+ !i && B && !F || (A(i), i || (P(null), x(!1)));
1483
1483
  },
1484
- children: /* @__PURE__ */ r(ls, { className: "max-w-sm", children: [
1485
- /* @__PURE__ */ r(cs, { children: [
1484
+ children: /* @__PURE__ */ n(ls, { className: "max-w-sm", children: [
1485
+ /* @__PURE__ */ n(cs, { children: [
1486
1486
  /* @__PURE__ */ e(ds, { children: F ? "Save failed" : "Saving dashboard" }),
1487
1487
  /* @__PURE__ */ e(us, { className: "pt-2", children: F ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." })
1488
1488
  ] }),
1489
- /* @__PURE__ */ e(ms, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: F ? /* @__PURE__ */ r(I, { children: [
1489
+ /* @__PURE__ */ e(ms, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: F ? /* @__PURE__ */ n(I, { children: [
1490
1490
  /* @__PURE__ */ e(
1491
1491
  hs,
1492
1492
  {
@@ -1505,7 +1505,7 @@ function pt() {
1505
1505
  children: "Retry"
1506
1506
  }
1507
1507
  )
1508
- ] }) : /* @__PURE__ */ r(
1508
+ ] }) : /* @__PURE__ */ n(
1509
1509
  Ce,
1510
1510
  {
1511
1511
  disabled: !0,
@@ -1526,7 +1526,7 @@ function pt() {
1526
1526
  onOpenChange: se,
1527
1527
  onSave: Fs,
1528
1528
  onDiscard: Os,
1529
- isSaving: K
1529
+ isSaving: B
1530
1530
  }
1531
1531
  )
1532
1532
  ] })