react-semaphor 0.1.571 → 0.1.573
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 +62 -59
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/{model-change-T1cRkh3m.js → add-to-dashboard-B6Ah8Lub.js} +121 -84
- package/dist/chunks/{assistant-chat-SkCraw2C.js → assistant-chat-D95DtCj7.js} +2398 -2300
- package/dist/chunks/{bookmark-impact-DCYD-6Fr.js → bookmark-impact-DUWw3wlA.js} +2 -2
- package/dist/chunks/{bookmark-state-CflS88gq.js → bookmark-state-BEl_G9vr.js} +54 -54
- package/dist/chunks/{card-filter-builder-D-aSYpyr.js → card-filter-builder-B3bEPylu.js} +54 -54
- package/dist/chunks/{dashboard-B_w_ekUz.js → dashboard-DdALjmc3.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-_g1m2tJ3.js → dashboard-briefing-launcher-D2vevpyl.js} +923 -956
- package/dist/chunks/{dashboard-controls-CY0gbcCt.js → dashboard-controls-DxrsGK9A.js} +103 -103
- package/dist/chunks/{dashboard-json-DsM79yem.js → dashboard-json-rwds0HjB.js} +1 -1
- package/dist/chunks/{dates-RSEzJ9N7.js → dates-DlYMDaF2.js} +5 -5
- package/dist/chunks/{edit-dashboard-visual-cX0FM-4i.js → edit-dashboard-visual-BCDz5HOb.js} +1354 -1317
- package/dist/chunks/{filter-reach-copy-thzt25Rc.js → filter-reach-copy-BTAXnbwQ.js} +9 -9
- package/dist/chunks/{index-y3HUzRNk.js → index-8BxDk8EP.js} +2 -2
- package/dist/chunks/{report-preferences-dialog-B_GXs91t.js → report-preferences-dialog-D9nBczmk.js} +725 -801
- package/dist/chunks/{resolve-dashboard-input-context-Lkbwycwe.js → resolve-dashboard-input-context-DBFuNhZo.js} +3961 -3923
- package/dist/chunks/{saved-dashboard-context-DC_TEd6y.js → saved-dashboard-context-AChHk4tw.js} +3 -3
- package/dist/chunks/{semaphor-ready-indicator-CBQamwQY.js → semaphor-ready-indicator-BdOAS4Uw.js} +25293 -24700
- package/dist/chunks/{shelf-drop-preview-context-Bkjf0XXw.js → shelf-drop-preview-context-B1goDUYE.js} +259 -259
- package/dist/chunks/{stored-dashboard-C0hekXiI.js → stored-dashboard-rpLzf4mk.js} +231 -231
- package/dist/chunks/{variable-draft-DvglU8yj.js → variable-draft-DPSMDwqt.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1381 -1368
- package/dist/index.js +147 -147
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/dashboard/summary-card.d.ts +5 -0
- package/dist/types/index.js +1 -1
- package/dist/types/lib/formatters/kpi-number-formatter.d.ts +12 -0
- package/dist/types/lib/types/explorer-types.d.ts +6 -0
- package/dist/types/shared/assistant-protocol/model-change.d.ts +52 -1
- package/dist/types/shared/assistant-protocol/parts.d.ts +49 -2
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +38 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import la, { useState as
|
|
3
|
-
import {
|
|
4
|
-
import { c as we, B as L, X as Qe, s as
|
|
1
|
+
import { jsx as t, jsxs as r, Fragment as U } from "react/jsx-runtime";
|
|
2
|
+
import la, { useState as E, useEffect as Ee, useCallback as ie, useMemo as Y, useLayoutEffect as Ut, useRef as et, useContext as Va } from "react";
|
|
3
|
+
import { dI as it, bD as Le, bE as Ve, bG as Be, dJ as Ba, b1 as $e, a_ as ot, dK as Pa, dL as lt, dM as Ct, ag as dt, ad as ve, u as w, dN as _a, dO as Oa, bC as M, dP as Ma, af as oe, aY as za, c6 as Ra, dQ as Ua, dR as $a, bw as da, bW as be, cq as ca, bV as tt, n as ja, j as qa, dS as Wa, ct as wt, cu as St, cv as kt, cw as Dt, cx as At, cy as Ft, cz as Et, cA as ua, cD as It, dT as Qa, dp as Ka, ci as pt, cf as je, cg as qe, dB as ha, ch as We, c2 as re, cr as Ha, cm as at, dU as Ga, b$ as Ya, dV as ma, bn as ct, bF as Tt, bH as ut, dW as pa, bB as Xa, dX as Ja, bo as Za, h as en, dY as tn, J as an, H as fa, bi as nn, K as rn, r as sn, dZ as on, d_ as ln, d$ as ga, e0 as dn, e1 as cn, e2 as Ce, e3 as un, R as ba, e4 as hn, e5 as mn, aV as pn, e6 as fn, e7 as ge, e8 as gn, a3 as Lt, e9 as bn, ea as ft, eb as xn, ec as $t, ed as vn, ee as yn, ef as Nn, eg as xa, cT as Cn, eh as wn, ei as Sn, dv as Vt, cE as va, ej as kn, ek as jt, el as Dn, em as An, en as Fn, eo as En, b0 as In, bx as Tn, c5 as ya, ep as Ln, eq as Vn, er as Xe, es as Bn, et as Pn, eu as _n, A as On, aK as Mn, aL as zn, aq as Rn, ap as Un, ao as $n, an as jn, ak as qn, ai as Wn, ev as Qn, ew as Kn, ex as Hn, ey as Gn, ez as Yn, aI as Xn } from "./semaphor-ready-indicator-BdOAS4Uw.js";
|
|
4
|
+
import { c as we, B as L, X as Qe, s as Re, x as xe, L as de, q as Bt, j as Pt, p as Jn, F as _t, e as Ie, aa as Na, h as Te, f as nt, i as Ca, g as Nt, y as Se, z as ke, A as De, D as Ae, E as fe, ab as Zn } from "./style-sheet-parts-C7qGZuH1.js";
|
|
5
5
|
import { L as Ue } from "./layout-grid-8rR-LPTk.js";
|
|
6
6
|
import { c as J } from "./pickers-DkqmtnTL.js";
|
|
7
7
|
import { S as er } from "./validators-B8fpdinG.js";
|
|
@@ -9,27 +9,26 @@ import "./matrix-operation-contract-DCVinw1o.js";
|
|
|
9
9
|
import "./analytics-base-schemas-BaIQrEzX.js";
|
|
10
10
|
import "../value-format-preferences/index.js";
|
|
11
11
|
import { s as Je } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
|
|
12
|
-
import {
|
|
12
|
+
import { bF as qt, bb as Wt, eo as Qt, gN as tr, gO as rt, fM as Kt, gP as ar, o as Ke, gQ as nr, p as rr, gf as sr, gR as ir, gS as or, ct as lr, gT as dr, l as cr, f9 as ur, gU as hr, gV as mr, a as Ot, aN as pr, a4 as fr, c7 as gr, gW as br, gX as xr, ci as vr, gY as yr, gZ as Ht, g_ as Nr } from "./resolve-dashboard-input-context-DBFuNhZo.js";
|
|
13
13
|
import { S as wa } from "./save-D985VvYp.js";
|
|
14
|
-
import { V as Cr, L as wr, a as Sr, u as Sa, C as ka, F as kr, b as Dr, A as Ar, c as Fr } from "./card-filter-builder-
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { aA as Lr, an as Vr, D as Pr, a8 as st, R as Br } from "./bookmark-state-CflS88gq.js";
|
|
14
|
+
import { V as Cr, L as wr, a as Sr, u as Sa, C as ka, F as kr, b as Dr, A as Ar, c as Fr } from "./card-filter-builder-B3bEPylu.js";
|
|
15
|
+
import { createPortal as Er } from "react-dom";
|
|
16
|
+
import { aV as Gt, ar as Ir } from "./temporal-input-presentation-CqbJjIuu.js";
|
|
17
|
+
import { aA as Tr, ao as Lr, D as Vr, a9 as st, S as Br } from "./bookmark-state-BEl_G9vr.js";
|
|
19
18
|
import "zod";
|
|
20
19
|
import "./schema-C9NPiIru.js";
|
|
21
20
|
import "./index-CV_Kzou0.js";
|
|
22
21
|
import "./context-R31TSL5V.js";
|
|
23
|
-
import { v as
|
|
24
|
-
import { a as Yt, d as Xt, c as
|
|
25
|
-
import { g as pe, d as
|
|
22
|
+
import { v as Pr, F as _r } from "./filter-reach-copy-BTAXnbwQ.js";
|
|
23
|
+
import { a as Yt, d as Xt, c as Or, i as Mr, b as zr, e as Rr, v as Jt, f as Zt, g as Ur } from "./variable-draft-DPSMDwqt.js";
|
|
24
|
+
import { g as pe, d as $r, a as jr } from "./index-8BxDk8EP.js";
|
|
26
25
|
/**
|
|
27
26
|
* @license lucide-react v0.453.0 - ISC
|
|
28
27
|
*
|
|
29
28
|
* This source code is licensed under the ISC license.
|
|
30
29
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
30
|
*/
|
|
32
|
-
const
|
|
31
|
+
const qr = we("ArrowUpRight", [
|
|
33
32
|
["path", { d: "M7 7h10v10", key: "1tivn9" }],
|
|
34
33
|
["path", { d: "M7 17 17 7", key: "1vkiza" }]
|
|
35
34
|
]);
|
|
@@ -49,7 +48,7 @@ const ea = we("Bell", [
|
|
|
49
48
|
* This source code is licensed under the ISC license.
|
|
50
49
|
* See the LICENSE file in the root directory of this source tree.
|
|
51
50
|
*/
|
|
52
|
-
const
|
|
51
|
+
const Wr = we("CalendarRange", [
|
|
53
52
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
54
53
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
55
54
|
["path", { d: "M3 10h18", key: "8toen8" }],
|
|
@@ -65,7 +64,7 @@ const Qr = we("CalendarRange", [
|
|
|
65
64
|
* This source code is licensed under the ISC license.
|
|
66
65
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
66
|
*/
|
|
68
|
-
const
|
|
67
|
+
const Qr = we("CodeXml", [
|
|
69
68
|
["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
|
|
70
69
|
["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
|
|
71
70
|
["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
|
|
@@ -88,7 +87,7 @@ const ta = we("MonitorSmartphone", [
|
|
|
88
87
|
* This source code is licensed under the ISC license.
|
|
89
88
|
* See the LICENSE file in the root directory of this source tree.
|
|
90
89
|
*/
|
|
91
|
-
const
|
|
90
|
+
const Kr = we("MousePointer2", [
|
|
92
91
|
[
|
|
93
92
|
"path",
|
|
94
93
|
{
|
|
@@ -103,7 +102,7 @@ const Hr = we("MousePointer2", [
|
|
|
103
102
|
* This source code is licensed under the ISC license.
|
|
104
103
|
* See the LICENSE file in the root directory of this source tree.
|
|
105
104
|
*/
|
|
106
|
-
const
|
|
105
|
+
const Hr = we("Newspaper", [
|
|
107
106
|
[
|
|
108
107
|
"path",
|
|
109
108
|
{
|
|
@@ -121,18 +120,18 @@ const Gr = we("Newspaper", [
|
|
|
121
120
|
* This source code is licensed under the ISC license.
|
|
122
121
|
* See the LICENSE file in the root directory of this source tree.
|
|
123
122
|
*/
|
|
124
|
-
const
|
|
123
|
+
const Gr = we("Terminal", [
|
|
125
124
|
["polyline", { points: "4 17 10 11 4 5", key: "akl6gq" }],
|
|
126
125
|
["line", { x1: "12", x2: "20", y1: "19", y2: "19", key: "q2wloq" }]
|
|
127
126
|
]);
|
|
128
|
-
function
|
|
129
|
-
return /* @__PURE__ */ t("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((e, a) => /* @__PURE__ */
|
|
127
|
+
function Yr() {
|
|
128
|
+
return /* @__PURE__ */ t("div", { className: "space-y-1.5 py-1", children: [...Array(5)].map((e, a) => /* @__PURE__ */ r(
|
|
130
129
|
"div",
|
|
131
130
|
{
|
|
132
131
|
className: "flex animate-pulse items-start gap-3 rounded-xl border border-transparent px-2.5 py-2.5",
|
|
133
132
|
children: [
|
|
134
133
|
/* @__PURE__ */ t("div", { className: "mt-0.5 h-4 w-4 flex-shrink-0 rounded bg-muted/60" }),
|
|
135
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ r("div", { className: "flex-1 space-y-1.5", children: [
|
|
136
135
|
/* @__PURE__ */ t("div", { className: "h-4 w-3/5 rounded bg-muted/60" }),
|
|
137
136
|
/* @__PURE__ */ t("div", { className: "h-3 w-4/5 rounded bg-muted/40" })
|
|
138
137
|
] })
|
|
@@ -141,33 +140,33 @@ function Xr() {
|
|
|
141
140
|
a
|
|
142
141
|
)) });
|
|
143
142
|
}
|
|
144
|
-
function
|
|
143
|
+
function Xr({
|
|
145
144
|
open: e,
|
|
146
145
|
onOpenChange: a,
|
|
147
|
-
onSubmit:
|
|
146
|
+
onSubmit: s,
|
|
148
147
|
isCreating: n
|
|
149
148
|
}) {
|
|
150
|
-
const i = it("interactive"), [o, l] =
|
|
149
|
+
const i = it("interactive"), [o, l] = E(""), [u, c] = E("");
|
|
151
150
|
Ee(() => {
|
|
152
151
|
e || (l(""), c(""));
|
|
153
152
|
}, [e]);
|
|
154
153
|
const d = () => {
|
|
155
|
-
o.trim() &&
|
|
154
|
+
o.trim() && s({ title: o, description: u });
|
|
156
155
|
}, h = (p) => {
|
|
157
156
|
a(p);
|
|
158
157
|
};
|
|
159
|
-
return /* @__PURE__ */ t(Le, { open: e, onOpenChange: h, children: /* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ t(Le, { open: e, onOpenChange: h, children: /* @__PURE__ */ r(
|
|
160
159
|
Ve,
|
|
161
160
|
{
|
|
162
161
|
showCloseButton: !1,
|
|
163
162
|
className: "flex max-w-lg grid-cols-none flex-col gap-0 overflow-hidden rounded-card border-border/60 p-0 shadow-lg sm:rounded-card",
|
|
164
163
|
style: i.dialogStyle,
|
|
165
164
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
166
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
168
167
|
/* @__PURE__ */ t(Ue, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */ t(
|
|
168
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
169
|
+
/* @__PURE__ */ t(Be, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "New library visual" }),
|
|
171
170
|
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Visual" })
|
|
172
171
|
] })
|
|
173
172
|
] }),
|
|
@@ -184,10 +183,10 @@ function Jr({
|
|
|
184
183
|
}
|
|
185
184
|
)
|
|
186
185
|
] }),
|
|
187
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ r("div", { className: "space-y-3 px-4 py-3", children: [
|
|
188
187
|
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */ t(
|
|
188
|
+
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
189
|
+
/* @__PURE__ */ t(Re, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
|
|
191
190
|
/* @__PURE__ */ t(
|
|
192
191
|
xe,
|
|
193
192
|
{
|
|
@@ -203,8 +202,8 @@ function Jr({
|
|
|
203
202
|
}
|
|
204
203
|
)
|
|
205
204
|
] }),
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
/* @__PURE__ */ t(
|
|
205
|
+
/* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
|
|
206
|
+
/* @__PURE__ */ t(Re, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
|
|
208
207
|
/* @__PURE__ */ t(
|
|
209
208
|
xe,
|
|
210
209
|
{
|
|
@@ -218,7 +217,7 @@ function Jr({
|
|
|
218
217
|
)
|
|
219
218
|
] })
|
|
220
219
|
] }),
|
|
221
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ r("div", { className: "flex shrink-0 justify-end gap-2 border-t border-border/60 px-4 py-2.5", children: [
|
|
222
221
|
/* @__PURE__ */ t(
|
|
223
222
|
L,
|
|
224
223
|
{
|
|
@@ -235,7 +234,7 @@ function Jr({
|
|
|
235
234
|
size: "xs",
|
|
236
235
|
onClick: d,
|
|
237
236
|
disabled: !o.trim() || n,
|
|
238
|
-
children: n ? /* @__PURE__ */
|
|
237
|
+
children: n ? /* @__PURE__ */ r(U, { children: [
|
|
239
238
|
/* @__PURE__ */ t(de, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
240
239
|
"Creating..."
|
|
241
240
|
] }) : "Create library visual"
|
|
@@ -246,11 +245,11 @@ function Jr({
|
|
|
246
245
|
}
|
|
247
246
|
) });
|
|
248
247
|
}
|
|
249
|
-
function
|
|
250
|
-
const [a,
|
|
248
|
+
function Jr(e) {
|
|
249
|
+
const [a, s] = E(null), [n, i] = E(null), o = Ba();
|
|
251
250
|
return Ee(() => {
|
|
252
251
|
if (!e || e.trim() === "") {
|
|
253
|
-
|
|
252
|
+
s(null), i(null);
|
|
254
253
|
return;
|
|
255
254
|
}
|
|
256
255
|
if (!o)
|
|
@@ -277,25 +276,25 @@ function Zr(e) {
|
|
|
277
276
|
);
|
|
278
277
|
if (typeof d.useChartStore != "function")
|
|
279
278
|
throw new Error("useChartStore is not a function");
|
|
280
|
-
|
|
279
|
+
s(() => d.useChartStore), i(null);
|
|
281
280
|
} catch (u) {
|
|
282
281
|
const c = u instanceof Error ? u.message : "Unknown error";
|
|
283
|
-
console.error("Failed to load remote chart store:", c), i(c),
|
|
282
|
+
console.error("Failed to load remote chart store:", c), i(c), s(null);
|
|
284
283
|
}
|
|
285
284
|
})();
|
|
286
285
|
}, [e, o]), a;
|
|
287
286
|
}
|
|
288
|
-
function
|
|
287
|
+
function Zr(e, a) {
|
|
289
288
|
if (e.length === 0)
|
|
290
289
|
return "";
|
|
291
|
-
const
|
|
290
|
+
const s = e.find(
|
|
292
291
|
(n) => {
|
|
293
292
|
var i, o;
|
|
294
293
|
return ((i = n.customCardPreferences) == null ? void 0 : i.visualType) === "multiple" || !!((o = n.customCardPreferences) != null && o.dataInputCardIds);
|
|
295
294
|
}
|
|
296
295
|
);
|
|
297
|
-
if (
|
|
298
|
-
return
|
|
296
|
+
if (s)
|
|
297
|
+
return s.id;
|
|
299
298
|
if (a) {
|
|
300
299
|
const n = e.find((i) => i.id === a);
|
|
301
300
|
if (n) {
|
|
@@ -313,19 +312,19 @@ function es(e, a) {
|
|
|
313
312
|
}
|
|
314
313
|
return e[0].id;
|
|
315
314
|
}
|
|
316
|
-
async function aa(e, a,
|
|
317
|
-
if (!a || !
|
|
315
|
+
async function aa(e, a, s, n, i = "Opening library visual...") {
|
|
316
|
+
if (!a || !s)
|
|
318
317
|
throw new Error("Missing auth token or visual ID");
|
|
319
|
-
const o = ["resource-by-id", "visual",
|
|
318
|
+
const o = ["resource-by-id", "visual", s], l = n.getQueryData(o);
|
|
320
319
|
if (l)
|
|
321
|
-
return console.log("Using cached visual data for:",
|
|
322
|
-
console.log("Fetching visual data from network for:",
|
|
320
|
+
return console.log("Using cached visual data for:", s), { data: l, fromCache: !0 };
|
|
321
|
+
console.log("Fetching visual data from network for:", s);
|
|
323
322
|
const u = M.loading(i, {
|
|
324
323
|
position: "top-center"
|
|
325
324
|
});
|
|
326
325
|
try {
|
|
327
326
|
const c = await fetch(
|
|
328
|
-
`${e}/management/v1/visuals/${
|
|
327
|
+
`${e}/management/v1/visuals/${s}`,
|
|
329
328
|
{
|
|
330
329
|
headers: {
|
|
331
330
|
Authorization: `Bearer ${a}`
|
|
@@ -340,38 +339,38 @@ async function aa(e, a, r, n, i = "Opening library visual...") {
|
|
|
340
339
|
throw M.dismiss(u), c;
|
|
341
340
|
}
|
|
342
341
|
}
|
|
343
|
-
function
|
|
342
|
+
function Da(e) {
|
|
344
343
|
if (typeof e == "string")
|
|
345
344
|
return JSON.parse(e);
|
|
346
345
|
if (typeof e == "object")
|
|
347
346
|
return e;
|
|
348
347
|
throw new Error("Invalid frame object format");
|
|
349
348
|
}
|
|
350
|
-
function
|
|
349
|
+
function es(e, a) {
|
|
351
350
|
var o, l;
|
|
352
|
-
const
|
|
353
|
-
if (!
|
|
351
|
+
const s = (e == null ? void 0 : e.frameObject) ?? ((o = e == null ? void 0 : e.visual) == null ? void 0 : o.frameObject);
|
|
352
|
+
if (!s)
|
|
354
353
|
return !1;
|
|
355
|
-
const n =
|
|
354
|
+
const n = Da(s);
|
|
356
355
|
if (!(n != null && n.cards) || n.cards.length === 0)
|
|
357
356
|
return !1;
|
|
358
357
|
const i = (l = n.cards) == null ? void 0 : l.find(
|
|
359
358
|
(u) => u.id === n.activeCardId
|
|
360
359
|
);
|
|
361
|
-
return i ? (
|
|
360
|
+
return i ? (Ma({
|
|
362
361
|
...a,
|
|
363
362
|
frame: n,
|
|
364
363
|
card: i,
|
|
365
364
|
visualId: (e == null ? void 0 : e.id) || n.visualId
|
|
366
365
|
}), !0) : !1;
|
|
367
366
|
}
|
|
368
|
-
function
|
|
367
|
+
function ts() {
|
|
369
368
|
const e = oe(
|
|
370
369
|
(n) => {
|
|
371
370
|
var i;
|
|
372
371
|
return ((i = n.card.customCardPreferences) == null ? void 0 : i.url) || "";
|
|
373
372
|
}
|
|
374
|
-
), a =
|
|
373
|
+
), a = Jr(e);
|
|
375
374
|
return { getUpdatedFrame: ie(() => {
|
|
376
375
|
var N;
|
|
377
376
|
za();
|
|
@@ -404,12 +403,12 @@ function as() {
|
|
|
404
403
|
return {
|
|
405
404
|
...n,
|
|
406
405
|
cards: y,
|
|
407
|
-
activeCardId:
|
|
406
|
+
activeCardId: Zr(y, n.activeCardId)
|
|
408
407
|
};
|
|
409
408
|
}, [a]) };
|
|
410
409
|
}
|
|
411
|
-
function
|
|
412
|
-
const { authToken: e, tokenProps: a } = $e(),
|
|
410
|
+
function Pe() {
|
|
411
|
+
const { authToken: e, tokenProps: a } = $e(), s = ot(), n = Pa(), i = lt(), { selectVisual: o } = Ct(), {
|
|
413
412
|
setFrame: l,
|
|
414
413
|
loadCard: u,
|
|
415
414
|
setIsDevMode: c,
|
|
@@ -423,28 +422,28 @@ function Be() {
|
|
|
423
422
|
setSelectedTableName: N,
|
|
424
423
|
setSelectedDatamodelId: k,
|
|
425
424
|
setInlineFilterValuesMap: V,
|
|
426
|
-
setApplyFilters:
|
|
425
|
+
setApplyFilters: B,
|
|
427
426
|
clearEditorContext: D
|
|
428
427
|
} = dt(), {
|
|
429
|
-
setIsDashboardEditing:
|
|
428
|
+
setIsDashboardEditing: O,
|
|
430
429
|
setIsVisualEditing: b,
|
|
431
430
|
clearSelectedFrameId: S
|
|
432
|
-
} = ve(), v = w((
|
|
433
|
-
(
|
|
434
|
-
),
|
|
431
|
+
} = ve(), v = w((_) => _.selectedSheetId), T = w((_) => _.selectedFrameId), F = w((_) => _.dashboard), H = w(
|
|
432
|
+
(_) => _.inlineFilterValuesMap
|
|
433
|
+
), P = _a((i == null ? void 0 : i.id) || "", {
|
|
435
434
|
enabled: !!(i != null && i.id) && !!(e != null && e.accessToken)
|
|
436
435
|
}), Q = ie(
|
|
437
|
-
async (
|
|
436
|
+
async (_) => {
|
|
438
437
|
try {
|
|
439
|
-
o(
|
|
438
|
+
o(_), S(), D();
|
|
440
439
|
const { data: te, fromCache: Z } = await aa(
|
|
441
440
|
a.apiServiceUrl,
|
|
442
441
|
(e == null ? void 0 : e.accessToken) || "",
|
|
443
|
-
|
|
444
|
-
|
|
442
|
+
_.id,
|
|
443
|
+
s,
|
|
445
444
|
"Opening library visual..."
|
|
446
445
|
);
|
|
447
|
-
if (!
|
|
446
|
+
if (!es(te, {
|
|
448
447
|
setFrame: l,
|
|
449
448
|
loadCard: u,
|
|
450
449
|
setIsDevMode: c,
|
|
@@ -458,10 +457,10 @@ function Be() {
|
|
|
458
457
|
setSelectedTableName: N,
|
|
459
458
|
setSelectedDatamodelId: k,
|
|
460
459
|
setInlineFilterValuesMap: V,
|
|
461
|
-
setApplyFilters:
|
|
462
|
-
setIsDashboardEditing:
|
|
460
|
+
setApplyFilters: B,
|
|
461
|
+
setIsDashboardEditing: O,
|
|
463
462
|
setIsVisualEditing: b,
|
|
464
|
-
dashboard:
|
|
463
|
+
dashboard: F,
|
|
465
464
|
selectedSheetId: v,
|
|
466
465
|
selectedFrameId: T,
|
|
467
466
|
inlineFilterValuesMap: H
|
|
@@ -475,11 +474,11 @@ function Be() {
|
|
|
475
474
|
[
|
|
476
475
|
e == null ? void 0 : e.accessToken,
|
|
477
476
|
a.apiServiceUrl,
|
|
478
|
-
|
|
477
|
+
s,
|
|
479
478
|
o,
|
|
480
479
|
l,
|
|
481
480
|
u,
|
|
482
|
-
|
|
481
|
+
O,
|
|
483
482
|
b,
|
|
484
483
|
c,
|
|
485
484
|
d,
|
|
@@ -492,39 +491,39 @@ function Be() {
|
|
|
492
491
|
N,
|
|
493
492
|
k,
|
|
494
493
|
V,
|
|
495
|
-
|
|
494
|
+
B,
|
|
496
495
|
D,
|
|
497
496
|
S,
|
|
498
|
-
|
|
497
|
+
F,
|
|
499
498
|
v,
|
|
500
499
|
T,
|
|
501
500
|
H
|
|
502
501
|
]
|
|
503
502
|
), X = ie(
|
|
504
|
-
async (
|
|
503
|
+
async (_) => {
|
|
505
504
|
var Z;
|
|
506
505
|
const te = (G) => (M.error(G), { success: !1, error: G });
|
|
507
506
|
try {
|
|
508
|
-
if (o(
|
|
507
|
+
if (o(_), !v)
|
|
509
508
|
return te("No sheet selected. Please select a sheet first.");
|
|
510
509
|
const { data: G, fromCache: I } = await aa(
|
|
511
510
|
a.apiServiceUrl,
|
|
512
511
|
(e == null ? void 0 : e.accessToken) || "",
|
|
513
|
-
|
|
514
|
-
|
|
512
|
+
_.id,
|
|
513
|
+
s,
|
|
515
514
|
"Adding visual to dashboard..."
|
|
516
515
|
), ae = (G == null ? void 0 : G.frameObject) ?? ((Z = G == null ? void 0 : G.visual) == null ? void 0 : Z.frameObject);
|
|
517
516
|
if (!ae)
|
|
518
517
|
return te("Visual has no frame data");
|
|
519
|
-
const j =
|
|
518
|
+
const j = Da(ae);
|
|
520
519
|
if (!(j != null && j.cards) || j.cards.length === 0)
|
|
521
520
|
return te("Visual frame is malformed");
|
|
522
|
-
const
|
|
523
|
-
...
|
|
524
|
-
visualId:
|
|
521
|
+
const z = {
|
|
522
|
+
...Oa(j),
|
|
523
|
+
visualId: _.id
|
|
525
524
|
// Link this frame to the library visual
|
|
526
525
|
};
|
|
527
|
-
return await n(v,
|
|
526
|
+
return await n(v, z), O(!0), { success: !0, fromCache: I };
|
|
528
527
|
} catch (G) {
|
|
529
528
|
return console.error("Error adding visual:", G), te(
|
|
530
529
|
G instanceof Error ? G.message : "Failed to add visual to dashboard"
|
|
@@ -534,83 +533,83 @@ function Be() {
|
|
|
534
533
|
[
|
|
535
534
|
e == null ? void 0 : e.accessToken,
|
|
536
535
|
a.apiServiceUrl,
|
|
537
|
-
|
|
536
|
+
s,
|
|
538
537
|
o,
|
|
539
538
|
v,
|
|
540
|
-
|
|
539
|
+
O,
|
|
541
540
|
n
|
|
542
541
|
]
|
|
543
542
|
);
|
|
544
543
|
return {
|
|
545
|
-
visual:
|
|
546
|
-
isLoading:
|
|
547
|
-
isError:
|
|
548
|
-
error:
|
|
544
|
+
visual: P.data,
|
|
545
|
+
isLoading: P.isLoading,
|
|
546
|
+
isError: P.isError,
|
|
547
|
+
error: P.error,
|
|
549
548
|
handleEditLibraryVisual: Q,
|
|
550
549
|
handleAddLibraryVisual: X,
|
|
551
|
-
getUpdatedFrame:
|
|
552
|
-
refetch:
|
|
550
|
+
getUpdatedFrame: ts().getUpdatedFrame,
|
|
551
|
+
refetch: P.refetch
|
|
553
552
|
};
|
|
554
553
|
}
|
|
555
|
-
function
|
|
554
|
+
function Aa(e) {
|
|
556
555
|
return e ? new Date(e).toLocaleDateString("en-US", {
|
|
557
556
|
month: "short",
|
|
558
557
|
day: "numeric",
|
|
559
558
|
year: "numeric"
|
|
560
559
|
}) : "Unknown";
|
|
561
560
|
}
|
|
562
|
-
function
|
|
561
|
+
function Fa(e, a) {
|
|
563
562
|
var n;
|
|
564
|
-
const
|
|
565
|
-
return
|
|
563
|
+
const s = (n = e.ownership.createdBy) == null ? void 0 : n.type;
|
|
564
|
+
return s === "tenant" || s === "organization" && a;
|
|
566
565
|
}
|
|
567
566
|
function Mt(e, a) {
|
|
568
|
-
var
|
|
569
|
-
return
|
|
567
|
+
var s, n;
|
|
568
|
+
return Fa(e, a) ? ((s = e.ownership.createdBy) == null ? void 0 : s.name) || ((n = e.createdByTenantUserRel) == null ? void 0 : n.name) || e.lastModifiedBy || "Unknown" : "Organization";
|
|
570
569
|
}
|
|
571
|
-
function
|
|
570
|
+
function as(e, a) {
|
|
572
571
|
return Mt(e, a).split(/\s+/).filter(Boolean).slice(0, 2).map((n) => n.charAt(0).toUpperCase()).join("") || "?";
|
|
573
572
|
}
|
|
574
|
-
function
|
|
573
|
+
function ns(e) {
|
|
575
574
|
const a = (e || "").toLowerCase();
|
|
576
|
-
return a.includes("table") ?
|
|
575
|
+
return a.includes("table") ? Bt : a.includes("pie") || a.includes("donut") ? Qa : a.includes("line") ? Ka : a.includes("bar") ? Jn : Ue;
|
|
577
576
|
}
|
|
578
|
-
function
|
|
577
|
+
function rs({ visual: e }) {
|
|
579
578
|
const a = e.ownership.status === "public" ? "Public" : e.ownership.status === "shared" || e.ownership.sharedCount > 0 ? "Shared" : "Private";
|
|
580
579
|
return /* @__PURE__ */ t("span", { className: "inline-flex items-center rounded-[4px] border border-border/60 px-1.5 py-px text-[11px] text-muted-foreground", children: a });
|
|
581
580
|
}
|
|
582
|
-
function
|
|
581
|
+
function ji({
|
|
583
582
|
open: e,
|
|
584
583
|
onOpenChange: a
|
|
585
584
|
}) {
|
|
586
|
-
const
|
|
585
|
+
const s = it("interactive"), [n, i] = E(""), [o, l] = E(/* @__PURE__ */ new Set()), [u, c] = E(!1), [d, h] = E(
|
|
587
586
|
null
|
|
588
|
-
), [p, m] =
|
|
587
|
+
), [p, m] = E(
|
|
589
588
|
null
|
|
590
|
-
), [f, g] =
|
|
589
|
+
), [f, g] = E(!1), [y, N] = E(null), [k, V] = E(null), B = () => {
|
|
591
590
|
l(/* @__PURE__ */ new Set()), h(null), m(null), g(!1), N(null);
|
|
592
591
|
}, D = () => {
|
|
593
|
-
a(!1),
|
|
594
|
-
}, { selectVisual:
|
|
592
|
+
a(!1), B();
|
|
593
|
+
}, { selectVisual: O } = Ct(), { handleAddLibraryVisual: b, handleEditLibraryVisual: S } = Pe(), { isConsoleMode: v } = Ra(), {
|
|
595
594
|
resources: T,
|
|
596
|
-
isLoading:
|
|
595
|
+
isLoading: F,
|
|
597
596
|
isError: H,
|
|
598
|
-
createResource:
|
|
597
|
+
createResource: P,
|
|
599
598
|
updateResource: Q,
|
|
600
599
|
deleteResourceAsync: X,
|
|
601
|
-
duplicateResource:
|
|
600
|
+
duplicateResource: _,
|
|
602
601
|
isCreating: te,
|
|
603
602
|
isDeleting: Z
|
|
604
|
-
} =
|
|
603
|
+
} = Ua(
|
|
605
604
|
void 0,
|
|
606
605
|
(C) => {
|
|
607
|
-
c(!1), C && (
|
|
606
|
+
c(!1), C && (O(C), S(C), D());
|
|
608
607
|
}
|
|
609
608
|
), {
|
|
610
609
|
startUpdating: G,
|
|
611
610
|
stopUpdating: I,
|
|
612
611
|
isUpdating: ae
|
|
613
|
-
} =
|
|
612
|
+
} = $a(), j = T, z = Y(() => {
|
|
614
613
|
const C = n.trim().toLowerCase();
|
|
615
614
|
return C ? j.filter(
|
|
616
615
|
(q) => {
|
|
@@ -627,29 +626,29 @@ function Wi({
|
|
|
627
626
|
(C) => C.permissions.canDelete
|
|
628
627
|
), he = ne.filter(
|
|
629
628
|
(C) => C.permissions.canShare
|
|
630
|
-
), ye =
|
|
629
|
+
), ye = z.length > 0 && z.every(
|
|
631
630
|
(C) => o.has(C.id)
|
|
632
|
-
), x =
|
|
631
|
+
), x = z.some(
|
|
633
632
|
(C) => o.has(C.id)
|
|
634
|
-
),
|
|
633
|
+
), R = (C) => {
|
|
635
634
|
const q = new Set(o);
|
|
636
635
|
C(q), l(q);
|
|
637
636
|
}, $ = (C) => {
|
|
638
|
-
|
|
637
|
+
R((q) => {
|
|
639
638
|
q.has(C) ? q.delete(C) : q.add(C);
|
|
640
639
|
});
|
|
641
640
|
}, K = () => {
|
|
642
641
|
l((C) => {
|
|
643
642
|
const q = new Set(C);
|
|
644
|
-
return ye ?
|
|
643
|
+
return ye ? z.forEach(
|
|
645
644
|
(ee) => q.delete(ee.id)
|
|
646
|
-
) :
|
|
645
|
+
) : z.forEach(
|
|
647
646
|
(ee) => q.add(ee.id)
|
|
648
647
|
), q;
|
|
649
648
|
});
|
|
650
649
|
}, le = async (C) => {
|
|
651
650
|
(await b(C)).success && D();
|
|
652
|
-
},
|
|
651
|
+
}, _e = async () => {
|
|
653
652
|
const C = ne;
|
|
654
653
|
if (C.length === 0) return;
|
|
655
654
|
let q = !1;
|
|
@@ -662,7 +661,7 @@ function Wi({
|
|
|
662
661
|
}, ht = (C) => {
|
|
663
662
|
S(C), D();
|
|
664
663
|
}, Fe = (C) => {
|
|
665
|
-
V(C),
|
|
664
|
+
V(C), _(C, {
|
|
666
665
|
onSettled: () => V(null)
|
|
667
666
|
});
|
|
668
667
|
}, He = () => {
|
|
@@ -684,7 +683,7 @@ function Wi({
|
|
|
684
683
|
}), g(!1), N(null);
|
|
685
684
|
} catch {
|
|
686
685
|
}
|
|
687
|
-
},
|
|
686
|
+
}, Oe = () => {
|
|
688
687
|
if (ne.length !== 1) {
|
|
689
688
|
M.error("Select one visual to share");
|
|
690
689
|
return;
|
|
@@ -721,21 +720,21 @@ function Wi({
|
|
|
721
720
|
}
|
|
722
721
|
);
|
|
723
722
|
}, ce = (C) => {
|
|
724
|
-
a(C), C ||
|
|
725
|
-
},
|
|
726
|
-
return /* @__PURE__ */
|
|
727
|
-
/* @__PURE__ */ t(Le, { open: e, onOpenChange: ce, children: /* @__PURE__ */
|
|
723
|
+
a(C), C || B();
|
|
724
|
+
}, ze = y ? 1 : ue.length;
|
|
725
|
+
return /* @__PURE__ */ r(U, { children: [
|
|
726
|
+
/* @__PURE__ */ t(Le, { open: e, onOpenChange: ce, children: /* @__PURE__ */ r(
|
|
728
727
|
Ve,
|
|
729
728
|
{
|
|
730
729
|
showCloseButton: !1,
|
|
731
730
|
className: "flex max-h-[80vh] w-[min(72rem,calc(100vw-2rem))] max-w-none grid-cols-none flex-col gap-0 overflow-hidden rounded-card border-border/60 p-0 shadow-lg sm:rounded-card",
|
|
732
|
-
style:
|
|
731
|
+
style: s.dialogStyle,
|
|
733
732
|
children: [
|
|
734
|
-
/* @__PURE__ */
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */ t(
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
/* @__PURE__ */ t(
|
|
733
|
+
/* @__PURE__ */ r("div", { className: "flex h-10 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
734
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
735
|
+
/* @__PURE__ */ t(Bt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
736
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
737
|
+
/* @__PURE__ */ t(Be, { className: "truncate text-[13px] font-medium leading-none tracking-normal", children: "Visuals library" }),
|
|
739
738
|
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-medium uppercase leading-none tracking-[0.08em] text-muted-foreground", children: "Add to dashboard" })
|
|
740
739
|
] })
|
|
741
740
|
] }),
|
|
@@ -751,9 +750,9 @@ function Wi({
|
|
|
751
750
|
}
|
|
752
751
|
)
|
|
753
752
|
] }),
|
|
754
|
-
/* @__PURE__ */
|
|
755
|
-
/* @__PURE__ */
|
|
756
|
-
/* @__PURE__ */ t(
|
|
753
|
+
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center gap-2 border-b border-border/60 px-3 py-2", children: [
|
|
754
|
+
/* @__PURE__ */ r("div", { className: "relative min-w-[12rem] flex-1 md:max-w-md", children: [
|
|
755
|
+
/* @__PURE__ */ t(da, { className: "pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
757
756
|
/* @__PURE__ */ t(
|
|
758
757
|
"input",
|
|
759
758
|
{
|
|
@@ -766,7 +765,7 @@ function Wi({
|
|
|
766
765
|
}
|
|
767
766
|
)
|
|
768
767
|
] }),
|
|
769
|
-
/* @__PURE__ */
|
|
768
|
+
/* @__PURE__ */ r(
|
|
770
769
|
L,
|
|
771
770
|
{
|
|
772
771
|
size: "xs",
|
|
@@ -780,14 +779,14 @@ function Wi({
|
|
|
780
779
|
}
|
|
781
780
|
)
|
|
782
781
|
] }),
|
|
783
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children:
|
|
782
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: F ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(Yr, {}) }) : H ? /* @__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" }) }) : z.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
|
|
784
783
|
/* @__PURE__ */ t(Ue, { className: "h-5 w-5 text-muted-foreground/60" }),
|
|
785
784
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: n ? "No visuals found" : "No visuals yet" }),
|
|
786
785
|
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: n ? "Try a different search." : "Create a saved visual to add it here." })
|
|
787
786
|
] }) : /* @__PURE__ */ t(
|
|
788
|
-
|
|
787
|
+
ss,
|
|
789
788
|
{
|
|
790
|
-
visuals:
|
|
789
|
+
visuals: z,
|
|
791
790
|
selectedIds: o,
|
|
792
791
|
allFilteredSelected: ye,
|
|
793
792
|
someFilteredSelected: x,
|
|
@@ -806,9 +805,9 @@ function Wi({
|
|
|
806
805
|
isConsoleMode: v
|
|
807
806
|
}
|
|
808
807
|
) }),
|
|
809
|
-
/* @__PURE__ */
|
|
810
|
-
/* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5", children: o.size > 0 && /* @__PURE__ */
|
|
811
|
-
/* @__PURE__ */
|
|
808
|
+
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-3 py-2", children: [
|
|
809
|
+
/* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5", children: o.size > 0 && /* @__PURE__ */ r(U, { children: [
|
|
810
|
+
/* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: [
|
|
812
811
|
/* @__PURE__ */ t("span", { className: "font-medium tabular-nums text-foreground", children: o.size }),
|
|
813
812
|
" ",
|
|
814
813
|
"selected"
|
|
@@ -822,20 +821,20 @@ function Wi({
|
|
|
822
821
|
children: "Clear"
|
|
823
822
|
}
|
|
824
823
|
),
|
|
825
|
-
/* @__PURE__ */
|
|
824
|
+
/* @__PURE__ */ r(
|
|
826
825
|
L,
|
|
827
826
|
{
|
|
828
827
|
size: "xs",
|
|
829
828
|
variant: "outline",
|
|
830
|
-
onClick:
|
|
829
|
+
onClick: Oe,
|
|
831
830
|
disabled: ne.length !== 1 || he.length !== 1,
|
|
832
831
|
children: [
|
|
833
|
-
/* @__PURE__ */ t(
|
|
832
|
+
/* @__PURE__ */ t(ca, { className: "h-3.5 w-3.5" }),
|
|
834
833
|
"Share"
|
|
835
834
|
]
|
|
836
835
|
}
|
|
837
836
|
),
|
|
838
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ r(
|
|
839
838
|
L,
|
|
840
839
|
{
|
|
841
840
|
size: "xs",
|
|
@@ -851,7 +850,7 @@ function Wi({
|
|
|
851
850
|
}
|
|
852
851
|
)
|
|
853
852
|
] }) }),
|
|
854
|
-
/* @__PURE__ */
|
|
853
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
855
854
|
/* @__PURE__ */ t(
|
|
856
855
|
L,
|
|
857
856
|
{
|
|
@@ -861,14 +860,14 @@ function Wi({
|
|
|
861
860
|
children: "Close"
|
|
862
861
|
}
|
|
863
862
|
),
|
|
864
|
-
/* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ r(
|
|
865
864
|
L,
|
|
866
865
|
{
|
|
867
866
|
size: "xs",
|
|
868
|
-
onClick:
|
|
867
|
+
onClick: _e,
|
|
869
868
|
disabled: o.size === 0,
|
|
870
869
|
children: [
|
|
871
|
-
/* @__PURE__ */ t(
|
|
870
|
+
/* @__PURE__ */ t(Pt, { className: "h-3.5 w-3.5" }),
|
|
872
871
|
o.size === 0 ? "Add to dashboard" : `Add ${o.size} visual${o.size === 1 ? "" : "s"}`
|
|
873
872
|
]
|
|
874
873
|
}
|
|
@@ -879,24 +878,24 @@ function Wi({
|
|
|
879
878
|
}
|
|
880
879
|
) }),
|
|
881
880
|
/* @__PURE__ */ t(
|
|
882
|
-
|
|
881
|
+
Xr,
|
|
883
882
|
{
|
|
884
883
|
open: u,
|
|
885
884
|
onOpenChange: c,
|
|
886
|
-
onSubmit:
|
|
885
|
+
onSubmit: P,
|
|
887
886
|
isCreating: te
|
|
888
887
|
}
|
|
889
888
|
),
|
|
890
889
|
d && /* @__PURE__ */ t(
|
|
891
|
-
|
|
890
|
+
ja,
|
|
892
891
|
{
|
|
893
892
|
resource: d,
|
|
894
|
-
resourceType:
|
|
893
|
+
resourceType: qa.VISUAL,
|
|
895
894
|
onClose: () => h(null)
|
|
896
895
|
}
|
|
897
896
|
),
|
|
898
897
|
p && /* @__PURE__ */ t(
|
|
899
|
-
|
|
898
|
+
Wa,
|
|
900
899
|
{
|
|
901
900
|
open: !!p,
|
|
902
901
|
resourceLabel: "Visual",
|
|
@@ -914,26 +913,26 @@ function Wi({
|
|
|
914
913
|
onOpenChange: (C) => {
|
|
915
914
|
!C && Z || (g(C), C || N(null));
|
|
916
915
|
},
|
|
917
|
-
children: /* @__PURE__ */
|
|
918
|
-
/* @__PURE__ */
|
|
919
|
-
/* @__PURE__ */
|
|
916
|
+
children: /* @__PURE__ */ r(St, { children: [
|
|
917
|
+
/* @__PURE__ */ r(kt, { children: [
|
|
918
|
+
/* @__PURE__ */ r(Dt, { children: [
|
|
920
919
|
"Delete ",
|
|
921
|
-
|
|
920
|
+
ze,
|
|
922
921
|
" visual",
|
|
923
|
-
|
|
922
|
+
ze === 1 ? "" : "s",
|
|
924
923
|
"?"
|
|
925
924
|
] }),
|
|
926
925
|
/* @__PURE__ */ t(At, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
|
|
927
926
|
] }),
|
|
928
|
-
/* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ r(Ft, { children: [
|
|
929
928
|
/* @__PURE__ */ t(Et, { disabled: Z, children: "Cancel" }),
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
|
|
929
|
+
/* @__PURE__ */ r(
|
|
930
|
+
ua,
|
|
932
931
|
{
|
|
933
932
|
onClick: (C) => {
|
|
934
933
|
C.preventDefault(), mt();
|
|
935
934
|
},
|
|
936
|
-
disabled: Z ||
|
|
935
|
+
disabled: Z || ze === 0,
|
|
937
936
|
children: [
|
|
938
937
|
Z ? /* @__PURE__ */ t(de, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(tt, { className: "h-3.5 w-3.5" }),
|
|
939
938
|
Z ? "Deleting..." : "Delete"
|
|
@@ -946,10 +945,10 @@ function Wi({
|
|
|
946
945
|
)
|
|
947
946
|
] });
|
|
948
947
|
}
|
|
949
|
-
function
|
|
948
|
+
function ss({
|
|
950
949
|
visuals: e,
|
|
951
950
|
selectedIds: a,
|
|
952
|
-
allFilteredSelected:
|
|
951
|
+
allFilteredSelected: s,
|
|
953
952
|
someFilteredSelected: n,
|
|
954
953
|
onSelectAll: i,
|
|
955
954
|
onToggleSelection: o,
|
|
@@ -963,12 +962,12 @@ function is({
|
|
|
963
962
|
isDeleting: f,
|
|
964
963
|
isConsoleMode: g
|
|
965
964
|
}) {
|
|
966
|
-
return /* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
965
|
+
return /* @__PURE__ */ r("div", { className: "min-w-[48rem]", children: [
|
|
966
|
+
/* @__PURE__ */ r("div", { className: "grid h-9 grid-cols-[2.5rem_minmax(14rem,1.8fr)_minmax(10rem,1fr)_8rem_7rem_5rem_5.5rem] items-center border-b border-border/60 px-3 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: [
|
|
968
967
|
/* @__PURE__ */ t(
|
|
969
968
|
It,
|
|
970
969
|
{
|
|
971
|
-
checked:
|
|
970
|
+
checked: s ? !0 : n ? "indeterminate" : !1,
|
|
972
971
|
onCheckedChange: i,
|
|
973
972
|
"aria-label": "Select all visuals"
|
|
974
973
|
}
|
|
@@ -981,7 +980,7 @@ function is({
|
|
|
981
980
|
/* @__PURE__ */ t("span", { className: "text-right", children: "Actions" })
|
|
982
981
|
] }),
|
|
983
982
|
e.map((y) => /* @__PURE__ */ t(
|
|
984
|
-
|
|
983
|
+
is,
|
|
985
984
|
{
|
|
986
985
|
visual: y,
|
|
987
986
|
selected: a.has(y.id),
|
|
@@ -1000,10 +999,10 @@ function is({
|
|
|
1000
999
|
))
|
|
1001
1000
|
] });
|
|
1002
1001
|
}
|
|
1003
|
-
function
|
|
1002
|
+
function is({
|
|
1004
1003
|
visual: e,
|
|
1005
1004
|
selected: a,
|
|
1006
|
-
onToggleSelection:
|
|
1005
|
+
onToggleSelection: s,
|
|
1007
1006
|
onAddVisual: n,
|
|
1008
1007
|
onOpenVisual: i,
|
|
1009
1008
|
onEditDetails: o,
|
|
@@ -1015,10 +1014,10 @@ function os({
|
|
|
1015
1014
|
isConsoleMode: p
|
|
1016
1015
|
}) {
|
|
1017
1016
|
var g;
|
|
1018
|
-
const m =
|
|
1017
|
+
const m = ns(e.kind), f = () => {
|
|
1019
1018
|
n(e);
|
|
1020
1019
|
};
|
|
1021
|
-
return /* @__PURE__ */
|
|
1020
|
+
return /* @__PURE__ */ r(
|
|
1022
1021
|
"div",
|
|
1023
1022
|
{
|
|
1024
1023
|
className: J(
|
|
@@ -1030,11 +1029,11 @@ function os({
|
|
|
1030
1029
|
It,
|
|
1031
1030
|
{
|
|
1032
1031
|
checked: a,
|
|
1033
|
-
onCheckedChange: () =>
|
|
1032
|
+
onCheckedChange: () => s(e.id),
|
|
1034
1033
|
"aria-label": `Select ${e.title || "visual"}`
|
|
1035
1034
|
}
|
|
1036
1035
|
) }),
|
|
1037
|
-
/* @__PURE__ */
|
|
1036
|
+
/* @__PURE__ */ r(
|
|
1038
1037
|
"button",
|
|
1039
1038
|
{
|
|
1040
1039
|
type: "button",
|
|
@@ -1043,7 +1042,7 @@ function os({
|
|
|
1043
1042
|
"aria-label": `Add ${e.title || "visual"} to dashboard`,
|
|
1044
1043
|
children: [
|
|
1045
1044
|
/* @__PURE__ */ t(m, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
1046
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ r("div", { className: "min-w-0", children: [
|
|
1047
1046
|
/* @__PURE__ */ t(
|
|
1048
1047
|
"div",
|
|
1049
1048
|
{
|
|
@@ -1064,15 +1063,15 @@ function os({
|
|
|
1064
1063
|
]
|
|
1065
1064
|
}
|
|
1066
1065
|
),
|
|
1067
|
-
/* @__PURE__ */
|
|
1068
|
-
/* @__PURE__ */ t("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children:
|
|
1066
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
1067
|
+
/* @__PURE__ */ t("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-[9px] font-medium text-muted-foreground", children: as(e, p) }),
|
|
1069
1068
|
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: Mt(e, p) })
|
|
1070
1069
|
] }),
|
|
1071
|
-
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children:
|
|
1072
|
-
/* @__PURE__ */ t(
|
|
1070
|
+
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children: Aa(e.updatedAt) }),
|
|
1071
|
+
/* @__PURE__ */ t(rs, { visual: e }),
|
|
1073
1072
|
/* @__PURE__ */ t("span", { className: "text-right tabular-nums text-muted-foreground", children: e.ownership.sharedCount > 0 ? e.ownership.sharedCount : "—" }),
|
|
1074
1073
|
/* @__PURE__ */ t(
|
|
1075
|
-
|
|
1074
|
+
os,
|
|
1076
1075
|
{
|
|
1077
1076
|
visual: e,
|
|
1078
1077
|
onOpenVisual: i,
|
|
@@ -1089,10 +1088,10 @@ function os({
|
|
|
1089
1088
|
}
|
|
1090
1089
|
);
|
|
1091
1090
|
}
|
|
1092
|
-
function
|
|
1091
|
+
function os({
|
|
1093
1092
|
visual: e,
|
|
1094
1093
|
onOpenVisual: a,
|
|
1095
|
-
onEditDetails:
|
|
1094
|
+
onEditDetails: s,
|
|
1096
1095
|
onShareVisual: n,
|
|
1097
1096
|
onDeleteVisual: i,
|
|
1098
1097
|
onDuplicateVisual: o,
|
|
@@ -1100,7 +1099,7 @@ function ls({
|
|
|
1100
1099
|
isDeleting: u,
|
|
1101
1100
|
isConsoleMode: c
|
|
1102
1101
|
}) {
|
|
1103
|
-
return /* @__PURE__ */
|
|
1102
|
+
return /* @__PURE__ */ r(
|
|
1104
1103
|
"div",
|
|
1105
1104
|
{
|
|
1106
1105
|
className: "flex items-center justify-end gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
|
|
@@ -1117,7 +1116,7 @@ function ls({
|
|
|
1117
1116
|
children: /* @__PURE__ */ t(pt, { className: "h-3.5 w-3.5" })
|
|
1118
1117
|
}
|
|
1119
1118
|
),
|
|
1120
|
-
/* @__PURE__ */
|
|
1119
|
+
/* @__PURE__ */ r(je, { modal: !1, children: [
|
|
1121
1120
|
/* @__PURE__ */ t(qe, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1122
1121
|
L,
|
|
1123
1122
|
{
|
|
@@ -1125,41 +1124,41 @@ function ls({
|
|
|
1125
1124
|
variant: "ghost",
|
|
1126
1125
|
className: "w-7 px-0",
|
|
1127
1126
|
"aria-label": "More actions",
|
|
1128
|
-
children: /* @__PURE__ */ t(
|
|
1127
|
+
children: /* @__PURE__ */ t(ha, { className: "h-3.5 w-3.5" })
|
|
1129
1128
|
}
|
|
1130
1129
|
) }),
|
|
1131
|
-
/* @__PURE__ */
|
|
1130
|
+
/* @__PURE__ */ r(
|
|
1132
1131
|
We,
|
|
1133
1132
|
{
|
|
1134
1133
|
align: "end",
|
|
1135
1134
|
className: "z-[60] w-44 rounded-[6px] border-border/60 p-1 shadow-sm",
|
|
1136
1135
|
children: [
|
|
1137
|
-
/* @__PURE__ */
|
|
1136
|
+
/* @__PURE__ */ r(re, { onClick: () => a(e), children: [
|
|
1138
1137
|
/* @__PURE__ */ t(pt, { className: "h-3.5 w-3.5" }),
|
|
1139
1138
|
"Edit visual"
|
|
1140
1139
|
] }),
|
|
1141
|
-
/* @__PURE__ */
|
|
1140
|
+
/* @__PURE__ */ r(
|
|
1142
1141
|
re,
|
|
1143
1142
|
{
|
|
1144
1143
|
onClick: () => o(e.id),
|
|
1145
1144
|
disabled: l === e.id,
|
|
1146
1145
|
children: [
|
|
1147
|
-
l === e.id ? /* @__PURE__ */ t(de, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(
|
|
1146
|
+
l === e.id ? /* @__PURE__ */ t(de, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(Ha, { className: "h-3.5 w-3.5" }),
|
|
1148
1147
|
l === e.id ? "Duplicating..." : "Duplicate"
|
|
1149
1148
|
]
|
|
1150
1149
|
}
|
|
1151
1150
|
),
|
|
1152
|
-
e.permissions.canEdit && /* @__PURE__ */
|
|
1151
|
+
e.permissions.canEdit && /* @__PURE__ */ r(re, { onClick: () => s(e), children: [
|
|
1153
1152
|
/* @__PURE__ */ t(pt, { className: "h-3.5 w-3.5" }),
|
|
1154
1153
|
"Edit details"
|
|
1155
1154
|
] }),
|
|
1156
|
-
e.permissions.canShare && /* @__PURE__ */
|
|
1157
|
-
/* @__PURE__ */ t(
|
|
1155
|
+
e.permissions.canShare && /* @__PURE__ */ r(re, { onClick: () => n(e), children: [
|
|
1156
|
+
/* @__PURE__ */ t(ca, { className: "h-3.5 w-3.5" }),
|
|
1158
1157
|
"Share"
|
|
1159
1158
|
] }),
|
|
1160
|
-
e.permissions.canDelete && /* @__PURE__ */
|
|
1159
|
+
e.permissions.canDelete && /* @__PURE__ */ r(U, { children: [
|
|
1161
1160
|
/* @__PURE__ */ t(at, {}),
|
|
1162
|
-
/* @__PURE__ */
|
|
1161
|
+
/* @__PURE__ */ r(
|
|
1163
1162
|
re,
|
|
1164
1163
|
{
|
|
1165
1164
|
className: "text-destructive focus:bg-destructive/10 focus:text-destructive",
|
|
@@ -1173,14 +1172,14 @@ function ls({
|
|
|
1173
1172
|
)
|
|
1174
1173
|
] }),
|
|
1175
1174
|
/* @__PURE__ */ t(at, {}),
|
|
1176
|
-
/* @__PURE__ */
|
|
1177
|
-
|
|
1178
|
-
/* @__PURE__ */ t(
|
|
1175
|
+
/* @__PURE__ */ r("div", { className: "space-y-1 px-2 py-1.5 text-[11px] text-muted-foreground", children: [
|
|
1176
|
+
Fa(e, c) && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
1177
|
+
/* @__PURE__ */ t(Ga, { className: "h-3 w-3" }),
|
|
1179
1178
|
/* @__PURE__ */ t("span", { className: "truncate", children: Mt(e, c) })
|
|
1180
1179
|
] }),
|
|
1181
|
-
/* @__PURE__ */
|
|
1182
|
-
/* @__PURE__ */ t(
|
|
1183
|
-
/* @__PURE__ */ t("span", { children:
|
|
1180
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
1181
|
+
/* @__PURE__ */ t(Ya, { className: "h-3 w-3" }),
|
|
1182
|
+
/* @__PURE__ */ t("span", { children: Aa(e.updatedAt) })
|
|
1184
1183
|
] })
|
|
1185
1184
|
] })
|
|
1186
1185
|
]
|
|
@@ -1191,7 +1190,7 @@ function ls({
|
|
|
1191
1190
|
}
|
|
1192
1191
|
);
|
|
1193
1192
|
}
|
|
1194
|
-
function
|
|
1193
|
+
function qi(e, a, s = !1) {
|
|
1195
1194
|
const n = w((d) => d.dashboard), i = w(
|
|
1196
1195
|
(d) => d.isDashboardEditing
|
|
1197
1196
|
), o = w(
|
|
@@ -1203,13 +1202,13 @@ function Qi(e, a, r = !1) {
|
|
|
1203
1202
|
Ut(() => (w.setState({ checkUnsavedDashboardChanges: l }), () => {
|
|
1204
1203
|
w.getState().checkUnsavedDashboardChanges === l && w.setState({ checkUnsavedDashboardChanges: null });
|
|
1205
1204
|
}), [l]);
|
|
1206
|
-
const u = Y(() => !
|
|
1205
|
+
const u = Y(() => !s || a || !n || i && (!e || n.id !== e.id) ? null : {
|
|
1207
1206
|
dashboardId: n.id,
|
|
1208
1207
|
dirty: i && e ? Je(n) !== Je(e) : !1
|
|
1209
1208
|
}, [
|
|
1210
1209
|
i,
|
|
1211
1210
|
a,
|
|
1212
|
-
|
|
1211
|
+
s,
|
|
1213
1212
|
e,
|
|
1214
1213
|
n
|
|
1215
1214
|
]), c = et(null);
|
|
@@ -1230,10 +1229,10 @@ function Qi(e, a, r = !1) {
|
|
|
1230
1229
|
}));
|
|
1231
1230
|
}, [u, o]), l;
|
|
1232
1231
|
}
|
|
1233
|
-
function
|
|
1232
|
+
function zt(e) {
|
|
1234
1233
|
var a;
|
|
1235
|
-
for (const
|
|
1236
|
-
if (
|
|
1234
|
+
for (const s of e.cards)
|
|
1235
|
+
if (s.type === "matrixTable" && !er.safeParse((a = s.config) == null ? void 0 : a.matrix).success)
|
|
1237
1236
|
return M.error("Matrix requires at least one row field, one metric, and valid settings."), !1;
|
|
1238
1237
|
return !0;
|
|
1239
1238
|
}
|
|
@@ -1241,12 +1240,12 @@ function gt({
|
|
|
1241
1240
|
className: e,
|
|
1242
1241
|
variant: a = "outline"
|
|
1243
1242
|
}) {
|
|
1244
|
-
const
|
|
1243
|
+
const s = oe((o) => o.onSave), { getUpdatedFrame: n } = Pe();
|
|
1245
1244
|
function i() {
|
|
1246
1245
|
const o = n();
|
|
1247
|
-
|
|
1246
|
+
zt(o) && (s == null || s(o));
|
|
1248
1247
|
}
|
|
1249
|
-
return /* @__PURE__ */
|
|
1248
|
+
return /* @__PURE__ */ r(
|
|
1250
1249
|
L,
|
|
1251
1250
|
{
|
|
1252
1251
|
onClick: i,
|
|
@@ -1254,23 +1253,23 @@ function gt({
|
|
|
1254
1253
|
size: "xs",
|
|
1255
1254
|
variant: a,
|
|
1256
1255
|
children: [
|
|
1257
|
-
/* @__PURE__ */ t(
|
|
1256
|
+
/* @__PURE__ */ t(Pt, { className: "h-3.5 w-3.5" }),
|
|
1258
1257
|
"Done"
|
|
1259
1258
|
]
|
|
1260
1259
|
}
|
|
1261
1260
|
);
|
|
1262
1261
|
}
|
|
1263
|
-
function
|
|
1262
|
+
function ls({
|
|
1264
1263
|
className: e,
|
|
1265
1264
|
variant: a = "default"
|
|
1266
1265
|
}) {
|
|
1267
|
-
const
|
|
1266
|
+
const s = ot(), [n, i] = E(!1), { setIsVisualEditing: o } = ve(), { getUpdatedFrame: l } = Pe(), u = lt(), c = oe((p) => p.frame), d = ma();
|
|
1268
1267
|
return /* @__PURE__ */ t(
|
|
1269
1268
|
L,
|
|
1270
1269
|
{
|
|
1271
1270
|
onClick: () => {
|
|
1272
1271
|
const p = l();
|
|
1273
|
-
if (!
|
|
1272
|
+
if (!zt(p))
|
|
1274
1273
|
return;
|
|
1275
1274
|
const m = (c == null ? void 0 : c.visualId) || (u == null ? void 0 : u.id);
|
|
1276
1275
|
if (!m) {
|
|
@@ -1286,7 +1285,7 @@ function ds({
|
|
|
1286
1285
|
},
|
|
1287
1286
|
{
|
|
1288
1287
|
onSuccess: () => {
|
|
1289
|
-
i(!1), M.success("Visual updated successfully"),
|
|
1288
|
+
i(!1), M.success("Visual updated successfully"), s.invalidateQueries({
|
|
1290
1289
|
queryKey: ["resource-by-id", "visual", m],
|
|
1291
1290
|
exact: !0
|
|
1292
1291
|
});
|
|
@@ -1300,20 +1299,20 @@ function ds({
|
|
|
1300
1299
|
className: e,
|
|
1301
1300
|
size: "xs",
|
|
1302
1301
|
variant: a,
|
|
1303
|
-
children: n ? /* @__PURE__ */
|
|
1302
|
+
children: n ? /* @__PURE__ */ r(U, { children: [
|
|
1304
1303
|
/* @__PURE__ */ t(de, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1305
1304
|
"Saving"
|
|
1306
|
-
] }) : /* @__PURE__ */
|
|
1305
|
+
] }) : /* @__PURE__ */ r(U, { children: [
|
|
1307
1306
|
/* @__PURE__ */ t(wa, { className: "h-3.5 w-3.5" }),
|
|
1308
1307
|
"Save to Library"
|
|
1309
1308
|
] })
|
|
1310
1309
|
}
|
|
1311
1310
|
);
|
|
1312
1311
|
}
|
|
1313
|
-
function
|
|
1312
|
+
function ds({
|
|
1314
1313
|
className: e
|
|
1315
1314
|
}) {
|
|
1316
|
-
const a = ot(), [
|
|
1315
|
+
const a = ot(), [s, n] = E(!1), i = lt(), o = oe((g) => g.frame), l = w((g) => g.selectedSheetId), u = w((g) => g.dashboard), { updateFrame: c, setIsVisualEditing: d } = ve(), { getUpdatedFrame: h } = Pe(), p = ma(), m = ct();
|
|
1317
1316
|
return /* @__PURE__ */ t(
|
|
1318
1317
|
L,
|
|
1319
1318
|
{
|
|
@@ -1330,7 +1329,7 @@ function cs({
|
|
|
1330
1329
|
n(!0);
|
|
1331
1330
|
try {
|
|
1332
1331
|
const y = h();
|
|
1333
|
-
if (!
|
|
1332
|
+
if (!zt(y)) {
|
|
1334
1333
|
n(!1);
|
|
1335
1334
|
return;
|
|
1336
1335
|
}
|
|
@@ -1362,11 +1361,11 @@ function cs({
|
|
|
1362
1361
|
className: e,
|
|
1363
1362
|
size: "xs",
|
|
1364
1363
|
variant: "default",
|
|
1365
|
-
disabled:
|
|
1366
|
-
children:
|
|
1364
|
+
disabled: s,
|
|
1365
|
+
children: s ? /* @__PURE__ */ r(U, { children: [
|
|
1367
1366
|
/* @__PURE__ */ t(de, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1368
1367
|
"Saving..."
|
|
1369
|
-
] }) : /* @__PURE__ */
|
|
1368
|
+
] }) : /* @__PURE__ */ r(U, { children: [
|
|
1370
1369
|
/* @__PURE__ */ t(wa, { className: "h-3.5 w-3.5" }),
|
|
1371
1370
|
"Save & Apply"
|
|
1372
1371
|
] })
|
|
@@ -1374,15 +1373,15 @@ function cs({
|
|
|
1374
1373
|
);
|
|
1375
1374
|
}
|
|
1376
1375
|
function bt({ className: e }) {
|
|
1377
|
-
const { setTempQueryData: a, setSqlGen:
|
|
1376
|
+
const { setTempQueryData: a, setSqlGen: s } = dt(), n = ot(), i = oe((u) => u.tempQueryData), o = oe((u) => u.onClose);
|
|
1378
1377
|
function l() {
|
|
1379
1378
|
if (i) {
|
|
1380
1379
|
const { queryKey: u, queryData: c } = i;
|
|
1381
1380
|
u && c && n.setQueryData(u, c);
|
|
1382
1381
|
}
|
|
1383
|
-
|
|
1382
|
+
s({}), o == null || o();
|
|
1384
1383
|
}
|
|
1385
|
-
return /* @__PURE__ */
|
|
1384
|
+
return /* @__PURE__ */ r(
|
|
1386
1385
|
L,
|
|
1387
1386
|
{
|
|
1388
1387
|
onClick: l,
|
|
@@ -1396,23 +1395,23 @@ function bt({ className: e }) {
|
|
|
1396
1395
|
}
|
|
1397
1396
|
);
|
|
1398
1397
|
}
|
|
1399
|
-
function
|
|
1398
|
+
function cs({
|
|
1400
1399
|
open: e,
|
|
1401
1400
|
onOpenChange: a,
|
|
1402
|
-
isLibraryVisual:
|
|
1401
|
+
isLibraryVisual: s,
|
|
1403
1402
|
currentVisualName: n,
|
|
1404
1403
|
isSaving: i = !1,
|
|
1405
1404
|
destinationMode: o = "both",
|
|
1406
1405
|
onConfirm: l
|
|
1407
1406
|
}) {
|
|
1408
|
-
const [u, c] =
|
|
1409
|
-
|
|
1410
|
-
), [d, h] =
|
|
1407
|
+
const [u, c] = E(
|
|
1408
|
+
s && n ? `Copy of ${n}` : n || ""
|
|
1409
|
+
), [d, h] = E("");
|
|
1411
1410
|
la.useEffect(() => {
|
|
1412
1411
|
e && (c(
|
|
1413
|
-
|
|
1412
|
+
s && n ? `Copy of ${n}` : n || ""
|
|
1414
1413
|
), h(""));
|
|
1415
|
-
}, [e,
|
|
1414
|
+
}, [e, s, n]);
|
|
1416
1415
|
const p = !!u.trim(), m = o === "local" ? {
|
|
1417
1416
|
saveToLibrary: !1,
|
|
1418
1417
|
saveToCurrentDashboard: !0,
|
|
@@ -1439,9 +1438,9 @@ function us({
|
|
|
1439
1438
|
saveToCurrentDashboard: m.saveToCurrentDashboard
|
|
1440
1439
|
});
|
|
1441
1440
|
};
|
|
1442
|
-
return /* @__PURE__ */ t(Le, { open: e, onOpenChange: a, children: /* @__PURE__ */
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
/* @__PURE__ */
|
|
1441
|
+
return /* @__PURE__ */ t(Le, { open: e, onOpenChange: a, children: /* @__PURE__ */ r(Ve, { className: "sm:max-w-[500px]", children: [
|
|
1442
|
+
/* @__PURE__ */ r(Tt, { children: [
|
|
1443
|
+
/* @__PURE__ */ r(Be, { className: "flex items-center gap-2", children: [
|
|
1445
1444
|
/* @__PURE__ */ t("span", { children: "Save Visual As" }),
|
|
1446
1445
|
m.badgeType !== "local" && /* @__PURE__ */ t(
|
|
1447
1446
|
Cr,
|
|
@@ -1454,9 +1453,9 @@ function us({
|
|
|
1454
1453
|
] }),
|
|
1455
1454
|
/* @__PURE__ */ t(ut, { children: m.description })
|
|
1456
1455
|
] }),
|
|
1457
|
-
/* @__PURE__ */
|
|
1458
|
-
/* @__PURE__ */
|
|
1459
|
-
/* @__PURE__ */ t(
|
|
1456
|
+
/* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
|
|
1457
|
+
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
1458
|
+
/* @__PURE__ */ t(Re, { htmlFor: "name", children: "Name" }),
|
|
1460
1459
|
/* @__PURE__ */ t(
|
|
1461
1460
|
xe,
|
|
1462
1461
|
{
|
|
@@ -1468,10 +1467,10 @@ function us({
|
|
|
1468
1467
|
}
|
|
1469
1468
|
)
|
|
1470
1469
|
] }),
|
|
1471
|
-
/* @__PURE__ */
|
|
1472
|
-
/* @__PURE__ */ t(
|
|
1470
|
+
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
1471
|
+
/* @__PURE__ */ t(Re, { htmlFor: "description", children: "Description (optional)" }),
|
|
1473
1472
|
/* @__PURE__ */ t(
|
|
1474
|
-
|
|
1473
|
+
pa,
|
|
1475
1474
|
{
|
|
1476
1475
|
id: "description",
|
|
1477
1476
|
value: d,
|
|
@@ -1483,7 +1482,7 @@ function us({
|
|
|
1483
1482
|
)
|
|
1484
1483
|
] })
|
|
1485
1484
|
] }),
|
|
1486
|
-
/* @__PURE__ */
|
|
1485
|
+
/* @__PURE__ */ r(Xa, { children: [
|
|
1487
1486
|
/* @__PURE__ */ t(
|
|
1488
1487
|
L,
|
|
1489
1488
|
{
|
|
@@ -1493,19 +1492,19 @@ function us({
|
|
|
1493
1492
|
children: "Cancel"
|
|
1494
1493
|
}
|
|
1495
1494
|
),
|
|
1496
|
-
/* @__PURE__ */
|
|
1495
|
+
/* @__PURE__ */ r(L, { onClick: f, disabled: !p || i, children: [
|
|
1497
1496
|
i && /* @__PURE__ */ t(de, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
1498
1497
|
m.actionLabel
|
|
1499
1498
|
] })
|
|
1500
1499
|
] })
|
|
1501
1500
|
] }) });
|
|
1502
1501
|
}
|
|
1503
|
-
function
|
|
1504
|
-
const [e, a] =
|
|
1502
|
+
function us() {
|
|
1503
|
+
const [e, a] = E(!1), [s, n] = E(!1), [i, o] = E(null), [l, u] = E(null), c = oe((b) => b.frame), d = oe((b) => b.card), h = lt(), p = w((b) => b.selectedSheetId), m = w((b) => b.dashboard), { getUpdatedFrame: f } = Pe(), { selectVisual: g } = Ct(), { addFrame: y, setIsVisualEditing: N } = ve(), k = ct(), V = !!(c != null && c.visualId), B = (() => {
|
|
1505
1504
|
var b, S;
|
|
1506
1505
|
return ((b = c == null ? void 0 : c.cards) == null ? void 0 : b.length) === 1 && ((S = c.cards[0]) != null && S.title) ? c.cards[0].title : h != null && h.title ? h.title : (d == null ? void 0 : d.title) || "Untitled Visual";
|
|
1507
|
-
})(), D =
|
|
1508
|
-
b != null && b.id && (g(b),
|
|
1506
|
+
})(), D = Ja((b) => {
|
|
1507
|
+
b != null && b.id && (g(b), s && i && l && p && (async () => {
|
|
1509
1508
|
try {
|
|
1510
1509
|
const S = {
|
|
1511
1510
|
...i,
|
|
@@ -1536,29 +1535,29 @@ function hs() {
|
|
|
1536
1535
|
}
|
|
1537
1536
|
const S = f(), T = S.cards.length === 1 ? {
|
|
1538
1537
|
...S,
|
|
1539
|
-
cards: S.cards.map((
|
|
1540
|
-
...
|
|
1538
|
+
cards: S.cards.map((F) => ({
|
|
1539
|
+
...F,
|
|
1541
1540
|
title: b.name
|
|
1542
1541
|
// Use visual name as card title
|
|
1543
1542
|
}))
|
|
1544
1543
|
} : S;
|
|
1545
1544
|
if (b.saveToLibrary) {
|
|
1546
|
-
let
|
|
1545
|
+
let F = null;
|
|
1547
1546
|
if (b.saveToCurrentDashboard)
|
|
1548
1547
|
try {
|
|
1549
|
-
|
|
1548
|
+
F = await k(T, {
|
|
1550
1549
|
previousFrame: rt(m, T.id)
|
|
1551
1550
|
});
|
|
1552
|
-
} catch (
|
|
1551
|
+
} catch (P) {
|
|
1553
1552
|
console.error(
|
|
1554
1553
|
"Failed to prepare semantic metadata before saving visual:",
|
|
1555
|
-
|
|
1554
|
+
P
|
|
1556
1555
|
), M.error(
|
|
1557
|
-
|
|
1556
|
+
P instanceof Error ? P.message : "Failed to prepare semantic metadata for the saved visual"
|
|
1558
1557
|
);
|
|
1559
1558
|
return;
|
|
1560
1559
|
}
|
|
1561
|
-
n(b.saveToCurrentDashboard), o(T), u(
|
|
1560
|
+
n(b.saveToCurrentDashboard), o(T), u(F);
|
|
1562
1561
|
const H = {
|
|
1563
1562
|
title: b.name,
|
|
1564
1563
|
description: b.description,
|
|
@@ -1568,7 +1567,7 @@ function hs() {
|
|
|
1568
1567
|
};
|
|
1569
1568
|
D.mutate(H);
|
|
1570
1569
|
} else if (b.saveToCurrentDashboard) {
|
|
1571
|
-
const
|
|
1570
|
+
const F = {
|
|
1572
1571
|
...T,
|
|
1573
1572
|
// Card title already synced
|
|
1574
1573
|
id: Kt(),
|
|
@@ -1579,7 +1578,7 @@ function hs() {
|
|
|
1579
1578
|
const H = await k(T, {
|
|
1580
1579
|
previousFrame: rt(m, T.id)
|
|
1581
1580
|
});
|
|
1582
|
-
y(p,
|
|
1581
|
+
y(p, F, {
|
|
1583
1582
|
semanticExecutionPayload: H
|
|
1584
1583
|
}), M.success("Visual saved to dashboard"), a(!1), N(!1);
|
|
1585
1584
|
} catch (H) {
|
|
@@ -1590,21 +1589,21 @@ function hs() {
|
|
|
1590
1589
|
}
|
|
1591
1590
|
},
|
|
1592
1591
|
isLibraryVisual: V,
|
|
1593
|
-
currentVisualName:
|
|
1592
|
+
currentVisualName: B,
|
|
1594
1593
|
isSaving: D.isPending
|
|
1595
1594
|
};
|
|
1596
1595
|
}
|
|
1597
|
-
function
|
|
1598
|
-
const { isInspectionMode: a } =
|
|
1599
|
-
saveAsDialogOpen:
|
|
1596
|
+
function Wi(e = {}) {
|
|
1597
|
+
const { isInspectionMode: a } = Za(), s = oe((P) => P.frame), n = oe((P) => P.editorContext), i = en((P) => P.selectedVisual), o = w((P) => P.selectedFrameId), l = w((P) => P.selectedSheetId), u = w((P) => P.dashboard), { setIsVisualEditing: c, updateFrame: d } = ve(), [h, p] = E(!1), [m, f] = E("both"), g = ct(), y = (n == null ? void 0 : n.type) === "documentSection", N = !!(s != null && s.visualId || i != null && i.id), k = !!(s != null && s.visualId && o), V = N && !k, {
|
|
1598
|
+
saveAsDialogOpen: B,
|
|
1600
1599
|
setSaveAsDialogOpen: D,
|
|
1601
|
-
handleSaveAs:
|
|
1600
|
+
handleSaveAs: O,
|
|
1602
1601
|
isLibraryVisual: b,
|
|
1603
1602
|
currentVisualName: S,
|
|
1604
1603
|
isSaving: v
|
|
1605
|
-
} =
|
|
1604
|
+
} = us(), { getUpdatedFrame: T } = Pe();
|
|
1606
1605
|
if (a)
|
|
1607
|
-
return /* @__PURE__ */
|
|
1606
|
+
return /* @__PURE__ */ r(U, { children: [
|
|
1608
1607
|
/* @__PURE__ */ t(
|
|
1609
1608
|
gt,
|
|
1610
1609
|
{
|
|
@@ -1615,11 +1614,11 @@ function Ki(e = {}) {
|
|
|
1615
1614
|
/* @__PURE__ */ t(bt, {})
|
|
1616
1615
|
] });
|
|
1617
1616
|
if (y)
|
|
1618
|
-
return /* @__PURE__ */
|
|
1617
|
+
return /* @__PURE__ */ r(U, { children: [
|
|
1619
1618
|
/* @__PURE__ */ t(gt, { className: "rounded-control", variant: "default" }),
|
|
1620
1619
|
/* @__PURE__ */ t(bt, {})
|
|
1621
1620
|
] });
|
|
1622
|
-
const
|
|
1621
|
+
const F = async () => {
|
|
1623
1622
|
if (!l) {
|
|
1624
1623
|
M.error("No sheet selected");
|
|
1625
1624
|
return;
|
|
@@ -1631,30 +1630,30 @@ function Ki(e = {}) {
|
|
|
1631
1630
|
visualId: void 0
|
|
1632
1631
|
}, X = rt(u, Q.id);
|
|
1633
1632
|
try {
|
|
1634
|
-
const
|
|
1633
|
+
const _ = await g(Q, {
|
|
1635
1634
|
previousFrame: X
|
|
1636
1635
|
});
|
|
1637
1636
|
d(l, Q, {
|
|
1638
|
-
semanticExecutionPayload:
|
|
1637
|
+
semanticExecutionPayload: _
|
|
1639
1638
|
});
|
|
1640
|
-
} catch (
|
|
1641
|
-
console.error("Failed to apply local semantic metadata:",
|
|
1642
|
-
|
|
1639
|
+
} catch (_) {
|
|
1640
|
+
console.error("Failed to apply local semantic metadata:", _), p(!1), M.error(
|
|
1641
|
+
_ instanceof Error ? _.message : "Failed to prepare semantic metadata for this visual"
|
|
1643
1642
|
);
|
|
1644
1643
|
return;
|
|
1645
1644
|
}
|
|
1646
1645
|
setTimeout(() => {
|
|
1647
1646
|
p(!1), M.success("Changes applied. Visual is now local to this dashboard"), c(!1);
|
|
1648
1647
|
}, 300);
|
|
1649
|
-
}, H = (
|
|
1650
|
-
f(
|
|
1648
|
+
}, H = (P) => {
|
|
1649
|
+
f(P), D(!0);
|
|
1651
1650
|
};
|
|
1652
|
-
return /* @__PURE__ */
|
|
1653
|
-
/* @__PURE__ */
|
|
1651
|
+
return /* @__PURE__ */ r(U, { children: [
|
|
1652
|
+
/* @__PURE__ */ r("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
|
|
1654
1653
|
!N && /* @__PURE__ */ t(gt, { className: "!rounded-none", variant: "default" }),
|
|
1655
|
-
N && V && /* @__PURE__ */ t(
|
|
1656
|
-
N && k && /* @__PURE__ */ t(
|
|
1657
|
-
/* @__PURE__ */
|
|
1654
|
+
N && V && /* @__PURE__ */ t(ls, { className: "!rounded-none", variant: "default" }),
|
|
1655
|
+
N && k && /* @__PURE__ */ t(ds, { className: "!rounded-none" }),
|
|
1656
|
+
/* @__PURE__ */ r(je, { modal: !1, children: [
|
|
1658
1657
|
/* @__PURE__ */ t(qe, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1659
1658
|
L,
|
|
1660
1659
|
{
|
|
@@ -1663,30 +1662,30 @@ function Ki(e = {}) {
|
|
|
1663
1662
|
className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
|
|
1664
1663
|
"aria-label": "Open visual save options",
|
|
1665
1664
|
disabled: v || h,
|
|
1666
|
-
children: /* @__PURE__ */ t(
|
|
1665
|
+
children: /* @__PURE__ */ t(_t, { className: "h-3.5 w-3.5" })
|
|
1667
1666
|
}
|
|
1668
1667
|
) }),
|
|
1669
|
-
/* @__PURE__ */
|
|
1668
|
+
/* @__PURE__ */ r(
|
|
1670
1669
|
We,
|
|
1671
1670
|
{
|
|
1672
1671
|
align: "end",
|
|
1673
1672
|
className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
|
|
1674
1673
|
children: [
|
|
1675
|
-
k && /* @__PURE__ */
|
|
1676
|
-
/* @__PURE__ */
|
|
1674
|
+
k && /* @__PURE__ */ r(U, { children: [
|
|
1675
|
+
/* @__PURE__ */ r(
|
|
1677
1676
|
re,
|
|
1678
1677
|
{
|
|
1679
|
-
onClick:
|
|
1678
|
+
onClick: F,
|
|
1680
1679
|
disabled: h,
|
|
1681
1680
|
children: [
|
|
1682
|
-
/* @__PURE__ */ t(
|
|
1681
|
+
/* @__PURE__ */ t(Pt, { className: "h-3.5 w-3.5" }),
|
|
1683
1682
|
h ? "Applying..." : "Apply Locally"
|
|
1684
1683
|
]
|
|
1685
1684
|
}
|
|
1686
1685
|
),
|
|
1687
1686
|
/* @__PURE__ */ t(at, {})
|
|
1688
1687
|
] }),
|
|
1689
|
-
/* @__PURE__ */
|
|
1688
|
+
/* @__PURE__ */ r(
|
|
1690
1689
|
re,
|
|
1691
1690
|
{
|
|
1692
1691
|
onClick: () => H("local"),
|
|
@@ -1697,7 +1696,7 @@ function Ki(e = {}) {
|
|
|
1697
1696
|
]
|
|
1698
1697
|
}
|
|
1699
1698
|
),
|
|
1700
|
-
/* @__PURE__ */
|
|
1699
|
+
/* @__PURE__ */ r(
|
|
1701
1700
|
re,
|
|
1702
1701
|
{
|
|
1703
1702
|
onClick: () => H("library"),
|
|
@@ -1708,7 +1707,7 @@ function Ki(e = {}) {
|
|
|
1708
1707
|
]
|
|
1709
1708
|
}
|
|
1710
1709
|
),
|
|
1711
|
-
/* @__PURE__ */
|
|
1710
|
+
/* @__PURE__ */ r(
|
|
1712
1711
|
re,
|
|
1713
1712
|
{
|
|
1714
1713
|
onClick: () => H("both"),
|
|
@@ -1726,27 +1725,27 @@ function Ki(e = {}) {
|
|
|
1726
1725
|
] }),
|
|
1727
1726
|
/* @__PURE__ */ t(bt, {}),
|
|
1728
1727
|
/* @__PURE__ */ t(
|
|
1729
|
-
|
|
1728
|
+
cs,
|
|
1730
1729
|
{
|
|
1731
|
-
open:
|
|
1732
|
-
onOpenChange: (
|
|
1733
|
-
v || D(
|
|
1730
|
+
open: B,
|
|
1731
|
+
onOpenChange: (P) => {
|
|
1732
|
+
v || D(P);
|
|
1734
1733
|
},
|
|
1735
1734
|
isLibraryVisual: b,
|
|
1736
1735
|
currentVisualName: S,
|
|
1737
1736
|
isSaving: v,
|
|
1738
1737
|
destinationMode: m,
|
|
1739
|
-
onConfirm:
|
|
1738
|
+
onConfirm: O
|
|
1740
1739
|
}
|
|
1741
1740
|
)
|
|
1742
1741
|
] });
|
|
1743
1742
|
}
|
|
1744
|
-
function
|
|
1745
|
-
const a = oe((h) => h.isDevMode),
|
|
1746
|
-
if (!n || !l || !ar(
|
|
1743
|
+
function Qi({ className: e }) {
|
|
1744
|
+
const a = oe((h) => h.isDevMode), s = oe((h) => h.card.type), n = w((h) => h.isVisualEditing), { setIsDevMode: i } = dt(), { config: o } = Va(tn).tokenProps, l = (o == null ? void 0 : o.showAdvancedMode) !== !1;
|
|
1745
|
+
if (!n || !l || !ar(s))
|
|
1747
1746
|
return null;
|
|
1748
|
-
const u = a ?
|
|
1749
|
-
return /* @__PURE__ */
|
|
1747
|
+
const u = a ? Kr : Qr, c = a ? "Visual editor" : "SQL editor", d = a ? "Switch to visual editor" : "Switch to SQL editor";
|
|
1748
|
+
return /* @__PURE__ */ r(
|
|
1750
1749
|
"button",
|
|
1751
1750
|
{
|
|
1752
1751
|
type: "button",
|
|
@@ -1764,13 +1763,13 @@ function Hi({ className: e }) {
|
|
|
1764
1763
|
}
|
|
1765
1764
|
);
|
|
1766
1765
|
}
|
|
1767
|
-
function
|
|
1768
|
-
const e =
|
|
1766
|
+
function Ki() {
|
|
1767
|
+
const e = an() === "sm", a = w((c) => c.isDashboardEditing), s = w((c) => c.isVisualEditing), n = w((c) => {
|
|
1769
1768
|
var h;
|
|
1770
1769
|
const d = ((h = c.dashboard) == null ? void 0 : h.sheets) ?? [];
|
|
1771
1770
|
return d.find((p) => p.id === c.selectedSheetId) ?? d[0];
|
|
1772
1771
|
}), i = w((c) => c.actions.arrangeSheet), o = w((c) => c.actions.undoArrange);
|
|
1773
|
-
if (!a ||
|
|
1772
|
+
if (!a || s || !n || Ke(n)) return null;
|
|
1774
1773
|
const l = !(n.frames ?? []).length, u = (c) => {
|
|
1775
1774
|
const d = i(n.id, { keepOrder: c });
|
|
1776
1775
|
if (!d.ok) {
|
|
@@ -1790,8 +1789,8 @@ function Gi() {
|
|
|
1790
1789
|
}
|
|
1791
1790
|
});
|
|
1792
1791
|
};
|
|
1793
|
-
return /* @__PURE__ */
|
|
1794
|
-
/* @__PURE__ */
|
|
1792
|
+
return /* @__PURE__ */ r("div", { className: "inline-flex h-7 items-stretch overflow-hidden rounded-control border border-input bg-background", children: [
|
|
1793
|
+
/* @__PURE__ */ r(
|
|
1795
1794
|
L,
|
|
1796
1795
|
{
|
|
1797
1796
|
variant: "ghost",
|
|
@@ -1807,7 +1806,7 @@ function Gi() {
|
|
|
1807
1806
|
]
|
|
1808
1807
|
}
|
|
1809
1808
|
),
|
|
1810
|
-
/* @__PURE__ */
|
|
1809
|
+
/* @__PURE__ */ r(je, { modal: !1, children: [
|
|
1811
1810
|
/* @__PURE__ */ t(qe, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1812
1811
|
L,
|
|
1813
1812
|
{
|
|
@@ -1816,22 +1815,22 @@ function Gi() {
|
|
|
1816
1815
|
disabled: l,
|
|
1817
1816
|
className: "h-full w-7 rounded-none border-0 border-l border-border/60 px-0 shadow-none hover:bg-accent",
|
|
1818
1817
|
"aria-label": "Open arrange options",
|
|
1819
|
-
children: /* @__PURE__ */ t(
|
|
1818
|
+
children: /* @__PURE__ */ t(_t, { className: "h-3.5 w-3.5" })
|
|
1820
1819
|
}
|
|
1821
1820
|
) }),
|
|
1822
|
-
/* @__PURE__ */ t(We, { align: "end", className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm", children: /* @__PURE__ */
|
|
1821
|
+
/* @__PURE__ */ t(We, { align: "end", className: "z-[60] w-48 rounded-[6px] border-border/60 p-1 shadow-sm", children: /* @__PURE__ */ r(re, { onClick: () => u(!0), children: [
|
|
1823
1822
|
/* @__PURE__ */ t(Ue, { className: "h-3.5 w-3.5" }),
|
|
1824
1823
|
"Keep my order"
|
|
1825
1824
|
] }) })
|
|
1826
1825
|
] })
|
|
1827
1826
|
] });
|
|
1828
1827
|
}
|
|
1829
|
-
function
|
|
1828
|
+
function Hi() {
|
|
1830
1829
|
const e = w((i) => i.screenSizesOpen), a = w((i) => {
|
|
1831
1830
|
var u, c;
|
|
1832
1831
|
const o = ((u = i.dashboard) == null ? void 0 : u.sheets) ?? [], l = o.find((d) => d.id === i.selectedSheetId) ?? o[0];
|
|
1833
1832
|
return !!l && !Ke(l) && !!((c = l.frames) != null && c.length);
|
|
1834
|
-
}),
|
|
1833
|
+
}), s = w((i) => i.actions.setScreenSizesOpen), n = fa(
|
|
1835
1834
|
"screen-sizes",
|
|
1836
1835
|
"lg",
|
|
1837
1836
|
a ? {
|
|
@@ -1839,7 +1838,7 @@ function Yi() {
|
|
|
1839
1838
|
icon: /* @__PURE__ */ t(ta, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
1840
1839
|
checked: e,
|
|
1841
1840
|
order: 40,
|
|
1842
|
-
onSelect: () =>
|
|
1841
|
+
onSelect: () => s(!e)
|
|
1843
1842
|
} : void 0
|
|
1844
1843
|
);
|
|
1845
1844
|
return !a || n.collapsed ? null : /* @__PURE__ */ t(
|
|
@@ -1851,14 +1850,14 @@ function Yi() {
|
|
|
1851
1850
|
"aria-pressed": e,
|
|
1852
1851
|
"aria-label": "Screen sizes",
|
|
1853
1852
|
title: "Screen sizes",
|
|
1854
|
-
onClick: () =>
|
|
1853
|
+
onClick: () => s(!e),
|
|
1855
1854
|
className: "w-7 px-0",
|
|
1856
1855
|
children: /* @__PURE__ */ t(ta, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
|
|
1857
1856
|
}
|
|
1858
1857
|
);
|
|
1859
1858
|
}
|
|
1860
|
-
function
|
|
1861
|
-
const { openDashboardId: a, access:
|
|
1859
|
+
function Gi({ dashboardId: e }) {
|
|
1860
|
+
const { openDashboardId: a, access: s, printMode: n, serverIsFavorite: i, fetchedAt: o } = w(
|
|
1862
1861
|
nn((c) => {
|
|
1863
1862
|
var d;
|
|
1864
1863
|
return {
|
|
@@ -1870,52 +1869,22 @@ function Xi({ dashboardId: e }) {
|
|
|
1870
1869
|
};
|
|
1871
1870
|
})
|
|
1872
1871
|
), l = rn(), u = l.isFavorite(e, i, o);
|
|
1873
|
-
return a !== e || n ||
|
|
1872
|
+
return a !== e || n || s === "session-only" ? null : /* @__PURE__ */ t(
|
|
1874
1873
|
sn,
|
|
1875
1874
|
{
|
|
1876
1875
|
variant: "toolbar",
|
|
1877
1876
|
isFavorite: u,
|
|
1878
|
-
readOnly:
|
|
1877
|
+
readOnly: s === "read-only",
|
|
1879
1878
|
pending: l.isPending(e),
|
|
1880
1879
|
onToggle: () => void l.setFavorite({ dashboardId: e, isFavorite: !u })
|
|
1881
1880
|
}
|
|
1882
1881
|
);
|
|
1883
1882
|
}
|
|
1884
|
-
function
|
|
1885
|
-
width: e,
|
|
1886
|
-
hasOverflowMenu: a = !0,
|
|
1887
|
-
children: r
|
|
1888
|
-
}) {
|
|
1889
|
-
const [n, i] = A(
|
|
1890
|
-
() => /* @__PURE__ */ new Map()
|
|
1891
|
-
), [o, l] = A(null), [u, c] = A(null), d = ie((p) => (i((m) => new Map(m).set(p.id, p)), () => i((m) => {
|
|
1892
|
-
if (m.get(p.id) !== p) return m;
|
|
1893
|
-
const f = new Map(m);
|
|
1894
|
-
return f.delete(p.id), f;
|
|
1895
|
-
})), []), h = Y(
|
|
1896
|
-
() => ({
|
|
1897
|
-
width: e,
|
|
1898
|
-
hasOverflowMenu: a,
|
|
1899
|
-
overflowItems: [...n.values()].sort((p, m) => p.order - m.order),
|
|
1900
|
-
register: d,
|
|
1901
|
-
openOverflowId: o,
|
|
1902
|
-
setOpenOverflowId: l,
|
|
1903
|
-
anchorSlot: u,
|
|
1904
|
-
setAnchorSlot: c
|
|
1905
|
-
}),
|
|
1906
|
-
[u, a, n, o, d, e]
|
|
1907
|
-
);
|
|
1908
|
-
return /* @__PURE__ */ t(Aa.Provider, { value: h, children: r });
|
|
1909
|
-
}
|
|
1910
|
-
function Zi() {
|
|
1911
|
-
const { setAnchorSlot: e } = da(Aa);
|
|
1912
|
-
return /* @__PURE__ */ t("span", { ref: e, "aria-hidden": !0, className: "relative -mr-1.5 block h-7 w-0" });
|
|
1913
|
-
}
|
|
1914
|
-
function eo(e) {
|
|
1883
|
+
function Yi(e) {
|
|
1915
1884
|
var c;
|
|
1916
|
-
const { authToken: a, tokenProps:
|
|
1885
|
+
const { authToken: a, tokenProps: s } = $e(), { data: n } = on(), { mutate: i, isPending: o } = ln(), l = !!e && ((c = n == null ? void 0 : n.preference) == null ? void 0 : c.defaultDashboardId) === e, u = !n || o;
|
|
1917
1886
|
return {
|
|
1918
|
-
available: !!e && !!(a != null && a.accessToken) && !!(
|
|
1887
|
+
available: !!e && !!(a != null && a.accessToken) && !!(s != null && s.apiServiceUrl),
|
|
1919
1888
|
isDefault: l,
|
|
1920
1889
|
disabled: u,
|
|
1921
1890
|
toggle: () => {
|
|
@@ -1923,10 +1892,10 @@ function eo(e) {
|
|
|
1923
1892
|
}
|
|
1924
1893
|
};
|
|
1925
1894
|
}
|
|
1926
|
-
function
|
|
1895
|
+
function Xi({
|
|
1927
1896
|
open: e,
|
|
1928
1897
|
onOpenChange: a,
|
|
1929
|
-
onSave:
|
|
1898
|
+
onSave: s,
|
|
1930
1899
|
onDiscard: n,
|
|
1931
1900
|
isSaving: i,
|
|
1932
1901
|
title: o = "Unsaved changes",
|
|
@@ -1937,12 +1906,12 @@ function to({
|
|
|
1937
1906
|
}) {
|
|
1938
1907
|
return /* @__PURE__ */ t(wt, { open: e, onOpenChange: (p) => {
|
|
1939
1908
|
!p && i || a(p);
|
|
1940
|
-
}, children: /* @__PURE__ */
|
|
1941
|
-
/* @__PURE__ */
|
|
1909
|
+
}, children: /* @__PURE__ */ r(St, { children: [
|
|
1910
|
+
/* @__PURE__ */ r(kt, { children: [
|
|
1942
1911
|
/* @__PURE__ */ t(Dt, { children: o }),
|
|
1943
1912
|
/* @__PURE__ */ t(At, { children: l })
|
|
1944
1913
|
] }),
|
|
1945
|
-
/* @__PURE__ */
|
|
1914
|
+
/* @__PURE__ */ r(Ft, { children: [
|
|
1946
1915
|
/* @__PURE__ */ t(
|
|
1947
1916
|
L,
|
|
1948
1917
|
{
|
|
@@ -1956,19 +1925,19 @@ function to({
|
|
|
1956
1925
|
}
|
|
1957
1926
|
),
|
|
1958
1927
|
/* @__PURE__ */ t(Et, { disabled: i, children: u }),
|
|
1959
|
-
/* @__PURE__ */ t(L, { type: "button", size: "xs", onClick:
|
|
1928
|
+
/* @__PURE__ */ t(L, { type: "button", size: "xs", onClick: s, disabled: i, children: i ? /* @__PURE__ */ r(U, { children: [
|
|
1960
1929
|
/* @__PURE__ */ t(de, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
1961
1930
|
"Saving..."
|
|
1962
1931
|
] }) : d })
|
|
1963
1932
|
] })
|
|
1964
1933
|
] }) });
|
|
1965
1934
|
}
|
|
1966
|
-
async function
|
|
1935
|
+
async function Ji(e) {
|
|
1967
1936
|
var o, l;
|
|
1968
1937
|
const a = (l = (o = w.getState()) == null ? void 0 : o.authToken) == null ? void 0 : l.accessToken;
|
|
1969
1938
|
if (!a)
|
|
1970
1939
|
return;
|
|
1971
|
-
const
|
|
1940
|
+
const s = `${e}/v1/invalidate-token`, n = await fetch(s, {
|
|
1972
1941
|
method: "POST",
|
|
1973
1942
|
headers: {
|
|
1974
1943
|
Authorization: `Bearer ${a}`
|
|
@@ -1979,8 +1948,8 @@ async function ao(e) {
|
|
|
1979
1948
|
const i = await n.json();
|
|
1980
1949
|
return console.log("invalidateToken", i), i;
|
|
1981
1950
|
}
|
|
1982
|
-
function
|
|
1983
|
-
var
|
|
1951
|
+
function hs(e) {
|
|
1952
|
+
var s;
|
|
1984
1953
|
const a = e.item;
|
|
1985
1954
|
return a.kind === "export" ? {
|
|
1986
1955
|
title: a.title,
|
|
@@ -1992,7 +1961,7 @@ function ms(e) {
|
|
|
1992
1961
|
a.totalRows !== null ? `${a.totalRows.toLocaleString("en-US")} rows` : null,
|
|
1993
1962
|
a.fileSize ? pn(a.fileSize) : null
|
|
1994
1963
|
].filter((n) => !!n),
|
|
1995
|
-
failure: ((
|
|
1964
|
+
failure: ((s = a.failure) == null ? void 0 : s.kind) === "export" ? a.failure.message : a.status === "failed" ? Ce.failedFallback : null,
|
|
1996
1965
|
note: null
|
|
1997
1966
|
} : {
|
|
1998
1967
|
title: a.title,
|
|
@@ -2005,17 +1974,17 @@ function ms(e) {
|
|
|
2005
1974
|
note: a.omittedAttachmentCount > 0 ? ge.attachmentsLeftOut(a.omittedAttachmentCount) : null
|
|
2006
1975
|
};
|
|
2007
1976
|
}
|
|
2008
|
-
function na({ row: e, now: a, api:
|
|
2009
|
-
const [n, i] =
|
|
1977
|
+
function na({ row: e, now: a, api: s }) {
|
|
1978
|
+
const [n, i] = E("idle"), o = cn(e, s), l = async () => {
|
|
2010
1979
|
if (!o) return;
|
|
2011
1980
|
i("working");
|
|
2012
|
-
const u = await gn(
|
|
1981
|
+
const u = await gn(s, e, o);
|
|
2013
1982
|
i(u === "done" ? "idle" : u);
|
|
2014
1983
|
};
|
|
2015
1984
|
return /* @__PURE__ */ t(
|
|
2016
|
-
|
|
1985
|
+
Ea,
|
|
2017
1986
|
{
|
|
2018
|
-
shown:
|
|
1987
|
+
shown: hs(e),
|
|
2019
1988
|
now: a,
|
|
2020
1989
|
longRunningHint: e.item.kind === "export",
|
|
2021
1990
|
action: o ? { label: ga[o], run: () => void l() } : null,
|
|
@@ -2024,10 +1993,10 @@ function na({ row: e, now: a, api: r }) {
|
|
|
2024
1993
|
}
|
|
2025
1994
|
);
|
|
2026
1995
|
}
|
|
2027
|
-
function
|
|
2028
|
-
const
|
|
1996
|
+
function ms({ work: e, now: a }) {
|
|
1997
|
+
const s = e.stage === "preparing" ? e.cancel : null;
|
|
2029
1998
|
return /* @__PURE__ */ t(
|
|
2030
|
-
|
|
1999
|
+
Ea,
|
|
2031
2000
|
{
|
|
2032
2001
|
shown: {
|
|
2033
2002
|
title: e.title,
|
|
@@ -2041,26 +2010,26 @@ function ps({ work: e, now: a }) {
|
|
|
2041
2010
|
},
|
|
2042
2011
|
now: a,
|
|
2043
2012
|
longRunningHint: !1,
|
|
2044
|
-
action:
|
|
2013
|
+
action: s ? { label: ga.cancel, run: s } : null,
|
|
2045
2014
|
working: !1,
|
|
2046
2015
|
problem: null
|
|
2047
2016
|
}
|
|
2048
2017
|
);
|
|
2049
2018
|
}
|
|
2050
|
-
function
|
|
2019
|
+
function Ea({
|
|
2051
2020
|
shown: e,
|
|
2052
2021
|
now: a,
|
|
2053
|
-
longRunningHint:
|
|
2022
|
+
longRunningHint: s,
|
|
2054
2023
|
action: n,
|
|
2055
2024
|
working: i,
|
|
2056
2025
|
problem: o
|
|
2057
2026
|
}) {
|
|
2058
|
-
const l = e.status === "ready" ? "bg-emerald-500" : e.status === "failed" ? "bg-destructive" : e.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", u = e.status === "ready" ? Ce.ready : e.status === "failed" ? Ce.failed : e.status === "cancelled" ? Ce.cancelled : Ce.inProgress, c = Date.parse(e.startedAt), d = Gt(Date.parse(e.finishedAt ?? e.startedAt), a, { addSuffix: !0 }), h = e.status === "running" &&
|
|
2059
|
-
return /* @__PURE__ */
|
|
2027
|
+
const l = e.status === "ready" ? "bg-emerald-500" : e.status === "failed" ? "bg-destructive" : e.status === "cancelled" ? "bg-muted-foreground/40" : "animate-pulse bg-muted-foreground/60", u = e.status === "ready" ? Ce.ready : e.status === "failed" ? Ce.failed : e.status === "cancelled" ? Ce.cancelled : Ce.inProgress, c = Date.parse(e.startedAt), d = Gt(Date.parse(e.finishedAt ?? e.startedAt), a, { addSuffix: !0 }), h = e.status === "running" && s && a - c >= un, p = /* @__PURE__ */ t("span", { className: "text-muted-foreground/50", children: "·" });
|
|
2028
|
+
return /* @__PURE__ */ r("div", { className: "group flex items-start gap-2.5 px-3 py-2 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
|
|
2060
2029
|
/* @__PURE__ */ t("span", { className: "flex h-5 shrink-0 items-center", "aria-hidden": "true", children: /* @__PURE__ */ t("span", { className: `h-1.5 w-1.5 rounded-full ${l}` }) }),
|
|
2061
2030
|
/* @__PURE__ */ t("span", { className: "sr-only", children: u }),
|
|
2062
|
-
/* @__PURE__ */
|
|
2063
|
-
/* @__PURE__ */
|
|
2031
|
+
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
2032
|
+
/* @__PURE__ */ r("div", { className: "flex h-5 items-center gap-2", children: [
|
|
2064
2033
|
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-[13px] font-medium leading-5", children: e.title }),
|
|
2065
2034
|
n && i && /* @__PURE__ */ t("span", { role: "status", className: "inline-flex shrink-0 items-center gap-1.5 text-[12px] text-muted-foreground", children: /* @__PURE__ */ t(ba, { className: "h-3 w-3 animate-spin", strokeWidth: 1.75 }) }),
|
|
2066
2035
|
n && !i && /* @__PURE__ */ t(
|
|
@@ -2073,9 +2042,9 @@ function Ta({
|
|
|
2073
2042
|
}
|
|
2074
2043
|
)
|
|
2075
2044
|
] }),
|
|
2076
|
-
e.status === "running" && e.running && /* @__PURE__ */
|
|
2045
|
+
e.status === "running" && e.running && /* @__PURE__ */ r("div", { className: "text-[12px] leading-4 text-muted-foreground", children: [
|
|
2077
2046
|
/* @__PURE__ */ t("span", { className: "tabular-nums", children: e.running.text }),
|
|
2078
|
-
e.running.detail && /* @__PURE__ */
|
|
2047
|
+
e.running.detail && /* @__PURE__ */ r(U, { children: [
|
|
2079
2048
|
" ",
|
|
2080
2049
|
p,
|
|
2081
2050
|
" ",
|
|
@@ -2088,17 +2057,17 @@ function Ta({
|
|
|
2088
2057
|
e.running.percent !== void 0 && /* @__PURE__ */ t(hn, { value: e.running.percent, className: "mt-1.5 h-1" }),
|
|
2089
2058
|
h && /* @__PURE__ */ t("div", { className: "mt-1", children: Ce.longRunning })
|
|
2090
2059
|
] }),
|
|
2091
|
-
e.status !== "running" && /* @__PURE__ */
|
|
2060
|
+
e.status !== "running" && /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5 text-[12px] leading-4 text-muted-foreground", children: [
|
|
2092
2061
|
e.status === "ready" && e.finishedDetail.length > 0 ? (
|
|
2093
2062
|
// Disclosed on hover or focus only; the time is what a reader scans.
|
|
2094
|
-
/* @__PURE__ */
|
|
2095
|
-
e.finishedDetail.map((m, f) => /* @__PURE__ */
|
|
2063
|
+
/* @__PURE__ */ r("span", { className: "hidden group-hover:contents group-focus-within:contents", children: [
|
|
2064
|
+
e.finishedDetail.map((m, f) => /* @__PURE__ */ r(la.Fragment, { children: [
|
|
2096
2065
|
f > 0 && p,
|
|
2097
2066
|
/* @__PURE__ */ t("span", { children: m })
|
|
2098
2067
|
] }, f)),
|
|
2099
2068
|
p
|
|
2100
2069
|
] })
|
|
2101
|
-
) : e.status !== "ready" ? /* @__PURE__ */
|
|
2070
|
+
) : e.status !== "ready" ? /* @__PURE__ */ r(U, { children: [
|
|
2102
2071
|
/* @__PURE__ */ t("span", { children: u }),
|
|
2103
2072
|
p
|
|
2104
2073
|
] }) : null,
|
|
@@ -2110,23 +2079,23 @@ function Ta({
|
|
|
2110
2079
|
] })
|
|
2111
2080
|
] });
|
|
2112
2081
|
}
|
|
2113
|
-
function
|
|
2114
|
-
const { snapshot: a, markSeen:
|
|
2082
|
+
function Zi({ variant: e }) {
|
|
2083
|
+
const { snapshot: a, markSeen: s } = Lt(), n = a.runningCount > 0 ? a.runningCount > 9 ? "9+" : String(a.runningCount) : a.hasUnseenFinished ? "" : null, i = fa("activity", "md", {
|
|
2115
2084
|
label: ge.title,
|
|
2116
2085
|
icon: /* @__PURE__ */ t(ea, { className: "h-3.5 w-3.5" }),
|
|
2117
2086
|
hint: n || (n === "" ? "New" : void 0),
|
|
2118
2087
|
order: 30,
|
|
2119
|
-
onOpen:
|
|
2088
|
+
onOpen: s
|
|
2120
2089
|
});
|
|
2121
|
-
return i.collapsed ? /* @__PURE__ */
|
|
2090
|
+
return i.collapsed ? /* @__PURE__ */ r(
|
|
2122
2091
|
Ie,
|
|
2123
2092
|
{
|
|
2124
2093
|
open: i.popoverOpen,
|
|
2125
2094
|
onOpenChange: (o) => {
|
|
2126
|
-
i.setPopoverOpen(o), o &&
|
|
2095
|
+
i.setPopoverOpen(o), o && s();
|
|
2127
2096
|
},
|
|
2128
2097
|
children: [
|
|
2129
|
-
i.anchorSlot &&
|
|
2098
|
+
i.anchorSlot && Er(
|
|
2130
2099
|
/* @__PURE__ */ t(Na, { asChild: !0, children: /* @__PURE__ */ t("span", { className: "absolute right-0 top-0 h-7 w-px" }) }),
|
|
2131
2100
|
i.anchorSlot
|
|
2132
2101
|
),
|
|
@@ -2142,10 +2111,10 @@ function no({ variant: e }) {
|
|
|
2142
2111
|
)
|
|
2143
2112
|
]
|
|
2144
2113
|
}
|
|
2145
|
-
) : /* @__PURE__ */
|
|
2146
|
-
o &&
|
|
2114
|
+
) : /* @__PURE__ */ r(Ie, { onOpenChange: (o) => {
|
|
2115
|
+
o && s();
|
|
2147
2116
|
}, children: [
|
|
2148
|
-
/* @__PURE__ */ t(nt, { asChild: !0, children: /* @__PURE__ */
|
|
2117
|
+
/* @__PURE__ */ t(nt, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2149
2118
|
L,
|
|
2150
2119
|
{
|
|
2151
2120
|
variant: e ?? "ghost",
|
|
@@ -2169,19 +2138,19 @@ function no({ variant: e }) {
|
|
|
2169
2138
|
] });
|
|
2170
2139
|
}
|
|
2171
2140
|
function ra() {
|
|
2172
|
-
const e = Lt(), a = bn(), { rows:
|
|
2173
|
-
...
|
|
2141
|
+
const e = Lt(), a = bn(), { rows: s, browserRows: n, activeTruncated: i } = e.snapshot, o = s.some((d) => ft(d.item.status)), l = [
|
|
2142
|
+
...s.filter((d) => !ft(d.item.status)).map((d) => ({ startedAt: d.item.startedAt, row: d })),
|
|
2174
2143
|
...n.map((d) => ({ startedAt: d.startedAt, work: d }))
|
|
2175
|
-
].sort((d, h) => h.startedAt.localeCompare(d.startedAt)), u =
|
|
2176
|
-
return c === 0 ? /* @__PURE__ */
|
|
2144
|
+
].sort((d, h) => h.startedAt.localeCompare(d.startedAt)), u = s.filter((d) => ft(d.item.status)), c = s.length + n.length;
|
|
2145
|
+
return c === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-1.5 px-6 py-8 text-center", children: [
|
|
2177
2146
|
/* @__PURE__ */ t("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px] border border-border text-muted-foreground", children: /* @__PURE__ */ t(xn, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
|
|
2178
2147
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: ge.title }),
|
|
2179
2148
|
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: ge.empty })
|
|
2180
|
-
] }) : /* @__PURE__ */
|
|
2181
|
-
/* @__PURE__ */
|
|
2149
|
+
] }) : /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
2150
|
+
/* @__PURE__ */ r("div", { className: "flex h-8 items-center gap-2 border-b border-border px-3", children: [
|
|
2182
2151
|
/* @__PURE__ */ t("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: ge.title }),
|
|
2183
2152
|
/* @__PURE__ */ t("span", { className: "text-[10px] tabular-nums text-muted-foreground/70", children: c }),
|
|
2184
|
-
/* @__PURE__ */
|
|
2153
|
+
/* @__PURE__ */ r("div", { className: "ml-auto flex items-center gap-0.5", children: [
|
|
2185
2154
|
o && /* @__PURE__ */ t(
|
|
2186
2155
|
L,
|
|
2187
2156
|
{
|
|
@@ -2207,13 +2176,13 @@ function ra() {
|
|
|
2207
2176
|
] })
|
|
2208
2177
|
] }),
|
|
2209
2178
|
i && /* @__PURE__ */ t("p", { className: "border-b border-border px-3 py-2 text-[12px] leading-4 text-muted-foreground", children: ge.truncated }),
|
|
2210
|
-
/* @__PURE__ */ t("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */
|
|
2211
|
-
l.map((d) => "work" in d ? /* @__PURE__ */ t(
|
|
2179
|
+
/* @__PURE__ */ t("div", { className: "max-h-[320px] overflow-y-auto", children: /* @__PURE__ */ r("div", { className: "divide-y divide-border/70", children: [
|
|
2180
|
+
l.map((d) => "work" in d ? /* @__PURE__ */ t(ms, { work: d.work, now: a }, d.work.id) : /* @__PURE__ */ t(na, { row: d.row, now: a, api: e }, $t(d.row))),
|
|
2212
2181
|
u.map((d) => /* @__PURE__ */ t(na, { row: d, now: a, api: e }, $t(d)))
|
|
2213
2182
|
] }) })
|
|
2214
2183
|
] });
|
|
2215
2184
|
}
|
|
2216
|
-
function
|
|
2185
|
+
function ps(e) {
|
|
2217
2186
|
if (e)
|
|
2218
2187
|
return {
|
|
2219
2188
|
renamed: e.type === "rename" ? { oldId: e.oldId, newId: e.newId } : void 0,
|
|
@@ -2222,10 +2191,10 @@ function fs(e) {
|
|
|
2222
2191
|
affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
|
|
2223
2192
|
};
|
|
2224
2193
|
}
|
|
2225
|
-
function
|
|
2194
|
+
function fs({
|
|
2226
2195
|
open: e,
|
|
2227
2196
|
onOpenChange: a,
|
|
2228
|
-
trigger:
|
|
2197
|
+
trigger: s,
|
|
2229
2198
|
showTrigger: n = !0,
|
|
2230
2199
|
initialMode: i = "manage"
|
|
2231
2200
|
}) {
|
|
@@ -2247,16 +2216,16 @@ function gs({
|
|
|
2247
2216
|
// create and make consumers use `forceClose()` from a dedicated
|
|
2248
2217
|
// button.
|
|
2249
2218
|
dismissMode: n ? "passive" : "explicit-only"
|
|
2250
|
-
}), m = w((v) => v.dashboard), { setDashboardControlsModel: f } = ve(), { participants: g } = vn(
|
|
2219
|
+
}), m = w((v) => v.dashboard), { setDashboardControlsModel: f } = ve(), { participants: g } = vn(Tr(m)), y = Array.from(
|
|
2251
2220
|
new Map(
|
|
2252
2221
|
g.flatMap(
|
|
2253
2222
|
(v) => v.fieldChoices.map((T) => {
|
|
2254
|
-
var
|
|
2223
|
+
var F;
|
|
2255
2224
|
return [
|
|
2256
2225
|
T.value,
|
|
2257
2226
|
{
|
|
2258
2227
|
option: T,
|
|
2259
|
-
target: (
|
|
2228
|
+
target: (F = v.fieldTargetMap) == null ? void 0 : F[T.value]
|
|
2260
2229
|
}
|
|
2261
2230
|
];
|
|
2262
2231
|
})
|
|
@@ -2266,12 +2235,12 @@ function gs({
|
|
|
2266
2235
|
new Map(
|
|
2267
2236
|
g.flatMap(
|
|
2268
2237
|
(v) => v.metricChoices.map((T) => {
|
|
2269
|
-
var
|
|
2238
|
+
var F;
|
|
2270
2239
|
return [
|
|
2271
2240
|
T.value,
|
|
2272
2241
|
{
|
|
2273
2242
|
option: T,
|
|
2274
|
-
target: (
|
|
2243
|
+
target: (F = v.metricTargetMap) == null ? void 0 : F[T.value]
|
|
2275
2244
|
}
|
|
2276
2245
|
];
|
|
2277
2246
|
})
|
|
@@ -2280,11 +2249,11 @@ function gs({
|
|
|
2280
2249
|
), k = nr({
|
|
2281
2250
|
...m || {},
|
|
2282
2251
|
controls: []
|
|
2283
|
-
}), V = yn(m),
|
|
2252
|
+
}), V = yn(m), B = (v, T, F) => {
|
|
2284
2253
|
f(
|
|
2285
2254
|
v,
|
|
2286
2255
|
T,
|
|
2287
|
-
|
|
2256
|
+
ps(F)
|
|
2288
2257
|
);
|
|
2289
2258
|
}, D = ie(() => {
|
|
2290
2259
|
if (o) {
|
|
@@ -2292,7 +2261,7 @@ function gs({
|
|
|
2292
2261
|
return;
|
|
2293
2262
|
}
|
|
2294
2263
|
p(!1);
|
|
2295
|
-
}, [o, l, p]),
|
|
2264
|
+
}, [o, l, p]), O = /* @__PURE__ */ t(
|
|
2296
2265
|
ka,
|
|
2297
2266
|
{
|
|
2298
2267
|
scope: "dashboard",
|
|
@@ -2307,18 +2276,18 @@ function gs({
|
|
|
2307
2276
|
initialCreateFlow: i === "create",
|
|
2308
2277
|
onCreateFlowActiveChange: p,
|
|
2309
2278
|
onCreateFlowComplete: D,
|
|
2310
|
-
onChange:
|
|
2279
|
+
onChange: B,
|
|
2311
2280
|
emptyMessage: "No dashboard controls yet."
|
|
2312
2281
|
}
|
|
2313
|
-
), b = c ? "Add dashboard control" : "Dashboard Controls", S = /* @__PURE__ */
|
|
2314
|
-
/* @__PURE__ */
|
|
2282
|
+
), b = c ? "Add dashboard control" : "Dashboard Controls", S = /* @__PURE__ */ r(U, { children: [
|
|
2283
|
+
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
2315
2284
|
/* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
2316
2285
|
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
|
|
2317
2286
|
] }),
|
|
2318
|
-
|
|
2287
|
+
O
|
|
2319
2288
|
] });
|
|
2320
|
-
return n ? /* @__PURE__ */
|
|
2321
|
-
/* @__PURE__ */ t(nt, { asChild: !0, children:
|
|
2289
|
+
return n ? /* @__PURE__ */ r(Ie, { open: h, onOpenChange: u, children: [
|
|
2290
|
+
/* @__PURE__ */ t(nt, { asChild: !0, children: s || /* @__PURE__ */ r(L, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
2322
2291
|
/* @__PURE__ */ t(Ca, { className: "mr-2 h-4 w-4" }),
|
|
2323
2292
|
"Controls"
|
|
2324
2293
|
] }) }),
|
|
@@ -2332,19 +2301,19 @@ function gs({
|
|
|
2332
2301
|
children: S
|
|
2333
2302
|
}
|
|
2334
2303
|
)
|
|
2335
|
-
] }) : /* @__PURE__ */ t(Le, { open: h, onOpenChange: u, children: /* @__PURE__ */
|
|
2304
|
+
] }) : /* @__PURE__ */ t(Le, { open: h, onOpenChange: u, children: /* @__PURE__ */ r(
|
|
2336
2305
|
Ve,
|
|
2337
2306
|
{
|
|
2338
2307
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
2339
2308
|
onEscapeKeyDown: d,
|
|
2340
2309
|
onPointerDownOutside: d,
|
|
2341
2310
|
children: [
|
|
2342
|
-
/* @__PURE__ */
|
|
2311
|
+
/* @__PURE__ */ r(
|
|
2343
2312
|
Tt,
|
|
2344
2313
|
{
|
|
2345
2314
|
className: c ? "space-y-0" : void 0,
|
|
2346
2315
|
children: [
|
|
2347
|
-
/* @__PURE__ */ t(
|
|
2316
|
+
/* @__PURE__ */ t(Be, { className: "text-[15px]", children: b }),
|
|
2348
2317
|
/* @__PURE__ */ t(
|
|
2349
2318
|
ut,
|
|
2350
2319
|
{
|
|
@@ -2355,12 +2324,12 @@ function gs({
|
|
|
2355
2324
|
]
|
|
2356
2325
|
}
|
|
2357
2326
|
),
|
|
2358
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children:
|
|
2327
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: O })
|
|
2359
2328
|
]
|
|
2360
2329
|
}
|
|
2361
2330
|
) });
|
|
2362
2331
|
}
|
|
2363
|
-
const
|
|
2332
|
+
const gs = [
|
|
2364
2333
|
"enum",
|
|
2365
2334
|
"multi_enum",
|
|
2366
2335
|
"text",
|
|
@@ -2368,13 +2337,13 @@ const bs = [
|
|
|
2368
2337
|
"boolean",
|
|
2369
2338
|
"date"
|
|
2370
2339
|
];
|
|
2371
|
-
function
|
|
2340
|
+
function bs({
|
|
2372
2341
|
open: e,
|
|
2373
2342
|
onOpenChange: a,
|
|
2374
|
-
initialMode:
|
|
2343
|
+
initialMode: s = "manage"
|
|
2375
2344
|
}) {
|
|
2376
2345
|
var S;
|
|
2377
|
-
const n =
|
|
2346
|
+
const n = s === "create", {
|
|
2378
2347
|
forceClose: i,
|
|
2379
2348
|
handleOpenChange: o,
|
|
2380
2349
|
isCreateFlowActive: l,
|
|
@@ -2384,7 +2353,7 @@ function xs({
|
|
|
2384
2353
|
} = Sa({
|
|
2385
2354
|
open: e,
|
|
2386
2355
|
onOpenChange: a,
|
|
2387
|
-
initialCreateFlowActive:
|
|
2356
|
+
initialCreateFlowActive: s === "create",
|
|
2388
2357
|
dismissMode: "explicit-only"
|
|
2389
2358
|
}), h = w((v) => v.dashboard), p = w((v) => v.selectedSheetId), { setDashboardInputs: m } = ve(), f = (S = h.sheets) == null ? void 0 : S.find(
|
|
2390
2359
|
(v) => v.id === p
|
|
@@ -2400,11 +2369,11 @@ function xs({
|
|
|
2400
2369
|
() => N.map((v) => v.control),
|
|
2401
2370
|
[N]
|
|
2402
2371
|
), V = Y(
|
|
2403
|
-
() =>
|
|
2372
|
+
() => vs(k),
|
|
2404
2373
|
[k]
|
|
2405
|
-
),
|
|
2374
|
+
), B = Y(
|
|
2406
2375
|
() => [
|
|
2407
|
-
...
|
|
2376
|
+
...xs(h),
|
|
2408
2377
|
...(h.variables ?? []).map((v) => v.name)
|
|
2409
2378
|
],
|
|
2410
2379
|
[h]
|
|
@@ -2414,16 +2383,16 @@ function xs({
|
|
|
2414
2383
|
return;
|
|
2415
2384
|
}
|
|
2416
2385
|
d(!1);
|
|
2417
|
-
}, [n, i, d]),
|
|
2418
|
-
(v, T,
|
|
2386
|
+
}, [n, i, d]), O = ie(
|
|
2387
|
+
(v, T, F) => {
|
|
2419
2388
|
!g || !(f != null && f.document) || m(
|
|
2420
|
-
|
|
2389
|
+
Ns({
|
|
2421
2390
|
dashboard: h,
|
|
2422
2391
|
documentSheetId: f.id,
|
|
2423
2392
|
currentDocumentInputs: y,
|
|
2424
2393
|
nextControls: v,
|
|
2425
2394
|
nextDefaultValues: T,
|
|
2426
|
-
change:
|
|
2395
|
+
change: F
|
|
2427
2396
|
})
|
|
2428
2397
|
);
|
|
2429
2398
|
},
|
|
@@ -2435,15 +2404,15 @@ function xs({
|
|
|
2435
2404
|
m
|
|
2436
2405
|
]
|
|
2437
2406
|
);
|
|
2438
|
-
return !g || !(f != null && f.document) ? null : /* @__PURE__ */ t(Le, { open: c, onOpenChange: o, children: /* @__PURE__ */
|
|
2407
|
+
return !g || !(f != null && f.document) ? null : /* @__PURE__ */ t(Le, { open: c, onOpenChange: o, children: /* @__PURE__ */ r(
|
|
2439
2408
|
Ve,
|
|
2440
2409
|
{
|
|
2441
2410
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
2442
2411
|
onEscapeKeyDown: u,
|
|
2443
2412
|
onPointerDownOutside: u,
|
|
2444
2413
|
children: [
|
|
2445
|
-
/* @__PURE__ */
|
|
2446
|
-
/* @__PURE__ */ t(
|
|
2414
|
+
/* @__PURE__ */ r(Tt, { className: l ? "space-y-0" : void 0, children: [
|
|
2415
|
+
/* @__PURE__ */ t(Be, { className: "text-[15px]", children: l ? "Add document control" : "Document Controls" }),
|
|
2447
2416
|
/* @__PURE__ */ t(
|
|
2448
2417
|
ut,
|
|
2449
2418
|
{
|
|
@@ -2457,18 +2426,18 @@ function xs({
|
|
|
2457
2426
|
{
|
|
2458
2427
|
scope: "dashboard",
|
|
2459
2428
|
controls: k,
|
|
2460
|
-
reservedControlIds:
|
|
2429
|
+
reservedControlIds: B,
|
|
2461
2430
|
defaultValues: V,
|
|
2462
2431
|
usageByControlId: {},
|
|
2463
2432
|
availableFieldChoices: [],
|
|
2464
2433
|
availableMetricChoices: [],
|
|
2465
2434
|
structuralParticipants: [],
|
|
2466
2435
|
structuralParticipantIdsByControlId: {},
|
|
2467
|
-
allowedControlTypes:
|
|
2468
|
-
initialCreateFlow:
|
|
2436
|
+
allowedControlTypes: gs,
|
|
2437
|
+
initialCreateFlow: s === "create",
|
|
2469
2438
|
onCreateFlowActiveChange: d,
|
|
2470
2439
|
onCreateFlowComplete: D,
|
|
2471
|
-
onChange:
|
|
2440
|
+
onChange: O,
|
|
2472
2441
|
emptyMessage: "No document controls yet."
|
|
2473
2442
|
}
|
|
2474
2443
|
) })
|
|
@@ -2476,25 +2445,25 @@ function xs({
|
|
|
2476
2445
|
}
|
|
2477
2446
|
) });
|
|
2478
2447
|
}
|
|
2479
|
-
function
|
|
2448
|
+
function xs(e) {
|
|
2480
2449
|
return (e.controls || []).map((a) => a.id);
|
|
2481
2450
|
}
|
|
2482
|
-
function
|
|
2451
|
+
function vs(e) {
|
|
2483
2452
|
const a = {};
|
|
2484
|
-
for (const
|
|
2485
|
-
|
|
2453
|
+
for (const s of e)
|
|
2454
|
+
s.defaultValue !== void 0 && (a[s.id] = s.defaultValue);
|
|
2486
2455
|
return a;
|
|
2487
2456
|
}
|
|
2488
|
-
function
|
|
2457
|
+
function ys(e, a) {
|
|
2489
2458
|
return a ? Object.prototype.hasOwnProperty.call(a, e.id) ? {
|
|
2490
2459
|
...e,
|
|
2491
2460
|
defaultValue: a[e.id]
|
|
2492
2461
|
} : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 } : e.defaultValue === void 0 ? e : { ...e, defaultValue: void 0 };
|
|
2493
2462
|
}
|
|
2494
|
-
function
|
|
2463
|
+
function Ns({
|
|
2495
2464
|
dashboard: e,
|
|
2496
2465
|
documentSheetId: a,
|
|
2497
|
-
currentDocumentInputs:
|
|
2466
|
+
currentDocumentInputs: s,
|
|
2498
2467
|
nextControls: n,
|
|
2499
2468
|
nextDefaultValues: i,
|
|
2500
2469
|
change: o
|
|
@@ -2502,10 +2471,10 @@ function Cs({
|
|
|
2502
2471
|
const l = new Map(
|
|
2503
2472
|
n.map((f) => [
|
|
2504
2473
|
f.id,
|
|
2505
|
-
|
|
2474
|
+
ys(f, i)
|
|
2506
2475
|
])
|
|
2507
2476
|
), u = (o == null ? void 0 : o.type) === "rename" ? { oldId: o.oldId, newId: o.newId } : null, c = /* @__PURE__ */ new Set(), d = [];
|
|
2508
|
-
for (const f of
|
|
2477
|
+
for (const f of s) {
|
|
2509
2478
|
if (f.kind !== "control") {
|
|
2510
2479
|
d.push(f);
|
|
2511
2480
|
continue;
|
|
@@ -2537,16 +2506,16 @@ function Cs({
|
|
|
2537
2506
|
})
|
|
2538
2507
|
);
|
|
2539
2508
|
const h = new Set(
|
|
2540
|
-
|
|
2509
|
+
s.map((f) => f.id)
|
|
2541
2510
|
);
|
|
2542
2511
|
return [...(Array.isArray(e.inputs) ? e.inputs : []).filter(
|
|
2543
2512
|
(f) => !h.has(f.id)
|
|
2544
2513
|
), ...d];
|
|
2545
2514
|
}
|
|
2546
|
-
function
|
|
2515
|
+
function Cs({
|
|
2547
2516
|
showFilters: e,
|
|
2548
2517
|
onShowFiltersChange: a,
|
|
2549
|
-
pickerContent:
|
|
2518
|
+
pickerContent: s,
|
|
2550
2519
|
settingsContent: n,
|
|
2551
2520
|
size: i = "default",
|
|
2552
2521
|
className: o,
|
|
@@ -2555,8 +2524,8 @@ function ws({
|
|
|
2555
2524
|
pickerContentClassName: c,
|
|
2556
2525
|
settingsContentClassName: d
|
|
2557
2526
|
}) {
|
|
2558
|
-
const h = i === "toolbar", [p, m] =
|
|
2559
|
-
return /* @__PURE__ */
|
|
2527
|
+
const h = i === "toolbar", [p, m] = E(!1), f = it("interactive");
|
|
2528
|
+
return /* @__PURE__ */ r(
|
|
2560
2529
|
"div",
|
|
2561
2530
|
{
|
|
2562
2531
|
className: J(
|
|
@@ -2568,8 +2537,8 @@ function ws({
|
|
|
2568
2537
|
o
|
|
2569
2538
|
),
|
|
2570
2539
|
children: [
|
|
2571
|
-
/* @__PURE__ */
|
|
2572
|
-
/* @__PURE__ */ t(nt, { asChild: !0, children: /* @__PURE__ */
|
|
2540
|
+
/* @__PURE__ */ r(Ie, { open: e, onOpenChange: a, children: [
|
|
2541
|
+
/* @__PURE__ */ t(nt, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2573
2542
|
L,
|
|
2574
2543
|
{
|
|
2575
2544
|
variant: "ghost",
|
|
@@ -2594,11 +2563,11 @@ function ws({
|
|
|
2594
2563
|
c
|
|
2595
2564
|
),
|
|
2596
2565
|
style: f.contentStyle,
|
|
2597
|
-
children:
|
|
2566
|
+
children: s
|
|
2598
2567
|
}
|
|
2599
2568
|
)
|
|
2600
2569
|
] }),
|
|
2601
|
-
/* @__PURE__ */
|
|
2570
|
+
/* @__PURE__ */ r(Ie, { open: p, onOpenChange: m, children: [
|
|
2602
2571
|
/* @__PURE__ */ t(nt, { asChild: !0, children: /* @__PURE__ */ t(
|
|
2603
2572
|
L,
|
|
2604
2573
|
{
|
|
@@ -2609,7 +2578,7 @@ function ws({
|
|
|
2609
2578
|
u
|
|
2610
2579
|
),
|
|
2611
2580
|
"aria-label": "Filter and control actions",
|
|
2612
|
-
children: /* @__PURE__ */ t(
|
|
2581
|
+
children: /* @__PURE__ */ t(_t, { className: "h-3.5 w-3.5" })
|
|
2613
2582
|
}
|
|
2614
2583
|
) }),
|
|
2615
2584
|
/* @__PURE__ */ t(
|
|
@@ -2630,54 +2599,54 @@ function ws({
|
|
|
2630
2599
|
}
|
|
2631
2600
|
);
|
|
2632
2601
|
}
|
|
2633
|
-
function
|
|
2602
|
+
function ws() {
|
|
2634
2603
|
Dr();
|
|
2635
|
-
const e = w((c) => c.selectedSheetId), a = w((c) => c.selectedFrameId),
|
|
2604
|
+
const e = w((c) => c.selectedSheetId), a = w((c) => c.selectedFrameId), s = w((c) => c.dashboard), n = w((c) => c.actions.getSelectedFrame), { setSelectedFrameId: i } = ve(), { setCard: o } = dt(), l = oe((c) => c.card.dataSource);
|
|
2636
2605
|
return Ee(() => {
|
|
2637
2606
|
var d, h;
|
|
2638
2607
|
let c = n();
|
|
2639
2608
|
if (!c) {
|
|
2640
|
-
const p = (d =
|
|
2609
|
+
const p = (d = s == null ? void 0 : s.sheets) == null ? void 0 : d.find((f) => f.id === e), m = (h = p == null ? void 0 : p.frames) == null ? void 0 : h[0];
|
|
2641
2610
|
m && (i(m.id), c = m);
|
|
2642
2611
|
}
|
|
2643
2612
|
if (c) {
|
|
2644
2613
|
const p = c.cards.find((m) => m.id === c.activeCardId);
|
|
2645
2614
|
p && o(p);
|
|
2646
2615
|
}
|
|
2647
|
-
}, [n, e, a,
|
|
2616
|
+
}, [n, e, a, s, i, o]), {
|
|
2648
2617
|
hasEntities: !!(l != null && l.selectedEntities && l.selectedEntities.length > 0)
|
|
2649
2618
|
};
|
|
2650
2619
|
}
|
|
2651
|
-
function
|
|
2620
|
+
function Ss() {
|
|
2652
2621
|
const e = w((c) => c.dashboard), a = w(
|
|
2653
2622
|
(c) => c.semanticExecutionPayload
|
|
2654
|
-
),
|
|
2623
|
+
), s = w(
|
|
2655
2624
|
(c) => c.actions.addFilterInput
|
|
2656
|
-
), { hasEntities: n } =
|
|
2625
|
+
), { hasEntities: n } = ws(), { isLoading: i } = Cn(), o = Y(
|
|
2657
2626
|
() => or(e, a),
|
|
2658
2627
|
[e, a]
|
|
2659
2628
|
), u = !lr(e) && o.hasEligibleCards && !i;
|
|
2660
|
-
return /* @__PURE__ */
|
|
2661
|
-
u && /* @__PURE__ */ t("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */
|
|
2629
|
+
return /* @__PURE__ */ r("div", { className: "flex h-[520px] w-[400px] flex-col", children: [
|
|
2630
|
+
u && /* @__PURE__ */ t("div", { className: "border-b border-border/60 p-2", children: /* @__PURE__ */ r(
|
|
2662
2631
|
"button",
|
|
2663
2632
|
{
|
|
2664
2633
|
type: "button",
|
|
2665
|
-
onClick: () =>
|
|
2634
|
+
onClick: () => s(dr(), {
|
|
2666
2635
|
kind: "allSheets",
|
|
2667
2636
|
sheetKinds: ["dashboard"]
|
|
2668
2637
|
}),
|
|
2669
2638
|
title: `Applies to ${o.eligibleCardCount} of ${o.totalCardCount} date-aware cards`,
|
|
2670
2639
|
className: "flex w-full items-start gap-2 rounded-control px-2 py-1.5 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border",
|
|
2671
2640
|
children: [
|
|
2672
|
-
/* @__PURE__ */ t(
|
|
2673
|
-
/* @__PURE__ */
|
|
2641
|
+
/* @__PURE__ */ t(Wr, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
2642
|
+
/* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col", children: [
|
|
2674
2643
|
/* @__PURE__ */ t("span", { className: "text-[12px] font-medium text-foreground", children: "Add global date filter" }),
|
|
2675
2644
|
/* @__PURE__ */ t("span", { className: "text-[11px] leading-[1.4] text-muted-foreground", children: "One date range across all date-aware cards." })
|
|
2676
2645
|
] })
|
|
2677
2646
|
]
|
|
2678
2647
|
}
|
|
2679
2648
|
) }),
|
|
2680
|
-
!n && /* @__PURE__ */
|
|
2649
|
+
!n && /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center px-6 py-8 text-center", children: [
|
|
2681
2650
|
/* @__PURE__ */ t(wn, { className: "mb-3 h-10 w-10 text-muted-foreground/50" }),
|
|
2682
2651
|
/* @__PURE__ */ t("h3", { className: "mb-1 text-[13px] font-medium text-foreground", children: "No fields configured" }),
|
|
2683
2652
|
/* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: "Configure a data source for this card to enable filtering." })
|
|
@@ -2685,17 +2654,17 @@ function ks() {
|
|
|
2685
2654
|
n && /* @__PURE__ */ t("div", { className: "flex flex-1 overflow-hidden", children: /* @__PURE__ */ t(Sn, { context: "filter" }) })
|
|
2686
2655
|
] });
|
|
2687
2656
|
}
|
|
2688
|
-
function
|
|
2657
|
+
function ks({
|
|
2689
2658
|
onAddFilter: e,
|
|
2690
2659
|
onAddControl: a,
|
|
2691
|
-
onManageControls:
|
|
2660
|
+
onManageControls: s,
|
|
2692
2661
|
onDismiss: n
|
|
2693
2662
|
}) {
|
|
2694
2663
|
const i = w(
|
|
2695
2664
|
(u) => u.dashboard.filterLayout
|
|
2696
2665
|
), { setFilterLayout: o } = ve(), l = (i == null ? void 0 : i.toolbarWrap) ?? !1;
|
|
2697
|
-
return /* @__PURE__ */
|
|
2698
|
-
/* @__PURE__ */
|
|
2666
|
+
return /* @__PURE__ */ r("div", { className: "w-[300px]", children: [
|
|
2667
|
+
/* @__PURE__ */ r("div", { className: "p-1", children: [
|
|
2699
2668
|
/* @__PURE__ */ t(
|
|
2700
2669
|
xt,
|
|
2701
2670
|
{
|
|
@@ -2722,16 +2691,16 @@ function Ds({
|
|
|
2722
2691
|
icon: Vt,
|
|
2723
2692
|
label: "Manage controls",
|
|
2724
2693
|
onClick: () => {
|
|
2725
|
-
|
|
2694
|
+
s(), n();
|
|
2726
2695
|
}
|
|
2727
2696
|
}
|
|
2728
2697
|
)
|
|
2729
2698
|
] }),
|
|
2730
2699
|
/* @__PURE__ */ t("div", { className: "border-t border-border/60" }),
|
|
2731
|
-
/* @__PURE__ */
|
|
2700
|
+
/* @__PURE__ */ r("div", { className: "space-y-1 p-2", children: [
|
|
2732
2701
|
/* @__PURE__ */ t("p", { className: "px-1 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Display" }),
|
|
2733
2702
|
/* @__PURE__ */ t(
|
|
2734
|
-
|
|
2703
|
+
Ds,
|
|
2735
2704
|
{
|
|
2736
2705
|
id: "filter-display-wrap",
|
|
2737
2706
|
label: "Wrap to multiple lines",
|
|
@@ -2745,13 +2714,13 @@ function Ds({
|
|
|
2745
2714
|
function xt({
|
|
2746
2715
|
icon: e,
|
|
2747
2716
|
label: a,
|
|
2748
|
-
onClick:
|
|
2717
|
+
onClick: s
|
|
2749
2718
|
}) {
|
|
2750
|
-
return /* @__PURE__ */
|
|
2719
|
+
return /* @__PURE__ */ r(
|
|
2751
2720
|
"button",
|
|
2752
2721
|
{
|
|
2753
2722
|
type: "button",
|
|
2754
|
-
onClick:
|
|
2723
|
+
onClick: s,
|
|
2755
2724
|
className: "flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-[13px] text-foreground outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40",
|
|
2756
2725
|
children: [
|
|
2757
2726
|
/* @__PURE__ */ t(e, { className: "h-3.5 w-3.5 text-muted-foreground" }),
|
|
@@ -2760,16 +2729,16 @@ function xt({
|
|
|
2760
2729
|
}
|
|
2761
2730
|
);
|
|
2762
2731
|
}
|
|
2763
|
-
function
|
|
2732
|
+
function Ds({
|
|
2764
2733
|
id: e,
|
|
2765
2734
|
label: a,
|
|
2766
|
-
checked:
|
|
2735
|
+
checked: s,
|
|
2767
2736
|
onCheckedChange: n
|
|
2768
2737
|
}) {
|
|
2769
|
-
return /* @__PURE__ */
|
|
2770
|
-
/* @__PURE__ */ t(It, { id: e, checked:
|
|
2738
|
+
return /* @__PURE__ */ r("div", { className: "flex items-center gap-2 rounded-control px-1 py-1 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
|
|
2739
|
+
/* @__PURE__ */ t(It, { id: e, checked: s, onCheckedChange: n }),
|
|
2771
2740
|
/* @__PURE__ */ t(
|
|
2772
|
-
|
|
2741
|
+
Re,
|
|
2773
2742
|
{
|
|
2774
2743
|
htmlFor: e,
|
|
2775
2744
|
className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
|
|
@@ -2778,16 +2747,16 @@ function As({
|
|
|
2778
2747
|
)
|
|
2779
2748
|
] });
|
|
2780
2749
|
}
|
|
2781
|
-
function
|
|
2750
|
+
function eo({
|
|
2782
2751
|
size: e,
|
|
2783
2752
|
className: a,
|
|
2784
|
-
primaryButtonClassName:
|
|
2753
|
+
primaryButtonClassName: s,
|
|
2785
2754
|
secondaryButtonClassName: n,
|
|
2786
2755
|
pickerContentClassName: i,
|
|
2787
2756
|
settingsContentClassName: o
|
|
2788
2757
|
}) {
|
|
2789
|
-
var
|
|
2790
|
-
const [l, u] =
|
|
2758
|
+
var O;
|
|
2759
|
+
const [l, u] = E(null), c = w((b) => b.dashboard), d = w((b) => b.selectedSheetId), h = w((b) => b.showFilters), p = w((b) => b.actions), { setDocumentPanelTarget: m, setShowFilters: f } = p, g = (O = c.sheets) == null ? void 0 : O.find(
|
|
2791
2760
|
(b) => b.id === d
|
|
2792
2761
|
), y = Ke(g), N = ie((b) => {
|
|
2793
2762
|
window.setTimeout(() => {
|
|
@@ -2812,37 +2781,37 @@ function ro({
|
|
|
2812
2781
|
]
|
|
2813
2782
|
), V = ie(() => {
|
|
2814
2783
|
k(!0);
|
|
2815
|
-
}, [k]),
|
|
2784
|
+
}, [k]), B = ie(() => {
|
|
2816
2785
|
N("create");
|
|
2817
2786
|
}, [N]), D = ie(() => {
|
|
2818
2787
|
N("manage");
|
|
2819
2788
|
}, [N]);
|
|
2820
|
-
return /* @__PURE__ */
|
|
2789
|
+
return /* @__PURE__ */ r(U, { children: [
|
|
2821
2790
|
/* @__PURE__ */ t(
|
|
2822
|
-
|
|
2791
|
+
Cs,
|
|
2823
2792
|
{
|
|
2824
2793
|
showFilters: y ? !1 : h,
|
|
2825
2794
|
onShowFiltersChange: k,
|
|
2826
|
-
pickerContent: /* @__PURE__ */ t(
|
|
2795
|
+
pickerContent: /* @__PURE__ */ t(Ss, {}),
|
|
2827
2796
|
settingsContent: (b) => /* @__PURE__ */ t(
|
|
2828
|
-
|
|
2797
|
+
ks,
|
|
2829
2798
|
{
|
|
2830
2799
|
onAddFilter: V,
|
|
2831
|
-
onAddControl:
|
|
2800
|
+
onAddControl: B,
|
|
2832
2801
|
onManageControls: D,
|
|
2833
2802
|
onDismiss: b
|
|
2834
2803
|
}
|
|
2835
2804
|
),
|
|
2836
2805
|
size: e,
|
|
2837
2806
|
className: a,
|
|
2838
|
-
primaryButtonClassName:
|
|
2807
|
+
primaryButtonClassName: s,
|
|
2839
2808
|
secondaryButtonClassName: n,
|
|
2840
2809
|
pickerContentClassName: i,
|
|
2841
2810
|
settingsContentClassName: o
|
|
2842
2811
|
}
|
|
2843
2812
|
),
|
|
2844
2813
|
l ? y ? /* @__PURE__ */ t(
|
|
2845
|
-
|
|
2814
|
+
bs,
|
|
2846
2815
|
{
|
|
2847
2816
|
open: !0,
|
|
2848
2817
|
onOpenChange: (b) => {
|
|
@@ -2851,7 +2820,7 @@ function ro({
|
|
|
2851
2820
|
initialMode: l
|
|
2852
2821
|
}
|
|
2853
2822
|
) : /* @__PURE__ */ t(
|
|
2854
|
-
|
|
2823
|
+
fs,
|
|
2855
2824
|
{
|
|
2856
2825
|
open: !0,
|
|
2857
2826
|
onOpenChange: (b) => {
|
|
@@ -2863,46 +2832,46 @@ function ro({
|
|
|
2863
2832
|
) : null
|
|
2864
2833
|
] });
|
|
2865
2834
|
}
|
|
2866
|
-
function
|
|
2867
|
-
return (e.variables ?? []).map((
|
|
2868
|
-
const n =
|
|
2835
|
+
function As(e, a) {
|
|
2836
|
+
return (e.variables ?? []).map((s) => {
|
|
2837
|
+
const n = Lr(e, s.id);
|
|
2869
2838
|
return {
|
|
2870
|
-
variable:
|
|
2871
|
-
question:
|
|
2839
|
+
variable: s,
|
|
2840
|
+
question: Pr(s),
|
|
2872
2841
|
places: n,
|
|
2873
2842
|
usedHere: !!a && n.some((i) => i.sheetId === a)
|
|
2874
2843
|
};
|
|
2875
2844
|
});
|
|
2876
2845
|
}
|
|
2877
|
-
function
|
|
2878
|
-
const
|
|
2879
|
-
return e.places.length ?
|
|
2846
|
+
function Fs(e, a) {
|
|
2847
|
+
const s = a ? e.places.filter((i) => i.sheetId === a).length : 0, n = e.places.length - s;
|
|
2848
|
+
return e.places.length ? s && n ? `Used here · ${n} elsewhere` : s ? "Used here" : `Used in ${n} ${n === 1 ? "place" : "places"}` : "Not used yet";
|
|
2880
2849
|
}
|
|
2881
|
-
function
|
|
2850
|
+
function Es({
|
|
2882
2851
|
dashboard: e,
|
|
2883
2852
|
sheetId: a,
|
|
2884
|
-
sheetTitle:
|
|
2853
|
+
sheetTitle: s,
|
|
2885
2854
|
onOpen: n,
|
|
2886
2855
|
onNew: i
|
|
2887
2856
|
}) {
|
|
2888
|
-
const [o, l] =
|
|
2857
|
+
const [o, l] = E(""), u = Y(() => As(e, a), [e, a]), c = o.trim().toLowerCase(), d = u.filter(
|
|
2889
2858
|
(m) => !c || m.variable.name.toLowerCase().includes(c) || (m.variable.label ?? "").toLowerCase().includes(c) || m.question.toLowerCase().includes(c)
|
|
2890
2859
|
), h = d.filter((m) => m.usedHere), p = d.filter((m) => !m.usedHere);
|
|
2891
|
-
return /* @__PURE__ */
|
|
2892
|
-
/* @__PURE__ */
|
|
2893
|
-
/* @__PURE__ */
|
|
2860
|
+
return /* @__PURE__ */ r("div", { className: "w-[380px] max-w-[calc(100vw-24px)] overflow-hidden", "data-testid": "variables-list", children: [
|
|
2861
|
+
/* @__PURE__ */ r("div", { className: "flex h-11 items-center justify-between gap-2 border-b border-border/60 px-3", children: [
|
|
2862
|
+
/* @__PURE__ */ r("span", { className: "flex items-center gap-2", children: [
|
|
2894
2863
|
/* @__PURE__ */ t(Nt, { className: "h-3.5 w-3.5 text-muted-foreground", "aria-hidden": !0 }),
|
|
2895
2864
|
/* @__PURE__ */ t("span", { className: "text-[13px] font-medium", children: "Data variables" }),
|
|
2896
2865
|
u.length ? /* @__PURE__ */ t("span", { className: "rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium tabular-nums text-muted-foreground", children: u.length }) : null
|
|
2897
2866
|
] }),
|
|
2898
|
-
u.length ? /* @__PURE__ */
|
|
2867
|
+
u.length ? /* @__PURE__ */ r(L, { size: "xs", className: "gap-1", onClick: i, children: [
|
|
2899
2868
|
/* @__PURE__ */ t(be, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
2900
2869
|
" New variable"
|
|
2901
2870
|
] }) : null
|
|
2902
2871
|
] }),
|
|
2903
|
-
u.length ? /* @__PURE__ */
|
|
2904
|
-
/* @__PURE__ */ t("div", { className: "px-3 py-2", children: /* @__PURE__ */
|
|
2905
|
-
/* @__PURE__ */ t(
|
|
2872
|
+
u.length ? /* @__PURE__ */ r(U, { children: [
|
|
2873
|
+
/* @__PURE__ */ t("div", { className: "px-3 py-2", children: /* @__PURE__ */ r("div", { className: "flex h-7 items-center gap-1.5 rounded-control border border-border px-2 text-[12px] text-muted-foreground", children: [
|
|
2874
|
+
/* @__PURE__ */ t(da, { className: "h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
|
|
2906
2875
|
/* @__PURE__ */ t(
|
|
2907
2876
|
"input",
|
|
2908
2877
|
{
|
|
@@ -2914,18 +2883,18 @@ function Is({
|
|
|
2914
2883
|
}
|
|
2915
2884
|
)
|
|
2916
2885
|
] }) }),
|
|
2917
|
-
/* @__PURE__ */
|
|
2918
|
-
h.length ? /* @__PURE__ */ t(sa, { children:
|
|
2886
|
+
/* @__PURE__ */ r("div", { className: "max-h-[360px] overflow-y-auto", children: [
|
|
2887
|
+
h.length ? /* @__PURE__ */ t(sa, { children: s ? `On ${s}` : "On this tab" }) : null,
|
|
2919
2888
|
h.map((m) => /* @__PURE__ */ t(ia, { row: m, sheetId: a, onOpen: n }, m.variable.id)),
|
|
2920
2889
|
p.length ? /* @__PURE__ */ t(sa, { children: h.length ? "Elsewhere on this dashboard" : "On this dashboard" }) : null,
|
|
2921
2890
|
p.map((m) => /* @__PURE__ */ t(ia, { row: m, sheetId: a, onOpen: n, muted: !!h.length }, m.variable.id)),
|
|
2922
2891
|
d.length ? null : /* @__PURE__ */ t("p", { className: "px-4 py-6 text-center text-[12px] text-muted-foreground", children: "No variable matches." })
|
|
2923
2892
|
] })
|
|
2924
|
-
] }) : /* @__PURE__ */
|
|
2893
|
+
] }) : /* @__PURE__ */ r("div", { className: "px-6 py-8 text-center", children: [
|
|
2925
2894
|
/* @__PURE__ */ t("span", { className: "mx-auto flex h-8 w-8 items-center justify-center rounded-full bg-muted", children: /* @__PURE__ */ t(Nt, { className: "h-4 w-4 text-muted-foreground", "aria-hidden": !0 }) }),
|
|
2926
2895
|
/* @__PURE__ */ t("p", { className: "mt-3 text-[13px] font-medium", children: "No variables yet" }),
|
|
2927
2896
|
/* @__PURE__ */ t("p", { className: "mx-auto mt-1 max-w-[280px] text-[12px] leading-[1.5] text-muted-foreground", children: "A variable shows a value from your data in any text: a name or address in a header, the latest date in a footer." }),
|
|
2928
|
-
/* @__PURE__ */
|
|
2897
|
+
/* @__PURE__ */ r(L, { size: "xs", className: "mt-4 gap-1", onClick: i, children: [
|
|
2929
2898
|
/* @__PURE__ */ t(be, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
2930
2899
|
" New variable"
|
|
2931
2900
|
] })
|
|
@@ -2938,38 +2907,38 @@ function sa({ children: e }) {
|
|
|
2938
2907
|
function ia({
|
|
2939
2908
|
row: e,
|
|
2940
2909
|
sheetId: a,
|
|
2941
|
-
onOpen:
|
|
2910
|
+
onOpen: s,
|
|
2942
2911
|
muted: n
|
|
2943
2912
|
}) {
|
|
2944
|
-
return /* @__PURE__ */
|
|
2913
|
+
return /* @__PURE__ */ r(
|
|
2945
2914
|
"button",
|
|
2946
2915
|
{
|
|
2947
2916
|
type: "button",
|
|
2948
|
-
onClick: () =>
|
|
2917
|
+
onClick: () => s(e.variable.id),
|
|
2949
2918
|
className: "grid w-full grid-cols-[minmax(0,1fr)_132px] items-center gap-3 border-t border-border/60 px-4 py-2 text-left first:border-t-0 hover:bg-muted/50",
|
|
2950
2919
|
children: [
|
|
2951
|
-
/* @__PURE__ */
|
|
2920
|
+
/* @__PURE__ */ r("span", { className: "min-w-0", children: [
|
|
2952
2921
|
/* @__PURE__ */ t("span", { className: J("block truncate text-[12px] font-medium text-foreground", !e.variable.label && "font-mono"), children: e.variable.label || e.variable.name }),
|
|
2953
2922
|
/* @__PURE__ */ t("span", { className: "mt-0.5 block truncate text-[11px] text-muted-foreground", children: e.question })
|
|
2954
2923
|
] }),
|
|
2955
|
-
/* @__PURE__ */ t("span", { className: J("truncate text-right text-[11px]", n ? "text-muted-foreground/70" : "text-muted-foreground"), children:
|
|
2924
|
+
/* @__PURE__ */ t("span", { className: J("truncate text-right text-[11px]", n ? "text-muted-foreground/70" : "text-muted-foreground"), children: Fs(e, a) })
|
|
2956
2925
|
]
|
|
2957
2926
|
}
|
|
2958
2927
|
);
|
|
2959
2928
|
}
|
|
2960
|
-
function
|
|
2961
|
-
const e = w((
|
|
2929
|
+
function to() {
|
|
2930
|
+
const e = w((s) => {
|
|
2962
2931
|
var n;
|
|
2963
|
-
return ((n =
|
|
2964
|
-
}), a = w((
|
|
2932
|
+
return ((n = s.dashboard.variables) == null ? void 0 : n.length) ?? 0;
|
|
2933
|
+
}), a = w((s) => s.actions.setVariablesListOpen);
|
|
2965
2934
|
return { label: "Data variables", count: e, open: () => a(!0) };
|
|
2966
2935
|
}
|
|
2967
|
-
function
|
|
2936
|
+
function ao() {
|
|
2968
2937
|
var c;
|
|
2969
|
-
const e = w((d) => d.variablesListOpen), a = w((d) => d.actions.setVariablesListOpen),
|
|
2938
|
+
const e = w((d) => d.variablesListOpen), a = w((d) => d.actions.setVariablesListOpen), s = w((d) => d.dashboard), n = w((d) => d.selectedSheetId), i = w((d) => d.actions.openVariableEditor), o = it("interactive"), l = (c = s.sheets) == null ? void 0 : c.find((d) => d.id === n), u = (d) => {
|
|
2970
2939
|
a(!1), i(d);
|
|
2971
2940
|
};
|
|
2972
|
-
return /* @__PURE__ */
|
|
2941
|
+
return /* @__PURE__ */ r(Ie, { open: e, onOpenChange: a, children: [
|
|
2973
2942
|
/* @__PURE__ */ t(Na, { asChild: !0, children: /* @__PURE__ */ t("span", { "aria-hidden": !0, className: "pointer-events-none inline-block h-7 w-0 self-center" }) }),
|
|
2974
2943
|
/* @__PURE__ */ t(
|
|
2975
2944
|
Te,
|
|
@@ -2981,9 +2950,9 @@ function io() {
|
|
|
2981
2950
|
className: "z-50 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)]",
|
|
2982
2951
|
style: o.contentStyle,
|
|
2983
2952
|
children: /* @__PURE__ */ t(
|
|
2984
|
-
|
|
2953
|
+
Es,
|
|
2985
2954
|
{
|
|
2986
|
-
dashboard:
|
|
2955
|
+
dashboard: s,
|
|
2987
2956
|
sheetId: n ?? void 0,
|
|
2988
2957
|
sheetTitle: l == null ? void 0 : l.title,
|
|
2989
2958
|
onOpen: (d) => u({ kind: "edit", variableId: d }),
|
|
@@ -2994,32 +2963,32 @@ function io() {
|
|
|
2994
2963
|
)
|
|
2995
2964
|
] });
|
|
2996
2965
|
}
|
|
2997
|
-
function
|
|
2998
|
-
const
|
|
2966
|
+
function Is(e, a) {
|
|
2967
|
+
const s = cr(e);
|
|
2999
2968
|
return new Set(
|
|
3000
2969
|
(e.sheets ?? []).map((i) => {
|
|
3001
2970
|
const o = { sheetId: i.id, cardId: a, sheetKind: Ke(i) ? "document" : "dashboard" };
|
|
3002
|
-
return
|
|
2971
|
+
return s.filter((l) => Vr(l, o)).map((l) => l.runtimeScope === "shared" ? l.id : `${l.id}@${i.id}`).join(`
|
|
3003
2972
|
`);
|
|
3004
2973
|
})
|
|
3005
2974
|
).size > 1;
|
|
3006
2975
|
}
|
|
3007
|
-
const
|
|
2976
|
+
const Ts = [];
|
|
3008
2977
|
function vt(e) {
|
|
3009
2978
|
return Object.fromEntries(
|
|
3010
2979
|
Object.entries(e).filter(([, a]) => a != null)
|
|
3011
2980
|
);
|
|
3012
2981
|
}
|
|
3013
|
-
function
|
|
2982
|
+
function Ls(e) {
|
|
3014
2983
|
const a = e == null ? void 0 : e.type;
|
|
3015
2984
|
return a === "dataset" || a === "model" || hr.includes(a);
|
|
3016
2985
|
}
|
|
3017
|
-
function
|
|
2986
|
+
function Vs(e, a) {
|
|
3018
2987
|
return _r(
|
|
3019
|
-
e.map((
|
|
2988
|
+
e.map((s, n) => {
|
|
3020
2989
|
var i, o;
|
|
3021
2990
|
return {
|
|
3022
|
-
target:
|
|
2991
|
+
target: s,
|
|
3023
2992
|
columns: (i = a[n]) == null ? void 0 : i.columns,
|
|
3024
2993
|
calculatedFields: (o = a[n]) == null ? void 0 : o.calculatedFields
|
|
3025
2994
|
};
|
|
@@ -3027,12 +2996,12 @@ function Ps(e, a) {
|
|
|
3027
2996
|
).columns;
|
|
3028
2997
|
}
|
|
3029
2998
|
function Bs(e) {
|
|
3030
|
-
const { tokenProps: a } = $e(),
|
|
3031
|
-
() => ((e == null ? void 0 : e.selectedEntities) ?? []).filter(
|
|
2999
|
+
const { tokenProps: a } = $e(), s = w((m) => m.authToken), { connections: n } = va(), i = e == null ? void 0 : e.connectionId, o = n.find((m) => m.id === i), l = Y(
|
|
3000
|
+
() => ((e == null ? void 0 : e.selectedEntities) ?? []).filter(Ls),
|
|
3032
3001
|
[e == null ? void 0 : e.selectedEntities]
|
|
3033
3002
|
), u = (m) => {
|
|
3034
3003
|
var g;
|
|
3035
|
-
if (!(
|
|
3004
|
+
if (!(s != null && s.accessToken)) return !1;
|
|
3036
3005
|
if (m.type === "dataset") {
|
|
3037
3006
|
const y = m;
|
|
3038
3007
|
return !!(y.domainId && y.name);
|
|
@@ -3043,12 +3012,12 @@ function Bs(e) {
|
|
|
3043
3012
|
}, c = ie(
|
|
3044
3013
|
(m) => {
|
|
3045
3014
|
var g, y;
|
|
3046
|
-
const f =
|
|
3015
|
+
const f = Vs(
|
|
3047
3016
|
l,
|
|
3048
3017
|
m.map((N) => N.data)
|
|
3049
3018
|
);
|
|
3050
3019
|
return {
|
|
3051
|
-
fields: f.length ? f :
|
|
3020
|
+
fields: f.length ? f : Ts,
|
|
3052
3021
|
isLoading: m.some((N) => N.isLoading),
|
|
3053
3022
|
error: (y = (g = m.find((N) => N.error)) == null ? void 0 : g.error) == null ? void 0 : y.message
|
|
3054
3023
|
};
|
|
@@ -3059,7 +3028,7 @@ function Bs(e) {
|
|
|
3059
3028
|
queryKey: ["columns", i, m, (e == null ? void 0 : e.semanticDomainId) ?? null],
|
|
3060
3029
|
queryFn: () => ur(
|
|
3061
3030
|
`${a.apiServiceUrl}/v1/columns`,
|
|
3062
|
-
(
|
|
3031
|
+
(s == null ? void 0 : s.accessToken) || "",
|
|
3063
3032
|
m.type === "model" ? vt({
|
|
3064
3033
|
connection_id: i,
|
|
3065
3034
|
datamodel_id: m.id,
|
|
@@ -3088,15 +3057,15 @@ function Bs(e) {
|
|
|
3088
3057
|
});
|
|
3089
3058
|
return { fields: d, isLoading: h, error: p };
|
|
3090
3059
|
}
|
|
3091
|
-
function
|
|
3092
|
-
var
|
|
3093
|
-
const a = ((
|
|
3060
|
+
function Ps(e) {
|
|
3061
|
+
var s;
|
|
3062
|
+
const a = ((s = e.comparison) == null ? void 0 : s.mode) === "explicit" ? e.comparison.spec : void 0;
|
|
3094
3063
|
return a && a.kind !== "target" ? { mode: "period", spec: a } : { mode: "off" };
|
|
3095
3064
|
}
|
|
3096
3065
|
function _s(e) {
|
|
3097
3066
|
return e.mode === "period" ? pr(e.spec) : void 0;
|
|
3098
3067
|
}
|
|
3099
|
-
const
|
|
3068
|
+
const Rt = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", Os = {
|
|
3100
3069
|
connectionId: "",
|
|
3101
3070
|
connectionType: "",
|
|
3102
3071
|
mode: "semanticDomain",
|
|
@@ -3105,14 +3074,14 @@ const zt = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreg
|
|
|
3105
3074
|
function se({
|
|
3106
3075
|
label: e,
|
|
3107
3076
|
hint: a,
|
|
3108
|
-
aside:
|
|
3077
|
+
aside: s,
|
|
3109
3078
|
children: n,
|
|
3110
3079
|
className: i
|
|
3111
3080
|
}) {
|
|
3112
|
-
return /* @__PURE__ */
|
|
3113
|
-
/* @__PURE__ */
|
|
3114
|
-
/* @__PURE__ */ t("p", { className:
|
|
3115
|
-
|
|
3081
|
+
return /* @__PURE__ */ r("div", { className: i, children: [
|
|
3082
|
+
/* @__PURE__ */ r("div", { className: "mb-1 flex min-h-5 items-center justify-between gap-2", children: [
|
|
3083
|
+
/* @__PURE__ */ t("p", { className: Rt, children: e }),
|
|
3084
|
+
s
|
|
3116
3085
|
] }),
|
|
3117
3086
|
n,
|
|
3118
3087
|
a ? /* @__PURE__ */ t("p", { className: "mt-1 text-[11px] leading-4 text-muted-foreground", children: a }) : null
|
|
@@ -3121,7 +3090,7 @@ function se({
|
|
|
3121
3090
|
function yt({
|
|
3122
3091
|
muted: e,
|
|
3123
3092
|
onClick: a,
|
|
3124
|
-
children:
|
|
3093
|
+
children: s,
|
|
3125
3094
|
ariaLabel: n
|
|
3126
3095
|
}) {
|
|
3127
3096
|
return /* @__PURE__ */ t(
|
|
@@ -3134,49 +3103,49 @@ function yt({
|
|
|
3134
3103
|
"flex h-7 w-full items-center gap-1.5 rounded-control border border-input bg-background px-2 text-left text-[12px] hover:bg-muted/50",
|
|
3135
3104
|
e ? "text-muted-foreground" : "text-foreground"
|
|
3136
3105
|
),
|
|
3137
|
-
children:
|
|
3106
|
+
children: s
|
|
3138
3107
|
}
|
|
3139
3108
|
);
|
|
3140
3109
|
}
|
|
3141
|
-
function
|
|
3142
|
-
var
|
|
3143
|
-
const a = (
|
|
3110
|
+
function Ms(e) {
|
|
3111
|
+
var s;
|
|
3112
|
+
const a = (s = e == null ? void 0 : e.selectedEntities) == null ? void 0 : s[0];
|
|
3144
3113
|
if (a)
|
|
3145
3114
|
return a.label || a.name;
|
|
3146
3115
|
}
|
|
3147
3116
|
function zs(e) {
|
|
3148
|
-
const a =
|
|
3117
|
+
const a = Ot(e);
|
|
3149
3118
|
return a === "date" ? "date" : a === "string" ? "text" : a === "number" ? "number" : a === "boolean" ? "yes/no" : a;
|
|
3150
3119
|
}
|
|
3151
3120
|
const oa = "__new_calculated_field__";
|
|
3152
|
-
function
|
|
3121
|
+
function Rs({
|
|
3153
3122
|
draft: e,
|
|
3154
3123
|
onChange: a,
|
|
3155
|
-
handle:
|
|
3124
|
+
handle: s,
|
|
3156
3125
|
onCalculatedFieldOpenChange: n
|
|
3157
3126
|
}) {
|
|
3158
|
-
var
|
|
3159
|
-
const { tokenProps: i } = $e(), o = ((
|
|
3127
|
+
var _, te, Z, G, I, ae, j, z, ne, ue, he, ye;
|
|
3128
|
+
const { tokenProps: i } = $e(), o = ((_ = i.config) == null ? void 0 : _.showAdvancedMode) !== !1, l = ((te = i.config) == null ? void 0 : te.showDirectSource) !== !1, { connections: u } = va(), [c, d] = E(!1), [h, p] = E(!1), [m, f] = E(!1), g = (x) => {
|
|
3160
3129
|
p(x), n == null || n(x);
|
|
3161
|
-
}, { fields: y, isLoading: N, error: k } = Bs(e.mode === "data" ? e.dataSource : void 0), V = [...e.calculatedFields ?? [], ...y],
|
|
3130
|
+
}, { fields: y, isLoading: N, error: k } = Bs(e.mode === "data" ? e.dataSource : void 0), V = [...e.calculatedFields ?? [], ...y], B = (x) => x && (V.find((R) => R.id === x.id) ?? V.find((R) => Us(R, x))), D = [
|
|
3162
3131
|
...V,
|
|
3163
3132
|
...[e.field, e.sortField].filter(
|
|
3164
|
-
(x) => !!x && !
|
|
3133
|
+
(x) => !!x && !B(x) && !V.some((R) => R.id === x.id)
|
|
3165
3134
|
)
|
|
3166
|
-
],
|
|
3167
|
-
connectionId: ((
|
|
3135
|
+
], O = ((Z = B(e.field)) == null ? void 0 : Z.id) ?? ((G = e.field) == null ? void 0 : G.id) ?? "", b = ((I = B(e.sortField ?? e.field)) == null ? void 0 : I.id) ?? ((ae = e.sortField ?? e.field) == null ? void 0 : ae.id) ?? "", S = (x) => a({ ...e, ...x }), v = Ms(e.dataSource), T = ((j = e.dataSource) == null ? void 0 : j.mode) === "database" ? Bt : jt, F = "mt-1 inline-flex items-center gap-1 text-[11px] font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline", H = {
|
|
3136
|
+
connectionId: ((z = e.dataSource) == null ? void 0 : z.connectionId) || e.connectionId,
|
|
3168
3137
|
dataSource: e.dataSource,
|
|
3169
3138
|
config: e.conditions ? { filters: e.conditions } : {},
|
|
3170
3139
|
cardType: "text"
|
|
3171
|
-
},
|
|
3140
|
+
}, P = Yt(e.field), Q = (ne = P.find((x) => x.value === e.get)) == null ? void 0 : ne.hint, X = (x) => {
|
|
3172
3141
|
if (x === oa) {
|
|
3173
3142
|
g(!0);
|
|
3174
3143
|
return;
|
|
3175
3144
|
}
|
|
3176
|
-
const
|
|
3177
|
-
if (!
|
|
3178
|
-
const $ = Yt(
|
|
3179
|
-
S({ field:
|
|
3145
|
+
const R = D.find((K) => K.id === x);
|
|
3146
|
+
if (!R) return;
|
|
3147
|
+
const $ = Yt(R).some((K) => K.value === e.get) && e.field !== void 0;
|
|
3148
|
+
S({ field: R, get: $ ? e.get : Xt(R) });
|
|
3180
3149
|
};
|
|
3181
3150
|
return h ? /* @__PURE__ */ t(
|
|
3182
3151
|
Dn,
|
|
@@ -3188,20 +3157,20 @@ function Us({
|
|
|
3188
3157
|
cardId: e.id,
|
|
3189
3158
|
source: H,
|
|
3190
3159
|
onSave: (x) => {
|
|
3191
|
-
const
|
|
3160
|
+
const R = { ...x, fieldScope: x.fieldScope ?? "card" };
|
|
3192
3161
|
S({
|
|
3193
|
-
calculatedFields: [...(e.calculatedFields ?? []).filter(($) => $.id !==
|
|
3194
|
-
field:
|
|
3195
|
-
get: Xt(
|
|
3162
|
+
calculatedFields: [...(e.calculatedFields ?? []).filter(($) => $.id !== R.id), R],
|
|
3163
|
+
field: R,
|
|
3164
|
+
get: Xt(R)
|
|
3196
3165
|
}), g(!1);
|
|
3197
3166
|
}
|
|
3198
3167
|
}
|
|
3199
|
-
) : /* @__PURE__ */
|
|
3168
|
+
) : /* @__PURE__ */ r(U, { children: [
|
|
3200
3169
|
/* @__PURE__ */ t(
|
|
3201
3170
|
se,
|
|
3202
3171
|
{
|
|
3203
3172
|
label: "Name",
|
|
3204
|
-
aside: /* @__PURE__ */ t(
|
|
3173
|
+
aside: /* @__PURE__ */ t(js, { value: e.name, placeholder: s, editing: m, onEditing: f, onChange: (x) => S({ name: x }) }),
|
|
3205
3174
|
hint: m ? "The key: what you type after {{, and what links and agents use. Letters, digits and underscores." : void 0,
|
|
3206
3175
|
children: /* @__PURE__ */ t(
|
|
3207
3176
|
xe,
|
|
@@ -3215,9 +3184,9 @@ function Us({
|
|
|
3215
3184
|
)
|
|
3216
3185
|
}
|
|
3217
3186
|
),
|
|
3218
|
-
e.mode === "sql" ? /* @__PURE__ */
|
|
3219
|
-
/* @__PURE__ */
|
|
3220
|
-
/* @__PURE__ */
|
|
3187
|
+
e.mode === "sql" ? /* @__PURE__ */ r(U, { children: [
|
|
3188
|
+
/* @__PURE__ */ r(se, { label: "Connection", children: [
|
|
3189
|
+
/* @__PURE__ */ r(
|
|
3221
3190
|
Se,
|
|
3222
3191
|
{
|
|
3223
3192
|
value: e.connectionId ?? "",
|
|
@@ -3228,7 +3197,7 @@ function Us({
|
|
|
3228
3197
|
]
|
|
3229
3198
|
}
|
|
3230
3199
|
),
|
|
3231
|
-
/* @__PURE__ */
|
|
3200
|
+
/* @__PURE__ */ r("button", { type: "button", onClick: () => S({ mode: "data" }), className: F, children: [
|
|
3232
3201
|
/* @__PURE__ */ t(jt, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
3233
3202
|
" Use a dataset or table instead"
|
|
3234
3203
|
] })
|
|
@@ -3239,7 +3208,7 @@ function Us({
|
|
|
3239
3208
|
label: "SQL",
|
|
3240
3209
|
hint: /* @__PURE__ */ t(U, { children: "One row. Each column is a part; the first shows by default. Filters reach it where the SQL names them, as a SQL card's do." }),
|
|
3241
3210
|
children: /* @__PURE__ */ t(
|
|
3242
|
-
|
|
3211
|
+
pa,
|
|
3243
3212
|
{
|
|
3244
3213
|
size: "xs",
|
|
3245
3214
|
value: e.sql,
|
|
@@ -3251,32 +3220,32 @@ function Us({
|
|
|
3251
3220
|
)
|
|
3252
3221
|
}
|
|
3253
3222
|
),
|
|
3254
|
-
/* @__PURE__ */ t(se, { label: "Get", children: /* @__PURE__ */
|
|
3223
|
+
/* @__PURE__ */ t(se, { label: "Get", children: /* @__PURE__ */ r(
|
|
3255
3224
|
Se,
|
|
3256
3225
|
{
|
|
3257
3226
|
value: e.get === "first" ? "first" : "only",
|
|
3258
3227
|
onValueChange: (x) => S({ get: x }),
|
|
3259
3228
|
children: [
|
|
3260
3229
|
/* @__PURE__ */ t(ke, { size: "xs", "aria-label": "Get", children: /* @__PURE__ */ t(De, {}) }),
|
|
3261
|
-
/* @__PURE__ */
|
|
3230
|
+
/* @__PURE__ */ r(Ae, { children: [
|
|
3262
3231
|
/* @__PURE__ */ t(fe, { value: "only", children: "The only row" }),
|
|
3263
3232
|
/* @__PURE__ */ t(fe, { value: "first", children: "The first row" })
|
|
3264
3233
|
] })
|
|
3265
3234
|
]
|
|
3266
3235
|
}
|
|
3267
3236
|
) })
|
|
3268
|
-
] }) : /* @__PURE__ */
|
|
3269
|
-
/* @__PURE__ */
|
|
3270
|
-
/* @__PURE__ */ t(yt, { muted: !v, onClick: () => d(!0), ariaLabel: "Source", children: v ? /* @__PURE__ */
|
|
3237
|
+
] }) : /* @__PURE__ */ r(U, { children: [
|
|
3238
|
+
/* @__PURE__ */ r(se, { label: "Source", children: [
|
|
3239
|
+
/* @__PURE__ */ t(yt, { muted: !v, onClick: () => d(!0), ariaLabel: "Source", children: v ? /* @__PURE__ */ r(U, { children: [
|
|
3271
3240
|
/* @__PURE__ */ t(T, { className: "h-3.5 w-3.5 text-muted-foreground", "aria-hidden": !0 }),
|
|
3272
3241
|
" ",
|
|
3273
3242
|
v
|
|
3274
3243
|
] }) : l ? "Choose a dataset or table" : "Choose a dataset" }),
|
|
3275
|
-
o ? /* @__PURE__ */
|
|
3244
|
+
o ? /* @__PURE__ */ r("button", { type: "button", onClick: () => {
|
|
3276
3245
|
var x;
|
|
3277
3246
|
return S({ mode: "sql", connectionId: ((x = e.dataSource) == null ? void 0 : x.connectionId) || e.connectionId });
|
|
3278
|
-
}, className:
|
|
3279
|
-
/* @__PURE__ */ t(
|
|
3247
|
+
}, className: F, children: [
|
|
3248
|
+
/* @__PURE__ */ t(Gr, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
3280
3249
|
" Write SQL instead"
|
|
3281
3250
|
] }) : null
|
|
3282
3251
|
] }),
|
|
@@ -3285,33 +3254,33 @@ function Us({
|
|
|
3285
3254
|
{
|
|
3286
3255
|
open: c,
|
|
3287
3256
|
onOpenChange: d,
|
|
3288
|
-
dataSource: e.dataSource ??
|
|
3257
|
+
dataSource: e.dataSource ?? Os,
|
|
3289
3258
|
incomingSelectedEntities: ((he = e.dataSource) == null ? void 0 : he.selectedEntities) ?? [],
|
|
3290
3259
|
onDataSourceChange: (x) => {
|
|
3291
3260
|
var $;
|
|
3292
|
-
const
|
|
3261
|
+
const R = JSON.stringify(x.selectedEntities) === JSON.stringify(($ = e.dataSource) == null ? void 0 : $.selectedEntities);
|
|
3293
3262
|
S(
|
|
3294
|
-
|
|
3263
|
+
R ? { dataSource: x } : { dataSource: x, field: void 0, sortField: void 0, conditions: null, calculatedFields: void 0 }
|
|
3295
3264
|
);
|
|
3296
3265
|
}
|
|
3297
3266
|
}
|
|
3298
3267
|
),
|
|
3299
|
-
/* @__PURE__ */
|
|
3300
|
-
/* @__PURE__ */ t(se, { label: "Field", children: v ? /* @__PURE__ */
|
|
3268
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
3269
|
+
/* @__PURE__ */ t(se, { label: "Field", children: v ? /* @__PURE__ */ r(Se, { value: O, onValueChange: X, disabled: N && !D.length, children: [
|
|
3301
3270
|
/* @__PURE__ */ t(ke, { size: "xs", "aria-label": "Field", children: /* @__PURE__ */ t(De, { placeholder: N ? "Loading fields…" : k ? "Fields unavailable" : "Choose a field" }) }),
|
|
3302
|
-
/* @__PURE__ */
|
|
3303
|
-
D.map((x) => /* @__PURE__ */ t(fe, { value: x.id, children: /* @__PURE__ */
|
|
3271
|
+
/* @__PURE__ */ r(Ae, { children: [
|
|
3272
|
+
D.map((x) => /* @__PURE__ */ t(fe, { value: x.id, children: /* @__PURE__ */ r("span", { className: "flex items-center gap-2", children: [
|
|
3304
3273
|
/* @__PURE__ */ t("span", { children: x.label || x.name }),
|
|
3305
3274
|
/* @__PURE__ */ t("span", { className: "text-muted-foreground", children: zs(x.dataType) })
|
|
3306
3275
|
] }) }, x.id)),
|
|
3307
3276
|
/* @__PURE__ */ t(Zn, {}),
|
|
3308
|
-
/* @__PURE__ */ t(fe, { value: oa, children: /* @__PURE__ */
|
|
3277
|
+
/* @__PURE__ */ t(fe, { value: oa, children: /* @__PURE__ */ r("span", { className: "flex items-center gap-1.5", children: [
|
|
3309
3278
|
/* @__PURE__ */ t(be, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
3310
3279
|
" New calculated field…"
|
|
3311
3280
|
] }) })
|
|
3312
3281
|
] })
|
|
3313
3282
|
] }) : /* @__PURE__ */ t(yt, { muted: !0, children: "Choose a source first" }) }),
|
|
3314
|
-
/* @__PURE__ */ t(se, { label: "Get", children: /* @__PURE__ */
|
|
3283
|
+
/* @__PURE__ */ t(se, { label: "Get", children: /* @__PURE__ */ r(
|
|
3315
3284
|
Se,
|
|
3316
3285
|
{
|
|
3317
3286
|
value: e.get,
|
|
@@ -3319,13 +3288,13 @@ function Us({
|
|
|
3319
3288
|
disabled: !e.field,
|
|
3320
3289
|
children: [
|
|
3321
3290
|
/* @__PURE__ */ t(ke, { size: "xs", "aria-label": "Get", children: /* @__PURE__ */ t(De, {}) }),
|
|
3322
|
-
/* @__PURE__ */ t(Ae, { children:
|
|
3291
|
+
/* @__PURE__ */ t(Ae, { children: P.map((x) => /* @__PURE__ */ t(fe, { value: x.value, children: x.label }, x.value)) })
|
|
3323
3292
|
]
|
|
3324
3293
|
}
|
|
3325
3294
|
) }),
|
|
3326
3295
|
e.field && Q ? /* @__PURE__ */ t("p", { className: "col-span-2 -mt-1.5 text-[11px] leading-4 text-muted-foreground", children: Q }) : null,
|
|
3327
3296
|
k ? /* @__PURE__ */ t("p", { className: "col-span-2 -mt-1.5 text-[11px] leading-4 text-destructive", children: k }) : null,
|
|
3328
|
-
|
|
3297
|
+
Or(e) ? /* @__PURE__ */ t(
|
|
3329
3298
|
se,
|
|
3330
3299
|
{
|
|
3331
3300
|
label: "Compare with",
|
|
@@ -3334,34 +3303,34 @@ function Us({
|
|
|
3334
3303
|
An,
|
|
3335
3304
|
{
|
|
3336
3305
|
controlLabel: "Variable",
|
|
3337
|
-
selection:
|
|
3306
|
+
selection: Ps(e),
|
|
3338
3307
|
onChange: (x) => S({ comparison: _s(x) })
|
|
3339
3308
|
}
|
|
3340
3309
|
)
|
|
3341
3310
|
}
|
|
3342
3311
|
) : null,
|
|
3343
|
-
e.field && !
|
|
3344
|
-
/* @__PURE__ */ t(se, { label: "Order by", children: /* @__PURE__ */
|
|
3312
|
+
e.field && !Mr(e.get) && e.get !== "only" ? /* @__PURE__ */ r("div", { className: J("col-span-2 grid gap-3", e.get === "list" ? "grid-cols-3" : "grid-cols-2"), children: [
|
|
3313
|
+
/* @__PURE__ */ t(se, { label: "Order by", children: /* @__PURE__ */ r(
|
|
3345
3314
|
Se,
|
|
3346
3315
|
{
|
|
3347
3316
|
value: `${b}|${e.sortDirection}`,
|
|
3348
3317
|
onValueChange: (x) => {
|
|
3349
|
-
const
|
|
3318
|
+
const R = x.lastIndexOf("|"), $ = x.slice(0, R), K = x.slice(R + 1);
|
|
3350
3319
|
S({ sortField: D.find((le) => le.id === $), sortDirection: K });
|
|
3351
3320
|
},
|
|
3352
3321
|
children: [
|
|
3353
3322
|
/* @__PURE__ */ t(ke, { size: "xs", "aria-label": "Order by", children: /* @__PURE__ */ t(De, {}) }),
|
|
3354
3323
|
/* @__PURE__ */ t(Ae, { children: D.flatMap(
|
|
3355
|
-
(x) => ["asc", "desc"].map((
|
|
3324
|
+
(x) => ["asc", "desc"].map((R) => /* @__PURE__ */ r(fe, { value: `${x.id}|${R}`, children: [
|
|
3356
3325
|
x.label || x.name,
|
|
3357
3326
|
", ",
|
|
3358
|
-
|
|
3359
|
-
] }, `${x.id}|${
|
|
3327
|
+
$s(x, R)
|
|
3328
|
+
] }, `${x.id}|${R}`))
|
|
3360
3329
|
) })
|
|
3361
3330
|
]
|
|
3362
3331
|
}
|
|
3363
3332
|
) }),
|
|
3364
|
-
e.get === "list" ? /* @__PURE__ */
|
|
3333
|
+
e.get === "list" ? /* @__PURE__ */ r(U, { children: [
|
|
3365
3334
|
/* @__PURE__ */ t(se, { label: "Show up to", children: /* @__PURE__ */ t(
|
|
3366
3335
|
xe,
|
|
3367
3336
|
{
|
|
@@ -3372,8 +3341,8 @@ function Us({
|
|
|
3372
3341
|
value: e.listLimit ?? "",
|
|
3373
3342
|
placeholder: "10",
|
|
3374
3343
|
onChange: (x) => {
|
|
3375
|
-
const
|
|
3376
|
-
S({ listLimit: Number.isFinite(
|
|
3344
|
+
const R = Number.parseInt(x.target.value, 10);
|
|
3345
|
+
S({ listLimit: Number.isFinite(R) && R > 0 ? Math.min(R, st) : void 0 });
|
|
3377
3346
|
},
|
|
3378
3347
|
"aria-label": "Show up to"
|
|
3379
3348
|
}
|
|
@@ -3409,21 +3378,21 @@ function Us({
|
|
|
3409
3378
|
] })
|
|
3410
3379
|
] });
|
|
3411
3380
|
}
|
|
3412
|
-
function
|
|
3381
|
+
function Us(e, a) {
|
|
3413
3382
|
return e.name === a.name && (e.qualifiedEntityName ?? e.entityName ?? "") === (a.qualifiedEntityName ?? a.entityName ?? "");
|
|
3414
3383
|
}
|
|
3415
|
-
function
|
|
3416
|
-
const
|
|
3417
|
-
return
|
|
3384
|
+
function $s(e, a) {
|
|
3385
|
+
const s = Ot(e.dataType);
|
|
3386
|
+
return s === "date" ? a === "asc" ? "earliest first" : "latest first" : s === "number" ? a === "asc" ? "lowest first" : "highest first" : a === "asc" ? "A to Z" : "Z to A";
|
|
3418
3387
|
}
|
|
3419
|
-
function
|
|
3388
|
+
function js({
|
|
3420
3389
|
value: e,
|
|
3421
3390
|
placeholder: a,
|
|
3422
|
-
editing:
|
|
3391
|
+
editing: s,
|
|
3423
3392
|
onEditing: n,
|
|
3424
3393
|
onChange: i
|
|
3425
3394
|
}) {
|
|
3426
|
-
return
|
|
3395
|
+
return s ? /* @__PURE__ */ t(
|
|
3427
3396
|
xe,
|
|
3428
3397
|
{
|
|
3429
3398
|
size: "xs",
|
|
@@ -3438,7 +3407,7 @@ function qs({
|
|
|
3438
3407
|
className: "h-6 w-44 font-mono text-[11px]",
|
|
3439
3408
|
"aria-label": "Key"
|
|
3440
3409
|
}
|
|
3441
|
-
) : /* @__PURE__ */
|
|
3410
|
+
) : /* @__PURE__ */ r(
|
|
3442
3411
|
"button",
|
|
3443
3412
|
{
|
|
3444
3413
|
type: "button",
|
|
@@ -3453,79 +3422,79 @@ function qs({
|
|
|
3453
3422
|
}
|
|
3454
3423
|
);
|
|
3455
3424
|
}
|
|
3456
|
-
const
|
|
3425
|
+
const qs = [
|
|
3457
3426
|
{ id: "data", label: "Data" },
|
|
3458
3427
|
{ id: "filters", label: "Dashboard filters" },
|
|
3459
3428
|
{ id: "display", label: "Display" }
|
|
3460
3429
|
];
|
|
3461
|
-
function
|
|
3462
|
-
const { name: a, label:
|
|
3430
|
+
function Ws(e) {
|
|
3431
|
+
const { name: a, label: s, presentation: n, emptyText: i, ...o } = e;
|
|
3463
3432
|
return JSON.stringify(o);
|
|
3464
3433
|
}
|
|
3465
|
-
function
|
|
3434
|
+
function Qs({
|
|
3466
3435
|
variable: e,
|
|
3467
3436
|
onClose: a,
|
|
3468
|
-
onHoldEscape:
|
|
3437
|
+
onHoldEscape: s
|
|
3469
3438
|
}) {
|
|
3470
3439
|
var Z, G;
|
|
3471
|
-
const n = w((I) => I.dashboard), i = w((I) => I.selectedSheetId), o = w((I) => I.actions.saveVariableChange), [l, u] =
|
|
3472
|
-
() => e ? zr(e) :
|
|
3473
|
-
), [c, d] =
|
|
3474
|
-
p(I),
|
|
3475
|
-
}, [f, g] =
|
|
3440
|
+
const n = w((I) => I.dashboard), i = w((I) => I.selectedSheetId), o = w((I) => I.actions.saveVariableChange), [l, u] = E(
|
|
3441
|
+
() => e ? zr(e) : Rr()
|
|
3442
|
+
), [c, d] = E("data"), [h, p] = E(!1), m = (I) => {
|
|
3443
|
+
p(I), s == null || s(I);
|
|
3444
|
+
}, [f, g] = E([]), [y, N] = E(null), k = !e, V = Ws(l), B = Y(
|
|
3476
3445
|
() => Jt({ ...JSON.parse(V), name: "" }, n),
|
|
3477
3446
|
[V, n]
|
|
3478
|
-
), { name: D, label:
|
|
3447
|
+
), { name: D, label: O, presentation: b, emptyText: S } = l, v = Y(
|
|
3479
3448
|
() => ({
|
|
3480
|
-
...
|
|
3481
|
-
name: Zt(n, { id:
|
|
3482
|
-
...
|
|
3449
|
+
...B,
|
|
3450
|
+
name: Zt(n, { id: B.id, name: D, field: l.field, mode: l.mode, label: O }),
|
|
3451
|
+
...O != null && O.trim() ? { label: O.trim() } : {},
|
|
3483
3452
|
...b ? { presentation: b } : {},
|
|
3484
3453
|
...S != null && S.trim() ? { emptyText: S } : {}
|
|
3485
3454
|
}),
|
|
3486
3455
|
// The field and mode are inside the query key already.
|
|
3487
|
-
[
|
|
3456
|
+
[B, n, D, O, b, S, l.field, l.mode]
|
|
3488
3457
|
), T = Y(
|
|
3489
3458
|
() => ({
|
|
3490
3459
|
...n,
|
|
3491
3460
|
variables: [...(n.variables ?? []).filter((I) => I.id !== v.id), v]
|
|
3492
3461
|
}),
|
|
3493
3462
|
[n, v]
|
|
3494
|
-
),
|
|
3463
|
+
), F = Ur(l), H = ct(), P = w((I) => I.actions.mergeSemanticExecutionPayload), [Q, X] = E(!1), _ = async () => {
|
|
3495
3464
|
const I = Jt(l, n);
|
|
3496
3465
|
X(!0);
|
|
3497
3466
|
let ae;
|
|
3498
3467
|
try {
|
|
3499
|
-
const
|
|
3500
|
-
if (!
|
|
3501
|
-
X(!1), g(
|
|
3468
|
+
const z = vr(n, e ? { kind: "update", id: e.id, patch: I } : { kind: "add", variable: I });
|
|
3469
|
+
if (!z.ok) {
|
|
3470
|
+
X(!1), g(z.issues);
|
|
3502
3471
|
return;
|
|
3503
3472
|
}
|
|
3504
|
-
const [ne] =
|
|
3473
|
+
const [ne] = z.queryFrames;
|
|
3505
3474
|
ae = ne ? await H(ne, e ? { previousFrame: yr(n, e) } : void 0) : { domainsById: {} };
|
|
3506
|
-
} catch (
|
|
3475
|
+
} catch (z) {
|
|
3507
3476
|
X(!1), g([
|
|
3508
3477
|
{
|
|
3509
3478
|
code: "queryMissing",
|
|
3510
|
-
message:
|
|
3479
|
+
message: z instanceof Error && z.message ? z.message : "The data source's details could not be loaded.",
|
|
3511
3480
|
fix: "Try again, or choose the source again."
|
|
3512
3481
|
}
|
|
3513
3482
|
]);
|
|
3514
3483
|
return;
|
|
3515
3484
|
}
|
|
3516
3485
|
const j = o(
|
|
3517
|
-
k ? { kind: "add", variable: I } : { kind: "update", id: I.id, patch:
|
|
3486
|
+
k ? { kind: "add", variable: I } : { kind: "update", id: I.id, patch: Ks(I) }
|
|
3518
3487
|
);
|
|
3519
3488
|
if (X(!1), !j.ok) {
|
|
3520
3489
|
g(j.issues);
|
|
3521
3490
|
return;
|
|
3522
3491
|
}
|
|
3523
|
-
|
|
3492
|
+
P(ae), a();
|
|
3524
3493
|
}, te = (I) => {
|
|
3525
3494
|
if (!e) return;
|
|
3526
3495
|
const ae = o({ kind: "remove", id: e.id, confirmed: I });
|
|
3527
3496
|
if (!ae.ok) {
|
|
3528
|
-
const j = ae.issues.find((
|
|
3497
|
+
const j = ae.issues.find((z) => z.code === "inUse");
|
|
3529
3498
|
if (j && !I) {
|
|
3530
3499
|
N(j);
|
|
3531
3500
|
return;
|
|
@@ -3535,19 +3504,19 @@ function Ks({
|
|
|
3535
3504
|
}
|
|
3536
3505
|
a();
|
|
3537
3506
|
};
|
|
3538
|
-
return /* @__PURE__ */
|
|
3507
|
+
return /* @__PURE__ */ r(
|
|
3539
3508
|
"div",
|
|
3540
3509
|
{
|
|
3541
3510
|
className: "flex h-[600px] max-h-[85vh] w-[600px] max-w-[calc(100vw-24px)] flex-col overflow-hidden",
|
|
3542
3511
|
"data-testid": "variable-editor",
|
|
3543
3512
|
children: [
|
|
3544
|
-
/* @__PURE__ */
|
|
3545
|
-
/* @__PURE__ */
|
|
3513
|
+
/* @__PURE__ */ r("div", { className: "flex min-h-12 shrink-0 items-center justify-between gap-2 border-b border-border/60 px-3 py-1.5", children: [
|
|
3514
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-start gap-2", children: [
|
|
3546
3515
|
/* @__PURE__ */ t(Nt, { className: "mt-1 h-3.5 w-3.5 shrink-0 text-muted-foreground", "aria-hidden": !0 }),
|
|
3547
|
-
/* @__PURE__ */
|
|
3548
|
-
/* @__PURE__ */
|
|
3516
|
+
/* @__PURE__ */ r("div", { className: "min-w-0", children: [
|
|
3517
|
+
/* @__PURE__ */ r("p", { className: "flex items-center gap-2", children: [
|
|
3549
3518
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: k ? "New variable" : e.label || e.name }),
|
|
3550
|
-
/* @__PURE__ */ t("span", { className:
|
|
3519
|
+
/* @__PURE__ */ t("span", { className: Rt, children: "Variable from data" })
|
|
3551
3520
|
] }),
|
|
3552
3521
|
/* @__PURE__ */ t("p", { className: "mt-0.5 truncate text-[10px] leading-3 text-muted-foreground/70", children: "Available on every tab and Document of this dashboard" })
|
|
3553
3522
|
] })
|
|
@@ -3563,7 +3532,7 @@ function Ks({
|
|
|
3563
3532
|
}
|
|
3564
3533
|
)
|
|
3565
3534
|
] }),
|
|
3566
|
-
h ? null : /* @__PURE__ */ t("nav", { role: "tablist", "aria-label": "Variable settings sections", className: "flex h-9 shrink-0 items-stretch gap-4 border-b border-border/60 px-4", children:
|
|
3535
|
+
h ? null : /* @__PURE__ */ t("nav", { role: "tablist", "aria-label": "Variable settings sections", className: "flex h-9 shrink-0 items-stretch gap-4 border-b border-border/60 px-4", children: qs.map((I) => /* @__PURE__ */ r(
|
|
3567
3536
|
"button",
|
|
3568
3537
|
{
|
|
3569
3538
|
role: "tab",
|
|
@@ -3580,9 +3549,9 @@ function Ks({
|
|
|
3580
3549
|
},
|
|
3581
3550
|
I.id
|
|
3582
3551
|
)) }),
|
|
3583
|
-
/* @__PURE__ */
|
|
3552
|
+
/* @__PURE__ */ r("div", { className: J("min-h-0 flex-1 overflow-y-auto", c === "filters" || h ? "" : "space-y-4 px-4 py-4"), children: [
|
|
3584
3553
|
c === "data" ? /* @__PURE__ */ t(
|
|
3585
|
-
|
|
3554
|
+
Rs,
|
|
3586
3555
|
{
|
|
3587
3556
|
draft: l,
|
|
3588
3557
|
onChange: u,
|
|
@@ -3590,27 +3559,27 @@ function Ks({
|
|
|
3590
3559
|
onCalculatedFieldOpenChange: m
|
|
3591
3560
|
}
|
|
3592
3561
|
) : null,
|
|
3593
|
-
c === "filters" ? /* @__PURE__ */ t(
|
|
3594
|
-
c === "display" ? /* @__PURE__ */ t(
|
|
3562
|
+
c === "filters" ? /* @__PURE__ */ t(Hs, { draft: l, draftDashboard: T }) : null,
|
|
3563
|
+
c === "display" ? /* @__PURE__ */ t(Xs, { draft: l, onChange: u }) : null
|
|
3595
3564
|
] }),
|
|
3596
|
-
h ? null : /* @__PURE__ */
|
|
3565
|
+
h ? null : /* @__PURE__ */ r(U, { children: [
|
|
3597
3566
|
/* @__PURE__ */ t(
|
|
3598
|
-
|
|
3567
|
+
Js,
|
|
3599
3568
|
{
|
|
3600
3569
|
draft: l,
|
|
3601
3570
|
draftVariable: v,
|
|
3602
3571
|
draftDashboard: T,
|
|
3603
|
-
blocker:
|
|
3572
|
+
blocker: F,
|
|
3604
3573
|
selectedSheetId: i ?? void 0
|
|
3605
3574
|
}
|
|
3606
3575
|
),
|
|
3607
|
-
f.length ? /* @__PURE__ */ t("div", { className: "shrink-0 border-t border-border/60 bg-destructive/5 px-4 py-2 text-[11px] leading-4 text-destructive", role: "alert", children: f.map((I) => /* @__PURE__ */
|
|
3576
|
+
f.length ? /* @__PURE__ */ t("div", { className: "shrink-0 border-t border-border/60 bg-destructive/5 px-4 py-2 text-[11px] leading-4 text-destructive", role: "alert", children: f.map((I) => /* @__PURE__ */ r("p", { children: [
|
|
3608
3577
|
I.message,
|
|
3609
3578
|
" ",
|
|
3610
3579
|
I.fix
|
|
3611
3580
|
] }, `${I.code}:${I.path ?? ""}`)) }) : null,
|
|
3612
|
-
y ? /* @__PURE__ */
|
|
3613
|
-
/* @__PURE__ */
|
|
3581
|
+
y ? /* @__PURE__ */ r("div", { className: "shrink-0 border-t border-border/60 bg-amber-500/10 px-4 py-2 text-[11px] leading-4 text-amber-800 dark:text-amber-300", role: "alertdialog", children: [
|
|
3582
|
+
/* @__PURE__ */ r("p", { children: [
|
|
3614
3583
|
y.message,
|
|
3615
3584
|
" Used in ",
|
|
3616
3585
|
((Z = y.places) == null ? void 0 : Z.length) ?? 0,
|
|
@@ -3618,12 +3587,12 @@ function Ks({
|
|
|
3618
3587
|
((G = y.places) == null ? void 0 : G.length) === 1 ? "place" : "places",
|
|
3619
3588
|
". Its chips then read as missing."
|
|
3620
3589
|
] }),
|
|
3621
|
-
/* @__PURE__ */
|
|
3590
|
+
/* @__PURE__ */ r("div", { className: "mt-1.5 flex gap-1.5", children: [
|
|
3622
3591
|
/* @__PURE__ */ t(L, { variant: "outline", size: "xs", className: "h-6 px-2 text-[11px]", onClick: () => N(null), children: "Keep it" }),
|
|
3623
3592
|
/* @__PURE__ */ t(L, { size: "xs", className: "h-6 px-2 text-[11px]", onClick: () => te(!0), children: "Remove anyway" })
|
|
3624
3593
|
] })
|
|
3625
3594
|
] }) : null,
|
|
3626
|
-
/* @__PURE__ */
|
|
3595
|
+
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border/60 px-4 py-2.5", children: [
|
|
3627
3596
|
k ? /* @__PURE__ */ t("span", {}) : /* @__PURE__ */ t(
|
|
3628
3597
|
L,
|
|
3629
3598
|
{
|
|
@@ -3634,9 +3603,9 @@ function Ks({
|
|
|
3634
3603
|
children: "Delete"
|
|
3635
3604
|
}
|
|
3636
3605
|
),
|
|
3637
|
-
/* @__PURE__ */
|
|
3606
|
+
/* @__PURE__ */ r("span", { className: "flex items-center gap-1.5", children: [
|
|
3638
3607
|
/* @__PURE__ */ t(L, { variant: "outline", size: "xs", onClick: a, children: "Cancel" }),
|
|
3639
|
-
/* @__PURE__ */ t(L, { size: "xs", disabled: !!
|
|
3608
|
+
/* @__PURE__ */ t(L, { size: "xs", disabled: !!F || Q, title: F, onClick: () => void _(), children: k ? "Create" : "Done" })
|
|
3640
3609
|
] })
|
|
3641
3610
|
] })
|
|
3642
3611
|
] })
|
|
@@ -3644,36 +3613,36 @@ function Ks({
|
|
|
3644
3613
|
}
|
|
3645
3614
|
);
|
|
3646
3615
|
}
|
|
3647
|
-
function
|
|
3648
|
-
const { id: a, ...
|
|
3616
|
+
function Ks(e) {
|
|
3617
|
+
const { id: a, ...s } = e;
|
|
3649
3618
|
return {
|
|
3650
|
-
...
|
|
3619
|
+
...s,
|
|
3651
3620
|
// Fields the draft cleared come back as `undefined`, so an update drops them.
|
|
3652
|
-
label:
|
|
3653
|
-
presentation:
|
|
3654
|
-
emptyText:
|
|
3621
|
+
label: s.label,
|
|
3622
|
+
presentation: s.presentation,
|
|
3623
|
+
emptyText: s.emptyText
|
|
3655
3624
|
};
|
|
3656
3625
|
}
|
|
3657
|
-
function
|
|
3658
|
-
const
|
|
3659
|
-
(o) =>
|
|
3626
|
+
function Hs({ draft: e, draftDashboard: a }) {
|
|
3627
|
+
const s = Y(() => fr(a), [a]), n = s.inputs.filter(
|
|
3628
|
+
(o) => s.reachedVariables({ inputId: o.input.id }).some((l) => l.variableId === e.id)
|
|
3660
3629
|
), i = e.mode === "sql" && gr(e.sql);
|
|
3661
|
-
return n.length ? /* @__PURE__ */
|
|
3630
|
+
return n.length ? /* @__PURE__ */ r("div", { className: "divide-y divide-border/60", children: [
|
|
3662
3631
|
/* @__PURE__ */ t("p", { className: "px-4 py-2 text-[11px] leading-4 text-muted-foreground", children: "How each filter applies here. Change a mapping on the filter's Cards tab, under Variables." }),
|
|
3663
3632
|
n.map((o) => {
|
|
3664
3633
|
var c;
|
|
3665
3634
|
const l = (c = o.input.application) == null ? void 0 : c.cards.find((d) => d.cardId === e.id), u = i ? "Subscribes in SQL" : e.mode === "sql" ? "Not named in the SQL" : (l == null ? void 0 : l.kind) === "excluded" ? "Don't apply" : (l == null ? void 0 : l.kind) === "bound" ? `${l.target.kind === "field" ? "Field" : "Path"} · ${l.target.field.name}` : "Auto";
|
|
3666
|
-
return /* @__PURE__ */
|
|
3667
|
-
/* @__PURE__ */
|
|
3635
|
+
return /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3 px-4 py-2 text-[12px]", children: [
|
|
3636
|
+
/* @__PURE__ */ r("span", { className: "min-w-0", children: [
|
|
3668
3637
|
/* @__PURE__ */ t("span", { className: "block truncate font-medium text-foreground", children: o.input.label || o.input.filter.title }),
|
|
3669
|
-
/* @__PURE__ */ t("span", { className: "block truncate text-[11px] text-muted-foreground", children:
|
|
3638
|
+
/* @__PURE__ */ t("span", { className: "block truncate text-[11px] text-muted-foreground", children: Gs(o.input.scope) })
|
|
3670
3639
|
] }),
|
|
3671
3640
|
/* @__PURE__ */ t("span", { className: J("shrink-0 text-[11px]", u === "Don't apply" || u === "Not named in the SQL" ? "text-muted-foreground" : "text-foreground"), children: u })
|
|
3672
3641
|
] }, o.input.id);
|
|
3673
3642
|
})
|
|
3674
3643
|
] }) : /* @__PURE__ */ t("p", { className: "px-4 py-6 text-center text-[12px] text-muted-foreground", children: "No filter reaches this variable. A filter on the tabs or Documents where it is used reaches it; a variable used nowhere yet follows every tab's filters." });
|
|
3675
3644
|
}
|
|
3676
|
-
function
|
|
3645
|
+
function Gs(e) {
|
|
3677
3646
|
switch (e.kind) {
|
|
3678
3647
|
case "allSheets":
|
|
3679
3648
|
return "On every tab";
|
|
@@ -3685,20 +3654,20 @@ function Ys(e) {
|
|
|
3685
3654
|
return e.kind;
|
|
3686
3655
|
}
|
|
3687
3656
|
}
|
|
3688
|
-
const
|
|
3657
|
+
const Ys = [
|
|
3689
3658
|
{ value: "auto", label: "Automatic" },
|
|
3690
3659
|
{ value: "short", label: "Short" },
|
|
3691
3660
|
{ value: "medium", label: "Medium" },
|
|
3692
3661
|
{ value: "long", label: "Long" },
|
|
3693
3662
|
{ value: "pattern", label: "Custom pattern…" }
|
|
3694
3663
|
];
|
|
3695
|
-
function
|
|
3664
|
+
function Xs({ draft: e, onChange: a }) {
|
|
3696
3665
|
var u, c;
|
|
3697
|
-
const
|
|
3698
|
-
return /* @__PURE__ */
|
|
3699
|
-
|
|
3700
|
-
/* @__PURE__ */
|
|
3701
|
-
/* @__PURE__ */
|
|
3666
|
+
const s = e.mode === "sql" ? "unknown" : Ot((u = e.field) == null ? void 0 : u.dataType), n = (c = e.presentation) == null ? void 0 : c.temporal, i = n ? n.mode === "style" ? n.dateStyle : n.mode === "pattern" ? "pattern" : "auto" : "auto", o = (n == null ? void 0 : n.mode) === "pattern" ? Ir(n.pattern) : null, l = (d) => a({ ...e, presentation: d && Object.keys(d).length ? d : void 0 });
|
|
3667
|
+
return /* @__PURE__ */ r(U, { children: [
|
|
3668
|
+
s === "date" || s === "unknown" ? /* @__PURE__ */ r(se, { label: "Dates read as", hint: "A chip can change this for itself.", children: [
|
|
3669
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
3670
|
+
/* @__PURE__ */ r(
|
|
3702
3671
|
Se,
|
|
3703
3672
|
{
|
|
3704
3673
|
value: i,
|
|
@@ -3708,7 +3677,7 @@ function Js({ draft: e, onChange: a }) {
|
|
|
3708
3677
|
}),
|
|
3709
3678
|
children: [
|
|
3710
3679
|
/* @__PURE__ */ t(ke, { size: "xs", className: "w-44", "aria-label": "Date style", children: /* @__PURE__ */ t(De, {}) }),
|
|
3711
|
-
/* @__PURE__ */ t(Ae, { children:
|
|
3680
|
+
/* @__PURE__ */ t(Ae, { children: Ys.map((d) => /* @__PURE__ */ t(fe, { value: d.value, children: d.label }, d.value)) })
|
|
3712
3681
|
]
|
|
3713
3682
|
}
|
|
3714
3683
|
),
|
|
@@ -3725,7 +3694,7 @@ function Js({ draft: e, onChange: a }) {
|
|
|
3725
3694
|
] }),
|
|
3726
3695
|
o ? /* @__PURE__ */ t("p", { className: "mt-1 text-[11px] text-destructive", children: o }) : null
|
|
3727
3696
|
] }) : null,
|
|
3728
|
-
|
|
3697
|
+
s === "number" || s === "unknown" ? /* @__PURE__ */ t(se, { label: "Numbers read as", hint: "A chip can change any of these for itself.", children: /* @__PURE__ */ t(Fn, { value: e.presentation, onChange: l }) }) : null,
|
|
3729
3698
|
/* @__PURE__ */ t(
|
|
3730
3699
|
se,
|
|
3731
3700
|
{
|
|
@@ -3747,27 +3716,27 @@ function Js({ draft: e, onChange: a }) {
|
|
|
3747
3716
|
)
|
|
3748
3717
|
] });
|
|
3749
3718
|
}
|
|
3750
|
-
function
|
|
3719
|
+
function Js({
|
|
3751
3720
|
draft: e,
|
|
3752
3721
|
draftVariable: a,
|
|
3753
|
-
draftDashboard:
|
|
3722
|
+
draftDashboard: s,
|
|
3754
3723
|
blocker: n,
|
|
3755
3724
|
selectedSheetId: i
|
|
3756
3725
|
}) {
|
|
3757
3726
|
var S;
|
|
3758
|
-
const o =
|
|
3727
|
+
const o = s.sheets ?? [], l = Y(() => Is(s, a.id), [s, a.id]), [u, c] = E(void 0), d = (l ? u : void 0) ?? i ?? ((S = o[0]) == null ? void 0 : S.id), h = o.find((v) => v.id === d), p = w((v) => d ? v.documentSectionRuntimeBySheetId[d] : void 0), m = !!(h && Ke(h)), f = Y(
|
|
3759
3728
|
() => d ? m ? p ? { kind: "document", sheetId: d, runtime: p } : void 0 : { kind: "sheet", sheetId: d } : void 0,
|
|
3760
3729
|
[m, p, d]
|
|
3761
3730
|
), g = Y(() => n || !f ? [] : [a], [n, a, f]), N = En({
|
|
3762
|
-
dashboard:
|
|
3731
|
+
dashboard: s,
|
|
3763
3732
|
place: f ?? { kind: "sheet", sheetId: d ?? "" },
|
|
3764
3733
|
purpose: "preview",
|
|
3765
3734
|
variables: g
|
|
3766
|
-
}).byId.get(a.id), k = In(), V = Tn(),
|
|
3735
|
+
}).byId.get(a.id), k = In(), V = Tn(), B = Y(
|
|
3767
3736
|
() => xr({ preferences: k, calendar: V }),
|
|
3768
3737
|
[V, k]
|
|
3769
3738
|
);
|
|
3770
|
-
let D,
|
|
3739
|
+
let D, O = "", b = null;
|
|
3771
3740
|
if (n)
|
|
3772
3741
|
D = /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: e.mode === "sql" ? "Write the SQL to see a value." : "Choose a source and a field to see a value." });
|
|
3773
3742
|
else if (!f)
|
|
@@ -3775,12 +3744,12 @@ function Zs({
|
|
|
3775
3744
|
else if (!N || N.status === "loading")
|
|
3776
3745
|
D = /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "Loading…" });
|
|
3777
3746
|
else {
|
|
3778
|
-
const v =
|
|
3779
|
-
if (D = v.body,
|
|
3747
|
+
const v = Zs(a, N, B);
|
|
3748
|
+
if (D = v.body, O = v.meta, v.unavailable) {
|
|
3780
3749
|
const T = (h == null ? void 0 : h.title) || "this tab";
|
|
3781
|
-
b = /* @__PURE__ */
|
|
3750
|
+
b = /* @__PURE__ */ r("p", { className: "mt-1.5 flex gap-1.5 text-[11px] leading-4 text-amber-700 dark:text-amber-400", children: [
|
|
3782
3751
|
/* @__PURE__ */ t(ya, { className: "mt-px h-3 w-3 shrink-0", "aria-hidden": !0 }),
|
|
3783
|
-
/* @__PURE__ */
|
|
3752
|
+
/* @__PURE__ */ r("span", { children: [
|
|
3784
3753
|
"No change on ",
|
|
3785
3754
|
T,
|
|
3786
3755
|
". ",
|
|
@@ -3789,32 +3758,32 @@ function Zs({
|
|
|
3789
3758
|
] });
|
|
3790
3759
|
}
|
|
3791
3760
|
}
|
|
3792
|
-
return /* @__PURE__ */
|
|
3793
|
-
/* @__PURE__ */
|
|
3794
|
-
/* @__PURE__ */ t("span", { className:
|
|
3795
|
-
l ? /* @__PURE__ */
|
|
3761
|
+
return /* @__PURE__ */ r("div", { className: "shrink-0 border-t border-border/60 bg-muted/30 px-4 py-2.5", "data-testid": "variable-preview", children: [
|
|
3762
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
|
|
3763
|
+
/* @__PURE__ */ t("span", { className: Rt, children: l ? "Preview on" : "Preview" }),
|
|
3764
|
+
l ? /* @__PURE__ */ r(Se, { value: d ?? "", onValueChange: c, disabled: !!n, children: [
|
|
3796
3765
|
/* @__PURE__ */ t(ke, { size: "xs", className: "h-6 w-auto gap-1.5 px-2 text-[12px]", "aria-label": "Preview place", children: /* @__PURE__ */ t(De, {}) }),
|
|
3797
3766
|
/* @__PURE__ */ t(Ae, { children: o.map((v) => /* @__PURE__ */ t(fe, { value: v.id, children: v.title || v.id }, v.id)) })
|
|
3798
3767
|
] }) : null,
|
|
3799
3768
|
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1 truncate text-right text-[13px]", children: D })
|
|
3800
3769
|
] }),
|
|
3801
|
-
|
|
3770
|
+
O ? /* @__PURE__ */ t("p", { className: "mt-1 text-[11px] leading-4 text-muted-foreground", children: O }) : null,
|
|
3802
3771
|
b
|
|
3803
3772
|
] });
|
|
3804
3773
|
}
|
|
3805
|
-
function
|
|
3806
|
-
const n = (h) => /* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: h }), i = (h) => /* @__PURE__ */
|
|
3774
|
+
function Zs(e, a, s) {
|
|
3775
|
+
const n = (h) => /* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: h }), i = (h) => /* @__PURE__ */ r("span", { className: "inline-flex items-center gap-1.5 text-[12px] text-amber-700 dark:text-amber-400", children: [
|
|
3807
3776
|
/* @__PURE__ */ t(ya, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
|
|
3808
3777
|
" ",
|
|
3809
3778
|
h
|
|
3810
3779
|
] }), o = (h) => h === void 0 ? "" : h === "beyondCap" ? `more than ${st} match` : `${h} ${h === 1 ? "match" : "matches"}`, l = "filterReach" in a ? a.filterReach : [], u = l.filter((h) => h.status === "applied").length, c = l.length - u, d = l.length ? ` · ${u} ${u === 1 ? "filter" : "filters"} applied${c ? `, ${c} skipped` : ""}` : "";
|
|
3811
3780
|
switch (a.status) {
|
|
3812
3781
|
case "answered": {
|
|
3813
|
-
const h = Br(e, Object.keys(a.parts))[0], p = h ? a.parts[h] : void 0, m = p && Ht(p, e.presentation,
|
|
3782
|
+
const h = Br(e, Object.keys(a.parts))[0], p = h ? a.parts[h] : void 0, m = p && Ht(p, e.presentation, s) || "(empty)", f = `${o(a.matched)}${d}`.replace(/^ · /, ""), g = Nr(e, a, s);
|
|
3814
3783
|
return g && typeof g == "object" && "unavailable" in g ? { body: n(m), meta: f, unavailable: g.unavailable } : g === "noPrevious" ? { body: n(m), meta: `${f} · Nothing in the period before to compare with.`.replace(/^ · /, "") } : g ? {
|
|
3815
|
-
body: /* @__PURE__ */
|
|
3784
|
+
body: /* @__PURE__ */ r(U, { children: [
|
|
3816
3785
|
n(g.value),
|
|
3817
|
-
/* @__PURE__ */
|
|
3786
|
+
/* @__PURE__ */ r("span", { className: "text-muted-foreground", children: [
|
|
3818
3787
|
" · was ",
|
|
3819
3788
|
g.previous,
|
|
3820
3789
|
" · "
|
|
@@ -3825,7 +3794,7 @@ function ei(e, a, r) {
|
|
|
3825
3794
|
} : { body: n(m), meta: f };
|
|
3826
3795
|
}
|
|
3827
3796
|
case "listed": {
|
|
3828
|
-
const h = a.items.map((m) => Ht(m, e.presentation,
|
|
3797
|
+
const h = a.items.map((m) => Ht(m, e.presentation, s)), p = a.more === "beyondCap" ? " and more" : a.more ? ` and ${a.more} more` : "";
|
|
3829
3798
|
return { body: n(`${h.join(e.get.kind === "list" ? e.get.separator ?? ", " : ", ")}${p}`), meta: `${o(a.matched)}${d}` };
|
|
3830
3799
|
}
|
|
3831
3800
|
case "none":
|
|
@@ -3834,7 +3803,7 @@ function ei(e, a, r) {
|
|
|
3834
3803
|
meta: "Keep a selection on a filter, add a condition, or choose First or List."
|
|
3835
3804
|
} : { body: /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "No rows match." }), meta: d.slice(3) };
|
|
3836
3805
|
case "held":
|
|
3837
|
-
return { body: /* @__PURE__ */
|
|
3806
|
+
return { body: /* @__PURE__ */ r("span", { className: "text-muted-foreground", children: [
|
|
3838
3807
|
"Waiting for ",
|
|
3839
3808
|
a.missingRequired.join(", "),
|
|
3840
3809
|
"."
|
|
@@ -3847,26 +3816,26 @@ function ei(e, a, r) {
|
|
|
3847
3816
|
return { body: null, meta: "" };
|
|
3848
3817
|
}
|
|
3849
3818
|
}
|
|
3850
|
-
function
|
|
3851
|
-
const e = w((l) => l.variableEditor), a = w((l) => l.dashboard.variables),
|
|
3852
|
-
return !(e && (e.kind === "new" || i)) ? null : /* @__PURE__ */
|
|
3819
|
+
function no() {
|
|
3820
|
+
const e = w((l) => l.variableEditor), a = w((l) => l.dashboard.variables), s = w((l) => l.actions.closeVariableEditor), n = et(!1), i = (e == null ? void 0 : e.kind) === "edit" ? a == null ? void 0 : a.find((l) => l.id === e.variableId) : void 0;
|
|
3821
|
+
return !(e && (e.kind === "new" || i)) ? null : /* @__PURE__ */ r(Le, { modal: !1, open: !0, onOpenChange: (l) => !l && s(), children: [
|
|
3853
3822
|
/* @__PURE__ */ t("div", { className: "pointer-events-none fixed inset-0 z-40 bg-zinc-950/40 backdrop-blur-sm" }),
|
|
3854
|
-
/* @__PURE__ */
|
|
3823
|
+
/* @__PURE__ */ r(
|
|
3855
3824
|
Ve,
|
|
3856
3825
|
{
|
|
3857
3826
|
className: "w-auto max-w-none gap-0 overflow-hidden p-0 [&>button:last-child]:hidden",
|
|
3858
3827
|
onInteractOutside: (l) => l.preventDefault(),
|
|
3859
3828
|
onEscapeKeyDown: (l) => {
|
|
3860
|
-
n.current ? l.preventDefault() :
|
|
3829
|
+
n.current ? l.preventDefault() : s();
|
|
3861
3830
|
},
|
|
3862
3831
|
children: [
|
|
3863
|
-
/* @__PURE__ */ t(
|
|
3832
|
+
/* @__PURE__ */ t(Be, { className: "sr-only", children: "Variable from data" }),
|
|
3864
3833
|
/* @__PURE__ */ t(ut, { className: "sr-only", children: "Define a value from your data to show in text." }),
|
|
3865
3834
|
/* @__PURE__ */ t(
|
|
3866
|
-
|
|
3835
|
+
Qs,
|
|
3867
3836
|
{
|
|
3868
3837
|
variable: i,
|
|
3869
|
-
onClose:
|
|
3838
|
+
onClose: s,
|
|
3870
3839
|
onHoldEscape: (l) => {
|
|
3871
3840
|
n.current = l;
|
|
3872
3841
|
}
|
|
@@ -3878,40 +3847,40 @@ function oo() {
|
|
|
3878
3847
|
)
|
|
3879
3848
|
] });
|
|
3880
3849
|
}
|
|
3881
|
-
function
|
|
3850
|
+
function ei({
|
|
3882
3851
|
disabled: e,
|
|
3883
3852
|
briefingCount: a,
|
|
3884
|
-
className:
|
|
3853
|
+
className: s,
|
|
3885
3854
|
onClick: n
|
|
3886
3855
|
}) {
|
|
3887
3856
|
const i = typeof a == "number" && a > 0;
|
|
3888
|
-
return /* @__PURE__ */
|
|
3857
|
+
return /* @__PURE__ */ r(
|
|
3889
3858
|
L,
|
|
3890
3859
|
{
|
|
3891
3860
|
type: "button",
|
|
3892
3861
|
size: "xs",
|
|
3893
3862
|
variant: "outline",
|
|
3894
3863
|
disabled: e,
|
|
3895
|
-
className: J("gap-1.5",
|
|
3864
|
+
className: J("gap-1.5", s),
|
|
3896
3865
|
onClick: n,
|
|
3897
3866
|
"aria-label": "Reports & briefings",
|
|
3898
3867
|
children: [
|
|
3899
|
-
/* @__PURE__ */ t(
|
|
3868
|
+
/* @__PURE__ */ t(Hr, { className: "h-3.5 w-3.5" }),
|
|
3900
3869
|
"Reports & briefings",
|
|
3901
3870
|
i ? /* @__PURE__ */ t("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
|
|
3902
3871
|
]
|
|
3903
3872
|
}
|
|
3904
3873
|
);
|
|
3905
3874
|
}
|
|
3906
|
-
const
|
|
3907
|
-
function
|
|
3875
|
+
const ti = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", Ia = "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", Ze = "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";
|
|
3876
|
+
function ai(e) {
|
|
3908
3877
|
return e === "dashboard" ? "This dashboard" : "Project";
|
|
3909
3878
|
}
|
|
3910
|
-
function
|
|
3879
|
+
function ni(e) {
|
|
3911
3880
|
if (!e) return "Never";
|
|
3912
3881
|
const a = new Date(e);
|
|
3913
3882
|
if (Number.isNaN(a.getTime())) return "Unknown";
|
|
3914
|
-
const
|
|
3883
|
+
const s = Date.now() - a.getTime(), n = Math.round(s / 6e4);
|
|
3915
3884
|
if (n < 1) return "now";
|
|
3916
3885
|
if (n < 60) return `${n}m ago`;
|
|
3917
3886
|
const i = Math.round(n / 60);
|
|
@@ -3921,26 +3890,26 @@ function ri(e) {
|
|
|
3921
3890
|
const l = Math.round(o / 7);
|
|
3922
3891
|
return l < 5 ? `${l}w ago` : `${Math.round(o / 30)}mo ago`;
|
|
3923
3892
|
}
|
|
3924
|
-
function
|
|
3925
|
-
return e.scheduleExpr ?
|
|
3893
|
+
function ri(e) {
|
|
3894
|
+
return e.scheduleExpr ? $r(
|
|
3926
3895
|
e.scheduleExpr,
|
|
3927
3896
|
e.timezone || "UTC"
|
|
3928
3897
|
) ?? "Invalid schedule" : "On demand";
|
|
3929
3898
|
}
|
|
3930
|
-
function
|
|
3899
|
+
function si(e) {
|
|
3931
3900
|
if (e.lastRunStatus) {
|
|
3932
3901
|
const a = e.lastRunStatus.toString().toUpperCase();
|
|
3933
3902
|
return a === "SUCCESS" ? "Last run completed." : a === "FAILED" ? "Last run failed." : `Last run ${e.lastRunStatus.toString().toLowerCase()}`;
|
|
3934
3903
|
}
|
|
3935
3904
|
return null;
|
|
3936
3905
|
}
|
|
3937
|
-
function
|
|
3906
|
+
function Ta(e) {
|
|
3938
3907
|
return e.hasActiveRun ? "Running" : e.lastRunStatus ? `Last run ${e.lastRunStatus.toString().toLowerCase()}` : "Idle";
|
|
3939
3908
|
}
|
|
3940
|
-
function
|
|
3909
|
+
function ii(e) {
|
|
3941
3910
|
return e.source.type === "dashboard" ? "This dashboard" : "Project";
|
|
3942
3911
|
}
|
|
3943
|
-
function
|
|
3912
|
+
function oi({
|
|
3944
3913
|
activeView: e,
|
|
3945
3914
|
onChange: a
|
|
3946
3915
|
}) {
|
|
@@ -3950,31 +3919,31 @@ function li({
|
|
|
3950
3919
|
className: "flex shrink-0 items-center gap-1 rounded-control bg-muted p-0.5",
|
|
3951
3920
|
role: "tablist",
|
|
3952
3921
|
"aria-label": "Briefing source view",
|
|
3953
|
-
children: ["dashboard", "project"].map((
|
|
3954
|
-
const n = e ===
|
|
3922
|
+
children: ["dashboard", "project"].map((s) => {
|
|
3923
|
+
const n = e === s;
|
|
3955
3924
|
return /* @__PURE__ */ t(
|
|
3956
3925
|
"button",
|
|
3957
3926
|
{
|
|
3958
3927
|
type: "button",
|
|
3959
3928
|
role: "tab",
|
|
3960
3929
|
"aria-selected": n,
|
|
3961
|
-
onClick: () => a(
|
|
3930
|
+
onClick: () => a(s),
|
|
3962
3931
|
className: J(
|
|
3963
3932
|
"h-6 rounded-[3px] px-2 text-[11px] transition-colors",
|
|
3964
3933
|
n ? "bg-background font-medium text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
|
|
3965
3934
|
),
|
|
3966
|
-
children:
|
|
3935
|
+
children: ai(s)
|
|
3967
3936
|
},
|
|
3968
|
-
|
|
3937
|
+
s
|
|
3969
3938
|
);
|
|
3970
3939
|
})
|
|
3971
3940
|
}
|
|
3972
3941
|
);
|
|
3973
3942
|
}
|
|
3974
|
-
function
|
|
3943
|
+
function li({
|
|
3975
3944
|
briefings: e,
|
|
3976
3945
|
dashboardLabel: a,
|
|
3977
|
-
sourceView:
|
|
3946
|
+
sourceView: s,
|
|
3978
3947
|
error: n,
|
|
3979
3948
|
loading: i,
|
|
3980
3949
|
onSourceViewChange: o,
|
|
@@ -3991,18 +3960,18 @@ function di({
|
|
|
3991
3960
|
busyId: N,
|
|
3992
3961
|
manageBriefingsHref: k,
|
|
3993
3962
|
contentKind: V,
|
|
3994
|
-
hideHeader:
|
|
3963
|
+
hideHeader: B = !1
|
|
3995
3964
|
}) {
|
|
3996
|
-
const D = e.length,
|
|
3997
|
-
return /* @__PURE__ */
|
|
3965
|
+
const D = e.length, O = e.filter((F) => F.status === "ACTIVE").length, b = V === "reports" ? D === 1 ? "report" : "reports" : V === "briefings" ? D === 1 ? "briefing" : "briefings" : D === 1 ? "item" : "items", S = e.find((F) => F.hasActiveRun) ?? null, v = V ?? "reports & briefings", T = s === "dashboard" ? a : `Project ${v}`;
|
|
3966
|
+
return /* @__PURE__ */ r(
|
|
3998
3967
|
"section",
|
|
3999
3968
|
{
|
|
4000
3969
|
"aria-label": `Dashboard ${v.replace("&", "and")}`,
|
|
4001
3970
|
className: "flex h-full min-h-0 flex-col bg-background text-foreground",
|
|
4002
3971
|
children: [
|
|
4003
|
-
|
|
4004
|
-
/* @__PURE__ */
|
|
4005
|
-
/* @__PURE__ */ t("div", { className:
|
|
3972
|
+
B ? null : /* @__PURE__ */ r("header", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [
|
|
3973
|
+
/* @__PURE__ */ r("div", { className: "min-w-0", children: [
|
|
3974
|
+
/* @__PURE__ */ t("div", { className: ti, children: v }),
|
|
4006
3975
|
/* @__PURE__ */ t("h2", { className: "mt-0.5 truncate text-[14px] font-semibold leading-5", children: T })
|
|
4007
3976
|
] }),
|
|
4008
3977
|
/* @__PURE__ */ t(
|
|
@@ -4016,37 +3985,37 @@ function di({
|
|
|
4016
3985
|
}
|
|
4017
3986
|
)
|
|
4018
3987
|
] }),
|
|
4019
|
-
/* @__PURE__ */
|
|
4020
|
-
/* @__PURE__ */
|
|
3988
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3 border-b border-border px-4 py-2", children: [
|
|
3989
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
4021
3990
|
/* @__PURE__ */ t(
|
|
4022
|
-
|
|
3991
|
+
oi,
|
|
4023
3992
|
{
|
|
4024
|
-
activeView:
|
|
3993
|
+
activeView: s,
|
|
4025
3994
|
onChange: o
|
|
4026
3995
|
}
|
|
4027
3996
|
),
|
|
4028
|
-
/* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && D === 0 ? /* @__PURE__ */
|
|
3997
|
+
/* @__PURE__ */ t("div", { className: "flex min-w-0 items-center gap-1.5 text-[11px] text-muted-foreground", children: i && D === 0 ? /* @__PURE__ */ r("span", { children: [
|
|
4029
3998
|
"Loading ",
|
|
4030
3999
|
v,
|
|
4031
4000
|
"…"
|
|
4032
|
-
] }) : D === 0 ? /* @__PURE__ */
|
|
4001
|
+
] }) : D === 0 ? /* @__PURE__ */ r("span", { children: [
|
|
4033
4002
|
"No ",
|
|
4034
4003
|
v,
|
|
4035
4004
|
" yet"
|
|
4036
|
-
] }) : /* @__PURE__ */
|
|
4037
|
-
/* @__PURE__ */
|
|
4005
|
+
] }) : /* @__PURE__ */ r(U, { children: [
|
|
4006
|
+
/* @__PURE__ */ r("span", { className: "font-medium text-foreground/80", children: [
|
|
4038
4007
|
D,
|
|
4039
4008
|
" ",
|
|
4040
4009
|
b
|
|
4041
4010
|
] }),
|
|
4042
4011
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
4043
|
-
/* @__PURE__ */
|
|
4044
|
-
|
|
4012
|
+
/* @__PURE__ */ r("span", { children: [
|
|
4013
|
+
O,
|
|
4045
4014
|
" active"
|
|
4046
4015
|
] })
|
|
4047
4016
|
] }) })
|
|
4048
4017
|
] }),
|
|
4049
|
-
/* @__PURE__ */
|
|
4018
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
4050
4019
|
i ? (
|
|
4051
4020
|
// Auto-refresh on open; surface a quiet spinner near the count
|
|
4052
4021
|
// when a manual reload is in flight, but don't show a separate
|
|
@@ -4054,12 +4023,12 @@ function di({
|
|
|
4054
4023
|
// case without crowding the toolbar.
|
|
4055
4024
|
/* @__PURE__ */ t(de, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" })
|
|
4056
4025
|
) : null,
|
|
4057
|
-
D > 0 && d ? p && h ? /* @__PURE__ */
|
|
4058
|
-
/* @__PURE__ */ t(qe, { asChild: !0, children: /* @__PURE__ */
|
|
4026
|
+
D > 0 && d ? p && h ? /* @__PURE__ */ r(je, { children: [
|
|
4027
|
+
/* @__PURE__ */ t(qe, { asChild: !0, children: /* @__PURE__ */ r("button", { className: Ze, children: [
|
|
4059
4028
|
/* @__PURE__ */ t(be, { className: "h-3 w-3" }),
|
|
4060
4029
|
" New"
|
|
4061
4030
|
] }) }),
|
|
4062
|
-
/* @__PURE__ */
|
|
4031
|
+
/* @__PURE__ */ r(We, { align: "end", children: [
|
|
4063
4032
|
/* @__PURE__ */ t(re, { onClick: () => c("scheduled_report"), children: "Schedule a report" }),
|
|
4064
4033
|
/* @__PURE__ */ t(
|
|
4065
4034
|
re,
|
|
@@ -4069,7 +4038,7 @@ function di({
|
|
|
4069
4038
|
}
|
|
4070
4039
|
)
|
|
4071
4040
|
] })
|
|
4072
|
-
] }) : h ? /* @__PURE__ */
|
|
4041
|
+
] }) : h ? /* @__PURE__ */ r(
|
|
4073
4042
|
"button",
|
|
4074
4043
|
{
|
|
4075
4044
|
onClick: () => c("scheduled_report"),
|
|
@@ -4079,7 +4048,7 @@ function di({
|
|
|
4079
4048
|
" Schedule report"
|
|
4080
4049
|
]
|
|
4081
4050
|
}
|
|
4082
|
-
) : p ? /* @__PURE__ */
|
|
4051
|
+
) : p ? /* @__PURE__ */ r(
|
|
4083
4052
|
"button",
|
|
4084
4053
|
{
|
|
4085
4054
|
onClick: () => c("analytical_briefing"),
|
|
@@ -4092,16 +4061,16 @@ function di({
|
|
|
4092
4061
|
) : null : null
|
|
4093
4062
|
] })
|
|
4094
4063
|
] }),
|
|
4095
|
-
S ? /* @__PURE__ */
|
|
4064
|
+
S ? /* @__PURE__ */ r("div", { className: "flex items-center gap-2 border-b border-border bg-muted/60 px-4 py-2 text-[12px]", children: [
|
|
4096
4065
|
/* @__PURE__ */ t(de, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground" }),
|
|
4097
4066
|
/* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: S.name }),
|
|
4098
4067
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
4099
|
-
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children:
|
|
4068
|
+
/* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: Ta(S) })
|
|
4100
4069
|
] }) : null,
|
|
4101
|
-
/* @__PURE__ */
|
|
4070
|
+
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto", children: [
|
|
4102
4071
|
n ? /* @__PURE__ */ t("div", { className: "m-4 rounded-card border border-destructive/30 bg-destructive/10 px-3 py-2 text-[12px] text-destructive", children: n }) : null,
|
|
4103
4072
|
!i && e.length === 0 && !n ? /* @__PURE__ */ t(
|
|
4104
|
-
|
|
4073
|
+
di,
|
|
4105
4074
|
{
|
|
4106
4075
|
onNew: c,
|
|
4107
4076
|
canCreate: d,
|
|
@@ -4110,28 +4079,28 @@ function di({
|
|
|
4110
4079
|
contentKind: V
|
|
4111
4080
|
}
|
|
4112
4081
|
) : null,
|
|
4113
|
-
e.map((
|
|
4114
|
-
|
|
4082
|
+
e.map((F) => /* @__PURE__ */ t(
|
|
4083
|
+
ui,
|
|
4115
4084
|
{
|
|
4116
|
-
briefing:
|
|
4117
|
-
isOpening: y ===
|
|
4118
|
-
isBusy: N ===
|
|
4119
|
-
onOpen: () => u(
|
|
4120
|
-
onRunNow: () => m(
|
|
4121
|
-
onTogglePause: () => f(
|
|
4122
|
-
onDelete: () => g(
|
|
4085
|
+
briefing: F,
|
|
4086
|
+
isOpening: y === F.id,
|
|
4087
|
+
isBusy: N === F.id,
|
|
4088
|
+
onOpen: () => u(F.id),
|
|
4089
|
+
onRunNow: () => m(F),
|
|
4090
|
+
onTogglePause: () => f(F),
|
|
4091
|
+
onDelete: () => g(F)
|
|
4123
4092
|
},
|
|
4124
|
-
|
|
4093
|
+
F.id
|
|
4125
4094
|
))
|
|
4126
4095
|
] }),
|
|
4127
|
-
k ? /* @__PURE__ */ t("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */
|
|
4096
|
+
k ? /* @__PURE__ */ t("div", { className: "border-t border-border px-4 py-2.5", children: /* @__PURE__ */ r(
|
|
4128
4097
|
"a",
|
|
4129
4098
|
{
|
|
4130
4099
|
href: k,
|
|
4131
|
-
className: J(
|
|
4100
|
+
className: J(Ia, "h-6 px-1 text-[11px]"),
|
|
4132
4101
|
children: [
|
|
4133
4102
|
"Manage all reports & briefings",
|
|
4134
|
-
/* @__PURE__ */ t(
|
|
4103
|
+
/* @__PURE__ */ t(qr, { className: "h-3 w-3" })
|
|
4135
4104
|
]
|
|
4136
4105
|
}
|
|
4137
4106
|
) }) : null
|
|
@@ -4139,10 +4108,10 @@ function di({
|
|
|
4139
4108
|
}
|
|
4140
4109
|
);
|
|
4141
4110
|
}
|
|
4142
|
-
function
|
|
4111
|
+
function di({
|
|
4143
4112
|
onNew: e,
|
|
4144
4113
|
canCreate: a,
|
|
4145
|
-
canCreateScheduledReport:
|
|
4114
|
+
canCreateScheduledReport: s,
|
|
4146
4115
|
analyticalBriefingsEnabled: n,
|
|
4147
4116
|
contentKind: i
|
|
4148
4117
|
}) {
|
|
@@ -4153,12 +4122,12 @@ function ci({
|
|
|
4153
4122
|
title: "No briefings yet",
|
|
4154
4123
|
description: "Create an analytical briefing to monitor this dashboard and brief your team."
|
|
4155
4124
|
} : null;
|
|
4156
|
-
return /* @__PURE__ */
|
|
4157
|
-
/* @__PURE__ */ t(
|
|
4125
|
+
return /* @__PURE__ */ r("div", { className: "flex h-full flex-col items-center justify-center px-8 py-12 text-center", children: [
|
|
4126
|
+
/* @__PURE__ */ t(ci, { className: "mb-5 h-[88px] w-[112px] text-border" }),
|
|
4158
4127
|
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: (o == null ? void 0 : o.title) ?? "Have an analyst brief your team" }),
|
|
4159
4128
|
/* @__PURE__ */ t("p", { className: "mt-1.5 max-w-[320px] text-[12px] leading-5 text-muted-foreground", children: (o == null ? void 0 : o.description) ?? "Describe what to watch. An analyst digs into this dashboard and the data behind it, then briefs your team on the cadence you choose." }),
|
|
4160
|
-
a ? /* @__PURE__ */
|
|
4161
|
-
|
|
4129
|
+
a ? /* @__PURE__ */ r("div", { className: "mt-4 flex flex-wrap justify-center gap-2", children: [
|
|
4130
|
+
s ? /* @__PURE__ */ r(
|
|
4162
4131
|
"button",
|
|
4163
4132
|
{
|
|
4164
4133
|
onClick: () => e("scheduled_report"),
|
|
@@ -4173,15 +4142,15 @@ function ci({
|
|
|
4173
4142
|
"button",
|
|
4174
4143
|
{
|
|
4175
4144
|
onClick: () => e("analytical_briefing"),
|
|
4176
|
-
className:
|
|
4145
|
+
className: Ia,
|
|
4177
4146
|
children: "Create analytical briefing"
|
|
4178
4147
|
}
|
|
4179
4148
|
) : null
|
|
4180
4149
|
] }) : null
|
|
4181
4150
|
] });
|
|
4182
4151
|
}
|
|
4183
|
-
function
|
|
4184
|
-
return /* @__PURE__ */
|
|
4152
|
+
function ci({ className: e }) {
|
|
4153
|
+
return /* @__PURE__ */ r(
|
|
4185
4154
|
"svg",
|
|
4186
4155
|
{
|
|
4187
4156
|
viewBox: "0 0 112 88",
|
|
@@ -4357,17 +4326,17 @@ function ui({ className: e }) {
|
|
|
4357
4326
|
}
|
|
4358
4327
|
);
|
|
4359
4328
|
}
|
|
4360
|
-
function
|
|
4329
|
+
function ui({
|
|
4361
4330
|
briefing: e,
|
|
4362
4331
|
isOpening: a,
|
|
4363
|
-
isBusy:
|
|
4332
|
+
isBusy: s,
|
|
4364
4333
|
onOpen: n,
|
|
4365
4334
|
onRunNow: i,
|
|
4366
4335
|
onTogglePause: o,
|
|
4367
4336
|
onDelete: l
|
|
4368
4337
|
}) {
|
|
4369
|
-
const u = e.status === "PAUSED", c = e.hasActiveRun, d =
|
|
4370
|
-
return /* @__PURE__ */
|
|
4338
|
+
const u = e.status === "PAUSED", c = e.hasActiveRun, d = si(e), h = ni(e.lastRunAt), p = e.lastRunStatus, m = pe(e), f = p === "SUCCESS" ? Xe.success.dot : p === "FAILED" ? Xe.danger.dot : p ? Xe.warning.dot : Xe.neutral.dot;
|
|
4339
|
+
return /* @__PURE__ */ r(
|
|
4371
4340
|
"div",
|
|
4372
4341
|
{
|
|
4373
4342
|
className: J(
|
|
@@ -4375,7 +4344,7 @@ function hi({
|
|
|
4375
4344
|
u && "opacity-70"
|
|
4376
4345
|
),
|
|
4377
4346
|
children: [
|
|
4378
|
-
/* @__PURE__ */
|
|
4347
|
+
/* @__PURE__ */ r(
|
|
4379
4348
|
"div",
|
|
4380
4349
|
{
|
|
4381
4350
|
role: "button",
|
|
@@ -4386,26 +4355,26 @@ function hi({
|
|
|
4386
4355
|
},
|
|
4387
4356
|
className: "cursor-pointer pr-8",
|
|
4388
4357
|
children: [
|
|
4389
|
-
/* @__PURE__ */
|
|
4358
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
4390
4359
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.name }),
|
|
4391
4360
|
u ? /* @__PURE__ */ t("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: "· Paused" }) : null
|
|
4392
4361
|
] }),
|
|
4393
|
-
/* @__PURE__ */
|
|
4362
|
+
/* @__PURE__ */ r("div", { className: "mt-1 flex flex-wrap items-center gap-x-1.5 text-[11px] text-muted-foreground", children: [
|
|
4394
4363
|
/* @__PURE__ */ t("span", { children: m.typeLabel }),
|
|
4395
4364
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
4396
|
-
/* @__PURE__ */ t("span", { children:
|
|
4365
|
+
/* @__PURE__ */ t("span", { children: ii(e) }),
|
|
4397
4366
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
4398
4367
|
/* @__PURE__ */ t(Vn, { className: "h-3 w-3" }),
|
|
4399
|
-
/* @__PURE__ */ t("span", { className: "truncate", children:
|
|
4400
|
-
e.lastRunAt ? /* @__PURE__ */
|
|
4368
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: ri(e) }),
|
|
4369
|
+
e.lastRunAt ? /* @__PURE__ */ r(U, { children: [
|
|
4401
4370
|
/* @__PURE__ */ t("span", { className: "text-border", children: "·" }),
|
|
4402
|
-
/* @__PURE__ */
|
|
4371
|
+
/* @__PURE__ */ r("span", { children: [
|
|
4403
4372
|
"Last run ",
|
|
4404
4373
|
h
|
|
4405
4374
|
] })
|
|
4406
4375
|
] }) : null
|
|
4407
4376
|
] }),
|
|
4408
|
-
d || c ? /* @__PURE__ */
|
|
4377
|
+
d || c ? /* @__PURE__ */ r("div", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] leading-[1.5] text-foreground/80", children: [
|
|
4409
4378
|
c ? /* @__PURE__ */ t(de, { className: "h-3 w-3 shrink-0 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ t(
|
|
4410
4379
|
"span",
|
|
4411
4380
|
{
|
|
@@ -4415,12 +4384,12 @@ function hi({
|
|
|
4415
4384
|
)
|
|
4416
4385
|
}
|
|
4417
4386
|
),
|
|
4418
|
-
/* @__PURE__ */ t("span", { className: "truncate", children: c ?
|
|
4387
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: c ? Ta(e) : d })
|
|
4419
4388
|
] }) : null
|
|
4420
4389
|
]
|
|
4421
4390
|
}
|
|
4422
4391
|
),
|
|
4423
|
-
/* @__PURE__ */ t("div", { className: "absolute right-3 top-3", children:
|
|
4392
|
+
/* @__PURE__ */ t("div", { className: "absolute right-3 top-3", children: s ? /* @__PURE__ */ t(de, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : a ? /* @__PURE__ */ t(de, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground/70" }) : /* @__PURE__ */ r(je, { children: [
|
|
4424
4393
|
/* @__PURE__ */ t(qe, { asChild: !0, children: /* @__PURE__ */ t(
|
|
4425
4394
|
"button",
|
|
4426
4395
|
{
|
|
@@ -4428,23 +4397,23 @@ function hi({
|
|
|
4428
4397
|
onClick: (g) => g.stopPropagation(),
|
|
4429
4398
|
className: "inline-flex h-6 w-6 items-center justify-center rounded-control text-muted-foreground/70 opacity-60 hover:bg-muted hover:text-foreground/80 focus-visible:opacity-100 group-hover:opacity-100",
|
|
4430
4399
|
"aria-label": `${m.noun === "report" ? "Report" : "Briefing"} actions`,
|
|
4431
|
-
children: /* @__PURE__ */ t(
|
|
4400
|
+
children: /* @__PURE__ */ t(ha, { className: "h-3.5 w-3.5" })
|
|
4432
4401
|
}
|
|
4433
4402
|
) }),
|
|
4434
|
-
/* @__PURE__ */
|
|
4435
|
-
/* @__PURE__ */
|
|
4403
|
+
/* @__PURE__ */ r(We, { align: "end", className: "w-44", children: [
|
|
4404
|
+
/* @__PURE__ */ r(re, { onClick: n, children: [
|
|
4436
4405
|
/* @__PURE__ */ t(Vt, { className: "h-3.5 w-3.5" }),
|
|
4437
4406
|
"Edit ",
|
|
4438
4407
|
m.noun
|
|
4439
4408
|
] }),
|
|
4440
|
-
/* @__PURE__ */
|
|
4409
|
+
/* @__PURE__ */ r(
|
|
4441
4410
|
re,
|
|
4442
4411
|
{
|
|
4443
4412
|
onClick: (g) => {
|
|
4444
4413
|
g.preventDefault(), i();
|
|
4445
4414
|
},
|
|
4446
4415
|
children: [
|
|
4447
|
-
/* @__PURE__ */ t(
|
|
4416
|
+
/* @__PURE__ */ t(Bn, { className: "h-3.5 w-3.5" }),
|
|
4448
4417
|
"Run now"
|
|
4449
4418
|
]
|
|
4450
4419
|
}
|
|
@@ -4455,17 +4424,17 @@ function hi({
|
|
|
4455
4424
|
onClick: (g) => {
|
|
4456
4425
|
g.preventDefault(), o();
|
|
4457
4426
|
},
|
|
4458
|
-
children: u ? /* @__PURE__ */
|
|
4459
|
-
/* @__PURE__ */ t(
|
|
4427
|
+
children: u ? /* @__PURE__ */ r(U, { children: [
|
|
4428
|
+
/* @__PURE__ */ t(Pn, { className: "h-3.5 w-3.5" }),
|
|
4460
4429
|
"Resume"
|
|
4461
|
-
] }) : /* @__PURE__ */
|
|
4462
|
-
/* @__PURE__ */ t(
|
|
4430
|
+
] }) : /* @__PURE__ */ r(U, { children: [
|
|
4431
|
+
/* @__PURE__ */ t(_n, { className: "h-3.5 w-3.5" }),
|
|
4463
4432
|
"Pause"
|
|
4464
4433
|
] })
|
|
4465
4434
|
}
|
|
4466
4435
|
) : null,
|
|
4467
4436
|
/* @__PURE__ */ t(at, {}),
|
|
4468
|
-
/* @__PURE__ */
|
|
4437
|
+
/* @__PURE__ */ r(
|
|
4469
4438
|
re,
|
|
4470
4439
|
{
|
|
4471
4440
|
onClick: (g) => {
|
|
@@ -4485,19 +4454,19 @@ function hi({
|
|
|
4485
4454
|
}
|
|
4486
4455
|
);
|
|
4487
4456
|
}
|
|
4488
|
-
function
|
|
4457
|
+
function hi(e) {
|
|
4489
4458
|
return (e == null ? void 0 : e.trim()) || "This dashboard";
|
|
4490
4459
|
}
|
|
4491
|
-
function
|
|
4460
|
+
function mi(e) {
|
|
4492
4461
|
return e === "This dashboard" ? "Watch this dashboard" : `Watch ${e}`;
|
|
4493
4462
|
}
|
|
4494
|
-
function
|
|
4463
|
+
function pi(e, a, s) {
|
|
4495
4464
|
return a !== "dashboard" ? e : e.filter(
|
|
4496
|
-
(n) => n.source.type === "dashboard" && n.source.dashboardId ===
|
|
4465
|
+
(n) => n.source.type === "dashboard" && n.source.dashboardId === s
|
|
4497
4466
|
);
|
|
4498
4467
|
}
|
|
4499
|
-
async function
|
|
4500
|
-
const
|
|
4468
|
+
async function fi(e) {
|
|
4469
|
+
const s = [];
|
|
4501
4470
|
let n = 1, i = 0, o = Number.POSITIVE_INFINITY;
|
|
4502
4471
|
for (; i < o; ) {
|
|
4503
4472
|
const l = await e.apiClient.listBriefings(
|
|
@@ -4505,26 +4474,26 @@ async function gi(e) {
|
|
|
4505
4474
|
e.token,
|
|
4506
4475
|
{ scope: "organization", page: n, pageSize: 100 }
|
|
4507
4476
|
);
|
|
4508
|
-
if (
|
|
4477
|
+
if (s.push(...l.briefings), i += l.briefings.length, o = l.total, l.briefings.length === 0 || i >= o) break;
|
|
4509
4478
|
n += 1;
|
|
4510
4479
|
}
|
|
4511
|
-
return
|
|
4480
|
+
return s;
|
|
4512
4481
|
}
|
|
4513
|
-
const
|
|
4482
|
+
const gi = {
|
|
4514
4483
|
listBriefings: Wn,
|
|
4515
4484
|
getBriefing: qn,
|
|
4516
4485
|
pauseBriefing: jn,
|
|
4517
4486
|
resumeBriefing: $n,
|
|
4518
4487
|
deleteBriefing: Un,
|
|
4519
|
-
runBriefingNow:
|
|
4488
|
+
runBriefingNow: Rn
|
|
4520
4489
|
};
|
|
4521
|
-
function
|
|
4522
|
-
return /* @__PURE__ */ t(
|
|
4490
|
+
function ro(e) {
|
|
4491
|
+
return /* @__PURE__ */ t(On, { authToken: e.token ? { accessToken: e.token } : void 0, children: /* @__PURE__ */ t(Mn, { children: /* @__PURE__ */ t(bi, { ...e }) }) });
|
|
4523
4492
|
}
|
|
4524
|
-
function
|
|
4493
|
+
function bi({
|
|
4525
4494
|
dashboardId: e,
|
|
4526
4495
|
dashboardTitle: a,
|
|
4527
|
-
apiServiceUrl:
|
|
4496
|
+
apiServiceUrl: s,
|
|
4528
4497
|
token: n,
|
|
4529
4498
|
disabled: i,
|
|
4530
4499
|
className: o,
|
|
@@ -4536,54 +4505,54 @@ function xi({
|
|
|
4536
4505
|
openRun: p,
|
|
4537
4506
|
client: m
|
|
4538
4507
|
}) {
|
|
4539
|
-
const { authToken: f, tokenProps: g } = $e(), y =
|
|
4540
|
-
u === void 0 && V(
|
|
4541
|
-
}, [
|
|
4508
|
+
const { authToken: f, tokenProps: g } = $e(), y = zn(), N = !h || y.canCreate && (h === "scheduled_report" || y.analyticalBriefingsEnabled), [k, V] = E(!1), B = u ?? k, D = (A) => {
|
|
4509
|
+
u === void 0 && V(A), c == null || c(A);
|
|
4510
|
+
}, [O, b] = E(
|
|
4542
4511
|
h ? "author" : "list"
|
|
4543
|
-
), [S, v] =
|
|
4512
|
+
), [S, v] = E(
|
|
4544
4513
|
h ?? "analytical_briefing"
|
|
4545
|
-
), [T,
|
|
4514
|
+
), [T, F] = E("dashboard"), [H, P] = E(
|
|
4546
4515
|
[]
|
|
4547
|
-
), [Q, X] =
|
|
4516
|
+
), [Q, X] = E(null), _ = h && !N && !Q ? "list" : O, [te, Z] = E(!1), [G, I] = E(null), [ae, j] = E(null), [z, ne] = E(
|
|
4548
4517
|
null
|
|
4549
|
-
), [ue, he] =
|
|
4518
|
+
), [ue, he] = E(null), ye = et(null), x = et(B);
|
|
4550
4519
|
Ee(() => {
|
|
4551
|
-
const
|
|
4552
|
-
x.current =
|
|
4553
|
-
}, [
|
|
4554
|
-
const
|
|
4520
|
+
const A = B && !x.current;
|
|
4521
|
+
x.current = B, !(!A || !h) && (X(null), F("dashboard"), v(h), b("author"), he(null));
|
|
4522
|
+
}, [B, h]);
|
|
4523
|
+
const R = Lt(), $ = s ?? (g == null ? void 0 : g.apiServiceUrl), K = n ?? (f == null ? void 0 : f.accessToken), le = Y(() => ({ ...gi, ...m }), [m]), [_e, ht] = E(null);
|
|
4555
4524
|
Ee(() => {
|
|
4556
4525
|
if (!p || !$ || !K) return;
|
|
4557
|
-
let
|
|
4526
|
+
let A = !0;
|
|
4558
4527
|
return le.getBriefing($, K, p.briefingId).then(({ briefing: W }) => {
|
|
4559
|
-
|
|
4528
|
+
A && (X(W), ht(p), b("author"));
|
|
4560
4529
|
}, (W) => {
|
|
4561
|
-
|
|
4530
|
+
A && M.error(W instanceof Error ? W.message : "Could not open the run.");
|
|
4562
4531
|
}), () => {
|
|
4563
|
-
|
|
4532
|
+
A = !1;
|
|
4564
4533
|
};
|
|
4565
4534
|
}, [p, $, K, le]);
|
|
4566
|
-
const Fe =
|
|
4567
|
-
const
|
|
4535
|
+
const Fe = hi(a), He = Y(() => {
|
|
4536
|
+
const A = pi(
|
|
4568
4537
|
H,
|
|
4569
4538
|
T,
|
|
4570
4539
|
e
|
|
4571
4540
|
);
|
|
4572
4541
|
if (!h)
|
|
4573
|
-
return
|
|
4542
|
+
return A;
|
|
4574
4543
|
const W = h === "scheduled_report" ? "report" : "briefing";
|
|
4575
|
-
return
|
|
4544
|
+
return A.filter(
|
|
4576
4545
|
(Ge) => pe(Ge).noun === W
|
|
4577
4546
|
);
|
|
4578
4547
|
}, [e, H, T, h]), mt = Y(() => T === "dashboard" ? {
|
|
4579
4548
|
source: { type: "dashboard", dashboardId: e },
|
|
4580
4549
|
label: Fe,
|
|
4581
|
-
detail:
|
|
4550
|
+
detail: mi(Fe)
|
|
4582
4551
|
} : {
|
|
4583
4552
|
source: { type: "project" },
|
|
4584
4553
|
label: "This project",
|
|
4585
4554
|
detail: "Use any data in this project."
|
|
4586
|
-
}, [e, Fe, T]),
|
|
4555
|
+
}, [e, Fe, T]), Oe = !!($ && K), Me = jr({
|
|
4587
4556
|
canCreate: y.canCreate,
|
|
4588
4557
|
analyticalBriefingsEnabled: y.analyticalBriefingsEnabled,
|
|
4589
4558
|
scheduledReportAvailable: T === "dashboard"
|
|
@@ -4591,16 +4560,16 @@ function xi({
|
|
|
4591
4560
|
if (!(!$ || !K)) {
|
|
4592
4561
|
Z(!0), he(null);
|
|
4593
4562
|
try {
|
|
4594
|
-
|
|
4595
|
-
await
|
|
4563
|
+
P(
|
|
4564
|
+
await fi({
|
|
4596
4565
|
apiClient: le,
|
|
4597
4566
|
apiServiceUrl: $,
|
|
4598
4567
|
token: K
|
|
4599
4568
|
})
|
|
4600
4569
|
);
|
|
4601
|
-
} catch (
|
|
4570
|
+
} catch (A) {
|
|
4602
4571
|
he(
|
|
4603
|
-
|
|
4572
|
+
A instanceof Error ? A.message : "Could not load briefings."
|
|
4604
4573
|
);
|
|
4605
4574
|
} finally {
|
|
4606
4575
|
Z(!1);
|
|
@@ -4608,20 +4577,20 @@ function xi({
|
|
|
4608
4577
|
}
|
|
4609
4578
|
}, [le, $, K]);
|
|
4610
4579
|
Ee(() => {
|
|
4611
|
-
!
|
|
4612
|
-
}, [
|
|
4613
|
-
const
|
|
4614
|
-
X(null),
|
|
4615
|
-
}, C = (
|
|
4616
|
-
X(null), v(
|
|
4617
|
-
}, q = async (
|
|
4580
|
+
!B || _ !== "list" || !Oe || ce();
|
|
4581
|
+
}, [Oe, _, ce, B]);
|
|
4582
|
+
const ze = () => {
|
|
4583
|
+
X(null), F("dashboard"), b("list"), D(!0);
|
|
4584
|
+
}, C = (A) => {
|
|
4585
|
+
X(null), v(A), b("author");
|
|
4586
|
+
}, q = async (A) => {
|
|
4618
4587
|
if (!(!$ || !K)) {
|
|
4619
|
-
I(
|
|
4588
|
+
I(A), he(null);
|
|
4620
4589
|
try {
|
|
4621
4590
|
const W = await le.getBriefing(
|
|
4622
4591
|
$,
|
|
4623
4592
|
K,
|
|
4624
|
-
|
|
4593
|
+
A
|
|
4625
4594
|
);
|
|
4626
4595
|
X(W.briefing), b("author");
|
|
4627
4596
|
} catch (W) {
|
|
@@ -4632,17 +4601,17 @@ function xi({
|
|
|
4632
4601
|
I(null);
|
|
4633
4602
|
}
|
|
4634
4603
|
}
|
|
4635
|
-
}, ee = async (
|
|
4604
|
+
}, ee = async (A) => {
|
|
4636
4605
|
if (!(!$ || !K)) {
|
|
4637
|
-
j(
|
|
4606
|
+
j(A.id);
|
|
4638
4607
|
try {
|
|
4639
4608
|
const W = await le.runBriefingNow(
|
|
4640
4609
|
$,
|
|
4641
4610
|
K,
|
|
4642
|
-
|
|
4643
|
-
{ requestId:
|
|
4611
|
+
A.id,
|
|
4612
|
+
{ requestId: xi() }
|
|
4644
4613
|
);
|
|
4645
|
-
|
|
4614
|
+
R.track({ kind: "briefing", id: W.run.id, title: A.name, briefingId: A.id }), ce();
|
|
4646
4615
|
} catch (W) {
|
|
4647
4616
|
M.error(
|
|
4648
4617
|
W instanceof Error ? W.message : "Could not start the run."
|
|
@@ -4651,19 +4620,19 @@ function xi({
|
|
|
4651
4620
|
j(null);
|
|
4652
4621
|
}
|
|
4653
4622
|
}
|
|
4654
|
-
}, me = async (
|
|
4623
|
+
}, me = async (A) => {
|
|
4655
4624
|
if (!$ || !K) return;
|
|
4656
|
-
const { noun: W } = pe(
|
|
4657
|
-
j(
|
|
4625
|
+
const { noun: W } = pe(A), Ge = W === "report" ? "Report" : "Briefing";
|
|
4626
|
+
j(A.id);
|
|
4658
4627
|
try {
|
|
4659
|
-
const Ye =
|
|
4628
|
+
const Ye = A.status === "PAUSED" ? await le.resumeBriefing(
|
|
4660
4629
|
$,
|
|
4661
4630
|
K,
|
|
4662
|
-
|
|
4631
|
+
A.id
|
|
4663
4632
|
) : await le.pauseBriefing(
|
|
4664
4633
|
$,
|
|
4665
4634
|
K,
|
|
4666
|
-
|
|
4635
|
+
A.id
|
|
4667
4636
|
);
|
|
4668
4637
|
M.success(
|
|
4669
4638
|
Ye.briefing.status === "PAUSED" ? `${Ge} paused` : `${Ge} resumed`
|
|
@@ -4676,16 +4645,16 @@ function xi({
|
|
|
4676
4645
|
j(null);
|
|
4677
4646
|
}
|
|
4678
4647
|
}, Ne = async () => {
|
|
4679
|
-
if (!
|
|
4680
|
-
const
|
|
4681
|
-
j(
|
|
4648
|
+
if (!z || !$ || !K) return;
|
|
4649
|
+
const A = z;
|
|
4650
|
+
j(A.id);
|
|
4682
4651
|
try {
|
|
4683
4652
|
await le.deleteBriefing(
|
|
4684
4653
|
$,
|
|
4685
4654
|
K,
|
|
4686
|
-
|
|
4655
|
+
A.id
|
|
4687
4656
|
);
|
|
4688
|
-
const { noun: W } = pe(
|
|
4657
|
+
const { noun: W } = pe(A);
|
|
4689
4658
|
M.success(`${W === "report" ? "Report" : "Briefing"} deleted`), ne(null), ce();
|
|
4690
4659
|
} catch (W) {
|
|
4691
4660
|
M.error(
|
|
@@ -4694,35 +4663,35 @@ function xi({
|
|
|
4694
4663
|
} finally {
|
|
4695
4664
|
j(null);
|
|
4696
4665
|
}
|
|
4697
|
-
},
|
|
4698
|
-
return y.surfaceVisible ? /* @__PURE__ */
|
|
4666
|
+
}, La = He.length;
|
|
4667
|
+
return y.surfaceVisible ? /* @__PURE__ */ r(Qn, { open: B, onOpenChange: D, children: [
|
|
4699
4668
|
d ? null : /* @__PURE__ */ t(
|
|
4700
|
-
|
|
4669
|
+
ei,
|
|
4701
4670
|
{
|
|
4702
|
-
disabled: i || !
|
|
4703
|
-
briefingCount:
|
|
4671
|
+
disabled: i || !Oe,
|
|
4672
|
+
briefingCount: La,
|
|
4704
4673
|
className: o,
|
|
4705
|
-
onClick:
|
|
4674
|
+
onClick: ze
|
|
4706
4675
|
}
|
|
4707
4676
|
),
|
|
4708
|
-
/* @__PURE__ */
|
|
4677
|
+
/* @__PURE__ */ r(
|
|
4709
4678
|
Kn,
|
|
4710
4679
|
{
|
|
4711
4680
|
ref: ye,
|
|
4712
4681
|
side: "right",
|
|
4713
4682
|
hideClose: !0,
|
|
4714
4683
|
className: "flex h-full w-full flex-col overflow-hidden p-0 outline-none sm:max-w-[560px]",
|
|
4715
|
-
onOpenAutoFocus: (
|
|
4684
|
+
onOpenAutoFocus: (A) => {
|
|
4716
4685
|
var W;
|
|
4717
|
-
|
|
4686
|
+
A.preventDefault(), (W = ye.current) == null || W.focus({ preventScroll: !0 });
|
|
4718
4687
|
},
|
|
4719
4688
|
children: [
|
|
4720
|
-
/* @__PURE__ */
|
|
4689
|
+
/* @__PURE__ */ r(Hn, { className: "sr-only", children: [
|
|
4721
4690
|
/* @__PURE__ */ t(Gn, { children: "Reports & briefings" }),
|
|
4722
4691
|
/* @__PURE__ */ t(Yn, { children: "Manage reports and briefings for this dashboard." })
|
|
4723
4692
|
] }),
|
|
4724
|
-
h ? /* @__PURE__ */
|
|
4725
|
-
/* @__PURE__ */
|
|
4693
|
+
h ? /* @__PURE__ */ r("div", { className: "flex shrink-0 items-start justify-between gap-3 border-b border-border pl-4 pr-3 pt-2", children: [
|
|
4694
|
+
/* @__PURE__ */ r(
|
|
4726
4695
|
"div",
|
|
4727
4696
|
{
|
|
4728
4697
|
className: "flex items-center gap-5",
|
|
@@ -4734,15 +4703,15 @@ function xi({
|
|
|
4734
4703
|
{
|
|
4735
4704
|
type: "button",
|
|
4736
4705
|
role: "tab",
|
|
4737
|
-
"aria-selected":
|
|
4706
|
+
"aria-selected": _ === "author",
|
|
4738
4707
|
disabled: !N,
|
|
4739
4708
|
className: J(
|
|
4740
4709
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
4741
|
-
|
|
4710
|
+
_ === "author" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground",
|
|
4742
4711
|
!N && "cursor-not-allowed opacity-50"
|
|
4743
4712
|
),
|
|
4744
4713
|
onClick: () => {
|
|
4745
|
-
N && (X(null), v(h),
|
|
4714
|
+
N && (X(null), v(h), F("dashboard"), b("author"));
|
|
4746
4715
|
},
|
|
4747
4716
|
children: Q ? `Edit ${pe(Q).noun}` : h === "scheduled_report" ? "Schedule report" : "Create briefing"
|
|
4748
4717
|
}
|
|
@@ -4752,10 +4721,10 @@ function xi({
|
|
|
4752
4721
|
{
|
|
4753
4722
|
type: "button",
|
|
4754
4723
|
role: "tab",
|
|
4755
|
-
"aria-selected":
|
|
4724
|
+
"aria-selected": _ === "list",
|
|
4756
4725
|
className: J(
|
|
4757
4726
|
"-mb-px border-b-2 px-0.5 pb-2 text-[12px] transition-colors",
|
|
4758
|
-
|
|
4727
|
+
_ === "list" ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"
|
|
4759
4728
|
),
|
|
4760
4729
|
onClick: () => b("list"),
|
|
4761
4730
|
children: h === "scheduled_report" ? "Manage reports" : "Manage briefings"
|
|
@@ -4775,18 +4744,18 @@ function xi({
|
|
|
4775
4744
|
}
|
|
4776
4745
|
)
|
|
4777
4746
|
] }) : null,
|
|
4778
|
-
|
|
4779
|
-
|
|
4747
|
+
_ === "list" ? /* @__PURE__ */ t(
|
|
4748
|
+
li,
|
|
4780
4749
|
{
|
|
4781
4750
|
briefings: He,
|
|
4782
4751
|
dashboardLabel: Fe,
|
|
4783
4752
|
sourceView: T,
|
|
4784
4753
|
error: ue,
|
|
4785
4754
|
loading: te,
|
|
4786
|
-
onSourceViewChange:
|
|
4755
|
+
onSourceViewChange: F,
|
|
4787
4756
|
onClose: () => D(!1),
|
|
4788
|
-
onEdit: (
|
|
4789
|
-
q(
|
|
4757
|
+
onEdit: (A) => {
|
|
4758
|
+
q(A);
|
|
4790
4759
|
},
|
|
4791
4760
|
onNew: C,
|
|
4792
4761
|
canCreate: !h && Me.length > 0,
|
|
@@ -4796,13 +4765,13 @@ function xi({
|
|
|
4796
4765
|
analyticalBriefingsEnabled: Me.includes(
|
|
4797
4766
|
"analytical_briefing"
|
|
4798
4767
|
),
|
|
4799
|
-
onRunNow: (
|
|
4800
|
-
ee(
|
|
4768
|
+
onRunNow: (A) => {
|
|
4769
|
+
ee(A);
|
|
4801
4770
|
},
|
|
4802
|
-
onTogglePause: (
|
|
4803
|
-
me(
|
|
4771
|
+
onTogglePause: (A) => {
|
|
4772
|
+
me(A);
|
|
4804
4773
|
},
|
|
4805
|
-
onDelete: (
|
|
4774
|
+
onDelete: (A) => ne(A),
|
|
4806
4775
|
selectingId: G,
|
|
4807
4776
|
busyId: ae,
|
|
4808
4777
|
manageBriefingsHref: l,
|
|
@@ -4815,7 +4784,7 @@ function xi({
|
|
|
4815
4784
|
apiServiceUrl: $,
|
|
4816
4785
|
token: K,
|
|
4817
4786
|
briefing: Q,
|
|
4818
|
-
initialRunId:
|
|
4787
|
+
initialRunId: _e && (Q == null ? void 0 : Q.id) === _e.briefingId ? _e.runId : void 0,
|
|
4819
4788
|
intent: S,
|
|
4820
4789
|
sourceContext: Q ? void 0 : mt,
|
|
4821
4790
|
title: Q ? `Edit ${pe(Q).noun}` : S === "scheduled_report" ? "Schedule report" : "Create analytical briefing",
|
|
@@ -4824,13 +4793,13 @@ function xi({
|
|
|
4824
4793
|
onBack: h ? void 0 : () => b("list"),
|
|
4825
4794
|
onCancel: () => D(!1),
|
|
4826
4795
|
onDeleted: () => {
|
|
4827
|
-
const
|
|
4828
|
-
M.success(`${
|
|
4796
|
+
const A = Q ? pe(Q).noun : "briefing";
|
|
4797
|
+
M.success(`${A === "report" ? "Report" : "Briefing"} deleted`), X(null), b("list"), ce();
|
|
4829
4798
|
},
|
|
4830
4799
|
onRunStarted: () => {
|
|
4831
4800
|
},
|
|
4832
|
-
onSaved: (
|
|
4833
|
-
X(
|
|
4801
|
+
onSaved: (A) => {
|
|
4802
|
+
X(A), ce();
|
|
4834
4803
|
},
|
|
4835
4804
|
onMinimizeRun: () => {
|
|
4836
4805
|
D(!1);
|
|
@@ -4843,35 +4812,35 @@ function xi({
|
|
|
4843
4812
|
/* @__PURE__ */ t(
|
|
4844
4813
|
wt,
|
|
4845
4814
|
{
|
|
4846
|
-
open: !!
|
|
4847
|
-
onOpenChange: (
|
|
4848
|
-
|
|
4815
|
+
open: !!z,
|
|
4816
|
+
onOpenChange: (A) => {
|
|
4817
|
+
A || ne(null);
|
|
4849
4818
|
},
|
|
4850
|
-
children: /* @__PURE__ */
|
|
4851
|
-
/* @__PURE__ */
|
|
4852
|
-
/* @__PURE__ */
|
|
4819
|
+
children: /* @__PURE__ */ r(St, { children: [
|
|
4820
|
+
/* @__PURE__ */ r(kt, { children: [
|
|
4821
|
+
/* @__PURE__ */ r(Dt, { children: [
|
|
4853
4822
|
"Delete",
|
|
4854
4823
|
" ",
|
|
4855
|
-
|
|
4824
|
+
z ? pe(z).noun : "briefing",
|
|
4856
4825
|
"?"
|
|
4857
4826
|
] }),
|
|
4858
|
-
/* @__PURE__ */
|
|
4827
|
+
/* @__PURE__ */ r(At, { children: [
|
|
4859
4828
|
"This permanently deletes ",
|
|
4860
|
-
/* @__PURE__ */ t("strong", { children:
|
|
4829
|
+
/* @__PURE__ */ t("strong", { children: z == null ? void 0 : z.name }),
|
|
4861
4830
|
". Recipients will stop receiving it."
|
|
4862
4831
|
] })
|
|
4863
4832
|
] }),
|
|
4864
|
-
/* @__PURE__ */
|
|
4833
|
+
/* @__PURE__ */ r(Ft, { children: [
|
|
4865
4834
|
/* @__PURE__ */ t(Et, { children: "Cancel" }),
|
|
4866
|
-
/* @__PURE__ */
|
|
4867
|
-
|
|
4835
|
+
/* @__PURE__ */ r(
|
|
4836
|
+
ua,
|
|
4868
4837
|
{
|
|
4869
4838
|
className: "bg-destructive/90 hover:bg-destructive",
|
|
4870
4839
|
onClick: Ne,
|
|
4871
4840
|
children: [
|
|
4872
4841
|
"Delete",
|
|
4873
4842
|
" ",
|
|
4874
|
-
|
|
4843
|
+
z ? pe(z).noun : "briefing"
|
|
4875
4844
|
]
|
|
4876
4845
|
}
|
|
4877
4846
|
)
|
|
@@ -4881,30 +4850,28 @@ function xi({
|
|
|
4881
4850
|
)
|
|
4882
4851
|
] }) : null;
|
|
4883
4852
|
}
|
|
4884
|
-
function
|
|
4853
|
+
function xi() {
|
|
4885
4854
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `briefing-run-now-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
4886
4855
|
}
|
|
4887
4856
|
export {
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
Ki as
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
ao as
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
lo as n,
|
|
4909
|
-
Qi as u
|
|
4857
|
+
Qi as A,
|
|
4858
|
+
Gi as D,
|
|
4859
|
+
Hi as S,
|
|
4860
|
+
Xi as U,
|
|
4861
|
+
ji as V,
|
|
4862
|
+
ei as W,
|
|
4863
|
+
Wi as a,
|
|
4864
|
+
Ki as b,
|
|
4865
|
+
Yi as c,
|
|
4866
|
+
Zi as d,
|
|
4867
|
+
fs as e,
|
|
4868
|
+
bs as f,
|
|
4869
|
+
Cs as g,
|
|
4870
|
+
eo as h,
|
|
4871
|
+
Ji as i,
|
|
4872
|
+
ao as j,
|
|
4873
|
+
to as k,
|
|
4874
|
+
no as l,
|
|
4875
|
+
ro as m,
|
|
4876
|
+
qi as u
|
|
4910
4877
|
};
|