react-semaphor 0.1.538 → 0.1.540
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/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +63 -54
- package/dist/brand-studio/index.js +1 -1
- package/dist/chunks/add-to-dashboard-BuAqfA2Y.js +80 -0
- package/dist/chunks/{aggregate-table-row-presentation-Qgpv6_G8.js → aggregate-table-row-presentation-BjK9YfMI.js} +1 -1
- package/dist/chunks/{assistant-chat-BAqUIFp5.js → assistant-chat-ya7xopaC.js} +2700 -2363
- package/dist/chunks/{context-HD9usB1P.js → context-ClREvqCZ.js} +101 -102
- package/dist/chunks/{dashboard-DTDDFQsS.js → dashboard-B6Bithfl.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Bb2QUqOa.js → dashboard-briefing-launcher-DJI-zfEq.js} +364 -364
- package/dist/chunks/{dashboard-controls-FpONU8QV.js → dashboard-controls-Dh7HqoKy.js} +7 -7
- package/dist/chunks/{dashboard-json-DazPhBU_.js → dashboard-json-BnmlB71h.js} +2 -2
- package/dist/chunks/{document-dashboard-inputs-D96rlU7S.js → document-dashboard-inputs-BrYYlRVo.js} +9 -9
- package/dist/chunks/{edit-dashboard-visual-CIhZodVH.js → edit-dashboard-visual-CydOkSko.js} +6 -6
- package/dist/chunks/{matrix-formatter-Bgw32tb3.js → matrix-formatter-DQ8avoIQ.js} +8 -8
- package/dist/chunks/report-preferences-dialog-neMDolLg.js +1950 -0
- package/dist/chunks/{saved-dashboard-context-BrTkjcod.js → saved-dashboard-context-CCrLpfSQ.js} +2 -2
- package/dist/chunks/{semaphor-ready-indicator-CHHoWhil.js → semaphor-ready-indicator--4DWtVBu.js} +23779 -23712
- package/dist/chunks/{shelf-drop-preview-context-EsayECEC.js → shelf-drop-preview-context-CpdB5ois.js} +3 -3
- package/dist/chunks/{switch-CvItuC1Q.js → switch-DWEWiv1J.js} +53 -52
- package/dist/chunks/{use-create-flow-overlay-state-BqA92GkX.js → use-create-flow-overlay-state-8g6Zhphh.js} +3 -3
- package/dist/dashboard/index.js +1 -1
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.js +2 -2
- package/dist/index.js +10 -10
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/components/assistant/assistant-entry-points.d.ts +3 -0
- package/dist/types/components/assistant/assistant-store.d.ts +49 -1
- package/dist/types/components/assistant/use-assistant.d.ts +10 -1
- package/dist/types/lib/hooks/use-filter-option-browse.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +2 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +88 -66
- package/dist/types/shared/assistant-protocol/conversation.d.ts +3 -0
- package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
- package/dist/types/shared/assistant-protocol/limits.d.ts +2 -0
- package/dist/types/shared/assistant-protocol/parts.d.ts +17 -8
- package/dist/types/shared/assistant-protocol/request.d.ts +6 -1
- package/dist/types/shared/assistant-protocol/tagged-fields.d.ts +29 -0
- package/package.json +2 -1
- package/dist/chunks/add-to-dashboard-CxtTfISD.js +0 -56
- package/dist/chunks/report-preferences-dialog-BCGs4-AE.js +0 -1808
|
@@ -2,28 +2,28 @@ import { jsx as t, jsxs as i, Fragment as $ } from "react/jsx-runtime";
|
|
|
2
2
|
import * as ue from "react";
|
|
3
3
|
import _t, { useState as F, useEffect as J, useCallback as j, useMemo as oe, useLayoutEffect as Pt, useRef as ge, useContext as pr } from "react";
|
|
4
4
|
import { u as V, v as Tt, s as fr } from "./custom-visual-inputs-BrUOIwln.js";
|
|
5
|
-
import { B as U, l as Le, q as
|
|
6
|
-
import {
|
|
5
|
+
import { B as U, l as Le, q as dt, L as ie, j as Ot, c as ut, i as gr, Z as br, P as qe, a as He, b as Ge, S as $t } from "./switch-DWEWiv1J.js";
|
|
6
|
+
import { cr as ht, bu as Ue, bv as Ve, bx as Re, cs as vr, ct as xr, aX as Be, aV as Je, cu as yr, cv as et, cw as mt, _ as tt, X as pe, u as T, cx as Cr, cy as wr, cz as Nr, Z as ee, b6 as Sr, cA as Dr, cB as Er, aR as Se, cg as zt, aI as Qe, l as kr, h as Ar, cC as Ir, cj as pt, ck as ft, cl as gt, cm as bt, cn as vt, co as xt, cp as yt, cq as jt, aG as Ct, cD as Fr, cE as Pr, c8 as ot, c5 as rt, c6 as at, cF as Wt, c7 as nt, bR as X, ch as Tr, cf as Ke, cG as Lr, bP as Ur, bw as wt, by as Nt, cH as Vr, bt as Rr, cI as qt, cJ as St, cK as Br, bV as Mr, f as _r, cL as Or, J as xe, aB as Te, ax as Ht, ay as Xe, cM as G, K as Gt, aw as $r, cN as zr, aD as jr, R as Qt, cO as Wr, az as Lt, N as qr, cP as Hr, cQ as Gr, cR as Qr, cS as Kr, cT as Kt, cU as Xr, cV as Zr, cW as Yr, cX as Xt, cY as Jr, cZ as ze, c_ as ea, c$ as ta, d0 as ra, as as aa, at as na, a8 as sa, a7 as oa, a6 as ia, a5 as la, a2 as ca, a0 as da, d1 as ua, d2 as ha, d3 as ma, d4 as pa, d5 as fa, aq as ga, d6 as ba, d7 as va, ae as xa, d8 as ya, d9 as Ca, da as wa } from "./semaphor-ready-indicator--4DWtVBu.js";
|
|
7
7
|
import { L as Dt } from "./layout-grid-Bgzth8vd.js";
|
|
8
|
-
import { c as De, X as Me, C as
|
|
8
|
+
import { c as De, X as Me, C as Zt } from "./x-4f5U2XwU.js";
|
|
9
9
|
import "./index-CuHybtft.js";
|
|
10
10
|
import { t as Na } from "./validators-Ej1DdCXa.js";
|
|
11
11
|
import "./matrix-operation-contract-B8PBF1Gd.js";
|
|
12
12
|
import "./analytics-base-schemas-BFAoRlkU.js";
|
|
13
13
|
import "zod";
|
|
14
14
|
import "../value-format-preferences/index.js";
|
|
15
|
-
import { c as
|
|
15
|
+
import { c as Z } from "./class-utils-Df1OVOT1.js";
|
|
16
16
|
import { S as Sa } from "./selection-reducer-vKIb_jS6.js";
|
|
17
17
|
import { s as je } from "./normalize-dashboard-for-dirty-check-Bk3VYv_q.js";
|
|
18
18
|
import { f as Da } from "./editor-draft-sync-BN5qYHPF.js";
|
|
19
|
-
import {
|
|
19
|
+
import { ae as Ze, af as Ea, k as ka, ag as Aa, ah as Ia, ai as Fa, aj as Pa, ak as Ta } from "./document-dashboard-inputs-BrYYlRVo.js";
|
|
20
20
|
import "react-dom";
|
|
21
21
|
import "./pivot-result-lifecycle-8qCDmpKc.js";
|
|
22
22
|
import "./calculated-field-identity-DcBS2NPP.js";
|
|
23
23
|
import { o as La } from "./bookmark-state-k7y5SNGf.js";
|
|
24
|
-
import { S as
|
|
25
|
-
import { V as Ua, L as Va, a as Ra, u as Jt, C as er, F as Ba, b as Ma } from "./use-create-flow-overlay-state-
|
|
26
|
-
import {
|
|
24
|
+
import { S as Yt } from "./save-CfJpQQ68.js";
|
|
25
|
+
import { V as Ua, L as Va, a as Ra, u as Jt, C as er, F as Ba, b as Ma } from "./use-create-flow-overlay-state-8g6Zhphh.js";
|
|
26
|
+
import { o as Ut } from "./matrix-formatter-DQ8avoIQ.js";
|
|
27
27
|
import { t as _a } from "./document-sheet-utils-C1eEldxs.js";
|
|
28
28
|
import { g as me, d as Oa, a as $a } from "./index-CqMiAkay.js";
|
|
29
29
|
/**
|
|
@@ -96,7 +96,7 @@ const Ha = De("MousePointer2", [
|
|
|
96
96
|
* This source code is licensed under the ISC license.
|
|
97
97
|
* See the LICENSE file in the root directory of this source tree.
|
|
98
98
|
*/
|
|
99
|
-
const
|
|
99
|
+
const Ga = De("Newspaper", [
|
|
100
100
|
[
|
|
101
101
|
"path",
|
|
102
102
|
{
|
|
@@ -108,7 +108,7 @@ const Qa = De("Newspaper", [
|
|
|
108
108
|
["path", { d: "M15 18h-5", key: "95g1m2" }],
|
|
109
109
|
["path", { d: "M10 6h8v4h-8V6Z", key: "smlsk5" }]
|
|
110
110
|
]);
|
|
111
|
-
function
|
|
111
|
+
function Qa() {
|
|
112
112
|
return /* @__PURE__ */ t("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((e, r) => /* @__PURE__ */ i(
|
|
113
113
|
"div",
|
|
114
114
|
{
|
|
@@ -130,12 +130,12 @@ function Ka({
|
|
|
130
130
|
onSubmit: o,
|
|
131
131
|
isCreating: a
|
|
132
132
|
}) {
|
|
133
|
-
const n = ht("interactive"), [s,
|
|
133
|
+
const n = ht("interactive"), [s, d] = F(""), [c, l] = F("");
|
|
134
134
|
J(() => {
|
|
135
|
-
e || (
|
|
135
|
+
e || (d(""), l(""));
|
|
136
136
|
}, [e]);
|
|
137
137
|
const u = () => {
|
|
138
|
-
s.trim() && o({ title: s, description:
|
|
138
|
+
s.trim() && o({ title: s, description: c });
|
|
139
139
|
}, h = (p) => {
|
|
140
140
|
r(p);
|
|
141
141
|
};
|
|
@@ -172,13 +172,13 @@ function Ka({
|
|
|
172
172
|
/* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
|
|
173
173
|
/* @__PURE__ */ t(Le, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
|
|
174
174
|
/* @__PURE__ */ t(
|
|
175
|
-
|
|
175
|
+
dt,
|
|
176
176
|
{
|
|
177
177
|
id: "visual-title",
|
|
178
178
|
size: "sm",
|
|
179
179
|
placeholder: "Untitled visual",
|
|
180
180
|
value: s,
|
|
181
|
-
onChange: (p) =>
|
|
181
|
+
onChange: (p) => d(p.target.value),
|
|
182
182
|
disabled: a,
|
|
183
183
|
onKeyDown: (p) => {
|
|
184
184
|
p.key === "Enter" && !p.shiftKey && (p.preventDefault(), u());
|
|
@@ -189,12 +189,12 @@ function Ka({
|
|
|
189
189
|
/* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
|
|
190
190
|
/* @__PURE__ */ t(Le, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
|
|
191
191
|
/* @__PURE__ */ t(
|
|
192
|
-
|
|
192
|
+
dt,
|
|
193
193
|
{
|
|
194
194
|
id: "visual-description",
|
|
195
195
|
size: "sm",
|
|
196
196
|
placeholder: "Optional",
|
|
197
|
-
value:
|
|
197
|
+
value: c,
|
|
198
198
|
onChange: (p) => l(p.target.value),
|
|
199
199
|
disabled: a
|
|
200
200
|
}
|
|
@@ -261,14 +261,14 @@ function Xa(e) {
|
|
|
261
261
|
if (typeof u.useChartStore != "function")
|
|
262
262
|
throw new Error("useChartStore is not a function");
|
|
263
263
|
o(() => u.useChartStore), n(null);
|
|
264
|
-
} catch (
|
|
265
|
-
const l =
|
|
264
|
+
} catch (c) {
|
|
265
|
+
const l = c instanceof Error ? c.message : "Unknown error";
|
|
266
266
|
console.error("Failed to load remote chart store:", l), n(l), o(null);
|
|
267
267
|
}
|
|
268
268
|
})();
|
|
269
269
|
}, [e, s]), r;
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Za(e, r) {
|
|
272
272
|
if (e.length === 0)
|
|
273
273
|
return "";
|
|
274
274
|
const o = e.find(
|
|
@@ -286,17 +286,17 @@ function Ya(e, r) {
|
|
|
286
286
|
if (n == "All__Header")
|
|
287
287
|
return e[0].id;
|
|
288
288
|
if (n && n.endsWith("__Header")) {
|
|
289
|
-
const
|
|
290
|
-
(l) => l.tabTitle ===
|
|
289
|
+
const d = n.split("__")[0], c = e.find(
|
|
290
|
+
(l) => l.tabTitle === d
|
|
291
291
|
);
|
|
292
|
-
return
|
|
292
|
+
return c ? c.id : e[0].id;
|
|
293
293
|
}
|
|
294
294
|
return r;
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
return e[0].id;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function Ya(e, r) {
|
|
300
300
|
return r ? {
|
|
301
301
|
...e,
|
|
302
302
|
settings: r
|
|
@@ -333,8 +333,8 @@ function en(e, {
|
|
|
333
333
|
selectedSchemaName: a,
|
|
334
334
|
selectedDatamodelId: n,
|
|
335
335
|
selectedDatabaseName: s,
|
|
336
|
-
selectedTableName:
|
|
337
|
-
selectedConnectionId:
|
|
336
|
+
selectedTableName: d,
|
|
337
|
+
selectedConnectionId: c,
|
|
338
338
|
remoteChartSettings: l,
|
|
339
339
|
stripConfig: u
|
|
340
340
|
}) {
|
|
@@ -342,22 +342,22 @@ function en(e, {
|
|
|
342
342
|
return {
|
|
343
343
|
...e,
|
|
344
344
|
dataSource: Ja(e, {
|
|
345
|
-
selectedConnectionId:
|
|
345
|
+
selectedConnectionId: c,
|
|
346
346
|
selectedDatabaseName: s,
|
|
347
347
|
selectedSchemaName: a,
|
|
348
|
-
selectedTableName:
|
|
348
|
+
selectedTableName: d
|
|
349
349
|
}),
|
|
350
350
|
lastSelectedSchema: a,
|
|
351
351
|
lastSelectedDatamodelId: n,
|
|
352
352
|
lastSelectedDatabase: s,
|
|
353
|
-
lastSelectedTable:
|
|
354
|
-
connectionId:
|
|
353
|
+
lastSelectedTable: d,
|
|
354
|
+
connectionId: c || e.connectionId,
|
|
355
355
|
sql: h ? o || e.sql : void 0,
|
|
356
356
|
python: h ? e.python : void 0,
|
|
357
357
|
config: r || !e.config ? void 0 : u(e.config),
|
|
358
358
|
customCfg: e.customCfg,
|
|
359
359
|
preferences: e.preferences,
|
|
360
|
-
customCardPreferences:
|
|
360
|
+
customCardPreferences: Ya(
|
|
361
361
|
e.customCardPreferences,
|
|
362
362
|
l
|
|
363
363
|
)
|
|
@@ -372,11 +372,11 @@ const tn = (e) => {
|
|
|
372
372
|
async function Vt(e, r, o, a, n = "Opening library visual...") {
|
|
373
373
|
if (!r || !o)
|
|
374
374
|
throw new Error("Missing auth token or visual ID");
|
|
375
|
-
const s = ["resource-by-id", "visual", o],
|
|
376
|
-
if (
|
|
377
|
-
return console.log("Using cached visual data for:", o), { data:
|
|
375
|
+
const s = ["resource-by-id", "visual", o], d = a.getQueryData(s);
|
|
376
|
+
if (d)
|
|
377
|
+
return console.log("Using cached visual data for:", o), { data: d, fromCache: !0 };
|
|
378
378
|
console.log("Fetching visual data from network for:", o);
|
|
379
|
-
const
|
|
379
|
+
const c = V.loading(n, {
|
|
380
380
|
position: "top-center"
|
|
381
381
|
});
|
|
382
382
|
try {
|
|
@@ -391,9 +391,9 @@ async function Vt(e, r, o, a, n = "Opening library visual...") {
|
|
|
391
391
|
if (!l.ok)
|
|
392
392
|
throw new Error("Failed to load visual");
|
|
393
393
|
const u = await l.json();
|
|
394
|
-
return a.setQueryData(s, u), V.dismiss(
|
|
394
|
+
return a.setQueryData(s, u), V.dismiss(c), { data: u, fromCache: !1 };
|
|
395
395
|
} catch (l) {
|
|
396
|
-
throw V.dismiss(
|
|
396
|
+
throw V.dismiss(c), l;
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
399
|
function tr(e) {
|
|
@@ -404,15 +404,15 @@ function tr(e) {
|
|
|
404
404
|
throw new Error("Invalid frame object format");
|
|
405
405
|
}
|
|
406
406
|
function rn(e, r) {
|
|
407
|
-
var s,
|
|
407
|
+
var s, d;
|
|
408
408
|
const o = (e == null ? void 0 : e.frameObject) ?? ((s = e == null ? void 0 : e.visual) == null ? void 0 : s.frameObject);
|
|
409
409
|
if (!o)
|
|
410
410
|
return !1;
|
|
411
411
|
const a = tr(o);
|
|
412
412
|
if (!(a != null && a.cards) || a.cards.length === 0)
|
|
413
413
|
return !1;
|
|
414
|
-
const n = (
|
|
415
|
-
(
|
|
414
|
+
const n = (d = a.cards) == null ? void 0 : d.find(
|
|
415
|
+
(c) => c.id === a.activeCardId
|
|
416
416
|
);
|
|
417
417
|
return n ? (Nr({
|
|
418
418
|
...r,
|
|
@@ -435,16 +435,16 @@ function an() {
|
|
|
435
435
|
frame: a,
|
|
436
436
|
card: n,
|
|
437
437
|
isDevMode: s,
|
|
438
|
-
selectedSchemaName:
|
|
439
|
-
selectedDatamodelId:
|
|
438
|
+
selectedSchemaName: d,
|
|
439
|
+
selectedDatamodelId: c,
|
|
440
440
|
selectedDatabaseName: l,
|
|
441
441
|
selectedTableName: u,
|
|
442
442
|
selectedConnectionId: h
|
|
443
443
|
} = ee.getState(), p = n.sql, m = (b = r == null ? void 0 : r.getState()) == null ? void 0 : b.settings, g = en(n, {
|
|
444
444
|
isDevMode: s,
|
|
445
445
|
cardSql: p,
|
|
446
|
-
selectedSchemaName:
|
|
447
|
-
selectedDatamodelId:
|
|
446
|
+
selectedSchemaName: d,
|
|
447
|
+
selectedDatamodelId: c,
|
|
448
448
|
selectedDatabaseName: l,
|
|
449
449
|
selectedTableName: u,
|
|
450
450
|
selectedConnectionId: h,
|
|
@@ -456,14 +456,14 @@ function an() {
|
|
|
456
456
|
return {
|
|
457
457
|
...a,
|
|
458
458
|
cards: f,
|
|
459
|
-
activeCardId:
|
|
459
|
+
activeCardId: Za(f, a.activeCardId)
|
|
460
460
|
};
|
|
461
461
|
}, [r]) };
|
|
462
462
|
}
|
|
463
463
|
function Ee() {
|
|
464
464
|
const { authToken: e, tokenProps: r } = Be(), o = Je(), a = yr(), n = et(), { selectVisual: s } = mt(), {
|
|
465
|
-
setFrame:
|
|
466
|
-
setCard:
|
|
465
|
+
setFrame: d,
|
|
466
|
+
setCard: c,
|
|
467
467
|
setIsDevMode: l,
|
|
468
468
|
initializeModeDrafts: u,
|
|
469
469
|
setActiveTabCardId: h,
|
|
@@ -483,7 +483,7 @@ function Ee() {
|
|
|
483
483
|
setIsVisualEditing: S,
|
|
484
484
|
setSelectedFrameId: x,
|
|
485
485
|
clearSelectedFrameId: B
|
|
486
|
-
} = pe(), I = T((O) => O.selectedSheetId), W = T((O) => O.selectedFrameId), P = T((O) => O.dashboard), M = T((O) => O.filterValues),
|
|
486
|
+
} = pe(), I = T((O) => O.selectedSheetId), W = T((O) => O.selectedFrameId), P = T((O) => O.dashboard), M = T((O) => O.filterValues), Y = T(
|
|
487
487
|
(O) => O.inlineFilterValuesMap
|
|
488
488
|
), K = Cr((n == null ? void 0 : n.id) || "", {
|
|
489
489
|
enabled: !!(n != null && n.id) && !!(e != null && e.accessToken)
|
|
@@ -499,8 +499,8 @@ function Ee() {
|
|
|
499
499
|
"Opening library visual..."
|
|
500
500
|
);
|
|
501
501
|
if (!rn(te, {
|
|
502
|
-
setFrame:
|
|
503
|
-
setCard:
|
|
502
|
+
setFrame: d,
|
|
503
|
+
setCard: c,
|
|
504
504
|
setIsDevMode: l,
|
|
505
505
|
initializeModeDrafts: u,
|
|
506
506
|
setActiveTabCardId: h,
|
|
@@ -520,7 +520,7 @@ function Ee() {
|
|
|
520
520
|
selectedSheetId: I,
|
|
521
521
|
selectedFrameId: W,
|
|
522
522
|
filterValues: M,
|
|
523
|
-
inlineFilterValuesMap:
|
|
523
|
+
inlineFilterValuesMap: Y
|
|
524
524
|
}))
|
|
525
525
|
throw new Error("Failed to setup editor with visual data");
|
|
526
526
|
return { success: !0, fromCache: re };
|
|
@@ -533,8 +533,8 @@ function Ee() {
|
|
|
533
533
|
r.apiServiceUrl,
|
|
534
534
|
o,
|
|
535
535
|
s,
|
|
536
|
-
c,
|
|
537
536
|
d,
|
|
537
|
+
c,
|
|
538
538
|
w,
|
|
539
539
|
S,
|
|
540
540
|
l,
|
|
@@ -556,9 +556,9 @@ function Ee() {
|
|
|
556
556
|
I,
|
|
557
557
|
W,
|
|
558
558
|
M,
|
|
559
|
-
|
|
559
|
+
Y
|
|
560
560
|
]
|
|
561
|
-
),
|
|
561
|
+
), ce = j(
|
|
562
562
|
async (O) => {
|
|
563
563
|
var re;
|
|
564
564
|
const te = (L) => (V.error(L), { success: !1, error: L });
|
|
@@ -574,11 +574,11 @@ function Ee() {
|
|
|
574
574
|
), le = (L == null ? void 0 : L.frameObject) ?? ((re = L == null ? void 0 : L.visual) == null ? void 0 : re.frameObject);
|
|
575
575
|
if (!le)
|
|
576
576
|
return te("Visual has no frame data");
|
|
577
|
-
const
|
|
578
|
-
if (!(
|
|
577
|
+
const Q = tr(le);
|
|
578
|
+
if (!(Q != null && Q.cards) || Q.cards.length === 0)
|
|
579
579
|
return te("Visual frame is malformed");
|
|
580
580
|
const be = {
|
|
581
|
-
...wr(
|
|
581
|
+
...wr(Q),
|
|
582
582
|
visualId: O.id
|
|
583
583
|
// Link this frame to the library visual
|
|
584
584
|
};
|
|
@@ -610,7 +610,7 @@ function Ee() {
|
|
|
610
610
|
isError: K.isError,
|
|
611
611
|
error: K.error,
|
|
612
612
|
handleEditLibraryVisual: Ce,
|
|
613
|
-
handleAddLibraryVisual:
|
|
613
|
+
handleAddLibraryVisual: ce,
|
|
614
614
|
getUpdatedFrame: an().getUpdatedFrame,
|
|
615
615
|
refetch: K.refetch
|
|
616
616
|
};
|
|
@@ -646,12 +646,12 @@ function Hs({
|
|
|
646
646
|
open: e,
|
|
647
647
|
onOpenChange: r
|
|
648
648
|
}) {
|
|
649
|
-
const o = ht("interactive"), [a, n] = F(""), [s,
|
|
649
|
+
const o = ht("interactive"), [a, n] = F(""), [s, d] = F(/* @__PURE__ */ new Set()), [c, l] = F(!1), [u, h] = F(
|
|
650
650
|
null
|
|
651
651
|
), [p, m] = F(
|
|
652
652
|
null
|
|
653
653
|
), [g, f] = F(!1), [b, k] = F(null), [v, D] = F(null), E = () => {
|
|
654
|
-
|
|
654
|
+
d(/* @__PURE__ */ new Set()), h(null), m(null), f(!1), k(null);
|
|
655
655
|
}, N = () => {
|
|
656
656
|
r(!1), E();
|
|
657
657
|
}, { selectVisual: y } = mt(), { handleAddLibraryVisual: w, handleEditLibraryVisual: S } = Ee(), { isConsoleMode: x } = Sr(), {
|
|
@@ -660,10 +660,10 @@ function Hs({
|
|
|
660
660
|
isError: W,
|
|
661
661
|
createResource: P,
|
|
662
662
|
updateResource: M,
|
|
663
|
-
deleteResourceAsync:
|
|
663
|
+
deleteResourceAsync: Y,
|
|
664
664
|
duplicateResource: K,
|
|
665
665
|
isCreating: Ce,
|
|
666
|
-
isDeleting:
|
|
666
|
+
isDeleting: ce
|
|
667
667
|
} = Dr(
|
|
668
668
|
void 0,
|
|
669
669
|
(C) => {
|
|
@@ -677,8 +677,8 @@ function Hs({
|
|
|
677
677
|
const C = a.trim().toLowerCase();
|
|
678
678
|
return C ? L.filter(
|
|
679
679
|
(R) => {
|
|
680
|
-
var z,
|
|
681
|
-
return ((z = R.title) == null ? void 0 : z.toLowerCase().includes(C)) || ((
|
|
680
|
+
var z, de, fe;
|
|
681
|
+
return ((z = R.title) == null ? void 0 : z.toLowerCase().includes(C)) || ((de = R.description) == null ? void 0 : de.toLowerCase().includes(C)) || ((fe = R.kind) == null ? void 0 : fe.toLowerCase().includes(C));
|
|
682
682
|
}
|
|
683
683
|
) : L;
|
|
684
684
|
}, [a, L]), le = oe(
|
|
@@ -686,7 +686,7 @@ function Hs({
|
|
|
686
686
|
(C) => s.has(C.id)
|
|
687
687
|
),
|
|
688
688
|
[s, L]
|
|
689
|
-
),
|
|
689
|
+
), Q = le.filter(
|
|
690
690
|
(C) => C.permissions.canDelete
|
|
691
691
|
), be = le.filter(
|
|
692
692
|
(C) => C.permissions.canShare
|
|
@@ -696,13 +696,13 @@ function Hs({
|
|
|
696
696
|
(C) => s.has(C.id)
|
|
697
697
|
), we = (C) => {
|
|
698
698
|
const R = new Set(s);
|
|
699
|
-
C(R),
|
|
699
|
+
C(R), d(R);
|
|
700
700
|
}, se = (C) => {
|
|
701
701
|
we((R) => {
|
|
702
702
|
R.has(C) ? R.delete(C) : R.add(C);
|
|
703
703
|
});
|
|
704
704
|
}, Ae = () => {
|
|
705
|
-
|
|
705
|
+
d((C) => {
|
|
706
706
|
const R = new Set(C);
|
|
707
707
|
return ke ? ae.forEach(
|
|
708
708
|
(z) => R.delete(z.id)
|
|
@@ -729,20 +729,20 @@ function Hs({
|
|
|
729
729
|
onSettled: () => D(null)
|
|
730
730
|
});
|
|
731
731
|
}, _e = () => {
|
|
732
|
-
if (
|
|
732
|
+
if (Q.length === 0) {
|
|
733
733
|
V.error("Select a visual you can delete");
|
|
734
734
|
return;
|
|
735
735
|
}
|
|
736
736
|
k(null), f(!0);
|
|
737
737
|
}, st = async () => {
|
|
738
|
-
const C = b ? [b] :
|
|
738
|
+
const C = b ? [b] : Q;
|
|
739
739
|
try {
|
|
740
740
|
for (const R of C)
|
|
741
|
-
await
|
|
742
|
-
|
|
741
|
+
await Y(R.id);
|
|
742
|
+
d((R) => {
|
|
743
743
|
const z = new Set(R);
|
|
744
744
|
return C.forEach(
|
|
745
|
-
(
|
|
745
|
+
(de) => z.delete(de.id)
|
|
746
746
|
), z;
|
|
747
747
|
}), f(!1), k(null);
|
|
748
748
|
} catch {
|
|
@@ -768,7 +768,7 @@ function Hs({
|
|
|
768
768
|
m(null);
|
|
769
769
|
return;
|
|
770
770
|
}
|
|
771
|
-
const
|
|
771
|
+
const de = Object.keys(z), fe = de.length === 1 ? de[0] : void 0;
|
|
772
772
|
O(p.id, fe), M(
|
|
773
773
|
{
|
|
774
774
|
resourceId: p.id,
|
|
@@ -785,7 +785,7 @@ function Hs({
|
|
|
785
785
|
);
|
|
786
786
|
}, ne = (C) => {
|
|
787
787
|
r(C), C || E();
|
|
788
|
-
}, Pe = b ? 1 :
|
|
788
|
+
}, Pe = b ? 1 : Q.length;
|
|
789
789
|
return /* @__PURE__ */ i($, { children: [
|
|
790
790
|
/* @__PURE__ */ t(Ue, { open: e, onOpenChange: ne, children: /* @__PURE__ */ i(
|
|
791
791
|
Ve,
|
|
@@ -843,7 +843,7 @@ function Hs({
|
|
|
843
843
|
}
|
|
844
844
|
)
|
|
845
845
|
] }),
|
|
846
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: I ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(
|
|
846
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: I ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(Qa, {}) }) : W ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ t("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : ae.length === 0 ? /* @__PURE__ */ i("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
|
|
847
847
|
/* @__PURE__ */ t(Dt, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
848
848
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: a ? "No visuals found" : "No visuals yet" }),
|
|
849
849
|
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: a ? "Try a different search." : "Create a saved visual to add it here." })
|
|
@@ -865,7 +865,7 @@ function Hs({
|
|
|
865
865
|
},
|
|
866
866
|
onDuplicateVisual: Ne,
|
|
867
867
|
duplicatingId: v,
|
|
868
|
-
isDeleting:
|
|
868
|
+
isDeleting: ce,
|
|
869
869
|
isConsoleMode: x
|
|
870
870
|
}
|
|
871
871
|
) }),
|
|
@@ -881,7 +881,7 @@ function Hs({
|
|
|
881
881
|
{
|
|
882
882
|
size: "xs",
|
|
883
883
|
variant: "ghost",
|
|
884
|
-
onClick: () =>
|
|
884
|
+
onClick: () => d(/* @__PURE__ */ new Set()),
|
|
885
885
|
children: "Clear"
|
|
886
886
|
}
|
|
887
887
|
),
|
|
@@ -905,11 +905,11 @@ function Hs({
|
|
|
905
905
|
variant: "outline",
|
|
906
906
|
className: "text-destructive hover:text-destructive",
|
|
907
907
|
onClick: _e,
|
|
908
|
-
disabled:
|
|
908
|
+
disabled: Q.length === 0,
|
|
909
909
|
children: [
|
|
910
|
-
/* @__PURE__ */ t(
|
|
910
|
+
/* @__PURE__ */ t(Qe, { className: "h-3.5 w-3.5" }),
|
|
911
911
|
"Delete ",
|
|
912
|
-
|
|
912
|
+
Q.length || s.size
|
|
913
913
|
]
|
|
914
914
|
}
|
|
915
915
|
)
|
|
@@ -944,7 +944,7 @@ function Hs({
|
|
|
944
944
|
/* @__PURE__ */ t(
|
|
945
945
|
Ka,
|
|
946
946
|
{
|
|
947
|
-
open:
|
|
947
|
+
open: c,
|
|
948
948
|
onOpenChange: l,
|
|
949
949
|
onSubmit: P,
|
|
950
950
|
isCreating: Ce
|
|
@@ -975,7 +975,7 @@ function Hs({
|
|
|
975
975
|
{
|
|
976
976
|
open: g,
|
|
977
977
|
onOpenChange: (C) => {
|
|
978
|
-
!C &&
|
|
978
|
+
!C && ce || (f(C), C || k(null));
|
|
979
979
|
},
|
|
980
980
|
children: /* @__PURE__ */ i(ft, { children: [
|
|
981
981
|
/* @__PURE__ */ i(gt, { children: [
|
|
@@ -989,17 +989,17 @@ function Hs({
|
|
|
989
989
|
/* @__PURE__ */ t(vt, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
|
|
990
990
|
] }),
|
|
991
991
|
/* @__PURE__ */ i(xt, { children: [
|
|
992
|
-
/* @__PURE__ */ t(yt, { disabled:
|
|
992
|
+
/* @__PURE__ */ t(yt, { disabled: ce, children: "Cancel" }),
|
|
993
993
|
/* @__PURE__ */ i(
|
|
994
994
|
jt,
|
|
995
995
|
{
|
|
996
996
|
onClick: (C) => {
|
|
997
997
|
C.preventDefault(), st();
|
|
998
998
|
},
|
|
999
|
-
disabled:
|
|
999
|
+
disabled: ce || Pe === 0,
|
|
1000
1000
|
children: [
|
|
1001
|
-
|
|
1002
|
-
|
|
1001
|
+
ce ? /* @__PURE__ */ t(ie, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(Qe, { className: "h-3.5 w-3.5" }),
|
|
1002
|
+
ce ? "Deleting..." : "Delete"
|
|
1003
1003
|
]
|
|
1004
1004
|
}
|
|
1005
1005
|
)
|
|
@@ -1016,8 +1016,8 @@ function ln({
|
|
|
1016
1016
|
someFilteredSelected: a,
|
|
1017
1017
|
onSelectAll: n,
|
|
1018
1018
|
onToggleSelection: s,
|
|
1019
|
-
onAddVisual:
|
|
1020
|
-
onOpenVisual:
|
|
1019
|
+
onAddVisual: d,
|
|
1020
|
+
onOpenVisual: c,
|
|
1021
1021
|
onEditDetails: l,
|
|
1022
1022
|
onShareVisual: u,
|
|
1023
1023
|
onDeleteVisual: h,
|
|
@@ -1044,13 +1044,13 @@ function ln({
|
|
|
1044
1044
|
/* @__PURE__ */ t("span", { className: "text-right", children: "Actions" })
|
|
1045
1045
|
] }),
|
|
1046
1046
|
e.map((b) => /* @__PURE__ */ t(
|
|
1047
|
-
|
|
1047
|
+
cn,
|
|
1048
1048
|
{
|
|
1049
1049
|
visual: b,
|
|
1050
1050
|
selected: r.has(b.id),
|
|
1051
1051
|
onToggleSelection: s,
|
|
1052
|
-
onAddVisual:
|
|
1053
|
-
onOpenVisual:
|
|
1052
|
+
onAddVisual: d,
|
|
1053
|
+
onOpenVisual: c,
|
|
1054
1054
|
onEditDetails: l,
|
|
1055
1055
|
onShareVisual: u,
|
|
1056
1056
|
onDeleteVisual: h,
|
|
@@ -1063,15 +1063,15 @@ function ln({
|
|
|
1063
1063
|
))
|
|
1064
1064
|
] });
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function cn({
|
|
1067
1067
|
visual: e,
|
|
1068
1068
|
selected: r,
|
|
1069
1069
|
onToggleSelection: o,
|
|
1070
1070
|
onAddVisual: a,
|
|
1071
1071
|
onOpenVisual: n,
|
|
1072
1072
|
onEditDetails: s,
|
|
1073
|
-
onShareVisual:
|
|
1074
|
-
onDeleteVisual:
|
|
1073
|
+
onShareVisual: d,
|
|
1074
|
+
onDeleteVisual: c,
|
|
1075
1075
|
onDuplicateVisual: l,
|
|
1076
1076
|
duplicatingId: u,
|
|
1077
1077
|
isDeleting: h,
|
|
@@ -1084,7 +1084,7 @@ function dn({
|
|
|
1084
1084
|
return /* @__PURE__ */ i(
|
|
1085
1085
|
"div",
|
|
1086
1086
|
{
|
|
1087
|
-
className:
|
|
1087
|
+
className: Z(
|
|
1088
1088
|
"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",
|
|
1089
1089
|
r && "bg-muted/70"
|
|
1090
1090
|
),
|
|
@@ -1135,13 +1135,13 @@ function dn({
|
|
|
1135
1135
|
/* @__PURE__ */ t(on, { visual: e }),
|
|
1136
1136
|
/* @__PURE__ */ t("span", { className: "text-right tabular-nums text-muted-foreground", children: e.ownership.sharedCount > 0 ? e.ownership.sharedCount : "—" }),
|
|
1137
1137
|
/* @__PURE__ */ t(
|
|
1138
|
-
|
|
1138
|
+
dn,
|
|
1139
1139
|
{
|
|
1140
1140
|
visual: e,
|
|
1141
1141
|
onOpenVisual: n,
|
|
1142
1142
|
onEditDetails: s,
|
|
1143
|
-
onShareVisual:
|
|
1144
|
-
onDeleteVisual:
|
|
1143
|
+
onShareVisual: d,
|
|
1144
|
+
onDeleteVisual: c,
|
|
1145
1145
|
onDuplicateVisual: l,
|
|
1146
1146
|
duplicatingId: u,
|
|
1147
1147
|
isDeleting: h,
|
|
@@ -1152,15 +1152,15 @@ function dn({
|
|
|
1152
1152
|
}
|
|
1153
1153
|
);
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1155
|
+
function dn({
|
|
1156
1156
|
visual: e,
|
|
1157
1157
|
onOpenVisual: r,
|
|
1158
1158
|
onEditDetails: o,
|
|
1159
1159
|
onShareVisual: a,
|
|
1160
1160
|
onDeleteVisual: n,
|
|
1161
1161
|
onDuplicateVisual: s,
|
|
1162
|
-
duplicatingId:
|
|
1163
|
-
isDeleting:
|
|
1162
|
+
duplicatingId: d,
|
|
1163
|
+
isDeleting: c,
|
|
1164
1164
|
isConsoleMode: l
|
|
1165
1165
|
}) {
|
|
1166
1166
|
return /* @__PURE__ */ i(
|
|
@@ -1205,10 +1205,10 @@ function cn({
|
|
|
1205
1205
|
X,
|
|
1206
1206
|
{
|
|
1207
1207
|
onClick: () => s(e.id),
|
|
1208
|
-
disabled:
|
|
1208
|
+
disabled: d === e.id,
|
|
1209
1209
|
children: [
|
|
1210
|
-
|
|
1211
|
-
|
|
1210
|
+
d === e.id ? /* @__PURE__ */ t(ie, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(Tr, { className: "h-3.5 w-3.5" }),
|
|
1211
|
+
d === e.id ? "Duplicating..." : "Duplicate"
|
|
1212
1212
|
]
|
|
1213
1213
|
}
|
|
1214
1214
|
),
|
|
@@ -1227,10 +1227,10 @@ function cn({
|
|
|
1227
1227
|
{
|
|
1228
1228
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
1229
1229
|
onClick: () => n(e),
|
|
1230
|
-
disabled:
|
|
1230
|
+
disabled: c,
|
|
1231
1231
|
children: [
|
|
1232
|
-
/* @__PURE__ */ t(
|
|
1233
|
-
|
|
1232
|
+
/* @__PURE__ */ t(Qe, { className: "h-3.5 w-3.5" }),
|
|
1233
|
+
c ? "Deleting..." : "Delete"
|
|
1234
1234
|
]
|
|
1235
1235
|
}
|
|
1236
1236
|
)
|
|
@@ -1254,19 +1254,19 @@ function cn({
|
|
|
1254
1254
|
}
|
|
1255
1255
|
);
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function Gs(e, r, o = !1) {
|
|
1258
1258
|
const a = T((u) => u.dashboard), n = T(
|
|
1259
1259
|
(u) => u.isDashboardEditing
|
|
1260
1260
|
), s = T(
|
|
1261
1261
|
(u) => u.onDashboardLifecycleEvent
|
|
1262
|
-
),
|
|
1262
|
+
), d = j(() => {
|
|
1263
1263
|
const u = T.getState().dashboard;
|
|
1264
1264
|
return r || !e || !u || u.id !== e.id ? !1 : je(u) !== je(e);
|
|
1265
1265
|
}, [e, r]);
|
|
1266
|
-
Pt(() => (T.setState({ checkUnsavedDashboardChanges:
|
|
1267
|
-
T.getState().checkUnsavedDashboardChanges ===
|
|
1268
|
-
}), [
|
|
1269
|
-
const
|
|
1266
|
+
Pt(() => (T.setState({ checkUnsavedDashboardChanges: d }), () => {
|
|
1267
|
+
T.getState().checkUnsavedDashboardChanges === d && T.setState({ checkUnsavedDashboardChanges: null });
|
|
1268
|
+
}), [d]);
|
|
1269
|
+
const c = oe(() => !o || r || !a || n && (!e || a.id !== e.id) ? null : {
|
|
1270
1270
|
dashboardId: a.id,
|
|
1271
1271
|
dirty: n && e ? je(a) !== je(e) : !1
|
|
1272
1272
|
}, [
|
|
@@ -1277,21 +1277,21 @@ function Qs(e, r, o = !1) {
|
|
|
1277
1277
|
a
|
|
1278
1278
|
]), l = ge(null);
|
|
1279
1279
|
return Pt(() => {
|
|
1280
|
-
if (!s || !
|
|
1280
|
+
if (!s || !c) {
|
|
1281
1281
|
l.current = null;
|
|
1282
1282
|
return;
|
|
1283
1283
|
}
|
|
1284
1284
|
const u = l.current;
|
|
1285
|
-
(u == null ? void 0 : u.callback) === s && u.dashboardId ===
|
|
1285
|
+
(u == null ? void 0 : u.callback) === s && u.dashboardId === c.dashboardId && u.dirty === c.dirty || (l.current = {
|
|
1286
1286
|
callback: s,
|
|
1287
|
-
dashboardId:
|
|
1288
|
-
dirty:
|
|
1287
|
+
dashboardId: c.dashboardId,
|
|
1288
|
+
dirty: c.dirty
|
|
1289
1289
|
}, s({
|
|
1290
1290
|
type: "dashboard:dirty-state",
|
|
1291
|
-
dashboardId:
|
|
1292
|
-
payload: { dirty:
|
|
1291
|
+
dashboardId: c.dashboardId,
|
|
1292
|
+
payload: { dirty: c.dirty }
|
|
1293
1293
|
}));
|
|
1294
|
-
}, [
|
|
1294
|
+
}, [c, s]), d;
|
|
1295
1295
|
}
|
|
1296
1296
|
function un({
|
|
1297
1297
|
open: e,
|
|
@@ -1300,9 +1300,9 @@ function un({
|
|
|
1300
1300
|
currentVisualName: a,
|
|
1301
1301
|
isSaving: n = !1,
|
|
1302
1302
|
destinationMode: s = "both",
|
|
1303
|
-
onConfirm:
|
|
1303
|
+
onConfirm: d
|
|
1304
1304
|
}) {
|
|
1305
|
-
const [
|
|
1305
|
+
const [c, l] = F(
|
|
1306
1306
|
o && a ? `Copy of ${a}` : a || ""
|
|
1307
1307
|
), [u, h] = F("");
|
|
1308
1308
|
_t.useEffect(() => {
|
|
@@ -1310,7 +1310,7 @@ function un({
|
|
|
1310
1310
|
o && a ? `Copy of ${a}` : a || ""
|
|
1311
1311
|
), h(""));
|
|
1312
1312
|
}, [e, o, a]);
|
|
1313
|
-
const p = !!
|
|
1313
|
+
const p = !!c.trim(), m = s === "local" ? {
|
|
1314
1314
|
saveToLibrary: !1,
|
|
1315
1315
|
saveToCurrentDashboard: !0,
|
|
1316
1316
|
badgeType: "local",
|
|
@@ -1329,8 +1329,8 @@ function un({
|
|
|
1329
1329
|
description: "Creates a new library visual and adds a linked copy to this dashboard.",
|
|
1330
1330
|
actionLabel: "Save Copy as Linked Visual"
|
|
1331
1331
|
}, g = () => {
|
|
1332
|
-
!p || n ||
|
|
1333
|
-
name:
|
|
1332
|
+
!p || n || d({
|
|
1333
|
+
name: c.trim(),
|
|
1334
1334
|
description: u.trim() || void 0,
|
|
1335
1335
|
saveToLibrary: m.saveToLibrary,
|
|
1336
1336
|
saveToCurrentDashboard: m.saveToCurrentDashboard
|
|
@@ -1355,10 +1355,10 @@ function un({
|
|
|
1355
1355
|
/* @__PURE__ */ i("div", { className: "grid gap-2", children: [
|
|
1356
1356
|
/* @__PURE__ */ t(Le, { htmlFor: "name", children: "Name" }),
|
|
1357
1357
|
/* @__PURE__ */ t(
|
|
1358
|
-
|
|
1358
|
+
dt,
|
|
1359
1359
|
{
|
|
1360
1360
|
id: "name",
|
|
1361
|
-
value:
|
|
1361
|
+
value: c,
|
|
1362
1362
|
onChange: (f) => l(f.target.value),
|
|
1363
1363
|
placeholder: "Enter visual name",
|
|
1364
1364
|
disabled: n
|
|
@@ -1431,15 +1431,15 @@ function hn({
|
|
|
1431
1431
|
className: e,
|
|
1432
1432
|
variant: r = "default"
|
|
1433
1433
|
}) {
|
|
1434
|
-
const o = Je(), [a, n] = F(!1), { setIsVisualEditing: s } = pe(), { getUpdatedFrame:
|
|
1434
|
+
const o = Je(), [a, n] = F(!1), { setIsVisualEditing: s } = pe(), { getUpdatedFrame: d } = Ee(), c = et(), l = ee((p) => p.frame), u = qt();
|
|
1435
1435
|
return /* @__PURE__ */ t(
|
|
1436
1436
|
U,
|
|
1437
1437
|
{
|
|
1438
1438
|
onClick: () => {
|
|
1439
|
-
const p =
|
|
1439
|
+
const p = d();
|
|
1440
1440
|
if (!kt(p))
|
|
1441
1441
|
return;
|
|
1442
|
-
const m = (l == null ? void 0 : l.visualId) || (
|
|
1442
|
+
const m = (l == null ? void 0 : l.visualId) || (c == null ? void 0 : c.id);
|
|
1443
1443
|
if (!m) {
|
|
1444
1444
|
V.error("No visual to save");
|
|
1445
1445
|
return;
|
|
@@ -1471,7 +1471,7 @@ function hn({
|
|
|
1471
1471
|
/* @__PURE__ */ t(ie, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1472
1472
|
"Saving"
|
|
1473
1473
|
] }) : /* @__PURE__ */ i($, { children: [
|
|
1474
|
-
/* @__PURE__ */ t(
|
|
1474
|
+
/* @__PURE__ */ t(Yt, { className: "h-3.5 w-3.5" }),
|
|
1475
1475
|
"Save to Library"
|
|
1476
1476
|
] })
|
|
1477
1477
|
}
|
|
@@ -1480,12 +1480,12 @@ function hn({
|
|
|
1480
1480
|
function mn({
|
|
1481
1481
|
className: e
|
|
1482
1482
|
}) {
|
|
1483
|
-
const r = Je(), [o, a] = F(!1), n = et(), s = ee((f) => f.frame),
|
|
1483
|
+
const r = Je(), [o, a] = F(!1), n = et(), s = ee((f) => f.frame), d = T((f) => f.selectedSheetId), c = T((f) => f.dashboard), { updateFrame: l, setIsVisualEditing: u } = pe(), { getUpdatedFrame: h } = Ee(), p = qt(), m = St();
|
|
1484
1484
|
return /* @__PURE__ */ t(
|
|
1485
1485
|
U,
|
|
1486
1486
|
{
|
|
1487
1487
|
onClick: async () => {
|
|
1488
|
-
if (!
|
|
1488
|
+
if (!d) {
|
|
1489
1489
|
V.error("No sheet selected");
|
|
1490
1490
|
return;
|
|
1491
1491
|
}
|
|
@@ -1505,7 +1505,7 @@ function mn({
|
|
|
1505
1505
|
...b,
|
|
1506
1506
|
visualId: f
|
|
1507
1507
|
// Keep the link to library visual
|
|
1508
|
-
}, v =
|
|
1508
|
+
}, v = Ze(c, k.id), D = await m(k, {
|
|
1509
1509
|
previousFrame: v
|
|
1510
1510
|
});
|
|
1511
1511
|
await p.mutateAsync({
|
|
@@ -1513,7 +1513,7 @@ function mn({
|
|
|
1513
1513
|
data: {
|
|
1514
1514
|
frameObject: b
|
|
1515
1515
|
}
|
|
1516
|
-
}), l(
|
|
1516
|
+
}), l(d, k, {
|
|
1517
1517
|
semanticExecutionPayload: D
|
|
1518
1518
|
}), r.invalidateQueries({ queryKey: ["visuals"] }), r.invalidateQueries({ queryKey: ["visual", f] }), V.success("Saved to library and applied locally"), setTimeout(() => {
|
|
1519
1519
|
u(!1);
|
|
@@ -1534,25 +1534,25 @@ function mn({
|
|
|
1534
1534
|
/* @__PURE__ */ t(ie, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1535
1535
|
"Saving..."
|
|
1536
1536
|
] }) : /* @__PURE__ */ i($, { children: [
|
|
1537
|
-
/* @__PURE__ */ t(
|
|
1537
|
+
/* @__PURE__ */ t(Yt, { className: "h-3.5 w-3.5" }),
|
|
1538
1538
|
"Save & Apply"
|
|
1539
1539
|
] })
|
|
1540
1540
|
}
|
|
1541
1541
|
);
|
|
1542
1542
|
}
|
|
1543
1543
|
function lt({ className: e }) {
|
|
1544
|
-
const { setTempQueryData: r, setSqlGen: o } = tt(), a = Je(), n = ee((
|
|
1545
|
-
function
|
|
1544
|
+
const { setTempQueryData: r, setSqlGen: o } = tt(), a = Je(), n = ee((c) => c.tempQueryData), s = ee((c) => c.onClose);
|
|
1545
|
+
function d() {
|
|
1546
1546
|
if (n) {
|
|
1547
|
-
const { queryKey:
|
|
1548
|
-
|
|
1547
|
+
const { queryKey: c, queryData: l } = n;
|
|
1548
|
+
c && l && a.setQueryData(c, l);
|
|
1549
1549
|
}
|
|
1550
1550
|
o({}), s == null || s();
|
|
1551
1551
|
}
|
|
1552
1552
|
return /* @__PURE__ */ i(
|
|
1553
1553
|
U,
|
|
1554
1554
|
{
|
|
1555
|
-
onClick:
|
|
1555
|
+
onClick: d,
|
|
1556
1556
|
className: e,
|
|
1557
1557
|
size: "xs",
|
|
1558
1558
|
variant: "outline",
|
|
@@ -1564,11 +1564,11 @@ function lt({ className: e }) {
|
|
|
1564
1564
|
);
|
|
1565
1565
|
}
|
|
1566
1566
|
function pn() {
|
|
1567
|
-
const [e, r] = F(!1), [o, a] = F(!1), [n, s] = F(null), [
|
|
1567
|
+
const [e, r] = F(!1), [o, a] = F(!1), [n, s] = F(null), [d, c] = F(null), l = ee((S) => S.frame), u = ee((S) => S.card), h = et(), p = T((S) => S.selectedSheetId), m = T((S) => S.dashboard), { getUpdatedFrame: g } = Ee(), { selectVisual: f } = mt(), { addFrame: b, setSelectedFrameId: k, setIsVisualEditing: v } = pe(), D = St(), E = !!(l != null && l.visualId), N = (() => {
|
|
1568
1568
|
var S, x;
|
|
1569
1569
|
return ((S = l == null ? void 0 : l.cards) == null ? void 0 : S.length) === 1 && ((x = l.cards[0]) != null && x.title) ? l.cards[0].title : h != null && h.title ? h.title : (u == null ? void 0 : u.title) || "Untitled Visual";
|
|
1570
1570
|
})(), y = Br((S) => {
|
|
1571
|
-
S != null && S.id && (f(S), o && n &&
|
|
1571
|
+
S != null && S.id && (f(S), o && n && d && p && (async () => {
|
|
1572
1572
|
try {
|
|
1573
1573
|
const x = {
|
|
1574
1574
|
...n,
|
|
@@ -1578,8 +1578,8 @@ function pn() {
|
|
|
1578
1578
|
};
|
|
1579
1579
|
b(p, x, {
|
|
1580
1580
|
placement: "end",
|
|
1581
|
-
semanticExecutionPayload:
|
|
1582
|
-
}), k(x.id), a(!1), s(null),
|
|
1581
|
+
semanticExecutionPayload: d
|
|
1582
|
+
}), k(x.id), a(!1), s(null), c(null), v(!1);
|
|
1583
1583
|
} catch (x) {
|
|
1584
1584
|
console.error(
|
|
1585
1585
|
"Failed to promote semantic metadata for saved visual:",
|
|
@@ -1611,7 +1611,7 @@ function pn() {
|
|
|
1611
1611
|
if (S.saveToCurrentDashboard)
|
|
1612
1612
|
try {
|
|
1613
1613
|
W = await D(I, {
|
|
1614
|
-
previousFrame:
|
|
1614
|
+
previousFrame: Ze(m, I.id)
|
|
1615
1615
|
});
|
|
1616
1616
|
} catch (M) {
|
|
1617
1617
|
console.error(
|
|
@@ -1622,7 +1622,7 @@ function pn() {
|
|
|
1622
1622
|
);
|
|
1623
1623
|
return;
|
|
1624
1624
|
}
|
|
1625
|
-
a(S.saveToCurrentDashboard), s(I),
|
|
1625
|
+
a(S.saveToCurrentDashboard), s(I), c(W);
|
|
1626
1626
|
const P = {
|
|
1627
1627
|
title: S.name,
|
|
1628
1628
|
description: S.description,
|
|
@@ -1641,7 +1641,7 @@ function pn() {
|
|
|
1641
1641
|
};
|
|
1642
1642
|
try {
|
|
1643
1643
|
const P = await D(I, {
|
|
1644
|
-
previousFrame:
|
|
1644
|
+
previousFrame: Ze(m, I.id)
|
|
1645
1645
|
});
|
|
1646
1646
|
b(p, W, {
|
|
1647
1647
|
placement: "end",
|
|
@@ -1659,8 +1659,8 @@ function pn() {
|
|
|
1659
1659
|
isSaving: y.isPending
|
|
1660
1660
|
};
|
|
1661
1661
|
}
|
|
1662
|
-
function
|
|
1663
|
-
const { isInspectionMode: r } = Mr(), o = ee((P) => P.frame), a = ee((P) => P.editorContext), n = _r((P) => P.selectedVisual), s = T((P) => P.selectedFrameId),
|
|
1662
|
+
function Qs(e = {}) {
|
|
1663
|
+
const { isInspectionMode: r } = Mr(), o = ee((P) => P.frame), a = ee((P) => P.editorContext), n = _r((P) => P.selectedVisual), s = T((P) => P.selectedFrameId), d = T((P) => P.selectedSheetId), c = T((P) => P.dashboard), { setIsVisualEditing: l, updateFrame: u } = pe(), [h, p] = F(!1), [m, g] = F("both"), f = St(), b = (a == null ? void 0 : a.type) === "documentSection", k = !!(o != null && o.visualId || n != null && n.id), v = !!(o != null && o.visualId && s), D = k && !v, {
|
|
1664
1664
|
saveAsDialogOpen: E,
|
|
1665
1665
|
setSaveAsDialogOpen: N,
|
|
1666
1666
|
handleSaveAs: y,
|
|
@@ -1685,7 +1685,7 @@ function Gs(e = {}) {
|
|
|
1685
1685
|
/* @__PURE__ */ t(lt, {})
|
|
1686
1686
|
] });
|
|
1687
1687
|
const I = async () => {
|
|
1688
|
-
if (!
|
|
1688
|
+
if (!d) {
|
|
1689
1689
|
V.error("No sheet selected");
|
|
1690
1690
|
return;
|
|
1691
1691
|
}
|
|
@@ -1694,12 +1694,12 @@ function Gs(e = {}) {
|
|
|
1694
1694
|
const M = {
|
|
1695
1695
|
...B(),
|
|
1696
1696
|
visualId: void 0
|
|
1697
|
-
},
|
|
1697
|
+
}, Y = Ze(c, M.id);
|
|
1698
1698
|
try {
|
|
1699
1699
|
const K = await f(M, {
|
|
1700
|
-
previousFrame:
|
|
1700
|
+
previousFrame: Y
|
|
1701
1701
|
});
|
|
1702
|
-
u(
|
|
1702
|
+
u(d, M, {
|
|
1703
1703
|
semanticExecutionPayload: K
|
|
1704
1704
|
});
|
|
1705
1705
|
} catch (K) {
|
|
@@ -1728,7 +1728,7 @@ function Gs(e = {}) {
|
|
|
1728
1728
|
className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
|
|
1729
1729
|
"aria-label": "Open visual save options",
|
|
1730
1730
|
disabled: x || h,
|
|
1731
|
-
children: /* @__PURE__ */ t(
|
|
1731
|
+
children: /* @__PURE__ */ t(Zt, { className: "h-3.5 w-3.5" })
|
|
1732
1732
|
}
|
|
1733
1733
|
) }),
|
|
1734
1734
|
/* @__PURE__ */ i(
|
|
@@ -1807,10 +1807,10 @@ function Gs(e = {}) {
|
|
|
1807
1807
|
] });
|
|
1808
1808
|
}
|
|
1809
1809
|
function Ks({ className: e }) {
|
|
1810
|
-
const r = ee((h) => h.isDevMode), o = ee((h) => h.card.type), a = T((h) => h.isVisualEditing), { setIsDevMode: n } = tt(), { config: s } = pr(Or).tokenProps,
|
|
1811
|
-
if (!a || !
|
|
1810
|
+
const r = ee((h) => h.isDevMode), o = ee((h) => h.card.type), a = T((h) => h.isVisualEditing), { setIsDevMode: n } = tt(), { config: s } = pr(Or).tokenProps, d = (s == null ? void 0 : s.showAdvancedMode) !== !1;
|
|
1811
|
+
if (!a || !d || !fr(o))
|
|
1812
1812
|
return null;
|
|
1813
|
-
const
|
|
1813
|
+
const c = r ? Ha : Wa, l = r ? "Visual editor" : "SQL editor", u = r ? "Switch to visual editor" : "Switch to SQL editor";
|
|
1814
1814
|
return /* @__PURE__ */ i(
|
|
1815
1815
|
"button",
|
|
1816
1816
|
{
|
|
@@ -1818,12 +1818,12 @@ function Ks({ className: e }) {
|
|
|
1818
1818
|
"aria-label": u,
|
|
1819
1819
|
title: u,
|
|
1820
1820
|
onClick: () => n(!r),
|
|
1821
|
-
className:
|
|
1821
|
+
className: Z(
|
|
1822
1822
|
"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",
|
|
1823
1823
|
e
|
|
1824
1824
|
),
|
|
1825
1825
|
children: [
|
|
1826
|
-
/* @__PURE__ */ t(
|
|
1826
|
+
/* @__PURE__ */ t(c, { className: "h-3 w-3 text-muted-foreground" }),
|
|
1827
1827
|
l
|
|
1828
1828
|
]
|
|
1829
1829
|
}
|
|
@@ -1836,8 +1836,8 @@ function Xs({
|
|
|
1836
1836
|
onDiscard: a,
|
|
1837
1837
|
isSaving: n,
|
|
1838
1838
|
title: s = "Unsaved changes",
|
|
1839
|
-
description:
|
|
1840
|
-
cancelLabel:
|
|
1839
|
+
description: d = "You have unsaved changes to this dashboard. What would you like to do?",
|
|
1840
|
+
cancelLabel: c = "Cancel",
|
|
1841
1841
|
discardLabel: l = "Discard changes",
|
|
1842
1842
|
saveLabel: u = "Save"
|
|
1843
1843
|
}) {
|
|
@@ -1846,7 +1846,7 @@ function Xs({
|
|
|
1846
1846
|
}, children: /* @__PURE__ */ i(ft, { children: [
|
|
1847
1847
|
/* @__PURE__ */ i(gt, { children: [
|
|
1848
1848
|
/* @__PURE__ */ t(bt, { children: s }),
|
|
1849
|
-
/* @__PURE__ */ t(vt, { children:
|
|
1849
|
+
/* @__PURE__ */ t(vt, { children: d })
|
|
1850
1850
|
] }),
|
|
1851
1851
|
/* @__PURE__ */ i(xt, { children: [
|
|
1852
1852
|
/* @__PURE__ */ t(
|
|
@@ -1861,7 +1861,7 @@ function Xs({
|
|
|
1861
1861
|
children: l
|
|
1862
1862
|
}
|
|
1863
1863
|
),
|
|
1864
|
-
/* @__PURE__ */ t(yt, { disabled: n, children:
|
|
1864
|
+
/* @__PURE__ */ t(yt, { disabled: n, children: c }),
|
|
1865
1865
|
/* @__PURE__ */ t(U, { type: "button", size: "xs", onClick: o, disabled: n, children: n ? /* @__PURE__ */ i($, { children: [
|
|
1866
1866
|
/* @__PURE__ */ t(ie, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
1867
1867
|
"Saving..."
|
|
@@ -1869,9 +1869,9 @@ function Xs({
|
|
|
1869
1869
|
] })
|
|
1870
1870
|
] }) });
|
|
1871
1871
|
}
|
|
1872
|
-
async function
|
|
1873
|
-
var s,
|
|
1874
|
-
const r = (
|
|
1872
|
+
async function Zs(e) {
|
|
1873
|
+
var s, d;
|
|
1874
|
+
const r = (d = (s = T.getState()) == null ? void 0 : s.authToken) == null ? void 0 : d.accessToken;
|
|
1875
1875
|
if (!r)
|
|
1876
1876
|
return;
|
|
1877
1877
|
const o = `${e}/v1/invalidate-token`, a = await fetch(o, {
|
|
@@ -1923,10 +1923,10 @@ function Sn(e) {
|
|
|
1923
1923
|
const r = Date.now() - e.getTime();
|
|
1924
1924
|
return r < xn ? gn : r < yn ? bn : vn;
|
|
1925
1925
|
}
|
|
1926
|
-
function
|
|
1926
|
+
function Ys() {
|
|
1927
1927
|
const { authToken: e, tokenProps: r } = Be(), o = xe((m) => m.activeExports), [a, n] = F(
|
|
1928
1928
|
typeof document < "u" ? !document.hidden : !0
|
|
1929
|
-
), s = ge(null),
|
|
1929
|
+
), s = ge(null), d = ge(!1), c = ge(void 0), l = r == null ? void 0 : r.apiServiceUrl, u = e == null ? void 0 : e.accessToken, h = j(() => {
|
|
1930
1930
|
const m = xe.getState().activeExports;
|
|
1931
1931
|
return Array.from(m.values()).filter(
|
|
1932
1932
|
(g) => Te(g.status)
|
|
@@ -1943,12 +1943,12 @@ function Zs() {
|
|
|
1943
1943
|
}, []);
|
|
1944
1944
|
const p = j(async () => {
|
|
1945
1945
|
if (!l || !u) {
|
|
1946
|
-
|
|
1946
|
+
d.current = !1;
|
|
1947
1947
|
return;
|
|
1948
1948
|
}
|
|
1949
1949
|
const m = h();
|
|
1950
1950
|
if (m.length === 0) {
|
|
1951
|
-
|
|
1951
|
+
d.current = !1;
|
|
1952
1952
|
return;
|
|
1953
1953
|
}
|
|
1954
1954
|
const g = Date.now(), f = await Promise.allSettled(
|
|
@@ -1983,7 +1983,7 @@ function Zs() {
|
|
|
1983
1983
|
if (g > Nn(E) && !(w && !Te(w.status))) {
|
|
1984
1984
|
b(E.id, {
|
|
1985
1985
|
status: "failed",
|
|
1986
|
-
error:
|
|
1986
|
+
error: G.unconfirmed,
|
|
1987
1987
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
1988
1988
|
});
|
|
1989
1989
|
return;
|
|
@@ -1998,37 +1998,37 @@ function Zs() {
|
|
|
1998
1998
|
), N = Sn(E);
|
|
1999
1999
|
s.current && clearTimeout(s.current), s.current = setTimeout(() => {
|
|
2000
2000
|
var y;
|
|
2001
|
-
(y =
|
|
2001
|
+
(y = c.current) == null || y.call(c);
|
|
2002
2002
|
}, N);
|
|
2003
2003
|
} else
|
|
2004
|
-
|
|
2004
|
+
d.current = !1;
|
|
2005
2005
|
}, [l, u, h]);
|
|
2006
2006
|
return J(() => {
|
|
2007
|
-
|
|
2007
|
+
c.current = p;
|
|
2008
2008
|
}, [p]), J(() => {
|
|
2009
2009
|
var g;
|
|
2010
|
-
h().length > 0 && a && !
|
|
2010
|
+
h().length > 0 && a && !d.current && (d.current = !0, (g = c.current) == null || g.call(c));
|
|
2011
2011
|
}, [o, a, h]), J(() => {
|
|
2012
2012
|
var g;
|
|
2013
2013
|
const m = h();
|
|
2014
|
-
a && m.length > 0 && !
|
|
2014
|
+
a && m.length > 0 && !d.current && (d.current = !0, (g = c.current) == null || g.call(c));
|
|
2015
2015
|
}, [a, h]), J(() => {
|
|
2016
|
-
!a && s.current && (clearTimeout(s.current), s.current = null,
|
|
2016
|
+
!a && s.current && (clearTimeout(s.current), s.current = null, d.current = !1);
|
|
2017
2017
|
}, [a]), J(() => () => {
|
|
2018
2018
|
s.current && (clearTimeout(s.current), s.current = null);
|
|
2019
2019
|
}, []), {
|
|
2020
|
-
isPolling:
|
|
2020
|
+
isPolling: d.current,
|
|
2021
2021
|
isTabVisible: a,
|
|
2022
2022
|
inProgressCount: h().length
|
|
2023
2023
|
};
|
|
2024
2024
|
}
|
|
2025
2025
|
function Js() {
|
|
2026
|
-
const { authToken: e, tokenProps: r } = Be(), o = xe((
|
|
2026
|
+
const { authToken: e, tokenProps: r } = Be(), o = xe((c) => c.activeExports), { recoverExport: a } = Gt(), n = ge(!1), s = r == null ? void 0 : r.apiServiceUrl, d = e == null ? void 0 : e.accessToken;
|
|
2027
2027
|
J(() => {
|
|
2028
|
-
if (n.current || !s || !
|
|
2028
|
+
if (n.current || !s || !d) return;
|
|
2029
2029
|
(async () => {
|
|
2030
2030
|
try {
|
|
2031
|
-
const { exports: l } = await ye((u) => $r(s,
|
|
2031
|
+
const { exports: l } = await ye((u) => $r(s, d, {
|
|
2032
2032
|
status: ["pending", "processing", "chunking", "compacting", "completed", "failed", "cancelled"],
|
|
2033
2033
|
limit: 20
|
|
2034
2034
|
// Limit to recent exports
|
|
@@ -2038,7 +2038,7 @@ function Js() {
|
|
|
2038
2038
|
let h;
|
|
2039
2039
|
if (u.status === "completed")
|
|
2040
2040
|
try {
|
|
2041
|
-
h = await ye((m) => Xe(s,
|
|
2041
|
+
h = await ye((m) => Xe(s, d, u.id, m));
|
|
2042
2042
|
} catch (m) {
|
|
2043
2043
|
console.error(
|
|
2044
2044
|
`[useExportRecovery] Failed to get download URL for ${u.id}:`,
|
|
@@ -2058,7 +2058,7 @@ function Js() {
|
|
|
2058
2058
|
console.error("[useExportRecovery] Failed to recover exports:", l), n.current = !0;
|
|
2059
2059
|
}
|
|
2060
2060
|
})();
|
|
2061
|
-
}, [s,
|
|
2061
|
+
}, [s, d, a, o]);
|
|
2062
2062
|
}
|
|
2063
2063
|
function Dn(e) {
|
|
2064
2064
|
return e.title ? e.title : Te(
|
|
@@ -2067,33 +2067,33 @@ function Dn(e) {
|
|
|
2067
2067
|
}
|
|
2068
2068
|
function En(e, r = []) {
|
|
2069
2069
|
let o = [];
|
|
2070
|
-
function a(s,
|
|
2071
|
-
const
|
|
2072
|
-
|
|
2070
|
+
function a(s, d) {
|
|
2071
|
+
const c = ue.createContext(d);
|
|
2072
|
+
c.displayName = s + "Context";
|
|
2073
2073
|
const l = o.length;
|
|
2074
|
-
o = [...o,
|
|
2074
|
+
o = [...o, d];
|
|
2075
2075
|
const u = (p) => {
|
|
2076
2076
|
var v;
|
|
2077
|
-
const { scope: m, children: g, ...f } = p, b = ((v = m == null ? void 0 : m[e]) == null ? void 0 : v[l]) ||
|
|
2077
|
+
const { scope: m, children: g, ...f } = p, b = ((v = m == null ? void 0 : m[e]) == null ? void 0 : v[l]) || c, k = ue.useMemo(() => f, Object.values(f));
|
|
2078
2078
|
return /* @__PURE__ */ t(b.Provider, { value: k, children: g });
|
|
2079
2079
|
};
|
|
2080
2080
|
u.displayName = s + "Provider";
|
|
2081
2081
|
function h(p, m) {
|
|
2082
2082
|
var b;
|
|
2083
|
-
const g = ((b = m == null ? void 0 : m[e]) == null ? void 0 : b[l]) ||
|
|
2083
|
+
const g = ((b = m == null ? void 0 : m[e]) == null ? void 0 : b[l]) || c, f = ue.useContext(g);
|
|
2084
2084
|
if (f) return f;
|
|
2085
|
-
if (
|
|
2085
|
+
if (d !== void 0) return d;
|
|
2086
2086
|
throw new Error(`\`${p}\` must be used within \`${s}\``);
|
|
2087
2087
|
}
|
|
2088
2088
|
return [u, h];
|
|
2089
2089
|
}
|
|
2090
2090
|
const n = () => {
|
|
2091
|
-
const s = o.map((
|
|
2092
|
-
return function(
|
|
2093
|
-
const l = (
|
|
2091
|
+
const s = o.map((d) => ue.createContext(d));
|
|
2092
|
+
return function(c) {
|
|
2093
|
+
const l = (c == null ? void 0 : c[e]) || s;
|
|
2094
2094
|
return ue.useMemo(
|
|
2095
|
-
() => ({ [`__scope${e}`]: { ...
|
|
2096
|
-
[
|
|
2095
|
+
() => ({ [`__scope${e}`]: { ...c, [e]: l } }),
|
|
2096
|
+
[c, l]
|
|
2097
2097
|
);
|
|
2098
2098
|
};
|
|
2099
2099
|
};
|
|
@@ -2108,11 +2108,11 @@ function kn(...e) {
|
|
|
2108
2108
|
scopeName: n.scopeName
|
|
2109
2109
|
}));
|
|
2110
2110
|
return function(s) {
|
|
2111
|
-
const
|
|
2111
|
+
const d = a.reduce((c, { useScope: l, scopeName: u }) => {
|
|
2112
2112
|
const p = l(s)[`__scope${u}`];
|
|
2113
|
-
return { ...
|
|
2113
|
+
return { ...c, ...p };
|
|
2114
2114
|
}, {});
|
|
2115
|
-
return ue.useMemo(() => ({ [`__scope${r.scopeName}`]:
|
|
2115
|
+
return ue.useMemo(() => ({ [`__scope${r.scopeName}`]: d }), [d]);
|
|
2116
2116
|
};
|
|
2117
2117
|
};
|
|
2118
2118
|
return o.scopeName = r.scopeName, o;
|
|
@@ -2137,8 +2137,8 @@ var An = [
|
|
|
2137
2137
|
"ul"
|
|
2138
2138
|
], nr = An.reduce((e, r) => {
|
|
2139
2139
|
const o = br(`Primitive.${r}`), a = ue.forwardRef((n, s) => {
|
|
2140
|
-
const { asChild:
|
|
2141
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ t(l, { ...
|
|
2140
|
+
const { asChild: d, ...c } = n, l = d ? o : r;
|
|
2141
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ t(l, { ...c, ref: s });
|
|
2142
2142
|
});
|
|
2143
2143
|
return a.displayName = `Primitive.${r}`, { ...e, [r]: a };
|
|
2144
2144
|
}, {}), It = "Progress", Ft = 100, [In] = En(It), [Fn, Pn] = In(It), sr = ue.forwardRef(
|
|
@@ -2148,24 +2148,24 @@ var An = [
|
|
|
2148
2148
|
value: a = null,
|
|
2149
2149
|
max: n,
|
|
2150
2150
|
getValueLabel: s = Tn,
|
|
2151
|
-
...
|
|
2151
|
+
...d
|
|
2152
2152
|
} = e;
|
|
2153
2153
|
(n || n === 0) && !Rt(n) && console.error(Ln(`${n}`, "Progress"));
|
|
2154
|
-
const
|
|
2155
|
-
a !== null && !Bt(a,
|
|
2156
|
-
const l = Bt(a,
|
|
2157
|
-
return /* @__PURE__ */ t(Fn, { scope: o, value: l, max:
|
|
2154
|
+
const c = Rt(n) ? n : Ft;
|
|
2155
|
+
a !== null && !Bt(a, c) && console.error(Un(`${a}`, "Progress"));
|
|
2156
|
+
const l = Bt(a, c) ? a : null, u = Ye(l) ? s(l, c) : void 0;
|
|
2157
|
+
return /* @__PURE__ */ t(Fn, { scope: o, value: l, max: c, children: /* @__PURE__ */ t(
|
|
2158
2158
|
nr.div,
|
|
2159
2159
|
{
|
|
2160
|
-
"aria-valuemax":
|
|
2160
|
+
"aria-valuemax": c,
|
|
2161
2161
|
"aria-valuemin": 0,
|
|
2162
|
-
"aria-valuenow":
|
|
2162
|
+
"aria-valuenow": Ye(l) ? l : void 0,
|
|
2163
2163
|
"aria-valuetext": u,
|
|
2164
2164
|
role: "progressbar",
|
|
2165
|
-
"data-state": lr(l,
|
|
2165
|
+
"data-state": lr(l, c),
|
|
2166
2166
|
"data-value": l ?? void 0,
|
|
2167
|
-
"data-max":
|
|
2168
|
-
...
|
|
2167
|
+
"data-max": c,
|
|
2168
|
+
...d,
|
|
2169
2169
|
ref: r
|
|
2170
2170
|
}
|
|
2171
2171
|
) });
|
|
@@ -2194,14 +2194,14 @@ function Tn(e, r) {
|
|
|
2194
2194
|
function lr(e, r) {
|
|
2195
2195
|
return e == null ? "indeterminate" : e === r ? "complete" : "loading";
|
|
2196
2196
|
}
|
|
2197
|
-
function
|
|
2197
|
+
function Ye(e) {
|
|
2198
2198
|
return typeof e == "number";
|
|
2199
2199
|
}
|
|
2200
2200
|
function Rt(e) {
|
|
2201
|
-
return
|
|
2201
|
+
return Ye(e) && !isNaN(e) && e > 0;
|
|
2202
2202
|
}
|
|
2203
2203
|
function Bt(e, r) {
|
|
2204
|
-
return
|
|
2204
|
+
return Ye(e) && !isNaN(e) && e <= r && e >= 0;
|
|
2205
2205
|
}
|
|
2206
2206
|
function Ln(e, r) {
|
|
2207
2207
|
return `Invalid prop \`max\` of value \`${e}\` supplied to \`${r}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ft}\`.`;
|
|
@@ -2214,12 +2214,12 @@ function Un(e, r) {
|
|
|
2214
2214
|
|
|
2215
2215
|
Defaulting to \`null\`.`;
|
|
2216
2216
|
}
|
|
2217
|
-
var
|
|
2218
|
-
const
|
|
2219
|
-
|
|
2217
|
+
var cr = sr, Vn = ir;
|
|
2218
|
+
const dr = ue.forwardRef(({ className: e, value: r, ...o }, a) => /* @__PURE__ */ t(
|
|
2219
|
+
cr,
|
|
2220
2220
|
{
|
|
2221
2221
|
ref: a,
|
|
2222
|
-
className:
|
|
2222
|
+
className: Z(
|
|
2223
2223
|
"relative h-4 w-full overflow-hidden rounded-full bg-secondary",
|
|
2224
2224
|
e
|
|
2225
2225
|
),
|
|
@@ -2233,7 +2233,7 @@ const cr = ue.forwardRef(({ className: e, value: r, ...o }, a) => /* @__PURE__ *
|
|
|
2233
2233
|
)
|
|
2234
2234
|
}
|
|
2235
2235
|
));
|
|
2236
|
-
|
|
2236
|
+
dr.displayName = cr.displayName;
|
|
2237
2237
|
function Rn({
|
|
2238
2238
|
export: e,
|
|
2239
2239
|
onRemove: r,
|
|
@@ -2251,13 +2251,13 @@ function Rn({
|
|
|
2251
2251
|
n("preparing");
|
|
2252
2252
|
const b = await o(e);
|
|
2253
2253
|
n(b === "denied" ? "denied" : "idle");
|
|
2254
|
-
},
|
|
2254
|
+
}, d = (b) => {
|
|
2255
2255
|
b.stopPropagation(), r == null || r(e.id);
|
|
2256
|
-
},
|
|
2257
|
-
text:
|
|
2258
|
-
detail: e.progress !== null ?
|
|
2256
|
+
}, c = Te(e.status), l = e.status === "pending" ? { text: G.queued } : e.status === "compacting" || e.phase === "finalizing" ? { text: G.finalizing } : e.phase === "preparing" ? { text: G.preparing } : e.phase === "acquiring" ? { text: G.fetchingRows(e.rowsProcessed ?? 0) } : {
|
|
2257
|
+
text: G.processing,
|
|
2258
|
+
detail: e.progress !== null ? G.percentComplete(e.progress) : e.rowsProcessed !== void 0 ? G.rowsProcessed(e.rowsProcessed) : void 0,
|
|
2259
2259
|
bar: e.progress
|
|
2260
|
-
}, u =
|
|
2260
|
+
}, u = c && Date.now() - e.startedAt.getTime() >= zr, h = e.status === "completed" ? "bg-emerald-500" : e.status === "failed" ? "bg-destructive" : e.status === "pending" || e.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", p = e.status === "completed" ? G.ready : e.status === "failed" ? G.failed : e.status === "cancelled" ? G.cancelled : G.inProgress, m = Ut(e.startedAt, { addSuffix: !0 }), g = [
|
|
2261
2261
|
e.status === "completed" && e.totalRows !== null ? `${e.totalRows.toLocaleString()} rows` : null,
|
|
2262
2262
|
e.status === "completed" && e.fileSize ? jr(e.fileSize) : null
|
|
2263
2263
|
].filter((b) => !!b), f = /* @__PURE__ */ t("span", { className: "text-muted-foreground/50", children: "·" });
|
|
@@ -2268,7 +2268,7 @@ function Rn({
|
|
|
2268
2268
|
/* @__PURE__ */ i("div", { className: "flex h-5 items-center gap-2", children: [
|
|
2269
2269
|
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: e.title }),
|
|
2270
2270
|
e.status === "completed" && a === "preparing" && /* @__PURE__ */ i("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: [
|
|
2271
|
-
/* @__PURE__ */ t(
|
|
2271
|
+
/* @__PURE__ */ t(Qt, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }),
|
|
2272
2272
|
"Preparing"
|
|
2273
2273
|
] }),
|
|
2274
2274
|
e.status === "completed" && a !== "preparing" && /* @__PURE__ */ t(
|
|
@@ -2286,7 +2286,7 @@ function Rn({
|
|
|
2286
2286
|
variant: "ghost",
|
|
2287
2287
|
size: "xs",
|
|
2288
2288
|
className: "-mr-1.5 h-5 w-5 shrink-0 px-0 text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100",
|
|
2289
|
-
onClick:
|
|
2289
|
+
onClick: d,
|
|
2290
2290
|
"aria-label": "Remove notification",
|
|
2291
2291
|
title: "Remove",
|
|
2292
2292
|
children: /* @__PURE__ */ t(Me, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
|
|
@@ -2306,9 +2306,9 @@ function Rn({
|
|
|
2306
2306
|
] }),
|
|
2307
2307
|
e.status === "completed" && a === "denied" && /* @__PURE__ */ i("div", { role: "alert", className: "mt-1 flex items-start gap-1.5 text-[12px] leading-4 text-foreground", children: [
|
|
2308
2308
|
/* @__PURE__ */ t(Wr, { className: "mt-0.5 h-3 w-3 shrink-0 text-destructive", strokeWidth: 1.75 }),
|
|
2309
|
-
/* @__PURE__ */ t("span", { children:
|
|
2309
|
+
/* @__PURE__ */ t("span", { children: G.linkExpired })
|
|
2310
2310
|
] }),
|
|
2311
|
-
|
|
2311
|
+
c && /* @__PURE__ */ i("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
|
|
2312
2312
|
/* @__PURE__ */ t("span", { className: "tabular-nums", children: l.text }),
|
|
2313
2313
|
l.detail && /* @__PURE__ */ i($, { children: [
|
|
2314
2314
|
" ",
|
|
@@ -2319,28 +2319,28 @@ function Rn({
|
|
|
2319
2319
|
" ",
|
|
2320
2320
|
f,
|
|
2321
2321
|
" ",
|
|
2322
|
-
/* @__PURE__ */ t("span", { children:
|
|
2323
|
-
l.bar !== void 0 && l.bar !== null && /* @__PURE__ */ t(
|
|
2324
|
-
u && /* @__PURE__ */ t("div", { className: "mt-1", children:
|
|
2322
|
+
/* @__PURE__ */ t("span", { children: G.started(Ut(e.startedAt)) }),
|
|
2323
|
+
l.bar !== void 0 && l.bar !== null && /* @__PURE__ */ t(dr, { value: l.bar, className: "mt-1.5 h-1" }),
|
|
2324
|
+
u && /* @__PURE__ */ t("div", { className: "mt-1", children: G.longRunning })
|
|
2325
2325
|
] }),
|
|
2326
2326
|
e.status === "cancelled" && /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
|
|
2327
|
-
/* @__PURE__ */ t("span", { children:
|
|
2327
|
+
/* @__PURE__ */ t("span", { children: G.cancelled }),
|
|
2328
2328
|
f,
|
|
2329
2329
|
/* @__PURE__ */ t("span", { children: m })
|
|
2330
2330
|
] }),
|
|
2331
2331
|
e.status === "failed" && /* @__PURE__ */ i($, { children: [
|
|
2332
2332
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
|
|
2333
|
-
/* @__PURE__ */ t("span", { children:
|
|
2333
|
+
/* @__PURE__ */ t("span", { children: G.failed }),
|
|
2334
2334
|
f,
|
|
2335
2335
|
/* @__PURE__ */ t("span", { children: m })
|
|
2336
2336
|
] }),
|
|
2337
|
-
/* @__PURE__ */ t("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: e.error ||
|
|
2337
|
+
/* @__PURE__ */ t("div", { className: "mt-1 whitespace-pre-wrap break-words text-[12px] leading-4 text-destructive", children: e.error || G.failedFallback })
|
|
2338
2338
|
] })
|
|
2339
2339
|
] })
|
|
2340
2340
|
] });
|
|
2341
2341
|
}
|
|
2342
2342
|
function Bn() {
|
|
2343
|
-
const { authToken: e, tokenProps: r } = Be(), o = xe((v) => v.activeExports), { clearCompleted: a, removeExport: n, updateExport: s, applyServerStatus:
|
|
2343
|
+
const { authToken: e, tokenProps: r } = Be(), o = xe((v) => v.activeExports), { clearCompleted: a, removeExport: n, updateExport: s, applyServerStatus: d } = Gt(), [c, l] = F(!1), [u, h] = F(!1), p = Array.from(o.values()).sort(
|
|
2344
2344
|
(v, D) => D.startedAt.getTime() - v.startedAt.getTime()
|
|
2345
2345
|
), m = p.some(
|
|
2346
2346
|
(v) => v.status === "completed" || v.status === "failed" || v.status === "cancelled"
|
|
@@ -2366,7 +2366,7 @@ function Bn() {
|
|
|
2366
2366
|
} catch (S) {
|
|
2367
2367
|
console.error(`Failed to get download URL for ${N.id}:`, S);
|
|
2368
2368
|
}
|
|
2369
|
-
|
|
2369
|
+
d(N.id, At(y, w));
|
|
2370
2370
|
} catch (y) {
|
|
2371
2371
|
s(N.id, { downloadUrl: void 0 }), console.error(`Failed to refresh export ${N.id}:`, y);
|
|
2372
2372
|
}
|
|
@@ -2381,7 +2381,7 @@ function Bn() {
|
|
|
2381
2381
|
e == null ? void 0 : e.accessToken,
|
|
2382
2382
|
r == null ? void 0 : r.apiServiceUrl,
|
|
2383
2383
|
s,
|
|
2384
|
-
|
|
2384
|
+
d
|
|
2385
2385
|
]), f = j(async () => {
|
|
2386
2386
|
const v = r == null ? void 0 : r.apiServiceUrl, D = e == null ? void 0 : e.accessToken;
|
|
2387
2387
|
if (!v || !D) {
|
|
@@ -2461,14 +2461,14 @@ function Bn() {
|
|
|
2461
2461
|
size: "xs",
|
|
2462
2462
|
className: "h-6 w-6 px-0 text-muted-foreground hover:text-foreground",
|
|
2463
2463
|
onClick: g,
|
|
2464
|
-
disabled:
|
|
2464
|
+
disabled: c,
|
|
2465
2465
|
title: "Refresh status",
|
|
2466
2466
|
"aria-label": "Refresh status",
|
|
2467
2467
|
children: /* @__PURE__ */ t(
|
|
2468
|
-
|
|
2468
|
+
Qt,
|
|
2469
2469
|
{
|
|
2470
2470
|
strokeWidth: 1.75,
|
|
2471
|
-
className: `h-3.5 w-3.5 ${
|
|
2471
|
+
className: `h-3.5 w-3.5 ${c ? "animate-spin" : ""}`
|
|
2472
2472
|
}
|
|
2473
2473
|
)
|
|
2474
2474
|
}
|
|
@@ -2491,7 +2491,7 @@ function eo({
|
|
|
2491
2491
|
}) {
|
|
2492
2492
|
const r = xe((l) => l.activeExports), o = qr(), a = r.size > 0, n = Array.from(r.values()).some(
|
|
2493
2493
|
(l) => l.status === "completed" || l.status === "failed"
|
|
2494
|
-
),
|
|
2494
|
+
), d = o > 0 ? o > 9 ? "9+" : String(o) : null;
|
|
2495
2495
|
return /* @__PURE__ */ i(qe, { children: [
|
|
2496
2496
|
/* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ i(
|
|
2497
2497
|
U,
|
|
@@ -2505,14 +2505,14 @@ function eo({
|
|
|
2505
2505
|
a && /* @__PURE__ */ t(
|
|
2506
2506
|
"span",
|
|
2507
2507
|
{
|
|
2508
|
-
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${
|
|
2509
|
-
children:
|
|
2508
|
+
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"}`,
|
|
2509
|
+
children: d
|
|
2510
2510
|
}
|
|
2511
2511
|
)
|
|
2512
2512
|
]
|
|
2513
2513
|
}
|
|
2514
2514
|
) }),
|
|
2515
|
-
/* @__PURE__ */ t(
|
|
2515
|
+
/* @__PURE__ */ t(Ge, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(Bn, {}) })
|
|
2516
2516
|
] });
|
|
2517
2517
|
}
|
|
2518
2518
|
function Mn(e) {
|
|
@@ -2532,8 +2532,8 @@ function _n({
|
|
|
2532
2532
|
initialMode: n = "manage"
|
|
2533
2533
|
}) {
|
|
2534
2534
|
const s = n === "create", {
|
|
2535
|
-
forceClose:
|
|
2536
|
-
handleOpenChange:
|
|
2535
|
+
forceClose: d,
|
|
2536
|
+
handleOpenChange: c,
|
|
2537
2537
|
isCreateFlowActive: l,
|
|
2538
2538
|
preventPassiveDismissDuringCreate: u,
|
|
2539
2539
|
resolvedOpen: h,
|
|
@@ -2549,7 +2549,7 @@ function _n({
|
|
|
2549
2549
|
// create and make consumers use `forceClose()` from a dedicated
|
|
2550
2550
|
// button.
|
|
2551
2551
|
dismissMode: a ? "passive" : "explicit-only"
|
|
2552
|
-
}), m = T((x) => x.dashboard), { setDashboardControlsModel: g } = pe(), { participants: f } =
|
|
2552
|
+
}), m = T((x) => x.dashboard), { setDashboardControlsModel: g } = pe(), { participants: f } = Gr(La(m)), b = Array.from(
|
|
2553
2553
|
new Map(
|
|
2554
2554
|
f.flatMap(
|
|
2555
2555
|
(x) => x.fieldChoices.map((B) => {
|
|
@@ -2582,7 +2582,7 @@ function _n({
|
|
|
2582
2582
|
), v = Ea({
|
|
2583
2583
|
...m || {},
|
|
2584
2584
|
controls: []
|
|
2585
|
-
}), D =
|
|
2585
|
+
}), D = Qr(m), E = (x, B, I) => {
|
|
2586
2586
|
g(
|
|
2587
2587
|
x,
|
|
2588
2588
|
B,
|
|
@@ -2590,11 +2590,11 @@ function _n({
|
|
|
2590
2590
|
);
|
|
2591
2591
|
}, N = j(() => {
|
|
2592
2592
|
if (s) {
|
|
2593
|
-
|
|
2593
|
+
d();
|
|
2594
2594
|
return;
|
|
2595
2595
|
}
|
|
2596
2596
|
p(!1);
|
|
2597
|
-
}, [s,
|
|
2597
|
+
}, [s, d, p]), y = /* @__PURE__ */ t(
|
|
2598
2598
|
er,
|
|
2599
2599
|
{
|
|
2600
2600
|
scope: "dashboard",
|
|
@@ -2619,13 +2619,13 @@ function _n({
|
|
|
2619
2619
|
] }),
|
|
2620
2620
|
y
|
|
2621
2621
|
] });
|
|
2622
|
-
return a ? /* @__PURE__ */ i(qe, { open: h, onOpenChange:
|
|
2622
|
+
return a ? /* @__PURE__ */ i(qe, { open: h, onOpenChange: c, children: [
|
|
2623
2623
|
/* @__PURE__ */ t(He, { asChild: !0, children: o || /* @__PURE__ */ i(U, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
2624
2624
|
/* @__PURE__ */ t($t, { className: "mr-2 h-4 w-4" }),
|
|
2625
2625
|
"Controls"
|
|
2626
2626
|
] }) }),
|
|
2627
2627
|
/* @__PURE__ */ t(
|
|
2628
|
-
|
|
2628
|
+
Ge,
|
|
2629
2629
|
{
|
|
2630
2630
|
className: "w-[620px] max-w-[95vw] space-y-4",
|
|
2631
2631
|
align: "end",
|
|
@@ -2634,7 +2634,7 @@ function _n({
|
|
|
2634
2634
|
children: S
|
|
2635
2635
|
}
|
|
2636
2636
|
)
|
|
2637
|
-
] }) : /* @__PURE__ */ t(Ue, { open: h, onOpenChange:
|
|
2637
|
+
] }) : /* @__PURE__ */ t(Ue, { open: h, onOpenChange: c, children: /* @__PURE__ */ i(
|
|
2638
2638
|
Ve,
|
|
2639
2639
|
{
|
|
2640
2640
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
@@ -2679,8 +2679,8 @@ function $n({
|
|
|
2679
2679
|
const a = o === "create", {
|
|
2680
2680
|
forceClose: n,
|
|
2681
2681
|
handleOpenChange: s,
|
|
2682
|
-
isCreateFlowActive:
|
|
2683
|
-
preventPassiveDismissDuringCreate:
|
|
2682
|
+
isCreateFlowActive: d,
|
|
2683
|
+
preventPassiveDismissDuringCreate: c,
|
|
2684
2684
|
resolvedOpen: l,
|
|
2685
2685
|
setIsCreateFlowActive: u
|
|
2686
2686
|
} = Jt({
|
|
@@ -2738,16 +2738,16 @@ function $n({
|
|
|
2738
2738
|
Ve,
|
|
2739
2739
|
{
|
|
2740
2740
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
2741
|
-
onEscapeKeyDown:
|
|
2742
|
-
onPointerDownOutside:
|
|
2741
|
+
onEscapeKeyDown: c,
|
|
2742
|
+
onPointerDownOutside: c,
|
|
2743
2743
|
children: [
|
|
2744
|
-
/* @__PURE__ */ i(wt, { className:
|
|
2745
|
-
/* @__PURE__ */ t(Re, { className: "text-[15px]", children:
|
|
2744
|
+
/* @__PURE__ */ i(wt, { className: d ? "space-y-0" : void 0, children: [
|
|
2745
|
+
/* @__PURE__ */ t(Re, { className: "text-[15px]", children: d ? "Add document control" : "Document Controls" }),
|
|
2746
2746
|
/* @__PURE__ */ t(
|
|
2747
2747
|
Nt,
|
|
2748
2748
|
{
|
|
2749
|
-
className:
|
|
2750
|
-
children:
|
|
2749
|
+
className: d ? "sr-only" : "text-[13px]",
|
|
2750
|
+
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."
|
|
2751
2751
|
}
|
|
2752
2752
|
)
|
|
2753
2753
|
] }),
|
|
@@ -2798,18 +2798,18 @@ function qn({
|
|
|
2798
2798
|
nextDefaultValues: n,
|
|
2799
2799
|
change: s
|
|
2800
2800
|
}) {
|
|
2801
|
-
const
|
|
2801
|
+
const d = new Map(
|
|
2802
2802
|
a.map((m) => [
|
|
2803
2803
|
m.id,
|
|
2804
2804
|
Wn(m, n)
|
|
2805
2805
|
])
|
|
2806
|
-
),
|
|
2806
|
+
), c = (s == null ? void 0 : s.type) === "rename" ? { oldId: s.oldId, newId: s.newId } : null, l = /* @__PURE__ */ new Set(), u = [];
|
|
2807
2807
|
for (const m of o) {
|
|
2808
2808
|
if (m.kind !== "control") {
|
|
2809
2809
|
u.push(m);
|
|
2810
2810
|
continue;
|
|
2811
2811
|
}
|
|
2812
|
-
const g =
|
|
2812
|
+
const g = d.get(m.control.id) || ((c == null ? void 0 : c.oldId) === m.control.id ? d.get(c.newId) : void 0);
|
|
2813
2813
|
if (!g)
|
|
2814
2814
|
continue;
|
|
2815
2815
|
l.add(g.id);
|
|
@@ -2827,7 +2827,7 @@ function qn({
|
|
|
2827
2827
|
control: b
|
|
2828
2828
|
});
|
|
2829
2829
|
}
|
|
2830
|
-
for (const m of
|
|
2830
|
+
for (const m of d.values())
|
|
2831
2831
|
l.has(m.id) || u.push(
|
|
2832
2832
|
Ia({
|
|
2833
2833
|
control: m,
|
|
@@ -2849,8 +2849,8 @@ function Hn({
|
|
|
2849
2849
|
settingsContent: a,
|
|
2850
2850
|
size: n = "default",
|
|
2851
2851
|
className: s,
|
|
2852
|
-
primaryButtonClassName:
|
|
2853
|
-
secondaryButtonClassName:
|
|
2852
|
+
primaryButtonClassName: d,
|
|
2853
|
+
secondaryButtonClassName: c,
|
|
2854
2854
|
pickerContentClassName: l,
|
|
2855
2855
|
settingsContentClassName: u
|
|
2856
2856
|
}) {
|
|
@@ -2858,7 +2858,7 @@ function Hn({
|
|
|
2858
2858
|
return /* @__PURE__ */ i(
|
|
2859
2859
|
"div",
|
|
2860
2860
|
{
|
|
2861
|
-
className:
|
|
2861
|
+
className: Z(
|
|
2862
2862
|
// Height lives on the shell so the outer border is part of the
|
|
2863
2863
|
// h-7 box (matches regular `size="xs"` buttons). Inner triggers
|
|
2864
2864
|
// stretch to fill via `h-full`.
|
|
@@ -2873,9 +2873,9 @@ function Hn({
|
|
|
2873
2873
|
{
|
|
2874
2874
|
variant: "ghost",
|
|
2875
2875
|
size: "xs",
|
|
2876
|
-
className:
|
|
2876
|
+
className: Z(
|
|
2877
2877
|
"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",
|
|
2878
|
-
|
|
2878
|
+
d
|
|
2879
2879
|
),
|
|
2880
2880
|
children: [
|
|
2881
2881
|
e ? /* @__PURE__ */ t(Ba, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Kt, { className: "h-3.5 w-3.5" }),
|
|
@@ -2884,11 +2884,11 @@ function Hn({
|
|
|
2884
2884
|
}
|
|
2885
2885
|
) }),
|
|
2886
2886
|
/* @__PURE__ */ t(
|
|
2887
|
-
|
|
2887
|
+
Ge,
|
|
2888
2888
|
{
|
|
2889
2889
|
align: "end",
|
|
2890
2890
|
sideOffset: 6,
|
|
2891
|
-
className:
|
|
2891
|
+
className: Z(
|
|
2892
2892
|
"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)]",
|
|
2893
2893
|
l
|
|
2894
2894
|
),
|
|
@@ -2903,20 +2903,20 @@ function Hn({
|
|
|
2903
2903
|
{
|
|
2904
2904
|
variant: "ghost",
|
|
2905
2905
|
size: "xs",
|
|
2906
|
-
className:
|
|
2906
|
+
className: Z(
|
|
2907
2907
|
"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",
|
|
2908
|
-
|
|
2908
|
+
c
|
|
2909
2909
|
),
|
|
2910
2910
|
"aria-label": "Filter and control actions",
|
|
2911
|
-
children: /* @__PURE__ */ t(
|
|
2911
|
+
children: /* @__PURE__ */ t(Zt, { className: "h-3.5 w-3.5" })
|
|
2912
2912
|
}
|
|
2913
2913
|
) }),
|
|
2914
2914
|
/* @__PURE__ */ t(
|
|
2915
|
-
|
|
2915
|
+
Ge,
|
|
2916
2916
|
{
|
|
2917
2917
|
align: "end",
|
|
2918
2918
|
sideOffset: 6,
|
|
2919
|
-
className:
|
|
2919
|
+
className: Z(
|
|
2920
2920
|
"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)]",
|
|
2921
2921
|
u
|
|
2922
2922
|
),
|
|
@@ -2929,9 +2929,9 @@ function Hn({
|
|
|
2929
2929
|
}
|
|
2930
2930
|
);
|
|
2931
2931
|
}
|
|
2932
|
-
function
|
|
2932
|
+
function Gn() {
|
|
2933
2933
|
Ma();
|
|
2934
|
-
const e = T((l) => l.selectedSheetId), r = T((l) => l.selectedFrameId), o = T((l) => l.dashboard), a = T((l) => l.actions.getSelectedFrame), { setSelectedFrameId: n } = pe(), { setCard: s } = tt(),
|
|
2934
|
+
const e = T((l) => l.selectedSheetId), r = T((l) => l.selectedFrameId), o = T((l) => l.dashboard), a = T((l) => l.actions.getSelectedFrame), { setSelectedFrameId: n } = pe(), { setCard: s } = tt(), d = ee((l) => l.card.dataSource);
|
|
2935
2935
|
return J(() => {
|
|
2936
2936
|
var u, h;
|
|
2937
2937
|
let l = a();
|
|
@@ -2944,18 +2944,18 @@ function Qn() {
|
|
|
2944
2944
|
p && s(p);
|
|
2945
2945
|
}
|
|
2946
2946
|
}, [a, e, r, o, n, s]), {
|
|
2947
|
-
hasEntities: !!(
|
|
2947
|
+
hasEntities: !!(d != null && d.selectedEntities && d.selectedEntities.length > 0)
|
|
2948
2948
|
};
|
|
2949
2949
|
}
|
|
2950
|
-
function
|
|
2950
|
+
function Qn() {
|
|
2951
2951
|
const e = T((l) => l.dashboard), r = T(
|
|
2952
2952
|
(l) => l.semanticExecutionPayload
|
|
2953
|
-
), o = T((l) => l.actions.addFilter), { hasEntities: a } =
|
|
2953
|
+
), o = T((l) => l.actions.addFilter), { hasEntities: a } = Gn(), { isLoading: n } = Xr(), s = oe(
|
|
2954
2954
|
() => Fa(e, r),
|
|
2955
2955
|
[e, r]
|
|
2956
|
-
),
|
|
2956
|
+
), c = !Pa(e.filters) && s.hasEligibleCards && !n;
|
|
2957
2957
|
return /* @__PURE__ */ i("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
|
|
2958
|
-
|
|
2958
|
+
c && /* @__PURE__ */ t("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ i(
|
|
2959
2959
|
"button",
|
|
2960
2960
|
{
|
|
2961
2961
|
type: "button",
|
|
@@ -2972,11 +2972,11 @@ function Gn() {
|
|
|
2972
2972
|
}
|
|
2973
2973
|
) }),
|
|
2974
2974
|
!a && /* @__PURE__ */ i("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
|
|
2975
|
-
/* @__PURE__ */ t(
|
|
2975
|
+
/* @__PURE__ */ t(Zr, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
|
|
2976
2976
|
/* @__PURE__ */ t("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
|
|
2977
2977
|
/* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
|
|
2978
2978
|
] }),
|
|
2979
|
-
a && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(
|
|
2979
|
+
a && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(Yr, { context: "filter" }) })
|
|
2980
2980
|
] });
|
|
2981
2981
|
}
|
|
2982
2982
|
const Mt = !1;
|
|
@@ -2987,14 +2987,14 @@ function Kn({
|
|
|
2987
2987
|
onDismiss: a
|
|
2988
2988
|
}) {
|
|
2989
2989
|
const n = T(
|
|
2990
|
-
(
|
|
2990
|
+
(c) => c.dashboard.filterLayout
|
|
2991
2991
|
), { setFilterLayout: s } = pe();
|
|
2992
2992
|
n != null && n.displayMode;
|
|
2993
|
-
const
|
|
2993
|
+
const d = (n == null ? void 0 : n.toolbarWrap) ?? !1;
|
|
2994
2994
|
return n == null || n.showDownloadButton, /* @__PURE__ */ i("div", { className: "w-[300px]", children: [
|
|
2995
2995
|
/* @__PURE__ */ i("div", { className: "p-1", children: [
|
|
2996
2996
|
/* @__PURE__ */ t(
|
|
2997
|
-
|
|
2997
|
+
ct,
|
|
2998
2998
|
{
|
|
2999
2999
|
icon: Kt,
|
|
3000
3000
|
label: "Add filter",
|
|
@@ -3004,7 +3004,7 @@ function Kn({
|
|
|
3004
3004
|
}
|
|
3005
3005
|
),
|
|
3006
3006
|
/* @__PURE__ */ t(
|
|
3007
|
-
|
|
3007
|
+
ct,
|
|
3008
3008
|
{
|
|
3009
3009
|
icon: $t,
|
|
3010
3010
|
label: "Add control",
|
|
@@ -3014,7 +3014,7 @@ function Kn({
|
|
|
3014
3014
|
}
|
|
3015
3015
|
),
|
|
3016
3016
|
/* @__PURE__ */ t(
|
|
3017
|
-
|
|
3017
|
+
ct,
|
|
3018
3018
|
{
|
|
3019
3019
|
icon: Xt,
|
|
3020
3020
|
label: "Manage controls",
|
|
@@ -3033,15 +3033,15 @@ function Kn({
|
|
|
3033
3033
|
{
|
|
3034
3034
|
id: "filter-display-wrap",
|
|
3035
3035
|
label: "Wrap to multiple lines",
|
|
3036
|
-
checked:
|
|
3037
|
-
onCheckedChange: (
|
|
3036
|
+
checked: d,
|
|
3037
|
+
onCheckedChange: (c) => s({ toolbarWrap: c === !0 })
|
|
3038
3038
|
}
|
|
3039
3039
|
),
|
|
3040
3040
|
Mt
|
|
3041
3041
|
] })
|
|
3042
3042
|
] });
|
|
3043
3043
|
}
|
|
3044
|
-
function
|
|
3044
|
+
function ct({
|
|
3045
3045
|
icon: e,
|
|
3046
3046
|
label: r,
|
|
3047
3047
|
onClick: o
|
|
@@ -3086,11 +3086,11 @@ function to({
|
|
|
3086
3086
|
settingsContentClassName: s
|
|
3087
3087
|
}) {
|
|
3088
3088
|
var y;
|
|
3089
|
-
const [
|
|
3089
|
+
const [d, c] = F(null), l = T((w) => w.dashboard), u = T((w) => w.selectedSheetId), h = T((w) => w.showFilters), p = T((w) => w.actions), { setDocumentPanelTarget: m, setShowFilters: g } = p, f = (y = l.sheets) == null ? void 0 : y.find(
|
|
3090
3090
|
(w) => w.id === u
|
|
3091
3091
|
), b = _a(f), k = j((w) => {
|
|
3092
3092
|
window.setTimeout(() => {
|
|
3093
|
-
|
|
3093
|
+
c(w);
|
|
3094
3094
|
}, 0);
|
|
3095
3095
|
}, []), v = j(
|
|
3096
3096
|
(w) => {
|
|
@@ -3122,7 +3122,7 @@ function to({
|
|
|
3122
3122
|
{
|
|
3123
3123
|
showFilters: b ? !1 : h,
|
|
3124
3124
|
onShowFiltersChange: v,
|
|
3125
|
-
pickerContent: /* @__PURE__ */ t(
|
|
3125
|
+
pickerContent: /* @__PURE__ */ t(Qn, {}),
|
|
3126
3126
|
settingsContent: (w) => /* @__PURE__ */ t(
|
|
3127
3127
|
Kn,
|
|
3128
3128
|
{
|
|
@@ -3140,29 +3140,29 @@ function to({
|
|
|
3140
3140
|
settingsContentClassName: s
|
|
3141
3141
|
}
|
|
3142
3142
|
),
|
|
3143
|
-
|
|
3143
|
+
d ? b ? /* @__PURE__ */ t(
|
|
3144
3144
|
$n,
|
|
3145
3145
|
{
|
|
3146
3146
|
open: !0,
|
|
3147
3147
|
onOpenChange: (w) => {
|
|
3148
|
-
w ||
|
|
3148
|
+
w || c(null);
|
|
3149
3149
|
},
|
|
3150
|
-
initialMode:
|
|
3150
|
+
initialMode: d
|
|
3151
3151
|
}
|
|
3152
3152
|
) : /* @__PURE__ */ t(
|
|
3153
3153
|
_n,
|
|
3154
3154
|
{
|
|
3155
3155
|
open: !0,
|
|
3156
3156
|
onOpenChange: (w) => {
|
|
3157
|
-
w ||
|
|
3157
|
+
w || c(null);
|
|
3158
3158
|
},
|
|
3159
3159
|
showTrigger: !1,
|
|
3160
|
-
initialMode:
|
|
3160
|
+
initialMode: d
|
|
3161
3161
|
}
|
|
3162
3162
|
) : null
|
|
3163
3163
|
] });
|
|
3164
3164
|
}
|
|
3165
|
-
function
|
|
3165
|
+
function Zn({
|
|
3166
3166
|
disabled: e,
|
|
3167
3167
|
briefingCount: r,
|
|
3168
3168
|
className: o,
|
|
@@ -3176,18 +3176,18 @@ function Yn({
|
|
|
3176
3176
|
size: "xs",
|
|
3177
3177
|
variant: "outline",
|
|
3178
3178
|
disabled: e,
|
|
3179
|
-
className:
|
|
3179
|
+
className: Z("gap-1.5", o),
|
|
3180
3180
|
onClick: a,
|
|
3181
3181
|
"aria-label": "Reports & briefings",
|
|
3182
3182
|
children: [
|
|
3183
|
-
/* @__PURE__ */ t(
|
|
3183
|
+
/* @__PURE__ */ t(Ga, { className: "h-3.5 w-3.5" }),
|
|
3184
3184
|
"Reports & briefings",
|
|
3185
3185
|
n ? /* @__PURE__ */ t("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: r }) : null
|
|
3186
3186
|
]
|
|
3187
3187
|
}
|
|
3188
3188
|
);
|
|
3189
3189
|
}
|
|
3190
|
-
const
|
|
3190
|
+
const Yn = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", ur = "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", We = "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";
|
|
3191
3191
|
function Jn(e) {
|
|
3192
3192
|
return e === "dashboard" ? "This dashboard" : "Project";
|
|
3193
3193
|
}
|
|
@@ -3202,8 +3202,8 @@ function es(e) {
|
|
|
3202
3202
|
if (n < 24) return `${n}h ago`;
|
|
3203
3203
|
const s = Math.round(n / 24);
|
|
3204
3204
|
if (s < 7) return `${s}d ago`;
|
|
3205
|
-
const
|
|
3206
|
-
return
|
|
3205
|
+
const d = Math.round(s / 7);
|
|
3206
|
+
return d < 5 ? `${d}w ago` : `${Math.round(s / 30)}mo ago`;
|
|
3207
3207
|
}
|
|
3208
3208
|
function ts(e) {
|
|
3209
3209
|
return e.scheduleExpr ? Oa(
|
|
@@ -3243,7 +3243,7 @@ function ns({
|
|
|
3243
3243
|
role: "tab",
|
|
3244
3244
|
"aria-selected": a,
|
|
3245
3245
|
onClick: () => r(o),
|
|
3246
|
-
className:
|
|
3246
|
+
className: Z(
|
|
3247
3247
|
"h-6 rounded-[3px] px-2 text-[11px] transition-colors",
|
|
3248
3248
|
a ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
3249
3249
|
),
|
|
@@ -3262,8 +3262,8 @@ function ss({
|
|
|
3262
3262
|
error: a,
|
|
3263
3263
|
loading: n,
|
|
3264
3264
|
onSourceViewChange: s,
|
|
3265
|
-
onClose:
|
|
3266
|
-
onEdit:
|
|
3265
|
+
onClose: d,
|
|
3266
|
+
onEdit: c,
|
|
3267
3267
|
onNew: l,
|
|
3268
3268
|
canCreate: u,
|
|
3269
3269
|
canCreateScheduledReport: h,
|
|
@@ -3286,14 +3286,14 @@ function ss({
|
|
|
3286
3286
|
children: [
|
|
3287
3287
|
E ? null : /* @__PURE__ */ i("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
|
|
3288
3288
|
/* @__PURE__ */ i("div", { className: "min-w-0", children: [
|
|
3289
|
-
/* @__PURE__ */ t("div", { className:
|
|
3289
|
+
/* @__PURE__ */ t("div", { className: Yn, children: x }),
|
|
3290
3290
|
/* @__PURE__ */ t("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: B })
|
|
3291
3291
|
] }),
|
|
3292
3292
|
/* @__PURE__ */ t(
|
|
3293
3293
|
"button",
|
|
3294
3294
|
{
|
|
3295
3295
|
type: "button",
|
|
3296
|
-
onClick:
|
|
3296
|
+
onClick: d,
|
|
3297
3297
|
className: "rounded-control p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
3298
3298
|
"aria-label": `Close ${x.replace("&", "and")} panel`,
|
|
3299
3299
|
children: /* @__PURE__ */ t(Me, { className: "h-3.5 w-3.5" })
|
|
@@ -3400,7 +3400,7 @@ function ss({
|
|
|
3400
3400
|
briefing: I,
|
|
3401
3401
|
isOpening: b === I.id,
|
|
3402
3402
|
isBusy: k === I.id,
|
|
3403
|
-
onOpen: () =>
|
|
3403
|
+
onOpen: () => c(I.id),
|
|
3404
3404
|
onRunNow: () => m(I),
|
|
3405
3405
|
onTogglePause: () => g(I),
|
|
3406
3406
|
onDelete: () => f(I)
|
|
@@ -3412,7 +3412,7 @@ function ss({
|
|
|
3412
3412
|
"a",
|
|
3413
3413
|
{
|
|
3414
3414
|
href: v,
|
|
3415
|
-
className:
|
|
3415
|
+
className: Z(ur, "h-6 px-1 text-[11px]"),
|
|
3416
3416
|
children: [
|
|
3417
3417
|
"Manage all reports & briefings",
|
|
3418
3418
|
/* @__PURE__ */ t(za, { className: "h-3 w-3" })
|
|
@@ -3648,15 +3648,15 @@ function ls({
|
|
|
3648
3648
|
onOpen: a,
|
|
3649
3649
|
onRunNow: n,
|
|
3650
3650
|
onTogglePause: s,
|
|
3651
|
-
onDelete:
|
|
3651
|
+
onDelete: d
|
|
3652
3652
|
}) {
|
|
3653
|
-
const
|
|
3653
|
+
const c = e.status === "PAUSED", l = e.hasActiveRun, u = rs(e), h = es(e.lastRunAt), p = e.lastRunStatus, m = me(e), g = p === "SUCCESS" ? ze.success.dot : p === "FAILED" ? ze.danger.dot : p ? ze.warning.dot : ze.neutral.dot;
|
|
3654
3654
|
return /* @__PURE__ */ i(
|
|
3655
3655
|
"div",
|
|
3656
3656
|
{
|
|
3657
|
-
className:
|
|
3657
|
+
className: Z(
|
|
3658
3658
|
"group relative border-b border-border/60 px-4 py-3 transition-colors hover:bg-muted/60",
|
|
3659
|
-
|
|
3659
|
+
c && "opacity-70"
|
|
3660
3660
|
),
|
|
3661
3661
|
children: [
|
|
3662
3662
|
/* @__PURE__ */ i(
|
|
@@ -3672,7 +3672,7 @@ function ls({
|
|
|
3672
3672
|
children: [
|
|
3673
3673
|
/* @__PURE__ */ i("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
3674
3674
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.name }),
|
|
3675
|
-
|
|
3675
|
+
c ? /* @__PURE__ */ t("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
|
|
3676
3676
|
] }),
|
|
3677
3677
|
/* @__PURE__ */ i("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
|
|
3678
3678
|
/* @__PURE__ */ t("span", { children: m.typeLabel }),
|
|
@@ -3693,7 +3693,7 @@ function ls({
|
|
|
3693
3693
|
l ? /* @__PURE__ */ t(ie, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ t(
|
|
3694
3694
|
"span",
|
|
3695
3695
|
{
|
|
3696
|
-
className:
|
|
3696
|
+
className: Z(
|
|
3697
3697
|
"inline-block h-1.5 w-1.5 shrink-0 rounded-full",
|
|
3698
3698
|
g
|
|
3699
3699
|
)
|
|
@@ -3739,7 +3739,7 @@ function ls({
|
|
|
3739
3739
|
onClick: (f) => {
|
|
3740
3740
|
f.preventDefault(), s();
|
|
3741
3741
|
},
|
|
3742
|
-
children:
|
|
3742
|
+
children: c ? /* @__PURE__ */ i($, { children: [
|
|
3743
3743
|
/* @__PURE__ */ t(ta, { className: "h-3.5 w-3.5" }),
|
|
3744
3744
|
"Resume"
|
|
3745
3745
|
] }) : /* @__PURE__ */ i($, { children: [
|
|
@@ -3753,11 +3753,11 @@ function ls({
|
|
|
3753
3753
|
X,
|
|
3754
3754
|
{
|
|
3755
3755
|
onClick: (f) => {
|
|
3756
|
-
f.preventDefault(),
|
|
3756
|
+
f.preventDefault(), d();
|
|
3757
3757
|
},
|
|
3758
3758
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
3759
3759
|
children: [
|
|
3760
|
-
/* @__PURE__ */ t(
|
|
3760
|
+
/* @__PURE__ */ t(Qe, { className: "h-3.5 w-3.5" }),
|
|
3761
3761
|
"Delete ",
|
|
3762
3762
|
m.noun
|
|
3763
3763
|
]
|
|
@@ -3769,7 +3769,7 @@ function ls({
|
|
|
3769
3769
|
}
|
|
3770
3770
|
);
|
|
3771
3771
|
}
|
|
3772
|
-
const
|
|
3772
|
+
const cs = 2e3, ds = 20 * 6e4;
|
|
3773
3773
|
function us(e) {
|
|
3774
3774
|
return (e == null ? void 0 : e.trim()) || "This dashboard";
|
|
3775
3775
|
}
|
|
@@ -3785,19 +3785,19 @@ async function ps(e) {
|
|
|
3785
3785
|
const o = [];
|
|
3786
3786
|
let a = 1, n = 0, s = Number.POSITIVE_INFINITY;
|
|
3787
3787
|
for (; n < s; ) {
|
|
3788
|
-
const
|
|
3788
|
+
const d = await e.apiClient.listBriefings(
|
|
3789
3789
|
e.apiServiceUrl,
|
|
3790
3790
|
e.token,
|
|
3791
3791
|
{ scope: "organization", page: a, pageSize: 100 }
|
|
3792
3792
|
);
|
|
3793
|
-
if (o.push(...
|
|
3793
|
+
if (o.push(...d.briefings), n += d.briefings.length, s = d.total, d.briefings.length === 0 || n >= s) break;
|
|
3794
3794
|
a += 1;
|
|
3795
3795
|
}
|
|
3796
3796
|
return o;
|
|
3797
3797
|
}
|
|
3798
3798
|
const fs = {
|
|
3799
|
-
listBriefings:
|
|
3800
|
-
getBriefing:
|
|
3799
|
+
listBriefings: da,
|
|
3800
|
+
getBriefing: ca,
|
|
3801
3801
|
pauseBriefing: la,
|
|
3802
3802
|
resumeBriefing: ia,
|
|
3803
3803
|
deleteBriefing: oa,
|
|
@@ -3810,13 +3810,13 @@ function gs({
|
|
|
3810
3810
|
token: a,
|
|
3811
3811
|
onTerminal: n,
|
|
3812
3812
|
onTimeout: s,
|
|
3813
|
-
onExpand:
|
|
3813
|
+
onExpand: d
|
|
3814
3814
|
}) {
|
|
3815
|
-
const [
|
|
3815
|
+
const [c, l] = F(r), { startRun: u } = va({
|
|
3816
3816
|
apiServiceUrl: o,
|
|
3817
3817
|
token: a,
|
|
3818
|
-
intervalMs:
|
|
3819
|
-
timeoutMs:
|
|
3818
|
+
intervalMs: cs,
|
|
3819
|
+
timeoutMs: ds,
|
|
3820
3820
|
fetchRun: ({
|
|
3821
3821
|
apiServiceUrl: p,
|
|
3822
3822
|
token: m,
|
|
@@ -3834,7 +3834,7 @@ function gs({
|
|
|
3834
3834
|
}), h = ge(!1);
|
|
3835
3835
|
return J(() => {
|
|
3836
3836
|
h.current || (h.current = !0, ya(r.status) ? u(r) : Ca(r.status) && n(r));
|
|
3837
|
-
}, [r, n, u]), /* @__PURE__ */ t(wa, { run:
|
|
3837
|
+
}, [r, n, u]), /* @__PURE__ */ t(wa, { run: c, onExpand: d });
|
|
3838
3838
|
}
|
|
3839
3839
|
function ro(e) {
|
|
3840
3840
|
return /* @__PURE__ */ t(aa, { children: /* @__PURE__ */ t(bs, { ...e }) });
|
|
@@ -3846,27 +3846,27 @@ function bs({
|
|
|
3846
3846
|
token: a,
|
|
3847
3847
|
disabled: n,
|
|
3848
3848
|
className: s,
|
|
3849
|
-
manageBriefingsHref:
|
|
3850
|
-
open:
|
|
3849
|
+
manageBriefingsHref: d,
|
|
3850
|
+
open: c,
|
|
3851
3851
|
onOpenChange: l,
|
|
3852
3852
|
hideTrigger: u = !1,
|
|
3853
3853
|
workflowIntent: h,
|
|
3854
3854
|
client: p
|
|
3855
3855
|
}) {
|
|
3856
|
-
const { authToken: m, tokenProps: g } = Be(), f = na(), b = !h || f.canCreate && (h === "scheduled_report" || f.analyticalBriefingsEnabled), [k, v] = F(!1), D =
|
|
3857
|
-
|
|
3856
|
+
const { authToken: m, tokenProps: g } = Be(), f = na(), b = !h || f.canCreate && (h === "scheduled_report" || f.analyticalBriefingsEnabled), [k, v] = F(!1), D = c ?? k, E = (A) => {
|
|
3857
|
+
c === void 0 && v(A), l == null || l(A);
|
|
3858
3858
|
}, [N, y] = F(
|
|
3859
3859
|
h ? "author" : "list"
|
|
3860
3860
|
), [w, S] = F(
|
|
3861
3861
|
h ?? "analytical_briefing"
|
|
3862
3862
|
), [x, B] = F("dashboard"), [I, W] = F(
|
|
3863
3863
|
[]
|
|
3864
|
-
), [P, M] = F(null),
|
|
3864
|
+
), [P, M] = F(null), Y = h && !b && !P ? "list" : N, [K, Ce] = F(!1), [ce, O] = F(null), [te, re] = F(null), [L, ae] = F(
|
|
3865
3865
|
null
|
|
3866
|
-
), [le,
|
|
3866
|
+
), [le, Q] = F(null), be = ge(null), ke = ge(D);
|
|
3867
3867
|
J(() => {
|
|
3868
3868
|
const A = D && !ke.current;
|
|
3869
|
-
ke.current = D, !(!A || !h) && (M(null), B("dashboard"), S(h), y("author"),
|
|
3869
|
+
ke.current = D, !(!A || !h) && (M(null), B("dashboard"), S(h), y("author"), Q(null));
|
|
3870
3870
|
}, [D, h]);
|
|
3871
3871
|
const [ve, we] = F(
|
|
3872
3872
|
null
|
|
@@ -3896,7 +3896,7 @@ function bs({
|
|
|
3896
3896
|
scheduledReportAvailable: x === "dashboard"
|
|
3897
3897
|
}), ne = j(async () => {
|
|
3898
3898
|
if (!(!q || !H)) {
|
|
3899
|
-
Ce(!0),
|
|
3899
|
+
Ce(!0), Q(null);
|
|
3900
3900
|
try {
|
|
3901
3901
|
W(
|
|
3902
3902
|
await ps({
|
|
@@ -3906,7 +3906,7 @@ function bs({
|
|
|
3906
3906
|
})
|
|
3907
3907
|
);
|
|
3908
3908
|
} catch (A) {
|
|
3909
|
-
|
|
3909
|
+
Q(
|
|
3910
3910
|
A instanceof Error ? A.message : "Could not load briefings."
|
|
3911
3911
|
);
|
|
3912
3912
|
} finally {
|
|
@@ -3915,15 +3915,15 @@ function bs({
|
|
|
3915
3915
|
}
|
|
3916
3916
|
}, [he, q, H]);
|
|
3917
3917
|
J(() => {
|
|
3918
|
-
!D ||
|
|
3919
|
-
}, [Ie,
|
|
3918
|
+
!D || Y !== "list" || !Ie || ne();
|
|
3919
|
+
}, [Ie, Y, ne, D]);
|
|
3920
3920
|
const Pe = () => {
|
|
3921
3921
|
M(null), B("dashboard"), y("list"), E(!0);
|
|
3922
3922
|
}, C = (A) => {
|
|
3923
3923
|
M(null), S(A), y("author");
|
|
3924
3924
|
}, R = async (A) => {
|
|
3925
3925
|
if (!(!q || !H)) {
|
|
3926
|
-
O(A),
|
|
3926
|
+
O(A), Q(null);
|
|
3927
3927
|
try {
|
|
3928
3928
|
const _ = await he.getBriefing(
|
|
3929
3929
|
q,
|
|
@@ -3932,7 +3932,7 @@ function bs({
|
|
|
3932
3932
|
);
|
|
3933
3933
|
M(_.briefing), y("author");
|
|
3934
3934
|
} catch (_) {
|
|
3935
|
-
|
|
3935
|
+
Q(
|
|
3936
3936
|
_ instanceof Error ? _.message : "Could not open briefing."
|
|
3937
3937
|
);
|
|
3938
3938
|
} finally {
|
|
@@ -3957,7 +3957,7 @@ function bs({
|
|
|
3957
3957
|
re(null);
|
|
3958
3958
|
}
|
|
3959
3959
|
}
|
|
3960
|
-
},
|
|
3960
|
+
}, de = async (A) => {
|
|
3961
3961
|
if (!q || !H) return;
|
|
3962
3962
|
const { noun: _ } = me(A), Oe = _ === "report" ? "Report" : "Briefing";
|
|
3963
3963
|
re(A.id);
|
|
@@ -4003,7 +4003,7 @@ function bs({
|
|
|
4003
4003
|
}, mr = _e.length;
|
|
4004
4004
|
return f.surfaceVisible ? /* @__PURE__ */ i(ua, { open: D, onOpenChange: E, children: [
|
|
4005
4005
|
u ? null : /* @__PURE__ */ t(
|
|
4006
|
-
|
|
4006
|
+
Zn,
|
|
4007
4007
|
{
|
|
4008
4008
|
disabled: n || !Ie,
|
|
4009
4009
|
briefingCount: mr,
|
|
@@ -4040,11 +4040,11 @@ function bs({
|
|
|
4040
4040
|
{
|
|
4041
4041
|
type: "button",
|
|
4042
4042
|
role: "tab",
|
|
4043
|
-
"aria-selected":
|
|
4043
|
+
"aria-selected": Y === "author",
|
|
4044
4044
|
disabled: !b,
|
|
4045
|
-
className:
|
|
4045
|
+
className: Z(
|
|
4046
4046
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
4047
|
-
|
|
4047
|
+
Y === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
|
|
4048
4048
|
!b && "cursor-not-allowed opacity-50"
|
|
4049
4049
|
),
|
|
4050
4050
|
onClick: () => {
|
|
@@ -4058,10 +4058,10 @@ function bs({
|
|
|
4058
4058
|
{
|
|
4059
4059
|
type: "button",
|
|
4060
4060
|
role: "tab",
|
|
4061
|
-
"aria-selected":
|
|
4062
|
-
className:
|
|
4061
|
+
"aria-selected": Y === "list",
|
|
4062
|
+
className: Z(
|
|
4063
4063
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
4064
|
-
|
|
4064
|
+
Y === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
4065
4065
|
),
|
|
4066
4066
|
onClick: () => y("list"),
|
|
4067
4067
|
children: h === "scheduled_report" ? "Manage reports" : "Manage briefings"
|
|
@@ -4081,7 +4081,7 @@ function bs({
|
|
|
4081
4081
|
}
|
|
4082
4082
|
)
|
|
4083
4083
|
] }) : null,
|
|
4084
|
-
|
|
4084
|
+
Y === "list" ? /* @__PURE__ */ t(
|
|
4085
4085
|
ss,
|
|
4086
4086
|
{
|
|
4087
4087
|
briefings: _e,
|
|
@@ -4106,12 +4106,12 @@ function bs({
|
|
|
4106
4106
|
z(A);
|
|
4107
4107
|
},
|
|
4108
4108
|
onTogglePause: (A) => {
|
|
4109
|
-
|
|
4109
|
+
de(A);
|
|
4110
4110
|
},
|
|
4111
4111
|
onDelete: (A) => ae(A),
|
|
4112
|
-
selectingId:
|
|
4112
|
+
selectingId: ce,
|
|
4113
4113
|
busyId: te,
|
|
4114
|
-
manageBriefingsHref:
|
|
4114
|
+
manageBriefingsHref: d,
|
|
4115
4115
|
contentKind: h === "scheduled_report" ? "reports" : h === "analytical_briefing" ? "briefings" : void 0,
|
|
4116
4116
|
hideHeader: !!h
|
|
4117
4117
|
}
|
|
@@ -4234,15 +4234,15 @@ export {
|
|
|
4234
4234
|
eo as N,
|
|
4235
4235
|
Xs as U,
|
|
4236
4236
|
Hs as V,
|
|
4237
|
-
|
|
4238
|
-
|
|
4237
|
+
Zn as W,
|
|
4238
|
+
Qs as a,
|
|
4239
4239
|
Rn as b,
|
|
4240
|
-
|
|
4240
|
+
Ys as c,
|
|
4241
4241
|
Js as d,
|
|
4242
4242
|
$n as e,
|
|
4243
4243
|
Hn as f,
|
|
4244
4244
|
to as g,
|
|
4245
4245
|
ro as h,
|
|
4246
|
-
|
|
4247
|
-
|
|
4246
|
+
Zs as i,
|
|
4247
|
+
Gs as u
|
|
4248
4248
|
};
|