react-semaphor 0.0.314 → 0.0.316

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,4 +1,4 @@
1
- import { c as V, p as Os, u as z, n as zs, o as Ie, q as e, r as Fs, s as Is, t as O, j as Ts, v as Ms, w as Ds, x as Ls, y as Es, L as R, z as le, A as la, E as ra, H as ia, J as oa, K as st, M as at, N as tt, O as Js, Q as W, R as Ge, V as m, W as nt, F as ca, Y as Qe, Z as Je, _ as da, $ as lt, a0 as ua, a1 as he, a2 as xe, a3 as pe, a4 as fe, a5 as Se, a6 as ge, a7 as J, T as As, a8 as Vs, a9 as qs, aa as Rs, ab as ma, ac as ha, ad as ue, ae as rt, af as it, ag as xa, ah as ot, C as ct, ai as dt, aj as pa, B as ut, ak as We, al as mt, am as Ks, an as fa, ao as ys, ap as Ne, aq as ze, ar as oe, as as ga, at as ht, au as xt, av as pt, aw as ft, I as gt, ax as jt, ay as bt, az as yt, aA as Ve, aB as vs, aC as vt, a as Ct, aD as Be, aE as Cs, aF as Ae, aG as Ns, aH as Nt, aI as St, aJ as wt, aK as kt, aL as Ot, aM as zt, aN as bs, aO as Ft, aP as Ws, aQ as It, aR as Ys, aS as Tt, aT as Mt, aU as Dt, aV as Lt, aW as ja, aX as re, aY as _s, aZ as ba, a_ as Et, a$ as At, b0 as ls, b1 as Vt, b2 as qt, b3 as Rt, b4 as _t, b5 as Ht, b6 as $t, b7 as Pt, l as Bt, b8 as us, b9 as ya, ba as va, bb as Ca, bc as rs, bd as Na, be as is, bf as Xs, bg as Ut, bh as Gt, bi as ms, bj as hs, bk as xs, bl as Qt, X as Sa, bm as Jt, bn as Kt, bo as Wt, bp as ps, bq as Fe, f as Yt, br as Pe, bs as Hs, bt as wa, bu as Xt, bv as Zt, bw as os, bx as en, by as sn, bz as an, bA as Zs, bB as tn, bC as nn, bD as ln, bE as rn, bF as on, bG as cn, bH as dn, bI as un, bJ as Te, bK as B, bL as U, bM as $s, bN as G, bO as mn, bP as ka, bQ as hn, bR as xn, bS as pn, bT as fn, bU as gn, bV as jn, bW as bn, bX as yn, bY as vn } from "./index-ferxOK5X.js";
1
+ import { c as V, p as Os, u as z, n as zs, o as Ie, q as e, r as Fs, s as Is, t as O, j as Ts, v as Ds, w as Ms, x as Ls, y as Es, L as R, z as le, A as la, E as ra, H as ia, J as oa, K as st, M as at, N as tt, O as Js, Q as W, R as Ge, V as m, W as nt, F as ca, Y as Qe, Z as Je, _ as da, $ as lt, a0 as ua, a1 as me, a2 as he, a3 as xe, a4 as pe, a5 as Se, a6 as fe, a7 as J, T as As, a8 as Vs, a9 as qs, aa as Rs, ab as ma, ac as ha, ad as de, ae as rt, af as it, ag as xa, ah as ot, C as ct, ai as dt, aj as pa, B as ut, ak as We, al as mt, am as Ks, an as fa, ao as ys, ap as Ne, aq as ze, ar as ge, as as ga, at as ht, au as xt, av as pt, aw as ft, I as gt, ax as jt, ay as bt, az as yt, aA as Ve, aB as vs, aC as vt, a as Ct, aD as Be, aE as Cs, aF as Ae, aG as Ns, aH as Nt, aI as St, aJ as wt, aK as kt, aL as Ot, aM as zt, aN as bs, aO as Ft, aP as Ws, aQ as It, aR as Ys, aS as Tt, aT as Dt, aU as Mt, aV as Lt, aW as ja, aX as re, aY as _s, aZ as ba, a_ as Et, a$ as At, b0 as ls, b1 as Vt, b2 as qt, b3 as Rt, b4 as _t, b5 as Ht, b6 as $t, b7 as Pt, l as Bt, b8 as us, b9 as ya, ba as va, bb as Ca, bc as rs, bd as Na, be as is, bf as Xs, bg as Ut, bh as Gt, bi as ms, bj as hs, bk as xs, bl as Qt, X as Sa, bm as Jt, bn as Kt, bo as Wt, bp as ps, bq as Fe, f as Yt, br as Pe, bs as Hs, bt as wa, bu as Xt, bv as Zt, bw as os, bx as en, by as sn, bz as an, bA as Zs, bB as tn, bC as nn, bD as ln, bE as rn, bF as on, bG as cn, bH as dn, bI as un, bJ as Te, bK as B, bL as U, bM as $s, bN as G, bO as mn, bP as ka, bQ as hn, bR as xn, bS as pn, bT as fn, bU as gn, bV as jn, bW as bn, bX as yn, bY as vn } from "./index-Ct1jmduc.js";
2
2
  import * as ea from "react";
3
3
  import we, { useState as q, useMemo as Ss, useEffect as Z, useRef as ws, Suspense as Cn } from "react";
4
4
  import "react-dom";
