react-semaphor 0.1.115 → 0.1.117
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.
- package/dist/chunks/{dashboard-controls-BQDmKxxN.js → dashboard-controls-BVyKYGSS.js} +264 -251
- package/dist/chunks/{dashboard-controls-YDGnMyyK.js → dashboard-controls-BfjTgw7o.js} +4 -4
- package/dist/chunks/{dashboard-json-BHAPV0Eh.js → dashboard-json-D6wa6YoM.js} +1 -1
- package/dist/chunks/{dashboard-json-D-gw81va.js → dashboard-json-DT3-XQFT.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CadUC2o0.js → edit-dashboard-visual-B783wHIy.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-D8DmYTKj.js → edit-dashboard-visual-BiAkxXjP.js} +165 -165
- package/dist/chunks/{editor-action-buttons-Cz-qv-g3.js → editor-action-buttons-BmFpFk-_.js} +2 -2
- package/dist/chunks/{editor-action-buttons-CJ1R-8qC.js → editor-action-buttons-CiZYTAan.js} +1 -1
- package/dist/chunks/{index-Bf4pgVkQ.js → index-BYYUZIiS.js} +2894 -2889
- package/dist/chunks/{index-WFJ2bdm0.js → index-Cwi4U3XN.js} +67 -67
- package/dist/chunks/resource-management-panel-C9DAKT2s.js +6 -0
- package/dist/chunks/resource-management-panel-xtVaOdeV.js +895 -0
- package/dist/chunks/{schedule-dashboard-DlYi6cPQ.js → schedule-dashboard-BjjU3_uS.js} +1 -1
- package/dist/chunks/{schedule-dashboard-BJ0PeQTb.js → schedule-dashboard-bnGqtUi1.js} +3 -3
- package/dist/chunks/{use-visual-utils-DlzVpKYl.js → use-visual-utils-B-h2YrMC.js} +1 -1
- package/dist/chunks/{use-visual-utils-DlurLDVv.js → use-visual-utils-DTdxZgvk.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/resource-management-panel-BXzn0kHW.js +0 -6
- package/dist/chunks/resource-management-panel-ByY6ZxCb.js +0 -878
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsxs as r, jsx as e, Fragment as
|
|
2
|
-
import { b as J,
|
|
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-BYYUZIiS.js";
|
|
3
3
|
import * as S from "react";
|
|
4
|
-
import { useState as
|
|
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
|
|
7
|
-
import { S as $e } from "./editor-action-buttons-
|
|
6
|
+
import { g as we, A as ia, V as la, S as ca } from "./schedule-dashboard-bnGqtUi1.js";
|
|
7
|
+
import { S as $e } from "./editor-action-buttons-BmFpFk-_.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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
76
|
-
function
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
157
|
+
return await Me(t, a, {
|
|
158
158
|
operation: "delete",
|
|
159
159
|
lensId: n
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
const [s, n] =
|
|
164
|
-
async function
|
|
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
|
|
166
|
+
const k = we(
|
|
167
167
|
c
|
|
168
|
-
),
|
|
168
|
+
), A = await ba(
|
|
169
169
|
v.apiServiceUrl,
|
|
170
170
|
s,
|
|
171
|
-
|
|
171
|
+
k,
|
|
172
172
|
p,
|
|
173
173
|
b == null ? void 0 : b.accessToken
|
|
174
174
|
);
|
|
175
|
-
|
|
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
|
-
|
|
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
|
-
|
|
198
|
+
V,
|
|
199
199
|
{
|
|
200
200
|
value: s,
|
|
201
|
-
onChange: (
|
|
202
|
-
n(
|
|
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(
|
|
211
|
-
|
|
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:
|
|
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
|
|
225
|
-
const [s, n] =
|
|
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
|
|
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((
|
|
237
|
-
...
|
|
236
|
+
const p = a == null ? void 0 : a.map((D) => D.id === c.id ? {
|
|
237
|
+
...D,
|
|
238
238
|
isDefault: !c.isDefault
|
|
239
239
|
} : {
|
|
240
|
-
...
|
|
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((
|
|
249
|
+
const v = a == null ? void 0 : a.find((D) => D.isDefault);
|
|
250
250
|
if (v && v.id !== c.id) {
|
|
251
|
-
const
|
|
251
|
+
const D = {
|
|
252
252
|
...v,
|
|
253
253
|
isDefault: !1
|
|
254
254
|
};
|
|
255
|
-
await xe(m.apiServiceUrl,
|
|
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(
|
|
260
|
-
/* @__PURE__ */ r(
|
|
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
|
|
315
|
+
function wa({
|
|
316
316
|
iconClassName: s
|
|
317
317
|
}) {
|
|
318
|
-
const [n, a] =
|
|
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 =
|
|
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),
|
|
324
|
+
await ze(h.apiServiceUrl), w.dismiss(c), w.success("PDF downloaded successfully!", {
|
|
325
325
|
duration: 2e3
|
|
326
326
|
});
|
|
327
327
|
} catch (p) {
|
|
328
|
-
|
|
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 =
|
|
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),
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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(
|
|
412
|
+
/* @__PURE__ */ r(Ve, { children: [
|
|
413
413
|
/* @__PURE__ */ e(
|
|
414
|
-
|
|
414
|
+
M,
|
|
415
415
|
{
|
|
416
416
|
variant: "outline",
|
|
417
417
|
onClick: () => a(!1),
|
|
418
418
|
children: "Cancel"
|
|
419
419
|
}
|
|
420
420
|
),
|
|
421
|
-
/* @__PURE__ */ e(
|
|
421
|
+
/* @__PURE__ */ e(M, { onClick: u, disabled: !t, children: "Download" })
|
|
422
422
|
] })
|
|
423
423
|
] })
|
|
424
424
|
}
|
|
425
425
|
)
|
|
426
426
|
] });
|
|
427
427
|
}
|
|
428
|
-
const
|
|
428
|
+
const xa = async (s, n, a) => {
|
|
429
429
|
const t = `${s}/management/v1/groups`;
|
|
430
430
|
return await Ke(t, n, a);
|
|
431
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
|
459
|
+
function ka() {
|
|
460
460
|
const { authToken: s, tokenProps: n } = R(), a = de();
|
|
461
461
|
return ue({
|
|
462
|
-
mutationFn: (t) =>
|
|
462
|
+
mutationFn: (t) => xa(n.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", t),
|
|
463
463
|
onSuccess: () => {
|
|
464
|
-
a.invalidateQueries({ queryKey: ["groups"] }),
|
|
464
|
+
a.invalidateQueries({ queryKey: ["groups"] }), w.success("Group created successfully");
|
|
465
465
|
},
|
|
466
466
|
onError: (t) => {
|
|
467
|
-
console.error("Failed to create group:", t),
|
|
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) =>
|
|
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] }),
|
|
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),
|
|
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
|
|
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
|
-
}) =>
|
|
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"] }),
|
|
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),
|
|
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
|
|
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
|
-
}) =>
|
|
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"] }),
|
|
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),
|
|
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
|
|
525
|
+
function Aa({
|
|
526
526
|
onSuccess: s,
|
|
527
527
|
tenantId: n,
|
|
528
528
|
isTenantUser: a
|
|
529
529
|
}) {
|
|
530
|
-
const [t, i] =
|
|
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
|
-
|
|
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
|
-
|
|
601
|
+
M,
|
|
602
602
|
{
|
|
603
603
|
type: "button",
|
|
604
604
|
variant: "outline",
|
|
@@ -610,15 +610,15 @@ function Pa({
|
|
|
610
610
|
}
|
|
611
611
|
),
|
|
612
612
|
/* @__PURE__ */ e(
|
|
613
|
-
|
|
613
|
+
M,
|
|
614
614
|
{
|
|
615
615
|
type: "submit",
|
|
616
616
|
disabled: f.isPending || !t.trim(),
|
|
617
|
-
children: f.isPending ? /* @__PURE__ */ r(
|
|
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(
|
|
621
|
-
/* @__PURE__ */ e(
|
|
620
|
+
] }) : /* @__PURE__ */ r(P, { children: [
|
|
621
|
+
/* @__PURE__ */ e($, { className: "mr-2 h-4 w-4" }),
|
|
622
622
|
"Create Group"
|
|
623
623
|
] })
|
|
624
624
|
}
|
|
@@ -626,20 +626,20 @@ function Pa({
|
|
|
626
626
|
] })
|
|
627
627
|
] });
|
|
628
628
|
}
|
|
629
|
-
function
|
|
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
|
|
636
|
-
const { scope: p, children: b, ...v } = c,
|
|
637
|
-
return /* @__PURE__ */ e(
|
|
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
|
|
642
|
-
const 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,
|
|
659
|
+
return i.scopeName = s, [t, Ea(i, ...n)];
|
|
660
660
|
}
|
|
661
|
-
function
|
|
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
|
|
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
|
-
},
|
|
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 =
|
|
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
|
|
715
|
-
return
|
|
716
|
-
|
|
714
|
+
function Ga() {
|
|
715
|
+
return ga.useSyncExternalStore(
|
|
716
|
+
Ra,
|
|
717
717
|
() => !0,
|
|
718
718
|
() => !1
|
|
719
719
|
);
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function Ra() {
|
|
722
722
|
return () => {
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
|
-
var Ie = "Avatar", [
|
|
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
|
-
|
|
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 =
|
|
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(() => {
|
|
@@ -764,8 +764,8 @@ ns.displayName = rs;
|
|
|
764
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
|
|
768
|
-
const t =
|
|
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
769
|
() => je(o, s)
|
|
770
770
|
);
|
|
771
771
|
return De(() => {
|
|
@@ -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
|
|
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
|
-
|
|
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
|
|
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] =
|
|
825
|
-
type:
|
|
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 =
|
|
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
|
|
835
|
-
return ((
|
|
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]),
|
|
839
|
-
if (!l) return
|
|
838
|
+
}, [N, l]), C = ae(() => {
|
|
839
|
+
if (!l) return I;
|
|
840
840
|
const g = l.toLowerCase();
|
|
841
|
-
return
|
|
841
|
+
return I.filter(
|
|
842
842
|
(L) => {
|
|
843
|
-
var
|
|
844
|
-
return ((q = (
|
|
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
|
-
}, [
|
|
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:
|
|
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((
|
|
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((
|
|
878
|
+
(L) => L.includes(g) ? L.filter((E) => E !== g) : [...L, g]
|
|
879
879
|
);
|
|
880
880
|
};
|
|
881
|
-
return /* @__PURE__ */ e(
|
|
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
|
-
|
|
885
|
+
I.length,
|
|
886
886
|
" ",
|
|
887
|
-
|
|
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
|
-
|
|
906
|
+
V,
|
|
907
907
|
{
|
|
908
908
|
placeholder: "Search members...",
|
|
909
909
|
value: l,
|
|
@@ -912,12 +912,12 @@ 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)) }) :
|
|
916
|
-
/* @__PURE__ */ e(
|
|
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
|
+
/* @__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:
|
|
920
|
-
|
|
919
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: C.map((g) => /* @__PURE__ */ e(
|
|
920
|
+
$a,
|
|
921
921
|
{
|
|
922
922
|
member: g,
|
|
923
923
|
selected: u.includes(g.userId),
|
|
@@ -933,16 +933,16 @@ function za({
|
|
|
933
933
|
" selected"
|
|
934
934
|
] }),
|
|
935
935
|
/* @__PURE__ */ e(
|
|
936
|
-
|
|
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(
|
|
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(
|
|
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
|
-
|
|
957
|
+
V,
|
|
958
958
|
{
|
|
959
959
|
placeholder: "Search users to add...",
|
|
960
960
|
value: l,
|
|
@@ -963,12 +963,12 @@ function za({
|
|
|
963
963
|
}
|
|
964
964
|
)
|
|
965
965
|
] }),
|
|
966
|
-
/* @__PURE__ */ e(ve, { className: "h-[300px]", 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" })
|
|
970
970
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: T.map((g) => /* @__PURE__ */ e(
|
|
971
|
-
|
|
971
|
+
ja,
|
|
972
972
|
{
|
|
973
973
|
user: g,
|
|
974
974
|
selected: h.includes(g.id),
|
|
@@ -984,14 +984,14 @@ function za({
|
|
|
984
984
|
" selected"
|
|
985
985
|
] }),
|
|
986
986
|
/* @__PURE__ */ e(
|
|
987
|
-
|
|
987
|
+
M,
|
|
988
988
|
{
|
|
989
989
|
onClick: U,
|
|
990
990
|
disabled: O.isPending,
|
|
991
|
-
children: O.isPending ? /* @__PURE__ */ r(
|
|
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(
|
|
994
|
+
] }) : /* @__PURE__ */ r(P, { children: [
|
|
995
995
|
/* @__PURE__ */ e(ye, { className: "mr-2 h-4 w-4" }),
|
|
996
996
|
"Add Members"
|
|
997
997
|
] })
|
|
@@ -1002,7 +1002,7 @@ function za({
|
|
|
1002
1002
|
] })
|
|
1003
1003
|
] }) }) });
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1005
|
+
function $a({
|
|
1006
1006
|
member: s,
|
|
1007
1007
|
selected: n,
|
|
1008
1008
|
onToggle: a
|
|
@@ -1015,7 +1015,7 @@ function _a({
|
|
|
1015
1015
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1016
1016
|
onClick: a,
|
|
1017
1017
|
children: [
|
|
1018
|
-
/* @__PURE__ */ e(
|
|
1018
|
+
/* @__PURE__ */ e(Ye, { checked: n }),
|
|
1019
1019
|
/* @__PURE__ */ e(Ee, { className: "h-8 w-8", children: /* @__PURE__ */ e(Fe, { className: "text-xs", children: t }) }),
|
|
1020
1020
|
/* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
1021
1021
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((l = s.user) == null ? void 0 : l.name) || "Unknown User" }),
|
|
@@ -1025,7 +1025,7 @@ function _a({
|
|
|
1025
1025
|
}
|
|
1026
1026
|
);
|
|
1027
1027
|
}
|
|
1028
|
-
function
|
|
1028
|
+
function ja({
|
|
1029
1029
|
user: s,
|
|
1030
1030
|
selected: n,
|
|
1031
1031
|
onToggle: a
|
|
@@ -1038,7 +1038,7 @@ function $a({
|
|
|
1038
1038
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1039
1039
|
onClick: a,
|
|
1040
1040
|
children: [
|
|
1041
|
-
/* @__PURE__ */ e(
|
|
1041
|
+
/* @__PURE__ */ e(Ye, { checked: n }),
|
|
1042
1042
|
/* @__PURE__ */ e(Ee, { className: "h-8 w-8", children: /* @__PURE__ */ e(Fe, { className: "text-xs", children: t }) }),
|
|
1043
1043
|
/* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
1044
1044
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: s.name }),
|
|
@@ -1048,36 +1048,36 @@ function $a({
|
|
|
1048
1048
|
}
|
|
1049
1049
|
);
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1051
|
+
function Qa({
|
|
1052
1052
|
open: s,
|
|
1053
1053
|
onOpenChange: n
|
|
1054
1054
|
}) {
|
|
1055
|
-
const [a, t] =
|
|
1056
|
-
type:
|
|
1057
|
-
tenantId:
|
|
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
|
-
}),
|
|
1060
|
-
(
|
|
1059
|
+
}), I = A.filter(
|
|
1060
|
+
(C) => {
|
|
1061
1061
|
var U;
|
|
1062
|
-
return
|
|
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 (
|
|
1069
|
-
console.error("Failed to delete group:",
|
|
1068
|
+
} catch (C) {
|
|
1069
|
+
console.error("Failed to delete group:", C);
|
|
1070
1070
|
}
|
|
1071
|
-
}, N = (
|
|
1072
|
-
m(
|
|
1071
|
+
}, N = (C) => {
|
|
1072
|
+
m(C), f(!0);
|
|
1073
1073
|
}, T = () => {
|
|
1074
1074
|
t("groups"), G();
|
|
1075
1075
|
};
|
|
1076
|
-
return /* @__PURE__ */ r(
|
|
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: [
|
|
1080
|
-
/* @__PURE__ */ e(
|
|
1080
|
+
/* @__PURE__ */ e($, { className: "h-5 w-5" }),
|
|
1081
1081
|
"Group Management"
|
|
1082
1082
|
] }),
|
|
1083
1083
|
/* @__PURE__ */ e(Pe, { children: "Manage your groups, create new groups, and control group membership" })
|
|
@@ -1085,7 +1085,7 @@ function ja({
|
|
|
1085
1085
|
/* @__PURE__ */ r(We, { value: a, onValueChange: t, className: "mt-4", children: [
|
|
1086
1086
|
/* @__PURE__ */ r(Je, { className: "grid w-full grid-cols-2", children: [
|
|
1087
1087
|
/* @__PURE__ */ r(re, { value: "groups", className: "flex items-center gap-2", children: [
|
|
1088
|
-
/* @__PURE__ */ e(
|
|
1088
|
+
/* @__PURE__ */ e($, { className: "h-4 w-4" }),
|
|
1089
1089
|
"Groups"
|
|
1090
1090
|
] }),
|
|
1091
1091
|
/* @__PURE__ */ r(re, { value: "create", className: "flex items-center gap-2", children: [
|
|
@@ -1097,42 +1097,42 @@ function ja({
|
|
|
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
|
-
|
|
1100
|
+
V,
|
|
1101
1101
|
{
|
|
1102
1102
|
placeholder: "Search groups...",
|
|
1103
1103
|
value: i,
|
|
1104
|
-
onChange: (
|
|
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((
|
|
1110
|
-
/* @__PURE__ */ e(
|
|
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
|
+
/* @__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:
|
|
1113
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: I.map((C) => /* @__PURE__ */ e(
|
|
1114
1114
|
Va,
|
|
1115
1115
|
{
|
|
1116
|
-
group:
|
|
1117
|
-
onManageMembers: () => N(
|
|
1118
|
-
onDelete: () => c(
|
|
1116
|
+
group: C,
|
|
1117
|
+
onManageMembers: () => N(C),
|
|
1118
|
+
onDelete: () => c(C),
|
|
1119
1119
|
currentUserId: b == null ? void 0 : b.id
|
|
1120
1120
|
},
|
|
1121
|
-
|
|
1121
|
+
C.id
|
|
1122
1122
|
)) }) })
|
|
1123
1123
|
] }) }),
|
|
1124
1124
|
/* @__PURE__ */ e(ne, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1125
|
-
|
|
1125
|
+
Aa,
|
|
1126
1126
|
{
|
|
1127
1127
|
onSuccess: T,
|
|
1128
|
-
tenantId:
|
|
1129
|
-
isTenantUser:
|
|
1128
|
+
tenantId: k,
|
|
1129
|
+
isTenantUser: D
|
|
1130
1130
|
}
|
|
1131
1131
|
) })
|
|
1132
1132
|
] })
|
|
1133
1133
|
] }) }),
|
|
1134
1134
|
l && /* @__PURE__ */ e(
|
|
1135
|
-
|
|
1135
|
+
_a,
|
|
1136
1136
|
{
|
|
1137
1137
|
open: h,
|
|
1138
1138
|
onOpenChange: f,
|
|
@@ -1159,10 +1159,10 @@ function ja({
|
|
|
1159
1159
|
/* @__PURE__ */ e(
|
|
1160
1160
|
$s,
|
|
1161
1161
|
{
|
|
1162
|
-
onClick:
|
|
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(
|
|
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"
|
|
@@ -1189,7 +1189,7 @@ function Va({
|
|
|
1189
1189
|
] }),
|
|
1190
1190
|
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-3 text-xs text-muted-foreground", children: [
|
|
1191
1191
|
/* @__PURE__ */ r("span", { className: "flex items-center gap-1", children: [
|
|
1192
|
-
/* @__PURE__ */ e(
|
|
1192
|
+
/* @__PURE__ */ e($, { className: "h-3 w-3" }),
|
|
1193
1193
|
s.memberCount,
|
|
1194
1194
|
" ",
|
|
1195
1195
|
s.memberCount === 1 ? "member" : "members"
|
|
@@ -1202,7 +1202,7 @@ function Va({
|
|
|
1202
1202
|
] }),
|
|
1203
1203
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
|
|
1204
1204
|
/* @__PURE__ */ e(
|
|
1205
|
-
|
|
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
|
-
|
|
1215
|
+
M,
|
|
1216
1216
|
{
|
|
1217
1217
|
variant: "ghost",
|
|
1218
1218
|
size: "sm",
|
|
@@ -1231,34 +1231,34 @@ function Za() {
|
|
|
1231
1231
|
authToken: s,
|
|
1232
1232
|
tokenProps: n,
|
|
1233
1233
|
id: a
|
|
1234
|
-
} = R(), { isLocalDev: t } =
|
|
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] =
|
|
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
1243
|
_e((d) => d.card);
|
|
1244
1244
|
const T = se(
|
|
1245
1245
|
(d) => d.selectedDashboard
|
|
1246
|
-
),
|
|
1246
|
+
), C = se(
|
|
1247
1247
|
(d) => d.initialDashboard
|
|
1248
1248
|
);
|
|
1249
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 =
|
|
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:
|
|
1254
|
+
), { setIsDashboardEditing: L, setShowDashboardJSON: E } = y(
|
|
1255
1255
|
(d) => d.actions
|
|
1256
|
-
), { setInitialDashboard: q, clearSelectedDashboard:
|
|
1256
|
+
), { setInitialDashboard: q, clearSelectedDashboard: Y } = se(
|
|
1257
1257
|
(d) => d.actions
|
|
1258
|
-
), { resources: z } = Ks(fe.DASHBOARD), { currentUser: cs } =
|
|
1259
|
-
id:
|
|
1260
|
-
title: (u == null ? void 0 : u.title) ||
|
|
1261
|
-
} : null, { handleAddNewFrame: us } = Js(), [pe, ge] =
|
|
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;
|
|
@@ -1267,22 +1267,22 @@ function Za() {
|
|
|
1267
1267
|
dashboardId: u.id,
|
|
1268
1268
|
newTitle: d,
|
|
1269
1269
|
previousTitle: F
|
|
1270
|
-
}),
|
|
1270
|
+
}), Z.mutate(
|
|
1271
1271
|
{
|
|
1272
1272
|
resourceId: u.id,
|
|
1273
1273
|
data: { title: d }
|
|
1274
1274
|
},
|
|
1275
1275
|
{
|
|
1276
1276
|
onSuccess: () => {
|
|
1277
|
-
console.log("Dashboard title updated successfully"),
|
|
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),
|
|
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
|
-
|
|
1285
|
+
oa(() => {
|
|
1286
1286
|
if (z && z.length > 0) {
|
|
1287
1287
|
const d = u == null ? void 0 : u.id;
|
|
1288
1288
|
if (d) {
|
|
@@ -1304,17 +1304,17 @@ function Za() {
|
|
|
1304
1304
|
const F = {
|
|
1305
1305
|
template: d
|
|
1306
1306
|
};
|
|
1307
|
-
|
|
1307
|
+
Z.mutate(
|
|
1308
1308
|
{
|
|
1309
1309
|
resourceId: d.id,
|
|
1310
1310
|
data: F
|
|
1311
1311
|
},
|
|
1312
1312
|
{
|
|
1313
1313
|
onSuccess: () => {
|
|
1314
|
-
ge(!1),
|
|
1314
|
+
ge(!1), w.success("Dashboard saved!");
|
|
1315
1315
|
},
|
|
1316
1316
|
onError: () => {
|
|
1317
|
-
ge(!1),
|
|
1317
|
+
ge(!1), w.error("Failed to save dashboard");
|
|
1318
1318
|
}
|
|
1319
1319
|
}
|
|
1320
1320
|
);
|
|
@@ -1326,16 +1326,16 @@ function Za() {
|
|
|
1326
1326
|
), F = JSON.stringify(d), K = {
|
|
1327
1327
|
...f,
|
|
1328
1328
|
template: F,
|
|
1329
|
-
filterValues:
|
|
1329
|
+
filterValues: j
|
|
1330
1330
|
};
|
|
1331
1331
|
await xe(
|
|
1332
1332
|
n.apiServiceUrl,
|
|
1333
1333
|
K,
|
|
1334
1334
|
s == null ? void 0 : s.accessToken
|
|
1335
|
-
),
|
|
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:", {
|
|
1339
1339
|
title: Ge,
|
|
1340
1340
|
dashboardStateTitle: u.title,
|
|
1341
1341
|
dashboardId: u == null ? void 0 : u.id,
|
|
@@ -1349,25 +1349,25 @@ function Za() {
|
|
|
1349
1349
|
role: "dashboard-controls",
|
|
1350
1350
|
children: [
|
|
1351
1351
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1352
|
-
bs && /* @__PURE__ */ r(
|
|
1352
|
+
bs && /* @__PURE__ */ r(P, { children: [
|
|
1353
1353
|
/* @__PURE__ */ e(
|
|
1354
|
-
|
|
1354
|
+
_,
|
|
1355
1355
|
{
|
|
1356
1356
|
"aria-label": "Manage Dashboards",
|
|
1357
1357
|
tooltip: "Manage Dashboards",
|
|
1358
1358
|
onClick: () => {
|
|
1359
|
-
|
|
1359
|
+
I(!G);
|
|
1360
1360
|
},
|
|
1361
1361
|
className: "h-7 p-2",
|
|
1362
|
-
children: /* @__PURE__ */ e(
|
|
1362
|
+
children: /* @__PURE__ */ e(ua, { className: "h-4 w-4" })
|
|
1363
1363
|
}
|
|
1364
1364
|
),
|
|
1365
1365
|
o && !N && /* @__PURE__ */ e(
|
|
1366
|
-
|
|
1366
|
+
_,
|
|
1367
1367
|
{
|
|
1368
1368
|
"aria-label": "Dashboard Hub",
|
|
1369
1369
|
tooltip: "Dashboard Hub",
|
|
1370
|
-
onClick: () =>
|
|
1370
|
+
onClick: () => Y(),
|
|
1371
1371
|
className: "h-7 p-2",
|
|
1372
1372
|
children: /* @__PURE__ */ e(He, { className: "h-4 w-4" })
|
|
1373
1373
|
}
|
|
@@ -1377,7 +1377,7 @@ function Za() {
|
|
|
1377
1377
|
/* @__PURE__ */ e(H, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
|
|
1378
1378
|
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
|
|
1379
1379
|
] }) : /* @__PURE__ */ e(
|
|
1380
|
-
|
|
1380
|
+
Ys,
|
|
1381
1381
|
{
|
|
1382
1382
|
value: Ge || "Untitled Dashboard",
|
|
1383
1383
|
onSave: (d) => {
|
|
@@ -1393,58 +1393,71 @@ function Za() {
|
|
|
1393
1393
|
displayClassName: "text-sm font-medium",
|
|
1394
1394
|
inputClassName: "text-sm font-medium",
|
|
1395
1395
|
placeholder: "Dashboard Title",
|
|
1396
|
-
isPending:
|
|
1396
|
+
isPending: Z.isPending
|
|
1397
1397
|
}
|
|
1398
1398
|
))
|
|
1399
1399
|
] }),
|
|
1400
1400
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1401
|
-
N && /* @__PURE__ */ r(
|
|
1402
|
-
/* @__PURE__ */ e(
|
|
1403
|
-
/* @__PURE__ */ e(
|
|
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__ */
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
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
|
-
|
|
1430
|
+
_,
|
|
1418
1431
|
{
|
|
1419
1432
|
tooltip: "Manage Groups",
|
|
1420
1433
|
onClick: () => O(!0),
|
|
1421
1434
|
className: "h-7 p-2",
|
|
1422
|
-
children: /* @__PURE__ */ e(
|
|
1435
|
+
children: /* @__PURE__ */ e($, { className: "h-4 w-4" })
|
|
1423
1436
|
}
|
|
1424
1437
|
),
|
|
1425
|
-
!N && o && ((Ue =
|
|
1426
|
-
|
|
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: () =>
|
|
1442
|
+
onClick: () => k(!0),
|
|
1430
1443
|
className: "h-7 p-2",
|
|
1431
|
-
children: /* @__PURE__ */ e(
|
|
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
|
-
|
|
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(
|
|
1454
|
+
children: /* @__PURE__ */ e(aa, { className: "h-4 w-4" })
|
|
1442
1455
|
}
|
|
1443
1456
|
),
|
|
1444
|
-
c && !N && ee && t && o && /* @__PURE__ */ e(
|
|
1445
|
-
!N && ee && t && o && /* @__PURE__ */ e(
|
|
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
|
-
|
|
1460
|
+
M,
|
|
1448
1461
|
{
|
|
1449
1462
|
className: "h-7 p-2",
|
|
1450
1463
|
variant: "secondary",
|
|
@@ -1458,7 +1471,7 @@ function Za() {
|
|
|
1458
1471
|
}
|
|
1459
1472
|
),
|
|
1460
1473
|
c && !N && o && /* @__PURE__ */ r(
|
|
1461
|
-
|
|
1474
|
+
M,
|
|
1462
1475
|
{
|
|
1463
1476
|
variant: "outline",
|
|
1464
1477
|
className: "h-7 p-2",
|
|
@@ -1472,20 +1485,20 @@ function Za() {
|
|
|
1472
1485
|
}
|
|
1473
1486
|
),
|
|
1474
1487
|
!N && !c && i.canEdit && o && /* @__PURE__ */ r(
|
|
1475
|
-
|
|
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(
|
|
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
|
-
|
|
1501
|
+
M,
|
|
1489
1502
|
{
|
|
1490
1503
|
className: "h-7 p-2",
|
|
1491
1504
|
disabled: pe,
|
|
@@ -1498,23 +1511,23 @@ function Za() {
|
|
|
1498
1511
|
}
|
|
1499
1512
|
),
|
|
1500
1513
|
!N && c && t && o && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
|
|
1501
|
-
|
|
1514
|
+
M,
|
|
1502
1515
|
{
|
|
1503
1516
|
className: "h-7 p-2",
|
|
1504
|
-
onClick: () =>
|
|
1517
|
+
onClick: () => E(!he),
|
|
1505
1518
|
size: "sm",
|
|
1506
1519
|
variant: "ghost",
|
|
1507
|
-
children: /* @__PURE__ */ e(
|
|
1520
|
+
children: /* @__PURE__ */ e(ra, { className: "h-4 w-4" })
|
|
1508
1521
|
}
|
|
1509
1522
|
) }),
|
|
1510
|
-
!N && t && /* @__PURE__ */ e(
|
|
1523
|
+
!N && t && /* @__PURE__ */ e(fa, {}),
|
|
1511
1524
|
c && !N && o && /* @__PURE__ */ r(
|
|
1512
|
-
|
|
1525
|
+
M,
|
|
1513
1526
|
{
|
|
1514
1527
|
variant: "outline",
|
|
1515
1528
|
className: "h-7 p-2",
|
|
1516
1529
|
onClick: () => {
|
|
1517
|
-
L(!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 Za() {
|
|
|
1522
1535
|
]
|
|
1523
1536
|
}
|
|
1524
1537
|
),
|
|
1525
|
-
|
|
1526
|
-
|
|
1538
|
+
D && Te && /* @__PURE__ */ e(
|
|
1539
|
+
na,
|
|
1527
1540
|
{
|
|
1528
1541
|
resource: Te,
|
|
1529
1542
|
resourceType: fe.DASHBOARD,
|
|
1530
|
-
onClose: () =>
|
|
1543
|
+
onClose: () => k(!1)
|
|
1531
1544
|
}
|
|
1532
1545
|
),
|
|
1533
1546
|
/* @__PURE__ */ e(
|
|
1534
|
-
|
|
1547
|
+
Qa,
|
|
1535
1548
|
{
|
|
1536
|
-
open:
|
|
1549
|
+
open: A,
|
|
1537
1550
|
onOpenChange: O
|
|
1538
1551
|
}
|
|
1539
1552
|
)
|