react-semaphor 0.0.183 → 0.0.185

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 T, b as k, j as e, Q as ds, R as hs, U as w, V as Us, W as ms, X as us, Y as xs, Z as ps, _ as B, $ as ae, a0 as Js, J as Ps, O as Ee, a1 as Ia, a2 as qa, a3 as Va, a4 as Ra, a5 as _a, a6 as Ha, a7 as Fs, a8 as Re, a9 as $e, aa as We, T as fs, e as Gs, g as gs, ab as Oe, ac as Me, f as W, ad as Te, ae as Ae, af as _e, ag as Le, ah as X, ai as js, G as r, aj as Ke, ak as Ue, al as Ba, am as Je, w as Qs, v as Ws, t as he, an as $a, r as Ka, N as Ys, s as Ua, ao as Ja, B as Pa, ap as Xs, aq as Ga, L as He, S as bs, z as Qa, n as Os, ar as Ms, A as rs, 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 Wa, aA as Ya, aB as na, aC as Xa, aD as Za, aE as et, aF as st, aG as at, aH as is, aI as tt, aJ as Qe, aK as os, aL as Fe, aM as cs, aN as Ts, aO as nt, aP as lt, aQ as rt, aR as it, aS as ot, aT as ls, aU as ct, aV as As, aW as dt, aX as Es, aY as ht, aZ as mt, a_ as ut, a$ as la, l as xt, C as pt, E as Ls, d as ft, h as gt, i as jt, o as bt, b0 as yt, m as vt, b1 as Nt, b2 as Ct, b3 as St, b4 as Ds, b5 as kt, b6 as Is, b7 as qs, K as wt, b8 as ys, b9 as zt, ba as ra, bb as Ye, bc as ia, bd as Ft, be as Ot, bf as Mt, bg as Tt, bh as At, bi as Et, bj as Se, bk as q, bl as V, bm as vs, bn as R, bo as Vs, bp as Lt, bq as Dt, br as It, bs as qt, bt as Rs, bu as Vt, bv as Rt, bw as _t, bx as Ht, by as Bt, bz as $t } from "./index-71zNxWPN.js";
2
- import me, { useState as M, useEffect as K, useMemo as Kt, useRef as Be } from "react";
1
+ import { P as L, b as k, j as e, Q as us, R as xs, U as z, V as $s, W as ps, X as fs, Y as gs, Z as js, _ as R, $ as ae, a0 as Ks, J as Us, O as Ae, a1 as Ia, a2 as qa, a3 as Va, a4 as Ra, a5 as _a, a6 as Ha, a7 as Os, a8 as Re, a9 as $e, aa as We, T as bs, e as Ps, g as ys, ab as Fe, ac as Oe, f as W, ad as Me, ae as Te, af as _e, ag as Le, ah as X, ai as vs, G as r, aj as Ke, ak as Ue, al as Ba, am as Pe, w as Gs, v as Js, t as he, an as $a, r as Ka, N as Qs, s as Ua, ao as Pa, B as Ga, ap as Ws, aq as Ja, L as He, S as Ns, z as Qa, n as Ms, ar as Ts, A as cs, u as es, as as Ce, at as we, au as Ys, av as Xs, aw as Zs, ax as ea, ay as sa, az as Wa, aA as Ya, aB as aa, aC as Xa, aD as Za, aE as et, aF as st, aG as at, aH as ds, aI as tt, aJ as Ve, aK as hs, aL as ze, aM as ms, aN as As, aO as nt, aP as lt, aQ as rt, aR as it, aS as ot, aT as ls, aU as ct, aV as Ls, aW as dt, aX as Es, aY as ht, aZ as mt, a_ as ut, a$ as ta, l as xt, C as pt, E as Ds, d as ft, h as gt, i as jt, o as bt, b0 as yt, m as vt, H as Nt, b1 as Ct, b2 as St, b3 as kt, b4 as rs, b5 as wt, b6 as is, b7 as Is, K as zt, b8 as Cs, b9 as Ft, ba as na, bb as Ot, bc as la, bd as Ye, be as Mt, bf as Ee, bg as _, bh as H, bi as ra, bj as B, bk as qs, bl as Tt, bm as At, bn as Lt, bo as Et, bp as Dt, bq as It, br as qt, bs as Vt, bt as Vs, bu as Rt, bv as _t, bw as Ht, bx as Bt, by as $t, bz as Kt } from "./index-zzQRnCNa.js";
2
+ import me, { useState as T, useEffect as K, useMemo as Ut, useRef as Be } 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 Ut = T("Activity", [
9
+ const Pt = L("Activity", [
10
10
  [
11
11
  "path",
12
12
  {
@@ -21,7 +21,7 @@ const Ut = T("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 = T("AreaChart", [
24
+ const Gt = L("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 = T("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 Ns = T("BarChart4", [
34
+ const Ss = L("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 Ns = T("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 Pt = T("CircleX", [
46
+ const Jt = L("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 Pt = T("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 Gt = T("Database", [
57
+ const Qt = L("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 Gt = T("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 Qt = T("Eraser", [
68
+ const Wt = L("Eraser", [
69
69
  [
70
70
  "path",
71
71
  {
@@ -82,7 +82,7 @@ const Qt = T("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 = T("Filter", [
85
+ const ia = L("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,18 @@ const oa = T("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 Wt = T("Glasses", [
94
+ const oa = L("GanttChart", [
95
+ ["path", { d: "M8 6h10", key: "9lnwnk" }],
96
+ ["path", { d: "M6 12h9", key: "1g9pqf" }],
97
+ ["path", { d: "M11 18h7", key: "c8dzvl" }]
98
+ ]);
99
+ /**
100
+ * @license lucide-react v0.379.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */
105
+ const Yt = L("Glasses", [
95
106
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
96
107
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
97
108
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -104,7 +115,7 @@ const Wt = T("Glasses", [
104
115
  * This source code is licensed under the ISC license.
105
116
  * See the LICENSE file in the root directory of this source tree.
106
117
  */
107
- const Yt = T("Hammer", [
118
+ const Xt = L("Hammer", [
108
119
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
109
120
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
110
121
  [
@@ -121,7 +132,7 @@ const Yt = T("Hammer", [
121
132
  * This source code is licensed under the ISC license.
122
133
  * See the LICENSE file in the root directory of this source tree.
123
134
  */
124
- const Xt = T("Hash", [
135
+ const Zt = L("Hash", [
125
136
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
126
137
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
127
138
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -133,7 +144,7 @@ const Xt = T("Hash", [
133
144
  * This source code is licensed under the ISC license.
134
145
  * See the LICENSE file in the root directory of this source tree.
135
146
  */
136
- const Zt = T("Key", [
147
+ const en = L("Key", [
137
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" }],
138
149
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
139
150
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
@@ -144,7 +155,7 @@ const Zt = T("Key", [
144
155
  * This source code is licensed under the ISC license.
145
156
  * See the LICENSE file in the root directory of this source tree.
146
157
  */
147
- const Cs = T("LineChart", [
158
+ const ks = L("LineChart", [
148
159
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
149
160
  ["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
150
161
  ]);
@@ -154,7 +165,7 @@ const Cs = T("LineChart", [
154
165
  * This source code is licensed under the ISC license.
155
166
  * See the LICENSE file in the root directory of this source tree.
156
167
  */
157
- const en = T("ListEnd", [
168
+ const sn = L("ListEnd", [
158
169
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
159
170
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
160
171
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -167,7 +178,7 @@ const en = T("ListEnd", [
167
178
  * This source code is licensed under the ISC license.
168
179
  * See the LICENSE file in the root directory of this source tree.
169
180
  */
170
- const sn = T("ListStart", [
181
+ const an = L("ListStart", [
171
182
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
172
183
  ["path", { d: "M16 18H3", key: "12xzn7" }],
173
184
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -180,7 +191,7 @@ const sn = T("ListStart", [
180
191
  * This source code is licensed under the ISC license.
181
192
  * See the LICENSE file in the root directory of this source tree.
182
193
  */
183
- const an = T("ListX", [
194
+ const tn = L("ListX", [
184
195
  ["path", { d: "M11 12H3", key: "51ecnj" }],
185
196
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
186
197
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -193,7 +204,7 @@ const an = T("ListX", [
193
204
  * This source code is licensed under the ISC license.
194
205
  * See the LICENSE file in the root directory of this source tree.
195
206
  */
196
- const tn = T("MessageSquareMore", [
207
+ const nn = L("MessageSquareMore", [
197
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" }],
198
209
  ["path", { d: "M8 10h.01", key: "19clt8" }],
199
210
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -205,7 +216,7 @@ const tn = T("MessageSquareMore", [
205
216
  * This source code is licensed under the ISC license.
206
217
  * See the LICENSE file in the root directory of this source tree.
207
218
  */
208
- const nn = T("Network", [
219
+ const ln = L("Network", [
209
220
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
210
221
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
211
222
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -218,7 +229,7 @@ const nn = T("Network", [
218
229
  * This source code is licensed under the ISC license.
219
230
  * See the LICENSE file in the root directory of this source tree.
220
231
  */
221
- const ca = T("Pencil", [
232
+ const ca = L("Pencil", [
222
233
  ["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }],
223
234
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
224
235
  ]);
@@ -228,7 +239,7 @@ const ca = T("Pencil", [
228
239
  * This source code is licensed under the ISC license.
229
240
  * See the LICENSE file in the root directory of this source tree.
230
241
  */
231
- const da = T("PieChart", [
242
+ const da = L("PieChart", [
232
243
  ["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }],
233
244
  ["path", { d: "M22 12A10 10 0 0 0 12 2v10z", key: "1rfc4y" }]
234
245
  ]);
@@ -238,7 +249,7 @@ const da = T("PieChart", [
238
249
  * This source code is licensed under the ISC license.
239
250
  * See the LICENSE file in the root directory of this source tree.
240
251
  */
241
- const ln = T("Play", [
252
+ const rn = L("Play", [
242
253
  ["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
243
254
  ]);
244
255
  /**
@@ -247,7 +258,7 @@ const ln = T("Play", [
247
258
  * This source code is licensed under the ISC license.
248
259
  * See the LICENSE file in the root directory of this source tree.
249
260
  */
250
- const rn = T("Plug2", [
261
+ const on = L("Plug2", [
251
262
  ["path", { d: "M9 2v6", key: "17ngun" }],
252
263
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
253
264
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -260,7 +271,7 @@ const rn = T("Plug2", [
260
271
  * This source code is licensed under the ISC license.
261
272
  * See the LICENSE file in the root directory of this source tree.
262
273
  */
263
- const on = T("Save", [
274
+ const cn = L("Save", [
264
275
  [
265
276
  "path",
266
277
  {
@@ -277,7 +288,7 @@ const on = T("Save", [
277
288
  * This source code is licensed under the ISC license.
278
289
  * See the LICENSE file in the root directory of this source tree.
279
290
  */
280
- const ha = T("ScatterChart", [
291
+ const ha = L("ScatterChart", [
281
292
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
282
293
  ["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
283
294
  ["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
@@ -291,7 +302,7 @@ const ha = T("ScatterChart", [
291
302
  * This source code is licensed under the ISC license.
292
303
  * See the LICENSE file in the root directory of this source tree.
293
304
  */
294
- const cn = T("ShieldQuestion", [
305
+ const dn = L("ShieldQuestion", [
295
306
  [
296
307
  "path",
297
308
  {
@@ -308,7 +319,7 @@ const cn = T("ShieldQuestion", [
308
319
  * This source code is licensed under the ISC license.
309
320
  * See the LICENSE file in the root directory of this source tree.
310
321
  */
311
- const dn = T("Sigma", [
322
+ const hn = L("Sigma", [
312
323
  ["path", { d: "M18 7V4H6l6 8-6 8h12v-3", key: "zis8ev" }]
313
324
  ]);
314
325
  /**
@@ -317,7 +328,7 @@ const dn = T("Sigma", [
317
328
  * This source code is licensed under the ISC license.
318
329
  * See the LICENSE file in the root directory of this source tree.
319
330
  */
320
- const hn = T("SwatchBook", [
331
+ const mn = L("SwatchBook", [
321
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" }],
322
333
  ["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
323
334
  ["path", { d: "M 7 17h0.01", key: "10821z" }],
@@ -335,7 +346,7 @@ const hn = T("SwatchBook", [
335
346
  * This source code is licensed under the ISC license.
336
347
  * See the LICENSE file in the root directory of this source tree.
337
348
  */
338
- const mn = T("Tag", [
349
+ const un = L("Tag", [
339
350
  [
340
351
  "path",
341
352
  {
@@ -351,7 +362,7 @@ const mn = T("Tag", [
351
362
  * This source code is licensed under the ISC license.
352
363
  * See the LICENSE file in the root directory of this source tree.
353
364
  */
354
- const un = T("ToggleLeft", [
365
+ const xn = L("ToggleLeft", [
355
366
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
356
367
  ["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
357
368
  ]);
@@ -361,7 +372,7 @@ const un = T("ToggleLeft", [
361
372
  * This source code is licensed under the ISC license.
362
373
  * See the LICENSE file in the root directory of this source tree.
363
374
  */
364
- const xn = T("Type", [
375
+ const pn = L("Type", [
365
376
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
366
377
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
367
378
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
@@ -372,51 +383,51 @@ const xn = T("Type", [
372
383
  * This source code is licensed under the ISC license.
373
384
  * See the LICENSE file in the root directory of this source tree.
374
385
  */
375
- const pn = T("User", [
386
+ const fn = L("User", [
376
387
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
377
388
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
378
389
  ]);
379
- function fn() {
380
- const [s, n] = M(""), [a, t] = M(!1), [i, o] = M(!1), l = k((d) => d.dashboard);
390
+ function gn() {
391
+ const [s, n] = T(""), [a, t] = T(!1), [i, o] = T(!1), l = k((h) => h.dashboard);
381
392
  function c() {
382
- const d = Ps(l), f = Ee(l.id), m = JSON.parse(localStorage.getItem(f) || "[]");
393
+ const h = Us(l), g = Ae(l.id), m = JSON.parse(localStorage.getItem(g) || "[]");
383
394
  if (m.some(
384
- (C) => C.name === s
395
+ (N) => N.name === s
385
396
  )) {
386
397
  t(!0);
387
398
  return;
388
399
  }
389
400
  m.push({
390
401
  name: s,
391
- template: d
392
- }), localStorage.setItem(f, JSON.stringify(m)), o(!1);
402
+ template: h
403
+ }), localStorage.setItem(g, JSON.stringify(m)), o(!1);
393
404
  }
394
- return /* @__PURE__ */ e.jsxs(ds, { open: i, onOpenChange: o, children: [
395
- /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
396
- w,
405
+ return /* @__PURE__ */ e.jsxs(us, { open: i, onOpenChange: o, children: [
406
+ /* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
407
+ z,
397
408
  {
398
409
  variant: "outline",
399
410
  className: "h-7 p-2",
400
411
  size: "sm",
401
412
  children: [
402
- /* @__PURE__ */ e.jsx(Us, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
413
+ /* @__PURE__ */ e.jsx($s, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
403
414
  "Add Lens"
404
415
  ]
405
416
  }
406
417
  ) }),
407
- /* @__PURE__ */ e.jsxs(ms, { className: "sm:max-w-[425px]", children: [
408
- /* @__PURE__ */ e.jsxs(us, { children: [
409
- /* @__PURE__ */ e.jsx(xs, { children: "Add a Lens" }),
410
- /* @__PURE__ */ e.jsx(ps, { children: "Lenses are private by default and are only visible to you." })
418
+ /* @__PURE__ */ e.jsxs(ps, { className: "sm:max-w-[425px]", children: [
419
+ /* @__PURE__ */ e.jsxs(fs, { children: [
420
+ /* @__PURE__ */ e.jsx(gs, { children: "Add a Lens" }),
421
+ /* @__PURE__ */ e.jsx(js, { children: "Lenses are private by default and are only visible to you." })
411
422
  ] }),
412
423
  /* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
413
- /* @__PURE__ */ e.jsx(B, { className: "text-right", children: "Name" }),
424
+ /* @__PURE__ */ e.jsx(R, { className: "text-right", children: "Name" }),
414
425
  /* @__PURE__ */ e.jsx(
415
426
  ae,
416
427
  {
417
428
  value: s,
418
- onChange: (d) => {
419
- a && t(!1), n(d.target.value);
429
+ onChange: (h) => {
430
+ a && t(!1), n(h.target.value);
420
431
  },
421
432
  id: "name",
422
433
  className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
@@ -424,8 +435,8 @@ function fn() {
424
435
  )
425
436
  ] }) }),
426
437
  a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The bookmark name already exists. Use a differnet name." }),
427
- /* @__PURE__ */ e.jsx(Js, { children: /* @__PURE__ */ e.jsx(
428
- w,
438
+ /* @__PURE__ */ e.jsx(Ks, { children: /* @__PURE__ */ e.jsx(
439
+ z,
429
440
  {
430
441
  variant: "outline",
431
442
  type: "submit",
@@ -437,34 +448,34 @@ function fn() {
437
448
  ] })
438
449
  ] });
439
450
  }
440
- function gn() {
441
- const [s, n] = M(!1), [a, t] = M(""), i = k((h) => h.dashboard), o = k((h) => h.bookmarkKey), [l, c] = M([]), d = k((h) => h.actions.setDashboard), f = k(
442
- (h) => h.actions.setFilterValues
451
+ function jn() {
452
+ const [s, n] = T(!1), [a, t] = T(""), i = k((d) => d.dashboard), o = k((d) => d.bookmarkKey), [l, c] = T([]), h = k((d) => d.actions.setDashboard), g = k(
453
+ (d) => d.actions.setFilterValues
443
454
  ), m = k(
444
- (h) => h.actions.setBookmarkKey
455
+ (d) => d.actions.setBookmarkKey
445
456
  );
446
457
  K(() => {
447
- const h = Ee(i.id), x = JSON.parse(localStorage.getItem(h) || "[]");
458
+ const d = Ae(i.id), x = JSON.parse(localStorage.getItem(d) || "[]");
448
459
  c(x);
449
- const g = x.find(
450
- (j) => j.default
460
+ const f = x.find(
461
+ (w) => w.default
451
462
  );
452
- g && g.name === o && t(g.name);
463
+ f && f.name === o && t(f.name);
453
464
  }, [s, i, o]);
454
- function u(h) {
455
- if (h === a)
465
+ function u(d) {
466
+ if (d === a)
456
467
  return;
457
- const x = l.find((j) => j.name === h), g = x == null ? void 0 : x.template;
458
- g && (d(g), f(x.filterValues || []), m(h === "Original" ? "" : h)), t(h);
468
+ const x = l.find((w) => w.name === d), f = x == null ? void 0 : x.template;
469
+ f && (h(f), g(x.filterValues || []), m(d === "Original" ? "" : d)), t(d);
459
470
  }
460
- function C(h) {
461
- const x = Ee(i.id), j = JSON.parse(localStorage.getItem(x) || "[]").filter(
462
- (b) => b.name !== h
471
+ function N(d) {
472
+ const x = Ae(i.id), w = JSON.parse(localStorage.getItem(x) || "[]").filter(
473
+ (b) => b.name !== d
463
474
  );
464
- localStorage.setItem(x, JSON.stringify(j)), c(j);
475
+ localStorage.setItem(x, JSON.stringify(w)), c(w);
465
476
  }
466
477
  return /* @__PURE__ */ e.jsxs(Ia, { open: s, onOpenChange: n, children: [
467
- /* @__PURE__ */ e.jsx(qa, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Wt, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
478
+ /* @__PURE__ */ e.jsx(qa, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Yt, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
468
479
  /* @__PURE__ */ e.jsxs(Va, { className: "w-56", children: [
469
480
  /* @__PURE__ */ e.jsx(Ra, { children: "Lenses" }),
470
481
  /* @__PURE__ */ e.jsx(_a, {}),
@@ -474,20 +485,20 @@ function gn() {
474
485
  value: a,
475
486
  onValueChange: u,
476
487
  children: [
477
- /* @__PURE__ */ e.jsx(Fs, { value: "Original", children: "Original" }),
478
- l.filter((h) => h.name != "Original").map((h, x) => /* @__PURE__ */ e.jsxs(
479
- Fs,
488
+ /* @__PURE__ */ e.jsx(Os, { value: "Original", children: "Original" }),
489
+ l.filter((d) => d.name != "Original").map((d, x) => /* @__PURE__ */ e.jsxs(
490
+ Os,
480
491
  {
481
492
  className: "xbg-red-100 flex justify-between",
482
- value: h.name,
483
- defaultChecked: h.name === o,
493
+ value: d.name,
494
+ defaultChecked: d.name === o,
484
495
  children: [
485
- /* @__PURE__ */ e.jsx("p", { children: h.name }),
496
+ /* @__PURE__ */ e.jsx("p", { children: d.name }),
486
497
  /* @__PURE__ */ e.jsx(
487
498
  Re,
488
499
  {
489
- onClick: (g) => {
490
- g.preventDefault(), C(h.name);
500
+ onClick: (f) => {
501
+ f.preventDefault(), N(d.name);
491
502
  },
492
503
  className: "h-3 w-3 hover:cursor-pointer",
493
504
  strokeWidth: 1.5
@@ -503,27 +514,27 @@ function gn() {
503
514
  ] })
504
515
  ] });
505
516
  }
506
- function jn() {
507
- const [s, n] = M(!1), a = k((o) => o.dashboard), t = k((o) => o.bookmarkKey);
517
+ function bn() {
518
+ const [s, n] = T(!1), a = k((o) => o.dashboard), t = k((o) => o.bookmarkKey);
508
519
  K(() => {
509
520
  if (!t) {
510
521
  n(!1);
511
522
  return;
512
523
  }
513
- const o = Ee(a.id), c = JSON.parse(
524
+ const o = Ae(a.id), c = JSON.parse(
514
525
  localStorage.getItem(o) || "[]"
515
526
  ).find(
516
- (d) => d.name === t
527
+ (h) => h.name === t
517
528
  );
518
529
  n(c ? c.default : !1);
519
530
  }, [t, a.id]);
520
531
  function i(o) {
521
532
  if (n(o), !t)
522
533
  return;
523
- const l = Ee(a.id), d = JSON.parse(
534
+ const l = Ae(a.id), h = JSON.parse(
524
535
  localStorage.getItem(l) || "[]"
525
- ).map((f) => (f.name === t ? f.default = o : f.default = !1, f));
526
- console.log(d), localStorage.setItem(l, JSON.stringify(d));
536
+ ).map((g) => (g.name === t ? g.default = o : g.default = !1, g));
537
+ console.log(h), localStorage.setItem(l, JSON.stringify(h));
527
538
  }
528
539
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
529
540
  /* @__PURE__ */ e.jsx(
@@ -544,7 +555,7 @@ function jn() {
544
555
  )
545
556
  ] });
546
557
  }
547
- function bn() {
558
+ function yn() {
548
559
  const s = k((b) => b.bookmarkKey), n = k((b) => b.dashboard);
549
560
  k((b) => b.selectedSheetId);
550
561
  const a = k(
@@ -555,10 +566,10 @@ function bn() {
555
566
  );
556
567
  const l = k((b) => b.onSaveFunction), c = k(
557
568
  (b) => b.actions.setShowFilters
558
- ), { addFrame: d, setSelectedFrameId: f } = k(
569
+ ), { addFrame: h, setSelectedFrameId: g } = k(
559
570
  (b) => b.actions
560
- ), { getSelectedSheet: m, setIsDashboardEditing: u, setShowDashboardJSON: C } = k((b) => b.actions), h = m(), x = () => {
561
- if (!a || !h)
571
+ ), { getSelectedSheet: m, setIsDashboardEditing: u, setShowDashboardJSON: N } = k((b) => b.actions), d = m(), x = () => {
572
+ if (!a || !d)
562
573
  return;
563
574
  const b = {
564
575
  id: We(),
@@ -575,31 +586,31 @@ function bn() {
575
586
  type: "bar",
576
587
  sql: "select COUNT(*) from YOUR_TABLE",
577
588
  data: []
578
- }, L = {
589
+ }, E = {
579
590
  id: We(),
580
591
  cards: [b],
581
592
  activeCardId: b.id
582
593
  };
583
- d(h.id, L), f(L.id);
584
- }, g = () => {
594
+ h(d.id, E), g(E.id);
595
+ }, f = () => {
585
596
  u(!0);
586
597
  };
587
- function j() {
598
+ function w() {
588
599
  if (!s || s === "")
589
600
  return;
590
- const b = Ps(n), L = Ee(n.id), A = JSON.parse(localStorage.getItem(L) || "[]"), O = A.findIndex(
591
- (y) => y.name === s
601
+ const b = Us(n), E = Ae(n.id), C = JSON.parse(localStorage.getItem(E) || "[]"), O = C.findIndex(
602
+ (j) => j.name === s
592
603
  );
593
- O !== -1 ? A[O] = {
604
+ O !== -1 ? C[O] = {
594
605
  name: s,
595
606
  template: b,
596
- default: A[O].default,
607
+ default: C[O].default,
597
608
  filterValues: t
598
- } : A.push({
609
+ } : C.push({
599
610
  name: s,
600
611
  template: b,
601
612
  filterValues: t
602
- }), localStorage.setItem(L, JSON.stringify(A)), l == null || l(b);
613
+ }), localStorage.setItem(E, JSON.stringify(C)), l == null || l(b);
603
614
  }
604
615
  return i ? null : /* @__PURE__ */ e.jsxs(
605
616
  "div",
@@ -608,17 +619,17 @@ function bn() {
608
619
  role: "dashboard-controls",
609
620
  children: [
610
621
  !i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
611
- /* @__PURE__ */ e.jsx(B, { children: s }),
622
+ /* @__PURE__ */ e.jsx(R, { children: s }),
612
623
  !!s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
613
624
  /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "|" }),
614
- /* @__PURE__ */ e.jsx(jn, {})
625
+ /* @__PURE__ */ e.jsx(bn, {})
615
626
  ] })
616
627
  ] }),
617
628
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
618
- a && !i && /* @__PURE__ */ e.jsx(fn, {}),
619
- !i && /* @__PURE__ */ e.jsx(gn, {}),
629
+ a && !i && /* @__PURE__ */ e.jsx(gn, {}),
630
+ !i && /* @__PURE__ */ e.jsx(jn, {}),
620
631
  a && !i && /* @__PURE__ */ e.jsxs(
621
- w,
632
+ z,
622
633
  {
623
634
  variant: "outline",
624
635
  className: "h-7 p-2",
@@ -626,52 +637,52 @@ function bn() {
626
637
  disabled: !a,
627
638
  onClick: x,
628
639
  children: [
629
- /* @__PURE__ */ e.jsx(Us, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
640
+ /* @__PURE__ */ e.jsx($s, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
630
641
  "Add Frame"
631
642
  ]
632
643
  }
633
644
  ),
634
645
  !a && /* @__PURE__ */ e.jsx(
635
- w,
646
+ z,
636
647
  {
637
648
  variant: "outline",
638
649
  className: "h-7 p-2",
639
- onClick: g,
650
+ onClick: f,
640
651
  size: "sm",
641
652
  children: /* @__PURE__ */ e.jsx(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
642
653
  }
643
654
  ),
644
655
  a && !i && /* @__PURE__ */ e.jsx(
645
- w,
656
+ z,
646
657
  {
647
658
  variant: "outline",
648
659
  role: "close",
649
660
  className: "h-7 p-2",
650
661
  onClick: () => {
651
- u(!1), C(!1);
662
+ u(!1), N(!1);
652
663
  },
653
664
  size: "sm",
654
665
  children: /* @__PURE__ */ e.jsx(Re, { className: "h-4 w-4", strokeWidth: 1.5 })
655
666
  }
656
667
  ),
657
668
  a && !i && /* @__PURE__ */ e.jsx(
658
- w,
669
+ z,
659
670
  {
660
671
  className: "h-7 p-2",
661
672
  variant: "outline",
662
- onClick: j,
673
+ onClick: w,
663
674
  size: "sm",
664
- children: /* @__PURE__ */ e.jsx(on, { className: "h-4 w-4", strokeWidth: 1.5 })
675
+ children: /* @__PURE__ */ e.jsx(cn, { className: "h-4 w-4", strokeWidth: 1.5 })
665
676
  }
666
677
  ),
667
678
  !o && !i && a && /* @__PURE__ */ e.jsx(
668
- w,
679
+ z,
669
680
  {
670
681
  className: "h-7 p-2",
671
682
  variant: "outline",
672
683
  onClick: () => c(!0),
673
684
  size: "sm",
674
- children: /* @__PURE__ */ e.jsx(oa, { className: "h-4 w-4", strokeWidth: 1.5 })
685
+ children: /* @__PURE__ */ e.jsx(ia, { className: "h-4 w-4", strokeWidth: 1.5 })
675
686
  }
676
687
  ),
677
688
  !i && a && !1,
@@ -681,7 +692,7 @@ function bn() {
681
692
  }
682
693
  );
683
694
  }
684
- function Ge({
695
+ function Qe({
685
696
  title: s,
686
697
  items: n,
687
698
  value: a,
@@ -690,67 +701,67 @@ function Ge({
690
701
  connectionTooltip: o,
691
702
  onChange: l,
692
703
  className: c,
693
- showIcon: d = !0,
694
- disabled: f = !1
704
+ showIcon: h = !0,
705
+ disabled: g = !1
695
706
  }) {
696
707
  const m = t ? "Loading..." : i ? "Error" : a;
697
708
  function u() {
698
709
  if (s === "Connection")
699
- return /* @__PURE__ */ e.jsx(rn, { className: "size-4 rotate-90" });
710
+ return /* @__PURE__ */ e.jsx(on, { className: "size-4 rotate-90" });
700
711
  if (s === "Database")
701
- return /* @__PURE__ */ e.jsx(Gt, { className: "size-4" });
712
+ return /* @__PURE__ */ e.jsx(Qt, { className: "size-4" });
702
713
  if (s === "Schema")
703
- return /* @__PURE__ */ e.jsx(nn, { className: "size-4" });
714
+ return /* @__PURE__ */ e.jsx(ln, { className: "size-4" });
704
715
  if (s === "Table")
705
- return /* @__PURE__ */ e.jsx(js, { className: "size-4" });
716
+ return /* @__PURE__ */ e.jsx(vs, { className: "size-4" });
706
717
  }
707
718
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
708
- d && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(fs, { children: [
709
- /* @__PURE__ */ e.jsx(Gs, { children: u() }),
710
- /* @__PURE__ */ e.jsx(gs, { className: "text-xs", align: "start", children: o })
719
+ h && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(bs, { children: [
720
+ /* @__PURE__ */ e.jsx(Ps, { children: u() }),
721
+ /* @__PURE__ */ e.jsx(ys, { className: "text-xs", align: "start", children: o })
711
722
  ] }) : u() }),
712
- /* @__PURE__ */ e.jsxs(Oe, { disabled: f, value: m, onValueChange: l, children: [
723
+ /* @__PURE__ */ e.jsxs(Fe, { disabled: g, value: m, onValueChange: l, children: [
713
724
  /* @__PURE__ */ e.jsx(
714
- Me,
725
+ Oe,
715
726
  {
716
727
  className: W(
717
728
  "h-9 w-full focus:ring-1 focus:ring-offset-0",
718
729
  c
719
730
  ),
720
731
  children: /* @__PURE__ */ e.jsx(
721
- Te,
732
+ Me,
722
733
  {
723
734
  placeholder: t ? "Loading..." : i ? "Error" : `Select ${s}`
724
735
  }
725
736
  )
726
737
  }
727
738
  ),
728
- /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
739
+ /* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
729
740
  t ? /* @__PURE__ */ e.jsx(Le, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Le, { children: s }),
730
- /* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((C, h) => /* @__PURE__ */ e.jsx(X, { value: C.id, children: C.name }, h)) }),
741
+ /* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((N, d) => /* @__PURE__ */ e.jsx(X, { value: N.id, children: N.name }, d)) }),
731
742
  (t || i) && /* @__PURE__ */ e.jsx(X, { value: m, children: m })
732
743
  ] }) })
733
744
  ] })
734
745
  ] });
735
746
  }
736
- function yn({ column: s }) {
737
- const [n, a] = M(!1), t = r((m) => m.selectedTableName), i = r(
747
+ function vn({ column: s }) {
748
+ const [n, a] = T(!1), t = r((m) => m.selectedTableName), i = r(
738
749
  (m) => m.selectedSchemaName
739
- ), o = r((m) => m.sqlGen), l = r((m) => m.actions.setSqlGen), c = r((m) => m.actions.setCardSql), d = r((m) => m.actions.setRunSql);
740
- function f(m, u) {
741
- const C = Qs(m, o, u);
742
- l(C);
743
- const h = Ws(
744
- C,
750
+ ), o = r((m) => m.sqlGen), l = r((m) => m.actions.setSqlGen), c = r((m) => m.actions.setCardSql), h = r((m) => m.actions.setRunSql);
751
+ function g(m, u) {
752
+ const N = Gs(m, o, u);
753
+ l(N);
754
+ const d = Js(
755
+ N,
745
756
  he(i || ""),
746
757
  he(t)
747
758
  );
748
- h && (c(h), d(!0)), a(!1);
759
+ d && (c(d), h(!0)), a(!1);
749
760
  }
750
761
  return /* @__PURE__ */ e.jsxs(Ke, { open: n, onOpenChange: a, children: [
751
762
  /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ba, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
752
763
  /* @__PURE__ */ e.jsx(
753
- Je,
764
+ Pe,
754
765
  {
755
766
  align: "center",
756
767
  className: "w-18 rounded-md p-0 shadow-none",
@@ -758,7 +769,7 @@ function yn({ column: s }) {
758
769
  /* @__PURE__ */ e.jsx(
759
770
  "li",
760
771
  {
761
- onClick: () => f(s, "COUNT"),
772
+ onClick: () => g(s, "COUNT"),
762
773
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
763
774
  children: "Count"
764
775
  }
@@ -766,7 +777,7 @@ function yn({ column: s }) {
766
777
  /* @__PURE__ */ e.jsx(
767
778
  "li",
768
779
  {
769
- onClick: () => f(s, "AVG"),
780
+ onClick: () => g(s, "AVG"),
770
781
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
771
782
  children: "Avg"
772
783
  }
@@ -774,7 +785,7 @@ function yn({ column: s }) {
774
785
  /* @__PURE__ */ e.jsx(
775
786
  "li",
776
787
  {
777
- onClick: () => f(s, "SUM"),
788
+ onClick: () => g(s, "SUM"),
778
789
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
779
790
  children: "Sum"
780
791
  }
@@ -782,7 +793,7 @@ function yn({ column: s }) {
782
793
  /* @__PURE__ */ e.jsx(
783
794
  "li",
784
795
  {
785
- onClick: () => f(s, "MAX"),
796
+ onClick: () => g(s, "MAX"),
786
797
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
787
798
  children: "Max"
788
799
  }
@@ -790,7 +801,7 @@ function yn({ column: s }) {
790
801
  /* @__PURE__ */ e.jsx(
791
802
  "li",
792
803
  {
793
- onClick: () => f(s, "MIN"),
804
+ onClick: () => g(s, "MIN"),
794
805
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
795
806
  children: "Min"
796
807
  }
@@ -801,94 +812,94 @@ function yn({ column: s }) {
801
812
  ] });
802
813
  }
803
814
  function ma({ column: s }) {
804
- return /* @__PURE__ */ e.jsxs(fs, { children: [
815
+ return /* @__PURE__ */ e.jsxs(bs, { children: [
805
816
  /* @__PURE__ */ e.jsx($a, { asChild: !0, children: Ka.includes(s.data_type.toLowerCase()) ? (
806
817
  // <span className=" font-thin">T</span>
807
- /* @__PURE__ */ e.jsx(xn, { className: "size-3" })
808
- ) : Ys.includes(s.data_type.toLowerCase()) ? (
818
+ /* @__PURE__ */ e.jsx(pn, { className: "size-3" })
819
+ ) : Qs.includes(s.data_type.toLowerCase()) ? (
809
820
  //
810
- /* @__PURE__ */ e.jsx(Xt, { className: "size-3" })
811
- ) : Ua.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Ja, { className: "size-3" }) : Pa.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(un, { className: "size-3" }) : /* @__PURE__ */ e.jsx(cn, { className: "size-3" }) }),
812
- /* @__PURE__ */ e.jsx(gs, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
821
+ /* @__PURE__ */ e.jsx(Zt, { className: "size-3" })
822
+ ) : Ua.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Pa, { className: "size-3" }) : Ga.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(xn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(dn, { className: "size-3" }) }),
823
+ /* @__PURE__ */ e.jsx(ys, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
813
824
  ] });
814
825
  }
815
- function vn({
826
+ function Nn({
816
827
  schemaName: s,
817
828
  tableName: n,
818
829
  columns: a,
819
830
  status: t
820
831
  }) {
821
- const i = r((y) => y.sqlGen), o = r(
822
- (y) => y.selectedConnectionId
832
+ const i = r((j) => j.sqlGen), o = r(
833
+ (j) => j.selectedConnectionId
823
834
  ), l = r(
824
- (y) => y.selectedDatabaseName
835
+ (j) => j.selectedDatabaseName
825
836
  ), c = r(
826
- (y) => y.selectedSchemaName
827
- ), d = r((y) => y.selectedTableName), f = k(
828
- (y) => y.dashboard.aiScopeTables
829
- ), { setAIScopeTables: m } = k((y) => y.actions), u = r((y) => y.actions.setRunSql), C = r((y) => y.actions.setSqlGen), h = r(
830
- (y) => y.actions.setIsShowingVisual
831
- ), x = r((y) => y.actions.setCardSql), { connectionType: g } = ua();
832
- function j(y) {
833
- const z = Qs(y, i);
834
- C(z);
835
- const E = Ws(z, he(s), he(n));
836
- E && (x(E), u(!0));
837
+ (j) => j.selectedSchemaName
838
+ ), h = r((j) => j.selectedTableName), g = k(
839
+ (j) => j.dashboard.aiScopeTables
840
+ ), { setAIScopeTables: m } = k((j) => j.actions), u = r((j) => j.actions.setRunSql), N = r((j) => j.actions.setSqlGen), d = r(
841
+ (j) => j.actions.setIsShowingVisual
842
+ ), x = r((j) => j.actions.setCardSql), { connectionType: f } = ua();
843
+ function w(j) {
844
+ const F = Gs(j, i);
845
+ N(F);
846
+ const A = Js(F, he(s), he(n));
847
+ A && (x(A), u(!0));
837
848
  }
838
849
  function b() {
839
- return (f == null ? void 0 : f.find(
840
- (y) => y.connectinonId === o && y.tableName === d
850
+ return (g == null ? void 0 : g.find(
851
+ (j) => j.connectinonId === o && j.tableName === h
841
852
  )) !== void 0;
842
853
  }
843
- function L(y) {
844
- if (y === !0 && d && o) {
845
- const z = {
854
+ function E(j) {
855
+ if (j === !0 && h && o) {
856
+ const F = {
846
857
  connectinonId: o,
847
- connectionType: g,
858
+ connectionType: f,
848
859
  databaseName: l,
849
860
  schemaName: c,
850
- tableName: d
851
- }, _ = [...f || [], z].filter(
861
+ tableName: h
862
+ }, q = [...g || [], F].filter(
852
863
  (Y, $, U) => U.findIndex(
853
864
  (D) => D.connectinonId === Y.connectinonId && D.tableName === Y.tableName
854
865
  ) === $
855
866
  );
856
- m(_), Ms.success(`Added '${d}' to AI Scope`, {
867
+ m(q), Ts.success(`Added '${h}' to AI Scope`, {
857
868
  position: "top-right",
858
869
  duration: 2500,
859
870
  richColors: !0
860
871
  });
861
872
  } else {
862
- const z = (f || []).filter(
863
- (E) => E.connectinonId !== o && E.tableName !== d
873
+ const F = (g || []).filter(
874
+ (A) => A.connectinonId !== o && A.tableName !== h
864
875
  );
865
- m(z), Ms(`Removed '${d}' from AI Scope`, {
876
+ m(F), Ts(`Removed '${h}' from AI Scope`, {
866
877
  position: "top-right",
867
878
  duration: 2e3,
868
879
  richColors: !0
869
880
  });
870
881
  }
871
882
  }
872
- function A() {
873
- let z = rs(s, n);
874
- ((_) => _.charAt(0) === _.charAt(0).toUpperCase())(n) && (z = `"${n}"`), h(!1), x(`SELECT * FROM ${z} LIMIT 10`), u(!0);
883
+ function C() {
884
+ let F = cs(s, n);
885
+ ((q) => q.charAt(0) === q.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1), x(`SELECT * FROM ${F} LIMIT 10`), u(!0);
875
886
  }
876
887
  function O() {
877
- let z = rs(s, n);
878
- ((_) => _.charAt(0) === _.charAt(0).toUpperCase())(n) && (z = `"${n}"`), h(!1), x(`SELECT COUNT(*) FROM ${z}`), u(!0);
888
+ let F = cs(s, n);
889
+ ((q) => q.charAt(0) === q.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1), x(`SELECT COUNT(*) FROM ${F}`), u(!0);
879
890
  }
880
891
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
881
892
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
882
893
  /* @__PURE__ */ e.jsx(
883
- Xs,
894
+ Ws,
884
895
  {
885
896
  title: `${b() ? "Remove from" : "Add to"} AI Scope`,
886
897
  pressed: b(),
887
- onPressedChange: L,
898
+ onPressedChange: E,
888
899
  variant: "outline",
889
900
  className: "h-9 px-2",
890
901
  children: /* @__PURE__ */ e.jsx(
891
- Ga,
902
+ Ja,
892
903
  {
893
904
  className: W("size-4", {
894
905
  "text-primary": b(),
@@ -899,21 +910,21 @@ function vn({
899
910
  }
900
911
  ),
901
912
  /* @__PURE__ */ e.jsxs(
902
- w,
913
+ z,
903
914
  {
904
915
  disabled: t !== "Success",
905
- onClick: A,
916
+ onClick: C,
906
917
  size: "sm",
907
918
  variant: "secondary",
908
919
  className: "flex",
909
920
  children: [
910
- t !== "Success" ? /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(hn, { className: "mr-2 size-4" }),
921
+ t !== "Success" ? /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(mn, { className: "mr-2 size-4" }),
911
922
  "Top 10"
912
923
  ]
913
924
  }
914
925
  ),
915
926
  /* @__PURE__ */ e.jsxs(
916
- w,
927
+ z,
917
928
  {
918
929
  disabled: t !== "Success",
919
930
  onClick: O,
@@ -921,87 +932,87 @@ function vn({
921
932
  variant: "secondary",
922
933
  className: "flex",
923
934
  children: [
924
- t !== "Success" ? /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(dn, { className: "mr-2 size-4" }),
935
+ t !== "Success" ? /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(hn, { className: "mr-2 size-4" }),
925
936
  "Count"
926
937
  ]
927
938
  }
928
939
  )
929
940
  ] }),
930
941
  /* @__PURE__ */ e.jsxs(
931
- bs,
942
+ Ns,
932
943
  {
933
944
  className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
934
945
  children: [
935
- a == null ? void 0 : a.map((y) => /* @__PURE__ */ e.jsxs(
946
+ a == null ? void 0 : a.map((j) => /* @__PURE__ */ e.jsxs(
936
947
  "div",
937
948
  {
938
- onClick: () => j(y),
949
+ onClick: () => w(j),
939
950
  className: W(
940
951
  "mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
941
952
  {
942
- "bg-muted": Qa(y, i)
953
+ "bg-muted": Qa(j, i)
943
954
  }
944
955
  ),
945
956
  children: [
946
957
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
947
- /* @__PURE__ */ e.jsx(ma, { column: y }),
948
- /* @__PURE__ */ e.jsx("span", { children: y.column_name })
958
+ /* @__PURE__ */ e.jsx(ma, { column: j }),
959
+ /* @__PURE__ */ e.jsx("span", { children: j.column_name })
949
960
  ] }),
950
- Ys.includes(y.data_type) && /* @__PURE__ */ e.jsx(
961
+ Qs.includes(j.data_type) && /* @__PURE__ */ e.jsx(
951
962
  "div",
952
963
  {
953
- onClick: (z) => z.stopPropagation(),
964
+ onClick: (F) => F.stopPropagation(),
954
965
  className: "flex items-center justify-end",
955
- children: /* @__PURE__ */ e.jsx(yn, { column: y })
966
+ children: /* @__PURE__ */ e.jsx(vn, { column: j })
956
967
  }
957
968
  )
958
969
  ]
959
970
  },
960
- y.column_name
971
+ j.column_name
961
972
  )),
962
- /* @__PURE__ */ e.jsx(Os, { orientation: "vertical" }),
963
- /* @__PURE__ */ e.jsx(Os, { orientation: "horizontal" })
973
+ /* @__PURE__ */ e.jsx(Ms, { orientation: "vertical" }),
974
+ /* @__PURE__ */ e.jsx(Ms, { orientation: "horizontal" })
964
975
  ]
965
976
  }
966
977
  )
967
978
  ] });
968
979
  }
969
980
  function ua(s, n) {
970
- var ss, ve, Pe, qe;
971
- let a = Kt(() => [], []);
981
+ var ss, ve, Je, Ie;
982
+ let a = Ut(() => [], []);
972
983
  const t = es().authToken || s, i = r(
973
984
  (S) => S.selectedConnectionId
974
985
  ), o = r(
975
986
  (S) => S.selectedDatabaseName
976
987
  ), l = r(
977
988
  (S) => S.selectedSchemaName
978
- ), c = r((S) => S.selectedTableName), d = r(
989
+ ), c = r((S) => S.selectedTableName), h = r(
979
990
  (S) => S.actions.setCurrentColumns
980
- ), f = r(
991
+ ), g = r(
981
992
  (S) => S.actions.setSelectedConnectionId
982
993
  ), m = r(
983
994
  (S) => S.actions.setSelectedDatabaseName
984
995
  ), u = r(
985
996
  (S) => S.actions.setSelectedSchemaName
986
- ), C = r(
997
+ ), N = r(
987
998
  (S) => S.actions.setSelectedTableName
988
- ), h = r((S) => S.actions.setCardSql);
999
+ ), d = r((S) => S.actions.setCardSql);
989
1000
  function x(S) {
990
1001
  return i && o && l && o !== "NA" ? !0 : i && S === "API" ? !1 : !!(i && S === "S3");
991
1002
  }
992
- function g(S) {
1003
+ function f(S) {
993
1004
  return !!(i && o && o !== "NA" && l && c || i && (S === "S3" || S === "API"));
994
1005
  }
995
- function j(S) {
1006
+ function w(S) {
996
1007
  return i && S ? !(S === "API" || S === "S3") : !1;
997
1008
  }
998
1009
  const {
999
1010
  data: b,
1000
- isLoading: L,
1001
- isError: A
1011
+ isLoading: E,
1012
+ isError: C
1002
1013
  } = Ce({
1003
1014
  queryKey: ["connections"],
1004
- queryFn: () => ze(
1015
+ queryFn: () => we(
1005
1016
  "https://semaphor.cloud/api/v1/connections",
1006
1017
  (t == null ? void 0 : t.accessToken) || ""
1007
1018
  ),
@@ -1009,32 +1020,32 @@ function ua(s, n) {
1009
1020
  // Only fetch if authToken is present
1010
1021
  }), O = b == null ? void 0 : b.connections.find(
1011
1022
  (S) => S.id === i
1012
- ), y = O == null ? void 0 : O.type, z = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
1013
- data: E,
1014
- isLoading: _,
1023
+ ), j = O == null ? void 0 : O.type, F = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
1024
+ data: A,
1025
+ isLoading: q,
1015
1026
  isFetching: Y,
1016
1027
  isError: $,
1017
1028
  refetch: U
1018
1029
  } = Ce({
1019
1030
  queryKey: ["databases", i],
1020
- queryFn: () => ze(
1031
+ queryFn: () => we(
1021
1032
  "https://semaphor.cloud/api/v1/databases",
1022
1033
  (t == null ? void 0 : t.accessToken) || "",
1023
1034
  {
1024
1035
  connection_id: i
1025
1036
  }
1026
1037
  ),
1027
- enabled: j(y)
1038
+ enabled: w(j)
1028
1039
  // !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
1029
1040
  }), {
1030
1041
  data: D,
1031
1042
  isLoading: te,
1032
- isFetching: G,
1043
+ isFetching: J,
1033
1044
  isError: ee,
1034
1045
  refetch: Z
1035
1046
  } = Ce({
1036
1047
  queryKey: ["schemas", i, o],
1037
- queryFn: () => ze(
1048
+ queryFn: () => we(
1038
1049
  "https://semaphor.cloud/api/v1/schemas",
1039
1050
  (t == null ? void 0 : t.accessToken) || "",
1040
1051
  {
@@ -1042,14 +1053,14 @@ function ua(s, n) {
1042
1053
  database_name: o
1043
1054
  }
1044
1055
  ),
1045
- enabled: !!i && !!o && !z && o !== "NA"
1056
+ enabled: !!i && !!o && !F && o !== "NA"
1046
1057
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1047
1058
  }), {
1048
- data: J,
1059
+ data: P,
1049
1060
  isLoading: I,
1050
- isFetching: v,
1051
- isError: N,
1052
- refetch: F
1061
+ isFetching: y,
1062
+ isError: v,
1063
+ refetch: M
1053
1064
  } = Ce({
1054
1065
  queryKey: [
1055
1066
  "tables",
@@ -1057,7 +1068,7 @@ function ua(s, n) {
1057
1068
  o,
1058
1069
  l
1059
1070
  ],
1060
- queryFn: () => ze(
1071
+ queryFn: () => we(
1061
1072
  "https://semaphor.cloud/api/v1/tables",
1062
1073
  (t == null ? void 0 : t.accessToken) || "",
1063
1074
  {
@@ -1066,9 +1077,9 @@ function ua(s, n) {
1066
1077
  schema_name: l
1067
1078
  }
1068
1079
  ),
1069
- enabled: x(y)
1080
+ enabled: x(j)
1070
1081
  }), {
1071
- data: H,
1082
+ data: V,
1072
1083
  isLoading: ue,
1073
1084
  isFetching: se,
1074
1085
  isError: ge
@@ -1080,7 +1091,7 @@ function ua(s, n) {
1080
1091
  l,
1081
1092
  c
1082
1093
  ],
1083
- queryFn: () => ze(
1094
+ queryFn: () => we(
1084
1095
  "https://semaphor.cloud/api/v1/columns",
1085
1096
  (t == null ? void 0 : t.accessToken) || "",
1086
1097
  {
@@ -1090,7 +1101,7 @@ function ua(s, n) {
1090
1101
  table_name: c
1091
1102
  }
1092
1103
  ),
1093
- enabled: g(y)
1104
+ enabled: f(j)
1094
1105
  // (!!selectedConnectionId &&
1095
1106
  // !!selectedDatabaseName &&
1096
1107
  // !!selectedSchemaName &&
@@ -1100,75 +1111,75 @@ function ua(s, n) {
1100
1111
  // && currentConnection?.type !== 'API', // Only fetch if connectionId, database, and table is present
1101
1112
  });
1102
1113
  K(() => {
1103
- d(a);
1104
- }, [H, d, a]), K(() => {
1114
+ h(a);
1115
+ }, [V, h, a]), K(() => {
1105
1116
  }, [
1106
- z,
1107
- h,
1108
- C,
1117
+ F,
1118
+ d,
1119
+ N,
1109
1120
  u,
1110
1121
  m,
1111
1122
  O
1112
1123
  ]);
1113
- const je = (O == null ? void 0 : O.type) === "API" ? (ss = O == null ? void 0 : O.type) == null ? void 0 : ss.toLowerCase() : c || "", be = z ? "" : l || "";
1124
+ const je = (O == null ? void 0 : O.type) === "API" ? (ss = O == null ? void 0 : O.type) == null ? void 0 : ss.toLowerCase() : c || "", be = F ? "" : l || "";
1114
1125
  function xe(S) {
1115
- u(S), C("");
1126
+ u(S), N("");
1116
1127
  }
1117
- function P(S) {
1118
- m(S), u(""), C("");
1128
+ function G(S) {
1129
+ m(S), u(""), N("");
1119
1130
  }
1120
1131
  function ne(S) {
1121
- f(S);
1132
+ g(S);
1122
1133
  }
1123
- E && ((ve = E == null ? void 0 : E.databases) == null ? void 0 : ve.length) > 0, D && ((Pe = D == null ? void 0 : D.schemas) == null ? void 0 : Pe.length) > 0, H && ((qe = H == null ? void 0 : H.columns) == null ? void 0 : qe.length) > 0 && (a = H.columns.map((S) => ({
1134
+ A && ((ve = A == null ? void 0 : A.databases) == null ? void 0 : ve.length) > 0, D && ((Je = D == null ? void 0 : D.schemas) == null ? void 0 : Je.length) > 0, V && ((Ie = V == null ? void 0 : V.columns) == null ? void 0 : Ie.length) > 0 && (a = V.columns.map((S) => ({
1124
1135
  ...S,
1125
1136
  data_type: S.data_type.toLowerCase()
1126
- }))), $ && (a = []), (ge || A) && (a = []);
1137
+ }))), $ && (a = []), (ge || C) && (a = []);
1127
1138
  const le = b == null ? void 0 : b.connections.map(
1128
1139
  (S) => ({
1129
1140
  id: S.id,
1130
1141
  name: S.name,
1131
1142
  type: S.type
1132
1143
  })
1133
- ), ye = E == null ? void 0 : E.databases.map((S) => ({
1144
+ ), ye = A == null ? void 0 : A.databases.map((S) => ({
1134
1145
  id: S.database_name,
1135
1146
  name: S.database_name
1136
1147
  })), re = D == null ? void 0 : D.schemas.map((S) => ({
1137
1148
  id: S.schema_name,
1138
1149
  name: S.schema_name
1139
- })), Ie = J == null ? void 0 : J.tables.map((S) => ({
1150
+ })), De = P == null ? void 0 : P.tables.map((S) => ({
1140
1151
  id: S.table_name,
1141
1152
  name: S.table_name
1142
1153
  }));
1143
1154
  return {
1144
1155
  connectionItems: le,
1145
- isConnectionsLoading: L,
1146
- isConnectionsError: A,
1156
+ isConnectionsLoading: E,
1157
+ isConnectionsError: C,
1147
1158
  databaseItems: ye,
1148
- isDatabasesLoadingOrFetching: _ || Y,
1159
+ isDatabasesLoadingOrFetching: q || Y,
1149
1160
  isDatabaseError: $,
1150
1161
  schemaItems: re,
1151
- isSchemaLoadingOrFetching: te || G,
1162
+ isSchemaLoadingOrFetching: te || J,
1152
1163
  isSchemaError: ee,
1153
- tableItems: Ie,
1154
- isTableLoadingOrFetching: I || v,
1155
- isTableError: N,
1164
+ tableItems: De,
1165
+ isTableLoadingOrFetching: I || y,
1166
+ isTableError: v,
1156
1167
  columns: a,
1157
1168
  isColumnsLoadingOrFetching: ue || se,
1158
1169
  isColumnsError: ge,
1159
- isNonDbConnection: z,
1160
- connectionType: y,
1170
+ isNonDbConnection: F,
1171
+ connectionType: j,
1161
1172
  tableName: je,
1162
1173
  schemaName: be,
1163
1174
  handleConnectionChange: ne,
1164
- handleDatabaseChange: P,
1175
+ handleDatabaseChange: G,
1165
1176
  handleSchemaChange: xe
1166
1177
  };
1167
1178
  }
1168
1179
  function xa({
1169
1180
  ColumnsComponent: s
1170
1181
  }) {
1171
- var J;
1182
+ var P;
1172
1183
  const n = r(
1173
1184
  (I) => I.selectedConnectionId
1174
1185
  ), a = r(
@@ -1180,61 +1191,61 @@ function xa({
1180
1191
  ), {
1181
1192
  connectionItems: l,
1182
1193
  schemaItems: c,
1183
- databaseItems: d,
1184
- tableItems: f,
1194
+ databaseItems: h,
1195
+ tableItems: g,
1185
1196
  columns: m,
1186
1197
  isConnectionsLoading: u,
1187
- isConnectionsError: C,
1188
- isDatabasesLoadingOrFetching: h,
1198
+ isConnectionsError: N,
1199
+ isDatabasesLoadingOrFetching: d,
1189
1200
  isDatabaseError: x,
1190
- isSchemaLoadingOrFetching: g,
1191
- isSchemaError: j,
1201
+ isSchemaLoadingOrFetching: f,
1202
+ isSchemaError: w,
1192
1203
  isColumnsError: b,
1193
- isColumnsLoadingOrFetching: L,
1194
- isTableLoadingOrFetching: A,
1204
+ isColumnsLoadingOrFetching: E,
1205
+ isTableLoadingOrFetching: C,
1195
1206
  isTableError: O,
1196
- connectionType: y,
1197
- isNonDbConnection: z,
1198
- handleConnectionChange: E,
1199
- handleDatabaseChange: _,
1207
+ connectionType: j,
1208
+ isNonDbConnection: F,
1209
+ handleConnectionChange: A,
1210
+ handleDatabaseChange: q,
1200
1211
  handleSchemaChange: Y,
1201
1212
  tableName: $,
1202
1213
  schemaName: U
1203
1214
  } = ua();
1204
1215
  function D() {
1205
1216
  return s ? s(U, $, m) : /* @__PURE__ */ e.jsx(
1206
- vn,
1217
+ Nn,
1207
1218
  {
1208
1219
  schemaName: U,
1209
1220
  tableName: $,
1210
1221
  columns: m,
1211
- status: L ? "Loading..." : b ? "Error" : "Success"
1222
+ status: E ? "Loading..." : b ? "Error" : "Success"
1212
1223
  }
1213
1224
  );
1214
1225
  }
1215
1226
  function te() {
1216
1227
  window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
1217
1228
  }
1218
- function G() {
1219
- return y === "S3" || y === "API" ? null : /* @__PURE__ */ e.jsx(
1220
- Ge,
1229
+ function J() {
1230
+ return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
1231
+ Qe,
1221
1232
  {
1222
- onChange: _,
1233
+ onChange: q,
1223
1234
  isError: x,
1224
- isLoading: h,
1225
- items: d,
1235
+ isLoading: d,
1236
+ items: h,
1226
1237
  value: a || "",
1227
1238
  title: "Database"
1228
1239
  }
1229
1240
  );
1230
1241
  }
1231
1242
  function ee() {
1232
- return y === "S3" || y === "API" ? null : /* @__PURE__ */ e.jsx(
1233
- Ge,
1243
+ return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
1244
+ Qe,
1234
1245
  {
1235
1246
  onChange: Y,
1236
- isError: j,
1237
- isLoading: g,
1247
+ isError: w,
1248
+ isLoading: f,
1238
1249
  items: c,
1239
1250
  value: t || "",
1240
1251
  title: "Schema"
@@ -1242,13 +1253,13 @@ function xa({
1242
1253
  );
1243
1254
  }
1244
1255
  function Z() {
1245
- return y === "API" ? null : /* @__PURE__ */ e.jsx(
1246
- Ge,
1256
+ return j === "API" ? null : /* @__PURE__ */ e.jsx(
1257
+ Qe,
1247
1258
  {
1248
1259
  onChange: o,
1249
1260
  isError: O,
1250
- items: f,
1251
- isLoading: A,
1261
+ items: g,
1262
+ isLoading: C,
1252
1263
  value: i || "",
1253
1264
  title: "Table"
1254
1265
  }
@@ -1257,40 +1268,40 @@ function xa({
1257
1268
  return /* @__PURE__ */ e.jsxs("aside", { className: "xbg-red-100 flex grow flex-col justify-between", children: [
1258
1269
  /* @__PURE__ */ e.jsxs("section", { className: "space-y-3 px-6 py-4", children: [
1259
1270
  /* @__PURE__ */ e.jsx(
1260
- Ge,
1271
+ Qe,
1261
1272
  {
1262
1273
  items: l,
1263
1274
  title: "Connection",
1264
1275
  value: n || "",
1265
- onChange: E,
1276
+ onChange: A,
1266
1277
  isLoading: u,
1267
- isError: C,
1268
- connectionTooltip: ((J = l == null ? void 0 : l.find(
1278
+ isError: N,
1279
+ connectionTooltip: ((P = l == null ? void 0 : l.find(
1269
1280
  (I) => I.id === n
1270
- )) == null ? void 0 : J.type) || ""
1281
+ )) == null ? void 0 : P.type) || ""
1271
1282
  }
1272
1283
  ),
1273
- G(),
1284
+ J(),
1274
1285
  ee(),
1275
1286
  Z()
1276
1287
  ] }),
1277
1288
  D(),
1278
1289
  /* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
1279
- w,
1290
+ z,
1280
1291
  {
1281
1292
  onClick: te,
1282
1293
  size: "sm",
1283
1294
  variant: "secondary",
1284
1295
  className: "w-full",
1285
1296
  children: [
1286
- /* @__PURE__ */ e.jsx(tn, { className: "mr-2 size-4" }),
1297
+ /* @__PURE__ */ e.jsx(nn, { className: "mr-2 size-4" }),
1287
1298
  "Help"
1288
1299
  ]
1289
1300
  }
1290
1301
  ) })
1291
1302
  ] });
1292
1303
  }
1293
- function Nn(s) {
1304
+ function Cn(s) {
1294
1305
  const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), i = s.toUpperCase().indexOf("ORDER BY");
1295
1306
  let o = s.length;
1296
1307
  if (i !== -1 && (o = i), t !== -1 && t < o && (o = t), n !== -1) {
@@ -1306,17 +1317,17 @@ function Nn(s) {
1306
1317
  return `${l} {{ filters | where }} ${c}`;
1307
1318
  }
1308
1319
  }
1309
- function Cn({
1320
+ function Sn({
1310
1321
  error: s,
1311
1322
  setShowAIDialog: n,
1312
1323
  setUserInputforAI: a,
1313
1324
  setTriggerAIRun: t
1314
1325
  }) {
1315
- return /* @__PURE__ */ e.jsxs(Zs, { openDelay: 0, children: [
1316
- /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Pt, { className: "h-4 w-4 text-red-500" }) }) }),
1317
- /* @__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: [
1326
+ return /* @__PURE__ */ e.jsxs(Ys, { openDelay: 0, children: [
1327
+ /* @__PURE__ */ e.jsx(Xs, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Jt, { className: "h-4 w-4 text-red-500" }) }) }),
1328
+ /* @__PURE__ */ e.jsx(Zs, { 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: [
1318
1329
  /* @__PURE__ */ e.jsxs(
1319
- w,
1330
+ z,
1320
1331
  {
1321
1332
  onClick: () => {
1322
1333
  n(!0), a(s), t(!0);
@@ -1324,16 +1335,16 @@ function Cn({
1324
1335
  size: "sm",
1325
1336
  variant: "outline",
1326
1337
  children: [
1327
- /* @__PURE__ */ e.jsx(Yt, { className: "h-4 w-4 mr-2" }),
1338
+ /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4 mr-2" }),
1328
1339
  "Fix It"
1329
1340
  ]
1330
1341
  }
1331
1342
  ),
1332
- /* @__PURE__ */ e.jsx(bs, { className: " min-h-0 max-h-[250px] overflow-scroll ", children: /* @__PURE__ */ e.jsx("p", { className: " overflow-auto text-sm leading-relaxed font-mono ", children: s }) })
1343
+ /* @__PURE__ */ e.jsx(Ns, { className: " min-h-0 max-h-[250px] overflow-scroll ", children: /* @__PURE__ */ e.jsx("p", { className: " overflow-auto text-sm leading-relaxed font-mono ", children: s }) })
1333
1344
  ] }) }) })
1334
1345
  ] });
1335
1346
  }
1336
- function Sn({
1347
+ function kn({
1337
1348
  text: s,
1338
1349
  onCheckedChange: n,
1339
1350
  checked: a
@@ -1343,17 +1354,17 @@ function Sn({
1343
1354
  /* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
1344
1355
  ] });
1345
1356
  }
1346
- function kn() {
1347
- const { authToken: s } = es(), n = Be(null), a = r((c) => c.applyFilters), [t, i] = M(""), o = r((c) => c.filterValues), l = r((c) => c.card.sql);
1357
+ function wn() {
1358
+ const { authToken: s } = es(), n = Be(null), a = r((c) => c.applyFilters), [t, i] = T(""), o = r((c) => c.filterValues), l = r((c) => c.card.sql);
1348
1359
  return /* @__PURE__ */ e.jsxs(
1349
- Zs,
1360
+ Ys,
1350
1361
  {
1351
1362
  openDelay: 0,
1352
1363
  onOpenChange: async (c) => {
1353
1364
  if (!c)
1354
1365
  return;
1355
1366
  console.log("onOpenChange");
1356
- const d = await aa(
1367
+ const h = await ea(
1357
1368
  "https://semaphor.cloud/api/v1/filter-sql",
1358
1369
  (s == null ? void 0 : s.accessToken) || "",
1359
1370
  {
@@ -1361,15 +1372,15 @@ function kn() {
1361
1372
  active_filters: o
1362
1373
  }
1363
1374
  );
1364
- console.log(d), d.sql ? (console.log(d.records), i(d.sql)) : i("Error");
1375
+ console.log(h), h.sql ? (console.log(h.records), i(h.sql)) : i("Error");
1365
1376
  },
1366
1377
  children: [
1367
- /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
1368
- /* @__PURE__ */ e.jsxs(sa, { align: "end", className: "w-[600px]", children: [
1378
+ /* @__PURE__ */ e.jsx(Xs, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
1379
+ /* @__PURE__ */ e.jsxs(Zs, { align: "end", className: "w-[600px]", children: [
1369
1380
  /* @__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: [
1370
1381
  t,
1371
1382
  /* @__PURE__ */ e.jsx(
1372
- ta,
1383
+ sa,
1373
1384
  {
1374
1385
  onClick: () => Wa(n),
1375
1386
  className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
@@ -1385,7 +1396,7 @@ function kn() {
1385
1396
  }
1386
1397
  );
1387
1398
  }
1388
- const wn = `
1399
+ const zn = `
1389
1400
 
1390
1401
  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.
1391
1402
 
@@ -1432,7 +1443,7 @@ SELECT label, measure FROM table
1432
1443
  - Label - Category
1433
1444
  - Measure - Number
1434
1445
  `;
1435
- function zn({
1446
+ function Fn({
1436
1447
  open: s,
1437
1448
  setOpen: n,
1438
1449
  userInput: a,
@@ -1440,61 +1451,61 @@ function zn({
1440
1451
  triggerAIRun: i,
1441
1452
  setTriggerAIRun: o
1442
1453
  }) {
1443
- const l = Be(null), c = Be(null), { authToken: d } = es(), [f, m] = M(!1), u = r((v) => v.actions.setCardSql), C = k((v) => v.dashboard.baseQueries), h = r((v) => v.actions.setRunSql), x = r((v) => v.actions.setCardType), [g, j] = M([]), b = r((v) => v.currentColumns), L = r((v) => v.card.sql), A = r((v) => v.selectedTableName), O = `
1454
+ const l = Be(null), c = Be(null), { authToken: h } = es(), [g, m] = T(!1), u = r((y) => y.actions.setCardSql), N = k((y) => y.dashboard.baseQueries), d = r((y) => y.actions.setRunSql), x = r((y) => y.actions.setCardType), [f, w] = T([]), b = r((y) => y.currentColumns), E = r((y) => y.card.sql), C = r((y) => y.selectedTableName), O = `
1444
1455
  ${a}
1445
1456
 
1446
- Database Query Dialect: ${A === "api" || A === "s3" ? "DuckDb" : ""}
1447
- Table Name: ${A}
1448
- Table Columns: ${b == null ? void 0 : b.map((v) => `${v.column_name} | ${v.data_type}`).join(", ")}
1449
- User SQL: ${L}
1450
- ${C && `Base Queries: ${JSON.stringify(C)} `}`, y = ` 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.
1451
- Visual Query Syntax: ${wn}`, { data: z, isLoading: E, isFetching: _, isError: Y, refetch: $ } = Ce({
1457
+ Database Query Dialect: ${C === "api" || C === "s3" ? "DuckDb" : ""}
1458
+ Table Name: ${C}
1459
+ Table Columns: ${b == null ? void 0 : b.map((y) => `${y.column_name} | ${y.data_type}`).join(", ")}
1460
+ User SQL: ${E}
1461
+ ${N && `Base Queries: ${JSON.stringify(N)} `}`, j = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
1462
+ Visual Query Syntax: ${zn}`, { data: F, isLoading: A, isFetching: q, isError: Y, refetch: $ } = Ce({
1452
1463
  queryKey: ["ai-query"],
1453
- queryFn: () => ze(
1464
+ queryFn: () => we(
1454
1465
  "https://semaphor.cloud/api/v1/ai",
1455
- (d == null ? void 0 : d.accessToken) || "",
1466
+ (h == null ? void 0 : h.accessToken) || "",
1456
1467
  {
1457
- user_content: `userContent: ${O} ${f ? y : ""}`
1468
+ user_content: `userContent: ${O} ${g ? j : ""}`
1458
1469
  }
1459
1470
  ),
1460
1471
  enabled: !1
1461
1472
  // Do not run by default.
1462
1473
  });
1463
- function U(v) {
1464
- if (v.toLowerCase().includes("bar"))
1474
+ function U(y) {
1475
+ if (y.toLowerCase().includes("bar"))
1465
1476
  x("bar");
1466
- else if (v.toLowerCase().includes("line"))
1477
+ else if (y.toLowerCase().includes("line"))
1467
1478
  x("line");
1468
- else if (v.toLowerCase().includes("bubble"))
1479
+ else if (y.toLowerCase().includes("bubble"))
1469
1480
  x("bubble");
1470
- else if (v.toLowerCase().includes("scatter"))
1481
+ else if (y.toLowerCase().includes("scatter"))
1471
1482
  x("scatter");
1472
- else if (v.toLowerCase().includes("stacked"))
1483
+ else if (y.toLowerCase().includes("stacked"))
1473
1484
  x("stackedBar");
1474
- else if (v.toLowerCase().includes("pie"))
1485
+ else if (y.toLowerCase().includes("pie"))
1475
1486
  x("pie");
1476
- else if (v.toLowerCase().includes("donut") || v.toLowerCase().includes("doughnut"))
1487
+ else if (y.toLowerCase().includes("donut") || y.toLowerCase().includes("doughnut"))
1477
1488
  x("doughnut");
1478
- else if (v.toLowerCase().includes("radar"))
1489
+ else if (y.toLowerCase().includes("radar"))
1479
1490
  x("radar");
1480
1491
  else
1481
1492
  return x("bar"), !1;
1482
1493
  return !0;
1483
1494
  }
1484
1495
  K(() => {
1485
- z && j((v) => [...v, { role: "ai", content: z.response }]);
1486
- }, [z]), K(() => {
1487
- const v = setTimeout(() => {
1488
- var N;
1496
+ F && w((y) => [...y, { role: "ai", content: F.response }]);
1497
+ }, [F]), K(() => {
1498
+ const y = setTimeout(() => {
1499
+ var v;
1489
1500
  c.current && (c.current.scroll({
1490
1501
  top: c.current.scrollHeight,
1491
1502
  behavior: "smooth"
1492
- }), (N = l.current) == null || N.focus());
1503
+ }), (v = l.current) == null || v.focus());
1493
1504
  }, 100);
1494
- return () => clearTimeout(v);
1495
- }, [g]);
1505
+ return () => clearTimeout(y);
1506
+ }, [f]);
1496
1507
  function D() {
1497
- a && (j((v) => [...v, { role: "user", content: a }]), U(a) && m(!0), t(""), $());
1508
+ a && (w((y) => [...y, { role: "user", content: a }]), U(a) && m(!0), t(""), $());
1498
1509
  }
1499
1510
  K(() => {
1500
1511
  i && (D(), o(!1));
@@ -1507,7 +1518,7 @@ function zn({
1507
1518
  fontSize: 15,
1508
1519
  // padding: '5px',
1509
1520
  width: "100%"
1510
- }, G = {
1521
+ }, J = {
1511
1522
  // background: '#f6f8fa',
1512
1523
  // color: '#000',
1513
1524
  fontFamily: "monospace",
@@ -1526,18 +1537,18 @@ function zn({
1526
1537
  listStyleType: "disc"
1527
1538
  }, Z = {
1528
1539
  // Override how paragraphs are rendered
1529
- p: ({ node: v, ...N }) => /* @__PURE__ */ e.jsx("p", { style: te, ...N }),
1530
- code: ({ node: v, ...N }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...N }),
1531
- pre: ({ node: v, ...N }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: G, children: [
1532
- /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: N.children }),
1540
+ p: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("p", { style: te, ...v }),
1541
+ code: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...v }),
1542
+ pre: ({ node: y, ...v }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: J, children: [
1543
+ /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: v.children }),
1533
1544
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1534
- /* @__PURE__ */ e.jsx(w, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ta, {}) }),
1545
+ /* @__PURE__ */ e.jsx(z, { onClick: P, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(sa, {}) }),
1535
1546
  /* @__PURE__ */ e.jsx(
1536
- w,
1547
+ z,
1537
1548
  {
1538
- onClick: (F) => {
1539
- const H = J(F);
1540
- H && (n(!1), u(H), h(!0));
1549
+ onClick: (M) => {
1550
+ const V = P(M);
1551
+ V && (n(!1), u(V), d(!0));
1541
1552
  },
1542
1553
  size: "sm",
1543
1554
  variant: "outline",
@@ -1546,40 +1557,40 @@ function zn({
1546
1557
  )
1547
1558
  ] })
1548
1559
  ] }),
1549
- li: ({ node: v, ...N }) => /* @__PURE__ */ e.jsx("li", { style: ee, ...N })
1560
+ li: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("li", { style: ee, ...v })
1550
1561
  // You can add more overrides for other elements like h1, h2, etc.
1551
1562
  };
1552
- function J(v) {
1553
- const N = v.currentTarget.closest("pre");
1554
- if (!N)
1563
+ function P(y) {
1564
+ const v = y.currentTarget.closest("pre");
1565
+ if (!v)
1555
1566
  return;
1556
- const F = N.textContent || N.innerText;
1557
- return navigator.clipboard.writeText(F).then(() => console.log("Text copied to clipboard")).catch((H) => console.error("Error in copying text: ", H)), F;
1567
+ const M = v.textContent || v.innerText;
1568
+ return navigator.clipboard.writeText(M).then(() => console.log("Text copied to clipboard")).catch((V) => console.error("Error in copying text: ", V)), M;
1558
1569
  }
1559
1570
  function I() {
1560
- return g == null ? void 0 : g.map((v, N) => v.role === "user" ? /* @__PURE__ */ e.jsxs(
1571
+ return f == null ? void 0 : f.map((y, v) => y.role === "user" ? /* @__PURE__ */ e.jsxs(
1561
1572
  "div",
1562
1573
  {
1563
1574
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
1564
1575
  children: [
1565
- /* @__PURE__ */ e.jsx(pn, { className: "mr-2 h-5 w-5" }),
1566
- /* @__PURE__ */ e.jsx("div", { children: v.content })
1576
+ /* @__PURE__ */ e.jsx(fn, { className: "mr-2 h-5 w-5" }),
1577
+ /* @__PURE__ */ e.jsx("div", { children: y.content })
1567
1578
  ]
1568
1579
  },
1569
- N
1570
- ) : v.role === "ai" ? /* @__PURE__ */ e.jsx(
1580
+ v
1581
+ ) : y.role === "ai" ? /* @__PURE__ */ e.jsx(
1571
1582
  Za,
1572
1583
  {
1573
1584
  className: "w-full overflow-auto py-1",
1574
1585
  components: Z,
1575
- children: z == null ? void 0 : z.response.replace(/DuckDB/gi, "Semaphor")
1586
+ children: F == null ? void 0 : F.response.replace(/DuckDB/gi, "Semaphor")
1576
1587
  },
1577
- N
1578
- ) : /* @__PURE__ */ e.jsx("div", {}, N));
1588
+ v
1589
+ ) : /* @__PURE__ */ e.jsx("div", {}, v));
1579
1590
  }
1580
- return /* @__PURE__ */ e.jsxs(ds, { open: s, onOpenChange: n, children: [
1581
- /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1582
- w,
1591
+ return /* @__PURE__ */ e.jsxs(us, { open: s, onOpenChange: n, children: [
1592
+ /* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1593
+ z,
1583
1594
  {
1584
1595
  size: "sm",
1585
1596
  className: "w-full justify-start border font-normal text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",
@@ -1588,13 +1599,13 @@ function zn({
1588
1599
  }
1589
1600
  ) }),
1590
1601
  /* @__PURE__ */ e.jsxs(
1591
- ms,
1602
+ ps,
1592
1603
  {
1593
1604
  className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
1594
1605
  children: [
1595
- /* @__PURE__ */ e.jsxs(us, { children: [
1596
- /* @__PURE__ */ e.jsx(xs, { children: "Assistant" }),
1597
- /* @__PURE__ */ e.jsx(ps, { children: "What can I help you with?" })
1606
+ /* @__PURE__ */ e.jsxs(fs, { children: [
1607
+ /* @__PURE__ */ e.jsx(gs, { children: "Assistant" }),
1608
+ /* @__PURE__ */ e.jsx(js, { children: "What can I help you with?" })
1598
1609
  ] }),
1599
1610
  /* @__PURE__ */ e.jsx(
1600
1611
  "div",
@@ -1609,35 +1620,35 @@ function zn({
1609
1620
  {
1610
1621
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center rounded-md border", children: [
1611
1622
  /* @__PURE__ */ e.jsx(
1612
- na,
1623
+ aa,
1613
1624
  {
1614
1625
  autoFocus: !0,
1615
1626
  ref: l,
1616
- onKeyDown: (v) => {
1617
- v.key === "Enter" && !v.shiftKey && (v.preventDefault(), t(""), D());
1627
+ onKeyDown: (y) => {
1628
+ y.key === "Enter" && !y.shiftKey && (y.preventDefault(), t(""), D());
1618
1629
  },
1619
1630
  placeholder: "Type your question here...",
1620
- onFocus: (v) => {
1621
- const N = v.target, F = N.value.length;
1622
- N.setSelectionRange(F, F);
1631
+ onFocus: (y) => {
1632
+ const v = y.target, M = v.value.length;
1633
+ v.setSelectionRange(M, M);
1623
1634
  },
1624
1635
  className: W(
1625
1636
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1626
1637
  ),
1627
- disabled: E || _,
1638
+ disabled: A || q,
1628
1639
  value: a,
1629
- onChange: (v) => t(v.target.value)
1640
+ onChange: (y) => t(y.target.value)
1630
1641
  }
1631
1642
  ),
1632
1643
  " ",
1633
1644
  /* @__PURE__ */ e.jsx(
1634
- w,
1645
+ z,
1635
1646
  {
1636
1647
  className: "h-8",
1637
1648
  size: "sm",
1638
1649
  variant: "ghost",
1639
1650
  onClick: D,
1640
- children: !E && !_ ? /* @__PURE__ */ e.jsx(Xa, {}) : /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1651
+ children: !A && !q ? /* @__PURE__ */ e.jsx(Xa, {}) : /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1641
1652
  }
1642
1653
  )
1643
1654
  ] })
@@ -1654,11 +1665,11 @@ var pa = {
1654
1665
  className: void 0,
1655
1666
  style: void 0,
1656
1667
  attr: void 0
1657
- }, _s = me.createContext && /* @__PURE__ */ me.createContext(pa), Fn = ["attr", "size", "title"];
1658
- function On(s, n) {
1668
+ }, Rs = me.createContext && /* @__PURE__ */ me.createContext(pa), On = ["attr", "size", "title"];
1669
+ function Mn(s, n) {
1659
1670
  if (s == null)
1660
1671
  return {};
1661
- var a = Mn(s, n), t, i;
1672
+ var a = Tn(s, n), t, i;
1662
1673
  if (Object.getOwnPropertySymbols) {
1663
1674
  var o = Object.getOwnPropertySymbols(s);
1664
1675
  for (i = 0; i < o.length; i++)
@@ -1666,7 +1677,7 @@ function On(s, n) {
1666
1677
  }
1667
1678
  return a;
1668
1679
  }
1669
- function Mn(s, n) {
1680
+ function Tn(s, n) {
1670
1681
  if (s == null)
1671
1682
  return {};
1672
1683
  var a = {}, t = Object.keys(s), i, o;
@@ -1684,7 +1695,7 @@ function Xe() {
1684
1695
  return s;
1685
1696
  }, Xe.apply(this, arguments);
1686
1697
  }
1687
- function Hs(s, n) {
1698
+ function _s(s, n) {
1688
1699
  var a = Object.keys(s);
1689
1700
  if (Object.getOwnPropertySymbols) {
1690
1701
  var t = Object.getOwnPropertySymbols(s);
@@ -1697,18 +1708,18 @@ function Hs(s, n) {
1697
1708
  function Ze(s) {
1698
1709
  for (var n = 1; n < arguments.length; n++) {
1699
1710
  var a = arguments[n] != null ? arguments[n] : {};
1700
- n % 2 ? Hs(Object(a), !0).forEach(function(t) {
1701
- Tn(s, t, a[t]);
1702
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : Hs(Object(a)).forEach(function(t) {
1711
+ n % 2 ? _s(Object(a), !0).forEach(function(t) {
1712
+ An(s, t, a[t]);
1713
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : _s(Object(a)).forEach(function(t) {
1703
1714
  Object.defineProperty(s, t, Object.getOwnPropertyDescriptor(a, t));
1704
1715
  });
1705
1716
  }
1706
1717
  return s;
1707
1718
  }
1708
- function Tn(s, n, a) {
1709
- return n = An(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
1719
+ function An(s, n, a) {
1720
+ return n = Ln(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
1710
1721
  }
1711
- function An(s) {
1722
+ function Ln(s) {
1712
1723
  var n = En(s, "string");
1713
1724
  return typeof n == "symbol" ? n : String(n);
1714
1725
  }
@@ -1730,23 +1741,23 @@ function fa(s) {
1730
1741
  }, n.attr), fa(n.child)));
1731
1742
  }
1732
1743
  function fe(s) {
1733
- return (n) => /* @__PURE__ */ me.createElement(Ln, Xe({
1744
+ return (n) => /* @__PURE__ */ me.createElement(Dn, Xe({
1734
1745
  attr: Ze({}, s.attr)
1735
1746
  }, n), fa(s.child));
1736
1747
  }
1737
- function Ln(s) {
1748
+ function Dn(s) {
1738
1749
  var n = (a) => {
1739
1750
  var {
1740
1751
  attr: t,
1741
1752
  size: i,
1742
1753
  title: o
1743
- } = s, l = On(s, Fn), c = i || a.size || "1em", d;
1744
- return a.className && (d = a.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ me.createElement("svg", Xe({
1754
+ } = s, l = Mn(s, On), c = i || a.size || "1em", h;
1755
+ return a.className && (h = a.className), s.className && (h = (h ? h + " " : "") + s.className), /* @__PURE__ */ me.createElement("svg", Xe({
1745
1756
  stroke: "currentColor",
1746
1757
  fill: "currentColor",
1747
1758
  strokeWidth: "0"
1748
1759
  }, a.attr, t, l, {
1749
- className: d,
1760
+ className: h,
1750
1761
  style: Ze(Ze({
1751
1762
  color: s.color || a.color
1752
1763
  }, a.style), s.style),
@@ -1755,17 +1766,17 @@ function Ln(s) {
1755
1766
  xmlns: "http://www.w3.org/2000/svg"
1756
1767
  }), o && /* @__PURE__ */ me.createElement("title", null, o), s.children);
1757
1768
  };
1758
- return _s !== void 0 ? /* @__PURE__ */ me.createElement(_s.Consumer, null, (a) => n(a)) : n(pa);
1769
+ return Rs !== void 0 ? /* @__PURE__ */ me.createElement(Rs.Consumer, null, (a) => n(a)) : n(pa);
1759
1770
  }
1760
- function Dn(s) {
1771
+ function In(s) {
1761
1772
  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);
1762
1773
  }
1763
- function In() {
1764
- const { theme: s } = st(), n = Be(), a = Be(), [t, i] = M(!1), [o, l] = M(!1), [c, d] = M(!1), [f, m] = M(""), [u, C] = M(!1), { authToken: h } = es();
1774
+ function qn() {
1775
+ const { theme: s } = st(), n = Be(), a = Be(), [t, i] = T(!1), [o, l] = T(!1), [c, h] = T(!1), [g, m] = T(""), [u, N] = T(!1), { authToken: d } = es();
1765
1776
  k((p) => p.selectedSheetId);
1766
- const x = k((p) => p.dashboard.baseQueries), g = r((p) => p.card), j = k((p) => p.theme), b = r((p) => p.isShowingVisual), L = r(
1777
+ const x = k((p) => p.dashboard.baseQueries), f = r((p) => p.card), w = k((p) => p.theme), b = r((p) => p.isShowingVisual), E = r(
1767
1778
  (p) => p.selectedConnectionId
1768
- ), A = r(
1779
+ ), C = r(
1769
1780
  (p) => p.selectedDatabaseName
1770
1781
  ), O = r(
1771
1782
  (p) => p.selectedSchemaName
@@ -1773,37 +1784,37 @@ function In() {
1773
1784
  k(
1774
1785
  (p) => p.actions.updateFrameCard
1775
1786
  );
1776
- const y = r((p) => p.selectedTableName), z = r((p) => p.card.sql), E = r((p) => p.card.python), _ = at(z, x), Y = r((p) => p.selectedConnectionId), $ = r((p) => p.frame), U = r((p) => p.filterValues), D = r((p) => p.applyFilters), {
1787
+ const j = r((p) => p.selectedTableName), F = r((p) => p.card.sql), A = r((p) => p.card.python), q = at(F, x), Y = r((p) => p.selectedConnectionId), $ = r((p) => p.frame), U = r((p) => p.filterValues), D = r((p) => p.applyFilters), {
1777
1788
  setCardCustomCfg: te,
1778
- setQueryResultColumns: G,
1789
+ setQueryResultColumns: J,
1779
1790
  setFilterValues: ee,
1780
1791
  setCardSql: Z,
1781
- setCardPython: J,
1792
+ setCardPython: P,
1782
1793
  setQueryError: I,
1783
- setPythonStdOut: v,
1784
- setCardPreferences: N
1785
- } = r((p) => p.actions), F = r((p) => p.onSave), H = r(
1794
+ setPythonStdOut: y,
1795
+ setCardPreferences: v
1796
+ } = r((p) => p.actions), M = r((p) => p.onSave), V = r(
1786
1797
  (p) => p.actions.setApplyFilters
1787
1798
  ), ue = r((p) => p.onClose), se = r((p) => p.actions.setCardData), ge = r((p) => p.actions.setSqlGen), je = r((p) => p.runSql), be = r((p) => p.actions.setRunSql), xe = r(
1788
1799
  (p) => p.actions.setIsSqlRunning
1789
1800
  ), {
1790
- data: P,
1801
+ data: G,
1791
1802
  isLoading: ne,
1792
1803
  isFetching: le,
1793
1804
  isSuccess: ye,
1794
1805
  isError: re,
1795
- error: Ie,
1806
+ error: De,
1796
1807
  status: ss,
1797
1808
  refetch: ve
1798
1809
  } = Ce({
1799
- queryKey: [_, E],
1800
- queryFn: () => aa(
1810
+ queryKey: [q, A],
1811
+ queryFn: () => ea(
1801
1812
  "https://semaphor.cloud/api/v1/query",
1802
- (h == null ? void 0 : h.accessToken) || "",
1813
+ (d == null ? void 0 : d.accessToken) || "",
1803
1814
  {
1804
1815
  connection_id: Y,
1805
- sql: _,
1806
- python: E === Ts ? "" : E,
1816
+ sql: q,
1817
+ python: A === As ? "" : A,
1807
1818
  active_filters: D ? U : []
1808
1819
  }
1809
1820
  ),
@@ -1811,51 +1822,51 @@ function In() {
1811
1822
  retry: !1
1812
1823
  });
1813
1824
  K(() => {
1814
- if (P && (se(P.records), v((P == null ? void 0 : P.output) || ""), P.records.length > 0)) {
1815
- const { dimensionKeys: p } = is(P.records);
1816
- G(p);
1825
+ if (G && (se(G.records), y((G == null ? void 0 : G.output) || ""), G.records.length > 0)) {
1826
+ const { dimensionKeys: p } = ds(G.records);
1827
+ J(p);
1817
1828
  }
1818
- }, [P, se, G, v]), K(() => {
1829
+ }, [G, se, J, y]), K(() => {
1819
1830
  je && (ve(), be(!1));
1820
1831
  }, [je, ve, be]), K(() => {
1821
- (ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(Ie.message), se([]), G([]), v("")) : I("");
1832
+ (ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(De.message), se([]), J([]), y("")) : I("");
1822
1833
  }, [
1823
1834
  ne,
1824
1835
  le,
1825
- P,
1826
- v,
1836
+ G,
1837
+ y,
1827
1838
  re,
1828
1839
  ye,
1829
1840
  xe,
1830
1841
  se,
1831
- G,
1842
+ J,
1832
1843
  I,
1833
- Ie
1844
+ De
1834
1845
  ]);
1835
- function Pe() {
1836
- Z(""), se([]), ge({}), te(""), N({});
1846
+ function Je() {
1847
+ Z(""), se([]), ge({}), te(""), v({});
1837
1848
  }
1838
- const qe = (p) => {
1849
+ const Ie = (p) => {
1839
1850
  a.current = p;
1840
1851
  };
1841
1852
  function S() {
1842
- let p = z;
1843
- z && !z.includes("{{") && (p = Nn(z), Z(p));
1853
+ let p = F;
1854
+ F && !F.includes("{{") && (p = Cn(F), Z(p));
1844
1855
  const ie = {
1845
- ...g,
1856
+ ...f,
1846
1857
  lastSelectedSchema: O,
1847
- lastSelectedDatabase: A,
1848
- lastSelectedTable: y,
1849
- connectionId: L,
1850
- type: b ? g.type : "table",
1858
+ lastSelectedDatabase: C,
1859
+ lastSelectedTable: j,
1860
+ connectionId: E,
1861
+ type: b ? f.type : "table",
1851
1862
  sql: p,
1852
- customCfg: b ? g.customCfg : null
1853
- }, Ve = $.cards.map(
1854
- (Ne) => Ne.id === g.id ? ie : Ne
1863
+ customCfg: b ? f.customCfg : null
1864
+ }, qe = $.cards.map(
1865
+ (Ne) => Ne.id === f.id ? ie : Ne
1855
1866
  );
1856
- F == null || F({
1867
+ M == null || M({
1857
1868
  ...$,
1858
- cards: Ve
1869
+ cards: qe
1859
1870
  });
1860
1871
  }
1861
1872
  function za() {
@@ -1868,9 +1879,9 @@ function In() {
1868
1879
  return Oa(ie);
1869
1880
  }
1870
1881
  function Oa(p) {
1871
- const [ie, Ve, Ne] = p.split(" "), Q = parseFloat(ie), Aa = parseFloat(Ve), Ea = parseFloat(Ne), La = Aa / 100, zs = Ea / 100, pe = (1 - Math.abs(2 * zs - 1)) * La, ke = pe * (1 - Math.abs(Q / 60 % 2 - 1)), as = zs - pe / 2;
1882
+ const [ie, qe, Ne] = p.split(" "), Q = parseFloat(ie), Aa = parseFloat(qe), La = parseFloat(Ne), Ea = Aa / 100, Fs = La / 100, pe = (1 - Math.abs(2 * Fs - 1)) * Ea, Se = pe * (1 - Math.abs(Q / 60 % 2 - 1)), as = Fs - pe / 2;
1872
1883
  let oe = 0, ce = 0, de = 0;
1873
- 0 <= Q && Q < 60 ? (oe = pe, ce = ke, de = 0) : 60 <= Q && Q < 120 ? (oe = ke, ce = pe, de = 0) : 120 <= Q && Q < 180 ? (oe = 0, ce = pe, de = ke) : 180 <= Q && Q < 240 ? (oe = 0, ce = ke, de = pe) : 240 <= Q && Q < 300 ? (oe = ke, ce = 0, de = pe) : 300 <= Q && Q < 360 && (oe = pe, ce = 0, de = ke), oe = Math.round((oe + as) * 255), ce = Math.round((ce + as) * 255), de = Math.round((de + as) * 255);
1884
+ 0 <= Q && Q < 60 ? (oe = pe, ce = Se, de = 0) : 60 <= Q && Q < 120 ? (oe = Se, ce = pe, de = 0) : 120 <= Q && Q < 180 ? (oe = 0, ce = pe, de = Se) : 180 <= Q && Q < 240 ? (oe = 0, ce = Se, de = pe) : 240 <= Q && Q < 300 ? (oe = Se, ce = 0, de = pe) : 300 <= Q && Q < 360 && (oe = pe, ce = 0, de = Se), oe = Math.round((oe + as) * 255), ce = Math.round((ce + as) * 255), de = Math.round((de + as) * 255);
1874
1885
  const ts = (Da) => {
1875
1886
  const ns = Da.toString(16);
1876
1887
  return ns.length == 1 ? "0" + ns : ns;
@@ -1880,7 +1891,7 @@ function In() {
1880
1891
  K(() => {
1881
1892
  const p = n.current, ie = a.current;
1882
1893
  if (p) {
1883
- const Ve = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = j === "system" ? Ve : j;
1894
+ const qe = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = w === "system" ? qe : w;
1884
1895
  p.editor.defineTheme("default", {
1885
1896
  // base: theme === 'light' ? 'hc-light' : 'vs-dark',
1886
1897
  base: Ne === "light" ? "vs" : "vs-dark",
@@ -1899,8 +1910,8 @@ function In() {
1899
1910
  }
1900
1911
  ), () => {
1901
1912
  };
1902
- }, [s, j, n.current]);
1903
- function ws(p) {
1913
+ }, [s, w, n.current]);
1914
+ function zs(p) {
1904
1915
  n.current = p;
1905
1916
  }
1906
1917
  function Ma() {
@@ -1913,14 +1924,14 @@ function In() {
1913
1924
  children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
1914
1925
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
1915
1926
  /* @__PURE__ */ e.jsx(
1916
- Sn,
1927
+ kn,
1917
1928
  {
1918
1929
  checked: D,
1919
- onCheckedChange: () => H(!D),
1930
+ onCheckedChange: () => V(!D),
1920
1931
  text: "Apply Filters"
1921
1932
  }
1922
1933
  ),
1923
- /* @__PURE__ */ e.jsx(kn, {}),
1934
+ /* @__PURE__ */ e.jsx(wn, {}),
1924
1935
  U && o && /* @__PURE__ */ e.jsx(
1925
1936
  Re,
1926
1937
  {
@@ -1930,7 +1941,7 @@ function In() {
1930
1941
  )
1931
1942
  ] }),
1932
1943
  /* @__PURE__ */ e.jsx(
1933
- Qe,
1944
+ Ve,
1934
1945
  {
1935
1946
  theme: "default",
1936
1947
  onChange: (p) => {
@@ -1964,7 +1975,7 @@ function In() {
1964
1975
  }
1965
1976
  ),
1966
1977
  U && !o && /* @__PURE__ */ e.jsx(
1967
- oa,
1978
+ ia,
1968
1979
  {
1969
1980
  onClick: () => l(!0),
1970
1981
  className: W(
@@ -1979,14 +1990,14 @@ function In() {
1979
1990
  }
1980
1991
  function Ta() {
1981
1992
  return /* @__PURE__ */ e.jsxs(
1982
- os,
1993
+ hs,
1983
1994
  {
1984
1995
  className: "flex grow pb-1",
1985
1996
  direction: "vertical",
1986
1997
  role: "editor-resizable-group",
1987
1998
  children: [
1988
1999
  /* @__PURE__ */ e.jsxs(
1989
- Fe,
2000
+ ze,
1990
2001
  {
1991
2002
  id: "1",
1992
2003
  order: 1,
@@ -1999,14 +2010,14 @@ function In() {
1999
2010
  role: "sql-container",
2000
2011
  className: "relative flex w-[99%]",
2001
2012
  children: /* @__PURE__ */ e.jsx(
2002
- Qe,
2013
+ Ve,
2003
2014
  {
2004
2015
  theme: "default",
2005
2016
  className: "pt-3",
2006
2017
  onChange: (p) => {
2007
2018
  Z(p);
2008
2019
  },
2009
- value: z,
2020
+ value: F,
2010
2021
  options: {
2011
2022
  minimap: {
2012
2023
  enabled: !1
@@ -2021,8 +2032,8 @@ function In() {
2021
2032
  },
2022
2033
  defaultLanguage: "sql",
2023
2034
  defaultValue: "SELECT * FROM table",
2024
- beforeMount: ws,
2025
- onMount: qe
2035
+ beforeMount: zs,
2036
+ onMount: Ie
2026
2037
  }
2027
2038
  )
2028
2039
  }
@@ -2032,9 +2043,9 @@ function In() {
2032
2043
  }
2033
2044
  ),
2034
2045
  t && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2035
- /* @__PURE__ */ e.jsx(cs, { withHandle: !0, className: "border" }),
2046
+ /* @__PURE__ */ e.jsx(ms, { withHandle: !0, className: "border" }),
2036
2047
  /* @__PURE__ */ e.jsxs(
2037
- Fe,
2048
+ ze,
2038
2049
  {
2039
2050
  id: "2",
2040
2051
  order: 2,
@@ -2047,14 +2058,14 @@ function In() {
2047
2058
  role: "python-container",
2048
2059
  className: "relative flex w-[99%] pt-0",
2049
2060
  children: /* @__PURE__ */ e.jsx(
2050
- Qe,
2061
+ Ve,
2051
2062
  {
2052
2063
  className: "pt-3",
2053
2064
  theme: "default",
2054
2065
  onChange: (p) => {
2055
- J(p && p.trim() || "");
2066
+ P(p && p.trim() || "");
2056
2067
  },
2057
- value: E || Ts,
2068
+ value: A || As,
2058
2069
  options: {
2059
2070
  minimap: {
2060
2071
  enabled: !1
@@ -2068,8 +2079,8 @@ function In() {
2068
2079
  renderLineHighlight: "none"
2069
2080
  },
2070
2081
  defaultLanguage: "python",
2071
- beforeMount: ws,
2072
- onMount: qe
2082
+ beforeMount: zs,
2083
+ onMount: Ie
2073
2084
  }
2074
2085
  )
2075
2086
  }
@@ -2110,7 +2121,7 @@ function In() {
2110
2121
  children: [
2111
2122
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2112
2123
  /* @__PURE__ */ e.jsxs(
2113
- w,
2124
+ z,
2114
2125
  {
2115
2126
  title: "Shift + Enter",
2116
2127
  disabled: ne || le,
@@ -2121,59 +2132,59 @@ function In() {
2121
2132
  size: "sm",
2122
2133
  variant: "outline",
2123
2134
  children: [
2124
- ne || le ? /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(ln, { className: "mr-2 h-4 w-4" }),
2135
+ ne || le ? /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(rn, { className: "mr-2 h-4 w-4" }),
2125
2136
  "Run"
2126
2137
  ]
2127
2138
  }
2128
2139
  ),
2129
2140
  re && /* @__PURE__ */ e.jsx(
2130
- Cn,
2141
+ Sn,
2131
2142
  {
2132
- error: Ie.message,
2133
- setShowAIDialog: d,
2134
- setTriggerAIRun: C,
2143
+ error: De.message,
2144
+ setShowAIDialog: h,
2145
+ setTriggerAIRun: N,
2135
2146
  setUserInputforAI: m
2136
2147
  }
2137
2148
  ),
2138
2149
  /* @__PURE__ */ e.jsxs(
2139
- w,
2150
+ z,
2140
2151
  {
2141
- onClick: Pe,
2152
+ onClick: Je,
2142
2153
  className: "",
2143
2154
  size: "sm",
2144
2155
  variant: "outline",
2145
2156
  children: [
2146
- /* @__PURE__ */ e.jsx(Qt, { className: "mr-2 size-4" }),
2157
+ /* @__PURE__ */ e.jsx(Wt, { className: "mr-2 size-4" }),
2147
2158
  "Clear"
2148
2159
  ]
2149
2160
  }
2150
2161
  ),
2151
2162
  /* @__PURE__ */ e.jsx(
2152
- Xs,
2163
+ Ws,
2153
2164
  {
2154
2165
  pressed: t,
2155
2166
  onPressedChange: (p) => i(p),
2156
2167
  className: "",
2157
2168
  size: "sm",
2158
2169
  variant: "outline",
2159
- children: /* @__PURE__ */ e.jsx(Dn, { className: "size-4 text-foreground/70" })
2170
+ children: /* @__PURE__ */ e.jsx(In, { className: "size-4 text-foreground/70" })
2160
2171
  }
2161
2172
  ),
2162
2173
  /* @__PURE__ */ e.jsx(
2163
- zn,
2174
+ Fn,
2164
2175
  {
2165
2176
  open: c,
2166
- setOpen: d,
2167
- userInput: f,
2177
+ setOpen: h,
2178
+ userInput: g,
2168
2179
  triggerAIRun: u,
2169
- setTriggerAIRun: C,
2180
+ setTriggerAIRun: N,
2170
2181
  setUserInput: (p) => m(p)
2171
2182
  }
2172
2183
  )
2173
2184
  ] }),
2174
2185
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-end gap-2", children: [
2175
2186
  /* @__PURE__ */ e.jsxs(
2176
- w,
2187
+ z,
2177
2188
  {
2178
2189
  onClick: S,
2179
2190
  size: "sm",
@@ -2185,7 +2196,7 @@ function In() {
2185
2196
  }
2186
2197
  ),
2187
2198
  /* @__PURE__ */ e.jsxs(
2188
- w,
2199
+ z,
2189
2200
  {
2190
2201
  onClick: za,
2191
2202
  className: "w-full",
@@ -2206,21 +2217,21 @@ function In() {
2206
2217
  )
2207
2218
  );
2208
2219
  }
2209
- function qn({ data: s }) {
2220
+ function Vn({ data: s }) {
2210
2221
  var l;
2211
2222
  const [n, a] = me.useState([]), i = Object.keys(s[0]).map((c) => ({
2212
2223
  // header: key,
2213
2224
  accessorKey: c,
2214
- header: ({ column: d }) => {
2215
- const f = d.getIsSorted();
2225
+ header: ({ column: h }) => {
2226
+ const g = h.getIsSorted();
2216
2227
  return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
2217
2228
  "div",
2218
2229
  {
2219
2230
  className: "flex cursor-pointer items-center",
2220
- onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
2231
+ onClick: () => h.toggleSorting(h.getIsSorted() === "asc"),
2221
2232
  children: [
2222
2233
  c,
2223
- f === "asc" ? /* @__PURE__ */ e.jsx(nt, { className: "ml-2 h-5 w-5" }) : f === "desc" ? /* @__PURE__ */ e.jsx(lt, { className: "ml-2 h-5 w-5" }) : null
2234
+ g === "asc" ? /* @__PURE__ */ e.jsx(nt, { className: "ml-2 h-5 w-5" }) : g === "desc" ? /* @__PURE__ */ e.jsx(lt, { className: "ml-2 h-5 w-5" }) : null
2224
2235
  ]
2225
2236
  }
2226
2237
  ) });
@@ -2238,16 +2249,16 @@ function qn({ data: s }) {
2238
2249
  }
2239
2250
  });
2240
2251
  return /* @__PURE__ */ e.jsxs(it, { children: [
2241
- /* @__PURE__ */ e.jsx(ot, { children: o.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(ls, { children: c.headers.map((d) => /* @__PURE__ */ e.jsx(ct, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : As(
2242
- d.column.columnDef.header,
2243
- d.getContext()
2244
- ) }, d.id)) }, c.id)) }),
2252
+ /* @__PURE__ */ e.jsx(ot, { children: o.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(ls, { children: c.headers.map((h) => /* @__PURE__ */ e.jsx(ct, { className: "sticky top-0 bg-muted", children: h.isPlaceholder ? null : Ls(
2253
+ h.column.columnDef.header,
2254
+ h.getContext()
2255
+ ) }, h.id)) }, c.id)) }),
2245
2256
  /* @__PURE__ */ e.jsx(dt, { children: (l = o.getRowModel().rows) != null && l.length ? o.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
2246
2257
  ls,
2247
2258
  {
2248
2259
  className: "whitespace-nowrap py-2",
2249
2260
  "data-state": c.getIsSelected() && "selected",
2250
- children: c.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Es, { children: As(d.column.columnDef.cell, d.getContext()) }, d.id))
2261
+ children: c.getVisibleCells().map((h) => /* @__PURE__ */ e.jsx(Es, { children: Ls(h.column.columnDef.cell, h.getContext()) }, h.id))
2251
2262
  },
2252
2263
  c.id
2253
2264
  )) : /* @__PURE__ */ e.jsx(ls, { children: /* @__PURE__ */ e.jsx(Es, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
@@ -2258,8 +2269,9 @@ function ga({
2258
2269
  className: s,
2259
2270
  ...n
2260
2271
  }) {
2272
+ var l;
2261
2273
  me.useState(0);
2262
- const a = k((l) => l.themeStyle), t = r((l) => l.card), i = r((l) => l.actions.setCard);
2274
+ const a = k((c) => c.themeStyle), t = r((c) => c.card), i = r((c) => c.actions.setCard);
2263
2275
  if (K(() => {
2264
2276
  }, [
2265
2277
  t.data,
@@ -2271,7 +2283,7 @@ function ga({
2271
2283
  ]), !t.id)
2272
2284
  return null;
2273
2285
  let o;
2274
- return t.data && t.data.length > 0 && (o = la({
2286
+ return t.data && t.data.length > 0 && (o = ta({
2275
2287
  data: t.data,
2276
2288
  cardType: t.type,
2277
2289
  cfg: t.cfg,
@@ -2286,19 +2298,19 @@ function ga({
2286
2298
  children: [
2287
2299
  /* @__PURE__ */ e.jsxs(pt, { className: "py-4", children: [
2288
2300
  /* @__PURE__ */ e.jsx(
2289
- Ls,
2301
+ Ds,
2290
2302
  {
2291
2303
  text: t.title,
2292
- onSave: (l) => i({ ...t, title: l }),
2304
+ onSave: (c) => i({ ...t, title: c }),
2293
2305
  children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(ft, { className: "text-base", children: t.title }) })
2294
2306
  },
2295
2307
  t.title
2296
2308
  ),
2297
2309
  /* @__PURE__ */ e.jsx(
2298
- Ls,
2310
+ Ds,
2299
2311
  {
2300
2312
  text: t.description || "",
2301
- onSave: (l) => i({ ...t, description: l }),
2313
+ onSave: (c) => i({ ...t, description: c }),
2302
2314
  children: /* @__PURE__ */ e.jsxs(gt, { children: [
2303
2315
  " ",
2304
2316
  t.description
@@ -2314,7 +2326,7 @@ function ga({
2314
2326
  {
2315
2327
  cfg: o
2316
2328
  },
2317
- JSON.stringify(o) + JSON.stringify(t.preferences)
2329
+ JSON.stringify(o) + JSON.stringify(t.preferences) + ((l = t == null ? void 0 : t.preferences) == null ? void 0 : l.customVisualCode)
2318
2330
  ),
2319
2331
  t.type === "table" && t.data && t.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2320
2332
  /* @__PURE__ */ e.jsx(yt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(vt, { card: t, data: t == null ? void 0 : t.data }) })
@@ -2323,90 +2335,89 @@ function ga({
2323
2335
  }
2324
2336
  );
2325
2337
  }
2326
- function Vn() {
2327
- const [s, n] = M(!1), [a, t] = M(""), [i, o] = M(""), [l, c] = M(""), d = r((j) => j.card), f = r(
2328
- (j) => j.card.customCfg
2329
- ), m = r(
2330
- (j) => j.actions.setCardCustomCfg
2331
- );
2332
- function u(j) {
2333
- var A, O;
2334
- const b = {
2335
- ...j,
2338
+ function Rn() {
2339
+ const [s, n] = T(!1), [a, t] = T(""), [i, o] = T(""), [l, c] = T(""), [h, g] = T(""), m = r((C) => C.card), u = r(
2340
+ (C) => C.card.customCfg
2341
+ ), { setCardCustomCfg: N, setCustomVisualCode: d } = Nt();
2342
+ function x(C) {
2343
+ var F, A;
2344
+ const O = {
2345
+ ...C,
2336
2346
  data: {
2337
- ...j == null ? void 0 : j.data,
2338
- datasets: (O = (A = j == null ? void 0 : j.data) == null ? void 0 : A.datasets) == null ? void 0 : O.map((y) => ({
2339
- ...y,
2347
+ ...C == null ? void 0 : C.data,
2348
+ datasets: (A = (F = C == null ? void 0 : C.data) == null ? void 0 : F.datasets) == null ? void 0 : A.map((q) => ({
2349
+ ...q,
2340
2350
  data: []
2341
2351
  }))
2342
2352
  }
2343
2353
  };
2344
- return JSON.stringify(b, null, 1);
2354
+ return JSON.stringify(O, null, 1);
2345
2355
  }
2346
- function C() {
2347
- if (!d.data || d.data.length === 0)
2356
+ function f() {
2357
+ var O, j;
2358
+ if (!m.data || m.data.length === 0)
2348
2359
  return;
2349
- const j = la({
2350
- data: d.data,
2351
- cardType: d.type,
2352
- cfg: d.cfg,
2353
- preferences: d.preferences
2360
+ const C = ta({
2361
+ data: m.data,
2362
+ cardType: m.type,
2363
+ cfg: m.cfg,
2364
+ preferences: m.preferences
2354
2365
  });
2355
- j && (t(JSON.stringify(j, null, 1)), f && o(JSON.stringify(f, null, 1)));
2366
+ C && (t(JSON.stringify(C, null, 1)), (O = m == null ? void 0 : m.preferences) != null && O.customVisualCode && c((j = m == null ? void 0 : m.preferences) == null ? void 0 : j.customVisualCode), u && o(JSON.stringify(u, null, 1)));
2356
2367
  }
2357
- function h() {
2358
- if (i)
2368
+ function w() {
2369
+ if (l && d(l), !!i)
2359
2370
  try {
2360
- const j = JSON.parse(i);
2361
- return j ? (m(j), c(""), o(""), j) : void 0;
2362
- } catch (j) {
2363
- console.log(j), c("Invalid JSON");
2371
+ const C = JSON.parse(i);
2372
+ return C ? (N(C), g(""), o(""), C) : void 0;
2373
+ } catch (C) {
2374
+ console.log(C), g("Invalid JSON");
2364
2375
  }
2365
2376
  }
2366
- function x() {
2367
- o(""), m(null);
2377
+ function b() {
2378
+ o(""), N(null);
2368
2379
  }
2369
- function g() {
2370
- let j;
2371
- if (f) {
2372
- const b = qs.cloneDeep(d.cfg), L = qs.merge(b, f);
2373
- return j = u(L), j;
2380
+ function E() {
2381
+ let C;
2382
+ if (u) {
2383
+ const O = Is.cloneDeep(m.cfg), j = Is.merge(O, u);
2384
+ return C = x(j), C;
2374
2385
  }
2375
- return a ? (j = u(JSON.parse(a)), j) : "";
2386
+ return a ? (C = x(JSON.parse(a)), C) : "";
2376
2387
  }
2377
- return /* @__PURE__ */ e.jsxs(ds, { open: s, onOpenChange: n, children: [
2378
- /* @__PURE__ */ e.jsx(hs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2379
- w,
2388
+ return /* @__PURE__ */ e.jsxs(us, { open: s, onOpenChange: n, children: [
2389
+ /* @__PURE__ */ e.jsx(xs, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2390
+ z,
2380
2391
  {
2381
- onClick: C,
2382
- className: ` ${f && "border-foreground/50 dark:border-foreground/70"}`,
2392
+ onClick: f,
2393
+ className: ` ${u && "border-foreground/50 dark:border-foreground/70"}`,
2383
2394
  size: "sm",
2384
2395
  variant: "outline",
2385
- children: /* @__PURE__ */ e.jsx(Nt, { className: "h-4 w-4" })
2396
+ children: /* @__PURE__ */ e.jsx(Ct, { className: "h-4 w-4" })
2386
2397
  }
2387
2398
  ) }),
2388
2399
  /* @__PURE__ */ e.jsxs(
2389
- ms,
2400
+ ps,
2390
2401
  {
2391
- className: "max-h-[70vh] min-h-[70vh] min-w-[900px] overflow-auto",
2402
+ className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
2392
2403
  children: [
2393
- /* @__PURE__ */ e.jsxs(us, { className: "", children: [
2404
+ /* @__PURE__ */ e.jsxs(fs, { className: "", children: [
2394
2405
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2395
- /* @__PURE__ */ e.jsx(xs, { children: "Customize Card" }),
2396
- /* @__PURE__ */ e.jsxs(fs, { children: [
2397
- /* @__PURE__ */ e.jsx(Gs, { children: /* @__PURE__ */ e.jsx(
2398
- Zt,
2406
+ /* @__PURE__ */ e.jsx(gs, { children: "Customize Card" }),
2407
+ /* @__PURE__ */ e.jsxs(bs, { children: [
2408
+ /* @__PURE__ */ e.jsx(Ps, { children: /* @__PURE__ */ e.jsx(
2409
+ en,
2399
2410
  {
2400
2411
  onClick: () => {
2401
- navigator.clipboard.writeText(d.id);
2412
+ navigator.clipboard.writeText(m.id);
2402
2413
  },
2403
2414
  className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
2404
2415
  }
2405
2416
  ) }),
2406
- /* @__PURE__ */ e.jsx(gs, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
2417
+ /* @__PURE__ */ e.jsx(ys, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
2407
2418
  ] })
2408
2419
  ] }),
2409
- /* @__PURE__ */ e.jsxs(ps, { children: [
2420
+ /* @__PURE__ */ e.jsxs(js, { children: [
2410
2421
  "See the configuration options and documentation",
2411
2422
  /* @__PURE__ */ e.jsx(
2412
2423
  "a",
@@ -2421,21 +2432,22 @@ function Vn() {
2421
2432
  ] }),
2422
2433
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
2423
2434
  /* @__PURE__ */ e.jsx(ga, { className: "w-1/2 rounded shadow-none" }),
2424
- /* @__PURE__ */ e.jsxs(Ct, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2425
- /* @__PURE__ */ e.jsxs(St, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2426
- /* @__PURE__ */ e.jsxs(Ds, { value: "custom-config", children: [
2427
- f && /* @__PURE__ */ e.jsx(kt, { className: "mr-1 h-5 w-5 text-green-600" }),
2428
- f ? "Custom Config" : "Default Config"
2435
+ /* @__PURE__ */ e.jsxs(St, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2436
+ /* @__PURE__ */ e.jsxs(kt, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2437
+ /* @__PURE__ */ e.jsxs(rs, { value: "custom-config", children: [
2438
+ u && /* @__PURE__ */ e.jsx(wt, { className: "mr-1 h-5 w-5 text-green-600" }),
2439
+ u ? "Custom Config" : "Default Config"
2429
2440
  ] }),
2430
- /* @__PURE__ */ e.jsx(Ds, { className: "", value: "output", children: "Output" })
2441
+ /* @__PURE__ */ e.jsx(rs, { className: "", value: "output", children: "Output" }),
2442
+ /* @__PURE__ */ e.jsx(rs, { className: "", value: "custom-code", children: "Custom Code" })
2431
2443
  ] }),
2432
2444
  /* @__PURE__ */ e.jsx(
2433
- Is,
2445
+ is,
2434
2446
  {
2435
2447
  className: "bg-red-x mt-0 grow rounded-b border border-t-0 p-2",
2436
2448
  value: "output",
2437
2449
  children: /* @__PURE__ */ e.jsx(
2438
- na,
2450
+ aa,
2439
2451
  {
2440
2452
  disabled: !0,
2441
2453
  value: a,
@@ -2445,12 +2457,12 @@ function Vn() {
2445
2457
  }
2446
2458
  ),
2447
2459
  /* @__PURE__ */ e.jsx(
2448
- Is,
2460
+ is,
2449
2461
  {
2450
2462
  className: "mt-0 grow rounded-b border border-t-0",
2451
2463
  value: "custom-config",
2452
2464
  children: /* @__PURE__ */ e.jsx(
2453
- Qe,
2465
+ Ve,
2454
2466
  {
2455
2467
  className: "h-full w-full overflow-hidden",
2456
2468
  theme: "default",
@@ -2467,27 +2479,56 @@ function Vn() {
2467
2479
  renderLineHighlight: "none"
2468
2480
  },
2469
2481
  defaultLanguage: "json",
2470
- value: g(),
2471
- onChange: (j) => o(j)
2482
+ value: E(),
2483
+ onChange: (C) => o(C)
2484
+ }
2485
+ )
2486
+ }
2487
+ ),
2488
+ /* @__PURE__ */ e.jsx(
2489
+ is,
2490
+ {
2491
+ className: "mt-0 grow rounded-b border border-t-0",
2492
+ value: "custom-code",
2493
+ children: /* @__PURE__ */ e.jsx(
2494
+ Ve,
2495
+ {
2496
+ className: "h-full w-full overflow-hidden",
2497
+ theme: "default",
2498
+ options: {
2499
+ minimap: {
2500
+ enabled: !1
2501
+ },
2502
+ wordWrap: "on",
2503
+ scrollbar: {
2504
+ verticalScrollbarSize: 0,
2505
+ horizontalScrollbarSize: 0
2506
+ },
2507
+ fontSize: 14,
2508
+ renderLineHighlight: "none"
2509
+ },
2510
+ defaultLanguage: "javascript",
2511
+ value: l,
2512
+ onChange: (C) => c(C || "")
2472
2513
  }
2473
2514
  )
2474
2515
  }
2475
2516
  )
2476
2517
  ] })
2477
2518
  ] }),
2478
- /* @__PURE__ */ e.jsxs(Js, { className: "flex items-center", children: [
2479
- /* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children: l }),
2519
+ /* @__PURE__ */ e.jsxs(Ks, { className: "flex items-center", children: [
2520
+ /* @__PURE__ */ e.jsx(R, { className: "mr-2 text-red-500", children: h }),
2480
2521
  /* @__PURE__ */ e.jsx(
2481
- w,
2522
+ z,
2482
2523
  {
2483
- disabled: !f,
2484
- onClick: x,
2524
+ disabled: !u,
2525
+ onClick: b,
2485
2526
  variant: "outline",
2486
2527
  children: "Reset"
2487
2528
  }
2488
2529
  ),
2489
- /* @__PURE__ */ e.jsx(w, { onClick: h, variant: "outline", children: "Apply" }),
2490
- /* @__PURE__ */ e.jsx(w, { onClick: () => n(!1), variant: "outline", children: "Close" })
2530
+ /* @__PURE__ */ e.jsx(z, { onClick: w, variant: "outline", children: "Apply" }),
2531
+ /* @__PURE__ */ e.jsx(z, { onClick: () => n(!1), variant: "outline", children: "Close" })
2491
2532
  ] })
2492
2533
  ]
2493
2534
  }
@@ -2515,8 +2556,8 @@ function Ca(s) {
2515
2556
  function Sa(s) {
2516
2557
  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);
2517
2558
  }
2518
- function Rn() {
2519
- const [s, n] = M(!1), a = r((c) => c.card.type), { setCardType: t, setCardPreferences: i } = r(
2559
+ function _n() {
2560
+ const [s, n] = T(!1), a = r((c) => c.card.type), { setCardType: t, setCardPreferences: i } = r(
2520
2561
  (c) => c.actions
2521
2562
  ), o = r(
2522
2563
  (c) => c.actions.setCardCustomCfg
@@ -2525,27 +2566,27 @@ function Rn() {
2525
2566
  t(c), o(null), i({}), n(!1);
2526
2567
  }
2527
2568
  return /* @__PURE__ */ e.jsxs(Ke, { open: s, onOpenChange: n, children: [
2528
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(_n, { className: "h-4 w-4", chartType: a }) }) }),
2529
- /* @__PURE__ */ e.jsx(Je, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2569
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Hn, { className: "h-4 w-4", chartType: a }) }) }),
2570
+ /* @__PURE__ */ e.jsx(Pe, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2530
2571
  /* @__PURE__ */ e.jsx(
2531
- w,
2572
+ z,
2532
2573
  {
2533
2574
  onClick: () => l("bar"),
2534
2575
  className: "font-normal",
2535
2576
  variant: "ghost",
2536
- children: /* @__PURE__ */ e.jsx(Ns, { className: "size-5" })
2577
+ children: /* @__PURE__ */ e.jsx(Ss, { className: "size-5" })
2537
2578
  }
2538
2579
  ),
2539
2580
  /* @__PURE__ */ e.jsx(
2540
- w,
2581
+ z,
2541
2582
  {
2542
2583
  onClick: () => l("line"),
2543
2584
  variant: "ghost",
2544
- children: /* @__PURE__ */ e.jsx(Cs, { className: "size-5" })
2585
+ children: /* @__PURE__ */ e.jsx(ks, { className: "size-5" })
2545
2586
  }
2546
2587
  ),
2547
2588
  /* @__PURE__ */ e.jsx(
2548
- w,
2589
+ z,
2549
2590
  {
2550
2591
  onClick: () => l("stackedBar"),
2551
2592
  variant: "ghost",
@@ -2553,7 +2594,7 @@ function Rn() {
2553
2594
  }
2554
2595
  ),
2555
2596
  /* @__PURE__ */ e.jsx(
2556
- w,
2597
+ z,
2557
2598
  {
2558
2599
  onClick: () => l("scatter"),
2559
2600
  variant: "ghost",
@@ -2561,7 +2602,7 @@ function Rn() {
2561
2602
  }
2562
2603
  ),
2563
2604
  /* @__PURE__ */ e.jsx(
2564
- w,
2605
+ z,
2565
2606
  {
2566
2607
  onClick: () => l("bubble"),
2567
2608
  variant: "ghost",
@@ -2569,7 +2610,7 @@ function Rn() {
2569
2610
  }
2570
2611
  ),
2571
2612
  /* @__PURE__ */ e.jsx(
2572
- w,
2613
+ z,
2573
2614
  {
2574
2615
  onClick: () => l("pie"),
2575
2616
  variant: "ghost",
@@ -2577,7 +2618,7 @@ function Rn() {
2577
2618
  }
2578
2619
  ),
2579
2620
  /* @__PURE__ */ e.jsx(
2580
- w,
2621
+ z,
2581
2622
  {
2582
2623
  onClick: () => l("doughnut"),
2583
2624
  variant: "ghost",
@@ -2585,7 +2626,7 @@ function Rn() {
2585
2626
  }
2586
2627
  ),
2587
2628
  /* @__PURE__ */ e.jsx(
2588
- w,
2629
+ z,
2589
2630
  {
2590
2631
  onClick: () => l("radar"),
2591
2632
  variant: "ghost",
@@ -2599,7 +2640,7 @@ function Rn() {
2599
2640
  }
2600
2641
  ),
2601
2642
  /* @__PURE__ */ e.jsx(
2602
- w,
2643
+ z,
2603
2644
  {
2604
2645
  onClick: () => l("polarArea"),
2605
2646
  variant: "ghost",
@@ -2607,7 +2648,7 @@ function Rn() {
2607
2648
  }
2608
2649
  ),
2609
2650
  /* @__PURE__ */ e.jsx(
2610
- w,
2651
+ z,
2611
2652
  {
2612
2653
  onClick: () => l("pyramid"),
2613
2654
  variant: "ghost",
@@ -2615,15 +2656,23 @@ function Rn() {
2615
2656
  }
2616
2657
  ),
2617
2658
  /* @__PURE__ */ e.jsx(
2618
- w,
2659
+ z,
2660
+ {
2661
+ onClick: () => l("range"),
2662
+ variant: "ghost",
2663
+ children: /* @__PURE__ */ e.jsx(oa, { className: "size-5" })
2664
+ }
2665
+ ),
2666
+ /* @__PURE__ */ e.jsx(
2667
+ z,
2619
2668
  {
2620
2669
  onClick: () => l("table"),
2621
2670
  variant: "ghost",
2622
- children: /* @__PURE__ */ e.jsx(js, { className: "size-5" })
2671
+ children: /* @__PURE__ */ e.jsx(vs, { className: "size-5" })
2623
2672
  }
2624
2673
  ),
2625
2674
  /* @__PURE__ */ e.jsx(
2626
- w,
2675
+ z,
2627
2676
  {
2628
2677
  onClick: () => l("kpi"),
2629
2678
  variant: "ghost",
@@ -2633,12 +2682,12 @@ function Rn() {
2633
2682
  ] }) })
2634
2683
  ] });
2635
2684
  }
2636
- function _n({ chartType: s, className: n }) {
2685
+ function Hn({ chartType: s, className: n }) {
2637
2686
  switch (s) {
2638
2687
  case "bar":
2639
- return /* @__PURE__ */ e.jsx(Ns, { className: n });
2688
+ return /* @__PURE__ */ e.jsx(Ss, { className: n });
2640
2689
  case "line":
2641
- return /* @__PURE__ */ e.jsx(Cs, { className: n });
2690
+ return /* @__PURE__ */ e.jsx(ks, { className: n });
2642
2691
  case "pie":
2643
2692
  return /* @__PURE__ */ e.jsx(da, { className: n });
2644
2693
  case "radar":
@@ -2655,22 +2704,24 @@ function _n({ chartType: s, className: n }) {
2655
2704
  return /* @__PURE__ */ e.jsx(ya, { className: n });
2656
2705
  case "pyramid":
2657
2706
  return /* @__PURE__ */ e.jsx(Sa, { className: n });
2707
+ case "range":
2708
+ return /* @__PURE__ */ e.jsx(oa, { className: n });
2658
2709
  case "kpi":
2659
2710
  return /* @__PURE__ */ e.jsx(Ca, { className: n });
2660
2711
  default:
2661
- return /* @__PURE__ */ e.jsx(js, { className: n });
2712
+ return /* @__PURE__ */ e.jsx(vs, { className: n });
2662
2713
  }
2663
2714
  }
2664
- function Hn() {
2715
+ function Bn() {
2665
2716
  const s = r(
2666
2717
  (a) => a.card.refreshInterval
2667
2718
  ), n = r(
2668
2719
  (a) => a.actions.setCardRefreshInterval
2669
2720
  );
2670
2721
  return /* @__PURE__ */ e.jsxs(Ke, { children: [
2671
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Ut, { className: "w-4 h-4" }) }) }),
2672
- /* @__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: [
2673
- /* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
2722
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Pt, { className: "w-4 h-4" }) }) }),
2723
+ /* @__PURE__ */ e.jsx(Pe, { className: "w-[200px]", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-4", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-5 items-center gap-1", children: [
2724
+ /* @__PURE__ */ e.jsx(R, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
2674
2725
  /* @__PURE__ */ e.jsx(
2675
2726
  ae,
2676
2727
  {
@@ -2684,27 +2735,27 @@ function Hn() {
2684
2735
  ] }) }) }) })
2685
2736
  ] });
2686
2737
  }
2687
- function Bs() {
2738
+ function Hs() {
2688
2739
  r((l) => l.frame);
2689
2740
  const s = r((l) => l.card), n = r((l) => l.card.data), a = r((l) => l.isShowingVisual), t = r((l) => l.isSqlRunning), i = r((l) => l.queryError), o = r((l) => l.pythonStdOut);
2690
2741
  return r((l) => l.onSave), r((l) => l.onClose), r((l) => l.actions.setCardSql), r((l) => l.actions.setCardType), r((l) => l.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
2691
2742
  t && /* @__PURE__ */ e.jsx(He, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
2692
2743
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
2693
2744
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2694
- /* @__PURE__ */ e.jsx(Rn, {}),
2695
- s.type !== "table" && /* @__PURE__ */ e.jsx(Vn, {}),
2696
- /* @__PURE__ */ e.jsx(Hn, {})
2745
+ /* @__PURE__ */ e.jsx(_n, {}),
2746
+ s.type !== "table" && /* @__PURE__ */ e.jsx(Rn, {}),
2747
+ /* @__PURE__ */ e.jsx(Bn, {})
2697
2748
  ] }),
2698
- /* @__PURE__ */ e.jsx($n, {})
2749
+ /* @__PURE__ */ e.jsx(Kn, {})
2699
2750
  ] }),
2700
- 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(wt, { isLoading: t, card: s }) }) }) : /* @__PURE__ */ e.jsx(ga, { 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: [
2701
- o && /* @__PURE__ */ e.jsx(Bn, {}),
2702
- s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(qn, { data: n || [] }),
2751
+ 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(zt, { isLoading: t, card: s }) }) }) : /* @__PURE__ */ e.jsx(ga, { className: "grow border-none shadow-none" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
2752
+ o && /* @__PURE__ */ e.jsx($n, {}),
2753
+ s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(Vn, { data: n || [] }),
2703
2754
  i && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: i })
2704
2755
  ] })
2705
2756
  ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
2706
2757
  }
2707
- function Bn() {
2758
+ function $n() {
2708
2759
  const s = r((a) => a.pythonStdOut);
2709
2760
  if (!s)
2710
2761
  return null;
@@ -2718,17 +2769,17 @@ function Bn() {
2718
2769
  className: "bg-muted p-2 font-mono text-sm"
2719
2770
  }
2720
2771
  ),
2721
- /* @__PURE__ */ e.jsx(ys, { className: "mb-2" })
2772
+ /* @__PURE__ */ e.jsx(Cs, { className: "mb-2" })
2722
2773
  ] });
2723
2774
  }
2724
- function $n() {
2775
+ function Kn() {
2725
2776
  const s = r((a) => a.isShowingVisual), n = r(
2726
2777
  (a) => a.actions.setIsShowingVisual
2727
2778
  );
2728
2779
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2729
- /* @__PURE__ */ e.jsx(B, { htmlFor: "visualize", children: "Chart" }),
2780
+ /* @__PURE__ */ e.jsx(R, { htmlFor: "visualize", children: "Chart" }),
2730
2781
  /* @__PURE__ */ e.jsx(
2731
- zt,
2782
+ Ft,
2732
2783
  {
2733
2784
  checked: s,
2734
2785
  onCheckedChange: () => n(!s),
@@ -2738,212 +2789,48 @@ function $n() {
2738
2789
  )
2739
2790
  ] });
2740
2791
  }
2741
- function De() {
2742
- const [s, n] = M([]);
2743
- r(
2744
- (m) => m.card.cfg
2745
- );
2746
- const a = r((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: i, setCardPreferences: o } = r((m) => m.actions), l = r(
2747
- (m) => m.queryResultColumns
2748
- );
2749
- r(
2750
- (m) => {
2751
- var u;
2752
- return (u = m.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
2753
- }
2754
- ), K(() => {
2755
- l && n(new Array(l.length).fill(!1));
2756
- }, [l]);
2757
- function c(m, u) {
2758
- var C, h;
2759
- u ? a != null && a.onClickFilter && ((C = a == null ? void 0 : a.onClickFilter) == null ? void 0 : C.length) > 0 ? o({
2760
- ...a,
2761
- onClickFilter: [
2762
- ...a.onClickFilter,
2763
- {
2764
- columnIndex: m,
2765
- expression: ""
2766
- }
2767
- ]
2768
- }) : o({
2769
- ...a,
2770
- onClickFilter: [
2771
- {
2772
- columnIndex: m,
2773
- expression: ""
2774
- }
2775
- ]
2776
- }) : (o({
2777
- ...a,
2778
- onClickFilter: (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.filter(
2779
- (x) => x.columnIndex !== m
2780
- )
2781
- }), n((x) => {
2782
- const g = [...x];
2783
- return g[m] = !1, g;
2784
- }));
2785
- }
2786
- function d(m, u) {
2787
- var h;
2788
- const C = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.map((x) => x.columnIndex === m ? {
2789
- ...x,
2790
- expression: u.target.value
2791
- } : x);
2792
- o({
2793
- ...a,
2794
- onClickFilter: C
2795
- });
2796
- }
2797
- function f(m) {
2798
- var u, C, h, x;
2799
- if (s != null && s[m] || (C = (u = a == null ? void 0 : a.onClickFilter) == null ? void 0 : u.find((g) => g.columnIndex === m)) != null && C.expression)
2800
- return /* @__PURE__ */ e.jsx(
2801
- ae,
2802
- {
2803
- value: (x = (h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find((g) => g.columnIndex === m)) == null ? void 0 : x.expression,
2804
- onChange: (g) => d(m, g),
2805
- type: "text",
2806
- className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
2807
- placeholder: "Expression"
2808
- }
2809
- );
2810
- }
2811
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: l == null ? void 0 : l.map((m, u) => {
2812
- var C, h;
2813
- return /* @__PURE__ */ e.jsx(
2814
- "div",
2815
- {
2816
- className: "flex items-center justify-between space-y-2 xbg-red-100 group",
2817
- children: /* @__PURE__ */ e.jsxs("div", { className: " grow", children: [
2818
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center py-2 space-x-2", children: [
2819
- /* @__PURE__ */ e.jsx(
2820
- $e,
2821
- {
2822
- checked: !!((C = a == null ? void 0 : a.onClickFilter) != null && C.find(
2823
- (x) => x.columnIndex === u
2824
- )),
2825
- onCheckedChange: (x) => c(u, x)
2826
- }
2827
- ),
2828
- /* @__PURE__ */ e.jsx(
2829
- "label",
2830
- {
2831
- className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
2832
- children: m
2833
- }
2834
- ),
2835
- /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((h = a == null ? void 0 : a.onClickFilter) == null ? void 0 : h.find(
2836
- (x) => x.columnIndex === u
2837
- )) && /* @__PURE__ */ e.jsx(
2838
- ca,
2839
- {
2840
- onClick: () => {
2841
- n((x) => {
2842
- const g = [...x];
2843
- return g[u] = !x[u], g;
2844
- });
2845
- },
2846
- className: " invisible group-hover:visible size-3 text-gray-400 cursor-pointer"
2847
- }
2848
- ) })
2849
- ] }),
2850
- f(u)
2851
- ] })
2852
- },
2853
- m
2854
- );
2855
- }) });
2856
- }
2857
- function Ss() {
2858
- var o, l;
2859
- const s = r((c) => c.card.preferences), n = r(
2860
- (c) => c.card.cfg
2861
- ), { setCardCfg: a, setCardPreferences: t } = r(
2862
- (c) => c.actions
2863
- );
2864
- (o = n == null ? void 0 : n.options) != null && o.indexAxis;
2865
- function i(c) {
2866
- var m, u, C, h, x, g;
2867
- let d = {};
2868
- (m = s == null ? void 0 : s.chartOptions) != null && m.scales && (d = {
2869
- x: (C = (u = s == null ? void 0 : s.chartOptions) == null ? void 0 : u.scales) == null ? void 0 : C.y,
2870
- y: (x = (h = s == null ? void 0 : s.chartOptions) == null ? void 0 : h.scales) == null ? void 0 : x.x
2871
- });
2872
- const f = {
2873
- ...s,
2874
- chartOptions: {
2875
- ...s == null ? void 0 : s.chartOptions,
2876
- scales: {
2877
- ...(g = s == null ? void 0 : s.chartOptions) == null ? void 0 : g.scales,
2878
- ...d
2879
- },
2880
- indexAxis: c
2881
- }
2882
- };
2883
- t(f);
2884
- }
2885
- return /* @__PURE__ */ e.jsxs(
2886
- ra,
2887
- {
2888
- value: ((l = s == null ? void 0 : s.chartOptions) == null ? void 0 : l.indexAxis) || "x",
2889
- onValueChange: i,
2890
- className: "flex gap-3",
2891
- defaultValue: "x",
2892
- children: [
2893
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2894
- /* @__PURE__ */ e.jsx(Ye, { value: "x", id: "r1" }),
2895
- /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
2896
- ] }),
2897
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2898
- /* @__PURE__ */ e.jsx(Ye, { value: "y", id: "r2" }),
2899
- /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
2900
- ] })
2901
- ]
2902
- }
2903
- );
2904
- }
2905
- const we = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
2906
- function $s(s, n) {
2792
+ const ke = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
2793
+ function Bs(s, n) {
2907
2794
  var t, i, o;
2908
- const a = ia(s, n);
2795
+ const a = na(s, n);
2909
2796
  return ((o = (i = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : i[a]) == null ? void 0 : o.type) || "linear";
2910
2797
  }
2911
2798
  function ka() {
2912
- var G, ee, Z, J, I, v;
2913
- const [s, n] = M(!1), a = r((N) => {
2914
- var F;
2915
- return (F = N.card) == null ? void 0 : F.preferences;
2916
- }), t = r((N) => {
2917
- var F;
2918
- return (F = N.card) == null ? void 0 : F.cfg;
2919
- }), i = ia(a, t), [o, l] = M(
2920
- $s(a)
2921
- ), [c, d] = M(
2922
- ((Z = (ee = (G = a == null ? void 0 : a.chartOptions) == null ? void 0 : G.scales) == null ? void 0 : ee[i]) == null ? void 0 : Z.min) || ""
2923
- ), [f, m] = M(
2924
- ((v = (I = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[i]) == null ? void 0 : v.max) || ""
2925
- ), [u, C] = M(c || f ? "custom" : "auto"), [h, x] = M(""), [g, j] = M(0), [b, L] = M(""), [A, O] = M(""), [y, z] = M(""), E = r(
2926
- (N) => N.actions.setCardPreferences
2927
- ), _ = r((N) => {
2928
- var F;
2929
- return (F = N.card) == null ? void 0 : F.type;
2930
- }), Y = ["pie", "doughnut", "polarArea"].includes(_);
2799
+ var J, ee, Z, P, I, y;
2800
+ const [s, n] = T(!1), a = r((v) => {
2801
+ var M;
2802
+ return (M = v.card) == null ? void 0 : M.preferences;
2803
+ }), t = r((v) => {
2804
+ var M;
2805
+ return (M = v.card) == null ? void 0 : M.cfg;
2806
+ }), i = na(a, t), [o, l] = T(
2807
+ Bs(a)
2808
+ ), [c, h] = T(
2809
+ ((Z = (ee = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : ee[i]) == null ? void 0 : Z.min) || ""
2810
+ ), [g, m] = T(
2811
+ ((y = (I = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : I[i]) == null ? void 0 : y.max) || ""
2812
+ ), [u, N] = T(c || g ? "custom" : "auto"), [d, x] = T(""), [f, w] = T(0), [b, E] = T(""), [C, O] = T(""), [j, F] = T(""), A = r(
2813
+ (v) => v.actions.setCardPreferences
2814
+ ), q = r((v) => {
2815
+ var M;
2816
+ return (M = v.card) == null ? void 0 : M.type;
2817
+ }), Y = ["pie", "doughnut", "polarArea"].includes(q);
2931
2818
  K(() => {
2932
- var N, F, H, ue, se, ge, je, be, xe, P, ne, le, ye, re;
2933
- l($s(a)), d(
2934
- ((H = (F = (N = a == null ? void 0 : a.chartOptions) == null ? void 0 : N.scales) == null ? void 0 : F[i]) == null ? void 0 : H.min) === 0 ? 0 : ""
2819
+ var v, M, V, ue, se, ge, je, be, xe, G, ne, le, ye, re;
2820
+ l(Bs(a)), h(
2821
+ ((V = (M = (v = a == null ? void 0 : a.chartOptions) == null ? void 0 : v.scales) == null ? void 0 : M[i]) == null ? void 0 : V.min) === 0 ? 0 : ""
2935
2822
  ), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[i]) == null ? void 0 : ge.max) || ""), x(
2936
- ((P = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[i]) == null ? void 0 : xe.ticks) == null ? void 0 : P.stepSize) || ""
2937
- ), j(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), L(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.suffix) || ""), O(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.currency) || ""), z(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.locale) || "");
2823
+ ((G = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[i]) == null ? void 0 : xe.ticks) == null ? void 0 : G.stepSize) || ""
2824
+ ), w(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), E(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.suffix) || ""), O(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.currency) || ""), F(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.locale) || "");
2938
2825
  }, [s, a, i]);
2939
- function $(N, F) {
2940
- return F === "" || /^[0-9\b]+$/.test(F) ? Number(F) : Number(N);
2826
+ function $(v, M) {
2827
+ return M === "" || /^[0-9\b]+$/.test(M) ? Number(M) : Number(v);
2941
2828
  }
2942
2829
  function U() {
2943
2830
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2944
2831
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
2945
2832
  /* @__PURE__ */ e.jsx(
2946
- B,
2833
+ R,
2947
2834
  {
2948
2835
  className: "col-span-2 hover:cursor-pointer hover:underline",
2949
2836
  htmlFor: "currency",
@@ -2960,33 +2847,33 @@ function ka() {
2960
2847
  /* @__PURE__ */ e.jsx(
2961
2848
  ae,
2962
2849
  {
2963
- value: A,
2850
+ value: C,
2964
2851
  placeholder: "USD",
2965
- onChange: (N) => O(N.target.value),
2852
+ onChange: (v) => O(v.target.value),
2966
2853
  id: "currency",
2967
- className: `col-span-2 h-8 w-full ${we}`
2854
+ className: `col-span-2 h-8 w-full ${ke}`
2968
2855
  }
2969
2856
  ),
2970
2857
  /* @__PURE__ */ e.jsx(
2971
2858
  ae,
2972
2859
  {
2973
- value: y,
2860
+ value: j,
2974
2861
  placeholder: "en-US",
2975
- onChange: (N) => z(N.target.value),
2862
+ onChange: (v) => F(v.target.value),
2976
2863
  id: "locale",
2977
- className: `col-span-2 h-8 w-full ${we}`
2864
+ className: `col-span-2 h-8 w-full ${ke}`
2978
2865
  }
2979
2866
  )
2980
2867
  ] }),
2981
2868
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-9 items-center gap-2", children: [
2982
- /* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
2869
+ /* @__PURE__ */ e.jsx(R, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
2983
2870
  /* @__PURE__ */ e.jsx(
2984
2871
  ae,
2985
2872
  {
2986
- value: g,
2987
- onChange: (N) => j(Number(N.target.value)),
2873
+ value: f,
2874
+ onChange: (v) => w(Number(v.target.value)),
2988
2875
  id: "format",
2989
- className: `col-span-6 h-8 w-full tracking-wide ${we}`
2876
+ className: `col-span-6 h-8 w-full tracking-wide ${ke}`
2990
2877
  }
2991
2878
  )
2992
2879
  ] })
@@ -2995,91 +2882,91 @@ function ka() {
2995
2882
  function D() {
2996
2883
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2997
2884
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
2998
- /* @__PURE__ */ e.jsx(B, { htmlFor: "range", children: "Range" }),
2885
+ /* @__PURE__ */ e.jsx(R, { htmlFor: "range", children: "Range" }),
2999
2886
  /* @__PURE__ */ e.jsx(
3000
2887
  ae,
3001
2888
  {
3002
2889
  id: "min",
3003
2890
  value: c,
3004
- onChange: (N) => d((F) => $(F, N.target.value)),
3005
- className: `col-span-1 h-8 w-full ${we}`
2891
+ onChange: (v) => h((M) => $(M, v.target.value)),
2892
+ className: `col-span-1 h-8 w-full ${ke}`
3006
2893
  }
3007
2894
  ),
3008
2895
  /* @__PURE__ */ e.jsx(
3009
2896
  ae,
3010
2897
  {
3011
- value: f,
3012
- onChange: (N) => m((F) => $(F, N.target.value)),
2898
+ value: g,
2899
+ onChange: (v) => m((M) => $(M, v.target.value)),
3013
2900
  id: "max",
3014
- className: `col-span-1 h-8 w-full ${we}`
2901
+ className: `col-span-1 h-8 w-full ${ke}`
3015
2902
  }
3016
2903
  )
3017
2904
  ] }),
3018
2905
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3019
- /* @__PURE__ */ e.jsx(B, { htmlFor: "step-size", children: "Step Size" }),
2906
+ /* @__PURE__ */ e.jsx(R, { htmlFor: "step-size", children: "Step Size" }),
3020
2907
  /* @__PURE__ */ e.jsx(
3021
2908
  ae,
3022
2909
  {
3023
- value: h,
3024
- onChange: (N) => x((F) => $(F, N.target.value)),
2910
+ value: d,
2911
+ onChange: (v) => x((M) => $(M, v.target.value)),
3025
2912
  id: "step-size",
3026
- className: `col-span-1 h-8 w-full ${we}`
2913
+ className: `col-span-1 h-8 w-full ${ke}`
3027
2914
  }
3028
2915
  )
3029
2916
  ] })
3030
2917
  ] });
3031
2918
  }
3032
2919
  function te() {
3033
- var H;
3034
- let N = {};
3035
- u === "custom" && (N = {
2920
+ var V;
2921
+ let v = {};
2922
+ u === "custom" && (v = {
3036
2923
  min: c,
3037
- max: f,
2924
+ max: g,
3038
2925
  ticks: {
3039
- stepSize: h
2926
+ stepSize: d
3040
2927
  }
3041
2928
  });
3042
- const F = {
2929
+ const M = {
3043
2930
  ...a || {},
3044
2931
  chartOptions: {
3045
2932
  ...a == null ? void 0 : a.chartOptions,
3046
2933
  scales: {
3047
- ...(H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales,
2934
+ ...(V = a == null ? void 0 : a.chartOptions) == null ? void 0 : V.scales,
3048
2935
  [i]: {
3049
2936
  // ...cardPreferences?.chartOptions?.scales?.[axis],
3050
2937
  type: o,
3051
- ...o === "linear" ? N : {}
2938
+ ...o === "linear" ? v : {}
3052
2939
  }
3053
2940
  }
3054
2941
  },
3055
2942
  numberAxisFormat: {
3056
- decimalPlaces: g,
2943
+ decimalPlaces: f,
3057
2944
  suffix: b,
3058
- currency: A,
3059
- locale: y
2945
+ currency: C,
2946
+ locale: j
3060
2947
  }
3061
2948
  };
3062
- E(F);
2949
+ A(M);
3063
2950
  }
3064
- return /* @__PURE__ */ e.jsxs(Ke, { onOpenChange: (N) => n(N), children: [
3065
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ft, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3066
- /* @__PURE__ */ e.jsx(Je, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
2951
+ return /* @__PURE__ */ e.jsxs(Ke, { onOpenChange: (v) => n(v), children: [
2952
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ot, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
2953
+ /* @__PURE__ */ e.jsx(Pe, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3067
2954
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3068
2955
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
3069
2956
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
3070
2957
  ] }),
3071
2958
  /* @__PURE__ */ e.jsxs("div", { className: "grid gap-2", children: [
3072
2959
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3073
- /* @__PURE__ */ e.jsx(B, { htmlFor: "scale", children: "Type" }),
2960
+ /* @__PURE__ */ e.jsx(R, { htmlFor: "scale", children: "Type" }),
3074
2961
  /* @__PURE__ */ e.jsxs(
3075
- Oe,
2962
+ Fe,
3076
2963
  {
3077
2964
  disabled: Y,
3078
2965
  value: o,
3079
- onValueChange: (N) => l(N),
2966
+ onValueChange: (v) => l(v),
3080
2967
  children: [
3081
- /* @__PURE__ */ e.jsx(Me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3082
- /* @__PURE__ */ e.jsx(Ae, { id: "type", children: /* @__PURE__ */ e.jsxs(_e, { children: [
2968
+ /* @__PURE__ */ e.jsx(Oe, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Me, {}) }),
2969
+ /* @__PURE__ */ e.jsx(Te, { id: "type", children: /* @__PURE__ */ e.jsxs(_e, { children: [
3083
2970
  /* @__PURE__ */ e.jsx(Le, { children: "Option" }),
3084
2971
  /* @__PURE__ */ e.jsx(X, { value: "linear", children: "Linear" }),
3085
2972
  /* @__PURE__ */ e.jsx(X, { value: "logarithmic", children: "Logarithmic" })
@@ -3089,14 +2976,14 @@ function ka() {
3089
2976
  )
3090
2977
  ] }),
3091
2978
  o == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3092
- /* @__PURE__ */ e.jsx(B, { htmlFor: "scale-option", children: "Setup" }),
2979
+ /* @__PURE__ */ e.jsx(R, { htmlFor: "scale-option", children: "Setup" }),
3093
2980
  /* @__PURE__ */ e.jsxs(
3094
- ra,
2981
+ la,
3095
2982
  {
3096
2983
  disabled: Y,
3097
2984
  id: "scale-option",
3098
2985
  value: u,
3099
- onValueChange: (N) => C(N),
2986
+ onValueChange: (v) => N(v),
3100
2987
  className: "col-span-2 flex gap-3",
3101
2988
  defaultValue: "x",
3102
2989
  children: [
@@ -3114,9 +3001,9 @@ function ka() {
3114
3001
  ] }),
3115
3002
  u === "custom" && o == "linear" && D(),
3116
3003
  U(),
3117
- /* @__PURE__ */ e.jsx(Ot, {}),
3004
+ /* @__PURE__ */ e.jsx(Mt, {}),
3118
3005
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
3119
- w,
3006
+ z,
3120
3007
  {
3121
3008
  onClick: te,
3122
3009
  variant: "secondary",
@@ -3128,304 +3015,46 @@ function ka() {
3128
3015
  ] }) })
3129
3016
  ] });
3130
3017
  }
3131
- function Kn({ idx: s }) {
3132
- var c;
3133
- const n = r((d) => {
3134
- var f;
3135
- return (f = d.card) == null ? void 0 : f.preferences;
3136
- }), a = r(
3137
- (d) => {
3138
- var f;
3139
- return (f = d.card.preferences) == null ? void 0 : f.datasetOptions;
3140
- }
3141
- ), t = r(
3142
- (d) => d.actions.setCardPreferences
3143
- ), i = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.indexAxis, o = a == null ? void 0 : a.find((d) => d.idx === s);
3144
- function l(d, f) {
3145
- (d === "end" || d === "start") && Tt(At());
3146
- const m = {
3147
- display: d !== "none",
3148
- align: d,
3149
- anchor: d,
3150
- clamp: !0
3018
+ function ws() {
3019
+ var i, o, l;
3020
+ const s = r(
3021
+ (c) => c.card.cfg
3022
+ ), n = r((c) => c.actions.setCardCfg), a = r((c) => c.card.type);
3023
+ function t(c) {
3024
+ var m;
3025
+ const h = {
3026
+ datalabels: {
3027
+ display: c !== "none",
3028
+ align: c,
3029
+ anchor: c,
3030
+ clamp: !0
3031
+ }
3032
+ }, g = {
3033
+ ...s,
3034
+ options: {
3035
+ ...s == null ? void 0 : s.options,
3036
+ plugins: {
3037
+ ...(m = s == null ? void 0 : s.options) == null ? void 0 : m.plugins,
3038
+ ...h
3039
+ }
3040
+ }
3151
3041
  };
3152
- if (!o)
3153
- t({
3154
- ...n,
3155
- datasetOptions: [
3156
- ...a || [],
3157
- {
3158
- idx: f,
3159
- datalabels: m
3160
- }
3161
- ]
3162
- });
3163
- else {
3164
- const u = { ...o };
3165
- u.datalabels = m;
3166
- const C = a == null ? void 0 : a.map(
3167
- (h) => h.idx === f ? u : h
3168
- );
3169
- t({
3170
- ...n,
3171
- datasetOptions: C
3172
- });
3173
- }
3174
- }
3175
- return /* @__PURE__ */ e.jsxs(Ke, { children: [
3176
- /* @__PURE__ */ e.jsx(Ue, { children: /* @__PURE__ */ e.jsx(mn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3177
- /* @__PURE__ */ e.jsx(Je, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3178
- /* @__PURE__ */ e.jsx(
3179
- w,
3180
- {
3181
- onClick: () => l("none", s),
3182
- size: "sm",
3183
- variant: "secondary",
3184
- className: "h-7 p-1 text-xs font-normal",
3185
- children: /* @__PURE__ */ e.jsx(Mt, { className: "size-4" })
3186
- }
3187
- ),
3188
- /* @__PURE__ */ e.jsx(
3189
- w,
3190
- {
3191
- onClick: () => l("start", s),
3192
- size: "sm",
3193
- variant: "secondary",
3194
- className: "h-7 p-1 text-xs font-normal",
3195
- children: /* @__PURE__ */ e.jsx(
3196
- en,
3197
- {
3198
- className: W("h-4 w-4", {
3199
- "rotate-90": i === "y"
3200
- })
3201
- }
3202
- )
3203
- }
3204
- ),
3205
- /* @__PURE__ */ e.jsx(
3206
- w,
3207
- {
3208
- onClick: () => l("center", s),
3209
- size: "sm",
3210
- variant: "secondary",
3211
- className: "h-7 p-1 text-xs font-normal",
3212
- children: /* @__PURE__ */ e.jsx(
3213
- an,
3214
- {
3215
- className: W("h-4 w-4", {
3216
- "rotate-90": i === "y"
3217
- })
3218
- }
3219
- )
3220
- }
3221
- ),
3222
- /* @__PURE__ */ e.jsx(
3223
- w,
3224
- {
3225
- onClick: () => l("end", s),
3226
- size: "sm",
3227
- variant: "secondary",
3228
- className: "h-7 p-1 text-xs font-normal",
3229
- children: /* @__PURE__ */ e.jsx(
3230
- sn,
3231
- {
3232
- className: W("h-4 w-4", {
3233
- "rotate-90": i === "y"
3234
- })
3235
- }
3236
- )
3237
- }
3238
- )
3239
- ] }) })
3240
- ] });
3241
- }
3242
- function wa() {
3243
- const s = r((d) => d.card), n = r(
3244
- (d) => {
3245
- var f, m, u;
3246
- 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;
3247
- }
3248
- ), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
3249
- keys: i,
3250
- metricKeys: o,
3251
- dimensionKeys: l
3252
- } = is(s.data || []);
3253
- let c = o;
3254
- if (s.type === "stackedBar") {
3255
- const d = Et({
3256
- dataArray: s.data || [],
3257
- groupKey: l[0],
3258
- pivotKey: l[1],
3259
- valueKey: c[0]
3260
- }), { metricKeys: f } = is(d);
3261
- c = f;
3262
- }
3263
- return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3264
- /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3265
- /* @__PURE__ */ e.jsx(B, { children: a }),
3266
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: l[0] }) }) })
3267
- ] }),
3268
- /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3269
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
3270
- /* @__PURE__ */ e.jsx(B, { children: t }),
3271
- /* @__PURE__ */ e.jsx(ka, {})
3272
- ] }),
3273
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((d, f) => /* @__PURE__ */ e.jsx(Un, { col: d, idx: f }, d)) })
3274
- ] })
3275
- ] });
3276
- }
3277
- function Un({ col: s, idx: n }) {
3278
- const a = r((c) => {
3279
- var d;
3280
- return (d = c.card) == null ? void 0 : d.preferences;
3281
- }), t = r(
3282
- (c) => {
3283
- var d;
3284
- return (d = c.card.preferences) == null ? void 0 : d.datasetOptions;
3285
- }
3286
- ), i = t == null ? void 0 : t.find((c) => c.idx === n), { setCardPreferences: o } = r((c) => c.actions);
3287
- function l(c) {
3288
- if (!i)
3289
- o({
3290
- ...a,
3291
- datasetOptions: [
3292
- ...t || [],
3293
- {
3294
- idx: n,
3295
- type: c === "area" ? "line" : c,
3296
- fill: c === "area" ? "origin" : ""
3297
- }
3298
- ]
3299
- });
3300
- else {
3301
- const d = { ...i };
3302
- d.type = c === "area" ? "line" : c, d.fill = c === "area" ? "origin" : "";
3303
- const f = t == null ? void 0 : t.map(
3304
- (m) => m.idx === n ? d : m
3305
- );
3306
- o({
3307
- ...a,
3308
- datasetOptions: f
3309
- });
3310
- }
3311
- }
3312
- return /* @__PURE__ */ e.jsxs("div", { className: "group flex items-center justify-between gap-5 rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: [
3313
- /* @__PURE__ */ e.jsx("p", { children: s }),
3314
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3315
- /* @__PURE__ */ e.jsx(
3316
- Ns,
3317
- {
3318
- onClick: () => l("bar"),
3319
- className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3320
- }
3321
- ),
3322
- /* @__PURE__ */ e.jsx(
3323
- Cs,
3324
- {
3325
- onClick: () => l("line"),
3326
- className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3327
- }
3328
- ),
3329
- /* @__PURE__ */ e.jsx(
3330
- Jt,
3331
- {
3332
- onClick: () => l("area"),
3333
- className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3334
- }
3335
- ),
3336
- /* @__PURE__ */ e.jsx(
3337
- ys,
3338
- {
3339
- orientation: "vertical",
3340
- className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
3341
- }
3342
- ),
3343
- /* @__PURE__ */ e.jsx(Kn, { idx: n })
3344
- ] })
3345
- ] });
3346
- }
3347
- function Jn({
3348
- cardType: s
3349
- }) {
3350
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3351
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3352
- /* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
3353
- /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 font-mono text-xs", children: [
3354
- /* @__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" }),
3355
- /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3356
- /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
3357
- /* @__PURE__ */ e.jsx("li", { children: "y-axis1 - number" }),
3358
- /* @__PURE__ */ e.jsx("li", { children: "y-axis2 - number" })
3359
- ] }),
3360
- /* @__PURE__ */ e.jsxs("div", { children: [
3361
- "See ",
3362
- /* @__PURE__ */ e.jsx(
3363
- "a",
3364
- {
3365
- target: "_blank",
3366
- onClick: (n) => n.stopPropagation(),
3367
- className: "text-blue-700",
3368
- href: "https://docs.semaphor.cloud/concepts/visuals#line-chart",
3369
- children: "example"
3370
- }
3371
- ),
3372
- " in the docs."
3373
- ] })
3374
- ] })
3375
- ] }),
3376
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3377
- /* @__PURE__ */ e.jsx(V, { children: "Settings" }),
3378
- /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 px-2", children: [
3379
- /* @__PURE__ */ e.jsx(Ss, {}),
3380
- /* @__PURE__ */ e.jsx(wa, {})
3381
- ] })
3382
- ] }),
3383
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3384
- /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3385
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3386
- ] })
3387
- ] }) });
3388
- }
3389
- function ks() {
3390
- var i, o, l;
3391
- const s = r(
3392
- (c) => c.card.cfg
3393
- ), n = r((c) => c.actions.setCardCfg), a = r((c) => c.card.type);
3394
- function t(c) {
3395
- var m;
3396
- const d = {
3397
- datalabels: {
3398
- display: c !== "none",
3399
- align: c,
3400
- anchor: c,
3401
- clamp: !0
3402
- }
3403
- }, f = {
3404
- ...s,
3405
- options: {
3406
- ...s == null ? void 0 : s.options,
3407
- plugins: {
3408
- ...(m = s == null ? void 0 : s.options) == null ? void 0 : m.plugins,
3409
- ...d
3410
- }
3411
- }
3412
- };
3413
- n(f), console.log(c);
3042
+ n(g), console.log(c);
3414
3043
  }
3415
3044
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3416
3045
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
3417
3046
  /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
3418
- a !== "pyramid" && /* @__PURE__ */ e.jsx(ka, {})
3047
+ !["pyramid", "range"].includes(a) && /* @__PURE__ */ e.jsx(ka, {})
3419
3048
  ] }),
3420
3049
  /* @__PURE__ */ e.jsxs(
3421
- Oe,
3050
+ Fe,
3422
3051
  {
3423
3052
  value: (l = (o = (i = s == null ? void 0 : s.options) == null ? void 0 : i.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : l.anchor,
3424
3053
  onValueChange: t,
3425
3054
  defaultValue: "none",
3426
3055
  children: [
3427
- /* @__PURE__ */ e.jsx(Me, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, { placeholder: "Select position" }) }),
3428
- /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
3056
+ /* @__PURE__ */ e.jsx(Oe, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Me, { placeholder: "Select position" }) }),
3057
+ /* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
3429
3058
  /* @__PURE__ */ e.jsx(Le, { children: "Data Labels" }),
3430
3059
  /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
3431
3060
  a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "start", children: "Start" }),
@@ -3437,7 +3066,123 @@ function ks() {
3437
3066
  )
3438
3067
  ] });
3439
3068
  }
3440
- function Pn({
3069
+ function Ge() {
3070
+ const [s, n] = T([]);
3071
+ r(
3072
+ (m) => m.card.cfg
3073
+ );
3074
+ const a = r((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: i, setCardPreferences: o } = r((m) => m.actions), l = r(
3075
+ (m) => m.queryResultColumns
3076
+ );
3077
+ r(
3078
+ (m) => {
3079
+ var u;
3080
+ return (u = m.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
3081
+ }
3082
+ ), K(() => {
3083
+ l && n(new Array(l.length).fill(!1));
3084
+ }, [l]);
3085
+ function c(m, u) {
3086
+ var N, d;
3087
+ u ? a != null && a.onClickFilter && ((N = a == null ? void 0 : a.onClickFilter) == null ? void 0 : N.length) > 0 ? o({
3088
+ ...a,
3089
+ onClickFilter: [
3090
+ ...a.onClickFilter,
3091
+ {
3092
+ columnIndex: m,
3093
+ expression: ""
3094
+ }
3095
+ ]
3096
+ }) : o({
3097
+ ...a,
3098
+ onClickFilter: [
3099
+ {
3100
+ columnIndex: m,
3101
+ expression: ""
3102
+ }
3103
+ ]
3104
+ }) : (o({
3105
+ ...a,
3106
+ onClickFilter: (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.filter(
3107
+ (x) => x.columnIndex !== m
3108
+ )
3109
+ }), n((x) => {
3110
+ const f = [...x];
3111
+ return f[m] = !1, f;
3112
+ }));
3113
+ }
3114
+ function h(m, u) {
3115
+ var d;
3116
+ const N = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.map((x) => x.columnIndex === m ? {
3117
+ ...x,
3118
+ expression: u.target.value
3119
+ } : x);
3120
+ o({
3121
+ ...a,
3122
+ onClickFilter: N
3123
+ });
3124
+ }
3125
+ function g(m) {
3126
+ var u, N, d, x;
3127
+ if (s != null && s[m] || (N = (u = a == null ? void 0 : a.onClickFilter) == null ? void 0 : u.find((f) => f.columnIndex === m)) != null && N.expression)
3128
+ return /* @__PURE__ */ e.jsx(
3129
+ ae,
3130
+ {
3131
+ value: (x = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.find((f) => f.columnIndex === m)) == null ? void 0 : x.expression,
3132
+ onChange: (f) => h(m, f),
3133
+ type: "text",
3134
+ className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
3135
+ placeholder: "Expression"
3136
+ }
3137
+ );
3138
+ }
3139
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: l == null ? void 0 : l.map((m, u) => {
3140
+ var N, d;
3141
+ return /* @__PURE__ */ e.jsx(
3142
+ "div",
3143
+ {
3144
+ className: "flex items-center justify-between space-y-2 xbg-red-100 group",
3145
+ children: /* @__PURE__ */ e.jsxs("div", { className: " grow", children: [
3146
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center py-2 space-x-2", children: [
3147
+ /* @__PURE__ */ e.jsx(
3148
+ $e,
3149
+ {
3150
+ checked: !!((N = a == null ? void 0 : a.onClickFilter) != null && N.find(
3151
+ (x) => x.columnIndex === u
3152
+ )),
3153
+ onCheckedChange: (x) => c(u, x)
3154
+ }
3155
+ ),
3156
+ /* @__PURE__ */ e.jsx(
3157
+ "label",
3158
+ {
3159
+ className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
3160
+ children: m
3161
+ }
3162
+ ),
3163
+ /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.find(
3164
+ (x) => x.columnIndex === u
3165
+ )) && /* @__PURE__ */ e.jsx(
3166
+ ca,
3167
+ {
3168
+ onClick: () => {
3169
+ n((x) => {
3170
+ const f = [...x];
3171
+ return f[u] = !x[u], f;
3172
+ });
3173
+ },
3174
+ className: " invisible group-hover:visible size-3 text-gray-400 cursor-pointer"
3175
+ }
3176
+ ) })
3177
+ ] }),
3178
+ g(u)
3179
+ ] })
3180
+ },
3181
+ m
3182
+ );
3183
+ }) });
3184
+ }
3185
+ function Un({
3441
3186
  cardType: s
3442
3187
  }) {
3443
3188
  function n(a) {
@@ -3467,22 +3212,70 @@ function Pn({
3467
3212
  ] })
3468
3213
  ] });
3469
3214
  }
3470
- return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3471
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3472
- /* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
3473
- /* @__PURE__ */ e.jsx(R, { className: " space-y-4 font-mono text-xs ", children: n(s) })
3215
+ return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
3216
+ /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3217
+ /* @__PURE__ */ e.jsx(H, { children: `${ra(s)} Chart` }),
3218
+ /* @__PURE__ */ e.jsx(B, { className: " space-y-4 font-mono text-xs ", children: n(s) })
3474
3219
  ] }),
3475
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3476
- /* @__PURE__ */ e.jsx(V, { children: "Settings" }),
3477
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(ks, {}) })
3220
+ /* @__PURE__ */ e.jsxs(_, { value: "item-2", children: [
3221
+ /* @__PURE__ */ e.jsx(H, { children: "Settings" }),
3222
+ /* @__PURE__ */ e.jsx(B, { className: "px-2", children: /* @__PURE__ */ e.jsx(ws, {}) })
3478
3223
  ] }),
3479
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3480
- /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3481
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3224
+ /* @__PURE__ */ e.jsxs(_, { value: "item-3", children: [
3225
+ /* @__PURE__ */ e.jsx(H, { children: "Filter on click" }),
3226
+ /* @__PURE__ */ e.jsx(B, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ge, {}) })
3482
3227
  ] })
3483
3228
  ] }) });
3484
3229
  }
3485
- const Gn = {
3230
+ function wa() {
3231
+ var o, l, c;
3232
+ const s = r((h) => h.card.preferences), n = r(
3233
+ (h) => h.card.cfg
3234
+ ), { setCardCfg: a, setCardPreferences: t } = r(
3235
+ (h) => h.actions
3236
+ );
3237
+ (o = n == null ? void 0 : n.options) != null && o.indexAxis;
3238
+ function i(h) {
3239
+ var u, N, d, x, f, w;
3240
+ let g = {};
3241
+ (u = s == null ? void 0 : s.chartOptions) != null && u.scales && (g = {
3242
+ x: (d = (N = s == null ? void 0 : s.chartOptions) == null ? void 0 : N.scales) == null ? void 0 : d.y,
3243
+ y: (f = (x = s == null ? void 0 : s.chartOptions) == null ? void 0 : x.scales) == null ? void 0 : f.x
3244
+ });
3245
+ const m = {
3246
+ ...s,
3247
+ chartOptions: {
3248
+ ...s == null ? void 0 : s.chartOptions,
3249
+ scales: {
3250
+ ...(w = s == null ? void 0 : s.chartOptions) == null ? void 0 : w.scales,
3251
+ ...g
3252
+ },
3253
+ indexAxis: h
3254
+ }
3255
+ };
3256
+ t(m);
3257
+ }
3258
+ return /* @__PURE__ */ e.jsxs(
3259
+ la,
3260
+ {
3261
+ value: ((l = s == null ? void 0 : s.chartOptions) == null ? void 0 : l.indexAxis) || ((c = n == null ? void 0 : n.options) == null ? void 0 : c.indexAxis) || "x",
3262
+ onValueChange: i,
3263
+ className: "flex gap-3",
3264
+ defaultValue: "x",
3265
+ children: [
3266
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3267
+ /* @__PURE__ */ e.jsx(Ye, { value: "x", id: "r1" }),
3268
+ /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
3269
+ ] }),
3270
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3271
+ /* @__PURE__ */ e.jsx(Ye, { value: "y", id: "r2" }),
3272
+ /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
3273
+ ] })
3274
+ ]
3275
+ }
3276
+ );
3277
+ }
3278
+ const Pn = {
3486
3279
  datasets: [
3487
3280
  {
3488
3281
  type: "line",
@@ -3495,7 +3288,7 @@ const Gn = {
3495
3288
  data: []
3496
3289
  }
3497
3290
  ]
3498
- }, Qn = {
3291
+ }, Gn = {
3499
3292
  datasets: [
3500
3293
  {
3501
3294
  fill: "origin",
@@ -3505,50 +3298,50 @@ const Gn = {
3505
3298
  }
3506
3299
  ]
3507
3300
  };
3508
- function Wn() {
3301
+ function Jn() {
3509
3302
  const s = r((n) => n.card.type);
3510
- return /* @__PURE__ */ e.jsxs("div", { className: "p-6 space-y-6", children: [
3303
+ return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
3511
3304
  /* @__PURE__ */ e.jsx(
3512
- Se,
3305
+ Ee,
3513
3306
  {
3514
3307
  className: " ",
3515
3308
  type: "single",
3516
3309
  collapsible: !0,
3517
- children: Yn(s)
3310
+ children: Qn(s)
3518
3311
  }
3519
3312
  ),
3520
- /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(Ss, {}) }),
3521
- /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(ks, {}) }),
3522
- /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(De, {}) })
3313
+ /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(wa, {}) }),
3314
+ /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(ws, {}) }),
3315
+ /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Ge, {}) })
3523
3316
  ] });
3524
3317
  }
3525
- function Yn(s) {
3318
+ function Qn(s) {
3526
3319
  if (["line", "bar"].includes(s))
3527
3320
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3528
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3529
- /* @__PURE__ */ e.jsx(V, { className: " font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
3530
- /* @__PURE__ */ e.jsxs(R, { className: " ", children: [
3531
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded font-mono font-semibold text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2, y-axis-3,... FROM table" }),
3532
- /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
3321
+ /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3322
+ /* @__PURE__ */ e.jsx(H, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
3323
+ /* @__PURE__ */ e.jsxs(B, { className: " ", children: [
3324
+ /* @__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" }),
3325
+ /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3533
3326
  /* @__PURE__ */ e.jsx("li", { children: "X-axis - Category (ex. city)" }),
3534
3327
  /* @__PURE__ */ e.jsx("li", { children: "Y-axis - Number (ex. population)" })
3535
3328
  ] })
3536
3329
  ] })
3537
3330
  ] }),
3538
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3539
- /* @__PURE__ */ e.jsx(V, { className: " font-normal", children: "Mixed Chart" }),
3540
- /* @__PURE__ */ e.jsxs(R, { className: " text-xs space-y-2", children: [
3331
+ /* @__PURE__ */ e.jsxs(_, { value: "item-2", children: [
3332
+ /* @__PURE__ */ e.jsx(H, { className: "font-normal", children: "Mixed Chart" }),
3333
+ /* @__PURE__ */ e.jsxs(B, { className: "space-y-2 text-xs", children: [
3541
3334
  /* @__PURE__ */ e.jsxs("p", { children: [
3542
3335
  "Click ",
3543
3336
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
3544
3337
  " and change the `type` property in the dataset."
3545
3338
  ] }),
3546
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Gn, null, 2) })
3339
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Pn, null, 2) })
3547
3340
  ] })
3548
3341
  ] }),
3549
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3550
- /* @__PURE__ */ e.jsx(V, { className: " font-normal", children: "Area Chart" }),
3551
- /* @__PURE__ */ e.jsxs(R, { className: " text-xs space-y-2", children: [
3342
+ /* @__PURE__ */ e.jsxs(_, { value: "item-3", children: [
3343
+ /* @__PURE__ */ e.jsx(H, { className: "font-normal", children: "Area Chart" }),
3344
+ /* @__PURE__ */ e.jsxs(B, { className: "space-y-2 text-xs", children: [
3552
3345
  /* @__PURE__ */ e.jsxs("p", { children: [
3553
3346
  "Click ",
3554
3347
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
@@ -3556,7 +3349,7 @@ function Yn(s) {
3556
3349
  /* @__PURE__ */ e.jsx(
3557
3350
  "a",
3558
3351
  {
3559
- className: "text-blue-500 hover:underline mx-1",
3352
+ className: "mx-1 text-blue-500 hover:underline",
3560
3353
  href: "https://www.chartjs.org/docs/latest/samples/area/line-boundaries.html",
3561
3354
  target: "_blank",
3562
3355
  children: "docs"
@@ -3564,20 +3357,20 @@ function Yn(s) {
3564
3357
  ),
3565
3358
  "for more options."
3566
3359
  ] }),
3567
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Qn, null, 2) })
3360
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Gn, null, 2) })
3568
3361
  ] })
3569
3362
  ] })
3570
3363
  ] });
3571
3364
  if (s === "bubble")
3572
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3573
- /* @__PURE__ */ e.jsx(V, { className: " font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3365
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3366
+ /* @__PURE__ */ e.jsx(H, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3574
3367
  "How to create a ",
3575
3368
  /* @__PURE__ */ e.jsx("span", { children: s }),
3576
3369
  " chart query?"
3577
3370
  ] }) }),
3578
- /* @__PURE__ */ e.jsxs(R, { className: " ", children: [
3579
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded font-mono font-semibold text-xs", children: "SELECT label, x-axis, y-axis, radius FROM table" }),
3580
- /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
3371
+ /* @__PURE__ */ e.jsxs(B, { className: " ", children: [
3372
+ /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis, radius FROM table" }),
3373
+ /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3581
3374
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
3582
3375
  /* @__PURE__ */ e.jsx("li", { children: "Bubble Group (opt) - Category (ex. state)" }),
3583
3376
  /* @__PURE__ */ e.jsx("li", { children: "X-axis - Number (ex. avg. age)" }),
@@ -3587,15 +3380,15 @@ function Yn(s) {
3587
3380
  ] })
3588
3381
  ] }) });
3589
3382
  if (s === "scatter")
3590
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3591
- /* @__PURE__ */ e.jsx(V, { className: " font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3383
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3384
+ /* @__PURE__ */ e.jsx(H, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3592
3385
  "How to create a ",
3593
3386
  /* @__PURE__ */ e.jsx("span", { children: s }),
3594
3387
  " chart query?"
3595
3388
  ] }) }),
3596
- /* @__PURE__ */ e.jsxs(R, { className: " ", children: [
3597
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded font-mono font-semibold text-xs", children: "SELECT label, x-axis, y-axis FROM table" }),
3598
- /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
3389
+ /* @__PURE__ */ e.jsxs(B, { className: " ", children: [
3390
+ /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, x-axis, y-axis FROM table" }),
3391
+ /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3599
3392
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
3600
3393
  /* @__PURE__ */ e.jsx("li", { children: "Group (opt) - Category (ex. state)" }),
3601
3394
  /* @__PURE__ */ e.jsx("li", { children: "X-axis - Number (ex. avg. age)" }),
@@ -3604,124 +3397,124 @@ function Yn(s) {
3604
3397
  ] })
3605
3398
  ] }) });
3606
3399
  if (["pie", "doughnut", "polarArea"].includes(s))
3607
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3608
- /* @__PURE__ */ e.jsx(V, { className: " font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3400
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3401
+ /* @__PURE__ */ e.jsx(H, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3609
3402
  /* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
3610
3403
  " ",
3611
3404
  "chart query"
3612
3405
  ] }) }),
3613
- /* @__PURE__ */ e.jsxs(R, { className: " ", children: [
3614
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded font-mono font-semibold text-xs", children: "SELECT label, measure FROM table" }),
3615
- /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc [&>li]:mt-2 font-normal text-xs", children: [
3406
+ /* @__PURE__ */ e.jsxs(B, { className: " ", children: [
3407
+ /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs font-semibold", children: "SELECT label, measure FROM table" }),
3408
+ /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3616
3409
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
3617
3410
  /* @__PURE__ */ e.jsx("li", { children: "Measure - Number (ex. population)" })
3618
3411
  ] })
3619
3412
  ] })
3620
3413
  ] }) });
3621
3414
  }
3622
- function Xn() {
3623
- var d, f, m, u, C;
3624
- const s = r((h) => h.card.preferences), n = r(
3625
- (h) => h.actions.setCardPreferences
3415
+ function Wn() {
3416
+ var h, g, m, u, N;
3417
+ const s = r((d) => d.card.preferences), n = r(
3418
+ (d) => d.actions.setCardPreferences
3626
3419
  ), a = r(
3627
- (h) => h.actions.setNumberFormat
3420
+ (d) => d.actions.setNumberFormat
3628
3421
  );
3629
3422
  r(
3630
- (h) => {
3631
- var x, g;
3632
- return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.decimalPlaces;
3423
+ (d) => {
3424
+ var x, f;
3425
+ return (f = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : f.decimalPlaces;
3633
3426
  }
3634
3427
  );
3635
3428
  const t = r(
3636
- (h) => {
3637
- var x, g;
3638
- return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.locale;
3429
+ (d) => {
3430
+ var x, f;
3431
+ return (f = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : f.locale;
3639
3432
  }
3640
3433
  ), i = r(
3641
- (h) => {
3642
- var x, g;
3643
- return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.currency;
3434
+ (d) => {
3435
+ var x, f;
3436
+ return (f = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : f.currency;
3644
3437
  }
3645
3438
  );
3646
3439
  r(
3647
- (h) => h.actions.setFilterOnClickField
3440
+ (d) => d.actions.setFilterOnClickField
3648
3441
  );
3649
3442
  const o = r(
3650
- (h) => {
3651
- var x, g;
3652
- return (g = (x = h.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : g.colorRanges;
3443
+ (d) => {
3444
+ var x, f;
3445
+ return (f = (x = d.card.preferences) == null ? void 0 : x.formatNumber) == null ? void 0 : f.colorRanges;
3653
3446
  }
3654
3447
  ) || [], l = r(
3655
- (h) => h.actions.setColorRanges
3656
- ), c = [...new Set(Vs.map((h) => h.currency))];
3448
+ (d) => d.actions.setColorRanges
3449
+ ), c = [...new Set(qs.map((d) => d.currency))];
3657
3450
  return /* @__PURE__ */ e.jsxs("div", { children: [
3658
3451
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
3659
3452
  /* @__PURE__ */ e.jsx(
3660
3453
  $e,
3661
3454
  {
3662
- checked: !!((d = s == null ? void 0 : s.formatNumber) != null && d.enabled),
3663
- onCheckedChange: (h) => {
3455
+ checked: !!((h = s == null ? void 0 : s.formatNumber) != null && h.enabled),
3456
+ onCheckedChange: (d) => {
3664
3457
  n({
3665
3458
  ...s,
3666
3459
  formatNumber: {
3667
3460
  ...s == null ? void 0 : s.formatNumber,
3668
- enabled: h
3461
+ enabled: d
3669
3462
  }
3670
3463
  });
3671
3464
  }
3672
3465
  }
3673
3466
  ),
3674
- /* @__PURE__ */ e.jsx(B, { children: "Format Number" })
3467
+ /* @__PURE__ */ e.jsx(R, { children: "Format Number" })
3675
3468
  ] }),
3676
- ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
3469
+ ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
3677
3470
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-2", children: [
3678
3471
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
3679
3472
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
3680
- /* @__PURE__ */ e.jsx(B, { children: "Locale" }),
3473
+ /* @__PURE__ */ e.jsx(R, { children: "Locale" }),
3681
3474
  /* @__PURE__ */ e.jsxs(
3682
- Oe,
3475
+ Fe,
3683
3476
  {
3684
3477
  value: t || "en-US",
3685
- onValueChange: (h) => {
3686
- var x, g, j;
3478
+ onValueChange: (d) => {
3479
+ var x, f, w;
3687
3480
  return a(
3688
3481
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
3689
- ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.currency) || "",
3690
- h || "en-US",
3691
- ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.suffix) || ""
3482
+ ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.currency) || "",
3483
+ d || "en-US",
3484
+ ((w = s == null ? void 0 : s.formatNumber) == null ? void 0 : w.suffix) || ""
3692
3485
  );
3693
3486
  },
3694
3487
  children: [
3695
- /* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3696
- /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
3488
+ /* @__PURE__ */ e.jsx(Oe, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Me, {}) }),
3489
+ /* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
3697
3490
  /* @__PURE__ */ e.jsx(Le, { children: "Format" }),
3698
- Vs.map((h) => /* @__PURE__ */ e.jsx(X, { value: h.locale, children: h.locale }, h.locale))
3491
+ qs.map((d) => /* @__PURE__ */ e.jsx(X, { value: d.locale, children: d.locale }, d.locale))
3699
3492
  ] }) })
3700
3493
  ]
3701
3494
  }
3702
3495
  )
3703
3496
  ] }),
3704
3497
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
3705
- /* @__PURE__ */ e.jsx(B, { children: "Currency" }),
3498
+ /* @__PURE__ */ e.jsx(R, { children: "Currency" }),
3706
3499
  /* @__PURE__ */ e.jsxs(
3707
- Oe,
3500
+ Fe,
3708
3501
  {
3709
3502
  value: i || "none",
3710
- onValueChange: (h) => {
3711
- var x, g, j;
3503
+ onValueChange: (d) => {
3504
+ var x, f, w;
3712
3505
  return a(
3713
3506
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
3714
- h === "none" ? "" : h,
3715
- ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.locale) || "",
3716
- ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.suffix) || ""
3507
+ d === "none" ? "" : d,
3508
+ ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.locale) || "",
3509
+ ((w = s == null ? void 0 : s.formatNumber) == null ? void 0 : w.suffix) || ""
3717
3510
  );
3718
3511
  },
3719
3512
  children: [
3720
- /* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3721
- /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
3513
+ /* @__PURE__ */ e.jsx(Oe, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Me, {}) }),
3514
+ /* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
3722
3515
  /* @__PURE__ */ e.jsx(Le, { children: "Currency" }),
3723
3516
  /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
3724
- c.map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h))
3517
+ c.map((d) => /* @__PURE__ */ e.jsx(X, { value: d, children: d }, d))
3725
3518
  ] }) })
3726
3519
  ]
3727
3520
  }
@@ -3730,42 +3523,42 @@ function Xn() {
3730
3523
  ] }),
3731
3524
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3732
3525
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
3733
- /* @__PURE__ */ e.jsx(B, { children: "Decimals" }),
3526
+ /* @__PURE__ */ e.jsx(R, { children: "Decimals" }),
3734
3527
  /* @__PURE__ */ e.jsxs(
3735
- Oe,
3528
+ Fe,
3736
3529
  {
3737
3530
  value: ((u = (m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.decimalPlaces) == null ? void 0 : u.toString()) || "0",
3738
- onValueChange: (h) => {
3739
- var x, g, j;
3531
+ onValueChange: (d) => {
3532
+ var x, f, w;
3740
3533
  return a(
3741
- Number(h),
3534
+ Number(d),
3742
3535
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.currency) || "",
3743
- ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.locale) || "",
3744
- ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.suffix) || ""
3536
+ ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.locale) || "",
3537
+ ((w = s == null ? void 0 : s.formatNumber) == null ? void 0 : w.suffix) || ""
3745
3538
  );
3746
3539
  },
3747
3540
  children: [
3748
- /* @__PURE__ */ e.jsx(Me, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3749
- /* @__PURE__ */ e.jsx(Ae, { children: ["0", "1", "2", "3", "4"].map((h) => /* @__PURE__ */ e.jsx(X, { value: h, children: h }, h)) })
3541
+ /* @__PURE__ */ e.jsx(Oe, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Me, {}) }),
3542
+ /* @__PURE__ */ e.jsx(Te, { children: ["0", "1", "2", "3", "4"].map((d) => /* @__PURE__ */ e.jsx(X, { value: d, children: d }, d)) })
3750
3543
  ]
3751
3544
  }
3752
3545
  )
3753
3546
  ] }),
3754
3547
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
3755
- /* @__PURE__ */ e.jsx(B, { children: "Suffix" }),
3548
+ /* @__PURE__ */ e.jsx(R, { children: "Suffix" }),
3756
3549
  /* @__PURE__ */ e.jsx(
3757
3550
  ae,
3758
3551
  {
3759
- value: ((C = s == null ? void 0 : s.formatNumber) == null ? void 0 : C.suffix) || "",
3552
+ value: ((N = s == null ? void 0 : s.formatNumber) == null ? void 0 : N.suffix) || "",
3760
3553
  className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3761
3554
  placeholder: "K, M, B, %",
3762
- onChange: (h) => {
3763
- var x, g, j;
3555
+ onChange: (d) => {
3556
+ var x, f, w;
3764
3557
  return a(
3765
3558
  ((x = s == null ? void 0 : s.formatNumber) == null ? void 0 : x.decimalPlaces) || 0,
3766
- ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.currency) || "",
3767
- ((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.locale) || "",
3768
- h.target.value
3559
+ ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.currency) || "",
3560
+ ((w = s == null ? void 0 : s.formatNumber) == null ? void 0 : w.locale) || "",
3561
+ d.target.value
3769
3562
  );
3770
3563
  }
3771
3564
  }
@@ -3773,9 +3566,9 @@ function Xn() {
3773
3566
  ] })
3774
3567
  ] })
3775
3568
  ] }) }),
3776
- /* @__PURE__ */ e.jsx(ys, { className: "my-3" }),
3569
+ /* @__PURE__ */ e.jsx(Cs, { className: "my-3" }),
3777
3570
  /* @__PURE__ */ e.jsx(
3778
- Lt,
3571
+ Tt,
3779
3572
  {
3780
3573
  colorRanges: o,
3781
3574
  setColorRanges: l
@@ -3784,11 +3577,11 @@ function Xn() {
3784
3577
  ] })
3785
3578
  ] });
3786
3579
  }
3787
- function Zn() {
3580
+ function Yn() {
3788
3581
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
3789
- /* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3790
- /* @__PURE__ */ e.jsx(V, { className: "", children: "KPI Query" }),
3791
- /* @__PURE__ */ e.jsxs(R, { className: "font-mono", children: [
3582
+ /* @__PURE__ */ e.jsx(Ee, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3583
+ /* @__PURE__ */ e.jsx(H, { className: "", children: "KPI Query" }),
3584
+ /* @__PURE__ */ e.jsxs(B, { className: "font-mono", children: [
3792
3585
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
3793
3586
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs [&>li]:mt-2", children: [
3794
3587
  /* @__PURE__ */ e.jsx("li", { children: "current - number" }),
@@ -3810,19 +3603,19 @@ function Zn() {
3810
3603
  ] })
3811
3604
  ] })
3812
3605
  ] }) }),
3813
- /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Xn, {}) }),
3606
+ /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Wn, {}) }),
3814
3607
  /* @__PURE__ */ e.jsx("div", {}),
3815
3608
  /* @__PURE__ */ e.jsx("div", {})
3816
3609
  ] });
3817
3610
  }
3818
- function Ks({
3611
+ function os({
3819
3612
  cardType: s,
3820
3613
  docContent: n
3821
3614
  }) {
3822
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3823
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3824
- /* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
3825
- /* @__PURE__ */ e.jsx(R, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3615
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
3616
+ /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3617
+ /* @__PURE__ */ e.jsx(H, { children: `${ra(s)} Chart` }),
3618
+ /* @__PURE__ */ e.jsx(B, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3826
3619
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
3827
3620
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3828
3621
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
@@ -3844,21 +3637,237 @@ function Ks({
3844
3637
  ] })
3845
3638
  ] }) })
3846
3639
  ] }),
3847
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3848
- /* @__PURE__ */ e.jsx(V, { children: "Settings" }),
3849
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(ks, {}) })
3640
+ /* @__PURE__ */ e.jsxs(_, { value: "item-2", children: [
3641
+ /* @__PURE__ */ e.jsx(H, { children: "Settings" }),
3642
+ /* @__PURE__ */ e.jsx(B, { className: "px-2", children: /* @__PURE__ */ e.jsx(ws, {}) })
3850
3643
  ] }),
3851
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3852
- /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3853
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3644
+ s !== "range" && /* @__PURE__ */ e.jsxs(_, { value: "item-3", children: [
3645
+ /* @__PURE__ */ e.jsx(H, { children: "Filter on click" }),
3646
+ /* @__PURE__ */ e.jsx(B, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ge, {}) })
3854
3647
  ] })
3855
3648
  ] }) });
3856
3649
  }
3857
- function el() {
3858
- return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3859
- /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3860
- /* @__PURE__ */ e.jsx(V, { children: "Stacked Chart" }),
3861
- /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 font-mono text-xs", children: [
3650
+ function Xn({ idx: s }) {
3651
+ var c;
3652
+ const n = r((h) => {
3653
+ var g;
3654
+ return (g = h.card) == null ? void 0 : g.preferences;
3655
+ }), a = r(
3656
+ (h) => {
3657
+ var g;
3658
+ return (g = h.card.preferences) == null ? void 0 : g.datasetOptions;
3659
+ }
3660
+ ), t = r(
3661
+ (h) => h.actions.setCardPreferences
3662
+ ), i = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.indexAxis, o = a == null ? void 0 : a.find((h) => h.idx === s);
3663
+ function l(h, g) {
3664
+ (h === "end" || h === "start") && Lt(Et());
3665
+ const m = {
3666
+ display: h !== "none",
3667
+ align: h,
3668
+ anchor: h,
3669
+ clamp: !0
3670
+ };
3671
+ if (!o)
3672
+ t({
3673
+ ...n,
3674
+ datasetOptions: [
3675
+ ...a || [],
3676
+ {
3677
+ idx: g,
3678
+ datalabels: m
3679
+ }
3680
+ ]
3681
+ });
3682
+ else {
3683
+ const u = { ...o };
3684
+ u.datalabels = m;
3685
+ const N = a == null ? void 0 : a.map(
3686
+ (d) => d.idx === g ? u : d
3687
+ );
3688
+ t({
3689
+ ...n,
3690
+ datasetOptions: N
3691
+ });
3692
+ }
3693
+ }
3694
+ return /* @__PURE__ */ e.jsxs(Ke, { children: [
3695
+ /* @__PURE__ */ e.jsx(Ue, { children: /* @__PURE__ */ e.jsx(un, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3696
+ /* @__PURE__ */ e.jsx(Pe, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3697
+ /* @__PURE__ */ e.jsx(
3698
+ z,
3699
+ {
3700
+ onClick: () => l("none", s),
3701
+ size: "sm",
3702
+ variant: "secondary",
3703
+ className: "h-7 p-1 text-xs font-normal",
3704
+ children: /* @__PURE__ */ e.jsx(At, { className: "size-4" })
3705
+ }
3706
+ ),
3707
+ /* @__PURE__ */ e.jsx(
3708
+ z,
3709
+ {
3710
+ onClick: () => l("start", s),
3711
+ size: "sm",
3712
+ variant: "secondary",
3713
+ className: "h-7 p-1 text-xs font-normal",
3714
+ children: /* @__PURE__ */ e.jsx(
3715
+ sn,
3716
+ {
3717
+ className: W("h-4 w-4", {
3718
+ "rotate-90": i === "y"
3719
+ })
3720
+ }
3721
+ )
3722
+ }
3723
+ ),
3724
+ /* @__PURE__ */ e.jsx(
3725
+ z,
3726
+ {
3727
+ onClick: () => l("center", s),
3728
+ size: "sm",
3729
+ variant: "secondary",
3730
+ className: "h-7 p-1 text-xs font-normal",
3731
+ children: /* @__PURE__ */ e.jsx(
3732
+ tn,
3733
+ {
3734
+ className: W("h-4 w-4", {
3735
+ "rotate-90": i === "y"
3736
+ })
3737
+ }
3738
+ )
3739
+ }
3740
+ ),
3741
+ /* @__PURE__ */ e.jsx(
3742
+ z,
3743
+ {
3744
+ onClick: () => l("end", s),
3745
+ size: "sm",
3746
+ variant: "secondary",
3747
+ className: "h-7 p-1 text-xs font-normal",
3748
+ children: /* @__PURE__ */ e.jsx(
3749
+ an,
3750
+ {
3751
+ className: W("h-4 w-4", {
3752
+ "rotate-90": i === "y"
3753
+ })
3754
+ }
3755
+ )
3756
+ }
3757
+ )
3758
+ ] }) })
3759
+ ] });
3760
+ }
3761
+ function Zn() {
3762
+ const s = r((h) => h.card), n = r(
3763
+ (h) => {
3764
+ var g, m, u;
3765
+ return (u = (m = (g = h == null ? void 0 : h.card) == null ? void 0 : g.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : u.indexAxis;
3766
+ }
3767
+ ), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
3768
+ keys: i,
3769
+ metricKeys: o,
3770
+ dimensionKeys: l
3771
+ } = ds(s.data || []);
3772
+ let c = o;
3773
+ if (s.type === "stackedBar") {
3774
+ const h = Dt({
3775
+ dataArray: s.data || [],
3776
+ groupKey: l[0],
3777
+ pivotKey: l[1],
3778
+ valueKey: c[0]
3779
+ }), { metricKeys: g } = ds(h);
3780
+ c = g;
3781
+ }
3782
+ return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3783
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3784
+ /* @__PURE__ */ e.jsx(R, { children: a }),
3785
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: l[0] }) }) })
3786
+ ] }),
3787
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3788
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
3789
+ /* @__PURE__ */ e.jsx(R, { children: t }),
3790
+ /* @__PURE__ */ e.jsx(ka, {})
3791
+ ] }),
3792
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((h, g) => /* @__PURE__ */ e.jsx(el, { col: h, idx: g }, h)) })
3793
+ ] })
3794
+ ] });
3795
+ }
3796
+ function el({ col: s, idx: n }) {
3797
+ const a = r((c) => {
3798
+ var h;
3799
+ return (h = c.card) == null ? void 0 : h.preferences;
3800
+ }), t = r(
3801
+ (c) => {
3802
+ var h;
3803
+ return (h = c.card.preferences) == null ? void 0 : h.datasetOptions;
3804
+ }
3805
+ ), i = t == null ? void 0 : t.find((c) => c.idx === n), { setCardPreferences: o } = r((c) => c.actions);
3806
+ function l(c) {
3807
+ if (!i)
3808
+ o({
3809
+ ...a,
3810
+ datasetOptions: [
3811
+ ...t || [],
3812
+ {
3813
+ idx: n,
3814
+ type: c === "area" ? "line" : c,
3815
+ fill: c === "area" ? "origin" : ""
3816
+ }
3817
+ ]
3818
+ });
3819
+ else {
3820
+ const h = { ...i };
3821
+ h.type = c === "area" ? "line" : c, h.fill = c === "area" ? "origin" : "";
3822
+ const g = t == null ? void 0 : t.map(
3823
+ (m) => m.idx === n ? h : m
3824
+ );
3825
+ o({
3826
+ ...a,
3827
+ datasetOptions: g
3828
+ });
3829
+ }
3830
+ }
3831
+ return /* @__PURE__ */ e.jsxs("div", { className: "group flex items-center justify-between gap-5 rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: [
3832
+ /* @__PURE__ */ e.jsx("p", { children: s }),
3833
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3834
+ /* @__PURE__ */ e.jsx(
3835
+ Ss,
3836
+ {
3837
+ onClick: () => l("bar"),
3838
+ className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3839
+ }
3840
+ ),
3841
+ /* @__PURE__ */ e.jsx(
3842
+ ks,
3843
+ {
3844
+ onClick: () => l("line"),
3845
+ className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3846
+ }
3847
+ ),
3848
+ /* @__PURE__ */ e.jsx(
3849
+ Gt,
3850
+ {
3851
+ onClick: () => l("area"),
3852
+ className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3853
+ }
3854
+ ),
3855
+ /* @__PURE__ */ e.jsx(
3856
+ Cs,
3857
+ {
3858
+ orientation: "vertical",
3859
+ className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
3860
+ }
3861
+ ),
3862
+ /* @__PURE__ */ e.jsx(Xn, { idx: n })
3863
+ ] })
3864
+ ] });
3865
+ }
3866
+ function sl() {
3867
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
3868
+ /* @__PURE__ */ e.jsxs(_, { value: "item-1", children: [
3869
+ /* @__PURE__ */ e.jsx(H, { children: "Stacked Chart" }),
3870
+ /* @__PURE__ */ e.jsxs(B, { className: "space-y-4 font-mono text-xs", children: [
3862
3871
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
3863
3872
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3864
3873
  /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
@@ -3881,20 +3890,20 @@ function el() {
3881
3890
  ] })
3882
3891
  ] })
3883
3892
  ] }),
3884
- /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3885
- /* @__PURE__ */ e.jsx(V, { children: "Settings" }),
3886
- /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 px-2", children: [
3887
- /* @__PURE__ */ e.jsx(Ss, {}),
3888
- /* @__PURE__ */ e.jsx(wa, {})
3893
+ /* @__PURE__ */ e.jsxs(_, { value: "item-2", children: [
3894
+ /* @__PURE__ */ e.jsx(H, { children: "Settings" }),
3895
+ /* @__PURE__ */ e.jsxs(B, { className: "space-y-4 px-2", children: [
3896
+ /* @__PURE__ */ e.jsx(wa, {}),
3897
+ /* @__PURE__ */ e.jsx(Zn, {})
3889
3898
  ] })
3890
3899
  ] }),
3891
- /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3892
- /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3893
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3900
+ /* @__PURE__ */ e.jsxs(_, { value: "item-3", children: [
3901
+ /* @__PURE__ */ e.jsx(H, { children: "Filter on click" }),
3902
+ /* @__PURE__ */ e.jsx(B, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ge, {}) })
3894
3903
  ] })
3895
3904
  ] }) });
3896
3905
  }
3897
- function sl({}) {
3906
+ function al({}) {
3898
3907
  const s = r((t) => {
3899
3908
  var i;
3900
3909
  return (i = t.card) == null ? void 0 : i.preferences;
@@ -3907,9 +3916,9 @@ function sl({}) {
3907
3916
  });
3908
3917
  };
3909
3918
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
3910
- /* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3911
- /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3912
- /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3919
+ /* @__PURE__ */ e.jsx(Ee, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(_, { value: "item-3", children: [
3920
+ /* @__PURE__ */ e.jsx(H, { children: "Filter on click" }),
3921
+ /* @__PURE__ */ e.jsx(B, { className: "px-2", children: /* @__PURE__ */ e.jsx(Ge, {}) })
3913
3922
  ] }) }),
3914
3923
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3915
3924
  /* @__PURE__ */ e.jsx($e, { onCheckedChange: a, id: "allow-download" }),
@@ -3924,7 +3933,7 @@ function sl({}) {
3924
3933
  ] })
3925
3934
  ] });
3926
3935
  }
3927
- const al = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3936
+ const tl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3928
3937
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
3929
3938
  /* @__PURE__ */ e.jsxs("div", { children: [
3930
3939
  "See ",
@@ -3940,100 +3949,111 @@ const al = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
3940
3949
  ),
3941
3950
  " in the docs."
3942
3951
  ] })
3952
+ ] }), nl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3953
+ /* @__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" }),
3954
+ /* @__PURE__ */ e.jsxs("div", { children: [
3955
+ "See ",
3956
+ /* @__PURE__ */ e.jsx(
3957
+ "a",
3958
+ {
3959
+ target: "_blank",
3960
+ onClick: (s) => s.stopPropagation(),
3961
+ className: "text-blue-700",
3962
+ href: "https://docs.semaphor.cloud/concepts/visuals#range-chart",
3963
+ children: "example"
3964
+ }
3965
+ ),
3966
+ " in the docs."
3967
+ ] })
3943
3968
  ] });
3944
- function tl() {
3969
+ function ll() {
3945
3970
  const s = r((a) => a.card.type);
3946
3971
  function n(a) {
3947
3972
  switch (a) {
3948
3973
  case "stackedBar":
3949
- return /* @__PURE__ */ e.jsx(el, {});
3974
+ return /* @__PURE__ */ e.jsx(sl, {});
3950
3975
  case "pyramid":
3951
- return /* @__PURE__ */ e.jsx(
3952
- Ks,
3953
- {
3954
- docContent: al,
3955
- cardType: a
3956
- }
3957
- );
3976
+ return /* @__PURE__ */ e.jsx(os, { docContent: tl, cardType: a });
3958
3977
  case "kpi":
3959
- return /* @__PURE__ */ e.jsx(Zn, {});
3978
+ return /* @__PURE__ */ e.jsx(Yn, {});
3960
3979
  case "line":
3961
3980
  case "bar":
3962
- return /* @__PURE__ */ e.jsx(Jn, { cardType: a });
3981
+ case "range":
3982
+ return /* @__PURE__ */ e.jsx(os, { docContent: nl, cardType: a });
3963
3983
  case "pie":
3964
3984
  case "doughnut":
3965
3985
  case "polarArea":
3966
3986
  case "radar":
3967
- return /* @__PURE__ */ e.jsx(Ks, { cardType: a });
3987
+ return /* @__PURE__ */ e.jsx(os, { cardType: a });
3968
3988
  case "bubble":
3969
3989
  case "scatter":
3970
- return /* @__PURE__ */ e.jsx(Pn, { cardType: a });
3990
+ return /* @__PURE__ */ e.jsx(Un, { cardType: a });
3971
3991
  case "table":
3972
- return /* @__PURE__ */ e.jsx(sl, { cardType: a });
3992
+ return /* @__PURE__ */ e.jsx(al, { cardType: a });
3973
3993
  default:
3974
- return /* @__PURE__ */ e.jsx(Wn, {});
3994
+ return /* @__PURE__ */ e.jsx(Jn, {});
3975
3995
  }
3976
3996
  }
3977
- return /* @__PURE__ */ e.jsx(bs, { className: "h-full w-full text-sm", children: n(s) });
3997
+ return /* @__PURE__ */ e.jsx(Ns, { className: "h-full w-full text-sm", children: n(s) });
3978
3998
  }
3979
- function nl() {
3999
+ function rl() {
3980
4000
  const s = r((n) => n.isShowingVisual);
3981
4001
  return /* @__PURE__ */ e.jsxs(
3982
- os,
4002
+ hs,
3983
4003
  {
3984
4004
  direction: "vertical",
3985
4005
  className: "min-w-full max-w-lg min-h-[250px]",
3986
4006
  children: [
3987
4007
  /* @__PURE__ */ e.jsx(
3988
- Fe,
4008
+ ze,
3989
4009
  {
3990
4010
  role: "query-section",
3991
4011
  className: "flex",
3992
4012
  minSize: 20,
3993
4013
  defaultSize: 40,
3994
- children: /* @__PURE__ */ e.jsx(In, {})
4014
+ children: /* @__PURE__ */ e.jsx(qn, {})
3995
4015
  }
3996
4016
  ),
3997
- /* @__PURE__ */ e.jsx(cs, { withHandle: !0, className: "border " }),
4017
+ /* @__PURE__ */ e.jsx(ms, { withHandle: !0, className: "border " }),
3998
4018
  /* @__PURE__ */ e.jsx(
3999
- Fe,
4019
+ ze,
4000
4020
  {
4001
4021
  className: "pb-1",
4002
4022
  role: "visual-section",
4003
4023
  minSize: 0,
4004
4024
  defaultSize: 60,
4005
- children: s ? /* @__PURE__ */ e.jsxs(os, { direction: "horizontal", children: [
4025
+ children: s ? /* @__PURE__ */ e.jsxs(hs, { direction: "horizontal", children: [
4006
4026
  /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
4007
- Fe,
4027
+ ze,
4008
4028
  {
4009
4029
  className: "flex min-w-[275px]",
4010
4030
  minSize: 20,
4011
4031
  defaultSize: 25,
4012
4032
  maxSize: 30,
4013
- children: /* @__PURE__ */ e.jsx(tl, {})
4033
+ children: /* @__PURE__ */ e.jsx(ll, {})
4014
4034
  }
4015
4035
  ) }),
4016
- /* @__PURE__ */ e.jsx(cs, { className: "border " }),
4017
- /* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(Bs, {}) })
4018
- ] }) : /* @__PURE__ */ e.jsx(Bs, {})
4036
+ /* @__PURE__ */ e.jsx(ms, { className: "border " }),
4037
+ /* @__PURE__ */ e.jsx(ze, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(Hs, {}) })
4038
+ ] }) : /* @__PURE__ */ e.jsx(Hs, {})
4019
4039
  }
4020
4040
  )
4021
4041
  ]
4022
4042
  }
4023
4043
  );
4024
4044
  }
4025
- function ll({ authToken: s, onSave: n, onClose: a }) {
4045
+ function il({ authToken: s, onSave: n, onClose: a }) {
4026
4046
  const t = r((l) => l.actions.setOnSave), i = r((l) => l.actions.setOnClose), o = k((l) => l.actions.setAuthToken);
4027
4047
  return K(() => {
4028
4048
  n && t(n), a && i(a);
4029
4049
  }, [n, t, a, i]), K(() => {
4030
4050
  s && s.accessToken && o(s);
4031
- }, [s, o]), /* @__PURE__ */ e.jsxs(Dt, { className: "rounded-none", role: "editor-panel", children: [
4032
- /* @__PURE__ */ e.jsx(It, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(xa, {}) }),
4033
- /* @__PURE__ */ e.jsx(qt, { children: /* @__PURE__ */ e.jsx(nl, {}) })
4051
+ }, [s, o]), /* @__PURE__ */ e.jsxs(It, { className: "rounded-none", role: "editor-panel", children: [
4052
+ /* @__PURE__ */ e.jsx(qt, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(xa, {}) }),
4053
+ /* @__PURE__ */ e.jsx(Vt, { children: /* @__PURE__ */ e.jsx(rl, {}) })
4034
4054
  ] });
4035
4055
  }
4036
- function rl() {
4056
+ function ol() {
4037
4057
  k((l) => l.selectedCardId);
4038
4058
  const s = k((l) => l.selectedSheetId), { setIsVisualEditing: n } = k((l) => l.actions), a = k((l) => l.isVisualEditing), t = k((l) => l.actions.updateFrame);
4039
4059
  function i(l) {
@@ -4050,33 +4070,33 @@ function rl() {
4050
4070
  block: a,
4051
4071
  hidden: !a
4052
4072
  }),
4053
- children: /* @__PURE__ */ e.jsx(ll, { onSave: i, onClose: o })
4073
+ children: /* @__PURE__ */ e.jsx(il, { onSave: i, onClose: o })
4054
4074
  }
4055
4075
  );
4056
4076
  }
4057
- function il({
4077
+ function cl({
4058
4078
  columns: s,
4059
4079
  tableName: n
4060
4080
  }) {
4061
- const a = r((u) => u.selectedConnectionId), t = r((u) => u.selectedDatabaseName), i = r((u) => u.selectedSchemaName), o = r((u) => u.selectedTableName), l = k((u) => u.dashboard.filters) || [], c = k((u) => u.actions.addFilter), d = k((u) => u.actions.removeFilter), f = k(
4081
+ const a = r((u) => u.selectedConnectionId), t = r((u) => u.selectedDatabaseName), i = r((u) => u.selectedSchemaName), o = r((u) => u.selectedTableName), l = k((u) => u.dashboard.filters) || [], c = k((u) => u.actions.addFilter), h = k((u) => u.actions.removeFilter), g = k(
4062
4082
  (u) => u.actions.removeFilterValue
4063
4083
  );
4064
4084
  function m(u) {
4065
- const C = he(u.column_name), h = he(t || ""), x = he(i || ""), g = he(n), j = rs(
4085
+ const N = he(u.column_name), d = he(t || ""), x = he(i || ""), f = he(n), w = cs(
4066
4086
  x,
4067
- g
4068
- ), b = `${j}.${C}`;
4087
+ f
4088
+ ), b = `${w}.${N}`;
4069
4089
  console.log(
4070
4090
  "find",
4071
4091
  b,
4072
- g,
4073
- h
4092
+ f,
4093
+ d
4074
4094
  );
4075
- const L = l == null ? void 0 : l.find(
4076
- (A) => A.column === b && A.table === g && (A.database === h || A.database === t)
4095
+ const E = l == null ? void 0 : l.find(
4096
+ (C) => C.column === b && C.table === f && (C.database === d || C.database === t)
4077
4097
  );
4078
- if (L)
4079
- f(L.id), d(L.id);
4098
+ if (E)
4099
+ g(E.id), h(E.id);
4080
4100
  else {
4081
4101
  if (n === "api" && a) {
4082
4102
  c({
@@ -4089,10 +4109,10 @@ function il({
4089
4109
  // database: 'NA',
4090
4110
  connectionId: a,
4091
4111
  operation: "in",
4092
- sql: Rs(
4112
+ sql: Vs(
4093
4113
  u.data_type,
4094
- j,
4095
- C
4114
+ w,
4115
+ N
4096
4116
  )
4097
4117
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4098
4118
  });
@@ -4100,25 +4120,25 @@ function il({
4100
4120
  }
4101
4121
  c({
4102
4122
  id: We(),
4103
- column: `${j}.${C}`,
4123
+ column: `${w}.${N}`,
4104
4124
  title: u.column_name,
4105
4125
  dataType: u.data_type,
4106
4126
  table: o || "",
4107
4127
  database: t || "",
4108
4128
  connectionId: a || "",
4109
4129
  operation: "in",
4110
- sql: Rs(
4130
+ sql: Vs(
4111
4131
  u.data_type,
4112
- j,
4113
- C
4132
+ w,
4133
+ N
4114
4134
  )
4115
4135
  //DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
4116
4136
  });
4117
4137
  }
4118
4138
  }
4119
4139
  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) => {
4120
- const C = l == null ? void 0 : l.find(
4121
- (h) => h.column === he(u.column_name) && h.table === o && h.database === t
4140
+ const N = l == null ? void 0 : l.find(
4141
+ (d) => d.column === he(u.column_name) && d.table === o && d.database === t
4122
4142
  );
4123
4143
  return /* @__PURE__ */ e.jsx(
4124
4144
  "div",
@@ -4127,7 +4147,7 @@ function il({
4127
4147
  className: W(
4128
4148
  "group flex cursor-pointer items-center justify-between border border-dashed border-background px-3 py-[6px] text-sm transition-colors hover:bg-muted/50",
4129
4149
  {
4130
- "bg-muted": C
4150
+ "bg-muted": N
4131
4151
  }
4132
4152
  ),
4133
4153
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
@@ -4139,16 +4159,16 @@ function il({
4139
4159
  );
4140
4160
  }) });
4141
4161
  }
4142
- function ol() {
4162
+ function dl() {
4143
4163
  k((n) => n.showFilters);
4144
4164
  const s = k(
4145
4165
  (n) => n.actions.setShowFilters
4146
4166
  );
4147
4167
  return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
4148
4168
  /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
4149
- /* @__PURE__ */ e.jsx(B, { className: "text-lg", children: "Filters" }),
4169
+ /* @__PURE__ */ e.jsx(R, { className: "text-lg", children: "Filters" }),
4150
4170
  /* @__PURE__ */ e.jsx(
4151
- w,
4171
+ z,
4152
4172
  {
4153
4173
  onClick: () => s(!1),
4154
4174
  className: "h-7 w-7 p-0",
@@ -4161,7 +4181,7 @@ function ol() {
4161
4181
  xa,
4162
4182
  {
4163
4183
  ColumnsComponent: (n, a, t) => /* @__PURE__ */ e.jsx(
4164
- il,
4184
+ cl,
4165
4185
  {
4166
4186
  schemaName: n,
4167
4187
  tableName: a,
@@ -4172,7 +4192,7 @@ function ol() {
4172
4192
  ) })
4173
4193
  ] });
4174
4194
  }
4175
- function cl() {
4195
+ function hl() {
4176
4196
  k((a) => a.dashboard);
4177
4197
  const s = k((a) => a.showFilters), n = k((a) => a.isVisualEditing);
4178
4198
  return k((a) => a.bookmarkKey), /* @__PURE__ */ e.jsxs(
@@ -4184,13 +4204,13 @@ function cl() {
4184
4204
  flex: !n
4185
4205
  }),
4186
4206
  children: [
4187
- /* @__PURE__ */ e.jsx(Vt, {}),
4188
- s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(ol, {}) })
4207
+ /* @__PURE__ */ e.jsx(Rt, {}),
4208
+ s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(dl, {}) })
4189
4209
  ]
4190
4210
  }
4191
4211
  );
4192
4212
  }
4193
- function dl() {
4213
+ function ml() {
4194
4214
  const s = k((t) => t.dashboard), n = k((t) => t.actions.setDashboard), a = k(
4195
4215
  (t) => t.showDashboardJSON
4196
4216
  );
@@ -4203,7 +4223,7 @@ function dl() {
4203
4223
  hidden: !a
4204
4224
  }),
4205
4225
  children: /* @__PURE__ */ e.jsx(
4206
- Rt,
4226
+ _t,
4207
4227
  {
4208
4228
  onChange: (t) => {
4209
4229
  if (t)
@@ -4234,25 +4254,25 @@ function dl() {
4234
4254
  }
4235
4255
  );
4236
4256
  }
4237
- function ul({
4257
+ function pl({
4238
4258
  showControls: s = !1,
4239
4259
  showFooter: n = !0,
4240
4260
  ...a
4241
4261
  }) {
4242
- return /* @__PURE__ */ e.jsxs(_t, { dashboardProps: a, children: [
4243
- /* @__PURE__ */ e.jsx(Ht, {}),
4244
- /* @__PURE__ */ e.jsxs(Bt, { children: [
4245
- /* @__PURE__ */ e.jsx(dl, {}),
4246
- /* @__PURE__ */ e.jsxs($t, { ...a, children: [
4247
- s && /* @__PURE__ */ e.jsx(bn, {}),
4248
- /* @__PURE__ */ e.jsx(rl, {}),
4249
- /* @__PURE__ */ e.jsx(cl, {})
4262
+ return /* @__PURE__ */ e.jsxs(Ht, { dashboardProps: a, children: [
4263
+ /* @__PURE__ */ e.jsx(Bt, {}),
4264
+ /* @__PURE__ */ e.jsxs($t, { children: [
4265
+ /* @__PURE__ */ e.jsx(ml, {}),
4266
+ /* @__PURE__ */ e.jsxs(Kt, { ...a, children: [
4267
+ s && /* @__PURE__ */ e.jsx(yn, {}),
4268
+ /* @__PURE__ */ e.jsx(ol, {}),
4269
+ /* @__PURE__ */ e.jsx(hl, {})
4250
4270
  ] })
4251
4271
  ] })
4252
4272
  ] });
4253
4273
  }
4254
4274
  export {
4255
- ul as D,
4256
- Ge as S,
4275
+ pl as D,
4276
+ Qe as S,
4257
4277
  ua as u
4258
4278
  };