react-semaphor 0.1.461 → 0.1.463
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/appearance-runtime/index.cjs +1 -0
- package/dist/appearance-runtime/index.js +5 -0
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +1 -1
- package/dist/chunks/appearance-context-DVXt8qjW.js +126 -0
- package/dist/chunks/appearance-context-DhyjbQk1.cjs +1 -0
- package/dist/chunks/appearance-runtime-provider-BgNYdUYH.cjs +1 -0
- package/dist/chunks/appearance-runtime-provider-CjmE4gBY.js +81 -0
- package/dist/chunks/{dashboard-briefing-launcher-3owMxX5K.js → dashboard-briefing-launcher-Dcfh50rg.js} +1264 -1260
- package/dist/chunks/dashboard-briefing-launcher-Dyf9-SMG.cjs +26 -0
- package/dist/chunks/{dashboard-controls-B4GvjGr1.js → dashboard-controls-Cux9l7G3.js} +8 -6
- package/dist/chunks/{dashboard-controls-Bpm_xOXQ.cjs → dashboard-controls-Dk_4fD9Y.cjs} +1 -1
- package/dist/chunks/dashboard-json-6vY_UIQ9.cjs +1 -0
- package/dist/chunks/{dashboard-json-DzyxoBp-.js → dashboard-json-CLSh4K-P.js} +12 -10
- package/dist/chunks/{edit-dashboard-visual-1T278Nr_.cjs → edit-dashboard-visual-BNNbxMoA.cjs} +28 -28
- package/dist/chunks/{edit-dashboard-visual-nwSasO_j.js → edit-dashboard-visual-WYIa0u5O.js} +854 -852
- package/dist/chunks/{editor-action-buttons-CX1Pken3.cjs → editor-action-buttons-B1QYcu9f.cjs} +1 -1
- package/dist/chunks/{editor-action-buttons-Dqw0asfA.js → editor-action-buttons-DfKOZoQs.js} +2 -2
- package/dist/chunks/{index-B1qplNxl.cjs → index-BnsIn34X.cjs} +183 -183
- package/dist/chunks/{index-DazD5k0F.js → index-BxQ_lHnZ.js} +28144 -28185
- package/dist/chunks/{report-preferences-dialog-DKPyjiCt.cjs → report-preferences-dialog-Cd7yCULW.cjs} +1 -1
- package/dist/chunks/{report-preferences-dialog-Dv3vCCFt.js → report-preferences-dialog-jy8Ck1pK.js} +2 -2
- package/dist/chunks/{switch-DBZsEV0U.cjs → switch-CNqDn5b8.cjs} +26 -26
- package/dist/chunks/{switch-kPUJEC1A.js → switch-G_-UwdXX.js} +2721 -2842
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +152 -150
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/appearance-runtime.d.ts +151 -0
- package/package.json +8 -2
- package/dist/chunks/dashboard-briefing-launcher-xuGrw8H3.cjs +0 -26
- package/dist/chunks/dashboard-json-yLM01xK4.cjs +0 -1
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as W } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { B, O as
|
|
5
|
-
import { L as
|
|
6
|
-
import { c as
|
|
7
|
-
import { u as
|
|
8
|
-
import { v as
|
|
2
|
+
import Wt, { useState as E, useEffect as Q, useMemo as ee, useContext as Ht, useRef as he, useCallback as K } from "react";
|
|
3
|
+
import { cm as et, aH as De, aI as ke, aK as Ae, bb as wt, bY as Gt, cn as Kt, co as qt, aZ as fe, ca as Nt, bl as Pe, s as Xt, o as Zt, cp as Qt, aP as tt, aS as rt, aT as at, aU as nt, aV as st, aW as ot, aX as it, aY as St, bk as lt, aG as O, cq as Yt, cr as Jt, cs as qe, cb as $e, cc as je, ct as Dt, cd as We, bW as G, b1 as er, bB as Me, cu as tr, bV as rr, aJ as ct, aL as dt, cv as ar, aF as nr, ba as sr, bw as kt, cw as or, bZ as ir, u as lr, aM as cr, b3 as dr, az as He, O as ue, aw as ut, as as At, at as ht, P as Et, ar as ur, ay as hr, ch as mr, cx as pr, bu as fr, au as gt, R as gr, T as br, cy as xr, cz as vr, cA as yr, cB as Cr, cC as wr, cD as Nr, cE as It, cF as Sr, b4 as Dr, cG as kr, ce as Ft, cH as Ar, cI as Er, cJ as Re, cK as Ir, cL as Fr, cM as Lr, an as Br, ap as Tr, a3 as Vr, a2 as Rr, a1 as Ur, a0 as Pr, Z as Mr, X as Or, cN as _r, cO as zr, cP as $r, cQ as jr, cR as Wr, al as Hr, cS as Gr, cT as Kr, a9 as qr, cU as Xr, cV as Zr, cW as Qr } from "./index-BxQ_lHnZ.js";
|
|
4
|
+
import { B, O as Se, Z as Ye, L as te, M as Lt, d as Bt, c as q, K as Yr, D as ge, u as P, z as be, aw as Tt, av as Je, E as Vt, P as Oe, a as _e, b as ze, aH as Jr, aI as ea, S as Rt, aJ as ta, aK as ra, aL as aa, aM as na, aF as sa } from "./switch-G_-UwdXX.js";
|
|
5
|
+
import { L as mt } from "./layout-grid-CiubineE.js";
|
|
6
|
+
import { c as Ee, X as Ge, C as Ut } from "./x-CXDkqdur.js";
|
|
7
|
+
import { u as pt, V as oa, E as Xe, a as Ze, b as ia, c as la, L as ca, d as da, e as Pt, C as Mt, F as ua, f as ha } from "./editor-action-buttons-DfKOZoQs.js";
|
|
8
|
+
import { v as bt } from "./saved-temporal-bucket-format-Dd2eixTH.js";
|
|
9
9
|
import "./validators-DVd8s3qY.js";
|
|
10
10
|
import "./analyze-result-contract-DROq4vgY.js";
|
|
11
11
|
import "../value-format-preferences/index.js";
|
|
12
12
|
import { S as ma } from "./search-BHsQIWBV.js";
|
|
13
13
|
import { M as pa } from "./mouse-pointer-2-BZvGk45-.js";
|
|
14
|
-
import { u as
|
|
14
|
+
import { u as xt } from "./pivot-header-presentation-DW0gKG8g.js";
|
|
15
|
+
import "./appearance-runtime-provider-CjmE4gBY.js";
|
|
16
|
+
import "./appearance-context-DVXt8qjW.js";
|
|
15
17
|
import "./index-DSKR3nKn.js";
|
|
16
18
|
import "./temporal-bucket-authoring-1fZuPAVb.js";
|
|
17
19
|
import "./color-CJvdlFM_.js";
|
|
@@ -23,7 +25,7 @@ import { g as se, d as fa, a as ga } from "./index-De_7nrwb.js";
|
|
|
23
25
|
* This source code is licensed under the ISC license.
|
|
24
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
25
27
|
*/
|
|
26
|
-
const ba =
|
|
28
|
+
const ba = Ee("ArrowUpRight", [
|
|
27
29
|
["path", { d: "M7 7h10v10", key: "1tivn9" }],
|
|
28
30
|
["path", { d: "M7 17 17 7", key: "1vkiza" }]
|
|
29
31
|
]);
|
|
@@ -33,7 +35,7 @@ const ba = Ae("ArrowUpRight", [
|
|
|
33
35
|
* This source code is licensed under the ISC license.
|
|
34
36
|
* See the LICENSE file in the root directory of this source tree.
|
|
35
37
|
*/
|
|
36
|
-
const xa =
|
|
38
|
+
const xa = Ee("CalendarRange", [
|
|
37
39
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
38
40
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
39
41
|
["path", { d: "M3 10h18", key: "8toen8" }],
|
|
@@ -49,7 +51,7 @@ const xa = Ae("CalendarRange", [
|
|
|
49
51
|
* This source code is licensed under the ISC license.
|
|
50
52
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
53
|
*/
|
|
52
|
-
const va =
|
|
54
|
+
const va = Ee("CircleX", [
|
|
53
55
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
54
56
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
55
57
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -60,7 +62,7 @@ const va = Ae("CircleX", [
|
|
|
60
62
|
* This source code is licensed under the ISC license.
|
|
61
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
64
|
*/
|
|
63
|
-
const
|
|
65
|
+
const vt = Ee("FileDown", [
|
|
64
66
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
65
67
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
66
68
|
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
@@ -72,7 +74,7 @@ const bt = Ae("FileDown", [
|
|
|
72
74
|
* This source code is licensed under the ISC license.
|
|
73
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
74
76
|
*/
|
|
75
|
-
const ya =
|
|
77
|
+
const ya = Ee("Newspaper", [
|
|
76
78
|
[
|
|
77
79
|
"path",
|
|
78
80
|
{
|
|
@@ -103,29 +105,30 @@ function Ca() {
|
|
|
103
105
|
function wa({
|
|
104
106
|
open: t,
|
|
105
107
|
onOpenChange: a,
|
|
106
|
-
onSubmit:
|
|
107
|
-
isCreating:
|
|
108
|
+
onSubmit: o,
|
|
109
|
+
isCreating: n
|
|
108
110
|
}) {
|
|
109
|
-
const [
|
|
110
|
-
|
|
111
|
-
t || (
|
|
111
|
+
const i = et("interactive"), [s, d] = E(""), [p, l] = E("");
|
|
112
|
+
Q(() => {
|
|
113
|
+
t || (d(""), l(""));
|
|
112
114
|
}, [t]);
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
a(
|
|
115
|
+
const u = () => {
|
|
116
|
+
s.trim() && o({ title: s, description: p });
|
|
117
|
+
}, c = (m) => {
|
|
118
|
+
a(m);
|
|
117
119
|
};
|
|
118
|
-
return /* @__PURE__ */ e(
|
|
119
|
-
|
|
120
|
+
return /* @__PURE__ */ e(De, { open: t, onOpenChange: c, children: /* @__PURE__ */ r(
|
|
121
|
+
ke,
|
|
120
122
|
{
|
|
121
123
|
showCloseButton: !1,
|
|
122
|
-
className: "flex max-w-lg grid-cols-none flex-col gap-0 overflow-hidden rounded-
|
|
124
|
+
className: "flex max-w-lg grid-cols-none flex-col gap-0 overflow-hidden rounded-card border-border/60 p-0 shadow-lg sm:rounded-card",
|
|
125
|
+
style: i.dialogStyle,
|
|
123
126
|
children: [
|
|
124
127
|
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
125
128
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
126
|
-
/* @__PURE__ */ e(
|
|
129
|
+
/* @__PURE__ */ e(mt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
127
130
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
128
|
-
/* @__PURE__ */ e(
|
|
131
|
+
/* @__PURE__ */ e(Ae, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
|
|
129
132
|
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
|
|
130
133
|
] })
|
|
131
134
|
] }),
|
|
@@ -135,43 +138,43 @@ function wa({
|
|
|
135
138
|
size: "xs",
|
|
136
139
|
variant: "ghost",
|
|
137
140
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
138
|
-
onClick: () =>
|
|
141
|
+
onClick: () => c(!1),
|
|
139
142
|
"aria-label": "Close",
|
|
140
|
-
disabled:
|
|
141
|
-
children: /* @__PURE__ */ e(
|
|
143
|
+
disabled: n,
|
|
144
|
+
children: /* @__PURE__ */ e(Ge, { className: "h-3.5 w-3.5" })
|
|
142
145
|
}
|
|
143
146
|
)
|
|
144
147
|
] }),
|
|
145
148
|
/* @__PURE__ */ r("div", { className: "space-y-3 px-4 py-3", children: [
|
|
146
149
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
|
|
147
150
|
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
148
|
-
/* @__PURE__ */ e(
|
|
151
|
+
/* @__PURE__ */ e(Se, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
|
|
149
152
|
/* @__PURE__ */ e(
|
|
150
|
-
|
|
153
|
+
Ye,
|
|
151
154
|
{
|
|
152
155
|
id: "visual-title",
|
|
153
156
|
size: "sm",
|
|
154
157
|
placeholder: "Untitled visual",
|
|
155
|
-
value:
|
|
156
|
-
onChange: (
|
|
157
|
-
disabled:
|
|
158
|
-
onKeyDown: (
|
|
159
|
-
|
|
158
|
+
value: s,
|
|
159
|
+
onChange: (m) => d(m.target.value),
|
|
160
|
+
disabled: n,
|
|
161
|
+
onKeyDown: (m) => {
|
|
162
|
+
m.key === "Enter" && !m.shiftKey && (m.preventDefault(), u());
|
|
160
163
|
}
|
|
161
164
|
}
|
|
162
165
|
)
|
|
163
166
|
] }),
|
|
164
167
|
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
165
|
-
/* @__PURE__ */ e(
|
|
168
|
+
/* @__PURE__ */ e(Se, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
|
|
166
169
|
/* @__PURE__ */ e(
|
|
167
|
-
|
|
170
|
+
Ye,
|
|
168
171
|
{
|
|
169
172
|
id: "visual-description",
|
|
170
173
|
size: "sm",
|
|
171
174
|
placeholder: "Optional",
|
|
172
|
-
value:
|
|
173
|
-
onChange: (
|
|
174
|
-
disabled:
|
|
175
|
+
value: p,
|
|
176
|
+
onChange: (m) => l(m.target.value),
|
|
177
|
+
disabled: n
|
|
175
178
|
}
|
|
176
179
|
)
|
|
177
180
|
] })
|
|
@@ -182,8 +185,8 @@ function wa({
|
|
|
182
185
|
{
|
|
183
186
|
size: "xs",
|
|
184
187
|
variant: "outline",
|
|
185
|
-
onClick: () =>
|
|
186
|
-
disabled:
|
|
188
|
+
onClick: () => c(!1),
|
|
189
|
+
disabled: n,
|
|
187
190
|
children: "Cancel"
|
|
188
191
|
}
|
|
189
192
|
),
|
|
@@ -191,9 +194,9 @@ function wa({
|
|
|
191
194
|
B,
|
|
192
195
|
{
|
|
193
196
|
size: "xs",
|
|
194
|
-
onClick:
|
|
195
|
-
disabled: !
|
|
196
|
-
children:
|
|
197
|
+
onClick: u,
|
|
198
|
+
disabled: !s.trim() || n,
|
|
199
|
+
children: n ? /* @__PURE__ */ r(W, { children: [
|
|
197
200
|
/* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
198
201
|
"Creating..."
|
|
199
202
|
] }) : "Create library visual"
|
|
@@ -204,189 +207,190 @@ function wa({
|
|
|
204
207
|
}
|
|
205
208
|
) });
|
|
206
209
|
}
|
|
207
|
-
function
|
|
210
|
+
function Ot(t) {
|
|
208
211
|
return t ? new Date(t).toLocaleDateString("en-US", {
|
|
209
212
|
month: "short",
|
|
210
213
|
day: "numeric",
|
|
211
214
|
year: "numeric"
|
|
212
215
|
}) : "Unknown";
|
|
213
216
|
}
|
|
214
|
-
function
|
|
215
|
-
var
|
|
216
|
-
const
|
|
217
|
-
return
|
|
217
|
+
function _t(t, a) {
|
|
218
|
+
var n;
|
|
219
|
+
const o = (n = t.ownership.createdBy) == null ? void 0 : n.type;
|
|
220
|
+
return o === "tenant" || o === "organization" && a;
|
|
218
221
|
}
|
|
219
|
-
function
|
|
220
|
-
var
|
|
221
|
-
return
|
|
222
|
+
function ft(t, a) {
|
|
223
|
+
var o, n;
|
|
224
|
+
return _t(t, a) ? ((o = t.ownership.createdBy) == null ? void 0 : o.name) || ((n = t.createdByTenantUserRel) == null ? void 0 : n.name) || t.lastModifiedBy || "Unknown" : "Organization";
|
|
222
225
|
}
|
|
223
226
|
function Na(t, a) {
|
|
224
|
-
return
|
|
227
|
+
return ft(t, a).split(/\s+/).filter(Boolean).slice(0, 2).map((n) => n.charAt(0).toUpperCase()).join("") || "?";
|
|
225
228
|
}
|
|
226
229
|
function Sa(t) {
|
|
227
230
|
const a = (t || "").toLowerCase();
|
|
228
|
-
return a.includes("table") ?
|
|
231
|
+
return a.includes("table") ? Lt : a.includes("pie") || a.includes("donut") ? Yt : a.includes("line") ? Jt : a.includes("bar") ? Yr : mt;
|
|
229
232
|
}
|
|
230
233
|
function Da({ visual: t }) {
|
|
231
234
|
const a = t.ownership.status === "public" ? "Public" : t.ownership.status === "shared" || t.ownership.sharedCount > 0 ? "Shared" : "Private";
|
|
232
235
|
return /* @__PURE__ */ e("span", { className: "inline-flex items-center rounded-[4px] border border-border/60 px-1.5 py-px text-[11px] text-muted-foreground", children: a });
|
|
233
236
|
}
|
|
234
|
-
function
|
|
237
|
+
function jn({
|
|
235
238
|
open: t,
|
|
236
239
|
onOpenChange: a
|
|
237
240
|
}) {
|
|
238
|
-
const [
|
|
241
|
+
const o = et("interactive"), [n, i] = E(""), [s, d] = E(/* @__PURE__ */ new Set()), [p, l] = E(!1), [u, c] = E(
|
|
239
242
|
null
|
|
240
|
-
), [
|
|
243
|
+
), [m, h] = E(
|
|
241
244
|
null
|
|
242
|
-
), [
|
|
243
|
-
|
|
244
|
-
},
|
|
245
|
-
a(!1),
|
|
246
|
-
}, { selectVisual:
|
|
247
|
-
resources:
|
|
248
|
-
isLoading:
|
|
249
|
-
isError:
|
|
250
|
-
createResource:
|
|
251
|
-
updateResource:
|
|
252
|
-
deleteResourceAsync:
|
|
253
|
-
duplicateResource:
|
|
254
|
-
isCreating:
|
|
255
|
-
isDeleting:
|
|
256
|
-
} =
|
|
245
|
+
), [f, x] = E(!1), [C, N] = E(null), [I, D] = E(null), b = () => {
|
|
246
|
+
d(/* @__PURE__ */ new Set()), c(null), h(null), x(!1), N(null);
|
|
247
|
+
}, S = () => {
|
|
248
|
+
a(!1), b();
|
|
249
|
+
}, { selectVisual: A } = wt(), { handleAddLibraryVisual: U, handleEditLibraryVisual: g } = pt(), { isConsoleMode: v } = Gt(), {
|
|
250
|
+
resources: T,
|
|
251
|
+
isLoading: F,
|
|
252
|
+
isError: H,
|
|
253
|
+
createResource: k,
|
|
254
|
+
updateResource: V,
|
|
255
|
+
deleteResourceAsync: $,
|
|
256
|
+
duplicateResource: xe,
|
|
257
|
+
isCreating: re,
|
|
258
|
+
isDeleting: oe
|
|
259
|
+
} = Kt(
|
|
257
260
|
void 0,
|
|
258
|
-
(
|
|
259
|
-
|
|
261
|
+
(y) => {
|
|
262
|
+
l(!1), y && (A(y), g(y), S());
|
|
260
263
|
}
|
|
261
264
|
), {
|
|
262
|
-
startUpdating:
|
|
263
|
-
stopUpdating:
|
|
264
|
-
isUpdating:
|
|
265
|
-
} =
|
|
266
|
-
const
|
|
267
|
-
return
|
|
265
|
+
startUpdating: Ie,
|
|
266
|
+
stopUpdating: Fe,
|
|
267
|
+
isUpdating: ie
|
|
268
|
+
} = qt(), j = T, Y = ee(() => {
|
|
269
|
+
const y = n.trim().toLowerCase();
|
|
270
|
+
return y ? j.filter(
|
|
268
271
|
(L) => {
|
|
269
|
-
var M, ae,
|
|
270
|
-
return ((M = L.title) == null ? void 0 : M.toLowerCase().includes(
|
|
272
|
+
var M, ae, ce;
|
|
273
|
+
return ((M = L.title) == null ? void 0 : M.toLowerCase().includes(y)) || ((ae = L.description) == null ? void 0 : ae.toLowerCase().includes(y)) || ((ce = L.kind) == null ? void 0 : ce.toLowerCase().includes(y));
|
|
271
274
|
}
|
|
272
|
-
) :
|
|
273
|
-
}, [
|
|
274
|
-
() =>
|
|
275
|
-
(
|
|
275
|
+
) : j;
|
|
276
|
+
}, [n, j]), le = ee(
|
|
277
|
+
() => j.filter(
|
|
278
|
+
(y) => s.has(y.id)
|
|
276
279
|
),
|
|
277
|
-
[
|
|
278
|
-
),
|
|
279
|
-
(
|
|
280
|
-
),
|
|
281
|
-
(
|
|
282
|
-
),
|
|
283
|
-
(
|
|
284
|
-
),
|
|
285
|
-
(
|
|
286
|
-
),
|
|
287
|
-
const L = new Set(
|
|
288
|
-
|
|
289
|
-
},
|
|
290
|
-
|
|
291
|
-
L.has(
|
|
280
|
+
[s, j]
|
|
281
|
+
), J = le.filter(
|
|
282
|
+
(y) => y.permissions.canDelete
|
|
283
|
+
), Le = le.filter(
|
|
284
|
+
(y) => y.permissions.canShare
|
|
285
|
+
), ve = Y.length > 0 && Y.every(
|
|
286
|
+
(y) => s.has(y.id)
|
|
287
|
+
), de = Y.some(
|
|
288
|
+
(y) => s.has(y.id)
|
|
289
|
+
), me = (y) => {
|
|
290
|
+
const L = new Set(s);
|
|
291
|
+
y(L), d(L);
|
|
292
|
+
}, Z = (y) => {
|
|
293
|
+
me((L) => {
|
|
294
|
+
L.has(y) ? L.delete(y) : L.add(y);
|
|
292
295
|
});
|
|
293
|
-
},
|
|
294
|
-
|
|
295
|
-
const L = new Set(
|
|
296
|
-
return
|
|
296
|
+
}, ye = () => {
|
|
297
|
+
d((y) => {
|
|
298
|
+
const L = new Set(y);
|
|
299
|
+
return ve ? Y.forEach(
|
|
297
300
|
(M) => L.delete(M.id)
|
|
298
|
-
) :
|
|
301
|
+
) : Y.forEach(
|
|
299
302
|
(M) => L.add(M.id)
|
|
300
303
|
), L;
|
|
301
304
|
});
|
|
302
|
-
},
|
|
303
|
-
(await
|
|
304
|
-
},
|
|
305
|
-
const
|
|
306
|
-
if (
|
|
305
|
+
}, _ = async (y) => {
|
|
306
|
+
(await U(y)).success && S();
|
|
307
|
+
}, z = async () => {
|
|
308
|
+
const y = le;
|
|
309
|
+
if (y.length === 0) return;
|
|
307
310
|
let L = !1;
|
|
308
|
-
for (const M of
|
|
309
|
-
if (!(await
|
|
311
|
+
for (const M of y)
|
|
312
|
+
if (!(await U(M)).success) {
|
|
310
313
|
L = !0;
|
|
311
314
|
break;
|
|
312
315
|
}
|
|
313
|
-
L ||
|
|
314
|
-
},
|
|
315
|
-
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
onSettled: () =>
|
|
316
|
+
L || S();
|
|
317
|
+
}, ne = (y) => {
|
|
318
|
+
g(y), S();
|
|
319
|
+
}, pe = (y) => {
|
|
320
|
+
D(y), xe(y, {
|
|
321
|
+
onSettled: () => D(null)
|
|
319
322
|
});
|
|
320
|
-
},
|
|
321
|
-
if (
|
|
323
|
+
}, Be = () => {
|
|
324
|
+
if (J.length === 0) {
|
|
322
325
|
O.error("Select a visual you can delete");
|
|
323
326
|
return;
|
|
324
327
|
}
|
|
325
|
-
|
|
326
|
-
},
|
|
327
|
-
const
|
|
328
|
+
N(null), x(!0);
|
|
329
|
+
}, Ke = async () => {
|
|
330
|
+
const y = C ? [C] : J;
|
|
328
331
|
try {
|
|
329
|
-
for (const L of
|
|
330
|
-
await
|
|
331
|
-
|
|
332
|
+
for (const L of y)
|
|
333
|
+
await $(L.id);
|
|
334
|
+
d((L) => {
|
|
332
335
|
const M = new Set(L);
|
|
333
|
-
return
|
|
336
|
+
return y.forEach(
|
|
334
337
|
(ae) => M.delete(ae.id)
|
|
335
338
|
), M;
|
|
336
|
-
}),
|
|
339
|
+
}), x(!1), N(null);
|
|
337
340
|
} catch {
|
|
338
341
|
}
|
|
339
|
-
},
|
|
340
|
-
if (
|
|
342
|
+
}, Ce = () => {
|
|
343
|
+
if (le.length !== 1) {
|
|
341
344
|
O.error("Select one visual to share");
|
|
342
345
|
return;
|
|
343
346
|
}
|
|
344
|
-
const [
|
|
345
|
-
if (!
|
|
347
|
+
const [y] = le;
|
|
348
|
+
if (!y.permissions.canShare) {
|
|
346
349
|
O.error("You do not have permission to share this visual");
|
|
347
350
|
return;
|
|
348
351
|
}
|
|
349
|
-
|
|
352
|
+
c(y);
|
|
350
353
|
}, we = ({
|
|
351
|
-
title:
|
|
354
|
+
title: y,
|
|
352
355
|
description: L
|
|
353
356
|
}) => {
|
|
354
|
-
if (!
|
|
357
|
+
if (!m) return;
|
|
355
358
|
const M = {};
|
|
356
|
-
if (
|
|
357
|
-
|
|
359
|
+
if (y !== m.title && (M.title = y), (m.description || "") !== L && (M.description = L), Object.keys(M).length === 0) {
|
|
360
|
+
h(null);
|
|
358
361
|
return;
|
|
359
362
|
}
|
|
360
|
-
const ae = Object.keys(M),
|
|
361
|
-
|
|
363
|
+
const ae = Object.keys(M), ce = ae.length === 1 ? ae[0] : void 0;
|
|
364
|
+
Ie(m.id, ce), V(
|
|
362
365
|
{
|
|
363
|
-
resourceId:
|
|
366
|
+
resourceId: m.id,
|
|
364
367
|
data: M
|
|
365
368
|
},
|
|
366
369
|
{
|
|
367
370
|
onSuccess: () => {
|
|
368
|
-
|
|
371
|
+
Fe(m.id, ce), h(null);
|
|
369
372
|
},
|
|
370
373
|
onError: () => {
|
|
371
|
-
|
|
374
|
+
Fe(m.id, ce);
|
|
372
375
|
}
|
|
373
376
|
}
|
|
374
377
|
);
|
|
375
|
-
},
|
|
376
|
-
a(
|
|
377
|
-
},
|
|
378
|
+
}, X = (y) => {
|
|
379
|
+
a(y), y || b();
|
|
380
|
+
}, Ne = C ? 1 : J.length;
|
|
378
381
|
return /* @__PURE__ */ r(W, { children: [
|
|
379
|
-
/* @__PURE__ */ e(
|
|
380
|
-
|
|
382
|
+
/* @__PURE__ */ e(De, { open: t, onOpenChange: X, children: /* @__PURE__ */ r(
|
|
383
|
+
ke,
|
|
381
384
|
{
|
|
382
385
|
showCloseButton: !1,
|
|
383
|
-
className: "flex max-h-[80vh] w-[min(72rem,calc(100vw-2rem))] max-w-none grid-cols-none flex-col gap-0 overflow-hidden rounded-
|
|
386
|
+
className: "flex max-h-[80vh] w-[min(72rem,calc(100vw-2rem))] max-w-none grid-cols-none flex-col gap-0 overflow-hidden rounded-card border-border/60 p-0 shadow-lg sm:rounded-card",
|
|
387
|
+
style: o.dialogStyle,
|
|
384
388
|
children: [
|
|
385
389
|
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
386
390
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
387
|
-
/* @__PURE__ */ e(
|
|
391
|
+
/* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
388
392
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
389
|
-
/* @__PURE__ */ e(
|
|
393
|
+
/* @__PURE__ */ e(Ae, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
|
|
390
394
|
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
|
|
391
395
|
] })
|
|
392
396
|
] }),
|
|
@@ -396,7 +400,7 @@ function _n({
|
|
|
396
400
|
size: "xs",
|
|
397
401
|
variant: "ghost",
|
|
398
402
|
className: "w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
399
|
-
onClick: () =>
|
|
403
|
+
onClick: () => X(!1),
|
|
400
404
|
"aria-label": "Close visuals library",
|
|
401
405
|
children: "×"
|
|
402
406
|
}
|
|
@@ -409,8 +413,8 @@ function _n({
|
|
|
409
413
|
"input",
|
|
410
414
|
{
|
|
411
415
|
autoFocus: !0,
|
|
412
|
-
value:
|
|
413
|
-
onChange: (
|
|
416
|
+
value: n,
|
|
417
|
+
onChange: (y) => i(y.target.value),
|
|
414
418
|
placeholder: "Search visuals...",
|
|
415
419
|
className: "h-7 w-full rounded-control border border-input bg-background pl-7 pr-2 text-[12px] text-foreground placeholder:text-muted-foreground focus:border-ring focus:outline-none",
|
|
416
420
|
"aria-label": "Search visuals"
|
|
@@ -423,7 +427,7 @@ function _n({
|
|
|
423
427
|
size: "xs",
|
|
424
428
|
variant: "outline",
|
|
425
429
|
className: "ml-auto",
|
|
426
|
-
onClick: () =>
|
|
430
|
+
onClick: () => l(!0),
|
|
427
431
|
children: [
|
|
428
432
|
/* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" }),
|
|
429
433
|
"New library visual"
|
|
@@ -431,36 +435,36 @@ function _n({
|
|
|
431
435
|
}
|
|
432
436
|
)
|
|
433
437
|
] }),
|
|
434
|
-
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children:
|
|
435
|
-
/* @__PURE__ */ e(
|
|
436
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children:
|
|
437
|
-
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children:
|
|
438
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-auto", children: F ? /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(Ca, {}) }) : H ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ e("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : Y.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
|
|
439
|
+
/* @__PURE__ */ e(mt, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
440
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium", children: n ? "No visuals found" : "No visuals yet" }),
|
|
441
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: n ? "Try a different search." : "Create a saved visual to add it here." })
|
|
438
442
|
] }) : /* @__PURE__ */ e(
|
|
439
443
|
ka,
|
|
440
444
|
{
|
|
441
|
-
visuals:
|
|
442
|
-
selectedIds:
|
|
443
|
-
allFilteredSelected:
|
|
444
|
-
someFilteredSelected:
|
|
445
|
-
onSelectAll:
|
|
446
|
-
onToggleSelection:
|
|
447
|
-
onAddVisual:
|
|
448
|
-
onOpenVisual:
|
|
449
|
-
onEditDetails:
|
|
450
|
-
onShareVisual:
|
|
451
|
-
onDeleteVisual: (
|
|
452
|
-
y
|
|
445
|
+
visuals: Y,
|
|
446
|
+
selectedIds: s,
|
|
447
|
+
allFilteredSelected: ve,
|
|
448
|
+
someFilteredSelected: de,
|
|
449
|
+
onSelectAll: ye,
|
|
450
|
+
onToggleSelection: Z,
|
|
451
|
+
onAddVisual: _,
|
|
452
|
+
onOpenVisual: ne,
|
|
453
|
+
onEditDetails: h,
|
|
454
|
+
onShareVisual: c,
|
|
455
|
+
onDeleteVisual: (y) => {
|
|
456
|
+
N(y), x(!0);
|
|
453
457
|
},
|
|
454
|
-
onDuplicateVisual:
|
|
455
|
-
duplicatingId:
|
|
456
|
-
isDeleting:
|
|
457
|
-
isConsoleMode:
|
|
458
|
+
onDuplicateVisual: pe,
|
|
459
|
+
duplicatingId: I,
|
|
460
|
+
isDeleting: oe,
|
|
461
|
+
isConsoleMode: v
|
|
458
462
|
}
|
|
459
463
|
) }),
|
|
460
464
|
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
|
|
461
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children:
|
|
465
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5", children: s.size > 0 && /* @__PURE__ */ r(W, { children: [
|
|
462
466
|
/* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: [
|
|
463
|
-
/* @__PURE__ */ e("span", { className: "font-medium tabular-nums text-foreground", children:
|
|
467
|
+
/* @__PURE__ */ e("span", { className: "font-medium tabular-nums text-foreground", children: s.size }),
|
|
464
468
|
" ",
|
|
465
469
|
"selected"
|
|
466
470
|
] }),
|
|
@@ -469,7 +473,7 @@ function _n({
|
|
|
469
473
|
{
|
|
470
474
|
size: "xs",
|
|
471
475
|
variant: "ghost",
|
|
472
|
-
onClick: () =>
|
|
476
|
+
onClick: () => d(/* @__PURE__ */ new Set()),
|
|
473
477
|
children: "Clear"
|
|
474
478
|
}
|
|
475
479
|
),
|
|
@@ -478,10 +482,10 @@ function _n({
|
|
|
478
482
|
{
|
|
479
483
|
size: "xs",
|
|
480
484
|
variant: "outline",
|
|
481
|
-
onClick:
|
|
482
|
-
disabled:
|
|
485
|
+
onClick: Ce,
|
|
486
|
+
disabled: le.length !== 1 || Le.length !== 1,
|
|
483
487
|
children: [
|
|
484
|
-
/* @__PURE__ */ e(
|
|
488
|
+
/* @__PURE__ */ e(Nt, { className: "h-3.5 w-3.5" }),
|
|
485
489
|
"Share"
|
|
486
490
|
]
|
|
487
491
|
}
|
|
@@ -492,12 +496,12 @@ function _n({
|
|
|
492
496
|
size: "xs",
|
|
493
497
|
variant: "outline",
|
|
494
498
|
className: "text-destructive hover:text-destructive",
|
|
495
|
-
onClick:
|
|
496
|
-
disabled:
|
|
499
|
+
onClick: Be,
|
|
500
|
+
disabled: J.length === 0,
|
|
497
501
|
children: [
|
|
498
|
-
/* @__PURE__ */ e(
|
|
502
|
+
/* @__PURE__ */ e(Pe, { className: "h-3.5 w-3.5" }),
|
|
499
503
|
"Delete ",
|
|
500
|
-
|
|
504
|
+
J.length || s.size
|
|
501
505
|
]
|
|
502
506
|
}
|
|
503
507
|
)
|
|
@@ -508,7 +512,7 @@ function _n({
|
|
|
508
512
|
{
|
|
509
513
|
size: "xs",
|
|
510
514
|
variant: "outline",
|
|
511
|
-
onClick: () =>
|
|
515
|
+
onClick: () => X(!1),
|
|
512
516
|
children: "Close"
|
|
513
517
|
}
|
|
514
518
|
),
|
|
@@ -516,11 +520,11 @@ function _n({
|
|
|
516
520
|
B,
|
|
517
521
|
{
|
|
518
522
|
size: "xs",
|
|
519
|
-
onClick:
|
|
520
|
-
disabled:
|
|
523
|
+
onClick: z,
|
|
524
|
+
disabled: s.size === 0,
|
|
521
525
|
children: [
|
|
522
|
-
/* @__PURE__ */ e(
|
|
523
|
-
|
|
526
|
+
/* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" }),
|
|
527
|
+
s.size === 0 ? "Add to dashboard" : `Add ${s.size} visual${s.size === 1 ? "" : "s"}`
|
|
524
528
|
]
|
|
525
529
|
}
|
|
526
530
|
)
|
|
@@ -532,62 +536,62 @@ function _n({
|
|
|
532
536
|
/* @__PURE__ */ e(
|
|
533
537
|
wa,
|
|
534
538
|
{
|
|
535
|
-
open:
|
|
536
|
-
onOpenChange:
|
|
537
|
-
onSubmit:
|
|
538
|
-
isCreating:
|
|
539
|
+
open: p,
|
|
540
|
+
onOpenChange: l,
|
|
541
|
+
onSubmit: k,
|
|
542
|
+
isCreating: re
|
|
539
543
|
}
|
|
540
544
|
),
|
|
541
|
-
|
|
542
|
-
|
|
545
|
+
u && /* @__PURE__ */ e(
|
|
546
|
+
Xt,
|
|
543
547
|
{
|
|
544
|
-
resource:
|
|
545
|
-
resourceType:
|
|
546
|
-
onClose: () =>
|
|
548
|
+
resource: u,
|
|
549
|
+
resourceType: Zt.VISUAL,
|
|
550
|
+
onClose: () => c(null)
|
|
547
551
|
}
|
|
548
552
|
),
|
|
549
|
-
|
|
550
|
-
|
|
553
|
+
m && /* @__PURE__ */ e(
|
|
554
|
+
Qt,
|
|
551
555
|
{
|
|
552
|
-
open: !!
|
|
556
|
+
open: !!m,
|
|
553
557
|
resourceLabel: "Visual",
|
|
554
|
-
initialTitle:
|
|
555
|
-
initialDescription:
|
|
556
|
-
onClose: () =>
|
|
558
|
+
initialTitle: m.title || "",
|
|
559
|
+
initialDescription: m.description || "",
|
|
560
|
+
onClose: () => h(null),
|
|
557
561
|
onSave: we,
|
|
558
|
-
isSaving:
|
|
562
|
+
isSaving: ie(m.id)
|
|
559
563
|
}
|
|
560
564
|
),
|
|
561
565
|
/* @__PURE__ */ e(
|
|
562
|
-
|
|
566
|
+
tt,
|
|
563
567
|
{
|
|
564
|
-
open:
|
|
565
|
-
onOpenChange: (
|
|
566
|
-
!
|
|
568
|
+
open: f,
|
|
569
|
+
onOpenChange: (y) => {
|
|
570
|
+
!y && oe || (x(y), y || N(null));
|
|
567
571
|
},
|
|
568
|
-
children: /* @__PURE__ */ r(
|
|
569
|
-
/* @__PURE__ */ r(
|
|
570
|
-
/* @__PURE__ */ r(
|
|
572
|
+
children: /* @__PURE__ */ r(rt, { children: [
|
|
573
|
+
/* @__PURE__ */ r(at, { children: [
|
|
574
|
+
/* @__PURE__ */ r(nt, { children: [
|
|
571
575
|
"Delete ",
|
|
572
|
-
|
|
576
|
+
Ne,
|
|
573
577
|
" visual",
|
|
574
|
-
|
|
578
|
+
Ne === 1 ? "" : "s",
|
|
575
579
|
"?"
|
|
576
580
|
] }),
|
|
577
|
-
/* @__PURE__ */ e(
|
|
581
|
+
/* @__PURE__ */ e(st, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
|
|
578
582
|
] }),
|
|
579
|
-
/* @__PURE__ */ r(
|
|
580
|
-
/* @__PURE__ */ e(
|
|
583
|
+
/* @__PURE__ */ r(ot, { children: [
|
|
584
|
+
/* @__PURE__ */ e(it, { disabled: oe, children: "Cancel" }),
|
|
581
585
|
/* @__PURE__ */ r(
|
|
582
|
-
|
|
586
|
+
St,
|
|
583
587
|
{
|
|
584
|
-
onClick: (
|
|
585
|
-
|
|
588
|
+
onClick: (y) => {
|
|
589
|
+
y.preventDefault(), Ke();
|
|
586
590
|
},
|
|
587
|
-
disabled:
|
|
591
|
+
disabled: oe || Ne === 0,
|
|
588
592
|
children: [
|
|
589
|
-
|
|
590
|
-
|
|
593
|
+
oe ? /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-3.5 w-3.5" }),
|
|
594
|
+
oe ? "Deleting..." : "Delete"
|
|
591
595
|
]
|
|
592
596
|
}
|
|
593
597
|
)
|
|
@@ -600,27 +604,27 @@ function _n({
|
|
|
600
604
|
function ka({
|
|
601
605
|
visuals: t,
|
|
602
606
|
selectedIds: a,
|
|
603
|
-
allFilteredSelected:
|
|
604
|
-
someFilteredSelected:
|
|
605
|
-
onSelectAll:
|
|
606
|
-
onToggleSelection:
|
|
607
|
-
onAddVisual:
|
|
608
|
-
onOpenVisual:
|
|
607
|
+
allFilteredSelected: o,
|
|
608
|
+
someFilteredSelected: n,
|
|
609
|
+
onSelectAll: i,
|
|
610
|
+
onToggleSelection: s,
|
|
611
|
+
onAddVisual: d,
|
|
612
|
+
onOpenVisual: p,
|
|
609
613
|
onEditDetails: l,
|
|
610
|
-
onShareVisual:
|
|
611
|
-
onDeleteVisual:
|
|
612
|
-
onDuplicateVisual:
|
|
614
|
+
onShareVisual: u,
|
|
615
|
+
onDeleteVisual: c,
|
|
616
|
+
onDuplicateVisual: m,
|
|
613
617
|
duplicatingId: h,
|
|
614
|
-
isDeleting:
|
|
615
|
-
isConsoleMode:
|
|
618
|
+
isDeleting: f,
|
|
619
|
+
isConsoleMode: x
|
|
616
620
|
}) {
|
|
617
621
|
return /* @__PURE__ */ r("div", { className: "min-w-[48rem]", children: [
|
|
618
622
|
/* @__PURE__ */ r("div", { className: "grid h-9 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/60 px-3 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: [
|
|
619
623
|
/* @__PURE__ */ e(
|
|
620
|
-
|
|
624
|
+
lt,
|
|
621
625
|
{
|
|
622
|
-
checked:
|
|
623
|
-
onCheckedChange:
|
|
626
|
+
checked: o ? !0 : n ? "indeterminate" : !1,
|
|
627
|
+
onCheckedChange: i,
|
|
624
628
|
"aria-label": "Select all visuals"
|
|
625
629
|
}
|
|
626
630
|
),
|
|
@@ -631,57 +635,57 @@ function ka({
|
|
|
631
635
|
/* @__PURE__ */ e("span", { className: "text-right", children: "Shared" }),
|
|
632
636
|
/* @__PURE__ */ e("span", { className: "text-right", children: "Actions" })
|
|
633
637
|
] }),
|
|
634
|
-
t.map((
|
|
638
|
+
t.map((C) => /* @__PURE__ */ e(
|
|
635
639
|
Aa,
|
|
636
640
|
{
|
|
637
|
-
visual:
|
|
638
|
-
selected: a.has(
|
|
639
|
-
onToggleSelection:
|
|
640
|
-
onAddVisual:
|
|
641
|
-
onOpenVisual:
|
|
641
|
+
visual: C,
|
|
642
|
+
selected: a.has(C.id),
|
|
643
|
+
onToggleSelection: s,
|
|
644
|
+
onAddVisual: d,
|
|
645
|
+
onOpenVisual: p,
|
|
642
646
|
onEditDetails: l,
|
|
643
|
-
onShareVisual:
|
|
644
|
-
onDeleteVisual:
|
|
645
|
-
onDuplicateVisual:
|
|
647
|
+
onShareVisual: u,
|
|
648
|
+
onDeleteVisual: c,
|
|
649
|
+
onDuplicateVisual: m,
|
|
646
650
|
duplicatingId: h,
|
|
647
|
-
isDeleting:
|
|
648
|
-
isConsoleMode:
|
|
651
|
+
isDeleting: f,
|
|
652
|
+
isConsoleMode: x
|
|
649
653
|
},
|
|
650
|
-
|
|
654
|
+
C.id
|
|
651
655
|
))
|
|
652
656
|
] });
|
|
653
657
|
}
|
|
654
658
|
function Aa({
|
|
655
659
|
visual: t,
|
|
656
660
|
selected: a,
|
|
657
|
-
onToggleSelection:
|
|
658
|
-
onAddVisual:
|
|
659
|
-
onOpenVisual:
|
|
660
|
-
onEditDetails:
|
|
661
|
-
onShareVisual:
|
|
662
|
-
onDeleteVisual:
|
|
661
|
+
onToggleSelection: o,
|
|
662
|
+
onAddVisual: n,
|
|
663
|
+
onOpenVisual: i,
|
|
664
|
+
onEditDetails: s,
|
|
665
|
+
onShareVisual: d,
|
|
666
|
+
onDeleteVisual: p,
|
|
663
667
|
onDuplicateVisual: l,
|
|
664
|
-
duplicatingId:
|
|
665
|
-
isDeleting:
|
|
666
|
-
isConsoleMode:
|
|
668
|
+
duplicatingId: u,
|
|
669
|
+
isDeleting: c,
|
|
670
|
+
isConsoleMode: m
|
|
667
671
|
}) {
|
|
668
|
-
var
|
|
669
|
-
const h = Sa(t.kind),
|
|
670
|
-
|
|
672
|
+
var x;
|
|
673
|
+
const h = Sa(t.kind), f = () => {
|
|
674
|
+
n(t);
|
|
671
675
|
};
|
|
672
676
|
return /* @__PURE__ */ r(
|
|
673
677
|
"div",
|
|
674
678
|
{
|
|
675
|
-
className:
|
|
679
|
+
className: q(
|
|
676
680
|
"group grid min-h-12 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/50 px-3 text-[13px] hover:bg-muted/50",
|
|
677
681
|
a && "bg-muted/70"
|
|
678
682
|
),
|
|
679
683
|
children: [
|
|
680
684
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
681
|
-
|
|
685
|
+
lt,
|
|
682
686
|
{
|
|
683
687
|
checked: a,
|
|
684
|
-
onCheckedChange: () =>
|
|
688
|
+
onCheckedChange: () => o(t.id),
|
|
685
689
|
"aria-label": `Select ${t.title || "visual"}`
|
|
686
690
|
}
|
|
687
691
|
) }),
|
|
@@ -690,7 +694,7 @@ function Aa({
|
|
|
690
694
|
{
|
|
691
695
|
type: "button",
|
|
692
696
|
className: "flex min-w-0 items-center gap-2 rounded-[4px] text-left outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
693
|
-
onClick:
|
|
697
|
+
onClick: f,
|
|
694
698
|
"aria-label": `Add ${t.title || "visual"} to dashboard`,
|
|
695
699
|
children: [
|
|
696
700
|
/* @__PURE__ */ e(h, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
@@ -703,7 +707,7 @@ function Aa({
|
|
|
703
707
|
children: t.title || "Untitled Visual"
|
|
704
708
|
}
|
|
705
709
|
),
|
|
706
|
-
((
|
|
710
|
+
((x = t.description) == null ? void 0 : x.trim()) && /* @__PURE__ */ e(
|
|
707
711
|
"div",
|
|
708
712
|
{
|
|
709
713
|
className: "truncate text-[11px] text-muted-foreground",
|
|
@@ -716,24 +720,24 @@ function Aa({
|
|
|
716
720
|
}
|
|
717
721
|
),
|
|
718
722
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
719
|
-
/* @__PURE__ */ e("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: Na(t,
|
|
720
|
-
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children:
|
|
723
|
+
/* @__PURE__ */ e("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: Na(t, m) }),
|
|
724
|
+
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: ft(t, m) })
|
|
721
725
|
] }),
|
|
722
|
-
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children:
|
|
726
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: Ot(t.updatedAt) }),
|
|
723
727
|
/* @__PURE__ */ e(Da, { visual: t }),
|
|
724
728
|
/* @__PURE__ */ e("span", { className: "text-right tabular-nums text-muted-foreground", children: t.ownership.sharedCount > 0 ? t.ownership.sharedCount : "—" }),
|
|
725
729
|
/* @__PURE__ */ e(
|
|
726
730
|
Ea,
|
|
727
731
|
{
|
|
728
732
|
visual: t,
|
|
729
|
-
onOpenVisual:
|
|
730
|
-
onEditDetails:
|
|
731
|
-
onShareVisual:
|
|
732
|
-
onDeleteVisual:
|
|
733
|
+
onOpenVisual: i,
|
|
734
|
+
onEditDetails: s,
|
|
735
|
+
onShareVisual: d,
|
|
736
|
+
onDeleteVisual: p,
|
|
733
737
|
onDuplicateVisual: l,
|
|
734
|
-
duplicatingId:
|
|
735
|
-
isDeleting:
|
|
736
|
-
isConsoleMode:
|
|
738
|
+
duplicatingId: u,
|
|
739
|
+
isDeleting: c,
|
|
740
|
+
isConsoleMode: m
|
|
737
741
|
}
|
|
738
742
|
)
|
|
739
743
|
]
|
|
@@ -743,19 +747,19 @@ function Aa({
|
|
|
743
747
|
function Ea({
|
|
744
748
|
visual: t,
|
|
745
749
|
onOpenVisual: a,
|
|
746
|
-
onEditDetails:
|
|
747
|
-
onShareVisual:
|
|
748
|
-
onDeleteVisual:
|
|
749
|
-
onDuplicateVisual:
|
|
750
|
-
duplicatingId:
|
|
751
|
-
isDeleting:
|
|
750
|
+
onEditDetails: o,
|
|
751
|
+
onShareVisual: n,
|
|
752
|
+
onDeleteVisual: i,
|
|
753
|
+
onDuplicateVisual: s,
|
|
754
|
+
duplicatingId: d,
|
|
755
|
+
isDeleting: p,
|
|
752
756
|
isConsoleMode: l
|
|
753
757
|
}) {
|
|
754
758
|
return /* @__PURE__ */ r(
|
|
755
759
|
"div",
|
|
756
760
|
{
|
|
757
761
|
className: "flex items-center justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
|
|
758
|
-
onClick: (
|
|
762
|
+
onClick: (u) => u.stopPropagation(),
|
|
759
763
|
children: [
|
|
760
764
|
/* @__PURE__ */ e(
|
|
761
765
|
B,
|
|
@@ -765,73 +769,73 @@ function Ea({
|
|
|
765
769
|
className: "w-7 px-0",
|
|
766
770
|
onClick: () => a(t),
|
|
767
771
|
"aria-label": "Edit visual",
|
|
768
|
-
children: /* @__PURE__ */ e(
|
|
772
|
+
children: /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" })
|
|
769
773
|
}
|
|
770
774
|
),
|
|
771
|
-
/* @__PURE__ */ r(
|
|
772
|
-
/* @__PURE__ */ e(
|
|
775
|
+
/* @__PURE__ */ r($e, { modal: !1, children: [
|
|
776
|
+
/* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ e(
|
|
773
777
|
B,
|
|
774
778
|
{
|
|
775
779
|
size: "xs",
|
|
776
780
|
variant: "ghost",
|
|
777
781
|
className: "w-7 px-0",
|
|
778
782
|
"aria-label": "More actions",
|
|
779
|
-
children: /* @__PURE__ */ e(
|
|
783
|
+
children: /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5" })
|
|
780
784
|
}
|
|
781
785
|
) }),
|
|
782
786
|
/* @__PURE__ */ r(
|
|
783
|
-
|
|
787
|
+
We,
|
|
784
788
|
{
|
|
785
789
|
align: "end",
|
|
786
790
|
className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
787
791
|
children: [
|
|
788
|
-
/* @__PURE__ */ r(
|
|
789
|
-
/* @__PURE__ */ e(
|
|
792
|
+
/* @__PURE__ */ r(G, { onClick: () => a(t), children: [
|
|
793
|
+
/* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" }),
|
|
790
794
|
"Edit visual"
|
|
791
795
|
] }),
|
|
792
796
|
/* @__PURE__ */ r(
|
|
793
|
-
|
|
797
|
+
G,
|
|
794
798
|
{
|
|
795
|
-
onClick: () =>
|
|
796
|
-
disabled:
|
|
799
|
+
onClick: () => s(t.id),
|
|
800
|
+
disabled: d === t.id,
|
|
797
801
|
children: [
|
|
798
|
-
|
|
799
|
-
|
|
802
|
+
d === t.id ? /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(er, { className: "h-3.5 w-3.5" }),
|
|
803
|
+
d === t.id ? "Duplicating..." : "Duplicate"
|
|
800
804
|
]
|
|
801
805
|
}
|
|
802
806
|
),
|
|
803
|
-
t.permissions.canEdit && /* @__PURE__ */ r(
|
|
804
|
-
/* @__PURE__ */ e(
|
|
807
|
+
t.permissions.canEdit && /* @__PURE__ */ r(G, { onClick: () => o(t), children: [
|
|
808
|
+
/* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" }),
|
|
805
809
|
"Edit details"
|
|
806
810
|
] }),
|
|
807
|
-
t.permissions.canShare && /* @__PURE__ */ r(
|
|
808
|
-
/* @__PURE__ */ e(
|
|
811
|
+
t.permissions.canShare && /* @__PURE__ */ r(G, { onClick: () => n(t), children: [
|
|
812
|
+
/* @__PURE__ */ e(Nt, { className: "h-3.5 w-3.5" }),
|
|
809
813
|
"Share"
|
|
810
814
|
] }),
|
|
811
815
|
t.permissions.canDelete && /* @__PURE__ */ r(W, { children: [
|
|
812
|
-
/* @__PURE__ */ e(
|
|
816
|
+
/* @__PURE__ */ e(Me, {}),
|
|
813
817
|
/* @__PURE__ */ r(
|
|
814
|
-
|
|
818
|
+
G,
|
|
815
819
|
{
|
|
816
820
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
817
|
-
onClick: () =>
|
|
818
|
-
disabled:
|
|
821
|
+
onClick: () => i(t),
|
|
822
|
+
disabled: p,
|
|
819
823
|
children: [
|
|
820
|
-
/* @__PURE__ */ e(
|
|
821
|
-
|
|
824
|
+
/* @__PURE__ */ e(Pe, { className: "h-3.5 w-3.5" }),
|
|
825
|
+
p ? "Deleting..." : "Delete"
|
|
822
826
|
]
|
|
823
827
|
}
|
|
824
828
|
)
|
|
825
829
|
] }),
|
|
826
|
-
/* @__PURE__ */ e(
|
|
830
|
+
/* @__PURE__ */ e(Me, {}),
|
|
827
831
|
/* @__PURE__ */ r("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
|
|
828
|
-
|
|
829
|
-
/* @__PURE__ */ e(
|
|
830
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
832
|
+
_t(t, l) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
833
|
+
/* @__PURE__ */ e(tr, { className: "h-3 w-3" }),
|
|
834
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: ft(t, l) })
|
|
831
835
|
] }),
|
|
832
836
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
833
|
-
/* @__PURE__ */ e(
|
|
834
|
-
/* @__PURE__ */ e("span", { children:
|
|
837
|
+
/* @__PURE__ */ e(rr, { className: "h-3 w-3" }),
|
|
838
|
+
/* @__PURE__ */ e("span", { children: Ot(t.updatedAt) })
|
|
835
839
|
] })
|
|
836
840
|
] })
|
|
837
841
|
]
|
|
@@ -845,27 +849,27 @@ function Ea({
|
|
|
845
849
|
function Ia({
|
|
846
850
|
open: t,
|
|
847
851
|
onOpenChange: a,
|
|
848
|
-
isLibraryVisual:
|
|
849
|
-
currentVisualName:
|
|
850
|
-
isSaving:
|
|
851
|
-
destinationMode:
|
|
852
|
-
onConfirm:
|
|
852
|
+
isLibraryVisual: o,
|
|
853
|
+
currentVisualName: n,
|
|
854
|
+
isSaving: i = !1,
|
|
855
|
+
destinationMode: s = "both",
|
|
856
|
+
onConfirm: d
|
|
853
857
|
}) {
|
|
854
|
-
const [
|
|
855
|
-
|
|
856
|
-
), [
|
|
857
|
-
|
|
858
|
+
const [p, l] = E(
|
|
859
|
+
o && n ? `Copy of ${n}` : n || ""
|
|
860
|
+
), [u, c] = E("");
|
|
861
|
+
Wt.useEffect(() => {
|
|
858
862
|
t && (l(
|
|
859
|
-
|
|
860
|
-
),
|
|
861
|
-
}, [t,
|
|
862
|
-
const
|
|
863
|
+
o && n ? `Copy of ${n}` : n || ""
|
|
864
|
+
), c(""));
|
|
865
|
+
}, [t, o, n]);
|
|
866
|
+
const m = !!p.trim(), h = s === "local" ? {
|
|
863
867
|
saveToLibrary: !1,
|
|
864
868
|
saveToCurrentDashboard: !0,
|
|
865
869
|
badgeType: "local",
|
|
866
870
|
description: "Creates a local copy on the current dashboard.",
|
|
867
871
|
actionLabel: "Add to Dashboard (Local)"
|
|
868
|
-
} :
|
|
872
|
+
} : s === "library" ? {
|
|
869
873
|
saveToLibrary: !0,
|
|
870
874
|
saveToCurrentDashboard: !1,
|
|
871
875
|
badgeType: "library",
|
|
@@ -877,17 +881,17 @@ function Ia({
|
|
|
877
881
|
badgeType: "linked",
|
|
878
882
|
description: "Creates a new library visual and adds a linked copy to this dashboard.",
|
|
879
883
|
actionLabel: "Save Copy as Linked Visual"
|
|
880
|
-
},
|
|
881
|
-
!
|
|
882
|
-
name:
|
|
883
|
-
description:
|
|
884
|
+
}, f = () => {
|
|
885
|
+
!m || i || d({
|
|
886
|
+
name: p.trim(),
|
|
887
|
+
description: u.trim() || void 0,
|
|
884
888
|
saveToLibrary: h.saveToLibrary,
|
|
885
889
|
saveToCurrentDashboard: h.saveToCurrentDashboard
|
|
886
890
|
});
|
|
887
891
|
};
|
|
888
|
-
return /* @__PURE__ */ e(
|
|
889
|
-
/* @__PURE__ */ r(
|
|
890
|
-
/* @__PURE__ */ r(
|
|
892
|
+
return /* @__PURE__ */ e(De, { open: t, onOpenChange: a, children: /* @__PURE__ */ r(ke, { className: "sm:max-w-[500px]", children: [
|
|
893
|
+
/* @__PURE__ */ r(ct, { children: [
|
|
894
|
+
/* @__PURE__ */ r(Ae, { className: "flex items-center gap-2", children: [
|
|
891
895
|
/* @__PURE__ */ e("span", { children: "Save Visual As" }),
|
|
892
896
|
h.badgeType !== "local" && /* @__PURE__ */ e(
|
|
893
897
|
oa,
|
|
@@ -898,77 +902,77 @@ function Ia({
|
|
|
898
902
|
}
|
|
899
903
|
)
|
|
900
904
|
] }),
|
|
901
|
-
/* @__PURE__ */ e(
|
|
905
|
+
/* @__PURE__ */ e(dt, { children: h.description })
|
|
902
906
|
] }),
|
|
903
907
|
/* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
|
|
904
908
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
905
|
-
/* @__PURE__ */ e(
|
|
909
|
+
/* @__PURE__ */ e(Se, { htmlFor: "name", children: "Name" }),
|
|
906
910
|
/* @__PURE__ */ e(
|
|
907
|
-
|
|
911
|
+
Ye,
|
|
908
912
|
{
|
|
909
913
|
id: "name",
|
|
910
|
-
value:
|
|
911
|
-
onChange: (
|
|
914
|
+
value: p,
|
|
915
|
+
onChange: (x) => l(x.target.value),
|
|
912
916
|
placeholder: "Enter visual name",
|
|
913
|
-
disabled:
|
|
917
|
+
disabled: i
|
|
914
918
|
}
|
|
915
919
|
)
|
|
916
920
|
] }),
|
|
917
921
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
918
|
-
/* @__PURE__ */ e(
|
|
922
|
+
/* @__PURE__ */ e(Se, { htmlFor: "description", children: "Description (optional)" }),
|
|
919
923
|
/* @__PURE__ */ e(
|
|
920
|
-
|
|
924
|
+
ar,
|
|
921
925
|
{
|
|
922
926
|
id: "description",
|
|
923
|
-
value:
|
|
924
|
-
onChange: (
|
|
927
|
+
value: u,
|
|
928
|
+
onChange: (x) => c(x.target.value),
|
|
925
929
|
placeholder: "Enter visual description",
|
|
926
930
|
rows: 3,
|
|
927
|
-
disabled:
|
|
931
|
+
disabled: i
|
|
928
932
|
}
|
|
929
933
|
)
|
|
930
934
|
] })
|
|
931
935
|
] }),
|
|
932
|
-
/* @__PURE__ */ r(
|
|
936
|
+
/* @__PURE__ */ r(nr, { children: [
|
|
933
937
|
/* @__PURE__ */ e(
|
|
934
938
|
B,
|
|
935
939
|
{
|
|
936
940
|
variant: "outline",
|
|
937
941
|
onClick: () => a(!1),
|
|
938
|
-
disabled:
|
|
942
|
+
disabled: i,
|
|
939
943
|
children: "Cancel"
|
|
940
944
|
}
|
|
941
945
|
),
|
|
942
|
-
/* @__PURE__ */ r(B, { onClick:
|
|
943
|
-
|
|
946
|
+
/* @__PURE__ */ r(B, { onClick: f, disabled: !m || i, children: [
|
|
947
|
+
i && /* @__PURE__ */ e(te, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
944
948
|
h.actionLabel
|
|
945
949
|
] })
|
|
946
950
|
] })
|
|
947
951
|
] }) });
|
|
948
952
|
}
|
|
949
953
|
function Fa() {
|
|
950
|
-
const [t, a] = E(!1), [
|
|
951
|
-
var
|
|
952
|
-
return ((
|
|
953
|
-
})(),
|
|
954
|
-
|
|
954
|
+
const [t, a] = E(!1), [o, n] = E(!1), [i, s] = E(null), [d, p] = E(null), l = ge((g) => g.frame), u = ge((g) => g.card), c = sr(), m = P((g) => g.selectedSheetId), h = P((g) => g.dashboard), { getUpdatedFrame: f } = pt(), { selectVisual: x } = wt(), { addFrame: C, setSelectedFrameId: N, setIsVisualEditing: I } = be(), D = kt(), b = !!(l != null && l.visualId), S = (() => {
|
|
955
|
+
var g, v;
|
|
956
|
+
return ((g = l == null ? void 0 : l.cards) == null ? void 0 : g.length) === 1 && ((v = l.cards[0]) != null && v.title) ? l.cards[0].title : c != null && c.title ? c.title : (u == null ? void 0 : u.title) || "Untitled Visual";
|
|
957
|
+
})(), A = or((g) => {
|
|
958
|
+
g != null && g.id && (x(g), o && i && d && m && (async () => {
|
|
955
959
|
try {
|
|
956
|
-
const
|
|
957
|
-
...
|
|
958
|
-
id:
|
|
959
|
-
visualId:
|
|
960
|
+
const v = {
|
|
961
|
+
...i,
|
|
962
|
+
id: bt(),
|
|
963
|
+
visualId: g.id
|
|
960
964
|
// Link to the newly created library visual
|
|
961
965
|
};
|
|
962
|
-
|
|
966
|
+
C(m, v, {
|
|
963
967
|
position: "end",
|
|
964
|
-
semanticExecutionPayload:
|
|
965
|
-
}),
|
|
966
|
-
} catch (
|
|
968
|
+
semanticExecutionPayload: d
|
|
969
|
+
}), N(v.id), n(!1), s(null), p(null), I(!1);
|
|
970
|
+
} catch (v) {
|
|
967
971
|
console.error(
|
|
968
972
|
"Failed to promote semantic metadata for saved visual:",
|
|
969
|
-
|
|
973
|
+
v
|
|
970
974
|
), O.error(
|
|
971
|
-
|
|
975
|
+
v instanceof Error ? v.message : "Failed to prepare semantic metadata for the saved visual"
|
|
972
976
|
);
|
|
973
977
|
}
|
|
974
978
|
})(), a(!1));
|
|
@@ -976,65 +980,65 @@ function Fa() {
|
|
|
976
980
|
return {
|
|
977
981
|
saveAsDialogOpen: t,
|
|
978
982
|
setSaveAsDialogOpen: a,
|
|
979
|
-
handleSaveAs: async (
|
|
980
|
-
if (!
|
|
983
|
+
handleSaveAs: async (g) => {
|
|
984
|
+
if (!m) {
|
|
981
985
|
O.error("No sheet selected");
|
|
982
986
|
return;
|
|
983
987
|
}
|
|
984
|
-
const
|
|
988
|
+
const v = f(), T = Tt(v);
|
|
985
989
|
if (T) {
|
|
986
990
|
O.error(T);
|
|
987
991
|
return;
|
|
988
992
|
}
|
|
989
|
-
const H =
|
|
990
|
-
...
|
|
991
|
-
cards:
|
|
992
|
-
...
|
|
993
|
-
title:
|
|
993
|
+
const H = v.cards.length === 1 ? {
|
|
994
|
+
...v,
|
|
995
|
+
cards: v.cards.map((k) => ({
|
|
996
|
+
...k,
|
|
997
|
+
title: g.name
|
|
994
998
|
// Use visual name as card title
|
|
995
999
|
}))
|
|
996
|
-
} :
|
|
997
|
-
if (
|
|
998
|
-
let
|
|
999
|
-
if (
|
|
1000
|
+
} : v;
|
|
1001
|
+
if (g.saveToLibrary) {
|
|
1002
|
+
let k = null;
|
|
1003
|
+
if (g.saveToCurrentDashboard)
|
|
1000
1004
|
try {
|
|
1001
|
-
|
|
1002
|
-
previousFrame:
|
|
1005
|
+
k = await D(H, {
|
|
1006
|
+
previousFrame: Je(h, H.id)
|
|
1003
1007
|
});
|
|
1004
|
-
} catch (
|
|
1008
|
+
} catch ($) {
|
|
1005
1009
|
console.error(
|
|
1006
1010
|
"Failed to prepare semantic metadata before saving visual:",
|
|
1007
|
-
|
|
1011
|
+
$
|
|
1008
1012
|
), O.error(
|
|
1009
|
-
|
|
1013
|
+
$ instanceof Error ? $.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1010
1014
|
);
|
|
1011
1015
|
return;
|
|
1012
1016
|
}
|
|
1013
|
-
|
|
1017
|
+
n(g.saveToCurrentDashboard), s(H), p(k);
|
|
1014
1018
|
const V = {
|
|
1015
|
-
title:
|
|
1016
|
-
description:
|
|
1019
|
+
title: g.name,
|
|
1020
|
+
description: g.description,
|
|
1017
1021
|
frameObject: H,
|
|
1018
1022
|
// Card title synced for single-card frames
|
|
1019
1023
|
isPrivate: !1
|
|
1020
1024
|
};
|
|
1021
|
-
|
|
1022
|
-
} else if (
|
|
1023
|
-
const
|
|
1025
|
+
A.mutate(V);
|
|
1026
|
+
} else if (g.saveToCurrentDashboard) {
|
|
1027
|
+
const k = {
|
|
1024
1028
|
...H,
|
|
1025
1029
|
// Card title already synced
|
|
1026
|
-
id:
|
|
1030
|
+
id: bt(),
|
|
1027
1031
|
visualId: void 0
|
|
1028
1032
|
// Explicitly no visualId for local visuals
|
|
1029
1033
|
};
|
|
1030
1034
|
try {
|
|
1031
|
-
const V = await
|
|
1032
|
-
previousFrame:
|
|
1035
|
+
const V = await D(H, {
|
|
1036
|
+
previousFrame: Je(h, H.id)
|
|
1033
1037
|
});
|
|
1034
|
-
|
|
1038
|
+
C(m, k, {
|
|
1035
1039
|
position: "end",
|
|
1036
1040
|
semanticExecutionPayload: V
|
|
1037
|
-
}),
|
|
1041
|
+
}), N(k.id), O.success("Visual saved to dashboard"), a(!1), I(!1);
|
|
1038
1042
|
} catch (V) {
|
|
1039
1043
|
console.error("Failed to save visual to dashboard:", V), O.error(
|
|
1040
1044
|
V instanceof Error ? V.message : "Failed to prepare semantic metadata for the visual"
|
|
@@ -1042,113 +1046,113 @@ function Fa() {
|
|
|
1042
1046
|
}
|
|
1043
1047
|
}
|
|
1044
1048
|
},
|
|
1045
|
-
isLibraryVisual:
|
|
1049
|
+
isLibraryVisual: b,
|
|
1046
1050
|
currentVisualName: S,
|
|
1047
|
-
isSaving:
|
|
1051
|
+
isSaving: A.isPending
|
|
1048
1052
|
};
|
|
1049
1053
|
}
|
|
1050
|
-
function
|
|
1051
|
-
const { isInspectionMode: a } =
|
|
1052
|
-
saveAsDialogOpen:
|
|
1054
|
+
function Wn(t = {}) {
|
|
1055
|
+
const { isInspectionMode: a } = ir(), o = ge((k) => k.frame), n = ge((k) => k.editorContext), i = lr((k) => k.selectedVisual), s = P((k) => k.selectedFrameId), d = P((k) => k.selectedSheetId), p = P((k) => k.dashboard), { setIsVisualEditing: l, updateFrame: u } = be(), [c, m] = E(!1), [h, f] = E("both"), x = kt(), C = (n == null ? void 0 : n.type) === "documentSection", N = !!(o != null && o.visualId || i != null && i.id), I = !!(o != null && o.visualId && s), D = N && !I, {
|
|
1056
|
+
saveAsDialogOpen: b,
|
|
1053
1057
|
setSaveAsDialogOpen: S,
|
|
1054
|
-
handleSaveAs:
|
|
1058
|
+
handleSaveAs: A,
|
|
1055
1059
|
isLibraryVisual: U,
|
|
1056
|
-
currentVisualName:
|
|
1057
|
-
isSaving:
|
|
1058
|
-
} = Fa(), { getUpdatedFrame: T } =
|
|
1060
|
+
currentVisualName: g,
|
|
1061
|
+
isSaving: v
|
|
1062
|
+
} = Fa(), { getUpdatedFrame: T } = pt();
|
|
1059
1063
|
if (a)
|
|
1060
1064
|
return /* @__PURE__ */ r(W, { children: [
|
|
1061
1065
|
/* @__PURE__ */ e(
|
|
1062
|
-
|
|
1066
|
+
Xe,
|
|
1063
1067
|
{
|
|
1064
1068
|
className: "rounded-control",
|
|
1065
1069
|
variant: "default"
|
|
1066
1070
|
}
|
|
1067
1071
|
),
|
|
1068
|
-
/* @__PURE__ */ e(
|
|
1072
|
+
/* @__PURE__ */ e(Ze, {})
|
|
1069
1073
|
] });
|
|
1070
|
-
if (
|
|
1074
|
+
if (C)
|
|
1071
1075
|
return /* @__PURE__ */ r(W, { children: [
|
|
1072
|
-
/* @__PURE__ */ e(
|
|
1073
|
-
/* @__PURE__ */ e(
|
|
1076
|
+
/* @__PURE__ */ e(Xe, { className: "rounded-control", variant: "default" }),
|
|
1077
|
+
/* @__PURE__ */ e(Ze, {})
|
|
1074
1078
|
] });
|
|
1075
1079
|
const F = async () => {
|
|
1076
|
-
if (!
|
|
1080
|
+
if (!d) {
|
|
1077
1081
|
O.error("No sheet selected");
|
|
1078
1082
|
return;
|
|
1079
1083
|
}
|
|
1080
|
-
if (
|
|
1081
|
-
|
|
1082
|
-
const
|
|
1084
|
+
if (c) return;
|
|
1085
|
+
m(!0);
|
|
1086
|
+
const k = T(), V = Tt(k);
|
|
1083
1087
|
if (V) {
|
|
1084
|
-
|
|
1088
|
+
m(!1), O.error(V);
|
|
1085
1089
|
return;
|
|
1086
1090
|
}
|
|
1087
|
-
const
|
|
1088
|
-
...
|
|
1091
|
+
const $ = {
|
|
1092
|
+
...k,
|
|
1089
1093
|
visualId: void 0
|
|
1090
|
-
}, xe =
|
|
1094
|
+
}, xe = Je(p, $.id);
|
|
1091
1095
|
try {
|
|
1092
|
-
const
|
|
1096
|
+
const re = await x($, {
|
|
1093
1097
|
previousFrame: xe
|
|
1094
1098
|
});
|
|
1095
|
-
d
|
|
1096
|
-
semanticExecutionPayload:
|
|
1099
|
+
u(d, $, {
|
|
1100
|
+
semanticExecutionPayload: re
|
|
1097
1101
|
});
|
|
1098
|
-
} catch (
|
|
1099
|
-
console.error("Failed to apply local semantic metadata:",
|
|
1100
|
-
|
|
1102
|
+
} catch (re) {
|
|
1103
|
+
console.error("Failed to apply local semantic metadata:", re), m(!1), O.error(
|
|
1104
|
+
re instanceof Error ? re.message : "Failed to prepare semantic metadata for this visual"
|
|
1101
1105
|
);
|
|
1102
1106
|
return;
|
|
1103
1107
|
}
|
|
1104
1108
|
setTimeout(() => {
|
|
1105
|
-
|
|
1109
|
+
m(!1), O.success("Changes applied. Visual is now local to this dashboard"), l(!1);
|
|
1106
1110
|
}, 300);
|
|
1107
|
-
}, H = (
|
|
1108
|
-
|
|
1111
|
+
}, H = (k) => {
|
|
1112
|
+
f(k), S(!0);
|
|
1109
1113
|
};
|
|
1110
1114
|
return /* @__PURE__ */ r(W, { children: [
|
|
1111
1115
|
/* @__PURE__ */ r("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
|
|
1112
|
-
!
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
/* @__PURE__ */ r(
|
|
1116
|
-
/* @__PURE__ */ e(
|
|
1116
|
+
!N && /* @__PURE__ */ e(Xe, { className: "!rounded-none", variant: "default" }),
|
|
1117
|
+
N && D && /* @__PURE__ */ e(ia, { className: "!rounded-none", variant: "default" }),
|
|
1118
|
+
N && I && /* @__PURE__ */ e(la, { className: "!rounded-none" }),
|
|
1119
|
+
/* @__PURE__ */ r($e, { modal: !1, children: [
|
|
1120
|
+
/* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1117
1121
|
B,
|
|
1118
1122
|
{
|
|
1119
1123
|
variant: "default",
|
|
1120
1124
|
size: "xs",
|
|
1121
1125
|
className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
|
|
1122
1126
|
"aria-label": "Open visual save options",
|
|
1123
|
-
disabled:
|
|
1124
|
-
children: /* @__PURE__ */ e(
|
|
1127
|
+
disabled: v || c,
|
|
1128
|
+
children: /* @__PURE__ */ e(Ut, { className: "h-3.5 w-3.5" })
|
|
1125
1129
|
}
|
|
1126
1130
|
) }),
|
|
1127
1131
|
/* @__PURE__ */ r(
|
|
1128
|
-
|
|
1132
|
+
We,
|
|
1129
1133
|
{
|
|
1130
1134
|
align: "end",
|
|
1131
1135
|
className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
|
|
1132
1136
|
children: [
|
|
1133
1137
|
I && /* @__PURE__ */ r(W, { children: [
|
|
1134
1138
|
/* @__PURE__ */ r(
|
|
1135
|
-
|
|
1139
|
+
G,
|
|
1136
1140
|
{
|
|
1137
1141
|
onClick: F,
|
|
1138
|
-
disabled:
|
|
1142
|
+
disabled: c,
|
|
1139
1143
|
children: [
|
|
1140
|
-
/* @__PURE__ */ e(
|
|
1141
|
-
|
|
1144
|
+
/* @__PURE__ */ e(Bt, { className: "h-3.5 w-3.5" }),
|
|
1145
|
+
c ? "Applying..." : "Apply Locally"
|
|
1142
1146
|
]
|
|
1143
1147
|
}
|
|
1144
1148
|
),
|
|
1145
|
-
/* @__PURE__ */ e(
|
|
1149
|
+
/* @__PURE__ */ e(Me, {})
|
|
1146
1150
|
] }),
|
|
1147
1151
|
/* @__PURE__ */ r(
|
|
1148
|
-
|
|
1152
|
+
G,
|
|
1149
1153
|
{
|
|
1150
1154
|
onClick: () => H("local"),
|
|
1151
|
-
disabled:
|
|
1155
|
+
disabled: v,
|
|
1152
1156
|
children: [
|
|
1153
1157
|
/* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" }),
|
|
1154
1158
|
"Add to Dashboard (Local)"
|
|
@@ -1156,10 +1160,10 @@ function $n(t = {}) {
|
|
|
1156
1160
|
}
|
|
1157
1161
|
),
|
|
1158
1162
|
/* @__PURE__ */ r(
|
|
1159
|
-
|
|
1163
|
+
G,
|
|
1160
1164
|
{
|
|
1161
1165
|
onClick: () => H("library"),
|
|
1162
|
-
disabled:
|
|
1166
|
+
disabled: v,
|
|
1163
1167
|
children: [
|
|
1164
1168
|
/* @__PURE__ */ e(ca, { className: "h-3.5 w-3.5" }),
|
|
1165
1169
|
"Save as Library Visual"
|
|
@@ -1167,10 +1171,10 @@ function $n(t = {}) {
|
|
|
1167
1171
|
}
|
|
1168
1172
|
),
|
|
1169
1173
|
/* @__PURE__ */ r(
|
|
1170
|
-
|
|
1174
|
+
G,
|
|
1171
1175
|
{
|
|
1172
1176
|
onClick: () => H("both"),
|
|
1173
|
-
disabled:
|
|
1177
|
+
disabled: v,
|
|
1174
1178
|
children: [
|
|
1175
1179
|
/* @__PURE__ */ e(da, { className: "h-3.5 w-3.5" }),
|
|
1176
1180
|
"Save Copy as Linked Visual"
|
|
@@ -1182,154 +1186,154 @@ function $n(t = {}) {
|
|
|
1182
1186
|
)
|
|
1183
1187
|
] })
|
|
1184
1188
|
] }),
|
|
1185
|
-
/* @__PURE__ */ e(
|
|
1189
|
+
/* @__PURE__ */ e(Ze, {}),
|
|
1186
1190
|
/* @__PURE__ */ e(
|
|
1187
1191
|
Ia,
|
|
1188
1192
|
{
|
|
1189
|
-
open:
|
|
1190
|
-
onOpenChange: (
|
|
1191
|
-
|
|
1193
|
+
open: b,
|
|
1194
|
+
onOpenChange: (k) => {
|
|
1195
|
+
v || S(k);
|
|
1192
1196
|
},
|
|
1193
1197
|
isLibraryVisual: U,
|
|
1194
|
-
currentVisualName:
|
|
1195
|
-
isSaving:
|
|
1198
|
+
currentVisualName: g,
|
|
1199
|
+
isSaving: v,
|
|
1196
1200
|
destinationMode: h,
|
|
1197
|
-
onConfirm:
|
|
1201
|
+
onConfirm: A
|
|
1198
1202
|
}
|
|
1199
1203
|
)
|
|
1200
1204
|
] });
|
|
1201
1205
|
}
|
|
1202
|
-
function
|
|
1203
|
-
const a = ge((
|
|
1204
|
-
if (!
|
|
1206
|
+
function Hn({ className: t }) {
|
|
1207
|
+
const a = ge((u) => u.isDevMode), o = P((u) => u.isVisualEditing), { setIsDevMode: n } = Vt(), { config: i } = Ht(cr).tokenProps, s = (i == null ? void 0 : i.showAdvancedMode) !== !1;
|
|
1208
|
+
if (!o || !s)
|
|
1205
1209
|
return null;
|
|
1206
|
-
const
|
|
1210
|
+
const d = a ? pa : dr, p = a ? "Visual editor" : "SQL editor", l = a ? "Switch to visual editor" : "Switch to SQL editor";
|
|
1207
1211
|
return /* @__PURE__ */ r(
|
|
1208
1212
|
"button",
|
|
1209
1213
|
{
|
|
1210
1214
|
type: "button",
|
|
1211
1215
|
"aria-label": l,
|
|
1212
1216
|
title: l,
|
|
1213
|
-
onClick: () =>
|
|
1214
|
-
className:
|
|
1217
|
+
onClick: () => n(!a),
|
|
1218
|
+
className: q(
|
|
1215
1219
|
"inline-flex h-7 items-center gap-1.5 rounded-control border border-input bg-background px-2 text-[12px] font-medium text-foreground transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:outline-none",
|
|
1216
1220
|
t
|
|
1217
1221
|
),
|
|
1218
1222
|
children: [
|
|
1219
|
-
/* @__PURE__ */ e(
|
|
1220
|
-
|
|
1223
|
+
/* @__PURE__ */ e(d, { className: "h-3 w-3 text-muted-foreground" }),
|
|
1224
|
+
p
|
|
1221
1225
|
]
|
|
1222
1226
|
}
|
|
1223
1227
|
);
|
|
1224
1228
|
}
|
|
1225
|
-
function
|
|
1229
|
+
function Gn({
|
|
1226
1230
|
open: t,
|
|
1227
1231
|
onOpenChange: a,
|
|
1228
|
-
onSave:
|
|
1229
|
-
onDiscard:
|
|
1230
|
-
isSaving:
|
|
1231
|
-
title:
|
|
1232
|
-
description:
|
|
1233
|
-
cancelLabel:
|
|
1232
|
+
onSave: o,
|
|
1233
|
+
onDiscard: n,
|
|
1234
|
+
isSaving: i,
|
|
1235
|
+
title: s = "Unsaved changes",
|
|
1236
|
+
description: d = "You have unsaved changes to this dashboard. What would you like to do?",
|
|
1237
|
+
cancelLabel: p = "Cancel",
|
|
1234
1238
|
discardLabel: l = "Discard",
|
|
1235
|
-
saveLabel:
|
|
1239
|
+
saveLabel: u = "Save"
|
|
1236
1240
|
}) {
|
|
1237
|
-
return /* @__PURE__ */ e(
|
|
1238
|
-
!
|
|
1239
|
-
}, children: /* @__PURE__ */ r(
|
|
1240
|
-
/* @__PURE__ */ r(
|
|
1241
|
-
/* @__PURE__ */ e(
|
|
1242
|
-
/* @__PURE__ */ e(
|
|
1241
|
+
return /* @__PURE__ */ e(tt, { open: t, onOpenChange: (m) => {
|
|
1242
|
+
!m && i || a(m);
|
|
1243
|
+
}, children: /* @__PURE__ */ r(rt, { children: [
|
|
1244
|
+
/* @__PURE__ */ r(at, { children: [
|
|
1245
|
+
/* @__PURE__ */ e(nt, { children: s }),
|
|
1246
|
+
/* @__PURE__ */ e(st, { children: d })
|
|
1243
1247
|
] }),
|
|
1244
|
-
/* @__PURE__ */ r(
|
|
1248
|
+
/* @__PURE__ */ r(ot, { children: [
|
|
1245
1249
|
/* @__PURE__ */ e(
|
|
1246
1250
|
B,
|
|
1247
1251
|
{
|
|
1248
1252
|
type: "button",
|
|
1249
1253
|
size: "xs",
|
|
1250
|
-
onClick:
|
|
1251
|
-
disabled:
|
|
1254
|
+
onClick: n,
|
|
1255
|
+
disabled: i,
|
|
1252
1256
|
variant: "ghost",
|
|
1253
1257
|
className: "mr-auto text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",
|
|
1254
1258
|
children: l
|
|
1255
1259
|
}
|
|
1256
1260
|
),
|
|
1257
|
-
/* @__PURE__ */ e(
|
|
1258
|
-
/* @__PURE__ */ e(B, { type: "button", size: "xs", onClick:
|
|
1261
|
+
/* @__PURE__ */ e(it, { disabled: i, children: p }),
|
|
1262
|
+
/* @__PURE__ */ e(B, { type: "button", size: "xs", onClick: o, disabled: i, children: i ? /* @__PURE__ */ r(W, { children: [
|
|
1259
1263
|
/* @__PURE__ */ e(te, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
1260
1264
|
"Saving..."
|
|
1261
|
-
] }) :
|
|
1265
|
+
] }) : u })
|
|
1262
1266
|
] })
|
|
1263
1267
|
] }) });
|
|
1264
1268
|
}
|
|
1265
|
-
const La = 1e4, Ba = 15e3, Ta = 3e4, Va = 3e4, Ra = 12e4,
|
|
1269
|
+
const La = 1e4, Ba = 15e3, Ta = 3e4, Va = 3e4, Ra = 12e4, yt = 2 * 60 * 60 * 1e3;
|
|
1266
1270
|
function Ua(t) {
|
|
1267
1271
|
const a = Date.now() - t.getTime();
|
|
1268
1272
|
return a < Va ? La : a < Ra ? Ba : Ta;
|
|
1269
1273
|
}
|
|
1270
|
-
function
|
|
1271
|
-
const { authToken: t, tokenProps: a } =
|
|
1274
|
+
function Kn() {
|
|
1275
|
+
const { authToken: t, tokenProps: a } = He(), o = ue((h) => h.activeExports), [n, i] = E(
|
|
1272
1276
|
typeof document < "u" ? !document.hidden : !0
|
|
1273
|
-
),
|
|
1277
|
+
), s = he(null), d = he(!1), p = he(void 0), l = a == null ? void 0 : a.apiServiceUrl, u = t == null ? void 0 : t.accessToken, c = K(() => {
|
|
1274
1278
|
const h = ue.getState().activeExports;
|
|
1275
1279
|
return Array.from(h.values()).filter(
|
|
1276
|
-
(
|
|
1280
|
+
(f) => ut(f.status)
|
|
1277
1281
|
);
|
|
1278
1282
|
}, []);
|
|
1279
|
-
|
|
1283
|
+
Q(() => {
|
|
1280
1284
|
if (typeof document > "u") return;
|
|
1281
1285
|
const h = () => {
|
|
1282
|
-
|
|
1286
|
+
i(!document.hidden);
|
|
1283
1287
|
};
|
|
1284
1288
|
return document.addEventListener("visibilitychange", h), () => {
|
|
1285
1289
|
document.removeEventListener("visibilitychange", h);
|
|
1286
1290
|
};
|
|
1287
1291
|
}, []);
|
|
1288
|
-
const
|
|
1289
|
-
if (!l || !
|
|
1290
|
-
|
|
1292
|
+
const m = K(async () => {
|
|
1293
|
+
if (!l || !u) {
|
|
1294
|
+
d.current = !1;
|
|
1291
1295
|
return;
|
|
1292
1296
|
}
|
|
1293
|
-
const h =
|
|
1297
|
+
const h = c();
|
|
1294
1298
|
if (h.length === 0) {
|
|
1295
|
-
|
|
1299
|
+
d.current = !1;
|
|
1296
1300
|
return;
|
|
1297
1301
|
}
|
|
1298
|
-
const
|
|
1299
|
-
(
|
|
1302
|
+
const f = Date.now(), x = h.filter(
|
|
1303
|
+
(b) => f - b.startedAt.getTime() > yt
|
|
1300
1304
|
);
|
|
1301
|
-
if (
|
|
1302
|
-
const { updateExport:
|
|
1303
|
-
for (const S of
|
|
1304
|
-
|
|
1305
|
+
if (x.length > 0) {
|
|
1306
|
+
const { updateExport: b } = ue.getState().actions;
|
|
1307
|
+
for (const S of x)
|
|
1308
|
+
b(S.id, {
|
|
1305
1309
|
status: "failed",
|
|
1306
1310
|
error: "Export timed out. Please try again or contact support.",
|
|
1307
1311
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
1308
1312
|
});
|
|
1309
1313
|
}
|
|
1310
|
-
const
|
|
1311
|
-
(
|
|
1314
|
+
const C = h.filter(
|
|
1315
|
+
(b) => f - b.startedAt.getTime() <= yt
|
|
1312
1316
|
);
|
|
1313
|
-
if (
|
|
1314
|
-
|
|
1317
|
+
if (C.length === 0) {
|
|
1318
|
+
d.current = !1;
|
|
1315
1319
|
return;
|
|
1316
1320
|
}
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1321
|
+
const N = await Promise.allSettled(
|
|
1322
|
+
C.map(async (b) => {
|
|
1319
1323
|
try {
|
|
1320
|
-
const S = await
|
|
1321
|
-
let
|
|
1324
|
+
const S = await At(l, u, b.id);
|
|
1325
|
+
let A;
|
|
1322
1326
|
if (S.status === "completed")
|
|
1323
1327
|
try {
|
|
1324
|
-
|
|
1328
|
+
A = await ht(l, u, b.id);
|
|
1325
1329
|
} catch (U) {
|
|
1326
1330
|
console.error(
|
|
1327
|
-
`[useExportPolling] Failed to get download URL for ${
|
|
1331
|
+
`[useExportPolling] Failed to get download URL for ${b.id}:`,
|
|
1328
1332
|
U
|
|
1329
1333
|
);
|
|
1330
1334
|
}
|
|
1331
1335
|
return {
|
|
1332
|
-
id:
|
|
1336
|
+
id: b.id,
|
|
1333
1337
|
status: S.status,
|
|
1334
1338
|
progress: S.progress,
|
|
1335
1339
|
completedChunks: S.completedChunks,
|
|
@@ -1337,101 +1341,101 @@ function Hn() {
|
|
|
1337
1341
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
1338
1342
|
fileSize: S.fileSize,
|
|
1339
1343
|
error: S.error,
|
|
1340
|
-
downloadUrl:
|
|
1344
|
+
downloadUrl: A
|
|
1341
1345
|
};
|
|
1342
1346
|
} catch (S) {
|
|
1343
1347
|
return console.error(
|
|
1344
|
-
`[useExportPolling] Failed to poll export ${
|
|
1348
|
+
`[useExportPolling] Failed to poll export ${b.id}:`,
|
|
1345
1349
|
S
|
|
1346
1350
|
), null;
|
|
1347
1351
|
}
|
|
1348
1352
|
})
|
|
1349
1353
|
), { updateExport: I } = ue.getState().actions;
|
|
1350
|
-
for (const
|
|
1351
|
-
|
|
1352
|
-
const
|
|
1353
|
-
if (
|
|
1354
|
-
const
|
|
1355
|
-
(
|
|
1356
|
-
|
|
1357
|
-
), S = Ua(
|
|
1358
|
-
|
|
1359
|
-
var
|
|
1360
|
-
(
|
|
1354
|
+
for (const b of N)
|
|
1355
|
+
b.status === "fulfilled" && b.value && I(b.value.id, b.value);
|
|
1356
|
+
const D = c();
|
|
1357
|
+
if (D.length > 0 && !document.hidden) {
|
|
1358
|
+
const b = D.reduce(
|
|
1359
|
+
(A, U) => U.startedAt < A ? U.startedAt : A,
|
|
1360
|
+
D[0].startedAt
|
|
1361
|
+
), S = Ua(b);
|
|
1362
|
+
s.current && clearTimeout(s.current), s.current = setTimeout(() => {
|
|
1363
|
+
var A;
|
|
1364
|
+
(A = p.current) == null || A.call(p);
|
|
1361
1365
|
}, S);
|
|
1362
1366
|
} else
|
|
1363
|
-
|
|
1364
|
-
}, [l,
|
|
1365
|
-
return
|
|
1366
|
-
|
|
1367
|
-
}, [
|
|
1368
|
-
var
|
|
1369
|
-
|
|
1370
|
-
}, [
|
|
1371
|
-
var
|
|
1372
|
-
const h =
|
|
1373
|
-
|
|
1374
|
-
}, [
|
|
1375
|
-
!
|
|
1376
|
-
}, [
|
|
1377
|
-
|
|
1367
|
+
d.current = !1;
|
|
1368
|
+
}, [l, u, c]);
|
|
1369
|
+
return Q(() => {
|
|
1370
|
+
p.current = m;
|
|
1371
|
+
}, [m]), Q(() => {
|
|
1372
|
+
var f;
|
|
1373
|
+
c().length > 0 && n && !d.current && (d.current = !0, (f = p.current) == null || f.call(p));
|
|
1374
|
+
}, [o, n, c]), Q(() => {
|
|
1375
|
+
var f;
|
|
1376
|
+
const h = c();
|
|
1377
|
+
n && h.length > 0 && !d.current && (d.current = !0, (f = p.current) == null || f.call(p));
|
|
1378
|
+
}, [n, c]), Q(() => {
|
|
1379
|
+
!n && s.current && (clearTimeout(s.current), s.current = null, d.current = !1);
|
|
1380
|
+
}, [n]), Q(() => () => {
|
|
1381
|
+
s.current && (clearTimeout(s.current), s.current = null);
|
|
1378
1382
|
}, []), {
|
|
1379
|
-
isPolling:
|
|
1380
|
-
isTabVisible:
|
|
1381
|
-
inProgressCount:
|
|
1383
|
+
isPolling: d.current,
|
|
1384
|
+
isTabVisible: n,
|
|
1385
|
+
inProgressCount: c().length
|
|
1382
1386
|
};
|
|
1383
1387
|
}
|
|
1384
|
-
function
|
|
1385
|
-
const { authToken: t, tokenProps: a } =
|
|
1386
|
-
|
|
1387
|
-
if (
|
|
1388
|
+
function qn() {
|
|
1389
|
+
const { authToken: t, tokenProps: a } = He(), o = ue((p) => p.activeExports), { addExport: n } = Et(), i = he(!1), s = a == null ? void 0 : a.apiServiceUrl, d = t == null ? void 0 : t.accessToken;
|
|
1390
|
+
Q(() => {
|
|
1391
|
+
if (i.current || !s || !d) return;
|
|
1388
1392
|
(async () => {
|
|
1389
1393
|
try {
|
|
1390
|
-
const { exports: l } = await
|
|
1394
|
+
const { exports: l } = await ur(s, d, {
|
|
1391
1395
|
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
1392
1396
|
limit: 20
|
|
1393
1397
|
// Limit to recent exports
|
|
1394
1398
|
});
|
|
1395
|
-
for (const
|
|
1396
|
-
if (
|
|
1397
|
-
const
|
|
1398
|
-
let
|
|
1399
|
-
if (
|
|
1399
|
+
for (const u of l) {
|
|
1400
|
+
if (o.has(u.id)) continue;
|
|
1401
|
+
const c = u.totalChunks ? Math.round(u.completedChunks / u.totalChunks * 100) : 0;
|
|
1402
|
+
let m;
|
|
1403
|
+
if (u.status === "completed")
|
|
1400
1404
|
try {
|
|
1401
|
-
|
|
1402
|
-
} catch (
|
|
1405
|
+
m = await ht(s, d, u.id);
|
|
1406
|
+
} catch (f) {
|
|
1403
1407
|
console.error(
|
|
1404
|
-
`[useExportRecovery] Failed to get download URL for ${
|
|
1405
|
-
|
|
1408
|
+
`[useExportRecovery] Failed to get download URL for ${u.id}:`,
|
|
1409
|
+
f
|
|
1406
1410
|
);
|
|
1407
1411
|
}
|
|
1408
1412
|
const h = {
|
|
1409
|
-
id:
|
|
1410
|
-
status:
|
|
1411
|
-
progress:
|
|
1412
|
-
title: Pa(
|
|
1413
|
-
totalRows:
|
|
1414
|
-
totalChunks:
|
|
1415
|
-
completedChunks:
|
|
1416
|
-
startedAt: new Date(
|
|
1413
|
+
id: u.id,
|
|
1414
|
+
status: u.status,
|
|
1415
|
+
progress: c,
|
|
1416
|
+
title: Pa(u),
|
|
1417
|
+
totalRows: u.totalRows,
|
|
1418
|
+
totalChunks: u.totalChunks,
|
|
1419
|
+
completedChunks: u.completedChunks,
|
|
1420
|
+
startedAt: new Date(u.createdAt),
|
|
1417
1421
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
1418
|
-
completedAt:
|
|
1419
|
-
fileSize:
|
|
1420
|
-
error:
|
|
1421
|
-
expiresAt: new Date(
|
|
1422
|
-
downloadUrl:
|
|
1422
|
+
completedAt: u.completedAt ? new Date(u.completedAt) : void 0,
|
|
1423
|
+
fileSize: u.fileSize,
|
|
1424
|
+
error: u.error,
|
|
1425
|
+
expiresAt: new Date(u.expiresAt),
|
|
1426
|
+
downloadUrl: m
|
|
1423
1427
|
};
|
|
1424
|
-
|
|
1428
|
+
n(h);
|
|
1425
1429
|
}
|
|
1426
|
-
|
|
1430
|
+
i.current = !0;
|
|
1427
1431
|
} catch (l) {
|
|
1428
|
-
console.error("[useExportRecovery] Failed to recover exports:", l),
|
|
1432
|
+
console.error("[useExportRecovery] Failed to recover exports:", l), i.current = !0;
|
|
1429
1433
|
}
|
|
1430
1434
|
})();
|
|
1431
|
-
}, [
|
|
1435
|
+
}, [s, d, n, o]);
|
|
1432
1436
|
}
|
|
1433
1437
|
function Pa(t) {
|
|
1434
|
-
return t.title ? t.title :
|
|
1438
|
+
return t.title ? t.title : ut(
|
|
1435
1439
|
t.status
|
|
1436
1440
|
) ? "Export in progress..." : t.status === "completed" ? "Export completed" : t.status === "failed" ? "Export failed" : "Export";
|
|
1437
1441
|
}
|
|
@@ -1439,20 +1443,20 @@ function Ma({
|
|
|
1439
1443
|
export: t,
|
|
1440
1444
|
onRemove: a
|
|
1441
1445
|
}) {
|
|
1442
|
-
const
|
|
1446
|
+
const o = () => {
|
|
1443
1447
|
t.downloadUrl && window.open(t.downloadUrl, "_blank");
|
|
1444
|
-
},
|
|
1445
|
-
|
|
1446
|
-
},
|
|
1448
|
+
}, n = (p) => {
|
|
1449
|
+
p.stopPropagation(), a == null || a(t.id);
|
|
1450
|
+
}, i = () => {
|
|
1447
1451
|
switch (t.status) {
|
|
1448
1452
|
case "completed":
|
|
1449
|
-
return /* @__PURE__ */ e(
|
|
1453
|
+
return /* @__PURE__ */ e(fr, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
1450
1454
|
case "failed":
|
|
1451
1455
|
return /* @__PURE__ */ e(va, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
1452
1456
|
default:
|
|
1453
1457
|
return /* @__PURE__ */ e(te, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
1454
1458
|
}
|
|
1455
|
-
},
|
|
1459
|
+
}, s = ut(t.status), d = (() => {
|
|
1456
1460
|
switch (t.status) {
|
|
1457
1461
|
case "pending":
|
|
1458
1462
|
return "Queued...";
|
|
@@ -1469,7 +1473,7 @@ function Ma({
|
|
|
1469
1473
|
return /* @__PURE__ */ r("div", { className: "group p-4 transition-colors hover:bg-muted/50", children: [
|
|
1470
1474
|
/* @__PURE__ */ r("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
1471
1475
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
1472
|
-
|
|
1476
|
+
i(),
|
|
1473
1477
|
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
1474
1478
|
/* @__PURE__ */ e("h4", { className: "mb-1 truncate text-sm font-medium", children: t.title }),
|
|
1475
1479
|
t.status === "completed" && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
@@ -1479,10 +1483,10 @@ function Ma({
|
|
|
1479
1483
|
] }),
|
|
1480
1484
|
t.fileSize && /* @__PURE__ */ r(W, { children: [
|
|
1481
1485
|
/* @__PURE__ */ e("span", { children: "•" }),
|
|
1482
|
-
/* @__PURE__ */ e("span", { children:
|
|
1486
|
+
/* @__PURE__ */ e("span", { children: hr(t.fileSize) })
|
|
1483
1487
|
] })
|
|
1484
1488
|
] }),
|
|
1485
|
-
|
|
1489
|
+
s && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: d }),
|
|
1486
1490
|
t.status === "failed" && /* @__PURE__ */ e("div", { className: "line-clamp-2 text-xs text-destructive", children: t.error || "Export failed" })
|
|
1487
1491
|
] })
|
|
1488
1492
|
] }),
|
|
@@ -1492,136 +1496,136 @@ function Ma({
|
|
|
1492
1496
|
variant: "ghost",
|
|
1493
1497
|
size: "icon",
|
|
1494
1498
|
className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
|
|
1495
|
-
onClick:
|
|
1499
|
+
onClick: n,
|
|
1496
1500
|
"aria-label": "Remove notification",
|
|
1497
|
-
children: /* @__PURE__ */ e(
|
|
1501
|
+
children: /* @__PURE__ */ e(Ge, { className: "h-4 w-4" })
|
|
1498
1502
|
}
|
|
1499
1503
|
)
|
|
1500
1504
|
] }),
|
|
1501
1505
|
/* @__PURE__ */ r("div", { className: "ml-8", children: [
|
|
1502
1506
|
t.status === "completed" && /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
1503
|
-
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children:
|
|
1507
|
+
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: xt(t.startedAt, { addSuffix: !0 }) }),
|
|
1504
1508
|
t.downloadUrl && /* @__PURE__ */ r(
|
|
1505
1509
|
B,
|
|
1506
1510
|
{
|
|
1507
1511
|
size: "sm",
|
|
1508
1512
|
variant: "outline",
|
|
1509
1513
|
className: "h-8 bg-transparent",
|
|
1510
|
-
onClick:
|
|
1514
|
+
onClick: o,
|
|
1511
1515
|
children: [
|
|
1512
|
-
/* @__PURE__ */ e(
|
|
1516
|
+
/* @__PURE__ */ e(mr, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
1513
1517
|
"Download"
|
|
1514
1518
|
]
|
|
1515
1519
|
}
|
|
1516
1520
|
)
|
|
1517
1521
|
] }),
|
|
1518
|
-
|
|
1519
|
-
/* @__PURE__ */ e(
|
|
1522
|
+
s && /* @__PURE__ */ r("div", { children: [
|
|
1523
|
+
/* @__PURE__ */ e(pr, { value: t.progress, className: "h-1.5" }),
|
|
1520
1524
|
/* @__PURE__ */ r("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
|
|
1521
1525
|
t.progress,
|
|
1522
1526
|
"% complete"
|
|
1523
1527
|
] })
|
|
1524
1528
|
] }),
|
|
1525
|
-
t.status === "failed" && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children:
|
|
1529
|
+
t.status === "failed" && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: xt(t.startedAt, { addSuffix: !0 }) })
|
|
1526
1530
|
] })
|
|
1527
1531
|
] });
|
|
1528
1532
|
}
|
|
1529
1533
|
function Oa() {
|
|
1530
|
-
const { authToken: t, tokenProps: a } =
|
|
1531
|
-
(
|
|
1532
|
-
),
|
|
1533
|
-
(
|
|
1534
|
-
), h =
|
|
1535
|
-
const
|
|
1536
|
-
if (!(!
|
|
1537
|
-
|
|
1534
|
+
const { authToken: t, tokenProps: a } = He(), o = ue((C) => C.activeExports), { clearCompleted: n, removeExport: i, updateExport: s } = Et(), [d, p] = E(!1), [l, u] = E(!1), c = Array.from(o.values()).sort(
|
|
1535
|
+
(C, N) => N.startedAt.getTime() - C.startedAt.getTime()
|
|
1536
|
+
), m = c.some(
|
|
1537
|
+
(C) => C.status === "completed" || C.status === "failed"
|
|
1538
|
+
), h = K(async () => {
|
|
1539
|
+
const C = a == null ? void 0 : a.apiServiceUrl, N = t == null ? void 0 : t.accessToken;
|
|
1540
|
+
if (!(!C || !N)) {
|
|
1541
|
+
p(!0);
|
|
1538
1542
|
try {
|
|
1539
|
-
const I = Array.from(
|
|
1543
|
+
const I = Array.from(o.values());
|
|
1540
1544
|
await Promise.all(
|
|
1541
|
-
I.map(async (
|
|
1545
|
+
I.map(async (D) => {
|
|
1542
1546
|
try {
|
|
1543
|
-
const
|
|
1547
|
+
const b = await At(C, N, D.id);
|
|
1544
1548
|
let S;
|
|
1545
|
-
if (
|
|
1549
|
+
if (b.status === "completed")
|
|
1546
1550
|
try {
|
|
1547
|
-
S = await
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
+
S = await ht(
|
|
1552
|
+
C,
|
|
1553
|
+
N,
|
|
1554
|
+
D.id
|
|
1551
1555
|
);
|
|
1552
|
-
} catch (
|
|
1553
|
-
console.error(`Failed to get download URL for ${
|
|
1556
|
+
} catch (A) {
|
|
1557
|
+
console.error(`Failed to get download URL for ${D.id}:`, A);
|
|
1554
1558
|
}
|
|
1555
|
-
|
|
1556
|
-
status:
|
|
1557
|
-
progress:
|
|
1558
|
-
completedChunks:
|
|
1559
|
-
completedAt:
|
|
1559
|
+
s(D.id, {
|
|
1560
|
+
status: b.status,
|
|
1561
|
+
progress: b.progress,
|
|
1562
|
+
completedChunks: b.completedChunks,
|
|
1563
|
+
completedAt: b.completedAt ? new Date(b.completedAt) : void 0,
|
|
1560
1564
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
1561
|
-
fileSize:
|
|
1562
|
-
error:
|
|
1565
|
+
fileSize: b.fileSize,
|
|
1566
|
+
error: b.error,
|
|
1563
1567
|
downloadUrl: S
|
|
1564
1568
|
});
|
|
1565
|
-
} catch (
|
|
1566
|
-
console.error(`Failed to refresh export ${
|
|
1569
|
+
} catch (b) {
|
|
1570
|
+
console.error(`Failed to refresh export ${D.id}:`, b);
|
|
1567
1571
|
}
|
|
1568
1572
|
})
|
|
1569
1573
|
);
|
|
1570
1574
|
} finally {
|
|
1571
|
-
|
|
1575
|
+
p(!1);
|
|
1572
1576
|
}
|
|
1573
1577
|
}
|
|
1574
1578
|
}, [
|
|
1575
|
-
|
|
1579
|
+
o,
|
|
1576
1580
|
t == null ? void 0 : t.accessToken,
|
|
1577
1581
|
a == null ? void 0 : a.apiServiceUrl,
|
|
1578
|
-
|
|
1579
|
-
]),
|
|
1580
|
-
const
|
|
1581
|
-
if (!
|
|
1582
|
-
|
|
1582
|
+
s
|
|
1583
|
+
]), f = K(async () => {
|
|
1584
|
+
const C = a == null ? void 0 : a.apiServiceUrl, N = t == null ? void 0 : t.accessToken;
|
|
1585
|
+
if (!C || !N) {
|
|
1586
|
+
n();
|
|
1583
1587
|
return;
|
|
1584
1588
|
}
|
|
1585
|
-
|
|
1589
|
+
u(!0);
|
|
1586
1590
|
try {
|
|
1587
|
-
const I =
|
|
1588
|
-
(
|
|
1589
|
-
),
|
|
1590
|
-
I.map(async (
|
|
1591
|
+
const I = c.filter(
|
|
1592
|
+
(b) => b.status === "completed" || b.status === "failed"
|
|
1593
|
+
), D = await Promise.allSettled(
|
|
1594
|
+
I.map(async (b) => (await gt(C, N, b.id), b.id))
|
|
1591
1595
|
);
|
|
1592
|
-
for (const
|
|
1593
|
-
|
|
1596
|
+
for (const b of D)
|
|
1597
|
+
b.status === "fulfilled" ? i(b.value) : console.error("Failed to delete export:", b.reason);
|
|
1594
1598
|
} finally {
|
|
1595
|
-
|
|
1599
|
+
u(!1);
|
|
1596
1600
|
}
|
|
1597
1601
|
}, [
|
|
1598
|
-
|
|
1602
|
+
c,
|
|
1599
1603
|
a == null ? void 0 : a.apiServiceUrl,
|
|
1600
1604
|
t == null ? void 0 : t.accessToken,
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
]),
|
|
1604
|
-
async (
|
|
1605
|
-
const
|
|
1606
|
-
if (
|
|
1605
|
+
n,
|
|
1606
|
+
i
|
|
1607
|
+
]), x = K(
|
|
1608
|
+
async (C) => {
|
|
1609
|
+
const N = a == null ? void 0 : a.apiServiceUrl, I = t == null ? void 0 : t.accessToken;
|
|
1610
|
+
if (N && I)
|
|
1607
1611
|
try {
|
|
1608
|
-
await
|
|
1612
|
+
await gt(N, I, C), i(C);
|
|
1609
1613
|
return;
|
|
1610
|
-
} catch (
|
|
1611
|
-
console.error(`Failed to cancel export ${
|
|
1614
|
+
} catch (D) {
|
|
1615
|
+
console.error(`Failed to cancel export ${C}:`, D);
|
|
1612
1616
|
}
|
|
1613
|
-
|
|
1617
|
+
i(C);
|
|
1614
1618
|
},
|
|
1615
|
-
[a == null ? void 0 : a.apiServiceUrl, t == null ? void 0 : t.accessToken,
|
|
1619
|
+
[a == null ? void 0 : a.apiServiceUrl, t == null ? void 0 : t.accessToken, i]
|
|
1616
1620
|
);
|
|
1617
|
-
return
|
|
1618
|
-
/* @__PURE__ */ e(
|
|
1621
|
+
return c.length === 0 ? /* @__PURE__ */ r("div", { className: "p-6 text-center", children: [
|
|
1622
|
+
/* @__PURE__ */ e(vt, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
|
|
1619
1623
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No active exports" }),
|
|
1620
1624
|
/* @__PURE__ */ e("p", { className: "mt-1 text-xs text-muted-foreground", children: "Large exports will appear here" })
|
|
1621
1625
|
] }) : /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
1622
1626
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b px-4 py-3", children: [
|
|
1623
1627
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
1624
|
-
/* @__PURE__ */ e(
|
|
1628
|
+
/* @__PURE__ */ e(vt, { className: "h-5 w-5 text-muted-foreground" }),
|
|
1625
1629
|
/* @__PURE__ */ e("h4", { className: "font-semibold", children: "Exports" })
|
|
1626
1630
|
] }),
|
|
1627
1631
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
|
|
@@ -1632,47 +1636,47 @@ function Oa() {
|
|
|
1632
1636
|
size: "sm",
|
|
1633
1637
|
className: "h-7 w-7 p-0",
|
|
1634
1638
|
onClick: h,
|
|
1635
|
-
disabled:
|
|
1639
|
+
disabled: d,
|
|
1636
1640
|
title: "Refresh status",
|
|
1637
1641
|
children: /* @__PURE__ */ e(
|
|
1638
|
-
|
|
1642
|
+
gr,
|
|
1639
1643
|
{
|
|
1640
|
-
className: `h-4 w-4 ${
|
|
1644
|
+
className: `h-4 w-4 ${d ? "animate-spin" : ""}`
|
|
1641
1645
|
}
|
|
1642
1646
|
)
|
|
1643
1647
|
}
|
|
1644
1648
|
),
|
|
1645
|
-
|
|
1649
|
+
m && /* @__PURE__ */ e(
|
|
1646
1650
|
B,
|
|
1647
1651
|
{
|
|
1648
1652
|
variant: "ghost",
|
|
1649
1653
|
size: "sm",
|
|
1650
1654
|
className: "h-7 px-2 text-sm",
|
|
1651
|
-
onClick:
|
|
1655
|
+
onClick: f,
|
|
1652
1656
|
disabled: l,
|
|
1653
1657
|
children: l ? "Clearing..." : "Clear all"
|
|
1654
1658
|
}
|
|
1655
1659
|
)
|
|
1656
1660
|
] })
|
|
1657
1661
|
] }),
|
|
1658
|
-
/* @__PURE__ */ e("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y", children:
|
|
1662
|
+
/* @__PURE__ */ e("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "divide-y", children: c.map((C) => /* @__PURE__ */ e(
|
|
1659
1663
|
Ma,
|
|
1660
1664
|
{
|
|
1661
|
-
export:
|
|
1662
|
-
onRemove:
|
|
1665
|
+
export: C,
|
|
1666
|
+
onRemove: x
|
|
1663
1667
|
},
|
|
1664
|
-
|
|
1668
|
+
C.id
|
|
1665
1669
|
)) }) })
|
|
1666
1670
|
] });
|
|
1667
1671
|
}
|
|
1668
|
-
function
|
|
1672
|
+
function Xn({
|
|
1669
1673
|
variant: t
|
|
1670
1674
|
}) {
|
|
1671
|
-
const a = ue((l) => l.activeExports),
|
|
1675
|
+
const a = ue((l) => l.activeExports), o = br(), n = a.size > 0, i = Array.from(a.values()).some(
|
|
1672
1676
|
(l) => l.status === "completed" || l.status === "failed"
|
|
1673
|
-
),
|
|
1674
|
-
return /* @__PURE__ */ r(
|
|
1675
|
-
/* @__PURE__ */ e(
|
|
1677
|
+
), d = o > 0 ? o > 9 ? "9+" : String(o) : null;
|
|
1678
|
+
return /* @__PURE__ */ r(Oe, { children: [
|
|
1679
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ r(
|
|
1676
1680
|
B,
|
|
1677
1681
|
{
|
|
1678
1682
|
variant: t ?? "ghost",
|
|
@@ -1680,21 +1684,21 @@ function Kn({
|
|
|
1680
1684
|
className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
1681
1685
|
"aria-label": "Export notifications",
|
|
1682
1686
|
children: [
|
|
1683
|
-
/* @__PURE__ */ e(
|
|
1684
|
-
|
|
1687
|
+
/* @__PURE__ */ e(xr, { className: "h-3.5 w-3.5" }),
|
|
1688
|
+
n && /* @__PURE__ */ e(
|
|
1685
1689
|
"span",
|
|
1686
1690
|
{
|
|
1687
|
-
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${
|
|
1688
|
-
children:
|
|
1691
|
+
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${d ? "-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"}`,
|
|
1692
|
+
children: d
|
|
1689
1693
|
}
|
|
1690
1694
|
)
|
|
1691
1695
|
]
|
|
1692
1696
|
}
|
|
1693
1697
|
) }),
|
|
1694
|
-
/* @__PURE__ */ e(
|
|
1698
|
+
/* @__PURE__ */ e(ze, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ e(Oa, {}) })
|
|
1695
1699
|
] });
|
|
1696
1700
|
}
|
|
1697
|
-
function
|
|
1701
|
+
function _a(t) {
|
|
1698
1702
|
if (t)
|
|
1699
1703
|
return {
|
|
1700
1704
|
renamed: t.type === "rename" ? { oldId: t.oldId, newId: t.newId } : void 0,
|
|
@@ -1703,56 +1707,56 @@ function za(t) {
|
|
|
1703
1707
|
affectedBindingControlIds: t.type === "add" || t.type === "update" ? t.affectedBindingControlIds : void 0
|
|
1704
1708
|
};
|
|
1705
1709
|
}
|
|
1706
|
-
function
|
|
1710
|
+
function za({
|
|
1707
1711
|
open: t,
|
|
1708
1712
|
onOpenChange: a,
|
|
1709
|
-
trigger:
|
|
1710
|
-
showTrigger:
|
|
1711
|
-
initialMode:
|
|
1713
|
+
trigger: o,
|
|
1714
|
+
showTrigger: n = !0,
|
|
1715
|
+
initialMode: i = "manage"
|
|
1712
1716
|
}) {
|
|
1713
|
-
const
|
|
1714
|
-
forceClose:
|
|
1715
|
-
handleOpenChange:
|
|
1717
|
+
const s = i === "create", {
|
|
1718
|
+
forceClose: d,
|
|
1719
|
+
handleOpenChange: p,
|
|
1716
1720
|
isCreateFlowActive: l,
|
|
1717
|
-
preventPassiveDismissDuringCreate:
|
|
1718
|
-
resolvedOpen:
|
|
1719
|
-
setIsCreateFlowActive:
|
|
1720
|
-
} =
|
|
1721
|
+
preventPassiveDismissDuringCreate: u,
|
|
1722
|
+
resolvedOpen: c,
|
|
1723
|
+
setIsCreateFlowActive: m
|
|
1724
|
+
} = Pt({
|
|
1721
1725
|
open: t,
|
|
1722
1726
|
onOpenChange: a,
|
|
1723
|
-
initialCreateFlowActive:
|
|
1727
|
+
initialCreateFlowActive: i === "create",
|
|
1724
1728
|
// Dialog mode renders a built-in X close button — allow explicit
|
|
1725
1729
|
// closes through `handleOpenChange`. Popover mode has no X; its
|
|
1726
1730
|
// only close-via-trigger path is a re-click that would silently
|
|
1727
1731
|
// wipe the in-progress create flow, so block everything during
|
|
1728
1732
|
// create and make consumers use `forceClose()` from a dedicated
|
|
1729
1733
|
// button.
|
|
1730
|
-
dismissMode:
|
|
1731
|
-
}), h = P((
|
|
1734
|
+
dismissMode: n ? "passive" : "explicit-only"
|
|
1735
|
+
}), h = P((v) => v.dashboard), { setDashboardControlsModel: f } = be(), { participants: x } = vr(Jr(h)), C = Array.from(
|
|
1732
1736
|
new Map(
|
|
1733
|
-
|
|
1734
|
-
(
|
|
1737
|
+
x.flatMap(
|
|
1738
|
+
(v) => v.fieldChoices.map((T) => {
|
|
1735
1739
|
var F;
|
|
1736
1740
|
return [
|
|
1737
1741
|
T.value,
|
|
1738
1742
|
{
|
|
1739
1743
|
option: T,
|
|
1740
|
-
target: (F =
|
|
1744
|
+
target: (F = v.fieldTargetMap) == null ? void 0 : F[T.value]
|
|
1741
1745
|
}
|
|
1742
1746
|
];
|
|
1743
1747
|
})
|
|
1744
1748
|
)
|
|
1745
1749
|
).values()
|
|
1746
|
-
),
|
|
1750
|
+
), N = Array.from(
|
|
1747
1751
|
new Map(
|
|
1748
|
-
|
|
1749
|
-
(
|
|
1752
|
+
x.flatMap(
|
|
1753
|
+
(v) => v.metricChoices.map((T) => {
|
|
1750
1754
|
var F;
|
|
1751
1755
|
return [
|
|
1752
1756
|
T.value,
|
|
1753
1757
|
{
|
|
1754
1758
|
option: T,
|
|
1755
|
-
target: (F =
|
|
1759
|
+
target: (F = v.metricTargetMap) == null ? void 0 : F[T.value]
|
|
1756
1760
|
}
|
|
1757
1761
|
];
|
|
1758
1762
|
})
|
|
@@ -1761,73 +1765,73 @@ function _a({
|
|
|
1761
1765
|
), I = ea({
|
|
1762
1766
|
...h || {},
|
|
1763
1767
|
controls: []
|
|
1764
|
-
}),
|
|
1765
|
-
|
|
1766
|
-
|
|
1768
|
+
}), D = yr(h), b = (v, T, F) => {
|
|
1769
|
+
f(
|
|
1770
|
+
v,
|
|
1767
1771
|
T,
|
|
1768
|
-
|
|
1772
|
+
_a(F)
|
|
1769
1773
|
);
|
|
1770
|
-
}, S =
|
|
1771
|
-
if (
|
|
1772
|
-
|
|
1774
|
+
}, S = K(() => {
|
|
1775
|
+
if (s) {
|
|
1776
|
+
d();
|
|
1773
1777
|
return;
|
|
1774
1778
|
}
|
|
1775
|
-
|
|
1776
|
-
}, [
|
|
1777
|
-
|
|
1779
|
+
m(!1);
|
|
1780
|
+
}, [s, d, m]), A = /* @__PURE__ */ e(
|
|
1781
|
+
Mt,
|
|
1778
1782
|
{
|
|
1779
1783
|
scope: "dashboard",
|
|
1780
1784
|
controls: h.controls || [],
|
|
1781
1785
|
reservedControlIds: I,
|
|
1782
1786
|
defaultValues: h.defaultControlValues || {},
|
|
1783
|
-
usageByControlId:
|
|
1784
|
-
availableFieldChoices:
|
|
1785
|
-
availableMetricChoices:
|
|
1786
|
-
structuralParticipants:
|
|
1787
|
-
structuralParticipantIdsByControlId:
|
|
1788
|
-
initialCreateFlow:
|
|
1789
|
-
onCreateFlowActiveChange:
|
|
1787
|
+
usageByControlId: Cr(h),
|
|
1788
|
+
availableFieldChoices: C,
|
|
1789
|
+
availableMetricChoices: N,
|
|
1790
|
+
structuralParticipants: x,
|
|
1791
|
+
structuralParticipantIdsByControlId: D,
|
|
1792
|
+
initialCreateFlow: i === "create",
|
|
1793
|
+
onCreateFlowActiveChange: m,
|
|
1790
1794
|
onCreateFlowComplete: S,
|
|
1791
|
-
onChange:
|
|
1795
|
+
onChange: b,
|
|
1792
1796
|
emptyMessage: "No dashboard controls yet."
|
|
1793
1797
|
}
|
|
1794
|
-
), U = l ? "Add dashboard control" : "Dashboard Controls",
|
|
1798
|
+
), U = l ? "Add dashboard control" : "Dashboard Controls", g = /* @__PURE__ */ r(W, { children: [
|
|
1795
1799
|
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
1796
1800
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
1797
1801
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
|
|
1798
1802
|
] }),
|
|
1799
|
-
|
|
1803
|
+
A
|
|
1800
1804
|
] });
|
|
1801
|
-
return
|
|
1802
|
-
/* @__PURE__ */ e(
|
|
1803
|
-
/* @__PURE__ */ e(
|
|
1805
|
+
return n ? /* @__PURE__ */ r(Oe, { open: c, onOpenChange: p, children: [
|
|
1806
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: o || /* @__PURE__ */ r(B, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
1807
|
+
/* @__PURE__ */ e(Rt, { className: "mr-2 h-4 w-4" }),
|
|
1804
1808
|
"Controls"
|
|
1805
1809
|
] }) }),
|
|
1806
1810
|
/* @__PURE__ */ e(
|
|
1807
|
-
|
|
1811
|
+
ze,
|
|
1808
1812
|
{
|
|
1809
1813
|
className: "w-[620px] max-w-[95vw] space-y-4",
|
|
1810
1814
|
align: "end",
|
|
1811
|
-
onEscapeKeyDown:
|
|
1812
|
-
onPointerDownOutside:
|
|
1813
|
-
children:
|
|
1815
|
+
onEscapeKeyDown: u,
|
|
1816
|
+
onPointerDownOutside: u,
|
|
1817
|
+
children: g
|
|
1814
1818
|
}
|
|
1815
1819
|
)
|
|
1816
|
-
] }) : /* @__PURE__ */ e(
|
|
1817
|
-
|
|
1820
|
+
] }) : /* @__PURE__ */ e(De, { open: c, onOpenChange: p, children: /* @__PURE__ */ r(
|
|
1821
|
+
ke,
|
|
1818
1822
|
{
|
|
1819
1823
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
1820
|
-
onEscapeKeyDown:
|
|
1821
|
-
onPointerDownOutside:
|
|
1824
|
+
onEscapeKeyDown: u,
|
|
1825
|
+
onPointerDownOutside: u,
|
|
1822
1826
|
children: [
|
|
1823
1827
|
/* @__PURE__ */ r(
|
|
1824
|
-
|
|
1828
|
+
ct,
|
|
1825
1829
|
{
|
|
1826
1830
|
className: l ? "space-y-0" : void 0,
|
|
1827
1831
|
children: [
|
|
1828
|
-
/* @__PURE__ */ e(
|
|
1832
|
+
/* @__PURE__ */ e(Ae, { className: "text-[15px]", children: U }),
|
|
1829
1833
|
/* @__PURE__ */ e(
|
|
1830
|
-
|
|
1834
|
+
dt,
|
|
1831
1835
|
{
|
|
1832
1836
|
className: l ? "sr-only" : "text-[13px]",
|
|
1833
1837
|
children: l ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
|
|
@@ -1836,7 +1840,7 @@ function _a({
|
|
|
1836
1840
|
]
|
|
1837
1841
|
}
|
|
1838
1842
|
),
|
|
1839
|
-
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children:
|
|
1843
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: A })
|
|
1840
1844
|
]
|
|
1841
1845
|
}
|
|
1842
1846
|
) });
|
|
@@ -1852,101 +1856,101 @@ const $a = [
|
|
|
1852
1856
|
function ja({
|
|
1853
1857
|
open: t,
|
|
1854
1858
|
onOpenChange: a,
|
|
1855
|
-
initialMode:
|
|
1859
|
+
initialMode: o = "manage"
|
|
1856
1860
|
}) {
|
|
1857
|
-
var
|
|
1858
|
-
const
|
|
1859
|
-
forceClose:
|
|
1860
|
-
handleOpenChange:
|
|
1861
|
-
isCreateFlowActive:
|
|
1862
|
-
preventPassiveDismissDuringCreate:
|
|
1861
|
+
var g;
|
|
1862
|
+
const n = o === "create", {
|
|
1863
|
+
forceClose: i,
|
|
1864
|
+
handleOpenChange: s,
|
|
1865
|
+
isCreateFlowActive: d,
|
|
1866
|
+
preventPassiveDismissDuringCreate: p,
|
|
1863
1867
|
resolvedOpen: l,
|
|
1864
|
-
setIsCreateFlowActive:
|
|
1865
|
-
} =
|
|
1868
|
+
setIsCreateFlowActive: u
|
|
1869
|
+
} = Pt({
|
|
1866
1870
|
open: t,
|
|
1867
1871
|
onOpenChange: a,
|
|
1868
|
-
initialCreateFlowActive:
|
|
1872
|
+
initialCreateFlowActive: o === "create",
|
|
1869
1873
|
dismissMode: "explicit-only"
|
|
1870
|
-
}),
|
|
1871
|
-
(
|
|
1872
|
-
),
|
|
1873
|
-
() =>
|
|
1874
|
-
[
|
|
1875
|
-
),
|
|
1876
|
-
() =>
|
|
1877
|
-
(
|
|
1874
|
+
}), c = P((v) => v.dashboard), m = P((v) => v.selectedSheetId), { setDashboardInputs: h } = be(), f = (g = c.sheets) == null ? void 0 : g.find(
|
|
1875
|
+
(v) => v.id === m
|
|
1876
|
+
), x = (f == null ? void 0 : f.kind) === "document" && !!f.document, C = ee(
|
|
1877
|
+
() => x && (f != null && f.document) ? wr(c, f.id) : [],
|
|
1878
|
+
[c, x, f == null ? void 0 : f.document, f == null ? void 0 : f.id]
|
|
1879
|
+
), N = ee(
|
|
1880
|
+
() => C.filter(
|
|
1881
|
+
(v) => v.kind === "control"
|
|
1878
1882
|
),
|
|
1879
|
-
[
|
|
1883
|
+
[C]
|
|
1880
1884
|
), I = ee(
|
|
1881
|
-
() =>
|
|
1882
|
-
[
|
|
1883
|
-
),
|
|
1885
|
+
() => N.map((v) => v.control),
|
|
1886
|
+
[N]
|
|
1887
|
+
), D = ee(
|
|
1884
1888
|
() => Ha(I),
|
|
1885
1889
|
[I]
|
|
1886
|
-
),
|
|
1887
|
-
() => Wa(
|
|
1888
|
-
[
|
|
1889
|
-
), S =
|
|
1890
|
-
if (
|
|
1891
|
-
|
|
1890
|
+
), b = ee(
|
|
1891
|
+
() => Wa(c),
|
|
1892
|
+
[c]
|
|
1893
|
+
), S = K(() => {
|
|
1894
|
+
if (n) {
|
|
1895
|
+
i();
|
|
1892
1896
|
return;
|
|
1893
1897
|
}
|
|
1894
|
-
|
|
1895
|
-
}, [
|
|
1896
|
-
(
|
|
1897
|
-
!
|
|
1898
|
+
u(!1);
|
|
1899
|
+
}, [n, i, u]), A = K(
|
|
1900
|
+
(v, T, F) => {
|
|
1901
|
+
!x || !(f != null && f.document) || h(
|
|
1898
1902
|
Ka({
|
|
1899
|
-
allInputs:
|
|
1900
|
-
documentSheetId:
|
|
1901
|
-
currentDocumentInputs:
|
|
1902
|
-
nextControls:
|
|
1903
|
+
allInputs: c.inputs || [],
|
|
1904
|
+
documentSheetId: f.id,
|
|
1905
|
+
currentDocumentInputs: C,
|
|
1906
|
+
nextControls: v,
|
|
1903
1907
|
nextDefaultValues: T,
|
|
1904
1908
|
change: F
|
|
1905
1909
|
})
|
|
1906
1910
|
);
|
|
1907
1911
|
},
|
|
1908
1912
|
[
|
|
1909
|
-
|
|
1910
|
-
y,
|
|
1913
|
+
c.inputs,
|
|
1911
1914
|
C,
|
|
1912
|
-
|
|
1915
|
+
x,
|
|
1916
|
+
f,
|
|
1913
1917
|
h
|
|
1914
1918
|
]
|
|
1915
1919
|
);
|
|
1916
|
-
return !
|
|
1917
|
-
|
|
1920
|
+
return !x || !(f != null && f.document) ? null : /* @__PURE__ */ e(De, { open: l, onOpenChange: s, children: /* @__PURE__ */ r(
|
|
1921
|
+
ke,
|
|
1918
1922
|
{
|
|
1919
1923
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
1920
|
-
onEscapeKeyDown:
|
|
1921
|
-
onPointerDownOutside:
|
|
1924
|
+
onEscapeKeyDown: p,
|
|
1925
|
+
onPointerDownOutside: p,
|
|
1922
1926
|
children: [
|
|
1923
|
-
/* @__PURE__ */ r(
|
|
1924
|
-
/* @__PURE__ */ e(
|
|
1927
|
+
/* @__PURE__ */ r(ct, { className: d ? "space-y-0" : void 0, children: [
|
|
1928
|
+
/* @__PURE__ */ e(Ae, { className: "text-[15px]", children: d ? "Add document control" : "Document Controls" }),
|
|
1925
1929
|
/* @__PURE__ */ e(
|
|
1926
|
-
|
|
1930
|
+
dt,
|
|
1927
1931
|
{
|
|
1928
|
-
className:
|
|
1929
|
-
children:
|
|
1932
|
+
className: d ? "sr-only" : "text-[13px]",
|
|
1933
|
+
children: d ? "Configure and add a document-local control input." : "Add document-local control inputs. They are stored on this document sheet and are not dashboard controls."
|
|
1930
1934
|
}
|
|
1931
1935
|
)
|
|
1932
1936
|
] }),
|
|
1933
1937
|
/* @__PURE__ */ e("div", { className: "min-h-0 overflow-y-auto pr-1", children: /* @__PURE__ */ e(
|
|
1934
|
-
|
|
1938
|
+
Mt,
|
|
1935
1939
|
{
|
|
1936
1940
|
scope: "dashboard",
|
|
1937
1941
|
controls: I,
|
|
1938
|
-
reservedControlIds:
|
|
1939
|
-
defaultValues:
|
|
1942
|
+
reservedControlIds: b,
|
|
1943
|
+
defaultValues: D,
|
|
1940
1944
|
usageByControlId: {},
|
|
1941
1945
|
availableFieldChoices: [],
|
|
1942
1946
|
availableMetricChoices: [],
|
|
1943
1947
|
structuralParticipants: [],
|
|
1944
1948
|
structuralParticipantIdsByControlId: {},
|
|
1945
1949
|
allowedControlTypes: $a,
|
|
1946
|
-
initialCreateFlow:
|
|
1947
|
-
onCreateFlowActiveChange:
|
|
1950
|
+
initialCreateFlow: o === "create",
|
|
1951
|
+
onCreateFlowActiveChange: u,
|
|
1948
1952
|
onCreateFlowComplete: S,
|
|
1949
|
-
onChange:
|
|
1953
|
+
onChange: A,
|
|
1950
1954
|
emptyMessage: "No document controls yet."
|
|
1951
1955
|
}
|
|
1952
1956
|
) })
|
|
@@ -1959,8 +1963,8 @@ function Wa(t) {
|
|
|
1959
1963
|
}
|
|
1960
1964
|
function Ha(t) {
|
|
1961
1965
|
const a = {};
|
|
1962
|
-
for (const
|
|
1963
|
-
|
|
1966
|
+
for (const o of t)
|
|
1967
|
+
o.defaultValue !== void 0 && (a[o.id] = o.defaultValue);
|
|
1964
1968
|
return a;
|
|
1965
1969
|
}
|
|
1966
1970
|
function Ga(t, a) {
|
|
@@ -1972,135 +1976,135 @@ function Ga(t, a) {
|
|
|
1972
1976
|
function Ka({
|
|
1973
1977
|
allInputs: t,
|
|
1974
1978
|
documentSheetId: a,
|
|
1975
|
-
currentDocumentInputs:
|
|
1976
|
-
nextControls:
|
|
1977
|
-
nextDefaultValues:
|
|
1978
|
-
change:
|
|
1979
|
+
currentDocumentInputs: o,
|
|
1980
|
+
nextControls: n,
|
|
1981
|
+
nextDefaultValues: i,
|
|
1982
|
+
change: s
|
|
1979
1983
|
}) {
|
|
1980
|
-
const
|
|
1981
|
-
|
|
1984
|
+
const d = new Map(
|
|
1985
|
+
n.map((h) => [
|
|
1982
1986
|
h.id,
|
|
1983
|
-
Ga(h,
|
|
1987
|
+
Ga(h, i)
|
|
1984
1988
|
])
|
|
1985
|
-
),
|
|
1986
|
-
for (const h of
|
|
1989
|
+
), p = (s == null ? void 0 : s.type) === "rename" ? { oldId: s.oldId, newId: s.newId } : null, l = /* @__PURE__ */ new Set(), u = [];
|
|
1990
|
+
for (const h of o) {
|
|
1987
1991
|
if (h.kind !== "control") {
|
|
1988
|
-
|
|
1992
|
+
u.push(h);
|
|
1989
1993
|
continue;
|
|
1990
1994
|
}
|
|
1991
|
-
const
|
|
1992
|
-
if (!
|
|
1995
|
+
const f = d.get(h.control.id) || ((p == null ? void 0 : p.oldId) === h.control.id ? d.get(p.newId) : void 0);
|
|
1996
|
+
if (!f)
|
|
1993
1997
|
continue;
|
|
1994
|
-
l.add(
|
|
1995
|
-
const
|
|
1996
|
-
|
|
1997
|
-
[...t, ...
|
|
1998
|
-
(
|
|
1998
|
+
l.add(f.id);
|
|
1999
|
+
const x = ta(
|
|
2000
|
+
f.id,
|
|
2001
|
+
[...t, ...u].filter(
|
|
2002
|
+
(N) => N.id !== h.id
|
|
1999
2003
|
)
|
|
2000
|
-
),
|
|
2001
|
-
|
|
2004
|
+
), C = f.id === x ? f : { ...f, id: x };
|
|
2005
|
+
u.push({
|
|
2002
2006
|
...h,
|
|
2003
|
-
label:
|
|
2004
|
-
variableName:
|
|
2005
|
-
requiredAtExecution:
|
|
2006
|
-
control:
|
|
2007
|
+
label: C.label,
|
|
2008
|
+
variableName: x,
|
|
2009
|
+
requiredAtExecution: C.requiredAtExecution,
|
|
2010
|
+
control: C
|
|
2007
2011
|
});
|
|
2008
2012
|
}
|
|
2009
|
-
for (const h of
|
|
2010
|
-
l.has(h.id) ||
|
|
2011
|
-
|
|
2013
|
+
for (const h of d.values())
|
|
2014
|
+
l.has(h.id) || u.push(
|
|
2015
|
+
Nr({
|
|
2012
2016
|
control: h,
|
|
2013
|
-
existingInputs: [...t, ...
|
|
2017
|
+
existingInputs: [...t, ...u],
|
|
2014
2018
|
sheetId: a
|
|
2015
2019
|
})
|
|
2016
2020
|
);
|
|
2017
|
-
const
|
|
2018
|
-
|
|
2021
|
+
const c = new Set(
|
|
2022
|
+
o.map((h) => h.id)
|
|
2019
2023
|
);
|
|
2020
2024
|
return [...t.filter(
|
|
2021
|
-
(h) => !
|
|
2022
|
-
), ...
|
|
2025
|
+
(h) => !c.has(h.id)
|
|
2026
|
+
), ...u];
|
|
2023
2027
|
}
|
|
2024
2028
|
function qa({
|
|
2025
2029
|
showFilters: t,
|
|
2026
2030
|
onShowFiltersChange: a,
|
|
2027
|
-
pickerContent:
|
|
2028
|
-
settingsContent:
|
|
2029
|
-
size:
|
|
2030
|
-
className:
|
|
2031
|
-
primaryButtonClassName:
|
|
2032
|
-
secondaryButtonClassName:
|
|
2031
|
+
pickerContent: o,
|
|
2032
|
+
settingsContent: n,
|
|
2033
|
+
size: i = "default",
|
|
2034
|
+
className: s,
|
|
2035
|
+
primaryButtonClassName: d,
|
|
2036
|
+
secondaryButtonClassName: p,
|
|
2033
2037
|
pickerContentClassName: l,
|
|
2034
|
-
settingsContentClassName:
|
|
2038
|
+
settingsContentClassName: u
|
|
2035
2039
|
}) {
|
|
2036
|
-
const
|
|
2040
|
+
const c = i === "toolbar", [m, h] = E(!1), f = et("interactive");
|
|
2037
2041
|
return /* @__PURE__ */ r(
|
|
2038
2042
|
"div",
|
|
2039
2043
|
{
|
|
2040
|
-
className:
|
|
2044
|
+
className: q(
|
|
2041
2045
|
// Height lives on the shell so the outer border is part of the
|
|
2042
2046
|
// h-7 box (matches regular `size="xs"` buttons). Inner triggers
|
|
2043
2047
|
// stretch to fill via `h-full`.
|
|
2044
2048
|
"relative inline-flex items-stretch overflow-hidden rounded-control border border-input bg-background",
|
|
2045
|
-
|
|
2046
|
-
|
|
2049
|
+
c ? "h-8" : "h-7",
|
|
2050
|
+
s
|
|
2047
2051
|
),
|
|
2048
2052
|
children: [
|
|
2049
|
-
/* @__PURE__ */ r(
|
|
2050
|
-
/* @__PURE__ */ e(
|
|
2053
|
+
/* @__PURE__ */ r(Oe, { open: t, onOpenChange: a, children: [
|
|
2054
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2051
2055
|
B,
|
|
2052
2056
|
{
|
|
2053
2057
|
variant: "ghost",
|
|
2054
2058
|
size: "xs",
|
|
2055
|
-
className:
|
|
2059
|
+
className: q(
|
|
2056
2060
|
"h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
|
|
2057
|
-
|
|
2061
|
+
d
|
|
2058
2062
|
),
|
|
2059
2063
|
children: [
|
|
2060
|
-
t ? /* @__PURE__ */ e(ua, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(
|
|
2064
|
+
t ? /* @__PURE__ */ e(ua, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(It, { className: "h-3.5 w-3.5" }),
|
|
2061
2065
|
"Filter"
|
|
2062
2066
|
]
|
|
2063
2067
|
}
|
|
2064
2068
|
) }),
|
|
2065
2069
|
/* @__PURE__ */ e(
|
|
2066
|
-
|
|
2070
|
+
ze,
|
|
2067
2071
|
{
|
|
2068
2072
|
align: "end",
|
|
2069
2073
|
sideOffset: 6,
|
|
2070
|
-
className:
|
|
2071
|
-
"w-auto rounded-card border border-border/60 p-0 shadow-
|
|
2074
|
+
className: q(
|
|
2075
|
+
"w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
|
|
2072
2076
|
l
|
|
2073
2077
|
),
|
|
2074
|
-
style:
|
|
2075
|
-
children:
|
|
2078
|
+
style: f.contentStyle,
|
|
2079
|
+
children: o
|
|
2076
2080
|
}
|
|
2077
2081
|
)
|
|
2078
2082
|
] }),
|
|
2079
|
-
/* @__PURE__ */ r(
|
|
2080
|
-
/* @__PURE__ */ e(
|
|
2083
|
+
/* @__PURE__ */ r(Oe, { open: m, onOpenChange: h, children: [
|
|
2084
|
+
/* @__PURE__ */ e(_e, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2081
2085
|
B,
|
|
2082
2086
|
{
|
|
2083
2087
|
variant: "ghost",
|
|
2084
2088
|
size: "xs",
|
|
2085
|
-
className:
|
|
2089
|
+
className: q(
|
|
2086
2090
|
"h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50 data-[state=open]:bg-accent/60",
|
|
2087
|
-
|
|
2091
|
+
p
|
|
2088
2092
|
),
|
|
2089
2093
|
"aria-label": "Filter and control actions",
|
|
2090
|
-
children: /* @__PURE__ */ e(
|
|
2094
|
+
children: /* @__PURE__ */ e(Ut, { className: "h-3.5 w-3.5" })
|
|
2091
2095
|
}
|
|
2092
2096
|
) }),
|
|
2093
2097
|
/* @__PURE__ */ e(
|
|
2094
|
-
|
|
2098
|
+
ze,
|
|
2095
2099
|
{
|
|
2096
2100
|
align: "end",
|
|
2097
2101
|
sideOffset: 6,
|
|
2098
|
-
className:
|
|
2099
|
-
"w-auto rounded-card border border-border/60 p-0 shadow-
|
|
2100
|
-
|
|
2102
|
+
className: q(
|
|
2103
|
+
"w-auto rounded-card border border-border/60 p-0 shadow-[0_10px_28px_rgba(0,0,0,0.14)] dark:shadow-[0_10px_28px_rgba(0,0,0,0.5)]",
|
|
2104
|
+
u
|
|
2101
2105
|
),
|
|
2102
|
-
style:
|
|
2103
|
-
children:
|
|
2106
|
+
style: f.contentStyle,
|
|
2107
|
+
children: n(() => h(!1))
|
|
2104
2108
|
}
|
|
2105
2109
|
)
|
|
2106
2110
|
] })
|
|
@@ -2110,37 +2114,37 @@ function qa({
|
|
|
2110
2114
|
}
|
|
2111
2115
|
function Xa() {
|
|
2112
2116
|
ha();
|
|
2113
|
-
const t = P((l) => l.selectedSheetId), a = P((l) => l.selectedFrameId),
|
|
2114
|
-
return
|
|
2115
|
-
var
|
|
2116
|
-
let l =
|
|
2117
|
+
const t = P((l) => l.selectedSheetId), a = P((l) => l.selectedFrameId), o = P((l) => l.dashboard), n = P((l) => l.actions.getSelectedFrame), { setSelectedFrameId: i } = be(), { setCard: s } = Vt(), d = ge((l) => l.card.dataSource);
|
|
2118
|
+
return Q(() => {
|
|
2119
|
+
var u, c;
|
|
2120
|
+
let l = n();
|
|
2117
2121
|
if (!l) {
|
|
2118
|
-
const
|
|
2119
|
-
h && (
|
|
2122
|
+
const m = (u = o == null ? void 0 : o.sheets) == null ? void 0 : u.find((f) => f.id === t), h = (c = m == null ? void 0 : m.frames) == null ? void 0 : c[0];
|
|
2123
|
+
h && (i(h.id), l = h);
|
|
2120
2124
|
}
|
|
2121
2125
|
if (l) {
|
|
2122
|
-
const
|
|
2123
|
-
|
|
2126
|
+
const m = l.cards.find((h) => h.id === l.activeCardId);
|
|
2127
|
+
m && s(m);
|
|
2124
2128
|
}
|
|
2125
|
-
}, [
|
|
2126
|
-
hasEntities: !!(
|
|
2129
|
+
}, [n, t, a, o, i, s]), {
|
|
2130
|
+
hasEntities: !!(d != null && d.selectedEntities && d.selectedEntities.length > 0)
|
|
2127
2131
|
};
|
|
2128
2132
|
}
|
|
2129
2133
|
function Za() {
|
|
2130
2134
|
const t = P((l) => l.dashboard), a = P(
|
|
2131
2135
|
(l) => l.semanticExecutionPayload
|
|
2132
|
-
),
|
|
2136
|
+
), o = P((l) => l.actions.addFilter), { hasEntities: n } = Xa(), { isLoading: i } = Sr(), s = ee(
|
|
2133
2137
|
() => ra(t, a),
|
|
2134
2138
|
[t, a]
|
|
2135
|
-
),
|
|
2139
|
+
), p = !aa(t.filters) && s.hasEligibleCards && !i;
|
|
2136
2140
|
return /* @__PURE__ */ r("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
|
|
2137
|
-
|
|
2141
|
+
p && /* @__PURE__ */ e("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ r(
|
|
2138
2142
|
"button",
|
|
2139
2143
|
{
|
|
2140
2144
|
type: "button",
|
|
2141
|
-
onClick: () =>
|
|
2142
|
-
title: `Applies to ${
|
|
2143
|
-
className: "flex w-full items-start gap-2 rounded-
|
|
2145
|
+
onClick: () => o(na()),
|
|
2146
|
+
title: `Applies to ${s.eligibleCardCount} of ${s.totalCardCount} date-aware cards`,
|
|
2147
|
+
className: "flex w-full items-start gap-2 rounded-control px-2 py-1.5 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border",
|
|
2144
2148
|
children: [
|
|
2145
2149
|
/* @__PURE__ */ e(xa, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
2146
2150
|
/* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col", children: [
|
|
@@ -2150,55 +2154,55 @@ function Za() {
|
|
|
2150
2154
|
]
|
|
2151
2155
|
}
|
|
2152
2156
|
) }),
|
|
2153
|
-
!
|
|
2157
|
+
!n && /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
|
|
2154
2158
|
/* @__PURE__ */ e(Dr, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
|
|
2155
2159
|
/* @__PURE__ */ e("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
|
|
2156
2160
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
|
|
2157
2161
|
] }),
|
|
2158
|
-
|
|
2162
|
+
n && /* @__PURE__ */ e("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ e(kr, { context: "filter" }) })
|
|
2159
2163
|
] });
|
|
2160
2164
|
}
|
|
2161
|
-
const
|
|
2165
|
+
const Ct = !1;
|
|
2162
2166
|
function Qa({
|
|
2163
2167
|
onAddFilter: t,
|
|
2164
2168
|
onAddControl: a,
|
|
2165
|
-
onManageControls:
|
|
2166
|
-
onDismiss:
|
|
2169
|
+
onManageControls: o,
|
|
2170
|
+
onDismiss: n
|
|
2167
2171
|
}) {
|
|
2168
|
-
const
|
|
2169
|
-
(
|
|
2170
|
-
), { setFilterLayout:
|
|
2171
|
-
|
|
2172
|
-
const
|
|
2173
|
-
return
|
|
2172
|
+
const i = P(
|
|
2173
|
+
(p) => p.dashboard.filterLayout
|
|
2174
|
+
), { setFilterLayout: s } = be();
|
|
2175
|
+
i != null && i.displayMode;
|
|
2176
|
+
const d = (i == null ? void 0 : i.toolbarWrap) ?? !1;
|
|
2177
|
+
return i == null || i.showDownloadButton, /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
|
|
2174
2178
|
/* @__PURE__ */ r("div", { className: "p-1", children: [
|
|
2175
2179
|
/* @__PURE__ */ e(
|
|
2176
|
-
|
|
2180
|
+
Qe,
|
|
2177
2181
|
{
|
|
2178
|
-
icon:
|
|
2182
|
+
icon: It,
|
|
2179
2183
|
label: "Add filter",
|
|
2180
2184
|
onClick: () => {
|
|
2181
|
-
t(),
|
|
2185
|
+
t(), n();
|
|
2182
2186
|
}
|
|
2183
2187
|
}
|
|
2184
2188
|
),
|
|
2185
2189
|
/* @__PURE__ */ e(
|
|
2186
|
-
|
|
2190
|
+
Qe,
|
|
2187
2191
|
{
|
|
2188
|
-
icon:
|
|
2192
|
+
icon: Rt,
|
|
2189
2193
|
label: "Add control",
|
|
2190
2194
|
onClick: () => {
|
|
2191
|
-
a(),
|
|
2195
|
+
a(), n();
|
|
2192
2196
|
}
|
|
2193
2197
|
}
|
|
2194
2198
|
),
|
|
2195
2199
|
/* @__PURE__ */ e(
|
|
2196
|
-
|
|
2200
|
+
Qe,
|
|
2197
2201
|
{
|
|
2198
|
-
icon:
|
|
2202
|
+
icon: Ft,
|
|
2199
2203
|
label: "Manage controls",
|
|
2200
2204
|
onClick: () => {
|
|
2201
|
-
|
|
2205
|
+
o(), n();
|
|
2202
2206
|
}
|
|
2203
2207
|
}
|
|
2204
2208
|
)
|
|
@@ -2206,31 +2210,31 @@ function Qa({
|
|
|
2206
2210
|
/* @__PURE__ */ e("div", { className: "border-t border-border/60" }),
|
|
2207
2211
|
/* @__PURE__ */ r("div", { className: "space-y-1 p-2", children: [
|
|
2208
2212
|
/* @__PURE__ */ e("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
|
|
2209
|
-
|
|
2213
|
+
Ct,
|
|
2210
2214
|
/* @__PURE__ */ e(
|
|
2211
2215
|
Ya,
|
|
2212
2216
|
{
|
|
2213
2217
|
id: "filter-display-wrap",
|
|
2214
2218
|
label: "Wrap to multiple lines",
|
|
2215
|
-
checked:
|
|
2216
|
-
onCheckedChange: (
|
|
2219
|
+
checked: d,
|
|
2220
|
+
onCheckedChange: (p) => s({ toolbarWrap: p === !0 })
|
|
2217
2221
|
}
|
|
2218
2222
|
),
|
|
2219
|
-
|
|
2223
|
+
Ct
|
|
2220
2224
|
] })
|
|
2221
2225
|
] });
|
|
2222
2226
|
}
|
|
2223
|
-
function
|
|
2227
|
+
function Qe({
|
|
2224
2228
|
icon: t,
|
|
2225
2229
|
label: a,
|
|
2226
|
-
onClick:
|
|
2230
|
+
onClick: o
|
|
2227
2231
|
}) {
|
|
2228
2232
|
return /* @__PURE__ */ r(
|
|
2229
2233
|
"button",
|
|
2230
2234
|
{
|
|
2231
2235
|
type: "button",
|
|
2232
|
-
onClick:
|
|
2233
|
-
className: "flex w-full items-center gap-2 rounded-
|
|
2236
|
+
onClick: o,
|
|
2237
|
+
className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-[13px] text-foreground outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40",
|
|
2234
2238
|
children: [
|
|
2235
2239
|
/* @__PURE__ */ e(t, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
2236
2240
|
a
|
|
@@ -2241,13 +2245,13 @@ function Ze({
|
|
|
2241
2245
|
function Ya({
|
|
2242
2246
|
id: t,
|
|
2243
2247
|
label: a,
|
|
2244
|
-
checked:
|
|
2245
|
-
onCheckedChange:
|
|
2248
|
+
checked: o,
|
|
2249
|
+
onCheckedChange: n
|
|
2246
2250
|
}) {
|
|
2247
|
-
return /* @__PURE__ */ r("div", { className: "flex items-center gap-2 rounded-
|
|
2248
|
-
/* @__PURE__ */ e(
|
|
2251
|
+
return /* @__PURE__ */ r("div", { className: "flex items-center gap-2 rounded-control px-1 py-1 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
|
|
2252
|
+
/* @__PURE__ */ e(lt, { id: t, checked: o, onCheckedChange: n }),
|
|
2249
2253
|
/* @__PURE__ */ e(
|
|
2250
|
-
|
|
2254
|
+
Se,
|
|
2251
2255
|
{
|
|
2252
2256
|
htmlFor: t,
|
|
2253
2257
|
className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
|
|
@@ -2256,85 +2260,85 @@ function Ya({
|
|
|
2256
2260
|
)
|
|
2257
2261
|
] });
|
|
2258
2262
|
}
|
|
2259
|
-
function
|
|
2263
|
+
function Zn({
|
|
2260
2264
|
size: t,
|
|
2261
2265
|
className: a,
|
|
2262
|
-
primaryButtonClassName:
|
|
2263
|
-
secondaryButtonClassName:
|
|
2264
|
-
pickerContentClassName:
|
|
2265
|
-
settingsContentClassName:
|
|
2266
|
+
primaryButtonClassName: o,
|
|
2267
|
+
secondaryButtonClassName: n,
|
|
2268
|
+
pickerContentClassName: i,
|
|
2269
|
+
settingsContentClassName: s
|
|
2266
2270
|
}) {
|
|
2267
2271
|
var U;
|
|
2268
|
-
const [
|
|
2269
|
-
(
|
|
2270
|
-
),
|
|
2272
|
+
const [d, p] = E(null), l = P((g) => g.dashboard), u = P((g) => g.selectedSheetId), c = P((g) => g.showFilters), m = Ar((g) => g.setPanelOpen), h = P((g) => g.actions), { setDocumentInspectorTab: f, setShowFilters: x } = h, C = (U = l.sheets) == null ? void 0 : U.find(
|
|
2273
|
+
(g) => g.id === u
|
|
2274
|
+
), N = sa(C), I = K((g) => {
|
|
2271
2275
|
window.setTimeout(() => {
|
|
2272
|
-
|
|
2276
|
+
p(g);
|
|
2273
2277
|
}, 0);
|
|
2274
|
-
}, []),
|
|
2275
|
-
(
|
|
2276
|
-
if (
|
|
2277
|
-
|
|
2278
|
+
}, []), D = K(
|
|
2279
|
+
(g) => {
|
|
2280
|
+
if (N && u) {
|
|
2281
|
+
g && f(u, "inputs");
|
|
2278
2282
|
return;
|
|
2279
2283
|
}
|
|
2280
|
-
|
|
2284
|
+
g && m("dashboard", !1), x(g);
|
|
2281
2285
|
},
|
|
2282
2286
|
[
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
p,
|
|
2287
|
+
N,
|
|
2288
|
+
u,
|
|
2286
2289
|
f,
|
|
2287
|
-
|
|
2290
|
+
m,
|
|
2291
|
+
x
|
|
2288
2292
|
]
|
|
2289
|
-
),
|
|
2290
|
-
|
|
2291
|
-
}, [
|
|
2293
|
+
), b = K(() => {
|
|
2294
|
+
D(!0);
|
|
2295
|
+
}, [D]), S = K(() => {
|
|
2292
2296
|
I("create");
|
|
2293
|
-
}, [I]),
|
|
2297
|
+
}, [I]), A = K(() => {
|
|
2294
2298
|
I("manage");
|
|
2295
2299
|
}, [I]);
|
|
2296
2300
|
return /* @__PURE__ */ r(W, { children: [
|
|
2297
2301
|
/* @__PURE__ */ e(
|
|
2298
2302
|
qa,
|
|
2299
2303
|
{
|
|
2300
|
-
showFilters:
|
|
2301
|
-
onShowFiltersChange:
|
|
2304
|
+
showFilters: N ? !1 : c,
|
|
2305
|
+
onShowFiltersChange: D,
|
|
2302
2306
|
pickerContent: /* @__PURE__ */ e(Za, {}),
|
|
2303
|
-
settingsContent: (
|
|
2307
|
+
settingsContent: (g) => /* @__PURE__ */ e(
|
|
2304
2308
|
Qa,
|
|
2305
2309
|
{
|
|
2306
|
-
onAddFilter:
|
|
2310
|
+
onAddFilter: b,
|
|
2307
2311
|
onAddControl: S,
|
|
2308
|
-
onManageControls:
|
|
2309
|
-
onDismiss:
|
|
2312
|
+
onManageControls: A,
|
|
2313
|
+
onDismiss: g
|
|
2310
2314
|
}
|
|
2311
2315
|
),
|
|
2312
2316
|
size: t,
|
|
2313
2317
|
className: a,
|
|
2314
|
-
primaryButtonClassName:
|
|
2315
|
-
secondaryButtonClassName:
|
|
2316
|
-
pickerContentClassName:
|
|
2317
|
-
settingsContentClassName:
|
|
2318
|
+
primaryButtonClassName: o,
|
|
2319
|
+
secondaryButtonClassName: n,
|
|
2320
|
+
pickerContentClassName: i,
|
|
2321
|
+
settingsContentClassName: s
|
|
2318
2322
|
}
|
|
2319
2323
|
),
|
|
2320
|
-
|
|
2324
|
+
d ? N ? /* @__PURE__ */ e(
|
|
2321
2325
|
ja,
|
|
2322
2326
|
{
|
|
2323
2327
|
open: !0,
|
|
2324
|
-
onOpenChange: (
|
|
2325
|
-
|
|
2328
|
+
onOpenChange: (g) => {
|
|
2329
|
+
g || p(null);
|
|
2326
2330
|
},
|
|
2327
|
-
initialMode:
|
|
2331
|
+
initialMode: d
|
|
2328
2332
|
}
|
|
2329
2333
|
) : /* @__PURE__ */ e(
|
|
2330
|
-
|
|
2334
|
+
za,
|
|
2331
2335
|
{
|
|
2332
2336
|
open: !0,
|
|
2333
|
-
onOpenChange: (
|
|
2334
|
-
|
|
2337
|
+
onOpenChange: (g) => {
|
|
2338
|
+
g || p(null);
|
|
2335
2339
|
},
|
|
2336
2340
|
showTrigger: !1,
|
|
2337
|
-
initialMode:
|
|
2341
|
+
initialMode: d
|
|
2338
2342
|
}
|
|
2339
2343
|
) : null
|
|
2340
2344
|
] });
|
|
@@ -2342,10 +2346,10 @@ function qn({
|
|
|
2342
2346
|
function Ja({
|
|
2343
2347
|
disabled: t,
|
|
2344
2348
|
briefingCount: a,
|
|
2345
|
-
className:
|
|
2346
|
-
onClick:
|
|
2349
|
+
className: o,
|
|
2350
|
+
onClick: n
|
|
2347
2351
|
}) {
|
|
2348
|
-
const
|
|
2352
|
+
const i = typeof a == "number" && a > 0;
|
|
2349
2353
|
return /* @__PURE__ */ r(
|
|
2350
2354
|
B,
|
|
2351
2355
|
{
|
|
@@ -2353,18 +2357,18 @@ function Ja({
|
|
|
2353
2357
|
size: "xs",
|
|
2354
2358
|
variant: "outline",
|
|
2355
2359
|
disabled: t,
|
|
2356
|
-
className:
|
|
2357
|
-
onClick:
|
|
2360
|
+
className: q("gap-1.5", o),
|
|
2361
|
+
onClick: n,
|
|
2358
2362
|
"aria-label": "Reports & briefings",
|
|
2359
2363
|
children: [
|
|
2360
2364
|
/* @__PURE__ */ e(ya, { className: "h-3.5 w-3.5" }),
|
|
2361
2365
|
"Reports & briefings",
|
|
2362
|
-
|
|
2366
|
+
i ? /* @__PURE__ */ e("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
|
|
2363
2367
|
]
|
|
2364
2368
|
}
|
|
2365
2369
|
);
|
|
2366
2370
|
}
|
|
2367
|
-
const en = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",
|
|
2371
|
+
const en = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", zt = "inline-flex h-7 items-center gap-1.5 rounded-control px-2 text-[12px] text-muted-foreground hover:bg-muted hover:text-foreground disabled:opacity-50", Ue = "inline-flex h-7 items-center gap-1.5 rounded-control bg-primary px-3 text-[12px] font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50";
|
|
2368
2372
|
function tn(t) {
|
|
2369
2373
|
return t === "dashboard" ? "This dashboard" : "Project";
|
|
2370
2374
|
}
|
|
@@ -2372,15 +2376,15 @@ function rn(t) {
|
|
|
2372
2376
|
if (!t) return "Never";
|
|
2373
2377
|
const a = new Date(t);
|
|
2374
2378
|
if (Number.isNaN(a.getTime())) return "Unknown";
|
|
2375
|
-
const
|
|
2376
|
-
if (
|
|
2377
|
-
if (
|
|
2378
|
-
const
|
|
2379
|
-
if (
|
|
2380
|
-
const
|
|
2381
|
-
if (
|
|
2382
|
-
const
|
|
2383
|
-
return
|
|
2379
|
+
const o = Date.now() - a.getTime(), n = Math.round(o / 6e4);
|
|
2380
|
+
if (n < 1) return "now";
|
|
2381
|
+
if (n < 60) return `${n}m ago`;
|
|
2382
|
+
const i = Math.round(n / 60);
|
|
2383
|
+
if (i < 24) return `${i}h ago`;
|
|
2384
|
+
const s = Math.round(i / 24);
|
|
2385
|
+
if (s < 7) return `${s}d ago`;
|
|
2386
|
+
const d = Math.round(s / 7);
|
|
2387
|
+
return d < 5 ? `${d}w ago` : `${Math.round(s / 30)}mo ago`;
|
|
2384
2388
|
}
|
|
2385
2389
|
function an(t) {
|
|
2386
2390
|
return t.scheduleExpr ? fa(
|
|
@@ -2395,7 +2399,7 @@ function nn(t) {
|
|
|
2395
2399
|
}
|
|
2396
2400
|
return null;
|
|
2397
2401
|
}
|
|
2398
|
-
function
|
|
2402
|
+
function $t(t) {
|
|
2399
2403
|
return t.hasActiveRun ? "Running" : t.lastRunStatus ? `Last run ${t.lastRunStatus.toString().toLowerCase()}` : "Idle";
|
|
2400
2404
|
}
|
|
2401
2405
|
function sn(t) {
|
|
@@ -2411,22 +2415,22 @@ function on({
|
|
|
2411
2415
|
className: "flex shrink-0 items-center gap-1 rounded-control bg-muted p-0.5",
|
|
2412
2416
|
role: "tablist",
|
|
2413
2417
|
"aria-label": "Briefing source view",
|
|
2414
|
-
children: ["dashboard", "project"].map((
|
|
2415
|
-
const
|
|
2418
|
+
children: ["dashboard", "project"].map((o) => {
|
|
2419
|
+
const n = t === o;
|
|
2416
2420
|
return /* @__PURE__ */ e(
|
|
2417
2421
|
"button",
|
|
2418
2422
|
{
|
|
2419
2423
|
type: "button",
|
|
2420
2424
|
role: "tab",
|
|
2421
|
-
"aria-selected":
|
|
2422
|
-
onClick: () => a(
|
|
2423
|
-
className:
|
|
2425
|
+
"aria-selected": n,
|
|
2426
|
+
onClick: () => a(o),
|
|
2427
|
+
className: q(
|
|
2424
2428
|
"h-6 rounded-[3px] px-2 text-[11px] transition-colors",
|
|
2425
|
-
|
|
2429
|
+
n ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
2426
2430
|
),
|
|
2427
|
-
children: tn(
|
|
2431
|
+
children: tn(o)
|
|
2428
2432
|
},
|
|
2429
|
-
|
|
2433
|
+
o
|
|
2430
2434
|
);
|
|
2431
2435
|
})
|
|
2432
2436
|
}
|
|
@@ -2435,45 +2439,45 @@ function on({
|
|
|
2435
2439
|
function ln({
|
|
2436
2440
|
briefings: t,
|
|
2437
2441
|
dashboardLabel: a,
|
|
2438
|
-
sourceView:
|
|
2439
|
-
error:
|
|
2440
|
-
loading:
|
|
2441
|
-
onSourceViewChange:
|
|
2442
|
-
onClose:
|
|
2443
|
-
onEdit:
|
|
2442
|
+
sourceView: o,
|
|
2443
|
+
error: n,
|
|
2444
|
+
loading: i,
|
|
2445
|
+
onSourceViewChange: s,
|
|
2446
|
+
onClose: d,
|
|
2447
|
+
onEdit: p,
|
|
2444
2448
|
onNew: l,
|
|
2445
|
-
canCreate:
|
|
2446
|
-
canCreateScheduledReport:
|
|
2447
|
-
analyticalBriefingsEnabled:
|
|
2449
|
+
canCreate: u,
|
|
2450
|
+
canCreateScheduledReport: c,
|
|
2451
|
+
analyticalBriefingsEnabled: m,
|
|
2448
2452
|
onRunNow: h,
|
|
2449
|
-
onTogglePause:
|
|
2450
|
-
onDelete:
|
|
2451
|
-
selectingId:
|
|
2452
|
-
busyId:
|
|
2453
|
+
onTogglePause: f,
|
|
2454
|
+
onDelete: x,
|
|
2455
|
+
selectingId: C,
|
|
2456
|
+
busyId: N,
|
|
2453
2457
|
manageBriefingsHref: I,
|
|
2454
|
-
contentKind:
|
|
2455
|
-
hideHeader:
|
|
2458
|
+
contentKind: D,
|
|
2459
|
+
hideHeader: b = !1
|
|
2456
2460
|
}) {
|
|
2457
|
-
const S = t.length,
|
|
2461
|
+
const S = t.length, A = t.filter((F) => F.status === "ACTIVE").length, U = D === "reports" ? S === 1 ? "report" : "reports" : D === "briefings" ? S === 1 ? "briefing" : "briefings" : S === 1 ? "item" : "items", g = t.find((F) => F.hasActiveRun) ?? null, v = D ?? "reports & briefings", T = o === "dashboard" ? a : `Project ${v}`;
|
|
2458
2462
|
return /* @__PURE__ */ r(
|
|
2459
2463
|
"section",
|
|
2460
2464
|
{
|
|
2461
|
-
"aria-label": `Dashboard ${
|
|
2465
|
+
"aria-label": `Dashboard ${v.replace("&", "and")}`,
|
|
2462
2466
|
className: "flex h-full min-h-0 flex-col bg-background text-foreground",
|
|
2463
2467
|
children: [
|
|
2464
|
-
|
|
2468
|
+
b ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
|
|
2465
2469
|
/* @__PURE__ */ r("div", { className: "min-w-0", children: [
|
|
2466
|
-
/* @__PURE__ */ e("div", { className: en, children:
|
|
2470
|
+
/* @__PURE__ */ e("div", { className: en, children: v }),
|
|
2467
2471
|
/* @__PURE__ */ e("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: T })
|
|
2468
2472
|
] }),
|
|
2469
2473
|
/* @__PURE__ */ e(
|
|
2470
2474
|
"button",
|
|
2471
2475
|
{
|
|
2472
2476
|
type: "button",
|
|
2473
|
-
onClick:
|
|
2477
|
+
onClick: d,
|
|
2474
2478
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2475
|
-
"aria-label": `Close ${
|
|
2476
|
-
children: /* @__PURE__ */ e(
|
|
2479
|
+
"aria-label": `Close ${v.replace("&", "and")} panel`,
|
|
2480
|
+
children: /* @__PURE__ */ e(Ge, { className: "h-3.5 w-3.5" })
|
|
2477
2481
|
}
|
|
2478
2482
|
)
|
|
2479
2483
|
] }),
|
|
@@ -2482,17 +2486,17 @@ function ln({
|
|
|
2482
2486
|
/* @__PURE__ */ e(
|
|
2483
2487
|
on,
|
|
2484
2488
|
{
|
|
2485
|
-
activeView:
|
|
2486
|
-
onChange:
|
|
2489
|
+
activeView: o,
|
|
2490
|
+
onChange: s
|
|
2487
2491
|
}
|
|
2488
2492
|
),
|
|
2489
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children:
|
|
2493
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && S === 0 ? /* @__PURE__ */ r("span", { children: [
|
|
2490
2494
|
"Loading ",
|
|
2491
|
-
|
|
2495
|
+
v,
|
|
2492
2496
|
"…"
|
|
2493
2497
|
] }) : S === 0 ? /* @__PURE__ */ r("span", { children: [
|
|
2494
2498
|
"No ",
|
|
2495
|
-
|
|
2499
|
+
v,
|
|
2496
2500
|
" yet"
|
|
2497
2501
|
] }) : /* @__PURE__ */ r(W, { children: [
|
|
2498
2502
|
/* @__PURE__ */ r("span", { className: "font-medium text-foreground/80", children: [
|
|
@@ -2502,49 +2506,49 @@ function ln({
|
|
|
2502
2506
|
] }),
|
|
2503
2507
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2504
2508
|
/* @__PURE__ */ r("span", { children: [
|
|
2505
|
-
|
|
2509
|
+
A,
|
|
2506
2510
|
" active"
|
|
2507
2511
|
] })
|
|
2508
2512
|
] }) })
|
|
2509
2513
|
] }),
|
|
2510
2514
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
2511
|
-
|
|
2515
|
+
i ? (
|
|
2512
2516
|
// Auto-refresh on open; surface a quiet spinner near the count
|
|
2513
2517
|
// when a manual reload is in flight, but don't show a separate
|
|
2514
2518
|
// refresh button — close+reopen handles the rare "stale list"
|
|
2515
2519
|
// case without crowding the toolbar.
|
|
2516
2520
|
/* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
|
|
2517
2521
|
) : null,
|
|
2518
|
-
S > 0 &&
|
|
2519
|
-
/* @__PURE__ */ e(
|
|
2522
|
+
S > 0 && u ? m && c ? /* @__PURE__ */ r($e, { children: [
|
|
2523
|
+
/* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Ue, children: [
|
|
2520
2524
|
/* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
|
|
2521
2525
|
" New"
|
|
2522
2526
|
] }) }),
|
|
2523
|
-
/* @__PURE__ */ r(
|
|
2524
|
-
/* @__PURE__ */ e(
|
|
2527
|
+
/* @__PURE__ */ r(We, { align: "end", children: [
|
|
2528
|
+
/* @__PURE__ */ e(G, { onClick: () => l("scheduled_report"), children: "Schedule a report" }),
|
|
2525
2529
|
/* @__PURE__ */ e(
|
|
2526
|
-
|
|
2530
|
+
G,
|
|
2527
2531
|
{
|
|
2528
2532
|
onClick: () => l("analytical_briefing"),
|
|
2529
2533
|
children: "Create analytical briefing"
|
|
2530
2534
|
}
|
|
2531
2535
|
)
|
|
2532
2536
|
] })
|
|
2533
|
-
] }) :
|
|
2537
|
+
] }) : c ? /* @__PURE__ */ r(
|
|
2534
2538
|
"button",
|
|
2535
2539
|
{
|
|
2536
2540
|
onClick: () => l("scheduled_report"),
|
|
2537
|
-
className:
|
|
2541
|
+
className: Ue,
|
|
2538
2542
|
children: [
|
|
2539
2543
|
/* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
|
|
2540
2544
|
" Schedule report"
|
|
2541
2545
|
]
|
|
2542
2546
|
}
|
|
2543
|
-
) :
|
|
2547
|
+
) : m ? /* @__PURE__ */ r(
|
|
2544
2548
|
"button",
|
|
2545
2549
|
{
|
|
2546
2550
|
onClick: () => l("analytical_briefing"),
|
|
2547
|
-
className:
|
|
2551
|
+
className: Ue,
|
|
2548
2552
|
children: [
|
|
2549
2553
|
/* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
|
|
2550
2554
|
" New briefing"
|
|
@@ -2553,34 +2557,34 @@ function ln({
|
|
|
2553
2557
|
) : null : null
|
|
2554
2558
|
] })
|
|
2555
2559
|
] }),
|
|
2556
|
-
|
|
2560
|
+
g ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
|
|
2557
2561
|
/* @__PURE__ */ e(te, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
|
|
2558
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children:
|
|
2562
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: g.name }),
|
|
2559
2563
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2560
|
-
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children:
|
|
2564
|
+
/* @__PURE__ */ e("span", { className: "truncate text-muted-foreground", children: $t(g) })
|
|
2561
2565
|
] }) : null,
|
|
2562
2566
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: [
|
|
2563
|
-
|
|
2564
|
-
!
|
|
2567
|
+
n ? /* @__PURE__ */ e("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: n }) : null,
|
|
2568
|
+
!i && t.length === 0 && !n ? /* @__PURE__ */ e(
|
|
2565
2569
|
cn,
|
|
2566
2570
|
{
|
|
2567
2571
|
onNew: l,
|
|
2568
|
-
canCreate:
|
|
2569
|
-
canCreateScheduledReport:
|
|
2570
|
-
analyticalBriefingsEnabled:
|
|
2571
|
-
contentKind:
|
|
2572
|
+
canCreate: u,
|
|
2573
|
+
canCreateScheduledReport: c,
|
|
2574
|
+
analyticalBriefingsEnabled: m,
|
|
2575
|
+
contentKind: D
|
|
2572
2576
|
}
|
|
2573
2577
|
) : null,
|
|
2574
2578
|
t.map((F) => /* @__PURE__ */ e(
|
|
2575
2579
|
un,
|
|
2576
2580
|
{
|
|
2577
2581
|
briefing: F,
|
|
2578
|
-
isOpening:
|
|
2579
|
-
isBusy:
|
|
2580
|
-
onOpen: () =>
|
|
2582
|
+
isOpening: C === F.id,
|
|
2583
|
+
isBusy: N === F.id,
|
|
2584
|
+
onOpen: () => p(F.id),
|
|
2581
2585
|
onRunNow: () => h(F),
|
|
2582
|
-
onTogglePause: () =>
|
|
2583
|
-
onDelete: () =>
|
|
2586
|
+
onTogglePause: () => f(F),
|
|
2587
|
+
onDelete: () => x(F)
|
|
2584
2588
|
},
|
|
2585
2589
|
F.id
|
|
2586
2590
|
))
|
|
@@ -2589,7 +2593,7 @@ function ln({
|
|
|
2589
2593
|
"a",
|
|
2590
2594
|
{
|
|
2591
2595
|
href: I,
|
|
2592
|
-
className:
|
|
2596
|
+
className: q(zt, "h-6 px-1 text-[11px]"),
|
|
2593
2597
|
children: [
|
|
2594
2598
|
"Manage all reports & briefings",
|
|
2595
2599
|
/* @__PURE__ */ e(ba, { className: "h-3 w-3" })
|
|
@@ -2603,38 +2607,38 @@ function ln({
|
|
|
2603
2607
|
function cn({
|
|
2604
2608
|
onNew: t,
|
|
2605
2609
|
canCreate: a,
|
|
2606
|
-
canCreateScheduledReport:
|
|
2607
|
-
analyticalBriefingsEnabled:
|
|
2608
|
-
contentKind:
|
|
2610
|
+
canCreateScheduledReport: o,
|
|
2611
|
+
analyticalBriefingsEnabled: n,
|
|
2612
|
+
contentKind: i
|
|
2609
2613
|
}) {
|
|
2610
|
-
const
|
|
2614
|
+
const s = i === "reports" ? {
|
|
2611
2615
|
title: "No reports yet",
|
|
2612
2616
|
description: "Schedule an emailed dashboard or visual report to see it here."
|
|
2613
|
-
} :
|
|
2617
|
+
} : i === "briefings" ? {
|
|
2614
2618
|
title: "No briefings yet",
|
|
2615
2619
|
description: "Create an analytical briefing to monitor this dashboard and brief your team."
|
|
2616
2620
|
} : null;
|
|
2617
2621
|
return /* @__PURE__ */ r("div", { className: "flex h-full flex-col items-center justify-center px-8 py-12 text-center", children: [
|
|
2618
2622
|
/* @__PURE__ */ e(dn, { className: "mb-5 h-[88px] w-[112px] text-border" }),
|
|
2619
|
-
/* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: (
|
|
2620
|
-
/* @__PURE__ */ e("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (
|
|
2623
|
+
/* @__PURE__ */ e("div", { className: "text-[13px] font-medium text-foreground", children: (s == null ? void 0 : s.title) ?? "Have an analyst brief your team" }),
|
|
2624
|
+
/* @__PURE__ */ e("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (s == null ? void 0 : s.description) ?? "Describe what to watch. An analyst digs into this dashboard and the data behind it, then briefs your team on the cadence you choose." }),
|
|
2621
2625
|
a ? /* @__PURE__ */ r("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
|
|
2622
|
-
|
|
2626
|
+
o ? /* @__PURE__ */ r(
|
|
2623
2627
|
"button",
|
|
2624
2628
|
{
|
|
2625
2629
|
onClick: () => t("scheduled_report"),
|
|
2626
|
-
className:
|
|
2630
|
+
className: Ue,
|
|
2627
2631
|
children: [
|
|
2628
2632
|
/* @__PURE__ */ e(fe, { className: "h-3 w-3" }),
|
|
2629
2633
|
" Schedule a report"
|
|
2630
2634
|
]
|
|
2631
2635
|
}
|
|
2632
2636
|
) : null,
|
|
2633
|
-
|
|
2637
|
+
n ? /* @__PURE__ */ e(
|
|
2634
2638
|
"button",
|
|
2635
2639
|
{
|
|
2636
2640
|
onClick: () => t("analytical_briefing"),
|
|
2637
|
-
className:
|
|
2641
|
+
className: zt,
|
|
2638
2642
|
children: "Create analytical briefing"
|
|
2639
2643
|
}
|
|
2640
2644
|
) : null
|
|
@@ -2821,19 +2825,19 @@ function dn({ className: t }) {
|
|
|
2821
2825
|
function un({
|
|
2822
2826
|
briefing: t,
|
|
2823
2827
|
isOpening: a,
|
|
2824
|
-
isBusy:
|
|
2825
|
-
onOpen:
|
|
2826
|
-
onRunNow:
|
|
2827
|
-
onTogglePause:
|
|
2828
|
-
onDelete:
|
|
2828
|
+
isBusy: o,
|
|
2829
|
+
onOpen: n,
|
|
2830
|
+
onRunNow: i,
|
|
2831
|
+
onTogglePause: s,
|
|
2832
|
+
onDelete: d
|
|
2829
2833
|
}) {
|
|
2830
|
-
const
|
|
2834
|
+
const p = t.status === "PAUSED", l = t.hasActiveRun, u = nn(t), c = rn(t.lastRunAt), m = t.lastRunStatus, h = se(t), f = m === "SUCCESS" ? Re.success.dot : m === "FAILED" ? Re.danger.dot : m ? Re.warning.dot : Re.neutral.dot;
|
|
2831
2835
|
return /* @__PURE__ */ r(
|
|
2832
2836
|
"div",
|
|
2833
2837
|
{
|
|
2834
|
-
className:
|
|
2838
|
+
className: q(
|
|
2835
2839
|
"group relative border-b border-border/60 px-4 py-3 transition-colors hover:bg-muted/60",
|
|
2836
|
-
|
|
2840
|
+
p && "opacity-70"
|
|
2837
2841
|
),
|
|
2838
2842
|
children: [
|
|
2839
2843
|
/* @__PURE__ */ r(
|
|
@@ -2841,15 +2845,15 @@ function un({
|
|
|
2841
2845
|
{
|
|
2842
2846
|
role: "button",
|
|
2843
2847
|
tabIndex: 0,
|
|
2844
|
-
onClick:
|
|
2845
|
-
onKeyDown: (
|
|
2846
|
-
(
|
|
2848
|
+
onClick: n,
|
|
2849
|
+
onKeyDown: (x) => {
|
|
2850
|
+
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), n());
|
|
2847
2851
|
},
|
|
2848
2852
|
className: "cursor-pointer pr-8",
|
|
2849
2853
|
children: [
|
|
2850
2854
|
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2851
2855
|
/* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-foreground", children: t.name }),
|
|
2852
|
-
|
|
2856
|
+
p ? /* @__PURE__ */ e("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
|
|
2853
2857
|
] }),
|
|
2854
2858
|
/* @__PURE__ */ r("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
|
|
2855
2859
|
/* @__PURE__ */ e("span", { children: h.typeLabel }),
|
|
@@ -2862,47 +2866,47 @@ function un({
|
|
|
2862
2866
|
/* @__PURE__ */ e("span", { className: "text-border", children: "·" }),
|
|
2863
2867
|
/* @__PURE__ */ r("span", { children: [
|
|
2864
2868
|
"Last run ",
|
|
2865
|
-
|
|
2869
|
+
c
|
|
2866
2870
|
] })
|
|
2867
2871
|
] }) : null
|
|
2868
2872
|
] }),
|
|
2869
|
-
|
|
2873
|
+
u || l ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
|
|
2870
2874
|
l ? /* @__PURE__ */ e(te, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ e(
|
|
2871
2875
|
"span",
|
|
2872
2876
|
{
|
|
2873
|
-
className:
|
|
2877
|
+
className: q(
|
|
2874
2878
|
"inline-block h-1.5 w-1.5 shrink-0 rounded-full",
|
|
2875
|
-
|
|
2879
|
+
f
|
|
2876
2880
|
)
|
|
2877
2881
|
}
|
|
2878
2882
|
),
|
|
2879
|
-
/* @__PURE__ */ e("span", { className: "truncate", children: l ?
|
|
2883
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: l ? $t(t) : u })
|
|
2880
2884
|
] }) : null
|
|
2881
2885
|
]
|
|
2882
2886
|
}
|
|
2883
2887
|
),
|
|
2884
|
-
/* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children:
|
|
2885
|
-
/* @__PURE__ */ e(
|
|
2888
|
+
/* @__PURE__ */ e("div", { className: "absolute right-3 top-3", children: o ? /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ e(te, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ r($e, { children: [
|
|
2889
|
+
/* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2886
2890
|
"button",
|
|
2887
2891
|
{
|
|
2888
2892
|
type: "button",
|
|
2889
|
-
onClick: (
|
|
2893
|
+
onClick: (x) => x.stopPropagation(),
|
|
2890
2894
|
className: "inline-flex h-6 w-6 items-center justify-center rounded-control text-muted-foreground/70 opacity-60 hover:bg-muted hover:text-foreground/80 focus-visible:opacity-100 group-hover:opacity-100",
|
|
2891
2895
|
"aria-label": `${h.noun === "report" ? "Report" : "Briefing"} actions`,
|
|
2892
|
-
children: /* @__PURE__ */ e(
|
|
2896
|
+
children: /* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5" })
|
|
2893
2897
|
}
|
|
2894
2898
|
) }),
|
|
2895
|
-
/* @__PURE__ */ r(
|
|
2896
|
-
/* @__PURE__ */ r(
|
|
2897
|
-
/* @__PURE__ */ e(
|
|
2899
|
+
/* @__PURE__ */ r(We, { align: "end", className: "w-44", children: [
|
|
2900
|
+
/* @__PURE__ */ r(G, { onClick: n, children: [
|
|
2901
|
+
/* @__PURE__ */ e(Ft, { className: "h-3.5 w-3.5" }),
|
|
2898
2902
|
"Edit ",
|
|
2899
2903
|
h.noun
|
|
2900
2904
|
] }),
|
|
2901
2905
|
/* @__PURE__ */ r(
|
|
2902
|
-
|
|
2906
|
+
G,
|
|
2903
2907
|
{
|
|
2904
|
-
onClick: (
|
|
2905
|
-
|
|
2908
|
+
onClick: (x) => {
|
|
2909
|
+
x.preventDefault(), i();
|
|
2906
2910
|
},
|
|
2907
2911
|
children: [
|
|
2908
2912
|
/* @__PURE__ */ e(Ir, { className: "h-3.5 w-3.5" }),
|
|
@@ -2911,12 +2915,12 @@ function un({
|
|
|
2911
2915
|
}
|
|
2912
2916
|
),
|
|
2913
2917
|
t.scheduleExpr ? /* @__PURE__ */ e(
|
|
2914
|
-
|
|
2918
|
+
G,
|
|
2915
2919
|
{
|
|
2916
|
-
onClick: (
|
|
2917
|
-
|
|
2920
|
+
onClick: (x) => {
|
|
2921
|
+
x.preventDefault(), s();
|
|
2918
2922
|
},
|
|
2919
|
-
children:
|
|
2923
|
+
children: p ? /* @__PURE__ */ r(W, { children: [
|
|
2920
2924
|
/* @__PURE__ */ e(Fr, { className: "h-3.5 w-3.5" }),
|
|
2921
2925
|
"Resume"
|
|
2922
2926
|
] }) : /* @__PURE__ */ r(W, { children: [
|
|
@@ -2925,16 +2929,16 @@ function un({
|
|
|
2925
2929
|
] })
|
|
2926
2930
|
}
|
|
2927
2931
|
) : null,
|
|
2928
|
-
/* @__PURE__ */ e(
|
|
2932
|
+
/* @__PURE__ */ e(Me, {}),
|
|
2929
2933
|
/* @__PURE__ */ r(
|
|
2930
|
-
|
|
2934
|
+
G,
|
|
2931
2935
|
{
|
|
2932
|
-
onClick: (
|
|
2933
|
-
|
|
2936
|
+
onClick: (x) => {
|
|
2937
|
+
x.preventDefault(), d();
|
|
2934
2938
|
},
|
|
2935
2939
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
2936
2940
|
children: [
|
|
2937
|
-
/* @__PURE__ */ e(
|
|
2941
|
+
/* @__PURE__ */ e(Pe, { className: "h-3.5 w-3.5" }),
|
|
2938
2942
|
"Delete ",
|
|
2939
2943
|
h.noun
|
|
2940
2944
|
]
|
|
@@ -2953,24 +2957,24 @@ function pn(t) {
|
|
|
2953
2957
|
function fn(t) {
|
|
2954
2958
|
return t === "This dashboard" ? "Watch this dashboard" : `Watch ${t}`;
|
|
2955
2959
|
}
|
|
2956
|
-
function gn(t, a,
|
|
2960
|
+
function gn(t, a, o) {
|
|
2957
2961
|
return a !== "dashboard" ? t : t.filter(
|
|
2958
|
-
(
|
|
2962
|
+
(n) => n.source.type === "dashboard" && n.source.dashboardId === o
|
|
2959
2963
|
);
|
|
2960
2964
|
}
|
|
2961
2965
|
async function bn(t) {
|
|
2962
|
-
const
|
|
2963
|
-
let
|
|
2964
|
-
for (;
|
|
2965
|
-
const
|
|
2966
|
+
const o = [];
|
|
2967
|
+
let n = 1, i = 0, s = Number.POSITIVE_INFINITY;
|
|
2968
|
+
for (; i < s; ) {
|
|
2969
|
+
const d = await t.apiClient.listBriefings(
|
|
2966
2970
|
t.apiServiceUrl,
|
|
2967
2971
|
t.token,
|
|
2968
|
-
{ scope: "organization", page:
|
|
2972
|
+
{ scope: "organization", page: n, pageSize: 100 }
|
|
2969
2973
|
);
|
|
2970
|
-
if (
|
|
2971
|
-
|
|
2974
|
+
if (o.push(...d.briefings), i += d.briefings.length, s = d.total, d.briefings.length === 0 || i >= s) break;
|
|
2975
|
+
n += 1;
|
|
2972
2976
|
}
|
|
2973
|
-
return
|
|
2977
|
+
return o;
|
|
2974
2978
|
}
|
|
2975
2979
|
const xn = {
|
|
2976
2980
|
listBriefings: Or,
|
|
@@ -2983,83 +2987,83 @@ const xn = {
|
|
|
2983
2987
|
function vn({
|
|
2984
2988
|
briefingId: t,
|
|
2985
2989
|
initialRun: a,
|
|
2986
|
-
apiServiceUrl:
|
|
2987
|
-
token:
|
|
2988
|
-
onTerminal:
|
|
2989
|
-
onTimeout:
|
|
2990
|
-
onExpand:
|
|
2990
|
+
apiServiceUrl: o,
|
|
2991
|
+
token: n,
|
|
2992
|
+
onTerminal: i,
|
|
2993
|
+
onTimeout: s,
|
|
2994
|
+
onExpand: d
|
|
2991
2995
|
}) {
|
|
2992
|
-
const [
|
|
2993
|
-
apiServiceUrl:
|
|
2994
|
-
token:
|
|
2996
|
+
const [p, l] = E(a), { startRun: u } = Kr({
|
|
2997
|
+
apiServiceUrl: o,
|
|
2998
|
+
token: n,
|
|
2995
2999
|
intervalMs: hn,
|
|
2996
3000
|
timeoutMs: mn,
|
|
2997
3001
|
fetchRun: ({
|
|
2998
|
-
apiServiceUrl:
|
|
3002
|
+
apiServiceUrl: m,
|
|
2999
3003
|
token: h,
|
|
3000
|
-
runId:
|
|
3001
|
-
}) => qr(
|
|
3002
|
-
onRun: (
|
|
3003
|
-
l(
|
|
3004
|
+
runId: f
|
|
3005
|
+
}) => qr(m, h, t, f),
|
|
3006
|
+
onRun: (m) => {
|
|
3007
|
+
l(m);
|
|
3004
3008
|
},
|
|
3005
|
-
onTerminalRun: (
|
|
3006
|
-
|
|
3009
|
+
onTerminalRun: (m) => {
|
|
3010
|
+
i(m);
|
|
3007
3011
|
},
|
|
3008
3012
|
onTimeout: () => {
|
|
3009
|
-
|
|
3013
|
+
s();
|
|
3010
3014
|
}
|
|
3011
|
-
}),
|
|
3012
|
-
return
|
|
3013
|
-
|
|
3014
|
-
}, [a,
|
|
3015
|
+
}), c = he(!1);
|
|
3016
|
+
return Q(() => {
|
|
3017
|
+
c.current || (c.current = !0, Xr(a.status) ? u(a) : Zr(a.status) && i(a));
|
|
3018
|
+
}, [a, i, u]), /* @__PURE__ */ e(Qr, { run: p, onExpand: d });
|
|
3015
3019
|
}
|
|
3016
|
-
function
|
|
3020
|
+
function Qn(t) {
|
|
3017
3021
|
return /* @__PURE__ */ e(Br, { children: /* @__PURE__ */ e(yn, { ...t }) });
|
|
3018
3022
|
}
|
|
3019
3023
|
function yn({
|
|
3020
3024
|
dashboardId: t,
|
|
3021
3025
|
dashboardTitle: a,
|
|
3022
|
-
apiServiceUrl:
|
|
3023
|
-
token:
|
|
3024
|
-
disabled:
|
|
3025
|
-
className:
|
|
3026
|
-
manageBriefingsHref:
|
|
3027
|
-
open:
|
|
3026
|
+
apiServiceUrl: o,
|
|
3027
|
+
token: n,
|
|
3028
|
+
disabled: i,
|
|
3029
|
+
className: s,
|
|
3030
|
+
manageBriefingsHref: d,
|
|
3031
|
+
open: p,
|
|
3028
3032
|
onOpenChange: l,
|
|
3029
|
-
hideTrigger:
|
|
3030
|
-
workflowIntent:
|
|
3031
|
-
client:
|
|
3033
|
+
hideTrigger: u = !1,
|
|
3034
|
+
workflowIntent: c,
|
|
3035
|
+
client: m
|
|
3032
3036
|
}) {
|
|
3033
|
-
const { authToken: h, tokenProps:
|
|
3034
|
-
|
|
3035
|
-
}, [S,
|
|
3036
|
-
|
|
3037
|
-
), [U,
|
|
3038
|
-
|
|
3039
|
-
), [
|
|
3037
|
+
const { authToken: h, tokenProps: f } = He(), x = Tr(), C = !c || x.canCreate && (c === "scheduled_report" || x.analyticalBriefingsEnabled), [N, I] = E(!1), D = p ?? N, b = (w) => {
|
|
3038
|
+
p === void 0 && I(w), l == null || l(w);
|
|
3039
|
+
}, [S, A] = E(
|
|
3040
|
+
c ? "author" : "list"
|
|
3041
|
+
), [U, g] = E(
|
|
3042
|
+
c ?? "analytical_briefing"
|
|
3043
|
+
), [v, T] = E("dashboard"), [F, H] = E(
|
|
3040
3044
|
[]
|
|
3041
|
-
), [
|
|
3045
|
+
), [k, V] = E(null), $ = c && !C && !k ? "list" : S, [xe, re] = E(!1), [oe, Ie] = E(null), [Fe, ie] = E(null), [j, Y] = E(
|
|
3042
3046
|
null
|
|
3043
|
-
), [
|
|
3044
|
-
|
|
3045
|
-
const w =
|
|
3046
|
-
|
|
3047
|
-
}, [
|
|
3048
|
-
const [
|
|
3047
|
+
), [le, J] = E(null), Le = he(null), ve = he(D);
|
|
3048
|
+
Q(() => {
|
|
3049
|
+
const w = D && !ve.current;
|
|
3050
|
+
ve.current = D, !(!w || !c) && (V(null), T("dashboard"), g(c), A("author"), J(null));
|
|
3051
|
+
}, [D, c]);
|
|
3052
|
+
const [de, me] = E(
|
|
3049
3053
|
null
|
|
3050
|
-
), [
|
|
3054
|
+
), [Z, ye] = E(null), _ = o ?? (f == null ? void 0 : f.apiServiceUrl), z = n ?? (h == null ? void 0 : h.accessToken), ne = ee(() => ({ ...xn, ...m }), [m]), pe = pn(a), Be = ee(() => {
|
|
3051
3055
|
const w = gn(
|
|
3052
3056
|
F,
|
|
3053
|
-
|
|
3057
|
+
v,
|
|
3054
3058
|
t
|
|
3055
3059
|
);
|
|
3056
|
-
if (!
|
|
3060
|
+
if (!c)
|
|
3057
3061
|
return w;
|
|
3058
|
-
const R =
|
|
3062
|
+
const R = c === "scheduled_report" ? "report" : "briefing";
|
|
3059
3063
|
return w.filter(
|
|
3060
|
-
(
|
|
3064
|
+
(Te) => se(Te).noun === R
|
|
3061
3065
|
);
|
|
3062
|
-
}, [t, F,
|
|
3066
|
+
}, [t, F, v, c]), Ke = ee(() => v === "dashboard" ? {
|
|
3063
3067
|
source: { type: "dashboard", dashboardId: t },
|
|
3064
3068
|
label: pe,
|
|
3065
3069
|
detail: fn(pe)
|
|
@@ -3067,167 +3071,167 @@ function yn({
|
|
|
3067
3071
|
source: { type: "project" },
|
|
3068
3072
|
label: "This project",
|
|
3069
3073
|
detail: "Use any data in this project."
|
|
3070
|
-
}, [t, pe,
|
|
3071
|
-
canCreate:
|
|
3072
|
-
analyticalBriefingsEnabled:
|
|
3073
|
-
scheduledReportAvailable:
|
|
3074
|
-
}),
|
|
3075
|
-
if (!(!_ ||
|
|
3076
|
-
|
|
3074
|
+
}, [t, pe, v]), Ce = !!(_ && z), we = ga({
|
|
3075
|
+
canCreate: x.canCreate,
|
|
3076
|
+
analyticalBriefingsEnabled: x.analyticalBriefingsEnabled,
|
|
3077
|
+
scheduledReportAvailable: v === "dashboard"
|
|
3078
|
+
}), X = K(async () => {
|
|
3079
|
+
if (!(!_ || !z)) {
|
|
3080
|
+
re(!0), J(null);
|
|
3077
3081
|
try {
|
|
3078
3082
|
H(
|
|
3079
3083
|
await bn({
|
|
3080
3084
|
apiClient: ne,
|
|
3081
3085
|
apiServiceUrl: _,
|
|
3082
|
-
token:
|
|
3086
|
+
token: z
|
|
3083
3087
|
})
|
|
3084
3088
|
);
|
|
3085
3089
|
} catch (w) {
|
|
3086
|
-
|
|
3090
|
+
J(
|
|
3087
3091
|
w instanceof Error ? w.message : "Could not load briefings."
|
|
3088
3092
|
);
|
|
3089
3093
|
} finally {
|
|
3090
|
-
|
|
3094
|
+
re(!1);
|
|
3091
3095
|
}
|
|
3092
3096
|
}
|
|
3093
|
-
}, [ne, _,
|
|
3094
|
-
|
|
3095
|
-
!
|
|
3096
|
-
}, [
|
|
3097
|
-
const
|
|
3098
|
-
V(null), T("dashboard"),
|
|
3099
|
-
},
|
|
3100
|
-
V(null),
|
|
3101
|
-
},
|
|
3102
|
-
if (!(!_ ||
|
|
3103
|
-
|
|
3097
|
+
}, [ne, _, z]);
|
|
3098
|
+
Q(() => {
|
|
3099
|
+
!D || $ !== "list" || !Ce || X();
|
|
3100
|
+
}, [Ce, $, X, D]);
|
|
3101
|
+
const Ne = () => {
|
|
3102
|
+
V(null), T("dashboard"), A("list"), b(!0);
|
|
3103
|
+
}, y = (w) => {
|
|
3104
|
+
V(null), g(w), A("author");
|
|
3105
|
+
}, L = async (w) => {
|
|
3106
|
+
if (!(!_ || !z)) {
|
|
3107
|
+
Ie(w), J(null);
|
|
3104
3108
|
try {
|
|
3105
3109
|
const R = await ne.getBriefing(
|
|
3106
3110
|
_,
|
|
3107
|
-
|
|
3111
|
+
z,
|
|
3108
3112
|
w
|
|
3109
3113
|
);
|
|
3110
|
-
V(R.briefing),
|
|
3114
|
+
V(R.briefing), A("author");
|
|
3111
3115
|
} catch (R) {
|
|
3112
|
-
|
|
3116
|
+
J(
|
|
3113
3117
|
R instanceof Error ? R.message : "Could not open briefing."
|
|
3114
3118
|
);
|
|
3115
3119
|
} finally {
|
|
3116
|
-
|
|
3120
|
+
Ie(null);
|
|
3117
3121
|
}
|
|
3118
3122
|
}
|
|
3119
|
-
},
|
|
3120
|
-
if (!(!_ ||
|
|
3121
|
-
|
|
3123
|
+
}, M = async (w) => {
|
|
3124
|
+
if (!(!_ || !z)) {
|
|
3125
|
+
ie(w.id);
|
|
3122
3126
|
try {
|
|
3123
3127
|
await ne.runBriefingNow(
|
|
3124
3128
|
_,
|
|
3125
|
-
|
|
3129
|
+
z,
|
|
3126
3130
|
w.id,
|
|
3127
3131
|
{ requestId: Cn() }
|
|
3128
|
-
),
|
|
3132
|
+
), X();
|
|
3129
3133
|
} catch (R) {
|
|
3130
3134
|
O.error(
|
|
3131
3135
|
R instanceof Error ? R.message : "Could not start the run."
|
|
3132
3136
|
);
|
|
3133
3137
|
} finally {
|
|
3134
|
-
|
|
3138
|
+
ie(null);
|
|
3135
3139
|
}
|
|
3136
3140
|
}
|
|
3137
|
-
},
|
|
3138
|
-
if (!_ ||
|
|
3139
|
-
const { noun: R } = se(w),
|
|
3140
|
-
|
|
3141
|
+
}, ae = async (w) => {
|
|
3142
|
+
if (!_ || !z) return;
|
|
3143
|
+
const { noun: R } = se(w), Te = R === "report" ? "Report" : "Briefing";
|
|
3144
|
+
ie(w.id);
|
|
3141
3145
|
try {
|
|
3142
|
-
const
|
|
3146
|
+
const Ve = w.status === "PAUSED" ? await ne.resumeBriefing(
|
|
3143
3147
|
_,
|
|
3144
|
-
|
|
3148
|
+
z,
|
|
3145
3149
|
w.id
|
|
3146
3150
|
) : await ne.pauseBriefing(
|
|
3147
3151
|
_,
|
|
3148
|
-
|
|
3152
|
+
z,
|
|
3149
3153
|
w.id
|
|
3150
3154
|
);
|
|
3151
3155
|
O.success(
|
|
3152
|
-
|
|
3153
|
-
),
|
|
3154
|
-
} catch (
|
|
3156
|
+
Ve.briefing.status === "PAUSED" ? `${Te} paused` : `${Te} resumed`
|
|
3157
|
+
), X();
|
|
3158
|
+
} catch (Ve) {
|
|
3155
3159
|
O.error(
|
|
3156
|
-
|
|
3160
|
+
Ve instanceof Error ? Ve.message : `Could not update the ${R} status.`
|
|
3157
3161
|
);
|
|
3158
3162
|
} finally {
|
|
3159
|
-
|
|
3163
|
+
ie(null);
|
|
3160
3164
|
}
|
|
3161
|
-
},
|
|
3162
|
-
if (!
|
|
3163
|
-
const w =
|
|
3164
|
-
|
|
3165
|
+
}, ce = async () => {
|
|
3166
|
+
if (!j || !_ || !z) return;
|
|
3167
|
+
const w = j;
|
|
3168
|
+
ie(w.id);
|
|
3165
3169
|
try {
|
|
3166
3170
|
await ne.deleteBriefing(
|
|
3167
3171
|
_,
|
|
3168
|
-
|
|
3172
|
+
z,
|
|
3169
3173
|
w.id
|
|
3170
3174
|
);
|
|
3171
3175
|
const { noun: R } = se(w);
|
|
3172
|
-
O.success(`${R === "report" ? "Report" : "Briefing"} deleted`),
|
|
3176
|
+
O.success(`${R === "report" ? "Report" : "Briefing"} deleted`), Y(null), X();
|
|
3173
3177
|
} catch (R) {
|
|
3174
3178
|
O.error(
|
|
3175
3179
|
R instanceof Error ? R.message : "Could not delete the briefing."
|
|
3176
3180
|
);
|
|
3177
3181
|
} finally {
|
|
3178
|
-
|
|
3182
|
+
ie(null);
|
|
3179
3183
|
}
|
|
3180
|
-
},
|
|
3181
|
-
return
|
|
3182
|
-
|
|
3184
|
+
}, jt = Be.length;
|
|
3185
|
+
return x.surfaceVisible ? /* @__PURE__ */ r(_r, { open: D, onOpenChange: b, children: [
|
|
3186
|
+
u ? null : /* @__PURE__ */ e(
|
|
3183
3187
|
Ja,
|
|
3184
3188
|
{
|
|
3185
|
-
disabled:
|
|
3186
|
-
briefingCount:
|
|
3187
|
-
className:
|
|
3188
|
-
onClick:
|
|
3189
|
+
disabled: i || !Ce,
|
|
3190
|
+
briefingCount: jt,
|
|
3191
|
+
className: s,
|
|
3192
|
+
onClick: Ne
|
|
3189
3193
|
}
|
|
3190
3194
|
),
|
|
3191
3195
|
/* @__PURE__ */ r(
|
|
3192
|
-
|
|
3196
|
+
zr,
|
|
3193
3197
|
{
|
|
3194
|
-
ref:
|
|
3198
|
+
ref: Le,
|
|
3195
3199
|
side: "right",
|
|
3196
3200
|
hideClose: !0,
|
|
3197
3201
|
className: "flex h-full w-full flex-col overflow-hidden p-0 outline-none sm:max-w-[560px]",
|
|
3198
3202
|
onOpenAutoFocus: (w) => {
|
|
3199
3203
|
var R;
|
|
3200
|
-
w.preventDefault(), (R =
|
|
3204
|
+
w.preventDefault(), (R = Le.current) == null || R.focus({ preventScroll: !0 });
|
|
3201
3205
|
},
|
|
3202
3206
|
children: [
|
|
3203
3207
|
/* @__PURE__ */ r($r, { className: "sr-only", children: [
|
|
3204
3208
|
/* @__PURE__ */ e(jr, { children: "Reports & briefings" }),
|
|
3205
3209
|
/* @__PURE__ */ e(Wr, { children: "Manage reports and briefings for this dashboard." })
|
|
3206
3210
|
] }),
|
|
3207
|
-
|
|
3211
|
+
c ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
|
|
3208
3212
|
/* @__PURE__ */ r(
|
|
3209
3213
|
"div",
|
|
3210
3214
|
{
|
|
3211
3215
|
className: "flex items-center gap-5",
|
|
3212
3216
|
role: "tablist",
|
|
3213
|
-
"aria-label":
|
|
3217
|
+
"aria-label": c === "scheduled_report" ? "Email report workflow" : "Analytical briefing workflow",
|
|
3214
3218
|
children: [
|
|
3215
3219
|
/* @__PURE__ */ e(
|
|
3216
3220
|
"button",
|
|
3217
3221
|
{
|
|
3218
3222
|
type: "button",
|
|
3219
3223
|
role: "tab",
|
|
3220
|
-
"aria-selected":
|
|
3221
|
-
disabled: !
|
|
3222
|
-
className:
|
|
3224
|
+
"aria-selected": $ === "author",
|
|
3225
|
+
disabled: !C,
|
|
3226
|
+
className: q(
|
|
3223
3227
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3224
|
-
|
|
3225
|
-
!
|
|
3228
|
+
$ === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
|
|
3229
|
+
!C && "cursor-not-allowed opacity-50"
|
|
3226
3230
|
),
|
|
3227
3231
|
onClick: () => {
|
|
3228
|
-
|
|
3232
|
+
C && (V(null), g(c), T("dashboard"), A("author"));
|
|
3229
3233
|
},
|
|
3230
|
-
children:
|
|
3234
|
+
children: k ? `Edit ${se(k).noun}` : c === "scheduled_report" ? "Schedule report" : "Create briefing"
|
|
3231
3235
|
}
|
|
3232
3236
|
),
|
|
3233
3237
|
/* @__PURE__ */ e(
|
|
@@ -3235,13 +3239,13 @@ function yn({
|
|
|
3235
3239
|
{
|
|
3236
3240
|
type: "button",
|
|
3237
3241
|
role: "tab",
|
|
3238
|
-
"aria-selected":
|
|
3239
|
-
className:
|
|
3242
|
+
"aria-selected": $ === "list",
|
|
3243
|
+
className: q(
|
|
3240
3244
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
3241
|
-
|
|
3245
|
+
$ === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
3242
3246
|
),
|
|
3243
|
-
onClick: () =>
|
|
3244
|
-
children:
|
|
3247
|
+
onClick: () => A("list"),
|
|
3248
|
+
children: c === "scheduled_report" ? "Manage reports" : "Manage briefings"
|
|
3245
3249
|
}
|
|
3246
3250
|
)
|
|
3247
3251
|
]
|
|
@@ -3251,147 +3255,147 @@ function yn({
|
|
|
3251
3255
|
"button",
|
|
3252
3256
|
{
|
|
3253
3257
|
type: "button",
|
|
3254
|
-
onClick: () =>
|
|
3258
|
+
onClick: () => b(!1),
|
|
3255
3259
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3256
|
-
"aria-label":
|
|
3257
|
-
children: /* @__PURE__ */ e(
|
|
3260
|
+
"aria-label": c === "scheduled_report" ? "Close email report workflow" : "Close analytical briefing workflow",
|
|
3261
|
+
children: /* @__PURE__ */ e(Ge, { className: "h-3.5 w-3.5" })
|
|
3258
3262
|
}
|
|
3259
3263
|
)
|
|
3260
3264
|
] }) : null,
|
|
3261
|
-
|
|
3265
|
+
$ === "list" ? /* @__PURE__ */ e(
|
|
3262
3266
|
ln,
|
|
3263
3267
|
{
|
|
3264
|
-
briefings:
|
|
3268
|
+
briefings: Be,
|
|
3265
3269
|
dashboardLabel: pe,
|
|
3266
|
-
sourceView:
|
|
3267
|
-
error:
|
|
3270
|
+
sourceView: v,
|
|
3271
|
+
error: le,
|
|
3268
3272
|
loading: xe,
|
|
3269
3273
|
onSourceViewChange: T,
|
|
3270
|
-
onClose: () =>
|
|
3274
|
+
onClose: () => b(!1),
|
|
3271
3275
|
onEdit: (w) => {
|
|
3272
|
-
|
|
3276
|
+
L(w);
|
|
3273
3277
|
},
|
|
3274
|
-
onNew:
|
|
3275
|
-
canCreate: !
|
|
3276
|
-
canCreateScheduledReport:
|
|
3278
|
+
onNew: y,
|
|
3279
|
+
canCreate: !c && we.length > 0,
|
|
3280
|
+
canCreateScheduledReport: we.includes(
|
|
3277
3281
|
"scheduled_report"
|
|
3278
3282
|
),
|
|
3279
|
-
analyticalBriefingsEnabled:
|
|
3283
|
+
analyticalBriefingsEnabled: we.includes(
|
|
3280
3284
|
"analytical_briefing"
|
|
3281
3285
|
),
|
|
3282
3286
|
onRunNow: (w) => {
|
|
3283
|
-
|
|
3287
|
+
M(w);
|
|
3284
3288
|
},
|
|
3285
3289
|
onTogglePause: (w) => {
|
|
3286
|
-
|
|
3290
|
+
ae(w);
|
|
3287
3291
|
},
|
|
3288
|
-
onDelete: (w) =>
|
|
3289
|
-
selectingId:
|
|
3290
|
-
busyId:
|
|
3291
|
-
manageBriefingsHref:
|
|
3292
|
-
contentKind:
|
|
3293
|
-
hideHeader: !!
|
|
3292
|
+
onDelete: (w) => Y(w),
|
|
3293
|
+
selectingId: oe,
|
|
3294
|
+
busyId: Fe,
|
|
3295
|
+
manageBriefingsHref: d,
|
|
3296
|
+
contentKind: c === "scheduled_report" ? "reports" : c === "analytical_briefing" ? "briefings" : void 0,
|
|
3297
|
+
hideHeader: !!c
|
|
3294
3298
|
}
|
|
3295
3299
|
) : /* @__PURE__ */ e(
|
|
3296
3300
|
Hr,
|
|
3297
3301
|
{
|
|
3298
3302
|
apiServiceUrl: _,
|
|
3299
|
-
token:
|
|
3300
|
-
briefing:
|
|
3303
|
+
token: z,
|
|
3304
|
+
briefing: k,
|
|
3301
3305
|
intent: U,
|
|
3302
|
-
sourceContext:
|
|
3303
|
-
title:
|
|
3304
|
-
hideHeader: !!
|
|
3306
|
+
sourceContext: k ? void 0 : Ke,
|
|
3307
|
+
title: k ? `Edit ${se(k).noun}` : U === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
|
|
3308
|
+
hideHeader: !!c,
|
|
3305
3309
|
className: "h-full min-h-0 max-w-none border-0 shadow-none",
|
|
3306
|
-
onBack:
|
|
3307
|
-
onCancel: () =>
|
|
3310
|
+
onBack: c ? void 0 : () => A("list"),
|
|
3311
|
+
onCancel: () => b(!1),
|
|
3308
3312
|
onDeleted: () => {
|
|
3309
|
-
const w =
|
|
3310
|
-
O.success(`${w === "report" ? "Report" : "Briefing"} deleted`), V(null),
|
|
3313
|
+
const w = k ? se(k).noun : "briefing";
|
|
3314
|
+
O.success(`${w === "report" ? "Report" : "Briefing"} deleted`), V(null), A("list"), X();
|
|
3311
3315
|
},
|
|
3312
3316
|
onRunStarted: () => {
|
|
3313
3317
|
},
|
|
3314
3318
|
onSaved: (w) => {
|
|
3315
|
-
V(w),
|
|
3319
|
+
V(w), X();
|
|
3316
3320
|
},
|
|
3317
3321
|
onMinimizeRun: ({ briefing: w, run: R }) => {
|
|
3318
|
-
me({ briefing: w, run: R }),
|
|
3322
|
+
me({ briefing: w, run: R }), b(!1);
|
|
3319
3323
|
}
|
|
3320
3324
|
}
|
|
3321
3325
|
)
|
|
3322
3326
|
]
|
|
3323
3327
|
}
|
|
3324
3328
|
),
|
|
3325
|
-
|
|
3329
|
+
de && _ && z ? /* @__PURE__ */ e(
|
|
3326
3330
|
vn,
|
|
3327
3331
|
{
|
|
3328
|
-
briefingId:
|
|
3329
|
-
initialRun:
|
|
3332
|
+
briefingId: de.briefing.id,
|
|
3333
|
+
initialRun: de.run,
|
|
3330
3334
|
apiServiceUrl: _,
|
|
3331
|
-
token:
|
|
3335
|
+
token: z,
|
|
3332
3336
|
onTerminal: (w) => {
|
|
3333
|
-
|
|
3334
|
-
briefing:
|
|
3337
|
+
ye({
|
|
3338
|
+
briefing: de.briefing,
|
|
3335
3339
|
run: w
|
|
3336
|
-
}), me(null),
|
|
3340
|
+
}), me(null), X();
|
|
3337
3341
|
},
|
|
3338
3342
|
onTimeout: () => {
|
|
3339
|
-
me(null),
|
|
3343
|
+
me(null), X();
|
|
3340
3344
|
},
|
|
3341
3345
|
onExpand: () => {
|
|
3342
|
-
V(
|
|
3346
|
+
V(de.briefing), A("author"), me(null), b(!0);
|
|
3343
3347
|
}
|
|
3344
3348
|
}
|
|
3345
3349
|
) : null,
|
|
3346
|
-
|
|
3350
|
+
Z ? /* @__PURE__ */ e("div", { className: "fixed bottom-4 right-4 z-50 w-[360px]", children: /* @__PURE__ */ e(
|
|
3347
3351
|
Gr,
|
|
3348
3352
|
{
|
|
3349
|
-
title:
|
|
3350
|
-
durationSeconds:
|
|
3353
|
+
title: Z.run.status === "SUCCESS" ? `${Z.briefing.name} is ready` : `${Z.briefing.name} run failed`,
|
|
3354
|
+
durationSeconds: Z.run.startedAt && Z.run.completedAt ? Math.max(
|
|
3351
3355
|
0,
|
|
3352
3356
|
Math.floor(
|
|
3353
|
-
(new Date(
|
|
3357
|
+
(new Date(Z.run.completedAt).getTime() - new Date(Z.run.startedAt).getTime()) / 1e3
|
|
3354
3358
|
)
|
|
3355
3359
|
) : null,
|
|
3356
|
-
status:
|
|
3360
|
+
status: Z.run.status === "SUCCESS" ? "success" : "failed",
|
|
3357
3361
|
onView: () => {
|
|
3358
|
-
V(
|
|
3362
|
+
V(Z.briefing), A("author"), ye(null), b(!0);
|
|
3359
3363
|
},
|
|
3360
|
-
onDismiss: () =>
|
|
3364
|
+
onDismiss: () => ye(null)
|
|
3361
3365
|
}
|
|
3362
3366
|
) }) : null,
|
|
3363
3367
|
/* @__PURE__ */ e(
|
|
3364
|
-
|
|
3368
|
+
tt,
|
|
3365
3369
|
{
|
|
3366
|
-
open: !!
|
|
3370
|
+
open: !!j,
|
|
3367
3371
|
onOpenChange: (w) => {
|
|
3368
|
-
w ||
|
|
3372
|
+
w || Y(null);
|
|
3369
3373
|
},
|
|
3370
|
-
children: /* @__PURE__ */ r(
|
|
3371
|
-
/* @__PURE__ */ r(
|
|
3372
|
-
/* @__PURE__ */ r(
|
|
3374
|
+
children: /* @__PURE__ */ r(rt, { children: [
|
|
3375
|
+
/* @__PURE__ */ r(at, { children: [
|
|
3376
|
+
/* @__PURE__ */ r(nt, { children: [
|
|
3373
3377
|
"Delete",
|
|
3374
3378
|
" ",
|
|
3375
|
-
|
|
3379
|
+
j ? se(j).noun : "briefing",
|
|
3376
3380
|
"?"
|
|
3377
3381
|
] }),
|
|
3378
|
-
/* @__PURE__ */ r(
|
|
3382
|
+
/* @__PURE__ */ r(st, { children: [
|
|
3379
3383
|
"This permanently deletes ",
|
|
3380
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3384
|
+
/* @__PURE__ */ e("strong", { children: j == null ? void 0 : j.name }),
|
|
3381
3385
|
". Recipients will stop receiving it."
|
|
3382
3386
|
] })
|
|
3383
3387
|
] }),
|
|
3384
|
-
/* @__PURE__ */ r(
|
|
3385
|
-
/* @__PURE__ */ e(
|
|
3388
|
+
/* @__PURE__ */ r(ot, { children: [
|
|
3389
|
+
/* @__PURE__ */ e(it, { children: "Cancel" }),
|
|
3386
3390
|
/* @__PURE__ */ r(
|
|
3387
|
-
|
|
3391
|
+
St,
|
|
3388
3392
|
{
|
|
3389
3393
|
className: "bg-destructive/90 hover:bg-destructive",
|
|
3390
|
-
onClick:
|
|
3394
|
+
onClick: ce,
|
|
3391
3395
|
children: [
|
|
3392
3396
|
"Delete",
|
|
3393
3397
|
" ",
|
|
3394
|
-
|
|
3398
|
+
j ? se(j).noun : "briefing"
|
|
3395
3399
|
]
|
|
3396
3400
|
}
|
|
3397
3401
|
)
|
|
@@ -3405,19 +3409,19 @@ function Cn() {
|
|
|
3405
3409
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `briefing-run-now-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
3406
3410
|
}
|
|
3407
3411
|
export {
|
|
3408
|
-
|
|
3409
|
-
|
|
3412
|
+
Hn as A,
|
|
3413
|
+
za as D,
|
|
3410
3414
|
Oa as E,
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3415
|
+
Xn as N,
|
|
3416
|
+
Gn as U,
|
|
3417
|
+
jn as V,
|
|
3414
3418
|
Ja as W,
|
|
3415
|
-
|
|
3419
|
+
Wn as a,
|
|
3416
3420
|
Ma as b,
|
|
3417
|
-
|
|
3421
|
+
qn as c,
|
|
3418
3422
|
ja as d,
|
|
3419
3423
|
qa as e,
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3424
|
+
Zn as f,
|
|
3425
|
+
Qn as g,
|
|
3426
|
+
Kn as u
|
|
3423
3427
|
};
|