react-semaphor 0.1.435 → 0.1.437
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{dashboard-BSHDErvU.js → dashboard--OqogTLn.js} +23217 -23170
- package/dist/chunks/{dashboard-Bp3M6YmS.js → dashboard-BJr7m1TP.js} +208 -208
- package/dist/chunks/dashboard-briefing-launcher-BRjtoHFz.js +31 -0
- package/dist/chunks/{dashboard-briefing-launcher-D-QS3bYN.js → dashboard-briefing-launcher-Cegf8sog.js} +752 -740
- package/dist/chunks/{dashboard-controls-BKaTTk-y.js → dashboard-controls-BjWzQbOT.js} +884 -874
- package/dist/chunks/dashboard-controls-DbOKYwbJ.js +36 -0
- package/dist/chunks/{dashboard-json-BkL6Xf10.js → dashboard-json-BYHE2Xi7.js} +1 -1
- package/dist/chunks/{dashboard-json-DrOZ5EP1.js → dashboard-json-D3rtzp8l.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DOFAJpQh.js → edit-dashboard-visual-3rc-aeNO.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-BcV0QmRp.js → edit-dashboard-visual-BKTpoR38.js} +702 -699
- package/dist/chunks/{report-preferences-dialog-BiCnXwKt.js → report-preferences-dialog-CoYKKbFc.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-Nib_Yl_j.js → report-preferences-dialog-VVM61k5R.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CG5Se5yF.js → use-create-flow-overlay-state-CpH9832I.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CNdny3Z2.js → use-create-flow-overlay-state-Doo8NeYf.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +2 -0
- package/dist/types/main.d.ts +2 -0
- package/dist/types/surfboard.d.ts +2 -0
- package/dist/types/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-briefing-launcher-C9phmdyP.js +0 -31
- package/dist/chunks/dashboard-controls-Znhp6MTa.js +0 -36
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as e, jsxs as r, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { aH as
|
|
4
|
-
import { B, O as
|
|
5
|
-
import { L as
|
|
6
|
-
import { c as
|
|
7
|
-
import { u as
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import Wt, { useState as k, useEffect as J, useMemo as te, useContext as Ht, useRef as me, useCallback as G } from "react";
|
|
3
|
+
import { aH as ke, aI as Ae, aK as Ee, bb as Ct, c1 as wt, cq as Gt, cr as qt, aZ as be, ce as Nt, br as Re, y as Kt, w as Xt, cs as Yt, aP as Je, aS as et, aT as tt, aU as rt, aV as at, aW as nt, aX as st, aY as St, bq as ot, aG as z, ct as Zt, cu as Qt, cv as qe, cf as ze, cg as _e, cw as Dt, ch as $e, b$ as H, b1 as Jt, bG as Ue, cx as er, b_ as tr, aJ as it, aL as lt, cy as rr, aF as ar, ba as nr, bp as kt, cz as sr, av as or, aM as ir, b3 as lr, az as je, at as he, a6 as ct, a3 as At, a2 as dt, as as Et, a4 as cr, Y as dr, cl as ur, cA as hr, bB as mr, N as ft, R as pr, au as fr, cB as gr, cC as br, cD as xr, cE as vr, cF as yr, cG as Cr, cH as wr, cI as Nr, cJ as It, cK as Sr, b4 as Dr, cL as kr, ci as Ft, cM as Ar, cN as Er, cO as Te, cP as Ir, cQ as Fr, cR as Lr, o as Br, aj as Tr, ae as Vr, T as Rr, ad as Ur, aa as Pr, Z as Mr, a9 as Or, cS as zr, cT as _r, cU as $r, cV as jr, cW as Wr, B as Hr, cX as Gr, cY as qr, a1 as Kr, cZ as Xr, c_ as Yr, c$ as Zr } from "./dashboard--OqogTLn.js";
|
|
4
|
+
import { B as T, O as De, Z as Ze, L as re, M as Lt, d as Bt, c as q, K as Qr, E as xe, u as M, A as ve, aH as gt, a7 as Tt, a6 as Qe, D as Vt, S as ut, P as Pe, a as Me, b as Oe, aI as Jr, aJ as ea, aK as ta, aL as ra, aM as aa, aF as na } from "./code-editor-C8zzmSgt.js";
|
|
5
|
+
import { L as ht } from "./layout-grid-D5tYJg1-.js";
|
|
6
|
+
import { c as ye, X as We, C as Rt } from "./index-xHCrHprY.js";
|
|
7
|
+
import { u as mt, V as sa, E as Ke, a as Xe, b as oa, c as ia, L as la, d as ca, e as Ut, C as Pt, f as da } from "./use-create-flow-overlay-state-CpH9832I.js";
|
|
8
8
|
import "./analyze-result-contract-CfOBEwaC.js";
|
|
9
9
|
import "../value-format-preferences/index.js";
|
|
10
10
|
import { S as ua } from "./search-DHZCro8B.js";
|
|
@@ -19,7 +19,7 @@ import { getBriefingPresentation as oe, describeBriefingSchedule as ha, getBrief
|
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
21
|
*/
|
|
22
|
-
const pa =
|
|
22
|
+
const pa = ye("ArrowUpRight", [
|
|
23
23
|
["path", { d: "M7 7h10v10", key: "1tivn9" }],
|
|
24
24
|
["path", { d: "M7 17 17 7", key: "1vkiza" }]
|
|
25
25
|
]);
|
|
@@ -29,7 +29,7 @@ const pa = ve("ArrowUpRight", [
|
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
31
|
*/
|
|
32
|
-
const fa =
|
|
32
|
+
const fa = ye("CalendarRange", [
|
|
33
33
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
34
34
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
35
35
|
["path", { d: "M3 10h18", key: "8toen8" }],
|
|
@@ -45,7 +45,7 @@ const fa = ve("CalendarRange", [
|
|
|
45
45
|
* This source code is licensed under the ISC license.
|
|
46
46
|
* See the LICENSE file in the root directory of this source tree.
|
|
47
47
|
*/
|
|
48
|
-
const ga =
|
|
48
|
+
const ga = ye("CircleX", [
|
|
49
49
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
50
50
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
51
51
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -56,7 +56,7 @@ const ga = ve("CircleX", [
|
|
|
56
56
|
* This source code is licensed under the ISC license.
|
|
57
57
|
* See the LICENSE file in the root directory of this source tree.
|
|
58
58
|
*/
|
|
59
|
-
const xt =
|
|
59
|
+
const xt = ye("FileDown", [
|
|
60
60
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
61
61
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
62
62
|
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
@@ -68,7 +68,7 @@ const xt = ve("FileDown", [
|
|
|
68
68
|
* This source code is licensed under the ISC license.
|
|
69
69
|
* See the LICENSE file in the root directory of this source tree.
|
|
70
70
|
*/
|
|
71
|
-
const ba =
|
|
71
|
+
const ba = ye("FilterX", [
|
|
72
72
|
["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
|
|
73
73
|
["path", { d: "m22 3-5 5", key: "12jva0" }],
|
|
74
74
|
["path", { d: "m17 3 5 5", key: "k36vhe" }]
|
|
@@ -79,7 +79,7 @@ const ba = ve("FilterX", [
|
|
|
79
79
|
* This source code is licensed under the ISC license.
|
|
80
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
81
81
|
*/
|
|
82
|
-
const xa =
|
|
82
|
+
const xa = ye("Newspaper", [
|
|
83
83
|
[
|
|
84
84
|
"path",
|
|
85
85
|
{
|
|
@@ -113,8 +113,8 @@ function ya({
|
|
|
113
113
|
onSubmit: i,
|
|
114
114
|
isCreating: s
|
|
115
115
|
}) {
|
|
116
|
-
const [n, c] =
|
|
117
|
-
|
|
116
|
+
const [n, c] = k(""), [u, m] = k("");
|
|
117
|
+
J(() => {
|
|
118
118
|
t || (c(""), m(""));
|
|
119
119
|
}, [t]);
|
|
120
120
|
const l = () => {
|
|
@@ -122,22 +122,22 @@ function ya({
|
|
|
122
122
|
}, d = (o) => {
|
|
123
123
|
a(o);
|
|
124
124
|
};
|
|
125
|
-
return /* @__PURE__ */ e(
|
|
126
|
-
|
|
125
|
+
return /* @__PURE__ */ e(ke, { open: t, onOpenChange: d, children: /* @__PURE__ */ r(
|
|
126
|
+
Ae,
|
|
127
127
|
{
|
|
128
128
|
showCloseButton: !1,
|
|
129
129
|
className: "flex max-w-lg grid-cols-none flex-col gap-0 overflow-hidden rounded-[6px] border-border/60 p-0 shadow-lg",
|
|
130
130
|
children: [
|
|
131
131
|
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
132
132
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
133
|
-
/* @__PURE__ */ e(
|
|
133
|
+
/* @__PURE__ */ e(ht, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
134
134
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
135
|
-
/* @__PURE__ */ e(
|
|
135
|
+
/* @__PURE__ */ e(Ee, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
|
|
136
136
|
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
|
|
137
137
|
] })
|
|
138
138
|
] }),
|
|
139
139
|
/* @__PURE__ */ e(
|
|
140
|
-
|
|
140
|
+
T,
|
|
141
141
|
{
|
|
142
142
|
size: "xs",
|
|
143
143
|
variant: "ghost",
|
|
@@ -145,16 +145,16 @@ function ya({
|
|
|
145
145
|
onClick: () => d(!1),
|
|
146
146
|
"aria-label": "Close",
|
|
147
147
|
disabled: s,
|
|
148
|
-
children: /* @__PURE__ */ e(
|
|
148
|
+
children: /* @__PURE__ */ e(We, { className: "h-3.5 w-3.5" })
|
|
149
149
|
}
|
|
150
150
|
)
|
|
151
151
|
] }),
|
|
152
152
|
/* @__PURE__ */ r("div", { className: "space-y-3 px-4 py-3", children: [
|
|
153
153
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
|
|
154
154
|
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
155
|
-
/* @__PURE__ */ e(
|
|
155
|
+
/* @__PURE__ */ e(De, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
|
|
156
156
|
/* @__PURE__ */ e(
|
|
157
|
-
|
|
157
|
+
Ze,
|
|
158
158
|
{
|
|
159
159
|
id: "visual-title",
|
|
160
160
|
size: "sm",
|
|
@@ -169,9 +169,9 @@ function ya({
|
|
|
169
169
|
)
|
|
170
170
|
] }),
|
|
171
171
|
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
172
|
-
/* @__PURE__ */ e(
|
|
172
|
+
/* @__PURE__ */ e(De, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
|
|
173
173
|
/* @__PURE__ */ e(
|
|
174
|
-
|
|
174
|
+
Ze,
|
|
175
175
|
{
|
|
176
176
|
id: "visual-description",
|
|
177
177
|
size: "sm",
|
|
@@ -185,7 +185,7 @@ function ya({
|
|
|
185
185
|
] }),
|
|
186
186
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 justify-end gap-2 border-t border-border/60 px-4 py-2.5", children: [
|
|
187
187
|
/* @__PURE__ */ e(
|
|
188
|
-
|
|
188
|
+
T,
|
|
189
189
|
{
|
|
190
190
|
size: "xs",
|
|
191
191
|
variant: "outline",
|
|
@@ -195,13 +195,13 @@ function ya({
|
|
|
195
195
|
}
|
|
196
196
|
),
|
|
197
197
|
/* @__PURE__ */ e(
|
|
198
|
-
|
|
198
|
+
T,
|
|
199
199
|
{
|
|
200
200
|
size: "xs",
|
|
201
201
|
onClick: l,
|
|
202
202
|
disabled: !n.trim() || s,
|
|
203
|
-
children: s ? /* @__PURE__ */ r(
|
|
204
|
-
/* @__PURE__ */ e(
|
|
203
|
+
children: s ? /* @__PURE__ */ r(W, { children: [
|
|
204
|
+
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
205
205
|
"Creating..."
|
|
206
206
|
] }) : "Create library visual"
|
|
207
207
|
}
|
|
@@ -211,28 +211,28 @@ function ya({
|
|
|
211
211
|
}
|
|
212
212
|
) });
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Mt(t) {
|
|
215
215
|
return t ? new Date(t).toLocaleDateString("en-US", {
|
|
216
216
|
month: "short",
|
|
217
217
|
day: "numeric",
|
|
218
218
|
year: "numeric"
|
|
219
219
|
}) : "Unknown";
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function Ot(t, a) {
|
|
222
222
|
var s;
|
|
223
223
|
const i = (s = t.ownership.createdBy) == null ? void 0 : s.type;
|
|
224
224
|
return i === "tenant" || i === "organization" && a;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function pt(t, a) {
|
|
227
227
|
var i, s;
|
|
228
|
-
return
|
|
228
|
+
return Ot(t, a) ? ((i = t.ownership.createdBy) == null ? void 0 : i.name) || ((s = t.createdByTenantUserRel) == null ? void 0 : s.name) || t.lastModifiedBy || "Unknown" : "Organization";
|
|
229
229
|
}
|
|
230
230
|
function Ca(t, a) {
|
|
231
|
-
return
|
|
231
|
+
return pt(t, a).split(/\s+/).filter(Boolean).slice(0, 2).map((s) => s.charAt(0).toUpperCase()).join("") || "?";
|
|
232
232
|
}
|
|
233
233
|
function wa(t) {
|
|
234
234
|
const a = (t || "").toLowerCase();
|
|
235
|
-
return a.includes("table") ?
|
|
235
|
+
return a.includes("table") ? Lt : a.includes("pie") || a.includes("donut") ? Zt : a.includes("line") ? Qt : a.includes("bar") ? Qr : ht;
|
|
236
236
|
}
|
|
237
237
|
function Na({ visual: t }) {
|
|
238
238
|
const a = t.ownership.status === "public" ? "Public" : t.ownership.status === "shared" || t.ownership.sharedCount > 0 ? "Shared" : "Private";
|
|
@@ -242,163 +242,163 @@ function Rn({
|
|
|
242
242
|
open: t,
|
|
243
243
|
onOpenChange: a
|
|
244
244
|
}) {
|
|
245
|
-
const [i, s] =
|
|
245
|
+
const [i, s] = k(""), [n, c] = k(/* @__PURE__ */ new Set()), [u, m] = k(!1), [l, d] = k(
|
|
246
246
|
null
|
|
247
|
-
), [o,
|
|
247
|
+
), [o, f] = k(
|
|
248
248
|
null
|
|
249
|
-
), [h, p] =
|
|
250
|
-
c(/* @__PURE__ */ new Set()), d(null),
|
|
251
|
-
},
|
|
249
|
+
), [h, p] = k(!1), [y, v] = k(null), [A, E] = k(null), N = () => {
|
|
250
|
+
c(/* @__PURE__ */ new Set()), d(null), f(null), p(!1), v(null);
|
|
251
|
+
}, g = () => {
|
|
252
252
|
a(!1), N();
|
|
253
|
-
}, { selectVisual: S } = Ct(), { handleAddLibraryVisual:
|
|
253
|
+
}, { selectVisual: S } = Ct(), { handleAddLibraryVisual: D, handleEditLibraryVisual: P } = mt(), { isConsoleMode: b } = wt(), {
|
|
254
254
|
resources: C,
|
|
255
|
-
isLoading:
|
|
256
|
-
isError:
|
|
257
|
-
createResource:
|
|
258
|
-
updateResource:
|
|
259
|
-
deleteResourceAsync:
|
|
260
|
-
duplicateResource:
|
|
261
|
-
isCreating:
|
|
262
|
-
isDeleting:
|
|
255
|
+
isLoading: F,
|
|
256
|
+
isError: L,
|
|
257
|
+
createResource: K,
|
|
258
|
+
updateResource: V,
|
|
259
|
+
deleteResourceAsync: R,
|
|
260
|
+
duplicateResource: I,
|
|
261
|
+
isCreating: pe,
|
|
262
|
+
isDeleting: X
|
|
263
263
|
} = Gt(
|
|
264
264
|
void 0,
|
|
265
|
-
(
|
|
266
|
-
m(!1),
|
|
265
|
+
(x) => {
|
|
266
|
+
m(!1), x && (S(x), P(x), g());
|
|
267
267
|
}
|
|
268
268
|
), {
|
|
269
|
-
startUpdating:
|
|
270
|
-
stopUpdating:
|
|
269
|
+
startUpdating: Ce,
|
|
270
|
+
stopUpdating: ee,
|
|
271
271
|
isUpdating: He
|
|
272
|
-
} = qt(),
|
|
273
|
-
const
|
|
274
|
-
return
|
|
275
|
-
(
|
|
276
|
-
var O,
|
|
277
|
-
return ((O =
|
|
272
|
+
} = qt(), Z = C, _ = te(() => {
|
|
273
|
+
const x = i.trim().toLowerCase();
|
|
274
|
+
return x ? Z.filter(
|
|
275
|
+
(B) => {
|
|
276
|
+
var O, ne, ie;
|
|
277
|
+
return ((O = B.title) == null ? void 0 : O.toLowerCase().includes(x)) || ((ne = B.description) == null ? void 0 : ne.toLowerCase().includes(x)) || ((ie = B.kind) == null ? void 0 : ie.toLowerCase().includes(x));
|
|
278
278
|
}
|
|
279
|
-
) :
|
|
280
|
-
}, [i,
|
|
281
|
-
() =>
|
|
282
|
-
(
|
|
279
|
+
) : Z;
|
|
280
|
+
}, [i, Z]), ae = te(
|
|
281
|
+
() => Z.filter(
|
|
282
|
+
(x) => n.has(x.id)
|
|
283
283
|
),
|
|
284
|
-
[n,
|
|
285
|
-
), le =
|
|
286
|
-
(
|
|
287
|
-
), ce =
|
|
288
|
-
(
|
|
289
|
-
),
|
|
290
|
-
(
|
|
291
|
-
),
|
|
292
|
-
(
|
|
293
|
-
), de = (
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
},
|
|
297
|
-
de((
|
|
298
|
-
|
|
284
|
+
[n, Z]
|
|
285
|
+
), le = ae.filter(
|
|
286
|
+
(x) => x.permissions.canDelete
|
|
287
|
+
), ce = ae.filter(
|
|
288
|
+
(x) => x.permissions.canShare
|
|
289
|
+
), we = _.length > 0 && _.every(
|
|
290
|
+
(x) => n.has(x.id)
|
|
291
|
+
), Ie = _.some(
|
|
292
|
+
(x) => n.has(x.id)
|
|
293
|
+
), de = (x) => {
|
|
294
|
+
const B = new Set(n);
|
|
295
|
+
x(B), c(B);
|
|
296
|
+
}, fe = (x) => {
|
|
297
|
+
de((B) => {
|
|
298
|
+
B.has(x) ? B.delete(x) : B.add(x);
|
|
299
299
|
});
|
|
300
|
-
},
|
|
301
|
-
c((
|
|
302
|
-
const
|
|
303
|
-
return
|
|
304
|
-
(O) =>
|
|
300
|
+
}, Q = () => {
|
|
301
|
+
c((x) => {
|
|
302
|
+
const B = new Set(x);
|
|
303
|
+
return we ? _.forEach(
|
|
304
|
+
(O) => B.delete(O.id)
|
|
305
305
|
) : _.forEach(
|
|
306
|
-
(O) =>
|
|
307
|
-
),
|
|
306
|
+
(O) => B.add(O.id)
|
|
307
|
+
), B;
|
|
308
308
|
});
|
|
309
|
-
},
|
|
310
|
-
(await
|
|
309
|
+
}, Ne = async (x) => {
|
|
310
|
+
(await D(x)).success && g();
|
|
311
311
|
}, $ = async () => {
|
|
312
|
-
const
|
|
313
|
-
if (
|
|
314
|
-
let
|
|
315
|
-
for (const O of
|
|
316
|
-
if (!(await
|
|
317
|
-
|
|
312
|
+
const x = ae;
|
|
313
|
+
if (x.length === 0) return;
|
|
314
|
+
let B = !1;
|
|
315
|
+
for (const O of x)
|
|
316
|
+
if (!(await D(O)).success) {
|
|
317
|
+
B = !0;
|
|
318
318
|
break;
|
|
319
319
|
}
|
|
320
|
-
|
|
321
|
-
}, j = (
|
|
322
|
-
P(
|
|
323
|
-
}, se = (
|
|
324
|
-
E(
|
|
320
|
+
B || g();
|
|
321
|
+
}, j = (x) => {
|
|
322
|
+
P(x), g();
|
|
323
|
+
}, se = (x) => {
|
|
324
|
+
E(x), I(x, {
|
|
325
325
|
onSettled: () => E(null)
|
|
326
326
|
});
|
|
327
|
-
},
|
|
327
|
+
}, ge = () => {
|
|
328
328
|
if (le.length === 0) {
|
|
329
329
|
z.error("Select a visual you can delete");
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
332
|
-
|
|
333
|
-
},
|
|
334
|
-
const
|
|
332
|
+
v(null), p(!0);
|
|
333
|
+
}, Fe = async () => {
|
|
334
|
+
const x = y ? [y] : le;
|
|
335
335
|
try {
|
|
336
|
-
for (const
|
|
337
|
-
await
|
|
338
|
-
c((
|
|
339
|
-
const O = new Set(
|
|
340
|
-
return
|
|
341
|
-
(
|
|
336
|
+
for (const B of x)
|
|
337
|
+
await R(B.id);
|
|
338
|
+
c((B) => {
|
|
339
|
+
const O = new Set(B);
|
|
340
|
+
return x.forEach(
|
|
341
|
+
(ne) => O.delete(ne.id)
|
|
342
342
|
), O;
|
|
343
|
-
}), p(!1),
|
|
343
|
+
}), p(!1), v(null);
|
|
344
344
|
} catch {
|
|
345
345
|
}
|
|
346
346
|
}, Ge = () => {
|
|
347
|
-
if (
|
|
347
|
+
if (ae.length !== 1) {
|
|
348
348
|
z.error("Select one visual to share");
|
|
349
349
|
return;
|
|
350
350
|
}
|
|
351
|
-
const [
|
|
352
|
-
if (!
|
|
351
|
+
const [x] = ae;
|
|
352
|
+
if (!x.permissions.canShare) {
|
|
353
353
|
z.error("You do not have permission to share this visual");
|
|
354
354
|
return;
|
|
355
355
|
}
|
|
356
|
-
d(
|
|
357
|
-
},
|
|
358
|
-
title:
|
|
359
|
-
description:
|
|
356
|
+
d(x);
|
|
357
|
+
}, Se = ({
|
|
358
|
+
title: x,
|
|
359
|
+
description: B
|
|
360
360
|
}) => {
|
|
361
361
|
if (!o) return;
|
|
362
362
|
const O = {};
|
|
363
|
-
if (
|
|
364
|
-
|
|
363
|
+
if (x !== o.title && (O.title = x), (o.description || "") !== B && (O.description = B), Object.keys(O).length === 0) {
|
|
364
|
+
f(null);
|
|
365
365
|
return;
|
|
366
366
|
}
|
|
367
|
-
const
|
|
368
|
-
|
|
367
|
+
const ne = Object.keys(O), ie = ne.length === 1 ? ne[0] : void 0;
|
|
368
|
+
Ce(o.id, ie), V(
|
|
369
369
|
{
|
|
370
370
|
resourceId: o.id,
|
|
371
371
|
data: O
|
|
372
372
|
},
|
|
373
373
|
{
|
|
374
374
|
onSuccess: () => {
|
|
375
|
-
|
|
375
|
+
ee(o.id, ie), f(null);
|
|
376
376
|
},
|
|
377
377
|
onError: () => {
|
|
378
|
-
|
|
378
|
+
ee(o.id, ie);
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
381
|
);
|
|
382
|
-
}, ue = (
|
|
383
|
-
a(
|
|
384
|
-
},
|
|
385
|
-
return /* @__PURE__ */ r(
|
|
386
|
-
/* @__PURE__ */ e(
|
|
387
|
-
|
|
382
|
+
}, ue = (x) => {
|
|
383
|
+
a(x), x || N();
|
|
384
|
+
}, Y = y ? 1 : le.length;
|
|
385
|
+
return /* @__PURE__ */ r(W, { children: [
|
|
386
|
+
/* @__PURE__ */ e(ke, { open: t, onOpenChange: ue, children: /* @__PURE__ */ r(
|
|
387
|
+
Ae,
|
|
388
388
|
{
|
|
389
389
|
showCloseButton: !1,
|
|
390
390
|
className: "flex max-h-[80vh] w-[min(72rem,calc(100vw-2rem))] max-w-none grid-cols-none flex-col gap-0 overflow-hidden rounded-[6px] border-border/60 p-0 shadow-lg",
|
|
391
391
|
children: [
|
|
392
392
|
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
393
393
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
394
|
-
/* @__PURE__ */ e(
|
|
394
|
+
/* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
395
395
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
396
|
-
/* @__PURE__ */ e(
|
|
396
|
+
/* @__PURE__ */ e(Ee, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
|
|
397
397
|
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
|
|
398
398
|
] })
|
|
399
399
|
] }),
|
|
400
400
|
/* @__PURE__ */ e(
|
|
401
|
-
|
|
401
|
+
T,
|
|
402
402
|
{
|
|
403
403
|
size: "xs",
|
|
404
404
|
variant: "ghost",
|
|
@@ -417,7 +417,7 @@ function Rn({
|
|
|
417
417
|
{
|
|
418
418
|
autoFocus: !0,
|
|
419
419
|
value: i,
|
|
420
|
-
onChange: (
|
|
420
|
+
onChange: (x) => s(x.target.value),
|
|
421
421
|
placeholder: "Search visuals...",
|
|
422
422
|
className: "h-7 w-full rounded-control border border-input bg-background pl-7 pr-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-ring focus:outline-none",
|
|
423
423
|
"aria-label": "Search visuals"
|
|
@@ -425,21 +425,21 @@ function Rn({
|
|
|
425
425
|
)
|
|
426
426
|
] }),
|
|
427
427
|
/* @__PURE__ */ r(
|
|
428
|
-
|
|
428
|
+
T,
|
|
429
429
|
{
|
|
430
430
|
size: "xs",
|
|
431
431
|
variant: "outline",
|
|
432
432
|
className: "ml-auto",
|
|
433
433
|
onClick: () => m(!0),
|
|
434
434
|
children: [
|
|
435
|
-
/* @__PURE__ */ e(
|
|
435
|
+
/* @__PURE__ */ e(be, { className: "h-3.5 w-3.5" }),
|
|
436
436
|
"New library visual"
|
|
437
437
|
]
|
|
438
438
|
}
|
|
439
439
|
)
|
|
440
440
|
] }),
|
|
441
|
-
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children:
|
|
442
|
-
/* @__PURE__ */ e(
|
|
441
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children: F ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(va, {}) }) : L ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ e("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : _.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
|
|
442
|
+
/* @__PURE__ */ e(ht, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
443
443
|
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: i ? "No visuals found" : "No visuals yet" }),
|
|
444
444
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: i ? "Try a different search." : "Create a saved visual to add it here." })
|
|
445
445
|
] }) : /* @__PURE__ */ e(
|
|
@@ -447,32 +447,32 @@ function Rn({
|
|
|
447
447
|
{
|
|
448
448
|
visuals: _,
|
|
449
449
|
selectedIds: n,
|
|
450
|
-
allFilteredSelected:
|
|
451
|
-
someFilteredSelected:
|
|
452
|
-
onSelectAll:
|
|
453
|
-
onToggleSelection:
|
|
454
|
-
onAddVisual:
|
|
450
|
+
allFilteredSelected: we,
|
|
451
|
+
someFilteredSelected: Ie,
|
|
452
|
+
onSelectAll: Q,
|
|
453
|
+
onToggleSelection: fe,
|
|
454
|
+
onAddVisual: Ne,
|
|
455
455
|
onOpenVisual: j,
|
|
456
|
-
onEditDetails:
|
|
456
|
+
onEditDetails: f,
|
|
457
457
|
onShareVisual: d,
|
|
458
|
-
onDeleteVisual: (
|
|
459
|
-
x
|
|
458
|
+
onDeleteVisual: (x) => {
|
|
459
|
+
v(x), p(!0);
|
|
460
460
|
},
|
|
461
461
|
onDuplicateVisual: se,
|
|
462
|
-
duplicatingId:
|
|
463
|
-
isDeleting:
|
|
464
|
-
isConsoleMode:
|
|
462
|
+
duplicatingId: A,
|
|
463
|
+
isDeleting: X,
|
|
464
|
+
isConsoleMode: b
|
|
465
465
|
}
|
|
466
466
|
) }),
|
|
467
467
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
|
|
468
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children: n.size > 0 && /* @__PURE__ */ r(
|
|
468
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children: n.size > 0 && /* @__PURE__ */ r(W, { children: [
|
|
469
469
|
/* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: [
|
|
470
470
|
/* @__PURE__ */ e("span", { className: "font-medium tabular-nums text-foreground", children: n.size }),
|
|
471
471
|
" ",
|
|
472
472
|
"selected"
|
|
473
473
|
] }),
|
|
474
474
|
/* @__PURE__ */ e(
|
|
475
|
-
|
|
475
|
+
T,
|
|
476
476
|
{
|
|
477
477
|
size: "xs",
|
|
478
478
|
variant: "ghost",
|
|
@@ -481,28 +481,28 @@ function Rn({
|
|
|
481
481
|
}
|
|
482
482
|
),
|
|
483
483
|
/* @__PURE__ */ r(
|
|
484
|
-
|
|
484
|
+
T,
|
|
485
485
|
{
|
|
486
486
|
size: "xs",
|
|
487
487
|
variant: "outline",
|
|
488
488
|
onClick: Ge,
|
|
489
|
-
disabled:
|
|
489
|
+
disabled: ae.length !== 1 || ce.length !== 1,
|
|
490
490
|
children: [
|
|
491
|
-
/* @__PURE__ */ e(
|
|
491
|
+
/* @__PURE__ */ e(Nt, { className: "h-3.5 w-3.5" }),
|
|
492
492
|
"Share"
|
|
493
493
|
]
|
|
494
494
|
}
|
|
495
495
|
),
|
|
496
496
|
/* @__PURE__ */ r(
|
|
497
|
-
|
|
497
|
+
T,
|
|
498
498
|
{
|
|
499
499
|
size: "xs",
|
|
500
500
|
variant: "outline",
|
|
501
501
|
className: "text-destructive hover:text-destructive",
|
|
502
|
-
onClick:
|
|
502
|
+
onClick: ge,
|
|
503
503
|
disabled: le.length === 0,
|
|
504
504
|
children: [
|
|
505
|
-
/* @__PURE__ */ e(
|
|
505
|
+
/* @__PURE__ */ e(Re, { className: "h-3.5 w-3.5" }),
|
|
506
506
|
"Delete ",
|
|
507
507
|
le.length || n.size
|
|
508
508
|
]
|
|
@@ -511,7 +511,7 @@ function Rn({
|
|
|
511
511
|
] }) }),
|
|
512
512
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
513
513
|
/* @__PURE__ */ e(
|
|
514
|
-
|
|
514
|
+
T,
|
|
515
515
|
{
|
|
516
516
|
size: "xs",
|
|
517
517
|
variant: "outline",
|
|
@@ -520,13 +520,13 @@ function Rn({
|
|
|
520
520
|
}
|
|
521
521
|
),
|
|
522
522
|
/* @__PURE__ */ r(
|
|
523
|
-
|
|
523
|
+
T,
|
|
524
524
|
{
|
|
525
525
|
size: "xs",
|
|
526
526
|
onClick: $,
|
|
527
527
|
disabled: n.size === 0,
|
|
528
528
|
children: [
|
|
529
|
-
/* @__PURE__ */ e(
|
|
529
|
+
/* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" }),
|
|
530
530
|
n.size === 0 ? "Add to dashboard" : `Add ${n.size} visual${n.size === 1 ? "" : "s"}`
|
|
531
531
|
]
|
|
532
532
|
}
|
|
@@ -541,8 +541,8 @@ function Rn({
|
|
|
541
541
|
{
|
|
542
542
|
open: u,
|
|
543
543
|
onOpenChange: m,
|
|
544
|
-
onSubmit:
|
|
545
|
-
isCreating:
|
|
544
|
+
onSubmit: K,
|
|
545
|
+
isCreating: pe
|
|
546
546
|
}
|
|
547
547
|
),
|
|
548
548
|
l && /* @__PURE__ */ e(
|
|
@@ -560,41 +560,41 @@ function Rn({
|
|
|
560
560
|
resourceLabel: "Visual",
|
|
561
561
|
initialTitle: o.title || "",
|
|
562
562
|
initialDescription: o.description || "",
|
|
563
|
-
onClose: () =>
|
|
564
|
-
onSave:
|
|
563
|
+
onClose: () => f(null),
|
|
564
|
+
onSave: Se,
|
|
565
565
|
isSaving: He(o.id)
|
|
566
566
|
}
|
|
567
567
|
),
|
|
568
568
|
/* @__PURE__ */ e(
|
|
569
|
-
|
|
569
|
+
Je,
|
|
570
570
|
{
|
|
571
571
|
open: h,
|
|
572
|
-
onOpenChange: (
|
|
573
|
-
!
|
|
572
|
+
onOpenChange: (x) => {
|
|
573
|
+
!x && X || (p(x), x || v(null));
|
|
574
574
|
},
|
|
575
|
-
children: /* @__PURE__ */ r(
|
|
576
|
-
/* @__PURE__ */ r(
|
|
577
|
-
/* @__PURE__ */ r(
|
|
575
|
+
children: /* @__PURE__ */ r(et, { children: [
|
|
576
|
+
/* @__PURE__ */ r(tt, { children: [
|
|
577
|
+
/* @__PURE__ */ r(rt, { children: [
|
|
578
578
|
"Delete ",
|
|
579
|
-
|
|
579
|
+
Y,
|
|
580
580
|
" visual",
|
|
581
|
-
|
|
581
|
+
Y === 1 ? "" : "s",
|
|
582
582
|
"?"
|
|
583
583
|
] }),
|
|
584
|
-
/* @__PURE__ */ e(
|
|
584
|
+
/* @__PURE__ */ e(at, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
|
|
585
585
|
] }),
|
|
586
|
-
/* @__PURE__ */ r(
|
|
587
|
-
/* @__PURE__ */ e(
|
|
586
|
+
/* @__PURE__ */ r(nt, { children: [
|
|
587
|
+
/* @__PURE__ */ e(st, { disabled: X, children: "Cancel" }),
|
|
588
588
|
/* @__PURE__ */ r(
|
|
589
|
-
|
|
589
|
+
St,
|
|
590
590
|
{
|
|
591
|
-
onClick: (
|
|
592
|
-
|
|
591
|
+
onClick: (x) => {
|
|
592
|
+
x.preventDefault(), Fe();
|
|
593
593
|
},
|
|
594
|
-
disabled:
|
|
594
|
+
disabled: X || Y === 0,
|
|
595
595
|
children: [
|
|
596
|
-
|
|
597
|
-
|
|
596
|
+
X ? /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Re, { className: "h-3.5 w-3.5" }),
|
|
597
|
+
X ? "Deleting..." : "Delete"
|
|
598
598
|
]
|
|
599
599
|
}
|
|
600
600
|
)
|
|
@@ -616,7 +616,7 @@ function Sa({
|
|
|
616
616
|
onEditDetails: l,
|
|
617
617
|
onShareVisual: d,
|
|
618
618
|
onDeleteVisual: o,
|
|
619
|
-
onDuplicateVisual:
|
|
619
|
+
onDuplicateVisual: f,
|
|
620
620
|
duplicatingId: h,
|
|
621
621
|
isDeleting: p,
|
|
622
622
|
isConsoleMode: y
|
|
@@ -624,7 +624,7 @@ function Sa({
|
|
|
624
624
|
return /* @__PURE__ */ r("div", { className: "min-w-[48rem]", children: [
|
|
625
625
|
/* @__PURE__ */ r("div", { className: "grid h-9 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/60 px-3 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: [
|
|
626
626
|
/* @__PURE__ */ e(
|
|
627
|
-
|
|
627
|
+
ot,
|
|
628
628
|
{
|
|
629
629
|
checked: i ? !0 : s ? "indeterminate" : !1,
|
|
630
630
|
onCheckedChange: n,
|
|
@@ -638,23 +638,23 @@ function Sa({
|
|
|
638
638
|
/* @__PURE__ */ e("span", { className: "text-right", children: "Shared" }),
|
|
639
639
|
/* @__PURE__ */ e("span", { className: "text-right", children: "Actions" })
|
|
640
640
|
] }),
|
|
641
|
-
t.map((
|
|
641
|
+
t.map((v) => /* @__PURE__ */ e(
|
|
642
642
|
Da,
|
|
643
643
|
{
|
|
644
|
-
visual:
|
|
645
|
-
selected: a.has(
|
|
644
|
+
visual: v,
|
|
645
|
+
selected: a.has(v.id),
|
|
646
646
|
onToggleSelection: c,
|
|
647
647
|
onAddVisual: u,
|
|
648
648
|
onOpenVisual: m,
|
|
649
649
|
onEditDetails: l,
|
|
650
650
|
onShareVisual: d,
|
|
651
651
|
onDeleteVisual: o,
|
|
652
|
-
onDuplicateVisual:
|
|
652
|
+
onDuplicateVisual: f,
|
|
653
653
|
duplicatingId: h,
|
|
654
654
|
isDeleting: p,
|
|
655
655
|
isConsoleMode: y
|
|
656
656
|
},
|
|
657
|
-
|
|
657
|
+
v.id
|
|
658
658
|
))
|
|
659
659
|
] });
|
|
660
660
|
}
|
|
@@ -670,7 +670,7 @@ function Da({
|
|
|
670
670
|
onDuplicateVisual: l,
|
|
671
671
|
duplicatingId: d,
|
|
672
672
|
isDeleting: o,
|
|
673
|
-
isConsoleMode:
|
|
673
|
+
isConsoleMode: f
|
|
674
674
|
}) {
|
|
675
675
|
var y;
|
|
676
676
|
const h = wa(t.kind), p = () => {
|
|
@@ -679,13 +679,13 @@ function Da({
|
|
|
679
679
|
return /* @__PURE__ */ r(
|
|
680
680
|
"div",
|
|
681
681
|
{
|
|
682
|
-
className:
|
|
682
|
+
className: q(
|
|
683
683
|
"group grid min-h-12 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/50 px-3 text-[13px] hover:bg-muted/50",
|
|
684
684
|
a && "bg-muted/70"
|
|
685
685
|
),
|
|
686
686
|
children: [
|
|
687
687
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
688
|
-
|
|
688
|
+
ot,
|
|
689
689
|
{
|
|
690
690
|
checked: a,
|
|
691
691
|
onCheckedChange: () => i(t.id),
|
|
@@ -723,10 +723,10 @@ function Da({
|
|
|
723
723
|
}
|
|
724
724
|
),
|
|
725
725
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
726
|
-
/* @__PURE__ */ e("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: Ca(t,
|
|
727
|
-
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children:
|
|
726
|
+
/* @__PURE__ */ e("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: Ca(t, f) }),
|
|
727
|
+
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: pt(t, f) })
|
|
728
728
|
] }),
|
|
729
|
-
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children:
|
|
729
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: Mt(t.updatedAt) }),
|
|
730
730
|
/* @__PURE__ */ e(Na, { visual: t }),
|
|
731
731
|
/* @__PURE__ */ e("span", { className: "text-right tabular-nums text-muted-foreground", children: t.ownership.sharedCount > 0 ? t.ownership.sharedCount : "—" }),
|
|
732
732
|
/* @__PURE__ */ e(
|
|
@@ -740,7 +740,7 @@ function Da({
|
|
|
740
740
|
onDuplicateVisual: l,
|
|
741
741
|
duplicatingId: d,
|
|
742
742
|
isDeleting: o,
|
|
743
|
-
isConsoleMode:
|
|
743
|
+
isConsoleMode: f
|
|
744
744
|
}
|
|
745
745
|
)
|
|
746
746
|
]
|
|
@@ -765,7 +765,7 @@ function ka({
|
|
|
765
765
|
onClick: (d) => d.stopPropagation(),
|
|
766
766
|
children: [
|
|
767
767
|
/* @__PURE__ */ e(
|
|
768
|
-
|
|
768
|
+
T,
|
|
769
769
|
{
|
|
770
770
|
size: "xs",
|
|
771
771
|
variant: "ghost",
|
|
@@ -775,19 +775,19 @@ function ka({
|
|
|
775
775
|
children: /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" })
|
|
776
776
|
}
|
|
777
777
|
),
|
|
778
|
-
/* @__PURE__ */ r(
|
|
779
|
-
/* @__PURE__ */ e(
|
|
780
|
-
|
|
778
|
+
/* @__PURE__ */ r(ze, { modal: !1, children: [
|
|
779
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ e(
|
|
780
|
+
T,
|
|
781
781
|
{
|
|
782
782
|
size: "xs",
|
|
783
783
|
variant: "ghost",
|
|
784
784
|
className: "w-7 px-0",
|
|
785
785
|
"aria-label": "More actions",
|
|
786
|
-
children: /* @__PURE__ */ e(
|
|
786
|
+
children: /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5" })
|
|
787
787
|
}
|
|
788
788
|
) }),
|
|
789
789
|
/* @__PURE__ */ r(
|
|
790
|
-
|
|
790
|
+
$e,
|
|
791
791
|
{
|
|
792
792
|
align: "end",
|
|
793
793
|
className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
@@ -802,7 +802,7 @@ function ka({
|
|
|
802
802
|
onClick: () => c(t.id),
|
|
803
803
|
disabled: u === t.id,
|
|
804
804
|
children: [
|
|
805
|
-
u === t.id ? /* @__PURE__ */ e(
|
|
805
|
+
u === t.id ? /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Jt, { className: "h-3.5 w-3.5" }),
|
|
806
806
|
u === t.id ? "Duplicating..." : "Duplicate"
|
|
807
807
|
]
|
|
808
808
|
}
|
|
@@ -812,11 +812,11 @@ function ka({
|
|
|
812
812
|
"Edit details"
|
|
813
813
|
] }),
|
|
814
814
|
t.permissions.canShare && /* @__PURE__ */ r(H, { onClick: () => s(t), children: [
|
|
815
|
-
/* @__PURE__ */ e(
|
|
815
|
+
/* @__PURE__ */ e(Nt, { className: "h-3.5 w-3.5" }),
|
|
816
816
|
"Share"
|
|
817
817
|
] }),
|
|
818
|
-
t.permissions.canDelete && /* @__PURE__ */ r(
|
|
819
|
-
/* @__PURE__ */ e(
|
|
818
|
+
t.permissions.canDelete && /* @__PURE__ */ r(W, { children: [
|
|
819
|
+
/* @__PURE__ */ e(Ue, {}),
|
|
820
820
|
/* @__PURE__ */ r(
|
|
821
821
|
H,
|
|
822
822
|
{
|
|
@@ -824,21 +824,21 @@ function ka({
|
|
|
824
824
|
onClick: () => n(t),
|
|
825
825
|
disabled: m,
|
|
826
826
|
children: [
|
|
827
|
-
/* @__PURE__ */ e(
|
|
827
|
+
/* @__PURE__ */ e(Re, { className: "h-3.5 w-3.5" }),
|
|
828
828
|
m ? "Deleting..." : "Delete"
|
|
829
829
|
]
|
|
830
830
|
}
|
|
831
831
|
)
|
|
832
832
|
] }),
|
|
833
|
-
/* @__PURE__ */ e(
|
|
833
|
+
/* @__PURE__ */ e(Ue, {}),
|
|
834
834
|
/* @__PURE__ */ r("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
|
|
835
|
-
|
|
835
|
+
Ot(t, l) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
836
836
|
/* @__PURE__ */ e(er, { className: "h-3 w-3" }),
|
|
837
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
837
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: pt(t, l) })
|
|
838
838
|
] }),
|
|
839
839
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
840
840
|
/* @__PURE__ */ e(tr, { className: "h-3 w-3" }),
|
|
841
|
-
/* @__PURE__ */ e("span", { children:
|
|
841
|
+
/* @__PURE__ */ e("span", { children: Mt(t.updatedAt) })
|
|
842
842
|
] })
|
|
843
843
|
] })
|
|
844
844
|
]
|
|
@@ -858,15 +858,15 @@ function Aa({
|
|
|
858
858
|
destinationMode: c = "both",
|
|
859
859
|
onConfirm: u
|
|
860
860
|
}) {
|
|
861
|
-
const [m, l] =
|
|
861
|
+
const [m, l] = k(
|
|
862
862
|
i && s ? `Copy of ${s}` : s || ""
|
|
863
|
-
), [d, o] =
|
|
864
|
-
|
|
863
|
+
), [d, o] = k("");
|
|
864
|
+
Wt.useEffect(() => {
|
|
865
865
|
t && (l(
|
|
866
866
|
i && s ? `Copy of ${s}` : s || ""
|
|
867
867
|
), o(""));
|
|
868
868
|
}, [t, i, s]);
|
|
869
|
-
const
|
|
869
|
+
const f = !!m.trim(), h = c === "local" ? {
|
|
870
870
|
saveToLibrary: !1,
|
|
871
871
|
saveToCurrentDashboard: !0,
|
|
872
872
|
badgeType: "local",
|
|
@@ -885,16 +885,16 @@ function Aa({
|
|
|
885
885
|
description: "Creates a new library visual and adds a linked copy to this dashboard.",
|
|
886
886
|
actionLabel: "Save Copy as Linked Visual"
|
|
887
887
|
}, p = () => {
|
|
888
|
-
!
|
|
888
|
+
!f || n || u({
|
|
889
889
|
name: m.trim(),
|
|
890
890
|
description: d.trim() || void 0,
|
|
891
891
|
saveToLibrary: h.saveToLibrary,
|
|
892
892
|
saveToCurrentDashboard: h.saveToCurrentDashboard
|
|
893
893
|
});
|
|
894
894
|
};
|
|
895
|
-
return /* @__PURE__ */ e(
|
|
896
|
-
/* @__PURE__ */ r(
|
|
897
|
-
/* @__PURE__ */ r(
|
|
895
|
+
return /* @__PURE__ */ e(ke, { open: t, onOpenChange: a, children: /* @__PURE__ */ r(Ae, { className: "sm:max-w-[500px]", children: [
|
|
896
|
+
/* @__PURE__ */ r(it, { children: [
|
|
897
|
+
/* @__PURE__ */ r(Ee, { className: "flex items-center gap-2", children: [
|
|
898
898
|
/* @__PURE__ */ e("span", { children: "Save Visual As" }),
|
|
899
899
|
h.badgeType !== "local" && /* @__PURE__ */ e(
|
|
900
900
|
sa,
|
|
@@ -905,13 +905,13 @@ function Aa({
|
|
|
905
905
|
}
|
|
906
906
|
)
|
|
907
907
|
] }),
|
|
908
|
-
/* @__PURE__ */ e(
|
|
908
|
+
/* @__PURE__ */ e(lt, { children: h.description })
|
|
909
909
|
] }),
|
|
910
910
|
/* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
|
|
911
911
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
912
|
-
/* @__PURE__ */ e(
|
|
912
|
+
/* @__PURE__ */ e(De, { htmlFor: "name", children: "Name" }),
|
|
913
913
|
/* @__PURE__ */ e(
|
|
914
|
-
|
|
914
|
+
Ze,
|
|
915
915
|
{
|
|
916
916
|
id: "name",
|
|
917
917
|
value: m,
|
|
@@ -922,7 +922,7 @@ function Aa({
|
|
|
922
922
|
)
|
|
923
923
|
] }),
|
|
924
924
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
925
|
-
/* @__PURE__ */ e(
|
|
925
|
+
/* @__PURE__ */ e(De, { htmlFor: "description", children: "Description (optional)" }),
|
|
926
926
|
/* @__PURE__ */ e(
|
|
927
927
|
rr,
|
|
928
928
|
{
|
|
@@ -938,7 +938,7 @@ function Aa({
|
|
|
938
938
|
] }),
|
|
939
939
|
/* @__PURE__ */ r(ar, { children: [
|
|
940
940
|
/* @__PURE__ */ e(
|
|
941
|
-
|
|
941
|
+
T,
|
|
942
942
|
{
|
|
943
943
|
variant: "outline",
|
|
944
944
|
onClick: () => a(!1),
|
|
@@ -946,30 +946,30 @@ function Aa({
|
|
|
946
946
|
children: "Cancel"
|
|
947
947
|
}
|
|
948
948
|
),
|
|
949
|
-
/* @__PURE__ */ r(
|
|
950
|
-
n && /* @__PURE__ */ e(
|
|
949
|
+
/* @__PURE__ */ r(T, { onClick: p, disabled: !f || n, children: [
|
|
950
|
+
n && /* @__PURE__ */ e(re, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
951
951
|
h.actionLabel
|
|
952
952
|
] })
|
|
953
953
|
] })
|
|
954
954
|
] }) });
|
|
955
955
|
}
|
|
956
956
|
function Ea() {
|
|
957
|
-
const [t, a] =
|
|
958
|
-
var
|
|
959
|
-
return ((
|
|
960
|
-
})(),
|
|
961
|
-
|
|
957
|
+
const [t, a] = k(!1), [i, s] = k(!1), [n, c] = k(null), [u, m] = k(null), l = xe((b) => b.frame), d = xe((b) => b.card), o = nr(), f = M((b) => b.selectedSheetId), h = M((b) => b.dashboard), { getUpdatedFrame: p } = mt(), { selectVisual: y } = Ct(), { addFrame: v, setSelectedFrameId: A, setIsVisualEditing: E } = ve(), N = kt(), g = !!(l != null && l.visualId), S = (() => {
|
|
958
|
+
var b, C;
|
|
959
|
+
return ((b = l == null ? void 0 : l.cards) == null ? void 0 : b.length) === 1 && ((C = l.cards[0]) != null && C.title) ? l.cards[0].title : o != null && o.title ? o.title : (d == null ? void 0 : d.title) || "Untitled Visual";
|
|
960
|
+
})(), D = sr((b) => {
|
|
961
|
+
b != null && b.id && (y(b), i && n && u && f && (async () => {
|
|
962
962
|
try {
|
|
963
963
|
const C = {
|
|
964
964
|
...n,
|
|
965
|
-
id:
|
|
966
|
-
visualId:
|
|
965
|
+
id: gt(),
|
|
966
|
+
visualId: b.id
|
|
967
967
|
// Link to the newly created library visual
|
|
968
968
|
};
|
|
969
|
-
|
|
969
|
+
v(f, C, {
|
|
970
970
|
position: "end",
|
|
971
971
|
semanticExecutionPayload: u
|
|
972
|
-
}),
|
|
972
|
+
}), A(C.id), s(!1), c(null), m(null), E(!1);
|
|
973
973
|
} catch (C) {
|
|
974
974
|
console.error(
|
|
975
975
|
"Failed to promote semantic metadata for saved visual:",
|
|
@@ -983,170 +983,182 @@ function Ea() {
|
|
|
983
983
|
return {
|
|
984
984
|
saveAsDialogOpen: t,
|
|
985
985
|
setSaveAsDialogOpen: a,
|
|
986
|
-
handleSaveAs: async (
|
|
987
|
-
if (!
|
|
986
|
+
handleSaveAs: async (b) => {
|
|
987
|
+
if (!f) {
|
|
988
988
|
z.error("No sheet selected");
|
|
989
989
|
return;
|
|
990
990
|
}
|
|
991
|
-
const C = p(),
|
|
992
|
-
if (
|
|
993
|
-
z.error(
|
|
991
|
+
const C = p(), F = Tt(C);
|
|
992
|
+
if (F) {
|
|
993
|
+
z.error(F);
|
|
994
994
|
return;
|
|
995
995
|
}
|
|
996
|
-
const
|
|
996
|
+
const K = C.cards.length === 1 ? {
|
|
997
997
|
...C,
|
|
998
|
-
cards: C.cards.map((
|
|
999
|
-
...
|
|
1000
|
-
title:
|
|
998
|
+
cards: C.cards.map((V) => ({
|
|
999
|
+
...V,
|
|
1000
|
+
title: b.name
|
|
1001
1001
|
// Use visual name as card title
|
|
1002
1002
|
}))
|
|
1003
1003
|
} : C;
|
|
1004
|
-
if (
|
|
1005
|
-
let
|
|
1006
|
-
if (
|
|
1004
|
+
if (b.saveToLibrary) {
|
|
1005
|
+
let V = null;
|
|
1006
|
+
if (b.saveToCurrentDashboard)
|
|
1007
1007
|
try {
|
|
1008
|
-
|
|
1009
|
-
previousFrame:
|
|
1008
|
+
V = await N(K, {
|
|
1009
|
+
previousFrame: Qe(h, K.id)
|
|
1010
1010
|
});
|
|
1011
|
-
} catch (
|
|
1011
|
+
} catch (I) {
|
|
1012
1012
|
console.error(
|
|
1013
1013
|
"Failed to prepare semantic metadata before saving visual:",
|
|
1014
|
-
|
|
1014
|
+
I
|
|
1015
1015
|
), z.error(
|
|
1016
|
-
|
|
1016
|
+
I instanceof Error ? I.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1017
1017
|
);
|
|
1018
1018
|
return;
|
|
1019
1019
|
}
|
|
1020
|
-
s(
|
|
1021
|
-
const
|
|
1022
|
-
title:
|
|
1023
|
-
description:
|
|
1024
|
-
frameObject:
|
|
1020
|
+
s(b.saveToCurrentDashboard), c(K), m(V);
|
|
1021
|
+
const R = {
|
|
1022
|
+
title: b.name,
|
|
1023
|
+
description: b.description,
|
|
1024
|
+
frameObject: K,
|
|
1025
1025
|
// Card title synced for single-card frames
|
|
1026
1026
|
isPrivate: !1
|
|
1027
1027
|
};
|
|
1028
|
-
|
|
1029
|
-
} else if (
|
|
1030
|
-
const
|
|
1031
|
-
...
|
|
1028
|
+
D.mutate(R);
|
|
1029
|
+
} else if (b.saveToCurrentDashboard) {
|
|
1030
|
+
const V = {
|
|
1031
|
+
...K,
|
|
1032
1032
|
// Card title already synced
|
|
1033
|
-
id:
|
|
1033
|
+
id: gt(),
|
|
1034
1034
|
visualId: void 0
|
|
1035
1035
|
// Explicitly no visualId for local visuals
|
|
1036
1036
|
};
|
|
1037
1037
|
try {
|
|
1038
|
-
const
|
|
1039
|
-
previousFrame:
|
|
1038
|
+
const R = await N(K, {
|
|
1039
|
+
previousFrame: Qe(h, K.id)
|
|
1040
1040
|
});
|
|
1041
|
-
|
|
1041
|
+
v(f, V, {
|
|
1042
1042
|
position: "end",
|
|
1043
|
-
semanticExecutionPayload:
|
|
1044
|
-
}),
|
|
1045
|
-
} catch (
|
|
1046
|
-
console.error("Failed to save visual to dashboard:",
|
|
1047
|
-
|
|
1043
|
+
semanticExecutionPayload: R
|
|
1044
|
+
}), A(V.id), z.success("Visual saved to dashboard"), a(!1), E(!1);
|
|
1045
|
+
} catch (R) {
|
|
1046
|
+
console.error("Failed to save visual to dashboard:", R), z.error(
|
|
1047
|
+
R instanceof Error ? R.message : "Failed to prepare semantic metadata for the visual"
|
|
1048
1048
|
);
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
1051
|
},
|
|
1052
|
-
isLibraryVisual:
|
|
1052
|
+
isLibraryVisual: g,
|
|
1053
1053
|
currentVisualName: S,
|
|
1054
|
-
isSaving:
|
|
1054
|
+
isSaving: D.isPending
|
|
1055
1055
|
};
|
|
1056
1056
|
}
|
|
1057
1057
|
function Un(t = {}) {
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
/* @__PURE__ */ e(
|
|
1058
|
+
var R;
|
|
1059
|
+
const { preferences: a } = wt(), i = ((R = a == null ? void 0 : a.uiMode) == null ? void 0 : R.inspection) === !0, s = xe((I) => I.frame), n = xe((I) => I.editorContext), c = or((I) => I.selectedVisual), u = M((I) => I.selectedFrameId), m = M((I) => I.selectedSheetId), l = M((I) => I.dashboard), { setIsVisualEditing: d, updateFrame: o } = ve(), [f, h] = k(!1), [p, y] = k("both"), v = kt(), A = (n == null ? void 0 : n.type) === "documentSection", E = !!(s != null && s.visualId || c != null && c.id), N = !!(s != null && s.visualId && u), g = E && !N, {
|
|
1060
|
+
saveAsDialogOpen: S,
|
|
1061
|
+
setSaveAsDialogOpen: D,
|
|
1062
|
+
handleSaveAs: P,
|
|
1063
|
+
isLibraryVisual: b,
|
|
1064
|
+
currentVisualName: C,
|
|
1065
|
+
isSaving: F
|
|
1066
|
+
} = Ea(), { getUpdatedFrame: L } = mt();
|
|
1067
|
+
if (i)
|
|
1068
|
+
return /* @__PURE__ */ r(W, { children: [
|
|
1069
|
+
/* @__PURE__ */ e(
|
|
1070
|
+
Ke,
|
|
1071
|
+
{
|
|
1072
|
+
className: "rounded-control",
|
|
1073
|
+
variant: "default"
|
|
1074
|
+
}
|
|
1075
|
+
),
|
|
1076
|
+
/* @__PURE__ */ e(Xe, {})
|
|
1077
|
+
] });
|
|
1078
|
+
if (A)
|
|
1079
|
+
return /* @__PURE__ */ r(W, { children: [
|
|
1080
|
+
/* @__PURE__ */ e(Ke, { className: "rounded-control", variant: "default" }),
|
|
1081
|
+
/* @__PURE__ */ e(Xe, {})
|
|
1070
1082
|
] });
|
|
1071
|
-
const
|
|
1072
|
-
if (!
|
|
1083
|
+
const K = async () => {
|
|
1084
|
+
if (!m) {
|
|
1073
1085
|
z.error("No sheet selected");
|
|
1074
1086
|
return;
|
|
1075
1087
|
}
|
|
1076
|
-
if (
|
|
1077
|
-
|
|
1078
|
-
const
|
|
1079
|
-
if (
|
|
1080
|
-
|
|
1088
|
+
if (f) return;
|
|
1089
|
+
h(!0);
|
|
1090
|
+
const I = L(), pe = Tt(I);
|
|
1091
|
+
if (pe) {
|
|
1092
|
+
h(!1), z.error(pe);
|
|
1081
1093
|
return;
|
|
1082
1094
|
}
|
|
1083
|
-
const
|
|
1084
|
-
...
|
|
1095
|
+
const X = {
|
|
1096
|
+
...I,
|
|
1085
1097
|
visualId: void 0
|
|
1086
|
-
},
|
|
1098
|
+
}, Ce = Qe(l, X.id);
|
|
1087
1099
|
try {
|
|
1088
|
-
const
|
|
1089
|
-
previousFrame:
|
|
1100
|
+
const ee = await v(X, {
|
|
1101
|
+
previousFrame: Ce
|
|
1090
1102
|
});
|
|
1091
|
-
|
|
1092
|
-
semanticExecutionPayload:
|
|
1103
|
+
o(m, X, {
|
|
1104
|
+
semanticExecutionPayload: ee
|
|
1093
1105
|
});
|
|
1094
|
-
} catch (
|
|
1095
|
-
console.error("Failed to apply local semantic metadata:",
|
|
1096
|
-
|
|
1106
|
+
} catch (ee) {
|
|
1107
|
+
console.error("Failed to apply local semantic metadata:", ee), h(!1), z.error(
|
|
1108
|
+
ee instanceof Error ? ee.message : "Failed to prepare semantic metadata for this visual"
|
|
1097
1109
|
);
|
|
1098
1110
|
return;
|
|
1099
1111
|
}
|
|
1100
1112
|
setTimeout(() => {
|
|
1101
|
-
|
|
1113
|
+
h(!1), z.success("Changes applied. Visual is now local to this dashboard"), d(!1);
|
|
1102
1114
|
}, 300);
|
|
1103
|
-
},
|
|
1104
|
-
|
|
1115
|
+
}, V = (I) => {
|
|
1116
|
+
y(I), D(!0);
|
|
1105
1117
|
};
|
|
1106
|
-
return /* @__PURE__ */ r(
|
|
1118
|
+
return /* @__PURE__ */ r(W, { children: [
|
|
1107
1119
|
/* @__PURE__ */ r("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
|
|
1108
|
-
!
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
/* @__PURE__ */ r(
|
|
1112
|
-
/* @__PURE__ */ e(
|
|
1113
|
-
|
|
1120
|
+
!E && /* @__PURE__ */ e(Ke, { className: "!rounded-none", variant: "default" }),
|
|
1121
|
+
E && g && /* @__PURE__ */ e(oa, { className: "!rounded-none", variant: "default" }),
|
|
1122
|
+
E && N && /* @__PURE__ */ e(ia, { className: "!rounded-none" }),
|
|
1123
|
+
/* @__PURE__ */ r(ze, { modal: !1, children: [
|
|
1124
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1125
|
+
T,
|
|
1114
1126
|
{
|
|
1115
1127
|
variant: "default",
|
|
1116
1128
|
size: "xs",
|
|
1117
1129
|
className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
|
|
1118
1130
|
"aria-label": "Open visual save options",
|
|
1119
|
-
disabled:
|
|
1120
|
-
children: /* @__PURE__ */ e(
|
|
1131
|
+
disabled: F || f,
|
|
1132
|
+
children: /* @__PURE__ */ e(Rt, { className: "h-3.5 w-3.5" })
|
|
1121
1133
|
}
|
|
1122
1134
|
) }),
|
|
1123
1135
|
/* @__PURE__ */ r(
|
|
1124
|
-
|
|
1136
|
+
$e,
|
|
1125
1137
|
{
|
|
1126
1138
|
align: "end",
|
|
1127
1139
|
className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
|
|
1128
1140
|
children: [
|
|
1129
|
-
|
|
1141
|
+
N && /* @__PURE__ */ r(W, { children: [
|
|
1130
1142
|
/* @__PURE__ */ r(
|
|
1131
1143
|
H,
|
|
1132
1144
|
{
|
|
1133
|
-
onClick:
|
|
1134
|
-
disabled:
|
|
1145
|
+
onClick: K,
|
|
1146
|
+
disabled: f,
|
|
1135
1147
|
children: [
|
|
1136
|
-
/* @__PURE__ */ e(
|
|
1137
|
-
|
|
1148
|
+
/* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" }),
|
|
1149
|
+
f ? "Applying..." : "Apply Locally"
|
|
1138
1150
|
]
|
|
1139
1151
|
}
|
|
1140
1152
|
),
|
|
1141
|
-
/* @__PURE__ */ e(
|
|
1153
|
+
/* @__PURE__ */ e(Ue, {})
|
|
1142
1154
|
] }),
|
|
1143
1155
|
/* @__PURE__ */ r(
|
|
1144
1156
|
H,
|
|
1145
1157
|
{
|
|
1146
|
-
onClick: () =>
|
|
1147
|
-
disabled:
|
|
1158
|
+
onClick: () => V("local"),
|
|
1159
|
+
disabled: F,
|
|
1148
1160
|
children: [
|
|
1149
|
-
/* @__PURE__ */ e(
|
|
1161
|
+
/* @__PURE__ */ e(be, { className: "h-3.5 w-3.5" }),
|
|
1150
1162
|
"Add to Dashboard (Local)"
|
|
1151
1163
|
]
|
|
1152
1164
|
}
|
|
@@ -1154,8 +1166,8 @@ function Un(t = {}) {
|
|
|
1154
1166
|
/* @__PURE__ */ r(
|
|
1155
1167
|
H,
|
|
1156
1168
|
{
|
|
1157
|
-
onClick: () =>
|
|
1158
|
-
disabled:
|
|
1169
|
+
onClick: () => V("library"),
|
|
1170
|
+
disabled: F,
|
|
1159
1171
|
children: [
|
|
1160
1172
|
/* @__PURE__ */ e(la, { className: "h-3.5 w-3.5" }),
|
|
1161
1173
|
"Save as Library Visual"
|
|
@@ -1165,8 +1177,8 @@ function Un(t = {}) {
|
|
|
1165
1177
|
/* @__PURE__ */ r(
|
|
1166
1178
|
H,
|
|
1167
1179
|
{
|
|
1168
|
-
onClick: () =>
|
|
1169
|
-
disabled:
|
|
1180
|
+
onClick: () => V("both"),
|
|
1181
|
+
disabled: F,
|
|
1170
1182
|
children: [
|
|
1171
1183
|
/* @__PURE__ */ e(ca, { className: "h-3.5 w-3.5" }),
|
|
1172
1184
|
"Save Copy as Linked Visual"
|
|
@@ -1178,28 +1190,28 @@ function Un(t = {}) {
|
|
|
1178
1190
|
)
|
|
1179
1191
|
] })
|
|
1180
1192
|
] }),
|
|
1181
|
-
/* @__PURE__ */ e(
|
|
1193
|
+
/* @__PURE__ */ e(Xe, {}),
|
|
1182
1194
|
/* @__PURE__ */ e(
|
|
1183
1195
|
Aa,
|
|
1184
1196
|
{
|
|
1185
|
-
open:
|
|
1186
|
-
onOpenChange: (
|
|
1187
|
-
|
|
1197
|
+
open: S,
|
|
1198
|
+
onOpenChange: (I) => {
|
|
1199
|
+
F || D(I);
|
|
1188
1200
|
},
|
|
1189
|
-
isLibraryVisual:
|
|
1190
|
-
currentVisualName:
|
|
1191
|
-
isSaving:
|
|
1192
|
-
destinationMode:
|
|
1193
|
-
onConfirm:
|
|
1201
|
+
isLibraryVisual: b,
|
|
1202
|
+
currentVisualName: C,
|
|
1203
|
+
isSaving: F,
|
|
1204
|
+
destinationMode: p,
|
|
1205
|
+
onConfirm: P
|
|
1194
1206
|
}
|
|
1195
1207
|
)
|
|
1196
1208
|
] });
|
|
1197
1209
|
}
|
|
1198
1210
|
function Pn({ className: t }) {
|
|
1199
|
-
const a =
|
|
1211
|
+
const a = xe((d) => d.isDevMode), i = M((d) => d.isVisualEditing), { setIsDevMode: s } = Vt(), { config: n } = Ht(ir).tokenProps, c = (n == null ? void 0 : n.showAdvancedMode) !== !1;
|
|
1200
1212
|
if (!i || !c)
|
|
1201
1213
|
return null;
|
|
1202
|
-
const u = a ?
|
|
1214
|
+
const u = a ? ut : lr, m = a ? "Drag & drop" : "SQL", l = a ? "Switch to drag-and-drop mode" : "Switch to SQL mode";
|
|
1203
1215
|
return /* @__PURE__ */ r(
|
|
1204
1216
|
"button",
|
|
1205
1217
|
{
|
|
@@ -1207,7 +1219,7 @@ function Pn({ className: t }) {
|
|
|
1207
1219
|
"aria-label": l,
|
|
1208
1220
|
title: l,
|
|
1209
1221
|
onClick: () => s(!a),
|
|
1210
|
-
className:
|
|
1222
|
+
className: q(
|
|
1211
1223
|
"inline-flex h-7 items-center gap-1.5 rounded-control border border-input bg-background px-2 text-[12px] font-medium text-foreground transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:outline-none",
|
|
1212
1224
|
t
|
|
1213
1225
|
),
|
|
@@ -1230,16 +1242,16 @@ function Mn({
|
|
|
1230
1242
|
discardLabel: l = "Discard",
|
|
1231
1243
|
saveLabel: d = "Save"
|
|
1232
1244
|
}) {
|
|
1233
|
-
return /* @__PURE__ */ e(
|
|
1234
|
-
!
|
|
1235
|
-
}, children: /* @__PURE__ */ r(
|
|
1236
|
-
/* @__PURE__ */ r(
|
|
1237
|
-
/* @__PURE__ */ e(
|
|
1238
|
-
/* @__PURE__ */ e(
|
|
1245
|
+
return /* @__PURE__ */ e(Je, { open: t, onOpenChange: (f) => {
|
|
1246
|
+
!f && n || a(f);
|
|
1247
|
+
}, children: /* @__PURE__ */ r(et, { children: [
|
|
1248
|
+
/* @__PURE__ */ r(tt, { children: [
|
|
1249
|
+
/* @__PURE__ */ e(rt, { children: c }),
|
|
1250
|
+
/* @__PURE__ */ e(at, { children: u })
|
|
1239
1251
|
] }),
|
|
1240
|
-
/* @__PURE__ */ r(
|
|
1252
|
+
/* @__PURE__ */ r(nt, { children: [
|
|
1241
1253
|
/* @__PURE__ */ e(
|
|
1242
|
-
|
|
1254
|
+
T,
|
|
1243
1255
|
{
|
|
1244
1256
|
type: "button",
|
|
1245
1257
|
size: "xs",
|
|
@@ -1250,9 +1262,9 @@ function Mn({
|
|
|
1250
1262
|
children: l
|
|
1251
1263
|
}
|
|
1252
1264
|
),
|
|
1253
|
-
/* @__PURE__ */ e(
|
|
1254
|
-
/* @__PURE__ */ e(
|
|
1255
|
-
/* @__PURE__ */ e(
|
|
1265
|
+
/* @__PURE__ */ e(st, { disabled: n, children: m }),
|
|
1266
|
+
/* @__PURE__ */ e(T, { type: "button", size: "xs", onClick: i, disabled: n, children: n ? /* @__PURE__ */ r(W, { children: [
|
|
1267
|
+
/* @__PURE__ */ e(re, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
1256
1268
|
"Saving..."
|
|
1257
1269
|
] }) : d })
|
|
1258
1270
|
] })
|
|
@@ -1264,15 +1276,15 @@ function Va(t) {
|
|
|
1264
1276
|
return a < Ba ? Ia : a < Ta ? Fa : La;
|
|
1265
1277
|
}
|
|
1266
1278
|
function On() {
|
|
1267
|
-
const { authToken: t, tokenProps: a } =
|
|
1279
|
+
const { authToken: t, tokenProps: a } = je(), i = he((h) => h.activeExports), [s, n] = k(
|
|
1268
1280
|
typeof document < "u" ? !document.hidden : !0
|
|
1269
|
-
), c = me(null), u = me(!1), m = me(void 0), l = a == null ? void 0 : a.apiServiceUrl, d = t == null ? void 0 : t.accessToken, o =
|
|
1281
|
+
), c = me(null), u = me(!1), m = me(void 0), l = a == null ? void 0 : a.apiServiceUrl, d = t == null ? void 0 : t.accessToken, o = G(() => {
|
|
1270
1282
|
const h = he.getState().activeExports;
|
|
1271
1283
|
return Array.from(h.values()).filter(
|
|
1272
|
-
(p) =>
|
|
1284
|
+
(p) => ct(p.status)
|
|
1273
1285
|
);
|
|
1274
1286
|
}, []);
|
|
1275
|
-
|
|
1287
|
+
J(() => {
|
|
1276
1288
|
if (typeof document > "u") return;
|
|
1277
1289
|
const h = () => {
|
|
1278
1290
|
n(!document.hidden);
|
|
@@ -1281,7 +1293,7 @@ function On() {
|
|
|
1281
1293
|
document.removeEventListener("visibilitychange", h);
|
|
1282
1294
|
};
|
|
1283
1295
|
}, []);
|
|
1284
|
-
const
|
|
1296
|
+
const f = G(async () => {
|
|
1285
1297
|
if (!l || !d) {
|
|
1286
1298
|
u.current = !1;
|
|
1287
1299
|
return;
|
|
@@ -1292,40 +1304,40 @@ function On() {
|
|
|
1292
1304
|
return;
|
|
1293
1305
|
}
|
|
1294
1306
|
const p = Date.now(), y = h.filter(
|
|
1295
|
-
(
|
|
1307
|
+
(g) => p - g.startedAt.getTime() > vt
|
|
1296
1308
|
);
|
|
1297
1309
|
if (y.length > 0) {
|
|
1298
|
-
const { updateExport:
|
|
1310
|
+
const { updateExport: g } = he.getState().actions;
|
|
1299
1311
|
for (const S of y)
|
|
1300
|
-
|
|
1312
|
+
g(S.id, {
|
|
1301
1313
|
status: "failed",
|
|
1302
1314
|
error: "Export timed out. Please try again or contact support.",
|
|
1303
1315
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
1304
1316
|
});
|
|
1305
1317
|
}
|
|
1306
|
-
const
|
|
1307
|
-
(
|
|
1318
|
+
const v = h.filter(
|
|
1319
|
+
(g) => p - g.startedAt.getTime() <= vt
|
|
1308
1320
|
);
|
|
1309
|
-
if (
|
|
1321
|
+
if (v.length === 0) {
|
|
1310
1322
|
u.current = !1;
|
|
1311
1323
|
return;
|
|
1312
1324
|
}
|
|
1313
|
-
const
|
|
1314
|
-
|
|
1325
|
+
const A = await Promise.allSettled(
|
|
1326
|
+
v.map(async (g) => {
|
|
1315
1327
|
try {
|
|
1316
|
-
const S = await
|
|
1317
|
-
let
|
|
1328
|
+
const S = await At(l, d, g.id);
|
|
1329
|
+
let D;
|
|
1318
1330
|
if (S.status === "completed")
|
|
1319
1331
|
try {
|
|
1320
|
-
|
|
1332
|
+
D = await dt(l, d, g.id);
|
|
1321
1333
|
} catch (P) {
|
|
1322
1334
|
console.error(
|
|
1323
|
-
`[useExportPolling] Failed to get download URL for ${
|
|
1335
|
+
`[useExportPolling] Failed to get download URL for ${g.id}:`,
|
|
1324
1336
|
P
|
|
1325
1337
|
);
|
|
1326
1338
|
}
|
|
1327
1339
|
return {
|
|
1328
|
-
id:
|
|
1340
|
+
id: g.id,
|
|
1329
1341
|
status: S.status,
|
|
1330
1342
|
progress: S.progress,
|
|
1331
1343
|
completedChunks: S.completedChunks,
|
|
@@ -1333,43 +1345,43 @@ function On() {
|
|
|
1333
1345
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
1334
1346
|
fileSize: S.fileSize,
|
|
1335
1347
|
error: S.error,
|
|
1336
|
-
downloadUrl:
|
|
1348
|
+
downloadUrl: D
|
|
1337
1349
|
};
|
|
1338
1350
|
} catch (S) {
|
|
1339
1351
|
return console.error(
|
|
1340
|
-
`[useExportPolling] Failed to poll export ${
|
|
1352
|
+
`[useExportPolling] Failed to poll export ${g.id}:`,
|
|
1341
1353
|
S
|
|
1342
1354
|
), null;
|
|
1343
1355
|
}
|
|
1344
1356
|
})
|
|
1345
1357
|
), { updateExport: E } = he.getState().actions;
|
|
1346
|
-
for (const
|
|
1347
|
-
|
|
1358
|
+
for (const g of A)
|
|
1359
|
+
g.status === "fulfilled" && g.value && E(g.value.id, g.value);
|
|
1348
1360
|
const N = o();
|
|
1349
1361
|
if (N.length > 0 && !document.hidden) {
|
|
1350
|
-
const
|
|
1351
|
-
(
|
|
1362
|
+
const g = N.reduce(
|
|
1363
|
+
(D, P) => P.startedAt < D ? P.startedAt : D,
|
|
1352
1364
|
N[0].startedAt
|
|
1353
|
-
), S = Va(
|
|
1365
|
+
), S = Va(g);
|
|
1354
1366
|
c.current && clearTimeout(c.current), c.current = setTimeout(() => {
|
|
1355
|
-
var
|
|
1356
|
-
(
|
|
1367
|
+
var D;
|
|
1368
|
+
(D = m.current) == null || D.call(m);
|
|
1357
1369
|
}, S);
|
|
1358
1370
|
} else
|
|
1359
1371
|
u.current = !1;
|
|
1360
1372
|
}, [l, d, o]);
|
|
1361
|
-
return
|
|
1362
|
-
m.current =
|
|
1363
|
-
}, [
|
|
1373
|
+
return J(() => {
|
|
1374
|
+
m.current = f;
|
|
1375
|
+
}, [f]), J(() => {
|
|
1364
1376
|
var p;
|
|
1365
1377
|
o().length > 0 && s && !u.current && (u.current = !0, (p = m.current) == null || p.call(m));
|
|
1366
|
-
}, [i, s, o]),
|
|
1378
|
+
}, [i, s, o]), J(() => {
|
|
1367
1379
|
var p;
|
|
1368
1380
|
const h = o();
|
|
1369
1381
|
s && h.length > 0 && !u.current && (u.current = !0, (p = m.current) == null || p.call(m));
|
|
1370
|
-
}, [s, o]),
|
|
1382
|
+
}, [s, o]), J(() => {
|
|
1371
1383
|
!s && c.current && (clearTimeout(c.current), c.current = null, u.current = !1);
|
|
1372
|
-
}, [s]),
|
|
1384
|
+
}, [s]), J(() => () => {
|
|
1373
1385
|
c.current && (clearTimeout(c.current), c.current = null);
|
|
1374
1386
|
}, []), {
|
|
1375
1387
|
isPolling: u.current,
|
|
@@ -1378,8 +1390,8 @@ function On() {
|
|
|
1378
1390
|
};
|
|
1379
1391
|
}
|
|
1380
1392
|
function zn() {
|
|
1381
|
-
const { authToken: t, tokenProps: a } =
|
|
1382
|
-
|
|
1393
|
+
const { authToken: t, tokenProps: a } = je(), i = he((m) => m.activeExports), { addExport: s } = Et(), n = me(!1), c = a == null ? void 0 : a.apiServiceUrl, u = t == null ? void 0 : t.accessToken;
|
|
1394
|
+
J(() => {
|
|
1383
1395
|
if (n.current || !c || !u) return;
|
|
1384
1396
|
(async () => {
|
|
1385
1397
|
try {
|
|
@@ -1391,10 +1403,10 @@ function zn() {
|
|
|
1391
1403
|
for (const d of l) {
|
|
1392
1404
|
if (i.has(d.id)) continue;
|
|
1393
1405
|
const o = d.totalChunks ? Math.round(d.completedChunks / d.totalChunks * 100) : 0;
|
|
1394
|
-
let
|
|
1406
|
+
let f;
|
|
1395
1407
|
if (d.status === "completed")
|
|
1396
1408
|
try {
|
|
1397
|
-
|
|
1409
|
+
f = await dt(c, u, d.id);
|
|
1398
1410
|
} catch (p) {
|
|
1399
1411
|
console.error(
|
|
1400
1412
|
`[useExportRecovery] Failed to get download URL for ${d.id}:`,
|
|
@@ -1415,7 +1427,7 @@ function zn() {
|
|
|
1415
1427
|
fileSize: d.fileSize,
|
|
1416
1428
|
error: d.error,
|
|
1417
1429
|
expiresAt: new Date(d.expiresAt),
|
|
1418
|
-
downloadUrl:
|
|
1430
|
+
downloadUrl: f
|
|
1419
1431
|
};
|
|
1420
1432
|
s(h);
|
|
1421
1433
|
}
|
|
@@ -1427,7 +1439,7 @@ function zn() {
|
|
|
1427
1439
|
}, [c, u, s, i]);
|
|
1428
1440
|
}
|
|
1429
1441
|
function Ra(t) {
|
|
1430
|
-
return t.title ? t.title :
|
|
1442
|
+
return t.title ? t.title : ct(
|
|
1431
1443
|
t.status
|
|
1432
1444
|
) ? "Export in progress..." : t.status === "completed" ? "Export completed" : t.status === "failed" ? "Export failed" : "Export";
|
|
1433
1445
|
}
|
|
@@ -1446,9 +1458,9 @@ function Ua({
|
|
|
1446
1458
|
case "failed":
|
|
1447
1459
|
return /* @__PURE__ */ e(ga, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
1448
1460
|
default:
|
|
1449
|
-
return /* @__PURE__ */ e(
|
|
1461
|
+
return /* @__PURE__ */ e(re, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
1450
1462
|
}
|
|
1451
|
-
}, c =
|
|
1463
|
+
}, c = ct(t.status), u = (() => {
|
|
1452
1464
|
switch (t.status) {
|
|
1453
1465
|
case "pending":
|
|
1454
1466
|
return "Queued...";
|
|
@@ -1473,7 +1485,7 @@ function Ua({
|
|
|
1473
1485
|
t.totalRows.toLocaleString(),
|
|
1474
1486
|
" rows"
|
|
1475
1487
|
] }),
|
|
1476
|
-
t.fileSize && /* @__PURE__ */ r(
|
|
1488
|
+
t.fileSize && /* @__PURE__ */ r(W, { children: [
|
|
1477
1489
|
/* @__PURE__ */ e("span", { children: "•" }),
|
|
1478
1490
|
/* @__PURE__ */ e("span", { children: dr(t.fileSize) })
|
|
1479
1491
|
] })
|
|
@@ -1483,14 +1495,14 @@ function Ua({
|
|
|
1483
1495
|
] })
|
|
1484
1496
|
] }),
|
|
1485
1497
|
/* @__PURE__ */ e(
|
|
1486
|
-
|
|
1498
|
+
T,
|
|
1487
1499
|
{
|
|
1488
1500
|
variant: "ghost",
|
|
1489
1501
|
size: "icon",
|
|
1490
1502
|
className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
|
|
1491
1503
|
onClick: s,
|
|
1492
1504
|
"aria-label": "Remove notification",
|
|
1493
|
-
children: /* @__PURE__ */ e(
|
|
1505
|
+
children: /* @__PURE__ */ e(We, { className: "h-4 w-4" })
|
|
1494
1506
|
}
|
|
1495
1507
|
)
|
|
1496
1508
|
] }),
|
|
@@ -1498,7 +1510,7 @@ function Ua({
|
|
|
1498
1510
|
t.status === "completed" && /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
1499
1511
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: bt(t.startedAt, { addSuffix: !0 }) }),
|
|
1500
1512
|
t.downloadUrl && /* @__PURE__ */ r(
|
|
1501
|
-
|
|
1513
|
+
T,
|
|
1502
1514
|
{
|
|
1503
1515
|
size: "sm",
|
|
1504
1516
|
variant: "outline",
|
|
@@ -1523,43 +1535,43 @@ function Ua({
|
|
|
1523
1535
|
] });
|
|
1524
1536
|
}
|
|
1525
1537
|
function Pa() {
|
|
1526
|
-
const { authToken: t, tokenProps: a } =
|
|
1527
|
-
(
|
|
1528
|
-
),
|
|
1529
|
-
(
|
|
1530
|
-
), h =
|
|
1531
|
-
const
|
|
1532
|
-
if (!(!
|
|
1538
|
+
const { authToken: t, tokenProps: a } = je(), i = he((v) => v.activeExports), { clearCompleted: s, removeExport: n, updateExport: c } = Et(), [u, m] = k(!1), [l, d] = k(!1), o = Array.from(i.values()).sort(
|
|
1539
|
+
(v, A) => A.startedAt.getTime() - v.startedAt.getTime()
|
|
1540
|
+
), f = o.some(
|
|
1541
|
+
(v) => v.status === "completed" || v.status === "failed"
|
|
1542
|
+
), h = G(async () => {
|
|
1543
|
+
const v = a == null ? void 0 : a.apiServiceUrl, A = t == null ? void 0 : t.accessToken;
|
|
1544
|
+
if (!(!v || !A)) {
|
|
1533
1545
|
m(!0);
|
|
1534
1546
|
try {
|
|
1535
1547
|
const E = Array.from(i.values());
|
|
1536
1548
|
await Promise.all(
|
|
1537
1549
|
E.map(async (N) => {
|
|
1538
1550
|
try {
|
|
1539
|
-
const
|
|
1551
|
+
const g = await At(v, A, N.id);
|
|
1540
1552
|
let S;
|
|
1541
|
-
if (
|
|
1553
|
+
if (g.status === "completed")
|
|
1542
1554
|
try {
|
|
1543
|
-
S = await
|
|
1544
|
-
|
|
1545
|
-
|
|
1555
|
+
S = await dt(
|
|
1556
|
+
v,
|
|
1557
|
+
A,
|
|
1546
1558
|
N.id
|
|
1547
1559
|
);
|
|
1548
|
-
} catch (
|
|
1549
|
-
console.error(`Failed to get download URL for ${N.id}:`,
|
|
1560
|
+
} catch (D) {
|
|
1561
|
+
console.error(`Failed to get download URL for ${N.id}:`, D);
|
|
1550
1562
|
}
|
|
1551
1563
|
c(N.id, {
|
|
1552
|
-
status:
|
|
1553
|
-
progress:
|
|
1554
|
-
completedChunks:
|
|
1555
|
-
completedAt:
|
|
1564
|
+
status: g.status,
|
|
1565
|
+
progress: g.progress,
|
|
1566
|
+
completedChunks: g.completedChunks,
|
|
1567
|
+
completedAt: g.completedAt ? new Date(g.completedAt) : void 0,
|
|
1556
1568
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
1557
|
-
fileSize:
|
|
1558
|
-
error:
|
|
1569
|
+
fileSize: g.fileSize,
|
|
1570
|
+
error: g.error,
|
|
1559
1571
|
downloadUrl: S
|
|
1560
1572
|
});
|
|
1561
|
-
} catch (
|
|
1562
|
-
console.error(`Failed to refresh export ${N.id}:`,
|
|
1573
|
+
} catch (g) {
|
|
1574
|
+
console.error(`Failed to refresh export ${N.id}:`, g);
|
|
1563
1575
|
}
|
|
1564
1576
|
})
|
|
1565
1577
|
);
|
|
@@ -1572,21 +1584,21 @@ function Pa() {
|
|
|
1572
1584
|
t == null ? void 0 : t.accessToken,
|
|
1573
1585
|
a == null ? void 0 : a.apiServiceUrl,
|
|
1574
1586
|
c
|
|
1575
|
-
]), p =
|
|
1576
|
-
const
|
|
1577
|
-
if (!
|
|
1587
|
+
]), p = G(async () => {
|
|
1588
|
+
const v = a == null ? void 0 : a.apiServiceUrl, A = t == null ? void 0 : t.accessToken;
|
|
1589
|
+
if (!v || !A) {
|
|
1578
1590
|
s();
|
|
1579
1591
|
return;
|
|
1580
1592
|
}
|
|
1581
1593
|
d(!0);
|
|
1582
1594
|
try {
|
|
1583
1595
|
const E = o.filter(
|
|
1584
|
-
(
|
|
1596
|
+
(g) => g.status === "completed" || g.status === "failed"
|
|
1585
1597
|
), N = await Promise.allSettled(
|
|
1586
|
-
E.map(async (
|
|
1598
|
+
E.map(async (g) => (await ft(v, A, g.id), g.id))
|
|
1587
1599
|
);
|
|
1588
|
-
for (const
|
|
1589
|
-
|
|
1600
|
+
for (const g of N)
|
|
1601
|
+
g.status === "fulfilled" ? n(g.value) : console.error("Failed to delete export:", g.reason);
|
|
1590
1602
|
} finally {
|
|
1591
1603
|
d(!1);
|
|
1592
1604
|
}
|
|
@@ -1596,17 +1608,17 @@ function Pa() {
|
|
|
1596
1608
|
t == null ? void 0 : t.accessToken,
|
|
1597
1609
|
s,
|
|
1598
1610
|
n
|
|
1599
|
-
]), y =
|
|
1600
|
-
async (
|
|
1601
|
-
const
|
|
1602
|
-
if (
|
|
1611
|
+
]), y = G(
|
|
1612
|
+
async (v) => {
|
|
1613
|
+
const A = a == null ? void 0 : a.apiServiceUrl, E = t == null ? void 0 : t.accessToken;
|
|
1614
|
+
if (A && E)
|
|
1603
1615
|
try {
|
|
1604
|
-
await
|
|
1616
|
+
await ft(A, E, v), n(v);
|
|
1605
1617
|
return;
|
|
1606
1618
|
} catch (N) {
|
|
1607
|
-
console.error(`Failed to cancel export ${
|
|
1619
|
+
console.error(`Failed to cancel export ${v}:`, N);
|
|
1608
1620
|
}
|
|
1609
|
-
n(
|
|
1621
|
+
n(v);
|
|
1610
1622
|
},
|
|
1611
1623
|
[a == null ? void 0 : a.apiServiceUrl, t == null ? void 0 : t.accessToken, n]
|
|
1612
1624
|
);
|
|
@@ -1622,7 +1634,7 @@ function Pa() {
|
|
|
1622
1634
|
] }),
|
|
1623
1635
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
|
|
1624
1636
|
/* @__PURE__ */ e(
|
|
1625
|
-
|
|
1637
|
+
T,
|
|
1626
1638
|
{
|
|
1627
1639
|
variant: "ghost",
|
|
1628
1640
|
size: "sm",
|
|
@@ -1638,8 +1650,8 @@ function Pa() {
|
|
|
1638
1650
|
)
|
|
1639
1651
|
}
|
|
1640
1652
|
),
|
|
1641
|
-
|
|
1642
|
-
|
|
1653
|
+
f && /* @__PURE__ */ e(
|
|
1654
|
+
T,
|
|
1643
1655
|
{
|
|
1644
1656
|
variant: "ghost",
|
|
1645
1657
|
size: "sm",
|
|
@@ -1651,13 +1663,13 @@ function Pa() {
|
|
|
1651
1663
|
)
|
|
1652
1664
|
] })
|
|
1653
1665
|
] }),
|
|
1654
|
-
/* @__PURE__ */ e("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y", children: o.map((
|
|
1666
|
+
/* @__PURE__ */ e("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y", children: o.map((v) => /* @__PURE__ */ e(
|
|
1655
1667
|
Ua,
|
|
1656
1668
|
{
|
|
1657
|
-
export:
|
|
1669
|
+
export: v,
|
|
1658
1670
|
onRemove: y
|
|
1659
1671
|
},
|
|
1660
|
-
|
|
1672
|
+
v.id
|
|
1661
1673
|
)) }) })
|
|
1662
1674
|
] });
|
|
1663
1675
|
}
|
|
@@ -1667,9 +1679,9 @@ function _n({
|
|
|
1667
1679
|
const a = he((l) => l.activeExports), i = fr(), s = a.size > 0, n = Array.from(a.values()).some(
|
|
1668
1680
|
(l) => l.status === "completed" || l.status === "failed"
|
|
1669
1681
|
), u = i > 0 ? i > 9 ? "9+" : String(i) : null;
|
|
1670
|
-
return /* @__PURE__ */ r(
|
|
1671
|
-
/* @__PURE__ */ e(
|
|
1672
|
-
|
|
1682
|
+
return /* @__PURE__ */ r(Pe, { children: [
|
|
1683
|
+
/* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ r(
|
|
1684
|
+
T,
|
|
1673
1685
|
{
|
|
1674
1686
|
variant: t ?? "ghost",
|
|
1675
1687
|
size: "xs",
|
|
@@ -1687,7 +1699,7 @@ function _n({
|
|
|
1687
1699
|
]
|
|
1688
1700
|
}
|
|
1689
1701
|
) }),
|
|
1690
|
-
/* @__PURE__ */ e(
|
|
1702
|
+
/* @__PURE__ */ e(Oe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ e(Pa, {}) })
|
|
1691
1703
|
] });
|
|
1692
1704
|
}
|
|
1693
1705
|
function Ma(t) {
|
|
@@ -1712,8 +1724,8 @@ function Oa({
|
|
|
1712
1724
|
isCreateFlowActive: l,
|
|
1713
1725
|
preventPassiveDismissDuringCreate: d,
|
|
1714
1726
|
resolvedOpen: o,
|
|
1715
|
-
setIsCreateFlowActive:
|
|
1716
|
-
} =
|
|
1727
|
+
setIsCreateFlowActive: f
|
|
1728
|
+
} = Ut({
|
|
1717
1729
|
open: t,
|
|
1718
1730
|
onOpenChange: a,
|
|
1719
1731
|
initialCreateFlowActive: n === "create",
|
|
@@ -1724,31 +1736,31 @@ function Oa({
|
|
|
1724
1736
|
// create and make consumers use `forceClose()` from a dedicated
|
|
1725
1737
|
// button.
|
|
1726
1738
|
dismissMode: s ? "passive" : "explicit-only"
|
|
1727
|
-
}), h = M((C) => C.dashboard), { setDashboardControlsModel: p } =
|
|
1739
|
+
}), h = M((C) => C.dashboard), { setDashboardControlsModel: p } = ve(), { participants: y } = br(Jr(h)), v = Array.from(
|
|
1728
1740
|
new Map(
|
|
1729
1741
|
y.flatMap(
|
|
1730
|
-
(C) => C.fieldChoices.map((
|
|
1731
|
-
var
|
|
1742
|
+
(C) => C.fieldChoices.map((F) => {
|
|
1743
|
+
var L;
|
|
1732
1744
|
return [
|
|
1733
|
-
|
|
1745
|
+
F.value,
|
|
1734
1746
|
{
|
|
1735
|
-
option:
|
|
1736
|
-
target: (
|
|
1747
|
+
option: F,
|
|
1748
|
+
target: (L = C.fieldTargetMap) == null ? void 0 : L[F.value]
|
|
1737
1749
|
}
|
|
1738
1750
|
];
|
|
1739
1751
|
})
|
|
1740
1752
|
)
|
|
1741
1753
|
).values()
|
|
1742
|
-
),
|
|
1754
|
+
), A = Array.from(
|
|
1743
1755
|
new Map(
|
|
1744
1756
|
y.flatMap(
|
|
1745
|
-
(C) => C.metricChoices.map((
|
|
1746
|
-
var
|
|
1757
|
+
(C) => C.metricChoices.map((F) => {
|
|
1758
|
+
var L;
|
|
1747
1759
|
return [
|
|
1748
|
-
|
|
1760
|
+
F.value,
|
|
1749
1761
|
{
|
|
1750
|
-
option:
|
|
1751
|
-
target: (
|
|
1762
|
+
option: F,
|
|
1763
|
+
target: (L = C.metricTargetMap) == null ? void 0 : L[F.value]
|
|
1752
1764
|
}
|
|
1753
1765
|
];
|
|
1754
1766
|
})
|
|
@@ -1757,73 +1769,73 @@ function Oa({
|
|
|
1757
1769
|
), E = ea({
|
|
1758
1770
|
...h || {},
|
|
1759
1771
|
controls: []
|
|
1760
|
-
}), N = xr(h),
|
|
1772
|
+
}), N = xr(h), g = (C, F, L) => {
|
|
1761
1773
|
p(
|
|
1762
1774
|
C,
|
|
1763
|
-
|
|
1764
|
-
Ma(
|
|
1775
|
+
F,
|
|
1776
|
+
Ma(L)
|
|
1765
1777
|
);
|
|
1766
|
-
}, S =
|
|
1778
|
+
}, S = G(() => {
|
|
1767
1779
|
if (c) {
|
|
1768
1780
|
u();
|
|
1769
1781
|
return;
|
|
1770
1782
|
}
|
|
1771
|
-
|
|
1772
|
-
}, [c, u,
|
|
1773
|
-
|
|
1783
|
+
f(!1);
|
|
1784
|
+
}, [c, u, f]), D = /* @__PURE__ */ e(
|
|
1785
|
+
Pt,
|
|
1774
1786
|
{
|
|
1775
1787
|
scope: "dashboard",
|
|
1776
1788
|
controls: h.controls || [],
|
|
1777
1789
|
reservedControlIds: E,
|
|
1778
1790
|
defaultValues: h.defaultControlValues || {},
|
|
1779
1791
|
usageByControlId: vr(h),
|
|
1780
|
-
availableFieldChoices:
|
|
1781
|
-
availableMetricChoices:
|
|
1792
|
+
availableFieldChoices: v,
|
|
1793
|
+
availableMetricChoices: A,
|
|
1782
1794
|
structuralParticipants: y,
|
|
1783
1795
|
structuralParticipantIdsByControlId: N,
|
|
1784
1796
|
initialCreateFlow: n === "create",
|
|
1785
|
-
onCreateFlowActiveChange:
|
|
1797
|
+
onCreateFlowActiveChange: f,
|
|
1786
1798
|
onCreateFlowComplete: S,
|
|
1787
|
-
onChange:
|
|
1799
|
+
onChange: g,
|
|
1788
1800
|
emptyMessage: "No dashboard controls yet."
|
|
1789
1801
|
}
|
|
1790
|
-
), P = l ? "Add dashboard control" : "Dashboard Controls",
|
|
1802
|
+
), P = l ? "Add dashboard control" : "Dashboard Controls", b = /* @__PURE__ */ r(W, { children: [
|
|
1791
1803
|
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
1792
1804
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
1793
1805
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
|
|
1794
1806
|
] }),
|
|
1795
|
-
|
|
1807
|
+
D
|
|
1796
1808
|
] });
|
|
1797
|
-
return s ? /* @__PURE__ */ r(
|
|
1798
|
-
/* @__PURE__ */ e(
|
|
1799
|
-
/* @__PURE__ */ e(
|
|
1809
|
+
return s ? /* @__PURE__ */ r(Pe, { open: o, onOpenChange: m, children: [
|
|
1810
|
+
/* @__PURE__ */ e(Me, { asChild: !0, children: i || /* @__PURE__ */ r(T, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
1811
|
+
/* @__PURE__ */ e(ut, { className: "mr-2 h-4 w-4" }),
|
|
1800
1812
|
"Controls"
|
|
1801
1813
|
] }) }),
|
|
1802
1814
|
/* @__PURE__ */ e(
|
|
1803
|
-
|
|
1815
|
+
Oe,
|
|
1804
1816
|
{
|
|
1805
1817
|
className: "w-[620px] max-w-[95vw] space-y-4",
|
|
1806
1818
|
align: "end",
|
|
1807
1819
|
onEscapeKeyDown: d,
|
|
1808
1820
|
onPointerDownOutside: d,
|
|
1809
|
-
children:
|
|
1821
|
+
children: b
|
|
1810
1822
|
}
|
|
1811
1823
|
)
|
|
1812
|
-
] }) : /* @__PURE__ */ e(
|
|
1813
|
-
|
|
1824
|
+
] }) : /* @__PURE__ */ e(ke, { open: o, onOpenChange: m, children: /* @__PURE__ */ r(
|
|
1825
|
+
Ae,
|
|
1814
1826
|
{
|
|
1815
1827
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
1816
1828
|
onEscapeKeyDown: d,
|
|
1817
1829
|
onPointerDownOutside: d,
|
|
1818
1830
|
children: [
|
|
1819
1831
|
/* @__PURE__ */ r(
|
|
1820
|
-
|
|
1832
|
+
it,
|
|
1821
1833
|
{
|
|
1822
1834
|
className: l ? "space-y-0" : void 0,
|
|
1823
1835
|
children: [
|
|
1824
|
-
/* @__PURE__ */ e(
|
|
1836
|
+
/* @__PURE__ */ e(Ee, { className: "text-[15px]", children: P }),
|
|
1825
1837
|
/* @__PURE__ */ e(
|
|
1826
|
-
|
|
1838
|
+
lt,
|
|
1827
1839
|
{
|
|
1828
1840
|
className: l ? "sr-only" : "text-[13px]",
|
|
1829
1841
|
children: l ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
|
|
@@ -1832,7 +1844,7 @@ function Oa({
|
|
|
1832
1844
|
]
|
|
1833
1845
|
}
|
|
1834
1846
|
),
|
|
1835
|
-
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children:
|
|
1847
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: D })
|
|
1836
1848
|
]
|
|
1837
1849
|
}
|
|
1838
1850
|
) });
|
|
@@ -1850,7 +1862,7 @@ function _a({
|
|
|
1850
1862
|
onOpenChange: a,
|
|
1851
1863
|
initialMode: i = "manage"
|
|
1852
1864
|
}) {
|
|
1853
|
-
var
|
|
1865
|
+
var b;
|
|
1854
1866
|
const s = i === "create", {
|
|
1855
1867
|
forceClose: n,
|
|
1856
1868
|
handleOpenChange: c,
|
|
@@ -1858,68 +1870,68 @@ function _a({
|
|
|
1858
1870
|
preventPassiveDismissDuringCreate: m,
|
|
1859
1871
|
resolvedOpen: l,
|
|
1860
1872
|
setIsCreateFlowActive: d
|
|
1861
|
-
} =
|
|
1873
|
+
} = Ut({
|
|
1862
1874
|
open: t,
|
|
1863
1875
|
onOpenChange: a,
|
|
1864
1876
|
initialCreateFlowActive: i === "create",
|
|
1865
1877
|
dismissMode: "explicit-only"
|
|
1866
|
-
}), o = M((C) => C.dashboard),
|
|
1867
|
-
(C) => C.id ===
|
|
1868
|
-
), y = (p == null ? void 0 : p.kind) === "document" && !!p.document,
|
|
1878
|
+
}), o = M((C) => C.dashboard), f = M((C) => C.selectedSheetId), { setDashboardInputs: h } = ve(), p = (b = o.sheets) == null ? void 0 : b.find(
|
|
1879
|
+
(C) => C.id === f
|
|
1880
|
+
), y = (p == null ? void 0 : p.kind) === "document" && !!p.document, v = te(
|
|
1869
1881
|
() => y && (p != null && p.document) ? yr(o, p.id) : [],
|
|
1870
1882
|
[o, y, p == null ? void 0 : p.document, p == null ? void 0 : p.id]
|
|
1871
|
-
),
|
|
1872
|
-
() =>
|
|
1883
|
+
), A = te(
|
|
1884
|
+
() => v.filter(
|
|
1873
1885
|
(C) => C.kind === "control"
|
|
1874
1886
|
),
|
|
1875
|
-
[
|
|
1876
|
-
), E =
|
|
1877
|
-
() =>
|
|
1878
|
-
[
|
|
1879
|
-
), N =
|
|
1887
|
+
[v]
|
|
1888
|
+
), E = te(
|
|
1889
|
+
() => A.map((C) => C.control),
|
|
1890
|
+
[A]
|
|
1891
|
+
), N = te(
|
|
1880
1892
|
() => ja(E),
|
|
1881
1893
|
[E]
|
|
1882
|
-
),
|
|
1894
|
+
), g = te(
|
|
1883
1895
|
() => $a(o),
|
|
1884
1896
|
[o]
|
|
1885
|
-
), S =
|
|
1897
|
+
), S = G(() => {
|
|
1886
1898
|
if (s) {
|
|
1887
1899
|
n();
|
|
1888
1900
|
return;
|
|
1889
1901
|
}
|
|
1890
1902
|
d(!1);
|
|
1891
|
-
}, [s, n, d]),
|
|
1892
|
-
(C,
|
|
1903
|
+
}, [s, n, d]), D = G(
|
|
1904
|
+
(C, F, L) => {
|
|
1893
1905
|
!y || !(p != null && p.document) || h(
|
|
1894
1906
|
Ha({
|
|
1895
1907
|
allInputs: o.inputs || [],
|
|
1896
1908
|
documentSheetId: p.id,
|
|
1897
|
-
currentDocumentInputs:
|
|
1909
|
+
currentDocumentInputs: v,
|
|
1898
1910
|
nextControls: C,
|
|
1899
|
-
nextDefaultValues:
|
|
1900
|
-
change:
|
|
1911
|
+
nextDefaultValues: F,
|
|
1912
|
+
change: L
|
|
1901
1913
|
})
|
|
1902
1914
|
);
|
|
1903
1915
|
},
|
|
1904
1916
|
[
|
|
1905
1917
|
o.inputs,
|
|
1906
|
-
|
|
1918
|
+
v,
|
|
1907
1919
|
y,
|
|
1908
1920
|
p,
|
|
1909
1921
|
h
|
|
1910
1922
|
]
|
|
1911
1923
|
);
|
|
1912
|
-
return !y || !(p != null && p.document) ? null : /* @__PURE__ */ e(
|
|
1913
|
-
|
|
1924
|
+
return !y || !(p != null && p.document) ? null : /* @__PURE__ */ e(ke, { open: l, onOpenChange: c, children: /* @__PURE__ */ r(
|
|
1925
|
+
Ae,
|
|
1914
1926
|
{
|
|
1915
1927
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
1916
1928
|
onEscapeKeyDown: m,
|
|
1917
1929
|
onPointerDownOutside: m,
|
|
1918
1930
|
children: [
|
|
1919
|
-
/* @__PURE__ */ r(
|
|
1920
|
-
/* @__PURE__ */ e(
|
|
1931
|
+
/* @__PURE__ */ r(it, { className: u ? "space-y-0" : void 0, children: [
|
|
1932
|
+
/* @__PURE__ */ e(Ee, { className: "text-[15px]", children: u ? "Add document control" : "Document Controls" }),
|
|
1921
1933
|
/* @__PURE__ */ e(
|
|
1922
|
-
|
|
1934
|
+
lt,
|
|
1923
1935
|
{
|
|
1924
1936
|
className: u ? "sr-only" : "text-[13px]",
|
|
1925
1937
|
children: u ? "Configure and add a document-local control input." : "Add document-local control inputs. They are stored on this document sheet and are not dashboard controls."
|
|
@@ -1927,11 +1939,11 @@ function _a({
|
|
|
1927
1939
|
)
|
|
1928
1940
|
] }),
|
|
1929
1941
|
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ e(
|
|
1930
|
-
|
|
1942
|
+
Pt,
|
|
1931
1943
|
{
|
|
1932
1944
|
scope: "dashboard",
|
|
1933
1945
|
controls: E,
|
|
1934
|
-
reservedControlIds:
|
|
1946
|
+
reservedControlIds: g,
|
|
1935
1947
|
defaultValues: N,
|
|
1936
1948
|
usageByControlId: {},
|
|
1937
1949
|
availableFieldChoices: [],
|
|
@@ -1942,7 +1954,7 @@ function _a({
|
|
|
1942
1954
|
initialCreateFlow: i === "create",
|
|
1943
1955
|
onCreateFlowActiveChange: d,
|
|
1944
1956
|
onCreateFlowComplete: S,
|
|
1945
|
-
onChange:
|
|
1957
|
+
onChange: D,
|
|
1946
1958
|
emptyMessage: "No document controls yet."
|
|
1947
1959
|
}
|
|
1948
1960
|
) })
|
|
@@ -1991,15 +2003,15 @@ function Ha({
|
|
|
1991
2003
|
const y = Cr(
|
|
1992
2004
|
p.id,
|
|
1993
2005
|
[...t, ...d].filter(
|
|
1994
|
-
(
|
|
2006
|
+
(A) => A.id !== h.id
|
|
1995
2007
|
)
|
|
1996
|
-
),
|
|
2008
|
+
), v = p.id === y ? p : { ...p, id: y };
|
|
1997
2009
|
d.push({
|
|
1998
2010
|
...h,
|
|
1999
|
-
label:
|
|
2011
|
+
label: v.label,
|
|
2000
2012
|
variableName: y,
|
|
2001
|
-
requiredAtExecution:
|
|
2002
|
-
control:
|
|
2013
|
+
requiredAtExecution: v.requiredAtExecution,
|
|
2014
|
+
control: v
|
|
2003
2015
|
});
|
|
2004
2016
|
}
|
|
2005
2017
|
for (const h of u.values())
|
|
@@ -2029,11 +2041,11 @@ function Ga({
|
|
|
2029
2041
|
pickerContentClassName: l,
|
|
2030
2042
|
settingsContentClassName: d
|
|
2031
2043
|
}) {
|
|
2032
|
-
const o = n === "toolbar", [
|
|
2044
|
+
const o = n === "toolbar", [f, h] = k(!1), p = Nr("interactive");
|
|
2033
2045
|
return /* @__PURE__ */ r(
|
|
2034
2046
|
"div",
|
|
2035
2047
|
{
|
|
2036
|
-
className:
|
|
2048
|
+
className: q(
|
|
2037
2049
|
// Height lives on the shell so the outer border is part of the
|
|
2038
2050
|
// h-7 box (matches regular `size="xs"` buttons). Inner triggers
|
|
2039
2051
|
// stretch to fill via `h-full`.
|
|
@@ -2042,28 +2054,28 @@ function Ga({
|
|
|
2042
2054
|
c
|
|
2043
2055
|
),
|
|
2044
2056
|
children: [
|
|
2045
|
-
/* @__PURE__ */ r(
|
|
2046
|
-
/* @__PURE__ */ e(
|
|
2047
|
-
|
|
2057
|
+
/* @__PURE__ */ r(Pe, { open: t, onOpenChange: a, children: [
|
|
2058
|
+
/* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2059
|
+
T,
|
|
2048
2060
|
{
|
|
2049
2061
|
variant: "ghost",
|
|
2050
2062
|
size: "xs",
|
|
2051
|
-
className:
|
|
2063
|
+
className: q(
|
|
2052
2064
|
"h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
|
|
2053
2065
|
u
|
|
2054
2066
|
),
|
|
2055
2067
|
children: [
|
|
2056
|
-
t ? /* @__PURE__ */ e(ba, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(
|
|
2068
|
+
t ? /* @__PURE__ */ e(ba, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(It, { className: "h-3.5 w-3.5" }),
|
|
2057
2069
|
"Filter"
|
|
2058
2070
|
]
|
|
2059
2071
|
}
|
|
2060
2072
|
) }),
|
|
2061
2073
|
/* @__PURE__ */ e(
|
|
2062
|
-
|
|
2074
|
+
Oe,
|
|
2063
2075
|
{
|
|
2064
2076
|
align: "end",
|
|
2065
2077
|
sideOffset: 6,
|
|
2066
|
-
className:
|
|
2078
|
+
className: q(
|
|
2067
2079
|
"w-auto rounded-card border border-border/60 p-0 shadow-sm",
|
|
2068
2080
|
l
|
|
2069
2081
|
),
|
|
@@ -2072,26 +2084,26 @@ function Ga({
|
|
|
2072
2084
|
}
|
|
2073
2085
|
)
|
|
2074
2086
|
] }),
|
|
2075
|
-
/* @__PURE__ */ r(
|
|
2076
|
-
/* @__PURE__ */ e(
|
|
2077
|
-
|
|
2087
|
+
/* @__PURE__ */ r(Pe, { open: f, onOpenChange: h, children: [
|
|
2088
|
+
/* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2089
|
+
T,
|
|
2078
2090
|
{
|
|
2079
2091
|
variant: "ghost",
|
|
2080
2092
|
size: "xs",
|
|
2081
|
-
className:
|
|
2093
|
+
className: q(
|
|
2082
2094
|
"h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
|
|
2083
2095
|
m
|
|
2084
2096
|
),
|
|
2085
2097
|
"aria-label": "Filter and control actions",
|
|
2086
|
-
children: /* @__PURE__ */ e(
|
|
2098
|
+
children: /* @__PURE__ */ e(Rt, { className: "h-3.5 w-3.5" })
|
|
2087
2099
|
}
|
|
2088
2100
|
) }),
|
|
2089
2101
|
/* @__PURE__ */ e(
|
|
2090
|
-
|
|
2102
|
+
Oe,
|
|
2091
2103
|
{
|
|
2092
2104
|
align: "end",
|
|
2093
2105
|
sideOffset: 6,
|
|
2094
|
-
className:
|
|
2106
|
+
className: q(
|
|
2095
2107
|
"w-auto rounded-card border border-border/60 p-0 shadow-sm",
|
|
2096
2108
|
d
|
|
2097
2109
|
),
|
|
@@ -2106,17 +2118,17 @@ function Ga({
|
|
|
2106
2118
|
}
|
|
2107
2119
|
function qa() {
|
|
2108
2120
|
da();
|
|
2109
|
-
const t = M((l) => l.selectedSheetId), a = M((l) => l.selectedFrameId), i = M((l) => l.dashboard), s = M((l) => l.actions.getSelectedFrame), { setSelectedFrameId: n } =
|
|
2110
|
-
return
|
|
2121
|
+
const t = M((l) => l.selectedSheetId), a = M((l) => l.selectedFrameId), i = M((l) => l.dashboard), s = M((l) => l.actions.getSelectedFrame), { setSelectedFrameId: n } = ve(), { setCard: c } = Vt(), u = xe((l) => l.card.dataSource);
|
|
2122
|
+
return J(() => {
|
|
2111
2123
|
var d, o;
|
|
2112
2124
|
let l = s();
|
|
2113
2125
|
if (!l) {
|
|
2114
|
-
const
|
|
2126
|
+
const f = (d = i == null ? void 0 : i.sheets) == null ? void 0 : d.find((p) => p.id === t), h = (o = f == null ? void 0 : f.frames) == null ? void 0 : o[0];
|
|
2115
2127
|
h && (n(h.id), l = h);
|
|
2116
2128
|
}
|
|
2117
2129
|
if (l) {
|
|
2118
|
-
const
|
|
2119
|
-
|
|
2130
|
+
const f = l.cards.find((h) => h.id === l.activeCardId);
|
|
2131
|
+
f && c(f);
|
|
2120
2132
|
}
|
|
2121
2133
|
}, [s, t, a, i, n, c]), {
|
|
2122
2134
|
hasEntities: !!(u != null && u.selectedEntities && u.selectedEntities.length > 0)
|
|
@@ -2125,7 +2137,7 @@ function qa() {
|
|
|
2125
2137
|
function Ka() {
|
|
2126
2138
|
const t = M((l) => l.dashboard), a = M(
|
|
2127
2139
|
(l) => l.semanticExecutionPayload
|
|
2128
|
-
), i = M((l) => l.actions.addFilter), { hasEntities: s } = qa(), { isLoading: n } = Sr(), c =
|
|
2140
|
+
), i = M((l) => l.actions.addFilter), { hasEntities: s } = qa(), { isLoading: n } = Sr(), c = te(
|
|
2129
2141
|
() => ta(t, a),
|
|
2130
2142
|
[t, a]
|
|
2131
2143
|
), m = !ra(t.filters) && c.hasEligibleCards && !n;
|
|
@@ -2163,15 +2175,15 @@ function Xa({
|
|
|
2163
2175
|
}) {
|
|
2164
2176
|
const n = M(
|
|
2165
2177
|
(m) => m.dashboard.filterLayout
|
|
2166
|
-
), { setFilterLayout: c } =
|
|
2178
|
+
), { setFilterLayout: c } = ve();
|
|
2167
2179
|
n != null && n.displayMode;
|
|
2168
2180
|
const u = (n == null ? void 0 : n.toolbarWrap) ?? !1;
|
|
2169
2181
|
return n == null || n.showDownloadButton, /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
|
|
2170
2182
|
/* @__PURE__ */ r("div", { className: "p-1", children: [
|
|
2171
2183
|
/* @__PURE__ */ e(
|
|
2172
|
-
|
|
2184
|
+
Ye,
|
|
2173
2185
|
{
|
|
2174
|
-
icon:
|
|
2186
|
+
icon: It,
|
|
2175
2187
|
label: "Add filter",
|
|
2176
2188
|
onClick: () => {
|
|
2177
2189
|
t(), s();
|
|
@@ -2179,9 +2191,9 @@ function Xa({
|
|
|
2179
2191
|
}
|
|
2180
2192
|
),
|
|
2181
2193
|
/* @__PURE__ */ e(
|
|
2182
|
-
|
|
2194
|
+
Ye,
|
|
2183
2195
|
{
|
|
2184
|
-
icon:
|
|
2196
|
+
icon: ut,
|
|
2185
2197
|
label: "Add control",
|
|
2186
2198
|
onClick: () => {
|
|
2187
2199
|
a(), s();
|
|
@@ -2189,9 +2201,9 @@ function Xa({
|
|
|
2189
2201
|
}
|
|
2190
2202
|
),
|
|
2191
2203
|
/* @__PURE__ */ e(
|
|
2192
|
-
|
|
2204
|
+
Ye,
|
|
2193
2205
|
{
|
|
2194
|
-
icon:
|
|
2206
|
+
icon: Ft,
|
|
2195
2207
|
label: "Manage controls",
|
|
2196
2208
|
onClick: () => {
|
|
2197
2209
|
i(), s();
|
|
@@ -2216,7 +2228,7 @@ function Xa({
|
|
|
2216
2228
|
] })
|
|
2217
2229
|
] });
|
|
2218
2230
|
}
|
|
2219
|
-
function
|
|
2231
|
+
function Ye({
|
|
2220
2232
|
icon: t,
|
|
2221
2233
|
label: a,
|
|
2222
2234
|
onClick: i
|
|
@@ -2241,9 +2253,9 @@ function Ya({
|
|
|
2241
2253
|
onCheckedChange: s
|
|
2242
2254
|
}) {
|
|
2243
2255
|
return /* @__PURE__ */ r("div", { className: "flex items-center gap-2 rounded-[4px] px-1 py-1 transition-colors hover:bg-muted/40", children: [
|
|
2244
|
-
/* @__PURE__ */ e(
|
|
2256
|
+
/* @__PURE__ */ e(ot, { id: t, checked: i, onCheckedChange: s }),
|
|
2245
2257
|
/* @__PURE__ */ e(
|
|
2246
|
-
|
|
2258
|
+
De,
|
|
2247
2259
|
{
|
|
2248
2260
|
htmlFor: t,
|
|
2249
2261
|
className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
|
|
@@ -2261,48 +2273,48 @@ function $n({
|
|
|
2261
2273
|
settingsContentClassName: c
|
|
2262
2274
|
}) {
|
|
2263
2275
|
var P;
|
|
2264
|
-
const [u, m] =
|
|
2265
|
-
(
|
|
2266
|
-
),
|
|
2276
|
+
const [u, m] = k(null), l = M((b) => b.dashboard), d = M((b) => b.selectedSheetId), o = M((b) => b.showFilters), f = Ar((b) => b.setPanelOpen), h = M((b) => b.actions), { setDocumentInspectorTab: p, setShowFilters: y } = h, v = (P = l.sheets) == null ? void 0 : P.find(
|
|
2277
|
+
(b) => b.id === d
|
|
2278
|
+
), A = na(v), E = G((b) => {
|
|
2267
2279
|
window.setTimeout(() => {
|
|
2268
|
-
m(
|
|
2280
|
+
m(b);
|
|
2269
2281
|
}, 0);
|
|
2270
|
-
}, []), N =
|
|
2271
|
-
(
|
|
2272
|
-
if (
|
|
2273
|
-
|
|
2282
|
+
}, []), N = G(
|
|
2283
|
+
(b) => {
|
|
2284
|
+
if (A && d) {
|
|
2285
|
+
b && p(d, "inputs");
|
|
2274
2286
|
return;
|
|
2275
2287
|
}
|
|
2276
|
-
|
|
2288
|
+
b && f("dashboard", !1), y(b);
|
|
2277
2289
|
},
|
|
2278
2290
|
[
|
|
2279
|
-
|
|
2291
|
+
A,
|
|
2280
2292
|
d,
|
|
2281
2293
|
p,
|
|
2282
|
-
|
|
2294
|
+
f,
|
|
2283
2295
|
y
|
|
2284
2296
|
]
|
|
2285
|
-
),
|
|
2297
|
+
), g = G(() => {
|
|
2286
2298
|
N(!0);
|
|
2287
|
-
}, [N]), S =
|
|
2299
|
+
}, [N]), S = G(() => {
|
|
2288
2300
|
E("create");
|
|
2289
|
-
}, [E]),
|
|
2301
|
+
}, [E]), D = G(() => {
|
|
2290
2302
|
E("manage");
|
|
2291
2303
|
}, [E]);
|
|
2292
|
-
return /* @__PURE__ */ r(
|
|
2304
|
+
return /* @__PURE__ */ r(W, { children: [
|
|
2293
2305
|
/* @__PURE__ */ e(
|
|
2294
2306
|
Ga,
|
|
2295
2307
|
{
|
|
2296
|
-
showFilters:
|
|
2308
|
+
showFilters: A ? !1 : o,
|
|
2297
2309
|
onShowFiltersChange: N,
|
|
2298
2310
|
pickerContent: /* @__PURE__ */ e(Ka, {}),
|
|
2299
|
-
settingsContent: (
|
|
2311
|
+
settingsContent: (b) => /* @__PURE__ */ e(
|
|
2300
2312
|
Xa,
|
|
2301
2313
|
{
|
|
2302
|
-
onAddFilter:
|
|
2314
|
+
onAddFilter: g,
|
|
2303
2315
|
onAddControl: S,
|
|
2304
|
-
onManageControls:
|
|
2305
|
-
onDismiss:
|
|
2316
|
+
onManageControls: D,
|
|
2317
|
+
onDismiss: b
|
|
2306
2318
|
}
|
|
2307
2319
|
),
|
|
2308
2320
|
size: t,
|
|
@@ -2313,12 +2325,12 @@ function $n({
|
|
|
2313
2325
|
settingsContentClassName: c
|
|
2314
2326
|
}
|
|
2315
2327
|
),
|
|
2316
|
-
u ?
|
|
2328
|
+
u ? A ? /* @__PURE__ */ e(
|
|
2317
2329
|
_a,
|
|
2318
2330
|
{
|
|
2319
2331
|
open: !0,
|
|
2320
|
-
onOpenChange: (
|
|
2321
|
-
|
|
2332
|
+
onOpenChange: (b) => {
|
|
2333
|
+
b || m(null);
|
|
2322
2334
|
},
|
|
2323
2335
|
initialMode: u
|
|
2324
2336
|
}
|
|
@@ -2326,8 +2338,8 @@ function $n({
|
|
|
2326
2338
|
Oa,
|
|
2327
2339
|
{
|
|
2328
2340
|
open: !0,
|
|
2329
|
-
onOpenChange: (
|
|
2330
|
-
|
|
2341
|
+
onOpenChange: (b) => {
|
|
2342
|
+
b || m(null);
|
|
2331
2343
|
},
|
|
2332
2344
|
showTrigger: !1,
|
|
2333
2345
|
initialMode: u
|
|
@@ -2343,13 +2355,13 @@ function Za({
|
|
|
2343
2355
|
}) {
|
|
2344
2356
|
const n = typeof a == "number" && a > 0;
|
|
2345
2357
|
return /* @__PURE__ */ r(
|
|
2346
|
-
|
|
2358
|
+
T,
|
|
2347
2359
|
{
|
|
2348
2360
|
type: "button",
|
|
2349
2361
|
size: "xs",
|
|
2350
2362
|
variant: "outline",
|
|
2351
2363
|
disabled: t,
|
|
2352
|
-
className:
|
|
2364
|
+
className: q("gap-1.5", i),
|
|
2353
2365
|
onClick: s,
|
|
2354
2366
|
"aria-label": "Reports & briefings",
|
|
2355
2367
|
children: [
|
|
@@ -2360,7 +2372,7 @@ function Za({
|
|
|
2360
2372
|
}
|
|
2361
2373
|
);
|
|
2362
2374
|
}
|
|
2363
|
-
const Qa = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",
|
|
2375
|
+
const Qa = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", zt = "inline-flex h-7 items-center gap-1.5 rounded-control px-2 text-[12px] text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50", Ve = "inline-flex h-7 items-center gap-1.5 rounded-control bg-primary px-3 text-[12px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50";
|
|
2364
2376
|
function Ja(t) {
|
|
2365
2377
|
return t === "dashboard" ? "This dashboard" : "Project";
|
|
2366
2378
|
}
|
|
@@ -2391,7 +2403,7 @@ function rn(t) {
|
|
|
2391
2403
|
}
|
|
2392
2404
|
return null;
|
|
2393
2405
|
}
|
|
2394
|
-
function
|
|
2406
|
+
function _t(t) {
|
|
2395
2407
|
return t.hasActiveRun ? "Running" : t.lastRunStatus ? `Last run ${t.lastRunStatus.toString().toLowerCase()}` : "Idle";
|
|
2396
2408
|
}
|
|
2397
2409
|
function an(t) {
|
|
@@ -2416,7 +2428,7 @@ function nn({
|
|
|
2416
2428
|
role: "tab",
|
|
2417
2429
|
"aria-selected": s,
|
|
2418
2430
|
onClick: () => a(i),
|
|
2419
|
-
className:
|
|
2431
|
+
className: q(
|
|
2420
2432
|
"h-6 rounded-[3px] px-2 text-[11px] transition-colors",
|
|
2421
2433
|
s ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
2422
2434
|
),
|
|
@@ -2440,27 +2452,27 @@ function sn({
|
|
|
2440
2452
|
onNew: l,
|
|
2441
2453
|
canCreate: d,
|
|
2442
2454
|
canCreateScheduledReport: o,
|
|
2443
|
-
analyticalBriefingsEnabled:
|
|
2455
|
+
analyticalBriefingsEnabled: f,
|
|
2444
2456
|
onRunNow: h,
|
|
2445
2457
|
onTogglePause: p,
|
|
2446
2458
|
onDelete: y,
|
|
2447
|
-
selectingId:
|
|
2448
|
-
busyId:
|
|
2459
|
+
selectingId: v,
|
|
2460
|
+
busyId: A,
|
|
2449
2461
|
manageBriefingsHref: E,
|
|
2450
2462
|
contentKind: N,
|
|
2451
|
-
hideHeader:
|
|
2463
|
+
hideHeader: g = !1
|
|
2452
2464
|
}) {
|
|
2453
|
-
const S = t.length,
|
|
2465
|
+
const S = t.length, D = t.filter((L) => L.status === "ACTIVE").length, P = N === "reports" ? S === 1 ? "report" : "reports" : N === "briefings" ? S === 1 ? "briefing" : "briefings" : S === 1 ? "item" : "items", b = t.find((L) => L.hasActiveRun) ?? null, C = N ?? "reports & briefings", F = i === "dashboard" ? a : `Project ${C}`;
|
|
2454
2466
|
return /* @__PURE__ */ r(
|
|
2455
2467
|
"section",
|
|
2456
2468
|
{
|
|
2457
2469
|
"aria-label": `Dashboard ${C.replace("&", "and")}`,
|
|
2458
2470
|
className: "flex h-full min-h-0 flex-col bg-background text-foreground",
|
|
2459
2471
|
children: [
|
|
2460
|
-
|
|
2472
|
+
g ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
|
|
2461
2473
|
/* @__PURE__ */ r("div", { className: "min-w-0", children: [
|
|
2462
2474
|
/* @__PURE__ */ e("div", { className: Qa, children: C }),
|
|
2463
|
-
/* @__PURE__ */ e("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children:
|
|
2475
|
+
/* @__PURE__ */ e("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: F })
|
|
2464
2476
|
] }),
|
|
2465
2477
|
/* @__PURE__ */ e(
|
|
2466
2478
|
"button",
|
|
@@ -2469,7 +2481,7 @@ function sn({
|
|
|
2469
2481
|
onClick: u,
|
|
2470
2482
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2471
2483
|
"aria-label": `Close ${C.replace("&", "and")} panel`,
|
|
2472
|
-
children: /* @__PURE__ */ e(
|
|
2484
|
+
children: /* @__PURE__ */ e(We, { className: "h-3.5 w-3.5" })
|
|
2473
2485
|
}
|
|
2474
2486
|
)
|
|
2475
2487
|
] }),
|
|
@@ -2490,7 +2502,7 @@ function sn({
|
|
|
2490
2502
|
"No ",
|
|
2491
2503
|
C,
|
|
2492
2504
|
" yet"
|
|
2493
|
-
] }) : /* @__PURE__ */ r(
|
|
2505
|
+
] }) : /* @__PURE__ */ r(W, { children: [
|
|
2494
2506
|
/* @__PURE__ */ r("span", { className: "font-medium text-foreground/80", children: [
|
|
2495
2507
|
S,
|
|
2496
2508
|
" ",
|
|
@@ -2498,7 +2510,7 @@ function sn({
|
|
|
2498
2510
|
] }),
|
|
2499
2511
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2500
2512
|
/* @__PURE__ */ r("span", { children: [
|
|
2501
|
-
|
|
2513
|
+
D,
|
|
2502
2514
|
" active"
|
|
2503
2515
|
] })
|
|
2504
2516
|
] }) })
|
|
@@ -2509,14 +2521,14 @@ function sn({
|
|
|
2509
2521
|
// when a manual reload is in flight, but don't show a separate
|
|
2510
2522
|
// refresh button — close+reopen handles the rare "stale list"
|
|
2511
2523
|
// case without crowding the toolbar.
|
|
2512
|
-
/* @__PURE__ */ e(
|
|
2524
|
+
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
|
|
2513
2525
|
) : null,
|
|
2514
|
-
S > 0 && d ?
|
|
2515
|
-
/* @__PURE__ */ e(
|
|
2516
|
-
/* @__PURE__ */ e(
|
|
2526
|
+
S > 0 && d ? f && o ? /* @__PURE__ */ r(ze, { children: [
|
|
2527
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Ve, children: [
|
|
2528
|
+
/* @__PURE__ */ e(be, { className: "h-3 w-3" }),
|
|
2517
2529
|
" New"
|
|
2518
2530
|
] }) }),
|
|
2519
|
-
/* @__PURE__ */ r(
|
|
2531
|
+
/* @__PURE__ */ r($e, { align: "end", children: [
|
|
2520
2532
|
/* @__PURE__ */ e(H, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
|
|
2521
2533
|
/* @__PURE__ */ e(
|
|
2522
2534
|
H,
|
|
@@ -2530,30 +2542,30 @@ function sn({
|
|
|
2530
2542
|
"button",
|
|
2531
2543
|
{
|
|
2532
2544
|
onClick: () => l("scheduled_report"),
|
|
2533
|
-
className:
|
|
2545
|
+
className: Ve,
|
|
2534
2546
|
children: [
|
|
2535
|
-
/* @__PURE__ */ e(
|
|
2547
|
+
/* @__PURE__ */ e(be, { className: "h-3 w-3" }),
|
|
2536
2548
|
" Schedule report"
|
|
2537
2549
|
]
|
|
2538
2550
|
}
|
|
2539
|
-
) :
|
|
2551
|
+
) : f ? /* @__PURE__ */ r(
|
|
2540
2552
|
"button",
|
|
2541
2553
|
{
|
|
2542
2554
|
onClick: () => l("analytical_briefing"),
|
|
2543
|
-
className:
|
|
2555
|
+
className: Ve,
|
|
2544
2556
|
children: [
|
|
2545
|
-
/* @__PURE__ */ e(
|
|
2557
|
+
/* @__PURE__ */ e(be, { className: "h-3 w-3" }),
|
|
2546
2558
|
" New briefing"
|
|
2547
2559
|
]
|
|
2548
2560
|
}
|
|
2549
2561
|
) : null : null
|
|
2550
2562
|
] })
|
|
2551
2563
|
] }),
|
|
2552
|
-
|
|
2553
|
-
/* @__PURE__ */ e(
|
|
2554
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children:
|
|
2564
|
+
b ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
|
|
2565
|
+
/* @__PURE__ */ e(re, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
|
|
2566
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: b.name }),
|
|
2555
2567
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2556
|
-
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children:
|
|
2568
|
+
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: _t(b) })
|
|
2557
2569
|
] }) : null,
|
|
2558
2570
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: [
|
|
2559
2571
|
s ? /* @__PURE__ */ e("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: s }) : null,
|
|
@@ -2563,29 +2575,29 @@ function sn({
|
|
|
2563
2575
|
onNew: l,
|
|
2564
2576
|
canCreate: d,
|
|
2565
2577
|
canCreateScheduledReport: o,
|
|
2566
|
-
analyticalBriefingsEnabled:
|
|
2578
|
+
analyticalBriefingsEnabled: f,
|
|
2567
2579
|
contentKind: N
|
|
2568
2580
|
}
|
|
2569
2581
|
) : null,
|
|
2570
|
-
t.map((
|
|
2582
|
+
t.map((L) => /* @__PURE__ */ e(
|
|
2571
2583
|
cn,
|
|
2572
2584
|
{
|
|
2573
|
-
briefing:
|
|
2574
|
-
isOpening:
|
|
2575
|
-
isBusy:
|
|
2576
|
-
onOpen: () => m(
|
|
2577
|
-
onRunNow: () => h(
|
|
2578
|
-
onTogglePause: () => p(
|
|
2579
|
-
onDelete: () => y(
|
|
2585
|
+
briefing: L,
|
|
2586
|
+
isOpening: v === L.id,
|
|
2587
|
+
isBusy: A === L.id,
|
|
2588
|
+
onOpen: () => m(L.id),
|
|
2589
|
+
onRunNow: () => h(L),
|
|
2590
|
+
onTogglePause: () => p(L),
|
|
2591
|
+
onDelete: () => y(L)
|
|
2580
2592
|
},
|
|
2581
|
-
|
|
2593
|
+
L.id
|
|
2582
2594
|
))
|
|
2583
2595
|
] }),
|
|
2584
2596
|
E ? /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
|
|
2585
2597
|
"a",
|
|
2586
2598
|
{
|
|
2587
2599
|
href: E,
|
|
2588
|
-
className:
|
|
2600
|
+
className: q(zt, "h-6 px-1 text-[11px]"),
|
|
2589
2601
|
children: [
|
|
2590
2602
|
"Manage all reports & briefings",
|
|
2591
2603
|
/* @__PURE__ */ e(pa, { className: "h-3 w-3" })
|
|
@@ -2619,9 +2631,9 @@ function on({
|
|
|
2619
2631
|
"button",
|
|
2620
2632
|
{
|
|
2621
2633
|
onClick: () => t("scheduled_report"),
|
|
2622
|
-
className:
|
|
2634
|
+
className: Ve,
|
|
2623
2635
|
children: [
|
|
2624
|
-
/* @__PURE__ */ e(
|
|
2636
|
+
/* @__PURE__ */ e(be, { className: "h-3 w-3" }),
|
|
2625
2637
|
" Schedule a report"
|
|
2626
2638
|
]
|
|
2627
2639
|
}
|
|
@@ -2630,7 +2642,7 @@ function on({
|
|
|
2630
2642
|
"button",
|
|
2631
2643
|
{
|
|
2632
2644
|
onClick: () => t("analytical_briefing"),
|
|
2633
|
-
className:
|
|
2645
|
+
className: zt,
|
|
2634
2646
|
children: "Create analytical briefing"
|
|
2635
2647
|
}
|
|
2636
2648
|
) : null
|
|
@@ -2823,11 +2835,11 @@ function cn({
|
|
|
2823
2835
|
onTogglePause: c,
|
|
2824
2836
|
onDelete: u
|
|
2825
2837
|
}) {
|
|
2826
|
-
const m = t.status === "PAUSED", l = t.hasActiveRun, d = rn(t), o = en(t.lastRunAt),
|
|
2838
|
+
const m = t.status === "PAUSED", l = t.hasActiveRun, d = rn(t), o = en(t.lastRunAt), f = t.lastRunStatus, h = oe(t), p = f === "SUCCESS" ? Te.success.dot : f === "FAILED" ? Te.danger.dot : f ? Te.warning.dot : Te.neutral.dot;
|
|
2827
2839
|
return /* @__PURE__ */ r(
|
|
2828
2840
|
"div",
|
|
2829
2841
|
{
|
|
2830
|
-
className:
|
|
2842
|
+
className: q(
|
|
2831
2843
|
"group relative border-b border-border/60 px-4 py-3 transition-colors hover:bg-muted/60",
|
|
2832
2844
|
m && "opacity-70"
|
|
2833
2845
|
),
|
|
@@ -2854,7 +2866,7 @@ function cn({
|
|
|
2854
2866
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2855
2867
|
/* @__PURE__ */ e(Er, { className: "h-3 w-3" }),
|
|
2856
2868
|
/* @__PURE__ */ e("span", { className: "truncate", children: tn(t) }),
|
|
2857
|
-
t.lastRunAt ? /* @__PURE__ */ r(
|
|
2869
|
+
t.lastRunAt ? /* @__PURE__ */ r(W, { children: [
|
|
2858
2870
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2859
2871
|
/* @__PURE__ */ r("span", { children: [
|
|
2860
2872
|
"Last run ",
|
|
@@ -2863,34 +2875,34 @@ function cn({
|
|
|
2863
2875
|
] }) : null
|
|
2864
2876
|
] }),
|
|
2865
2877
|
d || l ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
|
|
2866
|
-
l ? /* @__PURE__ */ e(
|
|
2878
|
+
l ? /* @__PURE__ */ e(re, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ e(
|
|
2867
2879
|
"span",
|
|
2868
2880
|
{
|
|
2869
|
-
className:
|
|
2881
|
+
className: q(
|
|
2870
2882
|
"inline-block h-1.5 w-1.5 shrink-0 rounded-full",
|
|
2871
2883
|
p
|
|
2872
2884
|
)
|
|
2873
2885
|
}
|
|
2874
2886
|
),
|
|
2875
|
-
/* @__PURE__ */ e("span", { className: "truncate", children: l ?
|
|
2887
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: l ? _t(t) : d })
|
|
2876
2888
|
] }) : null
|
|
2877
2889
|
]
|
|
2878
2890
|
}
|
|
2879
2891
|
),
|
|
2880
|
-
/* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children: i ? /* @__PURE__ */ e(
|
|
2881
|
-
/* @__PURE__ */ e(
|
|
2892
|
+
/* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children: i ? /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ r(ze, { children: [
|
|
2893
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2882
2894
|
"button",
|
|
2883
2895
|
{
|
|
2884
2896
|
type: "button",
|
|
2885
2897
|
onClick: (y) => y.stopPropagation(),
|
|
2886
2898
|
className: "inline-flex h-6 w-6 items-center justify-center rounded-control text-muted-foreground/70 opacity-60 hover:bg-muted hover:text-foreground/80 focus-visible:opacity-100 group-hover:opacity-100",
|
|
2887
2899
|
"aria-label": `${h.noun === "report" ? "Report" : "Briefing"} actions`,
|
|
2888
|
-
children: /* @__PURE__ */ e(
|
|
2900
|
+
children: /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5" })
|
|
2889
2901
|
}
|
|
2890
2902
|
) }),
|
|
2891
|
-
/* @__PURE__ */ r(
|
|
2903
|
+
/* @__PURE__ */ r($e, { align: "end", className: "w-44", children: [
|
|
2892
2904
|
/* @__PURE__ */ r(H, { onClick: s, children: [
|
|
2893
|
-
/* @__PURE__ */ e(
|
|
2905
|
+
/* @__PURE__ */ e(Ft, { className: "h-3.5 w-3.5" }),
|
|
2894
2906
|
"Edit ",
|
|
2895
2907
|
h.noun
|
|
2896
2908
|
] }),
|
|
@@ -2912,16 +2924,16 @@ function cn({
|
|
|
2912
2924
|
onClick: (y) => {
|
|
2913
2925
|
y.preventDefault(), c();
|
|
2914
2926
|
},
|
|
2915
|
-
children: m ? /* @__PURE__ */ r(
|
|
2927
|
+
children: m ? /* @__PURE__ */ r(W, { children: [
|
|
2916
2928
|
/* @__PURE__ */ e(Fr, { className: "h-3.5 w-3.5" }),
|
|
2917
2929
|
"Resume"
|
|
2918
|
-
] }) : /* @__PURE__ */ r(
|
|
2930
|
+
] }) : /* @__PURE__ */ r(W, { children: [
|
|
2919
2931
|
/* @__PURE__ */ e(Lr, { className: "h-3.5 w-3.5" }),
|
|
2920
2932
|
"Pause"
|
|
2921
2933
|
] })
|
|
2922
2934
|
}
|
|
2923
2935
|
) : null,
|
|
2924
|
-
/* @__PURE__ */ e(
|
|
2936
|
+
/* @__PURE__ */ e(Ue, {}),
|
|
2925
2937
|
/* @__PURE__ */ r(
|
|
2926
2938
|
H,
|
|
2927
2939
|
{
|
|
@@ -2930,7 +2942,7 @@ function cn({
|
|
|
2930
2942
|
},
|
|
2931
2943
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
2932
2944
|
children: [
|
|
2933
|
-
/* @__PURE__ */ e(
|
|
2945
|
+
/* @__PURE__ */ e(Re, { className: "h-3.5 w-3.5" }),
|
|
2934
2946
|
"Delete ",
|
|
2935
2947
|
h.noun
|
|
2936
2948
|
]
|
|
@@ -2985,27 +2997,27 @@ function bn({
|
|
|
2985
2997
|
onTimeout: c,
|
|
2986
2998
|
onExpand: u
|
|
2987
2999
|
}) {
|
|
2988
|
-
const [m, l] =
|
|
3000
|
+
const [m, l] = k(a), { startRun: d } = qr({
|
|
2989
3001
|
apiServiceUrl: i,
|
|
2990
3002
|
token: s,
|
|
2991
3003
|
intervalMs: dn,
|
|
2992
3004
|
timeoutMs: un,
|
|
2993
3005
|
fetchRun: ({
|
|
2994
|
-
apiServiceUrl:
|
|
3006
|
+
apiServiceUrl: f,
|
|
2995
3007
|
token: h,
|
|
2996
3008
|
runId: p
|
|
2997
|
-
}) => Kr(
|
|
2998
|
-
onRun: (
|
|
2999
|
-
l(
|
|
3009
|
+
}) => Kr(f, h, t, p),
|
|
3010
|
+
onRun: (f) => {
|
|
3011
|
+
l(f);
|
|
3000
3012
|
},
|
|
3001
|
-
onTerminalRun: (
|
|
3002
|
-
n(
|
|
3013
|
+
onTerminalRun: (f) => {
|
|
3014
|
+
n(f);
|
|
3003
3015
|
},
|
|
3004
3016
|
onTimeout: () => {
|
|
3005
3017
|
c();
|
|
3006
3018
|
}
|
|
3007
3019
|
}), o = me(!1);
|
|
3008
|
-
return
|
|
3020
|
+
return J(() => {
|
|
3009
3021
|
o.current || (o.current = !0, Xr(a.status) ? d(a) : Yr(a.status) && n(a));
|
|
3010
3022
|
}, [a, n, d]), /* @__PURE__ */ e(Zr, { run: m, onExpand: u });
|
|
3011
3023
|
}
|
|
@@ -3024,28 +3036,28 @@ function xn({
|
|
|
3024
3036
|
onOpenChange: l,
|
|
3025
3037
|
hideTrigger: d = !1,
|
|
3026
3038
|
workflowIntent: o,
|
|
3027
|
-
client:
|
|
3039
|
+
client: f
|
|
3028
3040
|
}) {
|
|
3029
|
-
const { authToken: h, tokenProps: p } =
|
|
3041
|
+
const { authToken: h, tokenProps: p } = je(), y = Tr(), v = !o || y.canCreate && (o === "scheduled_report" || y.analyticalBriefingsEnabled), [A, E] = k(!1), N = m ?? A, g = (w) => {
|
|
3030
3042
|
m === void 0 && E(w), l == null || l(w);
|
|
3031
|
-
}, [S,
|
|
3043
|
+
}, [S, D] = k(
|
|
3032
3044
|
o ? "author" : "list"
|
|
3033
|
-
), [P,
|
|
3045
|
+
), [P, b] = k(
|
|
3034
3046
|
o ?? "analytical_briefing"
|
|
3035
|
-
), [C,
|
|
3047
|
+
), [C, F] = k("dashboard"), [L, K] = k(
|
|
3036
3048
|
[]
|
|
3037
|
-
), [
|
|
3049
|
+
), [V, R] = k(null), I = o && !v && !V ? "list" : S, [pe, X] = k(!1), [Ce, ee] = k(null), [He, Z] = k(null), [_, ae] = k(
|
|
3038
3050
|
null
|
|
3039
|
-
), [le, ce] =
|
|
3040
|
-
|
|
3041
|
-
const w = N && !
|
|
3042
|
-
|
|
3051
|
+
), [le, ce] = k(null), we = me(null), Ie = me(N);
|
|
3052
|
+
J(() => {
|
|
3053
|
+
const w = N && !Ie.current;
|
|
3054
|
+
Ie.current = N, !(!w || !o) && (R(null), F("dashboard"), b(o), D("author"), ce(null));
|
|
3043
3055
|
}, [N, o]);
|
|
3044
|
-
const [de,
|
|
3056
|
+
const [de, fe] = k(
|
|
3045
3057
|
null
|
|
3046
|
-
), [
|
|
3058
|
+
), [Q, Ne] = k(null), $ = i ?? (p == null ? void 0 : p.apiServiceUrl), j = s ?? (h == null ? void 0 : h.accessToken), se = te(() => ({ ...gn, ...f }), [f]), ge = hn(a), Fe = te(() => {
|
|
3047
3059
|
const w = pn(
|
|
3048
|
-
|
|
3060
|
+
L,
|
|
3049
3061
|
C,
|
|
3050
3062
|
t
|
|
3051
3063
|
);
|
|
@@ -3053,25 +3065,25 @@ function xn({
|
|
|
3053
3065
|
return w;
|
|
3054
3066
|
const U = o === "scheduled_report" ? "report" : "briefing";
|
|
3055
3067
|
return w.filter(
|
|
3056
|
-
(
|
|
3068
|
+
(Le) => oe(Le).noun === U
|
|
3057
3069
|
);
|
|
3058
|
-
}, [t,
|
|
3070
|
+
}, [t, L, C, o]), Ge = te(() => C === "dashboard" ? {
|
|
3059
3071
|
source: { type: "dashboard", dashboardId: t },
|
|
3060
|
-
label:
|
|
3061
|
-
detail: mn(
|
|
3072
|
+
label: ge,
|
|
3073
|
+
detail: mn(ge)
|
|
3062
3074
|
} : {
|
|
3063
3075
|
source: { type: "project" },
|
|
3064
3076
|
label: "This project",
|
|
3065
3077
|
detail: "Use any data in this project."
|
|
3066
|
-
}, [t,
|
|
3078
|
+
}, [t, ge, C]), Se = !!($ && j), ue = ma({
|
|
3067
3079
|
canCreate: y.canCreate,
|
|
3068
3080
|
analyticalBriefingsEnabled: y.analyticalBriefingsEnabled,
|
|
3069
3081
|
scheduledReportAvailable: C === "dashboard"
|
|
3070
|
-
}),
|
|
3082
|
+
}), Y = G(async () => {
|
|
3071
3083
|
if (!(!$ || !j)) {
|
|
3072
|
-
|
|
3084
|
+
X(!0), ce(null);
|
|
3073
3085
|
try {
|
|
3074
|
-
|
|
3086
|
+
K(
|
|
3075
3087
|
await fn({
|
|
3076
3088
|
apiClient: se,
|
|
3077
3089
|
apiServiceUrl: $,
|
|
@@ -3083,59 +3095,59 @@ function xn({
|
|
|
3083
3095
|
w instanceof Error ? w.message : "Could not load briefings."
|
|
3084
3096
|
);
|
|
3085
3097
|
} finally {
|
|
3086
|
-
|
|
3098
|
+
X(!1);
|
|
3087
3099
|
}
|
|
3088
3100
|
}
|
|
3089
3101
|
}, [se, $, j]);
|
|
3090
|
-
|
|
3091
|
-
!N ||
|
|
3092
|
-
}, [
|
|
3093
|
-
const
|
|
3094
|
-
|
|
3095
|
-
},
|
|
3096
|
-
|
|
3102
|
+
J(() => {
|
|
3103
|
+
!N || I !== "list" || !Se || Y();
|
|
3104
|
+
}, [Se, I, Y, N]);
|
|
3105
|
+
const x = () => {
|
|
3106
|
+
R(null), F("dashboard"), D("list"), g(!0);
|
|
3107
|
+
}, B = (w) => {
|
|
3108
|
+
R(null), b(w), D("author");
|
|
3097
3109
|
}, O = async (w) => {
|
|
3098
3110
|
if (!(!$ || !j)) {
|
|
3099
|
-
|
|
3111
|
+
ee(w), ce(null);
|
|
3100
3112
|
try {
|
|
3101
3113
|
const U = await se.getBriefing(
|
|
3102
3114
|
$,
|
|
3103
3115
|
j,
|
|
3104
3116
|
w
|
|
3105
3117
|
);
|
|
3106
|
-
|
|
3118
|
+
R(U.briefing), D("author");
|
|
3107
3119
|
} catch (U) {
|
|
3108
3120
|
ce(
|
|
3109
3121
|
U instanceof Error ? U.message : "Could not open briefing."
|
|
3110
3122
|
);
|
|
3111
3123
|
} finally {
|
|
3112
|
-
|
|
3124
|
+
ee(null);
|
|
3113
3125
|
}
|
|
3114
3126
|
}
|
|
3115
|
-
},
|
|
3127
|
+
}, ne = async (w) => {
|
|
3116
3128
|
if (!(!$ || !j)) {
|
|
3117
|
-
|
|
3129
|
+
Z(w.id);
|
|
3118
3130
|
try {
|
|
3119
3131
|
await se.runBriefingNow(
|
|
3120
3132
|
$,
|
|
3121
3133
|
j,
|
|
3122
3134
|
w.id,
|
|
3123
3135
|
{ requestId: vn() }
|
|
3124
|
-
),
|
|
3136
|
+
), Y();
|
|
3125
3137
|
} catch (U) {
|
|
3126
3138
|
z.error(
|
|
3127
3139
|
U instanceof Error ? U.message : "Could not start the run."
|
|
3128
3140
|
);
|
|
3129
3141
|
} finally {
|
|
3130
|
-
|
|
3142
|
+
Z(null);
|
|
3131
3143
|
}
|
|
3132
3144
|
}
|
|
3133
3145
|
}, ie = async (w) => {
|
|
3134
3146
|
if (!$ || !j) return;
|
|
3135
|
-
const { noun: U } = oe(w),
|
|
3136
|
-
|
|
3147
|
+
const { noun: U } = oe(w), Le = U === "report" ? "Report" : "Briefing";
|
|
3148
|
+
Z(w.id);
|
|
3137
3149
|
try {
|
|
3138
|
-
const
|
|
3150
|
+
const Be = w.status === "PAUSED" ? await se.resumeBriefing(
|
|
3139
3151
|
$,
|
|
3140
3152
|
j,
|
|
3141
3153
|
w.id
|
|
@@ -3145,19 +3157,19 @@ function xn({
|
|
|
3145
3157
|
w.id
|
|
3146
3158
|
);
|
|
3147
3159
|
z.success(
|
|
3148
|
-
|
|
3149
|
-
),
|
|
3150
|
-
} catch (
|
|
3160
|
+
Be.briefing.status === "PAUSED" ? `${Le} paused` : `${Le} resumed`
|
|
3161
|
+
), Y();
|
|
3162
|
+
} catch (Be) {
|
|
3151
3163
|
z.error(
|
|
3152
|
-
|
|
3164
|
+
Be instanceof Error ? Be.message : `Could not update the ${U} status.`
|
|
3153
3165
|
);
|
|
3154
3166
|
} finally {
|
|
3155
|
-
|
|
3167
|
+
Z(null);
|
|
3156
3168
|
}
|
|
3157
|
-
},
|
|
3169
|
+
}, $t = async () => {
|
|
3158
3170
|
if (!_ || !$ || !j) return;
|
|
3159
3171
|
const w = _;
|
|
3160
|
-
|
|
3172
|
+
Z(w.id);
|
|
3161
3173
|
try {
|
|
3162
3174
|
await se.deleteBriefing(
|
|
3163
3175
|
$,
|
|
@@ -3165,35 +3177,35 @@ function xn({
|
|
|
3165
3177
|
w.id
|
|
3166
3178
|
);
|
|
3167
3179
|
const { noun: U } = oe(w);
|
|
3168
|
-
z.success(`${U === "report" ? "Report" : "Briefing"} deleted`),
|
|
3180
|
+
z.success(`${U === "report" ? "Report" : "Briefing"} deleted`), ae(null), Y();
|
|
3169
3181
|
} catch (U) {
|
|
3170
3182
|
z.error(
|
|
3171
3183
|
U instanceof Error ? U.message : "Could not delete the briefing."
|
|
3172
3184
|
);
|
|
3173
3185
|
} finally {
|
|
3174
|
-
|
|
3186
|
+
Z(null);
|
|
3175
3187
|
}
|
|
3176
|
-
},
|
|
3177
|
-
return y.surfaceVisible ? /* @__PURE__ */ r(zr, { open: N, onOpenChange:
|
|
3188
|
+
}, jt = Fe.length;
|
|
3189
|
+
return y.surfaceVisible ? /* @__PURE__ */ r(zr, { open: N, onOpenChange: g, children: [
|
|
3178
3190
|
d ? null : /* @__PURE__ */ e(
|
|
3179
3191
|
Za,
|
|
3180
3192
|
{
|
|
3181
|
-
disabled: n || !
|
|
3182
|
-
briefingCount:
|
|
3193
|
+
disabled: n || !Se,
|
|
3194
|
+
briefingCount: jt,
|
|
3183
3195
|
className: c,
|
|
3184
|
-
onClick:
|
|
3196
|
+
onClick: x
|
|
3185
3197
|
}
|
|
3186
3198
|
),
|
|
3187
3199
|
/* @__PURE__ */ r(
|
|
3188
3200
|
_r,
|
|
3189
3201
|
{
|
|
3190
|
-
ref:
|
|
3202
|
+
ref: we,
|
|
3191
3203
|
side: "right",
|
|
3192
3204
|
hideClose: !0,
|
|
3193
3205
|
className: "flex h-full w-full flex-col overflow-hidden p-0 outline-none sm:max-w-[560px]",
|
|
3194
3206
|
onOpenAutoFocus: (w) => {
|
|
3195
3207
|
var U;
|
|
3196
|
-
w.preventDefault(), (U =
|
|
3208
|
+
w.preventDefault(), (U = we.current) == null || U.focus({ preventScroll: !0 });
|
|
3197
3209
|
},
|
|
3198
3210
|
children: [
|
|
3199
3211
|
/* @__PURE__ */ r($r, { className: "sr-only", children: [
|
|
@@ -3213,17 +3225,17 @@ function xn({
|
|
|
3213
3225
|
{
|
|
3214
3226
|
type: "button",
|
|
3215
3227
|
role: "tab",
|
|
3216
|
-
"aria-selected":
|
|
3217
|
-
disabled: !
|
|
3218
|
-
className:
|
|
3228
|
+
"aria-selected": I === "author",
|
|
3229
|
+
disabled: !v,
|
|
3230
|
+
className: q(
|
|
3219
3231
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3220
|
-
|
|
3221
|
-
!
|
|
3232
|
+
I === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
|
|
3233
|
+
!v && "cursor-not-allowed opacity-50"
|
|
3222
3234
|
),
|
|
3223
3235
|
onClick: () => {
|
|
3224
|
-
|
|
3236
|
+
v && (R(null), b(o), F("dashboard"), D("author"));
|
|
3225
3237
|
},
|
|
3226
|
-
children:
|
|
3238
|
+
children: V ? `Edit ${oe(V).noun}` : o === "scheduled_report" ? "Schedule report" : "Create briefing"
|
|
3227
3239
|
}
|
|
3228
3240
|
),
|
|
3229
3241
|
/* @__PURE__ */ e(
|
|
@@ -3231,12 +3243,12 @@ function xn({
|
|
|
3231
3243
|
{
|
|
3232
3244
|
type: "button",
|
|
3233
3245
|
role: "tab",
|
|
3234
|
-
"aria-selected":
|
|
3235
|
-
className:
|
|
3246
|
+
"aria-selected": I === "list",
|
|
3247
|
+
className: q(
|
|
3236
3248
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3237
|
-
|
|
3249
|
+
I === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
3238
3250
|
),
|
|
3239
|
-
onClick: () =>
|
|
3251
|
+
onClick: () => D("list"),
|
|
3240
3252
|
children: o === "scheduled_report" ? "Manage reports" : "Manage briefings"
|
|
3241
3253
|
}
|
|
3242
3254
|
)
|
|
@@ -3247,27 +3259,27 @@ function xn({
|
|
|
3247
3259
|
"button",
|
|
3248
3260
|
{
|
|
3249
3261
|
type: "button",
|
|
3250
|
-
onClick: () =>
|
|
3262
|
+
onClick: () => g(!1),
|
|
3251
3263
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3252
3264
|
"aria-label": o === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
|
|
3253
|
-
children: /* @__PURE__ */ e(
|
|
3265
|
+
children: /* @__PURE__ */ e(We, { className: "h-3.5 w-3.5" })
|
|
3254
3266
|
}
|
|
3255
3267
|
)
|
|
3256
3268
|
] }) : null,
|
|
3257
|
-
|
|
3269
|
+
I === "list" ? /* @__PURE__ */ e(
|
|
3258
3270
|
sn,
|
|
3259
3271
|
{
|
|
3260
|
-
briefings:
|
|
3261
|
-
dashboardLabel:
|
|
3272
|
+
briefings: Fe,
|
|
3273
|
+
dashboardLabel: ge,
|
|
3262
3274
|
sourceView: C,
|
|
3263
3275
|
error: le,
|
|
3264
|
-
loading:
|
|
3265
|
-
onSourceViewChange:
|
|
3266
|
-
onClose: () =>
|
|
3276
|
+
loading: pe,
|
|
3277
|
+
onSourceViewChange: F,
|
|
3278
|
+
onClose: () => g(!1),
|
|
3267
3279
|
onEdit: (w) => {
|
|
3268
3280
|
O(w);
|
|
3269
3281
|
},
|
|
3270
|
-
onNew:
|
|
3282
|
+
onNew: B,
|
|
3271
3283
|
canCreate: !o && ue.length > 0,
|
|
3272
3284
|
canCreateScheduledReport: ue.includes(
|
|
3273
3285
|
"scheduled_report"
|
|
@@ -3276,13 +3288,13 @@ function xn({
|
|
|
3276
3288
|
"analytical_briefing"
|
|
3277
3289
|
),
|
|
3278
3290
|
onRunNow: (w) => {
|
|
3279
|
-
|
|
3291
|
+
ne(w);
|
|
3280
3292
|
},
|
|
3281
3293
|
onTogglePause: (w) => {
|
|
3282
3294
|
ie(w);
|
|
3283
3295
|
},
|
|
3284
|
-
onDelete: (w) =>
|
|
3285
|
-
selectingId:
|
|
3296
|
+
onDelete: (w) => ae(w),
|
|
3297
|
+
selectingId: Ce,
|
|
3286
3298
|
busyId: He,
|
|
3287
3299
|
manageBriefingsHref: u,
|
|
3288
3300
|
contentKind: o === "scheduled_report" ? "reports" : o === "analytical_briefing" ? "briefings" : void 0,
|
|
@@ -3293,25 +3305,25 @@ function xn({
|
|
|
3293
3305
|
{
|
|
3294
3306
|
apiServiceUrl: $,
|
|
3295
3307
|
token: j,
|
|
3296
|
-
briefing:
|
|
3308
|
+
briefing: V,
|
|
3297
3309
|
intent: P,
|
|
3298
|
-
sourceContext:
|
|
3299
|
-
title:
|
|
3310
|
+
sourceContext: V ? void 0 : Ge,
|
|
3311
|
+
title: V ? `Edit ${oe(V).noun}` : P === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
|
|
3300
3312
|
hideHeader: !!o,
|
|
3301
3313
|
className: "h-full min-h-0 max-w-none border-0 shadow-none",
|
|
3302
|
-
onBack: o ? void 0 : () =>
|
|
3303
|
-
onCancel: () =>
|
|
3314
|
+
onBack: o ? void 0 : () => D("list"),
|
|
3315
|
+
onCancel: () => g(!1),
|
|
3304
3316
|
onDeleted: () => {
|
|
3305
|
-
const w =
|
|
3306
|
-
z.success(`${w === "report" ? "Report" : "Briefing"} deleted`),
|
|
3317
|
+
const w = V ? oe(V).noun : "briefing";
|
|
3318
|
+
z.success(`${w === "report" ? "Report" : "Briefing"} deleted`), R(null), D("list"), Y();
|
|
3307
3319
|
},
|
|
3308
3320
|
onRunStarted: () => {
|
|
3309
3321
|
},
|
|
3310
3322
|
onSaved: (w) => {
|
|
3311
|
-
|
|
3323
|
+
R(w), Y();
|
|
3312
3324
|
},
|
|
3313
3325
|
onMinimizeRun: ({ briefing: w, run: U }) => {
|
|
3314
|
-
|
|
3326
|
+
fe({ briefing: w, run: U }), g(!1);
|
|
3315
3327
|
}
|
|
3316
3328
|
}
|
|
3317
3329
|
)
|
|
@@ -3326,64 +3338,64 @@ function xn({
|
|
|
3326
3338
|
apiServiceUrl: $,
|
|
3327
3339
|
token: j,
|
|
3328
3340
|
onTerminal: (w) => {
|
|
3329
|
-
|
|
3341
|
+
Ne({
|
|
3330
3342
|
briefing: de.briefing,
|
|
3331
3343
|
run: w
|
|
3332
|
-
}),
|
|
3344
|
+
}), fe(null), Y();
|
|
3333
3345
|
},
|
|
3334
3346
|
onTimeout: () => {
|
|
3335
|
-
|
|
3347
|
+
fe(null), Y();
|
|
3336
3348
|
},
|
|
3337
3349
|
onExpand: () => {
|
|
3338
|
-
|
|
3350
|
+
R(de.briefing), D("author"), fe(null), g(!0);
|
|
3339
3351
|
}
|
|
3340
3352
|
}
|
|
3341
3353
|
) : null,
|
|
3342
|
-
|
|
3354
|
+
Q ? /* @__PURE__ */ e("div", { className: "fixed bottom-4 right-4 z-50 w-[360px]", children: /* @__PURE__ */ e(
|
|
3343
3355
|
Gr,
|
|
3344
3356
|
{
|
|
3345
|
-
title:
|
|
3346
|
-
durationSeconds:
|
|
3357
|
+
title: Q.run.status === "SUCCESS" ? `${Q.briefing.name} is ready` : `${Q.briefing.name} run failed`,
|
|
3358
|
+
durationSeconds: Q.run.startedAt && Q.run.completedAt ? Math.max(
|
|
3347
3359
|
0,
|
|
3348
3360
|
Math.floor(
|
|
3349
|
-
(new Date(
|
|
3361
|
+
(new Date(Q.run.completedAt).getTime() - new Date(Q.run.startedAt).getTime()) / 1e3
|
|
3350
3362
|
)
|
|
3351
3363
|
) : null,
|
|
3352
|
-
status:
|
|
3364
|
+
status: Q.run.status === "SUCCESS" ? "success" : "failed",
|
|
3353
3365
|
onView: () => {
|
|
3354
|
-
|
|
3366
|
+
R(Q.briefing), D("author"), Ne(null), g(!0);
|
|
3355
3367
|
},
|
|
3356
|
-
onDismiss: () =>
|
|
3368
|
+
onDismiss: () => Ne(null)
|
|
3357
3369
|
}
|
|
3358
3370
|
) }) : null,
|
|
3359
3371
|
/* @__PURE__ */ e(
|
|
3360
|
-
|
|
3372
|
+
Je,
|
|
3361
3373
|
{
|
|
3362
3374
|
open: !!_,
|
|
3363
3375
|
onOpenChange: (w) => {
|
|
3364
|
-
w ||
|
|
3376
|
+
w || ae(null);
|
|
3365
3377
|
},
|
|
3366
|
-
children: /* @__PURE__ */ r(
|
|
3367
|
-
/* @__PURE__ */ r(
|
|
3368
|
-
/* @__PURE__ */ r(
|
|
3378
|
+
children: /* @__PURE__ */ r(et, { children: [
|
|
3379
|
+
/* @__PURE__ */ r(tt, { children: [
|
|
3380
|
+
/* @__PURE__ */ r(rt, { children: [
|
|
3369
3381
|
"Delete",
|
|
3370
3382
|
" ",
|
|
3371
3383
|
_ ? oe(_).noun : "briefing",
|
|
3372
3384
|
"?"
|
|
3373
3385
|
] }),
|
|
3374
|
-
/* @__PURE__ */ r(
|
|
3386
|
+
/* @__PURE__ */ r(at, { children: [
|
|
3375
3387
|
"This permanently deletes ",
|
|
3376
3388
|
/* @__PURE__ */ e("strong", { children: _ == null ? void 0 : _.name }),
|
|
3377
3389
|
". Recipients will stop receiving it."
|
|
3378
3390
|
] })
|
|
3379
3391
|
] }),
|
|
3380
|
-
/* @__PURE__ */ r(
|
|
3381
|
-
/* @__PURE__ */ e(
|
|
3392
|
+
/* @__PURE__ */ r(nt, { children: [
|
|
3393
|
+
/* @__PURE__ */ e(st, { children: "Cancel" }),
|
|
3382
3394
|
/* @__PURE__ */ r(
|
|
3383
|
-
|
|
3395
|
+
St,
|
|
3384
3396
|
{
|
|
3385
3397
|
className: "bg-destructive/90 hover:bg-destructive",
|
|
3386
|
-
onClick:
|
|
3398
|
+
onClick: $t,
|
|
3387
3399
|
children: [
|
|
3388
3400
|
"Delete",
|
|
3389
3401
|
" ",
|