react-semaphor 0.0.173 → 0.0.175

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