react-semaphor 0.1.524 → 0.1.526
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brand-studio/index.js +37 -37
- package/dist/briefings/index.js +38 -33
- package/dist/chunks/{calculated-field-identity-Dy_WpDdo.js → calculated-field-identity-D1ofR4KJ.js} +28 -28
- package/dist/chunks/{card-config-utils-CAyjC5Tp.js → card-config-utils-9sv4e-Vb.js} +15 -15
- package/dist/chunks/{switch-CWPcwAZ4.js → code-highlight-994tgM9v.js} +6309 -8642
- package/dist/chunks/dashboard-CsHvEtjN.js +15 -0
- package/dist/chunks/{dashboard-briefing-launcher-CTEyh3FQ.js → dashboard-briefing-launcher-DXz1GhFZ.js} +364 -370
- package/dist/chunks/{dashboard-controls-C3KbYzz-.js → dashboard-controls-Df8qOSrs.js} +163 -168
- package/dist/chunks/dashboard-json-Xldp0qww.js +65 -0
- package/dist/chunks/{edit-dashboard-visual-DqRmfRqN.js → edit-dashboard-visual-COHBqyic.js} +2836 -2829
- package/dist/chunks/editor-action-buttons-DahlP57T.js +2071 -0
- package/dist/chunks/{index-D9HDUSye.js → index-CbjuruKe.js} +1187 -1018
- package/dist/chunks/{matrix-control-sources-B1K7x0SL.js → matrix-control-sources-2VAzGlt8.js} +29 -29
- package/dist/chunks/pre-block-Cq1RqhZX.js +3987 -0
- package/dist/chunks/report-preferences-dialog-BcH-0lR-.js +1232 -0
- package/dist/chunks/search-CJz-QQ0Q.js +24 -0
- package/dist/chunks/{selection-reducer-CvCBQbl2.js → selection-reducer-NF5C07yM.js} +25 -46
- package/dist/chunks/{index-D7GVxl4a.js → semaphor-ready-indicator-BLRDuLr4.js} +55200 -59783
- package/dist/chunks/slider-BYIH4icg.js +877 -0
- package/dist/chunks/switch-XaAACBrJ.js +2234 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +4 -4
- package/dist/data-app-builder/index.js +67 -67
- package/dist/data-app-sdk/index.js +33 -32
- package/dist/index.js +435 -243
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +4 -5
- package/dist/types/briefings/index.d.ts +1 -1
- package/dist/types/briefings/schedule.d.ts +49 -2
- package/dist/types/components/briefings/briefing-author/form-primitives.d.ts +1 -1
- package/dist/types/components/briefings/briefing-author/schedule-model.d.ts +12 -2
- package/dist/types/components/dashboard/dashboard-container.d.ts +1 -1
- package/dist/types/components/dashboard/sheet/layout-change-guard.d.ts +1 -1
- package/dist/types/components/dashboard/sheet/sheet-layout.d.ts +1 -1
- package/dist/types/components/editor/editor-main/text-card.d.ts +1 -1
- package/dist/types/components/editor/editor.d.ts +1 -1
- package/dist/types/components/providers/semaphor-context-provider.d.ts +1 -1
- package/dist/types/components/providers/theme-provider-context.d.ts +1 -1
- package/dist/types/components/providers/theme-provider.d.ts +1 -1
- package/dist/types/components/shared/unsaved-changes/use-pristine-snapshot-initializer.d.ts +1 -1
- package/dist/types/components/sharing-and-management/hooks/use-groups.d.ts +5 -1
- package/dist/types/components/sharing-and-management/hooks/use-unified-users.d.ts +9 -1
- package/dist/types/components/sharing-and-management/resource-share-dialog/index.d.ts +1 -1
- package/dist/types/components/sharing-and-management/resource-share-dialog/unified/adapter.d.ts +21 -1
- package/dist/types/components/sharing-and-management/resource-share-dialog/unified/configs.d.ts +12 -0
- package/dist/types/components/sharing-and-management/resource-share-dialog/unified/invite-combobox.d.ts +5 -0
- package/dist/types/components/sharing-and-management/resource-share-dialog/unified/share-shape.d.ts +7 -0
- package/dist/types/components/sharing-and-management/resource-share-dialog/unified/types.d.ts +2 -0
- package/dist/types/components/sharing-and-management/utils/shares-types.d.ts +8 -0
- package/dist/types/components/sharing-and-management/utils/types.d.ts +2 -0
- package/dist/types/components/surfboard/dashboard-plus.d.ts +1 -1
- package/dist/types/components/ui/resizable.d.ts +1 -1
- package/dist/types/components/visual/column-display-utils.d.ts +1 -1
- package/dist/types/components/visual/kpi-visual/kpi-utils.d.ts +1 -1
- package/dist/types/components/visual/settings/color-format.d.ts +1 -1
- package/dist/types/components/visual/visual-utils.d.ts +1 -1
- package/dist/types/lib/actions/data-point-click-action.d.ts +2 -1
- package/dist/types/lib/charts/area-chart.d.ts +1 -1
- package/dist/types/lib/charts/bar-chart.d.ts +1 -1
- package/dist/types/lib/charts/cartesian-data.d.ts +72 -0
- package/dist/types/lib/charts/cartesian-fields.d.ts +60 -0
- package/dist/types/lib/charts/chart-utils.d.ts +3 -0
- package/dist/types/lib/charts/combo-chart.d.ts +1 -1
- package/dist/types/lib/charts/create-chart.d.ts +1 -1
- package/dist/types/lib/charts/line-chart.d.ts +1 -1
- package/dist/types/lib/charts/shared/category-group-axis-plugin.d.ts +23 -0
- package/dist/types/lib/charts/stacked-line-chart.d.ts +2 -0
- package/dist/types/lib/charts/types.d.ts +1 -7
- package/dist/types/lib/dashboard/normalize-dashboard-for-dirty-check.d.ts +1 -1
- package/dist/types/lib/formatters/cartesian-temporal-presentation.d.ts +6 -1
- package/dist/types/lib/hooks/explorer/use-schemas.d.ts +1 -1
- package/dist/types/lib/hooks/use-dashboard.d.ts +2 -2
- package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +1 -2
- package/dist/types/lib/stores/editor-store.d.ts +1 -2
- package/dist/types/lib/stores/table-actions.d.ts +2 -1
- package/dist/types/lib/types/token-types.d.ts +0 -12
- package/dist/types/lib/utils.d.ts +0 -2
- package/package.json +2 -1
- package/dist/chunks/dashboard-json-Kc_M7nLP.js +0 -75
- package/dist/chunks/editor-action-buttons-s-ByVR9x.js +0 -2019
- package/dist/chunks/report-preferences-dialog-RAp0DAuw.js +0 -723
- package/dist/types/lib/encrypt-utils.d.ts +0 -9
|
@@ -1,34 +1,28 @@
|
|
|
1
1
|
import { jsx as t, jsxs as r, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
-
import Nt, { useState as A, useEffect as
|
|
3
|
-
import { B as T,
|
|
4
|
-
import {
|
|
2
|
+
import Nt, { useState as A, useEffect as K, useMemo as Z, useCallback as W, useLayoutEffect as xt, useRef as ce, useContext as qt } from "react";
|
|
3
|
+
import { B as T, L as re, C as St, _ as z, c as G, u as L, G as me, E as be, as as et, H as Dt, P as Pe, a as Me, b as _e, aN as Gt, aO as Qt, aP as Kt, aQ as Yt, aR as Zt, aS as Xt, Z as Jt } from "./code-highlight-994tgM9v.js";
|
|
4
|
+
import { c0 as rt, aU as Se, aV as De, aX as ke, b1 as kt, aJ as er, c1 as tr, c2 as rr, bQ as Et, b9 as Oe, n as ar, R as nr, c3 as sr, b7 as at, c4 as or, c5 as ir, c6 as Ye, bR as je, bS as We, c7 as At, bT as He, bC as q, b_ as ze, c8 as lr, bB as dr, aW as nt, aY as st, c9 as cr, aT as ur, b0 as hr, bk as Ft, ca as mr, bE as pr, u as fr, ax as qe, H as he, ar as ot, an as It, ao as $e, J as Lt, am as gr, at as br, cb as xr, cc as vr, ap as vt, L as yr, cd as Cr, ce as wr, cf as Nr, cg as Sr, ch as Dr, ci as kr, cj as Bt, ck as Er, cl as Ar, bU as Tt, cm as Fr, cn as Ir, co as Ue, cp as Lr, cq as Br, cr as Tr, aj as Ur, ak as Rr, $ as Vr, _ as Pr, Z as Mr, Y as _r, T as Or, P as zr, cs as $r, ct as jr, cu as Wr, cv as Hr, cw as qr, ah as Gr, cx as Qr, cy as Kr, a5 as Yr, cz as Zr, cA as Xr, cB as Jr } from "./semaphor-ready-indicator-BLRDuLr4.js";
|
|
5
|
+
import { P as ge, A as it, g as lt, h as dt, i as ct, j as ut, k as ht, l as mt, m as Ut, C as ea, b as ta, q as ra, R as Rt, D as aa } from "./pre-block-Cq1RqhZX.js";
|
|
6
|
+
import { L as Ne, m as tt, g as Vt, f as na, S as Pt } from "./switch-XaAACBrJ.js";
|
|
5
7
|
import { L as pt } from "./layout-grid-CiubineE.js";
|
|
6
|
-
import { c as
|
|
7
|
-
import {
|
|
8
|
-
import { v as yt, s as ha } from "./card-config-utils-CAyjC5Tp.js";
|
|
8
|
+
import { c as Ge, X as Qe, C as Mt } from "./x-CXDkqdur.js";
|
|
9
|
+
import { a as ft, V as sa, E as Ze, b as Xe, c as oa, d as ia, L as la, e as da, g as _t, C as Ot, F as ca, h as ua } from "./editor-action-buttons-DahlP57T.js";
|
|
9
10
|
import "./validators-CsdOtZI6.js";
|
|
10
11
|
import "./matrix-operation-contract-D32U2CSw.js";
|
|
11
12
|
import "../value-format-preferences/index.js";
|
|
12
|
-
import { S as
|
|
13
|
+
import { S as ha } from "./search-CJz-QQ0Q.js";
|
|
13
14
|
import { s as Re } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
|
|
15
|
+
import { v as yt, s as ma } from "./card-config-utils-9sv4e-Vb.js";
|
|
14
16
|
import { M as pa } from "./mouse-pointer-2-BZvGk45-.js";
|
|
15
17
|
import { k as fa } from "./matrix-formatter-WBgtebUT.js";
|
|
16
|
-
import "./
|
|
17
|
-
import "./appearance-context-DEYtWinQ.js";
|
|
18
|
-
import "./index-CLIro-EG.js";
|
|
19
|
-
import "./field-aggregations-BQjogiI1.js";
|
|
20
|
-
import "zod";
|
|
21
|
-
import "./matrix-continuation-C4sRcjZU.js";
|
|
22
|
-
import "./color-CJvdlFM_.js";
|
|
23
|
-
import "react-dom";
|
|
24
|
-
import { g as se, d as ga, a as ba } from "./index-D9HDUSye.js";
|
|
18
|
+
import { d as se, e as ga, h as ba } from "./index-CbjuruKe.js";
|
|
25
19
|
/**
|
|
26
20
|
* @license lucide-react v0.453.0 - ISC
|
|
27
21
|
*
|
|
28
22
|
* This source code is licensed under the ISC license.
|
|
29
23
|
* See the LICENSE file in the root directory of this source tree.
|
|
30
24
|
*/
|
|
31
|
-
const xa =
|
|
25
|
+
const xa = Ge("ArrowUpRight", [
|
|
32
26
|
["path", { d: "M7 7h10v10", key: "1tivn9" }],
|
|
33
27
|
["path", { d: "M7 17 17 7", key: "1vkiza" }]
|
|
34
28
|
]);
|
|
@@ -38,7 +32,7 @@ const xa = Ke("ArrowUpRight", [
|
|
|
38
32
|
* This source code is licensed under the ISC license.
|
|
39
33
|
* See the LICENSE file in the root directory of this source tree.
|
|
40
34
|
*/
|
|
41
|
-
const va =
|
|
35
|
+
const va = Ge("CalendarRange", [
|
|
42
36
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
43
37
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
44
38
|
["path", { d: "M3 10h18", key: "8toen8" }],
|
|
@@ -54,7 +48,7 @@ const va = Ke("CalendarRange", [
|
|
|
54
48
|
* This source code is licensed under the ISC license.
|
|
55
49
|
* See the LICENSE file in the root directory of this source tree.
|
|
56
50
|
*/
|
|
57
|
-
const ya =
|
|
51
|
+
const ya = Ge("FileDown", [
|
|
58
52
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
59
53
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
60
54
|
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
@@ -66,7 +60,7 @@ const ya = Ke("FileDown", [
|
|
|
66
60
|
* This source code is licensed under the ISC license.
|
|
67
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
68
62
|
*/
|
|
69
|
-
const Ca =
|
|
63
|
+
const Ca = Ge("Newspaper", [
|
|
70
64
|
[
|
|
71
65
|
"path",
|
|
72
66
|
{
|
|
@@ -101,7 +95,7 @@ function Na({
|
|
|
101
95
|
isCreating: n
|
|
102
96
|
}) {
|
|
103
97
|
const i = rt("interactive"), [s, c] = A(""), [m, l] = A("");
|
|
104
|
-
|
|
98
|
+
K(() => {
|
|
105
99
|
e || (c(""), l(""));
|
|
106
100
|
}, [e]);
|
|
107
101
|
const u = () => {
|
|
@@ -133,7 +127,7 @@ function Na({
|
|
|
133
127
|
onClick: () => d(!1),
|
|
134
128
|
"aria-label": "Close",
|
|
135
129
|
disabled: n,
|
|
136
|
-
children: /* @__PURE__ */ t(
|
|
130
|
+
children: /* @__PURE__ */ t(Qe, { className: "h-3.5 w-3.5" })
|
|
137
131
|
}
|
|
138
132
|
)
|
|
139
133
|
] }),
|
|
@@ -142,7 +136,7 @@ function Na({
|
|
|
142
136
|
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
143
137
|
/* @__PURE__ */ t(Ne, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
|
|
144
138
|
/* @__PURE__ */ t(
|
|
145
|
-
|
|
139
|
+
tt,
|
|
146
140
|
{
|
|
147
141
|
id: "visual-title",
|
|
148
142
|
size: "sm",
|
|
@@ -159,7 +153,7 @@ function Na({
|
|
|
159
153
|
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
160
154
|
/* @__PURE__ */ t(Ne, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
|
|
161
155
|
/* @__PURE__ */ t(
|
|
162
|
-
|
|
156
|
+
tt,
|
|
163
157
|
{
|
|
164
158
|
id: "visual-description",
|
|
165
159
|
size: "sm",
|
|
@@ -220,13 +214,13 @@ function Sa(e, a) {
|
|
|
220
214
|
}
|
|
221
215
|
function Da(e) {
|
|
222
216
|
const a = (e || "").toLowerCase();
|
|
223
|
-
return a.includes("table") ?
|
|
217
|
+
return a.includes("table") ? Vt : a.includes("pie") || a.includes("donut") ? or : a.includes("line") ? ir : a.includes("bar") ? na : pt;
|
|
224
218
|
}
|
|
225
219
|
function ka({ visual: e }) {
|
|
226
220
|
const a = e.ownership.status === "public" ? "Public" : e.ownership.status === "shared" || e.ownership.sharedCount > 0 ? "Shared" : "Private";
|
|
227
221
|
return /* @__PURE__ */ t("span", { className: "inline-flex items-center rounded-[4px] border border-border/60 px-1.5 py-px text-[11px] text-muted-foreground", children: a });
|
|
228
222
|
}
|
|
229
|
-
function
|
|
223
|
+
function zn({
|
|
230
224
|
open: e,
|
|
231
225
|
onOpenChange: a
|
|
232
226
|
}) {
|
|
@@ -238,26 +232,26 @@ function Kn({
|
|
|
238
232
|
c(/* @__PURE__ */ new Set()), d(null), h(null), g(!1), x(null);
|
|
239
233
|
}, w = () => {
|
|
240
234
|
a(!1), C();
|
|
241
|
-
}, { selectVisual: E } =
|
|
235
|
+
}, { selectVisual: E } = kt(), { handleAddLibraryVisual: U, handleEditLibraryVisual: b } = ft(), { isConsoleMode: y } = er(), {
|
|
242
236
|
resources: R,
|
|
243
|
-
isLoading:
|
|
237
|
+
isLoading: F,
|
|
244
238
|
isError: H,
|
|
245
|
-
createResource:
|
|
239
|
+
createResource: I,
|
|
246
240
|
updateResource: P,
|
|
247
|
-
deleteResourceAsync:
|
|
241
|
+
deleteResourceAsync: X,
|
|
248
242
|
duplicateResource: ae,
|
|
249
243
|
isCreating: Ee,
|
|
250
244
|
isDeleting: oe
|
|
251
|
-
} =
|
|
245
|
+
} = tr(
|
|
252
246
|
void 0,
|
|
253
247
|
(v) => {
|
|
254
248
|
l(!1), v && (E(v), b(v), w());
|
|
255
249
|
}
|
|
256
250
|
), {
|
|
257
251
|
startUpdating: Ae,
|
|
258
|
-
stopUpdating:
|
|
252
|
+
stopUpdating: Fe,
|
|
259
253
|
isUpdating: ie
|
|
260
|
-
} =
|
|
254
|
+
} = rr(), j = R, J = Z(() => {
|
|
261
255
|
const v = n.trim().toLowerCase();
|
|
262
256
|
return v ? j.filter(
|
|
263
257
|
(B) => {
|
|
@@ -265,14 +259,14 @@ function Kn({
|
|
|
265
259
|
return ((M = B.title) == null ? void 0 : M.toLowerCase().includes(v)) || ((te = B.description) == null ? void 0 : te.toLowerCase().includes(v)) || ((de = B.kind) == null ? void 0 : de.toLowerCase().includes(v));
|
|
266
260
|
}
|
|
267
261
|
) : j;
|
|
268
|
-
}, [n, j]), le =
|
|
262
|
+
}, [n, j]), le = Z(
|
|
269
263
|
() => j.filter(
|
|
270
264
|
(v) => s.has(v.id)
|
|
271
265
|
),
|
|
272
266
|
[s, j]
|
|
273
267
|
), ee = le.filter(
|
|
274
268
|
(v) => v.permissions.canDelete
|
|
275
|
-
),
|
|
269
|
+
), Ie = le.filter(
|
|
276
270
|
(v) => v.permissions.canShare
|
|
277
271
|
), xe = J.length > 0 && J.every(
|
|
278
272
|
(v) => s.has(v.id)
|
|
@@ -281,7 +275,7 @@ function Kn({
|
|
|
281
275
|
), pe = (v) => {
|
|
282
276
|
const B = new Set(s);
|
|
283
277
|
v(B), c(B);
|
|
284
|
-
},
|
|
278
|
+
}, Y = (v) => {
|
|
285
279
|
pe((B) => {
|
|
286
280
|
B.has(v) ? B.delete(v) : B.add(v);
|
|
287
281
|
});
|
|
@@ -294,9 +288,9 @@ function Kn({
|
|
|
294
288
|
(M) => B.add(M.id)
|
|
295
289
|
), B;
|
|
296
290
|
});
|
|
297
|
-
},
|
|
291
|
+
}, _ = async (v) => {
|
|
298
292
|
(await U(v)).success && w();
|
|
299
|
-
},
|
|
293
|
+
}, O = async () => {
|
|
300
294
|
const v = le;
|
|
301
295
|
if (v.length === 0) return;
|
|
302
296
|
let B = !1;
|
|
@@ -318,11 +312,11 @@ function Kn({
|
|
|
318
312
|
return;
|
|
319
313
|
}
|
|
320
314
|
x(null), g(!0);
|
|
321
|
-
},
|
|
315
|
+
}, Ke = async () => {
|
|
322
316
|
const v = k ? [k] : ee;
|
|
323
317
|
try {
|
|
324
318
|
for (const B of v)
|
|
325
|
-
await
|
|
319
|
+
await X(B.id);
|
|
326
320
|
c((B) => {
|
|
327
321
|
const M = new Set(B);
|
|
328
322
|
return v.forEach(
|
|
@@ -360,18 +354,18 @@ function Kn({
|
|
|
360
354
|
},
|
|
361
355
|
{
|
|
362
356
|
onSuccess: () => {
|
|
363
|
-
|
|
357
|
+
Fe(p.id, de), h(null);
|
|
364
358
|
},
|
|
365
359
|
onError: () => {
|
|
366
|
-
|
|
360
|
+
Fe(p.id, de);
|
|
367
361
|
}
|
|
368
362
|
}
|
|
369
363
|
);
|
|
370
|
-
},
|
|
364
|
+
}, Q = (v) => {
|
|
371
365
|
a(v), v || C();
|
|
372
366
|
}, we = k ? 1 : ee.length;
|
|
373
367
|
return /* @__PURE__ */ r($, { children: [
|
|
374
|
-
/* @__PURE__ */ t(Se, { open: e, onOpenChange:
|
|
368
|
+
/* @__PURE__ */ t(Se, { open: e, onOpenChange: Q, children: /* @__PURE__ */ r(
|
|
375
369
|
De,
|
|
376
370
|
{
|
|
377
371
|
showCloseButton: !1,
|
|
@@ -380,7 +374,7 @@ function Kn({
|
|
|
380
374
|
children: [
|
|
381
375
|
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
382
376
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
383
|
-
/* @__PURE__ */ t(
|
|
377
|
+
/* @__PURE__ */ t(Vt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
384
378
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
385
379
|
/* @__PURE__ */ t(ke, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
|
|
386
380
|
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
|
|
@@ -392,7 +386,7 @@ function Kn({
|
|
|
392
386
|
size: "xs",
|
|
393
387
|
variant: "ghost",
|
|
394
388
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
395
|
-
onClick: () =>
|
|
389
|
+
onClick: () => Q(!1),
|
|
396
390
|
"aria-label": "Close visuals library",
|
|
397
391
|
children: "×"
|
|
398
392
|
}
|
|
@@ -400,7 +394,7 @@ function Kn({
|
|
|
400
394
|
] }),
|
|
401
395
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center gap-2 border-b border-border/60 px-3 py-2", children: [
|
|
402
396
|
/* @__PURE__ */ r("div", { className: "relative min-w-[12rem] flex-1 md:max-w-md", children: [
|
|
403
|
-
/* @__PURE__ */ t(
|
|
397
|
+
/* @__PURE__ */ t(ha, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
404
398
|
/* @__PURE__ */ t(
|
|
405
399
|
"input",
|
|
406
400
|
{
|
|
@@ -427,7 +421,7 @@ function Kn({
|
|
|
427
421
|
}
|
|
428
422
|
)
|
|
429
423
|
] }),
|
|
430
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children:
|
|
424
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: F ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(wa, {}) }) : H ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ t("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : J.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
|
|
431
425
|
/* @__PURE__ */ t(pt, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
432
426
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: n ? "No visuals found" : "No visuals yet" }),
|
|
433
427
|
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: n ? "Try a different search." : "Create a saved visual to add it here." })
|
|
@@ -439,8 +433,8 @@ function Kn({
|
|
|
439
433
|
allFilteredSelected: xe,
|
|
440
434
|
someFilteredSelected: ue,
|
|
441
435
|
onSelectAll: ve,
|
|
442
|
-
onToggleSelection:
|
|
443
|
-
onAddVisual:
|
|
436
|
+
onToggleSelection: Y,
|
|
437
|
+
onAddVisual: _,
|
|
444
438
|
onOpenVisual: ne,
|
|
445
439
|
onEditDetails: h,
|
|
446
440
|
onShareVisual: d,
|
|
@@ -475,9 +469,9 @@ function Kn({
|
|
|
475
469
|
size: "xs",
|
|
476
470
|
variant: "outline",
|
|
477
471
|
onClick: ye,
|
|
478
|
-
disabled: le.length !== 1 ||
|
|
472
|
+
disabled: le.length !== 1 || Ie.length !== 1,
|
|
479
473
|
children: [
|
|
480
|
-
/* @__PURE__ */ t(
|
|
474
|
+
/* @__PURE__ */ t(Et, { className: "h-3.5 w-3.5" }),
|
|
481
475
|
"Share"
|
|
482
476
|
]
|
|
483
477
|
}
|
|
@@ -491,7 +485,7 @@ function Kn({
|
|
|
491
485
|
onClick: Le,
|
|
492
486
|
disabled: ee.length === 0,
|
|
493
487
|
children: [
|
|
494
|
-
/* @__PURE__ */ t(
|
|
488
|
+
/* @__PURE__ */ t(Oe, { className: "h-3.5 w-3.5" }),
|
|
495
489
|
"Delete ",
|
|
496
490
|
ee.length || s.size
|
|
497
491
|
]
|
|
@@ -504,7 +498,7 @@ function Kn({
|
|
|
504
498
|
{
|
|
505
499
|
size: "xs",
|
|
506
500
|
variant: "outline",
|
|
507
|
-
onClick: () =>
|
|
501
|
+
onClick: () => Q(!1),
|
|
508
502
|
children: "Close"
|
|
509
503
|
}
|
|
510
504
|
),
|
|
@@ -512,10 +506,10 @@ function Kn({
|
|
|
512
506
|
T,
|
|
513
507
|
{
|
|
514
508
|
size: "xs",
|
|
515
|
-
onClick:
|
|
509
|
+
onClick: O,
|
|
516
510
|
disabled: s.size === 0,
|
|
517
511
|
children: [
|
|
518
|
-
/* @__PURE__ */ t(
|
|
512
|
+
/* @__PURE__ */ t(St, { className: "h-3.5 w-3.5" }),
|
|
519
513
|
s.size === 0 ? "Add to dashboard" : `Add ${s.size} visual${s.size === 1 ? "" : "s"}`
|
|
520
514
|
]
|
|
521
515
|
}
|
|
@@ -530,20 +524,20 @@ function Kn({
|
|
|
530
524
|
{
|
|
531
525
|
open: m,
|
|
532
526
|
onOpenChange: l,
|
|
533
|
-
onSubmit:
|
|
527
|
+
onSubmit: I,
|
|
534
528
|
isCreating: Ee
|
|
535
529
|
}
|
|
536
530
|
),
|
|
537
531
|
u && /* @__PURE__ */ t(
|
|
538
|
-
|
|
532
|
+
ar,
|
|
539
533
|
{
|
|
540
534
|
resource: u,
|
|
541
|
-
resourceType:
|
|
535
|
+
resourceType: nr.VISUAL,
|
|
542
536
|
onClose: () => d(null)
|
|
543
537
|
}
|
|
544
538
|
),
|
|
545
539
|
p && /* @__PURE__ */ t(
|
|
546
|
-
|
|
540
|
+
sr,
|
|
547
541
|
{
|
|
548
542
|
open: !!p,
|
|
549
543
|
resourceLabel: "Visual",
|
|
@@ -555,34 +549,34 @@ function Kn({
|
|
|
555
549
|
}
|
|
556
550
|
),
|
|
557
551
|
/* @__PURE__ */ t(
|
|
558
|
-
|
|
552
|
+
it,
|
|
559
553
|
{
|
|
560
554
|
open: f,
|
|
561
555
|
onOpenChange: (v) => {
|
|
562
556
|
!v && oe || (g(v), v || x(null));
|
|
563
557
|
},
|
|
564
|
-
children: /* @__PURE__ */ r(
|
|
565
|
-
/* @__PURE__ */ r(
|
|
566
|
-
/* @__PURE__ */ r(
|
|
558
|
+
children: /* @__PURE__ */ r(lt, { children: [
|
|
559
|
+
/* @__PURE__ */ r(dt, { children: [
|
|
560
|
+
/* @__PURE__ */ r(ct, { children: [
|
|
567
561
|
"Delete ",
|
|
568
562
|
we,
|
|
569
563
|
" visual",
|
|
570
564
|
we === 1 ? "" : "s",
|
|
571
565
|
"?"
|
|
572
566
|
] }),
|
|
573
|
-
/* @__PURE__ */ t(
|
|
567
|
+
/* @__PURE__ */ t(ut, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
|
|
574
568
|
] }),
|
|
575
|
-
/* @__PURE__ */ r(
|
|
576
|
-
/* @__PURE__ */ t(
|
|
569
|
+
/* @__PURE__ */ r(ht, { children: [
|
|
570
|
+
/* @__PURE__ */ t(mt, { disabled: oe, children: "Cancel" }),
|
|
577
571
|
/* @__PURE__ */ r(
|
|
578
|
-
|
|
572
|
+
Ut,
|
|
579
573
|
{
|
|
580
574
|
onClick: (v) => {
|
|
581
|
-
v.preventDefault(),
|
|
575
|
+
v.preventDefault(), Ke();
|
|
582
576
|
},
|
|
583
577
|
disabled: oe || we === 0,
|
|
584
578
|
children: [
|
|
585
|
-
oe ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(
|
|
579
|
+
oe ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(Oe, { className: "h-3.5 w-3.5" }),
|
|
586
580
|
oe ? "Deleting..." : "Delete"
|
|
587
581
|
]
|
|
588
582
|
}
|
|
@@ -613,7 +607,7 @@ function Ea({
|
|
|
613
607
|
return /* @__PURE__ */ r("div", { className: "min-w-[48rem]", children: [
|
|
614
608
|
/* @__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: [
|
|
615
609
|
/* @__PURE__ */ t(
|
|
616
|
-
|
|
610
|
+
at,
|
|
617
611
|
{
|
|
618
612
|
checked: o ? !0 : n ? "indeterminate" : !1,
|
|
619
613
|
onCheckedChange: i,
|
|
@@ -668,13 +662,13 @@ function Aa({
|
|
|
668
662
|
return /* @__PURE__ */ r(
|
|
669
663
|
"div",
|
|
670
664
|
{
|
|
671
|
-
className:
|
|
665
|
+
className: G(
|
|
672
666
|
"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",
|
|
673
667
|
a && "bg-muted/70"
|
|
674
668
|
),
|
|
675
669
|
children: [
|
|
676
670
|
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
677
|
-
|
|
671
|
+
at,
|
|
678
672
|
{
|
|
679
673
|
checked: a,
|
|
680
674
|
onCheckedChange: () => o(e.id),
|
|
@@ -719,7 +713,7 @@ function Aa({
|
|
|
719
713
|
/* @__PURE__ */ t(ka, { visual: e }),
|
|
720
714
|
/* @__PURE__ */ t("span", { className: "text-right tabular-nums text-muted-foreground", children: e.ownership.sharedCount > 0 ? e.ownership.sharedCount : "—" }),
|
|
721
715
|
/* @__PURE__ */ t(
|
|
722
|
-
|
|
716
|
+
Fa,
|
|
723
717
|
{
|
|
724
718
|
visual: e,
|
|
725
719
|
onOpenVisual: i,
|
|
@@ -736,7 +730,7 @@ function Aa({
|
|
|
736
730
|
}
|
|
737
731
|
);
|
|
738
732
|
}
|
|
739
|
-
function
|
|
733
|
+
function Fa({
|
|
740
734
|
visual: e,
|
|
741
735
|
onOpenVisual: a,
|
|
742
736
|
onEditDetails: o,
|
|
@@ -761,7 +755,7 @@ function Ia({
|
|
|
761
755
|
className: "w-7 px-0",
|
|
762
756
|
onClick: () => a(e),
|
|
763
757
|
"aria-label": "Edit visual",
|
|
764
|
-
children: /* @__PURE__ */ t(
|
|
758
|
+
children: /* @__PURE__ */ t(Ye, { className: "h-3.5 w-3.5" })
|
|
765
759
|
}
|
|
766
760
|
),
|
|
767
761
|
/* @__PURE__ */ r(je, { modal: !1, children: [
|
|
@@ -772,7 +766,7 @@ function Ia({
|
|
|
772
766
|
variant: "ghost",
|
|
773
767
|
className: "w-7 px-0",
|
|
774
768
|
"aria-label": "More actions",
|
|
775
|
-
children: /* @__PURE__ */ t(
|
|
769
|
+
children: /* @__PURE__ */ t(At, { className: "h-3.5 w-3.5" })
|
|
776
770
|
}
|
|
777
771
|
) }),
|
|
778
772
|
/* @__PURE__ */ r(
|
|
@@ -781,39 +775,39 @@ function Ia({
|
|
|
781
775
|
align: "end",
|
|
782
776
|
className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
783
777
|
children: [
|
|
784
|
-
/* @__PURE__ */ r(
|
|
785
|
-
/* @__PURE__ */ t(
|
|
778
|
+
/* @__PURE__ */ r(q, { onClick: () => a(e), children: [
|
|
779
|
+
/* @__PURE__ */ t(Ye, { className: "h-3.5 w-3.5" }),
|
|
786
780
|
"Edit visual"
|
|
787
781
|
] }),
|
|
788
782
|
/* @__PURE__ */ r(
|
|
789
|
-
|
|
783
|
+
q,
|
|
790
784
|
{
|
|
791
785
|
onClick: () => s(e.id),
|
|
792
786
|
disabled: c === e.id,
|
|
793
787
|
children: [
|
|
794
|
-
c === e.id ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(
|
|
788
|
+
c === e.id ? /* @__PURE__ */ t(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(ea, { className: "h-3.5 w-3.5" }),
|
|
795
789
|
c === e.id ? "Duplicating..." : "Duplicate"
|
|
796
790
|
]
|
|
797
791
|
}
|
|
798
792
|
),
|
|
799
|
-
e.permissions.canEdit && /* @__PURE__ */ r(
|
|
800
|
-
/* @__PURE__ */ t(
|
|
793
|
+
e.permissions.canEdit && /* @__PURE__ */ r(q, { onClick: () => o(e), children: [
|
|
794
|
+
/* @__PURE__ */ t(Ye, { className: "h-3.5 w-3.5" }),
|
|
801
795
|
"Edit details"
|
|
802
796
|
] }),
|
|
803
|
-
e.permissions.canShare && /* @__PURE__ */ r(
|
|
804
|
-
/* @__PURE__ */ t(
|
|
797
|
+
e.permissions.canShare && /* @__PURE__ */ r(q, { onClick: () => n(e), children: [
|
|
798
|
+
/* @__PURE__ */ t(Et, { className: "h-3.5 w-3.5" }),
|
|
805
799
|
"Share"
|
|
806
800
|
] }),
|
|
807
801
|
e.permissions.canDelete && /* @__PURE__ */ r($, { children: [
|
|
808
802
|
/* @__PURE__ */ t(ze, {}),
|
|
809
803
|
/* @__PURE__ */ r(
|
|
810
|
-
|
|
804
|
+
q,
|
|
811
805
|
{
|
|
812
806
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
813
807
|
onClick: () => i(e),
|
|
814
808
|
disabled: m,
|
|
815
809
|
children: [
|
|
816
|
-
/* @__PURE__ */ t(
|
|
810
|
+
/* @__PURE__ */ t(Oe, { className: "h-3.5 w-3.5" }),
|
|
817
811
|
m ? "Deleting..." : "Delete"
|
|
818
812
|
]
|
|
819
813
|
}
|
|
@@ -822,11 +816,11 @@ function Ia({
|
|
|
822
816
|
/* @__PURE__ */ t(ze, {}),
|
|
823
817
|
/* @__PURE__ */ r("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
|
|
824
818
|
$t(e, l) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
825
|
-
/* @__PURE__ */ t(
|
|
819
|
+
/* @__PURE__ */ t(lr, { className: "h-3 w-3" }),
|
|
826
820
|
/* @__PURE__ */ t("span", { className: "truncate", children: gt(e, l) })
|
|
827
821
|
] }),
|
|
828
822
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
829
|
-
/* @__PURE__ */ t(
|
|
823
|
+
/* @__PURE__ */ t(dr, { className: "h-3 w-3" }),
|
|
830
824
|
/* @__PURE__ */ t("span", { children: zt(e.updatedAt) })
|
|
831
825
|
] })
|
|
832
826
|
] })
|
|
@@ -838,7 +832,7 @@ function Ia({
|
|
|
838
832
|
}
|
|
839
833
|
);
|
|
840
834
|
}
|
|
841
|
-
function
|
|
835
|
+
function $n(e, a, o = !1) {
|
|
842
836
|
const n = L((u) => u.dashboard), i = L(
|
|
843
837
|
(u) => u.isDashboardEditing
|
|
844
838
|
), s = L(
|
|
@@ -850,7 +844,7 @@ function qn(e, a, o = !1) {
|
|
|
850
844
|
xt(() => (L.setState({ checkUnsavedDashboardChanges: c }), () => {
|
|
851
845
|
L.getState().checkUnsavedDashboardChanges === c && L.setState({ checkUnsavedDashboardChanges: null });
|
|
852
846
|
}), [c]);
|
|
853
|
-
const m =
|
|
847
|
+
const m = Z(() => !o || a || !n || i && (!e || n.id !== e.id) ? null : {
|
|
854
848
|
dashboardId: n.id,
|
|
855
849
|
dirty: i && e ? Re(n) !== Re(e) : !1
|
|
856
850
|
}, [
|
|
@@ -877,7 +871,7 @@ function qn(e, a, o = !1) {
|
|
|
877
871
|
}));
|
|
878
872
|
}, [m, s]), c;
|
|
879
873
|
}
|
|
880
|
-
function
|
|
874
|
+
function Ia({
|
|
881
875
|
open: e,
|
|
882
876
|
onOpenChange: a,
|
|
883
877
|
isLibraryVisual: o,
|
|
@@ -921,7 +915,7 @@ function Fa({
|
|
|
921
915
|
});
|
|
922
916
|
};
|
|
923
917
|
return /* @__PURE__ */ t(Se, { open: e, onOpenChange: a, children: /* @__PURE__ */ r(De, { className: "sm:max-w-[500px]", children: [
|
|
924
|
-
/* @__PURE__ */ r(
|
|
918
|
+
/* @__PURE__ */ r(nt, { children: [
|
|
925
919
|
/* @__PURE__ */ r(ke, { className: "flex items-center gap-2", children: [
|
|
926
920
|
/* @__PURE__ */ t("span", { children: "Save Visual As" }),
|
|
927
921
|
h.badgeType !== "local" && /* @__PURE__ */ t(
|
|
@@ -933,13 +927,13 @@ function Fa({
|
|
|
933
927
|
}
|
|
934
928
|
)
|
|
935
929
|
] }),
|
|
936
|
-
/* @__PURE__ */ t(
|
|
930
|
+
/* @__PURE__ */ t(st, { children: h.description })
|
|
937
931
|
] }),
|
|
938
932
|
/* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
|
|
939
933
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
940
934
|
/* @__PURE__ */ t(Ne, { htmlFor: "name", children: "Name" }),
|
|
941
935
|
/* @__PURE__ */ t(
|
|
942
|
-
|
|
936
|
+
tt,
|
|
943
937
|
{
|
|
944
938
|
id: "name",
|
|
945
939
|
value: m,
|
|
@@ -952,7 +946,7 @@ function Fa({
|
|
|
952
946
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
953
947
|
/* @__PURE__ */ t(Ne, { htmlFor: "description", children: "Description (optional)" }),
|
|
954
948
|
/* @__PURE__ */ t(
|
|
955
|
-
|
|
949
|
+
cr,
|
|
956
950
|
{
|
|
957
951
|
id: "description",
|
|
958
952
|
value: u,
|
|
@@ -964,7 +958,7 @@ function Fa({
|
|
|
964
958
|
)
|
|
965
959
|
] })
|
|
966
960
|
] }),
|
|
967
|
-
/* @__PURE__ */ r(
|
|
961
|
+
/* @__PURE__ */ r(ur, { children: [
|
|
968
962
|
/* @__PURE__ */ t(
|
|
969
963
|
T,
|
|
970
964
|
{
|
|
@@ -982,10 +976,10 @@ function Fa({
|
|
|
982
976
|
] }) });
|
|
983
977
|
}
|
|
984
978
|
function La() {
|
|
985
|
-
const [e, a] = A(!1), [o, n] = A(!1), [i, s] = A(null), [c, m] = A(null), l = me((b) => b.frame), u = me((b) => b.card), d =
|
|
979
|
+
const [e, a] = A(!1), [o, n] = A(!1), [i, s] = A(null), [c, m] = A(null), l = me((b) => b.frame), u = me((b) => b.card), d = hr(), p = L((b) => b.selectedSheetId), h = L((b) => b.dashboard), { getUpdatedFrame: f } = ft(), { selectVisual: g } = kt(), { addFrame: k, setSelectedFrameId: x, setIsVisualEditing: D } = be(), S = Ft(), C = !!(l != null && l.visualId), w = (() => {
|
|
986
980
|
var b, y;
|
|
987
981
|
return ((b = l == null ? void 0 : l.cards) == null ? void 0 : b.length) === 1 && ((y = l.cards[0]) != null && y.title) ? l.cards[0].title : d != null && d.title ? d.title : (u == null ? void 0 : u.title) || "Untitled Visual";
|
|
988
|
-
})(), E =
|
|
982
|
+
})(), E = mr((b) => {
|
|
989
983
|
b != null && b.id && (g(b), o && i && c && p && (async () => {
|
|
990
984
|
try {
|
|
991
985
|
const y = {
|
|
@@ -1016,7 +1010,7 @@ function La() {
|
|
|
1016
1010
|
z.error("No sheet selected");
|
|
1017
1011
|
return;
|
|
1018
1012
|
}
|
|
1019
|
-
const y = f(),
|
|
1013
|
+
const y = f(), F = y.cards.length === 1 ? {
|
|
1020
1014
|
...y,
|
|
1021
1015
|
cards: y.cards.map((H) => ({
|
|
1022
1016
|
...H,
|
|
@@ -1028,8 +1022,8 @@ function La() {
|
|
|
1028
1022
|
let H = null;
|
|
1029
1023
|
if (b.saveToCurrentDashboard)
|
|
1030
1024
|
try {
|
|
1031
|
-
H = await S(
|
|
1032
|
-
previousFrame:
|
|
1025
|
+
H = await S(F, {
|
|
1026
|
+
previousFrame: et(h, F.id)
|
|
1033
1027
|
});
|
|
1034
1028
|
} catch (P) {
|
|
1035
1029
|
console.error(
|
|
@@ -1040,34 +1034,34 @@ function La() {
|
|
|
1040
1034
|
);
|
|
1041
1035
|
return;
|
|
1042
1036
|
}
|
|
1043
|
-
n(b.saveToCurrentDashboard), s(
|
|
1044
|
-
const
|
|
1037
|
+
n(b.saveToCurrentDashboard), s(F), m(H);
|
|
1038
|
+
const I = {
|
|
1045
1039
|
title: b.name,
|
|
1046
1040
|
description: b.description,
|
|
1047
|
-
frameObject:
|
|
1041
|
+
frameObject: F,
|
|
1048
1042
|
// Card title synced for single-card frames
|
|
1049
1043
|
isPrivate: !1
|
|
1050
1044
|
};
|
|
1051
|
-
E.mutate(
|
|
1045
|
+
E.mutate(I);
|
|
1052
1046
|
} else if (b.saveToCurrentDashboard) {
|
|
1053
1047
|
const H = {
|
|
1054
|
-
...
|
|
1048
|
+
...F,
|
|
1055
1049
|
// Card title already synced
|
|
1056
1050
|
id: yt(),
|
|
1057
1051
|
visualId: void 0
|
|
1058
1052
|
// Explicitly no visualId for local visuals
|
|
1059
1053
|
};
|
|
1060
1054
|
try {
|
|
1061
|
-
const
|
|
1062
|
-
previousFrame:
|
|
1055
|
+
const I = await S(F, {
|
|
1056
|
+
previousFrame: et(h, F.id)
|
|
1063
1057
|
});
|
|
1064
1058
|
k(p, H, {
|
|
1065
1059
|
position: "end",
|
|
1066
|
-
semanticExecutionPayload:
|
|
1060
|
+
semanticExecutionPayload: I
|
|
1067
1061
|
}), x(H.id), z.success("Visual saved to dashboard"), a(!1), D(!1);
|
|
1068
|
-
} catch (
|
|
1069
|
-
console.error("Failed to save visual to dashboard:",
|
|
1070
|
-
|
|
1062
|
+
} catch (I) {
|
|
1063
|
+
console.error("Failed to save visual to dashboard:", I), z.error(
|
|
1064
|
+
I instanceof Error ? I.message : "Failed to prepare semantic metadata for the visual"
|
|
1071
1065
|
);
|
|
1072
1066
|
}
|
|
1073
1067
|
}
|
|
@@ -1077,8 +1071,8 @@ function La() {
|
|
|
1077
1071
|
isSaving: E.isPending
|
|
1078
1072
|
};
|
|
1079
1073
|
}
|
|
1080
|
-
function
|
|
1081
|
-
const { isInspectionMode: a } =
|
|
1074
|
+
function jn(e = {}) {
|
|
1075
|
+
const { isInspectionMode: a } = pr(), o = me((I) => I.frame), n = me((I) => I.editorContext), i = fr((I) => I.selectedVisual), s = L((I) => I.selectedFrameId), c = L((I) => I.selectedSheetId), m = L((I) => I.dashboard), { setIsVisualEditing: l, updateFrame: u } = be(), [d, p] = A(!1), [h, f] = A("both"), g = Ft(), k = (n == null ? void 0 : n.type) === "documentSection", x = !!(o != null && o.visualId || i != null && i.id), D = !!(o != null && o.visualId && s), S = x && !D, {
|
|
1082
1076
|
saveAsDialogOpen: C,
|
|
1083
1077
|
setSaveAsDialogOpen: w,
|
|
1084
1078
|
handleSaveAs: E,
|
|
@@ -1089,20 +1083,20 @@ function Qn(e = {}) {
|
|
|
1089
1083
|
if (a)
|
|
1090
1084
|
return /* @__PURE__ */ r($, { children: [
|
|
1091
1085
|
/* @__PURE__ */ t(
|
|
1092
|
-
|
|
1086
|
+
Ze,
|
|
1093
1087
|
{
|
|
1094
1088
|
className: "rounded-control",
|
|
1095
1089
|
variant: "default"
|
|
1096
1090
|
}
|
|
1097
1091
|
),
|
|
1098
|
-
/* @__PURE__ */ t(
|
|
1092
|
+
/* @__PURE__ */ t(Xe, {})
|
|
1099
1093
|
] });
|
|
1100
1094
|
if (k)
|
|
1101
1095
|
return /* @__PURE__ */ r($, { children: [
|
|
1102
|
-
/* @__PURE__ */ t(
|
|
1103
|
-
/* @__PURE__ */ t(
|
|
1096
|
+
/* @__PURE__ */ t(Ze, { className: "rounded-control", variant: "default" }),
|
|
1097
|
+
/* @__PURE__ */ t(Xe, {})
|
|
1104
1098
|
] });
|
|
1105
|
-
const
|
|
1099
|
+
const F = async () => {
|
|
1106
1100
|
if (!c) {
|
|
1107
1101
|
z.error("No sheet selected");
|
|
1108
1102
|
return;
|
|
@@ -1112,10 +1106,10 @@ function Qn(e = {}) {
|
|
|
1112
1106
|
const P = {
|
|
1113
1107
|
...R(),
|
|
1114
1108
|
visualId: void 0
|
|
1115
|
-
},
|
|
1109
|
+
}, X = et(m, P.id);
|
|
1116
1110
|
try {
|
|
1117
1111
|
const ae = await g(P, {
|
|
1118
|
-
previousFrame:
|
|
1112
|
+
previousFrame: X
|
|
1119
1113
|
});
|
|
1120
1114
|
u(c, P, {
|
|
1121
1115
|
semanticExecutionPayload: ae
|
|
@@ -1129,12 +1123,12 @@ function Qn(e = {}) {
|
|
|
1129
1123
|
setTimeout(() => {
|
|
1130
1124
|
p(!1), z.success("Changes applied. Visual is now local to this dashboard"), l(!1);
|
|
1131
1125
|
}, 300);
|
|
1132
|
-
}, H = (
|
|
1133
|
-
f(
|
|
1126
|
+
}, H = (I) => {
|
|
1127
|
+
f(I), w(!0);
|
|
1134
1128
|
};
|
|
1135
1129
|
return /* @__PURE__ */ r($, { children: [
|
|
1136
1130
|
/* @__PURE__ */ r("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
|
|
1137
|
-
!x && /* @__PURE__ */ t(
|
|
1131
|
+
!x && /* @__PURE__ */ t(Ze, { className: "!rounded-none", variant: "default" }),
|
|
1138
1132
|
x && S && /* @__PURE__ */ t(oa, { className: "!rounded-none", variant: "default" }),
|
|
1139
1133
|
x && D && /* @__PURE__ */ t(ia, { className: "!rounded-none" }),
|
|
1140
1134
|
/* @__PURE__ */ r(je, { modal: !1, children: [
|
|
@@ -1157,12 +1151,12 @@ function Qn(e = {}) {
|
|
|
1157
1151
|
children: [
|
|
1158
1152
|
D && /* @__PURE__ */ r($, { children: [
|
|
1159
1153
|
/* @__PURE__ */ r(
|
|
1160
|
-
|
|
1154
|
+
q,
|
|
1161
1155
|
{
|
|
1162
|
-
onClick:
|
|
1156
|
+
onClick: F,
|
|
1163
1157
|
disabled: d,
|
|
1164
1158
|
children: [
|
|
1165
|
-
/* @__PURE__ */ t(
|
|
1159
|
+
/* @__PURE__ */ t(St, { className: "h-3.5 w-3.5" }),
|
|
1166
1160
|
d ? "Applying..." : "Apply Locally"
|
|
1167
1161
|
]
|
|
1168
1162
|
}
|
|
@@ -1170,7 +1164,7 @@ function Qn(e = {}) {
|
|
|
1170
1164
|
/* @__PURE__ */ t(ze, {})
|
|
1171
1165
|
] }),
|
|
1172
1166
|
/* @__PURE__ */ r(
|
|
1173
|
-
|
|
1167
|
+
q,
|
|
1174
1168
|
{
|
|
1175
1169
|
onClick: () => H("local"),
|
|
1176
1170
|
disabled: y,
|
|
@@ -1181,7 +1175,7 @@ function Qn(e = {}) {
|
|
|
1181
1175
|
}
|
|
1182
1176
|
),
|
|
1183
1177
|
/* @__PURE__ */ r(
|
|
1184
|
-
|
|
1178
|
+
q,
|
|
1185
1179
|
{
|
|
1186
1180
|
onClick: () => H("library"),
|
|
1187
1181
|
disabled: y,
|
|
@@ -1192,7 +1186,7 @@ function Qn(e = {}) {
|
|
|
1192
1186
|
}
|
|
1193
1187
|
),
|
|
1194
1188
|
/* @__PURE__ */ r(
|
|
1195
|
-
|
|
1189
|
+
q,
|
|
1196
1190
|
{
|
|
1197
1191
|
onClick: () => H("both"),
|
|
1198
1192
|
disabled: y,
|
|
@@ -1207,13 +1201,13 @@ function Qn(e = {}) {
|
|
|
1207
1201
|
)
|
|
1208
1202
|
] })
|
|
1209
1203
|
] }),
|
|
1210
|
-
/* @__PURE__ */ t(
|
|
1204
|
+
/* @__PURE__ */ t(Xe, {}),
|
|
1211
1205
|
/* @__PURE__ */ t(
|
|
1212
|
-
|
|
1206
|
+
Ia,
|
|
1213
1207
|
{
|
|
1214
1208
|
open: C,
|
|
1215
|
-
onOpenChange: (
|
|
1216
|
-
y || w(
|
|
1209
|
+
onOpenChange: (I) => {
|
|
1210
|
+
y || w(I);
|
|
1217
1211
|
},
|
|
1218
1212
|
isLibraryVisual: U,
|
|
1219
1213
|
currentVisualName: b,
|
|
@@ -1224,11 +1218,11 @@ function Qn(e = {}) {
|
|
|
1224
1218
|
)
|
|
1225
1219
|
] });
|
|
1226
1220
|
}
|
|
1227
|
-
function
|
|
1228
|
-
const a = me((d) => d.isDevMode), o = me((d) => d.card.type), n = L((d) => d.isVisualEditing), { setIsDevMode: i } =
|
|
1229
|
-
if (!n || !c || !
|
|
1221
|
+
function Wn({ className: e }) {
|
|
1222
|
+
const a = me((d) => d.isDevMode), o = me((d) => d.card.type), n = L((d) => d.isVisualEditing), { setIsDevMode: i } = Dt(), { config: s } = qt(ta).tokenProps, c = (s == null ? void 0 : s.showAdvancedMode) !== !1;
|
|
1223
|
+
if (!n || !c || !ma(o))
|
|
1230
1224
|
return null;
|
|
1231
|
-
const m = a ? pa :
|
|
1225
|
+
const m = a ? pa : ra, l = a ? "Visual editor" : "SQL editor", u = a ? "Switch to visual editor" : "Switch to SQL editor";
|
|
1232
1226
|
return /* @__PURE__ */ r(
|
|
1233
1227
|
"button",
|
|
1234
1228
|
{
|
|
@@ -1236,7 +1230,7 @@ function Xn({ className: e }) {
|
|
|
1236
1230
|
"aria-label": u,
|
|
1237
1231
|
title: u,
|
|
1238
1232
|
onClick: () => i(!a),
|
|
1239
|
-
className:
|
|
1233
|
+
className: G(
|
|
1240
1234
|
"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",
|
|
1241
1235
|
e
|
|
1242
1236
|
),
|
|
@@ -1247,7 +1241,7 @@ function Xn({ className: e }) {
|
|
|
1247
1241
|
}
|
|
1248
1242
|
);
|
|
1249
1243
|
}
|
|
1250
|
-
function
|
|
1244
|
+
function Hn({
|
|
1251
1245
|
open: e,
|
|
1252
1246
|
onOpenChange: a,
|
|
1253
1247
|
onSave: o,
|
|
@@ -1259,14 +1253,14 @@ function Yn({
|
|
|
1259
1253
|
discardLabel: l = "Discard changes",
|
|
1260
1254
|
saveLabel: u = "Save"
|
|
1261
1255
|
}) {
|
|
1262
|
-
return /* @__PURE__ */ t(
|
|
1256
|
+
return /* @__PURE__ */ t(it, { open: e, onOpenChange: (p) => {
|
|
1263
1257
|
!p && i || a(p);
|
|
1264
|
-
}, children: /* @__PURE__ */ r(
|
|
1265
|
-
/* @__PURE__ */ r(
|
|
1266
|
-
/* @__PURE__ */ t(
|
|
1267
|
-
/* @__PURE__ */ t(
|
|
1258
|
+
}, children: /* @__PURE__ */ r(lt, { children: [
|
|
1259
|
+
/* @__PURE__ */ r(dt, { children: [
|
|
1260
|
+
/* @__PURE__ */ t(ct, { children: s }),
|
|
1261
|
+
/* @__PURE__ */ t(ut, { children: c })
|
|
1268
1262
|
] }),
|
|
1269
|
-
/* @__PURE__ */ r(
|
|
1263
|
+
/* @__PURE__ */ r(ht, { children: [
|
|
1270
1264
|
/* @__PURE__ */ t(
|
|
1271
1265
|
T,
|
|
1272
1266
|
{
|
|
@@ -1279,7 +1273,7 @@ function Yn({
|
|
|
1279
1273
|
children: l
|
|
1280
1274
|
}
|
|
1281
1275
|
),
|
|
1282
|
-
/* @__PURE__ */ t(
|
|
1276
|
+
/* @__PURE__ */ t(mt, { disabled: i, children: m }),
|
|
1283
1277
|
/* @__PURE__ */ t(T, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ r($, { children: [
|
|
1284
1278
|
/* @__PURE__ */ t(re, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
1285
1279
|
"Saving..."
|
|
@@ -1309,16 +1303,16 @@ function Pa(e) {
|
|
|
1309
1303
|
const a = Date.now() - e.getTime();
|
|
1310
1304
|
return a < Ra ? Ba : a < Va ? Ta : Ua;
|
|
1311
1305
|
}
|
|
1312
|
-
function
|
|
1313
|
-
const { authToken: e, tokenProps: a } =
|
|
1306
|
+
function qn() {
|
|
1307
|
+
const { authToken: e, tokenProps: a } = qe(), o = he((h) => h.activeExports), [n, i] = A(
|
|
1314
1308
|
typeof document < "u" ? !document.hidden : !0
|
|
1315
1309
|
), s = ce(null), c = ce(!1), m = ce(void 0), l = a == null ? void 0 : a.apiServiceUrl, u = e == null ? void 0 : e.accessToken, d = W(() => {
|
|
1316
1310
|
const h = he.getState().activeExports;
|
|
1317
1311
|
return Array.from(h.values()).filter(
|
|
1318
|
-
(f) =>
|
|
1312
|
+
(f) => ot(f.status)
|
|
1319
1313
|
);
|
|
1320
1314
|
}, []);
|
|
1321
|
-
|
|
1315
|
+
K(() => {
|
|
1322
1316
|
if (typeof document > "u") return;
|
|
1323
1317
|
const h = () => {
|
|
1324
1318
|
i(!document.hidden);
|
|
@@ -1359,7 +1353,7 @@ function Zn() {
|
|
|
1359
1353
|
const x = await Promise.allSettled(
|
|
1360
1354
|
k.map(async (C) => {
|
|
1361
1355
|
try {
|
|
1362
|
-
const w = await
|
|
1356
|
+
const w = await It(l, u, C.id);
|
|
1363
1357
|
let E;
|
|
1364
1358
|
if (w.status === "completed")
|
|
1365
1359
|
try {
|
|
@@ -1394,18 +1388,18 @@ function Zn() {
|
|
|
1394
1388
|
} else
|
|
1395
1389
|
c.current = !1;
|
|
1396
1390
|
}, [l, u, d]);
|
|
1397
|
-
return
|
|
1391
|
+
return K(() => {
|
|
1398
1392
|
m.current = p;
|
|
1399
|
-
}, [p]),
|
|
1393
|
+
}, [p]), K(() => {
|
|
1400
1394
|
var f;
|
|
1401
1395
|
d().length > 0 && n && !c.current && (c.current = !0, (f = m.current) == null || f.call(m));
|
|
1402
|
-
}, [o, n, d]),
|
|
1396
|
+
}, [o, n, d]), K(() => {
|
|
1403
1397
|
var f;
|
|
1404
1398
|
const h = d();
|
|
1405
1399
|
n && h.length > 0 && !c.current && (c.current = !0, (f = m.current) == null || f.call(m));
|
|
1406
|
-
}, [n, d]),
|
|
1400
|
+
}, [n, d]), K(() => {
|
|
1407
1401
|
!n && s.current && (clearTimeout(s.current), s.current = null, c.current = !1);
|
|
1408
|
-
}, [n]),
|
|
1402
|
+
}, [n]), K(() => () => {
|
|
1409
1403
|
s.current && (clearTimeout(s.current), s.current = null);
|
|
1410
1404
|
}, []), {
|
|
1411
1405
|
isPolling: c.current,
|
|
@@ -1413,13 +1407,13 @@ function Zn() {
|
|
|
1413
1407
|
inProgressCount: d().length
|
|
1414
1408
|
};
|
|
1415
1409
|
}
|
|
1416
|
-
function
|
|
1417
|
-
const { authToken: e, tokenProps: a } =
|
|
1418
|
-
|
|
1410
|
+
function Gn() {
|
|
1411
|
+
const { authToken: e, tokenProps: a } = qe(), o = he((m) => m.activeExports), { addExport: n } = Lt(), i = ce(!1), s = a == null ? void 0 : a.apiServiceUrl, c = e == null ? void 0 : e.accessToken;
|
|
1412
|
+
K(() => {
|
|
1419
1413
|
if (i.current || !s || !c) return;
|
|
1420
1414
|
(async () => {
|
|
1421
1415
|
try {
|
|
1422
|
-
const { exports: l } = await
|
|
1416
|
+
const { exports: l } = await gr(s, c, {
|
|
1423
1417
|
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
1424
1418
|
limit: 20
|
|
1425
1419
|
// Limit to recent exports
|
|
@@ -1452,17 +1446,17 @@ function Jn() {
|
|
|
1452
1446
|
}, [s, c, n, o]);
|
|
1453
1447
|
}
|
|
1454
1448
|
function Ma(e) {
|
|
1455
|
-
return e.title ? e.title :
|
|
1449
|
+
return e.title ? e.title : ot(
|
|
1456
1450
|
e.status
|
|
1457
1451
|
) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
|
|
1458
1452
|
}
|
|
1459
|
-
function
|
|
1453
|
+
function _a({
|
|
1460
1454
|
export: e,
|
|
1461
1455
|
onRemove: a,
|
|
1462
1456
|
onDownload: o
|
|
1463
1457
|
}) {
|
|
1464
1458
|
const [n, i] = A("idle");
|
|
1465
|
-
|
|
1459
|
+
K(() => {
|
|
1466
1460
|
e.downloadUrl && i("idle");
|
|
1467
1461
|
}, [e.downloadUrl]);
|
|
1468
1462
|
const s = async () => {
|
|
@@ -1475,7 +1469,7 @@ function Oa({
|
|
|
1475
1469
|
i(g === "denied" ? "denied" : "idle");
|
|
1476
1470
|
}, c = (g) => {
|
|
1477
1471
|
g.stopPropagation(), a == null || a(e.id);
|
|
1478
|
-
}, m =
|
|
1472
|
+
}, m = ot(e.status), l = (() => {
|
|
1479
1473
|
switch (e.status) {
|
|
1480
1474
|
case "pending":
|
|
1481
1475
|
return "Queued...";
|
|
@@ -1486,7 +1480,7 @@ function Oa({
|
|
|
1486
1480
|
}
|
|
1487
1481
|
})(), u = e.status === "completed" ? "bg-emerald-500" : e.status === "failed" ? "bg-destructive" : e.status === "pending" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", d = e.status === "completed" ? "Ready" : e.status === "failed" ? "Failed" : "In progress", p = fa(e.startedAt, { addSuffix: !0 }), h = [
|
|
1488
1482
|
e.status === "completed" && e.totalRows !== null ? `${e.totalRows.toLocaleString()} rows` : null,
|
|
1489
|
-
e.status === "completed" && e.fileSize ?
|
|
1483
|
+
e.status === "completed" && e.fileSize ? br(e.fileSize) : null
|
|
1490
1484
|
].filter((g) => !!g), f = /* @__PURE__ */ t("span", { className: "text-muted-foreground/50", children: "·" });
|
|
1491
1485
|
return /* @__PURE__ */ r("div", { className: "group flex items-start gap-2.5 px-3 py-2 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
|
|
1492
1486
|
/* @__PURE__ */ t("span", { className: "flex h-5 shrink-0 items-center", "aria-hidden": "true", children: /* @__PURE__ */ t("span", { className: `h-1.5 w-1.5 rounded-full ${u}` }) }),
|
|
@@ -1516,7 +1510,7 @@ function Oa({
|
|
|
1516
1510
|
onClick: c,
|
|
1517
1511
|
"aria-label": "Remove notification",
|
|
1518
1512
|
title: "Remove",
|
|
1519
|
-
children: /* @__PURE__ */ t(
|
|
1513
|
+
children: /* @__PURE__ */ t(Qe, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
|
|
1520
1514
|
}
|
|
1521
1515
|
)
|
|
1522
1516
|
] }),
|
|
@@ -1532,7 +1526,7 @@ function Oa({
|
|
|
1532
1526
|
/* @__PURE__ */ t("span", { children: p })
|
|
1533
1527
|
] }),
|
|
1534
1528
|
e.status === "completed" && n === "denied" && /* @__PURE__ */ r("div", { role: "alert", className: "mt-1 flex items-start gap-1.5 text-[12px] leading-4 text-foreground", children: [
|
|
1535
|
-
/* @__PURE__ */ t(
|
|
1529
|
+
/* @__PURE__ */ t(xr, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
|
|
1536
1530
|
/* @__PURE__ */ t("span", { children: "This link expired. Refresh the tray to sign the file again." })
|
|
1537
1531
|
] }),
|
|
1538
1532
|
m && /* @__PURE__ */ r("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
|
|
@@ -1543,7 +1537,7 @@ function Oa({
|
|
|
1543
1537
|
" ",
|
|
1544
1538
|
/* @__PURE__ */ t("span", { className: "tabular-nums", children: e.progress === null ? `${e.rowsProcessed.toLocaleString()} rows processed` : `${e.progress}% complete` })
|
|
1545
1539
|
] }),
|
|
1546
|
-
e.progress !== null && /* @__PURE__ */ t(
|
|
1540
|
+
e.progress !== null && /* @__PURE__ */ t(vr, { value: e.progress, className: "mt-1.5 h-1" })
|
|
1547
1541
|
] }),
|
|
1548
1542
|
e.status === "failed" && /* @__PURE__ */ r($, { children: [
|
|
1549
1543
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
|
|
@@ -1556,8 +1550,8 @@ function Oa({
|
|
|
1556
1550
|
] })
|
|
1557
1551
|
] });
|
|
1558
1552
|
}
|
|
1559
|
-
function
|
|
1560
|
-
const { authToken: e, tokenProps: a } =
|
|
1553
|
+
function Oa() {
|
|
1554
|
+
const { authToken: e, tokenProps: a } = qe(), o = he((x) => x.activeExports), { clearCompleted: n, removeExport: i, updateExport: s } = Lt(), [c, m] = A(!1), [l, u] = A(!1), d = Array.from(o.values()).sort(
|
|
1561
1555
|
(x, D) => D.startedAt.getTime() - x.startedAt.getTime()
|
|
1562
1556
|
), p = d.some(
|
|
1563
1557
|
(x) => x.status === "completed" || x.status === "failed"
|
|
@@ -1570,7 +1564,7 @@ function _a() {
|
|
|
1570
1564
|
await Promise.all(
|
|
1571
1565
|
S.map(async (C) => {
|
|
1572
1566
|
try {
|
|
1573
|
-
const w = await
|
|
1567
|
+
const w = await It(x, D, C.id);
|
|
1574
1568
|
let E;
|
|
1575
1569
|
if (w.status === "completed")
|
|
1576
1570
|
try {
|
|
@@ -1691,7 +1685,7 @@ function _a() {
|
|
|
1691
1685
|
] })
|
|
1692
1686
|
] }),
|
|
1693
1687
|
/* @__PURE__ */ t("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y divide-border/70", children: d.map((x) => /* @__PURE__ */ t(
|
|
1694
|
-
|
|
1688
|
+
_a,
|
|
1695
1689
|
{
|
|
1696
1690
|
export: x,
|
|
1697
1691
|
onRemove: g,
|
|
@@ -1701,10 +1695,10 @@ function _a() {
|
|
|
1701
1695
|
)) }) })
|
|
1702
1696
|
] });
|
|
1703
1697
|
}
|
|
1704
|
-
function
|
|
1698
|
+
function Qn({
|
|
1705
1699
|
variant: e
|
|
1706
1700
|
}) {
|
|
1707
|
-
const a = he((l) => l.activeExports), o =
|
|
1701
|
+
const a = he((l) => l.activeExports), o = yr(), n = a.size > 0, i = Array.from(a.values()).some(
|
|
1708
1702
|
(l) => l.status === "completed" || l.status === "failed"
|
|
1709
1703
|
), c = o > 0 ? o > 9 ? "9+" : String(o) : null;
|
|
1710
1704
|
return /* @__PURE__ */ r(Pe, { children: [
|
|
@@ -1716,7 +1710,7 @@ function es({
|
|
|
1716
1710
|
className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
1717
1711
|
"aria-label": "Export notifications",
|
|
1718
1712
|
children: [
|
|
1719
|
-
/* @__PURE__ */ t(
|
|
1713
|
+
/* @__PURE__ */ t(Cr, { className: "h-3.5 w-3.5" }),
|
|
1720
1714
|
n && /* @__PURE__ */ t(
|
|
1721
1715
|
"span",
|
|
1722
1716
|
{
|
|
@@ -1727,7 +1721,7 @@ function es({
|
|
|
1727
1721
|
]
|
|
1728
1722
|
}
|
|
1729
1723
|
) }),
|
|
1730
|
-
/* @__PURE__ */ t(
|
|
1724
|
+
/* @__PURE__ */ t(_e, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(Oa, {}) })
|
|
1731
1725
|
] });
|
|
1732
1726
|
}
|
|
1733
1727
|
function za(e) {
|
|
@@ -1753,7 +1747,7 @@ function $a({
|
|
|
1753
1747
|
preventPassiveDismissDuringCreate: u,
|
|
1754
1748
|
resolvedOpen: d,
|
|
1755
1749
|
setIsCreateFlowActive: p
|
|
1756
|
-
} =
|
|
1750
|
+
} = _t({
|
|
1757
1751
|
open: e,
|
|
1758
1752
|
onOpenChange: a,
|
|
1759
1753
|
initialCreateFlowActive: i === "create",
|
|
@@ -1764,16 +1758,16 @@ function $a({
|
|
|
1764
1758
|
// create and make consumers use `forceClose()` from a dedicated
|
|
1765
1759
|
// button.
|
|
1766
1760
|
dismissMode: n ? "passive" : "explicit-only"
|
|
1767
|
-
}), h = L((y) => y.dashboard), { setDashboardControlsModel: f } = be(), { participants: g } =
|
|
1761
|
+
}), h = L((y) => y.dashboard), { setDashboardControlsModel: f } = be(), { participants: g } = wr(Gt(h)), k = Array.from(
|
|
1768
1762
|
new Map(
|
|
1769
1763
|
g.flatMap(
|
|
1770
1764
|
(y) => y.fieldChoices.map((R) => {
|
|
1771
|
-
var
|
|
1765
|
+
var F;
|
|
1772
1766
|
return [
|
|
1773
1767
|
R.value,
|
|
1774
1768
|
{
|
|
1775
1769
|
option: R,
|
|
1776
|
-
target: (
|
|
1770
|
+
target: (F = y.fieldTargetMap) == null ? void 0 : F[R.value]
|
|
1777
1771
|
}
|
|
1778
1772
|
];
|
|
1779
1773
|
})
|
|
@@ -1783,12 +1777,12 @@ function $a({
|
|
|
1783
1777
|
new Map(
|
|
1784
1778
|
g.flatMap(
|
|
1785
1779
|
(y) => y.metricChoices.map((R) => {
|
|
1786
|
-
var
|
|
1780
|
+
var F;
|
|
1787
1781
|
return [
|
|
1788
1782
|
R.value,
|
|
1789
1783
|
{
|
|
1790
1784
|
option: R,
|
|
1791
|
-
target: (
|
|
1785
|
+
target: (F = y.metricTargetMap) == null ? void 0 : F[R.value]
|
|
1792
1786
|
}
|
|
1793
1787
|
];
|
|
1794
1788
|
})
|
|
@@ -1797,11 +1791,11 @@ function $a({
|
|
|
1797
1791
|
), D = Qt({
|
|
1798
1792
|
...h || {},
|
|
1799
1793
|
controls: []
|
|
1800
|
-
}), S =
|
|
1794
|
+
}), S = Nr(h), C = (y, R, F) => {
|
|
1801
1795
|
f(
|
|
1802
1796
|
y,
|
|
1803
1797
|
R,
|
|
1804
|
-
za(
|
|
1798
|
+
za(F)
|
|
1805
1799
|
);
|
|
1806
1800
|
}, w = W(() => {
|
|
1807
1801
|
if (s) {
|
|
@@ -1810,13 +1804,13 @@ function $a({
|
|
|
1810
1804
|
}
|
|
1811
1805
|
p(!1);
|
|
1812
1806
|
}, [s, c, p]), E = /* @__PURE__ */ t(
|
|
1813
|
-
|
|
1807
|
+
Ot,
|
|
1814
1808
|
{
|
|
1815
1809
|
scope: "dashboard",
|
|
1816
1810
|
controls: h.controls || [],
|
|
1817
1811
|
reservedControlIds: D,
|
|
1818
1812
|
defaultValues: h.defaultControlValues || {},
|
|
1819
|
-
usageByControlId:
|
|
1813
|
+
usageByControlId: Sr(h),
|
|
1820
1814
|
availableFieldChoices: k,
|
|
1821
1815
|
availableMetricChoices: x,
|
|
1822
1816
|
structuralParticipants: g,
|
|
@@ -1836,11 +1830,11 @@ function $a({
|
|
|
1836
1830
|
] });
|
|
1837
1831
|
return n ? /* @__PURE__ */ r(Pe, { open: d, onOpenChange: m, children: [
|
|
1838
1832
|
/* @__PURE__ */ t(Me, { asChild: !0, children: o || /* @__PURE__ */ r(T, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
1839
|
-
/* @__PURE__ */ t(
|
|
1833
|
+
/* @__PURE__ */ t(Pt, { className: "mr-2 h-4 w-4" }),
|
|
1840
1834
|
"Controls"
|
|
1841
1835
|
] }) }),
|
|
1842
1836
|
/* @__PURE__ */ t(
|
|
1843
|
-
|
|
1837
|
+
_e,
|
|
1844
1838
|
{
|
|
1845
1839
|
className: "w-[620px] max-w-[95vw] space-y-4",
|
|
1846
1840
|
align: "end",
|
|
@@ -1857,13 +1851,13 @@ function $a({
|
|
|
1857
1851
|
onPointerDownOutside: u,
|
|
1858
1852
|
children: [
|
|
1859
1853
|
/* @__PURE__ */ r(
|
|
1860
|
-
|
|
1854
|
+
nt,
|
|
1861
1855
|
{
|
|
1862
1856
|
className: l ? "space-y-0" : void 0,
|
|
1863
1857
|
children: [
|
|
1864
1858
|
/* @__PURE__ */ t(ke, { className: "text-[15px]", children: U }),
|
|
1865
1859
|
/* @__PURE__ */ t(
|
|
1866
|
-
|
|
1860
|
+
st,
|
|
1867
1861
|
{
|
|
1868
1862
|
className: l ? "sr-only" : "text-[13px]",
|
|
1869
1863
|
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."
|
|
@@ -1898,28 +1892,28 @@ function Wa({
|
|
|
1898
1892
|
preventPassiveDismissDuringCreate: m,
|
|
1899
1893
|
resolvedOpen: l,
|
|
1900
1894
|
setIsCreateFlowActive: u
|
|
1901
|
-
} =
|
|
1895
|
+
} = _t({
|
|
1902
1896
|
open: e,
|
|
1903
1897
|
onOpenChange: a,
|
|
1904
1898
|
initialCreateFlowActive: o === "create",
|
|
1905
1899
|
dismissMode: "explicit-only"
|
|
1906
1900
|
}), d = L((y) => y.dashboard), p = L((y) => y.selectedSheetId), { setDashboardInputs: h } = be(), f = (b = d.sheets) == null ? void 0 : b.find(
|
|
1907
1901
|
(y) => y.id === p
|
|
1908
|
-
), g = (f == null ? void 0 : f.kind) === "document" && !!f.document, k =
|
|
1909
|
-
() => g && (f != null && f.document) ?
|
|
1902
|
+
), g = (f == null ? void 0 : f.kind) === "document" && !!f.document, k = Z(
|
|
1903
|
+
() => g && (f != null && f.document) ? Dr(d, f.id) : [],
|
|
1910
1904
|
[d, g, f == null ? void 0 : f.document, f == null ? void 0 : f.id]
|
|
1911
|
-
), x =
|
|
1905
|
+
), x = Z(
|
|
1912
1906
|
() => k.filter(
|
|
1913
1907
|
(y) => y.kind === "control"
|
|
1914
1908
|
),
|
|
1915
1909
|
[k]
|
|
1916
|
-
), D =
|
|
1910
|
+
), D = Z(
|
|
1917
1911
|
() => x.map((y) => y.control),
|
|
1918
1912
|
[x]
|
|
1919
|
-
), S =
|
|
1920
|
-
() =>
|
|
1913
|
+
), S = Z(
|
|
1914
|
+
() => qa(D),
|
|
1921
1915
|
[D]
|
|
1922
|
-
), C =
|
|
1916
|
+
), C = Z(
|
|
1923
1917
|
() => Ha(d),
|
|
1924
1918
|
[d]
|
|
1925
1919
|
), w = W(() => {
|
|
@@ -1929,15 +1923,15 @@ function Wa({
|
|
|
1929
1923
|
}
|
|
1930
1924
|
u(!1);
|
|
1931
1925
|
}, [n, i, u]), E = W(
|
|
1932
|
-
(y, R,
|
|
1926
|
+
(y, R, F) => {
|
|
1933
1927
|
!g || !(f != null && f.document) || h(
|
|
1934
|
-
|
|
1928
|
+
Qa({
|
|
1935
1929
|
allInputs: d.inputs || [],
|
|
1936
1930
|
documentSheetId: f.id,
|
|
1937
1931
|
currentDocumentInputs: k,
|
|
1938
1932
|
nextControls: y,
|
|
1939
1933
|
nextDefaultValues: R,
|
|
1940
|
-
change:
|
|
1934
|
+
change: F
|
|
1941
1935
|
})
|
|
1942
1936
|
);
|
|
1943
1937
|
},
|
|
@@ -1956,10 +1950,10 @@ function Wa({
|
|
|
1956
1950
|
onEscapeKeyDown: m,
|
|
1957
1951
|
onPointerDownOutside: m,
|
|
1958
1952
|
children: [
|
|
1959
|
-
/* @__PURE__ */ r(
|
|
1953
|
+
/* @__PURE__ */ r(nt, { className: c ? "space-y-0" : void 0, children: [
|
|
1960
1954
|
/* @__PURE__ */ t(ke, { className: "text-[15px]", children: c ? "Add document control" : "Document Controls" }),
|
|
1961
1955
|
/* @__PURE__ */ t(
|
|
1962
|
-
|
|
1956
|
+
st,
|
|
1963
1957
|
{
|
|
1964
1958
|
className: c ? "sr-only" : "text-[13px]",
|
|
1965
1959
|
children: c ? "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."
|
|
@@ -1967,7 +1961,7 @@ function Wa({
|
|
|
1967
1961
|
)
|
|
1968
1962
|
] }),
|
|
1969
1963
|
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ t(
|
|
1970
|
-
|
|
1964
|
+
Ot,
|
|
1971
1965
|
{
|
|
1972
1966
|
scope: "dashboard",
|
|
1973
1967
|
controls: D,
|
|
@@ -1993,19 +1987,19 @@ function Wa({
|
|
|
1993
1987
|
function Ha(e) {
|
|
1994
1988
|
return (e.controls || []).map((a) => a.id);
|
|
1995
1989
|
}
|
|
1996
|
-
function
|
|
1990
|
+
function qa(e) {
|
|
1997
1991
|
const a = {};
|
|
1998
1992
|
for (const o of e)
|
|
1999
1993
|
o.defaultValue !== void 0 && (a[o.id] = o.defaultValue);
|
|
2000
1994
|
return a;
|
|
2001
1995
|
}
|
|
2002
|
-
function
|
|
1996
|
+
function Ga(e, a) {
|
|
2003
1997
|
return a ? Object.prototype.hasOwnProperty.call(a, e.id) ? {
|
|
2004
1998
|
...e,
|
|
2005
1999
|
defaultValue: a[e.id]
|
|
2006
2000
|
} : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 } : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 };
|
|
2007
2001
|
}
|
|
2008
|
-
function
|
|
2002
|
+
function Qa({
|
|
2009
2003
|
allInputs: e,
|
|
2010
2004
|
documentSheetId: a,
|
|
2011
2005
|
currentDocumentInputs: o,
|
|
@@ -2016,7 +2010,7 @@ function qa({
|
|
|
2016
2010
|
const c = new Map(
|
|
2017
2011
|
n.map((h) => [
|
|
2018
2012
|
h.id,
|
|
2019
|
-
|
|
2013
|
+
Ga(h, i)
|
|
2020
2014
|
])
|
|
2021
2015
|
), m = (s == null ? void 0 : s.type) === "rename" ? { oldId: s.oldId, newId: s.newId } : null, l = /* @__PURE__ */ new Set(), u = [];
|
|
2022
2016
|
for (const h of o) {
|
|
@@ -2028,7 +2022,7 @@ function qa({
|
|
|
2028
2022
|
if (!f)
|
|
2029
2023
|
continue;
|
|
2030
2024
|
l.add(f.id);
|
|
2031
|
-
const g =
|
|
2025
|
+
const g = Kt(
|
|
2032
2026
|
f.id,
|
|
2033
2027
|
[...e, ...u].filter(
|
|
2034
2028
|
(x) => x.id !== h.id
|
|
@@ -2044,7 +2038,7 @@ function qa({
|
|
|
2044
2038
|
}
|
|
2045
2039
|
for (const h of c.values())
|
|
2046
2040
|
l.has(h.id) || u.push(
|
|
2047
|
-
|
|
2041
|
+
kr({
|
|
2048
2042
|
control: h,
|
|
2049
2043
|
existingInputs: [...e, ...u],
|
|
2050
2044
|
sheetId: a
|
|
@@ -2057,7 +2051,7 @@ function qa({
|
|
|
2057
2051
|
(h) => !d.has(h.id)
|
|
2058
2052
|
), ...u];
|
|
2059
2053
|
}
|
|
2060
|
-
function
|
|
2054
|
+
function Ka({
|
|
2061
2055
|
showFilters: e,
|
|
2062
2056
|
onShowFiltersChange: a,
|
|
2063
2057
|
pickerContent: o,
|
|
@@ -2073,7 +2067,7 @@ function Qa({
|
|
|
2073
2067
|
return /* @__PURE__ */ r(
|
|
2074
2068
|
"div",
|
|
2075
2069
|
{
|
|
2076
|
-
className:
|
|
2070
|
+
className: G(
|
|
2077
2071
|
// Height lives on the shell so the outer border is part of the
|
|
2078
2072
|
// h-7 box (matches regular `size="xs"` buttons). Inner triggers
|
|
2079
2073
|
// stretch to fill via `h-full`.
|
|
@@ -2088,22 +2082,22 @@ function Qa({
|
|
|
2088
2082
|
{
|
|
2089
2083
|
variant: "ghost",
|
|
2090
2084
|
size: "xs",
|
|
2091
|
-
className:
|
|
2085
|
+
className: G(
|
|
2092
2086
|
"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",
|
|
2093
2087
|
c
|
|
2094
2088
|
),
|
|
2095
2089
|
children: [
|
|
2096
|
-
e ? /* @__PURE__ */ t(ca, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(
|
|
2090
|
+
e ? /* @__PURE__ */ t(ca, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Bt, { className: "h-3.5 w-3.5" }),
|
|
2097
2091
|
"Filter"
|
|
2098
2092
|
]
|
|
2099
2093
|
}
|
|
2100
2094
|
) }),
|
|
2101
2095
|
/* @__PURE__ */ t(
|
|
2102
|
-
|
|
2096
|
+
_e,
|
|
2103
2097
|
{
|
|
2104
2098
|
align: "end",
|
|
2105
2099
|
sideOffset: 6,
|
|
2106
|
-
className:
|
|
2100
|
+
className: G(
|
|
2107
2101
|
"w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
|
|
2108
2102
|
l
|
|
2109
2103
|
),
|
|
@@ -2118,7 +2112,7 @@ function Qa({
|
|
|
2118
2112
|
{
|
|
2119
2113
|
variant: "ghost",
|
|
2120
2114
|
size: "xs",
|
|
2121
|
-
className:
|
|
2115
|
+
className: G(
|
|
2122
2116
|
"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",
|
|
2123
2117
|
m
|
|
2124
2118
|
),
|
|
@@ -2127,11 +2121,11 @@ function Qa({
|
|
|
2127
2121
|
}
|
|
2128
2122
|
) }),
|
|
2129
2123
|
/* @__PURE__ */ t(
|
|
2130
|
-
|
|
2124
|
+
_e,
|
|
2131
2125
|
{
|
|
2132
2126
|
align: "end",
|
|
2133
2127
|
sideOffset: 6,
|
|
2134
|
-
className:
|
|
2128
|
+
className: G(
|
|
2135
2129
|
"w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
|
|
2136
2130
|
u
|
|
2137
2131
|
),
|
|
@@ -2144,10 +2138,10 @@ function Qa({
|
|
|
2144
2138
|
}
|
|
2145
2139
|
);
|
|
2146
2140
|
}
|
|
2147
|
-
function
|
|
2141
|
+
function Ya() {
|
|
2148
2142
|
ua();
|
|
2149
|
-
const e = L((l) => l.selectedSheetId), a = L((l) => l.selectedFrameId), o = L((l) => l.dashboard), n = L((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = be(), { setCard: s } =
|
|
2150
|
-
return
|
|
2143
|
+
const e = L((l) => l.selectedSheetId), a = L((l) => l.selectedFrameId), o = L((l) => l.dashboard), n = L((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = be(), { setCard: s } = Dt(), c = me((l) => l.card.dataSource);
|
|
2144
|
+
return K(() => {
|
|
2151
2145
|
var u, d;
|
|
2152
2146
|
let l = n();
|
|
2153
2147
|
if (!l) {
|
|
@@ -2162,10 +2156,10 @@ function Xa() {
|
|
|
2162
2156
|
hasEntities: !!(c != null && c.selectedEntities && c.selectedEntities.length > 0)
|
|
2163
2157
|
};
|
|
2164
2158
|
}
|
|
2165
|
-
function
|
|
2159
|
+
function Za() {
|
|
2166
2160
|
const e = L((l) => l.dashboard), a = L(
|
|
2167
2161
|
(l) => l.semanticExecutionPayload
|
|
2168
|
-
), o = L((l) => l.actions.addFilter), { hasEntities: n } =
|
|
2162
|
+
), o = L((l) => l.actions.addFilter), { hasEntities: n } = Ya(), { isLoading: i } = Er(), s = Z(
|
|
2169
2163
|
() => Yt(e, a),
|
|
2170
2164
|
[e, a]
|
|
2171
2165
|
), m = !Zt(e.filters) && s.hasEligibleCards && !i;
|
|
@@ -2174,7 +2168,7 @@ function Ya() {
|
|
|
2174
2168
|
"button",
|
|
2175
2169
|
{
|
|
2176
2170
|
type: "button",
|
|
2177
|
-
onClick: () => o(
|
|
2171
|
+
onClick: () => o(Xt()),
|
|
2178
2172
|
title: `Applies to ${s.eligibleCardCount} of ${s.totalCardCount} date-aware cards`,
|
|
2179
2173
|
className: "flex w-full items-start gap-2 rounded-control px-2 py-1.5 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border",
|
|
2180
2174
|
children: [
|
|
@@ -2187,15 +2181,15 @@ function Ya() {
|
|
|
2187
2181
|
}
|
|
2188
2182
|
) }),
|
|
2189
2183
|
!n && /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
|
|
2190
|
-
/* @__PURE__ */ t(
|
|
2184
|
+
/* @__PURE__ */ t(aa, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
|
|
2191
2185
|
/* @__PURE__ */ t("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
|
|
2192
2186
|
/* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
|
|
2193
2187
|
] }),
|
|
2194
|
-
n && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(
|
|
2188
|
+
n && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(Ar, { context: "filter" }) })
|
|
2195
2189
|
] });
|
|
2196
2190
|
}
|
|
2197
2191
|
const wt = !1;
|
|
2198
|
-
function
|
|
2192
|
+
function Xa({
|
|
2199
2193
|
onAddFilter: e,
|
|
2200
2194
|
onAddControl: a,
|
|
2201
2195
|
onManageControls: o,
|
|
@@ -2211,7 +2205,7 @@ function Za({
|
|
|
2211
2205
|
/* @__PURE__ */ t(
|
|
2212
2206
|
Je,
|
|
2213
2207
|
{
|
|
2214
|
-
icon:
|
|
2208
|
+
icon: Bt,
|
|
2215
2209
|
label: "Add filter",
|
|
2216
2210
|
onClick: () => {
|
|
2217
2211
|
e(), n();
|
|
@@ -2221,7 +2215,7 @@ function Za({
|
|
|
2221
2215
|
/* @__PURE__ */ t(
|
|
2222
2216
|
Je,
|
|
2223
2217
|
{
|
|
2224
|
-
icon:
|
|
2218
|
+
icon: Pt,
|
|
2225
2219
|
label: "Add control",
|
|
2226
2220
|
onClick: () => {
|
|
2227
2221
|
a(), n();
|
|
@@ -2231,7 +2225,7 @@ function Za({
|
|
|
2231
2225
|
/* @__PURE__ */ t(
|
|
2232
2226
|
Je,
|
|
2233
2227
|
{
|
|
2234
|
-
icon:
|
|
2228
|
+
icon: Tt,
|
|
2235
2229
|
label: "Manage controls",
|
|
2236
2230
|
onClick: () => {
|
|
2237
2231
|
o(), n();
|
|
@@ -2281,7 +2275,7 @@ function Ja({
|
|
|
2281
2275
|
onCheckedChange: n
|
|
2282
2276
|
}) {
|
|
2283
2277
|
return /* @__PURE__ */ r("div", { className: "flex items-center gap-2 rounded-control px-1 py-1 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
|
|
2284
|
-
/* @__PURE__ */ t(
|
|
2278
|
+
/* @__PURE__ */ t(at, { id: e, checked: o, onCheckedChange: n }),
|
|
2285
2279
|
/* @__PURE__ */ t(
|
|
2286
2280
|
Ne,
|
|
2287
2281
|
{
|
|
@@ -2292,7 +2286,7 @@ function Ja({
|
|
|
2292
2286
|
)
|
|
2293
2287
|
] });
|
|
2294
2288
|
}
|
|
2295
|
-
function
|
|
2289
|
+
function Kn({
|
|
2296
2290
|
size: e,
|
|
2297
2291
|
className: a,
|
|
2298
2292
|
primaryButtonClassName: o,
|
|
@@ -2301,9 +2295,9 @@ function ts({
|
|
|
2301
2295
|
settingsContentClassName: s
|
|
2302
2296
|
}) {
|
|
2303
2297
|
var U;
|
|
2304
|
-
const [c, m] = A(null), l = L((b) => b.dashboard), u = L((b) => b.selectedSheetId), d = L((b) => b.showFilters), p =
|
|
2298
|
+
const [c, m] = A(null), l = L((b) => b.dashboard), u = L((b) => b.selectedSheetId), d = L((b) => b.showFilters), p = Fr((b) => b.setPanelOpen), h = L((b) => b.actions), { setDocumentPanelTarget: f, setShowFilters: g } = h, k = (U = l.sheets) == null ? void 0 : U.find(
|
|
2305
2299
|
(b) => b.id === u
|
|
2306
|
-
), x =
|
|
2300
|
+
), x = Jt(k), D = W((b) => {
|
|
2307
2301
|
window.setTimeout(() => {
|
|
2308
2302
|
m(b);
|
|
2309
2303
|
}, 0);
|
|
@@ -2334,13 +2328,13 @@ function ts({
|
|
|
2334
2328
|
}, [D]);
|
|
2335
2329
|
return /* @__PURE__ */ r($, { children: [
|
|
2336
2330
|
/* @__PURE__ */ t(
|
|
2337
|
-
|
|
2331
|
+
Ka,
|
|
2338
2332
|
{
|
|
2339
2333
|
showFilters: x ? !1 : d,
|
|
2340
2334
|
onShowFiltersChange: S,
|
|
2341
|
-
pickerContent: /* @__PURE__ */ t(
|
|
2335
|
+
pickerContent: /* @__PURE__ */ t(Za, {}),
|
|
2342
2336
|
settingsContent: (b) => /* @__PURE__ */ t(
|
|
2343
|
-
|
|
2337
|
+
Xa,
|
|
2344
2338
|
{
|
|
2345
2339
|
onAddFilter: C,
|
|
2346
2340
|
onAddControl: w,
|
|
@@ -2392,7 +2386,7 @@ function en({
|
|
|
2392
2386
|
size: "xs",
|
|
2393
2387
|
variant: "outline",
|
|
2394
2388
|
disabled: e,
|
|
2395
|
-
className:
|
|
2389
|
+
className: G("gap-1.5", o),
|
|
2396
2390
|
onClick: n,
|
|
2397
2391
|
"aria-label": "Reports & briefings",
|
|
2398
2392
|
children: [
|
|
@@ -2459,7 +2453,7 @@ function ln({
|
|
|
2459
2453
|
role: "tab",
|
|
2460
2454
|
"aria-selected": n,
|
|
2461
2455
|
onClick: () => a(o),
|
|
2462
|
-
className:
|
|
2456
|
+
className: G(
|
|
2463
2457
|
"h-6 rounded-[3px] px-2 text-[11px] transition-colors",
|
|
2464
2458
|
n ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
2465
2459
|
),
|
|
@@ -2493,7 +2487,7 @@ function dn({
|
|
|
2493
2487
|
contentKind: S,
|
|
2494
2488
|
hideHeader: C = !1
|
|
2495
2489
|
}) {
|
|
2496
|
-
const w = e.length, E = e.filter((
|
|
2490
|
+
const w = e.length, E = e.filter((F) => F.status === "ACTIVE").length, U = S === "reports" ? w === 1 ? "report" : "reports" : S === "briefings" ? w === 1 ? "briefing" : "briefings" : w === 1 ? "item" : "items", b = e.find((F) => F.hasActiveRun) ?? null, y = S ?? "reports & briefings", R = o === "dashboard" ? a : `Project ${y}`;
|
|
2497
2491
|
return /* @__PURE__ */ r(
|
|
2498
2492
|
"section",
|
|
2499
2493
|
{
|
|
@@ -2512,7 +2506,7 @@ function dn({
|
|
|
2512
2506
|
onClick: c,
|
|
2513
2507
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2514
2508
|
"aria-label": `Close ${y.replace("&", "and")} panel`,
|
|
2515
|
-
children: /* @__PURE__ */ t(
|
|
2509
|
+
children: /* @__PURE__ */ t(Qe, { className: "h-3.5 w-3.5" })
|
|
2516
2510
|
}
|
|
2517
2511
|
)
|
|
2518
2512
|
] }),
|
|
@@ -2560,9 +2554,9 @@ function dn({
|
|
|
2560
2554
|
" New"
|
|
2561
2555
|
] }) }),
|
|
2562
2556
|
/* @__PURE__ */ r(He, { align: "end", children: [
|
|
2563
|
-
/* @__PURE__ */ t(
|
|
2557
|
+
/* @__PURE__ */ t(q, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
|
|
2564
2558
|
/* @__PURE__ */ t(
|
|
2565
|
-
|
|
2559
|
+
q,
|
|
2566
2560
|
{
|
|
2567
2561
|
onClick: () => l("analytical_briefing"),
|
|
2568
2562
|
children: "Create analytical briefing"
|
|
@@ -2610,25 +2604,25 @@ function dn({
|
|
|
2610
2604
|
contentKind: S
|
|
2611
2605
|
}
|
|
2612
2606
|
) : null,
|
|
2613
|
-
e.map((
|
|
2607
|
+
e.map((F) => /* @__PURE__ */ t(
|
|
2614
2608
|
hn,
|
|
2615
2609
|
{
|
|
2616
|
-
briefing:
|
|
2617
|
-
isOpening: k ===
|
|
2618
|
-
isBusy: x ===
|
|
2619
|
-
onOpen: () => m(
|
|
2620
|
-
onRunNow: () => h(
|
|
2621
|
-
onTogglePause: () => f(
|
|
2622
|
-
onDelete: () => g(
|
|
2610
|
+
briefing: F,
|
|
2611
|
+
isOpening: k === F.id,
|
|
2612
|
+
isBusy: x === F.id,
|
|
2613
|
+
onOpen: () => m(F.id),
|
|
2614
|
+
onRunNow: () => h(F),
|
|
2615
|
+
onTogglePause: () => f(F),
|
|
2616
|
+
onDelete: () => g(F)
|
|
2623
2617
|
},
|
|
2624
|
-
|
|
2618
|
+
F.id
|
|
2625
2619
|
))
|
|
2626
2620
|
] }),
|
|
2627
2621
|
D ? /* @__PURE__ */ t("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
|
|
2628
2622
|
"a",
|
|
2629
2623
|
{
|
|
2630
2624
|
href: D,
|
|
2631
|
-
className:
|
|
2625
|
+
className: G(jt, "h-6 px-1 text-[11px]"),
|
|
2632
2626
|
children: [
|
|
2633
2627
|
"Manage all reports & briefings",
|
|
2634
2628
|
/* @__PURE__ */ t(xa, { className: "h-3 w-3" })
|
|
@@ -2870,7 +2864,7 @@ function hn({
|
|
|
2870
2864
|
return /* @__PURE__ */ r(
|
|
2871
2865
|
"div",
|
|
2872
2866
|
{
|
|
2873
|
-
className:
|
|
2867
|
+
className: G(
|
|
2874
2868
|
"group relative border-b border-border/60 px-4 py-3 transition-colors hover:bg-muted/60",
|
|
2875
2869
|
m && "opacity-70"
|
|
2876
2870
|
),
|
|
@@ -2895,7 +2889,7 @@ function hn({
|
|
|
2895
2889
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
2896
2890
|
/* @__PURE__ */ t("span", { children: on(e) }),
|
|
2897
2891
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
2898
|
-
/* @__PURE__ */ t(
|
|
2892
|
+
/* @__PURE__ */ t(Ir, { className: "h-3 w-3" }),
|
|
2899
2893
|
/* @__PURE__ */ t("span", { className: "truncate", children: nn(e) }),
|
|
2900
2894
|
e.lastRunAt ? /* @__PURE__ */ r($, { children: [
|
|
2901
2895
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
@@ -2909,7 +2903,7 @@ function hn({
|
|
|
2909
2903
|
l ? /* @__PURE__ */ t(re, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ t(
|
|
2910
2904
|
"span",
|
|
2911
2905
|
{
|
|
2912
|
-
className:
|
|
2906
|
+
className: G(
|
|
2913
2907
|
"inline-block h-1.5 w-1.5 shrink-0 rounded-full",
|
|
2914
2908
|
f
|
|
2915
2909
|
)
|
|
@@ -2928,52 +2922,52 @@ function hn({
|
|
|
2928
2922
|
onClick: (g) => g.stopPropagation(),
|
|
2929
2923
|
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",
|
|
2930
2924
|
"aria-label": `${h.noun === "report" ? "Report" : "Briefing"} actions`,
|
|
2931
|
-
children: /* @__PURE__ */ t(
|
|
2925
|
+
children: /* @__PURE__ */ t(At, { className: "h-3.5 w-3.5" })
|
|
2932
2926
|
}
|
|
2933
2927
|
) }),
|
|
2934
2928
|
/* @__PURE__ */ r(He, { align: "end", className: "w-44", children: [
|
|
2935
|
-
/* @__PURE__ */ r(
|
|
2936
|
-
/* @__PURE__ */ t(
|
|
2929
|
+
/* @__PURE__ */ r(q, { onClick: n, children: [
|
|
2930
|
+
/* @__PURE__ */ t(Tt, { className: "h-3.5 w-3.5" }),
|
|
2937
2931
|
"Edit ",
|
|
2938
2932
|
h.noun
|
|
2939
2933
|
] }),
|
|
2940
2934
|
/* @__PURE__ */ r(
|
|
2941
|
-
|
|
2935
|
+
q,
|
|
2942
2936
|
{
|
|
2943
2937
|
onClick: (g) => {
|
|
2944
2938
|
g.preventDefault(), i();
|
|
2945
2939
|
},
|
|
2946
2940
|
children: [
|
|
2947
|
-
/* @__PURE__ */ t(
|
|
2941
|
+
/* @__PURE__ */ t(Lr, { className: "h-3.5 w-3.5" }),
|
|
2948
2942
|
"Run now"
|
|
2949
2943
|
]
|
|
2950
2944
|
}
|
|
2951
2945
|
),
|
|
2952
2946
|
e.scheduleExpr ? /* @__PURE__ */ t(
|
|
2953
|
-
|
|
2947
|
+
q,
|
|
2954
2948
|
{
|
|
2955
2949
|
onClick: (g) => {
|
|
2956
2950
|
g.preventDefault(), s();
|
|
2957
2951
|
},
|
|
2958
2952
|
children: m ? /* @__PURE__ */ r($, { children: [
|
|
2959
|
-
/* @__PURE__ */ t(
|
|
2953
|
+
/* @__PURE__ */ t(Br, { className: "h-3.5 w-3.5" }),
|
|
2960
2954
|
"Resume"
|
|
2961
2955
|
] }) : /* @__PURE__ */ r($, { children: [
|
|
2962
|
-
/* @__PURE__ */ t(
|
|
2956
|
+
/* @__PURE__ */ t(Tr, { className: "h-3.5 w-3.5" }),
|
|
2963
2957
|
"Pause"
|
|
2964
2958
|
] })
|
|
2965
2959
|
}
|
|
2966
2960
|
) : null,
|
|
2967
2961
|
/* @__PURE__ */ t(ze, {}),
|
|
2968
2962
|
/* @__PURE__ */ r(
|
|
2969
|
-
|
|
2963
|
+
q,
|
|
2970
2964
|
{
|
|
2971
2965
|
onClick: (g) => {
|
|
2972
2966
|
g.preventDefault(), c();
|
|
2973
2967
|
},
|
|
2974
2968
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
2975
2969
|
children: [
|
|
2976
|
-
/* @__PURE__ */ t(
|
|
2970
|
+
/* @__PURE__ */ t(Oe, { className: "h-3.5 w-3.5" }),
|
|
2977
2971
|
"Delete ",
|
|
2978
2972
|
h.noun
|
|
2979
2973
|
]
|
|
@@ -3012,12 +3006,12 @@ async function xn(e) {
|
|
|
3012
3006
|
return o;
|
|
3013
3007
|
}
|
|
3014
3008
|
const vn = {
|
|
3015
|
-
listBriefings:
|
|
3016
|
-
getBriefing:
|
|
3017
|
-
pauseBriefing:
|
|
3018
|
-
resumeBriefing:
|
|
3019
|
-
deleteBriefing:
|
|
3020
|
-
runBriefingNow:
|
|
3009
|
+
listBriefings: zr,
|
|
3010
|
+
getBriefing: Or,
|
|
3011
|
+
pauseBriefing: _r,
|
|
3012
|
+
resumeBriefing: Mr,
|
|
3013
|
+
deleteBriefing: Pr,
|
|
3014
|
+
runBriefingNow: Vr
|
|
3021
3015
|
};
|
|
3022
3016
|
function yn({
|
|
3023
3017
|
briefingId: e,
|
|
@@ -3028,7 +3022,7 @@ function yn({
|
|
|
3028
3022
|
onTimeout: s,
|
|
3029
3023
|
onExpand: c
|
|
3030
3024
|
}) {
|
|
3031
|
-
const [m, l] = A(a), { startRun: u } =
|
|
3025
|
+
const [m, l] = A(a), { startRun: u } = Kr({
|
|
3032
3026
|
apiServiceUrl: o,
|
|
3033
3027
|
token: n,
|
|
3034
3028
|
intervalMs: mn,
|
|
@@ -3037,7 +3031,7 @@ function yn({
|
|
|
3037
3031
|
apiServiceUrl: p,
|
|
3038
3032
|
token: h,
|
|
3039
3033
|
runId: f
|
|
3040
|
-
}) =>
|
|
3034
|
+
}) => Yr(p, h, e, f),
|
|
3041
3035
|
onRun: (p) => {
|
|
3042
3036
|
l(p);
|
|
3043
3037
|
},
|
|
@@ -3048,12 +3042,12 @@ function yn({
|
|
|
3048
3042
|
s();
|
|
3049
3043
|
}
|
|
3050
3044
|
}), d = ce(!1);
|
|
3051
|
-
return
|
|
3052
|
-
d.current || (d.current = !0,
|
|
3053
|
-
}, [a, i, u]), /* @__PURE__ */ t(
|
|
3045
|
+
return K(() => {
|
|
3046
|
+
d.current || (d.current = !0, Zr(a.status) ? u(a) : Xr(a.status) && i(a));
|
|
3047
|
+
}, [a, i, u]), /* @__PURE__ */ t(Jr, { run: m, onExpand: c });
|
|
3054
3048
|
}
|
|
3055
|
-
function
|
|
3056
|
-
return /* @__PURE__ */ t(
|
|
3049
|
+
function Yn(e) {
|
|
3050
|
+
return /* @__PURE__ */ t(Ur, { children: /* @__PURE__ */ t(Cn, { ...e }) });
|
|
3057
3051
|
}
|
|
3058
3052
|
function Cn({
|
|
3059
3053
|
dashboardId: e,
|
|
@@ -3069,26 +3063,26 @@ function Cn({
|
|
|
3069
3063
|
workflowIntent: d,
|
|
3070
3064
|
client: p
|
|
3071
3065
|
}) {
|
|
3072
|
-
const { authToken: h, tokenProps: f } =
|
|
3066
|
+
const { authToken: h, tokenProps: f } = qe(), g = Rr(), k = !d || g.canCreate && (d === "scheduled_report" || g.analyticalBriefingsEnabled), [x, D] = A(!1), S = m ?? x, C = (N) => {
|
|
3073
3067
|
m === void 0 && D(N), l == null || l(N);
|
|
3074
3068
|
}, [w, E] = A(
|
|
3075
3069
|
d ? "author" : "list"
|
|
3076
3070
|
), [U, b] = A(
|
|
3077
3071
|
d ?? "analytical_briefing"
|
|
3078
|
-
), [y, R] = A("dashboard"), [
|
|
3072
|
+
), [y, R] = A("dashboard"), [F, H] = A(
|
|
3079
3073
|
[]
|
|
3080
|
-
), [
|
|
3074
|
+
), [I, P] = A(null), X = d && !k && !I ? "list" : w, [ae, Ee] = A(!1), [oe, Ae] = A(null), [Fe, ie] = A(null), [j, J] = A(
|
|
3081
3075
|
null
|
|
3082
|
-
), [le, ee] = A(null),
|
|
3083
|
-
|
|
3076
|
+
), [le, ee] = A(null), Ie = ce(null), xe = ce(S);
|
|
3077
|
+
K(() => {
|
|
3084
3078
|
const N = S && !xe.current;
|
|
3085
3079
|
xe.current = S, !(!N || !d) && (P(null), R("dashboard"), b(d), E("author"), ee(null));
|
|
3086
3080
|
}, [S, d]);
|
|
3087
3081
|
const [ue, pe] = A(
|
|
3088
3082
|
null
|
|
3089
|
-
), [
|
|
3083
|
+
), [Y, ve] = A(null), _ = o ?? (f == null ? void 0 : f.apiServiceUrl), O = n ?? (h == null ? void 0 : h.accessToken), ne = Z(() => ({ ...vn, ...p }), [p]), fe = fn(a), Le = Z(() => {
|
|
3090
3084
|
const N = bn(
|
|
3091
|
-
|
|
3085
|
+
F,
|
|
3092
3086
|
y,
|
|
3093
3087
|
e
|
|
3094
3088
|
);
|
|
@@ -3098,7 +3092,7 @@ function Cn({
|
|
|
3098
3092
|
return N.filter(
|
|
3099
3093
|
(Be) => se(Be).noun === V
|
|
3100
3094
|
);
|
|
3101
|
-
}, [e,
|
|
3095
|
+
}, [e, F, y, d]), Ke = Z(() => y === "dashboard" ? {
|
|
3102
3096
|
source: { type: "dashboard", dashboardId: e },
|
|
3103
3097
|
label: fe,
|
|
3104
3098
|
detail: gn(fe)
|
|
@@ -3106,19 +3100,19 @@ function Cn({
|
|
|
3106
3100
|
source: { type: "project" },
|
|
3107
3101
|
label: "This project",
|
|
3108
3102
|
detail: "Use any data in this project."
|
|
3109
|
-
}, [e, fe, y]), ye = !!(
|
|
3103
|
+
}, [e, fe, y]), ye = !!(_ && O), Ce = ba({
|
|
3110
3104
|
canCreate: g.canCreate,
|
|
3111
3105
|
analyticalBriefingsEnabled: g.analyticalBriefingsEnabled,
|
|
3112
3106
|
scheduledReportAvailable: y === "dashboard"
|
|
3113
|
-
}),
|
|
3114
|
-
if (!(!
|
|
3107
|
+
}), Q = W(async () => {
|
|
3108
|
+
if (!(!_ || !O)) {
|
|
3115
3109
|
Ee(!0), ee(null);
|
|
3116
3110
|
try {
|
|
3117
3111
|
H(
|
|
3118
3112
|
await xn({
|
|
3119
3113
|
apiClient: ne,
|
|
3120
|
-
apiServiceUrl:
|
|
3121
|
-
token:
|
|
3114
|
+
apiServiceUrl: _,
|
|
3115
|
+
token: O
|
|
3122
3116
|
})
|
|
3123
3117
|
);
|
|
3124
3118
|
} catch (N) {
|
|
@@ -3129,21 +3123,21 @@ function Cn({
|
|
|
3129
3123
|
Ee(!1);
|
|
3130
3124
|
}
|
|
3131
3125
|
}
|
|
3132
|
-
}, [ne,
|
|
3133
|
-
|
|
3134
|
-
!S ||
|
|
3135
|
-
}, [ye,
|
|
3126
|
+
}, [ne, _, O]);
|
|
3127
|
+
K(() => {
|
|
3128
|
+
!S || X !== "list" || !ye || Q();
|
|
3129
|
+
}, [ye, X, Q, S]);
|
|
3136
3130
|
const we = () => {
|
|
3137
3131
|
P(null), R("dashboard"), E("list"), C(!0);
|
|
3138
3132
|
}, v = (N) => {
|
|
3139
3133
|
P(null), b(N), E("author");
|
|
3140
3134
|
}, B = async (N) => {
|
|
3141
|
-
if (!(!
|
|
3135
|
+
if (!(!_ || !O)) {
|
|
3142
3136
|
Ae(N), ee(null);
|
|
3143
3137
|
try {
|
|
3144
3138
|
const V = await ne.getBriefing(
|
|
3145
|
-
O,
|
|
3146
3139
|
_,
|
|
3140
|
+
O,
|
|
3147
3141
|
N
|
|
3148
3142
|
);
|
|
3149
3143
|
P(V.briefing), E("author");
|
|
@@ -3156,15 +3150,15 @@ function Cn({
|
|
|
3156
3150
|
}
|
|
3157
3151
|
}
|
|
3158
3152
|
}, M = async (N) => {
|
|
3159
|
-
if (!(!
|
|
3153
|
+
if (!(!_ || !O)) {
|
|
3160
3154
|
ie(N.id);
|
|
3161
3155
|
try {
|
|
3162
3156
|
await ne.runBriefingNow(
|
|
3163
|
-
O,
|
|
3164
3157
|
_,
|
|
3158
|
+
O,
|
|
3165
3159
|
N.id,
|
|
3166
3160
|
{ requestId: wn() }
|
|
3167
|
-
),
|
|
3161
|
+
), Q();
|
|
3168
3162
|
} catch (V) {
|
|
3169
3163
|
z.error(
|
|
3170
3164
|
V instanceof Error ? V.message : "Could not start the run."
|
|
@@ -3174,22 +3168,22 @@ function Cn({
|
|
|
3174
3168
|
}
|
|
3175
3169
|
}
|
|
3176
3170
|
}, te = async (N) => {
|
|
3177
|
-
if (!
|
|
3171
|
+
if (!_ || !O) return;
|
|
3178
3172
|
const { noun: V } = se(N), Be = V === "report" ? "Report" : "Briefing";
|
|
3179
3173
|
ie(N.id);
|
|
3180
3174
|
try {
|
|
3181
3175
|
const Te = N.status === "PAUSED" ? await ne.resumeBriefing(
|
|
3182
|
-
O,
|
|
3183
3176
|
_,
|
|
3177
|
+
O,
|
|
3184
3178
|
N.id
|
|
3185
3179
|
) : await ne.pauseBriefing(
|
|
3186
|
-
O,
|
|
3187
3180
|
_,
|
|
3181
|
+
O,
|
|
3188
3182
|
N.id
|
|
3189
3183
|
);
|
|
3190
3184
|
z.success(
|
|
3191
3185
|
Te.briefing.status === "PAUSED" ? `${Be} paused` : `${Be} resumed`
|
|
3192
|
-
),
|
|
3186
|
+
), Q();
|
|
3193
3187
|
} catch (Te) {
|
|
3194
3188
|
z.error(
|
|
3195
3189
|
Te instanceof Error ? Te.message : `Could not update the ${V} status.`
|
|
@@ -3198,17 +3192,17 @@ function Cn({
|
|
|
3198
3192
|
ie(null);
|
|
3199
3193
|
}
|
|
3200
3194
|
}, de = async () => {
|
|
3201
|
-
if (!j || !
|
|
3195
|
+
if (!j || !_ || !O) return;
|
|
3202
3196
|
const N = j;
|
|
3203
3197
|
ie(N.id);
|
|
3204
3198
|
try {
|
|
3205
3199
|
await ne.deleteBriefing(
|
|
3206
|
-
O,
|
|
3207
3200
|
_,
|
|
3201
|
+
O,
|
|
3208
3202
|
N.id
|
|
3209
3203
|
);
|
|
3210
3204
|
const { noun: V } = se(N);
|
|
3211
|
-
z.success(`${V === "report" ? "Report" : "Briefing"} deleted`), J(null),
|
|
3205
|
+
z.success(`${V === "report" ? "Report" : "Briefing"} deleted`), J(null), Q();
|
|
3212
3206
|
} catch (V) {
|
|
3213
3207
|
z.error(
|
|
3214
3208
|
V instanceof Error ? V.message : "Could not delete the briefing."
|
|
@@ -3217,7 +3211,7 @@ function Cn({
|
|
|
3217
3211
|
ie(null);
|
|
3218
3212
|
}
|
|
3219
3213
|
}, Ht = Le.length;
|
|
3220
|
-
return g.surfaceVisible ? /* @__PURE__ */ r(
|
|
3214
|
+
return g.surfaceVisible ? /* @__PURE__ */ r($r, { open: S, onOpenChange: C, children: [
|
|
3221
3215
|
u ? null : /* @__PURE__ */ t(
|
|
3222
3216
|
en,
|
|
3223
3217
|
{
|
|
@@ -3228,20 +3222,20 @@ function Cn({
|
|
|
3228
3222
|
}
|
|
3229
3223
|
),
|
|
3230
3224
|
/* @__PURE__ */ r(
|
|
3231
|
-
|
|
3225
|
+
jr,
|
|
3232
3226
|
{
|
|
3233
|
-
ref:
|
|
3227
|
+
ref: Ie,
|
|
3234
3228
|
side: "right",
|
|
3235
3229
|
hideClose: !0,
|
|
3236
3230
|
className: "flex h-full w-full flex-col overflow-hidden p-0 outline-none sm:max-w-[560px]",
|
|
3237
3231
|
onOpenAutoFocus: (N) => {
|
|
3238
3232
|
var V;
|
|
3239
|
-
N.preventDefault(), (V =
|
|
3233
|
+
N.preventDefault(), (V = Ie.current) == null || V.focus({ preventScroll: !0 });
|
|
3240
3234
|
},
|
|
3241
3235
|
children: [
|
|
3242
|
-
/* @__PURE__ */ r(
|
|
3243
|
-
/* @__PURE__ */ t(
|
|
3244
|
-
/* @__PURE__ */ t(
|
|
3236
|
+
/* @__PURE__ */ r(Wr, { className: "sr-only", children: [
|
|
3237
|
+
/* @__PURE__ */ t(Hr, { children: "Reports & briefings" }),
|
|
3238
|
+
/* @__PURE__ */ t(qr, { children: "Manage reports and briefings for this dashboard." })
|
|
3245
3239
|
] }),
|
|
3246
3240
|
d ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
|
|
3247
3241
|
/* @__PURE__ */ r(
|
|
@@ -3256,17 +3250,17 @@ function Cn({
|
|
|
3256
3250
|
{
|
|
3257
3251
|
type: "button",
|
|
3258
3252
|
role: "tab",
|
|
3259
|
-
"aria-selected":
|
|
3253
|
+
"aria-selected": X === "author",
|
|
3260
3254
|
disabled: !k,
|
|
3261
|
-
className:
|
|
3255
|
+
className: G(
|
|
3262
3256
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3263
|
-
|
|
3257
|
+
X === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
|
|
3264
3258
|
!k && "cursor-not-allowed opacity-50"
|
|
3265
3259
|
),
|
|
3266
3260
|
onClick: () => {
|
|
3267
3261
|
k && (P(null), b(d), R("dashboard"), E("author"));
|
|
3268
3262
|
},
|
|
3269
|
-
children:
|
|
3263
|
+
children: I ? `Edit ${se(I).noun}` : d === "scheduled_report" ? "Schedule report" : "Create briefing"
|
|
3270
3264
|
}
|
|
3271
3265
|
),
|
|
3272
3266
|
/* @__PURE__ */ t(
|
|
@@ -3274,10 +3268,10 @@ function Cn({
|
|
|
3274
3268
|
{
|
|
3275
3269
|
type: "button",
|
|
3276
3270
|
role: "tab",
|
|
3277
|
-
"aria-selected":
|
|
3278
|
-
className:
|
|
3271
|
+
"aria-selected": X === "list",
|
|
3272
|
+
className: G(
|
|
3279
3273
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3280
|
-
|
|
3274
|
+
X === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
3281
3275
|
),
|
|
3282
3276
|
onClick: () => E("list"),
|
|
3283
3277
|
children: d === "scheduled_report" ? "Manage reports" : "Manage briefings"
|
|
@@ -3293,11 +3287,11 @@ function Cn({
|
|
|
3293
3287
|
onClick: () => C(!1),
|
|
3294
3288
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3295
3289
|
"aria-label": d === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
|
|
3296
|
-
children: /* @__PURE__ */ t(
|
|
3290
|
+
children: /* @__PURE__ */ t(Qe, { className: "h-3.5 w-3.5" })
|
|
3297
3291
|
}
|
|
3298
3292
|
)
|
|
3299
3293
|
] }) : null,
|
|
3300
|
-
|
|
3294
|
+
X === "list" ? /* @__PURE__ */ t(
|
|
3301
3295
|
dn,
|
|
3302
3296
|
{
|
|
3303
3297
|
briefings: Le,
|
|
@@ -3326,32 +3320,32 @@ function Cn({
|
|
|
3326
3320
|
},
|
|
3327
3321
|
onDelete: (N) => J(N),
|
|
3328
3322
|
selectingId: oe,
|
|
3329
|
-
busyId:
|
|
3323
|
+
busyId: Fe,
|
|
3330
3324
|
manageBriefingsHref: c,
|
|
3331
3325
|
contentKind: d === "scheduled_report" ? "reports" : d === "analytical_briefing" ? "briefings" : void 0,
|
|
3332
3326
|
hideHeader: !!d
|
|
3333
3327
|
}
|
|
3334
3328
|
) : /* @__PURE__ */ t(
|
|
3335
|
-
|
|
3329
|
+
Gr,
|
|
3336
3330
|
{
|
|
3337
|
-
apiServiceUrl:
|
|
3338
|
-
token:
|
|
3339
|
-
briefing:
|
|
3331
|
+
apiServiceUrl: _,
|
|
3332
|
+
token: O,
|
|
3333
|
+
briefing: I,
|
|
3340
3334
|
intent: U,
|
|
3341
|
-
sourceContext:
|
|
3342
|
-
title:
|
|
3335
|
+
sourceContext: I ? void 0 : Ke,
|
|
3336
|
+
title: I ? `Edit ${se(I).noun}` : U === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
|
|
3343
3337
|
hideHeader: !!d,
|
|
3344
3338
|
className: "h-full min-h-0 max-w-none border-0 shadow-none",
|
|
3345
3339
|
onBack: d ? void 0 : () => E("list"),
|
|
3346
3340
|
onCancel: () => C(!1),
|
|
3347
3341
|
onDeleted: () => {
|
|
3348
|
-
const N =
|
|
3349
|
-
z.success(`${N === "report" ? "Report" : "Briefing"} deleted`), P(null), E("list"),
|
|
3342
|
+
const N = I ? se(I).noun : "briefing";
|
|
3343
|
+
z.success(`${N === "report" ? "Report" : "Briefing"} deleted`), P(null), E("list"), Q();
|
|
3350
3344
|
},
|
|
3351
3345
|
onRunStarted: () => {
|
|
3352
3346
|
},
|
|
3353
3347
|
onSaved: (N) => {
|
|
3354
|
-
P(N),
|
|
3348
|
+
P(N), Q();
|
|
3355
3349
|
},
|
|
3356
3350
|
onMinimizeRun: ({ briefing: N, run: V }) => {
|
|
3357
3351
|
pe({ briefing: N, run: V }), C(!1);
|
|
@@ -3361,69 +3355,69 @@ function Cn({
|
|
|
3361
3355
|
]
|
|
3362
3356
|
}
|
|
3363
3357
|
),
|
|
3364
|
-
ue &&
|
|
3358
|
+
ue && _ && O ? /* @__PURE__ */ t(
|
|
3365
3359
|
yn,
|
|
3366
3360
|
{
|
|
3367
3361
|
briefingId: ue.briefing.id,
|
|
3368
3362
|
initialRun: ue.run,
|
|
3369
|
-
apiServiceUrl:
|
|
3370
|
-
token:
|
|
3363
|
+
apiServiceUrl: _,
|
|
3364
|
+
token: O,
|
|
3371
3365
|
onTerminal: (N) => {
|
|
3372
3366
|
ve({
|
|
3373
3367
|
briefing: ue.briefing,
|
|
3374
3368
|
run: N
|
|
3375
|
-
}), pe(null),
|
|
3369
|
+
}), pe(null), Q();
|
|
3376
3370
|
},
|
|
3377
3371
|
onTimeout: () => {
|
|
3378
|
-
pe(null),
|
|
3372
|
+
pe(null), Q();
|
|
3379
3373
|
},
|
|
3380
3374
|
onExpand: () => {
|
|
3381
3375
|
P(ue.briefing), E("author"), pe(null), C(!0);
|
|
3382
3376
|
}
|
|
3383
3377
|
}
|
|
3384
3378
|
) : null,
|
|
3385
|
-
|
|
3386
|
-
|
|
3379
|
+
Y ? /* @__PURE__ */ t("div", { className: "fixed bottom-4 right-4 z-50 w-[360px]", children: /* @__PURE__ */ t(
|
|
3380
|
+
Qr,
|
|
3387
3381
|
{
|
|
3388
|
-
title:
|
|
3389
|
-
durationSeconds:
|
|
3382
|
+
title: Y.run.status === "SUCCESS" ? `${Y.briefing.name} is ready` : `${Y.briefing.name} run failed`,
|
|
3383
|
+
durationSeconds: Y.run.startedAt && Y.run.completedAt ? Math.max(
|
|
3390
3384
|
0,
|
|
3391
3385
|
Math.floor(
|
|
3392
|
-
(new Date(
|
|
3386
|
+
(new Date(Y.run.completedAt).getTime() - new Date(Y.run.startedAt).getTime()) / 1e3
|
|
3393
3387
|
)
|
|
3394
3388
|
) : null,
|
|
3395
|
-
status:
|
|
3389
|
+
status: Y.run.status === "SUCCESS" ? "success" : "failed",
|
|
3396
3390
|
onView: () => {
|
|
3397
|
-
P(
|
|
3391
|
+
P(Y.briefing), E("author"), ve(null), C(!0);
|
|
3398
3392
|
},
|
|
3399
3393
|
onDismiss: () => ve(null)
|
|
3400
3394
|
}
|
|
3401
3395
|
) }) : null,
|
|
3402
3396
|
/* @__PURE__ */ t(
|
|
3403
|
-
|
|
3397
|
+
it,
|
|
3404
3398
|
{
|
|
3405
3399
|
open: !!j,
|
|
3406
3400
|
onOpenChange: (N) => {
|
|
3407
3401
|
N || J(null);
|
|
3408
3402
|
},
|
|
3409
|
-
children: /* @__PURE__ */ r(
|
|
3410
|
-
/* @__PURE__ */ r(
|
|
3411
|
-
/* @__PURE__ */ r(
|
|
3403
|
+
children: /* @__PURE__ */ r(lt, { children: [
|
|
3404
|
+
/* @__PURE__ */ r(dt, { children: [
|
|
3405
|
+
/* @__PURE__ */ r(ct, { children: [
|
|
3412
3406
|
"Delete",
|
|
3413
3407
|
" ",
|
|
3414
3408
|
j ? se(j).noun : "briefing",
|
|
3415
3409
|
"?"
|
|
3416
3410
|
] }),
|
|
3417
|
-
/* @__PURE__ */ r(
|
|
3411
|
+
/* @__PURE__ */ r(ut, { children: [
|
|
3418
3412
|
"This permanently deletes ",
|
|
3419
3413
|
/* @__PURE__ */ t("strong", { children: j == null ? void 0 : j.name }),
|
|
3420
3414
|
". Recipients will stop receiving it."
|
|
3421
3415
|
] })
|
|
3422
3416
|
] }),
|
|
3423
|
-
/* @__PURE__ */ r(
|
|
3424
|
-
/* @__PURE__ */ t(
|
|
3417
|
+
/* @__PURE__ */ r(ht, { children: [
|
|
3418
|
+
/* @__PURE__ */ t(mt, { children: "Cancel" }),
|
|
3425
3419
|
/* @__PURE__ */ r(
|
|
3426
|
-
|
|
3420
|
+
Ut,
|
|
3427
3421
|
{
|
|
3428
3422
|
className: "bg-destructive/90 hover:bg-destructive",
|
|
3429
3423
|
onClick: de,
|
|
@@ -3444,20 +3438,20 @@ function wn() {
|
|
|
3444
3438
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `briefing-run-now-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
3445
3439
|
}
|
|
3446
3440
|
export {
|
|
3447
|
-
|
|
3441
|
+
Wn as A,
|
|
3448
3442
|
$a as D,
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3443
|
+
Oa as E,
|
|
3444
|
+
Qn as N,
|
|
3445
|
+
Hn as U,
|
|
3446
|
+
zn as V,
|
|
3453
3447
|
en as W,
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3448
|
+
jn as a,
|
|
3449
|
+
_a as b,
|
|
3450
|
+
qn as c,
|
|
3451
|
+
Gn as d,
|
|
3458
3452
|
Wa as e,
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3453
|
+
Ka as f,
|
|
3454
|
+
Kn as g,
|
|
3455
|
+
Yn as h,
|
|
3456
|
+
$n as u
|
|
3463
3457
|
};
|