react-semaphor 0.1.547 → 0.1.549
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/analytics-protocol/index.js +1 -1
- package/dist/assistant-context/index.js +1 -1
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/{assistant-chat-CK84cPAB.js → assistant-chat-CUSvuESS.js} +1831 -1846
- package/dist/chunks/{custom-visual-inputs-ChL54gGm.js → custom-visual-inputs-CwAcigQS.js} +1 -1
- package/dist/chunks/{dashboard-DCk26-6i.js → dashboard-Cm7WkARH.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CQ1eYsGy.js → dashboard-briefing-launcher-X0HzNpS8.js} +627 -629
- package/dist/chunks/{dashboard-controls-BMeZjF7r.js → dashboard-controls-BuX6TMNK.js} +219 -219
- package/dist/chunks/{dashboard-json-BZqCoanC.js → dashboard-json-Cc4u2xvy.js} +1 -1
- package/dist/chunks/{document-dashboard-inputs-tYd7ao0o.js → document-dashboard-inputs-DPQ_wUGD.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-Bv3MHM_G.js → edit-dashboard-visual-DX2CzibK.js} +606 -606
- package/dist/chunks/{filter-reach-copy-CGWsL_ez.js → filter-reach-copy-Bc-Gei83.js} +4 -4
- package/dist/chunks/{global-date-filter-utils-BhAu8zIM.js → global-date-filter-utils-CnumW4j2.js} +1657 -1652
- package/dist/chunks/{index-DmrLP5Ro.js → index-DzsdV1o4.js} +3 -3
- package/dist/chunks/{raw-temporal-presentation-DypB7sMX.js → raw-temporal-presentation-CBKeEPYA.js} +1 -1
- package/dist/chunks/report-preferences-dialog-B9oYQ6OJ.js +2180 -0
- package/dist/chunks/{resolve-dashboard-input-context-D0JDUa4h.js → resolve-dashboard-input-context-DVWF7p5C.js} +2 -2
- package/dist/chunks/{saved-dashboard-context-BfAH5j4L.js → saved-dashboard-context-BMqMzNAo.js} +4 -4
- package/dist/chunks/{semaphor-ready-indicator-CRm17oIP.js → semaphor-ready-indicator-wWkPH4ue.js} +23405 -23367
- package/dist/chunks/{shelf-drop-preview-context-vy6P9THz.js → shelf-drop-preview-context-B86d8IZO.js} +3 -3
- package/dist/chunks/{source-entity-resolution-BIGRvtbG.js → source-entity-resolution-D195CrYS.js} +221 -192
- package/dist/chunks/{use-create-flow-overlay-state-Csx_Xjsh.js → use-create-flow-overlay-state-DPNjYyi3.js} +2 -2
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +7 -7
- package/dist/data-app-sdk-validation/index.js +1 -1
- package/dist/index.js +12 -12
- package/dist/live-channel/index.js +124 -0
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/components/surfboard/dashboard-plus.d.ts +1 -1
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +42 -6
- package/dist/types/lib/stores/dashboard-store.d.ts +9 -0
- package/dist/types/lib/types/common-types.d.ts +26 -1
- package/dist/types/live-channel.d.ts +2 -0
- package/dist/types/shared/assistant-protocol/parts.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +14 -44
- package/dist/types/shared/live-channel/index.d.ts +1 -0
- package/dist/types/shared/live-channel/live-channel-contract.d.ts +126 -0
- package/package.json +5 -1
- package/dist/chunks/report-preferences-dialog-DoVyriYC.js +0 -1977
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as e, jsxs as r, Fragment as
|
|
2
|
-
import Et, { useState as
|
|
3
|
-
import {
|
|
4
|
-
import { B as
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import Et, { useState as k, useEffect as xe, useCallback as ee, useMemo as ae, useLayoutEffect as kt, useRef as nt, useContext as Gt } from "react";
|
|
3
|
+
import { cD as ot, bI as Fe, bJ as Ee, bL as Ie, cE as Xt, b2 as It, b0 as Qe, cF as Yt, cG as Ke, cH as it, a4 as Ge, a1 as de, u as w, cI as Jt, cJ as Zt, bH as E, cK as ea, a3 as Z, be as ta, cL as aa, cM as ra, aX as ve, cs as Lt, aO as _e, o as na, k as sa, cN as oa, cv as lt, cw as dt, cx as ct, cy as ut, cz as ht, cA as mt, cB as pt, cC as Vt, aM as ft, cO as ia, cP as la, cl as et, ci as Le, cj as Ve, cQ as Tt, ck as Te, c4 as G, ct as da, cr as je, cR as ca, c2 as ua, bK as gt, bM as bt, cS as ha, bG as ma, cT as Bt, bu as xt, cU as pa, bv as fa, i as ga, cV as ba, cW as xa, cX as K, cY as va, R as Pt, cZ as ya, c_ as Ca, c$ as wa, d0 as Na, aJ as Sa, d1 as ue, d2 as ka, P as vt, d3 as Da, d4 as Aa, d5 as Fa, d6 as Ea, d7 as Ia, d8 as La, d9 as Va, da as Mt, db as Ta, dc as Ba, dd as Pa, de as Ut, df as Ma, dg as Re, dh as Ua, di as Ra, dj as za, A as Oa, ay as _a, az as ja, ae as $a, ad as Wa, ac as qa, ab as Ha, a8 as Qa, a6 as Ka, dk as Ga, dl as Xa, dm as Ya, dn as Ja, dp as Za, aw as er } from "./semaphor-ready-indicator-wWkPH4ue.js";
|
|
4
|
+
import { B as I, l as De, q as st, L as re, j as Rt, c as yt, i as tr, P as $e, a as We, b as qe, S as zt } from "./switch-CEBOR4n7.js";
|
|
5
5
|
import { L as Ae } from "./layout-grid-Bgzth8vd.js";
|
|
6
6
|
import { c as fe, X as Xe, C as Ct } from "./x-4f5U2XwU.js";
|
|
7
7
|
import "./index-CuHybtft.js";
|
|
@@ -13,17 +13,17 @@ import "../value-format-preferences/index.js";
|
|
|
13
13
|
import { c as J } from "./_commonjsHelpers-DimLPMtv.js";
|
|
14
14
|
import { S as rr } from "./selection-reducer-CJzkTZio.js";
|
|
15
15
|
import { s as ze } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
|
|
16
|
-
import { aL as nr, ay as sr, e1 as He, v as Dt, e2 as or, as as wt, e3 as ir, dq as lr, dc as dr, bp as cr, e4 as ur } from "./global-date-filter-utils-
|
|
16
|
+
import { aL as nr, ay as sr, e1 as He, v as Dt, e2 as or, as as wt, e3 as ir, dq as lr, dc as dr, bp as cr, e4 as ur } from "./global-date-filter-utils-CnumW4j2.js";
|
|
17
17
|
import { f as hr } from "./editor-draft-sync-BN5qYHPF.js";
|
|
18
18
|
import "react-dom";
|
|
19
19
|
import "./pivot-result-lifecycle-pwq3b7LC.js";
|
|
20
20
|
import "./index-CtoK1Lgu.js";
|
|
21
21
|
import { I as mr } from "./table-settings-WysCBj62.js";
|
|
22
22
|
import { S as Ot } from "./save-CfJpQQ68.js";
|
|
23
|
-
import { V as pr, L as fr, a as gr, u as _t, C as jt, F as br, b as xr } from "./use-create-flow-overlay-state-
|
|
23
|
+
import { V as pr, L as fr, a as gr, u as _t, C as jt, F as br, b as xr } from "./use-create-flow-overlay-state-DPNjYyi3.js";
|
|
24
24
|
import { q as At } from "./matrix-formatter-DWEeC0_c.js";
|
|
25
|
-
import { g as vr, f as yr } from "./document-dashboard-inputs-
|
|
26
|
-
import { g as le, d as Cr, a as wr } from "./index-
|
|
25
|
+
import { g as vr, f as yr } from "./document-dashboard-inputs-DPQ_wUGD.js";
|
|
26
|
+
import { g as le, d as Cr, a as wr } from "./index-DzsdV1o4.js";
|
|
27
27
|
/**
|
|
28
28
|
* @license lucide-react v0.453.0 - ISC
|
|
29
29
|
*
|
|
@@ -138,8 +138,8 @@ function Lr({
|
|
|
138
138
|
onSubmit: o,
|
|
139
139
|
isCreating: s
|
|
140
140
|
}) {
|
|
141
|
-
const i = ot("interactive"), [n, c] =
|
|
142
|
-
|
|
141
|
+
const i = ot("interactive"), [n, c] = k(""), [d, l] = k("");
|
|
142
|
+
xe(() => {
|
|
143
143
|
t || (c(""), l(""));
|
|
144
144
|
}, [t]);
|
|
145
145
|
const u = () => {
|
|
@@ -163,7 +163,7 @@ function Lr({
|
|
|
163
163
|
] })
|
|
164
164
|
] }),
|
|
165
165
|
/* @__PURE__ */ e(
|
|
166
|
-
|
|
166
|
+
I,
|
|
167
167
|
{
|
|
168
168
|
size: "xs",
|
|
169
169
|
variant: "ghost",
|
|
@@ -211,7 +211,7 @@ function Lr({
|
|
|
211
211
|
] }),
|
|
212
212
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 justify-end gap-2 border-t border-border/60 px-4 py-2.5", children: [
|
|
213
213
|
/* @__PURE__ */ e(
|
|
214
|
-
|
|
214
|
+
I,
|
|
215
215
|
{
|
|
216
216
|
size: "xs",
|
|
217
217
|
variant: "outline",
|
|
@@ -221,13 +221,13 @@ function Lr({
|
|
|
221
221
|
}
|
|
222
222
|
),
|
|
223
223
|
/* @__PURE__ */ e(
|
|
224
|
-
|
|
224
|
+
I,
|
|
225
225
|
{
|
|
226
226
|
size: "xs",
|
|
227
227
|
onClick: u,
|
|
228
228
|
disabled: !n.trim() || s,
|
|
229
|
-
children: s ? /* @__PURE__ */ r(
|
|
230
|
-
/* @__PURE__ */ e(
|
|
229
|
+
children: s ? /* @__PURE__ */ r(z, { children: [
|
|
230
|
+
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
231
231
|
"Creating..."
|
|
232
232
|
] }) : "Create library visual"
|
|
233
233
|
}
|
|
@@ -238,8 +238,8 @@ function Lr({
|
|
|
238
238
|
) });
|
|
239
239
|
}
|
|
240
240
|
function Vr(t) {
|
|
241
|
-
const [a, o] =
|
|
242
|
-
return
|
|
241
|
+
const [a, o] = k(null), [s, i] = k(null), n = Xt();
|
|
242
|
+
return xe(() => {
|
|
243
243
|
if (!t || t.trim() === "") {
|
|
244
244
|
o(null), i(null);
|
|
245
245
|
return;
|
|
@@ -311,7 +311,7 @@ async function Ft(t, a, o, s, i = "Opening library visual...") {
|
|
|
311
311
|
if (c)
|
|
312
312
|
return console.log("Using cached visual data for:", o), { data: c, fromCache: !0 };
|
|
313
313
|
console.log("Fetching visual data from network for:", o);
|
|
314
|
-
const d =
|
|
314
|
+
const d = E.loading(i, {
|
|
315
315
|
position: "top-center"
|
|
316
316
|
});
|
|
317
317
|
try {
|
|
@@ -326,9 +326,9 @@ async function Ft(t, a, o, s, i = "Opening library visual...") {
|
|
|
326
326
|
if (!l.ok)
|
|
327
327
|
throw new Error("Failed to load visual");
|
|
328
328
|
const u = await l.json();
|
|
329
|
-
return s.setQueryData(n, u),
|
|
329
|
+
return s.setQueryData(n, u), E.dismiss(d), { data: u, fromCache: !1 };
|
|
330
330
|
} catch (l) {
|
|
331
|
-
throw
|
|
331
|
+
throw E.dismiss(d), l;
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
function $t(t) {
|
|
@@ -357,13 +357,13 @@ function Br(t, a) {
|
|
|
357
357
|
}), !0) : !1;
|
|
358
358
|
}
|
|
359
359
|
function Pr() {
|
|
360
|
-
const t =
|
|
360
|
+
const t = Z(
|
|
361
361
|
(s) => {
|
|
362
362
|
var i;
|
|
363
363
|
return ((i = s.card.customCardPreferences) == null ? void 0 : i.url) || "";
|
|
364
364
|
}
|
|
365
365
|
), a = Vr(t);
|
|
366
|
-
return { getUpdatedFrame:
|
|
366
|
+
return { getUpdatedFrame: ee(() => {
|
|
367
367
|
var f;
|
|
368
368
|
hr();
|
|
369
369
|
const {
|
|
@@ -374,7 +374,7 @@ function Pr() {
|
|
|
374
374
|
selectedDatabaseName: d,
|
|
375
375
|
selectedTableName: l,
|
|
376
376
|
selectedConnectionId: u
|
|
377
|
-
} =
|
|
377
|
+
} = Z.getState(), h = i.sql, m = (f = a == null ? void 0 : a.getState()) == null ? void 0 : f.settings, p = nr(i, {
|
|
378
378
|
isDevMode: n,
|
|
379
379
|
cardSql: h,
|
|
380
380
|
selectedSchemaName: c,
|
|
@@ -393,8 +393,8 @@ function Pr() {
|
|
|
393
393
|
};
|
|
394
394
|
}, [a]) };
|
|
395
395
|
}
|
|
396
|
-
function
|
|
397
|
-
const { authToken: t, tokenProps: a } = It(), o = Qe(), s = Yt(), i =
|
|
396
|
+
function ye() {
|
|
397
|
+
const { authToken: t, tokenProps: a } = It(), o = Qe(), s = Yt(), i = Ke(), { selectVisual: n } = it(), {
|
|
398
398
|
setFrame: c,
|
|
399
399
|
setCard: d,
|
|
400
400
|
setIsDevMode: l,
|
|
@@ -405,32 +405,31 @@ function ve() {
|
|
|
405
405
|
setSelectedConnectionId: g,
|
|
406
406
|
setSelectedDatabaseName: f,
|
|
407
407
|
setSelectedSchemaName: v,
|
|
408
|
-
setSelectedTableName:
|
|
409
|
-
setSelectedDatamodelId:
|
|
410
|
-
setInlineFilterValuesMap:
|
|
411
|
-
setApplyFilters:
|
|
408
|
+
setSelectedTableName: S,
|
|
409
|
+
setSelectedDatamodelId: T,
|
|
410
|
+
setInlineFilterValuesMap: U,
|
|
411
|
+
setApplyFilters: M,
|
|
412
412
|
clearEditorContext: A
|
|
413
|
-
} =
|
|
414
|
-
setIsDashboardEditing:
|
|
415
|
-
setIsVisualEditing:
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
), T = Zt((i == null ? void 0 : i.id) || "", {
|
|
413
|
+
} = Ge(), {
|
|
414
|
+
setIsDashboardEditing: R,
|
|
415
|
+
setIsVisualEditing: b,
|
|
416
|
+
clearSelectedFrameId: F
|
|
417
|
+
} = de(), C = w((V) => V.selectedSheetId), D = w((V) => V.selectedFrameId), N = w((V) => V.dashboard), j = w(
|
|
418
|
+
(V) => V.inlineFilterValuesMap
|
|
419
|
+
), L = Jt((i == null ? void 0 : i.id) || "", {
|
|
421
420
|
enabled: !!(i != null && i.id) && !!(t != null && t.accessToken)
|
|
422
|
-
}),
|
|
423
|
-
async (
|
|
421
|
+
}), O = ee(
|
|
422
|
+
async (V) => {
|
|
424
423
|
try {
|
|
425
|
-
n(
|
|
426
|
-
const { data:
|
|
424
|
+
n(V), F(), A();
|
|
425
|
+
const { data: te, fromCache: Y } = await Ft(
|
|
427
426
|
a.apiServiceUrl,
|
|
428
427
|
(t == null ? void 0 : t.accessToken) || "",
|
|
429
|
-
|
|
428
|
+
V.id,
|
|
430
429
|
o,
|
|
431
430
|
"Opening library visual..."
|
|
432
431
|
);
|
|
433
|
-
if (!Br(
|
|
432
|
+
if (!Br(te, {
|
|
434
433
|
setFrame: c,
|
|
435
434
|
setCard: d,
|
|
436
435
|
setIsDevMode: l,
|
|
@@ -441,21 +440,21 @@ function ve() {
|
|
|
441
440
|
setSelectedConnectionId: g,
|
|
442
441
|
setSelectedDatabaseName: f,
|
|
443
442
|
setSelectedSchemaName: v,
|
|
444
|
-
setSelectedTableName:
|
|
445
|
-
setSelectedDatamodelId:
|
|
446
|
-
setInlineFilterValuesMap:
|
|
447
|
-
setApplyFilters:
|
|
448
|
-
setIsDashboardEditing:
|
|
449
|
-
setIsVisualEditing:
|
|
450
|
-
dashboard:
|
|
451
|
-
selectedSheetId:
|
|
452
|
-
selectedFrameId:
|
|
453
|
-
inlineFilterValuesMap:
|
|
443
|
+
setSelectedTableName: S,
|
|
444
|
+
setSelectedDatamodelId: T,
|
|
445
|
+
setInlineFilterValuesMap: U,
|
|
446
|
+
setApplyFilters: M,
|
|
447
|
+
setIsDashboardEditing: R,
|
|
448
|
+
setIsVisualEditing: b,
|
|
449
|
+
dashboard: N,
|
|
450
|
+
selectedSheetId: C,
|
|
451
|
+
selectedFrameId: D,
|
|
452
|
+
inlineFilterValuesMap: j
|
|
454
453
|
}))
|
|
455
454
|
throw new Error("Failed to setup editor with visual data");
|
|
456
|
-
return { success: !0, fromCache:
|
|
457
|
-
} catch (
|
|
458
|
-
return console.error("Error editing visual:",
|
|
455
|
+
return { success: !0, fromCache: Y };
|
|
456
|
+
} catch (te) {
|
|
457
|
+
return console.error("Error editing visual:", te), { success: !1, error: "Failed to load visual for editing" };
|
|
459
458
|
}
|
|
460
459
|
},
|
|
461
460
|
[
|
|
@@ -465,8 +464,8 @@ function ve() {
|
|
|
465
464
|
n,
|
|
466
465
|
c,
|
|
467
466
|
d,
|
|
468
|
-
|
|
469
|
-
|
|
467
|
+
R,
|
|
468
|
+
b,
|
|
470
469
|
l,
|
|
471
470
|
u,
|
|
472
471
|
h,
|
|
@@ -475,45 +474,45 @@ function ve() {
|
|
|
475
474
|
g,
|
|
476
475
|
f,
|
|
477
476
|
v,
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
M,
|
|
477
|
+
S,
|
|
478
|
+
T,
|
|
481
479
|
U,
|
|
480
|
+
M,
|
|
482
481
|
A,
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
482
|
+
F,
|
|
483
|
+
N,
|
|
484
|
+
C,
|
|
485
|
+
D,
|
|
486
|
+
j
|
|
488
487
|
]
|
|
489
|
-
),
|
|
490
|
-
async (
|
|
491
|
-
var
|
|
492
|
-
const
|
|
488
|
+
), X = ee(
|
|
489
|
+
async (V) => {
|
|
490
|
+
var Y;
|
|
491
|
+
const te = (H) => (E.error(H), { success: !1, error: H });
|
|
493
492
|
try {
|
|
494
|
-
if (n(
|
|
495
|
-
return
|
|
496
|
-
const { data:
|
|
493
|
+
if (n(V), !C)
|
|
494
|
+
return te("No sheet selected. Please select a sheet first.");
|
|
495
|
+
const { data: H, fromCache: he } = await Ft(
|
|
497
496
|
a.apiServiceUrl,
|
|
498
497
|
(t == null ? void 0 : t.accessToken) || "",
|
|
499
|
-
|
|
498
|
+
V.id,
|
|
500
499
|
o,
|
|
501
500
|
"Adding visual to dashboard..."
|
|
502
|
-
),
|
|
503
|
-
if (!
|
|
504
|
-
return
|
|
505
|
-
const
|
|
506
|
-
if (!(
|
|
507
|
-
return
|
|
508
|
-
const
|
|
509
|
-
...
|
|
510
|
-
visualId:
|
|
501
|
+
), ge = (H == null ? void 0 : H.frameObject) ?? ((Y = H == null ? void 0 : H.visual) == null ? void 0 : Y.frameObject);
|
|
502
|
+
if (!ge)
|
|
503
|
+
return te("Visual has no frame data");
|
|
504
|
+
const Q = $t(ge);
|
|
505
|
+
if (!(Q != null && Q.cards) || Q.cards.length === 0)
|
|
506
|
+
return te("Visual frame is malformed");
|
|
507
|
+
const _ = {
|
|
508
|
+
...Zt(Q),
|
|
509
|
+
visualId: V.id
|
|
511
510
|
// Link this frame to the library visual
|
|
512
511
|
};
|
|
513
|
-
return await s(
|
|
514
|
-
} catch (
|
|
515
|
-
return console.error("Error adding visual:",
|
|
516
|
-
|
|
512
|
+
return await s(C, _), R(!0), { success: !0, fromCache: he };
|
|
513
|
+
} catch (H) {
|
|
514
|
+
return console.error("Error adding visual:", H), te(
|
|
515
|
+
H instanceof Error ? H.message : "Failed to add visual to dashboard"
|
|
517
516
|
);
|
|
518
517
|
}
|
|
519
518
|
},
|
|
@@ -522,21 +521,20 @@ function ve() {
|
|
|
522
521
|
a.apiServiceUrl,
|
|
523
522
|
o,
|
|
524
523
|
n,
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
w,
|
|
524
|
+
C,
|
|
525
|
+
R,
|
|
528
526
|
s
|
|
529
527
|
]
|
|
530
528
|
);
|
|
531
529
|
return {
|
|
532
|
-
visual:
|
|
533
|
-
isLoading:
|
|
534
|
-
isError:
|
|
535
|
-
error:
|
|
536
|
-
handleEditLibraryVisual:
|
|
537
|
-
handleAddLibraryVisual:
|
|
530
|
+
visual: L.data,
|
|
531
|
+
isLoading: L.isLoading,
|
|
532
|
+
isError: L.isError,
|
|
533
|
+
error: L.error,
|
|
534
|
+
handleEditLibraryVisual: O,
|
|
535
|
+
handleAddLibraryVisual: X,
|
|
538
536
|
getUpdatedFrame: Pr().getUpdatedFrame,
|
|
539
|
-
refetch:
|
|
537
|
+
refetch: L.refetch
|
|
540
538
|
};
|
|
541
539
|
}
|
|
542
540
|
function Wt(t) {
|
|
@@ -570,148 +568,148 @@ function ts({
|
|
|
570
568
|
open: t,
|
|
571
569
|
onOpenChange: a
|
|
572
570
|
}) {
|
|
573
|
-
const o = ot("interactive"), [s, i] =
|
|
571
|
+
const o = ot("interactive"), [s, i] = k(""), [n, c] = k(/* @__PURE__ */ new Set()), [d, l] = k(!1), [u, h] = k(
|
|
574
572
|
null
|
|
575
|
-
), [m, p] =
|
|
573
|
+
), [m, p] = k(
|
|
576
574
|
null
|
|
577
|
-
), [g, f] =
|
|
578
|
-
c(/* @__PURE__ */ new Set()), h(null), p(null), f(!1),
|
|
575
|
+
), [g, f] = k(!1), [v, S] = k(null), [T, U] = k(null), M = () => {
|
|
576
|
+
c(/* @__PURE__ */ new Set()), h(null), p(null), f(!1), S(null);
|
|
579
577
|
}, A = () => {
|
|
580
|
-
a(!1),
|
|
581
|
-
}, { selectVisual:
|
|
582
|
-
resources:
|
|
583
|
-
isLoading:
|
|
578
|
+
a(!1), M();
|
|
579
|
+
}, { selectVisual: R } = it(), { handleAddLibraryVisual: b, handleEditLibraryVisual: F } = ye(), { isConsoleMode: C } = ta(), {
|
|
580
|
+
resources: D,
|
|
581
|
+
isLoading: N,
|
|
584
582
|
isError: j,
|
|
585
|
-
createResource:
|
|
586
|
-
updateResource:
|
|
587
|
-
deleteResourceAsync:
|
|
588
|
-
duplicateResource:
|
|
589
|
-
isCreating:
|
|
590
|
-
isDeleting:
|
|
583
|
+
createResource: L,
|
|
584
|
+
updateResource: O,
|
|
585
|
+
deleteResourceAsync: X,
|
|
586
|
+
duplicateResource: V,
|
|
587
|
+
isCreating: te,
|
|
588
|
+
isDeleting: Y
|
|
591
589
|
} = aa(
|
|
592
590
|
void 0,
|
|
593
|
-
(
|
|
594
|
-
l(!1),
|
|
591
|
+
(x) => {
|
|
592
|
+
l(!1), x && (R(x), F(x), A());
|
|
595
593
|
}
|
|
596
594
|
), {
|
|
597
|
-
startUpdating:
|
|
598
|
-
stopUpdating:
|
|
599
|
-
isUpdating:
|
|
600
|
-
} = ra(),
|
|
601
|
-
const
|
|
602
|
-
return
|
|
595
|
+
startUpdating: H,
|
|
596
|
+
stopUpdating: he,
|
|
597
|
+
isUpdating: ge
|
|
598
|
+
} = ra(), Q = D, _ = ae(() => {
|
|
599
|
+
const x = s.trim().toLowerCase();
|
|
600
|
+
return x ? Q.filter(
|
|
603
601
|
(B) => {
|
|
604
|
-
var q, ie,
|
|
605
|
-
return ((q = B.title) == null ? void 0 : q.toLowerCase().includes(
|
|
602
|
+
var q, ie, ce;
|
|
603
|
+
return ((q = B.title) == null ? void 0 : q.toLowerCase().includes(x)) || ((ie = B.description) == null ? void 0 : ie.toLowerCase().includes(x)) || ((ce = B.kind) == null ? void 0 : ce.toLowerCase().includes(x));
|
|
606
604
|
}
|
|
607
|
-
) :
|
|
608
|
-
}, [s,
|
|
609
|
-
() =>
|
|
610
|
-
(
|
|
605
|
+
) : Q;
|
|
606
|
+
}, [s, Q]), oe = ae(
|
|
607
|
+
() => Q.filter(
|
|
608
|
+
(x) => n.has(x.id)
|
|
611
609
|
),
|
|
612
|
-
[n,
|
|
613
|
-
), me =
|
|
614
|
-
(
|
|
615
|
-
), pe =
|
|
616
|
-
(
|
|
617
|
-
), Ce =
|
|
618
|
-
(
|
|
619
|
-
), Be =
|
|
620
|
-
(
|
|
621
|
-
), Ye = (
|
|
610
|
+
[n, Q]
|
|
611
|
+
), me = oe.filter(
|
|
612
|
+
(x) => x.permissions.canDelete
|
|
613
|
+
), pe = oe.filter(
|
|
614
|
+
(x) => x.permissions.canShare
|
|
615
|
+
), Ce = _.length > 0 && _.every(
|
|
616
|
+
(x) => n.has(x.id)
|
|
617
|
+
), Be = _.some(
|
|
618
|
+
(x) => n.has(x.id)
|
|
619
|
+
), Ye = (x) => {
|
|
622
620
|
const B = new Set(n);
|
|
623
|
-
|
|
624
|
-
}, $ = (
|
|
621
|
+
x(B), c(B);
|
|
622
|
+
}, $ = (x) => {
|
|
625
623
|
Ye((B) => {
|
|
626
|
-
B.has(
|
|
624
|
+
B.has(x) ? B.delete(x) : B.add(x);
|
|
627
625
|
});
|
|
628
626
|
}, W = () => {
|
|
629
|
-
c((
|
|
630
|
-
const B = new Set(
|
|
631
|
-
return Ce ?
|
|
627
|
+
c((x) => {
|
|
628
|
+
const B = new Set(x);
|
|
629
|
+
return Ce ? _.forEach(
|
|
632
630
|
(q) => B.delete(q.id)
|
|
633
|
-
) :
|
|
631
|
+
) : _.forEach(
|
|
634
632
|
(q) => B.add(q.id)
|
|
635
633
|
), B;
|
|
636
634
|
});
|
|
637
|
-
},
|
|
638
|
-
(await
|
|
635
|
+
}, ne = async (x) => {
|
|
636
|
+
(await b(x)).success && A();
|
|
639
637
|
}, we = async () => {
|
|
640
|
-
const
|
|
641
|
-
if (
|
|
638
|
+
const x = oe;
|
|
639
|
+
if (x.length === 0) return;
|
|
642
640
|
let B = !1;
|
|
643
|
-
for (const q of
|
|
644
|
-
if (!(await
|
|
641
|
+
for (const q of x)
|
|
642
|
+
if (!(await b(q)).success) {
|
|
645
643
|
B = !0;
|
|
646
644
|
break;
|
|
647
645
|
}
|
|
648
646
|
B || A();
|
|
649
|
-
},
|
|
650
|
-
|
|
651
|
-
},
|
|
652
|
-
|
|
653
|
-
onSettled: () =>
|
|
647
|
+
}, Je = (x) => {
|
|
648
|
+
F(x), A();
|
|
649
|
+
}, be = (x) => {
|
|
650
|
+
U(x), V(x, {
|
|
651
|
+
onSettled: () => U(null)
|
|
654
652
|
});
|
|
655
653
|
}, Pe = () => {
|
|
656
654
|
if (me.length === 0) {
|
|
657
|
-
|
|
655
|
+
E.error("Select a visual you can delete");
|
|
658
656
|
return;
|
|
659
657
|
}
|
|
660
|
-
|
|
661
|
-
},
|
|
662
|
-
const
|
|
658
|
+
S(null), f(!0);
|
|
659
|
+
}, Ze = async () => {
|
|
660
|
+
const x = v ? [v] : me;
|
|
663
661
|
try {
|
|
664
|
-
for (const B of
|
|
665
|
-
await
|
|
662
|
+
for (const B of x)
|
|
663
|
+
await X(B.id);
|
|
666
664
|
c((B) => {
|
|
667
665
|
const q = new Set(B);
|
|
668
|
-
return
|
|
666
|
+
return x.forEach(
|
|
669
667
|
(ie) => q.delete(ie.id)
|
|
670
668
|
), q;
|
|
671
|
-
}), f(!1),
|
|
669
|
+
}), f(!1), S(null);
|
|
672
670
|
} catch {
|
|
673
671
|
}
|
|
674
672
|
}, Ne = () => {
|
|
675
|
-
if (
|
|
676
|
-
|
|
673
|
+
if (oe.length !== 1) {
|
|
674
|
+
E.error("Select one visual to share");
|
|
677
675
|
return;
|
|
678
676
|
}
|
|
679
|
-
const [
|
|
680
|
-
if (!
|
|
681
|
-
|
|
677
|
+
const [x] = oe;
|
|
678
|
+
if (!x.permissions.canShare) {
|
|
679
|
+
E.error("You do not have permission to share this visual");
|
|
682
680
|
return;
|
|
683
681
|
}
|
|
684
|
-
h(
|
|
682
|
+
h(x);
|
|
685
683
|
}, Se = ({
|
|
686
|
-
title:
|
|
684
|
+
title: x,
|
|
687
685
|
description: B
|
|
688
686
|
}) => {
|
|
689
687
|
if (!m) return;
|
|
690
688
|
const q = {};
|
|
691
|
-
if (
|
|
689
|
+
if (x !== m.title && (q.title = x), (m.description || "") !== B && (q.description = B), Object.keys(q).length === 0) {
|
|
692
690
|
p(null);
|
|
693
691
|
return;
|
|
694
692
|
}
|
|
695
|
-
const ie = Object.keys(q),
|
|
696
|
-
|
|
693
|
+
const ie = Object.keys(q), ce = ie.length === 1 ? ie[0] : void 0;
|
|
694
|
+
H(m.id, ce), O(
|
|
697
695
|
{
|
|
698
696
|
resourceId: m.id,
|
|
699
697
|
data: q
|
|
700
698
|
},
|
|
701
699
|
{
|
|
702
700
|
onSuccess: () => {
|
|
703
|
-
|
|
701
|
+
he(m.id, ce), p(null);
|
|
704
702
|
},
|
|
705
703
|
onError: () => {
|
|
706
|
-
|
|
704
|
+
he(m.id, ce);
|
|
707
705
|
}
|
|
708
706
|
}
|
|
709
707
|
);
|
|
710
|
-
},
|
|
711
|
-
a(
|
|
708
|
+
}, se = (x) => {
|
|
709
|
+
a(x), x || M();
|
|
712
710
|
}, ke = v ? 1 : me.length;
|
|
713
|
-
return /* @__PURE__ */ r(
|
|
714
|
-
/* @__PURE__ */ e(Fe, { open: t, onOpenChange:
|
|
711
|
+
return /* @__PURE__ */ r(z, { children: [
|
|
712
|
+
/* @__PURE__ */ e(Fe, { open: t, onOpenChange: se, children: /* @__PURE__ */ r(
|
|
715
713
|
Ee,
|
|
716
714
|
{
|
|
717
715
|
showCloseButton: !1,
|
|
@@ -727,12 +725,12 @@ function ts({
|
|
|
727
725
|
] })
|
|
728
726
|
] }),
|
|
729
727
|
/* @__PURE__ */ e(
|
|
730
|
-
|
|
728
|
+
I,
|
|
731
729
|
{
|
|
732
730
|
size: "xs",
|
|
733
731
|
variant: "ghost",
|
|
734
732
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
735
|
-
onClick: () =>
|
|
733
|
+
onClick: () => se(!1),
|
|
736
734
|
"aria-label": "Close visuals library",
|
|
737
735
|
children: "×"
|
|
738
736
|
}
|
|
@@ -746,7 +744,7 @@ function ts({
|
|
|
746
744
|
{
|
|
747
745
|
autoFocus: !0,
|
|
748
746
|
value: s,
|
|
749
|
-
onChange: (
|
|
747
|
+
onChange: (x) => i(x.target.value),
|
|
750
748
|
placeholder: "Search visuals...",
|
|
751
749
|
className: "h-7 w-full rounded-control border border-input bg-background pl-7 pr-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-ring focus:outline-none",
|
|
752
750
|
"aria-label": "Search visuals"
|
|
@@ -754,54 +752,54 @@ function ts({
|
|
|
754
752
|
)
|
|
755
753
|
] }),
|
|
756
754
|
/* @__PURE__ */ r(
|
|
757
|
-
|
|
755
|
+
I,
|
|
758
756
|
{
|
|
759
757
|
size: "xs",
|
|
760
758
|
variant: "outline",
|
|
761
759
|
className: "ml-auto",
|
|
762
760
|
onClick: () => l(!0),
|
|
763
761
|
children: [
|
|
764
|
-
/* @__PURE__ */ e(
|
|
762
|
+
/* @__PURE__ */ e(ve, { className: "h-3.5 w-3.5" }),
|
|
765
763
|
"New library visual"
|
|
766
764
|
]
|
|
767
765
|
}
|
|
768
766
|
)
|
|
769
767
|
] }),
|
|
770
|
-
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children:
|
|
768
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children: N ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(Ir, {}) }) : j ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ e("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : _.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
|
|
771
769
|
/* @__PURE__ */ e(Ae, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
772
770
|
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: s ? "No visuals found" : "No visuals yet" }),
|
|
773
771
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: s ? "Try a different search." : "Create a saved visual to add it here." })
|
|
774
772
|
] }) : /* @__PURE__ */ e(
|
|
775
773
|
zr,
|
|
776
774
|
{
|
|
777
|
-
visuals:
|
|
775
|
+
visuals: _,
|
|
778
776
|
selectedIds: n,
|
|
779
777
|
allFilteredSelected: Ce,
|
|
780
778
|
someFilteredSelected: Be,
|
|
781
779
|
onSelectAll: W,
|
|
782
780
|
onToggleSelection: $,
|
|
783
|
-
onAddVisual:
|
|
784
|
-
onOpenVisual:
|
|
781
|
+
onAddVisual: ne,
|
|
782
|
+
onOpenVisual: Je,
|
|
785
783
|
onEditDetails: p,
|
|
786
784
|
onShareVisual: h,
|
|
787
|
-
onDeleteVisual: (
|
|
788
|
-
|
|
785
|
+
onDeleteVisual: (x) => {
|
|
786
|
+
S(x), f(!0);
|
|
789
787
|
},
|
|
790
|
-
onDuplicateVisual:
|
|
791
|
-
duplicatingId:
|
|
792
|
-
isDeleting:
|
|
793
|
-
isConsoleMode:
|
|
788
|
+
onDuplicateVisual: be,
|
|
789
|
+
duplicatingId: T,
|
|
790
|
+
isDeleting: Y,
|
|
791
|
+
isConsoleMode: C
|
|
794
792
|
}
|
|
795
793
|
) }),
|
|
796
794
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
|
|
797
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children: n.size > 0 && /* @__PURE__ */ r(
|
|
795
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children: n.size > 0 && /* @__PURE__ */ r(z, { children: [
|
|
798
796
|
/* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: [
|
|
799
797
|
/* @__PURE__ */ e("span", { className: "font-medium tabular-nums text-foreground", children: n.size }),
|
|
800
798
|
" ",
|
|
801
799
|
"selected"
|
|
802
800
|
] }),
|
|
803
801
|
/* @__PURE__ */ e(
|
|
804
|
-
|
|
802
|
+
I,
|
|
805
803
|
{
|
|
806
804
|
size: "xs",
|
|
807
805
|
variant: "ghost",
|
|
@@ -810,12 +808,12 @@ function ts({
|
|
|
810
808
|
}
|
|
811
809
|
),
|
|
812
810
|
/* @__PURE__ */ r(
|
|
813
|
-
|
|
811
|
+
I,
|
|
814
812
|
{
|
|
815
813
|
size: "xs",
|
|
816
814
|
variant: "outline",
|
|
817
815
|
onClick: Ne,
|
|
818
|
-
disabled:
|
|
816
|
+
disabled: oe.length !== 1 || pe.length !== 1,
|
|
819
817
|
children: [
|
|
820
818
|
/* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5" }),
|
|
821
819
|
"Share"
|
|
@@ -823,7 +821,7 @@ function ts({
|
|
|
823
821
|
}
|
|
824
822
|
),
|
|
825
823
|
/* @__PURE__ */ r(
|
|
826
|
-
|
|
824
|
+
I,
|
|
827
825
|
{
|
|
828
826
|
size: "xs",
|
|
829
827
|
variant: "outline",
|
|
@@ -840,16 +838,16 @@ function ts({
|
|
|
840
838
|
] }) }),
|
|
841
839
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
842
840
|
/* @__PURE__ */ e(
|
|
843
|
-
|
|
841
|
+
I,
|
|
844
842
|
{
|
|
845
843
|
size: "xs",
|
|
846
844
|
variant: "outline",
|
|
847
|
-
onClick: () =>
|
|
845
|
+
onClick: () => se(!1),
|
|
848
846
|
children: "Close"
|
|
849
847
|
}
|
|
850
848
|
),
|
|
851
849
|
/* @__PURE__ */ r(
|
|
852
|
-
|
|
850
|
+
I,
|
|
853
851
|
{
|
|
854
852
|
size: "xs",
|
|
855
853
|
onClick: we,
|
|
@@ -870,8 +868,8 @@ function ts({
|
|
|
870
868
|
{
|
|
871
869
|
open: d,
|
|
872
870
|
onOpenChange: l,
|
|
873
|
-
onSubmit:
|
|
874
|
-
isCreating:
|
|
871
|
+
onSubmit: L,
|
|
872
|
+
isCreating: te
|
|
875
873
|
}
|
|
876
874
|
),
|
|
877
875
|
u && /* @__PURE__ */ e(
|
|
@@ -891,15 +889,15 @@ function ts({
|
|
|
891
889
|
initialDescription: m.description || "",
|
|
892
890
|
onClose: () => p(null),
|
|
893
891
|
onSave: Se,
|
|
894
|
-
isSaving:
|
|
892
|
+
isSaving: ge(m.id)
|
|
895
893
|
}
|
|
896
894
|
),
|
|
897
895
|
/* @__PURE__ */ e(
|
|
898
896
|
lt,
|
|
899
897
|
{
|
|
900
898
|
open: g,
|
|
901
|
-
onOpenChange: (
|
|
902
|
-
!
|
|
899
|
+
onOpenChange: (x) => {
|
|
900
|
+
!x && Y || (f(x), x || S(null));
|
|
903
901
|
},
|
|
904
902
|
children: /* @__PURE__ */ r(dt, { children: [
|
|
905
903
|
/* @__PURE__ */ r(ct, { children: [
|
|
@@ -913,17 +911,17 @@ function ts({
|
|
|
913
911
|
/* @__PURE__ */ e(ht, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
|
|
914
912
|
] }),
|
|
915
913
|
/* @__PURE__ */ r(mt, { children: [
|
|
916
|
-
/* @__PURE__ */ e(pt, { disabled:
|
|
914
|
+
/* @__PURE__ */ e(pt, { disabled: Y, children: "Cancel" }),
|
|
917
915
|
/* @__PURE__ */ r(
|
|
918
916
|
Vt,
|
|
919
917
|
{
|
|
920
|
-
onClick: (
|
|
921
|
-
|
|
918
|
+
onClick: (x) => {
|
|
919
|
+
x.preventDefault(), Ze();
|
|
922
920
|
},
|
|
923
|
-
disabled:
|
|
921
|
+
disabled: Y || ke === 0,
|
|
924
922
|
children: [
|
|
925
|
-
|
|
926
|
-
|
|
923
|
+
Y ? /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5" }),
|
|
924
|
+
Y ? "Deleting..." : "Delete"
|
|
927
925
|
]
|
|
928
926
|
}
|
|
929
927
|
)
|
|
@@ -1094,7 +1092,7 @@ function _r({
|
|
|
1094
1092
|
onClick: (u) => u.stopPropagation(),
|
|
1095
1093
|
children: [
|
|
1096
1094
|
/* @__PURE__ */ e(
|
|
1097
|
-
|
|
1095
|
+
I,
|
|
1098
1096
|
{
|
|
1099
1097
|
size: "xs",
|
|
1100
1098
|
variant: "ghost",
|
|
@@ -1106,7 +1104,7 @@ function _r({
|
|
|
1106
1104
|
),
|
|
1107
1105
|
/* @__PURE__ */ r(Le, { modal: !1, children: [
|
|
1108
1106
|
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1109
|
-
|
|
1107
|
+
I,
|
|
1110
1108
|
{
|
|
1111
1109
|
size: "xs",
|
|
1112
1110
|
variant: "ghost",
|
|
@@ -1121,33 +1119,33 @@ function _r({
|
|
|
1121
1119
|
align: "end",
|
|
1122
1120
|
className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
1123
1121
|
children: [
|
|
1124
|
-
/* @__PURE__ */ r(
|
|
1122
|
+
/* @__PURE__ */ r(G, { onClick: () => a(t), children: [
|
|
1125
1123
|
/* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" }),
|
|
1126
1124
|
"Edit visual"
|
|
1127
1125
|
] }),
|
|
1128
1126
|
/* @__PURE__ */ r(
|
|
1129
|
-
|
|
1127
|
+
G,
|
|
1130
1128
|
{
|
|
1131
1129
|
onClick: () => n(t.id),
|
|
1132
1130
|
disabled: c === t.id,
|
|
1133
1131
|
children: [
|
|
1134
|
-
c === t.id ? /* @__PURE__ */ e(
|
|
1132
|
+
c === t.id ? /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(da, { className: "h-3.5 w-3.5" }),
|
|
1135
1133
|
c === t.id ? "Duplicating..." : "Duplicate"
|
|
1136
1134
|
]
|
|
1137
1135
|
}
|
|
1138
1136
|
),
|
|
1139
|
-
t.permissions.canEdit && /* @__PURE__ */ r(
|
|
1137
|
+
t.permissions.canEdit && /* @__PURE__ */ r(G, { onClick: () => o(t), children: [
|
|
1140
1138
|
/* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" }),
|
|
1141
1139
|
"Edit details"
|
|
1142
1140
|
] }),
|
|
1143
|
-
t.permissions.canShare && /* @__PURE__ */ r(
|
|
1141
|
+
t.permissions.canShare && /* @__PURE__ */ r(G, { onClick: () => s(t), children: [
|
|
1144
1142
|
/* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5" }),
|
|
1145
1143
|
"Share"
|
|
1146
1144
|
] }),
|
|
1147
|
-
t.permissions.canDelete && /* @__PURE__ */ r(
|
|
1145
|
+
t.permissions.canDelete && /* @__PURE__ */ r(z, { children: [
|
|
1148
1146
|
/* @__PURE__ */ e(je, {}),
|
|
1149
1147
|
/* @__PURE__ */ r(
|
|
1150
|
-
|
|
1148
|
+
G,
|
|
1151
1149
|
{
|
|
1152
1150
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
1153
1151
|
onClick: () => i(t),
|
|
@@ -1179,18 +1177,18 @@ function _r({
|
|
|
1179
1177
|
);
|
|
1180
1178
|
}
|
|
1181
1179
|
function as(t, a, o = !1) {
|
|
1182
|
-
const s =
|
|
1180
|
+
const s = w((u) => u.dashboard), i = w(
|
|
1183
1181
|
(u) => u.isDashboardEditing
|
|
1184
|
-
), n =
|
|
1182
|
+
), n = w(
|
|
1185
1183
|
(u) => u.onDashboardLifecycleEvent
|
|
1186
|
-
), c =
|
|
1187
|
-
const u =
|
|
1184
|
+
), c = ee(() => {
|
|
1185
|
+
const u = w.getState().dashboard;
|
|
1188
1186
|
return a || !t || !u || u.id !== t.id ? !1 : ze(u) !== ze(t);
|
|
1189
1187
|
}, [t, a]);
|
|
1190
|
-
kt(() => (
|
|
1191
|
-
|
|
1188
|
+
kt(() => (w.setState({ checkUnsavedDashboardChanges: c }), () => {
|
|
1189
|
+
w.getState().checkUnsavedDashboardChanges === c && w.setState({ checkUnsavedDashboardChanges: null });
|
|
1192
1190
|
}), [c]);
|
|
1193
|
-
const d =
|
|
1191
|
+
const d = ae(() => !o || a || !s || i && (!t || s.id !== t.id) ? null : {
|
|
1194
1192
|
dashboardId: s.id,
|
|
1195
1193
|
dirty: i && t ? ze(s) !== ze(t) : !1
|
|
1196
1194
|
}, [
|
|
@@ -1226,9 +1224,9 @@ function jr({
|
|
|
1226
1224
|
destinationMode: n = "both",
|
|
1227
1225
|
onConfirm: c
|
|
1228
1226
|
}) {
|
|
1229
|
-
const [d, l] =
|
|
1227
|
+
const [d, l] = k(
|
|
1230
1228
|
o && s ? `Copy of ${s}` : s || ""
|
|
1231
|
-
), [u, h] =
|
|
1229
|
+
), [u, h] = k("");
|
|
1232
1230
|
Et.useEffect(() => {
|
|
1233
1231
|
t && (l(
|
|
1234
1232
|
o && s ? `Copy of ${s}` : s || ""
|
|
@@ -1306,7 +1304,7 @@ function jr({
|
|
|
1306
1304
|
] }),
|
|
1307
1305
|
/* @__PURE__ */ r(ma, { children: [
|
|
1308
1306
|
/* @__PURE__ */ e(
|
|
1309
|
-
|
|
1307
|
+
I,
|
|
1310
1308
|
{
|
|
1311
1309
|
variant: "outline",
|
|
1312
1310
|
onClick: () => a(!1),
|
|
@@ -1314,8 +1312,8 @@ function jr({
|
|
|
1314
1312
|
children: "Cancel"
|
|
1315
1313
|
}
|
|
1316
1314
|
),
|
|
1317
|
-
/* @__PURE__ */ r(
|
|
1318
|
-
i && /* @__PURE__ */ e(
|
|
1315
|
+
/* @__PURE__ */ r(I, { onClick: g, disabled: !m || i, children: [
|
|
1316
|
+
i && /* @__PURE__ */ e(re, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1319
1317
|
p.actionLabel
|
|
1320
1318
|
] })
|
|
1321
1319
|
] })
|
|
@@ -1325,20 +1323,20 @@ function St(t) {
|
|
|
1325
1323
|
var a;
|
|
1326
1324
|
for (const o of t.cards)
|
|
1327
1325
|
if (o.type === "matrixTable" && !ar.safeParse((a = o.config) == null ? void 0 : a.matrix).success)
|
|
1328
|
-
return
|
|
1326
|
+
return E.error("Matrix requires at least one row field, one metric, and valid settings."), !1;
|
|
1329
1327
|
return !0;
|
|
1330
1328
|
}
|
|
1331
1329
|
function tt({
|
|
1332
1330
|
className: t,
|
|
1333
1331
|
variant: a = "outline"
|
|
1334
1332
|
}) {
|
|
1335
|
-
const o =
|
|
1333
|
+
const o = Z((n) => n.onSave), { getUpdatedFrame: s } = ye();
|
|
1336
1334
|
function i() {
|
|
1337
1335
|
const n = s();
|
|
1338
1336
|
St(n) && (o == null || o(n));
|
|
1339
1337
|
}
|
|
1340
1338
|
return /* @__PURE__ */ r(
|
|
1341
|
-
|
|
1339
|
+
I,
|
|
1342
1340
|
{
|
|
1343
1341
|
onClick: i,
|
|
1344
1342
|
className: t,
|
|
@@ -1355,9 +1353,9 @@ function $r({
|
|
|
1355
1353
|
className: t,
|
|
1356
1354
|
variant: a = "default"
|
|
1357
1355
|
}) {
|
|
1358
|
-
const o = Qe(), [s, i] =
|
|
1356
|
+
const o = Qe(), [s, i] = k(!1), { setIsVisualEditing: n } = de(), { getUpdatedFrame: c } = ye(), d = Ke(), l = Z((m) => m.frame), u = Bt();
|
|
1359
1357
|
return /* @__PURE__ */ e(
|
|
1360
|
-
|
|
1358
|
+
I,
|
|
1361
1359
|
{
|
|
1362
1360
|
onClick: () => {
|
|
1363
1361
|
const m = c();
|
|
@@ -1365,7 +1363,7 @@ function $r({
|
|
|
1365
1363
|
return;
|
|
1366
1364
|
const p = (l == null ? void 0 : l.visualId) || (d == null ? void 0 : d.id);
|
|
1367
1365
|
if (!p) {
|
|
1368
|
-
|
|
1366
|
+
E.error("No visual to save");
|
|
1369
1367
|
return;
|
|
1370
1368
|
}
|
|
1371
1369
|
i(!0), u.mutate(
|
|
@@ -1377,13 +1375,13 @@ function $r({
|
|
|
1377
1375
|
},
|
|
1378
1376
|
{
|
|
1379
1377
|
onSuccess: () => {
|
|
1380
|
-
i(!1),
|
|
1378
|
+
i(!1), E.success("Visual updated successfully"), o.invalidateQueries({
|
|
1381
1379
|
queryKey: ["resource-by-id", "visual", p],
|
|
1382
1380
|
exact: !0
|
|
1383
1381
|
});
|
|
1384
1382
|
},
|
|
1385
1383
|
onError: () => {
|
|
1386
|
-
i(!1),
|
|
1384
|
+
i(!1), E.error("Failed to update visual");
|
|
1387
1385
|
}
|
|
1388
1386
|
}
|
|
1389
1387
|
);
|
|
@@ -1391,10 +1389,10 @@ function $r({
|
|
|
1391
1389
|
className: t,
|
|
1392
1390
|
size: "xs",
|
|
1393
1391
|
variant: a,
|
|
1394
|
-
children: s ? /* @__PURE__ */ r(
|
|
1395
|
-
/* @__PURE__ */ e(
|
|
1392
|
+
children: s ? /* @__PURE__ */ r(z, { children: [
|
|
1393
|
+
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1396
1394
|
"Saving"
|
|
1397
|
-
] }) : /* @__PURE__ */ r(
|
|
1395
|
+
] }) : /* @__PURE__ */ r(z, { children: [
|
|
1398
1396
|
/* @__PURE__ */ e(Ot, { className: "h-3.5 w-3.5" }),
|
|
1399
1397
|
"Save to Library"
|
|
1400
1398
|
] })
|
|
@@ -1404,18 +1402,18 @@ function $r({
|
|
|
1404
1402
|
function Wr({
|
|
1405
1403
|
className: t
|
|
1406
1404
|
}) {
|
|
1407
|
-
const a = Qe(), [o, s] =
|
|
1405
|
+
const a = Qe(), [o, s] = k(!1), i = Ke(), n = Z((f) => f.frame), c = w((f) => f.selectedSheetId), d = w((f) => f.dashboard), { updateFrame: l, setIsVisualEditing: u } = de(), { getUpdatedFrame: h } = ye(), m = Bt(), p = xt();
|
|
1408
1406
|
return /* @__PURE__ */ e(
|
|
1409
|
-
|
|
1407
|
+
I,
|
|
1410
1408
|
{
|
|
1411
1409
|
onClick: async () => {
|
|
1412
1410
|
if (!c) {
|
|
1413
|
-
|
|
1411
|
+
E.error("No sheet selected");
|
|
1414
1412
|
return;
|
|
1415
1413
|
}
|
|
1416
1414
|
const f = (n == null ? void 0 : n.visualId) || (i == null ? void 0 : i.id);
|
|
1417
1415
|
if (!f) {
|
|
1418
|
-
|
|
1416
|
+
E.error("No visual to update");
|
|
1419
1417
|
return;
|
|
1420
1418
|
}
|
|
1421
1419
|
s(!0);
|
|
@@ -1425,25 +1423,25 @@ function Wr({
|
|
|
1425
1423
|
s(!1);
|
|
1426
1424
|
return;
|
|
1427
1425
|
}
|
|
1428
|
-
const
|
|
1426
|
+
const S = {
|
|
1429
1427
|
...v,
|
|
1430
1428
|
visualId: f
|
|
1431
1429
|
// Keep the link to library visual
|
|
1432
|
-
},
|
|
1433
|
-
previousFrame:
|
|
1430
|
+
}, T = He(d, S.id), U = await p(S, {
|
|
1431
|
+
previousFrame: T
|
|
1434
1432
|
});
|
|
1435
1433
|
await m.mutateAsync({
|
|
1436
1434
|
visualId: f,
|
|
1437
1435
|
data: {
|
|
1438
1436
|
frameObject: v
|
|
1439
1437
|
}
|
|
1440
|
-
}), l(c,
|
|
1441
|
-
semanticExecutionPayload:
|
|
1442
|
-
}), a.invalidateQueries({ queryKey: ["visuals"] }), a.invalidateQueries({ queryKey: ["visual", f] }),
|
|
1438
|
+
}), l(c, S, {
|
|
1439
|
+
semanticExecutionPayload: U
|
|
1440
|
+
}), a.invalidateQueries({ queryKey: ["visuals"] }), a.invalidateQueries({ queryKey: ["visual", f] }), E.success("Saved to library and applied locally"), setTimeout(() => {
|
|
1443
1441
|
u(!1);
|
|
1444
1442
|
}, 300);
|
|
1445
1443
|
} catch (v) {
|
|
1446
|
-
console.error("Failed to save and apply:", v),
|
|
1444
|
+
console.error("Failed to save and apply:", v), E.error(
|
|
1447
1445
|
v instanceof Error ? v.message : "Failed to save and apply changes"
|
|
1448
1446
|
);
|
|
1449
1447
|
} finally {
|
|
@@ -1454,10 +1452,10 @@ function Wr({
|
|
|
1454
1452
|
size: "xs",
|
|
1455
1453
|
variant: "default",
|
|
1456
1454
|
disabled: o,
|
|
1457
|
-
children: o ? /* @__PURE__ */ r(
|
|
1458
|
-
/* @__PURE__ */ e(
|
|
1455
|
+
children: o ? /* @__PURE__ */ r(z, { children: [
|
|
1456
|
+
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1459
1457
|
"Saving..."
|
|
1460
|
-
] }) : /* @__PURE__ */ r(
|
|
1458
|
+
] }) : /* @__PURE__ */ r(z, { children: [
|
|
1461
1459
|
/* @__PURE__ */ e(Ot, { className: "h-3.5 w-3.5" }),
|
|
1462
1460
|
"Save & Apply"
|
|
1463
1461
|
] })
|
|
@@ -1465,7 +1463,7 @@ function Wr({
|
|
|
1465
1463
|
);
|
|
1466
1464
|
}
|
|
1467
1465
|
function at({ className: t }) {
|
|
1468
|
-
const { setTempQueryData: a, setSqlGen: o } =
|
|
1466
|
+
const { setTempQueryData: a, setSqlGen: o } = Ge(), s = Qe(), i = Z((d) => d.tempQueryData), n = Z((d) => d.onClose);
|
|
1469
1467
|
function c() {
|
|
1470
1468
|
if (i) {
|
|
1471
1469
|
const { queryKey: d, queryData: l } = i;
|
|
@@ -1474,7 +1472,7 @@ function at({ className: t }) {
|
|
|
1474
1472
|
o({}), n == null || n();
|
|
1475
1473
|
}
|
|
1476
1474
|
return /* @__PURE__ */ r(
|
|
1477
|
-
|
|
1475
|
+
I,
|
|
1478
1476
|
{
|
|
1479
1477
|
onClick: c,
|
|
1480
1478
|
className: t,
|
|
@@ -1488,27 +1486,27 @@ function at({ className: t }) {
|
|
|
1488
1486
|
);
|
|
1489
1487
|
}
|
|
1490
1488
|
function qr() {
|
|
1491
|
-
const [t, a] =
|
|
1492
|
-
var
|
|
1493
|
-
return ((
|
|
1494
|
-
})(),
|
|
1495
|
-
|
|
1489
|
+
const [t, a] = k(!1), [o, s] = k(!1), [i, n] = k(null), [c, d] = k(null), l = Z((b) => b.frame), u = Z((b) => b.card), h = Ke(), m = w((b) => b.selectedSheetId), p = w((b) => b.dashboard), { getUpdatedFrame: g } = ye(), { selectVisual: f } = it(), { addFrame: v, setIsVisualEditing: S } = de(), T = xt(), U = !!(l != null && l.visualId), M = (() => {
|
|
1490
|
+
var b, F;
|
|
1491
|
+
return ((b = l == null ? void 0 : l.cards) == null ? void 0 : b.length) === 1 && ((F = l.cards[0]) != null && F.title) ? l.cards[0].title : h != null && h.title ? h.title : (u == null ? void 0 : u.title) || "Untitled Visual";
|
|
1492
|
+
})(), A = pa((b) => {
|
|
1493
|
+
b != null && b.id && (f(b), o && i && c && m && (async () => {
|
|
1496
1494
|
try {
|
|
1497
|
-
const
|
|
1495
|
+
const F = {
|
|
1498
1496
|
...i,
|
|
1499
1497
|
id: Dt(),
|
|
1500
|
-
visualId:
|
|
1498
|
+
visualId: b.id
|
|
1501
1499
|
// Link to the newly created library visual
|
|
1502
1500
|
};
|
|
1503
|
-
v(m,
|
|
1501
|
+
v(m, F, {
|
|
1504
1502
|
semanticExecutionPayload: c
|
|
1505
|
-
}),
|
|
1506
|
-
} catch (
|
|
1503
|
+
}), s(!1), n(null), d(null), S(!1);
|
|
1504
|
+
} catch (F) {
|
|
1507
1505
|
console.error(
|
|
1508
1506
|
"Failed to promote semantic metadata for saved visual:",
|
|
1509
|
-
|
|
1510
|
-
),
|
|
1511
|
-
|
|
1507
|
+
F
|
|
1508
|
+
), E.error(
|
|
1509
|
+
F instanceof Error ? F.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1512
1510
|
);
|
|
1513
1511
|
}
|
|
1514
1512
|
})(), a(!1));
|
|
@@ -1516,82 +1514,82 @@ function qr() {
|
|
|
1516
1514
|
return {
|
|
1517
1515
|
saveAsDialogOpen: t,
|
|
1518
1516
|
setSaveAsDialogOpen: a,
|
|
1519
|
-
handleSaveAs: async (
|
|
1517
|
+
handleSaveAs: async (b) => {
|
|
1520
1518
|
if (!m) {
|
|
1521
|
-
|
|
1519
|
+
E.error("No sheet selected");
|
|
1522
1520
|
return;
|
|
1523
1521
|
}
|
|
1524
|
-
const
|
|
1525
|
-
...
|
|
1526
|
-
cards:
|
|
1527
|
-
...
|
|
1528
|
-
title:
|
|
1522
|
+
const F = g(), D = F.cards.length === 1 ? {
|
|
1523
|
+
...F,
|
|
1524
|
+
cards: F.cards.map((N) => ({
|
|
1525
|
+
...N,
|
|
1526
|
+
title: b.name
|
|
1529
1527
|
// Use visual name as card title
|
|
1530
1528
|
}))
|
|
1531
|
-
} :
|
|
1532
|
-
if (
|
|
1533
|
-
let
|
|
1534
|
-
if (
|
|
1529
|
+
} : F;
|
|
1530
|
+
if (b.saveToLibrary) {
|
|
1531
|
+
let N = null;
|
|
1532
|
+
if (b.saveToCurrentDashboard)
|
|
1535
1533
|
try {
|
|
1536
|
-
|
|
1537
|
-
previousFrame: He(p,
|
|
1534
|
+
N = await T(D, {
|
|
1535
|
+
previousFrame: He(p, D.id)
|
|
1538
1536
|
});
|
|
1539
|
-
} catch (
|
|
1537
|
+
} catch (L) {
|
|
1540
1538
|
console.error(
|
|
1541
1539
|
"Failed to prepare semantic metadata before saving visual:",
|
|
1542
|
-
|
|
1543
|
-
),
|
|
1544
|
-
|
|
1540
|
+
L
|
|
1541
|
+
), E.error(
|
|
1542
|
+
L instanceof Error ? L.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1545
1543
|
);
|
|
1546
1544
|
return;
|
|
1547
1545
|
}
|
|
1548
|
-
s(
|
|
1549
|
-
const
|
|
1550
|
-
title:
|
|
1551
|
-
description:
|
|
1552
|
-
frameObject:
|
|
1546
|
+
s(b.saveToCurrentDashboard), n(D), d(N);
|
|
1547
|
+
const j = {
|
|
1548
|
+
title: b.name,
|
|
1549
|
+
description: b.description,
|
|
1550
|
+
frameObject: D,
|
|
1553
1551
|
// Card title synced for single-card frames
|
|
1554
1552
|
isPrivate: !1
|
|
1555
1553
|
};
|
|
1556
|
-
|
|
1557
|
-
} else if (
|
|
1558
|
-
const
|
|
1559
|
-
...
|
|
1554
|
+
A.mutate(j);
|
|
1555
|
+
} else if (b.saveToCurrentDashboard) {
|
|
1556
|
+
const N = {
|
|
1557
|
+
...D,
|
|
1560
1558
|
// Card title already synced
|
|
1561
1559
|
id: Dt(),
|
|
1562
1560
|
visualId: void 0
|
|
1563
1561
|
// Explicitly no visualId for local visuals
|
|
1564
1562
|
};
|
|
1565
1563
|
try {
|
|
1566
|
-
const
|
|
1567
|
-
previousFrame: He(p,
|
|
1564
|
+
const j = await T(D, {
|
|
1565
|
+
previousFrame: He(p, D.id)
|
|
1568
1566
|
});
|
|
1569
|
-
v(m,
|
|
1570
|
-
semanticExecutionPayload:
|
|
1571
|
-
}),
|
|
1572
|
-
} catch (
|
|
1573
|
-
console.error("Failed to save visual to dashboard:",
|
|
1574
|
-
|
|
1567
|
+
v(m, N, {
|
|
1568
|
+
semanticExecutionPayload: j
|
|
1569
|
+
}), E.success("Visual saved to dashboard"), a(!1), S(!1);
|
|
1570
|
+
} catch (j) {
|
|
1571
|
+
console.error("Failed to save visual to dashboard:", j), E.error(
|
|
1572
|
+
j instanceof Error ? j.message : "Failed to prepare semantic metadata for the visual"
|
|
1575
1573
|
);
|
|
1576
1574
|
}
|
|
1577
1575
|
}
|
|
1578
1576
|
},
|
|
1579
1577
|
isLibraryVisual: U,
|
|
1580
|
-
currentVisualName:
|
|
1581
|
-
isSaving:
|
|
1578
|
+
currentVisualName: M,
|
|
1579
|
+
isSaving: A.isPending
|
|
1582
1580
|
};
|
|
1583
1581
|
}
|
|
1584
1582
|
function rs(t = {}) {
|
|
1585
|
-
const { isInspectionMode: a } = fa(), o =
|
|
1586
|
-
saveAsDialogOpen:
|
|
1583
|
+
const { isInspectionMode: a } = fa(), o = Z((L) => L.frame), s = Z((L) => L.editorContext), i = ga((L) => L.selectedVisual), n = w((L) => L.selectedFrameId), c = w((L) => L.selectedSheetId), d = w((L) => L.dashboard), { setIsVisualEditing: l, updateFrame: u } = de(), [h, m] = k(!1), [p, g] = k("both"), f = xt(), v = (s == null ? void 0 : s.type) === "documentSection", S = !!(o != null && o.visualId || i != null && i.id), T = !!(o != null && o.visualId && n), U = S && !T, {
|
|
1584
|
+
saveAsDialogOpen: M,
|
|
1587
1585
|
setSaveAsDialogOpen: A,
|
|
1588
|
-
handleSaveAs:
|
|
1589
|
-
isLibraryVisual:
|
|
1590
|
-
currentVisualName:
|
|
1591
|
-
isSaving:
|
|
1592
|
-
} = qr(), { getUpdatedFrame:
|
|
1586
|
+
handleSaveAs: R,
|
|
1587
|
+
isLibraryVisual: b,
|
|
1588
|
+
currentVisualName: F,
|
|
1589
|
+
isSaving: C
|
|
1590
|
+
} = qr(), { getUpdatedFrame: D } = ye();
|
|
1593
1591
|
if (a)
|
|
1594
|
-
return /* @__PURE__ */ r(
|
|
1592
|
+
return /* @__PURE__ */ r(z, { children: [
|
|
1595
1593
|
/* @__PURE__ */ e(
|
|
1596
1594
|
tt,
|
|
1597
1595
|
{
|
|
@@ -1602,54 +1600,54 @@ function rs(t = {}) {
|
|
|
1602
1600
|
/* @__PURE__ */ e(at, {})
|
|
1603
1601
|
] });
|
|
1604
1602
|
if (v)
|
|
1605
|
-
return /* @__PURE__ */ r(
|
|
1603
|
+
return /* @__PURE__ */ r(z, { children: [
|
|
1606
1604
|
/* @__PURE__ */ e(tt, { className: "rounded-control", variant: "default" }),
|
|
1607
1605
|
/* @__PURE__ */ e(at, {})
|
|
1608
1606
|
] });
|
|
1609
|
-
const
|
|
1607
|
+
const N = async () => {
|
|
1610
1608
|
if (!c) {
|
|
1611
|
-
|
|
1609
|
+
E.error("No sheet selected");
|
|
1612
1610
|
return;
|
|
1613
1611
|
}
|
|
1614
1612
|
if (h) return;
|
|
1615
1613
|
m(!0);
|
|
1616
|
-
const
|
|
1617
|
-
...
|
|
1614
|
+
const O = {
|
|
1615
|
+
...D(),
|
|
1618
1616
|
visualId: void 0
|
|
1619
|
-
},
|
|
1617
|
+
}, X = He(d, O.id);
|
|
1620
1618
|
try {
|
|
1621
|
-
const
|
|
1622
|
-
previousFrame:
|
|
1619
|
+
const V = await f(O, {
|
|
1620
|
+
previousFrame: X
|
|
1623
1621
|
});
|
|
1624
|
-
u(c,
|
|
1625
|
-
semanticExecutionPayload:
|
|
1622
|
+
u(c, O, {
|
|
1623
|
+
semanticExecutionPayload: V
|
|
1626
1624
|
});
|
|
1627
|
-
} catch (
|
|
1628
|
-
console.error("Failed to apply local semantic metadata:",
|
|
1629
|
-
|
|
1625
|
+
} catch (V) {
|
|
1626
|
+
console.error("Failed to apply local semantic metadata:", V), m(!1), E.error(
|
|
1627
|
+
V instanceof Error ? V.message : "Failed to prepare semantic metadata for this visual"
|
|
1630
1628
|
);
|
|
1631
1629
|
return;
|
|
1632
1630
|
}
|
|
1633
1631
|
setTimeout(() => {
|
|
1634
|
-
m(!1),
|
|
1632
|
+
m(!1), E.success("Changes applied. Visual is now local to this dashboard"), l(!1);
|
|
1635
1633
|
}, 300);
|
|
1636
|
-
}, j = (
|
|
1637
|
-
g(
|
|
1634
|
+
}, j = (L) => {
|
|
1635
|
+
g(L), A(!0);
|
|
1638
1636
|
};
|
|
1639
|
-
return /* @__PURE__ */ r(
|
|
1637
|
+
return /* @__PURE__ */ r(z, { children: [
|
|
1640
1638
|
/* @__PURE__ */ r("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
|
|
1641
|
-
!
|
|
1642
|
-
|
|
1643
|
-
|
|
1639
|
+
!S && /* @__PURE__ */ e(tt, { className: "!rounded-none", variant: "default" }),
|
|
1640
|
+
S && U && /* @__PURE__ */ e($r, { className: "!rounded-none", variant: "default" }),
|
|
1641
|
+
S && T && /* @__PURE__ */ e(Wr, { className: "!rounded-none" }),
|
|
1644
1642
|
/* @__PURE__ */ r(Le, { modal: !1, children: [
|
|
1645
1643
|
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1646
|
-
|
|
1644
|
+
I,
|
|
1647
1645
|
{
|
|
1648
1646
|
variant: "default",
|
|
1649
1647
|
size: "xs",
|
|
1650
1648
|
className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
|
|
1651
1649
|
"aria-label": "Open visual save options",
|
|
1652
|
-
disabled:
|
|
1650
|
+
disabled: C || h,
|
|
1653
1651
|
children: /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" })
|
|
1654
1652
|
}
|
|
1655
1653
|
) }),
|
|
@@ -1659,11 +1657,11 @@ function rs(t = {}) {
|
|
|
1659
1657
|
align: "end",
|
|
1660
1658
|
className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
|
|
1661
1659
|
children: [
|
|
1662
|
-
|
|
1660
|
+
T && /* @__PURE__ */ r(z, { children: [
|
|
1663
1661
|
/* @__PURE__ */ r(
|
|
1664
|
-
|
|
1662
|
+
G,
|
|
1665
1663
|
{
|
|
1666
|
-
onClick:
|
|
1664
|
+
onClick: N,
|
|
1667
1665
|
disabled: h,
|
|
1668
1666
|
children: [
|
|
1669
1667
|
/* @__PURE__ */ e(yt, { className: "h-3.5 w-3.5" }),
|
|
@@ -1674,21 +1672,21 @@ function rs(t = {}) {
|
|
|
1674
1672
|
/* @__PURE__ */ e(je, {})
|
|
1675
1673
|
] }),
|
|
1676
1674
|
/* @__PURE__ */ r(
|
|
1677
|
-
|
|
1675
|
+
G,
|
|
1678
1676
|
{
|
|
1679
1677
|
onClick: () => j("local"),
|
|
1680
|
-
disabled:
|
|
1678
|
+
disabled: C,
|
|
1681
1679
|
children: [
|
|
1682
|
-
/* @__PURE__ */ e(
|
|
1680
|
+
/* @__PURE__ */ e(ve, { className: "h-3.5 w-3.5" }),
|
|
1683
1681
|
"Add to Dashboard (Local)"
|
|
1684
1682
|
]
|
|
1685
1683
|
}
|
|
1686
1684
|
),
|
|
1687
1685
|
/* @__PURE__ */ r(
|
|
1688
|
-
|
|
1686
|
+
G,
|
|
1689
1687
|
{
|
|
1690
1688
|
onClick: () => j("library"),
|
|
1691
|
-
disabled:
|
|
1689
|
+
disabled: C,
|
|
1692
1690
|
children: [
|
|
1693
1691
|
/* @__PURE__ */ e(fr, { className: "h-3.5 w-3.5" }),
|
|
1694
1692
|
"Save as Library Visual"
|
|
@@ -1696,10 +1694,10 @@ function rs(t = {}) {
|
|
|
1696
1694
|
}
|
|
1697
1695
|
),
|
|
1698
1696
|
/* @__PURE__ */ r(
|
|
1699
|
-
|
|
1697
|
+
G,
|
|
1700
1698
|
{
|
|
1701
1699
|
onClick: () => j("both"),
|
|
1702
|
-
disabled:
|
|
1700
|
+
disabled: C,
|
|
1703
1701
|
children: [
|
|
1704
1702
|
/* @__PURE__ */ e(gr, { className: "h-3.5 w-3.5" }),
|
|
1705
1703
|
"Save Copy as Linked Visual"
|
|
@@ -1715,21 +1713,21 @@ function rs(t = {}) {
|
|
|
1715
1713
|
/* @__PURE__ */ e(
|
|
1716
1714
|
jr,
|
|
1717
1715
|
{
|
|
1718
|
-
open:
|
|
1719
|
-
onOpenChange: (
|
|
1720
|
-
|
|
1716
|
+
open: M,
|
|
1717
|
+
onOpenChange: (L) => {
|
|
1718
|
+
C || A(L);
|
|
1721
1719
|
},
|
|
1722
|
-
isLibraryVisual:
|
|
1723
|
-
currentVisualName:
|
|
1724
|
-
isSaving:
|
|
1720
|
+
isLibraryVisual: b,
|
|
1721
|
+
currentVisualName: F,
|
|
1722
|
+
isSaving: C,
|
|
1725
1723
|
destinationMode: p,
|
|
1726
|
-
onConfirm:
|
|
1724
|
+
onConfirm: R
|
|
1727
1725
|
}
|
|
1728
1726
|
)
|
|
1729
1727
|
] });
|
|
1730
1728
|
}
|
|
1731
1729
|
function ns({ className: t }) {
|
|
1732
|
-
const a =
|
|
1730
|
+
const a = Z((h) => h.isDevMode), o = Z((h) => h.card.type), s = w((h) => h.isVisualEditing), { setIsDevMode: i } = Ge(), { config: n } = Gt(ba).tokenProps, c = (n == null ? void 0 : n.showAdvancedMode) !== !1;
|
|
1733
1731
|
if (!s || !c || !or(o))
|
|
1734
1732
|
return null;
|
|
1735
1733
|
const d = a ? Fr : Dr, l = a ? "Visual editor" : "SQL editor", u = a ? "Switch to visual editor" : "Switch to SQL editor";
|
|
@@ -1752,19 +1750,19 @@ function ns({ className: t }) {
|
|
|
1752
1750
|
);
|
|
1753
1751
|
}
|
|
1754
1752
|
function ss() {
|
|
1755
|
-
const t =
|
|
1753
|
+
const t = w((d) => d.isDashboardEditing), a = w((d) => d.isVisualEditing), o = w((d) => {
|
|
1756
1754
|
var u;
|
|
1757
1755
|
const l = ((u = d.dashboard) == null ? void 0 : u.sheets) ?? [];
|
|
1758
1756
|
return l.find((h) => h.id === d.selectedSheetId) ?? l[0];
|
|
1759
|
-
}), s =
|
|
1757
|
+
}), s = w((d) => d.actions.arrangeSheet), i = w((d) => d.actions.undoArrange);
|
|
1760
1758
|
if (!t || a || !o || wt(o)) return null;
|
|
1761
1759
|
const n = !(o.frames ?? []).length, c = (d) => {
|
|
1762
1760
|
const l = s(o.id, { keepOrder: d });
|
|
1763
1761
|
if (!l.ok) {
|
|
1764
|
-
|
|
1762
|
+
E.error(l.reason === "not_a_grid" ? "This sheet has no grid to arrange." : "The dashboard can't be arranged right now.");
|
|
1765
1763
|
return;
|
|
1766
1764
|
}
|
|
1767
|
-
|
|
1765
|
+
E("Arranged", {
|
|
1768
1766
|
// Long enough to reach Undo after looking at the result; the default 4 seconds isn't.
|
|
1769
1767
|
duration: 1e4,
|
|
1770
1768
|
description: d ? "Sizes and gaps fixed on every screen size, in your order." : "KPIs on top, charts in pairs, tables full width, on every screen size.",
|
|
@@ -1772,14 +1770,14 @@ function ss() {
|
|
|
1772
1770
|
label: "Undo",
|
|
1773
1771
|
onClick: () => {
|
|
1774
1772
|
const u = i();
|
|
1775
|
-
!u.ok && u.reason === "changed_since" &&
|
|
1773
|
+
!u.ok && u.reason === "changed_since" && E.info("The dashboard changed after Arrange, so it can't be undone from here.");
|
|
1776
1774
|
}
|
|
1777
1775
|
}
|
|
1778
1776
|
});
|
|
1779
1777
|
};
|
|
1780
1778
|
return /* @__PURE__ */ r("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
|
|
1781
1779
|
/* @__PURE__ */ r(
|
|
1782
|
-
|
|
1780
|
+
I,
|
|
1783
1781
|
{
|
|
1784
1782
|
variant: "ghost",
|
|
1785
1783
|
size: "xs",
|
|
@@ -1795,7 +1793,7 @@ function ss() {
|
|
|
1795
1793
|
),
|
|
1796
1794
|
/* @__PURE__ */ r(Le, { modal: !1, children: [
|
|
1797
1795
|
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1798
|
-
|
|
1796
|
+
I,
|
|
1799
1797
|
{
|
|
1800
1798
|
variant: "ghost",
|
|
1801
1799
|
size: "xs",
|
|
@@ -1805,7 +1803,7 @@ function ss() {
|
|
|
1805
1803
|
children: /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" })
|
|
1806
1804
|
}
|
|
1807
1805
|
) }),
|
|
1808
|
-
/* @__PURE__ */ e(Te, { align: "end", className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm", children: /* @__PURE__ */ r(
|
|
1806
|
+
/* @__PURE__ */ e(Te, { align: "end", className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm", children: /* @__PURE__ */ r(G, { onClick: () => c(!0), children: [
|
|
1809
1807
|
/* @__PURE__ */ e(Ae, { className: "h-3.5 w-3.5" }),
|
|
1810
1808
|
"Keep my order"
|
|
1811
1809
|
] }) })
|
|
@@ -1813,13 +1811,13 @@ function ss() {
|
|
|
1813
1811
|
] });
|
|
1814
1812
|
}
|
|
1815
1813
|
function os() {
|
|
1816
|
-
const t =
|
|
1814
|
+
const t = w((s) => s.screenSizesOpen), a = w((s) => {
|
|
1817
1815
|
var c, d;
|
|
1818
1816
|
const i = ((c = s.dashboard) == null ? void 0 : c.sheets) ?? [], n = i.find((l) => l.id === s.selectedSheetId) ?? i[0];
|
|
1819
1817
|
return !!n && !wt(n) && !!((d = n.frames) != null && d.length);
|
|
1820
|
-
}), o =
|
|
1818
|
+
}), o = w((s) => s.actions.setScreenSizesOpen);
|
|
1821
1819
|
return a ? /* @__PURE__ */ e(
|
|
1822
|
-
|
|
1820
|
+
I,
|
|
1823
1821
|
{
|
|
1824
1822
|
type: "button",
|
|
1825
1823
|
size: "xs",
|
|
@@ -1854,7 +1852,7 @@ function is({
|
|
|
1854
1852
|
] }),
|
|
1855
1853
|
/* @__PURE__ */ r(mt, { children: [
|
|
1856
1854
|
/* @__PURE__ */ e(
|
|
1857
|
-
|
|
1855
|
+
I,
|
|
1858
1856
|
{
|
|
1859
1857
|
type: "button",
|
|
1860
1858
|
size: "xs",
|
|
@@ -1866,8 +1864,8 @@ function is({
|
|
|
1866
1864
|
}
|
|
1867
1865
|
),
|
|
1868
1866
|
/* @__PURE__ */ e(pt, { disabled: i, children: d }),
|
|
1869
|
-
/* @__PURE__ */ e(
|
|
1870
|
-
/* @__PURE__ */ e(
|
|
1867
|
+
/* @__PURE__ */ e(I, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ r(z, { children: [
|
|
1868
|
+
/* @__PURE__ */ e(re, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
1871
1869
|
"Saving..."
|
|
1872
1870
|
] }) : u })
|
|
1873
1871
|
] })
|
|
@@ -1875,7 +1873,7 @@ function is({
|
|
|
1875
1873
|
}
|
|
1876
1874
|
async function ls(t) {
|
|
1877
1875
|
var n, c;
|
|
1878
|
-
const a = (c = (n =
|
|
1876
|
+
const a = (c = (n = w.getState()) == null ? void 0 : n.authToken) == null ? void 0 : c.accessToken;
|
|
1879
1877
|
if (!a)
|
|
1880
1878
|
return;
|
|
1881
1879
|
const o = `${t}/v1/invalidate-token`, s = await fetch(o, {
|
|
@@ -1928,11 +1926,11 @@ function Qr(t) {
|
|
|
1928
1926
|
running: { text: a.stageLabel ?? K.inProgress },
|
|
1929
1927
|
finishedDetail: [],
|
|
1930
1928
|
failure: null,
|
|
1931
|
-
note: a.omittedAttachmentCount > 0 ?
|
|
1929
|
+
note: a.omittedAttachmentCount > 0 ? ue.attachmentsLeftOut(a.omittedAttachmentCount) : null
|
|
1932
1930
|
};
|
|
1933
1931
|
}
|
|
1934
|
-
function
|
|
1935
|
-
const [s, i] =
|
|
1932
|
+
function Kr({ row: t, now: a, api: o }) {
|
|
1933
|
+
const [s, i] = k("idle"), n = Qr(t), c = xa(t, o), d = async () => {
|
|
1936
1934
|
if (!c) return;
|
|
1937
1935
|
i("working");
|
|
1938
1936
|
const f = await ka(o, t, c);
|
|
@@ -1957,7 +1955,7 @@ function Gr({ row: t, now: a, api: o }) {
|
|
|
1957
1955
|
] }),
|
|
1958
1956
|
n.status === "running" && n.running && /* @__PURE__ */ r("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
|
|
1959
1957
|
/* @__PURE__ */ e("span", { className: "tabular-nums", children: n.running.text }),
|
|
1960
|
-
n.running.detail && /* @__PURE__ */ r(
|
|
1958
|
+
n.running.detail && /* @__PURE__ */ r(z, { children: [
|
|
1961
1959
|
" ",
|
|
1962
1960
|
g,
|
|
1963
1961
|
" ",
|
|
@@ -1980,7 +1978,7 @@ function Gr({ row: t, now: a, api: o }) {
|
|
|
1980
1978
|
] }, v)),
|
|
1981
1979
|
g
|
|
1982
1980
|
] })
|
|
1983
|
-
) : n.status !== "ready" ? /* @__PURE__ */ r(
|
|
1981
|
+
) : n.status !== "ready" ? /* @__PURE__ */ r(z, { children: [
|
|
1984
1982
|
/* @__PURE__ */ e("span", { children: u }),
|
|
1985
1983
|
g
|
|
1986
1984
|
] }) : null,
|
|
@@ -2001,13 +1999,13 @@ function ds({ variant: t }) {
|
|
|
2001
1999
|
i && o();
|
|
2002
2000
|
}, children: [
|
|
2003
2001
|
/* @__PURE__ */ e(We, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2004
|
-
|
|
2002
|
+
I,
|
|
2005
2003
|
{
|
|
2006
2004
|
variant: t ?? "ghost",
|
|
2007
2005
|
size: "xs",
|
|
2008
2006
|
className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
2009
|
-
"aria-label":
|
|
2010
|
-
title:
|
|
2007
|
+
"aria-label": ue.title,
|
|
2008
|
+
title: ue.title,
|
|
2011
2009
|
children: [
|
|
2012
2010
|
/* @__PURE__ */ e(Sr, { className: "h-3.5 w-3.5" }),
|
|
2013
2011
|
s !== null && /* @__PURE__ */ e(
|
|
@@ -2020,32 +2018,32 @@ function ds({ variant: t }) {
|
|
|
2020
2018
|
]
|
|
2021
2019
|
}
|
|
2022
2020
|
) }),
|
|
2023
|
-
/* @__PURE__ */ e(qe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ e(
|
|
2021
|
+
/* @__PURE__ */ e(qe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ e(Gr, {}) })
|
|
2024
2022
|
] });
|
|
2025
2023
|
}
|
|
2026
|
-
function
|
|
2024
|
+
function Gr() {
|
|
2027
2025
|
const t = vt(), a = Da(), { rows: o, activeTruncated: s } = t.snapshot, i = o.some((n) => Aa(n.item.status));
|
|
2028
2026
|
return o.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-1.5 px-6 py-8 text-center", children: [
|
|
2029
2027
|
/* @__PURE__ */ e("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ e(Fa, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
|
|
2030
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children:
|
|
2031
|
-
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children:
|
|
2028
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: ue.title }),
|
|
2029
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: ue.empty })
|
|
2032
2030
|
] }) : /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
2033
2031
|
/* @__PURE__ */ r("div", { className: "flex h-8 items-center gap-2 border-b border-border px-3", children: [
|
|
2034
|
-
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children:
|
|
2032
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: ue.title }),
|
|
2035
2033
|
/* @__PURE__ */ e("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: o.length }),
|
|
2036
2034
|
/* @__PURE__ */ r("div", { className: "ml-auto flex items-center gap-0.5", children: [
|
|
2037
2035
|
i && /* @__PURE__ */ e(
|
|
2038
|
-
|
|
2036
|
+
I,
|
|
2039
2037
|
{
|
|
2040
2038
|
variant: "ghost",
|
|
2041
2039
|
size: "xs",
|
|
2042
2040
|
className: "h-6 px-1.5 text-[12px] text-muted-foreground hover:text-foreground",
|
|
2043
2041
|
onClick: t.clearFinished,
|
|
2044
|
-
children:
|
|
2042
|
+
children: ue.clear
|
|
2045
2043
|
}
|
|
2046
2044
|
),
|
|
2047
2045
|
/* @__PURE__ */ e(
|
|
2048
|
-
|
|
2046
|
+
I,
|
|
2049
2047
|
{
|
|
2050
2048
|
variant: "ghost",
|
|
2051
2049
|
size: "xs",
|
|
@@ -2058,8 +2056,8 @@ function Kr() {
|
|
|
2058
2056
|
)
|
|
2059
2057
|
] })
|
|
2060
2058
|
] }),
|
|
2061
|
-
s && /* @__PURE__ */ e("p", { className: "border-b border-border px-3 py-2 text-[12px] leading-4 text-muted-foreground", children:
|
|
2062
|
-
/* @__PURE__ */ e("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y divide-border/70", children: o.map((n) => /* @__PURE__ */ e(
|
|
2059
|
+
s && /* @__PURE__ */ e("p", { className: "border-b border-border px-3 py-2 text-[12px] leading-4 text-muted-foreground", children: ue.truncated }),
|
|
2060
|
+
/* @__PURE__ */ e("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y divide-border/70", children: o.map((n) => /* @__PURE__ */ e(Kr, { row: n, now: a, api: t }, Ea(n))) }) })
|
|
2063
2061
|
] });
|
|
2064
2062
|
}
|
|
2065
2063
|
function Xr(t) {
|
|
@@ -2096,78 +2094,78 @@ function Yr({
|
|
|
2096
2094
|
// create and make consumers use `forceClose()` from a dedicated
|
|
2097
2095
|
// button.
|
|
2098
2096
|
dismissMode: s ? "passive" : "explicit-only"
|
|
2099
|
-
}), p =
|
|
2097
|
+
}), p = w((C) => C.dashboard), { setDashboardControlsModel: g } = de(), { participants: f } = Ia(mr(p)), v = Array.from(
|
|
2100
2098
|
new Map(
|
|
2101
2099
|
f.flatMap(
|
|
2102
|
-
(
|
|
2103
|
-
var
|
|
2100
|
+
(C) => C.fieldChoices.map((D) => {
|
|
2101
|
+
var N;
|
|
2104
2102
|
return [
|
|
2105
|
-
|
|
2103
|
+
D.value,
|
|
2106
2104
|
{
|
|
2107
|
-
option:
|
|
2108
|
-
target: (
|
|
2105
|
+
option: D,
|
|
2106
|
+
target: (N = C.fieldTargetMap) == null ? void 0 : N[D.value]
|
|
2109
2107
|
}
|
|
2110
2108
|
];
|
|
2111
2109
|
})
|
|
2112
2110
|
)
|
|
2113
2111
|
).values()
|
|
2114
|
-
),
|
|
2112
|
+
), S = Array.from(
|
|
2115
2113
|
new Map(
|
|
2116
2114
|
f.flatMap(
|
|
2117
|
-
(
|
|
2118
|
-
var
|
|
2115
|
+
(C) => C.metricChoices.map((D) => {
|
|
2116
|
+
var N;
|
|
2119
2117
|
return [
|
|
2120
|
-
|
|
2118
|
+
D.value,
|
|
2121
2119
|
{
|
|
2122
|
-
option:
|
|
2123
|
-
target: (
|
|
2120
|
+
option: D,
|
|
2121
|
+
target: (N = C.metricTargetMap) == null ? void 0 : N[D.value]
|
|
2124
2122
|
}
|
|
2125
2123
|
];
|
|
2126
2124
|
})
|
|
2127
2125
|
)
|
|
2128
2126
|
).values()
|
|
2129
|
-
),
|
|
2127
|
+
), T = ir({
|
|
2130
2128
|
...p || {},
|
|
2131
2129
|
controls: []
|
|
2132
|
-
}),
|
|
2130
|
+
}), U = La(p), M = (C, D, N) => {
|
|
2133
2131
|
g(
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
Xr(
|
|
2132
|
+
C,
|
|
2133
|
+
D,
|
|
2134
|
+
Xr(N)
|
|
2137
2135
|
);
|
|
2138
|
-
}, A =
|
|
2136
|
+
}, A = ee(() => {
|
|
2139
2137
|
if (n) {
|
|
2140
2138
|
c();
|
|
2141
2139
|
return;
|
|
2142
2140
|
}
|
|
2143
2141
|
m(!1);
|
|
2144
|
-
}, [n, c, m]),
|
|
2142
|
+
}, [n, c, m]), R = /* @__PURE__ */ e(
|
|
2145
2143
|
jt,
|
|
2146
2144
|
{
|
|
2147
2145
|
scope: "dashboard",
|
|
2148
2146
|
controls: p.controls || [],
|
|
2149
|
-
reservedControlIds:
|
|
2147
|
+
reservedControlIds: T,
|
|
2150
2148
|
defaultValues: p.defaultControlValues || {},
|
|
2151
2149
|
usageByControlId: Va(p),
|
|
2152
2150
|
availableFieldChoices: v,
|
|
2153
|
-
availableMetricChoices:
|
|
2151
|
+
availableMetricChoices: S,
|
|
2154
2152
|
structuralParticipants: f,
|
|
2155
|
-
structuralParticipantIdsByControlId:
|
|
2153
|
+
structuralParticipantIdsByControlId: U,
|
|
2156
2154
|
initialCreateFlow: i === "create",
|
|
2157
2155
|
onCreateFlowActiveChange: m,
|
|
2158
2156
|
onCreateFlowComplete: A,
|
|
2159
|
-
onChange:
|
|
2157
|
+
onChange: M,
|
|
2160
2158
|
emptyMessage: "No dashboard controls yet."
|
|
2161
2159
|
}
|
|
2162
|
-
),
|
|
2160
|
+
), b = l ? "Add dashboard control" : "Dashboard Controls", F = /* @__PURE__ */ r(z, { children: [
|
|
2163
2161
|
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
2164
2162
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
2165
2163
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
|
|
2166
2164
|
] }),
|
|
2167
|
-
|
|
2165
|
+
R
|
|
2168
2166
|
] });
|
|
2169
2167
|
return s ? /* @__PURE__ */ r($e, { open: h, onOpenChange: d, children: [
|
|
2170
|
-
/* @__PURE__ */ e(We, { asChild: !0, children: o || /* @__PURE__ */ r(
|
|
2168
|
+
/* @__PURE__ */ e(We, { asChild: !0, children: o || /* @__PURE__ */ r(I, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
2171
2169
|
/* @__PURE__ */ e(zt, { className: "mr-2 h-4 w-4" }),
|
|
2172
2170
|
"Controls"
|
|
2173
2171
|
] }) }),
|
|
@@ -2178,7 +2176,7 @@ function Yr({
|
|
|
2178
2176
|
align: "end",
|
|
2179
2177
|
onEscapeKeyDown: u,
|
|
2180
2178
|
onPointerDownOutside: u,
|
|
2181
|
-
children:
|
|
2179
|
+
children: F
|
|
2182
2180
|
}
|
|
2183
2181
|
)
|
|
2184
2182
|
] }) : /* @__PURE__ */ e(Fe, { open: h, onOpenChange: d, children: /* @__PURE__ */ r(
|
|
@@ -2193,7 +2191,7 @@ function Yr({
|
|
|
2193
2191
|
{
|
|
2194
2192
|
className: l ? "space-y-0" : void 0,
|
|
2195
2193
|
children: [
|
|
2196
|
-
/* @__PURE__ */ e(Ie, { className: "text-[15px]", children:
|
|
2194
|
+
/* @__PURE__ */ e(Ie, { className: "text-[15px]", children: b }),
|
|
2197
2195
|
/* @__PURE__ */ e(
|
|
2198
2196
|
bt,
|
|
2199
2197
|
{
|
|
@@ -2204,12 +2202,12 @@ function Yr({
|
|
|
2204
2202
|
]
|
|
2205
2203
|
}
|
|
2206
2204
|
),
|
|
2207
|
-
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children:
|
|
2205
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: R })
|
|
2208
2206
|
]
|
|
2209
2207
|
}
|
|
2210
2208
|
) });
|
|
2211
2209
|
}
|
|
2212
|
-
const
|
|
2210
|
+
const Jr = [
|
|
2213
2211
|
"enum",
|
|
2214
2212
|
"multi_enum",
|
|
2215
2213
|
"text",
|
|
@@ -2217,12 +2215,12 @@ const Zr = [
|
|
|
2217
2215
|
"boolean",
|
|
2218
2216
|
"date"
|
|
2219
2217
|
];
|
|
2220
|
-
function
|
|
2218
|
+
function Zr({
|
|
2221
2219
|
open: t,
|
|
2222
2220
|
onOpenChange: a,
|
|
2223
2221
|
initialMode: o = "manage"
|
|
2224
2222
|
}) {
|
|
2225
|
-
var
|
|
2223
|
+
var F;
|
|
2226
2224
|
const s = o === "create", {
|
|
2227
2225
|
forceClose: i,
|
|
2228
2226
|
handleOpenChange: n,
|
|
@@ -2235,41 +2233,41 @@ function Jr({
|
|
|
2235
2233
|
onOpenChange: a,
|
|
2236
2234
|
initialCreateFlowActive: o === "create",
|
|
2237
2235
|
dismissMode: "explicit-only"
|
|
2238
|
-
}), h =
|
|
2239
|
-
(
|
|
2240
|
-
), f = (g == null ? void 0 : g.kind) === "document" && !!g.document, v =
|
|
2236
|
+
}), h = w((C) => C.dashboard), m = w((C) => C.selectedSheetId), { setDashboardInputs: p } = de(), g = (F = h.sheets) == null ? void 0 : F.find(
|
|
2237
|
+
(C) => C.id === m
|
|
2238
|
+
), f = (g == null ? void 0 : g.kind) === "document" && !!g.document, v = ae(
|
|
2241
2239
|
() => f && (g != null && g.document) ? vr(h, g.id) : [],
|
|
2242
2240
|
[h, f, g == null ? void 0 : g.document, g == null ? void 0 : g.id]
|
|
2243
|
-
),
|
|
2241
|
+
), S = ae(
|
|
2244
2242
|
() => v.filter(
|
|
2245
|
-
(
|
|
2243
|
+
(C) => C.kind === "control"
|
|
2246
2244
|
),
|
|
2247
2245
|
[v]
|
|
2248
|
-
),
|
|
2249
|
-
() =>
|
|
2250
|
-
[
|
|
2251
|
-
),
|
|
2252
|
-
() => tn(
|
|
2253
|
-
[
|
|
2254
|
-
),
|
|
2246
|
+
), T = ae(
|
|
2247
|
+
() => S.map((C) => C.control),
|
|
2248
|
+
[S]
|
|
2249
|
+
), U = ae(
|
|
2250
|
+
() => tn(T),
|
|
2251
|
+
[T]
|
|
2252
|
+
), M = ae(
|
|
2255
2253
|
() => en(h),
|
|
2256
2254
|
[h]
|
|
2257
|
-
), A =
|
|
2255
|
+
), A = ee(() => {
|
|
2258
2256
|
if (s) {
|
|
2259
2257
|
i();
|
|
2260
2258
|
return;
|
|
2261
2259
|
}
|
|
2262
2260
|
u(!1);
|
|
2263
|
-
}, [s, i, u]),
|
|
2264
|
-
(
|
|
2261
|
+
}, [s, i, u]), R = ee(
|
|
2262
|
+
(C, D, N) => {
|
|
2265
2263
|
!f || !(g != null && g.document) || p(
|
|
2266
2264
|
rn({
|
|
2267
2265
|
allInputs: h.inputs || [],
|
|
2268
2266
|
documentSheetId: g.id,
|
|
2269
2267
|
currentDocumentInputs: v,
|
|
2270
|
-
nextControls:
|
|
2271
|
-
nextDefaultValues:
|
|
2272
|
-
change:
|
|
2268
|
+
nextControls: C,
|
|
2269
|
+
nextDefaultValues: D,
|
|
2270
|
+
change: N
|
|
2273
2271
|
})
|
|
2274
2272
|
);
|
|
2275
2273
|
},
|
|
@@ -2302,19 +2300,19 @@ function Jr({
|
|
|
2302
2300
|
jt,
|
|
2303
2301
|
{
|
|
2304
2302
|
scope: "dashboard",
|
|
2305
|
-
controls:
|
|
2306
|
-
reservedControlIds:
|
|
2307
|
-
defaultValues:
|
|
2303
|
+
controls: T,
|
|
2304
|
+
reservedControlIds: M,
|
|
2305
|
+
defaultValues: U,
|
|
2308
2306
|
usageByControlId: {},
|
|
2309
2307
|
availableFieldChoices: [],
|
|
2310
2308
|
availableMetricChoices: [],
|
|
2311
2309
|
structuralParticipants: [],
|
|
2312
2310
|
structuralParticipantIdsByControlId: {},
|
|
2313
|
-
allowedControlTypes:
|
|
2311
|
+
allowedControlTypes: Jr,
|
|
2314
2312
|
initialCreateFlow: o === "create",
|
|
2315
2313
|
onCreateFlowActiveChange: u,
|
|
2316
2314
|
onCreateFlowComplete: A,
|
|
2317
|
-
onChange:
|
|
2315
|
+
onChange: R,
|
|
2318
2316
|
emptyMessage: "No document controls yet."
|
|
2319
2317
|
}
|
|
2320
2318
|
) })
|
|
@@ -2363,7 +2361,7 @@ function rn({
|
|
|
2363
2361
|
const f = lr(
|
|
2364
2362
|
g.id,
|
|
2365
2363
|
[...t, ...u].filter(
|
|
2366
|
-
(
|
|
2364
|
+
(S) => S.id !== p.id
|
|
2367
2365
|
)
|
|
2368
2366
|
), v = g.id === f ? g : { ...g, id: f };
|
|
2369
2367
|
u.push({
|
|
@@ -2401,7 +2399,7 @@ function nn({
|
|
|
2401
2399
|
pickerContentClassName: l,
|
|
2402
2400
|
settingsContentClassName: u
|
|
2403
2401
|
}) {
|
|
2404
|
-
const h = i === "toolbar", [m, p] =
|
|
2402
|
+
const h = i === "toolbar", [m, p] = k(!1), g = ot("interactive");
|
|
2405
2403
|
return /* @__PURE__ */ r(
|
|
2406
2404
|
"div",
|
|
2407
2405
|
{
|
|
@@ -2416,7 +2414,7 @@ function nn({
|
|
|
2416
2414
|
children: [
|
|
2417
2415
|
/* @__PURE__ */ r($e, { open: t, onOpenChange: a, children: [
|
|
2418
2416
|
/* @__PURE__ */ e(We, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2419
|
-
|
|
2417
|
+
I,
|
|
2420
2418
|
{
|
|
2421
2419
|
variant: "ghost",
|
|
2422
2420
|
size: "xs",
|
|
@@ -2446,7 +2444,7 @@ function nn({
|
|
|
2446
2444
|
] }),
|
|
2447
2445
|
/* @__PURE__ */ r($e, { open: m, onOpenChange: p, children: [
|
|
2448
2446
|
/* @__PURE__ */ e(We, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2449
|
-
|
|
2447
|
+
I,
|
|
2450
2448
|
{
|
|
2451
2449
|
variant: "ghost",
|
|
2452
2450
|
size: "xs",
|
|
@@ -2478,8 +2476,8 @@ function nn({
|
|
|
2478
2476
|
}
|
|
2479
2477
|
function sn() {
|
|
2480
2478
|
xr();
|
|
2481
|
-
const t =
|
|
2482
|
-
return
|
|
2479
|
+
const t = w((l) => l.selectedSheetId), a = w((l) => l.selectedFrameId), o = w((l) => l.dashboard), s = w((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = de(), { setCard: n } = Ge(), c = Z((l) => l.card.dataSource);
|
|
2480
|
+
return xe(() => {
|
|
2483
2481
|
var u, h;
|
|
2484
2482
|
let l = s();
|
|
2485
2483
|
if (!l) {
|
|
@@ -2495,11 +2493,11 @@ function sn() {
|
|
|
2495
2493
|
};
|
|
2496
2494
|
}
|
|
2497
2495
|
function on() {
|
|
2498
|
-
const t =
|
|
2496
|
+
const t = w((l) => l.dashboard), a = w(
|
|
2499
2497
|
(l) => l.semanticExecutionPayload
|
|
2500
|
-
), o =
|
|
2498
|
+
), o = w(
|
|
2501
2499
|
(l) => l.actions.addFilterInput
|
|
2502
|
-
), { hasEntities: s } = sn(), { isLoading: i } = Ta(), n =
|
|
2500
|
+
), { hasEntities: s } = sn(), { isLoading: i } = Ta(), n = ae(
|
|
2503
2501
|
() => dr(t, a),
|
|
2504
2502
|
[t, a]
|
|
2505
2503
|
), d = !cr(t) && n.hasEligibleCards && !i;
|
|
@@ -2537,7 +2535,7 @@ function ln({
|
|
|
2537
2535
|
onManageControls: o,
|
|
2538
2536
|
onDismiss: s
|
|
2539
2537
|
}) {
|
|
2540
|
-
const i =
|
|
2538
|
+
const i = w(
|
|
2541
2539
|
(d) => d.dashboard.filterLayout
|
|
2542
2540
|
), { setFilterLayout: n } = de(), c = (i == null ? void 0 : i.toolbarWrap) ?? !1;
|
|
2543
2541
|
return /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
|
|
@@ -2632,23 +2630,23 @@ function cs({
|
|
|
2632
2630
|
pickerContentClassName: i,
|
|
2633
2631
|
settingsContentClassName: n
|
|
2634
2632
|
}) {
|
|
2635
|
-
var
|
|
2636
|
-
const [c, d] =
|
|
2637
|
-
(
|
|
2638
|
-
), v = wt(f),
|
|
2633
|
+
var R;
|
|
2634
|
+
const [c, d] = k(null), l = w((b) => b.dashboard), u = w((b) => b.selectedSheetId), h = w((b) => b.showFilters), m = w((b) => b.actions), { setDocumentPanelTarget: p, setShowFilters: g } = m, f = (R = l.sheets) == null ? void 0 : R.find(
|
|
2635
|
+
(b) => b.id === u
|
|
2636
|
+
), v = wt(f), S = ee((b) => {
|
|
2639
2637
|
window.setTimeout(() => {
|
|
2640
|
-
d(
|
|
2638
|
+
d(b);
|
|
2641
2639
|
}, 0);
|
|
2642
|
-
}, []),
|
|
2643
|
-
(
|
|
2640
|
+
}, []), T = ee(
|
|
2641
|
+
(b) => {
|
|
2644
2642
|
if (v && u) {
|
|
2645
|
-
|
|
2643
|
+
b && p(u, {
|
|
2646
2644
|
kind: "document",
|
|
2647
2645
|
group: "inputs"
|
|
2648
2646
|
});
|
|
2649
2647
|
return;
|
|
2650
2648
|
}
|
|
2651
|
-
g(
|
|
2649
|
+
g(b);
|
|
2652
2650
|
},
|
|
2653
2651
|
[
|
|
2654
2652
|
v,
|
|
@@ -2656,27 +2654,27 @@ function cs({
|
|
|
2656
2654
|
p,
|
|
2657
2655
|
g
|
|
2658
2656
|
]
|
|
2659
|
-
),
|
|
2660
|
-
|
|
2661
|
-
}, [
|
|
2662
|
-
|
|
2663
|
-
}, [
|
|
2664
|
-
|
|
2665
|
-
}, [
|
|
2666
|
-
return /* @__PURE__ */ r(
|
|
2657
|
+
), U = ee(() => {
|
|
2658
|
+
T(!0);
|
|
2659
|
+
}, [T]), M = ee(() => {
|
|
2660
|
+
S("create");
|
|
2661
|
+
}, [S]), A = ee(() => {
|
|
2662
|
+
S("manage");
|
|
2663
|
+
}, [S]);
|
|
2664
|
+
return /* @__PURE__ */ r(z, { children: [
|
|
2667
2665
|
/* @__PURE__ */ e(
|
|
2668
2666
|
nn,
|
|
2669
2667
|
{
|
|
2670
2668
|
showFilters: v ? !1 : h,
|
|
2671
|
-
onShowFiltersChange:
|
|
2669
|
+
onShowFiltersChange: T,
|
|
2672
2670
|
pickerContent: /* @__PURE__ */ e(on, {}),
|
|
2673
|
-
settingsContent: (
|
|
2671
|
+
settingsContent: (b) => /* @__PURE__ */ e(
|
|
2674
2672
|
ln,
|
|
2675
2673
|
{
|
|
2676
|
-
onAddFilter:
|
|
2677
|
-
onAddControl:
|
|
2674
|
+
onAddFilter: U,
|
|
2675
|
+
onAddControl: M,
|
|
2678
2676
|
onManageControls: A,
|
|
2679
|
-
onDismiss:
|
|
2677
|
+
onDismiss: b
|
|
2680
2678
|
}
|
|
2681
2679
|
),
|
|
2682
2680
|
size: t,
|
|
@@ -2688,11 +2686,11 @@ function cs({
|
|
|
2688
2686
|
}
|
|
2689
2687
|
),
|
|
2690
2688
|
c ? v ? /* @__PURE__ */ e(
|
|
2691
|
-
|
|
2689
|
+
Zr,
|
|
2692
2690
|
{
|
|
2693
2691
|
open: !0,
|
|
2694
|
-
onOpenChange: (
|
|
2695
|
-
|
|
2692
|
+
onOpenChange: (b) => {
|
|
2693
|
+
b || d(null);
|
|
2696
2694
|
},
|
|
2697
2695
|
initialMode: c
|
|
2698
2696
|
}
|
|
@@ -2700,8 +2698,8 @@ function cs({
|
|
|
2700
2698
|
Yr,
|
|
2701
2699
|
{
|
|
2702
2700
|
open: !0,
|
|
2703
|
-
onOpenChange: (
|
|
2704
|
-
|
|
2701
|
+
onOpenChange: (b) => {
|
|
2702
|
+
b || d(null);
|
|
2705
2703
|
},
|
|
2706
2704
|
showTrigger: !1,
|
|
2707
2705
|
initialMode: c
|
|
@@ -2717,7 +2715,7 @@ function cn({
|
|
|
2717
2715
|
}) {
|
|
2718
2716
|
const i = typeof a == "number" && a > 0;
|
|
2719
2717
|
return /* @__PURE__ */ r(
|
|
2720
|
-
|
|
2718
|
+
I,
|
|
2721
2719
|
{
|
|
2722
2720
|
type: "button",
|
|
2723
2721
|
size: "xs",
|
|
@@ -2819,22 +2817,22 @@ function xn({
|
|
|
2819
2817
|
onTogglePause: g,
|
|
2820
2818
|
onDelete: f,
|
|
2821
2819
|
selectingId: v,
|
|
2822
|
-
busyId:
|
|
2823
|
-
manageBriefingsHref:
|
|
2824
|
-
contentKind:
|
|
2825
|
-
hideHeader:
|
|
2820
|
+
busyId: S,
|
|
2821
|
+
manageBriefingsHref: T,
|
|
2822
|
+
contentKind: U,
|
|
2823
|
+
hideHeader: M = !1
|
|
2826
2824
|
}) {
|
|
2827
|
-
const A = t.length,
|
|
2825
|
+
const A = t.length, R = t.filter((N) => N.status === "ACTIVE").length, b = U === "reports" ? A === 1 ? "report" : "reports" : U === "briefings" ? A === 1 ? "briefing" : "briefings" : A === 1 ? "item" : "items", F = t.find((N) => N.hasActiveRun) ?? null, C = U ?? "reports & briefings", D = o === "dashboard" ? a : `Project ${C}`;
|
|
2828
2826
|
return /* @__PURE__ */ r(
|
|
2829
2827
|
"section",
|
|
2830
2828
|
{
|
|
2831
|
-
"aria-label": `Dashboard ${
|
|
2829
|
+
"aria-label": `Dashboard ${C.replace("&", "and")}`,
|
|
2832
2830
|
className: "flex h-full min-h-0 flex-col bg-background text-foreground",
|
|
2833
2831
|
children: [
|
|
2834
|
-
|
|
2832
|
+
M ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
|
|
2835
2833
|
/* @__PURE__ */ r("div", { className: "min-w-0", children: [
|
|
2836
|
-
/* @__PURE__ */ e("div", { className: un, children:
|
|
2837
|
-
/* @__PURE__ */ e("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children:
|
|
2834
|
+
/* @__PURE__ */ e("div", { className: un, children: C }),
|
|
2835
|
+
/* @__PURE__ */ e("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: D })
|
|
2838
2836
|
] }),
|
|
2839
2837
|
/* @__PURE__ */ e(
|
|
2840
2838
|
"button",
|
|
@@ -2842,7 +2840,7 @@ function xn({
|
|
|
2842
2840
|
type: "button",
|
|
2843
2841
|
onClick: c,
|
|
2844
2842
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2845
|
-
"aria-label": `Close ${
|
|
2843
|
+
"aria-label": `Close ${C.replace("&", "and")} panel`,
|
|
2846
2844
|
children: /* @__PURE__ */ e(Xe, { className: "h-3.5 w-3.5" })
|
|
2847
2845
|
}
|
|
2848
2846
|
)
|
|
@@ -2858,21 +2856,21 @@ function xn({
|
|
|
2858
2856
|
),
|
|
2859
2857
|
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && A === 0 ? /* @__PURE__ */ r("span", { children: [
|
|
2860
2858
|
"Loading ",
|
|
2861
|
-
|
|
2859
|
+
C,
|
|
2862
2860
|
"…"
|
|
2863
2861
|
] }) : A === 0 ? /* @__PURE__ */ r("span", { children: [
|
|
2864
2862
|
"No ",
|
|
2865
|
-
|
|
2863
|
+
C,
|
|
2866
2864
|
" yet"
|
|
2867
|
-
] }) : /* @__PURE__ */ r(
|
|
2865
|
+
] }) : /* @__PURE__ */ r(z, { children: [
|
|
2868
2866
|
/* @__PURE__ */ r("span", { className: "font-medium text-foreground/80", children: [
|
|
2869
2867
|
A,
|
|
2870
2868
|
" ",
|
|
2871
|
-
|
|
2869
|
+
b
|
|
2872
2870
|
] }),
|
|
2873
2871
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2874
2872
|
/* @__PURE__ */ r("span", { children: [
|
|
2875
|
-
|
|
2873
|
+
R,
|
|
2876
2874
|
" active"
|
|
2877
2875
|
] })
|
|
2878
2876
|
] }) })
|
|
@@ -2883,17 +2881,17 @@ function xn({
|
|
|
2883
2881
|
// when a manual reload is in flight, but don't show a separate
|
|
2884
2882
|
// refresh button — close+reopen handles the rare "stale list"
|
|
2885
2883
|
// case without crowding the toolbar.
|
|
2886
|
-
/* @__PURE__ */ e(
|
|
2884
|
+
/* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
|
|
2887
2885
|
) : null,
|
|
2888
2886
|
A > 0 && u ? m && h ? /* @__PURE__ */ r(Le, { children: [
|
|
2889
2887
|
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Oe, children: [
|
|
2890
|
-
/* @__PURE__ */ e(
|
|
2888
|
+
/* @__PURE__ */ e(ve, { className: "h-3 w-3" }),
|
|
2891
2889
|
" New"
|
|
2892
2890
|
] }) }),
|
|
2893
2891
|
/* @__PURE__ */ r(Te, { align: "end", children: [
|
|
2894
|
-
/* @__PURE__ */ e(
|
|
2892
|
+
/* @__PURE__ */ e(G, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
|
|
2895
2893
|
/* @__PURE__ */ e(
|
|
2896
|
-
|
|
2894
|
+
G,
|
|
2897
2895
|
{
|
|
2898
2896
|
onClick: () => l("analytical_briefing"),
|
|
2899
2897
|
children: "Create analytical briefing"
|
|
@@ -2906,7 +2904,7 @@ function xn({
|
|
|
2906
2904
|
onClick: () => l("scheduled_report"),
|
|
2907
2905
|
className: Oe,
|
|
2908
2906
|
children: [
|
|
2909
|
-
/* @__PURE__ */ e(
|
|
2907
|
+
/* @__PURE__ */ e(ve, { className: "h-3 w-3" }),
|
|
2910
2908
|
" Schedule report"
|
|
2911
2909
|
]
|
|
2912
2910
|
}
|
|
@@ -2916,18 +2914,18 @@ function xn({
|
|
|
2916
2914
|
onClick: () => l("analytical_briefing"),
|
|
2917
2915
|
className: Oe,
|
|
2918
2916
|
children: [
|
|
2919
|
-
/* @__PURE__ */ e(
|
|
2917
|
+
/* @__PURE__ */ e(ve, { className: "h-3 w-3" }),
|
|
2920
2918
|
" New briefing"
|
|
2921
2919
|
]
|
|
2922
2920
|
}
|
|
2923
2921
|
) : null : null
|
|
2924
2922
|
] })
|
|
2925
2923
|
] }),
|
|
2926
|
-
|
|
2927
|
-
/* @__PURE__ */ e(
|
|
2928
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children:
|
|
2924
|
+
F ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
|
|
2925
|
+
/* @__PURE__ */ e(re, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
|
|
2926
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: F.name }),
|
|
2929
2927
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2930
|
-
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: Qt(
|
|
2928
|
+
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: Qt(F) })
|
|
2931
2929
|
] }) : null,
|
|
2932
2930
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: [
|
|
2933
2931
|
s ? /* @__PURE__ */ e("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: s }) : null,
|
|
@@ -2938,27 +2936,27 @@ function xn({
|
|
|
2938
2936
|
canCreate: u,
|
|
2939
2937
|
canCreateScheduledReport: h,
|
|
2940
2938
|
analyticalBriefingsEnabled: m,
|
|
2941
|
-
contentKind:
|
|
2939
|
+
contentKind: U
|
|
2942
2940
|
}
|
|
2943
2941
|
) : null,
|
|
2944
|
-
t.map((
|
|
2942
|
+
t.map((N) => /* @__PURE__ */ e(
|
|
2945
2943
|
Cn,
|
|
2946
2944
|
{
|
|
2947
|
-
briefing:
|
|
2948
|
-
isOpening: v ===
|
|
2949
|
-
isBusy:
|
|
2950
|
-
onOpen: () => d(
|
|
2951
|
-
onRunNow: () => p(
|
|
2952
|
-
onTogglePause: () => g(
|
|
2953
|
-
onDelete: () => f(
|
|
2945
|
+
briefing: N,
|
|
2946
|
+
isOpening: v === N.id,
|
|
2947
|
+
isBusy: S === N.id,
|
|
2948
|
+
onOpen: () => d(N.id),
|
|
2949
|
+
onRunNow: () => p(N),
|
|
2950
|
+
onTogglePause: () => g(N),
|
|
2951
|
+
onDelete: () => f(N)
|
|
2954
2952
|
},
|
|
2955
|
-
|
|
2953
|
+
N.id
|
|
2956
2954
|
))
|
|
2957
2955
|
] }),
|
|
2958
|
-
|
|
2956
|
+
T ? /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
|
|
2959
2957
|
"a",
|
|
2960
2958
|
{
|
|
2961
|
-
href:
|
|
2959
|
+
href: T,
|
|
2962
2960
|
className: J(Ht, "h-6 px-1 text-[11px]"),
|
|
2963
2961
|
children: [
|
|
2964
2962
|
"Manage all reports & briefings",
|
|
@@ -2995,7 +2993,7 @@ function vn({
|
|
|
2995
2993
|
onClick: () => t("scheduled_report"),
|
|
2996
2994
|
className: Oe,
|
|
2997
2995
|
children: [
|
|
2998
|
-
/* @__PURE__ */ e(
|
|
2996
|
+
/* @__PURE__ */ e(ve, { className: "h-3 w-3" }),
|
|
2999
2997
|
" Schedule a report"
|
|
3000
2998
|
]
|
|
3001
2999
|
}
|
|
@@ -3228,7 +3226,7 @@ function Cn({
|
|
|
3228
3226
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
3229
3227
|
/* @__PURE__ */ e(Ma, { className: "h-3 w-3" }),
|
|
3230
3228
|
/* @__PURE__ */ e("span", { className: "truncate", children: pn(t) }),
|
|
3231
|
-
t.lastRunAt ? /* @__PURE__ */ r(
|
|
3229
|
+
t.lastRunAt ? /* @__PURE__ */ r(z, { children: [
|
|
3232
3230
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
3233
3231
|
/* @__PURE__ */ r("span", { children: [
|
|
3234
3232
|
"Last run ",
|
|
@@ -3237,7 +3235,7 @@ function Cn({
|
|
|
3237
3235
|
] }) : null
|
|
3238
3236
|
] }),
|
|
3239
3237
|
u || l ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
|
|
3240
|
-
l ? /* @__PURE__ */ e(
|
|
3238
|
+
l ? /* @__PURE__ */ e(re, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ e(
|
|
3241
3239
|
"span",
|
|
3242
3240
|
{
|
|
3243
3241
|
className: J(
|
|
@@ -3251,7 +3249,7 @@ function Cn({
|
|
|
3251
3249
|
]
|
|
3252
3250
|
}
|
|
3253
3251
|
),
|
|
3254
|
-
/* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children: o ? /* @__PURE__ */ e(
|
|
3252
|
+
/* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children: o ? /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ e(re, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ r(Le, { children: [
|
|
3255
3253
|
/* @__PURE__ */ e(Ve, { asChild: !0, children: /* @__PURE__ */ e(
|
|
3256
3254
|
"button",
|
|
3257
3255
|
{
|
|
@@ -3263,13 +3261,13 @@ function Cn({
|
|
|
3263
3261
|
}
|
|
3264
3262
|
) }),
|
|
3265
3263
|
/* @__PURE__ */ r(Te, { align: "end", className: "w-44", children: [
|
|
3266
|
-
/* @__PURE__ */ r(
|
|
3264
|
+
/* @__PURE__ */ r(G, { onClick: s, children: [
|
|
3267
3265
|
/* @__PURE__ */ e(Ut, { className: "h-3.5 w-3.5" }),
|
|
3268
3266
|
"Edit ",
|
|
3269
3267
|
p.noun
|
|
3270
3268
|
] }),
|
|
3271
3269
|
/* @__PURE__ */ r(
|
|
3272
|
-
|
|
3270
|
+
G,
|
|
3273
3271
|
{
|
|
3274
3272
|
onClick: (f) => {
|
|
3275
3273
|
f.preventDefault(), i();
|
|
@@ -3281,15 +3279,15 @@ function Cn({
|
|
|
3281
3279
|
}
|
|
3282
3280
|
),
|
|
3283
3281
|
t.scheduleExpr ? /* @__PURE__ */ e(
|
|
3284
|
-
|
|
3282
|
+
G,
|
|
3285
3283
|
{
|
|
3286
3284
|
onClick: (f) => {
|
|
3287
3285
|
f.preventDefault(), n();
|
|
3288
3286
|
},
|
|
3289
|
-
children: d ? /* @__PURE__ */ r(
|
|
3287
|
+
children: d ? /* @__PURE__ */ r(z, { children: [
|
|
3290
3288
|
/* @__PURE__ */ e(Ra, { className: "h-3.5 w-3.5" }),
|
|
3291
3289
|
"Resume"
|
|
3292
|
-
] }) : /* @__PURE__ */ r(
|
|
3290
|
+
] }) : /* @__PURE__ */ r(z, { children: [
|
|
3293
3291
|
/* @__PURE__ */ e(za, { className: "h-3.5 w-3.5" }),
|
|
3294
3292
|
"Pause"
|
|
3295
3293
|
] })
|
|
@@ -3297,7 +3295,7 @@ function Cn({
|
|
|
3297
3295
|
) : null,
|
|
3298
3296
|
/* @__PURE__ */ e(je, {}),
|
|
3299
3297
|
/* @__PURE__ */ r(
|
|
3300
|
-
|
|
3298
|
+
G,
|
|
3301
3299
|
{
|
|
3302
3300
|
onClick: (f) => {
|
|
3303
3301
|
f.preventDefault(), c();
|
|
@@ -3342,7 +3340,7 @@ async function kn(t) {
|
|
|
3342
3340
|
return o;
|
|
3343
3341
|
}
|
|
3344
3342
|
const Dn = {
|
|
3345
|
-
listBriefings:
|
|
3343
|
+
listBriefings: Ka,
|
|
3346
3344
|
getBriefing: Qa,
|
|
3347
3345
|
pauseBriefing: Ha,
|
|
3348
3346
|
resumeBriefing: qa,
|
|
@@ -3367,37 +3365,37 @@ function An({
|
|
|
3367
3365
|
openRun: m,
|
|
3368
3366
|
client: p
|
|
3369
3367
|
}) {
|
|
3370
|
-
const { authToken: g, tokenProps: f } = It(), v = ja(),
|
|
3371
|
-
d === void 0 &&
|
|
3372
|
-
}, [
|
|
3368
|
+
const { authToken: g, tokenProps: f } = It(), v = ja(), S = !h || v.canCreate && (h === "scheduled_report" || v.analyticalBriefingsEnabled), [T, U] = k(!1), M = d ?? T, A = (y) => {
|
|
3369
|
+
d === void 0 && U(y), l == null || l(y);
|
|
3370
|
+
}, [R, b] = k(
|
|
3373
3371
|
h ? "author" : "list"
|
|
3374
|
-
), [
|
|
3372
|
+
), [F, C] = k(
|
|
3375
3373
|
h ?? "analytical_briefing"
|
|
3376
|
-
), [
|
|
3374
|
+
), [D, N] = k("dashboard"), [j, L] = k(
|
|
3377
3375
|
[]
|
|
3378
|
-
), [
|
|
3376
|
+
), [O, X] = k(null), V = h && !S && !O ? "list" : R, [te, Y] = k(!1), [H, he] = k(null), [ge, Q] = k(null), [_, oe] = k(
|
|
3379
3377
|
null
|
|
3380
|
-
), [me, pe] =
|
|
3381
|
-
|
|
3382
|
-
const y =
|
|
3383
|
-
Be.current =
|
|
3384
|
-
}, [
|
|
3385
|
-
const Ye = vt(), $ = o ?? (f == null ? void 0 : f.apiServiceUrl), W = s ?? (g == null ? void 0 : g.accessToken),
|
|
3386
|
-
|
|
3378
|
+
), [me, pe] = k(null), Ce = nt(null), Be = nt(M);
|
|
3379
|
+
xe(() => {
|
|
3380
|
+
const y = M && !Be.current;
|
|
3381
|
+
Be.current = M, !(!y || !h) && (X(null), N("dashboard"), C(h), b("author"), pe(null));
|
|
3382
|
+
}, [M, h]);
|
|
3383
|
+
const Ye = vt(), $ = o ?? (f == null ? void 0 : f.apiServiceUrl), W = s ?? (g == null ? void 0 : g.accessToken), ne = ae(() => ({ ...Dn, ...p }), [p]), [we, Je] = k(null);
|
|
3384
|
+
xe(() => {
|
|
3387
3385
|
if (!m || !$ || !W) return;
|
|
3388
3386
|
let y = !0;
|
|
3389
|
-
return
|
|
3390
|
-
y && (
|
|
3387
|
+
return ne.getBriefing($, W, m.briefingId).then(({ briefing: P }) => {
|
|
3388
|
+
y && (X(P), Je(m), b("author"));
|
|
3391
3389
|
}, (P) => {
|
|
3392
|
-
y &&
|
|
3390
|
+
y && E.error(P instanceof Error ? P.message : "Could not open the run.");
|
|
3393
3391
|
}), () => {
|
|
3394
3392
|
y = !1;
|
|
3395
3393
|
};
|
|
3396
|
-
}, [m, $, W,
|
|
3397
|
-
const
|
|
3394
|
+
}, [m, $, W, ne]);
|
|
3395
|
+
const be = wn(a), Pe = ae(() => {
|
|
3398
3396
|
const y = Sn(
|
|
3399
3397
|
j,
|
|
3400
|
-
|
|
3398
|
+
D,
|
|
3401
3399
|
t
|
|
3402
3400
|
);
|
|
3403
3401
|
if (!h)
|
|
@@ -3406,25 +3404,25 @@ function An({
|
|
|
3406
3404
|
return y.filter(
|
|
3407
3405
|
(Me) => le(Me).noun === P
|
|
3408
3406
|
);
|
|
3409
|
-
}, [t, j,
|
|
3407
|
+
}, [t, j, D, h]), Ze = ae(() => D === "dashboard" ? {
|
|
3410
3408
|
source: { type: "dashboard", dashboardId: t },
|
|
3411
|
-
label:
|
|
3412
|
-
detail: Nn(
|
|
3409
|
+
label: be,
|
|
3410
|
+
detail: Nn(be)
|
|
3413
3411
|
} : {
|
|
3414
3412
|
source: { type: "project" },
|
|
3415
3413
|
label: "This project",
|
|
3416
3414
|
detail: "Use any data in this project."
|
|
3417
|
-
}, [t,
|
|
3415
|
+
}, [t, be, D]), Ne = !!($ && W), Se = wr({
|
|
3418
3416
|
canCreate: v.canCreate,
|
|
3419
3417
|
analyticalBriefingsEnabled: v.analyticalBriefingsEnabled,
|
|
3420
|
-
scheduledReportAvailable:
|
|
3421
|
-
}),
|
|
3418
|
+
scheduledReportAvailable: D === "dashboard"
|
|
3419
|
+
}), se = ee(async () => {
|
|
3422
3420
|
if (!(!$ || !W)) {
|
|
3423
|
-
|
|
3421
|
+
Y(!0), pe(null);
|
|
3424
3422
|
try {
|
|
3425
|
-
|
|
3423
|
+
L(
|
|
3426
3424
|
await kn({
|
|
3427
|
-
apiClient:
|
|
3425
|
+
apiClient: ne,
|
|
3428
3426
|
apiServiceUrl: $,
|
|
3429
3427
|
token: W
|
|
3430
3428
|
})
|
|
@@ -3434,104 +3432,104 @@ function An({
|
|
|
3434
3432
|
y instanceof Error ? y.message : "Could not load briefings."
|
|
3435
3433
|
);
|
|
3436
3434
|
} finally {
|
|
3437
|
-
|
|
3435
|
+
Y(!1);
|
|
3438
3436
|
}
|
|
3439
3437
|
}
|
|
3440
|
-
}, [
|
|
3441
|
-
|
|
3442
|
-
!
|
|
3443
|
-
}, [Ne,
|
|
3438
|
+
}, [ne, $, W]);
|
|
3439
|
+
xe(() => {
|
|
3440
|
+
!M || V !== "list" || !Ne || se();
|
|
3441
|
+
}, [Ne, V, se, M]);
|
|
3444
3442
|
const ke = () => {
|
|
3445
|
-
|
|
3446
|
-
},
|
|
3447
|
-
|
|
3443
|
+
X(null), N("dashboard"), b("list"), A(!0);
|
|
3444
|
+
}, x = (y) => {
|
|
3445
|
+
X(null), C(y), b("author");
|
|
3448
3446
|
}, B = async (y) => {
|
|
3449
3447
|
if (!(!$ || !W)) {
|
|
3450
|
-
|
|
3448
|
+
he(y), pe(null);
|
|
3451
3449
|
try {
|
|
3452
|
-
const P = await
|
|
3450
|
+
const P = await ne.getBriefing(
|
|
3453
3451
|
$,
|
|
3454
3452
|
W,
|
|
3455
3453
|
y
|
|
3456
3454
|
);
|
|
3457
|
-
|
|
3455
|
+
X(P.briefing), b("author");
|
|
3458
3456
|
} catch (P) {
|
|
3459
3457
|
pe(
|
|
3460
3458
|
P instanceof Error ? P.message : "Could not open briefing."
|
|
3461
3459
|
);
|
|
3462
3460
|
} finally {
|
|
3463
|
-
|
|
3461
|
+
he(null);
|
|
3464
3462
|
}
|
|
3465
3463
|
}
|
|
3466
3464
|
}, q = async (y) => {
|
|
3467
3465
|
if (!(!$ || !W)) {
|
|
3468
|
-
|
|
3466
|
+
Q(y.id);
|
|
3469
3467
|
try {
|
|
3470
|
-
const P = await
|
|
3468
|
+
const P = await ne.runBriefingNow(
|
|
3471
3469
|
$,
|
|
3472
3470
|
W,
|
|
3473
3471
|
y.id,
|
|
3474
3472
|
{ requestId: Fn() }
|
|
3475
3473
|
);
|
|
3476
|
-
Ye.track({ kind: "briefing", id: P.run.id, title: y.name, briefingId: y.id }),
|
|
3474
|
+
Ye.track({ kind: "briefing", id: P.run.id, title: y.name, briefingId: y.id }), se();
|
|
3477
3475
|
} catch (P) {
|
|
3478
|
-
|
|
3476
|
+
E.error(
|
|
3479
3477
|
P instanceof Error ? P.message : "Could not start the run."
|
|
3480
3478
|
);
|
|
3481
3479
|
} finally {
|
|
3482
|
-
|
|
3480
|
+
Q(null);
|
|
3483
3481
|
}
|
|
3484
3482
|
}
|
|
3485
3483
|
}, ie = async (y) => {
|
|
3486
3484
|
if (!$ || !W) return;
|
|
3487
3485
|
const { noun: P } = le(y), Me = P === "report" ? "Report" : "Briefing";
|
|
3488
|
-
|
|
3486
|
+
Q(y.id);
|
|
3489
3487
|
try {
|
|
3490
|
-
const Ue = y.status === "PAUSED" ? await
|
|
3488
|
+
const Ue = y.status === "PAUSED" ? await ne.resumeBriefing(
|
|
3491
3489
|
$,
|
|
3492
3490
|
W,
|
|
3493
3491
|
y.id
|
|
3494
|
-
) : await
|
|
3492
|
+
) : await ne.pauseBriefing(
|
|
3495
3493
|
$,
|
|
3496
3494
|
W,
|
|
3497
3495
|
y.id
|
|
3498
3496
|
);
|
|
3499
|
-
|
|
3497
|
+
E.success(
|
|
3500
3498
|
Ue.briefing.status === "PAUSED" ? `${Me} paused` : `${Me} resumed`
|
|
3501
|
-
),
|
|
3499
|
+
), se();
|
|
3502
3500
|
} catch (Ue) {
|
|
3503
|
-
|
|
3501
|
+
E.error(
|
|
3504
3502
|
Ue instanceof Error ? Ue.message : `Could not update the ${P} status.`
|
|
3505
3503
|
);
|
|
3506
3504
|
} finally {
|
|
3507
|
-
|
|
3505
|
+
Q(null);
|
|
3508
3506
|
}
|
|
3509
|
-
},
|
|
3510
|
-
if (!
|
|
3511
|
-
const y =
|
|
3512
|
-
|
|
3507
|
+
}, ce = async () => {
|
|
3508
|
+
if (!_ || !$ || !W) return;
|
|
3509
|
+
const y = _;
|
|
3510
|
+
Q(y.id);
|
|
3513
3511
|
try {
|
|
3514
|
-
await
|
|
3512
|
+
await ne.deleteBriefing(
|
|
3515
3513
|
$,
|
|
3516
3514
|
W,
|
|
3517
3515
|
y.id
|
|
3518
3516
|
);
|
|
3519
3517
|
const { noun: P } = le(y);
|
|
3520
|
-
|
|
3518
|
+
E.success(`${P === "report" ? "Report" : "Briefing"} deleted`), oe(null), se();
|
|
3521
3519
|
} catch (P) {
|
|
3522
|
-
|
|
3520
|
+
E.error(
|
|
3523
3521
|
P instanceof Error ? P.message : "Could not delete the briefing."
|
|
3524
3522
|
);
|
|
3525
3523
|
} finally {
|
|
3526
|
-
|
|
3524
|
+
Q(null);
|
|
3527
3525
|
}
|
|
3528
|
-
},
|
|
3529
|
-
return v.surfaceVisible ? /* @__PURE__ */ r(
|
|
3526
|
+
}, Kt = Pe.length;
|
|
3527
|
+
return v.surfaceVisible ? /* @__PURE__ */ r(Ga, { open: M, onOpenChange: A, children: [
|
|
3530
3528
|
u ? null : /* @__PURE__ */ e(
|
|
3531
3529
|
cn,
|
|
3532
3530
|
{
|
|
3533
3531
|
disabled: i || !Ne,
|
|
3534
|
-
briefingCount:
|
|
3532
|
+
briefingCount: Kt,
|
|
3535
3533
|
className: n,
|
|
3536
3534
|
onClick: ke
|
|
3537
3535
|
}
|
|
@@ -3549,8 +3547,8 @@ function An({
|
|
|
3549
3547
|
},
|
|
3550
3548
|
children: [
|
|
3551
3549
|
/* @__PURE__ */ r(Ya, { className: "sr-only", children: [
|
|
3552
|
-
/* @__PURE__ */ e(
|
|
3553
|
-
/* @__PURE__ */ e(
|
|
3550
|
+
/* @__PURE__ */ e(Ja, { children: "Reports & briefings" }),
|
|
3551
|
+
/* @__PURE__ */ e(Za, { children: "Manage reports and briefings for this dashboard." })
|
|
3554
3552
|
] }),
|
|
3555
3553
|
h ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
|
|
3556
3554
|
/* @__PURE__ */ r(
|
|
@@ -3565,17 +3563,17 @@ function An({
|
|
|
3565
3563
|
{
|
|
3566
3564
|
type: "button",
|
|
3567
3565
|
role: "tab",
|
|
3568
|
-
"aria-selected":
|
|
3569
|
-
disabled: !
|
|
3566
|
+
"aria-selected": V === "author",
|
|
3567
|
+
disabled: !S,
|
|
3570
3568
|
className: J(
|
|
3571
3569
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3572
|
-
|
|
3573
|
-
!
|
|
3570
|
+
V === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
|
|
3571
|
+
!S && "cursor-not-allowed opacity-50"
|
|
3574
3572
|
),
|
|
3575
3573
|
onClick: () => {
|
|
3576
|
-
|
|
3574
|
+
S && (X(null), C(h), N("dashboard"), b("author"));
|
|
3577
3575
|
},
|
|
3578
|
-
children:
|
|
3576
|
+
children: O ? `Edit ${le(O).noun}` : h === "scheduled_report" ? "Schedule report" : "Create briefing"
|
|
3579
3577
|
}
|
|
3580
3578
|
),
|
|
3581
3579
|
/* @__PURE__ */ e(
|
|
@@ -3583,12 +3581,12 @@ function An({
|
|
|
3583
3581
|
{
|
|
3584
3582
|
type: "button",
|
|
3585
3583
|
role: "tab",
|
|
3586
|
-
"aria-selected":
|
|
3584
|
+
"aria-selected": V === "list",
|
|
3587
3585
|
className: J(
|
|
3588
3586
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3589
|
-
|
|
3587
|
+
V === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
3590
3588
|
),
|
|
3591
|
-
onClick: () =>
|
|
3589
|
+
onClick: () => b("list"),
|
|
3592
3590
|
children: h === "scheduled_report" ? "Manage reports" : "Manage briefings"
|
|
3593
3591
|
}
|
|
3594
3592
|
)
|
|
@@ -3606,20 +3604,20 @@ function An({
|
|
|
3606
3604
|
}
|
|
3607
3605
|
)
|
|
3608
3606
|
] }) : null,
|
|
3609
|
-
|
|
3607
|
+
V === "list" ? /* @__PURE__ */ e(
|
|
3610
3608
|
xn,
|
|
3611
3609
|
{
|
|
3612
3610
|
briefings: Pe,
|
|
3613
|
-
dashboardLabel:
|
|
3614
|
-
sourceView:
|
|
3611
|
+
dashboardLabel: be,
|
|
3612
|
+
sourceView: D,
|
|
3615
3613
|
error: me,
|
|
3616
|
-
loading:
|
|
3617
|
-
onSourceViewChange:
|
|
3614
|
+
loading: te,
|
|
3615
|
+
onSourceViewChange: N,
|
|
3618
3616
|
onClose: () => A(!1),
|
|
3619
3617
|
onEdit: (y) => {
|
|
3620
3618
|
B(y);
|
|
3621
3619
|
},
|
|
3622
|
-
onNew:
|
|
3620
|
+
onNew: x,
|
|
3623
3621
|
canCreate: !h && Se.length > 0,
|
|
3624
3622
|
canCreateScheduledReport: Se.includes(
|
|
3625
3623
|
"scheduled_report"
|
|
@@ -3633,9 +3631,9 @@ function An({
|
|
|
3633
3631
|
onTogglePause: (y) => {
|
|
3634
3632
|
ie(y);
|
|
3635
3633
|
},
|
|
3636
|
-
onDelete: (y) =>
|
|
3637
|
-
selectingId:
|
|
3638
|
-
busyId:
|
|
3634
|
+
onDelete: (y) => oe(y),
|
|
3635
|
+
selectingId: H,
|
|
3636
|
+
busyId: ge,
|
|
3639
3637
|
manageBriefingsHref: c,
|
|
3640
3638
|
contentKind: h === "scheduled_report" ? "reports" : h === "analytical_briefing" ? "briefings" : void 0,
|
|
3641
3639
|
hideHeader: !!h
|
|
@@ -3645,23 +3643,23 @@ function An({
|
|
|
3645
3643
|
{
|
|
3646
3644
|
apiServiceUrl: $,
|
|
3647
3645
|
token: W,
|
|
3648
|
-
briefing:
|
|
3649
|
-
initialRunId: we && (
|
|
3650
|
-
intent:
|
|
3651
|
-
sourceContext:
|
|
3652
|
-
title:
|
|
3646
|
+
briefing: O,
|
|
3647
|
+
initialRunId: we && (O == null ? void 0 : O.id) === we.briefingId ? we.runId : void 0,
|
|
3648
|
+
intent: F,
|
|
3649
|
+
sourceContext: O ? void 0 : Ze,
|
|
3650
|
+
title: O ? `Edit ${le(O).noun}` : F === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
|
|
3653
3651
|
hideHeader: !!h,
|
|
3654
3652
|
className: "h-full min-h-0 max-w-none border-0 shadow-none",
|
|
3655
|
-
onBack: h ? void 0 : () =>
|
|
3653
|
+
onBack: h ? void 0 : () => b("list"),
|
|
3656
3654
|
onCancel: () => A(!1),
|
|
3657
3655
|
onDeleted: () => {
|
|
3658
|
-
const y =
|
|
3659
|
-
|
|
3656
|
+
const y = O ? le(O).noun : "briefing";
|
|
3657
|
+
E.success(`${y === "report" ? "Report" : "Briefing"} deleted`), X(null), b("list"), se();
|
|
3660
3658
|
},
|
|
3661
3659
|
onRunStarted: () => {
|
|
3662
3660
|
},
|
|
3663
3661
|
onSaved: (y) => {
|
|
3664
|
-
|
|
3662
|
+
X(y), se();
|
|
3665
3663
|
},
|
|
3666
3664
|
onMinimizeRun: () => {
|
|
3667
3665
|
A(!1);
|
|
@@ -3674,21 +3672,21 @@ function An({
|
|
|
3674
3672
|
/* @__PURE__ */ e(
|
|
3675
3673
|
lt,
|
|
3676
3674
|
{
|
|
3677
|
-
open: !!
|
|
3675
|
+
open: !!_,
|
|
3678
3676
|
onOpenChange: (y) => {
|
|
3679
|
-
y ||
|
|
3677
|
+
y || oe(null);
|
|
3680
3678
|
},
|
|
3681
3679
|
children: /* @__PURE__ */ r(dt, { children: [
|
|
3682
3680
|
/* @__PURE__ */ r(ct, { children: [
|
|
3683
3681
|
/* @__PURE__ */ r(ut, { children: [
|
|
3684
3682
|
"Delete",
|
|
3685
3683
|
" ",
|
|
3686
|
-
|
|
3684
|
+
_ ? le(_).noun : "briefing",
|
|
3687
3685
|
"?"
|
|
3688
3686
|
] }),
|
|
3689
3687
|
/* @__PURE__ */ r(ht, { children: [
|
|
3690
3688
|
"This permanently deletes ",
|
|
3691
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3689
|
+
/* @__PURE__ */ e("strong", { children: _ == null ? void 0 : _.name }),
|
|
3692
3690
|
". Recipients will stop receiving it."
|
|
3693
3691
|
] })
|
|
3694
3692
|
] }),
|
|
@@ -3698,11 +3696,11 @@ function An({
|
|
|
3698
3696
|
Vt,
|
|
3699
3697
|
{
|
|
3700
3698
|
className: "bg-destructive/90 hover:bg-destructive",
|
|
3701
|
-
onClick:
|
|
3699
|
+
onClick: ce,
|
|
3702
3700
|
children: [
|
|
3703
3701
|
"Delete",
|
|
3704
3702
|
" ",
|
|
3705
|
-
|
|
3703
|
+
_ ? le(_).noun : "briefing"
|
|
3706
3704
|
]
|
|
3707
3705
|
}
|
|
3708
3706
|
)
|
|
@@ -3725,7 +3723,7 @@ export {
|
|
|
3725
3723
|
rs as a,
|
|
3726
3724
|
ss as b,
|
|
3727
3725
|
ds as c,
|
|
3728
|
-
|
|
3726
|
+
Zr as d,
|
|
3729
3727
|
nn as e,
|
|
3730
3728
|
cs as f,
|
|
3731
3729
|
us as g,
|