react-semaphor 0.1.426 → 0.1.428
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/CHANGELOG.md +5 -0
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +1 -1
- package/dist/chunks/{calendar-preferences-dialog-tBSngRN-.js → calendar-preferences-dialog-BF9bNAF_.js} +2 -2
- package/dist/chunks/{calendar-preferences-dialog-C-gN-vlq.js → calendar-preferences-dialog-_L9eBQfj.js} +1 -1
- package/dist/chunks/{code-editor-tfzm8LWW.js → code-editor-BoowcKU0.js} +23 -23
- package/dist/chunks/{code-editor-Pod1s6SK.js → code-editor-CojfM3qp.js} +772 -757
- package/dist/chunks/{dashboard-ZoKNg47G.js → dashboard-509sbC4_.js} +30989 -30715
- package/dist/chunks/dashboard-CMDXBLnG.js +1402 -0
- package/dist/chunks/{dashboard-briefing-launcher-0kR-QThz.js → dashboard-briefing-launcher-B-ZTWJwo.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-BE-sNAzW.js → dashboard-briefing-launcher-DIdYHNTq.js} +3 -3
- package/dist/chunks/{dashboard-controls-BUYTVauu.js → dashboard-controls-CWprw-Pb.js} +8 -8
- package/dist/chunks/{dashboard-controls-Ce_Bps8f.js → dashboard-controls-CbRzWo1N.js} +543 -534
- package/dist/chunks/{dashboard-json-81uc8aVR.js → dashboard-json-BEZrxx_k.js} +1 -1
- package/dist/chunks/{dashboard-json-4quaFoSw.js → dashboard-json-jO4GQfZk.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-nVRXv1Lq.js → edit-dashboard-visual-D3uhqgm3.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DqQsH7rN.js → edit-dashboard-visual-KgQTjqWp.js} +302 -302
- package/dist/chunks/{use-create-flow-overlay-state-CoANTEXS.js → use-create-flow-overlay-state-BiMYdjZP.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-DUVIsF0y.js → use-create-flow-overlay-state-CGsLzp9A.js} +2 -2
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +6 -6
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/main.d.ts +19 -0
- package/dist/types/types.d.ts +18 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-JNK2ly_e.js +0 -1402
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { u as D, B as U, aw as
|
|
3
|
-
import { bA as
|
|
4
|
-
import { c as Z, X as
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import { u as D, B as U, aw as dt, D as Zt, L as za, Z as _a, c as ge, ax as lt, ay as qa, az as Ha, aA as ea, aB as be, aC as ct, aD as ta, e as Be, aE as aa, aF as ja, F as Gt, Q as Ka, V as Qa, W as Wa, Y as Ja, p as Xa, aG as Ya } from "./code-editor-CojfM3qp.js";
|
|
3
|
+
import { bA as Za, bB as er, u as z, b as ra, bC as tr, aX as H, c as sa, d as ar, e as st, f as nt, o as rr, bD as fe, bE as Te, bF as sr, bG as $t, bH as na, bI as oa, bJ as nr, bK as ut, bL as or, bM as ir, bN as dr, bO as lr, bP as cr, bQ as ur, b6 as xe, bR as ve, p as C, bS as mr, bT as ia, bp as mt, bU as pr, bV as hr, bW as da, bX as fr, bY as la, bZ as O, b_ as gr, au as br, b$ as xr, c0 as vr, c1 as yr, ay as wr, aG as Fe, aH as Nr, O as at, c2 as Dr, c3 as Cr, c4 as kr, c5 as Sr, at as Ir, c6 as Mr, c7 as Er, I as zt, c8 as Ar, c9 as Lr, ca as Pr, cb as Ur, cc as Rr, cd as _t, ce as qt, cf as Ht, cg as Vr, ch as Fr, ci as Or, cj as Tr, a$ as jt, ck as Br, cl as Gr, cm as $r, Q as zr, cn as _r, aN as qr, aQ as Hr, aR as jr, aS as Kr, aT as Qr, aU as Wr, aV as Jr, aW as Kt, w as ot } from "./dashboard-509sbC4_.js";
|
|
4
|
+
import { c as Z, X as ca, C as Xr } from "./index-xHCrHprY.js";
|
|
5
5
|
import "./analyze-result-contract-DnfF8kBb.js";
|
|
6
6
|
import * as L from "react";
|
|
7
|
-
import { useState as N, useMemo as Y, useEffect as
|
|
7
|
+
import { useState as N, useMemo as Y, useEffect as Ge, useRef as Qt, useLayoutEffect as Yr, useCallback as Zr } from "react";
|
|
8
8
|
import "./index-If0wlXGi.js";
|
|
9
9
|
import "./comparison-document-migration-BJH1idOd.js";
|
|
10
|
-
import { createPortal as
|
|
10
|
+
import { createPortal as es } from "react-dom";
|
|
11
11
|
import "../briefings/index.js";
|
|
12
|
-
import { g as
|
|
13
|
-
import { S as
|
|
14
|
-
import { d as
|
|
15
|
-
import { C as
|
|
16
|
-
import { u as
|
|
17
|
-
import { s as
|
|
18
|
-
import { S as
|
|
19
|
-
import { P as
|
|
20
|
-
import { B as
|
|
12
|
+
import { g as ts, u as as, A as rs, V as ss, c as ns, f as os, N as is, D as ds, U as ls } from "./dashboard-briefing-launcher-DIdYHNTq.js";
|
|
13
|
+
import { S as cs, C as us } from "./search-DHZCro8B.js";
|
|
14
|
+
import { d as ua } from "./index-CnujJ3fa.js";
|
|
15
|
+
import { C as ms } from "./calendar-preferences-dialog-BF9bNAF_.js";
|
|
16
|
+
import { u as ps } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
17
|
+
import { s as rt } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
|
|
18
|
+
import { S as Wt } from "./save-HCJjjzdX.js";
|
|
19
|
+
import { P as hs } from "./palette-jqaAcwiQ.js";
|
|
20
|
+
import { B as fs } from "./braces-BdbUk_r9.js";
|
|
21
21
|
/**
|
|
22
22
|
* @license lucide-react v0.453.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
26
|
*/
|
|
27
|
-
const
|
|
27
|
+
const gs = Z("Glasses", [
|
|
28
28
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
29
29
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
30
30
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -37,7 +37,7 @@ const hn = Z("Glasses", [
|
|
|
37
37
|
* This source code is licensed under the ISC license.
|
|
38
38
|
* See the LICENSE file in the root directory of this source tree.
|
|
39
39
|
*/
|
|
40
|
-
const
|
|
40
|
+
const bs = Z("Monitor", [
|
|
41
41
|
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
42
42
|
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
43
43
|
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
@@ -48,7 +48,7 @@ const fn = Z("Monitor", [
|
|
|
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 xs = Z("Moon", [
|
|
52
52
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
53
53
|
]);
|
|
54
54
|
/**
|
|
@@ -57,7 +57,7 @@ const gn = Z("Moon", [
|
|
|
57
57
|
* This source code is licensed under the ISC license.
|
|
58
58
|
* See the LICENSE file in the root directory of this source tree.
|
|
59
59
|
*/
|
|
60
|
-
const
|
|
60
|
+
const vs = Z("ShieldX", [
|
|
61
61
|
[
|
|
62
62
|
"path",
|
|
63
63
|
{
|
|
@@ -74,7 +74,7 @@ const bn = Z("ShieldX", [
|
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
75
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
76
76
|
*/
|
|
77
|
-
const
|
|
77
|
+
const ys = Z("Sun", [
|
|
78
78
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
79
79
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
80
80
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -91,7 +91,7 @@ const xn = Z("Sun", [
|
|
|
91
91
|
* This source code is licensed under the ISC license.
|
|
92
92
|
* See the LICENSE file in the root directory of this source tree.
|
|
93
93
|
*/
|
|
94
|
-
const
|
|
94
|
+
const ws = Z("UserPlus", [
|
|
95
95
|
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
96
96
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
97
97
|
["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
|
|
@@ -103,19 +103,19 @@ const vn = Z("UserPlus", [
|
|
|
103
103
|
* This source code is licensed under the ISC license.
|
|
104
104
|
* See the LICENSE file in the root directory of this source tree.
|
|
105
105
|
*/
|
|
106
|
-
const
|
|
106
|
+
const ma = Z("UserRound", [
|
|
107
107
|
["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
|
|
108
108
|
["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
|
|
109
|
-
]),
|
|
110
|
-
function
|
|
111
|
-
const { theme: t, setTheme:
|
|
109
|
+
]), Oe = ["light", "dark", "system"];
|
|
110
|
+
function Ns() {
|
|
111
|
+
const { theme: t, setTheme: s } = Za(), r = D(
|
|
112
112
|
(h) => h.actions.setDashboardTheme
|
|
113
113
|
);
|
|
114
114
|
function a() {
|
|
115
|
-
const h =
|
|
116
|
-
|
|
115
|
+
const h = Oe.includes(t) ? t : "system", m = Oe[(Oe.indexOf(h) + 1) % Oe.length];
|
|
116
|
+
s(m), r(m);
|
|
117
117
|
}
|
|
118
|
-
const o = t === "light" ?
|
|
118
|
+
const o = t === "light" ? ys : t === "dark" ? xs : bs, l = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
|
|
119
119
|
return /* @__PURE__ */ e(
|
|
120
120
|
U,
|
|
121
121
|
{
|
|
@@ -130,13 +130,13 @@ function yn() {
|
|
|
130
130
|
}
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
const
|
|
133
|
+
function pa(t) {
|
|
134
|
+
const s = (/* @__PURE__ */ new Date()).toISOString(), r = er({
|
|
135
135
|
dashboard: t.dashboard,
|
|
136
136
|
sheetIds: (t.dashboard.sheets || []).filter((a) => a.kind !== "document").map((a) => a.id),
|
|
137
137
|
sheetKind: "dashboard",
|
|
138
138
|
mode: "dashboard",
|
|
139
|
-
generatedAt:
|
|
139
|
+
generatedAt: s,
|
|
140
140
|
runtimeValues: {
|
|
141
141
|
dashboardInputValues: t.dashboardInputValues,
|
|
142
142
|
filterValues: t.filterValues,
|
|
@@ -146,23 +146,23 @@ function ma(t) {
|
|
|
146
146
|
}
|
|
147
147
|
}).snapshot;
|
|
148
148
|
return {
|
|
149
|
-
generatedAt:
|
|
149
|
+
generatedAt: s,
|
|
150
150
|
dashboardInputValues: r.dashboardInputValues
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function Ds(t, s, r, a, o, l) {
|
|
154
154
|
if (!l)
|
|
155
155
|
return null;
|
|
156
156
|
const h = JSON.stringify(r), m = `${t}/v1/lens`;
|
|
157
|
-
return await
|
|
158
|
-
name:
|
|
157
|
+
return await dt(m, l, {
|
|
158
|
+
name: s,
|
|
159
159
|
template: h,
|
|
160
160
|
filterValues: a,
|
|
161
161
|
inputValues: o,
|
|
162
162
|
operation: "create"
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
|
-
async function
|
|
165
|
+
async function it(t, s, r) {
|
|
166
166
|
if (!r)
|
|
167
167
|
return null;
|
|
168
168
|
const {
|
|
@@ -172,8 +172,8 @@ async function ot(t, n, r) {
|
|
|
172
172
|
inputValues: h,
|
|
173
173
|
isDefault: m,
|
|
174
174
|
shared: p
|
|
175
|
-
} =
|
|
176
|
-
return await
|
|
175
|
+
} = s, v = `${t}/v1/lens`;
|
|
176
|
+
return await dt(v, r, {
|
|
177
177
|
lensId: a,
|
|
178
178
|
template: o,
|
|
179
179
|
filterValues: l,
|
|
@@ -183,33 +183,33 @@ async function ot(t, n, r) {
|
|
|
183
183
|
operation: "update"
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
|
-
async function
|
|
186
|
+
async function Cs(t, s, r) {
|
|
187
187
|
if (!r)
|
|
188
188
|
return null;
|
|
189
189
|
const a = `${t}/v1/lens`;
|
|
190
|
-
return await
|
|
190
|
+
return await dt(a, r, {
|
|
191
191
|
operation: "delete",
|
|
192
|
-
lensId:
|
|
192
|
+
lensId: s
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
const
|
|
196
|
-
function
|
|
195
|
+
const ks = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
196
|
+
function Ss({
|
|
197
197
|
open: t,
|
|
198
|
-
onOpenChange:
|
|
198
|
+
onOpenChange: s
|
|
199
199
|
} = {}) {
|
|
200
|
-
const [r, a] = N(""), [o, l] = N(!1), h = D((x) => x.lenses), { setLenses: m, setSelectedLensId: p } =
|
|
201
|
-
f || b(x),
|
|
200
|
+
const [r, a] = N(""), [o, l] = N(!1), h = D((x) => x.lenses), { setLenses: m, setSelectedLensId: p } = Zt(), [v, d] = N(!1), [u, b] = N(!1), f = t !== void 0, w = f ? t : u, y = (x) => {
|
|
201
|
+
f || b(x), s == null || s(x);
|
|
202
202
|
}, c = D((x) => x.dashboard), M = D((x) => x.filterValues), { authToken: S, tokenProps: P } = z();
|
|
203
203
|
async function k() {
|
|
204
204
|
d(!0);
|
|
205
|
-
const x = D.getState(), _ =
|
|
205
|
+
const x = D.getState(), _ = pa({
|
|
206
206
|
dashboard: c,
|
|
207
207
|
dashboardInputValues: x.dashboardInputValues,
|
|
208
208
|
filterValues: M,
|
|
209
209
|
controlValues: x.controlValues,
|
|
210
210
|
inlineFilterValuesMap: x.inlineFilterValuesMap,
|
|
211
211
|
cardControlValuesMap: x.cardControlValuesMap
|
|
212
|
-
}), q = await
|
|
212
|
+
}), q = await Ds(
|
|
213
213
|
P.apiServiceUrl,
|
|
214
214
|
r,
|
|
215
215
|
c,
|
|
@@ -219,20 +219,20 @@ function Cn({
|
|
|
219
219
|
);
|
|
220
220
|
q && (m([...h || [], q]), p(q.id), y(!1)), d(!1);
|
|
221
221
|
}
|
|
222
|
-
return /* @__PURE__ */
|
|
223
|
-
f ? null : /* @__PURE__ */ e(
|
|
222
|
+
return /* @__PURE__ */ n(ra, { open: w, onOpenChange: y, children: [
|
|
223
|
+
f ? null : /* @__PURE__ */ e(tr, { asChild: !0, children: /* @__PURE__ */ n(U, { variant: "secondary", size: "xs", children: [
|
|
224
224
|
/* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
|
|
225
225
|
"Lens"
|
|
226
226
|
] }) }),
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */ e(
|
|
227
|
+
/* @__PURE__ */ n(sa, { className: "rounded-control border-border/60 sm:max-w-[420px] sm:rounded-control", children: [
|
|
228
|
+
/* @__PURE__ */ n(ar, { children: [
|
|
229
|
+
/* @__PURE__ */ e(st, { className: "text-[15px]", children: "Create lens" }),
|
|
230
230
|
/* @__PURE__ */ e(nt, { className: "text-[13px] leading-5", children: "Lenses are private by default and are only visible to you." })
|
|
231
231
|
] }),
|
|
232
|
-
/* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */ e(
|
|
232
|
+
/* @__PURE__ */ n("div", { className: "space-y-1.5 py-1", children: [
|
|
233
|
+
/* @__PURE__ */ e(za, { htmlFor: "lens-name", className: ks, children: "Name" }),
|
|
234
234
|
/* @__PURE__ */ e(
|
|
235
|
-
|
|
235
|
+
_a,
|
|
236
236
|
{
|
|
237
237
|
id: "lens-name",
|
|
238
238
|
size: "xs",
|
|
@@ -243,7 +243,7 @@ function Cn({
|
|
|
243
243
|
),
|
|
244
244
|
o && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: "A lens with this name already exists. Pick a different one." })
|
|
245
245
|
] }),
|
|
246
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ n(rr, { children: [
|
|
247
247
|
/* @__PURE__ */ e(U, { variant: "outline", size: "xs", onClick: () => y(!1), children: "Cancel" }),
|
|
248
248
|
/* @__PURE__ */ e(
|
|
249
249
|
U,
|
|
@@ -259,19 +259,19 @@ function Cn({
|
|
|
259
259
|
] })
|
|
260
260
|
] });
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
const
|
|
262
|
+
function Is({ includeLabel: t = !1 } = {}) {
|
|
263
|
+
const s = D((d) => d.lenses), r = D((d) => d.selectedLensId), { setLenses: a, setSelectedLensId: o } = Zt(), { authToken: l, tokenProps: h } = z();
|
|
264
264
|
async function m(d) {
|
|
265
265
|
o(d);
|
|
266
266
|
}
|
|
267
267
|
async function p(d) {
|
|
268
|
-
if (await
|
|
269
|
-
const b =
|
|
268
|
+
if (await Cs(h.apiServiceUrl, d, l == null ? void 0 : l.accessToken)) {
|
|
269
|
+
const b = s == null ? void 0 : s.filter((f) => f.id !== d);
|
|
270
270
|
a(b || []), o("original");
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
async function v(d) {
|
|
274
|
-
const u =
|
|
274
|
+
const u = s == null ? void 0 : s.map((w) => w.id === d.id ? {
|
|
275
275
|
...w,
|
|
276
276
|
isDefault: !d.isDefault
|
|
277
277
|
} : {
|
|
@@ -283,36 +283,36 @@ function kn({ includeLabel: t = !1 } = {}) {
|
|
|
283
283
|
...d,
|
|
284
284
|
isDefault: !d.isDefault
|
|
285
285
|
};
|
|
286
|
-
await
|
|
287
|
-
const f =
|
|
286
|
+
await it(h.apiServiceUrl, b, l == null ? void 0 : l.accessToken);
|
|
287
|
+
const f = s == null ? void 0 : s.find((w) => w.isDefault);
|
|
288
288
|
if (f && f.id !== d.id) {
|
|
289
289
|
const w = {
|
|
290
290
|
...f,
|
|
291
291
|
isDefault: !1
|
|
292
292
|
};
|
|
293
|
-
await
|
|
293
|
+
await it(h.apiServiceUrl, w, l == null ? void 0 : l.accessToken);
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
return /* @__PURE__ */
|
|
297
|
-
t ? /* @__PURE__ */
|
|
296
|
+
return /* @__PURE__ */ n(T, { children: [
|
|
297
|
+
t ? /* @__PURE__ */ n(T, { children: [
|
|
298
298
|
/* @__PURE__ */ e(fe, { className: "px-3", children: "Lenses" }),
|
|
299
|
-
/* @__PURE__ */ e(
|
|
299
|
+
/* @__PURE__ */ e(Te, {})
|
|
300
300
|
] }) : null,
|
|
301
|
-
/* @__PURE__ */
|
|
302
|
-
|
|
301
|
+
/* @__PURE__ */ n(
|
|
302
|
+
sr,
|
|
303
303
|
{
|
|
304
304
|
value: r,
|
|
305
305
|
onValueChange: m,
|
|
306
306
|
children: [
|
|
307
|
-
/* @__PURE__ */ e(
|
|
308
|
-
|
|
309
|
-
|
|
307
|
+
/* @__PURE__ */ e($t, { value: "original", children: "Original" }),
|
|
308
|
+
s == null ? void 0 : s.map((d) => /* @__PURE__ */ n(
|
|
309
|
+
$t,
|
|
310
310
|
{
|
|
311
311
|
className: "group flex justify-between gap-2",
|
|
312
312
|
value: d.id,
|
|
313
313
|
children: [
|
|
314
314
|
/* @__PURE__ */ e("p", { children: d.name }),
|
|
315
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ n("span", { className: "flex items-center gap-3", children: [
|
|
316
316
|
/* @__PURE__ */ e(
|
|
317
317
|
na,
|
|
318
318
|
{
|
|
@@ -330,7 +330,7 @@ function kn({ includeLabel: t = !1 } = {}) {
|
|
|
330
330
|
}
|
|
331
331
|
),
|
|
332
332
|
/* @__PURE__ */ e(
|
|
333
|
-
|
|
333
|
+
oa,
|
|
334
334
|
{
|
|
335
335
|
onClick: (u) => {
|
|
336
336
|
u.preventDefault(), p(d.id);
|
|
@@ -349,19 +349,19 @@ function kn({ includeLabel: t = !1 } = {}) {
|
|
|
349
349
|
)
|
|
350
350
|
] });
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
const { displayPreferences: t, shouldShowElement:
|
|
354
|
-
() =>
|
|
352
|
+
function Ms() {
|
|
353
|
+
const { displayPreferences: t, shouldShowElement: s } = nr(), { currentUser: r, userContext: a } = ut(), o = Y(
|
|
354
|
+
() => or(r),
|
|
355
355
|
[r]
|
|
356
|
-
), l = Y(() => (m) => o && o[m] !== void 0 && o[m] === !1 ? !1 :
|
|
356
|
+
), l = Y(() => (m) => o && o[m] !== void 0 && o[m] === !1 ? !1 : s(m), [o, s, t]), h = Y(
|
|
357
357
|
() => {
|
|
358
358
|
var m, p, v, d, u;
|
|
359
359
|
return {
|
|
360
|
-
canEdit: ((m = a == null ? void 0 : a.permissions) == null ? void 0 : m.canEdit) ??
|
|
361
|
-
canUseFilters: ((p = a == null ? void 0 : a.permissions) == null ? void 0 : p.canEdit) ??
|
|
362
|
-
canManageDashboards: ((v = a == null ? void 0 : a.permissions) == null ? void 0 : v.canCreateDashboard) ??
|
|
363
|
-
canCreateDashboards: ((d = a == null ? void 0 : a.permissions) == null ? void 0 : d.canCreateDashboard) ??
|
|
364
|
-
canAccessVisuals: ((u = a == null ? void 0 : a.permissions) == null ? void 0 : u.canEdit) ??
|
|
360
|
+
canEdit: ((m = a == null ? void 0 : a.permissions) == null ? void 0 : m.canEdit) ?? ur(r),
|
|
361
|
+
canUseFilters: ((p = a == null ? void 0 : a.permissions) == null ? void 0 : p.canEdit) ?? cr(r),
|
|
362
|
+
canManageDashboards: ((v = a == null ? void 0 : a.permissions) == null ? void 0 : v.canCreateDashboard) ?? lr(r),
|
|
363
|
+
canCreateDashboards: ((d = a == null ? void 0 : a.permissions) == null ? void 0 : d.canCreateDashboard) ?? dr(r),
|
|
364
|
+
canAccessVisuals: ((u = a == null ? void 0 : a.permissions) == null ? void 0 : u.canEdit) ?? ir(r)
|
|
365
365
|
};
|
|
366
366
|
},
|
|
367
367
|
[r, a]
|
|
@@ -373,152 +373,152 @@ function Sn() {
|
|
|
373
373
|
currentUser: r
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
|
-
var
|
|
376
|
+
var pt = "Avatar", [Es] = qa(pt), As = [
|
|
377
377
|
0,
|
|
378
378
|
() => {
|
|
379
379
|
}
|
|
380
|
-
], [
|
|
381
|
-
(t,
|
|
382
|
-
const { __scopeAvatar: r, ...a } = t, [o, l] = L.useState("idle"), [h, m] =
|
|
380
|
+
], [Ls, ha] = Es(pt), ht = L.forwardRef(
|
|
381
|
+
(t, s) => {
|
|
382
|
+
const { __scopeAvatar: r, ...a } = t, [o, l] = L.useState("idle"), [h, m] = Us();
|
|
383
383
|
return /* @__PURE__ */ e(
|
|
384
|
-
|
|
384
|
+
Ls,
|
|
385
385
|
{
|
|
386
386
|
scope: r,
|
|
387
387
|
imageLoadingStatus: o,
|
|
388
388
|
setImageLoadingStatus: l,
|
|
389
389
|
imageCount: h,
|
|
390
390
|
setImageCount: m,
|
|
391
|
-
children: /* @__PURE__ */ e(
|
|
391
|
+
children: /* @__PURE__ */ e(lt.span, { ...a, ref: s })
|
|
392
392
|
}
|
|
393
393
|
);
|
|
394
394
|
}
|
|
395
395
|
);
|
|
396
|
-
|
|
397
|
-
var
|
|
398
|
-
(t,
|
|
399
|
-
const { __scopeAvatar: r, src: a, onLoadingStatusChange: o, ...l } = t, h =
|
|
400
|
-
|
|
401
|
-
const m =
|
|
396
|
+
ht.displayName = pt;
|
|
397
|
+
var fa = "AvatarImage", ft = L.forwardRef(
|
|
398
|
+
(t, s) => {
|
|
399
|
+
const { __scopeAvatar: r, src: a, onLoadingStatusChange: o, ...l } = t, h = ha(fa, r);
|
|
400
|
+
Rs(h.setImageCount);
|
|
401
|
+
const m = Ps(a, {
|
|
402
402
|
referrerPolicy: l.referrerPolicy,
|
|
403
403
|
crossOrigin: l.crossOrigin,
|
|
404
404
|
loadingStatus: h.imageLoadingStatus,
|
|
405
405
|
setLoadingStatus: h.setImageLoadingStatus
|
|
406
|
-
}), p =
|
|
406
|
+
}), p = Ha((d) => {
|
|
407
407
|
o == null || o(d);
|
|
408
408
|
}), v = L.useRef(m);
|
|
409
|
-
return
|
|
409
|
+
return ea(() => {
|
|
410
410
|
const d = v.current;
|
|
411
411
|
v.current = m, m !== d && p(m);
|
|
412
|
-
}, [m, p]), m === "loaded" ? /* @__PURE__ */ e(
|
|
412
|
+
}, [m, p]), m === "loaded" ? /* @__PURE__ */ e(lt.img, { ...l, ref: s, src: a }) : null;
|
|
413
413
|
}
|
|
414
414
|
);
|
|
415
|
-
|
|
416
|
-
var
|
|
417
|
-
(t,
|
|
418
|
-
const { __scopeAvatar: r, delayMs: a, ...o } = t, l =
|
|
415
|
+
ft.displayName = fa;
|
|
416
|
+
var ga = "AvatarFallback", gt = L.forwardRef(
|
|
417
|
+
(t, s) => {
|
|
418
|
+
const { __scopeAvatar: r, delayMs: a, ...o } = t, l = ha(ga, r), [h, m] = L.useState(a === void 0);
|
|
419
419
|
return L.useEffect(() => {
|
|
420
420
|
if (a !== void 0) {
|
|
421
421
|
const p = window.setTimeout(() => m(!0), a);
|
|
422
422
|
return () => window.clearTimeout(p);
|
|
423
423
|
}
|
|
424
|
-
}, [a]), h && l.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(
|
|
424
|
+
}, [a]), h && l.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(lt.span, { ...o, ref: s }) : null;
|
|
425
425
|
}
|
|
426
426
|
);
|
|
427
|
-
|
|
428
|
-
function
|
|
429
|
-
loadingStatus:
|
|
427
|
+
gt.displayName = ga;
|
|
428
|
+
function Ps(t, {
|
|
429
|
+
loadingStatus: s,
|
|
430
430
|
setLoadingStatus: r,
|
|
431
431
|
referrerPolicy: a,
|
|
432
432
|
crossOrigin: o
|
|
433
433
|
}) {
|
|
434
|
-
return
|
|
434
|
+
return ea(() => {
|
|
435
435
|
if (!t) {
|
|
436
436
|
r("error");
|
|
437
437
|
return;
|
|
438
438
|
}
|
|
439
439
|
const l = new window.Image(), h = (p) => {
|
|
440
440
|
const v = p.currentTarget;
|
|
441
|
-
r(
|
|
441
|
+
r(Jt(v));
|
|
442
442
|
}, m = () => r("error");
|
|
443
|
-
return l.addEventListener("load", h), l.addEventListener("error", m), a && (l.referrerPolicy = a), l.crossOrigin = o ?? null, l.src = t, r(
|
|
443
|
+
return l.addEventListener("load", h), l.addEventListener("error", m), a && (l.referrerPolicy = a), l.crossOrigin = o ?? null, l.src = t, r(Jt(l)), () => {
|
|
444
444
|
l.removeEventListener("load", h), l.removeEventListener("error", m), r("idle");
|
|
445
445
|
};
|
|
446
|
-
}, [t, o, a, r]),
|
|
446
|
+
}, [t, o, a, r]), s;
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function Jt(t) {
|
|
449
449
|
return t.complete ? t.naturalWidth > 0 ? "loaded" : "error" : "loading";
|
|
450
450
|
}
|
|
451
|
-
function
|
|
452
|
-
let t =
|
|
451
|
+
function Us() {
|
|
452
|
+
let t = As;
|
|
453
453
|
{
|
|
454
454
|
t = L.useState(0);
|
|
455
|
-
const [
|
|
455
|
+
const [s] = t, r = L.useRef(!1);
|
|
456
456
|
L.useEffect(() => {
|
|
457
|
-
|
|
457
|
+
s > 1 && !r.current && (r.current = !0, console.warn(
|
|
458
458
|
"Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior."
|
|
459
459
|
));
|
|
460
|
-
}, [
|
|
460
|
+
}, [s]);
|
|
461
461
|
}
|
|
462
462
|
return t;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
465
|
-
L.useEffect(() => (t((
|
|
466
|
-
t((
|
|
464
|
+
function Rs(t) {
|
|
465
|
+
L.useEffect(() => (t((s) => s + 1), () => {
|
|
466
|
+
t((s) => s - 1);
|
|
467
467
|
}), [t]);
|
|
468
468
|
}
|
|
469
|
-
const
|
|
470
|
-
|
|
469
|
+
const ba = L.forwardRef(({ className: t, ...s }, r) => /* @__PURE__ */ e(
|
|
470
|
+
ht,
|
|
471
471
|
{
|
|
472
472
|
ref: r,
|
|
473
473
|
className: ge(
|
|
474
474
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
475
475
|
t
|
|
476
476
|
),
|
|
477
|
-
...
|
|
477
|
+
...s
|
|
478
478
|
}
|
|
479
479
|
));
|
|
480
|
-
|
|
481
|
-
const
|
|
482
|
-
|
|
480
|
+
ba.displayName = ht.displayName;
|
|
481
|
+
const Vs = L.forwardRef(({ className: t, ...s }, r) => /* @__PURE__ */ e(
|
|
482
|
+
ft,
|
|
483
483
|
{
|
|
484
484
|
ref: r,
|
|
485
485
|
className: ge("aspect-square h-full w-full", t),
|
|
486
|
-
...
|
|
486
|
+
...s
|
|
487
487
|
}
|
|
488
488
|
));
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
|
|
489
|
+
Vs.displayName = ft.displayName;
|
|
490
|
+
const xa = L.forwardRef(({ className: t, ...s }, r) => /* @__PURE__ */ e(
|
|
491
|
+
gt,
|
|
492
492
|
{
|
|
493
493
|
ref: r,
|
|
494
494
|
className: ge(
|
|
495
495
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
496
496
|
t
|
|
497
497
|
),
|
|
498
|
-
...
|
|
498
|
+
...s
|
|
499
499
|
}
|
|
500
500
|
));
|
|
501
|
-
|
|
502
|
-
const
|
|
501
|
+
xa.displayName = gt.displayName;
|
|
502
|
+
const Fs = async (t, s, r) => {
|
|
503
503
|
const a = `${t}/management/v1/groups`;
|
|
504
|
-
return await
|
|
505
|
-
},
|
|
504
|
+
return await ta(a, s, r);
|
|
505
|
+
}, Os = async (t, s, r, a) => {
|
|
506
506
|
const o = `${t}/management/v1/groups/${r}`;
|
|
507
|
-
return
|
|
508
|
-
},
|
|
507
|
+
return ct(o, s, "PATCH", a);
|
|
508
|
+
}, Ts = async (t, s, r) => {
|
|
509
509
|
const a = `${t}/management/v1/groups/${r}`;
|
|
510
|
-
await
|
|
511
|
-
},
|
|
510
|
+
await ct(a, s, "DELETE");
|
|
511
|
+
}, Bs = async (t, s, r, a) => {
|
|
512
512
|
const o = `${t}/management/v1/groups/${r}/members`;
|
|
513
|
-
return await
|
|
514
|
-
},
|
|
513
|
+
return await ta(o, s, a);
|
|
514
|
+
}, Gs = async (t, s, r, a) => {
|
|
515
515
|
const o = `${t}/management/v1/groups/${r}/members`;
|
|
516
|
-
await
|
|
516
|
+
await ct(o, s, "DELETE", a);
|
|
517
517
|
};
|
|
518
|
-
function $
|
|
519
|
-
const { authToken: t, tokenProps:
|
|
518
|
+
function $s() {
|
|
519
|
+
const { authToken: t, tokenProps: s } = z(), r = xe();
|
|
520
520
|
return ve({
|
|
521
|
-
mutationFn: (a) =>
|
|
521
|
+
mutationFn: (a) => Fs(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a),
|
|
522
522
|
onSuccess: () => {
|
|
523
523
|
r.invalidateQueries({ queryKey: ["groups"] }), C.success("Group created successfully");
|
|
524
524
|
},
|
|
@@ -529,13 +529,13 @@ function $n() {
|
|
|
529
529
|
}
|
|
530
530
|
});
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
const { authToken: t, tokenProps:
|
|
532
|
+
function zs() {
|
|
533
|
+
const { authToken: t, tokenProps: s } = z(), r = xe();
|
|
534
534
|
return ve({
|
|
535
535
|
mutationFn: ({
|
|
536
536
|
groupId: a,
|
|
537
537
|
data: o
|
|
538
|
-
}) =>
|
|
538
|
+
}) => Os(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, o),
|
|
539
539
|
onSuccess: (a, o) => {
|
|
540
540
|
r.invalidateQueries({ queryKey: ["group", o.groupId] }), r.invalidateQueries({ queryKey: ["groups"] }), C.success("Group updated successfully");
|
|
541
541
|
},
|
|
@@ -546,10 +546,10 @@ function Bn() {
|
|
|
546
546
|
}
|
|
547
547
|
});
|
|
548
548
|
}
|
|
549
|
-
function
|
|
550
|
-
const { authToken: t, tokenProps:
|
|
549
|
+
function _s() {
|
|
550
|
+
const { authToken: t, tokenProps: s } = z(), r = xe();
|
|
551
551
|
return ve({
|
|
552
|
-
mutationFn: (a) =>
|
|
552
|
+
mutationFn: (a) => Ts(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a),
|
|
553
553
|
onSuccess: (a, o) => {
|
|
554
554
|
r.invalidateQueries({ queryKey: ["groups"] }), r.removeQueries({ queryKey: ["group", o] }), C.success("Group deleted successfully");
|
|
555
555
|
},
|
|
@@ -560,13 +560,13 @@ function Gn() {
|
|
|
560
560
|
}
|
|
561
561
|
});
|
|
562
562
|
}
|
|
563
|
-
function
|
|
564
|
-
const { authToken: t, tokenProps:
|
|
563
|
+
function qs() {
|
|
564
|
+
const { authToken: t, tokenProps: s } = z(), r = xe();
|
|
565
565
|
return ve({
|
|
566
566
|
mutationFn: ({
|
|
567
567
|
groupId: a,
|
|
568
568
|
data: o
|
|
569
|
-
}) =>
|
|
569
|
+
}) => Bs(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, o),
|
|
570
570
|
onSuccess: (a, o) => {
|
|
571
571
|
r.invalidateQueries({ queryKey: ["group", o.groupId] }), r.invalidateQueries({
|
|
572
572
|
queryKey: ["group-members", o.groupId]
|
|
@@ -579,13 +579,13 @@ function zn() {
|
|
|
579
579
|
}
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
const { authToken: t, tokenProps:
|
|
582
|
+
function Hs() {
|
|
583
|
+
const { authToken: t, tokenProps: s } = z(), r = xe();
|
|
584
584
|
return ve({
|
|
585
585
|
mutationFn: ({
|
|
586
586
|
groupId: a,
|
|
587
587
|
data: o
|
|
588
|
-
}) =>
|
|
588
|
+
}) => Gs(s.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", a, o),
|
|
589
589
|
onSuccess: (a, o) => {
|
|
590
590
|
r.invalidateQueries({ queryKey: ["group", o.groupId] }), r.invalidateQueries({
|
|
591
591
|
queryKey: ["group-members", o.groupId]
|
|
@@ -598,23 +598,23 @@ function _n() {
|
|
|
598
598
|
}
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
|
-
const
|
|
602
|
-
function
|
|
601
|
+
const js = [];
|
|
602
|
+
function Ks({
|
|
603
603
|
open: t,
|
|
604
|
-
onOpenChange:
|
|
604
|
+
onOpenChange: s
|
|
605
605
|
}) {
|
|
606
606
|
var S, P, k;
|
|
607
|
-
const { tokenProps: r } = z(), { currentUser: a } =
|
|
607
|
+
const { tokenProps: r } = z(), { currentUser: a } = ut(), o = (a == null ? void 0 : a.type) === "tenant", l = r == null ? void 0 : r.tenantId, {
|
|
608
608
|
groups: h,
|
|
609
609
|
isLoading: m,
|
|
610
610
|
error: p,
|
|
611
611
|
refetch: v
|
|
612
|
-
} =
|
|
612
|
+
} = mr({
|
|
613
613
|
type: o ? "TENANT_GROUP" : "all",
|
|
614
614
|
tenantId: o ? l : void 0,
|
|
615
615
|
includeMembers: !1
|
|
616
|
-
}), d = p ?
|
|
617
|
-
|
|
616
|
+
}), d = p ? va(p, "Unable to load groups.") : null, [u, b] = N({ kind: "list" }), [f, w] = N(null), y = _s();
|
|
617
|
+
Ge(() => {
|
|
618
618
|
t || (b({ kind: "list" }), w(null));
|
|
619
619
|
}, [t]);
|
|
620
620
|
const c = u.kind === "members" && h.find((x) => x.id === u.groupId) || null, M = async () => {
|
|
@@ -624,11 +624,11 @@ function Hn({
|
|
|
624
624
|
} catch {
|
|
625
625
|
}
|
|
626
626
|
};
|
|
627
|
-
return /* @__PURE__ */ e(
|
|
628
|
-
u.kind === "list" ? /* @__PURE__ */
|
|
629
|
-
/* @__PURE__ */ e(
|
|
627
|
+
return /* @__PURE__ */ e(ra, { open: t, onOpenChange: s, children: /* @__PURE__ */ n(sa, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
|
|
628
|
+
u.kind === "list" ? /* @__PURE__ */ n("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
|
|
629
|
+
/* @__PURE__ */ e(st, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
|
|
630
630
|
/* @__PURE__ */ e(nt, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
|
|
631
|
-
] }) : u.kind === "create" ? /* @__PURE__ */
|
|
631
|
+
] }) : u.kind === "create" ? /* @__PURE__ */ n("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
|
|
632
632
|
/* @__PURE__ */ e(
|
|
633
633
|
"button",
|
|
634
634
|
{
|
|
@@ -636,14 +636,14 @@ function Hn({
|
|
|
636
636
|
onClick: () => b({ kind: "list" }),
|
|
637
637
|
"aria-label": "Back",
|
|
638
638
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
639
|
-
children: /* @__PURE__ */ e(
|
|
639
|
+
children: /* @__PURE__ */ e(ia, { className: "h-3.5 w-3.5" })
|
|
640
640
|
}
|
|
641
641
|
),
|
|
642
|
-
/* @__PURE__ */ e(
|
|
642
|
+
/* @__PURE__ */ e(st, { className: "truncate text-[13px] font-medium", children: "New group" }),
|
|
643
643
|
/* @__PURE__ */ e(nt, { className: "sr-only", children: "Create a new group to organize members." })
|
|
644
644
|
] }) : null,
|
|
645
645
|
u.kind === "list" && /* @__PURE__ */ e(
|
|
646
|
-
|
|
646
|
+
Qs,
|
|
647
647
|
{
|
|
648
648
|
groups: h,
|
|
649
649
|
isLoading: m,
|
|
@@ -656,7 +656,7 @@ function Hn({
|
|
|
656
656
|
}
|
|
657
657
|
),
|
|
658
658
|
u.kind === "members" && c && /* @__PURE__ */ e(
|
|
659
|
-
|
|
659
|
+
Xs,
|
|
660
660
|
{
|
|
661
661
|
group: c,
|
|
662
662
|
isTenantViewer: o,
|
|
@@ -671,7 +671,7 @@ function Hn({
|
|
|
671
671
|
c.id
|
|
672
672
|
),
|
|
673
673
|
u.kind === "create" && /* @__PURE__ */ e(
|
|
674
|
-
|
|
674
|
+
Ys,
|
|
675
675
|
{
|
|
676
676
|
isTenantUser: o,
|
|
677
677
|
tenantId: l,
|
|
@@ -681,14 +681,14 @@ function Hn({
|
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
683
|
),
|
|
684
|
-
f && /* @__PURE__ */
|
|
685
|
-
/* @__PURE__ */
|
|
684
|
+
f && /* @__PURE__ */ n("div", { className: "flex shrink-0 items-center justify-between gap-3 border-t border-border bg-muted/40 px-5 py-2.5", children: [
|
|
685
|
+
/* @__PURE__ */ n("div", { className: "min-w-0 text-[12px] text-foreground", children: [
|
|
686
686
|
"Delete ",
|
|
687
687
|
/* @__PURE__ */ e("span", { className: "font-medium", children: f.name }),
|
|
688
688
|
"?",
|
|
689
689
|
/* @__PURE__ */ e("span", { className: "ml-2 text-muted-foreground", children: "Members lose any access granted via this group." })
|
|
690
690
|
] }),
|
|
691
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
692
692
|
/* @__PURE__ */ e(
|
|
693
693
|
"button",
|
|
694
694
|
{
|
|
@@ -699,7 +699,7 @@ function Hn({
|
|
|
699
699
|
children: "Cancel"
|
|
700
700
|
}
|
|
701
701
|
),
|
|
702
|
-
/* @__PURE__ */
|
|
702
|
+
/* @__PURE__ */ n(
|
|
703
703
|
"button",
|
|
704
704
|
{
|
|
705
705
|
type: "button",
|
|
@@ -707,7 +707,7 @@ function Hn({
|
|
|
707
707
|
disabled: y.isPending,
|
|
708
708
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-rose-600 px-2.5 text-[12px] font-medium text-white hover:bg-rose-700 disabled:opacity-60",
|
|
709
709
|
children: [
|
|
710
|
-
y.isPending ? /* @__PURE__ */ e(
|
|
710
|
+
y.isPending ? /* @__PURE__ */ e(Be, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(mt, { className: "h-3 w-3" }),
|
|
711
711
|
"Delete group"
|
|
712
712
|
]
|
|
713
713
|
}
|
|
@@ -716,9 +716,9 @@ function Hn({
|
|
|
716
716
|
] })
|
|
717
717
|
] }) });
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function Qs({
|
|
720
720
|
groups: t,
|
|
721
|
-
isLoading:
|
|
721
|
+
isLoading: s,
|
|
722
722
|
errorMessage: r,
|
|
723
723
|
onRetry: a,
|
|
724
724
|
currentUserId: o,
|
|
@@ -732,10 +732,10 @@ function jn({
|
|
|
732
732
|
),
|
|
733
733
|
[t, p]
|
|
734
734
|
);
|
|
735
|
-
return /* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
/* @__PURE__ */ e(
|
|
735
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
736
|
+
/* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-5 py-2.5", children: [
|
|
737
|
+
/* @__PURE__ */ n("div", { className: "flex flex-1 items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40", children: [
|
|
738
|
+
/* @__PURE__ */ e(cs, { className: "h-3 w-3 text-muted-foreground" }),
|
|
739
739
|
/* @__PURE__ */ e(
|
|
740
740
|
"input",
|
|
741
741
|
{
|
|
@@ -751,11 +751,11 @@ function jn({
|
|
|
751
751
|
type: "button",
|
|
752
752
|
onClick: () => v(""),
|
|
753
753
|
className: "flex h-4 w-4 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
754
|
-
children: /* @__PURE__ */ e(
|
|
754
|
+
children: /* @__PURE__ */ e(ca, { className: "h-2.5 w-2.5" })
|
|
755
755
|
}
|
|
756
756
|
)
|
|
757
757
|
] }),
|
|
758
|
-
/* @__PURE__ */
|
|
758
|
+
/* @__PURE__ */ n(
|
|
759
759
|
"button",
|
|
760
760
|
{
|
|
761
761
|
type: "button",
|
|
@@ -768,21 +768,21 @@ function jn({
|
|
|
768
768
|
}
|
|
769
769
|
)
|
|
770
770
|
] }),
|
|
771
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children:
|
|
771
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: s ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((u) => /* @__PURE__ */ e(
|
|
772
772
|
"div",
|
|
773
773
|
{
|
|
774
774
|
className: "h-12 animate-pulse rounded-[4px] bg-muted/60"
|
|
775
775
|
},
|
|
776
776
|
u
|
|
777
777
|
)) }) : r ? /* @__PURE__ */ e(
|
|
778
|
-
|
|
778
|
+
ya,
|
|
779
779
|
{
|
|
780
780
|
title: "Can't load groups",
|
|
781
781
|
message: r,
|
|
782
782
|
onRetry: a
|
|
783
783
|
}
|
|
784
|
-
) : d.length === 0 && t.length === 0 ? /* @__PURE__ */ e(
|
|
785
|
-
/* @__PURE__ */
|
|
784
|
+
) : d.length === 0 && t.length === 0 ? /* @__PURE__ */ e(Js, { onCreate: h }) : d.length === 0 ? /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
|
|
785
|
+
/* @__PURE__ */ n("div", { className: "text-[12px] text-foreground", children: [
|
|
786
786
|
'No groups match "',
|
|
787
787
|
p,
|
|
788
788
|
'"'
|
|
@@ -791,7 +791,7 @@ function jn({
|
|
|
791
791
|
] }) : d.map((u) => {
|
|
792
792
|
var b;
|
|
793
793
|
return /* @__PURE__ */ e(
|
|
794
|
-
|
|
794
|
+
Ws,
|
|
795
795
|
{
|
|
796
796
|
group: u,
|
|
797
797
|
canDelete: ((b = u.permissions) == null ? void 0 : b.canDelete) ?? u.createdBy === o,
|
|
@@ -803,50 +803,50 @@ function jn({
|
|
|
803
803
|
}) })
|
|
804
804
|
] });
|
|
805
805
|
}
|
|
806
|
-
function
|
|
806
|
+
function Ws({
|
|
807
807
|
group: t,
|
|
808
|
-
canDelete:
|
|
808
|
+
canDelete: s,
|
|
809
809
|
onClick: r,
|
|
810
810
|
onDelete: a
|
|
811
811
|
}) {
|
|
812
812
|
let o = "";
|
|
813
813
|
try {
|
|
814
|
-
o =
|
|
814
|
+
o = ua(new Date(t.createdAt), "MMM d, yyyy");
|
|
815
815
|
} catch {
|
|
816
816
|
o = "";
|
|
817
817
|
}
|
|
818
|
-
return /* @__PURE__ */
|
|
818
|
+
return /* @__PURE__ */ n(
|
|
819
819
|
"button",
|
|
820
820
|
{
|
|
821
821
|
type: "button",
|
|
822
822
|
onClick: r,
|
|
823
823
|
className: "group flex w-full items-center gap-3 border-b border-border/60 px-5 py-2.5 text-left hover:bg-accent/40",
|
|
824
824
|
children: [
|
|
825
|
-
/* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(
|
|
826
|
-
/* @__PURE__ */
|
|
825
|
+
/* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(fr, { className: "h-3.5 w-3.5" }) }),
|
|
826
|
+
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
827
827
|
/* @__PURE__ */ e("div", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
|
|
828
|
-
/* @__PURE__ */
|
|
829
|
-
/* @__PURE__ */
|
|
830
|
-
/* @__PURE__ */ e(
|
|
828
|
+
/* @__PURE__ */ n("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
|
|
829
|
+
/* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1", children: [
|
|
830
|
+
/* @__PURE__ */ e(ma, { className: "h-2.5 w-2.5" }),
|
|
831
831
|
t.memberCount,
|
|
832
832
|
" member",
|
|
833
833
|
t.memberCount === 1 ? "" : "s"
|
|
834
834
|
] }),
|
|
835
|
-
o && /* @__PURE__ */
|
|
835
|
+
o && /* @__PURE__ */ n(T, { children: [
|
|
836
836
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
837
|
-
/* @__PURE__ */
|
|
838
|
-
/* @__PURE__ */ e(
|
|
837
|
+
/* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1", children: [
|
|
838
|
+
/* @__PURE__ */ e(la, { className: "h-2.5 w-2.5" }),
|
|
839
839
|
o
|
|
840
840
|
] })
|
|
841
841
|
] }),
|
|
842
|
-
t.description && /* @__PURE__ */
|
|
842
|
+
t.description && /* @__PURE__ */ n(T, { children: [
|
|
843
843
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
844
844
|
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: t.description })
|
|
845
845
|
] })
|
|
846
846
|
] })
|
|
847
847
|
] }),
|
|
848
|
-
/* @__PURE__ */
|
|
849
|
-
|
|
848
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100", children: [
|
|
849
|
+
s && /* @__PURE__ */ e(
|
|
850
850
|
"span",
|
|
851
851
|
{
|
|
852
852
|
role: "button",
|
|
@@ -859,21 +859,21 @@ function Kn({
|
|
|
859
859
|
},
|
|
860
860
|
"aria-label": `Delete ${t.name}`,
|
|
861
861
|
className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
862
|
-
children: /* @__PURE__ */ e(
|
|
862
|
+
children: /* @__PURE__ */ e(mt, { className: "h-3 w-3" })
|
|
863
863
|
}
|
|
864
864
|
),
|
|
865
|
-
/* @__PURE__ */ e(
|
|
865
|
+
/* @__PURE__ */ e(us, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
866
866
|
] })
|
|
867
867
|
]
|
|
868
868
|
}
|
|
869
869
|
);
|
|
870
870
|
}
|
|
871
|
-
function
|
|
872
|
-
return /* @__PURE__ */
|
|
873
|
-
/* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(
|
|
871
|
+
function Js({ onCreate: t }) {
|
|
872
|
+
return /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
|
|
873
|
+
/* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(da, { className: "h-4 w-4" }) }),
|
|
874
874
|
/* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: "No groups yet" }),
|
|
875
875
|
/* @__PURE__ */ e("div", { className: "max-w-[320px] text-[11.5px] leading-[1.55] text-muted-foreground", children: "Groups let you grant shared access to dashboards. Create one and add members." }),
|
|
876
|
-
/* @__PURE__ */
|
|
876
|
+
/* @__PURE__ */ n(
|
|
877
877
|
"button",
|
|
878
878
|
{
|
|
879
879
|
type: "button",
|
|
@@ -887,9 +887,9 @@ function Qn({ onCreate: t }) {
|
|
|
887
887
|
)
|
|
888
888
|
] });
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function Xs({
|
|
891
891
|
group: t,
|
|
892
|
-
isTenantViewer:
|
|
892
|
+
isTenantViewer: s,
|
|
893
893
|
canEdit: r,
|
|
894
894
|
canDelete: a,
|
|
895
895
|
canManageMembers: o,
|
|
@@ -903,7 +903,7 @@ function Wn({
|
|
|
903
903
|
isLoading: d,
|
|
904
904
|
error: u,
|
|
905
905
|
refetch: b
|
|
906
|
-
} =
|
|
906
|
+
} = pr(t.id), f = (v == null ? void 0 : v.members) ?? js, w = u ? va(u, "Unable to load members for this group.") : null, y = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: c } = hr({
|
|
907
907
|
type: y,
|
|
908
908
|
tenantId: t.tenantId || void 0,
|
|
909
909
|
active: !0,
|
|
@@ -911,12 +911,12 @@ function Wn({
|
|
|
911
911
|
}), M = Y(
|
|
912
912
|
() => new Set(f.map((g) => g.userId)),
|
|
913
913
|
[f]
|
|
914
|
-
), S =
|
|
914
|
+
), S = qs(), P = Hs(), k = zs(), [x, _] = N(!1), [q, j] = N(t.name), [$e, K] = N(!1), [te, Q] = N(t.description || ""), [ae, re] = N(""), [ye, ee] = N(!1), ze = Y(() => {
|
|
915
915
|
const g = ae.trim().toLowerCase();
|
|
916
916
|
return c.filter((R) => !M.has(R.id)).filter(
|
|
917
917
|
(R) => !g || (R.name || "").toLowerCase().includes(g) || (R.email || "").toLowerCase().includes(g)
|
|
918
918
|
).slice(0, 50);
|
|
919
|
-
}, [c, M, ae]),
|
|
919
|
+
}, [c, M, ae]), se = async () => {
|
|
920
920
|
const g = q.trim();
|
|
921
921
|
if (_(!1), g.length >= 3 && g !== t.name)
|
|
922
922
|
try {
|
|
@@ -950,7 +950,7 @@ function Wn({
|
|
|
950
950
|
} catch {
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
|
-
},
|
|
953
|
+
}, _e = async (g) => {
|
|
954
954
|
if (o)
|
|
955
955
|
try {
|
|
956
956
|
await P.mutateAsync({
|
|
@@ -960,14 +960,14 @@ function Wn({
|
|
|
960
960
|
} catch {
|
|
961
961
|
}
|
|
962
962
|
};
|
|
963
|
-
let
|
|
963
|
+
let B = "";
|
|
964
964
|
try {
|
|
965
|
-
|
|
965
|
+
B = ua(new Date(t.createdAt), "MMM d, yyyy");
|
|
966
966
|
} catch {
|
|
967
|
-
|
|
967
|
+
B = "";
|
|
968
968
|
}
|
|
969
|
-
return /* @__PURE__ */
|
|
970
|
-
/* @__PURE__ */
|
|
969
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
970
|
+
/* @__PURE__ */ n("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
|
|
971
971
|
/* @__PURE__ */ e(
|
|
972
972
|
"button",
|
|
973
973
|
{
|
|
@@ -975,7 +975,7 @@ function Wn({
|
|
|
975
975
|
onClick: l,
|
|
976
976
|
"aria-label": "Back",
|
|
977
977
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
978
|
-
children: /* @__PURE__ */ e(
|
|
978
|
+
children: /* @__PURE__ */ e(ia, { className: "h-3.5 w-3.5" })
|
|
979
979
|
}
|
|
980
980
|
),
|
|
981
981
|
x ? /* @__PURE__ */ e(
|
|
@@ -984,9 +984,9 @@ function Wn({
|
|
|
984
984
|
autoFocus: !0,
|
|
985
985
|
value: q,
|
|
986
986
|
onChange: (g) => j(g.target.value),
|
|
987
|
-
onBlur:
|
|
987
|
+
onBlur: se,
|
|
988
988
|
onKeyDown: (g) => {
|
|
989
|
-
g.key === "Enter" &&
|
|
989
|
+
g.key === "Enter" && se(), g.key === "Escape" && (j(t.name), _(!1));
|
|
990
990
|
},
|
|
991
991
|
className: "h-6 min-w-0 flex-1 rounded-[3px] border border-border bg-background px-1.5 text-[13px] font-medium text-foreground focus:border-foreground/40 focus:outline-none"
|
|
992
992
|
}
|
|
@@ -1003,14 +1003,14 @@ function Wn({
|
|
|
1003
1003
|
children: t.name
|
|
1004
1004
|
}
|
|
1005
1005
|
),
|
|
1006
|
-
/* @__PURE__ */
|
|
1007
|
-
/* @__PURE__ */ e(
|
|
1006
|
+
/* @__PURE__ */ n("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
|
|
1007
|
+
/* @__PURE__ */ e(ma, { className: "h-2.5 w-2.5" }),
|
|
1008
1008
|
f.length,
|
|
1009
1009
|
" member",
|
|
1010
1010
|
f.length === 1 ? "" : "s"
|
|
1011
1011
|
] })
|
|
1012
1012
|
] }),
|
|
1013
|
-
/* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children:
|
|
1013
|
+
/* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: $e ? /* @__PURE__ */ n("div", { children: [
|
|
1014
1014
|
/* @__PURE__ */ e(
|
|
1015
1015
|
"textarea",
|
|
1016
1016
|
{
|
|
@@ -1026,12 +1026,12 @@ function Wn({
|
|
|
1026
1026
|
className: "block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
|
|
1027
1027
|
}
|
|
1028
1028
|
),
|
|
1029
|
-
/* @__PURE__ */
|
|
1030
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ n("div", { className: "mt-1.5 flex items-center justify-between", children: [
|
|
1030
|
+
/* @__PURE__ */ n("span", { className: "text-[10.5px] text-muted-foreground", children: [
|
|
1031
1031
|
te.length,
|
|
1032
1032
|
"/200 · Esc to cancel · ⌘↩ to save"
|
|
1033
1033
|
] }),
|
|
1034
|
-
/* @__PURE__ */
|
|
1034
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
|
|
1035
1035
|
/* @__PURE__ */ e(
|
|
1036
1036
|
"button",
|
|
1037
1037
|
{
|
|
@@ -1054,7 +1054,7 @@ function Wn({
|
|
|
1054
1054
|
)
|
|
1055
1055
|
] })
|
|
1056
1056
|
] })
|
|
1057
|
-
] }) : /* @__PURE__ */
|
|
1057
|
+
] }) : /* @__PURE__ */ n(
|
|
1058
1058
|
"button",
|
|
1059
1059
|
{
|
|
1060
1060
|
type: "button",
|
|
@@ -1066,22 +1066,22 @@ function Wn({
|
|
|
1066
1066
|
className: "block w-full rounded-[3px] px-1 py-0.5 text-left enabled:hover:bg-accent/40 disabled:cursor-default",
|
|
1067
1067
|
children: [
|
|
1068
1068
|
t.description ? /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: t.description }) : /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children: r ? "Add a description…" : "No description" }),
|
|
1069
|
-
/* @__PURE__ */
|
|
1070
|
-
|
|
1069
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
|
|
1070
|
+
B ? `Created ${B}` : "Recently created",
|
|
1071
1071
|
r ? " · You can edit this group" : ""
|
|
1072
1072
|
] })
|
|
1073
1073
|
]
|
|
1074
1074
|
}
|
|
1075
1075
|
) }),
|
|
1076
1076
|
o && /* @__PURE__ */ e(
|
|
1077
|
-
|
|
1077
|
+
Zs,
|
|
1078
1078
|
{
|
|
1079
1079
|
query: ae,
|
|
1080
1080
|
setQuery: re,
|
|
1081
1081
|
open: ye,
|
|
1082
1082
|
setOpen: ee,
|
|
1083
|
-
candidates:
|
|
1084
|
-
showKindChip: !
|
|
1083
|
+
candidates: ze,
|
|
1084
|
+
showKindChip: !s,
|
|
1085
1085
|
onAdd: Ne,
|
|
1086
1086
|
busy: S.isPending
|
|
1087
1087
|
}
|
|
@@ -1093,37 +1093,37 @@ function Wn({
|
|
|
1093
1093
|
},
|
|
1094
1094
|
g
|
|
1095
1095
|
)) }) : w ? /* @__PURE__ */ e(
|
|
1096
|
-
|
|
1096
|
+
ya,
|
|
1097
1097
|
{
|
|
1098
1098
|
title: "Can't load members",
|
|
1099
1099
|
message: w,
|
|
1100
1100
|
onRetry: () => b()
|
|
1101
1101
|
}
|
|
1102
|
-
) : f.length === 0 ? /* @__PURE__ */
|
|
1102
|
+
) : f.length === 0 ? /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
|
|
1103
1103
|
/* @__PURE__ */ e("div", { className: "text-[12px] text-foreground", children: "No members yet" }),
|
|
1104
1104
|
/* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: o ? "Search above to add people to this group." : "This group does not have any members." })
|
|
1105
1105
|
] }) : f.map((g) => {
|
|
1106
|
-
var R,
|
|
1107
|
-
return /* @__PURE__ */
|
|
1106
|
+
var R, ne, W, oe, J, De;
|
|
1107
|
+
return /* @__PURE__ */ n(
|
|
1108
1108
|
"div",
|
|
1109
1109
|
{
|
|
1110
1110
|
className: "group flex items-center gap-2 border-b border-border/60 px-5 py-2",
|
|
1111
1111
|
children: [
|
|
1112
|
-
/* @__PURE__ */ e(
|
|
1113
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ e(wa, { name: ((R = g.user) == null ? void 0 : R.name) || ((ne = g.user) == null ? void 0 : ne.email) || "?" }),
|
|
1113
|
+
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
1114
1114
|
/* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((W = g.user) == null ? void 0 : W.name) || ((oe = g.user) == null ? void 0 : oe.email) || "Unknown" }),
|
|
1115
1115
|
((J = g.user) == null ? void 0 : J.email) && g.user.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: g.user.email })
|
|
1116
1116
|
] }),
|
|
1117
|
-
!
|
|
1117
|
+
!s && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: g.userType }),
|
|
1118
1118
|
/* @__PURE__ */ e(
|
|
1119
1119
|
"button",
|
|
1120
1120
|
{
|
|
1121
1121
|
type: "button",
|
|
1122
|
-
onClick: () =>
|
|
1122
|
+
onClick: () => _e(g.userId),
|
|
1123
1123
|
disabled: !o || P.isPending,
|
|
1124
1124
|
"aria-label": `Remove ${((De = g.user) == null ? void 0 : De.name) || "member"}`,
|
|
1125
1125
|
className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover:opacity-100 disabled:opacity-30",
|
|
1126
|
-
children: /* @__PURE__ */ e(
|
|
1126
|
+
children: /* @__PURE__ */ e(ca, { className: "h-3 w-3" })
|
|
1127
1127
|
}
|
|
1128
1128
|
)
|
|
1129
1129
|
]
|
|
@@ -1131,34 +1131,34 @@ function Wn({
|
|
|
1131
1131
|
g.id
|
|
1132
1132
|
);
|
|
1133
1133
|
}) }),
|
|
1134
|
-
a && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: /* @__PURE__ */
|
|
1134
|
+
a && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: /* @__PURE__ */ n(
|
|
1135
1135
|
"button",
|
|
1136
1136
|
{
|
|
1137
1137
|
type: "button",
|
|
1138
1138
|
onClick: p,
|
|
1139
1139
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] border border-rose-200 bg-background px-2.5 text-[12px] font-medium text-rose-600 hover:bg-rose-50 dark:border-rose-900/60 dark:text-rose-400 dark:hover:bg-rose-950/30",
|
|
1140
1140
|
children: [
|
|
1141
|
-
/* @__PURE__ */ e(
|
|
1141
|
+
/* @__PURE__ */ e(mt, { className: "h-3 w-3" }),
|
|
1142
1142
|
"Delete group"
|
|
1143
1143
|
]
|
|
1144
1144
|
}
|
|
1145
1145
|
) })
|
|
1146
1146
|
] });
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1148
|
+
function Ys({
|
|
1149
1149
|
isTenantUser: t,
|
|
1150
|
-
tenantId:
|
|
1150
|
+
tenantId: s,
|
|
1151
1151
|
onCancel: r,
|
|
1152
1152
|
onCreated: a
|
|
1153
1153
|
}) {
|
|
1154
|
-
const [o, l] = N(""), [h, m] = N(""), [p, v] = N(null), d = $
|
|
1154
|
+
const [o, l] = N(""), [h, m] = N(""), [p, v] = N(null), d = $s(), u = o.trim().length >= 3 && o.trim().length <= 50, b = async () => {
|
|
1155
1155
|
if (!u) return;
|
|
1156
1156
|
v(null);
|
|
1157
1157
|
const f = {
|
|
1158
1158
|
name: o.trim(),
|
|
1159
1159
|
description: h.trim() || void 0,
|
|
1160
1160
|
type: t ? "TENANT_GROUP" : "ORG_GROUP",
|
|
1161
|
-
...t &&
|
|
1161
|
+
...t && s ? { tenantId: s } : {}
|
|
1162
1162
|
};
|
|
1163
1163
|
try {
|
|
1164
1164
|
const w = await d.mutateAsync(f), y = w == null ? void 0 : w.id;
|
|
@@ -1167,9 +1167,9 @@ function Jn({
|
|
|
1167
1167
|
v(w instanceof Error ? w.message : "Failed to create group");
|
|
1168
1168
|
}
|
|
1169
1169
|
};
|
|
1170
|
-
return /* @__PURE__ */
|
|
1171
|
-
/* @__PURE__ */
|
|
1172
|
-
/* @__PURE__ */ e(
|
|
1170
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
1171
|
+
/* @__PURE__ */ n("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
|
|
1172
|
+
/* @__PURE__ */ e(Xt, { children: "Name" }),
|
|
1173
1173
|
/* @__PURE__ */ e(
|
|
1174
1174
|
"input",
|
|
1175
1175
|
{
|
|
@@ -1182,8 +1182,8 @@ function Jn({
|
|
|
1182
1182
|
}
|
|
1183
1183
|
),
|
|
1184
1184
|
/* @__PURE__ */ e("div", { className: "mt-1 text-[10.5px] text-muted-foreground", children: "3–50 characters." }),
|
|
1185
|
-
/* @__PURE__ */
|
|
1186
|
-
/* @__PURE__ */ e(
|
|
1185
|
+
/* @__PURE__ */ n("div", { className: "mt-4", children: [
|
|
1186
|
+
/* @__PURE__ */ e(Xt, { children: "Description (optional)" }),
|
|
1187
1187
|
/* @__PURE__ */ e(
|
|
1188
1188
|
"textarea",
|
|
1189
1189
|
{
|
|
@@ -1195,14 +1195,14 @@ function Jn({
|
|
|
1195
1195
|
className: "mt-1 block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
|
|
1196
1196
|
}
|
|
1197
1197
|
),
|
|
1198
|
-
/* @__PURE__ */
|
|
1198
|
+
/* @__PURE__ */ n("div", { className: "mt-1 flex justify-end text-[10.5px] text-muted-foreground", children: [
|
|
1199
1199
|
h.length,
|
|
1200
1200
|
"/200"
|
|
1201
1201
|
] })
|
|
1202
1202
|
] }),
|
|
1203
1203
|
p && /* @__PURE__ */ e("div", { className: "mt-3 rounded-[5px] border border-rose-200 bg-rose-50 px-2 py-1.5 text-[11.5px] text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/30 dark:text-rose-300", children: p })
|
|
1204
1204
|
] }),
|
|
1205
|
-
/* @__PURE__ */
|
|
1205
|
+
/* @__PURE__ */ n("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: [
|
|
1206
1206
|
/* @__PURE__ */ e(
|
|
1207
1207
|
"button",
|
|
1208
1208
|
{
|
|
@@ -1220,10 +1220,10 @@ function Jn({
|
|
|
1220
1220
|
onClick: b,
|
|
1221
1221
|
disabled: !u || d.isPending,
|
|
1222
1222
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",
|
|
1223
|
-
children: d.isPending ? /* @__PURE__ */
|
|
1224
|
-
/* @__PURE__ */ e(
|
|
1223
|
+
children: d.isPending ? /* @__PURE__ */ n(T, { children: [
|
|
1224
|
+
/* @__PURE__ */ e(Be, { className: "h-3 w-3 animate-spin" }),
|
|
1225
1225
|
"Creating…"
|
|
1226
|
-
] }) : /* @__PURE__ */
|
|
1226
|
+
] }) : /* @__PURE__ */ n(T, { children: [
|
|
1227
1227
|
/* @__PURE__ */ e(H, { className: "h-3 w-3" }),
|
|
1228
1228
|
"Create group"
|
|
1229
1229
|
] })
|
|
@@ -1232,9 +1232,9 @@ function Jn({
|
|
|
1232
1232
|
] })
|
|
1233
1233
|
] });
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1235
|
+
function Zs({
|
|
1236
1236
|
query: t,
|
|
1237
|
-
setQuery:
|
|
1237
|
+
setQuery: s,
|
|
1238
1238
|
open: r,
|
|
1239
1239
|
setOpen: a,
|
|
1240
1240
|
candidates: o,
|
|
@@ -1242,8 +1242,8 @@ function Xn({
|
|
|
1242
1242
|
onAdd: h,
|
|
1243
1243
|
busy: m
|
|
1244
1244
|
}) {
|
|
1245
|
-
const p =
|
|
1246
|
-
|
|
1245
|
+
const p = Qt(null), v = Qt(null), [d, u] = N(null);
|
|
1246
|
+
Yr(() => {
|
|
1247
1247
|
if (!r) {
|
|
1248
1248
|
u(null);
|
|
1249
1249
|
return;
|
|
@@ -1262,7 +1262,7 @@ function Xn({
|
|
|
1262
1262
|
return f(), window.addEventListener("resize", f), window.addEventListener("scroll", f, !0), () => {
|
|
1263
1263
|
window.removeEventListener("resize", f), window.removeEventListener("scroll", f, !0);
|
|
1264
1264
|
};
|
|
1265
|
-
}, [r, o.length]),
|
|
1265
|
+
}, [r, o.length]), Ge(() => {
|
|
1266
1266
|
if (!r) return;
|
|
1267
1267
|
const f = (w) => {
|
|
1268
1268
|
var c, M;
|
|
@@ -1272,20 +1272,20 @@ function Xn({
|
|
|
1272
1272
|
return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
|
|
1273
1273
|
}, [r, a]);
|
|
1274
1274
|
const b = r && o.length > 0 && d;
|
|
1275
|
-
return /* @__PURE__ */
|
|
1276
|
-
/* @__PURE__ */
|
|
1275
|
+
return /* @__PURE__ */ n("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: [
|
|
1276
|
+
/* @__PURE__ */ n(
|
|
1277
1277
|
"div",
|
|
1278
1278
|
{
|
|
1279
1279
|
ref: p,
|
|
1280
1280
|
className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40",
|
|
1281
1281
|
children: [
|
|
1282
|
-
/* @__PURE__ */ e(
|
|
1282
|
+
/* @__PURE__ */ e(ws, { className: "h-3 w-3 text-muted-foreground" }),
|
|
1283
1283
|
/* @__PURE__ */ e(
|
|
1284
1284
|
"input",
|
|
1285
1285
|
{
|
|
1286
1286
|
value: t,
|
|
1287
1287
|
onChange: (f) => {
|
|
1288
|
-
|
|
1288
|
+
s(f.target.value), a(!0);
|
|
1289
1289
|
},
|
|
1290
1290
|
onFocus: () => a(!0),
|
|
1291
1291
|
placeholder: "Add a member by name or email…",
|
|
@@ -1296,7 +1296,7 @@ function Xn({
|
|
|
1296
1296
|
]
|
|
1297
1297
|
}
|
|
1298
1298
|
),
|
|
1299
|
-
b && typeof document < "u" &&
|
|
1299
|
+
b && typeof document < "u" && es(
|
|
1300
1300
|
/* @__PURE__ */ e(
|
|
1301
1301
|
"div",
|
|
1302
1302
|
{
|
|
@@ -1309,15 +1309,15 @@ function Xn({
|
|
|
1309
1309
|
transform: d.above ? "translateY(-100%)" : void 0
|
|
1310
1310
|
},
|
|
1311
1311
|
className: "z-[60] max-h-[240px] overflow-y-auto rounded-[5px] border border-border bg-background shadow-[0_8px_24px_-12px_rgba(0,0,0,0.18)]",
|
|
1312
|
-
children: o.map((f) => /* @__PURE__ */
|
|
1312
|
+
children: o.map((f) => /* @__PURE__ */ n(
|
|
1313
1313
|
"button",
|
|
1314
1314
|
{
|
|
1315
1315
|
type: "button",
|
|
1316
1316
|
onClick: () => h(f),
|
|
1317
1317
|
className: "flex w-full items-center gap-2 border-b border-border/60 px-2.5 py-2 text-left last:border-b-0 hover:bg-accent",
|
|
1318
1318
|
children: [
|
|
1319
|
-
/* @__PURE__ */ e(
|
|
1320
|
-
/* @__PURE__ */
|
|
1319
|
+
/* @__PURE__ */ e(wa, { name: f.name || f.email || "?" }),
|
|
1320
|
+
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
1321
1321
|
/* @__PURE__ */ e("div", { className: "truncate text-[12px] font-medium text-foreground", children: f.name || f.email || "Unknown" }),
|
|
1322
1322
|
f.email && f.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: f.email })
|
|
1323
1323
|
] }),
|
|
@@ -1332,22 +1332,22 @@ function Xn({
|
|
|
1332
1332
|
)
|
|
1333
1333
|
] });
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1336
|
-
if (!t) return
|
|
1335
|
+
function va(t, s) {
|
|
1336
|
+
if (!t) return s;
|
|
1337
1337
|
if (t instanceof Error) {
|
|
1338
1338
|
const r = t.message || "", a = r.match(/\{[\s\S]*"error"\s*:\s*"([^"]+)"[\s\S]*\}/);
|
|
1339
|
-
return a ? a[1] : r ||
|
|
1339
|
+
return a ? a[1] : r || s;
|
|
1340
1340
|
}
|
|
1341
|
-
return typeof t == "string" ? t :
|
|
1341
|
+
return typeof t == "string" ? t : s;
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1343
|
+
function ya({
|
|
1344
1344
|
title: t,
|
|
1345
|
-
message:
|
|
1345
|
+
message: s,
|
|
1346
1346
|
onRetry: r
|
|
1347
1347
|
}) {
|
|
1348
|
-
return /* @__PURE__ */
|
|
1348
|
+
return /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-2 px-6 py-10 text-center", children: [
|
|
1349
1349
|
/* @__PURE__ */ e("div", { className: "text-[12.5px] font-medium text-foreground", children: t }),
|
|
1350
|
-
/* @__PURE__ */ e("div", { className: "max-w-[360px] text-[11.5px] leading-[1.55] text-muted-foreground", children:
|
|
1350
|
+
/* @__PURE__ */ e("div", { className: "max-w-[360px] text-[11.5px] leading-[1.55] text-muted-foreground", children: s }),
|
|
1351
1351
|
r && /* @__PURE__ */ e(
|
|
1352
1352
|
"button",
|
|
1353
1353
|
{
|
|
@@ -1359,35 +1359,35 @@ function va({
|
|
|
1359
1359
|
)
|
|
1360
1360
|
] });
|
|
1361
1361
|
}
|
|
1362
|
-
function
|
|
1362
|
+
function Xt({ children: t }) {
|
|
1363
1363
|
return /* @__PURE__ */ e("label", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: t });
|
|
1364
1364
|
}
|
|
1365
|
-
function
|
|
1366
|
-
const
|
|
1367
|
-
return /* @__PURE__ */ e(
|
|
1365
|
+
function wa({ name: t }) {
|
|
1366
|
+
const s = t.split(" ").map((r) => r[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
1367
|
+
return /* @__PURE__ */ e(ba, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ e(xa, { className: "text-[9px] font-semibold", children: s || "?" }) });
|
|
1368
1368
|
}
|
|
1369
|
-
function pe(t,
|
|
1369
|
+
function pe(t, s, r) {
|
|
1370
1370
|
var l, h;
|
|
1371
1371
|
const a = (t.controls || []).find(
|
|
1372
1372
|
(m) => m.id === r
|
|
1373
1373
|
);
|
|
1374
1374
|
if (a)
|
|
1375
1375
|
return a.label;
|
|
1376
|
-
const o = (h = (l =
|
|
1376
|
+
const o = (h = (l = aa(t, s)) == null ? void 0 : l.controls) == null ? void 0 : h.find(
|
|
1377
1377
|
(m) => m.id === r
|
|
1378
1378
|
);
|
|
1379
1379
|
return (o == null ? void 0 : o.label) || r;
|
|
1380
1380
|
}
|
|
1381
|
-
function he(t,
|
|
1381
|
+
function he(t, s) {
|
|
1382
1382
|
var r;
|
|
1383
|
-
return ((r =
|
|
1383
|
+
return ((r = aa(t, s)) == null ? void 0 : r.title) || s;
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1386
|
-
const { errors:
|
|
1385
|
+
function en(t) {
|
|
1386
|
+
const { errors: s, dashboard: r } = t;
|
|
1387
1387
|
if (!r)
|
|
1388
|
-
return
|
|
1388
|
+
return s;
|
|
1389
1389
|
const a = /* @__PURE__ */ new Map();
|
|
1390
|
-
for (const o of
|
|
1390
|
+
for (const o of s) {
|
|
1391
1391
|
const l = o.match(
|
|
1392
1392
|
/^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
|
|
1393
1393
|
);
|
|
@@ -1467,74 +1467,79 @@ function Yn(t) {
|
|
|
1467
1467
|
}
|
|
1468
1468
|
return Array.from(a.values());
|
|
1469
1469
|
}
|
|
1470
|
-
function
|
|
1470
|
+
function tn({
|
|
1471
1471
|
visible: t,
|
|
1472
|
-
onSelect:
|
|
1472
|
+
onSelect: s
|
|
1473
1473
|
}) {
|
|
1474
|
-
return t ? /* @__PURE__ */
|
|
1475
|
-
/* @__PURE__ */ e(
|
|
1474
|
+
return t ? /* @__PURE__ */ n(O, { onSelect: s, children: [
|
|
1475
|
+
/* @__PURE__ */ e(gr, { className: "h-3.5 w-3.5" }),
|
|
1476
1476
|
"Schedule email report"
|
|
1477
1477
|
] }) : null;
|
|
1478
1478
|
}
|
|
1479
|
-
function
|
|
1479
|
+
function an({
|
|
1480
1480
|
scheduleReportVisible: t,
|
|
1481
|
-
analyticalBriefingVisible:
|
|
1481
|
+
analyticalBriefingVisible: s,
|
|
1482
1482
|
onScheduleReport: r,
|
|
1483
1483
|
onCreateAnalyticalBriefing: a
|
|
1484
1484
|
}) {
|
|
1485
|
-
return /* @__PURE__ */
|
|
1485
|
+
return /* @__PURE__ */ n(T, { children: [
|
|
1486
1486
|
/* @__PURE__ */ e(
|
|
1487
|
-
|
|
1487
|
+
tn,
|
|
1488
1488
|
{
|
|
1489
1489
|
visible: t,
|
|
1490
1490
|
onSelect: r
|
|
1491
1491
|
}
|
|
1492
1492
|
),
|
|
1493
|
-
|
|
1493
|
+
s ? /* @__PURE__ */ n(O, { onSelect: a, children: [
|
|
1494
1494
|
/* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
|
|
1495
1495
|
"Create analytical briefing"
|
|
1496
1496
|
] }) : null
|
|
1497
1497
|
] });
|
|
1498
1498
|
}
|
|
1499
|
-
function
|
|
1499
|
+
function Yt(t, s) {
|
|
1500
1500
|
return {
|
|
1501
|
-
dashboard:
|
|
1502
|
-
semanticExecutionPayload:
|
|
1501
|
+
dashboard: ot(t),
|
|
1502
|
+
semanticExecutionPayload: ot(s)
|
|
1503
1503
|
};
|
|
1504
1504
|
}
|
|
1505
|
-
function
|
|
1506
|
-
var
|
|
1507
|
-
|
|
1505
|
+
function Cn() {
|
|
1506
|
+
var Pt, Ut, Rt, Vt, Ft, Ot, Tt;
|
|
1507
|
+
ts(), as();
|
|
1508
1508
|
const {
|
|
1509
1509
|
authToken: t,
|
|
1510
|
-
tokenProps:
|
|
1510
|
+
tokenProps: s,
|
|
1511
1511
|
id: r,
|
|
1512
1512
|
showBriefings: a
|
|
1513
|
-
} = z(), o =
|
|
1513
|
+
} = z(), o = br(), { isLocalDev: l } = xr(), { openBrandStudioPreview: h } = vr(), { permissions: m } = Ms(), p = yr(), { isLoading: v } = wr(), d = D((i) => i.theme), u = D((i) => i.isDownloadingPdf), b = D(
|
|
1514
1514
|
(i) => i.dashboardAssistantDraftScopeKey
|
|
1515
|
-
), f = D((i) => i.lenses), w = D((i) => i.selectedLensId), y = f == null ? void 0 : f.find((i) => i.id === w), c = D((i) => i.dashboard), M = D((i) => i.selectedSheetId), S = (
|
|
1515
|
+
), f = D((i) => i.lenses), w = D((i) => i.selectedLensId), y = f == null ? void 0 : f.find((i) => i.id === w), c = D((i) => i.dashboard), M = D((i) => i.selectedSheetId), S = (Pt = c == null ? void 0 : c.sheets) == null ? void 0 : Pt.find(
|
|
1516
1516
|
(i) => i.id === M
|
|
1517
|
-
), P =
|
|
1517
|
+
), P = ja(S), k = P ? (Ut = S == null ? void 0 : S.document) == null ? void 0 : Ut.page : void 0, x = D(
|
|
1518
1518
|
(i) => i.isDashboardEditing
|
|
1519
|
-
), { setDashboardTitle: _ } = D((i) => i.actions), [q, j] = N(!1), [
|
|
1520
|
-
|
|
1521
|
-
const ie =
|
|
1519
|
+
), { setDashboardTitle: _ } = D((i) => i.actions), [q, j] = N(!1), [$e, K] = N(!1), [te, Q] = N(!1), [ae, re] = N(!1), [ye, ee] = N(null), [ze, se] = N(!1), [we, Ne] = N(!1), [_e, B] = N(!1), [g, R] = N(null), [ne, W] = N([]), [oe, J] = N(!1), [De, bt] = N(!1), xt = D((i) => i.filterValues), E = D((i) => i.isVisualEditing);
|
|
1520
|
+
Gt((i) => i.card);
|
|
1521
|
+
const ie = Fe(
|
|
1522
1522
|
(i) => i.selectedDashboard
|
|
1523
|
-
), Ce =
|
|
1523
|
+
), Ce = Fe(
|
|
1524
1524
|
(i) => i.initialDashboard
|
|
1525
1525
|
);
|
|
1526
|
-
|
|
1527
|
-
const ke = ie ? (
|
|
1526
|
+
Fe((i) => i.selectedVisual), D((i) => i.selectedFrameId), Gt((i) => i.frame);
|
|
1527
|
+
const ke = ie ? (Vt = ie == null ? void 0 : ie.permissions) == null ? void 0 : Vt.canEdit : (Rt = Ce == null ? void 0 : Ce.permissions) == null ? void 0 : Rt.canEdit, vt = D(
|
|
1528
1528
|
(i) => i.showDashboardJSON
|
|
1529
|
-
),
|
|
1530
|
-
setIsDashboardEditing:
|
|
1531
|
-
setShowDashboardJSON:
|
|
1532
|
-
} = D((i) => i.actions), { setInitialDashboard:
|
|
1529
|
+
), qe = D((i) => i.onSaveFunction), {
|
|
1530
|
+
setIsDashboardEditing: yt,
|
|
1531
|
+
setShowDashboardJSON: wt
|
|
1532
|
+
} = D((i) => i.actions), { setInitialDashboard: Nt, clearSelectedDashboard: He } = Fe(
|
|
1533
1533
|
(i) => i.actions
|
|
1534
|
-
), de = !!
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1534
|
+
), de = !!s.orgUserId || !!(s.tenantId && s.endUserId && s.endUserEmail), { resources: Se } = Nr(at.DASHBOARD), { data: je } = Dr(), Na = ((Ft = je == null ? void 0 : je.preference) == null ? void 0 : Ft.defaultDashboardId) || null, { mutate: Da, isPending: Ca } = Cr(), { currentUser: ka } = ut(), Sa = kr(ka), G = ie || Ce, Ie = Sr({
|
|
1535
|
+
config: s.config,
|
|
1536
|
+
canNavigateDashboardHub: de,
|
|
1537
|
+
canShareDashboard: ((Ot = G == null ? void 0 : G.permissions) == null ? void 0 : Ot.canShare) === !0,
|
|
1538
|
+
canManageGroups: Sa
|
|
1539
|
+
}), Dt = G ? {
|
|
1540
|
+
id: G.id,
|
|
1541
|
+
title: (c == null ? void 0 : c.title) || G.title || "Dashboard"
|
|
1542
|
+
} : null, { handleAddNewFrame: Ia } = Ir(), [Ke, Qe] = N(!1), [Ma, le] = N(!1), [We, Me] = N("close"), ce = Mr(at.DASHBOARD), [V, Ee] = N(null), Ea = async (i, I) => {
|
|
1538
1543
|
if (!(c != null && c.id)) {
|
|
1539
1544
|
console.log("No dashboard ID found");
|
|
1540
1545
|
return;
|
|
@@ -1558,21 +1563,21 @@ function ws() {
|
|
|
1558
1563
|
}
|
|
1559
1564
|
);
|
|
1560
1565
|
};
|
|
1561
|
-
|
|
1566
|
+
Ge(() => {
|
|
1562
1567
|
if (Se && Se.length > 0) {
|
|
1563
1568
|
const i = c == null ? void 0 : c.id;
|
|
1564
1569
|
if (i) {
|
|
1565
1570
|
const I = Se.find(
|
|
1566
1571
|
(F) => F.id === i
|
|
1567
1572
|
);
|
|
1568
|
-
I &&
|
|
1573
|
+
I && Nt(I);
|
|
1569
1574
|
}
|
|
1570
1575
|
}
|
|
1571
|
-
}, [Se, c == null ? void 0 : c.id,
|
|
1572
|
-
const ue =
|
|
1573
|
-
() =>
|
|
1576
|
+
}, [Se, c == null ? void 0 : c.id, Nt]);
|
|
1577
|
+
const ue = s.orgUserId || s.tenantId, Je = Y(
|
|
1578
|
+
() => rn({
|
|
1574
1579
|
accessToken: t == null ? void 0 : t.accessToken,
|
|
1575
|
-
dashboardId: (c == null ? void 0 : c.id) || r ||
|
|
1580
|
+
dashboardId: (c == null ? void 0 : c.id) || r || s.dashboard_id,
|
|
1576
1581
|
selectedSheetId: P ? M : void 0,
|
|
1577
1582
|
pageSize: k == null ? void 0 : k.size,
|
|
1578
1583
|
orientation: k == null ? void 0 : k.orientation,
|
|
@@ -1587,24 +1592,24 @@ function ws() {
|
|
|
1587
1592
|
k == null ? void 0 : k.size,
|
|
1588
1593
|
M,
|
|
1589
1594
|
d,
|
|
1590
|
-
|
|
1595
|
+
s.dashboard_id
|
|
1591
1596
|
]
|
|
1592
|
-
),
|
|
1597
|
+
), Ct = x && !E && ue && ke, { setDashboard: kt } = D((i) => i.actions), St = D(
|
|
1593
1598
|
(i) => i.semanticExecutionPayload
|
|
1594
|
-
),
|
|
1595
|
-
|
|
1596
|
-
},
|
|
1597
|
-
|
|
1599
|
+
), Aa = () => {
|
|
1600
|
+
yt(!0);
|
|
1601
|
+
}, Xe = () => {
|
|
1602
|
+
yt(!1), wt(!1), Ee(null);
|
|
1598
1603
|
};
|
|
1599
|
-
|
|
1604
|
+
Ge(() => {
|
|
1600
1605
|
if (!x) {
|
|
1601
|
-
V &&
|
|
1606
|
+
V && Ee(null);
|
|
1602
1607
|
return;
|
|
1603
1608
|
}
|
|
1604
|
-
V || !c || v ||
|
|
1605
|
-
|
|
1609
|
+
V || !c || v || Ee(
|
|
1610
|
+
Yt(
|
|
1606
1611
|
c,
|
|
1607
|
-
|
|
1612
|
+
St
|
|
1608
1613
|
)
|
|
1609
1614
|
);
|
|
1610
1615
|
}, [
|
|
@@ -1612,82 +1617,82 @@ function ws() {
|
|
|
1612
1617
|
V,
|
|
1613
1618
|
x,
|
|
1614
1619
|
v,
|
|
1615
|
-
|
|
1620
|
+
St
|
|
1616
1621
|
]);
|
|
1617
|
-
const
|
|
1622
|
+
const Ae = (V == null ? void 0 : V.dashboard) ?? null, { isDirty: It, isDirtyPending: La, resetDirty: Le } = ps(
|
|
1618
1623
|
c,
|
|
1619
|
-
|
|
1624
|
+
Ae,
|
|
1620
1625
|
300,
|
|
1621
1626
|
1e3,
|
|
1622
|
-
|
|
1623
|
-
),
|
|
1624
|
-
|
|
1625
|
-
},
|
|
1626
|
-
await
|
|
1627
|
+
rt
|
|
1628
|
+
), Mt = Zr(() => Ae ? rt(c) !== rt(Ae) : !1, [c, Ae]), Et = It || La, Pe = Ke || ce.isPending, Pa = () => {
|
|
1629
|
+
Mt() ? (Me("close"), le(!0)) : (Xe(), Le());
|
|
1630
|
+
}, Ua = async () => {
|
|
1631
|
+
await Ye({
|
|
1627
1632
|
closeAfterSave: !0,
|
|
1628
|
-
navigateHomeAfterSave:
|
|
1633
|
+
navigateHomeAfterSave: We === "home"
|
|
1629
1634
|
});
|
|
1630
|
-
}, Ua = () => {
|
|
1631
|
-
const i = Qe === "home" && !!de;
|
|
1632
|
-
V && Ct(V.dashboard, {
|
|
1633
|
-
semanticExecutionPayload: V.semanticExecutionPayload
|
|
1634
|
-
}), Je(), i && qe(), Ie("close"), le(!1), Ae();
|
|
1635
1635
|
}, Ra = () => {
|
|
1636
|
-
|
|
1636
|
+
const i = We === "home" && !!de;
|
|
1637
|
+
V && kt(V.dashboard, {
|
|
1637
1638
|
semanticExecutionPayload: V.semanticExecutionPayload
|
|
1638
|
-
}),
|
|
1639
|
+
}), Xe(), i && He(), Me("close"), le(!1), Le();
|
|
1639
1640
|
}, Va = () => {
|
|
1641
|
+
V && (kt(V.dashboard, {
|
|
1642
|
+
semanticExecutionPayload: V.semanticExecutionPayload
|
|
1643
|
+
}), Le());
|
|
1644
|
+
}, Fa = () => {
|
|
1640
1645
|
if (de) {
|
|
1641
|
-
if (x &&
|
|
1642
|
-
|
|
1646
|
+
if (x && Mt()) {
|
|
1647
|
+
Me("home"), le(!0);
|
|
1643
1648
|
return;
|
|
1644
1649
|
}
|
|
1645
|
-
|
|
1650
|
+
He();
|
|
1646
1651
|
}
|
|
1647
1652
|
};
|
|
1648
|
-
async function
|
|
1653
|
+
async function Ye(i) {
|
|
1649
1654
|
const I = D.getState().dashboard;
|
|
1650
1655
|
if (!I)
|
|
1651
1656
|
return;
|
|
1652
|
-
const F = (i == null ? void 0 : i.closeAfterSave) ?? oe,
|
|
1657
|
+
const F = (i == null ? void 0 : i.closeAfterSave) ?? oe, Ze = (i == null ? void 0 : i.navigateHomeAfterSave) ?? !1;
|
|
1653
1658
|
J(F), F && le(!1);
|
|
1654
|
-
const
|
|
1655
|
-
|
|
1656
|
-
const
|
|
1659
|
+
const et = ot(I);
|
|
1660
|
+
B(!0), R(null), W([]), Qe(!0);
|
|
1661
|
+
const $a = {
|
|
1657
1662
|
template: I
|
|
1658
1663
|
};
|
|
1659
1664
|
ce.mutate(
|
|
1660
1665
|
{
|
|
1661
1666
|
resourceId: I.id,
|
|
1662
|
-
data:
|
|
1667
|
+
data: $a
|
|
1663
1668
|
},
|
|
1664
1669
|
{
|
|
1665
1670
|
onSuccess: (A) => {
|
|
1666
|
-
var
|
|
1667
|
-
const X = (A == null ? void 0 : A.id) || ((
|
|
1671
|
+
var Ue, Re, Bt;
|
|
1672
|
+
const X = (A == null ? void 0 : A.id) || ((Ue = A == null ? void 0 : A.dashboard) == null ? void 0 : Ue.id) || ((Re = A == null ? void 0 : A.resource) == null ? void 0 : Re.id) || ((Bt = A == null ? void 0 : A.template) == null ? void 0 : Bt.id) || null;
|
|
1668
1673
|
if (!I.id && X) {
|
|
1669
|
-
const
|
|
1670
|
-
(
|
|
1674
|
+
const tt = Ya.getState(), Ve = tt.pendingDashboardDraftMigration;
|
|
1675
|
+
(Ve == null ? void 0 : Ve.scopeKey) === b ? tt.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
|
|
1671
1676
|
X
|
|
1672
|
-
) :
|
|
1677
|
+
) : Ve && tt.actions.clearPendingDashboardDraftMigration();
|
|
1673
1678
|
}
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1679
|
+
Qe(!1), C.success("Dashboard saved!"), Ee(
|
|
1680
|
+
Yt(
|
|
1681
|
+
et,
|
|
1677
1682
|
D.getState().semanticExecutionPayload
|
|
1678
1683
|
)
|
|
1679
|
-
),
|
|
1684
|
+
), B(!1), J(!1), F && (Xe(), Le(), Ze && de && He()), Me("close");
|
|
1680
1685
|
},
|
|
1681
1686
|
onError: (A) => {
|
|
1682
|
-
|
|
1683
|
-
const X = A.details,
|
|
1687
|
+
Qe(!1), R("Failed to save dashboard. Please try again.");
|
|
1688
|
+
const X = A.details, Ue = Array.isArray(
|
|
1684
1689
|
X == null ? void 0 : X.errors
|
|
1685
1690
|
) ? (X.errors || []).filter(
|
|
1686
|
-
(
|
|
1691
|
+
(Re) => typeof Re == "string"
|
|
1687
1692
|
) : [];
|
|
1688
1693
|
W(
|
|
1689
|
-
|
|
1690
|
-
errors:
|
|
1694
|
+
en({
|
|
1695
|
+
errors: Ue,
|
|
1691
1696
|
dashboard: I || void 0
|
|
1692
1697
|
})
|
|
1693
1698
|
), C.error("Failed to save dashboard");
|
|
@@ -1695,60 +1700,60 @@ function ws() {
|
|
|
1695
1700
|
}
|
|
1696
1701
|
);
|
|
1697
1702
|
}
|
|
1698
|
-
async function
|
|
1703
|
+
async function Oa() {
|
|
1699
1704
|
if (j(!0), !w || !y) return;
|
|
1700
1705
|
const i = D.getState().dashboard;
|
|
1701
1706
|
if (!i) {
|
|
1702
1707
|
j(!1);
|
|
1703
1708
|
return;
|
|
1704
1709
|
}
|
|
1705
|
-
const I = JSON.stringify(i), F = D.getState(),
|
|
1710
|
+
const I = JSON.stringify(i), F = D.getState(), Ze = pa({
|
|
1706
1711
|
dashboard: i,
|
|
1707
1712
|
dashboardInputValues: F.dashboardInputValues,
|
|
1708
|
-
filterValues:
|
|
1713
|
+
filterValues: xt,
|
|
1709
1714
|
controlValues: F.controlValues,
|
|
1710
1715
|
inlineFilterValuesMap: F.inlineFilterValuesMap,
|
|
1711
1716
|
cardControlValuesMap: F.cardControlValuesMap
|
|
1712
|
-
}),
|
|
1717
|
+
}), et = {
|
|
1713
1718
|
...y,
|
|
1714
1719
|
template: I,
|
|
1715
|
-
filterValues:
|
|
1716
|
-
inputValues:
|
|
1720
|
+
filterValues: xt,
|
|
1721
|
+
inputValues: Ze
|
|
1717
1722
|
};
|
|
1718
|
-
await
|
|
1719
|
-
|
|
1720
|
-
|
|
1723
|
+
await it(
|
|
1724
|
+
s.apiServiceUrl,
|
|
1725
|
+
et,
|
|
1721
1726
|
t == null ? void 0 : t.accessToken
|
|
1722
|
-
), C.success("Lens saved"),
|
|
1727
|
+
), C.success("Lens saved"), qe == null || qe(i), j(!1);
|
|
1723
1728
|
}
|
|
1724
|
-
const
|
|
1729
|
+
const At = (y == null ? void 0 : y.name) || c.title;
|
|
1725
1730
|
ce.isPending && console.log("Title during update:", {
|
|
1726
|
-
title:
|
|
1731
|
+
title: At,
|
|
1727
1732
|
dashboardStateTitle: c.title,
|
|
1728
1733
|
dashboardId: c == null ? void 0 : c.id,
|
|
1729
1734
|
currentLensName: y == null ? void 0 : y.name
|
|
1730
1735
|
});
|
|
1731
|
-
const
|
|
1732
|
-
(
|
|
1736
|
+
const Ta = de && !!(t != null && t.accessToken) && !!(s != null && s.apiServiceUrl), Ba = p && Ie.showDashboardHub, $ = (c == null ? void 0 : c.id) || null, Lt = Er(
|
|
1737
|
+
(Tt = s.config) == null ? void 0 : Tt.showBriefings,
|
|
1733
1738
|
a
|
|
1734
|
-
), me =
|
|
1735
|
-
|
|
1736
|
-
dashboardId: me ? null :
|
|
1739
|
+
), me = !!$ && Na === $, Ga = () => {
|
|
1740
|
+
$ && Da({
|
|
1741
|
+
dashboardId: me ? null : $
|
|
1737
1742
|
});
|
|
1738
1743
|
};
|
|
1739
|
-
return !p && !E ? null : /* @__PURE__ */
|
|
1744
|
+
return !p && !E ? null : /* @__PURE__ */ n(
|
|
1740
1745
|
"div",
|
|
1741
1746
|
{
|
|
1742
1747
|
className: "flex h-11 shrink-0 items-center justify-between gap-2 overflow-x-auto border-b px-4 py-2",
|
|
1743
1748
|
role: "dashboard-controls",
|
|
1744
1749
|
children: [
|
|
1745
|
-
/* @__PURE__ */
|
|
1746
|
-
|
|
1747
|
-
|
|
1750
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1751
|
+
Ba && !E && /* @__PURE__ */ e(
|
|
1752
|
+
zt,
|
|
1748
1753
|
{
|
|
1749
1754
|
"aria-label": "Dashboard Hub",
|
|
1750
1755
|
tooltip: "Dashboard Hub",
|
|
1751
|
-
onClick:
|
|
1756
|
+
onClick: Fa,
|
|
1752
1757
|
className: "h-7 w-7 px-0",
|
|
1753
1758
|
buttonProps: { size: "xs" },
|
|
1754
1759
|
children: /* @__PURE__ */ e(na, { className: "h-3.5 w-3.5" })
|
|
@@ -1762,11 +1767,11 @@ function ws() {
|
|
|
1762
1767
|
role: "status",
|
|
1763
1768
|
children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Loading dashboard title" })
|
|
1764
1769
|
}
|
|
1765
|
-
) : /* @__PURE__ */
|
|
1770
|
+
) : /* @__PURE__ */ n(T, { children: [
|
|
1766
1771
|
/* @__PURE__ */ e(
|
|
1767
|
-
|
|
1772
|
+
Ar,
|
|
1768
1773
|
{
|
|
1769
|
-
value:
|
|
1774
|
+
value: At || "Untitled Dashboard",
|
|
1770
1775
|
onSave: (i) => {
|
|
1771
1776
|
console.log("EditableText onSave called:", {
|
|
1772
1777
|
newTitle: i,
|
|
@@ -1774,9 +1779,13 @@ function ws() {
|
|
|
1774
1779
|
dashboardId: c == null ? void 0 : c.id
|
|
1775
1780
|
});
|
|
1776
1781
|
const I = (c == null ? void 0 : c.title) || "";
|
|
1777
|
-
_(i),
|
|
1782
|
+
_(i), Ea(i, I);
|
|
1778
1783
|
},
|
|
1779
|
-
isEditable:
|
|
1784
|
+
isEditable: Lr({
|
|
1785
|
+
isDashboardEditing: x,
|
|
1786
|
+
canEditDashboard: ke === !0,
|
|
1787
|
+
hasCurrentLens: !!y
|
|
1788
|
+
}),
|
|
1780
1789
|
displayClassName: "text-[13px] font-medium",
|
|
1781
1790
|
inputClassName: "text-[13px] font-medium",
|
|
1782
1791
|
placeholder: "Dashboard Title",
|
|
@@ -1791,62 +1800,62 @@ function ws() {
|
|
|
1791
1800
|
children: "Default"
|
|
1792
1801
|
}
|
|
1793
1802
|
),
|
|
1794
|
-
|
|
1795
|
-
/* @__PURE__ */ e(
|
|
1803
|
+
Ta && $ && /* @__PURE__ */ e(Ka, { children: /* @__PURE__ */ n(Qa, { children: [
|
|
1804
|
+
/* @__PURE__ */ e(Wa, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1796
1805
|
U,
|
|
1797
1806
|
{
|
|
1798
1807
|
variant: "ghost",
|
|
1799
1808
|
size: "xs",
|
|
1800
|
-
onClick:
|
|
1801
|
-
disabled:
|
|
1809
|
+
onClick: Ga,
|
|
1810
|
+
disabled: Ca || !(t != null && t.accessToken) || !(s != null && s.apiServiceUrl),
|
|
1802
1811
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
1803
1812
|
"aria-label": me ? "Clear default dashboard" : "Set as default dashboard",
|
|
1804
|
-
children: me ? /* @__PURE__ */ e(
|
|
1813
|
+
children: me ? /* @__PURE__ */ e(Pr, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(Ur, { className: "h-3.5 w-3.5" })
|
|
1805
1814
|
}
|
|
1806
1815
|
) }),
|
|
1807
|
-
/* @__PURE__ */ e(
|
|
1816
|
+
/* @__PURE__ */ e(Ja, { children: /* @__PURE__ */ e("p", { children: me ? "Clear default" : "Set as default" }) })
|
|
1808
1817
|
] }) })
|
|
1809
1818
|
] }))
|
|
1810
1819
|
] }),
|
|
1811
|
-
/* @__PURE__ */
|
|
1812
|
-
E && /* @__PURE__ */
|
|
1813
|
-
/* @__PURE__ */ e(
|
|
1814
|
-
/* @__PURE__ */ e(
|
|
1820
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
1821
|
+
E && /* @__PURE__ */ n(T, { children: [
|
|
1822
|
+
/* @__PURE__ */ e(rs, {}),
|
|
1823
|
+
/* @__PURE__ */ e(ss, {})
|
|
1815
1824
|
] }),
|
|
1816
|
-
!E && p &&
|
|
1825
|
+
!E && p && Ie.showDashboardSharing && /* @__PURE__ */ n(
|
|
1817
1826
|
U,
|
|
1818
1827
|
{
|
|
1819
1828
|
variant: "outline",
|
|
1820
1829
|
size: "xs",
|
|
1821
1830
|
onClick: () => K(!0),
|
|
1822
1831
|
children: [
|
|
1823
|
-
/* @__PURE__ */ e(
|
|
1832
|
+
/* @__PURE__ */ e(Rr, { className: "h-3.5 w-3.5" }),
|
|
1824
1833
|
"Share"
|
|
1825
1834
|
]
|
|
1826
1835
|
}
|
|
1827
1836
|
),
|
|
1828
|
-
!E && x && m.canUseFilters && p && /* @__PURE__ */ e(
|
|
1829
|
-
x && !E && ue && y && l && p && /* @__PURE__ */
|
|
1837
|
+
!E && x && m.canUseFilters && p && /* @__PURE__ */ e(ns, {}),
|
|
1838
|
+
x && !E && ue && y && l && p && /* @__PURE__ */ n(
|
|
1830
1839
|
U,
|
|
1831
1840
|
{
|
|
1832
1841
|
variant: "secondary",
|
|
1833
1842
|
size: "xs",
|
|
1834
1843
|
disabled: q,
|
|
1835
|
-
onClick:
|
|
1844
|
+
onClick: Oa,
|
|
1836
1845
|
children: [
|
|
1837
|
-
/* @__PURE__ */ e(
|
|
1846
|
+
/* @__PURE__ */ e(Wt, { className: "h-3.5 w-3.5" }),
|
|
1838
1847
|
"Save Lens"
|
|
1839
1848
|
]
|
|
1840
1849
|
}
|
|
1841
1850
|
),
|
|
1842
|
-
x && !E && p && !P && /* @__PURE__ */
|
|
1843
|
-
/* @__PURE__ */
|
|
1851
|
+
x && !E && p && !P && /* @__PURE__ */ n("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
|
|
1852
|
+
/* @__PURE__ */ n(
|
|
1844
1853
|
U,
|
|
1845
1854
|
{
|
|
1846
1855
|
variant: "ghost",
|
|
1847
1856
|
size: "xs",
|
|
1848
1857
|
disabled: !x,
|
|
1849
|
-
onClick: () => void
|
|
1858
|
+
onClick: () => void Ia(),
|
|
1850
1859
|
className: "h-full rounded-none border-0 shadow-none hover:bg-accent",
|
|
1851
1860
|
children: [
|
|
1852
1861
|
/* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
|
|
@@ -1854,8 +1863,8 @@ function ws() {
|
|
|
1854
1863
|
]
|
|
1855
1864
|
}
|
|
1856
1865
|
),
|
|
1857
|
-
/* @__PURE__ */
|
|
1858
|
-
/* @__PURE__ */ e(
|
|
1866
|
+
/* @__PURE__ */ n(_t, { modal: !1, children: [
|
|
1867
|
+
/* @__PURE__ */ e(qt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1859
1868
|
U,
|
|
1860
1869
|
{
|
|
1861
1870
|
variant: "ghost",
|
|
@@ -1863,15 +1872,15 @@ function ws() {
|
|
|
1863
1872
|
className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
|
|
1864
1873
|
"aria-label": "Open visual options",
|
|
1865
1874
|
disabled: !x,
|
|
1866
|
-
children: /* @__PURE__ */ e(
|
|
1875
|
+
children: /* @__PURE__ */ e(Xr, { className: "h-3.5 w-3.5" })
|
|
1867
1876
|
}
|
|
1868
1877
|
) }),
|
|
1869
1878
|
/* @__PURE__ */ e(
|
|
1870
|
-
|
|
1879
|
+
Ht,
|
|
1871
1880
|
{
|
|
1872
1881
|
align: "end",
|
|
1873
1882
|
className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
1874
|
-
children: /* @__PURE__ */
|
|
1883
|
+
children: /* @__PURE__ */ n(O, { onClick: () => bt(!0), children: [
|
|
1875
1884
|
/* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
|
|
1876
1885
|
"From library..."
|
|
1877
1886
|
] })
|
|
@@ -1879,52 +1888,52 @@ function ws() {
|
|
|
1879
1888
|
)
|
|
1880
1889
|
] }),
|
|
1881
1890
|
/* @__PURE__ */ e(
|
|
1882
|
-
|
|
1891
|
+
os,
|
|
1883
1892
|
{
|
|
1884
1893
|
open: De,
|
|
1885
|
-
onOpenChange:
|
|
1894
|
+
onOpenChange: bt
|
|
1886
1895
|
}
|
|
1887
1896
|
)
|
|
1888
1897
|
] }),
|
|
1889
|
-
!E && !x && ke && p && /* @__PURE__ */
|
|
1890
|
-
/* @__PURE__ */ e(
|
|
1898
|
+
!E && !x && ke && p && /* @__PURE__ */ n(U, { size: "xs", onClick: Aa, children: [
|
|
1899
|
+
/* @__PURE__ */ e(Vr, { className: "h-3.5 w-3.5" }),
|
|
1891
1900
|
"Edit"
|
|
1892
1901
|
] }),
|
|
1893
|
-
|
|
1902
|
+
Ct && p && It && /* @__PURE__ */ n(
|
|
1894
1903
|
U,
|
|
1895
1904
|
{
|
|
1896
1905
|
variant: "outline",
|
|
1897
1906
|
size: "xs",
|
|
1898
|
-
onClick:
|
|
1899
|
-
disabled:
|
|
1907
|
+
onClick: Va,
|
|
1908
|
+
disabled: Pe,
|
|
1900
1909
|
children: [
|
|
1901
|
-
/* @__PURE__ */ e(
|
|
1910
|
+
/* @__PURE__ */ e(Fr, { className: "h-3.5 w-3.5" }),
|
|
1902
1911
|
"Undo"
|
|
1903
1912
|
]
|
|
1904
1913
|
}
|
|
1905
1914
|
),
|
|
1906
|
-
|
|
1915
|
+
Ct && p && /* @__PURE__ */ n(
|
|
1907
1916
|
U,
|
|
1908
1917
|
{
|
|
1909
1918
|
size: "xs",
|
|
1910
|
-
className: ge(!
|
|
1911
|
-
disabled:
|
|
1912
|
-
onClick: () =>
|
|
1919
|
+
className: ge(!Et && "opacity-60"),
|
|
1920
|
+
disabled: Pe || !Et,
|
|
1921
|
+
onClick: () => Ye(),
|
|
1913
1922
|
children: [
|
|
1914
|
-
|
|
1915
|
-
|
|
1923
|
+
Pe ? /* @__PURE__ */ e(Be, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Wt, { className: "h-3.5 w-3.5" }),
|
|
1924
|
+
Pe ? "Saving..." : "Save"
|
|
1916
1925
|
]
|
|
1917
1926
|
}
|
|
1918
1927
|
),
|
|
1919
|
-
x && !E && p && /* @__PURE__ */
|
|
1920
|
-
/* @__PURE__ */ e(
|
|
1928
|
+
x && !E && p && /* @__PURE__ */ n(U, { variant: "outline", size: "xs", onClick: Pa, children: [
|
|
1929
|
+
/* @__PURE__ */ e(oa, { className: "h-3.5 w-3.5" }),
|
|
1921
1930
|
"Close"
|
|
1922
1931
|
] }),
|
|
1923
|
-
!E && p && /* @__PURE__ */ e("div", { className: "ml-2", children: /* @__PURE__ */ e(
|
|
1924
|
-
!E && l && /* @__PURE__ */ e(
|
|
1925
|
-
!E && p && /* @__PURE__ */
|
|
1926
|
-
/* @__PURE__ */ e(
|
|
1927
|
-
|
|
1932
|
+
!E && p && /* @__PURE__ */ e("div", { className: "ml-2", children: /* @__PURE__ */ e(is, {}) }),
|
|
1933
|
+
!E && l && /* @__PURE__ */ e(Ns, {}),
|
|
1934
|
+
!E && p && /* @__PURE__ */ n(_t, { children: [
|
|
1935
|
+
/* @__PURE__ */ e(qt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1936
|
+
zt,
|
|
1928
1937
|
{
|
|
1929
1938
|
tooltip: "More Options",
|
|
1930
1939
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
@@ -1933,60 +1942,60 @@ function ws() {
|
|
|
1933
1942
|
variant: "ghost",
|
|
1934
1943
|
"aria-label": "More dashboard options"
|
|
1935
1944
|
},
|
|
1936
|
-
children: /* @__PURE__ */ e(
|
|
1945
|
+
children: /* @__PURE__ */ e(Or, { className: "h-3.5 w-3.5" })
|
|
1937
1946
|
}
|
|
1938
1947
|
) }),
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
|
|
1948
|
+
/* @__PURE__ */ n(
|
|
1949
|
+
Ht,
|
|
1941
1950
|
{
|
|
1942
1951
|
align: "end",
|
|
1943
1952
|
className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
|
|
1944
1953
|
children: [
|
|
1945
1954
|
/* @__PURE__ */ e(fe, { children: "Reports & briefings" }),
|
|
1946
|
-
/* @__PURE__ */
|
|
1955
|
+
/* @__PURE__ */ n(
|
|
1947
1956
|
O,
|
|
1948
1957
|
{
|
|
1949
1958
|
disabled: u,
|
|
1950
1959
|
onSelect: () => Ne(!0),
|
|
1951
1960
|
children: [
|
|
1952
|
-
/* @__PURE__ */ e(
|
|
1961
|
+
/* @__PURE__ */ e(Tr, { className: "h-3.5 w-3.5" }),
|
|
1953
1962
|
"Export"
|
|
1954
1963
|
]
|
|
1955
1964
|
}
|
|
1956
1965
|
),
|
|
1957
1966
|
/* @__PURE__ */ e(
|
|
1958
|
-
|
|
1967
|
+
an,
|
|
1959
1968
|
{
|
|
1960
|
-
scheduleReportVisible: !!(
|
|
1961
|
-
analyticalBriefingVisible: !!(
|
|
1969
|
+
scheduleReportVisible: !!(Lt && o.surfaceVisible && $ && !x),
|
|
1970
|
+
analyticalBriefingVisible: !!(Lt && o.surfaceVisible && $ && !x),
|
|
1962
1971
|
onScheduleReport: () => ee("scheduled_report"),
|
|
1963
1972
|
onCreateAnalyticalBriefing: () => ee("analytical_briefing")
|
|
1964
1973
|
}
|
|
1965
1974
|
),
|
|
1966
|
-
/* @__PURE__ */ e(
|
|
1967
|
-
|
|
1975
|
+
/* @__PURE__ */ e(Te, {}),
|
|
1976
|
+
Ie.showGroupManagement && /* @__PURE__ */ n(T, { children: [
|
|
1968
1977
|
/* @__PURE__ */ e(fe, { children: "Access" }),
|
|
1969
|
-
/* @__PURE__ */
|
|
1978
|
+
/* @__PURE__ */ n(
|
|
1970
1979
|
O,
|
|
1971
1980
|
{
|
|
1972
1981
|
onClick: () => Q(!0),
|
|
1973
1982
|
children: [
|
|
1974
|
-
/* @__PURE__ */ e(
|
|
1983
|
+
/* @__PURE__ */ e(da, { className: "h-3.5 w-3.5" }),
|
|
1975
1984
|
"Manage Groups"
|
|
1976
1985
|
]
|
|
1977
1986
|
}
|
|
1978
1987
|
),
|
|
1979
|
-
/* @__PURE__ */ e(
|
|
1988
|
+
/* @__PURE__ */ e(Te, {})
|
|
1980
1989
|
] }),
|
|
1981
1990
|
/* @__PURE__ */ e(fe, { children: "Preferences" }),
|
|
1982
|
-
/* @__PURE__ */
|
|
1983
|
-
/* @__PURE__ */ e(
|
|
1991
|
+
/* @__PURE__ */ n(O, { onClick: () => re(!0), children: [
|
|
1992
|
+
/* @__PURE__ */ e(la, { className: "h-3.5 w-3.5" }),
|
|
1984
1993
|
"Calendar Preferences"
|
|
1985
1994
|
] }),
|
|
1986
|
-
l && p && /* @__PURE__ */
|
|
1987
|
-
/* @__PURE__ */ e(
|
|
1995
|
+
l && p && /* @__PURE__ */ n(T, { children: [
|
|
1996
|
+
/* @__PURE__ */ e(Te, {}),
|
|
1988
1997
|
/* @__PURE__ */ e(fe, { children: "Developer" }),
|
|
1989
|
-
/* @__PURE__ */
|
|
1998
|
+
/* @__PURE__ */ n(
|
|
1990
1999
|
O,
|
|
1991
2000
|
{
|
|
1992
2001
|
onSelect: () => {
|
|
@@ -1996,24 +2005,24 @@ function ws() {
|
|
|
1996
2005
|
).catch(() => C.error("Unable to copy token")) : C.error("Clipboard not available"));
|
|
1997
2006
|
},
|
|
1998
2007
|
children: [
|
|
1999
|
-
/* @__PURE__ */ e(
|
|
2008
|
+
/* @__PURE__ */ e(jt, { className: "h-3.5 w-3.5" }),
|
|
2000
2009
|
"Copy token"
|
|
2001
2010
|
]
|
|
2002
2011
|
}
|
|
2003
2012
|
),
|
|
2004
|
-
P && /* @__PURE__ */
|
|
2013
|
+
P && /* @__PURE__ */ n(
|
|
2005
2014
|
O,
|
|
2006
2015
|
{
|
|
2007
|
-
disabled: !
|
|
2016
|
+
disabled: !Je,
|
|
2008
2017
|
onSelect: () => {
|
|
2009
2018
|
var i;
|
|
2010
|
-
if (!
|
|
2019
|
+
if (!Je) {
|
|
2011
2020
|
C.error(
|
|
2012
2021
|
"Open a document sheet with a token to copy the local PDF URL"
|
|
2013
2022
|
);
|
|
2014
2023
|
return;
|
|
2015
2024
|
}
|
|
2016
|
-
(i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(
|
|
2025
|
+
(i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(Je).then(
|
|
2017
2026
|
() => C.success(
|
|
2018
2027
|
"Local document PDF URL copied to clipboard"
|
|
2019
2028
|
)
|
|
@@ -2024,78 +2033,78 @@ function ws() {
|
|
|
2024
2033
|
) : C.error("Clipboard not available");
|
|
2025
2034
|
},
|
|
2026
2035
|
children: [
|
|
2027
|
-
/* @__PURE__ */ e(
|
|
2036
|
+
/* @__PURE__ */ e(jt, { className: "h-3.5 w-3.5" }),
|
|
2028
2037
|
"Copy local document PDF URL"
|
|
2029
2038
|
]
|
|
2030
2039
|
}
|
|
2031
2040
|
),
|
|
2032
|
-
/* @__PURE__ */
|
|
2041
|
+
/* @__PURE__ */ n(
|
|
2033
2042
|
O,
|
|
2034
2043
|
{
|
|
2035
|
-
onSelect: () =>
|
|
2044
|
+
onSelect: () => Xa(s.apiServiceUrl),
|
|
2036
2045
|
children: [
|
|
2037
|
-
/* @__PURE__ */ e(
|
|
2046
|
+
/* @__PURE__ */ e(vs, { className: "h-3.5 w-3.5" }),
|
|
2038
2047
|
"Invalidate token"
|
|
2039
2048
|
]
|
|
2040
2049
|
}
|
|
2041
2050
|
),
|
|
2042
|
-
/* @__PURE__ */
|
|
2043
|
-
/* @__PURE__ */ e(
|
|
2051
|
+
/* @__PURE__ */ n(O, { onSelect: h, children: [
|
|
2052
|
+
/* @__PURE__ */ e(hs, { className: "h-3.5 w-3.5" }),
|
|
2044
2053
|
"Brand Studio"
|
|
2045
2054
|
] }),
|
|
2046
|
-
x && /* @__PURE__ */
|
|
2055
|
+
x && /* @__PURE__ */ n(
|
|
2047
2056
|
O,
|
|
2048
2057
|
{
|
|
2049
|
-
onSelect: () =>
|
|
2058
|
+
onSelect: () => wt(!vt),
|
|
2050
2059
|
children: [
|
|
2051
|
-
/* @__PURE__ */ e(
|
|
2052
|
-
|
|
2060
|
+
/* @__PURE__ */ e(fs, { className: "h-3.5 w-3.5" }),
|
|
2061
|
+
vt ? "Hide dashboard JSON" : "Show dashboard JSON"
|
|
2053
2062
|
]
|
|
2054
2063
|
}
|
|
2055
2064
|
),
|
|
2056
|
-
ue && x && /* @__PURE__ */
|
|
2065
|
+
ue && x && /* @__PURE__ */ n(O, { onSelect: () => se(!0), children: [
|
|
2057
2066
|
/* @__PURE__ */ e(H, { className: "h-3.5 w-3.5" }),
|
|
2058
2067
|
"Add lens"
|
|
2059
2068
|
] }),
|
|
2060
|
-
ue && /* @__PURE__ */
|
|
2061
|
-
/* @__PURE__ */
|
|
2062
|
-
/* @__PURE__ */ e(
|
|
2069
|
+
ue && /* @__PURE__ */ n(Br, { children: [
|
|
2070
|
+
/* @__PURE__ */ n(Gr, { children: [
|
|
2071
|
+
/* @__PURE__ */ e(gs, { className: "h-3.5 w-3.5" }),
|
|
2063
2072
|
"Lenses"
|
|
2064
2073
|
] }),
|
|
2065
|
-
/* @__PURE__ */ e(
|
|
2074
|
+
/* @__PURE__ */ e($r, { className: "w-60", children: /* @__PURE__ */ e(Is, {}) })
|
|
2066
2075
|
] })
|
|
2067
2076
|
] })
|
|
2068
2077
|
]
|
|
2069
2078
|
}
|
|
2070
2079
|
)
|
|
2071
2080
|
] }),
|
|
2072
|
-
|
|
2073
|
-
|
|
2081
|
+
$e && Dt && /* @__PURE__ */ e(
|
|
2082
|
+
zr,
|
|
2074
2083
|
{
|
|
2075
|
-
resource:
|
|
2076
|
-
resourceType:
|
|
2084
|
+
resource: Dt,
|
|
2085
|
+
resourceType: at.DASHBOARD,
|
|
2077
2086
|
onClose: () => K(!1)
|
|
2078
2087
|
}
|
|
2079
2088
|
),
|
|
2080
|
-
/* @__PURE__ */ e(
|
|
2081
|
-
|
|
2089
|
+
Ie.showGroupManagement && /* @__PURE__ */ e(
|
|
2090
|
+
Ks,
|
|
2082
2091
|
{
|
|
2083
2092
|
open: te,
|
|
2084
2093
|
onOpenChange: Q
|
|
2085
2094
|
}
|
|
2086
2095
|
),
|
|
2087
2096
|
/* @__PURE__ */ e(
|
|
2088
|
-
|
|
2097
|
+
ms,
|
|
2089
2098
|
{
|
|
2090
2099
|
open: ae,
|
|
2091
2100
|
onOpenChange: re
|
|
2092
2101
|
}
|
|
2093
2102
|
),
|
|
2094
|
-
|
|
2095
|
-
|
|
2103
|
+
$ && ye ? /* @__PURE__ */ e(
|
|
2104
|
+
ds,
|
|
2096
2105
|
{
|
|
2097
|
-
dashboardId:
|
|
2098
|
-
dashboardTitle: (c == null ? void 0 : c.title) || (
|
|
2106
|
+
dashboardId: $,
|
|
2107
|
+
dashboardTitle: (c == null ? void 0 : c.title) || (G == null ? void 0 : G.title),
|
|
2099
2108
|
open: !0,
|
|
2100
2109
|
onOpenChange: (i) => {
|
|
2101
2110
|
i || ee(null);
|
|
@@ -2104,69 +2113,69 @@ function ws() {
|
|
|
2104
2113
|
workflowIntent: ye
|
|
2105
2114
|
}
|
|
2106
2115
|
) : null,
|
|
2107
|
-
l && ue && p && /* @__PURE__ */ e(
|
|
2116
|
+
l && ue && p && /* @__PURE__ */ e(Ss, { open: ze, onOpenChange: se }),
|
|
2108
2117
|
p && /* @__PURE__ */ e(
|
|
2109
|
-
|
|
2118
|
+
_r,
|
|
2110
2119
|
{
|
|
2111
2120
|
open: we,
|
|
2112
2121
|
onOpenChange: Ne
|
|
2113
2122
|
}
|
|
2114
2123
|
),
|
|
2115
2124
|
/* @__PURE__ */ e(
|
|
2116
|
-
|
|
2125
|
+
qr,
|
|
2117
2126
|
{
|
|
2118
|
-
open:
|
|
2127
|
+
open: _e,
|
|
2119
2128
|
onOpenChange: (i) => {
|
|
2120
|
-
!i &&
|
|
2129
|
+
!i && Ke && !g || (B(i), i || (R(null), W([]), J(!1)));
|
|
2121
2130
|
},
|
|
2122
|
-
children: /* @__PURE__ */
|
|
2123
|
-
/* @__PURE__ */
|
|
2124
|
-
/* @__PURE__ */ e(
|
|
2125
|
-
/* @__PURE__ */ e(
|
|
2126
|
-
|
|
2131
|
+
children: /* @__PURE__ */ n(Hr, { className: "max-w-sm", children: [
|
|
2132
|
+
/* @__PURE__ */ n(jr, { children: [
|
|
2133
|
+
/* @__PURE__ */ e(Kr, { children: g ? "Save failed" : "Saving dashboard" }),
|
|
2134
|
+
/* @__PURE__ */ e(Qr, { className: "pt-2", children: g ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
|
|
2135
|
+
ne.length > 0 && /* @__PURE__ */ n("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
|
|
2127
2136
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
|
|
2128
|
-
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children:
|
|
2137
|
+
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: ne.slice(0, 5).map((i) => /* @__PURE__ */ e("li", { children: i }, i)) })
|
|
2129
2138
|
] })
|
|
2130
2139
|
] }),
|
|
2131
|
-
/* @__PURE__ */ e(
|
|
2140
|
+
/* @__PURE__ */ e(Wr, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: g ? /* @__PURE__ */ n(T, { children: [
|
|
2132
2141
|
/* @__PURE__ */ e(
|
|
2133
|
-
|
|
2142
|
+
Jr,
|
|
2134
2143
|
{
|
|
2135
2144
|
onClick: () => {
|
|
2136
|
-
|
|
2145
|
+
B(!1), R(null), W([]), J(!1);
|
|
2137
2146
|
},
|
|
2138
2147
|
className: "m-0",
|
|
2139
2148
|
children: "Close"
|
|
2140
2149
|
}
|
|
2141
2150
|
),
|
|
2142
2151
|
/* @__PURE__ */ e(
|
|
2143
|
-
|
|
2152
|
+
Kt,
|
|
2144
2153
|
{
|
|
2145
|
-
onClick: () =>
|
|
2154
|
+
onClick: () => Ye({
|
|
2146
2155
|
closeAfterSave: oe,
|
|
2147
|
-
navigateHomeAfterSave:
|
|
2156
|
+
navigateHomeAfterSave: We === "home"
|
|
2148
2157
|
}),
|
|
2149
2158
|
className: "m-0",
|
|
2150
2159
|
children: "Retry"
|
|
2151
2160
|
}
|
|
2152
2161
|
)
|
|
2153
|
-
] }) : /* @__PURE__ */
|
|
2154
|
-
/* @__PURE__ */ e(
|
|
2162
|
+
] }) : /* @__PURE__ */ n(Kt, { disabled: !0, className: "m-0 cursor-default", children: [
|
|
2163
|
+
/* @__PURE__ */ e(Be, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2155
2164
|
"Saving..."
|
|
2156
2165
|
] }) })
|
|
2157
2166
|
] })
|
|
2158
2167
|
}
|
|
2159
2168
|
),
|
|
2160
2169
|
/* @__PURE__ */ e(
|
|
2161
|
-
|
|
2170
|
+
ls,
|
|
2162
2171
|
{
|
|
2163
|
-
open:
|
|
2172
|
+
open: Ma,
|
|
2164
2173
|
onOpenChange: (i) => {
|
|
2165
2174
|
le(i);
|
|
2166
2175
|
},
|
|
2167
|
-
onSave:
|
|
2168
|
-
onDiscard:
|
|
2169
|
-
isSaving:
|
|
2176
|
+
onSave: Ua,
|
|
2177
|
+
onDiscard: Ra,
|
|
2178
|
+
isSaving: Ke,
|
|
2170
2179
|
saveLabel: "Save",
|
|
2171
2180
|
discardLabel: "Discard"
|
|
2172
2181
|
}
|
|
@@ -2176,9 +2185,9 @@ function ws() {
|
|
|
2176
2185
|
}
|
|
2177
2186
|
);
|
|
2178
2187
|
}
|
|
2179
|
-
function
|
|
2188
|
+
function rn({
|
|
2180
2189
|
accessToken: t,
|
|
2181
|
-
dashboardId:
|
|
2190
|
+
dashboardId: s,
|
|
2182
2191
|
selectedSheetId: r,
|
|
2183
2192
|
pageSize: a,
|
|
2184
2193
|
orientation: o,
|
|
@@ -2187,10 +2196,10 @@ function ts({
|
|
|
2187
2196
|
if (!t || !r)
|
|
2188
2197
|
return null;
|
|
2189
2198
|
const h = new URL("http://localhost:5173/print-document");
|
|
2190
|
-
h.searchParams.set("token", t),
|
|
2199
|
+
h.searchParams.set("token", t), s && h.searchParams.set("dashboardId", s), h.searchParams.set("selectedSheetId", r), l && h.searchParams.set("theme", l);
|
|
2191
2200
|
const m = new URL("http://127.0.0.1:3002/");
|
|
2192
2201
|
return m.searchParams.set("pdfMode", "document"), m.searchParams.set("pageSize", a || "letter"), m.searchParams.set("orientation", o || "portrait"), m.searchParams.set("url", h.toString()), m.toString();
|
|
2193
2202
|
}
|
|
2194
2203
|
export {
|
|
2195
|
-
|
|
2204
|
+
Cn as default
|
|
2196
2205
|
};
|