react-semaphor 0.1.549 → 0.1.550
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 +1 -1
- package/dist/chunks/{assistant-chat-CUSvuESS.js → assistant-chat-ClAvjeNe.js} +104 -104
- package/dist/chunks/{dashboard-Cm7WkARH.js → dashboard-DDQgKoss.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-X0HzNpS8.js → dashboard-briefing-launcher-CCYs8E4j.js} +1440 -1328
- package/dist/chunks/{dashboard-controls-BuX6TMNK.js → dashboard-controls-DfSkQBsk.js} +976 -929
- package/dist/chunks/{dashboard-json-Cc4u2xvy.js → dashboard-json-BPhyn9pl.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-DX2CzibK.js → edit-dashboard-visual-G7EmLuR0.js} +355 -355
- package/dist/chunks/{filter-reach-copy-Bc-Gei83.js → filter-reach-copy-8vnDYToV.js} +94 -92
- package/dist/chunks/{report-preferences-dialog-B9oYQ6OJ.js → report-preferences-dialog-D_fEDaS4.js} +849 -768
- package/dist/chunks/{semaphor-ready-indicator-wWkPH4ue.js → semaphor-ready-indicator-Bz5BxITW.js} +25706 -25429
- package/dist/chunks/{shelf-drop-preview-context-B86d8IZO.js → shelf-drop-preview-context-B8kNwpWQ.js} +2 -2
- package/dist/chunks/{switch-CEBOR4n7.js → switch-wJP6O7ZT.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-DPNjYyi3.js → use-create-flow-overlay-state-RzJa7G8S.js} +2 -2
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +2 -2
- package/dist/index.js +184 -169
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/components/assistant/assistant-entry-points.d.ts +4 -1
- package/dist/types/components/dashboard/favorites/dashboard-favorite-toggle.d.ts +11 -0
- package/dist/types/components/dashboard/favorites/favorite-star-button.d.ts +16 -0
- package/dist/types/components/index.d.ts +8 -0
- package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +16 -0
- package/dist/types/components/surfboard/toolbar/toolbar-context.d.ts +86 -0
- package/dist/types/components/surfboard/toolbar/toolbar-overflow.d.ts +14 -0
- package/dist/types/lib/dashboard-viewer/viewer-store-state.d.ts +7 -0
- package/dist/types/lib/hooks/use-dashboard-favorite.d.ts +24 -0
- package/dist/types/lib/hooks/use-dashboard-query.d.ts +2 -0
- package/dist/types/lib/hooks/use-default-dashboard-toggle.d.ts +12 -0
- package/dist/types/shared/dashboard-viewer/viewer-contract.d.ts +18 -0
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { B as
|
|
4
|
-
import { c as
|
|
1
|
+
import { jsx as e, jsxs as o, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { bQ as Br, u as C, bR as Fr, bS as Gr, bT as st, bU as Vr, bV as jr, bW as zr, bX as Hr, bY as qr, bZ as Kr, b5 as J, b3 as ve, b_ as ye, bK as D, b$ as Qr, bL as Ft, bM as Gt, bO as et, bP as tt, c0 as Vt, aR as ot, a_ as re, c1 as Wr, c2 as Yr, c3 as jt, c4 as Jr, c5 as zt, bN as Xr, c6 as Zr, c7 as P, c8 as ea, c9 as ta, ca as ra, aC as aa, bh as na, by as sa, cb as oa, bz as ia, j as da, W as ca, a6 as Ct, i as _e, p as la, k as Je, cc as ua, cd as ma, Q as ha, ce as pa, s as fa, cf as ba, cg as ga, bk as xa, ch as va, ci as Dt, cj as Ht, ck as Et, cl as ya, bA as wa, cm as Na, cn as Sa, co as be, cp as Pe, cq as ka, cr as Ca, cs as Da, ct as It, o as Ea, cu as Ia, cv as Aa, cw as Oa, cx as La, cy as Ma, cz as _a, cA as Pa, cB as Ta, cC as At, cD as Ra } from "./semaphor-ready-indicator-Bz5BxITW.js";
|
|
3
|
+
import { B as G, Z as Ua, _ as $a, $ as rt, L as Re, l as Ba, r as Fa, s as Ga, t as Va, u as ja, v as za, P as Ha, a as qa, b as Ka, m as Qa, n as Wa, o as Ya, I as Ja, p as Xa, c as qt } from "./switch-wJP6O7ZT.js";
|
|
4
|
+
import { c as we, X as Kt, C as Za } from "./x-4f5U2XwU.js";
|
|
5
5
|
import * as A from "react";
|
|
6
|
-
import
|
|
6
|
+
import Qt, { useMemo as V, useState as N, useEffect as ge, useRef as Ot, useLayoutEffect as en } from "react";
|
|
7
7
|
import "./index-CuHybtft.js";
|
|
8
8
|
import "./validators-C-aOQlTB.js";
|
|
9
9
|
import "./matrix-operation-contract-D6vYkZK4.js";
|
|
10
10
|
import "./analytics-base-schemas-BKs3flFS.js";
|
|
11
11
|
import "zod";
|
|
12
12
|
import "../value-format-preferences/index.js";
|
|
13
|
-
import { c as
|
|
14
|
-
import { u as
|
|
15
|
-
import { I as gn } from "./use-create-flow-overlay-state-
|
|
16
|
-
import {
|
|
17
|
-
import { createPortal as
|
|
18
|
-
import { dr as
|
|
19
|
-
import { S as
|
|
20
|
-
import { o as
|
|
21
|
-
import { ac as
|
|
22
|
-
import { r as
|
|
23
|
-
import { u as
|
|
24
|
-
import { K as
|
|
25
|
-
import { l as
|
|
26
|
-
import { S as
|
|
27
|
-
import { P as
|
|
13
|
+
import { c as xe } from "./_commonjsHelpers-DimLPMtv.js";
|
|
14
|
+
import { u as tn, d as rn, c as an, D as nn, A as sn, a as on, j as dn, V as cn, b as ln, e as un, S as mn, T as hn, i as pn, k as fn, U as bn } from "./dashboard-briefing-launcher-CCYs8E4j.js";
|
|
15
|
+
import { I as gn } from "./use-create-flow-overlay-state-RzJa7G8S.js";
|
|
16
|
+
import { u as xn, h as vn, R as yn, l as Wt } from "./report-preferences-dialog-D_fEDaS4.js";
|
|
17
|
+
import { createPortal as wn } from "react-dom";
|
|
18
|
+
import { dr as Ne, ds as it, dt as Yt, as as Nn } from "./global-date-filter-utils-CnumW4j2.js";
|
|
19
|
+
import { S as Sn, C as kn } from "./selection-reducer-CJzkTZio.js";
|
|
20
|
+
import { o as Jt } from "./matrix-formatter-DWEeC0_c.js";
|
|
21
|
+
import { ac as Lt, ad as Cn, ae as Dn, a as at } from "./resolve-dashboard-input-context-DVWF7p5C.js";
|
|
22
|
+
import { r as En } from "./export-file-format-C-tJsxsf.js";
|
|
23
|
+
import { u as In, s as An } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
|
|
24
|
+
import { K as Ue, u as Mt } from "./table-settings-WysCBj62.js";
|
|
25
|
+
import { l as On, h as _t, e as Ln } from "./document-dashboard-inputs-DPQ_wUGD.js";
|
|
26
|
+
import { S as Mn } from "./save-CfJpQQ68.js";
|
|
27
|
+
import { P as _n } from "./palette-D10o_yYX.js";
|
|
28
28
|
import { B as Pn } from "./braces-o9UiRQes.js";
|
|
29
29
|
/**
|
|
30
30
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -32,7 +32,7 @@ import { B as Pn } from "./braces-o9UiRQes.js";
|
|
|
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 Tn = we("Moon", [
|
|
36
36
|
["path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z", key: "a7tn18" }]
|
|
37
37
|
]);
|
|
38
38
|
/**
|
|
@@ -41,7 +41,7 @@ const _n = ye("Moon", [
|
|
|
41
41
|
* This source code is licensed under the ISC license.
|
|
42
42
|
* See the LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
const Rn =
|
|
44
|
+
const Rn = we("ShieldX", [
|
|
45
45
|
[
|
|
46
46
|
"path",
|
|
47
47
|
{
|
|
@@ -58,7 +58,7 @@ const Rn = ye("ShieldX", [
|
|
|
58
58
|
* This source code is licensed under the ISC license.
|
|
59
59
|
* See the LICENSE file in the root directory of this source tree.
|
|
60
60
|
*/
|
|
61
|
-
const
|
|
61
|
+
const Un = we("Sun", [
|
|
62
62
|
["circle", { cx: "12", cy: "12", r: "4", key: "4exip2" }],
|
|
63
63
|
["path", { d: "M12 2v2", key: "tus03m" }],
|
|
64
64
|
["path", { d: "M12 20v2", key: "1lh1kg" }],
|
|
@@ -75,7 +75,7 @@ const Tn = ye("Sun", [
|
|
|
75
75
|
* This source code is licensed under the ISC license.
|
|
76
76
|
* See the LICENSE file in the root directory of this source tree.
|
|
77
77
|
*/
|
|
78
|
-
const
|
|
78
|
+
const $n = we("UserPlus", [
|
|
79
79
|
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
|
|
80
80
|
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
|
|
81
81
|
["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
|
|
@@ -87,11 +87,11 @@ const Un = ye("UserPlus", [
|
|
|
87
87
|
* This source code is licensed under the ISC license.
|
|
88
88
|
* See the LICENSE file in the root directory of this source tree.
|
|
89
89
|
*/
|
|
90
|
-
const
|
|
90
|
+
const Xt = we("UserRound", [
|
|
91
91
|
["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
|
|
92
92
|
["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
|
|
93
93
|
]);
|
|
94
|
-
var
|
|
94
|
+
var nt = { exports: {} }, Xe = {};
|
|
95
95
|
/**
|
|
96
96
|
* @license React
|
|
97
97
|
* use-sync-external-store-shim.production.js
|
|
@@ -101,23 +101,23 @@ var at = { exports: {} }, Je = {};
|
|
|
101
101
|
* This source code is licensed under the MIT license found in the
|
|
102
102
|
* LICENSE file in the root directory of this source tree.
|
|
103
103
|
*/
|
|
104
|
-
var
|
|
105
|
-
function
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
-
var t =
|
|
109
|
-
function
|
|
104
|
+
var Pt;
|
|
105
|
+
function Bn() {
|
|
106
|
+
if (Pt) return Xe;
|
|
107
|
+
Pt = 1;
|
|
108
|
+
var t = Qt;
|
|
109
|
+
function a(c, u) {
|
|
110
110
|
return c === u && (c !== 0 || 1 / c === 1 / u) || c !== c && u !== u;
|
|
111
111
|
}
|
|
112
|
-
var
|
|
113
|
-
function
|
|
112
|
+
var n = typeof Object.is == "function" ? Object.is : a, r = t.useState, s = t.useEffect, d = t.useLayoutEffect, f = t.useDebugValue;
|
|
113
|
+
function h(c, u) {
|
|
114
114
|
var l = u(), p = r({ inst: { value: l, getSnapshot: u } }), x = p[0].inst, w = p[1];
|
|
115
115
|
return d(
|
|
116
116
|
function() {
|
|
117
117
|
x.value = l, x.getSnapshot = u, g(x) && w({ inst: x });
|
|
118
118
|
},
|
|
119
119
|
[c, l, u]
|
|
120
|
-
),
|
|
120
|
+
), s(
|
|
121
121
|
function() {
|
|
122
122
|
return g(x) && w({ inst: x }), c(function() {
|
|
123
123
|
g(x) && w({ inst: x });
|
|
@@ -131,7 +131,7 @@ function $n() {
|
|
|
131
131
|
c = c.value;
|
|
132
132
|
try {
|
|
133
133
|
var l = u();
|
|
134
|
-
return !
|
|
134
|
+
return !n(c, l);
|
|
135
135
|
} catch {
|
|
136
136
|
return !0;
|
|
137
137
|
}
|
|
@@ -139,10 +139,10 @@ function $n() {
|
|
|
139
139
|
function v(c, u) {
|
|
140
140
|
return u();
|
|
141
141
|
}
|
|
142
|
-
var
|
|
143
|
-
return
|
|
142
|
+
var m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? v : h;
|
|
143
|
+
return Xe.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : m, Xe;
|
|
144
144
|
}
|
|
145
|
-
var
|
|
145
|
+
var Ze = {};
|
|
146
146
|
/**
|
|
147
147
|
* @license React
|
|
148
148
|
* use-sync-external-store-shim.development.js
|
|
@@ -152,14 +152,14 @@ var Xe = {};
|
|
|
152
152
|
* This source code is licensed under the MIT license found in the
|
|
153
153
|
* LICENSE file in the root directory of this source tree.
|
|
154
154
|
*/
|
|
155
|
-
var
|
|
156
|
-
function
|
|
157
|
-
return
|
|
155
|
+
var Tt;
|
|
156
|
+
function Fn() {
|
|
157
|
+
return Tt || (Tt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
158
158
|
function t(l, p) {
|
|
159
159
|
return l === p && (l !== 0 || 1 / l === 1 / p) || l !== l && p !== p;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
|
|
161
|
+
function a(l, p) {
|
|
162
|
+
m || s.startTransition === void 0 || (m = !0, console.error(
|
|
163
163
|
"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."
|
|
164
164
|
));
|
|
165
165
|
var x = p();
|
|
@@ -175,19 +175,19 @@ function Bn() {
|
|
|
175
175
|
var S = w[0].inst, b = w[1];
|
|
176
176
|
return g(
|
|
177
177
|
function() {
|
|
178
|
-
S.value = x, S.getSnapshot = p,
|
|
178
|
+
S.value = x, S.getSnapshot = p, n(S) && b({ inst: S });
|
|
179
179
|
},
|
|
180
180
|
[l, x, p]
|
|
181
|
-
),
|
|
181
|
+
), h(
|
|
182
182
|
function() {
|
|
183
|
-
return
|
|
184
|
-
|
|
183
|
+
return n(S) && b({ inst: S }), l(function() {
|
|
184
|
+
n(S) && b({ inst: S });
|
|
185
185
|
});
|
|
186
186
|
},
|
|
187
187
|
[l]
|
|
188
188
|
), v(x), x;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function n(l) {
|
|
191
191
|
var p = l.getSnapshot;
|
|
192
192
|
l = l.value;
|
|
193
193
|
try {
|
|
@@ -201,113 +201,113 @@ function Bn() {
|
|
|
201
201
|
return p();
|
|
202
202
|
}
|
|
203
203
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
204
|
-
var
|
|
205
|
-
|
|
206
|
-
}()),
|
|
204
|
+
var s = Qt, d = typeof Object.is == "function" ? Object.is : t, f = s.useState, h = s.useEffect, g = s.useLayoutEffect, v = s.useDebugValue, m = !1, c = !1, u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : a;
|
|
205
|
+
Ze.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : u, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
206
|
+
}()), Ze;
|
|
207
207
|
}
|
|
208
|
-
process.env.NODE_ENV === "production" ?
|
|
209
|
-
var
|
|
210
|
-
const
|
|
211
|
-
function
|
|
212
|
-
const { theme: t, setTheme:
|
|
208
|
+
process.env.NODE_ENV === "production" ? nt.exports = Bn() : nt.exports = Fn();
|
|
209
|
+
var Gn = nt.exports;
|
|
210
|
+
const Te = ["light", "dark", "system"];
|
|
211
|
+
function Vn() {
|
|
212
|
+
const { theme: t, setTheme: a } = Br(), n = C(
|
|
213
213
|
(f) => f.actions.setDashboardTheme
|
|
214
214
|
);
|
|
215
215
|
function r() {
|
|
216
|
-
const f =
|
|
217
|
-
|
|
216
|
+
const f = Te.includes(t) ? t : "system", h = Te[(Te.indexOf(f) + 1) % Te.length];
|
|
217
|
+
a(h), n(h);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const s = t === "light" ? Un : t === "dark" ? Tn : Fr, d = t === "light" ? "Theme: light (click for dark)" : t === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
|
|
220
220
|
return /* @__PURE__ */ e(
|
|
221
|
-
|
|
221
|
+
G,
|
|
222
222
|
{
|
|
223
223
|
type: "button",
|
|
224
224
|
variant: "ghost",
|
|
225
225
|
size: "xs",
|
|
226
|
-
className: "h-7 w-7 p-0
|
|
226
|
+
className: "h-7 w-7 p-0",
|
|
227
227
|
onClick: r,
|
|
228
228
|
"aria-label": d,
|
|
229
229
|
title: d,
|
|
230
|
-
children: /* @__PURE__ */ e(
|
|
230
|
+
children: /* @__PURE__ */ e(s, { className: "h-3.5 w-3.5", strokeWidth: 1.5 })
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
const { displayPreferences: t, shouldShowElement:
|
|
236
|
-
() =>
|
|
237
|
-
[
|
|
238
|
-
), d =
|
|
234
|
+
function jn() {
|
|
235
|
+
const { displayPreferences: t, shouldShowElement: a } = Gr(), { currentUser: n, userContext: r } = st(), s = V(
|
|
236
|
+
() => Vr(n),
|
|
237
|
+
[n]
|
|
238
|
+
), d = V(() => (h) => s && s[h] !== void 0 && s[h] === !1 ? !1 : a(h), [s, a, t]), f = V(
|
|
239
239
|
() => {
|
|
240
|
-
var
|
|
240
|
+
var h, g, v, m, c;
|
|
241
241
|
return {
|
|
242
|
-
canEdit: ((
|
|
243
|
-
canUseFilters: ((g = r == null ? void 0 : r.permissions) == null ? void 0 : g.canEdit) ??
|
|
244
|
-
canManageDashboards: ((v = r == null ? void 0 : r.permissions) == null ? void 0 : v.canCreateDashboard) ??
|
|
245
|
-
canCreateDashboards: ((
|
|
246
|
-
canAccessVisuals: ((c = r == null ? void 0 : r.permissions) == null ? void 0 : c.canEdit) ??
|
|
242
|
+
canEdit: ((h = r == null ? void 0 : r.permissions) == null ? void 0 : h.canEdit) ?? Kr(n),
|
|
243
|
+
canUseFilters: ((g = r == null ? void 0 : r.permissions) == null ? void 0 : g.canEdit) ?? qr(n),
|
|
244
|
+
canManageDashboards: ((v = r == null ? void 0 : r.permissions) == null ? void 0 : v.canCreateDashboard) ?? Hr(n),
|
|
245
|
+
canCreateDashboards: ((m = r == null ? void 0 : r.permissions) == null ? void 0 : m.canCreateDashboard) ?? zr(n),
|
|
246
|
+
canAccessVisuals: ((c = r == null ? void 0 : r.permissions) == null ? void 0 : c.canEdit) ?? jr(n)
|
|
247
247
|
};
|
|
248
248
|
},
|
|
249
|
-
[
|
|
249
|
+
[n, r]
|
|
250
250
|
);
|
|
251
251
|
return {
|
|
252
252
|
displayPreferences: t,
|
|
253
253
|
shouldShowElement: d,
|
|
254
254
|
permissions: f,
|
|
255
|
-
currentUser:
|
|
255
|
+
currentUser: n
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
let
|
|
258
|
+
function zn(t, a = []) {
|
|
259
|
+
let n = [];
|
|
260
260
|
function r(d, f) {
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
const g =
|
|
264
|
-
|
|
261
|
+
const h = A.createContext(f);
|
|
262
|
+
h.displayName = d + "Context";
|
|
263
|
+
const g = n.length;
|
|
264
|
+
n = [...n, f];
|
|
265
265
|
const v = (c) => {
|
|
266
266
|
var S;
|
|
267
|
-
const { scope: u, children: l, ...p } = c, x = ((S = u == null ? void 0 : u[t]) == null ? void 0 : S[g]) ||
|
|
267
|
+
const { scope: u, children: l, ...p } = c, x = ((S = u == null ? void 0 : u[t]) == null ? void 0 : S[g]) || h, w = A.useMemo(() => p, Object.values(p));
|
|
268
268
|
return /* @__PURE__ */ e(x.Provider, { value: w, children: l });
|
|
269
269
|
};
|
|
270
270
|
v.displayName = d + "Provider";
|
|
271
|
-
function
|
|
271
|
+
function m(c, u) {
|
|
272
272
|
var x;
|
|
273
|
-
const l = ((x = u == null ? void 0 : u[t]) == null ? void 0 : x[g]) ||
|
|
273
|
+
const l = ((x = u == null ? void 0 : u[t]) == null ? void 0 : x[g]) || h, p = A.useContext(l);
|
|
274
274
|
if (p) return p;
|
|
275
275
|
if (f !== void 0) return f;
|
|
276
276
|
throw new Error(`\`${c}\` must be used within \`${d}\``);
|
|
277
277
|
}
|
|
278
|
-
return [v,
|
|
278
|
+
return [v, m];
|
|
279
279
|
}
|
|
280
|
-
const
|
|
281
|
-
const d =
|
|
282
|
-
return function(
|
|
283
|
-
const g = (
|
|
280
|
+
const s = () => {
|
|
281
|
+
const d = n.map((f) => A.createContext(f));
|
|
282
|
+
return function(h) {
|
|
283
|
+
const g = (h == null ? void 0 : h[t]) || d;
|
|
284
284
|
return A.useMemo(
|
|
285
|
-
() => ({ [`__scope${t}`]: { ...
|
|
286
|
-
[
|
|
285
|
+
() => ({ [`__scope${t}`]: { ...h, [t]: g } }),
|
|
286
|
+
[h, g]
|
|
287
287
|
);
|
|
288
288
|
};
|
|
289
289
|
};
|
|
290
|
-
return
|
|
290
|
+
return s.scopeName = t, [r, Hn(s, ...a)];
|
|
291
291
|
}
|
|
292
292
|
function Hn(...t) {
|
|
293
|
-
const
|
|
294
|
-
if (t.length === 1) return
|
|
295
|
-
const
|
|
296
|
-
const r = t.map((
|
|
297
|
-
useScope:
|
|
298
|
-
scopeName:
|
|
293
|
+
const a = t[0];
|
|
294
|
+
if (t.length === 1) return a;
|
|
295
|
+
const n = () => {
|
|
296
|
+
const r = t.map((s) => ({
|
|
297
|
+
useScope: s(),
|
|
298
|
+
scopeName: s.scopeName
|
|
299
299
|
}));
|
|
300
300
|
return function(d) {
|
|
301
|
-
const f = r.reduce((
|
|
301
|
+
const f = r.reduce((h, { useScope: g, scopeName: v }) => {
|
|
302
302
|
const c = g(d)[`__scope${v}`];
|
|
303
|
-
return { ...
|
|
303
|
+
return { ...h, ...c };
|
|
304
304
|
}, {});
|
|
305
|
-
return A.useMemo(() => ({ [`__scope${
|
|
305
|
+
return A.useMemo(() => ({ [`__scope${a.scopeName}`]: f }), [f]);
|
|
306
306
|
};
|
|
307
307
|
};
|
|
308
|
-
return
|
|
308
|
+
return n.scopeName = a.scopeName, n;
|
|
309
309
|
}
|
|
310
|
-
var
|
|
310
|
+
var qn = [
|
|
311
311
|
"a",
|
|
312
312
|
"button",
|
|
313
313
|
"div",
|
|
@@ -325,233 +325,233 @@ var zn = [
|
|
|
325
325
|
"span",
|
|
326
326
|
"svg",
|
|
327
327
|
"ul"
|
|
328
|
-
],
|
|
329
|
-
const
|
|
330
|
-
const { asChild: f, ...
|
|
331
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(g, { ...
|
|
328
|
+
], dt = qn.reduce((t, a) => {
|
|
329
|
+
const n = Ua(`Primitive.${a}`), r = A.forwardRef((s, d) => {
|
|
330
|
+
const { asChild: f, ...h } = s, g = f ? n : a;
|
|
331
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ e(g, { ...h, ref: d });
|
|
332
332
|
});
|
|
333
|
-
return r.displayName = `Primitive.${
|
|
333
|
+
return r.displayName = `Primitive.${a}`, { ...t, [a]: r };
|
|
334
334
|
}, {});
|
|
335
|
-
function
|
|
336
|
-
return
|
|
337
|
-
|
|
335
|
+
function Kn() {
|
|
336
|
+
return Gn.useSyncExternalStore(
|
|
337
|
+
Qn,
|
|
338
338
|
() => !0,
|
|
339
339
|
() => !1
|
|
340
340
|
);
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function Qn() {
|
|
343
343
|
return () => {
|
|
344
344
|
};
|
|
345
345
|
}
|
|
346
|
-
var
|
|
347
|
-
(t,
|
|
348
|
-
const { __scopeAvatar:
|
|
346
|
+
var ct = "Avatar", [Wn] = zn(ct), [Yn, Zt] = Wn(ct), er = A.forwardRef(
|
|
347
|
+
(t, a) => {
|
|
348
|
+
const { __scopeAvatar: n, ...r } = t, [s, d] = A.useState("idle");
|
|
349
349
|
return /* @__PURE__ */ e(
|
|
350
|
-
|
|
350
|
+
Yn,
|
|
351
351
|
{
|
|
352
|
-
scope:
|
|
353
|
-
imageLoadingStatus:
|
|
352
|
+
scope: n,
|
|
353
|
+
imageLoadingStatus: s,
|
|
354
354
|
onImageLoadingStatusChange: d,
|
|
355
|
-
children: /* @__PURE__ */ e(
|
|
355
|
+
children: /* @__PURE__ */ e(dt.span, { ...r, ref: a })
|
|
356
356
|
}
|
|
357
357
|
);
|
|
358
358
|
}
|
|
359
359
|
);
|
|
360
|
-
|
|
361
|
-
var
|
|
362
|
-
(t,
|
|
363
|
-
const { __scopeAvatar:
|
|
364
|
-
}, ...d } = t, f = tr
|
|
365
|
-
|
|
360
|
+
er.displayName = ct;
|
|
361
|
+
var tr = "AvatarImage", rr = A.forwardRef(
|
|
362
|
+
(t, a) => {
|
|
363
|
+
const { __scopeAvatar: n, src: r, onLoadingStatusChange: s = () => {
|
|
364
|
+
}, ...d } = t, f = Zt(tr, n), h = Jn(r, d), g = $a((v) => {
|
|
365
|
+
s(v), f.onImageLoadingStatusChange(v);
|
|
366
366
|
});
|
|
367
|
-
return
|
|
368
|
-
|
|
369
|
-
}, [
|
|
367
|
+
return rt(() => {
|
|
368
|
+
h !== "idle" && g(h);
|
|
369
|
+
}, [h, g]), h === "loaded" ? /* @__PURE__ */ e(dt.img, { ...d, ref: a, src: r }) : null;
|
|
370
370
|
}
|
|
371
371
|
);
|
|
372
|
-
|
|
373
|
-
var
|
|
374
|
-
(t,
|
|
375
|
-
const { __scopeAvatar:
|
|
372
|
+
rr.displayName = tr;
|
|
373
|
+
var ar = "AvatarFallback", nr = A.forwardRef(
|
|
374
|
+
(t, a) => {
|
|
375
|
+
const { __scopeAvatar: n, delayMs: r, ...s } = t, d = Zt(ar, n), [f, h] = A.useState(r === void 0);
|
|
376
376
|
return A.useEffect(() => {
|
|
377
377
|
if (r !== void 0) {
|
|
378
|
-
const g = window.setTimeout(() =>
|
|
378
|
+
const g = window.setTimeout(() => h(!0), r);
|
|
379
379
|
return () => window.clearTimeout(g);
|
|
380
380
|
}
|
|
381
|
-
}, [r]), f && d.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(
|
|
381
|
+
}, [r]), f && d.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ e(dt.span, { ...s, ref: a }) : null;
|
|
382
382
|
}
|
|
383
383
|
);
|
|
384
|
-
|
|
385
|
-
function
|
|
386
|
-
return t ?
|
|
384
|
+
nr.displayName = ar;
|
|
385
|
+
function Rt(t, a) {
|
|
386
|
+
return t ? a ? (t.src !== a && (t.src = a), t.complete && t.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
const r =
|
|
390
|
-
() =>
|
|
388
|
+
function Jn(t, { referrerPolicy: a, crossOrigin: n }) {
|
|
389
|
+
const r = Kn(), s = A.useRef(null), d = r ? (s.current || (s.current = new window.Image()), s.current) : null, [f, h] = A.useState(
|
|
390
|
+
() => Rt(d, t)
|
|
391
391
|
);
|
|
392
|
-
return
|
|
393
|
-
|
|
394
|
-
}, [d, t]),
|
|
392
|
+
return rt(() => {
|
|
393
|
+
h(Rt(d, t));
|
|
394
|
+
}, [d, t]), rt(() => {
|
|
395
395
|
const g = (c) => () => {
|
|
396
|
-
|
|
396
|
+
h(c);
|
|
397
397
|
};
|
|
398
398
|
if (!d) return;
|
|
399
|
-
const v = g("loaded"),
|
|
400
|
-
return d.addEventListener("load", v), d.addEventListener("error",
|
|
401
|
-
d.removeEventListener("load", v), d.removeEventListener("error",
|
|
399
|
+
const v = g("loaded"), m = g("error");
|
|
400
|
+
return d.addEventListener("load", v), d.addEventListener("error", m), a && (d.referrerPolicy = a), typeof n == "string" && (d.crossOrigin = n), () => {
|
|
401
|
+
d.removeEventListener("load", v), d.removeEventListener("error", m);
|
|
402
402
|
};
|
|
403
|
-
}, [d,
|
|
403
|
+
}, [d, n, a]), f;
|
|
404
404
|
}
|
|
405
|
-
var
|
|
406
|
-
const
|
|
407
|
-
|
|
405
|
+
var sr = er, or = rr, ir = nr;
|
|
406
|
+
const dr = A.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
407
|
+
sr,
|
|
408
408
|
{
|
|
409
|
-
ref:
|
|
410
|
-
className:
|
|
409
|
+
ref: n,
|
|
410
|
+
className: xe(
|
|
411
411
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
412
412
|
t
|
|
413
413
|
),
|
|
414
|
-
...
|
|
414
|
+
...a
|
|
415
415
|
}
|
|
416
416
|
));
|
|
417
|
-
|
|
418
|
-
const
|
|
419
|
-
|
|
417
|
+
dr.displayName = sr.displayName;
|
|
418
|
+
const Xn = A.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
419
|
+
or,
|
|
420
420
|
{
|
|
421
|
-
ref:
|
|
422
|
-
className:
|
|
423
|
-
...
|
|
421
|
+
ref: n,
|
|
422
|
+
className: xe("aspect-square h-full w-full", t),
|
|
423
|
+
...a
|
|
424
424
|
}
|
|
425
425
|
));
|
|
426
|
-
|
|
427
|
-
const
|
|
428
|
-
|
|
426
|
+
Xn.displayName = or.displayName;
|
|
427
|
+
const cr = A.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
428
|
+
ir,
|
|
429
429
|
{
|
|
430
|
-
ref:
|
|
431
|
-
className:
|
|
430
|
+
ref: n,
|
|
431
|
+
className: xe(
|
|
432
432
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
433
433
|
t
|
|
434
434
|
),
|
|
435
|
-
...
|
|
435
|
+
...a
|
|
436
436
|
}
|
|
437
437
|
));
|
|
438
|
-
|
|
439
|
-
const
|
|
438
|
+
cr.displayName = ir.displayName;
|
|
439
|
+
const Zn = async (t, a, n) => {
|
|
440
440
|
const r = `${t}/management/v1/groups`;
|
|
441
|
-
return await
|
|
442
|
-
},
|
|
443
|
-
const
|
|
444
|
-
return
|
|
445
|
-
},
|
|
446
|
-
const r = `${t}/management/v1/groups/${
|
|
447
|
-
await
|
|
448
|
-
},
|
|
449
|
-
const
|
|
450
|
-
return await
|
|
451
|
-
},
|
|
452
|
-
const
|
|
453
|
-
await
|
|
441
|
+
return await Yt(r, a, n);
|
|
442
|
+
}, es = async (t, a, n, r) => {
|
|
443
|
+
const s = `${t}/management/v1/groups/${n}`;
|
|
444
|
+
return it(s, a, "PATCH", r);
|
|
445
|
+
}, ts = async (t, a, n) => {
|
|
446
|
+
const r = `${t}/management/v1/groups/${n}`;
|
|
447
|
+
await it(r, a, "DELETE");
|
|
448
|
+
}, rs = async (t, a, n, r) => {
|
|
449
|
+
const s = `${t}/management/v1/groups/${n}/members`;
|
|
450
|
+
return await Yt(s, a, r);
|
|
451
|
+
}, as = async (t, a, n, r) => {
|
|
452
|
+
const s = `${t}/management/v1/groups/${n}/members`;
|
|
453
|
+
await it(s, a, "DELETE", r);
|
|
454
454
|
};
|
|
455
|
-
function
|
|
456
|
-
const { authToken: t, tokenProps:
|
|
457
|
-
return
|
|
458
|
-
mutationFn: (r) =>
|
|
455
|
+
function ns() {
|
|
456
|
+
const { authToken: t, tokenProps: a } = J(), n = ve();
|
|
457
|
+
return ye({
|
|
458
|
+
mutationFn: (r) => Zn(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
|
|
459
459
|
onSuccess: () => {
|
|
460
|
-
|
|
460
|
+
n.invalidateQueries({ queryKey: ["groups"] }), D.success("Group created successfully");
|
|
461
461
|
},
|
|
462
462
|
onError: (r) => {
|
|
463
463
|
console.error("Failed to create group:", r), D.error("Failed to create group", {
|
|
464
|
-
description:
|
|
464
|
+
description: Ne(r, "Failed to create group")
|
|
465
465
|
});
|
|
466
466
|
}
|
|
467
467
|
});
|
|
468
468
|
}
|
|
469
|
-
function
|
|
470
|
-
const { authToken: t, tokenProps:
|
|
471
|
-
return
|
|
469
|
+
function ss() {
|
|
470
|
+
const { authToken: t, tokenProps: a } = J(), n = ve();
|
|
471
|
+
return ye({
|
|
472
472
|
mutationFn: ({
|
|
473
473
|
groupId: r,
|
|
474
|
-
data:
|
|
475
|
-
}) =>
|
|
476
|
-
onSuccess: (r,
|
|
477
|
-
|
|
474
|
+
data: s
|
|
475
|
+
}) => es(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, s),
|
|
476
|
+
onSuccess: (r, s) => {
|
|
477
|
+
n.invalidateQueries({ queryKey: ["group", s.groupId] }), n.invalidateQueries({ queryKey: ["groups"] }), D.success("Group updated successfully");
|
|
478
478
|
},
|
|
479
479
|
onError: (r) => {
|
|
480
480
|
console.error("Failed to update group:", r), D.error("Failed to update group", {
|
|
481
|
-
description:
|
|
481
|
+
description: Ne(r, "Failed to update group")
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
|
-
function
|
|
487
|
-
const { authToken: t, tokenProps:
|
|
488
|
-
return
|
|
489
|
-
mutationFn: (r) =>
|
|
490
|
-
onSuccess: (r,
|
|
491
|
-
|
|
486
|
+
function os() {
|
|
487
|
+
const { authToken: t, tokenProps: a } = J(), n = ve();
|
|
488
|
+
return ye({
|
|
489
|
+
mutationFn: (r) => ts(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r),
|
|
490
|
+
onSuccess: (r, s) => {
|
|
491
|
+
n.invalidateQueries({ queryKey: ["groups"] }), n.removeQueries({ queryKey: ["group", s] }), D.success("Group deleted successfully");
|
|
492
492
|
},
|
|
493
493
|
onError: (r) => {
|
|
494
494
|
console.error("Failed to delete group:", r), D.error("Failed to delete group", {
|
|
495
|
-
description:
|
|
495
|
+
description: Ne(r, "Failed to delete group")
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
498
|
});
|
|
499
499
|
}
|
|
500
|
-
function
|
|
501
|
-
const { authToken: t, tokenProps:
|
|
502
|
-
return
|
|
500
|
+
function is() {
|
|
501
|
+
const { authToken: t, tokenProps: a } = J(), n = ve();
|
|
502
|
+
return ye({
|
|
503
503
|
mutationFn: ({
|
|
504
504
|
groupId: r,
|
|
505
|
-
data:
|
|
506
|
-
}) =>
|
|
507
|
-
onSuccess: (r,
|
|
508
|
-
|
|
509
|
-
queryKey: ["group-members",
|
|
510
|
-
}),
|
|
505
|
+
data: s
|
|
506
|
+
}) => rs(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, s),
|
|
507
|
+
onSuccess: (r, s) => {
|
|
508
|
+
n.invalidateQueries({ queryKey: ["group", s.groupId] }), n.invalidateQueries({
|
|
509
|
+
queryKey: ["group-members", s.groupId]
|
|
510
|
+
}), n.invalidateQueries({ queryKey: ["groups"] }), D.success("Members added successfully");
|
|
511
511
|
},
|
|
512
512
|
onError: (r) => {
|
|
513
513
|
console.error("Failed to add group members:", r), D.error("Failed to add members", {
|
|
514
|
-
description:
|
|
514
|
+
description: Ne(r, "Failed to add members")
|
|
515
515
|
});
|
|
516
516
|
}
|
|
517
517
|
});
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
const { authToken: t, tokenProps:
|
|
521
|
-
return
|
|
519
|
+
function ds() {
|
|
520
|
+
const { authToken: t, tokenProps: a } = J(), n = ve();
|
|
521
|
+
return ye({
|
|
522
522
|
mutationFn: ({
|
|
523
523
|
groupId: r,
|
|
524
|
-
data:
|
|
525
|
-
}) =>
|
|
526
|
-
onSuccess: (r,
|
|
527
|
-
|
|
528
|
-
queryKey: ["group-members",
|
|
529
|
-
}),
|
|
524
|
+
data: s
|
|
525
|
+
}) => as(a.apiServiceUrl, (t == null ? void 0 : t.accessToken) || "", r, s),
|
|
526
|
+
onSuccess: (r, s) => {
|
|
527
|
+
n.invalidateQueries({ queryKey: ["group", s.groupId] }), n.invalidateQueries({
|
|
528
|
+
queryKey: ["group-members", s.groupId]
|
|
529
|
+
}), n.invalidateQueries({ queryKey: ["groups"] }), D.success("Members removed successfully");
|
|
530
530
|
},
|
|
531
531
|
onError: (r) => {
|
|
532
532
|
console.error("Failed to remove group members:", r), D.error("Failed to remove members", {
|
|
533
|
-
description:
|
|
533
|
+
description: Ne(r, "Failed to remove members")
|
|
534
534
|
});
|
|
535
535
|
}
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
|
-
const
|
|
539
|
-
function
|
|
538
|
+
const cs = [];
|
|
539
|
+
function ls({
|
|
540
540
|
open: t,
|
|
541
|
-
onOpenChange:
|
|
541
|
+
onOpenChange: a
|
|
542
542
|
}) {
|
|
543
|
-
var b, L,
|
|
544
|
-
const { tokenProps:
|
|
543
|
+
var b, L, M;
|
|
544
|
+
const { tokenProps: n } = J(), { currentUser: r } = st(), s = (r == null ? void 0 : r.type) === "tenant", d = n == null ? void 0 : n.tenantId, {
|
|
545
545
|
groups: f,
|
|
546
|
-
isLoading:
|
|
546
|
+
isLoading: h,
|
|
547
547
|
error: g,
|
|
548
548
|
refetch: v
|
|
549
|
-
} =
|
|
550
|
-
type:
|
|
551
|
-
tenantId:
|
|
549
|
+
} = Qr({
|
|
550
|
+
type: s ? "TENANT_GROUP" : "all",
|
|
551
|
+
tenantId: s ? d : void 0,
|
|
552
552
|
includeMembers: !1
|
|
553
|
-
}),
|
|
554
|
-
|
|
553
|
+
}), m = g ? lr(g, "Unable to load groups.") : null, [c, u] = N({ kind: "list" }), [l, p] = N(null), x = os();
|
|
554
|
+
ge(() => {
|
|
555
555
|
t || (u({ kind: "list" }), p(null));
|
|
556
556
|
}, [t]);
|
|
557
557
|
const w = c.kind === "members" && f.find((k) => k.id === c.groupId) || null, S = async () => {
|
|
@@ -561,11 +561,11 @@ function lo({
|
|
|
561
561
|
} catch {
|
|
562
562
|
}
|
|
563
563
|
};
|
|
564
|
-
return /* @__PURE__ */ e(
|
|
565
|
-
c.kind === "list" ? /* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */ e(
|
|
567
|
-
/* @__PURE__ */ e(
|
|
568
|
-
] }) : c.kind === "create" ? /* @__PURE__ */
|
|
564
|
+
return /* @__PURE__ */ e(Ft, { open: t, onOpenChange: a, children: /* @__PURE__ */ o(Gt, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
|
|
565
|
+
c.kind === "list" ? /* @__PURE__ */ o("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
|
|
566
|
+
/* @__PURE__ */ e(et, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
|
|
567
|
+
/* @__PURE__ */ e(tt, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
|
|
568
|
+
] }) : c.kind === "create" ? /* @__PURE__ */ o("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
|
|
569
569
|
/* @__PURE__ */ e(
|
|
570
570
|
"button",
|
|
571
571
|
{
|
|
@@ -573,18 +573,18 @@ function lo({
|
|
|
573
573
|
onClick: () => u({ kind: "list" }),
|
|
574
574
|
"aria-label": "Back",
|
|
575
575
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
576
|
-
children: /* @__PURE__ */ e(
|
|
576
|
+
children: /* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5" })
|
|
577
577
|
}
|
|
578
578
|
),
|
|
579
|
-
/* @__PURE__ */ e(
|
|
580
|
-
/* @__PURE__ */ e(
|
|
579
|
+
/* @__PURE__ */ e(et, { className: "truncate text-[13px] font-medium", children: "New group" }),
|
|
580
|
+
/* @__PURE__ */ e(tt, { className: "sr-only", children: "Create a new group to organize members." })
|
|
581
581
|
] }) : null,
|
|
582
582
|
c.kind === "list" && /* @__PURE__ */ e(
|
|
583
|
-
|
|
583
|
+
us,
|
|
584
584
|
{
|
|
585
585
|
groups: f,
|
|
586
|
-
isLoading:
|
|
587
|
-
errorMessage:
|
|
586
|
+
isLoading: h,
|
|
587
|
+
errorMessage: m,
|
|
588
588
|
onRetry: () => v(),
|
|
589
589
|
currentUserId: r == null ? void 0 : r.id,
|
|
590
590
|
onOpenGroup: (k) => u({ kind: "members", groupId: k }),
|
|
@@ -593,13 +593,13 @@ function lo({
|
|
|
593
593
|
}
|
|
594
594
|
),
|
|
595
595
|
c.kind === "members" && w && /* @__PURE__ */ e(
|
|
596
|
-
|
|
596
|
+
ps,
|
|
597
597
|
{
|
|
598
598
|
group: w,
|
|
599
|
-
isTenantViewer:
|
|
599
|
+
isTenantViewer: s,
|
|
600
600
|
canEdit: ((b = w.permissions) == null ? void 0 : b.canEdit) ?? w.createdBy === (r == null ? void 0 : r.id),
|
|
601
601
|
canDelete: ((L = w.permissions) == null ? void 0 : L.canDelete) ?? w.createdBy === (r == null ? void 0 : r.id),
|
|
602
|
-
canManageMembers: ((
|
|
602
|
+
canManageMembers: ((M = w.permissions) == null ? void 0 : M.canManageMembers) ?? w.createdBy === (r == null ? void 0 : r.id),
|
|
603
603
|
onBack: () => u({ kind: "list" }),
|
|
604
604
|
onMembersChanged: v,
|
|
605
605
|
onUpdated: v,
|
|
@@ -608,9 +608,9 @@ function lo({
|
|
|
608
608
|
w.id
|
|
609
609
|
),
|
|
610
610
|
c.kind === "create" && /* @__PURE__ */ e(
|
|
611
|
-
|
|
611
|
+
fs,
|
|
612
612
|
{
|
|
613
|
-
isTenantUser:
|
|
613
|
+
isTenantUser: s,
|
|
614
614
|
tenantId: d,
|
|
615
615
|
onCancel: () => u({ kind: "list" }),
|
|
616
616
|
onCreated: (k) => {
|
|
@@ -618,14 +618,14 @@ function lo({
|
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
620
|
),
|
|
621
|
-
l && /* @__PURE__ */
|
|
622
|
-
/* @__PURE__ */
|
|
621
|
+
l && /* @__PURE__ */ o("div", { className: "flex shrink-0 items-center justify-between gap-3 border-t border-border bg-muted/40 px-5 py-2.5", children: [
|
|
622
|
+
/* @__PURE__ */ o("div", { className: "min-w-0 text-[12px] text-foreground", children: [
|
|
623
623
|
"Delete ",
|
|
624
624
|
/* @__PURE__ */ e("span", { className: "font-medium", children: l.name }),
|
|
625
625
|
"?",
|
|
626
626
|
/* @__PURE__ */ e("span", { className: "ml-2 text-muted-foreground", children: "Members lose any access granted via this group." })
|
|
627
627
|
] }),
|
|
628
|
-
/* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ o("div", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
629
629
|
/* @__PURE__ */ e(
|
|
630
630
|
"button",
|
|
631
631
|
{
|
|
@@ -636,7 +636,7 @@ function lo({
|
|
|
636
636
|
children: "Cancel"
|
|
637
637
|
}
|
|
638
638
|
),
|
|
639
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ o(
|
|
640
640
|
"button",
|
|
641
641
|
{
|
|
642
642
|
type: "button",
|
|
@@ -644,7 +644,7 @@ function lo({
|
|
|
644
644
|
disabled: x.isPending,
|
|
645
645
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-rose-600 px-2.5 text-[12px] font-medium text-white hover:bg-rose-700 disabled:opacity-60",
|
|
646
646
|
children: [
|
|
647
|
-
x.isPending ? /* @__PURE__ */ e(
|
|
647
|
+
x.isPending ? /* @__PURE__ */ e(Re, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(ot, { className: "h-3 w-3" }),
|
|
648
648
|
"Delete group"
|
|
649
649
|
]
|
|
650
650
|
}
|
|
@@ -653,26 +653,26 @@ function lo({
|
|
|
653
653
|
] })
|
|
654
654
|
] }) });
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function us({
|
|
657
657
|
groups: t,
|
|
658
|
-
isLoading:
|
|
659
|
-
errorMessage:
|
|
658
|
+
isLoading: a,
|
|
659
|
+
errorMessage: n,
|
|
660
660
|
onRetry: r,
|
|
661
|
-
currentUserId:
|
|
661
|
+
currentUserId: s,
|
|
662
662
|
onOpenGroup: d,
|
|
663
663
|
onCreate: f,
|
|
664
|
-
onDeleteRequest:
|
|
664
|
+
onDeleteRequest: h
|
|
665
665
|
}) {
|
|
666
|
-
const [g, v] = N(""),
|
|
666
|
+
const [g, v] = N(""), m = V(
|
|
667
667
|
() => t.filter(
|
|
668
668
|
(c) => !g.trim() || c.name.toLowerCase().includes(g.toLowerCase()) || (c.description || "").toLowerCase().includes(g.toLowerCase())
|
|
669
669
|
),
|
|
670
670
|
[t, g]
|
|
671
671
|
);
|
|
672
|
-
return /* @__PURE__ */
|
|
673
|
-
/* @__PURE__ */
|
|
674
|
-
/* @__PURE__ */
|
|
675
|
-
/* @__PURE__ */ e(
|
|
672
|
+
return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
673
|
+
/* @__PURE__ */ o("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-5 py-2.5", children: [
|
|
674
|
+
/* @__PURE__ */ o("div", { className: "flex flex-1 items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40", children: [
|
|
675
|
+
/* @__PURE__ */ e(Sn, { className: "h-3 w-3 text-muted-foreground" }),
|
|
676
676
|
/* @__PURE__ */ e(
|
|
677
677
|
"input",
|
|
678
678
|
{
|
|
@@ -688,11 +688,11 @@ function uo({
|
|
|
688
688
|
type: "button",
|
|
689
689
|
onClick: () => v(""),
|
|
690
690
|
className: "flex h-4 w-4 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
691
|
-
children: /* @__PURE__ */ e(
|
|
691
|
+
children: /* @__PURE__ */ e(Kt, { className: "h-2.5 w-2.5" })
|
|
692
692
|
}
|
|
693
693
|
)
|
|
694
694
|
] }),
|
|
695
|
-
/* @__PURE__ */
|
|
695
|
+
/* @__PURE__ */ o(
|
|
696
696
|
"button",
|
|
697
697
|
{
|
|
698
698
|
type: "button",
|
|
@@ -705,85 +705,85 @@ function uo({
|
|
|
705
705
|
}
|
|
706
706
|
)
|
|
707
707
|
] }),
|
|
708
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children:
|
|
708
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: a ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((c) => /* @__PURE__ */ e(
|
|
709
709
|
"div",
|
|
710
710
|
{
|
|
711
711
|
className: "h-12 animate-pulse rounded-[4px] bg-muted/60"
|
|
712
712
|
},
|
|
713
713
|
c
|
|
714
|
-
)) }) :
|
|
715
|
-
|
|
714
|
+
)) }) : n ? /* @__PURE__ */ e(
|
|
715
|
+
ur,
|
|
716
716
|
{
|
|
717
717
|
title: "Can't load groups",
|
|
718
|
-
message:
|
|
718
|
+
message: n,
|
|
719
719
|
onRetry: r
|
|
720
720
|
}
|
|
721
|
-
) :
|
|
722
|
-
/* @__PURE__ */
|
|
721
|
+
) : m.length === 0 && t.length === 0 ? /* @__PURE__ */ e(hs, { onCreate: f }) : m.length === 0 ? /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
|
|
722
|
+
/* @__PURE__ */ o("div", { className: "text-[12px] text-foreground", children: [
|
|
723
723
|
'No groups match "',
|
|
724
724
|
g,
|
|
725
725
|
'"'
|
|
726
726
|
] }),
|
|
727
727
|
/* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: "Try a different search." })
|
|
728
|
-
] }) :
|
|
728
|
+
] }) : m.map((c) => {
|
|
729
729
|
var u;
|
|
730
730
|
return /* @__PURE__ */ e(
|
|
731
|
-
|
|
731
|
+
ms,
|
|
732
732
|
{
|
|
733
733
|
group: c,
|
|
734
|
-
canDelete: ((u = c.permissions) == null ? void 0 : u.canDelete) ?? c.createdBy ===
|
|
734
|
+
canDelete: ((u = c.permissions) == null ? void 0 : u.canDelete) ?? c.createdBy === s,
|
|
735
735
|
onClick: () => d(c.id),
|
|
736
|
-
onDelete: () =>
|
|
736
|
+
onDelete: () => h(c)
|
|
737
737
|
},
|
|
738
738
|
c.id
|
|
739
739
|
);
|
|
740
740
|
}) })
|
|
741
741
|
] });
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function ms({
|
|
744
744
|
group: t,
|
|
745
|
-
canDelete:
|
|
746
|
-
onClick:
|
|
745
|
+
canDelete: a,
|
|
746
|
+
onClick: n,
|
|
747
747
|
onDelete: r
|
|
748
748
|
}) {
|
|
749
|
-
let
|
|
749
|
+
let s = "";
|
|
750
750
|
try {
|
|
751
|
-
|
|
751
|
+
s = Jt(new Date(t.createdAt), "MMM d, yyyy");
|
|
752
752
|
} catch {
|
|
753
|
-
|
|
753
|
+
s = "";
|
|
754
754
|
}
|
|
755
|
-
return /* @__PURE__ */
|
|
755
|
+
return /* @__PURE__ */ o(
|
|
756
756
|
"button",
|
|
757
757
|
{
|
|
758
758
|
type: "button",
|
|
759
|
-
onClick:
|
|
759
|
+
onClick: n,
|
|
760
760
|
className: "group flex w-full items-center gap-3 border-b border-border/60 px-5 py-2.5 text-left hover:bg-accent/40",
|
|
761
761
|
children: [
|
|
762
|
-
/* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(
|
|
763
|
-
/* @__PURE__ */
|
|
762
|
+
/* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[4px] border border-border bg-background text-muted-foreground", children: /* @__PURE__ */ e(Jr, { className: "h-3.5 w-3.5" }) }),
|
|
763
|
+
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
|
|
764
764
|
/* @__PURE__ */ e("div", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */ e(
|
|
765
|
+
/* @__PURE__ */ o("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
|
|
766
|
+
/* @__PURE__ */ o("span", { className: "inline-flex items-center gap-1", children: [
|
|
767
|
+
/* @__PURE__ */ e(Xt, { className: "h-2.5 w-2.5" }),
|
|
768
768
|
t.memberCount,
|
|
769
769
|
" member",
|
|
770
770
|
t.memberCount === 1 ? "" : "s"
|
|
771
771
|
] }),
|
|
772
|
-
|
|
772
|
+
s && /* @__PURE__ */ o($, { children: [
|
|
773
773
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
774
|
-
/* @__PURE__ */
|
|
775
|
-
/* @__PURE__ */ e(
|
|
776
|
-
|
|
774
|
+
/* @__PURE__ */ o("span", { className: "inline-flex items-center gap-1", children: [
|
|
775
|
+
/* @__PURE__ */ e(zt, { className: "h-2.5 w-2.5" }),
|
|
776
|
+
s
|
|
777
777
|
] })
|
|
778
778
|
] }),
|
|
779
|
-
t.description && /* @__PURE__ */
|
|
779
|
+
t.description && /* @__PURE__ */ o($, { children: [
|
|
780
780
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
781
781
|
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: t.description })
|
|
782
782
|
] })
|
|
783
783
|
] })
|
|
784
784
|
] }),
|
|
785
|
-
/* @__PURE__ */
|
|
786
|
-
|
|
785
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100", children: [
|
|
786
|
+
a && /* @__PURE__ */ e(
|
|
787
787
|
"span",
|
|
788
788
|
{
|
|
789
789
|
role: "button",
|
|
@@ -799,18 +799,18 @@ function mo({
|
|
|
799
799
|
children: /* @__PURE__ */ e(ot, { className: "h-3 w-3" })
|
|
800
800
|
}
|
|
801
801
|
),
|
|
802
|
-
/* @__PURE__ */ e(
|
|
802
|
+
/* @__PURE__ */ e(kn, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
803
803
|
] })
|
|
804
804
|
]
|
|
805
805
|
}
|
|
806
806
|
);
|
|
807
807
|
}
|
|
808
|
-
function
|
|
809
|
-
return /* @__PURE__ */
|
|
810
|
-
/* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(
|
|
808
|
+
function hs({ onCreate: t }) {
|
|
809
|
+
return /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
|
|
810
|
+
/* @__PURE__ */ e("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ e(jt, { className: "h-4 w-4" }) }),
|
|
811
811
|
/* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: "No groups yet" }),
|
|
812
812
|
/* @__PURE__ */ e("div", { className: "max-w-[320px] text-[11.5px] leading-[1.55] text-muted-foreground", children: "Groups let you grant shared access to dashboards. Create one and add members." }),
|
|
813
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ o(
|
|
814
814
|
"button",
|
|
815
815
|
{
|
|
816
816
|
type: "button",
|
|
@@ -824,58 +824,58 @@ function ho({ onCreate: t }) {
|
|
|
824
824
|
)
|
|
825
825
|
] });
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function ps({
|
|
828
828
|
group: t,
|
|
829
|
-
isTenantViewer:
|
|
830
|
-
canEdit:
|
|
829
|
+
isTenantViewer: a,
|
|
830
|
+
canEdit: n,
|
|
831
831
|
canDelete: r,
|
|
832
|
-
canManageMembers:
|
|
832
|
+
canManageMembers: s,
|
|
833
833
|
onBack: d,
|
|
834
834
|
onMembersChanged: f,
|
|
835
|
-
onUpdated:
|
|
835
|
+
onUpdated: h,
|
|
836
836
|
onRequestDelete: g
|
|
837
837
|
}) {
|
|
838
838
|
const {
|
|
839
839
|
data: v,
|
|
840
|
-
isLoading:
|
|
840
|
+
isLoading: m,
|
|
841
841
|
error: c,
|
|
842
842
|
refetch: u
|
|
843
|
-
} =
|
|
843
|
+
} = Wr(t.id), l = (v == null ? void 0 : v.members) ?? cs, p = c ? lr(c, "Unable to load members for this group.") : null, x = t.type === "TENANT_GROUP" ? "tenant" : "organization", { users: w } = Yr({
|
|
844
844
|
type: x,
|
|
845
845
|
tenantId: t.tenantId || void 0,
|
|
846
846
|
active: !0,
|
|
847
847
|
limit: 200
|
|
848
|
-
}), S =
|
|
848
|
+
}), S = V(
|
|
849
849
|
() => new Set(l.map((y) => y.userId)),
|
|
850
850
|
[l]
|
|
851
|
-
), b =
|
|
851
|
+
), b = is(), L = ds(), M = ss(), [k, E] = N(!1), [I, X] = N(t.name), [$e, j] = N(!1), [ae, z] = N(t.description || ""), [ne, se] = N(""), [Be, oe] = N(!1), Se = V(() => {
|
|
852
852
|
const y = ne.trim().toLowerCase();
|
|
853
853
|
return w.filter((B) => !S.has(B.id)).filter(
|
|
854
854
|
(B) => !y || (B.name || "").toLowerCase().includes(y) || (B.email || "").toLowerCase().includes(y)
|
|
855
855
|
).slice(0, 50);
|
|
856
|
-
}, [w, S, ne]),
|
|
856
|
+
}, [w, S, ne]), Z = async () => {
|
|
857
857
|
const y = I.trim();
|
|
858
858
|
if (E(!1), y.length >= 3 && y !== t.name)
|
|
859
859
|
try {
|
|
860
|
-
await
|
|
860
|
+
await M.mutateAsync({
|
|
861
861
|
groupId: t.id,
|
|
862
862
|
data: { name: y }
|
|
863
|
-
}),
|
|
863
|
+
}), h();
|
|
864
864
|
} catch {
|
|
865
865
|
}
|
|
866
866
|
}, ie = async () => {
|
|
867
867
|
const y = ae.trim();
|
|
868
|
-
if (
|
|
868
|
+
if (j(!1), y !== (t.description || ""))
|
|
869
869
|
try {
|
|
870
|
-
await
|
|
870
|
+
await M.mutateAsync({
|
|
871
871
|
groupId: t.id,
|
|
872
872
|
data: { description: y }
|
|
873
|
-
}),
|
|
873
|
+
}), h();
|
|
874
874
|
} catch {
|
|
875
875
|
}
|
|
876
|
-
},
|
|
877
|
-
if (
|
|
878
|
-
|
|
876
|
+
}, ke = async (y) => {
|
|
877
|
+
if (s) {
|
|
878
|
+
se(""), oe(!1);
|
|
879
879
|
try {
|
|
880
880
|
await b.mutateAsync({
|
|
881
881
|
groupId: t.id,
|
|
@@ -887,8 +887,8 @@ function po({
|
|
|
887
887
|
} catch {
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
|
-
},
|
|
891
|
-
if (
|
|
890
|
+
}, Ce = async (y) => {
|
|
891
|
+
if (s)
|
|
892
892
|
try {
|
|
893
893
|
await L.mutateAsync({
|
|
894
894
|
groupId: t.id,
|
|
@@ -897,14 +897,14 @@ function po({
|
|
|
897
897
|
} catch {
|
|
898
898
|
}
|
|
899
899
|
};
|
|
900
|
-
let
|
|
900
|
+
let ee = "";
|
|
901
901
|
try {
|
|
902
|
-
|
|
902
|
+
ee = Jt(new Date(t.createdAt), "MMM d, yyyy");
|
|
903
903
|
} catch {
|
|
904
|
-
|
|
904
|
+
ee = "";
|
|
905
905
|
}
|
|
906
|
-
return /* @__PURE__ */
|
|
907
|
-
/* @__PURE__ */
|
|
906
|
+
return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
907
|
+
/* @__PURE__ */ o("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
|
|
908
908
|
/* @__PURE__ */ e(
|
|
909
909
|
"button",
|
|
910
910
|
{
|
|
@@ -912,7 +912,7 @@ function po({
|
|
|
912
912
|
onClick: d,
|
|
913
913
|
"aria-label": "Back",
|
|
914
914
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
915
|
-
children: /* @__PURE__ */ e(
|
|
915
|
+
children: /* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5" })
|
|
916
916
|
}
|
|
917
917
|
),
|
|
918
918
|
k ? /* @__PURE__ */ e(
|
|
@@ -920,10 +920,10 @@ function po({
|
|
|
920
920
|
{
|
|
921
921
|
autoFocus: !0,
|
|
922
922
|
value: I,
|
|
923
|
-
onChange: (y) =>
|
|
924
|
-
onBlur:
|
|
923
|
+
onChange: (y) => X(y.target.value),
|
|
924
|
+
onBlur: Z,
|
|
925
925
|
onKeyDown: (y) => {
|
|
926
|
-
y.key === "Enter" &&
|
|
926
|
+
y.key === "Enter" && Z(), y.key === "Escape" && (X(t.name), E(!1));
|
|
927
927
|
},
|
|
928
928
|
className: "h-6 min-w-0 flex-1 rounded-[3px] border border-border bg-background px-1.5 text-[13px] font-medium text-foreground focus:border-foreground/40 focus:outline-none"
|
|
929
929
|
}
|
|
@@ -932,22 +932,22 @@ function po({
|
|
|
932
932
|
{
|
|
933
933
|
type: "button",
|
|
934
934
|
onClick: () => {
|
|
935
|
-
|
|
935
|
+
n && (X(t.name), E(!0));
|
|
936
936
|
},
|
|
937
|
-
title:
|
|
938
|
-
disabled: !
|
|
937
|
+
title: n ? "Click to rename" : t.name,
|
|
938
|
+
disabled: !n,
|
|
939
939
|
className: "truncate rounded-[3px] px-1 text-[13px] font-medium text-foreground enabled:hover:bg-accent disabled:cursor-default",
|
|
940
940
|
children: t.name
|
|
941
941
|
}
|
|
942
942
|
),
|
|
943
|
-
/* @__PURE__ */
|
|
944
|
-
/* @__PURE__ */ e(
|
|
943
|
+
/* @__PURE__ */ o("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
|
|
944
|
+
/* @__PURE__ */ e(Xt, { className: "h-2.5 w-2.5" }),
|
|
945
945
|
l.length,
|
|
946
946
|
" member",
|
|
947
947
|
l.length === 1 ? "" : "s"
|
|
948
948
|
] })
|
|
949
949
|
] }),
|
|
950
|
-
/* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children:
|
|
950
|
+
/* @__PURE__ */ e("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: $e ? /* @__PURE__ */ o("div", { children: [
|
|
951
951
|
/* @__PURE__ */ e(
|
|
952
952
|
"textarea",
|
|
953
953
|
{
|
|
@@ -957,24 +957,24 @@ function po({
|
|
|
957
957
|
onChange: (y) => z(y.target.value),
|
|
958
958
|
maxLength: 200,
|
|
959
959
|
onKeyDown: (y) => {
|
|
960
|
-
y.key === "Escape" && (z(t.description || ""),
|
|
960
|
+
y.key === "Escape" && (z(t.description || ""), j(!1)), y.key === "Enter" && (y.metaKey || y.ctrlKey) && ie();
|
|
961
961
|
},
|
|
962
962
|
placeholder: "What is this group for?",
|
|
963
963
|
className: "block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
|
|
964
964
|
}
|
|
965
965
|
),
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
966
|
+
/* @__PURE__ */ o("div", { className: "mt-1.5 flex items-center justify-between", children: [
|
|
967
|
+
/* @__PURE__ */ o("span", { className: "text-[10.5px] text-muted-foreground", children: [
|
|
968
968
|
ae.length,
|
|
969
969
|
"/200 · Esc to cancel · ⌘↩ to save"
|
|
970
970
|
] }),
|
|
971
|
-
/* @__PURE__ */
|
|
971
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-1.5", children: [
|
|
972
972
|
/* @__PURE__ */ e(
|
|
973
973
|
"button",
|
|
974
974
|
{
|
|
975
975
|
type: "button",
|
|
976
976
|
onClick: () => {
|
|
977
|
-
z(t.description || ""),
|
|
977
|
+
z(t.description || ""), j(!1);
|
|
978
978
|
},
|
|
979
979
|
className: "h-6 rounded-[5px] px-2 text-[11px] font-medium text-foreground/80 hover:bg-accent",
|
|
980
980
|
children: "Cancel"
|
|
@@ -991,76 +991,76 @@ function po({
|
|
|
991
991
|
)
|
|
992
992
|
] })
|
|
993
993
|
] })
|
|
994
|
-
] }) : /* @__PURE__ */
|
|
994
|
+
] }) : /* @__PURE__ */ o(
|
|
995
995
|
"button",
|
|
996
996
|
{
|
|
997
997
|
type: "button",
|
|
998
998
|
onClick: () => {
|
|
999
|
-
|
|
999
|
+
n && (z(t.description || ""), j(!0));
|
|
1000
1000
|
},
|
|
1001
|
-
disabled: !
|
|
1002
|
-
title:
|
|
1001
|
+
disabled: !n,
|
|
1002
|
+
title: n ? "Click to edit description" : void 0,
|
|
1003
1003
|
className: "block w-full rounded-[3px] px-1 py-0.5 text-left enabled:hover:bg-accent/40 disabled:cursor-default",
|
|
1004
1004
|
children: [
|
|
1005
|
-
t.description ? /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: t.description }) : /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children:
|
|
1006
|
-
/* @__PURE__ */
|
|
1007
|
-
|
|
1008
|
-
|
|
1005
|
+
t.description ? /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: t.description }) : /* @__PURE__ */ e("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children: n ? "Add a description…" : "No description" }),
|
|
1006
|
+
/* @__PURE__ */ o("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
|
|
1007
|
+
ee ? `Created ${ee}` : "Recently created",
|
|
1008
|
+
n ? " · You can edit this group" : ""
|
|
1009
1009
|
] })
|
|
1010
1010
|
]
|
|
1011
1011
|
}
|
|
1012
1012
|
) }),
|
|
1013
|
-
|
|
1014
|
-
|
|
1013
|
+
s && /* @__PURE__ */ e(
|
|
1014
|
+
bs,
|
|
1015
1015
|
{
|
|
1016
1016
|
query: ne,
|
|
1017
|
-
setQuery:
|
|
1018
|
-
open:
|
|
1019
|
-
setOpen:
|
|
1020
|
-
candidates:
|
|
1021
|
-
showKindChip: !
|
|
1022
|
-
onAdd:
|
|
1017
|
+
setQuery: se,
|
|
1018
|
+
open: Be,
|
|
1019
|
+
setOpen: oe,
|
|
1020
|
+
candidates: Se,
|
|
1021
|
+
showKindChip: !a,
|
|
1022
|
+
onAdd: ke,
|
|
1023
1023
|
busy: b.isPending
|
|
1024
1024
|
}
|
|
1025
1025
|
),
|
|
1026
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children:
|
|
1026
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto", children: m ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((y) => /* @__PURE__ */ e(
|
|
1027
1027
|
"div",
|
|
1028
1028
|
{
|
|
1029
1029
|
className: "h-10 animate-pulse rounded-[4px] bg-muted/60"
|
|
1030
1030
|
},
|
|
1031
1031
|
y
|
|
1032
1032
|
)) }) : p ? /* @__PURE__ */ e(
|
|
1033
|
-
|
|
1033
|
+
ur,
|
|
1034
1034
|
{
|
|
1035
1035
|
title: "Can't load members",
|
|
1036
1036
|
message: p,
|
|
1037
1037
|
onRetry: () => u()
|
|
1038
1038
|
}
|
|
1039
|
-
) : l.length === 0 ? /* @__PURE__ */
|
|
1039
|
+
) : l.length === 0 ? /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
|
|
1040
1040
|
/* @__PURE__ */ e("div", { className: "text-[12px] text-foreground", children: "No members yet" }),
|
|
1041
|
-
/* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children:
|
|
1041
|
+
/* @__PURE__ */ e("div", { className: "text-[11px] text-muted-foreground", children: s ? "Search above to add people to this group." : "This group does not have any members." })
|
|
1042
1042
|
] }) : l.map((y) => {
|
|
1043
|
-
var B, q, K,
|
|
1044
|
-
return /* @__PURE__ */
|
|
1043
|
+
var B, H, q, K, de, Q;
|
|
1044
|
+
return /* @__PURE__ */ o(
|
|
1045
1045
|
"div",
|
|
1046
1046
|
{
|
|
1047
1047
|
className: "group flex items-center gap-2 border-b border-border/60 px-5 py-2",
|
|
1048
1048
|
children: [
|
|
1049
|
-
/* @__PURE__ */ e(
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
/* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((
|
|
1049
|
+
/* @__PURE__ */ e(mr, { name: ((B = y.user) == null ? void 0 : B.name) || ((H = y.user) == null ? void 0 : H.email) || "?" }),
|
|
1050
|
+
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
|
|
1051
|
+
/* @__PURE__ */ e("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((q = y.user) == null ? void 0 : q.name) || ((K = y.user) == null ? void 0 : K.email) || "Unknown" }),
|
|
1052
1052
|
((de = y.user) == null ? void 0 : de.email) && y.user.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: y.user.email })
|
|
1053
1053
|
] }),
|
|
1054
|
-
!
|
|
1054
|
+
!a && /* @__PURE__ */ e("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: y.userType }),
|
|
1055
1055
|
/* @__PURE__ */ e(
|
|
1056
1056
|
"button",
|
|
1057
1057
|
{
|
|
1058
1058
|
type: "button",
|
|
1059
|
-
onClick: () =>
|
|
1060
|
-
disabled: !
|
|
1061
|
-
"aria-label": `Remove ${((
|
|
1059
|
+
onClick: () => Ce(y.userId),
|
|
1060
|
+
disabled: !s || L.isPending,
|
|
1061
|
+
"aria-label": `Remove ${((Q = y.user) == null ? void 0 : Q.name) || "member"}`,
|
|
1062
1062
|
className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover:opacity-100 disabled:opacity-30",
|
|
1063
|
-
children: /* @__PURE__ */ e(
|
|
1063
|
+
children: /* @__PURE__ */ e(Kt, { className: "h-3 w-3" })
|
|
1064
1064
|
}
|
|
1065
1065
|
)
|
|
1066
1066
|
]
|
|
@@ -1068,7 +1068,7 @@ function po({
|
|
|
1068
1068
|
y.id
|
|
1069
1069
|
);
|
|
1070
1070
|
}) }),
|
|
1071
|
-
r && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: /* @__PURE__ */
|
|
1071
|
+
r && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: /* @__PURE__ */ o(
|
|
1072
1072
|
"button",
|
|
1073
1073
|
{
|
|
1074
1074
|
type: "button",
|
|
@@ -1082,36 +1082,36 @@ function po({
|
|
|
1082
1082
|
) })
|
|
1083
1083
|
] });
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function fs({
|
|
1086
1086
|
isTenantUser: t,
|
|
1087
|
-
tenantId:
|
|
1088
|
-
onCancel:
|
|
1087
|
+
tenantId: a,
|
|
1088
|
+
onCancel: n,
|
|
1089
1089
|
onCreated: r
|
|
1090
1090
|
}) {
|
|
1091
|
-
const [
|
|
1091
|
+
const [s, d] = N(""), [f, h] = N(""), [g, v] = N(null), m = ns(), c = s.trim().length >= 3 && s.trim().length <= 50, u = async () => {
|
|
1092
1092
|
if (!c) return;
|
|
1093
1093
|
v(null);
|
|
1094
1094
|
const l = {
|
|
1095
|
-
name:
|
|
1095
|
+
name: s.trim(),
|
|
1096
1096
|
description: f.trim() || void 0,
|
|
1097
1097
|
type: t ? "TENANT_GROUP" : "ORG_GROUP",
|
|
1098
|
-
...t &&
|
|
1098
|
+
...t && a ? { tenantId: a } : {}
|
|
1099
1099
|
};
|
|
1100
1100
|
try {
|
|
1101
|
-
const p = await
|
|
1102
|
-
x ? r(x) :
|
|
1101
|
+
const p = await m.mutateAsync(l), x = p == null ? void 0 : p.id;
|
|
1102
|
+
x ? r(x) : n();
|
|
1103
1103
|
} catch (p) {
|
|
1104
1104
|
v(p instanceof Error ? p.message : "Failed to create group");
|
|
1105
1105
|
}
|
|
1106
1106
|
};
|
|
1107
|
-
return /* @__PURE__ */
|
|
1108
|
-
/* @__PURE__ */
|
|
1109
|
-
/* @__PURE__ */ e(
|
|
1107
|
+
return /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
1108
|
+
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
|
|
1109
|
+
/* @__PURE__ */ e(Ut, { children: "Name" }),
|
|
1110
1110
|
/* @__PURE__ */ e(
|
|
1111
1111
|
"input",
|
|
1112
1112
|
{
|
|
1113
1113
|
autoFocus: !0,
|
|
1114
|
-
value:
|
|
1114
|
+
value: s,
|
|
1115
1115
|
onChange: (l) => d(l.target.value),
|
|
1116
1116
|
placeholder: "Marketing leads, North America sales, …",
|
|
1117
1117
|
maxLength: 50,
|
|
@@ -1119,33 +1119,33 @@ function fo({
|
|
|
1119
1119
|
}
|
|
1120
1120
|
),
|
|
1121
1121
|
/* @__PURE__ */ e("div", { className: "mt-1 text-[10.5px] text-muted-foreground", children: "3–50 characters." }),
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
/* @__PURE__ */ e(
|
|
1122
|
+
/* @__PURE__ */ o("div", { className: "mt-4", children: [
|
|
1123
|
+
/* @__PURE__ */ e(Ut, { children: "Description (optional)" }),
|
|
1124
1124
|
/* @__PURE__ */ e(
|
|
1125
1125
|
"textarea",
|
|
1126
1126
|
{
|
|
1127
1127
|
rows: 2,
|
|
1128
1128
|
value: f,
|
|
1129
|
-
onChange: (l) =>
|
|
1129
|
+
onChange: (l) => h(l.target.value),
|
|
1130
1130
|
maxLength: 200,
|
|
1131
1131
|
placeholder: "What is this group for?",
|
|
1132
1132
|
className: "mt-1 block w-full resize-none rounded-[5px] border border-border bg-background px-2 py-1.5 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
|
|
1133
1133
|
}
|
|
1134
1134
|
),
|
|
1135
|
-
/* @__PURE__ */
|
|
1135
|
+
/* @__PURE__ */ o("div", { className: "mt-1 flex justify-end text-[10.5px] text-muted-foreground", children: [
|
|
1136
1136
|
f.length,
|
|
1137
1137
|
"/200"
|
|
1138
1138
|
] })
|
|
1139
1139
|
] }),
|
|
1140
1140
|
g && /* @__PURE__ */ e("div", { className: "mt-3 rounded-[5px] border border-rose-200 bg-rose-50 px-2 py-1.5 text-[11.5px] text-rose-700 dark:border-rose-900/60 dark:bg-rose-950/30 dark:text-rose-300", children: g })
|
|
1141
1141
|
] }),
|
|
1142
|
-
/* @__PURE__ */
|
|
1142
|
+
/* @__PURE__ */ o("div", { className: "flex shrink-0 items-center justify-end gap-1.5 border-t border-border bg-muted/30 px-5 py-2.5", children: [
|
|
1143
1143
|
/* @__PURE__ */ e(
|
|
1144
1144
|
"button",
|
|
1145
1145
|
{
|
|
1146
1146
|
type: "button",
|
|
1147
|
-
onClick:
|
|
1148
|
-
disabled:
|
|
1147
|
+
onClick: n,
|
|
1148
|
+
disabled: m.isPending,
|
|
1149
1149
|
className: "h-7 rounded-[5px] px-2.5 text-[12px] font-medium text-foreground/80 hover:bg-accent",
|
|
1150
1150
|
children: "Cancel"
|
|
1151
1151
|
}
|
|
@@ -1155,12 +1155,12 @@ function fo({
|
|
|
1155
1155
|
{
|
|
1156
1156
|
type: "button",
|
|
1157
1157
|
onClick: u,
|
|
1158
|
-
disabled: !c ||
|
|
1158
|
+
disabled: !c || m.isPending,
|
|
1159
1159
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] bg-foreground px-2.5 text-[12px] font-medium text-background hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",
|
|
1160
|
-
children:
|
|
1161
|
-
/* @__PURE__ */ e(
|
|
1160
|
+
children: m.isPending ? /* @__PURE__ */ o($, { children: [
|
|
1161
|
+
/* @__PURE__ */ e(Re, { className: "h-3 w-3 animate-spin" }),
|
|
1162
1162
|
"Creating…"
|
|
1163
|
-
] }) : /* @__PURE__ */
|
|
1163
|
+
] }) : /* @__PURE__ */ o($, { children: [
|
|
1164
1164
|
/* @__PURE__ */ e(re, { className: "h-3 w-3" }),
|
|
1165
1165
|
"Create group"
|
|
1166
1166
|
] })
|
|
@@ -1169,19 +1169,19 @@ function fo({
|
|
|
1169
1169
|
] })
|
|
1170
1170
|
] });
|
|
1171
1171
|
}
|
|
1172
|
-
function
|
|
1172
|
+
function bs({
|
|
1173
1173
|
query: t,
|
|
1174
|
-
setQuery:
|
|
1175
|
-
open:
|
|
1174
|
+
setQuery: a,
|
|
1175
|
+
open: n,
|
|
1176
1176
|
setOpen: r,
|
|
1177
|
-
candidates:
|
|
1177
|
+
candidates: s,
|
|
1178
1178
|
showKindChip: d,
|
|
1179
1179
|
onAdd: f,
|
|
1180
|
-
busy:
|
|
1180
|
+
busy: h
|
|
1181
1181
|
}) {
|
|
1182
|
-
const g =
|
|
1183
|
-
|
|
1184
|
-
if (!
|
|
1182
|
+
const g = Ot(null), v = Ot(null), [m, c] = N(null);
|
|
1183
|
+
en(() => {
|
|
1184
|
+
if (!n) {
|
|
1185
1185
|
c(null);
|
|
1186
1186
|
return;
|
|
1187
1187
|
}
|
|
@@ -1199,62 +1199,62 @@ function bo({
|
|
|
1199
1199
|
return l(), window.addEventListener("resize", l), window.addEventListener("scroll", l, !0), () => {
|
|
1200
1200
|
window.removeEventListener("resize", l), window.removeEventListener("scroll", l, !0);
|
|
1201
1201
|
};
|
|
1202
|
-
}, [
|
|
1203
|
-
if (!
|
|
1202
|
+
}, [n, s.length]), ge(() => {
|
|
1203
|
+
if (!n) return;
|
|
1204
1204
|
const l = (p) => {
|
|
1205
1205
|
var w, S;
|
|
1206
1206
|
const x = p.target;
|
|
1207
1207
|
(w = g.current) != null && w.contains(x) || (S = v.current) != null && S.contains(x) || r(!1);
|
|
1208
1208
|
};
|
|
1209
1209
|
return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
|
|
1210
|
-
}, [
|
|
1211
|
-
const u =
|
|
1212
|
-
return /* @__PURE__ */
|
|
1213
|
-
/* @__PURE__ */
|
|
1210
|
+
}, [n, r]);
|
|
1211
|
+
const u = n && s.length > 0 && m;
|
|
1212
|
+
return /* @__PURE__ */ o("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: [
|
|
1213
|
+
/* @__PURE__ */ o(
|
|
1214
1214
|
"div",
|
|
1215
1215
|
{
|
|
1216
1216
|
ref: g,
|
|
1217
1217
|
className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 focus-within:border-foreground/40",
|
|
1218
1218
|
children: [
|
|
1219
|
-
/* @__PURE__ */ e(
|
|
1219
|
+
/* @__PURE__ */ e($n, { className: "h-3 w-3 text-muted-foreground" }),
|
|
1220
1220
|
/* @__PURE__ */ e(
|
|
1221
1221
|
"input",
|
|
1222
1222
|
{
|
|
1223
1223
|
value: t,
|
|
1224
1224
|
onChange: (l) => {
|
|
1225
|
-
|
|
1225
|
+
a(l.target.value), r(!0);
|
|
1226
1226
|
},
|
|
1227
1227
|
onFocus: () => r(!0),
|
|
1228
1228
|
placeholder: "Add a member by name or email…",
|
|
1229
|
-
disabled:
|
|
1229
|
+
disabled: h,
|
|
1230
1230
|
className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed"
|
|
1231
1231
|
}
|
|
1232
1232
|
)
|
|
1233
1233
|
]
|
|
1234
1234
|
}
|
|
1235
1235
|
),
|
|
1236
|
-
u && typeof document < "u" &&
|
|
1236
|
+
u && typeof document < "u" && wn(
|
|
1237
1237
|
/* @__PURE__ */ e(
|
|
1238
1238
|
"div",
|
|
1239
1239
|
{
|
|
1240
1240
|
ref: v,
|
|
1241
1241
|
style: {
|
|
1242
1242
|
position: "fixed",
|
|
1243
|
-
left:
|
|
1244
|
-
top:
|
|
1245
|
-
width:
|
|
1246
|
-
transform:
|
|
1243
|
+
left: m.left,
|
|
1244
|
+
top: m.top,
|
|
1245
|
+
width: m.width,
|
|
1246
|
+
transform: m.above ? "translateY(-100%)" : void 0
|
|
1247
1247
|
},
|
|
1248
1248
|
className: "z-[60] max-h-[240px] overflow-y-auto rounded-[5px] border border-border bg-background shadow-[0_8px_24px_-12px_rgba(0,0,0,0.18)]",
|
|
1249
|
-
children:
|
|
1249
|
+
children: s.map((l) => /* @__PURE__ */ o(
|
|
1250
1250
|
"button",
|
|
1251
1251
|
{
|
|
1252
1252
|
type: "button",
|
|
1253
1253
|
onClick: () => f(l),
|
|
1254
1254
|
className: "flex w-full items-center gap-2 border-b border-border/60 px-2.5 py-2 text-left last:border-b-0 hover:bg-accent",
|
|
1255
1255
|
children: [
|
|
1256
|
-
/* @__PURE__ */ e(
|
|
1257
|
-
/* @__PURE__ */
|
|
1256
|
+
/* @__PURE__ */ e(mr, { name: l.name || l.email || "?" }),
|
|
1257
|
+
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
|
|
1258
1258
|
/* @__PURE__ */ e("div", { className: "truncate text-[12px] font-medium text-foreground", children: l.name || l.email || "Unknown" }),
|
|
1259
1259
|
l.email && l.name && /* @__PURE__ */ e("div", { className: "truncate text-[10.5px] text-muted-foreground", children: l.email })
|
|
1260
1260
|
] }),
|
|
@@ -1269,221 +1269,221 @@ function bo({
|
|
|
1269
1269
|
)
|
|
1270
1270
|
] });
|
|
1271
1271
|
}
|
|
1272
|
-
function
|
|
1273
|
-
if (!t) return
|
|
1272
|
+
function lr(t, a) {
|
|
1273
|
+
if (!t) return a;
|
|
1274
1274
|
if (t instanceof Error) {
|
|
1275
|
-
const
|
|
1276
|
-
return r ? r[1] :
|
|
1275
|
+
const n = t.message || "", r = n.match(/\{[\s\S]*"error"\s*:\s*"([^"]+)"[\s\S]*\}/);
|
|
1276
|
+
return r ? r[1] : n || a;
|
|
1277
1277
|
}
|
|
1278
|
-
return typeof t == "string" ? t :
|
|
1278
|
+
return typeof t == "string" ? t : a;
|
|
1279
1279
|
}
|
|
1280
|
-
function
|
|
1280
|
+
function ur({
|
|
1281
1281
|
title: t,
|
|
1282
|
-
message:
|
|
1283
|
-
onRetry:
|
|
1282
|
+
message: a,
|
|
1283
|
+
onRetry: n
|
|
1284
1284
|
}) {
|
|
1285
|
-
return /* @__PURE__ */
|
|
1285
|
+
return /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-center gap-2 px-6 py-10 text-center", children: [
|
|
1286
1286
|
/* @__PURE__ */ e("div", { className: "text-[12.5px] font-medium text-foreground", children: t }),
|
|
1287
|
-
/* @__PURE__ */ e("div", { className: "max-w-[360px] text-[11.5px] leading-[1.55] text-muted-foreground", children:
|
|
1288
|
-
|
|
1287
|
+
/* @__PURE__ */ e("div", { className: "max-w-[360px] text-[11.5px] leading-[1.55] text-muted-foreground", children: a }),
|
|
1288
|
+
n && /* @__PURE__ */ e(
|
|
1289
1289
|
"button",
|
|
1290
1290
|
{
|
|
1291
1291
|
type: "button",
|
|
1292
|
-
onClick:
|
|
1292
|
+
onClick: n,
|
|
1293
1293
|
className: "mt-1 inline-flex h-7 items-center rounded-[5px] border border-border bg-background px-2.5 text-[11.5px] font-medium text-foreground hover:bg-accent",
|
|
1294
1294
|
children: "Try again"
|
|
1295
1295
|
}
|
|
1296
1296
|
)
|
|
1297
1297
|
] });
|
|
1298
1298
|
}
|
|
1299
|
-
function
|
|
1299
|
+
function Ut({ children: t }) {
|
|
1300
1300
|
return /* @__PURE__ */ e("label", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: t });
|
|
1301
1301
|
}
|
|
1302
|
-
function
|
|
1303
|
-
const
|
|
1304
|
-
return /* @__PURE__ */ e(
|
|
1302
|
+
function mr({ name: t }) {
|
|
1303
|
+
const a = t.split(" ").map((n) => n[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
1304
|
+
return /* @__PURE__ */ e(dr, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ e(cr, { className: "text-[9px] font-semibold", children: a || "?" }) });
|
|
1305
1305
|
}
|
|
1306
|
-
const
|
|
1307
|
-
function
|
|
1306
|
+
const gs = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
1307
|
+
function xs({
|
|
1308
1308
|
open: t,
|
|
1309
|
-
onOpenChange:
|
|
1309
|
+
onOpenChange: a
|
|
1310
1310
|
}) {
|
|
1311
|
-
const
|
|
1312
|
-
(
|
|
1311
|
+
const n = C(
|
|
1312
|
+
(s) => {
|
|
1313
1313
|
var d, f;
|
|
1314
|
-
return
|
|
1315
|
-
dashboardDefault: (f = (d =
|
|
1314
|
+
return En({
|
|
1315
|
+
dashboardDefault: (f = (d = s.dashboard) == null ? void 0 : d.exportDefaults) == null ? void 0 : f.csvEncoding
|
|
1316
1316
|
});
|
|
1317
1317
|
}
|
|
1318
1318
|
), { setDashboardExportDefaults: r } = C(
|
|
1319
|
-
(
|
|
1319
|
+
(s) => s.actions
|
|
1320
1320
|
);
|
|
1321
|
-
return /* @__PURE__ */ e(
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
-
/* @__PURE__ */ e(
|
|
1324
|
-
/* @__PURE__ */ e(
|
|
1321
|
+
return /* @__PURE__ */ e(Ft, { open: t, onOpenChange: a, children: /* @__PURE__ */ o(Gt, { className: "rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control", children: [
|
|
1322
|
+
/* @__PURE__ */ o(Xr, { children: [
|
|
1323
|
+
/* @__PURE__ */ e(et, { className: "text-[15px]", children: "Download settings" }),
|
|
1324
|
+
/* @__PURE__ */ e(tt, { className: "text-[13px] leading-5", children: "Applies to every CSV downloaded or delivered from this dashboard. People can still change it for a single download." })
|
|
1325
1325
|
] }),
|
|
1326
|
-
/* @__PURE__ */
|
|
1327
|
-
/* @__PURE__ */ e(
|
|
1328
|
-
/* @__PURE__ */
|
|
1329
|
-
|
|
1326
|
+
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
1327
|
+
/* @__PURE__ */ e(Ba, { htmlFor: "dashboard-csv-encoding", className: gs, children: "CSV encoding" }),
|
|
1328
|
+
/* @__PURE__ */ o(
|
|
1329
|
+
Fa,
|
|
1330
1330
|
{
|
|
1331
|
-
value:
|
|
1332
|
-
onValueChange: (
|
|
1331
|
+
value: n,
|
|
1332
|
+
onValueChange: (s) => r({ csvEncoding: s }),
|
|
1333
1333
|
children: [
|
|
1334
|
-
/* @__PURE__ */ e(
|
|
1335
|
-
/* @__PURE__ */ e(
|
|
1334
|
+
/* @__PURE__ */ e(Ga, { id: "dashboard-csv-encoding", size: "sm", children: /* @__PURE__ */ e(Va, {}) }),
|
|
1335
|
+
/* @__PURE__ */ e(ja, { children: Zr.map((s) => /* @__PURE__ */ e(za, { value: s.value, children: s.label }, s.value)) })
|
|
1336
1336
|
]
|
|
1337
1337
|
}
|
|
1338
1338
|
)
|
|
1339
1339
|
] })
|
|
1340
1340
|
] }) });
|
|
1341
1341
|
}
|
|
1342
|
-
function pe(t,
|
|
1342
|
+
function pe(t, a, n) {
|
|
1343
1343
|
var d, f;
|
|
1344
1344
|
const r = (t.controls || []).find(
|
|
1345
|
-
(
|
|
1345
|
+
(h) => h.id === n
|
|
1346
1346
|
);
|
|
1347
1347
|
if (r)
|
|
1348
1348
|
return r.label;
|
|
1349
|
-
const
|
|
1350
|
-
(
|
|
1349
|
+
const s = (f = (d = Ue(t, a)) == null ? void 0 : d.controls) == null ? void 0 : f.find(
|
|
1350
|
+
(h) => h.id === n
|
|
1351
1351
|
);
|
|
1352
|
-
return (
|
|
1352
|
+
return (s == null ? void 0 : s.label) || n;
|
|
1353
1353
|
}
|
|
1354
|
-
function fe(t,
|
|
1355
|
-
var
|
|
1356
|
-
return ((
|
|
1354
|
+
function fe(t, a) {
|
|
1355
|
+
var n;
|
|
1356
|
+
return ((n = Ue(t, a)) == null ? void 0 : n.title) || a;
|
|
1357
1357
|
}
|
|
1358
|
-
function
|
|
1359
|
-
const { errors:
|
|
1360
|
-
if (!
|
|
1361
|
-
return
|
|
1358
|
+
function vs(t) {
|
|
1359
|
+
const { errors: a, dashboard: n } = t;
|
|
1360
|
+
if (!n)
|
|
1361
|
+
return a;
|
|
1362
1362
|
const r = /* @__PURE__ */ new Map();
|
|
1363
|
-
for (const
|
|
1364
|
-
const d =
|
|
1363
|
+
for (const s of a) {
|
|
1364
|
+
const d = s.match(
|
|
1365
1365
|
/^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
|
|
1366
1366
|
);
|
|
1367
1367
|
if (d) {
|
|
1368
|
-
const [,
|
|
1368
|
+
const [, m, c] = d, u = `${m}:${c}:missing-metric`;
|
|
1369
1369
|
r.has(u) || r.set(
|
|
1370
1370
|
u,
|
|
1371
|
-
`"${fe(
|
|
1372
|
-
|
|
1373
|
-
|
|
1371
|
+
`"${fe(n, m)}" has an outdated "${pe(
|
|
1372
|
+
n,
|
|
1373
|
+
m,
|
|
1374
1374
|
c
|
|
1375
1375
|
)}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1376
1376
|
);
|
|
1377
1377
|
continue;
|
|
1378
1378
|
}
|
|
1379
|
-
const f =
|
|
1379
|
+
const f = s.match(
|
|
1380
1380
|
/^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
|
|
1381
1381
|
);
|
|
1382
1382
|
if (f) {
|
|
1383
|
-
const [,
|
|
1383
|
+
const [, m, c] = f, u = `${m}:${c}:missing-group-by`;
|
|
1384
1384
|
r.has(u) || r.set(
|
|
1385
1385
|
u,
|
|
1386
|
-
`"${fe(
|
|
1387
|
-
|
|
1388
|
-
|
|
1386
|
+
`"${fe(n, m)}" has an outdated "${pe(
|
|
1387
|
+
n,
|
|
1388
|
+
m,
|
|
1389
1389
|
c
|
|
1390
1390
|
)}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1391
1391
|
);
|
|
1392
1392
|
continue;
|
|
1393
1393
|
}
|
|
1394
|
-
const
|
|
1394
|
+
const h = s.match(
|
|
1395
1395
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
|
|
1396
1396
|
);
|
|
1397
|
-
if (
|
|
1398
|
-
const [,
|
|
1397
|
+
if (h) {
|
|
1398
|
+
const [, m, c] = h, u = `${m}:${c}:invalid-metric`;
|
|
1399
1399
|
r.has(u) || r.set(
|
|
1400
1400
|
u,
|
|
1401
|
-
`"${fe(
|
|
1402
|
-
|
|
1403
|
-
|
|
1401
|
+
`"${fe(n, m)}" has an invalid "${pe(
|
|
1402
|
+
n,
|
|
1403
|
+
m,
|
|
1404
1404
|
c
|
|
1405
1405
|
)}" metric mapping. Open the card controls and choose a valid metric for each option.`
|
|
1406
1406
|
);
|
|
1407
1407
|
continue;
|
|
1408
1408
|
}
|
|
1409
|
-
const g =
|
|
1409
|
+
const g = s.match(
|
|
1410
1410
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
|
|
1411
1411
|
);
|
|
1412
1412
|
if (g) {
|
|
1413
|
-
const [,
|
|
1413
|
+
const [, m, c] = g, u = `${m}:${c}:invalid-group-by`;
|
|
1414
1414
|
r.has(u) || r.set(
|
|
1415
1415
|
u,
|
|
1416
|
-
`"${fe(
|
|
1417
|
-
|
|
1418
|
-
|
|
1416
|
+
`"${fe(n, m)}" has an invalid "${pe(
|
|
1417
|
+
n,
|
|
1418
|
+
m,
|
|
1419
1419
|
c
|
|
1420
1420
|
)}" field mapping. Open the card controls and choose a valid field for each option.`
|
|
1421
1421
|
);
|
|
1422
1422
|
continue;
|
|
1423
1423
|
}
|
|
1424
|
-
const v =
|
|
1424
|
+
const v = s.match(
|
|
1425
1425
|
/^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
|
|
1426
1426
|
);
|
|
1427
1427
|
if (v) {
|
|
1428
|
-
const [,
|
|
1428
|
+
const [, m, c] = v, u = `${m}:${c}:missing-temporal-group-by`;
|
|
1429
1429
|
r.has(u) || r.set(
|
|
1430
1430
|
u,
|
|
1431
|
-
`"${fe(
|
|
1432
|
-
|
|
1433
|
-
|
|
1431
|
+
`"${fe(n, m)}" can no longer use "${pe(
|
|
1432
|
+
n,
|
|
1433
|
+
m,
|
|
1434
1434
|
c
|
|
1435
1435
|
)}" for time grain because the card does not currently group by a date field.`
|
|
1436
1436
|
);
|
|
1437
1437
|
continue;
|
|
1438
1438
|
}
|
|
1439
|
-
r.set(
|
|
1439
|
+
r.set(s, s);
|
|
1440
1440
|
}
|
|
1441
1441
|
return Array.from(r.values());
|
|
1442
1442
|
}
|
|
1443
|
-
function
|
|
1443
|
+
function ys({
|
|
1444
1444
|
visible: t,
|
|
1445
|
-
onSelect:
|
|
1445
|
+
onSelect: a
|
|
1446
1446
|
}) {
|
|
1447
|
-
return t ? /* @__PURE__ */
|
|
1448
|
-
/* @__PURE__ */ e(
|
|
1447
|
+
return t ? /* @__PURE__ */ o(P, { onSelect: a, children: [
|
|
1448
|
+
/* @__PURE__ */ e(ea, { className: "h-3.5 w-3.5" }),
|
|
1449
1449
|
"Schedule email report"
|
|
1450
1450
|
] }) : null;
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function ws({
|
|
1453
1453
|
scheduleReportVisible: t,
|
|
1454
|
-
analyticalBriefingVisible:
|
|
1455
|
-
onScheduleReport:
|
|
1454
|
+
analyticalBriefingVisible: a,
|
|
1455
|
+
onScheduleReport: n,
|
|
1456
1456
|
onCreateAnalyticalBriefing: r
|
|
1457
1457
|
}) {
|
|
1458
|
-
return /* @__PURE__ */
|
|
1458
|
+
return /* @__PURE__ */ o($, { children: [
|
|
1459
1459
|
/* @__PURE__ */ e(
|
|
1460
|
-
|
|
1460
|
+
ys,
|
|
1461
1461
|
{
|
|
1462
1462
|
visible: t,
|
|
1463
|
-
onSelect:
|
|
1463
|
+
onSelect: n
|
|
1464
1464
|
}
|
|
1465
1465
|
),
|
|
1466
|
-
|
|
1466
|
+
a ? /* @__PURE__ */ o(P, { onSelect: r, children: [
|
|
1467
1467
|
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
|
|
1468
1468
|
"Create analytical briefing"
|
|
1469
1469
|
] }) : null
|
|
1470
1470
|
] });
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1473
|
-
var v,
|
|
1474
|
-
const { saved:
|
|
1472
|
+
function Ns(t) {
|
|
1473
|
+
var v, m, c;
|
|
1474
|
+
const { saved: a, draft: n, usage: r } = t, s = [], d = On(a);
|
|
1475
1475
|
for (const [u, l] of Object.entries(r.inputs))
|
|
1476
|
-
!l ||
|
|
1476
|
+
!l || !_t(a, u) || _t(n, u) || s.push({
|
|
1477
1477
|
target: "input",
|
|
1478
1478
|
id: u,
|
|
1479
|
-
label: Ln(
|
|
1479
|
+
label: Ln(a, d, u),
|
|
1480
1480
|
bookmarks: l,
|
|
1481
1481
|
remembered: 0
|
|
1482
1482
|
});
|
|
1483
|
-
const f = new Set((
|
|
1484
|
-
for (const u of
|
|
1483
|
+
const f = new Set((n.sheets ?? []).map((u) => u.id));
|
|
1484
|
+
for (const u of a.sheets ?? []) {
|
|
1485
1485
|
const l = r.sheets[u.id] ?? 0;
|
|
1486
|
-
!l || f.has(u.id) ||
|
|
1486
|
+
!l || f.has(u.id) || s.push({
|
|
1487
1487
|
target: "sheet",
|
|
1488
1488
|
id: u.id,
|
|
1489
1489
|
label: ((v = u.title) == null ? void 0 : v.trim()) || "Untitled sheet",
|
|
@@ -1491,12 +1491,12 @@ function No(t) {
|
|
|
1491
1491
|
remembered: 0
|
|
1492
1492
|
});
|
|
1493
1493
|
}
|
|
1494
|
-
const
|
|
1494
|
+
const h = Mt(a), g = Mt(n);
|
|
1495
1495
|
for (const [u, l] of Object.entries(r.tables)) {
|
|
1496
|
-
if (!
|
|
1497
|
-
const p =
|
|
1496
|
+
if (!h.has(u)) continue;
|
|
1497
|
+
const p = Ue(a, u), x = ((m = p == null ? void 0 : p.title) == null ? void 0 : m.trim()) || "Untitled table";
|
|
1498
1498
|
if (!g.has(u)) {
|
|
1499
|
-
|
|
1499
|
+
s.push({
|
|
1500
1500
|
target: "table",
|
|
1501
1501
|
id: u,
|
|
1502
1502
|
label: x,
|
|
@@ -1505,76 +1505,76 @@ function No(t) {
|
|
|
1505
1505
|
});
|
|
1506
1506
|
continue;
|
|
1507
1507
|
}
|
|
1508
|
-
const w = p ?
|
|
1508
|
+
const w = p ? Lt(p) : void 0, S = Ue(n, u), b = S ? Lt(S) : void 0;
|
|
1509
1509
|
if (!(!p || !w || !b))
|
|
1510
|
-
for (const [L,
|
|
1511
|
-
if (!(
|
|
1510
|
+
for (const [L, M] of Object.entries(l.columns)) {
|
|
1511
|
+
if (!(M.bookmarks || M.remembered) || Cn(L) || !w.has(L) || b.has(L))
|
|
1512
1512
|
continue;
|
|
1513
|
-
const k =
|
|
1514
|
-
|
|
1513
|
+
const k = Dn(p, L), E = ((c = k == null ? void 0 : k.label) == null ? void 0 : c.trim()) || (k == null ? void 0 : k.name);
|
|
1514
|
+
s.push({
|
|
1515
1515
|
target: "column",
|
|
1516
1516
|
id: L,
|
|
1517
1517
|
cardId: u,
|
|
1518
1518
|
label: E ? `${E} in ${x}` : `A column in ${x}`,
|
|
1519
|
-
bookmarks:
|
|
1520
|
-
remembered:
|
|
1519
|
+
bookmarks: M.bookmarks,
|
|
1520
|
+
remembered: M.remembered
|
|
1521
1521
|
});
|
|
1522
1522
|
}
|
|
1523
1523
|
}
|
|
1524
|
-
return
|
|
1524
|
+
return s;
|
|
1525
1525
|
}
|
|
1526
|
-
const
|
|
1527
|
-
function
|
|
1526
|
+
const Ss = "dashboard-bookmark-usage";
|
|
1527
|
+
function ks(t) {
|
|
1528
1528
|
var g;
|
|
1529
|
-
const
|
|
1529
|
+
const a = C((v) => v.viewerStateClient), n = (g = t.saved) == null ? void 0 : g.id, s = ta({
|
|
1530
1530
|
// Keyed by the viewer, never by the client object (TanStack drops functions when hashing).
|
|
1531
|
-
queryKey: [
|
|
1532
|
-
queryFn: () =>
|
|
1533
|
-
enabled: t.enabled && !!
|
|
1531
|
+
queryKey: [Ss, (a == null ? void 0 : a.viewerKey) ?? null],
|
|
1532
|
+
queryFn: () => a.bookmarks.usage(),
|
|
1533
|
+
enabled: t.enabled && !!a && !!n,
|
|
1534
1534
|
staleTime: 5 * 6e4,
|
|
1535
1535
|
retry: !1
|
|
1536
|
-
}).data, { saved: d, draft: f, enabled:
|
|
1537
|
-
return
|
|
1536
|
+
}).data, { saved: d, draft: f, enabled: h } = t;
|
|
1537
|
+
return V(() => !h || !d || !s ? [] : !s.bookmarks && !Object.keys(s.tables).length ? [] : Ns({ saved: d, draft: f, usage: s }), [f, h, d, s]);
|
|
1538
1538
|
}
|
|
1539
|
-
function
|
|
1540
|
-
return `${t} ${t === 1 ?
|
|
1539
|
+
function $t(t, a, n) {
|
|
1540
|
+
return `${t} ${t === 1 ? a : n}`;
|
|
1541
1541
|
}
|
|
1542
|
-
function
|
|
1543
|
-
const
|
|
1544
|
-
t.bookmarks ?
|
|
1545
|
-
t.remembered ?
|
|
1542
|
+
function Cs(t) {
|
|
1543
|
+
const a = [
|
|
1544
|
+
t.bookmarks ? $t(t.bookmarks, "bookmark", "bookmarks") : null,
|
|
1545
|
+
t.remembered ? $t(t.remembered, "remembered layout", "remembered layouts") : null
|
|
1546
1546
|
].filter(Boolean).join(", ");
|
|
1547
|
-
return t.target === "sheet" ? { name: `${t.label} sheet`, uses:
|
|
1547
|
+
return t.target === "sheet" ? { name: `${t.label} sheet`, uses: a } : t.target === "table" ? { name: `${t.label} table`, uses: a } : { name: t.label, uses: a };
|
|
1548
1548
|
}
|
|
1549
|
-
function
|
|
1549
|
+
function Ds({
|
|
1550
1550
|
saved: t,
|
|
1551
|
-
draft:
|
|
1552
|
-
enabled:
|
|
1551
|
+
draft: a,
|
|
1552
|
+
enabled: n
|
|
1553
1553
|
}) {
|
|
1554
|
-
const r =
|
|
1555
|
-
return r.length ? /* @__PURE__ */
|
|
1556
|
-
/* @__PURE__ */ e(
|
|
1557
|
-
|
|
1554
|
+
const r = ks({ saved: t, draft: a, enabled: n });
|
|
1555
|
+
return r.length ? /* @__PURE__ */ o(Ha, { children: [
|
|
1556
|
+
/* @__PURE__ */ e(qa, { asChild: !0, children: /* @__PURE__ */ o(
|
|
1557
|
+
G,
|
|
1558
1558
|
{
|
|
1559
1559
|
variant: "ghost",
|
|
1560
1560
|
size: "xs",
|
|
1561
1561
|
className: "gap-1 text-muted-foreground hover:text-foreground",
|
|
1562
1562
|
children: [
|
|
1563
|
-
/* @__PURE__ */ e(
|
|
1563
|
+
/* @__PURE__ */ e(ra, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
1564
1564
|
"Affects saved views"
|
|
1565
1565
|
]
|
|
1566
1566
|
}
|
|
1567
1567
|
) }),
|
|
1568
|
-
/* @__PURE__ */
|
|
1568
|
+
/* @__PURE__ */ o(Ka, { align: "end", className: "w-[320px] p-3 text-[12px]", children: [
|
|
1569
1569
|
/* @__PURE__ */ e("p", { className: "text-foreground", children: "This edit removes parts of the dashboard that viewers saved. Their views still open, with a note about what no longer applies." }),
|
|
1570
1570
|
/* @__PURE__ */ e(
|
|
1571
1571
|
"ul",
|
|
1572
1572
|
{
|
|
1573
1573
|
"aria-label": "Affected saved views",
|
|
1574
1574
|
className: "mt-2 grid gap-1 border-t border-border/60 pt-2",
|
|
1575
|
-
children: r.map((
|
|
1576
|
-
const { name: d, uses: f } =
|
|
1577
|
-
return /* @__PURE__ */
|
|
1575
|
+
children: r.map((s) => {
|
|
1576
|
+
const { name: d, uses: f } = Cs(s);
|
|
1577
|
+
return /* @__PURE__ */ o(
|
|
1578
1578
|
"li",
|
|
1579
1579
|
{
|
|
1580
1580
|
className: "flex items-baseline justify-between gap-3",
|
|
@@ -1583,7 +1583,7 @@ function Do({
|
|
|
1583
1583
|
/* @__PURE__ */ e("span", { className: "shrink-0 text-[11.5px] text-muted-foreground", children: f })
|
|
1584
1584
|
]
|
|
1585
1585
|
},
|
|
1586
|
-
`${
|
|
1586
|
+
`${s.target}:${s.cardId ?? ""}:${s.id}`
|
|
1587
1587
|
);
|
|
1588
1588
|
})
|
|
1589
1589
|
}
|
|
@@ -1591,60 +1591,60 @@ function Do({
|
|
|
1591
1591
|
] })
|
|
1592
1592
|
] }) : null;
|
|
1593
1593
|
}
|
|
1594
|
-
function
|
|
1594
|
+
function Bt(t, a) {
|
|
1595
1595
|
return {
|
|
1596
|
-
dashboard:
|
|
1597
|
-
semanticExecutionPayload:
|
|
1596
|
+
dashboard: at(t),
|
|
1597
|
+
semanticExecutionPayload: at(a)
|
|
1598
1598
|
};
|
|
1599
1599
|
}
|
|
1600
|
-
function
|
|
1601
|
-
var
|
|
1600
|
+
function ao() {
|
|
1601
|
+
var wt, Nt, St, kt;
|
|
1602
1602
|
const {
|
|
1603
1603
|
authToken: t,
|
|
1604
|
-
tokenProps:
|
|
1605
|
-
id:
|
|
1604
|
+
tokenProps: a,
|
|
1605
|
+
id: n,
|
|
1606
1606
|
showBriefings: r
|
|
1607
|
-
} =
|
|
1608
|
-
canEditDashboard:
|
|
1607
|
+
} = J(), s = aa(), { isLocalDev: d, isConsoleMode: f } = na(), {
|
|
1608
|
+
canEditDashboard: h,
|
|
1609
1609
|
hasInspectionUser: g,
|
|
1610
1610
|
inspectionMessage: v,
|
|
1611
|
-
isInspectionMode:
|
|
1611
|
+
isInspectionMode: m,
|
|
1612
1612
|
isInspectionSurface: c
|
|
1613
|
-
} =
|
|
1613
|
+
} = sa(), { openBrandStudioPreview: u } = oa(), { permissions: l } = jn(), p = ia(), { isLoading: x } = da(), w = C((i) => i.theme), S = C((i) => i.isDownloadingPdf), b = C((i) => i.dashboard), L = C((i) => i.selectedSheetId), M = (wt = b == null ? void 0 : b.sheets) == null ? void 0 : wt.find(
|
|
1614
1614
|
(i) => i.id === L
|
|
1615
|
-
), k =
|
|
1615
|
+
), k = Nn(M), E = k ? (Nt = M == null ? void 0 : M.document) == null ? void 0 : Nt.page : void 0, I = C(
|
|
1616
1616
|
(i) => i.isDashboardEditing
|
|
1617
|
-
), { setDashboardTitle:
|
|
1618
|
-
|
|
1619
|
-
() =>
|
|
1620
|
-
[
|
|
1617
|
+
), { setDashboardTitle: X } = C((i) => i.actions), [$e, j] = N(!1), [ae, z] = N(!1), [ne, se] = N(!1), [Be, oe] = N(!1), [Se, Z] = N(null), [ie, ke] = N(null), { registerBriefingViewer: Ce } = ca();
|
|
1618
|
+
ge(
|
|
1619
|
+
() => Ce((i) => ke(i)),
|
|
1620
|
+
[Ce]
|
|
1621
1621
|
);
|
|
1622
|
-
const [
|
|
1622
|
+
const [ee, y] = N(!1), [B, H] = N(!1), [q, K] = N(null), [de, Q] = N([]), [lt, De] = N(!1), [hr, ut] = N(!1), U = C((i) => i.isVisualEditing);
|
|
1623
1623
|
Ct((i) => i.card);
|
|
1624
|
-
const
|
|
1624
|
+
const pr = _e(
|
|
1625
1625
|
(i) => i.selectedDashboard
|
|
1626
|
-
),
|
|
1626
|
+
), fr = _e(
|
|
1627
1627
|
(i) => i.initialDashboard
|
|
1628
1628
|
);
|
|
1629
|
-
|
|
1630
|
-
const
|
|
1629
|
+
_e((i) => i.selectedVisual), C((i) => i.selectedFrameId), Ct((i) => i.frame);
|
|
1630
|
+
const mt = C(
|
|
1631
1631
|
(i) => i.showDashboardJSON
|
|
1632
1632
|
);
|
|
1633
1633
|
C((i) => i.onSaveFunction);
|
|
1634
|
-
const { setIsDashboardEditing:
|
|
1634
|
+
const { setIsDashboardEditing: ht, setShowDashboardJSON: pt, markDashboardSaved: br } = C(
|
|
1635
1635
|
(i) => i.actions
|
|
1636
|
-
), { setInitialDashboard:
|
|
1636
|
+
), { setInitialDashboard: ft, clearSelectedDashboard: Fe } = _e(
|
|
1637
1637
|
(i) => i.actions
|
|
1638
|
-
), ce = !!
|
|
1639
|
-
config:
|
|
1638
|
+
), ce = !!a.orgUserId || !!(a.tenantId && a.endUserId && a.endUserEmail), { resources: Ee } = la(Je.DASHBOARD), O = xn(), { currentUser: gr } = st(), xr = ua(gr), F = pr || fr, W = ma({
|
|
1639
|
+
config: a.config,
|
|
1640
1640
|
canNavigateDashboardHub: ce,
|
|
1641
1641
|
canShareDashboard: ((St = F == null ? void 0 : F.permissions) == null ? void 0 : St.canShare) === !0,
|
|
1642
|
-
canManageGroups:
|
|
1643
|
-
}),
|
|
1642
|
+
canManageGroups: xr
|
|
1643
|
+
}), bt = F ? {
|
|
1644
1644
|
id: F.id,
|
|
1645
1645
|
title: (b == null ? void 0 : b.title) || F.title || "Dashboard"
|
|
1646
|
-
} : null, { handleAddNewFrame:
|
|
1647
|
-
if (!
|
|
1646
|
+
} : null, { handleAddNewFrame: vr } = ha(), [Ge, Ve] = N(!1), [yr, le] = N(!1), [je, Ie] = N("close"), ue = pa(Je.DASHBOARD), [_, me] = N(null), wr = async (i, R) => {
|
|
1647
|
+
if (!m) {
|
|
1648
1648
|
if (!(b != null && b.id)) {
|
|
1649
1649
|
console.log("No dashboard ID found");
|
|
1650
1650
|
return;
|
|
@@ -1652,7 +1652,7 @@ function ts() {
|
|
|
1652
1652
|
console.log("Updating dashboard title:", {
|
|
1653
1653
|
dashboardId: b.id,
|
|
1654
1654
|
newTitle: i,
|
|
1655
|
-
previousTitle:
|
|
1655
|
+
previousTitle: R
|
|
1656
1656
|
}), ue.mutate(
|
|
1657
1657
|
{
|
|
1658
1658
|
resourceId: b.id,
|
|
@@ -1661,36 +1661,36 @@ function ts() {
|
|
|
1661
1661
|
{
|
|
1662
1662
|
onSuccess: () => {
|
|
1663
1663
|
me(
|
|
1664
|
-
(
|
|
1665
|
-
...
|
|
1666
|
-
dashboard: { ...
|
|
1667
|
-
} :
|
|
1664
|
+
(T) => (T == null ? void 0 : T.dashboard.id) === b.id ? {
|
|
1665
|
+
...T,
|
|
1666
|
+
dashboard: { ...T.dashboard, title: i }
|
|
1667
|
+
} : T
|
|
1668
1668
|
), D.success("Dashboard title updated");
|
|
1669
1669
|
},
|
|
1670
|
-
onError: (
|
|
1671
|
-
console.error("Failed to update dashboard title:",
|
|
1670
|
+
onError: (T) => {
|
|
1671
|
+
console.error("Failed to update dashboard title:", T), D.error("Failed to update dashboard title");
|
|
1672
1672
|
const te = C.getState().dashboard;
|
|
1673
|
-
(te == null ? void 0 : te.id) === b.id && te.title === i &&
|
|
1673
|
+
(te == null ? void 0 : te.id) === b.id && te.title === i && X(R);
|
|
1674
1674
|
}
|
|
1675
1675
|
}
|
|
1676
1676
|
);
|
|
1677
1677
|
}
|
|
1678
1678
|
};
|
|
1679
|
-
|
|
1680
|
-
if (
|
|
1679
|
+
ge(() => {
|
|
1680
|
+
if (Ee && Ee.length > 0) {
|
|
1681
1681
|
const i = b == null ? void 0 : b.id;
|
|
1682
1682
|
if (i) {
|
|
1683
|
-
const
|
|
1684
|
-
(
|
|
1683
|
+
const R = Ee.find(
|
|
1684
|
+
(T) => T.id === i
|
|
1685
1685
|
);
|
|
1686
|
-
|
|
1686
|
+
R && ft(R);
|
|
1687
1687
|
}
|
|
1688
1688
|
}
|
|
1689
|
-
}, [
|
|
1690
|
-
const
|
|
1691
|
-
() =>
|
|
1689
|
+
}, [Ee, b == null ? void 0 : b.id, ft]);
|
|
1690
|
+
const Nr = a.orgUserId || a.tenantId, ze = V(
|
|
1691
|
+
() => As({
|
|
1692
1692
|
accessToken: t == null ? void 0 : t.accessToken,
|
|
1693
|
-
dashboardId: (b == null ? void 0 : b.id) ||
|
|
1693
|
+
dashboardId: (b == null ? void 0 : b.id) || n || a.dashboard_id,
|
|
1694
1694
|
selectedSheetId: k ? L : void 0,
|
|
1695
1695
|
pageSize: E == null ? void 0 : E.size,
|
|
1696
1696
|
orientation: E == null ? void 0 : E.orientation,
|
|
@@ -1698,158 +1698,158 @@ function ts() {
|
|
|
1698
1698
|
}),
|
|
1699
1699
|
[
|
|
1700
1700
|
t == null ? void 0 : t.accessToken,
|
|
1701
|
-
|
|
1701
|
+
n,
|
|
1702
1702
|
b == null ? void 0 : b.id,
|
|
1703
1703
|
k,
|
|
1704
1704
|
E == null ? void 0 : E.orientation,
|
|
1705
1705
|
E == null ? void 0 : E.size,
|
|
1706
1706
|
L,
|
|
1707
1707
|
w,
|
|
1708
|
-
|
|
1708
|
+
a.dashboard_id
|
|
1709
1709
|
]
|
|
1710
|
-
), He = I && !
|
|
1710
|
+
), He = I && !U && !m && Nr && h, { setDashboard: qe } = C((i) => i.actions), Sr = C(
|
|
1711
1711
|
(i) => i.semanticExecutionPayload
|
|
1712
|
-
),
|
|
1713
|
-
|
|
1714
|
-
},
|
|
1715
|
-
|
|
1712
|
+
), kr = () => {
|
|
1713
|
+
ht(!0);
|
|
1714
|
+
}, Ae = () => {
|
|
1715
|
+
ht(!1), pt(!1), me(null);
|
|
1716
1716
|
};
|
|
1717
|
-
|
|
1717
|
+
ge(() => {
|
|
1718
1718
|
if (!I) {
|
|
1719
|
-
|
|
1719
|
+
_ && me(null);
|
|
1720
1720
|
return;
|
|
1721
1721
|
}
|
|
1722
|
-
if (
|
|
1722
|
+
if (_ || !b || x)
|
|
1723
1723
|
return;
|
|
1724
|
-
const i =
|
|
1724
|
+
const i = fa(C.getState());
|
|
1725
1725
|
me(
|
|
1726
|
-
|
|
1726
|
+
Bt(i.dashboard, i.semanticExecutionPayload)
|
|
1727
1727
|
);
|
|
1728
1728
|
}, [
|
|
1729
1729
|
b,
|
|
1730
|
-
|
|
1730
|
+
_,
|
|
1731
1731
|
I,
|
|
1732
1732
|
x,
|
|
1733
|
-
|
|
1733
|
+
Sr
|
|
1734
1734
|
]);
|
|
1735
|
-
const
|
|
1735
|
+
const Ke = (_ == null ? void 0 : _.dashboard) ?? null, { isDirty: Qe, isDirtyPending: Cr, resetDirty: he } = In(
|
|
1736
1736
|
b,
|
|
1737
|
-
|
|
1737
|
+
Ke,
|
|
1738
1738
|
300,
|
|
1739
1739
|
1e3,
|
|
1740
|
-
|
|
1741
|
-
),
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
),
|
|
1746
|
-
if (
|
|
1747
|
-
|
|
1748
|
-
semanticExecutionPayload:
|
|
1749
|
-
}),
|
|
1740
|
+
An
|
|
1741
|
+
), gt = tn(
|
|
1742
|
+
Ke,
|
|
1743
|
+
m,
|
|
1744
|
+
h
|
|
1745
|
+
), xt = Qe || Cr, Oe = Ge || ue.isPending, Dr = () => {
|
|
1746
|
+
if (m) {
|
|
1747
|
+
_ && qe(_.dashboard, {
|
|
1748
|
+
semanticExecutionPayload: _.semanticExecutionPayload
|
|
1749
|
+
}), Ae(), he();
|
|
1750
1750
|
return;
|
|
1751
1751
|
}
|
|
1752
|
-
|
|
1753
|
-
},
|
|
1754
|
-
await
|
|
1752
|
+
gt() ? (Ie("close"), le(!0)) : (Ae(), he());
|
|
1753
|
+
}, Er = async () => {
|
|
1754
|
+
await We({
|
|
1755
1755
|
closeAfterSave: !0,
|
|
1756
|
-
navigateHomeAfterSave:
|
|
1756
|
+
navigateHomeAfterSave: je === "home"
|
|
1757
1757
|
});
|
|
1758
|
-
},
|
|
1759
|
-
const i =
|
|
1760
|
-
|
|
1761
|
-
semanticExecutionPayload:
|
|
1762
|
-
}),
|
|
1763
|
-
},
|
|
1764
|
-
|
|
1765
|
-
semanticExecutionPayload:
|
|
1758
|
+
}, Ir = () => {
|
|
1759
|
+
const i = je === "home" && !!ce;
|
|
1760
|
+
_ && qe(_.dashboard, {
|
|
1761
|
+
semanticExecutionPayload: _.semanticExecutionPayload
|
|
1762
|
+
}), Ae(), i && Fe(), Ie("close"), le(!1), he();
|
|
1763
|
+
}, Ar = () => {
|
|
1764
|
+
_ && (qe(_.dashboard, {
|
|
1765
|
+
semanticExecutionPayload: _.semanticExecutionPayload
|
|
1766
1766
|
}), he());
|
|
1767
|
-
},
|
|
1767
|
+
}, Or = () => {
|
|
1768
1768
|
if (ce) {
|
|
1769
|
-
if (I &&
|
|
1770
|
-
|
|
1769
|
+
if (I && gt()) {
|
|
1770
|
+
Ie("home"), le(!0);
|
|
1771
1771
|
return;
|
|
1772
1772
|
}
|
|
1773
|
-
|
|
1773
|
+
Fe();
|
|
1774
1774
|
}
|
|
1775
1775
|
};
|
|
1776
|
-
async function
|
|
1777
|
-
if (
|
|
1776
|
+
async function We(i) {
|
|
1777
|
+
if (m)
|
|
1778
1778
|
return;
|
|
1779
|
-
const
|
|
1780
|
-
if (!
|
|
1779
|
+
const R = C.getState().dashboard;
|
|
1780
|
+
if (!R)
|
|
1781
1781
|
return;
|
|
1782
|
-
const
|
|
1783
|
-
|
|
1784
|
-
const
|
|
1785
|
-
|
|
1786
|
-
const
|
|
1787
|
-
template:
|
|
1782
|
+
const T = (i == null ? void 0 : i.closeAfterSave) ?? lt, te = (i == null ? void 0 : i.navigateHomeAfterSave) ?? !1;
|
|
1783
|
+
De(T), T && le(!1);
|
|
1784
|
+
const Pr = at(R);
|
|
1785
|
+
H(!0), K(null), Q([]), Ve(!0);
|
|
1786
|
+
const Tr = {
|
|
1787
|
+
template: R
|
|
1788
1788
|
};
|
|
1789
1789
|
ue.mutate(
|
|
1790
1790
|
{
|
|
1791
|
-
resourceId:
|
|
1792
|
-
data:
|
|
1791
|
+
resourceId: R.id,
|
|
1792
|
+
data: Tr
|
|
1793
1793
|
},
|
|
1794
1794
|
{
|
|
1795
1795
|
onSuccess: () => {
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1796
|
+
Ve(!1), br(), D.success("Dashboard saved!"), me(
|
|
1797
|
+
Bt(
|
|
1798
|
+
Pr,
|
|
1799
1799
|
C.getState().semanticExecutionPayload
|
|
1800
1800
|
)
|
|
1801
|
-
),
|
|
1801
|
+
), H(!1), De(!1), T && (Ae(), he(), te && ce && Fe()), Ie("close");
|
|
1802
1802
|
},
|
|
1803
|
-
onError: (
|
|
1804
|
-
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1807
|
-
) ? (
|
|
1808
|
-
(
|
|
1803
|
+
onError: (Rr) => {
|
|
1804
|
+
Ve(!1), K("Failed to save dashboard. Please try again.");
|
|
1805
|
+
const Me = Rr.details, Ur = Array.isArray(
|
|
1806
|
+
Me == null ? void 0 : Me.errors
|
|
1807
|
+
) ? (Me.errors || []).filter(
|
|
1808
|
+
($r) => typeof $r == "string"
|
|
1809
1809
|
) : [];
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
errors:
|
|
1813
|
-
dashboard:
|
|
1810
|
+
Q(
|
|
1811
|
+
vs({
|
|
1812
|
+
errors: Ur,
|
|
1813
|
+
dashboard: R || void 0
|
|
1814
1814
|
})
|
|
1815
1815
|
), D.error("Failed to save dashboard");
|
|
1816
1816
|
}
|
|
1817
1817
|
}
|
|
1818
1818
|
);
|
|
1819
1819
|
}
|
|
1820
|
-
const
|
|
1820
|
+
const vt = b.title;
|
|
1821
1821
|
ue.isPending && console.log("Title during update:", {
|
|
1822
|
-
title:
|
|
1822
|
+
title: vt,
|
|
1823
1823
|
dashboardStateTitle: b.title,
|
|
1824
1824
|
dashboardId: b == null ? void 0 : b.id
|
|
1825
1825
|
});
|
|
1826
|
-
const
|
|
1827
|
-
(kt =
|
|
1826
|
+
const Lr = ce && !!(t != null && t.accessToken) && !!(a != null && a.apiServiceUrl), Mr = !m && W.showDashboardHub && Lr, _r = !m && p && W.showDashboardHub, Y = (b == null ? void 0 : b.id) || null, yt = ba(
|
|
1827
|
+
(kt = a.config) == null ? void 0 : kt.showBriefings,
|
|
1828
1828
|
r
|
|
1829
|
-
),
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
return !p && !T ? null : /* @__PURE__ */ s(
|
|
1829
|
+
), Le = rn(Y);
|
|
1830
|
+
if (!p && !U)
|
|
1831
|
+
return null;
|
|
1832
|
+
const Ye = !U && p && !m;
|
|
1833
|
+
return /* @__PURE__ */ e(an, { width: O.width, hasOverflowMenu: Ye, children: /* @__PURE__ */ o(
|
|
1835
1834
|
"div",
|
|
1836
1835
|
{
|
|
1837
|
-
|
|
1836
|
+
ref: O.measure,
|
|
1837
|
+
className: "flex min-h-11 shrink-0 items-center gap-2 border-b px-3 py-1.5",
|
|
1838
1838
|
role: "dashboard-controls",
|
|
1839
1839
|
children: [
|
|
1840
|
-
/* @__PURE__ */
|
|
1841
|
-
|
|
1840
|
+
/* @__PURE__ */ o("div", { className: "flex min-w-[80px] flex-1 items-center gap-2", children: [
|
|
1841
|
+
_r && !U && /* @__PURE__ */ e(
|
|
1842
1842
|
gn,
|
|
1843
1843
|
{
|
|
1844
1844
|
"aria-label": "Dashboard Hub",
|
|
1845
1845
|
tooltip: "Dashboard Hub",
|
|
1846
|
-
onClick:
|
|
1846
|
+
onClick: Or,
|
|
1847
1847
|
className: "h-7 w-7 px-0",
|
|
1848
1848
|
buttonProps: { size: "xs" },
|
|
1849
|
-
children: /* @__PURE__ */ e(
|
|
1849
|
+
children: /* @__PURE__ */ e(ga, { className: "h-3.5 w-3.5" })
|
|
1850
1850
|
}
|
|
1851
1851
|
),
|
|
1852
|
-
!
|
|
1852
|
+
!U && p && (x ? /* @__PURE__ */ e(
|
|
1853
1853
|
"div",
|
|
1854
1854
|
{
|
|
1855
1855
|
className: "h-4 w-28 animate-pulse rounded-md bg-muted/70",
|
|
@@ -1857,23 +1857,23 @@ function ts() {
|
|
|
1857
1857
|
role: "status",
|
|
1858
1858
|
children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Loading dashboard title" })
|
|
1859
1859
|
}
|
|
1860
|
-
) : /* @__PURE__ */
|
|
1860
|
+
) : /* @__PURE__ */ o("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
1861
1861
|
/* @__PURE__ */ e(
|
|
1862
|
-
|
|
1862
|
+
xa,
|
|
1863
1863
|
{
|
|
1864
|
-
value:
|
|
1864
|
+
value: vt || "Untitled Dashboard",
|
|
1865
1865
|
onSave: (i) => {
|
|
1866
1866
|
console.log("EditableText onSave called:", {
|
|
1867
1867
|
newTitle: i,
|
|
1868
|
-
canEditDashboard:
|
|
1868
|
+
canEditDashboard: h,
|
|
1869
1869
|
dashboardId: b == null ? void 0 : b.id
|
|
1870
1870
|
});
|
|
1871
|
-
const
|
|
1872
|
-
|
|
1871
|
+
const R = (b == null ? void 0 : b.title) || "";
|
|
1872
|
+
X(i), wr(i, R);
|
|
1873
1873
|
},
|
|
1874
|
-
isEditable:
|
|
1874
|
+
isEditable: va({
|
|
1875
1875
|
isDashboardEditing: I,
|
|
1876
|
-
canEditDashboard:
|
|
1876
|
+
canEditDashboard: h === !0 && !m
|
|
1877
1877
|
}),
|
|
1878
1878
|
displayClassName: "text-[13px] font-medium",
|
|
1879
1879
|
inputClassName: "text-[13px] font-medium",
|
|
@@ -1881,228 +1881,241 @@ function ts() {
|
|
|
1881
1881
|
isPending: ue.isPending
|
|
1882
1882
|
}
|
|
1883
1883
|
),
|
|
1884
|
-
|
|
1885
|
-
"span",
|
|
1886
|
-
{
|
|
1887
|
-
className: "shrink-0 rounded-[4px] border border-border/60 px-1.5 py-px text-[10px] font-medium uppercase tracking-[0.06em] text-muted-foreground",
|
|
1888
|
-
title: "Default dashboard",
|
|
1889
|
-
children: "Default"
|
|
1890
|
-
}
|
|
1891
|
-
),
|
|
1892
|
-
Ur && G && /* @__PURE__ */ e(Ot, { children: /* @__PURE__ */ s(Mt, { children: [
|
|
1893
|
-
/* @__PURE__ */ e(Pt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1894
|
-
U,
|
|
1895
|
-
{
|
|
1896
|
-
variant: "ghost",
|
|
1897
|
-
size: "xs",
|
|
1898
|
-
onClick: Br,
|
|
1899
|
-
disabled: wr || !(t != null && t.accessToken) || !(n != null && n.apiServiceUrl),
|
|
1900
|
-
className: ge(
|
|
1901
|
-
"w-7 px-0",
|
|
1902
|
-
ee ? "bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary focus-visible:bg-primary/15" : "text-muted-foreground hover:text-foreground"
|
|
1903
|
-
),
|
|
1904
|
-
"aria-pressed": ee,
|
|
1905
|
-
"aria-label": ee ? "Remove as default dashboard" : "Set as default dashboard",
|
|
1906
|
-
children: /* @__PURE__ */ e(Ia, { className: "h-3.5 w-3.5" })
|
|
1907
|
-
}
|
|
1908
|
-
) }),
|
|
1909
|
-
/* @__PURE__ */ e(_t, { children: /* @__PURE__ */ e("p", { children: ee ? "Remove as default dashboard" : "Set as default dashboard" }) })
|
|
1910
|
-
] }) })
|
|
1884
|
+
!m && Y && /* @__PURE__ */ e(nn, { dashboardId: Y })
|
|
1911
1885
|
] }))
|
|
1912
1886
|
] }),
|
|
1913
|
-
/* @__PURE__ */
|
|
1914
|
-
|
|
1915
|
-
/* @__PURE__ */
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
/* @__PURE__ */
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
variant: "ghost",
|
|
1925
|
-
size: "xs",
|
|
1926
|
-
disabled: !I,
|
|
1927
|
-
onClick: () => void kr(),
|
|
1928
|
-
className: "h-full rounded-none border-0 shadow-none hover:bg-accent",
|
|
1929
|
-
children: [
|
|
1930
|
-
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
|
|
1931
|
-
"Visual"
|
|
1932
|
-
]
|
|
1933
|
-
}
|
|
1934
|
-
),
|
|
1935
|
-
/* @__PURE__ */ s(Dt, { modal: !1, children: [
|
|
1936
|
-
/* @__PURE__ */ e(Et, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1937
|
-
U,
|
|
1887
|
+
/* @__PURE__ */ o("div", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
1888
|
+
/* @__PURE__ */ o("div", { className: "-m-1 flex min-w-0 items-center gap-1.5 overflow-x-auto p-1 [scrollbar-width:thin] [&>*]:shrink-0", children: [
|
|
1889
|
+
U && /* @__PURE__ */ o($, { children: [
|
|
1890
|
+
/* @__PURE__ */ e(sn, {}),
|
|
1891
|
+
/* @__PURE__ */ e(on, {})
|
|
1892
|
+
] }),
|
|
1893
|
+
p && !m && /* @__PURE__ */ e(vn, {}),
|
|
1894
|
+
!U && I && !m && l.canUseFilters && p && /* @__PURE__ */ e(dn, {}),
|
|
1895
|
+
I && !U && !m && p && !k && /* @__PURE__ */ o("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
|
|
1896
|
+
/* @__PURE__ */ o(
|
|
1897
|
+
G,
|
|
1938
1898
|
{
|
|
1939
1899
|
variant: "ghost",
|
|
1940
1900
|
size: "xs",
|
|
1941
|
-
className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
|
|
1942
|
-
"aria-label": "Open visual options",
|
|
1943
1901
|
disabled: !I,
|
|
1944
|
-
|
|
1902
|
+
onClick: () => void vr(),
|
|
1903
|
+
"aria-label": O.width === "sm" ? "Add visual" : void 0,
|
|
1904
|
+
title: O.width === "sm" ? "Add visual" : void 0,
|
|
1905
|
+
className: xe(
|
|
1906
|
+
"h-full rounded-none border-0 shadow-none hover:bg-accent",
|
|
1907
|
+
O.width === "sm" && "w-7 px-0"
|
|
1908
|
+
),
|
|
1909
|
+
children: [
|
|
1910
|
+
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
|
|
1911
|
+
O.width !== "sm" && "Visual"
|
|
1912
|
+
]
|
|
1945
1913
|
}
|
|
1946
|
-
)
|
|
1914
|
+
),
|
|
1915
|
+
/* @__PURE__ */ o(Dt, { modal: !1, children: [
|
|
1916
|
+
/* @__PURE__ */ e(Ht, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1917
|
+
G,
|
|
1918
|
+
{
|
|
1919
|
+
variant: "ghost",
|
|
1920
|
+
size: "xs",
|
|
1921
|
+
className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
|
|
1922
|
+
"aria-label": "Open visual options",
|
|
1923
|
+
disabled: !I,
|
|
1924
|
+
children: /* @__PURE__ */ e(Za, { className: "h-3.5 w-3.5" })
|
|
1925
|
+
}
|
|
1926
|
+
) }),
|
|
1927
|
+
/* @__PURE__ */ e(
|
|
1928
|
+
Et,
|
|
1929
|
+
{
|
|
1930
|
+
align: "end",
|
|
1931
|
+
className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
1932
|
+
children: /* @__PURE__ */ o(P, { onClick: () => ut(!0), children: [
|
|
1933
|
+
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
|
|
1934
|
+
"From library..."
|
|
1935
|
+
] })
|
|
1936
|
+
}
|
|
1937
|
+
)
|
|
1938
|
+
] }),
|
|
1947
1939
|
/* @__PURE__ */ e(
|
|
1948
|
-
|
|
1940
|
+
cn,
|
|
1949
1941
|
{
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
children: /* @__PURE__ */ s(R, { onClick: () => lt(!0), children: [
|
|
1953
|
-
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5" }),
|
|
1954
|
-
"From library..."
|
|
1955
|
-
] })
|
|
1942
|
+
open: hr,
|
|
1943
|
+
onOpenChange: ut
|
|
1956
1944
|
}
|
|
1957
1945
|
)
|
|
1958
1946
|
] }),
|
|
1959
|
-
/* @__PURE__ */ e(
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
onOpenChange: lt
|
|
1964
|
-
}
|
|
1965
|
-
)
|
|
1966
|
-
] }),
|
|
1967
|
-
!h && p && /* @__PURE__ */ e(un, {}),
|
|
1968
|
-
!T && !I && (m || h) && (!c || !g || m !== void 0) && p && /* @__PURE__ */ s("div", { className: "inline-flex items-center gap-1", children: [
|
|
1969
|
-
/* @__PURE__ */ s(U, { size: "xs", onClick: Ar, children: [
|
|
1970
|
-
/* @__PURE__ */ e(Aa, { className: "h-3.5 w-3.5" }),
|
|
1971
|
-
h ? "Inspect" : "Edit"
|
|
1972
|
-
] }),
|
|
1973
|
-
v ? /* @__PURE__ */ e(Ot, { children: /* @__PURE__ */ s(Mt, { children: [
|
|
1974
|
-
/* @__PURE__ */ e(Pt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1975
|
-
"button",
|
|
1947
|
+
!m && p && /* @__PURE__ */ e(ln, {}),
|
|
1948
|
+
!U && !I && (h || m) && (!c || !g || h !== void 0) && p && /* @__PURE__ */ o("div", { className: "inline-flex items-center gap-1", children: [
|
|
1949
|
+
/* @__PURE__ */ o(
|
|
1950
|
+
G,
|
|
1976
1951
|
{
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1952
|
+
size: "xs",
|
|
1953
|
+
onClick: kr,
|
|
1954
|
+
"aria-label": m ? "Inspect" : "Edit",
|
|
1955
|
+
title: O.width === "sm" ? m ? "Inspect" : "Edit" : void 0,
|
|
1956
|
+
className: O.width === "sm" ? "w-7 px-0" : void 0,
|
|
1957
|
+
children: [
|
|
1958
|
+
/* @__PURE__ */ e(ya, { className: "h-3.5 w-3.5" }),
|
|
1959
|
+
O.width !== "sm" && (m ? "Inspect" : "Edit")
|
|
1960
|
+
]
|
|
1981
1961
|
}
|
|
1982
|
-
)
|
|
1983
|
-
/* @__PURE__ */ e(
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
1962
|
+
),
|
|
1963
|
+
v ? /* @__PURE__ */ e(Qa, { children: /* @__PURE__ */ o(Wa, { children: [
|
|
1964
|
+
/* @__PURE__ */ e(Ya, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1965
|
+
"button",
|
|
1966
|
+
{
|
|
1967
|
+
type: "button",
|
|
1968
|
+
"aria-label": v,
|
|
1969
|
+
className: "inline-flex size-6 items-center justify-center rounded-control text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
1970
|
+
children: /* @__PURE__ */ e(Ja, { "aria-hidden": "true", className: "size-3.5" })
|
|
1971
|
+
}
|
|
1972
|
+
) }),
|
|
1973
|
+
/* @__PURE__ */ e(Xa, { children: /* @__PURE__ */ e("p", { children: v }) })
|
|
1974
|
+
] }) }) : null
|
|
1975
|
+
] }),
|
|
1976
|
+
He && p && Qe && /* @__PURE__ */ e(
|
|
1977
|
+
Ds,
|
|
1978
|
+
{
|
|
1979
|
+
saved: Ke,
|
|
1980
|
+
draft: b,
|
|
1981
|
+
enabled: I && !m
|
|
1982
|
+
}
|
|
1983
|
+
),
|
|
1984
|
+
He && p && Qe && /* @__PURE__ */ o(
|
|
1985
|
+
G,
|
|
1986
|
+
{
|
|
1987
|
+
variant: "outline",
|
|
1988
|
+
size: "xs",
|
|
1989
|
+
onClick: Ar,
|
|
1990
|
+
disabled: Oe,
|
|
1991
|
+
"aria-label": "Undo",
|
|
1992
|
+
title: O.width === "sm" ? "Undo" : void 0,
|
|
1993
|
+
className: O.width === "sm" ? "w-7 px-0" : void 0,
|
|
1994
|
+
children: [
|
|
1995
|
+
/* @__PURE__ */ e(wa, { className: "h-3.5 w-3.5" }),
|
|
1996
|
+
O.width !== "sm" && "Undo"
|
|
1997
|
+
]
|
|
1998
|
+
}
|
|
1999
|
+
),
|
|
2000
|
+
He && p && /* @__PURE__ */ o(
|
|
2001
|
+
G,
|
|
2002
|
+
{
|
|
2003
|
+
size: "xs",
|
|
2004
|
+
className: xe(!xt && "opacity-60"),
|
|
2005
|
+
disabled: Oe || !xt,
|
|
2006
|
+
onClick: () => We(),
|
|
2007
|
+
children: [
|
|
2008
|
+
Oe ? /* @__PURE__ */ e(Re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Mn, { className: "h-3.5 w-3.5" }),
|
|
2009
|
+
Oe ? "Saving..." : "Save"
|
|
2010
|
+
]
|
|
2011
|
+
}
|
|
2012
|
+
),
|
|
2013
|
+
I && !U && p && /* @__PURE__ */ o(
|
|
2014
|
+
G,
|
|
2032
2015
|
{
|
|
2033
|
-
variant: "
|
|
2016
|
+
variant: "outline",
|
|
2034
2017
|
size: "xs",
|
|
2035
|
-
|
|
2036
|
-
"aria-label": "
|
|
2037
|
-
|
|
2018
|
+
onClick: Dr,
|
|
2019
|
+
"aria-label": "Close",
|
|
2020
|
+
title: O.width === "sm" ? "Close" : void 0,
|
|
2021
|
+
className: O.width === "sm" ? "w-7 px-0" : void 0,
|
|
2022
|
+
children: [
|
|
2023
|
+
/* @__PURE__ */ e(Na, { className: "h-3.5 w-3.5" }),
|
|
2024
|
+
O.width !== "sm" && "Close"
|
|
2025
|
+
]
|
|
2038
2026
|
}
|
|
2039
|
-
)
|
|
2040
|
-
|
|
2041
|
-
|
|
2027
|
+
)
|
|
2028
|
+
] }),
|
|
2029
|
+
!U && p && /* @__PURE__ */ o($, { children: [
|
|
2030
|
+
/* @__PURE__ */ e(un, {}),
|
|
2031
|
+
f && h === !0 && !m && /* @__PURE__ */ e(mn, {})
|
|
2032
|
+
] }),
|
|
2033
|
+
!U && d && O.width === "lg" && /* @__PURE__ */ e(Vn, {}),
|
|
2034
|
+
Ye && /* @__PURE__ */ e(hn, {}),
|
|
2035
|
+
Ye && /* @__PURE__ */ o(Dt, { children: [
|
|
2036
|
+
/* @__PURE__ */ e(Es, {}),
|
|
2037
|
+
/* @__PURE__ */ o(
|
|
2038
|
+
Et,
|
|
2042
2039
|
{
|
|
2043
2040
|
align: "end",
|
|
2044
2041
|
className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
|
|
2045
2042
|
children: [
|
|
2046
|
-
/* @__PURE__ */ e(
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
|
|
2043
|
+
/* @__PURE__ */ e(Is, {}),
|
|
2044
|
+
Le.available && Mr && /* @__PURE__ */ o($, { children: [
|
|
2045
|
+
/* @__PURE__ */ o(
|
|
2046
|
+
P,
|
|
2047
|
+
{
|
|
2048
|
+
disabled: Le.disabled,
|
|
2049
|
+
onSelect: Le.toggle,
|
|
2050
|
+
children: [
|
|
2051
|
+
/* @__PURE__ */ e(Sa, { className: "h-3.5 w-3.5" }),
|
|
2052
|
+
/* @__PURE__ */ e("span", { className: "flex-1", children: "Default dashboard" }),
|
|
2053
|
+
Le.isDefault && /* @__PURE__ */ e(qt, { className: "h-3.5 w-3.5" })
|
|
2054
|
+
]
|
|
2055
|
+
}
|
|
2056
|
+
),
|
|
2057
|
+
/* @__PURE__ */ e(be, {})
|
|
2058
|
+
] }),
|
|
2059
|
+
/* @__PURE__ */ e(Pe, { children: "Reports & briefings" }),
|
|
2060
|
+
/* @__PURE__ */ o(
|
|
2061
|
+
P,
|
|
2049
2062
|
{
|
|
2050
2063
|
disabled: S,
|
|
2051
2064
|
onSelect: () => y(!0),
|
|
2052
2065
|
children: [
|
|
2053
|
-
/* @__PURE__ */ e(
|
|
2066
|
+
/* @__PURE__ */ e(ka, { className: "h-3.5 w-3.5" }),
|
|
2054
2067
|
"Export"
|
|
2055
2068
|
]
|
|
2056
2069
|
}
|
|
2057
2070
|
),
|
|
2058
2071
|
/* @__PURE__ */ e(
|
|
2059
|
-
|
|
2072
|
+
ws,
|
|
2060
2073
|
{
|
|
2061
|
-
scheduleReportVisible: !!(
|
|
2062
|
-
analyticalBriefingVisible: !!(
|
|
2063
|
-
onScheduleReport: () =>
|
|
2064
|
-
onCreateAnalyticalBriefing: () =>
|
|
2074
|
+
scheduleReportVisible: !!(yt && s.surfaceVisible && Y && !I),
|
|
2075
|
+
analyticalBriefingVisible: !!(yt && s.surfaceVisible && Y && !I),
|
|
2076
|
+
onScheduleReport: () => Z("scheduled_report"),
|
|
2077
|
+
onCreateAnalyticalBriefing: () => Z("analytical_briefing")
|
|
2065
2078
|
}
|
|
2066
2079
|
),
|
|
2067
|
-
I && /* @__PURE__ */
|
|
2068
|
-
|
|
2080
|
+
I && /* @__PURE__ */ o(
|
|
2081
|
+
P,
|
|
2069
2082
|
{
|
|
2070
|
-
onSelect: () =>
|
|
2083
|
+
onSelect: () => oe(!0),
|
|
2071
2084
|
children: [
|
|
2072
|
-
/* @__PURE__ */ e(
|
|
2085
|
+
/* @__PURE__ */ e(Ca, { className: "h-3.5 w-3.5" }),
|
|
2073
2086
|
"Download settings"
|
|
2074
2087
|
]
|
|
2075
2088
|
}
|
|
2076
2089
|
),
|
|
2077
|
-
/* @__PURE__ */ e(
|
|
2078
|
-
(
|
|
2079
|
-
/* @__PURE__ */ e(
|
|
2080
|
-
|
|
2081
|
-
/* @__PURE__ */ e(
|
|
2090
|
+
/* @__PURE__ */ e(be, {}),
|
|
2091
|
+
(W.showDashboardSharing || W.showGroupManagement) && /* @__PURE__ */ o($, { children: [
|
|
2092
|
+
/* @__PURE__ */ e(Pe, { children: "Access" }),
|
|
2093
|
+
W.showDashboardSharing && /* @__PURE__ */ o(P, { onSelect: () => j(!0), children: [
|
|
2094
|
+
/* @__PURE__ */ e(Da, { className: "h-3.5 w-3.5" }),
|
|
2082
2095
|
"Share"
|
|
2083
2096
|
] }),
|
|
2084
|
-
|
|
2085
|
-
|
|
2097
|
+
W.showGroupManagement && /* @__PURE__ */ o(
|
|
2098
|
+
P,
|
|
2086
2099
|
{
|
|
2087
2100
|
onClick: () => z(!0),
|
|
2088
2101
|
children: [
|
|
2089
|
-
/* @__PURE__ */ e(
|
|
2102
|
+
/* @__PURE__ */ e(jt, { className: "h-3.5 w-3.5" }),
|
|
2090
2103
|
"Manage Groups"
|
|
2091
2104
|
]
|
|
2092
2105
|
}
|
|
2093
2106
|
),
|
|
2094
|
-
/* @__PURE__ */ e(
|
|
2107
|
+
/* @__PURE__ */ e(be, {})
|
|
2095
2108
|
] }),
|
|
2096
|
-
/* @__PURE__ */ e(
|
|
2097
|
-
/* @__PURE__ */
|
|
2098
|
-
/* @__PURE__ */ e(
|
|
2109
|
+
/* @__PURE__ */ e(Pe, { children: "Preferences" }),
|
|
2110
|
+
/* @__PURE__ */ o(P, { onClick: () => se(!0), children: [
|
|
2111
|
+
/* @__PURE__ */ e(zt, { className: "h-3.5 w-3.5" }),
|
|
2099
2112
|
"Report preferences"
|
|
2100
2113
|
] }),
|
|
2101
|
-
d && p && /* @__PURE__ */
|
|
2102
|
-
/* @__PURE__ */ e(
|
|
2103
|
-
/* @__PURE__ */ e(
|
|
2104
|
-
/* @__PURE__ */
|
|
2105
|
-
|
|
2114
|
+
d && p && /* @__PURE__ */ o($, { children: [
|
|
2115
|
+
/* @__PURE__ */ e(be, {}),
|
|
2116
|
+
/* @__PURE__ */ e(Pe, { children: "Developer" }),
|
|
2117
|
+
/* @__PURE__ */ o(
|
|
2118
|
+
P,
|
|
2106
2119
|
{
|
|
2107
2120
|
onSelect: () => {
|
|
2108
2121
|
var i;
|
|
@@ -2111,24 +2124,24 @@ function ts() {
|
|
|
2111
2124
|
).catch(() => D.error("Unable to copy token")) : D.error("Clipboard not available"));
|
|
2112
2125
|
},
|
|
2113
2126
|
children: [
|
|
2114
|
-
/* @__PURE__ */ e(
|
|
2127
|
+
/* @__PURE__ */ e(It, { className: "h-3.5 w-3.5" }),
|
|
2115
2128
|
"Copy token"
|
|
2116
2129
|
]
|
|
2117
2130
|
}
|
|
2118
2131
|
),
|
|
2119
|
-
k && /* @__PURE__ */
|
|
2120
|
-
|
|
2132
|
+
k && /* @__PURE__ */ o(
|
|
2133
|
+
P,
|
|
2121
2134
|
{
|
|
2122
|
-
disabled: !
|
|
2135
|
+
disabled: !ze,
|
|
2123
2136
|
onSelect: () => {
|
|
2124
2137
|
var i;
|
|
2125
|
-
if (!
|
|
2138
|
+
if (!ze) {
|
|
2126
2139
|
D.error(
|
|
2127
2140
|
"Open a document sheet with a token to copy the local PDF URL"
|
|
2128
2141
|
);
|
|
2129
2142
|
return;
|
|
2130
2143
|
}
|
|
2131
|
-
(i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(
|
|
2144
|
+
(i = navigator == null ? void 0 : navigator.clipboard) != null && i.writeText ? navigator.clipboard.writeText(ze).then(
|
|
2132
2145
|
() => D.success(
|
|
2133
2146
|
"Local document PDF URL copied to clipboard"
|
|
2134
2147
|
)
|
|
@@ -2139,32 +2152,32 @@ function ts() {
|
|
|
2139
2152
|
) : D.error("Clipboard not available");
|
|
2140
2153
|
},
|
|
2141
2154
|
children: [
|
|
2142
|
-
/* @__PURE__ */ e(
|
|
2155
|
+
/* @__PURE__ */ e(It, { className: "h-3.5 w-3.5" }),
|
|
2143
2156
|
"Copy local document PDF URL"
|
|
2144
2157
|
]
|
|
2145
2158
|
}
|
|
2146
2159
|
),
|
|
2147
|
-
/* @__PURE__ */
|
|
2148
|
-
|
|
2160
|
+
/* @__PURE__ */ o(
|
|
2161
|
+
P,
|
|
2149
2162
|
{
|
|
2150
|
-
onSelect: () => pn(
|
|
2163
|
+
onSelect: () => pn(a.apiServiceUrl),
|
|
2151
2164
|
children: [
|
|
2152
2165
|
/* @__PURE__ */ e(Rn, { className: "h-3.5 w-3.5" }),
|
|
2153
2166
|
"Invalidate token"
|
|
2154
2167
|
]
|
|
2155
2168
|
}
|
|
2156
2169
|
),
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
/* @__PURE__ */ e(
|
|
2170
|
+
/* @__PURE__ */ o(P, { onSelect: u, children: [
|
|
2171
|
+
/* @__PURE__ */ e(_n, { className: "h-3.5 w-3.5" }),
|
|
2159
2172
|
"Brand Studio"
|
|
2160
2173
|
] }),
|
|
2161
|
-
I && /* @__PURE__ */
|
|
2162
|
-
|
|
2174
|
+
I && /* @__PURE__ */ o(
|
|
2175
|
+
P,
|
|
2163
2176
|
{
|
|
2164
|
-
onSelect: () =>
|
|
2177
|
+
onSelect: () => pt(!mt),
|
|
2165
2178
|
children: [
|
|
2166
2179
|
/* @__PURE__ */ e(Pn, { className: "h-3.5 w-3.5" }),
|
|
2167
|
-
|
|
2180
|
+
mt ? "Hide dashboard JSON" : "Show dashboard JSON"
|
|
2168
2181
|
]
|
|
2169
2182
|
}
|
|
2170
2183
|
)
|
|
@@ -2173,96 +2186,96 @@ function ts() {
|
|
|
2173
2186
|
}
|
|
2174
2187
|
)
|
|
2175
2188
|
] }),
|
|
2176
|
-
|
|
2177
|
-
|
|
2189
|
+
$e && bt && /* @__PURE__ */ e(
|
|
2190
|
+
Ea,
|
|
2178
2191
|
{
|
|
2179
|
-
resource:
|
|
2180
|
-
resourceType:
|
|
2181
|
-
onClose: () =>
|
|
2192
|
+
resource: bt,
|
|
2193
|
+
resourceType: Je.DASHBOARD,
|
|
2194
|
+
onClose: () => j(!1)
|
|
2182
2195
|
}
|
|
2183
2196
|
),
|
|
2184
|
-
|
|
2185
|
-
|
|
2197
|
+
W.showGroupManagement && /* @__PURE__ */ e(
|
|
2198
|
+
ls,
|
|
2186
2199
|
{
|
|
2187
2200
|
open: ae,
|
|
2188
2201
|
onOpenChange: z
|
|
2189
2202
|
}
|
|
2190
2203
|
),
|
|
2191
2204
|
/* @__PURE__ */ e(
|
|
2192
|
-
|
|
2205
|
+
yn,
|
|
2193
2206
|
{
|
|
2194
2207
|
open: ne,
|
|
2195
|
-
onOpenChange:
|
|
2208
|
+
onOpenChange: se
|
|
2196
2209
|
}
|
|
2197
2210
|
),
|
|
2198
2211
|
/* @__PURE__ */ e(
|
|
2199
|
-
|
|
2212
|
+
xs,
|
|
2200
2213
|
{
|
|
2201
|
-
open:
|
|
2202
|
-
onOpenChange:
|
|
2214
|
+
open: Be,
|
|
2215
|
+
onOpenChange: oe
|
|
2203
2216
|
}
|
|
2204
2217
|
),
|
|
2205
|
-
|
|
2218
|
+
Y && (Se || ie) ? /* @__PURE__ */ e(
|
|
2206
2219
|
fn,
|
|
2207
2220
|
{
|
|
2208
|
-
dashboardId:
|
|
2221
|
+
dashboardId: Y,
|
|
2209
2222
|
dashboardTitle: (b == null ? void 0 : b.title) || (F == null ? void 0 : F.title),
|
|
2210
2223
|
open: !0,
|
|
2211
2224
|
onOpenChange: (i) => {
|
|
2212
|
-
i || (
|
|
2225
|
+
i || (Z(null), ke(null));
|
|
2213
2226
|
},
|
|
2214
2227
|
hideTrigger: !0,
|
|
2215
|
-
workflowIntent:
|
|
2228
|
+
workflowIntent: Se ?? void 0,
|
|
2216
2229
|
openRun: ie ?? void 0
|
|
2217
2230
|
}
|
|
2218
2231
|
) : null,
|
|
2219
2232
|
p && /* @__PURE__ */ e(
|
|
2220
|
-
|
|
2233
|
+
Ia,
|
|
2221
2234
|
{
|
|
2222
|
-
open:
|
|
2235
|
+
open: ee,
|
|
2223
2236
|
onOpenChange: y
|
|
2224
2237
|
}
|
|
2225
2238
|
),
|
|
2226
2239
|
/* @__PURE__ */ e(
|
|
2227
|
-
|
|
2240
|
+
Aa,
|
|
2228
2241
|
{
|
|
2229
2242
|
open: B,
|
|
2230
2243
|
onOpenChange: (i) => {
|
|
2231
|
-
!i &&
|
|
2244
|
+
!i && Ge && !q || (H(i), i || (K(null), Q([]), De(!1)));
|
|
2232
2245
|
},
|
|
2233
|
-
children: /* @__PURE__ */
|
|
2234
|
-
/* @__PURE__ */
|
|
2235
|
-
/* @__PURE__ */ e(
|
|
2236
|
-
/* @__PURE__ */ e(
|
|
2237
|
-
de.length > 0 && /* @__PURE__ */
|
|
2246
|
+
children: /* @__PURE__ */ o(Oa, { className: "max-w-sm", children: [
|
|
2247
|
+
/* @__PURE__ */ o(La, { children: [
|
|
2248
|
+
/* @__PURE__ */ e(Ma, { children: q ? "Save failed" : "Saving dashboard" }),
|
|
2249
|
+
/* @__PURE__ */ e(_a, { className: "pt-2", children: q ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
|
|
2250
|
+
de.length > 0 && /* @__PURE__ */ o("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
|
|
2238
2251
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
|
|
2239
2252
|
/* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: de.slice(0, 5).map((i) => /* @__PURE__ */ e("li", { children: i }, i)) })
|
|
2240
2253
|
] })
|
|
2241
2254
|
] }),
|
|
2242
|
-
/* @__PURE__ */ e(
|
|
2255
|
+
/* @__PURE__ */ e(Pa, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: q ? /* @__PURE__ */ o($, { children: [
|
|
2243
2256
|
/* @__PURE__ */ e(
|
|
2244
|
-
|
|
2257
|
+
Ta,
|
|
2245
2258
|
{
|
|
2246
2259
|
onClick: () => {
|
|
2247
|
-
|
|
2260
|
+
H(!1), K(null), Q([]), De(!1);
|
|
2248
2261
|
},
|
|
2249
2262
|
className: "m-0",
|
|
2250
2263
|
children: "Close"
|
|
2251
2264
|
}
|
|
2252
2265
|
),
|
|
2253
2266
|
/* @__PURE__ */ e(
|
|
2254
|
-
|
|
2267
|
+
At,
|
|
2255
2268
|
{
|
|
2256
|
-
onClick: () =>
|
|
2257
|
-
closeAfterSave:
|
|
2258
|
-
navigateHomeAfterSave:
|
|
2269
|
+
onClick: () => We({
|
|
2270
|
+
closeAfterSave: lt,
|
|
2271
|
+
navigateHomeAfterSave: je === "home"
|
|
2259
2272
|
}),
|
|
2260
2273
|
className: "m-0",
|
|
2261
2274
|
children: "Retry"
|
|
2262
2275
|
}
|
|
2263
2276
|
)
|
|
2264
|
-
] }) : /* @__PURE__ */
|
|
2265
|
-
/* @__PURE__ */ e(
|
|
2277
|
+
] }) : /* @__PURE__ */ o(At, { disabled: !0, className: "m-0 cursor-default", children: [
|
|
2278
|
+
/* @__PURE__ */ e(Re, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2266
2279
|
"Saving..."
|
|
2267
2280
|
] }) })
|
|
2268
2281
|
] })
|
|
@@ -2271,13 +2284,13 @@ function ts() {
|
|
|
2271
2284
|
/* @__PURE__ */ e(
|
|
2272
2285
|
bn,
|
|
2273
2286
|
{
|
|
2274
|
-
open:
|
|
2287
|
+
open: yr,
|
|
2275
2288
|
onOpenChange: (i) => {
|
|
2276
2289
|
le(i);
|
|
2277
2290
|
},
|
|
2278
|
-
onSave:
|
|
2279
|
-
onDiscard:
|
|
2280
|
-
isSaving:
|
|
2291
|
+
onSave: Er,
|
|
2292
|
+
onDiscard: Ir,
|
|
2293
|
+
isSaving: Ge,
|
|
2281
2294
|
saveLabel: "Save",
|
|
2282
2295
|
discardLabel: "Discard changes"
|
|
2283
2296
|
}
|
|
@@ -2285,23 +2298,57 @@ function ts() {
|
|
|
2285
2298
|
] })
|
|
2286
2299
|
]
|
|
2287
2300
|
}
|
|
2288
|
-
);
|
|
2301
|
+
) });
|
|
2302
|
+
}
|
|
2303
|
+
function Es() {
|
|
2304
|
+
const t = Wt();
|
|
2305
|
+
return /* @__PURE__ */ e(Ht, { asChild: !0, children: /* @__PURE__ */ o(
|
|
2306
|
+
G,
|
|
2307
|
+
{
|
|
2308
|
+
variant: "ghost",
|
|
2309
|
+
size: "xs",
|
|
2310
|
+
className: "relative w-7 px-0",
|
|
2311
|
+
"aria-label": "More dashboard options",
|
|
2312
|
+
children: [
|
|
2313
|
+
/* @__PURE__ */ e(Ra, { className: "h-3.5 w-3.5" }),
|
|
2314
|
+
t.length > 0 && /* @__PURE__ */ e(
|
|
2315
|
+
"span",
|
|
2316
|
+
{
|
|
2317
|
+
"aria-hidden": !0,
|
|
2318
|
+
className: "pointer-events-none absolute right-0.5 top-0.5 h-1.5 w-1.5 rounded-full bg-muted-foreground/70"
|
|
2319
|
+
}
|
|
2320
|
+
)
|
|
2321
|
+
]
|
|
2322
|
+
}
|
|
2323
|
+
) });
|
|
2324
|
+
}
|
|
2325
|
+
function Is() {
|
|
2326
|
+
const t = Wt();
|
|
2327
|
+
return t.length === 0 ? null : /* @__PURE__ */ o($, { children: [
|
|
2328
|
+
t.map((a) => /* @__PURE__ */ o(P, { onSelect: a.onSelect, children: [
|
|
2329
|
+
a.icon,
|
|
2330
|
+
/* @__PURE__ */ e("span", { className: "flex-1", children: a.label }),
|
|
2331
|
+
a.hint && /* @__PURE__ */ e("span", { className: "text-[11px] text-muted-foreground", children: a.hint }),
|
|
2332
|
+
a.checked && /* @__PURE__ */ e(qt, { className: "h-3.5 w-3.5" })
|
|
2333
|
+
] }, a.id)),
|
|
2334
|
+
/* @__PURE__ */ e(be, {})
|
|
2335
|
+
] });
|
|
2289
2336
|
}
|
|
2290
|
-
function
|
|
2337
|
+
function As({
|
|
2291
2338
|
accessToken: t,
|
|
2292
|
-
dashboardId:
|
|
2293
|
-
selectedSheetId:
|
|
2339
|
+
dashboardId: a,
|
|
2340
|
+
selectedSheetId: n,
|
|
2294
2341
|
pageSize: r,
|
|
2295
|
-
orientation:
|
|
2342
|
+
orientation: s,
|
|
2296
2343
|
theme: d
|
|
2297
2344
|
}) {
|
|
2298
|
-
if (!t || !
|
|
2345
|
+
if (!t || !n)
|
|
2299
2346
|
return null;
|
|
2300
2347
|
const f = new URL("http://localhost:5173/print-document");
|
|
2301
|
-
f.searchParams.set("token", t),
|
|
2302
|
-
const
|
|
2303
|
-
return
|
|
2348
|
+
f.searchParams.set("token", t), a && f.searchParams.set("dashboardId", a), f.searchParams.set("selectedSheetId", n), d && f.searchParams.set("theme", d);
|
|
2349
|
+
const h = new URL("http://127.0.0.1:3002/");
|
|
2350
|
+
return h.searchParams.set("pdfMode", "document"), h.searchParams.set("pageSize", r || "letter"), h.searchParams.set("orientation", s || "portrait"), h.searchParams.set("url", f.toString()), h.toString();
|
|
2304
2351
|
}
|
|
2305
2352
|
export {
|
|
2306
|
-
|
|
2353
|
+
ao as default
|
|
2307
2354
|
};
|