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