react-semaphor 0.0.187 → 0.0.189

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,5 +1,5 @@
1
- import { P as E, b as k, j as e, Q as us, R as xs, U as z, V as Ps, W as ps, X as fs, Y as gs, Z as js, _ as B, $ as ae, a0 as Us, J as Gs, O as Ee, a1 as Va, a2 as qa, a3 as Ra, a4 as _a, a5 as Ha, a6 as Ba, a7 as Ts, a8 as _e, a9 as Ke, aa as We, T as bs, e as Js, g as ys, ab as Oe, ac as Me, f as W, ad as Te, ae as Ae, af as He, ag as Le, ah as X, ai as vs, G as r, aj as Pe, ak as Ue, al as $a, am as Ge, w as Qs, v as Ws, t as he, an as Ka, r as Pa, N as Ys, s as Ua, ao as Ga, B as Ja, ap as Xs, aq as Qa, L as Be, S as Ns, z as Wa, n as As, ar as Es, A as cs, u as es, as as Ce, at as ze, au as Zs, av as ea, aw as sa, ax as aa, ay as ta, az as Ya, aA as Xa, aB as na, aC as Za, aD as et, aE as st, aF as at, aG as tt, aH as ds, aI as nt, aJ as Re, aK as hs, aL as Fe, aM as ms, aN as Ls, aO as lt, aP as rt, aQ as it, aR as ot, aS as ct, aT as ls, aU as dt, aV as Ds, aW as ht, aX as Is, aY as mt, aZ as ut, a_ as xt, a$ as la, l as pt, C as ft, E as Vs, d as gt, h as jt, i as bt, o as yt, b0 as vt, m as Nt, H as Ct, b1 as St, b2 as kt, b3 as wt, b4 as rs, b5 as zt, b6 as is, b7 as qs, K as Ft, b8 as Cs, b9 as Ot, ba as ra, bb as Ye, bc as ia, bd as Mt, be as Tt, bf as At, bg as Et, bh as Lt, bi as Dt, bj as Se, bk as q, bl as R, bm as Ss, bn as _, bo as Rs, bp as It, bq as Vt, br as qt, bs as Rt, bt as _s, bu as _t, bv as Ht, bw as Bt, bx as $t, by as Kt, bz as Pt } from "./index-W8jYjb9k.js";
2
- import me, { useState as T, useEffect as K, useMemo as Ut, useRef as $e } from "react";
1
+ import { P as E, b as k, j as e, Q as xs, R as ps, U as w, V as Ks, W as fs, X as gs, Y as js, Z as bs, _ as B, $ as ae, a0 as Us, J as Gs, O as Ee, a1 as qa, a2 as Va, a3 as Ra, a4 as _a, a5 as Ha, a6 as Ba, a7 as As, a8 as _e, a9 as Pe, aa as We, T as ys, e as Js, g as vs, ab as Oe, ac as Me, f as Y, ad as Te, ae as Ae, af as He, ag as Le, ah as X, ai as Ns, G as i, aj as Ke, ak as Ue, al as $a, am as Ge, w as Qs, v as Ws, t as he, an as Pa, r as Ka, N as Ys, s as Ua, ao as Ga, B as Ja, ap as Xs, aq as Qa, L as Be, S as Cs, z as Wa, n as Es, ar as cs, A as ds, u as es, as as Ce, at as ze, au as Zs, av as ea, aw as sa, ax as aa, ay as ta, az as Ya, aA as Xa, aB as na, aC as Za, aD as et, aE as st, aF as at, aG as tt, aH as hs, aI as nt, aJ as Re, aK as ms, aL as Fe, aM as us, aN as Ls, aO as rt, aP as lt, aQ as it, aR as ot, aS as ct, aT as rs, aU as dt, aV as Ds, aW as ht, aX as Is, aY as mt, aZ as ut, a_ as xt, a$ as ra, l as pt, C as ft, E as qs, d as gt, h as jt, i as bt, o as yt, b0 as vt, m as Nt, H as Ct, b1 as St, b2 as kt, b3 as wt, b4 as ls, b5 as zt, b6 as is, b7 as Vs, K as Ft, b8 as Ss, b9 as Ot, ba as la, bb as Ye, bc as ia, bd as Mt, be as Tt, bf as At, bg as Et, bh as Lt, bi as Dt, bj as Se, bk as V, bl as R, bm as ks, bn as _, bo as Rs, bp as It, bq as qt, br as Vt, bs as Rt, bt as _s, bu as _t, bv as Ht, bw as Bt, bx as $t, by as Pt, bz as Kt } from "./index-CENzhsPS.js";
2
+ import me, { useState as T, useEffect as P, useMemo as Ut, useRef as $e } from "react";
3
3
  /**
4
4
  * @license lucide-react v0.379.0 - ISC
5
5
  *
@@ -31,7 +31,7 @@ const Jt = E("AreaChart", [
31
31
  * This source code is licensed under the ISC license.
32
32
  * See the LICENSE file in the root directory of this source tree.
33
33
  */
