react-semaphor 0.1.559 → 0.1.561
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 +389 -378
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +9 -9
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/analytics-base-schemas-CB3oFAXk.js +658 -0
- package/dist/chunks/{assistant-chat-B_4bVE6I.js → assistant-chat-DiVHY3Hw.js} +209 -211
- package/dist/chunks/bookmark-impact-CR09dpkn.js +75 -0
- package/dist/chunks/bookmark-state-BusLpkb7.js +743 -0
- package/dist/chunks/{braces-Rdxa3H-s.js → braces-u8VorWJc.js} +1 -1
- package/dist/chunks/{comparison-window-caption-CKzQ5LcF.js → comparison-window-caption-DDsIWJYT.js} +201 -201
- package/dist/chunks/{context-DVy4HOU0.js → context-TUjw9eqr.js} +1 -1
- package/dist/chunks/{custom-visual-inputs-zVa9wX_o.js → custom-visual-inputs-DfolidZ9.js} +1 -1
- package/dist/chunks/{dashboard-BziwOVpZ.js → dashboard-BRdZBPqr.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CbeNR-YI.js → dashboard-briefing-launcher-CgvTLndW.js} +1163 -1178
- package/dist/chunks/{dashboard-controls-RD6UJs1r.js → dashboard-controls-B4vfSzTF.js} +877 -941
- package/dist/chunks/{dashboard-json-DGpv17vL.js → dashboard-json-Y3MF59g7.js} +5 -5
- package/dist/chunks/document-dashboard-inputs-CvBbFTUA.js +1718 -0
- package/dist/chunks/{edit-dashboard-visual-AQ2pQkFp.js → edit-dashboard-visual-DwjZcxj-.js} +9080 -9354
- package/dist/chunks/filter-reach-copy-bijwf_-b.js +3596 -0
- package/dist/chunks/{filter-value-text-B4l-xqJT.js → filter-value-text-DFnhwuEW.js} +3 -3
- package/dist/chunks/global-date-filter-utils-BXgCpvQM.js +15142 -0
- package/dist/chunks/{index-B1Xr7W24.js → index-ClwbY3BL.js} +648 -674
- package/dist/chunks/{layout-grid-Bbz3zKif.js → layout-grid-CtvCBfOm.js} +1 -1
- package/dist/chunks/{list-filter-3sbH0Uy1.js → list-filter-BklYgciR.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-CEe3PGEo.js → matrix-analytical-definition-pU51-JmY.js} +4 -4
- package/dist/chunks/{matrix-card-BRNGb1C4.js → matrix-card-CUorIB7Q.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-CEegvTqg.js → matrix-member-presentation-Df5UgCGN.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-COxrfQTS.js → matrix-operation-contract-BSiGEXVC.js} +221 -214
- package/dist/chunks/{metric-comparison-DQx-uX__.js → metric-comparison-95aC0uEO.js} +6 -6
- package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-B5wQhg5G.js} +1 -1
- package/dist/chunks/{palette-DMJtp3Vn.js → palette-DTnMhipt.js} +1 -1
- package/dist/chunks/pivot-result-contract-expectations-Bo-86vwS.js +56 -0
- package/dist/chunks/{pivot-result-identity-CAj8SiRL.js → pivot-result-identity-olvXJoB9.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-0sc8B1lh.js → report-preferences-dialog-C2YUIwKG.js} +55 -55
- package/dist/chunks/{report-runtime-context-bYoExeWr.js → report-runtime-context-DoIUr3MP.js} +2 -2
- package/dist/chunks/resolve-dashboard-input-context-q_iiNXE1.js +6503 -0
- package/dist/chunks/{save-DSb1jTtG.js → save-DH4RyrnG.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-BQWM3ldX.js → saved-dashboard-context-8jqfI7hI.js} +59 -59
- package/dist/chunks/{selection-reducer-DSzMWb4x.js → selection-reducer-CV7K4FI6.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-Bz14Oma5.js → semaphor-ready-indicator-E2XWyibu.js} +40105 -41658
- package/dist/chunks/{shelf-drop-preview-context-DBHAkgch.js → shelf-drop-preview-context-C29EUzDp.js} +570 -570
- package/dist/chunks/{source-entity-resolution-BOrmNCEM.js → source-entity-resolution-BXI3nQ5Z.js} +1 -1
- package/dist/chunks/{switch-Dq8XPFpT.js → switch-balDSHc7.js} +3 -3
- package/dist/chunks/{table-export-sheet-C_RvEUyO.js → table-export-sheet-CK8tvh4d.js} +1 -1
- package/dist/chunks/temporal-input-presentation-B77JsAzU.js +5002 -0
- package/dist/chunks/{token-types-LCYMJ3pa.js → token-types-DhYH5YKb.js} +1 -1
- package/dist/chunks/{upload-Dr_WAxHQ.js → upload-Ufj8vjyn.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BK3YFkfc.js → use-create-flow-overlay-state-9WsnzEO5.js} +6 -6
- package/dist/chunks/{validators-C87JPd-_.js → validators-BtaCFIEB.js} +1206 -1579
- package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-CGLVI40Q.js} +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2713 -1459
- package/dist/data-app-sdk/index.js +20 -20
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +10 -10
- package/dist/format-utils/index.js +262 -256
- package/dist/index.js +214 -215
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/dashboard/summary-number-formatter.d.ts +6 -0
- package/dist/types/components/editor/editor-aside/utils.d.ts +1 -1
- package/dist/types/components/visual/data-table/types/data-table.d.ts +5 -20
- package/dist/types/index.js +50 -51
- package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
- package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
- package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
- package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
- package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
- package/dist/types/lib/stores/editor-store.d.ts +48 -10
- package/dist/types/lib/stores/table-actions.d.ts +9 -5
- package/dist/types/lib/table-formatting/index.d.ts +0 -2
- package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
- package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
- package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
- package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
- package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
- package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
- package/dist/types/lib/types/common-types.d.ts +40 -47
- package/dist/types/lib/types/explorer-types.d.ts +11 -43
- package/dist/types/lib/utils/card-config-utils.d.ts +8 -0
- package/dist/types/lib/utils/card-definition.d.ts +9 -187
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +169 -513
- package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
- package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
- package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
- package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
- package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
- package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
- package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
- package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
- package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
- package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
- package/dist/types/shared/dashboard-authoring/card-settings/apply-card-settings.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +52 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/carry-column-settings.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-format-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +51 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-sources.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/confirm-class.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/card-settings/highlight-inputs.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +102 -0
- package/dist/types/shared/dashboard-authoring/card-settings/read-card-settings.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-settings.d.ts +59 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +32 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +555 -38
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +27 -8
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +25 -1
- package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
- package/dist/types/shared/dashboard-authoring/index.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
- package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +21 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +10 -4
- package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
- package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
- package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +13 -2
- package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
- package/dist/types/shared/format-utils/index.d.ts +2 -0
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
- package/dist/types/shared/format-utils/raw-temporal.d.ts +31 -1
- package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
- package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
- package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
- package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
- package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
- package/package.json +2 -2
- package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
- package/dist/chunks/bookmark-state-ssqrs5oP.js +0 -111
- package/dist/chunks/document-dashboard-inputs-ChVkcBuu.js +0 -3010
- package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
- package/dist/chunks/filter-reach-copy-B5Y7FHzg.js +0 -3411
- package/dist/chunks/global-date-filter-utils-DBzEOX9M.js +0 -12222
- package/dist/chunks/pivot-result-contract-expectations-DOYhqeZb.js +0 -1926
- package/dist/chunks/raw-temporal-presentation-BmT7z6NH.js +0 -584
- package/dist/chunks/resolve-dashboard-input-context-B_C_VAJH.js +0 -5520
- package/dist/chunks/table-settings-DXj_zXwS.js +0 -637
- package/dist/chunks/temporal-input-presentation-AhLSkGPf.js +0 -2939
- package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
- package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { c as fe, B as
|
|
5
|
-
import { L as Ee } from "./layout-grid-
|
|
1
|
+
import { jsx as e, jsxs as s, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import Mt, { useState as D, useEffect as ve, useCallback as Y, useMemo as ee, useLayoutEffect as Dt, useRef as nt, useContext as Ut } from "react";
|
|
3
|
+
import { cF as ot, bK as Ie, bL as Te, bN as Le, cG as na, b8 as it, b5 as Qe, cH as sa, cI as Ke, cJ as lt, a7 as Ge, a4 as de, u as w, cK as oa, cL as ia, bJ as E, cM as la, a6 as Z, b3 as da, ca, cN as ua, cO as ha, bD as ma, a$ as xe, cu as Ot, aS as $e, o as pa, k as fa, cP as ga, cx as dt, cy as ct, cz as ut, cA as ht, cB as mt, cC as pt, cD as ft, cE as Rt, aP as gt, cQ as ba, cR as va, cm as et, cj as Ve, ck as Be, cS as zt, cl as Pe, c6 as K, cv as xa, cq as We, cT as ya, c4 as Ca, bM as bt, bO as vt, cU as wa, bI as Na, cV as _t, bu as xt, cW as Sa, bv as ka, i as Da, cX as Aa, bp as Fa, w as Ea, t as Ia, cY as Ta, cZ as La, c_ as Va, c$ as ue, d0 as Ba, R as jt, d1 as Pa, d2 as Ma, d3 as Ua, aM as Oa, d4 as Ra, d5 as le, d6 as za, W as yt, d7 as _a, d8 as ja, d9 as $a, da as Wa, db as qa, dc as Ha, dd as Qa, de as $t, df as Ka, dg as Ga, dh as Xa, di as Wt, dj as Ya, dk as ze, dl as Ja, dm as Za, dn as er, A as tr, aB as ar, aC as rr, ah as nr, ag as sr, af as or, ae as ir, ab as lr, a9 as dr, dp as cr, dq as ur, dr as hr, ds as mr, dt as pr, az as fr } from "./semaphor-ready-indicator-E2XWyibu.js";
|
|
4
|
+
import { c as fe, B as T, X as Xe, m as De, r as st, L as ae, k as qt, d as Ct, j as gr, y as wt, P as Ae, a3 as br, b as Fe, a as qe, S as Ht } from "./switch-balDSHc7.js";
|
|
5
|
+
import { L as Ee } from "./layout-grid-CtvCBfOm.js";
|
|
6
6
|
import "./index-CuHybtft.js";
|
|
7
|
-
import { o as
|
|
8
|
-
import "./matrix-operation-contract-
|
|
9
|
-
import "./analytics-base-schemas-
|
|
7
|
+
import { o as vr } from "./validators-BtaCFIEB.js";
|
|
8
|
+
import "./matrix-operation-contract-BSiGEXVC.js";
|
|
9
|
+
import "./analytics-base-schemas-CB3oFAXk.js";
|
|
10
10
|
import "zod";
|
|
11
11
|
import "../value-format-preferences/index.js";
|
|
12
|
-
import { c as
|
|
12
|
+
import { c as J } from "./_commonjsHelpers-DimLPMtv.js";
|
|
13
13
|
import { s as _e } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import "./temporal-input-presentation-AhLSkGPf.js";
|
|
14
|
+
import { bp as At, b1 as Ft, dJ as Et, f4 as xr, f5 as He, v as It, f6 as yr, aX as Nt, f7 as Cr, ee as wr, e0 as Nr, c9 as Sr, f8 as kr } from "./global-date-filter-utils-BXgCpvQM.js";
|
|
15
|
+
import { createPortal as Dr } from "react-dom";
|
|
16
|
+
import { aK as Tt } from "./temporal-input-presentation-B77JsAzU.js";
|
|
18
17
|
import "./index-CJW5BdWT.js";
|
|
19
|
-
import {
|
|
20
|
-
import { S as
|
|
21
|
-
import { V as
|
|
22
|
-
import { m as
|
|
23
|
-
import {
|
|
24
|
-
import { g as
|
|
25
|
-
import { g as le, d as Br, a as Pr } from "./index-B1Xr7W24.js";
|
|
18
|
+
import { P as Ar } from "./bookmark-state-BusLpkb7.js";
|
|
19
|
+
import { S as Qt } from "./save-DH4RyrnG.js";
|
|
20
|
+
import { V as Fr, L as Er, a as Ir, u as Kt, C as Gt, F as Tr, b as Lr } from "./use-create-flow-overlay-state-9WsnzEO5.js";
|
|
21
|
+
import { m as Vr, k as Xt, n as Yt } from "./report-preferences-dialog-C2YUIwKG.js";
|
|
22
|
+
import { g as Br, d as Pr } from "./document-dashboard-inputs-CvBbFTUA.js";
|
|
23
|
+
import { g as ie, d as Mr, a as Ur } from "./index-ClwbY3BL.js";
|
|
26
24
|
/**
|
|
27
25
|
* @license lucide-react v0.453.0 - ISC
|
|
28
26
|
*
|
|
29
27
|
* This source code is licensed under the ISC license.
|
|
30
28
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
29
|
*/
|
|
32
|
-
const
|
|
30
|
+
const Or = fe("ArrowUpRight", [
|
|
33
31
|
["path", { d: "M7 7h10v10", key: "1tivn9" }],
|
|
34
32
|
["path", { d: "M7 17 17 7", key: "1vkiza" }]
|
|
35
33
|
]);
|
|
@@ -39,7 +37,7 @@ const Mr = fe("ArrowUpRight", [
|
|
|
39
37
|
* This source code is licensed under the ISC license.
|
|
40
38
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
39
|
*/
|
|
42
|
-
const
|
|
40
|
+
const Lt = fe("Bell", [
|
|
43
41
|
["path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9", key: "1qo2s2" }],
|
|
44
42
|
["path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0", key: "qgo35s" }]
|
|
45
43
|
]);
|
|
@@ -49,7 +47,7 @@ const Et = fe("Bell", [
|
|
|
49
47
|
* This source code is licensed under the ISC license.
|
|
50
48
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
49
|
*/
|
|
52
|
-
const
|
|
50
|
+
const Rr = fe("CalendarRange", [
|
|
53
51
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
54
52
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
55
53
|
["path", { d: "M3 10h18", key: "8toen8" }],
|
|
@@ -65,7 +63,7 @@ const Ur = fe("CalendarRange", [
|
|
|
65
63
|
* This source code is licensed under the ISC license.
|
|
66
64
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
65
|
*/
|
|
68
|
-
const
|
|
66
|
+
const zr = fe("CodeXml", [
|
|
69
67
|
["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
|
|
70
68
|
["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
|
|
71
69
|
["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
|
|
@@ -76,7 +74,7 @@ const Or = fe("CodeXml", [
|
|
|
76
74
|
* This source code is licensed under the ISC license.
|
|
77
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
78
76
|
*/
|
|
79
|
-
const
|
|
77
|
+
const Vt = fe("MonitorSmartphone", [
|
|
80
78
|
["path", { d: "M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8", key: "10dyio" }],
|
|
81
79
|
["path", { d: "M10 19v-3.96 3.15", key: "1irgej" }],
|
|
82
80
|
["path", { d: "M7 19h5", key: "qswx4l" }],
|
|
@@ -88,7 +86,7 @@ const It = fe("MonitorSmartphone", [
|
|
|
88
86
|
* This source code is licensed under the ISC license.
|
|
89
87
|
* See the LICENSE file in the root directory of this source tree.
|
|
90
88
|
*/
|
|
91
|
-
const
|
|
89
|
+
const _r = fe("MousePointer2", [
|
|
92
90
|
[
|
|
93
91
|
"path",
|
|
94
92
|
{
|
|
@@ -103,7 +101,7 @@ const zr = fe("MousePointer2", [
|
|
|
103
101
|
* This source code is licensed under the ISC license.
|
|
104
102
|
* See the LICENSE file in the root directory of this source tree.
|
|
105
103
|
*/
|
|
106
|
-
const
|
|
104
|
+
const jr = fe("Newspaper", [
|
|
107
105
|
[
|
|
108
106
|
"path",
|
|
109
107
|
{
|
|
@@ -115,38 +113,38 @@ const Rr = fe("Newspaper", [
|
|
|
115
113
|
["path", { d: "M15 18h-5", key: "95g1m2" }],
|
|
116
114
|
["path", { d: "M10 6h8v4h-8V6Z", key: "smlsk5" }]
|
|
117
115
|
]);
|
|
118
|
-
function
|
|
119
|
-
return /* @__PURE__ */
|
|
116
|
+
function $r() {
|
|
117
|
+
return /* @__PURE__ */ e("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((t, a) => /* @__PURE__ */ s(
|
|
120
118
|
"div",
|
|
121
119
|
{
|
|
122
120
|
className: "flex animate-pulse items-start gap-3 rounded-xl border border-transparent px-2.5 py-2.5",
|
|
123
121
|
children: [
|
|
124
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ e("div", { className: "mt-0.5 h-4 w-4 flex-shrink-0 rounded bg-muted/60" }),
|
|
125
123
|
/* @__PURE__ */ s("div", { className: "flex-1 space-y-1.5", children: [
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ e("div", { className: "h-4 w-3/5 rounded bg-muted/60" }),
|
|
125
|
+
/* @__PURE__ */ e("div", { className: "h-3 w-4/5 rounded bg-muted/40" })
|
|
128
126
|
] })
|
|
129
127
|
]
|
|
130
128
|
},
|
|
131
129
|
a
|
|
132
130
|
)) });
|
|
133
131
|
}
|
|
134
|
-
function
|
|
135
|
-
open:
|
|
132
|
+
function Wr({
|
|
133
|
+
open: t,
|
|
136
134
|
onOpenChange: a,
|
|
137
135
|
onSubmit: o,
|
|
138
136
|
isCreating: n
|
|
139
137
|
}) {
|
|
140
|
-
const i = ot("interactive"), [r, d] =
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}, [
|
|
138
|
+
const i = ot("interactive"), [r, d] = D(""), [c, l] = D("");
|
|
139
|
+
ve(() => {
|
|
140
|
+
t || (d(""), l(""));
|
|
141
|
+
}, [t]);
|
|
144
142
|
const u = () => {
|
|
145
143
|
r.trim() && o({ title: r, description: c });
|
|
146
144
|
}, h = (m) => {
|
|
147
145
|
a(m);
|
|
148
146
|
};
|
|
149
|
-
return /* @__PURE__ */
|
|
147
|
+
return /* @__PURE__ */ e(Ie, { open: t, onOpenChange: h, children: /* @__PURE__ */ s(
|
|
150
148
|
Te,
|
|
151
149
|
{
|
|
152
150
|
showCloseButton: !1,
|
|
@@ -155,14 +153,14 @@ function jr({
|
|
|
155
153
|
children: [
|
|
156
154
|
/* @__PURE__ */ s("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
157
155
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
158
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ e(Ee, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
159
157
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ e(Le, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
|
|
159
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
|
|
162
160
|
] })
|
|
163
161
|
] }),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
|
|
162
|
+
/* @__PURE__ */ e(
|
|
163
|
+
T,
|
|
166
164
|
{
|
|
167
165
|
size: "xs",
|
|
168
166
|
variant: "ghost",
|
|
@@ -170,15 +168,15 @@ function jr({
|
|
|
170
168
|
onClick: () => h(!1),
|
|
171
169
|
"aria-label": "Close",
|
|
172
170
|
disabled: n,
|
|
173
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ e(Xe, { className: "h-3.5 w-3.5" })
|
|
174
172
|
}
|
|
175
173
|
)
|
|
176
174
|
] }),
|
|
177
175
|
/* @__PURE__ */ s("div", { className: "space-y-3 px-4 py-3", children: [
|
|
178
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
|
|
179
177
|
/* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ e(De, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
|
|
179
|
+
/* @__PURE__ */ e(
|
|
182
180
|
st,
|
|
183
181
|
{
|
|
184
182
|
id: "visual-title",
|
|
@@ -194,8 +192,8 @@ function jr({
|
|
|
194
192
|
)
|
|
195
193
|
] }),
|
|
196
194
|
/* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ e(De, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
|
|
196
|
+
/* @__PURE__ */ e(
|
|
199
197
|
st,
|
|
200
198
|
{
|
|
201
199
|
id: "visual-description",
|
|
@@ -209,8 +207,8 @@ function jr({
|
|
|
209
207
|
] })
|
|
210
208
|
] }),
|
|
211
209
|
/* @__PURE__ */ s("div", { className: "flex shrink-0 justify-end gap-2 border-t border-border/60 px-4 py-2.5", children: [
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
|
|
210
|
+
/* @__PURE__ */ e(
|
|
211
|
+
T,
|
|
214
212
|
{
|
|
215
213
|
size: "xs",
|
|
216
214
|
variant: "outline",
|
|
@@ -219,14 +217,14 @@ function jr({
|
|
|
219
217
|
children: "Cancel"
|
|
220
218
|
}
|
|
221
219
|
),
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
|
|
220
|
+
/* @__PURE__ */ e(
|
|
221
|
+
T,
|
|
224
222
|
{
|
|
225
223
|
size: "xs",
|
|
226
224
|
onClick: u,
|
|
227
225
|
disabled: !r.trim() || n,
|
|
228
|
-
children: n ? /* @__PURE__ */ s(
|
|
229
|
-
/* @__PURE__ */
|
|
226
|
+
children: n ? /* @__PURE__ */ s(R, { children: [
|
|
227
|
+
/* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
230
228
|
"Creating..."
|
|
231
229
|
] }) : "Create library visual"
|
|
232
230
|
}
|
|
@@ -236,10 +234,10 @@ function jr({
|
|
|
236
234
|
}
|
|
237
235
|
) });
|
|
238
236
|
}
|
|
239
|
-
function
|
|
240
|
-
const [a, o] =
|
|
241
|
-
return
|
|
242
|
-
if (!
|
|
237
|
+
function qr(t) {
|
|
238
|
+
const [a, o] = D(null), [n, i] = D(null), r = na();
|
|
239
|
+
return ve(() => {
|
|
240
|
+
if (!t || t.trim() === "") {
|
|
243
241
|
o(null), i(null);
|
|
244
242
|
return;
|
|
245
243
|
}
|
|
@@ -247,14 +245,14 @@ function $r(e) {
|
|
|
247
245
|
return;
|
|
248
246
|
(async () => {
|
|
249
247
|
try {
|
|
250
|
-
if (!
|
|
251
|
-
throw new Error(`Invalid URL format: ${
|
|
248
|
+
if (!t.startsWith("http://") && !t.startsWith("https://"))
|
|
249
|
+
throw new Error(`Invalid URL format: ${t}`);
|
|
252
250
|
try {
|
|
253
|
-
new URL(
|
|
251
|
+
new URL(t);
|
|
254
252
|
} catch {
|
|
255
|
-
throw new Error(`Invalid URL: ${
|
|
253
|
+
throw new Error(`Invalid URL: ${t}`);
|
|
256
254
|
}
|
|
257
|
-
const l = `${
|
|
255
|
+
const l = `${t.endsWith("/") ? t : `${t}/`}index.js`;
|
|
258
256
|
try {
|
|
259
257
|
if (!(await fetch(l, { method: "HEAD" })).ok)
|
|
260
258
|
throw new Error(`Module not found at ${l}`);
|
|
@@ -273,12 +271,12 @@ function $r(e) {
|
|
|
273
271
|
console.error("Failed to load remote chart store:", l), i(l), o(null);
|
|
274
272
|
}
|
|
275
273
|
})();
|
|
276
|
-
}, [
|
|
274
|
+
}, [t, r]), a;
|
|
277
275
|
}
|
|
278
|
-
function
|
|
279
|
-
if (
|
|
276
|
+
function Hr(t, a) {
|
|
277
|
+
if (t.length === 0)
|
|
280
278
|
return "";
|
|
281
|
-
const o =
|
|
279
|
+
const o = t.find(
|
|
282
280
|
(n) => {
|
|
283
281
|
var i, r;
|
|
284
282
|
return ((i = n.customCardPreferences) == null ? void 0 : i.visualType) === "multiple" || !!((r = n.customCardPreferences) != null && r.dataInputCardIds);
|
|
@@ -287,23 +285,23 @@ function Wr(e, a) {
|
|
|
287
285
|
if (o)
|
|
288
286
|
return o.id;
|
|
289
287
|
if (a) {
|
|
290
|
-
const n =
|
|
288
|
+
const n = t.find((i) => i.id === a);
|
|
291
289
|
if (n) {
|
|
292
290
|
const i = n.tabTitle;
|
|
293
291
|
if (i == "All__Header")
|
|
294
|
-
return
|
|
292
|
+
return t[0].id;
|
|
295
293
|
if (i && i.endsWith("__Header")) {
|
|
296
|
-
const d = i.split("__")[0], c =
|
|
294
|
+
const d = i.split("__")[0], c = t.find(
|
|
297
295
|
(l) => l.tabTitle === d
|
|
298
296
|
);
|
|
299
|
-
return c ? c.id :
|
|
297
|
+
return c ? c.id : t[0].id;
|
|
300
298
|
}
|
|
301
299
|
return a;
|
|
302
300
|
}
|
|
303
301
|
}
|
|
304
|
-
return
|
|
302
|
+
return t[0].id;
|
|
305
303
|
}
|
|
306
|
-
async function
|
|
304
|
+
async function Bt(t, a, o, n, i = "Opening library visual...") {
|
|
307
305
|
if (!a || !o)
|
|
308
306
|
throw new Error("Missing auth token or visual ID");
|
|
309
307
|
const r = ["resource-by-id", "visual", o], d = n.getQueryData(r);
|
|
@@ -315,7 +313,7 @@ async function Tt(e, a, o, n, i = "Opening library visual...") {
|
|
|
315
313
|
});
|
|
316
314
|
try {
|
|
317
315
|
const l = await fetch(
|
|
318
|
-
`${
|
|
316
|
+
`${t}/management/v1/visuals/${o}`,
|
|
319
317
|
{
|
|
320
318
|
headers: {
|
|
321
319
|
Authorization: `Bearer ${a}`
|
|
@@ -330,41 +328,41 @@ async function Tt(e, a, o, n, i = "Opening library visual...") {
|
|
|
330
328
|
throw E.dismiss(c), l;
|
|
331
329
|
}
|
|
332
330
|
}
|
|
333
|
-
function
|
|
334
|
-
if (typeof
|
|
335
|
-
return JSON.parse(
|
|
336
|
-
if (typeof
|
|
337
|
-
return
|
|
331
|
+
function Jt(t) {
|
|
332
|
+
if (typeof t == "string")
|
|
333
|
+
return JSON.parse(t);
|
|
334
|
+
if (typeof t == "object")
|
|
335
|
+
return t;
|
|
338
336
|
throw new Error("Invalid frame object format");
|
|
339
337
|
}
|
|
340
|
-
function
|
|
338
|
+
function Qr(t, a) {
|
|
341
339
|
var r, d;
|
|
342
|
-
const o = (
|
|
340
|
+
const o = (t == null ? void 0 : t.frameObject) ?? ((r = t == null ? void 0 : t.visual) == null ? void 0 : r.frameObject);
|
|
343
341
|
if (!o)
|
|
344
342
|
return !1;
|
|
345
|
-
const n =
|
|
343
|
+
const n = Jt(o);
|
|
346
344
|
if (!(n != null && n.cards) || n.cards.length === 0)
|
|
347
345
|
return !1;
|
|
348
346
|
const i = (d = n.cards) == null ? void 0 : d.find(
|
|
349
347
|
(c) => c.id === n.activeCardId
|
|
350
348
|
);
|
|
351
|
-
return i ? (
|
|
349
|
+
return i ? (la({
|
|
352
350
|
...a,
|
|
353
351
|
frame: n,
|
|
354
352
|
card: i,
|
|
355
|
-
visualId: (
|
|
353
|
+
visualId: (t == null ? void 0 : t.id) || n.visualId
|
|
356
354
|
}), !0) : !1;
|
|
357
355
|
}
|
|
358
|
-
function
|
|
359
|
-
const
|
|
356
|
+
function Kr() {
|
|
357
|
+
const t = Z(
|
|
360
358
|
(n) => {
|
|
361
359
|
var i;
|
|
362
360
|
return ((i = n.card.customCardPreferences) == null ? void 0 : i.url) || "";
|
|
363
361
|
}
|
|
364
|
-
), a =
|
|
365
|
-
return { getUpdatedFrame:
|
|
366
|
-
var
|
|
367
|
-
|
|
362
|
+
), a = qr(t);
|
|
363
|
+
return { getUpdatedFrame: Y(() => {
|
|
364
|
+
var N;
|
|
365
|
+
da();
|
|
368
366
|
const {
|
|
369
367
|
frame: n,
|
|
370
368
|
card: i,
|
|
@@ -373,7 +371,7 @@ function Hr() {
|
|
|
373
371
|
selectedDatabaseName: c,
|
|
374
372
|
selectedTableName: l,
|
|
375
373
|
selectedConnectionId: u
|
|
376
|
-
} =
|
|
374
|
+
} = Z.getState(), h = i.sql, m = (N = a == null ? void 0 : a.getState()) == null ? void 0 : N.settings, p = At(i, {
|
|
377
375
|
isDevMode: r,
|
|
378
376
|
cardSql: h,
|
|
379
377
|
selectedSchemaName: d,
|
|
@@ -381,21 +379,27 @@ function Hr() {
|
|
|
381
379
|
selectedTableName: l,
|
|
382
380
|
selectedConnectionId: u,
|
|
383
381
|
remoteChartSettings: m,
|
|
384
|
-
stripConfig:
|
|
385
|
-
}), f = n.cards.map(
|
|
386
|
-
(
|
|
387
|
-
|
|
382
|
+
stripConfig: Ft
|
|
383
|
+
}), f = n.cards.map((S) => {
|
|
384
|
+
if (S.id === i.id) return Et({ before: i, after: p });
|
|
385
|
+
const M = xr(S) ? At(S, { isDevMode: !0, cardSql: S.sql, stripConfig: Ft }) : S;
|
|
386
|
+
return Et({ before: S, after: M });
|
|
387
|
+
}), g = f.flatMap((S) => S.dropped);
|
|
388
|
+
g.length && E.info("Some conditional formatting rules were removed", {
|
|
389
|
+
description: `Their column isn't in the saved visual: ${g.map((S) => S.name || "an unnamed rule").join(", ")}.`
|
|
390
|
+
});
|
|
391
|
+
const x = f.map((S) => S.card);
|
|
388
392
|
return {
|
|
389
393
|
...n,
|
|
390
|
-
cards:
|
|
391
|
-
activeCardId:
|
|
394
|
+
cards: x,
|
|
395
|
+
activeCardId: Hr(x, n.activeCardId)
|
|
392
396
|
};
|
|
393
397
|
}, [a]) };
|
|
394
398
|
}
|
|
395
399
|
function ye() {
|
|
396
|
-
const { authToken:
|
|
400
|
+
const { authToken: t, tokenProps: a } = it(), o = Qe(), n = sa(), i = Ke(), { selectVisual: r } = lt(), {
|
|
397
401
|
setFrame: d,
|
|
398
|
-
|
|
402
|
+
loadCard: c,
|
|
399
403
|
setIsDevMode: l,
|
|
400
404
|
initializeModeDrafts: u,
|
|
401
405
|
setActiveTabCardId: h,
|
|
@@ -403,34 +407,34 @@ function ye() {
|
|
|
403
407
|
setQueryResultColumns: p,
|
|
404
408
|
setSelectedConnectionId: f,
|
|
405
409
|
setSelectedDatabaseName: g,
|
|
406
|
-
setSelectedSchemaName:
|
|
407
|
-
setSelectedTableName:
|
|
408
|
-
setSelectedDatamodelId:
|
|
409
|
-
setInlineFilterValuesMap:
|
|
410
|
-
setApplyFilters:
|
|
411
|
-
clearEditorContext:
|
|
410
|
+
setSelectedSchemaName: x,
|
|
411
|
+
setSelectedTableName: N,
|
|
412
|
+
setSelectedDatamodelId: S,
|
|
413
|
+
setInlineFilterValuesMap: M,
|
|
414
|
+
setApplyFilters: U,
|
|
415
|
+
clearEditorContext: F
|
|
412
416
|
} = Ge(), {
|
|
413
417
|
setIsDashboardEditing: O,
|
|
414
418
|
setIsVisualEditing: b,
|
|
415
|
-
clearSelectedFrameId:
|
|
416
|
-
} =
|
|
417
|
-
(
|
|
418
|
-
),
|
|
419
|
-
enabled: !!(i != null && i.id) && !!(
|
|
420
|
-
}),
|
|
421
|
-
async (
|
|
419
|
+
clearSelectedFrameId: I
|
|
420
|
+
} = de(), C = w((V) => V.selectedSheetId), A = w((V) => V.selectedFrameId), k = w((V) => V.dashboard), j = w(
|
|
421
|
+
(V) => V.inlineFilterValuesMap
|
|
422
|
+
), L = oa((i == null ? void 0 : i.id) || "", {
|
|
423
|
+
enabled: !!(i != null && i.id) && !!(t != null && t.accessToken)
|
|
424
|
+
}), z = Y(
|
|
425
|
+
async (V) => {
|
|
422
426
|
try {
|
|
423
|
-
r(
|
|
424
|
-
const { data:
|
|
427
|
+
r(V), I(), F();
|
|
428
|
+
const { data: te, fromCache: X } = await Bt(
|
|
425
429
|
a.apiServiceUrl,
|
|
426
|
-
(
|
|
427
|
-
|
|
430
|
+
(t == null ? void 0 : t.accessToken) || "",
|
|
431
|
+
V.id,
|
|
428
432
|
o,
|
|
429
433
|
"Opening library visual..."
|
|
430
434
|
);
|
|
431
|
-
if (!
|
|
435
|
+
if (!Qr(te, {
|
|
432
436
|
setFrame: d,
|
|
433
|
-
|
|
437
|
+
loadCard: c,
|
|
434
438
|
setIsDevMode: l,
|
|
435
439
|
initializeModeDrafts: u,
|
|
436
440
|
setActiveTabCardId: h,
|
|
@@ -438,26 +442,26 @@ function ye() {
|
|
|
438
442
|
setQueryResultColumns: p,
|
|
439
443
|
setSelectedConnectionId: f,
|
|
440
444
|
setSelectedDatabaseName: g,
|
|
441
|
-
setSelectedSchemaName:
|
|
442
|
-
setSelectedTableName:
|
|
443
|
-
setSelectedDatamodelId:
|
|
444
|
-
setInlineFilterValuesMap:
|
|
445
|
-
setApplyFilters:
|
|
445
|
+
setSelectedSchemaName: x,
|
|
446
|
+
setSelectedTableName: N,
|
|
447
|
+
setSelectedDatamodelId: S,
|
|
448
|
+
setInlineFilterValuesMap: M,
|
|
449
|
+
setApplyFilters: U,
|
|
446
450
|
setIsDashboardEditing: O,
|
|
447
451
|
setIsVisualEditing: b,
|
|
448
|
-
dashboard:
|
|
452
|
+
dashboard: k,
|
|
449
453
|
selectedSheetId: C,
|
|
450
|
-
selectedFrameId:
|
|
454
|
+
selectedFrameId: A,
|
|
451
455
|
inlineFilterValuesMap: j
|
|
452
456
|
}))
|
|
453
457
|
throw new Error("Failed to setup editor with visual data");
|
|
454
|
-
return { success: !0, fromCache:
|
|
455
|
-
} catch (
|
|
456
|
-
return console.error("Error editing visual:",
|
|
458
|
+
return { success: !0, fromCache: X };
|
|
459
|
+
} catch (te) {
|
|
460
|
+
return console.error("Error editing visual:", te), { success: !1, error: "Failed to load visual for editing" };
|
|
457
461
|
}
|
|
458
462
|
},
|
|
459
463
|
[
|
|
460
|
-
|
|
464
|
+
t == null ? void 0 : t.accessToken,
|
|
461
465
|
a.apiServiceUrl,
|
|
462
466
|
o,
|
|
463
467
|
r,
|
|
@@ -472,51 +476,51 @@ function ye() {
|
|
|
472
476
|
p,
|
|
473
477
|
f,
|
|
474
478
|
g,
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
U,
|
|
479
|
+
x,
|
|
480
|
+
N,
|
|
481
|
+
S,
|
|
479
482
|
M,
|
|
480
|
-
|
|
483
|
+
U,
|
|
481
484
|
F,
|
|
482
|
-
|
|
485
|
+
I,
|
|
486
|
+
k,
|
|
483
487
|
C,
|
|
484
|
-
|
|
488
|
+
A,
|
|
485
489
|
j
|
|
486
490
|
]
|
|
487
|
-
),
|
|
488
|
-
async (
|
|
489
|
-
var
|
|
490
|
-
const
|
|
491
|
+
), G = Y(
|
|
492
|
+
async (V) => {
|
|
493
|
+
var X;
|
|
494
|
+
const te = (H) => (E.error(H), { success: !1, error: H });
|
|
491
495
|
try {
|
|
492
|
-
if (r(
|
|
493
|
-
return
|
|
494
|
-
const { data: H, fromCache: he } = await
|
|
496
|
+
if (r(V), !C)
|
|
497
|
+
return te("No sheet selected. Please select a sheet first.");
|
|
498
|
+
const { data: H, fromCache: he } = await Bt(
|
|
495
499
|
a.apiServiceUrl,
|
|
496
|
-
(
|
|
497
|
-
|
|
500
|
+
(t == null ? void 0 : t.accessToken) || "",
|
|
501
|
+
V.id,
|
|
498
502
|
o,
|
|
499
503
|
"Adding visual to dashboard..."
|
|
500
|
-
), ge = (H == null ? void 0 : H.frameObject) ?? ((
|
|
504
|
+
), ge = (H == null ? void 0 : H.frameObject) ?? ((X = H == null ? void 0 : H.visual) == null ? void 0 : X.frameObject);
|
|
501
505
|
if (!ge)
|
|
502
|
-
return
|
|
503
|
-
const Q =
|
|
506
|
+
return te("Visual has no frame data");
|
|
507
|
+
const Q = Jt(ge);
|
|
504
508
|
if (!(Q != null && Q.cards) || Q.cards.length === 0)
|
|
505
|
-
return
|
|
509
|
+
return te("Visual frame is malformed");
|
|
506
510
|
const _ = {
|
|
507
|
-
...
|
|
508
|
-
visualId:
|
|
511
|
+
...ia(Q),
|
|
512
|
+
visualId: V.id
|
|
509
513
|
// Link this frame to the library visual
|
|
510
514
|
};
|
|
511
515
|
return await n(C, _), O(!0), { success: !0, fromCache: he };
|
|
512
516
|
} catch (H) {
|
|
513
|
-
return console.error("Error adding visual:", H),
|
|
517
|
+
return console.error("Error adding visual:", H), te(
|
|
514
518
|
H instanceof Error ? H.message : "Failed to add visual to dashboard"
|
|
515
519
|
);
|
|
516
520
|
}
|
|
517
521
|
},
|
|
518
522
|
[
|
|
519
|
-
|
|
523
|
+
t == null ? void 0 : t.accessToken,
|
|
520
524
|
a.apiServiceUrl,
|
|
521
525
|
o,
|
|
522
526
|
r,
|
|
@@ -526,189 +530,189 @@ function ye() {
|
|
|
526
530
|
]
|
|
527
531
|
);
|
|
528
532
|
return {
|
|
529
|
-
visual:
|
|
530
|
-
isLoading:
|
|
531
|
-
isError:
|
|
532
|
-
error:
|
|
533
|
-
handleEditLibraryVisual:
|
|
534
|
-
handleAddLibraryVisual:
|
|
535
|
-
getUpdatedFrame:
|
|
536
|
-
refetch:
|
|
533
|
+
visual: L.data,
|
|
534
|
+
isLoading: L.isLoading,
|
|
535
|
+
isError: L.isError,
|
|
536
|
+
error: L.error,
|
|
537
|
+
handleEditLibraryVisual: z,
|
|
538
|
+
handleAddLibraryVisual: G,
|
|
539
|
+
getUpdatedFrame: Kr().getUpdatedFrame,
|
|
540
|
+
refetch: L.refetch
|
|
537
541
|
};
|
|
538
542
|
}
|
|
539
|
-
function
|
|
540
|
-
return
|
|
543
|
+
function Zt(t) {
|
|
544
|
+
return t ? new Date(t).toLocaleDateString("en-US", {
|
|
541
545
|
month: "short",
|
|
542
546
|
day: "numeric",
|
|
543
547
|
year: "numeric"
|
|
544
548
|
}) : "Unknown";
|
|
545
549
|
}
|
|
546
|
-
function
|
|
550
|
+
function ea(t, a) {
|
|
547
551
|
var n;
|
|
548
|
-
const o = (n =
|
|
552
|
+
const o = (n = t.ownership.createdBy) == null ? void 0 : n.type;
|
|
549
553
|
return o === "tenant" || o === "organization" && a;
|
|
550
554
|
}
|
|
551
|
-
function St(
|
|
555
|
+
function St(t, a) {
|
|
552
556
|
var o, n;
|
|
553
|
-
return
|
|
557
|
+
return ea(t, a) ? ((o = t.ownership.createdBy) == null ? void 0 : o.name) || ((n = t.createdByTenantUserRel) == null ? void 0 : n.name) || t.lastModifiedBy || "Unknown" : "Organization";
|
|
554
558
|
}
|
|
555
|
-
function
|
|
556
|
-
return St(
|
|
559
|
+
function Gr(t, a) {
|
|
560
|
+
return St(t, a).split(/\s+/).filter(Boolean).slice(0, 2).map((n) => n.charAt(0).toUpperCase()).join("") || "?";
|
|
557
561
|
}
|
|
558
|
-
function
|
|
559
|
-
const a = (
|
|
560
|
-
return a.includes("table") ?
|
|
562
|
+
function Xr(t) {
|
|
563
|
+
const a = (t || "").toLowerCase();
|
|
564
|
+
return a.includes("table") ? qt : a.includes("pie") || a.includes("donut") ? ba : a.includes("line") ? va : a.includes("bar") ? gr : Ee;
|
|
561
565
|
}
|
|
562
|
-
function
|
|
563
|
-
const a =
|
|
564
|
-
return /* @__PURE__ */
|
|
566
|
+
function Yr({ visual: t }) {
|
|
567
|
+
const a = t.ownership.status === "public" ? "Public" : t.ownership.status === "shared" || t.ownership.sharedCount > 0 ? "Shared" : "Private";
|
|
568
|
+
return /* @__PURE__ */ e("span", { className: "inline-flex items-center rounded-[4px] border border-border/60 px-1.5 py-px text-[11px] text-muted-foreground", children: a });
|
|
565
569
|
}
|
|
566
|
-
function
|
|
567
|
-
open:
|
|
570
|
+
function ds({
|
|
571
|
+
open: t,
|
|
568
572
|
onOpenChange: a
|
|
569
573
|
}) {
|
|
570
|
-
const o = ot("interactive"), [n, i] =
|
|
574
|
+
const o = ot("interactive"), [n, i] = D(""), [r, d] = D(/* @__PURE__ */ new Set()), [c, l] = D(!1), [u, h] = D(
|
|
571
575
|
null
|
|
572
|
-
), [m, p] =
|
|
576
|
+
), [m, p] = D(
|
|
573
577
|
null
|
|
574
|
-
), [f, g] =
|
|
575
|
-
d(/* @__PURE__ */ new Set()), h(null), p(null), g(!1),
|
|
576
|
-
},
|
|
577
|
-
a(!1),
|
|
578
|
-
}, { selectVisual: O } = lt(), { handleAddLibraryVisual: b, handleEditLibraryVisual:
|
|
579
|
-
resources:
|
|
580
|
-
isLoading:
|
|
578
|
+
), [f, g] = D(!1), [x, N] = D(null), [S, M] = D(null), U = () => {
|
|
579
|
+
d(/* @__PURE__ */ new Set()), h(null), p(null), g(!1), N(null);
|
|
580
|
+
}, F = () => {
|
|
581
|
+
a(!1), U();
|
|
582
|
+
}, { selectVisual: O } = lt(), { handleAddLibraryVisual: b, handleEditLibraryVisual: I } = ye(), { isConsoleMode: C } = ca(), {
|
|
583
|
+
resources: A,
|
|
584
|
+
isLoading: k,
|
|
581
585
|
isError: j,
|
|
582
|
-
createResource:
|
|
583
|
-
updateResource:
|
|
584
|
-
deleteResourceAsync:
|
|
585
|
-
duplicateResource:
|
|
586
|
-
isCreating:
|
|
587
|
-
isDeleting:
|
|
588
|
-
} =
|
|
586
|
+
createResource: L,
|
|
587
|
+
updateResource: z,
|
|
588
|
+
deleteResourceAsync: G,
|
|
589
|
+
duplicateResource: V,
|
|
590
|
+
isCreating: te,
|
|
591
|
+
isDeleting: X
|
|
592
|
+
} = ua(
|
|
589
593
|
void 0,
|
|
590
|
-
(
|
|
591
|
-
l(!1),
|
|
594
|
+
(v) => {
|
|
595
|
+
l(!1), v && (O(v), I(v), F());
|
|
592
596
|
}
|
|
593
597
|
), {
|
|
594
598
|
startUpdating: H,
|
|
595
599
|
stopUpdating: he,
|
|
596
600
|
isUpdating: ge
|
|
597
|
-
} =
|
|
598
|
-
const
|
|
599
|
-
return
|
|
601
|
+
} = ha(), Q = A, _ = ee(() => {
|
|
602
|
+
const v = n.trim().toLowerCase();
|
|
603
|
+
return v ? Q.filter(
|
|
600
604
|
(B) => {
|
|
601
|
-
var q,
|
|
602
|
-
return ((q = B.title) == null ? void 0 : q.toLowerCase().includes(
|
|
605
|
+
var q, oe, ce;
|
|
606
|
+
return ((q = B.title) == null ? void 0 : q.toLowerCase().includes(v)) || ((oe = B.description) == null ? void 0 : oe.toLowerCase().includes(v)) || ((ce = B.kind) == null ? void 0 : ce.toLowerCase().includes(v));
|
|
603
607
|
}
|
|
604
608
|
) : Q;
|
|
605
|
-
}, [n, Q]),
|
|
609
|
+
}, [n, Q]), se = ee(
|
|
606
610
|
() => Q.filter(
|
|
607
|
-
(
|
|
611
|
+
(v) => r.has(v.id)
|
|
608
612
|
),
|
|
609
613
|
[r, Q]
|
|
610
|
-
), me =
|
|
611
|
-
(
|
|
612
|
-
), pe =
|
|
613
|
-
(
|
|
614
|
+
), me = se.filter(
|
|
615
|
+
(v) => v.permissions.canDelete
|
|
616
|
+
), pe = se.filter(
|
|
617
|
+
(v) => v.permissions.canShare
|
|
614
618
|
), Ce = _.length > 0 && _.every(
|
|
615
|
-
(
|
|
619
|
+
(v) => r.has(v.id)
|
|
616
620
|
), Me = _.some(
|
|
617
|
-
(
|
|
618
|
-
), Ye = (
|
|
621
|
+
(v) => r.has(v.id)
|
|
622
|
+
), Ye = (v) => {
|
|
619
623
|
const B = new Set(r);
|
|
620
|
-
|
|
621
|
-
}, $ = (
|
|
624
|
+
v(B), d(B);
|
|
625
|
+
}, $ = (v) => {
|
|
622
626
|
Ye((B) => {
|
|
623
|
-
B.has(
|
|
627
|
+
B.has(v) ? B.delete(v) : B.add(v);
|
|
624
628
|
});
|
|
625
629
|
}, W = () => {
|
|
626
|
-
d((
|
|
627
|
-
const B = new Set(
|
|
630
|
+
d((v) => {
|
|
631
|
+
const B = new Set(v);
|
|
628
632
|
return Ce ? _.forEach(
|
|
629
633
|
(q) => B.delete(q.id)
|
|
630
634
|
) : _.forEach(
|
|
631
635
|
(q) => B.add(q.id)
|
|
632
636
|
), B;
|
|
633
637
|
});
|
|
634
|
-
},
|
|
635
|
-
(await b(
|
|
638
|
+
}, re = async (v) => {
|
|
639
|
+
(await b(v)).success && F();
|
|
636
640
|
}, we = async () => {
|
|
637
|
-
const
|
|
638
|
-
if (
|
|
641
|
+
const v = se;
|
|
642
|
+
if (v.length === 0) return;
|
|
639
643
|
let B = !1;
|
|
640
|
-
for (const q of
|
|
644
|
+
for (const q of v)
|
|
641
645
|
if (!(await b(q)).success) {
|
|
642
646
|
B = !0;
|
|
643
647
|
break;
|
|
644
648
|
}
|
|
645
|
-
B ||
|
|
646
|
-
}, Je = (
|
|
647
|
-
|
|
648
|
-
}, be = (
|
|
649
|
-
|
|
650
|
-
onSettled: () =>
|
|
649
|
+
B || F();
|
|
650
|
+
}, Je = (v) => {
|
|
651
|
+
I(v), F();
|
|
652
|
+
}, be = (v) => {
|
|
653
|
+
M(v), V(v, {
|
|
654
|
+
onSettled: () => M(null)
|
|
651
655
|
});
|
|
652
656
|
}, Ue = () => {
|
|
653
657
|
if (me.length === 0) {
|
|
654
658
|
E.error("Select a visual you can delete");
|
|
655
659
|
return;
|
|
656
660
|
}
|
|
657
|
-
|
|
661
|
+
N(null), g(!0);
|
|
658
662
|
}, Ze = async () => {
|
|
659
|
-
const
|
|
663
|
+
const v = x ? [x] : me;
|
|
660
664
|
try {
|
|
661
|
-
for (const B of
|
|
662
|
-
await
|
|
665
|
+
for (const B of v)
|
|
666
|
+
await G(B.id);
|
|
663
667
|
d((B) => {
|
|
664
668
|
const q = new Set(B);
|
|
665
|
-
return
|
|
666
|
-
(
|
|
669
|
+
return v.forEach(
|
|
670
|
+
(oe) => q.delete(oe.id)
|
|
667
671
|
), q;
|
|
668
|
-
}), g(!1),
|
|
672
|
+
}), g(!1), N(null);
|
|
669
673
|
} catch {
|
|
670
674
|
}
|
|
671
675
|
}, Ne = () => {
|
|
672
|
-
if (
|
|
676
|
+
if (se.length !== 1) {
|
|
673
677
|
E.error("Select one visual to share");
|
|
674
678
|
return;
|
|
675
679
|
}
|
|
676
|
-
const [
|
|
677
|
-
if (!
|
|
680
|
+
const [v] = se;
|
|
681
|
+
if (!v.permissions.canShare) {
|
|
678
682
|
E.error("You do not have permission to share this visual");
|
|
679
683
|
return;
|
|
680
684
|
}
|
|
681
|
-
h(
|
|
685
|
+
h(v);
|
|
682
686
|
}, Se = ({
|
|
683
|
-
title:
|
|
687
|
+
title: v,
|
|
684
688
|
description: B
|
|
685
689
|
}) => {
|
|
686
690
|
if (!m) return;
|
|
687
691
|
const q = {};
|
|
688
|
-
if (
|
|
692
|
+
if (v !== m.title && (q.title = v), (m.description || "") !== B && (q.description = B), Object.keys(q).length === 0) {
|
|
689
693
|
p(null);
|
|
690
694
|
return;
|
|
691
695
|
}
|
|
692
|
-
const
|
|
693
|
-
H(m.id,
|
|
696
|
+
const oe = Object.keys(q), ce = oe.length === 1 ? oe[0] : void 0;
|
|
697
|
+
H(m.id, ce), z(
|
|
694
698
|
{
|
|
695
699
|
resourceId: m.id,
|
|
696
700
|
data: q
|
|
697
701
|
},
|
|
698
702
|
{
|
|
699
703
|
onSuccess: () => {
|
|
700
|
-
he(m.id,
|
|
704
|
+
he(m.id, ce), p(null);
|
|
701
705
|
},
|
|
702
706
|
onError: () => {
|
|
703
|
-
he(m.id,
|
|
707
|
+
he(m.id, ce);
|
|
704
708
|
}
|
|
705
709
|
}
|
|
706
710
|
);
|
|
707
|
-
},
|
|
708
|
-
a(
|
|
709
|
-
}, ke =
|
|
710
|
-
return /* @__PURE__ */ s(
|
|
711
|
-
/* @__PURE__ */
|
|
711
|
+
}, ne = (v) => {
|
|
712
|
+
a(v), v || U();
|
|
713
|
+
}, ke = x ? 1 : me.length;
|
|
714
|
+
return /* @__PURE__ */ s(R, { children: [
|
|
715
|
+
/* @__PURE__ */ e(Ie, { open: t, onOpenChange: ne, children: /* @__PURE__ */ s(
|
|
712
716
|
Te,
|
|
713
717
|
{
|
|
714
718
|
showCloseButton: !1,
|
|
@@ -717,19 +721,19 @@ function cs({
|
|
|
717
721
|
children: [
|
|
718
722
|
/* @__PURE__ */ s("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
719
723
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
720
|
-
/* @__PURE__ */
|
|
724
|
+
/* @__PURE__ */ e(qt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
721
725
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
722
|
-
/* @__PURE__ */
|
|
723
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ e(Le, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
|
|
727
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
|
|
724
728
|
] })
|
|
725
729
|
] }),
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
-
|
|
730
|
+
/* @__PURE__ */ e(
|
|
731
|
+
T,
|
|
728
732
|
{
|
|
729
733
|
size: "xs",
|
|
730
734
|
variant: "ghost",
|
|
731
735
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
732
|
-
onClick: () =>
|
|
736
|
+
onClick: () => ne(!1),
|
|
733
737
|
"aria-label": "Close visuals library",
|
|
734
738
|
children: "×"
|
|
735
739
|
}
|
|
@@ -737,13 +741,13 @@ function cs({
|
|
|
737
741
|
] }),
|
|
738
742
|
/* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-2 border-b border-border/60 px-3 py-2", children: [
|
|
739
743
|
/* @__PURE__ */ s("div", { className: "relative min-w-[12rem] flex-1 md:max-w-md", children: [
|
|
740
|
-
/* @__PURE__ */
|
|
741
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ e(ma, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
745
|
+
/* @__PURE__ */ e(
|
|
742
746
|
"input",
|
|
743
747
|
{
|
|
744
748
|
autoFocus: !0,
|
|
745
749
|
value: n,
|
|
746
|
-
onChange: (
|
|
750
|
+
onChange: (v) => i(v.target.value),
|
|
747
751
|
placeholder: "Search visuals...",
|
|
748
752
|
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",
|
|
749
753
|
"aria-label": "Search visuals"
|
|
@@ -751,25 +755,25 @@ function cs({
|
|
|
751
755
|
)
|
|
752
756
|
] }),
|
|
753
757
|
/* @__PURE__ */ s(
|
|
754
|
-
|
|
758
|
+
T,
|
|
755
759
|
{
|
|
756
760
|
size: "xs",
|
|
757
761
|
variant: "outline",
|
|
758
762
|
className: "ml-auto",
|
|
759
763
|
onClick: () => l(!0),
|
|
760
764
|
children: [
|
|
761
|
-
/* @__PURE__ */
|
|
765
|
+
/* @__PURE__ */ e(xe, { className: "h-3.5 w-3.5" }),
|
|
762
766
|
"New library visual"
|
|
763
767
|
]
|
|
764
768
|
}
|
|
765
769
|
)
|
|
766
770
|
] }),
|
|
767
|
-
/* @__PURE__ */
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
/* @__PURE__ */
|
|
770
|
-
/* @__PURE__ */
|
|
771
|
-
] }) : /* @__PURE__ */
|
|
772
|
-
|
|
771
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children: k ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e($r, {}) }) : 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__ */ s("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
|
|
772
|
+
/* @__PURE__ */ e(Ee, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
773
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: n ? "No visuals found" : "No visuals yet" }),
|
|
774
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: n ? "Try a different search." : "Create a saved visual to add it here." })
|
|
775
|
+
] }) : /* @__PURE__ */ e(
|
|
776
|
+
Jr,
|
|
773
777
|
{
|
|
774
778
|
visuals: _,
|
|
775
779
|
selectedIds: r,
|
|
@@ -777,28 +781,28 @@ function cs({
|
|
|
777
781
|
someFilteredSelected: Me,
|
|
778
782
|
onSelectAll: W,
|
|
779
783
|
onToggleSelection: $,
|
|
780
|
-
onAddVisual:
|
|
784
|
+
onAddVisual: re,
|
|
781
785
|
onOpenVisual: Je,
|
|
782
786
|
onEditDetails: p,
|
|
783
787
|
onShareVisual: h,
|
|
784
|
-
onDeleteVisual: (
|
|
785
|
-
|
|
788
|
+
onDeleteVisual: (v) => {
|
|
789
|
+
N(v), g(!0);
|
|
786
790
|
},
|
|
787
791
|
onDuplicateVisual: be,
|
|
788
|
-
duplicatingId:
|
|
789
|
-
isDeleting:
|
|
792
|
+
duplicatingId: S,
|
|
793
|
+
isDeleting: X,
|
|
790
794
|
isConsoleMode: C
|
|
791
795
|
}
|
|
792
796
|
) }),
|
|
793
797
|
/* @__PURE__ */ s("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
|
|
794
|
-
/* @__PURE__ */
|
|
798
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children: r.size > 0 && /* @__PURE__ */ s(R, { children: [
|
|
795
799
|
/* @__PURE__ */ s("span", { className: "text-[12px] text-muted-foreground", children: [
|
|
796
|
-
/* @__PURE__ */
|
|
800
|
+
/* @__PURE__ */ e("span", { className: "font-medium tabular-nums text-foreground", children: r.size }),
|
|
797
801
|
" ",
|
|
798
802
|
"selected"
|
|
799
803
|
] }),
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
-
|
|
804
|
+
/* @__PURE__ */ e(
|
|
805
|
+
T,
|
|
802
806
|
{
|
|
803
807
|
size: "xs",
|
|
804
808
|
variant: "ghost",
|
|
@@ -807,20 +811,20 @@ function cs({
|
|
|
807
811
|
}
|
|
808
812
|
),
|
|
809
813
|
/* @__PURE__ */ s(
|
|
810
|
-
|
|
814
|
+
T,
|
|
811
815
|
{
|
|
812
816
|
size: "xs",
|
|
813
817
|
variant: "outline",
|
|
814
818
|
onClick: Ne,
|
|
815
|
-
disabled:
|
|
819
|
+
disabled: se.length !== 1 || pe.length !== 1,
|
|
816
820
|
children: [
|
|
817
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ e(Ot, { className: "h-3.5 w-3.5" }),
|
|
818
822
|
"Share"
|
|
819
823
|
]
|
|
820
824
|
}
|
|
821
825
|
),
|
|
822
826
|
/* @__PURE__ */ s(
|
|
823
|
-
|
|
827
|
+
T,
|
|
824
828
|
{
|
|
825
829
|
size: "xs",
|
|
826
830
|
variant: "outline",
|
|
@@ -828,7 +832,7 @@ function cs({
|
|
|
828
832
|
onClick: Ue,
|
|
829
833
|
disabled: me.length === 0,
|
|
830
834
|
children: [
|
|
831
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ e($e, { className: "h-3.5 w-3.5" }),
|
|
832
836
|
"Delete ",
|
|
833
837
|
me.length || r.size
|
|
834
838
|
]
|
|
@@ -836,23 +840,23 @@ function cs({
|
|
|
836
840
|
)
|
|
837
841
|
] }) }),
|
|
838
842
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
|
|
843
|
+
/* @__PURE__ */ e(
|
|
844
|
+
T,
|
|
841
845
|
{
|
|
842
846
|
size: "xs",
|
|
843
847
|
variant: "outline",
|
|
844
|
-
onClick: () =>
|
|
848
|
+
onClick: () => ne(!1),
|
|
845
849
|
children: "Close"
|
|
846
850
|
}
|
|
847
851
|
),
|
|
848
852
|
/* @__PURE__ */ s(
|
|
849
|
-
|
|
853
|
+
T,
|
|
850
854
|
{
|
|
851
855
|
size: "xs",
|
|
852
856
|
onClick: we,
|
|
853
857
|
disabled: r.size === 0,
|
|
854
858
|
children: [
|
|
855
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" }),
|
|
856
860
|
r.size === 0 ? "Add to dashboard" : `Add ${r.size} visual${r.size === 1 ? "" : "s"}`
|
|
857
861
|
]
|
|
858
862
|
}
|
|
@@ -862,25 +866,25 @@ function cs({
|
|
|
862
866
|
]
|
|
863
867
|
}
|
|
864
868
|
) }),
|
|
865
|
-
/* @__PURE__ */
|
|
866
|
-
|
|
869
|
+
/* @__PURE__ */ e(
|
|
870
|
+
Wr,
|
|
867
871
|
{
|
|
868
872
|
open: c,
|
|
869
873
|
onOpenChange: l,
|
|
870
|
-
onSubmit:
|
|
871
|
-
isCreating:
|
|
874
|
+
onSubmit: L,
|
|
875
|
+
isCreating: te
|
|
872
876
|
}
|
|
873
877
|
),
|
|
874
|
-
u && /* @__PURE__ */
|
|
875
|
-
|
|
878
|
+
u && /* @__PURE__ */ e(
|
|
879
|
+
pa,
|
|
876
880
|
{
|
|
877
881
|
resource: u,
|
|
878
|
-
resourceType:
|
|
882
|
+
resourceType: fa.VISUAL,
|
|
879
883
|
onClose: () => h(null)
|
|
880
884
|
}
|
|
881
885
|
),
|
|
882
|
-
m && /* @__PURE__ */
|
|
883
|
-
|
|
886
|
+
m && /* @__PURE__ */ e(
|
|
887
|
+
ga,
|
|
884
888
|
{
|
|
885
889
|
open: !!m,
|
|
886
890
|
resourceLabel: "Visual",
|
|
@@ -891,12 +895,12 @@ function cs({
|
|
|
891
895
|
isSaving: ge(m.id)
|
|
892
896
|
}
|
|
893
897
|
),
|
|
894
|
-
/* @__PURE__ */
|
|
898
|
+
/* @__PURE__ */ e(
|
|
895
899
|
dt,
|
|
896
900
|
{
|
|
897
901
|
open: f,
|
|
898
|
-
onOpenChange: (
|
|
899
|
-
!
|
|
902
|
+
onOpenChange: (v) => {
|
|
903
|
+
!v && X || (g(v), v || N(null));
|
|
900
904
|
},
|
|
901
905
|
children: /* @__PURE__ */ s(ct, { children: [
|
|
902
906
|
/* @__PURE__ */ s(ut, { children: [
|
|
@@ -907,20 +911,20 @@ function cs({
|
|
|
907
911
|
ke === 1 ? "" : "s",
|
|
908
912
|
"?"
|
|
909
913
|
] }),
|
|
910
|
-
/* @__PURE__ */
|
|
914
|
+
/* @__PURE__ */ e(mt, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
|
|
911
915
|
] }),
|
|
912
916
|
/* @__PURE__ */ s(pt, { children: [
|
|
913
|
-
/* @__PURE__ */
|
|
917
|
+
/* @__PURE__ */ e(ft, { disabled: X, children: "Cancel" }),
|
|
914
918
|
/* @__PURE__ */ s(
|
|
915
|
-
|
|
919
|
+
Rt,
|
|
916
920
|
{
|
|
917
|
-
onClick: (
|
|
918
|
-
|
|
921
|
+
onClick: (v) => {
|
|
922
|
+
v.preventDefault(), Ze();
|
|
919
923
|
},
|
|
920
|
-
disabled:
|
|
924
|
+
disabled: X || ke === 0,
|
|
921
925
|
children: [
|
|
922
|
-
|
|
923
|
-
|
|
926
|
+
X ? /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e($e, { className: "h-3.5 w-3.5" }),
|
|
927
|
+
X ? "Deleting..." : "Delete"
|
|
924
928
|
]
|
|
925
929
|
}
|
|
926
930
|
)
|
|
@@ -930,8 +934,8 @@ function cs({
|
|
|
930
934
|
)
|
|
931
935
|
] });
|
|
932
936
|
}
|
|
933
|
-
function
|
|
934
|
-
visuals:
|
|
937
|
+
function Jr({
|
|
938
|
+
visuals: t,
|
|
935
939
|
selectedIds: a,
|
|
936
940
|
allFilteredSelected: o,
|
|
937
941
|
someFilteredSelected: n,
|
|
@@ -949,7 +953,7 @@ function Xr({
|
|
|
949
953
|
}) {
|
|
950
954
|
return /* @__PURE__ */ s("div", { className: "min-w-[48rem]", children: [
|
|
951
955
|
/* @__PURE__ */ s("div", { className: "grid h-9 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/60 px-3 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: [
|
|
952
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ e(
|
|
953
957
|
gt,
|
|
954
958
|
{
|
|
955
959
|
checked: o ? !0 : n ? "indeterminate" : !1,
|
|
@@ -957,18 +961,18 @@ function Xr({
|
|
|
957
961
|
"aria-label": "Select all visuals"
|
|
958
962
|
}
|
|
959
963
|
),
|
|
960
|
-
/* @__PURE__ */
|
|
961
|
-
/* @__PURE__ */
|
|
962
|
-
/* @__PURE__ */
|
|
963
|
-
/* @__PURE__ */
|
|
964
|
-
/* @__PURE__ */
|
|
965
|
-
/* @__PURE__ */
|
|
964
|
+
/* @__PURE__ */ e("span", { children: "Name" }),
|
|
965
|
+
/* @__PURE__ */ e("span", { children: "Created by" }),
|
|
966
|
+
/* @__PURE__ */ e("span", { children: "Updated" }),
|
|
967
|
+
/* @__PURE__ */ e("span", { children: "Visibility" }),
|
|
968
|
+
/* @__PURE__ */ e("span", { className: "text-right", children: "Shared" }),
|
|
969
|
+
/* @__PURE__ */ e("span", { className: "text-right", children: "Actions" })
|
|
966
970
|
] }),
|
|
967
|
-
|
|
968
|
-
|
|
971
|
+
t.map((x) => /* @__PURE__ */ e(
|
|
972
|
+
Zr,
|
|
969
973
|
{
|
|
970
|
-
visual:
|
|
971
|
-
selected: a.has(
|
|
974
|
+
visual: x,
|
|
975
|
+
selected: a.has(x.id),
|
|
972
976
|
onToggleSelection: r,
|
|
973
977
|
onAddVisual: d,
|
|
974
978
|
onOpenVisual: c,
|
|
@@ -980,12 +984,12 @@ function Xr({
|
|
|
980
984
|
isDeleting: f,
|
|
981
985
|
isConsoleMode: g
|
|
982
986
|
},
|
|
983
|
-
|
|
987
|
+
x.id
|
|
984
988
|
))
|
|
985
989
|
] });
|
|
986
990
|
}
|
|
987
|
-
function
|
|
988
|
-
visual:
|
|
991
|
+
function Zr({
|
|
992
|
+
visual: t,
|
|
989
993
|
selected: a,
|
|
990
994
|
onToggleSelection: o,
|
|
991
995
|
onAddVisual: n,
|
|
@@ -999,23 +1003,23 @@ function Yr({
|
|
|
999
1003
|
isConsoleMode: m
|
|
1000
1004
|
}) {
|
|
1001
1005
|
var g;
|
|
1002
|
-
const p =
|
|
1003
|
-
n(
|
|
1006
|
+
const p = Xr(t.kind), f = () => {
|
|
1007
|
+
n(t);
|
|
1004
1008
|
};
|
|
1005
1009
|
return /* @__PURE__ */ s(
|
|
1006
1010
|
"div",
|
|
1007
1011
|
{
|
|
1008
|
-
className:
|
|
1012
|
+
className: J(
|
|
1009
1013
|
"group grid min-h-12 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/50 px-3 text-[13px] hover:bg-muted/50",
|
|
1010
1014
|
a && "bg-muted/70"
|
|
1011
1015
|
),
|
|
1012
1016
|
children: [
|
|
1013
|
-
/* @__PURE__ */
|
|
1017
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
1014
1018
|
gt,
|
|
1015
1019
|
{
|
|
1016
1020
|
checked: a,
|
|
1017
|
-
onCheckedChange: () => o(
|
|
1018
|
-
"aria-label": `Select ${
|
|
1021
|
+
onCheckedChange: () => o(t.id),
|
|
1022
|
+
"aria-label": `Select ${t.title || "visual"}`
|
|
1019
1023
|
}
|
|
1020
1024
|
) }),
|
|
1021
1025
|
/* @__PURE__ */ s(
|
|
@@ -1024,24 +1028,24 @@ function Yr({
|
|
|
1024
1028
|
type: "button",
|
|
1025
1029
|
className: "flex min-w-0 items-center gap-2 rounded-[4px] text-left outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
1026
1030
|
onClick: f,
|
|
1027
|
-
"aria-label": `Add ${
|
|
1031
|
+
"aria-label": `Add ${t.title || "visual"} to dashboard`,
|
|
1028
1032
|
children: [
|
|
1029
|
-
/* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ e(p, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
1030
1034
|
/* @__PURE__ */ s("div", { className: "min-w-0", children: [
|
|
1031
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ e(
|
|
1032
1036
|
"div",
|
|
1033
1037
|
{
|
|
1034
1038
|
className: "truncate font-medium text-foreground",
|
|
1035
|
-
title:
|
|
1036
|
-
children:
|
|
1039
|
+
title: t.title || "Untitled Visual",
|
|
1040
|
+
children: t.title || "Untitled Visual"
|
|
1037
1041
|
}
|
|
1038
1042
|
),
|
|
1039
|
-
((g =
|
|
1043
|
+
((g = t.description) == null ? void 0 : g.trim()) && /* @__PURE__ */ e(
|
|
1040
1044
|
"div",
|
|
1041
1045
|
{
|
|
1042
1046
|
className: "truncate text-[11px] text-muted-foreground",
|
|
1043
|
-
title:
|
|
1044
|
-
children:
|
|
1047
|
+
title: t.description,
|
|
1048
|
+
children: t.description
|
|
1045
1049
|
}
|
|
1046
1050
|
)
|
|
1047
1051
|
] })
|
|
@@ -1049,16 +1053,16 @@ function Yr({
|
|
|
1049
1053
|
}
|
|
1050
1054
|
),
|
|
1051
1055
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
1052
|
-
/* @__PURE__ */
|
|
1053
|
-
/* @__PURE__ */
|
|
1056
|
+
/* @__PURE__ */ e("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: Gr(t, m) }),
|
|
1057
|
+
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: St(t, m) })
|
|
1054
1058
|
] }),
|
|
1055
|
-
/* @__PURE__ */
|
|
1056
|
-
/* @__PURE__ */
|
|
1057
|
-
/* @__PURE__ */
|
|
1058
|
-
/* @__PURE__ */
|
|
1059
|
-
|
|
1059
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: Zt(t.updatedAt) }),
|
|
1060
|
+
/* @__PURE__ */ e(Yr, { visual: t }),
|
|
1061
|
+
/* @__PURE__ */ e("span", { className: "text-right tabular-nums text-muted-foreground", children: t.ownership.sharedCount > 0 ? t.ownership.sharedCount : "—" }),
|
|
1062
|
+
/* @__PURE__ */ e(
|
|
1063
|
+
en,
|
|
1060
1064
|
{
|
|
1061
|
-
visual:
|
|
1065
|
+
visual: t,
|
|
1062
1066
|
onOpenVisual: i,
|
|
1063
1067
|
onEditDetails: r,
|
|
1064
1068
|
onShareVisual: d,
|
|
@@ -1073,8 +1077,8 @@ function Yr({
|
|
|
1073
1077
|
}
|
|
1074
1078
|
);
|
|
1075
1079
|
}
|
|
1076
|
-
function
|
|
1077
|
-
visual:
|
|
1080
|
+
function en({
|
|
1081
|
+
visual: t,
|
|
1078
1082
|
onOpenVisual: a,
|
|
1079
1083
|
onEditDetails: o,
|
|
1080
1084
|
onShareVisual: n,
|
|
@@ -1090,26 +1094,26 @@ function Jr({
|
|
|
1090
1094
|
className: "flex items-center justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
|
|
1091
1095
|
onClick: (u) => u.stopPropagation(),
|
|
1092
1096
|
children: [
|
|
1093
|
-
/* @__PURE__ */
|
|
1094
|
-
|
|
1097
|
+
/* @__PURE__ */ e(
|
|
1098
|
+
T,
|
|
1095
1099
|
{
|
|
1096
1100
|
size: "xs",
|
|
1097
1101
|
variant: "ghost",
|
|
1098
1102
|
className: "w-7 px-0",
|
|
1099
|
-
onClick: () => a(
|
|
1103
|
+
onClick: () => a(t),
|
|
1100
1104
|
"aria-label": "Edit visual",
|
|
1101
|
-
children: /* @__PURE__ */
|
|
1105
|
+
children: /* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" })
|
|
1102
1106
|
}
|
|
1103
1107
|
),
|
|
1104
1108
|
/* @__PURE__ */ s(Ve, { modal: !1, children: [
|
|
1105
|
-
/* @__PURE__ */
|
|
1106
|
-
|
|
1109
|
+
/* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1110
|
+
T,
|
|
1107
1111
|
{
|
|
1108
1112
|
size: "xs",
|
|
1109
1113
|
variant: "ghost",
|
|
1110
1114
|
className: "w-7 px-0",
|
|
1111
1115
|
"aria-label": "More actions",
|
|
1112
|
-
children: /* @__PURE__ */
|
|
1116
|
+
children: /* @__PURE__ */ e(zt, { className: "h-3.5 w-3.5" })
|
|
1113
1117
|
}
|
|
1114
1118
|
) }),
|
|
1115
1119
|
/* @__PURE__ */ s(
|
|
@@ -1118,53 +1122,53 @@ function Jr({
|
|
|
1118
1122
|
align: "end",
|
|
1119
1123
|
className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
1120
1124
|
children: [
|
|
1121
|
-
/* @__PURE__ */ s(
|
|
1122
|
-
/* @__PURE__ */
|
|
1125
|
+
/* @__PURE__ */ s(K, { onClick: () => a(t), children: [
|
|
1126
|
+
/* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" }),
|
|
1123
1127
|
"Edit visual"
|
|
1124
1128
|
] }),
|
|
1125
1129
|
/* @__PURE__ */ s(
|
|
1126
|
-
|
|
1130
|
+
K,
|
|
1127
1131
|
{
|
|
1128
|
-
onClick: () => r(
|
|
1129
|
-
disabled: d ===
|
|
1132
|
+
onClick: () => r(t.id),
|
|
1133
|
+
disabled: d === t.id,
|
|
1130
1134
|
children: [
|
|
1131
|
-
d ===
|
|
1132
|
-
d ===
|
|
1135
|
+
d === t.id ? /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(xa, { className: "h-3.5 w-3.5" }),
|
|
1136
|
+
d === t.id ? "Duplicating..." : "Duplicate"
|
|
1133
1137
|
]
|
|
1134
1138
|
}
|
|
1135
1139
|
),
|
|
1136
|
-
|
|
1137
|
-
/* @__PURE__ */
|
|
1140
|
+
t.permissions.canEdit && /* @__PURE__ */ s(K, { onClick: () => o(t), children: [
|
|
1141
|
+
/* @__PURE__ */ e(et, { className: "h-3.5 w-3.5" }),
|
|
1138
1142
|
"Edit details"
|
|
1139
1143
|
] }),
|
|
1140
|
-
|
|
1141
|
-
/* @__PURE__ */
|
|
1144
|
+
t.permissions.canShare && /* @__PURE__ */ s(K, { onClick: () => n(t), children: [
|
|
1145
|
+
/* @__PURE__ */ e(Ot, { className: "h-3.5 w-3.5" }),
|
|
1142
1146
|
"Share"
|
|
1143
1147
|
] }),
|
|
1144
|
-
|
|
1145
|
-
/* @__PURE__ */
|
|
1148
|
+
t.permissions.canDelete && /* @__PURE__ */ s(R, { children: [
|
|
1149
|
+
/* @__PURE__ */ e(We, {}),
|
|
1146
1150
|
/* @__PURE__ */ s(
|
|
1147
|
-
|
|
1151
|
+
K,
|
|
1148
1152
|
{
|
|
1149
1153
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
1150
|
-
onClick: () => i(
|
|
1154
|
+
onClick: () => i(t),
|
|
1151
1155
|
disabled: c,
|
|
1152
1156
|
children: [
|
|
1153
|
-
/* @__PURE__ */
|
|
1157
|
+
/* @__PURE__ */ e($e, { className: "h-3.5 w-3.5" }),
|
|
1154
1158
|
c ? "Deleting..." : "Delete"
|
|
1155
1159
|
]
|
|
1156
1160
|
}
|
|
1157
1161
|
)
|
|
1158
1162
|
] }),
|
|
1159
|
-
/* @__PURE__ */
|
|
1163
|
+
/* @__PURE__ */ e(We, {}),
|
|
1160
1164
|
/* @__PURE__ */ s("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
|
|
1161
|
-
|
|
1162
|
-
/* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */
|
|
1165
|
+
ea(t, l) && /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
|
|
1166
|
+
/* @__PURE__ */ e(ya, { className: "h-3 w-3" }),
|
|
1167
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: St(t, l) })
|
|
1164
1168
|
] }),
|
|
1165
1169
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
|
|
1166
|
-
/* @__PURE__ */
|
|
1167
|
-
/* @__PURE__ */
|
|
1170
|
+
/* @__PURE__ */ e(Ca, { className: "h-3 w-3" }),
|
|
1171
|
+
/* @__PURE__ */ e("span", { children: Zt(t.updatedAt) })
|
|
1168
1172
|
] })
|
|
1169
1173
|
] })
|
|
1170
1174
|
]
|
|
@@ -1175,26 +1179,26 @@ function Jr({
|
|
|
1175
1179
|
}
|
|
1176
1180
|
);
|
|
1177
1181
|
}
|
|
1178
|
-
function
|
|
1182
|
+
function cs(t, a, o = !1) {
|
|
1179
1183
|
const n = w((u) => u.dashboard), i = w(
|
|
1180
1184
|
(u) => u.isDashboardEditing
|
|
1181
1185
|
), r = w(
|
|
1182
1186
|
(u) => u.onDashboardLifecycleEvent
|
|
1183
|
-
), d =
|
|
1187
|
+
), d = Y(() => {
|
|
1184
1188
|
const u = w.getState().dashboard;
|
|
1185
|
-
return a || !
|
|
1186
|
-
}, [
|
|
1189
|
+
return a || !t || !u || u.id !== t.id ? !1 : _e(u) !== _e(t);
|
|
1190
|
+
}, [t, a]);
|
|
1187
1191
|
Dt(() => (w.setState({ checkUnsavedDashboardChanges: d }), () => {
|
|
1188
1192
|
w.getState().checkUnsavedDashboardChanges === d && w.setState({ checkUnsavedDashboardChanges: null });
|
|
1189
1193
|
}), [d]);
|
|
1190
|
-
const c =
|
|
1194
|
+
const c = ee(() => !o || a || !n || i && (!t || n.id !== t.id) ? null : {
|
|
1191
1195
|
dashboardId: n.id,
|
|
1192
|
-
dirty: i &&
|
|
1196
|
+
dirty: i && t ? _e(n) !== _e(t) : !1
|
|
1193
1197
|
}, [
|
|
1194
1198
|
i,
|
|
1195
1199
|
a,
|
|
1196
1200
|
o,
|
|
1197
|
-
|
|
1201
|
+
t,
|
|
1198
1202
|
n
|
|
1199
1203
|
]), l = nt(null);
|
|
1200
1204
|
return Dt(() => {
|
|
@@ -1214,8 +1218,8 @@ function us(e, a, o = !1) {
|
|
|
1214
1218
|
}));
|
|
1215
1219
|
}, [c, r]), d;
|
|
1216
1220
|
}
|
|
1217
|
-
function
|
|
1218
|
-
open:
|
|
1221
|
+
function tn({
|
|
1222
|
+
open: t,
|
|
1219
1223
|
onOpenChange: a,
|
|
1220
1224
|
isLibraryVisual: o,
|
|
1221
1225
|
currentVisualName: n,
|
|
@@ -1223,14 +1227,14 @@ function Zr({
|
|
|
1223
1227
|
destinationMode: r = "both",
|
|
1224
1228
|
onConfirm: d
|
|
1225
1229
|
}) {
|
|
1226
|
-
const [c, l] =
|
|
1230
|
+
const [c, l] = D(
|
|
1227
1231
|
o && n ? `Copy of ${n}` : n || ""
|
|
1228
|
-
), [u, h] =
|
|
1229
|
-
|
|
1230
|
-
|
|
1232
|
+
), [u, h] = D("");
|
|
1233
|
+
Mt.useEffect(() => {
|
|
1234
|
+
t && (l(
|
|
1231
1235
|
o && n ? `Copy of ${n}` : n || ""
|
|
1232
1236
|
), h(""));
|
|
1233
|
-
}, [
|
|
1237
|
+
}, [t, o, n]);
|
|
1234
1238
|
const m = !!c.trim(), p = r === "local" ? {
|
|
1235
1239
|
saveToLibrary: !1,
|
|
1236
1240
|
saveToCurrentDashboard: !0,
|
|
@@ -1257,12 +1261,12 @@ function Zr({
|
|
|
1257
1261
|
saveToCurrentDashboard: p.saveToCurrentDashboard
|
|
1258
1262
|
});
|
|
1259
1263
|
};
|
|
1260
|
-
return /* @__PURE__ */
|
|
1264
|
+
return /* @__PURE__ */ e(Ie, { open: t, onOpenChange: a, children: /* @__PURE__ */ s(Te, { className: "sm:max-w-[500px]", children: [
|
|
1261
1265
|
/* @__PURE__ */ s(bt, { children: [
|
|
1262
1266
|
/* @__PURE__ */ s(Le, { className: "flex items-center gap-2", children: [
|
|
1263
|
-
/* @__PURE__ */
|
|
1264
|
-
p.badgeType !== "local" && /* @__PURE__ */
|
|
1265
|
-
|
|
1267
|
+
/* @__PURE__ */ e("span", { children: "Save Visual As" }),
|
|
1268
|
+
p.badgeType !== "local" && /* @__PURE__ */ e(
|
|
1269
|
+
Fr,
|
|
1266
1270
|
{
|
|
1267
1271
|
type: p.badgeType,
|
|
1268
1272
|
showLabel: !0,
|
|
@@ -1270,12 +1274,12 @@ function Zr({
|
|
|
1270
1274
|
}
|
|
1271
1275
|
)
|
|
1272
1276
|
] }),
|
|
1273
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ e(vt, { children: p.description })
|
|
1274
1278
|
] }),
|
|
1275
1279
|
/* @__PURE__ */ s("div", { className: "grid gap-4 py-4", children: [
|
|
1276
1280
|
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
1277
|
-
/* @__PURE__ */
|
|
1278
|
-
/* @__PURE__ */
|
|
1281
|
+
/* @__PURE__ */ e(De, { htmlFor: "name", children: "Name" }),
|
|
1282
|
+
/* @__PURE__ */ e(
|
|
1279
1283
|
st,
|
|
1280
1284
|
{
|
|
1281
1285
|
id: "name",
|
|
@@ -1287,9 +1291,9 @@ function Zr({
|
|
|
1287
1291
|
)
|
|
1288
1292
|
] }),
|
|
1289
1293
|
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
1290
|
-
/* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1292
|
-
|
|
1294
|
+
/* @__PURE__ */ e(De, { htmlFor: "description", children: "Description (optional)" }),
|
|
1295
|
+
/* @__PURE__ */ e(
|
|
1296
|
+
wa,
|
|
1293
1297
|
{
|
|
1294
1298
|
id: "description",
|
|
1295
1299
|
value: u,
|
|
@@ -1301,9 +1305,9 @@ function Zr({
|
|
|
1301
1305
|
)
|
|
1302
1306
|
] })
|
|
1303
1307
|
] }),
|
|
1304
|
-
/* @__PURE__ */ s(
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
|
|
1308
|
+
/* @__PURE__ */ s(Na, { children: [
|
|
1309
|
+
/* @__PURE__ */ e(
|
|
1310
|
+
T,
|
|
1307
1311
|
{
|
|
1308
1312
|
variant: "outline",
|
|
1309
1313
|
onClick: () => a(!1),
|
|
@@ -1311,50 +1315,50 @@ function Zr({
|
|
|
1311
1315
|
children: "Cancel"
|
|
1312
1316
|
}
|
|
1313
1317
|
),
|
|
1314
|
-
/* @__PURE__ */ s(
|
|
1315
|
-
i && /* @__PURE__ */
|
|
1318
|
+
/* @__PURE__ */ s(T, { onClick: f, disabled: !m || i, children: [
|
|
1319
|
+
i && /* @__PURE__ */ e(ae, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1316
1320
|
p.actionLabel
|
|
1317
1321
|
] })
|
|
1318
1322
|
] })
|
|
1319
1323
|
] }) });
|
|
1320
1324
|
}
|
|
1321
|
-
function kt(
|
|
1325
|
+
function kt(t) {
|
|
1322
1326
|
var a;
|
|
1323
|
-
for (const o of
|
|
1324
|
-
if (o.type === "matrixTable" && !
|
|
1327
|
+
for (const o of t.cards)
|
|
1328
|
+
if (o.type === "matrixTable" && !vr.safeParse((a = o.config) == null ? void 0 : a.matrix).success)
|
|
1325
1329
|
return E.error("Matrix requires at least one row field, one metric, and valid settings."), !1;
|
|
1326
1330
|
return !0;
|
|
1327
1331
|
}
|
|
1328
1332
|
function tt({
|
|
1329
|
-
className:
|
|
1333
|
+
className: t,
|
|
1330
1334
|
variant: a = "outline"
|
|
1331
1335
|
}) {
|
|
1332
|
-
const o =
|
|
1336
|
+
const o = Z((r) => r.onSave), { getUpdatedFrame: n } = ye();
|
|
1333
1337
|
function i() {
|
|
1334
1338
|
const r = n();
|
|
1335
1339
|
kt(r) && (o == null || o(r));
|
|
1336
1340
|
}
|
|
1337
1341
|
return /* @__PURE__ */ s(
|
|
1338
|
-
|
|
1342
|
+
T,
|
|
1339
1343
|
{
|
|
1340
1344
|
onClick: i,
|
|
1341
|
-
className:
|
|
1345
|
+
className: t,
|
|
1342
1346
|
size: "xs",
|
|
1343
1347
|
variant: a,
|
|
1344
1348
|
children: [
|
|
1345
|
-
/* @__PURE__ */
|
|
1349
|
+
/* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" }),
|
|
1346
1350
|
"Done"
|
|
1347
1351
|
]
|
|
1348
1352
|
}
|
|
1349
1353
|
);
|
|
1350
1354
|
}
|
|
1351
|
-
function
|
|
1352
|
-
className:
|
|
1355
|
+
function an({
|
|
1356
|
+
className: t,
|
|
1353
1357
|
variant: a = "default"
|
|
1354
1358
|
}) {
|
|
1355
|
-
const o = Qe(), [n, i] =
|
|
1356
|
-
return /* @__PURE__ */
|
|
1357
|
-
|
|
1359
|
+
const o = Qe(), [n, i] = D(!1), { setIsVisualEditing: r } = de(), { getUpdatedFrame: d } = ye(), c = Ke(), l = Z((m) => m.frame), u = _t();
|
|
1360
|
+
return /* @__PURE__ */ e(
|
|
1361
|
+
T,
|
|
1358
1362
|
{
|
|
1359
1363
|
onClick: () => {
|
|
1360
1364
|
const m = d();
|
|
@@ -1385,25 +1389,25 @@ function en({
|
|
|
1385
1389
|
}
|
|
1386
1390
|
);
|
|
1387
1391
|
},
|
|
1388
|
-
className:
|
|
1392
|
+
className: t,
|
|
1389
1393
|
size: "xs",
|
|
1390
1394
|
variant: a,
|
|
1391
|
-
children: n ? /* @__PURE__ */ s(
|
|
1392
|
-
/* @__PURE__ */
|
|
1395
|
+
children: n ? /* @__PURE__ */ s(R, { children: [
|
|
1396
|
+
/* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1393
1397
|
"Saving"
|
|
1394
|
-
] }) : /* @__PURE__ */ s(
|
|
1395
|
-
/* @__PURE__ */
|
|
1398
|
+
] }) : /* @__PURE__ */ s(R, { children: [
|
|
1399
|
+
/* @__PURE__ */ e(Qt, { className: "h-3.5 w-3.5" }),
|
|
1396
1400
|
"Save to Library"
|
|
1397
1401
|
] })
|
|
1398
1402
|
}
|
|
1399
1403
|
);
|
|
1400
1404
|
}
|
|
1401
|
-
function
|
|
1402
|
-
className:
|
|
1405
|
+
function rn({
|
|
1406
|
+
className: t
|
|
1403
1407
|
}) {
|
|
1404
|
-
const a = Qe(), [o, n] =
|
|
1405
|
-
return /* @__PURE__ */
|
|
1406
|
-
|
|
1408
|
+
const a = Qe(), [o, n] = D(!1), i = Ke(), r = Z((g) => g.frame), d = w((g) => g.selectedSheetId), c = w((g) => g.dashboard), { updateFrame: l, setIsVisualEditing: u } = de(), { getUpdatedFrame: h } = ye(), m = _t(), p = xt();
|
|
1409
|
+
return /* @__PURE__ */ e(
|
|
1410
|
+
T,
|
|
1407
1411
|
{
|
|
1408
1412
|
onClick: async () => {
|
|
1409
1413
|
if (!d) {
|
|
@@ -1417,52 +1421,52 @@ function tn({
|
|
|
1417
1421
|
}
|
|
1418
1422
|
n(!0);
|
|
1419
1423
|
try {
|
|
1420
|
-
const
|
|
1421
|
-
if (!kt(
|
|
1424
|
+
const x = h();
|
|
1425
|
+
if (!kt(x)) {
|
|
1422
1426
|
n(!1);
|
|
1423
1427
|
return;
|
|
1424
1428
|
}
|
|
1425
|
-
const
|
|
1426
|
-
...
|
|
1429
|
+
const N = {
|
|
1430
|
+
...x,
|
|
1427
1431
|
visualId: g
|
|
1428
1432
|
// Keep the link to library visual
|
|
1429
|
-
},
|
|
1430
|
-
previousFrame:
|
|
1433
|
+
}, S = He(c, N.id), M = await p(N, {
|
|
1434
|
+
previousFrame: S
|
|
1431
1435
|
});
|
|
1432
1436
|
await m.mutateAsync({
|
|
1433
1437
|
visualId: g,
|
|
1434
1438
|
data: {
|
|
1435
|
-
frameObject:
|
|
1439
|
+
frameObject: x
|
|
1436
1440
|
}
|
|
1437
|
-
}), l(d,
|
|
1438
|
-
semanticExecutionPayload:
|
|
1441
|
+
}), l(d, N, {
|
|
1442
|
+
semanticExecutionPayload: M
|
|
1439
1443
|
}), a.invalidateQueries({ queryKey: ["visuals"] }), a.invalidateQueries({ queryKey: ["visual", g] }), E.success("Saved to library and applied locally"), setTimeout(() => {
|
|
1440
1444
|
u(!1);
|
|
1441
1445
|
}, 300);
|
|
1442
|
-
} catch (
|
|
1443
|
-
console.error("Failed to save and apply:",
|
|
1444
|
-
|
|
1446
|
+
} catch (x) {
|
|
1447
|
+
console.error("Failed to save and apply:", x), E.error(
|
|
1448
|
+
x instanceof Error ? x.message : "Failed to save and apply changes"
|
|
1445
1449
|
);
|
|
1446
1450
|
} finally {
|
|
1447
1451
|
n(!1);
|
|
1448
1452
|
}
|
|
1449
1453
|
},
|
|
1450
|
-
className:
|
|
1454
|
+
className: t,
|
|
1451
1455
|
size: "xs",
|
|
1452
1456
|
variant: "default",
|
|
1453
1457
|
disabled: o,
|
|
1454
|
-
children: o ? /* @__PURE__ */ s(
|
|
1455
|
-
/* @__PURE__ */
|
|
1458
|
+
children: o ? /* @__PURE__ */ s(R, { children: [
|
|
1459
|
+
/* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1456
1460
|
"Saving..."
|
|
1457
|
-
] }) : /* @__PURE__ */ s(
|
|
1458
|
-
/* @__PURE__ */
|
|
1461
|
+
] }) : /* @__PURE__ */ s(R, { children: [
|
|
1462
|
+
/* @__PURE__ */ e(Qt, { className: "h-3.5 w-3.5" }),
|
|
1459
1463
|
"Save & Apply"
|
|
1460
1464
|
] })
|
|
1461
1465
|
}
|
|
1462
1466
|
);
|
|
1463
1467
|
}
|
|
1464
|
-
function at({ className:
|
|
1465
|
-
const { setTempQueryData: a, setSqlGen: o } = Ge(), n = Qe(), i =
|
|
1468
|
+
function at({ className: t }) {
|
|
1469
|
+
const { setTempQueryData: a, setSqlGen: o } = Ge(), n = Qe(), i = Z((c) => c.tempQueryData), r = Z((c) => c.onClose);
|
|
1466
1470
|
function d() {
|
|
1467
1471
|
if (i) {
|
|
1468
1472
|
const { queryKey: c, queryData: l } = i;
|
|
@@ -1471,101 +1475,101 @@ function at({ className: e }) {
|
|
|
1471
1475
|
o({}), r == null || r();
|
|
1472
1476
|
}
|
|
1473
1477
|
return /* @__PURE__ */ s(
|
|
1474
|
-
|
|
1478
|
+
T,
|
|
1475
1479
|
{
|
|
1476
1480
|
onClick: d,
|
|
1477
|
-
className:
|
|
1481
|
+
className: t,
|
|
1478
1482
|
size: "xs",
|
|
1479
1483
|
variant: "outline",
|
|
1480
1484
|
children: [
|
|
1481
|
-
/* @__PURE__ */
|
|
1485
|
+
/* @__PURE__ */ e(Xe, { className: "h-3.5 w-3.5" }),
|
|
1482
1486
|
"Close"
|
|
1483
1487
|
]
|
|
1484
1488
|
}
|
|
1485
1489
|
);
|
|
1486
1490
|
}
|
|
1487
|
-
function
|
|
1488
|
-
const [
|
|
1489
|
-
var b,
|
|
1490
|
-
return ((b = l == null ? void 0 : l.cards) == null ? void 0 : b.length) === 1 && ((
|
|
1491
|
-
})(),
|
|
1491
|
+
function nn() {
|
|
1492
|
+
const [t, a] = D(!1), [o, n] = D(!1), [i, r] = D(null), [d, c] = D(null), l = Z((b) => b.frame), u = Z((b) => b.card), h = Ke(), m = w((b) => b.selectedSheetId), p = w((b) => b.dashboard), { getUpdatedFrame: f } = ye(), { selectVisual: g } = lt(), { addFrame: x, setIsVisualEditing: N } = de(), S = xt(), M = !!(l != null && l.visualId), U = (() => {
|
|
1493
|
+
var b, I;
|
|
1494
|
+
return ((b = l == null ? void 0 : l.cards) == null ? void 0 : b.length) === 1 && ((I = l.cards[0]) != null && I.title) ? l.cards[0].title : h != null && h.title ? h.title : (u == null ? void 0 : u.title) || "Untitled Visual";
|
|
1495
|
+
})(), F = Sa((b) => {
|
|
1492
1496
|
b != null && b.id && (g(b), o && i && d && m && (async () => {
|
|
1493
1497
|
try {
|
|
1494
|
-
const
|
|
1498
|
+
const I = {
|
|
1495
1499
|
...i,
|
|
1496
|
-
id:
|
|
1500
|
+
id: It(),
|
|
1497
1501
|
visualId: b.id
|
|
1498
1502
|
// Link to the newly created library visual
|
|
1499
1503
|
};
|
|
1500
|
-
|
|
1504
|
+
x(m, I, {
|
|
1501
1505
|
semanticExecutionPayload: d
|
|
1502
|
-
}), n(!1), r(null), c(null),
|
|
1503
|
-
} catch (
|
|
1506
|
+
}), n(!1), r(null), c(null), N(!1);
|
|
1507
|
+
} catch (I) {
|
|
1504
1508
|
console.error(
|
|
1505
1509
|
"Failed to promote semantic metadata for saved visual:",
|
|
1506
|
-
|
|
1510
|
+
I
|
|
1507
1511
|
), E.error(
|
|
1508
|
-
|
|
1512
|
+
I instanceof Error ? I.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1509
1513
|
);
|
|
1510
1514
|
}
|
|
1511
1515
|
})(), a(!1));
|
|
1512
1516
|
});
|
|
1513
1517
|
return {
|
|
1514
|
-
saveAsDialogOpen:
|
|
1518
|
+
saveAsDialogOpen: t,
|
|
1515
1519
|
setSaveAsDialogOpen: a,
|
|
1516
1520
|
handleSaveAs: async (b) => {
|
|
1517
1521
|
if (!m) {
|
|
1518
1522
|
E.error("No sheet selected");
|
|
1519
1523
|
return;
|
|
1520
1524
|
}
|
|
1521
|
-
const
|
|
1522
|
-
...
|
|
1523
|
-
cards:
|
|
1524
|
-
...
|
|
1525
|
+
const I = f(), A = I.cards.length === 1 ? {
|
|
1526
|
+
...I,
|
|
1527
|
+
cards: I.cards.map((k) => ({
|
|
1528
|
+
...k,
|
|
1525
1529
|
title: b.name
|
|
1526
1530
|
// Use visual name as card title
|
|
1527
1531
|
}))
|
|
1528
|
-
} :
|
|
1532
|
+
} : I;
|
|
1529
1533
|
if (b.saveToLibrary) {
|
|
1530
|
-
let
|
|
1534
|
+
let k = null;
|
|
1531
1535
|
if (b.saveToCurrentDashboard)
|
|
1532
1536
|
try {
|
|
1533
|
-
|
|
1534
|
-
previousFrame: He(p,
|
|
1537
|
+
k = await S(A, {
|
|
1538
|
+
previousFrame: He(p, A.id)
|
|
1535
1539
|
});
|
|
1536
|
-
} catch (
|
|
1540
|
+
} catch (L) {
|
|
1537
1541
|
console.error(
|
|
1538
1542
|
"Failed to prepare semantic metadata before saving visual:",
|
|
1539
|
-
|
|
1543
|
+
L
|
|
1540
1544
|
), E.error(
|
|
1541
|
-
|
|
1545
|
+
L instanceof Error ? L.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1542
1546
|
);
|
|
1543
1547
|
return;
|
|
1544
1548
|
}
|
|
1545
|
-
n(b.saveToCurrentDashboard), r(
|
|
1549
|
+
n(b.saveToCurrentDashboard), r(A), c(k);
|
|
1546
1550
|
const j = {
|
|
1547
1551
|
title: b.name,
|
|
1548
1552
|
description: b.description,
|
|
1549
|
-
frameObject:
|
|
1553
|
+
frameObject: A,
|
|
1550
1554
|
// Card title synced for single-card frames
|
|
1551
1555
|
isPrivate: !1
|
|
1552
1556
|
};
|
|
1553
|
-
|
|
1557
|
+
F.mutate(j);
|
|
1554
1558
|
} else if (b.saveToCurrentDashboard) {
|
|
1555
|
-
const
|
|
1556
|
-
...
|
|
1559
|
+
const k = {
|
|
1560
|
+
...A,
|
|
1557
1561
|
// Card title already synced
|
|
1558
|
-
id:
|
|
1562
|
+
id: It(),
|
|
1559
1563
|
visualId: void 0
|
|
1560
1564
|
// Explicitly no visualId for local visuals
|
|
1561
1565
|
};
|
|
1562
1566
|
try {
|
|
1563
|
-
const j = await
|
|
1564
|
-
previousFrame: He(p,
|
|
1567
|
+
const j = await S(A, {
|
|
1568
|
+
previousFrame: He(p, A.id)
|
|
1565
1569
|
});
|
|
1566
|
-
|
|
1570
|
+
x(m, k, {
|
|
1567
1571
|
semanticExecutionPayload: j
|
|
1568
|
-
}), E.success("Visual saved to dashboard"), a(!1),
|
|
1572
|
+
}), E.success("Visual saved to dashboard"), a(!1), N(!1);
|
|
1569
1573
|
} catch (j) {
|
|
1570
1574
|
console.error("Failed to save visual to dashboard:", j), E.error(
|
|
1571
1575
|
j instanceof Error ? j.message : "Failed to prepare semantic metadata for the visual"
|
|
@@ -1573,81 +1577,81 @@ function an() {
|
|
|
1573
1577
|
}
|
|
1574
1578
|
}
|
|
1575
1579
|
},
|
|
1576
|
-
isLibraryVisual:
|
|
1577
|
-
currentVisualName:
|
|
1578
|
-
isSaving:
|
|
1580
|
+
isLibraryVisual: M,
|
|
1581
|
+
currentVisualName: U,
|
|
1582
|
+
isSaving: F.isPending
|
|
1579
1583
|
};
|
|
1580
1584
|
}
|
|
1581
|
-
function
|
|
1582
|
-
const { isInspectionMode: a } =
|
|
1583
|
-
saveAsDialogOpen:
|
|
1584
|
-
setSaveAsDialogOpen:
|
|
1585
|
+
function us(t = {}) {
|
|
1586
|
+
const { isInspectionMode: a } = ka(), o = Z((L) => L.frame), n = Z((L) => L.editorContext), i = Da((L) => L.selectedVisual), r = w((L) => L.selectedFrameId), d = w((L) => L.selectedSheetId), c = w((L) => L.dashboard), { setIsVisualEditing: l, updateFrame: u } = de(), [h, m] = D(!1), [p, f] = D("both"), g = xt(), x = (n == null ? void 0 : n.type) === "documentSection", N = !!(o != null && o.visualId || i != null && i.id), S = !!(o != null && o.visualId && r), M = N && !S, {
|
|
1587
|
+
saveAsDialogOpen: U,
|
|
1588
|
+
setSaveAsDialogOpen: F,
|
|
1585
1589
|
handleSaveAs: O,
|
|
1586
1590
|
isLibraryVisual: b,
|
|
1587
|
-
currentVisualName:
|
|
1591
|
+
currentVisualName: I,
|
|
1588
1592
|
isSaving: C
|
|
1589
|
-
} =
|
|
1593
|
+
} = nn(), { getUpdatedFrame: A } = ye();
|
|
1590
1594
|
if (a)
|
|
1591
|
-
return /* @__PURE__ */ s(
|
|
1592
|
-
/* @__PURE__ */
|
|
1595
|
+
return /* @__PURE__ */ s(R, { children: [
|
|
1596
|
+
/* @__PURE__ */ e(
|
|
1593
1597
|
tt,
|
|
1594
1598
|
{
|
|
1595
1599
|
className: "rounded-control",
|
|
1596
1600
|
variant: "default"
|
|
1597
1601
|
}
|
|
1598
1602
|
),
|
|
1599
|
-
/* @__PURE__ */
|
|
1603
|
+
/* @__PURE__ */ e(at, {})
|
|
1600
1604
|
] });
|
|
1601
|
-
if (
|
|
1602
|
-
return /* @__PURE__ */ s(
|
|
1603
|
-
/* @__PURE__ */
|
|
1604
|
-
/* @__PURE__ */
|
|
1605
|
+
if (x)
|
|
1606
|
+
return /* @__PURE__ */ s(R, { children: [
|
|
1607
|
+
/* @__PURE__ */ e(tt, { className: "rounded-control", variant: "default" }),
|
|
1608
|
+
/* @__PURE__ */ e(at, {})
|
|
1605
1609
|
] });
|
|
1606
|
-
const
|
|
1610
|
+
const k = async () => {
|
|
1607
1611
|
if (!d) {
|
|
1608
1612
|
E.error("No sheet selected");
|
|
1609
1613
|
return;
|
|
1610
1614
|
}
|
|
1611
1615
|
if (h) return;
|
|
1612
1616
|
m(!0);
|
|
1613
|
-
const
|
|
1614
|
-
...
|
|
1617
|
+
const z = {
|
|
1618
|
+
...A(),
|
|
1615
1619
|
visualId: void 0
|
|
1616
|
-
},
|
|
1620
|
+
}, G = He(c, z.id);
|
|
1617
1621
|
try {
|
|
1618
|
-
const
|
|
1619
|
-
previousFrame:
|
|
1622
|
+
const V = await g(z, {
|
|
1623
|
+
previousFrame: G
|
|
1620
1624
|
});
|
|
1621
|
-
u(d,
|
|
1622
|
-
semanticExecutionPayload:
|
|
1625
|
+
u(d, z, {
|
|
1626
|
+
semanticExecutionPayload: V
|
|
1623
1627
|
});
|
|
1624
|
-
} catch (
|
|
1625
|
-
console.error("Failed to apply local semantic metadata:",
|
|
1626
|
-
|
|
1628
|
+
} catch (V) {
|
|
1629
|
+
console.error("Failed to apply local semantic metadata:", V), m(!1), E.error(
|
|
1630
|
+
V instanceof Error ? V.message : "Failed to prepare semantic metadata for this visual"
|
|
1627
1631
|
);
|
|
1628
1632
|
return;
|
|
1629
1633
|
}
|
|
1630
1634
|
setTimeout(() => {
|
|
1631
1635
|
m(!1), E.success("Changes applied. Visual is now local to this dashboard"), l(!1);
|
|
1632
1636
|
}, 300);
|
|
1633
|
-
}, j = (
|
|
1634
|
-
f(
|
|
1637
|
+
}, j = (L) => {
|
|
1638
|
+
f(L), F(!0);
|
|
1635
1639
|
};
|
|
1636
|
-
return /* @__PURE__ */ s(
|
|
1640
|
+
return /* @__PURE__ */ s(R, { children: [
|
|
1637
1641
|
/* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
|
|
1638
|
-
!
|
|
1639
|
-
|
|
1640
|
-
|
|
1642
|
+
!N && /* @__PURE__ */ e(tt, { className: "!rounded-none", variant: "default" }),
|
|
1643
|
+
N && M && /* @__PURE__ */ e(an, { className: "!rounded-none", variant: "default" }),
|
|
1644
|
+
N && S && /* @__PURE__ */ e(rn, { className: "!rounded-none" }),
|
|
1641
1645
|
/* @__PURE__ */ s(Ve, { modal: !1, children: [
|
|
1642
|
-
/* @__PURE__ */
|
|
1643
|
-
|
|
1646
|
+
/* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1647
|
+
T,
|
|
1644
1648
|
{
|
|
1645
1649
|
variant: "default",
|
|
1646
1650
|
size: "xs",
|
|
1647
1651
|
className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
|
|
1648
1652
|
"aria-label": "Open visual save options",
|
|
1649
1653
|
disabled: C || h,
|
|
1650
|
-
children: /* @__PURE__ */
|
|
1654
|
+
children: /* @__PURE__ */ e(wt, { className: "h-3.5 w-3.5" })
|
|
1651
1655
|
}
|
|
1652
1656
|
) }),
|
|
1653
1657
|
/* @__PURE__ */ s(
|
|
@@ -1656,49 +1660,49 @@ function hs(e = {}) {
|
|
|
1656
1660
|
align: "end",
|
|
1657
1661
|
className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
|
|
1658
1662
|
children: [
|
|
1659
|
-
|
|
1663
|
+
S && /* @__PURE__ */ s(R, { children: [
|
|
1660
1664
|
/* @__PURE__ */ s(
|
|
1661
|
-
|
|
1665
|
+
K,
|
|
1662
1666
|
{
|
|
1663
|
-
onClick:
|
|
1667
|
+
onClick: k,
|
|
1664
1668
|
disabled: h,
|
|
1665
1669
|
children: [
|
|
1666
|
-
/* @__PURE__ */
|
|
1670
|
+
/* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" }),
|
|
1667
1671
|
h ? "Applying..." : "Apply Locally"
|
|
1668
1672
|
]
|
|
1669
1673
|
}
|
|
1670
1674
|
),
|
|
1671
|
-
/* @__PURE__ */
|
|
1675
|
+
/* @__PURE__ */ e(We, {})
|
|
1672
1676
|
] }),
|
|
1673
1677
|
/* @__PURE__ */ s(
|
|
1674
|
-
|
|
1678
|
+
K,
|
|
1675
1679
|
{
|
|
1676
1680
|
onClick: () => j("local"),
|
|
1677
1681
|
disabled: C,
|
|
1678
1682
|
children: [
|
|
1679
|
-
/* @__PURE__ */
|
|
1683
|
+
/* @__PURE__ */ e(xe, { className: "h-3.5 w-3.5" }),
|
|
1680
1684
|
"Add to Dashboard (Local)"
|
|
1681
1685
|
]
|
|
1682
1686
|
}
|
|
1683
1687
|
),
|
|
1684
1688
|
/* @__PURE__ */ s(
|
|
1685
|
-
|
|
1689
|
+
K,
|
|
1686
1690
|
{
|
|
1687
1691
|
onClick: () => j("library"),
|
|
1688
1692
|
disabled: C,
|
|
1689
1693
|
children: [
|
|
1690
|
-
/* @__PURE__ */
|
|
1694
|
+
/* @__PURE__ */ e(Er, { className: "h-3.5 w-3.5" }),
|
|
1691
1695
|
"Save as Library Visual"
|
|
1692
1696
|
]
|
|
1693
1697
|
}
|
|
1694
1698
|
),
|
|
1695
1699
|
/* @__PURE__ */ s(
|
|
1696
|
-
|
|
1700
|
+
K,
|
|
1697
1701
|
{
|
|
1698
1702
|
onClick: () => j("both"),
|
|
1699
1703
|
disabled: C,
|
|
1700
1704
|
children: [
|
|
1701
|
-
/* @__PURE__ */
|
|
1705
|
+
/* @__PURE__ */ e(Ir, { className: "h-3.5 w-3.5" }),
|
|
1702
1706
|
"Save Copy as Linked Visual"
|
|
1703
1707
|
]
|
|
1704
1708
|
}
|
|
@@ -1708,16 +1712,16 @@ function hs(e = {}) {
|
|
|
1708
1712
|
)
|
|
1709
1713
|
] })
|
|
1710
1714
|
] }),
|
|
1711
|
-
/* @__PURE__ */
|
|
1712
|
-
/* @__PURE__ */
|
|
1713
|
-
|
|
1715
|
+
/* @__PURE__ */ e(at, {}),
|
|
1716
|
+
/* @__PURE__ */ e(
|
|
1717
|
+
tn,
|
|
1714
1718
|
{
|
|
1715
|
-
open:
|
|
1716
|
-
onOpenChange: (
|
|
1717
|
-
C ||
|
|
1719
|
+
open: U,
|
|
1720
|
+
onOpenChange: (L) => {
|
|
1721
|
+
C || F(L);
|
|
1718
1722
|
},
|
|
1719
1723
|
isLibraryVisual: b,
|
|
1720
|
-
currentVisualName:
|
|
1724
|
+
currentVisualName: I,
|
|
1721
1725
|
isSaving: C,
|
|
1722
1726
|
destinationMode: p,
|
|
1723
1727
|
onConfirm: O
|
|
@@ -1725,11 +1729,11 @@ function hs(e = {}) {
|
|
|
1725
1729
|
)
|
|
1726
1730
|
] });
|
|
1727
1731
|
}
|
|
1728
|
-
function
|
|
1729
|
-
const a =
|
|
1730
|
-
if (!n || !d || !
|
|
1732
|
+
function hs({ className: t }) {
|
|
1733
|
+
const a = Z((h) => h.isDevMode), o = Z((h) => h.card.type), n = w((h) => h.isVisualEditing), { setIsDevMode: i } = Ge(), { config: r } = Ut(Aa).tokenProps, d = (r == null ? void 0 : r.showAdvancedMode) !== !1;
|
|
1734
|
+
if (!n || !d || !yr(o))
|
|
1731
1735
|
return null;
|
|
1732
|
-
const c = a ?
|
|
1736
|
+
const c = a ? _r : zr, l = a ? "Visual editor" : "SQL editor", u = a ? "Switch to visual editor" : "Switch to SQL editor";
|
|
1733
1737
|
return /* @__PURE__ */ s(
|
|
1734
1738
|
"button",
|
|
1735
1739
|
{
|
|
@@ -1737,19 +1741,19 @@ function ms({ className: e }) {
|
|
|
1737
1741
|
"aria-label": u,
|
|
1738
1742
|
title: u,
|
|
1739
1743
|
onClick: () => i(!a),
|
|
1740
|
-
className:
|
|
1744
|
+
className: J(
|
|
1741
1745
|
"inline-flex h-7 items-center gap-1.5 rounded-control border border-input bg-background px-2 text-[12px] font-medium text-foreground transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:outline-none",
|
|
1742
|
-
|
|
1746
|
+
t
|
|
1743
1747
|
),
|
|
1744
1748
|
children: [
|
|
1745
|
-
/* @__PURE__ */
|
|
1749
|
+
/* @__PURE__ */ e(c, { className: "h-3 w-3 text-muted-foreground" }),
|
|
1746
1750
|
l
|
|
1747
1751
|
]
|
|
1748
1752
|
}
|
|
1749
1753
|
);
|
|
1750
1754
|
}
|
|
1751
|
-
function
|
|
1752
|
-
const
|
|
1755
|
+
function ms() {
|
|
1756
|
+
const t = Vr() === "sm", a = w((l) => l.isDashboardEditing), o = w((l) => l.isVisualEditing), n = w((l) => {
|
|
1753
1757
|
var h;
|
|
1754
1758
|
const u = ((h = l.dashboard) == null ? void 0 : h.sheets) ?? [];
|
|
1755
1759
|
return u.find((m) => m.id === l.selectedSheetId) ?? u[0];
|
|
@@ -1776,74 +1780,74 @@ function ps() {
|
|
|
1776
1780
|
};
|
|
1777
1781
|
return /* @__PURE__ */ s("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
|
|
1778
1782
|
/* @__PURE__ */ s(
|
|
1779
|
-
|
|
1783
|
+
T,
|
|
1780
1784
|
{
|
|
1781
1785
|
variant: "ghost",
|
|
1782
1786
|
size: "xs",
|
|
1783
1787
|
disabled: d,
|
|
1784
1788
|
title: d ? "This sheet has no cards to arrange" : "Lay out the cards by kind on every screen size",
|
|
1785
1789
|
onClick: () => c(!1),
|
|
1786
|
-
"aria-label":
|
|
1787
|
-
className: `h-full rounded-none border-0 shadow-none hover:bg-accent${
|
|
1790
|
+
"aria-label": t ? "Arrange" : void 0,
|
|
1791
|
+
className: `h-full rounded-none border-0 shadow-none hover:bg-accent${t ? " w-7 px-0" : ""}`,
|
|
1788
1792
|
children: [
|
|
1789
|
-
/* @__PURE__ */
|
|
1790
|
-
!
|
|
1793
|
+
/* @__PURE__ */ e(Ee, { className: "h-3.5 w-3.5" }),
|
|
1794
|
+
!t && "Arrange"
|
|
1791
1795
|
]
|
|
1792
1796
|
}
|
|
1793
1797
|
),
|
|
1794
1798
|
/* @__PURE__ */ s(Ve, { modal: !1, children: [
|
|
1795
|
-
/* @__PURE__ */
|
|
1796
|
-
|
|
1799
|
+
/* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1800
|
+
T,
|
|
1797
1801
|
{
|
|
1798
1802
|
variant: "ghost",
|
|
1799
1803
|
size: "xs",
|
|
1800
1804
|
disabled: d,
|
|
1801
1805
|
className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
|
|
1802
1806
|
"aria-label": "Open arrange options",
|
|
1803
|
-
children: /* @__PURE__ */
|
|
1807
|
+
children: /* @__PURE__ */ e(wt, { className: "h-3.5 w-3.5" })
|
|
1804
1808
|
}
|
|
1805
1809
|
) }),
|
|
1806
|
-
/* @__PURE__ */
|
|
1807
|
-
/* @__PURE__ */
|
|
1810
|
+
/* @__PURE__ */ e(Pe, { align: "end", className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm", children: /* @__PURE__ */ s(K, { onClick: () => c(!0), children: [
|
|
1811
|
+
/* @__PURE__ */ e(Ee, { className: "h-3.5 w-3.5" }),
|
|
1808
1812
|
"Keep my order"
|
|
1809
1813
|
] }) })
|
|
1810
1814
|
] })
|
|
1811
1815
|
] });
|
|
1812
1816
|
}
|
|
1813
|
-
function
|
|
1814
|
-
const
|
|
1817
|
+
function ps() {
|
|
1818
|
+
const t = w((i) => i.screenSizesOpen), a = w((i) => {
|
|
1815
1819
|
var c, l;
|
|
1816
1820
|
const r = ((c = i.dashboard) == null ? void 0 : c.sheets) ?? [], d = r.find((u) => u.id === i.selectedSheetId) ?? r[0];
|
|
1817
1821
|
return !!d && !Nt(d) && !!((l = d.frames) != null && l.length);
|
|
1818
|
-
}), o = w((i) => i.actions.setScreenSizesOpen), n =
|
|
1822
|
+
}), o = w((i) => i.actions.setScreenSizesOpen), n = Xt(
|
|
1819
1823
|
"screen-sizes",
|
|
1820
1824
|
"lg",
|
|
1821
1825
|
a ? {
|
|
1822
1826
|
label: "Screen sizes",
|
|
1823
|
-
icon: /* @__PURE__ */
|
|
1824
|
-
checked:
|
|
1827
|
+
icon: /* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
1828
|
+
checked: t,
|
|
1825
1829
|
order: 40,
|
|
1826
|
-
onSelect: () => o(!
|
|
1830
|
+
onSelect: () => o(!t)
|
|
1827
1831
|
} : void 0
|
|
1828
1832
|
);
|
|
1829
|
-
return !a || n.collapsed ? null : /* @__PURE__ */
|
|
1830
|
-
|
|
1833
|
+
return !a || n.collapsed ? null : /* @__PURE__ */ e(
|
|
1834
|
+
T,
|
|
1831
1835
|
{
|
|
1832
1836
|
type: "button",
|
|
1833
1837
|
size: "xs",
|
|
1834
|
-
variant:
|
|
1835
|
-
"aria-pressed":
|
|
1838
|
+
variant: t ? "secondary" : "ghost",
|
|
1839
|
+
"aria-pressed": t,
|
|
1836
1840
|
"aria-label": "Screen sizes",
|
|
1837
1841
|
title: "Screen sizes",
|
|
1838
|
-
onClick: () => o(!
|
|
1842
|
+
onClick: () => o(!t),
|
|
1839
1843
|
className: "w-7 px-0",
|
|
1840
|
-
children: /* @__PURE__ */
|
|
1844
|
+
children: /* @__PURE__ */ e(Vt, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
|
|
1841
1845
|
}
|
|
1842
1846
|
);
|
|
1843
1847
|
}
|
|
1844
|
-
function
|
|
1848
|
+
function fs({ dashboardId: t }) {
|
|
1845
1849
|
const { openDashboardId: a, access: o, printMode: n, serverIsFavorite: i, fetchedAt: r } = w(
|
|
1846
|
-
|
|
1850
|
+
Fa((l) => {
|
|
1847
1851
|
var u;
|
|
1848
1852
|
return {
|
|
1849
1853
|
openDashboardId: (u = l.dashboard) == null ? void 0 : u.id,
|
|
@@ -1853,32 +1857,32 @@ function gs({ dashboardId: e }) {
|
|
|
1853
1857
|
fetchedAt: l.viewer.fetchedAt
|
|
1854
1858
|
};
|
|
1855
1859
|
})
|
|
1856
|
-
), d =
|
|
1857
|
-
return a !==
|
|
1858
|
-
|
|
1860
|
+
), d = Ea(), c = d.isFavorite(t, i, r);
|
|
1861
|
+
return a !== t || n || o === "session-only" ? null : /* @__PURE__ */ e(
|
|
1862
|
+
Ia,
|
|
1859
1863
|
{
|
|
1860
1864
|
variant: "toolbar",
|
|
1861
1865
|
isFavorite: c,
|
|
1862
1866
|
readOnly: o === "read-only",
|
|
1863
|
-
pending: d.isPending(
|
|
1864
|
-
onToggle: () => void d.setFavorite({ dashboardId:
|
|
1867
|
+
pending: d.isPending(t),
|
|
1868
|
+
onToggle: () => void d.setFavorite({ dashboardId: t, isFavorite: !c })
|
|
1865
1869
|
}
|
|
1866
1870
|
);
|
|
1867
1871
|
}
|
|
1868
|
-
function
|
|
1869
|
-
width:
|
|
1872
|
+
function gs({
|
|
1873
|
+
width: t,
|
|
1870
1874
|
hasOverflowMenu: a = !0,
|
|
1871
1875
|
children: o
|
|
1872
1876
|
}) {
|
|
1873
|
-
const [n, i] =
|
|
1877
|
+
const [n, i] = D(
|
|
1874
1878
|
() => /* @__PURE__ */ new Map()
|
|
1875
|
-
), [r, d] =
|
|
1879
|
+
), [r, d] = D(null), [c, l] = D(null), u = Y((m) => (i((p) => new Map(p).set(m.id, m)), () => i((p) => {
|
|
1876
1880
|
if (p.get(m.id) !== m) return p;
|
|
1877
1881
|
const f = new Map(p);
|
|
1878
1882
|
return f.delete(m.id), f;
|
|
1879
|
-
})), []), h =
|
|
1883
|
+
})), []), h = ee(
|
|
1880
1884
|
() => ({
|
|
1881
|
-
width:
|
|
1885
|
+
width: t,
|
|
1882
1886
|
hasOverflowMenu: a,
|
|
1883
1887
|
overflowItems: [...n.values()].sort((m, p) => m.order - p.order),
|
|
1884
1888
|
register: u,
|
|
@@ -1887,28 +1891,28 @@ function bs({
|
|
|
1887
1891
|
anchorSlot: c,
|
|
1888
1892
|
setAnchorSlot: l
|
|
1889
1893
|
}),
|
|
1890
|
-
[c, a, n, r, u,
|
|
1894
|
+
[c, a, n, r, u, t]
|
|
1891
1895
|
);
|
|
1892
|
-
return /* @__PURE__ */
|
|
1896
|
+
return /* @__PURE__ */ e(Yt.Provider, { value: h, children: o });
|
|
1893
1897
|
}
|
|
1894
|
-
function
|
|
1895
|
-
const { setAnchorSlot:
|
|
1896
|
-
return /* @__PURE__ */
|
|
1898
|
+
function bs() {
|
|
1899
|
+
const { setAnchorSlot: t } = Ut(Yt);
|
|
1900
|
+
return /* @__PURE__ */ e("span", { ref: t, "aria-hidden": !0, className: "relative -mr-1.5 block h-7 w-0" });
|
|
1897
1901
|
}
|
|
1898
|
-
function vs(
|
|
1902
|
+
function vs(t) {
|
|
1899
1903
|
var l;
|
|
1900
|
-
const { authToken: a, tokenProps: o } = it(), { data: n } =
|
|
1904
|
+
const { authToken: a, tokenProps: o } = it(), { data: n } = Ta(), { mutate: i, isPending: r } = La(), d = !!t && ((l = n == null ? void 0 : n.preference) == null ? void 0 : l.defaultDashboardId) === t, c = !n || r;
|
|
1901
1905
|
return {
|
|
1902
|
-
available: !!
|
|
1906
|
+
available: !!t && !!(a != null && a.accessToken) && !!(o != null && o.apiServiceUrl),
|
|
1903
1907
|
isDefault: d,
|
|
1904
1908
|
disabled: c,
|
|
1905
1909
|
toggle: () => {
|
|
1906
|
-
!
|
|
1910
|
+
!t || c || i({ dashboardId: d ? null : t });
|
|
1907
1911
|
}
|
|
1908
1912
|
};
|
|
1909
1913
|
}
|
|
1910
|
-
function
|
|
1911
|
-
open:
|
|
1914
|
+
function xs({
|
|
1915
|
+
open: t,
|
|
1912
1916
|
onOpenChange: a,
|
|
1913
1917
|
onSave: o,
|
|
1914
1918
|
onDiscard: n,
|
|
@@ -1919,16 +1923,16 @@ function ys({
|
|
|
1919
1923
|
discardLabel: l = "Discard changes",
|
|
1920
1924
|
saveLabel: u = "Save"
|
|
1921
1925
|
}) {
|
|
1922
|
-
return /* @__PURE__ */
|
|
1926
|
+
return /* @__PURE__ */ e(dt, { open: t, onOpenChange: (m) => {
|
|
1923
1927
|
!m && i || a(m);
|
|
1924
1928
|
}, children: /* @__PURE__ */ s(ct, { children: [
|
|
1925
1929
|
/* @__PURE__ */ s(ut, { children: [
|
|
1926
|
-
/* @__PURE__ */
|
|
1927
|
-
/* @__PURE__ */
|
|
1930
|
+
/* @__PURE__ */ e(ht, { children: r }),
|
|
1931
|
+
/* @__PURE__ */ e(mt, { children: d })
|
|
1928
1932
|
] }),
|
|
1929
1933
|
/* @__PURE__ */ s(pt, { children: [
|
|
1930
|
-
/* @__PURE__ */
|
|
1931
|
-
|
|
1934
|
+
/* @__PURE__ */ e(
|
|
1935
|
+
T,
|
|
1932
1936
|
{
|
|
1933
1937
|
type: "button",
|
|
1934
1938
|
size: "xs",
|
|
@@ -1939,20 +1943,20 @@ function ys({
|
|
|
1939
1943
|
children: l
|
|
1940
1944
|
}
|
|
1941
1945
|
),
|
|
1942
|
-
/* @__PURE__ */
|
|
1943
|
-
/* @__PURE__ */
|
|
1944
|
-
/* @__PURE__ */
|
|
1946
|
+
/* @__PURE__ */ e(ft, { disabled: i, children: c }),
|
|
1947
|
+
/* @__PURE__ */ e(T, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ s(R, { children: [
|
|
1948
|
+
/* @__PURE__ */ e(ae, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
1945
1949
|
"Saving..."
|
|
1946
1950
|
] }) : u })
|
|
1947
1951
|
] })
|
|
1948
1952
|
] }) });
|
|
1949
1953
|
}
|
|
1950
|
-
async function
|
|
1954
|
+
async function ys(t) {
|
|
1951
1955
|
var r, d;
|
|
1952
1956
|
const a = (d = (r = w.getState()) == null ? void 0 : r.authToken) == null ? void 0 : d.accessToken;
|
|
1953
1957
|
if (!a)
|
|
1954
1958
|
return;
|
|
1955
|
-
const o = `${
|
|
1959
|
+
const o = `${t}/v1/invalidate-token`, n = await fetch(o, {
|
|
1956
1960
|
method: "POST",
|
|
1957
1961
|
headers: {
|
|
1958
1962
|
Authorization: `Bearer ${a}`
|
|
@@ -1963,116 +1967,97 @@ async function Cs(e) {
|
|
|
1963
1967
|
const i = await n.json();
|
|
1964
1968
|
return console.log("invalidateToken", i), i;
|
|
1965
1969
|
}
|
|
1966
|
-
function
|
|
1967
|
-
switch (e == null ? void 0 : e.kind) {
|
|
1968
|
-
case "queued":
|
|
1969
|
-
return { text: K.queued };
|
|
1970
|
-
case "preparing":
|
|
1971
|
-
return { text: K.preparing };
|
|
1972
|
-
case "fetching":
|
|
1973
|
-
return { text: K.fetchingRows(e.rowsProcessed) };
|
|
1974
|
-
case "finalizing":
|
|
1975
|
-
return { text: K.finalizing };
|
|
1976
|
-
case "processing":
|
|
1977
|
-
return e.percent === null ? { text: K.processing } : { text: K.processing, detail: K.percentComplete(e.percent), bar: e.percent };
|
|
1978
|
-
default:
|
|
1979
|
-
return { text: K.inProgress };
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
function nn(e) {
|
|
1970
|
+
function sn(t) {
|
|
1983
1971
|
var o;
|
|
1984
|
-
const a =
|
|
1972
|
+
const a = t.item;
|
|
1985
1973
|
return a.kind === "export" ? {
|
|
1986
1974
|
title: a.title,
|
|
1987
1975
|
status: a.status,
|
|
1988
1976
|
startedAt: a.startedAt,
|
|
1989
1977
|
finishedAt: a.finishedAt,
|
|
1990
|
-
running:
|
|
1978
|
+
running: Ra(a.stage),
|
|
1991
1979
|
finishedDetail: [
|
|
1992
1980
|
a.totalRows !== null ? `${a.totalRows.toLocaleString("en-US")} rows` : null,
|
|
1993
|
-
a.fileSize ?
|
|
1981
|
+
a.fileSize ? Oa(a.fileSize) : null
|
|
1994
1982
|
].filter((n) => !!n),
|
|
1995
|
-
failure: ((o = a.failure) == null ? void 0 : o.kind) === "export" ? a.failure.message : a.status === "failed" ?
|
|
1983
|
+
failure: ((o = a.failure) == null ? void 0 : o.kind) === "export" ? a.failure.message : a.status === "failed" ? ue.failedFallback : null,
|
|
1996
1984
|
note: null
|
|
1997
1985
|
} : {
|
|
1998
1986
|
title: a.title,
|
|
1999
1987
|
status: a.status,
|
|
2000
1988
|
startedAt: a.startedAt,
|
|
2001
1989
|
finishedAt: a.finishedAt,
|
|
2002
|
-
running: { text: a.stageLabel ??
|
|
1990
|
+
running: { text: a.stageLabel ?? ue.inProgress },
|
|
2003
1991
|
finishedDetail: [],
|
|
2004
1992
|
failure: null,
|
|
2005
|
-
note: a.omittedAttachmentCount > 0 ?
|
|
1993
|
+
note: a.omittedAttachmentCount > 0 ? le.attachmentsLeftOut(a.omittedAttachmentCount) : null
|
|
2006
1994
|
};
|
|
2007
1995
|
}
|
|
2008
|
-
function
|
|
2009
|
-
const [n, i] =
|
|
1996
|
+
function on({ row: t, now: a, api: o }) {
|
|
1997
|
+
const [n, i] = D("idle"), r = sn(t), d = Va(t, o), c = async () => {
|
|
2010
1998
|
if (!d) return;
|
|
2011
1999
|
i("working");
|
|
2012
|
-
const g = await
|
|
2000
|
+
const g = await za(o, t, d);
|
|
2013
2001
|
i(g === "done" ? "idle" : g);
|
|
2014
|
-
}, l = r.status === "ready" ? "bg-emerald-500" : r.status === "failed" ? "bg-destructive" : r.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", u = r.status === "ready" ?
|
|
2002
|
+
}, l = r.status === "ready" ? "bg-emerald-500" : r.status === "failed" ? "bg-destructive" : r.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", u = r.status === "ready" ? ue.ready : r.status === "failed" ? ue.failed : r.status === "cancelled" ? ue.cancelled : ue.inProgress, h = Date.parse(r.startedAt), m = Tt(Date.parse(r.finishedAt ?? r.startedAt), a, { addSuffix: !0 }), p = r.status === "running" && t.item.kind === "export" && a - h >= Ba, f = /* @__PURE__ */ e("span", { className: "text-muted-foreground/50", children: "·" });
|
|
2015
2003
|
return /* @__PURE__ */ s("div", { className: "group flex items-start gap-2.5 px-3 py-2 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
|
|
2016
|
-
/* @__PURE__ */
|
|
2017
|
-
/* @__PURE__ */
|
|
2004
|
+
/* @__PURE__ */ e("span", { className: "flex h-5 shrink-0 items-center", "aria-hidden": "true", children: /* @__PURE__ */ e("span", { className: `h-1.5 w-1.5 rounded-full ${l}` }) }),
|
|
2005
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: u }),
|
|
2018
2006
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
2019
2007
|
/* @__PURE__ */ s("div", { className: "flex h-5 items-center gap-2", children: [
|
|
2020
|
-
/* @__PURE__ */
|
|
2021
|
-
d && n === "working" && /* @__PURE__ */
|
|
2022
|
-
d && n !== "working" && /* @__PURE__ */
|
|
2008
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: r.title }),
|
|
2009
|
+
d && n === "working" && /* @__PURE__ */ e("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: /* @__PURE__ */ e(jt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }) }),
|
|
2010
|
+
d && n !== "working" && /* @__PURE__ */ e(
|
|
2023
2011
|
"button",
|
|
2024
2012
|
{
|
|
2025
2013
|
type: "button",
|
|
2026
2014
|
onClick: () => void c(),
|
|
2027
2015
|
className: "shrink-0 text-[12px] font-medium text-foreground/80 underline-offset-2 hover:text-foreground hover:underline focus-visible:underline focus-visible:outline-none",
|
|
2028
|
-
children:
|
|
2016
|
+
children: Pa[d]
|
|
2029
2017
|
}
|
|
2030
2018
|
)
|
|
2031
2019
|
] }),
|
|
2032
2020
|
r.status === "running" && r.running && /* @__PURE__ */ s("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
|
|
2033
|
-
/* @__PURE__ */
|
|
2034
|
-
r.running.detail && /* @__PURE__ */ s(
|
|
2021
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums", children: r.running.text }),
|
|
2022
|
+
r.running.detail && /* @__PURE__ */ s(R, { children: [
|
|
2035
2023
|
" ",
|
|
2036
2024
|
f,
|
|
2037
2025
|
" ",
|
|
2038
|
-
/* @__PURE__ */
|
|
2026
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums", children: r.running.detail })
|
|
2039
2027
|
] }),
|
|
2040
2028
|
" ",
|
|
2041
2029
|
f,
|
|
2042
2030
|
" ",
|
|
2043
|
-
/* @__PURE__ */
|
|
2044
|
-
r.running.
|
|
2045
|
-
p && /* @__PURE__ */
|
|
2031
|
+
/* @__PURE__ */ e("span", { children: ue.started(Tt(h, a)) }),
|
|
2032
|
+
r.running.percent !== void 0 && /* @__PURE__ */ e(Ma, { value: r.running.percent, className: "mt-1.5 h-1" }),
|
|
2033
|
+
p && /* @__PURE__ */ e("div", { className: "mt-1", children: ue.longRunning })
|
|
2046
2034
|
] }),
|
|
2047
2035
|
r.status !== "running" && /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
|
|
2048
2036
|
r.status === "ready" && r.finishedDetail.length > 0 ? (
|
|
2049
2037
|
// Disclosed on hover or focus only; the time is what a reader scans.
|
|
2050
2038
|
/* @__PURE__ */ s("span", { className: "hidden group-hover:contents group-focus-within:contents", children: [
|
|
2051
|
-
r.finishedDetail.map((g,
|
|
2052
|
-
|
|
2053
|
-
/* @__PURE__ */
|
|
2054
|
-
] },
|
|
2039
|
+
r.finishedDetail.map((g, x) => /* @__PURE__ */ s(Mt.Fragment, { children: [
|
|
2040
|
+
x > 0 && f,
|
|
2041
|
+
/* @__PURE__ */ e("span", { children: g })
|
|
2042
|
+
] }, x)),
|
|
2055
2043
|
f
|
|
2056
2044
|
] })
|
|
2057
|
-
) : r.status !== "ready" ? /* @__PURE__ */ s(
|
|
2058
|
-
/* @__PURE__ */
|
|
2045
|
+
) : r.status !== "ready" ? /* @__PURE__ */ s(R, { children: [
|
|
2046
|
+
/* @__PURE__ */ e("span", { children: u }),
|
|
2059
2047
|
f
|
|
2060
2048
|
] }) : null,
|
|
2061
|
-
/* @__PURE__ */
|
|
2049
|
+
/* @__PURE__ */ e("span", { children: m })
|
|
2062
2050
|
] }),
|
|
2063
|
-
r.note && /* @__PURE__ */
|
|
2064
|
-
r.status === "failed" && r.failure && /* @__PURE__ */
|
|
2065
|
-
(n === "denied" || n === "blocked") && /* @__PURE__ */
|
|
2066
|
-
/* @__PURE__ */ t(Va, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
|
|
2067
|
-
/* @__PURE__ */ t("span", { children: Ba(n) })
|
|
2068
|
-
] })
|
|
2051
|
+
r.note && /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-muted-foreground", children: r.note }),
|
|
2052
|
+
r.status === "failed" && r.failure && /* @__PURE__ */ e("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: r.failure }),
|
|
2053
|
+
(n === "denied" || n === "blocked") && /* @__PURE__ */ e(Ua, { problem: n, className: "mt-1" })
|
|
2069
2054
|
] })
|
|
2070
2055
|
] });
|
|
2071
2056
|
}
|
|
2072
|
-
function
|
|
2073
|
-
const { snapshot: a, markSeen: o } = yt(), n = a.runningCount > 0 ? a.runningCount > 9 ? "9+" : String(a.runningCount) : a.hasUnseenFinished ? "" : null, i =
|
|
2074
|
-
label:
|
|
2075
|
-
icon: /* @__PURE__ */
|
|
2057
|
+
function Cs({ variant: t }) {
|
|
2058
|
+
const { snapshot: a, markSeen: o } = yt(), n = a.runningCount > 0 ? a.runningCount > 9 ? "9+" : String(a.runningCount) : a.hasUnseenFinished ? "" : null, i = Xt("activity", "md", {
|
|
2059
|
+
label: le.title,
|
|
2060
|
+
icon: /* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5" }),
|
|
2076
2061
|
hint: n || (n === "" ? "New" : void 0),
|
|
2077
2062
|
order: 30,
|
|
2078
2063
|
onOpen: o
|
|
@@ -2085,18 +2070,18 @@ function ws({ variant: e }) {
|
|
|
2085
2070
|
i.setPopoverOpen(r), r && o();
|
|
2086
2071
|
},
|
|
2087
2072
|
children: [
|
|
2088
|
-
i.anchorSlot &&
|
|
2089
|
-
/* @__PURE__ */
|
|
2073
|
+
i.anchorSlot && Dr(
|
|
2074
|
+
/* @__PURE__ */ e(br, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "absolute right-0 top-0 h-7 w-px" }) }),
|
|
2090
2075
|
i.anchorSlot
|
|
2091
2076
|
),
|
|
2092
|
-
/* @__PURE__ */
|
|
2077
|
+
/* @__PURE__ */ e(
|
|
2093
2078
|
Fe,
|
|
2094
2079
|
{
|
|
2095
2080
|
className: "w-80 p-0",
|
|
2096
2081
|
align: "end",
|
|
2097
2082
|
sideOffset: 8,
|
|
2098
2083
|
onFocusOutside: (r) => r.preventDefault(),
|
|
2099
|
-
children: /* @__PURE__ */
|
|
2084
|
+
children: /* @__PURE__ */ e(Pt, {})
|
|
2100
2085
|
}
|
|
2101
2086
|
)
|
|
2102
2087
|
]
|
|
@@ -2104,17 +2089,17 @@ function ws({ variant: e }) {
|
|
|
2104
2089
|
) : /* @__PURE__ */ s(Ae, { onOpenChange: (r) => {
|
|
2105
2090
|
r && o();
|
|
2106
2091
|
}, children: [
|
|
2107
|
-
/* @__PURE__ */
|
|
2108
|
-
|
|
2092
|
+
/* @__PURE__ */ e(qe, { asChild: !0, children: /* @__PURE__ */ s(
|
|
2093
|
+
T,
|
|
2109
2094
|
{
|
|
2110
|
-
variant:
|
|
2095
|
+
variant: t ?? "ghost",
|
|
2111
2096
|
size: "xs",
|
|
2112
2097
|
className: "relative w-7 px-0",
|
|
2113
|
-
"aria-label":
|
|
2114
|
-
title:
|
|
2098
|
+
"aria-label": le.title,
|
|
2099
|
+
title: le.title,
|
|
2115
2100
|
children: [
|
|
2116
|
-
/* @__PURE__ */
|
|
2117
|
-
n !== null && /* @__PURE__ */
|
|
2101
|
+
/* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5" }),
|
|
2102
|
+
n !== null && /* @__PURE__ */ e(
|
|
2118
2103
|
"span",
|
|
2119
2104
|
{
|
|
2120
2105
|
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${n ? "-right-0.5 -top-0.5 h-3.5 min-w-3.5 px-0.5 text-[9px] font-semibold" : "right-1 top-1 h-1.5 w-1.5"}`,
|
|
@@ -2124,59 +2109,59 @@ function ws({ variant: e }) {
|
|
|
2124
2109
|
]
|
|
2125
2110
|
}
|
|
2126
2111
|
) }),
|
|
2127
|
-
/* @__PURE__ */
|
|
2112
|
+
/* @__PURE__ */ e(Fe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ e(Pt, {}) })
|
|
2128
2113
|
] });
|
|
2129
2114
|
}
|
|
2130
|
-
function
|
|
2131
|
-
const
|
|
2115
|
+
function Pt() {
|
|
2116
|
+
const t = yt(), a = _a(), { rows: o, activeTruncated: n } = t.snapshot, i = o.some((r) => ja(r.item.status));
|
|
2132
2117
|
return o.length === 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-1.5 px-6 py-8 text-center", children: [
|
|
2133
|
-
/* @__PURE__ */
|
|
2134
|
-
/* @__PURE__ */
|
|
2135
|
-
/* @__PURE__ */
|
|
2118
|
+
/* @__PURE__ */ e("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ e($a, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
|
|
2119
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: le.title }),
|
|
2120
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: le.empty })
|
|
2136
2121
|
] }) : /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
|
|
2137
2122
|
/* @__PURE__ */ s("div", { className: "flex h-8 items-center gap-2 border-b border-border px-3", children: [
|
|
2138
|
-
/* @__PURE__ */
|
|
2139
|
-
/* @__PURE__ */
|
|
2123
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: le.title }),
|
|
2124
|
+
/* @__PURE__ */ e("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: o.length }),
|
|
2140
2125
|
/* @__PURE__ */ s("div", { className: "ml-auto flex items-center gap-0.5", children: [
|
|
2141
|
-
i && /* @__PURE__ */
|
|
2142
|
-
|
|
2126
|
+
i && /* @__PURE__ */ e(
|
|
2127
|
+
T,
|
|
2143
2128
|
{
|
|
2144
2129
|
variant: "ghost",
|
|
2145
2130
|
size: "xs",
|
|
2146
2131
|
className: "h-6 px-1.5 text-[12px] text-muted-foreground hover:text-foreground",
|
|
2147
|
-
onClick:
|
|
2148
|
-
children:
|
|
2132
|
+
onClick: t.clearFinished,
|
|
2133
|
+
children: le.clear
|
|
2149
2134
|
}
|
|
2150
2135
|
),
|
|
2151
|
-
/* @__PURE__ */
|
|
2152
|
-
|
|
2136
|
+
/* @__PURE__ */ e(
|
|
2137
|
+
T,
|
|
2153
2138
|
{
|
|
2154
2139
|
variant: "ghost",
|
|
2155
2140
|
size: "xs",
|
|
2156
2141
|
className: "h-6 w-6 px-0 text-muted-foreground hover:text-foreground",
|
|
2157
|
-
onClick:
|
|
2142
|
+
onClick: t.refresh,
|
|
2158
2143
|
title: "Refresh status",
|
|
2159
2144
|
"aria-label": "Refresh status",
|
|
2160
|
-
children: /* @__PURE__ */
|
|
2145
|
+
children: /* @__PURE__ */ e(jt, { strokeWidth: 1.75, className: "h-3.5 w-3.5" })
|
|
2161
2146
|
}
|
|
2162
2147
|
)
|
|
2163
2148
|
] })
|
|
2164
2149
|
] }),
|
|
2165
|
-
n && /* @__PURE__ */
|
|
2166
|
-
/* @__PURE__ */
|
|
2150
|
+
n && /* @__PURE__ */ e("p", { className: "border-b border-border px-3 py-2 text-[12px] leading-4 text-muted-foreground", children: le.truncated }),
|
|
2151
|
+
/* @__PURE__ */ e("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y divide-border/70", children: o.map((r) => /* @__PURE__ */ e(on, { row: r, now: a, api: t }, Wa(r))) }) })
|
|
2167
2152
|
] });
|
|
2168
2153
|
}
|
|
2169
|
-
function
|
|
2170
|
-
if (
|
|
2154
|
+
function ln(t) {
|
|
2155
|
+
if (t)
|
|
2171
2156
|
return {
|
|
2172
|
-
renamed:
|
|
2173
|
-
removedControlId:
|
|
2174
|
-
cardBindingsById:
|
|
2175
|
-
affectedBindingControlIds:
|
|
2157
|
+
renamed: t.type === "rename" ? { oldId: t.oldId, newId: t.newId } : void 0,
|
|
2158
|
+
removedControlId: t.type === "remove" ? t.controlId : void 0,
|
|
2159
|
+
cardBindingsById: t.type === "add" || t.type === "update" ? t.cardBindingsById : void 0,
|
|
2160
|
+
affectedBindingControlIds: t.type === "add" || t.type === "update" ? t.affectedBindingControlIds : void 0
|
|
2176
2161
|
};
|
|
2177
2162
|
}
|
|
2178
|
-
function
|
|
2179
|
-
open:
|
|
2163
|
+
function dn({
|
|
2164
|
+
open: t,
|
|
2180
2165
|
onOpenChange: a,
|
|
2181
2166
|
trigger: o,
|
|
2182
2167
|
showTrigger: n = !0,
|
|
@@ -2189,8 +2174,8 @@ function ln({
|
|
|
2189
2174
|
preventPassiveDismissDuringCreate: u,
|
|
2190
2175
|
resolvedOpen: h,
|
|
2191
2176
|
setIsCreateFlowActive: m
|
|
2192
|
-
} =
|
|
2193
|
-
open:
|
|
2177
|
+
} = Kt({
|
|
2178
|
+
open: t,
|
|
2194
2179
|
onOpenChange: a,
|
|
2195
2180
|
initialCreateFlowActive: i === "create",
|
|
2196
2181
|
// Dialog mode renders a built-in X close button — allow explicit
|
|
@@ -2200,92 +2185,92 @@ function ln({
|
|
|
2200
2185
|
// create and make consumers use `forceClose()` from a dedicated
|
|
2201
2186
|
// button.
|
|
2202
2187
|
dismissMode: n ? "passive" : "explicit-only"
|
|
2203
|
-
}), p = w((C) => C.dashboard), { setDashboardControlsModel: f } =
|
|
2188
|
+
}), p = w((C) => C.dashboard), { setDashboardControlsModel: f } = de(), { participants: g } = qa(Ar(p)), x = Array.from(
|
|
2204
2189
|
new Map(
|
|
2205
2190
|
g.flatMap(
|
|
2206
|
-
(C) => C.fieldChoices.map((
|
|
2207
|
-
var
|
|
2191
|
+
(C) => C.fieldChoices.map((A) => {
|
|
2192
|
+
var k;
|
|
2208
2193
|
return [
|
|
2209
|
-
|
|
2194
|
+
A.value,
|
|
2210
2195
|
{
|
|
2211
|
-
option:
|
|
2212
|
-
target: (
|
|
2196
|
+
option: A,
|
|
2197
|
+
target: (k = C.fieldTargetMap) == null ? void 0 : k[A.value]
|
|
2213
2198
|
}
|
|
2214
2199
|
];
|
|
2215
2200
|
})
|
|
2216
2201
|
)
|
|
2217
2202
|
).values()
|
|
2218
|
-
),
|
|
2203
|
+
), N = Array.from(
|
|
2219
2204
|
new Map(
|
|
2220
2205
|
g.flatMap(
|
|
2221
|
-
(C) => C.metricChoices.map((
|
|
2222
|
-
var
|
|
2206
|
+
(C) => C.metricChoices.map((A) => {
|
|
2207
|
+
var k;
|
|
2223
2208
|
return [
|
|
2224
|
-
|
|
2209
|
+
A.value,
|
|
2225
2210
|
{
|
|
2226
|
-
option:
|
|
2227
|
-
target: (
|
|
2211
|
+
option: A,
|
|
2212
|
+
target: (k = C.metricTargetMap) == null ? void 0 : k[A.value]
|
|
2228
2213
|
}
|
|
2229
2214
|
];
|
|
2230
2215
|
})
|
|
2231
2216
|
)
|
|
2232
2217
|
).values()
|
|
2233
|
-
),
|
|
2218
|
+
), S = Cr({
|
|
2234
2219
|
...p || {},
|
|
2235
2220
|
controls: []
|
|
2236
|
-
}),
|
|
2221
|
+
}), M = Ha(p), U = (C, A, k) => {
|
|
2237
2222
|
f(
|
|
2238
2223
|
C,
|
|
2239
|
-
|
|
2240
|
-
|
|
2224
|
+
A,
|
|
2225
|
+
ln(k)
|
|
2241
2226
|
);
|
|
2242
|
-
},
|
|
2227
|
+
}, F = Y(() => {
|
|
2243
2228
|
if (r) {
|
|
2244
2229
|
d();
|
|
2245
2230
|
return;
|
|
2246
2231
|
}
|
|
2247
2232
|
m(!1);
|
|
2248
|
-
}, [r, d, m]), O = /* @__PURE__ */
|
|
2249
|
-
|
|
2233
|
+
}, [r, d, m]), O = /* @__PURE__ */ e(
|
|
2234
|
+
Gt,
|
|
2250
2235
|
{
|
|
2251
2236
|
scope: "dashboard",
|
|
2252
2237
|
controls: p.controls || [],
|
|
2253
|
-
reservedControlIds:
|
|
2238
|
+
reservedControlIds: S,
|
|
2254
2239
|
defaultValues: p.defaultControlValues || {},
|
|
2255
|
-
usageByControlId:
|
|
2256
|
-
availableFieldChoices:
|
|
2257
|
-
availableMetricChoices:
|
|
2240
|
+
usageByControlId: Qa(p),
|
|
2241
|
+
availableFieldChoices: x,
|
|
2242
|
+
availableMetricChoices: N,
|
|
2258
2243
|
structuralParticipants: g,
|
|
2259
|
-
structuralParticipantIdsByControlId:
|
|
2244
|
+
structuralParticipantIdsByControlId: M,
|
|
2260
2245
|
initialCreateFlow: i === "create",
|
|
2261
2246
|
onCreateFlowActiveChange: m,
|
|
2262
|
-
onCreateFlowComplete:
|
|
2263
|
-
onChange:
|
|
2247
|
+
onCreateFlowComplete: F,
|
|
2248
|
+
onChange: U,
|
|
2264
2249
|
emptyMessage: "No dashboard controls yet."
|
|
2265
2250
|
}
|
|
2266
|
-
), b = l ? "Add dashboard control" : "Dashboard Controls",
|
|
2251
|
+
), b = l ? "Add dashboard control" : "Dashboard Controls", I = /* @__PURE__ */ s(R, { children: [
|
|
2267
2252
|
/* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
2268
|
-
/* @__PURE__ */
|
|
2269
|
-
/* @__PURE__ */
|
|
2253
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
2254
|
+
/* @__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." })
|
|
2270
2255
|
] }),
|
|
2271
2256
|
O
|
|
2272
2257
|
] });
|
|
2273
2258
|
return n ? /* @__PURE__ */ s(Ae, { open: h, onOpenChange: c, children: [
|
|
2274
|
-
/* @__PURE__ */
|
|
2275
|
-
/* @__PURE__ */
|
|
2259
|
+
/* @__PURE__ */ e(qe, { asChild: !0, children: o || /* @__PURE__ */ s(T, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
2260
|
+
/* @__PURE__ */ e(Ht, { className: "mr-2 h-4 w-4" }),
|
|
2276
2261
|
"Controls"
|
|
2277
2262
|
] }) }),
|
|
2278
|
-
/* @__PURE__ */
|
|
2263
|
+
/* @__PURE__ */ e(
|
|
2279
2264
|
Fe,
|
|
2280
2265
|
{
|
|
2281
2266
|
className: "w-[620px] max-w-[95vw] space-y-4",
|
|
2282
2267
|
align: "end",
|
|
2283
2268
|
onEscapeKeyDown: u,
|
|
2284
2269
|
onPointerDownOutside: u,
|
|
2285
|
-
children:
|
|
2270
|
+
children: I
|
|
2286
2271
|
}
|
|
2287
2272
|
)
|
|
2288
|
-
] }) : /* @__PURE__ */
|
|
2273
|
+
] }) : /* @__PURE__ */ e(Ie, { open: h, onOpenChange: c, children: /* @__PURE__ */ s(
|
|
2289
2274
|
Te,
|
|
2290
2275
|
{
|
|
2291
2276
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
@@ -2297,9 +2282,9 @@ function ln({
|
|
|
2297
2282
|
{
|
|
2298
2283
|
className: l ? "space-y-0" : void 0,
|
|
2299
2284
|
children: [
|
|
2300
|
-
/* @__PURE__ */
|
|
2301
|
-
/* @__PURE__ */
|
|
2302
|
-
|
|
2285
|
+
/* @__PURE__ */ e(Le, { className: "text-[15px]", children: b }),
|
|
2286
|
+
/* @__PURE__ */ e(
|
|
2287
|
+
vt,
|
|
2303
2288
|
{
|
|
2304
2289
|
className: l ? "sr-only" : "text-[13px]",
|
|
2305
2290
|
children: l ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
|
|
@@ -2308,12 +2293,12 @@ function ln({
|
|
|
2308
2293
|
]
|
|
2309
2294
|
}
|
|
2310
2295
|
),
|
|
2311
|
-
/* @__PURE__ */
|
|
2296
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: O })
|
|
2312
2297
|
]
|
|
2313
2298
|
}
|
|
2314
2299
|
) });
|
|
2315
2300
|
}
|
|
2316
|
-
const
|
|
2301
|
+
const cn = [
|
|
2317
2302
|
"enum",
|
|
2318
2303
|
"multi_enum",
|
|
2319
2304
|
"text",
|
|
@@ -2321,12 +2306,12 @@ const dn = [
|
|
|
2321
2306
|
"boolean",
|
|
2322
2307
|
"date"
|
|
2323
2308
|
];
|
|
2324
|
-
function
|
|
2325
|
-
open:
|
|
2309
|
+
function un({
|
|
2310
|
+
open: t,
|
|
2326
2311
|
onOpenChange: a,
|
|
2327
2312
|
initialMode: o = "manage"
|
|
2328
2313
|
}) {
|
|
2329
|
-
var
|
|
2314
|
+
var I;
|
|
2330
2315
|
const n = o === "create", {
|
|
2331
2316
|
forceClose: i,
|
|
2332
2317
|
handleOpenChange: r,
|
|
@@ -2334,58 +2319,58 @@ function cn({
|
|
|
2334
2319
|
preventPassiveDismissDuringCreate: c,
|
|
2335
2320
|
resolvedOpen: l,
|
|
2336
2321
|
setIsCreateFlowActive: u
|
|
2337
|
-
} =
|
|
2338
|
-
open:
|
|
2322
|
+
} = Kt({
|
|
2323
|
+
open: t,
|
|
2339
2324
|
onOpenChange: a,
|
|
2340
2325
|
initialCreateFlowActive: o === "create",
|
|
2341
2326
|
dismissMode: "explicit-only"
|
|
2342
|
-
}), h = w((C) => C.dashboard), m = w((C) => C.selectedSheetId), { setDashboardInputs: p } =
|
|
2327
|
+
}), h = w((C) => C.dashboard), m = w((C) => C.selectedSheetId), { setDashboardInputs: p } = de(), f = (I = h.sheets) == null ? void 0 : I.find(
|
|
2343
2328
|
(C) => C.id === m
|
|
2344
|
-
), g = (f == null ? void 0 : f.kind) === "document" && !!f.document,
|
|
2345
|
-
() => g && (f != null && f.document) ?
|
|
2329
|
+
), g = (f == null ? void 0 : f.kind) === "document" && !!f.document, x = ee(
|
|
2330
|
+
() => g && (f != null && f.document) ? Br(h, f.id) : [],
|
|
2346
2331
|
[h, g, f == null ? void 0 : f.document, f == null ? void 0 : f.id]
|
|
2347
|
-
),
|
|
2348
|
-
() =>
|
|
2332
|
+
), N = ee(
|
|
2333
|
+
() => x.filter(
|
|
2349
2334
|
(C) => C.kind === "control"
|
|
2350
2335
|
),
|
|
2351
|
-
[
|
|
2352
|
-
),
|
|
2353
|
-
() =>
|
|
2354
|
-
[
|
|
2355
|
-
),
|
|
2356
|
-
() =>
|
|
2357
|
-
[
|
|
2358
|
-
),
|
|
2359
|
-
() =>
|
|
2336
|
+
[x]
|
|
2337
|
+
), S = ee(
|
|
2338
|
+
() => N.map((C) => C.control),
|
|
2339
|
+
[N]
|
|
2340
|
+
), M = ee(
|
|
2341
|
+
() => mn(S),
|
|
2342
|
+
[S]
|
|
2343
|
+
), U = ee(
|
|
2344
|
+
() => hn(h),
|
|
2360
2345
|
[h]
|
|
2361
|
-
),
|
|
2346
|
+
), F = Y(() => {
|
|
2362
2347
|
if (n) {
|
|
2363
2348
|
i();
|
|
2364
2349
|
return;
|
|
2365
2350
|
}
|
|
2366
2351
|
u(!1);
|
|
2367
|
-
}, [n, i, u]), O =
|
|
2368
|
-
(C,
|
|
2352
|
+
}, [n, i, u]), O = Y(
|
|
2353
|
+
(C, A, k) => {
|
|
2369
2354
|
!g || !(f != null && f.document) || p(
|
|
2370
|
-
|
|
2355
|
+
fn({
|
|
2371
2356
|
allInputs: h.inputs || [],
|
|
2372
2357
|
documentSheetId: f.id,
|
|
2373
|
-
currentDocumentInputs:
|
|
2358
|
+
currentDocumentInputs: x,
|
|
2374
2359
|
nextControls: C,
|
|
2375
|
-
nextDefaultValues:
|
|
2376
|
-
change:
|
|
2360
|
+
nextDefaultValues: A,
|
|
2361
|
+
change: k
|
|
2377
2362
|
})
|
|
2378
2363
|
);
|
|
2379
2364
|
},
|
|
2380
2365
|
[
|
|
2381
2366
|
h.inputs,
|
|
2382
|
-
|
|
2367
|
+
x,
|
|
2383
2368
|
g,
|
|
2384
2369
|
f,
|
|
2385
2370
|
p
|
|
2386
2371
|
]
|
|
2387
2372
|
);
|
|
2388
|
-
return !g || !(f != null && f.document) ? null : /* @__PURE__ */
|
|
2373
|
+
return !g || !(f != null && f.document) ? null : /* @__PURE__ */ e(Ie, { open: l, onOpenChange: r, children: /* @__PURE__ */ s(
|
|
2389
2374
|
Te,
|
|
2390
2375
|
{
|
|
2391
2376
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
@@ -2393,31 +2378,31 @@ function cn({
|
|
|
2393
2378
|
onPointerDownOutside: c,
|
|
2394
2379
|
children: [
|
|
2395
2380
|
/* @__PURE__ */ s(bt, { className: d ? "space-y-0" : void 0, children: [
|
|
2396
|
-
/* @__PURE__ */
|
|
2397
|
-
/* @__PURE__ */
|
|
2398
|
-
|
|
2381
|
+
/* @__PURE__ */ e(Le, { className: "text-[15px]", children: d ? "Add document control" : "Document Controls" }),
|
|
2382
|
+
/* @__PURE__ */ e(
|
|
2383
|
+
vt,
|
|
2399
2384
|
{
|
|
2400
2385
|
className: d ? "sr-only" : "text-[13px]",
|
|
2401
2386
|
children: d ? "Configure and add a document-local control input." : "Add document-local control inputs. They are stored on this document sheet and are not dashboard controls."
|
|
2402
2387
|
}
|
|
2403
2388
|
)
|
|
2404
2389
|
] }),
|
|
2405
|
-
/* @__PURE__ */
|
|
2406
|
-
|
|
2390
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ e(
|
|
2391
|
+
Gt,
|
|
2407
2392
|
{
|
|
2408
2393
|
scope: "dashboard",
|
|
2409
|
-
controls:
|
|
2410
|
-
reservedControlIds:
|
|
2411
|
-
defaultValues:
|
|
2394
|
+
controls: S,
|
|
2395
|
+
reservedControlIds: U,
|
|
2396
|
+
defaultValues: M,
|
|
2412
2397
|
usageByControlId: {},
|
|
2413
2398
|
availableFieldChoices: [],
|
|
2414
2399
|
availableMetricChoices: [],
|
|
2415
2400
|
structuralParticipants: [],
|
|
2416
2401
|
structuralParticipantIdsByControlId: {},
|
|
2417
|
-
allowedControlTypes:
|
|
2402
|
+
allowedControlTypes: cn,
|
|
2418
2403
|
initialCreateFlow: o === "create",
|
|
2419
2404
|
onCreateFlowActiveChange: u,
|
|
2420
|
-
onCreateFlowComplete:
|
|
2405
|
+
onCreateFlowComplete: F,
|
|
2421
2406
|
onChange: O,
|
|
2422
2407
|
emptyMessage: "No document controls yet."
|
|
2423
2408
|
}
|
|
@@ -2426,23 +2411,23 @@ function cn({
|
|
|
2426
2411
|
}
|
|
2427
2412
|
) });
|
|
2428
2413
|
}
|
|
2429
|
-
function
|
|
2430
|
-
return (
|
|
2414
|
+
function hn(t) {
|
|
2415
|
+
return (t.controls || []).map((a) => a.id);
|
|
2431
2416
|
}
|
|
2432
|
-
function
|
|
2417
|
+
function mn(t) {
|
|
2433
2418
|
const a = {};
|
|
2434
|
-
for (const o of
|
|
2419
|
+
for (const o of t)
|
|
2435
2420
|
o.defaultValue !== void 0 && (a[o.id] = o.defaultValue);
|
|
2436
2421
|
return a;
|
|
2437
2422
|
}
|
|
2438
|
-
function
|
|
2439
|
-
return a ? Object.prototype.hasOwnProperty.call(a,
|
|
2440
|
-
...
|
|
2441
|
-
defaultValue: a[
|
|
2442
|
-
} :
|
|
2423
|
+
function pn(t, a) {
|
|
2424
|
+
return a ? Object.prototype.hasOwnProperty.call(a, t.id) ? {
|
|
2425
|
+
...t,
|
|
2426
|
+
defaultValue: a[t.id]
|
|
2427
|
+
} : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 } : t.defaultValue === void 0 ? t : { ...t, defaultValue: void 0 };
|
|
2443
2428
|
}
|
|
2444
|
-
function
|
|
2445
|
-
allInputs:
|
|
2429
|
+
function fn({
|
|
2430
|
+
allInputs: t,
|
|
2446
2431
|
documentSheetId: a,
|
|
2447
2432
|
currentDocumentInputs: o,
|
|
2448
2433
|
nextControls: n,
|
|
@@ -2452,7 +2437,7 @@ function pn({
|
|
|
2452
2437
|
const d = new Map(
|
|
2453
2438
|
n.map((p) => [
|
|
2454
2439
|
p.id,
|
|
2455
|
-
|
|
2440
|
+
pn(p, i)
|
|
2456
2441
|
])
|
|
2457
2442
|
), c = (r == null ? void 0 : r.type) === "rename" ? { oldId: r.oldId, newId: r.newId } : null, l = /* @__PURE__ */ new Set(), u = [];
|
|
2458
2443
|
for (const p of o) {
|
|
@@ -2464,37 +2449,37 @@ function pn({
|
|
|
2464
2449
|
if (!f)
|
|
2465
2450
|
continue;
|
|
2466
2451
|
l.add(f.id);
|
|
2467
|
-
const g =
|
|
2452
|
+
const g = wr(
|
|
2468
2453
|
f.id,
|
|
2469
|
-
[...
|
|
2470
|
-
(
|
|
2454
|
+
[...t, ...u].filter(
|
|
2455
|
+
(N) => N.id !== p.id
|
|
2471
2456
|
)
|
|
2472
|
-
),
|
|
2457
|
+
), x = f.id === g ? f : { ...f, id: g };
|
|
2473
2458
|
u.push({
|
|
2474
2459
|
...p,
|
|
2475
|
-
label:
|
|
2460
|
+
label: x.label,
|
|
2476
2461
|
variableName: g,
|
|
2477
|
-
requiredAtExecution:
|
|
2478
|
-
control:
|
|
2462
|
+
requiredAtExecution: x.requiredAtExecution,
|
|
2463
|
+
control: x
|
|
2479
2464
|
});
|
|
2480
2465
|
}
|
|
2481
2466
|
for (const p of d.values())
|
|
2482
2467
|
l.has(p.id) || u.push(
|
|
2483
|
-
|
|
2468
|
+
Pr({
|
|
2484
2469
|
control: p,
|
|
2485
|
-
existingInputs: [...
|
|
2470
|
+
existingInputs: [...t, ...u],
|
|
2486
2471
|
sheetId: a
|
|
2487
2472
|
})
|
|
2488
2473
|
);
|
|
2489
2474
|
const h = new Set(
|
|
2490
2475
|
o.map((p) => p.id)
|
|
2491
2476
|
);
|
|
2492
|
-
return [...
|
|
2477
|
+
return [...t.filter(
|
|
2493
2478
|
(p) => !h.has(p.id)
|
|
2494
2479
|
), ...u];
|
|
2495
2480
|
}
|
|
2496
|
-
function
|
|
2497
|
-
showFilters:
|
|
2481
|
+
function gn({
|
|
2482
|
+
showFilters: t,
|
|
2498
2483
|
onShowFiltersChange: a,
|
|
2499
2484
|
pickerContent: o,
|
|
2500
2485
|
settingsContent: n,
|
|
@@ -2505,11 +2490,11 @@ function fn({
|
|
|
2505
2490
|
pickerContentClassName: l,
|
|
2506
2491
|
settingsContentClassName: u
|
|
2507
2492
|
}) {
|
|
2508
|
-
const h = i === "toolbar", [m, p] =
|
|
2493
|
+
const h = i === "toolbar", [m, p] = D(!1), f = ot("interactive");
|
|
2509
2494
|
return /* @__PURE__ */ s(
|
|
2510
2495
|
"div",
|
|
2511
2496
|
{
|
|
2512
|
-
className:
|
|
2497
|
+
className: J(
|
|
2513
2498
|
// Height lives on the shell so the outer border is part of the
|
|
2514
2499
|
// h-7 box (matches regular `size="xs"` buttons). Inner triggers
|
|
2515
2500
|
// stretch to fill via `h-full`.
|
|
@@ -2518,28 +2503,28 @@ function fn({
|
|
|
2518
2503
|
r
|
|
2519
2504
|
),
|
|
2520
2505
|
children: [
|
|
2521
|
-
/* @__PURE__ */ s(Ae, { open:
|
|
2522
|
-
/* @__PURE__ */
|
|
2523
|
-
|
|
2506
|
+
/* @__PURE__ */ s(Ae, { open: t, onOpenChange: a, children: [
|
|
2507
|
+
/* @__PURE__ */ e(qe, { asChild: !0, children: /* @__PURE__ */ s(
|
|
2508
|
+
T,
|
|
2524
2509
|
{
|
|
2525
2510
|
variant: "ghost",
|
|
2526
2511
|
size: "xs",
|
|
2527
|
-
className:
|
|
2512
|
+
className: J(
|
|
2528
2513
|
"h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
|
|
2529
2514
|
d
|
|
2530
2515
|
),
|
|
2531
2516
|
children: [
|
|
2532
|
-
|
|
2517
|
+
t ? /* @__PURE__ */ e(Tr, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e($t, { className: "h-3.5 w-3.5" }),
|
|
2533
2518
|
"Filter"
|
|
2534
2519
|
]
|
|
2535
2520
|
}
|
|
2536
2521
|
) }),
|
|
2537
|
-
/* @__PURE__ */
|
|
2522
|
+
/* @__PURE__ */ e(
|
|
2538
2523
|
Fe,
|
|
2539
2524
|
{
|
|
2540
2525
|
align: "end",
|
|
2541
2526
|
sideOffset: 6,
|
|
2542
|
-
className:
|
|
2527
|
+
className: J(
|
|
2543
2528
|
"w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
|
|
2544
2529
|
l
|
|
2545
2530
|
),
|
|
@@ -2549,25 +2534,25 @@ function fn({
|
|
|
2549
2534
|
)
|
|
2550
2535
|
] }),
|
|
2551
2536
|
/* @__PURE__ */ s(Ae, { open: m, onOpenChange: p, children: [
|
|
2552
|
-
/* @__PURE__ */
|
|
2553
|
-
|
|
2537
|
+
/* @__PURE__ */ e(qe, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2538
|
+
T,
|
|
2554
2539
|
{
|
|
2555
2540
|
variant: "ghost",
|
|
2556
2541
|
size: "xs",
|
|
2557
|
-
className:
|
|
2542
|
+
className: J(
|
|
2558
2543
|
"h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
|
|
2559
2544
|
c
|
|
2560
2545
|
),
|
|
2561
2546
|
"aria-label": "Filter and control actions",
|
|
2562
|
-
children: /* @__PURE__ */
|
|
2547
|
+
children: /* @__PURE__ */ e(wt, { className: "h-3.5 w-3.5" })
|
|
2563
2548
|
}
|
|
2564
2549
|
) }),
|
|
2565
|
-
/* @__PURE__ */
|
|
2550
|
+
/* @__PURE__ */ e(
|
|
2566
2551
|
Fe,
|
|
2567
2552
|
{
|
|
2568
2553
|
align: "end",
|
|
2569
2554
|
sideOffset: 6,
|
|
2570
|
-
className:
|
|
2555
|
+
className: J(
|
|
2571
2556
|
"w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
|
|
2572
2557
|
u
|
|
2573
2558
|
),
|
|
@@ -2580,96 +2565,96 @@ function fn({
|
|
|
2580
2565
|
}
|
|
2581
2566
|
);
|
|
2582
2567
|
}
|
|
2583
|
-
function
|
|
2584
|
-
|
|
2585
|
-
const
|
|
2586
|
-
return
|
|
2568
|
+
function bn() {
|
|
2569
|
+
Lr();
|
|
2570
|
+
const t = w((l) => l.selectedSheetId), a = w((l) => l.selectedFrameId), o = w((l) => l.dashboard), n = w((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = de(), { setCard: r } = Ge(), d = Z((l) => l.card.dataSource);
|
|
2571
|
+
return ve(() => {
|
|
2587
2572
|
var u, h;
|
|
2588
2573
|
let l = n();
|
|
2589
2574
|
if (!l) {
|
|
2590
|
-
const m = (u = o == null ? void 0 : o.sheets) == null ? void 0 : u.find((f) => f.id ===
|
|
2575
|
+
const m = (u = o == null ? void 0 : o.sheets) == null ? void 0 : u.find((f) => f.id === t), p = (h = m == null ? void 0 : m.frames) == null ? void 0 : h[0];
|
|
2591
2576
|
p && (i(p.id), l = p);
|
|
2592
2577
|
}
|
|
2593
2578
|
if (l) {
|
|
2594
2579
|
const m = l.cards.find((p) => p.id === l.activeCardId);
|
|
2595
2580
|
m && r(m);
|
|
2596
2581
|
}
|
|
2597
|
-
}, [n,
|
|
2582
|
+
}, [n, t, a, o, i, r]), {
|
|
2598
2583
|
hasEntities: !!(d != null && d.selectedEntities && d.selectedEntities.length > 0)
|
|
2599
2584
|
};
|
|
2600
2585
|
}
|
|
2601
|
-
function
|
|
2602
|
-
const
|
|
2586
|
+
function vn() {
|
|
2587
|
+
const t = w((l) => l.dashboard), a = w(
|
|
2603
2588
|
(l) => l.semanticExecutionPayload
|
|
2604
2589
|
), o = w(
|
|
2605
2590
|
(l) => l.actions.addFilterInput
|
|
2606
|
-
), { hasEntities: n } =
|
|
2607
|
-
() =>
|
|
2608
|
-
[
|
|
2609
|
-
), c = !
|
|
2591
|
+
), { hasEntities: n } = bn(), { isLoading: i } = Ka(), r = ee(
|
|
2592
|
+
() => Nr(t, a),
|
|
2593
|
+
[t, a]
|
|
2594
|
+
), c = !Sr(t) && r.hasEligibleCards && !i;
|
|
2610
2595
|
return /* @__PURE__ */ s("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
|
|
2611
|
-
c && /* @__PURE__ */
|
|
2596
|
+
c && /* @__PURE__ */ e("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ s(
|
|
2612
2597
|
"button",
|
|
2613
2598
|
{
|
|
2614
2599
|
type: "button",
|
|
2615
|
-
onClick: () => o(
|
|
2600
|
+
onClick: () => o(kr(), {
|
|
2616
2601
|
kind: "allSheets",
|
|
2617
2602
|
sheetKinds: ["dashboard"]
|
|
2618
2603
|
}),
|
|
2619
2604
|
title: `Applies to ${r.eligibleCardCount} of ${r.totalCardCount} date-aware cards`,
|
|
2620
2605
|
className: "flex w-full items-start gap-2 rounded-control px-2 py-1.5 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border",
|
|
2621
2606
|
children: [
|
|
2622
|
-
/* @__PURE__ */
|
|
2607
|
+
/* @__PURE__ */ e(Rr, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
2623
2608
|
/* @__PURE__ */ s("span", { className: "flex min-w-0 flex-col", children: [
|
|
2624
|
-
/* @__PURE__ */
|
|
2625
|
-
/* @__PURE__ */
|
|
2609
|
+
/* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
|
|
2610
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
|
|
2626
2611
|
] })
|
|
2627
2612
|
]
|
|
2628
2613
|
}
|
|
2629
2614
|
) }),
|
|
2630
2615
|
!n && /* @__PURE__ */ s("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
|
|
2631
|
-
/* @__PURE__ */
|
|
2632
|
-
/* @__PURE__ */
|
|
2633
|
-
/* @__PURE__ */
|
|
2616
|
+
/* @__PURE__ */ e(Ga, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
|
|
2617
|
+
/* @__PURE__ */ e("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
|
|
2618
|
+
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
|
|
2634
2619
|
] }),
|
|
2635
|
-
n && /* @__PURE__ */
|
|
2620
|
+
n && /* @__PURE__ */ e("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ e(Xa, { context: "filter" }) })
|
|
2636
2621
|
] });
|
|
2637
2622
|
}
|
|
2638
2623
|
function xn({
|
|
2639
|
-
onAddFilter:
|
|
2624
|
+
onAddFilter: t,
|
|
2640
2625
|
onAddControl: a,
|
|
2641
2626
|
onManageControls: o,
|
|
2642
2627
|
onDismiss: n
|
|
2643
2628
|
}) {
|
|
2644
2629
|
const i = w(
|
|
2645
2630
|
(c) => c.dashboard.filterLayout
|
|
2646
|
-
), { setFilterLayout: r } =
|
|
2631
|
+
), { setFilterLayout: r } = de(), d = (i == null ? void 0 : i.toolbarWrap) ?? !1;
|
|
2647
2632
|
return /* @__PURE__ */ s("div", { className: "w-[300px]", children: [
|
|
2648
2633
|
/* @__PURE__ */ s("div", { className: "p-1", children: [
|
|
2649
|
-
/* @__PURE__ */
|
|
2634
|
+
/* @__PURE__ */ e(
|
|
2650
2635
|
rt,
|
|
2651
2636
|
{
|
|
2652
|
-
icon:
|
|
2637
|
+
icon: $t,
|
|
2653
2638
|
label: "Add filter",
|
|
2654
2639
|
onClick: () => {
|
|
2655
|
-
|
|
2640
|
+
t(), n();
|
|
2656
2641
|
}
|
|
2657
2642
|
}
|
|
2658
2643
|
),
|
|
2659
|
-
/* @__PURE__ */
|
|
2644
|
+
/* @__PURE__ */ e(
|
|
2660
2645
|
rt,
|
|
2661
2646
|
{
|
|
2662
|
-
icon:
|
|
2647
|
+
icon: Ht,
|
|
2663
2648
|
label: "Add control",
|
|
2664
2649
|
onClick: () => {
|
|
2665
2650
|
a(), n();
|
|
2666
2651
|
}
|
|
2667
2652
|
}
|
|
2668
2653
|
),
|
|
2669
|
-
/* @__PURE__ */
|
|
2654
|
+
/* @__PURE__ */ e(
|
|
2670
2655
|
rt,
|
|
2671
2656
|
{
|
|
2672
|
-
icon:
|
|
2657
|
+
icon: Wt,
|
|
2673
2658
|
label: "Manage controls",
|
|
2674
2659
|
onClick: () => {
|
|
2675
2660
|
o(), n();
|
|
@@ -2677,11 +2662,11 @@ function xn({
|
|
|
2677
2662
|
}
|
|
2678
2663
|
)
|
|
2679
2664
|
] }),
|
|
2680
|
-
/* @__PURE__ */
|
|
2665
|
+
/* @__PURE__ */ e("div", { className: "border-t border-border/60" }),
|
|
2681
2666
|
/* @__PURE__ */ s("div", { className: "space-y-1 p-2", children: [
|
|
2682
|
-
/* @__PURE__ */
|
|
2683
|
-
/* @__PURE__ */
|
|
2684
|
-
|
|
2667
|
+
/* @__PURE__ */ e("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
|
|
2668
|
+
/* @__PURE__ */ e(
|
|
2669
|
+
yn,
|
|
2685
2670
|
{
|
|
2686
2671
|
id: "filter-display-wrap",
|
|
2687
2672
|
label: "Wrap to multiple lines",
|
|
@@ -2693,7 +2678,7 @@ function xn({
|
|
|
2693
2678
|
] });
|
|
2694
2679
|
}
|
|
2695
2680
|
function rt({
|
|
2696
|
-
icon:
|
|
2681
|
+
icon: t,
|
|
2697
2682
|
label: a,
|
|
2698
2683
|
onClick: o
|
|
2699
2684
|
}) {
|
|
@@ -2704,32 +2689,32 @@ function rt({
|
|
|
2704
2689
|
onClick: o,
|
|
2705
2690
|
className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-[13px] text-foreground outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40",
|
|
2706
2691
|
children: [
|
|
2707
|
-
/* @__PURE__ */ t
|
|
2692
|
+
/* @__PURE__ */ e(t, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
2708
2693
|
a
|
|
2709
2694
|
]
|
|
2710
2695
|
}
|
|
2711
2696
|
);
|
|
2712
2697
|
}
|
|
2713
|
-
function
|
|
2714
|
-
id:
|
|
2698
|
+
function yn({
|
|
2699
|
+
id: t,
|
|
2715
2700
|
label: a,
|
|
2716
2701
|
checked: o,
|
|
2717
2702
|
onCheckedChange: n
|
|
2718
2703
|
}) {
|
|
2719
2704
|
return /* @__PURE__ */ s("div", { className: "flex items-center gap-2 rounded-control px-1 py-1 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
|
|
2720
|
-
/* @__PURE__ */
|
|
2721
|
-
/* @__PURE__ */
|
|
2705
|
+
/* @__PURE__ */ e(gt, { id: t, checked: o, onCheckedChange: n }),
|
|
2706
|
+
/* @__PURE__ */ e(
|
|
2722
2707
|
De,
|
|
2723
2708
|
{
|
|
2724
|
-
htmlFor:
|
|
2709
|
+
htmlFor: t,
|
|
2725
2710
|
className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
|
|
2726
2711
|
children: a
|
|
2727
2712
|
}
|
|
2728
2713
|
)
|
|
2729
2714
|
] });
|
|
2730
2715
|
}
|
|
2731
|
-
function
|
|
2732
|
-
size:
|
|
2716
|
+
function ws({
|
|
2717
|
+
size: t,
|
|
2733
2718
|
className: a,
|
|
2734
2719
|
primaryButtonClassName: o,
|
|
2735
2720
|
secondaryButtonClassName: n,
|
|
@@ -2737,15 +2722,15 @@ function Ns({
|
|
|
2737
2722
|
settingsContentClassName: r
|
|
2738
2723
|
}) {
|
|
2739
2724
|
var O;
|
|
2740
|
-
const [d, c] =
|
|
2725
|
+
const [d, c] = D(null), l = w((b) => b.dashboard), u = w((b) => b.selectedSheetId), h = w((b) => b.showFilters), m = w((b) => b.actions), { setDocumentPanelTarget: p, setShowFilters: f } = m, g = (O = l.sheets) == null ? void 0 : O.find(
|
|
2741
2726
|
(b) => b.id === u
|
|
2742
|
-
),
|
|
2727
|
+
), x = Nt(g), N = Y((b) => {
|
|
2743
2728
|
window.setTimeout(() => {
|
|
2744
2729
|
c(b);
|
|
2745
2730
|
}, 0);
|
|
2746
|
-
}, []),
|
|
2731
|
+
}, []), S = Y(
|
|
2747
2732
|
(b) => {
|
|
2748
|
-
if (
|
|
2733
|
+
if (x && u) {
|
|
2749
2734
|
b && p(u, {
|
|
2750
2735
|
kind: "document",
|
|
2751
2736
|
group: "inputs"
|
|
@@ -2755,35 +2740,35 @@ function Ns({
|
|
|
2755
2740
|
f(b);
|
|
2756
2741
|
},
|
|
2757
2742
|
[
|
|
2758
|
-
|
|
2743
|
+
x,
|
|
2759
2744
|
u,
|
|
2760
2745
|
p,
|
|
2761
2746
|
f
|
|
2762
2747
|
]
|
|
2763
|
-
),
|
|
2764
|
-
|
|
2765
|
-
}, [
|
|
2766
|
-
|
|
2767
|
-
}, [
|
|
2768
|
-
|
|
2769
|
-
}, [
|
|
2770
|
-
return /* @__PURE__ */ s(
|
|
2771
|
-
/* @__PURE__ */
|
|
2772
|
-
|
|
2748
|
+
), M = Y(() => {
|
|
2749
|
+
S(!0);
|
|
2750
|
+
}, [S]), U = Y(() => {
|
|
2751
|
+
N("create");
|
|
2752
|
+
}, [N]), F = Y(() => {
|
|
2753
|
+
N("manage");
|
|
2754
|
+
}, [N]);
|
|
2755
|
+
return /* @__PURE__ */ s(R, { children: [
|
|
2756
|
+
/* @__PURE__ */ e(
|
|
2757
|
+
gn,
|
|
2773
2758
|
{
|
|
2774
|
-
showFilters:
|
|
2775
|
-
onShowFiltersChange:
|
|
2776
|
-
pickerContent: /* @__PURE__ */
|
|
2777
|
-
settingsContent: (b) => /* @__PURE__ */
|
|
2759
|
+
showFilters: x ? !1 : h,
|
|
2760
|
+
onShowFiltersChange: S,
|
|
2761
|
+
pickerContent: /* @__PURE__ */ e(vn, {}),
|
|
2762
|
+
settingsContent: (b) => /* @__PURE__ */ e(
|
|
2778
2763
|
xn,
|
|
2779
2764
|
{
|
|
2780
|
-
onAddFilter:
|
|
2781
|
-
onAddControl:
|
|
2782
|
-
onManageControls:
|
|
2765
|
+
onAddFilter: M,
|
|
2766
|
+
onAddControl: U,
|
|
2767
|
+
onManageControls: F,
|
|
2783
2768
|
onDismiss: b
|
|
2784
2769
|
}
|
|
2785
2770
|
),
|
|
2786
|
-
size:
|
|
2771
|
+
size: t,
|
|
2787
2772
|
className: a,
|
|
2788
2773
|
primaryButtonClassName: o,
|
|
2789
2774
|
secondaryButtonClassName: n,
|
|
@@ -2791,8 +2776,8 @@ function Ns({
|
|
|
2791
2776
|
settingsContentClassName: r
|
|
2792
2777
|
}
|
|
2793
2778
|
),
|
|
2794
|
-
d ?
|
|
2795
|
-
|
|
2779
|
+
d ? x ? /* @__PURE__ */ e(
|
|
2780
|
+
un,
|
|
2796
2781
|
{
|
|
2797
2782
|
open: !0,
|
|
2798
2783
|
onOpenChange: (b) => {
|
|
@@ -2800,8 +2785,8 @@ function Ns({
|
|
|
2800
2785
|
},
|
|
2801
2786
|
initialMode: d
|
|
2802
2787
|
}
|
|
2803
|
-
) : /* @__PURE__ */
|
|
2804
|
-
|
|
2788
|
+
) : /* @__PURE__ */ e(
|
|
2789
|
+
dn,
|
|
2805
2790
|
{
|
|
2806
2791
|
open: !0,
|
|
2807
2792
|
onOpenChange: (b) => {
|
|
@@ -2813,38 +2798,38 @@ function Ns({
|
|
|
2813
2798
|
) : null
|
|
2814
2799
|
] });
|
|
2815
2800
|
}
|
|
2816
|
-
function
|
|
2817
|
-
disabled:
|
|
2801
|
+
function Cn({
|
|
2802
|
+
disabled: t,
|
|
2818
2803
|
briefingCount: a,
|
|
2819
2804
|
className: o,
|
|
2820
2805
|
onClick: n
|
|
2821
2806
|
}) {
|
|
2822
2807
|
const i = typeof a == "number" && a > 0;
|
|
2823
2808
|
return /* @__PURE__ */ s(
|
|
2824
|
-
|
|
2809
|
+
T,
|
|
2825
2810
|
{
|
|
2826
2811
|
type: "button",
|
|
2827
2812
|
size: "xs",
|
|
2828
2813
|
variant: "outline",
|
|
2829
|
-
disabled:
|
|
2830
|
-
className:
|
|
2814
|
+
disabled: t,
|
|
2815
|
+
className: J("gap-1.5", o),
|
|
2831
2816
|
onClick: n,
|
|
2832
2817
|
"aria-label": "Reports & briefings",
|
|
2833
2818
|
children: [
|
|
2834
|
-
/* @__PURE__ */
|
|
2819
|
+
/* @__PURE__ */ e(jr, { className: "h-3.5 w-3.5" }),
|
|
2835
2820
|
"Reports & briefings",
|
|
2836
|
-
i ? /* @__PURE__ */
|
|
2821
|
+
i ? /* @__PURE__ */ e("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
|
|
2837
2822
|
]
|
|
2838
2823
|
}
|
|
2839
2824
|
);
|
|
2840
2825
|
}
|
|
2841
|
-
const
|
|
2842
|
-
function
|
|
2843
|
-
return
|
|
2826
|
+
const wn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", ta = "inline-flex h-7 items-center gap-1.5 rounded-control px-2 text-[12px] text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50", je = "inline-flex h-7 items-center gap-1.5 rounded-control bg-primary px-3 text-[12px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50";
|
|
2827
|
+
function Nn(t) {
|
|
2828
|
+
return t === "dashboard" ? "This dashboard" : "Project";
|
|
2844
2829
|
}
|
|
2845
|
-
function
|
|
2846
|
-
if (!
|
|
2847
|
-
const a = new Date(
|
|
2830
|
+
function Sn(t) {
|
|
2831
|
+
if (!t) return "Never";
|
|
2832
|
+
const a = new Date(t);
|
|
2848
2833
|
if (Number.isNaN(a.getTime())) return "Unknown";
|
|
2849
2834
|
const o = Date.now() - a.getTime(), n = Math.round(o / 6e4);
|
|
2850
2835
|
if (n < 1) return "now";
|
|
@@ -2856,49 +2841,49 @@ function Nn(e) {
|
|
|
2856
2841
|
const d = Math.round(r / 7);
|
|
2857
2842
|
return d < 5 ? `${d}w ago` : `${Math.round(r / 30)}mo ago`;
|
|
2858
2843
|
}
|
|
2859
|
-
function
|
|
2860
|
-
return
|
|
2861
|
-
|
|
2862
|
-
|
|
2844
|
+
function kn(t) {
|
|
2845
|
+
return t.scheduleExpr ? Mr(
|
|
2846
|
+
t.scheduleExpr,
|
|
2847
|
+
t.timezone || "UTC"
|
|
2863
2848
|
) ?? "Invalid schedule" : "On demand";
|
|
2864
2849
|
}
|
|
2865
|
-
function
|
|
2866
|
-
if (
|
|
2867
|
-
const a =
|
|
2868
|
-
return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${
|
|
2850
|
+
function Dn(t) {
|
|
2851
|
+
if (t.lastRunStatus) {
|
|
2852
|
+
const a = t.lastRunStatus.toString().toUpperCase();
|
|
2853
|
+
return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${t.lastRunStatus.toString().toLowerCase()}`;
|
|
2869
2854
|
}
|
|
2870
2855
|
return null;
|
|
2871
2856
|
}
|
|
2872
|
-
function
|
|
2873
|
-
return
|
|
2857
|
+
function aa(t) {
|
|
2858
|
+
return t.hasActiveRun ? "Running" : t.lastRunStatus ? `Last run ${t.lastRunStatus.toString().toLowerCase()}` : "Idle";
|
|
2874
2859
|
}
|
|
2875
|
-
function
|
|
2876
|
-
return
|
|
2860
|
+
function An(t) {
|
|
2861
|
+
return t.source.type === "dashboard" ? "This dashboard" : "Project";
|
|
2877
2862
|
}
|
|
2878
|
-
function
|
|
2879
|
-
activeView:
|
|
2863
|
+
function Fn({
|
|
2864
|
+
activeView: t,
|
|
2880
2865
|
onChange: a
|
|
2881
2866
|
}) {
|
|
2882
|
-
return /* @__PURE__ */
|
|
2867
|
+
return /* @__PURE__ */ e(
|
|
2883
2868
|
"div",
|
|
2884
2869
|
{
|
|
2885
2870
|
className: "flex shrink-0 items-center gap-1 rounded-control bg-muted p-0.5",
|
|
2886
2871
|
role: "tablist",
|
|
2887
2872
|
"aria-label": "Briefing source view",
|
|
2888
2873
|
children: ["dashboard", "project"].map((o) => {
|
|
2889
|
-
const n =
|
|
2890
|
-
return /* @__PURE__ */
|
|
2874
|
+
const n = t === o;
|
|
2875
|
+
return /* @__PURE__ */ e(
|
|
2891
2876
|
"button",
|
|
2892
2877
|
{
|
|
2893
2878
|
type: "button",
|
|
2894
2879
|
role: "tab",
|
|
2895
2880
|
"aria-selected": n,
|
|
2896
2881
|
onClick: () => a(o),
|
|
2897
|
-
className:
|
|
2882
|
+
className: J(
|
|
2898
2883
|
"h-6 rounded-[3px] px-2 text-[11px] transition-colors",
|
|
2899
2884
|
n ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
2900
2885
|
),
|
|
2901
|
-
children:
|
|
2886
|
+
children: Nn(o)
|
|
2902
2887
|
},
|
|
2903
2888
|
o
|
|
2904
2889
|
);
|
|
@@ -2906,8 +2891,8 @@ function An({
|
|
|
2906
2891
|
}
|
|
2907
2892
|
);
|
|
2908
2893
|
}
|
|
2909
|
-
function
|
|
2910
|
-
briefings:
|
|
2894
|
+
function En({
|
|
2895
|
+
briefings: t,
|
|
2911
2896
|
dashboardLabel: a,
|
|
2912
2897
|
sourceView: o,
|
|
2913
2898
|
error: n,
|
|
@@ -2922,59 +2907,59 @@ function Fn({
|
|
|
2922
2907
|
onRunNow: p,
|
|
2923
2908
|
onTogglePause: f,
|
|
2924
2909
|
onDelete: g,
|
|
2925
|
-
selectingId:
|
|
2926
|
-
busyId:
|
|
2927
|
-
manageBriefingsHref:
|
|
2928
|
-
contentKind:
|
|
2929
|
-
hideHeader:
|
|
2910
|
+
selectingId: x,
|
|
2911
|
+
busyId: N,
|
|
2912
|
+
manageBriefingsHref: S,
|
|
2913
|
+
contentKind: M,
|
|
2914
|
+
hideHeader: U = !1
|
|
2930
2915
|
}) {
|
|
2931
|
-
const
|
|
2916
|
+
const F = t.length, O = t.filter((k) => k.status === "ACTIVE").length, b = M === "reports" ? F === 1 ? "report" : "reports" : M === "briefings" ? F === 1 ? "briefing" : "briefings" : F === 1 ? "item" : "items", I = t.find((k) => k.hasActiveRun) ?? null, C = M ?? "reports & briefings", A = o === "dashboard" ? a : `Project ${C}`;
|
|
2932
2917
|
return /* @__PURE__ */ s(
|
|
2933
2918
|
"section",
|
|
2934
2919
|
{
|
|
2935
2920
|
"aria-label": `Dashboard ${C.replace("&", "and")}`,
|
|
2936
2921
|
className: "flex h-full min-h-0 flex-col bg-background text-foreground",
|
|
2937
2922
|
children: [
|
|
2938
|
-
|
|
2923
|
+
U ? null : /* @__PURE__ */ s("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
|
|
2939
2924
|
/* @__PURE__ */ s("div", { className: "min-w-0", children: [
|
|
2940
|
-
/* @__PURE__ */
|
|
2941
|
-
/* @__PURE__ */
|
|
2925
|
+
/* @__PURE__ */ e("div", { className: wn, children: C }),
|
|
2926
|
+
/* @__PURE__ */ e("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: A })
|
|
2942
2927
|
] }),
|
|
2943
|
-
/* @__PURE__ */
|
|
2928
|
+
/* @__PURE__ */ e(
|
|
2944
2929
|
"button",
|
|
2945
2930
|
{
|
|
2946
2931
|
type: "button",
|
|
2947
2932
|
onClick: d,
|
|
2948
2933
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2949
2934
|
"aria-label": `Close ${C.replace("&", "and")} panel`,
|
|
2950
|
-
children: /* @__PURE__ */
|
|
2935
|
+
children: /* @__PURE__ */ e(Xe, { className: "h-3.5 w-3.5" })
|
|
2951
2936
|
}
|
|
2952
2937
|
)
|
|
2953
2938
|
] }),
|
|
2954
2939
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-3 border-b border-border px-4 py-2", children: [
|
|
2955
2940
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
2956
|
-
/* @__PURE__ */
|
|
2957
|
-
|
|
2941
|
+
/* @__PURE__ */ e(
|
|
2942
|
+
Fn,
|
|
2958
2943
|
{
|
|
2959
2944
|
activeView: o,
|
|
2960
2945
|
onChange: r
|
|
2961
2946
|
}
|
|
2962
2947
|
),
|
|
2963
|
-
/* @__PURE__ */
|
|
2948
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && F === 0 ? /* @__PURE__ */ s("span", { children: [
|
|
2964
2949
|
"Loading ",
|
|
2965
2950
|
C,
|
|
2966
2951
|
"…"
|
|
2967
|
-
] }) :
|
|
2952
|
+
] }) : F === 0 ? /* @__PURE__ */ s("span", { children: [
|
|
2968
2953
|
"No ",
|
|
2969
2954
|
C,
|
|
2970
2955
|
" yet"
|
|
2971
|
-
] }) : /* @__PURE__ */ s(
|
|
2956
|
+
] }) : /* @__PURE__ */ s(R, { children: [
|
|
2972
2957
|
/* @__PURE__ */ s("span", { className: "font-medium text-foreground/80", children: [
|
|
2973
|
-
|
|
2958
|
+
F,
|
|
2974
2959
|
" ",
|
|
2975
2960
|
b
|
|
2976
2961
|
] }),
|
|
2977
|
-
/* @__PURE__ */
|
|
2962
|
+
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2978
2963
|
/* @__PURE__ */ s("span", { children: [
|
|
2979
2964
|
O,
|
|
2980
2965
|
" active"
|
|
@@ -2987,17 +2972,17 @@ function Fn({
|
|
|
2987
2972
|
// when a manual reload is in flight, but don't show a separate
|
|
2988
2973
|
// refresh button — close+reopen handles the rare "stale list"
|
|
2989
2974
|
// case without crowding the toolbar.
|
|
2990
|
-
/* @__PURE__ */
|
|
2975
|
+
/* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
|
|
2991
2976
|
) : null,
|
|
2992
|
-
|
|
2993
|
-
/* @__PURE__ */
|
|
2994
|
-
/* @__PURE__ */
|
|
2977
|
+
F > 0 && u ? m && h ? /* @__PURE__ */ s(Ve, { children: [
|
|
2978
|
+
/* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ s("button", { className: je, children: [
|
|
2979
|
+
/* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
|
|
2995
2980
|
" New"
|
|
2996
2981
|
] }) }),
|
|
2997
2982
|
/* @__PURE__ */ s(Pe, { align: "end", children: [
|
|
2998
|
-
/* @__PURE__ */
|
|
2999
|
-
/* @__PURE__ */
|
|
3000
|
-
|
|
2983
|
+
/* @__PURE__ */ e(K, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
|
|
2984
|
+
/* @__PURE__ */ e(
|
|
2985
|
+
K,
|
|
3001
2986
|
{
|
|
3002
2987
|
onClick: () => l("analytical_briefing"),
|
|
3003
2988
|
children: "Create analytical briefing"
|
|
@@ -3010,7 +2995,7 @@ function Fn({
|
|
|
3010
2995
|
onClick: () => l("scheduled_report"),
|
|
3011
2996
|
className: je,
|
|
3012
2997
|
children: [
|
|
3013
|
-
/* @__PURE__ */
|
|
2998
|
+
/* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
|
|
3014
2999
|
" Schedule report"
|
|
3015
3000
|
]
|
|
3016
3001
|
}
|
|
@@ -3020,53 +3005,53 @@ function Fn({
|
|
|
3020
3005
|
onClick: () => l("analytical_briefing"),
|
|
3021
3006
|
className: je,
|
|
3022
3007
|
children: [
|
|
3023
|
-
/* @__PURE__ */
|
|
3008
|
+
/* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
|
|
3024
3009
|
" New briefing"
|
|
3025
3010
|
]
|
|
3026
3011
|
}
|
|
3027
3012
|
) : null : null
|
|
3028
3013
|
] })
|
|
3029
3014
|
] }),
|
|
3030
|
-
|
|
3031
|
-
/* @__PURE__ */
|
|
3032
|
-
/* @__PURE__ */
|
|
3033
|
-
/* @__PURE__ */
|
|
3034
|
-
/* @__PURE__ */
|
|
3015
|
+
I ? /* @__PURE__ */ s("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
|
|
3016
|
+
/* @__PURE__ */ e(ae, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
|
|
3017
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: I.name }),
|
|
3018
|
+
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
3019
|
+
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: aa(I) })
|
|
3035
3020
|
] }) : null,
|
|
3036
3021
|
/* @__PURE__ */ s("div", { className: "flex-1 overflow-y-auto", children: [
|
|
3037
|
-
n ? /* @__PURE__ */
|
|
3038
|
-
!i &&
|
|
3039
|
-
|
|
3022
|
+
n ? /* @__PURE__ */ e("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: n }) : null,
|
|
3023
|
+
!i && t.length === 0 && !n ? /* @__PURE__ */ e(
|
|
3024
|
+
In,
|
|
3040
3025
|
{
|
|
3041
3026
|
onNew: l,
|
|
3042
3027
|
canCreate: u,
|
|
3043
3028
|
canCreateScheduledReport: h,
|
|
3044
3029
|
analyticalBriefingsEnabled: m,
|
|
3045
|
-
contentKind:
|
|
3030
|
+
contentKind: M
|
|
3046
3031
|
}
|
|
3047
3032
|
) : null,
|
|
3048
|
-
|
|
3049
|
-
|
|
3033
|
+
t.map((k) => /* @__PURE__ */ e(
|
|
3034
|
+
Ln,
|
|
3050
3035
|
{
|
|
3051
|
-
briefing:
|
|
3052
|
-
isOpening:
|
|
3053
|
-
isBusy:
|
|
3054
|
-
onOpen: () => c(
|
|
3055
|
-
onRunNow: () => p(
|
|
3056
|
-
onTogglePause: () => f(
|
|
3057
|
-
onDelete: () => g(
|
|
3036
|
+
briefing: k,
|
|
3037
|
+
isOpening: x === k.id,
|
|
3038
|
+
isBusy: N === k.id,
|
|
3039
|
+
onOpen: () => c(k.id),
|
|
3040
|
+
onRunNow: () => p(k),
|
|
3041
|
+
onTogglePause: () => f(k),
|
|
3042
|
+
onDelete: () => g(k)
|
|
3058
3043
|
},
|
|
3059
|
-
|
|
3044
|
+
k.id
|
|
3060
3045
|
))
|
|
3061
3046
|
] }),
|
|
3062
|
-
|
|
3047
|
+
S ? /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ s(
|
|
3063
3048
|
"a",
|
|
3064
3049
|
{
|
|
3065
|
-
href:
|
|
3066
|
-
className:
|
|
3050
|
+
href: S,
|
|
3051
|
+
className: J(ta, "h-6 px-1 text-[11px]"),
|
|
3067
3052
|
children: [
|
|
3068
3053
|
"Manage all reports & briefings",
|
|
3069
|
-
/* @__PURE__ */
|
|
3054
|
+
/* @__PURE__ */ e(Or, { className: "h-3 w-3" })
|
|
3070
3055
|
]
|
|
3071
3056
|
}
|
|
3072
3057
|
) }) : null
|
|
@@ -3074,8 +3059,8 @@ function Fn({
|
|
|
3074
3059
|
}
|
|
3075
3060
|
);
|
|
3076
3061
|
}
|
|
3077
|
-
function
|
|
3078
|
-
onNew:
|
|
3062
|
+
function In({
|
|
3063
|
+
onNew: t,
|
|
3079
3064
|
canCreate: a,
|
|
3080
3065
|
canCreateScheduledReport: o,
|
|
3081
3066
|
analyticalBriefingsEnabled: n,
|
|
@@ -3089,33 +3074,33 @@ function En({
|
|
|
3089
3074
|
description: "Create an analytical briefing to monitor this dashboard and brief your team."
|
|
3090
3075
|
} : null;
|
|
3091
3076
|
return /* @__PURE__ */ s("div", { className: "flex h-full flex-col items-center justify-center px-8 py-12 text-center", children: [
|
|
3092
|
-
/* @__PURE__ */
|
|
3093
|
-
/* @__PURE__ */
|
|
3094
|
-
/* @__PURE__ */
|
|
3077
|
+
/* @__PURE__ */ e(Tn, { className: "mb-5 h-[88px] w-[112px] text-border" }),
|
|
3078
|
+
/* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: (r == null ? void 0 : r.title) ?? "Have an analyst brief your team" }),
|
|
3079
|
+
/* @__PURE__ */ e("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (r == null ? void 0 : r.description) ?? "Describe what to watch. An analyst digs into this dashboard and the data behind it, then briefs your team on the cadence you choose." }),
|
|
3095
3080
|
a ? /* @__PURE__ */ s("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
|
|
3096
3081
|
o ? /* @__PURE__ */ s(
|
|
3097
3082
|
"button",
|
|
3098
3083
|
{
|
|
3099
|
-
onClick: () =>
|
|
3084
|
+
onClick: () => t("scheduled_report"),
|
|
3100
3085
|
className: je,
|
|
3101
3086
|
children: [
|
|
3102
|
-
/* @__PURE__ */
|
|
3087
|
+
/* @__PURE__ */ e(xe, { className: "h-3 w-3" }),
|
|
3103
3088
|
" Schedule a report"
|
|
3104
3089
|
]
|
|
3105
3090
|
}
|
|
3106
3091
|
) : null,
|
|
3107
|
-
n ? /* @__PURE__ */
|
|
3092
|
+
n ? /* @__PURE__ */ e(
|
|
3108
3093
|
"button",
|
|
3109
3094
|
{
|
|
3110
|
-
onClick: () =>
|
|
3111
|
-
className:
|
|
3095
|
+
onClick: () => t("analytical_briefing"),
|
|
3096
|
+
className: ta,
|
|
3112
3097
|
children: "Create analytical briefing"
|
|
3113
3098
|
}
|
|
3114
3099
|
) : null
|
|
3115
3100
|
] }) : null
|
|
3116
3101
|
] });
|
|
3117
3102
|
}
|
|
3118
|
-
function
|
|
3103
|
+
function Tn({ className: t }) {
|
|
3119
3104
|
return /* @__PURE__ */ s(
|
|
3120
3105
|
"svg",
|
|
3121
3106
|
{
|
|
@@ -3124,9 +3109,9 @@ function In({ className: e }) {
|
|
|
3124
3109
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3125
3110
|
role: "presentation",
|
|
3126
3111
|
"aria-hidden": "true",
|
|
3127
|
-
className:
|
|
3112
|
+
className: t,
|
|
3128
3113
|
children: [
|
|
3129
|
-
/* @__PURE__ */
|
|
3114
|
+
/* @__PURE__ */ e(
|
|
3130
3115
|
"rect",
|
|
3131
3116
|
{
|
|
3132
3117
|
x: "22",
|
|
@@ -3138,7 +3123,7 @@ function In({ className: e }) {
|
|
|
3138
3123
|
strokeWidth: "1.25"
|
|
3139
3124
|
}
|
|
3140
3125
|
),
|
|
3141
|
-
/* @__PURE__ */
|
|
3126
|
+
/* @__PURE__ */ e(
|
|
3142
3127
|
"line",
|
|
3143
3128
|
{
|
|
3144
3129
|
x1: "30",
|
|
@@ -3150,7 +3135,7 @@ function In({ className: e }) {
|
|
|
3150
3135
|
strokeLinecap: "round"
|
|
3151
3136
|
}
|
|
3152
3137
|
),
|
|
3153
|
-
/* @__PURE__ */
|
|
3138
|
+
/* @__PURE__ */ e(
|
|
3154
3139
|
"line",
|
|
3155
3140
|
{
|
|
3156
3141
|
x1: "30",
|
|
@@ -3163,8 +3148,8 @@ function In({ className: e }) {
|
|
|
3163
3148
|
opacity: "0.5"
|
|
3164
3149
|
}
|
|
3165
3150
|
),
|
|
3166
|
-
/* @__PURE__ */
|
|
3167
|
-
/* @__PURE__ */
|
|
3151
|
+
/* @__PURE__ */ e("circle", { cx: "31", cy: "32", r: "1", fill: "currentColor", opacity: "0.6" }),
|
|
3152
|
+
/* @__PURE__ */ e(
|
|
3168
3153
|
"line",
|
|
3169
3154
|
{
|
|
3170
3155
|
x1: "35",
|
|
@@ -3177,8 +3162,8 @@ function In({ className: e }) {
|
|
|
3177
3162
|
strokeLinecap: "round"
|
|
3178
3163
|
}
|
|
3179
3164
|
),
|
|
3180
|
-
/* @__PURE__ */
|
|
3181
|
-
/* @__PURE__ */
|
|
3165
|
+
/* @__PURE__ */ e("circle", { cx: "31", cy: "38", r: "1", fill: "currentColor", opacity: "0.6" }),
|
|
3166
|
+
/* @__PURE__ */ e(
|
|
3182
3167
|
"line",
|
|
3183
3168
|
{
|
|
3184
3169
|
x1: "35",
|
|
@@ -3191,8 +3176,8 @@ function In({ className: e }) {
|
|
|
3191
3176
|
strokeLinecap: "round"
|
|
3192
3177
|
}
|
|
3193
3178
|
),
|
|
3194
|
-
/* @__PURE__ */
|
|
3195
|
-
/* @__PURE__ */
|
|
3179
|
+
/* @__PURE__ */ e("circle", { cx: "31", cy: "44", r: "1", fill: "currentColor", opacity: "0.6" }),
|
|
3180
|
+
/* @__PURE__ */ e(
|
|
3196
3181
|
"line",
|
|
3197
3182
|
{
|
|
3198
3183
|
x1: "35",
|
|
@@ -3205,7 +3190,7 @@ function In({ className: e }) {
|
|
|
3205
3190
|
strokeLinecap: "round"
|
|
3206
3191
|
}
|
|
3207
3192
|
),
|
|
3208
|
-
/* @__PURE__ */
|
|
3193
|
+
/* @__PURE__ */ e(
|
|
3209
3194
|
"rect",
|
|
3210
3195
|
{
|
|
3211
3196
|
x: "30",
|
|
@@ -3217,7 +3202,7 @@ function In({ className: e }) {
|
|
|
3217
3202
|
opacity: "0.55"
|
|
3218
3203
|
}
|
|
3219
3204
|
),
|
|
3220
|
-
/* @__PURE__ */
|
|
3205
|
+
/* @__PURE__ */ e(
|
|
3221
3206
|
"rect",
|
|
3222
3207
|
{
|
|
3223
3208
|
x: "38",
|
|
@@ -3229,7 +3214,7 @@ function In({ className: e }) {
|
|
|
3229
3214
|
opacity: "0.7"
|
|
3230
3215
|
}
|
|
3231
3216
|
),
|
|
3232
|
-
/* @__PURE__ */
|
|
3217
|
+
/* @__PURE__ */ e(
|
|
3233
3218
|
"rect",
|
|
3234
3219
|
{
|
|
3235
3220
|
x: "46",
|
|
@@ -3241,7 +3226,7 @@ function In({ className: e }) {
|
|
|
3241
3226
|
opacity: "0.85"
|
|
3242
3227
|
}
|
|
3243
3228
|
),
|
|
3244
|
-
/* @__PURE__ */
|
|
3229
|
+
/* @__PURE__ */ e(
|
|
3245
3230
|
"rect",
|
|
3246
3231
|
{
|
|
3247
3232
|
x: "54",
|
|
@@ -3253,7 +3238,7 @@ function In({ className: e }) {
|
|
|
3253
3238
|
opacity: "0.6"
|
|
3254
3239
|
}
|
|
3255
3240
|
),
|
|
3256
|
-
/* @__PURE__ */
|
|
3241
|
+
/* @__PURE__ */ e(
|
|
3257
3242
|
"rect",
|
|
3258
3243
|
{
|
|
3259
3244
|
x: "62",
|
|
@@ -3265,7 +3250,7 @@ function In({ className: e }) {
|
|
|
3265
3250
|
opacity: "0.75"
|
|
3266
3251
|
}
|
|
3267
3252
|
),
|
|
3268
|
-
/* @__PURE__ */
|
|
3253
|
+
/* @__PURE__ */ e(
|
|
3269
3254
|
"circle",
|
|
3270
3255
|
{
|
|
3271
3256
|
cx: "86",
|
|
@@ -3276,7 +3261,7 @@ function In({ className: e }) {
|
|
|
3276
3261
|
strokeWidth: "1.25"
|
|
3277
3262
|
}
|
|
3278
3263
|
),
|
|
3279
|
-
/* @__PURE__ */
|
|
3264
|
+
/* @__PURE__ */ e(
|
|
3280
3265
|
"line",
|
|
3281
3266
|
{
|
|
3282
3267
|
x1: "93.5",
|
|
@@ -3292,8 +3277,8 @@ function In({ className: e }) {
|
|
|
3292
3277
|
}
|
|
3293
3278
|
);
|
|
3294
3279
|
}
|
|
3295
|
-
function
|
|
3296
|
-
briefing:
|
|
3280
|
+
function Ln({
|
|
3281
|
+
briefing: t,
|
|
3297
3282
|
isOpening: a,
|
|
3298
3283
|
isBusy: o,
|
|
3299
3284
|
onOpen: n,
|
|
@@ -3301,11 +3286,11 @@ function Tn({
|
|
|
3301
3286
|
onTogglePause: r,
|
|
3302
3287
|
onDelete: d
|
|
3303
3288
|
}) {
|
|
3304
|
-
const c =
|
|
3289
|
+
const c = t.status === "PAUSED", l = t.hasActiveRun, u = Dn(t), h = Sn(t.lastRunAt), m = t.lastRunStatus, p = ie(t), f = m === "SUCCESS" ? ze.success.dot : m === "FAILED" ? ze.danger.dot : m ? ze.warning.dot : ze.neutral.dot;
|
|
3305
3290
|
return /* @__PURE__ */ s(
|
|
3306
3291
|
"div",
|
|
3307
3292
|
{
|
|
3308
|
-
className:
|
|
3293
|
+
className: J(
|
|
3309
3294
|
"group relative border-b border-border/60 px-4 py-3 transition-colors hover:bg-muted/60",
|
|
3310
3295
|
c && "opacity-70"
|
|
3311
3296
|
),
|
|
@@ -3322,18 +3307,18 @@ function Tn({
|
|
|
3322
3307
|
className: "cursor-pointer pr-8",
|
|
3323
3308
|
children: [
|
|
3324
3309
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
3325
|
-
/* @__PURE__ */
|
|
3326
|
-
c ? /* @__PURE__ */
|
|
3310
|
+
/* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
|
|
3311
|
+
c ? /* @__PURE__ */ e("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
|
|
3327
3312
|
] }),
|
|
3328
3313
|
/* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
|
|
3329
|
-
/* @__PURE__ */
|
|
3330
|
-
/* @__PURE__ */
|
|
3331
|
-
/* @__PURE__ */
|
|
3332
|
-
/* @__PURE__ */
|
|
3333
|
-
/* @__PURE__ */
|
|
3334
|
-
/* @__PURE__ */
|
|
3335
|
-
|
|
3336
|
-
/* @__PURE__ */
|
|
3314
|
+
/* @__PURE__ */ e("span", { children: p.typeLabel }),
|
|
3315
|
+
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
3316
|
+
/* @__PURE__ */ e("span", { children: An(t) }),
|
|
3317
|
+
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
3318
|
+
/* @__PURE__ */ e(Ya, { className: "h-3 w-3" }),
|
|
3319
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: kn(t) }),
|
|
3320
|
+
t.lastRunAt ? /* @__PURE__ */ s(R, { children: [
|
|
3321
|
+
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
3337
3322
|
/* @__PURE__ */ s("span", { children: [
|
|
3338
3323
|
"Last run ",
|
|
3339
3324
|
h
|
|
@@ -3341,74 +3326,74 @@ function Tn({
|
|
|
3341
3326
|
] }) : null
|
|
3342
3327
|
] }),
|
|
3343
3328
|
u || l ? /* @__PURE__ */ s("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
|
|
3344
|
-
l ? /* @__PURE__ */
|
|
3329
|
+
l ? /* @__PURE__ */ e(ae, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ e(
|
|
3345
3330
|
"span",
|
|
3346
3331
|
{
|
|
3347
|
-
className:
|
|
3332
|
+
className: J(
|
|
3348
3333
|
"inline-block h-1.5 w-1.5 shrink-0 rounded-full",
|
|
3349
3334
|
f
|
|
3350
3335
|
)
|
|
3351
3336
|
}
|
|
3352
3337
|
),
|
|
3353
|
-
/* @__PURE__ */
|
|
3338
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: l ? aa(t) : u })
|
|
3354
3339
|
] }) : null
|
|
3355
3340
|
]
|
|
3356
3341
|
}
|
|
3357
3342
|
),
|
|
3358
|
-
/* @__PURE__ */
|
|
3359
|
-
/* @__PURE__ */
|
|
3343
|
+
/* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children: o ? /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ s(Ve, { children: [
|
|
3344
|
+
/* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e(
|
|
3360
3345
|
"button",
|
|
3361
3346
|
{
|
|
3362
3347
|
type: "button",
|
|
3363
3348
|
onClick: (g) => g.stopPropagation(),
|
|
3364
3349
|
className: "inline-flex h-6 w-6 items-center justify-center rounded-control text-muted-foreground/70 opacity-60 hover:bg-muted hover:text-foreground/80 focus-visible:opacity-100 group-hover:opacity-100",
|
|
3365
3350
|
"aria-label": `${p.noun === "report" ? "Report" : "Briefing"} actions`,
|
|
3366
|
-
children: /* @__PURE__ */
|
|
3351
|
+
children: /* @__PURE__ */ e(zt, { className: "h-3.5 w-3.5" })
|
|
3367
3352
|
}
|
|
3368
3353
|
) }),
|
|
3369
3354
|
/* @__PURE__ */ s(Pe, { align: "end", className: "w-44", children: [
|
|
3370
|
-
/* @__PURE__ */ s(
|
|
3371
|
-
/* @__PURE__ */
|
|
3355
|
+
/* @__PURE__ */ s(K, { onClick: n, children: [
|
|
3356
|
+
/* @__PURE__ */ e(Wt, { className: "h-3.5 w-3.5" }),
|
|
3372
3357
|
"Edit ",
|
|
3373
3358
|
p.noun
|
|
3374
3359
|
] }),
|
|
3375
3360
|
/* @__PURE__ */ s(
|
|
3376
|
-
|
|
3361
|
+
K,
|
|
3377
3362
|
{
|
|
3378
3363
|
onClick: (g) => {
|
|
3379
3364
|
g.preventDefault(), i();
|
|
3380
3365
|
},
|
|
3381
3366
|
children: [
|
|
3382
|
-
/* @__PURE__ */
|
|
3367
|
+
/* @__PURE__ */ e(Ja, { className: "h-3.5 w-3.5" }),
|
|
3383
3368
|
"Run now"
|
|
3384
3369
|
]
|
|
3385
3370
|
}
|
|
3386
3371
|
),
|
|
3387
|
-
|
|
3388
|
-
|
|
3372
|
+
t.scheduleExpr ? /* @__PURE__ */ e(
|
|
3373
|
+
K,
|
|
3389
3374
|
{
|
|
3390
3375
|
onClick: (g) => {
|
|
3391
3376
|
g.preventDefault(), r();
|
|
3392
3377
|
},
|
|
3393
|
-
children: c ? /* @__PURE__ */ s(
|
|
3394
|
-
/* @__PURE__ */
|
|
3378
|
+
children: c ? /* @__PURE__ */ s(R, { children: [
|
|
3379
|
+
/* @__PURE__ */ e(Za, { className: "h-3.5 w-3.5" }),
|
|
3395
3380
|
"Resume"
|
|
3396
|
-
] }) : /* @__PURE__ */ s(
|
|
3397
|
-
/* @__PURE__ */
|
|
3381
|
+
] }) : /* @__PURE__ */ s(R, { children: [
|
|
3382
|
+
/* @__PURE__ */ e(er, { className: "h-3.5 w-3.5" }),
|
|
3398
3383
|
"Pause"
|
|
3399
3384
|
] })
|
|
3400
3385
|
}
|
|
3401
3386
|
) : null,
|
|
3402
|
-
/* @__PURE__ */
|
|
3387
|
+
/* @__PURE__ */ e(We, {}),
|
|
3403
3388
|
/* @__PURE__ */ s(
|
|
3404
|
-
|
|
3389
|
+
K,
|
|
3405
3390
|
{
|
|
3406
3391
|
onClick: (g) => {
|
|
3407
3392
|
g.preventDefault(), d();
|
|
3408
3393
|
},
|
|
3409
3394
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
3410
3395
|
children: [
|
|
3411
|
-
/* @__PURE__ */
|
|
3396
|
+
/* @__PURE__ */ e($e, { className: "h-3.5 w-3.5" }),
|
|
3412
3397
|
"Delete ",
|
|
3413
3398
|
p.noun
|
|
3414
3399
|
]
|
|
@@ -3420,24 +3405,24 @@ function Tn({
|
|
|
3420
3405
|
}
|
|
3421
3406
|
);
|
|
3422
3407
|
}
|
|
3423
|
-
function
|
|
3424
|
-
return (
|
|
3408
|
+
function Vn(t) {
|
|
3409
|
+
return (t == null ? void 0 : t.trim()) || "This dashboard";
|
|
3425
3410
|
}
|
|
3426
|
-
function
|
|
3427
|
-
return
|
|
3411
|
+
function Bn(t) {
|
|
3412
|
+
return t === "This dashboard" ? "Watch this dashboard" : `Watch ${t}`;
|
|
3428
3413
|
}
|
|
3429
|
-
function
|
|
3430
|
-
return a !== "dashboard" ?
|
|
3414
|
+
function Pn(t, a, o) {
|
|
3415
|
+
return a !== "dashboard" ? t : t.filter(
|
|
3431
3416
|
(n) => n.source.type === "dashboard" && n.source.dashboardId === o
|
|
3432
3417
|
);
|
|
3433
3418
|
}
|
|
3434
|
-
async function
|
|
3419
|
+
async function Mn(t) {
|
|
3435
3420
|
const o = [];
|
|
3436
3421
|
let n = 1, i = 0, r = Number.POSITIVE_INFINITY;
|
|
3437
3422
|
for (; i < r; ) {
|
|
3438
|
-
const d = await
|
|
3439
|
-
|
|
3440
|
-
|
|
3423
|
+
const d = await t.apiClient.listBriefings(
|
|
3424
|
+
t.apiServiceUrl,
|
|
3425
|
+
t.token,
|
|
3441
3426
|
{ scope: "organization", page: n, pageSize: 100 }
|
|
3442
3427
|
);
|
|
3443
3428
|
if (o.push(...d.briefings), i += d.briefings.length, r = d.total, d.briefings.length === 0 || i >= r) break;
|
|
@@ -3445,19 +3430,19 @@ async function Pn(e) {
|
|
|
3445
3430
|
}
|
|
3446
3431
|
return o;
|
|
3447
3432
|
}
|
|
3448
|
-
const
|
|
3449
|
-
listBriefings:
|
|
3450
|
-
getBriefing:
|
|
3451
|
-
pauseBriefing:
|
|
3452
|
-
resumeBriefing:
|
|
3453
|
-
deleteBriefing:
|
|
3454
|
-
runBriefingNow:
|
|
3433
|
+
const Un = {
|
|
3434
|
+
listBriefings: dr,
|
|
3435
|
+
getBriefing: lr,
|
|
3436
|
+
pauseBriefing: ir,
|
|
3437
|
+
resumeBriefing: or,
|
|
3438
|
+
deleteBriefing: sr,
|
|
3439
|
+
runBriefingNow: nr
|
|
3455
3440
|
};
|
|
3456
|
-
function
|
|
3457
|
-
return /* @__PURE__ */
|
|
3441
|
+
function Ns(t) {
|
|
3442
|
+
return /* @__PURE__ */ e(tr, { authToken: t.token ? { accessToken: t.token } : void 0, children: /* @__PURE__ */ e(ar, { children: /* @__PURE__ */ e(On, { ...t }) }) });
|
|
3458
3443
|
}
|
|
3459
|
-
function
|
|
3460
|
-
dashboardId:
|
|
3444
|
+
function On({
|
|
3445
|
+
dashboardId: t,
|
|
3461
3446
|
dashboardTitle: a,
|
|
3462
3447
|
apiServiceUrl: o,
|
|
3463
3448
|
token: n,
|
|
@@ -3471,64 +3456,64 @@ function Un({
|
|
|
3471
3456
|
openRun: m,
|
|
3472
3457
|
client: p
|
|
3473
3458
|
}) {
|
|
3474
|
-
const { authToken: f, tokenProps: g } = it(),
|
|
3475
|
-
c === void 0 &&
|
|
3476
|
-
}, [O, b] =
|
|
3459
|
+
const { authToken: f, tokenProps: g } = it(), x = rr(), N = !h || x.canCreate && (h === "scheduled_report" || x.analyticalBriefingsEnabled), [S, M] = D(!1), U = c ?? S, F = (y) => {
|
|
3460
|
+
c === void 0 && M(y), l == null || l(y);
|
|
3461
|
+
}, [O, b] = D(
|
|
3477
3462
|
h ? "author" : "list"
|
|
3478
|
-
), [
|
|
3463
|
+
), [I, C] = D(
|
|
3479
3464
|
h ?? "analytical_briefing"
|
|
3480
|
-
), [
|
|
3465
|
+
), [A, k] = D("dashboard"), [j, L] = D(
|
|
3481
3466
|
[]
|
|
3482
|
-
), [
|
|
3467
|
+
), [z, G] = D(null), V = h && !N && !z ? "list" : O, [te, X] = D(!1), [H, he] = D(null), [ge, Q] = D(null), [_, se] = D(
|
|
3483
3468
|
null
|
|
3484
|
-
), [me, pe] =
|
|
3485
|
-
|
|
3486
|
-
const y =
|
|
3487
|
-
Me.current =
|
|
3488
|
-
}, [
|
|
3489
|
-
const Ye = yt(), $ = o ?? (g == null ? void 0 : g.apiServiceUrl), W = n ?? (f == null ? void 0 : f.accessToken),
|
|
3490
|
-
|
|
3469
|
+
), [me, pe] = D(null), Ce = nt(null), Me = nt(U);
|
|
3470
|
+
ve(() => {
|
|
3471
|
+
const y = U && !Me.current;
|
|
3472
|
+
Me.current = U, !(!y || !h) && (G(null), k("dashboard"), C(h), b("author"), pe(null));
|
|
3473
|
+
}, [U, h]);
|
|
3474
|
+
const Ye = yt(), $ = o ?? (g == null ? void 0 : g.apiServiceUrl), W = n ?? (f == null ? void 0 : f.accessToken), re = ee(() => ({ ...Un, ...p }), [p]), [we, Je] = D(null);
|
|
3475
|
+
ve(() => {
|
|
3491
3476
|
if (!m || !$ || !W) return;
|
|
3492
3477
|
let y = !0;
|
|
3493
|
-
return
|
|
3494
|
-
y && (
|
|
3478
|
+
return re.getBriefing($, W, m.briefingId).then(({ briefing: P }) => {
|
|
3479
|
+
y && (G(P), Je(m), b("author"));
|
|
3495
3480
|
}, (P) => {
|
|
3496
3481
|
y && E.error(P instanceof Error ? P.message : "Could not open the run.");
|
|
3497
3482
|
}), () => {
|
|
3498
3483
|
y = !1;
|
|
3499
3484
|
};
|
|
3500
|
-
}, [m, $, W,
|
|
3501
|
-
const be =
|
|
3502
|
-
const y =
|
|
3485
|
+
}, [m, $, W, re]);
|
|
3486
|
+
const be = Vn(a), Ue = ee(() => {
|
|
3487
|
+
const y = Pn(
|
|
3503
3488
|
j,
|
|
3504
|
-
|
|
3505
|
-
|
|
3489
|
+
A,
|
|
3490
|
+
t
|
|
3506
3491
|
);
|
|
3507
3492
|
if (!h)
|
|
3508
3493
|
return y;
|
|
3509
3494
|
const P = h === "scheduled_report" ? "report" : "briefing";
|
|
3510
3495
|
return y.filter(
|
|
3511
|
-
(Oe) =>
|
|
3496
|
+
(Oe) => ie(Oe).noun === P
|
|
3512
3497
|
);
|
|
3513
|
-
}, [
|
|
3514
|
-
source: { type: "dashboard", dashboardId:
|
|
3498
|
+
}, [t, j, A, h]), Ze = ee(() => A === "dashboard" ? {
|
|
3499
|
+
source: { type: "dashboard", dashboardId: t },
|
|
3515
3500
|
label: be,
|
|
3516
|
-
detail:
|
|
3501
|
+
detail: Bn(be)
|
|
3517
3502
|
} : {
|
|
3518
3503
|
source: { type: "project" },
|
|
3519
3504
|
label: "This project",
|
|
3520
3505
|
detail: "Use any data in this project."
|
|
3521
|
-
}, [
|
|
3522
|
-
canCreate:
|
|
3523
|
-
analyticalBriefingsEnabled:
|
|
3524
|
-
scheduledReportAvailable:
|
|
3525
|
-
}),
|
|
3506
|
+
}, [t, be, A]), Ne = !!($ && W), Se = Ur({
|
|
3507
|
+
canCreate: x.canCreate,
|
|
3508
|
+
analyticalBriefingsEnabled: x.analyticalBriefingsEnabled,
|
|
3509
|
+
scheduledReportAvailable: A === "dashboard"
|
|
3510
|
+
}), ne = Y(async () => {
|
|
3526
3511
|
if (!(!$ || !W)) {
|
|
3527
|
-
|
|
3512
|
+
X(!0), pe(null);
|
|
3528
3513
|
try {
|
|
3529
|
-
|
|
3530
|
-
await
|
|
3531
|
-
apiClient:
|
|
3514
|
+
L(
|
|
3515
|
+
await Mn({
|
|
3516
|
+
apiClient: re,
|
|
3532
3517
|
apiServiceUrl: $,
|
|
3533
3518
|
token: W
|
|
3534
3519
|
})
|
|
@@ -3538,27 +3523,27 @@ function Un({
|
|
|
3538
3523
|
y instanceof Error ? y.message : "Could not load briefings."
|
|
3539
3524
|
);
|
|
3540
3525
|
} finally {
|
|
3541
|
-
|
|
3526
|
+
X(!1);
|
|
3542
3527
|
}
|
|
3543
3528
|
}
|
|
3544
|
-
}, [
|
|
3545
|
-
|
|
3546
|
-
!
|
|
3547
|
-
}, [Ne,
|
|
3529
|
+
}, [re, $, W]);
|
|
3530
|
+
ve(() => {
|
|
3531
|
+
!U || V !== "list" || !Ne || ne();
|
|
3532
|
+
}, [Ne, V, ne, U]);
|
|
3548
3533
|
const ke = () => {
|
|
3549
|
-
|
|
3550
|
-
},
|
|
3551
|
-
|
|
3534
|
+
G(null), k("dashboard"), b("list"), F(!0);
|
|
3535
|
+
}, v = (y) => {
|
|
3536
|
+
G(null), C(y), b("author");
|
|
3552
3537
|
}, B = async (y) => {
|
|
3553
3538
|
if (!(!$ || !W)) {
|
|
3554
3539
|
he(y), pe(null);
|
|
3555
3540
|
try {
|
|
3556
|
-
const P = await
|
|
3541
|
+
const P = await re.getBriefing(
|
|
3557
3542
|
$,
|
|
3558
3543
|
W,
|
|
3559
3544
|
y
|
|
3560
3545
|
);
|
|
3561
|
-
|
|
3546
|
+
G(P.briefing), b("author");
|
|
3562
3547
|
} catch (P) {
|
|
3563
3548
|
pe(
|
|
3564
3549
|
P instanceof Error ? P.message : "Could not open briefing."
|
|
@@ -3571,13 +3556,13 @@ function Un({
|
|
|
3571
3556
|
if (!(!$ || !W)) {
|
|
3572
3557
|
Q(y.id);
|
|
3573
3558
|
try {
|
|
3574
|
-
const P = await
|
|
3559
|
+
const P = await re.runBriefingNow(
|
|
3575
3560
|
$,
|
|
3576
3561
|
W,
|
|
3577
3562
|
y.id,
|
|
3578
|
-
{ requestId:
|
|
3563
|
+
{ requestId: Rn() }
|
|
3579
3564
|
);
|
|
3580
|
-
Ye.track({ kind: "briefing", id: P.run.id, title: y.name, briefingId: y.id }),
|
|
3565
|
+
Ye.track({ kind: "briefing", id: P.run.id, title: y.name, briefingId: y.id }), ne();
|
|
3581
3566
|
} catch (P) {
|
|
3582
3567
|
E.error(
|
|
3583
3568
|
P instanceof Error ? P.message : "Could not start the run."
|
|
@@ -3586,42 +3571,42 @@ function Un({
|
|
|
3586
3571
|
Q(null);
|
|
3587
3572
|
}
|
|
3588
3573
|
}
|
|
3589
|
-
},
|
|
3574
|
+
}, oe = async (y) => {
|
|
3590
3575
|
if (!$ || !W) return;
|
|
3591
|
-
const { noun: P } =
|
|
3576
|
+
const { noun: P } = ie(y), Oe = P === "report" ? "Report" : "Briefing";
|
|
3592
3577
|
Q(y.id);
|
|
3593
3578
|
try {
|
|
3594
|
-
const
|
|
3579
|
+
const Re = y.status === "PAUSED" ? await re.resumeBriefing(
|
|
3595
3580
|
$,
|
|
3596
3581
|
W,
|
|
3597
3582
|
y.id
|
|
3598
|
-
) : await
|
|
3583
|
+
) : await re.pauseBriefing(
|
|
3599
3584
|
$,
|
|
3600
3585
|
W,
|
|
3601
3586
|
y.id
|
|
3602
3587
|
);
|
|
3603
3588
|
E.success(
|
|
3604
|
-
|
|
3605
|
-
),
|
|
3606
|
-
} catch (
|
|
3589
|
+
Re.briefing.status === "PAUSED" ? `${Oe} paused` : `${Oe} resumed`
|
|
3590
|
+
), ne();
|
|
3591
|
+
} catch (Re) {
|
|
3607
3592
|
E.error(
|
|
3608
|
-
|
|
3593
|
+
Re instanceof Error ? Re.message : `Could not update the ${P} status.`
|
|
3609
3594
|
);
|
|
3610
3595
|
} finally {
|
|
3611
3596
|
Q(null);
|
|
3612
3597
|
}
|
|
3613
|
-
},
|
|
3598
|
+
}, ce = async () => {
|
|
3614
3599
|
if (!_ || !$ || !W) return;
|
|
3615
3600
|
const y = _;
|
|
3616
3601
|
Q(y.id);
|
|
3617
3602
|
try {
|
|
3618
|
-
await
|
|
3603
|
+
await re.deleteBriefing(
|
|
3619
3604
|
$,
|
|
3620
3605
|
W,
|
|
3621
3606
|
y.id
|
|
3622
3607
|
);
|
|
3623
|
-
const { noun: P } =
|
|
3624
|
-
E.success(`${P === "report" ? "Report" : "Briefing"} deleted`),
|
|
3608
|
+
const { noun: P } = ie(y);
|
|
3609
|
+
E.success(`${P === "report" ? "Report" : "Briefing"} deleted`), se(null), ne();
|
|
3625
3610
|
} catch (P) {
|
|
3626
3611
|
E.error(
|
|
3627
3612
|
P instanceof Error ? P.message : "Could not delete the briefing."
|
|
@@ -3629,19 +3614,19 @@ function Un({
|
|
|
3629
3614
|
} finally {
|
|
3630
3615
|
Q(null);
|
|
3631
3616
|
}
|
|
3632
|
-
},
|
|
3633
|
-
return
|
|
3634
|
-
u ? null : /* @__PURE__ */
|
|
3635
|
-
|
|
3617
|
+
}, ra = Ue.length;
|
|
3618
|
+
return x.surfaceVisible ? /* @__PURE__ */ s(cr, { open: U, onOpenChange: F, children: [
|
|
3619
|
+
u ? null : /* @__PURE__ */ e(
|
|
3620
|
+
Cn,
|
|
3636
3621
|
{
|
|
3637
3622
|
disabled: i || !Ne,
|
|
3638
|
-
briefingCount:
|
|
3623
|
+
briefingCount: ra,
|
|
3639
3624
|
className: r,
|
|
3640
3625
|
onClick: ke
|
|
3641
3626
|
}
|
|
3642
3627
|
),
|
|
3643
3628
|
/* @__PURE__ */ s(
|
|
3644
|
-
|
|
3629
|
+
ur,
|
|
3645
3630
|
{
|
|
3646
3631
|
ref: Ce,
|
|
3647
3632
|
side: "right",
|
|
@@ -3652,9 +3637,9 @@ function Un({
|
|
|
3652
3637
|
y.preventDefault(), (P = Ce.current) == null || P.focus({ preventScroll: !0 });
|
|
3653
3638
|
},
|
|
3654
3639
|
children: [
|
|
3655
|
-
/* @__PURE__ */ s(
|
|
3656
|
-
/* @__PURE__ */
|
|
3657
|
-
/* @__PURE__ */
|
|
3640
|
+
/* @__PURE__ */ s(hr, { className: "sr-only", children: [
|
|
3641
|
+
/* @__PURE__ */ e(mr, { children: "Reports & briefings" }),
|
|
3642
|
+
/* @__PURE__ */ e(pr, { children: "Manage reports and briefings for this dashboard." })
|
|
3658
3643
|
] }),
|
|
3659
3644
|
h ? /* @__PURE__ */ s("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
|
|
3660
3645
|
/* @__PURE__ */ s(
|
|
@@ -3664,33 +3649,33 @@ function Un({
|
|
|
3664
3649
|
role: "tablist",
|
|
3665
3650
|
"aria-label": h === "scheduled_report" ? "Email report workflow" : "Analytical briefing workflow",
|
|
3666
3651
|
children: [
|
|
3667
|
-
/* @__PURE__ */
|
|
3652
|
+
/* @__PURE__ */ e(
|
|
3668
3653
|
"button",
|
|
3669
3654
|
{
|
|
3670
3655
|
type: "button",
|
|
3671
3656
|
role: "tab",
|
|
3672
|
-
"aria-selected":
|
|
3673
|
-
disabled: !
|
|
3674
|
-
className:
|
|
3657
|
+
"aria-selected": V === "author",
|
|
3658
|
+
disabled: !N,
|
|
3659
|
+
className: J(
|
|
3675
3660
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3676
|
-
|
|
3677
|
-
!
|
|
3661
|
+
V === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
|
|
3662
|
+
!N && "cursor-not-allowed opacity-50"
|
|
3678
3663
|
),
|
|
3679
3664
|
onClick: () => {
|
|
3680
|
-
|
|
3665
|
+
N && (G(null), C(h), k("dashboard"), b("author"));
|
|
3681
3666
|
},
|
|
3682
|
-
children:
|
|
3667
|
+
children: z ? `Edit ${ie(z).noun}` : h === "scheduled_report" ? "Schedule report" : "Create briefing"
|
|
3683
3668
|
}
|
|
3684
3669
|
),
|
|
3685
|
-
/* @__PURE__ */
|
|
3670
|
+
/* @__PURE__ */ e(
|
|
3686
3671
|
"button",
|
|
3687
3672
|
{
|
|
3688
3673
|
type: "button",
|
|
3689
3674
|
role: "tab",
|
|
3690
|
-
"aria-selected":
|
|
3691
|
-
className:
|
|
3675
|
+
"aria-selected": V === "list",
|
|
3676
|
+
className: J(
|
|
3692
3677
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3693
|
-
|
|
3678
|
+
V === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
3694
3679
|
),
|
|
3695
3680
|
onClick: () => b("list"),
|
|
3696
3681
|
children: h === "scheduled_report" ? "Manage reports" : "Manage briefings"
|
|
@@ -3699,31 +3684,31 @@ function Un({
|
|
|
3699
3684
|
]
|
|
3700
3685
|
}
|
|
3701
3686
|
),
|
|
3702
|
-
/* @__PURE__ */
|
|
3687
|
+
/* @__PURE__ */ e(
|
|
3703
3688
|
"button",
|
|
3704
3689
|
{
|
|
3705
3690
|
type: "button",
|
|
3706
|
-
onClick: () =>
|
|
3691
|
+
onClick: () => F(!1),
|
|
3707
3692
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3708
3693
|
"aria-label": h === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
|
|
3709
|
-
children: /* @__PURE__ */
|
|
3694
|
+
children: /* @__PURE__ */ e(Xe, { className: "h-3.5 w-3.5" })
|
|
3710
3695
|
}
|
|
3711
3696
|
)
|
|
3712
3697
|
] }) : null,
|
|
3713
|
-
|
|
3714
|
-
|
|
3698
|
+
V === "list" ? /* @__PURE__ */ e(
|
|
3699
|
+
En,
|
|
3715
3700
|
{
|
|
3716
3701
|
briefings: Ue,
|
|
3717
3702
|
dashboardLabel: be,
|
|
3718
|
-
sourceView:
|
|
3703
|
+
sourceView: A,
|
|
3719
3704
|
error: me,
|
|
3720
|
-
loading:
|
|
3721
|
-
onSourceViewChange:
|
|
3722
|
-
onClose: () =>
|
|
3705
|
+
loading: te,
|
|
3706
|
+
onSourceViewChange: k,
|
|
3707
|
+
onClose: () => F(!1),
|
|
3723
3708
|
onEdit: (y) => {
|
|
3724
3709
|
B(y);
|
|
3725
3710
|
},
|
|
3726
|
-
onNew:
|
|
3711
|
+
onNew: v,
|
|
3727
3712
|
canCreate: !h && Se.length > 0,
|
|
3728
3713
|
canCreateScheduledReport: Se.includes(
|
|
3729
3714
|
"scheduled_report"
|
|
@@ -3735,78 +3720,78 @@ function Un({
|
|
|
3735
3720
|
q(y);
|
|
3736
3721
|
},
|
|
3737
3722
|
onTogglePause: (y) => {
|
|
3738
|
-
|
|
3723
|
+
oe(y);
|
|
3739
3724
|
},
|
|
3740
|
-
onDelete: (y) =>
|
|
3725
|
+
onDelete: (y) => se(y),
|
|
3741
3726
|
selectingId: H,
|
|
3742
3727
|
busyId: ge,
|
|
3743
3728
|
manageBriefingsHref: d,
|
|
3744
3729
|
contentKind: h === "scheduled_report" ? "reports" : h === "analytical_briefing" ? "briefings" : void 0,
|
|
3745
3730
|
hideHeader: !!h
|
|
3746
3731
|
}
|
|
3747
|
-
) : /* @__PURE__ */
|
|
3748
|
-
|
|
3732
|
+
) : /* @__PURE__ */ e(
|
|
3733
|
+
fr,
|
|
3749
3734
|
{
|
|
3750
3735
|
apiServiceUrl: $,
|
|
3751
3736
|
token: W,
|
|
3752
|
-
briefing:
|
|
3753
|
-
initialRunId: we && (
|
|
3754
|
-
intent:
|
|
3755
|
-
sourceContext:
|
|
3756
|
-
title:
|
|
3737
|
+
briefing: z,
|
|
3738
|
+
initialRunId: we && (z == null ? void 0 : z.id) === we.briefingId ? we.runId : void 0,
|
|
3739
|
+
intent: I,
|
|
3740
|
+
sourceContext: z ? void 0 : Ze,
|
|
3741
|
+
title: z ? `Edit ${ie(z).noun}` : I === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
|
|
3757
3742
|
hideHeader: !!h,
|
|
3758
3743
|
className: "h-full min-h-0 max-w-none border-0 shadow-none",
|
|
3759
3744
|
onBack: h ? void 0 : () => b("list"),
|
|
3760
|
-
onCancel: () =>
|
|
3745
|
+
onCancel: () => F(!1),
|
|
3761
3746
|
onDeleted: () => {
|
|
3762
|
-
const y =
|
|
3763
|
-
E.success(`${y === "report" ? "Report" : "Briefing"} deleted`),
|
|
3747
|
+
const y = z ? ie(z).noun : "briefing";
|
|
3748
|
+
E.success(`${y === "report" ? "Report" : "Briefing"} deleted`), G(null), b("list"), ne();
|
|
3764
3749
|
},
|
|
3765
3750
|
onRunStarted: () => {
|
|
3766
3751
|
},
|
|
3767
3752
|
onSaved: (y) => {
|
|
3768
|
-
|
|
3753
|
+
G(y), ne();
|
|
3769
3754
|
},
|
|
3770
3755
|
onMinimizeRun: () => {
|
|
3771
|
-
|
|
3756
|
+
F(!1);
|
|
3772
3757
|
}
|
|
3773
3758
|
}
|
|
3774
3759
|
)
|
|
3775
3760
|
]
|
|
3776
3761
|
}
|
|
3777
3762
|
),
|
|
3778
|
-
/* @__PURE__ */
|
|
3763
|
+
/* @__PURE__ */ e(
|
|
3779
3764
|
dt,
|
|
3780
3765
|
{
|
|
3781
3766
|
open: !!_,
|
|
3782
3767
|
onOpenChange: (y) => {
|
|
3783
|
-
y ||
|
|
3768
|
+
y || se(null);
|
|
3784
3769
|
},
|
|
3785
3770
|
children: /* @__PURE__ */ s(ct, { children: [
|
|
3786
3771
|
/* @__PURE__ */ s(ut, { children: [
|
|
3787
3772
|
/* @__PURE__ */ s(ht, { children: [
|
|
3788
3773
|
"Delete",
|
|
3789
3774
|
" ",
|
|
3790
|
-
_ ?
|
|
3775
|
+
_ ? ie(_).noun : "briefing",
|
|
3791
3776
|
"?"
|
|
3792
3777
|
] }),
|
|
3793
3778
|
/* @__PURE__ */ s(mt, { children: [
|
|
3794
3779
|
"This permanently deletes ",
|
|
3795
|
-
/* @__PURE__ */
|
|
3780
|
+
/* @__PURE__ */ e("strong", { children: _ == null ? void 0 : _.name }),
|
|
3796
3781
|
". Recipients will stop receiving it."
|
|
3797
3782
|
] })
|
|
3798
3783
|
] }),
|
|
3799
3784
|
/* @__PURE__ */ s(pt, { children: [
|
|
3800
|
-
/* @__PURE__ */
|
|
3785
|
+
/* @__PURE__ */ e(ft, { children: "Cancel" }),
|
|
3801
3786
|
/* @__PURE__ */ s(
|
|
3802
|
-
|
|
3787
|
+
Rt,
|
|
3803
3788
|
{
|
|
3804
3789
|
className: "bg-destructive/90 hover:bg-destructive",
|
|
3805
|
-
onClick:
|
|
3790
|
+
onClick: ce,
|
|
3806
3791
|
children: [
|
|
3807
3792
|
"Delete",
|
|
3808
3793
|
" ",
|
|
3809
|
-
_ ?
|
|
3794
|
+
_ ? ie(_).noun : "briefing"
|
|
3810
3795
|
]
|
|
3811
3796
|
}
|
|
3812
3797
|
)
|
|
@@ -3816,27 +3801,27 @@ function Un({
|
|
|
3816
3801
|
)
|
|
3817
3802
|
] }) : null;
|
|
3818
3803
|
}
|
|
3819
|
-
function
|
|
3804
|
+
function Rn() {
|
|
3820
3805
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `briefing-run-now-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
3821
3806
|
}
|
|
3822
3807
|
export {
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3808
|
+
hs as A,
|
|
3809
|
+
fs as D,
|
|
3810
|
+
ps as S,
|
|
3811
|
+
bs as T,
|
|
3812
|
+
xs as U,
|
|
3813
|
+
ds as V,
|
|
3814
|
+
Cn as W,
|
|
3815
|
+
us as a,
|
|
3816
|
+
ms as b,
|
|
3817
|
+
gs as c,
|
|
3833
3818
|
vs as d,
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3819
|
+
Cs as e,
|
|
3820
|
+
dn as f,
|
|
3821
|
+
un as g,
|
|
3822
|
+
gn as h,
|
|
3823
|
+
ys as i,
|
|
3824
|
+
ws as j,
|
|
3825
|
+
Ns as k,
|
|
3826
|
+
cs as u
|
|
3842
3827
|
};
|