react-semaphor 0.1.295 → 0.1.297
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{braces-DWldEFn5.js → braces-BT-cB4J_.js} +1 -1
- package/dist/chunks/{braces-BdoTYzuj.js → braces-CSunPeAg.js} +1 -1
- package/dist/chunks/dashboard-controls-C6254Ugx.js +2219 -0
- package/dist/chunks/dashboard-controls-Za3WPtTh.js +47 -0
- package/dist/chunks/{dashboard-filter-controls-button-XwenlcXw.js → dashboard-filter-controls-button-DZnR5IgP.js} +487 -513
- package/dist/chunks/dashboard-filter-controls-button-dYWccDmw.js +11 -0
- package/dist/chunks/{dashboard-json-CU55qPXj.js → dashboard-json-CuI5gkwY.js} +1 -1
- package/dist/chunks/{dashboard-json-V6m6lJ_c.js → dashboard-json-DjpkfbSZ.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-DRLPzp1P.js → dashboard-summary-settings-dialog-C6FUhXQy.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-0CIiWsKc.js → dashboard-summary-settings-dialog-vC2shhM-.js} +1 -1
- package/dist/chunks/edit-dashboard-visual-CoG-tE_T.js +188 -0
- package/dist/chunks/{edit-dashboard-visual-8ha6EM_g.js → edit-dashboard-visual-TBI9_Pyh.js} +6351 -6452
- package/dist/chunks/index--CoasbAE.js +1523 -0
- package/dist/chunks/{index-14M0TnH6.js → index-D0iNspb-.js} +102960 -87712
- package/dist/chunks/{resource-management-panel-CcDAn86l.js → resource-management-panel-Cf4FTR33.js} +2 -2
- package/dist/chunks/{resource-management-panel-BL5-5ouC.js → resource-management-panel-HOWOJUap.js} +31 -30
- package/dist/chunks/{use-create-flow-overlay-state-D3PxfjYv.js → use-create-flow-overlay-state-B7bE6z5B.js} +572 -568
- package/dist/chunks/use-create-flow-overlay-state-BqiJrgeK.js +21 -0
- package/dist/chunks/use-visual-utils-DP6ty2_T.js +1 -0
- package/dist/chunks/{use-visual-utils-CdIOq4nt.js → use-visual-utils-DyvrB6Zh.js} +70 -68
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +113 -112
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/dashboard.d.ts +245 -1
- package/dist/types/main.d.ts +317 -12
- package/dist/types/shared.d.ts +214 -1
- package/dist/types/surfboard.d.ts +245 -1
- package/dist/types/types.d.ts +245 -1
- package/package.json +7 -1
- package/dist/chunks/dashboard-controls-B3lrnI_r.js +0 -47
- package/dist/chunks/dashboard-controls-D7U6E1sB.js +0 -2014
- package/dist/chunks/dashboard-filter-controls-button-D0AsV28-.js +0 -11
- package/dist/chunks/edit-dashboard-visual-sSLAkmgf.js +0 -183
- package/dist/chunks/index-Ze8VskG1.js +0 -1435
- package/dist/chunks/use-create-flow-overlay-state-BbQVNDCj.js +0 -21
- package/dist/chunks/use-visual-utils-kh8p2QFm.js +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { c as
|
|
3
|
-
import { jsx as t, jsxs as s, Fragment as
|
|
4
|
-
import { V as
|
|
5
|
-
import { u as
|
|
6
|
-
import { k as
|
|
1
|
+
import Se, { useState as T, useRef as X, useCallback as $, useEffect as B, useContext as Ae } from "react";
|
|
2
|
+
import { c as le, d as K, aF as z, bM as Q, bI as de, bJ as W, aG as ce, bH as Ie, e as ue, f as me, g as he, h as pe, i as fe, L as Z, I as Fe, dc as Le, w as Te, B as I, x as q, W as j, M as ke, u as O, N as Pe, Q as J, c0 as ve, dd as Ue, de as ee, y as P, c2 as ge, c1 as G, ai as Me, cG as be, cH as xe, a9 as ye, cJ as we, cK as R, t as Ve, cO as Oe, cx as Be, O as ze, df as Re, b as H, dg as Y, dh as $e, cW as _e, cX as He, cY as je, cZ as Xe, c_ as Ge, c$ as Ke, d0 as Qe, bO as We, X as qe, di as Je, dj as Ye, cD as Ze, bK as te, ab as et, aI as tt, P as Ce, k as De, dk as at, m as Ne, dl as st, dm as rt, dn as ot, dp as nt, dq as it, dr as ae, ds as lt } from "./index-D0iNspb-.js";
|
|
3
|
+
import { jsx as t, jsxs as s, Fragment as _ } from "react/jsx-runtime";
|
|
4
|
+
import { V as dt, E as se, a as re, b as ct, c as ut, L as mt, d as ht, C as pt, u as ft, e as vt } from "./use-create-flow-overlay-state-B7bE6z5B.js";
|
|
5
|
+
import { u as Ee } from "./use-visual-utils-DyvrB6Zh.js";
|
|
6
|
+
import { k as oe } from "./date-formatter-vkCj9Ct-.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the ISC license.
|
|
11
11
|
* See the LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
13
|
+
const ne = le("FileDown", [
|
|
14
14
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
15
15
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
16
16
|
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
@@ -22,158 +22,158 @@ const re = ne("FileDown", [
|
|
|
22
22
|
* This source code is licensed under the ISC license.
|
|
23
23
|
* See the LICENSE file in the root directory of this source tree.
|
|
24
24
|
*/
|
|
25
|
-
const gt =
|
|
25
|
+
const gt = le("FilterX", [
|
|
26
26
|
["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
|
|
27
27
|
["path", { d: "m22 3-5 5", key: "12jva0" }],
|
|
28
28
|
["path", { d: "m17 3 5 5", key: "k36vhe" }]
|
|
29
|
-
]), bt = 1e4, xt = 15e3,
|
|
30
|
-
function
|
|
29
|
+
]), bt = 1e4, xt = 15e3, yt = 3e4, wt = 3e4, Ct = 12e4, ie = 2 * 60 * 60 * 1e3;
|
|
30
|
+
function Dt(e) {
|
|
31
31
|
const a = Date.now() - e.getTime();
|
|
32
|
-
return a <
|
|
32
|
+
return a < wt ? bt : a < Ct ? xt : yt;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const { authToken: e, tokenProps: a } =
|
|
34
|
+
function Vt() {
|
|
35
|
+
const { authToken: e, tokenProps: a } = K(), v = z((h) => h.activeExports), [l, n] = T(
|
|
36
36
|
typeof document < "u" ? !document.hidden : !0
|
|
37
|
-
),
|
|
38
|
-
const
|
|
39
|
-
return Array.from(
|
|
40
|
-
(
|
|
37
|
+
), d = X(null), c = X(!1), m = X(void 0), i = a == null ? void 0 : a.apiServiceUrl, r = e == null ? void 0 : e.accessToken, p = $(() => {
|
|
38
|
+
const h = z.getState().activeExports;
|
|
39
|
+
return Array.from(h.values()).filter(
|
|
40
|
+
(y) => Q(y.status)
|
|
41
41
|
);
|
|
42
42
|
}, []);
|
|
43
|
-
|
|
43
|
+
B(() => {
|
|
44
44
|
if (typeof document > "u") return;
|
|
45
|
-
const
|
|
46
|
-
|
|
45
|
+
const h = () => {
|
|
46
|
+
n(!document.hidden);
|
|
47
47
|
};
|
|
48
|
-
return document.addEventListener("visibilitychange",
|
|
49
|
-
document.removeEventListener("visibilitychange",
|
|
48
|
+
return document.addEventListener("visibilitychange", h), () => {
|
|
49
|
+
document.removeEventListener("visibilitychange", h);
|
|
50
50
|
};
|
|
51
51
|
}, []);
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
52
|
+
const b = $(async () => {
|
|
53
|
+
if (!i || !r) {
|
|
54
54
|
c.current = !1;
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
57
|
+
const h = p();
|
|
58
|
+
if (h.length === 0) {
|
|
59
59
|
c.current = !1;
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
(
|
|
62
|
+
const y = Date.now(), E = h.filter(
|
|
63
|
+
(o) => y - o.startedAt.getTime() > ie
|
|
64
64
|
);
|
|
65
|
-
if (
|
|
66
|
-
const { updateExport:
|
|
67
|
-
for (const
|
|
68
|
-
|
|
65
|
+
if (E.length > 0) {
|
|
66
|
+
const { updateExport: o } = z.getState().actions;
|
|
67
|
+
for (const x of E)
|
|
68
|
+
o(x.id, {
|
|
69
69
|
status: "failed",
|
|
70
70
|
error: "Export timed out. Please try again or contact support.",
|
|
71
71
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
(
|
|
74
|
+
const f = h.filter(
|
|
75
|
+
(o) => y - o.startedAt.getTime() <= ie
|
|
76
76
|
);
|
|
77
|
-
if (
|
|
77
|
+
if (f.length === 0) {
|
|
78
78
|
c.current = !1;
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
|
|
81
|
+
const w = await Promise.allSettled(
|
|
82
|
+
f.map(async (o) => {
|
|
83
83
|
try {
|
|
84
|
-
const
|
|
85
|
-
let
|
|
86
|
-
if (
|
|
84
|
+
const x = await de(i, r, o.id);
|
|
85
|
+
let N;
|
|
86
|
+
if (x.status === "completed")
|
|
87
87
|
try {
|
|
88
|
-
|
|
88
|
+
N = await W(i, r, o.id);
|
|
89
89
|
} catch (F) {
|
|
90
90
|
console.error(
|
|
91
|
-
`[useExportPolling] Failed to get download URL for ${
|
|
91
|
+
`[useExportPolling] Failed to get download URL for ${o.id}:`,
|
|
92
92
|
F
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
return {
|
|
96
|
-
id:
|
|
97
|
-
status:
|
|
98
|
-
progress:
|
|
99
|
-
completedChunks:
|
|
100
|
-
completedAt:
|
|
96
|
+
id: o.id,
|
|
97
|
+
status: x.status,
|
|
98
|
+
progress: x.progress,
|
|
99
|
+
completedChunks: x.completedChunks,
|
|
100
|
+
completedAt: x.completedAt ? new Date(x.completedAt) : void 0,
|
|
101
101
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
102
|
-
fileSize:
|
|
103
|
-
error:
|
|
104
|
-
downloadUrl:
|
|
102
|
+
fileSize: x.fileSize,
|
|
103
|
+
error: x.error,
|
|
104
|
+
downloadUrl: N
|
|
105
105
|
};
|
|
106
|
-
} catch (
|
|
106
|
+
} catch (x) {
|
|
107
107
|
return console.error(
|
|
108
|
-
`[useExportPolling] Failed to poll export ${
|
|
109
|
-
|
|
108
|
+
`[useExportPolling] Failed to poll export ${o.id}:`,
|
|
109
|
+
x
|
|
110
110
|
), null;
|
|
111
111
|
}
|
|
112
112
|
})
|
|
113
|
-
), { updateExport:
|
|
114
|
-
for (const
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
119
|
-
(
|
|
120
|
-
|
|
121
|
-
),
|
|
122
|
-
|
|
123
|
-
var
|
|
124
|
-
(
|
|
125
|
-
},
|
|
113
|
+
), { updateExport: S } = z.getState().actions;
|
|
114
|
+
for (const o of w)
|
|
115
|
+
o.status === "fulfilled" && o.value && S(o.value.id, o.value);
|
|
116
|
+
const C = p();
|
|
117
|
+
if (C.length > 0 && !document.hidden) {
|
|
118
|
+
const o = C.reduce(
|
|
119
|
+
(N, F) => F.startedAt < N ? F.startedAt : N,
|
|
120
|
+
C[0].startedAt
|
|
121
|
+
), x = Dt(o);
|
|
122
|
+
d.current && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
123
|
+
var N;
|
|
124
|
+
(N = m.current) == null || N.call(m);
|
|
125
|
+
}, x);
|
|
126
126
|
} else
|
|
127
127
|
c.current = !1;
|
|
128
|
-
}, [
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
}, [
|
|
132
|
-
var
|
|
133
|
-
|
|
134
|
-
}, [
|
|
135
|
-
var
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
}, [
|
|
139
|
-
!
|
|
140
|
-
}, [
|
|
141
|
-
|
|
128
|
+
}, [i, r, p]);
|
|
129
|
+
return B(() => {
|
|
130
|
+
m.current = b;
|
|
131
|
+
}, [b]), B(() => {
|
|
132
|
+
var y;
|
|
133
|
+
p().length > 0 && l && !c.current && (c.current = !0, (y = m.current) == null || y.call(m));
|
|
134
|
+
}, [v, l, p]), B(() => {
|
|
135
|
+
var y;
|
|
136
|
+
const h = p();
|
|
137
|
+
l && h.length > 0 && !c.current && (c.current = !0, (y = m.current) == null || y.call(m));
|
|
138
|
+
}, [l, p]), B(() => {
|
|
139
|
+
!l && d.current && (clearTimeout(d.current), d.current = null, c.current = !1);
|
|
140
|
+
}, [l]), B(() => () => {
|
|
141
|
+
d.current && (clearTimeout(d.current), d.current = null);
|
|
142
142
|
}, []), {
|
|
143
143
|
isPolling: c.current,
|
|
144
|
-
isTabVisible:
|
|
145
|
-
inProgressCount:
|
|
144
|
+
isTabVisible: l,
|
|
145
|
+
inProgressCount: p().length
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
const { authToken: e, tokenProps: a } =
|
|
150
|
-
|
|
151
|
-
if (
|
|
148
|
+
function Ot() {
|
|
149
|
+
const { authToken: e, tokenProps: a } = K(), v = z((m) => m.activeExports), { addExport: l } = ce(), n = X(!1), d = a == null ? void 0 : a.apiServiceUrl, c = e == null ? void 0 : e.accessToken;
|
|
150
|
+
B(() => {
|
|
151
|
+
if (n.current || !d || !c) return;
|
|
152
152
|
(async () => {
|
|
153
153
|
try {
|
|
154
|
-
const { exports:
|
|
154
|
+
const { exports: i } = await Ie(d, c, {
|
|
155
155
|
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
156
156
|
limit: 20
|
|
157
157
|
// Limit to recent exports
|
|
158
158
|
});
|
|
159
|
-
for (const r of
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
let
|
|
159
|
+
for (const r of i) {
|
|
160
|
+
if (v.has(r.id)) continue;
|
|
161
|
+
const p = r.totalChunks ? Math.round(r.completedChunks / r.totalChunks * 100) : 0;
|
|
162
|
+
let b;
|
|
163
163
|
if (r.status === "completed")
|
|
164
164
|
try {
|
|
165
|
-
|
|
166
|
-
} catch (
|
|
165
|
+
b = await W(d, c, r.id);
|
|
166
|
+
} catch (y) {
|
|
167
167
|
console.error(
|
|
168
168
|
`[useExportRecovery] Failed to get download URL for ${r.id}:`,
|
|
169
|
-
|
|
169
|
+
y
|
|
170
170
|
);
|
|
171
171
|
}
|
|
172
|
-
const
|
|
172
|
+
const h = {
|
|
173
173
|
id: r.id,
|
|
174
174
|
status: r.status,
|
|
175
|
-
progress:
|
|
176
|
-
title:
|
|
175
|
+
progress: p,
|
|
176
|
+
title: Nt(r),
|
|
177
177
|
totalRows: r.totalRows,
|
|
178
178
|
totalChunks: r.totalChunks,
|
|
179
179
|
completedChunks: r.completedChunks,
|
|
@@ -183,46 +183,46 @@ function Bt() {
|
|
|
183
183
|
fileSize: r.fileSize,
|
|
184
184
|
error: r.error,
|
|
185
185
|
expiresAt: new Date(r.expiresAt),
|
|
186
|
-
downloadUrl:
|
|
186
|
+
downloadUrl: b
|
|
187
187
|
};
|
|
188
|
-
|
|
188
|
+
l(h);
|
|
189
189
|
}
|
|
190
|
-
|
|
191
|
-
} catch (
|
|
192
|
-
console.error("[useExportRecovery] Failed to recover exports:",
|
|
190
|
+
n.current = !0;
|
|
191
|
+
} catch (i) {
|
|
192
|
+
console.error("[useExportRecovery] Failed to recover exports:", i), n.current = !0;
|
|
193
193
|
}
|
|
194
194
|
})();
|
|
195
|
-
}, [
|
|
195
|
+
}, [d, c, l, v]);
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
return e.title ? e.title :
|
|
197
|
+
function Nt(e) {
|
|
198
|
+
return e.title ? e.title : Q(
|
|
199
199
|
e.status
|
|
200
200
|
) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
|
|
201
201
|
}
|
|
202
202
|
function Et({
|
|
203
203
|
open: e,
|
|
204
204
|
onOpenChange: a,
|
|
205
|
-
isLibraryVisual:
|
|
206
|
-
currentVisualName:
|
|
207
|
-
isSaving:
|
|
208
|
-
destinationMode:
|
|
205
|
+
isLibraryVisual: v,
|
|
206
|
+
currentVisualName: l,
|
|
207
|
+
isSaving: n = !1,
|
|
208
|
+
destinationMode: d = "both",
|
|
209
209
|
onConfirm: c
|
|
210
210
|
}) {
|
|
211
|
-
const [
|
|
212
|
-
|
|
213
|
-
), [r,
|
|
214
|
-
|
|
215
|
-
e && (
|
|
216
|
-
|
|
217
|
-
),
|
|
218
|
-
}, [e,
|
|
219
|
-
const
|
|
211
|
+
const [m, i] = T(
|
|
212
|
+
v && l ? `Copy of ${l}` : l || ""
|
|
213
|
+
), [r, p] = T("");
|
|
214
|
+
Se.useEffect(() => {
|
|
215
|
+
e && (i(
|
|
216
|
+
v && l ? `Copy of ${l}` : l || ""
|
|
217
|
+
), p(""));
|
|
218
|
+
}, [e, v, l]);
|
|
219
|
+
const b = !!m.trim(), h = d === "local" ? {
|
|
220
220
|
saveToLibrary: !1,
|
|
221
221
|
saveToCurrentDashboard: !0,
|
|
222
222
|
badgeType: "local",
|
|
223
223
|
description: "Creates a local copy on the current dashboard.",
|
|
224
224
|
actionLabel: "Add to Dashboard (Local)"
|
|
225
|
-
} :
|
|
225
|
+
} : d === "library" ? {
|
|
226
226
|
saveToLibrary: !0,
|
|
227
227
|
saveToCurrentDashboard: !1,
|
|
228
228
|
badgeType: "library",
|
|
@@ -234,152 +234,152 @@ function Et({
|
|
|
234
234
|
badgeType: "linked",
|
|
235
235
|
description: "Creates a new library visual and adds a linked copy to this dashboard.",
|
|
236
236
|
actionLabel: "Save Copy as Linked Visual"
|
|
237
|
-
},
|
|
238
|
-
!
|
|
239
|
-
name:
|
|
237
|
+
}, y = () => {
|
|
238
|
+
!b || n || c({
|
|
239
|
+
name: m.trim(),
|
|
240
240
|
description: r.trim() || void 0,
|
|
241
|
-
saveToLibrary:
|
|
242
|
-
saveToCurrentDashboard:
|
|
241
|
+
saveToLibrary: h.saveToLibrary,
|
|
242
|
+
saveToCurrentDashboard: h.saveToCurrentDashboard
|
|
243
243
|
});
|
|
244
244
|
};
|
|
245
|
-
return /* @__PURE__ */ t(
|
|
246
|
-
/* @__PURE__ */ s(
|
|
247
|
-
/* @__PURE__ */ s(
|
|
245
|
+
return /* @__PURE__ */ t(ue, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(me, { className: "sm:max-w-[500px]", children: [
|
|
246
|
+
/* @__PURE__ */ s(he, { children: [
|
|
247
|
+
/* @__PURE__ */ s(pe, { className: "flex items-center gap-2", children: [
|
|
248
248
|
/* @__PURE__ */ t("span", { children: "Save Visual As" }),
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
h.badgeType !== "local" && /* @__PURE__ */ t(
|
|
250
|
+
dt,
|
|
251
251
|
{
|
|
252
|
-
type:
|
|
252
|
+
type: h.badgeType,
|
|
253
253
|
showLabel: !0,
|
|
254
254
|
className: "px-2 py-0.5"
|
|
255
255
|
}
|
|
256
256
|
)
|
|
257
257
|
] }),
|
|
258
|
-
/* @__PURE__ */ t(
|
|
258
|
+
/* @__PURE__ */ t(fe, { children: h.description })
|
|
259
259
|
] }),
|
|
260
260
|
/* @__PURE__ */ s("div", { className: "grid gap-4 py-4", children: [
|
|
261
261
|
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
262
262
|
/* @__PURE__ */ t(Z, { htmlFor: "name", children: "Name" }),
|
|
263
263
|
/* @__PURE__ */ t(
|
|
264
|
-
|
|
264
|
+
Fe,
|
|
265
265
|
{
|
|
266
266
|
id: "name",
|
|
267
|
-
value:
|
|
268
|
-
onChange: (
|
|
267
|
+
value: m,
|
|
268
|
+
onChange: (E) => i(E.target.value),
|
|
269
269
|
placeholder: "Enter visual name",
|
|
270
|
-
disabled:
|
|
270
|
+
disabled: n
|
|
271
271
|
}
|
|
272
272
|
)
|
|
273
273
|
] }),
|
|
274
274
|
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
275
275
|
/* @__PURE__ */ t(Z, { htmlFor: "description", children: "Description (optional)" }),
|
|
276
276
|
/* @__PURE__ */ t(
|
|
277
|
-
|
|
277
|
+
Le,
|
|
278
278
|
{
|
|
279
279
|
id: "description",
|
|
280
280
|
value: r,
|
|
281
|
-
onChange: (
|
|
281
|
+
onChange: (E) => p(E.target.value),
|
|
282
282
|
placeholder: "Enter visual description",
|
|
283
283
|
rows: 3,
|
|
284
|
-
disabled:
|
|
284
|
+
disabled: n
|
|
285
285
|
}
|
|
286
286
|
)
|
|
287
287
|
] })
|
|
288
288
|
] }),
|
|
289
|
-
/* @__PURE__ */ s(
|
|
289
|
+
/* @__PURE__ */ s(Te, { children: [
|
|
290
290
|
/* @__PURE__ */ t(
|
|
291
|
-
|
|
291
|
+
I,
|
|
292
292
|
{
|
|
293
293
|
variant: "outline",
|
|
294
294
|
onClick: () => a(!1),
|
|
295
|
-
disabled:
|
|
295
|
+
disabled: n,
|
|
296
296
|
children: "Cancel"
|
|
297
297
|
}
|
|
298
298
|
),
|
|
299
|
-
/* @__PURE__ */ s(
|
|
300
|
-
|
|
301
|
-
|
|
299
|
+
/* @__PURE__ */ s(I, { onClick: y, disabled: !b || n, children: [
|
|
300
|
+
n && /* @__PURE__ */ t(q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
301
|
+
h.actionLabel
|
|
302
302
|
] })
|
|
303
303
|
] })
|
|
304
304
|
] }) });
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
const [e, a] =
|
|
306
|
+
function St() {
|
|
307
|
+
const [e, a] = T(!1), [v, l] = T(!1), [n, d] = T(null), [c, m] = T(null), i = j((u) => u.frame), r = j((u) => u.card), p = ke(), b = O((u) => u.selectedSheetId), h = O((u) => u.dashboard), y = O(
|
|
308
308
|
(u) => u.actions.setIsDashboardPanelOpen
|
|
309
|
-
), { getUpdatedFrame:
|
|
310
|
-
var u,
|
|
311
|
-
return ((u =
|
|
312
|
-
})(), F =
|
|
313
|
-
u != null && u.id && (
|
|
309
|
+
), { getUpdatedFrame: E } = Ee(), { selectVisual: f } = Pe(), { addFrame: w, setSelectedFrameId: S, setIsVisualEditing: C } = J(), o = ve(), x = !!(i != null && i.visualId), N = (() => {
|
|
310
|
+
var u, g;
|
|
311
|
+
return ((u = i == null ? void 0 : i.cards) == null ? void 0 : u.length) === 1 && ((g = i.cards[0]) != null && g.title) ? i.cards[0].title : p != null && p.title ? p.title : (r == null ? void 0 : r.title) || "Untitled Visual";
|
|
312
|
+
})(), F = Ue((u) => {
|
|
313
|
+
u != null && u.id && (f(u), v && n && c && b && (async () => {
|
|
314
314
|
try {
|
|
315
|
-
const
|
|
316
|
-
...
|
|
315
|
+
const g = {
|
|
316
|
+
...n,
|
|
317
317
|
id: ee(),
|
|
318
318
|
visualId: u.id
|
|
319
319
|
// Link to the newly created library visual
|
|
320
320
|
};
|
|
321
|
-
|
|
321
|
+
w(b, g, {
|
|
322
322
|
position: "end",
|
|
323
323
|
semanticExecutionPayload: c
|
|
324
|
-
}),
|
|
325
|
-
} catch (
|
|
324
|
+
}), S(g.id), l(!1), d(null), m(null), C(!1);
|
|
325
|
+
} catch (g) {
|
|
326
326
|
console.error(
|
|
327
327
|
"Failed to promote semantic metadata for saved visual:",
|
|
328
|
-
|
|
329
|
-
),
|
|
330
|
-
|
|
328
|
+
g
|
|
329
|
+
), P.error(
|
|
330
|
+
g instanceof Error ? g.message : "Failed to prepare semantic metadata for the saved visual"
|
|
331
331
|
);
|
|
332
332
|
}
|
|
333
|
-
})(),
|
|
333
|
+
})(), y(!0), a(!1));
|
|
334
334
|
});
|
|
335
335
|
return {
|
|
336
336
|
saveAsDialogOpen: e,
|
|
337
337
|
setSaveAsDialogOpen: a,
|
|
338
338
|
handleSaveAs: async (u) => {
|
|
339
|
-
if (!
|
|
340
|
-
|
|
339
|
+
if (!b) {
|
|
340
|
+
P.error("No sheet selected");
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
345
|
-
|
|
343
|
+
const g = E(), A = ge(g);
|
|
344
|
+
if (A) {
|
|
345
|
+
P.error(A);
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
|
-
const k =
|
|
349
|
-
...
|
|
350
|
-
cards:
|
|
351
|
-
...
|
|
348
|
+
const k = g.cards.length === 1 ? {
|
|
349
|
+
...g,
|
|
350
|
+
cards: g.cards.map((L) => ({
|
|
351
|
+
...L,
|
|
352
352
|
title: u.name
|
|
353
353
|
// Use visual name as card title
|
|
354
354
|
}))
|
|
355
|
-
} :
|
|
355
|
+
} : g;
|
|
356
356
|
if (u.saveToLibrary) {
|
|
357
|
-
let
|
|
357
|
+
let L = null;
|
|
358
358
|
if (u.saveToCurrentDashboard)
|
|
359
359
|
try {
|
|
360
|
-
|
|
361
|
-
previousFrame: G(
|
|
360
|
+
L = await o(k, {
|
|
361
|
+
previousFrame: G(h, k.id)
|
|
362
362
|
});
|
|
363
|
-
} catch (
|
|
363
|
+
} catch (V) {
|
|
364
364
|
console.error(
|
|
365
365
|
"Failed to prepare semantic metadata before saving visual:",
|
|
366
|
-
|
|
367
|
-
),
|
|
368
|
-
|
|
366
|
+
V
|
|
367
|
+
), P.error(
|
|
368
|
+
V instanceof Error ? V.message : "Failed to prepare semantic metadata for the saved visual"
|
|
369
369
|
);
|
|
370
370
|
return;
|
|
371
371
|
}
|
|
372
|
-
|
|
373
|
-
const
|
|
372
|
+
l(u.saveToCurrentDashboard), d(k), m(L);
|
|
373
|
+
const M = {
|
|
374
374
|
title: u.name,
|
|
375
375
|
description: u.description,
|
|
376
376
|
frameObject: k,
|
|
377
377
|
// Card title synced for single-card frames
|
|
378
378
|
isPrivate: !1
|
|
379
379
|
};
|
|
380
|
-
F.mutate(
|
|
380
|
+
F.mutate(M);
|
|
381
381
|
} else if (u.saveToCurrentDashboard) {
|
|
382
|
-
const
|
|
382
|
+
const L = {
|
|
383
383
|
...k,
|
|
384
384
|
// Card title already synced
|
|
385
385
|
id: ee(),
|
|
@@ -387,146 +387,152 @@ function At() {
|
|
|
387
387
|
// Explicitly no visualId for local visuals
|
|
388
388
|
};
|
|
389
389
|
try {
|
|
390
|
-
const
|
|
391
|
-
previousFrame: G(
|
|
390
|
+
const M = await o(k, {
|
|
391
|
+
previousFrame: G(h, k.id)
|
|
392
392
|
});
|
|
393
|
-
|
|
393
|
+
w(b, L, {
|
|
394
394
|
position: "end",
|
|
395
|
-
semanticExecutionPayload:
|
|
396
|
-
}),
|
|
397
|
-
} catch (
|
|
398
|
-
console.error("Failed to save visual to dashboard:",
|
|
399
|
-
|
|
395
|
+
semanticExecutionPayload: M
|
|
396
|
+
}), S(L.id), P.success("Visual saved to dashboard"), a(!1), C(!1);
|
|
397
|
+
} catch (M) {
|
|
398
|
+
console.error("Failed to save visual to dashboard:", M), P.error(
|
|
399
|
+
M instanceof Error ? M.message : "Failed to prepare semantic metadata for the visual"
|
|
400
400
|
);
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
},
|
|
404
|
-
isLibraryVisual:
|
|
405
|
-
currentVisualName:
|
|
404
|
+
isLibraryVisual: x,
|
|
405
|
+
currentVisualName: N,
|
|
406
406
|
isSaving: F.isPending
|
|
407
407
|
};
|
|
408
408
|
}
|
|
409
|
-
function
|
|
410
|
-
const a = j((
|
|
409
|
+
function Bt(e = {}) {
|
|
410
|
+
const a = j((D) => D.frame), v = j((D) => D.editorContext), l = Me((D) => D.selectedVisual), n = O((D) => D.selectedFrameId), d = O((D) => D.selectedSheetId), c = O((D) => D.dashboard), { setIsVisualEditing: m, updateFrame: i } = J(), [r, p] = T(!1), [b, h] = T("both"), y = ve(), E = (v == null ? void 0 : v.type) === "documentSection", f = !!(a != null && a.visualId || l != null && l.id), w = !!(a != null && a.visualId && n), S = f && !w, {
|
|
411
411
|
saveAsDialogOpen: C,
|
|
412
|
-
setSaveAsDialogOpen:
|
|
413
|
-
handleSaveAs:
|
|
414
|
-
isLibraryVisual:
|
|
415
|
-
currentVisualName:
|
|
416
|
-
isSaving:
|
|
417
|
-
} =
|
|
418
|
-
|
|
419
|
-
|
|
412
|
+
setSaveAsDialogOpen: o,
|
|
413
|
+
handleSaveAs: x,
|
|
414
|
+
isLibraryVisual: N,
|
|
415
|
+
currentVisualName: F,
|
|
416
|
+
isSaving: U
|
|
417
|
+
} = St(), { getUpdatedFrame: u } = Ee();
|
|
418
|
+
if (E)
|
|
419
|
+
return /* @__PURE__ */ s(_, { children: [
|
|
420
|
+
/* @__PURE__ */ t(se, { className: "rounded-[5px]", variant: "default" }),
|
|
421
|
+
/* @__PURE__ */ t(re, {})
|
|
422
|
+
] });
|
|
423
|
+
const g = async () => {
|
|
424
|
+
if (!d) {
|
|
425
|
+
P.error("No sheet selected");
|
|
420
426
|
return;
|
|
421
427
|
}
|
|
422
|
-
if (
|
|
423
|
-
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
426
|
-
|
|
428
|
+
if (r) return;
|
|
429
|
+
p(!0);
|
|
430
|
+
const D = u(), k = ge(D);
|
|
431
|
+
if (k) {
|
|
432
|
+
p(!1), P.error(k);
|
|
427
433
|
return;
|
|
428
434
|
}
|
|
429
|
-
const
|
|
430
|
-
...
|
|
435
|
+
const L = {
|
|
436
|
+
...D,
|
|
431
437
|
visualId: void 0
|
|
432
|
-
},
|
|
438
|
+
}, M = G(c, L.id);
|
|
433
439
|
try {
|
|
434
|
-
const
|
|
435
|
-
previousFrame:
|
|
440
|
+
const V = await y(L, {
|
|
441
|
+
previousFrame: M
|
|
436
442
|
});
|
|
437
|
-
|
|
438
|
-
semanticExecutionPayload:
|
|
443
|
+
i(d, L, {
|
|
444
|
+
semanticExecutionPayload: V
|
|
439
445
|
});
|
|
440
|
-
} catch (
|
|
441
|
-
console.error("Failed to apply local semantic metadata:",
|
|
442
|
-
|
|
446
|
+
} catch (V) {
|
|
447
|
+
console.error("Failed to apply local semantic metadata:", V), p(!1), P.error(
|
|
448
|
+
V instanceof Error ? V.message : "Failed to prepare semantic metadata for this visual"
|
|
443
449
|
);
|
|
444
450
|
return;
|
|
445
451
|
}
|
|
446
452
|
setTimeout(() => {
|
|
447
|
-
|
|
453
|
+
p(!1), P.success("Changes applied. Visual is now local to this dashboard"), m(!1);
|
|
448
454
|
}, 300);
|
|
449
|
-
},
|
|
450
|
-
|
|
455
|
+
}, A = (D) => {
|
|
456
|
+
h(D), o(!0);
|
|
451
457
|
};
|
|
452
|
-
return /* @__PURE__ */ s(
|
|
458
|
+
return /* @__PURE__ */ s(_, { children: [
|
|
453
459
|
/* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-[5px]", children: [
|
|
454
|
-
!
|
|
455
|
-
|
|
460
|
+
!f && /* @__PURE__ */ t(
|
|
461
|
+
se,
|
|
456
462
|
{
|
|
457
463
|
className: "rounded-none",
|
|
458
464
|
variant: "default"
|
|
459
465
|
}
|
|
460
466
|
),
|
|
461
|
-
|
|
462
|
-
|
|
467
|
+
f && S && /* @__PURE__ */ t(
|
|
468
|
+
ct,
|
|
463
469
|
{
|
|
464
470
|
className: "rounded-none",
|
|
465
471
|
variant: "default"
|
|
466
472
|
}
|
|
467
473
|
),
|
|
468
|
-
|
|
469
|
-
/* @__PURE__ */ s(
|
|
470
|
-
/* @__PURE__ */ t(
|
|
471
|
-
|
|
474
|
+
f && w && /* @__PURE__ */ t(ut, { className: "rounded-none" }),
|
|
475
|
+
/* @__PURE__ */ s(be, { modal: !1, children: [
|
|
476
|
+
/* @__PURE__ */ t(xe, { asChild: !0, children: /* @__PURE__ */ t(
|
|
477
|
+
I,
|
|
472
478
|
{
|
|
473
479
|
variant: "default",
|
|
474
480
|
size: "xs",
|
|
475
481
|
className: "w-7 rounded-none border-l border-primary-foreground/20 px-0",
|
|
476
482
|
"aria-label": "Open visual save options",
|
|
477
|
-
disabled:
|
|
478
|
-
children: /* @__PURE__ */ t(
|
|
483
|
+
disabled: U || r,
|
|
484
|
+
children: /* @__PURE__ */ t(ye, { className: "h-3.5 w-3.5" })
|
|
479
485
|
}
|
|
480
486
|
) }),
|
|
481
487
|
/* @__PURE__ */ s(
|
|
482
|
-
|
|
488
|
+
we,
|
|
483
489
|
{
|
|
484
490
|
align: "end",
|
|
485
491
|
className: "min-w-[220px] rounded-[6px] border border-border/60 p-1 shadow-sm",
|
|
486
492
|
children: [
|
|
487
|
-
|
|
493
|
+
w && /* @__PURE__ */ s(_, { children: [
|
|
488
494
|
/* @__PURE__ */ s(
|
|
489
|
-
|
|
495
|
+
R,
|
|
490
496
|
{
|
|
491
|
-
onClick:
|
|
492
|
-
disabled:
|
|
497
|
+
onClick: g,
|
|
498
|
+
disabled: r,
|
|
493
499
|
children: [
|
|
494
|
-
/* @__PURE__ */ t(
|
|
495
|
-
|
|
500
|
+
/* @__PURE__ */ t(Ve, { className: "h-3.5 w-3.5" }),
|
|
501
|
+
r ? "Applying..." : "Apply Locally"
|
|
496
502
|
]
|
|
497
503
|
}
|
|
498
504
|
),
|
|
499
|
-
/* @__PURE__ */ t(
|
|
505
|
+
/* @__PURE__ */ t(Oe, {})
|
|
500
506
|
] }),
|
|
501
507
|
/* @__PURE__ */ s(
|
|
502
|
-
|
|
508
|
+
R,
|
|
503
509
|
{
|
|
504
|
-
onClick: () =>
|
|
505
|
-
disabled:
|
|
510
|
+
onClick: () => A("local"),
|
|
511
|
+
disabled: U,
|
|
506
512
|
children: [
|
|
507
|
-
/* @__PURE__ */ t(
|
|
513
|
+
/* @__PURE__ */ t(Be, { className: "h-3.5 w-3.5" }),
|
|
508
514
|
"Add to Dashboard (Local)"
|
|
509
515
|
]
|
|
510
516
|
}
|
|
511
517
|
),
|
|
512
518
|
/* @__PURE__ */ s(
|
|
513
|
-
|
|
519
|
+
R,
|
|
514
520
|
{
|
|
515
|
-
onClick: () =>
|
|
516
|
-
disabled:
|
|
521
|
+
onClick: () => A("library"),
|
|
522
|
+
disabled: U,
|
|
517
523
|
children: [
|
|
518
|
-
/* @__PURE__ */ t(
|
|
524
|
+
/* @__PURE__ */ t(mt, { className: "h-3.5 w-3.5" }),
|
|
519
525
|
"Save as Library Visual"
|
|
520
526
|
]
|
|
521
527
|
}
|
|
522
528
|
),
|
|
523
529
|
/* @__PURE__ */ s(
|
|
524
|
-
|
|
530
|
+
R,
|
|
525
531
|
{
|
|
526
|
-
onClick: () =>
|
|
527
|
-
disabled:
|
|
532
|
+
onClick: () => A("both"),
|
|
533
|
+
disabled: U,
|
|
528
534
|
children: [
|
|
529
|
-
/* @__PURE__ */ t(
|
|
535
|
+
/* @__PURE__ */ t(ht, { className: "h-3.5 w-3.5" }),
|
|
530
536
|
"Save Copy as Linked Visual"
|
|
531
537
|
]
|
|
532
538
|
}
|
|
@@ -536,74 +542,42 @@ function Ot(e = {}) {
|
|
|
536
542
|
)
|
|
537
543
|
] })
|
|
538
544
|
] }),
|
|
539
|
-
/* @__PURE__ */ t(
|
|
545
|
+
/* @__PURE__ */ t(re, {}),
|
|
540
546
|
/* @__PURE__ */ t(
|
|
541
547
|
Et,
|
|
542
548
|
{
|
|
543
549
|
open: C,
|
|
544
|
-
onOpenChange: (
|
|
545
|
-
|
|
550
|
+
onOpenChange: (D) => {
|
|
551
|
+
U || o(D);
|
|
546
552
|
},
|
|
547
|
-
isLibraryVisual:
|
|
548
|
-
currentVisualName:
|
|
549
|
-
isSaving:
|
|
550
|
-
destinationMode:
|
|
551
|
-
onConfirm:
|
|
553
|
+
isLibraryVisual: N,
|
|
554
|
+
currentVisualName: F,
|
|
555
|
+
isSaving: U,
|
|
556
|
+
destinationMode: b,
|
|
557
|
+
onConfirm: x
|
|
552
558
|
}
|
|
553
559
|
)
|
|
554
560
|
] });
|
|
555
561
|
}
|
|
556
562
|
function zt({ className: e }) {
|
|
557
|
-
const a = j((
|
|
558
|
-
if (!
|
|
563
|
+
const a = j((r) => r.isDevMode), v = O((r) => r.isVisualEditing), { setIsDevMode: l } = ze(), { config: n } = Ae(Re).tokenProps, d = (n == null ? void 0 : n.showAdvancedMode) !== !1;
|
|
564
|
+
if (!v || !d)
|
|
559
565
|
return null;
|
|
560
|
-
const c =
|
|
566
|
+
const c = a ? Y : $e, m = a ? "Drag & drop" : "SQL", i = a ? "Switch to drag-and-drop mode" : "Switch to SQL mode";
|
|
561
567
|
return /* @__PURE__ */ s(
|
|
562
|
-
"
|
|
568
|
+
"button",
|
|
563
569
|
{
|
|
564
|
-
|
|
565
|
-
"aria-label":
|
|
566
|
-
|
|
567
|
-
|
|
570
|
+
type: "button",
|
|
571
|
+
"aria-label": i,
|
|
572
|
+
title: i,
|
|
573
|
+
onClick: () => l(!a),
|
|
574
|
+
className: H(
|
|
575
|
+
"inline-flex h-7 items-center gap-1.5 rounded-[5px] border border-border bg-background px-2 text-[12px] font-medium text-foreground transition-colors hover:bg-muted/40",
|
|
568
576
|
e
|
|
569
577
|
),
|
|
570
578
|
children: [
|
|
571
|
-
/* @__PURE__ */
|
|
572
|
-
|
|
573
|
-
{
|
|
574
|
-
type: "button",
|
|
575
|
-
variant: "ghost",
|
|
576
|
-
size: "xs",
|
|
577
|
-
role: "radio",
|
|
578
|
-
"aria-checked": !a,
|
|
579
|
-
className: O(c, !a && h),
|
|
580
|
-
onClick: () => d(!1),
|
|
581
|
-
children: [
|
|
582
|
-
/* @__PURE__ */ t(Y, { className: "h-3.5 w-3.5" }),
|
|
583
|
-
"Drag & drop"
|
|
584
|
-
]
|
|
585
|
-
}
|
|
586
|
-
),
|
|
587
|
-
/* @__PURE__ */ s(
|
|
588
|
-
A,
|
|
589
|
-
{
|
|
590
|
-
type: "button",
|
|
591
|
-
variant: "ghost",
|
|
592
|
-
size: "xs",
|
|
593
|
-
role: "radio",
|
|
594
|
-
"aria-checked": a,
|
|
595
|
-
className: O(
|
|
596
|
-
c,
|
|
597
|
-
"border-l border-border/60",
|
|
598
|
-
a && h
|
|
599
|
-
),
|
|
600
|
-
onClick: () => d(!0),
|
|
601
|
-
children: [
|
|
602
|
-
/* @__PURE__ */ t(ze, { className: "h-3.5 w-3.5" }),
|
|
603
|
-
"SQL"
|
|
604
|
-
]
|
|
605
|
-
}
|
|
606
|
-
)
|
|
579
|
+
/* @__PURE__ */ t(c, { className: "h-3 w-3 text-muted-foreground" }),
|
|
580
|
+
m
|
|
607
581
|
]
|
|
608
582
|
}
|
|
609
583
|
);
|
|
@@ -611,61 +585,61 @@ function zt({ className: e }) {
|
|
|
611
585
|
function Rt({
|
|
612
586
|
open: e,
|
|
613
587
|
onOpenChange: a,
|
|
614
|
-
onSave:
|
|
615
|
-
onDiscard:
|
|
616
|
-
isSaving:
|
|
617
|
-
title:
|
|
588
|
+
onSave: v,
|
|
589
|
+
onDiscard: l,
|
|
590
|
+
isSaving: n,
|
|
591
|
+
title: d = "Unsaved changes",
|
|
618
592
|
description: c = "You have unsaved changes to this dashboard. What would you like to do?",
|
|
619
|
-
cancelLabel:
|
|
620
|
-
discardLabel:
|
|
593
|
+
cancelLabel: m = "Cancel",
|
|
594
|
+
discardLabel: i = "Discard",
|
|
621
595
|
saveLabel: r = "Save"
|
|
622
596
|
}) {
|
|
623
|
-
return /* @__PURE__ */ t(
|
|
624
|
-
!
|
|
625
|
-
}, children: /* @__PURE__ */ s(
|
|
626
|
-
/* @__PURE__ */ s(
|
|
627
|
-
/* @__PURE__ */ t(
|
|
628
|
-
/* @__PURE__ */ t(
|
|
597
|
+
return /* @__PURE__ */ t(_e, { open: e, onOpenChange: (b) => {
|
|
598
|
+
!b && n || a(b);
|
|
599
|
+
}, children: /* @__PURE__ */ s(He, { children: [
|
|
600
|
+
/* @__PURE__ */ s(je, { children: [
|
|
601
|
+
/* @__PURE__ */ t(Xe, { children: d }),
|
|
602
|
+
/* @__PURE__ */ t(Ge, { children: c })
|
|
629
603
|
] }),
|
|
630
|
-
/* @__PURE__ */ s(
|
|
604
|
+
/* @__PURE__ */ s(Ke, { children: [
|
|
631
605
|
/* @__PURE__ */ t(
|
|
632
|
-
|
|
606
|
+
I,
|
|
633
607
|
{
|
|
634
608
|
type: "button",
|
|
635
609
|
size: "xs",
|
|
636
|
-
onClick:
|
|
637
|
-
disabled:
|
|
610
|
+
onClick: l,
|
|
611
|
+
disabled: n,
|
|
638
612
|
variant: "ghost",
|
|
639
613
|
className: "mr-auto text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",
|
|
640
|
-
children:
|
|
614
|
+
children: i
|
|
641
615
|
}
|
|
642
616
|
),
|
|
643
|
-
/* @__PURE__ */ t(
|
|
644
|
-
/* @__PURE__ */ t(
|
|
645
|
-
/* @__PURE__ */ t(
|
|
617
|
+
/* @__PURE__ */ t(Qe, { disabled: n, children: m }),
|
|
618
|
+
/* @__PURE__ */ t(I, { type: "button", size: "xs", onClick: v, disabled: n, children: n ? /* @__PURE__ */ s(_, { children: [
|
|
619
|
+
/* @__PURE__ */ t(q, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
646
620
|
"Saving..."
|
|
647
621
|
] }) : r })
|
|
648
622
|
] })
|
|
649
623
|
] }) });
|
|
650
624
|
}
|
|
651
|
-
function
|
|
625
|
+
function At({
|
|
652
626
|
export: e,
|
|
653
627
|
onRemove: a
|
|
654
628
|
}) {
|
|
655
|
-
const
|
|
629
|
+
const v = () => {
|
|
656
630
|
e.downloadUrl && window.open(e.downloadUrl, "_blank");
|
|
657
|
-
},
|
|
658
|
-
|
|
659
|
-
},
|
|
631
|
+
}, l = (m) => {
|
|
632
|
+
m.stopPropagation(), a == null || a(e.id);
|
|
633
|
+
}, n = () => {
|
|
660
634
|
switch (e.status) {
|
|
661
635
|
case "completed":
|
|
662
|
-
return /* @__PURE__ */ t(
|
|
636
|
+
return /* @__PURE__ */ t(Ze, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
663
637
|
case "failed":
|
|
664
638
|
return /* @__PURE__ */ t(pt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
665
639
|
default:
|
|
666
|
-
return /* @__PURE__ */ t(
|
|
640
|
+
return /* @__PURE__ */ t(q, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
667
641
|
}
|
|
668
|
-
},
|
|
642
|
+
}, d = Q(e.status), c = (() => {
|
|
669
643
|
switch (e.status) {
|
|
670
644
|
case "pending":
|
|
671
645
|
return "Queued...";
|
|
@@ -682,7 +656,7 @@ function St({
|
|
|
682
656
|
return /* @__PURE__ */ s("div", { className: "group p-4 transition-colors hover:bg-muted/50", children: [
|
|
683
657
|
/* @__PURE__ */ s("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
684
658
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
685
|
-
|
|
659
|
+
n(),
|
|
686
660
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
687
661
|
/* @__PURE__ */ t("h4", { className: "mb-1 truncate text-sm font-medium", children: e.title }),
|
|
688
662
|
e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
@@ -690,22 +664,22 @@ function St({
|
|
|
690
664
|
e.totalRows.toLocaleString(),
|
|
691
665
|
" rows"
|
|
692
666
|
] }),
|
|
693
|
-
e.fileSize && /* @__PURE__ */ s(
|
|
667
|
+
e.fileSize && /* @__PURE__ */ s(_, { children: [
|
|
694
668
|
/* @__PURE__ */ t("span", { children: "•" }),
|
|
695
669
|
/* @__PURE__ */ t("span", { children: We(e.fileSize) })
|
|
696
670
|
] })
|
|
697
671
|
] }),
|
|
698
|
-
|
|
672
|
+
d && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: c }),
|
|
699
673
|
e.status === "failed" && /* @__PURE__ */ t("div", { className: "line-clamp-2 text-xs text-destructive", children: e.error || "Export failed" })
|
|
700
674
|
] })
|
|
701
675
|
] }),
|
|
702
676
|
/* @__PURE__ */ t(
|
|
703
|
-
|
|
677
|
+
I,
|
|
704
678
|
{
|
|
705
679
|
variant: "ghost",
|
|
706
680
|
size: "icon",
|
|
707
681
|
className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
|
|
708
|
-
onClick:
|
|
682
|
+
onClick: l,
|
|
709
683
|
"aria-label": "Remove notification",
|
|
710
684
|
children: /* @__PURE__ */ t(qe, { className: "h-4 w-4" })
|
|
711
685
|
}
|
|
@@ -713,188 +687,188 @@ function St({
|
|
|
713
687
|
] }),
|
|
714
688
|
/* @__PURE__ */ s("div", { className: "ml-8", children: [
|
|
715
689
|
e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
716
|
-
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children:
|
|
690
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: oe(e.startedAt, { addSuffix: !0 }) }),
|
|
717
691
|
e.downloadUrl && /* @__PURE__ */ s(
|
|
718
|
-
|
|
692
|
+
I,
|
|
719
693
|
{
|
|
720
694
|
size: "sm",
|
|
721
695
|
variant: "outline",
|
|
722
696
|
className: "h-8 bg-transparent",
|
|
723
|
-
onClick:
|
|
697
|
+
onClick: v,
|
|
724
698
|
children: [
|
|
725
|
-
/* @__PURE__ */ t(
|
|
699
|
+
/* @__PURE__ */ t(Je, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
726
700
|
"Download"
|
|
727
701
|
]
|
|
728
702
|
}
|
|
729
703
|
)
|
|
730
704
|
] }),
|
|
731
|
-
|
|
732
|
-
/* @__PURE__ */ t(
|
|
705
|
+
d && /* @__PURE__ */ s("div", { children: [
|
|
706
|
+
/* @__PURE__ */ t(Ye, { value: e.progress, className: "h-1.5" }),
|
|
733
707
|
/* @__PURE__ */ s("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
|
|
734
708
|
e.progress,
|
|
735
709
|
"% complete"
|
|
736
710
|
] })
|
|
737
711
|
] }),
|
|
738
|
-
e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children:
|
|
712
|
+
e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: oe(e.startedAt, { addSuffix: !0 }) })
|
|
739
713
|
] })
|
|
740
714
|
] });
|
|
741
715
|
}
|
|
742
716
|
function It() {
|
|
743
|
-
const { authToken: e, tokenProps: a } =
|
|
744
|
-
(
|
|
745
|
-
),
|
|
746
|
-
(
|
|
747
|
-
),
|
|
748
|
-
const
|
|
749
|
-
if (!(!
|
|
750
|
-
|
|
717
|
+
const { authToken: e, tokenProps: a } = K(), v = z((f) => f.activeExports), { clearCompleted: l, removeExport: n, updateExport: d } = ce(), [c, m] = T(!1), [i, r] = T(!1), p = Array.from(v.values()).sort(
|
|
718
|
+
(f, w) => w.startedAt.getTime() - f.startedAt.getTime()
|
|
719
|
+
), b = p.some(
|
|
720
|
+
(f) => f.status === "completed" || f.status === "failed"
|
|
721
|
+
), h = $(async () => {
|
|
722
|
+
const f = a == null ? void 0 : a.apiServiceUrl, w = e == null ? void 0 : e.accessToken;
|
|
723
|
+
if (!(!f || !w)) {
|
|
724
|
+
m(!0);
|
|
751
725
|
try {
|
|
752
|
-
const
|
|
726
|
+
const S = Array.from(v.values());
|
|
753
727
|
await Promise.all(
|
|
754
|
-
|
|
728
|
+
S.map(async (C) => {
|
|
755
729
|
try {
|
|
756
|
-
const
|
|
757
|
-
let
|
|
758
|
-
if (
|
|
730
|
+
const o = await de(f, w, C.id);
|
|
731
|
+
let x;
|
|
732
|
+
if (o.status === "completed")
|
|
759
733
|
try {
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
734
|
+
x = await W(
|
|
735
|
+
f,
|
|
736
|
+
w,
|
|
737
|
+
C.id
|
|
764
738
|
);
|
|
765
|
-
} catch (
|
|
766
|
-
console.error(`Failed to get download URL for ${
|
|
739
|
+
} catch (N) {
|
|
740
|
+
console.error(`Failed to get download URL for ${C.id}:`, N);
|
|
767
741
|
}
|
|
768
|
-
|
|
769
|
-
status:
|
|
770
|
-
progress:
|
|
771
|
-
completedChunks:
|
|
772
|
-
completedAt:
|
|
742
|
+
d(C.id, {
|
|
743
|
+
status: o.status,
|
|
744
|
+
progress: o.progress,
|
|
745
|
+
completedChunks: o.completedChunks,
|
|
746
|
+
completedAt: o.completedAt ? new Date(o.completedAt) : void 0,
|
|
773
747
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
774
|
-
fileSize:
|
|
775
|
-
error:
|
|
776
|
-
downloadUrl:
|
|
748
|
+
fileSize: o.fileSize,
|
|
749
|
+
error: o.error,
|
|
750
|
+
downloadUrl: x
|
|
777
751
|
});
|
|
778
|
-
} catch (
|
|
779
|
-
console.error(`Failed to refresh export ${
|
|
752
|
+
} catch (o) {
|
|
753
|
+
console.error(`Failed to refresh export ${C.id}:`, o);
|
|
780
754
|
}
|
|
781
755
|
})
|
|
782
756
|
);
|
|
783
757
|
} finally {
|
|
784
|
-
|
|
758
|
+
m(!1);
|
|
785
759
|
}
|
|
786
760
|
}
|
|
787
761
|
}, [
|
|
788
|
-
|
|
762
|
+
v,
|
|
789
763
|
e == null ? void 0 : e.accessToken,
|
|
790
764
|
a == null ? void 0 : a.apiServiceUrl,
|
|
791
|
-
|
|
792
|
-
]),
|
|
793
|
-
const
|
|
794
|
-
if (!
|
|
795
|
-
|
|
765
|
+
d
|
|
766
|
+
]), y = $(async () => {
|
|
767
|
+
const f = a == null ? void 0 : a.apiServiceUrl, w = e == null ? void 0 : e.accessToken;
|
|
768
|
+
if (!f || !w) {
|
|
769
|
+
l();
|
|
796
770
|
return;
|
|
797
771
|
}
|
|
798
772
|
r(!0);
|
|
799
773
|
try {
|
|
800
|
-
const
|
|
801
|
-
(
|
|
802
|
-
),
|
|
803
|
-
|
|
774
|
+
const S = p.filter(
|
|
775
|
+
(o) => o.status === "completed" || o.status === "failed"
|
|
776
|
+
), C = await Promise.allSettled(
|
|
777
|
+
S.map(async (o) => (await te(f, w, o.id), o.id))
|
|
804
778
|
);
|
|
805
|
-
for (const
|
|
806
|
-
|
|
779
|
+
for (const o of C)
|
|
780
|
+
o.status === "fulfilled" ? n(o.value) : console.error("Failed to delete export:", o.reason);
|
|
807
781
|
} finally {
|
|
808
782
|
r(!1);
|
|
809
783
|
}
|
|
810
784
|
}, [
|
|
811
|
-
|
|
785
|
+
p,
|
|
812
786
|
a == null ? void 0 : a.apiServiceUrl,
|
|
813
787
|
e == null ? void 0 : e.accessToken,
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
]),
|
|
817
|
-
async (
|
|
818
|
-
const
|
|
819
|
-
if (
|
|
788
|
+
l,
|
|
789
|
+
n
|
|
790
|
+
]), E = $(
|
|
791
|
+
async (f) => {
|
|
792
|
+
const w = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
|
|
793
|
+
if (w && S)
|
|
820
794
|
try {
|
|
821
|
-
await te(
|
|
795
|
+
await te(w, S, f), n(f);
|
|
822
796
|
return;
|
|
823
|
-
} catch (
|
|
824
|
-
console.error(`Failed to cancel export ${
|
|
797
|
+
} catch (C) {
|
|
798
|
+
console.error(`Failed to cancel export ${f}:`, C);
|
|
825
799
|
}
|
|
826
|
-
|
|
800
|
+
n(f);
|
|
827
801
|
},
|
|
828
|
-
[a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken,
|
|
802
|
+
[a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, n]
|
|
829
803
|
);
|
|
830
|
-
return
|
|
831
|
-
/* @__PURE__ */ t(
|
|
804
|
+
return p.length === 0 ? /* @__PURE__ */ s("div", { className: "p-6 text-center", children: [
|
|
805
|
+
/* @__PURE__ */ t(ne, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
|
|
832
806
|
/* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: "No active exports" }),
|
|
833
807
|
/* @__PURE__ */ t("p", { className: "mt-1 text-xs text-muted-foreground", children: "Large exports will appear here" })
|
|
834
808
|
] }) : /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
|
|
835
809
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between border-b px-4 py-3", children: [
|
|
836
810
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
837
|
-
/* @__PURE__ */ t(
|
|
811
|
+
/* @__PURE__ */ t(ne, { className: "h-5 w-5 text-muted-foreground" }),
|
|
838
812
|
/* @__PURE__ */ t("h4", { className: "font-semibold", children: "Exports" })
|
|
839
813
|
] }),
|
|
840
814
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
841
815
|
/* @__PURE__ */ t(
|
|
842
|
-
|
|
816
|
+
I,
|
|
843
817
|
{
|
|
844
818
|
variant: "ghost",
|
|
845
819
|
size: "sm",
|
|
846
820
|
className: "h-7 w-7 p-0",
|
|
847
|
-
onClick:
|
|
821
|
+
onClick: h,
|
|
848
822
|
disabled: c,
|
|
849
823
|
title: "Refresh status",
|
|
850
824
|
children: /* @__PURE__ */ t(
|
|
851
|
-
|
|
825
|
+
et,
|
|
852
826
|
{
|
|
853
827
|
className: `h-4 w-4 ${c ? "animate-spin" : ""}`
|
|
854
828
|
}
|
|
855
829
|
)
|
|
856
830
|
}
|
|
857
831
|
),
|
|
858
|
-
|
|
859
|
-
|
|
832
|
+
b && /* @__PURE__ */ t(
|
|
833
|
+
I,
|
|
860
834
|
{
|
|
861
835
|
variant: "ghost",
|
|
862
836
|
size: "sm",
|
|
863
837
|
className: "h-7 px-2 text-sm",
|
|
864
|
-
onClick:
|
|
865
|
-
disabled:
|
|
866
|
-
children:
|
|
838
|
+
onClick: y,
|
|
839
|
+
disabled: i,
|
|
840
|
+
children: i ? "Clearing..." : "Clear all"
|
|
867
841
|
}
|
|
868
842
|
)
|
|
869
843
|
] })
|
|
870
844
|
] }),
|
|
871
|
-
/* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children:
|
|
872
|
-
|
|
845
|
+
/* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: p.map((f) => /* @__PURE__ */ t(
|
|
846
|
+
At,
|
|
873
847
|
{
|
|
874
|
-
export:
|
|
875
|
-
onRemove:
|
|
848
|
+
export: f,
|
|
849
|
+
onRemove: E
|
|
876
850
|
},
|
|
877
|
-
|
|
851
|
+
f.id
|
|
878
852
|
)) }) })
|
|
879
853
|
] });
|
|
880
854
|
}
|
|
881
|
-
function
|
|
855
|
+
function $t({
|
|
882
856
|
variant: e
|
|
883
857
|
}) {
|
|
884
|
-
const a =
|
|
885
|
-
(
|
|
886
|
-
), c =
|
|
887
|
-
return /* @__PURE__ */ s(
|
|
888
|
-
/* @__PURE__ */ t(
|
|
889
|
-
|
|
858
|
+
const a = z((i) => i.activeExports), v = tt(), l = a.size > 0, n = Array.from(a.values()).some(
|
|
859
|
+
(i) => i.status === "completed" || i.status === "failed"
|
|
860
|
+
), c = v > 0 ? v > 9 ? "9+" : String(v) : null;
|
|
861
|
+
return /* @__PURE__ */ s(Ce, { children: [
|
|
862
|
+
/* @__PURE__ */ t(De, { asChild: !0, children: /* @__PURE__ */ s(
|
|
863
|
+
I,
|
|
890
864
|
{
|
|
891
865
|
variant: e ?? "ghost",
|
|
892
866
|
size: "xs",
|
|
893
867
|
className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
894
868
|
"aria-label": "Export notifications",
|
|
895
869
|
children: [
|
|
896
|
-
/* @__PURE__ */ t(
|
|
897
|
-
|
|
870
|
+
/* @__PURE__ */ t(at, { className: "h-3.5 w-3.5" }),
|
|
871
|
+
l && /* @__PURE__ */ t(
|
|
898
872
|
"span",
|
|
899
873
|
{
|
|
900
874
|
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${c ? "-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"}`,
|
|
@@ -904,7 +878,7 @@ function _t({
|
|
|
904
878
|
]
|
|
905
879
|
}
|
|
906
880
|
) }),
|
|
907
|
-
/* @__PURE__ */ t(
|
|
881
|
+
/* @__PURE__ */ t(Ne, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(It, {}) })
|
|
908
882
|
] });
|
|
909
883
|
}
|
|
910
884
|
function Ft(e) {
|
|
@@ -916,140 +890,140 @@ function Ft(e) {
|
|
|
916
890
|
affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
|
|
917
891
|
};
|
|
918
892
|
}
|
|
919
|
-
function
|
|
893
|
+
function _t({
|
|
920
894
|
open: e,
|
|
921
895
|
onOpenChange: a,
|
|
922
|
-
trigger:
|
|
923
|
-
showTrigger:
|
|
924
|
-
initialMode:
|
|
896
|
+
trigger: v,
|
|
897
|
+
showTrigger: l = !0,
|
|
898
|
+
initialMode: n = "manage"
|
|
925
899
|
}) {
|
|
926
|
-
const
|
|
900
|
+
const d = n === "create", {
|
|
927
901
|
forceClose: c,
|
|
928
|
-
handleOpenChange:
|
|
929
|
-
isCreateFlowActive:
|
|
902
|
+
handleOpenChange: m,
|
|
903
|
+
isCreateFlowActive: i,
|
|
930
904
|
preventPassiveDismissDuringCreate: r,
|
|
931
|
-
resolvedOpen:
|
|
932
|
-
setIsCreateFlowActive:
|
|
905
|
+
resolvedOpen: p,
|
|
906
|
+
setIsCreateFlowActive: b
|
|
933
907
|
} = ft({
|
|
934
908
|
open: e,
|
|
935
909
|
onOpenChange: a,
|
|
936
|
-
initialCreateFlowActive:
|
|
910
|
+
initialCreateFlowActive: n === "create",
|
|
937
911
|
// Dialog mode renders a built-in X close button — allow explicit
|
|
938
912
|
// closes through `handleOpenChange`. Popover mode has no X; its
|
|
939
913
|
// only close-via-trigger path is a re-click that would silently
|
|
940
914
|
// wipe the in-progress create flow, so block everything during
|
|
941
915
|
// create and make consumers use `forceClose()` from a dedicated
|
|
942
916
|
// button.
|
|
943
|
-
dismissMode:
|
|
944
|
-
}),
|
|
917
|
+
dismissMode: l ? "passive" : "explicit-only"
|
|
918
|
+
}), h = O((u) => u.dashboard), { setDashboardControlsModel: y } = J(), { participants: E } = st(rt(h)), f = Array.from(
|
|
945
919
|
new Map(
|
|
946
|
-
|
|
947
|
-
(u) => u.fieldChoices.map((
|
|
948
|
-
var
|
|
920
|
+
E.flatMap(
|
|
921
|
+
(u) => u.fieldChoices.map((g) => {
|
|
922
|
+
var A;
|
|
949
923
|
return [
|
|
950
|
-
|
|
924
|
+
g.value,
|
|
951
925
|
{
|
|
952
|
-
option:
|
|
953
|
-
target: (
|
|
926
|
+
option: g,
|
|
927
|
+
target: (A = u.fieldTargetMap) == null ? void 0 : A[g.value]
|
|
954
928
|
}
|
|
955
929
|
];
|
|
956
930
|
})
|
|
957
931
|
)
|
|
958
932
|
).values()
|
|
959
|
-
),
|
|
933
|
+
), w = Array.from(
|
|
960
934
|
new Map(
|
|
961
|
-
|
|
962
|
-
(u) => u.metricChoices.map((
|
|
963
|
-
var
|
|
935
|
+
E.flatMap(
|
|
936
|
+
(u) => u.metricChoices.map((g) => {
|
|
937
|
+
var A;
|
|
964
938
|
return [
|
|
965
|
-
|
|
939
|
+
g.value,
|
|
966
940
|
{
|
|
967
|
-
option:
|
|
968
|
-
target: (
|
|
941
|
+
option: g,
|
|
942
|
+
target: (A = u.metricTargetMap) == null ? void 0 : A[g.value]
|
|
969
943
|
}
|
|
970
944
|
];
|
|
971
945
|
})
|
|
972
946
|
)
|
|
973
947
|
).values()
|
|
974
|
-
),
|
|
975
|
-
...
|
|
948
|
+
), S = ot({
|
|
949
|
+
...h || {},
|
|
976
950
|
controls: []
|
|
977
|
-
}),
|
|
978
|
-
|
|
951
|
+
}), C = nt(h), o = (u, g, A) => {
|
|
952
|
+
y(
|
|
979
953
|
u,
|
|
980
|
-
|
|
981
|
-
Ft(
|
|
954
|
+
g,
|
|
955
|
+
Ft(A)
|
|
982
956
|
);
|
|
983
|
-
},
|
|
984
|
-
if (
|
|
957
|
+
}, x = $(() => {
|
|
958
|
+
if (d) {
|
|
985
959
|
c();
|
|
986
960
|
return;
|
|
987
961
|
}
|
|
988
|
-
|
|
989
|
-
}, [
|
|
962
|
+
b(!1);
|
|
963
|
+
}, [d, c, b]), N = /* @__PURE__ */ t(
|
|
990
964
|
vt,
|
|
991
965
|
{
|
|
992
966
|
scope: "dashboard",
|
|
993
|
-
controls:
|
|
994
|
-
reservedControlIds:
|
|
995
|
-
defaultValues:
|
|
996
|
-
usageByControlId:
|
|
997
|
-
availableFieldChoices:
|
|
998
|
-
availableMetricChoices:
|
|
999
|
-
structuralParticipants:
|
|
1000
|
-
structuralParticipantIdsByControlId:
|
|
1001
|
-
initialCreateFlow:
|
|
1002
|
-
onCreateFlowActiveChange:
|
|
1003
|
-
onCreateFlowComplete:
|
|
1004
|
-
onChange:
|
|
967
|
+
controls: h.controls || [],
|
|
968
|
+
reservedControlIds: S,
|
|
969
|
+
defaultValues: h.defaultControlValues || {},
|
|
970
|
+
usageByControlId: it(h),
|
|
971
|
+
availableFieldChoices: f,
|
|
972
|
+
availableMetricChoices: w,
|
|
973
|
+
structuralParticipants: E,
|
|
974
|
+
structuralParticipantIdsByControlId: C,
|
|
975
|
+
initialCreateFlow: n === "create",
|
|
976
|
+
onCreateFlowActiveChange: b,
|
|
977
|
+
onCreateFlowComplete: x,
|
|
978
|
+
onChange: o,
|
|
1005
979
|
emptyMessage: "No dashboard controls yet."
|
|
1006
980
|
}
|
|
1007
|
-
), F =
|
|
981
|
+
), F = i ? "Add dashboard control" : "Dashboard Controls", U = /* @__PURE__ */ s(_, { children: [
|
|
1008
982
|
/* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
1009
983
|
/* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
1010
984
|
/* @__PURE__ */ t("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." })
|
|
1011
985
|
] }),
|
|
1012
|
-
|
|
986
|
+
N
|
|
1013
987
|
] });
|
|
1014
|
-
return
|
|
1015
|
-
/* @__PURE__ */ t(
|
|
988
|
+
return l ? /* @__PURE__ */ s(Ce, { open: p, onOpenChange: m, children: [
|
|
989
|
+
/* @__PURE__ */ t(De, { asChild: !0, children: v || /* @__PURE__ */ s(I, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
1016
990
|
/* @__PURE__ */ t(Y, { className: "mr-2 h-4 w-4" }),
|
|
1017
991
|
"Controls"
|
|
1018
992
|
] }) }),
|
|
1019
993
|
/* @__PURE__ */ t(
|
|
1020
|
-
|
|
994
|
+
Ne,
|
|
1021
995
|
{
|
|
1022
996
|
className: "w-[620px] max-w-[95vw] space-y-4",
|
|
1023
997
|
align: "end",
|
|
1024
998
|
onEscapeKeyDown: r,
|
|
1025
999
|
onPointerDownOutside: r,
|
|
1026
|
-
children:
|
|
1000
|
+
children: U
|
|
1027
1001
|
}
|
|
1028
1002
|
)
|
|
1029
|
-
] }) : /* @__PURE__ */ t(
|
|
1030
|
-
|
|
1003
|
+
] }) : /* @__PURE__ */ t(ue, { open: p, onOpenChange: m, children: /* @__PURE__ */ s(
|
|
1004
|
+
me,
|
|
1031
1005
|
{
|
|
1032
1006
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
1033
1007
|
onEscapeKeyDown: r,
|
|
1034
1008
|
onPointerDownOutside: r,
|
|
1035
1009
|
children: [
|
|
1036
1010
|
/* @__PURE__ */ s(
|
|
1037
|
-
|
|
1011
|
+
he,
|
|
1038
1012
|
{
|
|
1039
|
-
className:
|
|
1013
|
+
className: i ? "space-y-0" : void 0,
|
|
1040
1014
|
children: [
|
|
1041
|
-
/* @__PURE__ */ t(
|
|
1015
|
+
/* @__PURE__ */ t(pe, { className: "text-[15px]", children: F }),
|
|
1042
1016
|
/* @__PURE__ */ t(
|
|
1043
|
-
|
|
1017
|
+
fe,
|
|
1044
1018
|
{
|
|
1045
|
-
className:
|
|
1046
|
-
children:
|
|
1019
|
+
className: i ? "sr-only" : "text-[13px]",
|
|
1020
|
+
children: i ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
|
|
1047
1021
|
}
|
|
1048
1022
|
)
|
|
1049
1023
|
]
|
|
1050
1024
|
}
|
|
1051
1025
|
),
|
|
1052
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children:
|
|
1026
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: N })
|
|
1053
1027
|
]
|
|
1054
1028
|
}
|
|
1055
1029
|
) });
|
|
@@ -1057,36 +1031,36 @@ function $t({
|
|
|
1057
1031
|
function Ht({
|
|
1058
1032
|
showFilters: e,
|
|
1059
1033
|
onToggleFilters: a,
|
|
1060
|
-
onAddFilter:
|
|
1061
|
-
onAddControl:
|
|
1062
|
-
onManageControls:
|
|
1063
|
-
size:
|
|
1034
|
+
onAddFilter: v,
|
|
1035
|
+
onAddControl: l,
|
|
1036
|
+
onManageControls: n,
|
|
1037
|
+
size: d = "default",
|
|
1064
1038
|
className: c,
|
|
1065
|
-
primaryButtonClassName:
|
|
1066
|
-
secondaryButtonClassName:
|
|
1039
|
+
primaryButtonClassName: m,
|
|
1040
|
+
secondaryButtonClassName: i,
|
|
1067
1041
|
dropdownContentClassName: r
|
|
1068
1042
|
}) {
|
|
1069
1043
|
return /* @__PURE__ */ s(
|
|
1070
1044
|
"div",
|
|
1071
1045
|
{
|
|
1072
|
-
className:
|
|
1046
|
+
className: H(
|
|
1073
1047
|
// Height lives on the shell so the outer border is part of the
|
|
1074
1048
|
// h-7 box (matches regular `size="xs"` buttons). Inner buttons
|
|
1075
1049
|
// stretch to fill via `h-full`, avoiding the 2px stack-up that
|
|
1076
1050
|
// makes the combo taller than a sibling `<Button size="xs">`.
|
|
1077
1051
|
"relative inline-flex items-stretch overflow-hidden rounded-[5px] border border-input bg-background",
|
|
1078
|
-
|
|
1052
|
+
d === "toolbar" ? "h-8" : "h-7",
|
|
1079
1053
|
c
|
|
1080
1054
|
),
|
|
1081
1055
|
children: [
|
|
1082
1056
|
/* @__PURE__ */ s(
|
|
1083
|
-
|
|
1057
|
+
I,
|
|
1084
1058
|
{
|
|
1085
1059
|
variant: "ghost",
|
|
1086
1060
|
size: "xs",
|
|
1087
|
-
className:
|
|
1061
|
+
className: H(
|
|
1088
1062
|
"h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50",
|
|
1089
|
-
|
|
1063
|
+
m
|
|
1090
1064
|
),
|
|
1091
1065
|
onClick: a,
|
|
1092
1066
|
children: [
|
|
@@ -1095,39 +1069,39 @@ function Ht({
|
|
|
1095
1069
|
]
|
|
1096
1070
|
}
|
|
1097
1071
|
),
|
|
1098
|
-
/* @__PURE__ */ s(
|
|
1099
|
-
/* @__PURE__ */ t(
|
|
1100
|
-
|
|
1072
|
+
/* @__PURE__ */ s(be, { children: [
|
|
1073
|
+
/* @__PURE__ */ t(xe, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1074
|
+
I,
|
|
1101
1075
|
{
|
|
1102
1076
|
variant: "ghost",
|
|
1103
1077
|
size: "xs",
|
|
1104
|
-
className:
|
|
1078
|
+
className: H(
|
|
1105
1079
|
"h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50",
|
|
1106
|
-
|
|
1080
|
+
i
|
|
1107
1081
|
),
|
|
1108
1082
|
"aria-label": "Filter and control actions",
|
|
1109
|
-
children: /* @__PURE__ */ t(
|
|
1083
|
+
children: /* @__PURE__ */ t(ye, { className: "h-3.5 w-3.5" })
|
|
1110
1084
|
}
|
|
1111
1085
|
) }),
|
|
1112
1086
|
/* @__PURE__ */ s(
|
|
1113
|
-
|
|
1087
|
+
we,
|
|
1114
1088
|
{
|
|
1115
1089
|
align: "start",
|
|
1116
|
-
className:
|
|
1090
|
+
className: H(
|
|
1117
1091
|
"min-w-[180px] rounded-[6px] border border-border/60 p-1 shadow-sm",
|
|
1118
1092
|
r
|
|
1119
1093
|
),
|
|
1120
1094
|
children: [
|
|
1121
|
-
/* @__PURE__ */ s(
|
|
1095
|
+
/* @__PURE__ */ s(R, { onSelect: v, children: [
|
|
1122
1096
|
/* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5" }),
|
|
1123
1097
|
"Add filter"
|
|
1124
1098
|
] }),
|
|
1125
|
-
/* @__PURE__ */ s(
|
|
1099
|
+
/* @__PURE__ */ s(R, { onSelect: l, children: [
|
|
1126
1100
|
/* @__PURE__ */ t(Y, { className: "h-3.5 w-3.5" }),
|
|
1127
1101
|
"Add control"
|
|
1128
1102
|
] }),
|
|
1129
|
-
/* @__PURE__ */ s(
|
|
1130
|
-
/* @__PURE__ */ t(
|
|
1103
|
+
/* @__PURE__ */ s(R, { onSelect: n, children: [
|
|
1104
|
+
/* @__PURE__ */ t(lt, { className: "h-3.5 w-3.5" }),
|
|
1131
1105
|
"Manage controls"
|
|
1132
1106
|
] })
|
|
1133
1107
|
]
|
|
@@ -1140,13 +1114,13 @@ function Ht({
|
|
|
1140
1114
|
}
|
|
1141
1115
|
export {
|
|
1142
1116
|
zt as A,
|
|
1143
|
-
|
|
1117
|
+
_t as D,
|
|
1144
1118
|
It as E,
|
|
1145
|
-
|
|
1119
|
+
$t as N,
|
|
1146
1120
|
Rt as U,
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1121
|
+
Bt as V,
|
|
1122
|
+
At as a,
|
|
1123
|
+
Ot as b,
|
|
1150
1124
|
Ht as c,
|
|
1151
|
-
|
|
1125
|
+
Vt as u
|
|
1152
1126
|
};
|