react-semaphor 0.0.346 → 0.0.348
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/{index-iepZTd2s.js → index-622sBsAD.js} +57 -57
- package/dist/chunks/{index-DhC0Hn1T.js → index-BI4RIp9g.js} +4 -4
- package/dist/chunks/{index-BqTxKEWv.js → index-BbkT5FU1.js} +385 -391
- package/dist/chunks/{index-ggRRMgwy.js → index-Bq5AyXcJ.js} +3521 -3508
- package/dist/chunks/{lucide-react-Be4cg6f4.js → lucide-react-BQZLQzXT.js} +3 -3
- package/dist/chunks/{lucide-react-Dq_in0Ap.js → lucide-react-D6rsddg8.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +30 -30
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +8 -8
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as R, u as vs, v as M, w as is, x as Se, y as e, z as Cs, A as Ns, H as O, o as Ss, J as ws, K as ks, M as zs, N as Os, O as H, Q as ie, R as ta, V as na, W as la, Y as ra, Z as st, _ as at, $ as tt, a0 as Gs, a1 as Y, a2 as Be, i as nt, a3 as u, a4 as lt, P as ia, F as oa, a5 as Ue, a6 as Ge, a7 as Ds, a8 as ca, a9 as Ms, aa as ue, ab as he, ac as me, ad as xe, ae as ve, af as pe, ag as
|
|
1
|
+
import { c as R, u as vs, v as M, w as is, x as Se, y as e, z as Cs, A as Ns, H as O, o as Ss, J as ws, K as ks, M as zs, N as Os, O as H, Q as ie, R as ta, V as na, W as la, Y as ra, Z as st, _ as at, $ as tt, a0 as Gs, a1 as Y, a2 as Be, i as nt, a3 as u, a4 as lt, P as ia, F as oa, a5 as Ue, a6 as Ge, a7 as Ds, a8 as ca, a9 as Ms, aa as ue, ab as he, ac as me, ad as xe, ae as ve, af as pe, ag as Z, T as Is, ah as Fs, ai as Ts, aj as Ls, ak as da, al as ua, am as ce, an as rt, ao as it, ap as ha, aq as ot, C as ct, ar as dt, as as ma, B as ut, at as fe, au as ht, av as Ke, aw as xa, ax as gs, ay as be, az as ze, aA as Ce, aB as pa, aC as mt, aD as xt, aE as pt, aF as ft, l as gt, aG as jt, aH as bt, aI as De, aJ as ne, aK as fa, aL as yt, aM as os, aN as vt, aO as Ct, aP as js, a as Nt, aQ as ss, aR as ye, aS as as, aT as St, aU as wt, aV as kt, aW as zt, aX as fs, aY as Ot, aZ as Ks, a_ as Dt, a$ as Qs, b0 as Mt, b1 as It, b2 as Ft, b3 as Tt, b4 as ga, b5 as Lt, b6 as Es, b7 as ja, b8 as Et, b9 as Vt, ba as Ze, bb as At, bc as qt, bd as ba, be as Rt, s as _t, bf as Ht, bg as $t, r as Pt, bh as cs, bi as ya, bj as va, bk as Ca, bl as Xe, bm as Na, bn as es, bo as Js, bp as Bt, bq as Ut, br as ds, bs as us, bt as hs, bu as Gt, I as Kt, X as Sa, bv as Qt, bw as Jt, bx as Wt, E as Yt, by as ms, bz as Oe, f as Zt, bA as $e, bB as Vs, bC as wa, bD as Xt, bE as en, bF as ts, bG as sn, bH as an, bI as tn, bJ as Ws, bK as ka, bL as nn, bM as ln, bN as rn, bO as on, bP as cn, bQ as dn, bR as un, bS as Me, bT as Q, bU as J, bV as As, bW as W, bX as hn, bY as za, bZ as mn, b_ as xn, b$ as pn, c0 as fn, c1 as gn, c2 as jn, c3 as bn, c4 as yn, c5 as vn } from "./index-Bq5AyXcJ.js";
|
|
2
2
|
import * as Ys from "react";
|
|
3
|
-
import Ne, { useState as q, useMemo as bs, useEffect as
|
|
3
|
+
import Ne, { useState as q, useMemo as bs, useEffect as X, useRef as ns, useCallback as Oa, Suspense as Cn } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -157,7 +157,7 @@ const On = R("Database", [
|
|
|
157
157
|
* This source code is licensed under the ISC license.
|
|
158
158
|
* See the LICENSE file in the root directory of this source tree.
|
|
159
159
|
*/
|
|
160
|
-
const
|
|
160
|
+
const Fa = R("EllipsisVertical", [
|
|
161
161
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
162
162
|
["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
|
|
163
163
|
["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
|
|
@@ -211,7 +211,7 @@ const In = R("Glasses", [
|
|
|
211
211
|
* This source code is licensed under the ISC license.
|
|
212
212
|
* See the LICENSE file in the root directory of this source tree.
|
|
213
213
|
*/
|
|
214
|
-
const
|
|
214
|
+
const Fn = R("Hammer", [
|
|
215
215
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
216
216
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
217
217
|
[
|
|
@@ -228,7 +228,7 @@ const Tn = R("Hammer", [
|
|
|
228
228
|
* This source code is licensed under the ISC license.
|
|
229
229
|
* See the LICENSE file in the root directory of this source tree.
|
|
230
230
|
*/
|
|
231
|
-
const
|
|
231
|
+
const Tn = R("Hash", [
|
|
232
232
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
233
233
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
234
234
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
@@ -240,7 +240,7 @@ const Ln = R("Hash", [
|
|
|
240
240
|
* This source code is licensed under the ISC license.
|
|
241
241
|
* See the LICENSE file in the root directory of this source tree.
|
|
242
242
|
*/
|
|
243
|
-
const
|
|
243
|
+
const Ln = R("House", [
|
|
244
244
|
["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
|
|
245
245
|
[
|
|
246
246
|
"path",
|
|
@@ -267,7 +267,7 @@ const En = R("Key", [
|
|
|
267
267
|
* This source code is licensed under the ISC license.
|
|
268
268
|
* See the LICENSE file in the root directory of this source tree.
|
|
269
269
|
*/
|
|
270
|
-
const
|
|
270
|
+
const Vn = R("ListEnd", [
|
|
271
271
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
272
272
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
273
273
|
["path", { d: "M10 18H3", key: "13769t" }],
|
|
@@ -280,7 +280,7 @@ const An = R("ListEnd", [
|
|
|
280
280
|
* This source code is licensed under the ISC license.
|
|
281
281
|
* See the LICENSE file in the root directory of this source tree.
|
|
282
282
|
*/
|
|
283
|
-
const
|
|
283
|
+
const An = R("ListStart", [
|
|
284
284
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
285
285
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
286
286
|
["path", { d: "M10 6H3", key: "lf8lx7" }],
|
|
@@ -306,7 +306,7 @@ const qn = R("ListX", [
|
|
|
306
306
|
* This source code is licensed under the ISC license.
|
|
307
307
|
* See the LICENSE file in the root directory of this source tree.
|
|
308
308
|
*/
|
|
309
|
-
const
|
|
309
|
+
const Ae = R("LoaderCircle", [
|
|
310
310
|
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
311
311
|
]);
|
|
312
312
|
/**
|
|
@@ -315,7 +315,7 @@ const Ve = R("LoaderCircle", [
|
|
|
315
315
|
* This source code is licensed under the ISC license.
|
|
316
316
|
* See the LICENSE file in the root directory of this source tree.
|
|
317
317
|
*/
|
|
318
|
-
const
|
|
318
|
+
const Ta = R("Map", [
|
|
319
319
|
[
|
|
320
320
|
"path",
|
|
321
321
|
{
|
|
@@ -366,7 +366,7 @@ const Hn = R("Play", [
|
|
|
366
366
|
* This source code is licensed under the ISC license.
|
|
367
367
|
* See the LICENSE file in the root directory of this source tree.
|
|
368
368
|
*/
|
|
369
|
-
const
|
|
369
|
+
const $n = R("Plug2", [
|
|
370
370
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
371
371
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
372
372
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
@@ -379,7 +379,7 @@ const Pn = R("Plug2", [
|
|
|
379
379
|
* This source code is licensed under the ISC license.
|
|
380
380
|
* See the LICENSE file in the root directory of this source tree.
|
|
381
381
|
*/
|
|
382
|
-
const
|
|
382
|
+
const Pn = R("Save", [
|
|
383
383
|
[
|
|
384
384
|
"path",
|
|
385
385
|
{
|
|
@@ -396,7 +396,7 @@ const $n = R("Save", [
|
|
|
396
396
|
* This source code is licensed under the ISC license.
|
|
397
397
|
* See the LICENSE file in the root directory of this source tree.
|
|
398
398
|
*/
|
|
399
|
-
const
|
|
399
|
+
const La = R("Shapes", [
|
|
400
400
|
[
|
|
401
401
|
"path",
|
|
402
402
|
{
|
|
@@ -557,7 +557,7 @@ function Yn(s) {
|
|
|
557
557
|
}
|
|
558
558
|
} : null;
|
|
559
559
|
}
|
|
560
|
-
async function
|
|
560
|
+
async function Zn(s, n, a, t) {
|
|
561
561
|
if (!t)
|
|
562
562
|
return null;
|
|
563
563
|
const l = JSON.stringify(n);
|
|
@@ -581,7 +581,7 @@ async function ys(s, n) {
|
|
|
581
581
|
operation: "update"
|
|
582
582
|
});
|
|
583
583
|
}
|
|
584
|
-
async function
|
|
584
|
+
async function Xn(s, n) {
|
|
585
585
|
return n ? await vs("https://semaphor.cloud/api/v1/lens", n, {
|
|
586
586
|
operation: "delete",
|
|
587
587
|
lensId: s
|
|
@@ -593,7 +593,7 @@ function el() {
|
|
|
593
593
|
d(!0);
|
|
594
594
|
const p = Ea(
|
|
595
595
|
b
|
|
596
|
-
), N = await
|
|
596
|
+
), N = await Zn(
|
|
597
597
|
s,
|
|
598
598
|
p,
|
|
599
599
|
g,
|
|
@@ -654,7 +654,7 @@ function sl() {
|
|
|
654
654
|
r(c);
|
|
655
655
|
}
|
|
656
656
|
async function d(c) {
|
|
657
|
-
if (await
|
|
657
|
+
if (await Xn(c, o == null ? void 0 : o.accessToken)) {
|
|
658
658
|
const g = a == null ? void 0 : a.filter((h) => h.id !== c);
|
|
659
659
|
l(g || []), r("original");
|
|
660
660
|
}
|
|
@@ -703,7 +703,7 @@ function sl() {
|
|
|
703
703
|
/* @__PURE__ */ e.jsx("p", { children: c.name }),
|
|
704
704
|
/* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
|
|
705
705
|
/* @__PURE__ */ e.jsx(
|
|
706
|
-
|
|
706
|
+
Ln,
|
|
707
707
|
{
|
|
708
708
|
onClick: (b) => {
|
|
709
709
|
b.preventDefault(), x(c);
|
|
@@ -764,7 +764,7 @@ function al({
|
|
|
764
764
|
className: "group h-7 p-2",
|
|
765
765
|
size: "sm",
|
|
766
766
|
onClick: o,
|
|
767
|
-
children: n ? /* @__PURE__ */ e.jsx(
|
|
767
|
+
children: n ? /* @__PURE__ */ e.jsx(Ae, { className: Y("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
|
|
768
768
|
nt,
|
|
769
769
|
{
|
|
770
770
|
className: Y("size-3.5", s),
|
|
@@ -791,10 +791,10 @@ function tl() {
|
|
|
791
791
|
(j) => j.actions.setShowFilters
|
|
792
792
|
), { addFrame: f, setSelectedFrameId: p } = M(
|
|
793
793
|
(j) => j.actions
|
|
794
|
-
), { getSelectedSheet: N, setIsDashboardEditing: y, setShowDashboardJSON:
|
|
794
|
+
), { getSelectedSheet: N, setIsDashboardEditing: y, setShowDashboardJSON: V } = M((j) => j.actions), I = N(), { tenantId: z, endUserId: F } = bs(
|
|
795
795
|
() => lt(s == null ? void 0 : s.accessToken),
|
|
796
796
|
[s == null ? void 0 : s.accessToken]
|
|
797
|
-
),
|
|
797
|
+
), T = bs(() => z || F, [z, F]), A = () => {
|
|
798
798
|
if (!r || !I) return;
|
|
799
799
|
const j = {
|
|
800
800
|
connectionId: o,
|
|
@@ -841,8 +841,8 @@ function tl() {
|
|
|
841
841
|
!c && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(H, { children: t == null ? void 0 : t.name }) }),
|
|
842
842
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
843
843
|
/* @__PURE__ */ e.jsx(al, {}),
|
|
844
|
-
r && !c &&
|
|
845
|
-
!c &&
|
|
844
|
+
r && !c && T && /* @__PURE__ */ e.jsx(el, {}),
|
|
845
|
+
!c && T && /* @__PURE__ */ e.jsx(sl, {}),
|
|
846
846
|
r && !c && /* @__PURE__ */ e.jsxs(
|
|
847
847
|
O,
|
|
848
848
|
{
|
|
@@ -850,7 +850,7 @@ function tl() {
|
|
|
850
850
|
className: "h-7 p-2",
|
|
851
851
|
size: "sm",
|
|
852
852
|
disabled: !r,
|
|
853
|
-
onClick:
|
|
853
|
+
onClick: A,
|
|
854
854
|
children: [
|
|
855
855
|
/* @__PURE__ */ e.jsx(Ss, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
856
856
|
"Frame"
|
|
@@ -874,13 +874,13 @@ function tl() {
|
|
|
874
874
|
role: "close",
|
|
875
875
|
className: "h-7 p-2",
|
|
876
876
|
onClick: () => {
|
|
877
|
-
y(!1),
|
|
877
|
+
y(!1), V(!1);
|
|
878
878
|
},
|
|
879
879
|
size: "sm",
|
|
880
880
|
children: /* @__PURE__ */ e.jsx(Be, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
881
881
|
}
|
|
882
882
|
),
|
|
883
|
-
r && !c &&
|
|
883
|
+
r && !c && T && /* @__PURE__ */ e.jsx(
|
|
884
884
|
O,
|
|
885
885
|
{
|
|
886
886
|
className: "h-7 p-2",
|
|
@@ -888,7 +888,7 @@ function tl() {
|
|
|
888
888
|
disabled: i,
|
|
889
889
|
onClick: v,
|
|
890
890
|
size: "sm",
|
|
891
|
-
children: /* @__PURE__ */ e.jsx(
|
|
891
|
+
children: /* @__PURE__ */ e.jsx(Pn, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
892
892
|
}
|
|
893
893
|
),
|
|
894
894
|
!b && !c && r && /* @__PURE__ */ e.jsx(
|
|
@@ -924,7 +924,7 @@ function He({
|
|
|
924
924
|
const b = t ? "Loading..." : l ? "Error" : a;
|
|
925
925
|
function g() {
|
|
926
926
|
if (s === "Connection")
|
|
927
|
-
return /* @__PURE__ */ e.jsx(
|
|
927
|
+
return /* @__PURE__ */ e.jsx($n, { className: "size-4 rotate-90" });
|
|
928
928
|
if (s === "Database")
|
|
929
929
|
return /* @__PURE__ */ e.jsx(On, { className: "size-4" });
|
|
930
930
|
if (s === "Schema")
|
|
@@ -958,10 +958,10 @@ function He({
|
|
|
958
958
|
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
959
959
|
t ? /* @__PURE__ */ e.jsx(pe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(pe, { children: s }),
|
|
960
960
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
961
|
-
i && /* @__PURE__ */ e.jsx(
|
|
962
|
-
n && n.map((h, f) => /* @__PURE__ */ e.jsx(
|
|
961
|
+
i && /* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }, "none"),
|
|
962
|
+
n && n.map((h, f) => /* @__PURE__ */ e.jsx(Z, { value: h.id, children: h.name }, f))
|
|
963
963
|
] }),
|
|
964
|
-
(t || l) && /* @__PURE__ */ e.jsx(
|
|
964
|
+
(t || l) && /* @__PURE__ */ e.jsx(Z, { value: b, children: b })
|
|
965
965
|
] }) })
|
|
966
966
|
] })
|
|
967
967
|
] });
|
|
@@ -973,10 +973,10 @@ function nl({ column: s }) {
|
|
|
973
973
|
(h) => h.selectedDatamodelId
|
|
974
974
|
), o = u((h) => h.sqlGen), { modelItems: i } = qe(), d = u((h) => h.actions.setSqlGen), x = u((h) => h.actions.setCardSql), c = u((h) => h.actions.setRunSql);
|
|
975
975
|
function b(h, f) {
|
|
976
|
-
var
|
|
977
|
-
const p = da(h, o, f), N = (
|
|
976
|
+
var V;
|
|
977
|
+
const p = da(h, o, f), N = (V = i == null ? void 0 : i.find(
|
|
978
978
|
(I) => I.id === r
|
|
979
|
-
)) == null ? void 0 :
|
|
979
|
+
)) == null ? void 0 : V.name;
|
|
980
980
|
d(p);
|
|
981
981
|
const y = ua(
|
|
982
982
|
p,
|
|
@@ -1030,10 +1030,10 @@ function nl({ column: s }) {
|
|
|
1030
1030
|
)
|
|
1031
1031
|
] });
|
|
1032
1032
|
}
|
|
1033
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1034
|
-
/* @__PURE__ */ e.jsx(
|
|
1033
|
+
return /* @__PURE__ */ e.jsxs(Fs, { openDelay: 0, open: n, onOpenChange: a, children: [
|
|
1034
|
+
/* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsx(Fa, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
|
|
1035
1035
|
/* @__PURE__ */ e.jsx(
|
|
1036
|
-
|
|
1036
|
+
Ls,
|
|
1037
1037
|
{
|
|
1038
1038
|
align: "center",
|
|
1039
1039
|
className: "w-20 rounded-md p-0 shadow-none",
|
|
@@ -1042,15 +1042,9 @@ function nl({ column: s }) {
|
|
|
1042
1042
|
)
|
|
1043
1043
|
] });
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1045
|
+
function Va({ column: s }) {
|
|
1046
1046
|
return /* @__PURE__ */ e.jsxs(Ds, { children: [
|
|
1047
|
-
/* @__PURE__ */ e.jsx(rt, { asChild: !0, children: it.
|
|
1048
|
-
// <span className=" font-thin">T</span>
|
|
1049
|
-
/* @__PURE__ */ e.jsx(_s, { className: "size-3" })
|
|
1050
|
-
) : ha.includes(s.data_type.toLowerCase()) ? (
|
|
1051
|
-
//
|
|
1052
|
-
/* @__PURE__ */ e.jsx(Ln, { className: "size-3" })
|
|
1053
|
-
) : ot.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(ct, { className: "size-3" }) : dt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Qn, { className: "size-3" }) : s.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e.jsx(Sn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Bn, { className: "size-3" }) }),
|
|
1047
|
+
/* @__PURE__ */ e.jsx(rt, { asChild: !0, children: it(s.data_type) ? /* @__PURE__ */ e.jsx(_s, { className: "size-3" }) : ha(s.data_type) ? /* @__PURE__ */ e.jsx(Tn, { className: "size-3" }) : ot(s.data_type) ? /* @__PURE__ */ e.jsx(ct, { className: "size-3" }) : dt(s.data_type) ? /* @__PURE__ */ e.jsx(Qn, { className: "size-3" }) : s.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e.jsx(Sn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Bn, { className: "size-3" }) }),
|
|
1054
1048
|
/* @__PURE__ */ e.jsx(Ms, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
|
|
1055
1049
|
] });
|
|
1056
1050
|
}
|
|
@@ -1073,7 +1067,7 @@ function ll({
|
|
|
1073
1067
|
), { setAIScopeTables: b } = M((m) => m.actions), g = u((m) => m.actions.setRunSql), h = u((m) => m.actions.setSqlGen), f = u(
|
|
1074
1068
|
(m) => m.actions.setIsShowingVisual
|
|
1075
1069
|
), p = u((m) => m.actions.setCardSql), { connectionType: N, modelItems: y } = qe();
|
|
1076
|
-
function
|
|
1070
|
+
function V(m) {
|
|
1077
1071
|
var S;
|
|
1078
1072
|
const v = da(m, l);
|
|
1079
1073
|
h(v);
|
|
@@ -1096,7 +1090,7 @@ function ll({
|
|
|
1096
1090
|
schemaName: i,
|
|
1097
1091
|
tableName: d
|
|
1098
1092
|
}, D = [...c || [], v].filter(
|
|
1099
|
-
(S, _,
|
|
1093
|
+
(S, _, P) => P.findIndex(
|
|
1100
1094
|
(K) => K.connectinonId === S.connectinonId && K.tableName === S.tableName
|
|
1101
1095
|
) === _
|
|
1102
1096
|
);
|
|
@@ -1116,7 +1110,7 @@ function ll({
|
|
|
1116
1110
|
});
|
|
1117
1111
|
}
|
|
1118
1112
|
}
|
|
1119
|
-
function
|
|
1113
|
+
function F() {
|
|
1120
1114
|
var S;
|
|
1121
1115
|
let m = xa(s, n);
|
|
1122
1116
|
const v = (S = y == null ? void 0 : y.find(
|
|
@@ -1124,16 +1118,16 @@ function ll({
|
|
|
1124
1118
|
)) == null ? void 0 : S.name;
|
|
1125
1119
|
x && x !== "none" && (m = `${gs}.${v}`);
|
|
1126
1120
|
let j = m;
|
|
1127
|
-
return ((_) => /[A-Z]/.test(_))(n) && (j = j.split(".").map((
|
|
1121
|
+
return ((_) => /[A-Z]/.test(_))(n) && (j = j.split(".").map((P) => `"${P}"`).join(".")), j;
|
|
1128
1122
|
}
|
|
1129
|
-
function
|
|
1130
|
-
const m =
|
|
1123
|
+
function T() {
|
|
1124
|
+
const m = F();
|
|
1131
1125
|
f(!1);
|
|
1132
1126
|
const v = N === "MSSQL" ? `SELECT top 10 * FROM ${m}` : `SELECT * FROM ${m} LIMIT 10`;
|
|
1133
1127
|
p(v), g(!0);
|
|
1134
1128
|
}
|
|
1135
|
-
function
|
|
1136
|
-
const m =
|
|
1129
|
+
function A() {
|
|
1130
|
+
const m = F();
|
|
1137
1131
|
p(`SELECT COUNT(*) as count FROM ${m}`), g(!0);
|
|
1138
1132
|
}
|
|
1139
1133
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
|
|
@@ -1161,12 +1155,12 @@ function ll({
|
|
|
1161
1155
|
O,
|
|
1162
1156
|
{
|
|
1163
1157
|
disabled: t !== "Success",
|
|
1164
|
-
onClick:
|
|
1158
|
+
onClick: T,
|
|
1165
1159
|
size: "sm",
|
|
1166
1160
|
variant: "secondary",
|
|
1167
1161
|
className: "flex",
|
|
1168
1162
|
children: [
|
|
1169
|
-
t !== "Success" ? /* @__PURE__ */ e.jsx(
|
|
1163
|
+
t !== "Success" ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Gn, { className: "mr-2 size-4" }),
|
|
1170
1164
|
"Top 10"
|
|
1171
1165
|
]
|
|
1172
1166
|
}
|
|
@@ -1175,12 +1169,12 @@ function ll({
|
|
|
1175
1169
|
O,
|
|
1176
1170
|
{
|
|
1177
1171
|
disabled: t !== "Success",
|
|
1178
|
-
onClick:
|
|
1172
|
+
onClick: A,
|
|
1179
1173
|
size: "sm",
|
|
1180
1174
|
variant: "secondary",
|
|
1181
1175
|
className: "flex",
|
|
1182
1176
|
children: [
|
|
1183
|
-
t !== "Success" ? /* @__PURE__ */ e.jsx(
|
|
1177
|
+
t !== "Success" ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Un, { className: "mr-2 size-4" }),
|
|
1184
1178
|
"Count"
|
|
1185
1179
|
]
|
|
1186
1180
|
}
|
|
@@ -1194,7 +1188,7 @@ function ll({
|
|
|
1194
1188
|
a == null ? void 0 : a.map((m) => /* @__PURE__ */ e.jsxs(
|
|
1195
1189
|
"div",
|
|
1196
1190
|
{
|
|
1197
|
-
onClick: () =>
|
|
1191
|
+
onClick: () => V(m),
|
|
1198
1192
|
className: Y(
|
|
1199
1193
|
"group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
1200
1194
|
{
|
|
@@ -1203,7 +1197,7 @@ function ll({
|
|
|
1203
1197
|
),
|
|
1204
1198
|
children: [
|
|
1205
1199
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1206
|
-
/* @__PURE__ */ e.jsx(
|
|
1200
|
+
/* @__PURE__ */ e.jsx(Va, { column: m }),
|
|
1207
1201
|
/* @__PURE__ */ e.jsx("span", { children: m.column_name })
|
|
1208
1202
|
] }),
|
|
1209
1203
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1211,7 +1205,7 @@ function ll({
|
|
|
1211
1205
|
{
|
|
1212
1206
|
onClick: (v) => v.stopPropagation(),
|
|
1213
1207
|
className: "flex items-center justify-end",
|
|
1214
|
-
children: ha
|
|
1208
|
+
children: ha(m.data_type) && /* @__PURE__ */ e.jsx(nl, { column: m })
|
|
1215
1209
|
}
|
|
1216
1210
|
)
|
|
1217
1211
|
]
|
|
@@ -1226,7 +1220,7 @@ function ll({
|
|
|
1226
1220
|
] });
|
|
1227
1221
|
}
|
|
1228
1222
|
function qe(s, n) {
|
|
1229
|
-
var Je,
|
|
1223
|
+
var Je, $s, Ps, Bs, Us;
|
|
1230
1224
|
let a = bs(() => [], []);
|
|
1231
1225
|
const t = Se().authToken || s, l = u(
|
|
1232
1226
|
(C) => C.selectedConnectionId
|
|
@@ -1255,13 +1249,13 @@ function qe(s, n) {
|
|
|
1255
1249
|
function y(C) {
|
|
1256
1250
|
return !!(l && o && o !== "NA" && i && d || l && (C === "S3" || C === "API") || r && r);
|
|
1257
1251
|
}
|
|
1258
|
-
function
|
|
1252
|
+
function V(C) {
|
|
1259
1253
|
return l && C ? !(C === "API" || C === "S3") : !1;
|
|
1260
1254
|
}
|
|
1261
1255
|
const {
|
|
1262
1256
|
data: I,
|
|
1263
1257
|
isLoading: z,
|
|
1264
|
-
isError:
|
|
1258
|
+
isError: F
|
|
1265
1259
|
} = be({
|
|
1266
1260
|
queryKey: ["connections"],
|
|
1267
1261
|
queryFn: () => ze(
|
|
@@ -1271,8 +1265,8 @@ function qe(s, n) {
|
|
|
1271
1265
|
enabled: !!(t != null && t.accessToken)
|
|
1272
1266
|
// Only fetch if authToken is present
|
|
1273
1267
|
}), {
|
|
1274
|
-
data:
|
|
1275
|
-
isLoading:
|
|
1268
|
+
data: T,
|
|
1269
|
+
isLoading: A,
|
|
1276
1270
|
isError: m
|
|
1277
1271
|
} = be({
|
|
1278
1272
|
queryKey: ["models", l],
|
|
@@ -1290,7 +1284,7 @@ function qe(s, n) {
|
|
|
1290
1284
|
), j = v == null ? void 0 : v.type, D = (v == null ? void 0 : v.type) === "API" || (v == null ? void 0 : v.type) === "S3", {
|
|
1291
1285
|
data: S,
|
|
1292
1286
|
isLoading: _,
|
|
1293
|
-
isFetching:
|
|
1287
|
+
isFetching: P,
|
|
1294
1288
|
isError: K,
|
|
1295
1289
|
refetch: ee
|
|
1296
1290
|
} = be({
|
|
@@ -1302,13 +1296,13 @@ function qe(s, n) {
|
|
|
1302
1296
|
connection_id: l
|
|
1303
1297
|
}
|
|
1304
1298
|
),
|
|
1305
|
-
enabled:
|
|
1299
|
+
enabled: V(j)
|
|
1306
1300
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1307
1301
|
}), {
|
|
1308
1302
|
data: G,
|
|
1309
1303
|
isLoading: se,
|
|
1310
1304
|
isFetching: k,
|
|
1311
|
-
isError:
|
|
1305
|
+
isError: $,
|
|
1312
1306
|
refetch: U
|
|
1313
1307
|
} = be({
|
|
1314
1308
|
queryKey: ["schemas", l, o],
|
|
@@ -1324,7 +1318,7 @@ function qe(s, n) {
|
|
|
1324
1318
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1325
1319
|
}), {
|
|
1326
1320
|
data: E,
|
|
1327
|
-
isLoading:
|
|
1321
|
+
isLoading: L,
|
|
1328
1322
|
isFetching: re,
|
|
1329
1323
|
isError: B,
|
|
1330
1324
|
refetch: ae
|
|
@@ -1348,7 +1342,7 @@ function qe(s, n) {
|
|
|
1348
1342
|
}), {
|
|
1349
1343
|
data: te,
|
|
1350
1344
|
isLoading: je,
|
|
1351
|
-
isFetching:
|
|
1345
|
+
isFetching: Fe,
|
|
1352
1346
|
isError: we
|
|
1353
1347
|
} = be({
|
|
1354
1348
|
queryKey: [
|
|
@@ -1380,9 +1374,9 @@ function qe(s, n) {
|
|
|
1380
1374
|
//currentConnection?.type === 'API',
|
|
1381
1375
|
// && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
|
|
1382
1376
|
});
|
|
1383
|
-
|
|
1377
|
+
X(() => {
|
|
1384
1378
|
x(a);
|
|
1385
|
-
}, [te, x, a]),
|
|
1379
|
+
}, [te, x, a]), X(() => {
|
|
1386
1380
|
}, [
|
|
1387
1381
|
D,
|
|
1388
1382
|
p,
|
|
@@ -1391,11 +1385,11 @@ function qe(s, n) {
|
|
|
1391
1385
|
g,
|
|
1392
1386
|
v
|
|
1393
1387
|
]);
|
|
1394
|
-
const
|
|
1388
|
+
const Te = (v == null ? void 0 : v.type) === "API" ? (Je = v == null ? void 0 : v.type) == null ? void 0 : Je.toLowerCase() : d || "", Le = D ? "" : i || "";
|
|
1395
1389
|
function Ee(C) {
|
|
1396
1390
|
h(C), f("");
|
|
1397
1391
|
}
|
|
1398
|
-
function
|
|
1392
|
+
function Ve(C) {
|
|
1399
1393
|
g(C === "none" ? "" : C), h(""), f(""), C !== "none" && C !== "" && b("");
|
|
1400
1394
|
}
|
|
1401
1395
|
function w(C) {
|
|
@@ -1404,17 +1398,17 @@ function qe(s, n) {
|
|
|
1404
1398
|
function le(C) {
|
|
1405
1399
|
b(C === "none" ? "" : C), C !== "none" && C !== "" && g("");
|
|
1406
1400
|
}
|
|
1407
|
-
S && ((
|
|
1401
|
+
S && (($s = S == null ? void 0 : S.databases) == null ? void 0 : $s.length) > 0, G && ((Ps = G == null ? void 0 : G.schemas) == null ? void 0 : Ps.length) > 0, te && ((Bs = te == null ? void 0 : te.columns) == null ? void 0 : Bs.length) > 0 && (a = te.columns.map((C) => ({
|
|
1408
1402
|
...C,
|
|
1409
1403
|
data_type: C.data_type.toLowerCase()
|
|
1410
|
-
}))), K && (a = []), (we ||
|
|
1404
|
+
}))), K && (a = []), (we || F) && (a = []);
|
|
1411
1405
|
const ke = I == null ? void 0 : I.connections.map(
|
|
1412
1406
|
(C) => ({
|
|
1413
1407
|
id: C.id,
|
|
1414
1408
|
name: C.name,
|
|
1415
1409
|
type: C.type
|
|
1416
1410
|
})
|
|
1417
|
-
), oe = (Us =
|
|
1411
|
+
), oe = (Us = T == null ? void 0 : T.datamodels) == null ? void 0 : Us.map((C) => ({
|
|
1418
1412
|
id: C.id,
|
|
1419
1413
|
name: C.name
|
|
1420
1414
|
})), _e = S == null ? void 0 : S.databases.map((C) => ({
|
|
@@ -1430,33 +1424,33 @@ function qe(s, n) {
|
|
|
1430
1424
|
return {
|
|
1431
1425
|
connectionItems: ke,
|
|
1432
1426
|
isConnectionsLoading: z,
|
|
1433
|
-
isConnectionsError:
|
|
1427
|
+
isConnectionsError: F,
|
|
1434
1428
|
modelItems: oe,
|
|
1435
|
-
isModelsLoading:
|
|
1429
|
+
isModelsLoading: A,
|
|
1436
1430
|
isModelsError: m,
|
|
1437
1431
|
databaseItems: _e,
|
|
1438
|
-
isDatabasesLoadingOrFetching: _ ||
|
|
1432
|
+
isDatabasesLoadingOrFetching: _ || P,
|
|
1439
1433
|
isDatabaseError: K,
|
|
1440
1434
|
schemaItems: ps,
|
|
1441
1435
|
isSchemaLoadingOrFetching: se || k,
|
|
1442
|
-
isSchemaError:
|
|
1436
|
+
isSchemaError: $,
|
|
1443
1437
|
tableItems: Qe,
|
|
1444
|
-
isTableLoadingOrFetching:
|
|
1438
|
+
isTableLoadingOrFetching: L || re,
|
|
1445
1439
|
isTableError: B,
|
|
1446
1440
|
columns: a,
|
|
1447
|
-
isColumnsLoadingOrFetching: je ||
|
|
1441
|
+
isColumnsLoadingOrFetching: je || Fe,
|
|
1448
1442
|
isColumnsError: we,
|
|
1449
1443
|
isNonDbConnection: D,
|
|
1450
1444
|
connectionType: j,
|
|
1451
|
-
tableName:
|
|
1452
|
-
schemaName:
|
|
1445
|
+
tableName: Te,
|
|
1446
|
+
schemaName: Le,
|
|
1453
1447
|
handleConnectionChange: w,
|
|
1454
1448
|
handleDatamodelChange: le,
|
|
1455
|
-
handleDatabaseChange:
|
|
1449
|
+
handleDatabaseChange: Ve,
|
|
1456
1450
|
handleSchemaChange: Ee
|
|
1457
1451
|
};
|
|
1458
1452
|
}
|
|
1459
|
-
function
|
|
1453
|
+
function Aa({
|
|
1460
1454
|
ColumnsComponent: s
|
|
1461
1455
|
}) {
|
|
1462
1456
|
var re;
|
|
@@ -1482,19 +1476,19 @@ function Va({
|
|
|
1482
1476
|
isConnectionsError: p,
|
|
1483
1477
|
isModelsError: N,
|
|
1484
1478
|
isDatabasesLoadingOrFetching: y,
|
|
1485
|
-
isDatabaseError:
|
|
1479
|
+
isDatabaseError: V,
|
|
1486
1480
|
isSchemaLoadingOrFetching: I,
|
|
1487
1481
|
isSchemaError: z,
|
|
1488
|
-
isColumnsError:
|
|
1489
|
-
isColumnsLoadingOrFetching:
|
|
1490
|
-
isTableLoadingOrFetching:
|
|
1482
|
+
isColumnsError: F,
|
|
1483
|
+
isColumnsLoadingOrFetching: T,
|
|
1484
|
+
isTableLoadingOrFetching: A,
|
|
1491
1485
|
isTableError: m,
|
|
1492
1486
|
connectionType: v,
|
|
1493
1487
|
isNonDbConnection: j,
|
|
1494
1488
|
handleConnectionChange: D,
|
|
1495
1489
|
handleDatabaseChange: S,
|
|
1496
1490
|
handleSchemaChange: _,
|
|
1497
|
-
handleDatamodelChange:
|
|
1491
|
+
handleDatamodelChange: P,
|
|
1498
1492
|
tableName: K,
|
|
1499
1493
|
schemaName: ee
|
|
1500
1494
|
} = qe();
|
|
@@ -1505,7 +1499,7 @@ function Va({
|
|
|
1505
1499
|
schemaName: ee,
|
|
1506
1500
|
tableName: K,
|
|
1507
1501
|
columns: g,
|
|
1508
|
-
status:
|
|
1502
|
+
status: T ? "Loading..." : F ? "Error" : "Success"
|
|
1509
1503
|
}
|
|
1510
1504
|
);
|
|
1511
1505
|
}
|
|
@@ -1520,7 +1514,7 @@ function Va({
|
|
|
1520
1514
|
{
|
|
1521
1515
|
showNone: !0,
|
|
1522
1516
|
onChange: S,
|
|
1523
|
-
isError:
|
|
1517
|
+
isError: V,
|
|
1524
1518
|
isLoading: y,
|
|
1525
1519
|
items: c,
|
|
1526
1520
|
value: t || "",
|
|
@@ -1528,7 +1522,7 @@ function Va({
|
|
|
1528
1522
|
}
|
|
1529
1523
|
);
|
|
1530
1524
|
}
|
|
1531
|
-
function
|
|
1525
|
+
function $() {
|
|
1532
1526
|
if (n && !j && (!t || t === "none") && (!a || a === "none"))
|
|
1533
1527
|
return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
|
|
1534
1528
|
/* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(Ce, {}) }),
|
|
@@ -1543,7 +1537,7 @@ function Va({
|
|
|
1543
1537
|
He,
|
|
1544
1538
|
{
|
|
1545
1539
|
showNone: !0,
|
|
1546
|
-
onChange:
|
|
1540
|
+
onChange: P,
|
|
1547
1541
|
isError: N,
|
|
1548
1542
|
isLoading: f,
|
|
1549
1543
|
items: d,
|
|
@@ -1565,7 +1559,7 @@ function Va({
|
|
|
1565
1559
|
}
|
|
1566
1560
|
);
|
|
1567
1561
|
}
|
|
1568
|
-
function
|
|
1562
|
+
function L() {
|
|
1569
1563
|
function B() {
|
|
1570
1564
|
let ae = !1;
|
|
1571
1565
|
return v === "API" ? (ae = !1, ae) : ((v === "S3" || n && t && t !== "none" && l) && (ae = !0), ae);
|
|
@@ -1576,7 +1570,7 @@ function Va({
|
|
|
1576
1570
|
onChange: o,
|
|
1577
1571
|
isError: m,
|
|
1578
1572
|
items: b,
|
|
1579
|
-
isLoading:
|
|
1573
|
+
isLoading: A,
|
|
1580
1574
|
value: r || "",
|
|
1581
1575
|
title: "Table"
|
|
1582
1576
|
}
|
|
@@ -1599,10 +1593,10 @@ function Va({
|
|
|
1599
1593
|
}
|
|
1600
1594
|
),
|
|
1601
1595
|
U(),
|
|
1602
|
-
|
|
1596
|
+
$(),
|
|
1603
1597
|
k(),
|
|
1604
1598
|
E(),
|
|
1605
|
-
|
|
1599
|
+
L()
|
|
1606
1600
|
] }),
|
|
1607
1601
|
G(),
|
|
1608
1602
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
|
|
@@ -1642,10 +1636,10 @@ function il({
|
|
|
1642
1636
|
setUserInputforAI: a,
|
|
1643
1637
|
setTriggerAIRun: t
|
|
1644
1638
|
}) {
|
|
1645
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1646
|
-
/* @__PURE__ */ e.jsx(
|
|
1639
|
+
return /* @__PURE__ */ e.jsxs(Fs, { openDelay: 0, children: [
|
|
1640
|
+
/* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(kn, { className: "h-4 w-4 text-red-500" }) }) }),
|
|
1647
1641
|
/* @__PURE__ */ e.jsx(
|
|
1648
|
-
|
|
1642
|
+
Ls,
|
|
1649
1643
|
{
|
|
1650
1644
|
align: "start",
|
|
1651
1645
|
className: "w-full min-w-fit max-w-[700px]",
|
|
@@ -1660,7 +1654,7 @@ function il({
|
|
|
1660
1654
|
size: "sm",
|
|
1661
1655
|
variant: "outline",
|
|
1662
1656
|
children: [
|
|
1663
|
-
/* @__PURE__ */ e.jsx(
|
|
1657
|
+
/* @__PURE__ */ e.jsx(Fn, { className: "mr-2 h-4 w-4" }),
|
|
1664
1658
|
"Debug with AI"
|
|
1665
1659
|
]
|
|
1666
1660
|
}
|
|
@@ -1725,21 +1719,21 @@ function cl({
|
|
|
1725
1719
|
triggerAIRun: l,
|
|
1726
1720
|
setTriggerAIRun: r
|
|
1727
1721
|
}) {
|
|
1728
|
-
const o = ns(null), i = ns(null), { authToken: d } = Se(), [x, c] = q(!1), b = u((k) => k.actions.setCardSql), g = M((k) => k.dashboard.baseQueries), h = u((k) => k.actions.setRunSql), f = u((k) => k.actions.setCardType), [p, N] = q([]), y = u((k) => k.currentColumns),
|
|
1722
|
+
const o = ns(null), i = ns(null), { authToken: d } = Se(), [x, c] = q(!1), b = u((k) => k.actions.setCardSql), g = M((k) => k.dashboard.baseQueries), h = u((k) => k.actions.setRunSql), f = u((k) => k.actions.setCardType), [p, N] = q([]), y = u((k) => k.currentColumns), V = u((k) => k.card.sql), I = u((k) => k.selectedTableName), z = `
|
|
1729
1723
|
${a}
|
|
1730
1724
|
|
|
1731
1725
|
Database Query Dialect: ${I === "api" || I === "s3" ? "DuckDb" : ""}
|
|
1732
1726
|
Table Name: ${I}
|
|
1733
1727
|
Table Columns: ${y == null ? void 0 : y.map((k) => `${k.column_name} | ${k.data_type}`).join(", ")}
|
|
1734
|
-
User SQL: ${
|
|
1735
|
-
${g && `Base Queries: ${JSON.stringify(g)} `}`,
|
|
1736
|
-
Visual Query Syntax: ${ol}`, { data:
|
|
1728
|
+
User SQL: ${V}
|
|
1729
|
+
${g && `Base Queries: ${JSON.stringify(g)} `}`, F = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
|
|
1730
|
+
Visual Query Syntax: ${ol}`, { data: T, isLoading: A, isFetching: m, isError: v, refetch: j } = be({
|
|
1737
1731
|
queryKey: ["ai-query"],
|
|
1738
1732
|
queryFn: () => ze(
|
|
1739
1733
|
"https://semaphor.cloud/api/v1/ai",
|
|
1740
1734
|
(d == null ? void 0 : d.accessToken) || "",
|
|
1741
1735
|
{
|
|
1742
|
-
user_content: `userContent: ${z} ${x ?
|
|
1736
|
+
user_content: `userContent: ${z} ${x ? F : ""}`
|
|
1743
1737
|
}
|
|
1744
1738
|
),
|
|
1745
1739
|
enabled: !1
|
|
@@ -1766,22 +1760,22 @@ function cl({
|
|
|
1766
1760
|
return f("bar"), !1;
|
|
1767
1761
|
return !0;
|
|
1768
1762
|
}
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
}, [
|
|
1763
|
+
X(() => {
|
|
1764
|
+
T && N((k) => [...k, { role: "ai", content: T.response }]);
|
|
1765
|
+
}, [T]), X(() => {
|
|
1772
1766
|
const k = setTimeout(() => {
|
|
1773
|
-
var
|
|
1767
|
+
var $;
|
|
1774
1768
|
i.current && (i.current.scroll({
|
|
1775
1769
|
top: i.current.scrollHeight,
|
|
1776
1770
|
behavior: "smooth"
|
|
1777
|
-
}), (
|
|
1771
|
+
}), ($ = o.current) == null || $.focus());
|
|
1778
1772
|
}, 100);
|
|
1779
1773
|
return () => clearTimeout(k);
|
|
1780
1774
|
}, [p]);
|
|
1781
1775
|
function S() {
|
|
1782
1776
|
a && (N((k) => [...k, { role: "user", content: a }]), D(a) && c(!0), t(""), j());
|
|
1783
1777
|
}
|
|
1784
|
-
|
|
1778
|
+
X(() => {
|
|
1785
1779
|
l && (S(), r(!1));
|
|
1786
1780
|
}, [l, r]);
|
|
1787
1781
|
const _ = {
|
|
@@ -1792,7 +1786,7 @@ function cl({
|
|
|
1792
1786
|
fontSize: 15,
|
|
1793
1787
|
// padding: '5px',
|
|
1794
1788
|
width: "100%"
|
|
1795
|
-
},
|
|
1789
|
+
}, P = {
|
|
1796
1790
|
// background: '#f6f8fa',
|
|
1797
1791
|
// color: '#000',
|
|
1798
1792
|
fontFamily: "monospace",
|
|
@@ -1811,10 +1805,10 @@ function cl({
|
|
|
1811
1805
|
listStyleType: "disc"
|
|
1812
1806
|
}, ee = {
|
|
1813
1807
|
// Override how paragraphs are rendered
|
|
1814
|
-
p: ({ node: k,
|
|
1815
|
-
code: ({ node: k,
|
|
1816
|
-
pre: ({ node: k,
|
|
1817
|
-
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children:
|
|
1808
|
+
p: ({ node: k, ...$ }) => /* @__PURE__ */ e.jsx("p", { style: _, ...$ }),
|
|
1809
|
+
code: ({ node: k, ...$ }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...$ }),
|
|
1810
|
+
pre: ({ node: k, ...$ }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: P, children: [
|
|
1811
|
+
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: $.children }),
|
|
1818
1812
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1819
1813
|
/* @__PURE__ */ e.jsx(O, { onClick: G, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(pt, {}) }),
|
|
1820
1814
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1831,17 +1825,17 @@ function cl({
|
|
|
1831
1825
|
)
|
|
1832
1826
|
] })
|
|
1833
1827
|
] }),
|
|
1834
|
-
li: ({ node: k,
|
|
1828
|
+
li: ({ node: k, ...$ }) => /* @__PURE__ */ e.jsx("li", { style: K, ...$ })
|
|
1835
1829
|
// You can add more overrides for other elements like h1, h2, etc.
|
|
1836
1830
|
};
|
|
1837
1831
|
function G(k) {
|
|
1838
|
-
const
|
|
1839
|
-
if (
|
|
1840
|
-
const U =
|
|
1832
|
+
const $ = k.currentTarget.closest("pre");
|
|
1833
|
+
if (!$) return;
|
|
1834
|
+
const U = $.textContent || $.innerText;
|
|
1841
1835
|
return navigator.clipboard.writeText(U).then(() => console.log("Text copied to clipboard")).catch((E) => console.error("Error in copying text: ", E)), U;
|
|
1842
1836
|
}
|
|
1843
1837
|
function se() {
|
|
1844
|
-
return p == null ? void 0 : p.map((k,
|
|
1838
|
+
return p == null ? void 0 : p.map((k, $) => k.role === "user" ? /* @__PURE__ */ e.jsxs(
|
|
1845
1839
|
"div",
|
|
1846
1840
|
{
|
|
1847
1841
|
className: "flex items-start rounded-md bg-muted p-3 text-sm",
|
|
@@ -1850,16 +1844,16 @@ function cl({
|
|
|
1850
1844
|
/* @__PURE__ */ e.jsx("div", { children: k.content })
|
|
1851
1845
|
]
|
|
1852
1846
|
},
|
|
1853
|
-
|
|
1847
|
+
$
|
|
1854
1848
|
) : k.role === "ai" ? /* @__PURE__ */ e.jsx(
|
|
1855
1849
|
xt,
|
|
1856
1850
|
{
|
|
1857
1851
|
className: "w-full overflow-auto py-1",
|
|
1858
1852
|
components: ee,
|
|
1859
|
-
children:
|
|
1853
|
+
children: T == null ? void 0 : T.response.replace(/DuckDB/gi, "Semaphor")
|
|
1860
1854
|
},
|
|
1861
|
-
|
|
1862
|
-
) : /* @__PURE__ */ e.jsx("div", {},
|
|
1855
|
+
$
|
|
1856
|
+
) : /* @__PURE__ */ e.jsx("div", {}, $));
|
|
1863
1857
|
}
|
|
1864
1858
|
return /* @__PURE__ */ e.jsxs(Cs, { open: s, onOpenChange: n, children: [
|
|
1865
1859
|
/* @__PURE__ */ e.jsx(Ns, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
@@ -1902,13 +1896,13 @@ function cl({
|
|
|
1902
1896
|
},
|
|
1903
1897
|
placeholder: "Type your question here...",
|
|
1904
1898
|
onFocus: (k) => {
|
|
1905
|
-
const
|
|
1906
|
-
|
|
1899
|
+
const $ = k.target, U = $.value.length;
|
|
1900
|
+
$.setSelectionRange(U, U);
|
|
1907
1901
|
},
|
|
1908
1902
|
className: Y(
|
|
1909
1903
|
"max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
1910
1904
|
),
|
|
1911
|
-
disabled:
|
|
1905
|
+
disabled: A || m,
|
|
1912
1906
|
value: a,
|
|
1913
1907
|
onChange: (k) => t(k.target.value)
|
|
1914
1908
|
}
|
|
@@ -1921,7 +1915,7 @@ function cl({
|
|
|
1921
1915
|
size: "sm",
|
|
1922
1916
|
variant: "ghost",
|
|
1923
1917
|
onClick: S,
|
|
1924
|
-
children: !
|
|
1918
|
+
children: !A && !m ? /* @__PURE__ */ e.jsx(mt, {}) : /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1925
1919
|
}
|
|
1926
1920
|
)
|
|
1927
1921
|
] })
|
|
@@ -1938,7 +1932,7 @@ var qa = {
|
|
|
1938
1932
|
className: void 0,
|
|
1939
1933
|
style: void 0,
|
|
1940
1934
|
attr: void 0
|
|
1941
|
-
},
|
|
1935
|
+
}, Zs = Ne.createContext && /* @__PURE__ */ Ne.createContext(qa), dl = ["attr", "size", "title"];
|
|
1942
1936
|
function ul(s, n) {
|
|
1943
1937
|
if (s == null) return {};
|
|
1944
1938
|
var a = hl(s, n), t, l;
|
|
@@ -1969,7 +1963,7 @@ function ls() {
|
|
|
1969
1963
|
return s;
|
|
1970
1964
|
}, ls.apply(this, arguments);
|
|
1971
1965
|
}
|
|
1972
|
-
function
|
|
1966
|
+
function Xs(s, n) {
|
|
1973
1967
|
var a = Object.keys(s);
|
|
1974
1968
|
if (Object.getOwnPropertySymbols) {
|
|
1975
1969
|
var t = Object.getOwnPropertySymbols(s);
|
|
@@ -1982,9 +1976,9 @@ function Zs(s, n) {
|
|
|
1982
1976
|
function rs(s) {
|
|
1983
1977
|
for (var n = 1; n < arguments.length; n++) {
|
|
1984
1978
|
var a = arguments[n] != null ? arguments[n] : {};
|
|
1985
|
-
n % 2 ?
|
|
1979
|
+
n % 2 ? Xs(Object(a), !0).forEach(function(t) {
|
|
1986
1980
|
ml(s, t, a[t]);
|
|
1987
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) :
|
|
1981
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : Xs(Object(a)).forEach(function(t) {
|
|
1988
1982
|
Object.defineProperty(s, t, Object.getOwnPropertyDescriptor(a, t));
|
|
1989
1983
|
});
|
|
1990
1984
|
}
|
|
@@ -2038,16 +2032,16 @@ function fl(s) {
|
|
|
2038
2032
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2039
2033
|
}), r && /* @__PURE__ */ Ne.createElement("title", null, r), s.children);
|
|
2040
2034
|
};
|
|
2041
|
-
return
|
|
2035
|
+
return Zs !== void 0 ? /* @__PURE__ */ Ne.createElement(Zs.Consumer, null, (a) => n(a)) : n(qa);
|
|
2042
2036
|
}
|
|
2043
2037
|
function gl(s) {
|
|
2044
2038
|
return ge({ tag: "svg", 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: [] }] })(s);
|
|
2045
2039
|
}
|
|
2046
2040
|
function jl({ sql: s }) {
|
|
2047
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2048
|
-
/* @__PURE__ */ e.jsx(
|
|
2041
|
+
return /* @__PURE__ */ e.jsxs(Fs, { children: [
|
|
2042
|
+
/* @__PURE__ */ e.jsx(Ts, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(gt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
|
|
2049
2043
|
/* @__PURE__ */ e.jsx(
|
|
2050
|
-
|
|
2044
|
+
Ls,
|
|
2051
2045
|
{
|
|
2052
2046
|
align: "end",
|
|
2053
2047
|
className: "w-full min-w-fit max-w-[700px] p-3 pt-2",
|
|
@@ -2064,7 +2058,7 @@ function _a(s) {
|
|
|
2064
2058
|
let p = "";
|
|
2065
2059
|
return s === "python" && (p = (g == null ? void 0 : g.python) || fa), s === "sql" && (p = (g == null ? void 0 : g.sql) || ""), p;
|
|
2066
2060
|
}, [s, g]);
|
|
2067
|
-
|
|
2061
|
+
X(() => {
|
|
2068
2062
|
if (r && l.id && l.id !== r) {
|
|
2069
2063
|
if (c.current && o) {
|
|
2070
2064
|
const p = c.current.getModel();
|
|
@@ -2086,7 +2080,7 @@ function _a(s) {
|
|
|
2086
2080
|
x,
|
|
2087
2081
|
s,
|
|
2088
2082
|
h
|
|
2089
|
-
]),
|
|
2083
|
+
]), X(() => {
|
|
2090
2084
|
if (!o) return;
|
|
2091
2085
|
const p = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", N = a === "system" ? p : a;
|
|
2092
2086
|
o.editor.defineTheme("default", {
|
|
@@ -2102,7 +2096,7 @@ function _a(s) {
|
|
|
2102
2096
|
// : getCssVariableValue('--semaphor-background'),
|
|
2103
2097
|
}
|
|
2104
2098
|
}), o.editor.setTheme("default");
|
|
2105
|
-
}, [n, a, o]),
|
|
2099
|
+
}, [n, a, o]), X(() => {
|
|
2106
2100
|
const p = c.current;
|
|
2107
2101
|
p && o && l && p.addCommand(
|
|
2108
2102
|
o.KeyMod.Shift | o.KeyCode.Enter,
|
|
@@ -2113,8 +2107,8 @@ function _a(s) {
|
|
|
2113
2107
|
}, [o, i, l]);
|
|
2114
2108
|
function f(p, N) {
|
|
2115
2109
|
if (c.current = p, !b.current[l.id]) {
|
|
2116
|
-
const y = p.getModel(),
|
|
2117
|
-
b.current[l.id] = y || (N == null ? void 0 : N.editor.createModel(
|
|
2110
|
+
const y = p.getModel(), V = h();
|
|
2111
|
+
b.current[l.id] = y || (N == null ? void 0 : N.editor.createModel(V, s)) || p.getModel();
|
|
2118
2112
|
}
|
|
2119
2113
|
p.setModel(b.current[l.id]);
|
|
2120
2114
|
}
|
|
@@ -2217,34 +2211,34 @@ function Cl() {
|
|
|
2217
2211
|
(w) => w.selectedConnectionId
|
|
2218
2212
|
), y = u(
|
|
2219
2213
|
(w) => w.selectedDatabaseName
|
|
2220
|
-
),
|
|
2214
|
+
), V = u(
|
|
2221
2215
|
(w) => w.selectedDatamodelId
|
|
2222
2216
|
), I = u(
|
|
2223
2217
|
(w) => w.selectedSchemaName
|
|
2224
|
-
), z = u((w) => w.selectedTableName),
|
|
2218
|
+
), z = u((w) => w.selectedTableName), F = u((w) => {
|
|
2225
2219
|
var le;
|
|
2226
2220
|
return (le = w == null ? void 0 : w.card) == null ? void 0 : le.sql;
|
|
2227
|
-
}),
|
|
2228
|
-
setCardCustomCfg:
|
|
2221
|
+
}), T = u((w) => w.applyFilters), {
|
|
2222
|
+
setCardCustomCfg: A,
|
|
2229
2223
|
setQueryResultColumns: m,
|
|
2230
2224
|
setCardSql: v,
|
|
2231
2225
|
setQueryError: j,
|
|
2232
2226
|
setPythonStdOut: D,
|
|
2233
2227
|
setCardPreferences: S,
|
|
2234
2228
|
setCardType: _
|
|
2235
|
-
} = ne(),
|
|
2229
|
+
} = ne(), P = u((w) => w.onSave), K = u((w) => w.onClose), ee = u((w) => w.actions.setSqlGen), G = u((w) => w.runSql), se = u((w) => w.actions.setRunSql), k = u((w) => w.actions.setCardCfg), $ = u(
|
|
2236
2230
|
(w) => w.actions.setIsSqlRunning
|
|
2237
2231
|
), {
|
|
2238
2232
|
data: U,
|
|
2239
2233
|
isLoading: E,
|
|
2240
|
-
isFetching:
|
|
2234
|
+
isFetching: L,
|
|
2241
2235
|
isSuccess: re,
|
|
2242
2236
|
isError: B,
|
|
2243
2237
|
error: ae,
|
|
2244
2238
|
queryKey: te,
|
|
2245
2239
|
refetch: je
|
|
2246
2240
|
} = De(f);
|
|
2247
|
-
|
|
2241
|
+
X(() => {
|
|
2248
2242
|
if (U && (U.rowLimitExceeded && Ge.error("Row limit (10,000) exceeded. Refine your query.", {
|
|
2249
2243
|
position: "top-center",
|
|
2250
2244
|
richColors: !0
|
|
@@ -2252,28 +2246,28 @@ function Cl() {
|
|
|
2252
2246
|
const { dimensionKeys: w } = js(U.records);
|
|
2253
2247
|
m(w);
|
|
2254
2248
|
}
|
|
2255
|
-
}, [U, m, D]),
|
|
2256
|
-
(E ||
|
|
2249
|
+
}, [U, m, D]), X(() => {
|
|
2250
|
+
(E || L) && $(!0), (B || re) && $(!1), B ? (j(ae.message), m([]), D("")) : j("");
|
|
2257
2251
|
}, [
|
|
2258
2252
|
E,
|
|
2259
|
-
|
|
2253
|
+
L,
|
|
2260
2254
|
U,
|
|
2261
2255
|
D,
|
|
2262
2256
|
B,
|
|
2263
2257
|
re,
|
|
2264
|
-
|
|
2258
|
+
$,
|
|
2265
2259
|
m,
|
|
2266
2260
|
j,
|
|
2267
2261
|
ae
|
|
2268
|
-
]),
|
|
2262
|
+
]), X(() => {
|
|
2269
2263
|
G && (a.getQueryData(te) || je(), se(!1));
|
|
2270
2264
|
}, [G, je, se, te, a]);
|
|
2271
|
-
function
|
|
2265
|
+
function Fe() {
|
|
2272
2266
|
const w = a.getQueryData(te);
|
|
2273
2267
|
s.queryData || n({
|
|
2274
2268
|
queryKey: te,
|
|
2275
2269
|
queryData: w
|
|
2276
|
-
}), a.setQueryData(te, null), v(""), ee({}), k(void 0),
|
|
2270
|
+
}), a.setQueryData(te, null), v(""), ee({}), k(void 0), A(""), S({}), _("bar");
|
|
2277
2271
|
}
|
|
2278
2272
|
function we(w, le) {
|
|
2279
2273
|
if (w.length === 0)
|
|
@@ -2295,13 +2289,13 @@ function Cl() {
|
|
|
2295
2289
|
}
|
|
2296
2290
|
return w[0].id;
|
|
2297
2291
|
}
|
|
2298
|
-
function
|
|
2299
|
-
let w =
|
|
2300
|
-
|
|
2292
|
+
function Te() {
|
|
2293
|
+
let w = F;
|
|
2294
|
+
F && !F.includes("{{") && (w = rl(F), v(w));
|
|
2301
2295
|
const le = {
|
|
2302
2296
|
...f,
|
|
2303
2297
|
lastSelectedSchema: I,
|
|
2304
|
-
lastSelectedDatamodelId:
|
|
2298
|
+
lastSelectedDatamodelId: V,
|
|
2305
2299
|
lastSelectedDatabase: y,
|
|
2306
2300
|
lastSelectedTable: z,
|
|
2307
2301
|
connectionId: N,
|
|
@@ -2315,9 +2309,9 @@ function Cl() {
|
|
|
2315
2309
|
cards: ke,
|
|
2316
2310
|
activeCardId: we(ke, h.activeCardId)
|
|
2317
2311
|
};
|
|
2318
|
-
|
|
2312
|
+
P == null || P(oe);
|
|
2319
2313
|
}
|
|
2320
|
-
function
|
|
2314
|
+
function Le() {
|
|
2321
2315
|
const { queryKey: w, queryData: le } = s;
|
|
2322
2316
|
w && le && a.setQueryData(w, le), K == null || K();
|
|
2323
2317
|
}
|
|
@@ -2350,14 +2344,14 @@ function Cl() {
|
|
|
2350
2344
|
className: Y(
|
|
2351
2345
|
"absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
|
|
2352
2346
|
{
|
|
2353
|
-
"font-bold text-red-800":
|
|
2347
|
+
"font-bold text-red-800": T
|
|
2354
2348
|
}
|
|
2355
2349
|
)
|
|
2356
2350
|
}
|
|
2357
2351
|
)
|
|
2358
2352
|
] });
|
|
2359
2353
|
}
|
|
2360
|
-
function
|
|
2354
|
+
function Ve() {
|
|
2361
2355
|
return /* @__PURE__ */ e.jsxs(
|
|
2362
2356
|
ss,
|
|
2363
2357
|
{
|
|
@@ -2421,7 +2415,7 @@ function Cl() {
|
|
|
2421
2415
|
className: "flex grow flex-col justify-end",
|
|
2422
2416
|
children: [
|
|
2423
2417
|
/* @__PURE__ */ e.jsxs("div", { className: "relative flex grow justify-between overflow-y-scroll", children: [
|
|
2424
|
-
|
|
2418
|
+
Ve(),
|
|
2425
2419
|
Ee()
|
|
2426
2420
|
] }),
|
|
2427
2421
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2435,7 +2429,7 @@ function Cl() {
|
|
|
2435
2429
|
O,
|
|
2436
2430
|
{
|
|
2437
2431
|
title: "Shift + Enter",
|
|
2438
|
-
disabled: E ||
|
|
2432
|
+
disabled: E || L,
|
|
2439
2433
|
onClick: () => {
|
|
2440
2434
|
je();
|
|
2441
2435
|
},
|
|
@@ -2443,7 +2437,7 @@ function Cl() {
|
|
|
2443
2437
|
size: "sm",
|
|
2444
2438
|
variant: "outline",
|
|
2445
2439
|
children: [
|
|
2446
|
-
E ||
|
|
2440
|
+
E || L ? /* @__PURE__ */ e.jsx(Ae, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Hn, { className: "mr-2 h-4 w-4" }),
|
|
2447
2441
|
"Run"
|
|
2448
2442
|
]
|
|
2449
2443
|
}
|
|
@@ -2460,7 +2454,7 @@ function Cl() {
|
|
|
2460
2454
|
/* @__PURE__ */ e.jsxs(
|
|
2461
2455
|
O,
|
|
2462
2456
|
{
|
|
2463
|
-
onClick:
|
|
2457
|
+
onClick: Fe,
|
|
2464
2458
|
className: "",
|
|
2465
2459
|
size: "sm",
|
|
2466
2460
|
variant: "outline",
|
|
@@ -2498,7 +2492,7 @@ function Cl() {
|
|
|
2498
2492
|
/* @__PURE__ */ e.jsxs(
|
|
2499
2493
|
O,
|
|
2500
2494
|
{
|
|
2501
|
-
onClick:
|
|
2495
|
+
onClick: Le,
|
|
2502
2496
|
className: "w-full",
|
|
2503
2497
|
size: "sm",
|
|
2504
2498
|
variant: "outline",
|
|
@@ -2511,7 +2505,7 @@ function Cl() {
|
|
|
2511
2505
|
/* @__PURE__ */ e.jsxs(
|
|
2512
2506
|
O,
|
|
2513
2507
|
{
|
|
2514
|
-
onClick:
|
|
2508
|
+
onClick: Te,
|
|
2515
2509
|
size: "sm",
|
|
2516
2510
|
variant: "outline",
|
|
2517
2511
|
children: [
|
|
@@ -2554,7 +2548,7 @@ function Nl({ data: s }) {
|
|
|
2554
2548
|
getCoreRowModel: Mt(),
|
|
2555
2549
|
getPaginationRowModel: It(),
|
|
2556
2550
|
onSortingChange: a,
|
|
2557
|
-
getSortedRowModel:
|
|
2551
|
+
getSortedRowModel: Ft(),
|
|
2558
2552
|
manualPagination: !0,
|
|
2559
2553
|
state: {
|
|
2560
2554
|
sorting: n
|
|
@@ -2584,25 +2578,25 @@ function Nl({ data: s }) {
|
|
|
2584
2578
|
] }) });
|
|
2585
2579
|
}
|
|
2586
2580
|
function Sl({ card: s }) {
|
|
2587
|
-
var y,
|
|
2581
|
+
var y, V, I, z, F, T, A, m, v, j, D;
|
|
2588
2582
|
const [n, a] = q(!1), [t, l] = q(
|
|
2589
2583
|
[]
|
|
2590
|
-
), { authToken: r } = Se(), o =
|
|
2591
|
-
colors: ((
|
|
2584
|
+
), { authToken: r } = Se(), o = Tt(r == null ? void 0 : r.accessToken), i = M((S) => S.themeStyle), d = {
|
|
2585
|
+
colors: ((V = (y = i == null ? void 0 : i.chart) == null ? void 0 : y.dataset) == null ? void 0 : V.backgroundColor) || []
|
|
2592
2586
|
};
|
|
2593
2587
|
(I = s.customCardPreferences) != null && I.inputData;
|
|
2594
|
-
const { getCard: x } = ga(((z = s.customCardPreferences) == null ? void 0 : z.url) || ""), c = ((
|
|
2588
|
+
const { getCard: x } = ga(((z = s.customCardPreferences) == null ? void 0 : z.url) || ""), c = ((F = s.customCardPreferences) == null ? void 0 : F.visualType) || "single", b = u((S) => S.frame);
|
|
2595
2589
|
ne();
|
|
2596
2590
|
const { data: g } = De(s), h = Oa((S, _) => {
|
|
2597
|
-
l((
|
|
2598
|
-
|
|
2591
|
+
l((P) => ({
|
|
2592
|
+
...P,
|
|
2599
2593
|
[S]: _
|
|
2600
2594
|
}));
|
|
2601
2595
|
}, []);
|
|
2602
|
-
if (!((
|
|
2596
|
+
if (!((T = s.customCardPreferences) != null && T.componentName))
|
|
2603
2597
|
return null;
|
|
2604
2598
|
const f = x(
|
|
2605
|
-
(
|
|
2599
|
+
(A = s.customCardPreferences) == null ? void 0 : A.componentName
|
|
2606
2600
|
);
|
|
2607
2601
|
function p(S) {
|
|
2608
2602
|
a(S);
|
|
@@ -2611,8 +2605,8 @@ function Sl({ card: s }) {
|
|
|
2611
2605
|
((m = s.customCardPreferences) == null ? void 0 : m.dataInputCardIds) || {}
|
|
2612
2606
|
).map((S) => {
|
|
2613
2607
|
var K, ee, G;
|
|
2614
|
-
const _ = (ee = (K = s.customCardPreferences) == null ? void 0 : K.dataInputCardIds) == null ? void 0 : ee[S].cardId,
|
|
2615
|
-
return
|
|
2608
|
+
const _ = (ee = (K = s.customCardPreferences) == null ? void 0 : K.dataInputCardIds) == null ? void 0 : ee[S].cardId, P = (G = b == null ? void 0 : b.cards) == null ? void 0 : G.find((se) => se.id === _);
|
|
2609
|
+
return P || null;
|
|
2616
2610
|
});
|
|
2617
2611
|
return /* @__PURE__ */ e.jsx("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs(
|
|
2618
2612
|
Cn,
|
|
@@ -2634,19 +2628,19 @@ function Sl({ card: s }) {
|
|
|
2634
2628
|
((j = s.customCardPreferences) == null ? void 0 : j.dataInputCardIds) || {}
|
|
2635
2629
|
).map((S) => {
|
|
2636
2630
|
var K, ee, G;
|
|
2637
|
-
const _ = (ee = (K = s.customCardPreferences) == null ? void 0 : K.dataInputCardIds) == null ? void 0 : ee[S].cardId,
|
|
2631
|
+
const _ = (ee = (K = s.customCardPreferences) == null ? void 0 : K.dataInputCardIds) == null ? void 0 : ee[S].cardId, P = (G = b == null ? void 0 : b.cards) == null ? void 0 : G.find(
|
|
2638
2632
|
(se) => se.id === _
|
|
2639
2633
|
);
|
|
2640
|
-
if (
|
|
2634
|
+
if (P)
|
|
2641
2635
|
return /* @__PURE__ */ e.jsx(
|
|
2642
|
-
|
|
2636
|
+
Lt,
|
|
2643
2637
|
{
|
|
2644
2638
|
onLoadingStatus: p,
|
|
2645
2639
|
onDataChange: h,
|
|
2646
2640
|
dataInputIndex: S,
|
|
2647
|
-
card:
|
|
2641
|
+
card: P
|
|
2648
2642
|
},
|
|
2649
|
-
|
|
2643
|
+
P.id + S
|
|
2650
2644
|
);
|
|
2651
2645
|
}),
|
|
2652
2646
|
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
|
|
@@ -2711,7 +2705,7 @@ function Ha({
|
|
|
2711
2705
|
);
|
|
2712
2706
|
if (a.type === "table" && (d != null && d.records) && (d == null ? void 0 : d.records.length) > 0)
|
|
2713
2707
|
return /* @__PURE__ */ e.jsxs(fe, { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: [
|
|
2714
|
-
/* @__PURE__ */ e.jsx(
|
|
2708
|
+
/* @__PURE__ */ e.jsx($t, { card: a, data: d == null ? void 0 : d.records }),
|
|
2715
2709
|
/* @__PURE__ */ e.jsx(Ke, { orientation: "horizontal" })
|
|
2716
2710
|
] });
|
|
2717
2711
|
}
|
|
@@ -2722,19 +2716,19 @@ function Ha({
|
|
|
2722
2716
|
className: Y("relative flex h-full flex-col rounded-none", s),
|
|
2723
2717
|
...n,
|
|
2724
2718
|
children: [
|
|
2725
|
-
t && /* @__PURE__ */ e.jsxs(
|
|
2719
|
+
t && /* @__PURE__ */ e.jsxs(Vt, { className: "flex flex-row items-start justify-between py-4", children: [
|
|
2726
2720
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2727
2721
|
/* @__PURE__ */ e.jsx(
|
|
2728
|
-
|
|
2722
|
+
Ze,
|
|
2729
2723
|
{
|
|
2730
2724
|
text: a.title,
|
|
2731
2725
|
onSave: (y) => b({ ...a, title: y }),
|
|
2732
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(
|
|
2726
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(At, { className: "text-base", children: a.title || "Edit title..." }) })
|
|
2733
2727
|
},
|
|
2734
2728
|
a.title
|
|
2735
2729
|
),
|
|
2736
2730
|
/* @__PURE__ */ e.jsx(
|
|
2737
|
-
|
|
2731
|
+
Ze,
|
|
2738
2732
|
{
|
|
2739
2733
|
text: a.description || "",
|
|
2740
2734
|
onSave: (y) => b({ ...a, description: y }),
|
|
@@ -2745,7 +2739,7 @@ function Ha({
|
|
|
2745
2739
|
] }),
|
|
2746
2740
|
i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2747
2741
|
/* @__PURE__ */ e.jsx(
|
|
2748
|
-
|
|
2742
|
+
Ze,
|
|
2749
2743
|
{
|
|
2750
2744
|
className: "my-1",
|
|
2751
2745
|
text: i.title || i.column,
|
|
@@ -2814,12 +2808,12 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
|
|
|
2814
2808
|
onCodeChange: l
|
|
2815
2809
|
}) => /* @__PURE__ */ e.jsxs(va, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
2816
2810
|
/* @__PURE__ */ e.jsxs(Ca, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
2817
|
-
/* @__PURE__ */ e.jsxs(
|
|
2811
|
+
/* @__PURE__ */ e.jsxs(Xe, { value: "custom-config", children: [
|
|
2818
2812
|
a && /* @__PURE__ */ e.jsx(Na, { className: "mr-1 h-5 w-5 text-green-600" }),
|
|
2819
2813
|
a ? "Custom Config" : "Default Config"
|
|
2820
2814
|
] }),
|
|
2821
|
-
/* @__PURE__ */ e.jsx(
|
|
2822
|
-
/* @__PURE__ */ e.jsx(
|
|
2815
|
+
/* @__PURE__ */ e.jsx(Xe, { value: "output", children: "Output" }),
|
|
2816
|
+
/* @__PURE__ */ e.jsx(Xe, { value: "custom-code", children: "Custom Code" })
|
|
2823
2817
|
] }),
|
|
2824
2818
|
/* @__PURE__ */ e.jsx(
|
|
2825
2819
|
es,
|
|
@@ -2880,14 +2874,14 @@ const ea = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
|
|
|
2880
2874
|
] });
|
|
2881
2875
|
function Ol() {
|
|
2882
2876
|
const [s, n] = q(!1), [a, t] = q(""), [l, r] = q(""), [o, i] = q(""), [d, x] = q(""), c = u((z) => z.card), b = u((z) => z.card.customCfg), { data: g } = De(c), { data: h } = Es(c), { setCardCustomCfg: f, setCustomVisualCode: p } = ne(), N = (z) => {
|
|
2883
|
-
var
|
|
2877
|
+
var F, T;
|
|
2884
2878
|
return JSON.stringify(
|
|
2885
2879
|
{
|
|
2886
2880
|
...z,
|
|
2887
2881
|
data: {
|
|
2888
2882
|
...z.data,
|
|
2889
|
-
datasets: (
|
|
2890
|
-
...
|
|
2883
|
+
datasets: (T = (F = z.data) == null ? void 0 : F.datasets) == null ? void 0 : T.map((A) => ({
|
|
2884
|
+
...A,
|
|
2891
2885
|
data: []
|
|
2892
2886
|
}))
|
|
2893
2887
|
}
|
|
@@ -2896,8 +2890,8 @@ function Ol() {
|
|
|
2896
2890
|
2
|
|
2897
2891
|
);
|
|
2898
2892
|
}, y = () => {
|
|
2899
|
-
var
|
|
2900
|
-
if (!((
|
|
2893
|
+
var F, T;
|
|
2894
|
+
if (!((F = g == null ? void 0 : g.records) != null && F.length)) return;
|
|
2901
2895
|
const z = ja({
|
|
2902
2896
|
data: g.records,
|
|
2903
2897
|
cardType: c.type,
|
|
@@ -2905,10 +2899,10 @@ function Ol() {
|
|
|
2905
2899
|
preferences: c.preferences,
|
|
2906
2900
|
topoJson: h
|
|
2907
2901
|
});
|
|
2908
|
-
z && (t(N(z)), i(((
|
|
2902
|
+
z && (t(N(z)), i(((T = c.preferences) == null ? void 0 : T.customVisualCode) || ""), r(
|
|
2909
2903
|
b ? JSON.stringify(b, null, 2) : ""
|
|
2910
2904
|
));
|
|
2911
|
-
},
|
|
2905
|
+
}, V = () => {
|
|
2912
2906
|
try {
|
|
2913
2907
|
if (o && p(o), l) {
|
|
2914
2908
|
const z = JSON.parse(l);
|
|
@@ -2932,7 +2926,7 @@ function Ol() {
|
|
|
2932
2926
|
size: "sm",
|
|
2933
2927
|
variant: "outline",
|
|
2934
2928
|
className: b ? "border-foreground/50 dark:border-foreground/70" : "",
|
|
2935
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2929
|
+
children: /* @__PURE__ */ e.jsx(Pt, { className: "h-4 w-4" })
|
|
2936
2930
|
}
|
|
2937
2931
|
) }),
|
|
2938
2932
|
/* @__PURE__ */ e.jsxs(ws, { className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]", children: [
|
|
@@ -2958,17 +2952,17 @@ function Ol() {
|
|
|
2958
2952
|
onReset: () => {
|
|
2959
2953
|
r(""), f(null);
|
|
2960
2954
|
},
|
|
2961
|
-
onApply:
|
|
2955
|
+
onApply: V,
|
|
2962
2956
|
onClose: () => n(!1)
|
|
2963
2957
|
}
|
|
2964
2958
|
)
|
|
2965
2959
|
] })
|
|
2966
2960
|
] });
|
|
2967
2961
|
}
|
|
2968
|
-
function
|
|
2962
|
+
function $a(s) {
|
|
2969
2963
|
return ge({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
|
|
2970
2964
|
}
|
|
2971
|
-
function
|
|
2965
|
+
function Pa(s) {
|
|
2972
2966
|
return ge({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24a8,8,0,0,0-8,8V88a8,8,0,0,0,8,8,32,32,0,1,1-27.72,16,8,8,0,0,0-2.93-10.93l-48.5-28A8,8,0,0,0,37.92,76,104,104,0,1,0,128,24ZM48.09,91.1,83,111.26A48.09,48.09,0,0,0,80,128c0,1.53.08,3,.22,4.52L41.28,143A88.16,88.16,0,0,1,48.09,91.1Zm-2.67,67.31,39-10.44A48.1,48.1,0,0,0,120,175.32v40.31A88.2,88.2,0,0,1,45.42,158.41ZM136,215.63V175.32a48,48,0,0,0,0-94.65V40.36a88,88,0,0,1,0,175.27Z" }, child: [] }] })(s);
|
|
2973
2967
|
}
|
|
2974
2968
|
function Ba(s) {
|
|
@@ -2991,9 +2985,9 @@ function Ja(s) {
|
|
|
2991
2985
|
}
|
|
2992
2986
|
function Wa(s) {
|
|
2993
2987
|
const [n, a] = q(null);
|
|
2994
|
-
return
|
|
2988
|
+
return X(() => {
|
|
2995
2989
|
s && (async () => {
|
|
2996
|
-
const r = (await import("./lucide-react-
|
|
2990
|
+
const r = (await import("./lucide-react-BQZLQzXT.js"))[s];
|
|
2997
2991
|
a(r);
|
|
2998
2992
|
})();
|
|
2999
2993
|
}, [s]), n;
|
|
@@ -3010,7 +3004,7 @@ function Dl({
|
|
|
3010
3004
|
onChartTypeChange: s
|
|
3011
3005
|
}) {
|
|
3012
3006
|
const [n, a] = q([]), { data: t } = Ya();
|
|
3013
|
-
return
|
|
3007
|
+
return X(() => {
|
|
3014
3008
|
(async () => {
|
|
3015
3009
|
var r;
|
|
3016
3010
|
if (t) {
|
|
@@ -3059,7 +3053,7 @@ function Il() {
|
|
|
3059
3053
|
}
|
|
3060
3054
|
return /* @__PURE__ */ e.jsxs(ds, { open: s, onOpenChange: n, children: [
|
|
3061
3055
|
/* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
|
|
3062
|
-
|
|
3056
|
+
Fl,
|
|
3063
3057
|
{
|
|
3064
3058
|
className: "h-4 w-4",
|
|
3065
3059
|
chartType: t,
|
|
@@ -3131,7 +3125,7 @@ function Il() {
|
|
|
3131
3125
|
{
|
|
3132
3126
|
onClick: () => x("doughnut"),
|
|
3133
3127
|
variant: "ghost",
|
|
3134
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3128
|
+
children: /* @__PURE__ */ e.jsx(Pa, { className: "size-5", strokeWidth: 1 })
|
|
3135
3129
|
}
|
|
3136
3130
|
),
|
|
3137
3131
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3140,7 +3134,7 @@ function Il() {
|
|
|
3140
3134
|
onClick: () => x("radar"),
|
|
3141
3135
|
variant: "ghost",
|
|
3142
3136
|
children: /* @__PURE__ */ e.jsx(
|
|
3143
|
-
|
|
3137
|
+
$a,
|
|
3144
3138
|
{
|
|
3145
3139
|
className: "size-5 font-extralight",
|
|
3146
3140
|
strokeWidth: 0.5
|
|
@@ -3201,7 +3195,7 @@ function Il() {
|
|
|
3201
3195
|
{
|
|
3202
3196
|
onClick: () => x("map"),
|
|
3203
3197
|
variant: "ghost",
|
|
3204
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3198
|
+
children: /* @__PURE__ */ e.jsx(Ta, { className: "size-4" })
|
|
3205
3199
|
}
|
|
3206
3200
|
),
|
|
3207
3201
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3209,7 +3203,7 @@ function Il() {
|
|
|
3209
3203
|
{
|
|
3210
3204
|
onClick: () => x("custom"),
|
|
3211
3205
|
variant: "ghost",
|
|
3212
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3206
|
+
children: /* @__PURE__ */ e.jsx(La, { className: "size-4" })
|
|
3213
3207
|
}
|
|
3214
3208
|
)
|
|
3215
3209
|
] }),
|
|
@@ -3217,7 +3211,7 @@ function Il() {
|
|
|
3217
3211
|
] })
|
|
3218
3212
|
] });
|
|
3219
3213
|
}
|
|
3220
|
-
function
|
|
3214
|
+
function Fl({
|
|
3221
3215
|
chartType: s,
|
|
3222
3216
|
className: n,
|
|
3223
3217
|
customIcon: a,
|
|
@@ -3232,13 +3226,13 @@ function Tl({
|
|
|
3232
3226
|
case "pie":
|
|
3233
3227
|
return /* @__PURE__ */ e.jsx(Ma, { className: n });
|
|
3234
3228
|
case "radar":
|
|
3235
|
-
return /* @__PURE__ */ e.jsx(
|
|
3229
|
+
return /* @__PURE__ */ e.jsx($a, { className: n });
|
|
3236
3230
|
case "scatter":
|
|
3237
3231
|
return /* @__PURE__ */ e.jsx(Ia, { className: n });
|
|
3238
3232
|
case "bubble":
|
|
3239
3233
|
return /* @__PURE__ */ e.jsx(Ua, { className: n });
|
|
3240
3234
|
case "doughnut":
|
|
3241
|
-
return /* @__PURE__ */ e.jsx(
|
|
3235
|
+
return /* @__PURE__ */ e.jsx(Pa, { className: n });
|
|
3242
3236
|
case "stackedBar":
|
|
3243
3237
|
return /* @__PURE__ */ e.jsx(Ka, { className: "size-4 text-foreground/70" });
|
|
3244
3238
|
case "stackedLine":
|
|
@@ -3254,18 +3248,18 @@ function Tl({
|
|
|
3254
3248
|
case "text":
|
|
3255
3249
|
return /* @__PURE__ */ e.jsx(_s, { className: n });
|
|
3256
3250
|
case "map":
|
|
3257
|
-
return /* @__PURE__ */ e.jsx(
|
|
3251
|
+
return /* @__PURE__ */ e.jsx(Ta, { className: n });
|
|
3258
3252
|
case "custom":
|
|
3259
|
-
return a && l ? /* @__PURE__ */ e.jsx(l, { className: n }) : t ? t == null ? void 0 : t.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(
|
|
3253
|
+
return a && l ? /* @__PURE__ */ e.jsx(l, { className: n }) : t ? t == null ? void 0 : t.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(La, { className: n });
|
|
3260
3254
|
default:
|
|
3261
3255
|
return /* @__PURE__ */ e.jsx(Is, { className: n });
|
|
3262
3256
|
}
|
|
3263
3257
|
}
|
|
3264
|
-
function
|
|
3258
|
+
function Tl() {
|
|
3265
3259
|
var n;
|
|
3266
3260
|
const s = u((a) => a.card);
|
|
3267
3261
|
return (n = s.customCardPreferences) == null || n.showCardHeader, ne(), /* @__PURE__ */ e.jsxs(na, { children: [
|
|
3268
|
-
/* @__PURE__ */ e.jsx(la, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
3262
|
+
/* @__PURE__ */ e.jsx(la, { asChild: !0, children: /* @__PURE__ */ e.jsx(Fa, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
|
|
3269
3263
|
/* @__PURE__ */ e.jsx(ra, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ e.jsxs(
|
|
3270
3264
|
Gt,
|
|
3271
3265
|
{
|
|
@@ -3335,7 +3329,7 @@ function sa() {
|
|
|
3335
3329
|
function y(m) {
|
|
3336
3330
|
x(m);
|
|
3337
3331
|
}
|
|
3338
|
-
const
|
|
3332
|
+
const V = (m, v) => {
|
|
3339
3333
|
console.log("handleDragStart", v), m.dataTransfer.setData("tabIndex", v.toString());
|
|
3340
3334
|
}, I = (m) => {
|
|
3341
3335
|
m.preventDefault();
|
|
@@ -3345,7 +3339,7 @@ function sa() {
|
|
|
3345
3339
|
const D = Array.from(s.cards), [S] = D.splice(parseInt(j), 1);
|
|
3346
3340
|
D.splice(v, 0, S), o({ ...s, cards: D });
|
|
3347
3341
|
};
|
|
3348
|
-
function
|
|
3342
|
+
function F(m, v) {
|
|
3349
3343
|
return m.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || m.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
|
|
3350
3344
|
"div",
|
|
3351
3345
|
{
|
|
@@ -3360,7 +3354,7 @@ function sa() {
|
|
|
3360
3354
|
}
|
|
3361
3355
|
);
|
|
3362
3356
|
}
|
|
3363
|
-
function
|
|
3357
|
+
function T() {
|
|
3364
3358
|
return /* @__PURE__ */ e.jsxs(
|
|
3365
3359
|
va,
|
|
3366
3360
|
{
|
|
@@ -3368,26 +3362,26 @@ function sa() {
|
|
|
3368
3362
|
value: s.activeCardId,
|
|
3369
3363
|
className: "flex grow flex-col",
|
|
3370
3364
|
children: [
|
|
3371
|
-
s.cards.map((m) => /* @__PURE__ */ e.jsx(es, { className: "mt-0 grow", value: m.id, children:
|
|
3365
|
+
s.cards.map((m) => /* @__PURE__ */ e.jsx(es, { className: "mt-0 grow", value: m.id, children: A() }, m.id)),
|
|
3372
3366
|
/* @__PURE__ */ e.jsx(Ca, { className: "group mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
3373
3367
|
s.cards.map((m, v) => /* @__PURE__ */ e.jsx(
|
|
3374
|
-
|
|
3368
|
+
Ze,
|
|
3375
3369
|
{
|
|
3376
3370
|
text: m.tabTitle || m.title,
|
|
3377
3371
|
onSave: (j) => {
|
|
3378
3372
|
i({ ...n, tabTitle: j }), d({ ...n, tabTitle: j });
|
|
3379
3373
|
},
|
|
3380
3374
|
children: /* @__PURE__ */ e.jsxs(
|
|
3381
|
-
|
|
3375
|
+
Xe,
|
|
3382
3376
|
{
|
|
3383
3377
|
draggable: !0,
|
|
3384
|
-
onDragStart: (j) =>
|
|
3378
|
+
onDragStart: (j) => V(j, v),
|
|
3385
3379
|
onDragOver: I,
|
|
3386
3380
|
onDrop: (j) => z(j, v),
|
|
3387
3381
|
className: "",
|
|
3388
3382
|
value: m.id,
|
|
3389
3383
|
children: [
|
|
3390
|
-
|
|
3384
|
+
F(s, m),
|
|
3391
3385
|
m.tabTitle || m.title,
|
|
3392
3386
|
s.activeCardId === m.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
|
|
3393
3387
|
Sa,
|
|
@@ -3425,7 +3419,7 @@ function sa() {
|
|
|
3425
3419
|
}
|
|
3426
3420
|
);
|
|
3427
3421
|
}
|
|
3428
|
-
function
|
|
3422
|
+
function A() {
|
|
3429
3423
|
return n.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Qt, { card: n, data: c == null ? void 0 : c.records }) }) }) : n.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(fe, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
|
|
3430
3424
|
Jt,
|
|
3431
3425
|
{
|
|
@@ -3436,16 +3430,16 @@ function sa() {
|
|
|
3436
3430
|
) }) }) }) : /* @__PURE__ */ e.jsx(cs, { FallbackComponent: ya, children: /* @__PURE__ */ e.jsx(Ha, { className: "grow border-none shadow-none" }) });
|
|
3437
3431
|
}
|
|
3438
3432
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
|
|
3439
|
-
(b || g) && /* @__PURE__ */ e.jsx(
|
|
3433
|
+
(b || g) && /* @__PURE__ */ e.jsx(Ae, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
|
|
3440
3434
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
3441
3435
|
a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
3442
3436
|
/* @__PURE__ */ e.jsx(Il, {}),
|
|
3443
3437
|
!["table", "custom"].includes(n.type) && /* @__PURE__ */ e.jsx(Ol, {}),
|
|
3444
|
-
/* @__PURE__ */ e.jsx(
|
|
3438
|
+
/* @__PURE__ */ e.jsx(Tl, {})
|
|
3445
3439
|
] }),
|
|
3446
3440
|
/* @__PURE__ */ e.jsx(El, {})
|
|
3447
3441
|
] }),
|
|
3448
|
-
a ?
|
|
3442
|
+
a ? T() : /* @__PURE__ */ e.jsxs(
|
|
3449
3443
|
ss,
|
|
3450
3444
|
{
|
|
3451
3445
|
className: "px-6",
|
|
@@ -3460,7 +3454,7 @@ function sa() {
|
|
|
3460
3454
|
defaultSize: 30,
|
|
3461
3455
|
minSize: 10,
|
|
3462
3456
|
className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
|
|
3463
|
-
children: r && /* @__PURE__ */ e.jsx(
|
|
3457
|
+
children: r && /* @__PURE__ */ e.jsx(Ll, {})
|
|
3464
3458
|
}
|
|
3465
3459
|
),
|
|
3466
3460
|
/* @__PURE__ */ e.jsx(as, {})
|
|
@@ -3484,7 +3478,7 @@ function sa() {
|
|
|
3484
3478
|
)
|
|
3485
3479
|
] });
|
|
3486
3480
|
}
|
|
3487
|
-
function
|
|
3481
|
+
function Ll() {
|
|
3488
3482
|
const s = u((a) => a.pythonStdOut);
|
|
3489
3483
|
if (!s) return null;
|
|
3490
3484
|
const n = s.replace(/\n/g, "<br>");
|
|
@@ -3513,7 +3507,7 @@ function El() {
|
|
|
3513
3507
|
)
|
|
3514
3508
|
] });
|
|
3515
3509
|
}
|
|
3516
|
-
function
|
|
3510
|
+
function Vl({
|
|
3517
3511
|
options: s,
|
|
3518
3512
|
value: n,
|
|
3519
3513
|
onValueChange: a
|
|
@@ -3549,11 +3543,11 @@ function de({
|
|
|
3549
3543
|
),
|
|
3550
3544
|
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
3551
3545
|
/* @__PURE__ */ e.jsx(pe, { children: s }),
|
|
3552
|
-
n.map((r) => /* @__PURE__ */ e.jsx(
|
|
3546
|
+
n.map((r) => /* @__PURE__ */ e.jsx(Z, { value: r.value, children: r.label }, r.value))
|
|
3553
3547
|
] }) })
|
|
3554
3548
|
] });
|
|
3555
3549
|
}
|
|
3556
|
-
function
|
|
3550
|
+
function Pe({
|
|
3557
3551
|
children: s,
|
|
3558
3552
|
summary: n,
|
|
3559
3553
|
open: a,
|
|
@@ -3567,14 +3561,14 @@ function $e({
|
|
|
3567
3561
|
children: [
|
|
3568
3562
|
/* @__PURE__ */ e.jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4", children: [
|
|
3569
3563
|
/* @__PURE__ */ e.jsx(H, { children: n }),
|
|
3570
|
-
/* @__PURE__ */ e.jsx(
|
|
3564
|
+
/* @__PURE__ */ e.jsx(Zt, { className: "h-4 w-4" })
|
|
3571
3565
|
] }),
|
|
3572
3566
|
/* @__PURE__ */ e.jsx("div", { className: "transition-all ease-in-out", children: s })
|
|
3573
3567
|
]
|
|
3574
3568
|
}
|
|
3575
3569
|
);
|
|
3576
3570
|
}
|
|
3577
|
-
function
|
|
3571
|
+
function Al() {
|
|
3578
3572
|
var p, N;
|
|
3579
3573
|
const s = u(
|
|
3580
3574
|
(y) => y.card.customCardPreferences
|
|
@@ -3583,12 +3577,12 @@ function Vl() {
|
|
|
3583
3577
|
), x = (p = d == null ? void 0 : d.visuals) == null ? void 0 : p.find(
|
|
3584
3578
|
(y) => y.name === (s == null ? void 0 : s.componentName)
|
|
3585
3579
|
);
|
|
3586
|
-
function c(y,
|
|
3580
|
+
function c(y, V) {
|
|
3587
3581
|
if (!s) return;
|
|
3588
3582
|
const z = {
|
|
3589
3583
|
...(s == null ? void 0 : s.dataInputCardIds) || {},
|
|
3590
3584
|
[y]: {
|
|
3591
|
-
cardId:
|
|
3585
|
+
cardId: V,
|
|
3592
3586
|
hookRef: null
|
|
3593
3587
|
}
|
|
3594
3588
|
};
|
|
@@ -3599,74 +3593,74 @@ function Vl() {
|
|
|
3599
3593
|
}
|
|
3600
3594
|
function b(y) {
|
|
3601
3595
|
var I, z;
|
|
3602
|
-
const
|
|
3603
|
-
var
|
|
3604
|
-
return ((
|
|
3605
|
-
}).map((
|
|
3606
|
-
value:
|
|
3607
|
-
label:
|
|
3596
|
+
const V = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((F) => {
|
|
3597
|
+
var T;
|
|
3598
|
+
return ((T = F == null ? void 0 : F.customCardPreferences) == null ? void 0 : T.visualType) !== "multiple";
|
|
3599
|
+
}).map((F) => ({
|
|
3600
|
+
value: F.id,
|
|
3601
|
+
label: F.tabTitle || F.title
|
|
3608
3602
|
}));
|
|
3609
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (z = y == null ? void 0 : y.dataInputs) == null ? void 0 : z.map((
|
|
3610
|
-
var
|
|
3603
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (z = y == null ? void 0 : y.dataInputs) == null ? void 0 : z.map((F, T) => {
|
|
3604
|
+
var A, m;
|
|
3611
3605
|
return /* @__PURE__ */ e.jsxs(
|
|
3612
3606
|
"div",
|
|
3613
3607
|
{
|
|
3614
3608
|
className: "grid grid-cols-10 gap-2",
|
|
3615
3609
|
children: [
|
|
3616
|
-
/* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children:
|
|
3610
|
+
/* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children: F }),
|
|
3617
3611
|
/* @__PURE__ */ e.jsx(
|
|
3618
3612
|
de,
|
|
3619
3613
|
{
|
|
3620
3614
|
className: "col-span-6 h-8 w-full justify-between",
|
|
3621
3615
|
label: "",
|
|
3622
|
-
options:
|
|
3623
|
-
value: ((m = (
|
|
3624
|
-
onValueChange: (v) => c(
|
|
3616
|
+
options: V || [],
|
|
3617
|
+
value: ((m = (A = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : A[T]) == null ? void 0 : m.cardId) || "",
|
|
3618
|
+
onValueChange: (v) => c(T, v)
|
|
3625
3619
|
}
|
|
3626
3620
|
)
|
|
3627
3621
|
]
|
|
3628
3622
|
},
|
|
3629
|
-
|
|
3623
|
+
T + Math.random()
|
|
3630
3624
|
);
|
|
3631
3625
|
}) });
|
|
3632
3626
|
}
|
|
3633
|
-
function g(y,
|
|
3634
|
-
var z,
|
|
3627
|
+
function g(y, V, I = []) {
|
|
3628
|
+
var z, F;
|
|
3635
3629
|
return s ? y === "input" ? /* @__PURE__ */ e.jsx(
|
|
3636
3630
|
ie,
|
|
3637
3631
|
{
|
|
3638
|
-
className: `h-8 w-full ${
|
|
3639
|
-
value: ((z = s == null ? void 0 : s.settings) == null ? void 0 : z[
|
|
3640
|
-
onChange: (
|
|
3632
|
+
className: `h-8 w-full ${$e}`,
|
|
3633
|
+
value: ((z = s == null ? void 0 : s.settings) == null ? void 0 : z[V]) || "",
|
|
3634
|
+
onChange: (T) => {
|
|
3641
3635
|
o({
|
|
3642
3636
|
...s,
|
|
3643
3637
|
settings: {
|
|
3644
3638
|
...s == null ? void 0 : s.settings,
|
|
3645
|
-
[
|
|
3639
|
+
[V]: T.target.value
|
|
3646
3640
|
}
|
|
3647
3641
|
});
|
|
3648
3642
|
}
|
|
3649
3643
|
},
|
|
3650
|
-
|
|
3644
|
+
V
|
|
3651
3645
|
) : y === "select" ? /* @__PURE__ */ e.jsx(
|
|
3652
3646
|
de,
|
|
3653
3647
|
{
|
|
3654
3648
|
className: "h-8 w-full",
|
|
3655
3649
|
label: "",
|
|
3656
3650
|
options: I,
|
|
3657
|
-
value: ((
|
|
3658
|
-
onValueChange: (
|
|
3651
|
+
value: ((F = s == null ? void 0 : s.settings) == null ? void 0 : F[V]) || "",
|
|
3652
|
+
onValueChange: (T) => {
|
|
3659
3653
|
o({
|
|
3660
3654
|
...s,
|
|
3661
|
-
settings: { ...s == null ? void 0 : s.settings, [
|
|
3655
|
+
settings: { ...s == null ? void 0 : s.settings, [V]: T }
|
|
3662
3656
|
});
|
|
3663
3657
|
}
|
|
3664
3658
|
}
|
|
3665
3659
|
) : null : null;
|
|
3666
3660
|
}
|
|
3667
3661
|
function h(y) {
|
|
3668
|
-
const
|
|
3669
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children:
|
|
3662
|
+
const V = Object.entries((y == null ? void 0 : y.settings) || {});
|
|
3663
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: V.map(([I, z]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3670
3664
|
/* @__PURE__ */ e.jsx(H, { children: z.title }),
|
|
3671
3665
|
g(
|
|
3672
3666
|
z.ui,
|
|
@@ -3687,7 +3681,7 @@ function Vl() {
|
|
|
3687
3681
|
{
|
|
3688
3682
|
className: "p-6",
|
|
3689
3683
|
children: [
|
|
3690
|
-
/* @__PURE__ */ e.jsx(
|
|
3684
|
+
/* @__PURE__ */ e.jsx(Pe, { summary: "Plugin Settings", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 text-sm", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 text-sm", children: [
|
|
3691
3685
|
/* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
3692
3686
|
de,
|
|
3693
3687
|
{
|
|
@@ -3705,7 +3699,7 @@ function Vl() {
|
|
|
3705
3699
|
}
|
|
3706
3700
|
) }) }),
|
|
3707
3701
|
((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && /* @__PURE__ */ e.jsx(
|
|
3708
|
-
|
|
3702
|
+
Vl,
|
|
3709
3703
|
{
|
|
3710
3704
|
options: [
|
|
3711
3705
|
{ value: "single", label: "Single Visual" },
|
|
@@ -3740,7 +3734,7 @@ function Vl() {
|
|
|
3740
3734
|
] }) })
|
|
3741
3735
|
] }) }) }),
|
|
3742
3736
|
/* @__PURE__ */ e.jsx(Ce, { className: "my-4" }),
|
|
3743
|
-
((N = t == null ? void 0 : t.customCardPreferences) == null ? void 0 : N.componentName) && /* @__PURE__ */ e.jsxs(
|
|
3737
|
+
((N = t == null ? void 0 : t.customCardPreferences) == null ? void 0 : N.componentName) && /* @__PURE__ */ e.jsxs(Pe, { summary: "Component Settings", children: [
|
|
3744
3738
|
x && x.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
3745
3739
|
/* @__PURE__ */ e.jsx(H, { children: "Input Mapping" }),
|
|
3746
3740
|
/* @__PURE__ */ e.jsx("div", { className: "px-2", children: b(x) })
|
|
@@ -3764,7 +3758,7 @@ function Ie() {
|
|
|
3764
3758
|
var b;
|
|
3765
3759
|
return (b = c.card.preferences) == null ? void 0 : b.filterOnClickColumnIndex;
|
|
3766
3760
|
}
|
|
3767
|
-
),
|
|
3761
|
+
), X(() => {
|
|
3768
3762
|
o && n(new Array(o.length).fill(!1));
|
|
3769
3763
|
}, [o]);
|
|
3770
3764
|
function i(c, b) {
|
|
@@ -3832,7 +3826,7 @@ function Ie() {
|
|
|
3832
3826
|
children: /* @__PURE__ */ e.jsxs("div", { className: "grow", children: [
|
|
3833
3827
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2 py-2", children: [
|
|
3834
3828
|
/* @__PURE__ */ e.jsx(
|
|
3835
|
-
|
|
3829
|
+
Vs,
|
|
3836
3830
|
{
|
|
3837
3831
|
checked: !!((g = a == null ? void 0 : a.onClickFilter) != null && g.find(
|
|
3838
3832
|
(f) => f.columnIndex === b
|
|
@@ -3905,40 +3899,40 @@ function aa(s, n) {
|
|
|
3905
3899
|
const a = wa(s, n);
|
|
3906
3900
|
return ((r = (l = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : l[a]) == null ? void 0 : r.type) || "linear";
|
|
3907
3901
|
}
|
|
3908
|
-
function
|
|
3909
|
-
var ee, G, se, k,
|
|
3902
|
+
function Za() {
|
|
3903
|
+
var ee, G, se, k, $, U;
|
|
3910
3904
|
const [s, n] = q(!1), a = u((E) => {
|
|
3911
|
-
var
|
|
3912
|
-
return (
|
|
3905
|
+
var L;
|
|
3906
|
+
return (L = E.card) == null ? void 0 : L.preferences;
|
|
3913
3907
|
}), t = u((E) => {
|
|
3914
|
-
var
|
|
3915
|
-
return (
|
|
3908
|
+
var L;
|
|
3909
|
+
return (L = E.card) == null ? void 0 : L.cfg;
|
|
3916
3910
|
}), l = wa(a, t), [r, o] = q(
|
|
3917
3911
|
aa(a)
|
|
3918
3912
|
), [i, d] = q(
|
|
3919
3913
|
((se = (G = (ee = a == null ? void 0 : a.chartOptions) == null ? void 0 : ee.scales) == null ? void 0 : G[l]) == null ? void 0 : se.min) || ""
|
|
3920
3914
|
), [x, c] = q(
|
|
3921
|
-
((U = (
|
|
3922
|
-
), [b, g] = q(i || x ? "custom" : "auto"), [h, f] = q(""), [p, N] = q(0), [y,
|
|
3915
|
+
((U = ($ = (k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : $[l]) == null ? void 0 : U.max) || ""
|
|
3916
|
+
), [b, g] = q(i || x ? "custom" : "auto"), [h, f] = q(""), [p, N] = q(0), [y, V] = q(""), [I, z] = q(""), [F, T] = q(""), A = u(
|
|
3923
3917
|
(E) => E.actions.setCardPreferences
|
|
3924
3918
|
), { updateCardInFrame: m } = ne(), v = u((E) => E.card), j = u((E) => {
|
|
3925
|
-
var
|
|
3926
|
-
return (
|
|
3919
|
+
var L;
|
|
3920
|
+
return (L = E.card) == null ? void 0 : L.type;
|
|
3927
3921
|
}), D = ["pie", "doughnut", "polarArea"].includes(j);
|
|
3928
|
-
|
|
3929
|
-
var E,
|
|
3922
|
+
X(() => {
|
|
3923
|
+
var E, L, re, B, ae, te, je, Fe, we, Te, Le, Ee, Ve, w;
|
|
3930
3924
|
o(aa(a)), d(
|
|
3931
|
-
((re = (
|
|
3925
|
+
((re = (L = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : L[l]) == null ? void 0 : re.min) === 0 ? 0 : ""
|
|
3932
3926
|
), c(((te = (ae = (B = a == null ? void 0 : a.chartOptions) == null ? void 0 : B.scales) == null ? void 0 : ae[l]) == null ? void 0 : te.max) || ""), f(
|
|
3933
|
-
((
|
|
3934
|
-
), N(((
|
|
3927
|
+
((Te = (we = (Fe = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : Fe[l]) == null ? void 0 : we.ticks) == null ? void 0 : Te.stepSize) || ""
|
|
3928
|
+
), N(((Le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Le.decimalPlaces) || 0), V(((Ee = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ee.suffix) || ""), z(((Ve = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ve.currency) || ""), T(((w = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : w.locale) || "");
|
|
3935
3929
|
}, [s, a, l]);
|
|
3936
|
-
function S(E,
|
|
3937
|
-
return
|
|
3930
|
+
function S(E, L) {
|
|
3931
|
+
return L === "" || /^[0-9\b]+$/.test(L) ? Number(L) : Number(E);
|
|
3938
3932
|
}
|
|
3939
3933
|
function _() {
|
|
3940
3934
|
const E = [
|
|
3941
|
-
...new Set(ts.map((
|
|
3935
|
+
...new Set(ts.map((L) => L.currency))
|
|
3942
3936
|
];
|
|
3943
3937
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3944
3938
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
|
|
@@ -3961,18 +3955,18 @@ function Xa() {
|
|
|
3961
3955
|
ue,
|
|
3962
3956
|
{
|
|
3963
3957
|
value: I || "none",
|
|
3964
|
-
onValueChange: (
|
|
3958
|
+
onValueChange: (L) => z(L === "none" ? "" : L),
|
|
3965
3959
|
children: [
|
|
3966
3960
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
|
|
3967
3961
|
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
3968
3962
|
/* @__PURE__ */ e.jsx(pe, { children: "Currency" }),
|
|
3969
|
-
/* @__PURE__ */ e.jsx(
|
|
3970
|
-
E.map((
|
|
3963
|
+
/* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }),
|
|
3964
|
+
E.map((L) => /* @__PURE__ */ e.jsx(Z, { value: L, children: L }, L))
|
|
3971
3965
|
] }) })
|
|
3972
3966
|
]
|
|
3973
3967
|
}
|
|
3974
3968
|
),
|
|
3975
|
-
/* @__PURE__ */ e.jsxs(ue, { value:
|
|
3969
|
+
/* @__PURE__ */ e.jsxs(ue, { value: F, onValueChange: (L) => T(L), children: [
|
|
3976
3970
|
/* @__PURE__ */ e.jsx(
|
|
3977
3971
|
he,
|
|
3978
3972
|
{
|
|
@@ -3982,7 +3976,7 @@ function Xa() {
|
|
|
3982
3976
|
),
|
|
3983
3977
|
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
3984
3978
|
/* @__PURE__ */ e.jsx(pe, { children: "Locale" }),
|
|
3985
|
-
ts.map((
|
|
3979
|
+
ts.map((L) => /* @__PURE__ */ e.jsx(Z, { value: L.locale, children: L.locale }, L.locale))
|
|
3986
3980
|
] }) })
|
|
3987
3981
|
] })
|
|
3988
3982
|
] }),
|
|
@@ -3992,7 +3986,7 @@ function Xa() {
|
|
|
3992
3986
|
ie,
|
|
3993
3987
|
{
|
|
3994
3988
|
value: p,
|
|
3995
|
-
onChange: (
|
|
3989
|
+
onChange: (L) => N(Number(L.target.value)),
|
|
3996
3990
|
id: "format",
|
|
3997
3991
|
className: `col-span-6 h-8 w-full tracking-wide ${We}`
|
|
3998
3992
|
}
|
|
@@ -4000,7 +3994,7 @@ function Xa() {
|
|
|
4000
3994
|
] })
|
|
4001
3995
|
] });
|
|
4002
3996
|
}
|
|
4003
|
-
function
|
|
3997
|
+
function P() {
|
|
4004
3998
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
4005
3999
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
4006
4000
|
/* @__PURE__ */ e.jsx(H, { htmlFor: "range", children: "Range" }),
|
|
@@ -4009,7 +4003,7 @@ function Xa() {
|
|
|
4009
4003
|
{
|
|
4010
4004
|
id: "min",
|
|
4011
4005
|
value: i,
|
|
4012
|
-
onChange: (E) => d((
|
|
4006
|
+
onChange: (E) => d((L) => S(L, E.target.value)),
|
|
4013
4007
|
className: `col-span-1 h-8 w-full ${We}`
|
|
4014
4008
|
}
|
|
4015
4009
|
),
|
|
@@ -4017,7 +4011,7 @@ function Xa() {
|
|
|
4017
4011
|
ie,
|
|
4018
4012
|
{
|
|
4019
4013
|
value: x,
|
|
4020
|
-
onChange: (E) => c((
|
|
4014
|
+
onChange: (E) => c((L) => S(L, E.target.value)),
|
|
4021
4015
|
id: "max",
|
|
4022
4016
|
className: `col-span-1 h-8 w-full ${We}`
|
|
4023
4017
|
}
|
|
@@ -4029,7 +4023,7 @@ function Xa() {
|
|
|
4029
4023
|
ie,
|
|
4030
4024
|
{
|
|
4031
4025
|
value: h,
|
|
4032
|
-
onChange: (E) => f((
|
|
4026
|
+
onChange: (E) => f((L) => S(L, E.target.value)),
|
|
4033
4027
|
id: "step-size",
|
|
4034
4028
|
className: `col-span-1 h-8 w-full ${We}`
|
|
4035
4029
|
}
|
|
@@ -4047,7 +4041,7 @@ function Xa() {
|
|
|
4047
4041
|
stepSize: h
|
|
4048
4042
|
}
|
|
4049
4043
|
});
|
|
4050
|
-
const
|
|
4044
|
+
const L = {
|
|
4051
4045
|
...a || {},
|
|
4052
4046
|
chartOptions: {
|
|
4053
4047
|
...a == null ? void 0 : a.chartOptions,
|
|
@@ -4064,18 +4058,18 @@ function Xa() {
|
|
|
4064
4058
|
decimalPlaces: p,
|
|
4065
4059
|
suffix: y,
|
|
4066
4060
|
currency: I,
|
|
4067
|
-
locale:
|
|
4061
|
+
locale: F
|
|
4068
4062
|
}
|
|
4069
4063
|
};
|
|
4070
|
-
console.log(
|
|
4064
|
+
console.log(L), A(L);
|
|
4071
4065
|
const re = {
|
|
4072
4066
|
...v,
|
|
4073
|
-
preferences:
|
|
4067
|
+
preferences: L
|
|
4074
4068
|
};
|
|
4075
4069
|
m(re);
|
|
4076
4070
|
}
|
|
4077
4071
|
return /* @__PURE__ */ e.jsxs(ds, { onOpenChange: (E) => n(E), children: [
|
|
4078
|
-
/* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
4072
|
+
/* @__PURE__ */ e.jsx(us, { asChild: !0, children: /* @__PURE__ */ e.jsx(Xt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
4079
4073
|
/* @__PURE__ */ e.jsx(hs, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
4080
4074
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4081
4075
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
@@ -4094,8 +4088,8 @@ function Xa() {
|
|
|
4094
4088
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
|
|
4095
4089
|
/* @__PURE__ */ e.jsx(xe, { id: "type", children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
4096
4090
|
/* @__PURE__ */ e.jsx(pe, { children: "Option" }),
|
|
4097
|
-
/* @__PURE__ */ e.jsx(
|
|
4098
|
-
/* @__PURE__ */ e.jsx(
|
|
4091
|
+
/* @__PURE__ */ e.jsx(Z, { value: "linear", children: "Linear" }),
|
|
4092
|
+
/* @__PURE__ */ e.jsx(Z, { value: "logarithmic", children: "Logarithmic" })
|
|
4099
4093
|
] }) })
|
|
4100
4094
|
]
|
|
4101
4095
|
}
|
|
@@ -4125,7 +4119,7 @@ function Xa() {
|
|
|
4125
4119
|
}
|
|
4126
4120
|
)
|
|
4127
4121
|
] }),
|
|
4128
|
-
b === "custom" && r == "linear" &&
|
|
4122
|
+
b === "custom" && r == "linear" && P(),
|
|
4129
4123
|
_(),
|
|
4130
4124
|
/* @__PURE__ */ e.jsx(en, {}),
|
|
4131
4125
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
@@ -4206,7 +4200,7 @@ function ql({ idx: s }) {
|
|
|
4206
4200
|
variant: "secondary",
|
|
4207
4201
|
className: "h-7 p-1 text-xs font-normal",
|
|
4208
4202
|
children: /* @__PURE__ */ e.jsx(
|
|
4209
|
-
|
|
4203
|
+
Vn,
|
|
4210
4204
|
{
|
|
4211
4205
|
className: Y("h-4 w-4", {
|
|
4212
4206
|
"rotate-90": l === "y"
|
|
@@ -4240,7 +4234,7 @@ function ql({ idx: s }) {
|
|
|
4240
4234
|
variant: "secondary",
|
|
4241
4235
|
className: "h-7 p-1 text-xs font-normal",
|
|
4242
4236
|
children: /* @__PURE__ */ e.jsx(
|
|
4243
|
-
|
|
4237
|
+
An,
|
|
4244
4238
|
{
|
|
4245
4239
|
className: Y("h-4 w-4", {
|
|
4246
4240
|
"rotate-90": l === "y"
|
|
@@ -4252,7 +4246,7 @@ function ql({ idx: s }) {
|
|
|
4252
4246
|
] }) })
|
|
4253
4247
|
] });
|
|
4254
4248
|
}
|
|
4255
|
-
function
|
|
4249
|
+
function Xa() {
|
|
4256
4250
|
const s = u((x) => x.card), n = u(
|
|
4257
4251
|
(x) => {
|
|
4258
4252
|
var c, b, g;
|
|
@@ -4281,7 +4275,7 @@ function Za() {
|
|
|
4281
4275
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4282
4276
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
|
|
4283
4277
|
/* @__PURE__ */ e.jsx(H, { children: l }),
|
|
4284
|
-
/* @__PURE__ */ e.jsx(
|
|
4278
|
+
/* @__PURE__ */ e.jsx(Za, {})
|
|
4285
4279
|
] }),
|
|
4286
4280
|
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((x, c) => /* @__PURE__ */ e.jsx(Rl, { col: x, idx: c }, x)) })
|
|
4287
4281
|
] })
|
|
@@ -4353,26 +4347,26 @@ function Rl({ col: s, idx: n }) {
|
|
|
4353
4347
|
function et() {
|
|
4354
4348
|
const s = u((g) => g.selectedConnectionId), n = u((g) => g.selectedDatamodelId), a = u((g) => g.selectedDatabaseName), t = u((g) => g.selectedSchemaName), l = u((g) => g.selectedTableName), r = M((g) => g.dashboard.filters) || [], o = M((g) => g.actions.addFilter), i = M((g) => g.actions.removeFilter), { removeFilterValues: d } = is(), { modelItems: x, tableName: c } = qe();
|
|
4355
4349
|
function b(g, h = "dashboard") {
|
|
4356
|
-
var
|
|
4350
|
+
var T;
|
|
4357
4351
|
const f = ce(g.column_name), p = ce(a || ""), N = ce(t || ""), y = ce(c);
|
|
4358
|
-
let
|
|
4352
|
+
let V = xa(
|
|
4359
4353
|
N,
|
|
4360
4354
|
y
|
|
4361
|
-
), I = `${
|
|
4362
|
-
const z = (
|
|
4363
|
-
(
|
|
4364
|
-
)) == null ? void 0 :
|
|
4365
|
-
n && n !== "none" && (I = `${gs}.${z}.${f}`,
|
|
4366
|
-
const
|
|
4367
|
-
(
|
|
4355
|
+
), I = `${V}.${f}`;
|
|
4356
|
+
const z = (T = x == null ? void 0 : x.find(
|
|
4357
|
+
(A) => A.id === n
|
|
4358
|
+
)) == null ? void 0 : T.name;
|
|
4359
|
+
n && n !== "none" && (I = `${gs}.${z}.${f}`, V = `${gs}.${z}`);
|
|
4360
|
+
const F = r == null ? void 0 : r.find(
|
|
4361
|
+
(A) => A.column === I && A.table === y && (A.database === p || A.database === a)
|
|
4368
4362
|
);
|
|
4369
|
-
if (
|
|
4370
|
-
d(
|
|
4363
|
+
if (F)
|
|
4364
|
+
d(F.id), i(F.id);
|
|
4371
4365
|
else {
|
|
4372
|
-
const
|
|
4366
|
+
const A = Ue();
|
|
4373
4367
|
return c === "api" && s ? (o({
|
|
4374
4368
|
location: h,
|
|
4375
|
-
id:
|
|
4369
|
+
id: A,
|
|
4376
4370
|
//uuidv4(),
|
|
4377
4371
|
column: I,
|
|
4378
4372
|
title: g.column_name,
|
|
@@ -4384,12 +4378,12 @@ function et() {
|
|
|
4384
4378
|
operation: "in",
|
|
4385
4379
|
sql: Ws(
|
|
4386
4380
|
g.data_type,
|
|
4387
|
-
|
|
4381
|
+
V,
|
|
4388
4382
|
f
|
|
4389
4383
|
)
|
|
4390
4384
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4391
|
-
}),
|
|
4392
|
-
id:
|
|
4385
|
+
}), A) : (o({
|
|
4386
|
+
id: A,
|
|
4393
4387
|
//uuidv4(),
|
|
4394
4388
|
location: h,
|
|
4395
4389
|
column: I,
|
|
@@ -4402,11 +4396,11 @@ function et() {
|
|
|
4402
4396
|
operation: "in",
|
|
4403
4397
|
sql: Ws(
|
|
4404
4398
|
g.data_type,
|
|
4405
|
-
|
|
4399
|
+
V,
|
|
4406
4400
|
f
|
|
4407
4401
|
)
|
|
4408
4402
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4409
|
-
}),
|
|
4403
|
+
}), A);
|
|
4410
4404
|
}
|
|
4411
4405
|
}
|
|
4412
4406
|
return { assignFilter: b };
|
|
@@ -4483,7 +4477,7 @@ function Hl({
|
|
|
4483
4477
|
}) {
|
|
4484
4478
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Me, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4485
4479
|
/* @__PURE__ */ e.jsxs(Q, { value: "item-1", children: [
|
|
4486
|
-
/* @__PURE__ */ e.jsx(J, { children: `${
|
|
4480
|
+
/* @__PURE__ */ e.jsx(J, { children: `${As(s)} Chart` }),
|
|
4487
4481
|
/* @__PURE__ */ e.jsxs(W, { className: "space-y-4 font-mono text-xs", children: [
|
|
4488
4482
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2,... FROM table" }),
|
|
4489
4483
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
@@ -4511,7 +4505,7 @@ function Hl({
|
|
|
4511
4505
|
/* @__PURE__ */ e.jsx(J, { children: "Settings" }),
|
|
4512
4506
|
/* @__PURE__ */ e.jsxs(W, { className: "space-y-4 px-2", children: [
|
|
4513
4507
|
/* @__PURE__ */ e.jsx(xs, {}),
|
|
4514
|
-
/* @__PURE__ */ e.jsx(
|
|
4508
|
+
/* @__PURE__ */ e.jsx(Xa, {})
|
|
4515
4509
|
] })
|
|
4516
4510
|
] }),
|
|
4517
4511
|
/* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
|
|
@@ -4552,7 +4546,7 @@ function Hs() {
|
|
|
4552
4546
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4553
4547
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
4554
4548
|
/* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
|
|
4555
|
-
!["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(
|
|
4549
|
+
!["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(Za, {})
|
|
4556
4550
|
] }),
|
|
4557
4551
|
/* @__PURE__ */ e.jsxs(
|
|
4558
4552
|
ue,
|
|
@@ -4564,17 +4558,17 @@ function Hs() {
|
|
|
4564
4558
|
/* @__PURE__ */ e.jsx(he, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, { placeholder: "Select position" }) }),
|
|
4565
4559
|
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
4566
4560
|
/* @__PURE__ */ e.jsx(pe, { children: "Data Labels" }),
|
|
4567
|
-
/* @__PURE__ */ e.jsx(
|
|
4568
|
-
a !== "pyramid" && /* @__PURE__ */ e.jsx(
|
|
4569
|
-
/* @__PURE__ */ e.jsx(
|
|
4570
|
-
a !== "pyramid" && /* @__PURE__ */ e.jsx(
|
|
4561
|
+
/* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }),
|
|
4562
|
+
a !== "pyramid" && /* @__PURE__ */ e.jsx(Z, { value: "start", children: "Start" }),
|
|
4563
|
+
/* @__PURE__ */ e.jsx(Z, { value: "center", children: "Center" }),
|
|
4564
|
+
a !== "pyramid" && /* @__PURE__ */ e.jsx(Z, { value: "end", children: "End" })
|
|
4571
4565
|
] }) })
|
|
4572
4566
|
]
|
|
4573
4567
|
}
|
|
4574
4568
|
)
|
|
4575
4569
|
] });
|
|
4576
4570
|
}
|
|
4577
|
-
function
|
|
4571
|
+
function $l({
|
|
4578
4572
|
cardType: s
|
|
4579
4573
|
}) {
|
|
4580
4574
|
function n(a) {
|
|
@@ -4605,7 +4599,7 @@ function Pl({
|
|
|
4605
4599
|
}
|
|
4606
4600
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Me, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4607
4601
|
/* @__PURE__ */ e.jsxs(Q, { value: "item-1", children: [
|
|
4608
|
-
/* @__PURE__ */ e.jsx(J, { children: `${
|
|
4602
|
+
/* @__PURE__ */ e.jsx(J, { children: `${As(s)} Chart` }),
|
|
4609
4603
|
/* @__PURE__ */ e.jsx(W, { className: "space-y-4 font-mono text-xs", children: n(s) })
|
|
4610
4604
|
] }),
|
|
4611
4605
|
/* @__PURE__ */ e.jsxs(Q, { value: "item-2", children: [
|
|
@@ -4621,7 +4615,7 @@ function Pl({
|
|
|
4621
4615
|
] })
|
|
4622
4616
|
] }) });
|
|
4623
4617
|
}
|
|
4624
|
-
const
|
|
4618
|
+
const Pl = {
|
|
4625
4619
|
datasets: [
|
|
4626
4620
|
{
|
|
4627
4621
|
type: "line",
|
|
@@ -4685,7 +4679,7 @@ function Gl(s) {
|
|
|
4685
4679
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
4686
4680
|
" and change the `type` property in the dataset."
|
|
4687
4681
|
] }),
|
|
4688
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
4682
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Pl, null, 2) })
|
|
4689
4683
|
] })
|
|
4690
4684
|
] }),
|
|
4691
4685
|
/* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
|
|
@@ -4799,7 +4793,7 @@ function Kl() {
|
|
|
4799
4793
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
4800
4794
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
4801
4795
|
/* @__PURE__ */ e.jsx(
|
|
4802
|
-
|
|
4796
|
+
Vs,
|
|
4803
4797
|
{
|
|
4804
4798
|
checked: !!((d = s == null ? void 0 : s.formatNumber) != null && d.enabled),
|
|
4805
4799
|
onCheckedChange: (h) => {
|
|
@@ -4837,8 +4831,8 @@ function Kl() {
|
|
|
4837
4831
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
|
|
4838
4832
|
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
4839
4833
|
/* @__PURE__ */ e.jsx(pe, { children: "Format" }),
|
|
4840
|
-
/* @__PURE__ */ e.jsx(
|
|
4841
|
-
ts.map((h) => /* @__PURE__ */ e.jsx(
|
|
4834
|
+
/* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }, "none"),
|
|
4835
|
+
ts.map((h) => /* @__PURE__ */ e.jsx(Z, { value: h.locale, children: h.locale }, h.locale))
|
|
4842
4836
|
] }) })
|
|
4843
4837
|
]
|
|
4844
4838
|
}
|
|
@@ -4863,8 +4857,8 @@ function Kl() {
|
|
|
4863
4857
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
|
|
4864
4858
|
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs(ve, { children: [
|
|
4865
4859
|
/* @__PURE__ */ e.jsx(pe, { children: "Currency" }),
|
|
4866
|
-
/* @__PURE__ */ e.jsx(
|
|
4867
|
-
i.map((h) => /* @__PURE__ */ e.jsx(
|
|
4860
|
+
/* @__PURE__ */ e.jsx(Z, { value: "none", children: "None" }, "none"),
|
|
4861
|
+
i.map((h) => /* @__PURE__ */ e.jsx(Z, { value: h, children: h }, h))
|
|
4868
4862
|
] }) })
|
|
4869
4863
|
]
|
|
4870
4864
|
}
|
|
@@ -4889,7 +4883,7 @@ function Kl() {
|
|
|
4889
4883
|
},
|
|
4890
4884
|
children: [
|
|
4891
4885
|
/* @__PURE__ */ e.jsx(he, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(me, {}) }),
|
|
4892
|
-
/* @__PURE__ */ e.jsx(xe, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(
|
|
4886
|
+
/* @__PURE__ */ e.jsx(xe, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(Z, { value: h, children: h }, h)) })
|
|
4893
4887
|
]
|
|
4894
4888
|
}
|
|
4895
4889
|
)
|
|
@@ -5058,8 +5052,8 @@ const Jl = [
|
|
|
5058
5052
|
label: s,
|
|
5059
5053
|
value: s
|
|
5060
5054
|
}));
|
|
5061
|
-
function
|
|
5062
|
-
var d, x, c, b, g, h, f, p, N, y,
|
|
5055
|
+
function Zl() {
|
|
5056
|
+
var d, x, c, b, g, h, f, p, N, y, V, I, z, F, T, A, m, v;
|
|
5063
5057
|
const s = u((j) => j.card), n = (x = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : x.topoJsonUrl, [a, t] = q(
|
|
5064
5058
|
((b = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : b.customTopoJsonUrl) || ""
|
|
5065
5059
|
), { setCardPreferences: l } = ne(), { data: r } = Es(s), o = Object.keys((r == null ? void 0 : r.objects) || {}).map((j) => ({
|
|
@@ -5080,9 +5074,9 @@ function Xl() {
|
|
|
5080
5074
|
}
|
|
5081
5075
|
];
|
|
5082
5076
|
return /* @__PURE__ */ e.jsxs("div", { className: "p-6", children: [
|
|
5083
|
-
/* @__PURE__ */ e.jsx(
|
|
5077
|
+
/* @__PURE__ */ e.jsx(Pe, { summary: "Map Query", children: /* @__PURE__ */ e.jsx("p", { className: "rounded-md bg-muted p-2 font-mono text-xs", children: "SELECT country, value FROM table" }) }),
|
|
5084
5078
|
/* @__PURE__ */ e.jsx(Ce, { className: "my-4" }),
|
|
5085
|
-
/* @__PURE__ */ e.jsx(
|
|
5079
|
+
/* @__PURE__ */ e.jsx(Pe, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
|
|
5086
5080
|
/* @__PURE__ */ e.jsx(
|
|
5087
5081
|
de,
|
|
5088
5082
|
{
|
|
@@ -5118,7 +5112,7 @@ function Xl() {
|
|
|
5118
5112
|
});
|
|
5119
5113
|
},
|
|
5120
5114
|
value: a,
|
|
5121
|
-
className: `h-9 w-full ${
|
|
5115
|
+
className: `h-9 w-full ${$e}`,
|
|
5122
5116
|
placeholder: "Custom URL"
|
|
5123
5117
|
}
|
|
5124
5118
|
),
|
|
@@ -5192,14 +5186,14 @@ function Xl() {
|
|
|
5192
5186
|
] })
|
|
5193
5187
|
] }) }),
|
|
5194
5188
|
/* @__PURE__ */ e.jsx(Ce, { className: "my-4" }),
|
|
5195
|
-
/* @__PURE__ */ e.jsx(
|
|
5189
|
+
/* @__PURE__ */ e.jsx(Pe, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
5196
5190
|
/* @__PURE__ */ e.jsx(
|
|
5197
5191
|
ie,
|
|
5198
5192
|
{
|
|
5199
|
-
className: `h-9 w-full ${
|
|
5193
|
+
className: `h-9 w-full ${$e}`,
|
|
5200
5194
|
type: "number",
|
|
5201
5195
|
step: 0.1,
|
|
5202
|
-
value: ((I = (
|
|
5196
|
+
value: ((I = (V = s.preferences) == null ? void 0 : V.mapVisualOptions) == null ? void 0 : I.projectionScale) || 1,
|
|
5203
5197
|
onChange: (j) => {
|
|
5204
5198
|
var D;
|
|
5205
5199
|
l({
|
|
@@ -5216,19 +5210,19 @@ function Xl() {
|
|
|
5216
5210
|
/* @__PURE__ */ e.jsx(
|
|
5217
5211
|
ie,
|
|
5218
5212
|
{
|
|
5219
|
-
className: `h-9 w-full ${
|
|
5213
|
+
className: `h-9 w-full ${$e}`,
|
|
5220
5214
|
type: "number",
|
|
5221
5215
|
step: 10,
|
|
5222
|
-
value: ((
|
|
5216
|
+
value: ((T = (F = (z = s.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : F.projectionOffset) == null ? void 0 : T[0]) || 0,
|
|
5223
5217
|
onChange: (j) => {
|
|
5224
|
-
var D, S, _,
|
|
5218
|
+
var D, S, _, P;
|
|
5225
5219
|
l({
|
|
5226
5220
|
...s.preferences,
|
|
5227
5221
|
mapVisualOptions: {
|
|
5228
5222
|
...(D = s.preferences) == null ? void 0 : D.mapVisualOptions,
|
|
5229
5223
|
projectionOffset: [
|
|
5230
5224
|
Number(j.target.value),
|
|
5231
|
-
((
|
|
5225
|
+
((P = (_ = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : _.projectionOffset) == null ? void 0 : P[1]) || 0
|
|
5232
5226
|
]
|
|
5233
5227
|
}
|
|
5234
5228
|
});
|
|
@@ -5239,18 +5233,18 @@ function Xl() {
|
|
|
5239
5233
|
/* @__PURE__ */ e.jsx(
|
|
5240
5234
|
ie,
|
|
5241
5235
|
{
|
|
5242
|
-
className: `h-9 w-full ${
|
|
5236
|
+
className: `h-9 w-full ${$e}`,
|
|
5243
5237
|
type: "number",
|
|
5244
5238
|
step: 10,
|
|
5245
|
-
value: ((v = (m = (
|
|
5239
|
+
value: ((v = (m = (A = s.preferences) == null ? void 0 : A.mapVisualOptions) == null ? void 0 : m.projectionOffset) == null ? void 0 : v[1]) || 0,
|
|
5246
5240
|
onChange: (j) => {
|
|
5247
|
-
var D, S, _,
|
|
5241
|
+
var D, S, _, P;
|
|
5248
5242
|
l({
|
|
5249
5243
|
...s.preferences,
|
|
5250
5244
|
mapVisualOptions: {
|
|
5251
5245
|
...(D = s.preferences) == null ? void 0 : D.mapVisualOptions,
|
|
5252
5246
|
projectionOffset: [
|
|
5253
|
-
((
|
|
5247
|
+
((P = (_ = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : _.projectionOffset) == null ? void 0 : P[0]) || 0,
|
|
5254
5248
|
Number(j.target.value)
|
|
5255
5249
|
]
|
|
5256
5250
|
}
|
|
@@ -5263,7 +5257,7 @@ function Xl() {
|
|
|
5263
5257
|
/* @__PURE__ */ e.jsx(Ie, {})
|
|
5264
5258
|
] });
|
|
5265
5259
|
}
|
|
5266
|
-
function
|
|
5260
|
+
function Xl() {
|
|
5267
5261
|
var t;
|
|
5268
5262
|
const s = u((l) => l.card.preferences), { setCardPreferences: n } = u((l) => l.actions);
|
|
5269
5263
|
function a(l) {
|
|
@@ -5303,7 +5297,7 @@ function Ye({
|
|
|
5303
5297
|
let t = "pie-chart";
|
|
5304
5298
|
return s === "radar" && (t = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Me, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
5305
5299
|
/* @__PURE__ */ e.jsxs(Q, { value: "item-1", children: [
|
|
5306
|
-
/* @__PURE__ */ e.jsx(J, { children: `${
|
|
5300
|
+
/* @__PURE__ */ e.jsx(J, { children: `${As(s)} ${a}` }),
|
|
5307
5301
|
/* @__PURE__ */ e.jsx(W, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5308
5302
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
|
|
5309
5303
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
@@ -5331,7 +5325,7 @@ function Ye({
|
|
|
5331
5325
|
/* @__PURE__ */ e.jsxs(W, { className: "space-y-4 px-2", children: [
|
|
5332
5326
|
s === "range" && /* @__PURE__ */ e.jsx(xs, {}),
|
|
5333
5327
|
s !== "text" && /* @__PURE__ */ e.jsx(Hs, {}),
|
|
5334
|
-
s === "text" && /* @__PURE__ */ e.jsx(
|
|
5328
|
+
s === "text" && /* @__PURE__ */ e.jsx(Xl, {})
|
|
5335
5329
|
] })
|
|
5336
5330
|
] }),
|
|
5337
5331
|
!["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
|
|
@@ -5411,7 +5405,7 @@ function er() {
|
|
|
5411
5405
|
/* @__PURE__ */ e.jsxs(W, { className: "space-y-4 px-2", children: [
|
|
5412
5406
|
/* @__PURE__ */ e.jsx(xs, {}),
|
|
5413
5407
|
a(),
|
|
5414
|
-
/* @__PURE__ */ e.jsx(
|
|
5408
|
+
/* @__PURE__ */ e.jsx(Xa, {})
|
|
5415
5409
|
] })
|
|
5416
5410
|
] }),
|
|
5417
5411
|
/* @__PURE__ */ e.jsxs(Q, { value: "item-3", children: [
|
|
@@ -5444,7 +5438,7 @@ function sr({}) {
|
|
|
5444
5438
|
] })
|
|
5445
5439
|
] }) }),
|
|
5446
5440
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
5447
|
-
/* @__PURE__ */ e.jsx(
|
|
5441
|
+
/* @__PURE__ */ e.jsx(Vs, { onCheckedChange: a, id: "allow-download" }),
|
|
5448
5442
|
/* @__PURE__ */ e.jsx(
|
|
5449
5443
|
"label",
|
|
5450
5444
|
{
|
|
@@ -5528,7 +5522,7 @@ function lr() {
|
|
|
5528
5522
|
return /* @__PURE__ */ e.jsx(Ye, { cardType: a });
|
|
5529
5523
|
case "bubble":
|
|
5530
5524
|
case "scatter":
|
|
5531
|
-
return /* @__PURE__ */ e.jsx(
|
|
5525
|
+
return /* @__PURE__ */ e.jsx($l, { cardType: a });
|
|
5532
5526
|
case "table":
|
|
5533
5527
|
return /* @__PURE__ */ e.jsx(sr, { cardType: a });
|
|
5534
5528
|
case "text":
|
|
@@ -5541,9 +5535,9 @@ function lr() {
|
|
|
5541
5535
|
}
|
|
5542
5536
|
);
|
|
5543
5537
|
case "map":
|
|
5544
|
-
return /* @__PURE__ */ e.jsx(
|
|
5538
|
+
return /* @__PURE__ */ e.jsx(Zl, {});
|
|
5545
5539
|
case "custom":
|
|
5546
|
-
return /* @__PURE__ */ e.jsx(
|
|
5540
|
+
return /* @__PURE__ */ e.jsx(Al, {});
|
|
5547
5541
|
default:
|
|
5548
5542
|
return /* @__PURE__ */ e.jsx(Ul, {});
|
|
5549
5543
|
}
|
|
@@ -5599,9 +5593,9 @@ function rr() {
|
|
|
5599
5593
|
function ir({ authToken: s, onSave: n, onClose: a }) {
|
|
5600
5594
|
M((o) => o.themeStyle);
|
|
5601
5595
|
const t = u((o) => o.actions.setOnSave), l = u((o) => o.actions.setOnClose), r = M((o) => o.actions.setAuthToken);
|
|
5602
|
-
return
|
|
5596
|
+
return X(() => {
|
|
5603
5597
|
n && t(n), a && l(a);
|
|
5604
|
-
}, [n, t, a, l]),
|
|
5598
|
+
}, [n, t, a, l]), X(() => {
|
|
5605
5599
|
s && s.accessToken && r(s);
|
|
5606
5600
|
}, [s, r]), /* @__PURE__ */ e.jsx(cs, { FallbackComponent: za, children: /* @__PURE__ */ e.jsxs(
|
|
5607
5601
|
mn,
|
|
@@ -5613,7 +5607,7 @@ function ir({ authToken: s, onSave: n, onClose: a }) {
|
|
|
5613
5607
|
className: "rounded-none",
|
|
5614
5608
|
role: "editor-panel",
|
|
5615
5609
|
children: [
|
|
5616
|
-
/* @__PURE__ */ e.jsx(xn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(
|
|
5610
|
+
/* @__PURE__ */ e.jsx(xn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Aa, {}) }),
|
|
5617
5611
|
/* @__PURE__ */ e.jsx(pn, { children: /* @__PURE__ */ e.jsx(rr, {}) })
|
|
5618
5612
|
]
|
|
5619
5613
|
}
|
|
@@ -5656,7 +5650,7 @@ function cr() {
|
|
|
5656
5650
|
}
|
|
5657
5651
|
),
|
|
5658
5652
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5659
|
-
/* @__PURE__ */ e.jsx(
|
|
5653
|
+
/* @__PURE__ */ e.jsx(Va, { column: r }),
|
|
5660
5654
|
/* @__PURE__ */ e.jsx("span", { children: r.column_name })
|
|
5661
5655
|
] })
|
|
5662
5656
|
},
|
|
@@ -5683,7 +5677,7 @@ function dr() {
|
|
|
5683
5677
|
)
|
|
5684
5678
|
] }),
|
|
5685
5679
|
/* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
|
|
5686
|
-
|
|
5680
|
+
Aa,
|
|
5687
5681
|
{
|
|
5688
5682
|
ColumnsComponent: () => (
|
|
5689
5683
|
// schemaName, tableName, columns
|
|
@@ -5807,16 +5801,16 @@ export {
|
|
|
5807
5801
|
Nn as B,
|
|
5808
5802
|
wn as C,
|
|
5809
5803
|
gr as D,
|
|
5810
|
-
|
|
5804
|
+
Fa as E,
|
|
5811
5805
|
Wn as F,
|
|
5812
5806
|
In as G,
|
|
5813
|
-
|
|
5807
|
+
Fn as H,
|
|
5814
5808
|
En as K,
|
|
5815
|
-
|
|
5816
|
-
|
|
5809
|
+
Vn as L,
|
|
5810
|
+
Ta as M,
|
|
5817
5811
|
_n as N,
|
|
5818
5812
|
Hn as P,
|
|
5819
|
-
|
|
5813
|
+
Pn as S,
|
|
5820
5814
|
Kn as T,
|
|
5821
5815
|
Jn as U,
|
|
5822
5816
|
Sn as a,
|
|
@@ -5830,14 +5824,14 @@ export {
|
|
|
5830
5824
|
On as i,
|
|
5831
5825
|
Dn as j,
|
|
5832
5826
|
Mn as k,
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5827
|
+
Tn as l,
|
|
5828
|
+
Ln as m,
|
|
5829
|
+
An as n,
|
|
5836
5830
|
qn as o,
|
|
5837
|
-
|
|
5831
|
+
Ae as p,
|
|
5838
5832
|
Rn as q,
|
|
5839
|
-
|
|
5840
|
-
|
|
5833
|
+
$n as r,
|
|
5834
|
+
La as s,
|
|
5841
5835
|
Bn as t,
|
|
5842
5836
|
Un as u,
|
|
5843
5837
|
Gn as v,
|