react-semaphor 0.1.322 → 0.1.323
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{calendar-preferences-dialog-t0OOALVd.js → calendar-preferences-dialog-B9Hz3pTH.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-CZqePF6B.js → calendar-preferences-dialog-CLXaVo3h.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-d1_fm91W.js → dashboard-briefing-launcher-COLpvReF.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-BYbnbZ9e.js → dashboard-briefing-launcher-CUEn7cr6.js} +3 -3
- package/dist/chunks/{dashboard-controls-BuChCKDm.js → dashboard-controls-CLShFyUq.js} +858 -846
- package/dist/chunks/dashboard-controls-DH8gdpOc.js +52 -0
- package/dist/chunks/{dashboard-json-DgoYjD0O.js → dashboard-json-Db0DpTMw.js} +1 -1
- package/dist/chunks/{dashboard-json-M5-VFCtZ.js → dashboard-json-eGBWfSN1.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-BH8DP1qq.js → edit-dashboard-visual-Cc3xpTNQ.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DP31ytwJ.js → edit-dashboard-visual-DmMKWtln.js} +3 -3
- package/dist/chunks/{index-CodH6sqg.js → index-CMS4bp9G.js} +1 -1
- package/dist/chunks/{index-ChmS5nsv.js → index-PTx7430W.js} +4 -4
- package/dist/chunks/{resource-management-panel-gt__S0Pb.js → resource-management-panel-C1mbF-2a.js} +2 -2
- package/dist/chunks/{resource-management-panel-D3vO68dH.js → resource-management-panel-DR7Ku6sa.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-OA3iI54p.js → use-create-flow-overlay-state-B65gg2oB.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-BZaSpL-c.js → use-create-flow-overlay-state-CmxTpqeg.js} +1 -1
- package/dist/chunks/{use-visual-utils-CMucAqbS.js → use-visual-utils-51Nsy8cj.js} +1 -1
- package/dist/chunks/{use-visual-utils-CsXS-Zeh.js → use-visual-utils-Diuguy3D.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/dashboard-controls-B3HHMRPC.js +0 -52
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as t, jsxs as i, Fragment as
|
|
2
|
-
import { c as K, u as N, B as
|
|
3
|
-
import { bf as ea, u as
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
1
|
+
import { jsx as t, jsxs as i, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { c as K, u as N, B as _, az as dt, E as Vt, L as Hr, a1 as jr, a as te, aA as qr, aB as Vr, aC as rt, aD as me, aE as ct, aF as Kt, f as $e, X as Qt, aG as Wt, aH as Kr, G as Rt, Y as Qr, Z as Wr, _ as Jr, a0 as Yr, j as Xr, aI as Zr } from "./switch-Deo2Ltmj.js";
|
|
3
|
+
import { bf as ea, u as G, b as Jt, bg as ta, aH as re, c as Yt, d as ra, e as at, f as nt, n as aa, bh as ue, aU as Fe, bi as na, bj as Ut, bk as Xt, bl as Zt, bm as sa, b8 as lt, bn as oa, bo as ia, bp as da, bq as ca, br as la, bs as ua, ad as pe, bt as fe, o as k, bu as ma, bv as er, ay as ut, bd as pa, bw as fa, bx as ha, by as tr, aT as rr, aW as ar, ax as ga, aL as ba, bz as xa, bA as va, y as ya, x as Ue, J as wa, z as Ye, bB as Na, bC as Sa, bD as Da, Z as Ca, bE as ka, I as Xe, bF as Ea, bG as La, bH as Ia, bI as Aa, aM as Ma, aN as Pa, aO as Oa, aP as _a, aQ as $, bJ as Ra, aR as Tt, bK as Ua, bL as Ta, bM as Fa, H as $a, bN as Ga, a$ as Ba, b0 as za, b1 as Ha, b2 as ja, b3 as qa, b4 as Va, b5 as Ka, b6 as Ft, v as st } from "./index-PTx7430W.js";
|
|
4
|
+
import * as I from "react";
|
|
5
|
+
import nr, { useState as w, useMemo as V, useEffect as Ge, useRef as $t, useLayoutEffect as Qa, useCallback as Wa } from "react";
|
|
6
6
|
import "./index-CJdxSyQq.js";
|
|
7
7
|
import { createPortal as Ja } from "react-dom";
|
|
8
|
-
import { L as Ya, b as Xa, u as Za, A as en, V as tn, K as rn, e as an, M as nn, N as sn, U as on } from "./dashboard-briefing-launcher-
|
|
9
|
-
import { d as
|
|
10
|
-
import { C as dn } from "./calendar-preferences-dialog-
|
|
8
|
+
import { L as Ya, b as Xa, u as Za, A as en, V as tn, K as rn, e as an, M as nn, N as sn, U as on } from "./dashboard-briefing-launcher-CUEn7cr6.js";
|
|
9
|
+
import { d as sr } from "./index-DFOb_6HB.js";
|
|
10
|
+
import { C as dn } from "./calendar-preferences-dialog-B9Hz3pTH.js";
|
|
11
11
|
import { u as cn } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
12
|
-
import { s as
|
|
13
|
-
import { S as
|
|
12
|
+
import { s as Ze } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
|
|
13
|
+
import { S as Gt } from "./save-DxkSzUTZ.js";
|
|
14
14
|
import { P as ln } from "./palette-D96DOM7E.js";
|
|
15
15
|
import { B as un } from "./braces-ZjRH2Kl7.js";
|
|
16
16
|
/**
|
|
@@ -103,7 +103,7 @@ const xn = K("UserPlus", [
|
|
|
103
103
|
["line", { x1: "19", x2: "19", y1: "8", y2: "14", key: "1bvyxn" }],
|
|
104
104
|
["line", { x1: "22", x2: "16", y1: "11", y2: "11", key: "1shjgl" }]
|
|
105
105
|
]);
|
|
106
|
-
var
|
|
106
|
+
var ot = { exports: {} }, et = {};
|
|
107
107
|
/**
|
|
108
108
|
* @license React
|
|
109
109
|
* use-sync-external-store-shim.production.js
|
|
@@ -113,22 +113,22 @@ var st = { exports: {} }, Ze = {};
|
|
|
113
113
|
* This source code is licensed under the MIT license found in the
|
|
114
114
|
* LICENSE file in the root directory of this source tree.
|
|
115
115
|
*/
|
|
116
|
-
var
|
|
116
|
+
var Bt;
|
|
117
117
|
function vn() {
|
|
118
|
-
if (
|
|
119
|
-
|
|
120
|
-
var e =
|
|
121
|
-
function
|
|
122
|
-
return c ===
|
|
118
|
+
if (Bt) return et;
|
|
119
|
+
Bt = 1;
|
|
120
|
+
var e = nr;
|
|
121
|
+
function n(c, f) {
|
|
122
|
+
return c === f && (c !== 0 || 1 / c === 1 / f) || c !== c && f !== f;
|
|
123
123
|
}
|
|
124
|
-
var
|
|
125
|
-
function l(c,
|
|
126
|
-
var
|
|
124
|
+
var a = typeof Object.is == "function" ? Object.is : n, r = e.useState, s = e.useEffect, u = e.useLayoutEffect, h = e.useDebugValue;
|
|
125
|
+
function l(c, f) {
|
|
126
|
+
var m = f(), g = r({ inst: { value: m, getSnapshot: f } }), o = g[0].inst, y = g[1];
|
|
127
127
|
return u(
|
|
128
128
|
function() {
|
|
129
|
-
o.value =
|
|
129
|
+
o.value = m, o.getSnapshot = f, b(o) && y({ inst: o });
|
|
130
130
|
},
|
|
131
|
-
[c,
|
|
131
|
+
[c, m, f]
|
|
132
132
|
), s(
|
|
133
133
|
function() {
|
|
134
134
|
return b(o) && y({ inst: o }), c(function() {
|
|
@@ -136,25 +136,25 @@ function vn() {
|
|
|
136
136
|
});
|
|
137
137
|
},
|
|
138
138
|
[c]
|
|
139
|
-
),
|
|
139
|
+
), h(m), m;
|
|
140
140
|
}
|
|
141
141
|
function b(c) {
|
|
142
|
-
var
|
|
142
|
+
var f = c.getSnapshot;
|
|
143
143
|
c = c.value;
|
|
144
144
|
try {
|
|
145
|
-
var
|
|
146
|
-
return !
|
|
145
|
+
var m = f();
|
|
146
|
+
return !a(c, m);
|
|
147
147
|
} catch {
|
|
148
148
|
return !0;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
function x(c,
|
|
152
|
-
return
|
|
151
|
+
function x(c, f) {
|
|
152
|
+
return f();
|
|
153
153
|
}
|
|
154
|
-
var
|
|
155
|
-
return
|
|
154
|
+
var p = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? x : l;
|
|
155
|
+
return et.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : p, et;
|
|
156
156
|
}
|
|
157
|
-
var
|
|
157
|
+
var tt = {};
|
|
158
158
|
/**
|
|
159
159
|
* @license React
|
|
160
160
|
* use-sync-external-store-shim.development.js
|
|
@@ -164,146 +164,146 @@ var et = {};
|
|
|
164
164
|
* This source code is licensed under the MIT license found in the
|
|
165
165
|
* LICENSE file in the root directory of this source tree.
|
|
166
166
|
*/
|
|
167
|
-
var
|
|
167
|
+
var zt;
|
|
168
168
|
function yn() {
|
|
169
|
-
return
|
|
170
|
-
function e(
|
|
171
|
-
return
|
|
169
|
+
return zt || (zt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
170
|
+
function e(m, g) {
|
|
171
|
+
return m === g && (m !== 0 || 1 / m === 1 / g) || m !== m && g !== g;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
|
|
173
|
+
function n(m, g) {
|
|
174
|
+
p || s.startTransition === void 0 || (p = !0, console.error(
|
|
175
175
|
"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."
|
|
176
176
|
));
|
|
177
|
-
var o =
|
|
177
|
+
var o = g();
|
|
178
178
|
if (!c) {
|
|
179
|
-
var y =
|
|
179
|
+
var y = g();
|
|
180
180
|
u(o, y) || (console.error(
|
|
181
181
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
182
182
|
), c = !0);
|
|
183
183
|
}
|
|
184
|
-
y =
|
|
185
|
-
inst: { value: o, getSnapshot:
|
|
184
|
+
y = h({
|
|
185
|
+
inst: { value: o, getSnapshot: g }
|
|
186
186
|
});
|
|
187
|
-
var S = y[0].inst,
|
|
187
|
+
var S = y[0].inst, C = y[1];
|
|
188
188
|
return b(
|
|
189
189
|
function() {
|
|
190
|
-
S.value = o, S.getSnapshot =
|
|
190
|
+
S.value = o, S.getSnapshot = g, a(S) && C({ inst: S });
|
|
191
191
|
},
|
|
192
|
-
[
|
|
192
|
+
[m, o, g]
|
|
193
193
|
), l(
|
|
194
194
|
function() {
|
|
195
|
-
return
|
|
196
|
-
|
|
195
|
+
return a(S) && C({ inst: S }), m(function() {
|
|
196
|
+
a(S) && C({ inst: S });
|
|
197
197
|
});
|
|
198
198
|
},
|
|
199
|
-
[
|
|
199
|
+
[m]
|
|
200
200
|
), x(o), o;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
var
|
|
204
|
-
|
|
202
|
+
function a(m) {
|
|
203
|
+
var g = m.getSnapshot;
|
|
204
|
+
m = m.value;
|
|
205
205
|
try {
|
|
206
|
-
var o =
|
|
207
|
-
return !u(
|
|
206
|
+
var o = g();
|
|
207
|
+
return !u(m, o);
|
|
208
208
|
} catch {
|
|
209
209
|
return !0;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
return
|
|
212
|
+
function r(m, g) {
|
|
213
|
+
return g();
|
|
214
214
|
}
|
|
215
215
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
216
|
-
var s =
|
|
217
|
-
|
|
218
|
-
}()),
|
|
216
|
+
var s = nr, u = typeof Object.is == "function" ? Object.is : e, h = s.useState, l = s.useEffect, b = s.useLayoutEffect, x = s.useDebugValue, p = !1, c = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : n;
|
|
217
|
+
tt.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : f, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
218
|
+
}()), tt;
|
|
219
219
|
}
|
|
220
|
-
process.env.NODE_ENV === "production" ?
|
|
221
|
-
var wn =
|
|
222
|
-
const
|
|
220
|
+
process.env.NODE_ENV === "production" ? ot.exports = vn() : ot.exports = yn();
|
|
221
|
+
var wn = ot.exports;
|
|
222
|
+
const Te = ["light", "dark", "system"];
|
|
223
223
|
function Nn() {
|
|
224
|
-
const { theme: e, setTheme:
|
|
225
|
-
(
|
|
224
|
+
const { theme: e, setTheme: n } = ea(), a = N(
|
|
225
|
+
(h) => h.actions.setDashboardTheme
|
|
226
226
|
);
|
|
227
|
-
function
|
|
228
|
-
const
|
|
229
|
-
|
|
227
|
+
function r() {
|
|
228
|
+
const h = Te.includes(e) ? e : "system", l = Te[(Te.indexOf(h) + 1) % Te.length];
|
|
229
|
+
n(l), a(l);
|
|
230
230
|
}
|
|
231
231
|
const s = e === "light" ? bn : e === "dark" ? hn : fn, u = e === "light" ? "Theme: light (click for dark)" : e === "dark" ? "Theme: dark (click for system)" : "Theme: system (click for light)";
|
|
232
232
|
return /* @__PURE__ */ t(
|
|
233
|
-
|
|
233
|
+
_,
|
|
234
234
|
{
|
|
235
235
|
type: "button",
|
|
236
236
|
variant: "ghost",
|
|
237
237
|
size: "xs",
|
|
238
238
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
|
|
239
|
-
onClick:
|
|
239
|
+
onClick: r,
|
|
240
240
|
"aria-label": u,
|
|
241
241
|
title: u,
|
|
242
242
|
children: /* @__PURE__ */ t(s, { className: "h-3.5 w-3.5", strokeWidth: 1.5 })
|
|
243
243
|
}
|
|
244
244
|
);
|
|
245
245
|
}
|
|
246
|
-
async function Sn(e, a, r,
|
|
246
|
+
async function Sn(e, n, a, r, s) {
|
|
247
247
|
if (!s)
|
|
248
248
|
return null;
|
|
249
|
-
const u = JSON.stringify(
|
|
250
|
-
return await
|
|
251
|
-
name:
|
|
249
|
+
const u = JSON.stringify(a), h = `${e}/v1/lens`;
|
|
250
|
+
return await dt(h, s, {
|
|
251
|
+
name: n,
|
|
252
252
|
template: u,
|
|
253
|
-
filterValues:
|
|
253
|
+
filterValues: r,
|
|
254
254
|
operation: "create"
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
async function
|
|
258
|
-
if (!
|
|
257
|
+
async function it(e, n, a) {
|
|
258
|
+
if (!a)
|
|
259
259
|
return null;
|
|
260
|
-
const { id:
|
|
261
|
-
return await
|
|
262
|
-
lensId:
|
|
260
|
+
const { id: r, template: s, filterValues: u, isDefault: h, shared: l } = n, b = `${e}/v1/lens`;
|
|
261
|
+
return await dt(b, a, {
|
|
262
|
+
lensId: r,
|
|
263
263
|
template: s,
|
|
264
264
|
filterValues: u,
|
|
265
|
-
isDefault:
|
|
265
|
+
isDefault: h,
|
|
266
266
|
shared: l,
|
|
267
267
|
operation: "update"
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
|
-
async function Dn(e,
|
|
271
|
-
if (!
|
|
270
|
+
async function Dn(e, n, a) {
|
|
271
|
+
if (!a)
|
|
272
272
|
return null;
|
|
273
|
-
const
|
|
274
|
-
return await
|
|
273
|
+
const r = `${e}/v1/lens`;
|
|
274
|
+
return await dt(r, a, {
|
|
275
275
|
operation: "delete",
|
|
276
|
-
lensId:
|
|
276
|
+
lensId: n
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
279
|
const Cn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
280
280
|
function kn({
|
|
281
281
|
open: e,
|
|
282
|
-
onOpenChange:
|
|
282
|
+
onOpenChange: n
|
|
283
283
|
} = {}) {
|
|
284
|
-
const [
|
|
285
|
-
|
|
286
|
-
}, y = N((
|
|
284
|
+
const [a, r] = w(""), [s, u] = w(!1), h = N((D) => D.lenses), { setLenses: l, setSelectedLensId: b } = Vt(), [x, p] = w(!1), [c, f] = w(!1), m = e !== void 0, g = m ? e : c, o = (D) => {
|
|
285
|
+
m || f(D), n == null || n(D);
|
|
286
|
+
}, y = N((D) => D.dashboard), S = N((D) => D.filterValues), { authToken: C, tokenProps: L } = G();
|
|
287
287
|
async function E() {
|
|
288
|
-
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
288
|
+
p(!0);
|
|
289
|
+
const D = await Sn(
|
|
290
|
+
L.apiServiceUrl,
|
|
291
|
+
a,
|
|
292
292
|
y,
|
|
293
293
|
S,
|
|
294
|
-
|
|
294
|
+
C == null ? void 0 : C.accessToken
|
|
295
295
|
);
|
|
296
|
-
|
|
296
|
+
D && (l([...h || [], D]), b(D.id), o(!1)), p(!1);
|
|
297
297
|
}
|
|
298
|
-
return /* @__PURE__ */ i(
|
|
299
|
-
|
|
300
|
-
/* @__PURE__ */ t(
|
|
298
|
+
return /* @__PURE__ */ i(Jt, { open: g, onOpenChange: o, children: [
|
|
299
|
+
m ? null : /* @__PURE__ */ t(ta, { asChild: !0, children: /* @__PURE__ */ i(_, { variant: "secondary", size: "xs", children: [
|
|
300
|
+
/* @__PURE__ */ t(re, { className: "h-3.5 w-3.5" }),
|
|
301
301
|
"Lens"
|
|
302
302
|
] }) }),
|
|
303
|
-
/* @__PURE__ */ i(
|
|
303
|
+
/* @__PURE__ */ i(Yt, { className: "rounded-control border-border/60 sm:max-w-[420px] sm:rounded-control", children: [
|
|
304
304
|
/* @__PURE__ */ i(ra, { children: [
|
|
305
|
-
/* @__PURE__ */ t(
|
|
306
|
-
/* @__PURE__ */ t(
|
|
305
|
+
/* @__PURE__ */ t(at, { className: "text-[15px]", children: "Create lens" }),
|
|
306
|
+
/* @__PURE__ */ t(nt, { className: "text-[13px] leading-5", children: "Lenses are private by default and are only visible to you." })
|
|
307
307
|
] }),
|
|
308
308
|
/* @__PURE__ */ i("div", { className: "space-y-1.5 py-1", children: [
|
|
309
309
|
/* @__PURE__ */ t(Hr, { htmlFor: "lens-name", className: Cn, children: "Name" }),
|
|
@@ -312,22 +312,22 @@ function kn({
|
|
|
312
312
|
{
|
|
313
313
|
id: "lens-name",
|
|
314
314
|
size: "xs",
|
|
315
|
-
value:
|
|
315
|
+
value: a,
|
|
316
316
|
placeholder: "Monthly review, West region, …",
|
|
317
|
-
onChange: (
|
|
317
|
+
onChange: (D) => r(D.target.value)
|
|
318
318
|
}
|
|
319
319
|
),
|
|
320
320
|
s && /* @__PURE__ */ t("p", { className: "text-[12px] text-destructive", children: "A lens with this name already exists. Pick a different one." })
|
|
321
321
|
] }),
|
|
322
322
|
/* @__PURE__ */ i(aa, { children: [
|
|
323
|
-
/* @__PURE__ */ t(
|
|
323
|
+
/* @__PURE__ */ t(_, { variant: "outline", size: "xs", onClick: () => o(!1), children: "Cancel" }),
|
|
324
324
|
/* @__PURE__ */ t(
|
|
325
|
-
|
|
325
|
+
_,
|
|
326
326
|
{
|
|
327
327
|
size: "xs",
|
|
328
328
|
type: "submit",
|
|
329
329
|
onClick: E,
|
|
330
|
-
disabled: x || !
|
|
330
|
+
disabled: x || !a.trim(),
|
|
331
331
|
children: x ? "Creating…" : "Create"
|
|
332
332
|
}
|
|
333
333
|
)
|
|
@@ -336,80 +336,80 @@ function kn({
|
|
|
336
336
|
] });
|
|
337
337
|
}
|
|
338
338
|
function En({ includeLabel: e = !1 } = {}) {
|
|
339
|
-
const
|
|
340
|
-
async function l(
|
|
341
|
-
s(
|
|
339
|
+
const n = N((p) => p.lenses), a = N((p) => p.selectedLensId), { setLenses: r, setSelectedLensId: s } = Vt(), { authToken: u, tokenProps: h } = G();
|
|
340
|
+
async function l(p) {
|
|
341
|
+
s(p);
|
|
342
342
|
}
|
|
343
|
-
async function b(
|
|
344
|
-
if (await Dn(
|
|
345
|
-
const
|
|
346
|
-
|
|
343
|
+
async function b(p) {
|
|
344
|
+
if (await Dn(h.apiServiceUrl, p, u == null ? void 0 : u.accessToken)) {
|
|
345
|
+
const f = n == null ? void 0 : n.filter((m) => m.id !== p);
|
|
346
|
+
r(f || []), s("original");
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
async function x(
|
|
350
|
-
const c =
|
|
351
|
-
...
|
|
352
|
-
isDefault: !
|
|
349
|
+
async function x(p) {
|
|
350
|
+
const c = n == null ? void 0 : n.map((g) => g.id === p.id ? {
|
|
351
|
+
...g,
|
|
352
|
+
isDefault: !p.isDefault
|
|
353
353
|
} : {
|
|
354
|
-
...
|
|
354
|
+
...g,
|
|
355
355
|
isDefault: !1
|
|
356
356
|
});
|
|
357
|
-
|
|
358
|
-
const
|
|
359
|
-
...
|
|
360
|
-
isDefault: !
|
|
357
|
+
r(c || []);
|
|
358
|
+
const f = {
|
|
359
|
+
...p,
|
|
360
|
+
isDefault: !p.isDefault
|
|
361
361
|
};
|
|
362
|
-
await
|
|
363
|
-
const
|
|
364
|
-
if (
|
|
365
|
-
const
|
|
366
|
-
...
|
|
362
|
+
await it(h.apiServiceUrl, f, u == null ? void 0 : u.accessToken);
|
|
363
|
+
const m = n == null ? void 0 : n.find((g) => g.isDefault);
|
|
364
|
+
if (m && m.id !== p.id) {
|
|
365
|
+
const g = {
|
|
366
|
+
...m,
|
|
367
367
|
isDefault: !1
|
|
368
368
|
};
|
|
369
|
-
await
|
|
369
|
+
await it(h.apiServiceUrl, g, u == null ? void 0 : u.accessToken);
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
return /* @__PURE__ */ i(
|
|
373
|
-
e ? /* @__PURE__ */ i(
|
|
372
|
+
return /* @__PURE__ */ i(R, { children: [
|
|
373
|
+
e ? /* @__PURE__ */ i(R, { children: [
|
|
374
374
|
/* @__PURE__ */ t(ue, { className: "px-3", children: "Lenses" }),
|
|
375
|
-
/* @__PURE__ */ t(
|
|
375
|
+
/* @__PURE__ */ t(Fe, {})
|
|
376
376
|
] }) : null,
|
|
377
377
|
/* @__PURE__ */ i(
|
|
378
378
|
na,
|
|
379
379
|
{
|
|
380
|
-
value:
|
|
380
|
+
value: a,
|
|
381
381
|
onValueChange: l,
|
|
382
382
|
children: [
|
|
383
383
|
/* @__PURE__ */ t(Ut, { value: "original", children: "Original" }),
|
|
384
|
-
|
|
384
|
+
n == null ? void 0 : n.map((p) => /* @__PURE__ */ i(
|
|
385
385
|
Ut,
|
|
386
386
|
{
|
|
387
387
|
className: "group flex justify-between gap-2",
|
|
388
|
-
value:
|
|
388
|
+
value: p.id,
|
|
389
389
|
children: [
|
|
390
|
-
/* @__PURE__ */ t("p", { children:
|
|
390
|
+
/* @__PURE__ */ t("p", { children: p.name }),
|
|
391
391
|
/* @__PURE__ */ i("span", { className: "flex items-center gap-3", children: [
|
|
392
392
|
/* @__PURE__ */ t(
|
|
393
|
-
|
|
393
|
+
Xt,
|
|
394
394
|
{
|
|
395
395
|
onClick: (c) => {
|
|
396
|
-
c.preventDefault(), x(
|
|
396
|
+
c.preventDefault(), x(p);
|
|
397
397
|
},
|
|
398
|
-
className:
|
|
398
|
+
className: te(
|
|
399
399
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
400
400
|
{
|
|
401
|
-
invisible: !
|
|
402
|
-
"text-green-500":
|
|
401
|
+
invisible: !p.isDefault,
|
|
402
|
+
"text-green-500": p.isDefault
|
|
403
403
|
}
|
|
404
404
|
),
|
|
405
405
|
strokeWidth: 1.5
|
|
406
406
|
}
|
|
407
407
|
),
|
|
408
408
|
/* @__PURE__ */ t(
|
|
409
|
-
|
|
409
|
+
Zt,
|
|
410
410
|
{
|
|
411
411
|
onClick: (c) => {
|
|
412
|
-
c.preventDefault(), b(
|
|
412
|
+
c.preventDefault(), b(p.id);
|
|
413
413
|
},
|
|
414
414
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
415
415
|
strokeWidth: 1.5
|
|
@@ -418,7 +418,7 @@ function En({ includeLabel: e = !1 } = {}) {
|
|
|
418
418
|
] })
|
|
419
419
|
]
|
|
420
420
|
},
|
|
421
|
-
|
|
421
|
+
p.id
|
|
422
422
|
))
|
|
423
423
|
]
|
|
424
424
|
}
|
|
@@ -426,82 +426,82 @@ function En({ includeLabel: e = !1 } = {}) {
|
|
|
426
426
|
] });
|
|
427
427
|
}
|
|
428
428
|
function Ln() {
|
|
429
|
-
const { displayPreferences: e, shouldShowElement:
|
|
430
|
-
() => oa(
|
|
431
|
-
[
|
|
432
|
-
), u = V(() => (l) => s && s[l] !== void 0 && s[l] === !1 ? !1 :
|
|
429
|
+
const { displayPreferences: e, shouldShowElement: n } = sa(), { currentUser: a, userContext: r } = lt(), s = V(
|
|
430
|
+
() => oa(a),
|
|
431
|
+
[a]
|
|
432
|
+
), u = V(() => (l) => s && s[l] !== void 0 && s[l] === !1 ? !1 : n(l), [s, n, e]), h = V(
|
|
433
433
|
() => {
|
|
434
|
-
var l, b, x,
|
|
434
|
+
var l, b, x, p, c;
|
|
435
435
|
return {
|
|
436
|
-
canEdit: ((l =
|
|
437
|
-
canUseFilters: ((b =
|
|
438
|
-
canManageDashboards: ((x =
|
|
439
|
-
canCreateDashboards: ((
|
|
440
|
-
canAccessVisuals: ((c =
|
|
436
|
+
canEdit: ((l = r == null ? void 0 : r.permissions) == null ? void 0 : l.canEdit) ?? ua(a),
|
|
437
|
+
canUseFilters: ((b = r == null ? void 0 : r.permissions) == null ? void 0 : b.canEdit) ?? la(a),
|
|
438
|
+
canManageDashboards: ((x = r == null ? void 0 : r.permissions) == null ? void 0 : x.canCreateDashboard) ?? ca(a),
|
|
439
|
+
canCreateDashboards: ((p = r == null ? void 0 : r.permissions) == null ? void 0 : p.canCreateDashboard) ?? da(a),
|
|
440
|
+
canAccessVisuals: ((c = r == null ? void 0 : r.permissions) == null ? void 0 : c.canEdit) ?? ia(a)
|
|
441
441
|
};
|
|
442
442
|
},
|
|
443
|
-
[
|
|
443
|
+
[a, r]
|
|
444
444
|
);
|
|
445
445
|
return {
|
|
446
446
|
displayPreferences: e,
|
|
447
447
|
shouldShowElement: u,
|
|
448
|
-
permissions:
|
|
449
|
-
currentUser:
|
|
448
|
+
permissions: h,
|
|
449
|
+
currentUser: a
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
|
-
function In(e,
|
|
453
|
-
let
|
|
454
|
-
function
|
|
455
|
-
const l =
|
|
452
|
+
function In(e, n = []) {
|
|
453
|
+
let a = [];
|
|
454
|
+
function r(u, h) {
|
|
455
|
+
const l = I.createContext(h);
|
|
456
456
|
l.displayName = u + "Context";
|
|
457
|
-
const b =
|
|
458
|
-
|
|
457
|
+
const b = a.length;
|
|
458
|
+
a = [...a, h];
|
|
459
459
|
const x = (c) => {
|
|
460
460
|
var S;
|
|
461
|
-
const { scope:
|
|
462
|
-
return /* @__PURE__ */ t(o.Provider, { value: y, children:
|
|
461
|
+
const { scope: f, children: m, ...g } = c, o = ((S = f == null ? void 0 : f[e]) == null ? void 0 : S[b]) || l, y = I.useMemo(() => g, Object.values(g));
|
|
462
|
+
return /* @__PURE__ */ t(o.Provider, { value: y, children: m });
|
|
463
463
|
};
|
|
464
464
|
x.displayName = u + "Provider";
|
|
465
|
-
function
|
|
465
|
+
function p(c, f) {
|
|
466
466
|
var o;
|
|
467
|
-
const
|
|
468
|
-
if (
|
|
469
|
-
if (
|
|
467
|
+
const m = ((o = f == null ? void 0 : f[e]) == null ? void 0 : o[b]) || l, g = I.useContext(m);
|
|
468
|
+
if (g) return g;
|
|
469
|
+
if (h !== void 0) return h;
|
|
470
470
|
throw new Error(`\`${c}\` must be used within \`${u}\``);
|
|
471
471
|
}
|
|
472
|
-
return [x,
|
|
472
|
+
return [x, p];
|
|
473
473
|
}
|
|
474
474
|
const s = () => {
|
|
475
|
-
const u =
|
|
475
|
+
const u = a.map((h) => I.createContext(h));
|
|
476
476
|
return function(l) {
|
|
477
477
|
const b = (l == null ? void 0 : l[e]) || u;
|
|
478
|
-
return
|
|
478
|
+
return I.useMemo(
|
|
479
479
|
() => ({ [`__scope${e}`]: { ...l, [e]: b } }),
|
|
480
480
|
[l, b]
|
|
481
481
|
);
|
|
482
482
|
};
|
|
483
483
|
};
|
|
484
|
-
return s.scopeName = e, [
|
|
484
|
+
return s.scopeName = e, [r, An(s, ...n)];
|
|
485
485
|
}
|
|
486
|
-
function
|
|
487
|
-
const
|
|
488
|
-
if (e.length === 1) return
|
|
489
|
-
const
|
|
490
|
-
const
|
|
486
|
+
function An(...e) {
|
|
487
|
+
const n = e[0];
|
|
488
|
+
if (e.length === 1) return n;
|
|
489
|
+
const a = () => {
|
|
490
|
+
const r = e.map((s) => ({
|
|
491
491
|
useScope: s(),
|
|
492
492
|
scopeName: s.scopeName
|
|
493
493
|
}));
|
|
494
494
|
return function(u) {
|
|
495
|
-
const
|
|
495
|
+
const h = r.reduce((l, { useScope: b, scopeName: x }) => {
|
|
496
496
|
const c = b(u)[`__scope${x}`];
|
|
497
497
|
return { ...l, ...c };
|
|
498
498
|
}, {});
|
|
499
|
-
return
|
|
499
|
+
return I.useMemo(() => ({ [`__scope${n.scopeName}`]: h }), [h]);
|
|
500
500
|
};
|
|
501
501
|
};
|
|
502
|
-
return
|
|
502
|
+
return a.scopeName = n.scopeName, a;
|
|
503
503
|
}
|
|
504
|
-
var
|
|
504
|
+
var Mn = [
|
|
505
505
|
"a",
|
|
506
506
|
"button",
|
|
507
507
|
"div",
|
|
@@ -519,222 +519,224 @@ var An = [
|
|
|
519
519
|
"span",
|
|
520
520
|
"svg",
|
|
521
521
|
"ul"
|
|
522
|
-
],
|
|
523
|
-
const
|
|
524
|
-
const { asChild:
|
|
522
|
+
], mt = Mn.reduce((e, n) => {
|
|
523
|
+
const a = qr(`Primitive.${n}`), r = I.forwardRef((s, u) => {
|
|
524
|
+
const { asChild: h, ...l } = s, b = h ? a : n;
|
|
525
525
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ t(b, { ...l, ref: u });
|
|
526
526
|
});
|
|
527
|
-
return
|
|
527
|
+
return r.displayName = `Primitive.${n}`, { ...e, [n]: r };
|
|
528
528
|
}, {});
|
|
529
529
|
function Pn() {
|
|
530
530
|
return wn.useSyncExternalStore(
|
|
531
|
-
|
|
531
|
+
On,
|
|
532
532
|
() => !0,
|
|
533
533
|
() => !1
|
|
534
534
|
);
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function On() {
|
|
537
537
|
return () => {
|
|
538
538
|
};
|
|
539
539
|
}
|
|
540
|
-
var
|
|
541
|
-
(e,
|
|
542
|
-
const { __scopeAvatar:
|
|
540
|
+
var pt = "Avatar", [_n] = In(pt), [Rn, or] = _n(pt), ir = I.forwardRef(
|
|
541
|
+
(e, n) => {
|
|
542
|
+
const { __scopeAvatar: a, ...r } = e, [s, u] = I.useState("idle");
|
|
543
543
|
return /* @__PURE__ */ t(
|
|
544
|
-
|
|
544
|
+
Rn,
|
|
545
545
|
{
|
|
546
|
-
scope:
|
|
546
|
+
scope: a,
|
|
547
547
|
imageLoadingStatus: s,
|
|
548
548
|
onImageLoadingStatusChange: u,
|
|
549
|
-
children: /* @__PURE__ */ t(
|
|
549
|
+
children: /* @__PURE__ */ t(mt.span, { ...r, ref: n })
|
|
550
550
|
}
|
|
551
551
|
);
|
|
552
552
|
}
|
|
553
553
|
);
|
|
554
|
-
|
|
555
|
-
var
|
|
556
|
-
(e,
|
|
557
|
-
const { __scopeAvatar:
|
|
558
|
-
}, ...u } = e,
|
|
559
|
-
s(x),
|
|
554
|
+
ir.displayName = pt;
|
|
555
|
+
var dr = "AvatarImage", cr = I.forwardRef(
|
|
556
|
+
(e, n) => {
|
|
557
|
+
const { __scopeAvatar: a, src: r, onLoadingStatusChange: s = () => {
|
|
558
|
+
}, ...u } = e, h = or(dr, a), l = Un(r, u), b = Vr((x) => {
|
|
559
|
+
s(x), h.onImageLoadingStatusChange(x);
|
|
560
560
|
});
|
|
561
|
-
return
|
|
561
|
+
return rt(() => {
|
|
562
562
|
l !== "idle" && b(l);
|
|
563
|
-
}, [l, b]), l === "loaded" ? /* @__PURE__ */ t(
|
|
563
|
+
}, [l, b]), l === "loaded" ? /* @__PURE__ */ t(mt.img, { ...u, ref: n, src: r }) : null;
|
|
564
564
|
}
|
|
565
565
|
);
|
|
566
|
-
|
|
567
|
-
var
|
|
568
|
-
(e,
|
|
569
|
-
const { __scopeAvatar:
|
|
570
|
-
return
|
|
571
|
-
if (
|
|
572
|
-
const b = window.setTimeout(() => l(!0),
|
|
566
|
+
cr.displayName = dr;
|
|
567
|
+
var lr = "AvatarFallback", ur = I.forwardRef(
|
|
568
|
+
(e, n) => {
|
|
569
|
+
const { __scopeAvatar: a, delayMs: r, ...s } = e, u = or(lr, a), [h, l] = I.useState(r === void 0);
|
|
570
|
+
return I.useEffect(() => {
|
|
571
|
+
if (r !== void 0) {
|
|
572
|
+
const b = window.setTimeout(() => l(!0), r);
|
|
573
573
|
return () => window.clearTimeout(b);
|
|
574
574
|
}
|
|
575
|
-
}, [
|
|
575
|
+
}, [r]), h && u.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ t(mt.span, { ...s, ref: n }) : null;
|
|
576
576
|
}
|
|
577
577
|
);
|
|
578
|
-
|
|
579
|
-
function
|
|
580
|
-
return e ?
|
|
578
|
+
ur.displayName = lr;
|
|
579
|
+
function Ht(e, n) {
|
|
580
|
+
return e ? n ? (e.src !== n && (e.src = n), e.complete && e.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
581
581
|
}
|
|
582
|
-
function
|
|
583
|
-
const
|
|
584
|
-
() =>
|
|
582
|
+
function Un(e, { referrerPolicy: n, crossOrigin: a }) {
|
|
583
|
+
const r = Pn(), s = I.useRef(null), u = r ? (s.current || (s.current = new window.Image()), s.current) : null, [h, l] = I.useState(
|
|
584
|
+
() => Ht(u, e)
|
|
585
585
|
);
|
|
586
|
-
return
|
|
587
|
-
l(
|
|
588
|
-
}, [u, e]),
|
|
586
|
+
return rt(() => {
|
|
587
|
+
l(Ht(u, e));
|
|
588
|
+
}, [u, e]), rt(() => {
|
|
589
589
|
const b = (c) => () => {
|
|
590
590
|
l(c);
|
|
591
591
|
};
|
|
592
592
|
if (!u) return;
|
|
593
|
-
const x = b("loaded"),
|
|
594
|
-
return u.addEventListener("load", x), u.addEventListener("error",
|
|
595
|
-
u.removeEventListener("load", x), u.removeEventListener("error",
|
|
593
|
+
const x = b("loaded"), p = b("error");
|
|
594
|
+
return u.addEventListener("load", x), u.addEventListener("error", p), n && (u.referrerPolicy = n), typeof a == "string" && (u.crossOrigin = a), () => {
|
|
595
|
+
u.removeEventListener("load", x), u.removeEventListener("error", p);
|
|
596
596
|
};
|
|
597
|
-
}, [u,
|
|
597
|
+
}, [u, a, n]), h;
|
|
598
598
|
}
|
|
599
|
-
var
|
|
600
|
-
const
|
|
601
|
-
|
|
599
|
+
var mr = ir, pr = cr, fr = ur;
|
|
600
|
+
const hr = I.forwardRef(({ className: e, ...n }, a) => /* @__PURE__ */ t(
|
|
601
|
+
mr,
|
|
602
602
|
{
|
|
603
|
-
ref:
|
|
604
|
-
className:
|
|
603
|
+
ref: a,
|
|
604
|
+
className: te(
|
|
605
605
|
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
606
606
|
e
|
|
607
607
|
),
|
|
608
|
-
...
|
|
608
|
+
...n
|
|
609
609
|
}
|
|
610
610
|
));
|
|
611
|
-
|
|
612
|
-
const Tn =
|
|
613
|
-
|
|
611
|
+
hr.displayName = mr.displayName;
|
|
612
|
+
const Tn = I.forwardRef(({ className: e, ...n }, a) => /* @__PURE__ */ t(
|
|
613
|
+
pr,
|
|
614
614
|
{
|
|
615
|
-
ref:
|
|
616
|
-
className:
|
|
617
|
-
...
|
|
615
|
+
ref: a,
|
|
616
|
+
className: te("aspect-square h-full w-full", e),
|
|
617
|
+
...n
|
|
618
618
|
}
|
|
619
619
|
));
|
|
620
|
-
Tn.displayName =
|
|
621
|
-
const
|
|
622
|
-
|
|
620
|
+
Tn.displayName = pr.displayName;
|
|
621
|
+
const gr = I.forwardRef(({ className: e, ...n }, a) => /* @__PURE__ */ t(
|
|
622
|
+
fr,
|
|
623
623
|
{
|
|
624
|
-
ref:
|
|
625
|
-
className:
|
|
624
|
+
ref: a,
|
|
625
|
+
className: te(
|
|
626
626
|
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
627
627
|
e
|
|
628
628
|
),
|
|
629
|
-
...
|
|
629
|
+
...n
|
|
630
630
|
}
|
|
631
631
|
));
|
|
632
|
-
|
|
633
|
-
const Fn = async (e,
|
|
634
|
-
const
|
|
635
|
-
return await
|
|
636
|
-
}, $n = async (e, a, r
|
|
637
|
-
const s = `${e}/management/v1/groups/${
|
|
638
|
-
return
|
|
639
|
-
}, Gn = async (e,
|
|
640
|
-
const
|
|
641
|
-
await
|
|
642
|
-
}, Bn = async (e, a, r
|
|
643
|
-
const s = `${e}/management/v1/groups/${
|
|
644
|
-
return await
|
|
645
|
-
}, zn = async (e, a, r
|
|
646
|
-
const s = `${e}/management/v1/groups/${
|
|
647
|
-
await
|
|
632
|
+
gr.displayName = fr.displayName;
|
|
633
|
+
const Fn = async (e, n, a) => {
|
|
634
|
+
const r = `${e}/management/v1/groups`;
|
|
635
|
+
return await Kt(r, n, a);
|
|
636
|
+
}, $n = async (e, n, a, r) => {
|
|
637
|
+
const s = `${e}/management/v1/groups/${a}`;
|
|
638
|
+
return ct(s, n, "PATCH", r);
|
|
639
|
+
}, Gn = async (e, n, a) => {
|
|
640
|
+
const r = `${e}/management/v1/groups/${a}`;
|
|
641
|
+
await ct(r, n, "DELETE");
|
|
642
|
+
}, Bn = async (e, n, a, r) => {
|
|
643
|
+
const s = `${e}/management/v1/groups/${a}/members`;
|
|
644
|
+
return await Kt(s, n, r);
|
|
645
|
+
}, zn = async (e, n, a, r) => {
|
|
646
|
+
const s = `${e}/management/v1/groups/${a}/members`;
|
|
647
|
+
await ct(s, n, "DELETE", r);
|
|
648
648
|
};
|
|
649
649
|
function Hn() {
|
|
650
|
-
const { authToken: e, tokenProps:
|
|
650
|
+
const { authToken: e, tokenProps: n } = G(), a = pe();
|
|
651
651
|
return fe({
|
|
652
|
-
mutationFn: (
|
|
652
|
+
mutationFn: (r) => Fn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r),
|
|
653
653
|
onSuccess: () => {
|
|
654
|
-
|
|
654
|
+
a.invalidateQueries({ queryKey: ["groups"] }), k.success("Group created successfully");
|
|
655
655
|
},
|
|
656
|
-
onError: (
|
|
657
|
-
console.error("Failed to create group:",
|
|
658
|
-
description: me(
|
|
656
|
+
onError: (r) => {
|
|
657
|
+
console.error("Failed to create group:", r), k.error("Failed to create group", {
|
|
658
|
+
description: me(r, "Failed to create group")
|
|
659
659
|
});
|
|
660
660
|
}
|
|
661
661
|
});
|
|
662
662
|
}
|
|
663
663
|
function jn() {
|
|
664
|
-
const { authToken: e, tokenProps:
|
|
664
|
+
const { authToken: e, tokenProps: n } = G(), a = pe();
|
|
665
665
|
return fe({
|
|
666
666
|
mutationFn: ({
|
|
667
|
-
groupId:
|
|
667
|
+
groupId: r,
|
|
668
668
|
data: s
|
|
669
|
-
}) => $n(
|
|
670
|
-
onSuccess: (
|
|
671
|
-
|
|
669
|
+
}) => $n(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r, s),
|
|
670
|
+
onSuccess: (r, s) => {
|
|
671
|
+
a.invalidateQueries({ queryKey: ["group", s.groupId] }), a.invalidateQueries({ queryKey: ["groups"] }), k.success("Group updated successfully");
|
|
672
672
|
},
|
|
673
|
-
onError: (
|
|
674
|
-
console.error("Failed to update group:",
|
|
675
|
-
description: me(
|
|
673
|
+
onError: (r) => {
|
|
674
|
+
console.error("Failed to update group:", r), k.error("Failed to update group", {
|
|
675
|
+
description: me(r, "Failed to update group")
|
|
676
676
|
});
|
|
677
677
|
}
|
|
678
678
|
});
|
|
679
679
|
}
|
|
680
680
|
function qn() {
|
|
681
|
-
const { authToken: e, tokenProps:
|
|
681
|
+
const { authToken: e, tokenProps: n } = G(), a = pe();
|
|
682
682
|
return fe({
|
|
683
|
-
mutationFn: (
|
|
684
|
-
onSuccess: (
|
|
685
|
-
|
|
683
|
+
mutationFn: (r) => Gn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r),
|
|
684
|
+
onSuccess: (r, s) => {
|
|
685
|
+
a.invalidateQueries({ queryKey: ["groups"] }), a.removeQueries({ queryKey: ["group", s] }), k.success("Group deleted successfully");
|
|
686
686
|
},
|
|
687
|
-
onError: (
|
|
688
|
-
console.error("Failed to delete group:",
|
|
689
|
-
description: me(
|
|
687
|
+
onError: (r) => {
|
|
688
|
+
console.error("Failed to delete group:", r), k.error("Failed to delete group", {
|
|
689
|
+
description: me(r, "Failed to delete group")
|
|
690
690
|
});
|
|
691
691
|
}
|
|
692
692
|
});
|
|
693
693
|
}
|
|
694
694
|
function Vn() {
|
|
695
|
-
const { authToken: e, tokenProps:
|
|
695
|
+
const { authToken: e, tokenProps: n } = G(), a = pe();
|
|
696
696
|
return fe({
|
|
697
697
|
mutationFn: ({
|
|
698
|
-
groupId:
|
|
698
|
+
groupId: r,
|
|
699
699
|
data: s
|
|
700
|
-
}) => Bn(
|
|
701
|
-
onSuccess: (
|
|
702
|
-
|
|
700
|
+
}) => Bn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r, s),
|
|
701
|
+
onSuccess: (r, s) => {
|
|
702
|
+
a.invalidateQueries({ queryKey: ["group", s.groupId] }), a.invalidateQueries({
|
|
703
703
|
queryKey: ["group-members", s.groupId]
|
|
704
|
-
}),
|
|
704
|
+
}), a.invalidateQueries({ queryKey: ["groups"] }), k.success("Members added successfully");
|
|
705
705
|
},
|
|
706
|
-
onError: (
|
|
707
|
-
console.error("Failed to add group members:",
|
|
708
|
-
description: me(
|
|
706
|
+
onError: (r) => {
|
|
707
|
+
console.error("Failed to add group members:", r), k.error("Failed to add members", {
|
|
708
|
+
description: me(r, "Failed to add members")
|
|
709
709
|
});
|
|
710
710
|
}
|
|
711
711
|
});
|
|
712
712
|
}
|
|
713
713
|
function Kn() {
|
|
714
|
-
const { authToken: e, tokenProps:
|
|
714
|
+
const { authToken: e, tokenProps: n } = G(), a = pe();
|
|
715
715
|
return fe({
|
|
716
716
|
mutationFn: ({
|
|
717
|
-
groupId:
|
|
717
|
+
groupId: r,
|
|
718
718
|
data: s
|
|
719
|
-
}) => zn(
|
|
720
|
-
onSuccess: (
|
|
721
|
-
|
|
719
|
+
}) => zn(n.apiServiceUrl, (e == null ? void 0 : e.accessToken) || "", r, s),
|
|
720
|
+
onSuccess: (r, s) => {
|
|
721
|
+
a.invalidateQueries({ queryKey: ["group", s.groupId] }), a.invalidateQueries({
|
|
722
722
|
queryKey: ["group-members", s.groupId]
|
|
723
|
-
}),
|
|
723
|
+
}), a.invalidateQueries({ queryKey: ["groups"] }), k.success("Members removed successfully");
|
|
724
724
|
},
|
|
725
|
-
onError: (
|
|
726
|
-
console.error("Failed to remove group members:",
|
|
727
|
-
description: me(
|
|
725
|
+
onError: (r) => {
|
|
726
|
+
console.error("Failed to remove group members:", r), k.error("Failed to remove members", {
|
|
727
|
+
description: me(r, "Failed to remove members")
|
|
728
728
|
});
|
|
729
729
|
}
|
|
730
730
|
});
|
|
731
731
|
}
|
|
732
|
-
|
|
732
|
+
const Qn = [];
|
|
733
|
+
function Wn({
|
|
733
734
|
open: e,
|
|
734
|
-
onOpenChange:
|
|
735
|
+
onOpenChange: n
|
|
735
736
|
}) {
|
|
736
|
-
|
|
737
|
-
|
|
737
|
+
var C, L, E;
|
|
738
|
+
const { tokenProps: a } = G(), { currentUser: r } = lt(), s = (r == null ? void 0 : r.type) === "tenant", u = a == null ? void 0 : a.tenantId, {
|
|
739
|
+
groups: h,
|
|
738
740
|
isLoading: l,
|
|
739
741
|
error: b,
|
|
740
742
|
refetch: x
|
|
@@ -742,76 +744,78 @@ function Qn({
|
|
|
742
744
|
type: s ? "TENANT_GROUP" : "all",
|
|
743
745
|
tenantId: s ? u : void 0,
|
|
744
746
|
includeMembers: !1
|
|
745
|
-
}),
|
|
746
|
-
|
|
747
|
-
e || (
|
|
747
|
+
}), p = b ? br(b, "Unable to load groups.") : null, [c, f] = w({ kind: "list" }), [m, g] = w(null), o = qn();
|
|
748
|
+
Ge(() => {
|
|
749
|
+
e || (f({ kind: "list" }), g(null));
|
|
748
750
|
}, [e]);
|
|
749
|
-
const y = c.kind === "members" &&
|
|
750
|
-
if (
|
|
751
|
+
const y = c.kind === "members" && h.find((D) => D.id === c.groupId) || null, S = async () => {
|
|
752
|
+
if (m)
|
|
751
753
|
try {
|
|
752
|
-
await o.mutateAsync(
|
|
754
|
+
await o.mutateAsync(m.id), g(null), f({ kind: "list" }), x();
|
|
753
755
|
} catch {
|
|
754
756
|
}
|
|
755
757
|
};
|
|
756
|
-
return /* @__PURE__ */ t(
|
|
758
|
+
return /* @__PURE__ */ t(Jt, { open: e, onOpenChange: n, children: /* @__PURE__ */ i(Yt, { className: "flex max-h-[640px] w-[720px] max-w-[92vw] flex-col gap-0 overflow-hidden p-0", children: [
|
|
757
759
|
c.kind === "list" ? /* @__PURE__ */ i("div", { className: "shrink-0 border-b border-border px-5 pt-4 pb-3.5", children: [
|
|
758
|
-
/* @__PURE__ */ t(
|
|
759
|
-
/* @__PURE__ */ t(
|
|
760
|
+
/* @__PURE__ */ t(at, { className: "text-[15px] font-semibold tracking-tight", children: "Group management" }),
|
|
761
|
+
/* @__PURE__ */ t(nt, { className: "mt-1 text-[12px] leading-[1.5] text-muted-foreground", children: "Organize people into groups for shared access." })
|
|
760
762
|
] }) : c.kind === "create" ? /* @__PURE__ */ i("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
|
|
761
763
|
/* @__PURE__ */ t(
|
|
762
764
|
"button",
|
|
763
765
|
{
|
|
764
766
|
type: "button",
|
|
765
|
-
onClick: () =>
|
|
767
|
+
onClick: () => f({ kind: "list" }),
|
|
766
768
|
"aria-label": "Back",
|
|
767
769
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
768
|
-
children: /* @__PURE__ */ t(
|
|
770
|
+
children: /* @__PURE__ */ t(er, { className: "h-3.5 w-3.5" })
|
|
769
771
|
}
|
|
770
772
|
),
|
|
771
|
-
/* @__PURE__ */ t(
|
|
772
|
-
/* @__PURE__ */ t(
|
|
773
|
+
/* @__PURE__ */ t(at, { className: "truncate text-[13px] font-medium", children: "New group" }),
|
|
774
|
+
/* @__PURE__ */ t(nt, { className: "sr-only", children: "Create a new group to organize members." })
|
|
773
775
|
] }) : null,
|
|
774
776
|
c.kind === "list" && /* @__PURE__ */ t(
|
|
775
|
-
|
|
777
|
+
Jn,
|
|
776
778
|
{
|
|
777
|
-
groups:
|
|
779
|
+
groups: h,
|
|
778
780
|
isLoading: l,
|
|
779
|
-
errorMessage:
|
|
781
|
+
errorMessage: p,
|
|
780
782
|
onRetry: () => x(),
|
|
781
|
-
currentUserId:
|
|
782
|
-
onOpenGroup: (D) =>
|
|
783
|
-
onCreate: () =>
|
|
784
|
-
onDeleteRequest: (D) =>
|
|
783
|
+
currentUserId: r == null ? void 0 : r.id,
|
|
784
|
+
onOpenGroup: (D) => f({ kind: "members", groupId: D }),
|
|
785
|
+
onCreate: () => f({ kind: "create" }),
|
|
786
|
+
onDeleteRequest: (D) => g(D)
|
|
785
787
|
}
|
|
786
788
|
),
|
|
787
789
|
c.kind === "members" && y && /* @__PURE__ */ t(
|
|
788
|
-
|
|
790
|
+
Zn,
|
|
789
791
|
{
|
|
790
792
|
group: y,
|
|
791
793
|
isTenantViewer: s,
|
|
792
|
-
|
|
793
|
-
|
|
794
|
+
canEdit: ((C = y.permissions) == null ? void 0 : C.canEdit) ?? y.createdBy === (r == null ? void 0 : r.id),
|
|
795
|
+
canDelete: ((L = y.permissions) == null ? void 0 : L.canDelete) ?? y.createdBy === (r == null ? void 0 : r.id),
|
|
796
|
+
canManageMembers: ((E = y.permissions) == null ? void 0 : E.canManageMembers) ?? y.createdBy === (r == null ? void 0 : r.id),
|
|
797
|
+
onBack: () => f({ kind: "list" }),
|
|
794
798
|
onMembersChanged: x,
|
|
795
799
|
onUpdated: x,
|
|
796
|
-
onRequestDelete: () =>
|
|
800
|
+
onRequestDelete: () => g(y)
|
|
797
801
|
},
|
|
798
802
|
y.id
|
|
799
803
|
),
|
|
800
804
|
c.kind === "create" && /* @__PURE__ */ t(
|
|
801
|
-
|
|
805
|
+
es,
|
|
802
806
|
{
|
|
803
807
|
isTenantUser: s,
|
|
804
808
|
tenantId: u,
|
|
805
|
-
onCancel: () =>
|
|
809
|
+
onCancel: () => f({ kind: "list" }),
|
|
806
810
|
onCreated: (D) => {
|
|
807
|
-
x(),
|
|
811
|
+
x(), f({ kind: "members", groupId: D });
|
|
808
812
|
}
|
|
809
813
|
}
|
|
810
814
|
),
|
|
811
|
-
|
|
815
|
+
m && /* @__PURE__ */ i("div", { className: "flex shrink-0 items-center justify-between gap-3 border-t border-border bg-muted/40 px-5 py-2.5", children: [
|
|
812
816
|
/* @__PURE__ */ i("div", { className: "min-w-0 text-[12px] text-foreground", children: [
|
|
813
817
|
"Delete ",
|
|
814
|
-
/* @__PURE__ */ t("span", { className: "font-medium", children:
|
|
818
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: m.name }),
|
|
815
819
|
"?",
|
|
816
820
|
/* @__PURE__ */ t("span", { className: "ml-2 text-muted-foreground", children: "Members lose any access granted via this group." })
|
|
817
821
|
] }),
|
|
@@ -820,7 +824,7 @@ function Qn({
|
|
|
820
824
|
"button",
|
|
821
825
|
{
|
|
822
826
|
type: "button",
|
|
823
|
-
onClick: () =>
|
|
827
|
+
onClick: () => g(null),
|
|
824
828
|
disabled: o.isPending,
|
|
825
829
|
className: "h-7 rounded-[5px] px-2.5 text-[12px] font-medium text-foreground/80 hover:bg-background",
|
|
826
830
|
children: "Cancel"
|
|
@@ -834,7 +838,7 @@ function Qn({
|
|
|
834
838
|
disabled: o.isPending,
|
|
835
839
|
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",
|
|
836
840
|
children: [
|
|
837
|
-
o.isPending ? /* @__PURE__ */ t(
|
|
841
|
+
o.isPending ? /* @__PURE__ */ t($e, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ t(ut, { className: "h-3 w-3" }),
|
|
838
842
|
"Delete group"
|
|
839
843
|
]
|
|
840
844
|
}
|
|
@@ -843,17 +847,17 @@ function Qn({
|
|
|
843
847
|
] })
|
|
844
848
|
] }) });
|
|
845
849
|
}
|
|
846
|
-
function
|
|
850
|
+
function Jn({
|
|
847
851
|
groups: e,
|
|
848
|
-
isLoading:
|
|
849
|
-
errorMessage:
|
|
850
|
-
onRetry:
|
|
852
|
+
isLoading: n,
|
|
853
|
+
errorMessage: a,
|
|
854
|
+
onRetry: r,
|
|
851
855
|
currentUserId: s,
|
|
852
856
|
onOpenGroup: u,
|
|
853
|
-
onCreate:
|
|
857
|
+
onCreate: h,
|
|
854
858
|
onDeleteRequest: l
|
|
855
859
|
}) {
|
|
856
|
-
const [b, x] = w(""),
|
|
860
|
+
const [b, x] = w(""), p = V(
|
|
857
861
|
() => e.filter(
|
|
858
862
|
(c) => !b.trim() || c.name.toLowerCase().includes(b.toLowerCase()) || (c.description || "").toLowerCase().includes(b.toLowerCase())
|
|
859
863
|
),
|
|
@@ -878,7 +882,7 @@ function Wn({
|
|
|
878
882
|
type: "button",
|
|
879
883
|
onClick: () => x(""),
|
|
880
884
|
className: "flex h-4 w-4 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
881
|
-
children: /* @__PURE__ */ t(
|
|
885
|
+
children: /* @__PURE__ */ t(Qt, { className: "h-2.5 w-2.5" })
|
|
882
886
|
}
|
|
883
887
|
)
|
|
884
888
|
] }),
|
|
@@ -886,56 +890,59 @@ function Wn({
|
|
|
886
890
|
"button",
|
|
887
891
|
{
|
|
888
892
|
type: "button",
|
|
889
|
-
onClick:
|
|
893
|
+
onClick: h,
|
|
890
894
|
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",
|
|
891
895
|
children: [
|
|
892
|
-
/* @__PURE__ */ t(
|
|
896
|
+
/* @__PURE__ */ t(re, { className: "h-3 w-3" }),
|
|
893
897
|
"New group"
|
|
894
898
|
]
|
|
895
899
|
}
|
|
896
900
|
)
|
|
897
901
|
] }),
|
|
898
|
-
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto", children:
|
|
902
|
+
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto", children: n ? /* @__PURE__ */ t("div", { className: "space-y-px p-3", children: [1, 2, 3].map((c) => /* @__PURE__ */ t(
|
|
899
903
|
"div",
|
|
900
904
|
{
|
|
901
905
|
className: "h-12 animate-pulse rounded-[4px] bg-muted/60"
|
|
902
906
|
},
|
|
903
907
|
c
|
|
904
|
-
)) }) :
|
|
905
|
-
|
|
908
|
+
)) }) : a ? /* @__PURE__ */ t(
|
|
909
|
+
xr,
|
|
906
910
|
{
|
|
907
911
|
title: "Can't load groups",
|
|
908
|
-
message:
|
|
909
|
-
onRetry:
|
|
912
|
+
message: a,
|
|
913
|
+
onRetry: r
|
|
910
914
|
}
|
|
911
|
-
) :
|
|
915
|
+
) : p.length === 0 && e.length === 0 ? /* @__PURE__ */ t(Xn, { onCreate: h }) : p.length === 0 ? /* @__PURE__ */ i("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
|
|
912
916
|
/* @__PURE__ */ i("div", { className: "text-[12px] text-foreground", children: [
|
|
913
917
|
'No groups match "',
|
|
914
918
|
b,
|
|
915
919
|
'"'
|
|
916
920
|
] }),
|
|
917
921
|
/* @__PURE__ */ t("div", { className: "text-[11px] text-muted-foreground", children: "Try a different search." })
|
|
918
|
-
] }) :
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
922
|
+
] }) : p.map((c) => {
|
|
923
|
+
var f;
|
|
924
|
+
return /* @__PURE__ */ t(
|
|
925
|
+
Yn,
|
|
926
|
+
{
|
|
927
|
+
group: c,
|
|
928
|
+
canDelete: ((f = c.permissions) == null ? void 0 : f.canDelete) ?? c.createdBy === s,
|
|
929
|
+
onClick: () => u(c.id),
|
|
930
|
+
onDelete: () => l(c)
|
|
931
|
+
},
|
|
932
|
+
c.id
|
|
933
|
+
);
|
|
934
|
+
}) })
|
|
928
935
|
] });
|
|
929
936
|
}
|
|
930
|
-
function
|
|
937
|
+
function Yn({
|
|
931
938
|
group: e,
|
|
932
|
-
|
|
933
|
-
onClick:
|
|
934
|
-
onDelete:
|
|
939
|
+
canDelete: n,
|
|
940
|
+
onClick: a,
|
|
941
|
+
onDelete: r
|
|
935
942
|
}) {
|
|
936
943
|
let s = "";
|
|
937
944
|
try {
|
|
938
|
-
s =
|
|
945
|
+
s = sr(new Date(e.createdAt), "MMM d, yyyy");
|
|
939
946
|
} catch {
|
|
940
947
|
s = "";
|
|
941
948
|
}
|
|
@@ -943,7 +950,7 @@ function Jn({
|
|
|
943
950
|
"button",
|
|
944
951
|
{
|
|
945
952
|
type: "button",
|
|
946
|
-
onClick:
|
|
953
|
+
onClick: a,
|
|
947
954
|
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",
|
|
948
955
|
children: [
|
|
949
956
|
/* @__PURE__ */ t("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__ */ t(Ya, { className: "h-3.5 w-3.5" }) }),
|
|
@@ -951,39 +958,39 @@ function Jn({
|
|
|
951
958
|
/* @__PURE__ */ t("div", { className: "truncate text-[13px] font-medium text-foreground", children: e.name }),
|
|
952
959
|
/* @__PURE__ */ i("div", { className: "mt-0.5 flex items-center gap-2 text-[11px] text-muted-foreground", children: [
|
|
953
960
|
/* @__PURE__ */ i("span", { className: "inline-flex items-center gap-1", children: [
|
|
954
|
-
/* @__PURE__ */ t(
|
|
961
|
+
/* @__PURE__ */ t(tr, { className: "h-2.5 w-2.5" }),
|
|
955
962
|
e.memberCount,
|
|
956
963
|
" member",
|
|
957
964
|
e.memberCount === 1 ? "" : "s"
|
|
958
965
|
] }),
|
|
959
|
-
s && /* @__PURE__ */ i(
|
|
966
|
+
s && /* @__PURE__ */ i(R, { children: [
|
|
960
967
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
961
968
|
/* @__PURE__ */ i("span", { className: "inline-flex items-center gap-1", children: [
|
|
962
|
-
/* @__PURE__ */ t(
|
|
969
|
+
/* @__PURE__ */ t(ar, { className: "h-2.5 w-2.5" }),
|
|
963
970
|
s
|
|
964
971
|
] })
|
|
965
972
|
] }),
|
|
966
|
-
e.description && /* @__PURE__ */ i(
|
|
973
|
+
e.description && /* @__PURE__ */ i(R, { children: [
|
|
967
974
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
968
975
|
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: e.description })
|
|
969
976
|
] })
|
|
970
977
|
] })
|
|
971
978
|
] }),
|
|
972
979
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100", children: [
|
|
973
|
-
|
|
980
|
+
n && /* @__PURE__ */ t(
|
|
974
981
|
"span",
|
|
975
982
|
{
|
|
976
983
|
role: "button",
|
|
977
984
|
tabIndex: 0,
|
|
978
985
|
onClick: (u) => {
|
|
979
|
-
u.stopPropagation(),
|
|
986
|
+
u.stopPropagation(), r();
|
|
980
987
|
},
|
|
981
988
|
onKeyDown: (u) => {
|
|
982
|
-
(u.key === "Enter" || u.key === " ") && (u.preventDefault(), u.stopPropagation(),
|
|
989
|
+
(u.key === "Enter" || u.key === " ") && (u.preventDefault(), u.stopPropagation(), r());
|
|
983
990
|
},
|
|
984
991
|
"aria-label": `Delete ${e.name}`,
|
|
985
992
|
className: "flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
986
|
-
children: /* @__PURE__ */ t(
|
|
993
|
+
children: /* @__PURE__ */ t(ut, { className: "h-3 w-3" })
|
|
987
994
|
}
|
|
988
995
|
),
|
|
989
996
|
/* @__PURE__ */ t(ga, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
@@ -992,9 +999,9 @@ function Jn({
|
|
|
992
999
|
}
|
|
993
1000
|
);
|
|
994
1001
|
}
|
|
995
|
-
function
|
|
1002
|
+
function Xn({ onCreate: e }) {
|
|
996
1003
|
return /* @__PURE__ */ i("div", { className: "flex h-full flex-col items-center justify-center gap-2 py-12 text-center", children: [
|
|
997
|
-
/* @__PURE__ */ t("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ t(
|
|
1004
|
+
/* @__PURE__ */ t("div", { className: "flex h-9 w-9 items-center justify-center rounded-full border border-border bg-muted/40 text-muted-foreground", children: /* @__PURE__ */ t(rr, { className: "h-4 w-4" }) }),
|
|
998
1005
|
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: "No groups yet" }),
|
|
999
1006
|
/* @__PURE__ */ t("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." }),
|
|
1000
1007
|
/* @__PURE__ */ i(
|
|
@@ -1004,86 +1011,91 @@ function Yn({ onCreate: e }) {
|
|
|
1004
1011
|
onClick: e,
|
|
1005
1012
|
className: "mt-1 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",
|
|
1006
1013
|
children: [
|
|
1007
|
-
/* @__PURE__ */ t(
|
|
1014
|
+
/* @__PURE__ */ t(re, { className: "h-3 w-3" }),
|
|
1008
1015
|
"New group"
|
|
1009
1016
|
]
|
|
1010
1017
|
}
|
|
1011
1018
|
)
|
|
1012
1019
|
] });
|
|
1013
1020
|
}
|
|
1014
|
-
function
|
|
1021
|
+
function Zn({
|
|
1015
1022
|
group: e,
|
|
1016
|
-
isTenantViewer:
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1023
|
+
isTenantViewer: n,
|
|
1024
|
+
canEdit: a,
|
|
1025
|
+
canDelete: r,
|
|
1026
|
+
canManageMembers: s,
|
|
1027
|
+
onBack: u,
|
|
1028
|
+
onMembersChanged: h,
|
|
1029
|
+
onUpdated: l,
|
|
1030
|
+
onRequestDelete: b
|
|
1022
1031
|
}) {
|
|
1023
1032
|
const {
|
|
1024
|
-
data:
|
|
1025
|
-
isLoading:
|
|
1026
|
-
error:
|
|
1027
|
-
refetch:
|
|
1028
|
-
} = fa(e.id),
|
|
1029
|
-
type:
|
|
1033
|
+
data: x,
|
|
1034
|
+
isLoading: p,
|
|
1035
|
+
error: c,
|
|
1036
|
+
refetch: f
|
|
1037
|
+
} = fa(e.id), m = (x == null ? void 0 : x.members) ?? Qn, g = c ? br(c, "Unable to load members for this group.") : null, o = e.type === "TENANT_GROUP" ? "tenant" : "organization", { users: y } = ha({
|
|
1038
|
+
type: o,
|
|
1030
1039
|
tenantId: e.tenantId || void 0,
|
|
1031
1040
|
active: !0,
|
|
1032
1041
|
limit: 200
|
|
1033
|
-
}),
|
|
1034
|
-
() => new Set(
|
|
1035
|
-
[
|
|
1036
|
-
),
|
|
1037
|
-
const v =
|
|
1038
|
-
return
|
|
1039
|
-
(
|
|
1042
|
+
}), S = V(
|
|
1043
|
+
() => new Set(m.map((v) => v.userId)),
|
|
1044
|
+
[m]
|
|
1045
|
+
), C = Vn(), L = Kn(), E = jn(), [D, ae] = w(!1), [Q, ne] = w(e.name), [he, W] = w(!1), [J, Y] = w(e.description || ""), [X, ge] = w(""), [be, xe] = w(!1), ve = V(() => {
|
|
1046
|
+
const v = X.trim().toLowerCase();
|
|
1047
|
+
return y.filter((U) => !S.has(U.id)).filter(
|
|
1048
|
+
(U) => !v || (U.name || "").toLowerCase().includes(v) || (U.email || "").toLowerCase().includes(v)
|
|
1040
1049
|
).slice(0, 50);
|
|
1041
|
-
}, [
|
|
1042
|
-
const v =
|
|
1043
|
-
if (
|
|
1050
|
+
}, [y, S, X]), ye = async () => {
|
|
1051
|
+
const v = Q.trim();
|
|
1052
|
+
if (ae(!1), v.length >= 3 && v !== e.name)
|
|
1044
1053
|
try {
|
|
1045
|
-
await
|
|
1054
|
+
await E.mutateAsync({
|
|
1046
1055
|
groupId: e.id,
|
|
1047
1056
|
data: { name: v }
|
|
1048
|
-
}),
|
|
1057
|
+
}), l();
|
|
1049
1058
|
} catch {
|
|
1050
1059
|
}
|
|
1051
|
-
},
|
|
1052
|
-
const v =
|
|
1053
|
-
if (
|
|
1060
|
+
}, B = async () => {
|
|
1061
|
+
const v = J.trim();
|
|
1062
|
+
if (W(!1), v !== (e.description || ""))
|
|
1054
1063
|
try {
|
|
1055
|
-
await
|
|
1064
|
+
await E.mutateAsync({
|
|
1056
1065
|
groupId: e.id,
|
|
1057
1066
|
data: { description: v }
|
|
1058
|
-
}),
|
|
1067
|
+
}), l();
|
|
1068
|
+
} catch {
|
|
1069
|
+
}
|
|
1070
|
+
}, Z = async (v) => {
|
|
1071
|
+
if (s) {
|
|
1072
|
+
ge(""), xe(!1);
|
|
1073
|
+
try {
|
|
1074
|
+
await C.mutateAsync({
|
|
1075
|
+
groupId: e.id,
|
|
1076
|
+
data: {
|
|
1077
|
+
userIds: [v.id],
|
|
1078
|
+
userType: o === "tenant" ? "tenant" : "org"
|
|
1079
|
+
}
|
|
1080
|
+
}), f(), h();
|
|
1059
1081
|
} catch {
|
|
1060
1082
|
}
|
|
1061
|
-
}, $e = async (v) => {
|
|
1062
|
-
he(""), be(!1);
|
|
1063
|
-
try {
|
|
1064
|
-
await y.mutateAsync({
|
|
1065
|
-
groupId: e.id,
|
|
1066
|
-
data: {
|
|
1067
|
-
userIds: [v.id],
|
|
1068
|
-
userType: p === "tenant" ? "tenant" : "org"
|
|
1069
|
-
}
|
|
1070
|
-
}), m(), s();
|
|
1071
|
-
} catch {
|
|
1072
|
-
}
|
|
1073
|
-
}, X = async (v) => {
|
|
1074
|
-
try {
|
|
1075
|
-
await S.mutateAsync({
|
|
1076
|
-
groupId: e.id,
|
|
1077
|
-
data: { userIds: [v] }
|
|
1078
|
-
}), m(), s();
|
|
1079
|
-
} catch {
|
|
1080
1083
|
}
|
|
1084
|
+
}, ee = async (v) => {
|
|
1085
|
+
if (s)
|
|
1086
|
+
try {
|
|
1087
|
+
await L.mutateAsync({
|
|
1088
|
+
groupId: e.id,
|
|
1089
|
+
data: { userIds: [v] }
|
|
1090
|
+
}), f(), h();
|
|
1091
|
+
} catch {
|
|
1092
|
+
}
|
|
1081
1093
|
};
|
|
1082
|
-
let
|
|
1094
|
+
let z = "";
|
|
1083
1095
|
try {
|
|
1084
|
-
|
|
1096
|
+
z = sr(new Date(e.createdAt), "MMM d, yyyy");
|
|
1085
1097
|
} catch {
|
|
1086
|
-
|
|
1098
|
+
z = "";
|
|
1087
1099
|
}
|
|
1088
1100
|
return /* @__PURE__ */ i("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
1089
1101
|
/* @__PURE__ */ i("div", { className: "flex h-10 shrink-0 items-center gap-1.5 border-b border-border px-5", children: [
|
|
@@ -1091,21 +1103,21 @@ function Xn({
|
|
|
1091
1103
|
"button",
|
|
1092
1104
|
{
|
|
1093
1105
|
type: "button",
|
|
1094
|
-
onClick:
|
|
1106
|
+
onClick: u,
|
|
1095
1107
|
"aria-label": "Back",
|
|
1096
1108
|
className: "-ml-1 flex h-6 w-6 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
1097
|
-
children: /* @__PURE__ */ t(
|
|
1109
|
+
children: /* @__PURE__ */ t(er, { className: "h-3.5 w-3.5" })
|
|
1098
1110
|
}
|
|
1099
1111
|
),
|
|
1100
|
-
|
|
1112
|
+
D ? /* @__PURE__ */ t(
|
|
1101
1113
|
"input",
|
|
1102
1114
|
{
|
|
1103
1115
|
autoFocus: !0,
|
|
1104
|
-
value:
|
|
1105
|
-
onChange: (v) =>
|
|
1106
|
-
onBlur:
|
|
1116
|
+
value: Q,
|
|
1117
|
+
onChange: (v) => ne(v.target.value),
|
|
1118
|
+
onBlur: ye,
|
|
1107
1119
|
onKeyDown: (v) => {
|
|
1108
|
-
v.key === "Enter" &&
|
|
1120
|
+
v.key === "Enter" && ye(), v.key === "Escape" && (ne(e.name), ae(!1));
|
|
1109
1121
|
},
|
|
1110
1122
|
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"
|
|
1111
1123
|
}
|
|
@@ -1114,32 +1126,32 @@ function Xn({
|
|
|
1114
1126
|
{
|
|
1115
1127
|
type: "button",
|
|
1116
1128
|
onClick: () => {
|
|
1117
|
-
|
|
1129
|
+
a && (ne(e.name), ae(!0));
|
|
1118
1130
|
},
|
|
1119
|
-
title:
|
|
1120
|
-
disabled: !
|
|
1131
|
+
title: a ? "Click to rename" : e.name,
|
|
1132
|
+
disabled: !a,
|
|
1121
1133
|
className: "truncate rounded-[3px] px-1 text-[13px] font-medium text-foreground enabled:hover:bg-accent disabled:cursor-default",
|
|
1122
1134
|
children: e.name
|
|
1123
1135
|
}
|
|
1124
1136
|
),
|
|
1125
1137
|
/* @__PURE__ */ i("span", { className: "ml-1 inline-flex shrink-0 items-center gap-1 text-[10.5px] text-muted-foreground", children: [
|
|
1126
|
-
/* @__PURE__ */ t(
|
|
1127
|
-
|
|
1138
|
+
/* @__PURE__ */ t(tr, { className: "h-2.5 w-2.5" }),
|
|
1139
|
+
m.length,
|
|
1128
1140
|
" member",
|
|
1129
|
-
|
|
1141
|
+
m.length === 1 ? "" : "s"
|
|
1130
1142
|
] })
|
|
1131
1143
|
] }),
|
|
1132
|
-
/* @__PURE__ */ t("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children:
|
|
1144
|
+
/* @__PURE__ */ t("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: he ? /* @__PURE__ */ i("div", { children: [
|
|
1133
1145
|
/* @__PURE__ */ t(
|
|
1134
1146
|
"textarea",
|
|
1135
1147
|
{
|
|
1136
1148
|
autoFocus: !0,
|
|
1137
1149
|
rows: 2,
|
|
1138
|
-
value:
|
|
1139
|
-
onChange: (v) =>
|
|
1150
|
+
value: J,
|
|
1151
|
+
onChange: (v) => Y(v.target.value),
|
|
1140
1152
|
maxLength: 200,
|
|
1141
1153
|
onKeyDown: (v) => {
|
|
1142
|
-
v.key === "Escape" && (
|
|
1154
|
+
v.key === "Escape" && (Y(e.description || ""), W(!1)), v.key === "Enter" && (v.metaKey || v.ctrlKey) && B();
|
|
1143
1155
|
},
|
|
1144
1156
|
placeholder: "What is this group for?",
|
|
1145
1157
|
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"
|
|
@@ -1147,7 +1159,7 @@ function Xn({
|
|
|
1147
1159
|
),
|
|
1148
1160
|
/* @__PURE__ */ i("div", { className: "mt-1.5 flex items-center justify-between", children: [
|
|
1149
1161
|
/* @__PURE__ */ i("span", { className: "text-[10.5px] text-muted-foreground", children: [
|
|
1150
|
-
|
|
1162
|
+
J.length,
|
|
1151
1163
|
"/200 · Esc to cancel · ⌘↩ to save"
|
|
1152
1164
|
] }),
|
|
1153
1165
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
|
|
@@ -1156,7 +1168,7 @@ function Xn({
|
|
|
1156
1168
|
{
|
|
1157
1169
|
type: "button",
|
|
1158
1170
|
onClick: () => {
|
|
1159
|
-
|
|
1171
|
+
Y(e.description || ""), W(!1);
|
|
1160
1172
|
},
|
|
1161
1173
|
className: "h-6 rounded-[5px] px-2 text-[11px] font-medium text-foreground/80 hover:bg-accent",
|
|
1162
1174
|
children: "Cancel"
|
|
@@ -1166,7 +1178,7 @@ function Xn({
|
|
|
1166
1178
|
"button",
|
|
1167
1179
|
{
|
|
1168
1180
|
type: "button",
|
|
1169
|
-
onClick:
|
|
1181
|
+
onClick: B,
|
|
1170
1182
|
className: "inline-flex h-6 items-center rounded-[5px] bg-foreground px-2 text-[11px] font-medium text-background hover:opacity-90",
|
|
1171
1183
|
children: "Save"
|
|
1172
1184
|
}
|
|
@@ -1178,71 +1190,71 @@ function Xn({
|
|
|
1178
1190
|
{
|
|
1179
1191
|
type: "button",
|
|
1180
1192
|
onClick: () => {
|
|
1181
|
-
|
|
1193
|
+
a && (Y(e.description || ""), W(!0));
|
|
1182
1194
|
},
|
|
1183
|
-
disabled: !
|
|
1184
|
-
title:
|
|
1195
|
+
disabled: !a,
|
|
1196
|
+
title: a ? "Click to edit description" : void 0,
|
|
1185
1197
|
className: "block w-full rounded-[3px] px-1 py-0.5 text-left enabled:hover:bg-accent/40 disabled:cursor-default",
|
|
1186
1198
|
children: [
|
|
1187
|
-
e.description ? /* @__PURE__ */ t("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: e.description }) : /* @__PURE__ */ t("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children:
|
|
1199
|
+
e.description ? /* @__PURE__ */ t("p", { className: "text-[12px] leading-[1.55] text-foreground/90", children: e.description }) : /* @__PURE__ */ t("p", { className: "text-[12px] leading-[1.55] text-muted-foreground", children: a ? "Add a description…" : "No description" }),
|
|
1188
1200
|
/* @__PURE__ */ i("p", { className: "mt-1 text-[10.5px] text-muted-foreground", children: [
|
|
1189
|
-
|
|
1190
|
-
|
|
1201
|
+
z ? `Created ${z}` : "Recently created",
|
|
1202
|
+
a ? " · You can edit this group" : ""
|
|
1191
1203
|
] })
|
|
1192
1204
|
]
|
|
1193
1205
|
}
|
|
1194
1206
|
) }),
|
|
1195
|
-
/* @__PURE__ */ t(
|
|
1196
|
-
|
|
1207
|
+
s && /* @__PURE__ */ t(
|
|
1208
|
+
ts,
|
|
1197
1209
|
{
|
|
1198
|
-
query:
|
|
1199
|
-
setQuery:
|
|
1200
|
-
open:
|
|
1201
|
-
setOpen:
|
|
1202
|
-
candidates:
|
|
1203
|
-
showKindChip: !
|
|
1204
|
-
onAdd:
|
|
1205
|
-
busy:
|
|
1210
|
+
query: X,
|
|
1211
|
+
setQuery: ge,
|
|
1212
|
+
open: be,
|
|
1213
|
+
setOpen: xe,
|
|
1214
|
+
candidates: ve,
|
|
1215
|
+
showKindChip: !n,
|
|
1216
|
+
onAdd: Z,
|
|
1217
|
+
busy: C.isPending
|
|
1206
1218
|
}
|
|
1207
1219
|
),
|
|
1208
|
-
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto", children:
|
|
1220
|
+
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto", children: p ? /* @__PURE__ */ t("div", { className: "space-y-px p-3", children: [1, 2, 3].map((v) => /* @__PURE__ */ t(
|
|
1209
1221
|
"div",
|
|
1210
1222
|
{
|
|
1211
1223
|
className: "h-10 animate-pulse rounded-[4px] bg-muted/60"
|
|
1212
1224
|
},
|
|
1213
1225
|
v
|
|
1214
1226
|
)) }) : g ? /* @__PURE__ */ t(
|
|
1215
|
-
|
|
1227
|
+
xr,
|
|
1216
1228
|
{
|
|
1217
1229
|
title: "Can't load members",
|
|
1218
1230
|
message: g,
|
|
1219
|
-
onRetry: () =>
|
|
1231
|
+
onRetry: () => f()
|
|
1220
1232
|
}
|
|
1221
|
-
) :
|
|
1233
|
+
) : m.length === 0 ? /* @__PURE__ */ i("div", { className: "flex h-full flex-col items-center justify-center gap-1 py-10 text-center", children: [
|
|
1222
1234
|
/* @__PURE__ */ t("div", { className: "text-[12px] text-foreground", children: "No members yet" }),
|
|
1223
|
-
/* @__PURE__ */ t("div", { className: "text-[11px] text-muted-foreground", children: "Search above to add people to this group." })
|
|
1224
|
-
] }) :
|
|
1225
|
-
var
|
|
1235
|
+
/* @__PURE__ */ t("div", { className: "text-[11px] text-muted-foreground", children: s ? "Search above to add people to this group." : "This group does not have any members." })
|
|
1236
|
+
] }) : m.map((v) => {
|
|
1237
|
+
var U, H, we, Ne, Se, A;
|
|
1226
1238
|
return /* @__PURE__ */ i(
|
|
1227
1239
|
"div",
|
|
1228
1240
|
{
|
|
1229
1241
|
className: "group flex items-center gap-2 border-b border-border/60 px-5 py-2",
|
|
1230
1242
|
children: [
|
|
1231
|
-
/* @__PURE__ */ t(
|
|
1243
|
+
/* @__PURE__ */ t(vr, { name: ((U = v.user) == null ? void 0 : U.name) || ((H = v.user) == null ? void 0 : H.email) || "?" }),
|
|
1232
1244
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
1233
|
-
/* @__PURE__ */ t("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((
|
|
1234
|
-
((
|
|
1245
|
+
/* @__PURE__ */ t("div", { className: "truncate text-[12.5px] font-medium text-foreground", children: ((we = v.user) == null ? void 0 : we.name) || ((Ne = v.user) == null ? void 0 : Ne.email) || "Unknown" }),
|
|
1246
|
+
((Se = v.user) == null ? void 0 : Se.email) && v.user.name && /* @__PURE__ */ t("div", { className: "truncate text-[10.5px] text-muted-foreground", children: v.user.email })
|
|
1235
1247
|
] }),
|
|
1236
|
-
!
|
|
1248
|
+
!n && /* @__PURE__ */ t("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: v.userType }),
|
|
1237
1249
|
/* @__PURE__ */ t(
|
|
1238
1250
|
"button",
|
|
1239
1251
|
{
|
|
1240
1252
|
type: "button",
|
|
1241
|
-
onClick: () =>
|
|
1242
|
-
disabled:
|
|
1243
|
-
"aria-label": `Remove ${((
|
|
1253
|
+
onClick: () => ee(v.userId),
|
|
1254
|
+
disabled: !s || L.isPending,
|
|
1255
|
+
"aria-label": `Remove ${((A = v.user) == null ? void 0 : A.name) || "member"}`,
|
|
1244
1256
|
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",
|
|
1245
|
-
children: /* @__PURE__ */ t(
|
|
1257
|
+
children: /* @__PURE__ */ t(Qt, { className: "h-3 w-3" })
|
|
1246
1258
|
}
|
|
1247
1259
|
)
|
|
1248
1260
|
]
|
|
@@ -1254,47 +1266,47 @@ function Xn({
|
|
|
1254
1266
|
"button",
|
|
1255
1267
|
{
|
|
1256
1268
|
type: "button",
|
|
1257
|
-
onClick:
|
|
1269
|
+
onClick: b,
|
|
1258
1270
|
className: "inline-flex h-7 items-center gap-1.5 rounded-[5px] border border-rose-200 bg-background px-2.5 text-[12px] font-medium text-rose-600 hover:bg-rose-50 dark:border-rose-900/60 dark:text-rose-400 dark:hover:bg-rose-950/30",
|
|
1259
1271
|
children: [
|
|
1260
|
-
/* @__PURE__ */ t(
|
|
1272
|
+
/* @__PURE__ */ t(ut, { className: "h-3 w-3" }),
|
|
1261
1273
|
"Delete group"
|
|
1262
1274
|
]
|
|
1263
1275
|
}
|
|
1264
1276
|
) })
|
|
1265
1277
|
] });
|
|
1266
1278
|
}
|
|
1267
|
-
function
|
|
1279
|
+
function es({
|
|
1268
1280
|
isTenantUser: e,
|
|
1269
|
-
tenantId:
|
|
1270
|
-
onCancel:
|
|
1271
|
-
onCreated:
|
|
1281
|
+
tenantId: n,
|
|
1282
|
+
onCancel: a,
|
|
1283
|
+
onCreated: r
|
|
1272
1284
|
}) {
|
|
1273
|
-
const [s, u] = w(""), [
|
|
1285
|
+
const [s, u] = w(""), [h, l] = w(""), [b, x] = w(null), p = Hn(), c = s.trim().length >= 3 && s.trim().length <= 50, f = async () => {
|
|
1274
1286
|
if (!c) return;
|
|
1275
1287
|
x(null);
|
|
1276
|
-
const
|
|
1288
|
+
const m = {
|
|
1277
1289
|
name: s.trim(),
|
|
1278
|
-
description:
|
|
1290
|
+
description: h.trim() || void 0,
|
|
1279
1291
|
type: e ? "TENANT_GROUP" : "ORG_GROUP",
|
|
1280
|
-
...e &&
|
|
1292
|
+
...e && n ? { tenantId: n } : {}
|
|
1281
1293
|
};
|
|
1282
1294
|
try {
|
|
1283
|
-
const
|
|
1284
|
-
o ?
|
|
1285
|
-
} catch (
|
|
1286
|
-
x(
|
|
1295
|
+
const g = await p.mutateAsync(m), o = g == null ? void 0 : g.id;
|
|
1296
|
+
o ? r(o) : a();
|
|
1297
|
+
} catch (g) {
|
|
1298
|
+
x(g instanceof Error ? g.message : "Failed to create group");
|
|
1287
1299
|
}
|
|
1288
1300
|
};
|
|
1289
1301
|
return /* @__PURE__ */ i("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
1290
1302
|
/* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
|
|
1291
|
-
/* @__PURE__ */ t(
|
|
1303
|
+
/* @__PURE__ */ t(jt, { children: "Name" }),
|
|
1292
1304
|
/* @__PURE__ */ t(
|
|
1293
1305
|
"input",
|
|
1294
1306
|
{
|
|
1295
1307
|
autoFocus: !0,
|
|
1296
1308
|
value: s,
|
|
1297
|
-
onChange: (
|
|
1309
|
+
onChange: (m) => u(m.target.value),
|
|
1298
1310
|
placeholder: "Marketing leads, North America sales, …",
|
|
1299
1311
|
maxLength: 50,
|
|
1300
1312
|
className: "mt-1 block h-7 w-full rounded-[5px] border border-border bg-background px-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-foreground/40 focus:outline-none"
|
|
@@ -1302,20 +1314,20 @@ function Zn({
|
|
|
1302
1314
|
),
|
|
1303
1315
|
/* @__PURE__ */ t("div", { className: "mt-1 text-[10.5px] text-muted-foreground", children: "3–50 characters." }),
|
|
1304
1316
|
/* @__PURE__ */ i("div", { className: "mt-4", children: [
|
|
1305
|
-
/* @__PURE__ */ t(
|
|
1317
|
+
/* @__PURE__ */ t(jt, { children: "Description (optional)" }),
|
|
1306
1318
|
/* @__PURE__ */ t(
|
|
1307
1319
|
"textarea",
|
|
1308
1320
|
{
|
|
1309
1321
|
rows: 2,
|
|
1310
|
-
value:
|
|
1311
|
-
onChange: (
|
|
1322
|
+
value: h,
|
|
1323
|
+
onChange: (m) => l(m.target.value),
|
|
1312
1324
|
maxLength: 200,
|
|
1313
1325
|
placeholder: "What is this group for?",
|
|
1314
1326
|
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"
|
|
1315
1327
|
}
|
|
1316
1328
|
),
|
|
1317
1329
|
/* @__PURE__ */ i("div", { className: "mt-1 flex justify-end text-[10.5px] text-muted-foreground", children: [
|
|
1318
|
-
|
|
1330
|
+
h.length,
|
|
1319
1331
|
"/200"
|
|
1320
1332
|
] })
|
|
1321
1333
|
] }),
|
|
@@ -1326,8 +1338,8 @@ function Zn({
|
|
|
1326
1338
|
"button",
|
|
1327
1339
|
{
|
|
1328
1340
|
type: "button",
|
|
1329
|
-
onClick:
|
|
1330
|
-
disabled:
|
|
1341
|
+
onClick: a,
|
|
1342
|
+
disabled: p.isPending,
|
|
1331
1343
|
className: "h-7 rounded-[5px] px-2.5 text-[12px] font-medium text-foreground/80 hover:bg-accent",
|
|
1332
1344
|
children: "Cancel"
|
|
1333
1345
|
}
|
|
@@ -1336,14 +1348,14 @@ function Zn({
|
|
|
1336
1348
|
"button",
|
|
1337
1349
|
{
|
|
1338
1350
|
type: "button",
|
|
1339
|
-
onClick:
|
|
1340
|
-
disabled: !c ||
|
|
1351
|
+
onClick: f,
|
|
1352
|
+
disabled: !c || p.isPending,
|
|
1341
1353
|
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",
|
|
1342
|
-
children:
|
|
1343
|
-
/* @__PURE__ */ t(
|
|
1354
|
+
children: p.isPending ? /* @__PURE__ */ i(R, { children: [
|
|
1355
|
+
/* @__PURE__ */ t($e, { className: "h-3 w-3 animate-spin" }),
|
|
1344
1356
|
"Creating…"
|
|
1345
|
-
] }) : /* @__PURE__ */ i(
|
|
1346
|
-
/* @__PURE__ */ t(
|
|
1357
|
+
] }) : /* @__PURE__ */ i(R, { children: [
|
|
1358
|
+
/* @__PURE__ */ t(re, { className: "h-3 w-3" }),
|
|
1347
1359
|
"Create group"
|
|
1348
1360
|
] })
|
|
1349
1361
|
}
|
|
@@ -1351,46 +1363,46 @@ function Zn({
|
|
|
1351
1363
|
] })
|
|
1352
1364
|
] });
|
|
1353
1365
|
}
|
|
1354
|
-
function
|
|
1366
|
+
function ts({
|
|
1355
1367
|
query: e,
|
|
1356
|
-
setQuery:
|
|
1357
|
-
open:
|
|
1358
|
-
setOpen:
|
|
1368
|
+
setQuery: n,
|
|
1369
|
+
open: a,
|
|
1370
|
+
setOpen: r,
|
|
1359
1371
|
candidates: s,
|
|
1360
1372
|
showKindChip: u,
|
|
1361
|
-
onAdd:
|
|
1373
|
+
onAdd: h,
|
|
1362
1374
|
busy: l
|
|
1363
1375
|
}) {
|
|
1364
|
-
const b =
|
|
1376
|
+
const b = $t(null), x = $t(null), [p, c] = w(null);
|
|
1365
1377
|
Qa(() => {
|
|
1366
|
-
if (!
|
|
1378
|
+
if (!a) {
|
|
1367
1379
|
c(null);
|
|
1368
1380
|
return;
|
|
1369
1381
|
}
|
|
1370
|
-
const
|
|
1371
|
-
const
|
|
1372
|
-
if (!
|
|
1373
|
-
const o =
|
|
1382
|
+
const m = () => {
|
|
1383
|
+
const g = b.current;
|
|
1384
|
+
if (!g) return;
|
|
1385
|
+
const o = g.getBoundingClientRect(), y = 240, C = window.innerHeight - o.bottom < y + 16 && o.top > y;
|
|
1374
1386
|
c({
|
|
1375
1387
|
left: o.left,
|
|
1376
|
-
top:
|
|
1388
|
+
top: C ? o.top - 6 : o.bottom + 6,
|
|
1377
1389
|
width: o.width,
|
|
1378
|
-
above:
|
|
1390
|
+
above: C
|
|
1379
1391
|
});
|
|
1380
1392
|
};
|
|
1381
|
-
return
|
|
1382
|
-
window.removeEventListener("resize",
|
|
1393
|
+
return m(), window.addEventListener("resize", m), window.addEventListener("scroll", m, !0), () => {
|
|
1394
|
+
window.removeEventListener("resize", m), window.removeEventListener("scroll", m, !0);
|
|
1383
1395
|
};
|
|
1384
|
-
}, [
|
|
1385
|
-
if (!
|
|
1386
|
-
const
|
|
1396
|
+
}, [a, s.length]), Ge(() => {
|
|
1397
|
+
if (!a) return;
|
|
1398
|
+
const m = (g) => {
|
|
1387
1399
|
var y, S;
|
|
1388
|
-
const o =
|
|
1389
|
-
(y = b.current) != null && y.contains(o) || (S = x.current) != null && S.contains(o) ||
|
|
1400
|
+
const o = g.target;
|
|
1401
|
+
(y = b.current) != null && y.contains(o) || (S = x.current) != null && S.contains(o) || r(!1);
|
|
1390
1402
|
};
|
|
1391
|
-
return document.addEventListener("mousedown",
|
|
1392
|
-
}, [
|
|
1393
|
-
const
|
|
1403
|
+
return document.addEventListener("mousedown", m), () => document.removeEventListener("mousedown", m);
|
|
1404
|
+
}, [a, r]);
|
|
1405
|
+
const f = a && s.length > 0 && p;
|
|
1394
1406
|
return /* @__PURE__ */ i("div", { className: "shrink-0 border-b border-border px-5 py-2.5", children: [
|
|
1395
1407
|
/* @__PURE__ */ i(
|
|
1396
1408
|
"div",
|
|
@@ -1403,10 +1415,10 @@ function es({
|
|
|
1403
1415
|
"input",
|
|
1404
1416
|
{
|
|
1405
1417
|
value: e,
|
|
1406
|
-
onChange: (
|
|
1407
|
-
|
|
1418
|
+
onChange: (m) => {
|
|
1419
|
+
n(m.target.value), r(!0);
|
|
1408
1420
|
},
|
|
1409
|
-
onFocus: () =>
|
|
1421
|
+
onFocus: () => r(!0),
|
|
1410
1422
|
placeholder: "Add a member by name or email…",
|
|
1411
1423
|
disabled: l,
|
|
1412
1424
|
className: "h-7 flex-1 bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed"
|
|
@@ -1415,35 +1427,35 @@ function es({
|
|
|
1415
1427
|
]
|
|
1416
1428
|
}
|
|
1417
1429
|
),
|
|
1418
|
-
|
|
1430
|
+
f && typeof document < "u" && Ja(
|
|
1419
1431
|
/* @__PURE__ */ t(
|
|
1420
1432
|
"div",
|
|
1421
1433
|
{
|
|
1422
1434
|
ref: x,
|
|
1423
1435
|
style: {
|
|
1424
1436
|
position: "fixed",
|
|
1425
|
-
left:
|
|
1426
|
-
top:
|
|
1427
|
-
width:
|
|
1428
|
-
transform:
|
|
1437
|
+
left: p.left,
|
|
1438
|
+
top: p.top,
|
|
1439
|
+
width: p.width,
|
|
1440
|
+
transform: p.above ? "translateY(-100%)" : void 0
|
|
1429
1441
|
},
|
|
1430
1442
|
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)]",
|
|
1431
|
-
children: s.map((
|
|
1443
|
+
children: s.map((m) => /* @__PURE__ */ i(
|
|
1432
1444
|
"button",
|
|
1433
1445
|
{
|
|
1434
1446
|
type: "button",
|
|
1435
|
-
onClick: () =>
|
|
1447
|
+
onClick: () => h(m),
|
|
1436
1448
|
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",
|
|
1437
1449
|
children: [
|
|
1438
|
-
/* @__PURE__ */ t(
|
|
1450
|
+
/* @__PURE__ */ t(vr, { name: m.name || m.email || "?" }),
|
|
1439
1451
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
1440
|
-
/* @__PURE__ */ t("div", { className: "truncate text-[12px] font-medium text-foreground", children:
|
|
1441
|
-
|
|
1452
|
+
/* @__PURE__ */ t("div", { className: "truncate text-[12px] font-medium text-foreground", children: m.name || m.email || "Unknown" }),
|
|
1453
|
+
m.email && m.name && /* @__PURE__ */ t("div", { className: "truncate text-[10.5px] text-muted-foreground", children: m.email })
|
|
1442
1454
|
] }),
|
|
1443
|
-
u &&
|
|
1455
|
+
u && m.type && /* @__PURE__ */ t("span", { className: "text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: m.type === "tenant" ? "tenant" : "org" })
|
|
1444
1456
|
]
|
|
1445
1457
|
},
|
|
1446
|
-
|
|
1458
|
+
m.id
|
|
1447
1459
|
))
|
|
1448
1460
|
}
|
|
1449
1461
|
),
|
|
@@ -1451,87 +1463,87 @@ function es({
|
|
|
1451
1463
|
)
|
|
1452
1464
|
] });
|
|
1453
1465
|
}
|
|
1454
|
-
function
|
|
1455
|
-
if (!e) return
|
|
1466
|
+
function br(e, n) {
|
|
1467
|
+
if (!e) return n;
|
|
1456
1468
|
if (e instanceof Error) {
|
|
1457
|
-
const
|
|
1458
|
-
return
|
|
1469
|
+
const a = e.message || "", r = a.match(/\{[\s\S]*"error"\s*:\s*"([^"]+)"[\s\S]*\}/);
|
|
1470
|
+
return r ? r[1] : a || n;
|
|
1459
1471
|
}
|
|
1460
|
-
return typeof e == "string" ? e :
|
|
1472
|
+
return typeof e == "string" ? e : n;
|
|
1461
1473
|
}
|
|
1462
|
-
function
|
|
1474
|
+
function xr({
|
|
1463
1475
|
title: e,
|
|
1464
|
-
message:
|
|
1465
|
-
onRetry:
|
|
1476
|
+
message: n,
|
|
1477
|
+
onRetry: a
|
|
1466
1478
|
}) {
|
|
1467
1479
|
return /* @__PURE__ */ i("div", { className: "flex h-full flex-col items-center justify-center gap-2 px-6 py-10 text-center", children: [
|
|
1468
1480
|
/* @__PURE__ */ t("div", { className: "text-[12.5px] font-medium text-foreground", children: e }),
|
|
1469
|
-
/* @__PURE__ */ t("div", { className: "max-w-[360px] text-[11.5px] leading-[1.55] text-muted-foreground", children:
|
|
1470
|
-
|
|
1481
|
+
/* @__PURE__ */ t("div", { className: "max-w-[360px] text-[11.5px] leading-[1.55] text-muted-foreground", children: n }),
|
|
1482
|
+
a && /* @__PURE__ */ t(
|
|
1471
1483
|
"button",
|
|
1472
1484
|
{
|
|
1473
1485
|
type: "button",
|
|
1474
|
-
onClick:
|
|
1486
|
+
onClick: a,
|
|
1475
1487
|
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",
|
|
1476
1488
|
children: "Try again"
|
|
1477
1489
|
}
|
|
1478
1490
|
)
|
|
1479
1491
|
] });
|
|
1480
1492
|
}
|
|
1481
|
-
function
|
|
1493
|
+
function jt({ children: e }) {
|
|
1482
1494
|
return /* @__PURE__ */ t("label", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: e });
|
|
1483
1495
|
}
|
|
1484
|
-
function
|
|
1485
|
-
const
|
|
1486
|
-
return /* @__PURE__ */ t(
|
|
1496
|
+
function vr({ name: e }) {
|
|
1497
|
+
const n = e.split(" ").map((a) => a[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
1498
|
+
return /* @__PURE__ */ t(hr, { className: "h-6 w-6 shrink-0", children: /* @__PURE__ */ t(gr, { className: "text-[9px] font-semibold", children: n || "?" }) });
|
|
1487
1499
|
}
|
|
1488
|
-
function ce(e,
|
|
1489
|
-
var u,
|
|
1490
|
-
const
|
|
1491
|
-
(l) => l.id ===
|
|
1500
|
+
function ce(e, n, a) {
|
|
1501
|
+
var u, h;
|
|
1502
|
+
const r = (e.controls || []).find(
|
|
1503
|
+
(l) => l.id === a
|
|
1492
1504
|
);
|
|
1493
|
-
if (
|
|
1494
|
-
return
|
|
1495
|
-
const s = (
|
|
1496
|
-
(l) => l.id ===
|
|
1505
|
+
if (r)
|
|
1506
|
+
return r.label;
|
|
1507
|
+
const s = (h = (u = Wt(e, n)) == null ? void 0 : u.controls) == null ? void 0 : h.find(
|
|
1508
|
+
(l) => l.id === a
|
|
1497
1509
|
);
|
|
1498
|
-
return (s == null ? void 0 : s.label) ||
|
|
1510
|
+
return (s == null ? void 0 : s.label) || a;
|
|
1499
1511
|
}
|
|
1500
|
-
function le(e,
|
|
1501
|
-
var
|
|
1502
|
-
return ((
|
|
1512
|
+
function le(e, n) {
|
|
1513
|
+
var a;
|
|
1514
|
+
return ((a = Wt(e, n)) == null ? void 0 : a.title) || n;
|
|
1503
1515
|
}
|
|
1504
|
-
function
|
|
1505
|
-
const { errors:
|
|
1506
|
-
if (!
|
|
1507
|
-
return
|
|
1508
|
-
const
|
|
1509
|
-
for (const s of
|
|
1516
|
+
function rs(e) {
|
|
1517
|
+
const { errors: n, dashboard: a } = e;
|
|
1518
|
+
if (!a)
|
|
1519
|
+
return n;
|
|
1520
|
+
const r = /* @__PURE__ */ new Map();
|
|
1521
|
+
for (const s of n) {
|
|
1510
1522
|
const u = s.match(
|
|
1511
1523
|
/^Card '(.+)' binding for control '(.+)' maps to missing metric '(.+)'\.$/
|
|
1512
1524
|
);
|
|
1513
1525
|
if (u) {
|
|
1514
|
-
const [,
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
`"${le(
|
|
1518
|
-
|
|
1519
|
-
|
|
1526
|
+
const [, p, c] = u, f = `${p}:${c}:missing-metric`;
|
|
1527
|
+
r.has(f) || r.set(
|
|
1528
|
+
f,
|
|
1529
|
+
`"${le(a, p)}" has an outdated "${ce(
|
|
1530
|
+
a,
|
|
1531
|
+
p,
|
|
1520
1532
|
c
|
|
1521
1533
|
)}" mapping. Some choices still point to metrics that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1522
1534
|
);
|
|
1523
1535
|
continue;
|
|
1524
1536
|
}
|
|
1525
|
-
const
|
|
1537
|
+
const h = s.match(
|
|
1526
1538
|
/^Card '(.+)' binding for control '(.+)' maps to missing group-by field '(.+)'\.$/
|
|
1527
1539
|
);
|
|
1528
|
-
if (
|
|
1529
|
-
const [,
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
`"${le(
|
|
1533
|
-
|
|
1534
|
-
|
|
1540
|
+
if (h) {
|
|
1541
|
+
const [, p, c] = h, f = `${p}:${c}:missing-group-by`;
|
|
1542
|
+
r.has(f) || r.set(
|
|
1543
|
+
f,
|
|
1544
|
+
`"${le(a, p)}" has an outdated "${ce(
|
|
1545
|
+
a,
|
|
1546
|
+
p,
|
|
1535
1547
|
c
|
|
1536
1548
|
)}" mapping. Some choices still point to fields that are no longer available on this card. Open the card controls and choose replacements.`
|
|
1537
1549
|
);
|
|
@@ -1541,12 +1553,12 @@ function ts(e) {
|
|
|
1541
1553
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid metric target\.$/
|
|
1542
1554
|
);
|
|
1543
1555
|
if (l) {
|
|
1544
|
-
const [,
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
`"${le(
|
|
1548
|
-
|
|
1549
|
-
|
|
1556
|
+
const [, p, c] = l, f = `${p}:${c}:invalid-metric`;
|
|
1557
|
+
r.has(f) || r.set(
|
|
1558
|
+
f,
|
|
1559
|
+
`"${le(a, p)}" has an invalid "${ce(
|
|
1560
|
+
a,
|
|
1561
|
+
p,
|
|
1550
1562
|
c
|
|
1551
1563
|
)}" metric mapping. Open the card controls and choose a valid metric for each option.`
|
|
1552
1564
|
);
|
|
@@ -1556,12 +1568,12 @@ function ts(e) {
|
|
|
1556
1568
|
/^Card '(.+)' binding for control '(.+)' maps to an invalid group-by target\.$/
|
|
1557
1569
|
);
|
|
1558
1570
|
if (b) {
|
|
1559
|
-
const [,
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
`"${le(
|
|
1563
|
-
|
|
1564
|
-
|
|
1571
|
+
const [, p, c] = b, f = `${p}:${c}:invalid-group-by`;
|
|
1572
|
+
r.has(f) || r.set(
|
|
1573
|
+
f,
|
|
1574
|
+
`"${le(a, p)}" has an invalid "${ce(
|
|
1575
|
+
a,
|
|
1576
|
+
p,
|
|
1565
1577
|
c
|
|
1566
1578
|
)}" field mapping. Open the card controls and choose a valid field for each option.`
|
|
1567
1579
|
);
|
|
@@ -1571,65 +1583,65 @@ function ts(e) {
|
|
|
1571
1583
|
/^Card '(.+)' binding for control '(.+)' requires at least one temporal group-by field\.$/
|
|
1572
1584
|
);
|
|
1573
1585
|
if (x) {
|
|
1574
|
-
const [,
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
`"${le(
|
|
1578
|
-
|
|
1579
|
-
|
|
1586
|
+
const [, p, c] = x, f = `${p}:${c}:missing-temporal-group-by`;
|
|
1587
|
+
r.has(f) || r.set(
|
|
1588
|
+
f,
|
|
1589
|
+
`"${le(a, p)}" can no longer use "${ce(
|
|
1590
|
+
a,
|
|
1591
|
+
p,
|
|
1580
1592
|
c
|
|
1581
1593
|
)}" for time grain because the card does not currently group by a date field.`
|
|
1582
1594
|
);
|
|
1583
1595
|
continue;
|
|
1584
1596
|
}
|
|
1585
|
-
|
|
1597
|
+
r.set(s, s);
|
|
1586
1598
|
}
|
|
1587
|
-
return Array.from(
|
|
1599
|
+
return Array.from(r.values());
|
|
1588
1600
|
}
|
|
1589
|
-
function
|
|
1590
|
-
return typeof e == "boolean" ? e : typeof
|
|
1601
|
+
function as(e, n) {
|
|
1602
|
+
return typeof e == "boolean" ? e : typeof n == "boolean" ? n : !0;
|
|
1591
1603
|
}
|
|
1592
|
-
function
|
|
1604
|
+
function qt(e, n) {
|
|
1593
1605
|
return {
|
|
1594
|
-
dashboard:
|
|
1595
|
-
semanticExecutionPayload:
|
|
1606
|
+
dashboard: st(e),
|
|
1607
|
+
semanticExecutionPayload: st(n)
|
|
1596
1608
|
};
|
|
1597
1609
|
}
|
|
1598
|
-
function
|
|
1599
|
-
var
|
|
1610
|
+
function vs() {
|
|
1611
|
+
var Et, Lt, It, At, Mt, Pt, Ot;
|
|
1600
1612
|
Xa(), Za();
|
|
1601
1613
|
const {
|
|
1602
1614
|
authToken: e,
|
|
1603
|
-
tokenProps:
|
|
1604
|
-
id:
|
|
1605
|
-
showBriefings:
|
|
1606
|
-
} =
|
|
1615
|
+
tokenProps: n,
|
|
1616
|
+
id: a,
|
|
1617
|
+
showBriefings: r
|
|
1618
|
+
} = G(), { isLocalDev: s } = ba(), { openBrandStudioPreview: u } = xa(), { permissions: h } = Ln(), l = va(), { isLoading: b } = ya(), x = N((d) => d.theme), p = N((d) => d.isDownloadingPdf), c = N(
|
|
1607
1619
|
(d) => d.dashboardAssistantDraftScopeKey
|
|
1608
|
-
),
|
|
1620
|
+
), f = N((d) => d.lenses), m = N((d) => d.selectedLensId), g = f == null ? void 0 : f.find((d) => d.id === m), o = N((d) => d.dashboard), y = N((d) => d.selectedSheetId), S = (Et = o == null ? void 0 : o.sheets) == null ? void 0 : Et.find(
|
|
1609
1621
|
(d) => d.id === y
|
|
1610
|
-
),
|
|
1622
|
+
), C = Kr(S), L = C ? (Lt = S == null ? void 0 : S.document) == null ? void 0 : Lt.page : void 0, E = N(
|
|
1611
1623
|
(d) => d.isDashboardEditing
|
|
1612
|
-
), { setDashboardTitle:
|
|
1624
|
+
), { setDashboardTitle: D } = N((d) => d.actions), [ae, Q] = w(!1), [ne, he] = w(!1), [W, J] = w(!1), [Y, X] = w(!1), [ge, be] = w(!1), [xe, ve] = w(!1), [ye, B] = w(!1), [Z, ee] = w(null), [z, v] = w([]), [U, H] = w(!1), we = N((d) => d.isDashboardPanelOpen), Ne = N(
|
|
1613
1625
|
(d) => d.actions.setIsDashboardPanelOpen
|
|
1614
|
-
),
|
|
1615
|
-
|
|
1616
|
-
const se =
|
|
1626
|
+
), Se = N((d) => d.filterValues), A = N((d) => d.isVisualEditing);
|
|
1627
|
+
Rt((d) => d.card);
|
|
1628
|
+
const se = Ue(
|
|
1617
1629
|
(d) => d.selectedDashboard
|
|
1618
|
-
),
|
|
1630
|
+
), De = Ue(
|
|
1619
1631
|
(d) => d.initialDashboard
|
|
1620
1632
|
);
|
|
1621
|
-
|
|
1622
|
-
const
|
|
1633
|
+
Ue((d) => d.selectedVisual), N((d) => d.selectedFrameId), Rt((d) => d.frame);
|
|
1634
|
+
const Ce = se ? (At = se == null ? void 0 : se.permissions) == null ? void 0 : At.canEdit : (It = De == null ? void 0 : De.permissions) == null ? void 0 : It.canEdit, ft = N(
|
|
1623
1635
|
(d) => d.showDashboardJSON
|
|
1624
|
-
),
|
|
1625
|
-
setIsDashboardEditing:
|
|
1626
|
-
setShowDashboardJSON:
|
|
1627
|
-
} = N((d) => d.actions), { setInitialDashboard:
|
|
1636
|
+
), Be = N((d) => d.onSaveFunction), {
|
|
1637
|
+
setIsDashboardEditing: ht,
|
|
1638
|
+
setShowDashboardJSON: gt
|
|
1639
|
+
} = N((d) => d.actions), { setInitialDashboard: bt, clearSelectedDashboard: ze } = Ue(
|
|
1628
1640
|
(d) => d.actions
|
|
1629
|
-
), { resources:
|
|
1630
|
-
id:
|
|
1631
|
-
title: (o == null ? void 0 : o.title) ||
|
|
1632
|
-
} : null, { handleAddNewFrame: Cr } = Ca(), [
|
|
1641
|
+
), { resources: ke } = wa(Ye.DASHBOARD), { data: He } = Na(), yr = ((Mt = He == null ? void 0 : He.preference) == null ? void 0 : Mt.defaultDashboardId) || null, { mutate: wr, isPending: Nr } = Sa(), { currentUser: Sr } = lt(), Dr = Da(Sr), T = se || De, xt = T ? {
|
|
1642
|
+
id: T.id,
|
|
1643
|
+
title: (o == null ? void 0 : o.title) || T.title || "Dashboard"
|
|
1644
|
+
} : null, { handleAddNewFrame: Cr } = Ca(), [je, qe] = w(!1), [kr, oe] = w(!1), [Ve, Ee] = w("close"), ie = ka(Ye.DASHBOARD), [O, Le] = w(null), Er = async (d, M) => {
|
|
1633
1645
|
if (!(o != null && o.id)) {
|
|
1634
1646
|
console.log("No dashboard ID found");
|
|
1635
1647
|
return;
|
|
@@ -1645,106 +1657,106 @@ function xs() {
|
|
|
1645
1657
|
},
|
|
1646
1658
|
{
|
|
1647
1659
|
onSuccess: () => {
|
|
1648
|
-
console.log("Dashboard title updated successfully"),
|
|
1660
|
+
console.log("Dashboard title updated successfully"), k.success("Dashboard title updated");
|
|
1649
1661
|
},
|
|
1650
|
-
onError: (
|
|
1651
|
-
console.error("Failed to update dashboard title:",
|
|
1662
|
+
onError: (F) => {
|
|
1663
|
+
console.error("Failed to update dashboard title:", F), k.error("Failed to update dashboard title"), D(M);
|
|
1652
1664
|
}
|
|
1653
1665
|
}
|
|
1654
1666
|
);
|
|
1655
1667
|
};
|
|
1656
|
-
|
|
1657
|
-
if (
|
|
1668
|
+
Ge(() => {
|
|
1669
|
+
if (ke && ke.length > 0) {
|
|
1658
1670
|
const d = o == null ? void 0 : o.id;
|
|
1659
1671
|
if (d) {
|
|
1660
|
-
const M =
|
|
1661
|
-
(
|
|
1672
|
+
const M = ke.find(
|
|
1673
|
+
(F) => F.id === d
|
|
1662
1674
|
);
|
|
1663
|
-
M &&
|
|
1675
|
+
M && bt(M);
|
|
1664
1676
|
}
|
|
1665
1677
|
}
|
|
1666
|
-
}, [
|
|
1667
|
-
const de =
|
|
1668
|
-
() =>
|
|
1678
|
+
}, [ke, o == null ? void 0 : o.id, bt]);
|
|
1679
|
+
const de = n.orgUserId || n.tenantId, Ke = V(
|
|
1680
|
+
() => ns({
|
|
1669
1681
|
accessToken: e == null ? void 0 : e.accessToken,
|
|
1670
|
-
dashboardId: (o == null ? void 0 : o.id) ||
|
|
1671
|
-
selectedSheetId:
|
|
1672
|
-
pageSize:
|
|
1673
|
-
orientation:
|
|
1682
|
+
dashboardId: (o == null ? void 0 : o.id) || a || n.dashboard_id,
|
|
1683
|
+
selectedSheetId: C ? y : void 0,
|
|
1684
|
+
pageSize: L == null ? void 0 : L.size,
|
|
1685
|
+
orientation: L == null ? void 0 : L.orientation,
|
|
1674
1686
|
theme: x
|
|
1675
1687
|
}),
|
|
1676
1688
|
[
|
|
1677
1689
|
e == null ? void 0 : e.accessToken,
|
|
1678
|
-
|
|
1690
|
+
a,
|
|
1679
1691
|
o == null ? void 0 : o.id,
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1692
|
+
C,
|
|
1693
|
+
L == null ? void 0 : L.orientation,
|
|
1694
|
+
L == null ? void 0 : L.size,
|
|
1683
1695
|
y,
|
|
1684
1696
|
x,
|
|
1685
|
-
|
|
1697
|
+
n.dashboard_id
|
|
1686
1698
|
]
|
|
1687
|
-
),
|
|
1699
|
+
), vt = E && !A && de && Ce, { setDashboard: yt } = N((d) => d.actions), wt = N(
|
|
1688
1700
|
(d) => d.semanticExecutionPayload
|
|
1689
1701
|
), Lr = () => {
|
|
1690
|
-
|
|
1691
|
-
},
|
|
1692
|
-
|
|
1702
|
+
ht(!0);
|
|
1703
|
+
}, Qe = () => {
|
|
1704
|
+
ht(!1), gt(!1), Le(null);
|
|
1693
1705
|
};
|
|
1694
|
-
|
|
1706
|
+
Ge(() => {
|
|
1695
1707
|
if (!E) {
|
|
1696
|
-
|
|
1708
|
+
O && Le(null);
|
|
1697
1709
|
return;
|
|
1698
1710
|
}
|
|
1699
|
-
|
|
1700
|
-
|
|
1711
|
+
O || !o || b || Le(
|
|
1712
|
+
qt(
|
|
1701
1713
|
o,
|
|
1702
|
-
|
|
1714
|
+
wt
|
|
1703
1715
|
)
|
|
1704
1716
|
);
|
|
1705
1717
|
}, [
|
|
1706
1718
|
o,
|
|
1707
|
-
|
|
1719
|
+
O,
|
|
1708
1720
|
E,
|
|
1709
1721
|
b,
|
|
1710
|
-
|
|
1722
|
+
wt
|
|
1711
1723
|
]);
|
|
1712
|
-
const
|
|
1724
|
+
const Ie = (O == null ? void 0 : O.dashboard) ?? null, { isDirty: Nt, isDirtyPending: Ir, resetDirty: Ae } = cn(
|
|
1713
1725
|
o,
|
|
1714
|
-
|
|
1726
|
+
Ie,
|
|
1715
1727
|
300,
|
|
1716
1728
|
1e3,
|
|
1717
|
-
|
|
1718
|
-
),
|
|
1719
|
-
|
|
1720
|
-
},
|
|
1721
|
-
await
|
|
1729
|
+
Ze
|
|
1730
|
+
), St = Wa(() => Ie ? Ze(o) !== Ze(Ie) : !1, [o, Ie]), Dt = Nt || Ir, Me = je || ie.isPending, Ar = () => {
|
|
1731
|
+
St() ? (Ee("close"), oe(!0)) : (Qe(), Ae());
|
|
1732
|
+
}, Mr = async () => {
|
|
1733
|
+
await We({
|
|
1722
1734
|
closeAfterSave: !0,
|
|
1723
|
-
navigateHomeAfterSave:
|
|
1735
|
+
navigateHomeAfterSave: Ve === "home"
|
|
1724
1736
|
});
|
|
1725
1737
|
}, Pr = () => {
|
|
1726
|
-
|
|
1727
|
-
semanticExecutionPayload:
|
|
1728
|
-
}),
|
|
1729
|
-
}, _r = () => {
|
|
1730
|
-
_ && (vt(_.dashboard, {
|
|
1731
|
-
semanticExecutionPayload: _.semanticExecutionPayload
|
|
1732
|
-
}), Le());
|
|
1738
|
+
O && yt(O.dashboard, {
|
|
1739
|
+
semanticExecutionPayload: O.semanticExecutionPayload
|
|
1740
|
+
}), Qe(), Ve === "home" && ze(), Ee("close"), oe(!1), Ae();
|
|
1733
1741
|
}, Or = () => {
|
|
1734
|
-
|
|
1735
|
-
|
|
1742
|
+
O && (yt(O.dashboard, {
|
|
1743
|
+
semanticExecutionPayload: O.semanticExecutionPayload
|
|
1744
|
+
}), Ae());
|
|
1745
|
+
}, _r = () => {
|
|
1746
|
+
if (E && St()) {
|
|
1747
|
+
Ee("home"), oe(!0);
|
|
1736
1748
|
return;
|
|
1737
1749
|
}
|
|
1738
|
-
|
|
1750
|
+
ze();
|
|
1739
1751
|
};
|
|
1740
|
-
async function
|
|
1752
|
+
async function We(d) {
|
|
1741
1753
|
const M = N.getState().dashboard;
|
|
1742
1754
|
if (!M)
|
|
1743
1755
|
return;
|
|
1744
|
-
const
|
|
1745
|
-
H(
|
|
1746
|
-
const Br =
|
|
1747
|
-
|
|
1756
|
+
const F = (d == null ? void 0 : d.closeAfterSave) ?? U, Gr = (d == null ? void 0 : d.navigateHomeAfterSave) ?? !1;
|
|
1757
|
+
H(F), F && oe(!1);
|
|
1758
|
+
const Br = st(M);
|
|
1759
|
+
B(!0), ee(null), v([]), qe(!0);
|
|
1748
1760
|
const zr = {
|
|
1749
1761
|
template: M
|
|
1750
1762
|
};
|
|
@@ -1755,69 +1767,69 @@ function xs() {
|
|
|
1755
1767
|
},
|
|
1756
1768
|
{
|
|
1757
1769
|
onSuccess: (P) => {
|
|
1758
|
-
var
|
|
1759
|
-
const q = (P == null ? void 0 : P.id) || ((
|
|
1770
|
+
var Oe, _e, _t;
|
|
1771
|
+
const q = (P == null ? void 0 : P.id) || ((Oe = P == null ? void 0 : P.dashboard) == null ? void 0 : Oe.id) || ((_e = P == null ? void 0 : P.resource) == null ? void 0 : _e.id) || ((_t = P == null ? void 0 : P.template) == null ? void 0 : _t.id) || null;
|
|
1760
1772
|
if (!M.id && q) {
|
|
1761
|
-
const
|
|
1762
|
-
(
|
|
1773
|
+
const Je = Zr.getState(), Re = Je.pendingDashboardDraftMigration;
|
|
1774
|
+
(Re == null ? void 0 : Re.scopeKey) === c ? Je.actions.setPendingDashboardDraftMigrationExpectedDashboardId(
|
|
1763
1775
|
q
|
|
1764
|
-
) :
|
|
1776
|
+
) : Re && Je.actions.clearPendingDashboardDraftMigration();
|
|
1765
1777
|
}
|
|
1766
|
-
|
|
1767
|
-
|
|
1778
|
+
qe(!1), k.success("Dashboard saved!"), Le(
|
|
1779
|
+
qt(
|
|
1768
1780
|
Br,
|
|
1769
1781
|
N.getState().semanticExecutionPayload
|
|
1770
1782
|
)
|
|
1771
|
-
),
|
|
1783
|
+
), B(!1), H(!1), F && (Qe(), Ae(), Gr && ze()), Ee("close");
|
|
1772
1784
|
},
|
|
1773
1785
|
onError: (P) => {
|
|
1774
|
-
|
|
1775
|
-
const q = P.details,
|
|
1786
|
+
qe(!1), ee("Failed to save dashboard. Please try again.");
|
|
1787
|
+
const q = P.details, Oe = Array.isArray(
|
|
1776
1788
|
q == null ? void 0 : q.errors
|
|
1777
1789
|
) ? (q.errors || []).filter(
|
|
1778
|
-
(
|
|
1790
|
+
(_e) => typeof _e == "string"
|
|
1779
1791
|
) : [];
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
errors:
|
|
1792
|
+
v(
|
|
1793
|
+
rs({
|
|
1794
|
+
errors: Oe,
|
|
1783
1795
|
dashboard: M || void 0
|
|
1784
1796
|
})
|
|
1785
|
-
),
|
|
1797
|
+
), k.error("Failed to save dashboard");
|
|
1786
1798
|
}
|
|
1787
1799
|
}
|
|
1788
1800
|
);
|
|
1789
1801
|
}
|
|
1790
|
-
async function
|
|
1791
|
-
if (
|
|
1802
|
+
async function Rr() {
|
|
1803
|
+
if (Q(!0), !m || !g) return;
|
|
1792
1804
|
const d = N.getState().dashboard;
|
|
1793
1805
|
if (!d) {
|
|
1794
|
-
|
|
1806
|
+
Q(!1);
|
|
1795
1807
|
return;
|
|
1796
1808
|
}
|
|
1797
|
-
const M = JSON.stringify(d),
|
|
1798
|
-
...
|
|
1809
|
+
const M = JSON.stringify(d), F = {
|
|
1810
|
+
...g,
|
|
1799
1811
|
template: M,
|
|
1800
|
-
filterValues:
|
|
1812
|
+
filterValues: Se
|
|
1801
1813
|
};
|
|
1802
|
-
await
|
|
1803
|
-
|
|
1804
|
-
|
|
1814
|
+
await it(
|
|
1815
|
+
n.apiServiceUrl,
|
|
1816
|
+
F,
|
|
1805
1817
|
e == null ? void 0 : e.accessToken
|
|
1806
|
-
),
|
|
1818
|
+
), k.success("Lens saved"), Be == null || Be(d), Q(!1);
|
|
1807
1819
|
}
|
|
1808
|
-
const
|
|
1820
|
+
const Ct = (g == null ? void 0 : g.name) || o.title;
|
|
1809
1821
|
ie.isPending && console.log("Title during update:", {
|
|
1810
|
-
title:
|
|
1822
|
+
title: Ct,
|
|
1811
1823
|
dashboardStateTitle: o.title,
|
|
1812
1824
|
dashboardId: o == null ? void 0 : o.id,
|
|
1813
|
-
currentLensName:
|
|
1825
|
+
currentLensName: g == null ? void 0 : g.name
|
|
1814
1826
|
});
|
|
1815
|
-
const
|
|
1816
|
-
(
|
|
1817
|
-
|
|
1818
|
-
),
|
|
1827
|
+
const kt = n.orgUserId || n.tenantId && n.endUserId && n.endUserEmail, Ur = !!kt && !!(e != null && e.accessToken) && !!(n != null && n.apiServiceUrl), Tr = l, j = (o == null ? void 0 : o.id) || null, Fr = as(
|
|
1828
|
+
(Pt = n.config) == null ? void 0 : Pt.showBriefings,
|
|
1829
|
+
r
|
|
1830
|
+
), Pe = !!j && yr === j, $r = () => {
|
|
1819
1831
|
j && wr({
|
|
1820
|
-
dashboardId:
|
|
1832
|
+
dashboardId: Pe ? null : j
|
|
1821
1833
|
});
|
|
1822
1834
|
};
|
|
1823
1835
|
return /* @__PURE__ */ i(
|
|
@@ -1827,14 +1839,14 @@ function xs() {
|
|
|
1827
1839
|
role: "dashboard-controls",
|
|
1828
1840
|
children: [
|
|
1829
1841
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1830
|
-
|
|
1842
|
+
kt && /* @__PURE__ */ i(R, { children: [
|
|
1831
1843
|
/* @__PURE__ */ t(
|
|
1832
|
-
|
|
1844
|
+
Xe,
|
|
1833
1845
|
{
|
|
1834
1846
|
"aria-label": "Manage Dashboards",
|
|
1835
1847
|
tooltip: "Manage Dashboards",
|
|
1836
1848
|
onClick: () => {
|
|
1837
|
-
|
|
1849
|
+
Ne(!we);
|
|
1838
1850
|
},
|
|
1839
1851
|
className: "h-7 w-7 px-0",
|
|
1840
1852
|
buttonProps: { size: "xs" },
|
|
@@ -1842,14 +1854,14 @@ function xs() {
|
|
|
1842
1854
|
}
|
|
1843
1855
|
),
|
|
1844
1856
|
Tr && !A && /* @__PURE__ */ t(
|
|
1845
|
-
|
|
1857
|
+
Xe,
|
|
1846
1858
|
{
|
|
1847
1859
|
"aria-label": "Dashboard Hub",
|
|
1848
1860
|
tooltip: "Dashboard Hub",
|
|
1849
|
-
onClick:
|
|
1861
|
+
onClick: _r,
|
|
1850
1862
|
className: "h-7 w-7 px-0",
|
|
1851
1863
|
buttonProps: { size: "xs" },
|
|
1852
|
-
children: /* @__PURE__ */ t(
|
|
1864
|
+
children: /* @__PURE__ */ t(Xt, { className: "h-3.5 w-3.5" })
|
|
1853
1865
|
}
|
|
1854
1866
|
)
|
|
1855
1867
|
] }),
|
|
@@ -1861,63 +1873,63 @@ function xs() {
|
|
|
1861
1873
|
role: "status",
|
|
1862
1874
|
children: /* @__PURE__ */ t("span", { className: "sr-only", children: "Loading dashboard title" })
|
|
1863
1875
|
}
|
|
1864
|
-
) : /* @__PURE__ */ i(
|
|
1876
|
+
) : /* @__PURE__ */ i(R, { children: [
|
|
1865
1877
|
/* @__PURE__ */ t(
|
|
1866
1878
|
Ea,
|
|
1867
1879
|
{
|
|
1868
|
-
value:
|
|
1880
|
+
value: Ct || "Untitled Dashboard",
|
|
1869
1881
|
onSave: (d) => {
|
|
1870
1882
|
console.log("EditableText onSave called:", {
|
|
1871
1883
|
newTitle: d,
|
|
1872
|
-
canEditDashboard:
|
|
1884
|
+
canEditDashboard: Ce,
|
|
1873
1885
|
dashboardId: o == null ? void 0 : o.id
|
|
1874
1886
|
});
|
|
1875
1887
|
const M = (o == null ? void 0 : o.title) || "";
|
|
1876
|
-
|
|
1888
|
+
D(d), Er(d, M);
|
|
1877
1889
|
},
|
|
1878
|
-
isEditable:
|
|
1890
|
+
isEditable: Ce && !g,
|
|
1879
1891
|
displayClassName: "text-[13px] font-medium",
|
|
1880
1892
|
inputClassName: "text-[13px] font-medium",
|
|
1881
1893
|
placeholder: "Dashboard Title",
|
|
1882
1894
|
isPending: ie.isPending
|
|
1883
1895
|
}
|
|
1884
1896
|
),
|
|
1885
|
-
|
|
1897
|
+
Ur && j && /* @__PURE__ */ t(Qr, { children: /* @__PURE__ */ i(Wr, { children: [
|
|
1886
1898
|
/* @__PURE__ */ t(Jr, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1887
|
-
|
|
1899
|
+
_,
|
|
1888
1900
|
{
|
|
1889
1901
|
variant: "ghost",
|
|
1890
1902
|
size: "xs",
|
|
1891
1903
|
onClick: $r,
|
|
1892
|
-
disabled: Nr || !(e != null && e.accessToken) || !(
|
|
1904
|
+
disabled: Nr || !(e != null && e.accessToken) || !(n != null && n.apiServiceUrl),
|
|
1893
1905
|
className: "w-7 px-0",
|
|
1894
|
-
"aria-label":
|
|
1906
|
+
"aria-label": Pe ? "Remove as default dashboard" : "Make this a default dashboard",
|
|
1895
1907
|
children: /* @__PURE__ */ t(
|
|
1896
1908
|
La,
|
|
1897
1909
|
{
|
|
1898
|
-
className:
|
|
1910
|
+
className: te(
|
|
1899
1911
|
"h-3.5 w-3.5 transition-colors",
|
|
1900
|
-
|
|
1912
|
+
Pe ? "fill-foreground text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
1901
1913
|
)
|
|
1902
1914
|
}
|
|
1903
1915
|
)
|
|
1904
1916
|
}
|
|
1905
1917
|
) }),
|
|
1906
|
-
/* @__PURE__ */ t(Yr, { children: /* @__PURE__ */ t("p", { children:
|
|
1918
|
+
/* @__PURE__ */ t(Yr, { children: /* @__PURE__ */ t("p", { children: Pe ? "Remove as default dashboard" : "Make this a default dashboard" }) })
|
|
1907
1919
|
] }) })
|
|
1908
1920
|
] }))
|
|
1909
1921
|
] }),
|
|
1910
1922
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1911
|
-
A && /* @__PURE__ */ i(
|
|
1923
|
+
A && /* @__PURE__ */ i(R, { children: [
|
|
1912
1924
|
/* @__PURE__ */ t(en, {}),
|
|
1913
1925
|
/* @__PURE__ */ t(tn, {})
|
|
1914
1926
|
] }),
|
|
1915
|
-
!A && l && ((
|
|
1916
|
-
|
|
1927
|
+
!A && l && ((Ot = T == null ? void 0 : T.permissions) == null ? void 0 : Ot.canShare) && /* @__PURE__ */ i(
|
|
1928
|
+
_,
|
|
1917
1929
|
{
|
|
1918
1930
|
variant: "outline",
|
|
1919
1931
|
size: "xs",
|
|
1920
|
-
onClick: () =>
|
|
1932
|
+
onClick: () => he(!0),
|
|
1921
1933
|
children: [
|
|
1922
1934
|
/* @__PURE__ */ t(Ia, { className: "h-3.5 w-3.5" }),
|
|
1923
1935
|
"Share"
|
|
@@ -1928,75 +1940,75 @@ function xs() {
|
|
|
1928
1940
|
rn,
|
|
1929
1941
|
{
|
|
1930
1942
|
dashboardId: j,
|
|
1931
|
-
dashboardTitle: (o == null ? void 0 : o.title) || (
|
|
1943
|
+
dashboardTitle: (o == null ? void 0 : o.title) || (T == null ? void 0 : T.title)
|
|
1932
1944
|
}
|
|
1933
1945
|
),
|
|
1934
|
-
!A && E &&
|
|
1935
|
-
E && !A && de &&
|
|
1936
|
-
|
|
1946
|
+
!A && E && h.canUseFilters && l && /* @__PURE__ */ t(an, {}),
|
|
1947
|
+
E && !A && de && g && s && l && /* @__PURE__ */ i(
|
|
1948
|
+
_,
|
|
1937
1949
|
{
|
|
1938
1950
|
variant: "secondary",
|
|
1939
1951
|
size: "xs",
|
|
1940
|
-
disabled:
|
|
1941
|
-
onClick:
|
|
1952
|
+
disabled: ae,
|
|
1953
|
+
onClick: Rr,
|
|
1942
1954
|
children: [
|
|
1943
|
-
/* @__PURE__ */ t(
|
|
1955
|
+
/* @__PURE__ */ t(Gt, { className: "h-3.5 w-3.5" }),
|
|
1944
1956
|
"Save Lens"
|
|
1945
1957
|
]
|
|
1946
1958
|
}
|
|
1947
1959
|
),
|
|
1948
|
-
E && !A && l && !
|
|
1949
|
-
|
|
1960
|
+
E && !A && l && !C && /* @__PURE__ */ i(
|
|
1961
|
+
_,
|
|
1950
1962
|
{
|
|
1951
1963
|
variant: "outline",
|
|
1952
1964
|
size: "xs",
|
|
1953
1965
|
disabled: !E,
|
|
1954
1966
|
onClick: () => Cr(),
|
|
1955
1967
|
children: [
|
|
1956
|
-
/* @__PURE__ */ t(
|
|
1968
|
+
/* @__PURE__ */ t(re, { className: "h-3.5 w-3.5" }),
|
|
1957
1969
|
"Visual"
|
|
1958
1970
|
]
|
|
1959
1971
|
}
|
|
1960
1972
|
),
|
|
1961
|
-
!A && !E &&
|
|
1962
|
-
/* @__PURE__ */ t(
|
|
1973
|
+
!A && !E && Ce && l && /* @__PURE__ */ i(_, { size: "xs", onClick: Lr, children: [
|
|
1974
|
+
/* @__PURE__ */ t(Aa, { className: "h-3.5 w-3.5" }),
|
|
1963
1975
|
"Edit"
|
|
1964
1976
|
] }),
|
|
1965
|
-
|
|
1966
|
-
|
|
1977
|
+
vt && l && Nt && /* @__PURE__ */ i(
|
|
1978
|
+
_,
|
|
1967
1979
|
{
|
|
1968
1980
|
variant: "outline",
|
|
1969
1981
|
size: "xs",
|
|
1970
|
-
onClick:
|
|
1971
|
-
disabled:
|
|
1982
|
+
onClick: Or,
|
|
1983
|
+
disabled: Me,
|
|
1972
1984
|
children: [
|
|
1973
1985
|
/* @__PURE__ */ t(nn, { className: "h-3.5 w-3.5" }),
|
|
1974
1986
|
"Undo"
|
|
1975
1987
|
]
|
|
1976
1988
|
}
|
|
1977
1989
|
),
|
|
1978
|
-
|
|
1979
|
-
|
|
1990
|
+
vt && l && /* @__PURE__ */ i(
|
|
1991
|
+
_,
|
|
1980
1992
|
{
|
|
1981
1993
|
size: "xs",
|
|
1982
|
-
className:
|
|
1983
|
-
disabled:
|
|
1984
|
-
onClick: () =>
|
|
1994
|
+
className: te(!Dt && "opacity-60"),
|
|
1995
|
+
disabled: Me || !Dt,
|
|
1996
|
+
onClick: () => We(),
|
|
1985
1997
|
children: [
|
|
1986
|
-
|
|
1987
|
-
|
|
1998
|
+
Me ? /* @__PURE__ */ t($e, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(Gt, { className: "h-3.5 w-3.5" }),
|
|
1999
|
+
Me ? "Saving..." : "Save"
|
|
1988
2000
|
]
|
|
1989
2001
|
}
|
|
1990
2002
|
),
|
|
1991
|
-
E && !A && l && /* @__PURE__ */ i(
|
|
1992
|
-
/* @__PURE__ */ t(
|
|
2003
|
+
E && !A && l && /* @__PURE__ */ i(_, { variant: "outline", size: "xs", onClick: Ar, children: [
|
|
2004
|
+
/* @__PURE__ */ t(Zt, { className: "h-3.5 w-3.5" }),
|
|
1993
2005
|
"Close"
|
|
1994
2006
|
] }),
|
|
1995
2007
|
!A && l && /* @__PURE__ */ t("div", { className: "ml-2", children: /* @__PURE__ */ t(sn, {}) }),
|
|
1996
2008
|
!A && s && /* @__PURE__ */ t(Nn, {}),
|
|
1997
|
-
!A && l && /* @__PURE__ */ i(
|
|
2009
|
+
!A && l && /* @__PURE__ */ i(Ma, { children: [
|
|
1998
2010
|
/* @__PURE__ */ t(Pa, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1999
|
-
|
|
2011
|
+
Xe,
|
|
2000
2012
|
{
|
|
2001
2013
|
tooltip: "More Options",
|
|
2002
2014
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
@@ -2005,122 +2017,122 @@ function xs() {
|
|
|
2005
2017
|
variant: "ghost",
|
|
2006
2018
|
"aria-label": "More dashboard options"
|
|
2007
2019
|
},
|
|
2008
|
-
children: /* @__PURE__ */ t(
|
|
2020
|
+
children: /* @__PURE__ */ t(Oa, { className: "h-3.5 w-3.5" })
|
|
2009
2021
|
}
|
|
2010
2022
|
) }),
|
|
2011
2023
|
/* @__PURE__ */ i(
|
|
2012
|
-
|
|
2024
|
+
_a,
|
|
2013
2025
|
{
|
|
2014
2026
|
align: "end",
|
|
2015
2027
|
className: "w-56 rounded-control border border-border/60 p-1 shadow-sm",
|
|
2016
2028
|
children: [
|
|
2017
2029
|
/* @__PURE__ */ t(ue, { children: "Reports" }),
|
|
2018
2030
|
/* @__PURE__ */ i(
|
|
2019
|
-
|
|
2031
|
+
$,
|
|
2020
2032
|
{
|
|
2021
|
-
disabled:
|
|
2022
|
-
onSelect: () =>
|
|
2033
|
+
disabled: p,
|
|
2034
|
+
onSelect: () => ve(!0),
|
|
2023
2035
|
children: [
|
|
2024
|
-
/* @__PURE__ */ t(
|
|
2036
|
+
/* @__PURE__ */ t(Ra, { className: "h-3.5 w-3.5" }),
|
|
2025
2037
|
"Export"
|
|
2026
2038
|
]
|
|
2027
2039
|
}
|
|
2028
2040
|
),
|
|
2029
|
-
/* @__PURE__ */ t(
|
|
2030
|
-
Dr && /* @__PURE__ */ i(
|
|
2041
|
+
/* @__PURE__ */ t(Fe, {}),
|
|
2042
|
+
Dr && /* @__PURE__ */ i(R, { children: [
|
|
2031
2043
|
/* @__PURE__ */ t(ue, { children: "Access" }),
|
|
2032
2044
|
/* @__PURE__ */ i(
|
|
2033
|
-
|
|
2045
|
+
$,
|
|
2034
2046
|
{
|
|
2035
|
-
onClick: () =>
|
|
2047
|
+
onClick: () => J(!0),
|
|
2036
2048
|
children: [
|
|
2037
|
-
/* @__PURE__ */ t(
|
|
2049
|
+
/* @__PURE__ */ t(rr, { className: "h-3.5 w-3.5" }),
|
|
2038
2050
|
"Manage Groups"
|
|
2039
2051
|
]
|
|
2040
2052
|
}
|
|
2041
2053
|
),
|
|
2042
|
-
/* @__PURE__ */ t(
|
|
2054
|
+
/* @__PURE__ */ t(Fe, {})
|
|
2043
2055
|
] }),
|
|
2044
2056
|
/* @__PURE__ */ t(ue, { children: "Preferences" }),
|
|
2045
|
-
/* @__PURE__ */ i(
|
|
2046
|
-
/* @__PURE__ */ t(
|
|
2057
|
+
/* @__PURE__ */ i($, { onClick: () => X(!0), children: [
|
|
2058
|
+
/* @__PURE__ */ t(ar, { className: "h-3.5 w-3.5" }),
|
|
2047
2059
|
"Calendar Preferences"
|
|
2048
2060
|
] }),
|
|
2049
|
-
s && l && /* @__PURE__ */ i(
|
|
2050
|
-
/* @__PURE__ */ t(
|
|
2061
|
+
s && l && /* @__PURE__ */ i(R, { children: [
|
|
2062
|
+
/* @__PURE__ */ t(Fe, {}),
|
|
2051
2063
|
/* @__PURE__ */ t(ue, { children: "Developer" }),
|
|
2052
2064
|
/* @__PURE__ */ i(
|
|
2053
|
-
|
|
2065
|
+
$,
|
|
2054
2066
|
{
|
|
2055
2067
|
onSelect: () => {
|
|
2056
2068
|
var d;
|
|
2057
2069
|
e != null && e.accessToken && ((d = navigator == null ? void 0 : navigator.clipboard) != null && d.writeText ? navigator.clipboard.writeText(e.accessToken).then(
|
|
2058
|
-
() =>
|
|
2059
|
-
).catch(() =>
|
|
2070
|
+
() => k.success("Token copied to clipboard")
|
|
2071
|
+
).catch(() => k.error("Unable to copy token")) : k.error("Clipboard not available"));
|
|
2060
2072
|
},
|
|
2061
2073
|
children: [
|
|
2062
|
-
/* @__PURE__ */ t(
|
|
2074
|
+
/* @__PURE__ */ t(Tt, { className: "h-3.5 w-3.5" }),
|
|
2063
2075
|
"Copy token"
|
|
2064
2076
|
]
|
|
2065
2077
|
}
|
|
2066
2078
|
),
|
|
2067
|
-
|
|
2068
|
-
|
|
2079
|
+
C && /* @__PURE__ */ i(
|
|
2080
|
+
$,
|
|
2069
2081
|
{
|
|
2070
|
-
disabled: !
|
|
2082
|
+
disabled: !Ke,
|
|
2071
2083
|
onSelect: () => {
|
|
2072
2084
|
var d;
|
|
2073
|
-
if (!
|
|
2074
|
-
|
|
2085
|
+
if (!Ke) {
|
|
2086
|
+
k.error(
|
|
2075
2087
|
"Open a document sheet with a token to copy the local PDF URL"
|
|
2076
2088
|
);
|
|
2077
2089
|
return;
|
|
2078
2090
|
}
|
|
2079
|
-
(d = navigator == null ? void 0 : navigator.clipboard) != null && d.writeText ? navigator.clipboard.writeText(
|
|
2080
|
-
() =>
|
|
2091
|
+
(d = navigator == null ? void 0 : navigator.clipboard) != null && d.writeText ? navigator.clipboard.writeText(Ke).then(
|
|
2092
|
+
() => k.success(
|
|
2081
2093
|
"Local document PDF URL copied to clipboard"
|
|
2082
2094
|
)
|
|
2083
2095
|
).catch(
|
|
2084
|
-
() =>
|
|
2096
|
+
() => k.error(
|
|
2085
2097
|
"Unable to copy local document PDF URL"
|
|
2086
2098
|
)
|
|
2087
|
-
) :
|
|
2099
|
+
) : k.error("Clipboard not available");
|
|
2088
2100
|
},
|
|
2089
2101
|
children: [
|
|
2090
|
-
/* @__PURE__ */ t(
|
|
2102
|
+
/* @__PURE__ */ t(Tt, { className: "h-3.5 w-3.5" }),
|
|
2091
2103
|
"Copy local document PDF URL"
|
|
2092
2104
|
]
|
|
2093
2105
|
}
|
|
2094
2106
|
),
|
|
2095
2107
|
/* @__PURE__ */ i(
|
|
2096
|
-
|
|
2108
|
+
$,
|
|
2097
2109
|
{
|
|
2098
|
-
onSelect: () => Xr(
|
|
2110
|
+
onSelect: () => Xr(n.apiServiceUrl),
|
|
2099
2111
|
children: [
|
|
2100
2112
|
/* @__PURE__ */ t(gn, { className: "h-3.5 w-3.5" }),
|
|
2101
2113
|
"Invalidate token"
|
|
2102
2114
|
]
|
|
2103
2115
|
}
|
|
2104
2116
|
),
|
|
2105
|
-
/* @__PURE__ */ i(
|
|
2117
|
+
/* @__PURE__ */ i($, { onSelect: u, children: [
|
|
2106
2118
|
/* @__PURE__ */ t(ln, { className: "h-3.5 w-3.5" }),
|
|
2107
2119
|
"Brand Studio"
|
|
2108
2120
|
] }),
|
|
2109
2121
|
E && /* @__PURE__ */ i(
|
|
2110
|
-
|
|
2122
|
+
$,
|
|
2111
2123
|
{
|
|
2112
|
-
onSelect: () =>
|
|
2124
|
+
onSelect: () => gt(!ft),
|
|
2113
2125
|
children: [
|
|
2114
2126
|
/* @__PURE__ */ t(un, { className: "h-3.5 w-3.5" }),
|
|
2115
|
-
|
|
2127
|
+
ft ? "Hide dashboard JSON" : "Show dashboard JSON"
|
|
2116
2128
|
]
|
|
2117
2129
|
}
|
|
2118
2130
|
),
|
|
2119
|
-
de && E && /* @__PURE__ */ i(
|
|
2120
|
-
/* @__PURE__ */ t(
|
|
2131
|
+
de && E && /* @__PURE__ */ i($, { onSelect: () => be(!0), children: [
|
|
2132
|
+
/* @__PURE__ */ t(re, { className: "h-3.5 w-3.5" }),
|
|
2121
2133
|
"Add lens"
|
|
2122
2134
|
] }),
|
|
2123
|
-
de && /* @__PURE__ */ i(
|
|
2135
|
+
de && /* @__PURE__ */ i(Ua, { children: [
|
|
2124
2136
|
/* @__PURE__ */ i(Ta, { children: [
|
|
2125
2137
|
/* @__PURE__ */ t(mn, { className: "h-3.5 w-3.5" }),
|
|
2126
2138
|
"Lenses"
|
|
@@ -2132,76 +2144,76 @@ function xs() {
|
|
|
2132
2144
|
}
|
|
2133
2145
|
)
|
|
2134
2146
|
] }),
|
|
2135
|
-
|
|
2147
|
+
ne && xt && /* @__PURE__ */ t(
|
|
2136
2148
|
$a,
|
|
2137
2149
|
{
|
|
2138
|
-
resource:
|
|
2139
|
-
resourceType:
|
|
2140
|
-
onClose: () =>
|
|
2150
|
+
resource: xt,
|
|
2151
|
+
resourceType: Ye.DASHBOARD,
|
|
2152
|
+
onClose: () => he(!1)
|
|
2141
2153
|
}
|
|
2142
2154
|
),
|
|
2143
2155
|
/* @__PURE__ */ t(
|
|
2144
|
-
|
|
2156
|
+
Wn,
|
|
2145
2157
|
{
|
|
2146
|
-
open:
|
|
2147
|
-
onOpenChange:
|
|
2158
|
+
open: W,
|
|
2159
|
+
onOpenChange: J
|
|
2148
2160
|
}
|
|
2149
2161
|
),
|
|
2150
2162
|
/* @__PURE__ */ t(
|
|
2151
2163
|
dn,
|
|
2152
2164
|
{
|
|
2153
|
-
open:
|
|
2154
|
-
onOpenChange:
|
|
2165
|
+
open: Y,
|
|
2166
|
+
onOpenChange: X
|
|
2155
2167
|
}
|
|
2156
2168
|
),
|
|
2157
|
-
s && de && l && /* @__PURE__ */ t(kn, { open:
|
|
2169
|
+
s && de && l && /* @__PURE__ */ t(kn, { open: ge, onOpenChange: be }),
|
|
2158
2170
|
l && /* @__PURE__ */ t(
|
|
2159
2171
|
Ga,
|
|
2160
2172
|
{
|
|
2161
|
-
open:
|
|
2162
|
-
onOpenChange:
|
|
2173
|
+
open: xe,
|
|
2174
|
+
onOpenChange: ve
|
|
2163
2175
|
}
|
|
2164
2176
|
),
|
|
2165
2177
|
/* @__PURE__ */ t(
|
|
2166
2178
|
Ba,
|
|
2167
2179
|
{
|
|
2168
|
-
open:
|
|
2180
|
+
open: ye,
|
|
2169
2181
|
onOpenChange: (d) => {
|
|
2170
|
-
!d &&
|
|
2182
|
+
!d && je && !Z || (B(d), d || (ee(null), v([]), H(!1)));
|
|
2171
2183
|
},
|
|
2172
2184
|
children: /* @__PURE__ */ i(za, { className: "max-w-sm", children: [
|
|
2173
2185
|
/* @__PURE__ */ i(Ha, { children: [
|
|
2174
|
-
/* @__PURE__ */ t(ja, { children:
|
|
2175
|
-
/* @__PURE__ */ t(qa, { className: "pt-2", children:
|
|
2176
|
-
|
|
2186
|
+
/* @__PURE__ */ t(ja, { children: Z ? "Save failed" : "Saving dashboard" }),
|
|
2187
|
+
/* @__PURE__ */ t(qa, { className: "pt-2", children: Z ? "We could not save the dashboard. Please try again." : "Please wait while we save your changes." }),
|
|
2188
|
+
z.length > 0 && /* @__PURE__ */ i("div", { className: "space-y-1 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-left", children: [
|
|
2177
2189
|
/* @__PURE__ */ t("div", { className: "text-sm font-medium text-destructive", children: "What needs attention" }),
|
|
2178
|
-
/* @__PURE__ */ t("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children:
|
|
2190
|
+
/* @__PURE__ */ t("ul", { className: "list-disc space-y-1 pl-4 text-xs text-muted-foreground", children: z.slice(0, 5).map((d) => /* @__PURE__ */ t("li", { children: d }, d)) })
|
|
2179
2191
|
] })
|
|
2180
2192
|
] }),
|
|
2181
|
-
/* @__PURE__ */ t(Va, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children:
|
|
2193
|
+
/* @__PURE__ */ t(Va, { className: "flex-col gap-2 sm:flex-row sm:justify-end", children: Z ? /* @__PURE__ */ i(R, { children: [
|
|
2182
2194
|
/* @__PURE__ */ t(
|
|
2183
2195
|
Ka,
|
|
2184
2196
|
{
|
|
2185
2197
|
onClick: () => {
|
|
2186
|
-
|
|
2198
|
+
B(!1), ee(null), v([]), H(!1);
|
|
2187
2199
|
},
|
|
2188
2200
|
className: "m-0",
|
|
2189
2201
|
children: "Close"
|
|
2190
2202
|
}
|
|
2191
2203
|
),
|
|
2192
2204
|
/* @__PURE__ */ t(
|
|
2193
|
-
|
|
2205
|
+
Ft,
|
|
2194
2206
|
{
|
|
2195
|
-
onClick: () =>
|
|
2196
|
-
closeAfterSave:
|
|
2197
|
-
navigateHomeAfterSave:
|
|
2207
|
+
onClick: () => We({
|
|
2208
|
+
closeAfterSave: U,
|
|
2209
|
+
navigateHomeAfterSave: Ve === "home"
|
|
2198
2210
|
}),
|
|
2199
2211
|
className: "m-0",
|
|
2200
2212
|
children: "Retry"
|
|
2201
2213
|
}
|
|
2202
2214
|
)
|
|
2203
|
-
] }) : /* @__PURE__ */ i(
|
|
2204
|
-
/* @__PURE__ */ t(
|
|
2215
|
+
] }) : /* @__PURE__ */ i(Ft, { disabled: !0, className: "m-0 cursor-default", children: [
|
|
2216
|
+
/* @__PURE__ */ t($e, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
2205
2217
|
"Saving..."
|
|
2206
2218
|
] }) })
|
|
2207
2219
|
] })
|
|
@@ -2214,9 +2226,9 @@ function xs() {
|
|
|
2214
2226
|
onOpenChange: (d) => {
|
|
2215
2227
|
oe(d);
|
|
2216
2228
|
},
|
|
2217
|
-
onSave:
|
|
2229
|
+
onSave: Mr,
|
|
2218
2230
|
onDiscard: Pr,
|
|
2219
|
-
isSaving:
|
|
2231
|
+
isSaving: je,
|
|
2220
2232
|
saveLabel: "Save",
|
|
2221
2233
|
discardLabel: "Discard"
|
|
2222
2234
|
}
|
|
@@ -2226,21 +2238,21 @@ function xs() {
|
|
|
2226
2238
|
}
|
|
2227
2239
|
);
|
|
2228
2240
|
}
|
|
2229
|
-
function
|
|
2241
|
+
function ns({
|
|
2230
2242
|
accessToken: e,
|
|
2231
|
-
dashboardId:
|
|
2232
|
-
selectedSheetId:
|
|
2233
|
-
pageSize:
|
|
2243
|
+
dashboardId: n,
|
|
2244
|
+
selectedSheetId: a,
|
|
2245
|
+
pageSize: r,
|
|
2234
2246
|
orientation: s,
|
|
2235
2247
|
theme: u
|
|
2236
2248
|
}) {
|
|
2237
|
-
if (!e || !
|
|
2249
|
+
if (!e || !a)
|
|
2238
2250
|
return null;
|
|
2239
|
-
const
|
|
2240
|
-
|
|
2251
|
+
const h = new URL("http://localhost:5173/print-document");
|
|
2252
|
+
h.searchParams.set("token", e), n && h.searchParams.set("dashboardId", n), h.searchParams.set("selectedSheetId", a), u && h.searchParams.set("theme", u);
|
|
2241
2253
|
const l = new URL("http://127.0.0.1:3002/");
|
|
2242
|
-
return l.searchParams.set("pdfMode", "document"), l.searchParams.set("pageSize",
|
|
2254
|
+
return l.searchParams.set("pdfMode", "document"), l.searchParams.set("pageSize", r || "letter"), l.searchParams.set("orientation", s || "portrait"), l.searchParams.set("url", h.toString()), l.toString();
|
|
2243
2255
|
}
|
|
2244
2256
|
export {
|
|
2245
|
-
|
|
2257
|
+
vs as default
|
|
2246
2258
|
};
|