react-semaphor 0.1.313 → 0.1.315
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brand-studio/index.js +4 -4
- package/dist/chunks/{braces-raPCNcS4.js → braces-CWi8x9ww.js} +1 -1
- package/dist/chunks/calendar-preferences-dialog-B3JYKgek.js +456 -0
- package/dist/chunks/calendar-preferences-dialog-aODuCeYE.js +1 -0
- package/dist/chunks/{chevrons-up-down-BYzO4q5w.js → chevrons-up-down-B2viXO2I.js} +1 -1
- package/dist/chunks/dashboard-controls-CSunAZVx.js +57 -0
- package/dist/chunks/{dashboard-controls-DMsmUQkB.js → dashboard-controls-jvJF-AJC.js} +501 -523
- package/dist/chunks/{dashboard-filter-controls-launcher-DBmNn4EY.js → dashboard-filter-controls-launcher-B0i9xSZZ.js} +1 -1
- package/dist/chunks/{dashboard-filter-controls-launcher-CqXgWEa1.js → dashboard-filter-controls-launcher-DG6yRPmx.js} +39 -39
- package/dist/chunks/{dashboard-json-DMFZLkws.js → dashboard-json-Duea3KSa.js} +1 -1
- package/dist/chunks/{dashboard-json-CHoCrAp0.js → dashboard-json-zKDTezgS.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-B0Ae_O25.js → edit-dashboard-visual-MZCJaPiq.js} +419 -419
- package/dist/chunks/{edit-dashboard-visual-CIP9G-Bu.js → edit-dashboard-visual-QjRIAadP.js} +1 -1
- package/dist/chunks/{index-DjZqoaV5.js → index-B7C8qBWC.js} +193 -193
- package/dist/chunks/{index-D7e2Eyp_.js → index-CjRLHvSp.js} +17676 -17583
- package/dist/chunks/{palette-7yJYVEvk.js → palette-CIuwlEiG.js} +1 -1
- package/dist/chunks/{resource-management-panel-B1mhnY97.js → resource-management-panel-CM3Zsk9H.js} +1 -1
- package/dist/chunks/{resource-management-panel-CSkNW3es.js → resource-management-panel-S0LXyguo.js} +18 -18
- package/dist/chunks/{save-DDX_vrED.js → save-_ALpoMy6.js} +1 -1
- package/dist/chunks/{switch-DEPWsRhf.js → switch-B6fh8nb-.js} +25 -25
- package/dist/chunks/{use-create-flow-overlay-state-BHQjJwik.js → use-create-flow-overlay-state-Cp7PYD-t.js} +4 -4
- package/dist/chunks/{use-create-flow-overlay-state-7LiC_vaL.js → use-create-flow-overlay-state-CqTBDwBF.js} +1 -1
- package/dist/chunks/{use-visual-utils-Dw-uLgop.js → use-visual-utils-D9DsvP1v.js} +12 -12
- package/dist/chunks/{use-visual-utils-Bz7kjSrk.js → use-visual-utils-DDd0pAJ_.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +69 -70
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +7 -8
- package/dist/types/main.d.ts +0 -11
- package/dist/types/surfboard.d.ts +0 -10
- package/package.json +1 -1
- package/dist/chunks/dashboard-controls-wPVXTTiH.js +0 -57
- package/dist/chunks/dashboard-summary-settings-dialog-CZkn4rtm.js +0 -545
- package/dist/chunks/dashboard-summary-settings-dialog-DoxcpXjk.js +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as P } from "react/jsx-runtime";
|
|
2
|
-
import { c as V, u as S, B as A, aD as
|
|
3
|
-
import { ch as
|
|
2
|
+
import { c as V, u as S, B as A, aD as ua, h as Za, L as ea, x as de, a as W, aE as _e, aF as es, aG as as, I as Zs, f as X, aH as et, aI as at, aJ as aa, T as ss, k as ts, l as Pe, n as Te, m as sa, aK as rs, aC as st, i as Va, s as tt, t as rt, v as nt, w as ot, K as it, aL as ct } from "./switch-B6fh8nb-.js";
|
|
3
|
+
import { ch as lt, u as j, b as ma, ci as dt, bl as ta, c as ha, d as pa, e as fa, f as ns, n as ut, cj as le, by as Oe, ck as mt, cl as ja, cm as os, cn as is, co as ht, bO as ga, cp as pt, cq as ft, cr as gt, cs as vt, ct as bt, cu as yt, q as Ue, M as Re, o as M, bV as xt, cv as St, cw as Nt, bS as ra, cx as na, bx as va, bc as cs, ba as ls, cy as wt, bF as ds, bG as us, bH as ms, bI as hs, bJ as ps, bK as fs, bL as gs, bM as oa, bp as Dt, cz as Ct, cA as Et, W as Lt, V as ke, a0 as Mt, X as Qe, cB as At, cC as kt, cD as It, ac as Ot, cE as Pt, I as Je, cF as Tt, cG as _t, cH as Ut, cf as Rt, bq as Gt, br as Ft, bs as $t, bt as zt, bu as F, bZ as Ht, K as qt, bA as Vt, bv as Ba, cI as jt, cJ as Bt, cK as Kt, $ as Qt, L as Jt, cL as Wt, H as ia } from "./index-CjRLHvSp.js";
|
|
4
4
|
import * as k from "react";
|
|
5
|
-
import
|
|
5
|
+
import vs, { useState as x, useMemo as q, useEffect as We, useCallback as Xt } from "react";
|
|
6
6
|
import "./index-CJdxSyQq.js";
|
|
7
7
|
import "react-dom";
|
|
8
|
-
import { b as
|
|
9
|
-
import { d as
|
|
10
|
-
import { C as
|
|
11
|
-
import { u as
|
|
12
|
-
import { s as
|
|
13
|
-
import { S as
|
|
14
|
-
import { P as
|
|
15
|
-
import { B as
|
|
8
|
+
import { b as Yt, u as Zt, A as er, V as ar, e as sr, N as tr, U as rr } from "./dashboard-filter-controls-launcher-DG6yRPmx.js";
|
|
9
|
+
import { d as nr } from "./index-DFOb_6HB.js";
|
|
10
|
+
import { C as or } from "./calendar-preferences-dialog-B3JYKgek.js";
|
|
11
|
+
import { u as ir } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
12
|
+
import { s as Xe } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
|
|
13
|
+
import { S as Ka } from "./save-_ALpoMy6.js";
|
|
14
|
+
import { P as cr } from "./palette-CIuwlEiG.js";
|
|
15
|
+
import { B as lr } from "./braces-CWi8x9ww.js";
|
|
16
16
|
/**
|
|
17
17
|
* @license lucide-react v0.453.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
22
|
+
const dr = V("Glasses", [
|
|
23
23
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
24
24
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
25
25
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -32,7 +32,7 @@ const pr = V("Glasses", [
|
|
|
32
32
|
* This source code is licensed under the ISC license.
|
|
33
33
|
* See the LICENSE file in the root directory of this source tree.
|
|
34
34
|
*/
|
|
35
|
-
const
|
|
35
|
+
const ur = V("Menu", [
|
|
36
36
|
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }],
|
|
37
37
|
["line", { x1: "4", x2: "20", y1: "6", y2: "6", key: "1owob3" }],
|
|
38
38
|
["line", { x1: "4", x2: "20", y1: "18", y2: "18", key: "yk5zj1" }]
|
|
@@ -43,7 +43,7 @@ const fr = V("Menu", [
|
|
|
43
43
|
* This source code is licensed under the ISC license.
|
|
44
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
45
45
|
*/
|
|
46
|
-
const
|
|
46
|
+
const mr = V("Monitor", [
|
|
47
47
|
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
48
48
|
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
49
49
|
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
@@ -54,7 +54,7 @@ const gr = V("Monitor", [
|
|
|
54
54
|
* This source code is licensed under the ISC license.
|
|
55
55
|
* See the LICENSE file in the root directory of this source tree.
|
|
56
56
|
*/
|
|
57
|
-
const
|
|
57
|
+
const hr = V("Moon", [
|
|
58
58
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
59
59
|
]);
|
|
60
60
|
/**
|
|
@@ -63,7 +63,7 @@ const vr = V("Moon", [
|
|
|
63
63
|
* This source code is licensed under the ISC license.
|
|
64
64
|
* See the LICENSE file in the root directory of this source tree.
|
|
65
65
|
*/
|
|
66
|
-
const
|
|
66
|
+
const pr = V("ShieldX", [
|
|
67
67
|
[
|
|
68
68
|
"path",
|
|
69
69
|
{
|
|
@@ -80,7 +80,7 @@ const br = V("ShieldX", [
|
|
|
80
80
|
* This source code is licensed under the ISC license.
|
|
81
81
|
* See the LICENSE file in the root directory of this source tree.
|
|
82
82
|
*/
|
|
83
|
-
const
|
|
83
|
+
const fr = V("Sun", [
|
|
84
84
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
85
85
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
86
86
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -97,7 +97,7 @@ const yr = V("Sun", [
|
|
|
97
97
|
* This source code is licensed under the ISC license.
|
|
98
98
|
* See the LICENSE file in the root directory of this source tree.
|
|
99
99
|
*/
|
|
100
|
-
const
|
|
100
|
+
const gr = V("Undo2", [
|
|
101
101
|
["path", { d: "M9 14 4 9l5-5", key: "102s5s" }],
|
|
102
102
|
["path", { d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11", key: "f3b9sd" }]
|
|
103
103
|
]);
|
|
@@ -107,13 +107,13 @@ const xr = V("Undo2", [
|
|
|
107
107
|
* This source code is licensed under the ISC license.
|
|
108
108
|
* See the LICENSE file in the root directory of this source tree.
|
|
109
109
|
*/
|
|
110
|
-
const
|
|
110
|
+
const ca = V("UserPlus", [
|
|
111
111
|
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
112
112
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
113
113
|
["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
|
|
114
114
|
["line", { x1: "22", x2: "16", y1: "11", y2: "11", key: "1shjgl" }]
|
|
115
115
|
]);
|
|
116
|
-
var
|
|
116
|
+
var la = { exports: {} }, Ye = {};
|
|
117
117
|
/**
|
|
118
118
|
* @license React
|
|
119
119
|
* use-sync-external-store-shim.production.js
|
|
@@ -123,26 +123,26 @@ var ua = { exports: {} }, ea = {};
|
|
|
123
123
|
* This source code is licensed under the MIT license found in the
|
|
124
124
|
* LICENSE file in the root directory of this source tree.
|
|
125
125
|
*/
|
|
126
|
-
var
|
|
127
|
-
function
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
var a =
|
|
126
|
+
var Qa;
|
|
127
|
+
function vr() {
|
|
128
|
+
if (Qa) return Ye;
|
|
129
|
+
Qa = 1;
|
|
130
|
+
var a = vs;
|
|
131
131
|
function r(p, h) {
|
|
132
132
|
return p === h && (p !== 0 || 1 / p === 1 / h) || p !== p && h !== h;
|
|
133
133
|
}
|
|
134
|
-
var t = typeof Object.is == "function" ? Object.is : r, s = a.useState,
|
|
134
|
+
var t = typeof Object.is == "function" ? Object.is : r, s = a.useState, n = a.useEffect, d = a.useLayoutEffect, l = a.useDebugValue;
|
|
135
135
|
function u(p, h) {
|
|
136
|
-
var f = h(),
|
|
136
|
+
var f = h(), o = s({ inst: { value: f, getSnapshot: h } }), y = o[0].inst, w = o[1];
|
|
137
137
|
return d(
|
|
138
138
|
function() {
|
|
139
|
-
y.value = f, y.getSnapshot = h, g(y) &&
|
|
139
|
+
y.value = f, y.getSnapshot = h, g(y) && w({ inst: y });
|
|
140
140
|
},
|
|
141
141
|
[p, f, h]
|
|
142
|
-
),
|
|
142
|
+
), n(
|
|
143
143
|
function() {
|
|
144
|
-
return g(y) &&
|
|
145
|
-
g(y) &&
|
|
144
|
+
return g(y) && w({ inst: y }), p(function() {
|
|
145
|
+
g(y) && w({ inst: y });
|
|
146
146
|
});
|
|
147
147
|
},
|
|
148
148
|
[p]
|
|
@@ -162,9 +162,9 @@ function Sr() {
|
|
|
162
162
|
return h();
|
|
163
163
|
}
|
|
164
164
|
var m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? b : u;
|
|
165
|
-
return
|
|
165
|
+
return Ye.useSyncExternalStore = a.useSyncExternalStore !== void 0 ? a.useSyncExternalStore : m, Ye;
|
|
166
166
|
}
|
|
167
|
-
var
|
|
167
|
+
var Ze = {};
|
|
168
168
|
/**
|
|
169
169
|
* @license React
|
|
170
170
|
* use-sync-external-store-shim.development.js
|
|
@@ -174,71 +174,71 @@ var aa = {};
|
|
|
174
174
|
* This source code is licensed under the MIT license found in the
|
|
175
175
|
* LICENSE file in the root directory of this source tree.
|
|
176
176
|
*/
|
|
177
|
-
var
|
|
178
|
-
function
|
|
179
|
-
return
|
|
180
|
-
function a(f,
|
|
181
|
-
return f ===
|
|
177
|
+
var Ja;
|
|
178
|
+
function br() {
|
|
179
|
+
return Ja || (Ja = 1, process.env.NODE_ENV !== "production" && function() {
|
|
180
|
+
function a(f, o) {
|
|
181
|
+
return f === o && (f !== 0 || 1 / f === 1 / o) || f !== f && o !== o;
|
|
182
182
|
}
|
|
183
|
-
function r(f,
|
|
184
|
-
m ||
|
|
183
|
+
function r(f, o) {
|
|
184
|
+
m || n.startTransition === void 0 || (m = !0, console.error(
|
|
185
185
|
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
186
186
|
));
|
|
187
|
-
var y =
|
|
187
|
+
var y = o();
|
|
188
188
|
if (!p) {
|
|
189
|
-
var
|
|
190
|
-
d(y,
|
|
189
|
+
var w = o();
|
|
190
|
+
d(y, w) || (console.error(
|
|
191
191
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
192
192
|
), p = !0);
|
|
193
193
|
}
|
|
194
|
-
|
|
195
|
-
inst: { value: y, getSnapshot:
|
|
194
|
+
w = l({
|
|
195
|
+
inst: { value: y, getSnapshot: o }
|
|
196
196
|
});
|
|
197
|
-
var
|
|
197
|
+
var D = w[0].inst, N = w[1];
|
|
198
198
|
return g(
|
|
199
199
|
function() {
|
|
200
|
-
|
|
200
|
+
D.value = y, D.getSnapshot = o, t(D) && N({ inst: D });
|
|
201
201
|
},
|
|
202
|
-
[f, y,
|
|
202
|
+
[f, y, o]
|
|
203
203
|
), u(
|
|
204
204
|
function() {
|
|
205
|
-
return t(
|
|
206
|
-
t(
|
|
205
|
+
return t(D) && N({ inst: D }), f(function() {
|
|
206
|
+
t(D) && N({ inst: D });
|
|
207
207
|
});
|
|
208
208
|
},
|
|
209
209
|
[f]
|
|
210
210
|
), b(y), y;
|
|
211
211
|
}
|
|
212
212
|
function t(f) {
|
|
213
|
-
var
|
|
213
|
+
var o = f.getSnapshot;
|
|
214
214
|
f = f.value;
|
|
215
215
|
try {
|
|
216
|
-
var y =
|
|
216
|
+
var y = o();
|
|
217
217
|
return !d(f, y);
|
|
218
218
|
} catch {
|
|
219
219
|
return !0;
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
function s(f,
|
|
223
|
-
return
|
|
222
|
+
function s(f, o) {
|
|
223
|
+
return o();
|
|
224
224
|
}
|
|
225
225
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
226
|
-
var
|
|
227
|
-
|
|
228
|
-
}()),
|
|
226
|
+
var n = vs, d = typeof Object.is == "function" ? Object.is : a, l = n.useState, u = n.useEffect, g = n.useLayoutEffect, b = n.useDebugValue, m = !1, p = !1, h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? s : r;
|
|
227
|
+
Ze.useSyncExternalStore = n.useSyncExternalStore !== void 0 ? n.useSyncExternalStore : h, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
228
|
+
}()), Ze;
|
|
229
229
|
}
|
|
230
|
-
process.env.NODE_ENV === "production" ?
|
|
231
|
-
var
|
|
230
|
+
process.env.NODE_ENV === "production" ? la.exports = vr() : la.exports = br();
|
|
231
|
+
var yr = la.exports;
|
|
232
232
|
const Ie = ["light", "dark", "system"];
|
|
233
|
-
function
|
|
234
|
-
const { theme: a, setTheme: r } =
|
|
233
|
+
function xr() {
|
|
234
|
+
const { theme: a, setTheme: r } = lt(), t = S(
|
|
235
235
|
(l) => l.actions.setDashboardTheme
|
|
236
236
|
);
|
|
237
237
|
function s() {
|
|
238
238
|
const l = Ie.includes(a) ? a : "system", u = Ie[(Ie.indexOf(l) + 1) % Ie.length];
|
|
239
239
|
r(u), t(u);
|
|
240
240
|
}
|
|
241
|
-
const
|
|
241
|
+
const n = a === "light" ? fr : a === "dark" ? hr : mr, d = a === "light" ? "Theme: light (click for dark)" : a === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
|
|
242
242
|
return /* @__PURE__ */ e(
|
|
243
243
|
A,
|
|
244
244
|
{
|
|
@@ -249,74 +249,74 @@ function wr() {
|
|
|
249
249
|
onClick: s,
|
|
250
250
|
"aria-label": d,
|
|
251
251
|
title: d,
|
|
252
|
-
children: /* @__PURE__ */ e(
|
|
252
|
+
children: /* @__PURE__ */ e(n, { className: "h-3.5 w-3.5", strokeWidth: 1.5 })
|
|
253
253
|
}
|
|
254
254
|
);
|
|
255
255
|
}
|
|
256
|
-
async function
|
|
257
|
-
if (!
|
|
256
|
+
async function Sr(a, r, t, s, n) {
|
|
257
|
+
if (!n)
|
|
258
258
|
return null;
|
|
259
259
|
const d = JSON.stringify(t), l = `${a}/v1/lens`;
|
|
260
|
-
return await
|
|
260
|
+
return await ua(l, n, {
|
|
261
261
|
name: r,
|
|
262
262
|
template: d,
|
|
263
263
|
filterValues: s,
|
|
264
264
|
operation: "create"
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
|
-
async function
|
|
267
|
+
async function da(a, r, t) {
|
|
268
268
|
if (!t)
|
|
269
269
|
return null;
|
|
270
|
-
const { id: s, template:
|
|
271
|
-
return await
|
|
270
|
+
const { id: s, template: n, filterValues: d, isDefault: l, shared: u } = r, g = `${a}/v1/lens`;
|
|
271
|
+
return await ua(g, t, {
|
|
272
272
|
lensId: s,
|
|
273
|
-
template:
|
|
273
|
+
template: n,
|
|
274
274
|
filterValues: d,
|
|
275
275
|
isDefault: l,
|
|
276
276
|
shared: u,
|
|
277
277
|
operation: "update"
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
|
-
async function
|
|
280
|
+
async function Nr(a, r, t) {
|
|
281
281
|
if (!t)
|
|
282
282
|
return null;
|
|
283
283
|
const s = `${a}/v1/lens`;
|
|
284
|
-
return await
|
|
284
|
+
return await ua(s, t, {
|
|
285
285
|
operation: "delete",
|
|
286
286
|
lensId: r
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
|
-
const
|
|
290
|
-
function
|
|
289
|
+
const wr = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
290
|
+
function Dr({
|
|
291
291
|
open: a,
|
|
292
292
|
onOpenChange: r
|
|
293
293
|
} = {}) {
|
|
294
|
-
const [t, s] = x(""), [
|
|
294
|
+
const [t, s] = x(""), [n, d] = x(!1), l = S((E) => E.lenses), { setLenses: u, setSelectedLensId: g } = Za(), [b, m] = x(!1), [p, h] = x(!1), f = a !== void 0, o = f ? a : p, y = (E) => {
|
|
295
295
|
f || h(E), r == null || r(E);
|
|
296
|
-
},
|
|
296
|
+
}, w = S((E) => E.dashboard), D = S((E) => E.filterValues), { authToken: N, tokenProps: C } = j();
|
|
297
297
|
async function T() {
|
|
298
298
|
m(!0);
|
|
299
|
-
const E = await
|
|
299
|
+
const E = await Sr(
|
|
300
300
|
C.apiServiceUrl,
|
|
301
301
|
t,
|
|
302
|
-
D,
|
|
303
302
|
w,
|
|
303
|
+
D,
|
|
304
304
|
N == null ? void 0 : N.accessToken
|
|
305
305
|
);
|
|
306
306
|
E && (u([...l || [], E]), g(E.id), y(!1)), m(!1);
|
|
307
307
|
}
|
|
308
|
-
return /* @__PURE__ */ i(
|
|
309
|
-
f ? null : /* @__PURE__ */ e(
|
|
310
|
-
/* @__PURE__ */ e(
|
|
308
|
+
return /* @__PURE__ */ i(ma, { open: o, onOpenChange: y, children: [
|
|
309
|
+
f ? null : /* @__PURE__ */ e(dt, { asChild: !0, children: /* @__PURE__ */ i(A, { variant: "secondary", size: "xs", children: [
|
|
310
|
+
/* @__PURE__ */ e(ta, { className: "h-3.5 w-3.5" }),
|
|
311
311
|
"Lens"
|
|
312
312
|
] }) }),
|
|
313
|
-
/* @__PURE__ */ i(
|
|
314
|
-
/* @__PURE__ */ i(
|
|
315
|
-
/* @__PURE__ */ e(
|
|
316
|
-
/* @__PURE__ */ e(
|
|
313
|
+
/* @__PURE__ */ i(ha, { className: "rounded-control border-border/60 sm:max-w-[420px] sm:rounded-control", children: [
|
|
314
|
+
/* @__PURE__ */ i(pa, { children: [
|
|
315
|
+
/* @__PURE__ */ e(fa, { className: "text-[15px]", children: "Create lens" }),
|
|
316
|
+
/* @__PURE__ */ e(ns, { className: "text-[13px] leading-5", children: "Lenses are private by default and are only visible to you." })
|
|
317
317
|
] }),
|
|
318
318
|
/* @__PURE__ */ i("div", { className: "space-y-1.5 py-1", children: [
|
|
319
|
-
/* @__PURE__ */ e(
|
|
319
|
+
/* @__PURE__ */ e(ea, { htmlFor: "lens-name", className: wr, children: "Name" }),
|
|
320
320
|
/* @__PURE__ */ e(
|
|
321
321
|
de,
|
|
322
322
|
{
|
|
@@ -327,9 +327,9 @@ function Mr({
|
|
|
327
327
|
onChange: (E) => s(E.target.value)
|
|
328
328
|
}
|
|
329
329
|
),
|
|
330
|
-
|
|
330
|
+
n && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: "A lens with this name already exists. Pick a different one." })
|
|
331
331
|
] }),
|
|
332
|
-
/* @__PURE__ */ i(
|
|
332
|
+
/* @__PURE__ */ i(ut, { children: [
|
|
333
333
|
/* @__PURE__ */ e(A, { variant: "outline", size: "xs", onClick: () => y(!1), children: "Cancel" }),
|
|
334
334
|
/* @__PURE__ */ e(
|
|
335
335
|
A,
|
|
@@ -345,23 +345,23 @@ function Mr({
|
|
|
345
345
|
] })
|
|
346
346
|
] });
|
|
347
347
|
}
|
|
348
|
-
function
|
|
349
|
-
const r = S((m) => m.lenses), t = S((m) => m.selectedLensId), { setLenses: s, setSelectedLensId:
|
|
348
|
+
function Cr({ includeLabel: a = !1 } = {}) {
|
|
349
|
+
const r = S((m) => m.lenses), t = S((m) => m.selectedLensId), { setLenses: s, setSelectedLensId: n } = Za(), { authToken: d, tokenProps: l } = j();
|
|
350
350
|
async function u(m) {
|
|
351
|
-
|
|
351
|
+
n(m);
|
|
352
352
|
}
|
|
353
353
|
async function g(m) {
|
|
354
|
-
if (await
|
|
354
|
+
if (await Nr(l.apiServiceUrl, m, d == null ? void 0 : d.accessToken)) {
|
|
355
355
|
const h = r == null ? void 0 : r.filter((f) => f.id !== m);
|
|
356
|
-
s(h || []),
|
|
356
|
+
s(h || []), n("original");
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
async function b(m) {
|
|
360
|
-
const p = r == null ? void 0 : r.map((
|
|
361
|
-
...
|
|
360
|
+
const p = r == null ? void 0 : r.map((o) => o.id === m.id ? {
|
|
361
|
+
...o,
|
|
362
362
|
isDefault: !m.isDefault
|
|
363
363
|
} : {
|
|
364
|
-
...
|
|
364
|
+
...o,
|
|
365
365
|
isDefault: !1
|
|
366
366
|
});
|
|
367
367
|
s(p || []);
|
|
@@ -369,14 +369,14 @@ function Ar({ includeLabel: a = !1 } = {}) {
|
|
|
369
369
|
...m,
|
|
370
370
|
isDefault: !m.isDefault
|
|
371
371
|
};
|
|
372
|
-
await
|
|
373
|
-
const f = r == null ? void 0 : r.find((
|
|
372
|
+
await da(l.apiServiceUrl, h, d == null ? void 0 : d.accessToken);
|
|
373
|
+
const f = r == null ? void 0 : r.find((o) => o.isDefault);
|
|
374
374
|
if (f && f.id !== m.id) {
|
|
375
|
-
const
|
|
375
|
+
const o = {
|
|
376
376
|
...f,
|
|
377
377
|
isDefault: !1
|
|
378
378
|
};
|
|
379
|
-
await
|
|
379
|
+
await da(l.apiServiceUrl, o, d == null ? void 0 : d.accessToken);
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
return /* @__PURE__ */ i(P, { children: [
|
|
@@ -385,14 +385,14 @@ function Ar({ includeLabel: a = !1 } = {}) {
|
|
|
385
385
|
/* @__PURE__ */ e(Oe, {})
|
|
386
386
|
] }) : null,
|
|
387
387
|
/* @__PURE__ */ i(
|
|
388
|
-
|
|
388
|
+
mt,
|
|
389
389
|
{
|
|
390
390
|
value: t,
|
|
391
391
|
onValueChange: u,
|
|
392
392
|
children: [
|
|
393
|
-
/* @__PURE__ */ e(
|
|
393
|
+
/* @__PURE__ */ e(ja, { value: "original", children: "Original" }),
|
|
394
394
|
r == null ? void 0 : r.map((m) => /* @__PURE__ */ i(
|
|
395
|
-
|
|
395
|
+
ja,
|
|
396
396
|
{
|
|
397
397
|
className: "group flex justify-between gap-2",
|
|
398
398
|
value: m.id,
|
|
@@ -400,7 +400,7 @@ function Ar({ includeLabel: a = !1 } = {}) {
|
|
|
400
400
|
/* @__PURE__ */ e("p", { children: m.name }),
|
|
401
401
|
/* @__PURE__ */ i("span", { className: "flex items-center gap-3", children: [
|
|
402
402
|
/* @__PURE__ */ e(
|
|
403
|
-
|
|
403
|
+
os,
|
|
404
404
|
{
|
|
405
405
|
onClick: (p) => {
|
|
406
406
|
p.preventDefault(), b(m);
|
|
@@ -416,7 +416,7 @@ function Ar({ includeLabel: a = !1 } = {}) {
|
|
|
416
416
|
}
|
|
417
417
|
),
|
|
418
418
|
/* @__PURE__ */ e(
|
|
419
|
-
|
|
419
|
+
is,
|
|
420
420
|
{
|
|
421
421
|
onClick: (p) => {
|
|
422
422
|
p.preventDefault(), g(m.id);
|
|
@@ -435,19 +435,19 @@ function Ar({ includeLabel: a = !1 } = {}) {
|
|
|
435
435
|
)
|
|
436
436
|
] });
|
|
437
437
|
}
|
|
438
|
-
function
|
|
439
|
-
const { displayPreferences: a, shouldShowElement: r } =
|
|
440
|
-
() =>
|
|
438
|
+
function Er() {
|
|
439
|
+
const { displayPreferences: a, shouldShowElement: r } = ht(), { currentUser: t, userContext: s } = ga(), n = q(
|
|
440
|
+
() => pt(t),
|
|
441
441
|
[t]
|
|
442
|
-
), d =
|
|
442
|
+
), d = q(() => (u) => n && n[u] !== void 0 && n[u] === !1 ? !1 : r(u), [n, r, a]), l = q(
|
|
443
443
|
() => {
|
|
444
444
|
var u, g, b, m, p;
|
|
445
445
|
return {
|
|
446
|
-
canEdit: ((u = s == null ? void 0 : s.permissions) == null ? void 0 : u.canEdit) ??
|
|
447
|
-
canUseFilters: ((g = s == null ? void 0 : s.permissions) == null ? void 0 : g.canEdit) ??
|
|
448
|
-
canManageDashboards: ((b = s == null ? void 0 : s.permissions) == null ? void 0 : b.canCreateDashboard) ??
|
|
449
|
-
canCreateDashboards: ((m = s == null ? void 0 : s.permissions) == null ? void 0 : m.canCreateDashboard) ??
|
|
450
|
-
canAccessVisuals: ((p = s == null ? void 0 : s.permissions) == null ? void 0 : p.canEdit) ??
|
|
446
|
+
canEdit: ((u = s == null ? void 0 : s.permissions) == null ? void 0 : u.canEdit) ?? yt(t),
|
|
447
|
+
canUseFilters: ((g = s == null ? void 0 : s.permissions) == null ? void 0 : g.canEdit) ?? bt(t),
|
|
448
|
+
canManageDashboards: ((b = s == null ? void 0 : s.permissions) == null ? void 0 : b.canCreateDashboard) ?? vt(t),
|
|
449
|
+
canCreateDashboards: ((m = s == null ? void 0 : s.permissions) == null ? void 0 : m.canCreateDashboard) ?? gt(t),
|
|
450
|
+
canAccessVisuals: ((p = s == null ? void 0 : s.permissions) == null ? void 0 : p.canEdit) ?? ft(t)
|
|
451
451
|
};
|
|
452
452
|
},
|
|
453
453
|
[t, s]
|
|
@@ -459,23 +459,23 @@ function kr() {
|
|
|
459
459
|
currentUser: t
|
|
460
460
|
};
|
|
461
461
|
}
|
|
462
|
-
const
|
|
462
|
+
const Lr = async (a, r, t) => {
|
|
463
463
|
const s = `${a}/management/v1/groups`;
|
|
464
|
-
return await
|
|
465
|
-
},
|
|
464
|
+
return await as(s, r, t);
|
|
465
|
+
}, Mr = async (a, r, t) => {
|
|
466
466
|
const s = `${a}/management/v1/groups/${t}`;
|
|
467
|
-
await
|
|
468
|
-
},
|
|
469
|
-
const
|
|
470
|
-
return await
|
|
471
|
-
},
|
|
472
|
-
const
|
|
473
|
-
await
|
|
467
|
+
await es(s, r, "DELETE");
|
|
468
|
+
}, Ar = async (a, r, t, s) => {
|
|
469
|
+
const n = `${a}/management/v1/groups/${t}/members`;
|
|
470
|
+
return await as(n, r, s);
|
|
471
|
+
}, kr = async (a, r, t, s) => {
|
|
472
|
+
const n = `${a}/management/v1/groups/${t}/members`;
|
|
473
|
+
await es(n, r, "DELETE", s);
|
|
474
474
|
};
|
|
475
|
-
function
|
|
475
|
+
function Ir() {
|
|
476
476
|
const { authToken: a, tokenProps: r } = j(), t = Ue();
|
|
477
477
|
return Re({
|
|
478
|
-
mutationFn: (s) =>
|
|
478
|
+
mutationFn: (s) => Lr(r.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", s),
|
|
479
479
|
onSuccess: () => {
|
|
480
480
|
t.invalidateQueries({ queryKey: ["groups"] }), M.success("Group created successfully");
|
|
481
481
|
},
|
|
@@ -486,12 +486,12 @@ function _r() {
|
|
|
486
486
|
}
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function Or() {
|
|
490
490
|
const { authToken: a, tokenProps: r } = j(), t = Ue();
|
|
491
491
|
return Re({
|
|
492
|
-
mutationFn: (s) =>
|
|
493
|
-
onSuccess: (s,
|
|
494
|
-
t.invalidateQueries({ queryKey: ["groups"] }), t.removeQueries({ queryKey: ["group",
|
|
492
|
+
mutationFn: (s) => Mr(r.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", s),
|
|
493
|
+
onSuccess: (s, n) => {
|
|
494
|
+
t.invalidateQueries({ queryKey: ["groups"] }), t.removeQueries({ queryKey: ["group", n] }), M.success("Group deleted successfully");
|
|
495
495
|
},
|
|
496
496
|
onError: (s) => {
|
|
497
497
|
console.error("Failed to delete group:", s), M.error("Failed to delete group", {
|
|
@@ -500,16 +500,16 @@ function Ur() {
|
|
|
500
500
|
}
|
|
501
501
|
});
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function Pr() {
|
|
504
504
|
const { authToken: a, tokenProps: r } = j(), t = Ue();
|
|
505
505
|
return Re({
|
|
506
506
|
mutationFn: ({
|
|
507
507
|
groupId: s,
|
|
508
|
-
data:
|
|
509
|
-
}) =>
|
|
510
|
-
onSuccess: (s,
|
|
511
|
-
t.invalidateQueries({ queryKey: ["group",
|
|
512
|
-
queryKey: ["group-members",
|
|
508
|
+
data: n
|
|
509
|
+
}) => Ar(r.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", s, n),
|
|
510
|
+
onSuccess: (s, n) => {
|
|
511
|
+
t.invalidateQueries({ queryKey: ["group", n.groupId] }), t.invalidateQueries({
|
|
512
|
+
queryKey: ["group-members", n.groupId]
|
|
513
513
|
}), t.invalidateQueries({ queryKey: ["groups"] }), M.success("Members added successfully");
|
|
514
514
|
},
|
|
515
515
|
onError: (s) => {
|
|
@@ -519,16 +519,16 @@ function Rr() {
|
|
|
519
519
|
}
|
|
520
520
|
});
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function Tr() {
|
|
523
523
|
const { authToken: a, tokenProps: r } = j(), t = Ue();
|
|
524
524
|
return Re({
|
|
525
525
|
mutationFn: ({
|
|
526
526
|
groupId: s,
|
|
527
|
-
data:
|
|
528
|
-
}) =>
|
|
529
|
-
onSuccess: (s,
|
|
530
|
-
t.invalidateQueries({ queryKey: ["group",
|
|
531
|
-
queryKey: ["group-members",
|
|
527
|
+
data: n
|
|
528
|
+
}) => kr(r.apiServiceUrl, (a == null ? void 0 : a.accessToken) || "", s, n),
|
|
529
|
+
onSuccess: (s, n) => {
|
|
530
|
+
t.invalidateQueries({ queryKey: ["group", n.groupId] }), t.invalidateQueries({
|
|
531
|
+
queryKey: ["group-members", n.groupId]
|
|
532
532
|
}), t.invalidateQueries({ queryKey: ["groups"] }), M.success("Members removed successfully");
|
|
533
533
|
},
|
|
534
534
|
onError: (s) => {
|
|
@@ -538,13 +538,13 @@ function Fr() {
|
|
|
538
538
|
}
|
|
539
539
|
});
|
|
540
540
|
}
|
|
541
|
-
const
|
|
542
|
-
function
|
|
541
|
+
const Wa = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
542
|
+
function _r({
|
|
543
543
|
onSuccess: a,
|
|
544
544
|
tenantId: r,
|
|
545
545
|
isTenantUser: t
|
|
546
546
|
}) {
|
|
547
|
-
const [s,
|
|
547
|
+
const [s, n] = x(""), [d, l] = x(""), [u, g] = x({}), b = Ir(), m = () => {
|
|
548
548
|
const h = {};
|
|
549
549
|
return s.trim() ? s.length < 3 ? h.name = "Group name must be at least 3 characters" : s.length > 50 && (h.name = "Group name must be less than 50 characters") : h.name = "Group name is required", d && d.length > 200 && (h.description = "Description must be less than 200 characters"), g(h), Object.keys(h).length === 0;
|
|
550
550
|
};
|
|
@@ -557,13 +557,13 @@ function Gr({
|
|
|
557
557
|
...t && r ? { tenantId: r } : {}
|
|
558
558
|
};
|
|
559
559
|
try {
|
|
560
|
-
await b.mutateAsync(f),
|
|
561
|
-
} catch (
|
|
562
|
-
console.error("Failed to create group:",
|
|
560
|
+
await b.mutateAsync(f), n(""), l(""), g({}), a();
|
|
561
|
+
} catch (o) {
|
|
562
|
+
console.error("Failed to create group:", o);
|
|
563
563
|
}
|
|
564
564
|
}, className: "space-y-4", children: [
|
|
565
565
|
/* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
|
|
566
|
-
/* @__PURE__ */ i(
|
|
566
|
+
/* @__PURE__ */ i(ea, { htmlFor: "group-name", className: Wa, children: [
|
|
567
567
|
"Group name ",
|
|
568
568
|
/* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
|
|
569
569
|
] }),
|
|
@@ -575,7 +575,7 @@ function Gr({
|
|
|
575
575
|
placeholder: "e.g., Marketing Team, Engineering Squad",
|
|
576
576
|
value: s,
|
|
577
577
|
onChange: (h) => {
|
|
578
|
-
|
|
578
|
+
n(h.target.value), u.name && g((f) => ({ ...f, name: "" }));
|
|
579
579
|
},
|
|
580
580
|
className: u.name ? "border-destructive" : "",
|
|
581
581
|
disabled: b.isPending
|
|
@@ -584,9 +584,9 @@ function Gr({
|
|
|
584
584
|
u.name && /* @__PURE__ */ e("p", { className: "text-[12px] text-destructive", children: u.name })
|
|
585
585
|
] }),
|
|
586
586
|
/* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
|
|
587
|
-
/* @__PURE__ */ e(
|
|
587
|
+
/* @__PURE__ */ e(ea, { htmlFor: "group-description", className: Wa, children: "Description (optional)" }),
|
|
588
588
|
/* @__PURE__ */ e(
|
|
589
|
-
|
|
589
|
+
xt,
|
|
590
590
|
{
|
|
591
591
|
id: "group-description",
|
|
592
592
|
placeholder: "Describe the purpose of this group…",
|
|
@@ -605,7 +605,7 @@ function Gr({
|
|
|
605
605
|
] })
|
|
606
606
|
] }),
|
|
607
607
|
/* @__PURE__ */ i("div", { className: "flex gap-2 text-[12px] text-muted-foreground", children: [
|
|
608
|
-
/* @__PURE__ */ e(
|
|
608
|
+
/* @__PURE__ */ e(Zs, { className: "h-3.5 w-3.5 shrink-0 mt-0.5" }),
|
|
609
609
|
/* @__PURE__ */ e("p", { children: "This group will be accessible to users in your workspace. You can add members after creating it." })
|
|
610
610
|
] }),
|
|
611
611
|
/* @__PURE__ */ i("div", { className: "flex justify-end gap-1.5 pt-1", children: [
|
|
@@ -616,7 +616,7 @@ function Gr({
|
|
|
616
616
|
variant: "outline",
|
|
617
617
|
size: "xs",
|
|
618
618
|
onClick: () => {
|
|
619
|
-
|
|
619
|
+
n(""), l(""), g({});
|
|
620
620
|
},
|
|
621
621
|
disabled: b.isPending,
|
|
622
622
|
children: "Clear"
|
|
@@ -637,7 +637,7 @@ function Gr({
|
|
|
637
637
|
] })
|
|
638
638
|
] });
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function Ur(a, r = []) {
|
|
641
641
|
let t = [];
|
|
642
642
|
function s(d, l) {
|
|
643
643
|
const u = k.createContext(l);
|
|
@@ -645,21 +645,21 @@ function $r(a, r = []) {
|
|
|
645
645
|
const g = t.length;
|
|
646
646
|
t = [...t, l];
|
|
647
647
|
const b = (p) => {
|
|
648
|
-
var
|
|
649
|
-
const { scope: h, children: f, ...
|
|
650
|
-
return /* @__PURE__ */ e(y.Provider, { value:
|
|
648
|
+
var D;
|
|
649
|
+
const { scope: h, children: f, ...o } = p, y = ((D = h == null ? void 0 : h[a]) == null ? void 0 : D[g]) || u, w = k.useMemo(() => o, Object.values(o));
|
|
650
|
+
return /* @__PURE__ */ e(y.Provider, { value: w, children: f });
|
|
651
651
|
};
|
|
652
652
|
b.displayName = d + "Provider";
|
|
653
653
|
function m(p, h) {
|
|
654
654
|
var y;
|
|
655
|
-
const f = ((y = h == null ? void 0 : h[a]) == null ? void 0 : y[g]) || u,
|
|
656
|
-
if (
|
|
655
|
+
const f = ((y = h == null ? void 0 : h[a]) == null ? void 0 : y[g]) || u, o = k.useContext(f);
|
|
656
|
+
if (o) return o;
|
|
657
657
|
if (l !== void 0) return l;
|
|
658
658
|
throw new Error(`\`${p}\` must be used within \`${d}\``);
|
|
659
659
|
}
|
|
660
660
|
return [b, m];
|
|
661
661
|
}
|
|
662
|
-
const
|
|
662
|
+
const n = () => {
|
|
663
663
|
const d = t.map((l) => k.createContext(l));
|
|
664
664
|
return function(u) {
|
|
665
665
|
const g = (u == null ? void 0 : u[a]) || d;
|
|
@@ -669,15 +669,15 @@ function $r(a, r = []) {
|
|
|
669
669
|
);
|
|
670
670
|
};
|
|
671
671
|
};
|
|
672
|
-
return
|
|
672
|
+
return n.scopeName = a, [s, Rr(n, ...r)];
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function Rr(...a) {
|
|
675
675
|
const r = a[0];
|
|
676
676
|
if (a.length === 1) return r;
|
|
677
677
|
const t = () => {
|
|
678
|
-
const s = a.map((
|
|
679
|
-
useScope:
|
|
680
|
-
scopeName:
|
|
678
|
+
const s = a.map((n) => ({
|
|
679
|
+
useScope: n(),
|
|
680
|
+
scopeName: n.scopeName
|
|
681
681
|
}));
|
|
682
682
|
return function(d) {
|
|
683
683
|
const l = s.reduce((u, { useScope: g, scopeName: b }) => {
|
|
@@ -689,7 +689,7 @@ function zr(...a) {
|
|
|
689
689
|
};
|
|
690
690
|
return t.scopeName = r.scopeName, t;
|
|
691
691
|
}
|
|
692
|
-
var
|
|
692
|
+
var Gr = [
|
|
693
693
|
"a",
|
|
694
694
|
"button",
|
|
695
695
|
"div",
|
|
@@ -707,73 +707,73 @@ var qr = [
|
|
|
707
707
|
"span",
|
|
708
708
|
"svg",
|
|
709
709
|
"ul"
|
|
710
|
-
],
|
|
711
|
-
const t =
|
|
712
|
-
const { asChild: l, ...u } =
|
|
710
|
+
], ba = Gr.reduce((a, r) => {
|
|
711
|
+
const t = et(`Primitive.${r}`), s = k.forwardRef((n, d) => {
|
|
712
|
+
const { asChild: l, ...u } = n, g = l ? t : r;
|
|
713
713
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(g, { ...u, ref: d });
|
|
714
714
|
});
|
|
715
715
|
return s.displayName = `Primitive.${r}`, { ...a, [r]: s };
|
|
716
716
|
}, {});
|
|
717
|
-
function
|
|
718
|
-
return
|
|
719
|
-
|
|
717
|
+
function Fr() {
|
|
718
|
+
return yr.useSyncExternalStore(
|
|
719
|
+
$r,
|
|
720
720
|
() => !0,
|
|
721
721
|
() => !1
|
|
722
722
|
);
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function $r() {
|
|
725
725
|
return () => {
|
|
726
726
|
};
|
|
727
727
|
}
|
|
728
|
-
var
|
|
728
|
+
var ya = "Avatar", [zr] = Ur(ya), [Hr, bs] = zr(ya), ys = k.forwardRef(
|
|
729
729
|
(a, r) => {
|
|
730
|
-
const { __scopeAvatar: t, ...s } = a, [
|
|
730
|
+
const { __scopeAvatar: t, ...s } = a, [n, d] = k.useState("idle");
|
|
731
731
|
return /* @__PURE__ */ e(
|
|
732
|
-
|
|
732
|
+
Hr,
|
|
733
733
|
{
|
|
734
734
|
scope: t,
|
|
735
|
-
imageLoadingStatus:
|
|
735
|
+
imageLoadingStatus: n,
|
|
736
736
|
onImageLoadingStatusChange: d,
|
|
737
|
-
children: /* @__PURE__ */ e(
|
|
737
|
+
children: /* @__PURE__ */ e(ba.span, { ...s, ref: r })
|
|
738
738
|
}
|
|
739
739
|
);
|
|
740
740
|
}
|
|
741
741
|
);
|
|
742
|
-
|
|
743
|
-
var
|
|
742
|
+
ys.displayName = ya;
|
|
743
|
+
var xs = "AvatarImage", Ss = k.forwardRef(
|
|
744
744
|
(a, r) => {
|
|
745
|
-
const { __scopeAvatar: t, src: s, onLoadingStatusChange:
|
|
746
|
-
}, ...d } = a, l =
|
|
747
|
-
|
|
745
|
+
const { __scopeAvatar: t, src: s, onLoadingStatusChange: n = () => {
|
|
746
|
+
}, ...d } = a, l = bs(xs, t), u = qr(s, d), g = at((b) => {
|
|
747
|
+
n(b), l.onImageLoadingStatusChange(b);
|
|
748
748
|
});
|
|
749
|
-
return
|
|
749
|
+
return aa(() => {
|
|
750
750
|
u !== "idle" && g(u);
|
|
751
|
-
}, [u, g]), u === "loaded" ? /* @__PURE__ */ e(
|
|
751
|
+
}, [u, g]), u === "loaded" ? /* @__PURE__ */ e(ba.img, { ...d, ref: r, src: s }) : null;
|
|
752
752
|
}
|
|
753
753
|
);
|
|
754
|
-
|
|
755
|
-
var
|
|
754
|
+
Ss.displayName = xs;
|
|
755
|
+
var Ns = "AvatarFallback", ws = k.forwardRef(
|
|
756
756
|
(a, r) => {
|
|
757
|
-
const { __scopeAvatar: t, delayMs: s, ...
|
|
757
|
+
const { __scopeAvatar: t, delayMs: s, ...n } = a, d = bs(Ns, t), [l, u] = k.useState(s === void 0);
|
|
758
758
|
return k.useEffect(() => {
|
|
759
759
|
if (s !== void 0) {
|
|
760
760
|
const g = window.setTimeout(() => u(!0), s);
|
|
761
761
|
return () => window.clearTimeout(g);
|
|
762
762
|
}
|
|
763
|
-
}, [s]), l && d.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(
|
|
763
|
+
}, [s]), l && d.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(ba.span, { ...n, ref: r }) : null;
|
|
764
764
|
}
|
|
765
765
|
);
|
|
766
|
-
ws.displayName =
|
|
767
|
-
function
|
|
766
|
+
ws.displayName = Ns;
|
|
767
|
+
function Xa(a, r) {
|
|
768
768
|
return a ? r ? (a.src !== r && (a.src = r), a.complete && a.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
769
769
|
}
|
|
770
|
-
function
|
|
771
|
-
const s =
|
|
772
|
-
() =>
|
|
770
|
+
function qr(a, { referrerPolicy: r, crossOrigin: t }) {
|
|
771
|
+
const s = Fr(), n = k.useRef(null), d = s ? (n.current || (n.current = new window.Image()), n.current) : null, [l, u] = k.useState(
|
|
772
|
+
() => Xa(d, a)
|
|
773
773
|
);
|
|
774
|
-
return
|
|
775
|
-
u(
|
|
776
|
-
}, [d, a]),
|
|
774
|
+
return aa(() => {
|
|
775
|
+
u(Xa(d, a));
|
|
776
|
+
}, [d, a]), aa(() => {
|
|
777
777
|
const g = (p) => () => {
|
|
778
778
|
u(p);
|
|
779
779
|
};
|
|
@@ -784,9 +784,9 @@ function Kr(a, { referrerPolicy: r, crossOrigin: t }) {
|
|
|
784
784
|
};
|
|
785
785
|
}, [d, t, r]), l;
|
|
786
786
|
}
|
|
787
|
-
var
|
|
788
|
-
const
|
|
789
|
-
|
|
787
|
+
var Ds = ys, Cs = Ss, Es = ws;
|
|
788
|
+
const xa = k.forwardRef(({ className: a, ...r }, t) => /* @__PURE__ */ e(
|
|
789
|
+
Ds,
|
|
790
790
|
{
|
|
791
791
|
ref: t,
|
|
792
792
|
className: W(
|
|
@@ -796,18 +796,18 @@ const Na = k.forwardRef(({ className: a, ...r }, t) => /* @__PURE__ */ e(
|
|
|
796
796
|
...r
|
|
797
797
|
}
|
|
798
798
|
));
|
|
799
|
-
|
|
800
|
-
const
|
|
801
|
-
|
|
799
|
+
xa.displayName = Ds.displayName;
|
|
800
|
+
const Vr = k.forwardRef(({ className: a, ...r }, t) => /* @__PURE__ */ e(
|
|
801
|
+
Cs,
|
|
802
802
|
{
|
|
803
803
|
ref: t,
|
|
804
804
|
className: W("aspect-square h-full w-full", a),
|
|
805
805
|
...r
|
|
806
806
|
}
|
|
807
807
|
));
|
|
808
|
-
|
|
809
|
-
const
|
|
810
|
-
|
|
808
|
+
Vr.displayName = Cs.displayName;
|
|
809
|
+
const Sa = k.forwardRef(({ className: a, ...r }, t) => /* @__PURE__ */ e(
|
|
810
|
+
Es,
|
|
811
811
|
{
|
|
812
812
|
ref: t,
|
|
813
813
|
className: W(
|
|
@@ -817,34 +817,34 @@ const Da = k.forwardRef(({ className: a, ...r }, t) => /* @__PURE__ */ e(
|
|
|
817
817
|
...r
|
|
818
818
|
}
|
|
819
819
|
));
|
|
820
|
-
|
|
821
|
-
function
|
|
820
|
+
Sa.displayName = Es.displayName;
|
|
821
|
+
function jr({
|
|
822
822
|
open: a,
|
|
823
823
|
onOpenChange: r,
|
|
824
824
|
group: t,
|
|
825
825
|
onUpdate: s
|
|
826
826
|
}) {
|
|
827
|
-
const [
|
|
827
|
+
const [n, d] = x("members"), [l, u] = x(""), [g, b] = x([]), [m, p] = x([]), { data: h, isLoading: f, refetch: o } = St(t.id), y = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: w, isLoading: D } = Nt({
|
|
828
828
|
type: y,
|
|
829
829
|
tenantId: t.tenantId || void 0,
|
|
830
830
|
active: !0,
|
|
831
831
|
limit: 100
|
|
832
|
-
}), N =
|
|
832
|
+
}), N = Pr(), C = Tr(), T = (h == null ? void 0 : h.members) || [], E = q(() => new Set(T.map((v) => v.userId)), [T]), $ = q(() => w.filter((v) => !E.has(v.id)), [w, E]), K = q(() => {
|
|
833
833
|
if (!l) return $;
|
|
834
834
|
const v = l.toLowerCase();
|
|
835
835
|
return $.filter(
|
|
836
836
|
(I) => {
|
|
837
|
-
var
|
|
838
|
-
return ((
|
|
837
|
+
var G, H;
|
|
838
|
+
return ((G = I.name) == null ? void 0 : G.toLowerCase().includes(v)) || ((H = I.email) == null ? void 0 : H.toLowerCase().includes(v));
|
|
839
839
|
}
|
|
840
840
|
);
|
|
841
|
-
}, [$, l]), L =
|
|
841
|
+
}, [$, l]), L = q(() => {
|
|
842
842
|
if (!l) return T;
|
|
843
843
|
const v = l.toLowerCase();
|
|
844
844
|
return T.filter(
|
|
845
845
|
(I) => {
|
|
846
|
-
var
|
|
847
|
-
return ((
|
|
846
|
+
var G, H, me, ee;
|
|
847
|
+
return ((H = (G = I.user) == null ? void 0 : G.name) == null ? void 0 : H.toLowerCase().includes(v)) || ((ee = (me = I.user) == null ? void 0 : me.email) == null ? void 0 : ee.toLowerCase().includes(v));
|
|
848
848
|
}
|
|
849
849
|
);
|
|
850
850
|
}, [T, l]), Q = async () => {
|
|
@@ -856,7 +856,7 @@ function Jr({
|
|
|
856
856
|
userIds: g,
|
|
857
857
|
userType: y === "tenant" ? "tenant" : "org"
|
|
858
858
|
}
|
|
859
|
-
}), b([]), d("members"),
|
|
859
|
+
}), b([]), d("members"), o(), s == null || s();
|
|
860
860
|
} catch (v) {
|
|
861
861
|
console.error("Failed to add members:", v);
|
|
862
862
|
}
|
|
@@ -868,22 +868,22 @@ function Jr({
|
|
|
868
868
|
data: {
|
|
869
869
|
userIds: m
|
|
870
870
|
}
|
|
871
|
-
}), p([]),
|
|
871
|
+
}), p([]), o(), s == null || s();
|
|
872
872
|
} catch (v) {
|
|
873
873
|
console.error("Failed to remove members:", v);
|
|
874
874
|
}
|
|
875
875
|
}, Y = (v) => {
|
|
876
876
|
b(
|
|
877
|
-
(I) => I.includes(v) ? I.filter((
|
|
877
|
+
(I) => I.includes(v) ? I.filter((G) => G !== v) : [...I, v]
|
|
878
878
|
);
|
|
879
879
|
}, Z = (v) => {
|
|
880
880
|
p(
|
|
881
|
-
(I) => I.includes(v) ? I.filter((
|
|
881
|
+
(I) => I.includes(v) ? I.filter((G) => G !== v) : [...I, v]
|
|
882
882
|
);
|
|
883
883
|
};
|
|
884
|
-
return /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
|
|
885
|
-
/* @__PURE__ */ i(
|
|
886
|
-
/* @__PURE__ */ e(
|
|
884
|
+
return /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(ma, { open: a, onOpenChange: r, children: /* @__PURE__ */ i(ha, { className: "max-w-3xl max-h-[80vh]", "aria-describedby": "group-members-description", children: [
|
|
885
|
+
/* @__PURE__ */ i(pa, { children: [
|
|
886
|
+
/* @__PURE__ */ e(fa, { children: t.name }),
|
|
887
887
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 mt-1", children: /* @__PURE__ */ i("p", { className: "text-sm text-muted-foreground", children: [
|
|
888
888
|
T.length,
|
|
889
889
|
" ",
|
|
@@ -895,16 +895,16 @@ function Jr({
|
|
|
895
895
|
" group"
|
|
896
896
|
] })
|
|
897
897
|
] }),
|
|
898
|
-
/* @__PURE__ */ i(
|
|
898
|
+
/* @__PURE__ */ i(ss, { value: n, onValueChange: (v) => {
|
|
899
899
|
d(v), u(""), p([]);
|
|
900
900
|
}, className: "mt-4", children: [
|
|
901
|
-
/* @__PURE__ */ i(
|
|
901
|
+
/* @__PURE__ */ i(ts, { className: "grid w-full grid-cols-2", children: [
|
|
902
902
|
/* @__PURE__ */ e(Pe, { value: "members", children: "Current Members" }),
|
|
903
903
|
/* @__PURE__ */ e(Pe, { value: "add", children: "Add Members" })
|
|
904
904
|
] }),
|
|
905
905
|
/* @__PURE__ */ i(Te, { value: "members", className: "mt-4 space-y-4", children: [
|
|
906
906
|
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
907
|
-
/* @__PURE__ */ e(
|
|
907
|
+
/* @__PURE__ */ e(ra, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
908
908
|
/* @__PURE__ */ e(
|
|
909
909
|
de,
|
|
910
910
|
{
|
|
@@ -915,12 +915,12 @@ function Jr({
|
|
|
915
915
|
}
|
|
916
916
|
)
|
|
917
917
|
] }),
|
|
918
|
-
/* @__PURE__ */ e(
|
|
919
|
-
/* @__PURE__ */ e(
|
|
918
|
+
/* @__PURE__ */ e(sa, { className: m.length > 0 ? "h-[300px]" : "h-[350px]", children: f ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((v) => /* @__PURE__ */ e(na, { className: "h-16 w-full" }, v)) }) : L.length === 0 ? /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
919
|
+
/* @__PURE__ */ e(va, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
920
920
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: l ? "No members found" : "No members yet" }),
|
|
921
921
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : 'Switch to the "Add Members" tab to add people to this group' })
|
|
922
922
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: L.map((v) => /* @__PURE__ */ e(
|
|
923
|
-
|
|
923
|
+
Br,
|
|
924
924
|
{
|
|
925
925
|
member: v,
|
|
926
926
|
selected: m.includes(v.userId),
|
|
@@ -946,7 +946,7 @@ function Jr({
|
|
|
946
946
|
/* @__PURE__ */ e(X, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
947
947
|
"Removing..."
|
|
948
948
|
] }) : /* @__PURE__ */ i(P, { children: [
|
|
949
|
-
/* @__PURE__ */ e(
|
|
949
|
+
/* @__PURE__ */ e(cs, { className: "mr-2 h-4 w-4" }),
|
|
950
950
|
"Remove Selected"
|
|
951
951
|
] })
|
|
952
952
|
}
|
|
@@ -955,7 +955,7 @@ function Jr({
|
|
|
955
955
|
] }),
|
|
956
956
|
/* @__PURE__ */ i(Te, { value: "add", className: "mt-4 space-y-4", children: [
|
|
957
957
|
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
958
|
-
/* @__PURE__ */ e(
|
|
958
|
+
/* @__PURE__ */ e(ra, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" }),
|
|
959
959
|
/* @__PURE__ */ e(
|
|
960
960
|
de,
|
|
961
961
|
{
|
|
@@ -966,12 +966,12 @@ function Jr({
|
|
|
966
966
|
}
|
|
967
967
|
)
|
|
968
968
|
] }),
|
|
969
|
-
/* @__PURE__ */ e(
|
|
970
|
-
/* @__PURE__ */ e(
|
|
969
|
+
/* @__PURE__ */ e(sa, { className: "h-[300px]", children: D ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((v) => /* @__PURE__ */ e(na, { className: "h-16 w-full" }, v)) }) : K.length === 0 ? /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
970
|
+
/* @__PURE__ */ e(ca, { className: "h-12 w-12 mb-3 opacity-50" }),
|
|
971
971
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: "No available users" }),
|
|
972
972
|
/* @__PURE__ */ e("p", { className: "text-xs mt-1", children: l ? "Try a different search" : "All eligible users are already members" })
|
|
973
973
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: K.map((v) => /* @__PURE__ */ e(
|
|
974
|
-
|
|
974
|
+
Kr,
|
|
975
975
|
{
|
|
976
976
|
user: v,
|
|
977
977
|
selected: g.includes(v.id),
|
|
@@ -995,7 +995,7 @@ function Jr({
|
|
|
995
995
|
/* @__PURE__ */ e(X, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
996
996
|
"Adding..."
|
|
997
997
|
] }) : /* @__PURE__ */ i(P, { children: [
|
|
998
|
-
/* @__PURE__ */ e(
|
|
998
|
+
/* @__PURE__ */ e(ca, { className: "mr-2 h-4 w-4" }),
|
|
999
999
|
"Add Members"
|
|
1000
1000
|
] })
|
|
1001
1001
|
}
|
|
@@ -1005,21 +1005,21 @@ function Jr({
|
|
|
1005
1005
|
] })
|
|
1006
1006
|
] }) }) });
|
|
1007
1007
|
}
|
|
1008
|
-
function
|
|
1008
|
+
function Br({
|
|
1009
1009
|
member: a,
|
|
1010
1010
|
selected: r,
|
|
1011
1011
|
onToggle: t
|
|
1012
1012
|
}) {
|
|
1013
|
-
var
|
|
1014
|
-
const s = ((d = (
|
|
1013
|
+
var n, d, l, u;
|
|
1014
|
+
const s = ((d = (n = a.user) == null ? void 0 : n.name) == null ? void 0 : d.split(" ").map((g) => g[0]).join("").toUpperCase()) || "?";
|
|
1015
1015
|
return /* @__PURE__ */ i(
|
|
1016
1016
|
"div",
|
|
1017
1017
|
{
|
|
1018
1018
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1019
1019
|
onClick: t,
|
|
1020
1020
|
children: [
|
|
1021
|
-
/* @__PURE__ */ e(
|
|
1022
|
-
/* @__PURE__ */ e(
|
|
1021
|
+
/* @__PURE__ */ e(ls, { checked: r }),
|
|
1022
|
+
/* @__PURE__ */ e(xa, { className: "h-8 w-8", children: /* @__PURE__ */ e(Sa, { className: "text-xs", children: s }) }),
|
|
1023
1023
|
/* @__PURE__ */ i("div", { className: "flex-1", children: [
|
|
1024
1024
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: ((l = a.user) == null ? void 0 : l.name) || "Unknown User" }),
|
|
1025
1025
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: (u = a.user) == null ? void 0 : u.email })
|
|
@@ -1028,21 +1028,21 @@ function Wr({
|
|
|
1028
1028
|
}
|
|
1029
1029
|
);
|
|
1030
1030
|
}
|
|
1031
|
-
function
|
|
1031
|
+
function Kr({
|
|
1032
1032
|
user: a,
|
|
1033
1033
|
selected: r,
|
|
1034
1034
|
onToggle: t
|
|
1035
1035
|
}) {
|
|
1036
|
-
var
|
|
1037
|
-
const s = ((
|
|
1036
|
+
var n;
|
|
1037
|
+
const s = ((n = a.name) == null ? void 0 : n.split(" ").map((d) => d[0]).join("").toUpperCase()) || "?";
|
|
1038
1038
|
return /* @__PURE__ */ i(
|
|
1039
1039
|
"div",
|
|
1040
1040
|
{
|
|
1041
1041
|
className: "flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-muted/50 cursor-pointer",
|
|
1042
1042
|
onClick: t,
|
|
1043
1043
|
children: [
|
|
1044
|
-
/* @__PURE__ */ e(
|
|
1045
|
-
/* @__PURE__ */ e(
|
|
1044
|
+
/* @__PURE__ */ e(ls, { checked: r }),
|
|
1045
|
+
/* @__PURE__ */ e(xa, { className: "h-8 w-8", children: /* @__PURE__ */ e(Sa, { className: "text-xs", children: s }) }),
|
|
1046
1046
|
/* @__PURE__ */ i("div", { className: "flex-1", children: [
|
|
1047
1047
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium", children: a.name }),
|
|
1048
1048
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: a.email })
|
|
@@ -1051,23 +1051,23 @@ function Xr({
|
|
|
1051
1051
|
}
|
|
1052
1052
|
);
|
|
1053
1053
|
}
|
|
1054
|
-
function
|
|
1054
|
+
function Qr({
|
|
1055
1055
|
open: a,
|
|
1056
1056
|
onOpenChange: r
|
|
1057
1057
|
}) {
|
|
1058
|
-
const [t, s] = x("groups"), [
|
|
1058
|
+
const [t, s] = x("groups"), [n, d] = x(""), [l, u] = x(null), [g, b] = x(!1), [m, p] = x(null), { tokenProps: h } = j(), { currentUser: f } = ga(), o = Or(), y = (f == null ? void 0 : f.type) === "tenant", w = h == null ? void 0 : h.tenantId, { groups: D, isLoading: N, refetch: C } = wt({
|
|
1059
1059
|
type: y ? "TENANT_GROUP" : "all",
|
|
1060
|
-
tenantId: y ?
|
|
1060
|
+
tenantId: y ? w : void 0,
|
|
1061
1061
|
includeMembers: !1
|
|
1062
|
-
}), T =
|
|
1062
|
+
}), T = D.filter(
|
|
1063
1063
|
(L) => {
|
|
1064
1064
|
var Q;
|
|
1065
|
-
return L.name.toLowerCase().includes(
|
|
1065
|
+
return L.name.toLowerCase().includes(n.toLowerCase()) || ((Q = L.description) == null ? void 0 : Q.toLowerCase().includes(n.toLowerCase()));
|
|
1066
1066
|
}
|
|
1067
1067
|
), E = async () => {
|
|
1068
1068
|
if (m)
|
|
1069
1069
|
try {
|
|
1070
|
-
await
|
|
1070
|
+
await o.mutateAsync(m.id), p(null), C();
|
|
1071
1071
|
} catch (L) {
|
|
1072
1072
|
console.error("Failed to delete group:", L);
|
|
1073
1073
|
}
|
|
@@ -1077,19 +1077,19 @@ function Yr({
|
|
|
1077
1077
|
s("groups"), C();
|
|
1078
1078
|
};
|
|
1079
1079
|
return /* @__PURE__ */ i(P, { children: [
|
|
1080
|
-
/* @__PURE__ */ e(
|
|
1081
|
-
/* @__PURE__ */ i(
|
|
1082
|
-
/* @__PURE__ */ e(
|
|
1083
|
-
/* @__PURE__ */ e(
|
|
1080
|
+
/* @__PURE__ */ e(ma, { open: a, onOpenChange: r, children: /* @__PURE__ */ i(ha, { className: "max-h-[80vh] max-w-3xl rounded-[6px] border-border/60 sm:rounded-[6px]", children: [
|
|
1081
|
+
/* @__PURE__ */ i(pa, { children: [
|
|
1082
|
+
/* @__PURE__ */ e(fa, { className: "text-[15px]", children: "Group management" }),
|
|
1083
|
+
/* @__PURE__ */ e(ns, { className: "text-[13px] leading-5", children: "Manage groups, create new ones, and control membership." })
|
|
1084
1084
|
] }),
|
|
1085
1085
|
/* @__PURE__ */ i(
|
|
1086
|
-
|
|
1086
|
+
ss,
|
|
1087
1087
|
{
|
|
1088
1088
|
value: t,
|
|
1089
1089
|
onValueChange: s,
|
|
1090
1090
|
className: "mt-2",
|
|
1091
1091
|
children: [
|
|
1092
|
-
/* @__PURE__ */ i(
|
|
1092
|
+
/* @__PURE__ */ i(ts, { className: "h-8 w-full justify-start gap-1 bg-transparent p-0 border-b border-border/60 rounded-none", children: [
|
|
1093
1093
|
/* @__PURE__ */ e(
|
|
1094
1094
|
Pe,
|
|
1095
1095
|
{
|
|
@@ -1109,29 +1109,29 @@ function Yr({
|
|
|
1109
1109
|
] }),
|
|
1110
1110
|
/* @__PURE__ */ e(Te, { value: "groups", className: "mt-4", children: /* @__PURE__ */ i("div", { className: "space-y-3", children: [
|
|
1111
1111
|
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1112
|
-
/* @__PURE__ */ e(
|
|
1112
|
+
/* @__PURE__ */ e(ra, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
1113
1113
|
/* @__PURE__ */ e(
|
|
1114
1114
|
de,
|
|
1115
1115
|
{
|
|
1116
1116
|
size: "xs",
|
|
1117
1117
|
placeholder: "Search groups…",
|
|
1118
|
-
value:
|
|
1118
|
+
value: n,
|
|
1119
1119
|
onChange: (L) => d(L.target.value),
|
|
1120
1120
|
className: "pl-7"
|
|
1121
1121
|
}
|
|
1122
1122
|
)
|
|
1123
1123
|
] }),
|
|
1124
|
-
/* @__PURE__ */ e(
|
|
1125
|
-
|
|
1124
|
+
/* @__PURE__ */ e(sa, { className: "h-[400px]", children: N ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((L) => /* @__PURE__ */ e(
|
|
1125
|
+
na,
|
|
1126
1126
|
{
|
|
1127
1127
|
className: "h-16 w-full rounded-[6px]"
|
|
1128
1128
|
},
|
|
1129
1129
|
L
|
|
1130
1130
|
)) }) : T.length === 0 ? /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center py-12 text-muted-foreground", children: [
|
|
1131
1131
|
/* @__PURE__ */ e("p", { className: "text-[13px]", children: "No groups found." }),
|
|
1132
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-[12px]", children:
|
|
1132
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-[12px]", children: n ? "Try a different search." : "Create your first group to get started." })
|
|
1133
1133
|
] }) : /* @__PURE__ */ e("div", { className: "space-y-2 pr-2", children: T.map((L) => /* @__PURE__ */ e(
|
|
1134
|
-
|
|
1134
|
+
Jr,
|
|
1135
1135
|
{
|
|
1136
1136
|
group: L,
|
|
1137
1137
|
onManageMembers: () => $(L),
|
|
@@ -1142,10 +1142,10 @@ function Yr({
|
|
|
1142
1142
|
)) }) })
|
|
1143
1143
|
] }) }),
|
|
1144
1144
|
/* @__PURE__ */ e(Te, { value: "create", className: "mt-4", children: /* @__PURE__ */ e(
|
|
1145
|
-
|
|
1145
|
+
_r,
|
|
1146
1146
|
{
|
|
1147
1147
|
onSuccess: K,
|
|
1148
|
-
tenantId:
|
|
1148
|
+
tenantId: w,
|
|
1149
1149
|
isTenantUser: y
|
|
1150
1150
|
}
|
|
1151
1151
|
) })
|
|
@@ -1154,7 +1154,7 @@ function Yr({
|
|
|
1154
1154
|
)
|
|
1155
1155
|
] }) }),
|
|
1156
1156
|
l && /* @__PURE__ */ e(
|
|
1157
|
-
|
|
1157
|
+
jr,
|
|
1158
1158
|
{
|
|
1159
1159
|
open: g,
|
|
1160
1160
|
onOpenChange: b,
|
|
@@ -1163,28 +1163,28 @@ function Yr({
|
|
|
1163
1163
|
}
|
|
1164
1164
|
),
|
|
1165
1165
|
/* @__PURE__ */ e(
|
|
1166
|
-
|
|
1166
|
+
ds,
|
|
1167
1167
|
{
|
|
1168
1168
|
open: !!m,
|
|
1169
1169
|
onOpenChange: () => p(null),
|
|
1170
|
-
children: /* @__PURE__ */ i(
|
|
1171
|
-
/* @__PURE__ */ i(
|
|
1172
|
-
/* @__PURE__ */ e(
|
|
1173
|
-
/* @__PURE__ */ i(
|
|
1170
|
+
children: /* @__PURE__ */ i(us, { children: [
|
|
1171
|
+
/* @__PURE__ */ i(ms, { children: [
|
|
1172
|
+
/* @__PURE__ */ e(hs, { children: "Delete group" }),
|
|
1173
|
+
/* @__PURE__ */ i(ps, { children: [
|
|
1174
1174
|
'Delete "',
|
|
1175
1175
|
m == null ? void 0 : m.name,
|
|
1176
1176
|
`"? This removes all members and can't be undone.`
|
|
1177
1177
|
] })
|
|
1178
1178
|
] }),
|
|
1179
|
-
/* @__PURE__ */ i(
|
|
1180
|
-
/* @__PURE__ */ e(
|
|
1179
|
+
/* @__PURE__ */ i(fs, { children: [
|
|
1180
|
+
/* @__PURE__ */ e(gs, { children: "Cancel" }),
|
|
1181
1181
|
/* @__PURE__ */ e(
|
|
1182
|
-
|
|
1182
|
+
oa,
|
|
1183
1183
|
{
|
|
1184
1184
|
onClick: E,
|
|
1185
|
-
disabled:
|
|
1185
|
+
disabled: o.isPending,
|
|
1186
1186
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
1187
|
-
children:
|
|
1187
|
+
children: o.isPending ? /* @__PURE__ */ i(P, { children: [
|
|
1188
1188
|
/* @__PURE__ */ e(X, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1189
1189
|
"Deleting…"
|
|
1190
1190
|
] }) : "Delete group"
|
|
@@ -1196,27 +1196,27 @@ function Yr({
|
|
|
1196
1196
|
)
|
|
1197
1197
|
] });
|
|
1198
1198
|
}
|
|
1199
|
-
function
|
|
1199
|
+
function Jr({
|
|
1200
1200
|
group: a,
|
|
1201
1201
|
onManageMembers: r,
|
|
1202
1202
|
onDelete: t,
|
|
1203
1203
|
currentUserId: s
|
|
1204
1204
|
}) {
|
|
1205
|
-
const
|
|
1205
|
+
const n = a.createdBy === s;
|
|
1206
1206
|
return /* @__PURE__ */ e("div", { className: "rounded-[6px] border border-border/60 bg-card px-3 py-2.5 transition-colors hover:bg-muted/30", children: /* @__PURE__ */ i("div", { className: "flex items-start justify-between gap-2", children: [
|
|
1207
1207
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
1208
1208
|
/* @__PURE__ */ e("h4", { className: "text-[13px] font-medium text-foreground", children: a.name }),
|
|
1209
1209
|
a.description && /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: a.description }),
|
|
1210
1210
|
/* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-3 text-[11px] text-muted-foreground", children: [
|
|
1211
1211
|
/* @__PURE__ */ i("span", { className: "inline-flex items-center gap-1", children: [
|
|
1212
|
-
/* @__PURE__ */ e(
|
|
1212
|
+
/* @__PURE__ */ e(va, { className: "h-3 w-3" }),
|
|
1213
1213
|
a.memberCount,
|
|
1214
1214
|
" ",
|
|
1215
1215
|
a.memberCount === 1 ? "member" : "members"
|
|
1216
1216
|
] }),
|
|
1217
1217
|
/* @__PURE__ */ i("span", { children: [
|
|
1218
1218
|
"Created ",
|
|
1219
|
-
|
|
1219
|
+
nr(new Date(a.createdAt), "MMM d, yyyy")
|
|
1220
1220
|
] })
|
|
1221
1221
|
] })
|
|
1222
1222
|
] }),
|
|
@@ -1230,10 +1230,10 @@ function Zr({
|
|
|
1230
1230
|
onClick: r,
|
|
1231
1231
|
title: "Manage members",
|
|
1232
1232
|
"aria-label": "Manage members",
|
|
1233
|
-
children: /* @__PURE__ */ e(
|
|
1233
|
+
children: /* @__PURE__ */ e(ca, { className: "h-3.5 w-3.5" })
|
|
1234
1234
|
}
|
|
1235
1235
|
),
|
|
1236
|
-
|
|
1236
|
+
n && /* @__PURE__ */ e(
|
|
1237
1237
|
A,
|
|
1238
1238
|
{
|
|
1239
1239
|
variant: "ghost",
|
|
@@ -1242,7 +1242,7 @@ function Zr({
|
|
|
1242
1242
|
onClick: t,
|
|
1243
1243
|
title: "Delete group",
|
|
1244
1244
|
"aria-label": "Delete group",
|
|
1245
|
-
children: /* @__PURE__ */ e(
|
|
1245
|
+
children: /* @__PURE__ */ e(cs, { className: "h-3.5 w-3.5" })
|
|
1246
1246
|
}
|
|
1247
1247
|
)
|
|
1248
1248
|
] })
|
|
@@ -1255,22 +1255,22 @@ function ie(a, r, t) {
|
|
|
1255
1255
|
);
|
|
1256
1256
|
if (s)
|
|
1257
1257
|
return s.label;
|
|
1258
|
-
const
|
|
1258
|
+
const n = (l = (d = rs(a, r)) == null ? void 0 : d.controls) == null ? void 0 : l.find(
|
|
1259
1259
|
(u) => u.id === t
|
|
1260
1260
|
);
|
|
1261
|
-
return (
|
|
1261
|
+
return (n == null ? void 0 : n.label) || t;
|
|
1262
1262
|
}
|
|
1263
1263
|
function ce(a, r) {
|
|
1264
1264
|
var t;
|
|
1265
|
-
return ((t =
|
|
1265
|
+
return ((t = rs(a, r)) == null ? void 0 : t.title) || r;
|
|
1266
1266
|
}
|
|
1267
|
-
function
|
|
1267
|
+
function Wr(a) {
|
|
1268
1268
|
const { errors: r, dashboard: t } = a;
|
|
1269
1269
|
if (!t)
|
|
1270
1270
|
return r;
|
|
1271
1271
|
const s = /* @__PURE__ */ new Map();
|
|
1272
|
-
for (const
|
|
1273
|
-
const d =
|
|
1272
|
+
for (const n of r) {
|
|
1273
|
+
const d = n.match(
|
|
1274
1274
|
/^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
|
|
1275
1275
|
);
|
|
1276
1276
|
if (d) {
|
|
@@ -1285,7 +1285,7 @@ function en(a) {
|
|
|
1285
1285
|
);
|
|
1286
1286
|
continue;
|
|
1287
1287
|
}
|
|
1288
|
-
const l =
|
|
1288
|
+
const l = n.match(
|
|
1289
1289
|
/^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
|
|
1290
1290
|
);
|
|
1291
1291
|
if (l) {
|
|
@@ -1300,7 +1300,7 @@ function en(a) {
|
|
|
1300
1300
|
);
|
|
1301
1301
|
continue;
|
|
1302
1302
|
}
|
|
1303
|
-
const u =
|
|
1303
|
+
const u = n.match(
|
|
1304
1304
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
|
|
1305
1305
|
);
|
|
1306
1306
|
if (u) {
|
|
@@ -1315,7 +1315,7 @@ function en(a) {
|
|
|
1315
1315
|
);
|
|
1316
1316
|
continue;
|
|
1317
1317
|
}
|
|
1318
|
-
const g =
|
|
1318
|
+
const g = n.match(
|
|
1319
1319
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
|
|
1320
1320
|
);
|
|
1321
1321
|
if (g) {
|
|
@@ -1330,7 +1330,7 @@ function en(a) {
|
|
|
1330
1330
|
);
|
|
1331
1331
|
continue;
|
|
1332
1332
|
}
|
|
1333
|
-
const b =
|
|
1333
|
+
const b = n.match(
|
|
1334
1334
|
/^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
|
|
1335
1335
|
);
|
|
1336
1336
|
if (b) {
|
|
@@ -1345,61 +1345,61 @@ function en(a) {
|
|
|
1345
1345
|
);
|
|
1346
1346
|
continue;
|
|
1347
1347
|
}
|
|
1348
|
-
s.set(
|
|
1348
|
+
s.set(n, n);
|
|
1349
1349
|
}
|
|
1350
1350
|
return Array.from(s.values());
|
|
1351
1351
|
}
|
|
1352
|
-
function
|
|
1352
|
+
function Ya(a, r) {
|
|
1353
1353
|
return {
|
|
1354
|
-
dashboard:
|
|
1355
|
-
semanticExecutionPayload:
|
|
1354
|
+
dashboard: ia(a),
|
|
1355
|
+
semanticExecutionPayload: ia(r)
|
|
1356
1356
|
};
|
|
1357
1357
|
}
|
|
1358
|
-
function
|
|
1359
|
-
var
|
|
1360
|
-
|
|
1358
|
+
function hn() {
|
|
1359
|
+
var Ra, Ga, Fa, $a, za, Ha;
|
|
1360
|
+
Yt(), Zt();
|
|
1361
1361
|
const {
|
|
1362
1362
|
authToken: a,
|
|
1363
1363
|
tokenProps: r,
|
|
1364
1364
|
id: t
|
|
1365
|
-
} = j(), { isLocalDev: s } =
|
|
1365
|
+
} = j(), { isLocalDev: s } = Dt(), { openBrandStudioPreview: n } = Ct(), { permissions: d } = Er(), l = Et(), { isLoading: u } = Lt(), g = S((c) => c.theme), b = S((c) => c.isDownloadingPdf), m = S(
|
|
1366
1366
|
(c) => c.dashboardAssistantDraftScopeKey
|
|
1367
|
-
), p = S((c) => c.lenses), h = S((c) => c.selectedLensId), f = p == null ? void 0 : p.find((c) => c.id === h),
|
|
1367
|
+
), p = S((c) => c.lenses), h = S((c) => c.selectedLensId), f = p == null ? void 0 : p.find((c) => c.id === h), o = S((c) => c.dashboard), y = S((c) => c.selectedSheetId), w = (Ra = o == null ? void 0 : o.sheets) == null ? void 0 : Ra.find(
|
|
1368
1368
|
(c) => c.id === y
|
|
1369
|
-
),
|
|
1369
|
+
), D = st(w), N = D ? (Ga = w == null ? void 0 : w.document) == null ? void 0 : Ga.page : void 0, C = S(
|
|
1370
1370
|
(c) => c.isDashboardEditing
|
|
1371
|
-
), { setDashboardTitle: T } = S((c) => c.actions), [E, $] = x(!1), [K, L] = x(!1), [Q, ue] = x(!1), [Y, Z] = x(!1), [v, I] = x(!1), [
|
|
1371
|
+
), { setDashboardTitle: T } = S((c) => c.actions), [E, $] = x(!1), [K, L] = x(!1), [Q, ue] = x(!1), [Y, Z] = x(!1), [v, I] = x(!1), [G, H] = x(!1), [me, ee] = x(!1), [Ls, he] = x(!1), [pe, fe] = x(null), [Na, ge] = x([]), [wa, ve] = x(!1), Ms = S((c) => c.isDashboardPanelOpen), As = S(
|
|
1372
1372
|
(c) => c.actions.setIsDashboardPanelOpen
|
|
1373
|
-
),
|
|
1374
|
-
|
|
1373
|
+
), ks = S((c) => c.filterValues), U = S((c) => c.isVisualEditing);
|
|
1374
|
+
Va((c) => c.card);
|
|
1375
1375
|
const ae = ke(
|
|
1376
1376
|
(c) => c.selectedDashboard
|
|
1377
1377
|
), be = ke(
|
|
1378
1378
|
(c) => c.initialDashboard
|
|
1379
1379
|
);
|
|
1380
|
-
ke((c) => c.selectedVisual), S((c) => c.selectedFrameId),
|
|
1381
|
-
const ye = ae ? (
|
|
1380
|
+
ke((c) => c.selectedVisual), S((c) => c.selectedFrameId), Va((c) => c.frame);
|
|
1381
|
+
const ye = ae ? ($a = ae == null ? void 0 : ae.permissions) == null ? void 0 : $a.canEdit : (Fa = be == null ? void 0 : be.permissions) == null ? void 0 : Fa.canEdit, Da = S(
|
|
1382
1382
|
(c) => c.showDashboardJSON
|
|
1383
|
-
),
|
|
1384
|
-
setIsDashboardEditing:
|
|
1385
|
-
setShowDashboardJSON:
|
|
1386
|
-
} = S((c) => c.actions), { setInitialDashboard:
|
|
1383
|
+
), Ge = S((c) => c.onSaveFunction), {
|
|
1384
|
+
setIsDashboardEditing: Ca,
|
|
1385
|
+
setShowDashboardJSON: Ea
|
|
1386
|
+
} = S((c) => c.actions), { setInitialDashboard: La, clearSelectedDashboard: Fe } = ke(
|
|
1387
1387
|
(c) => c.actions
|
|
1388
|
-
), { resources: xe } =
|
|
1388
|
+
), { resources: xe } = Mt(Qe.DASHBOARD), { data: $e } = At(), Is = ((za = $e == null ? void 0 : $e.preference) == null ? void 0 : za.defaultDashboardId) || null, { mutate: Os, isPending: Ps } = kt(), { currentUser: Ts } = ga(), _s = It(Ts), J = ae || be, Ma = J ? {
|
|
1389
1389
|
id: J.id,
|
|
1390
|
-
title: (
|
|
1391
|
-
} : null, { handleAddNewFrame:
|
|
1392
|
-
if (!(
|
|
1390
|
+
title: (o == null ? void 0 : o.title) || J.title || "Dashboard"
|
|
1391
|
+
} : null, { handleAddNewFrame: Us } = Ot(), [ze, He] = x(!1), [Rs, se] = x(!1), [qe, Se] = x("close"), te = Pt(Qe.DASHBOARD), [R, Ne] = x(null), Gs = async (c, O) => {
|
|
1392
|
+
if (!(o != null && o.id)) {
|
|
1393
1393
|
console.log("No dashboard ID found");
|
|
1394
1394
|
return;
|
|
1395
1395
|
}
|
|
1396
1396
|
console.log("Updating dashboard title:", {
|
|
1397
|
-
dashboardId:
|
|
1397
|
+
dashboardId: o.id,
|
|
1398
1398
|
newTitle: c,
|
|
1399
1399
|
previousTitle: O
|
|
1400
1400
|
}), te.mutate(
|
|
1401
1401
|
{
|
|
1402
|
-
resourceId:
|
|
1402
|
+
resourceId: o.id,
|
|
1403
1403
|
data: { title: c }
|
|
1404
1404
|
},
|
|
1405
1405
|
{
|
|
@@ -1412,22 +1412,22 @@ function vn() {
|
|
|
1412
1412
|
}
|
|
1413
1413
|
);
|
|
1414
1414
|
};
|
|
1415
|
-
|
|
1415
|
+
We(() => {
|
|
1416
1416
|
if (xe && xe.length > 0) {
|
|
1417
|
-
const c =
|
|
1417
|
+
const c = o == null ? void 0 : o.id;
|
|
1418
1418
|
if (c) {
|
|
1419
1419
|
const O = xe.find(
|
|
1420
1420
|
(z) => z.id === c
|
|
1421
1421
|
);
|
|
1422
|
-
O &&
|
|
1422
|
+
O && La(O);
|
|
1423
1423
|
}
|
|
1424
1424
|
}
|
|
1425
|
-
}, [xe,
|
|
1426
|
-
const re = r.orgUserId || r.tenantId, Ve =
|
|
1427
|
-
() =>
|
|
1425
|
+
}, [xe, o == null ? void 0 : o.id, La]);
|
|
1426
|
+
const re = r.orgUserId || r.tenantId, Ve = q(
|
|
1427
|
+
() => Xr({
|
|
1428
1428
|
accessToken: a == null ? void 0 : a.accessToken,
|
|
1429
|
-
dashboardId: (
|
|
1430
|
-
selectedSheetId:
|
|
1429
|
+
dashboardId: (o == null ? void 0 : o.id) || t || r.dashboard_id,
|
|
1430
|
+
selectedSheetId: D ? y : void 0,
|
|
1431
1431
|
pageSize: N == null ? void 0 : N.size,
|
|
1432
1432
|
orientation: N == null ? void 0 : N.orientation,
|
|
1433
1433
|
theme: g
|
|
@@ -1435,109 +1435,109 @@ function vn() {
|
|
|
1435
1435
|
[
|
|
1436
1436
|
a == null ? void 0 : a.accessToken,
|
|
1437
1437
|
t,
|
|
1438
|
-
|
|
1439
|
-
|
|
1438
|
+
o == null ? void 0 : o.id,
|
|
1439
|
+
D,
|
|
1440
1440
|
N == null ? void 0 : N.orientation,
|
|
1441
1441
|
N == null ? void 0 : N.size,
|
|
1442
1442
|
y,
|
|
1443
1443
|
g,
|
|
1444
1444
|
r.dashboard_id
|
|
1445
1445
|
]
|
|
1446
|
-
),
|
|
1446
|
+
), Aa = C && !U && re && ye, { setDashboard: ka } = S((c) => c.actions), Ia = S(
|
|
1447
1447
|
(c) => c.semanticExecutionPayload
|
|
1448
|
-
),
|
|
1449
|
-
|
|
1450
|
-
},
|
|
1451
|
-
|
|
1448
|
+
), Fs = () => {
|
|
1449
|
+
Ca(!0);
|
|
1450
|
+
}, je = () => {
|
|
1451
|
+
Ca(!1), Ea(!1), Ne(null);
|
|
1452
1452
|
};
|
|
1453
|
-
|
|
1453
|
+
We(() => {
|
|
1454
1454
|
if (!C) {
|
|
1455
1455
|
R && Ne(null);
|
|
1456
1456
|
return;
|
|
1457
1457
|
}
|
|
1458
|
-
R || !
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1458
|
+
R || !o || u || Ne(
|
|
1459
|
+
Ya(
|
|
1460
|
+
o,
|
|
1461
|
+
Ia
|
|
1462
1462
|
)
|
|
1463
1463
|
);
|
|
1464
1464
|
}, [
|
|
1465
|
-
|
|
1465
|
+
o,
|
|
1466
1466
|
R,
|
|
1467
1467
|
C,
|
|
1468
1468
|
u,
|
|
1469
|
-
|
|
1469
|
+
Ia
|
|
1470
1470
|
]);
|
|
1471
|
-
const
|
|
1472
|
-
|
|
1473
|
-
|
|
1471
|
+
const we = (R == null ? void 0 : R.dashboard) ?? null, { isDirty: Oa, isDirtyPending: $s, resetDirty: De } = ir(
|
|
1472
|
+
o,
|
|
1473
|
+
we,
|
|
1474
1474
|
300,
|
|
1475
1475
|
1e3,
|
|
1476
|
-
|
|
1477
|
-
),
|
|
1478
|
-
|
|
1479
|
-
},
|
|
1480
|
-
await
|
|
1476
|
+
Xe
|
|
1477
|
+
), Pa = Xt(() => we ? Xe(o) !== Xe(we) : !1, [o, we]), Ta = Oa || $s, Ce = ze || te.isPending, zs = () => {
|
|
1478
|
+
Pa() ? (Se("close"), se(!0)) : (je(), De());
|
|
1479
|
+
}, Hs = async () => {
|
|
1480
|
+
await Be({
|
|
1481
1481
|
closeAfterSave: !0,
|
|
1482
|
-
navigateHomeAfterSave:
|
|
1482
|
+
navigateHomeAfterSave: qe === "home"
|
|
1483
1483
|
});
|
|
1484
|
-
},
|
|
1485
|
-
R &&
|
|
1484
|
+
}, qs = () => {
|
|
1485
|
+
R && ka(R.dashboard, {
|
|
1486
1486
|
semanticExecutionPayload: R.semanticExecutionPayload
|
|
1487
|
-
}),
|
|
1488
|
-
},
|
|
1489
|
-
R && (
|
|
1487
|
+
}), je(), qe === "home" && Fe(), Se("close"), se(!1), De();
|
|
1488
|
+
}, Vs = () => {
|
|
1489
|
+
R && (ka(R.dashboard, {
|
|
1490
1490
|
semanticExecutionPayload: R.semanticExecutionPayload
|
|
1491
|
-
}),
|
|
1492
|
-
},
|
|
1493
|
-
if (C &&
|
|
1491
|
+
}), De());
|
|
1492
|
+
}, js = () => {
|
|
1493
|
+
if (C && Pa()) {
|
|
1494
1494
|
Se("home"), se(!0);
|
|
1495
1495
|
return;
|
|
1496
1496
|
}
|
|
1497
|
-
|
|
1497
|
+
Fe();
|
|
1498
1498
|
};
|
|
1499
|
-
async function
|
|
1499
|
+
async function Be(c) {
|
|
1500
1500
|
const O = S.getState().dashboard;
|
|
1501
1501
|
if (!O)
|
|
1502
1502
|
return;
|
|
1503
|
-
const z = (c == null ? void 0 : c.closeAfterSave) ??
|
|
1503
|
+
const z = (c == null ? void 0 : c.closeAfterSave) ?? wa, Ws = (c == null ? void 0 : c.navigateHomeAfterSave) ?? !1;
|
|
1504
1504
|
ve(z), z && se(!1);
|
|
1505
|
-
const
|
|
1506
|
-
he(!0), fe(null), ge([]),
|
|
1507
|
-
const
|
|
1505
|
+
const Xs = ia(O);
|
|
1506
|
+
he(!0), fe(null), ge([]), He(!0);
|
|
1507
|
+
const Ys = {
|
|
1508
1508
|
template: O
|
|
1509
1509
|
};
|
|
1510
1510
|
te.mutate(
|
|
1511
1511
|
{
|
|
1512
1512
|
resourceId: O.id,
|
|
1513
|
-
data:
|
|
1513
|
+
data: Ys
|
|
1514
1514
|
},
|
|
1515
1515
|
{
|
|
1516
1516
|
onSuccess: (_) => {
|
|
1517
|
-
var Le, Me,
|
|
1518
|
-
const B = (_ == null ? void 0 : _.id) || ((Le = _ == null ? void 0 : _.dashboard) == null ? void 0 : Le.id) || ((Me = _ == null ? void 0 : _.resource) == null ? void 0 : Me.id) || ((
|
|
1517
|
+
var Le, Me, qa;
|
|
1518
|
+
const B = (_ == null ? void 0 : _.id) || ((Le = _ == null ? void 0 : _.dashboard) == null ? void 0 : Le.id) || ((Me = _ == null ? void 0 : _.resource) == null ? void 0 : Me.id) || ((qa = _ == null ? void 0 : _.template) == null ? void 0 : qa.id) || null;
|
|
1519
1519
|
if (!O.id && B) {
|
|
1520
|
-
const
|
|
1521
|
-
(Ae == null ? void 0 : Ae.scopeKey) === m ?
|
|
1520
|
+
const Ke = ct.getState(), Ae = Ke.pendingDashboardDraftMigration;
|
|
1521
|
+
(Ae == null ? void 0 : Ae.scopeKey) === m ? Ke.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
|
|
1522
1522
|
B
|
|
1523
|
-
) : Ae &&
|
|
1523
|
+
) : Ae && Ke.actions.clearPendingDashboardDraftMigration();
|
|
1524
1524
|
}
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1525
|
+
He(!1), M.success("Dashboard saved!"), Ne(
|
|
1526
|
+
Ya(
|
|
1527
|
+
Xs,
|
|
1528
1528
|
S.getState().semanticExecutionPayload
|
|
1529
1529
|
)
|
|
1530
|
-
), he(!1), ve(!1), z && (
|
|
1530
|
+
), he(!1), ve(!1), z && (je(), De(), Ws && Fe()), Se("close");
|
|
1531
1531
|
},
|
|
1532
1532
|
onError: (_) => {
|
|
1533
|
-
|
|
1533
|
+
He(!1), fe("Failed to save dashboard. Please try again.");
|
|
1534
1534
|
const B = _.details, Le = Array.isArray(
|
|
1535
1535
|
B == null ? void 0 : B.errors
|
|
1536
1536
|
) ? (B.errors || []).filter(
|
|
1537
1537
|
(Me) => typeof Me == "string"
|
|
1538
1538
|
) : [];
|
|
1539
1539
|
ge(
|
|
1540
|
-
|
|
1540
|
+
Wr({
|
|
1541
1541
|
errors: Le,
|
|
1542
1542
|
dashboard: O || void 0
|
|
1543
1543
|
})
|
|
@@ -1546,7 +1546,7 @@ function vn() {
|
|
|
1546
1546
|
}
|
|
1547
1547
|
);
|
|
1548
1548
|
}
|
|
1549
|
-
async function
|
|
1549
|
+
async function Bs() {
|
|
1550
1550
|
if ($(!0), !h || !f) return;
|
|
1551
1551
|
const c = S.getState().dashboard;
|
|
1552
1552
|
if (!c) {
|
|
@@ -1556,27 +1556,27 @@ function vn() {
|
|
|
1556
1556
|
const O = JSON.stringify(c), z = {
|
|
1557
1557
|
...f,
|
|
1558
1558
|
template: O,
|
|
1559
|
-
filterValues:
|
|
1559
|
+
filterValues: ks
|
|
1560
1560
|
};
|
|
1561
|
-
await
|
|
1561
|
+
await da(
|
|
1562
1562
|
r.apiServiceUrl,
|
|
1563
1563
|
z,
|
|
1564
1564
|
a == null ? void 0 : a.accessToken
|
|
1565
|
-
), M.success("Lens saved"),
|
|
1565
|
+
), M.success("Lens saved"), Ge == null || Ge(c), $(!1);
|
|
1566
1566
|
}
|
|
1567
|
-
const
|
|
1567
|
+
const _a = (f == null ? void 0 : f.name) || o.title, ne = !!(o != null && o.id);
|
|
1568
1568
|
te.isPending && console.log("Title during update:", {
|
|
1569
|
-
title:
|
|
1570
|
-
dashboardStateTitle:
|
|
1571
|
-
dashboardId:
|
|
1569
|
+
title: _a,
|
|
1570
|
+
dashboardStateTitle: o.title,
|
|
1571
|
+
dashboardId: o == null ? void 0 : o.id,
|
|
1572
1572
|
currentLensName: f == null ? void 0 : f.name
|
|
1573
1573
|
});
|
|
1574
|
-
const
|
|
1575
|
-
|
|
1574
|
+
const Ua = r.orgUserId || r.tenantId && r.endUserId && r.endUserEmail, Ks = !!Ua && !!(a != null && a.accessToken) && !!(r != null && r.apiServiceUrl);
|
|
1575
|
+
We(() => {
|
|
1576
1576
|
!ne && Y && Z(!1);
|
|
1577
1577
|
}, [ne, Y]);
|
|
1578
|
-
const
|
|
1579
|
-
oe &&
|
|
1578
|
+
const Qs = l, oe = (o == null ? void 0 : o.id) || null, Ee = !!oe && Is === oe, Js = () => {
|
|
1579
|
+
oe && Os({
|
|
1580
1580
|
dashboardId: Ee ? null : oe
|
|
1581
1581
|
});
|
|
1582
1582
|
};
|
|
@@ -1587,29 +1587,29 @@ function vn() {
|
|
|
1587
1587
|
role: "dashboard-controls",
|
|
1588
1588
|
children: [
|
|
1589
1589
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1590
|
-
|
|
1590
|
+
Ua && /* @__PURE__ */ i(P, { children: [
|
|
1591
1591
|
/* @__PURE__ */ e(
|
|
1592
|
-
|
|
1592
|
+
Je,
|
|
1593
1593
|
{
|
|
1594
1594
|
"aria-label": "Manage Dashboards",
|
|
1595
1595
|
tooltip: "Manage Dashboards",
|
|
1596
1596
|
onClick: () => {
|
|
1597
|
-
|
|
1597
|
+
As(!Ms);
|
|
1598
1598
|
},
|
|
1599
1599
|
className: "h-7 w-7 px-0",
|
|
1600
1600
|
buttonProps: { size: "xs" },
|
|
1601
|
-
children: /* @__PURE__ */ e(
|
|
1601
|
+
children: /* @__PURE__ */ e(ur, { className: "h-3.5 w-3.5" })
|
|
1602
1602
|
}
|
|
1603
1603
|
),
|
|
1604
|
-
|
|
1605
|
-
|
|
1604
|
+
Qs && !U && /* @__PURE__ */ e(
|
|
1605
|
+
Je,
|
|
1606
1606
|
{
|
|
1607
1607
|
"aria-label": "Dashboard Hub",
|
|
1608
1608
|
tooltip: "Dashboard Hub",
|
|
1609
|
-
onClick:
|
|
1609
|
+
onClick: js,
|
|
1610
1610
|
className: "h-7 w-7 px-0",
|
|
1611
1611
|
buttonProps: { size: "xs" },
|
|
1612
|
-
children: /* @__PURE__ */ e(
|
|
1612
|
+
children: /* @__PURE__ */ e(os, { className: "h-3.5 w-3.5" })
|
|
1613
1613
|
}
|
|
1614
1614
|
)
|
|
1615
1615
|
] }),
|
|
@@ -1623,17 +1623,17 @@ function vn() {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
) : /* @__PURE__ */ i(P, { children: [
|
|
1625
1625
|
/* @__PURE__ */ e(
|
|
1626
|
-
|
|
1626
|
+
Tt,
|
|
1627
1627
|
{
|
|
1628
|
-
value:
|
|
1628
|
+
value: _a || "Untitled Dashboard",
|
|
1629
1629
|
onSave: (c) => {
|
|
1630
1630
|
console.log("EditableText onSave called:", {
|
|
1631
1631
|
newTitle: c,
|
|
1632
1632
|
canEditDashboard: ye,
|
|
1633
|
-
dashboardId:
|
|
1633
|
+
dashboardId: o == null ? void 0 : o.id
|
|
1634
1634
|
});
|
|
1635
|
-
const O = (
|
|
1636
|
-
T(c),
|
|
1635
|
+
const O = (o == null ? void 0 : o.title) || "";
|
|
1636
|
+
T(c), Gs(c, O);
|
|
1637
1637
|
},
|
|
1638
1638
|
isEditable: ye && !f,
|
|
1639
1639
|
displayClassName: "text-[13px] font-medium",
|
|
@@ -1642,18 +1642,18 @@ function vn() {
|
|
|
1642
1642
|
isPending: te.isPending
|
|
1643
1643
|
}
|
|
1644
1644
|
),
|
|
1645
|
-
|
|
1646
|
-
/* @__PURE__ */ e(
|
|
1645
|
+
Ks && oe && /* @__PURE__ */ e(tt, { children: /* @__PURE__ */ i(rt, { children: [
|
|
1646
|
+
/* @__PURE__ */ e(nt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1647
1647
|
A,
|
|
1648
1648
|
{
|
|
1649
1649
|
variant: "ghost",
|
|
1650
1650
|
size: "xs",
|
|
1651
|
-
onClick:
|
|
1652
|
-
disabled:
|
|
1651
|
+
onClick: Js,
|
|
1652
|
+
disabled: Ps || !(a != null && a.accessToken) || !(r != null && r.apiServiceUrl),
|
|
1653
1653
|
className: "w-7 px-0",
|
|
1654
1654
|
"aria-label": Ee ? "Remove as default dashboard" : "Make this a default dashboard",
|
|
1655
1655
|
children: /* @__PURE__ */ e(
|
|
1656
|
-
|
|
1656
|
+
_t,
|
|
1657
1657
|
{
|
|
1658
1658
|
className: W(
|
|
1659
1659
|
"h-3.5 w-3.5 transition-colors",
|
|
@@ -1663,14 +1663,14 @@ function vn() {
|
|
|
1663
1663
|
)
|
|
1664
1664
|
}
|
|
1665
1665
|
) }),
|
|
1666
|
-
/* @__PURE__ */ e(
|
|
1666
|
+
/* @__PURE__ */ e(ot, { children: /* @__PURE__ */ e("p", { children: Ee ? "Remove as default dashboard" : "Make this a default dashboard" }) })
|
|
1667
1667
|
] }) })
|
|
1668
1668
|
] }))
|
|
1669
1669
|
] }),
|
|
1670
1670
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1671
1671
|
U && /* @__PURE__ */ i(P, { children: [
|
|
1672
|
-
/* @__PURE__ */ e(
|
|
1673
|
-
/* @__PURE__ */ e(
|
|
1672
|
+
/* @__PURE__ */ e(er, {}),
|
|
1673
|
+
/* @__PURE__ */ e(ar, {})
|
|
1674
1674
|
] }),
|
|
1675
1675
|
!U && l && ((Ha = J == null ? void 0 : J.permissions) == null ? void 0 : Ha.canShare) && /* @__PURE__ */ i(
|
|
1676
1676
|
A,
|
|
@@ -1679,77 +1679,77 @@ function vn() {
|
|
|
1679
1679
|
size: "xs",
|
|
1680
1680
|
onClick: () => L(!0),
|
|
1681
1681
|
children: [
|
|
1682
|
-
/* @__PURE__ */ e(
|
|
1682
|
+
/* @__PURE__ */ e(Ut, { className: "h-3.5 w-3.5" }),
|
|
1683
1683
|
"Share"
|
|
1684
1684
|
]
|
|
1685
1685
|
}
|
|
1686
1686
|
),
|
|
1687
|
-
!U && C && d.canUseFilters && l && /* @__PURE__ */ e(
|
|
1687
|
+
!U && C && d.canUseFilters && l && /* @__PURE__ */ e(sr, {}),
|
|
1688
1688
|
C && !U && re && f && s && l && /* @__PURE__ */ i(
|
|
1689
1689
|
A,
|
|
1690
1690
|
{
|
|
1691
1691
|
variant: "secondary",
|
|
1692
1692
|
size: "xs",
|
|
1693
1693
|
disabled: E,
|
|
1694
|
-
onClick:
|
|
1694
|
+
onClick: Bs,
|
|
1695
1695
|
children: [
|
|
1696
|
-
/* @__PURE__ */ e(
|
|
1696
|
+
/* @__PURE__ */ e(Ka, { className: "h-3.5 w-3.5" }),
|
|
1697
1697
|
"Save Lens"
|
|
1698
1698
|
]
|
|
1699
1699
|
}
|
|
1700
1700
|
),
|
|
1701
|
-
C && !U && l && !
|
|
1701
|
+
C && !U && l && !D && /* @__PURE__ */ i(
|
|
1702
1702
|
A,
|
|
1703
1703
|
{
|
|
1704
1704
|
variant: "outline",
|
|
1705
1705
|
size: "xs",
|
|
1706
1706
|
disabled: !C,
|
|
1707
|
-
onClick: () =>
|
|
1707
|
+
onClick: () => Us(),
|
|
1708
1708
|
children: [
|
|
1709
|
-
/* @__PURE__ */ e(
|
|
1709
|
+
/* @__PURE__ */ e(ta, { className: "h-3.5 w-3.5" }),
|
|
1710
1710
|
"Visual"
|
|
1711
1711
|
]
|
|
1712
1712
|
}
|
|
1713
1713
|
),
|
|
1714
|
-
!U && !C && ye && l && /* @__PURE__ */ i(A, { size: "xs", onClick:
|
|
1715
|
-
/* @__PURE__ */ e(
|
|
1714
|
+
!U && !C && ye && l && /* @__PURE__ */ i(A, { size: "xs", onClick: Fs, children: [
|
|
1715
|
+
/* @__PURE__ */ e(Rt, { className: "h-3.5 w-3.5" }),
|
|
1716
1716
|
"Edit"
|
|
1717
1717
|
] }),
|
|
1718
|
-
|
|
1718
|
+
Aa && l && Oa && /* @__PURE__ */ i(
|
|
1719
1719
|
A,
|
|
1720
1720
|
{
|
|
1721
1721
|
variant: "outline",
|
|
1722
1722
|
size: "xs",
|
|
1723
|
-
onClick:
|
|
1723
|
+
onClick: Vs,
|
|
1724
1724
|
disabled: Ce,
|
|
1725
1725
|
children: [
|
|
1726
|
-
/* @__PURE__ */ e(
|
|
1726
|
+
/* @__PURE__ */ e(gr, { className: "h-3.5 w-3.5" }),
|
|
1727
1727
|
"Undo"
|
|
1728
1728
|
]
|
|
1729
1729
|
}
|
|
1730
1730
|
),
|
|
1731
|
-
|
|
1731
|
+
Aa && l && /* @__PURE__ */ i(
|
|
1732
1732
|
A,
|
|
1733
1733
|
{
|
|
1734
1734
|
size: "xs",
|
|
1735
|
-
className: W(!
|
|
1736
|
-
disabled: Ce || !
|
|
1737
|
-
onClick: () =>
|
|
1735
|
+
className: W(!Ta && "opacity-60"),
|
|
1736
|
+
disabled: Ce || !Ta,
|
|
1737
|
+
onClick: () => Be(),
|
|
1738
1738
|
children: [
|
|
1739
|
-
Ce ? /* @__PURE__ */ e(X, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(
|
|
1739
|
+
Ce ? /* @__PURE__ */ e(X, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Ka, { className: "h-3.5 w-3.5" }),
|
|
1740
1740
|
Ce ? "Saving..." : "Save"
|
|
1741
1741
|
]
|
|
1742
1742
|
}
|
|
1743
1743
|
),
|
|
1744
|
-
C && !U && l && /* @__PURE__ */ i(A, { variant: "outline", size: "xs", onClick:
|
|
1745
|
-
/* @__PURE__ */ e(
|
|
1744
|
+
C && !U && l && /* @__PURE__ */ i(A, { variant: "outline", size: "xs", onClick: zs, children: [
|
|
1745
|
+
/* @__PURE__ */ e(is, { className: "h-3.5 w-3.5" }),
|
|
1746
1746
|
"Close"
|
|
1747
1747
|
] }),
|
|
1748
|
-
!U && l && /* @__PURE__ */ e("div", { className: "ml-2", children: /* @__PURE__ */ e(
|
|
1749
|
-
!U && s && /* @__PURE__ */ e(
|
|
1750
|
-
!U && l && /* @__PURE__ */ i(
|
|
1751
|
-
/* @__PURE__ */ e(
|
|
1752
|
-
|
|
1748
|
+
!U && l && /* @__PURE__ */ e("div", { className: "ml-2", children: /* @__PURE__ */ e(tr, {}) }),
|
|
1749
|
+
!U && s && /* @__PURE__ */ e(xr, {}),
|
|
1750
|
+
!U && l && /* @__PURE__ */ i(Gt, { children: [
|
|
1751
|
+
/* @__PURE__ */ e(Ft, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1752
|
+
Je,
|
|
1753
1753
|
{
|
|
1754
1754
|
tooltip: "More Options",
|
|
1755
1755
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
@@ -1758,49 +1758,49 @@ function vn() {
|
|
|
1758
1758
|
variant: "ghost",
|
|
1759
1759
|
"aria-label": "More dashboard options"
|
|
1760
1760
|
},
|
|
1761
|
-
children: /* @__PURE__ */ e(
|
|
1761
|
+
children: /* @__PURE__ */ e($t, { className: "h-3.5 w-3.5" })
|
|
1762
1762
|
}
|
|
1763
1763
|
) }),
|
|
1764
1764
|
/* @__PURE__ */ i(
|
|
1765
|
-
|
|
1765
|
+
zt,
|
|
1766
1766
|
{
|
|
1767
1767
|
align: "end",
|
|
1768
1768
|
className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
|
|
1769
1769
|
children: [
|
|
1770
1770
|
/* @__PURE__ */ e(le, { children: "Reports" }),
|
|
1771
1771
|
/* @__PURE__ */ i(
|
|
1772
|
-
|
|
1772
|
+
F,
|
|
1773
1773
|
{
|
|
1774
1774
|
disabled: b,
|
|
1775
|
-
onSelect: () =>
|
|
1775
|
+
onSelect: () => ee(!0),
|
|
1776
1776
|
children: [
|
|
1777
|
-
/* @__PURE__ */ e(
|
|
1777
|
+
/* @__PURE__ */ e(Ht, { className: "h-3.5 w-3.5" }),
|
|
1778
1778
|
"Export"
|
|
1779
1779
|
]
|
|
1780
1780
|
}
|
|
1781
1781
|
),
|
|
1782
1782
|
/* @__PURE__ */ i(
|
|
1783
|
-
|
|
1783
|
+
F,
|
|
1784
1784
|
{
|
|
1785
1785
|
disabled: !ne,
|
|
1786
1786
|
onSelect: () => {
|
|
1787
1787
|
ne && Z(!0);
|
|
1788
1788
|
},
|
|
1789
1789
|
children: [
|
|
1790
|
-
/* @__PURE__ */ e(
|
|
1790
|
+
/* @__PURE__ */ e(qt, { className: "h-3.5 w-3.5" }),
|
|
1791
1791
|
"Schedule"
|
|
1792
1792
|
]
|
|
1793
1793
|
}
|
|
1794
1794
|
),
|
|
1795
1795
|
/* @__PURE__ */ e(Oe, {}),
|
|
1796
|
-
|
|
1796
|
+
_s && /* @__PURE__ */ i(P, { children: [
|
|
1797
1797
|
/* @__PURE__ */ e(le, { children: "Access" }),
|
|
1798
1798
|
/* @__PURE__ */ i(
|
|
1799
|
-
|
|
1799
|
+
F,
|
|
1800
1800
|
{
|
|
1801
1801
|
onClick: () => ue(!0),
|
|
1802
1802
|
children: [
|
|
1803
|
-
/* @__PURE__ */ e(
|
|
1803
|
+
/* @__PURE__ */ e(va, { className: "h-3.5 w-3.5" }),
|
|
1804
1804
|
"Manage Groups"
|
|
1805
1805
|
]
|
|
1806
1806
|
}
|
|
@@ -1808,19 +1808,15 @@ function vn() {
|
|
|
1808
1808
|
/* @__PURE__ */ e(Oe, {})
|
|
1809
1809
|
] }),
|
|
1810
1810
|
/* @__PURE__ */ e(le, { children: "Preferences" }),
|
|
1811
|
-
/* @__PURE__ */ i(
|
|
1812
|
-
/* @__PURE__ */ e(
|
|
1811
|
+
/* @__PURE__ */ i(F, { onClick: () => I(!0), children: [
|
|
1812
|
+
/* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5" }),
|
|
1813
1813
|
"Calendar Preferences"
|
|
1814
1814
|
] }),
|
|
1815
|
-
/* @__PURE__ */ i(G, { onClick: () => q(!0), children: [
|
|
1816
|
-
/* @__PURE__ */ e(Kt, { className: "h-3.5 w-3.5" }),
|
|
1817
|
-
"Summary Settings"
|
|
1818
|
-
] }),
|
|
1819
1815
|
s && l && /* @__PURE__ */ i(P, { children: [
|
|
1820
1816
|
/* @__PURE__ */ e(Oe, {}),
|
|
1821
1817
|
/* @__PURE__ */ e(le, { children: "Developer" }),
|
|
1822
1818
|
/* @__PURE__ */ i(
|
|
1823
|
-
|
|
1819
|
+
F,
|
|
1824
1820
|
{
|
|
1825
1821
|
onSelect: () => {
|
|
1826
1822
|
var c;
|
|
@@ -1829,13 +1825,13 @@ function vn() {
|
|
|
1829
1825
|
).catch(() => M.error("Unable to copy token")) : M.error("Clipboard not available"));
|
|
1830
1826
|
},
|
|
1831
1827
|
children: [
|
|
1832
|
-
/* @__PURE__ */ e(
|
|
1828
|
+
/* @__PURE__ */ e(Ba, { className: "h-3.5 w-3.5" }),
|
|
1833
1829
|
"Copy token"
|
|
1834
1830
|
]
|
|
1835
1831
|
}
|
|
1836
1832
|
),
|
|
1837
|
-
|
|
1838
|
-
|
|
1833
|
+
D && /* @__PURE__ */ i(
|
|
1834
|
+
F,
|
|
1839
1835
|
{
|
|
1840
1836
|
disabled: !Ve,
|
|
1841
1837
|
onSelect: () => {
|
|
@@ -1857,127 +1853,109 @@ function vn() {
|
|
|
1857
1853
|
) : M.error("Clipboard not available");
|
|
1858
1854
|
},
|
|
1859
1855
|
children: [
|
|
1860
|
-
/* @__PURE__ */ e(
|
|
1856
|
+
/* @__PURE__ */ e(Ba, { className: "h-3.5 w-3.5" }),
|
|
1861
1857
|
"Copy local document PDF URL"
|
|
1862
1858
|
]
|
|
1863
1859
|
}
|
|
1864
1860
|
),
|
|
1865
1861
|
/* @__PURE__ */ i(
|
|
1866
|
-
|
|
1862
|
+
F,
|
|
1867
1863
|
{
|
|
1868
|
-
onSelect: () =>
|
|
1864
|
+
onSelect: () => it(r.apiServiceUrl),
|
|
1869
1865
|
children: [
|
|
1870
|
-
/* @__PURE__ */ e(
|
|
1866
|
+
/* @__PURE__ */ e(pr, { className: "h-3.5 w-3.5" }),
|
|
1871
1867
|
"Invalidate token"
|
|
1872
1868
|
]
|
|
1873
1869
|
}
|
|
1874
1870
|
),
|
|
1875
|
-
/* @__PURE__ */ i(
|
|
1876
|
-
/* @__PURE__ */ e(
|
|
1871
|
+
/* @__PURE__ */ i(F, { onSelect: n, children: [
|
|
1872
|
+
/* @__PURE__ */ e(cr, { className: "h-3.5 w-3.5" }),
|
|
1877
1873
|
"Brand Studio"
|
|
1878
1874
|
] }),
|
|
1879
1875
|
C && /* @__PURE__ */ i(
|
|
1880
|
-
|
|
1876
|
+
F,
|
|
1881
1877
|
{
|
|
1882
|
-
onSelect: () =>
|
|
1878
|
+
onSelect: () => Ea(!Da),
|
|
1883
1879
|
children: [
|
|
1884
|
-
/* @__PURE__ */ e(
|
|
1885
|
-
|
|
1880
|
+
/* @__PURE__ */ e(lr, { className: "h-3.5 w-3.5" }),
|
|
1881
|
+
Da ? "Hide dashboard JSON" : "Show dashboard JSON"
|
|
1886
1882
|
]
|
|
1887
1883
|
}
|
|
1888
1884
|
),
|
|
1889
|
-
re && C && /* @__PURE__ */ i(
|
|
1890
|
-
/* @__PURE__ */ e(
|
|
1885
|
+
re && C && /* @__PURE__ */ i(F, { onSelect: () => H(!0), children: [
|
|
1886
|
+
/* @__PURE__ */ e(ta, { className: "h-3.5 w-3.5" }),
|
|
1891
1887
|
"Add lens"
|
|
1892
1888
|
] }),
|
|
1893
|
-
re && /* @__PURE__ */ i(
|
|
1894
|
-
/* @__PURE__ */ i(
|
|
1895
|
-
/* @__PURE__ */ e(
|
|
1889
|
+
re && /* @__PURE__ */ i(jt, { children: [
|
|
1890
|
+
/* @__PURE__ */ i(Bt, { children: [
|
|
1891
|
+
/* @__PURE__ */ e(dr, { className: "h-3.5 w-3.5" }),
|
|
1896
1892
|
"Lenses"
|
|
1897
1893
|
] }),
|
|
1898
|
-
/* @__PURE__ */ e(
|
|
1894
|
+
/* @__PURE__ */ e(Kt, { className: "w-60", children: /* @__PURE__ */ e(Cr, {}) })
|
|
1899
1895
|
] })
|
|
1900
1896
|
] })
|
|
1901
1897
|
]
|
|
1902
1898
|
}
|
|
1903
1899
|
)
|
|
1904
1900
|
] }),
|
|
1905
|
-
K &&
|
|
1906
|
-
|
|
1901
|
+
K && Ma && /* @__PURE__ */ e(
|
|
1902
|
+
Qt,
|
|
1907
1903
|
{
|
|
1908
|
-
resource:
|
|
1909
|
-
resourceType:
|
|
1904
|
+
resource: Ma,
|
|
1905
|
+
resourceType: Qe.DASHBOARD,
|
|
1910
1906
|
onClose: () => L(!1)
|
|
1911
1907
|
}
|
|
1912
1908
|
),
|
|
1913
1909
|
/* @__PURE__ */ e(
|
|
1914
|
-
|
|
1910
|
+
Qr,
|
|
1915
1911
|
{
|
|
1916
1912
|
open: Q,
|
|
1917
1913
|
onOpenChange: ue
|
|
1918
1914
|
}
|
|
1919
1915
|
),
|
|
1920
|
-
ne && (
|
|
1921
|
-
|
|
1916
|
+
ne && (o == null ? void 0 : o.id) && /* @__PURE__ */ e(
|
|
1917
|
+
Jt,
|
|
1922
1918
|
{
|
|
1923
1919
|
open: Y,
|
|
1924
1920
|
onOpenChange: Z,
|
|
1925
|
-
dashboardId:
|
|
1926
|
-
dashboardName:
|
|
1921
|
+
dashboardId: o.id,
|
|
1922
|
+
dashboardName: o == null ? void 0 : o.title
|
|
1927
1923
|
}
|
|
1928
1924
|
),
|
|
1929
1925
|
/* @__PURE__ */ e(
|
|
1930
|
-
|
|
1926
|
+
or,
|
|
1931
1927
|
{
|
|
1932
1928
|
open: v,
|
|
1933
1929
|
onOpenChange: I
|
|
1934
1930
|
}
|
|
1935
1931
|
),
|
|
1936
|
-
/* @__PURE__ */ e(
|
|
1937
|
-
dr,
|
|
1938
|
-
{
|
|
1939
|
-
open: F,
|
|
1940
|
-
onOpenChange: q,
|
|
1941
|
-
dashboard: n,
|
|
1942
|
-
disabled: !C,
|
|
1943
|
-
onApply: (c) => je(
|
|
1944
|
-
{
|
|
1945
|
-
...n,
|
|
1946
|
-
summary: c
|
|
1947
|
-
},
|
|
1948
|
-
{
|
|
1949
|
-
semanticExecutionPayload: Be
|
|
1950
|
-
}
|
|
1951
|
-
)
|
|
1952
|
-
}
|
|
1953
|
-
),
|
|
1954
|
-
s && re && l && /* @__PURE__ */ e(Mr, { open: me, onOpenChange: ee }),
|
|
1932
|
+
s && re && l && /* @__PURE__ */ e(Dr, { open: G, onOpenChange: H }),
|
|
1955
1933
|
l && /* @__PURE__ */ e(
|
|
1956
|
-
|
|
1934
|
+
Wt,
|
|
1957
1935
|
{
|
|
1958
|
-
open:
|
|
1959
|
-
onOpenChange:
|
|
1936
|
+
open: me,
|
|
1937
|
+
onOpenChange: ee
|
|
1960
1938
|
}
|
|
1961
1939
|
),
|
|
1962
1940
|
/* @__PURE__ */ e(
|
|
1963
|
-
|
|
1941
|
+
ds,
|
|
1964
1942
|
{
|
|
1965
|
-
open:
|
|
1943
|
+
open: Ls,
|
|
1966
1944
|
onOpenChange: (c) => {
|
|
1967
1945
|
!c && ze && !pe || (he(c), c || (fe(null), ge([]), ve(!1)));
|
|
1968
1946
|
},
|
|
1969
|
-
children: /* @__PURE__ */ i(
|
|
1970
|
-
/* @__PURE__ */ i(
|
|
1971
|
-
/* @__PURE__ */ e(
|
|
1972
|
-
/* @__PURE__ */ e(
|
|
1973
|
-
|
|
1947
|
+
children: /* @__PURE__ */ i(us, { className: "max-w-sm", children: [
|
|
1948
|
+
/* @__PURE__ */ i(ms, { children: [
|
|
1949
|
+
/* @__PURE__ */ e(hs, { children: pe ? "Save failed" : "Saving dashboard" }),
|
|
1950
|
+
/* @__PURE__ */ e(ps, { className: "pt-2", children: pe ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
|
|
1951
|
+
Na.length > 0 && /* @__PURE__ */ i("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
|
|
1974
1952
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
|
|
1975
|
-
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children:
|
|
1953
|
+
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: Na.slice(0, 5).map((c) => /* @__PURE__ */ e("li", { children: c }, c)) })
|
|
1976
1954
|
] })
|
|
1977
1955
|
] }),
|
|
1978
|
-
/* @__PURE__ */ e(
|
|
1956
|
+
/* @__PURE__ */ e(fs, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: pe ? /* @__PURE__ */ i(P, { children: [
|
|
1979
1957
|
/* @__PURE__ */ e(
|
|
1980
|
-
|
|
1958
|
+
gs,
|
|
1981
1959
|
{
|
|
1982
1960
|
onClick: () => {
|
|
1983
1961
|
he(!1), fe(null), ge([]), ve(!1);
|
|
@@ -1987,17 +1965,17 @@ function vn() {
|
|
|
1987
1965
|
}
|
|
1988
1966
|
),
|
|
1989
1967
|
/* @__PURE__ */ e(
|
|
1990
|
-
|
|
1968
|
+
oa,
|
|
1991
1969
|
{
|
|
1992
|
-
onClick: () =>
|
|
1993
|
-
closeAfterSave:
|
|
1994
|
-
navigateHomeAfterSave:
|
|
1970
|
+
onClick: () => Be({
|
|
1971
|
+
closeAfterSave: wa,
|
|
1972
|
+
navigateHomeAfterSave: qe === "home"
|
|
1995
1973
|
}),
|
|
1996
1974
|
className: "m-0",
|
|
1997
1975
|
children: "Retry"
|
|
1998
1976
|
}
|
|
1999
1977
|
)
|
|
2000
|
-
] }) : /* @__PURE__ */ i(
|
|
1978
|
+
] }) : /* @__PURE__ */ i(oa, { disabled: !0, className: "m-0 cursor-default", children: [
|
|
2001
1979
|
/* @__PURE__ */ e(X, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2002
1980
|
"Saving..."
|
|
2003
1981
|
] }) })
|
|
@@ -2005,14 +1983,14 @@ function vn() {
|
|
|
2005
1983
|
}
|
|
2006
1984
|
),
|
|
2007
1985
|
/* @__PURE__ */ e(
|
|
2008
|
-
|
|
1986
|
+
rr,
|
|
2009
1987
|
{
|
|
2010
|
-
open:
|
|
1988
|
+
open: Rs,
|
|
2011
1989
|
onOpenChange: (c) => {
|
|
2012
1990
|
se(c);
|
|
2013
1991
|
},
|
|
2014
|
-
onSave:
|
|
2015
|
-
onDiscard:
|
|
1992
|
+
onSave: Hs,
|
|
1993
|
+
onDiscard: qs,
|
|
2016
1994
|
isSaving: ze,
|
|
2017
1995
|
saveLabel: "Save",
|
|
2018
1996
|
discardLabel: "Discard"
|
|
@@ -2023,12 +2001,12 @@ function vn() {
|
|
|
2023
2001
|
}
|
|
2024
2002
|
);
|
|
2025
2003
|
}
|
|
2026
|
-
function
|
|
2004
|
+
function Xr({
|
|
2027
2005
|
accessToken: a,
|
|
2028
2006
|
dashboardId: r,
|
|
2029
2007
|
selectedSheetId: t,
|
|
2030
2008
|
pageSize: s,
|
|
2031
|
-
orientation:
|
|
2009
|
+
orientation: n,
|
|
2032
2010
|
theme: d
|
|
2033
2011
|
}) {
|
|
2034
2012
|
if (!a || !t)
|
|
@@ -2036,8 +2014,8 @@ function an({
|
|
|
2036
2014
|
const l = new URL("http://localhost:5173/print-document");
|
|
2037
2015
|
l.searchParams.set("token", a), r && l.searchParams.set("dashboardId", r), l.searchParams.set("selectedSheetId", t), d && l.searchParams.set("theme", d);
|
|
2038
2016
|
const u = new URL("http://127.0.0.1:3002/");
|
|
2039
|
-
return u.searchParams.set("pdfMode", "document"), u.searchParams.set("pageSize", s || "letter"), u.searchParams.set("orientation",
|
|
2017
|
+
return u.searchParams.set("pdfMode", "document"), u.searchParams.set("pageSize", s || "letter"), u.searchParams.set("orientation", n || "portrait"), u.searchParams.set("url", l.toString()), u.toString();
|
|
2040
2018
|
}
|
|
2041
2019
|
export {
|
|
2042
|
-
|
|
2020
|
+
hn as default
|
|
2043
2021
|
};
|