react-semaphor 0.1.210 → 0.1.211
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/{dashboard-controls-C08300Wi.js → dashboard-controls-7KpXzAWL.js} +592 -585
- package/dist/chunks/dashboard-controls-CnDq9Uh_.js +42 -0
- package/dist/chunks/{dashboard-json-GjDBGO26.js → dashboard-json-dqey5VK0.js} +1 -1
- package/dist/chunks/{dashboard-json-DlEE5-WA.js → dashboard-json-stWvjp2O.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-THx-gjnG.js → dashboard-summary-settings-dialog-DPEe6XBC.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-QUuhhXU9.js → dashboard-summary-settings-dialog-DuxhidK1.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-Bsmow1Pa.js → edit-dashboard-visual-CQAk_UsI.js} +483 -484
- package/dist/chunks/{edit-dashboard-visual-PfWJXb2-.js → edit-dashboard-visual-D_XPr8f8.js} +2 -2
- package/dist/chunks/{editor-action-buttons-FPyaC09X.js → editor-action-buttons-CH7W6KdH.js} +1 -1
- package/dist/chunks/{editor-action-buttons-DNbp_ZWy.js → editor-action-buttons-D34_GSZu.js} +27 -27
- package/dist/chunks/{index-CAVrkf9d.js → index-BDS2sWhv.js} +27718 -27508
- package/dist/chunks/index-BfiIPyeS.js +1109 -0
- package/dist/chunks/{notification-bell-C3a7wC1u.js → notification-bell-Cu3qDd9V.js} +251 -285
- package/dist/chunks/notification-bell-hijGST9g.js +6 -0
- package/dist/chunks/{resource-management-panel-BVTgbma8.js → resource-management-panel-BvHqslqC.js} +73 -73
- package/dist/chunks/{resource-management-panel-C5NjrVsA.js → resource-management-panel-gK3a6OEj.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-l7NFLYnn.js → use-role-aware-display-preferences-BlR29aKQ.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-DxCPoCgr.js → use-role-aware-display-preferences-a5FH9Y0k.js} +1 -1
- package/dist/chunks/{use-visual-utils-B82Q-Ytl.js → use-visual-utils-B11AA2fd.js} +1 -1
- package/dist/chunks/{use-visual-utils-D9IJz9R0.js → use-visual-utils-ptPsQ3nC.js} +23 -23
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +251 -216
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/main.d.ts +49 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-controls-BAOrAMV9.js +0 -42
- package/dist/chunks/index-CXKjmjfB.js +0 -1104
- package/dist/chunks/notification-bell-BqvKQSw9.js +0 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as t, jsxs as n, Fragment as
|
|
4
|
-
import { V as
|
|
5
|
-
import { a as
|
|
6
|
-
import { c as
|
|
1
|
+
import K, { useState as D, useRef as M, useCallback as k, useEffect as L, useContext as ee } from "react";
|
|
2
|
+
import { bS as te, l as z, bM as T, b6 as B, aT as Q, aS as $, bL as Y, aU as ae, m as se, n as re, o as oe, p as ne, q as ie, L as j, cB as le, cH as ce, G as de, B as I, H as _, a1 as P, V as ue, u as V, W as me, Z, cI as he, cJ as H, I as R, bO as pe, c as U, c8 as fe, c9 as ge, ab as ve, cb as be, cc as F, E as xe, cg as we, c7 as ye, Y as Ce, cK as Ne, cL as Ae, cM as De, cp as Ee, cq as Se, cr as Le, cN as Ie, cs as Te, ct as Ue, cu as ke, cv as Ve, cw as Fe, ay as Me, aI as Pe, X as Re, cO as Oe, cP as ze, cQ as Be, ax as q, ad as $e, bN as _e, P as je, s as He, cR as qe, t as Ge } from "./index-BDS2sWhv.js";
|
|
3
|
+
import { jsx as t, jsxs as n, Fragment as O } from "react/jsx-runtime";
|
|
4
|
+
import { V as Xe, E as We, a as Qe, b as Ye, L as Ze, c as Je, d as Ke, C as et } from "./editor-action-buttons-D34_GSZu.js";
|
|
5
|
+
import { a as J } from "./use-visual-utils-ptPsQ3nC.js";
|
|
6
|
+
import { c as G } from "./date-formatter-Y8Za1ib3.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
9
9
|
*
|
|
@@ -15,15 +15,15 @@ const X = te("FileDown", [
|
|
|
15
15
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
16
16
|
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
17
17
|
["path", { d: "m9 15 3 3 3-3", key: "1npd3o" }]
|
|
18
|
-
]),
|
|
19
|
-
function
|
|
18
|
+
]), tt = 1e4, at = 15e3, st = 3e4, rt = 3e4, ot = 12e4, W = 2 * 60 * 60 * 1e3;
|
|
19
|
+
function nt(e) {
|
|
20
20
|
const a = Date.now() - e.getTime();
|
|
21
|
-
return a <
|
|
21
|
+
return a < rt ? tt : a < ot ? at : st;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
const { authToken: e, tokenProps: a } = z(), m = T((h) => h.activeExports), [
|
|
23
|
+
function bt() {
|
|
24
|
+
const { authToken: e, tokenProps: a } = z(), m = T((h) => h.activeExports), [c, u] = D(
|
|
25
25
|
typeof document < "u" ? !document.hidden : !0
|
|
26
|
-
),
|
|
26
|
+
), d = M(null), l = M(!1), o = M(void 0), f = a == null ? void 0 : a.apiServiceUrl, i = e == null ? void 0 : e.accessToken, g = k(() => {
|
|
27
27
|
const h = T.getState().activeExports;
|
|
28
28
|
return Array.from(h.values()).filter(
|
|
29
29
|
(b) => B(b.status)
|
|
@@ -38,180 +38,180 @@ function yt() {
|
|
|
38
38
|
document.removeEventListener("visibilitychange", h);
|
|
39
39
|
};
|
|
40
40
|
}, []);
|
|
41
|
-
const x =
|
|
42
|
-
if (!f || !
|
|
43
|
-
|
|
41
|
+
const x = k(async () => {
|
|
42
|
+
if (!f || !i) {
|
|
43
|
+
l.current = !1;
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
const h = g();
|
|
47
47
|
if (h.length === 0) {
|
|
48
|
-
|
|
48
|
+
l.current = !1;
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
const b = Date.now(), N = h.filter(
|
|
52
|
-
(
|
|
52
|
+
(s) => b - s.startedAt.getTime() > W
|
|
53
53
|
);
|
|
54
54
|
if (N.length > 0) {
|
|
55
|
-
const { updateExport:
|
|
56
|
-
for (const
|
|
57
|
-
r
|
|
55
|
+
const { updateExport: s } = T.getState().actions;
|
|
56
|
+
for (const r of N)
|
|
57
|
+
s(r.id, {
|
|
58
58
|
status: "failed",
|
|
59
59
|
error: "Export timed out. Please try again or contact support.",
|
|
60
60
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
const p = h.filter(
|
|
64
|
-
(
|
|
64
|
+
(s) => b - s.startedAt.getTime() <= W
|
|
65
65
|
);
|
|
66
66
|
if (p.length === 0) {
|
|
67
|
-
|
|
67
|
+
l.current = !1;
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
70
|
const y = await Promise.allSettled(
|
|
71
|
-
p.map(async (
|
|
71
|
+
p.map(async (s) => {
|
|
72
72
|
try {
|
|
73
|
-
const
|
|
73
|
+
const r = await Q(f, i, s.id);
|
|
74
74
|
let v;
|
|
75
|
-
if (
|
|
75
|
+
if (r.status === "completed")
|
|
76
76
|
try {
|
|
77
|
-
v = await $(f,
|
|
77
|
+
v = await $(f, i, s.id);
|
|
78
78
|
} catch (E) {
|
|
79
79
|
console.error(
|
|
80
|
-
`[useExportPolling] Failed to get download URL for ${
|
|
80
|
+
`[useExportPolling] Failed to get download URL for ${s.id}:`,
|
|
81
81
|
E
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
return {
|
|
85
|
-
id:
|
|
86
|
-
status:
|
|
87
|
-
progress:
|
|
88
|
-
completedChunks:
|
|
89
|
-
completedAt:
|
|
85
|
+
id: s.id,
|
|
86
|
+
status: r.status,
|
|
87
|
+
progress: r.progress,
|
|
88
|
+
completedChunks: r.completedChunks,
|
|
89
|
+
completedAt: r.completedAt ? new Date(r.completedAt) : void 0,
|
|
90
90
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
91
|
-
fileSize:
|
|
92
|
-
error:
|
|
91
|
+
fileSize: r.fileSize,
|
|
92
|
+
error: r.error,
|
|
93
93
|
downloadUrl: v
|
|
94
94
|
};
|
|
95
|
-
} catch (
|
|
95
|
+
} catch (r) {
|
|
96
96
|
return console.error(
|
|
97
|
-
`[useExportPolling] Failed to poll export ${
|
|
98
|
-
|
|
97
|
+
`[useExportPolling] Failed to poll export ${s.id}:`,
|
|
98
|
+
r
|
|
99
99
|
), null;
|
|
100
100
|
}
|
|
101
101
|
})
|
|
102
102
|
), { updateExport: A } = T.getState().actions;
|
|
103
|
-
for (const
|
|
104
|
-
|
|
103
|
+
for (const s of y)
|
|
104
|
+
s.status === "fulfilled" && s.value && A(s.value.id, s.value);
|
|
105
105
|
const w = g();
|
|
106
106
|
if (w.length > 0 && !document.hidden) {
|
|
107
|
-
const
|
|
107
|
+
const s = w.reduce(
|
|
108
108
|
(v, E) => E.startedAt < v ? E.startedAt : v,
|
|
109
109
|
w[0].startedAt
|
|
110
|
-
),
|
|
111
|
-
|
|
110
|
+
), r = nt(s);
|
|
111
|
+
d.current && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
112
112
|
var v;
|
|
113
|
-
(v =
|
|
114
|
-
},
|
|
113
|
+
(v = o.current) == null || v.call(o);
|
|
114
|
+
}, r);
|
|
115
115
|
} else
|
|
116
|
-
|
|
117
|
-
}, [f,
|
|
116
|
+
l.current = !1;
|
|
117
|
+
}, [f, i, g]);
|
|
118
118
|
return L(() => {
|
|
119
|
-
|
|
119
|
+
o.current = x;
|
|
120
120
|
}, [x]), L(() => {
|
|
121
121
|
var b;
|
|
122
|
-
g().length > 0 &&
|
|
123
|
-
}, [m,
|
|
122
|
+
g().length > 0 && c && !l.current && (l.current = !0, (b = o.current) == null || b.call(o));
|
|
123
|
+
}, [m, c, g]), L(() => {
|
|
124
124
|
var b;
|
|
125
125
|
const h = g();
|
|
126
|
-
|
|
127
|
-
}, [
|
|
128
|
-
!
|
|
129
|
-
}, [
|
|
130
|
-
|
|
126
|
+
c && h.length > 0 && !l.current && (l.current = !0, (b = o.current) == null || b.call(o));
|
|
127
|
+
}, [c, g]), L(() => {
|
|
128
|
+
!c && d.current && (clearTimeout(d.current), d.current = null, l.current = !1);
|
|
129
|
+
}, [c]), L(() => () => {
|
|
130
|
+
d.current && (clearTimeout(d.current), d.current = null);
|
|
131
131
|
}, []), {
|
|
132
|
-
isPolling:
|
|
133
|
-
isTabVisible:
|
|
132
|
+
isPolling: l.current,
|
|
133
|
+
isTabVisible: c,
|
|
134
134
|
inProgressCount: g().length
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
const { authToken: e, tokenProps: a } = z(), m = T((
|
|
137
|
+
function xt() {
|
|
138
|
+
const { authToken: e, tokenProps: a } = z(), m = T((o) => o.activeExports), { addExport: c } = Y(), u = M(!1), d = a == null ? void 0 : a.apiServiceUrl, l = e == null ? void 0 : e.accessToken;
|
|
139
139
|
L(() => {
|
|
140
|
-
if (u.current || !
|
|
140
|
+
if (u.current || !d || !l) return;
|
|
141
141
|
(async () => {
|
|
142
142
|
try {
|
|
143
|
-
const { exports: f } = await ae(
|
|
143
|
+
const { exports: f } = await ae(d, l, {
|
|
144
144
|
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
145
145
|
limit: 20
|
|
146
146
|
// Limit to recent exports
|
|
147
147
|
});
|
|
148
|
-
for (const
|
|
149
|
-
if (m.has(
|
|
150
|
-
const g =
|
|
148
|
+
for (const i of f) {
|
|
149
|
+
if (m.has(i.id)) continue;
|
|
150
|
+
const g = i.totalChunks ? Math.round(i.completedChunks / i.totalChunks * 100) : 0;
|
|
151
151
|
let x;
|
|
152
|
-
if (
|
|
152
|
+
if (i.status === "completed")
|
|
153
153
|
try {
|
|
154
|
-
x = await $(
|
|
154
|
+
x = await $(d, l, i.id);
|
|
155
155
|
} catch (b) {
|
|
156
156
|
console.error(
|
|
157
|
-
`[useExportRecovery] Failed to get download URL for ${
|
|
157
|
+
`[useExportRecovery] Failed to get download URL for ${i.id}:`,
|
|
158
158
|
b
|
|
159
159
|
);
|
|
160
160
|
}
|
|
161
161
|
const h = {
|
|
162
|
-
id:
|
|
163
|
-
status:
|
|
162
|
+
id: i.id,
|
|
163
|
+
status: i.status,
|
|
164
164
|
progress: g,
|
|
165
|
-
title:
|
|
166
|
-
totalRows:
|
|
167
|
-
totalChunks:
|
|
168
|
-
completedChunks:
|
|
169
|
-
startedAt: new Date(
|
|
165
|
+
title: it(i),
|
|
166
|
+
totalRows: i.totalRows,
|
|
167
|
+
totalChunks: i.totalChunks,
|
|
168
|
+
completedChunks: i.completedChunks,
|
|
169
|
+
startedAt: new Date(i.createdAt),
|
|
170
170
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
171
|
-
completedAt:
|
|
172
|
-
fileSize:
|
|
173
|
-
error:
|
|
174
|
-
expiresAt: new Date(
|
|
171
|
+
completedAt: i.completedAt ? new Date(i.completedAt) : void 0,
|
|
172
|
+
fileSize: i.fileSize,
|
|
173
|
+
error: i.error,
|
|
174
|
+
expiresAt: new Date(i.expiresAt),
|
|
175
175
|
downloadUrl: x
|
|
176
176
|
};
|
|
177
|
-
|
|
177
|
+
c(h);
|
|
178
178
|
}
|
|
179
179
|
u.current = !0;
|
|
180
180
|
} catch (f) {
|
|
181
181
|
console.error("[useExportRecovery] Failed to recover exports:", f), u.current = !0;
|
|
182
182
|
}
|
|
183
183
|
})();
|
|
184
|
-
}, [
|
|
184
|
+
}, [d, l, c, m]);
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function it(e) {
|
|
187
187
|
return e.title ? e.title : B(
|
|
188
188
|
e.status
|
|
189
189
|
) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function lt({
|
|
192
192
|
open: e,
|
|
193
193
|
onOpenChange: a,
|
|
194
194
|
isLibraryVisual: m,
|
|
195
|
-
currentVisualName:
|
|
195
|
+
currentVisualName: c,
|
|
196
196
|
isSaving: u = !1,
|
|
197
|
-
destinationMode:
|
|
198
|
-
onConfirm:
|
|
197
|
+
destinationMode: d = "both",
|
|
198
|
+
onConfirm: l
|
|
199
199
|
}) {
|
|
200
|
-
const [
|
|
201
|
-
m &&
|
|
202
|
-
), [
|
|
203
|
-
|
|
200
|
+
const [o, f] = D(
|
|
201
|
+
m && c ? `Copy of ${c}` : c || ""
|
|
202
|
+
), [i, g] = D("");
|
|
203
|
+
K.useEffect(() => {
|
|
204
204
|
e && (f(
|
|
205
|
-
m &&
|
|
205
|
+
m && c ? `Copy of ${c}` : c || ""
|
|
206
206
|
), g(""));
|
|
207
|
-
}, [e, m,
|
|
208
|
-
const x = !!
|
|
207
|
+
}, [e, m, c]);
|
|
208
|
+
const x = !!o.trim(), h = d === "local" ? {
|
|
209
209
|
saveToLibrary: !1,
|
|
210
210
|
saveToCurrentDashboard: !0,
|
|
211
211
|
badgeType: "local",
|
|
212
212
|
description: "Creates a local copy on the current dashboard.",
|
|
213
213
|
actionLabel: "Add to Dashboard (Local)"
|
|
214
|
-
} :
|
|
214
|
+
} : d === "library" ? {
|
|
215
215
|
saveToLibrary: !0,
|
|
216
216
|
saveToCurrentDashboard: !1,
|
|
217
217
|
badgeType: "library",
|
|
@@ -224,9 +224,9 @@ function ut({
|
|
|
224
224
|
description: "Creates a new library visual and adds a linked copy to this dashboard.",
|
|
225
225
|
actionLabel: "Save Copy as Linked Visual"
|
|
226
226
|
}, b = () => {
|
|
227
|
-
!x || u ||
|
|
228
|
-
name:
|
|
229
|
-
description:
|
|
227
|
+
!x || u || l({
|
|
228
|
+
name: o.trim(),
|
|
229
|
+
description: i.trim() || void 0,
|
|
230
230
|
saveToLibrary: h.saveToLibrary,
|
|
231
231
|
saveToCurrentDashboard: h.saveToCurrentDashboard
|
|
232
232
|
});
|
|
@@ -236,7 +236,7 @@ function ut({
|
|
|
236
236
|
/* @__PURE__ */ n(ne, { className: "flex items-center gap-2", children: [
|
|
237
237
|
/* @__PURE__ */ t("span", { children: "Save Visual As" }),
|
|
238
238
|
h.badgeType !== "local" && /* @__PURE__ */ t(
|
|
239
|
-
|
|
239
|
+
Xe,
|
|
240
240
|
{
|
|
241
241
|
type: h.badgeType,
|
|
242
242
|
showLabel: !0,
|
|
@@ -248,12 +248,12 @@ function ut({
|
|
|
248
248
|
] }),
|
|
249
249
|
/* @__PURE__ */ n("div", { className: "grid gap-4 py-4", children: [
|
|
250
250
|
/* @__PURE__ */ n("div", { className: "grid gap-2", children: [
|
|
251
|
-
/* @__PURE__ */ t(
|
|
251
|
+
/* @__PURE__ */ t(j, { htmlFor: "name", children: "Name" }),
|
|
252
252
|
/* @__PURE__ */ t(
|
|
253
253
|
le,
|
|
254
254
|
{
|
|
255
255
|
id: "name",
|
|
256
|
-
value:
|
|
256
|
+
value: o,
|
|
257
257
|
onChange: (N) => f(N.target.value),
|
|
258
258
|
placeholder: "Enter visual name",
|
|
259
259
|
disabled: u
|
|
@@ -261,12 +261,12 @@ function ut({
|
|
|
261
261
|
)
|
|
262
262
|
] }),
|
|
263
263
|
/* @__PURE__ */ n("div", { className: "grid gap-2", children: [
|
|
264
|
-
/* @__PURE__ */ t(
|
|
264
|
+
/* @__PURE__ */ t(j, { htmlFor: "description", children: "Description (optional)" }),
|
|
265
265
|
/* @__PURE__ */ t(
|
|
266
266
|
ce,
|
|
267
267
|
{
|
|
268
268
|
id: "description",
|
|
269
|
-
value:
|
|
269
|
+
value: i,
|
|
270
270
|
onChange: (N) => g(N.target.value),
|
|
271
271
|
placeholder: "Enter visual description",
|
|
272
272
|
rows: 3,
|
|
@@ -286,28 +286,28 @@ function ut({
|
|
|
286
286
|
}
|
|
287
287
|
),
|
|
288
288
|
/* @__PURE__ */ n(I, { onClick: b, disabled: !x || u, children: [
|
|
289
|
-
u && /* @__PURE__ */ t(
|
|
289
|
+
u && /* @__PURE__ */ t(_, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
290
290
|
h.actionLabel
|
|
291
291
|
] })
|
|
292
292
|
] })
|
|
293
293
|
] }) });
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
const [e, a] = D(!1), [m,
|
|
297
|
-
(
|
|
298
|
-
), { getUpdatedFrame: x } =
|
|
299
|
-
var
|
|
300
|
-
return ((
|
|
301
|
-
})(), w = he((
|
|
302
|
-
if (
|
|
303
|
-
if (h(
|
|
295
|
+
function ct() {
|
|
296
|
+
const [e, a] = D(!1), [m, c] = D(!1), [u, d] = D(null), l = P((r) => r.frame), o = P((r) => r.card), f = ue(), i = V((r) => r.selectedSheetId), g = V(
|
|
297
|
+
(r) => r.actions.setIsDashboardPanelOpen
|
|
298
|
+
), { getUpdatedFrame: x } = J(), { selectVisual: h } = me(), { addFrame: b, setSelectedFrameId: N, setIsVisualEditing: p } = Z(), y = !!(l != null && l.visualId), A = (() => {
|
|
299
|
+
var r, v;
|
|
300
|
+
return ((r = l == null ? void 0 : l.cards) == null ? void 0 : r.length) === 1 && ((v = l.cards[0]) != null && v.title) ? l.cards[0].title : f != null && f.title ? f.title : (o == null ? void 0 : o.title) || "Untitled Visual";
|
|
301
|
+
})(), w = he((r) => {
|
|
302
|
+
if (r != null && r.id) {
|
|
303
|
+
if (h(r), m && u && i) {
|
|
304
304
|
const v = {
|
|
305
305
|
...u,
|
|
306
|
-
id:
|
|
307
|
-
visualId:
|
|
306
|
+
id: H(),
|
|
307
|
+
visualId: r.id
|
|
308
308
|
// Link to the newly created library visual
|
|
309
309
|
};
|
|
310
|
-
b(
|
|
310
|
+
b(i, v, "end"), N(v.id), c(!1), d(null), p(!1);
|
|
311
311
|
}
|
|
312
312
|
g(!0), a(!1);
|
|
313
313
|
}
|
|
@@ -315,8 +315,8 @@ function mt() {
|
|
|
315
315
|
return {
|
|
316
316
|
saveAsDialogOpen: e,
|
|
317
317
|
setSaveAsDialogOpen: a,
|
|
318
|
-
handleSaveAs: async (
|
|
319
|
-
if (!
|
|
318
|
+
handleSaveAs: async (r) => {
|
|
319
|
+
if (!i) {
|
|
320
320
|
R.error("No sheet selected");
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
@@ -324,29 +324,29 @@ function mt() {
|
|
|
324
324
|
...v,
|
|
325
325
|
cards: v.cards.map((S) => ({
|
|
326
326
|
...S,
|
|
327
|
-
title:
|
|
327
|
+
title: r.name
|
|
328
328
|
// Use visual name as card title
|
|
329
329
|
}))
|
|
330
330
|
} : v;
|
|
331
|
-
if (
|
|
332
|
-
|
|
331
|
+
if (r.saveToLibrary) {
|
|
332
|
+
c(r.saveToCurrentDashboard), d(C);
|
|
333
333
|
const S = {
|
|
334
|
-
title:
|
|
335
|
-
description:
|
|
334
|
+
title: r.name,
|
|
335
|
+
description: r.description,
|
|
336
336
|
frameObject: C,
|
|
337
337
|
// Card title synced for single-card frames
|
|
338
338
|
isPrivate: !1
|
|
339
339
|
};
|
|
340
340
|
w.mutate(S);
|
|
341
|
-
} else if (
|
|
341
|
+
} else if (r.saveToCurrentDashboard) {
|
|
342
342
|
const S = {
|
|
343
343
|
...C,
|
|
344
344
|
// Card title already synced
|
|
345
|
-
id:
|
|
345
|
+
id: H(),
|
|
346
346
|
visualId: void 0
|
|
347
347
|
// Explicitly no visualId for local visuals
|
|
348
348
|
};
|
|
349
|
-
b(
|
|
349
|
+
b(i, S, "end"), N(S.id), R.success("Visual saved to dashboard"), a(!1), p(!1);
|
|
350
350
|
}
|
|
351
351
|
},
|
|
352
352
|
isLibraryVisual: y,
|
|
@@ -354,53 +354,53 @@ function mt() {
|
|
|
354
354
|
isSaving: w.isPending
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function wt({
|
|
358
358
|
className: e
|
|
359
359
|
}) {
|
|
360
|
-
const a =
|
|
360
|
+
const a = P((C) => C.frame), m = pe((C) => C.selectedVisual), c = V((C) => C.selectedFrameId), u = V((C) => C.selectedSheetId), { setIsVisualEditing: d, updateFrame: l } = Z(), [o, f] = D(!1), [i, g] = D("both"), x = !!(a != null && a.visualId || m != null && m.id), h = !!(a != null && a.visualId && c), b = x && !h, {
|
|
361
361
|
saveAsDialogOpen: N,
|
|
362
362
|
setSaveAsDialogOpen: p,
|
|
363
363
|
handleSaveAs: y,
|
|
364
364
|
isLibraryVisual: A,
|
|
365
365
|
currentVisualName: w,
|
|
366
|
-
isSaving:
|
|
367
|
-
} =
|
|
366
|
+
isSaving: s
|
|
367
|
+
} = ct(), { getUpdatedFrame: r } = J(), v = () => {
|
|
368
368
|
if (!u) {
|
|
369
369
|
R.error("No sheet selected");
|
|
370
370
|
return;
|
|
371
371
|
}
|
|
372
|
-
if (
|
|
372
|
+
if (o) return;
|
|
373
373
|
f(!0);
|
|
374
374
|
const S = {
|
|
375
|
-
...
|
|
375
|
+
...r(),
|
|
376
376
|
visualId: void 0
|
|
377
377
|
};
|
|
378
|
-
|
|
379
|
-
f(!1), R.success("Changes applied. Visual is now local to this dashboard"),
|
|
378
|
+
l(u, S), setTimeout(() => {
|
|
379
|
+
f(!1), R.success("Changes applied. Visual is now local to this dashboard"), d(!1);
|
|
380
380
|
}, 300);
|
|
381
381
|
}, E = (C) => {
|
|
382
382
|
g(C), p(!0);
|
|
383
383
|
};
|
|
384
|
-
return /* @__PURE__ */ n(
|
|
384
|
+
return /* @__PURE__ */ n(O, { children: [
|
|
385
385
|
/* @__PURE__ */ n("div", { className: "inline-flex items-center overflow-hidden rounded-md border border-input", children: [
|
|
386
386
|
!x && /* @__PURE__ */ t(
|
|
387
|
-
|
|
387
|
+
We,
|
|
388
388
|
{
|
|
389
|
-
className:
|
|
389
|
+
className: U(e, "rounded-none border-0"),
|
|
390
390
|
variant: "default"
|
|
391
391
|
}
|
|
392
392
|
),
|
|
393
393
|
x && b && /* @__PURE__ */ t(
|
|
394
|
-
|
|
394
|
+
Qe,
|
|
395
395
|
{
|
|
396
|
-
className:
|
|
396
|
+
className: U(e, "rounded-none border-0"),
|
|
397
397
|
variant: "default"
|
|
398
398
|
}
|
|
399
399
|
),
|
|
400
400
|
x && h && /* @__PURE__ */ t(
|
|
401
|
-
|
|
401
|
+
Ye,
|
|
402
402
|
{
|
|
403
|
-
className:
|
|
403
|
+
className: U(e, "rounded-none border-0")
|
|
404
404
|
}
|
|
405
405
|
),
|
|
406
406
|
/* @__PURE__ */ n(fe, { modal: !1, children: [
|
|
@@ -409,35 +409,35 @@ function Nt({
|
|
|
409
409
|
{
|
|
410
410
|
variant: "default",
|
|
411
411
|
size: "sm",
|
|
412
|
-
className:
|
|
412
|
+
className: U(
|
|
413
413
|
e,
|
|
414
414
|
"w-8 rounded-none border-0 border-l border-primary-foreground/30 px-2"
|
|
415
415
|
),
|
|
416
416
|
"aria-label": "Open visual save options",
|
|
417
|
-
disabled:
|
|
417
|
+
disabled: s || o,
|
|
418
418
|
children: /* @__PURE__ */ t(ve, { className: "h-4 w-4" })
|
|
419
419
|
}
|
|
420
420
|
) }),
|
|
421
421
|
/* @__PURE__ */ n(be, { align: "end", children: [
|
|
422
|
-
h && /* @__PURE__ */ n(
|
|
422
|
+
h && /* @__PURE__ */ n(O, { children: [
|
|
423
423
|
/* @__PURE__ */ n(
|
|
424
|
-
|
|
424
|
+
F,
|
|
425
425
|
{
|
|
426
426
|
onClick: v,
|
|
427
|
-
disabled:
|
|
427
|
+
disabled: o,
|
|
428
428
|
children: [
|
|
429
429
|
/* @__PURE__ */ t(xe, { className: "mr-2 h-4 w-4" }),
|
|
430
|
-
|
|
430
|
+
o ? "Applying..." : "Apply Locally"
|
|
431
431
|
]
|
|
432
432
|
}
|
|
433
433
|
),
|
|
434
434
|
/* @__PURE__ */ t(we, {})
|
|
435
435
|
] }),
|
|
436
436
|
/* @__PURE__ */ n(
|
|
437
|
-
|
|
437
|
+
F,
|
|
438
438
|
{
|
|
439
439
|
onClick: () => E("local"),
|
|
440
|
-
disabled:
|
|
440
|
+
disabled: s,
|
|
441
441
|
children: [
|
|
442
442
|
/* @__PURE__ */ t(ye, { className: "mr-2 h-4 w-4" }),
|
|
443
443
|
"Add to Dashboard (Local)"
|
|
@@ -445,23 +445,23 @@ function Nt({
|
|
|
445
445
|
}
|
|
446
446
|
),
|
|
447
447
|
/* @__PURE__ */ n(
|
|
448
|
-
|
|
448
|
+
F,
|
|
449
449
|
{
|
|
450
450
|
onClick: () => E("library"),
|
|
451
|
-
disabled:
|
|
451
|
+
disabled: s,
|
|
452
452
|
children: [
|
|
453
|
-
/* @__PURE__ */ t(
|
|
453
|
+
/* @__PURE__ */ t(Ze, { className: "mr-2 h-4 w-4" }),
|
|
454
454
|
"Save as Library Visual"
|
|
455
455
|
]
|
|
456
456
|
}
|
|
457
457
|
),
|
|
458
458
|
/* @__PURE__ */ n(
|
|
459
|
-
|
|
459
|
+
F,
|
|
460
460
|
{
|
|
461
461
|
onClick: () => E("both"),
|
|
462
|
-
disabled:
|
|
462
|
+
disabled: s,
|
|
463
463
|
children: [
|
|
464
|
-
/* @__PURE__ */ t(
|
|
464
|
+
/* @__PURE__ */ t(Je, { className: "mr-2 h-4 w-4" }),
|
|
465
465
|
"Save Copy as Linked Visual"
|
|
466
466
|
]
|
|
467
467
|
}
|
|
@@ -469,34 +469,34 @@ function Nt({
|
|
|
469
469
|
] })
|
|
470
470
|
] })
|
|
471
471
|
] }),
|
|
472
|
-
/* @__PURE__ */ t(
|
|
472
|
+
/* @__PURE__ */ t(Ke, { className: e }),
|
|
473
473
|
/* @__PURE__ */ t(
|
|
474
|
-
|
|
474
|
+
lt,
|
|
475
475
|
{
|
|
476
476
|
open: N,
|
|
477
477
|
onOpenChange: (C) => {
|
|
478
|
-
|
|
478
|
+
s || p(C);
|
|
479
479
|
},
|
|
480
480
|
isLibraryVisual: A,
|
|
481
481
|
currentVisualName: w,
|
|
482
|
-
isSaving:
|
|
483
|
-
destinationMode:
|
|
482
|
+
isSaving: s,
|
|
483
|
+
destinationMode: i,
|
|
484
484
|
onConfirm: y
|
|
485
485
|
}
|
|
486
486
|
)
|
|
487
487
|
] });
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function yt({
|
|
490
490
|
className: e,
|
|
491
491
|
//labelClassName,
|
|
492
492
|
switchClassName: a
|
|
493
493
|
}) {
|
|
494
|
-
const m =
|
|
495
|
-
return !
|
|
494
|
+
const m = P((o) => o.isDevMode), c = V((o) => o.isVisualEditing), { setIsDevMode: u } = Ce(), { config: d } = ee(Ne).tokenProps, l = (d == null ? void 0 : d.showAdvancedMode) !== !1;
|
|
495
|
+
return !c || !l ? null : /* @__PURE__ */ n("div", { className: U("flex items-center space-x-2", e), children: [
|
|
496
496
|
/* @__PURE__ */ t(
|
|
497
497
|
Ae,
|
|
498
498
|
{
|
|
499
|
-
className:
|
|
499
|
+
className: U("", a),
|
|
500
500
|
checked: m,
|
|
501
501
|
onCheckedChange: () => u(!m),
|
|
502
502
|
id: "advanced-mode",
|
|
@@ -507,17 +507,17 @@ function At({
|
|
|
507
507
|
/* @__PURE__ */ t("label", { htmlFor: "advanced-mode", className: "sr-only", children: "Advanced Mode" })
|
|
508
508
|
] });
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function Ct({
|
|
511
511
|
open: e,
|
|
512
512
|
onOpenChange: a,
|
|
513
513
|
onSave: m,
|
|
514
|
-
onDiscard:
|
|
514
|
+
onDiscard: c,
|
|
515
515
|
isSaving: u,
|
|
516
|
-
title:
|
|
517
|
-
description:
|
|
518
|
-
cancelLabel:
|
|
516
|
+
title: d = "Unsaved Changes",
|
|
517
|
+
description: l = "You have unsaved changes to this dashboard. What would you like to do?",
|
|
518
|
+
cancelLabel: o = "Cancel",
|
|
519
519
|
discardLabel: f = "Discard",
|
|
520
|
-
saveLabel:
|
|
520
|
+
saveLabel: i = "Save & Close"
|
|
521
521
|
}) {
|
|
522
522
|
return /* @__PURE__ */ t(Ee, { open: e, onOpenChange: (x) => {
|
|
523
523
|
!x && u || a(x);
|
|
@@ -525,99 +525,66 @@ function Dt({
|
|
|
525
525
|
/* @__PURE__ */ n(Le, { className: "space-y-3", children: [
|
|
526
526
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
|
|
527
527
|
/* @__PURE__ */ t("div", { className: "flex h-9 w-9 items-center justify-center rounded-full bg-amber-50 ring-1 ring-amber-200/70", children: /* @__PURE__ */ t(Ie, { className: "h-[18px] w-[18px] text-amber-600" }) }),
|
|
528
|
-
/* @__PURE__ */ t(Te, { className: "text-lg font-semibold tracking-tight", children:
|
|
528
|
+
/* @__PURE__ */ t(Te, { className: "text-lg font-semibold tracking-tight", children: d })
|
|
529
529
|
] }),
|
|
530
|
-
/* @__PURE__ */ t(
|
|
530
|
+
/* @__PURE__ */ t(Ue, { className: "text-sm leading-6 text-muted-foreground", children: l })
|
|
531
531
|
] }),
|
|
532
|
-
/* @__PURE__ */ n(
|
|
532
|
+
/* @__PURE__ */ n(ke, { className: "mt-2 flex-col gap-1.5 sm:flex-row sm:justify-end", children: [
|
|
533
533
|
/* @__PURE__ */ t(
|
|
534
|
-
|
|
534
|
+
Ve,
|
|
535
535
|
{
|
|
536
536
|
disabled: u,
|
|
537
537
|
className: "order-1 m-0 h-9 border-border/60 px-4 sm:order-1",
|
|
538
|
-
children:
|
|
538
|
+
children: o
|
|
539
539
|
}
|
|
540
540
|
),
|
|
541
541
|
/* @__PURE__ */ t(
|
|
542
542
|
"button",
|
|
543
543
|
{
|
|
544
|
-
onClick:
|
|
544
|
+
onClick: c,
|
|
545
545
|
disabled: u,
|
|
546
546
|
className: "order-2 h-9 rounded-md border border-destructive/30 bg-destructive/10 px-4 text-sm font-medium text-destructive transition-colors hover:bg-destructive/20 disabled:pointer-events-none disabled:opacity-50 sm:order-2",
|
|
547
547
|
children: f
|
|
548
548
|
}
|
|
549
549
|
),
|
|
550
550
|
/* @__PURE__ */ t(
|
|
551
|
-
|
|
551
|
+
Fe,
|
|
552
552
|
{
|
|
553
553
|
onClick: m,
|
|
554
554
|
disabled: u,
|
|
555
555
|
className: "order-3 m-0 h-9 px-4 sm:order-3",
|
|
556
|
-
children: u ? /* @__PURE__ */ n(
|
|
557
|
-
/* @__PURE__ */ t(
|
|
556
|
+
children: u ? /* @__PURE__ */ n(O, { children: [
|
|
557
|
+
/* @__PURE__ */ t(_, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
558
558
|
"Saving..."
|
|
559
|
-
] }) :
|
|
559
|
+
] }) : i
|
|
560
560
|
}
|
|
561
561
|
)
|
|
562
562
|
] })
|
|
563
563
|
] }) });
|
|
564
564
|
}
|
|
565
|
-
function
|
|
565
|
+
function Nt(e, a, m, c) {
|
|
566
566
|
L(() => {
|
|
567
|
-
e && !m && a &&
|
|
568
|
-
}, [e, m, a,
|
|
569
|
-
}
|
|
570
|
-
function St({
|
|
571
|
-
triggerButtonClassName: e,
|
|
572
|
-
variant: a = "ghost"
|
|
573
|
-
}) {
|
|
574
|
-
const [m, l] = D(!1), u = U((i) => {
|
|
575
|
-
var s;
|
|
576
|
-
return (s = i.dashboard) == null ? void 0 : s.id;
|
|
577
|
-
}), c = U((i) => {
|
|
578
|
-
var s;
|
|
579
|
-
return (s = i.dashboard) == null ? void 0 : s.title;
|
|
580
|
-
});
|
|
581
|
-
return u ? /* @__PURE__ */ n(V, { children: [
|
|
582
|
-
/* @__PURE__ */ t(
|
|
583
|
-
Me,
|
|
584
|
-
{
|
|
585
|
-
tooltip: "Schedule Dashboard",
|
|
586
|
-
className: k("h-7 p-2", e),
|
|
587
|
-
buttonProps: { variant: a },
|
|
588
|
-
onClick: () => l(!0),
|
|
589
|
-
children: /* @__PURE__ */ t(Oe, { className: "size-4" })
|
|
590
|
-
}
|
|
591
|
-
),
|
|
592
|
-
/* @__PURE__ */ t(
|
|
593
|
-
Re,
|
|
594
|
-
{
|
|
595
|
-
open: m,
|
|
596
|
-
onOpenChange: l,
|
|
597
|
-
dashboardId: u,
|
|
598
|
-
dashboardName: c
|
|
599
|
-
}
|
|
600
|
-
)
|
|
601
|
-
] }) : null;
|
|
567
|
+
e && !m && a && c(Me(a));
|
|
568
|
+
}, [e, m, a, c]);
|
|
602
569
|
}
|
|
603
|
-
function
|
|
570
|
+
function dt({
|
|
604
571
|
export: e,
|
|
605
572
|
onRemove: a
|
|
606
573
|
}) {
|
|
607
574
|
const m = () => {
|
|
608
575
|
e.downloadUrl && window.open(e.downloadUrl, "_blank");
|
|
609
|
-
},
|
|
610
|
-
|
|
576
|
+
}, c = (o) => {
|
|
577
|
+
o.stopPropagation(), a == null || a(e.id);
|
|
611
578
|
}, u = () => {
|
|
612
579
|
switch (e.status) {
|
|
613
580
|
case "completed":
|
|
614
|
-
return /* @__PURE__ */ t(
|
|
581
|
+
return /* @__PURE__ */ t(Be, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
615
582
|
case "failed":
|
|
616
|
-
return /* @__PURE__ */ t(
|
|
583
|
+
return /* @__PURE__ */ t(et, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
617
584
|
default:
|
|
618
|
-
return /* @__PURE__ */ t(
|
|
585
|
+
return /* @__PURE__ */ t(_, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
619
586
|
}
|
|
620
|
-
},
|
|
587
|
+
}, d = B(e.status), l = (() => {
|
|
621
588
|
switch (e.status) {
|
|
622
589
|
case "pending":
|
|
623
590
|
return "Queued...";
|
|
@@ -642,12 +609,12 @@ function ht({
|
|
|
642
609
|
e.totalRows.toLocaleString(),
|
|
643
610
|
" rows"
|
|
644
611
|
] }),
|
|
645
|
-
e.fileSize && /* @__PURE__ */ n(
|
|
612
|
+
e.fileSize && /* @__PURE__ */ n(O, { children: [
|
|
646
613
|
/* @__PURE__ */ t("span", { children: "•" }),
|
|
647
|
-
/* @__PURE__ */ t("span", { children:
|
|
614
|
+
/* @__PURE__ */ t("span", { children: Pe(e.fileSize) })
|
|
648
615
|
] })
|
|
649
616
|
] }),
|
|
650
|
-
|
|
617
|
+
d && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: l }),
|
|
651
618
|
e.status === "failed" && /* @__PURE__ */ t("div", { className: "line-clamp-2 text-xs text-destructive", children: e.error || "Export failed" })
|
|
652
619
|
] })
|
|
653
620
|
] }),
|
|
@@ -657,15 +624,15 @@ function ht({
|
|
|
657
624
|
variant: "ghost",
|
|
658
625
|
size: "icon",
|
|
659
626
|
className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
|
|
660
|
-
onClick:
|
|
627
|
+
onClick: c,
|
|
661
628
|
"aria-label": "Remove notification",
|
|
662
|
-
children: /* @__PURE__ */ t(
|
|
629
|
+
children: /* @__PURE__ */ t(Re, { className: "h-4 w-4" })
|
|
663
630
|
}
|
|
664
631
|
)
|
|
665
632
|
] }),
|
|
666
633
|
/* @__PURE__ */ n("div", { className: "ml-8", children: [
|
|
667
634
|
e.status === "completed" && /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
|
|
668
|
-
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children:
|
|
635
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: G(e.startedAt, { addSuffix: !0 }) }),
|
|
669
636
|
e.downloadUrl && /* @__PURE__ */ n(
|
|
670
637
|
I,
|
|
671
638
|
{
|
|
@@ -674,42 +641,42 @@ function ht({
|
|
|
674
641
|
className: "h-8 bg-transparent",
|
|
675
642
|
onClick: m,
|
|
676
643
|
children: [
|
|
677
|
-
/* @__PURE__ */ t(
|
|
644
|
+
/* @__PURE__ */ t(Oe, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
678
645
|
"Download"
|
|
679
646
|
]
|
|
680
647
|
}
|
|
681
648
|
)
|
|
682
649
|
] }),
|
|
683
|
-
|
|
684
|
-
/* @__PURE__ */ t(
|
|
650
|
+
d && /* @__PURE__ */ n("div", { children: [
|
|
651
|
+
/* @__PURE__ */ t(ze, { value: e.progress, className: "h-1.5" }),
|
|
685
652
|
/* @__PURE__ */ n("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
|
|
686
653
|
e.progress,
|
|
687
654
|
"% complete"
|
|
688
655
|
] })
|
|
689
656
|
] }),
|
|
690
|
-
e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children:
|
|
657
|
+
e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: G(e.startedAt, { addSuffix: !0 }) })
|
|
691
658
|
] })
|
|
692
659
|
] });
|
|
693
660
|
}
|
|
694
|
-
function
|
|
695
|
-
const { authToken: e, tokenProps: a } = z(), m = T((p) => p.activeExports), { clearCompleted:
|
|
661
|
+
function ut() {
|
|
662
|
+
const { authToken: e, tokenProps: a } = z(), m = T((p) => p.activeExports), { clearCompleted: c, removeExport: u, updateExport: d } = Y(), [l, o] = D(!1), [f, i] = D(!1), g = Array.from(m.values()).sort(
|
|
696
663
|
(p, y) => y.startedAt.getTime() - p.startedAt.getTime()
|
|
697
664
|
), x = g.some(
|
|
698
665
|
(p) => p.status === "completed" || p.status === "failed"
|
|
699
|
-
), h =
|
|
666
|
+
), h = k(async () => {
|
|
700
667
|
const p = a == null ? void 0 : a.apiServiceUrl, y = e == null ? void 0 : e.accessToken;
|
|
701
668
|
if (!(!p || !y)) {
|
|
702
|
-
|
|
669
|
+
o(!0);
|
|
703
670
|
try {
|
|
704
671
|
const A = Array.from(m.values());
|
|
705
672
|
await Promise.all(
|
|
706
673
|
A.map(async (w) => {
|
|
707
674
|
try {
|
|
708
|
-
const
|
|
709
|
-
let
|
|
710
|
-
if (
|
|
675
|
+
const s = await Q(p, y, w.id);
|
|
676
|
+
let r;
|
|
677
|
+
if (s.status === "completed")
|
|
711
678
|
try {
|
|
712
|
-
|
|
679
|
+
r = await $(
|
|
713
680
|
p,
|
|
714
681
|
y,
|
|
715
682
|
w.id
|
|
@@ -717,60 +684,60 @@ function pt() {
|
|
|
717
684
|
} catch (v) {
|
|
718
685
|
console.error(`Failed to get download URL for ${w.id}:`, v);
|
|
719
686
|
}
|
|
720
|
-
|
|
721
|
-
status:
|
|
722
|
-
progress:
|
|
723
|
-
completedChunks:
|
|
724
|
-
completedAt:
|
|
687
|
+
d(w.id, {
|
|
688
|
+
status: s.status,
|
|
689
|
+
progress: s.progress,
|
|
690
|
+
completedChunks: s.completedChunks,
|
|
691
|
+
completedAt: s.completedAt ? new Date(s.completedAt) : void 0,
|
|
725
692
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
726
|
-
fileSize:
|
|
727
|
-
error:
|
|
728
|
-
downloadUrl:
|
|
693
|
+
fileSize: s.fileSize,
|
|
694
|
+
error: s.error,
|
|
695
|
+
downloadUrl: r
|
|
729
696
|
});
|
|
730
|
-
} catch (
|
|
731
|
-
console.error(`Failed to refresh export ${w.id}:`,
|
|
697
|
+
} catch (s) {
|
|
698
|
+
console.error(`Failed to refresh export ${w.id}:`, s);
|
|
732
699
|
}
|
|
733
700
|
})
|
|
734
701
|
);
|
|
735
702
|
} finally {
|
|
736
|
-
|
|
703
|
+
o(!1);
|
|
737
704
|
}
|
|
738
705
|
}
|
|
739
706
|
}, [
|
|
740
707
|
m,
|
|
741
708
|
e == null ? void 0 : e.accessToken,
|
|
742
709
|
a == null ? void 0 : a.apiServiceUrl,
|
|
743
|
-
|
|
744
|
-
]), b =
|
|
710
|
+
d
|
|
711
|
+
]), b = k(async () => {
|
|
745
712
|
const p = a == null ? void 0 : a.apiServiceUrl, y = e == null ? void 0 : e.accessToken;
|
|
746
713
|
if (!p || !y) {
|
|
747
|
-
|
|
714
|
+
c();
|
|
748
715
|
return;
|
|
749
716
|
}
|
|
750
|
-
|
|
717
|
+
i(!0);
|
|
751
718
|
try {
|
|
752
719
|
const A = g.filter(
|
|
753
|
-
(
|
|
720
|
+
(s) => s.status === "completed" || s.status === "failed"
|
|
754
721
|
), w = await Promise.allSettled(
|
|
755
|
-
A.map(async (
|
|
722
|
+
A.map(async (s) => (await q(p, y, s.id), s.id))
|
|
756
723
|
);
|
|
757
|
-
for (const
|
|
758
|
-
|
|
724
|
+
for (const s of w)
|
|
725
|
+
s.status === "fulfilled" ? u(s.value) : console.error("Failed to delete export:", s.reason);
|
|
759
726
|
} finally {
|
|
760
|
-
|
|
727
|
+
i(!1);
|
|
761
728
|
}
|
|
762
729
|
}, [
|
|
763
730
|
g,
|
|
764
731
|
a == null ? void 0 : a.apiServiceUrl,
|
|
765
732
|
e == null ? void 0 : e.accessToken,
|
|
766
|
-
|
|
733
|
+
c,
|
|
767
734
|
u
|
|
768
|
-
]), N =
|
|
735
|
+
]), N = k(
|
|
769
736
|
async (p) => {
|
|
770
737
|
const y = a == null ? void 0 : a.apiServiceUrl, A = e == null ? void 0 : e.accessToken;
|
|
771
738
|
if (y && A)
|
|
772
739
|
try {
|
|
773
|
-
await
|
|
740
|
+
await q(y, A, p), u(p);
|
|
774
741
|
return;
|
|
775
742
|
} catch (w) {
|
|
776
743
|
console.error(`Failed to cancel export ${p}:`, w);
|
|
@@ -797,12 +764,12 @@ function pt() {
|
|
|
797
764
|
size: "sm",
|
|
798
765
|
className: "h-7 w-7 p-0",
|
|
799
766
|
onClick: h,
|
|
800
|
-
disabled:
|
|
767
|
+
disabled: l,
|
|
801
768
|
title: "Refresh status",
|
|
802
769
|
children: /* @__PURE__ */ t(
|
|
803
|
-
|
|
770
|
+
$e,
|
|
804
771
|
{
|
|
805
|
-
className: `h-4 w-4 ${
|
|
772
|
+
className: `h-4 w-4 ${l ? "animate-spin" : ""}`
|
|
806
773
|
}
|
|
807
774
|
)
|
|
808
775
|
}
|
|
@@ -821,7 +788,7 @@ function pt() {
|
|
|
821
788
|
] })
|
|
822
789
|
] }),
|
|
823
790
|
/* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: g.map((p) => /* @__PURE__ */ t(
|
|
824
|
-
|
|
791
|
+
dt,
|
|
825
792
|
{
|
|
826
793
|
export: p,
|
|
827
794
|
onRemove: N
|
|
@@ -830,12 +797,12 @@ function pt() {
|
|
|
830
797
|
)) }) })
|
|
831
798
|
] });
|
|
832
799
|
}
|
|
833
|
-
function
|
|
834
|
-
const e = T((
|
|
835
|
-
(
|
|
836
|
-
),
|
|
837
|
-
return /* @__PURE__ */ n(
|
|
838
|
-
/* @__PURE__ */ t(
|
|
800
|
+
function At() {
|
|
801
|
+
const e = T((o) => o.activeExports), a = _e(), m = e.size > 0, c = Array.from(e.values()).some(
|
|
802
|
+
(o) => o.status === "completed" || o.status === "failed"
|
|
803
|
+
), d = a > 0 ? a > 9 ? "9+" : String(a) : null;
|
|
804
|
+
return /* @__PURE__ */ n(je, { children: [
|
|
805
|
+
/* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ n(
|
|
839
806
|
I,
|
|
840
807
|
{
|
|
841
808
|
variant: "ghost",
|
|
@@ -843,29 +810,28 @@ function Lt() {
|
|
|
843
810
|
className: "relative h-8 w-8",
|
|
844
811
|
"aria-label": "Export notifications",
|
|
845
812
|
children: [
|
|
846
|
-
/* @__PURE__ */ t(
|
|
813
|
+
/* @__PURE__ */ t(qe, { className: "h-4 w-4" }),
|
|
847
814
|
m && /* @__PURE__ */ t(
|
|
848
815
|
"span",
|
|
849
816
|
{
|
|
850
|
-
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${
|
|
851
|
-
children:
|
|
817
|
+
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${d ? "-right-0.5 -top-0.5 h-4 min-w-4 px-0.5 text-[10px] font-semibold" : "right-0.5 top-0.5 h-2 w-2"}`,
|
|
818
|
+
children: d
|
|
852
819
|
}
|
|
853
820
|
)
|
|
854
821
|
]
|
|
855
822
|
}
|
|
856
823
|
) }),
|
|
857
|
-
/* @__PURE__ */ t(
|
|
824
|
+
/* @__PURE__ */ t(Ge, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(ut, {}) })
|
|
858
825
|
] });
|
|
859
826
|
}
|
|
860
827
|
export {
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
yt as u
|
|
828
|
+
yt as A,
|
|
829
|
+
dt as E,
|
|
830
|
+
At as N,
|
|
831
|
+
Ct as U,
|
|
832
|
+
wt as V,
|
|
833
|
+
ut as a,
|
|
834
|
+
xt as b,
|
|
835
|
+
Nt as c,
|
|
836
|
+
bt as u
|
|
871
837
|
};
|