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