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