34
- const ks = E("BarChart4", [
34
+ const ws = E("BarChart4", [
35
35
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
36
36
  ["path", { d: "M13 17V9", key: "1fwyjl" }],
37
37
  ["path", { d: "M18 17V5", key: "sfb6ij" }],
@@ -155,7 +155,7 @@ const sn = E("Key", [
155
155
  * This source code is licensed under the ISC license.
156
156
  * See the LICENSE file in the root directory of this source tree.
157
157
  */
158
- const ws = E("LineChart", [
158
+ const zs = E("LineChart", [
159
159
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
160
160
  ["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
161
161
  ]);
@@ -204,7 +204,7 @@ const nn = E("ListX", [
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
206
  */
207
- const ln = E("MessageSquareMore", [
207
+ const rn = E("MessageSquareMore", [
208
208
  ["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" }],
209
209
  ["path", { d: "M8 10h.01", key: "19clt8" }],
210
210
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -216,7 +216,7 @@ const ln = E("MessageSquareMore", [
216
216
  * This source code is licensed under the ISC license.
217
217
  * See the LICENSE file in the root directory of this source tree.
218
218
  */
219
- const rn = E("Network", [
219
+ const ln = E("Network", [
220
220
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
221
221
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
222
222
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -388,37 +388,37 @@ const gn = E("User", [
388
388
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
389
389
  ]);
390
390
  function jn() {
391
- const [s, n] = T(""), [a, t] = T(!1), [i, o] = T(!1), l = k((h) => h.dashboard);
392
- function c() {
393
- const h = Gs(l), g = Ee(l.id), m = JSON.parse(localStorage.getItem(g) || "[]");
391
+ const [s, n] = T(""), [a, t] = T(!1), [o, c] = T(!1), r = k((d) => d.dashboard);
392
+ function l() {
393
+ const d = Gs(r), f = Ee(r.id), m = JSON.parse(localStorage.getItem(f) || "[]");
394
394
  if (m.some(
395
- (N) => N.name === s
395
+ (S) => S.name === s
396
396
  )) {
397
397
  t(!0);
398
398
  return;
399
399
  }
400
400
  m.push({
401
401
  name: s,
402
- template: h
403
- }), localStorage.setItem(g, JSON.stringify(m)), o(!1);
402
+ template: d
403
+ }), localStorage.setItem(f, JSON.stringify(m)), c(!1);
404
404
  }
405
- return /* @__PURE__ */ e.jsxs(us, { open: i, onOpenChange: o, children: [
406
- /* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
407
- z,
405
+ return /* @__PURE__ */ e.jsxs(xs, { open: o, onOpenChange: c, children: [
406
+ /* @__PURE__ */ e.jsx(ps, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
407
+ w,
408
408
  {
409
409
  variant: "outline",
410
410
  className: "h-7 p-2",
411
411
  size: "sm",
412
412
  children: [
413
- /* @__PURE__ */ e.jsx(Ps, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
413
+ /* @__PURE__ */ e.jsx(Ks, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
414
414
  "Add Lens"
415
415
  ]
416
416
  }
417
417
  ) }),
418
- /* @__PURE__ */ e.jsxs(ps, { className: "sm:max-w-[425px]", children: [
419
- /* @__PURE__ */ e.jsxs(fs, { children: [
420
- /* @__PURE__ */ e.jsx(gs, { children: "Add a Lens" }),
421
- /* @__PURE__ */ e.jsx(js, { children: "Lenses are private by default and are only visible to you." })
418
+ /* @__PURE__ */ e.jsxs(fs, { className: "sm:max-w-[425px]", children: [
419
+ /* @__PURE__ */ e.jsxs(gs, { children: [
420
+ /* @__PURE__ */ e.jsx(js, { children: "Add a Lens" }),
421
+ /* @__PURE__ */ e.jsx(bs, { children: "Lenses are private by default and are only visible to you." })
422
422
  ] }),
423
423
  /* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
424
424
  /* @__PURE__ */ e.jsx(B, { className: "text-right", children: "Name" }),
@@ -426,8 +426,8 @@ function jn() {
426
426
  ae,
427
427
  {
428
428
  value: s,
429
- onChange: (h) => {
430
- a && t(!1), n(h.target.value);
429
+ onChange: (d) => {
430
+ a && t(!1), n(d.target.value);
431
431
  },
432
432
  id: "name",
433
433
  className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
@@ -436,12 +436,12 @@ function jn() {
436
436
  ] }) }),
437
437
  a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The bookmark name already exists. Use a differnet name." }),
438
438
  /* @__PURE__ */ e.jsx(Us, { children: /* @__PURE__ */ e.jsx(
439
- z,
439
+ w,
440
440
  {
441
441
  variant: "outline",
442
442
  type: "submit",
443
443
  disabled: !s,
444
- onClick: c,
444
+ onClick: l,
445
445
  children: "Save"
446
446
  }
447
447
  ) })
@@ -449,33 +449,33 @@ function jn() {
449
449
  ] });
450
450
  }
451
451
  function bn() {
452
- const [s, n] = T(!1), [a, t] = T(""), i = k((d) => d.dashboard), o = k((d) => d.bookmarkKey), [l, c] = T([]), h = k((d) => d.actions.setDashboard), g = k(
453
- (d) => d.actions.setFilterValues
452
+ const [s, n] = T(!1), [a, t] = T(""), o = k((h) => h.dashboard), c = k((h) => h.bookmarkKey), [r, l] = T([]), d = k((h) => h.actions.setDashboard), f = k(
453
+ (h) => h.actions.setFilterValues
454
454
  ), m = k(
455
- (d) => d.actions.setBookmarkKey
455
+ (h) => h.actions.setBookmarkKey
456
456
  );
457
- K(() => {
458
- const d = Ee(i.id), x = JSON.parse(localStorage.getItem(d) || "[]");
459
- c(x);
460
- const f = x.find(
461
- (w) => w.default
457
+ P(() => {
458
+ const h = Ee(o.id), x = JSON.parse(localStorage.getItem(h) || "[]");
459
+ l(x);
460
+ const g = x.find(
461
+ (z) => z.default
462
462
  );
463
- f && f.name === o && t(f.name);
464
- }, [s, i, o]);
465
- function u(d) {
466
- if (d === a)
463
+ g && g.name === c && t(g.name);
464
+ }, [s, o, c]);
465
+ function u(h) {
466
+ if (h === a)
467
467
  return;
468
- const x = l.find((w) => w.name === d), f = x == null ? void 0 : x.template;
469
- f && (h(f), g(x.filterValues || []), m(d === "Original" ? "" : d)), t(d);
468
+ const x = r.find((z) => z.name === h), g = x == null ? void 0 : x.template;
469
+ g && (d(g), f(x.filterValues || []), m(h === "Original" ? "" : h)), t(h);
470
470
  }
471
- function N(d) {
472
- const x = Ee(i.id), w = JSON.parse(localStorage.getItem(x) || "[]").filter(
473
- (b) => b.name !== d
471
+ function S(h) {
472
+ const x = Ee(o.id), z = JSON.parse(localStorage.getItem(x) || "[]").filter(
473
+ (b) => b.name !== h
474
474
  );
475
- localStorage.setItem(x, JSON.stringify(w)), c(w);
475
+ localStorage.setItem(x, JSON.stringify(z)), l(z);
476
476
  }
477
- return /* @__PURE__ */ e.jsxs(Va, { open: s, onOpenChange: n, children: [
478
- /* @__PURE__ */ e.jsx(qa, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
477
+ return /* @__PURE__ */ e.jsxs(qa, { open: s, onOpenChange: n, children: [
478
+ /* @__PURE__ */ e.jsx(Va, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
479
479
  /* @__PURE__ */ e.jsxs(Ra, { className: "w-56", children: [
480
480
  /* @__PURE__ */ e.jsx(_a, { children: "Lenses" }),
481
481
  /* @__PURE__ */ e.jsx(Ha, {}),
@@ -485,20 +485,20 @@ function bn() {
485
485
  value: a,
486
486
  onValueChange: u,
487
487
  children: [
488
- /* @__PURE__ */ e.jsx(Ts, { value: "Original", children: "Original" }),
489
- l.filter((d) => d.name != "Original").map((d, x) => /* @__PURE__ */ e.jsxs(
490
- Ts,
488
+ /* @__PURE__ */ e.jsx(As, { value: "Original", children: "Original" }),
489
+ r.filter((h) => h.name != "Original").map((h, x) => /* @__PURE__ */ e.jsxs(
490
+ As,
491
491
  {
492
492
  className: "xbg-red-100 flex justify-between",
493
- value: d.name,
494
- defaultChecked: d.name === o,
493
+ value: h.name,
494
+ defaultChecked: h.name === c,
495
495
  children: [
496
- /* @__PURE__ */ e.jsx("p", { children: d.name }),
496
+ /* @__PURE__ */ e.jsx("p", { children: h.name }),
497
497
  /* @__PURE__ */ e.jsx(
498
498
  _e,
499
499
  {
500
- onClick: (f) => {
501
- f.preventDefault(), N(d.name);
500
+ onClick: (g) => {
501
+ g.preventDefault(), S(h.name);
502
502
  },
503
503
  className: "h-3 w-3 hover:cursor-pointer",
504
504
  strokeWidth: 1.5
@@ -515,33 +515,33 @@ function bn() {
515
515
  ] });
516
516
  }
517
517
  function yn() {
518
- const [s, n] = T(!1), a = k((o) => o.dashboard), t = k((o) => o.bookmarkKey);
519
- K(() => {
518
+ const [s, n] = T(!1), a = k((c) => c.dashboard), t = k((c) => c.bookmarkKey);
519
+ P(() => {
520
520
  if (!t) {
521
521
  n(!1);
522
522
  return;
523
523
  }
524
- const o = Ee(a.id), c = JSON.parse(
525
- localStorage.getItem(o) || "[]"
524
+ const c = Ee(a.id), l = JSON.parse(
525
+ localStorage.getItem(c) || "[]"
526
526
  ).find(
527
- (h) => h.name === t
527
+ (d) => d.name === t
528
528
  );
529
- n(c ? c.default : !1);
529
+ n(l ? l.default : !1);
530
530
  }, [t, a.id]);
531
- function i(o) {
532
- if (n(o), !t)
531
+ function o(c) {
532
+ if (n(c), !t)
533
533
  return;
534
- const l = Ee(a.id), h = JSON.parse(
535
- localStorage.getItem(l) || "[]"
536
- ).map((g) => (g.name === t ? g.default = o : g.default = !1, g));
537
- console.log(h), localStorage.setItem(l, JSON.stringify(h));
534
+ const r = Ee(a.id), d = JSON.parse(
535
+ localStorage.getItem(r) || "[]"
536
+ ).map((f) => (f.name === t ? f.default = c : f.default = !1, f));
537
+ console.log(d), localStorage.setItem(r, JSON.stringify(d));
538
538
  }
539
539
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
540
540
  /* @__PURE__ */ e.jsx(
541
- Ke,
541
+ Pe,
542
542
  {
543
543
  checked: s,
544
- onCheckedChange: i,
544
+ onCheckedChange: o,
545
545
  id: "terms"
546
546
  }
547
547
  ),
@@ -560,16 +560,16 @@ function vn() {
560
560
  k((b) => b.selectedSheetId);
561
561
  const a = k(
562
562
  (b) => b.isDashboardEditing
563
- ), t = k((b) => b.filterValues), i = k((b) => b.isVisualEditing), o = k((b) => b.showFilters);
563
+ ), t = k((b) => b.filterValues), o = k((b) => b.isVisualEditing), c = k((b) => b.showFilters);
564
564
  k(
565
565
  (b) => b.showDashboardJSON
566
566
  );
567
- const l = k((b) => b.onSaveFunction), c = k(
567
+ const r = k((b) => b.onSaveFunction), l = k(
568
568
  (b) => b.actions.setShowFilters
569
- ), { addFrame: h, setSelectedFrameId: g } = k(
569
+ ), { addFrame: d, setSelectedFrameId: f } = k(
570
570
  (b) => b.actions
571
- ), { getSelectedSheet: m, setIsDashboardEditing: u, setShowDashboardJSON: N } = k((b) => b.actions), d = m(), x = () => {
572
- if (!a || !d)
571
+ ), { getSelectedSheet: m, setIsDashboardEditing: u, setShowDashboardJSON: S } = k((b) => b.actions), h = m(), x = () => {
572
+ if (!a || !h)
573
573
  return;
574
574
  const b = {
575
575
  id: We(),
@@ -591,34 +591,34 @@ function vn() {
591
591
  cards: [b],
592
592
  activeCardId: b.id
593
593
  };
594
- h(d.id, L), g(L.id);
595
- }, f = () => {
594
+ d(h.id, L), f(L.id);
595
+ }, g = () => {
596
596
  u(!0);
597
597
  };
598
- function w() {
598
+ function z() {
599
599
  if (!s || s === "")
600
600
  return;
601
- const b = Gs(n), L = Ee(n.id), C = JSON.parse(localStorage.getItem(L) || "[]"), O = C.findIndex(
601
+ const b = Gs(n), L = Ee(n.id), N = JSON.parse(localStorage.getItem(L) || "[]"), O = N.findIndex(
602
602
  (j) => j.name === s
603
603
  );
604
- O !== -1 ? C[O] = {
604
+ O !== -1 ? N[O] = {
605
605
  name: s,
606
606
  template: b,
607
- default: C[O].default,
607
+ default: N[O].default,
608
608
  filterValues: t
609
- } : C.push({
609
+ } : N.push({
610
610
  name: s,
611
611
  template: b,
612
612
  filterValues: t
613
- }), localStorage.setItem(L, JSON.stringify(C)), l == null || l(b);
613
+ }), localStorage.setItem(L, JSON.stringify(N)), r == null || r(b);
614
614
  }
615
- return i ? null : /* @__PURE__ */ e.jsxs(
615
+ return o ? null : /* @__PURE__ */ e.jsxs(
616
616
  "div",
617
617
  {
618
618
  className: "flex items-center justify-between gap-2 border-b bg-muted/50 px-2 py-2",
619
619
  role: "dashboard-controls",
620
620
  children: [
621
- !i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
621
+ !o && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
622
622
  /* @__PURE__ */ e.jsx(B, { children: s }),
623
623
  !!s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
624
624
  /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "|" }),
@@ -626,10 +626,10 @@ function vn() {
626
626
  ] })
627
627
  ] }),
628
628
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
629
- a && !i && /* @__PURE__ */ e.jsx(jn, {}),
630
- !i && /* @__PURE__ */ e.jsx(bn, {}),
631
- a && !i && /* @__PURE__ */ e.jsxs(
632
- z,
629
+ a && !o && /* @__PURE__ */ e.jsx(jn, {}),
630
+ !o && /* @__PURE__ */ e.jsx(bn, {}),
631
+ a && !o && /* @__PURE__ */ e.jsxs(
632
+ w,
633
633
  {
634
634
  variant: "outline",
635
635
  className: "h-7 p-2",
@@ -637,56 +637,56 @@ function vn() {
637
637
  disabled: !a,
638
638
  onClick: x,
639
639
  children: [
640
- /* @__PURE__ */ e.jsx(Ps, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
640
+ /* @__PURE__ */ e.jsx(Ks, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
641
641
  "Add Frame"
642
642
  ]
643
643
  }
644
644
  ),
645
645
  !a && /* @__PURE__ */ e.jsx(
646
- z,
646
+ w,
647
647
  {
648
648
  variant: "outline",
649
649
  className: "h-7 p-2",
650
- onClick: f,
650
+ onClick: g,
651
651
  size: "sm",
652
652
  children: /* @__PURE__ */ e.jsx(da, { className: "h-4 w-4", strokeWidth: 1.5 })
653
653
  }
654
654
  ),
655
- a && !i && /* @__PURE__ */ e.jsx(
656
- z,
655
+ a && !o && /* @__PURE__ */ e.jsx(
656
+ w,
657
657
  {
658
658
  variant: "outline",
659
659
  role: "close",
660
660
  className: "h-7 p-2",
661
661
  onClick: () => {
662
- u(!1), N(!1);
662
+ u(!1), S(!1);
663
663
  },
664
664
  size: "sm",
665
665
  children: /* @__PURE__ */ e.jsx(_e, { className: "h-4 w-4", strokeWidth: 1.5 })
666
666
  }
667
667
  ),
668
- a && !i && /* @__PURE__ */ e.jsx(
669
- z,
668
+ a && !o && /* @__PURE__ */ e.jsx(
669
+ w,
670
670
  {
671
671
  className: "h-7 p-2",
672
672
  variant: "outline",
673
- onClick: w,
673
+ onClick: z,
674
674
  size: "sm",
675
675
  children: /* @__PURE__ */ e.jsx(dn, { className: "h-4 w-4", strokeWidth: 1.5 })
676
676
  }
677
677
  ),
678
- !o && !i && a && /* @__PURE__ */ e.jsx(
679
- z,
678
+ !c && !o && a && /* @__PURE__ */ e.jsx(
679
+ w,
680
680
  {
681
681
  className: "h-7 p-2",
682
682
  variant: "outline",
683
- onClick: () => c(!0),
683
+ onClick: () => l(!0),
684
684
  size: "sm",
685
685
  children: /* @__PURE__ */ e.jsx(oa, { className: "h-4 w-4", strokeWidth: 1.5 })
686
686
  }
687
687
  ),
688
- !i && a && !1,
689
- !i && !1
688
+ !o && a && !1,
689
+ !o && !1
690
690
  ] })
691
691
  ]
692
692
  }
@@ -697,68 +697,68 @@ function Qe({
697
697
  items: n,
698
698
  value: a,
699
699
  isLoading: t,
700
- isError: i,
701
- connectionTooltip: o,
702
- onChange: l,
703
- className: c,
704
- showIcon: h = !0,
705
- disabled: g = !1
700
+ isError: o,
701
+ connectionTooltip: c,
702
+ onChange: r,
703
+ className: l,
704
+ showIcon: d = !0,
705
+ disabled: f = !1
706
706
  }) {
707
- const m = t ? "Loading..." : i ? "Error" : a;
707
+ const m = t ? "Loading..." : o ? "Error" : a;
708
708
  function u() {
709
709
  if (s === "Connection")
710
710
  return /* @__PURE__ */ e.jsx(cn, { className: "size-4 rotate-90" });
711
711
  if (s === "Database")
712
712
  return /* @__PURE__ */ e.jsx(Wt, { className: "size-4" });
713
713
  if (s === "Schema")
714
- return /* @__PURE__ */ e.jsx(rn, { className: "size-4" });
714
+ return /* @__PURE__ */ e.jsx(ln, { className: "size-4" });
715
715
  if (s === "Table")
716
- return /* @__PURE__ */ e.jsx(vs, { className: "size-4" });
716
+ return /* @__PURE__ */ e.jsx(Ns, { className: "size-4" });
717
717
  }
718
718
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
719
- h && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(bs, { children: [
719
+ d && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: c ? /* @__PURE__ */ e.jsxs(ys, { children: [
720
720
  /* @__PURE__ */ e.jsx(Js, { children: u() }),
721
- /* @__PURE__ */ e.jsx(ys, { className: "text-xs", align: "start", children: o })
721
+ /* @__PURE__ */ e.jsx(vs, { className: "text-xs", align: "start", children: c })
722
722
  ] }) : u() }),
723
- /* @__PURE__ */ e.jsxs(Oe, { disabled: g, value: m, onValueChange: l, children: [
723
+ /* @__PURE__ */ e.jsxs(Oe, { disabled: f, value: m, onValueChange: r, children: [
724
724
  /* @__PURE__ */ e.jsx(
725
725
  Me,
726
726
  {
727
- className: W(
727
+ className: Y(
728
728
  "h-9 w-full focus:ring-1 focus:ring-offset-0",
729
- c
729
+ l
730
730
  ),
731
731
  children: /* @__PURE__ */ e.jsx(
732
732
  Te,
733
733
  {
734
- placeholder: t ? "Loading..." : i ? "Error" : `Select ${s}`
734
+ placeholder: t ? "Loading..." : o ? "Error" : `Select ${s}`
735
735
  }
736
736
  )
737
737
  }
738
738
  ),
739
739
  /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
740
740
  t ? /* @__PURE__ */ e.jsx(Le, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Le, { children: s }),
741
- /* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((N, d) => /* @__PURE__ */ e.jsx(X, { value: N.id, children: N.name }, d)) }),
742
- (t || i) && /* @__PURE__ */ e.jsx(X, { value: m, children: m })
741
+ /* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((S, h) => /* @__PURE__ */ e.jsx(X, { value: S.id, children: S.name }, h)) }),
742
+ (t || o) && /* @__PURE__ */ e.jsx(X, { value: m, children: m })
743
743
  ] }) })
744
744
  ] })
745
745
  ] });
746
746
  }
747
747
  function Nn({ column: s }) {
748
- const [n, a] = T(!1), t = r((m) => m.selectedTableName), i = r(
748
+ const [n, a] = T(!1), t = i((m) => m.selectedTableName), o = i(
749
749
  (m) => m.selectedSchemaName
750
- ), o = r((m) => m.sqlGen), l = r((m) => m.actions.setSqlGen), c = r((m) => m.actions.setCardSql), h = r((m) => m.actions.setRunSql);
751
- function g(m, u) {
752
- const N = Qs(m, o, u);
753
- l(N);
754
- const d = Ws(
755
- N,
756
- he(i || ""),
750
+ ), c = i((m) => m.sqlGen), r = i((m) => m.actions.setSqlGen), l = i((m) => m.actions.setCardSql), d = i((m) => m.actions.setRunSql);
751
+ function f(m, u) {
752
+ const S = Qs(m, c, u);
753
+ r(S);
754
+ const h = Ws(
755
+ S,
756
+ he(o || ""),
757
757
  he(t)
758
758
  );
759
- d && (c(d), h(!0)), a(!1);
759
+ h && (l(h), d(!0)), a(!1);
760
760
  }
761
- return /* @__PURE__ */ e.jsxs(Pe, { open: n, onOpenChange: a, children: [
761
+ return /* @__PURE__ */ e.jsxs(Ke, { open: n, onOpenChange: a, children: [
762
762
  /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx($a, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
763
763
  /* @__PURE__ */ e.jsx(
764
764
  Ge,
@@ -769,7 +769,7 @@ function Nn({ column: s }) {
769
769
  /* @__PURE__ */ e.jsx(
770
770
  "li",
771
771
  {
772
- onClick: () => g(s, "COUNT"),
772
+ onClick: () => f(s, "COUNT"),
773
773
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
774
774
  children: "Count"
775
775
  }
@@ -777,7 +777,7 @@ function Nn({ column: s }) {
777
777
  /* @__PURE__ */ e.jsx(
778
778
  "li",
779
779
  {
780
- onClick: () => g(s, "AVG"),
780
+ onClick: () => f(s, "AVG"),
781
781
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
782
782
  children: "Avg"
783
783
  }
@@ -785,7 +785,7 @@ function Nn({ column: s }) {
785
785
  /* @__PURE__ */ e.jsx(
786
786
  "li",
787
787
  {
788
- onClick: () => g(s, "SUM"),
788
+ onClick: () => f(s, "SUM"),
789
789
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
790
790
  children: "Sum"
791
791
  }
@@ -793,7 +793,7 @@ function Nn({ column: s }) {
793
793
  /* @__PURE__ */ e.jsx(
794
794
  "li",
795
795
  {
796
- onClick: () => g(s, "MAX"),
796
+ onClick: () => f(s, "MAX"),
797
797
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
798
798
  children: "Max"
799
799
  }
@@ -801,7 +801,7 @@ function Nn({ column: s }) {
801
801
  /* @__PURE__ */ e.jsx(
802
802
  "li",
803
803
  {
804
- onClick: () => g(s, "MIN"),
804
+ onClick: () => f(s, "MIN"),
805
805
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
806
806
  children: "Min"
807
807
  }
@@ -812,15 +812,15 @@ function Nn({ column: s }) {
812
812
  ] });
813
813
  }
814
814
  function ua({ column: s }) {
815
- return /* @__PURE__ */ e.jsxs(bs, { children: [
816
- /* @__PURE__ */ e.jsx(Ka, { asChild: !0, children: Pa.includes(s.data_type.toLowerCase()) ? (
815
+ return /* @__PURE__ */ e.jsxs(ys, { children: [
816
+ /* @__PURE__ */ e.jsx(Pa, { asChild: !0, children: Ka.includes(s.data_type.toLowerCase()) ? (
817
817
  // <span className=" font-thin">T</span>
818
818
  /* @__PURE__ */ e.jsx(fn, { className: "size-3" })
819
819
  ) : Ys.includes(s.data_type.toLowerCase()) ? (
820
820
  //
821
821
  /* @__PURE__ */ e.jsx(en, { className: "size-3" })
822
822
  ) : Ua.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Ga, { className: "size-3" }) : Ja.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(pn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(hn, { className: "size-3" }) }),
823
- /* @__PURE__ */ e.jsx(ys, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
823
+ /* @__PURE__ */ e.jsx(vs, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
824
824
  ] });
825
825
  }
826
826
  function Cn({
@@ -829,64 +829,66 @@ function Cn({
829
829
  columns: a,
830
830
  status: t
831
831
  }) {
832
- const i = r((j) => j.sqlGen), o = r(
832
+ const o = i((j) => j.sqlGen), c = i(
833
833
  (j) => j.selectedConnectionId
834
- ), l = r(
834
+ ), r = i(
835
835
  (j) => j.selectedDatabaseName
836
- ), c = r(
836
+ ), l = i(
837
837
  (j) => j.selectedSchemaName
838
- ), h = r((j) => j.selectedTableName), g = k(
838
+ ), d = i((j) => j.selectedTableName), f = k(
839
839
  (j) => j.dashboard.aiScopeTables
840
- ), { setAIScopeTables: m } = k((j) => j.actions), u = r((j) => j.actions.setRunSql), N = r((j) => j.actions.setSqlGen), d = r(
840
+ ), { setAIScopeTables: m } = k((j) => j.actions), u = i((j) => j.actions.setRunSql), S = i((j) => j.actions.setSqlGen), h = i(
841
841
  (j) => j.actions.setIsShowingVisual
842
- ), x = r((j) => j.actions.setCardSql), { connectionType: f } = xa();
843
- function w(j) {
844
- const F = Qs(j, i);
845
- N(F);
842
+ ), x = i((j) => j.actions.setCardSql), { connectionType: g } = xa();
843
+ function z(j) {
844
+ const F = Qs(j, o);
845
+ S(F);
846
846
  const A = Ws(F, he(s), he(n));
847
847
  A && (x(A), u(!0));
848
848
  }
849
849
  function b() {
850
- return (g == null ? void 0 : g.find(
851
- (j) => j.connectinonId === o && j.tableName === h
850
+ return (f == null ? void 0 : f.find(
851
+ (j) => j.connectinonId === c && j.tableName === d
852
852
  )) !== void 0;
853
853
  }
854
854
  function L(j) {
855
- if (j === !0 && h && o) {
855
+ if (j === !0 && d && c) {
856
856
  const F = {
857
- connectinonId: o,
858
- connectionType: f,
859
- databaseName: l,
860
- schemaName: c,
861
- tableName: h
862
- }, V = [...g || [], F].filter(
863
- (Y, $, P) => P.findIndex(
864
- (D) => D.connectinonId === Y.connectinonId && D.tableName === Y.tableName
857
+ connectinonId: c,
858
+ connectionType: g,
859
+ databaseName: r,
860
+ schemaName: l,
861
+ tableName: d
862
+ }, q = [...f || [], F].filter(
863
+ (K, $, G) => G.findIndex(
864
+ (D) => D.connectinonId === K.connectinonId && D.tableName === K.tableName
865
865
  ) === $
866
866
  );
867
- m(V), Es.success(`Added '${h}' to AI Scope`, {
867
+ m(q), cs.success(`Added '${d}' to AI Scope`, {
868
868
  position: "top-right",
869
869
  duration: 2500,
870
870
  richColors: !0
871
871
  });
872
872
  } else {
873
- const F = (g || []).filter(
874
- (A) => A.connectinonId !== o && A.tableName !== h
873
+ const F = (f || []).filter(
874
+ (A) => A.connectinonId !== c && A.tableName !== d
875
875
  );
876
- m(F), Es(`Removed '${h}' from AI Scope`, {
876
+ m(F), cs(`Removed '${d}' from AI Scope`, {
877
877
  position: "top-right",
878
878
  duration: 2e3,
879
879
  richColors: !0
880
880
  });
881
881
  }
882
882
  }
883
- function C() {
884
- let F = cs(s, n);
885
- ((V) => V.charAt(0) === V.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1), x(`SELECT * FROM ${F} LIMIT 10`), u(!0);
883
+ function N() {
884
+ let F = ds(s, n);
885
+ ((K) => K.charAt(0) === K.charAt(0).toUpperCase())(n) && (F = `"${n}"`), h(!1);
886
+ const q = g === "MSSQL" ? `SELECT top 10 * FROM ${F}` : `SELECT * FROM ${F} LIMIT 10`;
887
+ x(q), u(!0);
886
888
  }
887
889
  function O() {
888
- let F = cs(s, n);
889
- ((V) => V.charAt(0) === V.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1), x(`SELECT COUNT(*) FROM ${F}`), u(!0);
890
+ let F = ds(s, n);
891
+ ((q) => q.charAt(0) === q.charAt(0).toUpperCase())(n) && (F = `"${n}"`), h(!1), x(`SELECT COUNT(*) as count FROM ${F}`), u(!0);
890
892
  }
891
893
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
892
894
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
@@ -901,7 +903,7 @@ function Cn({
901
903
  children: /* @__PURE__ */ e.jsx(
902
904
  Qa,
903
905
  {
904
- className: W("size-4", {
906
+ className: Y("size-4", {
905
907
  "text-primary": b(),
906
908
  "text-muted-foreground": !b()
907
909
  })
@@ -910,10 +912,10 @@ function Cn({
910
912
  }
911
913
  ),
912
914
  /* @__PURE__ */ e.jsxs(
913
- z,
915
+ w,
914
916
  {
915
917
  disabled: t !== "Success",
916
- onClick: C,
918
+ onClick: N,
917
919
  size: "sm",
918
920
  variant: "secondary",
919
921
  className: "flex",
@@ -924,7 +926,7 @@ function Cn({
924
926
  }
925
927
  ),
926
928
  /* @__PURE__ */ e.jsxs(
927
- z,
929
+ w,
928
930
  {
929
931
  disabled: t !== "Success",
930
932
  onClick: O,
@@ -939,18 +941,18 @@ function Cn({
939
941
  )
940
942
  ] }),
941
943
  /* @__PURE__ */ e.jsxs(
942
- Ns,
944
+ Cs,
943
945
  {
944
946
  className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
945
947
  children: [
946
948
  a == null ? void 0 : a.map((j) => /* @__PURE__ */ e.jsxs(
947
949
  "div",
948
950
  {
949
- onClick: () => w(j),
950
- className: W(
951
+ onClick: () => z(j),
952
+ className: Y(
951
953
  "mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
952
954
  {
953
- "bg-muted": Wa(j, i)
955
+ "bg-muted": Wa(j, o)
954
956
  }
955
957
  ),
956
958
  children: [
@@ -970,46 +972,46 @@ function Cn({
970
972
  },
971
973
  j.column_name
972
974
  )),
973
- /* @__PURE__ */ e.jsx(As, { orientation: "vertical" }),
974
- /* @__PURE__ */ e.jsx(As, { orientation: "horizontal" })
975
+ /* @__PURE__ */ e.jsx(Es, { orientation: "vertical" }),
976
+ /* @__PURE__ */ e.jsx(Es, { orientation: "horizontal" })
975
977
  ]
976
978
  }
977
979
  )
978
980
  ] });
979
981
  }
980
982
  function xa(s, n) {
981
- var ss, ve, Je, Ve;
983
+ var ss, ve, Je, qe;
982
984
  let a = Ut(() => [], []);
983
- const t = es().authToken || s, i = r(
984
- (S) => S.selectedConnectionId
985
- ), o = r(
986
- (S) => S.selectedDatabaseName
987
- ), l = r(
988
- (S) => S.selectedSchemaName
989
- ), c = r((S) => S.selectedTableName), h = r(
990
- (S) => S.actions.setCurrentColumns
991
- ), g = r(
992
- (S) => S.actions.setSelectedConnectionId
993
- ), m = r(
994
- (S) => S.actions.setSelectedDatabaseName
995
- ), u = r(
996
- (S) => S.actions.setSelectedSchemaName
997
- ), N = r(
998
- (S) => S.actions.setSelectedTableName
999
- ), d = r((S) => S.actions.setCardSql);
1000
- function x(S) {
1001
- return i && o && l && o !== "NA" ? !0 : i && S === "API" ? !1 : !!(i && S === "S3");
985
+ const t = es().authToken || s, o = i(
986
+ (C) => C.selectedConnectionId
987
+ ), c = i(
988
+ (C) => C.selectedDatabaseName
989
+ ), r = i(
990
+ (C) => C.selectedSchemaName
991
+ ), l = i((C) => C.selectedTableName), d = i(
992
+ (C) => C.actions.setCurrentColumns
993
+ ), f = i(
994
+ (C) => C.actions.setSelectedConnectionId
995
+ ), m = i(
996
+ (C) => C.actions.setSelectedDatabaseName
997
+ ), u = i(
998
+ (C) => C.actions.setSelectedSchemaName
999
+ ), S = i(
1000
+ (C) => C.actions.setSelectedTableName
1001
+ ), h = i((C) => C.actions.setCardSql);
1002
+ function x(C) {
1003
+ return o && c && r && c !== "NA" ? !0 : o && C === "API" ? !1 : !!(o && C === "S3");
1002
1004
  }
1003
- function f(S) {
1004
- return !!(i && o && o !== "NA" && l && c || i && (S === "S3" || S === "API"));
1005
+ function g(C) {
1006
+ return !!(o && c && c !== "NA" && r && l || o && (C === "S3" || C === "API"));
1005
1007
  }
1006
- function w(S) {
1007
- return i && S ? !(S === "API" || S === "S3") : !1;
1008
+ function z(C) {
1009
+ return o && C ? !(C === "API" || C === "S3") : !1;
1008
1010
  }
1009
1011
  const {
1010
1012
  data: b,
1011
1013
  isLoading: L,
1012
- isError: C
1014
+ isError: N
1013
1015
  } = Ce({
1014
1016
  queryKey: ["connections"],
1015
1017
  queryFn: () => ze(
@@ -1019,44 +1021,44 @@ function xa(s, n) {
1019
1021
  enabled: !!(t != null && t.accessToken)
1020
1022
  // Only fetch if authToken is present
1021
1023
  }), O = b == null ? void 0 : b.connections.find(
1022
- (S) => S.id === i
1024
+ (C) => C.id === o
1023
1025
  ), j = O == null ? void 0 : O.type, F = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
1024
1026
  data: A,
1025
- isLoading: V,
1026
- isFetching: Y,
1027
+ isLoading: q,
1028
+ isFetching: K,
1027
1029
  isError: $,
1028
- refetch: P
1030
+ refetch: G
1029
1031
  } = Ce({
1030
- queryKey: ["databases", i],
1032
+ queryKey: ["databases", o],
1031
1033
  queryFn: () => ze(
1032
1034
  "https://semaphor.cloud/api/v1/databases",
1033
1035
  (t == null ? void 0 : t.accessToken) || "",
1034
1036
  {
1035
- connection_id: i
1037
+ connection_id: o
1036
1038
  }
1037
1039
  ),
1038
- enabled: w(j)
1040
+ enabled: z(j)
1039
1041
  // !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
1040
1042
  }), {
1041
1043
  data: D,
1042
1044
  isLoading: te,
1043
- isFetching: J,
1045
+ isFetching: Q,
1044
1046
  isError: ee,
1045
1047
  refetch: Z
1046
1048
  } = Ce({
1047
- queryKey: ["schemas", i, o],
1049
+ queryKey: ["schemas", o, c],
1048
1050
  queryFn: () => ze(
1049
1051
  "https://semaphor.cloud/api/v1/schemas",
1050
1052
  (t == null ? void 0 : t.accessToken) || "",
1051
1053
  {
1052
- connection_id: i,
1053
- database_name: o
1054
+ connection_id: o,
1055
+ database_name: c
1054
1056
  }
1055
1057
  ),
1056
- enabled: !!i && !!o && !F && o !== "NA"
1058
+ enabled: !!o && !!c && !F && c !== "NA"
1057
1059
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1058
1060
  }), {
1059
- data: U,
1061
+ data: J,
1060
1062
  isLoading: I,
1061
1063
  isFetching: y,
1062
1064
  isError: v,
@@ -1064,17 +1066,17 @@ function xa(s, n) {
1064
1066
  } = Ce({
1065
1067
  queryKey: [
1066
1068
  "tables",
1067
- i,
1068
1069
  o,
1069
- l
1070
+ c,
1071
+ r
1070
1072
  ],
1071
1073
  queryFn: () => ze(
1072
1074
  "https://semaphor.cloud/api/v1/tables",
1073
1075
  (t == null ? void 0 : t.accessToken) || "",
1074
1076
  {
1075
- connection_id: i,
1076
- database_name: o,
1077
- schema_name: l
1077
+ connection_id: o,
1078
+ database_name: c,
1079
+ schema_name: r
1078
1080
  }
1079
1081
  ),
1080
1082
  enabled: x(j)
@@ -1086,22 +1088,22 @@ function xa(s, n) {
1086
1088
  } = Ce({
1087
1089
  queryKey: [
1088
1090
  "columns",
1089
- i,
1090
1091
  o,
1091
- l,
1092
- c
1092
+ c,
1093
+ r,
1094
+ l
1093
1095
  ],
1094
1096
  queryFn: () => ze(
1095
1097
  "https://semaphor.cloud/api/v1/columns",
1096
1098
  (t == null ? void 0 : t.accessToken) || "",
1097
1099
  {
1098
- connection_id: i,
1099
- database_name: o,
1100
- schema_name: l,
1101
- table_name: c
1100
+ connection_id: o,
1101
+ database_name: c,
1102
+ schema_name: r,
1103
+ table_name: l
1102
1104
  }
1103
1105
  ),
1104
- enabled: f(j)
1106
+ enabled: g(j)
1105
1107
  // (!!selectedConnectionId &&
1106
1108
  // !!selectedDatabaseName &&
1107
1109
  // !!selectedSchemaName &&
@@ -1110,56 +1112,56 @@ function xa(s, n) {
1110
1112
  //currentConnection?.type === 'API',
1111
1113
  // && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
1112
1114
  });
1113
- K(() => {
1114
- h(a);
1115
- }, [H, h, a]), K(() => {
1115
+ P(() => {
1116
+ d(a);
1117
+ }, [H, d, a]), P(() => {
1116
1118
  }, [
1117
1119
  F,
1118
- d,
1119
- N,
1120
+ h,
1121
+ S,
1120
1122
  u,
1121
1123
  m,
1122
1124
  O
1123
1125
  ]);
1124
- const je = (O == null ? void 0 : O.type) === "API" ? (ss = O == null ? void 0 : O.type) == null ? void 0 : ss.toLowerCase() : c || "", be = F ? "" : l || "";
1125
- function xe(S) {
1126
- u(S), N("");
1126
+ const je = (O == null ? void 0 : O.type) === "API" ? (ss = O == null ? void 0 : O.type) == null ? void 0 : ss.toLowerCase() : l || "", be = F ? "" : r || "";
1127
+ function xe(C) {
1128
+ u(C), S("");
1127
1129
  }
1128
- function G(S) {
1129
- m(S), u(""), N("");
1130
+ function U(C) {
1131
+ m(C), u(""), S("");
1130
1132
  }
1131
- function ne(S) {
1132
- g(S);
1133
+ function ne(C) {
1134
+ f(C);
1133
1135
  }
1134
- A && ((ve = A == null ? void 0 : A.databases) == null ? void 0 : ve.length) > 0, D && ((Je = D == null ? void 0 : D.schemas) == null ? void 0 : Je.length) > 0, H && ((Ve = H == null ? void 0 : H.columns) == null ? void 0 : Ve.length) > 0 && (a = H.columns.map((S) => ({
1135
- ...S,
1136
- data_type: S.data_type.toLowerCase()
1137
- }))), $ && (a = []), (ge || C) && (a = []);
1138
- const le = b == null ? void 0 : b.connections.map(
1139
- (S) => ({
1140
- id: S.id,
1141
- name: S.name,
1142
- type: S.type
1136
+ A && ((ve = A == null ? void 0 : A.databases) == null ? void 0 : ve.length) > 0, D && ((Je = D == null ? void 0 : D.schemas) == null ? void 0 : Je.length) > 0, H && ((qe = H == null ? void 0 : H.columns) == null ? void 0 : qe.length) > 0 && (a = H.columns.map((C) => ({
1137
+ ...C,
1138
+ data_type: C.data_type.toLowerCase()
1139
+ }))), $ && (a = []), (ge || N) && (a = []);
1140
+ const re = b == null ? void 0 : b.connections.map(
1141
+ (C) => ({
1142
+ id: C.id,
1143
+ name: C.name,
1144
+ type: C.type
1143
1145
  })
1144
- ), ye = A == null ? void 0 : A.databases.map((S) => ({
1145
- id: S.database_name,
1146
- name: S.database_name
1147
- })), re = D == null ? void 0 : D.schemas.map((S) => ({
1148
- id: S.schema_name,
1149
- name: S.schema_name
1150
- })), Ie = U == null ? void 0 : U.tables.map((S) => ({
1151
- id: S.table_name,
1152
- name: S.table_name
1146
+ ), ye = A == null ? void 0 : A.databases.map((C) => ({
1147
+ id: C.database_name,
1148
+ name: C.database_name
1149
+ })), le = D == null ? void 0 : D.schemas.map((C) => ({
1150
+ id: C.schema_name,
1151
+ name: C.schema_name
1152
+ })), Ie = J == null ? void 0 : J.tables.map((C) => ({
1153
+ id: C.table_name,
1154
+ name: C.table_name
1153
1155
  }));
1154
1156
  return {
1155
- connectionItems: le,
1157
+ connectionItems: re,
1156
1158
  isConnectionsLoading: L,
1157
- isConnectionsError: C,
1159
+ isConnectionsError: N,
1158
1160
  databaseItems: ye,
1159
- isDatabasesLoadingOrFetching: V || Y,
1161
+ isDatabasesLoadingOrFetching: q || K,
1160
1162
  isDatabaseError: $,
1161
- schemaItems: re,
1162
- isSchemaLoadingOrFetching: te || J,
1163
+ schemaItems: le,
1164
+ isSchemaLoadingOrFetching: te || Q,
1163
1165
  isSchemaError: ee,
1164
1166
  tableItems: Ie,
1165
1167
  isTableLoadingOrFetching: I || y,
@@ -1172,51 +1174,51 @@ function xa(s, n) {
1172
1174
  tableName: je,
1173
1175
  schemaName: be,
1174
1176
  handleConnectionChange: ne,
1175
- handleDatabaseChange: G,
1177
+ handleDatabaseChange: U,
1176
1178
  handleSchemaChange: xe
1177
1179
  };
1178
1180
  }
1179
1181
  function pa({
1180
1182
  ColumnsComponent: s
1181
1183
  }) {
1182
- var U;
1183
- const n = r(
1184
+ var J;
1185
+ const n = i(
1184
1186
  (I) => I.selectedConnectionId
1185
- ), a = r(
1187
+ ), a = i(
1186
1188
  (I) => I.selectedDatabaseName
1187
- ), t = r(
1189
+ ), t = i(
1188
1190
  (I) => I.selectedSchemaName
1189
- ), i = r((I) => I.selectedTableName), o = r(
1191
+ ), o = i((I) => I.selectedTableName), c = i(
1190
1192
  (I) => I.actions.setSelectedTableName
1191
1193
  ), {
1192
- connectionItems: l,
1193
- schemaItems: c,
1194
- databaseItems: h,
1195
- tableItems: g,
1194
+ connectionItems: r,
1195
+ schemaItems: l,
1196
+ databaseItems: d,
1197
+ tableItems: f,
1196
1198
  columns: m,
1197
1199
  isConnectionsLoading: u,
1198
- isConnectionsError: N,
1199
- isDatabasesLoadingOrFetching: d,
1200
+ isConnectionsError: S,
1201
+ isDatabasesLoadingOrFetching: h,
1200
1202
  isDatabaseError: x,
1201
- isSchemaLoadingOrFetching: f,
1202
- isSchemaError: w,
1203
+ isSchemaLoadingOrFetching: g,
1204
+ isSchemaError: z,
1203
1205
  isColumnsError: b,
1204
1206
  isColumnsLoadingOrFetching: L,
1205
- isTableLoadingOrFetching: C,
1207
+ isTableLoadingOrFetching: N,
1206
1208
  isTableError: O,
1207
1209
  connectionType: j,
1208
1210
  isNonDbConnection: F,
1209
1211
  handleConnectionChange: A,
1210
- handleDatabaseChange: V,
1211
- handleSchemaChange: Y,
1212
+ handleDatabaseChange: q,
1213
+ handleSchemaChange: K,
1212
1214
  tableName: $,
1213
- schemaName: P
1215
+ schemaName: G
1214
1216
  } = xa();
1215
1217
  function D() {
1216
- return s ? s(P, $, m) : /* @__PURE__ */ e.jsx(
1218
+ return s ? s(G, $, m) : /* @__PURE__ */ e.jsx(
1217
1219
  Cn,
1218
1220
  {
1219
- schemaName: P,
1221
+ schemaName: G,
1220
1222
  tableName: $,
1221
1223
  columns: m,
1222
1224
  status: L ? "Loading..." : b ? "Error" : "Success"
@@ -1226,14 +1228,14 @@ function pa({
1226
1228
  function te() {
1227
1229
  window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
1228
1230
  }
1229
- function J() {
1231
+ function Q() {
1230
1232
  return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
1231
1233
  Qe,
1232
1234
  {
1233
- onChange: V,
1235
+ onChange: q,
1234
1236
  isError: x,
1235
- isLoading: d,
1236
- items: h,
1237
+ isLoading: h,
1238
+ items: d,
1237
1239
  value: a || "",
1238
1240
  title: "Database"
1239
1241
  }
@@ -1243,10 +1245,10 @@ function pa({
1243
1245
  return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
1244
1246
  Qe,
1245
1247
  {
1246
- onChange: Y,
1247
- isError: w,
1248
- isLoading: f,
1249
- items: c,
1248
+ onChange: K,
1249
+ isError: z,
1250
+ isLoading: g,
1251
+ items: l,
1250
1252
  value: t || "",
1251
1253
  title: "Schema"
1252
1254
  }
@@ -1256,11 +1258,11 @@ function pa({
1256
1258
  return j === "API" ? null : /* @__PURE__ */ e.jsx(
1257
1259
  Qe,
1258
1260
  {
1259
- onChange: o,
1261
+ onChange: c,
1260
1262
  isError: O,
1261
- items: g,
1262
- isLoading: C,
1263
- value: i || "",
1263
+ items: f,
1264
+ isLoading: N,
1265
+ value: o || "",
1264
1266
  title: "Table"
1265
1267
  }
1266
1268
  );
@@ -1270,31 +1272,31 @@ function pa({
1270
1272
  /* @__PURE__ */ e.jsx(
1271
1273
  Qe,
1272
1274
  {
1273
- items: l,
1275
+ items: r,
1274
1276
  title: "Connection",
1275
1277
  value: n || "",
1276
1278
  onChange: A,
1277
1279
  isLoading: u,
1278
- isError: N,
1279
- connectionTooltip: ((U = l == null ? void 0 : l.find(
1280
+ isError: S,
1281
+ connectionTooltip: ((J = r == null ? void 0 : r.find(
1280
1282
  (I) => I.id === n
1281
- )) == null ? void 0 : U.type) || ""
1283
+ )) == null ? void 0 : J.type) || ""
1282
1284
  }
1283
1285
  ),
1284
- J(),
1286
+ Q(),
1285
1287
  ee(),
1286
1288
  Z()
1287
1289
  ] }),
1288
1290
  D(),
1289
1291
  /* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
1290
- z,
1292
+ w,
1291
1293
  {
1292
1294
  onClick: te,
1293
1295
  size: "sm",
1294
1296
  variant: "secondary",
1295
1297
  className: "w-full",
1296
1298
  children: [
1297
- /* @__PURE__ */ e.jsx(ln, { className: "mr-2 size-4" }),
1299
+ /* @__PURE__ */ e.jsx(rn, { className: "mr-2 size-4" }),
1298
1300
  "Help"
1299
1301
  ]
1300
1302
  }
@@ -1302,19 +1304,19 @@ function pa({
1302
1304
  ] });
1303
1305
  }
1304
1306
  function Sn(s) {
1305
- const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), i = s.toUpperCase().indexOf("ORDER BY");
1306
- let o = s.length;
1307
- if (i !== -1 && (o = i), t !== -1 && t < o && (o = t), n !== -1) {
1308
- const l = s.substring(0, n), c = s.substring(n);
1309
- return `${l} {{ filters | where }} AND ${c.substring(
1307
+ const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), o = s.toUpperCase().indexOf("ORDER BY");
1308
+ let c = s.length;
1309
+ if (o !== -1 && (c = o), t !== -1 && t < c && (c = t), n !== -1) {
1310
+ const r = s.substring(0, n), l = s.substring(n);
1311
+ return `${r} {{ filters | where }} AND ${l.substring(
1310
1312
  6
1311
1313
  )}`;
1312
1314
  } else if (a !== -1) {
1313
- const l = s.substring(0, a), c = s.substring(a);
1314
- return `${l} {{ filters | where }} ${c}`;
1315
+ const r = s.substring(0, a), l = s.substring(a);
1316
+ return `${r} {{ filters | where }} ${l}`;
1315
1317
  } else {
1316
- const l = s.substring(0, o), c = s.substring(o);
1317
- return `${l} {{ filters | where }} ${c}`;
1318
+ const r = s.substring(0, c), l = s.substring(c);
1319
+ return `${r} {{ filters | where }} ${l}`;
1318
1320
  }
1319
1321
  }
1320
1322
  function kn({
@@ -1324,10 +1326,10 @@ function kn({
1324
1326
  setTriggerAIRun: t
1325
1327
  }) {
1326
1328
  return /* @__PURE__ */ e.jsxs(Zs, { openDelay: 0, children: [
1327
- /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Qt, { className: "h-4 w-4 text-red-500" }) }) }),
1329
+ /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Qt, { className: "h-4 w-4 text-red-500" }) }) }),
1328
1330
  /* @__PURE__ */ e.jsx(sa, { align: "start", className: " min-w-fit max-w-[500px]", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grow space-y-1 flex flex-col ", children: [
1329
1331
  /* @__PURE__ */ e.jsxs(
1330
- z,
1332
+ w,
1331
1333
  {
1332
1334
  onClick: () => {
1333
1335
  n(!0), a(s), t(!0);
@@ -1340,7 +1342,7 @@ function kn({
1340
1342
  ]
1341
1343
  }
1342
1344
  ),
1343
- /* @__PURE__ */ e.jsx(Ns, { className: " min-h-0 max-h-[250px] overflow-scroll ", children: /* @__PURE__ */ e.jsx("p", { className: " overflow-auto text-sm leading-relaxed font-mono ", children: s }) })
1345
+ /* @__PURE__ */ e.jsx(Cs, { className: " min-h-0 max-h-[250px] overflow-scroll ", children: /* @__PURE__ */ e.jsx("p", { className: " overflow-auto text-sm leading-relaxed font-mono ", children: s }) })
1344
1346
  ] }) }) })
1345
1347
  ] });
1346
1348
  }
@@ -1350,29 +1352,29 @@ function wn({
1350
1352
  checked: a
1351
1353
  }) {
1352
1354
  return /* @__PURE__ */ e.jsxs("div", { className: "xbg-red-100 ml-6 flex items-center gap-2", children: [
1353
- /* @__PURE__ */ e.jsx(Ke, { checked: a, onCheckedChange: n }),
1355
+ /* @__PURE__ */ e.jsx(Pe, { checked: a, onCheckedChange: n }),
1354
1356
  /* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
1355
1357
  ] });
1356
1358
  }
1357
1359
  function zn() {
1358
- const { authToken: s } = es(), n = $e(null), a = r((c) => c.applyFilters), [t, i] = T(""), o = r((c) => c.filterValues), l = r((c) => c.card.sql);
1360
+ const { authToken: s } = es(), n = $e(null), a = i((l) => l.applyFilters), [t, o] = T(""), c = i((l) => l.filterValues), r = i((l) => l.card.sql);
1359
1361
  return /* @__PURE__ */ e.jsxs(
1360
1362
  Zs,
1361
1363
  {
1362
1364
  openDelay: 0,
1363
- onOpenChange: async (c) => {
1364
- if (!c)
1365
+ onOpenChange: async (l) => {
1366
+ if (!l)
1365
1367
  return;
1366
1368
  console.log("onOpenChange");
1367
- const h = await aa(
1369
+ const d = await aa(
1368
1370
  "https://semaphor.cloud/api/v1/filter-sql",
1369
1371
  (s == null ? void 0 : s.accessToken) || "",
1370
1372
  {
1371
- sql: l,
1372
- active_filters: o
1373
+ sql: r,
1374
+ active_filters: c
1373
1375
  }
1374
1376
  );
1375
- console.log(h), h.sql ? (console.log(h.records), i(h.sql)) : i("Error");
1377
+ console.log(d), d.sql ? (console.log(d.records), o(d.sql)) : o("Error");
1376
1378
  },
1377
1379
  children: [
1378
1380
  /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
@@ -1448,30 +1450,30 @@ function On({
1448
1450
  setOpen: n,
1449
1451
  userInput: a,
1450
1452
  setUserInput: t,
1451
- triggerAIRun: i,
1452
- setTriggerAIRun: o
1453
+ triggerAIRun: o,
1454
+ setTriggerAIRun: c
1453
1455
  }) {
1454
- const l = $e(null), c = $e(null), { authToken: h } = es(), [g, m] = T(!1), u = r((y) => y.actions.setCardSql), N = k((y) => y.dashboard.baseQueries), d = r((y) => y.actions.setRunSql), x = r((y) => y.actions.setCardType), [f, w] = T([]), b = r((y) => y.currentColumns), L = r((y) => y.card.sql), C = r((y) => y.selectedTableName), O = `
1456
+ const r = $e(null), l = $e(null), { authToken: d } = es(), [f, m] = T(!1), u = i((y) => y.actions.setCardSql), S = k((y) => y.dashboard.baseQueries), h = i((y) => y.actions.setRunSql), x = i((y) => y.actions.setCardType), [g, z] = T([]), b = i((y) => y.currentColumns), L = i((y) => y.card.sql), N = i((y) => y.selectedTableName), O = `
1455
1457
  ${a}
1456
1458
 
1457
- Database Query Dialect: ${C === "api" || C === "s3" ? "DuckDb" : ""}
1458
- Table Name: ${C}
1459
+ Database Query Dialect: ${N === "api" || N === "s3" ? "DuckDb" : ""}
1460
+ Table Name: ${N}
1459
1461
  Table Columns: ${b == null ? void 0 : b.map((y) => `${y.column_name} | ${y.data_type}`).join(", ")}
1460
1462
  User SQL: ${L}
1461
- ${N && `Base Queries: ${JSON.stringify(N)} `}`, j = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
1462
- Visual Query Syntax: ${Fn}`, { data: F, isLoading: A, isFetching: V, isError: Y, refetch: $ } = Ce({
1463
+ ${S && `Base Queries: ${JSON.stringify(S)} `}`, j = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
1464
+ Visual Query Syntax: ${Fn}`, { data: F, isLoading: A, isFetching: q, isError: K, refetch: $ } = Ce({
1463
1465
  queryKey: ["ai-query"],
1464
1466
  queryFn: () => ze(
1465
1467
  "https://semaphor.cloud/api/v1/ai",
1466
- (h == null ? void 0 : h.accessToken) || "",
1468
+ (d == null ? void 0 : d.accessToken) || "",
1467
1469
  {
1468
- user_content: `userContent: ${O} ${g ? j : ""}`
1470
+ user_content: `userContent: ${O} ${f ? j : ""}`
1469
1471
  }
1470
1472
  ),
1471
1473
  enabled: !1
1472
1474
  // Do not run by default.
1473
1475
  });
1474
- function P(y) {
1476
+ function G(y) {
1475
1477
  if (y.toLowerCase().includes("bar"))
1476
1478
  x("bar");
1477
1479
  else if (y.toLowerCase().includes("line"))
@@ -1492,24 +1494,24 @@ function On({
1492
1494
  return x("bar"), !1;
1493
1495
  return !0;
1494
1496
  }
1495
- K(() => {
1496
- F && w((y) => [...y, { role: "ai", content: F.response }]);
1497
- }, [F]), K(() => {
1497
+ P(() => {
1498
+ F && z((y) => [...y, { role: "ai", content: F.response }]);
1499
+ }, [F]), P(() => {
1498
1500
  const y = setTimeout(() => {
1499
1501
  var v;
1500
- c.current && (c.current.scroll({
1501
- top: c.current.scrollHeight,
1502
+ l.current && (l.current.scroll({
1503
+ top: l.current.scrollHeight,
1502
1504
  behavior: "smooth"
1503
- }), (v = l.current) == null || v.focus());
1505
+ }), (v = r.current) == null || v.focus());
1504
1506
  }, 100);
1505
1507
  return () => clearTimeout(y);
1506
- }, [f]);
1508
+ }, [g]);
1507
1509
  function D() {
1508
- a && (w((y) => [...y, { role: "user", content: a }]), P(a) && m(!0), t(""), $());
1510
+ a && (z((y) => [...y, { role: "user", content: a }]), G(a) && m(!0), t(""), $());
1509
1511
  }
1510
- K(() => {
1511
- i && (D(), o(!1));
1512
- }, [i, o]);
1512
+ P(() => {
1513
+ o && (D(), c(!1));
1514
+ }, [o, c]);
1513
1515
  const te = {
1514
1516
  //seleect a darker color
1515
1517
  // color: '#000',
@@ -1518,7 +1520,7 @@ function On({
1518
1520
  fontSize: 15,
1519
1521
  // padding: '5px',
1520
1522
  width: "100%"
1521
- }, J = {
1523
+ }, Q = {
1522
1524
  // background: '#f6f8fa',
1523
1525
  // color: '#000',
1524
1526
  fontFamily: "monospace",
@@ -1539,16 +1541,16 @@ function On({
1539
1541
  // Override how paragraphs are rendered
1540
1542
  p: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("p", { style: te, ...v }),
1541
1543
  code: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...v }),
1542
- pre: ({ node: y, ...v }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: J, children: [
1544
+ pre: ({ node: y, ...v }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: Q, children: [
1543
1545
  /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: v.children }),
1544
1546
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1545
- /* @__PURE__ */ e.jsx(z, { onClick: U, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ta, {}) }),
1547
+ /* @__PURE__ */ e.jsx(w, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ta, {}) }),
1546
1548
  /* @__PURE__ */ e.jsx(
1547
- z,
1549
+ w,
1548
1550
  {
1549
1551
  onClick: (M) => {
1550
- const H = U(M);
1551
- H && (n(!1), u(H), d(!0));
1552
+ const H = J(M);
1553
+ H && (n(!1), u(H), h(!0));
1552
1554
  },
1553
1555
  size: "sm",
1554
1556
  variant: "outline",
@@ -1560,7 +1562,7 @@ function On({
1560
1562
  li: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("li", { style: ee, ...v })
1561
1563
  // You can add more overrides for other elements like h1, h2, etc.
1562
1564
  };
1563
- function U(y) {
1565
+ function J(y) {
1564
1566
  const v = y.currentTarget.closest("pre");
1565
1567
  if (!v)
1566
1568
  return;
@@ -1568,7 +1570,7 @@ function On({
1568
1570
  return navigator.clipboard.writeText(M).then(() => console.log("Text copied to clipboard")).catch((H) => console.error("Error in copying text: ", H)), M;
1569
1571
  }
1570
1572
  function I() {
1571
- return f == null ? void 0 : f.map((y, v) => y.role === "user" ? /* @__PURE__ */ e.jsxs(
1573
+ return g == null ? void 0 : g.map((y, v) => y.role === "user" ? /* @__PURE__ */ e.jsxs(
1572
1574
  "div",
1573
1575
  {
1574
1576
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
@@ -1588,9 +1590,9 @@ function On({
1588
1590
  v
1589
1591
  ) : /* @__PURE__ */ e.jsx("div", {}, v));
1590
1592
  }
1591
- return /* @__PURE__ */ e.jsxs(us, { open: s, onOpenChange: n, children: [
1592
- /* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1593
- z,
1593
+ return /* @__PURE__ */ e.jsxs(xs, { open: s, onOpenChange: n, children: [
1594
+ /* @__PURE__ */ e.jsx(ps, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1595
+ w,
1594
1596
  {
1595
1597
  size: "sm",
1596
1598
  className: "w-full justify-start border font-normal text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",
@@ -1599,18 +1601,18 @@ function On({
1599
1601
  }
1600
1602
  ) }),
1601
1603
  /* @__PURE__ */ e.jsxs(
1602
- ps,
1604
+ fs,
1603
1605
  {
1604
1606
  className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
1605
1607
  children: [
1606
- /* @__PURE__ */ e.jsxs(fs, { children: [
1607
- /* @__PURE__ */ e.jsx(gs, { children: "Assistant" }),
1608
- /* @__PURE__ */ e.jsx(js, { children: "What can I help you with?" })
1608
+ /* @__PURE__ */ e.jsxs(gs, { children: [
1609
+ /* @__PURE__ */ e.jsx(js, { children: "Assistant" }),
1610
+ /* @__PURE__ */ e.jsx(bs, { children: "What can I help you with?" })
1609
1611
  ] }),
1610
1612
  /* @__PURE__ */ e.jsx(
1611
1613
  "div",
1612
1614
  {
1613
- ref: c,
1615
+ ref: l,
1614
1616
  className: "h-[625px] w-full overflow-auto border-t border-t-muted",
1615
1617
  children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: I() })
1616
1618
  }
@@ -1623,7 +1625,7 @@ function On({
1623
1625
  na,
1624
1626
  {
1625
1627
  autoFocus: !0,
1626
- ref: l,
1628
+ ref: r,
1627
1629
  onKeyDown: (y) => {
1628
1630
  y.key === "Enter" && !y.shiftKey && (y.preventDefault(), t(""), D());
1629
1631
  },
@@ -1632,23 +1634,23 @@ function On({
1632
1634
  const v = y.target, M = v.value.length;
1633
1635
  v.setSelectionRange(M, M);
1634
1636
  },
1635
- className: W(
1637
+ className: Y(
1636
1638
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1637
1639
  ),
1638
- disabled: A || V,
1640
+ disabled: A || q,
1639
1641
  value: a,
1640
1642
  onChange: (y) => t(y.target.value)
1641
1643
  }
1642
1644
  ),
1643
1645
  " ",
1644
1646
  /* @__PURE__ */ e.jsx(
1645
- z,
1647
+ w,
1646
1648
  {
1647
1649
  className: "h-8",
1648
1650
  size: "sm",
1649
1651
  variant: "ghost",
1650
1652
  onClick: D,
1651
- children: !A && !V ? /* @__PURE__ */ e.jsx(Za, {}) : /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1653
+ children: !A && !q ? /* @__PURE__ */ e.jsx(Za, {}) : /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1652
1654
  }
1653
1655
  )
1654
1656
  ] })
@@ -1669,20 +1671,20 @@ var fa = {
1669
1671
  function Tn(s, n) {
1670
1672
  if (s == null)
1671
1673
  return {};
1672
- var a = An(s, n), t, i;
1674
+ var a = An(s, n), t, o;
1673
1675
  if (Object.getOwnPropertySymbols) {
1674
- var o = Object.getOwnPropertySymbols(s);
1675
- for (i = 0; i < o.length; i++)
1676
- t = o[i], !(n.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(s, t) && (a[t] = s[t]);
1676
+ var c = Object.getOwnPropertySymbols(s);
1677
+ for (o = 0; o < c.length; o++)
1678
+ t = c[o], !(n.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(s, t) && (a[t] = s[t]);
1677
1679
  }
1678
1680
  return a;
1679
1681
  }
1680
1682
  function An(s, n) {
1681
1683
  if (s == null)
1682
1684
  return {};
1683
- var a = {}, t = Object.keys(s), i, o;
1684
- for (o = 0; o < t.length; o++)
1685
- i = t[o], !(n.indexOf(i) >= 0) && (a[i] = s[i]);
1685
+ var a = {}, t = Object.keys(s), o, c;
1686
+ for (c = 0; c < t.length; c++)
1687
+ o = t[c], !(n.indexOf(o) >= 0) && (a[o] = s[o]);
1686
1688
  return a;
1687
1689
  }
1688
1690
  function Xe() {
@@ -1699,8 +1701,8 @@ function Bs(s, n) {
1699
1701
  var a = Object.keys(s);
1700
1702
  if (Object.getOwnPropertySymbols) {
1701
1703
  var t = Object.getOwnPropertySymbols(s);
1702
- n && (t = t.filter(function(i) {
1703
- return Object.getOwnPropertyDescriptor(s, i).enumerable;
1704
+ n && (t = t.filter(function(o) {
1705
+ return Object.getOwnPropertyDescriptor(s, o).enumerable;
1704
1706
  })), a.push.apply(a, t);
1705
1707
  }
1706
1708
  return a;
@@ -1749,124 +1751,127 @@ function In(s) {
1749
1751
  var n = (a) => {
1750
1752
  var {
1751
1753
  attr: t,
1752
- size: i,
1753
- title: o
1754
- } = s, l = Tn(s, Mn), c = i || a.size || "1em", h;
1755
- return a.className && (h = a.className), s.className && (h = (h ? h + " " : "") + s.className), /* @__PURE__ */ me.createElement("svg", Xe({
1754
+ size: o,
1755
+ title: c
1756
+ } = s, r = Tn(s, Mn), l = o || a.size || "1em", d;
1757
+ return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ me.createElement("svg", Xe({
1756
1758
  stroke: "currentColor",
1757
1759
  fill: "currentColor",
1758
1760
  strokeWidth: "0"
1759
- }, a.attr, t, l, {
1760
- className: h,
1761
+ }, a.attr, t, r, {
1762
+ className: d,
1761
1763
  style: Ze(Ze({
1762
1764
  color: s.color || a.color
1763
1765
  }, a.style), s.style),
1764
- height: c,
1765
- width: c,
1766
+ height: l,
1767
+ width: l,
1766
1768
  xmlns: "http://www.w3.org/2000/svg"
1767
- }), o && /* @__PURE__ */ me.createElement("title", null, o), s.children);
1769
+ }), c && /* @__PURE__ */ me.createElement("title", null, c), s.children);
1768
1770
  };
1769
1771
  return Hs !== void 0 ? /* @__PURE__ */ me.createElement(Hs.Consumer, null, (a) => n(a)) : n(fa);
1770
1772
  }
1771
- function Vn(s) {
1773
+ function qn(s) {
1772
1774
  return fe({ 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);
1773
1775
  }
1774
- function qn() {
1775
- const { theme: s } = at(), n = $e(), a = $e(), [t, i] = T(!1), [o, l] = T(!1), [c, h] = T(!1), [g, m] = T(""), [u, N] = T(!1), { authToken: d } = es();
1776
+ function Vn() {
1777
+ const { theme: s } = at(), n = $e(), a = $e(), [t, o] = T(!1), [c, r] = T(!1), [l, d] = T(!1), [f, m] = T(""), [u, S] = T(!1), { authToken: h } = es();
1776
1778
  k((p) => p.selectedSheetId);
1777
- const x = k((p) => p.dashboard.baseQueries), f = r((p) => p.card), w = k((p) => p.theme), b = r((p) => p.isShowingVisual), L = r(
1779
+ const x = k((p) => p.dashboard.baseQueries), g = i((p) => p.card), z = k((p) => p.theme), b = i((p) => p.isShowingVisual), L = i(
1778
1780
  (p) => p.selectedConnectionId
1779
- ), C = r(
1781
+ ), N = i(
1780
1782
  (p) => p.selectedDatabaseName
1781
- ), O = r(
1783
+ ), O = i(
1782
1784
  (p) => p.selectedSchemaName
1783
1785
  );
1784
1786
  k(
1785
1787
  (p) => p.actions.updateFrameCard
1786
1788
  );
1787
- const j = r((p) => p.selectedTableName), F = r((p) => p.card.sql), A = r((p) => p.card.python), V = tt(F, x), Y = r((p) => p.selectedConnectionId), $ = r((p) => p.frame), P = r((p) => p.filterValues), D = r((p) => p.applyFilters), {
1789
+ const j = i((p) => p.selectedTableName), F = i((p) => p.card.sql), A = i((p) => p.card.python), q = tt(F, x), K = i((p) => p.selectedConnectionId), $ = i((p) => p.frame), G = i((p) => p.filterValues), D = i((p) => p.applyFilters), {
1788
1790
  setCardCustomCfg: te,
1789
- setQueryResultColumns: J,
1791
+ setQueryResultColumns: Q,
1790
1792
  setFilterValues: ee,
1791
1793
  setCardSql: Z,
1792
- setCardPython: U,
1794
+ setCardPython: J,
1793
1795
  setQueryError: I,
1794
1796
  setPythonStdOut: y,
1795
1797
  setCardPreferences: v
1796
- } = r((p) => p.actions), M = r((p) => p.onSave), H = r(
1798
+ } = i((p) => p.actions), M = i((p) => p.onSave), H = i(
1797
1799
  (p) => p.actions.setApplyFilters
1798
- ), ue = r((p) => p.onClose), se = r((p) => p.actions.setCardData), ge = r((p) => p.actions.setSqlGen), je = r((p) => p.runSql), be = r((p) => p.actions.setRunSql), xe = r(
1800
+ ), ue = i((p) => p.onClose), se = i((p) => p.actions.setCardData), ge = i((p) => p.actions.setSqlGen), je = i((p) => p.runSql), be = i((p) => p.actions.setRunSql), xe = i(
1799
1801
  (p) => p.actions.setIsSqlRunning
1800
1802
  ), {
1801
- data: G,
1803
+ data: U,
1802
1804
  isLoading: ne,
1803
- isFetching: le,
1805
+ isFetching: re,
1804
1806
  isSuccess: ye,
1805
- isError: re,
1807
+ isError: le,
1806
1808
  error: Ie,
1807
1809
  status: ss,
1808
1810
  refetch: ve
1809
1811
  } = Ce({
1810
- queryKey: [V, A],
1812
+ queryKey: [q, A],
1811
1813
  queryFn: () => aa(
1812
1814
  "https://semaphor.cloud/api/v1/query",
1813
- (d == null ? void 0 : d.accessToken) || "",
1815
+ (h == null ? void 0 : h.accessToken) || "",
1814
1816
  {
1815
- connection_id: Y,
1816
- sql: V,
1817
+ connection_id: K,
1818
+ sql: q,
1817
1819
  python: A === Ls ? "" : A,
1818
- active_filters: D ? P : []
1820
+ active_filters: D ? G : []
1819
1821
  }
1820
1822
  ),
1821
1823
  enabled: !1,
1822
1824
  retry: !1
1823
1825
  });
1824
- K(() => {
1825
- if (G && (se(G.records), y((G == null ? void 0 : G.output) || ""), G.records.length > 0)) {
1826
- const { dimensionKeys: p } = ds(G.records);
1827
- J(p);
1826
+ P(() => {
1827
+ if (U && (se(U.records), U.rowLimitExceeded && cs.error("Row limit (10,000) exceeded. Refine your query.", {
1828
+ position: "top-center",
1829
+ richColors: !0
1830
+ }), y((U == null ? void 0 : U.output) || ""), U.records.length > 0)) {
1831
+ const { dimensionKeys: p } = hs(U.records);
1832
+ Q(p);
1828
1833
  }
1829
- }, [G, se, J, y]), K(() => {
1834
+ }, [U, se, Q, y]), P(() => {
1830
1835
  je && (ve(), be(!1));
1831
- }, [je, ve, be]), K(() => {
1832
- (ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(Ie.message), se([]), J([]), y("")) : I("");
1836
+ }, [je, ve, be]), P(() => {
1837
+ (ne || re) && xe(!0), (le || ye) && xe(!1), le ? (I(Ie.message), se([]), Q([]), y("")) : I("");
1833
1838
  }, [
1834
1839
  ne,
1835
- le,
1836
- G,
1837
- y,
1838
1840
  re,
1841
+ U,
1842
+ y,
1843
+ le,
1839
1844
  ye,
1840
1845
  xe,
1841
1846
  se,
1842
- J,
1847
+ Q,
1843
1848
  I,
1844
1849
  Ie
1845
1850
  ]);
1846
1851
  function Je() {
1847
1852
  Z(""), se([]), ge({}), te(""), v({});
1848
1853
  }
1849
- const Ve = (p) => {
1854
+ const qe = (p) => {
1850
1855
  a.current = p;
1851
1856
  };
1852
- function S() {
1857
+ function C() {
1853
1858
  let p = F;
1854
1859
  F && !F.includes("{{") && (p = Sn(F), Z(p));
1855
1860
  const ie = {
1856
- ...f,
1861
+ ...g,
1857
1862
  lastSelectedSchema: O,
1858
- lastSelectedDatabase: C,
1863
+ lastSelectedDatabase: N,
1859
1864
  lastSelectedTable: j,
1860
1865
  connectionId: L,
1861
- type: b ? f.type : "table",
1866
+ type: b ? g.type : "table",
1862
1867
  sql: p,
1863
- customCfg: b ? f.customCfg : null
1864
- }, qe = $.cards.map(
1865
- (Ne) => Ne.id === f.id ? ie : Ne
1868
+ customCfg: b ? g.customCfg : null
1869
+ }, Ve = $.cards.map(
1870
+ (Ne) => Ne.id === g.id ? ie : Ne
1866
1871
  );
1867
1872
  M == null || M({
1868
1873
  ...$,
1869
- cards: qe
1874
+ cards: Ve
1870
1875
  });
1871
1876
  }
1872
1877
  function Fa() {
@@ -1879,19 +1884,19 @@ function qn() {
1879
1884
  return Ma(ie);
1880
1885
  }
1881
1886
  function Ma(p) {
1882
- const [ie, qe, Ne] = p.split(" "), Q = parseFloat(ie), Ea = parseFloat(qe), La = parseFloat(Ne), Da = Ea / 100, Ms = La / 100, pe = (1 - Math.abs(2 * Ms - 1)) * Da, ke = pe * (1 - Math.abs(Q / 60 % 2 - 1)), as = Ms - pe / 2;
1887
+ const [ie, Ve, Ne] = p.split(" "), W = parseFloat(ie), Ea = parseFloat(Ve), La = parseFloat(Ne), Da = Ea / 100, Ts = La / 100, pe = (1 - Math.abs(2 * Ts - 1)) * Da, ke = pe * (1 - Math.abs(W / 60 % 2 - 1)), as = Ts - pe / 2;
1883
1888
  let oe = 0, ce = 0, de = 0;
1884
- 0 <= Q && Q < 60 ? (oe = pe, ce = ke, de = 0) : 60 <= Q && Q < 120 ? (oe = ke, ce = pe, de = 0) : 120 <= Q && Q < 180 ? (oe = 0, ce = pe, de = ke) : 180 <= Q && Q < 240 ? (oe = 0, ce = ke, de = pe) : 240 <= Q && Q < 300 ? (oe = ke, ce = 0, de = pe) : 300 <= Q && Q < 360 && (oe = pe, ce = 0, de = ke), oe = Math.round((oe + as) * 255), ce = Math.round((ce + as) * 255), de = Math.round((de + as) * 255);
1889
+ 0 <= W && W < 60 ? (oe = pe, ce = ke, de = 0) : 60 <= W && W < 120 ? (oe = ke, ce = pe, de = 0) : 120 <= W && W < 180 ? (oe = 0, ce = pe, de = ke) : 180 <= W && W < 240 ? (oe = 0, ce = ke, de = pe) : 240 <= W && W < 300 ? (oe = ke, ce = 0, de = pe) : 300 <= W && W < 360 && (oe = pe, ce = 0, de = ke), oe = Math.round((oe + as) * 255), ce = Math.round((ce + as) * 255), de = Math.round((de + as) * 255);
1885
1890
  const ts = (Ia) => {
1886
1891
  const ns = Ia.toString(16);
1887
1892
  return ns.length == 1 ? "0" + ns : ns;
1888
1893
  };
1889
1894
  return `#${ts(oe)}${ts(ce)}${ts(de)}`;
1890
1895
  }
1891
- K(() => {
1896
+ P(() => {
1892
1897
  const p = n.current, ie = a.current;
1893
1898
  if (p) {
1894
- const qe = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = w === "system" ? qe : w;
1899
+ const Ve = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = z === "system" ? Ve : z;
1895
1900
  p.editor.defineTheme("default", {
1896
1901
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
1897
1902
  base: Ne === "light" ? "vs" : "vs-dark",
@@ -1910,13 +1915,13 @@ function qn() {
1910
1915
  }
1911
1916
  ), () => {
1912
1917
  };
1913
- }, [s, w, n.current]);
1914
- function Os(p) {
1918
+ }, [s, z, n.current]);
1919
+ function Ms(p) {
1915
1920
  n.current = p;
1916
1921
  }
1917
1922
  function Ta() {
1918
1923
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1919
- o && /* @__PURE__ */ e.jsx(
1924
+ c && /* @__PURE__ */ e.jsx(
1920
1925
  "div",
1921
1926
  {
1922
1927
  className: "xbg-yellow-100 relative flex w-1/3 min-w-0 grow overflow-hidden border-l p-1 text-xs",
@@ -1932,10 +1937,10 @@ function qn() {
1932
1937
  }
1933
1938
  ),
1934
1939
  /* @__PURE__ */ e.jsx(zn, {}),
1935
- P && o && /* @__PURE__ */ e.jsx(
1940
+ G && c && /* @__PURE__ */ e.jsx(
1936
1941
  _e,
1937
1942
  {
1938
- onClick: () => l(!1),
1943
+ onClick: () => r(!1),
1939
1944
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
1940
1945
  }
1941
1946
  )
@@ -1953,7 +1958,7 @@ function qn() {
1953
1958
  },
1954
1959
  defaultLanguage: "json",
1955
1960
  className: "mt-1 min-h-[220px]",
1956
- value: JSON.stringify(P, null, 2),
1961
+ value: JSON.stringify(G, null, 2),
1957
1962
  options: {
1958
1963
  readOnly: !0,
1959
1964
  minimap: {
@@ -1974,11 +1979,11 @@ function qn() {
1974
1979
  ] })
1975
1980
  }
1976
1981
  ),
1977
- P && !o && /* @__PURE__ */ e.jsx(
1982
+ G && !c && /* @__PURE__ */ e.jsx(
1978
1983
  oa,
1979
1984
  {
1980
- onClick: () => l(!0),
1981
- className: W(
1985
+ onClick: () => r(!0),
1986
+ className: Y(
1982
1987
  "absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
1983
1988
  {
1984
1989
  "font-bold text-red-800": D
@@ -1990,7 +1995,7 @@ function qn() {
1990
1995
  }
1991
1996
  function Aa() {
1992
1997
  return /* @__PURE__ */ e.jsxs(
1993
- hs,
1998
+ ms,
1994
1999
  {
1995
2000
  className: "flex grow pb-1",
1996
2001
  direction: "vertical",
@@ -2032,8 +2037,8 @@ function qn() {
2032
2037
  },
2033
2038
  defaultLanguage: "sql",
2034
2039
  defaultValue: "SELECT * FROM table",
2035
- beforeMount: Os,
2036
- onMount: Ve
2040
+ beforeMount: Ms,
2041
+ onMount: qe
2037
2042
  }
2038
2043
  )
2039
2044
  }
@@ -2043,7 +2048,7 @@ function qn() {
2043
2048
  }
2044
2049
  ),
2045
2050
  t && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2046
- /* @__PURE__ */ e.jsx(ms, { withHandle: !0, className: "border" }),
2051
+ /* @__PURE__ */ e.jsx(us, { withHandle: !0, className: "border" }),
2047
2052
  /* @__PURE__ */ e.jsxs(
2048
2053
  Fe,
2049
2054
  {
@@ -2063,7 +2068,7 @@ function qn() {
2063
2068
  className: "pt-3",
2064
2069
  theme: "default",
2065
2070
  onChange: (p) => {
2066
- U(p && p.trim() || "");
2071
+ J(p && p.trim() || "");
2067
2072
  },
2068
2073
  value: A || Ls,
2069
2074
  options: {
@@ -2079,8 +2084,8 @@ function qn() {
2079
2084
  renderLineHighlight: "none"
2080
2085
  },
2081
2086
  defaultLanguage: "python",
2082
- beforeMount: Os,
2083
- onMount: Ve
2087
+ beforeMount: Ms,
2088
+ onMount: qe
2084
2089
  }
2085
2090
  )
2086
2091
  }
@@ -2121,10 +2126,10 @@ function qn() {
2121
2126
  children: [
2122
2127
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2123
2128
  /* @__PURE__ */ e.jsxs(
2124
- z,
2129
+ w,
2125
2130
  {
2126
2131
  title: "Shift + Enter",
2127
- disabled: ne || le,
2132
+ disabled: ne || re,
2128
2133
  onClick: () => {
2129
2134
  ve();
2130
2135
  },
@@ -2132,22 +2137,22 @@ function qn() {
2132
2137
  size: "sm",
2133
2138
  variant: "outline",
2134
2139
  children: [
2135
- ne || le ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(on, { className: "mr-2 h-4 w-4" }),
2140
+ ne || re ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(on, { className: "mr-2 h-4 w-4" }),
2136
2141
  "Run"
2137
2142
  ]
2138
2143
  }
2139
2144
  ),
2140
- re && /* @__PURE__ */ e.jsx(
2145
+ le && /* @__PURE__ */ e.jsx(
2141
2146
  kn,
2142
2147
  {
2143
2148
  error: Ie.message,
2144
- setShowAIDialog: h,
2145
- setTriggerAIRun: N,
2149
+ setShowAIDialog: d,
2150
+ setTriggerAIRun: S,
2146
2151
  setUserInputforAI: m
2147
2152
  }
2148
2153
  ),
2149
2154
  /* @__PURE__ */ e.jsxs(
2150
- z,
2155
+ w,
2151
2156
  {
2152
2157
  onClick: Je,
2153
2158
  className: "",
@@ -2163,30 +2168,30 @@ function qn() {
2163
2168
  Xs,
2164
2169
  {
2165
2170
  pressed: t,
2166
- onPressedChange: (p) => i(p),
2171
+ onPressedChange: (p) => o(p),
2167
2172
  className: "",
2168
2173
  size: "sm",
2169
2174
  variant: "outline",
2170
- children: /* @__PURE__ */ e.jsx(Vn, { className: "size-4 text-foreground/70" })
2175
+ children: /* @__PURE__ */ e.jsx(qn, { className: "size-4 text-foreground/70" })
2171
2176
  }
2172
2177
  ),
2173
2178
  /* @__PURE__ */ e.jsx(
2174
2179
  On,
2175
2180
  {
2176
- open: c,
2177
- setOpen: h,
2178
- userInput: g,
2181
+ open: l,
2182
+ setOpen: d,
2183
+ userInput: f,
2179
2184
  triggerAIRun: u,
2180
- setTriggerAIRun: N,
2185
+ setTriggerAIRun: S,
2181
2186
  setUserInput: (p) => m(p)
2182
2187
  }
2183
2188
  )
2184
2189
  ] }),
2185
2190
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
2186
2191
  /* @__PURE__ */ e.jsxs(
2187
- z,
2192
+ w,
2188
2193
  {
2189
- onClick: S,
2194
+ onClick: C,
2190
2195
  size: "sm",
2191
2196
  variant: "outline",
2192
2197
  children: [
@@ -2196,7 +2201,7 @@ function qn() {
2196
2201
  }
2197
2202
  ),
2198
2203
  /* @__PURE__ */ e.jsxs(
2199
- z,
2204
+ w,
2200
2205
  {
2201
2206
  onClick: Fa,
2202
2207
  className: "w-full",
@@ -2218,27 +2223,27 @@ function qn() {
2218
2223
  );
2219
2224
  }
2220
2225
  function Rn({ data: s }) {
2221
- var l;
2222
- const [n, a] = me.useState([]), i = Object.keys(s[0]).map((c) => ({
2226
+ var r;
2227
+ const [n, a] = me.useState([]), o = Object.keys(s[0]).map((l) => ({
2223
2228
  // header: key,
2224
- accessorKey: c,
2225
- header: ({ column: h }) => {
2226
- const g = h.getIsSorted();
2229
+ accessorKey: l,
2230
+ header: ({ column: d }) => {
2231
+ const f = d.getIsSorted();
2227
2232
  return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
2228
2233
  "div",
2229
2234
  {
2230
2235
  className: "flex cursor-pointer items-center",
2231
- onClick: () => h.toggleSorting(h.getIsSorted() === "asc"),
2236
+ onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
2232
2237
  children: [
2233
- c,
2234
- g === "asc" ? /* @__PURE__ */ e.jsx(lt, { className: "ml-2 h-5 w-5" }) : g === "desc" ? /* @__PURE__ */ e.jsx(rt, { className: "ml-2 h-5 w-5" }) : null
2238
+ l,
2239
+ f === "asc" ? /* @__PURE__ */ e.jsx(rt, { className: "ml-2 h-5 w-5" }) : f === "desc" ? /* @__PURE__ */ e.jsx(lt, { className: "ml-2 h-5 w-5" }) : null
2235
2240
  ]
2236
2241
  }
2237
2242
  ) });
2238
2243
  }
2239
- })), o = it({
2244
+ })), c = it({
2240
2245
  data: s,
2241
- columns: i,
2246
+ columns: o,
2242
2247
  getCoreRowModel: mt(),
2243
2248
  getPaginationRowModel: ut(),
2244
2249
  onSortingChange: a,
@@ -2249,19 +2254,19 @@ function Rn({ data: s }) {
2249
2254
  }
2250
2255
  });
2251
2256
  return /* @__PURE__ */ e.jsxs(ot, { children: [
2252
- /* @__PURE__ */ e.jsx(ct, { children: o.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(ls, { children: c.headers.map((h) => /* @__PURE__ */ e.jsx(dt, { className: "sticky top-0 bg-muted", children: h.isPlaceholder ? null : Ds(
2253
- h.column.columnDef.header,
2254
- h.getContext()
2255
- ) }, h.id)) }, c.id)) }),
2256
- /* @__PURE__ */ e.jsx(ht, { children: (l = o.getRowModel().rows) != null && l.length ? o.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
2257
- ls,
2257
+ /* @__PURE__ */ e.jsx(ct, { children: c.getHeaderGroups().map((l) => /* @__PURE__ */ e.jsx(rs, { children: l.headers.map((d) => /* @__PURE__ */ e.jsx(dt, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : Ds(
2258
+ d.column.columnDef.header,
2259
+ d.getContext()
2260
+ ) }, d.id)) }, l.id)) }),
2261
+ /* @__PURE__ */ e.jsx(ht, { children: (r = c.getRowModel().rows) != null && r.length ? c.getRowModel().rows.map((l) => /* @__PURE__ */ e.jsx(
2262
+ rs,
2258
2263
  {
2259
2264
  className: "whitespace-nowrap py-2",
2260
- "data-state": c.getIsSelected() && "selected",
2261
- children: c.getVisibleCells().map((h) => /* @__PURE__ */ e.jsx(Is, { children: Ds(h.column.columnDef.cell, h.getContext()) }, h.id))
2265
+ "data-state": l.getIsSelected() && "selected",
2266
+ children: l.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Is, { children: Ds(d.column.columnDef.cell, d.getContext()) }, d.id))
2262
2267
  },
2263
- c.id
2264
- )) : /* @__PURE__ */ e.jsx(ls, { children: /* @__PURE__ */ e.jsx(Is, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
2268
+ l.id
2269
+ )) : /* @__PURE__ */ e.jsx(rs, { children: /* @__PURE__ */ e.jsx(Is, { colSpan: o.length, className: "h-24 text-center", children: "No results." }) }) })
2265
2270
  ] });
2266
2271
  }
2267
2272
  function ja({
@@ -2269,10 +2274,10 @@ function ja({
2269
2274
  className: s,
2270
2275
  ...n
2271
2276
  }) {
2272
- var l;
2277
+ var r;
2273
2278
  me.useState(0);
2274
- const a = k((c) => c.themeStyle), t = r((c) => c.card), i = r((c) => c.actions.setCard);
2275
- if (K(() => {
2279
+ const a = k((l) => l.themeStyle), t = i((l) => l.card), o = i((l) => l.actions.setCard);
2280
+ if (P(() => {
2276
2281
  }, [
2277
2282
  t.data,
2278
2283
  t.type,
@@ -2282,8 +2287,8 @@ function ja({
2282
2287
  t.preferences
2283
2288
  ]), !t.id)
2284
2289
  return null;
2285
- let o;
2286
- return t.data && t.data.length > 0 && (o = la({
2290
+ let c;
2291
+ return t.data && t.data.length > 0 && (c = ra({
2287
2292
  data: t.data,
2288
2293
  cardType: t.type,
2289
2294
  cfg: t.cfg,
@@ -2293,24 +2298,24 @@ function ja({
2293
2298
  pt,
2294
2299
  {
2295
2300
  role: "editor-visual-card",
2296
- className: W("relative flex h-full flex-col rounded-none", s),
2301
+ className: Y("relative flex h-full flex-col rounded-none", s),
2297
2302
  ...n,
2298
2303
  children: [
2299
2304
  /* @__PURE__ */ e.jsxs(ft, { className: "py-4", children: [
2300
2305
  /* @__PURE__ */ e.jsx(
2301
- Vs,
2306
+ qs,
2302
2307
  {
2303
2308
  text: t.title,
2304
- onSave: (c) => i({ ...t, title: c }),
2309
+ onSave: (l) => o({ ...t, title: l }),
2305
2310
  children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(gt, { className: "text-base", children: t.title }) })
2306
2311
  },
2307
2312
  t.title
2308
2313
  ),
2309
2314
  /* @__PURE__ */ e.jsx(
2310
- Vs,
2315
+ qs,
2311
2316
  {
2312
2317
  text: t.description || "",
2313
- onSave: (c) => i({ ...t, description: c }),
2318
+ onSave: (l) => o({ ...t, description: l }),
2314
2319
  children: /* @__PURE__ */ e.jsxs(jt, { children: [
2315
2320
  " ",
2316
2321
  t.description
@@ -2320,13 +2325,13 @@ function ja({
2320
2325
  )
2321
2326
  ] }),
2322
2327
  /* @__PURE__ */ e.jsxs(bt, { className: "flex grow flex-col pb-3", children: [
2323
- t.type !== "table" && o && // <ChartJsVisual key={visualKey} cfg={cfg} />
2328
+ t.type !== "table" && c && // <ChartJsVisual key={visualKey} cfg={cfg} />
2324
2329
  /* @__PURE__ */ e.jsx(
2325
2330
  yt,
2326
2331
  {
2327
- cfg: o
2332
+ cfg: c
2328
2333
  },
2329
- JSON.stringify(o) + JSON.stringify(t.preferences) + ((l = t == null ? void 0 : t.preferences) == null ? void 0 : l.customVisualCode)
2334
+ JSON.stringify(c) + JSON.stringify(t.preferences) + ((r = t == null ? void 0 : t.preferences) == null ? void 0 : r.customVisualCode)
2330
2335
  ),
2331
2336
  t.type === "table" && t.data && t.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2332
2337
  /* @__PURE__ */ e.jsx(vt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Nt, { card: t, data: t == null ? void 0 : t.data }) })
@@ -2336,60 +2341,60 @@ function ja({
2336
2341
  );
2337
2342
  }
2338
2343
  function _n() {
2339
- const [s, n] = T(!1), [a, t] = T(""), [i, o] = T(""), [l, c] = T(""), [h, g] = T(""), m = r((C) => C.card), u = r(
2340
- (C) => C.card.customCfg
2341
- ), { setCardCustomCfg: N, setCustomVisualCode: d } = Ct();
2342
- function x(C) {
2344
+ const [s, n] = T(!1), [a, t] = T(""), [o, c] = T(""), [r, l] = T(""), [d, f] = T(""), m = i((N) => N.card), u = i(
2345
+ (N) => N.card.customCfg
2346
+ ), { setCardCustomCfg: S, setCustomVisualCode: h } = Ct();
2347
+ function x(N) {
2343
2348
  var F, A;
2344
2349
  const O = {
2345
- ...C,
2350
+ ...N,
2346
2351
  data: {
2347
- ...C == null ? void 0 : C.data,
2348
- datasets: (A = (F = C == null ? void 0 : C.data) == null ? void 0 : F.datasets) == null ? void 0 : A.map((V) => ({
2349
- ...V,
2352
+ ...N == null ? void 0 : N.data,
2353
+ datasets: (A = (F = N == null ? void 0 : N.data) == null ? void 0 : F.datasets) == null ? void 0 : A.map((q) => ({
2354
+ ...q,
2350
2355
  data: []
2351
2356
  }))
2352
2357
  }
2353
2358
  };
2354
2359
  return JSON.stringify(O, null, 1);
2355
2360
  }
2356
- function f() {
2361
+ function g() {
2357
2362
  var O, j;
2358
2363
  if (!m.data || m.data.length === 0)
2359
2364
  return;
2360
- const C = la({
2365
+ const N = ra({
2361
2366
  data: m.data,
2362
2367
  cardType: m.type,
2363
2368
  cfg: m.cfg,
2364
2369
  preferences: m.preferences
2365
2370
  });
2366
- C && (t(JSON.stringify(C, null, 1)), (O = m == null ? void 0 : m.preferences) != null && O.customVisualCode && c((j = m == null ? void 0 : m.preferences) == null ? void 0 : j.customVisualCode), u && o(JSON.stringify(u, null, 1)));
2371
+ N && (t(JSON.stringify(N, null, 1)), (O = m == null ? void 0 : m.preferences) != null && O.customVisualCode && l((j = m == null ? void 0 : m.preferences) == null ? void 0 : j.customVisualCode), u && c(JSON.stringify(u, null, 1)));
2367
2372
  }
2368
- function w() {
2369
- if (l && d(l), !!i)
2373
+ function z() {
2374
+ if (r && h(r), !!o)
2370
2375
  try {
2371
- const C = JSON.parse(i);
2372
- return C ? (N(C), g(""), o(""), C) : void 0;
2373
- } catch (C) {
2374
- console.log(C), g("Invalid JSON");
2376
+ const N = JSON.parse(o);
2377
+ return N ? (S(N), f(""), c(""), N) : void 0;
2378
+ } catch (N) {
2379
+ console.log(N), f("Invalid JSON");
2375
2380
  }
2376
2381
  }
2377
2382
  function b() {
2378
- o(""), N(null);
2383
+ c(""), S(null);
2379
2384
  }
2380
2385
  function L() {
2381
- let C;
2386
+ let N;
2382
2387
  if (u) {
2383
- const O = qs.cloneDeep(m.cfg), j = qs.merge(O, u);
2384
- return C = x(j), C;
2388
+ const O = Vs.cloneDeep(m.cfg), j = Vs.merge(O, u);
2389
+ return N = x(j), N;
2385
2390
  }
2386
- return a ? (C = x(JSON.parse(a)), C) : "";
2391
+ return a ? (N = x(JSON.parse(a)), N) : "";
2387
2392
  }
2388
- return /* @__PURE__ */ e.jsxs(us, { open: s, onOpenChange: n, children: [
2389
- /* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2390
- z,
2393
+ return /* @__PURE__ */ e.jsxs(xs, { open: s, onOpenChange: n, children: [
2394
+ /* @__PURE__ */ e.jsx(ps, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2395
+ w,
2391
2396
  {
2392
- onClick: f,
2397
+ onClick: g,
2393
2398
  className: ` ${u && "border-foreground/50 dark:border-foreground/70"}`,
2394
2399
  size: "sm",
2395
2400
  variant: "outline",
@@ -2397,14 +2402,14 @@ function _n() {
2397
2402
  }
2398
2403
  ) }),
2399
2404
  /* @__PURE__ */ e.jsxs(
2400
- ps,
2405
+ fs,
2401
2406
  {
2402
2407
  className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
2403
2408
  children: [
2404
- /* @__PURE__ */ e.jsxs(fs, { className: "", children: [
2409
+ /* @__PURE__ */ e.jsxs(gs, { className: "", children: [
2405
2410
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2406
- /* @__PURE__ */ e.jsx(gs, { children: "Customize Card" }),
2407
- /* @__PURE__ */ e.jsxs(bs, { children: [
2411
+ /* @__PURE__ */ e.jsx(js, { children: "Customize Card" }),
2412
+ /* @__PURE__ */ e.jsxs(ys, { children: [
2408
2413
  /* @__PURE__ */ e.jsx(Js, { children: /* @__PURE__ */ e.jsx(
2409
2414
  sn,
2410
2415
  {
@@ -2414,10 +2419,10 @@ function _n() {
2414
2419
  className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
2415
2420
  }
2416
2421
  ) }),
2417
- /* @__PURE__ */ e.jsx(ys, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
2422
+ /* @__PURE__ */ e.jsx(vs, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
2418
2423
  ] })
2419
2424
  ] }),
2420
- /* @__PURE__ */ e.jsxs(js, { children: [
2425
+ /* @__PURE__ */ e.jsxs(bs, { children: [
2421
2426
  "See the configuration options and documentation",
2422
2427
  /* @__PURE__ */ e.jsx(
2423
2428
  "a",
@@ -2434,12 +2439,12 @@ function _n() {
2434
2439
  /* @__PURE__ */ e.jsx(ja, { className: "w-1/2 rounded shadow-none" }),
2435
2440
  /* @__PURE__ */ e.jsxs(kt, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2436
2441
  /* @__PURE__ */ e.jsxs(wt, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2437
- /* @__PURE__ */ e.jsxs(rs, { value: "custom-config", children: [
2442
+ /* @__PURE__ */ e.jsxs(ls, { value: "custom-config", children: [
2438
2443
  u && /* @__PURE__ */ e.jsx(zt, { className: "mr-1 h-5 w-5 text-green-600" }),
2439
2444
  u ? "Custom Config" : "Default Config"
2440
2445
  ] }),
2441
- /* @__PURE__ */ e.jsx(rs, { className: "", value: "output", children: "Output" }),
2442
- /* @__PURE__ */ e.jsx(rs, { className: "", value: "custom-code", children: "Custom Code" })
2446
+ /* @__PURE__ */ e.jsx(ls, { className: "", value: "output", children: "Output" }),
2447
+ /* @__PURE__ */ e.jsx(ls, { className: "", value: "custom-code", children: "Custom Code" })
2443
2448
  ] }),
2444
2449
  /* @__PURE__ */ e.jsx(
2445
2450
  is,
@@ -2480,7 +2485,7 @@ function _n() {
2480
2485
  },
2481
2486
  defaultLanguage: "json",
2482
2487
  value: L(),
2483
- onChange: (C) => o(C)
2488
+ onChange: (N) => c(N)
2484
2489
  }
2485
2490
  )
2486
2491
  }
@@ -2508,8 +2513,8 @@ function _n() {
2508
2513
  renderLineHighlight: "none"
2509
2514
  },
2510
2515
  defaultLanguage: "javascript",
2511
- value: l,
2512
- onChange: (C) => c(C || "")
2516
+ value: r,
2517
+ onChange: (N) => l(N || "")
2513
2518
  }
2514
2519
  )
2515
2520
  }
@@ -2517,9 +2522,9 @@ function _n() {
2517
2522
  ] })
2518
2523
  ] }),
2519
2524
  /* @__PURE__ */ e.jsxs(Us, { className: "flex items-center", children: [
2520
- /* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children: h }),
2525
+ /* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children: d }),
2521
2526
  /* @__PURE__ */ e.jsx(
2522
- z,
2527
+ w,
2523
2528
  {
2524
2529
  disabled: !u,
2525
2530
  onClick: b,
@@ -2527,8 +2532,8 @@ function _n() {
2527
2532
  children: "Reset"
2528
2533
  }
2529
2534
  ),
2530
- /* @__PURE__ */ e.jsx(z, { onClick: w, variant: "outline", children: "Apply" }),
2531
- /* @__PURE__ */ e.jsx(z, { onClick: () => n(!1), variant: "outline", children: "Close" })
2535
+ /* @__PURE__ */ e.jsx(w, { onClick: z, variant: "outline", children: "Apply" }),
2536
+ /* @__PURE__ */ e.jsx(w, { onClick: () => n(!1), variant: "outline", children: "Close" })
2532
2537
  ] })
2533
2538
  ]
2534
2539
  }
@@ -2557,36 +2562,34 @@ function ka(s) {
2557
2562
  return fe({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
2558
2563
  }
2559
2564
  function Hn() {
2560
- const [s, n] = T(!1), a = r((c) => c.card.type), { setCardType: t, setCardPreferences: i } = r(
2561
- (c) => c.actions
2562
- ), o = r(
2563
- (c) => c.actions.setCardCustomCfg
2565
+ const [s, n] = T(!1), a = i((d) => d.card.type), { setCardType: t, setCardPreferences: o, setChartOrientation: c } = i((d) => d.actions), r = i(
2566
+ (d) => d.actions.setCardCustomCfg
2564
2567
  );
2565
- function l(c) {
2566
- t(c), o(null), i({}), n(!1);
2568
+ function l(d) {
2569
+ r(null), o({}), t(d), n(!1);
2567
2570
  }
2568
- return /* @__PURE__ */ e.jsxs(Pe, { open: s, onOpenChange: n, children: [
2569
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Bn, { className: "h-4 w-4", chartType: a }) }) }),
2571
+ return /* @__PURE__ */ e.jsxs(Ke, { open: s, onOpenChange: n, children: [
2572
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Bn, { className: "h-4 w-4", chartType: a }) }) }),
2570
2573
  /* @__PURE__ */ e.jsx(Ge, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2571
2574
  /* @__PURE__ */ e.jsx(
2572
- z,
2575
+ w,
2573
2576
  {
2574
2577
  onClick: () => l("bar"),
2575
2578
  className: "font-normal",
2576
2579
  variant: "ghost",
2577
- children: /* @__PURE__ */ e.jsx(ks, { className: "size-5" })
2580
+ children: /* @__PURE__ */ e.jsx(ws, { className: "size-5" })
2578
2581
  }
2579
2582
  ),
2580
2583
  /* @__PURE__ */ e.jsx(
2581
- z,
2584
+ w,
2582
2585
  {
2583
2586
  onClick: () => l("line"),
2584
2587
  variant: "ghost",
2585
- children: /* @__PURE__ */ e.jsx(ws, { className: "size-5" })
2588
+ children: /* @__PURE__ */ e.jsx(zs, { className: "size-5" })
2586
2589
  }
2587
2590
  ),
2588
2591
  /* @__PURE__ */ e.jsx(
2589
- z,
2592
+ w,
2590
2593
  {
2591
2594
  onClick: () => l("stackedBar"),
2592
2595
  variant: "ghost",
@@ -2594,7 +2597,7 @@ function Hn() {
2594
2597
  }
2595
2598
  ),
2596
2599
  /* @__PURE__ */ e.jsx(
2597
- z,
2600
+ w,
2598
2601
  {
2599
2602
  onClick: () => l("scatter"),
2600
2603
  variant: "ghost",
@@ -2602,7 +2605,7 @@ function Hn() {
2602
2605
  }
2603
2606
  ),
2604
2607
  /* @__PURE__ */ e.jsx(
2605
- z,
2608
+ w,
2606
2609
  {
2607
2610
  onClick: () => l("bubble"),
2608
2611
  variant: "ghost",
@@ -2610,7 +2613,7 @@ function Hn() {
2610
2613
  }
2611
2614
  ),
2612
2615
  /* @__PURE__ */ e.jsx(
2613
- z,
2616
+ w,
2614
2617
  {
2615
2618
  onClick: () => l("pie"),
2616
2619
  variant: "ghost",
@@ -2618,7 +2621,7 @@ function Hn() {
2618
2621
  }
2619
2622
  ),
2620
2623
  /* @__PURE__ */ e.jsx(
2621
- z,
2624
+ w,
2622
2625
  {
2623
2626
  onClick: () => l("doughnut"),
2624
2627
  variant: "ghost",
@@ -2626,7 +2629,7 @@ function Hn() {
2626
2629
  }
2627
2630
  ),
2628
2631
  /* @__PURE__ */ e.jsx(
2629
- z,
2632
+ w,
2630
2633
  {
2631
2634
  onClick: () => l("radar"),
2632
2635
  variant: "ghost",
@@ -2640,7 +2643,7 @@ function Hn() {
2640
2643
  }
2641
2644
  ),
2642
2645
  /* @__PURE__ */ e.jsx(
2643
- z,
2646
+ w,
2644
2647
  {
2645
2648
  onClick: () => l("polarArea"),
2646
2649
  variant: "ghost",
@@ -2648,7 +2651,7 @@ function Hn() {
2648
2651
  }
2649
2652
  ),
2650
2653
  /* @__PURE__ */ e.jsx(
2651
- z,
2654
+ w,
2652
2655
  {
2653
2656
  onClick: () => l("pyramid"),
2654
2657
  variant: "ghost",
@@ -2656,7 +2659,7 @@ function Hn() {
2656
2659
  }
2657
2660
  ),
2658
2661
  /* @__PURE__ */ e.jsx(
2659
- z,
2662
+ w,
2660
2663
  {
2661
2664
  onClick: () => l("range"),
2662
2665
  variant: "ghost",
@@ -2664,15 +2667,15 @@ function Hn() {
2664
2667
  }
2665
2668
  ),
2666
2669
  /* @__PURE__ */ e.jsx(
2667
- z,
2670
+ w,
2668
2671
  {
2669
2672
  onClick: () => l("table"),
2670
2673
  variant: "ghost",
2671
- children: /* @__PURE__ */ e.jsx(vs, { className: "size-5" })
2674
+ children: /* @__PURE__ */ e.jsx(Ns, { className: "size-5" })
2672
2675
  }
2673
2676
  ),
2674
2677
  /* @__PURE__ */ e.jsx(
2675
- z,
2678
+ w,
2676
2679
  {
2677
2680
  onClick: () => l("kpi"),
2678
2681
  variant: "ghost",
@@ -2685,9 +2688,9 @@ function Hn() {
2685
2688
  function Bn({ chartType: s, className: n }) {
2686
2689
  switch (s) {
2687
2690
  case "bar":
2688
- return /* @__PURE__ */ e.jsx(ks, { className: n });
2689
- case "line":
2690
2691
  return /* @__PURE__ */ e.jsx(ws, { className: n });
2692
+ case "line":
2693
+ return /* @__PURE__ */ e.jsx(zs, { className: n });
2691
2694
  case "pie":
2692
2695
  return /* @__PURE__ */ e.jsx(ha, { className: n });
2693
2696
  case "radar":
@@ -2709,17 +2712,17 @@ function Bn({ chartType: s, className: n }) {
2709
2712
  case "kpi":
2710
2713
  return /* @__PURE__ */ e.jsx(Sa, { className: n });
2711
2714
  default:
2712
- return /* @__PURE__ */ e.jsx(vs, { className: n });
2715
+ return /* @__PURE__ */ e.jsx(Ns, { className: n });
2713
2716
  }
2714
2717
  }
2715
2718
  function $n() {
2716
- const s = r(
2719
+ const s = i(
2717
2720
  (a) => a.card.refreshInterval
2718
- ), n = r(
2721
+ ), n = i(
2719
2722
  (a) => a.actions.setCardRefreshInterval
2720
2723
  );
2721
- return /* @__PURE__ */ e.jsxs(Pe, { children: [
2722
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Gt, { className: "w-4 h-4" }) }) }),
2724
+ return /* @__PURE__ */ e.jsxs(Ke, { children: [
2725
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Gt, { className: "w-4 h-4" }) }) }),
2723
2726
  /* @__PURE__ */ e.jsx(Ge, { className: "w-[200px]", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-4", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-5 items-center gap-1", children: [
2724
2727
  /* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
2725
2728
  /* @__PURE__ */ e.jsx(
@@ -2736,9 +2739,9 @@ function $n() {
2736
2739
  ] });
2737
2740
  }
2738
2741
  function $s() {
2739
- r((l) => l.frame);
2740
- const s = r((l) => l.card), n = r((l) => l.card.data), a = r((l) => l.isShowingVisual), t = r((l) => l.isSqlRunning), i = r((l) => l.queryError), o = r((l) => l.pythonStdOut);
2741
- return r((l) => l.onSave), r((l) => l.onClose), r((l) => l.actions.setCardSql), r((l) => l.actions.setCardType), r((l) => l.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
2742
+ i((r) => r.frame);
2743
+ const s = i((r) => r.card), n = i((r) => r.card.data), a = i((r) => r.isShowingVisual), t = i((r) => r.isSqlRunning), o = i((r) => r.queryError), c = i((r) => r.pythonStdOut);
2744
+ return i((r) => r.onSave), i((r) => r.onClose), i((r) => r.actions.setCardSql), i((r) => r.actions.setCardType), i((r) => r.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
2742
2745
  t && /* @__PURE__ */ e.jsx(Be, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
2743
2746
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
2744
2747
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
@@ -2746,17 +2749,17 @@ function $s() {
2746
2749
  s.type !== "table" && /* @__PURE__ */ e.jsx(_n, {}),
2747
2750
  /* @__PURE__ */ e.jsx($n, {})
2748
2751
  ] }),
2749
- /* @__PURE__ */ e.jsx(Pn, {})
2752
+ /* @__PURE__ */ e.jsx(Kn, {})
2750
2753
  ] }),
2751
2754
  a ? s.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex grow items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Ft, { isLoading: t, card: s }) }) }) : /* @__PURE__ */ e.jsx(ja, { className: "grow border-none shadow-none" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
2752
- o && /* @__PURE__ */ e.jsx(Kn, {}),
2755
+ c && /* @__PURE__ */ e.jsx(Pn, {}),
2753
2756
  s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(Rn, { data: n || [] }),
2754
- i && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: i })
2757
+ o && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: o })
2755
2758
  ] })
2756
2759
  ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
2757
2760
  }
2758
- function Kn() {
2759
- const s = r((a) => a.pythonStdOut);
2761
+ function Pn() {
2762
+ const s = i((a) => a.pythonStdOut);
2760
2763
  if (!s)
2761
2764
  return null;
2762
2765
  const n = s.replace(/\n/g, "<br>");
@@ -2769,11 +2772,11 @@ function Kn() {
2769
2772
  className: "bg-muted p-2 font-mono text-sm"
2770
2773
  }
2771
2774
  ),
2772
- /* @__PURE__ */ e.jsx(Cs, { className: "mb-2" })
2775
+ /* @__PURE__ */ e.jsx(Ss, { className: "mb-2" })
2773
2776
  ] });
2774
2777
  }
2775
- function Pn() {
2776
- const s = r((a) => a.isShowingVisual), n = r(
2778
+ function Kn() {
2779
+ const s = i((a) => a.isShowingVisual), n = i(
2777
2780
  (a) => a.actions.setIsShowingVisual
2778
2781
  );
2779
2782
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
@@ -2791,23 +2794,23 @@ function Pn() {
2791
2794
  }
2792
2795
  function De() {
2793
2796
  const [s, n] = T([]);
2794
- r(
2797
+ i(
2795
2798
  (m) => m.card.cfg
2796
2799
  );
2797
- const a = r((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: i, setCardPreferences: o } = r((m) => m.actions), l = r(
2800
+ const a = i((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: o, setCardPreferences: c } = i((m) => m.actions), r = i(
2798
2801
  (m) => m.queryResultColumns
2799
2802
  );
2800
- r(
2803
+ i(
2801
2804
  (m) => {
2802
2805
  var u;
2803
2806
  return (u = m.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
2804
2807
  }
2805
- ), K(() => {
2806
- l && n(new Array(l.length).fill(!1));
2807
- }, [l]);
2808
- function c(m, u) {
2809
- var N, d;
2810
- u ? a != null && a.onClickFilter && ((N = a == null ? void 0 : a.onClickFilter) == null ? void 0 : N.length) > 0 ? o({
2808
+ ), P(() => {
2809
+ r && n(new Array(r.length).fill(!1));
2810
+ }, [r]);
2811
+ function l(m, u) {
2812
+ var S, h;
2813
+ u ? a != null && a.onClickFilter && ((S = a == null ? void 0 : a.onClickFilter) == null ? void 0 : S.length) > 0 ? c({
2811
2814
  ...a,
2812
2815
  onClickFilter: [
2813
2816
  ...a.onClickFilter,
@@ -2816,7 +2819,7 @@ function De() {
2816
2819
  expression: ""
2817
2820
  }
2818
2821
  ]
2819
- }) : o({
2822
+ }) : c({
2820
2823
  ...a,
2821
2824
  onClickFilter: [
2822
2825
  {
@@ -2824,43 +2827,43 @@ function De() {
2824
2827
  expression: ""
2825
2828
  }
2826
2829
  ]
2827
- }) : (o({
2830
+ }) : (c({
2828
2831
  ...a,
2829
- onClickFilter: (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.filter(
2832
+ onClickFilter: (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.filter(
2830
2833
  (x) => x.columnIndex !== m
2831
2834
  )
2832
2835
  }), n((x) => {
2833
- const f = [...x];
2834
- return f[m] = !1, f;
2836
+ const g = [...x];
2837
+ return g[m] = !1, g;
2835
2838
  }));
2836
2839
  }
2837
- function h(m, u) {
2838
- var d;
2839
- const N = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.map((x) => x.columnIndex === m ? {
2840
+ function d(m, u) {
2841
+ var h;
2842
+ const S = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((x) => x.columnIndex === m ? {
2840
2843
  ...x,
2841
2844
  expression: u.target.value
2842
2845
  } : x);
2843
- o({
2846
+ c({
2844
2847
  ...a,
2845
- onClickFilter: N
2848
+ onClickFilter: S
2846
2849
  });
2847
2850
  }
2848
- function g(m) {
2849
- var u, N, d, x;
2850
- if (s != null && s[m] || (N = (u = a == null ? void 0 : a.onClickFilter) == null ? void 0 : u.find((f) => f.columnIndex === m)) != null && N.expression)
2851
+ function f(m) {
2852
+ var u, S, h, x;
2853
+ if (s != null && s[m] || (S = (u = a == null ? void 0 : a.onClickFilter) == null ? void 0 : u.find((g) => g.columnIndex === m)) != null && S.expression)
2851
2854
  return /* @__PURE__ */ e.jsx(
2852
2855
  ae,
2853
2856
  {
2854
- value: (x = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.find((f) => f.columnIndex === m)) == null ? void 0 : x.expression,
2855
- onChange: (f) => h(m, f),
2857
+ value: (x = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find((g) => g.columnIndex === m)) == null ? void 0 : x.expression,
2858
+ onChange: (g) => d(m, g),
2856
2859
  type: "text",
2857
2860
  className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
2858
2861
  placeholder: "Expression"
2859
2862
  }
2860
2863
  );
2861
2864
  }
2862
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: l == null ? void 0 : l.map((m, u) => {
2863
- var N, d;
2865
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: r == null ? void 0 : r.map((m, u) => {
2866
+ var S, h;
2864
2867
  return /* @__PURE__ */ e.jsx(
2865
2868
  "div",
2866
2869
  {
@@ -2868,12 +2871,12 @@ function De() {
2868
2871
  children: /* @__PURE__ */ e.jsxs("div", { className: " grow", children: [
2869
2872
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center py-2 space-x-2", children: [
2870
2873
  /* @__PURE__ */ e.jsx(
2871
- Ke,
2874
+ Pe,
2872
2875
  {
2873
- checked: !!((N = a == null ? void 0 : a.onClickFilter) != null && N.find(
2876
+ checked: !!((S = a == null ? void 0 : a.onClickFilter) != null && S.find(
2874
2877
  (x) => x.columnIndex === u
2875
2878
  )),
2876
- onCheckedChange: (x) => c(u, x)
2879
+ onCheckedChange: (x) => l(u, x)
2877
2880
  }
2878
2881
  ),
2879
2882
  /* @__PURE__ */ e.jsx(
@@ -2883,61 +2886,42 @@ function De() {
2883
2886
  children: m
2884
2887
  }
2885
2888
  ),
2886
- /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.find(
2889
+ /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find(
2887
2890
  (x) => x.columnIndex === u
2888
2891
  )) && /* @__PURE__ */ e.jsx(
2889
2892
  da,
2890
2893
  {
2891
2894
  onClick: () => {
2892
2895
  n((x) => {
2893
- const f = [...x];
2894
- return f[u] = !x[u], f;
2896
+ const g = [...x];
2897
+ return g[u] = !x[u], g;
2895
2898
  });
2896
2899
  },
2897
2900
  className: " invisible group-hover:visible size-3 text-gray-400 cursor-pointer"
2898
2901
  }
2899
2902
  ) })
2900
2903
  ] }),
2901
- g(u)
2904
+ f(u)
2902
2905
  ] })
2903
2906
  },
2904
2907
  m
2905
2908
  );
2906
2909
  }) });
2907
2910
  }
2908
- function zs() {
2909
- var o, l, c;
2910
- const s = r((h) => h.card.preferences), n = r(
2911
- (h) => h.card.cfg
2912
- ), { setCardCfg: a, setCardPreferences: t } = r(
2913
- (h) => h.actions
2914
- );
2915
- (o = n == null ? void 0 : n.options) != null && o.indexAxis;
2916
- function i(h) {
2917
- var u, N, d, x, f, w;
2918
- let g = {};
2919
- (u = s == null ? void 0 : s.chartOptions) != null && u.scales && (g = {
2920
- x: (d = (N = s == null ? void 0 : s.chartOptions) == null ? void 0 : N.scales) == null ? void 0 : d.y,
2921
- y: (f = (x = s == null ? void 0 : s.chartOptions) == null ? void 0 : x.scales) == null ? void 0 : f.x
2922
- });
2923
- const m = {
2924
- ...s,
2925
- chartOptions: {
2926
- ...s == null ? void 0 : s.chartOptions,
2927
- scales: {
2928
- ...(w = s == null ? void 0 : s.chartOptions) == null ? void 0 : w.scales,
2929
- ...g
2930
- },
2931
- indexAxis: h
2932
- }
2933
- };
2934
- t(m);
2911
+ function Fs() {
2912
+ var r, l, d;
2913
+ const s = i((f) => f.card.preferences), n = i(
2914
+ (f) => f.card.cfg
2915
+ ), { setCardCfg: a, setCardPreferences: t, setChartOrientation: o } = i((f) => f.actions);
2916
+ (r = n == null ? void 0 : n.options) != null && r.indexAxis;
2917
+ function c(f) {
2918
+ o(f);
2935
2919
  }
2936
2920
  return /* @__PURE__ */ e.jsxs(
2937
- ra,
2921
+ la,
2938
2922
  {
2939
- value: ((l = s == null ? void 0 : s.chartOptions) == null ? void 0 : l.indexAxis) || ((c = n == null ? void 0 : n.options) == null ? void 0 : c.indexAxis) || "x",
2940
- onValueChange: i,
2923
+ value: ((l = s == null ? void 0 : s.chartOptions) == null ? void 0 : l.indexAxis) || ((d = n == null ? void 0 : n.options) == null ? void 0 : d.indexAxis) || "x",
2924
+ onValueChange: c,
2941
2925
  className: "flex gap-3",
2942
2926
  defaultValue: "x",
2943
2927
  children: [
@@ -2954,43 +2938,43 @@ function zs() {
2954
2938
  );
2955
2939
  }
2956
2940
  const we = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
2957
- function Ks(s, n) {
2958
- var t, i, o;
2941
+ function Ps(s, n) {
2942
+ var t, o, c;
2959
2943
  const a = ia(s, n);
2960
- return ((o = (i = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : i[a]) == null ? void 0 : o.type) || "linear";
2944
+ return ((c = (o = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : o[a]) == null ? void 0 : c.type) || "linear";
2961
2945
  }
2962
2946
  function wa() {
2963
- var J, ee, Z, U, I, y;
2964
- const [s, n] = T(!1), a = r((v) => {
2947
+ var Q, ee, Z, J, I, y;
2948
+ const [s, n] = T(!1), a = i((v) => {
2965
2949
  var M;
2966
2950
  return (M = v.card) == null ? void 0 : M.preferences;
2967
- }), t = r((v) => {
2951
+ }), t = i((v) => {
2968
2952
  var M;
2969
2953
  return (M = v.card) == null ? void 0 : M.cfg;
2970
- }), i = ia(a, t), [o, l] = T(
2971
- Ks(a)
2972
- ), [c, h] = T(
2973
- ((Z = (ee = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : ee[i]) == null ? void 0 : Z.min) || ""
2974
- ), [g, m] = T(
2975
- ((y = (I = (U = a == null ? void 0 : a.chartOptions) == null ? void 0 : U.scales) == null ? void 0 : I[i]) == null ? void 0 : y.max) || ""
2976
- ), [u, N] = T(c || g ? "custom" : "auto"), [d, x] = T(""), [f, w] = T(0), [b, L] = T(""), [C, O] = T(""), [j, F] = T(""), A = r(
2954
+ }), o = ia(a, t), [c, r] = T(
2955
+ Ps(a)
2956
+ ), [l, d] = T(
2957
+ ((Z = (ee = (Q = a == null ? void 0 : a.chartOptions) == null ? void 0 : Q.scales) == null ? void 0 : ee[o]) == null ? void 0 : Z.min) || ""
2958
+ ), [f, m] = T(
2959
+ ((y = (I = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[o]) == null ? void 0 : y.max) || ""
2960
+ ), [u, S] = T(l || f ? "custom" : "auto"), [h, x] = T(""), [g, z] = T(0), [b, L] = T(""), [N, O] = T(""), [j, F] = T(""), A = i(
2977
2961
  (v) => v.actions.setCardPreferences
2978
- ), V = r((v) => {
2962
+ ), q = i((v) => {
2979
2963
  var M;
2980
2964
  return (M = v.card) == null ? void 0 : M.type;
2981
- }), Y = ["pie", "doughnut", "polarArea"].includes(V);
2982
- K(() => {
2983
- var v, M, H, ue, se, ge, je, be, xe, G, ne, le, ye, re;
2984
- l(Ks(a)), h(
2985
- ((H = (M = (v = a == null ? void 0 : a.chartOptions) == null ? void 0 : v.scales) == null ? void 0 : M[i]) == null ? void 0 : H.min) === 0 ? 0 : ""
2986
- ), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[i]) == null ? void 0 : ge.max) || ""), x(
2987
- ((G = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[i]) == null ? void 0 : xe.ticks) == null ? void 0 : G.stepSize) || ""
2988
- ), w(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), L(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.suffix) || ""), O(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.currency) || ""), F(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.locale) || "");
2989
- }, [s, a, i]);
2965
+ }), K = ["pie", "doughnut", "polarArea"].includes(q);
2966
+ P(() => {
2967
+ var v, M, H, ue, se, ge, je, be, xe, U, ne, re, ye, le;
2968
+ r(Ps(a)), d(
2969
+ ((H = (M = (v = a == null ? void 0 : a.chartOptions) == null ? void 0 : v.scales) == null ? void 0 : M[o]) == null ? void 0 : H.min) === 0 ? 0 : ""
2970
+ ), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[o]) == null ? void 0 : ge.max) || ""), x(
2971
+ ((U = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[o]) == null ? void 0 : xe.ticks) == null ? void 0 : U.stepSize) || ""
2972
+ ), z(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), L(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.suffix) || ""), O(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.currency) || ""), F(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.locale) || "");
2973
+ }, [s, a, o]);
2990
2974
  function $(v, M) {
2991
2975
  return M === "" || /^[0-9\b]+$/.test(M) ? Number(M) : Number(v);
2992
2976
  }
2993
- function P() {
2977
+ function G() {
2994
2978
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2995
2979
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
2996
2980
  /* @__PURE__ */ e.jsx(
@@ -3011,7 +2995,7 @@ function wa() {
3011
2995
  /* @__PURE__ */ e.jsx(
3012
2996
  ae,
3013
2997
  {
3014
- value: C,
2998
+ value: N,
3015
2999
  placeholder: "USD",
3016
3000
  onChange: (v) => O(v.target.value),
3017
3001
  id: "currency",
@@ -3034,8 +3018,8 @@ function wa() {
3034
3018
  /* @__PURE__ */ e.jsx(
3035
3019
  ae,
3036
3020
  {
3037
- value: f,
3038
- onChange: (v) => w(Number(v.target.value)),
3021
+ value: g,
3022
+ onChange: (v) => z(Number(v.target.value)),
3039
3023
  id: "format",
3040
3024
  className: `col-span-6 h-8 w-full tracking-wide ${we}`
3041
3025
  }
@@ -3051,15 +3035,15 @@ function wa() {
3051
3035
  ae,
3052
3036
  {
3053
3037
  id: "min",
3054
- value: c,
3055
- onChange: (v) => h((M) => $(M, v.target.value)),
3038
+ value: l,
3039
+ onChange: (v) => d((M) => $(M, v.target.value)),
3056
3040
  className: `col-span-1 h-8 w-full ${we}`
3057
3041
  }
3058
3042
  ),
3059
3043
  /* @__PURE__ */ e.jsx(
3060
3044
  ae,
3061
3045
  {
3062
- value: g,
3046
+ value: f,
3063
3047
  onChange: (v) => m((M) => $(M, v.target.value)),
3064
3048
  id: "max",
3065
3049
  className: `col-span-1 h-8 w-full ${we}`
@@ -3071,7 +3055,7 @@ function wa() {
3071
3055
  /* @__PURE__ */ e.jsx(
3072
3056
  ae,
3073
3057
  {
3074
- value: d,
3058
+ value: h,
3075
3059
  onChange: (v) => x((M) => $(M, v.target.value)),
3076
3060
  id: "step-size",
3077
3061
  className: `col-span-1 h-8 w-full ${we}`
@@ -3084,10 +3068,10 @@ function wa() {
3084
3068
  var H;
3085
3069
  let v = {};
3086
3070
  u === "custom" && (v = {
3087
- min: c,
3088
- max: g,
3071
+ min: l,
3072
+ max: f,
3089
3073
  ticks: {
3090
- stepSize: d
3074
+ stepSize: h
3091
3075
  }
3092
3076
  });
3093
3077
  const M = {
@@ -3096,23 +3080,23 @@ function wa() {
3096
3080
  ...a == null ? void 0 : a.chartOptions,
3097
3081
  scales: {
3098
3082
  ...(H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales,
3099
- [i]: {
3083
+ [o]: {
3100
3084
  // ...cardPreferences?.chartOptions?.scales?.[axis],
3101
- type: o,
3102
- ...o === "linear" ? v : {}
3085
+ type: c,
3086
+ ...c === "linear" ? v : {}
3103
3087
  }
3104
3088
  }
3105
3089
  },
3106
3090
  numberAxisFormat: {
3107
- decimalPlaces: f,
3091
+ decimalPlaces: g,
3108
3092
  suffix: b,
3109
- currency: C,
3093
+ currency: N,
3110
3094
  locale: j
3111
3095
  }
3112
3096
  };
3113
- A(M);
3097
+ console.log(M), A(M);
3114
3098
  }
3115
- return /* @__PURE__ */ e.jsxs(Pe, { onOpenChange: (v) => n(v), children: [
3099
+ return /* @__PURE__ */ e.jsxs(Ke, { onOpenChange: (v) => n(v), children: [
3116
3100
  /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Mt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3117
3101
  /* @__PURE__ */ e.jsx(Ge, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3118
3102
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
@@ -3125,9 +3109,9 @@ function wa() {
3125
3109
  /* @__PURE__ */ e.jsxs(
3126
3110
  Oe,
3127
3111
  {
3128
- disabled: Y,
3129
- value: o,
3130
- onValueChange: (v) => l(v),
3112
+ disabled: K,
3113
+ value: c,
3114
+ onValueChange: (v) => r(v),
3131
3115
  children: [
3132
3116
  /* @__PURE__ */ e.jsx(Me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3133
3117
  /* @__PURE__ */ e.jsx(Ae, { id: "type", children: /* @__PURE__ */ e.jsxs(He, { children: [
@@ -3139,15 +3123,15 @@ function wa() {
3139
3123
  }
3140
3124
  )
3141
3125
  ] }),
3142
- o == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3126
+ c == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3143
3127
  /* @__PURE__ */ e.jsx(B, { htmlFor: "scale-option", children: "Setup" }),
3144
3128
  /* @__PURE__ */ e.jsxs(
3145
- ra,
3129
+ la,
3146
3130
  {
3147
- disabled: Y,
3131
+ disabled: K,
3148
3132
  id: "scale-option",
3149
3133
  value: u,
3150
- onValueChange: (v) => N(v),
3134
+ onValueChange: (v) => S(v),
3151
3135
  className: "col-span-2 flex gap-3",
3152
3136
  defaultValue: "x",
3153
3137
  children: [
@@ -3163,11 +3147,11 @@ function wa() {
3163
3147
  }
3164
3148
  )
3165
3149
  ] }),
3166
- u === "custom" && o == "linear" && D(),
3167
- P(),
3150
+ u === "custom" && c == "linear" && D(),
3151
+ G(),
3168
3152
  /* @__PURE__ */ e.jsx(Tt, {}),
3169
3153
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
3170
- z,
3154
+ w,
3171
3155
  {
3172
3156
  onClick: te,
3173
3157
  variant: "secondary",
@@ -3180,56 +3164,56 @@ function wa() {
3180
3164
  ] });
3181
3165
  }
3182
3166
  function Un({ idx: s }) {
3183
- var c;
3184
- const n = r((h) => {
3185
- var g;
3186
- return (g = h.card) == null ? void 0 : g.preferences;
3187
- }), a = r(
3188
- (h) => {
3189
- var g;
3190
- return (g = h.card.preferences) == null ? void 0 : g.datasetOptions;
3167
+ var l;
3168
+ const n = i((d) => {
3169
+ var f;
3170
+ return (f = d.card) == null ? void 0 : f.preferences;
3171
+ }), a = i(
3172
+ (d) => {
3173
+ var f;
3174
+ return (f = d.card.preferences) == null ? void 0 : f.datasetOptions;
3191
3175
  }
3192
- ), t = r(
3193
- (h) => h.actions.setCardPreferences
3194
- ), i = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.indexAxis, o = a == null ? void 0 : a.find((h) => h.idx === s);
3195
- function l(h, g) {
3196
- (h === "end" || h === "start") && Et(Lt());
3176
+ ), t = i(
3177
+ (d) => d.actions.setCardPreferences
3178
+ ), o = (l = n == null ? void 0 : n.chartOptions) == null ? void 0 : l.indexAxis, c = a == null ? void 0 : a.find((d) => d.idx === s);
3179
+ function r(d, f) {
3180
+ (d === "end" || d === "start") && Et(Lt());
3197
3181
  const m = {
3198
- display: h !== "none",
3199
- align: h,
3200
- anchor: h,
3182
+ display: d !== "none",
3183
+ align: d,
3184
+ anchor: d,
3201
3185
  clamp: !0
3202
3186
  };
3203
- if (!o)
3187
+ if (!c)
3204
3188
  t({
3205
3189
  ...n,
3206
3190
  datasetOptions: [
3207
3191
  ...a || [],
3208
3192
  {
3209
- idx: g,
3193
+ idx: f,
3210
3194
  datalabels: m
3211
3195
  }
3212
3196
  ]
3213
3197
  });
3214
3198
  else {
3215
- const u = { ...o };
3199
+ const u = { ...c };
3216
3200
  u.datalabels = m;
3217
- const N = a == null ? void 0 : a.map(
3218
- (d) => d.idx === g ? u : d
3201
+ const S = a == null ? void 0 : a.map(
3202
+ (h) => h.idx === f ? u : h
3219
3203
  );
3220
3204
  t({
3221
3205
  ...n,
3222
- datasetOptions: N
3206
+ datasetOptions: S
3223
3207
  });
3224
3208
  }
3225
3209
  }
3226
- return /* @__PURE__ */ e.jsxs(Pe, { children: [
3210
+ return /* @__PURE__ */ e.jsxs(Ke, { children: [
3227
3211
  /* @__PURE__ */ e.jsx(Ue, { children: /* @__PURE__ */ e.jsx(xn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3228
3212
  /* @__PURE__ */ e.jsx(Ge, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3229
3213
  /* @__PURE__ */ e.jsx(
3230
- z,
3214
+ w,
3231
3215
  {
3232
- onClick: () => l("none", s),
3216
+ onClick: () => r("none", s),
3233
3217
  size: "sm",
3234
3218
  variant: "secondary",
3235
3219
  className: "h-7 p-1 text-xs font-normal",
@@ -3237,51 +3221,51 @@ function Un({ idx: s }) {
3237
3221
  }
3238
3222
  ),
3239
3223
  /* @__PURE__ */ e.jsx(
3240
- z,
3224
+ w,
3241
3225
  {
3242
- onClick: () => l("start", s),
3226
+ onClick: () => r("start", s),
3243
3227
  size: "sm",
3244
3228
  variant: "secondary",
3245
3229
  className: "h-7 p-1 text-xs font-normal",
3246
3230
  children: /* @__PURE__ */ e.jsx(
3247
3231
  an,
3248
3232
  {
3249
- className: W("h-4 w-4", {
3250
- "rotate-90": i === "y"
3233
+ className: Y("h-4 w-4", {
3234
+ "rotate-90": o === "y"
3251
3235
  })
3252
3236
  }
3253
3237
  )
3254
3238
  }
3255
3239
  ),
3256
3240
  /* @__PURE__ */ e.jsx(
3257
- z,
3241
+ w,
3258
3242
  {
3259
- onClick: () => l("center", s),
3243
+ onClick: () => r("center", s),
3260
3244
  size: "sm",
3261
3245
  variant: "secondary",
3262
3246
  className: "h-7 p-1 text-xs font-normal",
3263
3247
  children: /* @__PURE__ */ e.jsx(
3264
3248
  nn,
3265
3249
  {
3266
- className: W("h-4 w-4", {
3267
- "rotate-90": i === "y"
3250
+ className: Y("h-4 w-4", {
3251
+ "rotate-90": o === "y"
3268
3252
  })
3269
3253
  }
3270
3254
  )
3271
3255
  }
3272
3256
  ),
3273
3257
  /* @__PURE__ */ e.jsx(
3274
- z,
3258
+ w,
3275
3259
  {
3276
- onClick: () => l("end", s),
3260
+ onClick: () => r("end", s),
3277
3261
  size: "sm",
3278
3262
  variant: "secondary",
3279
3263
  className: "h-7 p-1 text-xs font-normal",
3280
3264
  children: /* @__PURE__ */ e.jsx(
3281
3265
  tn,
3282
3266
  {
3283
- className: W("h-4 w-4", {
3284
- "rotate-90": i === "y"
3267
+ className: Y("h-4 w-4", {
3268
+ "rotate-90": o === "y"
3285
3269
  })
3286
3270
  }
3287
3271
  )
@@ -3291,72 +3275,72 @@ function Un({ idx: s }) {
3291
3275
  ] });
3292
3276
  }
3293
3277
  function za() {
3294
- const s = r((h) => h.card), n = r(
3295
- (h) => {
3296
- var g, m, u;
3297
- return (u = (m = (g = h == null ? void 0 : h.card) == null ? void 0 : g.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : u.indexAxis;
3278
+ const s = i((d) => d.card), n = i(
3279
+ (d) => {
3280
+ var f, m, u;
3281
+ return (u = (m = (f = d == null ? void 0 : d.card) == null ? void 0 : f.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : u.indexAxis;
3298
3282
  }
3299
3283
  ), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
3300
- keys: i,
3301
- metricKeys: o,
3302
- dimensionKeys: l
3303
- } = ds(s.data || []);
3304
- let c = o;
3284
+ keys: o,
3285
+ metricKeys: c,
3286
+ dimensionKeys: r
3287
+ } = hs(s.data || []);
3288
+ let l = c;
3305
3289
  if (s.type === "stackedBar") {
3306
- const h = Dt({
3290
+ const d = Dt({
3307
3291
  dataArray: s.data || [],
3308
- groupKey: l[0],
3309
- pivotKey: l[1],
3310
- valueKey: c[0]
3311
- }), { metricKeys: g } = ds(h);
3312
- c = g;
3292
+ groupKey: r[0],
3293
+ pivotKey: r[1],
3294
+ valueKey: l[0]
3295
+ }), { metricKeys: f } = hs(d);
3296
+ l = f;
3313
3297
  }
3314
- return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3298
+ return o.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3315
3299
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3316
3300
  /* @__PURE__ */ e.jsx(B, { children: a }),
3317
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: l[0] }) }) })
3301
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: r[0] }) }) })
3318
3302
  ] }),
3319
3303
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3320
3304
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
3321
3305
  /* @__PURE__ */ e.jsx(B, { children: t }),
3322
3306
  /* @__PURE__ */ e.jsx(wa, {})
3323
3307
  ] }),
3324
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((h, g) => /* @__PURE__ */ e.jsx(Gn, { col: h, idx: g }, h)) })
3308
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: l.map((d, f) => /* @__PURE__ */ e.jsx(Gn, { col: d, idx: f }, d)) })
3325
3309
  ] })
3326
3310
  ] });
3327
3311
  }
3328
3312
  function Gn({ col: s, idx: n }) {
3329
- const a = r((c) => {
3330
- var h;
3331
- return (h = c.card) == null ? void 0 : h.preferences;
3332
- }), t = r(
3333
- (c) => {
3334
- var h;
3335
- return (h = c.card.preferences) == null ? void 0 : h.datasetOptions;
3313
+ const a = i((l) => {
3314
+ var d;
3315
+ return (d = l.card) == null ? void 0 : d.preferences;
3316
+ }), t = i(
3317
+ (l) => {
3318
+ var d;
3319
+ return (d = l.card.preferences) == null ? void 0 : d.datasetOptions;
3336
3320
  }
3337
- ), i = t == null ? void 0 : t.find((c) => c.idx === n), { setCardPreferences: o } = r((c) => c.actions);
3338
- function l(c) {
3339
- if (!i)
3340
- o({
3321
+ ), o = t == null ? void 0 : t.find((l) => l.idx === n), { setCardPreferences: c } = i((l) => l.actions);
3322
+ function r(l) {
3323
+ if (!o)
3324
+ c({
3341
3325
  ...a,
3342
3326
  datasetOptions: [
3343
3327
  ...t || [],
3344
3328
  {
3345
3329
  idx: n,
3346
- type: c === "area" ? "line" : c,
3347
- fill: c === "area" ? "origin" : ""
3330
+ type: l === "area" ? "line" : l,
3331
+ fill: l === "area" ? "origin" : ""
3348
3332
  }
3349
3333
  ]
3350
3334
  });
3351
3335
  else {
3352
- const h = { ...i };
3353
- h.type = c === "area" ? "line" : c, h.fill = c === "area" ? "origin" : "";
3354
- const g = t == null ? void 0 : t.map(
3355
- (m) => m.idx === n ? h : m
3336
+ const d = { ...o };
3337
+ d.type = l === "area" ? "line" : l, d.fill = l === "area" ? "origin" : "";
3338
+ const f = t == null ? void 0 : t.map(
3339
+ (m) => m.idx === n ? d : m
3356
3340
  );
3357
- o({
3341
+ c({
3358
3342
  ...a,
3359
- datasetOptions: g
3343
+ datasetOptions: f
3360
3344
  });
3361
3345
  }
3362
3346
  }
@@ -3364,28 +3348,28 @@ function Gn({ col: s, idx: n }) {
3364
3348
  /* @__PURE__ */ e.jsx("p", { children: s }),
3365
3349
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3366
3350
  /* @__PURE__ */ e.jsx(
3367
- ks,
3351
+ ws,
3368
3352
  {
3369
- onClick: () => l("bar"),
3353
+ onClick: () => r("bar"),
3370
3354
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3371
3355
  }
3372
3356
  ),
3373
3357
  /* @__PURE__ */ e.jsx(
3374
- ws,
3358
+ zs,
3375
3359
  {
3376
- onClick: () => l("line"),
3360
+ onClick: () => r("line"),
3377
3361
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3378
3362
  }
3379
3363
  ),
3380
3364
  /* @__PURE__ */ e.jsx(
3381
3365
  Jt,
3382
3366
  {
3383
- onClick: () => l("area"),
3367
+ onClick: () => r("area"),
3384
3368
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3385
3369
  }
3386
3370
  ),
3387
3371
  /* @__PURE__ */ e.jsx(
3388
- Cs,
3372
+ Ss,
3389
3373
  {
3390
3374
  orientation: "vertical",
3391
3375
  className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
@@ -3399,8 +3383,8 @@ function Jn({
3399
3383
  cardType: s
3400
3384
  }) {
3401
3385
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3402
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3403
- /* @__PURE__ */ e.jsx(R, { children: `${Ss(s)} Chart` }),
3386
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3387
+ /* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
3404
3388
  /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
3405
3389
  /* @__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" }),
3406
3390
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
@@ -3424,54 +3408,54 @@ function Jn({
3424
3408
  ] })
3425
3409
  ] })
3426
3410
  ] }),
3427
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3411
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3428
3412
  /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3429
3413
  /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
3430
- /* @__PURE__ */ e.jsx(zs, {}),
3414
+ /* @__PURE__ */ e.jsx(Fs, {}),
3431
3415
  /* @__PURE__ */ e.jsx(za, {})
3432
3416
  ] })
3433
3417
  ] }),
3434
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3418
+ /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3435
3419
  /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3436
3420
  /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3437
3421
  ] })
3438
3422
  ] }) });
3439
3423
  }
3440
- function Fs() {
3441
- var i, o, l;
3442
- const s = r(
3443
- (c) => c.card.cfg
3444
- ), n = r((c) => c.actions.setCardCfg), a = r((c) => c.card.type);
3445
- function t(c) {
3424
+ function Os() {
3425
+ var o, c, r;
3426
+ const s = i(
3427
+ (l) => l.card.cfg
3428
+ ), n = i((l) => l.actions.setCardCfg), a = i((l) => l.card.type);
3429
+ function t(l) {
3446
3430
  var m;
3447
- const h = {
3431
+ const d = {
3448
3432
  datalabels: {
3449
- display: c !== "none",
3450
- align: c,
3451
- anchor: c,
3433
+ display: l !== "none",
3434
+ align: l,
3435
+ anchor: l,
3452
3436
  clamp: !0
3453
3437
  }
3454
- }, g = {
3438
+ }, f = {
3455
3439
  ...s,
3456
3440
  options: {
3457
3441
  ...s == null ? void 0 : s.options,
3458
3442
  plugins: {
3459
3443
  ...(m = s == null ? void 0 : s.options) == null ? void 0 : m.plugins,
3460
- ...h
3444
+ ...d
3461
3445
  }
3462
3446
  }
3463
3447
  };
3464
- n(g), console.log(c);
3448
+ n(f), console.log(l);
3465
3449
  }
3466
3450
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3467
3451
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
3468
3452
  /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
3469
- !["pyramid", "range"].includes(a) && /* @__PURE__ */ e.jsx(wa, {})
3453
+ !["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(wa, {})
3470
3454
  ] }),
3471
3455
  /* @__PURE__ */ e.jsxs(
3472
3456
  Oe,
3473
3457
  {
3474
- value: (l = (o = (i = s == null ? void 0 : s.options) == null ? void 0 : i.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : l.anchor,
3458
+ value: (r = (c = (o = s == null ? void 0 : s.options) == null ? void 0 : o.plugins) == null ? void 0 : c.datalabels) == null ? void 0 : r.anchor,
3475
3459
  onValueChange: t,
3476
3460
  defaultValue: "none",
3477
3461
  children: [
@@ -3492,9 +3476,9 @@ function Qn({
3492
3476
  cardType: s
3493
3477
  }) {
3494
3478
  function n(a) {
3495
- const t = "SELECT label, [group], x-axis, y-axis, radius FROM table", i = "SELECT label, [group], x-axis, y-axis FROM table";
3479
+ const t = "SELECT label, [group], x-axis, y-axis, radius FROM table", o = "SELECT label, [group], x-axis, y-axis FROM table";
3496
3480
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3497
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: a === "bubble" ? t : i }),
3481
+ /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: a === "bubble" ? t : o }),
3498
3482
  /* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
3499
3483
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
3500
3484
  /* @__PURE__ */ e.jsx("li", { children: "group - category" }),
@@ -3508,7 +3492,7 @@ function Qn({
3508
3492
  "a",
3509
3493
  {
3510
3494
  target: "_blank",
3511
- onClick: (o) => o.stopPropagation(),
3495
+ onClick: (c) => c.stopPropagation(),
3512
3496
  className: "text-blue-700",
3513
3497
  href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
3514
3498
  children: "example"
@@ -3519,15 +3503,15 @@ function Qn({
3519
3503
  ] });
3520
3504
  }
3521
3505
  return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3522
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3523
- /* @__PURE__ */ e.jsx(R, { children: `${Ss(s)} Chart` }),
3506
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3507
+ /* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
3524
3508
  /* @__PURE__ */ e.jsx(_, { className: " space-y-4 font-mono text-xs ", children: n(s) })
3525
3509
  ] }),
3526
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3510
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3527
3511
  /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3528
- /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Fs, {}) })
3512
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Os, {}) })
3529
3513
  ] }),
3530
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3514
+ /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3531
3515
  /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3532
3516
  /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3533
3517
  ] })
@@ -3557,7 +3541,7 @@ const Wn = {
3557
3541
  ]
3558
3542
  };
3559
3543
  function Xn() {
3560
- const s = r((n) => n.card.type);
3544
+ const s = i((n) => n.card.type);
3561
3545
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
3562
3546
  /* @__PURE__ */ e.jsx(
3563
3547
  Se,
@@ -3568,15 +3552,15 @@ function Xn() {
3568
3552
  children: Zn(s)
3569
3553
  }
3570
3554
  ),
3571
- /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(zs, {}) }),
3572
- /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Fs, {}) }),
3555
+ /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(Fs, {}) }),
3556
+ /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Os, {}) }),
3573
3557
  /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(De, {}) })
3574
3558
  ] });
3575
3559
  }
3576
3560
  function Zn(s) {
3577
3561
  if (["line", "bar"].includes(s))
3578
3562
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3579
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3563
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3580
3564
  /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
3581
3565
  /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3582
3566
  /* @__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" }),
@@ -3586,7 +3570,7 @@ function Zn(s) {
3586
3570
  ] })
3587
3571
  ] })
3588
3572
  ] }),
3589
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3573
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3590
3574
  /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Mixed Chart" }),
3591
3575
  /* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
3592
3576
  /* @__PURE__ */ e.jsxs("p", { children: [
@@ -3597,7 +3581,7 @@ function Zn(s) {
3597
3581
  /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Wn, null, 2) })
3598
3582
  ] })
3599
3583
  ] }),
3600
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3584
+ /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3601
3585
  /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Area Chart" }),
3602
3586
  /* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
3603
3587
  /* @__PURE__ */ e.jsxs("p", { children: [
@@ -3620,7 +3604,7 @@ function Zn(s) {
3620
3604
  ] })
3621
3605
  ] });
3622
3606
  if (s === "bubble")
3623
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3607
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3624
3608
  /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3625
3609
  "How to create a ",
3626
3610
  /* @__PURE__ */ e.jsx("span", { children: s }),
@@ -3638,7 +3622,7 @@ function Zn(s) {
3638
3622
  ] })
3639
3623
  ] }) });
3640
3624
  if (s === "scatter")
3641
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3625
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3642
3626
  /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3643
3627
  "How to create a ",
3644
3628
  /* @__PURE__ */ e.jsx("span", { children: s }),
@@ -3655,7 +3639,7 @@ function Zn(s) {
3655
3639
  ] })
3656
3640
  ] }) });
3657
3641
  if (["pie", "doughnut", "polarArea"].includes(s))
3658
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3642
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3659
3643
  /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3660
3644
  /* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
3661
3645
  " ",
@@ -3670,53 +3654,53 @@ function Zn(s) {
3670
3654
  ] })
3671
3655
  ] }) });
3672
3656
  }
3673
- function el() {
3674
- var h, g, m, u, N;
3675
- const s = r((d) => d.card.preferences), n = r(
3676
- (d) => d.actions.setCardPreferences
3677
- ), a = r(
3678
- (d) => d.actions.setNumberFormat
3657
+ function er() {
3658
+ var d, f, m, u, S;
3659
+ const s = i((h) => h.card.preferences), n = i(
3660
+ (h) => h.actions.setCardPreferences
3661
+ ), a = i(
3662
+ (h) => h.actions.setNumberFormat
3679
3663
  );
3680
- r(
3681
- (d) => {
3682
- var x, f;
3683
- return (f = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : f.decimalPlaces;
3664
+ i(
3665
+ (h) => {
3666
+ var x, g;
3667
+ return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.decimalPlaces;
3684
3668
  }
3685
3669
  );
3686
- const t = r(
3687
- (d) => {
3688
- var x, f;
3689
- return (f = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : f.locale;
3670
+ const t = i(
3671
+ (h) => {
3672
+ var x, g;
3673
+ return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.locale;
3690
3674
  }
3691
- ), i = r(
3692
- (d) => {
3693
- var x, f;
3694
- return (f = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : f.currency;
3675
+ ), o = i(
3676
+ (h) => {
3677
+ var x, g;
3678
+ return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.currency;
3695
3679
  }
3696
3680
  );
3697
- r(
3698
- (d) => d.actions.setFilterOnClickField
3681
+ i(
3682
+ (h) => h.actions.setFilterOnClickField
3699
3683
  );
3700
- const o = r(
3701
- (d) => {
3702
- var x, f;
3703
- return (f = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : f.colorRanges;
3684
+ const c = i(
3685
+ (h) => {
3686
+ var x, g;
3687
+ return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.colorRanges;
3704
3688
  }
3705
- ) || [], l = r(
3706
- (d) => d.actions.setColorRanges
3707
- ), c = [...new Set(Rs.map((d) => d.currency))];
3689
+ ) || [], r = i(
3690
+ (h) => h.actions.setColorRanges
3691
+ ), l = [...new Set(Rs.map((h) => h.currency))];
3708
3692
  return /* @__PURE__ */ e.jsxs("div", { children: [
3709
3693
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
3710
3694
  /* @__PURE__ */ e.jsx(
3711
- Ke,
3695
+ Pe,
3712
3696
  {
3713
- checked: !!((h = s == null ? void 0 : s.formatNumber) != null && h.enabled),
3714
- onCheckedChange: (d) => {
3697
+ checked: !!((d = s == null ? void 0 : s.formatNumber) != null && d.enabled),
3698
+ onCheckedChange: (h) => {
3715
3699
  n({
3716
3700
  ...s,
3717
3701
  formatNumber: {
3718
3702
  ...s == null ? void 0 : s.formatNumber,
3719
- enabled: d
3703
+ enabled: h
3720
3704
  }
3721
3705
  });
3722
3706
  }
@@ -3724,7 +3708,7 @@ function el() {
3724
3708
  ),
3725
3709
  /* @__PURE__ */ e.jsx(B, { children: "Format Number" })
3726
3710
  ] }),
3727
- ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
3711
+ ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
3728
3712
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-2", children: [
3729
3713
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
3730
3714
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
@@ -3733,20 +3717,20 @@ function el() {
3733
3717
  Oe,
3734
3718
  {
3735
3719
  value: t || "en-US",
3736
- onValueChange: (d) => {
3737
- var x, f, w;
3720
+ onValueChange: (h) => {
3721
+ var x, g, z;
3738
3722
  return a(
3739
3723
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
3740
- ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.currency) || "",
3741
- d || "en-US",
3742
- ((w = s == null ? void 0 : s.formatNumber) == null ? void 0 : w.suffix) || ""
3724
+ ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.currency) || "",
3725
+ h || "en-US",
3726
+ ((z = s == null ? void 0 : s.formatNumber) == null ? void 0 : z.suffix) || ""
3743
3727
  );
3744
3728
  },
3745
3729
  children: [
3746
3730
  /* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3747
3731
  /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3748
3732
  /* @__PURE__ */ e.jsx(Le, { children: "Format" }),
3749
- Rs.map((d) => /* @__PURE__ */ e.jsx(X, { value: d.locale, children: d.locale }, d.locale))
3733
+ Rs.map((h) => /* @__PURE__ */ e.jsx(X, { value: h.locale, children: h.locale }, h.locale))
3750
3734
  ] }) })
3751
3735
  ]
3752
3736
  }
@@ -3757,14 +3741,14 @@ function el() {
3757
3741
  /* @__PURE__ */ e.jsxs(
3758
3742
  Oe,
3759
3743
  {
3760
- value: i || "none",
3761
- onValueChange: (d) => {
3762
- var x, f, w;
3744
+ value: o || "none",
3745
+ onValueChange: (h) => {
3746
+ var x, g, z;
3763
3747
  return a(
3764
3748
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
3765
- d === "none" ? "" : d,
3766
- ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.locale) || "",
3767
- ((w = s == null ? void 0 : s.formatNumber) == null ? void 0 : w.suffix) || ""
3749
+ h === "none" ? "" : h,
3750
+ ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.locale) || "",
3751
+ ((z = s == null ? void 0 : s.formatNumber) == null ? void 0 : z.suffix) || ""
3768
3752
  );
3769
3753
  },
3770
3754
  children: [
@@ -3772,7 +3756,7 @@ function el() {
3772
3756
  /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3773
3757
  /* @__PURE__ */ e.jsx(Le, { children: "Currency" }),
3774
3758
  /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
3775
- c.map((d) => /* @__PURE__ */ e.jsx(X, { value: d, children: d }, d))
3759
+ l.map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h))
3776
3760
  ] }) })
3777
3761
  ]
3778
3762
  }
@@ -3786,18 +3770,18 @@ function el() {
3786
3770
  Oe,
3787
3771
  {
3788
3772
  value: ((u = (m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.decimalPlaces) == null ? void 0 : u.toString()) || "0",
3789
- onValueChange: (d) => {
3790
- var x, f, w;
3773
+ onValueChange: (h) => {
3774
+ var x, g, z;
3791
3775
  return a(
3792
- Number(d),
3776
+ Number(h),
3793
3777
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.currency) || "",
3794
- ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.locale) || "",
3795
- ((w = s == null ? void 0 : s.formatNumber) == null ? void 0 : w.suffix) || ""
3778
+ ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.locale) || "",
3779
+ ((z = s == null ? void 0 : s.formatNumber) == null ? void 0 : z.suffix) || ""
3796
3780
  );
3797
3781
  },
3798
3782
  children: [
3799
3783
  /* @__PURE__ */ e.jsx(Me, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3800
- /* @__PURE__ */ e.jsx(Ae, { children: ["0", "1", "2", "3", "4"].map((d) => /* @__PURE__ */ e.jsx(X, { value: d, children: d }, d)) })
3784
+ /* @__PURE__ */ e.jsx(Ae, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h)) })
3801
3785
  ]
3802
3786
  }
3803
3787
  )
@@ -3807,16 +3791,16 @@ function el() {
3807
3791
  /* @__PURE__ */ e.jsx(
3808
3792
  ae,
3809
3793
  {
3810
- value: ((N = s == null ? void 0 : s.formatNumber) == null ? void 0 : N.suffix) || "",
3794
+ value: ((S = s == null ? void 0 : s.formatNumber) == null ? void 0 : S.suffix) || "",
3811
3795
  className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3812
3796
  placeholder: "K, M, B, %",
3813
- onChange: (d) => {
3814
- var x, f, w;
3797
+ onChange: (h) => {
3798
+ var x, g, z;
3815
3799
  return a(
3816
3800
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
3817
- ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.currency) || "",
3818
- ((w = s == null ? void 0 : s.formatNumber) == null ? void 0 : w.locale) || "",
3819
- d.target.value
3801
+ ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.currency) || "",
3802
+ ((z = s == null ? void 0 : s.formatNumber) == null ? void 0 : z.locale) || "",
3803
+ h.target.value
3820
3804
  );
3821
3805
  }
3822
3806
  }
@@ -3824,20 +3808,20 @@ function el() {
3824
3808
  ] })
3825
3809
  ] })
3826
3810
  ] }) }),
3827
- /* @__PURE__ */ e.jsx(Cs, { className: "my-3" }),
3811
+ /* @__PURE__ */ e.jsx(Ss, { className: "my-3" }),
3828
3812
  /* @__PURE__ */ e.jsx(
3829
3813
  It,
3830
3814
  {
3831
- colorRanges: o,
3832
- setColorRanges: l
3815
+ colorRanges: c,
3816
+ setColorRanges: r
3833
3817
  }
3834
3818
  )
3835
3819
  ] })
3836
3820
  ] });
3837
3821
  }
3838
- function sl() {
3822
+ function sr() {
3839
3823
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
3840
- /* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3824
+ /* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3841
3825
  /* @__PURE__ */ e.jsx(R, { className: "", children: "KPI Query" }),
3842
3826
  /* @__PURE__ */ e.jsxs(_, { className: "font-mono", children: [
3843
3827
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
@@ -3861,7 +3845,7 @@ function sl() {
3861
3845
  ] })
3862
3846
  ] })
3863
3847
  ] }) }),
3864
- /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(el, {}) }),
3848
+ /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(er, {}) }),
3865
3849
  /* @__PURE__ */ e.jsx("div", {}),
3866
3850
  /* @__PURE__ */ e.jsx("div", {})
3867
3851
  ] });
@@ -3871,8 +3855,8 @@ function os({
3871
3855
  docContent: n
3872
3856
  }) {
3873
3857
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3874
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3875
- /* @__PURE__ */ e.jsx(R, { children: `${Ss(s)} Chart` }),
3858
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3859
+ /* @__PURE__ */ e.jsx(R, { children: `${ks(s)} Chart` }),
3876
3860
  /* @__PURE__ */ e.jsx(_, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3877
3861
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
3878
3862
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
@@ -3895,19 +3879,19 @@ function os({
3895
3879
  ] })
3896
3880
  ] }) })
3897
3881
  ] }),
3898
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3882
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3899
3883
  /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3900
- /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Fs, {}) })
3884
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Os, {}) })
3901
3885
  ] }),
3902
- s !== "range" && /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3886
+ s !== "range" && /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3903
3887
  /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3904
3888
  /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3905
3889
  ] })
3906
3890
  ] }) });
3907
3891
  }
3908
- function al() {
3892
+ function ar() {
3909
3893
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3910
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3894
+ /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3911
3895
  /* @__PURE__ */ e.jsx(R, { children: "Stacked Chart" }),
3912
3896
  /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
3913
3897
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
@@ -3932,24 +3916,24 @@ function al() {
3932
3916
  ] })
3933
3917
  ] })
3934
3918
  ] }),
3935
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3919
+ /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3936
3920
  /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3937
3921
  /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
3938
- /* @__PURE__ */ e.jsx(zs, {}),
3922
+ /* @__PURE__ */ e.jsx(Fs, {}),
3939
3923
  /* @__PURE__ */ e.jsx(za, {})
3940
3924
  ] })
3941
3925
  ] }),
3942
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3926
+ /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3943
3927
  /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3944
3928
  /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3945
3929
  ] })
3946
3930
  ] }) });
3947
3931
  }
3948
- function tl({}) {
3949
- const s = r((t) => {
3950
- var i;
3951
- return (i = t.card) == null ? void 0 : i.preferences;
3952
- }), n = r(
3932
+ function tr({}) {
3933
+ const s = i((t) => {
3934
+ var o;
3935
+ return (o = t.card) == null ? void 0 : o.preferences;
3936
+ }), n = i(
3953
3937
  (t) => t.actions.setCardPreferences
3954
3938
  ), a = (t) => {
3955
3939
  n({
@@ -3958,12 +3942,12 @@ function tl({}) {
3958
3942
  });
3959
3943
  };
3960
3944
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
3961
- /* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3945
+ /* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3962
3946
  /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3963
3947
  /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3964
3948
  ] }) }),
3965
3949
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3966
- /* @__PURE__ */ e.jsx(Ke, { onCheckedChange: a, id: "allow-download" }),
3950
+ /* @__PURE__ */ e.jsx(Pe, { onCheckedChange: a, id: "allow-download" }),
3967
3951
  /* @__PURE__ */ e.jsx(
3968
3952
  "label",
3969
3953
  {
@@ -3975,7 +3959,7 @@ function tl({}) {
3975
3959
  ] })
3976
3960
  ] });
3977
3961
  }
3978
- const nl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3962
+ const nr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3979
3963
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
3980
3964
  /* @__PURE__ */ e.jsxs("div", { children: [
3981
3965
  "See ",
@@ -3991,7 +3975,7 @@ const nl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
3991
3975
  ),
3992
3976
  " in the docs."
3993
3977
  ] })
3994
- ] }), ll = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3978
+ ] }), rr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3995
3979
  /* @__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" }),
3996
3980
  /* @__PURE__ */ e.jsxs("div", { children: [
3997
3981
  "See ",
@@ -4008,21 +3992,21 @@ const nl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
4008
3992
  " in the docs."
4009
3993
  ] })
4010
3994
  ] });
4011
- function rl() {
4012
- const s = r((a) => a.card.type);
3995
+ function lr() {
3996
+ const s = i((a) => a.card.type);
4013
3997
  function n(a) {
4014
3998
  switch (a) {
4015
3999
  case "stackedBar":
4016
- return /* @__PURE__ */ e.jsx(al, {});
4000
+ return /* @__PURE__ */ e.jsx(ar, {});
4017
4001
  case "pyramid":
4018
- return /* @__PURE__ */ e.jsx(os, { docContent: nl, cardType: a });
4002
+ return /* @__PURE__ */ e.jsx(os, { docContent: nr, cardType: a });
4019
4003
  case "kpi":
4020
- return /* @__PURE__ */ e.jsx(sl, {});
4004
+ return /* @__PURE__ */ e.jsx(sr, {});
4021
4005
  case "line":
4022
4006
  case "bar":
4023
4007
  return /* @__PURE__ */ e.jsx(Jn, { cardType: a });
4024
4008
  case "range":
4025
- return /* @__PURE__ */ e.jsx(os, { docContent: ll, cardType: a });
4009
+ return /* @__PURE__ */ e.jsx(os, { docContent: rr, cardType: a });
4026
4010
  case "pie":
4027
4011
  case "doughnut":
4028
4012
  case "polarArea":
@@ -4032,17 +4016,17 @@ function rl() {
4032
4016
  case "scatter":
4033
4017
  return /* @__PURE__ */ e.jsx(Qn, { cardType: a });
4034
4018
  case "table":
4035
- return /* @__PURE__ */ e.jsx(tl, { cardType: a });
4019
+ return /* @__PURE__ */ e.jsx(tr, { cardType: a });
4036
4020
  default:
4037
4021
  return /* @__PURE__ */ e.jsx(Xn, {});
4038
4022
  }
4039
4023
  }
4040
- return /* @__PURE__ */ e.jsx(Ns, { className: "h-full w-full text-sm", children: n(s) });
4024
+ return /* @__PURE__ */ e.jsx(Cs, { className: "h-full w-full text-sm", children: n(s) });
4041
4025
  }
4042
- function il() {
4043
- const s = r((n) => n.isShowingVisual);
4026
+ function ir() {
4027
+ const s = i((n) => n.isShowingVisual);
4044
4028
  return /* @__PURE__ */ e.jsxs(
4045
- hs,
4029
+ ms,
4046
4030
  {
4047
4031
  direction: "vertical",
4048
4032
  className: "min-w-full max-w-lg min-h-[250px]",
@@ -4054,10 +4038,10 @@ function il() {
4054
4038
  className: "flex",
4055
4039
  minSize: 20,
4056
4040
  defaultSize: 40,
4057
- children: /* @__PURE__ */ e.jsx(qn, {})
4041
+ children: /* @__PURE__ */ e.jsx(Vn, {})
4058
4042
  }
4059
4043
  ),
4060
- /* @__PURE__ */ e.jsx(ms, { withHandle: !0, className: "border " }),
4044
+ /* @__PURE__ */ e.jsx(us, { withHandle: !0, className: "border " }),
4061
4045
  /* @__PURE__ */ e.jsx(
4062
4046
  Fe,
4063
4047
  {
@@ -4065,7 +4049,7 @@ function il() {
4065
4049
  role: "visual-section",
4066
4050
  minSize: 0,
4067
4051
  defaultSize: 60,
4068
- children: s ? /* @__PURE__ */ e.jsxs(hs, { direction: "horizontal", children: [
4052
+ children: s ? /* @__PURE__ */ e.jsxs(ms, { direction: "horizontal", children: [
4069
4053
  /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
4070
4054
  Fe,
4071
4055
  {
@@ -4073,10 +4057,10 @@ function il() {
4073
4057
  minSize: 20,
4074
4058
  defaultSize: 25,
4075
4059
  maxSize: 30,
4076
- children: /* @__PURE__ */ e.jsx(rl, {})
4060
+ children: /* @__PURE__ */ e.jsx(lr, {})
4077
4061
  }
4078
4062
  ) }),
4079
- /* @__PURE__ */ e.jsx(ms, { className: "border " }),
4063
+ /* @__PURE__ */ e.jsx(us, { className: "border " }),
4080
4064
  /* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx($s, {}) })
4081
4065
  ] }) : /* @__PURE__ */ e.jsx($s, {})
4082
4066
  }
@@ -4085,64 +4069,64 @@ function il() {
4085
4069
  }
4086
4070
  );
4087
4071
  }
4088
- function ol({ authToken: s, onSave: n, onClose: a }) {
4089
- const t = r((l) => l.actions.setOnSave), i = r((l) => l.actions.setOnClose), o = k((l) => l.actions.setAuthToken);
4090
- return K(() => {
4091
- n && t(n), a && i(a);
4092
- }, [n, t, a, i]), K(() => {
4093
- s && s.accessToken && o(s);
4094
- }, [s, o]), /* @__PURE__ */ e.jsxs(Vt, { className: "rounded-none", role: "editor-panel", children: [
4095
- /* @__PURE__ */ e.jsx(qt, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(pa, {}) }),
4096
- /* @__PURE__ */ e.jsx(Rt, { children: /* @__PURE__ */ e.jsx(il, {}) })
4072
+ function or({ authToken: s, onSave: n, onClose: a }) {
4073
+ const t = i((r) => r.actions.setOnSave), o = i((r) => r.actions.setOnClose), c = k((r) => r.actions.setAuthToken);
4074
+ return P(() => {
4075
+ n && t(n), a && o(a);
4076
+ }, [n, t, a, o]), P(() => {
4077
+ s && s.accessToken && c(s);
4078
+ }, [s, c]), /* @__PURE__ */ e.jsxs(qt, { className: "rounded-none", role: "editor-panel", children: [
4079
+ /* @__PURE__ */ e.jsx(Vt, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(pa, {}) }),
4080
+ /* @__PURE__ */ e.jsx(Rt, { children: /* @__PURE__ */ e.jsx(ir, {}) })
4097
4081
  ] });
4098
4082
  }
4099
- function cl() {
4100
- k((l) => l.selectedCardId);
4101
- const s = k((l) => l.selectedSheetId), { setIsVisualEditing: n } = k((l) => l.actions), a = k((l) => l.isVisualEditing), t = k((l) => l.actions.updateFrame);
4102
- function i(l) {
4103
- s && (t(s, l), n(!1));
4083
+ function cr() {
4084
+ k((r) => r.selectedCardId);
4085
+ const s = k((r) => r.selectedSheetId), { setIsVisualEditing: n } = k((r) => r.actions), a = k((r) => r.isVisualEditing), t = k((r) => r.actions.updateFrame);
4086
+ function o(r) {
4087
+ s && (t(s, r), n(!1));
4104
4088
  }
4105
- function o() {
4089
+ function c() {
4106
4090
  n(!1);
4107
4091
  }
4108
4092
  return /* @__PURE__ */ e.jsx(
4109
4093
  "div",
4110
4094
  {
4111
4095
  role: "editor-container",
4112
- className: W("flex grow", {
4096
+ className: Y("flex grow", {
4113
4097
  block: a,
4114
4098
  hidden: !a
4115
4099
  }),
4116
- children: /* @__PURE__ */ e.jsx(ol, { onSave: i, onClose: o })
4100
+ children: /* @__PURE__ */ e.jsx(or, { onSave: o, onClose: c })
4117
4101
  }
4118
4102
  );
4119
4103
  }
4120
- function dl({
4104
+ function dr({
4121
4105
  columns: s,
4122
4106
  tableName: n
4123
4107
  }) {
4124
- const a = r((u) => u.selectedConnectionId), t = r((u) => u.selectedDatabaseName), i = r((u) => u.selectedSchemaName), o = r((u) => u.selectedTableName), l = k((u) => u.dashboard.filters) || [], c = k((u) => u.actions.addFilter), h = k((u) => u.actions.removeFilter), g = k(
4108
+ const a = i((u) => u.selectedConnectionId), t = i((u) => u.selectedDatabaseName), o = i((u) => u.selectedSchemaName), c = i((u) => u.selectedTableName), r = k((u) => u.dashboard.filters) || [], l = k((u) => u.actions.addFilter), d = k((u) => u.actions.removeFilter), f = k(
4125
4109
  (u) => u.actions.removeFilterValue
4126
4110
  );
4127
4111
  function m(u) {
4128
- const N = he(u.column_name), d = he(t || ""), x = he(i || ""), f = he(n), w = cs(
4112
+ const S = he(u.column_name), h = he(t || ""), x = he(o || ""), g = he(n), z = ds(
4129
4113
  x,
4130
- f
4131
- ), b = `${w}.${N}`;
4114
+ g
4115
+ ), b = `${z}.${S}`;
4132
4116
  console.log(
4133
4117
  "find",
4134
4118
  b,
4135
- f,
4136
- d
4119
+ g,
4120
+ h
4137
4121
  );
4138
- const L = l == null ? void 0 : l.find(
4139
- (C) => C.column === b && C.table === f && (C.database === d || C.database === t)
4122
+ const L = r == null ? void 0 : r.find(
4123
+ (N) => N.column === b && N.table === g && (N.database === h || N.database === t)
4140
4124
  );
4141
4125
  if (L)
4142
- g(L.id), h(L.id);
4126
+ f(L.id), d(L.id);
4143
4127
  else {
4144
4128
  if (n === "api" && a) {
4145
- c({
4129
+ l({
4146
4130
  id: We(),
4147
4131
  column: b,
4148
4132
  title: u.column_name,
@@ -4154,43 +4138,43 @@ function dl({
4154
4138
  operation: "in",
4155
4139
  sql: _s(
4156
4140
  u.data_type,
4157
- w,
4158
- N
4141
+ z,
4142
+ S
4159
4143
  )
4160
4144
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4161
4145
  });
4162
4146
  return;
4163
4147
  }
4164
- c({
4148
+ l({
4165
4149
  id: We(),
4166
- column: `${w}.${N}`,
4150
+ column: `${z}.${S}`,
4167
4151
  title: u.column_name,
4168
4152
  dataType: u.data_type,
4169
- table: o || "",
4153
+ table: c || "",
4170
4154
  database: t || "",
4171
4155
  connectionId: a || "",
4172
4156
  operation: "in",
4173
4157
  sql: _s(
4174
4158
  u.data_type,
4175
- w,
4176
- N
4159
+ z,
4160
+ S
4177
4161
  )
4178
4162
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4179
4163
  });
4180
4164
  }
4181
4165
  }
4182
4166
  return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: s == null ? void 0 : s.map((u) => {
4183
- const N = l == null ? void 0 : l.find(
4184
- (d) => d.column === he(u.column_name) && d.table === o && d.database === t
4167
+ const S = r == null ? void 0 : r.find(
4168
+ (h) => h.column === he(u.column_name) && h.table === c && h.database === t
4185
4169
  );
4186
4170
  return /* @__PURE__ */ e.jsx(
4187
4171
  "div",
4188
4172
  {
4189
4173
  onClick: () => m(u),
4190
- className: W(
4174
+ className: Y(
4191
4175
  "group flex cursor-pointer items-center justify-between border border-dashed border-background px-3 py-[6px] text-sm transition-colors hover:bg-muted/50",
4192
4176
  {
4193
- "bg-muted": N
4177
+ "bg-muted": S
4194
4178
  }
4195
4179
  ),
4196
4180
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
@@ -4202,7 +4186,7 @@ function dl({
4202
4186
  );
4203
4187
  }) });
4204
4188
  }
4205
- function hl() {
4189
+ function hr() {
4206
4190
  k((n) => n.showFilters);
4207
4191
  const s = k(
4208
4192
  (n) => n.actions.setShowFilters
@@ -4211,7 +4195,7 @@ function hl() {
4211
4195
  /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
4212
4196
  /* @__PURE__ */ e.jsx(B, { className: "text-lg", children: "Filters" }),
4213
4197
  /* @__PURE__ */ e.jsx(
4214
- z,
4198
+ w,
4215
4199
  {
4216
4200
  onClick: () => s(!1),
4217
4201
  className: "h-7 w-7 p-0",
@@ -4224,7 +4208,7 @@ function hl() {
4224
4208
  pa,
4225
4209
  {
4226
4210
  ColumnsComponent: (n, a, t) => /* @__PURE__ */ e.jsx(
4227
- dl,
4211
+ dr,
4228
4212
  {
4229
4213
  schemaName: n,
4230
4214
  tableName: a,
@@ -4235,25 +4219,25 @@ function hl() {
4235
4219
  ) })
4236
4220
  ] });
4237
4221
  }
4238
- function ml() {
4222
+ function mr() {
4239
4223
  k((a) => a.dashboard);
4240
4224
  const s = k((a) => a.showFilters), n = k((a) => a.isVisualEditing);
4241
4225
  return k((a) => a.bookmarkKey), /* @__PURE__ */ e.jsxs(
4242
4226
  "div",
4243
4227
  {
4244
4228
  role: "dashboard-plus-main",
4245
- className: W("grow", {
4229
+ className: Y("grow", {
4246
4230
  hidden: n,
4247
4231
  flex: !n
4248
4232
  }),
4249
4233
  children: [
4250
4234
  /* @__PURE__ */ e.jsx(_t, {}),
4251
- s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(hl, {}) })
4235
+ s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(hr, {}) })
4252
4236
  ]
4253
4237
  }
4254
4238
  );
4255
4239
  }
4256
- function ul() {
4240
+ function ur() {
4257
4241
  const s = k((t) => t.dashboard), n = k((t) => t.actions.setDashboard), a = k(
4258
4242
  (t) => t.showDashboardJSON
4259
4243
  );
@@ -4262,7 +4246,7 @@ function ul() {
4262
4246
  ), /* @__PURE__ */ e.jsx(
4263
4247
  "div",
4264
4248
  {
4265
- className: W(" p-2", {
4249
+ className: Y(" p-2", {
4266
4250
  hidden: !a
4267
4251
  }),
4268
4252
  children: /* @__PURE__ */ e.jsx(
@@ -4297,25 +4281,25 @@ function ul() {
4297
4281
  }
4298
4282
  );
4299
4283
  }
4300
- function fl({
4284
+ function fr({
4301
4285
  showControls: s = !1,
4302
4286
  showFooter: n = !0,
4303
4287
  ...a
4304
4288
  }) {
4305
4289
  return /* @__PURE__ */ e.jsxs(Bt, { dashboardProps: a, children: [
4306
4290
  /* @__PURE__ */ e.jsx($t, {}),
4307
- /* @__PURE__ */ e.jsxs(Kt, { children: [
4308
- /* @__PURE__ */ e.jsx(ul, {}),
4309
- /* @__PURE__ */ e.jsxs(Pt, { ...a, children: [
4291
+ /* @__PURE__ */ e.jsxs(Pt, { children: [
4292
+ /* @__PURE__ */ e.jsx(ur, {}),
4293
+ /* @__PURE__ */ e.jsxs(Kt, { ...a, children: [
4310
4294
  s && /* @__PURE__ */ e.jsx(vn, {}),
4311
- /* @__PURE__ */ e.jsx(cl, {}),
4312
- /* @__PURE__ */ e.jsx(ml, {})
4295
+ /* @__PURE__ */ e.jsx(cr, {}),
4296
+ /* @__PURE__ */ e.jsx(mr, {})
4313
4297
  ] })
4314
4298
  ] })
4315
4299
  ] });
4316
4300
  }
4317
4301
  export {
4318
- fl as D,
4302
+ fr as D,
4319
4303
  Qe as S,
4320
4304
  xa as u
4321
4305
  };