react-semaphor 0.0.365 → 0.0.367

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.
@@ -1,6 +1,6 @@
1
- import { c as _, w as Cs, x as T, y as Re, z as Ie, A as e, B as Ss, H as ws, J as D, p as Qe, K as ks, M as zs, N as Is, Q as ca, R as H, V as oe, W as da, Y as Os, Z as Ds, _ as Ms, $ as ua, a0 as ma, a1 as tt, a2 as Zs, a3 as Z, a4 as Ue, i as nt, a5 as u, a6 as lt, a7 as rt, P as ha, F as xa, a8 as Ge, a9 as We, aa as pa, ab as it, ac as fa, ad as pe, ae as fe, af as ge, ag as je, ah as we, ai as be, aj as ee, ak as Ts, al as Fs, am as Ls, an as ga, ao as ja, ap as he, aq as ot, ar as ct, as as ba, at as dt, C as ut, au as mt, av as va, aw as ve, ax as ht, ay as Je, az as ts, aA as Me, aB as qe, aC as ke, aD as xt, X as Es, aE as Xs, aF as pt, aG as ft, aH as gt, aI as jt, l as bt, aJ as vt, aK as yt, aL as Fe, aM as ne, aN as ya, aO as Nt, aP as ds, aQ as Ct, aR as St, aS as vs, o as wt, a as kt, aT as ns, aU as Se, aV as ls, aW as zt, aX as It, aY as Ot, aZ as Dt, a_ as bs, a$ as Mt, b0 as Ys, b1 as Tt, b2 as ea, b3 as Ft, b4 as Lt, b5 as Et, b6 as Vt, b7 as Na, b8 as At, b9 as Vs, ba as Ca, bb as qt, bc as Rt, bd as es, be as _t, bf as Ht, bg as Sa, bh as Pt, t as Bt, bi as $t, bj as Ut, s as Gt, bk as us, bl as wa, bm as ka, bn as za, bo as ss, bp as as, bq as Wt, br as Ce, bs as Jt, bt as Kt, bu as ms, bv as hs, bw as xs, bx as Qt, I as Zt, by as Xt, bz as Yt, bA as en, E as sn, bB as ps, bC as Te, f as an, bD as Be, bE as As, bF as Ia, bG as tn, bH as nn, bI as rs, bJ as ln, bK as rn, bL as on, bM as cn, bN as sa, bO as aa, bP as Oa, bQ as dn, bR as un, bS as mn, bT as hn, bU as xn, bV as pn, bW as fn, bX as gn, bY as Le, bZ as J, b_ as K, b$ as qs, c0 as Q, c1 as jn, c2 as Da, c3 as bn, c4 as vn, c5 as yn, c6 as Nn, c7 as Cn, c8 as Sn, c9 as wn, ca as kn, cb as zn } from "./index-DD_Iz12h.js";
1
+ import { c as _, w as Cs, x as k, y as Re, z as Ie, A as e, B as Ss, H as ws, J as T, p as Qe, K as ks, M as zs, N as Is, Q as ca, R as H, V as oe, W as da, Y as Os, Z as Ds, _ as Ts, $ as ua, a0 as ma, a1 as tt, a2 as Zs, a3 as Z, a4 as Ge, i as nt, a5 as u, a6 as lt, a7 as rt, P as ha, F as xa, a8 as Ue, a9 as Je, aa as pa, ab as it, ac as fa, ad as pe, ae as fe, af as ge, ag as je, ah as we, ai as be, aj as ee, ak as Ms, al as Fs, am as Ls, an as ga, ao as ja, ap as he, aq as ot, ar as ct, as as ba, at as dt, C as ut, au as mt, av as va, aw as ve, ax as ht, ay as We, az as ts, aA as Te, aB as qe, aC as ke, aD as xt, X as Es, aE as Xs, aF as pt, aG as ft, aH as gt, aI as jt, l as bt, aJ as vt, aK as yt, aL as Fe, aM as ne, aN as ya, aO as Nt, aP as ds, aQ as Ct, aR as St, aS as vs, o as wt, a as kt, aT as ns, aU as Se, aV as ls, aW as zt, aX as It, aY as Ot, aZ as Dt, a_ as bs, a$ as Tt, b0 as Ys, b1 as Mt, b2 as ea, b3 as Ft, b4 as Lt, b5 as Et, b6 as Vt, b7 as Na, b8 as At, b9 as Vs, ba as Ca, bb as qt, bc as Rt, bd as es, be as _t, bf as Ht, bg as Sa, bh as Pt, t as $t, bi as Bt, bj as Gt, s as Ut, bk as us, bl as wa, bm as ka, bn as za, bo as ss, bp as as, bq as Jt, br as Ce, bs as Wt, bt as Kt, bu as ms, bv as hs, bw as xs, bx as Qt, I as Zt, by as Xt, bz as Yt, bA as en, E as sn, bB as ps, bC as Me, f as an, bD as $e, bE as As, bF as Ia, bG as tn, bH as nn, bI as rs, bJ as ln, bK as rn, bL as on, bM as cn, bN as sa, bO as aa, bP as Oa, bQ as dn, bR as un, bS as mn, bT as hn, bU as xn, bV as pn, bW as fn, bX as gn, bY as Le, bZ as W, b_ as K, b$ as qs, c0 as Q, c1 as jn, c2 as Da, c3 as bn, c4 as vn, c5 as yn, c6 as Nn, c7 as Cn, c8 as Sn, c9 as wn, ca as kn, cb as zn } from "./index-Dn9R0tUI.js";
2
2
  import * as ta from "react";
3
- import ze, { useState as q, useMemo as ys, useEffect as se, useRef as is, useCallback as Ma, Suspense as In } from "react";
3
+ import ze, { useState as q, useMemo as ys, useEffect as se, useRef as is, useCallback as Ta, Suspense as In } from "react";
4
4
  import "react-dom";
5
5
  /**
6
6
  * @license lucide-react v0.453.0 - ISC
@@ -44,7 +44,7 @@ const Dn = _("Braces", [
44
44
  * This source code is licensed under the ISC license.
45
45
  * See the LICENSE file in the root directory of this source tree.
46
46
  */
