react-semaphor 0.0.197 → 0.0.198

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,12 +1,12 @@
1
- import { P as E, b as k, j as e, Q as ps, R as fs, U as w, V as Ks, W as gs, X as js, Y as bs, Z as ys, _ 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 vs, e as Js, g as Ns, 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 Cs, 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 Ss, z as Wa, n as Es, ar as ds, A as hs, 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 ms, aI as nt, aJ as Re, aK as us, aL as Fe, aM as xs, aN as Ls, aO as rt, aP as lt, 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 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 is, b5 as zt, b6 as os, b7 as Vs, K as Ft, b8 as ks, 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 ws, 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-K0c-JSZa.js";
2
- import me, { useState as T, useEffect as P, useMemo as Ut, useRef as $e } from "react";
1
+ import { P as E, b as k, j as e, Q as ps, R as fs, U as w, V as Gs, W as gs, X as js, Y as bs, Z as ys, _ as B, $ as ae, a0 as Js, J as Qs, O as Ee, a1 as qa, a2 as Ra, a3 as _a, a4 as Ha, a5 as Ba, a6 as $a, a7 as Ls, a8 as He, a9 as Ke, aa as Xe, T as vs, e as Ws, g as Ns, ab as Oe, ac as Me, f as Y, ad as Te, ae as Ae, af as Be, ag as Le, ah as X, ai as Cs, G as i, aj as Ue, ak as Ge, al as Pa, am as Je, w as Ys, v as Xs, t as he, an as Ka, r as Ua, N as Zs, s as Ga, ao as Ja, B as Qa, ap as ea, aq as Wa, L as $e, S as Ss, z as Ya, n as Ds, ar as ds, A as hs, u as ss, as as Ce, at as ze, au as sa, av as aa, aw as ta, ax as na, ay as ra, az as Xa, aA as Za, aB as la, aC as et, aD as st, aE as at, aF as tt, aG as nt, aH as ms, aI as rt, aJ as _e, aK as us, aL as Fe, aM as xs, aN as Is, aO as lt, aP as it, aQ as ot, aR as ct, aS as dt, aT as is, aU as ht, aV as Vs, aW as mt, aX as qs, aY as ut, aZ as xt, a_ as pt, a$ as ia, l as ft, C as gt, E as Rs, d as jt, h as bt, i as yt, o as vt, b0 as Nt, m as Ct, H as St, b1 as kt, b2 as wt, b3 as zt, b4 as os, b5 as Ft, b6 as cs, b7 as _s, K as Ot, b8 as Mt, b9 as ks, ba as Tt, bb as ws, bc as De, bd as oa, be as At, bf as Et, bg as Lt, bh as Dt, bi as It, bj as Vt, bk as Se, bl as q, bm as R, bn as zs, bo as _, bp as Hs, bq as qt, br as Rt, bs as _t, bt as Ht, bu as Bs, bv as Bt, bw as $t, bx as Pt, by as Kt, bz as Ut, bA as Gt } from "./index-ZPzRMi0w.js";
2
+ import me, { useState as T, useEffect as P, useMemo as Jt, useRef as Pe } from "react";
3
3
  /**
4
4
  * @license lucide-react v0.379.0 - ISC
5
5
  *
6
6
  * This source code is licensed under the ISC license.
7
7
  * See the LICENSE file in the root directory of this source tree.
8
8
  */
9
- const Gt = E("Activity", [
9
+ const Qt = E("Activity", [
10
10
  [
11
11
  "path",
12
12
  {
@@ -21,7 +21,7 @@ const Gt = E("Activity", [
21
21
  * This source code is licensed under the ISC license.
22
22
  * See the LICENSE file in the root directory of this source tree.
23
23
  */
24
- const Jt = E("AreaChart", [
24
+ const Wt = E("AreaChart", [
25
25
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
26
26
  ["path", { d: "M7 12v5h12V8l-5 5-4-4Z", key: "zxz28u" }]
27
27
  ]);
@@ -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 zs = E("BarChart4", [
34
+ const Fs = 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" }],
@@ -43,7 +43,7 @@ const zs = E("BarChart4", [
43
43
  * This source code is licensed under the ISC license.
44
44
  * See the LICENSE file in the root directory of this source tree.
45
45
  */
46
- const Qt = E("CircleX", [
46
+ const Yt = E("CircleX", [
47
47
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
48
48
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
49
49
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -54,7 +54,7 @@ const Qt = E("CircleX", [
54
54
  * This source code is licensed under the ISC license.
55
55
  * See the LICENSE file in the root directory of this source tree.
56
56
  */
57
- const Wt = E("Database", [
57
+ const Xt = E("Database", [
58
58
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
59
59
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
60
60
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
@@ -65,7 +65,7 @@ const Wt = E("Database", [
65
65
  * This source code is licensed under the ISC license.
66
66
  * See the LICENSE file in the root directory of this source tree.
67
67
  */
68
- const Yt = E("Eraser", [
68
+ const Zt = E("Eraser", [
69
69
  [
70
70
  "path",
71
71
  {
@@ -82,7 +82,7 @@ const Yt = E("Eraser", [
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
84
  */
85
- const oa = E("Filter", [
85
+ const ca = E("Filter", [
86
86
  ["polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3", key: "1yg77f" }]
87
87
  ]);
88
88
  /**
@@ -91,7 +91,7 @@ const oa = E("Filter", [
91
91
  * This source code is licensed under the ISC license.
92
92
  * See the LICENSE file in the root directory of this source tree.
93
93
  */
94
- const ca = E("GanttChart", [
94
+ const da = E("GanttChart", [
95
95
  ["path", { d: "M8 6h10", key: "9lnwnk" }],
96
96
  ["path", { d: "M6 12h9", key: "1g9pqf" }],
97
97
  ["path", { d: "M11 18h7", key: "c8dzvl" }]
@@ -102,7 +102,7 @@ const ca = E("GanttChart", [
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
104
  */
105
- const Xt = E("Glasses", [
105
+ const en = E("Glasses", [
106
106
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
107
107
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
108
108
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -115,7 +115,7 @@ const Xt = E("Glasses", [
115
115
  * This source code is licensed under the ISC license.
116
116
  * See the LICENSE file in the root directory of this source tree.
117
117
  */
118
- const Zt = E("Hammer", [
118
+ const sn = E("Hammer", [
119
119
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
120
120
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
121
121
  [
@@ -132,7 +132,7 @@ const Zt = E("Hammer", [
132
132
  * This source code is licensed under the ISC license.
133
133
  * See the LICENSE file in the root directory of this source tree.
134
134
  */
135
- const en = E("Hash", [
135
+ const an = E("Hash", [
136
136
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
137
137
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
138
138
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -144,7 +144,7 @@ const en = E("Hash", [
144
144
  * This source code is licensed under the ISC license.
145
145
  * See the LICENSE file in the root directory of this source tree.
146
146
  */
147
- const sn = E("Key", [
147
+ const tn = E("Key", [
148
148
  ["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
149
149
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
150
150
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
@@ -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 Fs = E("LineChart", [
158
+ const Os = 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
  ]);
@@ -165,7 +165,7 @@ const Fs = E("LineChart", [
165
165
  * This source code is licensed under the ISC license.
166
166
  * See the LICENSE file in the root directory of this source tree.
167
167
  */
168
- const an = E("ListEnd", [
168
+ const nn = E("ListEnd", [
169
169
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
170
170
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
171
171
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -178,7 +178,7 @@ const an = E("ListEnd", [
178
178
  * This source code is licensed under the ISC license.
179
179
  * See the LICENSE file in the root directory of this source tree.
180
180
  */
181
- const tn = E("ListStart", [
181
+ const rn = E("ListStart", [
182
182
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
183
183
  ["path", { d: "M16 18H3", key: "12xzn7" }],
184
184
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -191,7 +191,7 @@ const tn = E("ListStart", [
191
191
  * This source code is licensed under the ISC license.
192
192
  * See the LICENSE file in the root directory of this source tree.
193
193
  */
194
- const nn = E("ListX", [
194
+ const ln = E("ListX", [
195
195
  ["path", { d: "M11 12H3", key: "51ecnj" }],
196
196
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
197
197
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -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 rn = E("MessageSquareMore", [
207
+ const on = 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 rn = 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 ln = E("Network", [
219
+ const cn = 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" }],
@@ -229,7 +229,7 @@ const ln = E("Network", [
229
229
  * This source code is licensed under the ISC license.
230
230
  * See the LICENSE file in the root directory of this source tree.
231
231
  */
232
- const da = E("Pencil", [
232
+ const ha = E("Pencil", [
233
233
  ["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }],
234
234
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
235
235
  ]);
@@ -239,7 +239,7 @@ const da = E("Pencil", [
239
239
  * This source code is licensed under the ISC license.
240
240
  * See the LICENSE file in the root directory of this source tree.
241
241
  */
242
- const ha = E("PieChart", [
242
+ const ma = E("PieChart", [
243
243
  ["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }],
244
244
  ["path", { d: "M22 12A10 10 0 0 0 12 2v10z", key: "1rfc4y" }]
245
245
  ]);
@@ -249,7 +249,7 @@ const ha = E("PieChart", [
249
249
  * This source code is licensed under the ISC license.
250
250
  * See the LICENSE file in the root directory of this source tree.
251
251
  */
252
- const on = E("Play", [
252
+ const dn = E("Play", [
253
253
  ["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
254
254
  ]);
255
255
  /**
@@ -258,7 +258,7 @@ const on = E("Play", [
258
258
  * This source code is licensed under the ISC license.
259
259
  * See the LICENSE file in the root directory of this source tree.
260
260
  */
261
- const cn = E("Plug2", [
261
+ const hn = E("Plug2", [
262
262
  ["path", { d: "M9 2v6", key: "17ngun" }],
263
263
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
264
264
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -271,7 +271,7 @@ const cn = E("Plug2", [
271
271
  * This source code is licensed under the ISC license.
272
272
  * See the LICENSE file in the root directory of this source tree.
273
273
  */
274
- const dn = E("Save", [
274
+ const mn = E("Save", [
275
275
  [
276
276
  "path",
277
277
  {
@@ -288,7 +288,7 @@ const dn = E("Save", [
288
288
  * This source code is licensed under the ISC license.
289
289
  * See the LICENSE file in the root directory of this source tree.
290
290
  */
291
- const ma = E("ScatterChart", [
291
+ const ua = E("ScatterChart", [
292
292
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
293
293
  ["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
294
294
  ["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
@@ -302,7 +302,7 @@ const ma = E("ScatterChart", [
302
302
  * This source code is licensed under the ISC license.
303
303
  * See the LICENSE file in the root directory of this source tree.
304
304
  */
305
- const hn = E("ShieldQuestion", [
305
+ const un = E("ShieldQuestion", [
306
306
  [
307
307
  "path",
308
308
  {
@@ -319,7 +319,7 @@ const hn = E("ShieldQuestion", [
319
319
  * This source code is licensed under the ISC license.
320
320
  * See the LICENSE file in the root directory of this source tree.
321
321
  */
322
- const mn = E("Sigma", [
322
+ const xn = E("Sigma", [
323
323
  ["path", { d: "M18 7V4H6l6 8-6 8h12v-3", key: "zis8ev" }]
324
324
  ]);
325
325
  /**
@@ -328,7 +328,7 @@ const mn = E("Sigma", [
328
328
  * This source code is licensed under the ISC license.
329
329
  * See the LICENSE file in the root directory of this source tree.
330
330
  */
331
- const un = E("SwatchBook", [
331
+ const pn = E("SwatchBook", [
332
332
  ["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
333
333
  ["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
334
334
  ["path", { d: "M 7 17h0.01", key: "10821z" }],
@@ -346,7 +346,7 @@ const un = E("SwatchBook", [
346
346
  * This source code is licensed under the ISC license.
347
347
  * See the LICENSE file in the root directory of this source tree.
348
348
  */
349
- const xn = E("Tag", [
349
+ const fn = E("Tag", [
350
350
  [
351
351
  "path",
352
352
  {
@@ -362,7 +362,7 @@ const xn = E("Tag", [
362
362
  * This source code is licensed under the ISC license.
363
363
  * See the LICENSE file in the root directory of this source tree.
364
364
  */
365
- const pn = E("ToggleLeft", [
365
+ const gn = E("ToggleLeft", [
366
366
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
367
367
  ["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
368
368
  ]);
@@ -372,7 +372,7 @@ const pn = E("ToggleLeft", [
372
372
  * This source code is licensed under the ISC license.
373
373
  * See the LICENSE file in the root directory of this source tree.
374
374
  */
375
- const fn = E("Type", [
375
+ const Ms = E("Type", [
376
376
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
377
377
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
378
378
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
@@ -383,14 +383,14 @@ const fn = E("Type", [
383
383
  * This source code is licensed under the ISC license.
384
384
  * See the LICENSE file in the root directory of this source tree.
385
385
  */
386
- const gn = E("User", [
386
+ const jn = E("User", [
387
387
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
388
388
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
389
389
  ]);
390
- function jn() {
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) || "[]");
390
+ function bn() {
391
+ const [s, n] = T(""), [a, t] = T(!1), [l, o] = T(!1), d = k((c) => c.dashboard);
392
+ function r() {
393
+ const c = Qs(d), f = Ee(d.id), m = JSON.parse(localStorage.getItem(f) || "[]");
394
394
  if (m.some(
395
395
  (S) => S.name === s
396
396
  )) {
@@ -399,10 +399,10 @@ function jn() {
399
399
  }
400
400
  m.push({
401
401
  name: s,
402
- template: d
403
- }), localStorage.setItem(f, JSON.stringify(m)), c(!1);
402
+ template: c
403
+ }), localStorage.setItem(f, JSON.stringify(m)), o(!1);
404
404
  }
405
- return /* @__PURE__ */ e.jsxs(ps, { open: o, onOpenChange: c, children: [
405
+ return /* @__PURE__ */ e.jsxs(ps, { open: l, onOpenChange: o, children: [
406
406
  /* @__PURE__ */ e.jsx(fs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
407
407
  w,
408
408
  {
@@ -410,7 +410,7 @@ function jn() {
410
410
  className: "h-7 p-2",
411
411
  size: "sm",
412
412
  children: [
413
- /* @__PURE__ */ e.jsx(Ks, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
413
+ /* @__PURE__ */ e.jsx(Gs, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
414
414
  "Add Lens"
415
415
  ]
416
416
  }
@@ -426,8 +426,8 @@ function jn() {
426
426
  ae,
427
427
  {
428
428
  value: s,
429
- onChange: (d) => {
430
- a && t(!1), n(d.target.value);
429
+ onChange: (c) => {
430
+ a && t(!1), n(c.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"
@@ -435,67 +435,67 @@ function jn() {
435
435
  )
436
436
  ] }) }),
437
437
  a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The bookmark name already exists. Use a differnet name." }),
438
- /* @__PURE__ */ e.jsx(Us, { children: /* @__PURE__ */ e.jsx(
438
+ /* @__PURE__ */ e.jsx(Js, { children: /* @__PURE__ */ e.jsx(
439
439
  w,
440
440
  {
441
441
  variant: "outline",
442
442
  type: "submit",
443
443
  disabled: !s,
444
- onClick: l,
444
+ onClick: r,
445
445
  children: "Save"
446
446
  }
447
447
  ) })
448
448
  ] })
449
449
  ] });
450
450
  }
451
- function bn() {
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(
451
+ function yn() {
452
+ const [s, n] = T(!1), [a, t] = T(""), l = k((h) => h.dashboard), o = k((h) => h.bookmarkKey), [d, r] = T([]), c = k((h) => h.actions.setDashboard), f = k(
453
453
  (h) => h.actions.setFilterValues
454
454
  ), m = k(
455
455
  (h) => h.actions.setBookmarkKey
456
456
  );
457
457
  P(() => {
458
- const h = Ee(o.id), x = JSON.parse(localStorage.getItem(h) || "[]");
459
- l(x);
458
+ const h = Ee(l.id), x = JSON.parse(localStorage.getItem(h) || "[]");
459
+ r(x);
460
460
  const g = x.find(
461
461
  (z) => z.default
462
462
  );
463
- g && g.name === c && t(g.name);
464
- }, [s, o, c]);
463
+ g && g.name === o && t(g.name);
464
+ }, [s, l, o]);
465
465
  function u(h) {
466
466
  if (h === a)
467
467
  return;
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);
468
+ const x = d.find((z) => z.name === h), g = x == null ? void 0 : x.template;
469
+ g && (c(g), f(x.filterValues || []), m(h === "Original" ? "" : h)), t(h);
470
470
  }
471
471
  function S(h) {
472
- const x = Ee(o.id), z = JSON.parse(localStorage.getItem(x) || "[]").filter(
472
+ const x = Ee(l.id), z = JSON.parse(localStorage.getItem(x) || "[]").filter(
473
473
  (b) => b.name !== h
474
474
  );
475
- localStorage.setItem(x, JSON.stringify(z)), l(z);
475
+ localStorage.setItem(x, JSON.stringify(z)), r(z);
476
476
  }
477
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
- /* @__PURE__ */ e.jsxs(Ra, { className: "w-56", children: [
480
- /* @__PURE__ */ e.jsx(_a, { children: "Lenses" }),
481
- /* @__PURE__ */ e.jsx(Ha, {}),
478
+ /* @__PURE__ */ e.jsx(Ra, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(en, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
479
+ /* @__PURE__ */ e.jsxs(_a, { className: "w-56", children: [
480
+ /* @__PURE__ */ e.jsx(Ha, { children: "Lenses" }),
481
+ /* @__PURE__ */ e.jsx(Ba, {}),
482
482
  /* @__PURE__ */ e.jsxs(
483
- Ba,
483
+ $a,
484
484
  {
485
485
  value: a,
486
486
  onValueChange: u,
487
487
  children: [
488
- /* @__PURE__ */ e.jsx(As, { value: "Original", children: "Original" }),
489
- r.filter((h) => h.name != "Original").map((h, x) => /* @__PURE__ */ e.jsxs(
490
- As,
488
+ /* @__PURE__ */ e.jsx(Ls, { value: "Original", children: "Original" }),
489
+ d.filter((h) => h.name != "Original").map((h, x) => /* @__PURE__ */ e.jsxs(
490
+ Ls,
491
491
  {
492
492
  className: "xbg-red-100 flex justify-between",
493
493
  value: h.name,
494
- defaultChecked: h.name === c,
494
+ defaultChecked: h.name === o,
495
495
  children: [
496
496
  /* @__PURE__ */ e.jsx("p", { children: h.name }),
497
497
  /* @__PURE__ */ e.jsx(
498
- _e,
498
+ He,
499
499
  {
500
500
  onClick: (g) => {
501
501
  g.preventDefault(), S(h.name);
@@ -514,34 +514,34 @@ function bn() {
514
514
  ] })
515
515
  ] });
516
516
  }
517
- function yn() {
518
- const [s, n] = T(!1), a = k((c) => c.dashboard), t = k((c) => c.bookmarkKey);
517
+ function vn() {
518
+ const [s, n] = T(!1), a = k((o) => o.dashboard), t = k((o) => o.bookmarkKey);
519
519
  P(() => {
520
520
  if (!t) {
521
521
  n(!1);
522
522
  return;
523
523
  }
524
- const c = Ee(a.id), l = JSON.parse(
525
- localStorage.getItem(c) || "[]"
524
+ const o = Ee(a.id), r = JSON.parse(
525
+ localStorage.getItem(o) || "[]"
526
526
  ).find(
527
- (d) => d.name === t
527
+ (c) => c.name === t
528
528
  );
529
- n(l ? l.default : !1);
529
+ n(r ? r.default : !1);
530
530
  }, [t, a.id]);
531
- function o(c) {
532
- if (n(c), !t)
531
+ function l(o) {
532
+ if (n(o), !t)
533
533
  return;
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));
534
+ const d = Ee(a.id), c = JSON.parse(
535
+ localStorage.getItem(d) || "[]"
536
+ ).map((f) => (f.name === t ? f.default = o : f.default = !1, f));
537
+ console.log(c), localStorage.setItem(d, JSON.stringify(c));
538
538
  }
539
539
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
540
540
  /* @__PURE__ */ e.jsx(
541
- Pe,
541
+ Ke,
542
542
  {
543
543
  checked: s,
544
- onCheckedChange: o,
544
+ onCheckedChange: l,
545
545
  id: "terms"
546
546
  }
547
547
  ),
@@ -555,24 +555,24 @@ function yn() {
555
555
  )
556
556
  ] });
557
557
  }
558
- function vn() {
558
+ function Nn() {
559
559
  const s = k((b) => b.bookmarkKey), n = k((b) => b.dashboard);
560
560
  k((b) => b.selectedSheetId);
561
561
  const a = k(
562
562
  (b) => b.isDashboardEditing
563
- ), t = k((b) => b.filterValues), o = k((b) => b.isVisualEditing), c = k((b) => b.showFilters);
563
+ ), t = k((b) => b.filterValues), l = k((b) => b.isVisualEditing), o = k((b) => b.showFilters);
564
564
  k(
565
565
  (b) => b.showDashboardJSON
566
566
  );
567
- const r = k((b) => b.onSaveFunction), l = k(
567
+ const d = k((b) => b.onSaveFunction), r = k(
568
568
  (b) => b.actions.setShowFilters
569
- ), { addFrame: d, setSelectedFrameId: f } = k(
569
+ ), { addFrame: c, setSelectedFrameId: f } = k(
570
570
  (b) => b.actions
571
571
  ), { getSelectedSheet: m, setIsDashboardEditing: u, setShowDashboardJSON: S } = k((b) => b.actions), h = m(), x = () => {
572
572
  if (!a || !h)
573
573
  return;
574
574
  const b = {
575
- id: We(),
575
+ id: Xe(),
576
576
  title: "Title",
577
577
  description: "Description",
578
578
  preferences: {
@@ -587,18 +587,18 @@ function vn() {
587
587
  sql: "select COUNT(*) from YOUR_TABLE",
588
588
  data: []
589
589
  }, L = {
590
- id: We(),
590
+ id: Xe(),
591
591
  cards: [b],
592
592
  activeCardId: b.id
593
593
  };
594
- d(h.id, L), f(L.id);
594
+ c(h.id, L), f(L.id);
595
595
  }, g = () => {
596
596
  u(!0);
597
597
  };
598
598
  function z() {
599
599
  if (!s || s === "")
600
600
  return;
601
- const b = Gs(n), L = Ee(n.id), N = JSON.parse(localStorage.getItem(L) || "[]"), O = N.findIndex(
601
+ const b = Qs(n), L = Ee(n.id), N = JSON.parse(localStorage.getItem(L) || "[]"), O = N.findIndex(
602
602
  (j) => j.name === s
603
603
  );
604
604
  O !== -1 ? N[O] = {
@@ -610,25 +610,25 @@ function vn() {
610
610
  name: s,
611
611
  template: b,
612
612
  filterValues: t
613
- }), localStorage.setItem(L, JSON.stringify(N)), r == null || r(b);
613
+ }), localStorage.setItem(L, JSON.stringify(N)), d == null || d(b);
614
614
  }
615
- return o ? null : /* @__PURE__ */ e.jsxs(
615
+ return l ? 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
- !o && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
621
+ !l && /* @__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: "|" }),
625
- /* @__PURE__ */ e.jsx(yn, {})
625
+ /* @__PURE__ */ e.jsx(vn, {})
626
626
  ] })
627
627
  ] }),
628
628
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
629
- a && !o && /* @__PURE__ */ e.jsx(jn, {}),
630
- !o && /* @__PURE__ */ e.jsx(bn, {}),
631
- a && !o && /* @__PURE__ */ e.jsxs(
629
+ a && !l && /* @__PURE__ */ e.jsx(bn, {}),
630
+ !l && /* @__PURE__ */ e.jsx(yn, {}),
631
+ a && !l && /* @__PURE__ */ e.jsxs(
632
632
  w,
633
633
  {
634
634
  variant: "outline",
@@ -637,7 +637,7 @@ function vn() {
637
637
  disabled: !a,
638
638
  onClick: x,
639
639
  children: [
640
- /* @__PURE__ */ e.jsx(Ks, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
640
+ /* @__PURE__ */ e.jsx(Gs, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
641
641
  "Add Frame"
642
642
  ]
643
643
  }
@@ -649,10 +649,10 @@ function vn() {
649
649
  className: "h-7 p-2",
650
650
  onClick: g,
651
651
  size: "sm",
652
- children: /* @__PURE__ */ e.jsx(da, { className: "h-4 w-4", strokeWidth: 1.5 })
652
+ children: /* @__PURE__ */ e.jsx(ha, { className: "h-4 w-4", strokeWidth: 1.5 })
653
653
  }
654
654
  ),
655
- a && !o && /* @__PURE__ */ e.jsx(
655
+ a && !l && /* @__PURE__ */ e.jsx(
656
656
  w,
657
657
  {
658
658
  variant: "outline",
@@ -662,106 +662,106 @@ function vn() {
662
662
  u(!1), S(!1);
663
663
  },
664
664
  size: "sm",
665
- children: /* @__PURE__ */ e.jsx(_e, { className: "h-4 w-4", strokeWidth: 1.5 })
665
+ children: /* @__PURE__ */ e.jsx(He, { className: "h-4 w-4", strokeWidth: 1.5 })
666
666
  }
667
667
  ),
668
- a && !o && /* @__PURE__ */ e.jsx(
668
+ a && !l && /* @__PURE__ */ e.jsx(
669
669
  w,
670
670
  {
671
671
  className: "h-7 p-2",
672
672
  variant: "outline",
673
673
  onClick: z,
674
674
  size: "sm",
675
- children: /* @__PURE__ */ e.jsx(dn, { className: "h-4 w-4", strokeWidth: 1.5 })
675
+ children: /* @__PURE__ */ e.jsx(mn, { className: "h-4 w-4", strokeWidth: 1.5 })
676
676
  }
677
677
  ),
678
- !c && !o && a && /* @__PURE__ */ e.jsx(
678
+ !o && !l && a && /* @__PURE__ */ e.jsx(
679
679
  w,
680
680
  {
681
681
  className: "h-7 p-2",
682
682
  variant: "outline",
683
- onClick: () => l(!0),
683
+ onClick: () => r(!0),
684
684
  size: "sm",
685
- children: /* @__PURE__ */ e.jsx(oa, { className: "h-4 w-4", strokeWidth: 1.5 })
685
+ children: /* @__PURE__ */ e.jsx(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
686
686
  }
687
687
  ),
688
- !o && a && !1,
689
- !o && !1
688
+ !l && a && !1,
689
+ !l && !1
690
690
  ] })
691
691
  ]
692
692
  }
693
693
  );
694
694
  }
695
- function Qe({
695
+ function We({
696
696
  title: s,
697
697
  items: n,
698
698
  value: a,
699
699
  isLoading: t,
700
- isError: o,
701
- connectionTooltip: c,
702
- onChange: r,
703
- className: l,
704
- showIcon: d = !0,
700
+ isError: l,
701
+ connectionTooltip: o,
702
+ onChange: d,
703
+ className: r,
704
+ showIcon: c = !0,
705
705
  disabled: f = !1
706
706
  }) {
707
- const m = t ? "Loading..." : o ? "Error" : a;
707
+ const m = t ? "Loading..." : l ? "Error" : a;
708
708
  function u() {
709
709
  if (s === "Connection")
710
- return /* @__PURE__ */ e.jsx(cn, { className: "size-4 rotate-90" });
710
+ return /* @__PURE__ */ e.jsx(hn, { className: "size-4 rotate-90" });
711
711
  if (s === "Database")
712
- return /* @__PURE__ */ e.jsx(Wt, { className: "size-4" });
712
+ return /* @__PURE__ */ e.jsx(Xt, { className: "size-4" });
713
713
  if (s === "Schema")
714
- return /* @__PURE__ */ e.jsx(ln, { className: "size-4" });
714
+ return /* @__PURE__ */ e.jsx(cn, { className: "size-4" });
715
715
  if (s === "Table")
716
716
  return /* @__PURE__ */ e.jsx(Cs, { className: "size-4" });
717
717
  }
718
718
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
719
- d && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: c ? /* @__PURE__ */ e.jsxs(vs, { children: [
720
- /* @__PURE__ */ e.jsx(Js, { children: u() }),
721
- /* @__PURE__ */ e.jsx(Ns, { className: "text-xs", align: "start", children: c })
719
+ c && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(vs, { children: [
720
+ /* @__PURE__ */ e.jsx(Ws, { children: u() }),
721
+ /* @__PURE__ */ e.jsx(Ns, { className: "text-xs", align: "start", children: o })
722
722
  ] }) : u() }),
723
- /* @__PURE__ */ e.jsxs(Oe, { disabled: f, value: m, onValueChange: r, children: [
723
+ /* @__PURE__ */ e.jsxs(Oe, { disabled: f, value: m, onValueChange: d, children: [
724
724
  /* @__PURE__ */ e.jsx(
725
725
  Me,
726
726
  {
727
727
  className: Y(
728
728
  "h-9 w-full focus:ring-1 focus:ring-offset-0",
729
- l
729
+ r
730
730
  ),
731
731
  children: /* @__PURE__ */ e.jsx(
732
732
  Te,
733
733
  {
734
- placeholder: t ? "Loading..." : o ? "Error" : `Select ${s}`
734
+ placeholder: t ? "Loading..." : l ? "Error" : `Select ${s}`
735
735
  }
736
736
  )
737
737
  }
738
738
  ),
739
- /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
739
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(Be, { children: [
740
740
  t ? /* @__PURE__ */ e.jsx(Le, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Le, { children: s }),
741
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 })
742
+ (t || l) && /* @__PURE__ */ e.jsx(X, { value: m, children: m })
743
743
  ] }) })
744
744
  ] })
745
745
  ] });
746
746
  }
747
- function Nn({ column: s }) {
748
- const [n, a] = T(!1), t = i((m) => m.selectedTableName), o = i(
747
+ function Cn({ column: s }) {
748
+ const [n, a] = T(!1), t = i((m) => m.selectedTableName), l = i(
749
749
  (m) => m.selectedSchemaName
750
- ), c = i((m) => m.sqlGen), r = i((m) => m.actions.setSqlGen), l = i((m) => m.actions.setCardSql), d = i((m) => m.actions.setRunSql);
750
+ ), o = i((m) => m.sqlGen), d = i((m) => m.actions.setSqlGen), r = i((m) => m.actions.setCardSql), c = i((m) => m.actions.setRunSql);
751
751
  function f(m, u) {
752
- const S = Qs(m, c, u);
753
- r(S);
754
- const h = Ws(
752
+ const S = Ys(m, o, u);
753
+ d(S);
754
+ const h = Xs(
755
755
  S,
756
- he(o || ""),
756
+ he(l || ""),
757
757
  he(t)
758
758
  );
759
- h && (l(h), d(!0)), a(!1);
759
+ h && (r(h), c(!0)), a(!1);
760
760
  }
761
- return /* @__PURE__ */ e.jsxs(Ke, { open: n, onOpenChange: a, children: [
762
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx($a, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
761
+ return /* @__PURE__ */ e.jsxs(Ue, { open: n, onOpenChange: a, children: [
762
+ /* @__PURE__ */ e.jsx(Ge, { asChild: !0, children: /* @__PURE__ */ e.jsx(Pa, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
763
763
  /* @__PURE__ */ e.jsx(
764
- Ge,
764
+ Je,
765
765
  {
766
766
  align: "center",
767
767
  className: "w-18 rounded-md p-0 shadow-none",
@@ -811,69 +811,69 @@ function Nn({ column: s }) {
811
811
  )
812
812
  ] });
813
813
  }
814
- function ua({ column: s }) {
814
+ function xa({ column: s }) {
815
815
  return /* @__PURE__ */ e.jsxs(vs, { children: [
816
- /* @__PURE__ */ e.jsx(Pa, { asChild: !0, children: Ka.includes(s.data_type.toLowerCase()) ? (
816
+ /* @__PURE__ */ e.jsx(Ka, { asChild: !0, children: Ua.includes(s.data_type.toLowerCase()) ? (
817
817
  // <span className=" font-thin">T</span>
818
- /* @__PURE__ */ e.jsx(fn, { className: "size-3" })
819
- ) : Ys.includes(s.data_type.toLowerCase()) ? (
818
+ /* @__PURE__ */ e.jsx(Ms, { className: "size-3" })
819
+ ) : Zs.includes(s.data_type.toLowerCase()) ? (
820
820
  //
821
- /* @__PURE__ */ e.jsx(en, { className: "size-3" })
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" }) }),
821
+ /* @__PURE__ */ e.jsx(an, { className: "size-3" })
822
+ ) : Ga.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Ja, { className: "size-3" }) : Qa.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(gn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(un, { className: "size-3" }) }),
823
823
  /* @__PURE__ */ e.jsx(Ns, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
824
824
  ] });
825
825
  }
826
- function Cn({
826
+ function Sn({
827
827
  schemaName: s,
828
828
  tableName: n,
829
829
  columns: a,
830
830
  status: t
831
831
  }) {
832
- const o = i((j) => j.sqlGen), c = i(
832
+ const l = i((j) => j.sqlGen), o = i(
833
833
  (j) => j.selectedConnectionId
834
- ), r = i(
834
+ ), d = i(
835
835
  (j) => j.selectedDatabaseName
836
- ), l = i(
836
+ ), r = i(
837
837
  (j) => j.selectedSchemaName
838
- ), d = i((j) => j.selectedTableName), f = k(
838
+ ), c = i((j) => j.selectedTableName), f = k(
839
839
  (j) => j.dashboard.aiScopeTables
840
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 = i((j) => j.actions.setCardSql), { connectionType: g } = xa();
842
+ ), x = i((j) => j.actions.setCardSql), { connectionType: g } = pa();
843
843
  function z(j) {
844
- const F = Qs(j, o);
844
+ const F = Ys(j, l);
845
845
  S(F);
846
- const A = Ws(F, he(s), he(n));
846
+ const A = Xs(F, he(s), he(n));
847
847
  A && (x(A), u(!0));
848
848
  }
849
849
  function b() {
850
850
  return (f == null ? void 0 : f.find(
851
- (j) => j.connectinonId === c && j.tableName === d
851
+ (j) => j.connectinonId === o && j.tableName === c
852
852
  )) !== void 0;
853
853
  }
854
854
  function L(j) {
855
- if (j === !0 && d && c) {
855
+ if (j === !0 && c && o) {
856
856
  const F = {
857
- connectinonId: c,
857
+ connectinonId: o,
858
858
  connectionType: g,
859
- databaseName: r,
860
- schemaName: l,
861
- tableName: d
862
- }, q = [...f || [], F].filter(
859
+ databaseName: d,
860
+ schemaName: r,
861
+ tableName: c
862
+ }, V = [...f || [], F].filter(
863
863
  (K, $, G) => G.findIndex(
864
864
  (D) => D.connectinonId === K.connectinonId && D.tableName === K.tableName
865
865
  ) === $
866
866
  );
867
- m(q), ds.success(`Added '${d}' to AI Scope`, {
867
+ m(V), ds.success(`Added '${c}' to AI Scope`, {
868
868
  position: "top-right",
869
869
  duration: 2500,
870
870
  richColors: !0
871
871
  });
872
872
  } else {
873
873
  const F = (f || []).filter(
874
- (A) => A.connectinonId !== c && A.tableName !== d
874
+ (A) => A.connectinonId !== o && A.tableName !== c
875
875
  );
876
- m(F), ds(`Removed '${d}' from AI Scope`, {
876
+ m(F), ds(`Removed '${c}' from AI Scope`, {
877
877
  position: "top-right",
878
878
  duration: 2e3,
879
879
  richColors: !0
@@ -883,17 +883,17 @@ function Cn({
883
883
  function N() {
884
884
  let F = hs(s, n);
885
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
+ const V = g === "MSSQL" ? `SELECT top 10 * FROM ${F}` : `SELECT * FROM ${F} LIMIT 10`;
887
+ x(V), u(!0);
888
888
  }
889
889
  function O() {
890
890
  let F = hs(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);
891
+ ((V) => V.charAt(0) === V.charAt(0).toUpperCase())(n) && (F = `"${n}"`), h(!1), x(`SELECT COUNT(*) as count FROM ${F}`), u(!0);
892
892
  }
893
893
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
894
894
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
895
895
  /* @__PURE__ */ e.jsx(
896
- Xs,
896
+ ea,
897
897
  {
898
898
  title: `${b() ? "Remove from" : "Add to"} AI Scope`,
899
899
  pressed: b(),
@@ -901,7 +901,7 @@ function Cn({
901
901
  variant: "outline",
902
902
  className: "h-9 px-2",
903
903
  children: /* @__PURE__ */ e.jsx(
904
- Qa,
904
+ Wa,
905
905
  {
906
906
  className: Y("size-4", {
907
907
  "text-primary": b(),
@@ -920,7 +920,7 @@ function Cn({
920
920
  variant: "secondary",
921
921
  className: "flex",
922
922
  children: [
923
- t !== "Success" ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(un, { className: "mr-2 size-4" }),
923
+ t !== "Success" ? /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(pn, { className: "mr-2 size-4" }),
924
924
  "Top 10"
925
925
  ]
926
926
  }
@@ -934,7 +934,7 @@ function Cn({
934
934
  variant: "secondary",
935
935
  className: "flex",
936
936
  children: [
937
- t !== "Success" ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(mn, { className: "mr-2 size-4" }),
937
+ t !== "Success" ? /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(xn, { className: "mr-2 size-4" }),
938
938
  "Count"
939
939
  ]
940
940
  }
@@ -952,43 +952,43 @@ function Cn({
952
952
  className: Y(
953
953
  "mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
954
954
  {
955
- "bg-muted": Wa(j, o)
955
+ "bg-muted": Ya(j, l)
956
956
  }
957
957
  ),
958
958
  children: [
959
959
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
960
- /* @__PURE__ */ e.jsx(ua, { column: j }),
960
+ /* @__PURE__ */ e.jsx(xa, { column: j }),
961
961
  /* @__PURE__ */ e.jsx("span", { children: j.column_name })
962
962
  ] }),
963
- Ys.includes(j.data_type) && /* @__PURE__ */ e.jsx(
963
+ Zs.includes(j.data_type) && /* @__PURE__ */ e.jsx(
964
964
  "div",
965
965
  {
966
966
  onClick: (F) => F.stopPropagation(),
967
967
  className: "flex items-center justify-end",
968
- children: /* @__PURE__ */ e.jsx(Nn, { column: j })
968
+ children: /* @__PURE__ */ e.jsx(Cn, { column: j })
969
969
  }
970
970
  )
971
971
  ]
972
972
  },
973
973
  j.column_name
974
974
  )),
975
- /* @__PURE__ */ e.jsx(Es, { orientation: "vertical" }),
976
- /* @__PURE__ */ e.jsx(Es, { orientation: "horizontal" })
975
+ /* @__PURE__ */ e.jsx(Ds, { orientation: "vertical" }),
976
+ /* @__PURE__ */ e.jsx(Ds, { orientation: "horizontal" })
977
977
  ]
978
978
  }
979
979
  )
980
980
  ] });
981
981
  }
982
- function xa(s, n) {
983
- var as, ve, Je, qe;
984
- let a = Ut(() => [], []);
985
- const t = es().authToken || s, o = i(
982
+ function pa(s, n) {
983
+ var ts, ve, Qe, qe;
984
+ let a = Jt(() => [], []);
985
+ const t = ss().authToken || s, l = i(
986
986
  (C) => C.selectedConnectionId
987
- ), c = i(
987
+ ), o = i(
988
988
  (C) => C.selectedDatabaseName
989
- ), r = i(
989
+ ), d = i(
990
990
  (C) => C.selectedSchemaName
991
- ), l = i((C) => C.selectedTableName), d = i(
991
+ ), r = i((C) => C.selectedTableName), c = i(
992
992
  (C) => C.actions.setCurrentColumns
993
993
  ), f = i(
994
994
  (C) => C.actions.setSelectedConnectionId
@@ -1000,13 +1000,13 @@ function xa(s, n) {
1000
1000
  (C) => C.actions.setSelectedTableName
1001
1001
  ), h = i((C) => C.actions.setCardSql);
1002
1002
  function x(C) {
1003
- return o && c && r && c !== "NA" ? !0 : o && C === "API" ? !1 : !!(o && C === "S3");
1003
+ return l && o && d && o !== "NA" ? !0 : l && C === "API" ? !1 : !!(l && C === "S3");
1004
1004
  }
1005
1005
  function g(C) {
1006
- return !!(o && c && c !== "NA" && r && l || o && (C === "S3" || C === "API"));
1006
+ return !!(l && o && o !== "NA" && d && r || l && (C === "S3" || C === "API"));
1007
1007
  }
1008
1008
  function z(C) {
1009
- return o && C ? !(C === "API" || C === "S3") : !1;
1009
+ return l && C ? !(C === "API" || C === "S3") : !1;
1010
1010
  }
1011
1011
  const {
1012
1012
  data: b,
@@ -1021,20 +1021,20 @@ function xa(s, n) {
1021
1021
  enabled: !!(t != null && t.accessToken)
1022
1022
  // Only fetch if authToken is present
1023
1023
  }), O = b == null ? void 0 : b.connections.find(
1024
- (C) => C.id === o
1024
+ (C) => C.id === l
1025
1025
  ), j = O == null ? void 0 : O.type, F = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
1026
1026
  data: A,
1027
- isLoading: q,
1027
+ isLoading: V,
1028
1028
  isFetching: K,
1029
1029
  isError: $,
1030
1030
  refetch: G
1031
1031
  } = Ce({
1032
- queryKey: ["databases", o],
1032
+ queryKey: ["databases", l],
1033
1033
  queryFn: () => ze(
1034
1034
  "https://semaphor.cloud/api/v1/databases",
1035
1035
  (t == null ? void 0 : t.accessToken) || "",
1036
1036
  {
1037
- connection_id: o
1037
+ connection_id: l
1038
1038
  }
1039
1039
  ),
1040
1040
  enabled: z(j)
@@ -1046,16 +1046,16 @@ function xa(s, n) {
1046
1046
  isError: ee,
1047
1047
  refetch: Z
1048
1048
  } = Ce({
1049
- queryKey: ["schemas", o, c],
1049
+ queryKey: ["schemas", l, o],
1050
1050
  queryFn: () => ze(
1051
1051
  "https://semaphor.cloud/api/v1/schemas",
1052
1052
  (t == null ? void 0 : t.accessToken) || "",
1053
1053
  {
1054
- connection_id: o,
1055
- database_name: c
1054
+ connection_id: l,
1055
+ database_name: o
1056
1056
  }
1057
1057
  ),
1058
- enabled: !!o && !!c && !F && c !== "NA"
1058
+ enabled: !!l && !!o && !F && o !== "NA"
1059
1059
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1060
1060
  }), {
1061
1061
  data: J,
@@ -1066,17 +1066,17 @@ function xa(s, n) {
1066
1066
  } = Ce({
1067
1067
  queryKey: [
1068
1068
  "tables",
1069
+ l,
1069
1070
  o,
1070
- c,
1071
- r
1071
+ d
1072
1072
  ],
1073
1073
  queryFn: () => ze(
1074
1074
  "https://semaphor.cloud/api/v1/tables",
1075
1075
  (t == null ? void 0 : t.accessToken) || "",
1076
1076
  {
1077
- connection_id: o,
1078
- database_name: c,
1079
- schema_name: r
1077
+ connection_id: l,
1078
+ database_name: o,
1079
+ schema_name: d
1080
1080
  }
1081
1081
  ),
1082
1082
  enabled: x(j)
@@ -1088,19 +1088,19 @@ function xa(s, n) {
1088
1088
  } = Ce({
1089
1089
  queryKey: [
1090
1090
  "columns",
1091
+ l,
1091
1092
  o,
1092
- c,
1093
- r,
1094
- l
1093
+ d,
1094
+ r
1095
1095
  ],
1096
1096
  queryFn: () => ze(
1097
1097
  "https://semaphor.cloud/api/v1/columns",
1098
1098
  (t == null ? void 0 : t.accessToken) || "",
1099
1099
  {
1100
- connection_id: o,
1101
- database_name: c,
1102
- schema_name: r,
1103
- table_name: l
1100
+ connection_id: l,
1101
+ database_name: o,
1102
+ schema_name: d,
1103
+ table_name: r
1104
1104
  }
1105
1105
  ),
1106
1106
  enabled: g(j)
@@ -1113,8 +1113,8 @@ function xa(s, n) {
1113
1113
  // && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
1114
1114
  });
1115
1115
  P(() => {
1116
- d(a);
1117
- }, [H, d, a]), P(() => {
1116
+ c(a);
1117
+ }, [H, c, a]), P(() => {
1118
1118
  }, [
1119
1119
  F,
1120
1120
  h,
@@ -1123,7 +1123,7 @@ function xa(s, n) {
1123
1123
  m,
1124
1124
  O
1125
1125
  ]);
1126
- const je = (O == null ? void 0 : O.type) === "API" ? (as = O == null ? void 0 : O.type) == null ? void 0 : as.toLowerCase() : l || "", be = F ? "" : r || "";
1126
+ const je = (O == null ? void 0 : O.type) === "API" ? (ts = O == null ? void 0 : O.type) == null ? void 0 : ts.toLowerCase() : r || "", be = F ? "" : d || "";
1127
1127
  function xe(C) {
1128
1128
  u(C), S("");
1129
1129
  }
@@ -1133,7 +1133,7 @@ function xa(s, n) {
1133
1133
  function ne(C) {
1134
1134
  f(C);
1135
1135
  }
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) => ({
1136
+ A && ((ve = A == null ? void 0 : A.databases) == null ? void 0 : ve.length) > 0, D && ((Qe = D == null ? void 0 : D.schemas) == null ? void 0 : Qe.length) > 0, H && ((qe = H == null ? void 0 : H.columns) == null ? void 0 : qe.length) > 0 && (a = H.columns.map((C) => ({
1137
1137
  ...C,
1138
1138
  data_type: C.data_type.toLowerCase()
1139
1139
  }))), $ && (a = []), (ge || N) && (a = []);
@@ -1149,7 +1149,7 @@ function xa(s, n) {
1149
1149
  })), le = D == null ? void 0 : D.schemas.map((C) => ({
1150
1150
  id: C.schema_name,
1151
1151
  name: C.schema_name
1152
- })), Ie = J == null ? void 0 : J.tables.map((C) => ({
1152
+ })), Ve = J == null ? void 0 : J.tables.map((C) => ({
1153
1153
  id: C.table_name,
1154
1154
  name: C.table_name
1155
1155
  }));
@@ -1158,12 +1158,12 @@ function xa(s, n) {
1158
1158
  isConnectionsLoading: L,
1159
1159
  isConnectionsError: N,
1160
1160
  databaseItems: ye,
1161
- isDatabasesLoadingOrFetching: q || K,
1161
+ isDatabasesLoadingOrFetching: V || K,
1162
1162
  isDatabaseError: $,
1163
1163
  schemaItems: le,
1164
1164
  isSchemaLoadingOrFetching: te || Q,
1165
1165
  isSchemaError: ee,
1166
- tableItems: Ie,
1166
+ tableItems: Ve,
1167
1167
  isTableLoadingOrFetching: I || y,
1168
1168
  isTableError: v,
1169
1169
  columns: a,
@@ -1178,7 +1178,7 @@ function xa(s, n) {
1178
1178
  handleSchemaChange: xe
1179
1179
  };
1180
1180
  }
1181
- function pa({
1181
+ function fa({
1182
1182
  ColumnsComponent: s
1183
1183
  }) {
1184
1184
  var J;
@@ -1188,12 +1188,12 @@ function pa({
1188
1188
  (I) => I.selectedDatabaseName
1189
1189
  ), t = i(
1190
1190
  (I) => I.selectedSchemaName
1191
- ), o = i((I) => I.selectedTableName), c = i(
1191
+ ), l = i((I) => I.selectedTableName), o = i(
1192
1192
  (I) => I.actions.setSelectedTableName
1193
1193
  ), {
1194
- connectionItems: r,
1195
- schemaItems: l,
1196
- databaseItems: d,
1194
+ connectionItems: d,
1195
+ schemaItems: r,
1196
+ databaseItems: c,
1197
1197
  tableItems: f,
1198
1198
  columns: m,
1199
1199
  isConnectionsLoading: u,
@@ -1209,14 +1209,14 @@ function pa({
1209
1209
  connectionType: j,
1210
1210
  isNonDbConnection: F,
1211
1211
  handleConnectionChange: A,
1212
- handleDatabaseChange: q,
1212
+ handleDatabaseChange: V,
1213
1213
  handleSchemaChange: K,
1214
1214
  tableName: $,
1215
1215
  schemaName: G
1216
- } = xa();
1216
+ } = pa();
1217
1217
  function D() {
1218
1218
  return s ? s(G, $, m) : /* @__PURE__ */ e.jsx(
1219
- Cn,
1219
+ Sn,
1220
1220
  {
1221
1221
  schemaName: G,
1222
1222
  tableName: $,
@@ -1230,12 +1230,12 @@ function pa({
1230
1230
  }
1231
1231
  function Q() {
1232
1232
  return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
1233
- Qe,
1233
+ We,
1234
1234
  {
1235
- onChange: q,
1235
+ onChange: V,
1236
1236
  isError: x,
1237
1237
  isLoading: h,
1238
- items: d,
1238
+ items: c,
1239
1239
  value: a || "",
1240
1240
  title: "Database"
1241
1241
  }
@@ -1243,12 +1243,12 @@ function pa({
1243
1243
  }
1244
1244
  function ee() {
1245
1245
  return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
1246
- Qe,
1246
+ We,
1247
1247
  {
1248
1248
  onChange: K,
1249
1249
  isError: z,
1250
1250
  isLoading: g,
1251
- items: l,
1251
+ items: r,
1252
1252
  value: t || "",
1253
1253
  title: "Schema"
1254
1254
  }
@@ -1256,13 +1256,13 @@ function pa({
1256
1256
  }
1257
1257
  function Z() {
1258
1258
  return j === "API" ? null : /* @__PURE__ */ e.jsx(
1259
- Qe,
1259
+ We,
1260
1260
  {
1261
- onChange: c,
1261
+ onChange: o,
1262
1262
  isError: O,
1263
1263
  items: f,
1264
1264
  isLoading: N,
1265
- value: o || "",
1265
+ value: l || "",
1266
1266
  title: "Table"
1267
1267
  }
1268
1268
  );
@@ -1270,15 +1270,15 @@ function pa({
1270
1270
  return /* @__PURE__ */ e.jsxs("aside", { className: "xbg-red-100 flex grow flex-col justify-between", children: [
1271
1271
  /* @__PURE__ */ e.jsxs("section", { className: "space-y-3 px-6 py-4", children: [
1272
1272
  /* @__PURE__ */ e.jsx(
1273
- Qe,
1273
+ We,
1274
1274
  {
1275
- items: r,
1275
+ items: d,
1276
1276
  title: "Connection",
1277
1277
  value: n || "",
1278
1278
  onChange: A,
1279
1279
  isLoading: u,
1280
1280
  isError: S,
1281
- connectionTooltip: ((J = r == null ? void 0 : r.find(
1281
+ connectionTooltip: ((J = d == null ? void 0 : d.find(
1282
1282
  (I) => I.id === n
1283
1283
  )) == null ? void 0 : J.type) || ""
1284
1284
  }
@@ -1296,38 +1296,38 @@ function pa({
1296
1296
  variant: "secondary",
1297
1297
  className: "w-full",
1298
1298
  children: [
1299
- /* @__PURE__ */ e.jsx(rn, { className: "mr-2 size-4" }),
1299
+ /* @__PURE__ */ e.jsx(on, { className: "mr-2 size-4" }),
1300
1300
  "Help"
1301
1301
  ]
1302
1302
  }
1303
1303
  ) })
1304
1304
  ] });
1305
1305
  }
1306
- function Sn(s) {
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(
1306
+ function kn(s) {
1307
+ const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
1308
+ let o = s.length;
1309
+ if (l !== -1 && (o = l), t !== -1 && t < o && (o = t), n !== -1) {
1310
+ const d = s.substring(0, n), r = s.substring(n);
1311
+ return `${d} {{ filters | where }} AND ${r.substring(
1312
1312
  6
1313
1313
  )}`;
1314
1314
  } else if (a !== -1) {
1315
- const r = s.substring(0, a), l = s.substring(a);
1316
- return `${r} {{ filters | where }} ${l}`;
1315
+ const d = s.substring(0, a), r = s.substring(a);
1316
+ return `${d} {{ filters | where }} ${r}`;
1317
1317
  } else {
1318
- const r = s.substring(0, c), l = s.substring(c);
1319
- return `${r} {{ filters | where }} ${l}`;
1318
+ const d = s.substring(0, o), r = s.substring(o);
1319
+ return `${d} {{ filters | where }} ${r}`;
1320
1320
  }
1321
1321
  }
1322
- function kn({
1322
+ function wn({
1323
1323
  error: s,
1324
1324
  setShowAIDialog: n,
1325
1325
  setUserInputforAI: a,
1326
1326
  setTriggerAIRun: t
1327
1327
  }) {
1328
- return /* @__PURE__ */ e.jsxs(Zs, { openDelay: 0, children: [
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" }) }) }),
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: [
1328
+ return /* @__PURE__ */ e.jsxs(sa, { openDelay: 0, children: [
1329
+ /* @__PURE__ */ e.jsx(aa, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Yt, { className: "h-4 w-4 text-red-500" }) }) }),
1330
+ /* @__PURE__ */ e.jsx(ta, { 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: [
1331
1331
  /* @__PURE__ */ e.jsxs(
1332
1332
  w,
1333
1333
  {
@@ -1337,7 +1337,7 @@ function kn({
1337
1337
  size: "sm",
1338
1338
  variant: "outline",
1339
1339
  children: [
1340
- /* @__PURE__ */ e.jsx(Zt, { className: "h-4 w-4 mr-2" }),
1340
+ /* @__PURE__ */ e.jsx(sn, { className: "h-4 w-4 mr-2" }),
1341
1341
  "Fix It"
1342
1342
  ]
1343
1343
  }
@@ -1346,51 +1346,51 @@ function kn({
1346
1346
  ] }) }) })
1347
1347
  ] });
1348
1348
  }
1349
- function wn({
1349
+ function zn({
1350
1350
  text: s,
1351
1351
  onCheckedChange: n,
1352
1352
  checked: a
1353
1353
  }) {
1354
1354
  return /* @__PURE__ */ e.jsxs("div", { className: "xbg-red-100 ml-6 flex items-center gap-2", children: [
1355
- /* @__PURE__ */ e.jsx(Pe, { checked: a, onCheckedChange: n }),
1355
+ /* @__PURE__ */ e.jsx(Ke, { checked: a, onCheckedChange: n }),
1356
1356
  /* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
1357
1357
  ] });
1358
1358
  }
1359
- function zn() {
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
+ function Fn() {
1360
+ const { authToken: s } = ss(), n = Pe(null), a = i((r) => r.applyFilters), [t, l] = T(""), o = i((r) => r.filterValues), d = i((r) => r.card.sql);
1361
1361
  return /* @__PURE__ */ e.jsxs(
1362
- Zs,
1362
+ sa,
1363
1363
  {
1364
1364
  openDelay: 0,
1365
- onOpenChange: async (l) => {
1366
- if (!l)
1365
+ onOpenChange: async (r) => {
1366
+ if (!r)
1367
1367
  return;
1368
1368
  console.log("onOpenChange");
1369
- const d = await aa(
1369
+ const c = await na(
1370
1370
  "https://semaphor.cloud/api/v1/filter-sql",
1371
1371
  (s == null ? void 0 : s.accessToken) || "",
1372
1372
  {
1373
- sql: r,
1374
- active_filters: c
1373
+ sql: d,
1374
+ active_filters: o
1375
1375
  }
1376
1376
  );
1377
- console.log(d), d.sql ? (console.log(d.records), o(d.sql)) : o("Error");
1377
+ console.log(c), c.sql ? (console.log(c.records), l(c.sql)) : l("Error");
1378
1378
  },
1379
1379
  children: [
1380
- /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
1381
- /* @__PURE__ */ e.jsxs(sa, { align: "end", className: "w-[600px]", children: [
1380
+ /* @__PURE__ */ e.jsx(aa, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
1381
+ /* @__PURE__ */ e.jsxs(ta, { align: "end", className: "w-[600px]", children: [
1382
1382
  /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-sm bg-muted p-2", children: /* @__PURE__ */ e.jsxs("code", { ref: n, className: "font-mono text-sm", children: [
1383
1383
  t,
1384
1384
  /* @__PURE__ */ e.jsx(
1385
- ta,
1385
+ ra,
1386
1386
  {
1387
- onClick: () => Ya(n),
1387
+ onClick: () => Xa(n),
1388
1388
  className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
1389
1389
  }
1390
1390
  )
1391
1391
  ] }) }) }),
1392
1392
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
1393
- /* @__PURE__ */ e.jsx(Xa, { className: "h-4 w-4 opacity-70" }),
1393
+ /* @__PURE__ */ e.jsx(Za, { className: "h-4 w-4 opacity-70" }),
1394
1394
  /* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "A preview of the query with filters applied." })
1395
1395
  ] })
1396
1396
  ] })
@@ -1398,7 +1398,7 @@ function zn() {
1398
1398
  }
1399
1399
  );
1400
1400
  }
1401
- const Fn = `
1401
+ const On = `
1402
1402
 
1403
1403
  Use the following syntax to create a chart query. Please replace the x-axis, y-axis, stack-by, label, and measure with the actual column names of the table.
1404
1404
 
@@ -1445,15 +1445,15 @@ SELECT label, measure FROM table
1445
1445
  - Label - Category
1446
1446
  - Measure - Number
1447
1447
  `;
1448
- function On({
1448
+ function Mn({
1449
1449
  open: s,
1450
1450
  setOpen: n,
1451
1451
  userInput: a,
1452
1452
  setUserInput: t,
1453
- triggerAIRun: o,
1454
- setTriggerAIRun: c
1453
+ triggerAIRun: l,
1454
+ setTriggerAIRun: o
1455
1455
  }) {
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 = `
1456
+ const d = Pe(null), r = Pe(null), { authToken: c } = ss(), [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 = `
1457
1457
  ${a}
1458
1458
 
1459
1459
  Database Query Dialect: ${N === "api" || N === "s3" ? "DuckDb" : ""}
@@ -1461,11 +1461,11 @@ function On({
1461
1461
  Table Columns: ${b == null ? void 0 : b.map((y) => `${y.column_name} | ${y.data_type}`).join(", ")}
1462
1462
  User SQL: ${L}
1463
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({
1464
+ Visual Query Syntax: ${On}`, { data: F, isLoading: A, isFetching: V, isError: K, refetch: $ } = Ce({
1465
1465
  queryKey: ["ai-query"],
1466
1466
  queryFn: () => ze(
1467
1467
  "https://semaphor.cloud/api/v1/ai",
1468
- (d == null ? void 0 : d.accessToken) || "",
1468
+ (c == null ? void 0 : c.accessToken) || "",
1469
1469
  {
1470
1470
  user_content: `userContent: ${O} ${f ? j : ""}`
1471
1471
  }
@@ -1499,10 +1499,10 @@ function On({
1499
1499
  }, [F]), P(() => {
1500
1500
  const y = setTimeout(() => {
1501
1501
  var v;
1502
- l.current && (l.current.scroll({
1503
- top: l.current.scrollHeight,
1502
+ r.current && (r.current.scroll({
1503
+ top: r.current.scrollHeight,
1504
1504
  behavior: "smooth"
1505
- }), (v = r.current) == null || v.focus());
1505
+ }), (v = d.current) == null || v.focus());
1506
1506
  }, 100);
1507
1507
  return () => clearTimeout(y);
1508
1508
  }, [g]);
@@ -1510,8 +1510,8 @@ function On({
1510
1510
  a && (z((y) => [...y, { role: "user", content: a }]), G(a) && m(!0), t(""), $());
1511
1511
  }
1512
1512
  P(() => {
1513
- o && (D(), c(!1));
1514
- }, [o, c]);
1513
+ l && (D(), o(!1));
1514
+ }, [l, o]);
1515
1515
  const te = {
1516
1516
  //seleect a darker color
1517
1517
  // color: '#000',
@@ -1544,7 +1544,7 @@ function On({
1544
1544
  pre: ({ node: y, ...v }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: Q, children: [
1545
1545
  /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: v.children }),
1546
1546
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1547
- /* @__PURE__ */ e.jsx(w, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ta, {}) }),
1547
+ /* @__PURE__ */ e.jsx(w, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ra, {}) }),
1548
1548
  /* @__PURE__ */ e.jsx(
1549
1549
  w,
1550
1550
  {
@@ -1554,7 +1554,7 @@ function On({
1554
1554
  },
1555
1555
  size: "sm",
1556
1556
  variant: "outline",
1557
- children: /* @__PURE__ */ e.jsx(st, {})
1557
+ children: /* @__PURE__ */ e.jsx(at, {})
1558
1558
  }
1559
1559
  )
1560
1560
  ] })
@@ -1575,13 +1575,13 @@ function On({
1575
1575
  {
1576
1576
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
1577
1577
  children: [
1578
- /* @__PURE__ */ e.jsx(gn, { className: "mr-2 h-5 w-5" }),
1578
+ /* @__PURE__ */ e.jsx(jn, { className: "mr-2 h-5 w-5" }),
1579
1579
  /* @__PURE__ */ e.jsx("div", { children: y.content })
1580
1580
  ]
1581
1581
  },
1582
1582
  v
1583
1583
  ) : y.role === "ai" ? /* @__PURE__ */ e.jsx(
1584
- et,
1584
+ st,
1585
1585
  {
1586
1586
  className: "w-full overflow-auto py-1",
1587
1587
  components: Z,
@@ -1612,7 +1612,7 @@ function On({
1612
1612
  /* @__PURE__ */ e.jsx(
1613
1613
  "div",
1614
1614
  {
1615
- ref: l,
1615
+ ref: r,
1616
1616
  className: "h-[625px] w-full overflow-auto border-t border-t-muted",
1617
1617
  children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: I() })
1618
1618
  }
@@ -1622,10 +1622,10 @@ function On({
1622
1622
  {
1623
1623
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center rounded-md border", children: [
1624
1624
  /* @__PURE__ */ e.jsx(
1625
- na,
1625
+ la,
1626
1626
  {
1627
1627
  autoFocus: !0,
1628
- ref: r,
1628
+ ref: d,
1629
1629
  onKeyDown: (y) => {
1630
1630
  y.key === "Enter" && !y.shiftKey && (y.preventDefault(), t(""), D());
1631
1631
  },
@@ -1637,7 +1637,7 @@ function On({
1637
1637
  className: Y(
1638
1638
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1639
1639
  ),
1640
- disabled: A || q,
1640
+ disabled: A || V,
1641
1641
  value: a,
1642
1642
  onChange: (y) => t(y.target.value)
1643
1643
  }
@@ -1650,7 +1650,7 @@ function On({
1650
1650
  size: "sm",
1651
1651
  variant: "ghost",
1652
1652
  onClick: D,
1653
- children: !A && !q ? /* @__PURE__ */ e.jsx(Za, {}) : /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1653
+ children: !A && !V ? /* @__PURE__ */ e.jsx(et, {}) : /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1654
1654
  }
1655
1655
  )
1656
1656
  ] })
@@ -1661,71 +1661,71 @@ function On({
1661
1661
  )
1662
1662
  ] });
1663
1663
  }
1664
- var fa = {
1664
+ var ga = {
1665
1665
  color: void 0,
1666
1666
  size: void 0,
1667
1667
  className: void 0,
1668
1668
  style: void 0,
1669
1669
  attr: void 0
1670
- }, Hs = me.createContext && /* @__PURE__ */ me.createContext(fa), Mn = ["attr", "size", "title"];
1671
- function Tn(s, n) {
1670
+ }, $s = me.createContext && /* @__PURE__ */ me.createContext(ga), Tn = ["attr", "size", "title"];
1671
+ function An(s, n) {
1672
1672
  if (s == null)
1673
1673
  return {};
1674
- var a = An(s, n), t, o;
1674
+ var a = En(s, n), t, l;
1675
1675
  if (Object.getOwnPropertySymbols) {
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]);
1676
+ var o = Object.getOwnPropertySymbols(s);
1677
+ for (l = 0; l < o.length; l++)
1678
+ t = o[l], !(n.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(s, t) && (a[t] = s[t]);
1679
1679
  }
1680
1680
  return a;
1681
1681
  }
1682
- function An(s, n) {
1682
+ function En(s, n) {
1683
1683
  if (s == null)
1684
1684
  return {};
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]);
1685
+ var a = {}, t = Object.keys(s), l, o;
1686
+ for (o = 0; o < t.length; o++)
1687
+ l = t[o], !(n.indexOf(l) >= 0) && (a[l] = s[l]);
1688
1688
  return a;
1689
1689
  }
1690
- function Xe() {
1691
- return Xe = Object.assign ? Object.assign.bind() : function(s) {
1690
+ function Ze() {
1691
+ return Ze = Object.assign ? Object.assign.bind() : function(s) {
1692
1692
  for (var n = 1; n < arguments.length; n++) {
1693
1693
  var a = arguments[n];
1694
1694
  for (var t in a)
1695
1695
  Object.prototype.hasOwnProperty.call(a, t) && (s[t] = a[t]);
1696
1696
  }
1697
1697
  return s;
1698
- }, Xe.apply(this, arguments);
1698
+ }, Ze.apply(this, arguments);
1699
1699
  }
1700
- function Bs(s, n) {
1700
+ function Ps(s, n) {
1701
1701
  var a = Object.keys(s);
1702
1702
  if (Object.getOwnPropertySymbols) {
1703
1703
  var t = Object.getOwnPropertySymbols(s);
1704
- n && (t = t.filter(function(o) {
1705
- return Object.getOwnPropertyDescriptor(s, o).enumerable;
1704
+ n && (t = t.filter(function(l) {
1705
+ return Object.getOwnPropertyDescriptor(s, l).enumerable;
1706
1706
  })), a.push.apply(a, t);
1707
1707
  }
1708
1708
  return a;
1709
1709
  }
1710
- function Ze(s) {
1710
+ function es(s) {
1711
1711
  for (var n = 1; n < arguments.length; n++) {
1712
1712
  var a = arguments[n] != null ? arguments[n] : {};
1713
- n % 2 ? Bs(Object(a), !0).forEach(function(t) {
1714
- En(s, t, a[t]);
1715
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : Bs(Object(a)).forEach(function(t) {
1713
+ n % 2 ? Ps(Object(a), !0).forEach(function(t) {
1714
+ Ln(s, t, a[t]);
1715
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : Ps(Object(a)).forEach(function(t) {
1716
1716
  Object.defineProperty(s, t, Object.getOwnPropertyDescriptor(a, t));
1717
1717
  });
1718
1718
  }
1719
1719
  return s;
1720
1720
  }
1721
- function En(s, n, a) {
1722
- return n = Ln(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
1721
+ function Ln(s, n, a) {
1722
+ return n = Dn(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
1723
1723
  }
1724
- function Ln(s) {
1725
- var n = Dn(s, "string");
1724
+ function Dn(s) {
1725
+ var n = In(s, "string");
1726
1726
  return typeof n == "symbol" ? n : String(n);
1727
1727
  }
1728
- function Dn(s, n) {
1728
+ function In(s, n) {
1729
1729
  if (typeof s != "object" || s === null)
1730
1730
  return s;
1731
1731
  var a = s[Symbol.toPrimitive];
@@ -1737,44 +1737,44 @@ function Dn(s, n) {
1737
1737
  }
1738
1738
  return (n === "string" ? String : Number)(s);
1739
1739
  }
1740
- function ga(s) {
1741
- return s && s.map((n, a) => /* @__PURE__ */ me.createElement(n.tag, Ze({
1740
+ function ja(s) {
1741
+ return s && s.map((n, a) => /* @__PURE__ */ me.createElement(n.tag, es({
1742
1742
  key: a
1743
- }, n.attr), ga(n.child)));
1743
+ }, n.attr), ja(n.child)));
1744
1744
  }
1745
1745
  function fe(s) {
1746
- return (n) => /* @__PURE__ */ me.createElement(In, Xe({
1747
- attr: Ze({}, s.attr)
1748
- }, n), ga(s.child));
1746
+ return (n) => /* @__PURE__ */ me.createElement(Vn, Ze({
1747
+ attr: es({}, s.attr)
1748
+ }, n), ja(s.child));
1749
1749
  }
1750
- function In(s) {
1750
+ function Vn(s) {
1751
1751
  var n = (a) => {
1752
1752
  var {
1753
1753
  attr: t,
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({
1754
+ size: l,
1755
+ title: o
1756
+ } = s, d = An(s, Tn), r = l || a.size || "1em", c;
1757
+ return a.className && (c = a.className), s.className && (c = (c ? c + " " : "") + s.className), /* @__PURE__ */ me.createElement("svg", Ze({
1758
1758
  stroke: "currentColor",
1759
1759
  fill: "currentColor",
1760
1760
  strokeWidth: "0"
1761
- }, a.attr, t, r, {
1762
- className: d,
1763
- style: Ze(Ze({
1761
+ }, a.attr, t, d, {
1762
+ className: c,
1763
+ style: es(es({
1764
1764
  color: s.color || a.color
1765
1765
  }, a.style), s.style),
1766
- height: l,
1767
- width: l,
1766
+ height: r,
1767
+ width: r,
1768
1768
  xmlns: "http://www.w3.org/2000/svg"
1769
- }), c && /* @__PURE__ */ me.createElement("title", null, c), s.children);
1769
+ }), o && /* @__PURE__ */ me.createElement("title", null, o), s.children);
1770
1770
  };
1771
- return Hs !== void 0 ? /* @__PURE__ */ me.createElement(Hs.Consumer, null, (a) => n(a)) : n(fa);
1771
+ return $s !== void 0 ? /* @__PURE__ */ me.createElement($s.Consumer, null, (a) => n(a)) : n(ga);
1772
1772
  }
1773
1773
  function qn(s) {
1774
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);
1775
1775
  }
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
+ function Rn() {
1777
+ const { theme: s } = tt(), n = Pe(), a = Pe(), [t, l] = T(!1), [o, d] = T(!1), [r, c] = T(!1), [f, m] = T(""), [u, S] = T(!1), { authToken: h } = ss();
1778
1778
  k((p) => p.selectedSheetId);
1779
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(
1780
1780
  (p) => p.selectedConnectionId
@@ -1786,7 +1786,7 @@ function Vn() {
1786
1786
  k(
1787
1787
  (p) => p.actions.updateFrameCard
1788
1788
  );
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), {
1789
+ const j = i((p) => p.selectedTableName), F = i((p) => p.card.sql), A = i((p) => p.card.python), V = nt(F, x), K = i((p) => p.selectedConnectionId), $ = i((p) => p.frame), G = i((p) => p.filterValues), D = i((p) => p.applyFilters), {
1790
1790
  setCardCustomCfg: te,
1791
1791
  setQueryResultColumns: Q,
1792
1792
  setFilterValues: ee,
@@ -1805,18 +1805,18 @@ function Vn() {
1805
1805
  isFetching: re,
1806
1806
  isSuccess: ye,
1807
1807
  isError: le,
1808
- error: Ie,
1809
- status: as,
1808
+ error: Ve,
1809
+ status: ts,
1810
1810
  refetch: ve
1811
1811
  } = Ce({
1812
- queryKey: [q, A],
1813
- queryFn: () => aa(
1812
+ queryKey: [V, A],
1813
+ queryFn: () => na(
1814
1814
  "https://semaphor.cloud/api/v1/query",
1815
1815
  (h == null ? void 0 : h.accessToken) || "",
1816
1816
  {
1817
1817
  connection_id: K,
1818
- sql: q,
1819
- python: A === Ls ? "" : A,
1818
+ sql: V,
1819
+ python: A === Is ? "" : A,
1820
1820
  active_filters: D ? G : []
1821
1821
  }
1822
1822
  ),
@@ -1834,7 +1834,7 @@ function Vn() {
1834
1834
  }, [U, se, Q, y]), P(() => {
1835
1835
  je && (ve(), be(!1));
1836
1836
  }, [je, ve, be]), P(() => {
1837
- (ne || re) && xe(!0), (le || ye) && xe(!1), le ? (I(Ie.message), se([]), Q([]), y("")) : I("");
1837
+ (ne || re) && xe(!0), (le || ye) && xe(!1), le ? (I(Ve.message), se([]), Q([]), y("")) : I("");
1838
1838
  }, [
1839
1839
  ne,
1840
1840
  re,
@@ -1846,9 +1846,9 @@ function Vn() {
1846
1846
  se,
1847
1847
  Q,
1848
1848
  I,
1849
- Ie
1849
+ Ve
1850
1850
  ]);
1851
- function Je() {
1851
+ function Qe() {
1852
1852
  Z(""), se([]), ge({}), te(""), v({});
1853
1853
  }
1854
1854
  const qe = (p) => {
@@ -1856,7 +1856,7 @@ function Vn() {
1856
1856
  };
1857
1857
  function C() {
1858
1858
  let p = F;
1859
- F && !F.includes("{{") && (p = Sn(F), Z(p));
1859
+ F && !F.includes("{{") && (p = kn(F), Z(p));
1860
1860
  const ie = {
1861
1861
  ...g,
1862
1862
  lastSelectedSchema: O,
@@ -1866,37 +1866,37 @@ function Vn() {
1866
1866
  type: b ? g.type : "table",
1867
1867
  sql: p,
1868
1868
  customCfg: b ? g.customCfg : null
1869
- }, Ve = $.cards.map(
1869
+ }, Re = $.cards.map(
1870
1870
  (Ne) => Ne.id === g.id ? ie : Ne
1871
1871
  );
1872
1872
  M == null || M({
1873
1873
  ...$,
1874
- cards: Ve
1874
+ cards: Re
1875
1875
  });
1876
1876
  }
1877
- function Fa() {
1877
+ function Oa() {
1878
1878
  ue == null || ue();
1879
1879
  }
1880
- function Oa(p) {
1880
+ function Ma(p) {
1881
1881
  const ie = getComputedStyle(
1882
1882
  document.documentElement
1883
1883
  ).getPropertyValue(p);
1884
- return Ma(ie);
1884
+ return Ta(ie);
1885
1885
  }
1886
- function Ma(p) {
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)), ts = Ts - pe / 2;
1886
+ function Ta(p) {
1887
+ const [ie, Re, Ne] = p.split(" "), W = parseFloat(ie), La = parseFloat(Re), Da = parseFloat(Ne), Ia = La / 100, Es = Da / 100, pe = (1 - Math.abs(2 * Es - 1)) * Ia, ke = pe * (1 - Math.abs(W / 60 % 2 - 1)), ns = Es - pe / 2;
1888
1888
  let oe = 0, ce = 0, de = 0;
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 + ts) * 255), ce = Math.round((ce + ts) * 255), de = Math.round((de + ts) * 255);
1890
- const ns = (Ia) => {
1891
- const rs = Ia.toString(16);
1892
- return rs.length == 1 ? "0" + rs : rs;
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 + ns) * 255), ce = Math.round((ce + ns) * 255), de = Math.round((de + ns) * 255);
1890
+ const rs = (Va) => {
1891
+ const ls = Va.toString(16);
1892
+ return ls.length == 1 ? "0" + ls : ls;
1893
1893
  };
1894
- return `#${ns(oe)}${ns(ce)}${ns(de)}`;
1894
+ return `#${rs(oe)}${rs(ce)}${rs(de)}`;
1895
1895
  }
1896
1896
  P(() => {
1897
1897
  const p = n.current, ie = a.current;
1898
1898
  if (p) {
1899
- const Ve = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = z === "system" ? Ve : z;
1899
+ const Re = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = z === "system" ? Re : z;
1900
1900
  p.editor.defineTheme("default", {
1901
1901
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
1902
1902
  base: Ne === "light" ? "vs" : "vs-dark",
@@ -1904,7 +1904,7 @@ function Vn() {
1904
1904
  rules: [],
1905
1905
  colors: {
1906
1906
  // 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
1907
- "editor.background": Ne === "light" ? "#ffffff" : Oa("--background")
1907
+ "editor.background": Ne === "light" ? "#ffffff" : Ma("--background")
1908
1908
  }
1909
1909
  }), p.editor.setTheme("default");
1910
1910
  }
@@ -1916,12 +1916,12 @@ function Vn() {
1916
1916
  ), () => {
1917
1917
  };
1918
1918
  }, [s, z, n.current]);
1919
- function Ms(p) {
1919
+ function As(p) {
1920
1920
  n.current = p;
1921
1921
  }
1922
- function Ta() {
1922
+ function Aa() {
1923
1923
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1924
- c && /* @__PURE__ */ e.jsx(
1924
+ o && /* @__PURE__ */ e.jsx(
1925
1925
  "div",
1926
1926
  {
1927
1927
  className: "xbg-yellow-100 relative flex w-1/3 min-w-0 grow overflow-hidden border-l p-1 text-xs",
@@ -1929,24 +1929,24 @@ function Vn() {
1929
1929
  children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
1930
1930
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
1931
1931
  /* @__PURE__ */ e.jsx(
1932
- wn,
1932
+ zn,
1933
1933
  {
1934
1934
  checked: D,
1935
1935
  onCheckedChange: () => H(!D),
1936
1936
  text: "Apply Filters"
1937
1937
  }
1938
1938
  ),
1939
- /* @__PURE__ */ e.jsx(zn, {}),
1940
- G && c && /* @__PURE__ */ e.jsx(
1941
- _e,
1939
+ /* @__PURE__ */ e.jsx(Fn, {}),
1940
+ G && o && /* @__PURE__ */ e.jsx(
1941
+ He,
1942
1942
  {
1943
- onClick: () => r(!1),
1943
+ onClick: () => d(!1),
1944
1944
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
1945
1945
  }
1946
1946
  )
1947
1947
  ] }),
1948
1948
  /* @__PURE__ */ e.jsx(
1949
- Re,
1949
+ _e,
1950
1950
  {
1951
1951
  theme: "default",
1952
1952
  onChange: (p) => {
@@ -1979,10 +1979,10 @@ function Vn() {
1979
1979
  ] })
1980
1980
  }
1981
1981
  ),
1982
- G && !c && /* @__PURE__ */ e.jsx(
1983
- oa,
1982
+ G && !o && /* @__PURE__ */ e.jsx(
1983
+ ca,
1984
1984
  {
1985
- onClick: () => r(!0),
1985
+ onClick: () => d(!0),
1986
1986
  className: Y(
1987
1987
  "absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
1988
1988
  {
@@ -1993,7 +1993,7 @@ function Vn() {
1993
1993
  )
1994
1994
  ] });
1995
1995
  }
1996
- function Aa() {
1996
+ function Ea() {
1997
1997
  return /* @__PURE__ */ e.jsxs(
1998
1998
  us,
1999
1999
  {
@@ -2015,7 +2015,7 @@ function Vn() {
2015
2015
  role: "sql-container",
2016
2016
  className: "relative flex w-[99%]",
2017
2017
  children: /* @__PURE__ */ e.jsx(
2018
- Re,
2018
+ _e,
2019
2019
  {
2020
2020
  theme: "default",
2021
2021
  className: "pt-3",
@@ -2037,7 +2037,7 @@ function Vn() {
2037
2037
  },
2038
2038
  defaultLanguage: "sql",
2039
2039
  defaultValue: "SELECT * FROM table",
2040
- beforeMount: Ms,
2040
+ beforeMount: As,
2041
2041
  onMount: qe
2042
2042
  }
2043
2043
  )
@@ -2063,14 +2063,14 @@ function Vn() {
2063
2063
  role: "python-container",
2064
2064
  className: "relative flex w-[99%] pt-0",
2065
2065
  children: /* @__PURE__ */ e.jsx(
2066
- Re,
2066
+ _e,
2067
2067
  {
2068
2068
  className: "pt-3",
2069
2069
  theme: "default",
2070
2070
  onChange: (p) => {
2071
2071
  J(p && p.trim() || "");
2072
2072
  },
2073
- value: A || Ls,
2073
+ value: A || Is,
2074
2074
  options: {
2075
2075
  minimap: {
2076
2076
  enabled: !1
@@ -2084,7 +2084,7 @@ function Vn() {
2084
2084
  renderLineHighlight: "none"
2085
2085
  },
2086
2086
  defaultLanguage: "python",
2087
- beforeMount: Ms,
2087
+ beforeMount: As,
2088
2088
  onMount: qe
2089
2089
  }
2090
2090
  )
@@ -2113,8 +2113,8 @@ function Vn() {
2113
2113
  role: "sql-editor",
2114
2114
  className: "relative flex grow justify-between overflow-y-scroll",
2115
2115
  children: [
2116
- Aa(),
2117
- Ta()
2116
+ Ea(),
2117
+ Aa()
2118
2118
  ]
2119
2119
  }
2120
2120
  ),
@@ -2137,16 +2137,16 @@ function Vn() {
2137
2137
  size: "sm",
2138
2138
  variant: "outline",
2139
2139
  children: [
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" }),
2140
+ ne || re ? /* @__PURE__ */ e.jsx($e, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(dn, { className: "mr-2 h-4 w-4" }),
2141
2141
  "Run"
2142
2142
  ]
2143
2143
  }
2144
2144
  ),
2145
2145
  le && /* @__PURE__ */ e.jsx(
2146
- kn,
2146
+ wn,
2147
2147
  {
2148
- error: Ie.message,
2149
- setShowAIDialog: d,
2148
+ error: Ve.message,
2149
+ setShowAIDialog: c,
2150
2150
  setTriggerAIRun: S,
2151
2151
  setUserInputforAI: m
2152
2152
  }
@@ -2154,21 +2154,21 @@ function Vn() {
2154
2154
  /* @__PURE__ */ e.jsxs(
2155
2155
  w,
2156
2156
  {
2157
- onClick: Je,
2157
+ onClick: Qe,
2158
2158
  className: "",
2159
2159
  size: "sm",
2160
2160
  variant: "outline",
2161
2161
  children: [
2162
- /* @__PURE__ */ e.jsx(Yt, { className: "mr-2 size-4" }),
2162
+ /* @__PURE__ */ e.jsx(Zt, { className: "mr-2 size-4" }),
2163
2163
  "Clear"
2164
2164
  ]
2165
2165
  }
2166
2166
  ),
2167
2167
  /* @__PURE__ */ e.jsx(
2168
- Xs,
2168
+ ea,
2169
2169
  {
2170
2170
  pressed: t,
2171
- onPressedChange: (p) => o(p),
2171
+ onPressedChange: (p) => l(p),
2172
2172
  className: "",
2173
2173
  size: "sm",
2174
2174
  variant: "outline",
@@ -2176,10 +2176,10 @@ function Vn() {
2176
2176
  }
2177
2177
  ),
2178
2178
  /* @__PURE__ */ e.jsx(
2179
- On,
2179
+ Mn,
2180
2180
  {
2181
- open: l,
2182
- setOpen: d,
2181
+ open: r,
2182
+ setOpen: c,
2183
2183
  userInput: f,
2184
2184
  triggerAIRun: u,
2185
2185
  setTriggerAIRun: S,
@@ -2195,7 +2195,7 @@ function Vn() {
2195
2195
  size: "sm",
2196
2196
  variant: "outline",
2197
2197
  children: [
2198
- /* @__PURE__ */ e.jsx(nt, { className: "mr-2 size-4 font-bold text-green-600" }),
2198
+ /* @__PURE__ */ e.jsx(rt, { className: "mr-2 size-4 font-bold text-green-600" }),
2199
2199
  "Accept"
2200
2200
  ]
2201
2201
  }
@@ -2203,12 +2203,12 @@ function Vn() {
2203
2203
  /* @__PURE__ */ e.jsxs(
2204
2204
  w,
2205
2205
  {
2206
- onClick: Fa,
2206
+ onClick: Oa,
2207
2207
  className: "w-full",
2208
2208
  size: "sm",
2209
2209
  variant: "outline",
2210
2210
  children: [
2211
- /* @__PURE__ */ e.jsx(_e, { className: "mr-2 size-4" }),
2211
+ /* @__PURE__ */ e.jsx(He, { className: "mr-2 size-4" }),
2212
2212
  "Close"
2213
2213
  ]
2214
2214
  }
@@ -2222,61 +2222,61 @@ function Vn() {
2222
2222
  )
2223
2223
  );
2224
2224
  }
2225
- function Rn({ data: s }) {
2226
- var r;
2227
- const [n, a] = me.useState([]), o = Object.keys(s[0]).map((l) => ({
2225
+ function _n({ data: s }) {
2226
+ var d;
2227
+ const [n, a] = me.useState([]), l = Object.keys(s[0]).map((r) => ({
2228
2228
  // header: key,
2229
- accessorKey: l,
2230
- header: ({ column: d }) => {
2231
- const f = d.getIsSorted();
2229
+ accessorKey: r,
2230
+ header: ({ column: c }) => {
2231
+ const f = c.getIsSorted();
2232
2232
  return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
2233
2233
  "div",
2234
2234
  {
2235
2235
  className: "flex cursor-pointer items-center",
2236
- onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
2236
+ onClick: () => c.toggleSorting(c.getIsSorted() === "asc"),
2237
2237
  children: [
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
2238
+ r,
2239
+ f === "asc" ? /* @__PURE__ */ e.jsx(lt, { className: "ml-2 h-5 w-5" }) : f === "desc" ? /* @__PURE__ */ e.jsx(it, { className: "ml-2 h-5 w-5" }) : null
2240
2240
  ]
2241
2241
  }
2242
2242
  ) });
2243
2243
  }
2244
- })), c = it({
2244
+ })), o = ot({
2245
2245
  data: s,
2246
- columns: o,
2247
- getCoreRowModel: mt(),
2248
- getPaginationRowModel: ut(),
2246
+ columns: l,
2247
+ getCoreRowModel: ut(),
2248
+ getPaginationRowModel: xt(),
2249
2249
  onSortingChange: a,
2250
- getSortedRowModel: xt(),
2250
+ getSortedRowModel: pt(),
2251
2251
  manualPagination: !0,
2252
2252
  state: {
2253
2253
  sorting: n
2254
2254
  }
2255
2255
  });
2256
- return /* @__PURE__ */ e.jsxs(ot, { children: [
2257
- /* @__PURE__ */ e.jsx(ct, { children: c.getHeaderGroups().map((l) => /* @__PURE__ */ e.jsx(ls, { 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
- ls,
2256
+ return /* @__PURE__ */ e.jsxs(ct, { children: [
2257
+ /* @__PURE__ */ e.jsx(dt, { children: o.getHeaderGroups().map((r) => /* @__PURE__ */ e.jsx(is, { children: r.headers.map((c) => /* @__PURE__ */ e.jsx(ht, { className: "sticky top-0 bg-muted", children: c.isPlaceholder ? null : Vs(
2258
+ c.column.columnDef.header,
2259
+ c.getContext()
2260
+ ) }, c.id)) }, r.id)) }),
2261
+ /* @__PURE__ */ e.jsx(mt, { children: (d = o.getRowModel().rows) != null && d.length ? o.getRowModel().rows.map((r) => /* @__PURE__ */ e.jsx(
2262
+ is,
2263
2263
  {
2264
2264
  className: "whitespace-nowrap py-2",
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))
2265
+ "data-state": r.getIsSelected() && "selected",
2266
+ children: r.getVisibleCells().map((c) => /* @__PURE__ */ e.jsx(qs, { children: Vs(c.column.columnDef.cell, c.getContext()) }, c.id))
2267
2267
  },
2268
- l.id
2269
- )) : /* @__PURE__ */ e.jsx(ls, { children: /* @__PURE__ */ e.jsx(Is, { colSpan: o.length, className: "h-24 text-center", children: "No results." }) }) })
2268
+ r.id
2269
+ )) : /* @__PURE__ */ e.jsx(is, { children: /* @__PURE__ */ e.jsx(qs, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
2270
2270
  ] });
2271
2271
  }
2272
- function ja({
2272
+ function ba({
2273
2273
  // card,
2274
2274
  className: s,
2275
2275
  ...n
2276
2276
  }) {
2277
- var r;
2277
+ var d;
2278
2278
  me.useState(0);
2279
- const a = k((l) => l.themeStyle), t = i((l) => l.card), o = i((l) => l.actions.setCard);
2279
+ const a = k((r) => r.themeStyle), t = i((r) => r.card), l = i((r) => r.actions.setCard);
2280
2280
  if (P(() => {
2281
2281
  }, [
2282
2282
  t.data,
@@ -2287,36 +2287,36 @@ function ja({
2287
2287
  t.preferences
2288
2288
  ]), !t.id)
2289
2289
  return null;
2290
- let c;
2291
- return t.data && t.data.length > 0 && (c = ra({
2290
+ let o;
2291
+ return t.data && t.data.length > 0 && (o = ia({
2292
2292
  data: t.data,
2293
2293
  cardType: t.type,
2294
2294
  cfg: t.cfg,
2295
2295
  customCfg: t.customCfg,
2296
2296
  preferences: t.preferences
2297
2297
  })), /* @__PURE__ */ e.jsxs(
2298
- pt,
2298
+ ft,
2299
2299
  {
2300
2300
  role: "editor-visual-card",
2301
2301
  className: Y("relative flex h-full flex-col rounded-none", s),
2302
2302
  ...n,
2303
2303
  children: [
2304
- /* @__PURE__ */ e.jsxs(ft, { className: "py-4", children: [
2304
+ /* @__PURE__ */ e.jsxs(gt, { className: "py-4", children: [
2305
2305
  /* @__PURE__ */ e.jsx(
2306
- qs,
2306
+ Rs,
2307
2307
  {
2308
2308
  text: t.title,
2309
- onSave: (l) => o({ ...t, title: l }),
2310
- children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(gt, { className: "text-base", children: t.title }) })
2309
+ onSave: (r) => l({ ...t, title: r }),
2310
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(jt, { className: "text-base", children: t.title }) })
2311
2311
  },
2312
2312
  t.title
2313
2313
  ),
2314
2314
  /* @__PURE__ */ e.jsx(
2315
- qs,
2315
+ Rs,
2316
2316
  {
2317
2317
  text: t.description || "",
2318
- onSave: (l) => o({ ...t, description: l }),
2319
- children: /* @__PURE__ */ e.jsxs(jt, { children: [
2318
+ onSave: (r) => l({ ...t, description: r }),
2319
+ children: /* @__PURE__ */ e.jsxs(bt, { children: [
2320
2320
  " ",
2321
2321
  t.description
2322
2322
  ] })
@@ -2324,34 +2324,34 @@ function ja({
2324
2324
  t.description
2325
2325
  )
2326
2326
  ] }),
2327
- /* @__PURE__ */ e.jsxs(bt, { className: "flex grow flex-col pb-3", children: [
2328
- t.type !== "table" && c && // <ChartJsVisual key={visualKey} cfg={cfg} />
2327
+ /* @__PURE__ */ e.jsxs(yt, { className: "flex grow flex-col pb-3", children: [
2328
+ t.type !== "table" && o && // <ChartJsVisual key={visualKey} cfg={cfg} />
2329
2329
  /* @__PURE__ */ e.jsx(
2330
- yt,
2330
+ vt,
2331
2331
  {
2332
- cfg: c
2332
+ cfg: o
2333
2333
  },
2334
- JSON.stringify(c) + JSON.stringify(t.preferences) + ((r = t == null ? void 0 : t.preferences) == null ? void 0 : r.customVisualCode)
2334
+ JSON.stringify(o) + JSON.stringify(t.preferences) + ((d = t == null ? void 0 : t.preferences) == null ? void 0 : d.customVisualCode)
2335
2335
  ),
2336
2336
  t.type === "table" && t.data && t.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
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 }) })
2337
+ /* @__PURE__ */ e.jsx(Nt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Ct, { card: t, data: t == null ? void 0 : t.data }) })
2338
2338
  ] })
2339
2339
  ]
2340
2340
  }
2341
2341
  );
2342
2342
  }
2343
- function _n() {
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(
2343
+ function Hn() {
2344
+ const [s, n] = T(!1), [a, t] = T(""), [l, o] = T(""), [d, r] = T(""), [c, f] = T(""), m = i((N) => N.card), u = i(
2345
2345
  (N) => N.card.customCfg
2346
- ), { setCardCustomCfg: S, setCustomVisualCode: h } = Ct();
2346
+ ), { setCardCustomCfg: S, setCustomVisualCode: h } = St();
2347
2347
  function x(N) {
2348
2348
  var F, A;
2349
2349
  const O = {
2350
2350
  ...N,
2351
2351
  data: {
2352
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,
2353
+ datasets: (A = (F = N == null ? void 0 : N.data) == null ? void 0 : F.datasets) == null ? void 0 : A.map((V) => ({
2354
+ ...V,
2355
2355
  data: []
2356
2356
  }))
2357
2357
  }
@@ -2362,30 +2362,30 @@ function _n() {
2362
2362
  var O, j;
2363
2363
  if (!m.data || m.data.length === 0)
2364
2364
  return;
2365
- const N = ra({
2365
+ const N = ia({
2366
2366
  data: m.data,
2367
2367
  cardType: m.type,
2368
2368
  cfg: m.cfg,
2369
2369
  preferences: m.preferences
2370
2370
  });
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)));
2371
+ N && (t(JSON.stringify(N, null, 1)), (O = m == null ? void 0 : m.preferences) != null && O.customVisualCode && r((j = m == null ? void 0 : m.preferences) == null ? void 0 : j.customVisualCode), u && o(JSON.stringify(u, null, 1)));
2372
2372
  }
2373
2373
  function z() {
2374
- if (r && h(r), !!o)
2374
+ if (d && h(d), !!l)
2375
2375
  try {
2376
- const N = JSON.parse(o);
2377
- return N ? (S(N), f(""), c(""), N) : void 0;
2376
+ const N = JSON.parse(l);
2377
+ return N ? (S(N), f(""), o(""), N) : void 0;
2378
2378
  } catch (N) {
2379
2379
  console.log(N), f("Invalid JSON");
2380
2380
  }
2381
2381
  }
2382
2382
  function b() {
2383
- c(""), S(null);
2383
+ o(""), S(null);
2384
2384
  }
2385
2385
  function L() {
2386
2386
  let N;
2387
2387
  if (u) {
2388
- const O = Vs.cloneDeep(m.cfg), j = Vs.merge(O, u);
2388
+ const O = _s.cloneDeep(m.cfg), j = _s.merge(O, u);
2389
2389
  return N = x(j), N;
2390
2390
  }
2391
2391
  return a ? (N = x(JSON.parse(a)), N) : "";
@@ -2398,7 +2398,7 @@ function _n() {
2398
2398
  className: ` ${u && "border-foreground/50 dark:border-foreground/70"}`,
2399
2399
  size: "sm",
2400
2400
  variant: "outline",
2401
- children: /* @__PURE__ */ e.jsx(St, { className: "h-4 w-4" })
2401
+ children: /* @__PURE__ */ e.jsx(kt, { className: "h-4 w-4" })
2402
2402
  }
2403
2403
  ) }),
2404
2404
  /* @__PURE__ */ e.jsxs(
@@ -2410,8 +2410,8 @@ function _n() {
2410
2410
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2411
2411
  /* @__PURE__ */ e.jsx(bs, { children: "Customize Card" }),
2412
2412
  /* @__PURE__ */ e.jsxs(vs, { children: [
2413
- /* @__PURE__ */ e.jsx(Js, { children: /* @__PURE__ */ e.jsx(
2414
- sn,
2413
+ /* @__PURE__ */ e.jsx(Ws, { children: /* @__PURE__ */ e.jsx(
2414
+ tn,
2415
2415
  {
2416
2416
  onClick: () => {
2417
2417
  navigator.clipboard.writeText(m.id);
@@ -2436,23 +2436,23 @@ function _n() {
2436
2436
  ] })
2437
2437
  ] }),
2438
2438
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
2439
- /* @__PURE__ */ e.jsx(ja, { className: "w-1/2 rounded shadow-none" }),
2440
- /* @__PURE__ */ e.jsxs(kt, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2441
- /* @__PURE__ */ e.jsxs(wt, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2442
- /* @__PURE__ */ e.jsxs(is, { value: "custom-config", children: [
2443
- u && /* @__PURE__ */ e.jsx(zt, { className: "mr-1 h-5 w-5 text-green-600" }),
2439
+ /* @__PURE__ */ e.jsx(ba, { className: "w-1/2 rounded shadow-none" }),
2440
+ /* @__PURE__ */ e.jsxs(wt, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2441
+ /* @__PURE__ */ e.jsxs(zt, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2442
+ /* @__PURE__ */ e.jsxs(os, { value: "custom-config", children: [
2443
+ u && /* @__PURE__ */ e.jsx(Ft, { className: "mr-1 h-5 w-5 text-green-600" }),
2444
2444
  u ? "Custom Config" : "Default Config"
2445
2445
  ] }),
2446
- /* @__PURE__ */ e.jsx(is, { className: "", value: "output", children: "Output" }),
2447
- /* @__PURE__ */ e.jsx(is, { className: "", value: "custom-code", children: "Custom Code" })
2446
+ /* @__PURE__ */ e.jsx(os, { className: "", value: "output", children: "Output" }),
2447
+ /* @__PURE__ */ e.jsx(os, { className: "", value: "custom-code", children: "Custom Code" })
2448
2448
  ] }),
2449
2449
  /* @__PURE__ */ e.jsx(
2450
- os,
2450
+ cs,
2451
2451
  {
2452
2452
  className: "bg-red-x mt-0 grow rounded-b border border-t-0 p-2",
2453
2453
  value: "output",
2454
2454
  children: /* @__PURE__ */ e.jsx(
2455
- na,
2455
+ la,
2456
2456
  {
2457
2457
  disabled: !0,
2458
2458
  value: a,
@@ -2462,12 +2462,12 @@ function _n() {
2462
2462
  }
2463
2463
  ),
2464
2464
  /* @__PURE__ */ e.jsx(
2465
- os,
2465
+ cs,
2466
2466
  {
2467
2467
  className: "mt-0 grow rounded-b border border-t-0",
2468
2468
  value: "custom-config",
2469
2469
  children: /* @__PURE__ */ e.jsx(
2470
- Re,
2470
+ _e,
2471
2471
  {
2472
2472
  className: "h-full w-full overflow-hidden",
2473
2473
  theme: "default",
@@ -2485,18 +2485,18 @@ function _n() {
2485
2485
  },
2486
2486
  defaultLanguage: "json",
2487
2487
  value: L(),
2488
- onChange: (N) => c(N)
2488
+ onChange: (N) => o(N)
2489
2489
  }
2490
2490
  )
2491
2491
  }
2492
2492
  ),
2493
2493
  /* @__PURE__ */ e.jsx(
2494
- os,
2494
+ cs,
2495
2495
  {
2496
2496
  className: "mt-0 grow rounded-b border border-t-0",
2497
2497
  value: "custom-code",
2498
2498
  children: /* @__PURE__ */ e.jsx(
2499
- Re,
2499
+ _e,
2500
2500
  {
2501
2501
  className: "h-full w-full overflow-hidden",
2502
2502
  theme: "default",
@@ -2513,16 +2513,16 @@ function _n() {
2513
2513
  renderLineHighlight: "none"
2514
2514
  },
2515
2515
  defaultLanguage: "javascript",
2516
- value: r,
2517
- onChange: (N) => l(N || "")
2516
+ value: d,
2517
+ onChange: (N) => r(N || "")
2518
2518
  }
2519
2519
  )
2520
2520
  }
2521
2521
  )
2522
2522
  ] })
2523
2523
  ] }),
2524
- /* @__PURE__ */ e.jsxs(Us, { className: "flex items-center", children: [
2525
- /* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children: d }),
2524
+ /* @__PURE__ */ e.jsxs(Js, { className: "flex items-center", children: [
2525
+ /* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children: c }),
2526
2526
  /* @__PURE__ */ e.jsx(
2527
2527
  w,
2528
2528
  {
@@ -2540,101 +2540,101 @@ function _n() {
2540
2540
  )
2541
2541
  ] });
2542
2542
  }
2543
- function ba(s) {
2543
+ function ya(s) {
2544
2544
  return fe({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
2545
2545
  }
2546
- function ya(s) {
2546
+ function va(s) {
2547
2547
  return fe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M137.39,24.06A16,16,0,0,0,120,40V80.67a15.86,15.86,0,0,0,13.25,15.76A32,32,0,1,1,96,129.68c-.41-8.22,1.27-15,5-20.26h0a15.86,15.86,0,0,0-1.69-20.47L71.69,60.68a16,16,0,0,0-23.63,1.1A103.6,103.6,0,0,0,55,202.05,103.24,103.24,0,0,0,128,232h1.49A104.3,104.3,0,0,0,232,129.48C232.75,75.18,191.19,28.88,137.39,24.06ZM60.32,71.94l27.61,28.19,0,.06A43.29,43.29,0,0,0,80.44,120H40.36A87.13,87.13,0,0,1,60.32,71.94ZM40.37,136h40.3A48,48,0,0,0,120,175.34v40.3A88,88,0,0,1,40.37,136Zm149.77,54.14A87.45,87.45,0,0,1,136,215.61V175.34a47.55,47.55,0,0,0,24.73-12.23A48,48,0,0,0,136,80.66L136,40c45.52,4.08,80.67,43.28,80,89.25A87.45,87.45,0,0,1,190.14,190.14Z" }, child: [] }] })(s);
2548
2548
  }
2549
- function va(s) {
2549
+ function Na(s) {
2550
2550
  return fe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
2551
2551
  }
2552
- function Na(s) {
2552
+ function Ca(s) {
2553
2553
  return fe({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }, child: [] }, { tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
2554
2554
  }
2555
- function Ca(s) {
2555
+ function Sa(s) {
2556
2556
  return fe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
2557
2557
  }
2558
- function Sa(s) {
2558
+ function ka(s) {
2559
2559
  return fe({ tag: "svg", attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z" }, child: [] }] })(s);
2560
2560
  }
2561
- function ka(s) {
2561
+ function wa(s) {
2562
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);
2563
2563
  }
2564
- function Hn() {
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
+ function Bn() {
2565
+ const [s, n] = T(!1), a = i((c) => c.card.type), { setCardType: t, setCardPreferences: l, setChartOrientation: o } = i((c) => c.actions), d = i(
2566
+ (c) => c.actions.setCardCustomCfg
2567
2567
  );
2568
- function l(d) {
2569
- r(null), o({}), t(d), n(!1);
2568
+ function r(c) {
2569
+ d(null), l({}), t(c), n(!1);
2570
2570
  }
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 }) }) }),
2573
- /* @__PURE__ */ e.jsx(Ge, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2571
+ return /* @__PURE__ */ e.jsxs(Ue, { open: s, onOpenChange: n, children: [
2572
+ /* @__PURE__ */ e.jsx(Ge, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx($n, { className: "h-4 w-4", chartType: a }) }) }),
2573
+ /* @__PURE__ */ e.jsx(Je, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2574
2574
  /* @__PURE__ */ e.jsx(
2575
2575
  w,
2576
2576
  {
2577
- onClick: () => l("bar"),
2577
+ onClick: () => r("bar"),
2578
2578
  className: "font-normal",
2579
2579
  variant: "ghost",
2580
- children: /* @__PURE__ */ e.jsx(zs, { className: "size-5" })
2580
+ children: /* @__PURE__ */ e.jsx(Fs, { className: "size-5" })
2581
2581
  }
2582
2582
  ),
2583
2583
  /* @__PURE__ */ e.jsx(
2584
2584
  w,
2585
2585
  {
2586
- onClick: () => l("line"),
2586
+ onClick: () => r("line"),
2587
2587
  variant: "ghost",
2588
- children: /* @__PURE__ */ e.jsx(Fs, { className: "size-5" })
2588
+ children: /* @__PURE__ */ e.jsx(Os, { className: "size-5" })
2589
2589
  }
2590
2590
  ),
2591
2591
  /* @__PURE__ */ e.jsx(
2592
2592
  w,
2593
2593
  {
2594
- onClick: () => l("stackedBar"),
2594
+ onClick: () => r("stackedBar"),
2595
2595
  variant: "ghost",
2596
- children: /* @__PURE__ */ e.jsx(Ca, { className: "size-5", strokeWidth: 0 })
2596
+ children: /* @__PURE__ */ e.jsx(Sa, { className: "size-5", strokeWidth: 0 })
2597
2597
  }
2598
2598
  ),
2599
2599
  /* @__PURE__ */ e.jsx(
2600
2600
  w,
2601
2601
  {
2602
- onClick: () => l("scatter"),
2602
+ onClick: () => r("scatter"),
2603
2603
  variant: "ghost",
2604
- children: /* @__PURE__ */ e.jsx(ma, { className: "size-5" })
2604
+ children: /* @__PURE__ */ e.jsx(ua, { className: "size-5" })
2605
2605
  }
2606
2606
  ),
2607
2607
  /* @__PURE__ */ e.jsx(
2608
2608
  w,
2609
2609
  {
2610
- onClick: () => l("bubble"),
2610
+ onClick: () => r("bubble"),
2611
2611
  variant: "ghost",
2612
- children: /* @__PURE__ */ e.jsx(Na, { className: "size-4" })
2612
+ children: /* @__PURE__ */ e.jsx(Ca, { className: "size-4" })
2613
2613
  }
2614
2614
  ),
2615
2615
  /* @__PURE__ */ e.jsx(
2616
2616
  w,
2617
2617
  {
2618
- onClick: () => l("pie"),
2618
+ onClick: () => r("pie"),
2619
2619
  variant: "ghost",
2620
- children: /* @__PURE__ */ e.jsx(ha, { className: "size-5" })
2620
+ children: /* @__PURE__ */ e.jsx(ma, { className: "size-5" })
2621
2621
  }
2622
2622
  ),
2623
2623
  /* @__PURE__ */ e.jsx(
2624
2624
  w,
2625
2625
  {
2626
- onClick: () => l("doughnut"),
2626
+ onClick: () => r("doughnut"),
2627
2627
  variant: "ghost",
2628
- children: /* @__PURE__ */ e.jsx(ya, { className: "size-5", strokeWidth: 1 })
2628
+ children: /* @__PURE__ */ e.jsx(va, { className: "size-5", strokeWidth: 1 })
2629
2629
  }
2630
2630
  ),
2631
2631
  /* @__PURE__ */ e.jsx(
2632
2632
  w,
2633
2633
  {
2634
- onClick: () => l("radar"),
2634
+ onClick: () => r("radar"),
2635
2635
  variant: "ghost",
2636
2636
  children: /* @__PURE__ */ e.jsx(
2637
- ba,
2637
+ ya,
2638
2638
  {
2639
2639
  className: "size-5 font-extralight",
2640
2640
  strokeWidth: 0.5
@@ -2645,31 +2645,31 @@ function Hn() {
2645
2645
  /* @__PURE__ */ e.jsx(
2646
2646
  w,
2647
2647
  {
2648
- onClick: () => l("polarArea"),
2648
+ onClick: () => r("polarArea"),
2649
2649
  variant: "ghost",
2650
- children: /* @__PURE__ */ e.jsx(va, { className: "size-5" })
2650
+ children: /* @__PURE__ */ e.jsx(Na, { className: "size-5" })
2651
2651
  }
2652
2652
  ),
2653
2653
  /* @__PURE__ */ e.jsx(
2654
2654
  w,
2655
2655
  {
2656
- onClick: () => l("pyramid"),
2656
+ onClick: () => r("pyramid"),
2657
2657
  variant: "ghost",
2658
- children: /* @__PURE__ */ e.jsx(ka, { className: "size-5" })
2658
+ children: /* @__PURE__ */ e.jsx(wa, { className: "size-5" })
2659
2659
  }
2660
2660
  ),
2661
2661
  /* @__PURE__ */ e.jsx(
2662
2662
  w,
2663
2663
  {
2664
- onClick: () => l("range"),
2664
+ onClick: () => r("range"),
2665
2665
  variant: "ghost",
2666
- children: /* @__PURE__ */ e.jsx(ca, { className: "size-5" })
2666
+ children: /* @__PURE__ */ e.jsx(da, { className: "size-5" })
2667
2667
  }
2668
2668
  ),
2669
2669
  /* @__PURE__ */ e.jsx(
2670
2670
  w,
2671
2671
  {
2672
- onClick: () => l("table"),
2672
+ onClick: () => r("table"),
2673
2673
  variant: "ghost",
2674
2674
  children: /* @__PURE__ */ e.jsx(Cs, { className: "size-5" })
2675
2675
  }
@@ -2677,53 +2677,63 @@ function Hn() {
2677
2677
  /* @__PURE__ */ e.jsx(
2678
2678
  w,
2679
2679
  {
2680
- onClick: () => l("kpi"),
2680
+ onClick: () => r("kpi"),
2681
+ variant: "ghost",
2682
+ children: /* @__PURE__ */ e.jsx(ka, { className: "size-6" })
2683
+ }
2684
+ ),
2685
+ /* @__PURE__ */ e.jsx(
2686
+ w,
2687
+ {
2688
+ onClick: () => r("text"),
2681
2689
  variant: "ghost",
2682
- children: /* @__PURE__ */ e.jsx(Sa, { className: "size-6" })
2690
+ children: /* @__PURE__ */ e.jsx(Ms, { className: "size-4" })
2683
2691
  }
2684
2692
  )
2685
2693
  ] }) })
2686
2694
  ] });
2687
2695
  }
2688
- function Bn({ chartType: s, className: n }) {
2696
+ function $n({ chartType: s, className: n }) {
2689
2697
  switch (s) {
2690
2698
  case "bar":
2691
- return /* @__PURE__ */ e.jsx(zs, { className: n });
2692
- case "line":
2693
2699
  return /* @__PURE__ */ e.jsx(Fs, { className: n });
2700
+ case "line":
2701
+ return /* @__PURE__ */ e.jsx(Os, { className: n });
2694
2702
  case "pie":
2695
- return /* @__PURE__ */ e.jsx(ha, { className: n });
2703
+ return /* @__PURE__ */ e.jsx(ma, { className: n });
2696
2704
  case "radar":
2697
- return /* @__PURE__ */ e.jsx(ba, { className: n });
2705
+ return /* @__PURE__ */ e.jsx(ya, { className: n });
2698
2706
  case "scatter":
2699
- return /* @__PURE__ */ e.jsx(ma, { className: n });
2707
+ return /* @__PURE__ */ e.jsx(ua, { className: n });
2700
2708
  case "bubble":
2701
- return /* @__PURE__ */ e.jsx(Na, { className: n });
2709
+ return /* @__PURE__ */ e.jsx(Ca, { className: n });
2702
2710
  case "doughnut":
2703
- return /* @__PURE__ */ e.jsx(ya, { className: n });
2711
+ return /* @__PURE__ */ e.jsx(va, { className: n });
2704
2712
  case "stackedBar":
2705
- return /* @__PURE__ */ e.jsx(Ca, { className: "size-4 text-foreground/70" });
2713
+ return /* @__PURE__ */ e.jsx(Sa, { className: "size-4 text-foreground/70" });
2706
2714
  case "polarArea":
2707
- return /* @__PURE__ */ e.jsx(va, { className: n });
2715
+ return /* @__PURE__ */ e.jsx(Na, { className: n });
2708
2716
  case "pyramid":
2709
- return /* @__PURE__ */ e.jsx(ka, { className: n });
2717
+ return /* @__PURE__ */ e.jsx(wa, { className: n });
2710
2718
  case "range":
2711
- return /* @__PURE__ */ e.jsx(ca, { className: n });
2719
+ return /* @__PURE__ */ e.jsx(da, { className: n });
2712
2720
  case "kpi":
2713
- return /* @__PURE__ */ e.jsx(Sa, { className: n });
2721
+ return /* @__PURE__ */ e.jsx(ka, { className: n });
2722
+ case "text":
2723
+ return /* @__PURE__ */ e.jsx(Ms, { className: n });
2714
2724
  default:
2715
2725
  return /* @__PURE__ */ e.jsx(Cs, { className: n });
2716
2726
  }
2717
2727
  }
2718
- function $n() {
2728
+ function Pn() {
2719
2729
  const s = i(
2720
2730
  (a) => a.card.refreshInterval
2721
2731
  ), n = i(
2722
2732
  (a) => a.actions.setCardRefreshInterval
2723
2733
  );
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" }) }) }),
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: [
2734
+ return /* @__PURE__ */ e.jsxs(Ue, { children: [
2735
+ /* @__PURE__ */ e.jsx(Ge, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Qt, { className: "w-4 h-4" }) }) }),
2736
+ /* @__PURE__ */ e.jsx(Je, { 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: [
2727
2737
  /* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
2728
2738
  /* @__PURE__ */ e.jsx(
2729
2739
  ae,
@@ -2738,27 +2748,43 @@ function $n() {
2738
2748
  ] }) }) }) })
2739
2749
  ] });
2740
2750
  }
2741
- function $s() {
2751
+ function Ks() {
2742
2752
  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: [
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" }),
2753
+ const s = i((r) => r.card), n = i((r) => r.card.data), a = i((r) => r.isShowingVisual), t = i((r) => r.isSqlRunning), l = i((r) => r.queryError), o = i((r) => r.pythonStdOut);
2754
+ if (i((r) => r.onSave), i((r) => r.onClose), i((r) => r.actions.setCardSql), i((r) => r.actions.setCardType), i((r) => r.actions.setSqlGen), !s)
2755
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
2756
+ function d() {
2757
+ return 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(Ot, { isLoading: t, card: s }) }) }) : s.type === "text" ? /* @__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(Mt, { isLoading: t, card: s }) }) }) : /* @__PURE__ */ e.jsx(ba, { className: "grow border-none shadow-none" });
2758
+ }
2759
+ return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
2760
+ t && /* @__PURE__ */ e.jsx($e, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
2746
2761
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
2747
2762
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2748
- /* @__PURE__ */ e.jsx(Hn, {}),
2749
- s.type !== "table" && /* @__PURE__ */ e.jsx(_n, {}),
2750
- /* @__PURE__ */ e.jsx($n, {})
2763
+ /* @__PURE__ */ e.jsx(Bn, {}),
2764
+ s.type !== "table" && /* @__PURE__ */ e.jsx(Hn, {}),
2765
+ /* @__PURE__ */ e.jsx(Pn, {})
2751
2766
  ] }),
2752
- /* @__PURE__ */ e.jsx(Kn, {})
2767
+ /* @__PURE__ */ e.jsx(Un, {})
2753
2768
  ] }),
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: [
2755
- c && /* @__PURE__ */ e.jsx(Pn, {}),
2756
- s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(Rn, { data: n || [] }),
2757
- o && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: o })
2758
- ] })
2759
- ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
2769
+ a ? d() : (
2770
+ // card.type === 'kpi' ? (
2771
+ // <div className="flex grow items-center justify-center">
2772
+ // <div className="w-1/2 rounded-md border">
2773
+ // <KPICard isLoading={isSqlRunning} card={card} />
2774
+ // </div>
2775
+ // </div>
2776
+ // ) : (
2777
+ // <EditorCard className="grow border-none shadow-none" />
2778
+ // )
2779
+ /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
2780
+ o && /* @__PURE__ */ e.jsx(Kn, {}),
2781
+ s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(_n, { data: n || [] }),
2782
+ l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: l })
2783
+ ] })
2784
+ )
2785
+ ] });
2760
2786
  }
2761
- function Pn() {
2787
+ function Kn() {
2762
2788
  const s = i((a) => a.pythonStdOut);
2763
2789
  if (!s)
2764
2790
  return null;
@@ -2775,14 +2801,14 @@ function Pn() {
2775
2801
  /* @__PURE__ */ e.jsx(ks, { className: "mb-2" })
2776
2802
  ] });
2777
2803
  }
2778
- function Kn() {
2804
+ function Un() {
2779
2805
  const s = i((a) => a.isShowingVisual), n = i(
2780
2806
  (a) => a.actions.setIsShowingVisual
2781
2807
  );
2782
2808
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2783
2809
  /* @__PURE__ */ e.jsx(B, { htmlFor: "visualize", children: "Chart" }),
2784
2810
  /* @__PURE__ */ e.jsx(
2785
- Ot,
2811
+ Tt,
2786
2812
  {
2787
2813
  checked: s,
2788
2814
  onCheckedChange: () => n(!s),
@@ -2792,12 +2818,12 @@ function Kn() {
2792
2818
  )
2793
2819
  ] });
2794
2820
  }
2795
- function De() {
2821
+ function Ie() {
2796
2822
  const [s, n] = T([]);
2797
2823
  i(
2798
2824
  (m) => m.card.cfg
2799
2825
  );
2800
- const a = i((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: o, setCardPreferences: c } = i((m) => m.actions), r = i(
2826
+ const a = i((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: l, setCardPreferences: o } = i((m) => m.actions), d = i(
2801
2827
  (m) => m.queryResultColumns
2802
2828
  );
2803
2829
  i(
@@ -2806,11 +2832,11 @@ function De() {
2806
2832
  return (u = m.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
2807
2833
  }
2808
2834
  ), P(() => {
2809
- r && n(new Array(r.length).fill(!1));
2810
- }, [r]);
2811
- function l(m, u) {
2835
+ d && n(new Array(d.length).fill(!1));
2836
+ }, [d]);
2837
+ function r(m, u) {
2812
2838
  var S, h;
2813
- u ? a != null && a.onClickFilter && ((S = a == null ? void 0 : a.onClickFilter) == null ? void 0 : S.length) > 0 ? c({
2839
+ u ? a != null && a.onClickFilter && ((S = a == null ? void 0 : a.onClickFilter) == null ? void 0 : S.length) > 0 ? o({
2814
2840
  ...a,
2815
2841
  onClickFilter: [
2816
2842
  ...a.onClickFilter,
@@ -2819,7 +2845,7 @@ function De() {
2819
2845
  expression: ""
2820
2846
  }
2821
2847
  ]
2822
- }) : c({
2848
+ }) : o({
2823
2849
  ...a,
2824
2850
  onClickFilter: [
2825
2851
  {
@@ -2827,7 +2853,7 @@ function De() {
2827
2853
  expression: ""
2828
2854
  }
2829
2855
  ]
2830
- }) : (c({
2856
+ }) : (o({
2831
2857
  ...a,
2832
2858
  onClickFilter: (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.filter(
2833
2859
  (x) => x.columnIndex !== m
@@ -2837,13 +2863,13 @@ function De() {
2837
2863
  return g[m] = !1, g;
2838
2864
  }));
2839
2865
  }
2840
- function d(m, u) {
2866
+ function c(m, u) {
2841
2867
  var h;
2842
2868
  const S = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((x) => x.columnIndex === m ? {
2843
2869
  ...x,
2844
2870
  expression: u.target.value
2845
2871
  } : x);
2846
- c({
2872
+ o({
2847
2873
  ...a,
2848
2874
  onClickFilter: S
2849
2875
  });
@@ -2855,14 +2881,14 @@ function De() {
2855
2881
  ae,
2856
2882
  {
2857
2883
  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),
2884
+ onChange: (g) => c(m, g),
2859
2885
  type: "text",
2860
2886
  className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
2861
2887
  placeholder: "Expression"
2862
2888
  }
2863
2889
  );
2864
2890
  }
2865
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: r == null ? void 0 : r.map((m, u) => {
2891
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: d == null ? void 0 : d.map((m, u) => {
2866
2892
  var S, h;
2867
2893
  return /* @__PURE__ */ e.jsx(
2868
2894
  "div",
@@ -2871,12 +2897,12 @@ function De() {
2871
2897
  children: /* @__PURE__ */ e.jsxs("div", { className: " grow", children: [
2872
2898
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center py-2 space-x-2", children: [
2873
2899
  /* @__PURE__ */ e.jsx(
2874
- Pe,
2900
+ Ke,
2875
2901
  {
2876
2902
  checked: !!((S = a == null ? void 0 : a.onClickFilter) != null && S.find(
2877
2903
  (x) => x.columnIndex === u
2878
2904
  )),
2879
- onCheckedChange: (x) => l(u, x)
2905
+ onCheckedChange: (x) => r(u, x)
2880
2906
  }
2881
2907
  ),
2882
2908
  /* @__PURE__ */ e.jsx(
@@ -2889,7 +2915,7 @@ function De() {
2889
2915
  /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find(
2890
2916
  (x) => x.columnIndex === u
2891
2917
  )) && /* @__PURE__ */ e.jsx(
2892
- da,
2918
+ ha,
2893
2919
  {
2894
2920
  onClick: () => {
2895
2921
  n((x) => {
@@ -2908,29 +2934,29 @@ function De() {
2908
2934
  );
2909
2935
  }) });
2910
2936
  }
2911
- function ss() {
2912
- var r, l, d;
2937
+ function as() {
2938
+ var d, r, c;
2913
2939
  const s = i((f) => f.card.preferences), n = i(
2914
2940
  (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);
2941
+ ), { setCardCfg: a, setCardPreferences: t, setChartOrientation: l } = i((f) => f.actions);
2942
+ (d = n == null ? void 0 : n.options) != null && d.indexAxis;
2943
+ function o(f) {
2944
+ l(f);
2919
2945
  }
2920
2946
  return /* @__PURE__ */ e.jsxs(
2921
- la,
2947
+ ws,
2922
2948
  {
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,
2949
+ value: ((r = s == null ? void 0 : s.chartOptions) == null ? void 0 : r.indexAxis) || ((c = n == null ? void 0 : n.options) == null ? void 0 : c.indexAxis) || "x",
2950
+ onValueChange: o,
2925
2951
  className: "flex gap-3",
2926
2952
  defaultValue: "x",
2927
2953
  children: [
2928
2954
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2929
- /* @__PURE__ */ e.jsx(Ye, { value: "x", id: "r1" }),
2955
+ /* @__PURE__ */ e.jsx(De, { value: "x", id: "r1" }),
2930
2956
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
2931
2957
  ] }),
2932
2958
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2933
- /* @__PURE__ */ e.jsx(Ye, { value: "y", id: "r2" }),
2959
+ /* @__PURE__ */ e.jsx(De, { value: "y", id: "r2" }),
2934
2960
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
2935
2961
  ] })
2936
2962
  ]
@@ -2938,12 +2964,12 @@ function ss() {
2938
2964
  );
2939
2965
  }
2940
2966
  const we = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
2941
- function Ps(s, n) {
2942
- var t, o, c;
2943
- const a = ia(s, n);
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";
2967
+ function Us(s, n) {
2968
+ var t, l, o;
2969
+ const a = oa(s, n);
2970
+ return ((o = (l = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : l[a]) == null ? void 0 : o.type) || "linear";
2945
2971
  }
2946
- function wa() {
2972
+ function za() {
2947
2973
  var Q, ee, Z, J, I, y;
2948
2974
  const [s, n] = T(!1), a = i((v) => {
2949
2975
  var M;
@@ -2951,26 +2977,26 @@ function wa() {
2951
2977
  }), t = i((v) => {
2952
2978
  var M;
2953
2979
  return (M = v.card) == null ? void 0 : M.cfg;
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) || ""
2980
+ }), l = oa(a, t), [o, d] = T(
2981
+ Us(a)
2982
+ ), [r, c] = T(
2983
+ ((Z = (ee = (Q = a == null ? void 0 : a.chartOptions) == null ? void 0 : Q.scales) == null ? void 0 : ee[l]) == null ? void 0 : Z.min) || ""
2958
2984
  ), [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(
2985
+ ((y = (I = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[l]) == null ? void 0 : y.max) || ""
2986
+ ), [u, S] = T(r || f ? "custom" : "auto"), [h, x] = T(""), [g, z] = T(0), [b, L] = T(""), [N, O] = T(""), [j, F] = T(""), A = i(
2961
2987
  (v) => v.actions.setCardPreferences
2962
- ), q = i((v) => {
2988
+ ), V = i((v) => {
2963
2989
  var M;
2964
2990
  return (M = v.card) == null ? void 0 : M.type;
2965
- }), K = ["pie", "doughnut", "polarArea"].includes(q);
2991
+ }), K = ["pie", "doughnut", "polarArea"].includes(V);
2966
2992
  P(() => {
2967
2993
  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) || ""
2994
+ d(Us(a)), c(
2995
+ ((H = (M = (v = a == null ? void 0 : a.chartOptions) == null ? void 0 : v.scales) == null ? void 0 : M[l]) == null ? void 0 : H.min) === 0 ? 0 : ""
2996
+ ), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[l]) == null ? void 0 : ge.max) || ""), x(
2997
+ ((U = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[l]) == null ? void 0 : xe.ticks) == null ? void 0 : U.stepSize) || ""
2972
2998
  ), 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]);
2999
+ }, [s, a, l]);
2974
3000
  function $(v, M) {
2975
3001
  return M === "" || /^[0-9\b]+$/.test(M) ? Number(M) : Number(v);
2976
3002
  }
@@ -3035,8 +3061,8 @@ function wa() {
3035
3061
  ae,
3036
3062
  {
3037
3063
  id: "min",
3038
- value: l,
3039
- onChange: (v) => d((M) => $(M, v.target.value)),
3064
+ value: r,
3065
+ onChange: (v) => c((M) => $(M, v.target.value)),
3040
3066
  className: `col-span-1 h-8 w-full ${we}`
3041
3067
  }
3042
3068
  ),
@@ -3068,7 +3094,7 @@ function wa() {
3068
3094
  var H;
3069
3095
  let v = {};
3070
3096
  u === "custom" && (v = {
3071
- min: l,
3097
+ min: r,
3072
3098
  max: f,
3073
3099
  ticks: {
3074
3100
  stepSize: h
@@ -3080,10 +3106,10 @@ function wa() {
3080
3106
  ...a == null ? void 0 : a.chartOptions,
3081
3107
  scales: {
3082
3108
  ...(H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales,
3083
- [o]: {
3109
+ [l]: {
3084
3110
  // ...cardPreferences?.chartOptions?.scales?.[axis],
3085
- type: c,
3086
- ...c === "linear" ? v : {}
3111
+ type: o,
3112
+ ...o === "linear" ? v : {}
3087
3113
  }
3088
3114
  }
3089
3115
  },
@@ -3096,9 +3122,9 @@ function wa() {
3096
3122
  };
3097
3123
  console.log(M), A(M);
3098
3124
  }
3099
- return /* @__PURE__ */ e.jsxs(Ke, { onOpenChange: (v) => n(v), children: [
3100
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Mt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3101
- /* @__PURE__ */ e.jsx(Ge, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3125
+ return /* @__PURE__ */ e.jsxs(Ue, { onOpenChange: (v) => n(v), children: [
3126
+ /* @__PURE__ */ e.jsx(Ge, { asChild: !0, children: /* @__PURE__ */ e.jsx(At, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3127
+ /* @__PURE__ */ e.jsx(Je, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3102
3128
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3103
3129
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
3104
3130
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
@@ -3110,11 +3136,11 @@ function wa() {
3110
3136
  Oe,
3111
3137
  {
3112
3138
  disabled: K,
3113
- value: c,
3114
- onValueChange: (v) => r(v),
3139
+ value: o,
3140
+ onValueChange: (v) => d(v),
3115
3141
  children: [
3116
3142
  /* @__PURE__ */ e.jsx(Me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3117
- /* @__PURE__ */ e.jsx(Ae, { id: "type", children: /* @__PURE__ */ e.jsxs(He, { children: [
3143
+ /* @__PURE__ */ e.jsx(Ae, { id: "type", children: /* @__PURE__ */ e.jsxs(Be, { children: [
3118
3144
  /* @__PURE__ */ e.jsx(Le, { children: "Option" }),
3119
3145
  /* @__PURE__ */ e.jsx(X, { value: "linear", children: "Linear" }),
3120
3146
  /* @__PURE__ */ e.jsx(X, { value: "logarithmic", children: "Logarithmic" })
@@ -3123,10 +3149,10 @@ function wa() {
3123
3149
  }
3124
3150
  )
3125
3151
  ] }),
3126
- c == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3152
+ o == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3127
3153
  /* @__PURE__ */ e.jsx(B, { htmlFor: "scale-option", children: "Setup" }),
3128
3154
  /* @__PURE__ */ e.jsxs(
3129
- la,
3155
+ ws,
3130
3156
  {
3131
3157
  disabled: K,
3132
3158
  id: "scale-option",
@@ -3136,20 +3162,20 @@ function wa() {
3136
3162
  defaultValue: "x",
3137
3163
  children: [
3138
3164
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3139
- /* @__PURE__ */ e.jsx(Ye, { value: "auto", id: "r1" }),
3165
+ /* @__PURE__ */ e.jsx(De, { value: "auto", id: "r1" }),
3140
3166
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
3141
3167
  ] }),
3142
3168
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3143
- /* @__PURE__ */ e.jsx(Ye, { value: "custom", id: "r2" }),
3169
+ /* @__PURE__ */ e.jsx(De, { value: "custom", id: "r2" }),
3144
3170
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
3145
3171
  ] })
3146
3172
  ]
3147
3173
  }
3148
3174
  )
3149
3175
  ] }),
3150
- u === "custom" && c == "linear" && D(),
3176
+ u === "custom" && o == "linear" && D(),
3151
3177
  G(),
3152
- /* @__PURE__ */ e.jsx(Tt, {}),
3178
+ /* @__PURE__ */ e.jsx(Et, {}),
3153
3179
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
3154
3180
  w,
3155
3181
  {
@@ -3163,28 +3189,28 @@ function wa() {
3163
3189
  ] }) })
3164
3190
  ] });
3165
3191
  }
3166
- function Un({ idx: s }) {
3167
- var l;
3168
- const n = i((d) => {
3192
+ function Gn({ idx: s }) {
3193
+ var r;
3194
+ const n = i((c) => {
3169
3195
  var f;
3170
- return (f = d.card) == null ? void 0 : f.preferences;
3196
+ return (f = c.card) == null ? void 0 : f.preferences;
3171
3197
  }), a = i(
3172
- (d) => {
3198
+ (c) => {
3173
3199
  var f;
3174
- return (f = d.card.preferences) == null ? void 0 : f.datasetOptions;
3200
+ return (f = c.card.preferences) == null ? void 0 : f.datasetOptions;
3175
3201
  }
3176
3202
  ), 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());
3203
+ (c) => c.actions.setCardPreferences
3204
+ ), l = (r = n == null ? void 0 : n.chartOptions) == null ? void 0 : r.indexAxis, o = a == null ? void 0 : a.find((c) => c.idx === s);
3205
+ function d(c, f) {
3206
+ (c === "end" || c === "start") && Dt(It());
3181
3207
  const m = {
3182
- display: d !== "none",
3183
- align: d,
3184
- anchor: d,
3208
+ display: c !== "none",
3209
+ align: c,
3210
+ anchor: c,
3185
3211
  clamp: !0
3186
3212
  };
3187
- if (!c)
3213
+ if (!o)
3188
3214
  t({
3189
3215
  ...n,
3190
3216
  datasetOptions: [
@@ -3196,7 +3222,7 @@ function Un({ idx: s }) {
3196
3222
  ]
3197
3223
  });
3198
3224
  else {
3199
- const u = { ...c };
3225
+ const u = { ...o };
3200
3226
  u.datalabels = m;
3201
3227
  const S = a == null ? void 0 : a.map(
3202
3228
  (h) => h.idx === f ? u : h
@@ -3207,31 +3233,31 @@ function Un({ idx: s }) {
3207
3233
  });
3208
3234
  }
3209
3235
  }
3210
- return /* @__PURE__ */ e.jsxs(Ke, { children: [
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" }) }),
3212
- /* @__PURE__ */ e.jsx(Ge, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3236
+ return /* @__PURE__ */ e.jsxs(Ue, { children: [
3237
+ /* @__PURE__ */ e.jsx(Ge, { children: /* @__PURE__ */ e.jsx(fn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3238
+ /* @__PURE__ */ e.jsx(Je, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3213
3239
  /* @__PURE__ */ e.jsx(
3214
3240
  w,
3215
3241
  {
3216
- onClick: () => r("none", s),
3242
+ onClick: () => d("none", s),
3217
3243
  size: "sm",
3218
3244
  variant: "secondary",
3219
3245
  className: "h-7 p-1 text-xs font-normal",
3220
- children: /* @__PURE__ */ e.jsx(At, { className: "size-4" })
3246
+ children: /* @__PURE__ */ e.jsx(Lt, { className: "size-4" })
3221
3247
  }
3222
3248
  ),
3223
3249
  /* @__PURE__ */ e.jsx(
3224
3250
  w,
3225
3251
  {
3226
- onClick: () => r("start", s),
3252
+ onClick: () => d("start", s),
3227
3253
  size: "sm",
3228
3254
  variant: "secondary",
3229
3255
  className: "h-7 p-1 text-xs font-normal",
3230
3256
  children: /* @__PURE__ */ e.jsx(
3231
- an,
3257
+ nn,
3232
3258
  {
3233
3259
  className: Y("h-4 w-4", {
3234
- "rotate-90": o === "y"
3260
+ "rotate-90": l === "y"
3235
3261
  })
3236
3262
  }
3237
3263
  )
@@ -3240,15 +3266,15 @@ function Un({ idx: s }) {
3240
3266
  /* @__PURE__ */ e.jsx(
3241
3267
  w,
3242
3268
  {
3243
- onClick: () => r("center", s),
3269
+ onClick: () => d("center", s),
3244
3270
  size: "sm",
3245
3271
  variant: "secondary",
3246
3272
  className: "h-7 p-1 text-xs font-normal",
3247
3273
  children: /* @__PURE__ */ e.jsx(
3248
- nn,
3274
+ ln,
3249
3275
  {
3250
3276
  className: Y("h-4 w-4", {
3251
- "rotate-90": o === "y"
3277
+ "rotate-90": l === "y"
3252
3278
  })
3253
3279
  }
3254
3280
  )
@@ -3257,15 +3283,15 @@ function Un({ idx: s }) {
3257
3283
  /* @__PURE__ */ e.jsx(
3258
3284
  w,
3259
3285
  {
3260
- onClick: () => r("end", s),
3286
+ onClick: () => d("end", s),
3261
3287
  size: "sm",
3262
3288
  variant: "secondary",
3263
3289
  className: "h-7 p-1 text-xs font-normal",
3264
3290
  children: /* @__PURE__ */ e.jsx(
3265
- tn,
3291
+ rn,
3266
3292
  {
3267
3293
  className: Y("h-4 w-4", {
3268
- "rotate-90": o === "y"
3294
+ "rotate-90": l === "y"
3269
3295
  })
3270
3296
  }
3271
3297
  )
@@ -3274,71 +3300,71 @@ function Un({ idx: s }) {
3274
3300
  ] }) })
3275
3301
  ] });
3276
3302
  }
3277
- function za() {
3278
- const s = i((d) => d.card), n = i(
3279
- (d) => {
3303
+ function Fa() {
3304
+ const s = i((c) => c.card), n = i(
3305
+ (c) => {
3280
3306
  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;
3307
+ return (u = (m = (f = c == null ? void 0 : c.card) == null ? void 0 : f.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : u.indexAxis;
3282
3308
  }
3283
3309
  ), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
3284
- keys: o,
3285
- metricKeys: c,
3286
- dimensionKeys: r
3310
+ keys: l,
3311
+ metricKeys: o,
3312
+ dimensionKeys: d
3287
3313
  } = ms(s.data || []);
3288
- let l = c;
3314
+ let r = o;
3289
3315
  if (s.type === "stackedBar") {
3290
- const d = Dt({
3316
+ const c = Vt({
3291
3317
  dataArray: s.data || [],
3292
- groupKey: r[0],
3293
- pivotKey: r[1],
3294
- valueKey: l[0]
3295
- }), { metricKeys: f } = ms(d);
3296
- l = f;
3318
+ groupKey: d[0],
3319
+ pivotKey: d[1],
3320
+ valueKey: r[0]
3321
+ }), { metricKeys: f } = ms(c);
3322
+ r = f;
3297
3323
  }
3298
- return o.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3324
+ return l.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3299
3325
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3300
3326
  /* @__PURE__ */ e.jsx(B, { children: a }),
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] }) }) })
3327
+ /* @__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: d[0] }) }) })
3302
3328
  ] }),
3303
3329
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3304
3330
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
3305
3331
  /* @__PURE__ */ e.jsx(B, { children: t }),
3306
- /* @__PURE__ */ e.jsx(wa, {})
3332
+ /* @__PURE__ */ e.jsx(za, {})
3307
3333
  ] }),
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)) })
3334
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: r.map((c, f) => /* @__PURE__ */ e.jsx(Jn, { col: c, idx: f }, c)) })
3309
3335
  ] })
3310
3336
  ] });
3311
3337
  }
3312
- function Gn({ col: s, idx: n }) {
3313
- const a = i((l) => {
3314
- var d;
3315
- return (d = l.card) == null ? void 0 : d.preferences;
3338
+ function Jn({ col: s, idx: n }) {
3339
+ const a = i((r) => {
3340
+ var c;
3341
+ return (c = r.card) == null ? void 0 : c.preferences;
3316
3342
  }), t = i(
3317
- (l) => {
3318
- var d;
3319
- return (d = l.card.preferences) == null ? void 0 : d.datasetOptions;
3343
+ (r) => {
3344
+ var c;
3345
+ return (c = r.card.preferences) == null ? void 0 : c.datasetOptions;
3320
3346
  }
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({
3347
+ ), l = t == null ? void 0 : t.find((r) => r.idx === n), { setCardPreferences: o } = i((r) => r.actions);
3348
+ function d(r) {
3349
+ if (!l)
3350
+ o({
3325
3351
  ...a,
3326
3352
  datasetOptions: [
3327
3353
  ...t || [],
3328
3354
  {
3329
3355
  idx: n,
3330
- type: l === "area" ? "line" : l,
3331
- fill: l === "area" ? "origin" : ""
3356
+ type: r === "area" ? "line" : r,
3357
+ fill: r === "area" ? "origin" : ""
3332
3358
  }
3333
3359
  ]
3334
3360
  });
3335
3361
  else {
3336
- const d = { ...o };
3337
- d.type = l === "area" ? "line" : l, d.fill = l === "area" ? "origin" : "";
3362
+ const c = { ...l };
3363
+ c.type = r === "area" ? "line" : r, c.fill = r === "area" ? "origin" : "";
3338
3364
  const f = t == null ? void 0 : t.map(
3339
- (m) => m.idx === n ? d : m
3365
+ (m) => m.idx === n ? c : m
3340
3366
  );
3341
- c({
3367
+ o({
3342
3368
  ...a,
3343
3369
  datasetOptions: f
3344
3370
  });
@@ -3348,23 +3374,23 @@ function Gn({ col: s, idx: n }) {
3348
3374
  /* @__PURE__ */ e.jsx("p", { children: s }),
3349
3375
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3350
3376
  /* @__PURE__ */ e.jsx(
3351
- zs,
3377
+ Fs,
3352
3378
  {
3353
- onClick: () => r("bar"),
3379
+ onClick: () => d("bar"),
3354
3380
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3355
3381
  }
3356
3382
  ),
3357
3383
  /* @__PURE__ */ e.jsx(
3358
- Fs,
3384
+ Os,
3359
3385
  {
3360
- onClick: () => r("line"),
3386
+ onClick: () => d("line"),
3361
3387
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3362
3388
  }
3363
3389
  ),
3364
3390
  /* @__PURE__ */ e.jsx(
3365
- Jt,
3391
+ Wt,
3366
3392
  {
3367
- onClick: () => r("area"),
3393
+ onClick: () => d("area"),
3368
3394
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3369
3395
  }
3370
3396
  ),
@@ -3375,16 +3401,16 @@ function Gn({ col: s, idx: n }) {
3375
3401
  className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
3376
3402
  }
3377
3403
  ),
3378
- /* @__PURE__ */ e.jsx(Un, { idx: n })
3404
+ /* @__PURE__ */ e.jsx(Gn, { idx: n })
3379
3405
  ] })
3380
3406
  ] });
3381
3407
  }
3382
- function Jn({
3408
+ function Qn({
3383
3409
  cardType: s
3384
3410
  }) {
3385
3411
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3386
- /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3387
- /* @__PURE__ */ e.jsx(R, { children: `${ws(s)} Chart` }),
3412
+ /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3413
+ /* @__PURE__ */ e.jsx(R, { children: `${zs(s)} Chart` }),
3388
3414
  /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
3389
3415
  /* @__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" }),
3390
3416
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
@@ -3408,31 +3434,31 @@ function Jn({
3408
3434
  ] })
3409
3435
  ] })
3410
3436
  ] }),
3411
- /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3437
+ /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3412
3438
  /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3413
3439
  /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
3414
- /* @__PURE__ */ e.jsx(ss, {}),
3415
- /* @__PURE__ */ e.jsx(za, {})
3440
+ /* @__PURE__ */ e.jsx(as, {}),
3441
+ /* @__PURE__ */ e.jsx(Fa, {})
3416
3442
  ] })
3417
3443
  ] }),
3418
- /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3444
+ /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3419
3445
  /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3420
- /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3446
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
3421
3447
  ] })
3422
3448
  ] }) });
3423
3449
  }
3424
- function Os() {
3425
- var o, c, r;
3450
+ function Ts() {
3451
+ var l, o, d;
3426
3452
  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) {
3453
+ (r) => r.card.cfg
3454
+ ), n = i((r) => r.actions.setCardCfg), a = i((r) => r.card.type);
3455
+ function t(r) {
3430
3456
  var m;
3431
- const d = {
3457
+ const c = {
3432
3458
  datalabels: {
3433
- display: l !== "none",
3434
- align: l,
3435
- anchor: l,
3459
+ display: r !== "none",
3460
+ align: r,
3461
+ anchor: r,
3436
3462
  clamp: !0
3437
3463
  }
3438
3464
  }, f = {
@@ -3441,26 +3467,26 @@ function Os() {
3441
3467
  ...s == null ? void 0 : s.options,
3442
3468
  plugins: {
3443
3469
  ...(m = s == null ? void 0 : s.options) == null ? void 0 : m.plugins,
3444
- ...d
3470
+ ...c
3445
3471
  }
3446
3472
  }
3447
3473
  };
3448
- n(f), console.log(l);
3474
+ n(f), console.log(r);
3449
3475
  }
3450
3476
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3451
3477
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
3452
3478
  /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
3453
- !["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(wa, {})
3479
+ !["pyramid"].includes(a) && /* @__PURE__ */ e.jsx(za, {})
3454
3480
  ] }),
3455
3481
  /* @__PURE__ */ e.jsxs(
3456
3482
  Oe,
3457
3483
  {
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,
3484
+ value: (d = (o = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : d.anchor,
3459
3485
  onValueChange: t,
3460
3486
  defaultValue: "none",
3461
3487
  children: [
3462
3488
  /* @__PURE__ */ e.jsx(Me, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, { placeholder: "Select position" }) }),
3463
- /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3489
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(Be, { children: [
3464
3490
  /* @__PURE__ */ e.jsx(Le, { children: "Data Labels" }),
3465
3491
  /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
3466
3492
  a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "start", children: "Start" }),
@@ -3472,13 +3498,13 @@ function Os() {
3472
3498
  )
3473
3499
  ] });
3474
3500
  }
3475
- function Qn({
3501
+ function Wn({
3476
3502
  cardType: s
3477
3503
  }) {
3478
3504
  function n(a) {
3479
- const t = "SELECT label, [group], x-axis, y-axis, radius FROM table", o = "SELECT label, [group], x-axis, y-axis FROM table";
3505
+ const t = "SELECT label, [group], x-axis, y-axis, radius FROM table", l = "SELECT label, [group], x-axis, y-axis FROM table";
3480
3506
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3481
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: a === "bubble" ? t : o }),
3507
+ /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: a === "bubble" ? t : l }),
3482
3508
  /* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
3483
3509
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
3484
3510
  /* @__PURE__ */ e.jsx("li", { children: "group - category" }),
@@ -3492,7 +3518,7 @@ function Qn({
3492
3518
  "a",
3493
3519
  {
3494
3520
  target: "_blank",
3495
- onClick: (c) => c.stopPropagation(),
3521
+ onClick: (o) => o.stopPropagation(),
3496
3522
  className: "text-blue-700",
3497
3523
  href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
3498
3524
  children: "example"
@@ -3503,21 +3529,21 @@ function Qn({
3503
3529
  ] });
3504
3530
  }
3505
3531
  return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3506
- /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3507
- /* @__PURE__ */ e.jsx(R, { children: `${ws(s)} Chart` }),
3532
+ /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3533
+ /* @__PURE__ */ e.jsx(R, { children: `${zs(s)} Chart` }),
3508
3534
  /* @__PURE__ */ e.jsx(_, { className: " space-y-4 font-mono text-xs ", children: n(s) })
3509
3535
  ] }),
3510
- /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3536
+ /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3511
3537
  /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3512
- /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Os, {}) })
3538
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ts, {}) })
3513
3539
  ] }),
3514
- /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3540
+ /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3515
3541
  /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3516
- /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3542
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
3517
3543
  ] })
3518
3544
  ] }) });
3519
3545
  }
3520
- const Wn = {
3546
+ const Yn = {
3521
3547
  datasets: [
3522
3548
  {
3523
3549
  type: "line",
@@ -3530,7 +3556,7 @@ const Wn = {
3530
3556
  data: []
3531
3557
  }
3532
3558
  ]
3533
- }, Yn = {
3559
+ }, Xn = {
3534
3560
  datasets: [
3535
3561
  {
3536
3562
  fill: "origin",
@@ -3540,7 +3566,7 @@ const Wn = {
3540
3566
  }
3541
3567
  ]
3542
3568
  };
3543
- function Xn() {
3569
+ function Zn() {
3544
3570
  const s = i((n) => n.card.type);
3545
3571
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
3546
3572
  /* @__PURE__ */ e.jsx(
@@ -3549,18 +3575,18 @@ function Xn() {
3549
3575
  className: " ",
3550
3576
  type: "single",
3551
3577
  collapsible: !0,
3552
- children: Zn(s)
3578
+ children: er(s)
3553
3579
  }
3554
3580
  ),
3555
- /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(ss, {}) }),
3556
- /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Os, {}) }),
3557
- /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(De, {}) })
3581
+ /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(as, {}) }),
3582
+ /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Ts, {}) }),
3583
+ /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Ie, {}) })
3558
3584
  ] });
3559
3585
  }
3560
- function Zn(s) {
3586
+ function er(s) {
3561
3587
  if (["line", "bar"].includes(s))
3562
3588
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3563
- /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3589
+ /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3564
3590
  /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
3565
3591
  /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3566
3592
  /* @__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" }),
@@ -3570,7 +3596,7 @@ function Zn(s) {
3570
3596
  ] })
3571
3597
  ] })
3572
3598
  ] }),
3573
- /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3599
+ /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3574
3600
  /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Mixed Chart" }),
3575
3601
  /* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
3576
3602
  /* @__PURE__ */ e.jsxs("p", { children: [
@@ -3578,10 +3604,10 @@ function Zn(s) {
3578
3604
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
3579
3605
  " and change the `type` property in the dataset."
3580
3606
  ] }),
3581
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Wn, null, 2) })
3607
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Yn, null, 2) })
3582
3608
  ] })
3583
3609
  ] }),
3584
- /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3610
+ /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3585
3611
  /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Area Chart" }),
3586
3612
  /* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
3587
3613
  /* @__PURE__ */ e.jsxs("p", { children: [
@@ -3599,12 +3625,12 @@ function Zn(s) {
3599
3625
  ),
3600
3626
  "for more options."
3601
3627
  ] }),
3602
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Yn, null, 2) })
3628
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Xn, null, 2) })
3603
3629
  ] })
3604
3630
  ] })
3605
3631
  ] });
3606
3632
  if (s === "bubble")
3607
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3633
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3608
3634
  /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3609
3635
  "How to create a ",
3610
3636
  /* @__PURE__ */ e.jsx("span", { children: s }),
@@ -3622,7 +3648,7 @@ function Zn(s) {
3622
3648
  ] })
3623
3649
  ] }) });
3624
3650
  if (s === "scatter")
3625
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3651
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3626
3652
  /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3627
3653
  "How to create a ",
3628
3654
  /* @__PURE__ */ e.jsx("span", { children: s }),
@@ -3639,7 +3665,7 @@ function Zn(s) {
3639
3665
  ] })
3640
3666
  ] }) });
3641
3667
  if (["pie", "doughnut", "polarArea"].includes(s))
3642
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3668
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3643
3669
  /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3644
3670
  /* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
3645
3671
  " ",
@@ -3654,8 +3680,8 @@ function Zn(s) {
3654
3680
  ] })
3655
3681
  ] }) });
3656
3682
  }
3657
- function er() {
3658
- var d, f, m, u, S;
3683
+ function sr() {
3684
+ var c, f, m, u, S;
3659
3685
  const s = i((h) => h.card.preferences), n = i(
3660
3686
  (h) => h.actions.setCardPreferences
3661
3687
  ), a = i(
@@ -3672,7 +3698,7 @@ function er() {
3672
3698
  var x, g;
3673
3699
  return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.locale;
3674
3700
  }
3675
- ), o = i(
3701
+ ), l = i(
3676
3702
  (h) => {
3677
3703
  var x, g;
3678
3704
  return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.currency;
@@ -3681,20 +3707,20 @@ function er() {
3681
3707
  i(
3682
3708
  (h) => h.actions.setFilterOnClickField
3683
3709
  );
3684
- const c = i(
3710
+ const o = i(
3685
3711
  (h) => {
3686
3712
  var x, g;
3687
3713
  return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.colorRanges;
3688
3714
  }
3689
- ) || [], r = i(
3715
+ ) || [], d = i(
3690
3716
  (h) => h.actions.setColorRanges
3691
- ), l = [...new Set(Rs.map((h) => h.currency))];
3717
+ ), r = [...new Set(Hs.map((h) => h.currency))];
3692
3718
  return /* @__PURE__ */ e.jsxs("div", { children: [
3693
3719
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
3694
3720
  /* @__PURE__ */ e.jsx(
3695
- Pe,
3721
+ Ke,
3696
3722
  {
3697
- checked: !!((d = s == null ? void 0 : s.formatNumber) != null && d.enabled),
3723
+ checked: !!((c = s == null ? void 0 : s.formatNumber) != null && c.enabled),
3698
3724
  onCheckedChange: (h) => {
3699
3725
  n({
3700
3726
  ...s,
@@ -3728,9 +3754,9 @@ function er() {
3728
3754
  },
3729
3755
  children: [
3730
3756
  /* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3731
- /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3757
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(Be, { children: [
3732
3758
  /* @__PURE__ */ e.jsx(Le, { children: "Format" }),
3733
- Rs.map((h) => /* @__PURE__ */ e.jsx(X, { value: h.locale, children: h.locale }, h.locale))
3759
+ Hs.map((h) => /* @__PURE__ */ e.jsx(X, { value: h.locale, children: h.locale }, h.locale))
3734
3760
  ] }) })
3735
3761
  ]
3736
3762
  }
@@ -3741,7 +3767,7 @@ function er() {
3741
3767
  /* @__PURE__ */ e.jsxs(
3742
3768
  Oe,
3743
3769
  {
3744
- value: o || "none",
3770
+ value: l || "none",
3745
3771
  onValueChange: (h) => {
3746
3772
  var x, g, z;
3747
3773
  return a(
@@ -3753,10 +3779,10 @@ function er() {
3753
3779
  },
3754
3780
  children: [
3755
3781
  /* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3756
- /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3782
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(Be, { children: [
3757
3783
  /* @__PURE__ */ e.jsx(Le, { children: "Currency" }),
3758
3784
  /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
3759
- l.map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h))
3785
+ r.map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h))
3760
3786
  ] }) })
3761
3787
  ]
3762
3788
  }
@@ -3810,18 +3836,18 @@ function er() {
3810
3836
  ] }) }),
3811
3837
  /* @__PURE__ */ e.jsx(ks, { className: "my-3" }),
3812
3838
  /* @__PURE__ */ e.jsx(
3813
- It,
3839
+ qt,
3814
3840
  {
3815
- colorRanges: c,
3816
- setColorRanges: r
3841
+ colorRanges: o,
3842
+ setColorRanges: d
3817
3843
  }
3818
3844
  )
3819
3845
  ] })
3820
3846
  ] });
3821
3847
  }
3822
- function sr() {
3848
+ function ar() {
3823
3849
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
3824
- /* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3850
+ /* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3825
3851
  /* @__PURE__ */ e.jsx(R, { className: "", children: "KPI Query" }),
3826
3852
  /* @__PURE__ */ e.jsxs(_, { className: "font-mono", children: [
3827
3853
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
@@ -3845,18 +3871,51 @@ function sr() {
3845
3871
  ] })
3846
3872
  ] })
3847
3873
  ] }) }),
3848
- /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(er, {}) }),
3874
+ /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(sr, {}) }),
3849
3875
  /* @__PURE__ */ e.jsx("div", {}),
3850
3876
  /* @__PURE__ */ e.jsx("div", {})
3851
3877
  ] });
3852
3878
  }
3853
- function cs({
3879
+ function tr() {
3880
+ var t;
3881
+ const s = i((l) => l.card.preferences), { setCardPreferences: n } = i((l) => l.actions);
3882
+ function a(l) {
3883
+ n({
3884
+ ...s,
3885
+ textVisualOptions: {
3886
+ ...s == null ? void 0 : s.textVisualOptions,
3887
+ isDynamicText: l === "dynamic"
3888
+ }
3889
+ });
3890
+ }
3891
+ return /* @__PURE__ */ e.jsxs(
3892
+ ws,
3893
+ {
3894
+ value: (t = s == null ? void 0 : s.textVisualOptions) != null && t.isDynamicText ? "dynamic" : "static",
3895
+ onValueChange: a,
3896
+ className: "flex gap-3",
3897
+ defaultValue: "x",
3898
+ children: [
3899
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3900
+ /* @__PURE__ */ e.jsx(De, { value: "static", id: "r1" }),
3901
+ /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Static" })
3902
+ ] }),
3903
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3904
+ /* @__PURE__ */ e.jsx(De, { value: "dynamic", id: "r2" }),
3905
+ /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Dynamic" })
3906
+ ] })
3907
+ ]
3908
+ }
3909
+ );
3910
+ }
3911
+ function Ye({
3854
3912
  cardType: s,
3855
- docContent: n
3913
+ docContent: n,
3914
+ suffix: a = "Chart"
3856
3915
  }) {
3857
3916
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3858
- /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3859
- /* @__PURE__ */ e.jsx(R, { children: `${ws(s)} Chart` }),
3917
+ /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3918
+ /* @__PURE__ */ e.jsx(R, { children: `${zs(s)} ${a}` }),
3860
3919
  /* @__PURE__ */ e.jsx(_, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3861
3920
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
3862
3921
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
@@ -3869,7 +3928,7 @@ function cs({
3869
3928
  "a",
3870
3929
  {
3871
3930
  target: "_blank",
3872
- onClick: (a) => a.stopPropagation(),
3931
+ onClick: (t) => t.stopPropagation(),
3873
3932
  className: "text-blue-700",
3874
3933
  href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
3875
3934
  children: "example"
@@ -3879,22 +3938,23 @@ function cs({
3879
3938
  ] })
3880
3939
  ] }) })
3881
3940
  ] }),
3882
- /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3941
+ /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3883
3942
  /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3884
3943
  /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
3885
- s === "range" && /* @__PURE__ */ e.jsx(ss, {}),
3886
- /* @__PURE__ */ e.jsx(Os, {})
3944
+ s === "range" && /* @__PURE__ */ e.jsx(as, {}),
3945
+ s !== "text" && /* @__PURE__ */ e.jsx(Ts, {}),
3946
+ s === "text" && /* @__PURE__ */ e.jsx(tr, {})
3887
3947
  ] })
3888
3948
  ] }),
3889
- s !== "range" && /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3949
+ !["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3890
3950
  /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3891
- /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3951
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
3892
3952
  ] })
3893
3953
  ] }) });
3894
3954
  }
3895
- function ar() {
3955
+ function nr() {
3896
3956
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3897
- /* @__PURE__ */ e.jsxs(V, { value: "item-1", children: [
3957
+ /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3898
3958
  /* @__PURE__ */ e.jsx(R, { children: "Stacked Chart" }),
3899
3959
  /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
3900
3960
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
@@ -3919,23 +3979,23 @@ function ar() {
3919
3979
  ] })
3920
3980
  ] })
3921
3981
  ] }),
3922
- /* @__PURE__ */ e.jsxs(V, { value: "item-2", children: [
3982
+ /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3923
3983
  /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3924
3984
  /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
3925
- /* @__PURE__ */ e.jsx(ss, {}),
3926
- /* @__PURE__ */ e.jsx(za, {})
3985
+ /* @__PURE__ */ e.jsx(as, {}),
3986
+ /* @__PURE__ */ e.jsx(Fa, {})
3927
3987
  ] })
3928
3988
  ] }),
3929
- /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
3989
+ /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3930
3990
  /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3931
- /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3991
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
3932
3992
  ] })
3933
3993
  ] }) });
3934
3994
  }
3935
- function tr({}) {
3995
+ function rr({}) {
3936
3996
  const s = i((t) => {
3937
- var o;
3938
- return (o = t.card) == null ? void 0 : o.preferences;
3997
+ var l;
3998
+ return (l = t.card) == null ? void 0 : l.preferences;
3939
3999
  }), n = i(
3940
4000
  (t) => t.actions.setCardPreferences
3941
4001
  ), a = (t) => {
@@ -3945,12 +4005,12 @@ function tr({}) {
3945
4005
  });
3946
4006
  };
3947
4007
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
3948
- /* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(V, { value: "item-3", children: [
4008
+ /* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3949
4009
  /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3950
- /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
4010
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ie, {}) })
3951
4011
  ] }) }),
3952
4012
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3953
- /* @__PURE__ */ e.jsx(Pe, { onCheckedChange: a, id: "allow-download" }),
4013
+ /* @__PURE__ */ e.jsx(Ke, { onCheckedChange: a, id: "allow-download" }),
3954
4014
  /* @__PURE__ */ e.jsx(
3955
4015
  "label",
3956
4016
  {
@@ -3962,7 +4022,7 @@ function tr({}) {
3962
4022
  ] })
3963
4023
  ] });
3964
4024
  }
3965
- const nr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
4025
+ const lr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3966
4026
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
3967
4027
  /* @__PURE__ */ e.jsxs("div", { children: [
3968
4028
  "See ",
@@ -3978,7 +4038,7 @@ const nr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
3978
4038
  ),
3979
4039
  " in the docs."
3980
4040
  ] })
3981
- ] }), rr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
4041
+ ] }), ir = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3982
4042
  /* @__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" }),
3983
4043
  /* @__PURE__ */ e.jsxs("div", { children: [
3984
4044
  "See ",
@@ -3994,39 +4054,64 @@ const nr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
3994
4054
  ),
3995
4055
  " in the docs."
3996
4056
  ] })
4057
+ ] }), or = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
4058
+ /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
4059
+ /* @__PURE__ */ e.jsxs("div", { children: [
4060
+ "See ",
4061
+ /* @__PURE__ */ e.jsx(
4062
+ "a",
4063
+ {
4064
+ target: "_blank",
4065
+ onClick: (s) => s.stopPropagation(),
4066
+ className: "text-blue-700",
4067
+ href: "https://docs.semaphor.cloud/concepts/visuals#text-visual",
4068
+ children: "example"
4069
+ }
4070
+ ),
4071
+ " in the docs."
4072
+ ] })
3997
4073
  ] });
3998
- function lr() {
4074
+ function cr() {
3999
4075
  const s = i((a) => a.card.type);
4000
4076
  function n(a) {
4001
4077
  switch (a) {
4002
4078
  case "stackedBar":
4003
- return /* @__PURE__ */ e.jsx(ar, {});
4079
+ return /* @__PURE__ */ e.jsx(nr, {});
4004
4080
  case "pyramid":
4005
- return /* @__PURE__ */ e.jsx(cs, { docContent: nr, cardType: a });
4081
+ return /* @__PURE__ */ e.jsx(Ye, { docContent: lr, cardType: a });
4006
4082
  case "kpi":
4007
- return /* @__PURE__ */ e.jsx(sr, {});
4083
+ return /* @__PURE__ */ e.jsx(ar, {});
4008
4084
  case "line":
4009
4085
  case "bar":
4010
- return /* @__PURE__ */ e.jsx(Jn, { cardType: a });
4086
+ return /* @__PURE__ */ e.jsx(Qn, { cardType: a });
4011
4087
  case "range":
4012
- return /* @__PURE__ */ e.jsx(cs, { docContent: rr, cardType: a });
4088
+ return /* @__PURE__ */ e.jsx(Ye, { docContent: ir, cardType: a });
4013
4089
  case "pie":
4014
4090
  case "doughnut":
4015
4091
  case "polarArea":
4016
4092
  case "radar":
4017
- return /* @__PURE__ */ e.jsx(cs, { cardType: a });
4093
+ return /* @__PURE__ */ e.jsx(Ye, { cardType: a });
4018
4094
  case "bubble":
4019
4095
  case "scatter":
4020
- return /* @__PURE__ */ e.jsx(Qn, { cardType: a });
4096
+ return /* @__PURE__ */ e.jsx(Wn, { cardType: a });
4021
4097
  case "table":
4022
- return /* @__PURE__ */ e.jsx(tr, { cardType: a });
4098
+ return /* @__PURE__ */ e.jsx(rr, { cardType: a });
4099
+ case "text":
4100
+ return /* @__PURE__ */ e.jsx(
4101
+ Ye,
4102
+ {
4103
+ docContent: or,
4104
+ cardType: a,
4105
+ suffix: "Visual"
4106
+ }
4107
+ );
4023
4108
  default:
4024
- return /* @__PURE__ */ e.jsx(Xn, {});
4109
+ return /* @__PURE__ */ e.jsx(Zn, {});
4025
4110
  }
4026
4111
  }
4027
4112
  return /* @__PURE__ */ e.jsx(Ss, { className: "h-full w-full text-sm", children: n(s) });
4028
4113
  }
4029
- function ir() {
4114
+ function dr() {
4030
4115
  const s = i((n) => n.isShowingVisual);
4031
4116
  return /* @__PURE__ */ e.jsxs(
4032
4117
  us,
@@ -4041,7 +4126,7 @@ function ir() {
4041
4126
  className: "flex",
4042
4127
  minSize: 20,
4043
4128
  defaultSize: 40,
4044
- children: /* @__PURE__ */ e.jsx(Vn, {})
4129
+ children: /* @__PURE__ */ e.jsx(Rn, {})
4045
4130
  }
4046
4131
  ),
4047
4132
  /* @__PURE__ */ e.jsx(xs, { withHandle: !0, className: "border" }),
@@ -4060,36 +4145,36 @@ function ir() {
4060
4145
  minSize: 20,
4061
4146
  defaultSize: 25,
4062
4147
  maxSize: 30,
4063
- children: /* @__PURE__ */ e.jsx(lr, {})
4148
+ children: /* @__PURE__ */ e.jsx(cr, {})
4064
4149
  }
4065
4150
  ) }),
4066
4151
  /* @__PURE__ */ e.jsx(xs, { className: "border" }),
4067
- /* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx($s, {}) })
4068
- ] }) : /* @__PURE__ */ e.jsx($s, {})
4152
+ /* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(Ks, {}) })
4153
+ ] }) : /* @__PURE__ */ e.jsx(Ks, {})
4069
4154
  }
4070
4155
  )
4071
4156
  ]
4072
4157
  }
4073
4158
  );
4074
4159
  }
4075
- function or({ authToken: s, onSave: n, onClose: a }) {
4076
- const t = i((r) => r.actions.setOnSave), o = i((r) => r.actions.setOnClose), c = k((r) => r.actions.setAuthToken);
4160
+ function hr({ authToken: s, onSave: n, onClose: a }) {
4161
+ const t = i((d) => d.actions.setOnSave), l = i((d) => d.actions.setOnClose), o = k((d) => d.actions.setAuthToken);
4077
4162
  return P(() => {
4078
- n && t(n), a && o(a);
4079
- }, [n, t, a, o]), P(() => {
4080
- s && s.accessToken && c(s);
4081
- }, [s, c]), /* @__PURE__ */ e.jsxs(qt, { className: "rounded-none", role: "editor-panel", children: [
4082
- /* @__PURE__ */ e.jsx(Vt, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(pa, {}) }),
4083
- /* @__PURE__ */ e.jsx(Rt, { children: /* @__PURE__ */ e.jsx(ir, {}) })
4163
+ n && t(n), a && l(a);
4164
+ }, [n, t, a, l]), P(() => {
4165
+ s && s.accessToken && o(s);
4166
+ }, [s, o]), /* @__PURE__ */ e.jsxs(Rt, { className: "rounded-none", role: "editor-panel", children: [
4167
+ /* @__PURE__ */ e.jsx(_t, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(fa, {}) }),
4168
+ /* @__PURE__ */ e.jsx(Ht, { children: /* @__PURE__ */ e.jsx(dr, {}) })
4084
4169
  ] });
4085
4170
  }
4086
- function cr() {
4087
- k((r) => r.selectedCardId);
4088
- const s = k((r) => r.selectedSheetId), { setIsVisualEditing: n } = k((r) => r.actions), a = k((r) => r.isVisualEditing), t = k((r) => r.actions.updateFrame);
4089
- function o(r) {
4090
- s && (t(s, r), n(!1));
4171
+ function mr() {
4172
+ k((d) => d.selectedCardId);
4173
+ const s = k((d) => d.selectedSheetId), { setIsVisualEditing: n } = k((d) => d.actions), a = k((d) => d.isVisualEditing), t = k((d) => d.actions.updateFrame);
4174
+ function l(d) {
4175
+ s && (t(s, d), n(!1));
4091
4176
  }
4092
- function c() {
4177
+ function o() {
4093
4178
  n(!1);
4094
4179
  }
4095
4180
  return /* @__PURE__ */ e.jsx(
@@ -4100,19 +4185,19 @@ function cr() {
4100
4185
  block: a,
4101
4186
  hidden: !a
4102
4187
  }),
4103
- children: /* @__PURE__ */ e.jsx(or, { onSave: o, onClose: c })
4188
+ children: /* @__PURE__ */ e.jsx(hr, { onSave: l, onClose: o })
4104
4189
  }
4105
4190
  );
4106
4191
  }
4107
- function dr({
4192
+ function ur({
4108
4193
  columns: s,
4109
4194
  tableName: n
4110
4195
  }) {
4111
- 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(
4196
+ const a = i((u) => u.selectedConnectionId), t = i((u) => u.selectedDatabaseName), l = i((u) => u.selectedSchemaName), o = i((u) => u.selectedTableName), d = k((u) => u.dashboard.filters) || [], r = k((u) => u.actions.addFilter), c = k((u) => u.actions.removeFilter), f = k(
4112
4197
  (u) => u.actions.removeFilterValue
4113
4198
  );
4114
4199
  function m(u) {
4115
- const S = he(u.column_name), h = he(t || ""), x = he(o || ""), g = he(n), z = hs(
4200
+ const S = he(u.column_name), h = he(t || ""), x = he(l || ""), g = he(n), z = hs(
4116
4201
  x,
4117
4202
  g
4118
4203
  ), b = `${z}.${S}`;
@@ -4122,15 +4207,15 @@ function dr({
4122
4207
  g,
4123
4208
  h
4124
4209
  );
4125
- const L = r == null ? void 0 : r.find(
4210
+ const L = d == null ? void 0 : d.find(
4126
4211
  (N) => N.column === b && N.table === g && (N.database === h || N.database === t)
4127
4212
  );
4128
4213
  if (L)
4129
- f(L.id), d(L.id);
4214
+ f(L.id), c(L.id);
4130
4215
  else {
4131
4216
  if (n === "api" && a) {
4132
- l({
4133
- id: We(),
4217
+ r({
4218
+ id: Xe(),
4134
4219
  column: b,
4135
4220
  title: u.column_name,
4136
4221
  dataType: u.data_type,
@@ -4139,7 +4224,7 @@ function dr({
4139
4224
  // database: 'NA',
4140
4225
  connectionId: a,
4141
4226
  operation: "in",
4142
- sql: _s(
4227
+ sql: Bs(
4143
4228
  u.data_type,
4144
4229
  z,
4145
4230
  S
@@ -4148,16 +4233,16 @@ function dr({
4148
4233
  });
4149
4234
  return;
4150
4235
  }
4151
- l({
4152
- id: We(),
4236
+ r({
4237
+ id: Xe(),
4153
4238
  column: `${z}.${S}`,
4154
4239
  title: u.column_name,
4155
4240
  dataType: u.data_type,
4156
- table: c || "",
4241
+ table: o || "",
4157
4242
  database: t || "",
4158
4243
  connectionId: a || "",
4159
4244
  operation: "in",
4160
- sql: _s(
4245
+ sql: Bs(
4161
4246
  u.data_type,
4162
4247
  z,
4163
4248
  S
@@ -4167,8 +4252,8 @@ function dr({
4167
4252
  }
4168
4253
  }
4169
4254
  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) => {
4170
- const S = r == null ? void 0 : r.find(
4171
- (h) => h.column === he(u.column_name) && h.table === c && h.database === t
4255
+ const S = d == null ? void 0 : d.find(
4256
+ (h) => h.column === he(u.column_name) && h.table === o && h.database === t
4172
4257
  );
4173
4258
  return /* @__PURE__ */ e.jsx(
4174
4259
  "div",
@@ -4181,7 +4266,7 @@ function dr({
4181
4266
  }
4182
4267
  ),
4183
4268
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
4184
- /* @__PURE__ */ e.jsx(ua, { column: u }),
4269
+ /* @__PURE__ */ e.jsx(xa, { column: u }),
4185
4270
  /* @__PURE__ */ e.jsx("span", { children: u.column_name })
4186
4271
  ] })
4187
4272
  },
@@ -4189,7 +4274,7 @@ function dr({
4189
4274
  );
4190
4275
  }) });
4191
4276
  }
4192
- function hr() {
4277
+ function xr() {
4193
4278
  k((n) => n.showFilters);
4194
4279
  const s = k(
4195
4280
  (n) => n.actions.setShowFilters
@@ -4203,15 +4288,15 @@ function hr() {
4203
4288
  onClick: () => s(!1),
4204
4289
  className: "h-7 w-7 p-0",
4205
4290
  variant: "ghost",
4206
- children: /* @__PURE__ */ e.jsx(_e, {})
4291
+ children: /* @__PURE__ */ e.jsx(He, {})
4207
4292
  }
4208
4293
  )
4209
4294
  ] }),
4210
4295
  /* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
4211
- pa,
4296
+ fa,
4212
4297
  {
4213
4298
  ColumnsComponent: (n, a, t) => /* @__PURE__ */ e.jsx(
4214
- dr,
4299
+ ur,
4215
4300
  {
4216
4301
  schemaName: n,
4217
4302
  tableName: a,
@@ -4222,7 +4307,7 @@ function hr() {
4222
4307
  ) })
4223
4308
  ] });
4224
4309
  }
4225
- function mr() {
4310
+ function pr() {
4226
4311
  k((a) => a.dashboard);
4227
4312
  const s = k((a) => a.showFilters), n = k((a) => a.isVisualEditing);
4228
4313
  return k((a) => a.bookmarkKey), /* @__PURE__ */ e.jsxs(
@@ -4234,13 +4319,13 @@ function mr() {
4234
4319
  flex: !n
4235
4320
  }),
4236
4321
  children: [
4237
- /* @__PURE__ */ e.jsx(_t, {}),
4238
- s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(hr, {}) })
4322
+ /* @__PURE__ */ e.jsx(Bt, {}),
4323
+ s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(xr, {}) })
4239
4324
  ]
4240
4325
  }
4241
4326
  );
4242
4327
  }
4243
- function ur() {
4328
+ function fr() {
4244
4329
  const s = k((t) => t.dashboard), n = k((t) => t.actions.setDashboard), a = k(
4245
4330
  (t) => t.showDashboardJSON
4246
4331
  );
@@ -4253,7 +4338,7 @@ function ur() {
4253
4338
  hidden: !a
4254
4339
  }),
4255
4340
  children: /* @__PURE__ */ e.jsx(
4256
- Ht,
4341
+ $t,
4257
4342
  {
4258
4343
  onChange: (t) => {
4259
4344
  if (t)
@@ -4284,25 +4369,26 @@ function ur() {
4284
4369
  }
4285
4370
  );
4286
4371
  }
4287
- function fr({
4372
+ function br({
4288
4373
  showControls: s = !1,
4289
4374
  showFooter: n = !0,
4290
- ...a
4375
+ showAssistant: a = !1,
4376
+ ...t
4291
4377
  }) {
4292
- return /* @__PURE__ */ e.jsxs(Bt, { dashboardProps: a, children: [
4293
- /* @__PURE__ */ e.jsx($t, {}),
4294
- /* @__PURE__ */ e.jsxs(Pt, { children: [
4295
- /* @__PURE__ */ e.jsx(ur, {}),
4296
- /* @__PURE__ */ e.jsxs(Kt, { ...a, children: [
4297
- s && /* @__PURE__ */ e.jsx(vn, {}),
4298
- /* @__PURE__ */ e.jsx(cr, {}),
4299
- /* @__PURE__ */ e.jsx(mr, {})
4378
+ return /* @__PURE__ */ e.jsxs(Pt, { dashboardProps: t, children: [
4379
+ /* @__PURE__ */ e.jsx(Kt, {}),
4380
+ /* @__PURE__ */ e.jsxs(Ut, { children: [
4381
+ /* @__PURE__ */ e.jsx(fr, {}),
4382
+ /* @__PURE__ */ e.jsxs(Gt, { ...t, children: [
4383
+ s && /* @__PURE__ */ e.jsx(Nn, {}),
4384
+ /* @__PURE__ */ e.jsx(mr, {}),
4385
+ /* @__PURE__ */ e.jsx(pr, {})
4300
4386
  ] })
4301
4387
  ] })
4302
4388
  ] });
4303
4389
  }
4304
4390
  export {
4305
- fr as D,
4306
- Qe as S,
4307
- xa as u
4391
+ br as D,
4392
+ We as S,
4393
+ pa as u
4308
4394
  };