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