47
- const Mn = _("ChartArea", [
47
+ const Tn = _("ChartArea", [
48
48
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
49
49
  [
50
50
  "path",
@@ -82,7 +82,7 @@ const _s = _("ChartLine", [
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
84
  */
85
- const Ta = _("ChartNoAxesGantt", [
85
+ const Ma = _("ChartNoAxesGantt", [
86
86
  ["path", { d: "M8 6h10", key: "9lnwnk" }],
87
87
  ["path", { d: "M6 12h9", key: "1g9pqf" }],
88
88
  ["path", { d: "M11 18h7", key: "c8dzvl" }]
@@ -123,7 +123,7 @@ const La = _("ChartScatter", [
123
123
  * This source code is licensed under the ISC license.
124
124
  * See the LICENSE file in the root directory of this source tree.
125
125
  */
126
- const Tn = _("CircleX", [
126
+ const Mn = _("CircleX", [
127
127
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
128
128
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
129
129
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -282,7 +282,7 @@ const Pn = _("ListStart", [
282
282
  * This source code is licensed under the ISC license.
283
283
  * See the LICENSE file in the root directory of this source tree.
284
284
  */
285
- const Bn = _("ListX", [
285
+ const $n = _("ListX", [
286
286
  ["path", { d: "M11 12H3", key: "51ecnj" }],
287
287
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
288
288
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -321,7 +321,7 @@ const Ea = _("Map", [
321
321
  * This source code is licensed under the ISC license.
322
322
  * See the LICENSE file in the root directory of this source tree.
323
323
  */
324
- const $n = _("MessageSquareMore", [
324
+ const Bn = _("MessageSquareMore", [
325
325
  ["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }],
326
326
  ["path", { d: "M8 10h.01", key: "19clt8" }],
327
327
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -333,7 +333,7 @@ const $n = _("MessageSquareMore", [
333
333
  * This source code is licensed under the ISC license.
334
334
  * See the LICENSE file in the root directory of this source tree.
335
335
  */
336
- const Un = _("Network", [
336
+ const Gn = _("Network", [
337
337
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
338
338
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
339
339
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -346,7 +346,7 @@ const Un = _("Network", [
346
346
  * This source code is licensed under the ISC license.
347
347
  * See the LICENSE file in the root directory of this source tree.
348
348
  */
349
- const Gn = _("Plug2", [
349
+ const Un = _("Plug2", [
350
350
  ["path", { d: "M9 2v6", key: "17ngun" }],
351
351
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
352
352
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -359,7 +359,7 @@ const Gn = _("Plug2", [
359
359
  * This source code is licensed under the ISC license.
360
360
  * See the LICENSE file in the root directory of this source tree.
361
361
  */
362
- const Wn = _("Save", [
362
+ const Jn = _("Save", [
363
363
  [
364
364
  "path",
365
365
  {
@@ -393,7 +393,7 @@ const Va = _("Shapes", [
393
393
  * This source code is licensed under the ISC license.
394
394
  * See the LICENSE file in the root directory of this source tree.
395
395
  */
396
- const Jn = _("ShieldQuestion", [
396
+ const Wn = _("ShieldQuestion", [
397
397
  [
398
398
  "path",
399
399
  {
@@ -498,7 +498,7 @@ const Yn = _("ToggleLeft", [
498
498
  * This source code is licensed under the ISC license.
499
499
  * See the LICENSE file in the root directory of this source tree.
500
500
  */
501
- const Bs = _("Type", [
501
+ const $s = _("Type", [
502
502
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
503
503
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
504
504
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
@@ -587,7 +587,7 @@ async function tl(s, n) {
587
587
  }) : null;
588
588
  }
589
589
  function nl() {
590
- const [s, n] = q(""), [a, t] = q(!1), l = T((g) => g.lenses), { setLenses: r, setSelectedLensId: i } = Re(), [o, c] = q(!1), [m, x] = q(!1), j = T((g) => g.dashboard), v = T((g) => g.filterValues), { authToken: d } = Ie();
590
+ const [s, n] = q(""), [a, t] = q(!1), l = k((g) => g.lenses), { setLenses: r, setSelectedLensId: i } = Re(), [o, c] = q(!1), [m, x] = q(!1), j = k((g) => g.dashboard), b = k((g) => g.filterValues), { authToken: d } = Ie();
591
591
  async function f() {
592
592
  c(!0);
593
593
  const g = Aa(
@@ -595,14 +595,14 @@ function nl() {
595
595
  ), N = await al(
596
596
  s,
597
597
  g,
598
- v,
598
+ b,
599
599
  d == null ? void 0 : d.accessToken
600
600
  );
601
601
  N && (r([...l || [], N]), i(N.id), x(!1)), c(!1);
602
602
  }
603
603
  return /* @__PURE__ */ e.jsxs(Ss, { open: m, onOpenChange: x, children: [
604
604
  /* @__PURE__ */ e.jsx(ws, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
605
- D,
605
+ T,
606
606
  {
607
607
  variant: "secondary",
608
608
  className: "h-7 p-2",
@@ -634,7 +634,7 @@ function nl() {
634
634
  ] }) }),
635
635
  a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
636
636
  /* @__PURE__ */ e.jsx(da, { children: /* @__PURE__ */ e.jsx(
637
- D,
637
+ T,
638
638
  {
639
639
  size: "sm",
640
640
  variant: "outline",
@@ -648,14 +648,14 @@ function nl() {
648
648
  ] });
649
649
  }
650
650
  function ll() {
651
- const [s, n] = q(!1), a = T((x) => x.lenses), t = T((x) => x.selectedLensId), { setLenses: l, setSelectedLensId: r } = Re(), { authToken: i } = Ie();
651
+ const [s, n] = q(!1), a = k((x) => x.lenses), t = k((x) => x.selectedLensId), { setLenses: l, setSelectedLensId: r } = Re(), { authToken: i } = Ie();
652
652
  async function o(x) {
653
653
  r(x);
654
654
  }
655
655
  async function c(x) {
656
656
  if (await tl(x, i == null ? void 0 : i.accessToken)) {
657
- const v = a == null ? void 0 : a.filter((d) => d.id !== x);
658
- l(v || []), r("original");
657
+ const b = a == null ? void 0 : a.filter((d) => d.id !== x);
658
+ l(b || []), r("original");
659
659
  }
660
660
  }
661
661
  async function m(x) {
@@ -667,11 +667,11 @@ function ll() {
667
667
  isDefault: !1
668
668
  });
669
669
  l(j || []);
670
- const v = {
670
+ const b = {
671
671
  ...x,
672
672
  isDefault: !x.isDefault
673
673
  };
674
- await Ns(v, i == null ? void 0 : i.accessToken);
674
+ await Ns(b, i == null ? void 0 : i.accessToken);
675
675
  const d = a == null ? void 0 : a.find((f) => f.isDefault);
676
676
  if (d && d.id !== x.id) {
677
677
  const f = {
@@ -682,8 +682,8 @@ function ll() {
682
682
  }
683
683
  }
684
684
  return /* @__PURE__ */ e.jsxs(Os, { open: s, onOpenChange: n, children: [
685
- /* @__PURE__ */ e.jsx(Ds, { asChild: !0, children: /* @__PURE__ */ e.jsx(D, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(An, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
686
- /* @__PURE__ */ e.jsxs(Ms, { align: "end", className: "w-60", children: [
685
+ /* @__PURE__ */ e.jsx(Ds, { asChild: !0, children: /* @__PURE__ */ e.jsx(T, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(An, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
686
+ /* @__PURE__ */ e.jsxs(Ts, { align: "end", className: "w-60", children: [
687
687
  /* @__PURE__ */ e.jsx(ua, { className: "px-3", children: "Lenses" }),
688
688
  /* @__PURE__ */ e.jsx(ma, {}),
689
689
  /* @__PURE__ */ e.jsxs(
@@ -718,7 +718,7 @@ function ll() {
718
718
  }
719
719
  ),
720
720
  /* @__PURE__ */ e.jsx(
721
- Ue,
721
+ Ge,
722
722
  {
723
723
  onClick: (j) => {
724
724
  j.preventDefault(), c(x.id);
@@ -738,31 +738,43 @@ function ll() {
738
738
  ] })
739
739
  ] });
740
740
  }
741
- function rl({
741
+ async function rl() {
742
+ var d;
743
+ const s = k.getState().authToken, n = k.getState().theme, a = k.getState().filterValues, t = (d = k.getState().dashboard) == null ? void 0 : d.title, l = k.getState().isDownloadingPdf, r = k.getState().selectedSheetId;
744
+ if (l)
745
+ return;
746
+ const i = new URLSearchParams();
747
+ i.set("token", (s == null ? void 0 : s.accessToken) || ""), i.set("theme", n || "light"), i.set("filterValues", JSON.stringify(a)), i.set("selectedSheetId", r || "");
748
+ const o = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(i.toString())}`;
749
+ k.setState({ isDownloadingPdf: !0 });
750
+ const x = (await (await fetch(o, {
751
+ method: "GET",
752
+ headers: {
753
+ Authorization: `Bearer ${s == null ? void 0 : s.accessToken}`
754
+ }
755
+ })).json()).url, j = document.createElement("a");
756
+ j.href = x;
757
+ const b = `${t}-${(/* @__PURE__ */ new Date()).toISOString()}.pdf`;
758
+ j.download = b, j.click(), k.setState({ isDownloadingPdf: !1 });
759
+ }
760
+ function il({
742
761
  iconClassName: s
743
762
  }) {
744
- const [n, a] = q(!1), { authToken: t } = Ie(), l = T((o) => o.theme), r = T((o) => o.filterValues);
745
- async function i() {
746
- {
747
- a(!0);
748
- const o = new URLSearchParams();
749
- o.set("token", (t == null ? void 0 : t.accessToken) || ""), o.set("theme", l || "light"), o.set("filterValues", JSON.stringify(r));
750
- const c = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`, x = await (await fetch(c, {
751
- method: "GET",
752
- headers: {
753
- Authorization: `Bearer ${t == null ? void 0 : t.accessToken}`
754
- }
755
- })).blob(), j = URL.createObjectURL(x);
756
- window.open(j, "_blank"), a(!1);
757
- }
763
+ Ie(), k((t) => {
764
+ var l;
765
+ return (l = t.dashboard) == null ? void 0 : l.title;
766
+ }), k((t) => t.theme), k((t) => t.filterValues);
767
+ const n = k((t) => t.isDownloadingPdf);
768
+ async function a() {
769
+ await rl();
758
770
  }
759
771
  return /* @__PURE__ */ e.jsx(
760
- D,
772
+ T,
761
773
  {
762
774
  variant: "link",
763
775
  className: "group h-7 p-2",
764
776
  size: "sm",
765
- onClick: i,
777
+ onClick: a,
766
778
  children: n ? /* @__PURE__ */ e.jsx(Ke, { className: Z("size-3.5 animate-spin", s) }) : /* @__PURE__ */ e.jsx(
767
779
  nt,
768
780
  {
@@ -773,31 +785,31 @@ function rl({
773
785
  }
774
786
  );
775
787
  }
776
- function il() {
788
+ function ol() {
777
789
  const { authToken: s } = Ie();
778
- T((p) => p.theme);
779
- const n = T((p) => p.lenses), a = T((p) => p.selectedLensId), t = n == null ? void 0 : n.find((p) => p.id === a), l = T((p) => p.dashboard);
780
- T((p) => p.selectedSheetId);
781
- const r = T(
790
+ k((p) => p.theme);
791
+ const n = k((p) => p.lenses), a = k((p) => p.selectedLensId), t = n == null ? void 0 : n.find((p) => p.id === a), l = k((p) => p.dashboard);
792
+ k((p) => p.selectedSheetId);
793
+ const r = k(
782
794
  (p) => p.isDashboardEditing
783
795
  ), i = u(
784
796
  (p) => p.selectedConnectionId
785
- ), [o, c] = q(!1), m = T((p) => p.filterValues), x = T((p) => p.isVisualEditing), j = T((p) => p.showFilters);
786
- T(
797
+ ), [o, c] = q(!1), m = k((p) => p.filterValues), x = k((p) => p.isVisualEditing), j = k((p) => p.showFilters);
798
+ k(
787
799
  (p) => p.showDashboardJSON
788
800
  );
789
- const v = T((p) => p.onSaveFunction), d = T(
801
+ const b = k((p) => p.onSaveFunction), d = k(
790
802
  (p) => p.actions.setShowFilters
791
- ), { addFrame: f, setSelectedFrameId: g } = T(
803
+ ), { addFrame: f, setSelectedFrameId: g } = k(
792
804
  (p) => p.actions
793
- ), { getSelectedSheet: N, setIsDashboardEditing: b, setShowDashboardJSON: V } = T((p) => p.actions), F = N(), { tenantId: S, endUserId: w } = ys(
805
+ ), { getSelectedSheet: N, setIsDashboardEditing: v, setShowDashboardJSON: V } = k((p) => p.actions), F = N(), { tenantId: S, endUserId: w } = ys(
794
806
  () => lt(s == null ? void 0 : s.accessToken),
795
807
  [s == null ? void 0 : s.accessToken]
796
- ), O = ys(() => S || w, [S, w]), R = () => {
808
+ ), D = ys(() => S || w, [S, w]), R = () => {
797
809
  if (!r || !F) return;
798
810
  const p = {
799
811
  connectionId: i,
800
- id: Ge(),
812
+ id: Ue(),
801
813
  title: "Title",
802
814
  description: "Description",
803
815
  preferences: {
@@ -811,25 +823,25 @@ function il() {
811
823
  type: "bar",
812
824
  sql: "select COUNT(*) from YOUR_TABLE",
813
825
  data: []
814
- }, z = {
815
- id: Ge(),
826
+ }, I = {
827
+ id: Ue(),
816
828
  cards: [p],
817
829
  activeCardId: p.id
818
830
  };
819
- f(F.id, z), g(z.id);
831
+ f(F.id, I), g(I.id);
820
832
  }, C = () => {
821
- b(!0);
833
+ v(!0);
822
834
  };
823
835
  async function h() {
824
836
  if (c(!0), !a || !t) return;
825
837
  const p = Aa(
826
838
  l
827
- ), z = JSON.stringify(p), I = {
839
+ ), I = JSON.stringify(p), O = {
828
840
  ...t,
829
- template: z,
841
+ template: I,
830
842
  filterValues: m
831
843
  };
832
- await Ns(I, s == null ? void 0 : s.accessToken), We.success("Lens saved"), v == null || v(p), c(!1);
844
+ await Ns(O, s == null ? void 0 : s.accessToken), Je.success("Lens saved"), b == null || b(p), c(!1);
833
845
  }
834
846
  return x ? null : /* @__PURE__ */ e.jsxs(
835
847
  "div",
@@ -840,11 +852,11 @@ function il() {
840
852
  !x && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(H, { children: t == null ? void 0 : t.name }) }),
841
853
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
842
854
  /* @__PURE__ */ e.jsx("button", { onClick: rt, children: /* @__PURE__ */ e.jsx(Xn, { className: "h-4 w-4", strokeWidth: 1.5 }) }),
843
- /* @__PURE__ */ e.jsx(rl, {}),
844
- r && !x && O && /* @__PURE__ */ e.jsx(nl, {}),
845
- !x && O && /* @__PURE__ */ e.jsx(ll, {}),
855
+ /* @__PURE__ */ e.jsx(il, {}),
856
+ r && !x && D && /* @__PURE__ */ e.jsx(nl, {}),
857
+ !x && D && /* @__PURE__ */ e.jsx(ll, {}),
846
858
  r && !x && /* @__PURE__ */ e.jsxs(
847
- D,
859
+ T,
848
860
  {
849
861
  variant: "secondary",
850
862
  className: "h-7 p-2",
@@ -858,7 +870,7 @@ function il() {
858
870
  }
859
871
  ),
860
872
  !r && /* @__PURE__ */ e.jsx(
861
- D,
873
+ T,
862
874
  {
863
875
  variant: "ghost",
864
876
  className: "h-7 p-2",
@@ -868,31 +880,31 @@ function il() {
868
880
  }
869
881
  ),
870
882
  r && !x && /* @__PURE__ */ e.jsx(
871
- D,
883
+ T,
872
884
  {
873
885
  variant: "ghost",
874
886
  role: "close",
875
887
  className: "h-7 p-2",
876
888
  onClick: () => {
877
- b(!1), V(!1);
889
+ v(!1), V(!1);
878
890
  },
879
891
  size: "sm",
880
- children: /* @__PURE__ */ e.jsx(Ue, { className: "h-4 w-4", strokeWidth: 1.5 })
892
+ children: /* @__PURE__ */ e.jsx(Ge, { className: "h-4 w-4", strokeWidth: 1.5 })
881
893
  }
882
894
  ),
883
- r && !x && O && /* @__PURE__ */ e.jsx(
884
- D,
895
+ r && !x && D && /* @__PURE__ */ e.jsx(
896
+ T,
885
897
  {
886
898
  className: "h-7 p-2",
887
899
  variant: "ghost",
888
900
  disabled: o,
889
901
  onClick: h,
890
902
  size: "sm",
891
- children: /* @__PURE__ */ e.jsx(Wn, { className: "h-4 w-4", strokeWidth: 1.5 })
903
+ children: /* @__PURE__ */ e.jsx(Jn, { className: "h-4 w-4", strokeWidth: 1.5 })
892
904
  }
893
905
  ),
894
906
  !j && !x && r && /* @__PURE__ */ e.jsx(
895
- D,
907
+ T,
896
908
  {
897
909
  className: "h-7 p-2",
898
910
  variant: "ghost",
@@ -922,13 +934,13 @@ function Pe({
922
934
  disabled: x = !1
923
935
  }) {
924
936
  const j = t ? "Loading..." : l ? "Error" : a;
925
- function v() {
937
+ function b() {
926
938
  if (s === "Connection")
927
- return /* @__PURE__ */ e.jsx(Gn, { className: "size-4 rotate-90" });
939
+ return /* @__PURE__ */ e.jsx(Un, { className: "size-4 rotate-90" });
928
940
  if (s === "Database")
929
941
  return /* @__PURE__ */ e.jsx(Ln, { className: "size-4" });
930
942
  if (s === "Schema")
931
- return /* @__PURE__ */ e.jsx(Un, { className: "size-4" });
943
+ return /* @__PURE__ */ e.jsx(Gn, { className: "size-4" });
932
944
  if (s === "Table")
933
945
  return /* @__PURE__ */ e.jsx(Ps, { className: "size-4" });
934
946
  if (s === "Model")
@@ -936,9 +948,9 @@ function Pe({
936
948
  }
937
949
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
938
950
  m && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: r ? /* @__PURE__ */ e.jsxs(pa, { children: [
939
- /* @__PURE__ */ e.jsx(it, { children: v() }),
951
+ /* @__PURE__ */ e.jsx(it, { children: b() }),
940
952
  /* @__PURE__ */ e.jsx(fa, { className: "text-xs", align: "start", children: r })
941
- ] }) : v() }),
953
+ ] }) : b() }),
942
954
  /* @__PURE__ */ e.jsxs(pe, { disabled: x, value: j, onValueChange: i, children: [
943
955
  /* @__PURE__ */ e.jsx(
944
956
  fe,
@@ -966,15 +978,15 @@ function Pe({
966
978
  ] })
967
979
  ] });
968
980
  }
969
- function ol({ column: s }) {
981
+ function cl({ column: s }) {
970
982
  const [n, a] = q(!1), t = u((f) => f.selectedTableName), l = u(
971
983
  (f) => f.selectedSchemaName
972
984
  ), r = u(
973
985
  (f) => f.selectedDatamodelId
974
986
  ), i = u((f) => f.sqlGen), { modelItems: o, connectionType: c } = Ee(), m = u((f) => f.actions.setSqlGen), x = u((f) => f.actions.setCardSql), j = u((f) => f.actions.setRunSql);
975
- function v(f, g) {
987
+ function b(f, g) {
976
988
  var F;
977
- const N = ga(f, i, g), b = (F = o == null ? void 0 : o.find(
989
+ const N = ga(f, i, g), v = (F = o == null ? void 0 : o.find(
978
990
  (S) => S.id === r
979
991
  )) == null ? void 0 : F.name;
980
992
  m(N);
@@ -982,7 +994,7 @@ function ol({ column: s }) {
982
994
  N,
983
995
  he(l || ""),
984
996
  he(t),
985
- b,
997
+ v,
986
998
  c
987
999
  );
988
1000
  V && (x(V), j(!0)), a(!1);
@@ -992,7 +1004,7 @@ function ol({ column: s }) {
992
1004
  /* @__PURE__ */ e.jsx(
993
1005
  "li",
994
1006
  {
995
- onClick: () => v(s, "COUNT"),
1007
+ onClick: () => b(s, "COUNT"),
996
1008
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
997
1009
  children: "Count"
998
1010
  }
@@ -1000,7 +1012,7 @@ function ol({ column: s }) {
1000
1012
  /* @__PURE__ */ e.jsx(
1001
1013
  "li",
1002
1014
  {
1003
- onClick: () => v(s, "AVG"),
1015
+ onClick: () => b(s, "AVG"),
1004
1016
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1005
1017
  children: "Avg"
1006
1018
  }
@@ -1008,7 +1020,7 @@ function ol({ column: s }) {
1008
1020
  /* @__PURE__ */ e.jsx(
1009
1021
  "li",
1010
1022
  {
1011
- onClick: () => v(s, "SUM"),
1023
+ onClick: () => b(s, "SUM"),
1012
1024
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1013
1025
  children: "Sum"
1014
1026
  }
@@ -1016,7 +1028,7 @@ function ol({ column: s }) {
1016
1028
  /* @__PURE__ */ e.jsx(
1017
1029
  "li",
1018
1030
  {
1019
- onClick: () => v(s, "MAX"),
1031
+ onClick: () => b(s, "MAX"),
1020
1032
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1021
1033
  children: "Max"
1022
1034
  }
@@ -1024,14 +1036,14 @@ function ol({ column: s }) {
1024
1036
  /* @__PURE__ */ e.jsx(
1025
1037
  "li",
1026
1038
  {
1027
- onClick: () => v(s, "MIN"),
1039
+ onClick: () => b(s, "MIN"),
1028
1040
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
1029
1041
  children: "Min"
1030
1042
  }
1031
1043
  )
1032
1044
  ] });
1033
1045
  }
1034
- return /* @__PURE__ */ e.jsxs(Ts, { openDelay: 0, open: n, onOpenChange: a, children: [
1046
+ return /* @__PURE__ */ e.jsxs(Ms, { openDelay: 0, open: n, onOpenChange: a, children: [
1035
1047
  /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(Hs, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
1036
1048
  /* @__PURE__ */ e.jsx(
1037
1049
  Ls,
@@ -1045,11 +1057,11 @@ function ol({ column: s }) {
1045
1057
  }
1046
1058
  function qa({ column: s }) {
1047
1059
  return /* @__PURE__ */ e.jsxs(pa, { children: [
1048
- /* @__PURE__ */ e.jsx(ot, { asChild: !0, children: ct(s.data_type) ? /* @__PURE__ */ e.jsx(Bs, { className: "size-3" }) : ba(s.data_type) ? /* @__PURE__ */ e.jsx(Rn, { className: "size-3" }) : dt(s.data_type) ? /* @__PURE__ */ e.jsx(ut, { className: "size-3" }) : mt(s.data_type) ? /* @__PURE__ */ e.jsx(Yn, { className: "size-3" }) : s.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e.jsx(Dn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Jn, { className: "size-3" }) }),
1060
+ /* @__PURE__ */ e.jsx(ot, { asChild: !0, children: ct(s.data_type) ? /* @__PURE__ */ e.jsx($s, { className: "size-3" }) : ba(s.data_type) ? /* @__PURE__ */ e.jsx(Rn, { className: "size-3" }) : dt(s.data_type) ? /* @__PURE__ */ e.jsx(ut, { className: "size-3" }) : mt(s.data_type) ? /* @__PURE__ */ e.jsx(Yn, { className: "size-3" }) : s.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e.jsx(Dn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Wn, { className: "size-3" }) }),
1049
1061
  /* @__PURE__ */ e.jsx(fa, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
1050
1062
  ] });
1051
1063
  }
1052
- function cl({
1064
+ function dl({
1053
1065
  schemaName: s,
1054
1066
  tableName: n,
1055
1067
  columns: a,
@@ -1063,51 +1075,51 @@ function cl({
1063
1075
  (h) => h.selectedSchemaName
1064
1076
  ), c = u((h) => h.selectedTableName), m = u(
1065
1077
  (h) => h.selectedDatamodelId
1066
- ), x = T(
1078
+ ), x = k(
1067
1079
  (h) => h.dashboard.aiScopeTables
1068
- ), { addToAIScope: j, removeFromAIScope: v } = Re();
1069
- T((h) => h.actions);
1080
+ ), { addToAIScope: j, removeFromAIScope: b } = Re();
1081
+ k((h) => h.actions);
1070
1082
  const d = u((h) => h.actions.setRunSql), f = u((h) => h.actions.setSqlGen), g = u(
1071
1083
  (h) => h.actions.setIsShowingVisual
1072
- ), N = u((h) => h.actions.setCardSql), { connectionType: b, modelItems: V, selectedDatamodelName: F } = Ee();
1084
+ ), N = u((h) => h.actions.setCardSql), { connectionType: v, modelItems: V, selectedDatamodelName: F } = Ee();
1073
1085
  function S(h) {
1074
1086
  var A;
1075
1087
  const p = ga(h, l);
1076
1088
  f(p);
1077
- const z = (A = V == null ? void 0 : V.find(
1078
- (B) => B.id === m
1079
- )) == null ? void 0 : A.name, I = ja(
1089
+ const I = (A = V == null ? void 0 : V.find(
1090
+ ($) => $.id === m
1091
+ )) == null ? void 0 : A.name, O = ja(
1080
1092
  p,
1081
1093
  he(s),
1082
1094
  he(n),
1083
- z,
1084
- b
1095
+ I,
1096
+ v
1085
1097
  );
1086
- I && (N(I), d(!0));
1098
+ O && (N(O), d(!0));
1087
1099
  }
1088
1100
  function w() {
1089
1101
  return (x == null ? void 0 : x.find(
1090
1102
  (h) => h.connectionId === r && (h.tableName === c || h.datamodelName === F)
1091
1103
  )) !== void 0;
1092
1104
  }
1093
- function O(h) {
1105
+ function D(h) {
1094
1106
  h === !0 && (c || F) && r ? (j({
1095
1107
  connectionId: r,
1096
- connectionType: b,
1108
+ connectionType: v,
1097
1109
  databaseName: i,
1098
1110
  schemaName: o,
1099
1111
  tableName: c,
1100
1112
  datamodelName: F
1101
- }), We.success("Added to Assistant Scope", {
1113
+ }), Je.success("Added to Assistant Scope", {
1102
1114
  position: "top-right",
1103
1115
  duration: 2500,
1104
1116
  richColors: !0
1105
- })) : (v({
1117
+ })) : (b({
1106
1118
  connectionId: r || "",
1107
- connectionType: b || "",
1119
+ connectionType: v || "",
1108
1120
  tableName: c || "",
1109
1121
  datamodelName: F || ""
1110
- }), We("Removed from Assistant Scope", {
1122
+ }), Je("Removed from Assistant Scope", {
1111
1123
  position: "top-right",
1112
1124
  duration: 2e3,
1113
1125
  richColors: !0
@@ -1118,10 +1130,10 @@ function cl({
1118
1130
  schemaName: s,
1119
1131
  tableName: n,
1120
1132
  modelName: F,
1121
- connectionType: b
1133
+ connectionType: v
1122
1134
  });
1123
1135
  g(!1);
1124
- const p = b === "MSSQL" ? `SELECT top 10 * FROM ${h}` : `SELECT * FROM ${h} LIMIT 10`;
1136
+ const p = v === "MSSQL" ? `SELECT top 10 * FROM ${h}` : `SELECT * FROM ${h} LIMIT 10`;
1125
1137
  N(p), d(!0);
1126
1138
  }
1127
1139
  function C() {
@@ -1129,7 +1141,7 @@ function cl({
1129
1141
  schemaName: s,
1130
1142
  tableName: n,
1131
1143
  modelName: F,
1132
- connectionType: b
1144
+ connectionType: v
1133
1145
  });
1134
1146
  N(`SELECT COUNT(*) as count FROM ${h}`), d(!0);
1135
1147
  }
@@ -1140,7 +1152,7 @@ function cl({
1140
1152
  {
1141
1153
  title: `${w() ? "Remove from" : "Add to"} Assistant Scope`,
1142
1154
  pressed: w(),
1143
- onPressedChange: O,
1155
+ onPressedChange: D,
1144
1156
  variant: "outline",
1145
1157
  className: Z("h-9 px-2", {
1146
1158
  // 'outline outline-1 outline-green-400': isInAIScopeTable(),
@@ -1160,7 +1172,7 @@ function cl({
1160
1172
  }
1161
1173
  ),
1162
1174
  /* @__PURE__ */ e.jsxs(
1163
- D,
1175
+ T,
1164
1176
  {
1165
1177
  disabled: t !== "Success",
1166
1178
  onClick: R,
@@ -1174,7 +1186,7 @@ function cl({
1174
1186
  }
1175
1187
  ),
1176
1188
  /* @__PURE__ */ e.jsxs(
1177
- D,
1189
+ T,
1178
1190
  {
1179
1191
  disabled: t !== "Success",
1180
1192
  onClick: C,
@@ -1213,22 +1225,22 @@ function cl({
1213
1225
  {
1214
1226
  onClick: (p) => p.stopPropagation(),
1215
1227
  className: "flex items-center justify-end",
1216
- children: ba(h.data_type) && /* @__PURE__ */ e.jsx(ol, { column: h })
1228
+ children: ba(h.data_type) && /* @__PURE__ */ e.jsx(cl, { column: h })
1217
1229
  }
1218
1230
  )
1219
1231
  ]
1220
1232
  },
1221
1233
  h.column_name
1222
1234
  )) }),
1223
- /* @__PURE__ */ e.jsx(Je, { orientation: "vertical" }),
1224
- /* @__PURE__ */ e.jsx(Je, { orientation: "horizontal" })
1235
+ /* @__PURE__ */ e.jsx(We, { orientation: "vertical" }),
1236
+ /* @__PURE__ */ e.jsx(We, { orientation: "horizontal" })
1225
1237
  ]
1226
1238
  }
1227
1239
  )
1228
1240
  ] });
1229
1241
  }
1230
1242
  function Ee(s, n) {
1231
- var Us, Gs, Ws, Js, Ks, Qs;
1243
+ var Gs, Us, Js, Ws, Ks, Qs;
1232
1244
  let a = ys(() => [], []);
1233
1245
  const t = Ie().authToken || s, l = u(
1234
1246
  (y) => y.selectedConnectionId
@@ -1244,7 +1256,7 @@ function Ee(s, n) {
1244
1256
  (y) => y.actions.setSelectedConnectionId
1245
1257
  ), j = u(
1246
1258
  (y) => y.actions.setSelectedDatamodelId
1247
- ), v = u(
1259
+ ), b = u(
1248
1260
  (y) => y.actions.setSelectedDatabaseName
1249
1261
  ), d = u(
1250
1262
  (y) => y.actions.setSelectedSchemaName
@@ -1254,7 +1266,7 @@ function Ee(s, n) {
1254
1266
  function N(y) {
1255
1267
  return l && i && o && i !== "NA" ? !0 : l && y === "API" ? !1 : !!(l && y === "S3");
1256
1268
  }
1257
- function b(y) {
1269
+ function v(y) {
1258
1270
  return !!(l && i && i !== "NA" && o && c || l && (y === "S3" || y === "API") || r && r);
1259
1271
  }
1260
1272
  function V(y) {
@@ -1264,7 +1276,7 @@ function Ee(s, n) {
1264
1276
  data: F,
1265
1277
  isLoading: S,
1266
1278
  isError: w
1267
- } = Me({
1279
+ } = Te({
1268
1280
  queryKey: ["connections"],
1269
1281
  queryFn: () => qe(
1270
1282
  "https://semaphor.cloud/api/v1/connections",
@@ -1273,10 +1285,10 @@ function Ee(s, n) {
1273
1285
  enabled: !!(t != null && t.accessToken)
1274
1286
  // Only fetch if authToken is present
1275
1287
  }), {
1276
- data: O,
1288
+ data: D,
1277
1289
  isLoading: R,
1278
1290
  isError: C
1279
- } = Me({
1291
+ } = Te({
1280
1292
  queryKey: ["models", l],
1281
1293
  queryFn: () => qe(
1282
1294
  "https://semaphor.cloud/api/v1/datamodels",
@@ -1289,13 +1301,13 @@ function Ee(s, n) {
1289
1301
  // Only fetch if authToken is present
1290
1302
  }), h = F == null ? void 0 : F.connections.find(
1291
1303
  (y) => y.id === l
1292
- ), p = h == null ? void 0 : h.type, z = (h == null ? void 0 : h.type) === "API" || (h == null ? void 0 : h.type) === "S3", {
1293
- data: I,
1304
+ ), p = h == null ? void 0 : h.type, I = (h == null ? void 0 : h.type) === "API" || (h == null ? void 0 : h.type) === "S3", {
1305
+ data: O,
1294
1306
  isLoading: A,
1295
- isFetching: B,
1307
+ isFetching: $,
1296
1308
  isError: X,
1297
1309
  refetch: Y
1298
- } = Me({
1310
+ } = Te({
1299
1311
  queryKey: ["databases", l],
1300
1312
  queryFn: () => qe(
1301
1313
  "https://semaphor.cloud/api/v1/databases",
@@ -1307,12 +1319,12 @@ function Ee(s, n) {
1307
1319
  enabled: V(p)
1308
1320
  // !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
1309
1321
  }), {
1310
- data: G,
1322
+ data: U,
1311
1323
  isLoading: le,
1312
1324
  isFetching: ce,
1313
- isError: $,
1325
+ isError: B,
1314
1326
  refetch: re
1315
- } = Me({
1327
+ } = Te({
1316
1328
  queryKey: ["schemas", l, i],
1317
1329
  queryFn: () => qe(
1318
1330
  "https://semaphor.cloud/api/v1/schemas",
@@ -1322,15 +1334,15 @@ function Ee(s, n) {
1322
1334
  database_name: i
1323
1335
  }
1324
1336
  ),
1325
- enabled: !!l && !!i && !z && i !== "NA"
1337
+ enabled: !!l && !!i && !I && i !== "NA"
1326
1338
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1327
1339
  }), {
1328
1340
  data: E,
1329
1341
  isLoading: M,
1330
1342
  isFetching: ae,
1331
1343
  isError: P,
1332
- refetch: W
1333
- } = Me({
1344
+ refetch: J
1345
+ } = Te({
1334
1346
  queryKey: [
1335
1347
  "tables",
1336
1348
  l,
@@ -1352,7 +1364,7 @@ function Ee(s, n) {
1352
1364
  isLoading: Ne,
1353
1365
  isFetching: me,
1354
1366
  isError: L
1355
- } = Me({
1367
+ } = Te({
1356
1368
  queryKey: [
1357
1369
  "columns",
1358
1370
  l,
@@ -1373,7 +1385,7 @@ function Ee(s, n) {
1373
1385
  table_name: c
1374
1386
  }
1375
1387
  ),
1376
- enabled: b(p)
1388
+ enabled: v(p)
1377
1389
  // (!!selectedConnectionId &&
1378
1390
  // !!selectedDatabaseName &&
1379
1391
  // !!selectedSchemaName &&
@@ -1386,28 +1398,28 @@ function Ee(s, n) {
1386
1398
  m(a);
1387
1399
  }, [te, m, a]), se(() => {
1388
1400
  }, [
1389
- z,
1401
+ I,
1390
1402
  p,
1391
1403
  g,
1392
1404
  f,
1393
1405
  d,
1394
- v,
1406
+ b,
1395
1407
  h
1396
1408
  ]);
1397
- const U = (h == null ? void 0 : h.type) === "API" ? (Us = h == null ? void 0 : h.type) == null ? void 0 : Us.toLowerCase() : c || "", de = z ? "" : o || "";
1409
+ const G = (h == null ? void 0 : h.type) === "API" ? (Gs = h == null ? void 0 : h.type) == null ? void 0 : Gs.toLowerCase() : c || "", de = I ? "" : o || "";
1398
1410
  function Ae(y) {
1399
1411
  d(y), f("");
1400
1412
  }
1401
1413
  function Oe(y) {
1402
- v(y === "none" ? "" : y), d(""), f(""), y !== "none" && y !== "" && j("");
1414
+ b(y === "none" ? "" : y), d(""), f(""), y !== "none" && y !== "" && j("");
1403
1415
  }
1404
- function k(y) {
1416
+ function z(y) {
1405
1417
  x(y);
1406
1418
  }
1407
1419
  function ie(y) {
1408
- j(y === "none" ? "" : y), y !== "none" && y !== "" && v("");
1420
+ j(y === "none" ? "" : y), y !== "none" && y !== "" && b("");
1409
1421
  }
1410
- I && ((Gs = I == null ? void 0 : I.databases) == null ? void 0 : Gs.length) > 0, G && ((Ws = G == null ? void 0 : G.schemas) == null ? void 0 : Ws.length) > 0, te && ((Js = te == null ? void 0 : te.columns) == null ? void 0 : Js.length) > 0 && (a = te.columns.map((y) => ({
1422
+ O && ((Us = O == null ? void 0 : O.databases) == null ? void 0 : Us.length) > 0, U && ((Js = U == null ? void 0 : U.schemas) == null ? void 0 : Js.length) > 0, te && ((Ws = te == null ? void 0 : te.columns) == null ? void 0 : Ws.length) > 0 && (a = te.columns.map((y) => ({
1411
1423
  ...y,
1412
1424
  data_type: y.data_type.toLowerCase()
1413
1425
  }))), X && (a = []), (L || w) && (a = []);
@@ -1417,22 +1429,22 @@ function Ee(s, n) {
1417
1429
  name: y.name,
1418
1430
  type: y.type
1419
1431
  })
1420
- ), ue = (Ks = O == null ? void 0 : O.datamodels) == null ? void 0 : Ks.map((y) => ({
1432
+ ), ue = (Ks = D == null ? void 0 : D.datamodels) == null ? void 0 : Ks.map((y) => ({
1421
1433
  id: y.id,
1422
1434
  name: y.name
1423
- })), He = I == null ? void 0 : I.databases.map((y) => ({
1435
+ })), He = O == null ? void 0 : O.databases.map((y) => ({
1424
1436
  id: y.database_name,
1425
1437
  name: y.database_name
1426
- })), gs = G == null ? void 0 : G.schemas.map((y) => ({
1438
+ })), gs = U == null ? void 0 : U.schemas.map((y) => ({
1427
1439
  id: y.schema_name,
1428
1440
  name: y.schema_name
1429
1441
  })), Ze = E == null ? void 0 : E.tables.map((y) => ({
1430
1442
  id: y.table_name,
1431
1443
  name: y.table_name
1432
- })), js = (Qs = O == null ? void 0 : O.datamodels.find(
1444
+ })), js = (Qs = D == null ? void 0 : D.datamodels.find(
1433
1445
  (y) => y.id === r
1434
1446
  )) == null ? void 0 : Qs.name;
1435
- return (p === "S3" || p === "API") && (v(""), d(""), j("")), {
1447
+ return (p === "S3" || p === "API") && (b(""), d(""), j("")), {
1436
1448
  connectionItems: De,
1437
1449
  isConnectionsLoading: S,
1438
1450
  isConnectionsError: w,
@@ -1442,22 +1454,22 @@ function Ee(s, n) {
1442
1454
  isModelsLoading: R,
1443
1455
  isModelsError: C,
1444
1456
  databaseItems: He,
1445
- isDatabasesLoadingOrFetching: A || B,
1457
+ isDatabasesLoadingOrFetching: A || $,
1446
1458
  isDatabaseError: X,
1447
1459
  schemaItems: gs,
1448
1460
  isSchemaLoadingOrFetching: le || ce,
1449
- isSchemaError: $,
1461
+ isSchemaError: B,
1450
1462
  tableItems: Ze,
1451
1463
  isTableLoadingOrFetching: M || ae,
1452
1464
  isTableError: P,
1453
1465
  columns: a,
1454
1466
  isColumnsLoadingOrFetching: Ne || me,
1455
1467
  isColumnsError: L,
1456
- isNonDbConnection: z,
1468
+ isNonDbConnection: I,
1457
1469
  connectionType: p,
1458
- tableName: U,
1470
+ tableName: G,
1459
1471
  schemaName: de,
1460
- handleConnectionChange: k,
1472
+ handleConnectionChange: z,
1461
1473
  handleDatamodelChange: ie,
1462
1474
  handleDatabaseChange: Oe,
1463
1475
  handleSchemaChange: Ae
@@ -1483,36 +1495,36 @@ function Ra({
1483
1495
  schemaItems: m,
1484
1496
  databaseItems: x,
1485
1497
  tableItems: j,
1486
- columns: v,
1498
+ columns: b,
1487
1499
  isConnectionsLoading: d,
1488
1500
  isModelsLoading: f,
1489
1501
  isConnectionsError: g,
1490
1502
  isModelsError: N,
1491
- isDatabasesLoadingOrFetching: b,
1503
+ isDatabasesLoadingOrFetching: v,
1492
1504
  isDatabaseError: V,
1493
1505
  isSchemaLoadingOrFetching: F,
1494
1506
  isSchemaError: S,
1495
1507
  isColumnsError: w,
1496
- isColumnsLoadingOrFetching: O,
1508
+ isColumnsLoadingOrFetching: D,
1497
1509
  isTableLoadingOrFetching: R,
1498
1510
  isTableError: C,
1499
1511
  connectionType: h,
1500
1512
  isNonDbConnection: p,
1501
- handleConnectionChange: z,
1502
- handleDatabaseChange: I,
1513
+ handleConnectionChange: I,
1514
+ handleDatabaseChange: O,
1503
1515
  handleSchemaChange: A,
1504
- handleDatamodelChange: B,
1516
+ handleDatamodelChange: $,
1505
1517
  tableName: X,
1506
1518
  schemaName: Y
1507
1519
  } = Ee();
1508
- function G() {
1509
- return s ? s(Y, X, v) : /* @__PURE__ */ e.jsx(
1510
- cl,
1520
+ function U() {
1521
+ return s ? s(Y, X, b) : /* @__PURE__ */ e.jsx(
1522
+ dl,
1511
1523
  {
1512
1524
  schemaName: Y,
1513
1525
  tableName: X,
1514
- columns: v,
1515
- status: O ? "Loading..." : w ? "Error" : "Success"
1526
+ columns: b,
1527
+ status: D ? "Loading..." : w ? "Error" : "Success"
1516
1528
  }
1517
1529
  );
1518
1530
  }
@@ -1526,16 +1538,16 @@ function Ra({
1526
1538
  Pe,
1527
1539
  {
1528
1540
  showNone: !0,
1529
- onChange: I,
1541
+ onChange: O,
1530
1542
  isError: V,
1531
- isLoading: b,
1543
+ isLoading: v,
1532
1544
  items: x,
1533
1545
  value: t || "",
1534
1546
  title: "Database"
1535
1547
  }
1536
1548
  );
1537
1549
  }
1538
- function $() {
1550
+ function B() {
1539
1551
  if (n && !p && (!t || t === "none") && (!a || a === "none"))
1540
1552
  return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
1541
1553
  /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(ke, {}) }),
@@ -1550,7 +1562,7 @@ function Ra({
1550
1562
  Pe,
1551
1563
  {
1552
1564
  showNone: !0,
1553
- onChange: B,
1565
+ onChange: $,
1554
1566
  isError: N,
1555
1567
  isLoading: f,
1556
1568
  items: c,
@@ -1574,8 +1586,8 @@ function Ra({
1574
1586
  }
1575
1587
  function M() {
1576
1588
  function P() {
1577
- let W = !1;
1578
- return h === "API" ? (W = !1, W) : ((h === "S3" || n && t && t !== "none" && l) && (W = !0), W);
1589
+ let J = !1;
1590
+ return h === "API" ? (J = !1, J) : ((h === "S3" || n && t && t !== "none" && l) && (J = !0), J);
1579
1591
  }
1580
1592
  return P() ? /* @__PURE__ */ e.jsx(
1581
1593
  Pe,
@@ -1597,7 +1609,7 @@ function Ra({
1597
1609
  items: o,
1598
1610
  title: "Connection",
1599
1611
  value: n || "",
1600
- onChange: z,
1612
+ onChange: I,
1601
1613
  isLoading: d,
1602
1614
  isError: g,
1603
1615
  connectionTooltip: ((ae = o == null ? void 0 : o.find(
@@ -1606,28 +1618,28 @@ function Ra({
1606
1618
  }
1607
1619
  ),
1608
1620
  ce(),
1609
- $(),
1621
+ B(),
1610
1622
  re(),
1611
1623
  E(),
1612
1624
  M()
1613
1625
  ] }),
1614
- G(),
1626
+ U(),
1615
1627
  /* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
1616
- D,
1628
+ T,
1617
1629
  {
1618
1630
  onClick: le,
1619
1631
  size: "sm",
1620
1632
  variant: "secondary",
1621
1633
  className: "w-full",
1622
1634
  children: [
1623
- /* @__PURE__ */ e.jsx($n, { className: "mr-2 size-4" }),
1635
+ /* @__PURE__ */ e.jsx(Bn, { className: "mr-2 size-4" }),
1624
1636
  "Help"
1625
1637
  ]
1626
1638
  }
1627
1639
  ) })
1628
1640
  ] });
1629
1641
  }
1630
- function dl(s) {
1642
+ function ul(s) {
1631
1643
  const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
1632
1644
  let r = s.length;
1633
1645
  if (l !== -1 && (r = l), t !== -1 && t < r && (r = t), n !== -1) {
@@ -1643,14 +1655,14 @@ function dl(s) {
1643
1655
  return console.log("beforeClause", i), console.log("afterClause", o), o ? `${i} {{ filters | where }} ${o}` : `${i.replace(/;$/, "")} {{ filters | where }}`;
1644
1656
  }
1645
1657
  }
1646
- function ul({
1658
+ function ml({
1647
1659
  error: s,
1648
1660
  setShowAIDialog: n,
1649
1661
  setUserInputforAI: a,
1650
1662
  setTriggerAIRun: t
1651
1663
  }) {
1652
- return /* @__PURE__ */ e.jsxs(Ts, { openDelay: 0, children: [
1653
- /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(D, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(Tn, { className: "h-4 w-4 text-red-500" }) }) }),
1664
+ return /* @__PURE__ */ e.jsxs(Ms, { openDelay: 0, children: [
1665
+ /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(T, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(Mn, { className: "h-4 w-4 text-red-500" }) }) }),
1654
1666
  /* @__PURE__ */ e.jsx(
1655
1667
  Ls,
1656
1668
  {
@@ -1659,7 +1671,7 @@ function ul({
1659
1671
  children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-2", children: [
1660
1672
  /* @__PURE__ */ e.jsx(ve, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 text-xs leading-relaxed", children: s }) }),
1661
1673
  /* @__PURE__ */ e.jsxs(
1662
- D,
1674
+ T,
1663
1675
  {
1664
1676
  onClick: () => {
1665
1677
  n(!0), a(s), t(!0);
@@ -1677,34 +1689,34 @@ function ul({
1677
1689
  )
1678
1690
  ] });
1679
1691
  }
1680
- function ml({
1692
+ function hl({
1681
1693
  open: s,
1682
1694
  setOpen: n,
1683
1695
  userInput: a,
1684
1696
  triggerAIRun: t,
1685
1697
  setTriggerAIRun: l
1686
1698
  }) {
1687
- const r = is(null), i = is(null), [o, c] = q(""), [m, x] = q(null), { authToken: j } = Ie(), [v, d] = q(!1), [f, g] = q(!1), N = u((L) => L.actions.setCardSql), b = u((L) => L.actions.setRunSql), V = u(
1699
+ const r = is(null), i = is(null), [o, c] = q(""), [m, x] = q(null), { authToken: j } = Ie(), [b, d] = q(!1), [f, g] = q(!1), N = u((L) => L.actions.setCardSql), v = u((L) => L.actions.setRunSql), V = u(
1688
1700
  (L) => L.actions.switchCardType
1689
1701
  ), F = u((L) => L.currentColumns), S = u(
1690
1702
  (L) => L.selectedDatabaseName
1691
- ), w = u((L) => L.selectedTableName), O = u(
1703
+ ), w = u((L) => L.selectedTableName), D = u(
1692
1704
  (L) => L.selectedConnectionId
1693
1705
  ), R = u(
1694
1706
  (L) => L.selectedSchemaName
1695
- ), C = T(
1707
+ ), C = k(
1696
1708
  (L) => L.dashboard.aiScopeTables
1697
- ), { removeFromAIScope: h, addToAIScope: p } = Re(), { selectedDatamodelName: z, selectedDatamodelId: I, connectionType: A } = Ee(), B = ts({
1709
+ ), { removeFromAIScope: h, addToAIScope: p } = Re(), { selectedDatamodelName: I, selectedDatamodelId: O, connectionType: A } = Ee(), $ = ts({
1698
1710
  schemaName: R || "",
1699
1711
  tableName: w || "",
1700
- modelName: z,
1712
+ modelName: I,
1701
1713
  connectionType: A || ""
1702
1714
  }), X = A === "api" || A === "S3" ? "DuckDb" : A, {
1703
1715
  messages: Y,
1704
- setMessages: G,
1716
+ setMessages: U,
1705
1717
  reload: le,
1706
1718
  append: ce,
1707
- input: $,
1719
+ input: B,
1708
1720
  status: re,
1709
1721
  handleInputChange: E,
1710
1722
  handleSubmit: M,
@@ -1770,8 +1782,8 @@ function ml({
1770
1782
  // };
1771
1783
  // }
1772
1784
  // },
1773
- onFinish(L, U) {
1774
- W(U.usage), c(""), console.log("onFinish", L, U), U.finishReason === "stop" && c("");
1785
+ onFinish(L, G) {
1786
+ J(G.usage), c(""), console.log("onFinish", L, G), G.finishReason === "stop" && c("");
1775
1787
  }
1776
1788
  });
1777
1789
  se(() => {
@@ -1788,20 +1800,20 @@ function ml({
1788
1800
  E
1789
1801
  ]), se(() => {
1790
1802
  const L = setTimeout(() => {
1791
- var U;
1803
+ var G;
1792
1804
  i.current && (i.current.scroll({
1793
1805
  top: i.current.scrollHeight,
1794
1806
  behavior: "auto"
1795
1807
  // 'smooth'
1796
- }), (U = r.current) == null || U.focus());
1808
+ }), (G = r.current) == null || G.focus());
1797
1809
  }, 50);
1798
1810
  return () => clearTimeout(L);
1799
1811
  }, [Y, s]);
1800
- function W(L) {
1801
- x((U) => U ? {
1802
- promptTokens: U.promptTokens + L.promptTokens,
1803
- completionTokens: U.completionTokens + L.completionTokens,
1804
- totalTokens: U.totalTokens + L.totalTokens
1812
+ function J(L) {
1813
+ x((G) => G ? {
1814
+ promptTokens: G.promptTokens + L.promptTokens,
1815
+ completionTokens: G.completionTokens + L.completionTokens,
1816
+ totalTokens: G.totalTokens + L.totalTokens
1805
1817
  } : L);
1806
1818
  }
1807
1819
  async function te({
@@ -1814,36 +1826,36 @@ function ml({
1814
1826
  })) };
1815
1827
  if (L.toolName === "createChart") {
1816
1828
  console.log("createChart", L.args);
1817
- const U = L.args.sql, de = L.args.chartType;
1818
- return V(de), N(U), b(!0), {
1829
+ const G = L.args.sql, de = L.args.chartType;
1830
+ return V(de), N(G), v(!0), {
1819
1831
  status: "success",
1820
- query: U
1832
+ query: G
1821
1833
  };
1822
1834
  }
1823
1835
  if (L.toolName === "getTableColumns" && c("Getting table columns..."), L.toolName === "getCurrentSchema")
1824
1836
  return c("Getting current table columns..."), {
1825
1837
  sqlDialect: X,
1826
- tableName: B,
1838
+ tableName: $,
1827
1839
  columns: F
1828
1840
  };
1829
1841
  c("Thinking...");
1830
1842
  }
1831
1843
  function Ne(L) {
1832
- n(!1), N(L), b(!0);
1844
+ n(!1), N(L), v(!0);
1833
1845
  }
1834
1846
  const me = !["ready", "error"].includes(re);
1835
1847
  return /* @__PURE__ */ e.jsxs(Ss, { open: s, onOpenChange: n, children: [
1836
1848
  /* @__PURE__ */ e.jsx(ws, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1837
- D,
1849
+ T,
1838
1850
  {
1839
1851
  onClick: () => {
1840
1852
  (!C || (C == null ? void 0 : C.length) === 0) && p({
1841
- connectionId: O || "",
1853
+ connectionId: D || "",
1842
1854
  connectionType: A || "",
1843
1855
  databaseName: S || "",
1844
1856
  schemaName: R || "",
1845
1857
  tableName: w || "",
1846
- datamodelName: z || ""
1858
+ datamodelName: I || ""
1847
1859
  });
1848
1860
  },
1849
1861
  size: "sm",
@@ -1858,7 +1870,7 @@ function ml({
1858
1870
  /* @__PURE__ */ e.jsx(Is, { children: "Assistant" }),
1859
1871
  C && C.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: [
1860
1872
  /* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "Tables in scope:" }),
1861
- C == null ? void 0 : C.map((L, U) => /* @__PURE__ */ e.jsxs(
1873
+ C == null ? void 0 : C.map((L, G) => /* @__PURE__ */ e.jsxs(
1862
1874
  "div",
1863
1875
  {
1864
1876
  className: "flex items-center gap-2 rounded-md bg-muted px-2 py-1 text-xs",
@@ -1880,25 +1892,25 @@ function ml({
1880
1892
  )
1881
1893
  ]
1882
1894
  },
1883
- U
1895
+ G
1884
1896
  ))
1885
1897
  ] }),
1886
1898
  (!C || (C == null ? void 0 : C.length) === 0) && /* @__PURE__ */ e.jsxs("div", { className: "mt-2 flex items-center gap-2", children: [
1887
1899
  /* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "Tables in scope: None" }),
1888
1900
  /* @__PURE__ */ e.jsxs(
1889
- D,
1901
+ T,
1890
1902
  {
1891
1903
  className: "h-6 text-xs",
1892
1904
  size: "sm",
1893
1905
  variant: "secondary",
1894
1906
  onClick: () => {
1895
1907
  p({
1896
- connectionId: O || "",
1908
+ connectionId: D || "",
1897
1909
  connectionType: A || "",
1898
1910
  databaseName: S || "",
1899
1911
  schemaName: R || "",
1900
1912
  tableName: w || "",
1901
- datamodelName: z || ""
1913
+ datamodelName: I || ""
1902
1914
  });
1903
1915
  },
1904
1916
  children: [
@@ -1912,15 +1924,15 @@ function ml({
1912
1924
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
1913
1925
  /* @__PURE__ */ e.jsxs(Os, { children: [
1914
1926
  /* @__PURE__ */ e.jsx(Ds, { children: /* @__PURE__ */ e.jsx(Hs, { className: "size-3.5 text-muted-foreground/70 hover:text-muted-foreground" }) }),
1915
- /* @__PURE__ */ e.jsxs(Ms, { align: "end", children: [
1927
+ /* @__PURE__ */ e.jsxs(Ts, { align: "end", children: [
1916
1928
  /* @__PURE__ */ e.jsx(ua, { children: "Options" }),
1917
1929
  /* @__PURE__ */ e.jsx(ma, {}),
1918
1930
  /* @__PURE__ */ e.jsx(
1919
1931
  Xs,
1920
1932
  {
1921
- checked: v,
1933
+ checked: b,
1922
1934
  onCheckedChange: d,
1923
- children: v ? "Hide Usage" : "Show Usage"
1935
+ children: b ? "Hide Usage" : "Show Usage"
1924
1936
  }
1925
1937
  ),
1926
1938
  /* @__PURE__ */ e.jsx(
@@ -1934,13 +1946,13 @@ function ml({
1934
1946
  ] })
1935
1947
  ] }),
1936
1948
  /* @__PURE__ */ e.jsx(
1937
- D,
1949
+ T,
1938
1950
  {
1939
1951
  className: "h-8",
1940
1952
  size: "sm",
1941
1953
  variant: "secondary",
1942
1954
  onClick: () => {
1943
- G([]), le();
1955
+ U([]), le();
1944
1956
  },
1945
1957
  children: "Clear"
1946
1958
  }
@@ -1976,13 +1988,13 @@ function ml({
1976
1988
  {
1977
1989
  stop: P,
1978
1990
  ref: r,
1979
- input: $,
1991
+ input: B,
1980
1992
  handleInputChange: E,
1981
1993
  handleSubmit: M,
1982
1994
  isLoading: me
1983
1995
  }
1984
1996
  ),
1985
- m && v && /* @__PURE__ */ e.jsx("div", { className: "flex h-8 items-center justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "text-xs text-muted-foreground", children: [
1997
+ m && b && /* @__PURE__ */ e.jsx("div", { className: "flex h-8 items-center justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "text-xs text-muted-foreground", children: [
1986
1998
  "Usage: ",
1987
1999
  m.promptTokens,
1988
2000
  " prompt tokens,",
@@ -2002,10 +2014,10 @@ var _a = {
2002
2014
  className: void 0,
2003
2015
  style: void 0,
2004
2016
  attr: void 0
2005
- }, na = ze.createContext && /* @__PURE__ */ ze.createContext(_a), hl = ["attr", "size", "title"];
2006
- function xl(s, n) {
2017
+ }, na = ze.createContext && /* @__PURE__ */ ze.createContext(_a), xl = ["attr", "size", "title"];
2018
+ function pl(s, n) {
2007
2019
  if (s == null) return {};
2008
- var a = pl(s, n), t, l;
2020
+ var a = fl(s, n), t, l;
2009
2021
  if (Object.getOwnPropertySymbols) {
2010
2022
  var r = Object.getOwnPropertySymbols(s);
2011
2023
  for (l = 0; l < r.length; l++)
@@ -2013,7 +2025,7 @@ function xl(s, n) {
2013
2025
  }
2014
2026
  return a;
2015
2027
  }
2016
- function pl(s, n) {
2028
+ function fl(s, n) {
2017
2029
  if (s == null) return {};
2018
2030
  var a = {};
2019
2031
  for (var t in s)
@@ -2047,21 +2059,21 @@ function cs(s) {
2047
2059
  for (var n = 1; n < arguments.length; n++) {
2048
2060
  var a = arguments[n] != null ? arguments[n] : {};
2049
2061
  n % 2 ? la(Object(a), !0).forEach(function(t) {
2050
- fl(s, t, a[t]);
2062
+ gl(s, t, a[t]);
2051
2063
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : la(Object(a)).forEach(function(t) {
2052
2064
  Object.defineProperty(s, t, Object.getOwnPropertyDescriptor(a, t));
2053
2065
  });
2054
2066
  }
2055
2067
  return s;
2056
2068
  }
2057
- function fl(s, n, a) {
2058
- return n = gl(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
2069
+ function gl(s, n, a) {
2070
+ return n = jl(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
2059
2071
  }
2060
- function gl(s) {
2061
- var n = jl(s, "string");
2072
+ function jl(s) {
2073
+ var n = bl(s, "string");
2062
2074
  return typeof n == "symbol" ? n : n + "";
2063
2075
  }
2064
- function jl(s, n) {
2076
+ function bl(s, n) {
2065
2077
  if (typeof s != "object" || !s) return s;
2066
2078
  var a = s[Symbol.toPrimitive];
2067
2079
  if (a !== void 0) {
@@ -2077,17 +2089,17 @@ function Ha(s) {
2077
2089
  }, n.attr), Ha(n.child)));
2078
2090
  }
2079
2091
  function ye(s) {
2080
- return (n) => /* @__PURE__ */ ze.createElement(bl, os({
2092
+ return (n) => /* @__PURE__ */ ze.createElement(vl, os({
2081
2093
  attr: cs({}, s.attr)
2082
2094
  }, n), Ha(s.child));
2083
2095
  }
2084
- function bl(s) {
2096
+ function vl(s) {
2085
2097
  var n = (a) => {
2086
2098
  var {
2087
2099
  attr: t,
2088
2100
  size: l,
2089
2101
  title: r
2090
- } = s, i = xl(s, hl), o = l || a.size || "1em", c;
2102
+ } = s, i = pl(s, xl), o = l || a.size || "1em", c;
2091
2103
  return a.className && (c = a.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ ze.createElement("svg", os({
2092
2104
  stroke: "currentColor",
2093
2105
  fill: "currentColor",
@@ -2104,12 +2116,12 @@ function bl(s) {
2104
2116
  };
2105
2117
  return na !== void 0 ? /* @__PURE__ */ ze.createElement(na.Consumer, null, (a) => n(a)) : n(_a);
2106
2118
  }
2107
- function vl(s) {
2119
+ function yl(s) {
2108
2120
  return ye({ 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);
2109
2121
  }
2110
- function yl({ sql: s }) {
2111
- return /* @__PURE__ */ e.jsxs(Ts, { children: [
2112
- /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(D, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(bt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
2122
+ function Nl({ sql: s }) {
2123
+ return /* @__PURE__ */ e.jsxs(Ms, { children: [
2124
+ /* @__PURE__ */ e.jsx(Fs, { asChild: !0, children: /* @__PURE__ */ e.jsx(T, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(bt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
2113
2125
  /* @__PURE__ */ e.jsx(
2114
2126
  Ls,
2115
2127
  {
@@ -2124,10 +2136,10 @@ function yl({ sql: s }) {
2124
2136
  ] });
2125
2137
  }
2126
2138
  function Pa(s) {
2127
- const { theme: n } = vt(), a = T((g) => g.theme), t = u((g) => g.frame), l = u((g) => g.card), r = u((g) => g.activeTabCardId), i = yt(), { refetch: o } = Fe(l), { updateCardTab: c, setRunSql: m } = ne(), x = is(), j = is({}), v = t.cards.find((g) => g.id === r), d = Ma(() => {
2139
+ const { theme: n } = vt(), a = k((g) => g.theme), t = u((g) => g.frame), l = u((g) => g.card), r = u((g) => g.activeTabCardId), i = yt(), { refetch: o } = Fe(l), { updateCardTab: c, setRunSql: m } = ne(), x = is(), j = is({}), b = t.cards.find((g) => g.id === r), d = Ta(() => {
2128
2140
  let g = "";
2129
- return s === "python" && (g = (v == null ? void 0 : v.python) || ya), s === "sql" && (g = (v == null ? void 0 : v.sql) || ""), g;
2130
- }, [s, v]);
2141
+ return s === "python" && (g = (b == null ? void 0 : b.python) || ya), s === "sql" && (g = (b == null ? void 0 : b.sql) || ""), g;
2142
+ }, [s, b]);
2131
2143
  se(() => {
2132
2144
  if (r && l.id && l.id !== r) {
2133
2145
  if (x.current && i) {
@@ -2135,8 +2147,8 @@ function Pa(s) {
2135
2147
  g && (j.current[l.id] = g);
2136
2148
  let N = j.current[r];
2137
2149
  if (!N) {
2138
- const b = d();
2139
- N = i.editor.createModel(b, s), j.current[r] = N;
2150
+ const v = d();
2151
+ N = i.editor.createModel(v, s), j.current[r] = N;
2140
2152
  }
2141
2153
  x.current.setModel(N);
2142
2154
  }
@@ -2177,14 +2189,14 @@ function Pa(s) {
2177
2189
  }, [i, o, l]);
2178
2190
  function f(g, N) {
2179
2191
  if (x.current = g, !j.current[l.id]) {
2180
- const b = g.getModel(), V = d();
2181
- j.current[l.id] = b || (N == null ? void 0 : N.editor.createModel(V, s)) || g.getModel();
2192
+ const v = g.getModel(), V = d();
2193
+ j.current[l.id] = v || (N == null ? void 0 : N.editor.createModel(V, s)) || g.getModel();
2182
2194
  }
2183
2195
  g.setModel(j.current[l.id]);
2184
2196
  }
2185
2197
  return { handleEditorDidMount: f };
2186
2198
  }
2187
- function Nl() {
2199
+ function Cl() {
2188
2200
  const s = u((i) => i.card.sql), n = u((i) => i.sqlGen), { setCardSql: a, setSqlGen: t } = ne(), { handleEditorDidMount: l } = Pa("sql");
2189
2201
  function r(i) {
2190
2202
  a(i), Ct(n) || t({});
@@ -2213,7 +2225,7 @@ function Nl() {
2213
2225
  }
2214
2226
  );
2215
2227
  }
2216
- function Cl() {
2228
+ function Sl() {
2217
2229
  const s = u((l) => l.card.python), { setCardPython: n } = ne(), { handleEditorDidMount: a } = Pa("python");
2218
2230
  function t(l) {
2219
2231
  n(l);
@@ -2242,8 +2254,8 @@ function Cl() {
2242
2254
  }
2243
2255
  );
2244
2256
  }
2245
- function Sl() {
2246
- const s = T((r) => r.dashboard.filters), n = T((r) => r.filterValues), a = T((r) => r.selectedSheetId), t = s == null ? void 0 : s.filter(
2257
+ function wl() {
2258
+ const s = k((r) => r.dashboard.filters), n = k((r) => r.filterValues), a = k((r) => r.selectedSheetId), t = s == null ? void 0 : s.filter(
2247
2259
  (r) => r.sheetId === a || !r.sheetId
2248
2260
  ), l = n == null ? void 0 : n.filter(
2249
2261
  (r) => (t == null ? void 0 : t.some((i) => i.id === r.filterId)) || r.filterId.endsWith(a)
@@ -2273,56 +2285,56 @@ function Sl() {
2273
2285
  }
2274
2286
  );
2275
2287
  }
2276
- function wl() {
2288
+ function kl() {
2277
2289
  var Oe;
2278
2290
  const [s, n] = q({
2279
2291
  queryKey: [],
2280
2292
  queryData: null
2281
- }), a = St(), [t, l] = q(!1), [r, i] = q(!1), [o, c] = q(!1), [m, x] = q(""), [j, v] = q(!1), d = u((k) => k.frame), f = u((k) => k.card), g = u((k) => k.isShowingVisual), N = u(
2282
- (k) => k.selectedConnectionId
2283
- ), b = u(
2284
- (k) => k.selectedDatabaseName
2293
+ }), a = St(), [t, l] = q(!1), [r, i] = q(!1), [o, c] = q(!1), [m, x] = q(""), [j, b] = q(!1), d = u((z) => z.frame), f = u((z) => z.card), g = u((z) => z.isShowingVisual), N = u(
2294
+ (z) => z.selectedConnectionId
2295
+ ), v = u(
2296
+ (z) => z.selectedDatabaseName
2285
2297
  ), V = u(
2286
- (k) => k.selectedDatamodelId
2298
+ (z) => z.selectedDatamodelId
2287
2299
  ), F = u(
2288
- (k) => k.selectedSchemaName
2289
- ), S = u((k) => k.selectedTableName), w = u((k) => {
2300
+ (z) => z.selectedSchemaName
2301
+ ), S = u((z) => z.selectedTableName), w = u((z) => {
2290
2302
  var ie;
2291
- return (ie = k == null ? void 0 : k.card) == null ? void 0 : ie.sql;
2292
- }), O = u((k) => k.applyFilters), {
2303
+ return (ie = z == null ? void 0 : z.card) == null ? void 0 : ie.sql;
2304
+ }), D = u((z) => z.applyFilters), {
2293
2305
  setCardCustomCfg: R,
2294
2306
  setQueryResultColumns: C,
2295
2307
  setCardSql: h,
2296
2308
  // setQueryError,
2297
2309
  setPythonStdOut: p,
2298
- setCardPreferences: z,
2299
- setCardType: I
2300
- } = ne(), A = u((k) => k.onSave), B = u((k) => k.onClose), X = u((k) => k.actions.setSqlGen), Y = u((k) => k.runSql), G = u((k) => k.actions.setRunSql), le = u((k) => k.actions.setCardCfg), ce = u(
2301
- (k) => k.actions.setIsSqlRunning
2310
+ setCardPreferences: I,
2311
+ setCardType: O
2312
+ } = ne(), A = u((z) => z.onSave), $ = u((z) => z.onClose), X = u((z) => z.actions.setSqlGen), Y = u((z) => z.runSql), U = u((z) => z.actions.setRunSql), le = u((z) => z.actions.setCardCfg), ce = u(
2313
+ (z) => z.actions.setIsSqlRunning
2302
2314
  ), {
2303
- data: $,
2315
+ data: B,
2304
2316
  isLoading: re,
2305
2317
  isFetching: E,
2306
2318
  isSuccess: M,
2307
2319
  isError: ae,
2308
2320
  error: P,
2309
- queryKey: W,
2321
+ queryKey: J,
2310
2322
  refetch: te
2311
2323
  } = Fe(f);
2312
2324
  se(() => {
2313
- if ($ && ($.rowLimitExceeded && We.error("Row limit (10,000) exceeded. Refine your query.", {
2325
+ if (B && (B.rowLimitExceeded && Je.error("Row limit (10,000) exceeded. Refine your query.", {
2314
2326
  position: "top-center",
2315
2327
  richColors: !0
2316
- }), p(($ == null ? void 0 : $.output) || ""), $.records.length > 0)) {
2317
- const { dimensionKeys: k } = vs($.records);
2318
- C(k);
2328
+ }), p((B == null ? void 0 : B.output) || ""), B.records.length > 0)) {
2329
+ const { dimensionKeys: z } = vs(B.records);
2330
+ C(z);
2319
2331
  }
2320
- }, [$, C, p]), se(() => {
2332
+ }, [B, C, p]), se(() => {
2321
2333
  (re || E) && ce(!0), (ae || M) && ce(!1), ae && (C([]), p(""));
2322
2334
  }, [
2323
2335
  re,
2324
2336
  E,
2325
- $,
2337
+ B,
2326
2338
  p,
2327
2339
  ae,
2328
2340
  M,
@@ -2331,47 +2343,47 @@ function wl() {
2331
2343
  // setQueryError,
2332
2344
  P
2333
2345
  ]), se(() => {
2334
- Y && (a.getQueryData(W) || te(), G(!1));
2335
- }, [Y, te, G, W, a]);
2346
+ Y && (a.getQueryData(J) || te(), U(!1));
2347
+ }, [Y, te, U, J, a]);
2336
2348
  function Ne() {
2337
- const k = a.getQueryData(W);
2349
+ const z = a.getQueryData(J);
2338
2350
  s.queryData || n({
2339
- queryKey: W,
2340
- queryData: k
2341
- }), a.setQueryData(W, null), a.removeQueries({ queryKey: W, exact: !0 }), h(""), X({}), le(void 0), R(""), z({}), I("bar");
2351
+ queryKey: J,
2352
+ queryData: z
2353
+ }), a.setQueryData(J, null), a.removeQueries({ queryKey: J, exact: !0 }), h(""), X({}), le(void 0), R(""), I({}), O("bar");
2342
2354
  }
2343
- function me(k, ie) {
2344
- if (k.length === 0)
2355
+ function me(z, ie) {
2356
+ if (z.length === 0)
2345
2357
  return "";
2346
2358
  if (ie) {
2347
- const De = k.find((ue) => ue.id === ie);
2359
+ const De = z.find((ue) => ue.id === ie);
2348
2360
  if (De) {
2349
2361
  const ue = De.tabTitle;
2350
2362
  if (ue == "All__Header")
2351
- return k[0].id;
2363
+ return z[0].id;
2352
2364
  if (ue && ue.endsWith("__Header")) {
2353
- const gs = ue.split("__")[0], Ze = k.find(
2365
+ const gs = ue.split("__")[0], Ze = z.find(
2354
2366
  (js) => js.tabTitle === gs
2355
2367
  );
2356
- return Ze ? Ze.id : k[0].id;
2368
+ return Ze ? Ze.id : z[0].id;
2357
2369
  }
2358
2370
  return ie;
2359
2371
  }
2360
2372
  }
2361
- return k[0].id;
2373
+ return z[0].id;
2362
2374
  }
2363
2375
  function L() {
2364
- let k = w;
2365
- w && !w.includes("{{") && (k = dl(w), h(k));
2376
+ let z = w;
2377
+ w && !w.includes("{{") && (z = ul(w), h(z));
2366
2378
  const ie = {
2367
2379
  ...f,
2368
2380
  lastSelectedSchema: F,
2369
2381
  lastSelectedDatamodelId: V,
2370
- lastSelectedDatabase: b,
2382
+ lastSelectedDatabase: v,
2371
2383
  lastSelectedTable: S,
2372
2384
  connectionId: N,
2373
2385
  type: g ? f.type : "table",
2374
- sql: k,
2386
+ sql: z,
2375
2387
  customCfg: g ? f.customCfg : null
2376
2388
  }, De = d.cards.map(
2377
2389
  (He) => He.id === f.id ? ie : He
@@ -2382,9 +2394,9 @@ function wl() {
2382
2394
  };
2383
2395
  A == null || A(ue);
2384
2396
  }
2385
- function U() {
2386
- const { queryKey: k, queryData: ie } = s;
2387
- k && ie && a.setQueryData(k, ie), X({}), B == null || B();
2397
+ function G() {
2398
+ const { queryKey: z, queryData: ie } = s;
2399
+ z && ie && a.setQueryData(z, ie), X({}), $ == null || $();
2388
2400
  }
2389
2401
  function de() {
2390
2402
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
@@ -2397,14 +2409,14 @@ function wl() {
2397
2409
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
2398
2410
  /* @__PURE__ */ e.jsx(H, { className: "ml-6 text-xs font-semibold", children: "Filters" }),
2399
2411
  r && /* @__PURE__ */ e.jsx(
2400
- Ue,
2412
+ Ge,
2401
2413
  {
2402
2414
  onClick: () => i(!1),
2403
2415
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
2404
2416
  }
2405
2417
  )
2406
2418
  ] }),
2407
- /* @__PURE__ */ e.jsx(Sl, {})
2419
+ /* @__PURE__ */ e.jsx(wl, {})
2408
2420
  ] })
2409
2421
  }
2410
2422
  ),
@@ -2415,7 +2427,7 @@ function wl() {
2415
2427
  className: Z(
2416
2428
  "absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
2417
2429
  {
2418
- "font-bold text-red-800": O
2430
+ "font-bold text-red-800": D
2419
2431
  }
2420
2432
  )
2421
2433
  }
@@ -2443,7 +2455,7 @@ function wl() {
2443
2455
  {
2444
2456
  id: "sql-container",
2445
2457
  className: "relative flex w-[99%]",
2446
- children: /* @__PURE__ */ e.jsx(Nl, {})
2458
+ children: /* @__PURE__ */ e.jsx(Cl, {})
2447
2459
  }
2448
2460
  ),
2449
2461
  t && /* @__PURE__ */ e.jsx("code", { className: "absolute right-6 top-3 text-xs text-muted-foreground/70", children: "sql" })
@@ -2465,7 +2477,7 @@ function wl() {
2465
2477
  {
2466
2478
  id: "python-container",
2467
2479
  className: "relative flex w-[99%] pt-0",
2468
- children: /* @__PURE__ */ e.jsx(Cl, {})
2480
+ children: /* @__PURE__ */ e.jsx(Sl, {})
2469
2481
  }
2470
2482
  ),
2471
2483
  /* @__PURE__ */ e.jsx("code", { className: "absolute right-6 top-3 text-xs text-muted-foreground/70", children: "python" })
@@ -2497,7 +2509,7 @@ function wl() {
2497
2509
  children: [
2498
2510
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2499
2511
  /* @__PURE__ */ e.jsxs(
2500
- D,
2512
+ T,
2501
2513
  {
2502
2514
  title: "Shift + Enter",
2503
2515
  disabled: re || E,
@@ -2513,17 +2525,17 @@ function wl() {
2513
2525
  ]
2514
2526
  }
2515
2527
  ),
2516
- (ae || ($ == null ? void 0 : $.error)) && /* @__PURE__ */ e.jsx(
2517
- ul,
2528
+ (ae || (B == null ? void 0 : B.error)) && /* @__PURE__ */ e.jsx(
2529
+ ml,
2518
2530
  {
2519
- error: (P == null ? void 0 : P.message) || ((Oe = $ == null ? void 0 : $.error) == null ? void 0 : Oe.message),
2531
+ error: (P == null ? void 0 : P.message) || ((Oe = B == null ? void 0 : B.error) == null ? void 0 : Oe.message),
2520
2532
  setShowAIDialog: c,
2521
- setTriggerAIRun: v,
2533
+ setTriggerAIRun: b,
2522
2534
  setUserInputforAI: x
2523
2535
  }
2524
2536
  ),
2525
2537
  /* @__PURE__ */ e.jsxs(
2526
- D,
2538
+ T,
2527
2539
  {
2528
2540
  onClick: Ne,
2529
2541
  className: "",
@@ -2539,41 +2551,41 @@ function wl() {
2539
2551
  va,
2540
2552
  {
2541
2553
  pressed: t,
2542
- onPressedChange: (k) => l(k),
2554
+ onPressedChange: (z) => l(z),
2543
2555
  className: "",
2544
2556
  size: "sm",
2545
2557
  variant: "outline",
2546
- children: /* @__PURE__ */ e.jsx(vl, { className: "size-4 text-foreground/70" })
2558
+ children: /* @__PURE__ */ e.jsx(yl, { className: "size-4 text-foreground/70" })
2547
2559
  }
2548
2560
  ),
2549
2561
  /* @__PURE__ */ e.jsx(
2550
- ml,
2562
+ hl,
2551
2563
  {
2552
2564
  open: o,
2553
2565
  setOpen: c,
2554
2566
  userInput: m,
2555
2567
  triggerAIRun: j,
2556
- setTriggerAIRun: v
2568
+ setTriggerAIRun: b
2557
2569
  }
2558
2570
  )
2559
2571
  ] }),
2560
2572
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2561
- ($ == null ? void 0 : $.sql) && /* @__PURE__ */ e.jsx(yl, { sql: $.sql }),
2573
+ (B == null ? void 0 : B.sql) && /* @__PURE__ */ e.jsx(Nl, { sql: B.sql }),
2562
2574
  /* @__PURE__ */ e.jsxs(
2563
- D,
2575
+ T,
2564
2576
  {
2565
- onClick: U,
2577
+ onClick: G,
2566
2578
  className: "w-full",
2567
2579
  size: "sm",
2568
2580
  variant: "outline",
2569
2581
  children: [
2570
- /* @__PURE__ */ e.jsx(Ue, { className: "mr-2 size-4" }),
2582
+ /* @__PURE__ */ e.jsx(Ge, { className: "mr-2 size-4" }),
2571
2583
  "Close"
2572
2584
  ]
2573
2585
  }
2574
2586
  ),
2575
2587
  /* @__PURE__ */ e.jsxs(
2576
- D,
2588
+ T,
2577
2589
  {
2578
2590
  onClick: L,
2579
2591
  size: "sm",
@@ -2593,7 +2605,7 @@ function wl() {
2593
2605
  )
2594
2606
  );
2595
2607
  }
2596
- function kl({ data: s }) {
2608
+ function zl({ data: s }) {
2597
2609
  var i;
2598
2610
  const [n, a] = ze.useState([]), l = Object.keys(s[0]).map((o) => ({
2599
2611
  // header: key,
@@ -2626,7 +2638,7 @@ function kl({ data: s }) {
2626
2638
  });
2627
2639
  return /* @__PURE__ */ e.jsx("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
2628
2640
  /* @__PURE__ */ e.jsx(Dt, { children: r.getHeaderGroups().map((o) => /* @__PURE__ */ e.jsx(bs, { children: o.headers.map((c) => /* @__PURE__ */ e.jsx(
2629
- Mt,
2641
+ Tt,
2630
2642
  {
2631
2643
  className: "sticky top-0 h-11 bg-muted font-semibold",
2632
2644
  children: c.isPlaceholder ? null : Ys(
@@ -2636,7 +2648,7 @@ function kl({ data: s }) {
2636
2648
  },
2637
2649
  c.id
2638
2650
  )) }, o.id)) }),
2639
- /* @__PURE__ */ e.jsx(Tt, { children: (i = r.getRowModel().rows) != null && i.length ? r.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
2651
+ /* @__PURE__ */ e.jsx(Mt, { children: (i = r.getRowModel().rows) != null && i.length ? r.getRowModel().rows.map((o) => /* @__PURE__ */ e.jsx(
2640
2652
  bs,
2641
2653
  {
2642
2654
  className: "whitespace-nowrap py-2",
@@ -2647,36 +2659,36 @@ function kl({ data: s }) {
2647
2659
  )) : /* @__PURE__ */ e.jsx(bs, { children: /* @__PURE__ */ e.jsx(ea, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2648
2660
  ] }) });
2649
2661
  }
2650
- function zl({ card: s }) {
2651
- var b, V, F, S, w, O, R, C, h, p, z;
2662
+ function Il({ card: s }) {
2663
+ var v, V, F, S, w, D, R, C, h, p, I;
2652
2664
  const [n, a] = q(!1), [t, l] = q(
2653
2665
  []
2654
- ), { authToken: r } = Ie(), i = Vt(r == null ? void 0 : r.accessToken), o = T((I) => I.themeStyle), c = {
2655
- colors: ((V = (b = o == null ? void 0 : o.chart) == null ? void 0 : b.dataset) == null ? void 0 : V.backgroundColor) || []
2666
+ ), { authToken: r } = Ie(), i = Vt(r == null ? void 0 : r.accessToken), o = k((O) => O.themeStyle), c = {
2667
+ colors: ((V = (v = o == null ? void 0 : o.chart) == null ? void 0 : v.dataset) == null ? void 0 : V.backgroundColor) || []
2656
2668
  };
2657
2669
  (F = s.customCardPreferences) != null && F.inputData;
2658
- const { getCard: m } = Na(((S = s.customCardPreferences) == null ? void 0 : S.url) || ""), x = ((w = s.customCardPreferences) == null ? void 0 : w.visualType) || "single", j = u((I) => I.frame);
2670
+ const { getCard: m } = Na(((S = s.customCardPreferences) == null ? void 0 : S.url) || ""), x = ((w = s.customCardPreferences) == null ? void 0 : w.visualType) || "single", j = u((O) => O.frame);
2659
2671
  ne();
2660
- const { data: v } = Fe(s), d = Ma((I, A) => {
2661
- l((B) => ({
2662
- ...B,
2663
- [I]: A
2672
+ const { data: b } = Fe(s), d = Ta((O, A) => {
2673
+ l(($) => ({
2674
+ ...$,
2675
+ [O]: A
2664
2676
  }));
2665
2677
  }, []);
2666
- if (!((O = s.customCardPreferences) != null && O.componentName))
2678
+ if (!((D = s.customCardPreferences) != null && D.componentName))
2667
2679
  return null;
2668
2680
  const f = m(
2669
2681
  (R = s.customCardPreferences) == null ? void 0 : R.componentName
2670
2682
  );
2671
- function g(I) {
2672
- a(I);
2683
+ function g(O) {
2684
+ a(O);
2673
2685
  }
2674
2686
  const N = Object.keys(
2675
2687
  ((C = s.customCardPreferences) == null ? void 0 : C.dataInputCardIds) || {}
2676
- ).map((I) => {
2677
- var X, Y, G;
2678
- const A = (Y = (X = s.customCardPreferences) == null ? void 0 : X.dataInputCardIds) == null ? void 0 : Y[I].cardId, B = (G = j == null ? void 0 : j.cards) == null ? void 0 : G.find((le) => le.id === A);
2679
- return B || null;
2688
+ ).map((O) => {
2689
+ var X, Y, U;
2690
+ const A = (Y = (X = s.customCardPreferences) == null ? void 0 : X.dataInputCardIds) == null ? void 0 : Y[O].cardId, $ = (U = j == null ? void 0 : j.cards) == null ? void 0 : U.find((le) => le.id === A);
2691
+ return $ || null;
2680
2692
  });
2681
2693
  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(
2682
2694
  In,
@@ -2690,27 +2702,27 @@ function zl({ card: s }) {
2690
2702
  theme: c,
2691
2703
  settings: (h = s.customCardPreferences) == null ? void 0 : h.settings,
2692
2704
  onDataChange: d,
2693
- data: (v == null ? void 0 : v.records) || []
2705
+ data: (b == null ? void 0 : b.records) || []
2694
2706
  }
2695
2707
  ),
2696
2708
  f && x === "multiple" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2697
2709
  Object.keys(
2698
2710
  ((p = s.customCardPreferences) == null ? void 0 : p.dataInputCardIds) || {}
2699
- ).map((I) => {
2700
- var X, Y, G;
2701
- const A = (Y = (X = s.customCardPreferences) == null ? void 0 : X.dataInputCardIds) == null ? void 0 : Y[I].cardId, B = (G = j == null ? void 0 : j.cards) == null ? void 0 : G.find(
2711
+ ).map((O) => {
2712
+ var X, Y, U;
2713
+ const A = (Y = (X = s.customCardPreferences) == null ? void 0 : X.dataInputCardIds) == null ? void 0 : Y[O].cardId, $ = (U = j == null ? void 0 : j.cards) == null ? void 0 : U.find(
2702
2714
  (le) => le.id === A
2703
2715
  );
2704
- if (B)
2716
+ if ($)
2705
2717
  return /* @__PURE__ */ e.jsx(
2706
2718
  At,
2707
2719
  {
2708
2720
  onLoadingStatus: g,
2709
2721
  onDataChange: d,
2710
- dataInputIndex: I,
2711
- card: B
2722
+ dataInputIndex: O,
2723
+ card: $
2712
2724
  },
2713
- B.id + I
2725
+ $.id + O
2714
2726
  );
2715
2727
  }),
2716
2728
  /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
@@ -2719,30 +2731,30 @@ function zl({ card: s }) {
2719
2731
  theme: c,
2720
2732
  onDataChange: d,
2721
2733
  settings: N.map(
2722
- (I) => {
2734
+ (O) => {
2723
2735
  var A;
2724
- return (A = I == null ? void 0 : I.customCardPreferences) == null ? void 0 : A.settings;
2736
+ return (A = O == null ? void 0 : O.customCardPreferences) == null ? void 0 : A.settings;
2725
2737
  }
2726
2738
  ),
2727
- data: N.map((I) => I != null && I.id ? t == null ? void 0 : t[I.id] : [])
2739
+ data: N.map((O) => O != null && O.id ? t == null ? void 0 : t[O.id] : [])
2728
2740
  }
2729
2741
  ) })
2730
2742
  ] })
2731
2743
  ]
2732
2744
  },
2733
- (z = s.customCardPreferences) == null ? void 0 : z.componentName
2745
+ (I = s.customCardPreferences) == null ? void 0 : I.componentName
2734
2746
  ) });
2735
2747
  }
2736
- function Ba({
2748
+ function $a({
2737
2749
  // card,
2738
2750
  // showCard,
2739
2751
  className: s,
2740
2752
  ...n
2741
2753
  }) {
2742
2754
  var N;
2743
- const a = u((b) => b.card), t = ((N = a.customCardPreferences) == null ? void 0 : N.showCardHeader) ?? !0, l = u((b) => b.frame), r = T((b) => b.dashboard.filters);
2744
- u((b) => b.actions.setRunSql);
2745
- const { updateFilter: i } = Re(), o = r == null ? void 0 : r.find((b) => b.id === l.filterId), { data: c, isLoading: m, isFetching: x } = Fe(a), { setCard: j } = ne(), { data: v } = Vs(a);
2755
+ const a = u((v) => v.card), t = ((N = a.customCardPreferences) == null ? void 0 : N.showCardHeader) ?? !0, l = u((v) => v.frame), r = k((v) => v.dashboard.filters);
2756
+ u((v) => v.actions.setRunSql);
2757
+ const { updateFilter: i } = Re(), o = r == null ? void 0 : r.find((v) => v.id === l.filterId), { data: c, isLoading: m, isFetching: x } = Fe(a), { setCard: j } = ne(), { data: b } = Vs(a);
2746
2758
  if (!a.id) return null;
2747
2759
  let d;
2748
2760
  c != null && c.records && (c == null ? void 0 : c.records.length) > 0 && (d = Ca({
@@ -2751,32 +2763,32 @@ function Ba({
2751
2763
  cfg: a.cfg,
2752
2764
  customCfg: a.customCfg,
2753
2765
  preferences: a.preferences,
2754
- topoJson: v
2766
+ topoJson: b
2755
2767
  }));
2756
- function f(b) {
2757
- return /* @__PURE__ */ e.jsx(zl, { card: b });
2768
+ function f(v) {
2769
+ return /* @__PURE__ */ e.jsx(Il, { card: v });
2758
2770
  }
2759
2771
  function g() {
2760
- var b;
2772
+ var v;
2761
2773
  if (c != null && c.records && (c == null ? void 0 : c.records.length) === 0 && !m && !x)
2762
2774
  return /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-2", children: [
2763
- /* @__PURE__ */ e.jsx(Bt, { className: "size-8 text-muted-foreground" }),
2775
+ /* @__PURE__ */ e.jsx($t, { className: "size-8 text-muted-foreground" }),
2764
2776
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "No records to display" })
2765
2777
  ] });
2766
2778
  if (a.type === "custom")
2767
2779
  return f(a);
2768
2780
  if (!["table", "custom"].includes(a.type) && d)
2769
2781
  return /* @__PURE__ */ e.jsx(
2770
- $t,
2782
+ Bt,
2771
2783
  {
2772
2784
  cfg: d
2773
2785
  },
2774
- JSON.stringify(d) + JSON.stringify(a.preferences) + ((b = a == null ? void 0 : a.preferences) == null ? void 0 : b.customVisualCode)
2786
+ JSON.stringify(d) + JSON.stringify(a.preferences) + ((v = a == null ? void 0 : a.preferences) == null ? void 0 : v.customVisualCode)
2775
2787
  );
2776
2788
  if (a.type === "table" && (c != null && c.records) && (c == null ? void 0 : c.records.length) > 0)
2777
2789
  return /* @__PURE__ */ e.jsxs(ve, { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: [
2778
- /* @__PURE__ */ e.jsx(Ut, { card: a, data: c == null ? void 0 : c.records }),
2779
- /* @__PURE__ */ e.jsx(Je, { orientation: "horizontal" })
2790
+ /* @__PURE__ */ e.jsx(Gt, { card: a, data: c == null ? void 0 : c.records }),
2791
+ /* @__PURE__ */ e.jsx(We, { orientation: "horizontal" })
2780
2792
  ] });
2781
2793
  }
2782
2794
  return /* @__PURE__ */ e.jsxs(
@@ -2792,7 +2804,7 @@ function Ba({
2792
2804
  es,
2793
2805
  {
2794
2806
  text: a.title,
2795
- onSave: (b) => j({ ...a, title: b }),
2807
+ onSave: (v) => j({ ...a, title: v }),
2796
2808
  children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(_t, { className: "text-base", children: a.title || "Edit title..." }) })
2797
2809
  },
2798
2810
  a.title
@@ -2801,7 +2813,7 @@ function Ba({
2801
2813
  es,
2802
2814
  {
2803
2815
  text: a.description || "",
2804
- onSave: (b) => j({ ...a, description: b }),
2816
+ onSave: (v) => j({ ...a, description: v }),
2805
2817
  children: /* @__PURE__ */ e.jsx(Ht, { children: a.description || "Edit description..." })
2806
2818
  },
2807
2819
  a.description
@@ -2813,7 +2825,7 @@ function Ba({
2813
2825
  {
2814
2826
  className: "my-1",
2815
2827
  text: o.title || o.column,
2816
- onSave: (b) => i({ ...o, title: b }),
2828
+ onSave: (v) => i({ ...o, title: v }),
2817
2829
  children: /* @__PURE__ */ e.jsx(H, { children: o.title })
2818
2830
  }
2819
2831
  ),
@@ -2845,7 +2857,7 @@ const ra = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2845
2857
  value: n,
2846
2858
  onChange: a
2847
2859
  }
2848
- ), Il = () => /* @__PURE__ */ e.jsxs(zs, { children: [
2860
+ ), Ol = () => /* @__PURE__ */ e.jsxs(zs, { children: [
2849
2861
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(Is, { children: "Customize Card" }) }),
2850
2862
  /* @__PURE__ */ e.jsxs(ca, { children: [
2851
2863
  "See the configuration options and documentation",
@@ -2859,7 +2871,7 @@ const ra = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2859
2871
  }
2860
2872
  )
2861
2873
  ] })
2862
- ] }), Ol = ({
2874
+ ] }), Dl = ({
2863
2875
  defaultConfig: s,
2864
2876
  customCode: n,
2865
2877
  customConfig: a,
@@ -2877,7 +2889,7 @@ const ra = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2877
2889
  value: "output",
2878
2890
  className: "mt-0 grow rounded-b border border-t-0 p-2",
2879
2891
  children: /* @__PURE__ */ e.jsx(
2880
- Wt,
2892
+ Jt,
2881
2893
  {
2882
2894
  readOnly: !0,
2883
2895
  value: s,
@@ -2916,7 +2928,7 @@ const ra = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2916
2928
  )
2917
2929
  }
2918
2930
  )
2919
- ] }), Dl = ({
2931
+ ] }), Tl = ({
2920
2932
  error: s,
2921
2933
  hasCustomConfig: n,
2922
2934
  onReset: a,
@@ -2924,28 +2936,28 @@ const ra = ({ language: s, value: n, onChange: a }) => /* @__PURE__ */ e.jsx(
2924
2936
  onClose: l
2925
2937
  }) => /* @__PURE__ */ e.jsxs(da, { className: "flex items-center", children: [
2926
2938
  /* @__PURE__ */ e.jsx(H, { className: "mr-2 text-red-500", children: s }),
2927
- /* @__PURE__ */ e.jsx(D, { disabled: !n, onClick: a, variant: "outline", children: "Reset" }),
2928
- /* @__PURE__ */ e.jsx(D, { onClick: t, variant: "outline", children: "Apply" }),
2929
- /* @__PURE__ */ e.jsx(D, { onClick: l, variant: "outline", children: "Close" })
2939
+ /* @__PURE__ */ e.jsx(T, { disabled: !n, onClick: a, variant: "outline", children: "Reset" }),
2940
+ /* @__PURE__ */ e.jsx(T, { onClick: t, variant: "outline", children: "Apply" }),
2941
+ /* @__PURE__ */ e.jsx(T, { onClick: l, variant: "outline", children: "Close" })
2930
2942
  ] });
2931
2943
  function Ml() {
2932
- const [s, n] = q(!1), [a, t] = q(""), [l, r] = q(""), [i, o] = q(""), [c, m] = q(""), x = u((S) => S.card), j = u((S) => S.card.customCfg), { data: v } = Fe(x), { data: d } = Vs(x), { setCardCustomCfg: f, setCustomVisualCode: g } = ne(), N = (S, w) => Ce.transform(S, (O, R, C) => {
2944
+ const [s, n] = q(!1), [a, t] = q(""), [l, r] = q(""), [i, o] = q(""), [c, m] = q(""), x = u((S) => S.card), j = u((S) => S.card.customCfg), { data: b } = Fe(x), { data: d } = Vs(x), { setCardCustomCfg: f, setCustomVisualCode: g } = ne(), N = (S, w) => Ce.transform(S, (D, R, C) => {
2933
2945
  if (!Ce.isEqual(R, w[C]))
2934
2946
  if (Ce.isArray(R) && Ce.isArray(w[C]))
2935
- O[C] = w[C];
2947
+ D[C] = w[C];
2936
2948
  else if (Ce.isObject(R) && Ce.isObject(w[C])) {
2937
2949
  const h = N(R, w[C]);
2938
- Ce.isEmpty(h) || (O[C] = h);
2950
+ Ce.isEmpty(h) || (D[C] = h);
2939
2951
  } else
2940
- O[C] = w[C];
2941
- }), b = (S) => {
2942
- var w, O;
2952
+ D[C] = w[C];
2953
+ }), v = (S) => {
2954
+ var w, D;
2943
2955
  return JSON.stringify(
2944
2956
  {
2945
2957
  ...S,
2946
2958
  data: {
2947
2959
  ...S.data,
2948
- datasets: (O = (w = S.data) == null ? void 0 : w.datasets) == null ? void 0 : O.map((R) => ({
2960
+ datasets: (D = (w = S.data) == null ? void 0 : w.datasets) == null ? void 0 : D.map((R) => ({
2949
2961
  ...R,
2950
2962
  data: []
2951
2963
  }))
@@ -2955,19 +2967,19 @@ function Ml() {
2955
2967
  2
2956
2968
  );
2957
2969
  }, V = () => {
2958
- var w, O;
2959
- if (!((w = v == null ? void 0 : v.records) != null && w.length)) return;
2970
+ var w, D;
2971
+ if (!((w = b == null ? void 0 : b.records) != null && w.length)) return;
2960
2972
  const S = Ca({
2961
- data: v.records,
2973
+ data: b.records,
2962
2974
  cardType: x.type,
2963
2975
  cfg: x.cfg,
2964
2976
  preferences: x.preferences,
2965
2977
  topoJson: d
2966
2978
  });
2967
2979
  if (S) {
2968
- t(b(S)), o(((O = x.preferences) == null ? void 0 : O.customVisualCode) || "");
2980
+ t(v(S)), o(((D = x.preferences) == null ? void 0 : D.customVisualCode) || "");
2969
2981
  const R = Ce.merge(S, j);
2970
- r(b(R));
2982
+ r(v(R));
2971
2983
  }
2972
2984
  }, F = () => {
2973
2985
  try {
@@ -2986,21 +2998,21 @@ function Ml() {
2986
2998
  };
2987
2999
  return /* @__PURE__ */ e.jsxs(Ss, { open: s, onOpenChange: n, children: [
2988
3000
  /* @__PURE__ */ e.jsx(ws, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2989
- D,
3001
+ T,
2990
3002
  {
2991
3003
  onClick: V,
2992
3004
  size: "sm",
2993
3005
  variant: "outline",
2994
3006
  className: j ? "border-foreground/50 dark:border-foreground/70" : "",
2995
- children: /* @__PURE__ */ e.jsx(Gt, { className: "h-4 w-4" })
3007
+ children: /* @__PURE__ */ e.jsx(Ut, { className: "h-4 w-4" })
2996
3008
  }
2997
3009
  ) }),
2998
3010
  /* @__PURE__ */ e.jsxs(ks, { className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]", children: [
2999
- /* @__PURE__ */ e.jsx(Il, {}),
3011
+ /* @__PURE__ */ e.jsx(Ol, {}),
3000
3012
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
3001
- /* @__PURE__ */ e.jsx(us, { FallbackComponent: wa, children: /* @__PURE__ */ e.jsx(Ba, { className: "w-1/2 rounded shadow-none" }) }),
3013
+ /* @__PURE__ */ e.jsx(us, { FallbackComponent: wa, children: /* @__PURE__ */ e.jsx($a, { className: "w-1/2 rounded shadow-none" }) }),
3002
3014
  /* @__PURE__ */ e.jsx(
3003
- Ol,
3015
+ Dl,
3004
3016
  {
3005
3017
  defaultConfig: a,
3006
3018
  customCode: i,
@@ -3011,7 +3023,7 @@ function Ml() {
3011
3023
  )
3012
3024
  ] }),
3013
3025
  /* @__PURE__ */ e.jsx(
3014
- Dl,
3026
+ Tl,
3015
3027
  {
3016
3028
  error: c,
3017
3029
  hasCustomConfig: !!j,
@@ -3025,19 +3037,19 @@ function Ml() {
3025
3037
  ] })
3026
3038
  ] });
3027
3039
  }
3028
- function $a(s) {
3040
+ function Ba(s) {
3029
3041
  return ye({ 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);
3030
3042
  }
3031
- function Ua(s) {
3043
+ function Ga(s) {
3032
3044
  return ye({ 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);
3033
3045
  }
3034
- function Ga(s) {
3046
+ function Ua(s) {
3035
3047
  return ye({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
3036
3048
  }
3037
- function Wa(s) {
3049
+ function Ja(s) {
3038
3050
  return ye({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
3039
3051
  }
3040
- function Ja(s) {
3052
+ function Wa(s) {
3041
3053
  return ye({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(s);
3042
3054
  }
3043
3055
  function Ka(s) {
@@ -3053,20 +3065,20 @@ function Xa(s) {
3053
3065
  const [n, a] = q(null);
3054
3066
  return se(() => {
3055
3067
  s && (async () => {
3056
- const r = (await import("./lucide-react-Ds4vVLCA.js"))[s];
3068
+ const r = (await import("./lucide-react-DGNkJZmc.js"))[s];
3057
3069
  a(r);
3058
3070
  })();
3059
3071
  }, [s]), n;
3060
3072
  }
3061
3073
  function Ya() {
3062
- const { authToken: s } = Ie(), { data: n, isLoading: a, isFetching: t, isError: l } = Me({
3074
+ const { authToken: s } = Ie(), { data: n, isLoading: a, isFetching: t, isError: l } = Te({
3063
3075
  queryKey: ["plugins", s == null ? void 0 : s.accessToken],
3064
- queryFn: () => Jt(s == null ? void 0 : s.accessToken)
3076
+ queryFn: () => Wt(s == null ? void 0 : s.accessToken)
3065
3077
  // staleTime: Infinity,
3066
3078
  });
3067
3079
  return { data: n, isLoading: a, isFetching: t, isError: l };
3068
3080
  }
3069
- function Tl({
3081
+ function Fl({
3070
3082
  onChartTypeChange: s
3071
3083
  }) {
3072
3084
  const [n, a] = q([]), { data: t } = Ya();
@@ -3087,7 +3099,7 @@ function Tl({
3087
3099
  }, [t]), n.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3088
3100
  /* @__PURE__ */ e.jsx(ke, { className: "my-2" }),
3089
3101
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: n.map((l, r) => /* @__PURE__ */ e.jsx(
3090
- Fl,
3102
+ Ll,
3091
3103
  {
3092
3104
  text: l.name,
3093
3105
  onClick: () => s("custom", l),
@@ -3097,19 +3109,19 @@ function Tl({
3097
3109
  )) })
3098
3110
  ] });
3099
3111
  }
3100
- const Fl = ({
3112
+ const Ll = ({
3101
3113
  text: s,
3102
3114
  icon: n,
3103
3115
  onClick: a
3104
3116
  }) => {
3105
3117
  const t = Xa(n || ""), l = s.charAt(0).toUpperCase();
3106
- return /* @__PURE__ */ e.jsx(D, { onClick: a, title: s, variant: "ghost", children: t ? /* @__PURE__ */ e.jsx(t, { className: "h-4 w-4" }) : l });
3118
+ return /* @__PURE__ */ e.jsx(T, { onClick: a, title: s, variant: "ghost", children: t ? /* @__PURE__ */ e.jsx(t, { className: "h-4 w-4" }) : l });
3107
3119
  };
3108
- function Ll() {
3120
+ function El() {
3109
3121
  var x, j;
3110
- const [s, n] = q(!1), a = u((v) => v.card), t = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: i } = u((v) => v.actions), { setCardCustomCfg: o, setCustomCardPreferences: c } = ne();
3111
- function m(v, d) {
3112
- o(null), r({}), l(v), d && c({
3122
+ const [s, n] = q(!1), a = u((b) => b.card), t = a.type, { setCardType: l, setCardPreferences: r, setChartOrientation: i } = u((b) => b.actions), { setCardCustomCfg: o, setCustomCardPreferences: c } = ne();
3123
+ function m(b, d) {
3124
+ o(null), r({}), l(b), d && c({
3113
3125
  type: "component",
3114
3126
  visualType: "single",
3115
3127
  url: d.url,
@@ -3118,8 +3130,8 @@ function Ll() {
3118
3130
  }), n(!1);
3119
3131
  }
3120
3132
  return /* @__PURE__ */ e.jsxs(ms, { open: s, onOpenChange: n, children: [
3121
- /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(D, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
3122
- El,
3133
+ /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(T, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
3134
+ Vl,
3123
3135
  {
3124
3136
  className: "h-4 w-4",
3125
3137
  chartType: t,
@@ -3130,7 +3142,7 @@ function Ll() {
3130
3142
  /* @__PURE__ */ e.jsxs(xs, { className: "w-50", children: [
3131
3143
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-4 place-items-center", children: [
3132
3144
  /* @__PURE__ */ e.jsx(
3133
- D,
3145
+ T,
3134
3146
  {
3135
3147
  onClick: () => m("bar"),
3136
3148
  className: "font-normal",
@@ -3139,7 +3151,7 @@ function Ll() {
3139
3151
  }
3140
3152
  ),
3141
3153
  /* @__PURE__ */ e.jsx(
3142
- D,
3154
+ T,
3143
3155
  {
3144
3156
  onClick: () => m("line"),
3145
3157
  variant: "ghost",
@@ -3147,7 +3159,7 @@ function Ll() {
3147
3159
  }
3148
3160
  ),
3149
3161
  /* @__PURE__ */ e.jsx(
3150
- D,
3162
+ T,
3151
3163
  {
3152
3164
  onClick: () => m("stackedBar"),
3153
3165
  variant: "ghost",
@@ -3155,15 +3167,15 @@ function Ll() {
3155
3167
  }
3156
3168
  ),
3157
3169
  /* @__PURE__ */ e.jsx(
3158
- D,
3170
+ T,
3159
3171
  {
3160
3172
  onClick: () => m("stackedLine"),
3161
3173
  variant: "ghost",
3162
- children: /* @__PURE__ */ e.jsx(Ja, { className: "size-5", strokeWidth: 0 })
3174
+ children: /* @__PURE__ */ e.jsx(Wa, { className: "size-5", strokeWidth: 0 })
3163
3175
  }
3164
3176
  ),
3165
3177
  /* @__PURE__ */ e.jsx(
3166
- D,
3178
+ T,
3167
3179
  {
3168
3180
  onClick: () => m("scatter"),
3169
3181
  variant: "ghost",
@@ -3171,15 +3183,15 @@ function Ll() {
3171
3183
  }
3172
3184
  ),
3173
3185
  /* @__PURE__ */ e.jsx(
3174
- D,
3186
+ T,
3175
3187
  {
3176
3188
  onClick: () => m("bubble"),
3177
3189
  variant: "ghost",
3178
- children: /* @__PURE__ */ e.jsx(Wa, { className: "size-4" })
3190
+ children: /* @__PURE__ */ e.jsx(Ja, { className: "size-4" })
3179
3191
  }
3180
3192
  ),
3181
3193
  /* @__PURE__ */ e.jsx(
3182
- D,
3194
+ T,
3183
3195
  {
3184
3196
  onClick: () => m("pie"),
3185
3197
  variant: "ghost",
@@ -3187,20 +3199,20 @@ function Ll() {
3187
3199
  }
3188
3200
  ),
3189
3201
  /* @__PURE__ */ e.jsx(
3190
- D,
3202
+ T,
3191
3203
  {
3192
3204
  onClick: () => m("doughnut"),
3193
3205
  variant: "ghost",
3194
- children: /* @__PURE__ */ e.jsx(Ua, { className: "size-5", strokeWidth: 1 })
3206
+ children: /* @__PURE__ */ e.jsx(Ga, { className: "size-5", strokeWidth: 1 })
3195
3207
  }
3196
3208
  ),
3197
3209
  /* @__PURE__ */ e.jsx(
3198
- D,
3210
+ T,
3199
3211
  {
3200
3212
  onClick: () => m("radar"),
3201
3213
  variant: "ghost",
3202
3214
  children: /* @__PURE__ */ e.jsx(
3203
- $a,
3215
+ Ba,
3204
3216
  {
3205
3217
  className: "size-5 font-extralight",
3206
3218
  strokeWidth: 0.5
@@ -3209,15 +3221,15 @@ function Ll() {
3209
3221
  }
3210
3222
  ),
3211
3223
  /* @__PURE__ */ e.jsx(
3212
- D,
3224
+ T,
3213
3225
  {
3214
3226
  onClick: () => m("polarArea"),
3215
3227
  variant: "ghost",
3216
- children: /* @__PURE__ */ e.jsx(Ga, { className: "size-5" })
3228
+ children: /* @__PURE__ */ e.jsx(Ua, { className: "size-5" })
3217
3229
  }
3218
3230
  ),
3219
3231
  /* @__PURE__ */ e.jsx(
3220
- D,
3232
+ T,
3221
3233
  {
3222
3234
  onClick: () => m("pyramid"),
3223
3235
  variant: "ghost",
@@ -3225,15 +3237,15 @@ function Ll() {
3225
3237
  }
3226
3238
  ),
3227
3239
  /* @__PURE__ */ e.jsx(
3228
- D,
3240
+ T,
3229
3241
  {
3230
3242
  onClick: () => m("range"),
3231
3243
  variant: "ghost",
3232
- children: /* @__PURE__ */ e.jsx(Ta, { className: "size-5" })
3244
+ children: /* @__PURE__ */ e.jsx(Ma, { className: "size-5" })
3233
3245
  }
3234
3246
  ),
3235
3247
  /* @__PURE__ */ e.jsx(
3236
- D,
3248
+ T,
3237
3249
  {
3238
3250
  onClick: () => m("table"),
3239
3251
  variant: "ghost",
@@ -3241,7 +3253,7 @@ function Ll() {
3241
3253
  }
3242
3254
  ),
3243
3255
  /* @__PURE__ */ e.jsx(
3244
- D,
3256
+ T,
3245
3257
  {
3246
3258
  onClick: () => m("kpi"),
3247
3259
  variant: "ghost",
@@ -3249,15 +3261,15 @@ function Ll() {
3249
3261
  }
3250
3262
  ),
3251
3263
  /* @__PURE__ */ e.jsx(
3252
- D,
3264
+ T,
3253
3265
  {
3254
3266
  onClick: () => m("text"),
3255
3267
  variant: "ghost",
3256
- children: /* @__PURE__ */ e.jsx(Bs, { className: "size-4" })
3268
+ children: /* @__PURE__ */ e.jsx($s, { className: "size-4" })
3257
3269
  }
3258
3270
  ),
3259
3271
  /* @__PURE__ */ e.jsx(
3260
- D,
3272
+ T,
3261
3273
  {
3262
3274
  onClick: () => m("map"),
3263
3275
  variant: "ghost",
@@ -3265,7 +3277,7 @@ function Ll() {
3265
3277
  }
3266
3278
  ),
3267
3279
  /* @__PURE__ */ e.jsx(
3268
- D,
3280
+ T,
3269
3281
  {
3270
3282
  onClick: () => m("custom"),
3271
3283
  variant: "ghost",
@@ -3273,11 +3285,11 @@ function Ll() {
3273
3285
  }
3274
3286
  )
3275
3287
  ] }),
3276
- /* @__PURE__ */ e.jsx(Tl, { onChartTypeChange: m })
3288
+ /* @__PURE__ */ e.jsx(Fl, { onChartTypeChange: m })
3277
3289
  ] })
3278
3290
  ] });
3279
3291
  }
3280
- function El({
3292
+ function Vl({
3281
3293
  chartType: s,
3282
3294
  className: n,
3283
3295
  customIcon: a,
@@ -3292,27 +3304,27 @@ function El({
3292
3304
  case "pie":
3293
3305
  return /* @__PURE__ */ e.jsx(Fa, { className: n });
3294
3306
  case "radar":
3295
- return /* @__PURE__ */ e.jsx($a, { className: n });
3307
+ return /* @__PURE__ */ e.jsx(Ba, { className: n });
3296
3308
  case "scatter":
3297
3309
  return /* @__PURE__ */ e.jsx(La, { className: n });
3298
3310
  case "bubble":
3299
- return /* @__PURE__ */ e.jsx(Wa, { className: n });
3311
+ return /* @__PURE__ */ e.jsx(Ja, { className: n });
3300
3312
  case "doughnut":
3301
- return /* @__PURE__ */ e.jsx(Ua, { className: n });
3313
+ return /* @__PURE__ */ e.jsx(Ga, { className: n });
3302
3314
  case "stackedBar":
3303
3315
  return /* @__PURE__ */ e.jsx(Ka, { className: "size-4 text-foreground/70" });
3304
3316
  case "stackedLine":
3305
- return /* @__PURE__ */ e.jsx(Ja, { className: "size-4 text-foreground/70" });
3317
+ return /* @__PURE__ */ e.jsx(Wa, { className: "size-4 text-foreground/70" });
3306
3318
  case "polarArea":
3307
- return /* @__PURE__ */ e.jsx(Ga, { className: n });
3319
+ return /* @__PURE__ */ e.jsx(Ua, { className: n });
3308
3320
  case "pyramid":
3309
3321
  return /* @__PURE__ */ e.jsx(Za, { className: n });
3310
3322
  case "range":
3311
- return /* @__PURE__ */ e.jsx(Ta, { className: n });
3323
+ return /* @__PURE__ */ e.jsx(Ma, { className: n });
3312
3324
  case "kpi":
3313
3325
  return /* @__PURE__ */ e.jsx(Qa, { className: n });
3314
3326
  case "text":
3315
- return /* @__PURE__ */ e.jsx(Bs, { className: n });
3327
+ return /* @__PURE__ */ e.jsx($s, { className: n });
3316
3328
  case "map":
3317
3329
  return /* @__PURE__ */ e.jsx(Ea, { className: n });
3318
3330
  case "custom":
@@ -3321,16 +3333,16 @@ function El({
3321
3333
  return /* @__PURE__ */ e.jsx(Ps, { className: n });
3322
3334
  }
3323
3335
  }
3324
- function Vl() {
3336
+ function Al() {
3325
3337
  var n;
3326
3338
  const s = u((a) => a.card);
3327
3339
  return (n = s.customCardPreferences) == null || n.showCardHeader, ne(), /* @__PURE__ */ e.jsxs(Os, { children: [
3328
3340
  /* @__PURE__ */ e.jsx(Ds, { asChild: !0, children: /* @__PURE__ */ e.jsx(Hs, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
3329
- /* @__PURE__ */ e.jsx(Ms, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ e.jsxs(
3341
+ /* @__PURE__ */ e.jsx(Ts, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ e.jsxs(
3330
3342
  Qt,
3331
3343
  {
3332
3344
  onClick: () => {
3333
- navigator.clipboard.writeText(s.id), We.success("Card ID copied to clipboard");
3345
+ navigator.clipboard.writeText(s.id), Je.success("Card ID copied to clipboard");
3334
3346
  },
3335
3347
  className: "cursor-pointer space-x-2",
3336
3348
  children: [
@@ -3345,12 +3357,12 @@ function ia() {
3345
3357
  var C;
3346
3358
  const s = u((h) => h.frame), n = u((h) => h.card), a = u((h) => h.isShowingVisual), t = u((h) => h.isSqlRunning), l = u((h) => h.pythonStdOut);
3347
3359
  u((h) => h.actions.setRunSql);
3348
- const { setFrame: r, setCard: i, updateCardInFrame: o, setActiveTabCardId: c } = ne(), { data: m, isLoading: x, isFetching: j, error: v } = Fe(n);
3360
+ const { setFrame: r, setCard: i, updateCardInFrame: o, setActiveTabCardId: c } = ne(), { data: m, isLoading: x, isFetching: j, error: b } = Fe(n);
3349
3361
  if (!n) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
3350
3362
  function d() {
3351
3363
  const h = {
3352
3364
  connectionId: n.connectionId,
3353
- id: Ge(),
3365
+ id: Ue(),
3354
3366
  title: "Title",
3355
3367
  description: "Description",
3356
3368
  preferences: {
@@ -3378,22 +3390,22 @@ function ia() {
3378
3390
  function g() {
3379
3391
  const h = {
3380
3392
  ...n,
3381
- id: Ge(),
3393
+ id: Ue(),
3382
3394
  title: `${n.title} Copy`,
3383
3395
  tabTitle: `${n.tabTitle || n.title} Copy`
3384
3396
  };
3385
3397
  f(h);
3386
3398
  }
3387
3399
  function N(h) {
3388
- const p = s.cards.filter((A) => A.id !== h), z = p[0], I = {
3400
+ const p = s.cards.filter((A) => A.id !== h), I = p[0], O = {
3389
3401
  ...s,
3390
3402
  cards: p,
3391
3403
  // update the active card to the first card in the frame
3392
- activeCardId: z.id
3404
+ activeCardId: I.id
3393
3405
  };
3394
- r(I), c(z.id), i(z);
3406
+ r(O), c(I.id), i(I);
3395
3407
  }
3396
- function b(h) {
3408
+ function v(h) {
3397
3409
  c(h);
3398
3410
  }
3399
3411
  const V = (h, p) => {
@@ -3401,31 +3413,31 @@ function ia() {
3401
3413
  }, F = (h) => {
3402
3414
  h.preventDefault();
3403
3415
  }, S = (h, p) => {
3404
- const z = h.dataTransfer.getData("tabIndex");
3405
- if (z === p.toString()) return;
3406
- const I = Array.from(s.cards), [A] = I.splice(parseInt(z), 1);
3407
- I.splice(p, 0, A), r({ ...s, cards: I });
3416
+ const I = h.dataTransfer.getData("tabIndex");
3417
+ if (I === p.toString()) return;
3418
+ const O = Array.from(s.cards), [A] = O.splice(parseInt(I), 1);
3419
+ O.splice(p, 0, A), r({ ...s, cards: O });
3408
3420
  };
3409
3421
  function w(h, p) {
3410
3422
  return h.cards.length === 1 && (p.displayTab === !0 || p.displayTab === void 0) || h.activeCardId !== p.id && (p.displayTab === !0 || p.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
3411
3423
  "div",
3412
3424
  {
3413
3425
  onClick: () => {
3414
- const z = p.displayTab === void 0 ? !1 : !p.displayTab;
3415
- i({ ...p, displayTab: z }), o({
3426
+ const I = p.displayTab === void 0 ? !1 : !p.displayTab;
3427
+ i({ ...p, displayTab: I }), o({
3416
3428
  ...p,
3417
- displayTab: z
3429
+ displayTab: I
3418
3430
  });
3419
3431
  },
3420
3432
  children: p.displayTab === !0 || p.displayTab === void 0 ? /* @__PURE__ */ e.jsx(sn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(Vn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
3421
3433
  }
3422
3434
  );
3423
3435
  }
3424
- function O() {
3436
+ function D() {
3425
3437
  return /* @__PURE__ */ e.jsxs(
3426
3438
  ka,
3427
3439
  {
3428
- onValueChange: b,
3440
+ onValueChange: v,
3429
3441
  value: s.activeCardId,
3430
3442
  className: "flex grow flex-col",
3431
3443
  children: [
@@ -3435,16 +3447,16 @@ function ia() {
3435
3447
  es,
3436
3448
  {
3437
3449
  text: h.tabTitle || h.title,
3438
- onSave: (z) => {
3439
- i({ ...n, tabTitle: z }), o({ ...n, tabTitle: z });
3450
+ onSave: (I) => {
3451
+ i({ ...n, tabTitle: I }), o({ ...n, tabTitle: I });
3440
3452
  },
3441
3453
  children: /* @__PURE__ */ e.jsxs(
3442
3454
  ss,
3443
3455
  {
3444
3456
  draggable: !0,
3445
- onDragStart: (z) => V(z, p),
3457
+ onDragStart: (I) => V(I, p),
3446
3458
  onDragOver: F,
3447
- onDrop: (z) => S(z, p),
3459
+ onDrop: (I) => S(I, p),
3448
3460
  className: "",
3449
3461
  value: h.id,
3450
3462
  children: [
@@ -3464,7 +3476,7 @@ function ia() {
3464
3476
  h.id
3465
3477
  )),
3466
3478
  /* @__PURE__ */ e.jsx(
3467
- D,
3479
+ T,
3468
3480
  {
3469
3481
  className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
3470
3482
  variant: "outline",
@@ -3473,7 +3485,7 @@ function ia() {
3473
3485
  }
3474
3486
  ),
3475
3487
  /* @__PURE__ */ e.jsx(
3476
- D,
3488
+ T,
3477
3489
  {
3478
3490
  className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
3479
3491
  variant: "outline",
@@ -3494,19 +3506,19 @@ function ia() {
3494
3506
  card: n,
3495
3507
  data: m == null ? void 0 : m.records
3496
3508
  }
3497
- ) }) }) }) : /* @__PURE__ */ e.jsx(us, { FallbackComponent: wa, children: /* @__PURE__ */ e.jsx(Ba, { className: "grow border-none shadow-none" }) });
3509
+ ) }) }) }) : /* @__PURE__ */ e.jsx(us, { FallbackComponent: wa, children: /* @__PURE__ */ e.jsx($a, { className: "grow border-none shadow-none" }) });
3498
3510
  }
3499
3511
  return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
3500
3512
  (x || j) && /* @__PURE__ */ e.jsx("div", { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto flex h-10 w-10 items-center justify-center rounded-md bg-muted", children: /* @__PURE__ */ e.jsx(Ke, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }),
3501
3513
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
3502
3514
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
3503
- /* @__PURE__ */ e.jsx(Ll, {}),
3515
+ /* @__PURE__ */ e.jsx(El, {}),
3504
3516
  !["table", "custom"].includes(n.type) && /* @__PURE__ */ e.jsx(Ml, {}),
3505
- /* @__PURE__ */ e.jsx(Vl, {})
3517
+ /* @__PURE__ */ e.jsx(Al, {})
3506
3518
  ] }),
3507
- /* @__PURE__ */ e.jsx(ql, {})
3519
+ /* @__PURE__ */ e.jsx(Rl, {})
3508
3520
  ] }),
3509
- a ? O() : /* @__PURE__ */ e.jsxs(
3521
+ a ? D() : /* @__PURE__ */ e.jsxs(
3510
3522
  ns,
3511
3523
  {
3512
3524
  className: "px-6",
@@ -3521,7 +3533,7 @@ function ia() {
3521
3533
  defaultSize: 30,
3522
3534
  minSize: 10,
3523
3535
  className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
3524
- children: l && /* @__PURE__ */ e.jsx(Al, {})
3536
+ children: l && /* @__PURE__ */ e.jsx(ql, {})
3525
3537
  }
3526
3538
  ),
3527
3539
  /* @__PURE__ */ e.jsx(ls, {})
@@ -3534,9 +3546,9 @@ function ia() {
3534
3546
  minSize: 10,
3535
3547
  className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
3536
3548
  children: /* @__PURE__ */ e.jsxs(ve, { className: "relative flex h-full min-h-0 w-full flex-1 basis-0", children: [
3537
- (m == null ? void 0 : m.records) && (m == null ? void 0 : m.records.length) > 0 && /* @__PURE__ */ e.jsx(kl, { data: (m == null ? void 0 : m.records) || [] }),
3538
- (v || (m == null ? void 0 : m.error)) && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs", children: (v == null ? void 0 : v.message) || ((C = m == null ? void 0 : m.error) == null ? void 0 : C.message) }),
3539
- /* @__PURE__ */ e.jsx(Je, { orientation: "horizontal" })
3549
+ (m == null ? void 0 : m.records) && (m == null ? void 0 : m.records.length) > 0 && /* @__PURE__ */ e.jsx(zl, { data: (m == null ? void 0 : m.records) || [] }),
3550
+ (b || (m == null ? void 0 : m.error)) && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-xs", children: (b == null ? void 0 : b.message) || ((C = m == null ? void 0 : m.error) == null ? void 0 : C.message) }),
3551
+ /* @__PURE__ */ e.jsx(We, { orientation: "horizontal" })
3540
3552
  ] })
3541
3553
  }
3542
3554
  )
@@ -3545,7 +3557,7 @@ function ia() {
3545
3557
  )
3546
3558
  ] });
3547
3559
  }
3548
- function Al() {
3560
+ function ql() {
3549
3561
  const s = u((a) => a.pythonStdOut);
3550
3562
  if (!s) return null;
3551
3563
  const n = s.replace(/\n/g, "<br>");
@@ -3553,11 +3565,11 @@ function Al() {
3553
3565
  /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 flex max-h-11 min-h-11 grow items-center border-b bg-muted px-3 font-mono text-xs font-semibold text-foreground/70", children: "Python Output" }),
3554
3566
  /* @__PURE__ */ e.jsxs(ve, { className: "overflow-y-auto px-2 pt-1 font-mono text-xs text-foreground/90", children: [
3555
3567
  /* @__PURE__ */ e.jsx("div", { dangerouslySetInnerHTML: { __html: n } }),
3556
- /* @__PURE__ */ e.jsx(Je, { orientation: "horizontal" })
3568
+ /* @__PURE__ */ e.jsx(We, { orientation: "horizontal" })
3557
3569
  ] })
3558
3570
  ] });
3559
3571
  }
3560
- function ql() {
3572
+ function Rl() {
3561
3573
  const s = u((a) => a.isShowingVisual), n = u(
3562
3574
  (a) => a.actions.setIsShowingVisual
3563
3575
  );
@@ -3574,7 +3586,7 @@ function ql() {
3574
3586
  )
3575
3587
  ] });
3576
3588
  }
3577
- function Rl({
3589
+ function _l({
3578
3590
  options: s,
3579
3591
  value: n,
3580
3592
  onValueChange: a
@@ -3587,7 +3599,7 @@ function Rl({
3587
3599
  className: "flex gap-4",
3588
3600
  defaultValue: s[0].value,
3589
3601
  children: s.map((t) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3590
- /* @__PURE__ */ e.jsx(Te, { value: t.value, id: t.value }),
3602
+ /* @__PURE__ */ e.jsx(Me, { value: t.value, id: t.value }),
3591
3603
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: t.value, children: t.label })
3592
3604
  ] }, t.value))
3593
3605
  }
@@ -3614,7 +3626,7 @@ function xe({
3614
3626
  ] }) })
3615
3627
  ] });
3616
3628
  }
3617
- function $e({
3629
+ function Be({
3618
3630
  children: s,
3619
3631
  summary: n,
3620
3632
  open: a,
@@ -3635,20 +3647,20 @@ function $e({
3635
3647
  }
3636
3648
  );
3637
3649
  }
3638
- function _l() {
3650
+ function Hl() {
3639
3651
  var g, N;
3640
3652
  const s = u(
3641
- (b) => b.card.customCardPreferences
3642
- ), { data: n } = Ya(), a = (n == null ? void 0 : n.plugins) || [], t = u((b) => b.card), l = u((b) => b.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: i } = ne(), { components: o, manifest: c } = Na(
3653
+ (v) => v.card.customCardPreferences
3654
+ ), { data: n } = Ya(), a = (n == null ? void 0 : n.plugins) || [], t = u((v) => v.card), l = u((v) => v.frame), r = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: i } = ne(), { components: o, manifest: c } = Na(
3643
3655
  (s == null ? void 0 : s.url) || ""
3644
3656
  ), m = (g = c == null ? void 0 : c.visuals) == null ? void 0 : g.find(
3645
- (b) => b.name === (s == null ? void 0 : s.componentName)
3657
+ (v) => v.name === (s == null ? void 0 : s.componentName)
3646
3658
  );
3647
- function x(b, V) {
3659
+ function x(v, V) {
3648
3660
  if (!s) return;
3649
3661
  const S = {
3650
3662
  ...(s == null ? void 0 : s.dataInputCardIds) || {},
3651
- [b]: {
3663
+ [v]: {
3652
3664
  cardId: V,
3653
3665
  hookRef: null
3654
3666
  }
@@ -3658,16 +3670,16 @@ function _l() {
3658
3670
  dataInputCardIds: S
3659
3671
  });
3660
3672
  }
3661
- function j(b) {
3673
+ function j(v) {
3662
3674
  var F, S;
3663
3675
  const V = (F = l == null ? void 0 : l.cards) == null ? void 0 : F.filter((w) => {
3664
- var O;
3665
- return ((O = w == null ? void 0 : w.customCardPreferences) == null ? void 0 : O.visualType) !== "multiple";
3676
+ var D;
3677
+ return ((D = w == null ? void 0 : w.customCardPreferences) == null ? void 0 : D.visualType) !== "multiple";
3666
3678
  }).map((w) => ({
3667
3679
  value: w.id,
3668
3680
  label: w.tabTitle || w.title
3669
3681
  }));
3670
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (S = b == null ? void 0 : b.dataInputs) == null ? void 0 : S.map((w, O) => {
3682
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (S = v == null ? void 0 : v.dataInputs) == null ? void 0 : S.map((w, D) => {
3671
3683
  var R, C;
3672
3684
  return /* @__PURE__ */ e.jsxs(
3673
3685
  "div",
@@ -3681,65 +3693,65 @@ function _l() {
3681
3693
  className: "col-span-6 h-8 w-full justify-between",
3682
3694
  label: "",
3683
3695
  options: V || [],
3684
- value: ((C = (R = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : R[O]) == null ? void 0 : C.cardId) || "",
3685
- onValueChange: (h) => x(O, h)
3696
+ value: ((C = (R = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : R[D]) == null ? void 0 : C.cardId) || "",
3697
+ onValueChange: (h) => x(D, h)
3686
3698
  }
3687
3699
  )
3688
3700
  ]
3689
3701
  },
3690
- O + Math.random()
3702
+ D + Math.random()
3691
3703
  );
3692
3704
  }) });
3693
3705
  }
3694
- function v(b, V, F = []) {
3706
+ function b(v, V, F = []) {
3695
3707
  var S, w;
3696
- return s ? b === "input" ? /* @__PURE__ */ e.jsx(
3708
+ return s ? v === "input" ? /* @__PURE__ */ e.jsx(
3697
3709
  oe,
3698
3710
  {
3699
- className: `h-8 w-full ${Be}`,
3711
+ className: `h-8 w-full ${$e}`,
3700
3712
  value: ((S = s == null ? void 0 : s.settings) == null ? void 0 : S[V]) || "",
3701
- onChange: (O) => {
3713
+ onChange: (D) => {
3702
3714
  i({
3703
3715
  ...s,
3704
3716
  settings: {
3705
3717
  ...s == null ? void 0 : s.settings,
3706
- [V]: O.target.value
3718
+ [V]: D.target.value
3707
3719
  }
3708
3720
  });
3709
3721
  }
3710
3722
  },
3711
3723
  V
3712
- ) : b === "select" ? /* @__PURE__ */ e.jsx(
3724
+ ) : v === "select" ? /* @__PURE__ */ e.jsx(
3713
3725
  xe,
3714
3726
  {
3715
3727
  className: "h-8 w-full",
3716
3728
  label: "",
3717
3729
  options: F,
3718
3730
  value: ((w = s == null ? void 0 : s.settings) == null ? void 0 : w[V]) || "",
3719
- onValueChange: (O) => {
3731
+ onValueChange: (D) => {
3720
3732
  i({
3721
3733
  ...s,
3722
- settings: { ...s == null ? void 0 : s.settings, [V]: O }
3734
+ settings: { ...s == null ? void 0 : s.settings, [V]: D }
3723
3735
  });
3724
3736
  }
3725
3737
  }
3726
3738
  ) : null : null;
3727
3739
  }
3728
- function d(b) {
3729
- const V = Object.entries((b == null ? void 0 : b.settings) || {});
3740
+ function d(v) {
3741
+ const V = Object.entries((v == null ? void 0 : v.settings) || {});
3730
3742
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: V.map(([F, S]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3731
3743
  /* @__PURE__ */ e.jsx(H, { children: S.title }),
3732
- v(
3744
+ b(
3733
3745
  S.ui,
3734
3746
  F,
3735
3747
  S.options
3736
3748
  )
3737
3749
  ] }, F)) });
3738
3750
  }
3739
- function f(b) {
3751
+ function f(v) {
3740
3752
  s && i({
3741
3753
  ...s,
3742
- visualType: b,
3754
+ visualType: v,
3743
3755
  componentName: ""
3744
3756
  });
3745
3757
  }
@@ -3748,7 +3760,7 @@ function _l() {
3748
3760
  {
3749
3761
  className: "p-6",
3750
3762
  children: [
3751
- /* @__PURE__ */ e.jsx($e, { 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: [
3763
+ /* @__PURE__ */ e.jsx(Be, { 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: [
3752
3764
  /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
3753
3765
  xe,
3754
3766
  {
@@ -3756,17 +3768,17 @@ function _l() {
3756
3768
  label: "",
3757
3769
  options: a,
3758
3770
  value: (s == null ? void 0 : s.url) || "",
3759
- onValueChange: (b) => i({
3771
+ onValueChange: (v) => i({
3760
3772
  ...s || {
3761
3773
  url: "",
3762
3774
  componentName: ""
3763
3775
  },
3764
- url: b
3776
+ url: v
3765
3777
  })
3766
3778
  }
3767
3779
  ) }) }),
3768
3780
  ((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && /* @__PURE__ */ e.jsx(
3769
- Rl,
3781
+ _l,
3770
3782
  {
3771
3783
  options: [
3772
3784
  { value: "single", label: "Single Visual" },
@@ -3784,16 +3796,16 @@ function _l() {
3784
3796
  className: "h-8 w-full",
3785
3797
  label: "",
3786
3798
  options: (o == null ? void 0 : o.filter(
3787
- (b) => b.type === r
3788
- ).map((b) => ({
3789
- value: b.name,
3790
- label: b.name
3799
+ (v) => v.type === r
3800
+ ).map((v) => ({
3801
+ value: v.name,
3802
+ label: v.name
3791
3803
  }))) || [],
3792
3804
  value: s.componentName,
3793
- onValueChange: (b) => {
3794
- console.log("changing value", b), i({
3805
+ onValueChange: (v) => {
3806
+ console.log("changing value", v), i({
3795
3807
  ...s,
3796
- componentName: b
3808
+ componentName: v
3797
3809
  });
3798
3810
  }
3799
3811
  }
@@ -3801,7 +3813,7 @@ function _l() {
3801
3813
  ] }) })
3802
3814
  ] }) }) }),
3803
3815
  /* @__PURE__ */ e.jsx(ke, { className: "my-4" }),
3804
- ((N = t == null ? void 0 : t.customCardPreferences) == null ? void 0 : N.componentName) && /* @__PURE__ */ e.jsxs($e, { summary: "Component Settings", children: [
3816
+ ((N = t == null ? void 0 : t.customCardPreferences) == null ? void 0 : N.componentName) && /* @__PURE__ */ e.jsxs(Be, { summary: "Component Settings", children: [
3805
3817
  m && m.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3806
3818
  /* @__PURE__ */ e.jsx(H, { children: "Input Mapping" }),
3807
3819
  /* @__PURE__ */ e.jsx("div", { className: "px-2", children: j(m) })
@@ -3829,8 +3841,8 @@ function Ve() {
3829
3841
  i && n(new Array(i.length).fill(!1));
3830
3842
  }, [i]);
3831
3843
  function o(x, j) {
3832
- var v, d;
3833
- j ? a != null && a.onClickFilter && ((v = a == null ? void 0 : a.onClickFilter) == null ? void 0 : v.length) > 0 ? r({
3844
+ var b, d;
3845
+ j ? a != null && a.onClickFilter && ((b = a == null ? void 0 : a.onClickFilter) == null ? void 0 : b.length) > 0 ? r({
3834
3846
  ...a,
3835
3847
  onClickFilter: [
3836
3848
  ...a.onClickFilter,
@@ -3859,18 +3871,18 @@ function Ve() {
3859
3871
  }
3860
3872
  function c(x, j) {
3861
3873
  var d;
3862
- const v = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.map((f) => f.columnIndex === x ? {
3874
+ const b = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.map((f) => f.columnIndex === x ? {
3863
3875
  ...f,
3864
3876
  expression: j.target.value
3865
3877
  } : f);
3866
3878
  r({
3867
3879
  ...a,
3868
- onClickFilter: v
3880
+ onClickFilter: b
3869
3881
  });
3870
3882
  }
3871
3883
  function m(x) {
3872
- var j, v, d, f;
3873
- if (s != null && s[x] || (v = (j = a == null ? void 0 : a.onClickFilter) == null ? void 0 : j.find((g) => g.columnIndex === x)) != null && v.expression)
3884
+ var j, b, d, f;
3885
+ if (s != null && s[x] || (b = (j = a == null ? void 0 : a.onClickFilter) == null ? void 0 : j.find((g) => g.columnIndex === x)) != null && b.expression)
3874
3886
  return /* @__PURE__ */ e.jsx(
3875
3887
  oe,
3876
3888
  {
@@ -3885,7 +3897,7 @@ function Ve() {
3885
3897
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3886
3898
  /* @__PURE__ */ e.jsx(H, { children: "On Click" }),
3887
3899
  i == null ? void 0 : i.map((x, j) => {
3888
- var v, d;
3900
+ var b, d;
3889
3901
  return /* @__PURE__ */ e.jsx(
3890
3902
  "div",
3891
3903
  {
@@ -3895,7 +3907,7 @@ function Ve() {
3895
3907
  /* @__PURE__ */ e.jsx(
3896
3908
  As,
3897
3909
  {
3898
- checked: !!((v = a == null ? void 0 : a.onClickFilter) != null && v.find(
3910
+ checked: !!((b = a == null ? void 0 : a.onClickFilter) != null && b.find(
3899
3911
  (f) => f.columnIndex === j
3900
3912
  )),
3901
3913
  onCheckedChange: (f) => o(j, f)
@@ -3949,11 +3961,11 @@ function fs() {
3949
3961
  defaultValue: "x",
3950
3962
  children: [
3951
3963
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3952
- /* @__PURE__ */ e.jsx(Te, { value: "x", id: "r1" }),
3964
+ /* @__PURE__ */ e.jsx(Me, { value: "x", id: "r1" }),
3953
3965
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
3954
3966
  ] }),
3955
3967
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3956
- /* @__PURE__ */ e.jsx(Te, { value: "y", id: "r2" }),
3968
+ /* @__PURE__ */ e.jsx(Me, { value: "y", id: "r2" }),
3957
3969
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
3958
3970
  ] })
3959
3971
  ]
@@ -3967,7 +3979,7 @@ function oa(s, n) {
3967
3979
  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";
3968
3980
  }
3969
3981
  function et() {
3970
- var Y, G, le, ce, $, re;
3982
+ var Y, U, le, ce, B, re;
3971
3983
  const [s, n] = q(!1), a = u((E) => {
3972
3984
  var M;
3973
3985
  return (M = E.card) == null ? void 0 : M.preferences;
@@ -3977,24 +3989,24 @@ function et() {
3977
3989
  }), l = Ia(a, t), [r, i] = q(
3978
3990
  oa(a)
3979
3991
  ), [o, c] = q(
3980
- ((le = (G = (Y = a == null ? void 0 : a.chartOptions) == null ? void 0 : Y.scales) == null ? void 0 : G[l]) == null ? void 0 : le.min) || ""
3992
+ ((le = (U = (Y = a == null ? void 0 : a.chartOptions) == null ? void 0 : Y.scales) == null ? void 0 : U[l]) == null ? void 0 : le.min) || ""
3981
3993
  ), [m, x] = q(
3982
- ((re = ($ = (ce = a == null ? void 0 : a.chartOptions) == null ? void 0 : ce.scales) == null ? void 0 : $[l]) == null ? void 0 : re.max) || ""
3983
- ), [j, v] = q(o || m ? "custom" : "auto"), [d, f] = q(""), [g, N] = q(0), [b, V] = q(""), [F, S] = q(""), [w, O] = q(""), R = u(
3994
+ ((re = (B = (ce = a == null ? void 0 : a.chartOptions) == null ? void 0 : ce.scales) == null ? void 0 : B[l]) == null ? void 0 : re.max) || ""
3995
+ ), [j, b] = q(o || m ? "custom" : "auto"), [d, f] = q(""), [g, N] = q(0), [v, V] = q(""), [F, S] = q(""), [w, D] = q(""), R = u(
3984
3996
  (E) => E.actions.setCardPreferences
3985
3997
  ), { updateCardInFrame: C } = ne(), h = u((E) => E.card), p = u((E) => {
3986
3998
  var M;
3987
3999
  return (M = E.card) == null ? void 0 : M.type;
3988
- }), z = ["pie", "doughnut", "polarArea"].includes(p);
4000
+ }), I = ["pie", "doughnut", "polarArea"].includes(p);
3989
4001
  se(() => {
3990
- var E, M, ae, P, W, te, Ne, me, L, U, de, Ae, Oe, k;
4002
+ var E, M, ae, P, J, te, Ne, me, L, G, de, Ae, Oe, z;
3991
4003
  i(oa(a)), c(
3992
4004
  ((ae = (M = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : M[l]) == null ? void 0 : ae.min) === 0 ? 0 : ""
3993
- ), x(((te = (W = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : W[l]) == null ? void 0 : te.max) || ""), f(
3994
- ((U = (L = (me = (Ne = a == null ? void 0 : a.chartOptions) == null ? void 0 : Ne.scales) == null ? void 0 : me[l]) == null ? void 0 : L.ticks) == null ? void 0 : U.stepSize) || ""
3995
- ), N(((de = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : de.decimalPlaces) || 0), V(((Ae = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ae.suffix) || ""), S(((Oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Oe.currency) || ""), O(((k = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : k.locale) || "");
4005
+ ), x(((te = (J = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : J[l]) == null ? void 0 : te.max) || ""), f(
4006
+ ((G = (L = (me = (Ne = a == null ? void 0 : a.chartOptions) == null ? void 0 : Ne.scales) == null ? void 0 : me[l]) == null ? void 0 : L.ticks) == null ? void 0 : G.stepSize) || ""
4007
+ ), N(((de = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : de.decimalPlaces) || 0), V(((Ae = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Ae.suffix) || ""), S(((Oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Oe.currency) || ""), D(((z = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : z.locale) || "");
3996
4008
  }, [s, a, l]);
3997
- function I(E, M) {
4009
+ function O(E, M) {
3998
4010
  return M === "" || /^[0-9\b]+$/.test(M) ? Number(M) : Number(E);
3999
4011
  }
4000
4012
  function A() {
@@ -4033,7 +4045,7 @@ function et() {
4033
4045
  ]
4034
4046
  }
4035
4047
  ),
4036
- /* @__PURE__ */ e.jsxs(pe, { value: w, onValueChange: (M) => O(M), children: [
4048
+ /* @__PURE__ */ e.jsxs(pe, { value: w, onValueChange: (M) => D(M), children: [
4037
4049
  /* @__PURE__ */ e.jsx(
4038
4050
  fe,
4039
4051
  {
@@ -4061,7 +4073,7 @@ function et() {
4061
4073
  ] })
4062
4074
  ] });
4063
4075
  }
4064
- function B() {
4076
+ function $() {
4065
4077
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
4066
4078
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
4067
4079
  /* @__PURE__ */ e.jsx(H, { htmlFor: "range", children: "Range" }),
@@ -4070,7 +4082,7 @@ function et() {
4070
4082
  {
4071
4083
  id: "min",
4072
4084
  value: o,
4073
- onChange: (E) => c((M) => I(M, E.target.value)),
4085
+ onChange: (E) => c((M) => O(M, E.target.value)),
4074
4086
  className: `col-span-1 h-8 w-full ${Xe}`
4075
4087
  }
4076
4088
  ),
@@ -4078,7 +4090,7 @@ function et() {
4078
4090
  oe,
4079
4091
  {
4080
4092
  value: m,
4081
- onChange: (E) => x((M) => I(M, E.target.value)),
4093
+ onChange: (E) => x((M) => O(M, E.target.value)),
4082
4094
  id: "max",
4083
4095
  className: `col-span-1 h-8 w-full ${Xe}`
4084
4096
  }
@@ -4090,7 +4102,7 @@ function et() {
4090
4102
  oe,
4091
4103
  {
4092
4104
  value: d,
4093
- onChange: (E) => f((M) => I(M, E.target.value)),
4105
+ onChange: (E) => f((M) => O(M, E.target.value)),
4094
4106
  id: "step-size",
4095
4107
  className: `col-span-1 h-8 w-full ${Xe}`
4096
4108
  }
@@ -4123,7 +4135,7 @@ function et() {
4123
4135
  },
4124
4136
  numberAxisFormat: {
4125
4137
  decimalPlaces: g,
4126
- suffix: b,
4138
+ suffix: v,
4127
4139
  currency: F,
4128
4140
  locale: w
4129
4141
  }
@@ -4148,7 +4160,7 @@ function et() {
4148
4160
  /* @__PURE__ */ e.jsxs(
4149
4161
  pe,
4150
4162
  {
4151
- disabled: z,
4163
+ disabled: I,
4152
4164
  value: r,
4153
4165
  onValueChange: (E) => i(E),
4154
4166
  children: [
@@ -4167,30 +4179,30 @@ function et() {
4167
4179
  /* @__PURE__ */ e.jsxs(
4168
4180
  ps,
4169
4181
  {
4170
- disabled: z,
4182
+ disabled: I,
4171
4183
  id: "scale-option",
4172
4184
  value: j,
4173
- onValueChange: (E) => v(E),
4185
+ onValueChange: (E) => b(E),
4174
4186
  className: "col-span-2 flex gap-3",
4175
4187
  defaultValue: "x",
4176
4188
  children: [
4177
4189
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4178
- /* @__PURE__ */ e.jsx(Te, { value: "auto", id: "r1" }),
4190
+ /* @__PURE__ */ e.jsx(Me, { value: "auto", id: "r1" }),
4179
4191
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
4180
4192
  ] }),
4181
4193
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
4182
- /* @__PURE__ */ e.jsx(Te, { value: "custom", id: "r2" }),
4194
+ /* @__PURE__ */ e.jsx(Me, { value: "custom", id: "r2" }),
4183
4195
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
4184
4196
  ] })
4185
4197
  ]
4186
4198
  }
4187
4199
  )
4188
4200
  ] }),
4189
- j === "custom" && r == "linear" && B(),
4201
+ j === "custom" && r == "linear" && $(),
4190
4202
  A(),
4191
4203
  /* @__PURE__ */ e.jsx(nn, {}),
4192
4204
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
4193
- D,
4205
+ T,
4194
4206
  {
4195
4207
  onClick: X,
4196
4208
  variant: "secondary",
@@ -4202,7 +4214,7 @@ function et() {
4202
4214
  ] }) })
4203
4215
  ] });
4204
4216
  }
4205
- function Hl({ idx: s }) {
4217
+ function Pl({ idx: s }) {
4206
4218
  var o;
4207
4219
  const n = u((c) => {
4208
4220
  var m;
@@ -4237,12 +4249,12 @@ function Hl({ idx: s }) {
4237
4249
  else {
4238
4250
  const j = { ...r };
4239
4251
  j.datalabels = x;
4240
- const v = a == null ? void 0 : a.map(
4252
+ const b = a == null ? void 0 : a.map(
4241
4253
  (d) => d.idx === m ? j : d
4242
4254
  );
4243
4255
  t({
4244
4256
  ...n,
4245
- datasetOptions: v
4257
+ datasetOptions: b
4246
4258
  });
4247
4259
  }
4248
4260
  }
@@ -4250,7 +4262,7 @@ function Hl({ idx: s }) {
4250
4262
  /* @__PURE__ */ e.jsx(hs, { children: /* @__PURE__ */ e.jsx(Zn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
4251
4263
  /* @__PURE__ */ e.jsx(xs, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
4252
4264
  /* @__PURE__ */ e.jsx(
4253
- D,
4265
+ T,
4254
4266
  {
4255
4267
  onClick: () => i("none", s),
4256
4268
  size: "sm",
@@ -4260,7 +4272,7 @@ function Hl({ idx: s }) {
4260
4272
  }
4261
4273
  ),
4262
4274
  /* @__PURE__ */ e.jsx(
4263
- D,
4275
+ T,
4264
4276
  {
4265
4277
  onClick: () => i("start", s),
4266
4278
  size: "sm",
@@ -4277,14 +4289,14 @@ function Hl({ idx: s }) {
4277
4289
  }
4278
4290
  ),
4279
4291
  /* @__PURE__ */ e.jsx(
4280
- D,
4292
+ T,
4281
4293
  {
4282
4294
  onClick: () => i("center", s),
4283
4295
  size: "sm",
4284
4296
  variant: "secondary",
4285
4297
  className: "h-7 p-1 text-xs font-normal",
4286
4298
  children: /* @__PURE__ */ e.jsx(
4287
- Bn,
4299
+ $n,
4288
4300
  {
4289
4301
  className: Z("h-4 w-4", {
4290
4302
  "rotate-90": l === "y"
@@ -4294,7 +4306,7 @@ function Hl({ idx: s }) {
4294
4306
  }
4295
4307
  ),
4296
4308
  /* @__PURE__ */ e.jsx(
4297
- D,
4309
+ T,
4298
4310
  {
4299
4311
  onClick: () => i("end", s),
4300
4312
  size: "sm",
@@ -4316,8 +4328,8 @@ function Hl({ idx: s }) {
4316
4328
  function st() {
4317
4329
  const s = u((m) => m.card), n = u(
4318
4330
  (m) => {
4319
- var x, j, v;
4320
- return (v = (j = (x = m == null ? void 0 : m.card) == null ? void 0 : x.preferences) == null ? void 0 : j.chartOptions) == null ? void 0 : v.indexAxis;
4331
+ var x, j, b;
4332
+ return (b = (j = (x = m == null ? void 0 : m.card) == null ? void 0 : x.preferences) == null ? void 0 : j.chartOptions) == null ? void 0 : b.indexAxis;
4321
4333
  }
4322
4334
  ), { data: a } = Fe(s), t = n === "y" ? "Y axis" : "X axis", l = n === "y" ? "X axis" : "Y axis", {
4323
4335
  keys: r,
@@ -4344,11 +4356,11 @@ function st() {
4344
4356
  /* @__PURE__ */ e.jsx(H, { children: l }),
4345
4357
  /* @__PURE__ */ e.jsx(et, {})
4346
4358
  ] }),
4347
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((m, x) => /* @__PURE__ */ e.jsx(Pl, { col: m, idx: x }, m)) })
4359
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((m, x) => /* @__PURE__ */ e.jsx($l, { col: m, idx: x }, m)) })
4348
4360
  ] })
4349
4361
  ] });
4350
4362
  }
4351
- function Pl({ col: s, idx: n }) {
4363
+ function $l({ col: s, idx: n }) {
4352
4364
  const a = u((o) => {
4353
4365
  var c;
4354
4366
  return (c = o.card) == null ? void 0 : c.preferences;
@@ -4401,23 +4413,23 @@ function Pl({ col: s, idx: n }) {
4401
4413
  }
4402
4414
  ),
4403
4415
  /* @__PURE__ */ e.jsx(
4404
- Mn,
4416
+ Tn,
4405
4417
  {
4406
4418
  onClick: () => i("area"),
4407
4419
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4408
4420
  }
4409
4421
  ),
4410
- /* @__PURE__ */ e.jsx(Hl, { idx: n })
4422
+ /* @__PURE__ */ e.jsx(Pl, { idx: n })
4411
4423
  ] })
4412
4424
  ] });
4413
4425
  }
4414
4426
  function at() {
4415
- const s = u((d) => d.selectedConnectionId), n = u((d) => d.selectedDatamodelId), a = u((d) => d.selectedDatabaseName), t = u((d) => d.selectedSchemaName), l = u((d) => d.selectedTableName), r = T((d) => d.dashboard.filters) || [], i = T((d) => d.actions.addFilter), o = T((d) => d.actions.removeFilter), { removeFilterValues: c } = Re(), { modelItems: m, tableName: x, connectionType: j } = Ee();
4416
- function v(d, f = "dashboard") {
4427
+ const s = u((d) => d.selectedConnectionId), n = u((d) => d.selectedDatamodelId), a = u((d) => d.selectedDatabaseName), t = u((d) => d.selectedSchemaName), l = u((d) => d.selectedTableName), r = k((d) => d.dashboard.filters) || [], i = k((d) => d.actions.addFilter), o = k((d) => d.actions.removeFilter), { removeFilterValues: c } = Re(), { modelItems: m, tableName: x, connectionType: j } = Ee();
4428
+ function b(d, f = "dashboard") {
4417
4429
  var R;
4418
- const g = he(d.column_name), N = he(a || ""), b = he(t || ""), V = he(x);
4430
+ const g = he(d.column_name), N = he(a || ""), v = he(t || ""), V = he(x);
4419
4431
  let F = cn(
4420
- b,
4432
+ v,
4421
4433
  V,
4422
4434
  j
4423
4435
  ), S = `${F}.${g}`;
@@ -4425,13 +4437,13 @@ function at() {
4425
4437
  (C) => C.id === n
4426
4438
  )) == null ? void 0 : R.name;
4427
4439
  n && n !== "none" && (S = `${aa}.${w}.${g}`, F = `${aa}.${w}`);
4428
- const O = r == null ? void 0 : r.find(
4440
+ const D = r == null ? void 0 : r.find(
4429
4441
  (C) => C.column === S && C.table === V && (C.database === N || C.database === a)
4430
4442
  );
4431
- if (O)
4432
- c(O.id), o(O.id);
4443
+ if (D)
4444
+ c(D.id), o(D.id);
4433
4445
  else {
4434
- const C = Ge();
4446
+ const C = Ue();
4435
4447
  return x === "api" && s ? (i({
4436
4448
  location: f,
4437
4449
  id: C,
@@ -4471,10 +4483,10 @@ function at() {
4471
4483
  }), C);
4472
4484
  }
4473
4485
  }
4474
- return { assignFilter: v };
4486
+ return { assignFilter: b };
4475
4487
  }
4476
4488
  function _e() {
4477
- const s = T(
4489
+ const s = k(
4478
4490
  (o) => o.dashboard.filters
4479
4491
  ), n = u((o) => o.frame), { setFrame: a } = ne(), { columns: t } = Ee(), { assignFilter: l } = at();
4480
4492
  function r(o) {
@@ -4496,7 +4508,7 @@ function Bl({
4496
4508
  const [a, t] = ta.useState(!1), [l, r] = ta.useState("");
4497
4509
  return /* @__PURE__ */ e.jsxs(ms, { open: a, onOpenChange: t, children: [
4498
4510
  /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
4499
- D,
4511
+ T,
4500
4512
  {
4501
4513
  size: "sm",
4502
4514
  variant: "outline",
@@ -4540,11 +4552,11 @@ function Bl({
4540
4552
  ] }) })
4541
4553
  ] });
4542
4554
  }
4543
- function $l({
4555
+ function Gl({
4544
4556
  cardType: s
4545
4557
  }) {
4546
4558
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
4547
- /* @__PURE__ */ e.jsxs(J, { value: "item-1", children: [
4559
+ /* @__PURE__ */ e.jsxs(W, { value: "item-1", children: [
4548
4560
  /* @__PURE__ */ e.jsx(K, { children: `${qs(s)} Chart` }),
4549
4561
  /* @__PURE__ */ e.jsxs(Q, { className: "space-y-4 font-mono text-xs", children: [
4550
4562
  /* @__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" }),
@@ -4569,14 +4581,14 @@ function $l({
4569
4581
  ] })
4570
4582
  ] })
4571
4583
  ] }),
4572
- /* @__PURE__ */ e.jsxs(J, { value: "item-2", children: [
4584
+ /* @__PURE__ */ e.jsxs(W, { value: "item-2", children: [
4573
4585
  /* @__PURE__ */ e.jsx(K, { children: "Settings" }),
4574
4586
  /* @__PURE__ */ e.jsxs(Q, { className: "space-y-4 px-2", children: [
4575
4587
  /* @__PURE__ */ e.jsx(fs, {}),
4576
4588
  /* @__PURE__ */ e.jsx(st, {})
4577
4589
  ] })
4578
4590
  ] }),
4579
- /* @__PURE__ */ e.jsxs(J, { value: "item-3", children: [
4591
+ /* @__PURE__ */ e.jsxs(W, { value: "item-3", children: [
4580
4592
  /* @__PURE__ */ e.jsx(K, { children: "Filters" }),
4581
4593
  /* @__PURE__ */ e.jsxs(Q, { className: "space-y-4 px-2", children: [
4582
4594
  /* @__PURE__ */ e.jsx(Ve, {}),
@@ -4585,7 +4597,7 @@ function $l({
4585
4597
  ] })
4586
4598
  ] }) });
4587
4599
  }
4588
- function $s() {
4600
+ function Bs() {
4589
4601
  var l, r, i;
4590
4602
  const s = u(
4591
4603
  (o) => o.card.cfg
@@ -4666,15 +4678,15 @@ function Ul({
4666
4678
  ] });
4667
4679
  }
4668
4680
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
4669
- /* @__PURE__ */ e.jsxs(J, { value: "item-1", children: [
4681
+ /* @__PURE__ */ e.jsxs(W, { value: "item-1", children: [
4670
4682
  /* @__PURE__ */ e.jsx(K, { children: `${qs(s)} Chart` }),
4671
4683
  /* @__PURE__ */ e.jsx(Q, { className: "space-y-4 font-mono text-xs", children: n(s) })
4672
4684
  ] }),
4673
- /* @__PURE__ */ e.jsxs(J, { value: "item-2", children: [
4685
+ /* @__PURE__ */ e.jsxs(W, { value: "item-2", children: [
4674
4686
  /* @__PURE__ */ e.jsx(K, { children: "Settings" }),
4675
- /* @__PURE__ */ e.jsx(Q, { className: "px-2", children: /* @__PURE__ */ e.jsx($s, {}) })
4687
+ /* @__PURE__ */ e.jsx(Q, { className: "px-2", children: /* @__PURE__ */ e.jsx(Bs, {}) })
4676
4688
  ] }),
4677
- /* @__PURE__ */ e.jsxs(J, { value: "item-3", children: [
4689
+ /* @__PURE__ */ e.jsxs(W, { value: "item-3", children: [
4678
4690
  /* @__PURE__ */ e.jsx(K, { children: "Filters" }),
4679
4691
  /* @__PURE__ */ e.jsxs(Q, { className: "space-y-4 px-2", children: [
4680
4692
  /* @__PURE__ */ e.jsx(Ve, {}),
@@ -4683,7 +4695,7 @@ function Ul({
4683
4695
  ] })
4684
4696
  ] }) });
4685
4697
  }
4686
- const Gl = {
4698
+ const Jl = {
4687
4699
  datasets: [
4688
4700
  {
4689
4701
  type: "line",
@@ -4706,7 +4718,7 @@ const Gl = {
4706
4718
  }
4707
4719
  ]
4708
4720
  };
4709
- function Jl() {
4721
+ function Kl() {
4710
4722
  const s = u((n) => n.card.type);
4711
4723
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
4712
4724
  /* @__PURE__ */ e.jsx(
@@ -4715,21 +4727,21 @@ function Jl() {
4715
4727
  className: " ",
4716
4728
  type: "single",
4717
4729
  collapsible: !0,
4718
- children: Kl(s)
4730
+ children: Ql(s)
4719
4731
  }
4720
4732
  ),
4721
4733
  /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(fs, {}) }),
4722
4734
  !["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4723
- /* @__PURE__ */ e.jsx($s, {}),
4735
+ /* @__PURE__ */ e.jsx(Bs, {}),
4724
4736
  /* @__PURE__ */ e.jsx(Ve, {}),
4725
4737
  /* @__PURE__ */ e.jsx(_e, {})
4726
4738
  ] })
4727
4739
  ] });
4728
4740
  }
4729
- function Kl(s) {
4741
+ function Ql(s) {
4730
4742
  if (["line", "bar"].includes(s))
4731
4743
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
4732
- /* @__PURE__ */ e.jsxs(J, { value: "item-1", children: [
4744
+ /* @__PURE__ */ e.jsxs(W, { value: "item-1", children: [
4733
4745
  /* @__PURE__ */ e.jsx(K, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
4734
4746
  /* @__PURE__ */ e.jsxs(Q, { className: " ", children: [
4735
4747
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table" }),
@@ -4739,7 +4751,7 @@ function Kl(s) {
4739
4751
  ] })
4740
4752
  ] })
4741
4753
  ] }),
4742
- /* @__PURE__ */ e.jsxs(J, { value: "item-2", children: [
4754
+ /* @__PURE__ */ e.jsxs(W, { value: "item-2", children: [
4743
4755
  /* @__PURE__ */ e.jsx(K, { className: "font-normal", children: "Mixed Chart" }),
4744
4756
  /* @__PURE__ */ e.jsxs(Q, { className: "space-y-2 text-xs", children: [
4745
4757
  /* @__PURE__ */ e.jsxs("p", { children: [
@@ -4747,10 +4759,10 @@ function Kl(s) {
4747
4759
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
4748
4760
  " and change the `type` property in the dataset."
4749
4761
  ] }),
4750
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Gl, null, 2) })
4762
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Jl, null, 2) })
4751
4763
  ] })
4752
4764
  ] }),
4753
- /* @__PURE__ */ e.jsxs(J, { value: "item-3", children: [
4765
+ /* @__PURE__ */ e.jsxs(W, { value: "item-3", children: [
4754
4766
  /* @__PURE__ */ e.jsx(K, { className: "font-normal", children: "Area Chart" }),
4755
4767
  /* @__PURE__ */ e.jsxs(Q, { className: "space-y-2 text-xs", children: [
4756
4768
  /* @__PURE__ */ e.jsxs("p", { children: [
@@ -4773,7 +4785,7 @@ function Kl(s) {
4773
4785
  ] })
4774
4786
  ] });
4775
4787
  if (s === "bubble")
4776
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(J, { value: "item-1", children: [
4788
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(W, { value: "item-1", children: [
4777
4789
  /* @__PURE__ */ e.jsx(K, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
4778
4790
  "How to create a ",
4779
4791
  /* @__PURE__ */ e.jsx("span", { children: s }),
@@ -4791,7 +4803,7 @@ function Kl(s) {
4791
4803
  ] })
4792
4804
  ] }) });
4793
4805
  if (s === "scatter")
4794
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(J, { value: "item-1", children: [
4806
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(W, { value: "item-1", children: [
4795
4807
  /* @__PURE__ */ e.jsx(K, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
4796
4808
  "How to create a ",
4797
4809
  /* @__PURE__ */ e.jsx("span", { children: s }),
@@ -4808,7 +4820,7 @@ function Kl(s) {
4808
4820
  ] })
4809
4821
  ] }) });
4810
4822
  if (["pie", "doughnut", "polarArea"].includes(s))
4811
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(J, { value: "item-1", children: [
4823
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(W, { value: "item-1", children: [
4812
4824
  /* @__PURE__ */ e.jsx(K, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
4813
4825
  /* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
4814
4826
  " ",
@@ -4823,8 +4835,8 @@ function Kl(s) {
4823
4835
  ] })
4824
4836
  ] }) });
4825
4837
  }
4826
- function Ql() {
4827
- var c, m, x, j, v;
4838
+ function Zl() {
4839
+ var c, m, x, j, b;
4828
4840
  const s = u((d) => d.card.preferences), n = u(
4829
4841
  (d) => d.actions.setCardPreferences
4830
4842
  ), a = u(
@@ -4961,7 +4973,7 @@ function Ql() {
4961
4973
  /* @__PURE__ */ e.jsx(
4962
4974
  oe,
4963
4975
  {
4964
- value: ((v = s == null ? void 0 : s.formatNumber) == null ? void 0 : v.suffix) || "",
4976
+ value: ((b = s == null ? void 0 : s.formatNumber) == null ? void 0 : b.suffix) || "",
4965
4977
  className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
4966
4978
  placeholder: "K, M, B, %",
4967
4979
  onChange: (d) => {
@@ -4989,9 +5001,9 @@ function Ql() {
4989
5001
  ] })
4990
5002
  ] });
4991
5003
  }
4992
- function Zl() {
5004
+ function Xl() {
4993
5005
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
4994
- /* @__PURE__ */ e.jsx(Le, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(J, { value: "item-1", children: [
5006
+ /* @__PURE__ */ e.jsx(Le, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(W, { value: "item-1", children: [
4995
5007
  /* @__PURE__ */ e.jsx(K, { className: "", children: "KPI Query" }),
4996
5008
  /* @__PURE__ */ e.jsxs(Q, { className: "font-mono", children: [
4997
5009
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
@@ -5015,12 +5027,12 @@ function Zl() {
5015
5027
  ] })
5016
5028
  ] })
5017
5029
  ] }) }),
5018
- /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Ql, {}) }),
5030
+ /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Zl, {}) }),
5019
5031
  /* @__PURE__ */ e.jsx("div", {}),
5020
5032
  /* @__PURE__ */ e.jsx("div", {})
5021
5033
  ] });
5022
5034
  }
5023
- const Xl = [
5035
+ const Yl = [
5024
5036
  {
5025
5037
  label: "Mercator",
5026
5038
  value: "mercator"
@@ -5077,7 +5089,7 @@ const Xl = [
5077
5089
  label: "Natural Earth 1",
5078
5090
  value: "naturalEarth1"
5079
5091
  }
5080
- ], Yl = [
5092
+ ], er = [
5081
5093
  "blues",
5082
5094
  "brBG",
5083
5095
  "buGn",
@@ -5116,12 +5128,12 @@ const Xl = [
5116
5128
  "ylGnBu",
5117
5129
  "ylOrBr",
5118
5130
  "ylOrRd"
5119
- ], er = Yl.map((s) => ({
5131
+ ], sr = er.map((s) => ({
5120
5132
  label: s,
5121
5133
  value: s
5122
5134
  }));
5123
- function sr() {
5124
- var c, m, x, j, v, d, f, g, N, b, V, F, S, w, O, R, C, h;
5135
+ function ar() {
5136
+ var c, m, x, j, b, d, f, g, N, v, V, F, S, w, D, R, C, h;
5125
5137
  const s = u((p) => p.card), n = (m = (c = s == null ? void 0 : s.preferences) == null ? void 0 : c.mapVisualOptions) == null ? void 0 : m.topoJsonUrl, [a, t] = q(
5126
5138
  ((j = (x = s == null ? void 0 : s.preferences) == null ? void 0 : x.mapVisualOptions) == null ? void 0 : j.customTopoJsonUrl) || ""
5127
5139
  ), { setCardPreferences: l } = ne(), { data: r } = Vs(s), i = Object.keys((r == null ? void 0 : r.objects) || {}).map((p) => ({
@@ -5142,9 +5154,9 @@ function sr() {
5142
5154
  }
5143
5155
  ];
5144
5156
  return /* @__PURE__ */ e.jsxs("div", { className: "p-6", children: [
5145
- /* @__PURE__ */ e.jsx($e, { 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" }) }),
5157
+ /* @__PURE__ */ e.jsx(Be, { 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" }) }),
5146
5158
  /* @__PURE__ */ e.jsx(ke, { className: "my-4" }),
5147
- /* @__PURE__ */ e.jsx($e, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
5159
+ /* @__PURE__ */ e.jsx(Be, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
5148
5160
  /* @__PURE__ */ e.jsx(
5149
5161
  xe,
5150
5162
  {
@@ -5180,7 +5192,7 @@ function sr() {
5180
5192
  });
5181
5193
  },
5182
5194
  value: a,
5183
- className: `h-9 w-full ${Be}`,
5195
+ className: `h-9 w-full ${$e}`,
5184
5196
  placeholder: "Custom URL"
5185
5197
  }
5186
5198
  ),
@@ -5192,14 +5204,14 @@ function sr() {
5192
5204
  {
5193
5205
  className: "h-9",
5194
5206
  options: i,
5195
- value: ((d = (v = s.preferences) == null ? void 0 : v.mapVisualOptions) == null ? void 0 : d.objectKey) || "",
5207
+ value: ((d = (b = s.preferences) == null ? void 0 : b.mapVisualOptions) == null ? void 0 : d.objectKey) || "",
5196
5208
  label: "Map Object",
5197
5209
  onValueChange: (p) => {
5198
- var z;
5210
+ var I;
5199
5211
  l({
5200
5212
  ...s.preferences,
5201
5213
  mapVisualOptions: {
5202
- ...(z = s.preferences) == null ? void 0 : z.mapVisualOptions,
5214
+ ...(I = s.preferences) == null ? void 0 : I.mapVisualOptions,
5203
5215
  objectKey: p
5204
5216
  }
5205
5217
  });
@@ -5213,15 +5225,15 @@ function sr() {
5213
5225
  xe,
5214
5226
  {
5215
5227
  className: "h-9",
5216
- options: Xl,
5228
+ options: Yl,
5217
5229
  value: ((g = (f = s.preferences) == null ? void 0 : f.mapVisualOptions) == null ? void 0 : g.projection) || "",
5218
5230
  label: "Projection",
5219
5231
  onValueChange: (p) => {
5220
- var z;
5232
+ var I;
5221
5233
  l({
5222
5234
  ...s.preferences,
5223
5235
  mapVisualOptions: {
5224
- ...(z = s.preferences) == null ? void 0 : z.mapVisualOptions,
5236
+ ...(I = s.preferences) == null ? void 0 : I.mapVisualOptions,
5225
5237
  projection: p
5226
5238
  }
5227
5239
  });
@@ -5235,15 +5247,15 @@ function sr() {
5235
5247
  xe,
5236
5248
  {
5237
5249
  className: "h-9",
5238
- options: er,
5239
- value: ((b = (N = s.preferences) == null ? void 0 : N.mapVisualOptions) == null ? void 0 : b.colorScale) || "",
5250
+ options: sr,
5251
+ value: ((v = (N = s.preferences) == null ? void 0 : N.mapVisualOptions) == null ? void 0 : v.colorScale) || "",
5240
5252
  label: "Select Color Scale",
5241
5253
  onValueChange: (p) => {
5242
- var z;
5254
+ var I;
5243
5255
  l({
5244
5256
  ...s.preferences,
5245
5257
  mapVisualOptions: {
5246
- ...(z = s.preferences) == null ? void 0 : z.mapVisualOptions,
5258
+ ...(I = s.preferences) == null ? void 0 : I.mapVisualOptions,
5247
5259
  colorScale: p
5248
5260
  }
5249
5261
  });
@@ -5254,20 +5266,20 @@ function sr() {
5254
5266
  ] })
5255
5267
  ] }) }),
5256
5268
  /* @__PURE__ */ e.jsx(ke, { className: "my-4" }),
5257
- /* @__PURE__ */ e.jsx($e, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
5269
+ /* @__PURE__ */ e.jsx(Be, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
5258
5270
  /* @__PURE__ */ e.jsx(
5259
5271
  oe,
5260
5272
  {
5261
- className: `h-9 w-full ${Be}`,
5273
+ className: `h-9 w-full ${$e}`,
5262
5274
  type: "number",
5263
5275
  step: 0.1,
5264
5276
  value: ((F = (V = s.preferences) == null ? void 0 : V.mapVisualOptions) == null ? void 0 : F.projectionScale) || 1,
5265
5277
  onChange: (p) => {
5266
- var z;
5278
+ var I;
5267
5279
  l({
5268
5280
  ...s.preferences,
5269
5281
  mapVisualOptions: {
5270
- ...(z = s.preferences) == null ? void 0 : z.mapVisualOptions,
5282
+ ...(I = s.preferences) == null ? void 0 : I.mapVisualOptions,
5271
5283
  projectionScale: Number(p.target.value)
5272
5284
  }
5273
5285
  });
@@ -5278,19 +5290,19 @@ function sr() {
5278
5290
  /* @__PURE__ */ e.jsx(
5279
5291
  oe,
5280
5292
  {
5281
- className: `h-9 w-full ${Be}`,
5293
+ className: `h-9 w-full ${$e}`,
5282
5294
  type: "number",
5283
5295
  step: 10,
5284
- value: ((O = (w = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : w.projectionOffset) == null ? void 0 : O[0]) || 0,
5296
+ value: ((D = (w = (S = s.preferences) == null ? void 0 : S.mapVisualOptions) == null ? void 0 : w.projectionOffset) == null ? void 0 : D[0]) || 0,
5285
5297
  onChange: (p) => {
5286
- var z, I, A, B;
5298
+ var I, O, A, $;
5287
5299
  l({
5288
5300
  ...s.preferences,
5289
5301
  mapVisualOptions: {
5290
- ...(z = s.preferences) == null ? void 0 : z.mapVisualOptions,
5302
+ ...(I = s.preferences) == null ? void 0 : I.mapVisualOptions,
5291
5303
  projectionOffset: [
5292
5304
  Number(p.target.value),
5293
- ((B = (A = (I = s.preferences) == null ? void 0 : I.mapVisualOptions) == null ? void 0 : A.projectionOffset) == null ? void 0 : B[1]) || 0
5305
+ (($ = (A = (O = s.preferences) == null ? void 0 : O.mapVisualOptions) == null ? void 0 : A.projectionOffset) == null ? void 0 : $[1]) || 0
5294
5306
  ]
5295
5307
  }
5296
5308
  });
@@ -5301,18 +5313,18 @@ function sr() {
5301
5313
  /* @__PURE__ */ e.jsx(
5302
5314
  oe,
5303
5315
  {
5304
- className: `h-9 w-full ${Be}`,
5316
+ className: `h-9 w-full ${$e}`,
5305
5317
  type: "number",
5306
5318
  step: 10,
5307
5319
  value: ((h = (C = (R = s.preferences) == null ? void 0 : R.mapVisualOptions) == null ? void 0 : C.projectionOffset) == null ? void 0 : h[1]) || 0,
5308
5320
  onChange: (p) => {
5309
- var z, I, A, B;
5321
+ var I, O, A, $;
5310
5322
  l({
5311
5323
  ...s.preferences,
5312
5324
  mapVisualOptions: {
5313
- ...(z = s.preferences) == null ? void 0 : z.mapVisualOptions,
5325
+ ...(I = s.preferences) == null ? void 0 : I.mapVisualOptions,
5314
5326
  projectionOffset: [
5315
- ((B = (A = (I = s.preferences) == null ? void 0 : I.mapVisualOptions) == null ? void 0 : A.projectionOffset) == null ? void 0 : B[0]) || 0,
5327
+ (($ = (A = (O = s.preferences) == null ? void 0 : O.mapVisualOptions) == null ? void 0 : A.projectionOffset) == null ? void 0 : $[0]) || 0,
5316
5328
  Number(p.target.value)
5317
5329
  ]
5318
5330
  }
@@ -5325,7 +5337,7 @@ function sr() {
5325
5337
  /* @__PURE__ */ e.jsx(Ve, {})
5326
5338
  ] });
5327
5339
  }
5328
- function ar() {
5340
+ function tr() {
5329
5341
  var t;
5330
5342
  const s = u((l) => l.card.preferences), { setCardPreferences: n } = u((l) => l.actions);
5331
5343
  function a(l) {
@@ -5346,11 +5358,11 @@ function ar() {
5346
5358
  defaultValue: "x",
5347
5359
  children: [
5348
5360
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
5349
- /* @__PURE__ */ e.jsx(Te, { value: "static", id: "r1" }),
5361
+ /* @__PURE__ */ e.jsx(Me, { value: "static", id: "r1" }),
5350
5362
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
5351
5363
  ] }),
5352
5364
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
5353
- /* @__PURE__ */ e.jsx(Te, { value: "dynamic", id: "r2" }),
5365
+ /* @__PURE__ */ e.jsx(Me, { value: "dynamic", id: "r2" }),
5354
5366
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
5355
5367
  ] })
5356
5368
  ]
@@ -5364,7 +5376,7 @@ function Ye({
5364
5376
  }) {
5365
5377
  let t = "pie-chart";
5366
5378
  return s === "radar" && (t = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
5367
- /* @__PURE__ */ e.jsxs(J, { value: "item-1", children: [
5379
+ /* @__PURE__ */ e.jsxs(W, { value: "item-1", children: [
5368
5380
  /* @__PURE__ */ e.jsx(K, { children: `${qs(s)} ${a}` }),
5369
5381
  /* @__PURE__ */ e.jsx(Q, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5370
5382
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
@@ -5388,15 +5400,15 @@ function Ye({
5388
5400
  ] })
5389
5401
  ] }) })
5390
5402
  ] }),
5391
- /* @__PURE__ */ e.jsxs(J, { value: "item-2", children: [
5403
+ /* @__PURE__ */ e.jsxs(W, { value: "item-2", children: [
5392
5404
  /* @__PURE__ */ e.jsx(K, { children: "Settings" }),
5393
5405
  /* @__PURE__ */ e.jsxs(Q, { className: "space-y-4 px-2", children: [
5394
5406
  s === "range" && /* @__PURE__ */ e.jsx(fs, {}),
5395
- s !== "text" && /* @__PURE__ */ e.jsx($s, {}),
5396
- s === "text" && /* @__PURE__ */ e.jsx(ar, {})
5407
+ s !== "text" && /* @__PURE__ */ e.jsx(Bs, {}),
5408
+ s === "text" && /* @__PURE__ */ e.jsx(tr, {})
5397
5409
  ] })
5398
5410
  ] }),
5399
- !["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(J, { value: "item-3", children: [
5411
+ !["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(W, { value: "item-3", children: [
5400
5412
  /* @__PURE__ */ e.jsx(K, { children: "Filters" }),
5401
5413
  /* @__PURE__ */ e.jsxs(Q, { className: "space-y-4 px-2", children: [
5402
5414
  /* @__PURE__ */ e.jsx(Ve, {}),
@@ -5405,7 +5417,7 @@ function Ye({
5405
5417
  ] })
5406
5418
  ] }) });
5407
5419
  }
5408
- function tr() {
5420
+ function nr() {
5409
5421
  const s = u(
5410
5422
  (t) => {
5411
5423
  var l, r;
@@ -5443,7 +5455,7 @@ function tr() {
5443
5455
  ] });
5444
5456
  }
5445
5457
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Le, { defaultValue: ["item-2"], type: "multiple", children: [
5446
- /* @__PURE__ */ e.jsxs(J, { value: "item-1", children: [
5458
+ /* @__PURE__ */ e.jsxs(W, { value: "item-1", children: [
5447
5459
  /* @__PURE__ */ e.jsx(K, { children: "Stacked Chart" }),
5448
5460
  /* @__PURE__ */ e.jsxs(Q, { className: "space-y-4 font-mono text-xs", children: [
5449
5461
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
@@ -5468,7 +5480,7 @@ function tr() {
5468
5480
  ] })
5469
5481
  ] })
5470
5482
  ] }),
5471
- /* @__PURE__ */ e.jsxs(J, { value: "item-2", children: [
5483
+ /* @__PURE__ */ e.jsxs(W, { value: "item-2", children: [
5472
5484
  /* @__PURE__ */ e.jsx(K, { children: "Settings" }),
5473
5485
  /* @__PURE__ */ e.jsxs(Q, { className: "space-y-4 px-2", children: [
5474
5486
  /* @__PURE__ */ e.jsx(fs, {}),
@@ -5476,7 +5488,7 @@ function tr() {
5476
5488
  /* @__PURE__ */ e.jsx(st, {})
5477
5489
  ] })
5478
5490
  ] }),
5479
- /* @__PURE__ */ e.jsxs(J, { value: "item-3", children: [
5491
+ /* @__PURE__ */ e.jsxs(W, { value: "item-3", children: [
5480
5492
  /* @__PURE__ */ e.jsx(K, { children: "Filters" }),
5481
5493
  /* @__PURE__ */ e.jsxs(Q, { className: "space-y-4 px-2", children: [
5482
5494
  /* @__PURE__ */ e.jsx(Ve, {}),
@@ -5485,7 +5497,7 @@ function tr() {
5485
5497
  ] })
5486
5498
  ] }) });
5487
5499
  }
5488
- function nr({}) {
5500
+ function lr({}) {
5489
5501
  const s = u((t) => {
5490
5502
  var l;
5491
5503
  return (l = t.card) == null ? void 0 : l.preferences;
@@ -5498,7 +5510,7 @@ function nr({}) {
5498
5510
  });
5499
5511
  };
5500
5512
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
5501
- /* @__PURE__ */ e.jsx(Le, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(J, { value: "item-3", children: [
5513
+ /* @__PURE__ */ e.jsx(Le, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(W, { value: "item-3", children: [
5502
5514
  /* @__PURE__ */ e.jsx(K, { children: "Filters" }),
5503
5515
  /* @__PURE__ */ e.jsxs(Q, { className: "space-y-4 px-2", children: [
5504
5516
  /* @__PURE__ */ e.jsx(Ve, {}),
@@ -5518,7 +5530,7 @@ function nr({}) {
5518
5530
  ] })
5519
5531
  ] });
5520
5532
  }
5521
- const lr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5533
+ const rr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5522
5534
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
5523
5535
  /* @__PURE__ */ e.jsxs("div", { children: [
5524
5536
  "See ",
@@ -5534,7 +5546,7 @@ const lr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5534
5546
  ),
5535
5547
  " in the docs."
5536
5548
  ] })
5537
- ] }), rr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5549
+ ] }), ir = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5538
5550
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT y-axis, label, range-from, range-to, range-value FROM table" }),
5539
5551
  /* @__PURE__ */ e.jsxs("div", { children: [
5540
5552
  "See ",
@@ -5550,7 +5562,7 @@ const lr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5550
5562
  ),
5551
5563
  " in the docs."
5552
5564
  ] })
5553
- ] }), ir = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5565
+ ] }), or = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
5554
5566
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
5555
5567
  /* @__PURE__ */ e.jsxs("div", { children: [
5556
5568
  "See ",
@@ -5567,22 +5579,22 @@ const lr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
5567
5579
  " in the docs."
5568
5580
  ] })
5569
5581
  ] });
5570
- function or() {
5582
+ function cr() {
5571
5583
  const s = u((a) => a.card.type);
5572
5584
  function n(a) {
5573
5585
  switch (a) {
5574
5586
  case "stackedBar":
5575
5587
  case "stackedLine":
5576
- return /* @__PURE__ */ e.jsx(tr, {});
5588
+ return /* @__PURE__ */ e.jsx(nr, {});
5577
5589
  case "pyramid":
5578
- return /* @__PURE__ */ e.jsx(Ye, { docContent: lr, cardType: a });
5590
+ return /* @__PURE__ */ e.jsx(Ye, { docContent: rr, cardType: a });
5579
5591
  case "kpi":
5580
- return /* @__PURE__ */ e.jsx(Zl, {});
5592
+ return /* @__PURE__ */ e.jsx(Xl, {});
5581
5593
  case "line":
5582
5594
  case "bar":
5583
- return /* @__PURE__ */ e.jsx($l, { cardType: a });
5595
+ return /* @__PURE__ */ e.jsx(Gl, { cardType: a });
5584
5596
  case "range":
5585
- return /* @__PURE__ */ e.jsx(Ye, { docContent: rr, cardType: a });
5597
+ return /* @__PURE__ */ e.jsx(Ye, { docContent: ir, cardType: a });
5586
5598
  case "pie":
5587
5599
  case "doughnut":
5588
5600
  case "polarArea":
@@ -5592,27 +5604,27 @@ function or() {
5592
5604
  case "scatter":
5593
5605
  return /* @__PURE__ */ e.jsx(Ul, { cardType: a });
5594
5606
  case "table":
5595
- return /* @__PURE__ */ e.jsx(nr, { cardType: a });
5607
+ return /* @__PURE__ */ e.jsx(lr, { cardType: a });
5596
5608
  case "text":
5597
5609
  return /* @__PURE__ */ e.jsx(
5598
5610
  Ye,
5599
5611
  {
5600
- docContent: ir,
5612
+ docContent: or,
5601
5613
  cardType: a,
5602
5614
  suffix: "Visual"
5603
5615
  }
5604
5616
  );
5605
5617
  case "map":
5606
- return /* @__PURE__ */ e.jsx(sr, {});
5618
+ return /* @__PURE__ */ e.jsx(ar, {});
5607
5619
  case "custom":
5608
- return /* @__PURE__ */ e.jsx(_l, {});
5620
+ return /* @__PURE__ */ e.jsx(Hl, {});
5609
5621
  default:
5610
- return /* @__PURE__ */ e.jsx(Jl, {});
5622
+ return /* @__PURE__ */ e.jsx(Kl, {});
5611
5623
  }
5612
5624
  }
5613
5625
  return /* @__PURE__ */ e.jsx(ve, { className: "h-full w-full text-sm", children: n(s) });
5614
5626
  }
5615
- function cr() {
5627
+ function dr() {
5616
5628
  const s = u((n) => n.isShowingVisual);
5617
5629
  return /* @__PURE__ */ e.jsxs(
5618
5630
  ns,
@@ -5627,7 +5639,7 @@ function cr() {
5627
5639
  className: "flex",
5628
5640
  minSize: 20,
5629
5641
  defaultSize: 40,
5630
- children: /* @__PURE__ */ e.jsx(wl, {})
5642
+ children: /* @__PURE__ */ e.jsx(kl, {})
5631
5643
  }
5632
5644
  ),
5633
5645
  /* @__PURE__ */ e.jsx(ls, { withHandle: !0, className: "border" }),
@@ -5646,7 +5658,7 @@ function cr() {
5646
5658
  minSize: 20,
5647
5659
  defaultSize: 25,
5648
5660
  maxSize: 30,
5649
- children: /* @__PURE__ */ e.jsx(or, {})
5661
+ children: /* @__PURE__ */ e.jsx(cr, {})
5650
5662
  }
5651
5663
  ) }),
5652
5664
  /* @__PURE__ */ e.jsx(ls, { className: "border" }),
@@ -5658,9 +5670,9 @@ function cr() {
5658
5670
  }
5659
5671
  );
5660
5672
  }
5661
- function dr({ authToken: s, onSave: n, onClose: a }) {
5662
- T((i) => i.themeStyle);
5663
- const t = u((i) => i.actions.setOnSave), l = u((i) => i.actions.setOnClose), r = T((i) => i.actions.setAuthToken);
5673
+ function ur({ authToken: s, onSave: n, onClose: a }) {
5674
+ k((i) => i.themeStyle);
5675
+ const t = u((i) => i.actions.setOnSave), l = u((i) => i.actions.setOnClose), r = k((i) => i.actions.setAuthToken);
5664
5676
  return se(() => {
5665
5677
  n && t(n), a && l(a);
5666
5678
  }, [n, t, a, l]), se(() => {
@@ -5676,14 +5688,14 @@ function dr({ authToken: s, onSave: n, onClose: a }) {
5676
5688
  role: "editor-panel",
5677
5689
  children: [
5678
5690
  /* @__PURE__ */ e.jsx(vn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(Ra, {}) }),
5679
- /* @__PURE__ */ e.jsx(yn, { children: /* @__PURE__ */ e.jsx(cr, {}) })
5691
+ /* @__PURE__ */ e.jsx(yn, { children: /* @__PURE__ */ e.jsx(dr, {}) })
5680
5692
  ]
5681
5693
  }
5682
5694
  ) });
5683
5695
  }
5684
- function ur() {
5685
- T((i) => i.selectedCardId);
5686
- const s = T((i) => i.selectedSheetId), { setIsVisualEditing: n } = T((i) => i.actions), a = T((i) => i.isVisualEditing), t = T((i) => i.actions.updateFrame);
5696
+ function mr() {
5697
+ k((i) => i.selectedCardId);
5698
+ const s = k((i) => i.selectedSheetId), { setIsVisualEditing: n } = k((i) => i.actions), a = k((i) => i.isVisualEditing), t = k((i) => i.actions.updateFrame);
5687
5699
  function l(i) {
5688
5700
  s && (t(s, i), n(!1));
5689
5701
  }
@@ -5697,12 +5709,12 @@ function ur() {
5697
5709
  className: Z("flex grow", {
5698
5710
  "max-h-0 overflow-hidden": !a
5699
5711
  }),
5700
- children: /* @__PURE__ */ e.jsx(dr, { onSave: l, onClose: r })
5712
+ children: /* @__PURE__ */ e.jsx(ur, { onSave: l, onClose: r })
5701
5713
  }
5702
5714
  );
5703
5715
  }
5704
- function mr() {
5705
- const s = u((r) => r.selectedDatabaseName), n = u((r) => r.selectedTableName), a = T((r) => r.dashboard.filters) || [], { columns: t } = Ee(), { assignFilter: l } = at();
5716
+ function hr() {
5717
+ const s = u((r) => r.selectedDatabaseName), n = u((r) => r.selectedTableName), a = k((r) => r.dashboard.filters) || [], { columns: t } = Ee(), { assignFilter: l } = at();
5706
5718
  return /* @__PURE__ */ e.jsx(ve, { className: "flex-1 basis-0 flex-col px-3", children: t == null ? void 0 : t.map((r) => {
5707
5719
  const i = a == null ? void 0 : a.find(
5708
5720
  (o) => o.column === he(r.column_name) && o.table === n && o.database === s
@@ -5726,21 +5738,21 @@ function mr() {
5726
5738
  );
5727
5739
  }) });
5728
5740
  }
5729
- function hr() {
5730
- T((n) => n.showFilters);
5731
- const s = T(
5741
+ function xr() {
5742
+ k((n) => n.showFilters);
5743
+ const s = k(
5732
5744
  (n) => n.actions.setShowFilters
5733
5745
  );
5734
5746
  return /* @__PURE__ */ e.jsxs("section", { className: "relative flex min-w-72 grow flex-col border-l px-1", children: [
5735
5747
  /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
5736
5748
  /* @__PURE__ */ e.jsx(H, { className: "px-2 text-lg", children: "Filters" }),
5737
5749
  /* @__PURE__ */ e.jsx(
5738
- D,
5750
+ T,
5739
5751
  {
5740
5752
  onClick: () => s(!1),
5741
5753
  className: "h-7 w-7 p-0",
5742
5754
  variant: "ghost",
5743
- children: /* @__PURE__ */ e.jsx(Ue, {})
5755
+ children: /* @__PURE__ */ e.jsx(Ge, {})
5744
5756
  }
5745
5757
  )
5746
5758
  ] }),
@@ -5750,7 +5762,7 @@ function hr() {
5750
5762
  ColumnsComponent: () => (
5751
5763
  // schemaName, tableName, columns
5752
5764
  /* @__PURE__ */ e.jsx(
5753
- mr,
5765
+ hr,
5754
5766
  {}
5755
5767
  )
5756
5768
  )
@@ -5758,8 +5770,8 @@ function hr() {
5758
5770
  ) })
5759
5771
  ] });
5760
5772
  }
5761
- function xr() {
5762
- const s = T((t) => t.dashboard.filters), n = T((t) => t.theme), a = s == null ? void 0 : s.filter((t) => t.hide);
5773
+ function pr() {
5774
+ const s = k((t) => t.dashboard.filters), n = k((t) => t.theme), a = s == null ? void 0 : s.filter((t) => t.hide);
5763
5775
  return a != null && a.length ? /* @__PURE__ */ e.jsx(
5764
5776
  "div",
5765
5777
  {
@@ -5781,8 +5793,8 @@ function xr() {
5781
5793
  }
5782
5794
  ) : null;
5783
5795
  }
5784
- function pr() {
5785
- const s = T((t) => t.showFilters), n = T((t) => t.isVisualEditing), a = T(
5796
+ function fr() {
5797
+ const s = k((t) => t.showFilters), n = k((t) => t.isVisualEditing), a = k(
5786
5798
  (t) => t.isDashboardEditing
5787
5799
  );
5788
5800
  return /* @__PURE__ */ e.jsxs(
@@ -5797,19 +5809,19 @@ function pr() {
5797
5809
  }),
5798
5810
  children: [
5799
5811
  /* @__PURE__ */ e.jsxs("section", { className: "flex grow flex-col", children: [
5800
- a && /* @__PURE__ */ e.jsx(xr, {}),
5812
+ a && /* @__PURE__ */ e.jsx(pr, {}),
5801
5813
  /* @__PURE__ */ e.jsx(Nn, {})
5802
5814
  ] }),
5803
- s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(hr, {}) })
5815
+ s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(xr, {}) })
5804
5816
  ]
5805
5817
  }
5806
5818
  );
5807
5819
  }
5808
- function fr() {
5809
- const s = T((t) => t.dashboard), n = T((t) => t.actions.setDashboard), a = T(
5820
+ function gr() {
5821
+ const s = k((t) => t.dashboard), n = k((t) => t.actions.setDashboard), a = k(
5810
5822
  (t) => t.showDashboardJSON
5811
5823
  );
5812
- return T(
5824
+ return k(
5813
5825
  (t) => t.actions.setShowDashboardJSON
5814
5826
  ), /* @__PURE__ */ e.jsx(
5815
5827
  "div",
@@ -5849,7 +5861,7 @@ function fr() {
5849
5861
  }
5850
5862
  );
5851
5863
  }
5852
- function vr({
5864
+ function yr({
5853
5865
  showControls: s = !1,
5854
5866
  showFooter: n = !0,
5855
5867
  ...a
@@ -5857,38 +5869,39 @@ function vr({
5857
5869
  return /* @__PURE__ */ e.jsx(us, { FallbackComponent: Da, children: /* @__PURE__ */ e.jsxs(Sn, { dashboardProps: a, children: [
5858
5870
  /* @__PURE__ */ e.jsx(wn, {}),
5859
5871
  /* @__PURE__ */ e.jsxs(kn, { children: [
5860
- /* @__PURE__ */ e.jsx(fr, {}),
5872
+ /* @__PURE__ */ e.jsx(gr, {}),
5861
5873
  /* @__PURE__ */ e.jsxs(zn, { ...a, children: [
5862
- s && /* @__PURE__ */ e.jsx(il, {}),
5863
- /* @__PURE__ */ e.jsx(ur, {}),
5864
- /* @__PURE__ */ e.jsx(pr, {})
5874
+ s && /* @__PURE__ */ e.jsx(ol, {}),
5875
+ /* @__PURE__ */ e.jsx(mr, {}),
5876
+ /* @__PURE__ */ e.jsx(fr, {})
5865
5877
  ] })
5866
5878
  ] })
5867
5879
  ] }) });
5868
5880
  }
5869
5881
  export {
5870
- Pe as A,
5882
+ Ee as A,
5871
5883
  On as B,
5872
- Mn as C,
5873
- vr as D,
5884
+ Tn as C,
5885
+ yr as D,
5874
5886
  Hs as E,
5875
- Aa as F,
5887
+ Pe as F,
5876
5888
  An as G,
5877
5889
  qn as H,
5878
- el as I,
5890
+ Aa as I,
5891
+ el as J,
5879
5892
  Hn as L,
5880
5893
  Ea as M,
5881
- Un as N,
5882
- Gn as P,
5883
- Wn as S,
5894
+ Gn as N,
5895
+ Un as P,
5896
+ Jn as S,
5884
5897
  Ps as T,
5885
5898
  Dn as a,
5886
5899
  Rs as b,
5887
5900
  _s as c,
5888
- Ta as d,
5901
+ Ma as d,
5889
5902
  Fa as e,
5890
5903
  La as f,
5891
- Tn as g,
5904
+ Mn as g,
5892
5905
  Fn as h,
5893
5906
  Ln as i,
5894
5907
  En as j,
@@ -5896,16 +5909,16 @@ export {
5896
5909
  Rn as l,
5897
5910
  _n as m,
5898
5911
  Pn as n,
5899
- Bn as o,
5912
+ $n as o,
5900
5913
  Ke as p,
5901
- $n as q,
5914
+ Bn as q,
5902
5915
  Va as r,
5903
- Jn as s,
5916
+ Wn as s,
5904
5917
  Kn as t,
5905
5918
  Qn as u,
5906
5919
  Zn as v,
5907
5920
  Xn as w,
5908
5921
  Yn as x,
5909
- Bs as y,
5910
- Ee as z
5922
+ $s as y,
5923
+ rl as z
5911
5924
  };