react-semaphor 0.1.262 → 0.1.264
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-Cq2fQ7bv.js → dashboard-controls-DVMSiuTb.js} +527 -545
- package/dist/chunks/dashboard-controls-JZ-mgUSY.js +42 -0
- package/dist/chunks/{dashboard-filter-controls-button-udrHABi3.js → dashboard-filter-controls-button-ClYx7NdN.js} +3 -3
- package/dist/chunks/{dashboard-filter-controls-button-Cedz-YZx.js → dashboard-filter-controls-button-CnijsTUC.js} +1 -1
- package/dist/chunks/{dashboard-json-BU6cvmRP.js → dashboard-json-BILMCUhG.js} +1 -1
- package/dist/chunks/{dashboard-json-RKwWONKm.js → dashboard-json-CKWfqC0m.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-Bl-XplTR.js → dashboard-summary-settings-dialog-5JMWm5zV.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-DDxHxKjp.js → dashboard-summary-settings-dialog-6SEdlbOP.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-B1r0Ho9B.js → edit-dashboard-visual-BjU_0_QA.js} +890 -884
- package/dist/chunks/{edit-dashboard-visual-BwDFI3hI.js → edit-dashboard-visual-DPqnhyq1.js} +5 -5
- package/dist/chunks/{index-DZ93VE76.js → index-BUNYVJ8g.js} +227 -227
- package/dist/chunks/{index-BtbNfaQD.js → index-D2dG8YFx.js} +20197 -20194
- package/dist/chunks/{resource-management-panel-Cz7MYBC7.js → resource-management-panel-BAytqOVf.js} +1 -1
- package/dist/chunks/{resource-management-panel-DxG6-naG.js → resource-management-panel-I5Q6TQbc.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-BcMrPzMc.js → use-create-flow-overlay-state-CPUI4zrE.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-D13D1vB_.js → use-create-flow-overlay-state-DakZJeCH.js} +1 -1
- package/dist/chunks/{use-visual-utils-DmxEKpor.js → use-visual-utils-B_9CT1PY.js} +1 -1
- package/dist/chunks/{use-visual-utils-DScc5-p_.js → use-visual-utils-Cd9d6nnp.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 +5 -5
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/dashboard-controls-AFlpiHtC.js +0 -42
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsxs as o, jsx as e, Fragment as I } from "react/jsx-runtime";
|
|
2
|
-
import { bL as de, dn as
|
|
2
|
+
import { bL as de, dn as qs, u as x, cy as ra, cz as na, B as M, cB as oa, cC as Q, dp as ia, N as qa, b as $, e as la, dq as Hs, cp as ca, f as da, g as ua, h as ma, i as Ha, L as Qe, I as ce, v as js, a6 as K, dr as we, cG as We, ds as zs, dt as Pa, du as ja, c as Y, dv as za, dw as Bs, cX as ha, dx as Ks, dy as Qs, dz as Ws, dA as Js, dB as Xs, dC as Ys, H as Ae, V as Me, x as k, dD as Le, dE as Ba, dF as Ka, d5 as Zs, dG as et, w as Z, cF as J, dH as at, dI as st, dJ as Je, dK as tt, dL as rt, dM as Qa, dN as Wa, dO as Ce, dP as Ee, d1 as Xe, cL as Ye, dQ as Ze, cc as Ja, dR as ea, c7 as Xa, dS as nt, cO as Ya, cP as Za, cQ as es, cR as as, cS as ss, cT as ts, cU as rs, cV as aa, dT as ns, cx as ot, dU as it, af as lt, U as Ua, ae as De, dV as ct, al as dt, ag as je, dW as ut, dX as mt, dY as ht, aA as pt, dZ as ft, d_ as gt, bS as vt, bT as bt, bU as yt, d$ as Nt, bV as St, cD as xt, as as Dt, e0 as wt, e1 as Ct, dm as Et, e2 as At, e3 as Mt, cA as Lt, a8 as kt, cI as It, e4 as Ot, ak as Tt, a9 as _t, ar as Pt, e5 as Ut } from "./index-D2dG8YFx.js";
|
|
3
3
|
import * as A from "react";
|
|
4
|
-
import
|
|
4
|
+
import os, { useState as N, useMemo as W, useCallback as Ra, useEffect as Rt } from "react";
|
|
5
5
|
import "react-dom";
|
|
6
|
-
import { b as
|
|
7
|
-
import { l as
|
|
8
|
-
import { C as
|
|
9
|
-
import { u as
|
|
10
|
-
import { s as
|
|
11
|
-
import { S as Ga } from "./use-create-flow-overlay-state-
|
|
6
|
+
import { b as Gt, u as Ft, d as $t, A as Vt, V as qt, N as Ht, c as jt, D as zt, U as Bt } from "./dashboard-filter-controls-button-ClYx7NdN.js";
|
|
7
|
+
import { l as Kt } from "./date-formatter-vkCj9Ct-.js";
|
|
8
|
+
import { C as Qt, D as Wt } from "./dashboard-summary-settings-dialog-6SEdlbOP.js";
|
|
9
|
+
import { u as Jt } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
10
|
+
import { s as ze } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
|
|
11
|
+
import { S as Ga } from "./use-create-flow-overlay-state-CPUI4zrE.js";
|
|
12
12
|
/**
|
|
13
13
|
* @license lucide-react v0.453.0 - ISC
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the ISC license.
|
|
16
16
|
* See the LICENSE file in the root directory of this source tree.
|
|
17
17
|
*/
|
|
18
|
-
const
|
|
18
|
+
const Xt = de("Glasses", [
|
|
19
19
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
20
20
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
21
21
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -28,7 +28,7 @@ const Wt = de("Glasses", [
|
|
|
28
28
|
* This source code is licensed under the ISC license.
|
|
29
29
|
* See the LICENSE file in the root directory of this source tree.
|
|
30
30
|
*/
|
|
31
|
-
const
|
|
31
|
+
const Yt = de("Menu", [
|
|
32
32
|
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
|
|
33
33
|
["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
|
|
34
34
|
["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
|
|
@@ -39,7 +39,7 @@ const Jt = de("Menu", [
|
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
41
|
*/
|
|
42
|
-
const
|
|
42
|
+
const Zt = de("Moon", [
|
|
43
43
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
44
44
|
]);
|
|
45
45
|
/**
|
|
@@ -48,7 +48,7 @@ const Xt = de("Moon", [
|
|
|
48
48
|
* This source code is licensed under the ISC license.
|
|
49
49
|
* See the LICENSE file in the root directory of this source tree.
|
|
50
50
|
*/
|
|
51
|
-
const
|
|
51
|
+
const er = de("ShieldX", [
|
|
52
52
|
[
|
|
53
53
|
"path",
|
|
54
54
|
{
|
|
@@ -65,7 +65,7 @@ const Yt = de("ShieldX", [
|
|
|
65
65
|
* This source code is licensed under the ISC license.
|
|
66
66
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
67
|
*/
|
|
68
|
-
const
|
|
68
|
+
const ar = de("Sun", [
|
|
69
69
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
70
70
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
71
71
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -76,7 +76,7 @@ const Zt = de("Sun", [
|
|
|
76
76
|
["path", { d: "m6.34 17.66-1.41 1.41", key: "1m8zz5" }],
|
|
77
77
|
["path", { d: "m19.07 4.93-1.41 1.41", key: "1shlcs" }]
|
|
78
78
|
]);
|
|
79
|
-
var
|
|
79
|
+
var sa = { exports: {} }, Be = {};
|
|
80
80
|
/**
|
|
81
81
|
* @license React
|
|
82
82
|
* use-sync-external-store-shim.production.js
|
|
@@ -86,30 +86,30 @@ var aa = { exports: {} }, ze = {};
|
|
|
86
86
|
* This source code is licensed under the MIT license found in the
|
|
87
87
|
* LICENSE file in the root directory of this source tree.
|
|
88
88
|
*/
|
|
89
|
-
var
|
|
90
|
-
function
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
var a =
|
|
89
|
+
var Fa;
|
|
90
|
+
function sr() {
|
|
91
|
+
if (Fa) return Be;
|
|
92
|
+
Fa = 1;
|
|
93
|
+
var a = os;
|
|
94
94
|
function n(r, d) {
|
|
95
95
|
return r === d && (r !== 0 || 1 / r === 1 / d) || r !== r && d !== d;
|
|
96
96
|
}
|
|
97
|
-
var s = typeof Object.is == "function" ? Object.is : n, t = a.useState,
|
|
98
|
-
function
|
|
97
|
+
var s = typeof Object.is == "function" ? Object.is : n, t = a.useState, l = a.useEffect, c = a.useLayoutEffect, m = a.useDebugValue;
|
|
98
|
+
function u(r, d) {
|
|
99
99
|
var f = d(), v = t({ inst: { value: f, getSnapshot: d } }), b = v[0].inst, S = v[1];
|
|
100
100
|
return c(
|
|
101
101
|
function() {
|
|
102
102
|
b.value = f, b.getSnapshot = d, p(b) && S({ inst: b });
|
|
103
103
|
},
|
|
104
104
|
[r, f, d]
|
|
105
|
-
),
|
|
105
|
+
), l(
|
|
106
106
|
function() {
|
|
107
107
|
return p(b) && S({ inst: b }), r(function() {
|
|
108
108
|
p(b) && S({ inst: b });
|
|
109
109
|
});
|
|
110
110
|
},
|
|
111
111
|
[r]
|
|
112
|
-
),
|
|
112
|
+
), m(f), f;
|
|
113
113
|
}
|
|
114
114
|
function p(r) {
|
|
115
115
|
var d = r.getSnapshot;
|
|
@@ -124,10 +124,10 @@ function er() {
|
|
|
124
124
|
function y(r, d) {
|
|
125
125
|
return d();
|
|
126
126
|
}
|
|
127
|
-
var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? y :
|
|
128
|
-
return
|
|
127
|
+
var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? y : u;
|
|
128
|
+
return Be.useSyncExternalStore = a.useSyncExternalStore !== void 0 ? a.useSyncExternalStore : h, Be;
|
|
129
129
|
}
|
|
130
|
-
var
|
|
130
|
+
var Ke = {};
|
|
131
131
|
/**
|
|
132
132
|
* @license React
|
|
133
133
|
* use-sync-external-store-shim.development.js
|
|
@@ -137,14 +137,14 @@ var Be = {};
|
|
|
137
137
|
* This source code is licensed under the MIT license found in the
|
|
138
138
|
* LICENSE file in the root directory of this source tree.
|
|
139
139
|
*/
|
|
140
|
-
var
|
|
141
|
-
function
|
|
142
|
-
return
|
|
140
|
+
var $a;
|
|
141
|
+
function tr() {
|
|
142
|
+
return $a || ($a = 1, process.env.NODE_ENV !== "production" && function() {
|
|
143
143
|
function a(f, v) {
|
|
144
144
|
return f === v && (f !== 0 || 1 / f === 1 / v) || f !== f && v !== v;
|
|
145
145
|
}
|
|
146
146
|
function n(f, v) {
|
|
147
|
-
h ||
|
|
147
|
+
h || l.startTransition === void 0 || (h = !0, console.error(
|
|
148
148
|
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
149
149
|
));
|
|
150
150
|
var b = v();
|
|
@@ -154,7 +154,7 @@ function ar() {
|
|
|
154
154
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
155
155
|
), r = !0);
|
|
156
156
|
}
|
|
157
|
-
S =
|
|
157
|
+
S = m({
|
|
158
158
|
inst: { value: b, getSnapshot: v }
|
|
159
159
|
});
|
|
160
160
|
var C = S[0].inst, P = S[1];
|
|
@@ -163,7 +163,7 @@ function ar() {
|
|
|
163
163
|
C.value = b, C.getSnapshot = v, s(C) && P({ inst: C });
|
|
164
164
|
},
|
|
165
165
|
[f, b, v]
|
|
166
|
-
),
|
|
166
|
+
), u(
|
|
167
167
|
function() {
|
|
168
168
|
return s(C) && P({ inst: C }), f(function() {
|
|
169
169
|
s(C) && P({ inst: C });
|
|
@@ -186,27 +186,27 @@ function ar() {
|
|
|
186
186
|
return v();
|
|
187
187
|
}
|
|
188
188
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
189
|
-
var
|
|
190
|
-
|
|
191
|
-
}()),
|
|
189
|
+
var l = os, c = typeof Object.is == "function" ? Object.is : a, m = l.useState, u = l.useEffect, p = l.useLayoutEffect, y = l.useDebugValue, h = !1, r = !1, d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t : n;
|
|
190
|
+
Ke.useSyncExternalStore = l.useSyncExternalStore !== void 0 ? l.useSyncExternalStore : d, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
191
|
+
}()), Ke;
|
|
192
192
|
}
|
|
193
|
-
process.env.NODE_ENV === "production" ?
|
|
194
|
-
var
|
|
195
|
-
function
|
|
196
|
-
const { setTheme: a } =
|
|
193
|
+
process.env.NODE_ENV === "production" ? sa.exports = sr() : sa.exports = tr();
|
|
194
|
+
var rr = sa.exports;
|
|
195
|
+
function nr() {
|
|
196
|
+
const { setTheme: a } = qs(), n = x(
|
|
197
197
|
(s) => s.actions.setDashboardTheme
|
|
198
198
|
);
|
|
199
|
-
return /* @__PURE__ */ o(
|
|
200
|
-
/* @__PURE__ */ e(
|
|
199
|
+
return /* @__PURE__ */ o(ra, { children: [
|
|
200
|
+
/* @__PURE__ */ e(na, { asChild: !0, children: /* @__PURE__ */ o(M, { className: "h-7 p-2", variant: "ghost", size: "sm", children: [
|
|
201
201
|
/* @__PURE__ */ e(
|
|
202
|
-
|
|
202
|
+
ar,
|
|
203
203
|
{
|
|
204
204
|
strokeWidth: 1.5,
|
|
205
205
|
className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
|
|
206
206
|
}
|
|
207
207
|
),
|
|
208
208
|
/* @__PURE__ */ e(
|
|
209
|
-
|
|
209
|
+
Zt,
|
|
210
210
|
{
|
|
211
211
|
strokeWidth: 1.5,
|
|
212
212
|
className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
|
|
@@ -214,7 +214,7 @@ function tr() {
|
|
|
214
214
|
),
|
|
215
215
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle theme" })
|
|
216
216
|
] }) }),
|
|
217
|
-
/* @__PURE__ */ o(
|
|
217
|
+
/* @__PURE__ */ o(oa, { align: "end", children: [
|
|
218
218
|
/* @__PURE__ */ e(
|
|
219
219
|
Q,
|
|
220
220
|
{
|
|
@@ -245,72 +245,72 @@ function tr() {
|
|
|
245
245
|
] })
|
|
246
246
|
] });
|
|
247
247
|
}
|
|
248
|
-
async function
|
|
249
|
-
if (!
|
|
248
|
+
async function or(a, n, s, t, l) {
|
|
249
|
+
if (!l)
|
|
250
250
|
return null;
|
|
251
|
-
const c = JSON.stringify(s),
|
|
252
|
-
return await
|
|
251
|
+
const c = JSON.stringify(s), m = `${a}/v1/lens`;
|
|
252
|
+
return await ia(m, l, {
|
|
253
253
|
name: n,
|
|
254
254
|
template: c,
|
|
255
255
|
filterValues: t,
|
|
256
256
|
operation: "create"
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
|
-
async function
|
|
259
|
+
async function ta(a, n, s) {
|
|
260
260
|
if (!s)
|
|
261
261
|
return null;
|
|
262
|
-
const { id: t, template:
|
|
263
|
-
return await
|
|
262
|
+
const { id: t, template: l, filterValues: c, isDefault: m, shared: u } = n, p = `${a}/v1/lens`;
|
|
263
|
+
return await ia(p, s, {
|
|
264
264
|
lensId: t,
|
|
265
|
-
template:
|
|
265
|
+
template: l,
|
|
266
266
|
filterValues: c,
|
|
267
|
-
isDefault:
|
|
268
|
-
shared:
|
|
267
|
+
isDefault: m,
|
|
268
|
+
shared: u,
|
|
269
269
|
operation: "update"
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
|
-
async function
|
|
272
|
+
async function ir(a, n, s) {
|
|
273
273
|
if (!s)
|
|
274
274
|
return null;
|
|
275
275
|
const t = `${a}/v1/lens`;
|
|
276
|
-
return await
|
|
276
|
+
return await ia(t, s, {
|
|
277
277
|
operation: "delete",
|
|
278
278
|
lensId: n
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
const [a, n] = N(""), [s, t] = N(!1),
|
|
281
|
+
function lr() {
|
|
282
|
+
const [a, n] = N(""), [s, t] = N(!1), l = x((S) => S.lenses), { setLenses: c, setSelectedLensId: m } = qa(), [u, p] = N(!1), [y, h] = N(!1), r = x((S) => S.dashboard), d = x((S) => S.filterValues), { authToken: f, tokenProps: v } = $();
|
|
283
283
|
async function b() {
|
|
284
284
|
p(!0);
|
|
285
|
-
const S = await
|
|
285
|
+
const S = await or(
|
|
286
286
|
v.apiServiceUrl,
|
|
287
287
|
a,
|
|
288
288
|
r,
|
|
289
289
|
d,
|
|
290
290
|
f == null ? void 0 : f.accessToken
|
|
291
291
|
);
|
|
292
|
-
S && (c([...
|
|
292
|
+
S && (c([...l || [], S]), m(S.id), h(!1)), p(!1);
|
|
293
293
|
}
|
|
294
|
-
return /* @__PURE__ */ o(
|
|
295
|
-
/* @__PURE__ */ e(
|
|
294
|
+
return /* @__PURE__ */ o(la, { open: y, onOpenChange: h, children: [
|
|
295
|
+
/* @__PURE__ */ e(Hs, { asChild: !0, children: /* @__PURE__ */ o(
|
|
296
296
|
M,
|
|
297
297
|
{
|
|
298
298
|
variant: "secondary",
|
|
299
299
|
className: "h-7 p-2",
|
|
300
300
|
size: "sm",
|
|
301
301
|
children: [
|
|
302
|
-
/* @__PURE__ */ e(
|
|
302
|
+
/* @__PURE__ */ e(ca, { className: "mr-2 h-4 w-4" }),
|
|
303
303
|
"Lens"
|
|
304
304
|
]
|
|
305
305
|
}
|
|
306
306
|
) }),
|
|
307
|
-
/* @__PURE__ */ o(
|
|
308
|
-
/* @__PURE__ */ o(
|
|
309
|
-
/* @__PURE__ */ e(
|
|
310
|
-
/* @__PURE__ */ e(
|
|
307
|
+
/* @__PURE__ */ o(da, { className: "sm:max-w-[425px]", children: [
|
|
308
|
+
/* @__PURE__ */ o(ua, { children: [
|
|
309
|
+
/* @__PURE__ */ e(ma, { children: "Create Lens" }),
|
|
310
|
+
/* @__PURE__ */ e(Ha, { children: "Lenses are private by default and are only visible to you." })
|
|
311
311
|
] }),
|
|
312
312
|
/* @__PURE__ */ e("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ o("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
313
|
-
/* @__PURE__ */ e(
|
|
313
|
+
/* @__PURE__ */ e(Qe, { className: "text-right", children: "Name" }),
|
|
314
314
|
/* @__PURE__ */ e(
|
|
315
315
|
ce,
|
|
316
316
|
{
|
|
@@ -324,29 +324,29 @@ function or() {
|
|
|
324
324
|
)
|
|
325
325
|
] }) }),
|
|
326
326
|
s && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
327
|
-
/* @__PURE__ */ e(
|
|
327
|
+
/* @__PURE__ */ e(js, { children: /* @__PURE__ */ e(
|
|
328
328
|
M,
|
|
329
329
|
{
|
|
330
330
|
size: "sm",
|
|
331
331
|
variant: "outline",
|
|
332
332
|
type: "submit",
|
|
333
333
|
onClick: b,
|
|
334
|
-
disabled:
|
|
335
|
-
children:
|
|
334
|
+
disabled: u,
|
|
335
|
+
children: u ? "Creating..." : "Add"
|
|
336
336
|
}
|
|
337
337
|
) })
|
|
338
338
|
] })
|
|
339
339
|
] });
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
const [a, n] = N(!1), s = x((r) => r.lenses), t = x((r) => r.selectedLensId), { setLenses:
|
|
341
|
+
function cr() {
|
|
342
|
+
const [a, n] = N(!1), s = x((r) => r.lenses), t = x((r) => r.selectedLensId), { setLenses: l, setSelectedLensId: c } = qa(), { authToken: m, tokenProps: u } = $();
|
|
343
343
|
async function p(r) {
|
|
344
344
|
c(r);
|
|
345
345
|
}
|
|
346
346
|
async function y(r) {
|
|
347
|
-
if (await
|
|
347
|
+
if (await ir(u.apiServiceUrl, r, m == null ? void 0 : m.accessToken)) {
|
|
348
348
|
const f = s == null ? void 0 : s.filter((v) => v.id !== r);
|
|
349
|
-
|
|
349
|
+
l(f || []), c("original");
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
async function h(r) {
|
|
@@ -357,35 +357,35 @@ function ir() {
|
|
|
357
357
|
...b,
|
|
358
358
|
isDefault: !1
|
|
359
359
|
});
|
|
360
|
-
|
|
360
|
+
l(d || []);
|
|
361
361
|
const f = {
|
|
362
362
|
...r,
|
|
363
363
|
isDefault: !r.isDefault
|
|
364
364
|
};
|
|
365
|
-
await
|
|
365
|
+
await ta(u.apiServiceUrl, f, m == null ? void 0 : m.accessToken);
|
|
366
366
|
const v = s == null ? void 0 : s.find((b) => b.isDefault);
|
|
367
367
|
if (v && v.id !== r.id) {
|
|
368
368
|
const b = {
|
|
369
369
|
...v,
|
|
370
370
|
isDefault: !1
|
|
371
371
|
};
|
|
372
|
-
await
|
|
372
|
+
await ta(u.apiServiceUrl, b, m == null ? void 0 : m.accessToken);
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
|
-
return /* @__PURE__ */ o(
|
|
376
|
-
/* @__PURE__ */ e(
|
|
377
|
-
/* @__PURE__ */ o(
|
|
378
|
-
/* @__PURE__ */ e(
|
|
379
|
-
/* @__PURE__ */ e(
|
|
375
|
+
return /* @__PURE__ */ o(ra, { open: a, onOpenChange: n, children: [
|
|
376
|
+
/* @__PURE__ */ e(na, { asChild: !0, children: /* @__PURE__ */ e(K, { tooltip: "Lenses", className: "h-7 p-2", children: /* @__PURE__ */ e(Xt, { className: "h-4 w-4" }) }) }),
|
|
377
|
+
/* @__PURE__ */ o(oa, { align: "end", className: "w-60", children: [
|
|
378
|
+
/* @__PURE__ */ e(we, { className: "px-3", children: "Lenses" }),
|
|
379
|
+
/* @__PURE__ */ e(We, {}),
|
|
380
380
|
/* @__PURE__ */ o(
|
|
381
|
-
|
|
381
|
+
zs,
|
|
382
382
|
{
|
|
383
383
|
value: t,
|
|
384
384
|
onValueChange: p,
|
|
385
385
|
children: [
|
|
386
|
-
/* @__PURE__ */ e(
|
|
386
|
+
/* @__PURE__ */ e(Pa, { value: "original", children: "Original" }),
|
|
387
387
|
s == null ? void 0 : s.map((r) => /* @__PURE__ */ o(
|
|
388
|
-
|
|
388
|
+
Pa,
|
|
389
389
|
{
|
|
390
390
|
className: "group flex justify-between gap-2",
|
|
391
391
|
value: r.id,
|
|
@@ -393,7 +393,7 @@ function ir() {
|
|
|
393
393
|
/* @__PURE__ */ e("p", { children: r.name }),
|
|
394
394
|
/* @__PURE__ */ o("span", { className: "flex items-center gap-3", children: [
|
|
395
395
|
/* @__PURE__ */ e(
|
|
396
|
-
|
|
396
|
+
ja,
|
|
397
397
|
{
|
|
398
398
|
onClick: (d) => {
|
|
399
399
|
d.preventDefault(), h(r);
|
|
@@ -409,7 +409,7 @@ function ir() {
|
|
|
409
409
|
}
|
|
410
410
|
),
|
|
411
411
|
/* @__PURE__ */ e(
|
|
412
|
-
|
|
412
|
+
za,
|
|
413
413
|
{
|
|
414
414
|
onClick: (d) => {
|
|
415
415
|
d.preventDefault(), y(r.id);
|
|
@@ -429,19 +429,19 @@ function ir() {
|
|
|
429
429
|
] })
|
|
430
430
|
] });
|
|
431
431
|
}
|
|
432
|
-
function
|
|
433
|
-
const { displayPreferences: a, shouldShowElement: n } =
|
|
434
|
-
() =>
|
|
432
|
+
function dr() {
|
|
433
|
+
const { displayPreferences: a, shouldShowElement: n } = Bs(), { currentUser: s, userContext: t } = ha(), l = W(
|
|
434
|
+
() => Ks(s),
|
|
435
435
|
[s]
|
|
436
|
-
), c = W(() => (
|
|
436
|
+
), c = W(() => (u) => l && l[u] !== void 0 && l[u] === !1 ? !1 : n(u), [l, n, a]), m = W(
|
|
437
437
|
() => {
|
|
438
|
-
var
|
|
438
|
+
var u, p, y, h, r;
|
|
439
439
|
return {
|
|
440
|
-
canEdit: ((
|
|
441
|
-
canUseFilters: ((p = t == null ? void 0 : t.permissions) == null ? void 0 : p.canEdit) ??
|
|
442
|
-
canManageDashboards: ((y = t == null ? void 0 : t.permissions) == null ? void 0 : y.canCreateDashboard) ??
|
|
443
|
-
canCreateDashboards: ((h = t == null ? void 0 : t.permissions) == null ? void 0 : h.canCreateDashboard) ??
|
|
444
|
-
canAccessVisuals: ((r = t == null ? void 0 : t.permissions) == null ? void 0 : r.canEdit) ??
|
|
440
|
+
canEdit: ((u = t == null ? void 0 : t.permissions) == null ? void 0 : u.canEdit) ?? Ys(s),
|
|
441
|
+
canUseFilters: ((p = t == null ? void 0 : t.permissions) == null ? void 0 : p.canEdit) ?? Xs(s),
|
|
442
|
+
canManageDashboards: ((y = t == null ? void 0 : t.permissions) == null ? void 0 : y.canCreateDashboard) ?? Js(s),
|
|
443
|
+
canCreateDashboards: ((h = t == null ? void 0 : t.permissions) == null ? void 0 : h.canCreateDashboard) ?? Ws(s),
|
|
444
|
+
canAccessVisuals: ((r = t == null ? void 0 : t.permissions) == null ? void 0 : r.canEdit) ?? Qs(s)
|
|
445
445
|
};
|
|
446
446
|
},
|
|
447
447
|
[s, t]
|
|
@@ -449,113 +449,95 @@ function lr() {
|
|
|
449
449
|
return {
|
|
450
450
|
displayPreferences: a,
|
|
451
451
|
shouldShowElement: c,
|
|
452
|
-
permissions:
|
|
452
|
+
permissions: m,
|
|
453
453
|
currentUser: s
|
|
454
454
|
};
|
|
455
455
|
}
|
|
456
|
-
const
|
|
456
|
+
const ur = async (a, n, s) => {
|
|
457
457
|
const t = `${a}/management/v1/groups`;
|
|
458
|
-
return await
|
|
459
|
-
},
|
|
460
|
-
const t = `${a}/management/v1/groups/${s}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
throw new Error(c || "Failed to delete group");
|
|
469
|
-
}
|
|
470
|
-
}, ur = async (a, n, s, t) => {
|
|
471
|
-
const i = `${a}/management/v1/groups/${s}/members`;
|
|
472
|
-
return await za(i, n, t);
|
|
473
|
-
}, mr = async (a, n, s, t) => {
|
|
474
|
-
const i = `${a}/management/v1/groups/${s}/members`, c = await fetch(i, {
|
|
475
|
-
method: "DELETE",
|
|
476
|
-
headers: {
|
|
477
|
-
"Content-Type": "application/json",
|
|
478
|
-
Authorization: `Bearer ${n}`
|
|
479
|
-
},
|
|
480
|
-
body: JSON.stringify(t)
|
|
481
|
-
});
|
|
482
|
-
if (!c.ok) {
|
|
483
|
-
const u = await c.text();
|
|
484
|
-
throw new Error(u || "Failed to remove group members");
|
|
485
|
-
}
|
|
458
|
+
return await Ka(t, n, s);
|
|
459
|
+
}, mr = async (a, n, s) => {
|
|
460
|
+
const t = `${a}/management/v1/groups/${s}`;
|
|
461
|
+
await Ba(t, n, "DELETE");
|
|
462
|
+
}, hr = async (a, n, s, t) => {
|
|
463
|
+
const l = `${a}/management/v1/groups/${s}/members`;
|
|
464
|
+
return await Ka(l, n, t);
|
|
465
|
+
}, pr = async (a, n, s, t) => {
|
|
466
|
+
const l = `${a}/management/v1/groups/${s}/members`;
|
|
467
|
+
await Ba(l, n, "DELETE", t);
|
|
486
468
|
};
|
|
487
|
-
function
|
|
469
|
+
function fr() {
|
|
488
470
|
const { authToken: a, tokenProps: n } = $(), s = Ae();
|
|
489
471
|
return Me({
|
|
490
|
-
mutationFn: (t) =>
|
|
472
|
+
mutationFn: (t) => ur(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", t),
|
|
491
473
|
onSuccess: () => {
|
|
492
474
|
s.invalidateQueries({ queryKey: ["groups"] }), k.success("Group created successfully");
|
|
493
475
|
},
|
|
494
476
|
onError: (t) => {
|
|
495
477
|
console.error("Failed to create group:", t), k.error("Failed to create group", {
|
|
496
|
-
description: t
|
|
478
|
+
description: Le(t, "Failed to create group")
|
|
497
479
|
});
|
|
498
480
|
}
|
|
499
481
|
});
|
|
500
482
|
}
|
|
501
|
-
function
|
|
483
|
+
function gr() {
|
|
502
484
|
const { authToken: a, tokenProps: n } = $(), s = Ae();
|
|
503
485
|
return Me({
|
|
504
|
-
mutationFn: (t) =>
|
|
505
|
-
onSuccess: (t,
|
|
506
|
-
s.invalidateQueries({ queryKey: ["groups"] }), s.removeQueries({ queryKey: ["group",
|
|
486
|
+
mutationFn: (t) => mr(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", t),
|
|
487
|
+
onSuccess: (t, l) => {
|
|
488
|
+
s.invalidateQueries({ queryKey: ["groups"] }), s.removeQueries({ queryKey: ["group", l] }), k.success("Group deleted successfully");
|
|
507
489
|
},
|
|
508
490
|
onError: (t) => {
|
|
509
491
|
console.error("Failed to delete group:", t), k.error("Failed to delete group", {
|
|
510
|
-
description: t
|
|
492
|
+
description: Le(t, "Failed to delete group")
|
|
511
493
|
});
|
|
512
494
|
}
|
|
513
495
|
});
|
|
514
496
|
}
|
|
515
|
-
function
|
|
497
|
+
function vr() {
|
|
516
498
|
const { authToken: a, tokenProps: n } = $(), s = Ae();
|
|
517
499
|
return Me({
|
|
518
500
|
mutationFn: ({
|
|
519
501
|
groupId: t,
|
|
520
|
-
data:
|
|
521
|
-
}) =>
|
|
522
|
-
onSuccess: (t,
|
|
523
|
-
s.invalidateQueries({ queryKey: ["group",
|
|
524
|
-
queryKey: ["group-members",
|
|
502
|
+
data: l
|
|
503
|
+
}) => hr(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", t, l),
|
|
504
|
+
onSuccess: (t, l) => {
|
|
505
|
+
s.invalidateQueries({ queryKey: ["group", l.groupId] }), s.invalidateQueries({
|
|
506
|
+
queryKey: ["group-members", l.groupId]
|
|
525
507
|
}), s.invalidateQueries({ queryKey: ["groups"] }), k.success("Members added successfully");
|
|
526
508
|
},
|
|
527
509
|
onError: (t) => {
|
|
528
510
|
console.error("Failed to add group members:", t), k.error("Failed to add members", {
|
|
529
|
-
description: t
|
|
511
|
+
description: Le(t, "Failed to add members")
|
|
530
512
|
});
|
|
531
513
|
}
|
|
532
514
|
});
|
|
533
515
|
}
|
|
534
|
-
function
|
|
516
|
+
function br() {
|
|
535
517
|
const { authToken: a, tokenProps: n } = $(), s = Ae();
|
|
536
518
|
return Me({
|
|
537
519
|
mutationFn: ({
|
|
538
520
|
groupId: t,
|
|
539
|
-
data:
|
|
540
|
-
}) =>
|
|
541
|
-
onSuccess: (t,
|
|
542
|
-
s.invalidateQueries({ queryKey: ["group",
|
|
543
|
-
queryKey: ["group-members",
|
|
521
|
+
data: l
|
|
522
|
+
}) => pr(n.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", t, l),
|
|
523
|
+
onSuccess: (t, l) => {
|
|
524
|
+
s.invalidateQueries({ queryKey: ["group", l.groupId] }), s.invalidateQueries({
|
|
525
|
+
queryKey: ["group-members", l.groupId]
|
|
544
526
|
}), s.invalidateQueries({ queryKey: ["groups"] }), k.success("Members removed successfully");
|
|
545
527
|
},
|
|
546
528
|
onError: (t) => {
|
|
547
529
|
console.error("Failed to remove group members:", t), k.error("Failed to remove members", {
|
|
548
|
-
description: t
|
|
530
|
+
description: Le(t, "Failed to remove members")
|
|
549
531
|
});
|
|
550
532
|
}
|
|
551
533
|
});
|
|
552
534
|
}
|
|
553
|
-
function
|
|
535
|
+
function yr({
|
|
554
536
|
onSuccess: a,
|
|
555
537
|
tenantId: n,
|
|
556
538
|
isTenantUser: s
|
|
557
539
|
}) {
|
|
558
|
-
const [t,
|
|
540
|
+
const [t, l] = N(""), [c, m] = N(""), [u, p] = N({}), y = fr(), h = () => {
|
|
559
541
|
const d = {};
|
|
560
542
|
return t.trim() ? t.length < 3 ? d.name = "Group name must be at least 3 characters" : t.length > 50 && (d.name = "Group name must be less than 50 characters") : d.name = "Group name is required", c && c.length > 200 && (d.description = "Description must be less than 200 characters"), p(d), Object.keys(d).length === 0;
|
|
561
543
|
};
|
|
@@ -568,14 +550,14 @@ function vr({
|
|
|
568
550
|
...s && n ? { tenantId: n } : {}
|
|
569
551
|
};
|
|
570
552
|
try {
|
|
571
|
-
await y.mutateAsync(f),
|
|
553
|
+
await y.mutateAsync(f), l(""), m(""), p({}), a();
|
|
572
554
|
} catch (v) {
|
|
573
555
|
console.error("Failed to create group:", v);
|
|
574
556
|
}
|
|
575
557
|
}, className: "space-y-6", children: [
|
|
576
558
|
/* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
577
559
|
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
578
|
-
/* @__PURE__ */ o(
|
|
560
|
+
/* @__PURE__ */ o(Qe, { htmlFor: "group-name", children: [
|
|
579
561
|
"Group Name ",
|
|
580
562
|
/* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
|
|
581
563
|
] }),
|
|
@@ -586,41 +568,41 @@ function vr({
|
|
|
586
568
|
placeholder: "e.g., Marketing Team, Engineering Squad",
|
|
587
569
|
value: t,
|
|
588
570
|
onChange: (d) => {
|
|
589
|
-
|
|
571
|
+
l(d.target.value), u.name && p((f) => ({ ...f, name: "" }));
|
|
590
572
|
},
|
|
591
|
-
className:
|
|
573
|
+
className: u.name ? "border-destructive" : "",
|
|
592
574
|
disabled: y.isPending
|
|
593
575
|
}
|
|
594
576
|
),
|
|
595
|
-
|
|
577
|
+
u.name && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.name })
|
|
596
578
|
] }),
|
|
597
579
|
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
598
|
-
/* @__PURE__ */ o(
|
|
580
|
+
/* @__PURE__ */ o(Qe, { htmlFor: "group-description", children: [
|
|
599
581
|
"Description",
|
|
600
582
|
/* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: "(optional)" })
|
|
601
583
|
] }),
|
|
602
584
|
/* @__PURE__ */ e(
|
|
603
|
-
|
|
585
|
+
Zs,
|
|
604
586
|
{
|
|
605
587
|
id: "group-description",
|
|
606
588
|
placeholder: "Describe the purpose of this group...",
|
|
607
589
|
value: c,
|
|
608
590
|
onChange: (d) => {
|
|
609
|
-
|
|
591
|
+
m(d.target.value), u.description && p((f) => ({ ...f, description: "" }));
|
|
610
592
|
},
|
|
611
|
-
className:
|
|
593
|
+
className: u.description ? "border-destructive" : "",
|
|
612
594
|
disabled: y.isPending,
|
|
613
595
|
rows: 3
|
|
614
596
|
}
|
|
615
597
|
),
|
|
616
|
-
|
|
598
|
+
u.description && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: u.description }),
|
|
617
599
|
/* @__PURE__ */ o("p", { className: "text-xs text-muted-foreground", children: [
|
|
618
600
|
c.length,
|
|
619
601
|
"/200 characters"
|
|
620
602
|
] })
|
|
621
603
|
] }),
|
|
622
604
|
/* @__PURE__ */ e("div", { className: "rounded-lg border bg-muted/50 p-4", children: /* @__PURE__ */ o("div", { className: "flex gap-3", children: [
|
|
623
|
-
/* @__PURE__ */ e(
|
|
605
|
+
/* @__PURE__ */ e(et, { className: "h-4 w-4 mt-0.5 text-muted-foreground" }),
|
|
624
606
|
/* @__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." })
|
|
625
607
|
] }) })
|
|
626
608
|
] }),
|
|
@@ -631,7 +613,7 @@ function vr({
|
|
|
631
613
|
type: "button",
|
|
632
614
|
variant: "outline",
|
|
633
615
|
onClick: () => {
|
|
634
|
-
|
|
616
|
+
l(""), m(""), p({});
|
|
635
617
|
},
|
|
636
618
|
disabled: y.isPending,
|
|
637
619
|
children: "Clear"
|
|
@@ -654,59 +636,59 @@ function vr({
|
|
|
654
636
|
] })
|
|
655
637
|
] });
|
|
656
638
|
}
|
|
657
|
-
function
|
|
639
|
+
function Nr(a, n = []) {
|
|
658
640
|
let s = [];
|
|
659
|
-
function t(c,
|
|
660
|
-
const
|
|
661
|
-
|
|
641
|
+
function t(c, m) {
|
|
642
|
+
const u = A.createContext(m);
|
|
643
|
+
u.displayName = c + "Context";
|
|
662
644
|
const p = s.length;
|
|
663
|
-
s = [...s,
|
|
645
|
+
s = [...s, m];
|
|
664
646
|
const y = (r) => {
|
|
665
647
|
var C;
|
|
666
|
-
const { scope: d, children: f, ...v } = r, b = ((C = d == null ? void 0 : d[a]) == null ? void 0 : C[p]) ||
|
|
648
|
+
const { scope: d, children: f, ...v } = r, b = ((C = d == null ? void 0 : d[a]) == null ? void 0 : C[p]) || u, S = A.useMemo(() => v, Object.values(v));
|
|
667
649
|
return /* @__PURE__ */ e(b.Provider, { value: S, children: f });
|
|
668
650
|
};
|
|
669
651
|
y.displayName = c + "Provider";
|
|
670
652
|
function h(r, d) {
|
|
671
653
|
var b;
|
|
672
|
-
const f = ((b = d == null ? void 0 : d[a]) == null ? void 0 : b[p]) ||
|
|
654
|
+
const f = ((b = d == null ? void 0 : d[a]) == null ? void 0 : b[p]) || u, v = A.useContext(f);
|
|
673
655
|
if (v) return v;
|
|
674
|
-
if (
|
|
656
|
+
if (m !== void 0) return m;
|
|
675
657
|
throw new Error(`\`${r}\` must be used within \`${c}\``);
|
|
676
658
|
}
|
|
677
659
|
return [y, h];
|
|
678
660
|
}
|
|
679
|
-
const
|
|
680
|
-
const c = s.map((
|
|
681
|
-
return function(
|
|
682
|
-
const p = (
|
|
661
|
+
const l = () => {
|
|
662
|
+
const c = s.map((m) => A.createContext(m));
|
|
663
|
+
return function(u) {
|
|
664
|
+
const p = (u == null ? void 0 : u[a]) || c;
|
|
683
665
|
return A.useMemo(
|
|
684
|
-
() => ({ [`__scope${a}`]: { ...
|
|
685
|
-
[
|
|
666
|
+
() => ({ [`__scope${a}`]: { ...u, [a]: p } }),
|
|
667
|
+
[u, p]
|
|
686
668
|
);
|
|
687
669
|
};
|
|
688
670
|
};
|
|
689
|
-
return
|
|
671
|
+
return l.scopeName = a, [t, Sr(l, ...n)];
|
|
690
672
|
}
|
|
691
|
-
function
|
|
673
|
+
function Sr(...a) {
|
|
692
674
|
const n = a[0];
|
|
693
675
|
if (a.length === 1) return n;
|
|
694
676
|
const s = () => {
|
|
695
|
-
const t = a.map((
|
|
696
|
-
useScope:
|
|
697
|
-
scopeName:
|
|
677
|
+
const t = a.map((l) => ({
|
|
678
|
+
useScope: l(),
|
|
679
|
+
scopeName: l.scopeName
|
|
698
680
|
}));
|
|
699
681
|
return function(c) {
|
|
700
|
-
const
|
|
682
|
+
const m = t.reduce((u, { useScope: p, scopeName: y }) => {
|
|
701
683
|
const r = p(c)[`__scope${y}`];
|
|
702
|
-
return { ...
|
|
684
|
+
return { ...u, ...r };
|
|
703
685
|
}, {});
|
|
704
|
-
return A.useMemo(() => ({ [`__scope${n.scopeName}`]:
|
|
686
|
+
return A.useMemo(() => ({ [`__scope${n.scopeName}`]: m }), [m]);
|
|
705
687
|
};
|
|
706
688
|
};
|
|
707
689
|
return s.scopeName = n.scopeName, s;
|
|
708
690
|
}
|
|
709
|
-
var
|
|
691
|
+
var xr = [
|
|
710
692
|
"a",
|
|
711
693
|
"button",
|
|
712
694
|
"div",
|
|
@@ -724,86 +706,86 @@ var Nr = [
|
|
|
724
706
|
"span",
|
|
725
707
|
"svg",
|
|
726
708
|
"ul"
|
|
727
|
-
],
|
|
728
|
-
const s =
|
|
729
|
-
const { asChild:
|
|
730
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(p, { ...
|
|
709
|
+
], pa = xr.reduce((a, n) => {
|
|
710
|
+
const s = at(`Primitive.${n}`), t = A.forwardRef((l, c) => {
|
|
711
|
+
const { asChild: m, ...u } = l, p = m ? s : n;
|
|
712
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(p, { ...u, ref: c });
|
|
731
713
|
});
|
|
732
714
|
return t.displayName = `Primitive.${n}`, { ...a, [n]: t };
|
|
733
715
|
}, {});
|
|
734
|
-
function
|
|
735
|
-
return
|
|
736
|
-
|
|
716
|
+
function Dr() {
|
|
717
|
+
return rr.useSyncExternalStore(
|
|
718
|
+
wr,
|
|
737
719
|
() => !0,
|
|
738
720
|
() => !1
|
|
739
721
|
);
|
|
740
722
|
}
|
|
741
|
-
function
|
|
723
|
+
function wr() {
|
|
742
724
|
return () => {
|
|
743
725
|
};
|
|
744
726
|
}
|
|
745
|
-
var
|
|
727
|
+
var fa = "Avatar", [Cr] = Nr(fa), [Er, is] = Cr(fa), ls = A.forwardRef(
|
|
746
728
|
(a, n) => {
|
|
747
|
-
const { __scopeAvatar: s, ...t } = a, [
|
|
729
|
+
const { __scopeAvatar: s, ...t } = a, [l, c] = A.useState("idle");
|
|
748
730
|
return /* @__PURE__ */ e(
|
|
749
|
-
|
|
731
|
+
Er,
|
|
750
732
|
{
|
|
751
733
|
scope: s,
|
|
752
|
-
imageLoadingStatus:
|
|
734
|
+
imageLoadingStatus: l,
|
|
753
735
|
onImageLoadingStatusChange: c,
|
|
754
|
-
children: /* @__PURE__ */ e(
|
|
736
|
+
children: /* @__PURE__ */ e(pa.span, { ...t, ref: n })
|
|
755
737
|
}
|
|
756
738
|
);
|
|
757
739
|
}
|
|
758
740
|
);
|
|
759
|
-
|
|
760
|
-
var
|
|
741
|
+
ls.displayName = fa;
|
|
742
|
+
var cs = "AvatarImage", ds = A.forwardRef(
|
|
761
743
|
(a, n) => {
|
|
762
|
-
const { __scopeAvatar: s, src: t, onLoadingStatusChange:
|
|
763
|
-
}, ...c } = a,
|
|
764
|
-
|
|
744
|
+
const { __scopeAvatar: s, src: t, onLoadingStatusChange: l = () => {
|
|
745
|
+
}, ...c } = a, m = is(cs, s), u = Ar(t, c), p = st((y) => {
|
|
746
|
+
l(y), m.onImageLoadingStatusChange(y);
|
|
765
747
|
});
|
|
766
|
-
return
|
|
767
|
-
|
|
768
|
-
}, [
|
|
748
|
+
return Je(() => {
|
|
749
|
+
u !== "idle" && p(u);
|
|
750
|
+
}, [u, p]), u === "loaded" ? /* @__PURE__ */ e(pa.img, { ...c, ref: n, src: t }) : null;
|
|
769
751
|
}
|
|
770
752
|
);
|
|
771
|
-
|
|
772
|
-
var
|
|
753
|
+
ds.displayName = cs;
|
|
754
|
+
var us = "AvatarFallback", ms = A.forwardRef(
|
|
773
755
|
(a, n) => {
|
|
774
|
-
const { __scopeAvatar: s, delayMs: t, ...
|
|
756
|
+
const { __scopeAvatar: s, delayMs: t, ...l } = a, c = is(us, s), [m, u] = A.useState(t === void 0);
|
|
775
757
|
return A.useEffect(() => {
|
|
776
758
|
if (t !== void 0) {
|
|
777
|
-
const p = window.setTimeout(() =>
|
|
759
|
+
const p = window.setTimeout(() => u(!0), t);
|
|
778
760
|
return () => window.clearTimeout(p);
|
|
779
761
|
}
|
|
780
|
-
}, [t]),
|
|
762
|
+
}, [t]), m && c.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(pa.span, { ...l, ref: n }) : null;
|
|
781
763
|
}
|
|
782
764
|
);
|
|
783
|
-
|
|
784
|
-
function
|
|
765
|
+
ms.displayName = us;
|
|
766
|
+
function Va(a, n) {
|
|
785
767
|
return a ? n ? (a.src !== n && (a.src = n), a.complete && a.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
786
768
|
}
|
|
787
|
-
function
|
|
788
|
-
const t =
|
|
789
|
-
() =>
|
|
769
|
+
function Ar(a, { referrerPolicy: n, crossOrigin: s }) {
|
|
770
|
+
const t = Dr(), l = A.useRef(null), c = t ? (l.current || (l.current = new window.Image()), l.current) : null, [m, u] = A.useState(
|
|
771
|
+
() => Va(c, a)
|
|
790
772
|
);
|
|
791
|
-
return
|
|
792
|
-
|
|
793
|
-
}, [c, a]),
|
|
773
|
+
return Je(() => {
|
|
774
|
+
u(Va(c, a));
|
|
775
|
+
}, [c, a]), Je(() => {
|
|
794
776
|
const p = (r) => () => {
|
|
795
|
-
|
|
777
|
+
u(r);
|
|
796
778
|
};
|
|
797
779
|
if (!c) return;
|
|
798
780
|
const y = p("loaded"), h = p("error");
|
|
799
781
|
return c.addEventListener("load", y), c.addEventListener("error", h), n && (c.referrerPolicy = n), typeof s == "string" && (c.crossOrigin = s), () => {
|
|
800
782
|
c.removeEventListener("load", y), c.removeEventListener("error", h);
|
|
801
783
|
};
|
|
802
|
-
}, [c, s, n]),
|
|
784
|
+
}, [c, s, n]), m;
|
|
803
785
|
}
|
|
804
|
-
var
|
|
805
|
-
const
|
|
806
|
-
|
|
786
|
+
var hs = ls, ps = ds, fs = ms;
|
|
787
|
+
const ga = A.forwardRef(({ className: a, ...n }, s) => /* @__PURE__ */ e(
|
|
788
|
+
hs,
|
|
807
789
|
{
|
|
808
790
|
ref: s,
|
|
809
791
|
className: Y(
|
|
@@ -813,18 +795,18 @@ const fa = A.forwardRef(({ className: a, ...n }, s) => /* @__PURE__ */ e(
|
|
|
813
795
|
...n
|
|
814
796
|
}
|
|
815
797
|
));
|
|
816
|
-
|
|
817
|
-
const
|
|
818
|
-
|
|
798
|
+
ga.displayName = hs.displayName;
|
|
799
|
+
const Mr = A.forwardRef(({ className: a, ...n }, s) => /* @__PURE__ */ e(
|
|
800
|
+
ps,
|
|
819
801
|
{
|
|
820
802
|
ref: s,
|
|
821
803
|
className: Y("aspect-square h-full w-full", a),
|
|
822
804
|
...n
|
|
823
805
|
}
|
|
824
806
|
));
|
|
825
|
-
|
|
826
|
-
const
|
|
827
|
-
|
|
807
|
+
Mr.displayName = ps.displayName;
|
|
808
|
+
const va = A.forwardRef(({ className: a, ...n }, s) => /* @__PURE__ */ e(
|
|
809
|
+
fs,
|
|
828
810
|
{
|
|
829
811
|
ref: s,
|
|
830
812
|
className: Y(
|
|
@@ -834,37 +816,37 @@ const ga = A.forwardRef(({ className: a, ...n }, s) => /* @__PURE__ */ e(
|
|
|
834
816
|
...n
|
|
835
817
|
}
|
|
836
818
|
));
|
|
837
|
-
|
|
838
|
-
function
|
|
819
|
+
va.displayName = fs.displayName;
|
|
820
|
+
function Lr({
|
|
839
821
|
open: a,
|
|
840
822
|
onOpenChange: n,
|
|
841
823
|
group: s,
|
|
842
824
|
onUpdate: t
|
|
843
825
|
}) {
|
|
844
|
-
const [
|
|
826
|
+
const [l, c] = N("members"), [m, u] = N(""), [p, y] = N([]), [h, r] = N([]), { data: d, isLoading: f, refetch: v } = tt(s.id), b = s.type === "TENANT_GROUP" ? "tenant" : "organization", { users: S, isLoading: C } = rt({
|
|
845
827
|
type: b,
|
|
846
828
|
tenantId: s.tenantId || void 0,
|
|
847
829
|
active: !0,
|
|
848
830
|
limit: 100
|
|
849
|
-
}), P =
|
|
850
|
-
if (!
|
|
851
|
-
const g =
|
|
831
|
+
}), P = vr(), U = br(), _ = (d == null ? void 0 : d.members) || [], V = W(() => new Set(_.map((g) => g.userId)), [_]), q = W(() => S.filter((g) => !V.has(g.id)), [S, V]), H = W(() => {
|
|
832
|
+
if (!m) return q;
|
|
833
|
+
const g = m.toLowerCase();
|
|
852
834
|
return q.filter(
|
|
853
835
|
(E) => {
|
|
854
836
|
var O, F;
|
|
855
837
|
return ((O = E.name) == null ? void 0 : O.toLowerCase().includes(g)) || ((F = E.email) == null ? void 0 : F.toLowerCase().includes(g));
|
|
856
838
|
}
|
|
857
839
|
);
|
|
858
|
-
}, [q,
|
|
859
|
-
if (!
|
|
860
|
-
const g =
|
|
840
|
+
}, [q, m]), D = W(() => {
|
|
841
|
+
if (!m) return _;
|
|
842
|
+
const g = m.toLowerCase();
|
|
861
843
|
return _.filter(
|
|
862
844
|
(E) => {
|
|
863
845
|
var O, F, z, ae;
|
|
864
846
|
return ((F = (O = E.user) == null ? void 0 : O.name) == null ? void 0 : F.toLowerCase().includes(g)) || ((ae = (z = E.user) == null ? void 0 : z.email) == null ? void 0 : ae.toLowerCase().includes(g));
|
|
865
847
|
}
|
|
866
848
|
);
|
|
867
|
-
}, [_,
|
|
849
|
+
}, [_, m]), j = async () => {
|
|
868
850
|
if (p.length !== 0)
|
|
869
851
|
try {
|
|
870
852
|
await P.mutateAsync({
|
|
@@ -893,14 +875,14 @@ function Ar({
|
|
|
893
875
|
y(
|
|
894
876
|
(E) => E.includes(g) ? E.filter((O) => O !== g) : [...E, g]
|
|
895
877
|
);
|
|
896
|
-
},
|
|
878
|
+
}, ke = (g) => {
|
|
897
879
|
r(
|
|
898
880
|
(E) => E.includes(g) ? E.filter((O) => O !== g) : [...E, g]
|
|
899
881
|
);
|
|
900
882
|
};
|
|
901
|
-
return /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(
|
|
902
|
-
/* @__PURE__ */ o(
|
|
903
|
-
/* @__PURE__ */ e(
|
|
883
|
+
return /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(la, { open: a, onOpenChange: n, children: /* @__PURE__ */ o(da, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
|
|
884
|
+
/* @__PURE__ */ o(ua, { children: [
|
|
885
|
+
/* @__PURE__ */ e(ma, { children: s.name }),
|
|
904
886
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ o("p", { className: "text-sm text-muted-foreground", children: [
|
|
905
887
|
_.length,
|
|
906
888
|
" ",
|
|
@@ -912,36 +894,36 @@ function Ar({
|
|
|
912
894
|
" group"
|
|
913
895
|
] })
|
|
914
896
|
] }),
|
|
915
|
-
/* @__PURE__ */ o(
|
|
916
|
-
c(g),
|
|
897
|
+
/* @__PURE__ */ o(Qa, { value: l, onValueChange: (g) => {
|
|
898
|
+
c(g), u(""), r([]);
|
|
917
899
|
}, className: "mt-4", children: [
|
|
918
|
-
/* @__PURE__ */ o(
|
|
900
|
+
/* @__PURE__ */ o(Wa, { className: "grid w-full grid-cols-2", children: [
|
|
919
901
|
/* @__PURE__ */ e(Ce, { value: "members", children: "Current Members" }),
|
|
920
902
|
/* @__PURE__ */ e(Ce, { value: "add", children: "Add Members" })
|
|
921
903
|
] }),
|
|
922
904
|
/* @__PURE__ */ o(Ee, { value: "members", className: "mt-4 space-y-4", children: [
|
|
923
905
|
/* @__PURE__ */ o("div", { className: "relative", children: [
|
|
924
|
-
/* @__PURE__ */ e(
|
|
906
|
+
/* @__PURE__ */ e(Xe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
925
907
|
/* @__PURE__ */ e(
|
|
926
908
|
ce,
|
|
927
909
|
{
|
|
928
910
|
placeholder: "Search members...",
|
|
929
|
-
value:
|
|
930
|
-
onChange: (g) =>
|
|
911
|
+
value: m,
|
|
912
|
+
onChange: (g) => u(g.target.value),
|
|
931
913
|
className: "pl-10"
|
|
932
914
|
}
|
|
933
915
|
)
|
|
934
916
|
] }),
|
|
935
|
-
/* @__PURE__ */ e(
|
|
917
|
+
/* @__PURE__ */ e(Ye, { className: h.length > 0 ? "h-[300px]" : "h-[350px]", children: f ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ze, { className: "h-16 w-full" }, g)) }) : D.length === 0 ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
936
918
|
/* @__PURE__ */ e(J, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
937
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children:
|
|
938
|
-
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children:
|
|
939
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children:
|
|
940
|
-
|
|
919
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: m ? "No members found" : "No members yet" }),
|
|
920
|
+
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: m ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
|
|
921
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: D.map((g) => /* @__PURE__ */ e(
|
|
922
|
+
kr,
|
|
941
923
|
{
|
|
942
924
|
member: g,
|
|
943
925
|
selected: h.includes(g.userId),
|
|
944
|
-
onToggle: () =>
|
|
926
|
+
onToggle: () => ke(g.userId)
|
|
945
927
|
},
|
|
946
928
|
g.id
|
|
947
929
|
)) }) }),
|
|
@@ -963,7 +945,7 @@ function Ar({
|
|
|
963
945
|
/* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
964
946
|
"Removing..."
|
|
965
947
|
] }) : /* @__PURE__ */ o(I, { children: [
|
|
966
|
-
/* @__PURE__ */ e(
|
|
948
|
+
/* @__PURE__ */ e(Ja, { className: "mr-2 h-4 w-4" }),
|
|
967
949
|
"Remove Selected"
|
|
968
950
|
] })
|
|
969
951
|
}
|
|
@@ -972,23 +954,23 @@ function Ar({
|
|
|
972
954
|
] }),
|
|
973
955
|
/* @__PURE__ */ o(Ee, { value: "add", className: "mt-4 space-y-4", children: [
|
|
974
956
|
/* @__PURE__ */ o("div", { className: "relative", children: [
|
|
975
|
-
/* @__PURE__ */ e(
|
|
957
|
+
/* @__PURE__ */ e(Xe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
976
958
|
/* @__PURE__ */ e(
|
|
977
959
|
ce,
|
|
978
960
|
{
|
|
979
961
|
placeholder: "Search users to add...",
|
|
980
|
-
value:
|
|
981
|
-
onChange: (g) =>
|
|
962
|
+
value: m,
|
|
963
|
+
onChange: (g) => u(g.target.value),
|
|
982
964
|
className: "pl-10"
|
|
983
965
|
}
|
|
984
966
|
)
|
|
985
967
|
] }),
|
|
986
|
-
/* @__PURE__ */ e(
|
|
987
|
-
/* @__PURE__ */ e(
|
|
968
|
+
/* @__PURE__ */ e(Ye, { className: "h-[300px]", children: C ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((g) => /* @__PURE__ */ e(Ze, { className: "h-16 w-full" }, g)) }) : H.length === 0 ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
969
|
+
/* @__PURE__ */ e(ea, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
988
970
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
989
|
-
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children:
|
|
971
|
+
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: m ? "Try a different search" : "All eligible users are already members" })
|
|
990
972
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: H.map((g) => /* @__PURE__ */ e(
|
|
991
|
-
|
|
973
|
+
Ir,
|
|
992
974
|
{
|
|
993
975
|
user: g,
|
|
994
976
|
selected: p.includes(g.id),
|
|
@@ -1012,7 +994,7 @@ function Ar({
|
|
|
1012
994
|
/* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1013
995
|
"Adding..."
|
|
1014
996
|
] }) : /* @__PURE__ */ o(I, { children: [
|
|
1015
|
-
/* @__PURE__ */ e(
|
|
997
|
+
/* @__PURE__ */ e(ea, { className: "mr-2 h-4 w-4" }),
|
|
1016
998
|
"Add Members"
|
|
1017
999
|
] })
|
|
1018
1000
|
}
|
|
@@ -1022,44 +1004,44 @@ function Ar({
|
|
|
1022
1004
|
] })
|
|
1023
1005
|
] }) }) });
|
|
1024
1006
|
}
|
|
1025
|
-
function
|
|
1007
|
+
function kr({
|
|
1026
1008
|
member: a,
|
|
1027
1009
|
selected: n,
|
|
1028
1010
|
onToggle: s
|
|
1029
1011
|
}) {
|
|
1030
|
-
var
|
|
1031
|
-
const t = ((c = (
|
|
1012
|
+
var l, c, m, u;
|
|
1013
|
+
const t = ((c = (l = a.user) == null ? void 0 : l.name) == null ? void 0 : c.split(" ").map((p) => p[0]).join("").toUpperCase()) || "?";
|
|
1032
1014
|
return /* @__PURE__ */ o(
|
|
1033
1015
|
"div",
|
|
1034
1016
|
{
|
|
1035
1017
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1036
1018
|
onClick: s,
|
|
1037
1019
|
children: [
|
|
1038
|
-
/* @__PURE__ */ e(
|
|
1039
|
-
/* @__PURE__ */ e(
|
|
1020
|
+
/* @__PURE__ */ e(Xa, { checked: n }),
|
|
1021
|
+
/* @__PURE__ */ e(ga, { className: "h-8 w-8", children: /* @__PURE__ */ e(va, { className: "text-xs", children: t }) }),
|
|
1040
1022
|
/* @__PURE__ */ o("div", { className: "flex-1", children: [
|
|
1041
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((
|
|
1042
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (
|
|
1023
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((m = a.user) == null ? void 0 : m.name) || "Unknown User" }),
|
|
1024
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (u = a.user) == null ? void 0 : u.email })
|
|
1043
1025
|
] })
|
|
1044
1026
|
]
|
|
1045
1027
|
}
|
|
1046
1028
|
);
|
|
1047
1029
|
}
|
|
1048
|
-
function
|
|
1030
|
+
function Ir({
|
|
1049
1031
|
user: a,
|
|
1050
1032
|
selected: n,
|
|
1051
1033
|
onToggle: s
|
|
1052
1034
|
}) {
|
|
1053
|
-
var
|
|
1054
|
-
const t = ((
|
|
1035
|
+
var l;
|
|
1036
|
+
const t = ((l = a.name) == null ? void 0 : l.split(" ").map((c) => c[0]).join("").toUpperCase()) || "?";
|
|
1055
1037
|
return /* @__PURE__ */ o(
|
|
1056
1038
|
"div",
|
|
1057
1039
|
{
|
|
1058
1040
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1059
1041
|
onClick: s,
|
|
1060
1042
|
children: [
|
|
1061
|
-
/* @__PURE__ */ e(
|
|
1062
|
-
/* @__PURE__ */ e(
|
|
1043
|
+
/* @__PURE__ */ e(Xa, { checked: n }),
|
|
1044
|
+
/* @__PURE__ */ e(ga, { className: "h-8 w-8", children: /* @__PURE__ */ e(va, { className: "text-xs", children: t }) }),
|
|
1063
1045
|
/* @__PURE__ */ o("div", { className: "flex-1", children: [
|
|
1064
1046
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: a.name }),
|
|
1065
1047
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: a.email })
|
|
@@ -1068,81 +1050,81 @@ function Lr({
|
|
|
1068
1050
|
}
|
|
1069
1051
|
);
|
|
1070
1052
|
}
|
|
1071
|
-
function
|
|
1053
|
+
function Or({
|
|
1072
1054
|
open: a,
|
|
1073
1055
|
onOpenChange: n
|
|
1074
1056
|
}) {
|
|
1075
|
-
const [s, t] = N("groups"), [
|
|
1057
|
+
const [s, t] = N("groups"), [l, c] = N(""), [m, u] = N(null), [p, y] = N(!1), [h, r] = N(null), { tokenProps: d } = $(), { currentUser: f } = ha(), v = gr(), b = (f == null ? void 0 : f.type) === "tenant", S = d == null ? void 0 : d.tenantId, { groups: C, isLoading: P, refetch: U } = nt({
|
|
1076
1058
|
type: b ? "TENANT_GROUP" : "all",
|
|
1077
1059
|
tenantId: b ? S : void 0,
|
|
1078
1060
|
includeMembers: !1
|
|
1079
1061
|
}), _ = C.filter(
|
|
1080
|
-
(
|
|
1062
|
+
(D) => {
|
|
1081
1063
|
var j;
|
|
1082
|
-
return
|
|
1064
|
+
return D.name.toLowerCase().includes(l.toLowerCase()) || ((j = D.description) == null ? void 0 : j.toLowerCase().includes(l.toLowerCase()));
|
|
1083
1065
|
}
|
|
1084
1066
|
), V = async () => {
|
|
1085
1067
|
if (h)
|
|
1086
1068
|
try {
|
|
1087
1069
|
await v.mutateAsync(h.id), r(null), U();
|
|
1088
|
-
} catch (
|
|
1089
|
-
console.error("Failed to delete group:",
|
|
1070
|
+
} catch (D) {
|
|
1071
|
+
console.error("Failed to delete group:", D);
|
|
1090
1072
|
}
|
|
1091
|
-
}, q = (
|
|
1092
|
-
|
|
1073
|
+
}, q = (D) => {
|
|
1074
|
+
u(D), y(!0);
|
|
1093
1075
|
}, H = () => {
|
|
1094
1076
|
t("groups"), U();
|
|
1095
1077
|
};
|
|
1096
1078
|
return /* @__PURE__ */ o(I, { children: [
|
|
1097
|
-
/* @__PURE__ */ e(
|
|
1098
|
-
/* @__PURE__ */ o(
|
|
1099
|
-
/* @__PURE__ */ o(
|
|
1079
|
+
/* @__PURE__ */ e(la, { open: a, onOpenChange: n, children: /* @__PURE__ */ o(da, { className: "max-w-4xl max-h-[80vh]", children: [
|
|
1080
|
+
/* @__PURE__ */ o(ua, { children: [
|
|
1081
|
+
/* @__PURE__ */ o(ma, { className: "flex items-center gap-2", children: [
|
|
1100
1082
|
/* @__PURE__ */ e(J, { className: "h-5 w-5" }),
|
|
1101
1083
|
"Group Management"
|
|
1102
1084
|
] }),
|
|
1103
|
-
/* @__PURE__ */ e(
|
|
1085
|
+
/* @__PURE__ */ e(Ha, { children: "Manage your groups, create new groups, and control group membership" })
|
|
1104
1086
|
] }),
|
|
1105
|
-
/* @__PURE__ */ o(
|
|
1106
|
-
/* @__PURE__ */ o(
|
|
1087
|
+
/* @__PURE__ */ o(Qa, { value: s, onValueChange: t, className: "mt-4", children: [
|
|
1088
|
+
/* @__PURE__ */ o(Wa, { className: "grid w-full grid-cols-2", children: [
|
|
1107
1089
|
/* @__PURE__ */ o(Ce, { value: "groups", className: "flex items-center gap-2", children: [
|
|
1108
1090
|
/* @__PURE__ */ e(J, { className: "h-4 w-4" }),
|
|
1109
1091
|
"Groups"
|
|
1110
1092
|
] }),
|
|
1111
1093
|
/* @__PURE__ */ o(Ce, { value: "create", className: "flex items-center gap-2", children: [
|
|
1112
|
-
/* @__PURE__ */ e(
|
|
1094
|
+
/* @__PURE__ */ e(ca, { className: "h-4 w-4" }),
|
|
1113
1095
|
"Create Group"
|
|
1114
1096
|
] })
|
|
1115
1097
|
] }),
|
|
1116
1098
|
/* @__PURE__ */ e(Ee, { value: "groups", className: "mt-4", children: /* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
1117
1099
|
/* @__PURE__ */ o("div", { className: "relative", children: [
|
|
1118
|
-
/* @__PURE__ */ e(
|
|
1100
|
+
/* @__PURE__ */ e(Xe, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
1119
1101
|
/* @__PURE__ */ e(
|
|
1120
1102
|
ce,
|
|
1121
1103
|
{
|
|
1122
1104
|
placeholder: "Search groups...",
|
|
1123
|
-
value:
|
|
1124
|
-
onChange: (
|
|
1105
|
+
value: l,
|
|
1106
|
+
onChange: (D) => c(D.target.value),
|
|
1125
1107
|
className: "pl-10"
|
|
1126
1108
|
}
|
|
1127
1109
|
)
|
|
1128
1110
|
] }),
|
|
1129
|
-
/* @__PURE__ */ e(
|
|
1111
|
+
/* @__PURE__ */ e(Ye, { className: "h-[400px]", children: P ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((D) => /* @__PURE__ */ e(Ze, { className: "h-24 w-full" }, D)) }) : _.length === 0 ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
1130
1112
|
/* @__PURE__ */ e(J, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
1131
1113
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No groups found" }),
|
|
1132
|
-
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children:
|
|
1133
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: _.map((
|
|
1134
|
-
|
|
1114
|
+
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "Create your first group to get started" })
|
|
1115
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: _.map((D) => /* @__PURE__ */ e(
|
|
1116
|
+
Tr,
|
|
1135
1117
|
{
|
|
1136
|
-
group:
|
|
1137
|
-
onManageMembers: () => q(
|
|
1138
|
-
onDelete: () => r(
|
|
1118
|
+
group: D,
|
|
1119
|
+
onManageMembers: () => q(D),
|
|
1120
|
+
onDelete: () => r(D),
|
|
1139
1121
|
currentUserId: f == null ? void 0 : f.id
|
|
1140
1122
|
},
|
|
1141
|
-
|
|
1123
|
+
D.id
|
|
1142
1124
|
)) }) })
|
|
1143
1125
|
] }) }),
|
|
1144
1126
|
/* @__PURE__ */ e(Ee, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1145
|
-
|
|
1127
|
+
yr,
|
|
1146
1128
|
{
|
|
1147
1129
|
onSuccess: H,
|
|
1148
1130
|
tenantId: S,
|
|
@@ -1151,33 +1133,33 @@ function kr({
|
|
|
1151
1133
|
) })
|
|
1152
1134
|
] })
|
|
1153
1135
|
] }) }),
|
|
1154
|
-
|
|
1155
|
-
|
|
1136
|
+
m && /* @__PURE__ */ e(
|
|
1137
|
+
Lr,
|
|
1156
1138
|
{
|
|
1157
1139
|
open: p,
|
|
1158
1140
|
onOpenChange: y,
|
|
1159
|
-
group:
|
|
1141
|
+
group: m,
|
|
1160
1142
|
onUpdate: () => U()
|
|
1161
1143
|
}
|
|
1162
1144
|
),
|
|
1163
1145
|
/* @__PURE__ */ e(
|
|
1164
|
-
|
|
1146
|
+
Ya,
|
|
1165
1147
|
{
|
|
1166
1148
|
open: !!h,
|
|
1167
1149
|
onOpenChange: () => r(null),
|
|
1168
|
-
children: /* @__PURE__ */ o(
|
|
1169
|
-
/* @__PURE__ */ o(
|
|
1170
|
-
/* @__PURE__ */ e(
|
|
1171
|
-
/* @__PURE__ */ o(
|
|
1150
|
+
children: /* @__PURE__ */ o(Za, { children: [
|
|
1151
|
+
/* @__PURE__ */ o(es, { children: [
|
|
1152
|
+
/* @__PURE__ */ e(as, { children: "Delete Group" }),
|
|
1153
|
+
/* @__PURE__ */ o(ss, { children: [
|
|
1172
1154
|
'Are you sure you want to delete "',
|
|
1173
1155
|
h == null ? void 0 : h.name,
|
|
1174
1156
|
'"? This action cannot be undone and will remove all members from the group.'
|
|
1175
1157
|
] })
|
|
1176
1158
|
] }),
|
|
1177
|
-
/* @__PURE__ */ o(
|
|
1178
|
-
/* @__PURE__ */ e(
|
|
1159
|
+
/* @__PURE__ */ o(ts, { children: [
|
|
1160
|
+
/* @__PURE__ */ e(rs, { children: "Cancel" }),
|
|
1179
1161
|
/* @__PURE__ */ e(
|
|
1180
|
-
|
|
1162
|
+
aa,
|
|
1181
1163
|
{
|
|
1182
1164
|
onClick: V,
|
|
1183
1165
|
disabled: v.isPending,
|
|
@@ -1194,13 +1176,13 @@ function kr({
|
|
|
1194
1176
|
)
|
|
1195
1177
|
] });
|
|
1196
1178
|
}
|
|
1197
|
-
function
|
|
1179
|
+
function Tr({
|
|
1198
1180
|
group: a,
|
|
1199
1181
|
onManageMembers: n,
|
|
1200
1182
|
onDelete: s,
|
|
1201
1183
|
currentUserId: t
|
|
1202
1184
|
}) {
|
|
1203
|
-
const
|
|
1185
|
+
const l = a.createdBy === t;
|
|
1204
1186
|
return /* @__PURE__ */ e("div", { className: "rounded-lg border bg-card p-4 transition-colors hover:bg-muted/50", children: /* @__PURE__ */ o("div", { className: "flex items-start justify-between gap-3", children: [
|
|
1205
1187
|
/* @__PURE__ */ o("div", { className: "flex-1 space-y-2", children: [
|
|
1206
1188
|
/* @__PURE__ */ o("div", { children: [
|
|
@@ -1216,7 +1198,7 @@ function Ir({
|
|
|
1216
1198
|
] }),
|
|
1217
1199
|
/* @__PURE__ */ o("span", { children: [
|
|
1218
1200
|
"Created ",
|
|
1219
|
-
|
|
1201
|
+
Kt(new Date(a.createdAt), "MMM d, yyyy")
|
|
1220
1202
|
] })
|
|
1221
1203
|
] })
|
|
1222
1204
|
] }),
|
|
@@ -1228,10 +1210,10 @@ function Ir({
|
|
|
1228
1210
|
size: "sm",
|
|
1229
1211
|
onClick: n,
|
|
1230
1212
|
title: "Manage members",
|
|
1231
|
-
children: /* @__PURE__ */ e(
|
|
1213
|
+
children: /* @__PURE__ */ e(ea, { className: "h-4 w-4" })
|
|
1232
1214
|
}
|
|
1233
1215
|
),
|
|
1234
|
-
|
|
1216
|
+
l && /* @__PURE__ */ e(
|
|
1235
1217
|
M,
|
|
1236
1218
|
{
|
|
1237
1219
|
variant: "ghost",
|
|
@@ -1239,35 +1221,35 @@ function Ir({
|
|
|
1239
1221
|
onClick: s,
|
|
1240
1222
|
title: "Delete group",
|
|
1241
1223
|
className: "text-destructive hover:text-destructive",
|
|
1242
|
-
children: /* @__PURE__ */ e(
|
|
1224
|
+
children: /* @__PURE__ */ e(Ja, { className: "h-4 w-4" })
|
|
1243
1225
|
}
|
|
1244
1226
|
)
|
|
1245
1227
|
] })
|
|
1246
1228
|
] }) });
|
|
1247
1229
|
}
|
|
1248
1230
|
function ie(a, n, s) {
|
|
1249
|
-
var c,
|
|
1231
|
+
var c, m;
|
|
1250
1232
|
const t = (a.controls || []).find(
|
|
1251
|
-
(
|
|
1233
|
+
(u) => u.id === s
|
|
1252
1234
|
);
|
|
1253
1235
|
if (t)
|
|
1254
1236
|
return t.label;
|
|
1255
|
-
const
|
|
1256
|
-
(
|
|
1237
|
+
const l = (m = (c = ns(a, n)) == null ? void 0 : c.controls) == null ? void 0 : m.find(
|
|
1238
|
+
(u) => u.id === s
|
|
1257
1239
|
);
|
|
1258
|
-
return (
|
|
1240
|
+
return (l == null ? void 0 : l.label) || s;
|
|
1259
1241
|
}
|
|
1260
1242
|
function le(a, n) {
|
|
1261
1243
|
var s;
|
|
1262
|
-
return ((s =
|
|
1244
|
+
return ((s = ns(a, n)) == null ? void 0 : s.title) || n;
|
|
1263
1245
|
}
|
|
1264
|
-
function
|
|
1246
|
+
function _r(a) {
|
|
1265
1247
|
const { errors: n, dashboard: s } = a;
|
|
1266
1248
|
if (!s)
|
|
1267
1249
|
return n;
|
|
1268
1250
|
const t = /* @__PURE__ */ new Map();
|
|
1269
|
-
for (const
|
|
1270
|
-
const c =
|
|
1251
|
+
for (const l of n) {
|
|
1252
|
+
const c = l.match(
|
|
1271
1253
|
/^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
|
|
1272
1254
|
);
|
|
1273
1255
|
if (c) {
|
|
@@ -1282,11 +1264,11 @@ function Or(a) {
|
|
|
1282
1264
|
);
|
|
1283
1265
|
continue;
|
|
1284
1266
|
}
|
|
1285
|
-
const
|
|
1267
|
+
const m = l.match(
|
|
1286
1268
|
/^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
|
|
1287
1269
|
);
|
|
1288
|
-
if (
|
|
1289
|
-
const [, h, r] =
|
|
1270
|
+
if (m) {
|
|
1271
|
+
const [, h, r] = m, d = `${h}:${r}:missing-group-by`;
|
|
1290
1272
|
t.has(d) || t.set(
|
|
1291
1273
|
d,
|
|
1292
1274
|
`"${le(s, h)}" has an outdated "${ie(
|
|
@@ -1297,11 +1279,11 @@ function Or(a) {
|
|
|
1297
1279
|
);
|
|
1298
1280
|
continue;
|
|
1299
1281
|
}
|
|
1300
|
-
const
|
|
1282
|
+
const u = l.match(
|
|
1301
1283
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
|
|
1302
1284
|
);
|
|
1303
|
-
if (
|
|
1304
|
-
const [, h, r] =
|
|
1285
|
+
if (u) {
|
|
1286
|
+
const [, h, r] = u, d = `${h}:${r}:invalid-metric`;
|
|
1305
1287
|
t.has(d) || t.set(
|
|
1306
1288
|
d,
|
|
1307
1289
|
`"${le(s, h)}" has an invalid "${ie(
|
|
@@ -1312,7 +1294,7 @@ function Or(a) {
|
|
|
1312
1294
|
);
|
|
1313
1295
|
continue;
|
|
1314
1296
|
}
|
|
1315
|
-
const p =
|
|
1297
|
+
const p = l.match(
|
|
1316
1298
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
|
|
1317
1299
|
);
|
|
1318
1300
|
if (p) {
|
|
@@ -1327,7 +1309,7 @@ function Or(a) {
|
|
|
1327
1309
|
);
|
|
1328
1310
|
continue;
|
|
1329
1311
|
}
|
|
1330
|
-
const y =
|
|
1312
|
+
const y = l.match(
|
|
1331
1313
|
/^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
|
|
1332
1314
|
);
|
|
1333
1315
|
if (y) {
|
|
@@ -1342,162 +1324,162 @@ function Or(a) {
|
|
|
1342
1324
|
);
|
|
1343
1325
|
continue;
|
|
1344
1326
|
}
|
|
1345
|
-
t.set(
|
|
1327
|
+
t.set(l, l);
|
|
1346
1328
|
}
|
|
1347
1329
|
return Array.from(t.values());
|
|
1348
1330
|
}
|
|
1349
|
-
function
|
|
1350
|
-
var
|
|
1351
|
-
|
|
1331
|
+
function zr() {
|
|
1332
|
+
var ka, Ia, Oa, Ta;
|
|
1333
|
+
Gt(), Ft();
|
|
1352
1334
|
const {
|
|
1353
1335
|
authToken: a,
|
|
1354
1336
|
tokenProps: n,
|
|
1355
1337
|
id: s
|
|
1356
|
-
} = $(), { isLocalDev: t } =
|
|
1357
|
-
x((
|
|
1358
|
-
const
|
|
1359
|
-
(
|
|
1360
|
-
), p = x((
|
|
1361
|
-
x((
|
|
1338
|
+
} = $(), { isLocalDev: t } = ot(), { permissions: l } = dr(), c = it(), { isLoading: m } = lt();
|
|
1339
|
+
x((i) => i.theme);
|
|
1340
|
+
const u = x(
|
|
1341
|
+
(i) => i.dashboardAssistantDraftScopeKey
|
|
1342
|
+
), p = x((i) => i.lenses), y = x((i) => i.selectedLensId), h = p == null ? void 0 : p.find((i) => i.id === y), r = x((i) => i.dashboard);
|
|
1343
|
+
x((i) => i.selectedSheetId);
|
|
1362
1344
|
const d = x(
|
|
1363
|
-
(
|
|
1364
|
-
), { setDashboardTitle: f } = x((
|
|
1365
|
-
(
|
|
1366
|
-
),
|
|
1367
|
-
|
|
1368
|
-
const se =
|
|
1369
|
-
(
|
|
1370
|
-
), he =
|
|
1371
|
-
(
|
|
1345
|
+
(i) => i.isDashboardEditing
|
|
1346
|
+
), { setDashboardTitle: f } = x((i) => i.actions), [v, b] = N(!1), [S, C] = N(!1), [P, U] = N(!1), [_, V] = N(!1), [q, H] = N(!1), [D, j] = N(!1), [ue, ee] = N(null), [ke, g] = N(!1), [E, O] = N(null), [F, z] = N([]), [ae, me] = N(!1), gs = x((i) => i.isDashboardPanelOpen), vs = x(
|
|
1347
|
+
(i) => i.actions.setIsDashboardPanelOpen
|
|
1348
|
+
), bs = x((i) => i.filterValues), w = x((i) => i.isVisualEditing);
|
|
1349
|
+
Ua((i) => i.card);
|
|
1350
|
+
const se = De(
|
|
1351
|
+
(i) => i.selectedDashboard
|
|
1352
|
+
), he = De(
|
|
1353
|
+
(i) => i.initialDashboard
|
|
1372
1354
|
);
|
|
1373
|
-
|
|
1374
|
-
const pe = se ? (
|
|
1375
|
-
(
|
|
1376
|
-
),
|
|
1377
|
-
(
|
|
1378
|
-
), { setIsDashboardEditing:
|
|
1379
|
-
(
|
|
1380
|
-
), { setInitialDashboard:
|
|
1381
|
-
(
|
|
1382
|
-
), { resources: ge } =
|
|
1355
|
+
De((i) => i.selectedVisual), x((i) => i.selectedFrameId), Ua((i) => i.frame);
|
|
1356
|
+
const pe = se ? (Ia = se == null ? void 0 : se.permissions) == null ? void 0 : Ia.canEdit : (ka = he == null ? void 0 : he.permissions) == null ? void 0 : ka.canEdit, fe = x((i) => i.showFilters), ba = ct((i) => i.setPanelOpen), ys = x(
|
|
1357
|
+
(i) => i.showDashboardJSON
|
|
1358
|
+
), Ie = x((i) => i.onSaveFunction), ya = x(
|
|
1359
|
+
(i) => i.actions.setShowFilters
|
|
1360
|
+
), { setIsDashboardEditing: Na, setShowDashboardJSON: Sa } = x(
|
|
1361
|
+
(i) => i.actions
|
|
1362
|
+
), { setInitialDashboard: xa, clearSelectedDashboard: Oe } = De(
|
|
1363
|
+
(i) => i.actions
|
|
1364
|
+
), { resources: ge } = dt(je.DASHBOARD), { data: Te } = ut(), Ns = ((Oa = Te == null ? void 0 : Te.preference) == null ? void 0 : Oa.defaultDashboardId) || null, { mutate: Ss, isPending: xs } = mt(), { currentUser: Ds } = ha(), ws = ht(Ds), X = se || he, Da = X ? {
|
|
1383
1365
|
id: X.id,
|
|
1384
1366
|
title: (r == null ? void 0 : r.title) || X.title || "Dashboard"
|
|
1385
|
-
} : null, { handleAddNewFrame:
|
|
1367
|
+
} : null, { handleAddNewFrame: Cs } = pt(), [_e, Pe] = N(!1), [Es, te] = N(!1), [Ue, ve] = N("close"), re = ft(je.DASHBOARD), [R, Re] = N(
|
|
1386
1368
|
null
|
|
1387
|
-
), wa =
|
|
1388
|
-
(
|
|
1369
|
+
), wa = Ra(
|
|
1370
|
+
(i) => {
|
|
1389
1371
|
window.setTimeout(() => {
|
|
1390
|
-
ee(
|
|
1372
|
+
ee(i);
|
|
1391
1373
|
}, 0);
|
|
1392
1374
|
},
|
|
1393
1375
|
[]
|
|
1394
|
-
),
|
|
1376
|
+
), As = async (i, L) => {
|
|
1395
1377
|
if (!(r != null && r.id)) {
|
|
1396
1378
|
console.log("No dashboard ID found");
|
|
1397
1379
|
return;
|
|
1398
1380
|
}
|
|
1399
1381
|
console.log("Updating dashboard title:", {
|
|
1400
1382
|
dashboardId: r.id,
|
|
1401
|
-
newTitle:
|
|
1383
|
+
newTitle: i,
|
|
1402
1384
|
previousTitle: L
|
|
1403
1385
|
}), re.mutate(
|
|
1404
1386
|
{
|
|
1405
1387
|
resourceId: r.id,
|
|
1406
|
-
data: { title:
|
|
1388
|
+
data: { title: i }
|
|
1407
1389
|
},
|
|
1408
1390
|
{
|
|
1409
1391
|
onSuccess: () => {
|
|
1410
1392
|
console.log("Dashboard title updated successfully"), k.success("Dashboard title updated");
|
|
1411
1393
|
},
|
|
1412
|
-
onError: (
|
|
1413
|
-
console.error("Failed to update dashboard title:",
|
|
1394
|
+
onError: (G) => {
|
|
1395
|
+
console.error("Failed to update dashboard title:", G), k.error("Failed to update dashboard title"), f(L);
|
|
1414
1396
|
}
|
|
1415
1397
|
}
|
|
1416
1398
|
);
|
|
1417
1399
|
};
|
|
1418
|
-
|
|
1400
|
+
Rt(() => {
|
|
1419
1401
|
if (ge && ge.length > 0) {
|
|
1420
|
-
const
|
|
1421
|
-
if (
|
|
1402
|
+
const i = r == null ? void 0 : r.id;
|
|
1403
|
+
if (i) {
|
|
1422
1404
|
const L = ge.find(
|
|
1423
|
-
(
|
|
1405
|
+
(G) => G.id === i
|
|
1424
1406
|
);
|
|
1425
|
-
L &&
|
|
1407
|
+
L && xa(L);
|
|
1426
1408
|
}
|
|
1427
1409
|
}
|
|
1428
|
-
}, [ge, r == null ? void 0 : r.id,
|
|
1429
|
-
const be = n.orgUserId || n.tenantId,
|
|
1430
|
-
|
|
1431
|
-
},
|
|
1432
|
-
|
|
1410
|
+
}, [ge, r == null ? void 0 : r.id, xa]);
|
|
1411
|
+
const be = n.orgUserId || n.tenantId, Ca = d && !w && be && pe, { setDashboard: Ge } = x((i) => i.actions), Ms = () => {
|
|
1412
|
+
Na(!0);
|
|
1413
|
+
}, Fe = () => {
|
|
1414
|
+
Na(!1), Sa(!1), Re(null), ee(null);
|
|
1433
1415
|
};
|
|
1434
|
-
|
|
1416
|
+
$t(
|
|
1435
1417
|
d,
|
|
1436
1418
|
r,
|
|
1437
|
-
|
|
1438
|
-
(
|
|
1419
|
+
R,
|
|
1420
|
+
(i) => Re(i)
|
|
1439
1421
|
);
|
|
1440
|
-
const { isDirty:
|
|
1422
|
+
const { isDirty: Ea, isDirtyPending: Ls, resetDirty: ye } = Jt(
|
|
1441
1423
|
r,
|
|
1442
|
-
|
|
1424
|
+
R,
|
|
1443
1425
|
300,
|
|
1444
1426
|
1e3,
|
|
1445
|
-
|
|
1446
|
-
),
|
|
1447
|
-
|
|
1448
|
-
},
|
|
1449
|
-
await
|
|
1427
|
+
ze
|
|
1428
|
+
), Aa = Ra(() => R ? ze(r) !== ze(R) : !1, [r, R]), $e = Ea || Ls, ne = _e || re.isPending, ks = () => {
|
|
1429
|
+
Aa() ? (ve("close"), te(!0)) : (Fe(), ye());
|
|
1430
|
+
}, Is = async () => {
|
|
1431
|
+
await Ve({
|
|
1450
1432
|
closeAfterSave: !0,
|
|
1451
|
-
navigateHomeAfterSave:
|
|
1433
|
+
navigateHomeAfterSave: Ue === "home"
|
|
1452
1434
|
});
|
|
1453
|
-
}, ks = () => {
|
|
1454
|
-
G && Ge(G), Re(), Pe === "home" && Ie(), ve("close"), te(!1), ye();
|
|
1455
|
-
}, Is = () => {
|
|
1456
|
-
G && (Ge(G), ye());
|
|
1457
1435
|
}, Os = () => {
|
|
1458
|
-
|
|
1436
|
+
R && Ge(R), Fe(), Ue === "home" && Oe(), ve("close"), te(!1), ye();
|
|
1437
|
+
}, Ts = () => {
|
|
1438
|
+
R && (Ge(R), ye());
|
|
1439
|
+
}, _s = () => {
|
|
1440
|
+
if (d && Aa()) {
|
|
1459
1441
|
ve("home"), te(!0);
|
|
1460
1442
|
return;
|
|
1461
1443
|
}
|
|
1462
|
-
|
|
1444
|
+
Oe();
|
|
1463
1445
|
};
|
|
1464
|
-
async function
|
|
1446
|
+
async function Ve(i) {
|
|
1465
1447
|
const L = x.getState().dashboard;
|
|
1466
1448
|
if (!L)
|
|
1467
1449
|
return;
|
|
1468
|
-
const
|
|
1469
|
-
me(
|
|
1470
|
-
const
|
|
1471
|
-
g(!0), O(null), z([]),
|
|
1472
|
-
const
|
|
1450
|
+
const G = (i == null ? void 0 : i.closeAfterSave) ?? ae, Fs = (i == null ? void 0 : i.navigateHomeAfterSave) ?? !1;
|
|
1451
|
+
me(G), G && te(!1);
|
|
1452
|
+
const $s = Pt(L);
|
|
1453
|
+
g(!0), O(null), z([]), Pe(!0);
|
|
1454
|
+
const Vs = {
|
|
1473
1455
|
template: L
|
|
1474
1456
|
};
|
|
1475
1457
|
re.mutate(
|
|
1476
1458
|
{
|
|
1477
1459
|
resourceId: L.id,
|
|
1478
|
-
data:
|
|
1460
|
+
data: Vs
|
|
1479
1461
|
},
|
|
1480
1462
|
{
|
|
1481
1463
|
onSuccess: (T) => {
|
|
1482
|
-
var Ne, Se,
|
|
1483
|
-
const B = (T == null ? void 0 : T.id) || ((Ne = T == null ? void 0 : T.dashboard) == null ? void 0 : Ne.id) || ((Se = T == null ? void 0 : T.resource) == null ? void 0 : Se.id) || ((
|
|
1464
|
+
var Ne, Se, _a;
|
|
1465
|
+
const B = (T == null ? void 0 : T.id) || ((Ne = T == null ? void 0 : T.dashboard) == null ? void 0 : Ne.id) || ((Se = T == null ? void 0 : T.resource) == null ? void 0 : Se.id) || ((_a = T == null ? void 0 : T.template) == null ? void 0 : _a.id) || null;
|
|
1484
1466
|
if (!L.id && B) {
|
|
1485
|
-
const
|
|
1486
|
-
(xe == null ? void 0 : xe.scopeKey) ===
|
|
1467
|
+
const He = Ut.getState(), xe = He.pendingDashboardDraftMigration;
|
|
1468
|
+
(xe == null ? void 0 : xe.scopeKey) === u ? He.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
|
|
1487
1469
|
B
|
|
1488
|
-
) : xe &&
|
|
1470
|
+
) : xe && He.actions.clearPendingDashboardDraftMigration();
|
|
1489
1471
|
}
|
|
1490
|
-
|
|
1472
|
+
Pe(!1), k.success("Dashboard saved!"), Re($s), g(!1), me(!1), G && (Fe(), ye(), Fs && Oe()), ve("close");
|
|
1491
1473
|
},
|
|
1492
1474
|
onError: (T) => {
|
|
1493
|
-
|
|
1475
|
+
Pe(!1), O("Failed to save dashboard. Please try again.");
|
|
1494
1476
|
const B = T.details, Ne = Array.isArray(
|
|
1495
1477
|
B == null ? void 0 : B.errors
|
|
1496
1478
|
) ? (B.errors || []).filter(
|
|
1497
1479
|
(Se) => typeof Se == "string"
|
|
1498
1480
|
) : [];
|
|
1499
1481
|
z(
|
|
1500
|
-
|
|
1482
|
+
_r({
|
|
1501
1483
|
errors: Ne,
|
|
1502
1484
|
dashboard: L || void 0
|
|
1503
1485
|
})
|
|
@@ -1506,34 +1488,34 @@ function Hr() {
|
|
|
1506
1488
|
}
|
|
1507
1489
|
);
|
|
1508
1490
|
}
|
|
1509
|
-
async function
|
|
1491
|
+
async function Ps() {
|
|
1510
1492
|
if (b(!0), !y || !h) return;
|
|
1511
|
-
const
|
|
1512
|
-
if (!
|
|
1493
|
+
const i = x.getState().dashboard;
|
|
1494
|
+
if (!i) {
|
|
1513
1495
|
b(!1);
|
|
1514
1496
|
return;
|
|
1515
1497
|
}
|
|
1516
|
-
const L = JSON.stringify(
|
|
1498
|
+
const L = JSON.stringify(i), G = {
|
|
1517
1499
|
...h,
|
|
1518
1500
|
template: L,
|
|
1519
|
-
filterValues:
|
|
1501
|
+
filterValues: bs
|
|
1520
1502
|
};
|
|
1521
|
-
await
|
|
1503
|
+
await ta(
|
|
1522
1504
|
n.apiServiceUrl,
|
|
1523
|
-
|
|
1505
|
+
G,
|
|
1524
1506
|
a == null ? void 0 : a.accessToken
|
|
1525
|
-
), k.success("Lens saved"),
|
|
1507
|
+
), k.success("Lens saved"), Ie == null || Ie(i), b(!1);
|
|
1526
1508
|
}
|
|
1527
|
-
const
|
|
1509
|
+
const Ma = (h == null ? void 0 : h.name) || r.title;
|
|
1528
1510
|
re.isPending && console.log("Title during update:", {
|
|
1529
|
-
title:
|
|
1511
|
+
title: Ma,
|
|
1530
1512
|
dashboardStateTitle: r.title,
|
|
1531
1513
|
dashboardId: r == null ? void 0 : r.id,
|
|
1532
1514
|
currentLensName: h == null ? void 0 : h.name
|
|
1533
1515
|
});
|
|
1534
|
-
const
|
|
1535
|
-
oe &&
|
|
1536
|
-
dashboardId:
|
|
1516
|
+
const La = n.orgUserId || n.tenantId && n.endUserId && n.endUserEmail, Us = !!La && !!(a != null && a.accessToken) && !!(n != null && n.apiServiceUrl), Rs = c, oe = (r == null ? void 0 : r.id) || null, qe = !!oe && Ns === oe, Gs = () => {
|
|
1517
|
+
oe && Ss({
|
|
1518
|
+
dashboardId: qe ? null : oe
|
|
1537
1519
|
});
|
|
1538
1520
|
};
|
|
1539
1521
|
return /* @__PURE__ */ o(
|
|
@@ -1543,31 +1525,31 @@ function Hr() {
|
|
|
1543
1525
|
role: "dashboard-controls",
|
|
1544
1526
|
children: [
|
|
1545
1527
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
1546
|
-
|
|
1528
|
+
La && /* @__PURE__ */ o(I, { children: [
|
|
1547
1529
|
/* @__PURE__ */ e(
|
|
1548
1530
|
K,
|
|
1549
1531
|
{
|
|
1550
1532
|
"aria-label": "Manage Dashboards",
|
|
1551
1533
|
tooltip: "Manage Dashboards",
|
|
1552
1534
|
onClick: () => {
|
|
1553
|
-
|
|
1535
|
+
vs(!gs);
|
|
1554
1536
|
},
|
|
1555
1537
|
className: "h-7 p-2",
|
|
1556
|
-
children: /* @__PURE__ */ e(
|
|
1538
|
+
children: /* @__PURE__ */ e(Yt, { className: "h-4 w-4" })
|
|
1557
1539
|
}
|
|
1558
1540
|
),
|
|
1559
|
-
|
|
1541
|
+
Rs && !w && /* @__PURE__ */ e(
|
|
1560
1542
|
K,
|
|
1561
1543
|
{
|
|
1562
1544
|
"aria-label": "Dashboard Hub",
|
|
1563
1545
|
tooltip: "Dashboard Hub",
|
|
1564
|
-
onClick:
|
|
1546
|
+
onClick: _s,
|
|
1565
1547
|
className: "h-7 p-2",
|
|
1566
|
-
children: /* @__PURE__ */ e(
|
|
1548
|
+
children: /* @__PURE__ */ e(ja, { className: "h-4 w-4" })
|
|
1567
1549
|
}
|
|
1568
1550
|
)
|
|
1569
1551
|
] }),
|
|
1570
|
-
!
|
|
1552
|
+
!w && c && (m ? /* @__PURE__ */ e(
|
|
1571
1553
|
"div",
|
|
1572
1554
|
{
|
|
1573
1555
|
className: "h-4 w-28 rounded-md bg-muted/70 animate-pulse",
|
|
@@ -1577,17 +1559,17 @@ function Hr() {
|
|
|
1577
1559
|
}
|
|
1578
1560
|
) : /* @__PURE__ */ o(I, { children: [
|
|
1579
1561
|
/* @__PURE__ */ e(
|
|
1580
|
-
|
|
1562
|
+
gt,
|
|
1581
1563
|
{
|
|
1582
|
-
value:
|
|
1583
|
-
onSave: (
|
|
1564
|
+
value: Ma || "Untitled Dashboard",
|
|
1565
|
+
onSave: (i) => {
|
|
1584
1566
|
console.log("EditableText onSave called:", {
|
|
1585
|
-
newTitle:
|
|
1567
|
+
newTitle: i,
|
|
1586
1568
|
canEditDashboard: pe,
|
|
1587
1569
|
dashboardId: r == null ? void 0 : r.id
|
|
1588
1570
|
});
|
|
1589
1571
|
const L = (r == null ? void 0 : r.title) || "";
|
|
1590
|
-
f(
|
|
1572
|
+
f(i), As(i, L);
|
|
1591
1573
|
},
|
|
1592
1574
|
isEditable: pe && !h,
|
|
1593
1575
|
displayClassName: "text-sm font-medium",
|
|
@@ -1596,78 +1578,78 @@ function Hr() {
|
|
|
1596
1578
|
isPending: re.isPending
|
|
1597
1579
|
}
|
|
1598
1580
|
),
|
|
1599
|
-
|
|
1600
|
-
/* @__PURE__ */ e(
|
|
1581
|
+
Us && oe && /* @__PURE__ */ e(vt, { children: /* @__PURE__ */ o(bt, { children: [
|
|
1582
|
+
/* @__PURE__ */ e(yt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1601
1583
|
M,
|
|
1602
1584
|
{
|
|
1603
1585
|
variant: "ghost",
|
|
1604
1586
|
size: "icon",
|
|
1605
|
-
onClick:
|
|
1606
|
-
disabled:
|
|
1587
|
+
onClick: Gs,
|
|
1588
|
+
disabled: xs || !(a != null && a.accessToken) || !(n != null && n.apiServiceUrl),
|
|
1607
1589
|
className: "h-7 w-7",
|
|
1608
1590
|
children: /* @__PURE__ */ e(
|
|
1609
|
-
|
|
1591
|
+
Nt,
|
|
1610
1592
|
{
|
|
1611
1593
|
className: Y(
|
|
1612
1594
|
"h-4 w-4 transition-colors",
|
|
1613
|
-
|
|
1595
|
+
qe ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground hover:text-yellow-400"
|
|
1614
1596
|
)
|
|
1615
1597
|
}
|
|
1616
1598
|
)
|
|
1617
1599
|
}
|
|
1618
1600
|
) }),
|
|
1619
|
-
/* @__PURE__ */ e(
|
|
1601
|
+
/* @__PURE__ */ e(St, { children: /* @__PURE__ */ e("p", { children: qe ? "Remove as default dashboard" : "Make this a default dashboard" }) })
|
|
1620
1602
|
] }) })
|
|
1621
1603
|
] }))
|
|
1622
1604
|
] }),
|
|
1623
1605
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
1624
|
-
|
|
1625
|
-
/* @__PURE__ */ e(
|
|
1626
|
-
/* @__PURE__ */ e(
|
|
1606
|
+
w && /* @__PURE__ */ o(I, { children: [
|
|
1607
|
+
/* @__PURE__ */ e(Vt, { className: "mr-2" }),
|
|
1608
|
+
/* @__PURE__ */ e(qt, { className: "h-7" })
|
|
1627
1609
|
] }),
|
|
1628
|
-
t && !
|
|
1610
|
+
t && !w && /* @__PURE__ */ o(I, { children: [
|
|
1629
1611
|
/* @__PURE__ */ e(
|
|
1630
1612
|
K,
|
|
1631
1613
|
{
|
|
1632
1614
|
tooltip: "Copy Token",
|
|
1633
1615
|
onClick: () => {
|
|
1634
|
-
var
|
|
1635
|
-
a != null && a.accessToken && ((
|
|
1616
|
+
var i;
|
|
1617
|
+
a != null && a.accessToken && ((i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(a.accessToken).then(() => k.success("Token copied to clipboard")).catch(() => k.error("Unable to copy token")) : k.error("Clipboard not available"));
|
|
1636
1618
|
},
|
|
1637
1619
|
className: "h-7 p-2",
|
|
1638
|
-
children: /* @__PURE__ */ e(
|
|
1620
|
+
children: /* @__PURE__ */ e(xt, { className: "h-4 w-4" })
|
|
1639
1621
|
}
|
|
1640
1622
|
),
|
|
1641
1623
|
/* @__PURE__ */ e(
|
|
1642
1624
|
K,
|
|
1643
1625
|
{
|
|
1644
1626
|
tooltip: "Invalidate Token",
|
|
1645
|
-
onClick: () =>
|
|
1627
|
+
onClick: () => Dt(n.apiServiceUrl),
|
|
1646
1628
|
className: "h-7 p-2",
|
|
1647
|
-
children: /* @__PURE__ */ e(
|
|
1629
|
+
children: /* @__PURE__ */ e(er, { className: "h-4 w-4" })
|
|
1648
1630
|
}
|
|
1649
1631
|
)
|
|
1650
1632
|
] }),
|
|
1651
|
-
!
|
|
1652
|
-
!
|
|
1653
|
-
!
|
|
1633
|
+
!w && c && /* @__PURE__ */ e(wt, {}),
|
|
1634
|
+
!w && c && /* @__PURE__ */ e(Ht, {}),
|
|
1635
|
+
!w && c && ((Ta = X == null ? void 0 : X.permissions) == null ? void 0 : Ta.canShare) && /* @__PURE__ */ e(
|
|
1654
1636
|
K,
|
|
1655
1637
|
{
|
|
1656
1638
|
tooltip: "Share Dashboard",
|
|
1657
1639
|
onClick: () => C(!0),
|
|
1658
1640
|
className: "h-7 p-2",
|
|
1659
|
-
children: /* @__PURE__ */ e(
|
|
1641
|
+
children: /* @__PURE__ */ e(Ct, { className: "h-4 w-4" })
|
|
1660
1642
|
}
|
|
1661
1643
|
),
|
|
1662
|
-
!
|
|
1663
|
-
|
|
1644
|
+
!w && d && l.canUseFilters && c && /* @__PURE__ */ e(
|
|
1645
|
+
jt,
|
|
1664
1646
|
{
|
|
1665
1647
|
showFilters: fe,
|
|
1666
1648
|
onToggleFilters: () => {
|
|
1667
|
-
fe ||
|
|
1649
|
+
fe || ba("dashboard", !1), ya(!fe);
|
|
1668
1650
|
},
|
|
1669
1651
|
onAddFilter: () => {
|
|
1670
|
-
fe || (
|
|
1652
|
+
fe || (ba("dashboard", !1), ya(!0));
|
|
1671
1653
|
},
|
|
1672
1654
|
onAddControl: () => {
|
|
1673
1655
|
wa("create");
|
|
@@ -1675,26 +1657,26 @@ function Hr() {
|
|
|
1675
1657
|
onManageControls: () => wa("manage")
|
|
1676
1658
|
}
|
|
1677
1659
|
),
|
|
1678
|
-
d && !
|
|
1679
|
-
|
|
1660
|
+
d && !w && c && ue ? /* @__PURE__ */ e(
|
|
1661
|
+
zt,
|
|
1680
1662
|
{
|
|
1681
1663
|
open: !0,
|
|
1682
|
-
onOpenChange: (
|
|
1683
|
-
|
|
1664
|
+
onOpenChange: (i) => {
|
|
1665
|
+
i || ee(null);
|
|
1684
1666
|
},
|
|
1685
1667
|
showTrigger: !1,
|
|
1686
1668
|
initialMode: ue
|
|
1687
1669
|
}
|
|
1688
1670
|
) : null,
|
|
1689
|
-
d && !
|
|
1690
|
-
!
|
|
1691
|
-
d && !
|
|
1671
|
+
d && !w && be && t && c && /* @__PURE__ */ e(lr, {}),
|
|
1672
|
+
!w && be && t && c && /* @__PURE__ */ e(cr, {}),
|
|
1673
|
+
d && !w && be && h && t && c && /* @__PURE__ */ o(
|
|
1692
1674
|
M,
|
|
1693
1675
|
{
|
|
1694
1676
|
className: "h-7 p-2",
|
|
1695
1677
|
variant: "secondary",
|
|
1696
1678
|
disabled: v,
|
|
1697
|
-
onClick:
|
|
1679
|
+
onClick: Ps,
|
|
1698
1680
|
size: "sm",
|
|
1699
1681
|
children: [
|
|
1700
1682
|
/* @__PURE__ */ e(Ga, { className: "mr-2 h-4 w-4" }),
|
|
@@ -1702,54 +1684,54 @@ function Hr() {
|
|
|
1702
1684
|
]
|
|
1703
1685
|
}
|
|
1704
1686
|
),
|
|
1705
|
-
d && !
|
|
1687
|
+
d && !w && c && /* @__PURE__ */ o(
|
|
1706
1688
|
M,
|
|
1707
1689
|
{
|
|
1708
1690
|
variant: "outline",
|
|
1709
1691
|
className: "h-7 p-2",
|
|
1710
1692
|
size: "sm",
|
|
1711
1693
|
disabled: !d,
|
|
1712
|
-
onClick: () =>
|
|
1694
|
+
onClick: () => Cs(),
|
|
1713
1695
|
children: [
|
|
1714
|
-
/* @__PURE__ */ e(
|
|
1696
|
+
/* @__PURE__ */ e(ca, { className: "mr-2 h-4 w-4" }),
|
|
1715
1697
|
"Visual"
|
|
1716
1698
|
]
|
|
1717
1699
|
}
|
|
1718
1700
|
),
|
|
1719
|
-
!
|
|
1701
|
+
!w && !d && pe && c && /* @__PURE__ */ o(
|
|
1720
1702
|
M,
|
|
1721
1703
|
{
|
|
1722
1704
|
variant: "outline",
|
|
1723
1705
|
className: "h-7 p-2",
|
|
1724
|
-
onClick:
|
|
1706
|
+
onClick: Ms,
|
|
1725
1707
|
size: "sm",
|
|
1726
1708
|
children: [
|
|
1727
|
-
/* @__PURE__ */ e(
|
|
1709
|
+
/* @__PURE__ */ e(Et, { className: "mr-2 h-4 w-4" }),
|
|
1728
1710
|
"Edit"
|
|
1729
1711
|
]
|
|
1730
1712
|
}
|
|
1731
1713
|
),
|
|
1732
|
-
|
|
1714
|
+
Ca && c && Ea && /* @__PURE__ */ o(
|
|
1733
1715
|
M,
|
|
1734
1716
|
{
|
|
1735
1717
|
variant: "outline",
|
|
1736
1718
|
className: "h-7 p-2",
|
|
1737
|
-
onClick:
|
|
1719
|
+
onClick: Ts,
|
|
1738
1720
|
size: "sm",
|
|
1739
1721
|
disabled: ne,
|
|
1740
1722
|
children: [
|
|
1741
|
-
/* @__PURE__ */ e(
|
|
1723
|
+
/* @__PURE__ */ e(At, { className: "mr-2 h-4 w-4" }),
|
|
1742
1724
|
"Undo"
|
|
1743
1725
|
]
|
|
1744
1726
|
}
|
|
1745
1727
|
),
|
|
1746
|
-
|
|
1728
|
+
Ca && c && /* @__PURE__ */ o("div", { className: "relative inline-flex", children: [
|
|
1747
1729
|
/* @__PURE__ */ o(
|
|
1748
1730
|
M,
|
|
1749
1731
|
{
|
|
1750
|
-
className: Y("h-7 p-2",
|
|
1751
|
-
disabled: ne ||
|
|
1752
|
-
onClick: () =>
|
|
1732
|
+
className: Y("h-7 p-2", !$e && "opacity-60"),
|
|
1733
|
+
disabled: ne || !$e,
|
|
1734
|
+
onClick: () => Ve(),
|
|
1753
1735
|
size: "sm",
|
|
1754
1736
|
children: [
|
|
1755
1737
|
ne ? /* @__PURE__ */ e(Z, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(Ga, { className: "mr-2 h-4 w-4" }),
|
|
@@ -1757,7 +1739,7 @@ function Hr() {
|
|
|
1757
1739
|
]
|
|
1758
1740
|
}
|
|
1759
1741
|
),
|
|
1760
|
-
|
|
1742
|
+
$e && !ne && /* @__PURE__ */ e(
|
|
1761
1743
|
"span",
|
|
1762
1744
|
{
|
|
1763
1745
|
"aria-hidden": "true",
|
|
@@ -1765,60 +1747,60 @@ function Hr() {
|
|
|
1765
1747
|
}
|
|
1766
1748
|
)
|
|
1767
1749
|
] }),
|
|
1768
|
-
!
|
|
1750
|
+
!w && d && t && c && /* @__PURE__ */ e("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e(
|
|
1769
1751
|
M,
|
|
1770
1752
|
{
|
|
1771
1753
|
className: "h-7 p-2",
|
|
1772
|
-
onClick: () =>
|
|
1754
|
+
onClick: () => Sa(!ys),
|
|
1773
1755
|
size: "sm",
|
|
1774
1756
|
variant: "ghost",
|
|
1775
|
-
children: /* @__PURE__ */ e(
|
|
1757
|
+
children: /* @__PURE__ */ e(Mt, { className: "h-4 w-4" })
|
|
1776
1758
|
}
|
|
1777
1759
|
) }),
|
|
1778
|
-
!
|
|
1779
|
-
d && !
|
|
1760
|
+
!w && t && /* @__PURE__ */ e(nr, {}),
|
|
1761
|
+
d && !w && c && /* @__PURE__ */ o(
|
|
1780
1762
|
M,
|
|
1781
1763
|
{
|
|
1782
1764
|
variant: "outline",
|
|
1783
1765
|
className: "h-7 p-2",
|
|
1784
|
-
onClick:
|
|
1766
|
+
onClick: ks,
|
|
1785
1767
|
children: [
|
|
1786
|
-
/* @__PURE__ */ e(
|
|
1768
|
+
/* @__PURE__ */ e(za, { className: "mr-2 h-4 w-4" }),
|
|
1787
1769
|
"Close"
|
|
1788
1770
|
]
|
|
1789
1771
|
}
|
|
1790
1772
|
),
|
|
1791
|
-
!
|
|
1792
|
-
/* @__PURE__ */ e(
|
|
1773
|
+
!w && c && /* @__PURE__ */ o(ra, { children: [
|
|
1774
|
+
/* @__PURE__ */ e(na, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1793
1775
|
K,
|
|
1794
1776
|
{
|
|
1795
1777
|
tooltip: "More Options",
|
|
1796
1778
|
className: "h-8 w-8 rounded-md border border-transparent p-0 text-muted-foreground hover:bg-muted/50 hover:text-foreground",
|
|
1797
1779
|
buttonProps: { "aria-label": "More dashboard options" },
|
|
1798
|
-
children: /* @__PURE__ */ e(
|
|
1780
|
+
children: /* @__PURE__ */ e(Lt, { className: "h-4 w-4" })
|
|
1799
1781
|
}
|
|
1800
1782
|
) }),
|
|
1801
1783
|
/* @__PURE__ */ o(
|
|
1802
|
-
|
|
1784
|
+
oa,
|
|
1803
1785
|
{
|
|
1804
1786
|
align: "end",
|
|
1805
1787
|
className: "w-56 rounded-xl border border-border/60 p-1 shadow-sm",
|
|
1806
1788
|
children: [
|
|
1807
|
-
/* @__PURE__ */ e(
|
|
1789
|
+
/* @__PURE__ */ e(we, { className: "px-2.5 text-xs font-medium text-muted-foreground", children: "Automation" }),
|
|
1808
1790
|
/* @__PURE__ */ o(
|
|
1809
1791
|
Q,
|
|
1810
1792
|
{
|
|
1811
1793
|
onClick: () => V(!0),
|
|
1812
1794
|
className: "flex items-center gap-2",
|
|
1813
1795
|
children: [
|
|
1814
|
-
/* @__PURE__ */ e(
|
|
1796
|
+
/* @__PURE__ */ e(kt, { className: "mr-2 h-4 w-4" }),
|
|
1815
1797
|
"Schedule Dashboard"
|
|
1816
1798
|
]
|
|
1817
1799
|
}
|
|
1818
1800
|
),
|
|
1819
|
-
/* @__PURE__ */ e(
|
|
1820
|
-
|
|
1821
|
-
/* @__PURE__ */ e(
|
|
1801
|
+
/* @__PURE__ */ e(We, {}),
|
|
1802
|
+
ws && /* @__PURE__ */ o(I, { children: [
|
|
1803
|
+
/* @__PURE__ */ e(we, { className: "px-2.5 text-xs font-medium text-muted-foreground", children: "Access" }),
|
|
1822
1804
|
/* @__PURE__ */ o(
|
|
1823
1805
|
Q,
|
|
1824
1806
|
{
|
|
@@ -1830,16 +1812,16 @@ function Hr() {
|
|
|
1830
1812
|
]
|
|
1831
1813
|
}
|
|
1832
1814
|
),
|
|
1833
|
-
/* @__PURE__ */ e(
|
|
1815
|
+
/* @__PURE__ */ e(We, {})
|
|
1834
1816
|
] }),
|
|
1835
|
-
/* @__PURE__ */ e(
|
|
1817
|
+
/* @__PURE__ */ e(we, { className: "px-2.5 text-xs font-medium text-muted-foreground", children: "Preferences" }),
|
|
1836
1818
|
/* @__PURE__ */ o(
|
|
1837
1819
|
Q,
|
|
1838
1820
|
{
|
|
1839
1821
|
onClick: () => H(!0),
|
|
1840
1822
|
className: "flex items-center gap-2",
|
|
1841
1823
|
children: [
|
|
1842
|
-
/* @__PURE__ */ e(
|
|
1824
|
+
/* @__PURE__ */ e(It, { className: "mr-2 h-4 w-4" }),
|
|
1843
1825
|
"Calendar Preferences"
|
|
1844
1826
|
]
|
|
1845
1827
|
}
|
|
@@ -1850,7 +1832,7 @@ function Hr() {
|
|
|
1850
1832
|
onClick: () => j(!0),
|
|
1851
1833
|
className: "flex items-center gap-2",
|
|
1852
1834
|
children: [
|
|
1853
|
-
/* @__PURE__ */ e(
|
|
1835
|
+
/* @__PURE__ */ e(Ot, { className: "mr-2 h-4 w-4" }),
|
|
1854
1836
|
"Summary Settings"
|
|
1855
1837
|
]
|
|
1856
1838
|
}
|
|
@@ -1859,23 +1841,23 @@ function Hr() {
|
|
|
1859
1841
|
}
|
|
1860
1842
|
)
|
|
1861
1843
|
] }),
|
|
1862
|
-
S &&
|
|
1863
|
-
|
|
1844
|
+
S && Da && /* @__PURE__ */ e(
|
|
1845
|
+
Tt,
|
|
1864
1846
|
{
|
|
1865
|
-
resource:
|
|
1866
|
-
resourceType:
|
|
1847
|
+
resource: Da,
|
|
1848
|
+
resourceType: je.DASHBOARD,
|
|
1867
1849
|
onClose: () => C(!1)
|
|
1868
1850
|
}
|
|
1869
1851
|
),
|
|
1870
1852
|
/* @__PURE__ */ e(
|
|
1871
|
-
|
|
1853
|
+
Or,
|
|
1872
1854
|
{
|
|
1873
1855
|
open: P,
|
|
1874
1856
|
onOpenChange: U
|
|
1875
1857
|
}
|
|
1876
1858
|
),
|
|
1877
1859
|
(r == null ? void 0 : r.id) && /* @__PURE__ */ e(
|
|
1878
|
-
|
|
1860
|
+
_t,
|
|
1879
1861
|
{
|
|
1880
1862
|
open: _,
|
|
1881
1863
|
onOpenChange: V,
|
|
@@ -1884,44 +1866,44 @@ function Hr() {
|
|
|
1884
1866
|
}
|
|
1885
1867
|
),
|
|
1886
1868
|
/* @__PURE__ */ e(
|
|
1887
|
-
|
|
1869
|
+
Qt,
|
|
1888
1870
|
{
|
|
1889
1871
|
open: q,
|
|
1890
1872
|
onOpenChange: H
|
|
1891
1873
|
}
|
|
1892
1874
|
),
|
|
1893
1875
|
/* @__PURE__ */ e(
|
|
1894
|
-
|
|
1876
|
+
Wt,
|
|
1895
1877
|
{
|
|
1896
|
-
open:
|
|
1878
|
+
open: D,
|
|
1897
1879
|
onOpenChange: j,
|
|
1898
1880
|
dashboard: r,
|
|
1899
1881
|
disabled: !d,
|
|
1900
|
-
onApply: (
|
|
1882
|
+
onApply: (i) => Ge({
|
|
1901
1883
|
...r,
|
|
1902
|
-
summary:
|
|
1884
|
+
summary: i
|
|
1903
1885
|
})
|
|
1904
1886
|
}
|
|
1905
1887
|
),
|
|
1906
1888
|
/* @__PURE__ */ e(
|
|
1907
|
-
|
|
1889
|
+
Ya,
|
|
1908
1890
|
{
|
|
1909
|
-
open:
|
|
1910
|
-
onOpenChange: (
|
|
1911
|
-
!
|
|
1891
|
+
open: ke,
|
|
1892
|
+
onOpenChange: (i) => {
|
|
1893
|
+
!i && _e && !E || (g(i), i || (O(null), z([]), me(!1)));
|
|
1912
1894
|
},
|
|
1913
|
-
children: /* @__PURE__ */ o(
|
|
1914
|
-
/* @__PURE__ */ o(
|
|
1915
|
-
/* @__PURE__ */ e(
|
|
1916
|
-
/* @__PURE__ */ e(
|
|
1895
|
+
children: /* @__PURE__ */ o(Za, { className: "max-w-sm", children: [
|
|
1896
|
+
/* @__PURE__ */ o(es, { children: [
|
|
1897
|
+
/* @__PURE__ */ e(as, { children: E ? "Save failed" : "Saving dashboard" }),
|
|
1898
|
+
/* @__PURE__ */ e(ss, { className: "pt-2", children: E ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
|
|
1917
1899
|
F.length > 0 && /* @__PURE__ */ o("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
|
|
1918
1900
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
|
|
1919
|
-
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: F.slice(0, 5).map((
|
|
1901
|
+
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: F.slice(0, 5).map((i) => /* @__PURE__ */ e("li", { children: i }, i)) })
|
|
1920
1902
|
] })
|
|
1921
1903
|
] }),
|
|
1922
|
-
/* @__PURE__ */ e(
|
|
1904
|
+
/* @__PURE__ */ e(ts, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: E ? /* @__PURE__ */ o(I, { children: [
|
|
1923
1905
|
/* @__PURE__ */ e(
|
|
1924
|
-
|
|
1906
|
+
rs,
|
|
1925
1907
|
{
|
|
1926
1908
|
onClick: () => {
|
|
1927
1909
|
g(!1), O(null), z([]), me(!1);
|
|
@@ -1931,18 +1913,18 @@ function Hr() {
|
|
|
1931
1913
|
}
|
|
1932
1914
|
),
|
|
1933
1915
|
/* @__PURE__ */ e(
|
|
1934
|
-
|
|
1916
|
+
aa,
|
|
1935
1917
|
{
|
|
1936
|
-
onClick: () =>
|
|
1918
|
+
onClick: () => Ve({
|
|
1937
1919
|
closeAfterSave: ae,
|
|
1938
|
-
navigateHomeAfterSave:
|
|
1920
|
+
navigateHomeAfterSave: Ue === "home"
|
|
1939
1921
|
}),
|
|
1940
1922
|
className: "m-0",
|
|
1941
1923
|
children: "Retry"
|
|
1942
1924
|
}
|
|
1943
1925
|
)
|
|
1944
1926
|
] }) : /* @__PURE__ */ o(
|
|
1945
|
-
|
|
1927
|
+
aa,
|
|
1946
1928
|
{
|
|
1947
1929
|
disabled: !0,
|
|
1948
1930
|
className: "m-0 cursor-default",
|
|
@@ -1956,15 +1938,15 @@ function Hr() {
|
|
|
1956
1938
|
}
|
|
1957
1939
|
),
|
|
1958
1940
|
/* @__PURE__ */ e(
|
|
1959
|
-
|
|
1941
|
+
Bt,
|
|
1960
1942
|
{
|
|
1961
|
-
open:
|
|
1962
|
-
onOpenChange: (
|
|
1963
|
-
te(
|
|
1943
|
+
open: Es,
|
|
1944
|
+
onOpenChange: (i) => {
|
|
1945
|
+
te(i);
|
|
1964
1946
|
},
|
|
1965
|
-
onSave:
|
|
1966
|
-
onDiscard:
|
|
1967
|
-
isSaving:
|
|
1947
|
+
onSave: Is,
|
|
1948
|
+
onDiscard: Os,
|
|
1949
|
+
isSaving: _e,
|
|
1968
1950
|
saveLabel: "Save",
|
|
1969
1951
|
discardLabel: "Discard"
|
|
1970
1952
|
}
|
|
@@ -1975,5 +1957,5 @@ function Hr() {
|
|
|
1975
1957
|
);
|
|
1976
1958
|
}
|
|
1977
1959
|
export {
|
|
1978
|
-
|
|
1960
|
+
zr as default
|
|
1979
1961
|
};
|