react-semaphor 0.1.208 → 0.1.210
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-BAOrAMV9.js +42 -0
- package/dist/chunks/{dashboard-controls-yOzrvYwI.js → dashboard-controls-C08300Wi.js} +504 -456
- package/dist/chunks/{dashboard-json-BuLoVNV4.js → dashboard-json-DlEE5-WA.js} +1 -1
- package/dist/chunks/{dashboard-json-DqChvVCF.js → dashboard-json-GjDBGO26.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-tJueBNph.js → dashboard-summary-settings-dialog-QUuhhXU9.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-DmccX33N.js → dashboard-summary-settings-dialog-THx-gjnG.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CV4JsCTg.js → edit-dashboard-visual-Bsmow1Pa.js} +3422 -3536
- package/dist/chunks/edit-dashboard-visual-PfWJXb2-.js +164 -0
- package/dist/chunks/editor-action-buttons-DNbp_ZWy.js +404 -0
- package/dist/chunks/editor-action-buttons-FPyaC09X.js +21 -0
- package/dist/chunks/{index-CBcPi9pm.js → index-CAVrkf9d.js} +24248 -23818
- package/dist/chunks/index-CXKjmjfB.js +1104 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-D9x96J2F.js +1 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
- package/dist/chunks/notification-bell-BqvKQSw9.js +6 -0
- package/dist/chunks/notification-bell-C3a7wC1u.js +871 -0
- package/dist/chunks/resource-management-panel-BVTgbma8.js +913 -0
- package/dist/chunks/resource-management-panel-C5NjrVsA.js +6 -0
- package/dist/chunks/{use-role-aware-display-preferences-DTSpe_ZT.js → use-role-aware-display-preferences-DxCPoCgr.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-B4QJkliF.js → use-role-aware-display-preferences-l7NFLYnn.js} +1 -1
- package/dist/chunks/{use-visual-utils-ChR-Jti8.js → use-visual-utils-B82Q-Ytl.js} +1 -1
- package/dist/chunks/{use-visual-utils-CCT3ABI5.js → use-visual-utils-D9IJz9R0.js} +34 -34
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +44 -40
- package/dist/shared/index.cjs +1 -0
- package/dist/shared/index.js +6 -0
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +12 -1
- package/dist/types/main.d.ts +52 -2
- package/dist/types/shared.d.ts +1762 -0
- package/dist/types/surfboard.d.ts +12 -1
- package/dist/types/types.d.ts +12 -1
- package/package.json +6 -1
- package/dist/chunks/dashboard-controls-K5zNLdtH.js +0 -42
- package/dist/chunks/edit-dashboard-visual-CKNlwaCO.js +0 -179
- package/dist/chunks/editor-action-buttons-CAjqJiT_.js +0 -340
- package/dist/chunks/editor-action-buttons-DQVh7L5i.js +0 -11
- package/dist/chunks/index-DQOwJyRp.js +0 -1104
- package/dist/chunks/notification-bell-B-OVf20Q.js +0 -862
- package/dist/chunks/notification-bell-DyzIftQU.js +0 -11
- package/dist/chunks/resource-management-panel-D_mSi7Cm.js +0 -914
- package/dist/chunks/resource-management-panel-NqaNfAq3.js +0 -6
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { jsxs as a, jsx as e, Fragment as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { bP as ne, cR as ba, u as x, c5 as He, c6 as Ve, B as C, c8 as ze, c9 as te, cS as $e, bs as Ns, l as j, m as Be, cT as ya, c4 as Ke, n as Qe, o as We, p as Je, q as Ss, L as Te, Q as re, G as Na, a2 as q, cU as Sa, cd as wa, cV as xa, cW as ps, cX as ws, c as J, cY as xs, bJ as ge, cZ as ve, I as L, c_ as Ds, cE as Da, c$ as Ca, H as V, cc as z, d0 as Xe, d1 as La, d2 as Ea, d3 as _e, d4 as Aa, d5 as ka, d6 as Cs, d7 as Ls, d8 as pe, d9 as fe, cA as Ue, cj as Re, da as Ge, ce as Es, db as Pe, dc as As, e as ks, dd as Ma, cm as Ms, cn as Is, co as Os, cp as Ts, cq as _s, cr as Us, cs as Rs, ct as Fe, c3 as Ia, de as Oa, bu as Ta, bA as fs, bE as me, df as _a, bF as Ua, ag as ke, dg as Ra, dh as Ga, di as Pa, dj as Fa, dk as qa, dl as ja, bW as Ha, bX as Va, bY as za, dm as $a, b_ as Ba, ca as Ka, aO as Qa, dn as Wa, dp as Ja, dq as Xa, dr as Ya, ds as Za, dt as et, c7 as st, cg as at, du as tt, ai as rt, am as nt } from "./index-CAVrkf9d.js";
|
|
3
3
|
import * as _ from "react";
|
|
4
|
-
import
|
|
4
|
+
import Gs, { useState as S, useMemo as he, useEffect as ot, useCallback as it } from "react";
|
|
5
5
|
import "react-dom";
|
|
6
|
-
import { b as
|
|
7
|
-
import { u as
|
|
8
|
-
import { d as
|
|
9
|
-
import { C as
|
|
10
|
-
import {
|
|
6
|
+
import { b as lt, u as ct, c as dt, A as ut, V as mt, S as ht, N as pt, U as ft } from "./notification-bell-C3a7wC1u.js";
|
|
7
|
+
import { u as gt } from "./use-role-aware-display-preferences-DxCPoCgr.js";
|
|
8
|
+
import { d as vt } from "./date-formatter-Y8Za1ib3.js";
|
|
9
|
+
import { C as bt, D as yt } from "./dashboard-summary-settings-dialog-THx-gjnG.js";
|
|
10
|
+
import { u as Nt, s as Me } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
|
|
11
|
+
import { S as gs } from "./editor-action-buttons-DNbp_ZWy.js";
|
|
11
12
|
/**
|
|
12
13
|
* @license lucide-react v0.453.0 - ISC
|
|
13
14
|
*
|
|
14
15
|
* This source code is licensed under the ISC license.
|
|
15
16
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
17
|
*/
|
|
17
|
-
const
|
|
18
|
+
const St = ne("Glasses", [
|
|
18
19
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
19
20
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
20
21
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -27,7 +28,7 @@ const it = se("Glasses", [
|
|
|
27
28
|
* This source code is licensed under the ISC license.
|
|
28
29
|
* See the LICENSE file in the root directory of this source tree.
|
|
29
30
|
*/
|
|
30
|
-
const
|
|
31
|
+
const wt = ne("Menu", [
|
|
31
32
|
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
|
|
32
33
|
["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
|
|
33
34
|
["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
|
|
@@ -38,7 +39,7 @@ const lt = se("Menu", [
|
|
|
38
39
|
* This source code is licensed under the ISC license.
|
|
39
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
40
41
|
*/
|
|
41
|
-
const
|
|
42
|
+
const xt = ne("Moon", [
|
|
42
43
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
43
44
|
]);
|
|
44
45
|
/**
|
|
@@ -47,7 +48,7 @@ const ct = se("Moon", [
|
|
|
47
48
|
* This source code is licensed under the ISC license.
|
|
48
49
|
* See the LICENSE file in the root directory of this source tree.
|
|
49
50
|
*/
|
|
50
|
-
const
|
|
51
|
+
const Dt = ne("ShieldX", [
|
|
51
52
|
[
|
|
52
53
|
"path",
|
|
53
54
|
{
|
|
@@ -64,7 +65,7 @@ const dt = se("ShieldX", [
|
|
|
64
65
|
* This source code is licensed under the ISC license.
|
|
65
66
|
* See the LICENSE file in the root directory of this source tree.
|
|
66
67
|
*/
|
|
67
|
-
const
|
|
68
|
+
const Ct = ne("Sun", [
|
|
68
69
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
69
70
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
70
71
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -75,7 +76,7 @@ const ut = se("Sun", [
|
|
|
75
76
|
["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
|
|
76
77
|
["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
|
|
77
78
|
]);
|
|
78
|
-
var
|
|
79
|
+
var qe = { exports: {} }, Ie = {};
|
|
79
80
|
/**
|
|
80
81
|
* @license React
|
|
81
82
|
* use-sync-external-store-shim.production.js
|
|
@@ -85,15 +86,15 @@ var Ie = { exports: {} }, xe = {};
|
|
|
85
86
|
* This source code is licensed under the MIT license found in the
|
|
86
87
|
* LICENSE file in the root directory of this source tree.
|
|
87
88
|
*/
|
|
88
|
-
var
|
|
89
|
-
function
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
var s =
|
|
93
|
-
function
|
|
89
|
+
var vs;
|
|
90
|
+
function Lt() {
|
|
91
|
+
if (vs) return Ie;
|
|
92
|
+
vs = 1;
|
|
93
|
+
var s = Gs;
|
|
94
|
+
function o(d, m) {
|
|
94
95
|
return d === m && (d !== 0 || 1 / d === 1 / m) || d !== d && m !== m;
|
|
95
96
|
}
|
|
96
|
-
var t = typeof Object.is == "function" ? Object.is :
|
|
97
|
+
var t = typeof Object.is == "function" ? Object.is : o, r = s.useState, l = s.useEffect, i = s.useLayoutEffect, u = s.useDebugValue;
|
|
97
98
|
function p(d, m) {
|
|
98
99
|
var h = m(), b = r({ inst: { value: h, getSnapshot: m } }), y = b[0].inst, N = b[1];
|
|
99
100
|
return i(
|
|
@@ -124,9 +125,9 @@ function mt() {
|
|
|
124
125
|
return m();
|
|
125
126
|
}
|
|
126
127
|
var c = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : p;
|
|
127
|
-
return
|
|
128
|
+
return Ie.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : c, Ie;
|
|
128
129
|
}
|
|
129
|
-
var
|
|
130
|
+
var Oe = {};
|
|
130
131
|
/**
|
|
131
132
|
* @license React
|
|
132
133
|
* use-sync-external-store-shim.development.js
|
|
@@ -136,13 +137,13 @@ var De = {};
|
|
|
136
137
|
* This source code is licensed under the MIT license found in the
|
|
137
138
|
* LICENSE file in the root directory of this source tree.
|
|
138
139
|
*/
|
|
139
|
-
var
|
|
140
|
-
function
|
|
141
|
-
return
|
|
140
|
+
var bs;
|
|
141
|
+
function Et() {
|
|
142
|
+
return bs || (bs = 1, process.env.NODE_ENV !== "production" && function() {
|
|
142
143
|
function s(h, b) {
|
|
143
144
|
return h === b && (h !== 0 || 1 / h === 1 / b) || h !== h && b !== b;
|
|
144
145
|
}
|
|
145
|
-
function
|
|
146
|
+
function o(h, b) {
|
|
146
147
|
c || l.startTransition === void 0 || (c = !0, console.error(
|
|
147
148
|
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
148
149
|
));
|
|
@@ -156,16 +157,16 @@ function ht() {
|
|
|
156
157
|
N = u({
|
|
157
158
|
inst: { value: y, getSnapshot: b }
|
|
158
159
|
});
|
|
159
|
-
var A = N[0].inst,
|
|
160
|
+
var A = N[0].inst, O = N[1];
|
|
160
161
|
return g(
|
|
161
162
|
function() {
|
|
162
|
-
A.value = y, A.getSnapshot = b, t(A) &&
|
|
163
|
+
A.value = y, A.getSnapshot = b, t(A) && O({ inst: A });
|
|
163
164
|
},
|
|
164
165
|
[h, y, b]
|
|
165
166
|
), p(
|
|
166
167
|
function() {
|
|
167
|
-
return t(A) &&
|
|
168
|
-
t(A) &&
|
|
168
|
+
return t(A) && O({ inst: A }), h(function() {
|
|
169
|
+
t(A) && O({ inst: A });
|
|
169
170
|
});
|
|
170
171
|
},
|
|
171
172
|
[h]
|
|
@@ -185,27 +186,27 @@ function ht() {
|
|
|
185
186
|
return b();
|
|
186
187
|
}
|
|
187
188
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
188
|
-
var l =
|
|
189
|
-
|
|
190
|
-
}()),
|
|
189
|
+
var l = Gs, i = typeof Object.is == "function" ? Object.is : s, u = l.useState, p = l.useEffect, g = l.useLayoutEffect, v = l.useDebugValue, c = !1, d = !1, m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : o;
|
|
190
|
+
Oe.useSyncExternalStore = l.useSyncExternalStore !== void 0 ? l.useSyncExternalStore : m, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
191
|
+
}()), Oe;
|
|
191
192
|
}
|
|
192
|
-
process.env.NODE_ENV === "production" ?
|
|
193
|
-
var
|
|
194
|
-
function
|
|
195
|
-
const { setTheme: s } =
|
|
193
|
+
process.env.NODE_ENV === "production" ? qe.exports = Lt() : qe.exports = Et();
|
|
194
|
+
var At = qe.exports;
|
|
195
|
+
function kt() {
|
|
196
|
+
const { setTheme: s } = ba(), o = x(
|
|
196
197
|
(t) => t.actions.setDashboardTheme
|
|
197
198
|
);
|
|
198
|
-
return /* @__PURE__ */ a(
|
|
199
|
-
/* @__PURE__ */ e(
|
|
199
|
+
return /* @__PURE__ */ a(He, { children: [
|
|
200
|
+
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ a(C, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
|
|
200
201
|
/* @__PURE__ */ e(
|
|
201
|
-
|
|
202
|
+
Ct,
|
|
202
203
|
{
|
|
203
204
|
strokeWidth: 1.5,
|
|
204
205
|
className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
|
|
205
206
|
}
|
|
206
207
|
),
|
|
207
208
|
/* @__PURE__ */ e(
|
|
208
|
-
|
|
209
|
+
xt,
|
|
209
210
|
{
|
|
210
211
|
strokeWidth: 1.5,
|
|
211
212
|
className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
|
|
@@ -213,30 +214,30 @@ function ft() {
|
|
|
213
214
|
),
|
|
214
215
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle theme" })
|
|
215
216
|
] }) }),
|
|
216
|
-
/* @__PURE__ */ a(
|
|
217
|
+
/* @__PURE__ */ a(ze, { align: "end", children: [
|
|
217
218
|
/* @__PURE__ */ e(
|
|
218
|
-
|
|
219
|
+
te,
|
|
219
220
|
{
|
|
220
221
|
onClick: () => {
|
|
221
|
-
s("light"),
|
|
222
|
+
s("light"), o("light");
|
|
222
223
|
},
|
|
223
224
|
children: "Light"
|
|
224
225
|
}
|
|
225
226
|
),
|
|
226
227
|
/* @__PURE__ */ e(
|
|
227
|
-
|
|
228
|
+
te,
|
|
228
229
|
{
|
|
229
230
|
onClick: () => {
|
|
230
|
-
s("dark"),
|
|
231
|
+
s("dark"), o("dark");
|
|
231
232
|
},
|
|
232
233
|
children: "Dark"
|
|
233
234
|
}
|
|
234
235
|
),
|
|
235
236
|
/* @__PURE__ */ e(
|
|
236
|
-
|
|
237
|
+
te,
|
|
237
238
|
{
|
|
238
239
|
onClick: () => {
|
|
239
|
-
s("system"),
|
|
240
|
+
s("system"), o("system");
|
|
240
241
|
},
|
|
241
242
|
children: "System"
|
|
242
243
|
}
|
|
@@ -244,22 +245,22 @@ function ft() {
|
|
|
244
245
|
] })
|
|
245
246
|
] });
|
|
246
247
|
}
|
|
247
|
-
async function
|
|
248
|
+
async function Mt(s, o, t, r, l) {
|
|
248
249
|
if (!l)
|
|
249
250
|
return null;
|
|
250
251
|
const i = JSON.stringify(t), u = `${s}/v1/lens`;
|
|
251
|
-
return await
|
|
252
|
-
name:
|
|
252
|
+
return await $e(u, l, {
|
|
253
|
+
name: o,
|
|
253
254
|
template: i,
|
|
254
255
|
filterValues: r,
|
|
255
256
|
operation: "create"
|
|
256
257
|
});
|
|
257
258
|
}
|
|
258
|
-
async function
|
|
259
|
+
async function je(s, o, t) {
|
|
259
260
|
if (!t)
|
|
260
261
|
return null;
|
|
261
|
-
const { id: r, template: l, filterValues: i, isDefault: u, shared: p } =
|
|
262
|
-
return await
|
|
262
|
+
const { id: r, template: l, filterValues: i, isDefault: u, shared: p } = o, g = `${s}/v1/lens`;
|
|
263
|
+
return await $e(g, t, {
|
|
263
264
|
lensId: r,
|
|
264
265
|
template: l,
|
|
265
266
|
filterValues: i,
|
|
@@ -268,20 +269,20 @@ async function Te(s, n, t) {
|
|
|
268
269
|
operation: "update"
|
|
269
270
|
});
|
|
270
271
|
}
|
|
271
|
-
async function
|
|
272
|
+
async function It(s, o, t) {
|
|
272
273
|
if (!t)
|
|
273
274
|
return null;
|
|
274
275
|
const r = `${s}/v1/lens`;
|
|
275
|
-
return await
|
|
276
|
+
return await $e(r, t, {
|
|
276
277
|
operation: "delete",
|
|
277
|
-
lensId:
|
|
278
|
+
lensId: o
|
|
278
279
|
});
|
|
279
280
|
}
|
|
280
|
-
function
|
|
281
|
-
const [s,
|
|
281
|
+
function Ot() {
|
|
282
|
+
const [s, o] = S(""), [t, r] = S(!1), l = x((N) => N.lenses), { setLenses: i, setSelectedLensId: u } = Ns(), [p, g] = S(!1), [v, c] = S(!1), d = x((N) => N.dashboard), m = x((N) => N.filterValues), { authToken: h, tokenProps: b } = j();
|
|
282
283
|
async function y() {
|
|
283
284
|
g(!0);
|
|
284
|
-
const N = await
|
|
285
|
+
const N = await Mt(
|
|
285
286
|
b.apiServiceUrl,
|
|
286
287
|
s,
|
|
287
288
|
d,
|
|
@@ -290,32 +291,32 @@ function bt() {
|
|
|
290
291
|
);
|
|
291
292
|
N && (i([...l || [], N]), u(N.id), c(!1)), g(!1);
|
|
292
293
|
}
|
|
293
|
-
return /* @__PURE__ */ a(
|
|
294
|
-
/* @__PURE__ */ e(
|
|
294
|
+
return /* @__PURE__ */ a(Be, { open: v, onOpenChange: c, children: [
|
|
295
|
+
/* @__PURE__ */ e(ya, { asChild: !0, children: /* @__PURE__ */ a(
|
|
295
296
|
C,
|
|
296
297
|
{
|
|
297
298
|
variant: "secondary",
|
|
298
299
|
className: "h-7 p-2",
|
|
299
300
|
size: "sm",
|
|
300
301
|
children: [
|
|
301
|
-
/* @__PURE__ */ e(
|
|
302
|
+
/* @__PURE__ */ e(Ke, { className: "mr-2 h-4 w-4" }),
|
|
302
303
|
"Lens"
|
|
303
304
|
]
|
|
304
305
|
}
|
|
305
306
|
) }),
|
|
306
|
-
/* @__PURE__ */ a(
|
|
307
|
-
/* @__PURE__ */ a(
|
|
308
|
-
/* @__PURE__ */ e(
|
|
309
|
-
/* @__PURE__ */ e(
|
|
307
|
+
/* @__PURE__ */ a(Qe, { className: "sm:max-w-[425px]", children: [
|
|
308
|
+
/* @__PURE__ */ a(We, { children: [
|
|
309
|
+
/* @__PURE__ */ e(Je, { children: "Create Lens" }),
|
|
310
|
+
/* @__PURE__ */ e(Ss, { children: "Lenses are private by default and are only visible to you." })
|
|
310
311
|
] }),
|
|
311
312
|
/* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ a("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
312
|
-
/* @__PURE__ */ e(
|
|
313
|
+
/* @__PURE__ */ e(Te, { className: "text-right", children: "Name" }),
|
|
313
314
|
/* @__PURE__ */ e(
|
|
314
|
-
|
|
315
|
+
re,
|
|
315
316
|
{
|
|
316
317
|
value: s,
|
|
317
318
|
onChange: (N) => {
|
|
318
|
-
|
|
319
|
+
o(N.target.value);
|
|
319
320
|
},
|
|
320
321
|
id: "name",
|
|
321
322
|
className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
@@ -323,7 +324,7 @@ function bt() {
|
|
|
323
324
|
)
|
|
324
325
|
] }) }),
|
|
325
326
|
t && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
326
|
-
/* @__PURE__ */ e(
|
|
327
|
+
/* @__PURE__ */ e(Na, { children: /* @__PURE__ */ e(
|
|
327
328
|
C,
|
|
328
329
|
{
|
|
329
330
|
size: "sm",
|
|
@@ -337,13 +338,13 @@ function bt() {
|
|
|
337
338
|
] })
|
|
338
339
|
] });
|
|
339
340
|
}
|
|
340
|
-
function
|
|
341
|
-
const [s,
|
|
341
|
+
function Tt() {
|
|
342
|
+
const [s, o] = S(!1), t = x((d) => d.lenses), r = x((d) => d.selectedLensId), { setLenses: l, setSelectedLensId: i } = Ns(), { authToken: u, tokenProps: p } = j();
|
|
342
343
|
async function g(d) {
|
|
343
344
|
i(d);
|
|
344
345
|
}
|
|
345
346
|
async function v(d) {
|
|
346
|
-
if (await
|
|
347
|
+
if (await It(p.apiServiceUrl, d, u == null ? void 0 : u.accessToken)) {
|
|
347
348
|
const h = t == null ? void 0 : t.filter((b) => b.id !== d);
|
|
348
349
|
l(h || []), i("original");
|
|
349
350
|
}
|
|
@@ -361,30 +362,30 @@ function yt() {
|
|
|
361
362
|
...d,
|
|
362
363
|
isDefault: !d.isDefault
|
|
363
364
|
};
|
|
364
|
-
await
|
|
365
|
+
await je(p.apiServiceUrl, h, u == null ? void 0 : u.accessToken);
|
|
365
366
|
const b = t == null ? void 0 : t.find((y) => y.isDefault);
|
|
366
367
|
if (b && b.id !== d.id) {
|
|
367
368
|
const y = {
|
|
368
369
|
...b,
|
|
369
370
|
isDefault: !1
|
|
370
371
|
};
|
|
371
|
-
await
|
|
372
|
+
await je(p.apiServiceUrl, y, u == null ? void 0 : u.accessToken);
|
|
372
373
|
}
|
|
373
374
|
}
|
|
374
|
-
return /* @__PURE__ */ a(
|
|
375
|
-
/* @__PURE__ */ e(
|
|
376
|
-
/* @__PURE__ */ a(
|
|
377
|
-
/* @__PURE__ */ e(
|
|
378
|
-
/* @__PURE__ */ e(
|
|
375
|
+
return /* @__PURE__ */ a(He, { open: s, onOpenChange: o, children: [
|
|
376
|
+
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(q, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(St, { className: "h-4 w-4" }) }) }),
|
|
377
|
+
/* @__PURE__ */ a(ze, { align: "end", className: "w-60", children: [
|
|
378
|
+
/* @__PURE__ */ e(Sa, { className: "px-3", children: "Lenses" }),
|
|
379
|
+
/* @__PURE__ */ e(wa, {}),
|
|
379
380
|
/* @__PURE__ */ a(
|
|
380
|
-
|
|
381
|
+
xa,
|
|
381
382
|
{
|
|
382
383
|
value: r,
|
|
383
384
|
onValueChange: g,
|
|
384
385
|
children: [
|
|
385
|
-
/* @__PURE__ */ e(
|
|
386
|
+
/* @__PURE__ */ e(ps, { value: "original", children: "Original" }),
|
|
386
387
|
t == null ? void 0 : t.map((d) => /* @__PURE__ */ a(
|
|
387
|
-
|
|
388
|
+
ps,
|
|
388
389
|
{
|
|
389
390
|
className: "group flex justify-between gap-2",
|
|
390
391
|
value: d.id,
|
|
@@ -392,12 +393,12 @@ function yt() {
|
|
|
392
393
|
/* @__PURE__ */ e("p", { children: d.name }),
|
|
393
394
|
/* @__PURE__ */ a("span", { className: "flex items-center gap-3", children: [
|
|
394
395
|
/* @__PURE__ */ e(
|
|
395
|
-
|
|
396
|
+
ws,
|
|
396
397
|
{
|
|
397
398
|
onClick: (m) => {
|
|
398
399
|
m.preventDefault(), c(d);
|
|
399
400
|
},
|
|
400
|
-
className:
|
|
401
|
+
className: J(
|
|
401
402
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
402
403
|
{
|
|
403
404
|
invisible: !d.isDefault,
|
|
@@ -408,7 +409,7 @@ function yt() {
|
|
|
408
409
|
}
|
|
409
410
|
),
|
|
410
411
|
/* @__PURE__ */ e(
|
|
411
|
-
|
|
412
|
+
xs,
|
|
412
413
|
{
|
|
413
414
|
onClick: (m) => {
|
|
414
415
|
m.preventDefault(), v(d.id);
|
|
@@ -428,29 +429,29 @@ function yt() {
|
|
|
428
429
|
] })
|
|
429
430
|
] });
|
|
430
431
|
}
|
|
431
|
-
const
|
|
432
|
+
const _t = async (s, o, t) => {
|
|
432
433
|
const r = `${s}/management/v1/groups`;
|
|
433
|
-
return await
|
|
434
|
-
},
|
|
434
|
+
return await Ds(r, o, t);
|
|
435
|
+
}, Ut = async (s, o, t) => {
|
|
435
436
|
const r = `${s}/management/v1/groups/${t}`, l = await fetch(r, {
|
|
436
437
|
method: "DELETE",
|
|
437
438
|
headers: {
|
|
438
|
-
Authorization: `Bearer ${
|
|
439
|
+
Authorization: `Bearer ${o}`
|
|
439
440
|
}
|
|
440
441
|
});
|
|
441
442
|
if (!l.ok) {
|
|
442
443
|
const i = await l.text();
|
|
443
444
|
throw new Error(i || "Failed to delete group");
|
|
444
445
|
}
|
|
445
|
-
},
|
|
446
|
+
}, Rt = async (s, o, t, r) => {
|
|
446
447
|
const l = `${s}/management/v1/groups/${t}/members`;
|
|
447
|
-
return await
|
|
448
|
-
},
|
|
448
|
+
return await Ds(l, o, r);
|
|
449
|
+
}, Gt = async (s, o, t, r) => {
|
|
449
450
|
const l = `${s}/management/v1/groups/${t}/members`, i = await fetch(l, {
|
|
450
451
|
method: "DELETE",
|
|
451
452
|
headers: {
|
|
452
453
|
"Content-Type": "application/json",
|
|
453
|
-
Authorization: `Bearer ${
|
|
454
|
+
Authorization: `Bearer ${o}`
|
|
454
455
|
},
|
|
455
456
|
body: JSON.stringify(r)
|
|
456
457
|
});
|
|
@@ -459,10 +460,10 @@ const Nt = async (s, n, t) => {
|
|
|
459
460
|
throw new Error(u || "Failed to remove group members");
|
|
460
461
|
}
|
|
461
462
|
};
|
|
462
|
-
function
|
|
463
|
-
const { authToken: s, tokenProps:
|
|
464
|
-
return
|
|
465
|
-
mutationFn: (r) =>
|
|
463
|
+
function Pt() {
|
|
464
|
+
const { authToken: s, tokenProps: o } = j(), t = ge();
|
|
465
|
+
return ve({
|
|
466
|
+
mutationFn: (r) => _t(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r),
|
|
466
467
|
onSuccess: () => {
|
|
467
468
|
t.invalidateQueries({ queryKey: ["groups"] }), L.success("Group created successfully");
|
|
468
469
|
},
|
|
@@ -473,10 +474,10 @@ function Dt() {
|
|
|
473
474
|
}
|
|
474
475
|
});
|
|
475
476
|
}
|
|
476
|
-
function
|
|
477
|
-
const { authToken: s, tokenProps:
|
|
478
|
-
return
|
|
479
|
-
mutationFn: (r) =>
|
|
477
|
+
function Ft() {
|
|
478
|
+
const { authToken: s, tokenProps: o } = j(), t = ge();
|
|
479
|
+
return ve({
|
|
480
|
+
mutationFn: (r) => Ut(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r),
|
|
480
481
|
onSuccess: (r, l) => {
|
|
481
482
|
t.invalidateQueries({ queryKey: ["groups"] }), t.removeQueries({ queryKey: ["group", l] }), L.success("Group deleted successfully");
|
|
482
483
|
},
|
|
@@ -487,13 +488,13 @@ function Ct() {
|
|
|
487
488
|
}
|
|
488
489
|
});
|
|
489
490
|
}
|
|
490
|
-
function
|
|
491
|
-
const { authToken: s, tokenProps:
|
|
492
|
-
return
|
|
491
|
+
function qt() {
|
|
492
|
+
const { authToken: s, tokenProps: o } = j(), t = ge();
|
|
493
|
+
return ve({
|
|
493
494
|
mutationFn: ({
|
|
494
495
|
groupId: r,
|
|
495
496
|
data: l
|
|
496
|
-
}) =>
|
|
497
|
+
}) => Rt(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r, l),
|
|
497
498
|
onSuccess: (r, l) => {
|
|
498
499
|
t.invalidateQueries({ queryKey: ["group", l.groupId] }), t.invalidateQueries({
|
|
499
500
|
queryKey: ["group-members", l.groupId]
|
|
@@ -506,13 +507,13 @@ function Lt() {
|
|
|
506
507
|
}
|
|
507
508
|
});
|
|
508
509
|
}
|
|
509
|
-
function
|
|
510
|
-
const { authToken: s, tokenProps:
|
|
511
|
-
return
|
|
510
|
+
function jt() {
|
|
511
|
+
const { authToken: s, tokenProps: o } = j(), t = ge();
|
|
512
|
+
return ve({
|
|
512
513
|
mutationFn: ({
|
|
513
514
|
groupId: r,
|
|
514
515
|
data: l
|
|
515
|
-
}) =>
|
|
516
|
+
}) => Gt(o.apiServiceUrl, (s == null ? void 0 : s.accessToken) || "", r, l),
|
|
516
517
|
onSuccess: (r, l) => {
|
|
517
518
|
t.invalidateQueries({ queryKey: ["group", l.groupId] }), t.invalidateQueries({
|
|
518
519
|
queryKey: ["group-members", l.groupId]
|
|
@@ -525,12 +526,12 @@ function Et() {
|
|
|
525
526
|
}
|
|
526
527
|
});
|
|
527
528
|
}
|
|
528
|
-
function
|
|
529
|
+
function Ht({
|
|
529
530
|
onSuccess: s,
|
|
530
|
-
tenantId:
|
|
531
|
+
tenantId: o,
|
|
531
532
|
isTenantUser: t
|
|
532
533
|
}) {
|
|
533
|
-
const [r, l] = S(""), [i, u] = S(""), [p, g] = S({}), v =
|
|
534
|
+
const [r, l] = S(""), [i, u] = S(""), [p, g] = S({}), v = Pt(), c = () => {
|
|
534
535
|
const m = {};
|
|
535
536
|
return r.trim() ? r.length < 3 ? m.name = "Group name must be at least 3 characters" : r.length > 50 && (m.name = "Group name must be less than 50 characters") : m.name = "Group name is required", i && i.length > 200 && (m.description = "Description must be less than 200 characters"), g(m), Object.keys(m).length === 0;
|
|
536
537
|
};
|
|
@@ -540,7 +541,7 @@ function At({
|
|
|
540
541
|
name: r.trim(),
|
|
541
542
|
description: i.trim() || void 0,
|
|
542
543
|
type: t ? "TENANT_GROUP" : "ORG_GROUP",
|
|
543
|
-
...t &&
|
|
544
|
+
...t && o ? { tenantId: o } : {}
|
|
544
545
|
};
|
|
545
546
|
try {
|
|
546
547
|
await v.mutateAsync(h), l(""), u(""), g({}), s();
|
|
@@ -550,12 +551,12 @@ function At({
|
|
|
550
551
|
}, className: "space-y-6", children: [
|
|
551
552
|
/* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
552
553
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
553
|
-
/* @__PURE__ */ a(
|
|
554
|
+
/* @__PURE__ */ a(Te, { htmlFor: "group-name", children: [
|
|
554
555
|
"Group Name ",
|
|
555
556
|
/* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
|
|
556
557
|
] }),
|
|
557
558
|
/* @__PURE__ */ e(
|
|
558
|
-
|
|
559
|
+
re,
|
|
559
560
|
{
|
|
560
561
|
id: "group-name",
|
|
561
562
|
placeholder: "e.g., Marketing Team, Engineering Squad",
|
|
@@ -570,12 +571,12 @@ function At({
|
|
|
570
571
|
p.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: p.name })
|
|
571
572
|
] }),
|
|
572
573
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
573
|
-
/* @__PURE__ */ a(
|
|
574
|
+
/* @__PURE__ */ a(Te, { htmlFor: "group-description", children: [
|
|
574
575
|
"Description",
|
|
575
576
|
/* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: "(optional)" })
|
|
576
577
|
] }),
|
|
577
578
|
/* @__PURE__ */ e(
|
|
578
|
-
|
|
579
|
+
Da,
|
|
579
580
|
{
|
|
580
581
|
id: "group-description",
|
|
581
582
|
placeholder: "Describe the purpose of this group...",
|
|
@@ -595,7 +596,7 @@ function At({
|
|
|
595
596
|
] })
|
|
596
597
|
] }),
|
|
597
598
|
/* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ a("div", { className: "flex gap-3", children: [
|
|
598
|
-
/* @__PURE__ */ e(
|
|
599
|
+
/* @__PURE__ */ e(Ca, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
|
|
599
600
|
/* @__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." })
|
|
600
601
|
] }) })
|
|
601
602
|
] }),
|
|
@@ -617,10 +618,10 @@ function At({
|
|
|
617
618
|
{
|
|
618
619
|
type: "submit",
|
|
619
620
|
disabled: v.isPending || !r.trim(),
|
|
620
|
-
children: v.isPending ? /* @__PURE__ */ a(
|
|
621
|
+
children: v.isPending ? /* @__PURE__ */ a(k, { children: [
|
|
621
622
|
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
622
623
|
"Creating..."
|
|
623
|
-
] }) : /* @__PURE__ */ a(
|
|
624
|
+
] }) : /* @__PURE__ */ a(k, { children: [
|
|
624
625
|
/* @__PURE__ */ e(z, { className: "mr-2 h-4 w-4" }),
|
|
625
626
|
"Create Group"
|
|
626
627
|
] })
|
|
@@ -629,122 +630,122 @@ function At({
|
|
|
629
630
|
] })
|
|
630
631
|
] });
|
|
631
632
|
}
|
|
632
|
-
function
|
|
633
|
-
return
|
|
634
|
-
|
|
633
|
+
function Vt() {
|
|
634
|
+
return At.useSyncExternalStore(
|
|
635
|
+
zt,
|
|
635
636
|
() => !0,
|
|
636
637
|
() => !1
|
|
637
638
|
);
|
|
638
639
|
}
|
|
639
|
-
function
|
|
640
|
+
function zt() {
|
|
640
641
|
return () => {
|
|
641
642
|
};
|
|
642
643
|
}
|
|
643
|
-
var
|
|
644
|
-
(s,
|
|
644
|
+
var Ye = "Avatar", [$t] = La(Ye), [Bt, Ps] = $t(Ye), Fs = _.forwardRef(
|
|
645
|
+
(s, o) => {
|
|
645
646
|
const { __scopeAvatar: t, ...r } = s, [l, i] = _.useState("idle");
|
|
646
647
|
return /* @__PURE__ */ e(
|
|
647
|
-
|
|
648
|
+
Bt,
|
|
648
649
|
{
|
|
649
650
|
scope: t,
|
|
650
651
|
imageLoadingStatus: l,
|
|
651
652
|
onImageLoadingStatusChange: i,
|
|
652
|
-
children: /* @__PURE__ */ e(
|
|
653
|
+
children: /* @__PURE__ */ e(Xe.span, { ...r, ref: o })
|
|
653
654
|
}
|
|
654
655
|
);
|
|
655
656
|
}
|
|
656
657
|
);
|
|
657
|
-
|
|
658
|
-
var
|
|
659
|
-
(s,
|
|
658
|
+
Fs.displayName = Ye;
|
|
659
|
+
var qs = "AvatarImage", js = _.forwardRef(
|
|
660
|
+
(s, o) => {
|
|
660
661
|
const { __scopeAvatar: t, src: r, onLoadingStatusChange: l = () => {
|
|
661
|
-
}, ...i } = s, u =
|
|
662
|
+
}, ...i } = s, u = Ps(qs, t), p = Kt(r, i), g = Ea((v) => {
|
|
662
663
|
l(v), u.onImageLoadingStatusChange(v);
|
|
663
664
|
});
|
|
664
|
-
return
|
|
665
|
+
return _e(() => {
|
|
665
666
|
p !== "idle" && g(p);
|
|
666
|
-
}, [p, g]), p === "loaded" ? /* @__PURE__ */ e(
|
|
667
|
+
}, [p, g]), p === "loaded" ? /* @__PURE__ */ e(Xe.img, { ...i, ref: o, src: r }) : null;
|
|
667
668
|
}
|
|
668
669
|
);
|
|
669
|
-
|
|
670
|
-
var
|
|
671
|
-
(s,
|
|
672
|
-
const { __scopeAvatar: t, delayMs: r, ...l } = s, i =
|
|
670
|
+
js.displayName = qs;
|
|
671
|
+
var Hs = "AvatarFallback", Vs = _.forwardRef(
|
|
672
|
+
(s, o) => {
|
|
673
|
+
const { __scopeAvatar: t, delayMs: r, ...l } = s, i = Ps(Hs, t), [u, p] = _.useState(r === void 0);
|
|
673
674
|
return _.useEffect(() => {
|
|
674
675
|
if (r !== void 0) {
|
|
675
676
|
const g = window.setTimeout(() => p(!0), r);
|
|
676
677
|
return () => window.clearTimeout(g);
|
|
677
678
|
}
|
|
678
|
-
}, [r]), u && i.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(
|
|
679
|
+
}, [r]), u && i.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(Xe.span, { ...l, ref: o }) : null;
|
|
679
680
|
}
|
|
680
681
|
);
|
|
681
|
-
|
|
682
|
-
function
|
|
683
|
-
return s ?
|
|
682
|
+
Vs.displayName = Hs;
|
|
683
|
+
function ys(s, o) {
|
|
684
|
+
return s ? o ? (s.src !== o && (s.src = o), s.complete && s.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
684
685
|
}
|
|
685
|
-
function
|
|
686
|
-
const r =
|
|
687
|
-
() =>
|
|
686
|
+
function Kt(s, { referrerPolicy: o, crossOrigin: t }) {
|
|
687
|
+
const r = Vt(), l = _.useRef(null), i = r ? (l.current || (l.current = new window.Image()), l.current) : null, [u, p] = _.useState(
|
|
688
|
+
() => ys(i, s)
|
|
688
689
|
);
|
|
689
|
-
return
|
|
690
|
-
p(
|
|
691
|
-
}, [i, s]),
|
|
690
|
+
return _e(() => {
|
|
691
|
+
p(ys(i, s));
|
|
692
|
+
}, [i, s]), _e(() => {
|
|
692
693
|
const g = (d) => () => {
|
|
693
694
|
p(d);
|
|
694
695
|
};
|
|
695
696
|
if (!i) return;
|
|
696
697
|
const v = g("loaded"), c = g("error");
|
|
697
|
-
return i.addEventListener("load", v), i.addEventListener("error", c),
|
|
698
|
+
return i.addEventListener("load", v), i.addEventListener("error", c), o && (i.referrerPolicy = o), typeof t == "string" && (i.crossOrigin = t), () => {
|
|
698
699
|
i.removeEventListener("load", v), i.removeEventListener("error", c);
|
|
699
700
|
};
|
|
700
|
-
}, [i, t,
|
|
701
|
+
}, [i, t, o]), u;
|
|
701
702
|
}
|
|
702
|
-
var
|
|
703
|
-
const
|
|
704
|
-
|
|
703
|
+
var zs = Fs, $s = js, Bs = Vs;
|
|
704
|
+
const Ze = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
|
|
705
|
+
zs,
|
|
705
706
|
{
|
|
706
707
|
ref: t,
|
|
707
|
-
className:
|
|
708
|
+
className: J(
|
|
708
709
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
709
710
|
s
|
|
710
711
|
),
|
|
711
|
-
...
|
|
712
|
+
...o
|
|
712
713
|
}
|
|
713
714
|
));
|
|
714
|
-
|
|
715
|
-
const
|
|
716
|
-
|
|
715
|
+
Ze.displayName = zs.displayName;
|
|
716
|
+
const Qt = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
|
|
717
|
+
$s,
|
|
717
718
|
{
|
|
718
719
|
ref: t,
|
|
719
|
-
className:
|
|
720
|
-
...
|
|
720
|
+
className: J("aspect-square h-full w-full", s),
|
|
721
|
+
...o
|
|
721
722
|
}
|
|
722
723
|
));
|
|
723
|
-
|
|
724
|
-
const
|
|
725
|
-
|
|
724
|
+
Qt.displayName = $s.displayName;
|
|
725
|
+
const es = _.forwardRef(({ className: s, ...o }, t) => /* @__PURE__ */ e(
|
|
726
|
+
Bs,
|
|
726
727
|
{
|
|
727
728
|
ref: t,
|
|
728
|
-
className:
|
|
729
|
+
className: J(
|
|
729
730
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
730
731
|
s
|
|
731
732
|
),
|
|
732
|
-
...
|
|
733
|
+
...o
|
|
733
734
|
}
|
|
734
735
|
));
|
|
735
|
-
|
|
736
|
-
function
|
|
736
|
+
es.displayName = Bs.displayName;
|
|
737
|
+
function Wt({
|
|
737
738
|
open: s,
|
|
738
|
-
onOpenChange:
|
|
739
|
+
onOpenChange: o,
|
|
739
740
|
group: t,
|
|
740
741
|
onUpdate: r
|
|
741
742
|
}) {
|
|
742
|
-
const [l, i] = S("members"), [u, p] = S(""), [g, v] = S([]), [c, d] = S([]), { data: m, isLoading: h, refetch: b } =
|
|
743
|
+
const [l, i] = S("members"), [u, p] = S(""), [g, v] = S([]), [c, d] = S([]), { data: m, isLoading: h, refetch: b } = Aa(t.id), y = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: N, isLoading: A } = ka({
|
|
743
744
|
type: y,
|
|
744
745
|
tenantId: t.tenantId || void 0,
|
|
745
746
|
active: !0,
|
|
746
747
|
limit: 100
|
|
747
|
-
}),
|
|
748
|
+
}), O = qt(), U = jt(), M = (m == null ? void 0 : m.members) || [], $ = he(() => new Set(M.map((f) => f.userId)), [M]), P = he(() => N.filter((f) => !$.has(f.id)), [N, $]), B = he(() => {
|
|
748
749
|
if (!u) return P;
|
|
749
750
|
const f = u.toLowerCase();
|
|
750
751
|
return P.filter(
|
|
@@ -753,19 +754,19 @@ function Gt({
|
|
|
753
754
|
return ((T = E.name) == null ? void 0 : T.toLowerCase().includes(f)) || ((w = E.email) == null ? void 0 : w.toLowerCase().includes(f));
|
|
754
755
|
}
|
|
755
756
|
);
|
|
756
|
-
}, [P, u]), D =
|
|
757
|
-
if (!u) return
|
|
757
|
+
}, [P, u]), D = he(() => {
|
|
758
|
+
if (!u) return M;
|
|
758
759
|
const f = u.toLowerCase();
|
|
759
|
-
return
|
|
760
|
+
return M.filter(
|
|
760
761
|
(E) => {
|
|
761
|
-
var T, w,
|
|
762
|
-
return ((w = (T = E.user) == null ? void 0 : T.name) == null ? void 0 : w.toLowerCase().includes(f)) || ((
|
|
762
|
+
var T, w, F, H;
|
|
763
|
+
return ((w = (T = E.user) == null ? void 0 : T.name) == null ? void 0 : w.toLowerCase().includes(f)) || ((H = (F = E.user) == null ? void 0 : F.email) == null ? void 0 : H.toLowerCase().includes(f));
|
|
763
764
|
}
|
|
764
765
|
);
|
|
765
|
-
}, [
|
|
766
|
+
}, [M, u]), R = async () => {
|
|
766
767
|
if (g.length !== 0)
|
|
767
768
|
try {
|
|
768
|
-
await
|
|
769
|
+
await O.mutateAsync({
|
|
769
770
|
groupId: t.id,
|
|
770
771
|
data: {
|
|
771
772
|
userIds: g,
|
|
@@ -775,10 +776,10 @@ function Gt({
|
|
|
775
776
|
} catch (f) {
|
|
776
777
|
console.error("Failed to add members:", f);
|
|
777
778
|
}
|
|
778
|
-
},
|
|
779
|
+
}, K = async () => {
|
|
779
780
|
if (c.length !== 0)
|
|
780
781
|
try {
|
|
781
|
-
await
|
|
782
|
+
await U.mutateAsync({
|
|
782
783
|
groupId: t.id,
|
|
783
784
|
data: {
|
|
784
785
|
userIds: c
|
|
@@ -787,22 +788,22 @@ function Gt({
|
|
|
787
788
|
} catch (f) {
|
|
788
789
|
console.error("Failed to remove members:", f);
|
|
789
790
|
}
|
|
790
|
-
},
|
|
791
|
+
}, oe = (f) => {
|
|
791
792
|
v(
|
|
792
793
|
(E) => E.includes(f) ? E.filter((T) => T !== f) : [...E, f]
|
|
793
794
|
);
|
|
794
|
-
},
|
|
795
|
+
}, Q = (f) => {
|
|
795
796
|
d(
|
|
796
797
|
(E) => E.includes(f) ? E.filter((T) => T !== f) : [...E, f]
|
|
797
798
|
);
|
|
798
799
|
};
|
|
799
|
-
return /* @__PURE__ */ e(
|
|
800
|
-
/* @__PURE__ */ a(
|
|
801
|
-
/* @__PURE__ */ e(
|
|
800
|
+
return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(Be, { open: s, onOpenChange: o, children: /* @__PURE__ */ a(Qe, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
|
|
801
|
+
/* @__PURE__ */ a(We, { children: [
|
|
802
|
+
/* @__PURE__ */ e(Je, { children: t.name }),
|
|
802
803
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ a("p", { className: "text-sm text-muted-foreground", children: [
|
|
803
|
-
|
|
804
|
+
M.length,
|
|
804
805
|
" ",
|
|
805
|
-
|
|
806
|
+
M.length === 1 ? "member" : "members"
|
|
806
807
|
] }) }),
|
|
807
808
|
/* @__PURE__ */ a("p", { id: "group-members-description", className: "sr-only", children: [
|
|
808
809
|
"Add or remove members from the ",
|
|
@@ -810,18 +811,18 @@ function Gt({
|
|
|
810
811
|
" group"
|
|
811
812
|
] })
|
|
812
813
|
] }),
|
|
813
|
-
/* @__PURE__ */ a(
|
|
814
|
+
/* @__PURE__ */ a(Cs, { value: l, onValueChange: (f) => {
|
|
814
815
|
i(f), p(""), d([]);
|
|
815
816
|
}, className: "mt-4", children: [
|
|
816
|
-
/* @__PURE__ */ a(
|
|
817
|
-
/* @__PURE__ */ e(
|
|
818
|
-
/* @__PURE__ */ e(
|
|
817
|
+
/* @__PURE__ */ a(Ls, { className: "grid w-full grid-cols-2", children: [
|
|
818
|
+
/* @__PURE__ */ e(pe, { value: "members", children: "Current Members" }),
|
|
819
|
+
/* @__PURE__ */ e(pe, { value: "add", children: "Add Members" })
|
|
819
820
|
] }),
|
|
820
|
-
/* @__PURE__ */ a(
|
|
821
|
+
/* @__PURE__ */ a(fe, { value: "members", className: "mt-4 space-y-4", children: [
|
|
821
822
|
/* @__PURE__ */ a("div", { className: "relative", children: [
|
|
822
|
-
/* @__PURE__ */ e(
|
|
823
|
+
/* @__PURE__ */ e(Ue, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
823
824
|
/* @__PURE__ */ e(
|
|
824
|
-
|
|
825
|
+
re,
|
|
825
826
|
{
|
|
826
827
|
placeholder: "Search members...",
|
|
827
828
|
value: u,
|
|
@@ -830,16 +831,16 @@ function Gt({
|
|
|
830
831
|
}
|
|
831
832
|
)
|
|
832
833
|
] }),
|
|
833
|
-
/* @__PURE__ */ e(
|
|
834
|
+
/* @__PURE__ */ e(Re, { className: c.length > 0 ? "h-[300px]" : "h-[350px]", children: h ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((f) => /* @__PURE__ */ e(Ge, { className: "h-16 w-full" }, f)) }) : D.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
834
835
|
/* @__PURE__ */ e(z, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
835
836
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: u ? "No members found" : "No members yet" }),
|
|
836
837
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
|
|
837
838
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: D.map((f) => /* @__PURE__ */ e(
|
|
838
|
-
|
|
839
|
+
Jt,
|
|
839
840
|
{
|
|
840
841
|
member: f,
|
|
841
842
|
selected: c.includes(f.userId),
|
|
842
|
-
onToggle: () =>
|
|
843
|
+
onToggle: () => Q(f.userId)
|
|
843
844
|
},
|
|
844
845
|
f.id
|
|
845
846
|
)) }) }),
|
|
@@ -855,24 +856,24 @@ function Gt({
|
|
|
855
856
|
{
|
|
856
857
|
variant: "destructive",
|
|
857
858
|
size: "sm",
|
|
858
|
-
onClick:
|
|
859
|
-
disabled:
|
|
860
|
-
children:
|
|
859
|
+
onClick: K,
|
|
860
|
+
disabled: U.isPending,
|
|
861
|
+
children: U.isPending ? /* @__PURE__ */ a(k, { children: [
|
|
861
862
|
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
862
863
|
"Removing..."
|
|
863
|
-
] }) : /* @__PURE__ */ a(
|
|
864
|
-
/* @__PURE__ */ e(
|
|
864
|
+
] }) : /* @__PURE__ */ a(k, { children: [
|
|
865
|
+
/* @__PURE__ */ e(Es, { className: "mr-2 h-4 w-4" }),
|
|
865
866
|
"Remove Selected"
|
|
866
867
|
] })
|
|
867
868
|
}
|
|
868
869
|
)
|
|
869
870
|
] })
|
|
870
871
|
] }),
|
|
871
|
-
/* @__PURE__ */ a(
|
|
872
|
+
/* @__PURE__ */ a(fe, { value: "add", className: "mt-4 space-y-4", children: [
|
|
872
873
|
/* @__PURE__ */ a("div", { className: "relative", children: [
|
|
873
|
-
/* @__PURE__ */ e(
|
|
874
|
+
/* @__PURE__ */ e(Ue, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
874
875
|
/* @__PURE__ */ e(
|
|
875
|
-
|
|
876
|
+
re,
|
|
876
877
|
{
|
|
877
878
|
placeholder: "Search users to add...",
|
|
878
879
|
value: u,
|
|
@@ -881,16 +882,16 @@ function Gt({
|
|
|
881
882
|
}
|
|
882
883
|
)
|
|
883
884
|
] }),
|
|
884
|
-
/* @__PURE__ */ e(
|
|
885
|
-
/* @__PURE__ */ e(
|
|
885
|
+
/* @__PURE__ */ e(Re, { className: "h-[300px]", children: A ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((f) => /* @__PURE__ */ e(Ge, { className: "h-16 w-full" }, f)) }) : B.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
886
|
+
/* @__PURE__ */ e(Pe, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
886
887
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
887
888
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: u ? "Try a different search" : "All eligible users are already members" })
|
|
888
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children:
|
|
889
|
-
|
|
889
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: B.map((f) => /* @__PURE__ */ e(
|
|
890
|
+
Xt,
|
|
890
891
|
{
|
|
891
892
|
user: f,
|
|
892
893
|
selected: g.includes(f.id),
|
|
893
|
-
onToggle: () =>
|
|
894
|
+
onToggle: () => oe(f.id)
|
|
894
895
|
},
|
|
895
896
|
f.id
|
|
896
897
|
)) }) }),
|
|
@@ -905,12 +906,12 @@ function Gt({
|
|
|
905
906
|
C,
|
|
906
907
|
{
|
|
907
908
|
onClick: R,
|
|
908
|
-
disabled:
|
|
909
|
-
children:
|
|
909
|
+
disabled: O.isPending,
|
|
910
|
+
children: O.isPending ? /* @__PURE__ */ a(k, { children: [
|
|
910
911
|
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
911
912
|
"Adding..."
|
|
912
|
-
] }) : /* @__PURE__ */ a(
|
|
913
|
-
/* @__PURE__ */ e(
|
|
913
|
+
] }) : /* @__PURE__ */ a(k, { children: [
|
|
914
|
+
/* @__PURE__ */ e(Pe, { className: "mr-2 h-4 w-4" }),
|
|
914
915
|
"Add Members"
|
|
915
916
|
] })
|
|
916
917
|
}
|
|
@@ -920,9 +921,9 @@ function Gt({
|
|
|
920
921
|
] })
|
|
921
922
|
] }) }) });
|
|
922
923
|
}
|
|
923
|
-
function
|
|
924
|
+
function Jt({
|
|
924
925
|
member: s,
|
|
925
|
-
selected:
|
|
926
|
+
selected: o,
|
|
926
927
|
onToggle: t
|
|
927
928
|
}) {
|
|
928
929
|
var l, i, u, p;
|
|
@@ -933,8 +934,8 @@ function Rt({
|
|
|
933
934
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
934
935
|
onClick: t,
|
|
935
936
|
children: [
|
|
936
|
-
/* @__PURE__ */ e(
|
|
937
|
-
/* @__PURE__ */ e(
|
|
937
|
+
/* @__PURE__ */ e(As, { checked: o }),
|
|
938
|
+
/* @__PURE__ */ e(Ze, { className: "h-8 w-8", children: /* @__PURE__ */ e(es, { className: "text-xs", children: r }) }),
|
|
938
939
|
/* @__PURE__ */ a("div", { className: "flex-1", children: [
|
|
939
940
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((u = s.user) == null ? void 0 : u.name) || "Unknown User" }),
|
|
940
941
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (p = s.user) == null ? void 0 : p.email })
|
|
@@ -943,9 +944,9 @@ function Rt({
|
|
|
943
944
|
}
|
|
944
945
|
);
|
|
945
946
|
}
|
|
946
|
-
function
|
|
947
|
+
function Xt({
|
|
947
948
|
user: s,
|
|
948
|
-
selected:
|
|
949
|
+
selected: o,
|
|
949
950
|
onToggle: t
|
|
950
951
|
}) {
|
|
951
952
|
var l;
|
|
@@ -956,8 +957,8 @@ function Pt({
|
|
|
956
957
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
957
958
|
onClick: t,
|
|
958
959
|
children: [
|
|
959
|
-
/* @__PURE__ */ e(
|
|
960
|
-
/* @__PURE__ */ e(
|
|
960
|
+
/* @__PURE__ */ e(As, { checked: o }),
|
|
961
|
+
/* @__PURE__ */ e(Ze, { className: "h-8 w-8", children: /* @__PURE__ */ e(es, { className: "text-xs", children: r }) }),
|
|
961
962
|
/* @__PURE__ */ a("div", { className: "flex-1", children: [
|
|
962
963
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: s.name }),
|
|
963
964
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: s.email })
|
|
@@ -966,15 +967,15 @@ function Pt({
|
|
|
966
967
|
}
|
|
967
968
|
);
|
|
968
969
|
}
|
|
969
|
-
function
|
|
970
|
+
function Yt({
|
|
970
971
|
open: s,
|
|
971
|
-
onOpenChange:
|
|
972
|
+
onOpenChange: o
|
|
972
973
|
}) {
|
|
973
|
-
const [t, r] = S("groups"), [l, i] = S(""), [u, p] = S(null), [g, v] = S(!1), [c, d] = S(null), { tokenProps: m } =
|
|
974
|
+
const [t, r] = S("groups"), [l, i] = S(""), [u, p] = S(null), [g, v] = S(!1), [c, d] = S(null), { tokenProps: m } = j(), { currentUser: h } = ks(), b = Ft(), y = (h == null ? void 0 : h.type) === "tenant", N = m == null ? void 0 : m.tenantId, { groups: A, isLoading: O, refetch: U } = Ma({
|
|
974
975
|
type: y ? "TENANT_GROUP" : "all",
|
|
975
976
|
tenantId: y ? N : void 0,
|
|
976
977
|
includeMembers: !1
|
|
977
|
-
}),
|
|
978
|
+
}), M = A.filter(
|
|
978
979
|
(D) => {
|
|
979
980
|
var R;
|
|
980
981
|
return D.name.toLowerCase().includes(l.toLowerCase()) || ((R = D.description) == null ? void 0 : R.toLowerCase().includes(l.toLowerCase()));
|
|
@@ -982,40 +983,40 @@ function Ut({
|
|
|
982
983
|
), $ = async () => {
|
|
983
984
|
if (c)
|
|
984
985
|
try {
|
|
985
|
-
await b.mutateAsync(c.id), d(null),
|
|
986
|
+
await b.mutateAsync(c.id), d(null), U();
|
|
986
987
|
} catch (D) {
|
|
987
988
|
console.error("Failed to delete group:", D);
|
|
988
989
|
}
|
|
989
990
|
}, P = (D) => {
|
|
990
991
|
p(D), v(!0);
|
|
991
|
-
},
|
|
992
|
-
r("groups"),
|
|
992
|
+
}, B = () => {
|
|
993
|
+
r("groups"), U();
|
|
993
994
|
};
|
|
994
|
-
return /* @__PURE__ */ a(
|
|
995
|
-
/* @__PURE__ */ e(
|
|
996
|
-
/* @__PURE__ */ a(
|
|
997
|
-
/* @__PURE__ */ a(
|
|
995
|
+
return /* @__PURE__ */ a(k, { children: [
|
|
996
|
+
/* @__PURE__ */ e(Be, { open: s, onOpenChange: o, children: /* @__PURE__ */ a(Qe, { className: "max-w-4xl max-h-[80vh]", children: [
|
|
997
|
+
/* @__PURE__ */ a(We, { children: [
|
|
998
|
+
/* @__PURE__ */ a(Je, { className: "flex items-center gap-2", children: [
|
|
998
999
|
/* @__PURE__ */ e(z, { className: "h-5 w-5" }),
|
|
999
1000
|
"Group Management"
|
|
1000
1001
|
] }),
|
|
1001
|
-
/* @__PURE__ */ e(
|
|
1002
|
+
/* @__PURE__ */ e(Ss, { children: "Manage your groups, create new groups, and control group membership" })
|
|
1002
1003
|
] }),
|
|
1003
|
-
/* @__PURE__ */ a(
|
|
1004
|
-
/* @__PURE__ */ a(
|
|
1005
|
-
/* @__PURE__ */ a(
|
|
1004
|
+
/* @__PURE__ */ a(Cs, { value: t, onValueChange: r, className: "mt-4", children: [
|
|
1005
|
+
/* @__PURE__ */ a(Ls, { className: "grid w-full grid-cols-2", children: [
|
|
1006
|
+
/* @__PURE__ */ a(pe, { value: "groups", className: "flex items-center gap-2", children: [
|
|
1006
1007
|
/* @__PURE__ */ e(z, { className: "h-4 w-4" }),
|
|
1007
1008
|
"Groups"
|
|
1008
1009
|
] }),
|
|
1009
|
-
/* @__PURE__ */ a(
|
|
1010
|
-
/* @__PURE__ */ e(
|
|
1010
|
+
/* @__PURE__ */ a(pe, { value: "create", className: "flex items-center gap-2", children: [
|
|
1011
|
+
/* @__PURE__ */ e(Ke, { className: "h-4 w-4" }),
|
|
1011
1012
|
"Create Group"
|
|
1012
1013
|
] })
|
|
1013
1014
|
] }),
|
|
1014
|
-
/* @__PURE__ */ e(
|
|
1015
|
+
/* @__PURE__ */ e(fe, { value: "groups", className: "mt-4", children: /* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
1015
1016
|
/* @__PURE__ */ a("div", { className: "relative", children: [
|
|
1016
|
-
/* @__PURE__ */ e(
|
|
1017
|
+
/* @__PURE__ */ e(Ue, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
1017
1018
|
/* @__PURE__ */ e(
|
|
1018
|
-
|
|
1019
|
+
re,
|
|
1019
1020
|
{
|
|
1020
1021
|
placeholder: "Search groups...",
|
|
1021
1022
|
value: l,
|
|
@@ -1024,12 +1025,12 @@ function Ut({
|
|
|
1024
1025
|
}
|
|
1025
1026
|
)
|
|
1026
1027
|
] }),
|
|
1027
|
-
/* @__PURE__ */ e(
|
|
1028
|
+
/* @__PURE__ */ e(Re, { className: "h-[400px]", children: O ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((D) => /* @__PURE__ */ e(Ge, { className: "h-24 w-full" }, D)) }) : M.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
1028
1029
|
/* @__PURE__ */ e(z, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
1029
1030
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
|
|
1030
1031
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
|
|
1031
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
1032
|
-
|
|
1032
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: M.map((D) => /* @__PURE__ */ e(
|
|
1033
|
+
Zt,
|
|
1033
1034
|
{
|
|
1034
1035
|
group: D,
|
|
1035
1036
|
onManageMembers: () => P(D),
|
|
@@ -1039,10 +1040,10 @@ function Ut({
|
|
|
1039
1040
|
D.id
|
|
1040
1041
|
)) }) })
|
|
1041
1042
|
] }) }),
|
|
1042
|
-
/* @__PURE__ */ e(
|
|
1043
|
-
|
|
1043
|
+
/* @__PURE__ */ e(fe, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1044
|
+
Ht,
|
|
1044
1045
|
{
|
|
1045
|
-
onSuccess:
|
|
1046
|
+
onSuccess: B,
|
|
1046
1047
|
tenantId: N,
|
|
1047
1048
|
isTenantUser: y
|
|
1048
1049
|
}
|
|
@@ -1050,37 +1051,37 @@ function Ut({
|
|
|
1050
1051
|
] })
|
|
1051
1052
|
] }) }),
|
|
1052
1053
|
u && /* @__PURE__ */ e(
|
|
1053
|
-
|
|
1054
|
+
Wt,
|
|
1054
1055
|
{
|
|
1055
1056
|
open: g,
|
|
1056
1057
|
onOpenChange: v,
|
|
1057
1058
|
group: u,
|
|
1058
|
-
onUpdate: () =>
|
|
1059
|
+
onUpdate: () => U()
|
|
1059
1060
|
}
|
|
1060
1061
|
),
|
|
1061
1062
|
/* @__PURE__ */ e(
|
|
1062
|
-
|
|
1063
|
+
Ms,
|
|
1063
1064
|
{
|
|
1064
1065
|
open: !!c,
|
|
1065
1066
|
onOpenChange: () => d(null),
|
|
1066
|
-
children: /* @__PURE__ */ a(
|
|
1067
|
-
/* @__PURE__ */ a(
|
|
1068
|
-
/* @__PURE__ */ e(
|
|
1069
|
-
/* @__PURE__ */ a(
|
|
1067
|
+
children: /* @__PURE__ */ a(Is, { children: [
|
|
1068
|
+
/* @__PURE__ */ a(Os, { children: [
|
|
1069
|
+
/* @__PURE__ */ e(Ts, { children: "Delete Group" }),
|
|
1070
|
+
/* @__PURE__ */ a(_s, { children: [
|
|
1070
1071
|
'Are you sure you want to delete "',
|
|
1071
1072
|
c == null ? void 0 : c.name,
|
|
1072
1073
|
'"? This action cannot be undone and will remove all members from the group.'
|
|
1073
1074
|
] })
|
|
1074
1075
|
] }),
|
|
1075
|
-
/* @__PURE__ */ a(
|
|
1076
|
-
/* @__PURE__ */ e(
|
|
1076
|
+
/* @__PURE__ */ a(Us, { children: [
|
|
1077
|
+
/* @__PURE__ */ e(Rs, { children: "Cancel" }),
|
|
1077
1078
|
/* @__PURE__ */ e(
|
|
1078
|
-
|
|
1079
|
+
Fe,
|
|
1079
1080
|
{
|
|
1080
1081
|
onClick: $,
|
|
1081
1082
|
disabled: b.isPending,
|
|
1082
1083
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1083
|
-
children: b.isPending ? /* @__PURE__ */ a(
|
|
1084
|
+
children: b.isPending ? /* @__PURE__ */ a(k, { children: [
|
|
1084
1085
|
/* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1085
1086
|
"Deleting..."
|
|
1086
1087
|
] }) : "Delete Group"
|
|
@@ -1092,9 +1093,9 @@ function Ut({
|
|
|
1092
1093
|
)
|
|
1093
1094
|
] });
|
|
1094
1095
|
}
|
|
1095
|
-
function
|
|
1096
|
+
function Zt({
|
|
1096
1097
|
group: s,
|
|
1097
|
-
onManageMembers:
|
|
1098
|
+
onManageMembers: o,
|
|
1098
1099
|
onDelete: t,
|
|
1099
1100
|
currentUserId: r
|
|
1100
1101
|
}) {
|
|
@@ -1114,7 +1115,7 @@ function Ft({
|
|
|
1114
1115
|
] }),
|
|
1115
1116
|
/* @__PURE__ */ a("span", { children: [
|
|
1116
1117
|
"Created ",
|
|
1117
|
-
|
|
1118
|
+
vt(new Date(s.createdAt), "MMM d, yyyy")
|
|
1118
1119
|
] })
|
|
1119
1120
|
] })
|
|
1120
1121
|
] }),
|
|
@@ -1124,9 +1125,9 @@ function Ft({
|
|
|
1124
1125
|
{
|
|
1125
1126
|
variant: "ghost",
|
|
1126
1127
|
size: "sm",
|
|
1127
|
-
onClick:
|
|
1128
|
+
onClick: o,
|
|
1128
1129
|
title: "Manage members",
|
|
1129
|
-
children: /* @__PURE__ */ e(
|
|
1130
|
+
children: /* @__PURE__ */ e(Pe, { className: "h-4 w-4" })
|
|
1130
1131
|
}
|
|
1131
1132
|
),
|
|
1132
1133
|
l && /* @__PURE__ */ e(
|
|
@@ -1137,147 +1138,164 @@ function Ft({
|
|
|
1137
1138
|
onClick: t,
|
|
1138
1139
|
title: "Delete group",
|
|
1139
1140
|
className: "text-destructive hover:text-destructive",
|
|
1140
|
-
children: /* @__PURE__ */ e(
|
|
1141
|
+
children: /* @__PURE__ */ e(Es, { className: "h-4 w-4" })
|
|
1141
1142
|
}
|
|
1142
1143
|
)
|
|
1143
1144
|
] })
|
|
1144
1145
|
] }) });
|
|
1145
1146
|
}
|
|
1146
|
-
function
|
|
1147
|
-
var
|
|
1148
|
-
|
|
1147
|
+
function dr() {
|
|
1148
|
+
var ds, us, ms, hs;
|
|
1149
|
+
lt(), ct();
|
|
1149
1150
|
const {
|
|
1150
1151
|
authToken: s,
|
|
1151
|
-
tokenProps:
|
|
1152
|
+
tokenProps: o,
|
|
1152
1153
|
id: t
|
|
1153
|
-
} =
|
|
1154
|
-
x((
|
|
1155
|
-
const p = x((
|
|
1156
|
-
x((
|
|
1154
|
+
} = j(), { isLocalDev: r } = Ia(), { permissions: l } = gt(), i = Oa(), { isLoading: u } = Ta();
|
|
1155
|
+
x((n) => n.theme);
|
|
1156
|
+
const p = x((n) => n.lenses), g = x((n) => n.selectedLensId), v = p == null ? void 0 : p.find((n) => n.id === g), c = x((n) => n.dashboard);
|
|
1157
|
+
x((n) => n.selectedSheetId);
|
|
1157
1158
|
const d = x(
|
|
1158
|
-
(
|
|
1159
|
-
), { setDashboardTitle: m } = x((
|
|
1160
|
-
(
|
|
1161
|
-
), T = x((
|
|
1162
|
-
|
|
1163
|
-
const
|
|
1164
|
-
(
|
|
1165
|
-
),
|
|
1166
|
-
(
|
|
1159
|
+
(n) => n.isDashboardEditing
|
|
1160
|
+
), { setDashboardTitle: m } = x((n) => n.actions), [h, b] = S(!1), [y, N] = S(!1), [A, O] = S(!1), [U, M] = S(!1), [$, P] = S(!1), [B, D] = S(!1), [R, K] = S(null), [oe, Q] = S(!1), f = x((n) => n.isDashboardPanelOpen), E = x(
|
|
1161
|
+
(n) => n.actions.setIsDashboardPanelOpen
|
|
1162
|
+
), T = x((n) => n.filterValues), w = x((n) => n.isVisualEditing);
|
|
1163
|
+
fs((n) => n.card);
|
|
1164
|
+
const F = me(
|
|
1165
|
+
(n) => n.selectedDashboard
|
|
1166
|
+
), H = me(
|
|
1167
|
+
(n) => n.initialDashboard
|
|
1167
1168
|
);
|
|
1168
|
-
|
|
1169
|
-
const
|
|
1170
|
-
(
|
|
1171
|
-
),
|
|
1172
|
-
(
|
|
1173
|
-
), { setIsDashboardEditing:
|
|
1174
|
-
(
|
|
1175
|
-
), { setInitialDashboard:
|
|
1176
|
-
(
|
|
1177
|
-
), { resources:
|
|
1178
|
-
id:
|
|
1179
|
-
title: (c == null ? void 0 : c.title) ||
|
|
1180
|
-
} : null, { handleAddNewFrame:
|
|
1169
|
+
me((n) => n.selectedVisual), x((n) => n.selectedFrameId), fs((n) => n.frame);
|
|
1170
|
+
const ie = F ? (us = F == null ? void 0 : F.permissions) == null ? void 0 : us.canEdit : (ds = H == null ? void 0 : H.permissions) == null ? void 0 : ds.canEdit, Ks = x((n) => n.showFilters), Qs = _a((n) => n.setPanelOpen), Ws = x(
|
|
1171
|
+
(n) => n.showDashboardJSON
|
|
1172
|
+
), be = x((n) => n.onSaveFunction), Js = x(
|
|
1173
|
+
(n) => n.actions.setShowFilters
|
|
1174
|
+
), { setIsDashboardEditing: ss, setShowDashboardJSON: as } = x(
|
|
1175
|
+
(n) => n.actions
|
|
1176
|
+
), { setInitialDashboard: ts, clearSelectedDashboard: ye } = me(
|
|
1177
|
+
(n) => n.actions
|
|
1178
|
+
), { resources: le } = Ua(ke.DASHBOARD), { data: Ne } = Ra(), Xs = ((ms = Ne == null ? void 0 : Ne.preference) == null ? void 0 : ms.defaultDashboardId) || null, { mutate: Ys, isPending: Zs } = Ga(), { currentUser: ea } = ks(), sa = Pa(ea), W = F || H, rs = W ? {
|
|
1179
|
+
id: W.id,
|
|
1180
|
+
title: (c == null ? void 0 : c.title) || W.title || "Dashboard"
|
|
1181
|
+
} : null, { handleAddNewFrame: aa } = Fa(), [Se, we] = S(!1), [ta, X] = S(!1), [Y, ce] = S("close"), Z = qa(ke.DASHBOARD), [G, xe] = S(
|
|
1181
1182
|
null
|
|
1182
|
-
),
|
|
1183
|
+
), ra = async (n, I) => {
|
|
1183
1184
|
if (!(c != null && c.id)) {
|
|
1184
1185
|
console.log("No dashboard ID found");
|
|
1185
1186
|
return;
|
|
1186
1187
|
}
|
|
1187
1188
|
console.log("Updating dashboard title:", {
|
|
1188
1189
|
dashboardId: c.id,
|
|
1189
|
-
newTitle:
|
|
1190
|
-
previousTitle:
|
|
1191
|
-
}),
|
|
1190
|
+
newTitle: n,
|
|
1191
|
+
previousTitle: I
|
|
1192
|
+
}), Z.mutate(
|
|
1192
1193
|
{
|
|
1193
1194
|
resourceId: c.id,
|
|
1194
|
-
data: { title:
|
|
1195
|
+
data: { title: n }
|
|
1195
1196
|
},
|
|
1196
1197
|
{
|
|
1197
1198
|
onSuccess: () => {
|
|
1198
1199
|
console.log("Dashboard title updated successfully"), L.success("Dashboard title updated");
|
|
1199
1200
|
},
|
|
1200
|
-
onError: (
|
|
1201
|
-
console.error("Failed to update dashboard title:",
|
|
1201
|
+
onError: (ae) => {
|
|
1202
|
+
console.error("Failed to update dashboard title:", ae), L.error("Failed to update dashboard title"), m(I);
|
|
1202
1203
|
}
|
|
1203
1204
|
}
|
|
1204
1205
|
);
|
|
1205
1206
|
};
|
|
1206
|
-
|
|
1207
|
-
if (
|
|
1208
|
-
const
|
|
1209
|
-
if (
|
|
1210
|
-
const
|
|
1211
|
-
(
|
|
1207
|
+
ot(() => {
|
|
1208
|
+
if (le && le.length > 0) {
|
|
1209
|
+
const n = c == null ? void 0 : c.id;
|
|
1210
|
+
if (n) {
|
|
1211
|
+
const I = le.find(
|
|
1212
|
+
(ae) => ae.id === n
|
|
1212
1213
|
);
|
|
1213
|
-
|
|
1214
|
+
I && ts(I);
|
|
1214
1215
|
}
|
|
1215
1216
|
}
|
|
1216
|
-
}, [
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1219
|
-
},
|
|
1220
|
-
|
|
1217
|
+
}, [le, c == null ? void 0 : c.id, ts]);
|
|
1218
|
+
const de = o.orgUserId || o.tenantId, ns = d && !w && de && ie, { setDashboard: De } = x((n) => n.actions), na = () => {
|
|
1219
|
+
ss(!0);
|
|
1220
|
+
}, Ce = () => {
|
|
1221
|
+
ss(!1), as(!1), xe(null);
|
|
1221
1222
|
};
|
|
1222
|
-
|
|
1223
|
+
dt(
|
|
1223
1224
|
d,
|
|
1224
1225
|
c,
|
|
1225
|
-
|
|
1226
|
-
(
|
|
1226
|
+
G,
|
|
1227
|
+
(n) => xe(n)
|
|
1227
1228
|
);
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1229
|
+
const { isDirty: os, isDirtyPending: oa, resetDirty: ue } = Nt(
|
|
1230
|
+
c,
|
|
1231
|
+
G,
|
|
1232
|
+
300,
|
|
1233
|
+
1e3,
|
|
1234
|
+
Me
|
|
1235
|
+
), is = it(() => G ? Me(c) !== Me(G) : !1, [c, G]), Le = os || oa, ee = Se || Z.isPending, ia = () => {
|
|
1236
|
+
is() ? (ce("close"), X(!0)) : (Ce(), ue());
|
|
1237
|
+
}, la = async () => {
|
|
1238
|
+
await Ee({
|
|
1239
|
+
closeAfterSave: !0,
|
|
1240
|
+
navigateHomeAfterSave: Y === "home"
|
|
1241
|
+
});
|
|
1242
|
+
}, ca = () => {
|
|
1243
|
+
G && De(G), Ce(), Y === "home" && ye(), ce("close"), X(!1), ue();
|
|
1244
|
+
}, da = () => {
|
|
1245
|
+
G && (De(G), ue());
|
|
1246
|
+
}, ua = () => {
|
|
1247
|
+
if (d && is()) {
|
|
1248
|
+
ce("home"), X(!0);
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1251
|
+
ye();
|
|
1234
1252
|
};
|
|
1235
|
-
async function
|
|
1236
|
-
const
|
|
1237
|
-
|
|
1238
|
-
const
|
|
1239
|
-
D(!0),
|
|
1240
|
-
const
|
|
1253
|
+
async function Ee(n) {
|
|
1254
|
+
const I = (n == null ? void 0 : n.closeAfterSave) ?? oe, ae = (n == null ? void 0 : n.navigateHomeAfterSave) ?? !1;
|
|
1255
|
+
Q(I), I && X(!1);
|
|
1256
|
+
const ga = nt(c);
|
|
1257
|
+
D(!0), K(null), we(!0);
|
|
1258
|
+
const va = {
|
|
1241
1259
|
template: c
|
|
1242
1260
|
};
|
|
1243
|
-
|
|
1261
|
+
Z.mutate(
|
|
1244
1262
|
{
|
|
1245
1263
|
resourceId: c.id,
|
|
1246
|
-
data:
|
|
1264
|
+
data: va
|
|
1247
1265
|
},
|
|
1248
1266
|
{
|
|
1249
1267
|
onSuccess: () => {
|
|
1250
|
-
|
|
1268
|
+
we(!1), L.success("Dashboard saved!"), xe(ga), D(!1), Q(!1), I && (Ce(), ue(), ae && ye()), ce("close");
|
|
1251
1269
|
},
|
|
1252
1270
|
onError: () => {
|
|
1253
|
-
|
|
1271
|
+
we(!1), K("Failed to save dashboard. Please try again."), L.error("Failed to save dashboard");
|
|
1254
1272
|
}
|
|
1255
1273
|
}
|
|
1256
1274
|
);
|
|
1257
1275
|
}
|
|
1258
|
-
async function
|
|
1276
|
+
async function ma() {
|
|
1259
1277
|
if (b(!0), !g || !v) return;
|
|
1260
|
-
const
|
|
1278
|
+
const n = JSON.stringify(c), I = {
|
|
1261
1279
|
...v,
|
|
1262
|
-
template:
|
|
1280
|
+
template: n,
|
|
1263
1281
|
filterValues: T
|
|
1264
1282
|
};
|
|
1265
|
-
await
|
|
1266
|
-
|
|
1267
|
-
|
|
1283
|
+
await je(
|
|
1284
|
+
o.apiServiceUrl,
|
|
1285
|
+
I,
|
|
1268
1286
|
s == null ? void 0 : s.accessToken
|
|
1269
|
-
), L.success("Lens saved"),
|
|
1287
|
+
), L.success("Lens saved"), be == null || be(c), b(!1);
|
|
1270
1288
|
}
|
|
1271
|
-
const
|
|
1272
|
-
|
|
1273
|
-
title:
|
|
1289
|
+
const ls = (v == null ? void 0 : v.name) || c.title;
|
|
1290
|
+
Z.isPending && console.log("Title during update:", {
|
|
1291
|
+
title: ls,
|
|
1274
1292
|
dashboardStateTitle: c.title,
|
|
1275
1293
|
dashboardId: c == null ? void 0 : c.id,
|
|
1276
1294
|
currentLensName: v == null ? void 0 : v.name
|
|
1277
1295
|
});
|
|
1278
|
-
const
|
|
1279
|
-
|
|
1280
|
-
dashboardId:
|
|
1296
|
+
const cs = o.orgUserId || o.tenantId && o.endUserId && o.endUserEmail, ha = !!cs && !!(s != null && s.accessToken) && !!(o != null && o.apiServiceUrl), pa = i, se = (c == null ? void 0 : c.id) || null, Ae = !!se && Xs === se, fa = () => {
|
|
1297
|
+
se && Ys({
|
|
1298
|
+
dashboardId: Ae ? null : se
|
|
1281
1299
|
});
|
|
1282
1300
|
};
|
|
1283
1301
|
return /* @__PURE__ */ a(
|
|
@@ -1287,9 +1305,9 @@ function Wt() {
|
|
|
1287
1305
|
role: "dashboard-controls",
|
|
1288
1306
|
children: [
|
|
1289
1307
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
1290
|
-
|
|
1308
|
+
cs && /* @__PURE__ */ a(k, { children: [
|
|
1291
1309
|
/* @__PURE__ */ e(
|
|
1292
|
-
|
|
1310
|
+
q,
|
|
1293
1311
|
{
|
|
1294
1312
|
"aria-label": "Manage Dashboards",
|
|
1295
1313
|
tooltip: "Manage Dashboards",
|
|
@@ -1297,141 +1315,141 @@ function Wt() {
|
|
|
1297
1315
|
E(!f);
|
|
1298
1316
|
},
|
|
1299
1317
|
className: "h-7 p-2",
|
|
1300
|
-
children: /* @__PURE__ */ e(
|
|
1318
|
+
children: /* @__PURE__ */ e(wt, { className: "h-4 w-4" })
|
|
1301
1319
|
}
|
|
1302
1320
|
),
|
|
1303
|
-
|
|
1304
|
-
|
|
1321
|
+
pa && !w && /* @__PURE__ */ e(
|
|
1322
|
+
q,
|
|
1305
1323
|
{
|
|
1306
1324
|
"aria-label": "Dashboard Hub",
|
|
1307
1325
|
tooltip: "Dashboard Hub",
|
|
1308
|
-
onClick:
|
|
1326
|
+
onClick: ua,
|
|
1309
1327
|
className: "h-7 p-2",
|
|
1310
|
-
children: /* @__PURE__ */ e(
|
|
1328
|
+
children: /* @__PURE__ */ e(ws, { className: "h-4 w-4" })
|
|
1311
1329
|
}
|
|
1312
1330
|
)
|
|
1313
1331
|
] }),
|
|
1314
1332
|
!w && i && (u ? /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
1315
1333
|
/* @__PURE__ */ e(V, { className: "h-3 w-3 animate-spin text-muted-foreground" }),
|
|
1316
1334
|
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Loading..." })
|
|
1317
|
-
] }) : /* @__PURE__ */ a(
|
|
1335
|
+
] }) : /* @__PURE__ */ a(k, { children: [
|
|
1318
1336
|
/* @__PURE__ */ e(
|
|
1319
|
-
|
|
1337
|
+
ja,
|
|
1320
1338
|
{
|
|
1321
|
-
value:
|
|
1322
|
-
onSave: (
|
|
1339
|
+
value: ls || "Untitled Dashboard",
|
|
1340
|
+
onSave: (n) => {
|
|
1323
1341
|
console.log("EditableText onSave called:", {
|
|
1324
|
-
newTitle:
|
|
1325
|
-
canEditDashboard:
|
|
1342
|
+
newTitle: n,
|
|
1343
|
+
canEditDashboard: ie,
|
|
1326
1344
|
dashboardId: c == null ? void 0 : c.id
|
|
1327
1345
|
});
|
|
1328
|
-
const
|
|
1329
|
-
m(
|
|
1346
|
+
const I = (c == null ? void 0 : c.title) || "";
|
|
1347
|
+
m(n), ra(n, I);
|
|
1330
1348
|
},
|
|
1331
|
-
isEditable:
|
|
1349
|
+
isEditable: ie && !v,
|
|
1332
1350
|
displayClassName: "text-sm font-medium",
|
|
1333
1351
|
inputClassName: "text-sm font-medium",
|
|
1334
1352
|
placeholder: "Dashboard Title",
|
|
1335
|
-
isPending:
|
|
1353
|
+
isPending: Z.isPending
|
|
1336
1354
|
}
|
|
1337
1355
|
),
|
|
1338
|
-
|
|
1339
|
-
/* @__PURE__ */ e(
|
|
1356
|
+
ha && se && /* @__PURE__ */ e(Ha, { children: /* @__PURE__ */ a(Va, { children: [
|
|
1357
|
+
/* @__PURE__ */ e(za, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1340
1358
|
C,
|
|
1341
1359
|
{
|
|
1342
1360
|
variant: "ghost",
|
|
1343
1361
|
size: "icon",
|
|
1344
|
-
onClick:
|
|
1345
|
-
disabled:
|
|
1362
|
+
onClick: fa,
|
|
1363
|
+
disabled: Zs || !(s != null && s.accessToken) || !(o != null && o.apiServiceUrl),
|
|
1346
1364
|
className: "h-7 w-7",
|
|
1347
1365
|
children: /* @__PURE__ */ e(
|
|
1348
|
-
|
|
1366
|
+
$a,
|
|
1349
1367
|
{
|
|
1350
|
-
className:
|
|
1368
|
+
className: J(
|
|
1351
1369
|
"h-4 w-4 transition-colors",
|
|
1352
|
-
|
|
1370
|
+
Ae ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground hover:text-yellow-400"
|
|
1353
1371
|
)
|
|
1354
1372
|
}
|
|
1355
1373
|
)
|
|
1356
1374
|
}
|
|
1357
1375
|
) }),
|
|
1358
|
-
/* @__PURE__ */ e(
|
|
1376
|
+
/* @__PURE__ */ e(Ba, { children: /* @__PURE__ */ e("p", { children: Ae ? "Remove as default dashboard" : "Make this a default dashboard" }) })
|
|
1359
1377
|
] }) })
|
|
1360
1378
|
] }))
|
|
1361
1379
|
] }),
|
|
1362
1380
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
1363
|
-
w && /* @__PURE__ */ a(
|
|
1364
|
-
/* @__PURE__ */ e(
|
|
1365
|
-
/* @__PURE__ */ e(
|
|
1381
|
+
w && /* @__PURE__ */ a(k, { children: [
|
|
1382
|
+
/* @__PURE__ */ e(ut, { className: "mr-2" }),
|
|
1383
|
+
/* @__PURE__ */ e(mt, { className: "h-7" })
|
|
1366
1384
|
] }),
|
|
1367
|
-
r && !w && /* @__PURE__ */ a(
|
|
1385
|
+
r && !w && /* @__PURE__ */ a(k, { children: [
|
|
1368
1386
|
/* @__PURE__ */ e(
|
|
1369
|
-
|
|
1387
|
+
q,
|
|
1370
1388
|
{
|
|
1371
1389
|
tooltip: "Copy Token",
|
|
1372
1390
|
onClick: () => {
|
|
1373
|
-
var
|
|
1374
|
-
s != null && s.accessToken && ((
|
|
1391
|
+
var n;
|
|
1392
|
+
s != null && s.accessToken && ((n = navigator == null ? void 0 : navigator.clipboard) != null && n.writeText ? navigator.clipboard.writeText(s.accessToken).then(() => L.success("Token copied to clipboard")).catch(() => L.error("Unable to copy token")) : L.error("Clipboard not available"));
|
|
1375
1393
|
},
|
|
1376
1394
|
className: "h-7 p-2",
|
|
1377
|
-
children: /* @__PURE__ */ e(
|
|
1395
|
+
children: /* @__PURE__ */ e(Ka, { className: "h-4 w-4" })
|
|
1378
1396
|
}
|
|
1379
1397
|
),
|
|
1380
1398
|
/* @__PURE__ */ e(
|
|
1381
|
-
|
|
1399
|
+
q,
|
|
1382
1400
|
{
|
|
1383
1401
|
tooltip: "Invalidate Token",
|
|
1384
|
-
onClick: () =>
|
|
1402
|
+
onClick: () => Qa(o.apiServiceUrl),
|
|
1385
1403
|
className: "h-7 p-2",
|
|
1386
|
-
children: /* @__PURE__ */ e(
|
|
1404
|
+
children: /* @__PURE__ */ e(Dt, { className: "h-4 w-4" })
|
|
1387
1405
|
}
|
|
1388
1406
|
)
|
|
1389
1407
|
] }),
|
|
1390
|
-
!w && i && /* @__PURE__ */ e(
|
|
1391
|
-
!w && i && /* @__PURE__ */ e(
|
|
1392
|
-
!w && i && /* @__PURE__ */ e(
|
|
1393
|
-
!w && i &&
|
|
1394
|
-
|
|
1408
|
+
!w && i && /* @__PURE__ */ e(Wa, {}),
|
|
1409
|
+
!w && i && /* @__PURE__ */ e(ht, {}),
|
|
1410
|
+
!w && i && /* @__PURE__ */ e(pt, {}),
|
|
1411
|
+
!w && i && sa && /* @__PURE__ */ e(
|
|
1412
|
+
q,
|
|
1395
1413
|
{
|
|
1396
1414
|
tooltip: "Manage Groups",
|
|
1397
|
-
onClick: () =>
|
|
1415
|
+
onClick: () => O(!0),
|
|
1398
1416
|
className: "h-7 p-2",
|
|
1399
1417
|
children: /* @__PURE__ */ e(z, { className: "h-4 w-4" })
|
|
1400
1418
|
}
|
|
1401
1419
|
),
|
|
1402
|
-
!w && i && ((
|
|
1403
|
-
|
|
1420
|
+
!w && i && ((hs = W == null ? void 0 : W.permissions) == null ? void 0 : hs.canShare) && /* @__PURE__ */ e(
|
|
1421
|
+
q,
|
|
1404
1422
|
{
|
|
1405
1423
|
tooltip: "Share Dashboard",
|
|
1406
1424
|
onClick: () => N(!0),
|
|
1407
1425
|
className: "h-7 p-2",
|
|
1408
|
-
children: /* @__PURE__ */ e(
|
|
1426
|
+
children: /* @__PURE__ */ e(Ja, { className: "h-4 w-4" })
|
|
1409
1427
|
}
|
|
1410
1428
|
),
|
|
1411
|
-
!
|
|
1429
|
+
!Ks && !w && d && l.canUseFilters && i && /* @__PURE__ */ e(
|
|
1412
1430
|
C,
|
|
1413
1431
|
{
|
|
1414
1432
|
className: "h-7 p-2",
|
|
1415
1433
|
variant: "outline",
|
|
1416
1434
|
onClick: () => {
|
|
1417
|
-
|
|
1435
|
+
Qs("dashboard", !1), Js(!0);
|
|
1418
1436
|
},
|
|
1419
1437
|
size: "sm",
|
|
1420
|
-
children: /* @__PURE__ */ e(
|
|
1438
|
+
children: /* @__PURE__ */ e(Xa, { className: "h-4 w-4" })
|
|
1421
1439
|
}
|
|
1422
1440
|
),
|
|
1423
|
-
d && !w &&
|
|
1424
|
-
!w &&
|
|
1425
|
-
d && !w &&
|
|
1441
|
+
d && !w && de && r && i && /* @__PURE__ */ e(Ot, {}),
|
|
1442
|
+
!w && de && r && i && /* @__PURE__ */ e(Tt, {}),
|
|
1443
|
+
d && !w && de && v && r && i && /* @__PURE__ */ a(
|
|
1426
1444
|
C,
|
|
1427
1445
|
{
|
|
1428
1446
|
className: "h-7 p-2",
|
|
1429
1447
|
variant: "secondary",
|
|
1430
1448
|
disabled: h,
|
|
1431
|
-
onClick:
|
|
1449
|
+
onClick: ma,
|
|
1432
1450
|
size: "sm",
|
|
1433
1451
|
children: [
|
|
1434
|
-
/* @__PURE__ */ e(
|
|
1452
|
+
/* @__PURE__ */ e(gs, { className: "mr-2 h-4 w-4" }),
|
|
1435
1453
|
"Save Lens"
|
|
1436
1454
|
]
|
|
1437
1455
|
}
|
|
@@ -1443,143 +1461,169 @@ function Wt() {
|
|
|
1443
1461
|
className: "h-7 p-2",
|
|
1444
1462
|
size: "sm",
|
|
1445
1463
|
disabled: !d,
|
|
1446
|
-
onClick: () =>
|
|
1464
|
+
onClick: () => aa(),
|
|
1447
1465
|
children: [
|
|
1448
|
-
/* @__PURE__ */ e(
|
|
1466
|
+
/* @__PURE__ */ e(Ke, { className: "mr-2 h-4 w-4" }),
|
|
1449
1467
|
"Visual"
|
|
1450
1468
|
]
|
|
1451
1469
|
}
|
|
1452
1470
|
),
|
|
1453
|
-
!w && !d &&
|
|
1471
|
+
!w && !d && ie && i && /* @__PURE__ */ a(
|
|
1454
1472
|
C,
|
|
1455
1473
|
{
|
|
1456
1474
|
variant: "outline",
|
|
1457
1475
|
className: "h-7 p-2",
|
|
1458
|
-
onClick:
|
|
1476
|
+
onClick: na,
|
|
1459
1477
|
size: "sm",
|
|
1460
1478
|
children: [
|
|
1461
|
-
/* @__PURE__ */ e(
|
|
1479
|
+
/* @__PURE__ */ e(Ya, { className: "mr-2 h-4 w-4" }),
|
|
1462
1480
|
"Edit"
|
|
1463
1481
|
]
|
|
1464
1482
|
}
|
|
1465
1483
|
),
|
|
1466
|
-
|
|
1484
|
+
ns && i && os && /* @__PURE__ */ a(
|
|
1467
1485
|
C,
|
|
1468
1486
|
{
|
|
1487
|
+
variant: "outline",
|
|
1469
1488
|
className: "h-7 p-2",
|
|
1470
|
-
|
|
1471
|
-
onClick: () => Ne(),
|
|
1489
|
+
onClick: da,
|
|
1472
1490
|
size: "sm",
|
|
1491
|
+
disabled: ee,
|
|
1473
1492
|
children: [
|
|
1474
|
-
|
|
1475
|
-
|
|
1493
|
+
/* @__PURE__ */ e(Za, { className: "mr-2 h-4 w-4" }),
|
|
1494
|
+
"Undo"
|
|
1476
1495
|
]
|
|
1477
1496
|
}
|
|
1478
1497
|
),
|
|
1498
|
+
ns && i && /* @__PURE__ */ a("div", { className: "relative inline-flex", children: [
|
|
1499
|
+
/* @__PURE__ */ a(
|
|
1500
|
+
C,
|
|
1501
|
+
{
|
|
1502
|
+
className: J("h-7 p-2", !Le && "opacity-60"),
|
|
1503
|
+
disabled: ee || !Le,
|
|
1504
|
+
onClick: () => Ee(),
|
|
1505
|
+
size: "sm",
|
|
1506
|
+
children: [
|
|
1507
|
+
ee ? /* @__PURE__ */ e(V, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(gs, { className: "mr-2 h-4 w-4" }),
|
|
1508
|
+
ee ? "Saving..." : "Save"
|
|
1509
|
+
]
|
|
1510
|
+
}
|
|
1511
|
+
),
|
|
1512
|
+
Le && !ee && /* @__PURE__ */ e(
|
|
1513
|
+
"span",
|
|
1514
|
+
{
|
|
1515
|
+
"aria-hidden": "true",
|
|
1516
|
+
className: "pointer-events-none absolute -right-1 -top-1 h-2.5 w-2.5 rounded-full bg-orange-500 ring-2 ring-background"
|
|
1517
|
+
}
|
|
1518
|
+
)
|
|
1519
|
+
] }),
|
|
1479
1520
|
!w && d && r && i && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
|
|
1480
1521
|
C,
|
|
1481
1522
|
{
|
|
1482
1523
|
className: "h-7 p-2",
|
|
1483
|
-
onClick: () =>
|
|
1524
|
+
onClick: () => as(!Ws),
|
|
1484
1525
|
size: "sm",
|
|
1485
1526
|
variant: "ghost",
|
|
1486
|
-
children: /* @__PURE__ */ e(
|
|
1527
|
+
children: /* @__PURE__ */ e(et, { className: "h-4 w-4" })
|
|
1487
1528
|
}
|
|
1488
1529
|
) }),
|
|
1489
|
-
!w && r && /* @__PURE__ */ e(
|
|
1530
|
+
!w && r && /* @__PURE__ */ e(kt, {}),
|
|
1490
1531
|
d && !w && i && /* @__PURE__ */ a(
|
|
1491
1532
|
C,
|
|
1492
1533
|
{
|
|
1493
1534
|
variant: "outline",
|
|
1494
1535
|
className: "h-7 p-2",
|
|
1495
|
-
onClick:
|
|
1536
|
+
onClick: ia,
|
|
1496
1537
|
children: [
|
|
1497
|
-
/* @__PURE__ */ e(
|
|
1538
|
+
/* @__PURE__ */ e(xs, { className: "mr-2 h-4 w-4" }),
|
|
1498
1539
|
"Close"
|
|
1499
1540
|
]
|
|
1500
1541
|
}
|
|
1501
1542
|
),
|
|
1502
|
-
!w && i && /* @__PURE__ */ a(
|
|
1503
|
-
/* @__PURE__ */ e(
|
|
1504
|
-
/* @__PURE__ */ a(
|
|
1505
|
-
/* @__PURE__ */ a(
|
|
1506
|
-
/* @__PURE__ */ e(
|
|
1543
|
+
!w && i && /* @__PURE__ */ a(He, { children: [
|
|
1544
|
+
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(q, { tooltip: "More Options", className: "h-7 p-2", children: /* @__PURE__ */ e(st, { className: "h-4 w-4" }) }) }),
|
|
1545
|
+
/* @__PURE__ */ a(ze, { align: "end", children: [
|
|
1546
|
+
/* @__PURE__ */ a(te, { onClick: () => M(!0), children: [
|
|
1547
|
+
/* @__PURE__ */ e(at, { className: "mr-2 h-4 w-4" }),
|
|
1507
1548
|
"Calendar Preferences"
|
|
1508
1549
|
] }),
|
|
1509
|
-
/* @__PURE__ */ a(
|
|
1510
|
-
/* @__PURE__ */ e(
|
|
1550
|
+
/* @__PURE__ */ a(te, { onClick: () => P(!0), children: [
|
|
1551
|
+
/* @__PURE__ */ e(tt, { className: "mr-2 h-4 w-4" }),
|
|
1511
1552
|
"Summary Settings"
|
|
1512
1553
|
] })
|
|
1513
1554
|
] })
|
|
1514
1555
|
] }),
|
|
1515
|
-
y &&
|
|
1516
|
-
|
|
1556
|
+
y && rs && /* @__PURE__ */ e(
|
|
1557
|
+
rt,
|
|
1517
1558
|
{
|
|
1518
|
-
resource:
|
|
1519
|
-
resourceType:
|
|
1559
|
+
resource: rs,
|
|
1560
|
+
resourceType: ke.DASHBOARD,
|
|
1520
1561
|
onClose: () => N(!1)
|
|
1521
1562
|
}
|
|
1522
1563
|
),
|
|
1523
1564
|
/* @__PURE__ */ e(
|
|
1524
|
-
|
|
1565
|
+
Yt,
|
|
1525
1566
|
{
|
|
1526
1567
|
open: A,
|
|
1527
|
-
onOpenChange:
|
|
1568
|
+
onOpenChange: O
|
|
1528
1569
|
}
|
|
1529
1570
|
),
|
|
1530
1571
|
/* @__PURE__ */ e(
|
|
1531
|
-
|
|
1572
|
+
bt,
|
|
1532
1573
|
{
|
|
1533
|
-
open:
|
|
1534
|
-
onOpenChange:
|
|
1574
|
+
open: U,
|
|
1575
|
+
onOpenChange: M
|
|
1535
1576
|
}
|
|
1536
1577
|
),
|
|
1537
1578
|
/* @__PURE__ */ e(
|
|
1538
|
-
|
|
1579
|
+
yt,
|
|
1539
1580
|
{
|
|
1540
1581
|
open: $,
|
|
1541
1582
|
onOpenChange: P,
|
|
1542
1583
|
dashboard: c,
|
|
1543
1584
|
disabled: !d,
|
|
1544
|
-
onApply: (
|
|
1585
|
+
onApply: (n) => De({
|
|
1545
1586
|
...c,
|
|
1546
|
-
summary:
|
|
1587
|
+
summary: n
|
|
1547
1588
|
})
|
|
1548
1589
|
}
|
|
1549
1590
|
),
|
|
1550
1591
|
/* @__PURE__ */ e(
|
|
1551
|
-
|
|
1592
|
+
Ms,
|
|
1552
1593
|
{
|
|
1553
|
-
open:
|
|
1554
|
-
onOpenChange: (
|
|
1555
|
-
!
|
|
1594
|
+
open: B,
|
|
1595
|
+
onOpenChange: (n) => {
|
|
1596
|
+
!n && Se && !R || (D(n), n || (K(null), Q(!1)));
|
|
1556
1597
|
},
|
|
1557
|
-
children: /* @__PURE__ */ a(
|
|
1558
|
-
/* @__PURE__ */ a(
|
|
1559
|
-
/* @__PURE__ */ e(
|
|
1560
|
-
/* @__PURE__ */ e(
|
|
1598
|
+
children: /* @__PURE__ */ a(Is, { className: "max-w-sm", children: [
|
|
1599
|
+
/* @__PURE__ */ a(Os, { children: [
|
|
1600
|
+
/* @__PURE__ */ e(Ts, { children: R ? "Save failed" : "Saving dashboard" }),
|
|
1601
|
+
/* @__PURE__ */ e(_s, { className: "pt-2", children: R ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." })
|
|
1561
1602
|
] }),
|
|
1562
|
-
/* @__PURE__ */ e(
|
|
1603
|
+
/* @__PURE__ */ e(Us, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: R ? /* @__PURE__ */ a(k, { children: [
|
|
1563
1604
|
/* @__PURE__ */ e(
|
|
1564
|
-
|
|
1605
|
+
Rs,
|
|
1565
1606
|
{
|
|
1566
1607
|
onClick: () => {
|
|
1567
|
-
D(!1),
|
|
1608
|
+
D(!1), K(null), Q(!1);
|
|
1568
1609
|
},
|
|
1569
1610
|
className: "m-0",
|
|
1570
1611
|
children: "Close"
|
|
1571
1612
|
}
|
|
1572
1613
|
),
|
|
1573
1614
|
/* @__PURE__ */ e(
|
|
1574
|
-
|
|
1615
|
+
Fe,
|
|
1575
1616
|
{
|
|
1576
|
-
onClick: () =>
|
|
1617
|
+
onClick: () => Ee({
|
|
1618
|
+
closeAfterSave: oe,
|
|
1619
|
+
navigateHomeAfterSave: Y === "home"
|
|
1620
|
+
}),
|
|
1577
1621
|
className: "m-0",
|
|
1578
1622
|
children: "Retry"
|
|
1579
1623
|
}
|
|
1580
1624
|
)
|
|
1581
1625
|
] }) : /* @__PURE__ */ a(
|
|
1582
|
-
|
|
1626
|
+
Fe,
|
|
1583
1627
|
{
|
|
1584
1628
|
disabled: !0,
|
|
1585
1629
|
className: "m-0 cursor-default",
|
|
@@ -1593,13 +1637,17 @@ function Wt() {
|
|
|
1593
1637
|
}
|
|
1594
1638
|
),
|
|
1595
1639
|
/* @__PURE__ */ e(
|
|
1596
|
-
|
|
1640
|
+
ft,
|
|
1597
1641
|
{
|
|
1598
|
-
open:
|
|
1599
|
-
onOpenChange:
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1642
|
+
open: ta,
|
|
1643
|
+
onOpenChange: (n) => {
|
|
1644
|
+
X(n);
|
|
1645
|
+
},
|
|
1646
|
+
onSave: la,
|
|
1647
|
+
onDiscard: ca,
|
|
1648
|
+
isSaving: Se,
|
|
1649
|
+
saveLabel: Y === "home" ? "Save & Return to Hub" : "Save & Close",
|
|
1650
|
+
discardLabel: Y === "home" ? "Discard & Return to Hub" : "Discard"
|
|
1603
1651
|
}
|
|
1604
1652
|
)
|
|
1605
1653
|
] })
|
|
@@ -1608,5 +1656,5 @@ function Wt() {
|
|
|
1608
1656
|
);
|
|
1609
1657
|
}
|
|
1610
1658
|
export {
|
|
1611
|
-
|
|
1659
|
+
dr as default
|
|
1612
1660
|
};
|