@@ -208,7 +208,7 @@ const Tn = V("Glasses", [
208
208
  * This source code is licensed under the ISC license.
209
209
  * See the LICENSE file in the root directory of this source tree.
210
210
  */
211
- const Mn = V("Hammer", [
211
+ const Dn = V("Hammer", [
212
212
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
213
213
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
214
214
  [
@@ -225,7 +225,7 @@ const Mn = V("Hammer", [
225
225
  * This source code is licensed under the ISC license.
226
226
  * See the LICENSE file in the root directory of this source tree.
227
227
  */
228
- const Dn = V("Hash", [
228
+ const Mn = V("Hash", [
229
229
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
230
230
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
231
231
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -356,7 +356,7 @@ const _n = V("Network", [
356
356
  * This source code is licensed under the ISC license.
357
357
  * See the LICENSE file in the root directory of this source tree.
358
358
  */
359
- const Ma = V("Pencil", [
359
+ const Da = V("Pencil", [
360
360
  [
361
361
  "path",
362
362
  {
@@ -411,7 +411,7 @@ const Pn = V("Save", [
411
411
  * This source code is licensed under the ISC license.
412
412
  * See the LICENSE file in the root directory of this source tree.
413
413
  */
414
- const Da = V("Shapes", [
414
+ const Ma = V("Shapes", [
415
415
  [
416
416
  "path",
417
417
  {
@@ -629,8 +629,8 @@ function el() {
629
629
  ]
630
630
  }
631
631
  ) }),
632
- /* @__PURE__ */ e.jsxs(Ms, { className: "sm:max-w-[425px]", children: [
633
- /* @__PURE__ */ e.jsxs(Ds, { children: [
632
+ /* @__PURE__ */ e.jsxs(Ds, { className: "sm:max-w-[425px]", children: [
633
+ /* @__PURE__ */ e.jsxs(Ms, { children: [
634
634
  /* @__PURE__ */ e.jsx(Ls, { children: "Create Lens" }),
635
635
  /* @__PURE__ */ e.jsx(Es, { children: "Lenses are private by default and are only visible to you." })
636
636
  ] }),
@@ -769,10 +769,10 @@ function al() {
769
769
  (f) => f.actions.setShowFilters
770
770
  ), { addFrame: j, setSelectedFrameId: b } = z(
771
771
  (f) => f.actions
772
- ), { getSelectedSheet: I, setIsDashboardEditing: C, setShowDashboardJSON: M } = z((f) => f.actions), F = I(), { tenantId: A, endUserId: N } = Ss(
772
+ ), { getSelectedSheet: I, setIsDashboardEditing: C, setShowDashboardJSON: D } = z((f) => f.actions), F = I(), { tenantId: A, endUserId: N } = Ss(
773
773
  () => nt(s == null ? void 0 : s.accessToken),
774
774
  [s == null ? void 0 : s.accessToken]
775
- ), S = Ss(() => A || N, [A, N]), D = () => {
775
+ ), S = Ss(() => A || N, [A, N]), M = () => {
776
776
  if (!o || !F) return;
777
777
  const f = {
778
778
  connectionId: i,
@@ -827,7 +827,7 @@ function al() {
827
827
  className: "h-7 p-2",
828
828
  size: "sm",
829
829
  disabled: !o,
830
- onClick: D,
830
+ onClick: M,
831
831
  children: [
832
832
  /* @__PURE__ */ e.jsx(Ts, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
833
833
  "Frame"
@@ -841,7 +841,7 @@ function al() {
841
841
  className: "h-7 p-2",
842
842
  onClick: h,
843
843
  size: "sm",
844
- children: /* @__PURE__ */ e.jsx(Ma, { className: "h-4 w-4", strokeWidth: 1.5 })
844
+ children: /* @__PURE__ */ e.jsx(Da, { className: "h-4 w-4", strokeWidth: 1.5 })
845
845
  }
846
846
  ),
847
847
  o && !u && /* @__PURE__ */ e.jsx(
@@ -851,7 +851,7 @@ function al() {
851
851
  role: "close",
852
852
  className: "h-7 p-2",
853
853
  onClick: () => {
854
- C(!1), M(!1);
854
+ C(!1), D(!1);
855
855
  },
856
856
  size: "sm",
857
857
  children: /* @__PURE__ */ e.jsx(Ge, { className: "h-4 w-4", strokeWidth: 1.5 })
@@ -916,24 +916,24 @@ function $e({
916
916
  /* @__PURE__ */ e.jsx(lt, { children: g() }),
917
917
  /* @__PURE__ */ e.jsx(ua, { className: "text-xs", align: "start", children: o })
918
918
  ] }) : g() }),
919
- /* @__PURE__ */ e.jsxs(he, { disabled: u, value: y, onValueChange: i, children: [
919
+ /* @__PURE__ */ e.jsxs(me, { disabled: u, value: y, onValueChange: i, children: [
920
920
  /* @__PURE__ */ e.jsx(
921
- xe,
921
+ he,
922
922
  {
923
923
  className: W(
924
924
  "h-9 w-full focus:ring-1 focus:ring-offset-0",
925
925
  d
926
926
  ),
927
927
  children: /* @__PURE__ */ e.jsx(
928
- pe,
928
+ xe,
929
929
  {
930
930
  placeholder: n ? "Loading..." : l ? "Error" : `Select ${s}`
931
931
  }
932
932
  )
933
933
  }
934
934
  ),
935
- /* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
936
- n ? /* @__PURE__ */ e.jsx(ge, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(ge, { children: s }),
935
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
936
+ n ? /* @__PURE__ */ e.jsx(fe, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(fe, { children: s }),
937
937
  /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
938
938
  c && /* @__PURE__ */ e.jsx(J, { value: "none", children: "None" }, "none"),
939
939
  t && t.map((x, j) => /* @__PURE__ */ e.jsx(J, { value: x.id, children: x.name }, j))
@@ -950,15 +950,15 @@ function tl({ column: s }) {
950
950
  (x) => x.selectedDatamodelId
951
951
  ), i = m((x) => x.sqlGen), { modelItems: c } = qe(), d = m((x) => x.actions.setSqlGen), p = m((x) => x.actions.setCardSql), u = m((x) => x.actions.setRunSql);
952
952
  function y(x, j) {
953
- var M;
954
- const b = ma(x, i, j), I = (M = c == null ? void 0 : c.find(
953
+ var D;
954
+ const b = ma(x, i, j), I = (D = c == null ? void 0 : c.find(
955
955
  (F) => F.id === o
956
- )) == null ? void 0 : M.name;
956
+ )) == null ? void 0 : D.name;
957
957
  d(b);
958
958
  const C = ha(
959
959
  b,
960
- ue(l || ""),
961
- ue(n),
960
+ de(l || ""),
961
+ de(n),
962
962
  I
963
963
  );
964
964
  C && (p(C), u(!0)), a(!1);
@@ -1026,7 +1026,7 @@ function Ea({ column: s }) {
1026
1026
  /* @__PURE__ */ e.jsx(Us, { className: "size-3" })
1027
1027
  ) : xa.includes(s.data_type.toLowerCase()) ? (
1028
1028
  //
1029
- /* @__PURE__ */ e.jsx(Dn, { className: "size-3" })
1029
+ /* @__PURE__ */ e.jsx(Mn, { className: "size-3" })
1030
1030
  ) : ot.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(ct, { className: "size-3" }) : dt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Jn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Bn, { className: "size-3" }) }),
1031
1031
  /* @__PURE__ */ e.jsx(ua, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
1032
1032
  ] });
@@ -1050,13 +1050,13 @@ function nl({
1050
1050
  ), { setAIScopeTables: y } = z((h) => h.actions), g = m((h) => h.actions.setRunSql), x = m((h) => h.actions.setSqlGen), j = m(
1051
1051
  (h) => h.actions.setIsShowingVisual
1052
1052
  ), b = m((h) => h.actions.setCardSql), { connectionType: I, modelItems: C } = qe();
1053
- function M(h) {
1053
+ function D(h) {
1054
1054
  var L;
1055
1055
  const v = ma(h, l);
1056
1056
  x(v);
1057
1057
  const f = (L = C == null ? void 0 : C.find(
1058
1058
  (H) => H.id === p
1059
- )) == null ? void 0 : L.name, k = ha(v, ue(s), ue(t), f);
1059
+ )) == null ? void 0 : L.name, k = ha(v, de(s), de(t), f);
1060
1060
  k && (b(k), g(!0));
1061
1061
  }
1062
1062
  function F() {
@@ -1109,7 +1109,7 @@ function nl({
1109
1109
  const v = I === "MSSQL" ? `SELECT top 10 * FROM ${h}` : `SELECT * FROM ${h} LIMIT 10`;
1110
1110
  b(v), g(!0);
1111
1111
  }
1112
- function D() {
1112
+ function M() {
1113
1113
  const h = N();
1114
1114
  b(`SELECT COUNT(*) as count FROM ${h}`), g(!0);
1115
1115
  }
@@ -1152,7 +1152,7 @@ function nl({
1152
1152
  O,
1153
1153
  {
1154
1154
  disabled: n !== "Success",
1155
- onClick: D,
1155
+ onClick: M,
1156
1156
  size: "sm",
1157
1157
  variant: "secondary",
1158
1158
  className: "flex",
@@ -1171,7 +1171,7 @@ function nl({
1171
1171
  a == null ? void 0 : a.map((h) => /* @__PURE__ */ e.jsxs(
1172
1172
  "div",
1173
1173
  {
1174
- onClick: () => M(h),
1174
+ onClick: () => D(h),
1175
1175
  className: W(
1176
1176
  "group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
1177
1177
  {
@@ -1232,7 +1232,7 @@ function qe(s, t) {
1232
1232
  function C(r) {
1233
1233
  return !!(l && i && i !== "NA" && c && d || l && (r === "S3" || r === "API") || o && o);
1234
1234
  }
1235
- function M(r) {
1235
+ function D(r) {
1236
1236
  return l && r ? !(r === "API" || r === "S3") : !1;
1237
1237
  }
1238
1238
  const {
@@ -1249,7 +1249,7 @@ function qe(s, t) {
1249
1249
  // Only fetch if authToken is present
1250
1250
  }), {
1251
1251
  data: S,
1252
- isLoading: D,
1252
+ isLoading: M,
1253
1253
  isError: h
1254
1254
  } = Ne({
1255
1255
  queryKey: ["models", l],
@@ -1279,7 +1279,7 @@ function qe(s, t) {
1279
1279
  connection_id: l
1280
1280
  }
1281
1281
  ),
1282
- enabled: M(f)
1282
+ enabled: D(f)
1283
1283
  // !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
1284
1284
  }), {
1285
1285
  data: K,
@@ -1324,7 +1324,7 @@ function qe(s, t) {
1324
1324
  enabled: I(f)
1325
1325
  }), {
1326
1326
  data: te,
1327
- isLoading: De,
1327
+ isLoading: Me,
1328
1328
  isFetching: ke,
1329
1329
  isError: be
1330
1330
  } = Ne({
@@ -1369,10 +1369,10 @@ function qe(s, t) {
1369
1369
  v
1370
1370
  ]);
1371
1371
  const ye = (v == null ? void 0 : v.type) === "API" ? (Xe = v == null ? void 0 : v.type) == null ? void 0 : Xe.toLowerCase() : d || "", Q = k ? "" : c || "";
1372
- function ce(r) {
1372
+ function oe(r) {
1373
1373
  x(r), j("");
1374
1374
  }
1375
- function de(r) {
1375
+ function ce(r) {
1376
1376
  g(r === "none" ? "" : r), x(""), j(""), r !== "none" && r !== "" && y("");
1377
1377
  }
1378
1378
  function Oe(r) {
@@ -1409,7 +1409,7 @@ function qe(s, t) {
1409
1409
  isConnectionsLoading: A,
1410
1410
  isConnectionsError: N,
1411
1411
  modelItems: He,
1412
- isModelsLoading: D,
1412
+ isModelsLoading: M,
1413
1413
  isModelsError: h,
1414
1414
  databaseItems: Ee,
1415
1415
  isDatabasesLoadingOrFetching: H || P,
@@ -1421,7 +1421,7 @@ function qe(s, t) {
1421
1421
  isTableLoadingOrFetching: T || se,
1422
1422
  isTableError: $,
1423
1423
  columns: a,
1424
- isColumnsLoadingOrFetching: De || ke,
1424
+ isColumnsLoadingOrFetching: Me || ke,
1425
1425
  isColumnsError: be,
1426
1426
  isNonDbConnection: k,
1427
1427
  connectionType: f,
@@ -1429,8 +1429,8 @@ function qe(s, t) {
1429
1429
  schemaName: Q,
1430
1430
  handleConnectionChange: Oe,
1431
1431
  handleDatamodelChange: Le,
1432
- handleDatabaseChange: de,
1433
- handleSchemaChange: ce
1432
+ handleDatabaseChange: ce,
1433
+ handleSchemaChange: oe
1434
1434
  };
1435
1435
  }
1436
1436
  function Aa({
@@ -1459,12 +1459,12 @@ function Aa({
1459
1459
  isConnectionsError: b,
1460
1460
  isModelsError: I,
1461
1461
  isDatabasesLoadingOrFetching: C,
1462
- isDatabaseError: M,
1462
+ isDatabaseError: D,
1463
1463
  isSchemaLoadingOrFetching: F,
1464
1464
  isSchemaError: A,
1465
1465
  isColumnsError: N,
1466
1466
  isColumnsLoadingOrFetching: S,
1467
- isTableLoadingOrFetching: D,
1467
+ isTableLoadingOrFetching: M,
1468
1468
  isTableError: h,
1469
1469
  connectionType: v,
1470
1470
  isNonDbConnection: f,
@@ -1497,7 +1497,7 @@ function Aa({
1497
1497
  {
1498
1498
  showNone: !0,
1499
1499
  onChange: L,
1500
- isError: M,
1500
+ isError: D,
1501
1501
  isLoading: C,
1502
1502
  items: u,
1503
1503
  value: n || "",
@@ -1508,9 +1508,9 @@ function Aa({
1508
1508
  function _() {
1509
1509
  if (t && !f && (!n || n === "none") && (!a || a === "none"))
1510
1510
  return /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3", children: [
1511
- /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(oe, {}) }),
1511
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(ge, {}) }),
1512
1512
  /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(R, { children: "OR" }) }),
1513
- /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(oe, {}) })
1513
+ /* @__PURE__ */ e.jsx("div", { className: "col-span-1 grid place-items-center", children: /* @__PURE__ */ e.jsx(ge, {}) })
1514
1514
  ] });
1515
1515
  }
1516
1516
  function ee() {
@@ -1553,7 +1553,7 @@ function Aa({
1553
1553
  onChange: i,
1554
1554
  isError: h,
1555
1555
  items: y,
1556
- isLoading: D,
1556
+ isLoading: M,
1557
1557
  value: o || "",
1558
1558
  title: "Table"
1559
1559
  }
@@ -1637,7 +1637,7 @@ function rl({
1637
1637
  size: "sm",
1638
1638
  variant: "outline",
1639
1639
  children: [
1640
- /* @__PURE__ */ e.jsx(Mn, { className: "mr-2 h-4 w-4" }),
1640
+ /* @__PURE__ */ e.jsx(Dn, { className: "mr-2 h-4 w-4" }),
1641
1641
  "Debug with AI"
1642
1642
  ]
1643
1643
  }
@@ -1702,15 +1702,15 @@ function ol({
1702
1702
  triggerAIRun: l,
1703
1703
  setTriggerAIRun: o
1704
1704
  }) {
1705
- const i = ws(null), c = ws(null), { authToken: d } = Ie(), [p, u] = q(!1), y = m((w) => w.actions.setCardSql), g = z((w) => w.dashboard.baseQueries), x = m((w) => w.actions.setRunSql), j = m((w) => w.actions.setCardType), [b, I] = q([]), C = m((w) => w.currentColumns), M = m((w) => w.card.sql), F = m((w) => w.selectedTableName), A = `
1705
+ const i = ws(null), c = ws(null), { authToken: d } = Ie(), [p, u] = q(!1), y = m((w) => w.actions.setCardSql), g = z((w) => w.dashboard.baseQueries), x = m((w) => w.actions.setRunSql), j = m((w) => w.actions.setCardType), [b, I] = q([]), C = m((w) => w.currentColumns), D = m((w) => w.card.sql), F = m((w) => w.selectedTableName), A = `
1706
1706
  ${a}
1707
1707
 
1708
1708
  Database Query Dialect: ${F === "api" || F === "s3" ? "DuckDb" : ""}
1709
1709
  Table Name: ${F}
1710
1710
  Table Columns: ${C == null ? void 0 : C.map((w) => `${w.column_name} | ${w.data_type}`).join(", ")}
1711
- User SQL: ${M}
1711
+ User SQL: ${D}
1712
1712
  ${g && `Base Queries: ${JSON.stringify(g)} `}`, N = ` 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.
1713
- Visual Query Syntax: ${il}`, { data: S, isLoading: D, isFetching: h, isError: v, refetch: f } = Ne({
1713
+ Visual Query Syntax: ${il}`, { data: S, isLoading: M, isFetching: h, isError: v, refetch: f } = Ne({
1714
1714
  queryKey: ["ai-query"],
1715
1715
  queryFn: () => ze(
1716
1716
  "https://semaphor.cloud/api/v1/ai",
@@ -1849,11 +1849,11 @@ function ol({
1849
1849
  }
1850
1850
  ) }),
1851
1851
  /* @__PURE__ */ e.jsxs(
1852
- Ms,
1852
+ Ds,
1853
1853
  {
1854
1854
  className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
1855
1855
  children: [
1856
- /* @__PURE__ */ e.jsxs(Ds, { children: [
1856
+ /* @__PURE__ */ e.jsxs(Ms, { children: [
1857
1857
  /* @__PURE__ */ e.jsx(Ls, { children: "Assistant" }),
1858
1858
  /* @__PURE__ */ e.jsx(Es, { children: "What can I help you with?" })
1859
1859
  ] }),
@@ -1885,7 +1885,7 @@ function ol({
1885
1885
  className: W(
1886
1886
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1887
1887
  ),
1888
- disabled: D || h,
1888
+ disabled: M || h,
1889
1889
  value: a,
1890
1890
  onChange: (w) => n(w.target.value)
1891
1891
  }
@@ -1898,7 +1898,7 @@ function ol({
1898
1898
  size: "sm",
1899
1899
  variant: "ghost",
1900
1900
  onClick: L,
1901
- children: !D && !h ? /* @__PURE__ */ e.jsx(ht, {}) : /* @__PURE__ */ e.jsx(Ke, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1901
+ children: !M && !h ? /* @__PURE__ */ e.jsx(ht, {}) : /* @__PURE__ */ e.jsx(Ke, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1902
1902
  }
1903
1903
  )
1904
1904
  ] })
@@ -2023,10 +2023,17 @@ function fl(s) {
2023
2023
  function gl({ sql: s }) {
2024
2024
  return /* @__PURE__ */ e.jsxs(Vs, { children: [
2025
2025
  /* @__PURE__ */ e.jsx(qs, { asChild: !0, children: /* @__PURE__ */ e.jsx(O, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(gt, { className: "h-4 w-4 text-muted-foreground" }) }) }),
2026
- /* @__PURE__ */ e.jsx(Rs, { align: "end", className: "w-full min-w-fit max-w-[700px]", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
2027
- /* @__PURE__ */ e.jsx(R, { className: "text-xs font-semibold", children: "Resolved Query" }),
2028
- /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-col space-y-2", children: /* @__PURE__ */ e.jsx(We, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 font-mono text-xs leading-relaxed", children: s }) }) })
2029
- ] }) })
2026
+ /* @__PURE__ */ e.jsx(
2027
+ Rs,
2028
+ {
2029
+ align: "end",
2030
+ className: "w-full min-w-fit max-w-[700px] p-3 pt-2",
2031
+ children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
2032
+ /* @__PURE__ */ e.jsx(R, { className: "text-xs font-semibold", children: "Resolved Query" }),
2033
+ /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-col space-y-2", children: /* @__PURE__ */ e.jsx(We, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 font-mono text-xs leading-relaxed", children: s }) }) })
2034
+ ] })
2035
+ }
2036
+ )
2030
2037
  ] });
2031
2038
  }
2032
2039
  function jl() {
@@ -2035,7 +2042,7 @@ function jl() {
2035
2042
  queryData: null
2036
2043
  }), { theme: a } = jt(), n = bt(), l = ws(), o = yt(), [i, c] = q(!1), [d, p] = q(!1), [u, y] = q(!1), [g, x] = q(""), [j, b] = q(!1), I = z((r) => r.selectedSheetId);
2037
2044
  z((r) => r.dashboard.baseQueries);
2038
- const C = m((r) => r.card), M = z((r) => r.theme), F = m((r) => r.isShowingVisual);
2045
+ const C = m((r) => r.card), D = z((r) => r.theme), F = m((r) => r.isShowingVisual);
2039
2046
  z((r) => r.onAcceptChanges);
2040
2047
  const A = m(
2041
2048
  (r) => r.selectedConnectionId
@@ -2043,7 +2050,7 @@ function jl() {
2043
2050
  (r) => r.selectedDatabaseName
2044
2051
  ), S = m(
2045
2052
  (r) => r.selectedDatamodelId
2046
- ), D = m(
2053
+ ), M = m(
2047
2054
  (r) => r.selectedSchemaName
2048
2055
  );
2049
2056
  z(
@@ -2067,14 +2074,14 @@ function jl() {
2067
2074
  m(
2068
2075
  (r) => r.actions.setApplyFilters
2069
2076
  );
2070
- const te = m((r) => r.onClose), De = m((r) => r.actions.setSqlGen), ke = m((r) => r.runSql), be = m((r) => r.actions.setRunSql);
2077
+ const te = m((r) => r.onClose), Me = m((r) => r.actions.setSqlGen), ke = m((r) => r.runSql), be = m((r) => r.actions.setRunSql);
2071
2078
  m((r) => r.actions.setCardCfg);
2072
2079
  const ye = m(
2073
2080
  (r) => r.actions.setIsSqlRunning
2074
2081
  ), {
2075
2082
  data: Q,
2076
- isLoading: ce,
2077
- isFetching: de,
2083
+ isLoading: oe,
2084
+ isFetching: ce,
2078
2085
  isSuccess: Oe,
2079
2086
  isError: Le,
2080
2087
  error: _e,
@@ -2095,10 +2102,10 @@ function jl() {
2095
2102
  ae,
2096
2103
  se
2097
2104
  ]), Z(() => {
2098
- (ce || de) && ye(!0), (Le || Oe) && ye(!1), Le ? (T(_e.message), ae([]), se("")) : T("");
2105
+ (oe || ce) && ye(!0), (Le || Oe) && ye(!1), Le ? (T(_e.message), ae([]), se("")) : T("");
2099
2106
  }, [
2107
+ oe,
2100
2108
  ce,
2101
- de,
2102
2109
  Q,
2103
2110
  se,
2104
2111
  Le,
@@ -2115,7 +2122,7 @@ function jl() {
2115
2122
  s.queryData || t({
2116
2123
  queryKey: He,
2117
2124
  queryData: r
2118
- }), n.setQueryData(He, null), _(""), De({}), K(""), $({});
2125
+ }), n.setQueryData(He, null), _(""), Me({}), K(""), $({});
2119
2126
  }
2120
2127
  const Ye = (r) => {
2121
2128
  l.current = r;
@@ -2145,7 +2152,7 @@ function jl() {
2145
2152
  v && !v.includes("{{") && (r = ll(v), _(r));
2146
2153
  const ne = {
2147
2154
  ...C,
2148
- lastSelectedSchema: D,
2155
+ lastSelectedSchema: M,
2149
2156
  lastSelectedDatamodelId: S,
2150
2157
  lastSelectedDatabase: N,
2151
2158
  lastSelectedTable: h,
@@ -2168,7 +2175,7 @@ function jl() {
2168
2175
  }
2169
2176
  Z(() => {
2170
2177
  if (!o) return;
2171
- const r = l.current, ne = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ve = M === "system" ? ne : M;
2178
+ const r = l.current, ne = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ve = D === "system" ? ne : D;
2172
2179
  return o.editor.defineTheme("default", {
2173
2180
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
2174
2181
  base: ve === "light" ? "vs" : "vs-dark",
@@ -2188,7 +2195,7 @@ function jl() {
2188
2195
  }
2189
2196
  ), () => {
2190
2197
  };
2191
- }, [a, M, o]);
2198
+ }, [a, D, o]);
2192
2199
  function ss() {
2193
2200
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2194
2201
  d && /* @__PURE__ */ e.jsx(
@@ -2237,7 +2244,7 @@ function jl() {
2237
2244
  renderLineHighlight: "none"
2238
2245
  }
2239
2246
  },
2240
- M
2247
+ D
2241
2248
  )
2242
2249
  ] })
2243
2250
  }
@@ -2389,7 +2396,7 @@ function jl() {
2389
2396
  O,
2390
2397
  {
2391
2398
  title: "Shift + Enter",
2392
- disabled: ce || de,
2399
+ disabled: oe || ce,
2393
2400
  onClick: () => {
2394
2401
  Ee();
2395
2402
  },
@@ -2397,7 +2404,7 @@ function jl() {
2397
2404
  size: "sm",
2398
2405
  variant: "outline",
2399
2406
  children: [
2400
- ce || de ? /* @__PURE__ */ e.jsx(Ke, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Hn, { className: "mr-2 h-4 w-4" }),
2407
+ oe || ce ? /* @__PURE__ */ e.jsx(Ke, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Hn, { className: "mr-2 h-4 w-4" }),
2401
2408
  "Run"
2402
2409
  ]
2403
2410
  }
@@ -2506,9 +2513,9 @@ function bl({ data: s }) {
2506
2513
  data: s,
2507
2514
  columns: l,
2508
2515
  getCoreRowModel: Tt(),
2509
- getPaginationRowModel: Mt(),
2516
+ getPaginationRowModel: Dt(),
2510
2517
  onSortingChange: a,
2511
- getSortedRowModel: Dt(),
2518
+ getSortedRowModel: Mt(),
2512
2519
  manualPagination: !0,
2513
2520
  state: {
2514
2521
  sorting: t
@@ -2531,7 +2538,7 @@ function bl({ data: s }) {
2531
2538
  ] });
2532
2539
  }
2533
2540
  function yl({ card: s }) {
2534
- var g, x, j, b, I, C, M, F, A, N;
2541
+ var g, x, j, b, I, C, D, F, A, N;
2535
2542
  const { authToken: t } = Ie(), a = Lt(t == null ? void 0 : t.accessToken), n = z((S) => S.themeStyle), l = {
2536
2543
  colors: ((x = (g = n == null ? void 0 : n.chart) == null ? void 0 : g.dataset) == null ? void 0 : x.backgroundColor) || []
2537
2544
  };
@@ -2542,14 +2549,14 @@ function yl({ card: s }) {
2542
2549
  if (!((C = s.customCardPreferences) != null && C.componentName))
2543
2550
  return null;
2544
2551
  const p = o(
2545
- (M = s.customCardPreferences) == null ? void 0 : M.componentName
2552
+ (D = s.customCardPreferences) == null ? void 0 : D.componentName
2546
2553
  ), u = (S) => {
2547
2554
  console.log("data", S), s.customCardPreferences;
2548
2555
  }, y = Object.keys(
2549
2556
  ((F = s.customCardPreferences) == null ? void 0 : F.dataInputCardIds) || {}
2550
2557
  ).map((S) => {
2551
2558
  var v, f, k;
2552
- const D = (f = (v = s.customCardPreferences) == null ? void 0 : v.dataInputCardIds) == null ? void 0 : f[S].cardId, h = (k = c == null ? void 0 : c.cards) == null ? void 0 : k.find((L) => L.id === D);
2559
+ const M = (f = (v = s.customCardPreferences) == null ? void 0 : v.dataInputCardIds) == null ? void 0 : f[S].cardId, h = (k = c == null ? void 0 : c.cards) == null ? void 0 : k.find((L) => L.id === M);
2553
2560
  return h || null;
2554
2561
  });
2555
2562
  return /* @__PURE__ */ e.jsx("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs(
@@ -2574,8 +2581,8 @@ function yl({ card: s }) {
2574
2581
  onDataChange: u,
2575
2582
  settings: y.map(
2576
2583
  (S) => {
2577
- var D;
2578
- return (D = S == null ? void 0 : S.customCardPreferences) == null ? void 0 : D.settings;
2584
+ var M;
2585
+ return (M = S == null ? void 0 : S.customCardPreferences) == null ? void 0 : M.settings;
2579
2586
  }
2580
2587
  ),
2581
2588
  data: y.map((S) => (S == null ? void 0 : S.data) || [])
@@ -2686,7 +2693,7 @@ function vl() {
2686
2693
  return JSON.stringify(S, null, 1);
2687
2694
  }
2688
2695
  function C() {
2689
- var S, D;
2696
+ var S, M;
2690
2697
  if (!(g != null && g.records) || (g == null ? void 0 : g.records.length) === 0) return;
2691
2698
  const N = ba({
2692
2699
  data: g == null ? void 0 : g.records,
@@ -2695,9 +2702,9 @@ function vl() {
2695
2702
  preferences: u.preferences,
2696
2703
  topoJson: x
2697
2704
  });
2698
- N && (n(JSON.stringify(N, null, 1)), (S = u == null ? void 0 : u.preferences) != null && S.customVisualCode && c((D = u == null ? void 0 : u.preferences) == null ? void 0 : D.customVisualCode), y && o(JSON.stringify(y, null, 1)));
2705
+ N && (n(JSON.stringify(N, null, 1)), (S = u == null ? void 0 : u.preferences) != null && S.customVisualCode && c((M = u == null ? void 0 : u.preferences) == null ? void 0 : M.customVisualCode), y && o(JSON.stringify(y, null, 1)));
2699
2706
  }
2700
- function M() {
2707
+ function D() {
2701
2708
  if (i && b(i), !!l)
2702
2709
  try {
2703
2710
  const N = JSON.parse(l);
@@ -2712,8 +2719,8 @@ function vl() {
2712
2719
  function A() {
2713
2720
  let N;
2714
2721
  if (y) {
2715
- const S = Xs.cloneDeep(u.cfg), D = Xs.merge(S, y);
2716
- return N = I(D), N;
2722
+ const S = Xs.cloneDeep(u.cfg), M = Xs.merge(S, y);
2723
+ return N = I(M), N;
2717
2724
  }
2718
2725
  return a ? (N = I(JSON.parse(a)), N) : "";
2719
2726
  }
@@ -2729,11 +2736,11 @@ function vl() {
2729
2736
  }
2730
2737
  ) }),
2731
2738
  /* @__PURE__ */ e.jsxs(
2732
- Ms,
2739
+ Ds,
2733
2740
  {
2734
2741
  className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
2735
2742
  children: [
2736
- /* @__PURE__ */ e.jsxs(Ds, { className: "", children: [
2743
+ /* @__PURE__ */ e.jsxs(Ms, { className: "", children: [
2737
2744
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(Ls, { children: "Customize Card" }) }),
2738
2745
  /* @__PURE__ */ e.jsxs(Es, { children: [
2739
2746
  "See the configuration options and documentation",
@@ -2845,7 +2852,7 @@ function vl() {
2845
2852
  children: "Reset"
2846
2853
  }
2847
2854
  ),
2848
- /* @__PURE__ */ e.jsx(O, { onClick: M, variant: "outline", children: "Apply" }),
2855
+ /* @__PURE__ */ e.jsx(O, { onClick: D, variant: "outline", children: "Apply" }),
2849
2856
  /* @__PURE__ */ e.jsx(O, { onClick: () => t(!1), variant: "outline", children: "Close" })
2850
2857
  ] })
2851
2858
  ]
@@ -2881,7 +2888,7 @@ function Ja(s) {
2881
2888
  const [t, a] = q(null);
2882
2889
  return Z(() => {
2883
2890
  s && (async () => {
2884
- const o = (await import("./lucide-react-CG3dBfrI.js"))[s];
2891
+ const o = (await import("./lucide-react-BbKgFV_m.js"))[s];
2885
2892
  a(o);
2886
2893
  })();
2887
2894
  }, [s]), t;
@@ -2913,7 +2920,7 @@ function Cl({
2913
2920
  }
2914
2921
  })();
2915
2922
  }, [n]), t.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2916
- /* @__PURE__ */ e.jsx(oe, { className: "my-2" }),
2923
+ /* @__PURE__ */ e.jsx(ge, { className: "my-2" }),
2917
2924
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, o) => /* @__PURE__ */ e.jsx(
2918
2925
  Nl,
2919
2926
  {
@@ -3097,7 +3104,7 @@ function Sl() {
3097
3104
  {
3098
3105
  onClick: () => p("custom"),
3099
3106
  variant: "ghost",
3100
- children: /* @__PURE__ */ e.jsx(Da, { className: "size-4" })
3107
+ children: /* @__PURE__ */ e.jsx(Ma, { className: "size-4" })
3101
3108
  }
3102
3109
  )
3103
3110
  ] }),
@@ -3144,7 +3151,7 @@ function wl({
3144
3151
  case "map":
3145
3152
  return /* @__PURE__ */ e.jsx(Ta, { className: t });
3146
3153
  case "custom":
3147
- return a && l ? /* @__PURE__ */ e.jsx(l, { className: t }) : n ? n == null ? void 0 : n.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(Da, { className: t });
3154
+ return a && l ? /* @__PURE__ */ e.jsx(l, { className: t }) : n ? n == null ? void 0 : n.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(Ma, { className: t });
3148
3155
  default:
3149
3156
  return /* @__PURE__ */ e.jsx(As, { className: t });
3150
3157
  }
@@ -3230,7 +3237,7 @@ function ta() {
3230
3237
  const f = v.cards.find((k) => k.id === h);
3231
3238
  f.sql && i(!0), d(f);
3232
3239
  }
3233
- const M = (h, v) => {
3240
+ const D = (h, v) => {
3234
3241
  console.log("handleDragStart", v), h.dataTransfer.setData("tabIndex", v.toString());
3235
3242
  }, F = (h) => {
3236
3243
  h.preventDefault();
@@ -3263,7 +3270,7 @@ function ta() {
3263
3270
  value: s.activeCardId,
3264
3271
  className: "flex grow flex-col",
3265
3272
  children: [
3266
- s.cards.map((h) => /* @__PURE__ */ e.jsx(is, { className: "mt-0 grow", value: h.id, children: D() }, h.id)),
3273
+ s.cards.map((h) => /* @__PURE__ */ e.jsx(is, { className: "mt-0 grow", value: h.id, children: M() }, h.id)),
3267
3274
  /* @__PURE__ */ e.jsx(Ca, { className: "group mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
3268
3275
  s.cards.map((h, v) => /* @__PURE__ */ e.jsx(
3269
3276
  ls,
@@ -3276,7 +3283,7 @@ function ta() {
3276
3283
  rs,
3277
3284
  {
3278
3285
  draggable: !0,
3279
- onDragStart: (f) => M(f, v),
3286
+ onDragStart: (f) => D(f, v),
3280
3287
  onDragOver: F,
3281
3288
  onDrop: (f) => A(f, v),
3282
3289
  className: "",
@@ -3320,7 +3327,7 @@ function ta() {
3320
3327
  }
3321
3328
  );
3322
3329
  }
3323
- function D() {
3330
+ function M() {
3324
3331
  return t.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Jt, { card: t, data: u == null ? void 0 : u.records }) }) }) : t.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(We, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
3325
3332
  Kt,
3326
3333
  {
@@ -3360,7 +3367,7 @@ function Ol() {
3360
3367
  className: "bg-muted p-2 font-mono text-sm"
3361
3368
  }
3362
3369
  ),
3363
- /* @__PURE__ */ e.jsx(oe, { className: "mb-2" })
3370
+ /* @__PURE__ */ e.jsx(ge, { className: "mb-2" })
3364
3371
  ] });
3365
3372
  }
3366
3373
  function zl() {
@@ -3399,23 +3406,23 @@ function Fl({
3399
3406
  }
3400
3407
  );
3401
3408
  }
3402
- function me({
3409
+ function ue({
3403
3410
  label: s,
3404
3411
  options: t,
3405
3412
  value: a,
3406
3413
  onValueChange: n,
3407
3414
  className: l
3408
3415
  }) {
3409
- return /* @__PURE__ */ e.jsxs(he, { value: a, onValueChange: n, children: [
3416
+ return /* @__PURE__ */ e.jsxs(me, { value: a, onValueChange: n, children: [
3410
3417
  /* @__PURE__ */ e.jsx(
3411
- xe,
3418
+ he,
3412
3419
  {
3413
3420
  className: W("w-full focus:ring-0 focus:ring-offset-0", l),
3414
- children: /* @__PURE__ */ e.jsx(pe, { placeholder: s })
3421
+ children: /* @__PURE__ */ e.jsx(xe, { placeholder: s })
3415
3422
  }
3416
3423
  ),
3417
- /* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
3418
- /* @__PURE__ */ e.jsx(ge, { children: s }),
3424
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
3425
+ /* @__PURE__ */ e.jsx(fe, { children: s }),
3419
3426
  t.map((o) => /* @__PURE__ */ e.jsx(J, { value: o.value, children: o.label }, o.value))
3420
3427
  ] }) })
3421
3428
  ] });
@@ -3450,12 +3457,12 @@ function Il() {
3450
3457
  ), p = (b = d == null ? void 0 : d.visuals) == null ? void 0 : b.find(
3451
3458
  (C) => C.name === (s == null ? void 0 : s.componentName)
3452
3459
  );
3453
- function u(C, M) {
3460
+ function u(C, D) {
3454
3461
  if (!s) return;
3455
3462
  const A = {
3456
3463
  ...(s == null ? void 0 : s.dataInputCardIds) || {},
3457
3464
  [C]: {
3458
- cardId: M,
3465
+ cardId: D,
3459
3466
  hookRef: null
3460
3467
  }
3461
3468
  };
@@ -3466,7 +3473,7 @@ function Il() {
3466
3473
  }
3467
3474
  function y(C) {
3468
3475
  var F, A;
3469
- const M = (F = l == null ? void 0 : l.cards) == null ? void 0 : F.filter((N) => {
3476
+ const D = (F = l == null ? void 0 : l.cards) == null ? void 0 : F.filter((N) => {
3470
3477
  var S;
3471
3478
  return ((S = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : S.visualType) !== "multiple";
3472
3479
  }).map((N) => ({
@@ -3474,7 +3481,7 @@ function Il() {
3474
3481
  label: N.tabTitle || N.title
3475
3482
  }));
3476
3483
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (A = C == null ? void 0 : C.dataInputs) == null ? void 0 : A.map((N, S) => {
3477
- var D, h;
3484
+ var M, h;
3478
3485
  return /* @__PURE__ */ e.jsxs(
3479
3486
  "div",
3480
3487
  {
@@ -3482,12 +3489,12 @@ function Il() {
3482
3489
  children: [
3483
3490
  /* @__PURE__ */ e.jsx("div", { className: "col-span-4 flex items-center", children: N }),
3484
3491
  /* @__PURE__ */ e.jsx(
3485
- me,
3492
+ ue,
3486
3493
  {
3487
3494
  className: "col-span-6 h-8 w-full justify-between",
3488
3495
  label: "",
3489
- options: M || [],
3490
- value: ((h = (D = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : D[S]) == null ? void 0 : h.cardId) || "",
3496
+ options: D || [],
3497
+ value: ((h = (M = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : M[S]) == null ? void 0 : h.cardId) || "",
3491
3498
  onValueChange: (v) => u(S, v)
3492
3499
  }
3493
3500
  )
@@ -3497,43 +3504,43 @@ function Il() {
3497
3504
  );
3498
3505
  }) });
3499
3506
  }
3500
- function g(C, M, F = []) {
3507
+ function g(C, D, F = []) {
3501
3508
  var A, N;
3502
3509
  return s ? C === "input" ? /* @__PURE__ */ e.jsx(
3503
3510
  le,
3504
3511
  {
3505
3512
  className: `h-8 w-full ${Pe}`,
3506
- value: ((A = s == null ? void 0 : s.settings) == null ? void 0 : A[M]) || "",
3513
+ value: ((A = s == null ? void 0 : s.settings) == null ? void 0 : A[D]) || "",
3507
3514
  onChange: (S) => {
3508
3515
  i({
3509
3516
  ...s,
3510
3517
  settings: {
3511
3518
  ...s == null ? void 0 : s.settings,
3512
- [M]: S.target.value
3519
+ [D]: S.target.value
3513
3520
  }
3514
3521
  });
3515
3522
  }
3516
3523
  },
3517
- M
3524
+ D
3518
3525
  ) : C === "select" ? /* @__PURE__ */ e.jsx(
3519
- me,
3526
+ ue,
3520
3527
  {
3521
3528
  className: "h-8 w-full",
3522
3529
  label: "",
3523
3530
  options: F,
3524
- value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[M]) || "",
3531
+ value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[D]) || "",
3525
3532
  onValueChange: (S) => {
3526
3533
  i({
3527
3534
  ...s,
3528
- settings: { ...s == null ? void 0 : s.settings, [M]: S }
3535
+ settings: { ...s == null ? void 0 : s.settings, [D]: S }
3529
3536
  });
3530
3537
  }
3531
3538
  }
3532
3539
  ) : null : null;
3533
3540
  }
3534
3541
  function x(C) {
3535
- const M = Object.entries((C == null ? void 0 : C.settings) || {});
3536
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: M.map(([F, A]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3542
+ const D = Object.entries((C == null ? void 0 : C.settings) || {});
3543
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: D.map(([F, A]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3537
3544
  /* @__PURE__ */ e.jsx(R, { children: A.title }),
3538
3545
  g(
3539
3546
  A.ui,
@@ -3556,7 +3563,7 @@ function Il() {
3556
3563
  children: [
3557
3564
  /* @__PURE__ */ e.jsx(Ue, { summary: "Plugin Settings", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 text-sm", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 text-sm", children: [
3558
3565
  /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
3559
- me,
3566
+ ue,
3560
3567
  {
3561
3568
  className: "h-8 w-full",
3562
3569
  label: "",
@@ -3585,7 +3592,7 @@ function Il() {
3585
3592
  ((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && s && /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3586
3593
  /* @__PURE__ */ e.jsx(R, { children: "Component" }),
3587
3594
  /* @__PURE__ */ e.jsx("div", { className: "space-y-2 px-2", children: c && /* @__PURE__ */ e.jsx(
3588
- me,
3595
+ ue,
3589
3596
  {
3590
3597
  className: "h-8 w-full",
3591
3598
  label: "",
@@ -3606,7 +3613,7 @@ function Il() {
3606
3613
  ) })
3607
3614
  ] }) })
3608
3615
  ] }) }) }),
3609
- /* @__PURE__ */ e.jsx(oe, { className: "my-4" }),
3616
+ /* @__PURE__ */ e.jsx(ge, { className: "my-4" }),
3610
3617
  ((I = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : I.componentName) && /* @__PURE__ */ e.jsxs(Ue, { summary: "Component Settings", children: [
3611
3618
  p && p.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
3612
3619
  /* @__PURE__ */ e.jsx(R, { children: "Input Mapping" }),
@@ -3618,7 +3625,7 @@ function Il() {
3618
3625
  }
3619
3626
  );
3620
3627
  }
3621
- function Me() {
3628
+ function De() {
3622
3629
  const [s, t] = q([]);
3623
3630
  m(
3624
3631
  (u) => u.card.cfg
@@ -3717,7 +3724,7 @@ function Me() {
3717
3724
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: ((x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.find(
3718
3725
  (j) => j.columnIndex === y
3719
3726
  )) && /* @__PURE__ */ e.jsx(
3720
- Ma,
3727
+ Da,
3721
3728
  {
3722
3729
  onClick: () => {
3723
3730
  t((j) => {
@@ -3786,19 +3793,19 @@ function Wa() {
3786
3793
  ((ae = (K = (ie = a == null ? void 0 : a.chartOptions) == null ? void 0 : ie.scales) == null ? void 0 : K[l]) == null ? void 0 : ae.min) || ""
3787
3794
  ), [p, u] = q(
3788
3795
  ((ee = (_ = (w = a == null ? void 0 : a.chartOptions) == null ? void 0 : w.scales) == null ? void 0 : _[l]) == null ? void 0 : ee.max) || ""
3789
- ), [y, g] = q(c || p ? "custom" : "auto"), [x, j] = q(""), [b, I] = q(0), [C, M] = q(""), [F, A] = q(""), [N, S] = q(""), D = m(
3796
+ ), [y, g] = q(c || p ? "custom" : "auto"), [x, j] = q(""), [b, I] = q(0), [C, D] = q(""), [F, A] = q(""), [N, S] = q(""), M = m(
3790
3797
  (E) => E.actions.setCardPreferences
3791
3798
  ), { updateCardInFrame: h } = re(), v = m((E) => E.card), f = m((E) => {
3792
3799
  var T;
3793
3800
  return (T = E.card) == null ? void 0 : T.type;
3794
3801
  }), k = ["pie", "doughnut", "polarArea"].includes(f);
3795
3802
  Z(() => {
3796
- var E, T, se, $, X, te, De, ke, be, ye, Q, ce, de, Oe;
3803
+ var E, T, se, $, X, te, Me, ke, be, ye, Q, oe, ce, Oe;
3797
3804
  i(na(a)), d(
3798
3805
  ((se = (T = (E = a == null ? void 0 : a.chartOptions) == null ? void 0 : E.scales) == null ? void 0 : T[l]) == null ? void 0 : se.min) === 0 ? 0 : ""
3799
3806
  ), u(((te = (X = ($ = a == null ? void 0 : a.chartOptions) == null ? void 0 : $.scales) == null ? void 0 : X[l]) == null ? void 0 : te.max) || ""), j(
3800
- ((ye = (be = (ke = (De = a == null ? void 0 : a.chartOptions) == null ? void 0 : De.scales) == null ? void 0 : ke[l]) == null ? void 0 : be.ticks) == null ? void 0 : ye.stepSize) || ""
3801
- ), I(((Q = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Q.decimalPlaces) || 0), M(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.suffix) || ""), A(((de = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : de.currency) || ""), S(((Oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Oe.locale) || "");
3807
+ ((ye = (be = (ke = (Me = a == null ? void 0 : a.chartOptions) == null ? void 0 : Me.scales) == null ? void 0 : ke[l]) == null ? void 0 : be.ticks) == null ? void 0 : ye.stepSize) || ""
3808
+ ), I(((Q = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Q.decimalPlaces) || 0), D(((oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : oe.suffix) || ""), A(((ce = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ce.currency) || ""), S(((Oe = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Oe.locale) || "");
3802
3809
  }, [s, a, l]);
3803
3810
  function L(E, T) {
3804
3811
  return T === "" || /^[0-9\b]+$/.test(T) ? Number(T) : Number(E);
@@ -3825,30 +3832,30 @@ function Wa() {
3825
3832
  }
3826
3833
  ),
3827
3834
  /* @__PURE__ */ e.jsxs(
3828
- he,
3835
+ me,
3829
3836
  {
3830
3837
  value: F || "none",
3831
3838
  onValueChange: (T) => A(T === "none" ? "" : T),
3832
3839
  children: [
3833
- /* @__PURE__ */ e.jsx(xe, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(pe, {}) }),
3834
- /* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
3835
- /* @__PURE__ */ e.jsx(ge, { children: "Currency" }),
3840
+ /* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
3841
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
3842
+ /* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
3836
3843
  /* @__PURE__ */ e.jsx(J, { value: "none", children: "None" }),
3837
3844
  E.map((T) => /* @__PURE__ */ e.jsx(J, { value: T, children: T }, T))
3838
3845
  ] }) })
3839
3846
  ]
3840
3847
  }
3841
3848
  ),
3842
- /* @__PURE__ */ e.jsxs(he, { value: N, onValueChange: (T) => S(T), children: [
3849
+ /* @__PURE__ */ e.jsxs(me, { value: N, onValueChange: (T) => S(T), children: [
3843
3850
  /* @__PURE__ */ e.jsx(
3844
- xe,
3851
+ he,
3845
3852
  {
3846
3853
  className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",
3847
- children: /* @__PURE__ */ e.jsx(pe, {})
3854
+ children: /* @__PURE__ */ e.jsx(xe, {})
3848
3855
  }
3849
3856
  ),
3850
- /* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
3851
- /* @__PURE__ */ e.jsx(ge, { children: "Locale" }),
3857
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
3858
+ /* @__PURE__ */ e.jsx(fe, { children: "Locale" }),
3852
3859
  os.map((T) => /* @__PURE__ */ e.jsx(J, { value: T.locale, children: T.locale }, T.locale))
3853
3860
  ] }) })
3854
3861
  ] })
@@ -3934,7 +3941,7 @@ function Wa() {
3934
3941
  locale: N
3935
3942
  }
3936
3943
  };
3937
- console.log(T), D(T);
3944
+ console.log(T), M(T);
3938
3945
  const se = {
3939
3946
  ...v,
3940
3947
  preferences: T
@@ -3952,15 +3959,15 @@ function Wa() {
3952
3959
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3953
3960
  /* @__PURE__ */ e.jsx(R, { htmlFor: "scale", children: "Type" }),
3954
3961
  /* @__PURE__ */ e.jsxs(
3955
- he,
3962
+ me,
3956
3963
  {
3957
3964
  disabled: k,
3958
3965
  value: o,
3959
3966
  onValueChange: (E) => i(E),
3960
3967
  children: [
3961
- /* @__PURE__ */ e.jsx(xe, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(pe, {}) }),
3962
- /* @__PURE__ */ e.jsx(fe, { id: "type", children: /* @__PURE__ */ e.jsxs(Se, { children: [
3963
- /* @__PURE__ */ e.jsx(ge, { children: "Option" }),
3968
+ /* @__PURE__ */ e.jsx(he, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
3969
+ /* @__PURE__ */ e.jsx(pe, { id: "type", children: /* @__PURE__ */ e.jsxs(Se, { children: [
3970
+ /* @__PURE__ */ e.jsx(fe, { children: "Option" }),
3964
3971
  /* @__PURE__ */ e.jsx(J, { value: "linear", children: "Linear" }),
3965
3972
  /* @__PURE__ */ e.jsx(J, { value: "logarithmic", children: "Logarithmic" })
3966
3973
  ] }) })
@@ -4150,11 +4157,11 @@ function Ya() {
4150
4157
  /* @__PURE__ */ e.jsx(R, { children: l }),
4151
4158
  /* @__PURE__ */ e.jsx(Wa, {})
4152
4159
  ] }),
4153
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((p, u) => /* @__PURE__ */ e.jsx(Ml, { col: p, idx: u }, p)) })
4160
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: d.map((p, u) => /* @__PURE__ */ e.jsx(Dl, { col: p, idx: u }, p)) })
4154
4161
  ] })
4155
4162
  ] });
4156
4163
  }
4157
- function Ml({ col: s, idx: t }) {
4164
+ function Dl({ col: s, idx: t }) {
4158
4165
  const a = m((c) => {
4159
4166
  var d;
4160
4167
  return (d = c.card) == null ? void 0 : d.preferences;
@@ -4213,13 +4220,6 @@ function Ml({ col: s, idx: t }) {
4213
4220
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
4214
4221
  }
4215
4222
  ),
4216
- /* @__PURE__ */ e.jsx(
4217
- oe,
4218
- {
4219
- orientation: "vertical",
4220
- className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
4221
- }
4222
- ),
4223
4223
  /* @__PURE__ */ e.jsx(Tl, { idx: t })
4224
4224
  ] })
4225
4225
  ] });
@@ -4230,25 +4230,25 @@ function Xa() {
4230
4230
  ), { modelItems: p, tableName: u } = qe();
4231
4231
  function y(g, x = "dashboard") {
4232
4232
  var S;
4233
- const j = ue(g.column_name), b = ue(a || ""), I = ue(n || ""), C = ue(u);
4234
- let M = fa(
4233
+ const j = de(g.column_name), b = de(a || ""), I = de(n || ""), C = de(u);
4234
+ let D = fa(
4235
4235
  I,
4236
4236
  C
4237
- ), F = `${M}.${j}`;
4237
+ ), F = `${D}.${j}`;
4238
4238
  const A = (S = p == null ? void 0 : p.find(
4239
- (D) => D.id === t
4239
+ (M) => M.id === t
4240
4240
  )) == null ? void 0 : S.name;
4241
- t && t !== "none" && (F = `${ys}.${A}.${j}`, M = `${ys}.${A}`);
4241
+ t && t !== "none" && (F = `${ys}.${A}.${j}`, D = `${ys}.${A}`);
4242
4242
  const N = o == null ? void 0 : o.find(
4243
- (D) => D.column === F && D.table === C && (D.database === b || D.database === a)
4243
+ (M) => M.column === F && M.table === C && (M.database === b || M.database === a)
4244
4244
  );
4245
4245
  if (N)
4246
4246
  d(N.id), c(N.id);
4247
4247
  else {
4248
- const D = Qe();
4248
+ const M = Qe();
4249
4249
  return u === "api" && s ? (i({
4250
4250
  location: x,
4251
- id: D,
4251
+ id: M,
4252
4252
  //uuidv4(),
4253
4253
  column: F,
4254
4254
  title: g.column_name,
@@ -4260,12 +4260,12 @@ function Xa() {
4260
4260
  operation: "in",
4261
4261
  sql: Zs(
4262
4262
  g.data_type,
4263
- M,
4263
+ D,
4264
4264
  j
4265
4265
  )
4266
4266
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4267
- }), D) : (i({
4268
- id: D,
4267
+ }), M) : (i({
4268
+ id: M,
4269
4269
  //uuidv4(),
4270
4270
  location: x,
4271
4271
  column: F,
@@ -4278,11 +4278,11 @@ function Xa() {
4278
4278
  operation: "in",
4279
4279
  sql: Zs(
4280
4280
  g.data_type,
4281
- M,
4281
+ D,
4282
4282
  j
4283
4283
  )
4284
4284
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4285
- }), D);
4285
+ }), M);
4286
4286
  }
4287
4287
  }
4288
4288
  return { assignFilter: y };
@@ -4298,11 +4298,11 @@ function Re() {
4298
4298
  const i = s == null ? void 0 : s.find((c) => c.id === t.filterId);
4299
4299
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
4300
4300
  /* @__PURE__ */ e.jsx(R, { children: "Card Filter" }),
4301
- /* @__PURE__ */ e.jsx(Dl, { onSelect: o, columns: n }),
4301
+ /* @__PURE__ */ e.jsx(Ml, { onSelect: o, columns: n }),
4302
4302
  i && /* @__PURE__ */ e.jsx(tn, { filter: i })
4303
4303
  ] });
4304
4304
  }
4305
- function Dl({
4305
+ function Ml({
4306
4306
  columns: s,
4307
4307
  onSelect: t
4308
4308
  }) {
@@ -4393,7 +4393,7 @@ function Ll({
4393
4393
  /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
4394
4394
  /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
4395
4395
  /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
4396
- /* @__PURE__ */ e.jsx(Me, {}),
4396
+ /* @__PURE__ */ e.jsx(De, {}),
4397
4397
  /* @__PURE__ */ e.jsx(Re, {})
4398
4398
  ] })
4399
4399
  ] })
@@ -4431,15 +4431,15 @@ function Gs() {
4431
4431
  !["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(Wa, {})
4432
4432
  ] }),
4433
4433
  /* @__PURE__ */ e.jsxs(
4434
- he,
4434
+ me,
4435
4435
  {
4436
4436
  value: (i = (o = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : i.anchor,
4437
4437
  onValueChange: n,
4438
4438
  defaultValue: "none",
4439
4439
  children: [
4440
- /* @__PURE__ */ e.jsx(xe, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(pe, { placeholder: "Select position" }) }),
4441
- /* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
4442
- /* @__PURE__ */ e.jsx(ge, { children: "Data Labels" }),
4440
+ /* @__PURE__ */ e.jsx(he, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, { placeholder: "Select position" }) }),
4441
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
4442
+ /* @__PURE__ */ e.jsx(fe, { children: "Data Labels" }),
4443
4443
  /* @__PURE__ */ e.jsx(J, { value: "none", children: "None" }),
4444
4444
  a !== "pyramid" && /* @__PURE__ */ e.jsx(J, { value: "start", children: "Start" }),
4445
4445
  /* @__PURE__ */ e.jsx(J, { value: "center", children: "Center" }),
@@ -4491,7 +4491,7 @@ function El({
4491
4491
  /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
4492
4492
  /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
4493
4493
  /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
4494
- /* @__PURE__ */ e.jsx(Me, {}),
4494
+ /* @__PURE__ */ e.jsx(De, {}),
4495
4495
  /* @__PURE__ */ e.jsx(Re, {})
4496
4496
  ] })
4497
4497
  ] })
@@ -4535,7 +4535,7 @@ function ql() {
4535
4535
  /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(fs, {}) }),
4536
4536
  !["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
4537
4537
  /* @__PURE__ */ e.jsx(Gs, {}),
4538
- /* @__PURE__ */ e.jsx(Me, {}),
4538
+ /* @__PURE__ */ e.jsx(De, {}),
4539
4539
  /* @__PURE__ */ e.jsx(Re, {})
4540
4540
  ] })
4541
4541
  ] });
@@ -4697,7 +4697,7 @@ function _l() {
4697
4697
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
4698
4698
  /* @__PURE__ */ e.jsx(R, { children: "Locale" }),
4699
4699
  /* @__PURE__ */ e.jsxs(
4700
- he,
4700
+ me,
4701
4701
  {
4702
4702
  value: n || "none",
4703
4703
  onValueChange: (x) => {
@@ -4710,9 +4710,9 @@ function _l() {
4710
4710
  );
4711
4711
  },
4712
4712
  children: [
4713
- /* @__PURE__ */ e.jsx(xe, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(pe, {}) }),
4714
- /* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
4715
- /* @__PURE__ */ e.jsx(ge, { children: "Format" }),
4713
+ /* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
4714
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
4715
+ /* @__PURE__ */ e.jsx(fe, { children: "Format" }),
4716
4716
  /* @__PURE__ */ e.jsx(J, { value: "none", children: "None" }, "none"),
4717
4717
  os.map((x) => /* @__PURE__ */ e.jsx(J, { value: x.locale, children: x.locale }, x.locale))
4718
4718
  ] }) })
@@ -4723,7 +4723,7 @@ function _l() {
4723
4723
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
4724
4724
  /* @__PURE__ */ e.jsx(R, { children: "Currency" }),
4725
4725
  /* @__PURE__ */ e.jsxs(
4726
- he,
4726
+ me,
4727
4727
  {
4728
4728
  value: l || "none",
4729
4729
  onValueChange: (x) => {
@@ -4736,9 +4736,9 @@ function _l() {
4736
4736
  );
4737
4737
  },
4738
4738
  children: [
4739
- /* @__PURE__ */ e.jsx(xe, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(pe, {}) }),
4740
- /* @__PURE__ */ e.jsx(fe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
4741
- /* @__PURE__ */ e.jsx(ge, { children: "Currency" }),
4739
+ /* @__PURE__ */ e.jsx(he, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
4740
+ /* @__PURE__ */ e.jsx(pe, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
4741
+ /* @__PURE__ */ e.jsx(fe, { children: "Currency" }),
4742
4742
  /* @__PURE__ */ e.jsx(J, { value: "none", children: "None" }, "none"),
4743
4743
  c.map((x) => /* @__PURE__ */ e.jsx(J, { value: x, children: x }, x))
4744
4744
  ] }) })
@@ -4751,7 +4751,7 @@ function _l() {
4751
4751
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
4752
4752
  /* @__PURE__ */ e.jsx(R, { children: "Decimals" }),
4753
4753
  /* @__PURE__ */ e.jsxs(
4754
- he,
4754
+ me,
4755
4755
  {
4756
4756
  value: ((y = (u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.decimalPlaces) == null ? void 0 : y.toString()) || "0",
4757
4757
  onValueChange: (x) => {
@@ -4764,8 +4764,8 @@ function _l() {
4764
4764
  );
4765
4765
  },
4766
4766
  children: [
4767
- /* @__PURE__ */ e.jsx(xe, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(pe, {}) }),
4768
- /* @__PURE__ */ e.jsx(fe, { children: ["0", "1", "2", "3", "4"].map((x) => /* @__PURE__ */ e.jsx(J, { value: x, children: x }, x)) })
4767
+ /* @__PURE__ */ e.jsx(he, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(xe, {}) }),
4768
+ /* @__PURE__ */ e.jsx(pe, { children: ["0", "1", "2", "3", "4"].map((x) => /* @__PURE__ */ e.jsx(J, { value: x, children: x }, x)) })
4769
4769
  ]
4770
4770
  }
4771
4771
  )
@@ -4792,7 +4792,7 @@ function _l() {
4792
4792
  ] })
4793
4793
  ] })
4794
4794
  ] }) }),
4795
- /* @__PURE__ */ e.jsx(oe, { className: "my-3" }),
4795
+ /* @__PURE__ */ e.jsx(ge, { className: "my-3" }),
4796
4796
  /* @__PURE__ */ e.jsx(
4797
4797
  mn,
4798
4798
  {
@@ -4935,7 +4935,7 @@ const $l = [
4935
4935
  value: s
4936
4936
  }));
4937
4937
  function Ul() {
4938
- var d, p, u, y, g, x, j, b, I, C, M, F, A, N, S, D, h, v;
4938
+ var d, p, u, y, g, x, j, b, I, C, D, F, A, N, S, M, h, v;
4939
4939
  const s = m((f) => f.card), t = (p = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : p.topoJsonUrl, [a, n] = q(
4940
4940
  ((y = (u = s == null ? void 0 : s.preferences) == null ? void 0 : u.mapVisualOptions) == null ? void 0 : y.customTopoJsonUrl) || ""
4941
4941
  ), { setCardPreferences: l } = re(), { data: o } = _s(s), i = Object.keys((o == null ? void 0 : o.objects) || {}).map((f) => ({
@@ -4957,10 +4957,10 @@ function Ul() {
4957
4957
  ];
4958
4958
  return /* @__PURE__ */ e.jsxs("div", { className: "p-6", children: [
4959
4959
  /* @__PURE__ */ e.jsx(Ue, { summary: "Map Query", children: /* @__PURE__ */ e.jsx("p", { className: "rounded-md bg-muted p-2 font-mono text-xs", children: "SELECT country, value FROM table" }) }),
4960
- /* @__PURE__ */ e.jsx(oe, { className: "my-4" }),
4960
+ /* @__PURE__ */ e.jsx(ge, { className: "my-4" }),
4961
4961
  /* @__PURE__ */ e.jsx(Ue, { open: !0, summary: "Settings", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-3 px-2", children: [
4962
4962
  /* @__PURE__ */ e.jsx(
4963
- me,
4963
+ ue,
4964
4964
  {
4965
4965
  className: "h-9",
4966
4966
  options: c,
@@ -5002,7 +5002,7 @@ function Ul() {
5002
5002
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
5003
5003
  /* @__PURE__ */ e.jsx(R, { children: "Map Object" }),
5004
5004
  /* @__PURE__ */ e.jsx(
5005
- me,
5005
+ ue,
5006
5006
  {
5007
5007
  className: "h-9",
5008
5008
  options: i,
@@ -5024,7 +5024,7 @@ function Ul() {
5024
5024
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
5025
5025
  /* @__PURE__ */ e.jsx(R, { children: "Projection" }),
5026
5026
  /* @__PURE__ */ e.jsx(
5027
- me,
5027
+ ue,
5028
5028
  {
5029
5029
  className: "h-9",
5030
5030
  options: $l,
@@ -5046,7 +5046,7 @@ function Ul() {
5046
5046
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
5047
5047
  /* @__PURE__ */ e.jsx(R, { children: "Colors" }),
5048
5048
  /* @__PURE__ */ e.jsx(
5049
- me,
5049
+ ue,
5050
5050
  {
5051
5051
  className: "h-9",
5052
5052
  options: Bl,
@@ -5067,7 +5067,7 @@ function Ul() {
5067
5067
  ] })
5068
5068
  ] })
5069
5069
  ] }) }),
5070
- /* @__PURE__ */ e.jsx(oe, { className: "my-4" }),
5070
+ /* @__PURE__ */ e.jsx(ge, { className: "my-4" }),
5071
5071
  /* @__PURE__ */ e.jsx(Ue, { className: "", summary: "Scale Options", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
5072
5072
  /* @__PURE__ */ e.jsx(
5073
5073
  le,
@@ -5075,7 +5075,7 @@ function Ul() {
5075
5075
  className: `h-9 w-full ${Pe}`,
5076
5076
  type: "number",
5077
5077
  step: 0.1,
5078
- value: ((F = (M = s.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : F.projectionScale) || 1,
5078
+ value: ((F = (D = s.preferences) == null ? void 0 : D.mapVisualOptions) == null ? void 0 : F.projectionScale) || 1,
5079
5079
  onChange: (f) => {
5080
5080
  var k;
5081
5081
  l({
@@ -5118,7 +5118,7 @@ function Ul() {
5118
5118
  className: `h-9 w-full ${Pe}`,
5119
5119
  type: "number",
5120
5120
  step: 10,
5121
- value: ((v = (h = (D = s.preferences) == null ? void 0 : D.mapVisualOptions) == null ? void 0 : h.projectionOffset) == null ? void 0 : v[1]) || 0,
5121
+ value: ((v = (h = (M = s.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : h.projectionOffset) == null ? void 0 : v[1]) || 0,
5122
5122
  onChange: (f) => {
5123
5123
  var k, L, H, P;
5124
5124
  l({
@@ -5135,8 +5135,8 @@ function Ul() {
5135
5135
  }
5136
5136
  )
5137
5137
  ] }) }),
5138
- /* @__PURE__ */ e.jsx(oe, { className: "my-4" }),
5139
- /* @__PURE__ */ e.jsx(Me, {})
5138
+ /* @__PURE__ */ e.jsx(ge, { className: "my-4" }),
5139
+ /* @__PURE__ */ e.jsx(De, {})
5140
5140
  ] });
5141
5141
  }
5142
5142
  function Gl() {
@@ -5176,7 +5176,8 @@ function ns({
5176
5176
  docContent: t,
5177
5177
  suffix: a = "Chart"
5178
5178
  }) {
5179
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Te, { defaultValue: ["item-2"], type: "multiple", children: [
5179
+ let n = "pie-chart";
5180
+ return s === "radar" && (n = "radar-chart"), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Te, { defaultValue: ["item-2"], type: "multiple", children: [
5180
5181
  /* @__PURE__ */ e.jsxs(B, { value: "item-1", children: [
5181
5182
  /* @__PURE__ */ e.jsx(U, { children: `${$s(s)} ${a}` }),
5182
5183
  /* @__PURE__ */ e.jsx(G, { children: t || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
@@ -5191,9 +5192,9 @@ function ns({
5191
5192
  "a",
5192
5193
  {
5193
5194
  target: "_blank",
5194
- onClick: (n) => n.stopPropagation(),
5195
+ onClick: (l) => l.stopPropagation(),
5195
5196
  className: "text-blue-700",
5196
- href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
5197
+ href: `https://docs.semaphor.cloud/concepts/visuals#${n}`,
5197
5198
  children: "example"
5198
5199
  }
5199
5200
  ),
@@ -5212,7 +5213,7 @@ function ns({
5212
5213
  !["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
5213
5214
  /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
5214
5215
  /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
5215
- /* @__PURE__ */ e.jsx(Me, {}),
5216
+ /* @__PURE__ */ e.jsx(De, {}),
5216
5217
  /* @__PURE__ */ e.jsx(Re, {})
5217
5218
  ] })
5218
5219
  ] })
@@ -5229,7 +5230,7 @@ function Ql() {
5229
5230
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
5230
5231
  /* @__PURE__ */ e.jsx(R, { children: "Sort" }),
5231
5232
  /* @__PURE__ */ e.jsx(
5232
- me,
5233
+ ue,
5233
5234
  {
5234
5235
  className: "h-8",
5235
5236
  label: "Sort Chart",
@@ -5292,7 +5293,7 @@ function Ql() {
5292
5293
  /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
5293
5294
  /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
5294
5295
  /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
5295
- /* @__PURE__ */ e.jsx(Me, {}),
5296
+ /* @__PURE__ */ e.jsx(De, {}),
5296
5297
  /* @__PURE__ */ e.jsx(Re, {})
5297
5298
  ] })
5298
5299
  ] })
@@ -5314,7 +5315,7 @@ function Jl({}) {
5314
5315
  /* @__PURE__ */ e.jsx(Te, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(B, { value: "item-3", children: [
5315
5316
  /* @__PURE__ */ e.jsx(U, { children: "Filters" }),
5316
5317
  /* @__PURE__ */ e.jsxs(G, { className: "space-y-4 px-2", children: [
5317
- /* @__PURE__ */ e.jsx(Me, {}),
5318
+ /* @__PURE__ */ e.jsx(De, {}),
5318
5319
  /* @__PURE__ */ e.jsx(Re, {})
5319
5320
  ] })
5320
5321
  ] }) }),
@@ -5525,7 +5526,7 @@ function ar() {
5525
5526
  const { modelItems: n, columns: l } = qe(), { assignFilter: o } = Xa();
5526
5527
  return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: l == null ? void 0 : l.map((i) => {
5527
5528
  const c = a == null ? void 0 : a.find(
5528
- (d) => d.column === ue(i.column_name) && d.table === t && d.database === s
5529
+ (d) => d.column === de(i.column_name) && d.table === t && d.database === s
5529
5530
  );
5530
5531
  return /* @__PURE__ */ e.jsx(
5531
5532
  "div",
@@ -5664,13 +5665,13 @@ export {
5664
5665
  Ia as E,
5665
5666
  La as F,
5666
5667
  Tn as G,
5667
- Mn as H,
5668
+ Dn as H,
5668
5669
  En as I,
5669
5670
  Wn as J,
5670
5671
  An as L,
5671
5672
  Ta as M,
5672
5673
  _n as N,
5673
- Ma as P,
5674
+ Da as P,
5674
5675
  Pn as S,
5675
5676
  Qn as T,
5676
5677
  Kn as U,
@@ -5685,7 +5686,7 @@ export {
5685
5686
  zn as i,
5686
5687
  In as j,
5687
5688
  Fn as k,
5688
- Dn as l,
5689
+ Mn as l,
5689
5690
  Ln as m,
5690
5691
  Vn as n,
5691
5692
  qn as o,
@@ -5693,7 +5694,7 @@ export {
5693
5694
  Rn as q,
5694
5695
  Hn as r,
5695
5696
  $n as s,
5696
- Da as t,
5697
+ Ma as t,
5697
5698
  Bn as u,
5698
5699
  Un as v,
5699
5700
  Gn as w,