react-semaphor 0.0.185 → 0.0.187

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 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";
1
+ import { P as E, b as k, j as e, Q as us, R as xs, U as z, V as Ps, W as ps, X as fs, Y as gs, Z as js, _ as B, $ as ae, a0 as Us, J as Gs, O as Ee, a1 as Va, a2 as qa, a3 as Ra, a4 as _a, a5 as Ha, a6 as Ba, a7 as Ts, a8 as _e, a9 as Ke, aa as We, T as bs, e as Js, g as ys, ab as Oe, ac as Me, f as W, ad as Te, ae as Ae, af as He, ag as Le, ah as X, ai as vs, G as r, aj as Pe, ak as Ue, al as $a, am as Ge, w as Qs, v as Ws, t as he, an as Ka, r as Pa, N as Ys, s as Ua, ao as Ga, B as Ja, ap as Xs, aq as Qa, L as Be, S as Ns, z as Wa, n as As, ar as Es, A as cs, u as es, as as Ce, at as ze, au as Zs, av as ea, aw as sa, ax as aa, ay as ta, az as Ya, aA as Xa, aB as na, aC as Za, aD as et, aE as st, aF as at, aG as tt, aH as ds, aI as nt, aJ as Re, aK as hs, aL as Fe, aM as ms, aN as Ls, aO as lt, aP as rt, aQ as it, aR as ot, aS as ct, aT as ls, aU as dt, aV as Ds, aW as ht, aX as Is, aY as mt, aZ as ut, a_ as xt, a$ as la, l as pt, C as ft, E as Vs, d as gt, h as jt, i as bt, o as yt, b0 as vt, m as Nt, H as Ct, b1 as St, b2 as kt, b3 as wt, b4 as rs, b5 as zt, b6 as is, b7 as qs, K as Ft, b8 as Cs, b9 as Ot, ba as ra, bb as Ye, bc as ia, bd as Mt, be as Tt, bf as At, bg as Et, bh as Lt, bi as Dt, bj as Se, bk as q, bl as R, bm as Ss, bn as _, bo as Rs, bp as It, bq as Vt, br as qt, bs as Rt, bt as _s, bu as _t, bv as Ht, bw as Bt, bx as $t, by as Kt, bz as Pt } from "./index-W8jYjb9k.js";
2
+ import me, { useState as T, useEffect as K, useMemo as Ut, useRef as $e } from "react";
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 Pt = L("Activity", [
9
+ const Gt = E("Activity", [
10
10
  [
11
11
  "path",
12
12
  {
@@ -21,7 +21,7 @@ const Pt = L("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 Gt = L("AreaChart", [
24
+ const Jt = E("AreaChart", [
25
25
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
26
26
  ["path", { d: "M7 12v5h12V8l-5 5-4-4Z", key: "zxz28u" }]
27
27
  ]);
@@ -31,7 +31,7 @@ const Gt = L("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 Ss = L("BarChart4", [
34
+ const ks = E("BarChart4", [
35
35
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
36
36
  ["path", { d: "M13 17V9", key: "1fwyjl" }],
37
37
  ["path", { d: "M18 17V5", key: "sfb6ij" }],
@@ -43,7 +43,7 @@ const Ss = L("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 Jt = L("CircleX", [
46
+ const Qt = E("CircleX", [
47
47
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
48
48
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
49
49
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -54,7 +54,7 @@ const Jt = L("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 Qt = L("Database", [
57
+ const Wt = E("Database", [
58
58
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
59
59
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
60
60
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
@@ -65,7 +65,7 @@ const Qt = L("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 Wt = L("Eraser", [
68
+ const Yt = E("Eraser", [
69
69
  [
70
70
  "path",
71
71
  {
@@ -82,7 +82,7 @@ const Wt = L("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 ia = L("Filter", [
85
+ const oa = E("Filter", [
86
86
  ["polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3", key: "1yg77f" }]
87
87
  ]);
88
88
  /**
@@ -91,7 +91,7 @@ const ia = L("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 oa = L("GanttChart", [
94
+ const ca = E("GanttChart", [
95
95
  ["path", { d: "M8 6h10", key: "9lnwnk" }],
96
96
  ["path", { d: "M6 12h9", key: "1g9pqf" }],
97
97
  ["path", { d: "M11 18h7", key: "c8dzvl" }]
@@ -102,7 +102,7 @@ const oa = L("GanttChart", [
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
104
  */
105
- const Yt = L("Glasses", [
105
+ const Xt = E("Glasses", [
106
106
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
107
107
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
108
108
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -115,7 +115,7 @@ const Yt = L("Glasses", [
115
115
  * This source code is licensed under the ISC license.
116
116
  * See the LICENSE file in the root directory of this source tree.
117
117
  */
118
- const Xt = L("Hammer", [
118
+ const Zt = E("Hammer", [
119
119
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
120
120
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
121
121
  [
@@ -132,7 +132,7 @@ const Xt = L("Hammer", [
132
132
  * This source code is licensed under the ISC license.
133
133
  * See the LICENSE file in the root directory of this source tree.
134
134
  */
135
- const Zt = L("Hash", [
135
+ const en = E("Hash", [
136
136
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
137
137
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
138
138
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -144,7 +144,7 @@ const Zt = L("Hash", [
144
144
  * This source code is licensed under the ISC license.
145
145
  * See the LICENSE file in the root directory of this source tree.
146
146
  */
147
- const en = L("Key", [
147
+ const sn = E("Key", [
148
148
  ["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
149
149
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
150
150
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
@@ -155,7 +155,7 @@ const en = L("Key", [
155
155
  * This source code is licensed under the ISC license.
156
156
  * See the LICENSE file in the root directory of this source tree.
157
157
  */
158
- const ks = L("LineChart", [
158
+ const ws = E("LineChart", [
159
159
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
160
160
  ["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
161
161
  ]);
@@ -165,7 +165,7 @@ const ks = L("LineChart", [
165
165
  * This source code is licensed under the ISC license.
166
166
  * See the LICENSE file in the root directory of this source tree.
167
167
  */
168
- const sn = L("ListEnd", [
168
+ const an = E("ListEnd", [
169
169
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
170
170
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
171
171
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -178,7 +178,7 @@ const sn = L("ListEnd", [
178
178
  * This source code is licensed under the ISC license.
179
179
  * See the LICENSE file in the root directory of this source tree.
180
180
  */
181
- const an = L("ListStart", [
181
+ const tn = E("ListStart", [
182
182
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
183
183
  ["path", { d: "M16 18H3", key: "12xzn7" }],
184
184
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -191,7 +191,7 @@ const an = L("ListStart", [
191
191
  * This source code is licensed under the ISC license.
192
192
  * See the LICENSE file in the root directory of this source tree.
193
193
  */
194
- const tn = L("ListX", [
194
+ const nn = E("ListX", [
195
195
  ["path", { d: "M11 12H3", key: "51ecnj" }],
196
196
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
197
197
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -204,7 +204,7 @@ const tn = L("ListX", [
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
206
  */
207
- const nn = L("MessageSquareMore", [
207
+ const ln = E("MessageSquareMore", [
208
208
  ["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }],
209
209
  ["path", { d: "M8 10h.01", key: "19clt8" }],
210
210
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -216,7 +216,7 @@ const nn = L("MessageSquareMore", [
216
216
  * This source code is licensed under the ISC license.
217
217
  * See the LICENSE file in the root directory of this source tree.
218
218
  */
219
- const ln = L("Network", [
219
+ const rn = E("Network", [
220
220
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
221
221
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
222
222
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -229,7 +229,7 @@ const ln = L("Network", [
229
229
  * This source code is licensed under the ISC license.
230
230
  * See the LICENSE file in the root directory of this source tree.
231
231
  */
232
- const ca = L("Pencil", [
232
+ const da = E("Pencil", [
233
233
  ["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }],
234
234
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
235
235
  ]);
@@ -239,7 +239,7 @@ const ca = L("Pencil", [
239
239
  * This source code is licensed under the ISC license.
240
240
  * See the LICENSE file in the root directory of this source tree.
241
241
  */
242
- const da = L("PieChart", [
242
+ const ha = E("PieChart", [
243
243
  ["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }],
244
244
  ["path", { d: "M22 12A10 10 0 0 0 12 2v10z", key: "1rfc4y" }]
245
245
  ]);
@@ -249,7 +249,7 @@ const da = L("PieChart", [
249
249
  * This source code is licensed under the ISC license.
250
250
  * See the LICENSE file in the root directory of this source tree.
251
251
  */
252
- const rn = L("Play", [
252
+ const on = E("Play", [
253
253
  ["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
254
254
  ]);
255
255
  /**
@@ -258,7 +258,7 @@ const rn = L("Play", [
258
258
  * This source code is licensed under the ISC license.
259
259
  * See the LICENSE file in the root directory of this source tree.
260
260
  */
261
- const on = L("Plug2", [
261
+ const cn = E("Plug2", [
262
262
  ["path", { d: "M9 2v6", key: "17ngun" }],
263
263
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
264
264
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -271,7 +271,7 @@ const on = L("Plug2", [
271
271
  * This source code is licensed under the ISC license.
272
272
  * See the LICENSE file in the root directory of this source tree.
273
273
  */
274
- const cn = L("Save", [
274
+ const dn = E("Save", [
275
275
  [
276
276
  "path",
277
277
  {
@@ -288,7 +288,7 @@ const cn = L("Save", [
288
288
  * This source code is licensed under the ISC license.
289
289
  * See the LICENSE file in the root directory of this source tree.
290
290
  */
291
- const ha = L("ScatterChart", [
291
+ const ma = E("ScatterChart", [
292
292
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
293
293
  ["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
294
294
  ["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
@@ -302,7 +302,7 @@ const ha = L("ScatterChart", [
302
302
  * This source code is licensed under the ISC license.
303
303
  * See the LICENSE file in the root directory of this source tree.
304
304
  */
305
- const dn = L("ShieldQuestion", [
305
+ const hn = E("ShieldQuestion", [
306
306
  [
307
307
  "path",
308
308
  {
@@ -319,7 +319,7 @@ const dn = L("ShieldQuestion", [
319
319
  * This source code is licensed under the ISC license.
320
320
  * See the LICENSE file in the root directory of this source tree.
321
321
  */
322
- const hn = L("Sigma", [
322
+ const mn = E("Sigma", [
323
323
  ["path", { d: "M18 7V4H6l6 8-6 8h12v-3", key: "zis8ev" }]
324
324
  ]);
325
325
  /**
@@ -328,7 +328,7 @@ const hn = L("Sigma", [
328
328
  * This source code is licensed under the ISC license.
329
329
  * See the LICENSE file in the root directory of this source tree.
330
330
  */
331
- const mn = L("SwatchBook", [
331
+ const un = E("SwatchBook", [
332
332
  ["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
333
333
  ["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
334
334
  ["path", { d: "M 7 17h0.01", key: "10821z" }],
@@ -346,7 +346,7 @@ const mn = L("SwatchBook", [
346
346
  * This source code is licensed under the ISC license.
347
347
  * See the LICENSE file in the root directory of this source tree.
348
348
  */
349
- const un = L("Tag", [
349
+ const xn = E("Tag", [
350
350
  [
351
351
  "path",
352
352
  {
@@ -362,7 +362,7 @@ const un = L("Tag", [
362
362
  * This source code is licensed under the ISC license.
363
363
  * See the LICENSE file in the root directory of this source tree.
364
364
  */
365
- const xn = L("ToggleLeft", [
365
+ const pn = E("ToggleLeft", [
366
366
  ["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
367
367
  ["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
368
368
  ]);
@@ -372,7 +372,7 @@ const xn = L("ToggleLeft", [
372
372
  * This source code is licensed under the ISC license.
373
373
  * See the LICENSE file in the root directory of this source tree.
374
374
  */
375
- const pn = L("Type", [
375
+ const fn = E("Type", [
376
376
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
377
377
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
378
378
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
@@ -383,14 +383,14 @@ const pn = L("Type", [
383
383
  * This source code is licensed under the ISC license.
384
384
  * See the LICENSE file in the root directory of this source tree.
385
385
  */
386
- const fn = L("User", [
386
+ const gn = E("User", [
387
387
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
388
388
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
389
389
  ]);
390
- function gn() {
390
+ function jn() {
391
391
  const [s, n] = T(""), [a, t] = T(!1), [i, o] = T(!1), l = k((h) => h.dashboard);
392
392
  function c() {
393
- const h = Us(l), g = Ae(l.id), m = JSON.parse(localStorage.getItem(g) || "[]");
393
+ const h = Gs(l), g = Ee(l.id), m = JSON.parse(localStorage.getItem(g) || "[]");
394
394
  if (m.some(
395
395
  (N) => N.name === s
396
396
  )) {
@@ -410,7 +410,7 @@ function gn() {
410
410
  className: "h-7 p-2",
411
411
  size: "sm",
412
412
  children: [
413
- /* @__PURE__ */ e.jsx($s, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
413
+ /* @__PURE__ */ e.jsx(Ps, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
414
414
  "Add Lens"
415
415
  ]
416
416
  }
@@ -421,7 +421,7 @@ function gn() {
421
421
  /* @__PURE__ */ e.jsx(js, { children: "Lenses are private by default and are only visible to you." })
422
422
  ] }),
423
423
  /* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
424
- /* @__PURE__ */ e.jsx(R, { className: "text-right", children: "Name" }),
424
+ /* @__PURE__ */ e.jsx(B, { className: "text-right", children: "Name" }),
425
425
  /* @__PURE__ */ e.jsx(
426
426
  ae,
427
427
  {
@@ -435,7 +435,7 @@ function gn() {
435
435
  )
436
436
  ] }) }),
437
437
  a && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The bookmark name already exists. Use a differnet name." }),
438
- /* @__PURE__ */ e.jsx(Ks, { children: /* @__PURE__ */ e.jsx(
438
+ /* @__PURE__ */ e.jsx(Us, { children: /* @__PURE__ */ e.jsx(
439
439
  z,
440
440
  {
441
441
  variant: "outline",
@@ -448,14 +448,14 @@ function gn() {
448
448
  ] })
449
449
  ] });
450
450
  }
451
- function jn() {
451
+ function bn() {
452
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
453
  (d) => d.actions.setFilterValues
454
454
  ), m = k(
455
455
  (d) => d.actions.setBookmarkKey
456
456
  );
457
457
  K(() => {
458
- const d = Ae(i.id), x = JSON.parse(localStorage.getItem(d) || "[]");
458
+ const d = Ee(i.id), x = JSON.parse(localStorage.getItem(d) || "[]");
459
459
  c(x);
460
460
  const f = x.find(
461
461
  (w) => w.default
@@ -469,25 +469,25 @@ function jn() {
469
469
  f && (h(f), g(x.filterValues || []), m(d === "Original" ? "" : d)), t(d);
470
470
  }
471
471
  function N(d) {
472
- const x = Ae(i.id), w = JSON.parse(localStorage.getItem(x) || "[]").filter(
472
+ const x = Ee(i.id), w = JSON.parse(localStorage.getItem(x) || "[]").filter(
473
473
  (b) => b.name !== d
474
474
  );
475
475
  localStorage.setItem(x, JSON.stringify(w)), c(w);
476
476
  }
477
- return /* @__PURE__ */ e.jsxs(Ia, { open: s, onOpenChange: n, children: [
478
- /* @__PURE__ */ e.jsx(qa, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Yt, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
479
- /* @__PURE__ */ e.jsxs(Va, { className: "w-56", children: [
480
- /* @__PURE__ */ e.jsx(Ra, { children: "Lenses" }),
481
- /* @__PURE__ */ e.jsx(_a, {}),
477
+ return /* @__PURE__ */ e.jsxs(Va, { open: s, onOpenChange: n, children: [
478
+ /* @__PURE__ */ e.jsx(qa, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
479
+ /* @__PURE__ */ e.jsxs(Ra, { className: "w-56", children: [
480
+ /* @__PURE__ */ e.jsx(_a, { children: "Lenses" }),
481
+ /* @__PURE__ */ e.jsx(Ha, {}),
482
482
  /* @__PURE__ */ e.jsxs(
483
- Ha,
483
+ Ba,
484
484
  {
485
485
  value: a,
486
486
  onValueChange: u,
487
487
  children: [
488
- /* @__PURE__ */ e.jsx(Os, { value: "Original", children: "Original" }),
488
+ /* @__PURE__ */ e.jsx(Ts, { value: "Original", children: "Original" }),
489
489
  l.filter((d) => d.name != "Original").map((d, x) => /* @__PURE__ */ e.jsxs(
490
- Os,
490
+ Ts,
491
491
  {
492
492
  className: "xbg-red-100 flex justify-between",
493
493
  value: d.name,
@@ -495,7 +495,7 @@ function jn() {
495
495
  children: [
496
496
  /* @__PURE__ */ e.jsx("p", { children: d.name }),
497
497
  /* @__PURE__ */ e.jsx(
498
- Re,
498
+ _e,
499
499
  {
500
500
  onClick: (f) => {
501
501
  f.preventDefault(), N(d.name);
@@ -514,14 +514,14 @@ function jn() {
514
514
  ] })
515
515
  ] });
516
516
  }
517
- function bn() {
517
+ function yn() {
518
518
  const [s, n] = T(!1), a = k((o) => o.dashboard), t = k((o) => o.bookmarkKey);
519
519
  K(() => {
520
520
  if (!t) {
521
521
  n(!1);
522
522
  return;
523
523
  }
524
- const o = Ae(a.id), c = JSON.parse(
524
+ const o = Ee(a.id), c = JSON.parse(
525
525
  localStorage.getItem(o) || "[]"
526
526
  ).find(
527
527
  (h) => h.name === t
@@ -531,14 +531,14 @@ function bn() {
531
531
  function i(o) {
532
532
  if (n(o), !t)
533
533
  return;
534
- const l = Ae(a.id), h = JSON.parse(
534
+ const l = Ee(a.id), h = JSON.parse(
535
535
  localStorage.getItem(l) || "[]"
536
536
  ).map((g) => (g.name === t ? g.default = o : g.default = !1, g));
537
537
  console.log(h), localStorage.setItem(l, JSON.stringify(h));
538
538
  }
539
539
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
540
540
  /* @__PURE__ */ e.jsx(
541
- $e,
541
+ Ke,
542
542
  {
543
543
  checked: s,
544
544
  onCheckedChange: i,
@@ -555,7 +555,7 @@ function bn() {
555
555
  )
556
556
  ] });
557
557
  }
558
- function yn() {
558
+ function vn() {
559
559
  const s = k((b) => b.bookmarkKey), n = k((b) => b.dashboard);
560
560
  k((b) => b.selectedSheetId);
561
561
  const a = k(
@@ -586,19 +586,19 @@ function yn() {
586
586
  type: "bar",
587
587
  sql: "select COUNT(*) from YOUR_TABLE",
588
588
  data: []
589
- }, E = {
589
+ }, L = {
590
590
  id: We(),
591
591
  cards: [b],
592
592
  activeCardId: b.id
593
593
  };
594
- h(d.id, E), g(E.id);
594
+ h(d.id, L), g(L.id);
595
595
  }, f = () => {
596
596
  u(!0);
597
597
  };
598
598
  function w() {
599
599
  if (!s || s === "")
600
600
  return;
601
- const b = Us(n), E = Ae(n.id), C = JSON.parse(localStorage.getItem(E) || "[]"), O = C.findIndex(
601
+ const b = Gs(n), L = Ee(n.id), C = JSON.parse(localStorage.getItem(L) || "[]"), O = C.findIndex(
602
602
  (j) => j.name === s
603
603
  );
604
604
  O !== -1 ? C[O] = {
@@ -610,7 +610,7 @@ function yn() {
610
610
  name: s,
611
611
  template: b,
612
612
  filterValues: t
613
- }), localStorage.setItem(E, JSON.stringify(C)), l == null || l(b);
613
+ }), localStorage.setItem(L, JSON.stringify(C)), l == null || l(b);
614
614
  }
615
615
  return i ? null : /* @__PURE__ */ e.jsxs(
616
616
  "div",
@@ -619,15 +619,15 @@ function yn() {
619
619
  role: "dashboard-controls",
620
620
  children: [
621
621
  !i && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
622
- /* @__PURE__ */ e.jsx(R, { children: s }),
622
+ /* @__PURE__ */ e.jsx(B, { children: s }),
623
623
  !!s && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
624
624
  /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground", children: "|" }),
625
- /* @__PURE__ */ e.jsx(bn, {})
625
+ /* @__PURE__ */ e.jsx(yn, {})
626
626
  ] })
627
627
  ] }),
628
628
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
629
- a && !i && /* @__PURE__ */ e.jsx(gn, {}),
630
- !i && /* @__PURE__ */ e.jsx(jn, {}),
629
+ a && !i && /* @__PURE__ */ e.jsx(jn, {}),
630
+ !i && /* @__PURE__ */ e.jsx(bn, {}),
631
631
  a && !i && /* @__PURE__ */ e.jsxs(
632
632
  z,
633
633
  {
@@ -637,7 +637,7 @@ function yn() {
637
637
  disabled: !a,
638
638
  onClick: x,
639
639
  children: [
640
- /* @__PURE__ */ e.jsx($s, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
640
+ /* @__PURE__ */ e.jsx(Ps, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
641
641
  "Add Frame"
642
642
  ]
643
643
  }
@@ -649,7 +649,7 @@ function yn() {
649
649
  className: "h-7 p-2",
650
650
  onClick: f,
651
651
  size: "sm",
652
- children: /* @__PURE__ */ e.jsx(ca, { className: "h-4 w-4", strokeWidth: 1.5 })
652
+ children: /* @__PURE__ */ e.jsx(da, { className: "h-4 w-4", strokeWidth: 1.5 })
653
653
  }
654
654
  ),
655
655
  a && !i && /* @__PURE__ */ e.jsx(
@@ -662,7 +662,7 @@ function yn() {
662
662
  u(!1), N(!1);
663
663
  },
664
664
  size: "sm",
665
- children: /* @__PURE__ */ e.jsx(Re, { className: "h-4 w-4", strokeWidth: 1.5 })
665
+ children: /* @__PURE__ */ e.jsx(_e, { className: "h-4 w-4", strokeWidth: 1.5 })
666
666
  }
667
667
  ),
668
668
  a && !i && /* @__PURE__ */ e.jsx(
@@ -672,7 +672,7 @@ function yn() {
672
672
  variant: "outline",
673
673
  onClick: w,
674
674
  size: "sm",
675
- children: /* @__PURE__ */ e.jsx(cn, { className: "h-4 w-4", strokeWidth: 1.5 })
675
+ children: /* @__PURE__ */ e.jsx(dn, { className: "h-4 w-4", strokeWidth: 1.5 })
676
676
  }
677
677
  ),
678
678
  !o && !i && a && /* @__PURE__ */ e.jsx(
@@ -682,7 +682,7 @@ function yn() {
682
682
  variant: "outline",
683
683
  onClick: () => c(!0),
684
684
  size: "sm",
685
- children: /* @__PURE__ */ e.jsx(ia, { className: "h-4 w-4", strokeWidth: 1.5 })
685
+ children: /* @__PURE__ */ e.jsx(oa, { className: "h-4 w-4", strokeWidth: 1.5 })
686
686
  }
687
687
  ),
688
688
  !i && a && !1,
@@ -707,36 +707,36 @@ function Qe({
707
707
  const m = t ? "Loading..." : i ? "Error" : a;
708
708
  function u() {
709
709
  if (s === "Connection")
710
- return /* @__PURE__ */ e.jsx(on, { className: "size-4 rotate-90" });
710
+ return /* @__PURE__ */ e.jsx(cn, { className: "size-4 rotate-90" });
711
711
  if (s === "Database")
712
- return /* @__PURE__ */ e.jsx(Qt, { className: "size-4" });
712
+ return /* @__PURE__ */ e.jsx(Wt, { className: "size-4" });
713
713
  if (s === "Schema")
714
- return /* @__PURE__ */ e.jsx(ln, { className: "size-4" });
714
+ return /* @__PURE__ */ e.jsx(rn, { className: "size-4" });
715
715
  if (s === "Table")
716
716
  return /* @__PURE__ */ e.jsx(vs, { className: "size-4" });
717
717
  }
718
718
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
719
719
  h && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(bs, { children: [
720
- /* @__PURE__ */ e.jsx(Ps, { children: u() }),
720
+ /* @__PURE__ */ e.jsx(Js, { children: u() }),
721
721
  /* @__PURE__ */ e.jsx(ys, { className: "text-xs", align: "start", children: o })
722
722
  ] }) : u() }),
723
- /* @__PURE__ */ e.jsxs(Fe, { disabled: g, value: m, onValueChange: l, children: [
723
+ /* @__PURE__ */ e.jsxs(Oe, { disabled: g, value: m, onValueChange: l, children: [
724
724
  /* @__PURE__ */ e.jsx(
725
- Oe,
725
+ Me,
726
726
  {
727
727
  className: W(
728
728
  "h-9 w-full focus:ring-1 focus:ring-offset-0",
729
729
  c
730
730
  ),
731
731
  children: /* @__PURE__ */ e.jsx(
732
- Me,
732
+ Te,
733
733
  {
734
734
  placeholder: t ? "Loading..." : i ? "Error" : `Select ${s}`
735
735
  }
736
736
  )
737
737
  }
738
738
  ),
739
- /* @__PURE__ */ e.jsx(Te, { children: /* @__PURE__ */ e.jsxs(_e, { children: [
739
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
740
740
  t ? /* @__PURE__ */ e.jsx(Le, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Le, { children: s }),
741
741
  /* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((N, d) => /* @__PURE__ */ e.jsx(X, { value: N.id, children: N.name }, d)) }),
742
742
  (t || i) && /* @__PURE__ */ e.jsx(X, { value: m, children: m })
@@ -744,24 +744,24 @@ function Qe({
744
744
  ] })
745
745
  ] });
746
746
  }
747
- function vn({ column: s }) {
747
+ function Nn({ column: s }) {
748
748
  const [n, a] = T(!1), t = r((m) => m.selectedTableName), i = r(
749
749
  (m) => m.selectedSchemaName
750
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
751
  function g(m, u) {
752
- const N = Gs(m, o, u);
752
+ const N = Qs(m, o, u);
753
753
  l(N);
754
- const d = Js(
754
+ const d = Ws(
755
755
  N,
756
756
  he(i || ""),
757
757
  he(t)
758
758
  );
759
759
  d && (c(d), h(!0)), a(!1);
760
760
  }
761
- return /* @__PURE__ */ e.jsxs(Ke, { open: n, onOpenChange: a, children: [
762
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ba, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
761
+ return /* @__PURE__ */ e.jsxs(Pe, { open: n, onOpenChange: a, children: [
762
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx($a, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
763
763
  /* @__PURE__ */ e.jsx(
764
- Pe,
764
+ Ge,
765
765
  {
766
766
  align: "center",
767
767
  className: "w-18 rounded-md p-0 shadow-none",
@@ -811,19 +811,19 @@ function vn({ column: s }) {
811
811
  )
812
812
  ] });
813
813
  }
814
- function ma({ column: s }) {
814
+ function ua({ column: s }) {
815
815
  return /* @__PURE__ */ e.jsxs(bs, { children: [
816
- /* @__PURE__ */ e.jsx($a, { asChild: !0, children: Ka.includes(s.data_type.toLowerCase()) ? (
816
+ /* @__PURE__ */ e.jsx(Ka, { asChild: !0, children: Pa.includes(s.data_type.toLowerCase()) ? (
817
817
  // <span className=" font-thin">T</span>
818
- /* @__PURE__ */ e.jsx(pn, { className: "size-3" })
819
- ) : Qs.includes(s.data_type.toLowerCase()) ? (
818
+ /* @__PURE__ */ e.jsx(fn, { className: "size-3" })
819
+ ) : Ys.includes(s.data_type.toLowerCase()) ? (
820
820
  //
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" }) }),
821
+ /* @__PURE__ */ e.jsx(en, { className: "size-3" })
822
+ ) : Ua.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Ga, { className: "size-3" }) : Ja.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(pn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(hn, { className: "size-3" }) }),
823
823
  /* @__PURE__ */ e.jsx(ys, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
824
824
  ] });
825
825
  }
826
- function Nn({
826
+ function Cn({
827
827
  schemaName: s,
828
828
  tableName: n,
829
829
  columns: a,
@@ -839,11 +839,11 @@ function Nn({
839
839
  (j) => j.dashboard.aiScopeTables
840
840
  ), { setAIScopeTables: m } = k((j) => j.actions), u = r((j) => j.actions.setRunSql), N = r((j) => j.actions.setSqlGen), d = r(
841
841
  (j) => j.actions.setIsShowingVisual
842
- ), x = r((j) => j.actions.setCardSql), { connectionType: f } = ua();
842
+ ), x = r((j) => j.actions.setCardSql), { connectionType: f } = xa();
843
843
  function w(j) {
844
- const F = Gs(j, i);
844
+ const F = Qs(j, i);
845
845
  N(F);
846
- const A = Js(F, he(s), he(n));
846
+ const A = Ws(F, he(s), he(n));
847
847
  A && (x(A), u(!0));
848
848
  }
849
849
  function b() {
@@ -851,7 +851,7 @@ function Nn({
851
851
  (j) => j.connectinonId === o && j.tableName === h
852
852
  )) !== void 0;
853
853
  }
854
- function E(j) {
854
+ function L(j) {
855
855
  if (j === !0 && h && o) {
856
856
  const F = {
857
857
  connectinonId: o,
@@ -859,12 +859,12 @@ function Nn({
859
859
  databaseName: l,
860
860
  schemaName: c,
861
861
  tableName: h
862
- }, q = [...g || [], F].filter(
863
- (Y, $, U) => U.findIndex(
862
+ }, V = [...g || [], F].filter(
863
+ (Y, $, P) => P.findIndex(
864
864
  (D) => D.connectinonId === Y.connectinonId && D.tableName === Y.tableName
865
865
  ) === $
866
866
  );
867
- m(q), Ts.success(`Added '${h}' to AI Scope`, {
867
+ m(V), Es.success(`Added '${h}' to AI Scope`, {
868
868
  position: "top-right",
869
869
  duration: 2500,
870
870
  richColors: !0
@@ -873,7 +873,7 @@ function Nn({
873
873
  const F = (g || []).filter(
874
874
  (A) => A.connectinonId !== o && A.tableName !== h
875
875
  );
876
- m(F), Ts(`Removed '${h}' from AI Scope`, {
876
+ m(F), Es(`Removed '${h}' from AI Scope`, {
877
877
  position: "top-right",
878
878
  duration: 2e3,
879
879
  richColors: !0
@@ -882,24 +882,24 @@ function Nn({
882
882
  }
883
883
  function C() {
884
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);
885
+ ((V) => V.charAt(0) === V.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1), x(`SELECT * FROM ${F} LIMIT 10`), u(!0);
886
886
  }
887
887
  function O() {
888
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);
889
+ ((V) => V.charAt(0) === V.charAt(0).toUpperCase())(n) && (F = `"${n}"`), d(!1), x(`SELECT COUNT(*) FROM ${F}`), u(!0);
890
890
  }
891
891
  return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
892
892
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
893
893
  /* @__PURE__ */ e.jsx(
894
- Ws,
894
+ Xs,
895
895
  {
896
896
  title: `${b() ? "Remove from" : "Add to"} AI Scope`,
897
897
  pressed: b(),
898
- onPressedChange: E,
898
+ onPressedChange: L,
899
899
  variant: "outline",
900
900
  className: "h-9 px-2",
901
901
  children: /* @__PURE__ */ e.jsx(
902
- Ja,
902
+ Qa,
903
903
  {
904
904
  className: W("size-4", {
905
905
  "text-primary": b(),
@@ -918,7 +918,7 @@ function Nn({
918
918
  variant: "secondary",
919
919
  className: "flex",
920
920
  children: [
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" }),
921
+ t !== "Success" ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(un, { className: "mr-2 size-4" }),
922
922
  "Top 10"
923
923
  ]
924
924
  }
@@ -932,7 +932,7 @@ function Nn({
932
932
  variant: "secondary",
933
933
  className: "flex",
934
934
  children: [
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" }),
935
+ t !== "Success" ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(mn, { className: "mr-2 size-4" }),
936
936
  "Count"
937
937
  ]
938
938
  }
@@ -950,35 +950,35 @@ function Nn({
950
950
  className: W(
951
951
  "mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
952
952
  {
953
- "bg-muted": Qa(j, i)
953
+ "bg-muted": Wa(j, i)
954
954
  }
955
955
  ),
956
956
  children: [
957
957
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
958
- /* @__PURE__ */ e.jsx(ma, { column: j }),
958
+ /* @__PURE__ */ e.jsx(ua, { column: j }),
959
959
  /* @__PURE__ */ e.jsx("span", { children: j.column_name })
960
960
  ] }),
961
- Qs.includes(j.data_type) && /* @__PURE__ */ e.jsx(
961
+ Ys.includes(j.data_type) && /* @__PURE__ */ e.jsx(
962
962
  "div",
963
963
  {
964
964
  onClick: (F) => F.stopPropagation(),
965
965
  className: "flex items-center justify-end",
966
- children: /* @__PURE__ */ e.jsx(vn, { column: j })
966
+ children: /* @__PURE__ */ e.jsx(Nn, { column: j })
967
967
  }
968
968
  )
969
969
  ]
970
970
  },
971
971
  j.column_name
972
972
  )),
973
- /* @__PURE__ */ e.jsx(Ms, { orientation: "vertical" }),
974
- /* @__PURE__ */ e.jsx(Ms, { orientation: "horizontal" })
973
+ /* @__PURE__ */ e.jsx(As, { orientation: "vertical" }),
974
+ /* @__PURE__ */ e.jsx(As, { orientation: "horizontal" })
975
975
  ]
976
976
  }
977
977
  )
978
978
  ] });
979
979
  }
980
- function ua(s, n) {
981
- var ss, ve, Je, Ie;
980
+ function xa(s, n) {
981
+ var ss, ve, Je, Ve;
982
982
  let a = Ut(() => [], []);
983
983
  const t = es().authToken || s, i = r(
984
984
  (S) => S.selectedConnectionId
@@ -1008,11 +1008,11 @@ function ua(s, n) {
1008
1008
  }
1009
1009
  const {
1010
1010
  data: b,
1011
- isLoading: E,
1011
+ isLoading: L,
1012
1012
  isError: C
1013
1013
  } = Ce({
1014
1014
  queryKey: ["connections"],
1015
- queryFn: () => we(
1015
+ queryFn: () => ze(
1016
1016
  "https://semaphor.cloud/api/v1/connections",
1017
1017
  (t == null ? void 0 : t.accessToken) || ""
1018
1018
  ),
@@ -1022,13 +1022,13 @@ function ua(s, n) {
1022
1022
  (S) => S.id === i
1023
1023
  ), j = O == null ? void 0 : O.type, F = (O == null ? void 0 : O.type) === "API" || (O == null ? void 0 : O.type) === "S3", {
1024
1024
  data: A,
1025
- isLoading: q,
1025
+ isLoading: V,
1026
1026
  isFetching: Y,
1027
1027
  isError: $,
1028
- refetch: U
1028
+ refetch: P
1029
1029
  } = Ce({
1030
1030
  queryKey: ["databases", i],
1031
- queryFn: () => we(
1031
+ queryFn: () => ze(
1032
1032
  "https://semaphor.cloud/api/v1/databases",
1033
1033
  (t == null ? void 0 : t.accessToken) || "",
1034
1034
  {
@@ -1045,7 +1045,7 @@ function ua(s, n) {
1045
1045
  refetch: Z
1046
1046
  } = Ce({
1047
1047
  queryKey: ["schemas", i, o],
1048
- queryFn: () => we(
1048
+ queryFn: () => ze(
1049
1049
  "https://semaphor.cloud/api/v1/schemas",
1050
1050
  (t == null ? void 0 : t.accessToken) || "",
1051
1051
  {
@@ -1056,7 +1056,7 @@ function ua(s, n) {
1056
1056
  enabled: !!i && !!o && !F && o !== "NA"
1057
1057
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1058
1058
  }), {
1059
- data: P,
1059
+ data: U,
1060
1060
  isLoading: I,
1061
1061
  isFetching: y,
1062
1062
  isError: v,
@@ -1068,7 +1068,7 @@ function ua(s, n) {
1068
1068
  o,
1069
1069
  l
1070
1070
  ],
1071
- queryFn: () => we(
1071
+ queryFn: () => ze(
1072
1072
  "https://semaphor.cloud/api/v1/tables",
1073
1073
  (t == null ? void 0 : t.accessToken) || "",
1074
1074
  {
@@ -1079,7 +1079,7 @@ function ua(s, n) {
1079
1079
  ),
1080
1080
  enabled: x(j)
1081
1081
  }), {
1082
- data: V,
1082
+ data: H,
1083
1083
  isLoading: ue,
1084
1084
  isFetching: se,
1085
1085
  isError: ge
@@ -1091,7 +1091,7 @@ function ua(s, n) {
1091
1091
  l,
1092
1092
  c
1093
1093
  ],
1094
- queryFn: () => we(
1094
+ queryFn: () => ze(
1095
1095
  "https://semaphor.cloud/api/v1/columns",
1096
1096
  (t == null ? void 0 : t.accessToken) || "",
1097
1097
  {
@@ -1112,7 +1112,7 @@ function ua(s, n) {
1112
1112
  });
1113
1113
  K(() => {
1114
1114
  h(a);
1115
- }, [V, h, a]), K(() => {
1115
+ }, [H, h, a]), K(() => {
1116
1116
  }, [
1117
1117
  F,
1118
1118
  d,
@@ -1131,7 +1131,7 @@ function ua(s, n) {
1131
1131
  function ne(S) {
1132
1132
  g(S);
1133
1133
  }
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) => ({
1134
+ A && ((ve = A == null ? void 0 : A.databases) == null ? void 0 : ve.length) > 0, D && ((Je = D == null ? void 0 : D.schemas) == null ? void 0 : Je.length) > 0, H && ((Ve = H == null ? void 0 : H.columns) == null ? void 0 : Ve.length) > 0 && (a = H.columns.map((S) => ({
1135
1135
  ...S,
1136
1136
  data_type: S.data_type.toLowerCase()
1137
1137
  }))), $ && (a = []), (ge || C) && (a = []);
@@ -1147,21 +1147,21 @@ function ua(s, n) {
1147
1147
  })), re = D == null ? void 0 : D.schemas.map((S) => ({
1148
1148
  id: S.schema_name,
1149
1149
  name: S.schema_name
1150
- })), De = P == null ? void 0 : P.tables.map((S) => ({
1150
+ })), Ie = U == null ? void 0 : U.tables.map((S) => ({
1151
1151
  id: S.table_name,
1152
1152
  name: S.table_name
1153
1153
  }));
1154
1154
  return {
1155
1155
  connectionItems: le,
1156
- isConnectionsLoading: E,
1156
+ isConnectionsLoading: L,
1157
1157
  isConnectionsError: C,
1158
1158
  databaseItems: ye,
1159
- isDatabasesLoadingOrFetching: q || Y,
1159
+ isDatabasesLoadingOrFetching: V || Y,
1160
1160
  isDatabaseError: $,
1161
1161
  schemaItems: re,
1162
1162
  isSchemaLoadingOrFetching: te || J,
1163
1163
  isSchemaError: ee,
1164
- tableItems: De,
1164
+ tableItems: Ie,
1165
1165
  isTableLoadingOrFetching: I || y,
1166
1166
  isTableError: v,
1167
1167
  columns: a,
@@ -1176,10 +1176,10 @@ function ua(s, n) {
1176
1176
  handleSchemaChange: xe
1177
1177
  };
1178
1178
  }
1179
- function xa({
1179
+ function pa({
1180
1180
  ColumnsComponent: s
1181
1181
  }) {
1182
- var P;
1182
+ var U;
1183
1183
  const n = r(
1184
1184
  (I) => I.selectedConnectionId
1185
1185
  ), a = r(
@@ -1201,25 +1201,25 @@ function xa({
1201
1201
  isSchemaLoadingOrFetching: f,
1202
1202
  isSchemaError: w,
1203
1203
  isColumnsError: b,
1204
- isColumnsLoadingOrFetching: E,
1204
+ isColumnsLoadingOrFetching: L,
1205
1205
  isTableLoadingOrFetching: C,
1206
1206
  isTableError: O,
1207
1207
  connectionType: j,
1208
1208
  isNonDbConnection: F,
1209
1209
  handleConnectionChange: A,
1210
- handleDatabaseChange: q,
1210
+ handleDatabaseChange: V,
1211
1211
  handleSchemaChange: Y,
1212
1212
  tableName: $,
1213
- schemaName: U
1214
- } = ua();
1213
+ schemaName: P
1214
+ } = xa();
1215
1215
  function D() {
1216
- return s ? s(U, $, m) : /* @__PURE__ */ e.jsx(
1217
- Nn,
1216
+ return s ? s(P, $, m) : /* @__PURE__ */ e.jsx(
1217
+ Cn,
1218
1218
  {
1219
- schemaName: U,
1219
+ schemaName: P,
1220
1220
  tableName: $,
1221
1221
  columns: m,
1222
- status: E ? "Loading..." : b ? "Error" : "Success"
1222
+ status: L ? "Loading..." : b ? "Error" : "Success"
1223
1223
  }
1224
1224
  );
1225
1225
  }
@@ -1230,7 +1230,7 @@ function xa({
1230
1230
  return j === "S3" || j === "API" ? null : /* @__PURE__ */ e.jsx(
1231
1231
  Qe,
1232
1232
  {
1233
- onChange: q,
1233
+ onChange: V,
1234
1234
  isError: x,
1235
1235
  isLoading: d,
1236
1236
  items: h,
@@ -1276,9 +1276,9 @@ function xa({
1276
1276
  onChange: A,
1277
1277
  isLoading: u,
1278
1278
  isError: N,
1279
- connectionTooltip: ((P = l == null ? void 0 : l.find(
1279
+ connectionTooltip: ((U = l == null ? void 0 : l.find(
1280
1280
  (I) => I.id === n
1281
- )) == null ? void 0 : P.type) || ""
1281
+ )) == null ? void 0 : U.type) || ""
1282
1282
  }
1283
1283
  ),
1284
1284
  J(),
@@ -1294,14 +1294,14 @@ function xa({
1294
1294
  variant: "secondary",
1295
1295
  className: "w-full",
1296
1296
  children: [
1297
- /* @__PURE__ */ e.jsx(nn, { className: "mr-2 size-4" }),
1297
+ /* @__PURE__ */ e.jsx(ln, { className: "mr-2 size-4" }),
1298
1298
  "Help"
1299
1299
  ]
1300
1300
  }
1301
1301
  ) })
1302
1302
  ] });
1303
1303
  }
1304
- function Cn(s) {
1304
+ function Sn(s) {
1305
1305
  const n = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), t = s.toUpperCase().indexOf("LIMIT"), i = s.toUpperCase().indexOf("ORDER BY");
1306
1306
  let o = s.length;
1307
1307
  if (i !== -1 && (o = i), t !== -1 && t < o && (o = t), n !== -1) {
@@ -1317,15 +1317,15 @@ function Cn(s) {
1317
1317
  return `${l} {{ filters | where }} ${c}`;
1318
1318
  }
1319
1319
  }
1320
- function Sn({
1320
+ function kn({
1321
1321
  error: s,
1322
1322
  setShowAIDialog: n,
1323
1323
  setUserInputforAI: a,
1324
1324
  setTriggerAIRun: t
1325
1325
  }) {
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: [
1326
+ return /* @__PURE__ */ e.jsxs(Zs, { openDelay: 0, children: [
1327
+ /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Qt, { className: "h-4 w-4 text-red-500" }) }) }),
1328
+ /* @__PURE__ */ e.jsx(sa, { align: "start", className: " min-w-fit max-w-[500px]", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grow space-y-1 flex flex-col ", children: [
1329
1329
  /* @__PURE__ */ e.jsxs(
1330
1330
  z,
1331
1331
  {
@@ -1335,7 +1335,7 @@ function Sn({
1335
1335
  size: "sm",
1336
1336
  variant: "outline",
1337
1337
  children: [
1338
- /* @__PURE__ */ e.jsx(Xt, { className: "h-4 w-4 mr-2" }),
1338
+ /* @__PURE__ */ e.jsx(Zt, { className: "h-4 w-4 mr-2" }),
1339
1339
  "Fix It"
1340
1340
  ]
1341
1341
  }
@@ -1344,27 +1344,27 @@ function Sn({
1344
1344
  ] }) }) })
1345
1345
  ] });
1346
1346
  }
1347
- function kn({
1347
+ function wn({
1348
1348
  text: s,
1349
1349
  onCheckedChange: n,
1350
1350
  checked: a
1351
1351
  }) {
1352
1352
  return /* @__PURE__ */ e.jsxs("div", { className: "xbg-red-100 ml-6 flex items-center gap-2", children: [
1353
- /* @__PURE__ */ e.jsx($e, { checked: a, onCheckedChange: n }),
1353
+ /* @__PURE__ */ e.jsx(Ke, { checked: a, onCheckedChange: n }),
1354
1354
  /* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
1355
1355
  ] });
1356
1356
  }
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);
1357
+ function zn() {
1358
+ const { authToken: s } = es(), n = $e(null), a = r((c) => c.applyFilters), [t, i] = T(""), o = r((c) => c.filterValues), l = r((c) => c.card.sql);
1359
1359
  return /* @__PURE__ */ e.jsxs(
1360
- Ys,
1360
+ Zs,
1361
1361
  {
1362
1362
  openDelay: 0,
1363
1363
  onOpenChange: async (c) => {
1364
1364
  if (!c)
1365
1365
  return;
1366
1366
  console.log("onOpenChange");
1367
- const h = await ea(
1367
+ const h = await aa(
1368
1368
  "https://semaphor.cloud/api/v1/filter-sql",
1369
1369
  (s == null ? void 0 : s.accessToken) || "",
1370
1370
  {
@@ -1375,20 +1375,20 @@ function wn() {
1375
1375
  console.log(h), h.sql ? (console.log(h.records), i(h.sql)) : i("Error");
1376
1376
  },
1377
1377
  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: [
1378
+ /* @__PURE__ */ e.jsx(ea, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
1379
+ /* @__PURE__ */ e.jsxs(sa, { align: "end", className: "w-[600px]", children: [
1380
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: [
1381
1381
  t,
1382
1382
  /* @__PURE__ */ e.jsx(
1383
- sa,
1383
+ ta,
1384
1384
  {
1385
- onClick: () => Wa(n),
1385
+ onClick: () => Ya(n),
1386
1386
  className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
1387
1387
  }
1388
1388
  )
1389
1389
  ] }) }) }),
1390
1390
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
1391
- /* @__PURE__ */ e.jsx(Ya, { className: "h-4 w-4 opacity-70" }),
1391
+ /* @__PURE__ */ e.jsx(Xa, { className: "h-4 w-4 opacity-70" }),
1392
1392
  /* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "A preview of the query with filters applied." })
1393
1393
  ] })
1394
1394
  ] })
@@ -1396,7 +1396,7 @@ function wn() {
1396
1396
  }
1397
1397
  );
1398
1398
  }
1399
- const zn = `
1399
+ const Fn = `
1400
1400
 
1401
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.
1402
1402
 
@@ -1443,7 +1443,7 @@ SELECT label, measure FROM table
1443
1443
  - Label - Category
1444
1444
  - Measure - Number
1445
1445
  `;
1446
- function Fn({
1446
+ function On({
1447
1447
  open: s,
1448
1448
  setOpen: n,
1449
1449
  userInput: a,
@@ -1451,17 +1451,17 @@ function Fn({
1451
1451
  triggerAIRun: i,
1452
1452
  setTriggerAIRun: o
1453
1453
  }) {
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 = `
1454
+ const l = $e(null), c = $e(null), { authToken: h } = es(), [g, m] = T(!1), u = r((y) => y.actions.setCardSql), N = k((y) => y.dashboard.baseQueries), d = r((y) => y.actions.setRunSql), x = r((y) => y.actions.setCardType), [f, w] = T([]), b = r((y) => y.currentColumns), L = r((y) => y.card.sql), C = r((y) => y.selectedTableName), O = `
1455
1455
  ${a}
1456
1456
 
1457
1457
  Database Query Dialect: ${C === "api" || C === "s3" ? "DuckDb" : ""}
1458
1458
  Table Name: ${C}
1459
1459
  Table Columns: ${b == null ? void 0 : b.map((y) => `${y.column_name} | ${y.data_type}`).join(", ")}
1460
- User SQL: ${E}
1460
+ User SQL: ${L}
1461
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({
1462
+ Visual Query Syntax: ${Fn}`, { data: F, isLoading: A, isFetching: V, isError: Y, refetch: $ } = Ce({
1463
1463
  queryKey: ["ai-query"],
1464
- queryFn: () => we(
1464
+ queryFn: () => ze(
1465
1465
  "https://semaphor.cloud/api/v1/ai",
1466
1466
  (h == null ? void 0 : h.accessToken) || "",
1467
1467
  {
@@ -1471,7 +1471,7 @@ function Fn({
1471
1471
  enabled: !1
1472
1472
  // Do not run by default.
1473
1473
  });
1474
- function U(y) {
1474
+ function P(y) {
1475
1475
  if (y.toLowerCase().includes("bar"))
1476
1476
  x("bar");
1477
1477
  else if (y.toLowerCase().includes("line"))
@@ -1505,7 +1505,7 @@ function Fn({
1505
1505
  return () => clearTimeout(y);
1506
1506
  }, [f]);
1507
1507
  function D() {
1508
- a && (w((y) => [...y, { role: "user", content: a }]), U(a) && m(!0), t(""), $());
1508
+ a && (w((y) => [...y, { role: "user", content: a }]), P(a) && m(!0), t(""), $());
1509
1509
  }
1510
1510
  K(() => {
1511
1511
  i && (D(), o(!1));
@@ -1542,17 +1542,17 @@ function Fn({
1542
1542
  pre: ({ node: y, ...v }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: J, children: [
1543
1543
  /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: v.children }),
1544
1544
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1545
- /* @__PURE__ */ e.jsx(z, { onClick: P, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(sa, {}) }),
1545
+ /* @__PURE__ */ e.jsx(z, { onClick: U, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ta, {}) }),
1546
1546
  /* @__PURE__ */ e.jsx(
1547
1547
  z,
1548
1548
  {
1549
1549
  onClick: (M) => {
1550
- const V = P(M);
1551
- V && (n(!1), u(V), d(!0));
1550
+ const H = U(M);
1551
+ H && (n(!1), u(H), d(!0));
1552
1552
  },
1553
1553
  size: "sm",
1554
1554
  variant: "outline",
1555
- children: /* @__PURE__ */ e.jsx(et, {})
1555
+ children: /* @__PURE__ */ e.jsx(st, {})
1556
1556
  }
1557
1557
  )
1558
1558
  ] })
@@ -1560,12 +1560,12 @@ function Fn({
1560
1560
  li: ({ node: y, ...v }) => /* @__PURE__ */ e.jsx("li", { style: ee, ...v })
1561
1561
  // You can add more overrides for other elements like h1, h2, etc.
1562
1562
  };
1563
- function P(y) {
1563
+ function U(y) {
1564
1564
  const v = y.currentTarget.closest("pre");
1565
1565
  if (!v)
1566
1566
  return;
1567
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;
1568
+ return navigator.clipboard.writeText(M).then(() => console.log("Text copied to clipboard")).catch((H) => console.error("Error in copying text: ", H)), M;
1569
1569
  }
1570
1570
  function I() {
1571
1571
  return f == null ? void 0 : f.map((y, v) => y.role === "user" ? /* @__PURE__ */ e.jsxs(
@@ -1573,13 +1573,13 @@ function Fn({
1573
1573
  {
1574
1574
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
1575
1575
  children: [
1576
- /* @__PURE__ */ e.jsx(fn, { className: "mr-2 h-5 w-5" }),
1576
+ /* @__PURE__ */ e.jsx(gn, { className: "mr-2 h-5 w-5" }),
1577
1577
  /* @__PURE__ */ e.jsx("div", { children: y.content })
1578
1578
  ]
1579
1579
  },
1580
1580
  v
1581
1581
  ) : y.role === "ai" ? /* @__PURE__ */ e.jsx(
1582
- Za,
1582
+ et,
1583
1583
  {
1584
1584
  className: "w-full overflow-auto py-1",
1585
1585
  components: Z,
@@ -1620,7 +1620,7 @@ function Fn({
1620
1620
  {
1621
1621
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center rounded-md border", children: [
1622
1622
  /* @__PURE__ */ e.jsx(
1623
- aa,
1623
+ na,
1624
1624
  {
1625
1625
  autoFocus: !0,
1626
1626
  ref: l,
@@ -1635,7 +1635,7 @@ function Fn({
1635
1635
  className: W(
1636
1636
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1637
1637
  ),
1638
- disabled: A || q,
1638
+ disabled: A || V,
1639
1639
  value: a,
1640
1640
  onChange: (y) => t(y.target.value)
1641
1641
  }
@@ -1648,7 +1648,7 @@ function Fn({
1648
1648
  size: "sm",
1649
1649
  variant: "ghost",
1650
1650
  onClick: D,
1651
- children: !A && !q ? /* @__PURE__ */ e.jsx(Xa, {}) : /* @__PURE__ */ e.jsx(He, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1651
+ children: !A && !V ? /* @__PURE__ */ e.jsx(Za, {}) : /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1652
1652
  }
1653
1653
  )
1654
1654
  ] })
@@ -1659,17 +1659,17 @@ function Fn({
1659
1659
  )
1660
1660
  ] });
1661
1661
  }
1662
- var pa = {
1662
+ var fa = {
1663
1663
  color: void 0,
1664
1664
  size: void 0,
1665
1665
  className: void 0,
1666
1666
  style: void 0,
1667
1667
  attr: void 0
1668
- }, Rs = me.createContext && /* @__PURE__ */ me.createContext(pa), On = ["attr", "size", "title"];
1669
- function Mn(s, n) {
1668
+ }, Hs = me.createContext && /* @__PURE__ */ me.createContext(fa), Mn = ["attr", "size", "title"];
1669
+ function Tn(s, n) {
1670
1670
  if (s == null)
1671
1671
  return {};
1672
- var a = Tn(s, n), t, i;
1672
+ var a = An(s, n), t, i;
1673
1673
  if (Object.getOwnPropertySymbols) {
1674
1674
  var o = Object.getOwnPropertySymbols(s);
1675
1675
  for (i = 0; i < o.length; i++)
@@ -1677,7 +1677,7 @@ function Mn(s, n) {
1677
1677
  }
1678
1678
  return a;
1679
1679
  }
1680
- function Tn(s, n) {
1680
+ function An(s, n) {
1681
1681
  if (s == null)
1682
1682
  return {};
1683
1683
  var a = {}, t = Object.keys(s), i, o;
@@ -1695,7 +1695,7 @@ function Xe() {
1695
1695
  return s;
1696
1696
  }, Xe.apply(this, arguments);
1697
1697
  }
1698
- function _s(s, n) {
1698
+ function Bs(s, n) {
1699
1699
  var a = Object.keys(s);
1700
1700
  if (Object.getOwnPropertySymbols) {
1701
1701
  var t = Object.getOwnPropertySymbols(s);
@@ -1708,22 +1708,22 @@ function _s(s, n) {
1708
1708
  function Ze(s) {
1709
1709
  for (var n = 1; n < arguments.length; n++) {
1710
1710
  var a = arguments[n] != null ? arguments[n] : {};
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) {
1711
+ n % 2 ? Bs(Object(a), !0).forEach(function(t) {
1712
+ En(s, t, a[t]);
1713
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : Bs(Object(a)).forEach(function(t) {
1714
1714
  Object.defineProperty(s, t, Object.getOwnPropertyDescriptor(a, t));
1715
1715
  });
1716
1716
  }
1717
1717
  return s;
1718
1718
  }
1719
- function An(s, n, a) {
1719
+ function En(s, n, a) {
1720
1720
  return n = Ln(n), n in s ? Object.defineProperty(s, n, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = a, s;
1721
1721
  }
1722
1722
  function Ln(s) {
1723
- var n = En(s, "string");
1723
+ var n = Dn(s, "string");
1724
1724
  return typeof n == "symbol" ? n : String(n);
1725
1725
  }
1726
- function En(s, n) {
1726
+ function Dn(s, n) {
1727
1727
  if (typeof s != "object" || s === null)
1728
1728
  return s;
1729
1729
  var a = s[Symbol.toPrimitive];
@@ -1735,23 +1735,23 @@ function En(s, n) {
1735
1735
  }
1736
1736
  return (n === "string" ? String : Number)(s);
1737
1737
  }
1738
- function fa(s) {
1738
+ function ga(s) {
1739
1739
  return s && s.map((n, a) => /* @__PURE__ */ me.createElement(n.tag, Ze({
1740
1740
  key: a
1741
- }, n.attr), fa(n.child)));
1741
+ }, n.attr), ga(n.child)));
1742
1742
  }
1743
1743
  function fe(s) {
1744
- return (n) => /* @__PURE__ */ me.createElement(Dn, Xe({
1744
+ return (n) => /* @__PURE__ */ me.createElement(In, Xe({
1745
1745
  attr: Ze({}, s.attr)
1746
- }, n), fa(s.child));
1746
+ }, n), ga(s.child));
1747
1747
  }
1748
- function Dn(s) {
1748
+ function In(s) {
1749
1749
  var n = (a) => {
1750
1750
  var {
1751
1751
  attr: t,
1752
1752
  size: i,
1753
1753
  title: o
1754
- } = s, l = Mn(s, On), c = i || a.size || "1em", h;
1754
+ } = s, l = Tn(s, Mn), c = i || a.size || "1em", h;
1755
1755
  return a.className && (h = a.className), s.className && (h = (h ? h + " " : "") + s.className), /* @__PURE__ */ me.createElement("svg", Xe({
1756
1756
  stroke: "currentColor",
1757
1757
  fill: "currentColor",
@@ -1766,15 +1766,15 @@ function Dn(s) {
1766
1766
  xmlns: "http://www.w3.org/2000/svg"
1767
1767
  }), o && /* @__PURE__ */ me.createElement("title", null, o), s.children);
1768
1768
  };
1769
- return Rs !== void 0 ? /* @__PURE__ */ me.createElement(Rs.Consumer, null, (a) => n(a)) : n(pa);
1769
+ return Hs !== void 0 ? /* @__PURE__ */ me.createElement(Hs.Consumer, null, (a) => n(a)) : n(fa);
1770
1770
  }
1771
- function In(s) {
1771
+ function Vn(s) {
1772
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);
1773
1773
  }
1774
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();
1775
+ const { theme: s } = at(), n = $e(), a = $e(), [t, i] = T(!1), [o, l] = T(!1), [c, h] = T(!1), [g, m] = T(""), [u, N] = T(!1), { authToken: d } = es();
1776
1776
  k((p) => p.selectedSheetId);
1777
- const x = k((p) => p.dashboard.baseQueries), f = r((p) => p.card), w = k((p) => p.theme), b = r((p) => p.isShowingVisual), E = r(
1777
+ const x = k((p) => p.dashboard.baseQueries), f = r((p) => p.card), w = k((p) => p.theme), b = r((p) => p.isShowingVisual), L = r(
1778
1778
  (p) => p.selectedConnectionId
1779
1779
  ), C = r(
1780
1780
  (p) => p.selectedDatabaseName
@@ -1784,16 +1784,16 @@ function qn() {
1784
1784
  k(
1785
1785
  (p) => p.actions.updateFrameCard
1786
1786
  );
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), {
1787
+ const j = r((p) => p.selectedTableName), F = r((p) => p.card.sql), A = r((p) => p.card.python), V = tt(F, x), Y = r((p) => p.selectedConnectionId), $ = r((p) => p.frame), P = r((p) => p.filterValues), D = r((p) => p.applyFilters), {
1788
1788
  setCardCustomCfg: te,
1789
1789
  setQueryResultColumns: J,
1790
1790
  setFilterValues: ee,
1791
1791
  setCardSql: Z,
1792
- setCardPython: P,
1792
+ setCardPython: U,
1793
1793
  setQueryError: I,
1794
1794
  setPythonStdOut: y,
1795
1795
  setCardPreferences: v
1796
- } = r((p) => p.actions), M = r((p) => p.onSave), V = r(
1796
+ } = r((p) => p.actions), M = r((p) => p.onSave), H = r(
1797
1797
  (p) => p.actions.setApplyFilters
1798
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(
1799
1799
  (p) => p.actions.setIsSqlRunning
@@ -1803,19 +1803,19 @@ function qn() {
1803
1803
  isFetching: le,
1804
1804
  isSuccess: ye,
1805
1805
  isError: re,
1806
- error: De,
1806
+ error: Ie,
1807
1807
  status: ss,
1808
1808
  refetch: ve
1809
1809
  } = Ce({
1810
- queryKey: [q, A],
1811
- queryFn: () => ea(
1810
+ queryKey: [V, A],
1811
+ queryFn: () => aa(
1812
1812
  "https://semaphor.cloud/api/v1/query",
1813
1813
  (d == null ? void 0 : d.accessToken) || "",
1814
1814
  {
1815
1815
  connection_id: Y,
1816
- sql: q,
1817
- python: A === As ? "" : A,
1818
- active_filters: D ? U : []
1816
+ sql: V,
1817
+ python: A === Ls ? "" : A,
1818
+ active_filters: D ? P : []
1819
1819
  }
1820
1820
  ),
1821
1821
  enabled: !1,
@@ -1829,7 +1829,7 @@ function qn() {
1829
1829
  }, [G, se, J, y]), K(() => {
1830
1830
  je && (ve(), be(!1));
1831
1831
  }, [je, ve, be]), K(() => {
1832
- (ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(De.message), se([]), J([]), y("")) : I("");
1832
+ (ne || le) && xe(!0), (re || ye) && xe(!1), re ? (I(Ie.message), se([]), J([]), y("")) : I("");
1833
1833
  }, [
1834
1834
  ne,
1835
1835
  le,
@@ -1841,23 +1841,23 @@ function qn() {
1841
1841
  se,
1842
1842
  J,
1843
1843
  I,
1844
- De
1844
+ Ie
1845
1845
  ]);
1846
1846
  function Je() {
1847
1847
  Z(""), se([]), ge({}), te(""), v({});
1848
1848
  }
1849
- const Ie = (p) => {
1849
+ const Ve = (p) => {
1850
1850
  a.current = p;
1851
1851
  };
1852
1852
  function S() {
1853
1853
  let p = F;
1854
- F && !F.includes("{{") && (p = Cn(F), Z(p));
1854
+ F && !F.includes("{{") && (p = Sn(F), Z(p));
1855
1855
  const ie = {
1856
1856
  ...f,
1857
1857
  lastSelectedSchema: O,
1858
1858
  lastSelectedDatabase: C,
1859
1859
  lastSelectedTable: j,
1860
- connectionId: E,
1860
+ connectionId: L,
1861
1861
  type: b ? f.type : "table",
1862
1862
  sql: p,
1863
1863
  customCfg: b ? f.customCfg : null
@@ -1869,21 +1869,21 @@ function qn() {
1869
1869
  cards: qe
1870
1870
  });
1871
1871
  }
1872
- function za() {
1872
+ function Fa() {
1873
1873
  ue == null || ue();
1874
1874
  }
1875
- function Fa(p) {
1875
+ function Oa(p) {
1876
1876
  const ie = getComputedStyle(
1877
1877
  document.documentElement
1878
1878
  ).getPropertyValue(p);
1879
- return Oa(ie);
1879
+ return Ma(ie);
1880
1880
  }
1881
- function Oa(p) {
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;
1881
+ function Ma(p) {
1882
+ const [ie, qe, Ne] = p.split(" "), Q = parseFloat(ie), Ea = parseFloat(qe), La = parseFloat(Ne), Da = Ea / 100, Ms = La / 100, pe = (1 - Math.abs(2 * Ms - 1)) * Da, ke = pe * (1 - Math.abs(Q / 60 % 2 - 1)), as = Ms - pe / 2;
1883
1883
  let oe = 0, ce = 0, de = 0;
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);
1885
- const ts = (Da) => {
1886
- const ns = Da.toString(16);
1884
+ 0 <= Q && Q < 60 ? (oe = pe, ce = ke, de = 0) : 60 <= Q && Q < 120 ? (oe = ke, ce = pe, de = 0) : 120 <= Q && Q < 180 ? (oe = 0, ce = pe, de = ke) : 180 <= Q && Q < 240 ? (oe = 0, ce = ke, de = pe) : 240 <= Q && Q < 300 ? (oe = ke, ce = 0, de = pe) : 300 <= Q && Q < 360 && (oe = pe, ce = 0, de = ke), oe = Math.round((oe + as) * 255), ce = Math.round((ce + as) * 255), de = Math.round((de + as) * 255);
1885
+ const ts = (Ia) => {
1886
+ const ns = Ia.toString(16);
1887
1887
  return ns.length == 1 ? "0" + ns : ns;
1888
1888
  };
1889
1889
  return `#${ts(oe)}${ts(ce)}${ts(de)}`;
@@ -1899,7 +1899,7 @@ function qn() {
1899
1899
  rules: [],
1900
1900
  colors: {
1901
1901
  // 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
1902
- "editor.background": Ne === "light" ? "#ffffff" : Fa("--background")
1902
+ "editor.background": Ne === "light" ? "#ffffff" : Oa("--background")
1903
1903
  }
1904
1904
  }), p.editor.setTheme("default");
1905
1905
  }
@@ -1911,10 +1911,10 @@ function qn() {
1911
1911
  ), () => {
1912
1912
  };
1913
1913
  }, [s, w, n.current]);
1914
- function zs(p) {
1914
+ function Os(p) {
1915
1915
  n.current = p;
1916
1916
  }
1917
- function Ma() {
1917
+ function Ta() {
1918
1918
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1919
1919
  o && /* @__PURE__ */ e.jsx(
1920
1920
  "div",
@@ -1924,16 +1924,16 @@ function qn() {
1924
1924
  children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
1925
1925
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
1926
1926
  /* @__PURE__ */ e.jsx(
1927
- kn,
1927
+ wn,
1928
1928
  {
1929
1929
  checked: D,
1930
- onCheckedChange: () => V(!D),
1930
+ onCheckedChange: () => H(!D),
1931
1931
  text: "Apply Filters"
1932
1932
  }
1933
1933
  ),
1934
- /* @__PURE__ */ e.jsx(wn, {}),
1935
- U && o && /* @__PURE__ */ e.jsx(
1936
- Re,
1934
+ /* @__PURE__ */ e.jsx(zn, {}),
1935
+ P && o && /* @__PURE__ */ e.jsx(
1936
+ _e,
1937
1937
  {
1938
1938
  onClick: () => l(!1),
1939
1939
  className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
@@ -1941,7 +1941,7 @@ function qn() {
1941
1941
  )
1942
1942
  ] }),
1943
1943
  /* @__PURE__ */ e.jsx(
1944
- Ve,
1944
+ Re,
1945
1945
  {
1946
1946
  theme: "default",
1947
1947
  onChange: (p) => {
@@ -1953,7 +1953,7 @@ function qn() {
1953
1953
  },
1954
1954
  defaultLanguage: "json",
1955
1955
  className: "mt-1 min-h-[220px]",
1956
- value: JSON.stringify(U, null, 2),
1956
+ value: JSON.stringify(P, null, 2),
1957
1957
  options: {
1958
1958
  readOnly: !0,
1959
1959
  minimap: {
@@ -1974,8 +1974,8 @@ function qn() {
1974
1974
  ] })
1975
1975
  }
1976
1976
  ),
1977
- U && !o && /* @__PURE__ */ e.jsx(
1978
- ia,
1977
+ P && !o && /* @__PURE__ */ e.jsx(
1978
+ oa,
1979
1979
  {
1980
1980
  onClick: () => l(!0),
1981
1981
  className: W(
@@ -1988,7 +1988,7 @@ function qn() {
1988
1988
  )
1989
1989
  ] });
1990
1990
  }
1991
- function Ta() {
1991
+ function Aa() {
1992
1992
  return /* @__PURE__ */ e.jsxs(
1993
1993
  hs,
1994
1994
  {
@@ -1997,7 +1997,7 @@ function qn() {
1997
1997
  role: "editor-resizable-group",
1998
1998
  children: [
1999
1999
  /* @__PURE__ */ e.jsxs(
2000
- ze,
2000
+ Fe,
2001
2001
  {
2002
2002
  id: "1",
2003
2003
  order: 1,
@@ -2010,7 +2010,7 @@ function qn() {
2010
2010
  role: "sql-container",
2011
2011
  className: "relative flex w-[99%]",
2012
2012
  children: /* @__PURE__ */ e.jsx(
2013
- Ve,
2013
+ Re,
2014
2014
  {
2015
2015
  theme: "default",
2016
2016
  className: "pt-3",
@@ -2032,8 +2032,8 @@ function qn() {
2032
2032
  },
2033
2033
  defaultLanguage: "sql",
2034
2034
  defaultValue: "SELECT * FROM table",
2035
- beforeMount: zs,
2036
- onMount: Ie
2035
+ beforeMount: Os,
2036
+ onMount: Ve
2037
2037
  }
2038
2038
  )
2039
2039
  }
@@ -2045,7 +2045,7 @@ function qn() {
2045
2045
  t && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2046
2046
  /* @__PURE__ */ e.jsx(ms, { withHandle: !0, className: "border" }),
2047
2047
  /* @__PURE__ */ e.jsxs(
2048
- ze,
2048
+ Fe,
2049
2049
  {
2050
2050
  id: "2",
2051
2051
  order: 2,
@@ -2058,14 +2058,14 @@ function qn() {
2058
2058
  role: "python-container",
2059
2059
  className: "relative flex w-[99%] pt-0",
2060
2060
  children: /* @__PURE__ */ e.jsx(
2061
- Ve,
2061
+ Re,
2062
2062
  {
2063
2063
  className: "pt-3",
2064
2064
  theme: "default",
2065
2065
  onChange: (p) => {
2066
- P(p && p.trim() || "");
2066
+ U(p && p.trim() || "");
2067
2067
  },
2068
- value: A || As,
2068
+ value: A || Ls,
2069
2069
  options: {
2070
2070
  minimap: {
2071
2071
  enabled: !1
@@ -2079,8 +2079,8 @@ function qn() {
2079
2079
  renderLineHighlight: "none"
2080
2080
  },
2081
2081
  defaultLanguage: "python",
2082
- beforeMount: zs,
2083
- onMount: Ie
2082
+ beforeMount: Os,
2083
+ onMount: Ve
2084
2084
  }
2085
2085
  )
2086
2086
  }
@@ -2108,8 +2108,8 @@ function qn() {
2108
2108
  role: "sql-editor",
2109
2109
  className: "relative flex grow justify-between overflow-y-scroll",
2110
2110
  children: [
2111
- Ta(),
2112
- Ma()
2111
+ Aa(),
2112
+ Ta()
2113
2113
  ]
2114
2114
  }
2115
2115
  ),
@@ -2132,15 +2132,15 @@ function qn() {
2132
2132
  size: "sm",
2133
2133
  variant: "outline",
2134
2134
  children: [
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" }),
2135
+ ne || le ? /* @__PURE__ */ e.jsx(Be, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(on, { className: "mr-2 h-4 w-4" }),
2136
2136
  "Run"
2137
2137
  ]
2138
2138
  }
2139
2139
  ),
2140
2140
  re && /* @__PURE__ */ e.jsx(
2141
- Sn,
2141
+ kn,
2142
2142
  {
2143
- error: De.message,
2143
+ error: Ie.message,
2144
2144
  setShowAIDialog: h,
2145
2145
  setTriggerAIRun: N,
2146
2146
  setUserInputforAI: m
@@ -2154,24 +2154,24 @@ function qn() {
2154
2154
  size: "sm",
2155
2155
  variant: "outline",
2156
2156
  children: [
2157
- /* @__PURE__ */ e.jsx(Wt, { className: "mr-2 size-4" }),
2157
+ /* @__PURE__ */ e.jsx(Yt, { className: "mr-2 size-4" }),
2158
2158
  "Clear"
2159
2159
  ]
2160
2160
  }
2161
2161
  ),
2162
2162
  /* @__PURE__ */ e.jsx(
2163
- Ws,
2163
+ Xs,
2164
2164
  {
2165
2165
  pressed: t,
2166
2166
  onPressedChange: (p) => i(p),
2167
2167
  className: "",
2168
2168
  size: "sm",
2169
2169
  variant: "outline",
2170
- children: /* @__PURE__ */ e.jsx(In, { className: "size-4 text-foreground/70" })
2170
+ children: /* @__PURE__ */ e.jsx(Vn, { className: "size-4 text-foreground/70" })
2171
2171
  }
2172
2172
  ),
2173
2173
  /* @__PURE__ */ e.jsx(
2174
- Fn,
2174
+ On,
2175
2175
  {
2176
2176
  open: c,
2177
2177
  setOpen: h,
@@ -2190,7 +2190,7 @@ function qn() {
2190
2190
  size: "sm",
2191
2191
  variant: "outline",
2192
2192
  children: [
2193
- /* @__PURE__ */ e.jsx(tt, { className: "mr-2 size-4 font-bold text-green-600" }),
2193
+ /* @__PURE__ */ e.jsx(nt, { className: "mr-2 size-4 font-bold text-green-600" }),
2194
2194
  "Accept"
2195
2195
  ]
2196
2196
  }
@@ -2198,12 +2198,12 @@ function qn() {
2198
2198
  /* @__PURE__ */ e.jsxs(
2199
2199
  z,
2200
2200
  {
2201
- onClick: za,
2201
+ onClick: Fa,
2202
2202
  className: "w-full",
2203
2203
  size: "sm",
2204
2204
  variant: "outline",
2205
2205
  children: [
2206
- /* @__PURE__ */ e.jsx(Re, { className: "mr-2 size-4" }),
2206
+ /* @__PURE__ */ e.jsx(_e, { className: "mr-2 size-4" }),
2207
2207
  "Close"
2208
2208
  ]
2209
2209
  }
@@ -2217,7 +2217,7 @@ function qn() {
2217
2217
  )
2218
2218
  );
2219
2219
  }
2220
- function Vn({ data: s }) {
2220
+ function Rn({ data: s }) {
2221
2221
  var l;
2222
2222
  const [n, a] = me.useState([]), i = Object.keys(s[0]).map((c) => ({
2223
2223
  // header: key,
@@ -2231,40 +2231,40 @@ function Vn({ data: s }) {
2231
2231
  onClick: () => h.toggleSorting(h.getIsSorted() === "asc"),
2232
2232
  children: [
2233
2233
  c,
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
2234
+ g === "asc" ? /* @__PURE__ */ e.jsx(lt, { className: "ml-2 h-5 w-5" }) : g === "desc" ? /* @__PURE__ */ e.jsx(rt, { className: "ml-2 h-5 w-5" }) : null
2235
2235
  ]
2236
2236
  }
2237
2237
  ) });
2238
2238
  }
2239
- })), o = rt({
2239
+ })), o = it({
2240
2240
  data: s,
2241
2241
  columns: i,
2242
- getCoreRowModel: ht(),
2243
- getPaginationRowModel: mt(),
2242
+ getCoreRowModel: mt(),
2243
+ getPaginationRowModel: ut(),
2244
2244
  onSortingChange: a,
2245
- getSortedRowModel: ut(),
2245
+ getSortedRowModel: xt(),
2246
2246
  manualPagination: !0,
2247
2247
  state: {
2248
2248
  sorting: n
2249
2249
  }
2250
2250
  });
2251
- return /* @__PURE__ */ e.jsxs(it, { children: [
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(
2251
+ return /* @__PURE__ */ e.jsxs(ot, { children: [
2252
+ /* @__PURE__ */ e.jsx(ct, { children: o.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(ls, { children: c.headers.map((h) => /* @__PURE__ */ e.jsx(dt, { className: "sticky top-0 bg-muted", children: h.isPlaceholder ? null : Ds(
2253
2253
  h.column.columnDef.header,
2254
2254
  h.getContext()
2255
2255
  ) }, h.id)) }, c.id)) }),
2256
- /* @__PURE__ */ e.jsx(dt, { children: (l = o.getRowModel().rows) != null && l.length ? o.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
2256
+ /* @__PURE__ */ e.jsx(ht, { children: (l = o.getRowModel().rows) != null && l.length ? o.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
2257
2257
  ls,
2258
2258
  {
2259
2259
  className: "whitespace-nowrap py-2",
2260
2260
  "data-state": c.getIsSelected() && "selected",
2261
- children: c.getVisibleCells().map((h) => /* @__PURE__ */ e.jsx(Es, { children: Ls(h.column.columnDef.cell, h.getContext()) }, h.id))
2261
+ children: c.getVisibleCells().map((h) => /* @__PURE__ */ e.jsx(Is, { children: Ds(h.column.columnDef.cell, h.getContext()) }, h.id))
2262
2262
  },
2263
2263
  c.id
2264
- )) : /* @__PURE__ */ e.jsx(ls, { children: /* @__PURE__ */ e.jsx(Es, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
2264
+ )) : /* @__PURE__ */ e.jsx(ls, { children: /* @__PURE__ */ e.jsx(Is, { colSpan: i.length, className: "h-24 text-center", children: "No results." }) }) })
2265
2265
  ] });
2266
2266
  }
2267
- function ga({
2267
+ function ja({
2268
2268
  // card,
2269
2269
  className: s,
2270
2270
  ...n
@@ -2283,35 +2283,35 @@ function ga({
2283
2283
  ]), !t.id)
2284
2284
  return null;
2285
2285
  let o;
2286
- return t.data && t.data.length > 0 && (o = ta({
2286
+ return t.data && t.data.length > 0 && (o = la({
2287
2287
  data: t.data,
2288
2288
  cardType: t.type,
2289
2289
  cfg: t.cfg,
2290
2290
  customCfg: t.customCfg,
2291
2291
  preferences: t.preferences
2292
2292
  })), /* @__PURE__ */ e.jsxs(
2293
- xt,
2293
+ pt,
2294
2294
  {
2295
2295
  role: "editor-visual-card",
2296
2296
  className: W("relative flex h-full flex-col rounded-none", s),
2297
2297
  ...n,
2298
2298
  children: [
2299
- /* @__PURE__ */ e.jsxs(pt, { className: "py-4", children: [
2299
+ /* @__PURE__ */ e.jsxs(ft, { className: "py-4", children: [
2300
2300
  /* @__PURE__ */ e.jsx(
2301
- Ds,
2301
+ Vs,
2302
2302
  {
2303
2303
  text: t.title,
2304
2304
  onSave: (c) => i({ ...t, title: c }),
2305
- children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(ft, { className: "text-base", children: t.title }) })
2305
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(gt, { className: "text-base", children: t.title }) })
2306
2306
  },
2307
2307
  t.title
2308
2308
  ),
2309
2309
  /* @__PURE__ */ e.jsx(
2310
- Ds,
2310
+ Vs,
2311
2311
  {
2312
2312
  text: t.description || "",
2313
2313
  onSave: (c) => i({ ...t, description: c }),
2314
- children: /* @__PURE__ */ e.jsxs(gt, { children: [
2314
+ children: /* @__PURE__ */ e.jsxs(jt, { children: [
2315
2315
  " ",
2316
2316
  t.description
2317
2317
  ] })
@@ -2319,34 +2319,34 @@ function ga({
2319
2319
  t.description
2320
2320
  )
2321
2321
  ] }),
2322
- /* @__PURE__ */ e.jsxs(jt, { className: "flex grow flex-col pb-3", children: [
2322
+ /* @__PURE__ */ e.jsxs(bt, { className: "flex grow flex-col pb-3", children: [
2323
2323
  t.type !== "table" && o && // <ChartJsVisual key={visualKey} cfg={cfg} />
2324
2324
  /* @__PURE__ */ e.jsx(
2325
- bt,
2325
+ yt,
2326
2326
  {
2327
2327
  cfg: o
2328
2328
  },
2329
2329
  JSON.stringify(o) + JSON.stringify(t.preferences) + ((l = t == null ? void 0 : t.preferences) == null ? void 0 : l.customVisualCode)
2330
2330
  ),
2331
2331
  t.type === "table" && t.data && t.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
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 }) })
2332
+ /* @__PURE__ */ e.jsx(vt, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Nt, { card: t, data: t == null ? void 0 : t.data }) })
2333
2333
  ] })
2334
2334
  ]
2335
2335
  }
2336
2336
  );
2337
2337
  }
2338
- function Rn() {
2338
+ function _n() {
2339
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
2340
  (C) => C.card.customCfg
2341
- ), { setCardCustomCfg: N, setCustomVisualCode: d } = Nt();
2341
+ ), { setCardCustomCfg: N, setCustomVisualCode: d } = Ct();
2342
2342
  function x(C) {
2343
2343
  var F, A;
2344
2344
  const O = {
2345
2345
  ...C,
2346
2346
  data: {
2347
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,
2348
+ datasets: (A = (F = C == null ? void 0 : C.data) == null ? void 0 : F.datasets) == null ? void 0 : A.map((V) => ({
2349
+ ...V,
2350
2350
  data: []
2351
2351
  }))
2352
2352
  }
@@ -2357,7 +2357,7 @@ function Rn() {
2357
2357
  var O, j;
2358
2358
  if (!m.data || m.data.length === 0)
2359
2359
  return;
2360
- const C = ta({
2360
+ const C = la({
2361
2361
  data: m.data,
2362
2362
  cardType: m.type,
2363
2363
  cfg: m.cfg,
@@ -2377,10 +2377,10 @@ function Rn() {
2377
2377
  function b() {
2378
2378
  o(""), N(null);
2379
2379
  }
2380
- function E() {
2380
+ function L() {
2381
2381
  let C;
2382
2382
  if (u) {
2383
- const O = Is.cloneDeep(m.cfg), j = Is.merge(O, u);
2383
+ const O = qs.cloneDeep(m.cfg), j = qs.merge(O, u);
2384
2384
  return C = x(j), C;
2385
2385
  }
2386
2386
  return a ? (C = x(JSON.parse(a)), C) : "";
@@ -2393,7 +2393,7 @@ function Rn() {
2393
2393
  className: ` ${u && "border-foreground/50 dark:border-foreground/70"}`,
2394
2394
  size: "sm",
2395
2395
  variant: "outline",
2396
- children: /* @__PURE__ */ e.jsx(Ct, { className: "h-4 w-4" })
2396
+ children: /* @__PURE__ */ e.jsx(St, { className: "h-4 w-4" })
2397
2397
  }
2398
2398
  ) }),
2399
2399
  /* @__PURE__ */ e.jsxs(
@@ -2405,8 +2405,8 @@ function Rn() {
2405
2405
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2406
2406
  /* @__PURE__ */ e.jsx(gs, { children: "Customize Card" }),
2407
2407
  /* @__PURE__ */ e.jsxs(bs, { children: [
2408
- /* @__PURE__ */ e.jsx(Ps, { children: /* @__PURE__ */ e.jsx(
2409
- en,
2408
+ /* @__PURE__ */ e.jsx(Js, { children: /* @__PURE__ */ e.jsx(
2409
+ sn,
2410
2410
  {
2411
2411
  onClick: () => {
2412
2412
  navigator.clipboard.writeText(m.id);
@@ -2431,11 +2431,11 @@ function Rn() {
2431
2431
  ] })
2432
2432
  ] }),
2433
2433
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
2434
- /* @__PURE__ */ e.jsx(ga, { className: "w-1/2 rounded shadow-none" }),
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: [
2434
+ /* @__PURE__ */ e.jsx(ja, { className: "w-1/2 rounded shadow-none" }),
2435
+ /* @__PURE__ */ e.jsxs(kt, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2436
+ /* @__PURE__ */ e.jsxs(wt, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2437
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" }),
2438
+ u && /* @__PURE__ */ e.jsx(zt, { className: "mr-1 h-5 w-5 text-green-600" }),
2439
2439
  u ? "Custom Config" : "Default Config"
2440
2440
  ] }),
2441
2441
  /* @__PURE__ */ e.jsx(rs, { className: "", value: "output", children: "Output" }),
@@ -2447,7 +2447,7 @@ function Rn() {
2447
2447
  className: "bg-red-x mt-0 grow rounded-b border border-t-0 p-2",
2448
2448
  value: "output",
2449
2449
  children: /* @__PURE__ */ e.jsx(
2450
- aa,
2450
+ na,
2451
2451
  {
2452
2452
  disabled: !0,
2453
2453
  value: a,
@@ -2462,7 +2462,7 @@ function Rn() {
2462
2462
  className: "mt-0 grow rounded-b border border-t-0",
2463
2463
  value: "custom-config",
2464
2464
  children: /* @__PURE__ */ e.jsx(
2465
- Ve,
2465
+ Re,
2466
2466
  {
2467
2467
  className: "h-full w-full overflow-hidden",
2468
2468
  theme: "default",
@@ -2479,7 +2479,7 @@ function Rn() {
2479
2479
  renderLineHighlight: "none"
2480
2480
  },
2481
2481
  defaultLanguage: "json",
2482
- value: E(),
2482
+ value: L(),
2483
2483
  onChange: (C) => o(C)
2484
2484
  }
2485
2485
  )
@@ -2491,7 +2491,7 @@ function Rn() {
2491
2491
  className: "mt-0 grow rounded-b border border-t-0",
2492
2492
  value: "custom-code",
2493
2493
  children: /* @__PURE__ */ e.jsx(
2494
- Ve,
2494
+ Re,
2495
2495
  {
2496
2496
  className: "h-full w-full overflow-hidden",
2497
2497
  theme: "default",
@@ -2516,8 +2516,8 @@ function Rn() {
2516
2516
  )
2517
2517
  ] })
2518
2518
  ] }),
2519
- /* @__PURE__ */ e.jsxs(Ks, { className: "flex items-center", children: [
2520
- /* @__PURE__ */ e.jsx(R, { className: "mr-2 text-red-500", children: h }),
2519
+ /* @__PURE__ */ e.jsxs(Us, { className: "flex items-center", children: [
2520
+ /* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children: h }),
2521
2521
  /* @__PURE__ */ e.jsx(
2522
2522
  z,
2523
2523
  {
@@ -2535,28 +2535,28 @@ function Rn() {
2535
2535
  )
2536
2536
  ] });
2537
2537
  }
2538
- function ja(s) {
2538
+ function ba(s) {
2539
2539
  return fe({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
2540
2540
  }
2541
- function ba(s) {
2541
+ function ya(s) {
2542
2542
  return fe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M137.39,24.06A16,16,0,0,0,120,40V80.67a15.86,15.86,0,0,0,13.25,15.76A32,32,0,1,1,96,129.68c-.41-8.22,1.27-15,5-20.26h0a15.86,15.86,0,0,0-1.69-20.47L71.69,60.68a16,16,0,0,0-23.63,1.1A103.6,103.6,0,0,0,55,202.05,103.24,103.24,0,0,0,128,232h1.49A104.3,104.3,0,0,0,232,129.48C232.75,75.18,191.19,28.88,137.39,24.06ZM60.32,71.94l27.61,28.19,0,.06A43.29,43.29,0,0,0,80.44,120H40.36A87.13,87.13,0,0,1,60.32,71.94ZM40.37,136h40.3A48,48,0,0,0,120,175.34v40.3A88,88,0,0,1,40.37,136Zm149.77,54.14A87.45,87.45,0,0,1,136,215.61V175.34a47.55,47.55,0,0,0,24.73-12.23A48,48,0,0,0,136,80.66L136,40c45.52,4.08,80.67,43.28,80,89.25A87.45,87.45,0,0,1,190.14,190.14Z" }, child: [] }] })(s);
2543
2543
  }
2544
- function ya(s) {
2544
+ function va(s) {
2545
2545
  return fe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
2546
2546
  }
2547
- function va(s) {
2547
+ function Na(s) {
2548
2548
  return fe({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }, child: [] }, { tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
2549
2549
  }
2550
- function Na(s) {
2550
+ function Ca(s) {
2551
2551
  return fe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
2552
2552
  }
2553
- function Ca(s) {
2553
+ function Sa(s) {
2554
2554
  return fe({ tag: "svg", attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z" }, child: [] }] })(s);
2555
2555
  }
2556
- function Sa(s) {
2556
+ function ka(s) {
2557
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);
2558
2558
  }
2559
- function _n() {
2559
+ function Hn() {
2560
2560
  const [s, n] = T(!1), a = r((c) => c.card.type), { setCardType: t, setCardPreferences: i } = r(
2561
2561
  (c) => c.actions
2562
2562
  ), o = r(
@@ -2565,16 +2565,16 @@ function _n() {
2565
2565
  function l(c) {
2566
2566
  t(c), o(null), i({}), n(!1);
2567
2567
  }
2568
- return /* @__PURE__ */ e.jsxs(Ke, { open: s, onOpenChange: n, children: [
2569
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(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: [
2568
+ return /* @__PURE__ */ e.jsxs(Pe, { open: s, onOpenChange: n, children: [
2569
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Bn, { className: "h-4 w-4", chartType: a }) }) }),
2570
+ /* @__PURE__ */ e.jsx(Ge, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2571
2571
  /* @__PURE__ */ e.jsx(
2572
2572
  z,
2573
2573
  {
2574
2574
  onClick: () => l("bar"),
2575
2575
  className: "font-normal",
2576
2576
  variant: "ghost",
2577
- children: /* @__PURE__ */ e.jsx(Ss, { className: "size-5" })
2577
+ children: /* @__PURE__ */ e.jsx(ks, { className: "size-5" })
2578
2578
  }
2579
2579
  ),
2580
2580
  /* @__PURE__ */ e.jsx(
@@ -2582,7 +2582,7 @@ function _n() {
2582
2582
  {
2583
2583
  onClick: () => l("line"),
2584
2584
  variant: "ghost",
2585
- children: /* @__PURE__ */ e.jsx(ks, { className: "size-5" })
2585
+ children: /* @__PURE__ */ e.jsx(ws, { className: "size-5" })
2586
2586
  }
2587
2587
  ),
2588
2588
  /* @__PURE__ */ e.jsx(
@@ -2590,7 +2590,7 @@ function _n() {
2590
2590
  {
2591
2591
  onClick: () => l("stackedBar"),
2592
2592
  variant: "ghost",
2593
- children: /* @__PURE__ */ e.jsx(Na, { className: "size-5", strokeWidth: 0 })
2593
+ children: /* @__PURE__ */ e.jsx(Ca, { className: "size-5", strokeWidth: 0 })
2594
2594
  }
2595
2595
  ),
2596
2596
  /* @__PURE__ */ e.jsx(
@@ -2598,7 +2598,7 @@ function _n() {
2598
2598
  {
2599
2599
  onClick: () => l("scatter"),
2600
2600
  variant: "ghost",
2601
- children: /* @__PURE__ */ e.jsx(ha, { className: "size-5" })
2601
+ children: /* @__PURE__ */ e.jsx(ma, { className: "size-5" })
2602
2602
  }
2603
2603
  ),
2604
2604
  /* @__PURE__ */ e.jsx(
@@ -2606,7 +2606,7 @@ function _n() {
2606
2606
  {
2607
2607
  onClick: () => l("bubble"),
2608
2608
  variant: "ghost",
2609
- children: /* @__PURE__ */ e.jsx(va, { className: "size-4" })
2609
+ children: /* @__PURE__ */ e.jsx(Na, { className: "size-4" })
2610
2610
  }
2611
2611
  ),
2612
2612
  /* @__PURE__ */ e.jsx(
@@ -2614,7 +2614,7 @@ function _n() {
2614
2614
  {
2615
2615
  onClick: () => l("pie"),
2616
2616
  variant: "ghost",
2617
- children: /* @__PURE__ */ e.jsx(da, { className: "size-5" })
2617
+ children: /* @__PURE__ */ e.jsx(ha, { className: "size-5" })
2618
2618
  }
2619
2619
  ),
2620
2620
  /* @__PURE__ */ e.jsx(
@@ -2622,7 +2622,7 @@ function _n() {
2622
2622
  {
2623
2623
  onClick: () => l("doughnut"),
2624
2624
  variant: "ghost",
2625
- children: /* @__PURE__ */ e.jsx(ba, { className: "size-5", strokeWidth: 1 })
2625
+ children: /* @__PURE__ */ e.jsx(ya, { className: "size-5", strokeWidth: 1 })
2626
2626
  }
2627
2627
  ),
2628
2628
  /* @__PURE__ */ e.jsx(
@@ -2631,7 +2631,7 @@ function _n() {
2631
2631
  onClick: () => l("radar"),
2632
2632
  variant: "ghost",
2633
2633
  children: /* @__PURE__ */ e.jsx(
2634
- ja,
2634
+ ba,
2635
2635
  {
2636
2636
  className: "size-5 font-extralight",
2637
2637
  strokeWidth: 0.5
@@ -2644,7 +2644,7 @@ function _n() {
2644
2644
  {
2645
2645
  onClick: () => l("polarArea"),
2646
2646
  variant: "ghost",
2647
- children: /* @__PURE__ */ e.jsx(ya, { className: "size-5" })
2647
+ children: /* @__PURE__ */ e.jsx(va, { className: "size-5" })
2648
2648
  }
2649
2649
  ),
2650
2650
  /* @__PURE__ */ e.jsx(
@@ -2652,7 +2652,7 @@ function _n() {
2652
2652
  {
2653
2653
  onClick: () => l("pyramid"),
2654
2654
  variant: "ghost",
2655
- children: /* @__PURE__ */ e.jsx(Sa, { className: "size-5" })
2655
+ children: /* @__PURE__ */ e.jsx(ka, { className: "size-5" })
2656
2656
  }
2657
2657
  ),
2658
2658
  /* @__PURE__ */ e.jsx(
@@ -2660,7 +2660,7 @@ function _n() {
2660
2660
  {
2661
2661
  onClick: () => l("range"),
2662
2662
  variant: "ghost",
2663
- children: /* @__PURE__ */ e.jsx(oa, { className: "size-5" })
2663
+ children: /* @__PURE__ */ e.jsx(ca, { className: "size-5" })
2664
2664
  }
2665
2665
  ),
2666
2666
  /* @__PURE__ */ e.jsx(
@@ -2676,52 +2676,52 @@ function _n() {
2676
2676
  {
2677
2677
  onClick: () => l("kpi"),
2678
2678
  variant: "ghost",
2679
- children: /* @__PURE__ */ e.jsx(Ca, { className: "size-6" })
2679
+ children: /* @__PURE__ */ e.jsx(Sa, { className: "size-6" })
2680
2680
  }
2681
2681
  )
2682
2682
  ] }) })
2683
2683
  ] });
2684
2684
  }
2685
- function Hn({ chartType: s, className: n }) {
2685
+ function Bn({ chartType: s, className: n }) {
2686
2686
  switch (s) {
2687
2687
  case "bar":
2688
- return /* @__PURE__ */ e.jsx(Ss, { className: n });
2689
- case "line":
2690
2688
  return /* @__PURE__ */ e.jsx(ks, { className: n });
2689
+ case "line":
2690
+ return /* @__PURE__ */ e.jsx(ws, { className: n });
2691
2691
  case "pie":
2692
- return /* @__PURE__ */ e.jsx(da, { className: n });
2692
+ return /* @__PURE__ */ e.jsx(ha, { className: n });
2693
2693
  case "radar":
2694
- return /* @__PURE__ */ e.jsx(ja, { className: n });
2694
+ return /* @__PURE__ */ e.jsx(ba, { className: n });
2695
2695
  case "scatter":
2696
- return /* @__PURE__ */ e.jsx(ha, { className: n });
2696
+ return /* @__PURE__ */ e.jsx(ma, { className: n });
2697
2697
  case "bubble":
2698
- return /* @__PURE__ */ e.jsx(va, { className: n });
2698
+ return /* @__PURE__ */ e.jsx(Na, { className: n });
2699
2699
  case "doughnut":
2700
- return /* @__PURE__ */ e.jsx(ba, { className: n });
2700
+ return /* @__PURE__ */ e.jsx(ya, { className: n });
2701
2701
  case "stackedBar":
2702
- return /* @__PURE__ */ e.jsx(Na, { className: "size-4 text-foreground/70" });
2702
+ return /* @__PURE__ */ e.jsx(Ca, { className: "size-4 text-foreground/70" });
2703
2703
  case "polarArea":
2704
- return /* @__PURE__ */ e.jsx(ya, { className: n });
2704
+ return /* @__PURE__ */ e.jsx(va, { className: n });
2705
2705
  case "pyramid":
2706
- return /* @__PURE__ */ e.jsx(Sa, { className: n });
2706
+ return /* @__PURE__ */ e.jsx(ka, { className: n });
2707
2707
  case "range":
2708
- return /* @__PURE__ */ e.jsx(oa, { className: n });
2708
+ return /* @__PURE__ */ e.jsx(ca, { className: n });
2709
2709
  case "kpi":
2710
- return /* @__PURE__ */ e.jsx(Ca, { className: n });
2710
+ return /* @__PURE__ */ e.jsx(Sa, { className: n });
2711
2711
  default:
2712
2712
  return /* @__PURE__ */ e.jsx(vs, { className: n });
2713
2713
  }
2714
2714
  }
2715
- function Bn() {
2715
+ function $n() {
2716
2716
  const s = r(
2717
2717
  (a) => a.card.refreshInterval
2718
2718
  ), n = r(
2719
2719
  (a) => a.actions.setCardRefreshInterval
2720
2720
  );
2721
- return /* @__PURE__ */ e.jsxs(Ke, { children: [
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" }),
2721
+ return /* @__PURE__ */ e.jsxs(Pe, { children: [
2722
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(z, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Gt, { className: "w-4 h-4" }) }) }),
2723
+ /* @__PURE__ */ e.jsx(Ge, { className: "w-[200px]", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-4", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-5 items-center gap-1", children: [
2724
+ /* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
2725
2725
  /* @__PURE__ */ e.jsx(
2726
2726
  ae,
2727
2727
  {
@@ -2735,27 +2735,27 @@ function Bn() {
2735
2735
  ] }) }) }) })
2736
2736
  ] });
2737
2737
  }
2738
- function Hs() {
2738
+ function $s() {
2739
2739
  r((l) => l.frame);
2740
2740
  const s = r((l) => l.card), n = r((l) => l.card.data), a = r((l) => l.isShowingVisual), t = r((l) => l.isSqlRunning), i = r((l) => l.queryError), o = r((l) => l.pythonStdOut);
2741
2741
  return r((l) => l.onSave), r((l) => l.onClose), r((l) => l.actions.setCardSql), r((l) => l.actions.setCardType), r((l) => l.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
2742
- 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" }),
2742
+ t && /* @__PURE__ */ e.jsx(Be, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
2743
2743
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
2744
2744
  a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2745
- /* @__PURE__ */ e.jsx(_n, {}),
2746
- s.type !== "table" && /* @__PURE__ */ e.jsx(Rn, {}),
2747
- /* @__PURE__ */ e.jsx(Bn, {})
2745
+ /* @__PURE__ */ e.jsx(Hn, {}),
2746
+ s.type !== "table" && /* @__PURE__ */ e.jsx(_n, {}),
2747
+ /* @__PURE__ */ e.jsx($n, {})
2748
2748
  ] }),
2749
- /* @__PURE__ */ e.jsx(Kn, {})
2749
+ /* @__PURE__ */ e.jsx(Pn, {})
2750
2750
  ] }),
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 || [] }),
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(Ft, { isLoading: t, card: s }) }) }) : /* @__PURE__ */ e.jsx(ja, { className: "grow border-none shadow-none" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
2752
+ o && /* @__PURE__ */ e.jsx(Kn, {}),
2753
+ s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(Rn, { data: n || [] }),
2754
2754
  i && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: i })
2755
2755
  ] })
2756
2756
  ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
2757
2757
  }
2758
- function $n() {
2758
+ function Kn() {
2759
2759
  const s = r((a) => a.pythonStdOut);
2760
2760
  if (!s)
2761
2761
  return null;
@@ -2772,14 +2772,14 @@ function $n() {
2772
2772
  /* @__PURE__ */ e.jsx(Cs, { className: "mb-2" })
2773
2773
  ] });
2774
2774
  }
2775
- function Kn() {
2775
+ function Pn() {
2776
2776
  const s = r((a) => a.isShowingVisual), n = r(
2777
2777
  (a) => a.actions.setIsShowingVisual
2778
2778
  );
2779
2779
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2780
- /* @__PURE__ */ e.jsx(R, { htmlFor: "visualize", children: "Chart" }),
2780
+ /* @__PURE__ */ e.jsx(B, { htmlFor: "visualize", children: "Chart" }),
2781
2781
  /* @__PURE__ */ e.jsx(
2782
- Ft,
2782
+ Ot,
2783
2783
  {
2784
2784
  checked: s,
2785
2785
  onCheckedChange: () => n(!s),
@@ -2789,48 +2789,212 @@ function Kn() {
2789
2789
  )
2790
2790
  ] });
2791
2791
  }
2792
- const ke = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
2793
- function Bs(s, n) {
2792
+ function De() {
2793
+ const [s, n] = T([]);
2794
+ r(
2795
+ (m) => m.card.cfg
2796
+ );
2797
+ const a = r((m) => m.card.preferences), { setCardCfg: t, setFilterOnClickColumnIndex: i, setCardPreferences: o } = r((m) => m.actions), l = r(
2798
+ (m) => m.queryResultColumns
2799
+ );
2800
+ r(
2801
+ (m) => {
2802
+ var u;
2803
+ return (u = m.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
2804
+ }
2805
+ ), K(() => {
2806
+ l && n(new Array(l.length).fill(!1));
2807
+ }, [l]);
2808
+ function c(m, u) {
2809
+ var N, d;
2810
+ u ? a != null && a.onClickFilter && ((N = a == null ? void 0 : a.onClickFilter) == null ? void 0 : N.length) > 0 ? o({
2811
+ ...a,
2812
+ onClickFilter: [
2813
+ ...a.onClickFilter,
2814
+ {
2815
+ columnIndex: m,
2816
+ expression: ""
2817
+ }
2818
+ ]
2819
+ }) : o({
2820
+ ...a,
2821
+ onClickFilter: [
2822
+ {
2823
+ columnIndex: m,
2824
+ expression: ""
2825
+ }
2826
+ ]
2827
+ }) : (o({
2828
+ ...a,
2829
+ onClickFilter: (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.filter(
2830
+ (x) => x.columnIndex !== m
2831
+ )
2832
+ }), n((x) => {
2833
+ const f = [...x];
2834
+ return f[m] = !1, f;
2835
+ }));
2836
+ }
2837
+ function h(m, u) {
2838
+ var d;
2839
+ const N = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.map((x) => x.columnIndex === m ? {
2840
+ ...x,
2841
+ expression: u.target.value
2842
+ } : x);
2843
+ o({
2844
+ ...a,
2845
+ onClickFilter: N
2846
+ });
2847
+ }
2848
+ function g(m) {
2849
+ var u, N, d, x;
2850
+ if (s != null && s[m] || (N = (u = a == null ? void 0 : a.onClickFilter) == null ? void 0 : u.find((f) => f.columnIndex === m)) != null && N.expression)
2851
+ return /* @__PURE__ */ e.jsx(
2852
+ ae,
2853
+ {
2854
+ value: (x = (d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.find((f) => f.columnIndex === m)) == null ? void 0 : x.expression,
2855
+ onChange: (f) => h(m, f),
2856
+ type: "text",
2857
+ className: " h-9 w-full focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 font-mono text-xs",
2858
+ placeholder: "Expression"
2859
+ }
2860
+ );
2861
+ }
2862
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: l == null ? void 0 : l.map((m, u) => {
2863
+ var N, d;
2864
+ return /* @__PURE__ */ e.jsx(
2865
+ "div",
2866
+ {
2867
+ className: "flex items-center justify-between space-y-2 xbg-red-100 group",
2868
+ children: /* @__PURE__ */ e.jsxs("div", { className: " grow", children: [
2869
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center py-2 space-x-2", children: [
2870
+ /* @__PURE__ */ e.jsx(
2871
+ Ke,
2872
+ {
2873
+ checked: !!((N = a == null ? void 0 : a.onClickFilter) != null && N.find(
2874
+ (x) => x.columnIndex === u
2875
+ )),
2876
+ onCheckedChange: (x) => c(u, x)
2877
+ }
2878
+ ),
2879
+ /* @__PURE__ */ e.jsx(
2880
+ "label",
2881
+ {
2882
+ className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
2883
+ children: m
2884
+ }
2885
+ ),
2886
+ /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((d = a == null ? void 0 : a.onClickFilter) == null ? void 0 : d.find(
2887
+ (x) => x.columnIndex === u
2888
+ )) && /* @__PURE__ */ e.jsx(
2889
+ da,
2890
+ {
2891
+ onClick: () => {
2892
+ n((x) => {
2893
+ const f = [...x];
2894
+ return f[u] = !x[u], f;
2895
+ });
2896
+ },
2897
+ className: " invisible group-hover:visible size-3 text-gray-400 cursor-pointer"
2898
+ }
2899
+ ) })
2900
+ ] }),
2901
+ g(u)
2902
+ ] })
2903
+ },
2904
+ m
2905
+ );
2906
+ }) });
2907
+ }
2908
+ function zs() {
2909
+ var o, l, c;
2910
+ const s = r((h) => h.card.preferences), n = r(
2911
+ (h) => h.card.cfg
2912
+ ), { setCardCfg: a, setCardPreferences: t } = r(
2913
+ (h) => h.actions
2914
+ );
2915
+ (o = n == null ? void 0 : n.options) != null && o.indexAxis;
2916
+ function i(h) {
2917
+ var u, N, d, x, f, w;
2918
+ let g = {};
2919
+ (u = s == null ? void 0 : s.chartOptions) != null && u.scales && (g = {
2920
+ x: (d = (N = s == null ? void 0 : s.chartOptions) == null ? void 0 : N.scales) == null ? void 0 : d.y,
2921
+ y: (f = (x = s == null ? void 0 : s.chartOptions) == null ? void 0 : x.scales) == null ? void 0 : f.x
2922
+ });
2923
+ const m = {
2924
+ ...s,
2925
+ chartOptions: {
2926
+ ...s == null ? void 0 : s.chartOptions,
2927
+ scales: {
2928
+ ...(w = s == null ? void 0 : s.chartOptions) == null ? void 0 : w.scales,
2929
+ ...g
2930
+ },
2931
+ indexAxis: h
2932
+ }
2933
+ };
2934
+ t(m);
2935
+ }
2936
+ return /* @__PURE__ */ e.jsxs(
2937
+ ra,
2938
+ {
2939
+ value: ((l = s == null ? void 0 : s.chartOptions) == null ? void 0 : l.indexAxis) || ((c = n == null ? void 0 : n.options) == null ? void 0 : c.indexAxis) || "x",
2940
+ onValueChange: i,
2941
+ className: "flex gap-3",
2942
+ defaultValue: "x",
2943
+ children: [
2944
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2945
+ /* @__PURE__ */ e.jsx(Ye, { value: "x", id: "r1" }),
2946
+ /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
2947
+ ] }),
2948
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2949
+ /* @__PURE__ */ e.jsx(Ye, { value: "y", id: "r2" }),
2950
+ /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
2951
+ ] })
2952
+ ]
2953
+ }
2954
+ );
2955
+ }
2956
+ const we = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
2957
+ function Ks(s, n) {
2794
2958
  var t, i, o;
2795
- const a = na(s, n);
2959
+ const a = ia(s, n);
2796
2960
  return ((o = (i = (t = s == null ? void 0 : s.chartOptions) == null ? void 0 : t.scales) == null ? void 0 : i[a]) == null ? void 0 : o.type) || "linear";
2797
2961
  }
2798
- function ka() {
2799
- var J, ee, Z, P, I, y;
2962
+ function wa() {
2963
+ var J, ee, Z, U, I, y;
2800
2964
  const [s, n] = T(!1), a = r((v) => {
2801
2965
  var M;
2802
2966
  return (M = v.card) == null ? void 0 : M.preferences;
2803
2967
  }), t = r((v) => {
2804
2968
  var M;
2805
2969
  return (M = v.card) == null ? void 0 : M.cfg;
2806
- }), i = na(a, t), [o, l] = T(
2807
- Bs(a)
2970
+ }), i = ia(a, t), [o, l] = T(
2971
+ Ks(a)
2808
2972
  ), [c, h] = T(
2809
2973
  ((Z = (ee = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : ee[i]) == null ? void 0 : Z.min) || ""
2810
2974
  ), [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(
2975
+ ((y = (I = (U = a == null ? void 0 : a.chartOptions) == null ? void 0 : U.scales) == null ? void 0 : I[i]) == null ? void 0 : y.max) || ""
2976
+ ), [u, N] = T(c || g ? "custom" : "auto"), [d, x] = T(""), [f, w] = T(0), [b, L] = T(""), [C, O] = T(""), [j, F] = T(""), A = r(
2813
2977
  (v) => v.actions.setCardPreferences
2814
- ), q = r((v) => {
2978
+ ), V = r((v) => {
2815
2979
  var M;
2816
2980
  return (M = v.card) == null ? void 0 : M.type;
2817
- }), Y = ["pie", "doughnut", "polarArea"].includes(q);
2981
+ }), Y = ["pie", "doughnut", "polarArea"].includes(V);
2818
2982
  K(() => {
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 : ""
2983
+ var v, M, H, ue, se, ge, je, be, xe, G, ne, le, ye, re;
2984
+ l(Ks(a)), h(
2985
+ ((H = (M = (v = a == null ? void 0 : a.chartOptions) == null ? void 0 : v.scales) == null ? void 0 : M[i]) == null ? void 0 : H.min) === 0 ? 0 : ""
2822
2986
  ), m(((ge = (se = (ue = a == null ? void 0 : a.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[i]) == null ? void 0 : ge.max) || ""), x(
2823
2987
  ((G = (xe = (be = (je = a == null ? void 0 : a.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[i]) == null ? void 0 : xe.ticks) == null ? void 0 : G.stepSize) || ""
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) || "");
2988
+ ), w(((ne = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ne.decimalPlaces) || 0), L(((le = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : le.suffix) || ""), O(((ye = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ye.currency) || ""), F(((re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : re.locale) || "");
2825
2989
  }, [s, a, i]);
2826
2990
  function $(v, M) {
2827
2991
  return M === "" || /^[0-9\b]+$/.test(M) ? Number(M) : Number(v);
2828
2992
  }
2829
- function U() {
2993
+ function P() {
2830
2994
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2831
2995
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
2832
2996
  /* @__PURE__ */ e.jsx(
2833
- R,
2997
+ B,
2834
2998
  {
2835
2999
  className: "col-span-2 hover:cursor-pointer hover:underline",
2836
3000
  htmlFor: "currency",
@@ -2851,7 +3015,7 @@ function ka() {
2851
3015
  placeholder: "USD",
2852
3016
  onChange: (v) => O(v.target.value),
2853
3017
  id: "currency",
2854
- className: `col-span-2 h-8 w-full ${ke}`
3018
+ className: `col-span-2 h-8 w-full ${we}`
2855
3019
  }
2856
3020
  ),
2857
3021
  /* @__PURE__ */ e.jsx(
@@ -2861,19 +3025,19 @@ function ka() {
2861
3025
  placeholder: "en-US",
2862
3026
  onChange: (v) => F(v.target.value),
2863
3027
  id: "locale",
2864
- className: `col-span-2 h-8 w-full ${ke}`
3028
+ className: `col-span-2 h-8 w-full ${we}`
2865
3029
  }
2866
3030
  )
2867
3031
  ] }),
2868
3032
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-9 items-center gap-2", children: [
2869
- /* @__PURE__ */ e.jsx(R, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
3033
+ /* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "format", children: "Decimals" }),
2870
3034
  /* @__PURE__ */ e.jsx(
2871
3035
  ae,
2872
3036
  {
2873
3037
  value: f,
2874
3038
  onChange: (v) => w(Number(v.target.value)),
2875
3039
  id: "format",
2876
- className: `col-span-6 h-8 w-full tracking-wide ${ke}`
3040
+ className: `col-span-6 h-8 w-full tracking-wide ${we}`
2877
3041
  }
2878
3042
  )
2879
3043
  ] })
@@ -2882,14 +3046,14 @@ function ka() {
2882
3046
  function D() {
2883
3047
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2884
3048
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
2885
- /* @__PURE__ */ e.jsx(R, { htmlFor: "range", children: "Range" }),
3049
+ /* @__PURE__ */ e.jsx(B, { htmlFor: "range", children: "Range" }),
2886
3050
  /* @__PURE__ */ e.jsx(
2887
3051
  ae,
2888
3052
  {
2889
3053
  id: "min",
2890
3054
  value: c,
2891
3055
  onChange: (v) => h((M) => $(M, v.target.value)),
2892
- className: `col-span-1 h-8 w-full ${ke}`
3056
+ className: `col-span-1 h-8 w-full ${we}`
2893
3057
  }
2894
3058
  ),
2895
3059
  /* @__PURE__ */ e.jsx(
@@ -2898,26 +3062,26 @@ function ka() {
2898
3062
  value: g,
2899
3063
  onChange: (v) => m((M) => $(M, v.target.value)),
2900
3064
  id: "max",
2901
- className: `col-span-1 h-8 w-full ${ke}`
3065
+ className: `col-span-1 h-8 w-full ${we}`
2902
3066
  }
2903
3067
  )
2904
3068
  ] }),
2905
3069
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
2906
- /* @__PURE__ */ e.jsx(R, { htmlFor: "step-size", children: "Step Size" }),
3070
+ /* @__PURE__ */ e.jsx(B, { htmlFor: "step-size", children: "Step Size" }),
2907
3071
  /* @__PURE__ */ e.jsx(
2908
3072
  ae,
2909
3073
  {
2910
3074
  value: d,
2911
3075
  onChange: (v) => x((M) => $(M, v.target.value)),
2912
3076
  id: "step-size",
2913
- className: `col-span-1 h-8 w-full ${ke}`
3077
+ className: `col-span-1 h-8 w-full ${we}`
2914
3078
  }
2915
3079
  )
2916
3080
  ] })
2917
3081
  ] });
2918
3082
  }
2919
3083
  function te() {
2920
- var V;
3084
+ var H;
2921
3085
  let v = {};
2922
3086
  u === "custom" && (v = {
2923
3087
  min: c,
@@ -2931,7 +3095,7 @@ function ka() {
2931
3095
  chartOptions: {
2932
3096
  ...a == null ? void 0 : a.chartOptions,
2933
3097
  scales: {
2934
- ...(V = a == null ? void 0 : a.chartOptions) == null ? void 0 : V.scales,
3098
+ ...(H = a == null ? void 0 : a.chartOptions) == null ? void 0 : H.scales,
2935
3099
  [i]: {
2936
3100
  // ...cardPreferences?.chartOptions?.scales?.[axis],
2937
3101
  type: o,
@@ -2948,25 +3112,25 @@ function ka() {
2948
3112
  };
2949
3113
  A(M);
2950
3114
  }
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: [
3115
+ return /* @__PURE__ */ e.jsxs(Pe, { onOpenChange: (v) => n(v), children: [
3116
+ /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: /* @__PURE__ */ e.jsx(Mt, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3117
+ /* @__PURE__ */ e.jsx(Ge, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
2954
3118
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
2955
3119
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
2956
3120
  /* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
2957
3121
  ] }),
2958
3122
  /* @__PURE__ */ e.jsxs("div", { className: "grid gap-2", children: [
2959
3123
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
2960
- /* @__PURE__ */ e.jsx(R, { htmlFor: "scale", children: "Type" }),
3124
+ /* @__PURE__ */ e.jsx(B, { htmlFor: "scale", children: "Type" }),
2961
3125
  /* @__PURE__ */ e.jsxs(
2962
- Fe,
3126
+ Oe,
2963
3127
  {
2964
3128
  disabled: Y,
2965
3129
  value: o,
2966
3130
  onValueChange: (v) => l(v),
2967
3131
  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: [
3132
+ /* @__PURE__ */ e.jsx(Me, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3133
+ /* @__PURE__ */ e.jsx(Ae, { id: "type", children: /* @__PURE__ */ e.jsxs(He, { children: [
2970
3134
  /* @__PURE__ */ e.jsx(Le, { children: "Option" }),
2971
3135
  /* @__PURE__ */ e.jsx(X, { value: "linear", children: "Linear" }),
2972
3136
  /* @__PURE__ */ e.jsx(X, { value: "logarithmic", children: "Logarithmic" })
@@ -2976,9 +3140,9 @@ function ka() {
2976
3140
  )
2977
3141
  ] }),
2978
3142
  o == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
2979
- /* @__PURE__ */ e.jsx(R, { htmlFor: "scale-option", children: "Setup" }),
3143
+ /* @__PURE__ */ e.jsx(B, { htmlFor: "scale-option", children: "Setup" }),
2980
3144
  /* @__PURE__ */ e.jsxs(
2981
- la,
3145
+ ra,
2982
3146
  {
2983
3147
  disabled: Y,
2984
3148
  id: "scale-option",
@@ -3000,8 +3164,8 @@ function ka() {
3000
3164
  )
3001
3165
  ] }),
3002
3166
  u === "custom" && o == "linear" && D(),
3003
- U(),
3004
- /* @__PURE__ */ e.jsx(Mt, {}),
3167
+ P(),
3168
+ /* @__PURE__ */ e.jsx(Tt, {}),
3005
3169
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
3006
3170
  z,
3007
3171
  {
@@ -3015,174 +3179,316 @@ function ka() {
3015
3179
  ] }) })
3016
3180
  ] });
3017
3181
  }
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
- }
3041
- };
3042
- n(g), console.log(c);
3043
- }
3044
- return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3045
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
3046
- /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
3047
- !["pyramid", "range"].includes(a) && /* @__PURE__ */ e.jsx(ka, {})
3048
- ] }),
3049
- /* @__PURE__ */ e.jsxs(
3050
- Fe,
3051
- {
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,
3053
- onValueChange: t,
3054
- defaultValue: "none",
3055
- 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: [
3058
- /* @__PURE__ */ e.jsx(Le, { children: "Data Labels" }),
3059
- /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
3060
- a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "start", children: "Start" }),
3061
- /* @__PURE__ */ e.jsx(X, { value: "center", children: "Center" }),
3062
- a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "end", children: "End" })
3063
- ] }) })
3182
+ function Un({ idx: s }) {
3183
+ var c;
3184
+ const n = r((h) => {
3185
+ var g;
3186
+ return (g = h.card) == null ? void 0 : g.preferences;
3187
+ }), a = r(
3188
+ (h) => {
3189
+ var g;
3190
+ return (g = h.card.preferences) == null ? void 0 : g.datasetOptions;
3191
+ }
3192
+ ), t = r(
3193
+ (h) => h.actions.setCardPreferences
3194
+ ), i = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.indexAxis, o = a == null ? void 0 : a.find((h) => h.idx === s);
3195
+ function l(h, g) {
3196
+ (h === "end" || h === "start") && Et(Lt());
3197
+ const m = {
3198
+ display: h !== "none",
3199
+ align: h,
3200
+ anchor: h,
3201
+ clamp: !0
3202
+ };
3203
+ if (!o)
3204
+ t({
3205
+ ...n,
3206
+ datasetOptions: [
3207
+ ...a || [],
3208
+ {
3209
+ idx: g,
3210
+ datalabels: m
3211
+ }
3064
3212
  ]
3065
- }
3066
- )
3067
- ] });
3068
- }
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;
3213
+ });
3214
+ else {
3215
+ const u = { ...o };
3216
+ u.datalabels = m;
3217
+ const N = a == null ? void 0 : a.map(
3218
+ (d) => d.idx === g ? u : d
3219
+ );
3220
+ t({
3221
+ ...n,
3222
+ datasetOptions: N
3223
+ });
3081
3224
  }
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,
3225
+ }
3226
+ return /* @__PURE__ */ e.jsxs(Pe, { children: [
3227
+ /* @__PURE__ */ e.jsx(Ue, { children: /* @__PURE__ */ e.jsx(xn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
3228
+ /* @__PURE__ */ e.jsx(Ge, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3229
+ /* @__PURE__ */ e.jsx(
3230
+ z,
3091
3231
  {
3092
- columnIndex: m,
3093
- expression: ""
3232
+ onClick: () => l("none", s),
3233
+ size: "sm",
3234
+ variant: "secondary",
3235
+ className: "h-7 p-1 text-xs font-normal",
3236
+ children: /* @__PURE__ */ e.jsx(At, { className: "size-4" })
3094
3237
  }
3095
- ]
3096
- }) : o({
3097
- ...a,
3098
- onClickFilter: [
3238
+ ),
3239
+ /* @__PURE__ */ e.jsx(
3240
+ z,
3099
3241
  {
3100
- columnIndex: m,
3101
- expression: ""
3242
+ onClick: () => l("start", s),
3243
+ size: "sm",
3244
+ variant: "secondary",
3245
+ className: "h-7 p-1 text-xs font-normal",
3246
+ children: /* @__PURE__ */ e.jsx(
3247
+ an,
3248
+ {
3249
+ className: W("h-4 w-4", {
3250
+ "rotate-90": i === "y"
3251
+ })
3252
+ }
3253
+ )
3254
+ }
3255
+ ),
3256
+ /* @__PURE__ */ e.jsx(
3257
+ z,
3258
+ {
3259
+ onClick: () => l("center", s),
3260
+ size: "sm",
3261
+ variant: "secondary",
3262
+ className: "h-7 p-1 text-xs font-normal",
3263
+ children: /* @__PURE__ */ e.jsx(
3264
+ nn,
3265
+ {
3266
+ className: W("h-4 w-4", {
3267
+ "rotate-90": i === "y"
3268
+ })
3269
+ }
3270
+ )
3271
+ }
3272
+ ),
3273
+ /* @__PURE__ */ e.jsx(
3274
+ z,
3275
+ {
3276
+ onClick: () => l("end", s),
3277
+ size: "sm",
3278
+ variant: "secondary",
3279
+ className: "h-7 p-1 text-xs font-normal",
3280
+ children: /* @__PURE__ */ e.jsx(
3281
+ tn,
3282
+ {
3283
+ className: W("h-4 w-4", {
3284
+ "rotate-90": i === "y"
3285
+ })
3286
+ }
3287
+ )
3102
3288
  }
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
3289
  )
3109
- }), n((x) => {
3110
- const f = [...x];
3111
- return f[m] = !1, f;
3112
- }));
3290
+ ] }) })
3291
+ ] });
3292
+ }
3293
+ function za() {
3294
+ const s = r((h) => h.card), n = r(
3295
+ (h) => {
3296
+ var g, m, u;
3297
+ return (u = (m = (g = h == null ? void 0 : h.card) == null ? void 0 : g.preferences) == null ? void 0 : m.chartOptions) == null ? void 0 : u.indexAxis;
3298
+ }
3299
+ ), a = n === "y" ? "Y axis" : "X axis", t = n === "y" ? "X axis" : "Y axis", {
3300
+ keys: i,
3301
+ metricKeys: o,
3302
+ dimensionKeys: l
3303
+ } = ds(s.data || []);
3304
+ let c = o;
3305
+ if (s.type === "stackedBar") {
3306
+ const h = Dt({
3307
+ dataArray: s.data || [],
3308
+ groupKey: l[0],
3309
+ pivotKey: l[1],
3310
+ valueKey: c[0]
3311
+ }), { metricKeys: g } = ds(h);
3312
+ c = g;
3113
3313
  }
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
- });
3314
+ return i.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3315
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3316
+ /* @__PURE__ */ e.jsx(B, { children: a }),
3317
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: l[0] }) }) })
3318
+ ] }),
3319
+ /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3320
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
3321
+ /* @__PURE__ */ e.jsx(B, { children: t }),
3322
+ /* @__PURE__ */ e.jsx(wa, {})
3323
+ ] }),
3324
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((h, g) => /* @__PURE__ */ e.jsx(Gn, { col: h, idx: g }, h)) })
3325
+ ] })
3326
+ ] });
3327
+ }
3328
+ function Gn({ col: s, idx: n }) {
3329
+ const a = r((c) => {
3330
+ var h;
3331
+ return (h = c.card) == null ? void 0 : h.preferences;
3332
+ }), t = r(
3333
+ (c) => {
3334
+ var h;
3335
+ return (h = c.card.preferences) == null ? void 0 : h.datasetOptions;
3336
+ }
3337
+ ), i = t == null ? void 0 : t.find((c) => c.idx === n), { setCardPreferences: o } = r((c) => c.actions);
3338
+ function l(c) {
3339
+ if (!i)
3340
+ o({
3341
+ ...a,
3342
+ datasetOptions: [
3343
+ ...t || [],
3344
+ {
3345
+ idx: n,
3346
+ type: c === "area" ? "line" : c,
3347
+ fill: c === "area" ? "origin" : ""
3348
+ }
3349
+ ]
3350
+ });
3351
+ else {
3352
+ const h = { ...i };
3353
+ h.type = c === "area" ? "line" : c, h.fill = c === "area" ? "origin" : "";
3354
+ const g = t == null ? void 0 : t.map(
3355
+ (m) => m.idx === n ? h : m
3356
+ );
3357
+ o({
3358
+ ...a,
3359
+ datasetOptions: g
3360
+ });
3361
+ }
3124
3362
  }
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,
3363
+ 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: [
3364
+ /* @__PURE__ */ e.jsx("p", { children: s }),
3365
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3366
+ /* @__PURE__ */ e.jsx(
3367
+ ks,
3130
3368
  {
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"
3369
+ onClick: () => l("bar"),
3370
+ className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3136
3371
  }
3137
- );
3372
+ ),
3373
+ /* @__PURE__ */ e.jsx(
3374
+ ws,
3375
+ {
3376
+ onClick: () => l("line"),
3377
+ className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3378
+ }
3379
+ ),
3380
+ /* @__PURE__ */ e.jsx(
3381
+ Jt,
3382
+ {
3383
+ onClick: () => l("area"),
3384
+ className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3385
+ }
3386
+ ),
3387
+ /* @__PURE__ */ e.jsx(
3388
+ Cs,
3389
+ {
3390
+ orientation: "vertical",
3391
+ className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
3392
+ }
3393
+ ),
3394
+ /* @__PURE__ */ e.jsx(Un, { idx: n })
3395
+ ] })
3396
+ ] });
3397
+ }
3398
+ function Jn({
3399
+ cardType: s
3400
+ }) {
3401
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3402
+ /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3403
+ /* @__PURE__ */ e.jsx(R, { children: `${Ss(s)} Chart` }),
3404
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
3405
+ /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2,... FROM table" }),
3406
+ /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3407
+ /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
3408
+ /* @__PURE__ */ e.jsx("li", { children: "y-axis1 - number" }),
3409
+ /* @__PURE__ */ e.jsx("li", { children: "y-axis2 - number" })
3410
+ ] }),
3411
+ /* @__PURE__ */ e.jsxs("div", { children: [
3412
+ "See ",
3413
+ /* @__PURE__ */ e.jsx(
3414
+ "a",
3415
+ {
3416
+ target: "_blank",
3417
+ onClick: (n) => n.stopPropagation(),
3418
+ className: "text-blue-700",
3419
+ href: "https://docs.semaphor.cloud/concepts/visuals#line-chart",
3420
+ children: "example"
3421
+ }
3422
+ ),
3423
+ " in the docs."
3424
+ ] })
3425
+ ] })
3426
+ ] }),
3427
+ /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3428
+ /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3429
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
3430
+ /* @__PURE__ */ e.jsx(zs, {}),
3431
+ /* @__PURE__ */ e.jsx(za, {})
3432
+ ] })
3433
+ ] }),
3434
+ /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3435
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3436
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3437
+ ] })
3438
+ ] }) });
3439
+ }
3440
+ function Fs() {
3441
+ var i, o, l;
3442
+ const s = r(
3443
+ (c) => c.card.cfg
3444
+ ), n = r((c) => c.actions.setCardCfg), a = r((c) => c.card.type);
3445
+ function t(c) {
3446
+ var m;
3447
+ const h = {
3448
+ datalabels: {
3449
+ display: c !== "none",
3450
+ align: c,
3451
+ anchor: c,
3452
+ clamp: !0
3453
+ }
3454
+ }, g = {
3455
+ ...s,
3456
+ options: {
3457
+ ...s == null ? void 0 : s.options,
3458
+ plugins: {
3459
+ ...(m = s == null ? void 0 : s.options) == null ? void 0 : m.plugins,
3460
+ ...h
3461
+ }
3462
+ }
3463
+ };
3464
+ n(g), console.log(c);
3138
3465
  }
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",
3466
+ return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3467
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
3468
+ /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
3469
+ !["pyramid", "range"].includes(a) && /* @__PURE__ */ e.jsx(wa, {})
3470
+ ] }),
3471
+ /* @__PURE__ */ e.jsxs(
3472
+ Oe,
3143
3473
  {
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
- }) });
3474
+ value: (l = (o = (i = s == null ? void 0 : s.options) == null ? void 0 : i.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : l.anchor,
3475
+ onValueChange: t,
3476
+ defaultValue: "none",
3477
+ children: [
3478
+ /* @__PURE__ */ e.jsx(Me, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, { placeholder: "Select position" }) }),
3479
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3480
+ /* @__PURE__ */ e.jsx(Le, { children: "Data Labels" }),
3481
+ /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }),
3482
+ a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "start", children: "Start" }),
3483
+ /* @__PURE__ */ e.jsx(X, { value: "center", children: "Center" }),
3484
+ a !== "pyramid" && /* @__PURE__ */ e.jsx(X, { value: "end", children: "End" })
3485
+ ] }) })
3486
+ ]
3487
+ }
3488
+ )
3489
+ ] });
3184
3490
  }
3185
- function Un({
3491
+ function Qn({
3186
3492
  cardType: s
3187
3493
  }) {
3188
3494
  function n(a) {
@@ -3193,89 +3499,41 @@ function Un({
3193
3499
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
3194
3500
  /* @__PURE__ */ e.jsx("li", { children: "group - category" }),
3195
3501
  /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
3196
- /* @__PURE__ */ e.jsx("li", { children: "y-axis - category" }),
3197
- a === "bubble" && /* @__PURE__ */ e.jsx("li", { children: "radius - number" })
3198
- ] }),
3199
- /* @__PURE__ */ e.jsxs("div", { children: [
3200
- "See ",
3201
- /* @__PURE__ */ e.jsx(
3202
- "a",
3203
- {
3204
- target: "_blank",
3205
- onClick: (o) => o.stopPropagation(),
3206
- className: "text-blue-700",
3207
- href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
3208
- children: "example"
3209
- }
3210
- ),
3211
- " in the docs."
3212
- ] })
3213
- ] });
3214
- }
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) })
3219
- ] }),
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, {}) })
3223
- ] }),
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, {}) })
3227
- ] })
3228
- ] }) });
3229
- }
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);
3502
+ /* @__PURE__ */ e.jsx("li", { children: "y-axis - category" }),
3503
+ a === "bubble" && /* @__PURE__ */ e.jsx("li", { children: "radius - number" })
3504
+ ] }),
3505
+ /* @__PURE__ */ e.jsxs("div", { children: [
3506
+ "See ",
3507
+ /* @__PURE__ */ e.jsx(
3508
+ "a",
3509
+ {
3510
+ target: "_blank",
3511
+ onClick: (o) => o.stopPropagation(),
3512
+ className: "text-blue-700",
3513
+ href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
3514
+ children: "example"
3515
+ }
3516
+ ),
3517
+ " in the docs."
3518
+ ] })
3519
+ ] });
3257
3520
  }
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
- );
3521
+ return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3522
+ /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3523
+ /* @__PURE__ */ e.jsx(R, { children: `${Ss(s)} Chart` }),
3524
+ /* @__PURE__ */ e.jsx(_, { className: " space-y-4 font-mono text-xs ", children: n(s) })
3525
+ ] }),
3526
+ /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3527
+ /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3528
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Fs, {}) })
3529
+ ] }),
3530
+ /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3531
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3532
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3533
+ ] })
3534
+ ] }) });
3277
3535
  }
3278
- const Pn = {
3536
+ const Wn = {
3279
3537
  datasets: [
3280
3538
  {
3281
3539
  type: "line",
@@ -3288,7 +3546,7 @@ const Pn = {
3288
3546
  data: []
3289
3547
  }
3290
3548
  ]
3291
- }, Gn = {
3549
+ }, Yn = {
3292
3550
  datasets: [
3293
3551
  {
3294
3552
  fill: "origin",
@@ -3298,29 +3556,29 @@ const Pn = {
3298
3556
  }
3299
3557
  ]
3300
3558
  };
3301
- function Jn() {
3559
+ function Xn() {
3302
3560
  const s = r((n) => n.card.type);
3303
3561
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
3304
3562
  /* @__PURE__ */ e.jsx(
3305
- Ee,
3563
+ Se,
3306
3564
  {
3307
3565
  className: " ",
3308
3566
  type: "single",
3309
3567
  collapsible: !0,
3310
- children: Qn(s)
3568
+ children: Zn(s)
3311
3569
  }
3312
3570
  ),
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, {}) })
3571
+ /* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(zs, {}) }),
3572
+ /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(Fs, {}) }),
3573
+ /* @__PURE__ */ e.jsx("div", { children: !["kpi"].includes(s) && /* @__PURE__ */ e.jsx(De, {}) })
3316
3574
  ] });
3317
3575
  }
3318
- function Qn(s) {
3576
+ function Zn(s) {
3319
3577
  if (["line", "bar"].includes(s))
3320
3578
  return /* @__PURE__ */ e.jsxs(e.Fragment, { 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: [
3579
+ /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3580
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsx("p", { children: "Chart Query" }) }),
3581
+ /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3324
3582
  /* @__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
3583
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3326
3584
  /* @__PURE__ */ e.jsx("li", { children: "X-axis - Category (ex. city)" }),
@@ -3328,20 +3586,20 @@ function Qn(s) {
3328
3586
  ] })
3329
3587
  ] })
3330
3588
  ] }),
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: [
3589
+ /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3590
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Mixed Chart" }),
3591
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
3334
3592
  /* @__PURE__ */ e.jsxs("p", { children: [
3335
3593
  "Click ",
3336
3594
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
3337
3595
  " and change the `type` property in the dataset."
3338
3596
  ] }),
3339
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Pn, null, 2) })
3597
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Wn, null, 2) })
3340
3598
  ] })
3341
3599
  ] }),
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: [
3600
+ /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3601
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: "Area Chart" }),
3602
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-2 text-xs", children: [
3345
3603
  /* @__PURE__ */ e.jsxs("p", { children: [
3346
3604
  "Click ",
3347
3605
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
@@ -3357,18 +3615,18 @@ function Qn(s) {
3357
3615
  ),
3358
3616
  "for more options."
3359
3617
  ] }),
3360
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Gn, null, 2) })
3618
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Yn, null, 2) })
3361
3619
  ] })
3362
3620
  ] })
3363
3621
  ] });
3364
3622
  if (s === "bubble")
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: [
3623
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3624
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3367
3625
  "How to create a ",
3368
3626
  /* @__PURE__ */ e.jsx("span", { children: s }),
3369
3627
  " chart query?"
3370
3628
  ] }) }),
3371
- /* @__PURE__ */ e.jsxs(B, { className: " ", children: [
3629
+ /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3372
3630
  /* @__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
3631
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3374
3632
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
@@ -3380,13 +3638,13 @@ function Qn(s) {
3380
3638
  ] })
3381
3639
  ] }) });
3382
3640
  if (s === "scatter")
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: [
3641
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3642
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3385
3643
  "How to create a ",
3386
3644
  /* @__PURE__ */ e.jsx("span", { children: s }),
3387
3645
  " chart query?"
3388
3646
  ] }) }),
3389
- /* @__PURE__ */ e.jsxs(B, { className: " ", children: [
3647
+ /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3390
3648
  /* @__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
3649
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3392
3650
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
@@ -3397,13 +3655,13 @@ function Qn(s) {
3397
3655
  ] })
3398
3656
  ] }) });
3399
3657
  if (["pie", "doughnut", "polarArea"].includes(s))
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: [
3658
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3659
+ /* @__PURE__ */ e.jsx(R, { className: "font-normal", children: /* @__PURE__ */ e.jsxs("p", { children: [
3402
3660
  /* @__PURE__ */ e.jsx("span", { children: s === "polarArea" ? "Polar" : s.charAt(0).toUpperCase() + s.slice(1) }),
3403
3661
  " ",
3404
3662
  "chart query"
3405
3663
  ] }) }),
3406
- /* @__PURE__ */ e.jsxs(B, { className: " ", children: [
3664
+ /* @__PURE__ */ e.jsxs(_, { className: " ", children: [
3407
3665
  /* @__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
3666
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs font-normal [&>li]:mt-2", children: [
3409
3667
  /* @__PURE__ */ e.jsx("li", { children: "Label - Category (ex. city)" }),
@@ -3412,7 +3670,7 @@ function Qn(s) {
3412
3670
  ] })
3413
3671
  ] }) });
3414
3672
  }
3415
- function Wn() {
3673
+ function el() {
3416
3674
  var h, g, m, u, N;
3417
3675
  const s = r((d) => d.card.preferences), n = r(
3418
3676
  (d) => d.actions.setCardPreferences
@@ -3446,11 +3704,11 @@ function Wn() {
3446
3704
  }
3447
3705
  ) || [], l = r(
3448
3706
  (d) => d.actions.setColorRanges
3449
- ), c = [...new Set(qs.map((d) => d.currency))];
3707
+ ), c = [...new Set(Rs.map((d) => d.currency))];
3450
3708
  return /* @__PURE__ */ e.jsxs("div", { children: [
3451
3709
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
3452
3710
  /* @__PURE__ */ e.jsx(
3453
- $e,
3711
+ Ke,
3454
3712
  {
3455
3713
  checked: !!((h = s == null ? void 0 : s.formatNumber) != null && h.enabled),
3456
3714
  onCheckedChange: (d) => {
@@ -3464,15 +3722,15 @@ function Wn() {
3464
3722
  }
3465
3723
  }
3466
3724
  ),
3467
- /* @__PURE__ */ e.jsx(R, { children: "Format Number" })
3725
+ /* @__PURE__ */ e.jsx(B, { children: "Format Number" })
3468
3726
  ] }),
3469
3727
  ((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.enabled) === !0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
3470
3728
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 p-2", children: [
3471
3729
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
3472
3730
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
3473
- /* @__PURE__ */ e.jsx(R, { children: "Locale" }),
3731
+ /* @__PURE__ */ e.jsx(B, { children: "Locale" }),
3474
3732
  /* @__PURE__ */ e.jsxs(
3475
- Fe,
3733
+ Oe,
3476
3734
  {
3477
3735
  value: t || "en-US",
3478
3736
  onValueChange: (d) => {
@@ -3485,19 +3743,19 @@ function Wn() {
3485
3743
  );
3486
3744
  },
3487
3745
  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: [
3746
+ /* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3747
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3490
3748
  /* @__PURE__ */ e.jsx(Le, { children: "Format" }),
3491
- qs.map((d) => /* @__PURE__ */ e.jsx(X, { value: d.locale, children: d.locale }, d.locale))
3749
+ Rs.map((d) => /* @__PURE__ */ e.jsx(X, { value: d.locale, children: d.locale }, d.locale))
3492
3750
  ] }) })
3493
3751
  ]
3494
3752
  }
3495
3753
  )
3496
3754
  ] }),
3497
3755
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
3498
- /* @__PURE__ */ e.jsx(R, { children: "Currency" }),
3756
+ /* @__PURE__ */ e.jsx(B, { children: "Currency" }),
3499
3757
  /* @__PURE__ */ e.jsxs(
3500
- Fe,
3758
+ Oe,
3501
3759
  {
3502
3760
  value: i || "none",
3503
3761
  onValueChange: (d) => {
@@ -3510,8 +3768,8 @@ function Wn() {
3510
3768
  );
3511
3769
  },
3512
3770
  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: [
3771
+ /* @__PURE__ */ e.jsx(Me, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3772
+ /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsxs(He, { children: [
3515
3773
  /* @__PURE__ */ e.jsx(Le, { children: "Currency" }),
3516
3774
  /* @__PURE__ */ e.jsx(X, { value: "none", children: "None" }, "none"),
3517
3775
  c.map((d) => /* @__PURE__ */ e.jsx(X, { value: d, children: d }, d))
@@ -3523,9 +3781,9 @@ function Wn() {
3523
3781
  ] }),
3524
3782
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3525
3783
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
3526
- /* @__PURE__ */ e.jsx(R, { children: "Decimals" }),
3784
+ /* @__PURE__ */ e.jsx(B, { children: "Decimals" }),
3527
3785
  /* @__PURE__ */ e.jsxs(
3528
- Fe,
3786
+ Oe,
3529
3787
  {
3530
3788
  value: ((u = (m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.decimalPlaces) == null ? void 0 : u.toString()) || "0",
3531
3789
  onValueChange: (d) => {
@@ -3538,14 +3796,14 @@ function Wn() {
3538
3796
  );
3539
3797
  },
3540
3798
  children: [
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)) })
3799
+ /* @__PURE__ */ e.jsx(Me, { className: "col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(Te, {}) }),
3800
+ /* @__PURE__ */ e.jsx(Ae, { children: ["0", "1", "2", "3", "4"].map((d) => /* @__PURE__ */ e.jsx(X, { value: d, children: d }, d)) })
3543
3801
  ]
3544
3802
  }
3545
3803
  )
3546
3804
  ] }),
3547
3805
  /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-1", children: [
3548
- /* @__PURE__ */ e.jsx(R, { children: "Suffix" }),
3806
+ /* @__PURE__ */ e.jsx(B, { children: "Suffix" }),
3549
3807
  /* @__PURE__ */ e.jsx(
3550
3808
  ae,
3551
3809
  {
@@ -3568,7 +3826,7 @@ function Wn() {
3568
3826
  ] }) }),
3569
3827
  /* @__PURE__ */ e.jsx(Cs, { className: "my-3" }),
3570
3828
  /* @__PURE__ */ e.jsx(
3571
- Tt,
3829
+ It,
3572
3830
  {
3573
3831
  colorRanges: o,
3574
3832
  setColorRanges: l
@@ -3577,11 +3835,11 @@ function Wn() {
3577
3835
  ] })
3578
3836
  ] });
3579
3837
  }
3580
- function Yn() {
3838
+ function sl() {
3581
3839
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", 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: [
3840
+ /* @__PURE__ */ e.jsx(Se, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3841
+ /* @__PURE__ */ e.jsx(R, { className: "", children: "KPI Query" }),
3842
+ /* @__PURE__ */ e.jsxs(_, { className: "font-mono", children: [
3585
3843
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 font-mono text-xs", children: "SELECT current, previous FROM table" }),
3586
3844
  /* @__PURE__ */ e.jsxs("ul", { className: "my-6 ml-6 list-disc text-xs [&>li]:mt-2", children: [
3587
3845
  /* @__PURE__ */ e.jsx("li", { children: "current - number" }),
@@ -3603,7 +3861,7 @@ function Yn() {
3603
3861
  ] })
3604
3862
  ] })
3605
3863
  ] }) }),
3606
- /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Wn, {}) }),
3864
+ /* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(el, {}) }),
3607
3865
  /* @__PURE__ */ e.jsx("div", {}),
3608
3866
  /* @__PURE__ */ e.jsx("div", {})
3609
3867
  ] });
@@ -3612,10 +3870,10 @@ function os({
3612
3870
  cardType: s,
3613
3871
  docContent: n
3614
3872
  }) {
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: [
3873
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3874
+ /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3875
+ /* @__PURE__ */ e.jsx(R, { children: `${Ss(s)} Chart` }),
3876
+ /* @__PURE__ */ e.jsx(_, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3619
3877
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
3620
3878
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3621
3879
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
@@ -3637,237 +3895,21 @@ function os({
3637
3895
  ] })
3638
3896
  ] }) })
3639
3897
  ] }),
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, {}) })
3898
+ /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3899
+ /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3900
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(Fs, {}) })
3643
3901
  ] }),
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, {}) })
3902
+ s !== "range" && /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3903
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3904
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3647
3905
  ] })
3648
3906
  ] }) });
3649
3907
  }
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: [
3908
+ function al() {
3909
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(Se, { defaultValue: ["item-2"], type: "multiple", children: [
3910
+ /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3911
+ /* @__PURE__ */ e.jsx(R, { children: "Stacked Chart" }),
3912
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 font-mono text-xs", children: [
3871
3913
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, stack-by, y-axis FROM table" }),
3872
3914
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3873
3915
  /* @__PURE__ */ e.jsx("li", { children: "x-axis - category" }),
@@ -3890,20 +3932,20 @@ function sl() {
3890
3932
  ] })
3891
3933
  ] })
3892
3934
  ] }),
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, {})
3935
+ /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3936
+ /* @__PURE__ */ e.jsx(R, { children: "Settings" }),
3937
+ /* @__PURE__ */ e.jsxs(_, { className: "space-y-4 px-2", children: [
3938
+ /* @__PURE__ */ e.jsx(zs, {}),
3939
+ /* @__PURE__ */ e.jsx(za, {})
3898
3940
  ] })
3899
3941
  ] }),
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, {}) })
3942
+ /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3943
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3944
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3903
3945
  ] })
3904
3946
  ] }) });
3905
3947
  }
3906
- function al({}) {
3948
+ function tl({}) {
3907
3949
  const s = r((t) => {
3908
3950
  var i;
3909
3951
  return (i = t.card) == null ? void 0 : i.preferences;
@@ -3916,12 +3958,12 @@ function al({}) {
3916
3958
  });
3917
3959
  };
3918
3960
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
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, {}) })
3961
+ /* @__PURE__ */ e.jsx(Se, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3962
+ /* @__PURE__ */ e.jsx(R, { children: "Filter on click" }),
3963
+ /* @__PURE__ */ e.jsx(_, { className: "px-2", children: /* @__PURE__ */ e.jsx(De, {}) })
3922
3964
  ] }) }),
3923
3965
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3924
- /* @__PURE__ */ e.jsx($e, { onCheckedChange: a, id: "allow-download" }),
3966
+ /* @__PURE__ */ e.jsx(Ke, { onCheckedChange: a, id: "allow-download" }),
3925
3967
  /* @__PURE__ */ e.jsx(
3926
3968
  "label",
3927
3969
  {
@@ -3933,7 +3975,7 @@ function al({}) {
3933
3975
  ] })
3934
3976
  ] });
3935
3977
  }
3936
- const tl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3978
+ const nl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3937
3979
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
3938
3980
  /* @__PURE__ */ e.jsxs("div", { children: [
3939
3981
  "See ",
@@ -3949,7 +3991,7 @@ const tl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
3949
3991
  ),
3950
3992
  " in the docs."
3951
3993
  ] })
3952
- ] }), nl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3994
+ ] }), ll = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3953
3995
  /* @__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
3996
  /* @__PURE__ */ e.jsxs("div", { children: [
3955
3997
  "See ",
@@ -3959,27 +4001,28 @@ const tl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
3959
4001
  target: "_blank",
3960
4002
  onClick: (s) => s.stopPropagation(),
3961
4003
  className: "text-blue-700",
3962
- href: "https://docs.semaphor.cloud/concepts/visuals#range-chart",
4004
+ href: "https://docs.semaphor.cloud/concepts/visuals#range-charts",
3963
4005
  children: "example"
3964
4006
  }
3965
4007
  ),
3966
4008
  " in the docs."
3967
4009
  ] })
3968
4010
  ] });
3969
- function ll() {
4011
+ function rl() {
3970
4012
  const s = r((a) => a.card.type);
3971
4013
  function n(a) {
3972
4014
  switch (a) {
3973
4015
  case "stackedBar":
3974
- return /* @__PURE__ */ e.jsx(sl, {});
4016
+ return /* @__PURE__ */ e.jsx(al, {});
3975
4017
  case "pyramid":
3976
- return /* @__PURE__ */ e.jsx(os, { docContent: tl, cardType: a });
4018
+ return /* @__PURE__ */ e.jsx(os, { docContent: nl, cardType: a });
3977
4019
  case "kpi":
3978
- return /* @__PURE__ */ e.jsx(Yn, {});
4020
+ return /* @__PURE__ */ e.jsx(sl, {});
3979
4021
  case "line":
3980
4022
  case "bar":
4023
+ return /* @__PURE__ */ e.jsx(Jn, { cardType: a });
3981
4024
  case "range":
3982
- return /* @__PURE__ */ e.jsx(os, { docContent: nl, cardType: a });
4025
+ return /* @__PURE__ */ e.jsx(os, { docContent: ll, cardType: a });
3983
4026
  case "pie":
3984
4027
  case "doughnut":
3985
4028
  case "polarArea":
@@ -3987,16 +4030,16 @@ function ll() {
3987
4030
  return /* @__PURE__ */ e.jsx(os, { cardType: a });
3988
4031
  case "bubble":
3989
4032
  case "scatter":
3990
- return /* @__PURE__ */ e.jsx(Un, { cardType: a });
4033
+ return /* @__PURE__ */ e.jsx(Qn, { cardType: a });
3991
4034
  case "table":
3992
- return /* @__PURE__ */ e.jsx(al, { cardType: a });
4035
+ return /* @__PURE__ */ e.jsx(tl, { cardType: a });
3993
4036
  default:
3994
- return /* @__PURE__ */ e.jsx(Jn, {});
4037
+ return /* @__PURE__ */ e.jsx(Xn, {});
3995
4038
  }
3996
4039
  }
3997
4040
  return /* @__PURE__ */ e.jsx(Ns, { className: "h-full w-full text-sm", children: n(s) });
3998
4041
  }
3999
- function rl() {
4042
+ function il() {
4000
4043
  const s = r((n) => n.isShowingVisual);
4001
4044
  return /* @__PURE__ */ e.jsxs(
4002
4045
  hs,
@@ -4005,7 +4048,7 @@ function rl() {
4005
4048
  className: "min-w-full max-w-lg min-h-[250px]",
4006
4049
  children: [
4007
4050
  /* @__PURE__ */ e.jsx(
4008
- ze,
4051
+ Fe,
4009
4052
  {
4010
4053
  role: "query-section",
4011
4054
  className: "flex",
@@ -4016,7 +4059,7 @@ function rl() {
4016
4059
  ),
4017
4060
  /* @__PURE__ */ e.jsx(ms, { withHandle: !0, className: "border " }),
4018
4061
  /* @__PURE__ */ e.jsx(
4019
- ze,
4062
+ Fe,
4020
4063
  {
4021
4064
  className: "pb-1",
4022
4065
  role: "visual-section",
@@ -4024,36 +4067,36 @@ function rl() {
4024
4067
  defaultSize: 60,
4025
4068
  children: s ? /* @__PURE__ */ e.jsxs(hs, { direction: "horizontal", children: [
4026
4069
  /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
4027
- ze,
4070
+ Fe,
4028
4071
  {
4029
4072
  className: "flex min-w-[275px]",
4030
4073
  minSize: 20,
4031
4074
  defaultSize: 25,
4032
4075
  maxSize: 30,
4033
- children: /* @__PURE__ */ e.jsx(ll, {})
4076
+ children: /* @__PURE__ */ e.jsx(rl, {})
4034
4077
  }
4035
4078
  ) }),
4036
4079
  /* @__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, {})
4080
+ /* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx($s, {}) })
4081
+ ] }) : /* @__PURE__ */ e.jsx($s, {})
4039
4082
  }
4040
4083
  )
4041
4084
  ]
4042
4085
  }
4043
4086
  );
4044
4087
  }
4045
- function il({ authToken: s, onSave: n, onClose: a }) {
4088
+ function ol({ authToken: s, onSave: n, onClose: a }) {
4046
4089
  const t = r((l) => l.actions.setOnSave), i = r((l) => l.actions.setOnClose), o = k((l) => l.actions.setAuthToken);
4047
4090
  return K(() => {
4048
4091
  n && t(n), a && i(a);
4049
4092
  }, [n, t, a, i]), K(() => {
4050
4093
  s && s.accessToken && o(s);
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, {}) })
4094
+ }, [s, o]), /* @__PURE__ */ e.jsxs(Vt, { className: "rounded-none", role: "editor-panel", children: [
4095
+ /* @__PURE__ */ e.jsx(qt, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(pa, {}) }),
4096
+ /* @__PURE__ */ e.jsx(Rt, { children: /* @__PURE__ */ e.jsx(il, {}) })
4054
4097
  ] });
4055
4098
  }
4056
- function ol() {
4099
+ function cl() {
4057
4100
  k((l) => l.selectedCardId);
4058
4101
  const s = k((l) => l.selectedSheetId), { setIsVisualEditing: n } = k((l) => l.actions), a = k((l) => l.isVisualEditing), t = k((l) => l.actions.updateFrame);
4059
4102
  function i(l) {
@@ -4070,11 +4113,11 @@ function ol() {
4070
4113
  block: a,
4071
4114
  hidden: !a
4072
4115
  }),
4073
- children: /* @__PURE__ */ e.jsx(il, { onSave: i, onClose: o })
4116
+ children: /* @__PURE__ */ e.jsx(ol, { onSave: i, onClose: o })
4074
4117
  }
4075
4118
  );
4076
4119
  }
4077
- function cl({
4120
+ function dl({
4078
4121
  columns: s,
4079
4122
  tableName: n
4080
4123
  }) {
@@ -4092,11 +4135,11 @@ function cl({
4092
4135
  f,
4093
4136
  d
4094
4137
  );
4095
- const E = l == null ? void 0 : l.find(
4138
+ const L = l == null ? void 0 : l.find(
4096
4139
  (C) => C.column === b && C.table === f && (C.database === d || C.database === t)
4097
4140
  );
4098
- if (E)
4099
- g(E.id), h(E.id);
4141
+ if (L)
4142
+ g(L.id), h(L.id);
4100
4143
  else {
4101
4144
  if (n === "api" && a) {
4102
4145
  c({
@@ -4109,7 +4152,7 @@ function cl({
4109
4152
  // database: 'NA',
4110
4153
  connectionId: a,
4111
4154
  operation: "in",
4112
- sql: Vs(
4155
+ sql: _s(
4113
4156
  u.data_type,
4114
4157
  w,
4115
4158
  N
@@ -4127,7 +4170,7 @@ function cl({
4127
4170
  database: t || "",
4128
4171
  connectionId: a || "",
4129
4172
  operation: "in",
4130
- sql: Vs(
4173
+ sql: _s(
4131
4174
  u.data_type,
4132
4175
  w,
4133
4176
  N
@@ -4151,7 +4194,7 @@ function cl({
4151
4194
  }
4152
4195
  ),
4153
4196
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
4154
- /* @__PURE__ */ e.jsx(ma, { column: u }),
4197
+ /* @__PURE__ */ e.jsx(ua, { column: u }),
4155
4198
  /* @__PURE__ */ e.jsx("span", { children: u.column_name })
4156
4199
  ] })
4157
4200
  },
@@ -4159,29 +4202,29 @@ function cl({
4159
4202
  );
4160
4203
  }) });
4161
4204
  }
4162
- function dl() {
4205
+ function hl() {
4163
4206
  k((n) => n.showFilters);
4164
4207
  const s = k(
4165
4208
  (n) => n.actions.setShowFilters
4166
4209
  );
4167
4210
  return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
4168
4211
  /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
4169
- /* @__PURE__ */ e.jsx(R, { className: "text-lg", children: "Filters" }),
4212
+ /* @__PURE__ */ e.jsx(B, { className: "text-lg", children: "Filters" }),
4170
4213
  /* @__PURE__ */ e.jsx(
4171
4214
  z,
4172
4215
  {
4173
4216
  onClick: () => s(!1),
4174
4217
  className: "h-7 w-7 p-0",
4175
4218
  variant: "ghost",
4176
- children: /* @__PURE__ */ e.jsx(Re, {})
4219
+ children: /* @__PURE__ */ e.jsx(_e, {})
4177
4220
  }
4178
4221
  )
4179
4222
  ] }),
4180
4223
  /* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
4181
- xa,
4224
+ pa,
4182
4225
  {
4183
4226
  ColumnsComponent: (n, a, t) => /* @__PURE__ */ e.jsx(
4184
- cl,
4227
+ dl,
4185
4228
  {
4186
4229
  schemaName: n,
4187
4230
  tableName: a,
@@ -4192,7 +4235,7 @@ function dl() {
4192
4235
  ) })
4193
4236
  ] });
4194
4237
  }
4195
- function hl() {
4238
+ function ml() {
4196
4239
  k((a) => a.dashboard);
4197
4240
  const s = k((a) => a.showFilters), n = k((a) => a.isVisualEditing);
4198
4241
  return k((a) => a.bookmarkKey), /* @__PURE__ */ e.jsxs(
@@ -4204,13 +4247,13 @@ function hl() {
4204
4247
  flex: !n
4205
4248
  }),
4206
4249
  children: [
4207
- /* @__PURE__ */ e.jsx(Rt, {}),
4208
- s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(dl, {}) })
4250
+ /* @__PURE__ */ e.jsx(_t, {}),
4251
+ s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(hl, {}) })
4209
4252
  ]
4210
4253
  }
4211
4254
  );
4212
4255
  }
4213
- function ml() {
4256
+ function ul() {
4214
4257
  const s = k((t) => t.dashboard), n = k((t) => t.actions.setDashboard), a = k(
4215
4258
  (t) => t.showDashboardJSON
4216
4259
  );
@@ -4223,7 +4266,7 @@ function ml() {
4223
4266
  hidden: !a
4224
4267
  }),
4225
4268
  children: /* @__PURE__ */ e.jsx(
4226
- _t,
4269
+ Ht,
4227
4270
  {
4228
4271
  onChange: (t) => {
4229
4272
  if (t)
@@ -4254,25 +4297,25 @@ function ml() {
4254
4297
  }
4255
4298
  );
4256
4299
  }
4257
- function pl({
4300
+ function fl({
4258
4301
  showControls: s = !1,
4259
4302
  showFooter: n = !0,
4260
4303
  ...a
4261
4304
  }) {
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, {})
4305
+ return /* @__PURE__ */ e.jsxs(Bt, { dashboardProps: a, children: [
4306
+ /* @__PURE__ */ e.jsx($t, {}),
4307
+ /* @__PURE__ */ e.jsxs(Kt, { children: [
4308
+ /* @__PURE__ */ e.jsx(ul, {}),
4309
+ /* @__PURE__ */ e.jsxs(Pt, { ...a, children: [
4310
+ s && /* @__PURE__ */ e.jsx(vn, {}),
4311
+ /* @__PURE__ */ e.jsx(cl, {}),
4312
+ /* @__PURE__ */ e.jsx(ml, {})
4270
4313
  ] })
4271
4314
  ] })
4272
4315
  ] });
4273
4316
  }
4274
4317
  export {
4275
- pl as D,
4318
+ fl as D,
4276
4319
  Qe as S,
4277
- ua as u
4320
+ xa as u
4278
4321
  };