react-semaphor 0.0.565 → 0.0.567
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{dashboard-plus-CJI9Flj6.js → dashboard-plus-0Rn87MhT.js} +543 -555
- package/dist/chunks/{dashboard-plus-CxIpiHa-.js → dashboard-plus-ByzYCkhZ.js} +2 -2
- package/dist/chunks/{index-DAHFzWxM.js → index-D8xxFA1P.js} +146 -146
- package/dist/chunks/{index-CEZuyo_5.js → index-DAzFInix.js} +14203 -14088
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +10 -2
- package/package.json +2 -2
|
@@ -4,9 +4,9 @@ var ir = (t) => {
|
|
|
4
4
|
var La = (t, a, n) => a.has(t) || ir("Cannot " + n);
|
|
5
5
|
var we = (t, a, n) => (La(t, a, "read from private field"), n ? n.call(t) : a.get(t)), dn = (t, a, n) => a.has(t) ? ir("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(t) : a.set(t, n), un = (t, a, n, r) => (La(t, a, "write to private field"), r ? r.call(t, n) : a.set(t, n), n), mn = (t, a, n) => (La(t, a, "access private method"), n);
|
|
6
6
|
import { jsxs as s, jsx as e, Fragment as ne } from "react/jsx-runtime";
|
|
7
|
-
import { E as Oi, F as Ai, G as or, H as Ii, I as _r, J as Ge, K as Ri, L as zi, M as J, N as cs, w as W, A as xt, O as Te, P as Jt, Q as Vr, R as
|
|
7
|
+
import { E as Oi, F as Ai, G as or, H as Ii, I as _r, J as Ge, K as Ri, L as zi, M as J, N as cs, w as W, A as xt, O as Te, P as Jt, Q as Vr, R as j, T as Le, U as Kt, V as Wt, W as Qt, X as Zt, Y as Z, Z as je, _ as pn, $ as Nn, a0 as Cn, a1 as ce, a2 as wn, a3 as jr, a4 as fn, a5 as Fi, a6 as cr, a7 as Ur, a8 as H, a9 as ds, aa as Ie, ab as Li, ac as ge, ad as ye, ae as ve, af as xe, ag as Ut, ah as Bt, ai as te, aj as Br, ak as it, al as ot, am as Pi, an as tn, ao as Dt, ap as _t, aq as Be, ar as qe, as as Ye, at, au as us, av as Gn, aw as Hn, ax as $r, ay as bt, az as gn, aA as Sn, aB as Qe, aC as Ne, aD as We, aE as ms, aF as _i, aG as ma, aH as qr, aI as tt, aJ as Yr, aK as yn, aL as hs, aM as Gr, aN as Re, aO as le, aP as Ce, aQ as kn, aR as ct, aS as Dn, aT as Vi, aU as Vt, aV as rt, aW as Jn, aX as Mn, aY as Ln, aZ as ps, a_ as Pn, a$ as dt, b0 as nn, b1 as Kn, b2 as Wn, b3 as Hr, b4 as an, b5 as fs, b6 as gs, b7 as ys, b8 as vs, b9 as Tn, ba as Qn, bb as Jr, bc as xs, bd as wa, be as bs, bf as ji, bg as Ns, bh as Ui, bi as Bi, bj as sn, bk as rn, bl as Fe, bm as At, bn as Kr, C as se, bo as Xt, B as T, bp as Wr, bq as Qr, br as Zr, bs as Xr, bt as el, bu as tl, bv as nl, bw as al, bx as $i, by as qi, bz as ha, bA as Cs, bB as Yi, bC as Gi, bD as Hi, bE as sl, bF as ws, bG as En, bH as Zn, bI as Xn, bJ as ea, bK as ta, bL as $t, bM as On, bN as Rt, v as ut, bO as Ss, m as rl, l as ll, f as nt, bP as Ji, g as pt, bQ as Ki, h as en, j as ft, k as Wi, bR as Qi, bS as Zi, bT as zt, bU as It, bV as il, bW as Xi, e as ol, bX as _n, bY as Mt, bZ as eo, b_ as Ha, b$ as ks, c0 as na, c1 as yt, c2 as cl, r as pa, q as dr, c3 as ze, c4 as oa, c5 as dl, c6 as to, c7 as no, c8 as ao, c9 as ul, ca as so, cb as Sa, cc as ro, cd as vn, ce as lo, cf as Ja, cg as Tt, ch as Ve, ci as Et, cj as io, ck as oo, cl as co, cm as uo, cn as mo, co as Pa, cp as ho, cq as ur, cr as po, cs as mr, ct as fo, cu as go, cv as yo, cw as vo, cx as Ds, cy as xo, cz as ml, cA as Ms, cB as bo, cC as hl, cD as ca, cE as pl, cF as No, cG as Co, cH as fa, cI as wo, cJ as fl, cK as So, cL as ko, cM as hr, cN as Do, cO as aa, cP as Ts, cQ as gl, cR as Mo, cS as To, cT as Eo, cU as yl, cV as Es, cW as vl, cX as Oo, cY as pr, cZ as ka, c_ as Da, c$ as Ma, d0 as Ao, d1 as Io, d2 as Ro, d3 as zo, d4 as Nt, d5 as Se, d6 as ke, d7 as De, d8 as Fo, d9 as Lo, da as Po, db as _o, s as Vo, dc as fr, dd as xl, de as jo, df as Uo, dg as Bo, dh as bl, di as Os, dj as An, dk as As, dl as Ft, dm as $o, dn as Ta, dp as Nl, dq as qo, dr as Yo, ds as Go, dt as Ho, du as Jo, dv as gr, dw as Ko, dx as Wo, dy as Qo, dz as Zo, dA as Xo, dB as ec, dC as tc, dD as Cl, dE as nc, dF as ac, dG as sc, dH as rc, dI as lc, dJ as Is, dK as _a, dL as yr, dM as ic, dN as oc, dO as Ka, dP as st, dQ as Ea, dR as cc, dS as dc, dT as vr, dU as uc, dV as Wa, dW as wl, dX as Rs, dY as mc, dZ as hc, d_ as Vn, d$ as Qa, e0 as pc, e1 as fc, e2 as Za, e3 as Xa, e4 as ga, e5 as xn, e6 as jn, e7 as gc, e8 as yc, e9 as Sl, ea as vc, eb as xc, S as bc, ec as Nc, ed as Cc, ee as wc } from "./index-DAzFInix.js";
|
|
8
8
|
import * as He from "react";
|
|
9
|
-
import Oe, { useState as
|
|
9
|
+
import Oe, { useState as V, useCallback as me, useEffect as Me, useRef as lt, useMemo as Ue, Suspense as kl, useContext as Sc } from "react";
|
|
10
10
|
import "react-dom";
|
|
11
11
|
var St, kt, $e, ht, gt, da, es, Pr, kc = (Pr = class extends Oi {
|
|
12
12
|
constructor(a, n) {
|
|
@@ -1323,7 +1323,7 @@ async function kd(t, a) {
|
|
|
1323
1323
|
}) : null;
|
|
1324
1324
|
}
|
|
1325
1325
|
function Dd() {
|
|
1326
|
-
const [t, a] =
|
|
1326
|
+
const [t, a] = V(""), [n, r] = V(!1), l = W((p) => p.lenses), { setLenses: i, setSelectedLensId: c } = xt(), [o, d] = V(!1), [m, u] = V(!1), h = W((p) => p.dashboard), f = W((p) => p.filterValues), { authToken: g } = Te();
|
|
1327
1327
|
async function v() {
|
|
1328
1328
|
d(!0);
|
|
1329
1329
|
const p = ns(
|
|
@@ -1338,13 +1338,13 @@ function Dd() {
|
|
|
1338
1338
|
}
|
|
1339
1339
|
return /* @__PURE__ */ s(Jt, { open: m, onOpenChange: u, children: [
|
|
1340
1340
|
/* @__PURE__ */ e(Vr, { asChild: !0, children: /* @__PURE__ */ s(
|
|
1341
|
-
|
|
1341
|
+
j,
|
|
1342
1342
|
{
|
|
1343
1343
|
variant: "secondary",
|
|
1344
1344
|
className: "h-7 p-2",
|
|
1345
1345
|
size: "sm",
|
|
1346
1346
|
children: [
|
|
1347
|
-
/* @__PURE__ */ e(
|
|
1347
|
+
/* @__PURE__ */ e(Le, { className: "mr-2 h-4 w-4" }),
|
|
1348
1348
|
"Lens"
|
|
1349
1349
|
]
|
|
1350
1350
|
}
|
|
@@ -1370,7 +1370,7 @@ function Dd() {
|
|
|
1370
1370
|
] }) }),
|
|
1371
1371
|
n && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
1372
1372
|
/* @__PURE__ */ e(pn, { children: /* @__PURE__ */ e(
|
|
1373
|
-
|
|
1373
|
+
j,
|
|
1374
1374
|
{
|
|
1375
1375
|
size: "sm",
|
|
1376
1376
|
variant: "outline",
|
|
@@ -1384,7 +1384,7 @@ function Dd() {
|
|
|
1384
1384
|
] });
|
|
1385
1385
|
}
|
|
1386
1386
|
function Md() {
|
|
1387
|
-
const [t, a] =
|
|
1387
|
+
const [t, a] = V(!1), n = W((u) => u.lenses), r = W((u) => u.selectedLensId), { setLenses: l, setSelectedLensId: i } = xt(), { authToken: c } = Te();
|
|
1388
1388
|
async function o(u) {
|
|
1389
1389
|
i(u);
|
|
1390
1390
|
}
|
|
@@ -1576,7 +1576,7 @@ function Od({
|
|
|
1576
1576
|
status: l,
|
|
1577
1577
|
error: i,
|
|
1578
1578
|
isDeleting: c
|
|
1579
|
-
} = Ad(), [o, d] =
|
|
1579
|
+
} = Ad(), [o, d] = V(""), [m, u] = V(Sr[0].value), [h, f] = V("06:00"), [g, v] = V("");
|
|
1580
1580
|
return /* @__PURE__ */ e(Br, { delayDuration: 0, children: /* @__PURE__ */ s(it, { children: [
|
|
1581
1581
|
/* @__PURE__ */ e(ot, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1582
1582
|
ce,
|
|
@@ -1646,7 +1646,7 @@ function Od({
|
|
|
1646
1646
|
)
|
|
1647
1647
|
] }),
|
|
1648
1648
|
/* @__PURE__ */ e("div", { className: "mt-2 flex justify-end", children: /* @__PURE__ */ s(
|
|
1649
|
-
|
|
1649
|
+
j,
|
|
1650
1650
|
{
|
|
1651
1651
|
onClick: async () => {
|
|
1652
1652
|
await n({
|
|
@@ -1724,7 +1724,7 @@ const kr = ({
|
|
|
1724
1724
|
/* @__PURE__ */ e(Ye, { children: a })
|
|
1725
1725
|
] }) });
|
|
1726
1726
|
function Ad() {
|
|
1727
|
-
const [t, a] =
|
|
1727
|
+
const [t, a] = V("idle"), [n, r] = V(""), [l, i] = V(null), c = W((M) => M.authToken), o = W((M) => M.dashboard.id), d = W((M) => M.dashboard.title), { endUserId: m } = $r((c == null ? void 0 : c.accessToken) || ""), u = "https://semaphor.cloud/api/v1/subscriptions/get", h = {
|
|
1728
1728
|
dashboardId: o,
|
|
1729
1729
|
endUserId: m
|
|
1730
1730
|
}, { data: f, isLoading: g, isError: v, isFetching: p, refetch: x } = bt({
|
|
@@ -1733,18 +1733,18 @@ function Ad() {
|
|
|
1733
1733
|
enabled: !!(c != null && c.accessToken) && !!o && !!m
|
|
1734
1734
|
});
|
|
1735
1735
|
async function y({
|
|
1736
|
-
email:
|
|
1736
|
+
email: M,
|
|
1737
1737
|
subject: F,
|
|
1738
1738
|
frequency: E,
|
|
1739
1739
|
time: k
|
|
1740
1740
|
}) {
|
|
1741
1741
|
const { authToken: b, ...D } = Fl(), N = Intl.DateTimeFormat().resolvedOptions().timeZone, I = {
|
|
1742
|
-
email:
|
|
1742
|
+
email: M,
|
|
1743
1743
|
frequency: E,
|
|
1744
1744
|
time: k,
|
|
1745
1745
|
timezone: N,
|
|
1746
1746
|
endUserId: m,
|
|
1747
|
-
endUserEmail:
|
|
1747
|
+
endUserEmail: M,
|
|
1748
1748
|
subject: F || d || "Scheduled Dashboard",
|
|
1749
1749
|
dashboardId: o,
|
|
1750
1750
|
dashboardParams: D
|
|
@@ -1766,11 +1766,11 @@ function Ad() {
|
|
|
1766
1766
|
console.error(z), a("error"), r(z.message);
|
|
1767
1767
|
}
|
|
1768
1768
|
}
|
|
1769
|
-
async function w(
|
|
1769
|
+
async function w(M) {
|
|
1770
1770
|
const F = "https://semaphor.cloud/api/v1/subscriptions/delete";
|
|
1771
|
-
i(
|
|
1771
|
+
i(M);
|
|
1772
1772
|
try {
|
|
1773
|
-
await gn(F, (c == null ? void 0 : c.accessToken) || "", { id:
|
|
1773
|
+
await gn(F, (c == null ? void 0 : c.accessToken) || "", { id: M }), x(), setTimeout(() => {
|
|
1774
1774
|
i(null);
|
|
1775
1775
|
}, 2e3);
|
|
1776
1776
|
} catch (E) {
|
|
@@ -2169,7 +2169,7 @@ function Wd(t, a) {
|
|
|
2169
2169
|
return Kd(ue.VISUAL, t, a);
|
|
2170
2170
|
}
|
|
2171
2171
|
function _l() {
|
|
2172
|
-
const [t, a] =
|
|
2172
|
+
const [t, a] = V(/* @__PURE__ */ new Map()), n = me((i, c) => {
|
|
2173
2173
|
a((o) => {
|
|
2174
2174
|
const d = new Map(o), m = new Set(d.get(i) || []);
|
|
2175
2175
|
return c ? m.add(c) : (m.add("title"), m.add("description")), d.set(i, m), d;
|
|
@@ -2292,11 +2292,11 @@ function eu({
|
|
|
2292
2292
|
var k;
|
|
2293
2293
|
const { selectVisual: f } = ms(), g = _i(t.id), v = W(
|
|
2294
2294
|
(b) => b.actions.setIsDashboardPanelOpen
|
|
2295
|
-
), [p, x] =
|
|
2295
|
+
), [p, x] = V(!1), [y, w] = V(!1);
|
|
2296
2296
|
Me(() => {
|
|
2297
2297
|
n ? (x(!0), w(!0)) : y && (x(!1), w(!1));
|
|
2298
2298
|
}, [n, y]);
|
|
2299
|
-
const
|
|
2299
|
+
const M = () => t.ownership.isOwner ? t.ownership.status === "private" ? /* @__PURE__ */ e(Al, { className: "h-3 w-3 text-purple-500" }) : /* @__PURE__ */ e(vt, { className: "h-3.5 w-3.5 text-blue-600" }) : /* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5 text-slate-500" }), F = () => /* @__PURE__ */ e(hs, { className: "h-4 w-4 text-slate-400" }), E = () => {
|
|
2300
2300
|
f(t), c == null || c(t);
|
|
2301
2301
|
};
|
|
2302
2302
|
return /* @__PURE__ */ s(
|
|
@@ -2327,7 +2327,7 @@ function eu({
|
|
|
2327
2327
|
displayClassName: "line-clamp-1 max-w-[150px] text-sm font-medium text-slate-900 dark:text-slate-100"
|
|
2328
2328
|
}
|
|
2329
2329
|
) }),
|
|
2330
|
-
/* @__PURE__ */ e("div", { className: "shrink-0", children:
|
|
2330
|
+
/* @__PURE__ */ e("div", { className: "shrink-0", children: M() })
|
|
2331
2331
|
] }),
|
|
2332
2332
|
/* @__PURE__ */ e("div", { className: "mt-0.5", children: /* @__PURE__ */ e(
|
|
2333
2333
|
ma,
|
|
@@ -2351,7 +2351,7 @@ function eu({
|
|
|
2351
2351
|
),
|
|
2352
2352
|
children: [
|
|
2353
2353
|
/* @__PURE__ */ e(
|
|
2354
|
-
|
|
2354
|
+
j,
|
|
2355
2355
|
{
|
|
2356
2356
|
size: "sm",
|
|
2357
2357
|
variant: "ghost",
|
|
@@ -2359,7 +2359,7 @@ function eu({
|
|
|
2359
2359
|
onClick: (b) => {
|
|
2360
2360
|
b.stopPropagation(), i(t);
|
|
2361
2361
|
},
|
|
2362
|
-
children: /* @__PURE__ */ e(
|
|
2362
|
+
children: /* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5" })
|
|
2363
2363
|
}
|
|
2364
2364
|
),
|
|
2365
2365
|
/* @__PURE__ */ s(
|
|
@@ -2370,7 +2370,7 @@ function eu({
|
|
|
2370
2370
|
onOpenChange: x,
|
|
2371
2371
|
children: [
|
|
2372
2372
|
/* @__PURE__ */ e(Cn, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2373
|
-
|
|
2373
|
+
j,
|
|
2374
2374
|
{
|
|
2375
2375
|
size: "sm",
|
|
2376
2376
|
variant: "ghost",
|
|
@@ -2387,7 +2387,7 @@ function eu({
|
|
|
2387
2387
|
b.stopPropagation(), i(t);
|
|
2388
2388
|
},
|
|
2389
2389
|
children: [
|
|
2390
|
-
/* @__PURE__ */ e(
|
|
2390
|
+
/* @__PURE__ */ e(Le, { className: "mr-2 h-3 w-3" }),
|
|
2391
2391
|
"Add"
|
|
2392
2392
|
]
|
|
2393
2393
|
}
|
|
@@ -2549,7 +2549,7 @@ function Ul({
|
|
|
2549
2549
|
")"
|
|
2550
2550
|
] }),
|
|
2551
2551
|
/* @__PURE__ */ e(
|
|
2552
|
-
|
|
2552
|
+
j,
|
|
2553
2553
|
{
|
|
2554
2554
|
variant: "ghost",
|
|
2555
2555
|
size: "sm",
|
|
@@ -2597,7 +2597,7 @@ function Bl({
|
|
|
2597
2597
|
")"
|
|
2598
2598
|
] }),
|
|
2599
2599
|
/* @__PURE__ */ e(
|
|
2600
|
-
|
|
2600
|
+
j,
|
|
2601
2601
|
{
|
|
2602
2602
|
variant: "ghost",
|
|
2603
2603
|
size: "sm",
|
|
@@ -2660,7 +2660,7 @@ function $l({
|
|
|
2660
2660
|
] })
|
|
2661
2661
|
] }),
|
|
2662
2662
|
/* @__PURE__ */ e(
|
|
2663
|
-
|
|
2663
|
+
j,
|
|
2664
2664
|
{
|
|
2665
2665
|
variant: "ghost",
|
|
2666
2666
|
size: "sm",
|
|
@@ -2828,9 +2828,9 @@ function iu({
|
|
|
2828
2828
|
o.slice(0, 3).map((f, g) => {
|
|
2829
2829
|
var y, w;
|
|
2830
2830
|
const v = ((y = a.find(
|
|
2831
|
-
(
|
|
2831
|
+
(M) => M.id === f.orgUserId
|
|
2832
2832
|
)) == null ? void 0 : y.name) || "Unknown User", p = ((w = a.find(
|
|
2833
|
-
(
|
|
2833
|
+
(M) => M.id === f.orgUserId
|
|
2834
2834
|
)) == null ? void 0 : w.type) || "", x = Xe(
|
|
2835
2835
|
f.role,
|
|
2836
2836
|
n(p)
|
|
@@ -2871,9 +2871,9 @@ function iu({
|
|
|
2871
2871
|
d.slice(0, 3).map((f, g) => {
|
|
2872
2872
|
var y, w;
|
|
2873
2873
|
const v = ((y = a.find(
|
|
2874
|
-
(
|
|
2874
|
+
(M) => M.id === f.tenantUserId
|
|
2875
2875
|
)) == null ? void 0 : y.name) || "Unknown User", p = ((w = a.find(
|
|
2876
|
-
(
|
|
2876
|
+
(M) => M.id === f.tenantUserId
|
|
2877
2877
|
)) == null ? void 0 : w.type) || "", x = Xe(
|
|
2878
2878
|
f.role,
|
|
2879
2879
|
n(p)
|
|
@@ -3271,17 +3271,17 @@ function Gl({
|
|
|
3271
3271
|
k ? v.removeSelectedUser(E) : b ? v.removeUserFromRemove(E) : v.addSelectedUser({ id: E, role: "VIEWER" });
|
|
3272
3272
|
}), x = o || v.updateSelectedUserRole, y = d || v.addUserToRemove, w = m || ((E, k, b) => {
|
|
3273
3273
|
v.addUserToUpdate({ id: E, currentRole: k, newRole: b });
|
|
3274
|
-
}),
|
|
3274
|
+
}), M = l, F = h;
|
|
3275
3275
|
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
3276
3276
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
3277
3277
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
3278
3278
|
/* @__PURE__ */ s(Z, { className: "text-sm font-medium", children: [
|
|
3279
3279
|
"All Users (",
|
|
3280
|
-
(
|
|
3280
|
+
(M ?? []).length,
|
|
3281
3281
|
")"
|
|
3282
3282
|
] }),
|
|
3283
3283
|
/* @__PURE__ */ e(rt, { children: /* @__PURE__ */ s(Be, { children: [
|
|
3284
|
-
/* @__PURE__ */ e(qe, { asChild: !0, children: /* @__PURE__ */ e(
|
|
3284
|
+
/* @__PURE__ */ e(qe, { asChild: !0, children: /* @__PURE__ */ e(j, { variant: "ghost", size: "sm", className: "h-6 w-6 p-0", children: /* @__PURE__ */ e(Jn, { className: "h-4 w-4" }) }) }),
|
|
3285
3285
|
/* @__PURE__ */ e(Ye, { className: "w-48 max-w-sm", children: /* @__PURE__ */ e(
|
|
3286
3286
|
iu,
|
|
3287
3287
|
{
|
|
@@ -3293,18 +3293,18 @@ function Gl({
|
|
|
3293
3293
|
) })
|
|
3294
3294
|
] }) })
|
|
3295
3295
|
] }),
|
|
3296
|
-
(
|
|
3297
|
-
|
|
3296
|
+
(M == null ? void 0 : M.length) > 0 && /* @__PURE__ */ e(
|
|
3297
|
+
j,
|
|
3298
3298
|
{
|
|
3299
3299
|
variant: "ghost",
|
|
3300
3300
|
size: "sm",
|
|
3301
3301
|
onClick: () => {
|
|
3302
|
-
u.length ===
|
|
3303
|
-
|
|
3302
|
+
u.length === M.length ? v.setSelectedUsers([]) : v.setSelectedUsers(
|
|
3303
|
+
M.map((E) => ({ id: E.id, role: "VIEWER" }))
|
|
3304
3304
|
);
|
|
3305
3305
|
},
|
|
3306
3306
|
className: "h-auto p-1 text-xs",
|
|
3307
|
-
children: u.length ===
|
|
3307
|
+
children: u.length === M.length ? "Deselect all" : "Select all"
|
|
3308
3308
|
}
|
|
3309
3309
|
)
|
|
3310
3310
|
] }),
|
|
@@ -3315,10 +3315,10 @@ function Gl({
|
|
|
3315
3315
|
isInitialLoading: a,
|
|
3316
3316
|
isSearching: n,
|
|
3317
3317
|
searchQuery: g,
|
|
3318
|
-
availableUsers:
|
|
3318
|
+
availableUsers: M || []
|
|
3319
3319
|
}
|
|
3320
3320
|
),
|
|
3321
|
-
!a && !n && (
|
|
3321
|
+
!a && !n && (M == null ? void 0 : M.length) > 0 && M.map((E) => {
|
|
3322
3322
|
const k = t ? nu(E, t, i) : void 0, b = F.includes(E.id), D = !!k, N = D && !b, I = u.some(
|
|
3323
3323
|
(A) => A.id === E.id
|
|
3324
3324
|
), S = u.find(
|
|
@@ -3477,7 +3477,7 @@ function du({
|
|
|
3477
3477
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium", children: "Select Access Level:" }),
|
|
3478
3478
|
/* @__PURE__ */ s(fs, { children: [
|
|
3479
3479
|
/* @__PURE__ */ e(gs, { asChild: !0, children: /* @__PURE__ */ e(
|
|
3480
|
-
|
|
3480
|
+
j,
|
|
3481
3481
|
{
|
|
3482
3482
|
variant: "ghost",
|
|
3483
3483
|
size: "sm",
|
|
@@ -3515,7 +3515,7 @@ function du({
|
|
|
3515
3515
|
] })
|
|
3516
3516
|
] }),
|
|
3517
3517
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-3", children: m.map((w) => /* @__PURE__ */ s(
|
|
3518
|
-
|
|
3518
|
+
j,
|
|
3519
3519
|
{
|
|
3520
3520
|
variant: h === w.value ? "default" : "outline",
|
|
3521
3521
|
className: "h-auto flex-col items-start gap-2 p-3",
|
|
@@ -3636,7 +3636,7 @@ function hu({
|
|
|
3636
3636
|
isRemoving: c = !1
|
|
3637
3637
|
}) {
|
|
3638
3638
|
var ae, G;
|
|
3639
|
-
const o = Tn(), d = Qn(), { searchQuery: m, setSearchQuery: u, debouncedSearchQuery: h } = Jr(), f = kn(), g = ct(), v = Dn(), p = dt(), x = xs(), y = Vt(), [w,
|
|
3639
|
+
const o = Tn(), d = Qn(), { searchQuery: m, setSearchQuery: u, debouncedSearchQuery: h } = Jr(), f = kn(), g = ct(), v = Dn(), p = dt(), x = xs(), y = Vt(), [w, M] = Oe.useState("specific_users"), F = () => {
|
|
3640
3640
|
if (o === "org") return "organization";
|
|
3641
3641
|
if (o === "tenant") return "tenant";
|
|
3642
3642
|
}, E = () => {
|
|
@@ -3657,7 +3657,7 @@ function hu({
|
|
|
3657
3657
|
const N = (L) => {
|
|
3658
3658
|
var $, K;
|
|
3659
3659
|
const q = L;
|
|
3660
|
-
if (
|
|
3660
|
+
if (M(q), r == null || r(q), y.setCurrentContext("org-tab"), q === "specific_users")
|
|
3661
3661
|
y.setCurrentMode("specificOrgUsers");
|
|
3662
3662
|
else if (q === "all_users") {
|
|
3663
3663
|
y.setCurrentMode("allOrgUsers");
|
|
@@ -3798,9 +3798,9 @@ function Dr({
|
|
|
3798
3798
|
isRemoving: c = !1
|
|
3799
3799
|
}) {
|
|
3800
3800
|
var ee;
|
|
3801
|
-
const { searchQuery: o, debouncedSearchQuery: d, setSearchQuery: m } = Jr(), u = kn(), h = ct(), f = Dn(), g = dt(), v = wa(), p = bs(), x = Qn(), y = Vt(), { data: w, isLoading:
|
|
3801
|
+
const { searchQuery: o, debouncedSearchQuery: d, setSearchQuery: m } = Jr(), u = kn(), h = ct(), f = Dn(), g = dt(), v = wa(), p = bs(), x = Qn(), y = Vt(), { data: w, isLoading: M } = Ud({
|
|
3802
3802
|
enabled: (n == null ? void 0 : n.type) === "organization"
|
|
3803
|
-
}), [F, E] =
|
|
3803
|
+
}), [F, E] = V(
|
|
3804
3804
|
(n == null ? void 0 : n.type) === "organization" ? "all_tenants" : "specific_tenant_users"
|
|
3805
3805
|
);
|
|
3806
3806
|
Oe.useEffect(() => {
|
|
@@ -3877,7 +3877,7 @@ function Dr({
|
|
|
3877
3877
|
/* @__PURE__ */ e(ji, { className: "mx-auto mb-2 h-8 w-8 text-destructive" }),
|
|
3878
3878
|
/* @__PURE__ */ e("p", { className: "mb-4 text-sm text-destructive", children: "Failed to load users or shares" }),
|
|
3879
3879
|
/* @__PURE__ */ e(
|
|
3880
|
-
|
|
3880
|
+
j,
|
|
3881
3881
|
{
|
|
3882
3882
|
variant: "outline",
|
|
3883
3883
|
size: "sm",
|
|
@@ -3935,12 +3935,12 @@ function Dr({
|
|
|
3935
3935
|
{
|
|
3936
3936
|
value: x || "",
|
|
3937
3937
|
onValueChange: b,
|
|
3938
|
-
disabled:
|
|
3938
|
+
disabled: M,
|
|
3939
3939
|
children: [
|
|
3940
3940
|
/* @__PURE__ */ e(ye, { className: "w-full", children: /* @__PURE__ */ e(
|
|
3941
3941
|
ve,
|
|
3942
3942
|
{
|
|
3943
|
-
placeholder:
|
|
3943
|
+
placeholder: M ? "Loading tenants..." : "Select a tenant..."
|
|
3944
3944
|
}
|
|
3945
3945
|
) }),
|
|
3946
3946
|
/* @__PURE__ */ e(xe, { className: "z-[51]", children: (ee = w == null ? void 0 : w.tenants) == null ? void 0 : ee.map((Q) => /* @__PURE__ */ e(te, { value: Q.id, children: Q.name }, Q.id)) })
|
|
@@ -4103,7 +4103,7 @@ function Mr({
|
|
|
4103
4103
|
dt(), Ns();
|
|
4104
4104
|
const g = Qn();
|
|
4105
4105
|
Tn();
|
|
4106
|
-
const v = xs(), p = bs(), x = wa(), { buildShareData: y, validateShareData: w, isCurrentStateValid:
|
|
4106
|
+
const v = xs(), p = bs(), x = wa(), { buildShareData: y, validateShareData: w, isCurrentStateValid: M } = Kl(), F = n || r || l, E = () => {
|
|
4107
4107
|
var I, S, z, A;
|
|
4108
4108
|
if (F) return "Updating...";
|
|
4109
4109
|
if (o === "specific_users") {
|
|
@@ -4135,7 +4135,7 @@ function Mr({
|
|
|
4135
4135
|
return O === 0 ? "Select users to share with" : u.length > 0 && h.length > 0 ? `Update access for ${O} user${O !== 1 ? "s" : ""}` : h.length > 0 && u.length === 0 && f.length === 0 ? `Remove access for ${h.length} user${h.length !== 1 ? "s" : ""}` : u.length > 0 && h.length === 0 && f.length === 0 ? `Share with ${u.length} user${u.length !== 1 ? "s" : ""}` : f.length > 0 && u.length === 0 && h.length === 0 ? `Update access for ${f.length} user${f.length !== 1 ? "s" : ""}` : `Update access for ${O} user${O !== 1 ? "s" : ""}`;
|
|
4136
4136
|
}
|
|
4137
4137
|
return "Share";
|
|
4138
|
-
}, k = () => F || !t || o === "all_tenant_users" && !g || o === "specific_tenant_users" && !g ? !0 : !
|
|
4138
|
+
}, k = () => F || !t || o === "all_tenant_users" && !g || o === "specific_tenant_users" && !g ? !0 : !M, b = () => {
|
|
4139
4139
|
const I = y();
|
|
4140
4140
|
I && w(I) && i(I);
|
|
4141
4141
|
}, D = () => {
|
|
@@ -4223,9 +4223,9 @@ function Mr({
|
|
|
4223
4223
|
return "default";
|
|
4224
4224
|
};
|
|
4225
4225
|
return /* @__PURE__ */ s(pn, { children: [
|
|
4226
|
-
/* @__PURE__ */ e(
|
|
4226
|
+
/* @__PURE__ */ e(j, { variant: "outline", onClick: c, disabled: F, children: "Close" }),
|
|
4227
4227
|
(o === "specific_users" || o === "specific_tenant_users") && /* @__PURE__ */ e(ne, { children: (u.length > 0 || h.length > 0 || f.length > 0) && /* @__PURE__ */ s(
|
|
4228
|
-
|
|
4228
|
+
j,
|
|
4229
4229
|
{
|
|
4230
4230
|
onClick: b,
|
|
4231
4231
|
disabled: !t || F,
|
|
@@ -4240,7 +4240,7 @@ function Mr({
|
|
|
4240
4240
|
}
|
|
4241
4241
|
) }),
|
|
4242
4242
|
(o === "all_users" || o === "all_tenants" || o === "all_tenant_users") && /* @__PURE__ */ s(
|
|
4243
|
-
|
|
4243
|
+
j,
|
|
4244
4244
|
{
|
|
4245
4245
|
onClick: D,
|
|
4246
4246
|
disabled: k(),
|
|
@@ -4287,7 +4287,7 @@ function pu({
|
|
|
4287
4287
|
}, y = () => p || !t ? !0 : !v, w = () => {
|
|
4288
4288
|
const E = f();
|
|
4289
4289
|
E && g(E) && l(E);
|
|
4290
|
-
},
|
|
4290
|
+
}, M = () => {
|
|
4291
4291
|
if (!o || o.role === "NONE") {
|
|
4292
4292
|
const E = f();
|
|
4293
4293
|
E && g(E) && l(E);
|
|
@@ -4315,9 +4315,9 @@ function pu({
|
|
|
4315
4315
|
}
|
|
4316
4316
|
}, F = () => !o || o.role === "NONE" ? "default" : "destructive";
|
|
4317
4317
|
return /* @__PURE__ */ s(pn, { children: [
|
|
4318
|
-
/* @__PURE__ */ e(
|
|
4318
|
+
/* @__PURE__ */ e(j, { variant: "outline", onClick: i, disabled: p, children: "Close" }),
|
|
4319
4319
|
c === "specific_users" && /* @__PURE__ */ e(ne, { children: (d.length > 0 || m.length > 0 || u.length > 0) && /* @__PURE__ */ s(
|
|
4320
|
-
|
|
4320
|
+
j,
|
|
4321
4321
|
{
|
|
4322
4322
|
onClick: w,
|
|
4323
4323
|
disabled: !t || p,
|
|
@@ -4332,9 +4332,9 @@ function pu({
|
|
|
4332
4332
|
}
|
|
4333
4333
|
) }),
|
|
4334
4334
|
c === "all_users" && /* @__PURE__ */ s(
|
|
4335
|
-
|
|
4335
|
+
j,
|
|
4336
4336
|
{
|
|
4337
|
-
onClick:
|
|
4337
|
+
onClick: M,
|
|
4338
4338
|
disabled: y(),
|
|
4339
4339
|
variant: F(),
|
|
4340
4340
|
children: [
|
|
@@ -4369,7 +4369,7 @@ function Wl({
|
|
|
4369
4369
|
resourceId: (t == null ? void 0 : t.id) || "",
|
|
4370
4370
|
resourceType: a,
|
|
4371
4371
|
userType: "organization"
|
|
4372
|
-
}), w = (D = (b = x == null ? void 0 : x.shares) == null ? void 0 : b.tenantWide) == null ? void 0 : D[0],
|
|
4372
|
+
}), w = (D = (b = x == null ? void 0 : x.shares) == null ? void 0 : b.tenantWide) == null ? void 0 : D[0], M = (I = (N = y == null ? void 0 : y.shares) == null ? void 0 : N.orgUsersOnly) == null ? void 0 : I[0], F = () => {
|
|
4373
4373
|
if (v === "org")
|
|
4374
4374
|
return h;
|
|
4375
4375
|
switch (p) {
|
|
@@ -4408,8 +4408,8 @@ function Wl({
|
|
|
4408
4408
|
className: "mb-4 min-h-0 flex-1",
|
|
4409
4409
|
children: [
|
|
4410
4410
|
/* @__PURE__ */ s(rn, { className: "mb-2 grid w-full grid-cols-2", children: [
|
|
4411
|
-
/* @__PURE__ */ e(
|
|
4412
|
-
/* @__PURE__ */ e(
|
|
4411
|
+
/* @__PURE__ */ e(Fe, { value: "org", children: "Org Users" }),
|
|
4412
|
+
/* @__PURE__ */ e(Fe, { value: "tenant", children: "Tenant Users" })
|
|
4413
4413
|
] }),
|
|
4414
4414
|
/* @__PURE__ */ e(At, { value: "org", className: "min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ e("div", { className: "h-full overflow-y-auto", children: /* @__PURE__ */ e(
|
|
4415
4415
|
hu,
|
|
@@ -4475,7 +4475,7 @@ function Wl({
|
|
|
4475
4475
|
onShare: c,
|
|
4476
4476
|
onClose: i,
|
|
4477
4477
|
shareTabType: h,
|
|
4478
|
-
currentAllUsersShare:
|
|
4478
|
+
currentAllUsersShare: M,
|
|
4479
4479
|
onRemoveAccess: o
|
|
4480
4480
|
}
|
|
4481
4481
|
) : (
|
|
@@ -4808,8 +4808,8 @@ function Zl(t, a, n, r) {
|
|
|
4808
4808
|
l,
|
|
4809
4809
|
i,
|
|
4810
4810
|
t.map((x) => {
|
|
4811
|
-
var w,
|
|
4812
|
-
const y = (
|
|
4811
|
+
var w, M;
|
|
4812
|
+
const y = (M = (w = o == null ? void 0 : o.shares) == null ? void 0 : w.specificTenantUsers) == null ? void 0 : M.find(
|
|
4813
4813
|
(F) => F.tenantUserId === x
|
|
4814
4814
|
);
|
|
4815
4815
|
return {
|
|
@@ -4842,8 +4842,8 @@ function Zl(t, a, n, r) {
|
|
|
4842
4842
|
onSuccess: () => {
|
|
4843
4843
|
d();
|
|
4844
4844
|
},
|
|
4845
|
-
onError: (
|
|
4846
|
-
console.error("Remove all-tenants access failed:",
|
|
4845
|
+
onError: (M) => {
|
|
4846
|
+
console.error("Remove all-tenants access failed:", M);
|
|
4847
4847
|
}
|
|
4848
4848
|
});
|
|
4849
4849
|
}
|
|
@@ -4860,8 +4860,8 @@ function Zl(t, a, n, r) {
|
|
|
4860
4860
|
onSuccess: () => {
|
|
4861
4861
|
d();
|
|
4862
4862
|
},
|
|
4863
|
-
onError: (
|
|
4864
|
-
console.error("Remove all-tenant-users access failed:",
|
|
4863
|
+
onError: (M) => {
|
|
4864
|
+
console.error("Remove all-tenant-users access failed:", M);
|
|
4865
4865
|
}
|
|
4866
4866
|
});
|
|
4867
4867
|
}
|
|
@@ -4878,8 +4878,8 @@ function Zl(t, a, n, r) {
|
|
|
4878
4878
|
onSuccess: () => {
|
|
4879
4879
|
d();
|
|
4880
4880
|
},
|
|
4881
|
-
onError: (
|
|
4882
|
-
console.error("Remove org-wide access failed:",
|
|
4881
|
+
onError: (M) => {
|
|
4882
|
+
console.error("Remove org-wide access failed:", M);
|
|
4883
4883
|
}
|
|
4884
4884
|
});
|
|
4885
4885
|
}
|
|
@@ -5021,7 +5021,7 @@ function yu(t) {
|
|
|
5021
5021
|
}
|
|
5022
5022
|
}
|
|
5023
5023
|
function Us(t) {
|
|
5024
|
-
const [a, n] =
|
|
5024
|
+
const [a, n] = V(null), [r, l] = V(null);
|
|
5025
5025
|
return Me(() => {
|
|
5026
5026
|
if (!t || t.trim() === "") {
|
|
5027
5027
|
n(null), l(null);
|
|
@@ -5114,17 +5114,17 @@ function xu(t, a, n, r, l) {
|
|
|
5114
5114
|
}
|
|
5115
5115
|
function bu() {
|
|
5116
5116
|
var f;
|
|
5117
|
-
const { setCardSql: t } = se(), a =
|
|
5117
|
+
const { setCardSql: t } = se(), a = T((g) => g.frame), n = T((g) => g.card), r = Us(
|
|
5118
5118
|
((f = n.customCardPreferences) == null ? void 0 : f.url) || ""
|
|
5119
|
-
), l =
|
|
5119
|
+
), l = T(
|
|
5120
5120
|
(g) => g.selectedSchemaName
|
|
5121
|
-
), i =
|
|
5121
|
+
), i = T(
|
|
5122
5122
|
(g) => g.selectedDatamodelId
|
|
5123
|
-
), c =
|
|
5123
|
+
), c = T(
|
|
5124
5124
|
(g) => g.selectedDatabaseName
|
|
5125
|
-
), o =
|
|
5125
|
+
), o = T((g) => g.selectedTableName), d = T(
|
|
5126
5126
|
(g) => g.selectedConnectionId
|
|
5127
|
-
), m =
|
|
5127
|
+
), m = T((g) => g.isShowingVisual), u = n.sql;
|
|
5128
5128
|
return { getUpdatedFrame: me(() => {
|
|
5129
5129
|
var y;
|
|
5130
5130
|
let g = u;
|
|
@@ -5221,11 +5221,11 @@ function Bs() {
|
|
|
5221
5221
|
), w = x.frameObject;
|
|
5222
5222
|
if (!w)
|
|
5223
5223
|
return { success: !1, error: "Visual has no frame data" };
|
|
5224
|
-
const
|
|
5224
|
+
const M = {
|
|
5225
5225
|
...w,
|
|
5226
5226
|
id: Xt()
|
|
5227
5227
|
};
|
|
5228
|
-
return m(h,
|
|
5228
|
+
return m(h, M, "end"), c(!0), d(M.id), u(!1), { success: !0, fromCache: y };
|
|
5229
5229
|
} catch (x) {
|
|
5230
5230
|
return console.error("Error adding visual:", x), { success: !1, error: "Failed to add visual to dashboard" };
|
|
5231
5231
|
}
|
|
@@ -5253,9 +5253,9 @@ function Bs() {
|
|
|
5253
5253
|
};
|
|
5254
5254
|
}
|
|
5255
5255
|
function Nu() {
|
|
5256
|
-
const [t, a] =
|
|
5256
|
+
const [t, a] = V(""), [n, r] = V(!1), [l, i] = V(""), [c, o] = V(""), [d, m] = V(!1), [u, h] = V(
|
|
5257
5257
|
null
|
|
5258
|
-
), [f, g] =
|
|
5258
|
+
), [f, g] = V(!1), [v, p] = V(null), [x, y] = V(null), { setIsDashboardEditing: w, setIsVisualEditing: M } = xt(), { handleEditLibraryVisual: F, handleAddLibraryVisual: E } = Bs(), {
|
|
5259
5259
|
resources: k,
|
|
5260
5260
|
isLoading: b,
|
|
5261
5261
|
isError: D,
|
|
@@ -5349,7 +5349,7 @@ function Nu() {
|
|
|
5349
5349
|
}), b ? /* @__PURE__ */ e(Ll, {}) : D ? /* @__PURE__ */ e(Qe, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ s("div", { className: "py-8 text-center text-muted-foreground", children: [
|
|
5350
5350
|
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load visuals" }),
|
|
5351
5351
|
/* @__PURE__ */ e(
|
|
5352
|
-
|
|
5352
|
+
j,
|
|
5353
5353
|
{
|
|
5354
5354
|
variant: "outline",
|
|
5355
5355
|
size: "sm",
|
|
@@ -5390,7 +5390,7 @@ function Nu() {
|
|
|
5390
5390
|
] }),
|
|
5391
5391
|
/* @__PURE__ */ s("div", { className: "flex gap-2 pt-2", children: [
|
|
5392
5392
|
/* @__PURE__ */ e(
|
|
5393
|
-
|
|
5393
|
+
j,
|
|
5394
5394
|
{
|
|
5395
5395
|
onClick: L,
|
|
5396
5396
|
size: "sm",
|
|
@@ -5400,7 +5400,7 @@ function Nu() {
|
|
|
5400
5400
|
}
|
|
5401
5401
|
),
|
|
5402
5402
|
/* @__PURE__ */ e(
|
|
5403
|
-
|
|
5403
|
+
j,
|
|
5404
5404
|
{
|
|
5405
5405
|
onClick: () => {
|
|
5406
5406
|
r(!1), i(""), o("");
|
|
@@ -5415,14 +5415,14 @@ function Nu() {
|
|
|
5415
5415
|
] })
|
|
5416
5416
|
] })
|
|
5417
5417
|
] }) : /* @__PURE__ */ s(
|
|
5418
|
-
|
|
5418
|
+
j,
|
|
5419
5419
|
{
|
|
5420
5420
|
onClick: () => r(!0),
|
|
5421
5421
|
className: "h-8 w-full",
|
|
5422
5422
|
size: "sm",
|
|
5423
5423
|
disabled: O,
|
|
5424
5424
|
children: [
|
|
5425
|
-
/* @__PURE__ */ e(
|
|
5425
|
+
/* @__PURE__ */ e(Le, { className: "mr-2 h-3.5 w-3.5" }),
|
|
5426
5426
|
O ? "Creating..." : "Create New Visual"
|
|
5427
5427
|
]
|
|
5428
5428
|
}
|
|
@@ -5526,13 +5526,13 @@ function Cu({
|
|
|
5526
5526
|
onDashboardItemClick: h
|
|
5527
5527
|
}) {
|
|
5528
5528
|
var k;
|
|
5529
|
-
const { selectDashboard: f } = ms(), g = $i(t.id), [v, p] =
|
|
5529
|
+
const { selectDashboard: f } = ms(), g = $i(t.id), [v, p] = V(!1), [x, y] = V(!1), w = W(
|
|
5530
5530
|
(b) => b.actions.setIsDashboardPanelOpen
|
|
5531
5531
|
);
|
|
5532
5532
|
Me(() => {
|
|
5533
5533
|
n ? (p(!0), y(!0)) : x && (p(!1), y(!1));
|
|
5534
5534
|
}, [n, x]);
|
|
5535
|
-
const
|
|
5535
|
+
const M = () => t.ownership.isOwner ? t.ownership.status === "private" ? /* @__PURE__ */ e(Al, { className: "h-3 w-3 text-purple-500" }) : /* @__PURE__ */ e(vt, { className: "h-3.5 w-3.5 text-blue-600" }) : /* @__PURE__ */ e(Lt, { className: "h-3.5 w-3.5 text-slate-500" }), F = () => /* @__PURE__ */ e(qi, { className: "h-4 w-4 text-slate-400" }), E = () => {
|
|
5536
5536
|
f(t), i(t.id), h == null || h(t.id);
|
|
5537
5537
|
};
|
|
5538
5538
|
return /* @__PURE__ */ s(
|
|
@@ -5563,7 +5563,7 @@ function Cu({
|
|
|
5563
5563
|
displayClassName: "line-clamp-1 max-w-[220px] text-sm font-medium text-slate-900 dark:text-slate-100"
|
|
5564
5564
|
}
|
|
5565
5565
|
) }),
|
|
5566
|
-
/* @__PURE__ */ e("div", { className: "shrink-0", children:
|
|
5566
|
+
/* @__PURE__ */ e("div", { className: "shrink-0", children: M() })
|
|
5567
5567
|
] }),
|
|
5568
5568
|
/* @__PURE__ */ e("div", { className: "mt-0.5", children: /* @__PURE__ */ e(
|
|
5569
5569
|
ma,
|
|
@@ -5594,7 +5594,7 @@ function Cu({
|
|
|
5594
5594
|
onOpenChange: p,
|
|
5595
5595
|
children: [
|
|
5596
5596
|
/* @__PURE__ */ e(Cn, { asChild: !0, children: /* @__PURE__ */ e(
|
|
5597
|
-
|
|
5597
|
+
j,
|
|
5598
5598
|
{
|
|
5599
5599
|
size: "sm",
|
|
5600
5600
|
variant: "ghost",
|
|
@@ -5672,13 +5672,13 @@ function Cu({
|
|
|
5672
5672
|
function wu({ onRetry: t }) {
|
|
5673
5673
|
return /* @__PURE__ */ e(Qe, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ s("div", { className: "py-8 text-center text-muted-foreground", children: [
|
|
5674
5674
|
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load dashboards" }),
|
|
5675
|
-
/* @__PURE__ */ e(
|
|
5675
|
+
/* @__PURE__ */ e(j, { variant: "outline", size: "sm", className: "mt-2", onClick: t, children: "Retry" })
|
|
5676
5676
|
] }) });
|
|
5677
5677
|
}
|
|
5678
5678
|
function Su(t) {
|
|
5679
|
-
const [a, n] =
|
|
5679
|
+
const [a, n] = V(""), [r, l] = V(!1), [i, c] = V(""), [o, d] = V(""), [m, u] = V(!1), [h, f] = V(
|
|
5680
5680
|
null
|
|
5681
|
-
), [g, v] =
|
|
5681
|
+
), [g, v] = V(!1), [p, x] = V(null), [y, w] = V(null), M = ha(
|
|
5682
5682
|
(X) => X.lastSelectedDashboard
|
|
5683
5683
|
), F = ha(
|
|
5684
5684
|
(X) => X.actions.selectDashboard
|
|
@@ -5701,7 +5701,7 @@ function Su(t) {
|
|
|
5701
5701
|
removeResourceShares: U
|
|
5702
5702
|
} = Qd(
|
|
5703
5703
|
() => {
|
|
5704
|
-
v(!1), x(null),
|
|
5704
|
+
v(!1), x(null), M && F(M);
|
|
5705
5705
|
},
|
|
5706
5706
|
() => {
|
|
5707
5707
|
l(!1), c(""), d("");
|
|
@@ -5806,7 +5806,7 @@ function Su(t) {
|
|
|
5806
5806
|
] }),
|
|
5807
5807
|
/* @__PURE__ */ s("div", { className: "flex gap-2 pt-2", children: [
|
|
5808
5808
|
/* @__PURE__ */ e(
|
|
5809
|
-
|
|
5809
|
+
j,
|
|
5810
5810
|
{
|
|
5811
5811
|
onClick: L,
|
|
5812
5812
|
size: "sm",
|
|
@@ -5816,7 +5816,7 @@ function Su(t) {
|
|
|
5816
5816
|
}
|
|
5817
5817
|
),
|
|
5818
5818
|
/* @__PURE__ */ e(
|
|
5819
|
-
|
|
5819
|
+
j,
|
|
5820
5820
|
{
|
|
5821
5821
|
onClick: () => {
|
|
5822
5822
|
l(!1), c(""), d("");
|
|
@@ -5831,14 +5831,14 @@ function Su(t) {
|
|
|
5831
5831
|
] })
|
|
5832
5832
|
] })
|
|
5833
5833
|
] }) : /* @__PURE__ */ s(
|
|
5834
|
-
|
|
5834
|
+
j,
|
|
5835
5835
|
{
|
|
5836
5836
|
onClick: () => l(!0),
|
|
5837
5837
|
className: "h-8 w-full",
|
|
5838
5838
|
size: "sm",
|
|
5839
5839
|
disabled: z,
|
|
5840
5840
|
children: [
|
|
5841
|
-
/* @__PURE__ */ e(
|
|
5841
|
+
/* @__PURE__ */ e(Le, { className: "mr-2 h-3.5 w-3.5" }),
|
|
5842
5842
|
z ? "Creating..." : "Create New Dashboard"
|
|
5843
5843
|
]
|
|
5844
5844
|
}
|
|
@@ -6007,8 +6007,8 @@ function ku({
|
|
|
6007
6007
|
className: "flex h-9 grow flex-col",
|
|
6008
6008
|
children: [
|
|
6009
6009
|
/* @__PURE__ */ e("div", { className: "px-5", children: /* @__PURE__ */ s(rn, { className: "grid h-8 w-full grid-cols-2", children: [
|
|
6010
|
-
/* @__PURE__ */ e(
|
|
6011
|
-
/* @__PURE__ */ e(
|
|
6010
|
+
/* @__PURE__ */ e(Fe, { value: "dashboards", className: "h-6", children: "Dashboards" }),
|
|
6011
|
+
/* @__PURE__ */ e(Fe, { value: "visuals", className: "h-6", children: "Visuals" })
|
|
6012
6012
|
] }) }),
|
|
6013
6013
|
/* @__PURE__ */ e(At, { value: "dashboards", className: "flex-1", children: /* @__PURE__ */ e(
|
|
6014
6014
|
Su,
|
|
@@ -6034,9 +6034,9 @@ function Du() {
|
|
|
6034
6034
|
W((L) => L.selectedSheetId);
|
|
6035
6035
|
const c = W(
|
|
6036
6036
|
(L) => L.isDashboardEditing
|
|
6037
|
-
), o =
|
|
6037
|
+
), o = T((L) => L.card), d = T(
|
|
6038
6038
|
(L) => L.selectedConnectionId
|
|
6039
|
-
), [m, u] =
|
|
6039
|
+
), [m, u] = V(!1), h = W((L) => L.isDashboardPanelOpen), f = W(
|
|
6040
6040
|
(L) => L.actions.setIsDashboardPanelOpen
|
|
6041
6041
|
), g = W((L) => L.filterValues), v = W((L) => L.isVisualEditing), p = ha(
|
|
6042
6042
|
(L) => L.selectedDashboard
|
|
@@ -6044,7 +6044,7 @@ function Du() {
|
|
|
6044
6044
|
W(
|
|
6045
6045
|
(L) => L.showDashboardJSON
|
|
6046
6046
|
);
|
|
6047
|
-
const w = W((L) => L.onSaveFunction),
|
|
6047
|
+
const w = W((L) => L.onSaveFunction), M = W(
|
|
6048
6048
|
(L) => L.actions.setShowFilters
|
|
6049
6049
|
), { addFrame: F, setSelectedFrameId: E } = W(
|
|
6050
6050
|
(L) => L.actions
|
|
@@ -6094,7 +6094,7 @@ function Du() {
|
|
|
6094
6094
|
F(N.id, $), E($.id);
|
|
6095
6095
|
}, C = () => {
|
|
6096
6096
|
b(!0);
|
|
6097
|
-
}, [R, P] =
|
|
6097
|
+
}, [R, P] = V(!1), U = Pl(ue.DASHBOARD);
|
|
6098
6098
|
async function B() {
|
|
6099
6099
|
const L = ns(
|
|
6100
6100
|
i
|
|
@@ -6157,7 +6157,7 @@ function Du() {
|
|
|
6157
6157
|
c && !v && z && /* @__PURE__ */ e(Dd, {}),
|
|
6158
6158
|
!v && z && /* @__PURE__ */ e(Md, {}),
|
|
6159
6159
|
c && !v && /* @__PURE__ */ s(
|
|
6160
|
-
|
|
6160
|
+
j,
|
|
6161
6161
|
{
|
|
6162
6162
|
variant: "secondary",
|
|
6163
6163
|
className: "h-7 p-2",
|
|
@@ -6165,13 +6165,13 @@ function Du() {
|
|
|
6165
6165
|
disabled: !c,
|
|
6166
6166
|
onClick: O,
|
|
6167
6167
|
children: [
|
|
6168
|
-
/* @__PURE__ */ e(
|
|
6168
|
+
/* @__PURE__ */ e(Le, { className: "mr-2 h-4 w-4" }),
|
|
6169
6169
|
"Frame"
|
|
6170
6170
|
]
|
|
6171
6171
|
}
|
|
6172
6172
|
),
|
|
6173
6173
|
!v && !c && /* @__PURE__ */ s(
|
|
6174
|
-
|
|
6174
|
+
j,
|
|
6175
6175
|
{
|
|
6176
6176
|
variant: "outline",
|
|
6177
6177
|
className: "h-7 p-2",
|
|
@@ -6184,7 +6184,7 @@ function Du() {
|
|
|
6184
6184
|
}
|
|
6185
6185
|
),
|
|
6186
6186
|
c && !v && /* @__PURE__ */ s(
|
|
6187
|
-
|
|
6187
|
+
j,
|
|
6188
6188
|
{
|
|
6189
6189
|
variant: "secondary",
|
|
6190
6190
|
className: "h-7 p-2",
|
|
@@ -6198,7 +6198,7 @@ function Du() {
|
|
|
6198
6198
|
}
|
|
6199
6199
|
),
|
|
6200
6200
|
c && !v && z && l && /* @__PURE__ */ s(
|
|
6201
|
-
|
|
6201
|
+
j,
|
|
6202
6202
|
{
|
|
6203
6203
|
className: "h-7 p-2",
|
|
6204
6204
|
variant: "secondary",
|
|
@@ -6212,7 +6212,7 @@ function Du() {
|
|
|
6212
6212
|
}
|
|
6213
6213
|
),
|
|
6214
6214
|
c && !v && z && x && /* @__PURE__ */ s(
|
|
6215
|
-
|
|
6215
|
+
j,
|
|
6216
6216
|
{
|
|
6217
6217
|
className: "h-7 p-2",
|
|
6218
6218
|
variant: "secondary",
|
|
@@ -6226,11 +6226,11 @@ function Du() {
|
|
|
6226
6226
|
}
|
|
6227
6227
|
),
|
|
6228
6228
|
!y && !v && c && /* @__PURE__ */ e(
|
|
6229
|
-
|
|
6229
|
+
j,
|
|
6230
6230
|
{
|
|
6231
6231
|
className: "h-7 p-2",
|
|
6232
6232
|
variant: "ghost",
|
|
6233
|
-
onClick: () =>
|
|
6233
|
+
onClick: () => M(!0),
|
|
6234
6234
|
size: "sm",
|
|
6235
6235
|
children: /* @__PURE__ */ e(ws, { className: "h-4 w-4" })
|
|
6236
6236
|
}
|
|
@@ -6267,14 +6267,14 @@ function Mu({
|
|
|
6267
6267
|
}, []);
|
|
6268
6268
|
function x() {
|
|
6269
6269
|
var w;
|
|
6270
|
-
return l ? "Loading..." : i ? "Error" : n ? (w = a == null ? void 0 : a.find((
|
|
6270
|
+
return l ? "Loading..." : i ? "Error" : n ? (w = a == null ? void 0 : a.find((M) => M.id === n)) == null ? void 0 : w.name : `Select ${t}`;
|
|
6271
6271
|
}
|
|
6272
|
-
function y(w,
|
|
6273
|
-
r(
|
|
6272
|
+
function y(w, M) {
|
|
6273
|
+
r(M), f(!1);
|
|
6274
6274
|
}
|
|
6275
6275
|
return /* @__PURE__ */ s(it, { open: h, onOpenChange: f, children: [
|
|
6276
6276
|
/* @__PURE__ */ e(ot, { asChild: !0, children: /* @__PURE__ */ s(
|
|
6277
|
-
|
|
6277
|
+
j,
|
|
6278
6278
|
{
|
|
6279
6279
|
ref: u,
|
|
6280
6280
|
variant: "outline",
|
|
@@ -6319,7 +6319,7 @@ function Mu({
|
|
|
6319
6319
|
{
|
|
6320
6320
|
className: "overflow-x-auto",
|
|
6321
6321
|
value: w.name,
|
|
6322
|
-
onSelect: (
|
|
6322
|
+
onSelect: (M) => y(M, w.id),
|
|
6323
6323
|
children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
6324
6324
|
/* @__PURE__ */ e(
|
|
6325
6325
|
_t,
|
|
@@ -6427,20 +6427,20 @@ function zn({
|
|
|
6427
6427
|
return /* @__PURE__ */ e(rt, { delayDuration: 0, children: /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: u === "select" ? g() : v() }) });
|
|
6428
6428
|
}
|
|
6429
6429
|
function Tu({ column: t }) {
|
|
6430
|
-
const [a, n] =
|
|
6430
|
+
const [a, n] = V(!1), r = T((p) => p.selectedTableName), l = T(
|
|
6431
6431
|
(p) => p.selectedSchemaName
|
|
6432
|
-
), i =
|
|
6432
|
+
), i = T(
|
|
6433
6433
|
(p) => p.selectedDatabaseName
|
|
6434
|
-
), c =
|
|
6434
|
+
), c = T(
|
|
6435
6435
|
(p) => p.selectedDatamodelId
|
|
6436
|
-
), o =
|
|
6436
|
+
), o = T((p) => p.sqlGen), { modelItems: d, connectionType: m } = ut(), u = T((p) => p.actions.setSqlGen), h = T((p) => p.actions.setCardSql), f = T((p) => p.actions.setRunSql);
|
|
6437
6437
|
function g(p, x) {
|
|
6438
6438
|
var F;
|
|
6439
6439
|
const y = rl(p, o, x), w = (F = d == null ? void 0 : d.find(
|
|
6440
6440
|
(E) => E.id === c
|
|
6441
6441
|
)) == null ? void 0 : F.name;
|
|
6442
6442
|
u(y);
|
|
6443
|
-
const
|
|
6443
|
+
const M = ll(
|
|
6444
6444
|
y,
|
|
6445
6445
|
nt(l || ""),
|
|
6446
6446
|
nt(r),
|
|
@@ -6448,7 +6448,7 @@ function Tu({ column: t }) {
|
|
|
6448
6448
|
m,
|
|
6449
6449
|
i || ""
|
|
6450
6450
|
);
|
|
6451
|
-
|
|
6451
|
+
M && (h(M), f(!0)), n(!1);
|
|
6452
6452
|
}
|
|
6453
6453
|
function v() {
|
|
6454
6454
|
return /* @__PURE__ */ s("ul", { className: "text-xs", children: [
|
|
@@ -6554,17 +6554,17 @@ function Ou({
|
|
|
6554
6554
|
onClick: t,
|
|
6555
6555
|
column: a
|
|
6556
6556
|
}) {
|
|
6557
|
-
const n = It((u) => u.activeId), r =
|
|
6557
|
+
const n = It((u) => u.activeId), r = T(
|
|
6558
6558
|
(u) => {
|
|
6559
6559
|
var h;
|
|
6560
6560
|
return (h = u.card.queryConfig) == null ? void 0 : h.groupByColumns;
|
|
6561
6561
|
}
|
|
6562
|
-
), l =
|
|
6562
|
+
), l = T(
|
|
6563
6563
|
(u) => {
|
|
6564
6564
|
var h;
|
|
6565
6565
|
return (h = u.card.queryConfig) == null ? void 0 : h.metricColumns;
|
|
6566
6566
|
}
|
|
6567
|
-
), i =
|
|
6567
|
+
), i = T(
|
|
6568
6568
|
(u) => {
|
|
6569
6569
|
var h;
|
|
6570
6570
|
return (h = u.card.queryConfig) == null ? void 0 : h.filterColumns;
|
|
@@ -6630,27 +6630,27 @@ const ja = {
|
|
|
6630
6630
|
id: "__placeholder__"
|
|
6631
6631
|
}, Yt = "droppable-group-by", Gt = "droppable-metrics", Ht = "droppable-pivot-by", xa = "sortable-group-by", ss = "sortable-metrics", ba = "sortable-pivot-by", rs = "droppable-filters", ls = "sortable-filters", qs = "sortable-order-by";
|
|
6632
6632
|
function Au() {
|
|
6633
|
-
const t = It((O) => O.insertIndex), a =
|
|
6633
|
+
const t = It((O) => O.insertIndex), a = T(
|
|
6634
6634
|
(O) => {
|
|
6635
6635
|
var C;
|
|
6636
6636
|
return ((C = O.card.queryConfig) == null ? void 0 : C.groupByColumns) || [];
|
|
6637
6637
|
}
|
|
6638
|
-
), n =
|
|
6638
|
+
), n = T(
|
|
6639
6639
|
(O) => {
|
|
6640
6640
|
var C;
|
|
6641
6641
|
return ((C = O.card.queryConfig) == null ? void 0 : C.metricColumns) || [];
|
|
6642
6642
|
}
|
|
6643
|
-
), r =
|
|
6643
|
+
), r = T(
|
|
6644
6644
|
(O) => {
|
|
6645
6645
|
var C;
|
|
6646
6646
|
return ((C = O.card.queryConfig) == null ? void 0 : C.filterColumns) || [];
|
|
6647
6647
|
}
|
|
6648
|
-
), l =
|
|
6648
|
+
), l = T(
|
|
6649
6649
|
(O) => {
|
|
6650
6650
|
var C;
|
|
6651
6651
|
return ((C = O.card.queryConfig) == null ? void 0 : C.orderBy) || [];
|
|
6652
6652
|
}
|
|
6653
|
-
), i =
|
|
6653
|
+
), i = T(
|
|
6654
6654
|
(O) => {
|
|
6655
6655
|
var C;
|
|
6656
6656
|
return ((C = O.card.queryConfig) == null ? void 0 : C.pivotColumns) || [];
|
|
@@ -6668,7 +6668,7 @@ function Au() {
|
|
|
6668
6668
|
setFilterColumns: v,
|
|
6669
6669
|
setOrderByColumns: p,
|
|
6670
6670
|
setPivotByColumns: x
|
|
6671
|
-
} = se(), { columns: y } = ol(), { formattedTableName: w } = ut(),
|
|
6671
|
+
} = se(), { columns: y } = ol(), { formattedTableName: w } = ut(), M = _n(
|
|
6672
6672
|
Mt(eo, {
|
|
6673
6673
|
activationConstraint: {
|
|
6674
6674
|
distance: 1
|
|
@@ -6902,7 +6902,7 @@ function Au() {
|
|
|
6902
6902
|
handleDragEnd: S,
|
|
6903
6903
|
handleDragStart: E,
|
|
6904
6904
|
handleDragCancel: A,
|
|
6905
|
-
sensors:
|
|
6905
|
+
sensors: M
|
|
6906
6906
|
};
|
|
6907
6907
|
}
|
|
6908
6908
|
function et(t) {
|
|
@@ -6951,25 +6951,25 @@ function Iu({
|
|
|
6951
6951
|
columns: n,
|
|
6952
6952
|
status: r
|
|
6953
6953
|
}) {
|
|
6954
|
-
const l =
|
|
6954
|
+
const l = T((C) => C.sqlGen), i = T((C) => C.isDevMode), c = T(
|
|
6955
6955
|
(C) => C.selectedConnectionId
|
|
6956
|
-
), o =
|
|
6956
|
+
), o = T(
|
|
6957
6957
|
(C) => {
|
|
6958
6958
|
var R, P;
|
|
6959
6959
|
return (P = (R = C.card) == null ? void 0 : R.queryConfig) == null ? void 0 : P.metricColumns;
|
|
6960
6960
|
}
|
|
6961
6961
|
);
|
|
6962
|
-
|
|
6962
|
+
T(
|
|
6963
6963
|
(C) => {
|
|
6964
6964
|
var R, P;
|
|
6965
6965
|
return (P = (R = C.card) == null ? void 0 : R.queryConfig) == null ? void 0 : P.groupByColumns;
|
|
6966
6966
|
}
|
|
6967
6967
|
);
|
|
6968
|
-
const d =
|
|
6968
|
+
const d = T(
|
|
6969
6969
|
(C) => C.selectedDatabaseName
|
|
6970
|
-
), m =
|
|
6970
|
+
), m = T(
|
|
6971
6971
|
(C) => C.selectedSchemaName
|
|
6972
|
-
), u =
|
|
6972
|
+
), u = T((C) => C.selectedTableName), h = T(
|
|
6973
6973
|
(C) => C.selectedDatamodelId
|
|
6974
6974
|
), f = W(
|
|
6975
6975
|
(C) => C.dashboard.aiScopeTables
|
|
@@ -6978,14 +6978,14 @@ function Iu({
|
|
|
6978
6978
|
addColumnToGroupBy: x,
|
|
6979
6979
|
setCardSql: y,
|
|
6980
6980
|
setRunSql: w,
|
|
6981
|
-
setSqlGen:
|
|
6981
|
+
setSqlGen: M,
|
|
6982
6982
|
setIsShowingVisual: F
|
|
6983
6983
|
} = se(), { connectionType: E, modelItems: k, selectedDatamodelName: b } = ut();
|
|
6984
6984
|
function D(C) {
|
|
6985
6985
|
var R;
|
|
6986
6986
|
if (i) {
|
|
6987
6987
|
const P = rl(C, l);
|
|
6988
|
-
|
|
6988
|
+
M(P);
|
|
6989
6989
|
const U = (R = k == null ? void 0 : k.find(
|
|
6990
6990
|
(Y) => Y.id === h
|
|
6991
6991
|
)) == null ? void 0 : R.name, B = ll(
|
|
@@ -7138,7 +7138,7 @@ function Iu({
|
|
|
7138
7138
|
}),
|
|
7139
7139
|
children: [
|
|
7140
7140
|
/* @__PURE__ */ e(
|
|
7141
|
-
|
|
7141
|
+
Le,
|
|
7142
7142
|
{
|
|
7143
7143
|
className: H("mr-1 size-4", {
|
|
7144
7144
|
"text-green-400": z(),
|
|
@@ -7151,7 +7151,7 @@ function Iu({
|
|
|
7151
7151
|
}
|
|
7152
7152
|
),
|
|
7153
7153
|
/* @__PURE__ */ s(
|
|
7154
|
-
|
|
7154
|
+
j,
|
|
7155
7155
|
{
|
|
7156
7156
|
disabled: r !== "Success",
|
|
7157
7157
|
onClick: I,
|
|
@@ -7165,7 +7165,7 @@ function Iu({
|
|
|
7165
7165
|
}
|
|
7166
7166
|
),
|
|
7167
7167
|
/* @__PURE__ */ s(
|
|
7168
|
-
|
|
7168
|
+
j,
|
|
7169
7169
|
{
|
|
7170
7170
|
disabled: r !== "Success",
|
|
7171
7171
|
onClick: S,
|
|
@@ -7214,22 +7214,22 @@ function ei({
|
|
|
7214
7214
|
type: a
|
|
7215
7215
|
}) {
|
|
7216
7216
|
var jt;
|
|
7217
|
-
const n =
|
|
7217
|
+
const n = T((fe) => fe.card), r = T(
|
|
7218
7218
|
(fe) => fe.selectedConnectionId
|
|
7219
|
-
), l = W((fe) => fe.showFilters), i =
|
|
7219
|
+
), l = W((fe) => fe.showFilters), i = T(
|
|
7220
7220
|
(fe) => fe.selectedDatamodelId
|
|
7221
|
-
), c =
|
|
7221
|
+
), c = T(
|
|
7222
7222
|
(fe) => fe.selectedDatabaseName
|
|
7223
|
-
), o =
|
|
7223
|
+
), o = T(
|
|
7224
7224
|
(fe) => fe.selectedSchemaName
|
|
7225
|
-
), d =
|
|
7225
|
+
), d = T((fe) => fe.selectedTableName), m = T((fe) => fe.isDevMode), { setSelectedTableName: u, setIsDevMode: h, setCardSql: f } = se(), {
|
|
7226
7226
|
connectionItems: g,
|
|
7227
7227
|
modelItems: v,
|
|
7228
7228
|
schemaItems: p,
|
|
7229
7229
|
databaseItems: x,
|
|
7230
7230
|
tableItems: y,
|
|
7231
7231
|
columns: w,
|
|
7232
|
-
isConnectionsLoading:
|
|
7232
|
+
isConnectionsLoading: M,
|
|
7233
7233
|
isModelsLoading: F,
|
|
7234
7234
|
isConnectionsError: E,
|
|
7235
7235
|
isModelsError: k,
|
|
@@ -7256,7 +7256,7 @@ function ei({
|
|
|
7256
7256
|
handleTableChange: K,
|
|
7257
7257
|
tableName: ee,
|
|
7258
7258
|
schemaName: Q
|
|
7259
|
-
} = ut(), { data: de, refetch: pe } =
|
|
7259
|
+
} = ut(), { data: de, refetch: pe } = ze(n);
|
|
7260
7260
|
function be() {
|
|
7261
7261
|
return t ? t(Q, ee, w) : /* @__PURE__ */ e(
|
|
7262
7262
|
Iu,
|
|
@@ -7373,7 +7373,7 @@ function ei({
|
|
|
7373
7373
|
title: "Connection",
|
|
7374
7374
|
value: r || "",
|
|
7375
7375
|
onChange: G,
|
|
7376
|
-
isLoading:
|
|
7376
|
+
isLoading: M,
|
|
7377
7377
|
isError: E,
|
|
7378
7378
|
type: "combobox",
|
|
7379
7379
|
connectionTooltip: ((jt = g == null ? void 0 : g.find(
|
|
@@ -7402,7 +7402,7 @@ function ei({
|
|
|
7402
7402
|
/* @__PURE__ */ e(Z, { htmlFor: "dev-mode", children: "Advanced Mode" })
|
|
7403
7403
|
] }),
|
|
7404
7404
|
/* @__PURE__ */ s(
|
|
7405
|
-
|
|
7405
|
+
j,
|
|
7406
7406
|
{
|
|
7407
7407
|
onClick: he,
|
|
7408
7408
|
size: "sm",
|
|
@@ -7425,7 +7425,7 @@ function ti({
|
|
|
7425
7425
|
textClassName: n = "",
|
|
7426
7426
|
copyButtonClassName: r = ""
|
|
7427
7427
|
}) {
|
|
7428
|
-
const [l, i] =
|
|
7428
|
+
const [l, i] = V(!1), c = lt(null), o = lt(!1);
|
|
7429
7429
|
function d() {
|
|
7430
7430
|
t && !o.current && navigator.clipboard.writeText(t);
|
|
7431
7431
|
}
|
|
@@ -7483,7 +7483,7 @@ function ni({
|
|
|
7483
7483
|
error: a,
|
|
7484
7484
|
onDebugWithAssistant: n
|
|
7485
7485
|
}) {
|
|
7486
|
-
const r =
|
|
7486
|
+
const r = T((d) => d.isDevMode), { setIsDevMode: l, setCardSql: i, setRunSql: c } = se();
|
|
7487
7487
|
function o() {
|
|
7488
7488
|
l(!r), i(t), setTimeout(() => {
|
|
7489
7489
|
c(!0);
|
|
@@ -7494,12 +7494,12 @@ function ni({
|
|
|
7494
7494
|
a && /* @__PURE__ */ e(ti, { error: a }),
|
|
7495
7495
|
t && /* @__PURE__ */ e("div", { className: "flex flex-col space-y-1.5", children: /* @__PURE__ */ e("div", { className: "rounded-md", children: /* @__PURE__ */ e(to, { code: t, language: "sql" }) }) })
|
|
7496
7496
|
] }),
|
|
7497
|
-
!r && t && /* @__PURE__ */ s(
|
|
7497
|
+
!r && t && /* @__PURE__ */ s(j, { onClick: o, variant: "secondary", size: "sm", children: [
|
|
7498
7498
|
/* @__PURE__ */ e(Jc, { className: "mr-2 h-4 w-4" }),
|
|
7499
7499
|
"View in SQL Editor"
|
|
7500
7500
|
] }),
|
|
7501
7501
|
a && n && /* @__PURE__ */ s(
|
|
7502
|
-
|
|
7502
|
+
j,
|
|
7503
7503
|
{
|
|
7504
7504
|
onClick: n,
|
|
7505
7505
|
size: "sm",
|
|
@@ -7518,7 +7518,7 @@ function ai({
|
|
|
7518
7518
|
onDebugWithAssistant: n
|
|
7519
7519
|
}) {
|
|
7520
7520
|
return /* @__PURE__ */ s(fs, { openDelay: a ? 0 : 500, children: [
|
|
7521
|
-
/* @__PURE__ */ e(gs, { asChild: !0, children: /* @__PURE__ */ e(
|
|
7521
|
+
/* @__PURE__ */ e(gs, { asChild: !0, children: /* @__PURE__ */ e(j, { variant: "link", className: "h-5 p-0", children: a ? /* @__PURE__ */ e(El, { className: "h-4 w-4 text-red-500" }) : /* @__PURE__ */ e(Jn, { className: "h-4 w-4 text-muted-foreground" }) }) }),
|
|
7522
7522
|
/* @__PURE__ */ e(ys, { align: "start", className: "flex w-[600px]", children: /* @__PURE__ */ e(
|
|
7523
7523
|
ni,
|
|
7524
7524
|
{
|
|
@@ -7641,7 +7641,7 @@ function ju(t) {
|
|
|
7641
7641
|
return on({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(t);
|
|
7642
7642
|
}
|
|
7643
7643
|
function li(t) {
|
|
7644
|
-
const { theme: a } = no(), n = W((p) => p.theme), r =
|
|
7644
|
+
const { theme: a } = no(), n = W((p) => p.theme), r = T((p) => p.frame), l = T((p) => p.card), i = T((p) => p.activeTabCardId), c = ao(), { refetch: o } = ze(l), { updateCardTab: d, setRunSql: m } = se(), u = lt(), h = lt({}), f = r.cards.find((p) => p.id === i), g = me(() => {
|
|
7645
7645
|
let p = "";
|
|
7646
7646
|
return t === "python" && (p = (f == null ? void 0 : f.python) || ul), t === "sql" && (p = (f == null ? void 0 : f.sql) || ""), p;
|
|
7647
7647
|
}, [t, f]);
|
|
@@ -7702,7 +7702,7 @@ function li(t) {
|
|
|
7702
7702
|
return { handleEditorDidMount: v };
|
|
7703
7703
|
}
|
|
7704
7704
|
function Uu() {
|
|
7705
|
-
const t =
|
|
7705
|
+
const t = T((c) => c.card.sql), a = T((c) => c.sqlGen), { setCardSql: n, setSqlGen: r } = se(), { handleEditorDidMount: l } = li("sql");
|
|
7706
7706
|
function i(c) {
|
|
7707
7707
|
n(c), ro(a) || r({});
|
|
7708
7708
|
}
|
|
@@ -7734,7 +7734,7 @@ function Uu() {
|
|
|
7734
7734
|
] });
|
|
7735
7735
|
}
|
|
7736
7736
|
function Bu() {
|
|
7737
|
-
const t =
|
|
7737
|
+
const t = T((l) => l.card.python), { setCardPython: a } = se(), { handleEditorDidMount: n } = li("python");
|
|
7738
7738
|
function r(l) {
|
|
7739
7739
|
a(l);
|
|
7740
7740
|
}
|
|
@@ -7793,26 +7793,26 @@ function Ys({
|
|
|
7793
7793
|
}) {
|
|
7794
7794
|
var c;
|
|
7795
7795
|
const { setCardSql: a } = se();
|
|
7796
|
-
|
|
7797
|
-
const n =
|
|
7796
|
+
T((o) => o.frame);
|
|
7797
|
+
const n = T((o) => o.card);
|
|
7798
7798
|
Us(
|
|
7799
7799
|
((c = n.customCardPreferences) == null ? void 0 : c.url) || ""
|
|
7800
|
-
),
|
|
7800
|
+
), T(
|
|
7801
7801
|
(o) => o.selectedSchemaName
|
|
7802
|
-
),
|
|
7802
|
+
), T(
|
|
7803
7803
|
(o) => o.selectedDatamodelId
|
|
7804
|
-
),
|
|
7804
|
+
), T(
|
|
7805
7805
|
(o) => o.selectedDatabaseName
|
|
7806
|
-
),
|
|
7806
|
+
), T((o) => o.selectedTableName), T(
|
|
7807
7807
|
(o) => o.selectedConnectionId
|
|
7808
|
-
),
|
|
7809
|
-
const r =
|
|
7808
|
+
), T((o) => o.isShowingVisual), n.sql;
|
|
7809
|
+
const r = T((o) => o.onSave), { getUpdatedFrame: l } = Bs();
|
|
7810
7810
|
function i() {
|
|
7811
7811
|
const o = l();
|
|
7812
7812
|
r == null || r(o);
|
|
7813
7813
|
}
|
|
7814
7814
|
return /* @__PURE__ */ s(
|
|
7815
|
-
|
|
7815
|
+
j,
|
|
7816
7816
|
{
|
|
7817
7817
|
onClick: i,
|
|
7818
7818
|
className: "h-8",
|
|
@@ -7826,10 +7826,10 @@ function Ys({
|
|
|
7826
7826
|
);
|
|
7827
7827
|
}
|
|
7828
7828
|
function qu() {
|
|
7829
|
-
const t = Ge(), [a, n] =
|
|
7829
|
+
const t = Ge(), [a, n] = V(!1), r = W(
|
|
7830
7830
|
(m) => m.actions.setIsDashboardPanelOpen
|
|
7831
7831
|
), { setIsVisualEditing: l } = xt(), { getUpdatedFrame: i } = Bs(), c = Kr(), o = Xd();
|
|
7832
|
-
return /* @__PURE__ */ s(
|
|
7832
|
+
return /* @__PURE__ */ s(j, { onClick: () => {
|
|
7833
7833
|
const m = i();
|
|
7834
7834
|
if (!(c != null && c.id)) {
|
|
7835
7835
|
Ne.error("No visual selected");
|
|
@@ -7866,7 +7866,7 @@ function qu() {
|
|
|
7866
7866
|
] });
|
|
7867
7867
|
}
|
|
7868
7868
|
function Gs() {
|
|
7869
|
-
const { setTempQueryData: t, setSqlGen: a } = se(), n = Ge(), r =
|
|
7869
|
+
const { setTempQueryData: t, setSqlGen: a } = se(), n = Ge(), r = T((d) => d.tempQueryData), l = T((d) => d.onClose), i = T((d) => d.card), { queryKey: c } = ze(i);
|
|
7870
7870
|
function o() {
|
|
7871
7871
|
if (r) {
|
|
7872
7872
|
const { queryKey: d, queryData: m } = r;
|
|
@@ -7875,7 +7875,7 @@ function Gs() {
|
|
|
7875
7875
|
a({}), l == null || l();
|
|
7876
7876
|
}
|
|
7877
7877
|
return /* @__PURE__ */ s(
|
|
7878
|
-
|
|
7878
|
+
j,
|
|
7879
7879
|
{
|
|
7880
7880
|
onClick: o,
|
|
7881
7881
|
className: "h-8",
|
|
@@ -7889,7 +7889,7 @@ function Gs() {
|
|
|
7889
7889
|
);
|
|
7890
7890
|
}
|
|
7891
7891
|
function Ra() {
|
|
7892
|
-
const { setTempQueryData: t } = se(), a = Ge(), n =
|
|
7892
|
+
const { setTempQueryData: t } = se(), a = Ge(), n = T((x) => x.isDevMode), r = T((x) => x.tempQueryData), l = T((x) => x.card), { queryKey: i } = ze(l), {
|
|
7893
7893
|
setCardSql: c,
|
|
7894
7894
|
setSqlGen: o,
|
|
7895
7895
|
setCardPython: d,
|
|
@@ -7908,7 +7908,7 @@ function Ra() {
|
|
|
7908
7908
|
}), a.setQueryData(i, null), a.removeQueries({ queryKey: i, exact: !0 }), n && h(vn), c(""), o({}), f(), g(void 0), d(""), m(""), u({}), v("bar");
|
|
7909
7909
|
}
|
|
7910
7910
|
return /* @__PURE__ */ s(
|
|
7911
|
-
|
|
7911
|
+
j,
|
|
7912
7912
|
{
|
|
7913
7913
|
onClick: p,
|
|
7914
7914
|
className: "h-8",
|
|
@@ -7922,24 +7922,24 @@ function Ra() {
|
|
|
7922
7922
|
);
|
|
7923
7923
|
}
|
|
7924
7924
|
function Yu() {
|
|
7925
|
-
const t = Ge(), [a, n] =
|
|
7926
|
-
|
|
7927
|
-
const i =
|
|
7928
|
-
|
|
7925
|
+
const t = Ge(), [a, n] = V(!1), [r, l] = V(!1);
|
|
7926
|
+
T((Y) => Y.frame);
|
|
7927
|
+
const i = T((Y) => Y.card);
|
|
7928
|
+
T((Y) => Y.isShowingVisual), T(
|
|
7929
7929
|
(Y) => Y.selectedConnectionId
|
|
7930
|
-
),
|
|
7930
|
+
), T((Y) => Y.tempQueryData), T(
|
|
7931
7931
|
(Y) => Y.selectedDatabaseName
|
|
7932
|
-
),
|
|
7932
|
+
), T(
|
|
7933
7933
|
(Y) => Y.selectedDatamodelId
|
|
7934
|
-
),
|
|
7934
|
+
), T(
|
|
7935
7935
|
(Y) => Y.selectedSchemaName
|
|
7936
7936
|
);
|
|
7937
|
-
const c =
|
|
7938
|
-
|
|
7939
|
-
const o =
|
|
7937
|
+
const c = T((Y) => Y.showAIDialog);
|
|
7938
|
+
T((Y) => Y.selectedTableName);
|
|
7939
|
+
const o = T((Y) => {
|
|
7940
7940
|
var oe;
|
|
7941
7941
|
return (oe = Y == null ? void 0 : Y.card) == null ? void 0 : oe.sql;
|
|
7942
|
-
}), d =
|
|
7942
|
+
}), d = T((Y) => {
|
|
7943
7943
|
var oe;
|
|
7944
7944
|
return (oe = Y == null ? void 0 : Y.card) == null ? void 0 : oe.python;
|
|
7945
7945
|
}), { sheetFilterValues: m } = lo(), {
|
|
@@ -7953,10 +7953,10 @@ function Yu() {
|
|
|
7953
7953
|
setCardType: x,
|
|
7954
7954
|
setCardPython: y,
|
|
7955
7955
|
runAssistant: w,
|
|
7956
|
-
setShowAIDialog:
|
|
7956
|
+
setShowAIDialog: M
|
|
7957
7957
|
} = se();
|
|
7958
|
-
|
|
7959
|
-
const F =
|
|
7958
|
+
T((Y) => Y.onSave), T((Y) => Y.onClose), T((Y) => Y.actions.setSqlGen);
|
|
7959
|
+
const F = T((Y) => Y.runSql), E = T((Y) => Y.actions.setRunSql), k = T(
|
|
7960
7960
|
(Y) => Y.actions.setIsSqlRunning
|
|
7961
7961
|
), {
|
|
7962
7962
|
data: b,
|
|
@@ -7968,7 +7968,7 @@ function Yu() {
|
|
|
7968
7968
|
queryKey: A,
|
|
7969
7969
|
refetch: O,
|
|
7970
7970
|
errorMessage: C
|
|
7971
|
-
} =
|
|
7971
|
+
} = ze(i);
|
|
7972
7972
|
Me(() => {
|
|
7973
7973
|
if (b && (b.rowLimitExceeded && Ne.error("Row limit (10,000) exceeded. Refine your query.", {
|
|
7974
7974
|
position: "top-center",
|
|
@@ -8025,7 +8025,7 @@ ${d}` : ""}
|
|
|
8025
8025
|
}
|
|
8026
8026
|
),
|
|
8027
8027
|
m && m.length > 0 && /* @__PURE__ */ e(
|
|
8028
|
-
|
|
8028
|
+
j,
|
|
8029
8029
|
{
|
|
8030
8030
|
variant: "ghost",
|
|
8031
8031
|
onClick: () => l(!r),
|
|
@@ -8099,7 +8099,7 @@ ${d}` : ""}
|
|
|
8099
8099
|
children: [
|
|
8100
8100
|
/* @__PURE__ */ s("div", { className: "flex grow items-center gap-2", children: [
|
|
8101
8101
|
/* @__PURE__ */ s(
|
|
8102
|
-
|
|
8102
|
+
j,
|
|
8103
8103
|
{
|
|
8104
8104
|
title: "Shift + Enter",
|
|
8105
8105
|
disabled: D || N,
|
|
@@ -8138,7 +8138,7 @@ ${d}` : ""}
|
|
|
8138
8138
|
{
|
|
8139
8139
|
disabled: c,
|
|
8140
8140
|
onClick: () => {
|
|
8141
|
-
|
|
8141
|
+
M(!0);
|
|
8142
8142
|
},
|
|
8143
8143
|
className: "h-9 w-full cursor-text px-3 text-left text-sm text-muted-foreground",
|
|
8144
8144
|
children: c ? "" : "Type your question..."
|
|
@@ -8229,14 +8229,14 @@ function Gu({ data: t }) {
|
|
|
8229
8229
|
] });
|
|
8230
8230
|
}
|
|
8231
8231
|
function Hu({ card: t }) {
|
|
8232
|
-
var w,
|
|
8233
|
-
const [a, n] =
|
|
8232
|
+
var w, M, F, E, k, b, D, N, I, S, z;
|
|
8233
|
+
const [a, n] = V(!1), [r, l] = V(
|
|
8234
8234
|
[]
|
|
8235
8235
|
), { authToken: i } = Te(), c = vo(i == null ? void 0 : i.accessToken), o = W((A) => A.themeStyle), d = {
|
|
8236
|
-
colors: ((
|
|
8236
|
+
colors: ((M = (w = o == null ? void 0 : o.chart) == null ? void 0 : w.dataset) == null ? void 0 : M.backgroundColor) || []
|
|
8237
8237
|
};
|
|
8238
8238
|
(F = t.customCardPreferences) != null && F.inputData;
|
|
8239
|
-
const { getCard: m } = Ds(((E = t.customCardPreferences) == null ? void 0 : E.url) || ""), u = ((k = t.customCardPreferences) == null ? void 0 : k.visualType) || "single", h =
|
|
8239
|
+
const { getCard: m } = Ds(((E = t.customCardPreferences) == null ? void 0 : E.url) || ""), u = ((k = t.customCardPreferences) == null ? void 0 : k.visualType) || "single", h = T((A) => A.frame), { setCustomCardPreferences: f } = se(), { data: g } = ze(t), v = me((A, O) => {
|
|
8240
8240
|
l((C) => ({
|
|
8241
8241
|
...C,
|
|
8242
8242
|
[A]: O
|
|
@@ -8320,7 +8320,7 @@ function ii({
|
|
|
8320
8320
|
...a
|
|
8321
8321
|
}) {
|
|
8322
8322
|
var D;
|
|
8323
|
-
const n =
|
|
8323
|
+
const n = T((N) => N.card), r = ml(n), l = ((D = n.customCardPreferences) == null ? void 0 : D.showCardHeader) ?? !0, i = T((N) => N.frame), c = W((N) => N.dashboard.filters), o = T((N) => N.actions.setRunSql), { updateFilter: d } = xt(), m = c == null ? void 0 : c.find((N) => N.id === i.filterId), { data: u, isLoading: h, isFetching: f, errorMessage: g, pagination: v, refetch: p } = ze(n), { setCard: x, updateCardInFrame: y } = se(), { data: w } = Ms(n), M = Ue(() => n.type === "pivotTable" && (u != null && u.records) && (u == null ? void 0 : u.records.length) > 0 ? bo({
|
|
8324
8324
|
card: n,
|
|
8325
8325
|
data: {
|
|
8326
8326
|
records: (u == null ? void 0 : u.records) || [],
|
|
@@ -8401,13 +8401,13 @@ function ii({
|
|
|
8401
8401
|
isLoading: h || f
|
|
8402
8402
|
}
|
|
8403
8403
|
) });
|
|
8404
|
-
if (n.type === "pivotTable" &&
|
|
8404
|
+
if (n.type === "pivotTable" && M)
|
|
8405
8405
|
return /* @__PURE__ */ e("div", { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: /* @__PURE__ */ e(
|
|
8406
8406
|
So,
|
|
8407
8407
|
{
|
|
8408
8408
|
card: n,
|
|
8409
|
-
data:
|
|
8410
|
-
options:
|
|
8409
|
+
data: M.data,
|
|
8410
|
+
options: M.options,
|
|
8411
8411
|
onAggregationChange: (N) => {
|
|
8412
8412
|
const I = hr(
|
|
8413
8413
|
N,
|
|
@@ -8540,9 +8540,9 @@ const qa = ({
|
|
|
8540
8540
|
onCodeChange: l
|
|
8541
8541
|
}) => /* @__PURE__ */ s(sn, { defaultValue: "final-config", className: "flex w-1/2 flex-col", children: [
|
|
8542
8542
|
/* @__PURE__ */ s(rn, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
8543
|
-
/* @__PURE__ */ e(
|
|
8544
|
-
/* @__PURE__ */ e(
|
|
8545
|
-
/* @__PURE__ */ e(
|
|
8543
|
+
/* @__PURE__ */ e(Fe, { value: "final-config", children: "Config" }),
|
|
8544
|
+
/* @__PURE__ */ e(Fe, { value: "custom-config", children: "Changes" }),
|
|
8545
|
+
/* @__PURE__ */ e(Fe, { value: "custom-code", children: "Custom Code" })
|
|
8546
8546
|
] }),
|
|
8547
8547
|
/* @__PURE__ */ e(
|
|
8548
8548
|
At,
|
|
@@ -8599,12 +8599,12 @@ const qa = ({
|
|
|
8599
8599
|
onClose: l
|
|
8600
8600
|
}) => /* @__PURE__ */ s(pn, { className: "flex items-center", children: [
|
|
8601
8601
|
/* @__PURE__ */ e(Z, { className: "mr-2 text-red-500", children: t }),
|
|
8602
|
-
/* @__PURE__ */ e(
|
|
8603
|
-
/* @__PURE__ */ e(
|
|
8604
|
-
/* @__PURE__ */ e(
|
|
8602
|
+
/* @__PURE__ */ e(j, { disabled: !a, onClick: n, variant: "outline", children: "Reset" }),
|
|
8603
|
+
/* @__PURE__ */ e(j, { onClick: r, variant: "outline", children: "Apply" }),
|
|
8604
|
+
/* @__PURE__ */ e(j, { onClick: l, variant: "outline", children: "Close" })
|
|
8605
8605
|
] });
|
|
8606
8606
|
function Qu() {
|
|
8607
|
-
const [t, a] =
|
|
8607
|
+
const [t, a] = V(!1), [n, r] = V(""), [l, i] = V(""), [c, o] = V(""), [d, m] = V(""), u = T((E) => E.card), h = T((E) => E.card.customCfg), f = h ? JSON.stringify(h, null, 2) : "", { data: g } = ze(u), { data: v } = Ms(u), { setCardCustomCfg: p, setCustomVisualCode: x } = se(), y = (E) => {
|
|
8608
8608
|
var k, b;
|
|
8609
8609
|
return JSON.stringify(
|
|
8610
8610
|
{
|
|
@@ -8637,7 +8637,7 @@ function Qu() {
|
|
|
8637
8637
|
const D = Mo(E, h);
|
|
8638
8638
|
i(y(D));
|
|
8639
8639
|
}
|
|
8640
|
-
},
|
|
8640
|
+
}, M = () => {
|
|
8641
8641
|
try {
|
|
8642
8642
|
if (c && x(c), l) {
|
|
8643
8643
|
const E = JSON.parse(
|
|
@@ -8685,7 +8685,7 @@ function Qu() {
|
|
|
8685
8685
|
onReset: () => {
|
|
8686
8686
|
i(n), p(null);
|
|
8687
8687
|
},
|
|
8688
|
-
onApply:
|
|
8688
|
+
onApply: M,
|
|
8689
8689
|
onClose: () => a(!1)
|
|
8690
8690
|
}
|
|
8691
8691
|
)
|
|
@@ -8693,7 +8693,7 @@ function Qu() {
|
|
|
8693
8693
|
] });
|
|
8694
8694
|
}
|
|
8695
8695
|
function za(t) {
|
|
8696
|
-
const [a, n] =
|
|
8696
|
+
const [a, n] = V(null);
|
|
8697
8697
|
return a;
|
|
8698
8698
|
}
|
|
8699
8699
|
function Hs() {
|
|
@@ -8707,7 +8707,7 @@ function Hs() {
|
|
|
8707
8707
|
function Zu({
|
|
8708
8708
|
onChartTypeChange: t
|
|
8709
8709
|
}) {
|
|
8710
|
-
const [a, n] =
|
|
8710
|
+
const [a, n] = V([]), {
|
|
8711
8711
|
setCardCustomCfg: r,
|
|
8712
8712
|
setCardPreferences: l,
|
|
8713
8713
|
setCardType: i,
|
|
@@ -8779,7 +8779,7 @@ function oi({
|
|
|
8779
8779
|
onChartTypeChange: t,
|
|
8780
8780
|
iconClassName: a
|
|
8781
8781
|
}) {
|
|
8782
|
-
const { setCardType: n, setCardPreferences: r, setIsDevMode: l } =
|
|
8782
|
+
const { setCardType: n, setCardPreferences: r, setIsDevMode: l } = T(
|
|
8783
8783
|
(u) => u.actions
|
|
8784
8784
|
), { setCardCustomCfg: i, setCustomCardPreferences: c, setQueryConfig: o } = se();
|
|
8785
8785
|
function d(u, h) {
|
|
@@ -9024,10 +9024,10 @@ function ci({
|
|
|
9024
9024
|
variant: t = "ghost"
|
|
9025
9025
|
}) {
|
|
9026
9026
|
var i, c;
|
|
9027
|
-
const [a, n] =
|
|
9027
|
+
const [a, n] = V(!1), r = T((o) => o.card), l = r.type;
|
|
9028
9028
|
return W((o) => o.isVisualEditing), /* @__PURE__ */ s(it, { open: a, onOpenChange: n, children: [
|
|
9029
9029
|
/* @__PURE__ */ e(ot, { asChild: !0, children: /* @__PURE__ */ e(
|
|
9030
|
-
|
|
9030
|
+
j,
|
|
9031
9031
|
{
|
|
9032
9032
|
size: "sm",
|
|
9033
9033
|
variant: t || "ghost",
|
|
@@ -9068,21 +9068,21 @@ function Ar(t, a) {
|
|
|
9068
9068
|
}
|
|
9069
9069
|
function nm() {
|
|
9070
9070
|
var R, P, U, B, Y, oe;
|
|
9071
|
-
const [t, a] =
|
|
9071
|
+
const [t, a] = V(!1), n = T((ae) => {
|
|
9072
9072
|
var G;
|
|
9073
9073
|
return (G = ae.card) == null ? void 0 : G.preferences;
|
|
9074
|
-
}), r =
|
|
9074
|
+
}), r = T((ae) => {
|
|
9075
9075
|
var G;
|
|
9076
9076
|
return (G = ae.card) == null ? void 0 : G.type;
|
|
9077
|
-
}), l = vl(n, {}), [i, c] =
|
|
9077
|
+
}), l = vl(n, {}), [i, c] = V(
|
|
9078
9078
|
Ar(n, r)
|
|
9079
|
-
), [o, d] =
|
|
9079
|
+
), [o, d] = V(
|
|
9080
9080
|
((U = (P = (R = n == null ? void 0 : n.chartOptions) == null ? void 0 : R.scales) == null ? void 0 : P[l]) == null ? void 0 : U.min) || ""
|
|
9081
|
-
), [m, u] =
|
|
9081
|
+
), [m, u] = V(
|
|
9082
9082
|
((oe = (Y = (B = n == null ? void 0 : n.chartOptions) == null ? void 0 : B.scales) == null ? void 0 : Y[l]) == null ? void 0 : oe.max) || ""
|
|
9083
|
-
), [h, f] =
|
|
9083
|
+
), [h, f] = V(o || m ? "custom" : "auto"), [g, v] = V(""), [p, x] = V(0), [y, w] = V(""), [M, F] = V(""), [E, k] = V(""), b = T(
|
|
9084
9084
|
(ae) => ae.actions.setCardPreferences
|
|
9085
|
-
), { updateCardInFrame: D } = se(), N =
|
|
9085
|
+
), { updateCardInFrame: D } = se(), N = T((ae) => ae.card), I = ["pie", "doughnut", "polarArea", "funnel"].includes(
|
|
9086
9086
|
r
|
|
9087
9087
|
);
|
|
9088
9088
|
Me(() => {
|
|
@@ -9120,7 +9120,7 @@ function nm() {
|
|
|
9120
9120
|
/* @__PURE__ */ s(
|
|
9121
9121
|
ge,
|
|
9122
9122
|
{
|
|
9123
|
-
value:
|
|
9123
|
+
value: M || "none",
|
|
9124
9124
|
onValueChange: (G) => F(G === "none" ? "" : G),
|
|
9125
9125
|
children: [
|
|
9126
9126
|
/* @__PURE__ */ e(ye, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(ve, {}) }),
|
|
@@ -9273,7 +9273,7 @@ function nm() {
|
|
|
9273
9273
|
numberAxisFormat: {
|
|
9274
9274
|
decimalPlaces: p,
|
|
9275
9275
|
suffix: y,
|
|
9276
|
-
currency:
|
|
9276
|
+
currency: M,
|
|
9277
9277
|
locale: E
|
|
9278
9278
|
}
|
|
9279
9279
|
};
|
|
@@ -9297,7 +9297,7 @@ function nm() {
|
|
|
9297
9297
|
A(),
|
|
9298
9298
|
/* @__PURE__ */ e(Oo, {}),
|
|
9299
9299
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e(
|
|
9300
|
-
|
|
9300
|
+
j,
|
|
9301
9301
|
{
|
|
9302
9302
|
onClick: C,
|
|
9303
9303
|
variant: "secondary",
|
|
@@ -9310,17 +9310,17 @@ function nm() {
|
|
|
9310
9310
|
] });
|
|
9311
9311
|
}
|
|
9312
9312
|
function am() {
|
|
9313
|
-
const t =
|
|
9313
|
+
const t = T(
|
|
9314
9314
|
(o) => {
|
|
9315
9315
|
var d, m, u, h;
|
|
9316
9316
|
return (h = (u = (m = (d = o.card.preferences) == null ? void 0 : d.chartOptions) == null ? void 0 : m.plugins) == null ? void 0 : u.legend) == null ? void 0 : h.position;
|
|
9317
9317
|
}
|
|
9318
|
-
), a =
|
|
9318
|
+
), a = T(
|
|
9319
9319
|
(o) => {
|
|
9320
9320
|
var d, m, u, h;
|
|
9321
9321
|
return (h = (u = (m = (d = o.card.preferences) == null ? void 0 : d.chartOptions) == null ? void 0 : m.plugins) == null ? void 0 : u.legend) == null ? void 0 : h.align;
|
|
9322
9322
|
}
|
|
9323
|
-
), n =
|
|
9323
|
+
), n = T(
|
|
9324
9324
|
(o) => {
|
|
9325
9325
|
var d, m, u, h;
|
|
9326
9326
|
return (h = (u = (m = (d = o.card.preferences) == null ? void 0 : d.chartOptions) == null ? void 0 : m.plugins) == null ? void 0 : u.legend) == null ? void 0 : h.display;
|
|
@@ -9436,12 +9436,12 @@ function am() {
|
|
|
9436
9436
|
] });
|
|
9437
9437
|
}
|
|
9438
9438
|
function sm() {
|
|
9439
|
-
const t =
|
|
9439
|
+
const t = T(
|
|
9440
9440
|
(i) => {
|
|
9441
9441
|
var c, o;
|
|
9442
9442
|
return (o = (c = i.card.preferences) == null ? void 0 : c.chartOptions) == null ? void 0 : o.indexAxis;
|
|
9443
9443
|
}
|
|
9444
|
-
), a =
|
|
9444
|
+
), a = T((i) => i.card.type), { setChartOrientation: n } = T((i) => i.actions);
|
|
9445
9445
|
function r() {
|
|
9446
9446
|
return /* @__PURE__ */ e(
|
|
9447
9447
|
ce,
|
|
@@ -9469,7 +9469,7 @@ function sm() {
|
|
|
9469
9469
|
return /* @__PURE__ */ e(ne, { children: a === "funnel" ? l() : r() });
|
|
9470
9470
|
}
|
|
9471
9471
|
function di() {
|
|
9472
|
-
const t =
|
|
9472
|
+
const t = T((c) => c.card), a = T((c) => c.isShowingVisual), n = T(
|
|
9473
9473
|
(c) => {
|
|
9474
9474
|
var o, d;
|
|
9475
9475
|
return (d = (o = c.card) == null ? void 0 : o.preferences) == null ? void 0 : d.chartOptions;
|
|
@@ -9513,7 +9513,7 @@ function di() {
|
|
|
9513
9513
|
] }) : null;
|
|
9514
9514
|
}
|
|
9515
9515
|
function rm() {
|
|
9516
|
-
const t =
|
|
9516
|
+
const t = T((v) => v.frame), a = T((v) => v.card), { setFrame: n, setActiveTabCardId: r, setCard: l, updateCardInFrame: i } = se(), c = (v, p) => {
|
|
9517
9517
|
v.dataTransfer.setData("tabIndex", p.toString());
|
|
9518
9518
|
}, o = (v) => {
|
|
9519
9519
|
v.preventDefault();
|
|
@@ -9594,7 +9594,7 @@ function rm() {
|
|
|
9594
9594
|
}
|
|
9595
9595
|
return /* @__PURE__ */ e(rn, { className: "group mx-4 justify-between overflow-x-auto", children: /* @__PURE__ */ s("div", { className: "flex items-center", children: [
|
|
9596
9596
|
t.cards.map((v, p) => /* @__PURE__ */ s(
|
|
9597
|
-
|
|
9597
|
+
Fe,
|
|
9598
9598
|
{
|
|
9599
9599
|
draggable: !0,
|
|
9600
9600
|
onDragStart: (x) => c(x, p),
|
|
@@ -9628,16 +9628,16 @@ function rm() {
|
|
|
9628
9628
|
v.id
|
|
9629
9629
|
)),
|
|
9630
9630
|
/* @__PURE__ */ e(
|
|
9631
|
-
|
|
9631
|
+
j,
|
|
9632
9632
|
{
|
|
9633
9633
|
className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
|
|
9634
9634
|
variant: "outline",
|
|
9635
9635
|
onClick: () => f(a),
|
|
9636
|
-
children: /* @__PURE__ */ e(
|
|
9636
|
+
children: /* @__PURE__ */ e(Le, { className: "h-4 w-4" })
|
|
9637
9637
|
}
|
|
9638
9638
|
),
|
|
9639
9639
|
/* @__PURE__ */ e(
|
|
9640
|
-
|
|
9640
|
+
j,
|
|
9641
9641
|
{
|
|
9642
9642
|
className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
|
|
9643
9643
|
variant: "outline",
|
|
@@ -9648,7 +9648,7 @@ function rm() {
|
|
|
9648
9648
|
] }) });
|
|
9649
9649
|
}
|
|
9650
9650
|
function ui() {
|
|
9651
|
-
const t =
|
|
9651
|
+
const t = T((p) => p.frame), a = T((p) => p.card), n = T((p) => p.isSqlRunning), r = T((p) => p.isDevMode), { setFrame: l, setActiveTabCardId: i, setCard: c, setIsDevMode: o, setRunSql: d } = se(), { data: m, isLoading: u, isFetching: h } = ze(a);
|
|
9652
9652
|
function f(p) {
|
|
9653
9653
|
const x = t.cards.find((y) => y.id === p);
|
|
9654
9654
|
if (x != null && x.sql) {
|
|
@@ -9705,9 +9705,9 @@ function ra({
|
|
|
9705
9705
|
children: t
|
|
9706
9706
|
}) {
|
|
9707
9707
|
var F, E;
|
|
9708
|
-
|
|
9709
|
-
const a =
|
|
9710
|
-
|
|
9708
|
+
T((k) => k.frame);
|
|
9709
|
+
const a = T((k) => k.card), n = T((k) => k.isDevMode), r = T((k) => k.isShowingVisual), l = W((k) => k.isVisualEditing), i = T((k) => k.pythonStdOut);
|
|
9710
|
+
T((k) => k.actions.setRunSql);
|
|
9711
9711
|
const {
|
|
9712
9712
|
setFrame: c,
|
|
9713
9713
|
setCard: o,
|
|
@@ -9715,7 +9715,7 @@ function ra({
|
|
|
9715
9715
|
runAssistant: m,
|
|
9716
9716
|
setIsDevMode: u,
|
|
9717
9717
|
setCardPreferences: h
|
|
9718
|
-
} = se(), { data: f, isLoading: g, isFetching: v, errorMessage: p, refetch: x } =
|
|
9718
|
+
} = se(), { data: f, isLoading: g, isFetching: v, errorMessage: p, refetch: x } = ze(a);
|
|
9719
9719
|
function y() {
|
|
9720
9720
|
const k = JSON.stringify(f == null ? void 0 : f.records, null, 2), b = new Blob([k], { type: "application/json" }), D = URL.createObjectURL(b), N = document.createElement("a");
|
|
9721
9721
|
N.href = D, N.download = `${a.title}.json`, N.click();
|
|
@@ -9730,7 +9730,7 @@ function ra({
|
|
|
9730
9730
|
`), D = new Blob([b], { type: "text/csv" }), N = URL.createObjectURL(D), I = document.createElement("a");
|
|
9731
9731
|
I.href = N, I.download = `${a.title}.csv`, I.click();
|
|
9732
9732
|
}
|
|
9733
|
-
function
|
|
9733
|
+
function M() {
|
|
9734
9734
|
const k = `Can you get the documentation for ${a.type} chart?`;
|
|
9735
9735
|
m(k);
|
|
9736
9736
|
}
|
|
@@ -9746,12 +9746,12 @@ function ra({
|
|
|
9746
9746
|
children: [
|
|
9747
9747
|
r && /* @__PURE__ */ s("div", { className: "flex grow items-center", children: [
|
|
9748
9748
|
/* @__PURE__ */ e(ci, {}),
|
|
9749
|
-
l && /* @__PURE__ */ e(ce, { tooltip: "Visual Docs", onClick:
|
|
9749
|
+
l && /* @__PURE__ */ e(ce, { tooltip: "Visual Docs", onClick: M, children: /* @__PURE__ */ e(Pc, { className: "size-4" }) }),
|
|
9750
9750
|
!["table", "custom"].includes(a.type) && l && /* @__PURE__ */ e(Qu, {})
|
|
9751
9751
|
] }),
|
|
9752
9752
|
!r && /* @__PURE__ */ s("div", { className: "flex grow items-center gap-1", children: [
|
|
9753
9753
|
/* @__PURE__ */ e(
|
|
9754
|
-
|
|
9754
|
+
j,
|
|
9755
9755
|
{
|
|
9756
9756
|
className: "h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70",
|
|
9757
9757
|
variant: "ghost",
|
|
@@ -9761,7 +9761,7 @@ function ra({
|
|
|
9761
9761
|
}
|
|
9762
9762
|
),
|
|
9763
9763
|
/* @__PURE__ */ e(
|
|
9764
|
-
|
|
9764
|
+
j,
|
|
9765
9765
|
{
|
|
9766
9766
|
className: "h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70",
|
|
9767
9767
|
variant: "ghost",
|
|
@@ -9847,7 +9847,7 @@ function ra({
|
|
|
9847
9847
|
) : /* @__PURE__ */ e(ne, { children: "No Active Card" });
|
|
9848
9848
|
}
|
|
9849
9849
|
function lm() {
|
|
9850
|
-
const t =
|
|
9850
|
+
const t = T((n) => n.pythonStdOut);
|
|
9851
9851
|
if (!t) return null;
|
|
9852
9852
|
const a = t.replace(/\n/g, "<br>");
|
|
9853
9853
|
return /* @__PURE__ */ s("div", { className: "relative flex w-full flex-col border-r", children: [
|
|
@@ -9859,7 +9859,7 @@ function lm() {
|
|
|
9859
9859
|
] });
|
|
9860
9860
|
}
|
|
9861
9861
|
function im() {
|
|
9862
|
-
const t =
|
|
9862
|
+
const t = T((n) => n.isShowingVisual), a = T(
|
|
9863
9863
|
(n) => n.actions.setIsShowingVisual
|
|
9864
9864
|
);
|
|
9865
9865
|
return /* @__PURE__ */ s("div", { className: "flex items-center space-x-2", children: [
|
|
@@ -9877,9 +9877,9 @@ function im() {
|
|
|
9877
9877
|
}
|
|
9878
9878
|
function om() {
|
|
9879
9879
|
var p, x;
|
|
9880
|
-
const t =
|
|
9880
|
+
const t = T(
|
|
9881
9881
|
(y) => y.card.customCardPreferences
|
|
9882
|
-
), { data: a } = Hs(), n = (a == null ? void 0 : a.plugins) || [], r =
|
|
9882
|
+
), { data: a } = Hs(), n = (a == null ? void 0 : a.plugins) || [], r = T((y) => y.card), l = T((y) => y.frame), i = (t == null ? void 0 : t.visualType) || "single", { setCustomCardPreferences: c } = se(), { components: o, manifest: d } = Ds(
|
|
9883
9883
|
(t == null ? void 0 : t.url) || ""
|
|
9884
9884
|
), m = (p = d == null ? void 0 : d.visuals) == null ? void 0 : p.find(
|
|
9885
9885
|
(y) => y.name === (t == null ? void 0 : t.componentName)
|
|
@@ -9899,8 +9899,8 @@ function om() {
|
|
|
9899
9899
|
});
|
|
9900
9900
|
}
|
|
9901
9901
|
function h(y) {
|
|
9902
|
-
var
|
|
9903
|
-
const w = (
|
|
9902
|
+
var M, F;
|
|
9903
|
+
const w = (M = l == null ? void 0 : l.cards) == null ? void 0 : M.filter((E) => {
|
|
9904
9904
|
var k;
|
|
9905
9905
|
return ((k = E == null ? void 0 : E.customCardPreferences) == null ? void 0 : k.visualType) !== "multiple";
|
|
9906
9906
|
}).map((E) => ({
|
|
@@ -9931,7 +9931,7 @@ function om() {
|
|
|
9931
9931
|
);
|
|
9932
9932
|
}) });
|
|
9933
9933
|
}
|
|
9934
|
-
function f(y, w,
|
|
9934
|
+
function f(y, w, M = [], F = "") {
|
|
9935
9935
|
var E, k;
|
|
9936
9936
|
return t ? y === "input" ? /* @__PURE__ */ e(
|
|
9937
9937
|
je,
|
|
@@ -9954,7 +9954,7 @@ function om() {
|
|
|
9954
9954
|
{
|
|
9955
9955
|
className: "h-8 w-full",
|
|
9956
9956
|
label: "",
|
|
9957
|
-
options:
|
|
9957
|
+
options: M,
|
|
9958
9958
|
value: ((k = t == null ? void 0 : t.settings) == null ? void 0 : k[w]) || F,
|
|
9959
9959
|
onValueChange: (b) => {
|
|
9960
9960
|
c({
|
|
@@ -9967,15 +9967,15 @@ function om() {
|
|
|
9967
9967
|
}
|
|
9968
9968
|
function g(y) {
|
|
9969
9969
|
const w = Object.entries((y == null ? void 0 : y.settings) || {});
|
|
9970
|
-
return /* @__PURE__ */ e("div", { className: "space-y-3", children: w.map(([
|
|
9970
|
+
return /* @__PURE__ */ e("div", { className: "space-y-3", children: w.map(([M, F]) => /* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
9971
9971
|
/* @__PURE__ */ e(Z, { children: F.title }),
|
|
9972
9972
|
f(
|
|
9973
9973
|
F.ui,
|
|
9974
|
-
|
|
9974
|
+
M,
|
|
9975
9975
|
F.options,
|
|
9976
9976
|
F.defaultValue
|
|
9977
9977
|
)
|
|
9978
|
-
] },
|
|
9978
|
+
] }, M)) });
|
|
9979
9979
|
}
|
|
9980
9980
|
function v(y) {
|
|
9981
9981
|
t && c({
|
|
@@ -10018,8 +10018,8 @@ function om() {
|
|
|
10018
10018
|
value: i,
|
|
10019
10019
|
onValueChange: v,
|
|
10020
10020
|
children: /* @__PURE__ */ s(rn, { className: "h-9 w-full", children: [
|
|
10021
|
-
/* @__PURE__ */ e(
|
|
10022
|
-
/* @__PURE__ */ e(
|
|
10021
|
+
/* @__PURE__ */ e(Fe, { className: "h-7 w-full", value: "single", children: "Single Visual" }),
|
|
10022
|
+
/* @__PURE__ */ e(Fe, { className: "h-7 w-full", value: "multiple", children: "Multi-Visual" })
|
|
10023
10023
|
] })
|
|
10024
10024
|
}
|
|
10025
10025
|
)
|
|
@@ -10060,12 +10060,12 @@ function om() {
|
|
|
10060
10060
|
);
|
|
10061
10061
|
}
|
|
10062
10062
|
function cn() {
|
|
10063
|
-
const [t, a] =
|
|
10063
|
+
const [t, a] = V([]), n = T((m) => m.card.preferences), { setFilterOnClickColumnIndex: r, setCardPreferences: l } = T(
|
|
10064
10064
|
(m) => m.actions
|
|
10065
|
-
), i =
|
|
10065
|
+
), i = T(
|
|
10066
10066
|
(m) => m.queryResultColumns
|
|
10067
10067
|
);
|
|
10068
|
-
|
|
10068
|
+
T(
|
|
10069
10069
|
(m) => {
|
|
10070
10070
|
var u;
|
|
10071
10071
|
return (u = m.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
|
|
@@ -10178,15 +10178,15 @@ function cn() {
|
|
|
10178
10178
|
}
|
|
10179
10179
|
function cm({ idx: t }) {
|
|
10180
10180
|
var o;
|
|
10181
|
-
const a =
|
|
10181
|
+
const a = T((d) => {
|
|
10182
10182
|
var m;
|
|
10183
10183
|
return (m = d.card) == null ? void 0 : m.preferences;
|
|
10184
|
-
}), n =
|
|
10184
|
+
}), n = T(
|
|
10185
10185
|
(d) => {
|
|
10186
10186
|
var m;
|
|
10187
10187
|
return (m = d.card.preferences) == null ? void 0 : m.datasetOptions;
|
|
10188
10188
|
}
|
|
10189
|
-
), r =
|
|
10189
|
+
), r = T(
|
|
10190
10190
|
(d) => d.actions.setCardPreferences
|
|
10191
10191
|
), l = (o = a == null ? void 0 : a.chartOptions) == null ? void 0 : o.indexAxis, i = n == null ? void 0 : n.find((d) => d.idx === t);
|
|
10192
10192
|
function c(d, m) {
|
|
@@ -10280,7 +10280,7 @@ function cm({ idx: t }) {
|
|
|
10280
10280
|
] });
|
|
10281
10281
|
}
|
|
10282
10282
|
function dm() {
|
|
10283
|
-
const t =
|
|
10283
|
+
const t = T((i) => i.card), { data: a } = ze(t), { keys: n } = Ja((a == null ? void 0 : a.records) || []), r = n.slice(1).filter((i) => !Po.includes(i));
|
|
10284
10284
|
let l = r;
|
|
10285
10285
|
if (["stackedBar", "stackedLine"].includes(t.type)) {
|
|
10286
10286
|
const i = _o({
|
|
@@ -10318,12 +10318,12 @@ function Xs({
|
|
|
10318
10318
|
] }) });
|
|
10319
10319
|
}
|
|
10320
10320
|
function mi() {
|
|
10321
|
-
const t =
|
|
10321
|
+
const t = T((d) => d.card), a = T(
|
|
10322
10322
|
(d) => {
|
|
10323
10323
|
var m, u, h;
|
|
10324
10324
|
return (h = (u = (m = d == null ? void 0 : d.card) == null ? void 0 : m.preferences) == null ? void 0 : u.chartOptions) == null ? void 0 : h.indexAxis;
|
|
10325
10325
|
}
|
|
10326
|
-
), { data: n } =
|
|
10326
|
+
), { data: n } = ze(t), r = a === "y" ? "Metric" : "Dimension", l = a === "y" ? "Dimension" : "Metric", { dimensionKeys: i, transformedMetricKeys: c, keys: o } = dm();
|
|
10327
10327
|
return o.length === 0 ? null : /* @__PURE__ */ s("div", { className: "space-y-4", children: [
|
|
10328
10328
|
/* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
10329
10329
|
/* @__PURE__ */ e(Z, { children: r }),
|
|
@@ -10362,15 +10362,15 @@ function pi({
|
|
|
10362
10362
|
iconClassName: r,
|
|
10363
10363
|
children: l
|
|
10364
10364
|
}) {
|
|
10365
|
-
const i =
|
|
10365
|
+
const i = T((u) => {
|
|
10366
10366
|
var h;
|
|
10367
10367
|
return (h = u.card) == null ? void 0 : h.preferences;
|
|
10368
|
-
}), c =
|
|
10368
|
+
}), c = T(
|
|
10369
10369
|
(u) => {
|
|
10370
10370
|
var h, f;
|
|
10371
10371
|
return (f = (h = u.card) == null ? void 0 : h.preferences) == null ? void 0 : f.datasetOptions;
|
|
10372
10372
|
}
|
|
10373
|
-
), o = c == null ? void 0 : c.find((u) => u.idx === a), { setCardPreferences: d } =
|
|
10373
|
+
), o = c == null ? void 0 : c.find((u) => u.idx === a), { setCardPreferences: d } = T((u) => u.actions);
|
|
10374
10374
|
function m(u) {
|
|
10375
10375
|
if (!o)
|
|
10376
10376
|
d({
|
|
@@ -10443,20 +10443,20 @@ function pi({
|
|
|
10443
10443
|
);
|
|
10444
10444
|
}
|
|
10445
10445
|
function fi() {
|
|
10446
|
-
const t =
|
|
10446
|
+
const t = T((g) => g.selectedConnectionId), a = T((g) => g.selectedDatamodelId), n = T((g) => g.selectedDatabaseName), r = T((g) => g.selectedSchemaName), l = T((g) => g.selectedTableName), i = W((g) => g.dashboard.filters) || [], c = W((g) => g.actions.addFilter), o = W((g) => g.actions.removeFilter), { removeFilterValues: d } = xt(), { modelItems: m, tableName: u, connectionType: h } = ut();
|
|
10447
10447
|
function f(g, v = "dashboard") {
|
|
10448
10448
|
var b;
|
|
10449
10449
|
const p = nt(g.column_name), x = nt(n || ""), y = nt(r || ""), w = nt(u);
|
|
10450
|
-
let
|
|
10450
|
+
let M = Vo({
|
|
10451
10451
|
schemaName: y,
|
|
10452
10452
|
tableName: w,
|
|
10453
10453
|
connectionType: h,
|
|
10454
10454
|
databaseName: x
|
|
10455
|
-
}), F = `${
|
|
10455
|
+
}), F = `${M}.${p}`;
|
|
10456
10456
|
const E = (b = m == null ? void 0 : m.find(
|
|
10457
10457
|
(D) => D.id === a
|
|
10458
10458
|
)) == null ? void 0 : b.name;
|
|
10459
|
-
a && a !== "none" && (F = `${fr}.${E}.${p}`,
|
|
10459
|
+
a && a !== "none" && (F = `${fr}.${E}.${p}`, M = `${fr}.${E}`);
|
|
10460
10460
|
const k = i == null ? void 0 : i.find(
|
|
10461
10461
|
(D) => D.column === F && D.table === w && (D.database === x || D.database === n)
|
|
10462
10462
|
);
|
|
@@ -10478,7 +10478,7 @@ function fi() {
|
|
|
10478
10478
|
operation: "in",
|
|
10479
10479
|
sql: Ha(
|
|
10480
10480
|
g.data_type,
|
|
10481
|
-
|
|
10481
|
+
M,
|
|
10482
10482
|
p
|
|
10483
10483
|
)
|
|
10484
10484
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
@@ -10496,7 +10496,7 @@ function fi() {
|
|
|
10496
10496
|
operation: "in",
|
|
10497
10497
|
sql: Ha(
|
|
10498
10498
|
g.data_type,
|
|
10499
|
-
|
|
10499
|
+
M,
|
|
10500
10500
|
p
|
|
10501
10501
|
)
|
|
10502
10502
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
@@ -10508,7 +10508,7 @@ function fi() {
|
|
|
10508
10508
|
function In() {
|
|
10509
10509
|
const t = W(
|
|
10510
10510
|
(o) => o.dashboard.filters
|
|
10511
|
-
), a =
|
|
10511
|
+
), a = T((o) => o.frame), { setFrame: n } = se(), { columns: r } = ut(), { assignFilter: l } = fi();
|
|
10512
10512
|
function i(o) {
|
|
10513
10513
|
const d = l(o, "frame");
|
|
10514
10514
|
n({ ...a, filterId: d });
|
|
@@ -10528,7 +10528,7 @@ function um({
|
|
|
10528
10528
|
const [n, r] = He.useState(!1), [l, i] = He.useState("");
|
|
10529
10529
|
return /* @__PURE__ */ s(it, { open: n, onOpenChange: r, children: [
|
|
10530
10530
|
/* @__PURE__ */ e(ot, { asChild: !0, children: /* @__PURE__ */ s(
|
|
10531
|
-
|
|
10531
|
+
j,
|
|
10532
10532
|
{
|
|
10533
10533
|
size: "sm",
|
|
10534
10534
|
variant: "outline",
|
|
@@ -10615,7 +10615,7 @@ function mm({
|
|
|
10615
10615
|
] }) });
|
|
10616
10616
|
}
|
|
10617
10617
|
function Fa() {
|
|
10618
|
-
const t =
|
|
10618
|
+
const t = T((o) => o.card.type), a = T((o) => o.isDevMode), n = T((o) => o.card.preferences), { setCardPreferences: r } = T((o) => o.actions);
|
|
10619
10619
|
function l(o) {
|
|
10620
10620
|
var u;
|
|
10621
10621
|
const d = {
|
|
@@ -10754,7 +10754,7 @@ const pm = {
|
|
|
10754
10754
|
]
|
|
10755
10755
|
};
|
|
10756
10756
|
function gm() {
|
|
10757
|
-
const t =
|
|
10757
|
+
const t = T((a) => a.card.type);
|
|
10758
10758
|
return /* @__PURE__ */ s("div", { className: "space-y-6 p-6", children: [
|
|
10759
10759
|
/* @__PURE__ */ e(
|
|
10760
10760
|
Nt,
|
|
@@ -11022,8 +11022,8 @@ const xm = [
|
|
|
11022
11022
|
value: t
|
|
11023
11023
|
}));
|
|
11024
11024
|
function Cm() {
|
|
11025
|
-
var d, m, u, h, f, g, v, p, x, y, w,
|
|
11026
|
-
const t =
|
|
11025
|
+
var d, m, u, h, f, g, v, p, x, y, w, M, F, E, k, b, D, N;
|
|
11026
|
+
const t = T((I) => I.card), a = (m = (d = t == null ? void 0 : t.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : m.topoJsonUrl, [n, r] = V(
|
|
11027
11027
|
((h = (u = t == null ? void 0 : t.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : h.customTopoJsonUrl) || ""
|
|
11028
11028
|
), { setCardPreferences: l } = se(), { data: i } = Ms(t), c = Object.keys((i == null ? void 0 : i.objects) || {}).map((I) => ({
|
|
11029
11029
|
label: I,
|
|
@@ -11162,7 +11162,7 @@ function Cm() {
|
|
|
11162
11162
|
className: `h-9 w-full ${Dt}`,
|
|
11163
11163
|
type: "number",
|
|
11164
11164
|
step: 0.1,
|
|
11165
|
-
value: ((
|
|
11165
|
+
value: ((M = (w = t.preferences) == null ? void 0 : w.mapVisualOptions) == null ? void 0 : M.projectionScale) || 1,
|
|
11166
11166
|
onChange: (I) => {
|
|
11167
11167
|
var S;
|
|
11168
11168
|
l({
|
|
@@ -11228,7 +11228,7 @@ function Cm() {
|
|
|
11228
11228
|
}
|
|
11229
11229
|
function wm() {
|
|
11230
11230
|
var r;
|
|
11231
|
-
const t =
|
|
11231
|
+
const t = T((l) => l.card.preferences), { setCardPreferences: a } = T((l) => l.actions);
|
|
11232
11232
|
function n(l) {
|
|
11233
11233
|
a({
|
|
11234
11234
|
...t,
|
|
@@ -11306,7 +11306,7 @@ function la({
|
|
|
11306
11306
|
] }) });
|
|
11307
11307
|
}
|
|
11308
11308
|
function Sm() {
|
|
11309
|
-
const t =
|
|
11309
|
+
const t = T(
|
|
11310
11310
|
(r) => {
|
|
11311
11311
|
var l, i;
|
|
11312
11312
|
return (i = (l = r == null ? void 0 : r.card) == null ? void 0 : l.preferences) == null ? void 0 : i.sortChart;
|
|
@@ -11388,10 +11388,10 @@ function km({
|
|
|
11388
11388
|
cardType: t = "table"
|
|
11389
11389
|
}) {
|
|
11390
11390
|
console.log("cardType", t);
|
|
11391
|
-
const a =
|
|
11391
|
+
const a = T((l) => {
|
|
11392
11392
|
var i;
|
|
11393
11393
|
return (i = l.card) == null ? void 0 : i.preferences;
|
|
11394
|
-
}), n =
|
|
11394
|
+
}), n = T(
|
|
11395
11395
|
(l) => l.actions.setCardPreferences
|
|
11396
11396
|
);
|
|
11397
11397
|
return /* @__PURE__ */ s("div", { className: "space-y-6 px-6 py-2", children: [
|
|
@@ -11470,7 +11470,7 @@ const Dm = /* @__PURE__ */ s("div", { className: "space-y-4 font-mono text-xs",
|
|
|
11470
11470
|
] })
|
|
11471
11471
|
] });
|
|
11472
11472
|
function Em() {
|
|
11473
|
-
const t =
|
|
11473
|
+
const t = T((n) => n.card.type);
|
|
11474
11474
|
function a(n) {
|
|
11475
11475
|
switch (n) {
|
|
11476
11476
|
case "stackedBar":
|
|
@@ -11695,7 +11695,7 @@ function zm({
|
|
|
11695
11695
|
function yi({
|
|
11696
11696
|
column: t
|
|
11697
11697
|
}) {
|
|
11698
|
-
const a =
|
|
11698
|
+
const a = T((d) => d.card.type), n = T(
|
|
11699
11699
|
(d) => {
|
|
11700
11700
|
var m, u;
|
|
11701
11701
|
return (u = (m = d.card) == null ? void 0 : m.config) == null ? void 0 : u.metricColumns;
|
|
@@ -11723,7 +11723,7 @@ function Fm({
|
|
|
11723
11723
|
onRemoveColumn: n,
|
|
11724
11724
|
droppableId: r
|
|
11725
11725
|
}) {
|
|
11726
|
-
const [l, i] =
|
|
11726
|
+
const [l, i] = V(!1), {
|
|
11727
11727
|
updateGroupByColumnOld: c,
|
|
11728
11728
|
updateMetricColumnOld: o,
|
|
11729
11729
|
updatePivotByColumnOld: d
|
|
@@ -11813,7 +11813,7 @@ function Fm({
|
|
|
11813
11813
|
}
|
|
11814
11814
|
);
|
|
11815
11815
|
}
|
|
11816
|
-
function
|
|
11816
|
+
function M() {
|
|
11817
11817
|
const k = ft(t.type);
|
|
11818
11818
|
if (r === Gt)
|
|
11819
11819
|
return /* @__PURE__ */ e(Am, { column: t });
|
|
@@ -11866,7 +11866,7 @@ function Fm({
|
|
|
11866
11866
|
/* @__PURE__ */ s("div", { className: "grow", children: [
|
|
11867
11867
|
/* @__PURE__ */ s("div", { className: "flex h-8 grow items-center justify-between rounded-md bg-muted", children: [
|
|
11868
11868
|
E(),
|
|
11869
|
-
|
|
11869
|
+
M(),
|
|
11870
11870
|
F()
|
|
11871
11871
|
] }),
|
|
11872
11872
|
l && w()
|
|
@@ -11896,7 +11896,7 @@ function Ga({
|
|
|
11896
11896
|
var p, x;
|
|
11897
11897
|
const { setNodeRef: c, isOver: o, over: d } = As({
|
|
11898
11898
|
id: t
|
|
11899
|
-
}), m = It((y) => y.activeId), u =
|
|
11899
|
+
}), m = It((y) => y.activeId), u = T((y) => {
|
|
11900
11900
|
var w;
|
|
11901
11901
|
return (w = y.card) == null ? void 0 : w.type;
|
|
11902
11902
|
}), h = o || ((x = (p = d == null ? void 0 : d.data) == null ? void 0 : p.current) == null ? void 0 : x.type) === l, f = m ? r : n, g = l === xa ? "Rows" : l === ba ? "Pivot Columns" : "Columns";
|
|
@@ -11954,13 +11954,13 @@ function vi({ children: t, id: a, type: n }) {
|
|
|
11954
11954
|
return /* @__PURE__ */ e("div", { ...l, ...r, ref: i, style: m, children: t });
|
|
11955
11955
|
}
|
|
11956
11956
|
function Pm() {
|
|
11957
|
-
const t =
|
|
11957
|
+
const t = T((y) => {
|
|
11958
11958
|
var w;
|
|
11959
11959
|
return (w = y.card.queryConfig) == null ? void 0 : w.orderBy;
|
|
11960
|
-
}) || [], a =
|
|
11960
|
+
}) || [], a = T((y) => {
|
|
11961
11961
|
var w;
|
|
11962
11962
|
return (w = y.card.queryConfig) == null ? void 0 : w.groupByColumns;
|
|
11963
|
-
}) || [], n =
|
|
11963
|
+
}) || [], n = T((y) => {
|
|
11964
11964
|
var w;
|
|
11965
11965
|
return (w = y.card.queryConfig) == null ? void 0 : w.metricColumns;
|
|
11966
11966
|
}) || [], { addOrderByColumn: r, removeOrderByColumn: l, updateOrderByColumn: i } = se(), c = [...a, ...n];
|
|
@@ -11971,22 +11971,22 @@ function Pm() {
|
|
|
11971
11971
|
value: y.label || y.name
|
|
11972
11972
|
}));
|
|
11973
11973
|
function f(y, w) {
|
|
11974
|
-
const
|
|
11975
|
-
return
|
|
11974
|
+
const M = g(y);
|
|
11975
|
+
return M ? M.role === "metric" ? w === "asc" ? m : u : w === "asc" ? o : d : null;
|
|
11976
11976
|
}
|
|
11977
11977
|
function g(y) {
|
|
11978
11978
|
return c.find((w) => w.id === y);
|
|
11979
11979
|
}
|
|
11980
11980
|
function v(y) {
|
|
11981
11981
|
const w = t.find(
|
|
11982
|
-
(
|
|
11982
|
+
(M) => M.columnId === y
|
|
11983
11983
|
);
|
|
11984
11984
|
if (w) {
|
|
11985
|
-
const
|
|
11985
|
+
const M = {
|
|
11986
11986
|
...w,
|
|
11987
11987
|
direction: w.direction === "asc" ? "desc" : "asc"
|
|
11988
11988
|
};
|
|
11989
|
-
i(
|
|
11989
|
+
i(M);
|
|
11990
11990
|
}
|
|
11991
11991
|
}
|
|
11992
11992
|
const p = (y) => {
|
|
@@ -11997,7 +11997,7 @@ function Pm() {
|
|
|
11997
11997
|
};
|
|
11998
11998
|
function x(y) {
|
|
11999
11999
|
const w = t.find(
|
|
12000
|
-
(
|
|
12000
|
+
(M) => M.columnId === y
|
|
12001
12001
|
);
|
|
12002
12002
|
w && l(w);
|
|
12003
12003
|
}
|
|
@@ -12021,7 +12021,7 @@ function Pm() {
|
|
|
12021
12021
|
}
|
|
12022
12022
|
) }),
|
|
12023
12023
|
t.map((y) => {
|
|
12024
|
-
var w,
|
|
12024
|
+
var w, M;
|
|
12025
12025
|
return /* @__PURE__ */ e(
|
|
12026
12026
|
vi,
|
|
12027
12027
|
{
|
|
@@ -12035,7 +12035,7 @@ function Pm() {
|
|
|
12035
12035
|
/* @__PURE__ */ s("div", { className: "flex h-full grow items-center justify-between gap-2 rounded-sm bg-muted px-2", children: [
|
|
12036
12036
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
|
|
12037
12037
|
/* @__PURE__ */ e(Ol, { className: "size-3 cursor-move text-muted-foreground hover:text-foreground" }),
|
|
12038
|
-
/* @__PURE__ */ e(Xs, { className: "w-[175px] text-sm", children: ((w = g(y.columnId)) == null ? void 0 : w.label) || ((
|
|
12038
|
+
/* @__PURE__ */ e(Xs, { className: "w-[175px] text-sm", children: ((w = g(y.columnId)) == null ? void 0 : w.label) || ((M = g(y.columnId)) == null ? void 0 : M.name) })
|
|
12039
12039
|
] }),
|
|
12040
12040
|
/* @__PURE__ */ e(
|
|
12041
12041
|
"button",
|
|
@@ -12068,21 +12068,21 @@ function Pm() {
|
|
|
12068
12068
|
);
|
|
12069
12069
|
}
|
|
12070
12070
|
function _m() {
|
|
12071
|
-
const t =
|
|
12071
|
+
const t = T(
|
|
12072
12072
|
(x) => {
|
|
12073
12073
|
var y;
|
|
12074
12074
|
return ((y = x.card.queryConfig) == null ? void 0 : y.groupByColumns) || [];
|
|
12075
12075
|
}
|
|
12076
|
-
), a =
|
|
12076
|
+
), a = T((x) => x.card.type), n = It(
|
|
12077
12077
|
(x) => x.previewGroupByColumns
|
|
12078
|
-
), r =
|
|
12078
|
+
), r = T(
|
|
12079
12079
|
(x) => {
|
|
12080
12080
|
var y;
|
|
12081
12081
|
return ((y = x.card.queryConfig) == null ? void 0 : y.metricColumns) || [];
|
|
12082
12082
|
}
|
|
12083
12083
|
), l = It(
|
|
12084
12084
|
(x) => x.previewMetricColumns
|
|
12085
|
-
), i =
|
|
12085
|
+
), i = T(
|
|
12086
12086
|
(x) => {
|
|
12087
12087
|
var y;
|
|
12088
12088
|
return ((y = x.card.queryConfig) == null ? void 0 : y.pivotColumns) || [];
|
|
@@ -12155,7 +12155,7 @@ function er({
|
|
|
12155
12155
|
sortableType: r,
|
|
12156
12156
|
className: l
|
|
12157
12157
|
}) {
|
|
12158
|
-
const [i, c] =
|
|
12158
|
+
const [i, c] = V(!1), { removeEditorFilter: o, clearEditorFilter: d } = se(), m = T(
|
|
12159
12159
|
(h) => {
|
|
12160
12160
|
var f, g;
|
|
12161
12161
|
return (g = (f = h.card.queryConfig) == null ? void 0 : f.filters) == null ? void 0 : g.some(
|
|
@@ -12221,27 +12221,27 @@ function Vm({
|
|
|
12221
12221
|
column: t,
|
|
12222
12222
|
sortableType: a
|
|
12223
12223
|
}) {
|
|
12224
|
-
const n = W((
|
|
12225
|
-
(
|
|
12224
|
+
const n = W((M) => M.themeStyle), r = T(
|
|
12225
|
+
(M) => {
|
|
12226
12226
|
var F, E;
|
|
12227
|
-
return (E = (F =
|
|
12227
|
+
return (E = (F = M.card) == null ? void 0 : F.queryConfig) == null ? void 0 : E.filters;
|
|
12228
12228
|
}
|
|
12229
|
-
), l =
|
|
12230
|
-
(
|
|
12229
|
+
), l = T(
|
|
12230
|
+
(M) => {
|
|
12231
12231
|
var F, E;
|
|
12232
|
-
return (E = (F =
|
|
12232
|
+
return (E = (F = M.card.queryConfig) == null ? void 0 : F.filterColumns) == null ? void 0 : E.find(
|
|
12233
12233
|
(k) => k.name === t.name
|
|
12234
12234
|
);
|
|
12235
12235
|
}
|
|
12236
12236
|
), { selectedConnectionId: i, selectedDatabaseName: c, selectedTableName: o } = ut(), d = Ue(() => {
|
|
12237
|
-
var
|
|
12238
|
-
return (
|
|
12237
|
+
var M;
|
|
12238
|
+
return (M = r == null ? void 0 : r.find(
|
|
12239
12239
|
(F) => F.filterColumnName === t.name
|
|
12240
|
-
)) == null ? void 0 :
|
|
12240
|
+
)) == null ? void 0 : M.filterValue;
|
|
12241
12241
|
}, [r, t.name]), m = Ue(() => Array.isArray(d) ? d.map(
|
|
12242
|
-
(
|
|
12243
|
-
id:
|
|
12244
|
-
value:
|
|
12242
|
+
(M) => ({
|
|
12243
|
+
id: M,
|
|
12244
|
+
value: M
|
|
12245
12245
|
})
|
|
12246
12246
|
) : [], [d]), { updateEditorFilterValue: u } = se(), h = {
|
|
12247
12247
|
column: t.name,
|
|
@@ -12264,8 +12264,8 @@ function Vm({
|
|
|
12264
12264
|
};
|
|
12265
12265
|
}) : [];
|
|
12266
12266
|
}, [f, h.column]);
|
|
12267
|
-
function y(
|
|
12268
|
-
const F =
|
|
12267
|
+
function y(M) {
|
|
12268
|
+
const F = M.map((E) => E.id);
|
|
12269
12269
|
u(t.name, F);
|
|
12270
12270
|
}
|
|
12271
12271
|
function w() {
|
|
@@ -12303,7 +12303,7 @@ function Vm({
|
|
|
12303
12303
|
);
|
|
12304
12304
|
}
|
|
12305
12305
|
function jm({ columnName: t }) {
|
|
12306
|
-
const { setEditorFilterMode: a } = se(), n =
|
|
12306
|
+
const { setEditorFilterMode: a } = se(), n = T(
|
|
12307
12307
|
(l) => {
|
|
12308
12308
|
var i, c;
|
|
12309
12309
|
return (c = (i = l.card.queryConfig) == null ? void 0 : i.filterColumns) == null ? void 0 : c.find(
|
|
@@ -12315,7 +12315,7 @@ function jm({ columnName: t }) {
|
|
|
12315
12315
|
(n == null ? void 0 : n.mode) === "exclude" ? a(t, "include") : a(t, "exclude");
|
|
12316
12316
|
}
|
|
12317
12317
|
return /* @__PURE__ */ e(
|
|
12318
|
-
|
|
12318
|
+
j,
|
|
12319
12319
|
{
|
|
12320
12320
|
onClick: r,
|
|
12321
12321
|
variant: "secondary",
|
|
@@ -12332,7 +12332,7 @@ function Um({
|
|
|
12332
12332
|
column: t,
|
|
12333
12333
|
sortableType: a
|
|
12334
12334
|
}) {
|
|
12335
|
-
const [n, r] =
|
|
12335
|
+
const [n, r] = V(!1), { selectedConnectionId: l, selectedDatabaseName: i, selectedTableName: c } = ut(), o = {
|
|
12336
12336
|
column: t.name,
|
|
12337
12337
|
sql: t.sql,
|
|
12338
12338
|
// this is the sql query to get the data
|
|
@@ -12354,7 +12354,7 @@ function Um({
|
|
|
12354
12354
|
function w() {
|
|
12355
12355
|
x(t.name, null, !0), v(p);
|
|
12356
12356
|
}
|
|
12357
|
-
function
|
|
12357
|
+
function M() {
|
|
12358
12358
|
return d || m ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(ks, { className: "h-8 w-72 bg-foreground/10" }) }) : u ? /* @__PURE__ */ e("div", { className: "h-8 w-72 bg-muted px-2", children: "Error" }) : f ? /* @__PURE__ */ e(
|
|
12359
12359
|
Yo,
|
|
12360
12360
|
{
|
|
@@ -12376,7 +12376,7 @@ function Um({
|
|
|
12376
12376
|
id: t.id,
|
|
12377
12377
|
sortableType: a,
|
|
12378
12378
|
column: t,
|
|
12379
|
-
children:
|
|
12379
|
+
children: M()
|
|
12380
12380
|
}
|
|
12381
12381
|
);
|
|
12382
12382
|
}
|
|
@@ -12448,7 +12448,7 @@ function $m() {
|
|
|
12448
12448
|
return /* @__PURE__ */ e("div", { className: "flex h-8 w-60 items-center space-x-2 rounded-md border border-dashed border-muted-foreground bg-background px-2 py-1 text-sm text-muted-foreground", children: "Drop here" });
|
|
12449
12449
|
}
|
|
12450
12450
|
function qm() {
|
|
12451
|
-
const t =
|
|
12451
|
+
const t = T(
|
|
12452
12452
|
(l) => {
|
|
12453
12453
|
var i;
|
|
12454
12454
|
return ((i = l.card.queryConfig) == null ? void 0 : i.filterColumns) || [];
|
|
@@ -12472,12 +12472,12 @@ function qm() {
|
|
|
12472
12472
|
) });
|
|
12473
12473
|
}
|
|
12474
12474
|
function Ym() {
|
|
12475
|
-
const t =
|
|
12475
|
+
const t = T((i) => i.card), a = T((i) => i.showAIDialog), { setShowAIDialog: n } = se(), { data: r, errorMessage: l } = ze(t);
|
|
12476
12476
|
return /* @__PURE__ */ s("section", { className: "flex justify-between gap-2 p-4", children: [
|
|
12477
12477
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
|
|
12478
12478
|
/* @__PURE__ */ e(Ra, {}),
|
|
12479
12479
|
!a && /* @__PURE__ */ s(
|
|
12480
|
-
|
|
12480
|
+
j,
|
|
12481
12481
|
{
|
|
12482
12482
|
onClick: () => n(!0),
|
|
12483
12483
|
variant: "secondary",
|
|
@@ -12498,7 +12498,7 @@ function Ym() {
|
|
|
12498
12498
|
] });
|
|
12499
12499
|
}
|
|
12500
12500
|
function Gm() {
|
|
12501
|
-
const t = lt(null), a = lt(null), n =
|
|
12501
|
+
const t = lt(null), a = lt(null), n = T((o) => o.isShowingVisual), r = T((o) => o.showAIDialog), l = T((o) => o.isDevMode);
|
|
12502
12502
|
Me(() => {
|
|
12503
12503
|
var o, d, m, u;
|
|
12504
12504
|
r ? ((o = t.current) == null || o.resize(0), (d = a.current) == null || d.resize(0)) : ((m = t.current) == null || m.resize(25), (u = a.current) == null || u.resize(25));
|
|
@@ -12590,10 +12590,10 @@ function Gm() {
|
|
|
12590
12590
|
function Hm(t) {
|
|
12591
12591
|
const a = Go(
|
|
12592
12592
|
(_) => _.currentAIContext
|
|
12593
|
-
), [n, r] =
|
|
12593
|
+
), [n, r] = V(""), [l, i] = V(null), { authToken: c } = Te(), o = T((_) => {
|
|
12594
12594
|
var ie;
|
|
12595
12595
|
return (ie = _ == null ? void 0 : _.card) == null ? void 0 : ie.sql;
|
|
12596
|
-
}), d =
|
|
12596
|
+
}), d = T((_) => _.isDevMode), m = T((_) => {
|
|
12597
12597
|
var ie;
|
|
12598
12598
|
return (ie = _ == null ? void 0 : _.card) == null ? void 0 : ie.python;
|
|
12599
12599
|
}), {
|
|
@@ -12602,11 +12602,11 @@ function Hm(t) {
|
|
|
12602
12602
|
setRunSql: f,
|
|
12603
12603
|
switchCardType: g,
|
|
12604
12604
|
setQueryConfig: v
|
|
12605
|
-
} = se(), p =
|
|
12605
|
+
} = se(), p = T((_) => _.currentAssitantScope) || [], x = T((_) => _.userInputForAI), y = T((_) => _.triggerAIRun), w = T((_) => _.card), M = T(
|
|
12606
12606
|
(_) => _.selectedDatabaseName
|
|
12607
|
-
), F =
|
|
12607
|
+
), F = T((_) => _.selectedTableName), E = T(
|
|
12608
12608
|
(_) => _.selectedConnectionId
|
|
12609
|
-
), k =
|
|
12609
|
+
), k = T(
|
|
12610
12610
|
(_) => _.selectedSchemaName
|
|
12611
12611
|
), b = W(
|
|
12612
12612
|
(_) => _.dashboard.aiScopeTables
|
|
@@ -12614,7 +12614,7 @@ function Hm(t) {
|
|
|
12614
12614
|
errorMessage: D,
|
|
12615
12615
|
refetch: N,
|
|
12616
12616
|
data: I
|
|
12617
|
-
} =
|
|
12617
|
+
} = ze(w), { setTriggerAIRun: S, setCurrentAssitantScope: z, setCardConfig: A } = se(), { selectedDatamodelName: O, connectionType: C, selectedDatamodelId: R } = ut(), {
|
|
12618
12618
|
messages: P,
|
|
12619
12619
|
setMessages: U,
|
|
12620
12620
|
reload: B,
|
|
@@ -12728,7 +12728,7 @@ function Hm(t) {
|
|
|
12728
12728
|
}
|
|
12729
12729
|
function be() {
|
|
12730
12730
|
const _ = {
|
|
12731
|
-
databaseName:
|
|
12731
|
+
databaseName: M || "",
|
|
12732
12732
|
schemaName: k || "",
|
|
12733
12733
|
tableName: F || "",
|
|
12734
12734
|
datamodelId: R || "",
|
|
@@ -12740,7 +12740,7 @@ function Hm(t) {
|
|
|
12740
12740
|
}
|
|
12741
12741
|
function he() {
|
|
12742
12742
|
const _ = {
|
|
12743
|
-
databaseName:
|
|
12743
|
+
databaseName: M || "",
|
|
12744
12744
|
schemaName: k || "",
|
|
12745
12745
|
tableName: F || "",
|
|
12746
12746
|
datamodelName: pa(O),
|
|
@@ -12797,9 +12797,9 @@ const Jm = [
|
|
|
12797
12797
|
}
|
|
12798
12798
|
];
|
|
12799
12799
|
function Ir() {
|
|
12800
|
-
const t = lt(null), a = lt(null), [n, r] =
|
|
12800
|
+
const t = lt(null), a = lt(null), [n, r] = V(!1), [l, i] = V(us), [c, o] = V(!1), [d, m] = V(!1), u = Zo(), { setCurrentAIContext: h } = Xo(), f = W((K) => K.dashboard.aiContext), g = T((K) => K.card.dataSource), v = T((K) => K.actions.setCardSql), p = T((K) => K.actions.setRunSql), x = T((K) => K.showAIDialog), y = W(
|
|
12801
12801
|
(K) => K.handleOpenAssistantProfile
|
|
12802
|
-
), { setShowAIDialog: w, setCardPython:
|
|
12802
|
+
), { setShowAIDialog: w, setCardPython: M } = se(), { setDataSource: F } = se(), { assistantProfile: E } = ec(), {
|
|
12803
12803
|
messages: k,
|
|
12804
12804
|
setMessages: b,
|
|
12805
12805
|
reload: D,
|
|
@@ -12825,7 +12825,7 @@ function Ir() {
|
|
|
12825
12825
|
}));
|
|
12826
12826
|
}, [x, g, h]);
|
|
12827
12827
|
function B(K, ee) {
|
|
12828
|
-
ee === "sql" ? (v(K), p(!0)) : ee === "python" && (
|
|
12828
|
+
ee === "sql" ? (v(K), p(!0)) : ee === "python" && (M(K), p(!0));
|
|
12829
12829
|
}
|
|
12830
12830
|
function Y() {
|
|
12831
12831
|
var K;
|
|
@@ -12853,7 +12853,7 @@ function Ir() {
|
|
|
12853
12853
|
function L() {
|
|
12854
12854
|
return /* @__PURE__ */ s(Nn, { children: [
|
|
12855
12855
|
/* @__PURE__ */ e(Cn, { asChild: !0, children: /* @__PURE__ */ e(
|
|
12856
|
-
|
|
12856
|
+
j,
|
|
12857
12857
|
{
|
|
12858
12858
|
className: "h-7 p-2 text-muted-foreground hover:text-foreground",
|
|
12859
12859
|
size: "sm",
|
|
@@ -12909,7 +12909,7 @@ function Ir() {
|
|
|
12909
12909
|
children: [
|
|
12910
12910
|
q(),
|
|
12911
12911
|
y && /* @__PURE__ */ e(
|
|
12912
|
-
|
|
12912
|
+
j,
|
|
12913
12913
|
{
|
|
12914
12914
|
variant: "outline",
|
|
12915
12915
|
size: "sm",
|
|
@@ -12941,7 +12941,7 @@ function Ir() {
|
|
|
12941
12941
|
}
|
|
12942
12942
|
),
|
|
12943
12943
|
/* @__PURE__ */ e(
|
|
12944
|
-
|
|
12944
|
+
j,
|
|
12945
12945
|
{
|
|
12946
12946
|
variant: "ghost",
|
|
12947
12947
|
className: "h-8 text-muted-foreground hover:text-foreground",
|
|
@@ -13090,7 +13090,7 @@ const tr = (t) => {
|
|
|
13090
13090
|
removeMetricColumn: o,
|
|
13091
13091
|
removePivotByColumn: d,
|
|
13092
13092
|
removeSortByColumn: m
|
|
13093
|
-
} = se(), u =
|
|
13093
|
+
} = se(), u = T((z) => z.card.type), h = t == null ? void 0 : t.id, f = me(
|
|
13094
13094
|
(z) => {
|
|
13095
13095
|
if (!(t != null && t.config)) return [];
|
|
13096
13096
|
switch (z) {
|
|
@@ -13253,7 +13253,7 @@ const tr = (t) => {
|
|
|
13253
13253
|
});
|
|
13254
13254
|
},
|
|
13255
13255
|
[h, f, r]
|
|
13256
|
-
),
|
|
13256
|
+
), M = me(
|
|
13257
13257
|
(z, A) => {
|
|
13258
13258
|
if (console.log("handleValueAliasesChange", z, A), !h) return;
|
|
13259
13259
|
console.log("handleValueAliasesChange", z, A);
|
|
@@ -13366,7 +13366,7 @@ const tr = (t) => {
|
|
|
13366
13366
|
handleDateFormatChange: x,
|
|
13367
13367
|
handleGranularityChange: y,
|
|
13368
13368
|
handleAliasTemplateChange: w,
|
|
13369
|
-
handleValueAliasesChange:
|
|
13369
|
+
handleValueAliasesChange: M,
|
|
13370
13370
|
removeField: I,
|
|
13371
13371
|
handleFieldClick: N,
|
|
13372
13372
|
// KPI-specific handlers
|
|
@@ -13397,7 +13397,7 @@ function Qm({ field: t }) {
|
|
|
13397
13397
|
transform: l,
|
|
13398
13398
|
transition: i,
|
|
13399
13399
|
isDragging: c
|
|
13400
|
-
} = An({ id: t.id }), [o, d] =
|
|
13400
|
+
} = An({ id: t.id }), [o, d] = V(!1), m = T((v) => v.card), { handleFieldClick: u } = tr(m), h = {
|
|
13401
13401
|
transform: zt.Transform.toString(l),
|
|
13402
13402
|
transition: i
|
|
13403
13403
|
};
|
|
@@ -13495,32 +13495,32 @@ function Qm({ field: t }) {
|
|
|
13495
13495
|
);
|
|
13496
13496
|
}
|
|
13497
13497
|
function Zm() {
|
|
13498
|
-
const [t, a] =
|
|
13498
|
+
const [t, a] = V(""), [n, r] = V("all"), l = T((M) => M.card.dataSource), {
|
|
13499
13499
|
columns: i = [],
|
|
13500
13500
|
columnGroups: c = [],
|
|
13501
13501
|
isLoading: o,
|
|
13502
13502
|
error: d
|
|
13503
13503
|
} = Ea(), m = i.filter(
|
|
13504
|
-
(
|
|
13505
|
-
), u = (
|
|
13506
|
-
if (
|
|
13504
|
+
(M) => M.name.toLowerCase().includes(t.toLowerCase()) || M.dataType.toLowerCase().includes(t.toLowerCase()) || M.qualifiedEntityName && M.qualifiedEntityName.toLowerCase().includes(t.toLowerCase())
|
|
13505
|
+
), u = (M) => {
|
|
13506
|
+
if (M.dataType === "number" || M.dataType === "integer" || M.dataType === "float" || M.dataType === "decimal" || M.dataType === "currency")
|
|
13507
13507
|
return "metrics";
|
|
13508
|
-
const F = st(
|
|
13508
|
+
const F = st(M.dataType);
|
|
13509
13509
|
return ["date", "string", "boolean"].includes(F) ? "dimensions" : F === "number" ? "metrics" : "dimensions";
|
|
13510
13510
|
}, f = (n === "all" ? m : m.filter(
|
|
13511
|
-
(
|
|
13512
|
-
)).reduce((
|
|
13511
|
+
(M) => u(M) === n
|
|
13512
|
+
)).reduce((M, F) => {
|
|
13513
13513
|
const E = F.qualifiedEntityName || "Other Fields";
|
|
13514
|
-
return
|
|
13514
|
+
return M[E] || (M[E] = {
|
|
13515
13515
|
label: cc(F.entityName),
|
|
13516
13516
|
fields: []
|
|
13517
|
-
}),
|
|
13517
|
+
}), M[E].fields.push(F), M;
|
|
13518
13518
|
}, {}), v = Object.keys(f), p = m.filter(
|
|
13519
|
-
(
|
|
13519
|
+
(M) => u(M) === "dimensions"
|
|
13520
13520
|
).length, x = m.filter(
|
|
13521
|
-
(
|
|
13521
|
+
(M) => u(M) === "metrics"
|
|
13522
13522
|
).length, y = m.filter(
|
|
13523
|
-
(
|
|
13523
|
+
(M) => u(M) === "calculated"
|
|
13524
13524
|
).length, w = m.length > 0;
|
|
13525
13525
|
return o ? /* @__PURE__ */ e("div", { className: "flex h-[calc(100vh-200px)] w-[290px] flex-col items-center justify-center", children: /* @__PURE__ */ e(fa, { size: "md", color: "muted", "aria-label": "Loading data" }) }) : d ? /* @__PURE__ */ s("div", { className: "flex h-[calc(100vh-200px)] w-[290px] flex-col items-center justify-center", children: [
|
|
13526
13526
|
/* @__PURE__ */ e(Rt, { className: "mb-4 h-12 w-12 text-red-300" }),
|
|
@@ -13541,7 +13541,7 @@ function Zm() {
|
|
|
13541
13541
|
type: "text",
|
|
13542
13542
|
placeholder: "Search fields...",
|
|
13543
13543
|
value: t,
|
|
13544
|
-
onChange: (
|
|
13544
|
+
onChange: (M) => a(M.target.value)
|
|
13545
13545
|
}
|
|
13546
13546
|
)
|
|
13547
13547
|
] }),
|
|
@@ -13550,22 +13550,22 @@ function Zm() {
|
|
|
13550
13550
|
{
|
|
13551
13551
|
defaultValue: "all",
|
|
13552
13552
|
value: n,
|
|
13553
|
-
onValueChange: (
|
|
13553
|
+
onValueChange: (M) => r(M),
|
|
13554
13554
|
className: "mb-4",
|
|
13555
13555
|
children: /* @__PURE__ */ s(rn, { className: "grid h-9 w-full grid-cols-4", children: [
|
|
13556
|
-
/* @__PURE__ */ s(
|
|
13556
|
+
/* @__PURE__ */ s(Fe, { value: "all", className: "text-xs", children: [
|
|
13557
13557
|
"All",
|
|
13558
13558
|
/* @__PURE__ */ e("span", { className: "ml-2 text-xs font-semibold", children: m.length })
|
|
13559
13559
|
] }),
|
|
13560
|
-
/* @__PURE__ */ s(
|
|
13560
|
+
/* @__PURE__ */ s(Fe, { value: "dimensions", className: "text-xs", children: [
|
|
13561
13561
|
/* @__PURE__ */ e(dc, { className: "size-4 shrink-0" }),
|
|
13562
13562
|
/* @__PURE__ */ e("span", { className: "ml-2 text-xs font-semibold", children: p })
|
|
13563
13563
|
] }),
|
|
13564
|
-
/* @__PURE__ */ s(
|
|
13564
|
+
/* @__PURE__ */ s(Fe, { value: "metrics", className: "text-xs", children: [
|
|
13565
13565
|
/* @__PURE__ */ e(hs, { className: "size-4 shrink-0" }),
|
|
13566
13566
|
/* @__PURE__ */ e("span", { className: "ml-2 text-xs font-semibold", children: x })
|
|
13567
13567
|
] }),
|
|
13568
|
-
/* @__PURE__ */ s(
|
|
13568
|
+
/* @__PURE__ */ s(Fe, { value: "calculated", className: "text-xs", children: [
|
|
13569
13569
|
/* @__PURE__ */ e(Ml, { className: "size-4 shrink-0" }),
|
|
13570
13570
|
/* @__PURE__ */ e("span", { className: "ml-2 text-xs font-semibold", children: y })
|
|
13571
13571
|
] })
|
|
@@ -13580,15 +13580,15 @@ function Zm() {
|
|
|
13580
13580
|
type: "multiple",
|
|
13581
13581
|
defaultValue: v,
|
|
13582
13582
|
className: "space-y-2",
|
|
13583
|
-
children: Object.entries(f).map(([
|
|
13584
|
-
const E = c.find((k) => k.entityName ===
|
|
13585
|
-
entityName:
|
|
13583
|
+
children: Object.entries(f).map(([M, F]) => {
|
|
13584
|
+
const E = c.find((k) => k.entityName === M) || {
|
|
13585
|
+
entityName: M,
|
|
13586
13586
|
label: F.label
|
|
13587
13587
|
};
|
|
13588
13588
|
return /* @__PURE__ */ s(
|
|
13589
13589
|
Se,
|
|
13590
13590
|
{
|
|
13591
|
-
value:
|
|
13591
|
+
value: M,
|
|
13592
13592
|
className: "border-none",
|
|
13593
13593
|
children: [
|
|
13594
13594
|
/* @__PURE__ */ e(ke, { className: "group rounded-md px-2.5 py-2 text-muted-foreground hover:bg-muted hover:no-underline", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
@@ -13605,7 +13605,7 @@ function Zm() {
|
|
|
13605
13605
|
/* @__PURE__ */ e(De, { className: "pb-2", children: /* @__PURE__ */ e("div", { className: "space-y-1", children: F.fields.map((k) => /* @__PURE__ */ e(Qm, { field: k }, k.id)) }) })
|
|
13606
13606
|
]
|
|
13607
13607
|
},
|
|
13608
|
-
|
|
13608
|
+
M
|
|
13609
13609
|
);
|
|
13610
13610
|
})
|
|
13611
13611
|
}
|
|
@@ -13631,7 +13631,7 @@ function eh({
|
|
|
13631
13631
|
initialJoinPlan: t,
|
|
13632
13632
|
availableDataSources: a
|
|
13633
13633
|
}) {
|
|
13634
|
-
const [n, r] =
|
|
13634
|
+
const [n, r] = V(t), [l, i] = V(/* @__PURE__ */ new Set()), c = () => {
|
|
13635
13635
|
const k = n.joins.length > 0 ? Math.max(...n.joins.map((D) => D.sequence)) + 1 : 1, b = {
|
|
13636
13636
|
id: `join-${Date.now()}`,
|
|
13637
13637
|
source: {
|
|
@@ -13906,7 +13906,7 @@ function th({
|
|
|
13906
13906
|
onCancel: l
|
|
13907
13907
|
}) {
|
|
13908
13908
|
const { setCardConfig: i } = se();
|
|
13909
|
-
|
|
13909
|
+
T((S) => S.card.config);
|
|
13910
13910
|
const { columnGroups: c } = Ea(), {
|
|
13911
13911
|
joinPlan: o,
|
|
13912
13912
|
expandedJoins: d,
|
|
@@ -13920,7 +13920,7 @@ function th({
|
|
|
13920
13920
|
getAvailableSourceEntities: x,
|
|
13921
13921
|
getAvailableTargetEntities: y,
|
|
13922
13922
|
addJoinKeyGroup: w,
|
|
13923
|
-
updateGroupOperator:
|
|
13923
|
+
updateGroupOperator: M,
|
|
13924
13924
|
removeJoinKeyGroup: F,
|
|
13925
13925
|
addJoinKey: E,
|
|
13926
13926
|
updateJoinKey: k,
|
|
@@ -13988,8 +13988,8 @@ function th({
|
|
|
13988
13988
|
o.joins.length,
|
|
13989
13989
|
")"
|
|
13990
13990
|
] }),
|
|
13991
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ s(
|
|
13992
|
-
/* @__PURE__ */ e(
|
|
13991
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ s(j, { variant: "outline", size: "sm", onClick: u, children: [
|
|
13992
|
+
/* @__PURE__ */ e(Le, { className: "mr-1 h-4 w-4" }),
|
|
13993
13993
|
"Add Join"
|
|
13994
13994
|
] }) })
|
|
13995
13995
|
] }),
|
|
@@ -14017,7 +14017,7 @@ function th({
|
|
|
14017
14017
|
] }),
|
|
14018
14018
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
14019
14019
|
/* @__PURE__ */ e(
|
|
14020
|
-
|
|
14020
|
+
j,
|
|
14021
14021
|
{
|
|
14022
14022
|
variant: "ghost",
|
|
14023
14023
|
size: "sm",
|
|
@@ -14027,7 +14027,7 @@ function th({
|
|
|
14027
14027
|
}
|
|
14028
14028
|
),
|
|
14029
14029
|
/* @__PURE__ */ e(
|
|
14030
|
-
|
|
14030
|
+
j,
|
|
14031
14031
|
{
|
|
14032
14032
|
variant: "ghost",
|
|
14033
14033
|
size: "sm",
|
|
@@ -14037,7 +14037,7 @@ function th({
|
|
|
14037
14037
|
}
|
|
14038
14038
|
),
|
|
14039
14039
|
/* @__PURE__ */ e(
|
|
14040
|
-
|
|
14040
|
+
j,
|
|
14041
14041
|
{
|
|
14042
14042
|
variant: "ghost",
|
|
14043
14043
|
size: "sm",
|
|
@@ -14046,7 +14046,7 @@ function th({
|
|
|
14046
14046
|
}
|
|
14047
14047
|
),
|
|
14048
14048
|
/* @__PURE__ */ e(
|
|
14049
|
-
|
|
14049
|
+
j,
|
|
14050
14050
|
{
|
|
14051
14051
|
variant: "ghost",
|
|
14052
14052
|
size: "sm",
|
|
@@ -14217,14 +14217,14 @@ function th({
|
|
|
14217
14217
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
14218
14218
|
/* @__PURE__ */ e(Z, { children: "Join Conditions" }),
|
|
14219
14219
|
/* @__PURE__ */ s(
|
|
14220
|
-
|
|
14220
|
+
j,
|
|
14221
14221
|
{
|
|
14222
14222
|
type: "button",
|
|
14223
14223
|
variant: "outline",
|
|
14224
14224
|
size: "sm",
|
|
14225
14225
|
onClick: () => w(S.id),
|
|
14226
14226
|
children: [
|
|
14227
|
-
/* @__PURE__ */ e(
|
|
14227
|
+
/* @__PURE__ */ e(Le, { className: "mr-1 h-3 w-3" }),
|
|
14228
14228
|
" Add Condition Group"
|
|
14229
14229
|
]
|
|
14230
14230
|
}
|
|
@@ -14251,7 +14251,7 @@ function th({
|
|
|
14251
14251
|
ge,
|
|
14252
14252
|
{
|
|
14253
14253
|
value: C.operator,
|
|
14254
|
-
onValueChange: (P) =>
|
|
14254
|
+
onValueChange: (P) => M(
|
|
14255
14255
|
S.id,
|
|
14256
14256
|
R,
|
|
14257
14257
|
P
|
|
@@ -14273,7 +14273,7 @@ function th({
|
|
|
14273
14273
|
}
|
|
14274
14274
|
),
|
|
14275
14275
|
/* @__PURE__ */ e(
|
|
14276
|
-
|
|
14276
|
+
j,
|
|
14277
14277
|
{
|
|
14278
14278
|
type: "button",
|
|
14279
14279
|
variant: "ghost",
|
|
@@ -14427,7 +14427,7 @@ function th({
|
|
|
14427
14427
|
}
|
|
14428
14428
|
) }),
|
|
14429
14429
|
/* @__PURE__ */ e(
|
|
14430
|
-
|
|
14430
|
+
j,
|
|
14431
14431
|
{
|
|
14432
14432
|
type: "button",
|
|
14433
14433
|
variant: "ghost",
|
|
@@ -14446,7 +14446,7 @@ function th({
|
|
|
14446
14446
|
P.id || U
|
|
14447
14447
|
)) }),
|
|
14448
14448
|
/* @__PURE__ */ s(
|
|
14449
|
-
|
|
14449
|
+
j,
|
|
14450
14450
|
{
|
|
14451
14451
|
type: "button",
|
|
14452
14452
|
variant: "outline",
|
|
@@ -14454,7 +14454,7 @@ function th({
|
|
|
14454
14454
|
className: "mt-2",
|
|
14455
14455
|
onClick: () => E(S.id, R),
|
|
14456
14456
|
children: [
|
|
14457
|
-
/* @__PURE__ */ e(
|
|
14457
|
+
/* @__PURE__ */ e(Le, { className: "mr-1 h-3 w-3" }),
|
|
14458
14458
|
" Add Condition"
|
|
14459
14459
|
]
|
|
14460
14460
|
}
|
|
@@ -14471,7 +14471,7 @@ function th({
|
|
|
14471
14471
|
] }),
|
|
14472
14472
|
/* @__PURE__ */ s("div", { className: "flex justify-end gap-2 border-t pt-4", children: [
|
|
14473
14473
|
/* @__PURE__ */ e(
|
|
14474
|
-
|
|
14474
|
+
j,
|
|
14475
14475
|
{
|
|
14476
14476
|
variant: "outline",
|
|
14477
14477
|
onClick: () => {
|
|
@@ -14480,9 +14480,9 @@ function th({
|
|
|
14480
14480
|
children: "Remove All"
|
|
14481
14481
|
}
|
|
14482
14482
|
),
|
|
14483
|
-
/* @__PURE__ */ e(
|
|
14483
|
+
/* @__PURE__ */ e(j, { variant: "outline", onClick: l, children: "Cancel" }),
|
|
14484
14484
|
/* @__PURE__ */ e(
|
|
14485
|
-
|
|
14485
|
+
j,
|
|
14486
14486
|
{
|
|
14487
14487
|
onClick: () => n(o),
|
|
14488
14488
|
disabled: !N(),
|
|
@@ -14611,7 +14611,7 @@ function nh({
|
|
|
14611
14611
|
}
|
|
14612
14612
|
function ah() {
|
|
14613
14613
|
var u, h;
|
|
14614
|
-
const t =
|
|
14614
|
+
const t = T((f) => f.card), a = T(
|
|
14615
14615
|
(f) => f.actions.updateCardConfig
|
|
14616
14616
|
), n = ((u = t == null ? void 0 : t.config) == null ? void 0 : u.joinPlan) || {
|
|
14617
14617
|
baseEntity: {
|
|
@@ -14624,7 +14624,7 @@ function ah() {
|
|
|
14624
14624
|
dialect: "none"
|
|
14625
14625
|
},
|
|
14626
14626
|
joins: []
|
|
14627
|
-
}, [r, l] =
|
|
14627
|
+
}, [r, l] = V(!1), i = ((h = t == null ? void 0 : t.dataSource) == null ? void 0 : h.selectedEntities) || [], c = (f) => {
|
|
14628
14628
|
a(t.id, {
|
|
14629
14629
|
...t == null ? void 0 : t.config,
|
|
14630
14630
|
joinPlan: f
|
|
@@ -14646,11 +14646,11 @@ function ah() {
|
|
|
14646
14646
|
FROM ${g.name}`;
|
|
14647
14647
|
return f.forEach((p) => {
|
|
14648
14648
|
const x = i.find(
|
|
14649
|
-
(
|
|
14649
|
+
(M) => M.name === p.target.name
|
|
14650
14650
|
);
|
|
14651
14651
|
if (!x) return;
|
|
14652
|
-
const y = p.joinKeyGroups.filter((
|
|
14653
|
-
const F =
|
|
14652
|
+
const y = p.joinKeyGroups.filter((M) => M.keys && M.keys.length > 0).map((M) => {
|
|
14653
|
+
const F = M.keys.filter(
|
|
14654
14654
|
(E) => {
|
|
14655
14655
|
var k, b, D, N;
|
|
14656
14656
|
return ((k = E.source) == null ? void 0 : k.name) && ((b = E.target) == null ? void 0 : b.name) && ((D = E.source) == null ? void 0 : D.entityName) && ((N = E.target) == null ? void 0 : N.entityName);
|
|
@@ -14658,7 +14658,7 @@ FROM ${g.name}`;
|
|
|
14658
14658
|
).map(
|
|
14659
14659
|
(E) => `${E.source.entityName}.${E.source.name} ${E.operator} ${E.target.entityName}.${E.target.name}`
|
|
14660
14660
|
);
|
|
14661
|
-
return F.length > 1 ? `(${F.join(` ${
|
|
14661
|
+
return F.length > 1 ? `(${F.join(` ${M.operator} `)})` : F[0];
|
|
14662
14662
|
}).filter(Boolean), w = y.length > 1 ? y.join(" OR ") : y[0] || "condition_here";
|
|
14663
14663
|
v += `
|
|
14664
14664
|
${p.joinType} JOIN ${x.name}
|
|
@@ -14669,7 +14669,7 @@ ${p.joinType} JOIN ${x.name}
|
|
|
14669
14669
|
n.joins.length > 0 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
14670
14670
|
/* @__PURE__ */ e(rt, { children: /* @__PURE__ */ s(Be, { children: [
|
|
14671
14671
|
/* @__PURE__ */ e(qe, { asChild: !0, children: /* @__PURE__ */ s(
|
|
14672
|
-
|
|
14672
|
+
j,
|
|
14673
14673
|
{
|
|
14674
14674
|
variant: "outline",
|
|
14675
14675
|
size: "sm",
|
|
@@ -14735,7 +14735,7 @@ ${p.joinType} JOIN ${x.name}
|
|
|
14735
14735
|
onCancel: d,
|
|
14736
14736
|
onRemove: o,
|
|
14737
14737
|
children: /* @__PURE__ */ s(
|
|
14738
|
-
|
|
14738
|
+
j,
|
|
14739
14739
|
{
|
|
14740
14740
|
onClick: () => l(!0),
|
|
14741
14741
|
variant: "outline",
|
|
@@ -14755,7 +14755,7 @@ function sh({
|
|
|
14755
14755
|
open: t,
|
|
14756
14756
|
onOpenChange: a
|
|
14757
14757
|
}) {
|
|
14758
|
-
const [n, r] =
|
|
14758
|
+
const [n, r] = V(
|
|
14759
14759
|
[]
|
|
14760
14760
|
), { updateDataSource: l } = se(), i = W((p) => p.dashboard.aiContext), c = (i == null ? void 0 : i.selectedEntities) || [];
|
|
14761
14761
|
Me(() => {
|
|
@@ -14773,11 +14773,11 @@ function sh({
|
|
|
14773
14773
|
r([]);
|
|
14774
14774
|
}, u = () => {
|
|
14775
14775
|
if (n.length === 0) return;
|
|
14776
|
-
const p = n[0], x = p.connectionId || "", y = p.connectionType || "",
|
|
14776
|
+
const p = n[0], x = p.connectionId || "", y = p.connectionType || "", M = n.some((E) => E.type === "dataset") ? "semanticDomain" : "database";
|
|
14777
14777
|
l({
|
|
14778
14778
|
connectionId: x,
|
|
14779
14779
|
connectionType: y,
|
|
14780
|
-
mode:
|
|
14780
|
+
mode: M,
|
|
14781
14781
|
selectedEntities: n
|
|
14782
14782
|
}), a(!1);
|
|
14783
14783
|
}, h = (p) => {
|
|
@@ -14810,7 +14810,7 @@ function sh({
|
|
|
14810
14810
|
/* @__PURE__ */ e(Qt, { children: "No Data Available" }),
|
|
14811
14811
|
/* @__PURE__ */ e(Zt, { children: "No entities are currently available in the AI context. Please add some data sources to the dashboard first." })
|
|
14812
14812
|
] }),
|
|
14813
|
-
/* @__PURE__ */ e(pn, { children: /* @__PURE__ */ e(
|
|
14813
|
+
/* @__PURE__ */ e(pn, { children: /* @__PURE__ */ e(j, { onClick: () => a(!1), children: "Close" }) })
|
|
14814
14814
|
] }) }) : /* @__PURE__ */ e(Jt, { open: t, onOpenChange: a, children: /* @__PURE__ */ s(Kt, { className: "flex max-w-2xl flex-col", children: [
|
|
14815
14815
|
/* @__PURE__ */ s(Wt, { children: [
|
|
14816
14816
|
/* @__PURE__ */ e(Qt, { children: "Select Data to Analyze" }),
|
|
@@ -14820,7 +14820,7 @@ function sh({
|
|
|
14820
14820
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
14821
14821
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
14822
14822
|
/* @__PURE__ */ e(
|
|
14823
|
-
|
|
14823
|
+
j,
|
|
14824
14824
|
{
|
|
14825
14825
|
variant: "outline",
|
|
14826
14826
|
size: "sm",
|
|
@@ -14830,7 +14830,7 @@ function sh({
|
|
|
14830
14830
|
}
|
|
14831
14831
|
),
|
|
14832
14832
|
/* @__PURE__ */ e(
|
|
14833
|
-
|
|
14833
|
+
j,
|
|
14834
14834
|
{
|
|
14835
14835
|
variant: "outline",
|
|
14836
14836
|
size: "sm",
|
|
@@ -14875,9 +14875,9 @@ function sh({
|
|
|
14875
14875
|
)) }) })
|
|
14876
14876
|
] }),
|
|
14877
14877
|
/* @__PURE__ */ e(pn, { children: /* @__PURE__ */ e("div", { className: "flex w-full justify-between", children: /* @__PURE__ */ s("div", { className: "flex grow justify-end gap-2", children: [
|
|
14878
|
-
/* @__PURE__ */ e(
|
|
14878
|
+
/* @__PURE__ */ e(j, { variant: "outline", onClick: () => a(!1), children: "Cancel" }),
|
|
14879
14879
|
/* @__PURE__ */ s(
|
|
14880
|
-
|
|
14880
|
+
j,
|
|
14881
14881
|
{
|
|
14882
14882
|
onClick: u,
|
|
14883
14883
|
disabled: n.length === 0,
|
|
@@ -14961,14 +14961,15 @@ function ih({
|
|
|
14961
14961
|
isVisible: t,
|
|
14962
14962
|
onToggleVisibility: a
|
|
14963
14963
|
}) {
|
|
14964
|
-
|
|
14965
|
-
|
|
14964
|
+
const [n, r] = V(!1), [l, i] = V(!1), [c, o] = V(!0), d = T((f) => f.card.dataSource);
|
|
14965
|
+
Ct();
|
|
14966
|
+
const { updateDataSource: m } = se(), u = {
|
|
14966
14967
|
connectionId: "",
|
|
14967
14968
|
connectionType: "",
|
|
14968
14969
|
mode: "database",
|
|
14969
14970
|
selectedEntities: []
|
|
14970
|
-
},
|
|
14971
|
-
...
|
|
14971
|
+
}, h = {
|
|
14972
|
+
...u,
|
|
14972
14973
|
...d,
|
|
14973
14974
|
selectedEntities: (d == null ? void 0 : d.selectedEntities) || []
|
|
14974
14975
|
};
|
|
@@ -15001,7 +15002,7 @@ function ih({
|
|
|
15001
15002
|
children: [
|
|
15002
15003
|
/* @__PURE__ */ e("h2", { className: "text-brand-100 font-semibold", children: "Data Source" }),
|
|
15003
15004
|
/* @__PURE__ */ e(
|
|
15004
|
-
|
|
15005
|
+
j,
|
|
15005
15006
|
{
|
|
15006
15007
|
variant: "ghost",
|
|
15007
15008
|
size: "sm",
|
|
@@ -15015,7 +15016,7 @@ function ih({
|
|
|
15015
15016
|
),
|
|
15016
15017
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
15017
15018
|
/* @__PURE__ */ e(
|
|
15018
|
-
|
|
15019
|
+
j,
|
|
15019
15020
|
{
|
|
15020
15021
|
size: "sm",
|
|
15021
15022
|
variant: "ghost",
|
|
@@ -15025,31 +15026,18 @@ function ih({
|
|
|
15025
15026
|
children: /* @__PURE__ */ e(Cl, { className: "h-3.5 w-3.5" })
|
|
15026
15027
|
}
|
|
15027
15028
|
),
|
|
15028
|
-
|
|
15029
|
-
|
|
15029
|
+
/* @__PURE__ */ s(
|
|
15030
|
+
j,
|
|
15030
15031
|
{
|
|
15031
15032
|
size: "sm",
|
|
15032
15033
|
variant: "outline",
|
|
15033
15034
|
className: "h-7",
|
|
15034
15035
|
onClick: () => r(!0),
|
|
15035
15036
|
children: [
|
|
15036
|
-
/* @__PURE__ */ e(
|
|
15037
|
+
/* @__PURE__ */ e(Le, { className: "mr-1 h-3.5 w-3.5" }),
|
|
15037
15038
|
"Add"
|
|
15038
15039
|
]
|
|
15039
15040
|
}
|
|
15040
|
-
),
|
|
15041
|
-
(m == null ? void 0 : m.type) === "tenant" && /* @__PURE__ */ s(
|
|
15042
|
-
V,
|
|
15043
|
-
{
|
|
15044
|
-
size: "sm",
|
|
15045
|
-
variant: "outline",
|
|
15046
|
-
className: "h-7",
|
|
15047
|
-
onClick: () => i(!0),
|
|
15048
|
-
children: [
|
|
15049
|
-
/* @__PURE__ */ e(ze, { className: "mr-1 h-3.5 w-3.5" }),
|
|
15050
|
-
"Select"
|
|
15051
|
-
]
|
|
15052
|
-
}
|
|
15053
15041
|
)
|
|
15054
15042
|
] })
|
|
15055
15043
|
] })
|
|
@@ -15060,27 +15048,27 @@ function ih({
|
|
|
15060
15048
|
{
|
|
15061
15049
|
className: `overflow-hidden px-6 ${c ? "max-h-96 space-y-4" : "max-h-0 py-0 opacity-0"}`,
|
|
15062
15050
|
children: [
|
|
15063
|
-
|
|
15064
|
-
|
|
15051
|
+
h.selectedEntities.length > 0 && /* @__PURE__ */ e(rt, { children: /* @__PURE__ */ s("div", { className: "flex flex-wrap gap-1", children: [
|
|
15052
|
+
h.selectedEntities.slice(0, 3).map((f, g) => /* @__PURE__ */ s(Be, { children: [
|
|
15065
15053
|
/* @__PURE__ */ e(qe, { asChild: !0, children: /* @__PURE__ */ s(
|
|
15066
15054
|
le,
|
|
15067
15055
|
{
|
|
15068
15056
|
variant: "secondary",
|
|
15069
15057
|
className: "group relative cursor-pointer pr-6 text-xs transition-colors hover:border-red-200 hover:bg-red-50 dark:hover:border-red-800 dark:hover:bg-red-950",
|
|
15070
15058
|
children: [
|
|
15071
|
-
Rs(
|
|
15059
|
+
Rs(f),
|
|
15072
15060
|
/* @__PURE__ */ e(
|
|
15073
15061
|
"button",
|
|
15074
15062
|
{
|
|
15075
|
-
onClick: (
|
|
15076
|
-
|
|
15077
|
-
const
|
|
15078
|
-
(
|
|
15063
|
+
onClick: (v) => {
|
|
15064
|
+
v.stopPropagation();
|
|
15065
|
+
const p = h.selectedEntities.filter(
|
|
15066
|
+
(x) => !(x.name === f.name && x.type === f.type)
|
|
15079
15067
|
);
|
|
15080
|
-
|
|
15081
|
-
...
|
|
15068
|
+
m({
|
|
15069
|
+
...u,
|
|
15082
15070
|
...d,
|
|
15083
|
-
selectedEntities:
|
|
15071
|
+
selectedEntities: p
|
|
15084
15072
|
});
|
|
15085
15073
|
},
|
|
15086
15074
|
className: "absolute right-1 top-1/2 -translate-y-1/2 rounded-full p-0.5 hover:bg-red-100",
|
|
@@ -15090,18 +15078,18 @@ function ih({
|
|
|
15090
15078
|
]
|
|
15091
15079
|
}
|
|
15092
15080
|
) }),
|
|
15093
|
-
/* @__PURE__ */ e(rh, { entity:
|
|
15094
|
-
] }, `${
|
|
15095
|
-
|
|
15081
|
+
/* @__PURE__ */ e(rh, { entity: f })
|
|
15082
|
+
] }, `${f.type}-${f.name}-${g}`)),
|
|
15083
|
+
h.selectedEntities.length > 3 && /* @__PURE__ */ s(Be, { children: [
|
|
15096
15084
|
/* @__PURE__ */ e(qe, { asChild: !0, children: /* @__PURE__ */ s(le, { variant: "outline", className: "text-xs", children: [
|
|
15097
15085
|
"+",
|
|
15098
|
-
|
|
15086
|
+
h.selectedEntities.length - 3,
|
|
15099
15087
|
" more"
|
|
15100
15088
|
] }) }),
|
|
15101
15089
|
/* @__PURE__ */ e(
|
|
15102
15090
|
lh,
|
|
15103
15091
|
{
|
|
15104
|
-
entities:
|
|
15092
|
+
entities: h.selectedEntities.slice(3)
|
|
15105
15093
|
}
|
|
15106
15094
|
)
|
|
15107
15095
|
] })
|
|
@@ -15121,8 +15109,8 @@ function ih({
|
|
|
15121
15109
|
dialogMode: "dataSource",
|
|
15122
15110
|
open: n,
|
|
15123
15111
|
onOpenChange: r,
|
|
15124
|
-
dataSource:
|
|
15125
|
-
fallbackDataSource:
|
|
15112
|
+
dataSource: h,
|
|
15113
|
+
fallbackDataSource: u
|
|
15126
15114
|
}
|
|
15127
15115
|
),
|
|
15128
15116
|
/* @__PURE__ */ e(
|
|
@@ -15225,11 +15213,11 @@ function dh({
|
|
|
15225
15213
|
onChartChange: a
|
|
15226
15214
|
}) {
|
|
15227
15215
|
var k;
|
|
15228
|
-
const [n, r] =
|
|
15216
|
+
const [n, r] = V([]), [l, i] = V(!1), { data: c } = Hs();
|
|
15229
15217
|
ch();
|
|
15230
|
-
const d = ((k =
|
|
15218
|
+
const d = ((k = T((b) => b.card).customCardPreferences) == null ? void 0 : k.url) || "";
|
|
15231
15219
|
Us(d);
|
|
15232
|
-
const { setCardType: m, setCardPreferences: u, setIsDevMode: h } =
|
|
15220
|
+
const { setCardType: m, setCardPreferences: u, setIsDevMode: h } = T(
|
|
15233
15221
|
(b) => b.actions
|
|
15234
15222
|
), { setCardCustomCfg: f, setCustomCardPreferences: g, setQueryConfig: v } = se(), [p, x] = Cs("chart-section-active", null), y = Ue(() => p ? [
|
|
15235
15223
|
p,
|
|
@@ -15267,7 +15255,7 @@ function dh({
|
|
|
15267
15255
|
function w(b) {
|
|
15268
15256
|
f(null), u({}), m(b), ["custom", "text", "map"].includes(b) && (h(!0), v(void 0)), a(b), i(!1);
|
|
15269
15257
|
}
|
|
15270
|
-
function
|
|
15258
|
+
function M(b) {
|
|
15271
15259
|
f(null), u({}), m("custom"), g({
|
|
15272
15260
|
type: "component",
|
|
15273
15261
|
visualType: "single",
|
|
@@ -15280,7 +15268,7 @@ function dh({
|
|
|
15280
15268
|
const F = () => {
|
|
15281
15269
|
var D;
|
|
15282
15270
|
if (t === "custom") {
|
|
15283
|
-
const N =
|
|
15271
|
+
const N = T.getState().card;
|
|
15284
15272
|
return ((D = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : D.componentName) || "Custom Visual";
|
|
15285
15273
|
}
|
|
15286
15274
|
const b = ua.find((N) => N.id === t);
|
|
@@ -15288,7 +15276,7 @@ function dh({
|
|
|
15288
15276
|
};
|
|
15289
15277
|
return /* @__PURE__ */ e("div", { className: "mb-6", children: /* @__PURE__ */ s(it, { open: l, onOpenChange: i, children: [
|
|
15290
15278
|
/* @__PURE__ */ e(ot, { asChild: !0, children: /* @__PURE__ */ s(
|
|
15291
|
-
|
|
15279
|
+
j,
|
|
15292
15280
|
{
|
|
15293
15281
|
variant: "outline",
|
|
15294
15282
|
role: "combobox",
|
|
@@ -15299,7 +15287,7 @@ function dh({
|
|
|
15299
15287
|
(() => {
|
|
15300
15288
|
var D, N;
|
|
15301
15289
|
if (t === "custom") {
|
|
15302
|
-
const I =
|
|
15290
|
+
const I = T.getState().card, S = (D = I == null ? void 0 : I.customCardPreferences) == null ? void 0 : D.icon, z = (N = I == null ? void 0 : I.customCardPreferences) == null ? void 0 : N.componentName;
|
|
15303
15291
|
if (S && z)
|
|
15304
15292
|
return /* @__PURE__ */ e(uh, { icon: S, componentName: z });
|
|
15305
15293
|
if (z) {
|
|
@@ -15397,7 +15385,7 @@ function dh({
|
|
|
15397
15385
|
{
|
|
15398
15386
|
pluginVisual: N,
|
|
15399
15387
|
index: I,
|
|
15400
|
-
onSelect: () =>
|
|
15388
|
+
onSelect: () => M(N)
|
|
15401
15389
|
},
|
|
15402
15390
|
`${N.url}-${N.name}-${I}`
|
|
15403
15391
|
))
|
|
@@ -15438,7 +15426,7 @@ function dh({
|
|
|
15438
15426
|
{
|
|
15439
15427
|
pluginVisual: N,
|
|
15440
15428
|
index: I,
|
|
15441
|
-
onSelect: () =>
|
|
15429
|
+
onSelect: () => M(N)
|
|
15442
15430
|
},
|
|
15443
15431
|
`${N.url}-${N.name}-${I}`
|
|
15444
15432
|
))
|
|
@@ -15467,7 +15455,7 @@ function mh({
|
|
|
15467
15455
|
onAliasTemplateChange: a
|
|
15468
15456
|
}) {
|
|
15469
15457
|
var d;
|
|
15470
|
-
const [n, r] =
|
|
15458
|
+
const [n, r] = V(t), [l, i] = V(!1), c = (d = T((m) => {
|
|
15471
15459
|
var u;
|
|
15472
15460
|
return (u = m.card.config) == null ? void 0 : u.pivotByColumns;
|
|
15473
15461
|
})) == null ? void 0 : d[0], o = c ? `e.g. Min Sales in {{${c.name}}}` : "e.g. Min Sales in {{region}}";
|
|
@@ -15493,7 +15481,7 @@ function mh({
|
|
|
15493
15481
|
),
|
|
15494
15482
|
l && n !== t && /* @__PURE__ */ s(ne, { children: [
|
|
15495
15483
|
/* @__PURE__ */ e(
|
|
15496
|
-
|
|
15484
|
+
j,
|
|
15497
15485
|
{
|
|
15498
15486
|
variant: "ghost",
|
|
15499
15487
|
size: "icon",
|
|
@@ -15506,7 +15494,7 @@ function mh({
|
|
|
15506
15494
|
}
|
|
15507
15495
|
),
|
|
15508
15496
|
/* @__PURE__ */ e(
|
|
15509
|
-
|
|
15497
|
+
j,
|
|
15510
15498
|
{
|
|
15511
15499
|
variant: "ghost",
|
|
15512
15500
|
size: "icon",
|
|
@@ -15526,7 +15514,7 @@ function hh({
|
|
|
15526
15514
|
valueAliases: t,
|
|
15527
15515
|
onValueAliasesChange: a
|
|
15528
15516
|
}) {
|
|
15529
|
-
const [n, r] =
|
|
15517
|
+
const [n, r] = V(null), [l, i] = V(""), [c, o] = V(""), d = () => {
|
|
15530
15518
|
a({ ...t, "": "" });
|
|
15531
15519
|
}, m = (h) => {
|
|
15532
15520
|
const f = { ...t };
|
|
@@ -15568,7 +15556,7 @@ function hh({
|
|
|
15568
15556
|
}
|
|
15569
15557
|
),
|
|
15570
15558
|
/* @__PURE__ */ e(
|
|
15571
|
-
|
|
15559
|
+
j,
|
|
15572
15560
|
{
|
|
15573
15561
|
variant: "ghost",
|
|
15574
15562
|
size: "icon",
|
|
@@ -15579,7 +15567,7 @@ function hh({
|
|
|
15579
15567
|
}
|
|
15580
15568
|
),
|
|
15581
15569
|
/* @__PURE__ */ e(
|
|
15582
|
-
|
|
15570
|
+
j,
|
|
15583
15571
|
{
|
|
15584
15572
|
variant: "ghost",
|
|
15585
15573
|
size: "icon",
|
|
@@ -15617,7 +15605,7 @@ function hh({
|
|
|
15617
15605
|
}
|
|
15618
15606
|
),
|
|
15619
15607
|
/* @__PURE__ */ e(
|
|
15620
|
-
|
|
15608
|
+
j,
|
|
15621
15609
|
{
|
|
15622
15610
|
variant: "ghost",
|
|
15623
15611
|
size: "sm",
|
|
@@ -15629,14 +15617,14 @@ function hh({
|
|
|
15629
15617
|
)
|
|
15630
15618
|
] }) }, h + g)),
|
|
15631
15619
|
/* @__PURE__ */ s(
|
|
15632
|
-
|
|
15620
|
+
j,
|
|
15633
15621
|
{
|
|
15634
15622
|
variant: "outline",
|
|
15635
15623
|
size: "sm",
|
|
15636
15624
|
className: "mt-1 h-8 text-xs",
|
|
15637
15625
|
onClick: d,
|
|
15638
15626
|
children: [
|
|
15639
|
-
/* @__PURE__ */ e(
|
|
15627
|
+
/* @__PURE__ */ e(Le, { className: "mr-1 h-3 w-3" }),
|
|
15640
15628
|
" Add Value Alias"
|
|
15641
15629
|
]
|
|
15642
15630
|
}
|
|
@@ -15651,7 +15639,7 @@ function Lr({
|
|
|
15651
15639
|
type: r = "text",
|
|
15652
15640
|
className: l = ""
|
|
15653
15641
|
}) {
|
|
15654
|
-
const [i, c] =
|
|
15642
|
+
const [i, c] = V(t ?? ""), [o, d] = V(!1);
|
|
15655
15643
|
Oe.useEffect(() => {
|
|
15656
15644
|
c(t ?? "");
|
|
15657
15645
|
}, [t]);
|
|
@@ -15682,7 +15670,7 @@ function Lr({
|
|
|
15682
15670
|
),
|
|
15683
15671
|
o && i !== t && /* @__PURE__ */ s(ne, { children: [
|
|
15684
15672
|
/* @__PURE__ */ e(
|
|
15685
|
-
|
|
15673
|
+
j,
|
|
15686
15674
|
{
|
|
15687
15675
|
variant: "ghost",
|
|
15688
15676
|
size: "icon",
|
|
@@ -15693,7 +15681,7 @@ function Lr({
|
|
|
15693
15681
|
}
|
|
15694
15682
|
),
|
|
15695
15683
|
/* @__PURE__ */ e(
|
|
15696
|
-
|
|
15684
|
+
j,
|
|
15697
15685
|
{
|
|
15698
15686
|
variant: "ghost",
|
|
15699
15687
|
size: "icon",
|
|
@@ -15723,26 +15711,26 @@ function ph({
|
|
|
15723
15711
|
transform: u,
|
|
15724
15712
|
transition: h,
|
|
15725
15713
|
isDragging: f
|
|
15726
|
-
} = An({ id: t.id }), g =
|
|
15714
|
+
} = An({ id: t.id }), g = T((re) => re.card), {
|
|
15727
15715
|
updateLabel: v,
|
|
15728
15716
|
handleAggregationChange: p,
|
|
15729
15717
|
handleDateFormatChange: x,
|
|
15730
15718
|
handleGranularityChange: y,
|
|
15731
15719
|
handleAliasTemplateChange: w,
|
|
15732
|
-
handleValueAliasesChange:
|
|
15720
|
+
handleValueAliasesChange: M,
|
|
15733
15721
|
removeField: F,
|
|
15734
15722
|
handleKpiComparisonTypeChange: E,
|
|
15735
15723
|
handleKpiShowTrendlineChange: k,
|
|
15736
15724
|
handleKpiTrendlineWindowChange: b,
|
|
15737
15725
|
handleKpiTrendlineGranularityChange: D,
|
|
15738
15726
|
handleKpiTargetValueChange: N
|
|
15739
|
-
} = tr(g), [I, S] =
|
|
15727
|
+
} = tr(g), [I, S] = V(!1), [z, A] = V(
|
|
15740
15728
|
t.dateFormat || "YYYY-MM-DD"
|
|
15741
|
-
), [O, C] =
|
|
15729
|
+
), [O, C] = V(t.customFormat || ""), [R, P] = V(!!t.customFormat), [U, B] = V(
|
|
15742
15730
|
t.granularity || "day"
|
|
15743
|
-
), [Y, oe] =
|
|
15731
|
+
), [Y, oe] = V(
|
|
15744
15732
|
t.aliasTemplate || ""
|
|
15745
|
-
), [ae, G] =
|
|
15733
|
+
), [ae, G] = V(
|
|
15746
15734
|
t.valueAliases || {}
|
|
15747
15735
|
), L = (re) => {
|
|
15748
15736
|
re === "custom" ? P(!0) : (P(!1), A(re), a === "groupBy" && x(n, re, ""));
|
|
@@ -15756,7 +15744,7 @@ function ph({
|
|
|
15756
15744
|
}, K = (re) => {
|
|
15757
15745
|
oe(re), a === "metrics" && w(n, re);
|
|
15758
15746
|
}, ee = (re) => {
|
|
15759
|
-
G(re), a === "metrics" &&
|
|
15747
|
+
G(re), a === "metrics" && M(n, re);
|
|
15760
15748
|
}, Q = (re) => {
|
|
15761
15749
|
v(a, n, re);
|
|
15762
15750
|
}, de = () => {
|
|
@@ -16038,7 +16026,7 @@ function ph({
|
|
|
16038
16026
|
/* @__PURE__ */ e(bi, { dataType: be }),
|
|
16039
16027
|
/* @__PURE__ */ e(Xs, { className: "w-[140px] flex-1 text-sm", children: t.label || t.name }),
|
|
16040
16028
|
a !== "sortBy" && /* @__PURE__ */ e(
|
|
16041
|
-
|
|
16029
|
+
j,
|
|
16042
16030
|
{
|
|
16043
16031
|
variant: "ghost",
|
|
16044
16032
|
size: "sm",
|
|
@@ -16055,7 +16043,7 @@ function ph({
|
|
|
16055
16043
|
}
|
|
16056
16044
|
),
|
|
16057
16045
|
a === "sortBy" && /* @__PURE__ */ e(
|
|
16058
|
-
|
|
16046
|
+
j,
|
|
16059
16047
|
{
|
|
16060
16048
|
variant: "ghost",
|
|
16061
16049
|
size: "sm",
|
|
@@ -16075,7 +16063,7 @@ function ph({
|
|
|
16075
16063
|
}
|
|
16076
16064
|
),
|
|
16077
16065
|
/* @__PURE__ */ e(
|
|
16078
|
-
|
|
16066
|
+
j,
|
|
16079
16067
|
{
|
|
16080
16068
|
variant: "ghost",
|
|
16081
16069
|
size: "sm",
|
|
@@ -16198,7 +16186,7 @@ function ia({
|
|
|
16198
16186
|
}) {
|
|
16199
16187
|
const { isOver: c, setNodeRef: o } = As({
|
|
16200
16188
|
id: t
|
|
16201
|
-
}), { updateSortByColumn: d } = se(), m =
|
|
16189
|
+
}), { updateSortByColumn: d } = se(), m = T((v) => v.card), u = T((v) => v.card.type), h = a.length > 0, f = (v, p) => {
|
|
16202
16190
|
var y;
|
|
16203
16191
|
!((y = m.config) != null && y.sortByColumns) || m.config.sortByColumns.findIndex(
|
|
16204
16192
|
(w) => w.id === v
|
|
@@ -16266,7 +16254,7 @@ function gh({
|
|
|
16266
16254
|
metricsFields: n,
|
|
16267
16255
|
sortByFields: r
|
|
16268
16256
|
}) {
|
|
16269
|
-
const l =
|
|
16257
|
+
const l = T((h) => h.card), i = l == null ? void 0 : l.type, c = t.length > 0 || n.length > 0, o = i !== "kpi", d = i !== "kpi" && c, m = () => i === "kpi" ? {
|
|
16270
16258
|
label: "Trend By",
|
|
16271
16259
|
placeholder: "Drop fields to trend data"
|
|
16272
16260
|
} : {
|
|
@@ -16327,7 +16315,7 @@ function yh({
|
|
|
16327
16315
|
metricsFields: l,
|
|
16328
16316
|
sortByFields: i
|
|
16329
16317
|
}) {
|
|
16330
|
-
const c =
|
|
16318
|
+
const c = T((h) => h.showAIDialog), o = n.length > 0 || r.length > 0 || l.length > 0, { setShowAIDialog: d } = se(), m = T((h) => h.card), { data: u } = ze(m);
|
|
16331
16319
|
return /* @__PURE__ */ s(
|
|
16332
16320
|
"div",
|
|
16333
16321
|
{
|
|
@@ -16347,7 +16335,7 @@ function yh({
|
|
|
16347
16335
|
/* @__PURE__ */ s("div", { className: H("flex justify-end gap-2 px-6 pt-6"), children: [
|
|
16348
16336
|
/* @__PURE__ */ e("div", { className: H("invisible", { visible: o || u }), children: /* @__PURE__ */ e(Ra, {}) }),
|
|
16349
16337
|
!c && /* @__PURE__ */ s(
|
|
16350
|
-
|
|
16338
|
+
j,
|
|
16351
16339
|
{
|
|
16352
16340
|
onClick: () => d(!c),
|
|
16353
16341
|
variant: "outline",
|
|
@@ -16380,7 +16368,7 @@ function vh({
|
|
|
16380
16368
|
initialFilters: t,
|
|
16381
16369
|
availableFields: a
|
|
16382
16370
|
} = {}) {
|
|
16383
|
-
const [n, r] =
|
|
16371
|
+
const [n, r] = V(
|
|
16384
16372
|
t || {
|
|
16385
16373
|
id: `group-${Date.now()}`,
|
|
16386
16374
|
logicalOperator: "AND",
|
|
@@ -16389,7 +16377,7 @@ function vh({
|
|
|
16389
16377
|
groups: []
|
|
16390
16378
|
}
|
|
16391
16379
|
);
|
|
16392
|
-
|
|
16380
|
+
T((E) => E.card.dataSource);
|
|
16393
16381
|
const { columns: l, isLoading: i } = Ea(), o = a || l || [], d = {
|
|
16394
16382
|
id: "default",
|
|
16395
16383
|
name: "default",
|
|
@@ -16531,7 +16519,7 @@ function vh({
|
|
|
16531
16519
|
groups: N.groups.map(D)
|
|
16532
16520
|
};
|
|
16533
16521
|
r(D(n));
|
|
16534
|
-
},
|
|
16522
|
+
}, M = (E) => {
|
|
16535
16523
|
if (!E || E.conditions.length === 0 && E.groups.length === 0)
|
|
16536
16524
|
return "-- No filters defined";
|
|
16537
16525
|
const k = (D) => {
|
|
@@ -16587,7 +16575,7 @@ function vh({
|
|
|
16587
16575
|
updateGroupNegate: x,
|
|
16588
16576
|
reorderConditions: y,
|
|
16589
16577
|
reorderGroups: w,
|
|
16590
|
-
generateSQLPreview:
|
|
16578
|
+
generateSQLPreview: M,
|
|
16591
16579
|
hasAnyFilters: F
|
|
16592
16580
|
};
|
|
16593
16581
|
}
|
|
@@ -16646,7 +16634,7 @@ function Ch({
|
|
|
16646
16634
|
}, [n]);
|
|
16647
16635
|
return /* @__PURE__ */ s(it, { modal: !0, open: i, onOpenChange: c, children: [
|
|
16648
16636
|
/* @__PURE__ */ e(ot, { asChild: !0, children: /* @__PURE__ */ s(
|
|
16649
|
-
|
|
16637
|
+
j,
|
|
16650
16638
|
{
|
|
16651
16639
|
variant: "outline",
|
|
16652
16640
|
role: "combobox",
|
|
@@ -16716,7 +16704,7 @@ function Ch({
|
|
|
16716
16704
|
}
|
|
16717
16705
|
function ar(t) {
|
|
16718
16706
|
var v;
|
|
16719
|
-
const a =
|
|
16707
|
+
const a = T((p) => p.card), { authToken: n } = Te(), r = T((p) => p.card.config), l = r == null ? void 0 : r.joinPlan, i = {
|
|
16720
16708
|
...t,
|
|
16721
16709
|
alias: t.name,
|
|
16722
16710
|
// we need exact field name in the output for the filters to work.
|
|
@@ -16787,7 +16775,7 @@ function wh({
|
|
|
16787
16775
|
};
|
|
16788
16776
|
return /* @__PURE__ */ e("div", { className: H("w-full", l), children: /* @__PURE__ */ s(it, { open: i, onOpenChange: c, modal: !0, children: [
|
|
16789
16777
|
/* @__PURE__ */ e(ot, { asChild: !0, children: /* @__PURE__ */ s(
|
|
16790
|
-
|
|
16778
|
+
j,
|
|
16791
16779
|
{
|
|
16792
16780
|
variant: "outline",
|
|
16793
16781
|
role: "combobox",
|
|
@@ -17085,7 +17073,7 @@ function Ci({
|
|
|
17085
17073
|
}
|
|
17086
17074
|
),
|
|
17087
17075
|
/* @__PURE__ */ e(
|
|
17088
|
-
|
|
17076
|
+
j,
|
|
17089
17077
|
{
|
|
17090
17078
|
variant: "ghost",
|
|
17091
17079
|
size: "sm",
|
|
@@ -17120,11 +17108,11 @@ function Ah({
|
|
|
17120
17108
|
attributes: x,
|
|
17121
17109
|
listeners: y,
|
|
17122
17110
|
setNodeRef: w,
|
|
17123
|
-
transform:
|
|
17111
|
+
transform: M,
|
|
17124
17112
|
transition: F,
|
|
17125
17113
|
isDragging: E
|
|
17126
17114
|
} = An({ id: t.id }), k = {
|
|
17127
|
-
transform: zt.Transform.toString(
|
|
17115
|
+
transform: zt.Transform.toString(M),
|
|
17128
17116
|
transition: F
|
|
17129
17117
|
}, b = (N) => {
|
|
17130
17118
|
const { active: I, over: S } = N;
|
|
@@ -17162,7 +17150,7 @@ function Ah({
|
|
|
17162
17150
|
}
|
|
17163
17151
|
),
|
|
17164
17152
|
/* @__PURE__ */ e(
|
|
17165
|
-
|
|
17153
|
+
j,
|
|
17166
17154
|
{
|
|
17167
17155
|
variant: t.negate ? "default" : "outline",
|
|
17168
17156
|
size: "sm",
|
|
@@ -17188,7 +17176,7 @@ function Ah({
|
|
|
17188
17176
|
/* @__PURE__ */ e("span", { className: "text-sm font-medium", children: "Group" })
|
|
17189
17177
|
] }),
|
|
17190
17178
|
/* @__PURE__ */ e(
|
|
17191
|
-
|
|
17179
|
+
j,
|
|
17192
17180
|
{
|
|
17193
17181
|
variant: "ghost",
|
|
17194
17182
|
size: "sm",
|
|
@@ -17260,27 +17248,27 @@ function Ah({
|
|
|
17260
17248
|
),
|
|
17261
17249
|
/* @__PURE__ */ s("div", { className: "mt-3 flex items-center gap-2", children: [
|
|
17262
17250
|
/* @__PURE__ */ s(
|
|
17263
|
-
|
|
17251
|
+
j,
|
|
17264
17252
|
{
|
|
17265
17253
|
size: "sm",
|
|
17266
17254
|
variant: "outline",
|
|
17267
17255
|
className: "h-7 text-xs",
|
|
17268
17256
|
onClick: () => h(t.id),
|
|
17269
17257
|
children: [
|
|
17270
|
-
/* @__PURE__ */ e(
|
|
17258
|
+
/* @__PURE__ */ e(Le, { className: "mr-1 h-3 w-3" }),
|
|
17271
17259
|
"Add Condition"
|
|
17272
17260
|
]
|
|
17273
17261
|
}
|
|
17274
17262
|
),
|
|
17275
17263
|
/* @__PURE__ */ s(
|
|
17276
|
-
|
|
17264
|
+
j,
|
|
17277
17265
|
{
|
|
17278
17266
|
variant: "outline",
|
|
17279
17267
|
size: "sm",
|
|
17280
17268
|
className: "h-7 text-xs",
|
|
17281
17269
|
onClick: () => f(t.id),
|
|
17282
17270
|
children: [
|
|
17283
|
-
/* @__PURE__ */ e(
|
|
17271
|
+
/* @__PURE__ */ e(Le, { className: "mr-1 h-3 w-3" }),
|
|
17284
17272
|
"Add Group"
|
|
17285
17273
|
]
|
|
17286
17274
|
}
|
|
@@ -17313,7 +17301,7 @@ function Ih({
|
|
|
17313
17301
|
reorderConditions: x,
|
|
17314
17302
|
reorderGroups: y,
|
|
17315
17303
|
generateSQLPreview: w,
|
|
17316
|
-
hasAnyFilters:
|
|
17304
|
+
hasAnyFilters: M,
|
|
17317
17305
|
setCurrentFilters: F
|
|
17318
17306
|
} = vh({
|
|
17319
17307
|
initialFilters: t,
|
|
@@ -17323,7 +17311,7 @@ function Ih({
|
|
|
17323
17311
|
Mt(Xa, {
|
|
17324
17312
|
coordinateGetter: Za
|
|
17325
17313
|
})
|
|
17326
|
-
), [k, b] =
|
|
17314
|
+
), [k, b] = V(!1), D = (S, z, A) => {
|
|
17327
17315
|
const O = (C) => C.id === S ? {
|
|
17328
17316
|
...C,
|
|
17329
17317
|
conditions: C.conditions.map((R) => R.id === z ? {
|
|
@@ -17408,27 +17396,27 @@ function Ih({
|
|
|
17408
17396
|
),
|
|
17409
17397
|
/* @__PURE__ */ s("div", { className: "mt-3 flex items-center gap-2", children: [
|
|
17410
17398
|
/* @__PURE__ */ s(
|
|
17411
|
-
|
|
17399
|
+
j,
|
|
17412
17400
|
{
|
|
17413
17401
|
size: "sm",
|
|
17414
17402
|
className: "h-7 text-xs",
|
|
17415
17403
|
variant: "outline",
|
|
17416
17404
|
onClick: () => d(S.id),
|
|
17417
17405
|
children: [
|
|
17418
|
-
/* @__PURE__ */ e(
|
|
17406
|
+
/* @__PURE__ */ e(Le, { className: "mr-1 h-3 w-3" }),
|
|
17419
17407
|
"Add Condition"
|
|
17420
17408
|
]
|
|
17421
17409
|
}
|
|
17422
17410
|
),
|
|
17423
17411
|
k && /* @__PURE__ */ s(
|
|
17424
|
-
|
|
17412
|
+
j,
|
|
17425
17413
|
{
|
|
17426
17414
|
variant: "outline",
|
|
17427
17415
|
size: "sm",
|
|
17428
17416
|
className: "h-7 text-xs",
|
|
17429
17417
|
onClick: () => m(S.id),
|
|
17430
17418
|
children: [
|
|
17431
|
-
/* @__PURE__ */ e(
|
|
17419
|
+
/* @__PURE__ */ e(Le, { className: "mr-1 h-3 w-3" }),
|
|
17432
17420
|
"Add Group"
|
|
17433
17421
|
]
|
|
17434
17422
|
}
|
|
@@ -17480,19 +17468,19 @@ function Ih({
|
|
|
17480
17468
|
}
|
|
17481
17469
|
)
|
|
17482
17470
|
] }) }),
|
|
17483
|
-
|
|
17471
|
+
M && /* @__PURE__ */ s("div", { className: "mt-4 border-t border-border pt-4", children: [
|
|
17484
17472
|
/* @__PURE__ */ e("div", { className: "mb-2 text-xs font-medium text-muted-foreground", children: "SQL WHERE Clause Preview" }),
|
|
17485
17473
|
/* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-md border bg-muted p-3", children: /* @__PURE__ */ e("pre", { className: "whitespace-pre-wrap font-mono text-xs text-muted-foreground", children: w(i) }) })
|
|
17486
17474
|
] })
|
|
17487
17475
|
] }) }) }),
|
|
17488
17476
|
/* @__PURE__ */ s("div", { className: "flex justify-end gap-2", children: [
|
|
17489
|
-
/* @__PURE__ */ e(
|
|
17490
|
-
I > 0 && /* @__PURE__ */ e(
|
|
17477
|
+
/* @__PURE__ */ e(j, { size: "sm", variant: "outline", onClick: l, children: "Cancel" }),
|
|
17478
|
+
I > 0 && /* @__PURE__ */ e(j, { variant: "outline", size: "sm", onClick: r, children: "Clear All" }),
|
|
17491
17479
|
/* @__PURE__ */ e(
|
|
17492
|
-
|
|
17480
|
+
j,
|
|
17493
17481
|
{
|
|
17494
17482
|
size: "sm",
|
|
17495
|
-
onClick: () => n(
|
|
17483
|
+
onClick: () => n(M ? i : null),
|
|
17496
17484
|
children: "Apply Filters"
|
|
17497
17485
|
}
|
|
17498
17486
|
)
|
|
@@ -17548,7 +17536,7 @@ function zh({
|
|
|
17548
17536
|
setFieldsForContainer: r
|
|
17549
17537
|
}) {
|
|
17550
17538
|
var g;
|
|
17551
|
-
const [l, i] =
|
|
17539
|
+
const [l, i] = V(null), c = T((v) => v.card), o = (g = c == null ? void 0 : c.config) == null ? void 0 : g.joinPlan, d = [
|
|
17552
17540
|
...a,
|
|
17553
17541
|
...n("groupBy"),
|
|
17554
17542
|
...n("pivotBy"),
|
|
@@ -17566,12 +17554,12 @@ function zh({
|
|
|
17566
17554
|
i(null);
|
|
17567
17555
|
return;
|
|
17568
17556
|
}
|
|
17569
|
-
const y = p.id, w = x.id,
|
|
17570
|
-
if (
|
|
17557
|
+
const y = p.id, w = x.id, M = m(y), F = m(w) || w;
|
|
17558
|
+
if (M === "source" && F === "sortBy") {
|
|
17571
17559
|
i(null);
|
|
17572
17560
|
return;
|
|
17573
17561
|
}
|
|
17574
|
-
if (
|
|
17562
|
+
if (M === "source" && F !== "source" && F !== "sortBy") {
|
|
17575
17563
|
const E = [...a].find((N) => N.id === y);
|
|
17576
17564
|
if (!E) {
|
|
17577
17565
|
i(null);
|
|
@@ -17613,15 +17601,15 @@ function zh({
|
|
|
17613
17601
|
i(null), r(F, [...b, D]);
|
|
17614
17602
|
return;
|
|
17615
17603
|
}
|
|
17616
|
-
if (
|
|
17617
|
-
const E = n(
|
|
17604
|
+
if (M && F && M !== "source" && F !== "source" && M !== F) {
|
|
17605
|
+
const E = n(M), k = n(F), b = E.find((I) => I.id === y);
|
|
17618
17606
|
if (!b) {
|
|
17619
17607
|
i(null);
|
|
17620
17608
|
return;
|
|
17621
17609
|
}
|
|
17622
17610
|
const D = Ka(b, F);
|
|
17623
17611
|
if (i(null), F === "sortBy") {
|
|
17624
|
-
if (
|
|
17612
|
+
if (M === "pivotBy") {
|
|
17625
17613
|
i(null);
|
|
17626
17614
|
return;
|
|
17627
17615
|
}
|
|
@@ -17631,14 +17619,14 @@ function zh({
|
|
|
17631
17619
|
const N = E.filter(
|
|
17632
17620
|
(I) => I.id !== y
|
|
17633
17621
|
);
|
|
17634
|
-
r(
|
|
17622
|
+
r(M, N), r(F, [...k, D]);
|
|
17635
17623
|
return;
|
|
17636
17624
|
}
|
|
17637
|
-
if (
|
|
17638
|
-
const E = n(
|
|
17625
|
+
if (M && F && M === F && M !== "source") {
|
|
17626
|
+
const E = n(M), k = E.findIndex((D) => D.id === y), b = E.findIndex((D) => D.id === w);
|
|
17639
17627
|
if (k !== b) {
|
|
17640
17628
|
const D = Qa(E, k, b);
|
|
17641
|
-
r(
|
|
17629
|
+
r(M, D);
|
|
17642
17630
|
}
|
|
17643
17631
|
}
|
|
17644
17632
|
i(null);
|
|
@@ -17666,9 +17654,9 @@ function Fh({
|
|
|
17666
17654
|
}) {
|
|
17667
17655
|
const { currentUser: r } = Ct();
|
|
17668
17656
|
r == null || r.role;
|
|
17669
|
-
const [l, i] =
|
|
17657
|
+
const [l, i] = V(!1), c = T((y) => y.isDevMode), o = T((y) => y.card), d = T((y) => y.card.dataSource);
|
|
17670
17658
|
ml(o);
|
|
17671
|
-
const { config: m } = Sc(gc).tokenProps, u = (m == null ? void 0 : m.showAdvancedMode) !== !1, { setIsDevMode: h } = se(), f =
|
|
17659
|
+
const { config: m } = Sc(gc).tokenProps, u = (m == null ? void 0 : m.showAdvancedMode) !== !1, { setIsDevMode: h } = se(), f = T((y) => y.showAIDialog), g = T((y) => y.frame), v = ha((y) => y.selectedVisual), p = (v == null ? void 0 : v.id) === (g == null ? void 0 : g.id), { setShowAIDialog: x } = se();
|
|
17672
17660
|
return /* @__PURE__ */ s(
|
|
17673
17661
|
"div",
|
|
17674
17662
|
{
|
|
@@ -17694,7 +17682,7 @@ function Fh({
|
|
|
17694
17682
|
] }),
|
|
17695
17683
|
/* @__PURE__ */ s("div", { className: "flex items-center space-x-2", children: [
|
|
17696
17684
|
(r == null ? void 0 : r.type) !== "tenant" && /* @__PURE__ */ s(Nn, { modal: !1, children: [
|
|
17697
|
-
/* @__PURE__ */ e(Cn, { asChild: !0, children: /* @__PURE__ */ e(
|
|
17685
|
+
/* @__PURE__ */ e(Cn, { asChild: !0, children: /* @__PURE__ */ e(j, { variant: "ghost", size: "sm", className: "h-8 p-0", children: /* @__PURE__ */ e(Ss, { className: "size-3.5" }) }) }),
|
|
17698
17686
|
/* @__PURE__ */ e(wn, { align: "end", children: /* @__PURE__ */ s(
|
|
17699
17687
|
tt,
|
|
17700
17688
|
{
|
|
@@ -17729,7 +17717,7 @@ function Fh({
|
|
|
17729
17717
|
);
|
|
17730
17718
|
}
|
|
17731
17719
|
function Lh({ activeView: t, onViewChange: a }) {
|
|
17732
|
-
const n =
|
|
17720
|
+
const n = T((l) => l.card), { errorMessage: r } = ze(n);
|
|
17733
17721
|
return /* @__PURE__ */ e(
|
|
17734
17722
|
sn,
|
|
17735
17723
|
{
|
|
@@ -17737,7 +17725,7 @@ function Lh({ activeView: t, onViewChange: a }) {
|
|
|
17737
17725
|
onValueChange: (l) => a(l),
|
|
17738
17726
|
children: /* @__PURE__ */ s(rn, { className: "h-9 w-fit gap-2 bg-background p-0", children: [
|
|
17739
17727
|
/* @__PURE__ */ e(
|
|
17740
|
-
|
|
17728
|
+
Fe,
|
|
17741
17729
|
{
|
|
17742
17730
|
value: "chart",
|
|
17743
17731
|
className: "rounded-md transition data-[state=active]:bg-muted",
|
|
@@ -17745,7 +17733,7 @@ function Lh({ activeView: t, onViewChange: a }) {
|
|
|
17745
17733
|
}
|
|
17746
17734
|
),
|
|
17747
17735
|
/* @__PURE__ */ e(
|
|
17748
|
-
|
|
17736
|
+
Fe,
|
|
17749
17737
|
{
|
|
17750
17738
|
value: "table",
|
|
17751
17739
|
className: "rounded-md transition data-[state=active]:bg-muted",
|
|
@@ -17753,7 +17741,7 @@ function Lh({ activeView: t, onViewChange: a }) {
|
|
|
17753
17741
|
}
|
|
17754
17742
|
),
|
|
17755
17743
|
n.type !== "kpi" && /* @__PURE__ */ e(
|
|
17756
|
-
|
|
17744
|
+
Fe,
|
|
17757
17745
|
{
|
|
17758
17746
|
value: "sql",
|
|
17759
17747
|
className: H(
|
|
@@ -17779,7 +17767,7 @@ const Ph = [
|
|
|
17779
17767
|
];
|
|
17780
17768
|
function _h() {
|
|
17781
17769
|
var d, m;
|
|
17782
|
-
const t =
|
|
17770
|
+
const t = T((u) => u.card), { updateRowLimit: a } = se(), [n, r] = V(!1), [l, i] = V(""), c = (u) => {
|
|
17783
17771
|
if (u === "custom") {
|
|
17784
17772
|
r(!0);
|
|
17785
17773
|
return;
|
|
@@ -17817,22 +17805,22 @@ function Vh({
|
|
|
17817
17805
|
}) {
|
|
17818
17806
|
const n = ql(a, {
|
|
17819
17807
|
enabled: t
|
|
17820
|
-
}), r =
|
|
17808
|
+
}), r = T(
|
|
17821
17809
|
(u) => {
|
|
17822
17810
|
var h;
|
|
17823
17811
|
return ((h = u.card.customCardPreferences) == null ? void 0 : h.url) || "";
|
|
17824
17812
|
}
|
|
17825
|
-
), l =
|
|
17813
|
+
), l = T((u) => u.card), i = T(
|
|
17826
17814
|
(u) => {
|
|
17827
17815
|
var h;
|
|
17828
17816
|
return ((h = u.card.customCardPreferences) == null ? void 0 : h.pluginChartType) || "";
|
|
17829
17817
|
}
|
|
17830
|
-
), c =
|
|
17818
|
+
), c = T(
|
|
17831
17819
|
(u) => {
|
|
17832
17820
|
var h;
|
|
17833
17821
|
return ((h = u.card.customCardPreferences) == null ? void 0 : h.settings) || {};
|
|
17834
17822
|
}
|
|
17835
|
-
), { data: o } =
|
|
17823
|
+
), { data: o } = ze(l), { getCard: d } = Ds(r), m = Ue(() => !r || r.trim() === "" ? null : d("Chart Settings"), [d, r]);
|
|
17836
17824
|
return /* @__PURE__ */ e(
|
|
17837
17825
|
"div",
|
|
17838
17826
|
{
|
|
@@ -17891,9 +17879,9 @@ function jh({
|
|
|
17891
17879
|
// setActiveCard,
|
|
17892
17880
|
}) {
|
|
17893
17881
|
var R;
|
|
17894
|
-
const g =
|
|
17895
|
-
|
|
17896
|
-
const v = W((P) => P.filterValues), { updateCardConfig: p, setCard: x, updateCardInFrame: y } = se(), w =
|
|
17882
|
+
const g = T((P) => P.card);
|
|
17883
|
+
T((P) => P.frame);
|
|
17884
|
+
const v = W((P) => P.filterValues), { updateCardConfig: p, setCard: x, updateCardInFrame: y } = se(), w = T((P) => P.showAIDialog), [M, F] = V(!1), E = T(
|
|
17897
17885
|
(P) => {
|
|
17898
17886
|
var U;
|
|
17899
17887
|
return ((U = P.card.customCardPreferences) == null ? void 0 : U.url) && P.card.type === "custom";
|
|
@@ -17905,7 +17893,7 @@ function jh({
|
|
|
17905
17893
|
isLoading: N,
|
|
17906
17894
|
isFetching: I,
|
|
17907
17895
|
pagination: S
|
|
17908
|
-
} =
|
|
17896
|
+
} = ze(m), z = (P, U) => {
|
|
17909
17897
|
const B = {
|
|
17910
17898
|
...m,
|
|
17911
17899
|
paginationConfig: {
|
|
@@ -18016,7 +18004,7 @@ function jh({
|
|
|
18016
18004
|
] }),
|
|
18017
18005
|
/* @__PURE__ */ e("div", { className: H("flex grow items-center justify-end"), children: t === "chart" && /* @__PURE__ */ e(di, {}) })
|
|
18018
18006
|
] }),
|
|
18019
|
-
!
|
|
18007
|
+
!M && E && /* @__PURE__ */ e(
|
|
18020
18008
|
ce,
|
|
18021
18009
|
{
|
|
18022
18010
|
"aria-label": "Open Chart Settings",
|
|
@@ -18048,7 +18036,7 @@ function jh({
|
|
|
18048
18036
|
/* @__PURE__ */ e(
|
|
18049
18037
|
Vh,
|
|
18050
18038
|
{
|
|
18051
|
-
isOpen:
|
|
18039
|
+
isOpen: M,
|
|
18052
18040
|
onClose: () => F(!1)
|
|
18053
18041
|
}
|
|
18054
18042
|
)
|
|
@@ -18056,7 +18044,7 @@ function jh({
|
|
|
18056
18044
|
] });
|
|
18057
18045
|
}
|
|
18058
18046
|
function Uh({ activeField: t }) {
|
|
18059
|
-
const [a, n] =
|
|
18047
|
+
const [a, n] = V(!0);
|
|
18060
18048
|
return Me(() => {
|
|
18061
18049
|
t && n(!0);
|
|
18062
18050
|
}, [t]), t ? /* @__PURE__ */ s(
|
|
@@ -18100,9 +18088,9 @@ const Bh = () => {
|
|
|
18100
18088
|
};
|
|
18101
18089
|
function $h() {
|
|
18102
18090
|
var G, L;
|
|
18103
|
-
const [t, a] =
|
|
18091
|
+
const [t, a] = V(
|
|
18104
18092
|
"chart"
|
|
18105
|
-
), [n, r] =
|
|
18093
|
+
), [n, r] = V(!1), [l, i] = V(!1), [c, o] = V(!0), d = T((q) => q.showAIDialog), m = W((q) => q.isVisualEditing), { setCardType: u } = se(), h = T((q) => q.card.type);
|
|
18106
18094
|
Me(() => Bh(), []);
|
|
18107
18095
|
const f = () => {
|
|
18108
18096
|
console.log("Accept clicked - would save/apply current configuration");
|
|
@@ -18114,11 +18102,11 @@ function $h() {
|
|
|
18114
18102
|
i(!0);
|
|
18115
18103
|
}, x = (q) => {
|
|
18116
18104
|
u(q);
|
|
18117
|
-
}, y =
|
|
18118
|
-
|
|
18105
|
+
}, y = T((q) => q.frame), w = T((q) => q.card);
|
|
18106
|
+
T((q) => q.activeTabCardId), T(
|
|
18119
18107
|
(q) => q.actions.getAvailableFields
|
|
18120
18108
|
);
|
|
18121
|
-
const { addCard:
|
|
18109
|
+
const { addCard: M, removeCard: F, updateCard: E, setActiveCard: k, updateFilters: b } = se(), {
|
|
18122
18110
|
columns: D = [],
|
|
18123
18111
|
isLoading: N,
|
|
18124
18112
|
error: I
|
|
@@ -18202,13 +18190,13 @@ function $h() {
|
|
|
18202
18190
|
getFieldsForContainer: A,
|
|
18203
18191
|
cards: y.cards,
|
|
18204
18192
|
activeCardId: y.activeCardId,
|
|
18205
|
-
addCard:
|
|
18193
|
+
addCard: M,
|
|
18206
18194
|
setActiveCard: k
|
|
18207
18195
|
}
|
|
18208
18196
|
)
|
|
18209
18197
|
] }),
|
|
18210
18198
|
!c && m && /* @__PURE__ */ e("div", { className: "fixed left-6 top-[105px] z-50", children: /* @__PURE__ */ e(
|
|
18211
|
-
|
|
18199
|
+
j,
|
|
18212
18200
|
{
|
|
18213
18201
|
size: "sm",
|
|
18214
18202
|
variant: "outline",
|
|
@@ -18237,7 +18225,7 @@ function $h() {
|
|
|
18237
18225
|
);
|
|
18238
18226
|
}
|
|
18239
18227
|
function qh({ authToken: t, onSave: a, onClose: n }) {
|
|
18240
|
-
const r = lt(null), l =
|
|
18228
|
+
const r = lt(null), l = T((w) => w.showAIDialog), i = T((w) => w.isDevMode), { setAuthToken: c } = xt(), { setShowAIDialog: o, setOnSave: d, setOnClose: m } = se(), {
|
|
18241
18229
|
handleDragOver: u,
|
|
18242
18230
|
handleDragEnd: h,
|
|
18243
18231
|
handleDragStart: f,
|
|
@@ -18249,8 +18237,8 @@ function qh({ authToken: t, onSave: a, onClose: n }) {
|
|
|
18249
18237
|
}, [a, d, n, m]), Me(() => {
|
|
18250
18238
|
t && t.accessToken && c(t);
|
|
18251
18239
|
}, [t, c]), Me(() => {
|
|
18252
|
-
var w,
|
|
18253
|
-
l ? ((w = r.current) == null || w.resize(40), o(!0)) : (o(!1), (
|
|
18240
|
+
var w, M;
|
|
18241
|
+
l ? ((w = r.current) == null || w.resize(40), o(!0)) : (o(!1), (M = r.current) == null || M.resize(0));
|
|
18254
18242
|
}, [l, o]);
|
|
18255
18243
|
function p(w) {
|
|
18256
18244
|
w < 1 ? o(!1) : l || o(!0);
|
|
@@ -18346,7 +18334,7 @@ function Yh() {
|
|
|
18346
18334
|
);
|
|
18347
18335
|
}
|
|
18348
18336
|
function Gh() {
|
|
18349
|
-
const t =
|
|
18337
|
+
const t = T((i) => i.selectedDatabaseName), a = T((i) => i.selectedTableName), n = W((i) => i.dashboard.filters) || [], { columns: r } = ut(), { assignFilter: l } = fi();
|
|
18350
18338
|
return /* @__PURE__ */ e(Qe, { className: "flex-1 basis-0 flex-col px-3", children: r == null ? void 0 : r.map((i) => {
|
|
18351
18339
|
const c = n == null ? void 0 : n.find(
|
|
18352
18340
|
(o) => o.column === nt(i.column_name) && o.table === a && o.database === t
|
|
@@ -18379,7 +18367,7 @@ function Hh() {
|
|
|
18379
18367
|
/* @__PURE__ */ s("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
|
|
18380
18368
|
/* @__PURE__ */ e(Z, { className: "px-2 text-lg", children: "Filters" }),
|
|
18381
18369
|
/* @__PURE__ */ e(
|
|
18382
|
-
|
|
18370
|
+
j,
|
|
18383
18371
|
{
|
|
18384
18372
|
onClick: () => t(!1),
|
|
18385
18373
|
className: "h-7 w-7 p-0",
|
|
@@ -18464,7 +18452,7 @@ function Wh() {
|
|
|
18464
18452
|
}),
|
|
18465
18453
|
children: [
|
|
18466
18454
|
/* @__PURE__ */ s(
|
|
18467
|
-
|
|
18455
|
+
j,
|
|
18468
18456
|
{
|
|
18469
18457
|
variant: "secondary",
|
|
18470
18458
|
size: "sm",
|