react-semaphor 0.0.380 → 0.0.381
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.
- package/dist/chunks/{index-DVyKgtY2.js → index-Aexvs6bn.js} +5890 -5880
- package/dist/chunks/{index-DtslCSgq.js → index-DkaJf5Kh.js} +84 -84
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.js +911 -934
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as H, p as
|
|
2
|
-
import { D as _r,
|
|
1
|
+
import { c as H, p as Ot, u as T, a as Ze, b as Me, d as Tt, e as Mt, B as I, P as Xe, f as Dt, g as It, h as Lt, i as Ft, L as G, I as pe, j as da, k as Vt, l as Et, m as At, n as ua, o as ha, q as cn, r as Xt, s as ee, C as ut, t as dn, v as p, w as un, x as hn, y as ma, F as pa, z as We, A as Ke, T as fa, E as mn, G as ga, S as ve, H as xe, J as Ne, K as Ce, M as ke, N as Se, O as te, Q as ba, R as ya, U as va, V as xa, W as Na, X as be, Y as pn, Z as fn, _ as Ca, $ as gn, a0 as bn, a1 as yn, a2 as Sa, a3 as Te, a4 as vn, a5 as He, a6 as St, a7 as Le, a8 as _e, a9 as ze, aa as xn, ab as Nn, ac as Cn, ad as Yt, ae as Sn, af as Ye, ag as wn, ah as kn, ai as zn, aj as On, ak as Nt, al as Tn, am as Mn, an as Ve, ao as de, ap as wa, aq as Dn, ar as ht, as as In, at as Ln, au as Fn, av as wt, aw as Vn, ax as En, ay as rt, az as we, aA as it, aB as An, aC as qn, aD as Rn, aE as jn, aF as Ct, aG as _n, aH as ea, aI as Hn, aJ as ta, aK as Pn, aL as $n, aM as Un, aN as Bn, aO as ka, aP as Gn, aQ as qt, aR as za, aS as Jn, aT as Wn, aU as nt, aV as Kn, aW as Qn, aX as Oa, aY as Zn, aZ as Xn, a_ as Yn, a$ as es, b0 as ts, b1 as mt, b2 as Ta, b3 as as, b4 as Ma, b5 as Da, b6 as st, b7 as lt, b8 as ns, b9 as ss, ba as ls, bb as rs, bc as pt, bd as ft, be as gt, bf as is, bg as os, bh as cs, bi as ds, bj as us, bk as hs, bl as ms, bm as bt, bn as Fe, bo as ps, bp as Be, bq as Rt, br as Ia, bs as fs, bt as gs, bu as ot, bv as bs, bw as ys, bx as vs, by as xs, bz as aa, bA as na, bB as La, bC as Ns, bD as Cs, bE as Ss, bF as ws, bG as ks, bH as zs, bI as Os, bJ as Ts, bK as Ee, bL as Z, bM as X, bN as jt, bO as Y, bP as Ms, bQ as Fa, bR as Ds, bS as Is, bT as Ls, bU as Fs, bV as Vs, bW as Es, bX as As, bY as qs, bZ as Rs } from "./chunks/index-Aexvs6bn.js";
|
|
2
|
+
import { D as _r, c2 as Hr, c0 as Pr, c0 as $r, c4 as Ur, c3 as Br, c5 as Gr, c1 as Jr, b_ as Wr, b$ as Kr } from "./chunks/index-Aexvs6bn.js";
|
|
3
3
|
import { jsxs as n, jsx as e, Fragment as ae } from "react/jsx-runtime";
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
4
|
+
import * as sa from "react";
|
|
5
|
+
import Oe, { useState as j, useMemo as kt, useEffect as ce, useRef as Ge, useCallback as Va, Suspense as js } from "react";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -10,7 +10,7 @@ import "react-dom";
|
|
|
10
10
|
* This source code is licensed under the ISC license.
|
|
11
11
|
* See the LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
13
|
+
const _s = H("Box", [
|
|
14
14
|
[
|
|
15
15
|
"path",
|
|
16
16
|
{
|
|
@@ -27,7 +27,7 @@ const js = H("Box", [
|
|
|
27
27
|
* This source code is licensed under the ISC license.
|
|
28
28
|
* See the LICENSE file in the root directory of this source tree.
|
|
29
29
|
*/
|
|
30
|
-
const
|
|
30
|
+
const Hs = H("Braces", [
|
|
31
31
|
[
|
|
32
32
|
"path",
|
|
33
33
|
{ d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
|
|
@@ -46,7 +46,7 @@ const _s = H("Braces", [
|
|
|
46
46
|
* This source code is licensed under the ISC license.
|
|
47
47
|
* See the LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/
|
|
49
|
-
const
|
|
49
|
+
const Ps = H("ChartArea", [
|
|
50
50
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
51
51
|
[
|
|
52
52
|
"path",
|
|
@@ -62,7 +62,7 @@ const Hs = H("ChartArea", [
|
|
|
62
62
|
* This source code is licensed under the ISC license.
|
|
63
63
|
* See the LICENSE file in the root directory of this source tree.
|
|
64
64
|
*/
|
|
65
|
-
const
|
|
65
|
+
const _t = H("ChartColumnIncreasing", [
|
|
66
66
|
["path", { d: "M13 17V9", key: "1fwyjl" }],
|
|
67
67
|
["path", { d: "M18 17V5", key: "sfb6ij" }],
|
|
68
68
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
@@ -74,7 +74,7 @@ const $t = H("ChartColumnIncreasing", [
|
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
75
75
|
* See the LICENSE file in the root directory of this source tree.
|
|
76
76
|
*/
|
|
77
|
-
const
|
|
77
|
+
const Ht = H("ChartLine", [
|
|
78
78
|
["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
|
|
79
79
|
["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
|
|
80
80
|
]);
|
|
@@ -125,7 +125,7 @@ const qa = H("ChartScatter", [
|
|
|
125
125
|
* This source code is licensed under the ISC license.
|
|
126
126
|
* See the LICENSE file in the root directory of this source tree.
|
|
127
127
|
*/
|
|
128
|
-
const
|
|
128
|
+
const $s = H("CircleX", [
|
|
129
129
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
130
130
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
131
131
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -136,7 +136,7 @@ const Ps = H("CircleX", [
|
|
|
136
136
|
* This source code is licensed under the ISC license.
|
|
137
137
|
* See the LICENSE file in the root directory of this source tree.
|
|
138
138
|
*/
|
|
139
|
-
const
|
|
139
|
+
const Us = H("CopyPlus", [
|
|
140
140
|
["line", { x1: "15", x2: "15", y1: "12", y2: "18", key: "1p7wdc" }],
|
|
141
141
|
["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
|
|
142
142
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
@@ -159,7 +159,7 @@ const Bs = H("Database", [
|
|
|
159
159
|
* This source code is licensed under the ISC license.
|
|
160
160
|
* See the LICENSE file in the root directory of this source tree.
|
|
161
161
|
*/
|
|
162
|
-
const
|
|
162
|
+
const Pt = H("EllipsisVertical", [
|
|
163
163
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
164
164
|
["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
|
|
165
165
|
["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
|
|
@@ -170,7 +170,7 @@ const Ut = H("EllipsisVertical", [
|
|
|
170
170
|
* This source code is licensed under the ISC license.
|
|
171
171
|
* See the LICENSE file in the root directory of this source tree.
|
|
172
172
|
*/
|
|
173
|
-
const
|
|
173
|
+
const Gs = H("Eraser", [
|
|
174
174
|
[
|
|
175
175
|
"path",
|
|
176
176
|
{
|
|
@@ -187,7 +187,7 @@ const Us = H("Eraser", [
|
|
|
187
187
|
* This source code is licensed under the ISC license.
|
|
188
188
|
* See the LICENSE file in the root directory of this source tree.
|
|
189
189
|
*/
|
|
190
|
-
const
|
|
190
|
+
const Js = H("EyeClosed", [
|
|
191
191
|
["path", { d: "m15 18-.722-3.25", key: "1j64jw" }],
|
|
192
192
|
["path", { d: "M2 8a10.645 10.645 0 0 0 20 0", key: "1e7gxb" }],
|
|
193
193
|
["path", { d: "m20 15-1.726-2.05", key: "1cnuld" }],
|
|
@@ -200,7 +200,7 @@ const Gs = H("EyeClosed", [
|
|
|
200
200
|
* This source code is licensed under the ISC license.
|
|
201
201
|
* See the LICENSE file in the root directory of this source tree.
|
|
202
202
|
*/
|
|
203
|
-
const
|
|
203
|
+
const Ws = H("FileJson2", [
|
|
204
204
|
["path", { d: "M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4", key: "1pf5j1" }],
|
|
205
205
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
206
206
|
[
|
|
@@ -218,7 +218,7 @@ const Js = H("FileJson2", [
|
|
|
218
218
|
* This source code is licensed under the ISC license.
|
|
219
219
|
* See the LICENSE file in the root directory of this source tree.
|
|
220
220
|
*/
|
|
221
|
-
const
|
|
221
|
+
const Ks = H("Glasses", [
|
|
222
222
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
223
223
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
224
224
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -231,7 +231,7 @@ const Ws = H("Glasses", [
|
|
|
231
231
|
* This source code is licensed under the ISC license.
|
|
232
232
|
* See the LICENSE file in the root directory of this source tree.
|
|
233
233
|
*/
|
|
234
|
-
const
|
|
234
|
+
const Qs = H("Hammer", [
|
|
235
235
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
236
236
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
237
237
|
[
|
|
@@ -248,7 +248,7 @@ const Ks = H("Hammer", [
|
|
|
248
248
|
* This source code is licensed under the ISC license.
|
|
249
249
|
* See the LICENSE file in the root directory of this source tree.
|
|
250
250
|
*/
|
|
251
|
-
const
|
|
251
|
+
const Zs = H("Hash", [
|
|
252
252
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
253
253
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
254
254
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
@@ -260,7 +260,7 @@ const Qs = H("Hash", [
|
|
|
260
260
|
* This source code is licensed under the ISC license.
|
|
261
261
|
* See the LICENSE file in the root directory of this source tree.
|
|
262
262
|
*/
|
|
263
|
-
const
|
|
263
|
+
const Xs = H("House", [
|
|
264
264
|
["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
|
|
265
265
|
[
|
|
266
266
|
"path",
|
|
@@ -276,7 +276,7 @@ const Zs = H("House", [
|
|
|
276
276
|
* This source code is licensed under the ISC license.
|
|
277
277
|
* See the LICENSE file in the root directory of this source tree.
|
|
278
278
|
*/
|
|
279
|
-
const
|
|
279
|
+
const Ys = H("ListEnd", [
|
|
280
280
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
281
281
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
282
282
|
["path", { d: "M10 18H3", key: "13769t" }],
|
|
@@ -289,7 +289,7 @@ const Xs = H("ListEnd", [
|
|
|
289
289
|
* This source code is licensed under the ISC license.
|
|
290
290
|
* See the LICENSE file in the root directory of this source tree.
|
|
291
291
|
*/
|
|
292
|
-
const
|
|
292
|
+
const el = H("ListStart", [
|
|
293
293
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
294
294
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
295
295
|
["path", { d: "M10 6H3", key: "lf8lx7" }],
|
|
@@ -302,7 +302,7 @@ const Ys = H("ListStart", [
|
|
|
302
302
|
* This source code is licensed under the ISC license.
|
|
303
303
|
* See the LICENSE file in the root directory of this source tree.
|
|
304
304
|
*/
|
|
305
|
-
const
|
|
305
|
+
const tl = H("ListX", [
|
|
306
306
|
["path", { d: "M11 12H3", key: "51ecnj" }],
|
|
307
307
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
308
308
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
@@ -315,9 +315,26 @@ const el = H("ListX", [
|
|
|
315
315
|
* This source code is licensed under the ISC license.
|
|
316
316
|
* See the LICENSE file in the root directory of this source tree.
|
|
317
317
|
*/
|
|
318
|
-
const
|
|
318
|
+
const Qe = H("LoaderCircle", [
|
|
319
319
|
["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
|
|
320
320
|
]);
|
|
321
|
+
/**
|
|
322
|
+
* @license lucide-react v0.453.0 - ISC
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the ISC license.
|
|
325
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
+
*/
|
|
327
|
+
const al = H("Logs", [
|
|
328
|
+
["path", { d: "M13 12h8", key: "h98zly" }],
|
|
329
|
+
["path", { d: "M13 18h8", key: "oe0vm4" }],
|
|
330
|
+
["path", { d: "M13 6h8", key: "15sg57" }],
|
|
331
|
+
["path", { d: "M3 12h1", key: "lp3yf2" }],
|
|
332
|
+
["path", { d: "M3 18h1", key: "1eiwyy" }],
|
|
333
|
+
["path", { d: "M3 6h1", key: "rgxa97" }],
|
|
334
|
+
["path", { d: "M8 12h1", key: "1con00" }],
|
|
335
|
+
["path", { d: "M8 18h1", key: "13wk12" }],
|
|
336
|
+
["path", { d: "M8 6h1", key: "tn6mkg" }]
|
|
337
|
+
]);
|
|
321
338
|
/**
|
|
322
339
|
* @license lucide-react v0.453.0 - ISC
|
|
323
340
|
*
|
|
@@ -341,7 +358,7 @@ const Ra = H("Map", [
|
|
|
341
358
|
* This source code is licensed under the ISC license.
|
|
342
359
|
* See the LICENSE file in the root directory of this source tree.
|
|
343
360
|
*/
|
|
344
|
-
const
|
|
361
|
+
const nl = H("MessageSquareMore", [
|
|
345
362
|
["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" }],
|
|
346
363
|
["path", { d: "M8 10h.01", key: "19clt8" }],
|
|
347
364
|
["path", { d: "M12 10h.01", key: "1nrarc" }],
|
|
@@ -353,7 +370,7 @@ const tl = H("MessageSquareMore", [
|
|
|
353
370
|
* This source code is licensed under the ISC license.
|
|
354
371
|
* See the LICENSE file in the root directory of this source tree.
|
|
355
372
|
*/
|
|
356
|
-
const
|
|
373
|
+
const sl = H("Network", [
|
|
357
374
|
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
|
|
358
375
|
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
|
|
359
376
|
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
|
|
@@ -366,7 +383,7 @@ const al = H("Network", [
|
|
|
366
383
|
* This source code is licensed under the ISC license.
|
|
367
384
|
* See the LICENSE file in the root directory of this source tree.
|
|
368
385
|
*/
|
|
369
|
-
const
|
|
386
|
+
const ll = H("Plug2", [
|
|
370
387
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
371
388
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
372
389
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
@@ -379,7 +396,7 @@ const nl = H("Plug2", [
|
|
|
379
396
|
* This source code is licensed under the ISC license.
|
|
380
397
|
* See the LICENSE file in the root directory of this source tree.
|
|
381
398
|
*/
|
|
382
|
-
const
|
|
399
|
+
const rl = H("RefreshCw", [
|
|
383
400
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
384
401
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
385
402
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
@@ -391,7 +408,7 @@ const sl = H("RefreshCw", [
|
|
|
391
408
|
* This source code is licensed under the ISC license.
|
|
392
409
|
* See the LICENSE file in the root directory of this source tree.
|
|
393
410
|
*/
|
|
394
|
-
const
|
|
411
|
+
const il = H("Save", [
|
|
395
412
|
[
|
|
396
413
|
"path",
|
|
397
414
|
{
|
|
@@ -425,7 +442,7 @@ const ja = H("Shapes", [
|
|
|
425
442
|
* This source code is licensed under the ISC license.
|
|
426
443
|
* See the LICENSE file in the root directory of this source tree.
|
|
427
444
|
*/
|
|
428
|
-
const
|
|
445
|
+
const ol = H("ShieldQuestion", [
|
|
429
446
|
[
|
|
430
447
|
"path",
|
|
431
448
|
{
|
|
@@ -442,7 +459,7 @@ const rl = H("ShieldQuestion", [
|
|
|
442
459
|
* This source code is licensed under the ISC license.
|
|
443
460
|
* See the LICENSE file in the root directory of this source tree.
|
|
444
461
|
*/
|
|
445
|
-
const
|
|
462
|
+
const cl = H("Sigma", [
|
|
446
463
|
[
|
|
447
464
|
"path",
|
|
448
465
|
{
|
|
@@ -457,25 +474,7 @@ const il = H("Sigma", [
|
|
|
457
474
|
* This source code is licensed under the ISC license.
|
|
458
475
|
* See the LICENSE file in the root directory of this source tree.
|
|
459
476
|
*/
|
|
460
|
-
const
|
|
461
|
-
["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
|
|
462
|
-
["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
|
|
463
|
-
["path", { d: "M 7 17h.01", key: "1euzgo" }],
|
|
464
|
-
[
|
|
465
|
-
"path",
|
|
466
|
-
{
|
|
467
|
-
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",
|
|
468
|
-
key: "o2gii7"
|
|
469
|
-
}
|
|
470
|
-
]
|
|
471
|
-
]);
|
|
472
|
-
/**
|
|
473
|
-
* @license lucide-react v0.453.0 - ISC
|
|
474
|
-
*
|
|
475
|
-
* This source code is licensed under the ISC license.
|
|
476
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
477
|
-
*/
|
|
478
|
-
const Gt = H("Table", [
|
|
477
|
+
const $t = H("Table", [
|
|
479
478
|
["path", { d: "M12 3v18", key: "108xh3" }],
|
|
480
479
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
481
480
|
["path", { d: "M3 9h18", key: "1pudct" }],
|
|
@@ -487,7 +486,7 @@ const Gt = H("Table", [
|
|
|
487
486
|
* This source code is licensed under the ISC license.
|
|
488
487
|
* See the LICENSE file in the root directory of this source tree.
|
|
489
488
|
*/
|
|
490
|
-
const
|
|
489
|
+
const dl = H("Tag", [
|
|
491
490
|
[
|
|
492
491
|
"path",
|
|
493
492
|
{
|
|
@@ -503,7 +502,7 @@ const cl = H("Tag", [
|
|
|
503
502
|
* This source code is licensed under the ISC license.
|
|
504
503
|
* See the LICENSE file in the root directory of this source tree.
|
|
505
504
|
*/
|
|
506
|
-
const
|
|
505
|
+
const ul = H("TicketX", [
|
|
507
506
|
[
|
|
508
507
|
"path",
|
|
509
508
|
{
|
|
@@ -520,7 +519,7 @@ const dl = H("TicketX", [
|
|
|
520
519
|
* This source code is licensed under the ISC license.
|
|
521
520
|
* See the LICENSE file in the root directory of this source tree.
|
|
522
521
|
*/
|
|
523
|
-
const
|
|
522
|
+
const hl = H("ToggleLeft", [
|
|
524
523
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
|
|
525
524
|
["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
|
|
526
525
|
]);
|
|
@@ -530,7 +529,7 @@ const ul = H("ToggleLeft", [
|
|
|
530
529
|
* This source code is licensed under the ISC license.
|
|
531
530
|
* See the LICENSE file in the root directory of this source tree.
|
|
532
531
|
*/
|
|
533
|
-
const
|
|
532
|
+
const Ut = H("Type", [
|
|
534
533
|
["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
|
|
535
534
|
["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
|
|
536
535
|
["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
|
|
@@ -547,14 +546,14 @@ function _a(t) {
|
|
|
547
546
|
var i;
|
|
548
547
|
return {
|
|
549
548
|
...r,
|
|
550
|
-
cards: (i = r.cards) == null ? void 0 : i.map((o) =>
|
|
549
|
+
cards: (i = r.cards) == null ? void 0 : i.map((o) => ml(o))
|
|
551
550
|
};
|
|
552
551
|
})
|
|
553
552
|
};
|
|
554
553
|
})
|
|
555
554
|
};
|
|
556
555
|
}
|
|
557
|
-
function
|
|
556
|
+
function ml(t) {
|
|
558
557
|
var s, a, l, r;
|
|
559
558
|
return {
|
|
560
559
|
...t,
|
|
@@ -569,12 +568,12 @@ function hl(t) {
|
|
|
569
568
|
}))
|
|
570
569
|
}
|
|
571
570
|
},
|
|
572
|
-
customCfg:
|
|
571
|
+
customCfg: pl(t.customCfg),
|
|
573
572
|
// if customCfg is present, clean it, otherwise return null{
|
|
574
573
|
data: []
|
|
575
574
|
};
|
|
576
575
|
}
|
|
577
|
-
function
|
|
576
|
+
function pl(t) {
|
|
578
577
|
var s, a;
|
|
579
578
|
return t ? {
|
|
580
579
|
...t,
|
|
@@ -588,22 +587,22 @@ function ml(t) {
|
|
|
588
587
|
}
|
|
589
588
|
} : null;
|
|
590
589
|
}
|
|
591
|
-
async function
|
|
590
|
+
async function fl(t, s, a, l) {
|
|
592
591
|
if (!l)
|
|
593
592
|
return null;
|
|
594
593
|
const r = JSON.stringify(s);
|
|
595
|
-
return await
|
|
594
|
+
return await Ot("https://semaphor.cloud/api/v1/lens", l, {
|
|
596
595
|
name: t,
|
|
597
596
|
template: r,
|
|
598
597
|
filterValues: a,
|
|
599
598
|
operation: "create"
|
|
600
599
|
});
|
|
601
600
|
}
|
|
602
|
-
async function
|
|
601
|
+
async function zt(t, s) {
|
|
603
602
|
if (!s)
|
|
604
603
|
return null;
|
|
605
604
|
const { id: a, template: l, filterValues: r, isDefault: i, shared: o } = t;
|
|
606
|
-
return await
|
|
605
|
+
return await Ot("https://semaphor.cloud/api/v1/lens", s, {
|
|
607
606
|
lensId: a,
|
|
608
607
|
template: l,
|
|
609
608
|
filterValues: r,
|
|
@@ -612,19 +611,19 @@ async function Ot(t, s) {
|
|
|
612
611
|
operation: "update"
|
|
613
612
|
});
|
|
614
613
|
}
|
|
615
|
-
async function
|
|
616
|
-
return s ? await
|
|
614
|
+
async function gl(t, s) {
|
|
615
|
+
return s ? await Ot("https://semaphor.cloud/api/v1/lens", s, {
|
|
617
616
|
operation: "delete",
|
|
618
617
|
lensId: t
|
|
619
618
|
}) : null;
|
|
620
619
|
}
|
|
621
|
-
function
|
|
622
|
-
const [t, s] = j(""), [a, l] = j(!1), r =
|
|
620
|
+
function bl() {
|
|
621
|
+
const [t, s] = j(""), [a, l] = j(!1), r = T((b) => b.lenses), { setLenses: i, setSelectedLensId: o } = Ze(), [c, d] = j(!1), [h, f] = j(!1), v = T((b) => b.dashboard), x = T((b) => b.filterValues), { authToken: u } = Me();
|
|
623
622
|
async function g() {
|
|
624
623
|
d(!0);
|
|
625
624
|
const b = _a(
|
|
626
|
-
|
|
627
|
-
), k = await
|
|
625
|
+
v
|
|
626
|
+
), k = await fl(
|
|
628
627
|
t,
|
|
629
628
|
b,
|
|
630
629
|
x,
|
|
@@ -632,21 +631,21 @@ function gl() {
|
|
|
632
631
|
);
|
|
633
632
|
k && (i([...r || [], k]), o(k.id), f(!1)), d(!1);
|
|
634
633
|
}
|
|
635
|
-
return /* @__PURE__ */ n(
|
|
636
|
-
/* @__PURE__ */ e(
|
|
637
|
-
|
|
634
|
+
return /* @__PURE__ */ n(Tt, { open: h, onOpenChange: f, children: [
|
|
635
|
+
/* @__PURE__ */ e(Mt, { asChild: !0, children: /* @__PURE__ */ n(
|
|
636
|
+
I,
|
|
638
637
|
{
|
|
639
638
|
variant: "secondary",
|
|
640
639
|
className: "h-7 p-2",
|
|
641
640
|
size: "sm",
|
|
642
641
|
children: [
|
|
643
|
-
/* @__PURE__ */ e(
|
|
642
|
+
/* @__PURE__ */ e(Xe, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
644
643
|
"Lens"
|
|
645
644
|
]
|
|
646
645
|
}
|
|
647
646
|
) }),
|
|
648
647
|
/* @__PURE__ */ n(Dt, { className: "sm:max-w-[425px]", children: [
|
|
649
|
-
/* @__PURE__ */ n(
|
|
648
|
+
/* @__PURE__ */ n(It, { children: [
|
|
650
649
|
/* @__PURE__ */ e(Lt, { children: "Create Lens" }),
|
|
651
650
|
/* @__PURE__ */ e(Ft, { children: "Lenses are private by default and are only visible to you." })
|
|
652
651
|
] }),
|
|
@@ -665,8 +664,8 @@ function gl() {
|
|
|
665
664
|
)
|
|
666
665
|
] }) }),
|
|
667
666
|
a && /* @__PURE__ */ e("p", { className: "text-sm", children: "The lens name already exists. Use a differnet name." }),
|
|
668
|
-
/* @__PURE__ */ e(
|
|
669
|
-
|
|
667
|
+
/* @__PURE__ */ e(da, { children: /* @__PURE__ */ e(
|
|
668
|
+
I,
|
|
670
669
|
{
|
|
671
670
|
size: "sm",
|
|
672
671
|
variant: "outline",
|
|
@@ -679,54 +678,54 @@ function gl() {
|
|
|
679
678
|
] })
|
|
680
679
|
] });
|
|
681
680
|
}
|
|
682
|
-
function
|
|
683
|
-
const [t, s] = j(!1), a =
|
|
681
|
+
function yl() {
|
|
682
|
+
const [t, s] = j(!1), a = T((f) => f.lenses), l = T((f) => f.selectedLensId), { setLenses: r, setSelectedLensId: i } = Ze(), { authToken: o } = Me();
|
|
684
683
|
async function c(f) {
|
|
685
684
|
i(f);
|
|
686
685
|
}
|
|
687
686
|
async function d(f) {
|
|
688
|
-
if (await
|
|
687
|
+
if (await gl(f, o == null ? void 0 : o.accessToken)) {
|
|
689
688
|
const x = a == null ? void 0 : a.filter((u) => u.id !== f);
|
|
690
689
|
r(x || []), i("original");
|
|
691
690
|
}
|
|
692
691
|
}
|
|
693
692
|
async function h(f) {
|
|
694
|
-
const
|
|
693
|
+
const v = a == null ? void 0 : a.map((g) => g.id === f.id ? {
|
|
695
694
|
...g,
|
|
696
695
|
isDefault: !f.isDefault
|
|
697
696
|
} : {
|
|
698
697
|
...g,
|
|
699
698
|
isDefault: !1
|
|
700
699
|
});
|
|
701
|
-
r(
|
|
700
|
+
r(v || []);
|
|
702
701
|
const x = {
|
|
703
702
|
...f,
|
|
704
703
|
isDefault: !f.isDefault
|
|
705
704
|
};
|
|
706
|
-
await
|
|
705
|
+
await zt(x, o == null ? void 0 : o.accessToken);
|
|
707
706
|
const u = a == null ? void 0 : a.find((g) => g.isDefault);
|
|
708
707
|
if (u && u.id !== f.id) {
|
|
709
708
|
const g = {
|
|
710
709
|
...u,
|
|
711
710
|
isDefault: !1
|
|
712
711
|
};
|
|
713
|
-
await
|
|
712
|
+
await zt(g, o == null ? void 0 : o.accessToken);
|
|
714
713
|
}
|
|
715
714
|
}
|
|
716
715
|
return /* @__PURE__ */ n(Vt, { open: t, onOpenChange: s, children: [
|
|
717
|
-
/* @__PURE__ */ e(Et, { asChild: !0, children: /* @__PURE__ */ e(
|
|
716
|
+
/* @__PURE__ */ e(Et, { asChild: !0, children: /* @__PURE__ */ e(I, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e(Ks, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
718
717
|
/* @__PURE__ */ n(At, { align: "end", className: "w-60", children: [
|
|
719
|
-
/* @__PURE__ */ e(
|
|
720
|
-
/* @__PURE__ */ e(
|
|
718
|
+
/* @__PURE__ */ e(ua, { className: "px-3", children: "Lenses" }),
|
|
719
|
+
/* @__PURE__ */ e(ha, {}),
|
|
721
720
|
/* @__PURE__ */ n(
|
|
722
721
|
cn,
|
|
723
722
|
{
|
|
724
723
|
value: l,
|
|
725
724
|
onValueChange: c,
|
|
726
725
|
children: [
|
|
727
|
-
/* @__PURE__ */ e(
|
|
726
|
+
/* @__PURE__ */ e(Xt, { value: "original", children: "Original" }),
|
|
728
727
|
a == null ? void 0 : a.map((f) => /* @__PURE__ */ n(
|
|
729
|
-
|
|
728
|
+
Xt,
|
|
730
729
|
{
|
|
731
730
|
className: "group flex justify-between gap-2",
|
|
732
731
|
value: f.id,
|
|
@@ -734,10 +733,10 @@ function bl() {
|
|
|
734
733
|
/* @__PURE__ */ e("p", { children: f.name }),
|
|
735
734
|
/* @__PURE__ */ n("span", { className: "flex items-center gap-3", children: [
|
|
736
735
|
/* @__PURE__ */ e(
|
|
737
|
-
|
|
736
|
+
Xs,
|
|
738
737
|
{
|
|
739
|
-
onClick: (
|
|
740
|
-
|
|
738
|
+
onClick: (v) => {
|
|
739
|
+
v.preventDefault(), h(f);
|
|
741
740
|
},
|
|
742
741
|
className: ee(
|
|
743
742
|
"size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
@@ -750,10 +749,10 @@ function bl() {
|
|
|
750
749
|
}
|
|
751
750
|
),
|
|
752
751
|
/* @__PURE__ */ e(
|
|
753
|
-
|
|
752
|
+
ut,
|
|
754
753
|
{
|
|
755
|
-
onClick: (
|
|
756
|
-
|
|
754
|
+
onClick: (v) => {
|
|
755
|
+
v.preventDefault(), d(f.id);
|
|
757
756
|
},
|
|
758
757
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
759
758
|
strokeWidth: 1.5
|
|
@@ -772,43 +771,43 @@ function bl() {
|
|
|
772
771
|
}
|
|
773
772
|
async function vl() {
|
|
774
773
|
var u;
|
|
775
|
-
const t =
|
|
774
|
+
const t = T.getState().authToken, s = T.getState().theme, a = T.getState().filterValues, l = (u = T.getState().dashboard) == null ? void 0 : u.title, r = T.getState().isDownloadingPdf, i = T.getState().selectedSheetId;
|
|
776
775
|
if (r)
|
|
777
776
|
return;
|
|
778
777
|
const o = new URLSearchParams();
|
|
779
778
|
o.set("token", (t == null ? void 0 : t.accessToken) || ""), o.set("theme", s || "light"), o.set("filterValues", JSON.stringify(a)), o.set("selectedSheetId", i || "");
|
|
780
779
|
const c = `https://semaphor.cloud/api/v1/generate-pdf?params=${encodeURIComponent(o.toString())}`;
|
|
781
|
-
|
|
780
|
+
T.setState({ isDownloadingPdf: !0 });
|
|
782
781
|
const f = (await (await fetch(c, {
|
|
783
782
|
method: "GET",
|
|
784
783
|
headers: {
|
|
785
784
|
Authorization: `Bearer ${t == null ? void 0 : t.accessToken}`
|
|
786
785
|
}
|
|
787
|
-
})).json()).url,
|
|
788
|
-
|
|
786
|
+
})).json()).url, v = document.createElement("a");
|
|
787
|
+
v.href = f;
|
|
789
788
|
const x = `${l}-${(/* @__PURE__ */ new Date()).toISOString()}.pdf`;
|
|
790
|
-
|
|
789
|
+
v.download = x, v.click(), T.setState({ isDownloadingPdf: !1 });
|
|
791
790
|
}
|
|
792
|
-
function
|
|
791
|
+
function xl({
|
|
793
792
|
iconClassName: t
|
|
794
793
|
}) {
|
|
795
|
-
const { authToken: s } =
|
|
796
|
-
|
|
794
|
+
const { authToken: s } = Me();
|
|
795
|
+
T((r) => {
|
|
797
796
|
var i;
|
|
798
797
|
return (i = r.dashboard) == null ? void 0 : i.title;
|
|
799
|
-
}),
|
|
800
|
-
const a =
|
|
798
|
+
}), T((r) => r.theme), T((r) => r.filterValues);
|
|
799
|
+
const a = T((r) => r.isDownloadingPdf);
|
|
801
800
|
async function l() {
|
|
802
801
|
await vl();
|
|
803
802
|
}
|
|
804
803
|
return /* @__PURE__ */ e(
|
|
805
|
-
|
|
804
|
+
I,
|
|
806
805
|
{
|
|
807
806
|
variant: "link",
|
|
808
807
|
className: "group h-7 p-2",
|
|
809
808
|
size: "sm",
|
|
810
809
|
onClick: l,
|
|
811
|
-
children: a ? /* @__PURE__ */ e(
|
|
810
|
+
children: a ? /* @__PURE__ */ e(Qe, { className: ee("size-3.5 animate-spin", t) }) : /* @__PURE__ */ e(
|
|
812
811
|
dn,
|
|
813
812
|
{
|
|
814
813
|
className: ee("size-3.5", t),
|
|
@@ -818,31 +817,31 @@ function yl({
|
|
|
818
817
|
}
|
|
819
818
|
);
|
|
820
819
|
}
|
|
821
|
-
function
|
|
822
|
-
const { authToken: t } =
|
|
823
|
-
|
|
824
|
-
const s =
|
|
825
|
-
|
|
826
|
-
const i =
|
|
820
|
+
function Nl() {
|
|
821
|
+
const { authToken: t } = Me();
|
|
822
|
+
T((m) => m.theme);
|
|
823
|
+
const s = T((m) => m.lenses), a = T((m) => m.selectedLensId), l = s == null ? void 0 : s.find((m) => m.id === a), r = T((m) => m.dashboard);
|
|
824
|
+
T((m) => m.selectedSheetId);
|
|
825
|
+
const i = T(
|
|
827
826
|
(m) => m.isDashboardEditing
|
|
828
827
|
), o = p(
|
|
829
828
|
(m) => m.selectedConnectionId
|
|
830
|
-
), [c, d] = j(!1), h =
|
|
831
|
-
|
|
829
|
+
), [c, d] = j(!1), h = T((m) => m.filterValues), f = T((m) => m.isVisualEditing), v = T((m) => m.showFilters);
|
|
830
|
+
T(
|
|
832
831
|
(m) => m.showDashboardJSON
|
|
833
832
|
);
|
|
834
|
-
const x =
|
|
833
|
+
const x = T((m) => m.onSaveFunction), u = T(
|
|
835
834
|
(m) => m.actions.setShowFilters
|
|
836
|
-
), { addFrame: g, setSelectedFrameId: b } =
|
|
835
|
+
), { addFrame: g, setSelectedFrameId: b } = T(
|
|
837
836
|
(m) => m.actions
|
|
838
|
-
), { getSelectedSheet: k, setIsDashboardEditing: N, setShowDashboardJSON: V } =
|
|
837
|
+
), { getSelectedSheet: k, setIsDashboardEditing: N, setShowDashboardJSON: V } = T((m) => m.actions), w = k(), { tenantId: z, endUserId: F } = kt(
|
|
839
838
|
() => un(t == null ? void 0 : t.accessToken),
|
|
840
839
|
[t == null ? void 0 : t.accessToken]
|
|
841
|
-
), E = kt(() =>
|
|
840
|
+
), E = kt(() => z || F, [z, F]), U = () => {
|
|
842
841
|
if (!i || !w) return;
|
|
843
842
|
const m = {
|
|
844
843
|
connectionId: o,
|
|
845
|
-
id:
|
|
844
|
+
id: We(),
|
|
846
845
|
title: "Title",
|
|
847
846
|
description: "Description",
|
|
848
847
|
preferences: {
|
|
@@ -856,25 +855,25 @@ function xl() {
|
|
|
856
855
|
type: "bar",
|
|
857
856
|
sql: "select COUNT(*) from YOUR_TABLE",
|
|
858
857
|
data: []
|
|
859
|
-
},
|
|
860
|
-
id:
|
|
858
|
+
}, y = {
|
|
859
|
+
id: We(),
|
|
861
860
|
cards: [m],
|
|
862
861
|
activeCardId: m.id
|
|
863
862
|
};
|
|
864
|
-
g(w.id,
|
|
863
|
+
g(w.id, y), b(y.id);
|
|
865
864
|
}, R = () => {
|
|
866
865
|
N(!0);
|
|
867
866
|
};
|
|
868
|
-
async function
|
|
867
|
+
async function B() {
|
|
869
868
|
if (d(!0), !a || !l) return;
|
|
870
869
|
const m = _a(
|
|
871
870
|
r
|
|
872
|
-
),
|
|
871
|
+
), y = JSON.stringify(m), M = {
|
|
873
872
|
...l,
|
|
874
|
-
template:
|
|
873
|
+
template: y,
|
|
875
874
|
filterValues: h
|
|
876
875
|
};
|
|
877
|
-
await
|
|
876
|
+
await zt(M, t == null ? void 0 : t.accessToken), Ke.success("Lens saved"), x == null || x(m), d(!1);
|
|
878
877
|
}
|
|
879
878
|
return f ? null : /* @__PURE__ */ n(
|
|
880
879
|
"div",
|
|
@@ -884,36 +883,36 @@ function xl() {
|
|
|
884
883
|
children: [
|
|
885
884
|
!f && /* @__PURE__ */ e("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e(G, { children: l == null ? void 0 : l.name }) }),
|
|
886
885
|
/* @__PURE__ */ n("div", { className: "flex gap-2", children: [
|
|
887
|
-
/* @__PURE__ */ e("button", { onClick: hn, children: /* @__PURE__ */ e(
|
|
888
|
-
/* @__PURE__ */ e(
|
|
889
|
-
i && !f && E && /* @__PURE__ */ e(
|
|
890
|
-
!f && E && /* @__PURE__ */ e(
|
|
886
|
+
/* @__PURE__ */ e("button", { onClick: hn, children: /* @__PURE__ */ e(ul, { className: "h-4 w-4", strokeWidth: 1.5 }) }),
|
|
887
|
+
/* @__PURE__ */ e(xl, {}),
|
|
888
|
+
i && !f && E && /* @__PURE__ */ e(bl, {}),
|
|
889
|
+
!f && E && /* @__PURE__ */ e(yl, {}),
|
|
891
890
|
i && !f && /* @__PURE__ */ n(
|
|
892
|
-
|
|
891
|
+
I,
|
|
893
892
|
{
|
|
894
893
|
variant: "secondary",
|
|
895
894
|
className: "h-7 p-2",
|
|
896
895
|
size: "sm",
|
|
897
896
|
disabled: !i,
|
|
898
|
-
onClick:
|
|
897
|
+
onClick: U,
|
|
899
898
|
children: [
|
|
900
|
-
/* @__PURE__ */ e(
|
|
899
|
+
/* @__PURE__ */ e(Xe, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
901
900
|
"Frame"
|
|
902
901
|
]
|
|
903
902
|
}
|
|
904
903
|
),
|
|
905
904
|
!i && /* @__PURE__ */ e(
|
|
906
|
-
|
|
905
|
+
I,
|
|
907
906
|
{
|
|
908
907
|
variant: "ghost",
|
|
909
908
|
className: "h-7 p-2",
|
|
910
909
|
onClick: R,
|
|
911
910
|
size: "sm",
|
|
912
|
-
children: /* @__PURE__ */ e(
|
|
911
|
+
children: /* @__PURE__ */ e(ma, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
913
912
|
}
|
|
914
913
|
),
|
|
915
914
|
i && !f && /* @__PURE__ */ e(
|
|
916
|
-
|
|
915
|
+
I,
|
|
917
916
|
{
|
|
918
917
|
variant: "ghost",
|
|
919
918
|
role: "close",
|
|
@@ -922,28 +921,28 @@ function xl() {
|
|
|
922
921
|
N(!1), V(!1);
|
|
923
922
|
},
|
|
924
923
|
size: "sm",
|
|
925
|
-
children: /* @__PURE__ */ e(
|
|
924
|
+
children: /* @__PURE__ */ e(ut, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
926
925
|
}
|
|
927
926
|
),
|
|
928
927
|
i && !f && E && /* @__PURE__ */ e(
|
|
929
|
-
|
|
928
|
+
I,
|
|
930
929
|
{
|
|
931
930
|
className: "h-7 p-2",
|
|
932
931
|
variant: "ghost",
|
|
933
932
|
disabled: c,
|
|
934
|
-
onClick:
|
|
933
|
+
onClick: B,
|
|
935
934
|
size: "sm",
|
|
936
|
-
children: /* @__PURE__ */ e(
|
|
935
|
+
children: /* @__PURE__ */ e(il, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
937
936
|
}
|
|
938
937
|
),
|
|
939
|
-
!
|
|
940
|
-
|
|
938
|
+
!v && !f && i && /* @__PURE__ */ e(
|
|
939
|
+
I,
|
|
941
940
|
{
|
|
942
941
|
className: "h-7 p-2",
|
|
943
942
|
variant: "ghost",
|
|
944
943
|
onClick: () => u(!0),
|
|
945
944
|
size: "sm",
|
|
946
|
-
children: /* @__PURE__ */ e(
|
|
945
|
+
children: /* @__PURE__ */ e(pa, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
947
946
|
}
|
|
948
947
|
),
|
|
949
948
|
!f && i && !1,
|
|
@@ -953,7 +952,7 @@ function xl() {
|
|
|
953
952
|
}
|
|
954
953
|
);
|
|
955
954
|
}
|
|
956
|
-
function
|
|
955
|
+
function Ue({
|
|
957
956
|
title: t,
|
|
958
957
|
items: s,
|
|
959
958
|
value: a,
|
|
@@ -965,27 +964,27 @@ function Be({
|
|
|
965
964
|
showNone: d = !1,
|
|
966
965
|
className: h,
|
|
967
966
|
showIcon: f = !0,
|
|
968
|
-
disabled:
|
|
967
|
+
disabled: v = !1
|
|
969
968
|
}) {
|
|
970
969
|
const x = l ? "Loading..." : r ? "Error" : a;
|
|
971
970
|
function u() {
|
|
972
971
|
if (t === "Connection")
|
|
973
|
-
return /* @__PURE__ */ e(
|
|
972
|
+
return /* @__PURE__ */ e(ll, { className: "size-4 rotate-90" });
|
|
974
973
|
if (t === "Database")
|
|
975
974
|
return /* @__PURE__ */ e(Bs, { className: "size-4" });
|
|
976
975
|
if (t === "Schema")
|
|
977
|
-
return /* @__PURE__ */ e(
|
|
976
|
+
return /* @__PURE__ */ e(sl, { className: "size-4" });
|
|
978
977
|
if (t === "Table")
|
|
979
|
-
return /* @__PURE__ */ e(
|
|
978
|
+
return /* @__PURE__ */ e($t, { className: "size-4" });
|
|
980
979
|
if (t === "Model")
|
|
981
|
-
return /* @__PURE__ */ e(
|
|
980
|
+
return /* @__PURE__ */ e(_s, { className: "size-4" });
|
|
982
981
|
}
|
|
983
982
|
return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
984
|
-
f && /* @__PURE__ */ e("div", { className: "shrink-0", children: o ? /* @__PURE__ */ n(
|
|
983
|
+
f && /* @__PURE__ */ e("div", { className: "shrink-0", children: o ? /* @__PURE__ */ n(fa, { children: [
|
|
985
984
|
/* @__PURE__ */ e(mn, { children: u() }),
|
|
986
|
-
/* @__PURE__ */ e(
|
|
985
|
+
/* @__PURE__ */ e(ga, { className: "text-xs", align: "start", children: o })
|
|
987
986
|
] }) : u() }),
|
|
988
|
-
/* @__PURE__ */ n(
|
|
987
|
+
/* @__PURE__ */ n(ve, { disabled: v, value: x, onValueChange: c, children: [
|
|
989
988
|
/* @__PURE__ */ e(
|
|
990
989
|
xe,
|
|
991
990
|
{
|
|
@@ -1001,11 +1000,11 @@ function Be({
|
|
|
1001
1000
|
)
|
|
1002
1001
|
}
|
|
1003
1002
|
),
|
|
1004
|
-
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(
|
|
1003
|
+
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(ke, { children: [
|
|
1005
1004
|
l ? /* @__PURE__ */ e(Se, { children: "Loading..." }) : /* @__PURE__ */ n(Se, { className: "flex items-center justify-between gap-2", children: [
|
|
1006
1005
|
t,
|
|
1007
1006
|
/* @__PURE__ */ e(
|
|
1008
|
-
|
|
1007
|
+
rl,
|
|
1009
1008
|
{
|
|
1010
1009
|
className: "mr-1 size-3 cursor-pointer text-muted-foreground hover:text-foreground",
|
|
1011
1010
|
onClick: i
|
|
@@ -1021,16 +1020,16 @@ function Be({
|
|
|
1021
1020
|
] })
|
|
1022
1021
|
] });
|
|
1023
1022
|
}
|
|
1024
|
-
function
|
|
1023
|
+
function Cl({ column: t }) {
|
|
1025
1024
|
const [s, a] = j(!1), l = p((g) => g.selectedTableName), r = p(
|
|
1026
1025
|
(g) => g.selectedSchemaName
|
|
1027
1026
|
), i = p(
|
|
1028
1027
|
(g) => g.selectedDatamodelId
|
|
1029
|
-
), o = p((g) => g.sqlGen), { modelItems: c, connectionType: d } = Ae(), h = p((g) => g.actions.setSqlGen), f = p((g) => g.actions.setCardSql),
|
|
1028
|
+
), o = p((g) => g.sqlGen), { modelItems: c, connectionType: d } = Ae(), h = p((g) => g.actions.setSqlGen), f = p((g) => g.actions.setCardSql), v = p((g) => g.actions.setRunSql);
|
|
1030
1029
|
function x(g, b) {
|
|
1031
1030
|
var w;
|
|
1032
1031
|
const k = xa(g, o, b), N = (w = c == null ? void 0 : c.find(
|
|
1033
|
-
(
|
|
1032
|
+
(z) => z.id === i
|
|
1034
1033
|
)) == null ? void 0 : w.name;
|
|
1035
1034
|
h(k);
|
|
1036
1035
|
const V = Na(
|
|
@@ -1040,7 +1039,7 @@ function Nl({ column: t }) {
|
|
|
1040
1039
|
N,
|
|
1041
1040
|
d
|
|
1042
1041
|
);
|
|
1043
|
-
V && (f(V),
|
|
1042
|
+
V && (f(V), v(!0)), a(!1);
|
|
1044
1043
|
}
|
|
1045
1044
|
function u() {
|
|
1046
1045
|
return /* @__PURE__ */ n("ul", { className: "text-xs", children: [
|
|
@@ -1086,10 +1085,10 @@ function Nl({ column: t }) {
|
|
|
1086
1085
|
)
|
|
1087
1086
|
] });
|
|
1088
1087
|
}
|
|
1089
|
-
return /* @__PURE__ */ n(
|
|
1090
|
-
/* @__PURE__ */ e(
|
|
1088
|
+
return /* @__PURE__ */ n(ba, { openDelay: 0, open: s, onOpenChange: a, children: [
|
|
1089
|
+
/* @__PURE__ */ e(ya, { asChild: !0, children: /* @__PURE__ */ e(Pt, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
|
|
1091
1090
|
/* @__PURE__ */ e(
|
|
1092
|
-
|
|
1091
|
+
va,
|
|
1093
1092
|
{
|
|
1094
1093
|
align: "center",
|
|
1095
1094
|
className: "w-20 rounded-md p-0 shadow-none",
|
|
@@ -1099,12 +1098,12 @@ function Nl({ column: t }) {
|
|
|
1099
1098
|
] });
|
|
1100
1099
|
}
|
|
1101
1100
|
function Ha({ column: t }) {
|
|
1102
|
-
return /* @__PURE__ */ n(
|
|
1103
|
-
/* @__PURE__ */ e(pn, { asChild: !0, children: fn(t.data_type) ? /* @__PURE__ */ e(
|
|
1104
|
-
/* @__PURE__ */ e(
|
|
1101
|
+
return /* @__PURE__ */ n(fa, { children: [
|
|
1102
|
+
/* @__PURE__ */ e(pn, { asChild: !0, children: fn(t.data_type) ? /* @__PURE__ */ e(Ut, { className: "size-3" }) : Ca(t.data_type) ? /* @__PURE__ */ e(Zs, { className: "size-3" }) : gn(t.data_type) ? /* @__PURE__ */ e(bn, { className: "size-3" }) : yn(t.data_type) ? /* @__PURE__ */ e(hl, { className: "size-3" }) : t.data_type.toLowerCase() === "json" ? /* @__PURE__ */ e(Hs, { className: "size-3" }) : /* @__PURE__ */ e(ol, { className: "size-3" }) }),
|
|
1103
|
+
/* @__PURE__ */ e(ga, { children: /* @__PURE__ */ e("p", { className: "font-mono text-xs", children: t.data_type }) })
|
|
1105
1104
|
] });
|
|
1106
1105
|
}
|
|
1107
|
-
function
|
|
1106
|
+
function Sl({
|
|
1108
1107
|
schemaName: t,
|
|
1109
1108
|
tableName: s,
|
|
1110
1109
|
columns: a,
|
|
@@ -1118,40 +1117,40 @@ function Cl({
|
|
|
1118
1117
|
(m) => m.selectedSchemaName
|
|
1119
1118
|
), d = p((m) => m.selectedTableName), h = p(
|
|
1120
1119
|
(m) => m.selectedDatamodelId
|
|
1121
|
-
), f =
|
|
1120
|
+
), f = T(
|
|
1122
1121
|
(m) => m.dashboard.aiScopeTables
|
|
1123
|
-
), { addToAIScope:
|
|
1122
|
+
), { addToAIScope: v, removeFromAIScope: x } = Ze(), { setAIScopeTables: u } = T((m) => m.actions), g = p((m) => m.actions.setRunSql), b = p((m) => m.actions.setSqlGen), k = p(
|
|
1124
1123
|
(m) => m.actions.setIsShowingVisual
|
|
1125
|
-
), N = p((m) => m.actions.setCardSql), { connectionType: V, modelItems: w, selectedDatamodelName:
|
|
1124
|
+
), N = p((m) => m.actions.setCardSql), { connectionType: V, modelItems: w, selectedDatamodelName: z } = Ae();
|
|
1126
1125
|
function F(m) {
|
|
1127
1126
|
var A;
|
|
1128
|
-
const
|
|
1129
|
-
b(
|
|
1130
|
-
const
|
|
1127
|
+
const y = xa(m, r);
|
|
1128
|
+
b(y);
|
|
1129
|
+
const M = (A = w == null ? void 0 : w.find(
|
|
1131
1130
|
($) => $.id === h
|
|
1132
1131
|
)) == null ? void 0 : A.name, C = Na(
|
|
1133
|
-
|
|
1132
|
+
y,
|
|
1134
1133
|
be(t),
|
|
1135
1134
|
be(s),
|
|
1136
|
-
|
|
1135
|
+
M,
|
|
1137
1136
|
V
|
|
1138
1137
|
);
|
|
1139
1138
|
C && (N(C), g(!0));
|
|
1140
1139
|
}
|
|
1141
1140
|
function E() {
|
|
1142
1141
|
return (f == null ? void 0 : f.find(
|
|
1143
|
-
(m) => m.connectionId === i && (m.tableName === d || m.datamodelName ===
|
|
1142
|
+
(m) => m.connectionId === i && (m.tableName === d || m.datamodelName === z)
|
|
1144
1143
|
)) !== void 0;
|
|
1145
1144
|
}
|
|
1146
|
-
function
|
|
1147
|
-
m === !0 && (d ||
|
|
1145
|
+
function U(m) {
|
|
1146
|
+
m === !0 && (d || z) && i ? (v({
|
|
1148
1147
|
connectionId: i,
|
|
1149
1148
|
connectionType: V === "S3" || V === "API" ? "DuckDb" : V,
|
|
1150
1149
|
databaseName: o,
|
|
1151
1150
|
schemaName: c,
|
|
1152
1151
|
tableName: d,
|
|
1153
|
-
datamodelName:
|
|
1154
|
-
}),
|
|
1152
|
+
datamodelName: z
|
|
1153
|
+
}), Ke.success("Added to Assistant Scope", {
|
|
1155
1154
|
position: "top-right",
|
|
1156
1155
|
duration: 2500,
|
|
1157
1156
|
richColors: !0
|
|
@@ -1159,8 +1158,8 @@ function Cl({
|
|
|
1159
1158
|
connectionId: i || "",
|
|
1160
1159
|
connectionType: V || "",
|
|
1161
1160
|
tableName: d || "",
|
|
1162
|
-
datamodelName:
|
|
1163
|
-
}),
|
|
1161
|
+
datamodelName: z || ""
|
|
1162
|
+
}), Ke("Removed from Assistant Scope", {
|
|
1164
1163
|
position: "top-right",
|
|
1165
1164
|
duration: 2e3,
|
|
1166
1165
|
richColors: !0
|
|
@@ -1170,18 +1169,18 @@ function Cl({
|
|
|
1170
1169
|
const m = St({
|
|
1171
1170
|
schemaName: t,
|
|
1172
1171
|
tableName: s,
|
|
1173
|
-
modelName:
|
|
1172
|
+
modelName: z,
|
|
1174
1173
|
connectionType: V
|
|
1175
1174
|
});
|
|
1176
1175
|
k(!1);
|
|
1177
|
-
const
|
|
1178
|
-
N(
|
|
1176
|
+
const y = V === "MSSQL" ? `SELECT top 10 * FROM ${m}` : `SELECT * FROM ${m} LIMIT 10`;
|
|
1177
|
+
N(y), g(!0);
|
|
1179
1178
|
}
|
|
1180
|
-
function
|
|
1179
|
+
function B() {
|
|
1181
1180
|
const m = St({
|
|
1182
1181
|
schemaName: t,
|
|
1183
1182
|
tableName: s,
|
|
1184
|
-
modelName:
|
|
1183
|
+
modelName: z,
|
|
1185
1184
|
connectionType: V
|
|
1186
1185
|
});
|
|
1187
1186
|
N(`SELECT COUNT(*) as count FROM ${m}`), g(!0);
|
|
@@ -1193,14 +1192,14 @@ function Cl({
|
|
|
1193
1192
|
{
|
|
1194
1193
|
title: `${E() ? "Remove from" : "Add to"} Assistant Scope`,
|
|
1195
1194
|
pressed: E(),
|
|
1196
|
-
onPressedChange:
|
|
1195
|
+
onPressedChange: U,
|
|
1197
1196
|
variant: "outline",
|
|
1198
1197
|
className: ee("h-9 px-2", {
|
|
1199
1198
|
// 'outline outline-1 outline-green-400': isInAIScopeTable(),
|
|
1200
1199
|
}),
|
|
1201
1200
|
children: [
|
|
1202
1201
|
/* @__PURE__ */ e(
|
|
1203
|
-
|
|
1202
|
+
Xe,
|
|
1204
1203
|
{
|
|
1205
1204
|
className: ee("mr-1 size-4", {
|
|
1206
1205
|
"text-green-400": E(),
|
|
@@ -1213,7 +1212,7 @@ function Cl({
|
|
|
1213
1212
|
}
|
|
1214
1213
|
),
|
|
1215
1214
|
/* @__PURE__ */ n(
|
|
1216
|
-
|
|
1215
|
+
I,
|
|
1217
1216
|
{
|
|
1218
1217
|
disabled: l !== "Success",
|
|
1219
1218
|
onClick: R,
|
|
@@ -1221,28 +1220,28 @@ function Cl({
|
|
|
1221
1220
|
variant: "secondary",
|
|
1222
1221
|
className: "flex",
|
|
1223
1222
|
children: [
|
|
1224
|
-
l !== "Success" ? /* @__PURE__ */ e(
|
|
1223
|
+
l !== "Success" ? /* @__PURE__ */ e(Qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e(al, { className: "mr-2 size-4" }),
|
|
1225
1224
|
"Top 10"
|
|
1226
1225
|
]
|
|
1227
1226
|
}
|
|
1228
1227
|
),
|
|
1229
1228
|
/* @__PURE__ */ n(
|
|
1230
|
-
|
|
1229
|
+
I,
|
|
1231
1230
|
{
|
|
1232
1231
|
disabled: l !== "Success",
|
|
1233
|
-
onClick:
|
|
1232
|
+
onClick: B,
|
|
1234
1233
|
size: "sm",
|
|
1235
1234
|
variant: "secondary",
|
|
1236
1235
|
className: "w-full",
|
|
1237
1236
|
children: [
|
|
1238
|
-
l !== "Success" ? /* @__PURE__ */ e(
|
|
1237
|
+
l !== "Success" ? /* @__PURE__ */ e(Qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e(cl, { className: "mr-2 size-4" }),
|
|
1239
1238
|
"Count"
|
|
1240
1239
|
]
|
|
1241
1240
|
}
|
|
1242
1241
|
)
|
|
1243
1242
|
] }),
|
|
1244
1243
|
/* @__PURE__ */ n(
|
|
1245
|
-
|
|
1244
|
+
Te,
|
|
1246
1245
|
{
|
|
1247
1246
|
className: "flex-1 basis-0 border-b border-t border-muted py-3",
|
|
1248
1247
|
children: [
|
|
@@ -1253,7 +1252,7 @@ function Cl({
|
|
|
1253
1252
|
className: ee(
|
|
1254
1253
|
"group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-1 text-sm transition-colors hover:bg-muted/50",
|
|
1255
1254
|
{
|
|
1256
|
-
"border border-dashed border-muted-foreground bg-muted":
|
|
1255
|
+
"border border-dashed border-muted-foreground bg-muted": vn(m, r)
|
|
1257
1256
|
}
|
|
1258
1257
|
),
|
|
1259
1258
|
children: [
|
|
@@ -1264,9 +1263,9 @@ function Cl({
|
|
|
1264
1263
|
/* @__PURE__ */ e(
|
|
1265
1264
|
"div",
|
|
1266
1265
|
{
|
|
1267
|
-
onClick: (
|
|
1266
|
+
onClick: (y) => y.stopPropagation(),
|
|
1268
1267
|
className: "flex items-center justify-end",
|
|
1269
|
-
children: Ca(m.data_type) && /* @__PURE__ */ e(
|
|
1268
|
+
children: Ca(m.data_type) && /* @__PURE__ */ e(Cl, { column: m })
|
|
1270
1269
|
}
|
|
1271
1270
|
)
|
|
1272
1271
|
]
|
|
@@ -1281,9 +1280,9 @@ function Cl({
|
|
|
1281
1280
|
] });
|
|
1282
1281
|
}
|
|
1283
1282
|
function Ae(t, s) {
|
|
1284
|
-
var
|
|
1283
|
+
var Gt, Jt, Wt, Kt, Qt, Zt;
|
|
1285
1284
|
let a = kt(() => [], []);
|
|
1286
|
-
const l =
|
|
1285
|
+
const l = Me().authToken || t, r = p(
|
|
1287
1286
|
(S) => S.selectedConnectionId
|
|
1288
1287
|
), i = p(
|
|
1289
1288
|
(S) => S.selectedDatamodelId
|
|
@@ -1295,7 +1294,7 @@ function Ae(t, s) {
|
|
|
1295
1294
|
(S) => S.actions.setCurrentColumns
|
|
1296
1295
|
), f = p(
|
|
1297
1296
|
(S) => S.actions.setSelectedConnectionId
|
|
1298
|
-
),
|
|
1297
|
+
), v = p(
|
|
1299
1298
|
(S) => S.actions.setSelectedDatamodelId
|
|
1300
1299
|
), x = p(
|
|
1301
1300
|
(S) => S.actions.setSelectedDatabaseName
|
|
@@ -1317,7 +1316,7 @@ function Ae(t, s) {
|
|
|
1317
1316
|
const {
|
|
1318
1317
|
refetch: V,
|
|
1319
1318
|
data: w,
|
|
1320
|
-
isLoading:
|
|
1319
|
+
isLoading: z,
|
|
1321
1320
|
isError: F
|
|
1322
1321
|
} = Le({
|
|
1323
1322
|
queryKey: ["connections"],
|
|
@@ -1329,9 +1328,9 @@ function Ae(t, s) {
|
|
|
1329
1328
|
// Only fetch if authToken is present
|
|
1330
1329
|
}), {
|
|
1331
1330
|
refetch: E,
|
|
1332
|
-
data:
|
|
1331
|
+
data: U,
|
|
1333
1332
|
isLoading: R,
|
|
1334
|
-
isError:
|
|
1333
|
+
isError: B
|
|
1335
1334
|
} = Le({
|
|
1336
1335
|
queryKey: ["models", r],
|
|
1337
1336
|
queryFn: () => _e(
|
|
@@ -1345,11 +1344,11 @@ function Ae(t, s) {
|
|
|
1345
1344
|
// Only fetch if authToken is present
|
|
1346
1345
|
}), m = w == null ? void 0 : w.connections.find(
|
|
1347
1346
|
(S) => S.id === r
|
|
1348
|
-
),
|
|
1347
|
+
), y = m == null ? void 0 : m.type, M = (m == null ? void 0 : m.type) === "API" || (m == null ? void 0 : m.type) === "S3", {
|
|
1349
1348
|
data: C,
|
|
1350
1349
|
isLoading: A,
|
|
1351
1350
|
isFetching: $,
|
|
1352
|
-
isError:
|
|
1351
|
+
isError: J,
|
|
1353
1352
|
refetch: Q
|
|
1354
1353
|
} = Le({
|
|
1355
1354
|
queryKey: ["databases", r],
|
|
@@ -1360,13 +1359,13 @@ function Ae(t, s) {
|
|
|
1360
1359
|
connection_id: r
|
|
1361
1360
|
}
|
|
1362
1361
|
),
|
|
1363
|
-
enabled: N(
|
|
1362
|
+
enabled: N(y)
|
|
1364
1363
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1365
1364
|
}), {
|
|
1366
1365
|
data: K,
|
|
1367
|
-
isLoading:
|
|
1366
|
+
isLoading: le,
|
|
1368
1367
|
isFetching: me,
|
|
1369
|
-
isError:
|
|
1368
|
+
isError: W,
|
|
1370
1369
|
refetch: q
|
|
1371
1370
|
} = Le({
|
|
1372
1371
|
queryKey: ["schemas", r, o],
|
|
@@ -1378,12 +1377,12 @@ function Ae(t, s) {
|
|
|
1378
1377
|
database_name: o
|
|
1379
1378
|
}
|
|
1380
1379
|
),
|
|
1381
|
-
enabled: !!r && !!o && !
|
|
1380
|
+
enabled: !!r && !!o && !M && o !== "NA"
|
|
1382
1381
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1383
1382
|
}), {
|
|
1384
1383
|
data: L,
|
|
1385
|
-
isLoading:
|
|
1386
|
-
isFetching:
|
|
1384
|
+
isLoading: re,
|
|
1385
|
+
isFetching: ie,
|
|
1387
1386
|
isError: ue,
|
|
1388
1387
|
refetch: oe
|
|
1389
1388
|
} = Le({
|
|
@@ -1402,13 +1401,13 @@ function Ae(t, s) {
|
|
|
1402
1401
|
schema_name: c
|
|
1403
1402
|
}
|
|
1404
1403
|
),
|
|
1405
|
-
enabled: b(
|
|
1404
|
+
enabled: b(y)
|
|
1406
1405
|
}), {
|
|
1407
1406
|
data: ne,
|
|
1408
|
-
isLoading:
|
|
1407
|
+
isLoading: O,
|
|
1409
1408
|
isFetching: _,
|
|
1410
1409
|
isError: P,
|
|
1411
|
-
refetch:
|
|
1410
|
+
refetch: se
|
|
1412
1411
|
} = Le({
|
|
1413
1412
|
queryKey: [
|
|
1414
1413
|
"columns",
|
|
@@ -1430,7 +1429,7 @@ function Ae(t, s) {
|
|
|
1430
1429
|
table_name: d
|
|
1431
1430
|
}
|
|
1432
1431
|
),
|
|
1433
|
-
enabled: k(
|
|
1432
|
+
enabled: k(y)
|
|
1434
1433
|
// (!!selectedConnectionId &&
|
|
1435
1434
|
// !!selectedDatabaseName &&
|
|
1436
1435
|
// !!selectedSchemaName &&
|
|
@@ -1442,41 +1441,41 @@ function Ae(t, s) {
|
|
|
1442
1441
|
ce(() => {
|
|
1443
1442
|
h(a);
|
|
1444
1443
|
}, [ne, h, a]), ce(() => {
|
|
1445
|
-
(
|
|
1444
|
+
(y === "S3" || y === "API") && (x(""), u(""), v(""), y === "API" && g("api"));
|
|
1446
1445
|
}, [
|
|
1447
|
-
|
|
1446
|
+
y,
|
|
1448
1447
|
g,
|
|
1449
1448
|
x,
|
|
1450
1449
|
u,
|
|
1451
|
-
|
|
1450
|
+
v
|
|
1452
1451
|
]);
|
|
1453
|
-
const Re = (m == null ? void 0 : m.type) === "API" ? (
|
|
1452
|
+
const Re = (m == null ? void 0 : m.type) === "API" ? (Gt = m == null ? void 0 : m.type) == null ? void 0 : Gt.toLowerCase() : d || "", je = M ? "" : c || "";
|
|
1454
1453
|
function De(S) {
|
|
1455
1454
|
u(S), g("");
|
|
1456
1455
|
}
|
|
1457
1456
|
function D(S) {
|
|
1458
|
-
x(S === "none" ? "" : S), u(""), g(""), S !== "none" && S !== "" &&
|
|
1457
|
+
x(S === "none" ? "" : S), u(""), g(""), S !== "none" && S !== "" && v("");
|
|
1459
1458
|
}
|
|
1460
1459
|
function he(S) {
|
|
1461
1460
|
f(S);
|
|
1462
1461
|
}
|
|
1463
|
-
function
|
|
1464
|
-
|
|
1462
|
+
function Ie(S) {
|
|
1463
|
+
v(S === "none" ? "" : S), S !== "none" && S !== "" && x("");
|
|
1465
1464
|
}
|
|
1466
|
-
C && ((
|
|
1465
|
+
C && ((Jt = C == null ? void 0 : C.databases) == null ? void 0 : Jt.length) > 0, K && ((Wt = K == null ? void 0 : K.schemas) == null ? void 0 : Wt.length) > 0, ne && ((Kt = ne == null ? void 0 : ne.columns) == null ? void 0 : Kt.length) > 0 && (a = ne.columns.map((S) => ({
|
|
1467
1466
|
...S,
|
|
1468
1467
|
data_type: S.data_type.toLowerCase()
|
|
1469
|
-
}))),
|
|
1468
|
+
}))), J && (a = []), (P || F) && (a = []);
|
|
1470
1469
|
const fe = w == null ? void 0 : w.connections.map(
|
|
1471
1470
|
(S) => ({
|
|
1472
1471
|
id: S.id,
|
|
1473
1472
|
name: S.name,
|
|
1474
1473
|
type: S.type
|
|
1475
1474
|
})
|
|
1476
|
-
), $e = (
|
|
1475
|
+
), $e = (Qt = U == null ? void 0 : U.datamodels) == null ? void 0 : Qt.map((S) => ({
|
|
1477
1476
|
id: S.id,
|
|
1478
1477
|
name: S.name
|
|
1479
|
-
})),
|
|
1478
|
+
})), vt = C == null ? void 0 : C.databases.map((S) => ({
|
|
1480
1479
|
id: S.database_name,
|
|
1481
1480
|
name: S.database_name
|
|
1482
1481
|
})), et = K == null ? void 0 : K.schemas.map((S) => ({
|
|
@@ -1485,32 +1484,32 @@ function Ae(t, s) {
|
|
|
1485
1484
|
})), xt = L == null ? void 0 : L.tables.map((S) => ({
|
|
1486
1485
|
id: S.table_name,
|
|
1487
1486
|
name: S.table_name
|
|
1488
|
-
})), on = (
|
|
1487
|
+
})), on = (Zt = U == null ? void 0 : U.datamodels.find(
|
|
1489
1488
|
(S) => S.id === i
|
|
1490
|
-
)) == null ? void 0 :
|
|
1489
|
+
)) == null ? void 0 : Zt.name;
|
|
1491
1490
|
return {
|
|
1492
1491
|
connectionItems: fe,
|
|
1493
|
-
isConnectionsLoading:
|
|
1492
|
+
isConnectionsLoading: z,
|
|
1494
1493
|
isConnectionsError: F,
|
|
1495
1494
|
modelItems: $e,
|
|
1496
1495
|
selectedDatamodelId: i,
|
|
1497
1496
|
selectedDatamodelName: on,
|
|
1498
1497
|
isModelsLoading: R,
|
|
1499
|
-
isModelsError:
|
|
1500
|
-
databaseItems:
|
|
1498
|
+
isModelsError: B,
|
|
1499
|
+
databaseItems: vt,
|
|
1501
1500
|
isDatabasesLoadingOrFetching: A || $,
|
|
1502
|
-
isDatabaseError:
|
|
1501
|
+
isDatabaseError: J,
|
|
1503
1502
|
schemaItems: et,
|
|
1504
|
-
isSchemaLoadingOrFetching:
|
|
1505
|
-
isSchemaError:
|
|
1503
|
+
isSchemaLoadingOrFetching: le || me,
|
|
1504
|
+
isSchemaError: W,
|
|
1506
1505
|
tableItems: xt,
|
|
1507
|
-
isTableLoadingOrFetching:
|
|
1506
|
+
isTableLoadingOrFetching: re || ie,
|
|
1508
1507
|
isTableError: ue,
|
|
1509
1508
|
columns: a,
|
|
1510
|
-
isColumnsLoadingOrFetching:
|
|
1509
|
+
isColumnsLoadingOrFetching: O || _,
|
|
1511
1510
|
isColumnsError: P,
|
|
1512
|
-
isNonDbConnection:
|
|
1513
|
-
connectionType:
|
|
1511
|
+
isNonDbConnection: M,
|
|
1512
|
+
connectionType: y,
|
|
1514
1513
|
tableName: Re,
|
|
1515
1514
|
schemaName: je,
|
|
1516
1515
|
refetchConnections: V,
|
|
@@ -1518,9 +1517,9 @@ function Ae(t, s) {
|
|
|
1518
1517
|
refetchDatabases: Q,
|
|
1519
1518
|
refetchSchemas: q,
|
|
1520
1519
|
refetchTables: oe,
|
|
1521
|
-
refetchColumns:
|
|
1520
|
+
refetchColumns: se,
|
|
1522
1521
|
handleConnectionChange: he,
|
|
1523
|
-
handleDatamodelChange:
|
|
1522
|
+
handleDatamodelChange: Ie,
|
|
1524
1523
|
handleDatabaseChange: D,
|
|
1525
1524
|
handleSchemaChange: De
|
|
1526
1525
|
};
|
|
@@ -1544,7 +1543,7 @@ function Pa({
|
|
|
1544
1543
|
modelItems: d,
|
|
1545
1544
|
schemaItems: h,
|
|
1546
1545
|
databaseItems: f,
|
|
1547
|
-
tableItems:
|
|
1546
|
+
tableItems: v,
|
|
1548
1547
|
columns: x,
|
|
1549
1548
|
isConnectionsLoading: u,
|
|
1550
1549
|
isModelsLoading: g,
|
|
@@ -1553,47 +1552,47 @@ function Pa({
|
|
|
1553
1552
|
isDatabasesLoadingOrFetching: N,
|
|
1554
1553
|
isDatabaseError: V,
|
|
1555
1554
|
isSchemaLoadingOrFetching: w,
|
|
1556
|
-
isSchemaError:
|
|
1555
|
+
isSchemaError: z,
|
|
1557
1556
|
isColumnsError: F,
|
|
1558
1557
|
isColumnsLoadingOrFetching: E,
|
|
1559
|
-
isTableLoadingOrFetching:
|
|
1558
|
+
isTableLoadingOrFetching: U,
|
|
1560
1559
|
isTableError: R,
|
|
1561
|
-
connectionType:
|
|
1560
|
+
connectionType: B,
|
|
1562
1561
|
isNonDbConnection: m,
|
|
1563
|
-
refetchDatabases:
|
|
1564
|
-
refetchModels:
|
|
1562
|
+
refetchDatabases: y,
|
|
1563
|
+
refetchModels: M,
|
|
1565
1564
|
refetchSchemas: C,
|
|
1566
1565
|
refetchTables: A,
|
|
1567
1566
|
refetchColumns: $,
|
|
1568
|
-
refetchConnections:
|
|
1567
|
+
refetchConnections: J,
|
|
1569
1568
|
handleConnectionChange: Q,
|
|
1570
1569
|
handleDatabaseChange: K,
|
|
1571
|
-
handleSchemaChange:
|
|
1570
|
+
handleSchemaChange: le,
|
|
1572
1571
|
handleDatamodelChange: me,
|
|
1573
|
-
tableName:
|
|
1572
|
+
tableName: W,
|
|
1574
1573
|
schemaName: q
|
|
1575
1574
|
} = Ae();
|
|
1576
1575
|
function L() {
|
|
1577
|
-
return t ? t(q,
|
|
1578
|
-
|
|
1576
|
+
return t ? t(q, W, x) : /* @__PURE__ */ e(
|
|
1577
|
+
Sl,
|
|
1579
1578
|
{
|
|
1580
1579
|
schemaName: q,
|
|
1581
|
-
tableName:
|
|
1580
|
+
tableName: W,
|
|
1582
1581
|
columns: x,
|
|
1583
1582
|
status: E ? "Loading..." : F ? "Error" : "Success"
|
|
1584
1583
|
}
|
|
1585
1584
|
);
|
|
1586
1585
|
}
|
|
1587
|
-
function
|
|
1586
|
+
function re() {
|
|
1588
1587
|
window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
|
|
1589
1588
|
}
|
|
1590
|
-
function
|
|
1591
|
-
if (!s ||
|
|
1589
|
+
function ie() {
|
|
1590
|
+
if (!s || B === "S3" || B === "API") return null;
|
|
1592
1591
|
if (!a || a === "none")
|
|
1593
1592
|
return /* @__PURE__ */ e(
|
|
1594
|
-
|
|
1593
|
+
Ue,
|
|
1595
1594
|
{
|
|
1596
|
-
refetch:
|
|
1595
|
+
refetch: y,
|
|
1597
1596
|
showNone: !0,
|
|
1598
1597
|
onChange: K,
|
|
1599
1598
|
isError: V,
|
|
@@ -1613,12 +1612,12 @@ function Pa({
|
|
|
1613
1612
|
] });
|
|
1614
1613
|
}
|
|
1615
1614
|
function oe() {
|
|
1616
|
-
if (!s ||
|
|
1615
|
+
if (!s || B === "S3" || B === "API") return null;
|
|
1617
1616
|
if (!l || l === "none")
|
|
1618
1617
|
return /* @__PURE__ */ e(
|
|
1619
|
-
|
|
1618
|
+
Ue,
|
|
1620
1619
|
{
|
|
1621
|
-
refetch:
|
|
1620
|
+
refetch: M,
|
|
1622
1621
|
showNone: !0,
|
|
1623
1622
|
onChange: me,
|
|
1624
1623
|
isError: k,
|
|
@@ -1630,12 +1629,12 @@ function Pa({
|
|
|
1630
1629
|
);
|
|
1631
1630
|
}
|
|
1632
1631
|
function ne() {
|
|
1633
|
-
return !s ||
|
|
1634
|
-
|
|
1632
|
+
return !s || B === "S3" || B === "API" || !l || l === "none" ? null : /* @__PURE__ */ e(
|
|
1633
|
+
Ue,
|
|
1635
1634
|
{
|
|
1636
1635
|
refetch: C,
|
|
1637
|
-
onChange:
|
|
1638
|
-
isError:
|
|
1636
|
+
onChange: le,
|
|
1637
|
+
isError: z,
|
|
1639
1638
|
isLoading: w,
|
|
1640
1639
|
items: h,
|
|
1641
1640
|
value: r || "",
|
|
@@ -1643,19 +1642,19 @@ function Pa({
|
|
|
1643
1642
|
}
|
|
1644
1643
|
);
|
|
1645
1644
|
}
|
|
1646
|
-
function
|
|
1645
|
+
function O() {
|
|
1647
1646
|
function P() {
|
|
1648
|
-
let
|
|
1649
|
-
return
|
|
1647
|
+
let se = !1;
|
|
1648
|
+
return B === "API" ? (se = !1, se) : ((B === "S3" || s && l && l !== "none" && r) && (se = !0), se);
|
|
1650
1649
|
}
|
|
1651
1650
|
return P() ? /* @__PURE__ */ e(
|
|
1652
|
-
|
|
1651
|
+
Ue,
|
|
1653
1652
|
{
|
|
1654
1653
|
refetch: A,
|
|
1655
1654
|
onChange: o,
|
|
1656
1655
|
isError: R,
|
|
1657
|
-
items:
|
|
1658
|
-
isLoading:
|
|
1656
|
+
items: v,
|
|
1657
|
+
isLoading: U,
|
|
1659
1658
|
value: i || "",
|
|
1660
1659
|
title: "Table"
|
|
1661
1660
|
}
|
|
@@ -1664,9 +1663,9 @@ function Pa({
|
|
|
1664
1663
|
return /* @__PURE__ */ n("aside", { className: "flex grow flex-col justify-between", children: [
|
|
1665
1664
|
/* @__PURE__ */ n("section", { className: "space-y-3 px-6 py-4", children: [
|
|
1666
1665
|
/* @__PURE__ */ e(
|
|
1667
|
-
|
|
1666
|
+
Ue,
|
|
1668
1667
|
{
|
|
1669
|
-
refetch:
|
|
1668
|
+
refetch: J,
|
|
1670
1669
|
items: c,
|
|
1671
1670
|
title: "Connection",
|
|
1672
1671
|
value: s || "",
|
|
@@ -1678,29 +1677,29 @@ function Pa({
|
|
|
1678
1677
|
)) == null ? void 0 : _.type) || ""
|
|
1679
1678
|
}
|
|
1680
1679
|
),
|
|
1681
|
-
|
|
1680
|
+
ie(),
|
|
1682
1681
|
ue(),
|
|
1683
1682
|
oe(),
|
|
1684
1683
|
ne(),
|
|
1685
|
-
|
|
1684
|
+
O()
|
|
1686
1685
|
] }),
|
|
1687
1686
|
L(),
|
|
1688
1687
|
/* @__PURE__ */ e("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ n(
|
|
1689
|
-
|
|
1688
|
+
I,
|
|
1690
1689
|
{
|
|
1691
|
-
onClick:
|
|
1690
|
+
onClick: re,
|
|
1692
1691
|
size: "sm",
|
|
1693
1692
|
variant: "secondary",
|
|
1694
1693
|
className: "w-full",
|
|
1695
1694
|
children: [
|
|
1696
|
-
/* @__PURE__ */ e(
|
|
1695
|
+
/* @__PURE__ */ e(nl, { className: "mr-2 size-4" }),
|
|
1697
1696
|
"Help"
|
|
1698
1697
|
]
|
|
1699
1698
|
}
|
|
1700
1699
|
) })
|
|
1701
1700
|
] });
|
|
1702
1701
|
}
|
|
1703
|
-
function
|
|
1702
|
+
function wl(t) {
|
|
1704
1703
|
const s = t.toUpperCase().indexOf("WHERE"), a = t.toUpperCase().indexOf("GROUP BY"), l = t.toUpperCase().indexOf("LIMIT"), r = t.toUpperCase().indexOf("ORDER BY");
|
|
1705
1704
|
let i = t.length;
|
|
1706
1705
|
if (r !== -1 && (i = r), l !== -1 && l < i && (i = l), s !== -1) {
|
|
@@ -1716,32 +1715,39 @@ function Sl(t) {
|
|
|
1716
1715
|
return console.log("beforeClause", o), console.log("afterClause", c), c ? `${o} {{ filters | where }} ${c}` : `${o.replace(/;$/, "")} {{ filters | where }}`;
|
|
1717
1716
|
}
|
|
1718
1717
|
}
|
|
1719
|
-
function
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1718
|
+
function kl({
|
|
1719
|
+
sql: t,
|
|
1720
|
+
error: s,
|
|
1721
|
+
setShowAIDialog: a,
|
|
1722
|
+
setUserInputforAI: l,
|
|
1723
|
+
setTriggerAIRun: r
|
|
1724
1724
|
}) {
|
|
1725
|
-
return /* @__PURE__ */ n(
|
|
1726
|
-
/* @__PURE__ */ e(
|
|
1725
|
+
return !t && !s ? null : /* @__PURE__ */ n(ba, { openDelay: s ? 0 : 500, children: [
|
|
1726
|
+
/* @__PURE__ */ e(ya, { asChild: !0, children: /* @__PURE__ */ e(I, { variant: "link", className: "h-5 p-0", children: s ? /* @__PURE__ */ e($s, { className: "h-4 w-4 text-red-500" }) : /* @__PURE__ */ e(xn, { className: "h-4 w-4 text-muted-foreground" }) }) }),
|
|
1727
1727
|
/* @__PURE__ */ e(
|
|
1728
|
-
|
|
1728
|
+
va,
|
|
1729
1729
|
{
|
|
1730
1730
|
align: "start",
|
|
1731
1731
|
className: "w-full min-w-fit max-w-[700px]",
|
|
1732
1732
|
children: /* @__PURE__ */ e("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ n("div", { className: "flex grow flex-col space-y-2", children: [
|
|
1733
|
-
/* @__PURE__ */
|
|
1734
|
-
|
|
1735
|
-
|
|
1733
|
+
/* @__PURE__ */ n(Te, { className: "max-h-[250px] min-h-0 overflow-scroll text-xs leading-relaxed text-foreground/80", children: [
|
|
1734
|
+
s && s,
|
|
1735
|
+
t && /* @__PURE__ */ n("div", { className: "flex flex-col space-y-1.5", children: [
|
|
1736
|
+
/* @__PURE__ */ e("span", { className: "text-xs font-semibold", children: "Resolved SQL" }),
|
|
1737
|
+
/* @__PURE__ */ e("span", { className: "font-mono", children: t })
|
|
1738
|
+
] })
|
|
1739
|
+
] }),
|
|
1740
|
+
s && /* @__PURE__ */ n(
|
|
1741
|
+
I,
|
|
1736
1742
|
{
|
|
1737
1743
|
onClick: () => {
|
|
1738
|
-
|
|
1744
|
+
a(!0), l(s), r(!0);
|
|
1739
1745
|
},
|
|
1740
1746
|
size: "sm",
|
|
1741
|
-
variant: "
|
|
1747
|
+
variant: "secondary",
|
|
1742
1748
|
children: [
|
|
1743
|
-
/* @__PURE__ */ e(
|
|
1744
|
-
"Debug with
|
|
1749
|
+
/* @__PURE__ */ e(Qs, { className: "mr-2 h-4 w-4" }),
|
|
1750
|
+
"Debug with Assistant"
|
|
1745
1751
|
]
|
|
1746
1752
|
}
|
|
1747
1753
|
)
|
|
@@ -1750,40 +1756,40 @@ function wl({
|
|
|
1750
1756
|
)
|
|
1751
1757
|
] });
|
|
1752
1758
|
}
|
|
1753
|
-
function
|
|
1759
|
+
function zl({
|
|
1754
1760
|
userInput: t,
|
|
1755
1761
|
triggerAIRun: s,
|
|
1756
1762
|
setTriggerAIRun: a,
|
|
1757
1763
|
open: l,
|
|
1758
1764
|
setOpen: r
|
|
1759
1765
|
}) {
|
|
1760
|
-
const i = Ge(null), o = Ge(null), [c, d] = j([]), [h, f] = j(""), [
|
|
1766
|
+
const i = Ge(null), o = Ge(null), [c, d] = j([]), [h, f] = j(""), [v, x] = j(null), { authToken: u } = Me(), g = p((O) => {
|
|
1761
1767
|
var _;
|
|
1762
|
-
return (_ =
|
|
1763
|
-
}), b = p((
|
|
1768
|
+
return (_ = O == null ? void 0 : O.card) == null ? void 0 : _.sql;
|
|
1769
|
+
}), b = p((O) => {
|
|
1764
1770
|
var _;
|
|
1765
|
-
return (_ =
|
|
1766
|
-
}), k = p((
|
|
1767
|
-
(
|
|
1771
|
+
return (_ = O == null ? void 0 : O.card) == null ? void 0 : _.python;
|
|
1772
|
+
}), k = p((O) => O.actions.setCardSql), N = p((O) => O.actions.setRunSql), V = p(
|
|
1773
|
+
(O) => O.actions.switchCardType
|
|
1768
1774
|
), w = p(
|
|
1769
|
-
(
|
|
1770
|
-
),
|
|
1771
|
-
(
|
|
1775
|
+
(O) => O.selectedDatabaseName
|
|
1776
|
+
), z = p((O) => O.selectedTableName), F = p(
|
|
1777
|
+
(O) => O.selectedConnectionId
|
|
1772
1778
|
), E = p(
|
|
1773
|
-
(
|
|
1774
|
-
),
|
|
1775
|
-
(
|
|
1776
|
-
), { selectedDatamodelName: R, connectionType:
|
|
1779
|
+
(O) => O.selectedSchemaName
|
|
1780
|
+
), U = T(
|
|
1781
|
+
(O) => O.dashboard.aiScopeTables
|
|
1782
|
+
), { selectedDatamodelName: R, connectionType: B } = Ae(), {
|
|
1777
1783
|
messages: m,
|
|
1778
|
-
setMessages:
|
|
1779
|
-
reload:
|
|
1784
|
+
setMessages: y,
|
|
1785
|
+
reload: M,
|
|
1780
1786
|
append: C,
|
|
1781
1787
|
input: A,
|
|
1782
1788
|
status: $,
|
|
1783
|
-
handleInputChange:
|
|
1789
|
+
handleInputChange: J,
|
|
1784
1790
|
handleSubmit: Q,
|
|
1785
1791
|
stop: K
|
|
1786
|
-
} =
|
|
1792
|
+
} = Nn({
|
|
1787
1793
|
api: "https://semaphor.cloud/api/v1/assistant",
|
|
1788
1794
|
headers: {
|
|
1789
1795
|
Authorization: `Bearer ${u == null ? void 0 : u.accessToken}`
|
|
@@ -1794,12 +1800,12 @@ function kl({
|
|
|
1794
1800
|
maxSteps: 10,
|
|
1795
1801
|
//maxToolRoundtrips: 5,
|
|
1796
1802
|
onToolCall: q,
|
|
1797
|
-
onFinish(
|
|
1798
|
-
me(_.usage), f(""), console.log("onFinish",
|
|
1803
|
+
onFinish(O, _) {
|
|
1804
|
+
me(_.usage), f(""), console.log("onFinish", O, _), _.finishReason === "stop" && f("");
|
|
1799
1805
|
}
|
|
1800
1806
|
});
|
|
1801
1807
|
ce(() => {
|
|
1802
|
-
s && t && (
|
|
1808
|
+
s && t && (J({
|
|
1803
1809
|
target: { value: t }
|
|
1804
1810
|
}), setTimeout(() => {
|
|
1805
1811
|
Q(), a(!1);
|
|
@@ -1809,47 +1815,47 @@ function kl({
|
|
|
1809
1815
|
Q,
|
|
1810
1816
|
t,
|
|
1811
1817
|
a,
|
|
1812
|
-
|
|
1818
|
+
J
|
|
1813
1819
|
]);
|
|
1814
|
-
const
|
|
1820
|
+
const le = Ge(l);
|
|
1815
1821
|
ce(() => {
|
|
1816
|
-
const
|
|
1817
|
-
|
|
1822
|
+
const O = le.current ? "smooth" : "auto";
|
|
1823
|
+
le.current = l;
|
|
1818
1824
|
const _ = setTimeout(() => {
|
|
1819
1825
|
var P;
|
|
1820
1826
|
o.current && (o.current.scroll({
|
|
1821
1827
|
top: o.current.scrollHeight,
|
|
1822
|
-
behavior:
|
|
1828
|
+
behavior: O
|
|
1823
1829
|
}), (P = i.current) == null || P.focus());
|
|
1824
1830
|
}, 50);
|
|
1825
1831
|
return () => clearTimeout(_);
|
|
1826
1832
|
}, [m, l]);
|
|
1827
|
-
function me(
|
|
1833
|
+
function me(O) {
|
|
1828
1834
|
x((_) => _ ? {
|
|
1829
|
-
promptTokens: _.promptTokens +
|
|
1830
|
-
completionTokens: _.completionTokens +
|
|
1831
|
-
totalTokens: _.totalTokens +
|
|
1832
|
-
} :
|
|
1835
|
+
promptTokens: _.promptTokens + O.promptTokens,
|
|
1836
|
+
completionTokens: _.completionTokens + O.completionTokens,
|
|
1837
|
+
totalTokens: _.totalTokens + O.totalTokens
|
|
1838
|
+
} : O);
|
|
1833
1839
|
}
|
|
1834
|
-
function
|
|
1835
|
-
const _ =
|
|
1836
|
-
|
|
1840
|
+
function W(O) {
|
|
1841
|
+
const _ = Cn(c, O);
|
|
1842
|
+
re(_);
|
|
1837
1843
|
}
|
|
1838
1844
|
async function q({
|
|
1839
|
-
toolCall:
|
|
1845
|
+
toolCall: O
|
|
1840
1846
|
}) {
|
|
1841
|
-
if (
|
|
1842
|
-
console.log("createChart",
|
|
1843
|
-
const _ =
|
|
1847
|
+
if (O.toolName === "createChart") {
|
|
1848
|
+
console.log("createChart", O.args);
|
|
1849
|
+
const _ = O.args.sql, P = O.args.chartType;
|
|
1844
1850
|
return V(P), k(_), N(!0), {
|
|
1845
1851
|
status: "success",
|
|
1846
1852
|
message: "Let the user know that chart is created"
|
|
1847
1853
|
// query: sql,
|
|
1848
1854
|
};
|
|
1849
|
-
} else if (
|
|
1855
|
+
} else if (O.toolName === "getTableColumns")
|
|
1850
1856
|
f("Getting table columns...");
|
|
1851
1857
|
else {
|
|
1852
|
-
if (
|
|
1858
|
+
if (O.toolName === "getUserSql")
|
|
1853
1859
|
return g ? (console.log("cardSql", g), console.log("cardPython", b), {
|
|
1854
1860
|
status: "success",
|
|
1855
1861
|
sql: g,
|
|
@@ -1861,15 +1867,15 @@ function kl({
|
|
|
1861
1867
|
f("Thinking...");
|
|
1862
1868
|
}
|
|
1863
1869
|
}
|
|
1864
|
-
function L(
|
|
1865
|
-
return
|
|
1870
|
+
function L(O) {
|
|
1871
|
+
return O.map((P) => ({
|
|
1866
1872
|
...P,
|
|
1867
1873
|
connectionType: P.connectionType === "API" || P.connectionType === "S3" ? "DuckDb" : P.connectionType
|
|
1868
1874
|
}));
|
|
1869
1875
|
}
|
|
1870
|
-
function
|
|
1871
|
-
const _ = L(
|
|
1872
|
-
d(_),
|
|
1876
|
+
function re(O) {
|
|
1877
|
+
const _ = L(O);
|
|
1878
|
+
d(_), y((P) => [
|
|
1873
1879
|
...P,
|
|
1874
1880
|
{
|
|
1875
1881
|
id: crypto.randomUUID(),
|
|
@@ -1878,69 +1884,69 @@ function kl({
|
|
|
1878
1884
|
}
|
|
1879
1885
|
]);
|
|
1880
1886
|
}
|
|
1881
|
-
function
|
|
1882
|
-
const
|
|
1887
|
+
function ie() {
|
|
1888
|
+
const O = {
|
|
1883
1889
|
databaseName: w || "",
|
|
1884
1890
|
schemaName: E || "",
|
|
1885
|
-
tableName:
|
|
1891
|
+
tableName: z || "",
|
|
1886
1892
|
datamodelName: R || "",
|
|
1887
1893
|
connectionId: F || "",
|
|
1888
|
-
connectionType:
|
|
1889
|
-
}, _ =
|
|
1890
|
-
|
|
1894
|
+
connectionType: B || ""
|
|
1895
|
+
}, _ = Yt([...c, O]);
|
|
1896
|
+
re(_);
|
|
1891
1897
|
}
|
|
1892
1898
|
function ue() {
|
|
1893
|
-
const
|
|
1899
|
+
const O = {
|
|
1894
1900
|
databaseName: w || "",
|
|
1895
1901
|
schemaName: E || "",
|
|
1896
|
-
tableName:
|
|
1902
|
+
tableName: z || "",
|
|
1897
1903
|
datamodelName: R || "",
|
|
1898
1904
|
connectionId: F || "",
|
|
1899
|
-
connectionType:
|
|
1900
|
-
}, _ =
|
|
1901
|
-
[...
|
|
1902
|
-
|
|
1905
|
+
connectionType: B || ""
|
|
1906
|
+
}, _ = Sn(
|
|
1907
|
+
[...U || [], ...c],
|
|
1908
|
+
O
|
|
1903
1909
|
);
|
|
1904
1910
|
if (console.log("isInScope", _), !_ || c.length === 0) {
|
|
1905
|
-
const P =
|
|
1906
|
-
...
|
|
1911
|
+
const P = Yt([
|
|
1912
|
+
...U || [],
|
|
1907
1913
|
...c,
|
|
1908
|
-
|
|
1914
|
+
O
|
|
1909
1915
|
]).filter(
|
|
1910
|
-
(
|
|
1916
|
+
(se) => se.connectionId === O.connectionId
|
|
1911
1917
|
);
|
|
1912
|
-
|
|
1918
|
+
re(P);
|
|
1913
1919
|
}
|
|
1914
1920
|
}
|
|
1915
|
-
function oe(
|
|
1916
|
-
r(!1), k(
|
|
1921
|
+
function oe(O) {
|
|
1922
|
+
r(!1), k(O), N(!0);
|
|
1917
1923
|
}
|
|
1918
1924
|
const ne = !["ready", "error"].includes($);
|
|
1919
1925
|
return {
|
|
1920
1926
|
messages: m,
|
|
1921
|
-
setMessages:
|
|
1922
|
-
reload:
|
|
1927
|
+
setMessages: y,
|
|
1928
|
+
reload: M,
|
|
1923
1929
|
append: C,
|
|
1924
1930
|
input: A,
|
|
1925
1931
|
isLoading: ne,
|
|
1926
1932
|
handleRun: oe,
|
|
1927
1933
|
handleOpenDialogAndSetScope: ue,
|
|
1928
|
-
handleAddCurrentTableToScope:
|
|
1929
|
-
removeFromCurrentSelections:
|
|
1934
|
+
handleAddCurrentTableToScope: ie,
|
|
1935
|
+
removeFromCurrentSelections: W,
|
|
1930
1936
|
currentScope: c,
|
|
1931
1937
|
setCurrentScope: d,
|
|
1932
1938
|
containerRef: o,
|
|
1933
1939
|
inputRef: i,
|
|
1934
|
-
handleInputChange:
|
|
1940
|
+
handleInputChange: J,
|
|
1935
1941
|
handleSubmit: Q,
|
|
1936
1942
|
stop: K,
|
|
1937
1943
|
chatStatus: $,
|
|
1938
1944
|
toolStatus: h,
|
|
1939
|
-
llmUsage:
|
|
1945
|
+
llmUsage: v
|
|
1940
1946
|
};
|
|
1941
1947
|
}
|
|
1942
1948
|
const Ol = !1;
|
|
1943
|
-
function
|
|
1949
|
+
function Tl({
|
|
1944
1950
|
open: t,
|
|
1945
1951
|
setOpen: s,
|
|
1946
1952
|
userInput: a,
|
|
@@ -1948,7 +1954,7 @@ function zl({
|
|
|
1948
1954
|
setTriggerAIRun: r
|
|
1949
1955
|
}) {
|
|
1950
1956
|
const [i, o] = j(!1), [c, d] = j(Ol), [h, f] = j(!1), {
|
|
1951
|
-
messages:
|
|
1957
|
+
messages: v,
|
|
1952
1958
|
setMessages: x,
|
|
1953
1959
|
reload: u,
|
|
1954
1960
|
input: g,
|
|
@@ -1957,17 +1963,17 @@ function zl({
|
|
|
1957
1963
|
handleOpenDialogAndSetScope: N,
|
|
1958
1964
|
handleAddCurrentTableToScope: V,
|
|
1959
1965
|
removeFromCurrentSelections: w,
|
|
1960
|
-
currentScope:
|
|
1966
|
+
currentScope: z,
|
|
1961
1967
|
setCurrentScope: F,
|
|
1962
1968
|
containerRef: E,
|
|
1963
|
-
inputRef:
|
|
1969
|
+
inputRef: U,
|
|
1964
1970
|
handleInputChange: R,
|
|
1965
|
-
handleSubmit:
|
|
1971
|
+
handleSubmit: B,
|
|
1966
1972
|
stop: m,
|
|
1967
|
-
chatStatus:
|
|
1968
|
-
toolStatus:
|
|
1973
|
+
chatStatus: y,
|
|
1974
|
+
toolStatus: M,
|
|
1969
1975
|
llmUsage: C
|
|
1970
|
-
} =
|
|
1976
|
+
} = zl({
|
|
1971
1977
|
userInput: a,
|
|
1972
1978
|
triggerAIRun: l,
|
|
1973
1979
|
setTriggerAIRun: r,
|
|
@@ -1976,10 +1982,10 @@ function zl({
|
|
|
1976
1982
|
});
|
|
1977
1983
|
function A() {
|
|
1978
1984
|
return /* @__PURE__ */ n(Vt, { children: [
|
|
1979
|
-
/* @__PURE__ */ e(Et, { children: /* @__PURE__ */ e(
|
|
1985
|
+
/* @__PURE__ */ e(Et, { children: /* @__PURE__ */ e(Pt, { className: "size-3.5 text-muted-foreground/70 hover:text-muted-foreground" }) }),
|
|
1980
1986
|
/* @__PURE__ */ n(At, { align: "end", children: [
|
|
1981
|
-
/* @__PURE__ */ e(
|
|
1982
|
-
/* @__PURE__ */ e(
|
|
1987
|
+
/* @__PURE__ */ e(ua, { children: "Options" }),
|
|
1988
|
+
/* @__PURE__ */ e(ha, {}),
|
|
1983
1989
|
/* @__PURE__ */ e(
|
|
1984
1990
|
Nt,
|
|
1985
1991
|
{
|
|
@@ -2007,9 +2013,9 @@ function zl({
|
|
|
2007
2013
|
] })
|
|
2008
2014
|
] });
|
|
2009
2015
|
}
|
|
2010
|
-
return /* @__PURE__ */ n(
|
|
2011
|
-
/* @__PURE__ */ e(
|
|
2012
|
-
|
|
2016
|
+
return /* @__PURE__ */ n(Tt, { open: t, onOpenChange: s, children: [
|
|
2017
|
+
/* @__PURE__ */ e(Mt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2018
|
+
I,
|
|
2013
2019
|
{
|
|
2014
2020
|
onClick: N,
|
|
2015
2021
|
size: "sm",
|
|
@@ -2019,13 +2025,13 @@ function zl({
|
|
|
2019
2025
|
}
|
|
2020
2026
|
) }),
|
|
2021
2027
|
/* @__PURE__ */ n(Dt, { className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]", children: [
|
|
2022
|
-
/* @__PURE__ */ e(
|
|
2028
|
+
/* @__PURE__ */ e(It, { children: /* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-2 pr-5", children: [
|
|
2023
2029
|
/* @__PURE__ */ n("div", { children: [
|
|
2024
2030
|
/* @__PURE__ */ e(Lt, { children: "Assistant" }),
|
|
2025
2031
|
/* @__PURE__ */ e(Ft, { children: "What can I help you with?" }),
|
|
2026
|
-
|
|
2032
|
+
z && z.length > 0 && /* @__PURE__ */ n("div", { className: "mt-2 flex flex-wrap items-center gap-2", children: [
|
|
2027
2033
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Tables in scope:" }),
|
|
2028
|
-
|
|
2034
|
+
z == null ? void 0 : z.map(($, J) => /* @__PURE__ */ n(
|
|
2029
2035
|
"div",
|
|
2030
2036
|
{
|
|
2031
2037
|
className: "flex items-center gap-2 rounded-md bg-muted px-2 py-1 text-xs",
|
|
@@ -2042,25 +2048,25 @@ function zl({
|
|
|
2042
2048
|
onClick: () => {
|
|
2043
2049
|
w($);
|
|
2044
2050
|
},
|
|
2045
|
-
children: /* @__PURE__ */ e(
|
|
2051
|
+
children: /* @__PURE__ */ e(Ye, { className: "size-3 text-muted-foreground hover:text-foreground" })
|
|
2046
2052
|
}
|
|
2047
2053
|
)
|
|
2048
2054
|
]
|
|
2049
2055
|
},
|
|
2050
|
-
|
|
2056
|
+
J
|
|
2051
2057
|
))
|
|
2052
2058
|
] }),
|
|
2053
|
-
(
|
|
2059
|
+
(z == null ? void 0 : z.length) === 0 && /* @__PURE__ */ n("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
2054
2060
|
/* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: "Tables in scope: None" }),
|
|
2055
2061
|
/* @__PURE__ */ n(
|
|
2056
|
-
|
|
2062
|
+
I,
|
|
2057
2063
|
{
|
|
2058
2064
|
className: "h-6 text-xs",
|
|
2059
2065
|
size: "sm",
|
|
2060
2066
|
variant: "secondary",
|
|
2061
2067
|
onClick: V,
|
|
2062
2068
|
children: [
|
|
2063
|
-
/* @__PURE__ */ e(
|
|
2069
|
+
/* @__PURE__ */ e(Xe, { className: "mr-2 size-3" }),
|
|
2064
2070
|
"Current Table"
|
|
2065
2071
|
]
|
|
2066
2072
|
}
|
|
@@ -2070,7 +2076,7 @@ function zl({
|
|
|
2070
2076
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2071
2077
|
A(),
|
|
2072
2078
|
/* @__PURE__ */ e(
|
|
2073
|
-
|
|
2079
|
+
I,
|
|
2074
2080
|
{
|
|
2075
2081
|
className: "h-8",
|
|
2076
2082
|
size: "sm",
|
|
@@ -2090,18 +2096,18 @@ function zl({
|
|
|
2090
2096
|
className: "h-[625px] w-full overflow-auto border-t border-t-muted",
|
|
2091
2097
|
children: /* @__PURE__ */ n("div", { className: "space-y-4 py-2 pr-3", role: "messages", children: [
|
|
2092
2098
|
/* @__PURE__ */ e(
|
|
2093
|
-
|
|
2099
|
+
wn,
|
|
2094
2100
|
{
|
|
2095
|
-
messages:
|
|
2101
|
+
messages: v,
|
|
2096
2102
|
showTools: c,
|
|
2097
2103
|
handleRun: k,
|
|
2098
2104
|
showSystemMessage: h
|
|
2099
2105
|
}
|
|
2100
2106
|
),
|
|
2101
2107
|
/* @__PURE__ */ e(
|
|
2102
|
-
|
|
2108
|
+
kn,
|
|
2103
2109
|
{
|
|
2104
|
-
status:
|
|
2110
|
+
status: zn(y, M),
|
|
2105
2111
|
isLoading: b
|
|
2106
2112
|
}
|
|
2107
2113
|
)
|
|
@@ -2112,10 +2118,10 @@ function zl({
|
|
|
2112
2118
|
On,
|
|
2113
2119
|
{
|
|
2114
2120
|
stop: m,
|
|
2115
|
-
ref:
|
|
2121
|
+
ref: U,
|
|
2116
2122
|
input: g,
|
|
2117
2123
|
handleInputChange: R,
|
|
2118
|
-
handleSubmit:
|
|
2124
|
+
handleSubmit: B,
|
|
2119
2125
|
isLoading: b
|
|
2120
2126
|
}
|
|
2121
2127
|
),
|
|
@@ -2139,10 +2145,10 @@ var $a = {
|
|
|
2139
2145
|
className: void 0,
|
|
2140
2146
|
style: void 0,
|
|
2141
2147
|
attr: void 0
|
|
2142
|
-
},
|
|
2143
|
-
function
|
|
2148
|
+
}, la = Oe.createContext && /* @__PURE__ */ Oe.createContext($a), Ml = ["attr", "size", "title"];
|
|
2149
|
+
function Dl(t, s) {
|
|
2144
2150
|
if (t == null) return {};
|
|
2145
|
-
var a =
|
|
2151
|
+
var a = Il(t, s), l, r;
|
|
2146
2152
|
if (Object.getOwnPropertySymbols) {
|
|
2147
2153
|
var i = Object.getOwnPropertySymbols(t);
|
|
2148
2154
|
for (r = 0; r < i.length; r++)
|
|
@@ -2150,7 +2156,7 @@ function Tl(t, s) {
|
|
|
2150
2156
|
}
|
|
2151
2157
|
return a;
|
|
2152
2158
|
}
|
|
2153
|
-
function
|
|
2159
|
+
function Il(t, s) {
|
|
2154
2160
|
if (t == null) return {};
|
|
2155
2161
|
var a = {};
|
|
2156
2162
|
for (var l in t)
|
|
@@ -2170,7 +2176,7 @@ function ct() {
|
|
|
2170
2176
|
return t;
|
|
2171
2177
|
}, ct.apply(this, arguments);
|
|
2172
2178
|
}
|
|
2173
|
-
function
|
|
2179
|
+
function ra(t, s) {
|
|
2174
2180
|
var a = Object.keys(t);
|
|
2175
2181
|
if (Object.getOwnPropertySymbols) {
|
|
2176
2182
|
var l = Object.getOwnPropertySymbols(t);
|
|
@@ -2183,22 +2189,22 @@ function ca(t, s) {
|
|
|
2183
2189
|
function dt(t) {
|
|
2184
2190
|
for (var s = 1; s < arguments.length; s++) {
|
|
2185
2191
|
var a = arguments[s] != null ? arguments[s] : {};
|
|
2186
|
-
s % 2 ?
|
|
2187
|
-
|
|
2188
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) :
|
|
2192
|
+
s % 2 ? ra(Object(a), !0).forEach(function(l) {
|
|
2193
|
+
Ll(t, l, a[l]);
|
|
2194
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : ra(Object(a)).forEach(function(l) {
|
|
2189
2195
|
Object.defineProperty(t, l, Object.getOwnPropertyDescriptor(a, l));
|
|
2190
2196
|
});
|
|
2191
2197
|
}
|
|
2192
2198
|
return t;
|
|
2193
2199
|
}
|
|
2194
|
-
function
|
|
2195
|
-
return s =
|
|
2200
|
+
function Ll(t, s, a) {
|
|
2201
|
+
return s = Fl(s), s in t ? Object.defineProperty(t, s, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[s] = a, t;
|
|
2196
2202
|
}
|
|
2197
|
-
function
|
|
2198
|
-
var s =
|
|
2203
|
+
function Fl(t) {
|
|
2204
|
+
var s = Vl(t, "string");
|
|
2199
2205
|
return typeof s == "symbol" ? s : s + "";
|
|
2200
2206
|
}
|
|
2201
|
-
function
|
|
2207
|
+
function Vl(t, s) {
|
|
2202
2208
|
if (typeof t != "object" || !t) return t;
|
|
2203
2209
|
var a = t[Symbol.toPrimitive];
|
|
2204
2210
|
if (a !== void 0) {
|
|
@@ -2208,24 +2214,24 @@ function Fl(t, s) {
|
|
|
2208
2214
|
}
|
|
2209
2215
|
return (s === "string" ? String : Number)(t);
|
|
2210
2216
|
}
|
|
2211
|
-
function
|
|
2212
|
-
return t && t.map((s, a) => /* @__PURE__ */
|
|
2217
|
+
function Ua(t) {
|
|
2218
|
+
return t && t.map((s, a) => /* @__PURE__ */ Oe.createElement(s.tag, dt({
|
|
2213
2219
|
key: a
|
|
2214
|
-
}, s.attr),
|
|
2220
|
+
}, s.attr), Ua(s.child)));
|
|
2215
2221
|
}
|
|
2216
2222
|
function ge(t) {
|
|
2217
|
-
return (s) => /* @__PURE__ */
|
|
2223
|
+
return (s) => /* @__PURE__ */ Oe.createElement(El, ct({
|
|
2218
2224
|
attr: dt({}, t.attr)
|
|
2219
|
-
}, s),
|
|
2225
|
+
}, s), Ua(t.child));
|
|
2220
2226
|
}
|
|
2221
|
-
function
|
|
2227
|
+
function El(t) {
|
|
2222
2228
|
var s = (a) => {
|
|
2223
2229
|
var {
|
|
2224
2230
|
attr: l,
|
|
2225
2231
|
size: r,
|
|
2226
2232
|
title: i
|
|
2227
|
-
} = t, o =
|
|
2228
|
-
return a.className && (d = a.className), t.className && (d = (d ? d + " " : "") + t.className), /* @__PURE__ */
|
|
2233
|
+
} = t, o = Dl(t, Ml), c = r || a.size || "1em", d;
|
|
2234
|
+
return a.className && (d = a.className), t.className && (d = (d ? d + " " : "") + t.className), /* @__PURE__ */ Oe.createElement("svg", ct({
|
|
2229
2235
|
stroke: "currentColor",
|
|
2230
2236
|
fill: "currentColor",
|
|
2231
2237
|
strokeWidth: "0"
|
|
@@ -2237,31 +2243,15 @@ function Vl(t) {
|
|
|
2237
2243
|
height: c,
|
|
2238
2244
|
width: c,
|
|
2239
2245
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2240
|
-
}), i && /* @__PURE__ */
|
|
2246
|
+
}), i && /* @__PURE__ */ Oe.createElement("title", null, i), t.children);
|
|
2241
2247
|
};
|
|
2242
|
-
return
|
|
2248
|
+
return la !== void 0 ? /* @__PURE__ */ Oe.createElement(la.Consumer, null, (a) => s(a)) : s($a);
|
|
2243
2249
|
}
|
|
2244
|
-
function
|
|
2250
|
+
function Al(t) {
|
|
2245
2251
|
return ge({ 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: [] }] })(t);
|
|
2246
2252
|
}
|
|
2247
|
-
function
|
|
2248
|
-
|
|
2249
|
-
/* @__PURE__ */ e(Rt, { asChild: !0, children: /* @__PURE__ */ e(M, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e(zn, { className: "h-4 w-4 text-muted-foreground" }) }) }),
|
|
2250
|
-
/* @__PURE__ */ e(
|
|
2251
|
-
jt,
|
|
2252
|
-
{
|
|
2253
|
-
align: "end",
|
|
2254
|
-
className: "w-full min-w-fit max-w-[700px] p-3 pt-2",
|
|
2255
|
-
children: /* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
2256
|
-
/* @__PURE__ */ e(G, { className: "text-xs font-semibold", children: "Resolved Query" }),
|
|
2257
|
-
/* @__PURE__ */ e("div", { className: "flex grow flex-col space-y-2", children: /* @__PURE__ */ e(we, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e("p", { className: "overflow-auto rounded-md bg-muted p-2 font-mono text-xs leading-relaxed", children: t }) }) })
|
|
2258
|
-
] })
|
|
2259
|
-
}
|
|
2260
|
-
)
|
|
2261
|
-
] });
|
|
2262
|
-
}
|
|
2263
|
-
function Ua(t) {
|
|
2264
|
-
const { theme: s } = In(), a = z((b) => b.theme), l = p((b) => b.frame), r = p((b) => b.card), i = p((b) => b.activeTabCardId), o = Tn(), { refetch: c } = Ve(r), { updateCardTab: d, setRunSql: h } = de(), f = Ge(), y = Ge({}), x = l.cards.find((b) => b.id === i), u = Va(() => {
|
|
2253
|
+
function Ba(t) {
|
|
2254
|
+
const { theme: s } = Tn(), a = T((b) => b.theme), l = p((b) => b.frame), r = p((b) => b.card), i = p((b) => b.activeTabCardId), o = Mn(), { refetch: c } = Ve(r), { updateCardTab: d, setRunSql: h } = de(), f = Ge(), v = Ge({}), x = l.cards.find((b) => b.id === i), u = Va(() => {
|
|
2265
2255
|
let b = "";
|
|
2266
2256
|
return t === "python" && (b = (x == null ? void 0 : x.python) || wa), t === "sql" && (b = (x == null ? void 0 : x.sql) || ""), b;
|
|
2267
2257
|
}, [t, x]);
|
|
@@ -2269,11 +2259,11 @@ function Ua(t) {
|
|
|
2269
2259
|
if (i && r.id && r.id !== i) {
|
|
2270
2260
|
if (f.current && o) {
|
|
2271
2261
|
const b = f.current.getModel();
|
|
2272
|
-
b && (
|
|
2273
|
-
let k =
|
|
2262
|
+
b && (v.current[r.id] = b);
|
|
2263
|
+
let k = v.current[i];
|
|
2274
2264
|
if (!k) {
|
|
2275
2265
|
const N = u();
|
|
2276
|
-
k = o.editor.createModel(N, t),
|
|
2266
|
+
k = o.editor.createModel(N, t), v.current[i] = k;
|
|
2277
2267
|
}
|
|
2278
2268
|
f.current.setModel(k);
|
|
2279
2269
|
}
|
|
@@ -2313,18 +2303,18 @@ function Ua(t) {
|
|
|
2313
2303
|
);
|
|
2314
2304
|
}, [o, c, r]);
|
|
2315
2305
|
function g(b, k) {
|
|
2316
|
-
if (f.current = b, !
|
|
2306
|
+
if (f.current = b, !v.current[r.id]) {
|
|
2317
2307
|
const N = b.getModel(), V = u();
|
|
2318
|
-
|
|
2308
|
+
v.current[r.id] = N || (k == null ? void 0 : k.editor.createModel(V, t)) || b.getModel();
|
|
2319
2309
|
}
|
|
2320
|
-
b.setModel(
|
|
2310
|
+
b.setModel(v.current[r.id]);
|
|
2321
2311
|
}
|
|
2322
2312
|
return { handleEditorDidMount: g };
|
|
2323
2313
|
}
|
|
2324
2314
|
function ql() {
|
|
2325
|
-
const t = p((o) => o.card.sql), s = p((o) => o.sqlGen), { setCardSql: a, setSqlGen: l } = de(), { handleEditorDidMount: r } =
|
|
2315
|
+
const t = p((o) => o.card.sql), s = p((o) => o.sqlGen), { setCardSql: a, setSqlGen: l } = de(), { handleEditorDidMount: r } = Ba("sql");
|
|
2326
2316
|
function i(o) {
|
|
2327
|
-
a(o),
|
|
2317
|
+
a(o), In(s) || l({});
|
|
2328
2318
|
}
|
|
2329
2319
|
return /* @__PURE__ */ e(
|
|
2330
2320
|
ht,
|
|
@@ -2351,7 +2341,7 @@ function ql() {
|
|
|
2351
2341
|
);
|
|
2352
2342
|
}
|
|
2353
2343
|
function Rl() {
|
|
2354
|
-
const t = p((r) => r.card.python), { setCardPython: s } = de(), { handleEditorDidMount: a } =
|
|
2344
|
+
const t = p((r) => r.card.python), { setCardPython: s } = de(), { handleEditorDidMount: a } = Ba("python");
|
|
2355
2345
|
function l(r) {
|
|
2356
2346
|
s(r);
|
|
2357
2347
|
}
|
|
@@ -2379,19 +2369,14 @@ function Rl() {
|
|
|
2379
2369
|
}
|
|
2380
2370
|
);
|
|
2381
2371
|
}
|
|
2382
|
-
function jl() {
|
|
2383
|
-
const t = z((i) => i.dashboard.filters), s = z((i) => i.filterValues), a = z((i) => i.selectedSheetId), l = t == null ? void 0 : t.filter(
|
|
2384
|
-
(i) => i.sheetId === a || !i.sheetId
|
|
2385
|
-
), r = s == null ? void 0 : s.filter(
|
|
2386
|
-
(i) => (l == null ? void 0 : l.some((o) => o.id === i.filterId)) || i.filterId.endsWith(a)
|
|
2387
|
-
);
|
|
2372
|
+
function jl({ jsonString: t }) {
|
|
2388
2373
|
return /* @__PURE__ */ e(
|
|
2389
2374
|
ht,
|
|
2390
2375
|
{
|
|
2391
2376
|
theme: "default",
|
|
2392
2377
|
defaultLanguage: "json",
|
|
2393
2378
|
className: "mt-1 min-h-[220px]",
|
|
2394
|
-
value:
|
|
2379
|
+
value: t,
|
|
2395
2380
|
options: {
|
|
2396
2381
|
readOnly: !0,
|
|
2397
2382
|
minimap: {
|
|
@@ -2415,7 +2400,7 @@ function _l() {
|
|
|
2415
2400
|
const [t, s] = j({
|
|
2416
2401
|
queryKey: [],
|
|
2417
2402
|
queryData: null
|
|
2418
|
-
}), a = Ln(), [l, r] = j(!1), [i, o] = j(!1), [c, d] = j(!1), [h, f] = j(""), [
|
|
2403
|
+
}), a = Ln(), [l, r] = j(!1), [i, o] = j(!1), [c, d] = j(!1), [h, f] = j(""), [v, x] = j(!1), u = p((D) => D.frame), g = p((D) => D.card), b = p((D) => D.isShowingVisual), k = p(
|
|
2419
2404
|
(D) => D.selectedConnectionId
|
|
2420
2405
|
), N = p(
|
|
2421
2406
|
(D) => D.selectedDatabaseName
|
|
@@ -2423,47 +2408,49 @@ function _l() {
|
|
|
2423
2408
|
(D) => D.selectedDatamodelId
|
|
2424
2409
|
), w = p(
|
|
2425
2410
|
(D) => D.selectedSchemaName
|
|
2426
|
-
),
|
|
2411
|
+
), z = p((D) => D.selectedTableName), F = p((D) => {
|
|
2427
2412
|
var he;
|
|
2428
2413
|
return (he = D == null ? void 0 : D.card) == null ? void 0 : he.sql;
|
|
2429
|
-
})
|
|
2430
|
-
|
|
2414
|
+
});
|
|
2415
|
+
p((D) => D.applyFilters);
|
|
2416
|
+
const { sheetFilterValues: E } = Fn(), {
|
|
2417
|
+
setCardCustomCfg: U,
|
|
2431
2418
|
setQueryResultColumns: R,
|
|
2432
|
-
setCardSql:
|
|
2419
|
+
setCardSql: B,
|
|
2433
2420
|
// setQueryError,
|
|
2434
2421
|
setPythonStdOut: m,
|
|
2435
|
-
setCardPreferences:
|
|
2436
|
-
setCardType:
|
|
2422
|
+
setCardPreferences: y,
|
|
2423
|
+
setCardType: M,
|
|
2437
2424
|
setCardPython: C
|
|
2438
|
-
} = de(), A = p((D) => D.onSave), $ = p((D) => D.onClose),
|
|
2425
|
+
} = de(), A = p((D) => D.onSave), $ = p((D) => D.onClose), J = p((D) => D.actions.setSqlGen), Q = p((D) => D.runSql), K = p((D) => D.actions.setRunSql), le = p((D) => D.actions.setCardCfg), me = p(
|
|
2439
2426
|
(D) => D.actions.setIsSqlRunning
|
|
2440
2427
|
), {
|
|
2441
|
-
data:
|
|
2428
|
+
data: W,
|
|
2442
2429
|
isLoading: q,
|
|
2443
2430
|
isFetching: L,
|
|
2444
|
-
isSuccess:
|
|
2445
|
-
isError:
|
|
2431
|
+
isSuccess: re,
|
|
2432
|
+
isError: ie,
|
|
2446
2433
|
error: ue,
|
|
2447
2434
|
queryKey: oe,
|
|
2448
2435
|
refetch: ne
|
|
2449
2436
|
} = Ve(g);
|
|
2450
2437
|
ce(() => {
|
|
2451
|
-
if (
|
|
2438
|
+
if (W && (W.rowLimitExceeded && Ke.error("Row limit (10,000) exceeded. Refine your query.", {
|
|
2452
2439
|
position: "top-center",
|
|
2453
2440
|
richColors: !0
|
|
2454
|
-
}), m((
|
|
2455
|
-
const { dimensionKeys: D } = wt(
|
|
2441
|
+
}), m((W == null ? void 0 : W.output) || ""), W.records.length > 0)) {
|
|
2442
|
+
const { dimensionKeys: D } = wt(W.records);
|
|
2456
2443
|
R(D);
|
|
2457
2444
|
}
|
|
2458
|
-
}, [
|
|
2459
|
-
(q || L) && me(!0), (
|
|
2445
|
+
}, [W, R, m]), ce(() => {
|
|
2446
|
+
(q || L) && me(!0), (ie || re) && me(!1), ie && (R([]), m(""));
|
|
2460
2447
|
}, [
|
|
2461
2448
|
q,
|
|
2462
2449
|
L,
|
|
2463
|
-
|
|
2450
|
+
W,
|
|
2464
2451
|
m,
|
|
2465
|
-
se,
|
|
2466
2452
|
ie,
|
|
2453
|
+
re,
|
|
2467
2454
|
me,
|
|
2468
2455
|
R,
|
|
2469
2456
|
// setQueryError,
|
|
@@ -2471,25 +2458,25 @@ function _l() {
|
|
|
2471
2458
|
]), ce(() => {
|
|
2472
2459
|
Q && (a.getQueryData(oe) || ne(), K(!1));
|
|
2473
2460
|
}, [Q, ne, K, oe, a]);
|
|
2474
|
-
function
|
|
2461
|
+
function O() {
|
|
2475
2462
|
const D = a.getQueryData(oe);
|
|
2476
2463
|
t.queryData || s({
|
|
2477
2464
|
queryKey: oe,
|
|
2478
2465
|
queryData: D
|
|
2479
|
-
}), a.setQueryData(oe, null), a.removeQueries({ queryKey: oe, exact: !0 }),
|
|
2466
|
+
}), a.setQueryData(oe, null), a.removeQueries({ queryKey: oe, exact: !0 }), B(""), J({}), C(""), le(void 0), U(""), y({}), M("bar");
|
|
2480
2467
|
}
|
|
2481
2468
|
function _(D, he) {
|
|
2482
2469
|
if (D.length === 0)
|
|
2483
2470
|
return "";
|
|
2484
2471
|
if (he) {
|
|
2485
|
-
const
|
|
2486
|
-
if (
|
|
2487
|
-
const fe =
|
|
2472
|
+
const Ie = D.find((fe) => fe.id === he);
|
|
2473
|
+
if (Ie) {
|
|
2474
|
+
const fe = Ie.tabTitle;
|
|
2488
2475
|
if (fe == "All__Header")
|
|
2489
2476
|
return D[0].id;
|
|
2490
2477
|
if (fe && fe.endsWith("__Header")) {
|
|
2491
|
-
const
|
|
2492
|
-
(xt) => xt.tabTitle ===
|
|
2478
|
+
const vt = fe.split("__")[0], et = D.find(
|
|
2479
|
+
(xt) => xt.tabTitle === vt
|
|
2493
2480
|
);
|
|
2494
2481
|
return et ? et.id : D[0].id;
|
|
2495
2482
|
}
|
|
@@ -2500,62 +2487,52 @@ function _l() {
|
|
|
2500
2487
|
}
|
|
2501
2488
|
function P() {
|
|
2502
2489
|
let D = F;
|
|
2503
|
-
F && !F.includes("{{") && (D =
|
|
2490
|
+
F && !F.includes("{{") && (D = wl(F), B(D));
|
|
2504
2491
|
const he = {
|
|
2505
2492
|
...g,
|
|
2506
2493
|
lastSelectedSchema: w,
|
|
2507
2494
|
lastSelectedDatamodelId: V,
|
|
2508
2495
|
lastSelectedDatabase: N,
|
|
2509
|
-
lastSelectedTable:
|
|
2496
|
+
lastSelectedTable: z,
|
|
2510
2497
|
connectionId: k,
|
|
2511
2498
|
type: b ? g.type : "table",
|
|
2512
2499
|
sql: D,
|
|
2513
2500
|
customCfg: b ? g.customCfg : null
|
|
2514
|
-
},
|
|
2501
|
+
}, Ie = u.cards.map(
|
|
2515
2502
|
($e) => $e.id === g.id ? he : $e
|
|
2516
2503
|
), fe = {
|
|
2517
2504
|
...u,
|
|
2518
|
-
cards:
|
|
2519
|
-
activeCardId: _(
|
|
2505
|
+
cards: Ie,
|
|
2506
|
+
activeCardId: _(Ie, u.activeCardId)
|
|
2520
2507
|
};
|
|
2521
2508
|
A == null || A(fe);
|
|
2522
2509
|
}
|
|
2523
|
-
function
|
|
2510
|
+
function se() {
|
|
2524
2511
|
const { queryKey: D, queryData: he } = t;
|
|
2525
|
-
D && he && a.setQueryData(D, he),
|
|
2512
|
+
D && he && a.setQueryData(D, he), J({}), $ == null || $();
|
|
2526
2513
|
}
|
|
2527
2514
|
function Re() {
|
|
2528
2515
|
return /* @__PURE__ */ n(ae, { children: [
|
|
2529
2516
|
i && /* @__PURE__ */ e(
|
|
2530
2517
|
"div",
|
|
2531
2518
|
{
|
|
2532
|
-
className: "relative flex w-1/3 min-w-0 grow overflow-hidden
|
|
2519
|
+
className: "relative flex w-1/3 min-w-0 grow overflow-hidden text-xs",
|
|
2533
2520
|
role: "editor-filter-container",
|
|
2534
|
-
children: /* @__PURE__ */
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
onClick: () => o(!1),
|
|
2541
|
-
className: "bg-background/50 text-foreground/50 hover:cursor-pointer hover:text-foreground"
|
|
2542
|
-
}
|
|
2543
|
-
)
|
|
2544
|
-
] }),
|
|
2545
|
-
/* @__PURE__ */ e(jl, {})
|
|
2546
|
-
] })
|
|
2521
|
+
children: /* @__PURE__ */ e("div", { className: "mt-2 w-[99%]", children: /* @__PURE__ */ e(
|
|
2522
|
+
jl,
|
|
2523
|
+
{
|
|
2524
|
+
jsonString: JSON.stringify(E, null, 2)
|
|
2525
|
+
}
|
|
2526
|
+
) })
|
|
2547
2527
|
}
|
|
2548
2528
|
),
|
|
2549
|
-
|
|
2550
|
-
|
|
2529
|
+
E && E.length > 0 && /* @__PURE__ */ e(
|
|
2530
|
+
I,
|
|
2551
2531
|
{
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
"font-bold text-red-800": E
|
|
2557
|
-
}
|
|
2558
|
-
)
|
|
2532
|
+
variant: "secondary",
|
|
2533
|
+
onClick: () => o(!i),
|
|
2534
|
+
className: "absolute bottom-0 right-6 size-7 p-1",
|
|
2535
|
+
children: i ? /* @__PURE__ */ e(Ye, { className: "size-3.5 text-muted-foreground" }) : /* @__PURE__ */ e(pa, { className: "size-3.5 text-muted-foreground" })
|
|
2559
2536
|
}
|
|
2560
2537
|
)
|
|
2561
2538
|
] });
|
|
@@ -2569,7 +2546,7 @@ function _l() {
|
|
|
2569
2546
|
role: "editor-resizable-group",
|
|
2570
2547
|
children: [
|
|
2571
2548
|
/* @__PURE__ */ n(
|
|
2572
|
-
|
|
2549
|
+
we,
|
|
2573
2550
|
{
|
|
2574
2551
|
id: "1",
|
|
2575
2552
|
order: 1,
|
|
@@ -2591,7 +2568,7 @@ function _l() {
|
|
|
2591
2568
|
l && /* @__PURE__ */ n(ae, { children: [
|
|
2592
2569
|
/* @__PURE__ */ e(it, { withHandle: !0, className: "border" }),
|
|
2593
2570
|
/* @__PURE__ */ n(
|
|
2594
|
-
|
|
2571
|
+
we,
|
|
2595
2572
|
{
|
|
2596
2573
|
id: "2",
|
|
2597
2574
|
order: 2,
|
|
@@ -2635,7 +2612,7 @@ function _l() {
|
|
|
2635
2612
|
children: [
|
|
2636
2613
|
/* @__PURE__ */ n("div", { className: "flex grow items-center gap-2", children: [
|
|
2637
2614
|
/* @__PURE__ */ n(
|
|
2638
|
-
|
|
2615
|
+
I,
|
|
2639
2616
|
{
|
|
2640
2617
|
title: "Shift + Enter",
|
|
2641
2618
|
disabled: q || L,
|
|
@@ -2646,29 +2623,30 @@ function _l() {
|
|
|
2646
2623
|
size: "sm",
|
|
2647
2624
|
variant: "outline",
|
|
2648
2625
|
children: [
|
|
2649
|
-
q || L ? /* @__PURE__ */ e(
|
|
2626
|
+
q || L ? /* @__PURE__ */ e(Qe, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e(Vn, { className: "mr-2 h-4 w-4" }),
|
|
2650
2627
|
"Run"
|
|
2651
2628
|
]
|
|
2652
2629
|
}
|
|
2653
2630
|
),
|
|
2654
|
-
|
|
2655
|
-
|
|
2631
|
+
/* @__PURE__ */ e(
|
|
2632
|
+
kl,
|
|
2656
2633
|
{
|
|
2657
|
-
|
|
2634
|
+
sql: W == null ? void 0 : W.sql,
|
|
2635
|
+
error: (ue == null ? void 0 : ue.message) || ((De = W == null ? void 0 : W.error) == null ? void 0 : De.message),
|
|
2658
2636
|
setShowAIDialog: d,
|
|
2659
2637
|
setTriggerAIRun: x,
|
|
2660
2638
|
setUserInputforAI: f
|
|
2661
2639
|
}
|
|
2662
2640
|
),
|
|
2663
2641
|
/* @__PURE__ */ n(
|
|
2664
|
-
|
|
2642
|
+
I,
|
|
2665
2643
|
{
|
|
2666
|
-
onClick:
|
|
2644
|
+
onClick: O,
|
|
2667
2645
|
className: "",
|
|
2668
2646
|
size: "sm",
|
|
2669
2647
|
variant: "outline",
|
|
2670
2648
|
children: [
|
|
2671
|
-
/* @__PURE__ */ e(
|
|
2649
|
+
/* @__PURE__ */ e(Gs, { className: "mr-2 size-4" }),
|
|
2672
2650
|
"Clear"
|
|
2673
2651
|
]
|
|
2674
2652
|
}
|
|
@@ -2681,43 +2659,42 @@ function _l() {
|
|
|
2681
2659
|
className: "",
|
|
2682
2660
|
size: "sm",
|
|
2683
2661
|
variant: "outline",
|
|
2684
|
-
children: /* @__PURE__ */ e(
|
|
2662
|
+
children: /* @__PURE__ */ e(Al, { className: "size-4 text-foreground/70" })
|
|
2685
2663
|
}
|
|
2686
2664
|
),
|
|
2687
2665
|
/* @__PURE__ */ e(
|
|
2688
|
-
|
|
2666
|
+
Tl,
|
|
2689
2667
|
{
|
|
2690
2668
|
open: c,
|
|
2691
2669
|
setOpen: d,
|
|
2692
2670
|
userInput: h,
|
|
2693
|
-
triggerAIRun:
|
|
2671
|
+
triggerAIRun: v,
|
|
2694
2672
|
setTriggerAIRun: x
|
|
2695
2673
|
}
|
|
2696
2674
|
)
|
|
2697
2675
|
] }),
|
|
2698
2676
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
2699
|
-
(J == null ? void 0 : J.sql) && /* @__PURE__ */ e(Al, { sql: J.sql }),
|
|
2700
2677
|
/* @__PURE__ */ n(
|
|
2701
|
-
|
|
2678
|
+
I,
|
|
2702
2679
|
{
|
|
2703
|
-
onClick:
|
|
2680
|
+
onClick: se,
|
|
2704
2681
|
className: "w-full",
|
|
2705
2682
|
size: "sm",
|
|
2706
2683
|
variant: "outline",
|
|
2707
2684
|
children: [
|
|
2708
|
-
/* @__PURE__ */ e(
|
|
2685
|
+
/* @__PURE__ */ e(ut, { className: "mr-2 size-4" }),
|
|
2709
2686
|
"Close"
|
|
2710
2687
|
]
|
|
2711
2688
|
}
|
|
2712
2689
|
),
|
|
2713
2690
|
/* @__PURE__ */ n(
|
|
2714
|
-
|
|
2691
|
+
I,
|
|
2715
2692
|
{
|
|
2716
2693
|
onClick: P,
|
|
2717
2694
|
size: "sm",
|
|
2718
2695
|
variant: "outline",
|
|
2719
2696
|
children: [
|
|
2720
|
-
/* @__PURE__ */ e(
|
|
2697
|
+
/* @__PURE__ */ e(En, { className: "mr-2 size-4 font-bold text-green-600" }),
|
|
2721
2698
|
"Accept"
|
|
2722
2699
|
]
|
|
2723
2700
|
}
|
|
@@ -2733,7 +2710,7 @@ function _l() {
|
|
|
2733
2710
|
}
|
|
2734
2711
|
function Hl({ data: t }) {
|
|
2735
2712
|
var o;
|
|
2736
|
-
const [s, a] =
|
|
2713
|
+
const [s, a] = Oe.useState([]), r = Object.keys(t[0]).map((c) => ({
|
|
2737
2714
|
// header: key,
|
|
2738
2715
|
accessorKey: c,
|
|
2739
2716
|
header: ({ column: d }) => {
|
|
@@ -2745,61 +2722,61 @@ function Hl({ data: t }) {
|
|
|
2745
2722
|
onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
|
|
2746
2723
|
children: [
|
|
2747
2724
|
c,
|
|
2748
|
-
h === "asc" ? /* @__PURE__ */ e(
|
|
2725
|
+
h === "asc" ? /* @__PURE__ */ e(An, { className: "ml-2 h-5 w-5" }) : h === "desc" ? /* @__PURE__ */ e(qn, { className: "ml-2 h-5 w-5" }) : null
|
|
2749
2726
|
]
|
|
2750
2727
|
}
|
|
2751
2728
|
) });
|
|
2752
2729
|
}
|
|
2753
|
-
})), i =
|
|
2730
|
+
})), i = Rn({
|
|
2754
2731
|
data: t,
|
|
2755
2732
|
columns: r,
|
|
2756
|
-
getCoreRowModel:
|
|
2757
|
-
getPaginationRowModel:
|
|
2733
|
+
getCoreRowModel: Un(),
|
|
2734
|
+
getPaginationRowModel: $n(),
|
|
2758
2735
|
onSortingChange: a,
|
|
2759
|
-
getSortedRowModel:
|
|
2736
|
+
getSortedRowModel: Pn(),
|
|
2760
2737
|
manualPagination: !0,
|
|
2761
2738
|
state: {
|
|
2762
2739
|
sorting: s
|
|
2763
2740
|
}
|
|
2764
2741
|
});
|
|
2765
2742
|
return /* @__PURE__ */ e("div", { className: "font-mono text-xs text-foreground/95", children: /* @__PURE__ */ n("table", { className: "w-full", children: [
|
|
2766
|
-
/* @__PURE__ */ e(
|
|
2767
|
-
|
|
2743
|
+
/* @__PURE__ */ e(jn, { children: i.getHeaderGroups().map((c) => /* @__PURE__ */ e(Ct, { children: c.headers.map((d) => /* @__PURE__ */ e(
|
|
2744
|
+
_n,
|
|
2768
2745
|
{
|
|
2769
2746
|
className: "sticky top-0 h-11 bg-muted font-semibold",
|
|
2770
|
-
children: d.isPlaceholder ? null :
|
|
2747
|
+
children: d.isPlaceholder ? null : ea(
|
|
2771
2748
|
d.column.columnDef.header,
|
|
2772
2749
|
d.getContext()
|
|
2773
2750
|
)
|
|
2774
2751
|
},
|
|
2775
2752
|
d.id
|
|
2776
2753
|
)) }, c.id)) }),
|
|
2777
|
-
/* @__PURE__ */ e(
|
|
2754
|
+
/* @__PURE__ */ e(Hn, { children: (o = i.getRowModel().rows) != null && o.length ? i.getRowModel().rows.map((c) => /* @__PURE__ */ e(
|
|
2778
2755
|
Ct,
|
|
2779
2756
|
{
|
|
2780
2757
|
className: "whitespace-nowrap py-2",
|
|
2781
2758
|
"data-state": c.getIsSelected() && "selected",
|
|
2782
|
-
children: c.getVisibleCells().map((d) => /* @__PURE__ */ e(
|
|
2759
|
+
children: c.getVisibleCells().map((d) => /* @__PURE__ */ e(ta, { className: "py-3", children: ea(d.column.columnDef.cell, d.getContext()) }, d.id))
|
|
2783
2760
|
},
|
|
2784
2761
|
c.id
|
|
2785
|
-
)) : /* @__PURE__ */ e(Ct, { children: /* @__PURE__ */ e(
|
|
2762
|
+
)) : /* @__PURE__ */ e(Ct, { children: /* @__PURE__ */ e(ta, { colSpan: r.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2786
2763
|
] }) });
|
|
2787
2764
|
}
|
|
2788
2765
|
function Pl({ card: t }) {
|
|
2789
|
-
var V, w,
|
|
2766
|
+
var V, w, z, F, E, U, R, B, m, y, M;
|
|
2790
2767
|
const [s, a] = j(!1), [l, r] = j(
|
|
2791
2768
|
[]
|
|
2792
|
-
), { authToken: i } =
|
|
2769
|
+
), { authToken: i } = Me(), o = Bn(i == null ? void 0 : i.accessToken), c = T((C) => C.themeStyle), d = {
|
|
2793
2770
|
colors: ((w = (V = c == null ? void 0 : c.chart) == null ? void 0 : V.dataset) == null ? void 0 : w.backgroundColor) || []
|
|
2794
2771
|
};
|
|
2795
|
-
(
|
|
2796
|
-
const { getCard: h } = ka(((F = t.customCardPreferences) == null ? void 0 : F.url) || ""), f = ((E = t.customCardPreferences) == null ? void 0 : E.visualType) || "single",
|
|
2772
|
+
(z = t.customCardPreferences) != null && z.inputData;
|
|
2773
|
+
const { getCard: h } = ka(((F = t.customCardPreferences) == null ? void 0 : F.url) || ""), f = ((E = t.customCardPreferences) == null ? void 0 : E.visualType) || "single", v = p((C) => C.frame), { setCustomCardPreferences: x } = de(), { data: u } = Ve(t), g = Va((C, A) => {
|
|
2797
2774
|
r(($) => ({
|
|
2798
2775
|
...$,
|
|
2799
2776
|
[C]: A
|
|
2800
2777
|
}));
|
|
2801
2778
|
}, []);
|
|
2802
|
-
if (!((
|
|
2779
|
+
if (!((U = t.customCardPreferences) != null && U.componentName))
|
|
2803
2780
|
return null;
|
|
2804
2781
|
const b = h(
|
|
2805
2782
|
(R = t.customCardPreferences) == null ? void 0 : R.componentName
|
|
@@ -2808,14 +2785,14 @@ function Pl({ card: t }) {
|
|
|
2808
2785
|
a(C);
|
|
2809
2786
|
}
|
|
2810
2787
|
const N = Object.keys(
|
|
2811
|
-
((
|
|
2788
|
+
((B = t.customCardPreferences) == null ? void 0 : B.dataInputCardIds) || {}
|
|
2812
2789
|
).map((C) => {
|
|
2813
|
-
var
|
|
2814
|
-
const A = (Q = (
|
|
2790
|
+
var J, Q, K;
|
|
2791
|
+
const A = (Q = (J = t.customCardPreferences) == null ? void 0 : J.dataInputCardIds) == null ? void 0 : Q[C].cardId, $ = (K = v == null ? void 0 : v.cards) == null ? void 0 : K.find((le) => le.id === A);
|
|
2815
2792
|
return $ || null;
|
|
2816
2793
|
});
|
|
2817
2794
|
return /* @__PURE__ */ e("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ n(
|
|
2818
|
-
|
|
2795
|
+
js,
|
|
2819
2796
|
{
|
|
2820
2797
|
fallback: /* @__PURE__ */ e(ae, {}),
|
|
2821
2798
|
children: [
|
|
@@ -2831,15 +2808,15 @@ function Pl({ card: t }) {
|
|
|
2831
2808
|
),
|
|
2832
2809
|
b && f === "multiple" && /* @__PURE__ */ n(ae, { children: [
|
|
2833
2810
|
Object.keys(
|
|
2834
|
-
((
|
|
2811
|
+
((y = t.customCardPreferences) == null ? void 0 : y.dataInputCardIds) || {}
|
|
2835
2812
|
).map((C) => {
|
|
2836
|
-
var
|
|
2837
|
-
const A = (Q = (
|
|
2838
|
-
(
|
|
2813
|
+
var J, Q, K;
|
|
2814
|
+
const A = (Q = (J = t.customCardPreferences) == null ? void 0 : J.dataInputCardIds) == null ? void 0 : Q[C].cardId, $ = (K = v == null ? void 0 : v.cards) == null ? void 0 : K.find(
|
|
2815
|
+
(le) => le.id === A
|
|
2839
2816
|
);
|
|
2840
2817
|
if ($)
|
|
2841
2818
|
return /* @__PURE__ */ e(
|
|
2842
|
-
|
|
2819
|
+
Gn,
|
|
2843
2820
|
{
|
|
2844
2821
|
onLoadingStatus: k,
|
|
2845
2822
|
onDataChange: g,
|
|
@@ -2866,7 +2843,7 @@ function Pl({ card: t }) {
|
|
|
2866
2843
|
] })
|
|
2867
2844
|
]
|
|
2868
2845
|
},
|
|
2869
|
-
(
|
|
2846
|
+
(M = t.customCardPreferences) == null ? void 0 : M.componentName
|
|
2870
2847
|
) });
|
|
2871
2848
|
}
|
|
2872
2849
|
function Ga({
|
|
@@ -2876,12 +2853,12 @@ function Ga({
|
|
|
2876
2853
|
...s
|
|
2877
2854
|
}) {
|
|
2878
2855
|
var k;
|
|
2879
|
-
const a = p((N) => N.card), l = ((k = a.customCardPreferences) == null ? void 0 : k.showCardHeader) ?? !0, r = p((N) => N.frame), i =
|
|
2856
|
+
const a = p((N) => N.card), l = ((k = a.customCardPreferences) == null ? void 0 : k.showCardHeader) ?? !0, r = p((N) => N.frame), i = T((N) => N.dashboard.filters);
|
|
2880
2857
|
p((N) => N.actions.setRunSql);
|
|
2881
|
-
const { updateFilter: o } =
|
|
2858
|
+
const { updateFilter: o } = Ze(), c = i == null ? void 0 : i.find((N) => N.id === r.filterId), { data: d, isLoading: h, isFetching: f } = Ve(a), { setCard: v } = de(), { data: x } = qt(a);
|
|
2882
2859
|
if (!a.id) return null;
|
|
2883
2860
|
let u;
|
|
2884
|
-
d != null && d.records && (d == null ? void 0 : d.records.length) > 0 && (u =
|
|
2861
|
+
d != null && d.records && (d == null ? void 0 : d.records.length) > 0 && (u = za({
|
|
2885
2862
|
data: d == null ? void 0 : d.records,
|
|
2886
2863
|
cardType: a.type,
|
|
2887
2864
|
cfg: a.cfg,
|
|
@@ -2896,40 +2873,40 @@ function Ga({
|
|
|
2896
2873
|
var N;
|
|
2897
2874
|
if (d != null && d.records && (d == null ? void 0 : d.records.length) === 0 && !h && !f)
|
|
2898
2875
|
return /* @__PURE__ */ n("div", { className: "flex h-full flex-col items-center justify-center gap-2", children: [
|
|
2899
|
-
/* @__PURE__ */ e(
|
|
2876
|
+
/* @__PURE__ */ e(Xn, { className: "size-8 text-muted-foreground" }),
|
|
2900
2877
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "No records to display" })
|
|
2901
2878
|
] });
|
|
2902
2879
|
if (a.type === "custom")
|
|
2903
2880
|
return g(a);
|
|
2904
2881
|
if (!["table", "custom"].includes(a.type) && u)
|
|
2905
2882
|
return /* @__PURE__ */ e(
|
|
2906
|
-
|
|
2883
|
+
Yn,
|
|
2907
2884
|
{
|
|
2908
2885
|
cfg: u
|
|
2909
2886
|
},
|
|
2910
2887
|
JSON.stringify(u) + JSON.stringify(a.preferences) + ((N = a == null ? void 0 : a.preferences) == null ? void 0 : N.customVisualCode)
|
|
2911
2888
|
);
|
|
2912
2889
|
if (a.type === "table" && (d != null && d.records) && (d == null ? void 0 : d.records.length) > 0)
|
|
2913
|
-
return /* @__PURE__ */ n(
|
|
2914
|
-
/* @__PURE__ */ e(
|
|
2890
|
+
return /* @__PURE__ */ n(Te, { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: [
|
|
2891
|
+
/* @__PURE__ */ e(es, { card: a, data: d == null ? void 0 : d.records }),
|
|
2915
2892
|
/* @__PURE__ */ e(He, { orientation: "horizontal" })
|
|
2916
2893
|
] });
|
|
2917
2894
|
}
|
|
2918
2895
|
return /* @__PURE__ */ n(
|
|
2919
|
-
|
|
2896
|
+
Jn,
|
|
2920
2897
|
{
|
|
2921
2898
|
role: "editor-visual-card",
|
|
2922
2899
|
className: ee("relative flex h-full flex-col rounded-none", t),
|
|
2923
2900
|
...s,
|
|
2924
2901
|
children: [
|
|
2925
|
-
l && /* @__PURE__ */ n(
|
|
2902
|
+
l && /* @__PURE__ */ n(Wn, { className: "flex flex-row items-start justify-between py-4", children: [
|
|
2926
2903
|
/* @__PURE__ */ n("div", { children: [
|
|
2927
2904
|
/* @__PURE__ */ e(
|
|
2928
2905
|
nt,
|
|
2929
2906
|
{
|
|
2930
2907
|
text: a.title,
|
|
2931
|
-
onSave: (N) =>
|
|
2932
|
-
children: /* @__PURE__ */ e("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e(
|
|
2908
|
+
onSave: (N) => v({ ...a, title: N }),
|
|
2909
|
+
children: /* @__PURE__ */ e("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e(Kn, { className: "text-base", children: a.title || "Edit title..." }) })
|
|
2933
2910
|
},
|
|
2934
2911
|
a.title
|
|
2935
2912
|
),
|
|
@@ -2937,8 +2914,8 @@ function Ga({
|
|
|
2937
2914
|
nt,
|
|
2938
2915
|
{
|
|
2939
2916
|
text: a.description || "",
|
|
2940
|
-
onSave: (N) =>
|
|
2941
|
-
children: /* @__PURE__ */ e(
|
|
2917
|
+
onSave: (N) => v({ ...a, description: N }),
|
|
2918
|
+
children: /* @__PURE__ */ e(Qn, { children: a.description || "Edit description..." })
|
|
2942
2919
|
},
|
|
2943
2920
|
a.description
|
|
2944
2921
|
)
|
|
@@ -2953,15 +2930,15 @@ function Ga({
|
|
|
2953
2930
|
children: /* @__PURE__ */ e(G, { children: c.title })
|
|
2954
2931
|
}
|
|
2955
2932
|
),
|
|
2956
|
-
/* @__PURE__ */ e(
|
|
2933
|
+
/* @__PURE__ */ e(Oa, { filter: c })
|
|
2957
2934
|
] })
|
|
2958
2935
|
] }),
|
|
2959
|
-
/* @__PURE__ */ e(
|
|
2936
|
+
/* @__PURE__ */ e(Zn, { className: "flex grow flex-col", children: b() })
|
|
2960
2937
|
]
|
|
2961
2938
|
}
|
|
2962
2939
|
);
|
|
2963
2940
|
}
|
|
2964
|
-
const
|
|
2941
|
+
const ia = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
|
|
2965
2942
|
ht,
|
|
2966
2943
|
{
|
|
2967
2944
|
className: "h-full w-full overflow-hidden text-xs",
|
|
@@ -2981,7 +2958,7 @@ const da = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
|
|
|
2981
2958
|
value: s,
|
|
2982
2959
|
onChange: a
|
|
2983
2960
|
}
|
|
2984
|
-
), $l = () => /* @__PURE__ */ n(
|
|
2961
|
+
), $l = () => /* @__PURE__ */ n(It, { children: [
|
|
2985
2962
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(Lt, { children: "Customize Card" }) }),
|
|
2986
2963
|
/* @__PURE__ */ n(Ft, { children: [
|
|
2987
2964
|
"See the configuration options and documentation",
|
|
@@ -2995,13 +2972,13 @@ const da = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
|
|
|
2995
2972
|
}
|
|
2996
2973
|
)
|
|
2997
2974
|
] })
|
|
2998
|
-
] }),
|
|
2975
|
+
] }), Ul = ({
|
|
2999
2976
|
defaultConfig: t,
|
|
3000
2977
|
customCode: s,
|
|
3001
2978
|
customConfig: a,
|
|
3002
2979
|
onConfigChange: l,
|
|
3003
2980
|
onCodeChange: r
|
|
3004
|
-
}) => /* @__PURE__ */ n(
|
|
2981
|
+
}) => /* @__PURE__ */ n(Ma, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
3005
2982
|
/* @__PURE__ */ n(Da, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
3006
2983
|
/* @__PURE__ */ e(st, { value: "custom-config", children: a ? "Custom Config" : "Default Config" }),
|
|
3007
2984
|
/* @__PURE__ */ e(st, { value: "output", children: "Output" }),
|
|
@@ -3013,7 +2990,7 @@ const da = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
|
|
|
3013
2990
|
value: "output",
|
|
3014
2991
|
className: "mt-0 grow rounded-b border border-t-0 p-2",
|
|
3015
2992
|
children: /* @__PURE__ */ e(
|
|
3016
|
-
|
|
2993
|
+
ns,
|
|
3017
2994
|
{
|
|
3018
2995
|
readOnly: !0,
|
|
3019
2996
|
value: t,
|
|
@@ -3028,7 +3005,7 @@ const da = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
|
|
|
3028
3005
|
value: "custom-config",
|
|
3029
3006
|
className: "mt-0 grow rounded-b border border-t-0",
|
|
3030
3007
|
children: /* @__PURE__ */ e(
|
|
3031
|
-
|
|
3008
|
+
ia,
|
|
3032
3009
|
{
|
|
3033
3010
|
language: "json",
|
|
3034
3011
|
value: a,
|
|
@@ -3043,7 +3020,7 @@ const da = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
|
|
|
3043
3020
|
value: "custom-code",
|
|
3044
3021
|
className: "mt-0 grow rounded-b border border-t-0",
|
|
3045
3022
|
children: /* @__PURE__ */ e(
|
|
3046
|
-
|
|
3023
|
+
ia,
|
|
3047
3024
|
{
|
|
3048
3025
|
language: "javascript",
|
|
3049
3026
|
value: s,
|
|
@@ -3052,27 +3029,27 @@ const da = ({ language: t, value: s, onChange: a }) => /* @__PURE__ */ e(
|
|
|
3052
3029
|
)
|
|
3053
3030
|
}
|
|
3054
3031
|
)
|
|
3055
|
-
] }),
|
|
3032
|
+
] }), Bl = ({
|
|
3056
3033
|
error: t,
|
|
3057
3034
|
hasCustomConfig: s,
|
|
3058
3035
|
onReset: a,
|
|
3059
3036
|
onApply: l,
|
|
3060
3037
|
onClose: r
|
|
3061
|
-
}) => /* @__PURE__ */ n(
|
|
3038
|
+
}) => /* @__PURE__ */ n(da, { className: "flex items-center", children: [
|
|
3062
3039
|
/* @__PURE__ */ e(G, { className: "mr-2 text-red-500", children: t }),
|
|
3063
|
-
/* @__PURE__ */ e(
|
|
3064
|
-
/* @__PURE__ */ e(
|
|
3065
|
-
/* @__PURE__ */ e(
|
|
3040
|
+
/* @__PURE__ */ e(I, { disabled: !s, onClick: a, variant: "outline", children: "Reset" }),
|
|
3041
|
+
/* @__PURE__ */ e(I, { onClick: l, variant: "outline", children: "Apply" }),
|
|
3042
|
+
/* @__PURE__ */ e(I, { onClick: r, variant: "outline", children: "Close" })
|
|
3066
3043
|
] });
|
|
3067
3044
|
function Gl() {
|
|
3068
|
-
const [t, s] = j(!1), [a, l] = j(""), [r, i] = j(""), [o, c] = j(""), [d, h] = j(""), f = p((w) => w.card),
|
|
3069
|
-
var
|
|
3045
|
+
const [t, s] = j(!1), [a, l] = j(""), [r, i] = j(""), [o, c] = j(""), [d, h] = j(""), f = p((w) => w.card), v = p((w) => w.card.customCfg), { data: x } = Ve(f), { data: u } = qt(f), { setCardCustomCfg: g, setCustomVisualCode: b } = de(), k = (w) => {
|
|
3046
|
+
var z, F;
|
|
3070
3047
|
return JSON.stringify(
|
|
3071
3048
|
{
|
|
3072
3049
|
...w,
|
|
3073
3050
|
data: {
|
|
3074
3051
|
...w.data,
|
|
3075
|
-
datasets: (F = (
|
|
3052
|
+
datasets: (F = (z = w.data) == null ? void 0 : z.datasets) == null ? void 0 : F.map((E) => ({
|
|
3076
3053
|
...E,
|
|
3077
3054
|
data: []
|
|
3078
3055
|
}))
|
|
@@ -3082,14 +3059,14 @@ function Gl() {
|
|
|
3082
3059
|
2
|
|
3083
3060
|
);
|
|
3084
3061
|
};
|
|
3085
|
-
return /* @__PURE__ */ n(
|
|
3086
|
-
/* @__PURE__ */ e(
|
|
3087
|
-
|
|
3062
|
+
return /* @__PURE__ */ n(Tt, { open: t, onOpenChange: s, children: [
|
|
3063
|
+
/* @__PURE__ */ e(Mt, { asChild: !0, children: /* @__PURE__ */ e(
|
|
3064
|
+
I,
|
|
3088
3065
|
{
|
|
3089
3066
|
onClick: () => {
|
|
3090
|
-
var
|
|
3091
|
-
if (!((
|
|
3092
|
-
const w =
|
|
3067
|
+
var z, F;
|
|
3068
|
+
if (!((z = x == null ? void 0 : x.records) != null && z.length)) return;
|
|
3069
|
+
const w = za({
|
|
3093
3070
|
data: x.records,
|
|
3094
3071
|
cardType: f.type,
|
|
3095
3072
|
cfg: f.cfg,
|
|
@@ -3098,22 +3075,22 @@ function Gl() {
|
|
|
3098
3075
|
});
|
|
3099
3076
|
if (w) {
|
|
3100
3077
|
l(k(w)), c(((F = f.preferences) == null ? void 0 : F.customVisualCode) || "");
|
|
3101
|
-
const E =
|
|
3078
|
+
const E = as(w, v);
|
|
3102
3079
|
i(k(E));
|
|
3103
3080
|
}
|
|
3104
3081
|
},
|
|
3105
3082
|
size: "sm",
|
|
3106
3083
|
variant: "outline",
|
|
3107
|
-
className:
|
|
3108
|
-
children: /* @__PURE__ */ e(
|
|
3084
|
+
className: v ? "border-foreground/50 dark:border-foreground/70" : "",
|
|
3085
|
+
children: /* @__PURE__ */ e(ts, { className: "h-4 w-4" })
|
|
3109
3086
|
}
|
|
3110
3087
|
) }),
|
|
3111
3088
|
/* @__PURE__ */ n(Dt, { className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]", children: [
|
|
3112
3089
|
/* @__PURE__ */ e($l, {}),
|
|
3113
3090
|
/* @__PURE__ */ n("div", { className: "flex grow gap-2", children: [
|
|
3114
|
-
/* @__PURE__ */ e(mt, { FallbackComponent:
|
|
3091
|
+
/* @__PURE__ */ e(mt, { FallbackComponent: Ta, children: /* @__PURE__ */ e(Ga, { className: "w-1/2 rounded shadow-none" }) }),
|
|
3115
3092
|
/* @__PURE__ */ e(
|
|
3116
|
-
|
|
3093
|
+
Ul,
|
|
3117
3094
|
{
|
|
3118
3095
|
defaultConfig: a,
|
|
3119
3096
|
customCode: o,
|
|
@@ -3124,10 +3101,10 @@ function Gl() {
|
|
|
3124
3101
|
)
|
|
3125
3102
|
] }),
|
|
3126
3103
|
/* @__PURE__ */ e(
|
|
3127
|
-
|
|
3104
|
+
Bl,
|
|
3128
3105
|
{
|
|
3129
3106
|
error: d,
|
|
3130
|
-
hasCustomConfig: !!
|
|
3107
|
+
hasCustomConfig: !!v,
|
|
3131
3108
|
onReset: () => {
|
|
3132
3109
|
i(a), g(null);
|
|
3133
3110
|
},
|
|
@@ -3136,11 +3113,11 @@ function Gl() {
|
|
|
3136
3113
|
if (o && b(o), r) {
|
|
3137
3114
|
const w = JSON.parse(
|
|
3138
3115
|
r
|
|
3139
|
-
),
|
|
3116
|
+
), z = ss(
|
|
3140
3117
|
JSON.parse(a),
|
|
3141
3118
|
w
|
|
3142
3119
|
);
|
|
3143
|
-
g(
|
|
3120
|
+
g(z), h("");
|
|
3144
3121
|
}
|
|
3145
3122
|
} catch {
|
|
3146
3123
|
h("Invalid JSON configuration");
|
|
@@ -3184,9 +3161,9 @@ function tn(t) {
|
|
|
3184
3161
|
return s;
|
|
3185
3162
|
}
|
|
3186
3163
|
function an() {
|
|
3187
|
-
const { authToken: t } =
|
|
3164
|
+
const { authToken: t } = Me(), { data: s, isLoading: a, isFetching: l, isError: r } = Le({
|
|
3188
3165
|
queryKey: ["plugins", t == null ? void 0 : t.accessToken],
|
|
3189
|
-
queryFn: () =>
|
|
3166
|
+
queryFn: () => ls(t == null ? void 0 : t.accessToken)
|
|
3190
3167
|
// staleTime: Infinity,
|
|
3191
3168
|
});
|
|
3192
3169
|
return { data: s, isLoading: a, isFetching: l, isError: r };
|
|
@@ -3200,9 +3177,9 @@ function Wl({
|
|
|
3200
3177
|
var i;
|
|
3201
3178
|
if (l) {
|
|
3202
3179
|
const c = (await Promise.all(
|
|
3203
|
-
(i = l == null ? void 0 : l.plugins) == null ? void 0 : i.map(async (d) => (await
|
|
3204
|
-
name:
|
|
3205
|
-
icon:
|
|
3180
|
+
(i = l == null ? void 0 : l.plugins) == null ? void 0 : i.map(async (d) => (await rs(d.value)).visuals.map((v) => ({
|
|
3181
|
+
name: v.name,
|
|
3182
|
+
icon: v.icon,
|
|
3206
3183
|
url: d.value
|
|
3207
3184
|
})))
|
|
3208
3185
|
)).flat();
|
|
@@ -3228,10 +3205,10 @@ const Kl = ({
|
|
|
3228
3205
|
onClick: a
|
|
3229
3206
|
}) => {
|
|
3230
3207
|
const l = tn(), r = t.charAt(0).toUpperCase();
|
|
3231
|
-
return /* @__PURE__ */ e(
|
|
3208
|
+
return /* @__PURE__ */ e(I, { onClick: a, title: t, variant: "ghost", children: l ? /* @__PURE__ */ e(l, { className: "h-4 w-4" }) : r });
|
|
3232
3209
|
};
|
|
3233
3210
|
function Ql() {
|
|
3234
|
-
var f,
|
|
3211
|
+
var f, v;
|
|
3235
3212
|
const [t, s] = j(!1), a = p((x) => x.card), l = a.type, { setCardType: r, setCardPreferences: i, setChartOrientation: o } = p((x) => x.actions), { setCardCustomCfg: c, setCustomCardPreferences: d } = de();
|
|
3236
3213
|
function h(x, u) {
|
|
3237
3214
|
c(null), i({}), r(x), u && d({
|
|
@@ -3243,36 +3220,36 @@ function Ql() {
|
|
|
3243
3220
|
}), s(!1);
|
|
3244
3221
|
}
|
|
3245
3222
|
return /* @__PURE__ */ n(pt, { open: t, onOpenChange: s, children: [
|
|
3246
|
-
/* @__PURE__ */ e(ft, { asChild: !0, children: /* @__PURE__ */ e(
|
|
3223
|
+
/* @__PURE__ */ e(ft, { asChild: !0, children: /* @__PURE__ */ e(I, { size: "sm", variant: "outline", children: /* @__PURE__ */ e(
|
|
3247
3224
|
Zl,
|
|
3248
3225
|
{
|
|
3249
3226
|
className: "h-4 w-4",
|
|
3250
3227
|
chartType: l,
|
|
3251
3228
|
customIcon: (f = a.customCardPreferences) == null ? void 0 : f.icon,
|
|
3252
|
-
componentName: (
|
|
3229
|
+
componentName: (v = a.customCardPreferences) == null ? void 0 : v.componentName
|
|
3253
3230
|
}
|
|
3254
3231
|
) }) }),
|
|
3255
3232
|
/* @__PURE__ */ n(gt, { className: "w-50", children: [
|
|
3256
3233
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-4 place-items-center", children: [
|
|
3257
3234
|
/* @__PURE__ */ e(
|
|
3258
|
-
|
|
3235
|
+
I,
|
|
3259
3236
|
{
|
|
3260
3237
|
onClick: () => h("bar"),
|
|
3261
3238
|
className: "font-normal",
|
|
3262
3239
|
variant: "ghost",
|
|
3263
|
-
children: /* @__PURE__ */ e(
|
|
3240
|
+
children: /* @__PURE__ */ e(_t, { className: "size-5" })
|
|
3264
3241
|
}
|
|
3265
3242
|
),
|
|
3266
3243
|
/* @__PURE__ */ e(
|
|
3267
|
-
|
|
3244
|
+
I,
|
|
3268
3245
|
{
|
|
3269
3246
|
onClick: () => h("line"),
|
|
3270
3247
|
variant: "ghost",
|
|
3271
|
-
children: /* @__PURE__ */ e(
|
|
3248
|
+
children: /* @__PURE__ */ e(Ht, { className: "size-5" })
|
|
3272
3249
|
}
|
|
3273
3250
|
),
|
|
3274
3251
|
/* @__PURE__ */ e(
|
|
3275
|
-
|
|
3252
|
+
I,
|
|
3276
3253
|
{
|
|
3277
3254
|
onClick: () => h("stackedBar"),
|
|
3278
3255
|
variant: "ghost",
|
|
@@ -3280,7 +3257,7 @@ function Ql() {
|
|
|
3280
3257
|
}
|
|
3281
3258
|
),
|
|
3282
3259
|
/* @__PURE__ */ e(
|
|
3283
|
-
|
|
3260
|
+
I,
|
|
3284
3261
|
{
|
|
3285
3262
|
onClick: () => h("stackedLine"),
|
|
3286
3263
|
variant: "ghost",
|
|
@@ -3288,7 +3265,7 @@ function Ql() {
|
|
|
3288
3265
|
}
|
|
3289
3266
|
),
|
|
3290
3267
|
/* @__PURE__ */ e(
|
|
3291
|
-
|
|
3268
|
+
I,
|
|
3292
3269
|
{
|
|
3293
3270
|
onClick: () => h("scatter"),
|
|
3294
3271
|
variant: "ghost",
|
|
@@ -3296,7 +3273,7 @@ function Ql() {
|
|
|
3296
3273
|
}
|
|
3297
3274
|
),
|
|
3298
3275
|
/* @__PURE__ */ e(
|
|
3299
|
-
|
|
3276
|
+
I,
|
|
3300
3277
|
{
|
|
3301
3278
|
onClick: () => h("bubble"),
|
|
3302
3279
|
variant: "ghost",
|
|
@@ -3304,7 +3281,7 @@ function Ql() {
|
|
|
3304
3281
|
}
|
|
3305
3282
|
),
|
|
3306
3283
|
/* @__PURE__ */ e(
|
|
3307
|
-
|
|
3284
|
+
I,
|
|
3308
3285
|
{
|
|
3309
3286
|
onClick: () => h("pie"),
|
|
3310
3287
|
variant: "ghost",
|
|
@@ -3312,7 +3289,7 @@ function Ql() {
|
|
|
3312
3289
|
}
|
|
3313
3290
|
),
|
|
3314
3291
|
/* @__PURE__ */ e(
|
|
3315
|
-
|
|
3292
|
+
I,
|
|
3316
3293
|
{
|
|
3317
3294
|
onClick: () => h("doughnut"),
|
|
3318
3295
|
variant: "ghost",
|
|
@@ -3320,7 +3297,7 @@ function Ql() {
|
|
|
3320
3297
|
}
|
|
3321
3298
|
),
|
|
3322
3299
|
/* @__PURE__ */ e(
|
|
3323
|
-
|
|
3300
|
+
I,
|
|
3324
3301
|
{
|
|
3325
3302
|
onClick: () => h("radar"),
|
|
3326
3303
|
variant: "ghost",
|
|
@@ -3334,7 +3311,7 @@ function Ql() {
|
|
|
3334
3311
|
}
|
|
3335
3312
|
),
|
|
3336
3313
|
/* @__PURE__ */ e(
|
|
3337
|
-
|
|
3314
|
+
I,
|
|
3338
3315
|
{
|
|
3339
3316
|
onClick: () => h("polarArea"),
|
|
3340
3317
|
variant: "ghost",
|
|
@@ -3342,7 +3319,7 @@ function Ql() {
|
|
|
3342
3319
|
}
|
|
3343
3320
|
),
|
|
3344
3321
|
/* @__PURE__ */ e(
|
|
3345
|
-
|
|
3322
|
+
I,
|
|
3346
3323
|
{
|
|
3347
3324
|
onClick: () => h("pyramid"),
|
|
3348
3325
|
variant: "ghost",
|
|
@@ -3350,7 +3327,7 @@ function Ql() {
|
|
|
3350
3327
|
}
|
|
3351
3328
|
),
|
|
3352
3329
|
/* @__PURE__ */ e(
|
|
3353
|
-
|
|
3330
|
+
I,
|
|
3354
3331
|
{
|
|
3355
3332
|
onClick: () => h("range"),
|
|
3356
3333
|
variant: "ghost",
|
|
@@ -3358,15 +3335,15 @@ function Ql() {
|
|
|
3358
3335
|
}
|
|
3359
3336
|
),
|
|
3360
3337
|
/* @__PURE__ */ e(
|
|
3361
|
-
|
|
3338
|
+
I,
|
|
3362
3339
|
{
|
|
3363
3340
|
onClick: () => h("table"),
|
|
3364
3341
|
variant: "ghost",
|
|
3365
|
-
children: /* @__PURE__ */ e(
|
|
3342
|
+
children: /* @__PURE__ */ e($t, { className: "size-5" })
|
|
3366
3343
|
}
|
|
3367
3344
|
),
|
|
3368
3345
|
/* @__PURE__ */ e(
|
|
3369
|
-
|
|
3346
|
+
I,
|
|
3370
3347
|
{
|
|
3371
3348
|
onClick: () => h("kpi"),
|
|
3372
3349
|
variant: "ghost",
|
|
@@ -3374,15 +3351,15 @@ function Ql() {
|
|
|
3374
3351
|
}
|
|
3375
3352
|
),
|
|
3376
3353
|
/* @__PURE__ */ e(
|
|
3377
|
-
|
|
3354
|
+
I,
|
|
3378
3355
|
{
|
|
3379
3356
|
onClick: () => h("text"),
|
|
3380
3357
|
variant: "ghost",
|
|
3381
|
-
children: /* @__PURE__ */ e(
|
|
3358
|
+
children: /* @__PURE__ */ e(Ut, { className: "size-4" })
|
|
3382
3359
|
}
|
|
3383
3360
|
),
|
|
3384
3361
|
/* @__PURE__ */ e(
|
|
3385
|
-
|
|
3362
|
+
I,
|
|
3386
3363
|
{
|
|
3387
3364
|
onClick: () => h("map"),
|
|
3388
3365
|
variant: "ghost",
|
|
@@ -3390,7 +3367,7 @@ function Ql() {
|
|
|
3390
3367
|
}
|
|
3391
3368
|
),
|
|
3392
3369
|
/* @__PURE__ */ e(
|
|
3393
|
-
|
|
3370
|
+
I,
|
|
3394
3371
|
{
|
|
3395
3372
|
onClick: () => h("custom"),
|
|
3396
3373
|
variant: "ghost",
|
|
@@ -3411,9 +3388,9 @@ function Zl({
|
|
|
3411
3388
|
const r = tn();
|
|
3412
3389
|
switch (t) {
|
|
3413
3390
|
case "bar":
|
|
3414
|
-
return /* @__PURE__ */ e(
|
|
3391
|
+
return /* @__PURE__ */ e(_t, { className: s });
|
|
3415
3392
|
case "line":
|
|
3416
|
-
return /* @__PURE__ */ e(
|
|
3393
|
+
return /* @__PURE__ */ e(Ht, { className: s });
|
|
3417
3394
|
case "pie":
|
|
3418
3395
|
return /* @__PURE__ */ e(Aa, { className: s });
|
|
3419
3396
|
case "radar":
|
|
@@ -3437,13 +3414,13 @@ function Zl({
|
|
|
3437
3414
|
case "kpi":
|
|
3438
3415
|
return /* @__PURE__ */ e(Ya, { className: s });
|
|
3439
3416
|
case "text":
|
|
3440
|
-
return /* @__PURE__ */ e(
|
|
3417
|
+
return /* @__PURE__ */ e(Ut, { className: s });
|
|
3441
3418
|
case "map":
|
|
3442
3419
|
return /* @__PURE__ */ e(Ra, { className: s });
|
|
3443
3420
|
case "custom":
|
|
3444
3421
|
return a && r ? /* @__PURE__ */ e(r, { className: s }) : l ? l == null ? void 0 : l.charAt(0).toUpperCase() : /* @__PURE__ */ e(ja, { className: s });
|
|
3445
3422
|
default:
|
|
3446
|
-
return /* @__PURE__ */ e(
|
|
3423
|
+
return /* @__PURE__ */ e($t, { className: s });
|
|
3447
3424
|
}
|
|
3448
3425
|
}
|
|
3449
3426
|
function Xl() {
|
|
@@ -3452,32 +3429,32 @@ function Xl() {
|
|
|
3452
3429
|
(a = t.customCardPreferences) == null || a.showCardHeader;
|
|
3453
3430
|
const { setCustomCardPreferences: s } = de();
|
|
3454
3431
|
return /* @__PURE__ */ n(Vt, { children: [
|
|
3455
|
-
/* @__PURE__ */ e(Et, { asChild: !0, children: /* @__PURE__ */ e(
|
|
3432
|
+
/* @__PURE__ */ e(Et, { asChild: !0, children: /* @__PURE__ */ e(Pt, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
|
|
3456
3433
|
/* @__PURE__ */ e(At, { align: "start", className: "w-40 text-muted-foreground", children: /* @__PURE__ */ n(
|
|
3457
|
-
|
|
3434
|
+
is,
|
|
3458
3435
|
{
|
|
3459
3436
|
onClick: () => {
|
|
3460
|
-
navigator.clipboard.writeText(t.id),
|
|
3437
|
+
navigator.clipboard.writeText(t.id), Ke.success("Card ID copied to clipboard");
|
|
3461
3438
|
},
|
|
3462
3439
|
className: "cursor-pointer space-x-2",
|
|
3463
3440
|
children: [
|
|
3464
|
-
/* @__PURE__ */ e(
|
|
3441
|
+
/* @__PURE__ */ e(os, { className: "size-5" }),
|
|
3465
3442
|
/* @__PURE__ */ e("span", { children: "Copy Card ID" })
|
|
3466
3443
|
]
|
|
3467
3444
|
}
|
|
3468
3445
|
) })
|
|
3469
3446
|
] });
|
|
3470
3447
|
}
|
|
3471
|
-
function
|
|
3448
|
+
function oa() {
|
|
3472
3449
|
var m;
|
|
3473
|
-
const t = p((
|
|
3474
|
-
p((
|
|
3475
|
-
const { setFrame: i, setCard: o, updateCardInFrame: c, setActiveTabCardId: d } = de(), { data: h, isLoading: f, isFetching:
|
|
3450
|
+
const t = p((y) => y.frame), s = p((y) => y.card), a = p((y) => y.isShowingVisual), l = p((y) => y.isSqlRunning), r = p((y) => y.pythonStdOut);
|
|
3451
|
+
p((y) => y.actions.setRunSql);
|
|
3452
|
+
const { setFrame: i, setCard: o, updateCardInFrame: c, setActiveTabCardId: d } = de(), { data: h, isLoading: f, isFetching: v, error: x } = Ve(s);
|
|
3476
3453
|
if (!s) return /* @__PURE__ */ e(ae, { children: "No Active Card" });
|
|
3477
3454
|
function u() {
|
|
3478
|
-
const
|
|
3455
|
+
const y = {
|
|
3479
3456
|
connectionId: s.connectionId,
|
|
3480
|
-
id:
|
|
3457
|
+
id: We(),
|
|
3481
3458
|
title: "Title",
|
|
3482
3459
|
description: "Description",
|
|
3483
3460
|
preferences: {
|
|
@@ -3492,76 +3469,76 @@ function ua() {
|
|
|
3492
3469
|
sql: "",
|
|
3493
3470
|
data: []
|
|
3494
3471
|
};
|
|
3495
|
-
g(
|
|
3472
|
+
g(y);
|
|
3496
3473
|
}
|
|
3497
|
-
function g(
|
|
3498
|
-
const
|
|
3474
|
+
function g(y) {
|
|
3475
|
+
const M = {
|
|
3499
3476
|
...t,
|
|
3500
|
-
cards: [...t.cards,
|
|
3501
|
-
activeCardId:
|
|
3477
|
+
cards: [...t.cards, y],
|
|
3478
|
+
activeCardId: y.id
|
|
3502
3479
|
};
|
|
3503
|
-
i(
|
|
3480
|
+
i(M), d(y.id);
|
|
3504
3481
|
}
|
|
3505
3482
|
function b() {
|
|
3506
|
-
const
|
|
3483
|
+
const y = {
|
|
3507
3484
|
...s,
|
|
3508
|
-
id:
|
|
3485
|
+
id: We(),
|
|
3509
3486
|
title: `${s.title} Copy`,
|
|
3510
3487
|
tabTitle: `${s.tabTitle || s.title} Copy`
|
|
3511
3488
|
};
|
|
3512
|
-
g(
|
|
3489
|
+
g(y);
|
|
3513
3490
|
}
|
|
3514
|
-
function k(
|
|
3515
|
-
const
|
|
3491
|
+
function k(y) {
|
|
3492
|
+
const M = t.cards.filter(($) => $.id !== y), C = M[0], A = {
|
|
3516
3493
|
...t,
|
|
3517
|
-
cards:
|
|
3494
|
+
cards: M,
|
|
3518
3495
|
// update the active card to the first card in the frame
|
|
3519
3496
|
activeCardId: C.id
|
|
3520
3497
|
};
|
|
3521
3498
|
i(A), d(C.id), o(C);
|
|
3522
3499
|
}
|
|
3523
|
-
function N(
|
|
3524
|
-
d(
|
|
3500
|
+
function N(y) {
|
|
3501
|
+
d(y);
|
|
3525
3502
|
}
|
|
3526
|
-
const V = (
|
|
3527
|
-
console.log("handleDragStart",
|
|
3528
|
-
}, w = (
|
|
3529
|
-
|
|
3530
|
-
},
|
|
3531
|
-
const C =
|
|
3532
|
-
if (C ===
|
|
3503
|
+
const V = (y, M) => {
|
|
3504
|
+
console.log("handleDragStart", M), y.dataTransfer.setData("tabIndex", M.toString());
|
|
3505
|
+
}, w = (y) => {
|
|
3506
|
+
y.preventDefault();
|
|
3507
|
+
}, z = (y, M) => {
|
|
3508
|
+
const C = y.dataTransfer.getData("tabIndex");
|
|
3509
|
+
if (C === M.toString()) return;
|
|
3533
3510
|
const A = Array.from(t.cards), [$] = A.splice(parseInt(C), 1);
|
|
3534
|
-
A.splice(
|
|
3511
|
+
A.splice(M, 0, $), i({ ...t, cards: A });
|
|
3535
3512
|
};
|
|
3536
|
-
function F(
|
|
3537
|
-
return
|
|
3513
|
+
function F(y, M) {
|
|
3514
|
+
return y.cards.length === 1 && (M.displayTab === !0 || M.displayTab === void 0) || y.activeCardId !== M.id && (M.displayTab === !0 || M.displayTab === void 0) ? null : /* @__PURE__ */ e(
|
|
3538
3515
|
"div",
|
|
3539
3516
|
{
|
|
3540
3517
|
onClick: () => {
|
|
3541
|
-
const C =
|
|
3542
|
-
o({ ...
|
|
3543
|
-
...
|
|
3518
|
+
const C = M.displayTab === void 0 ? !1 : !M.displayTab;
|
|
3519
|
+
o({ ...M, displayTab: C }), c({
|
|
3520
|
+
...M,
|
|
3544
3521
|
displayTab: C
|
|
3545
3522
|
});
|
|
3546
3523
|
},
|
|
3547
|
-
children:
|
|
3524
|
+
children: M.displayTab === !0 || M.displayTab === void 0 ? /* @__PURE__ */ e(ms, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e(Js, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
|
|
3548
3525
|
}
|
|
3549
3526
|
);
|
|
3550
3527
|
}
|
|
3551
3528
|
function E() {
|
|
3552
3529
|
return /* @__PURE__ */ n(
|
|
3553
|
-
|
|
3530
|
+
Ma,
|
|
3554
3531
|
{
|
|
3555
3532
|
onValueChange: N,
|
|
3556
3533
|
value: t.activeCardId,
|
|
3557
3534
|
className: "flex grow flex-col",
|
|
3558
3535
|
children: [
|
|
3559
|
-
t.cards.map((
|
|
3536
|
+
t.cards.map((y) => /* @__PURE__ */ e(lt, { className: "mt-0 grow", value: y.id, children: U() }, y.id)),
|
|
3560
3537
|
/* @__PURE__ */ e(Da, { className: "group mx-6 justify-between", children: /* @__PURE__ */ n("div", { className: "flex items-center", children: [
|
|
3561
|
-
t.cards.map((
|
|
3538
|
+
t.cards.map((y, M) => /* @__PURE__ */ e(
|
|
3562
3539
|
nt,
|
|
3563
3540
|
{
|
|
3564
|
-
text:
|
|
3541
|
+
text: y.tabTitle || y.title,
|
|
3565
3542
|
onSave: (C) => {
|
|
3566
3543
|
o({ ...s, tabTitle: C }), c({ ...s, tabTitle: C });
|
|
3567
3544
|
},
|
|
@@ -3569,43 +3546,43 @@ function ua() {
|
|
|
3569
3546
|
st,
|
|
3570
3547
|
{
|
|
3571
3548
|
draggable: !0,
|
|
3572
|
-
onDragStart: (C) => V(C,
|
|
3549
|
+
onDragStart: (C) => V(C, M),
|
|
3573
3550
|
onDragOver: w,
|
|
3574
|
-
onDrop: (C) =>
|
|
3551
|
+
onDrop: (C) => z(C, M),
|
|
3575
3552
|
className: "",
|
|
3576
|
-
value:
|
|
3553
|
+
value: y.id,
|
|
3577
3554
|
children: [
|
|
3578
|
-
F(t,
|
|
3579
|
-
|
|
3580
|
-
t.activeCardId ===
|
|
3581
|
-
|
|
3555
|
+
F(t, y),
|
|
3556
|
+
y.tabTitle || y.title,
|
|
3557
|
+
t.activeCardId === y.id && t.cards.length > 1 && /* @__PURE__ */ e(
|
|
3558
|
+
Ye,
|
|
3582
3559
|
{
|
|
3583
3560
|
className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
|
|
3584
|
-
onClick: () => k(
|
|
3561
|
+
onClick: () => k(y.id)
|
|
3585
3562
|
}
|
|
3586
3563
|
)
|
|
3587
3564
|
]
|
|
3588
3565
|
}
|
|
3589
3566
|
)
|
|
3590
3567
|
},
|
|
3591
|
-
|
|
3568
|
+
y.id
|
|
3592
3569
|
)),
|
|
3593
3570
|
/* @__PURE__ */ e(
|
|
3594
|
-
|
|
3571
|
+
I,
|
|
3595
3572
|
{
|
|
3596
3573
|
className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
|
|
3597
3574
|
variant: "outline",
|
|
3598
3575
|
onClick: u,
|
|
3599
|
-
children: /* @__PURE__ */ e(
|
|
3576
|
+
children: /* @__PURE__ */ e(Xe, { className: "h-4 w-4" })
|
|
3600
3577
|
}
|
|
3601
3578
|
),
|
|
3602
3579
|
/* @__PURE__ */ e(
|
|
3603
|
-
|
|
3580
|
+
I,
|
|
3604
3581
|
{
|
|
3605
3582
|
className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
|
|
3606
3583
|
variant: "outline",
|
|
3607
3584
|
onClick: b,
|
|
3608
|
-
children: /* @__PURE__ */ e(
|
|
3585
|
+
children: /* @__PURE__ */ e(Us, { className: "h-4 w-4" })
|
|
3609
3586
|
}
|
|
3610
3587
|
)
|
|
3611
3588
|
] }) })
|
|
@@ -3613,32 +3590,32 @@ function ua() {
|
|
|
3613
3590
|
}
|
|
3614
3591
|
);
|
|
3615
3592
|
}
|
|
3616
|
-
function
|
|
3617
|
-
return s.type === "kpi" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(
|
|
3618
|
-
|
|
3593
|
+
function U() {
|
|
3594
|
+
return s.type === "kpi" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(ds, { card: s, data: h == null ? void 0 : h.records }) }) }) : s.type === "text" ? /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e(Te, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e(
|
|
3595
|
+
us,
|
|
3619
3596
|
{
|
|
3620
3597
|
isLoading: l,
|
|
3621
3598
|
card: s,
|
|
3622
3599
|
data: h == null ? void 0 : h.records
|
|
3623
3600
|
}
|
|
3624
|
-
) }) }) }) : /* @__PURE__ */ e(mt, { FallbackComponent:
|
|
3601
|
+
) }) }) }) : /* @__PURE__ */ e(mt, { FallbackComponent: Ta, children: /* @__PURE__ */ e(Ga, { className: "grow border-none shadow-none" }) });
|
|
3625
3602
|
}
|
|
3626
3603
|
function R() {
|
|
3627
|
-
const
|
|
3604
|
+
const y = JSON.stringify(h == null ? void 0 : h.records, null, 2), M = new Blob([y], { type: "application/json" }), C = URL.createObjectURL(M), A = document.createElement("a");
|
|
3628
3605
|
A.href = C, A.download = `${s.title}.json`, A.click();
|
|
3629
3606
|
}
|
|
3630
|
-
function
|
|
3631
|
-
const
|
|
3607
|
+
function B() {
|
|
3608
|
+
const M = [
|
|
3632
3609
|
Object.keys(
|
|
3633
|
-
h == null ? void 0 : h.records.reduce((
|
|
3610
|
+
h == null ? void 0 : h.records.reduce((J, Q) => ({ ...J, ...Q }), {})
|
|
3634
3611
|
).join(","),
|
|
3635
|
-
...((h == null ? void 0 : h.records) || []).map((
|
|
3612
|
+
...((h == null ? void 0 : h.records) || []).map((J) => Object.values(J).join(","))
|
|
3636
3613
|
].join(`
|
|
3637
|
-
`), C = new Blob([
|
|
3614
|
+
`), C = new Blob([M], { type: "text/csv" }), A = URL.createObjectURL(C), $ = document.createElement("a");
|
|
3638
3615
|
$.href = A, $.download = `${s.title}.csv`, $.click();
|
|
3639
3616
|
}
|
|
3640
3617
|
return /* @__PURE__ */ n("div", { className: "relative flex h-full flex-col py-3", children: [
|
|
3641
|
-
(f ||
|
|
3618
|
+
(f || v) && /* @__PURE__ */ e("div", { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto flex h-10 w-10 items-center justify-center rounded-md bg-muted", children: /* @__PURE__ */ e(Qe, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }),
|
|
3642
3619
|
/* @__PURE__ */ n("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
3643
3620
|
a && /* @__PURE__ */ n("div", { className: "flex grow items-center gap-2", children: [
|
|
3644
3621
|
/* @__PURE__ */ e(Ql, {}),
|
|
@@ -3647,27 +3624,27 @@ function ua() {
|
|
|
3647
3624
|
] }),
|
|
3648
3625
|
!a && /* @__PURE__ */ n("div", { className: "flex grow items-center gap-1", children: [
|
|
3649
3626
|
/* @__PURE__ */ e(
|
|
3650
|
-
|
|
3627
|
+
I,
|
|
3651
3628
|
{
|
|
3652
3629
|
className: "h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70",
|
|
3653
3630
|
variant: "ghost",
|
|
3654
3631
|
size: "icon",
|
|
3655
|
-
onClick:
|
|
3632
|
+
onClick: B,
|
|
3656
3633
|
children: /* @__PURE__ */ e(Jl, { className: "size-4" })
|
|
3657
3634
|
}
|
|
3658
3635
|
),
|
|
3659
3636
|
/* @__PURE__ */ e(
|
|
3660
|
-
|
|
3637
|
+
I,
|
|
3661
3638
|
{
|
|
3662
3639
|
className: "h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70",
|
|
3663
3640
|
variant: "ghost",
|
|
3664
3641
|
size: "icon",
|
|
3665
3642
|
onClick: R,
|
|
3666
|
-
children: /* @__PURE__ */ e(
|
|
3643
|
+
children: /* @__PURE__ */ e(Ws, { strokeWidth: 1.5, className: "size-4" })
|
|
3667
3644
|
}
|
|
3668
3645
|
),
|
|
3669
3646
|
/* @__PURE__ */ e(
|
|
3670
|
-
|
|
3647
|
+
cs,
|
|
3671
3648
|
{
|
|
3672
3649
|
text: JSON.stringify(h == null ? void 0 : h.records, null, 2),
|
|
3673
3650
|
className: "h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70"
|
|
@@ -3684,7 +3661,7 @@ function ua() {
|
|
|
3684
3661
|
children: [
|
|
3685
3662
|
r && /* @__PURE__ */ n(ae, { children: [
|
|
3686
3663
|
/* @__PURE__ */ e(
|
|
3687
|
-
|
|
3664
|
+
we,
|
|
3688
3665
|
{
|
|
3689
3666
|
id: "1",
|
|
3690
3667
|
order: 1,
|
|
@@ -3697,13 +3674,13 @@ function ua() {
|
|
|
3697
3674
|
/* @__PURE__ */ e(it, {})
|
|
3698
3675
|
] }),
|
|
3699
3676
|
/* @__PURE__ */ e(
|
|
3700
|
-
|
|
3677
|
+
we,
|
|
3701
3678
|
{
|
|
3702
3679
|
id: "2",
|
|
3703
3680
|
order: 2,
|
|
3704
3681
|
minSize: 10,
|
|
3705
3682
|
className: "relative flex h-full min-h-0 w-full flex-1 basis-0",
|
|
3706
|
-
children: /* @__PURE__ */ n(
|
|
3683
|
+
children: /* @__PURE__ */ n(Te, { className: "relative flex h-full min-h-0 w-full flex-1 basis-0", children: [
|
|
3707
3684
|
(h == null ? void 0 : h.records) && (h == null ? void 0 : h.records.length) > 0 && /* @__PURE__ */ e(Hl, { data: (h == null ? void 0 : h.records) || [] }),
|
|
3708
3685
|
(x || (h == null ? void 0 : h.error)) && /* @__PURE__ */ e("span", { className: "font-mono text-xs", children: (x == null ? void 0 : x.message) || ((m = h == null ? void 0 : h.error) == null ? void 0 : m.message) }),
|
|
3709
3686
|
/* @__PURE__ */ e(He, { orientation: "horizontal" })
|
|
@@ -3721,7 +3698,7 @@ function Yl() {
|
|
|
3721
3698
|
const s = t.replace(/\n/g, "<br>");
|
|
3722
3699
|
return /* @__PURE__ */ n("div", { className: "relative flex w-full flex-col border-r", children: [
|
|
3723
3700
|
/* @__PURE__ */ e("div", { className: "sticky top-0 flex max-h-11 min-h-11 grow items-center border-b bg-muted px-3 font-mono text-xs font-semibold text-foreground/70", children: "Python Output" }),
|
|
3724
|
-
/* @__PURE__ */ n(
|
|
3701
|
+
/* @__PURE__ */ n(Te, { className: "overflow-y-auto px-2 pt-1 font-mono text-xs text-foreground/90", children: [
|
|
3725
3702
|
/* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: s } }),
|
|
3726
3703
|
/* @__PURE__ */ e(He, { orientation: "horizontal" })
|
|
3727
3704
|
] })
|
|
@@ -3734,7 +3711,7 @@ function er() {
|
|
|
3734
3711
|
return /* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
|
|
3735
3712
|
/* @__PURE__ */ e(G, { htmlFor: "visualize", children: "Chart" }),
|
|
3736
3713
|
/* @__PURE__ */ e(
|
|
3737
|
-
|
|
3714
|
+
hs,
|
|
3738
3715
|
{
|
|
3739
3716
|
checked: t,
|
|
3740
3717
|
onCheckedChange: () => s(!t),
|
|
@@ -3763,14 +3740,14 @@ function tr({
|
|
|
3763
3740
|
}
|
|
3764
3741
|
);
|
|
3765
3742
|
}
|
|
3766
|
-
function
|
|
3743
|
+
function ye({
|
|
3767
3744
|
label: t,
|
|
3768
3745
|
options: s,
|
|
3769
3746
|
value: a,
|
|
3770
3747
|
onValueChange: l,
|
|
3771
3748
|
className: r
|
|
3772
3749
|
}) {
|
|
3773
|
-
return /* @__PURE__ */ n(
|
|
3750
|
+
return /* @__PURE__ */ n(ve, { value: a, onValueChange: l, children: [
|
|
3774
3751
|
/* @__PURE__ */ e(
|
|
3775
3752
|
xe,
|
|
3776
3753
|
{
|
|
@@ -3778,7 +3755,7 @@ function ve({
|
|
|
3778
3755
|
children: /* @__PURE__ */ e(Ne, { placeholder: t })
|
|
3779
3756
|
}
|
|
3780
3757
|
),
|
|
3781
|
-
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(
|
|
3758
|
+
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(ke, { children: [
|
|
3782
3759
|
/* @__PURE__ */ e(Se, { children: t }),
|
|
3783
3760
|
s.map((i) => /* @__PURE__ */ e(te, { value: i.value, children: i.label }, i.value))
|
|
3784
3761
|
] }) })
|
|
@@ -3798,7 +3775,7 @@ function Je({
|
|
|
3798
3775
|
children: [
|
|
3799
3776
|
/* @__PURE__ */ n("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4", children: [
|
|
3800
3777
|
/* @__PURE__ */ e(G, { children: s }),
|
|
3801
|
-
/* @__PURE__ */ e(
|
|
3778
|
+
/* @__PURE__ */ e(ps, { className: "h-4 w-4" })
|
|
3802
3779
|
] }),
|
|
3803
3780
|
/* @__PURE__ */ e("div", { className: "transition-all ease-in-out", children: t })
|
|
3804
3781
|
]
|
|
@@ -3816,7 +3793,7 @@ function ar() {
|
|
|
3816
3793
|
);
|
|
3817
3794
|
function f(N, V) {
|
|
3818
3795
|
if (!t) return;
|
|
3819
|
-
const
|
|
3796
|
+
const z = {
|
|
3820
3797
|
...(t == null ? void 0 : t.dataInputCardIds) || {},
|
|
3821
3798
|
[N]: {
|
|
3822
3799
|
cardId: V,
|
|
@@ -3825,11 +3802,11 @@ function ar() {
|
|
|
3825
3802
|
};
|
|
3826
3803
|
o({
|
|
3827
3804
|
...t,
|
|
3828
|
-
dataInputCardIds:
|
|
3805
|
+
dataInputCardIds: z
|
|
3829
3806
|
});
|
|
3830
3807
|
}
|
|
3831
|
-
function
|
|
3832
|
-
var w,
|
|
3808
|
+
function v(N) {
|
|
3809
|
+
var w, z;
|
|
3833
3810
|
const V = (w = r == null ? void 0 : r.cards) == null ? void 0 : w.filter((F) => {
|
|
3834
3811
|
var E;
|
|
3835
3812
|
return ((E = F == null ? void 0 : F.customCardPreferences) == null ? void 0 : E.visualType) !== "multiple";
|
|
@@ -3837,8 +3814,8 @@ function ar() {
|
|
|
3837
3814
|
value: F.id,
|
|
3838
3815
|
label: F.tabTitle || F.title
|
|
3839
3816
|
}));
|
|
3840
|
-
return /* @__PURE__ */ e("div", { className: "space-y-2", children: (
|
|
3841
|
-
var
|
|
3817
|
+
return /* @__PURE__ */ e("div", { className: "space-y-2", children: (z = N == null ? void 0 : N.dataInputs) == null ? void 0 : z.map((F, E) => {
|
|
3818
|
+
var U, R;
|
|
3842
3819
|
return /* @__PURE__ */ n(
|
|
3843
3820
|
"div",
|
|
3844
3821
|
{
|
|
@@ -3846,13 +3823,13 @@ function ar() {
|
|
|
3846
3823
|
children: [
|
|
3847
3824
|
/* @__PURE__ */ e("div", { className: "col-span-4 flex items-center", children: F }),
|
|
3848
3825
|
/* @__PURE__ */ e(
|
|
3849
|
-
|
|
3826
|
+
ye,
|
|
3850
3827
|
{
|
|
3851
3828
|
className: "col-span-6 h-8 w-full justify-between",
|
|
3852
3829
|
label: "",
|
|
3853
3830
|
options: V || [],
|
|
3854
|
-
value: ((R = (
|
|
3855
|
-
onValueChange: (
|
|
3831
|
+
value: ((R = (U = t == null ? void 0 : t.dataInputCardIds) == null ? void 0 : U[E]) == null ? void 0 : R.cardId) || "",
|
|
3832
|
+
onValueChange: (B) => f(E, B)
|
|
3856
3833
|
}
|
|
3857
3834
|
)
|
|
3858
3835
|
]
|
|
@@ -3862,12 +3839,12 @@ function ar() {
|
|
|
3862
3839
|
}) });
|
|
3863
3840
|
}
|
|
3864
3841
|
function x(N, V, w = []) {
|
|
3865
|
-
var
|
|
3842
|
+
var z, F;
|
|
3866
3843
|
return t ? N === "input" ? /* @__PURE__ */ e(
|
|
3867
3844
|
pe,
|
|
3868
3845
|
{
|
|
3869
|
-
className: `h-8 w-full ${
|
|
3870
|
-
value: ((
|
|
3846
|
+
className: `h-8 w-full ${Be}`,
|
|
3847
|
+
value: ((z = t == null ? void 0 : t.settings) == null ? void 0 : z[V]) || "",
|
|
3871
3848
|
onChange: (E) => {
|
|
3872
3849
|
o({
|
|
3873
3850
|
...t,
|
|
@@ -3880,7 +3857,7 @@ function ar() {
|
|
|
3880
3857
|
},
|
|
3881
3858
|
V
|
|
3882
3859
|
) : N === "select" ? /* @__PURE__ */ e(
|
|
3883
|
-
|
|
3860
|
+
ye,
|
|
3884
3861
|
{
|
|
3885
3862
|
className: "h-8 w-full",
|
|
3886
3863
|
label: "",
|
|
@@ -3897,12 +3874,12 @@ function ar() {
|
|
|
3897
3874
|
}
|
|
3898
3875
|
function u(N) {
|
|
3899
3876
|
const V = Object.entries((N == null ? void 0 : N.settings) || {});
|
|
3900
|
-
return /* @__PURE__ */ e("div", { className: "space-y-3", children: V.map(([w,
|
|
3901
|
-
/* @__PURE__ */ e(G, { children:
|
|
3877
|
+
return /* @__PURE__ */ e("div", { className: "space-y-3", children: V.map(([w, z]) => /* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
3878
|
+
/* @__PURE__ */ e(G, { children: z.title }),
|
|
3902
3879
|
x(
|
|
3903
|
-
|
|
3880
|
+
z.ui,
|
|
3904
3881
|
w,
|
|
3905
|
-
|
|
3882
|
+
z.options
|
|
3906
3883
|
)
|
|
3907
3884
|
] }, w)) });
|
|
3908
3885
|
}
|
|
@@ -3920,7 +3897,7 @@ function ar() {
|
|
|
3920
3897
|
children: [
|
|
3921
3898
|
/* @__PURE__ */ e(Je, { summary: "Plugin Settings", children: /* @__PURE__ */ e("div", { className: "space-y-4 text-sm", children: /* @__PURE__ */ n("div", { className: "space-y-4 text-sm", children: [
|
|
3922
3899
|
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e("div", { className: "px-2", children: /* @__PURE__ */ e(
|
|
3923
|
-
|
|
3900
|
+
ye,
|
|
3924
3901
|
{
|
|
3925
3902
|
className: "h-8 w-full",
|
|
3926
3903
|
label: "",
|
|
@@ -3949,7 +3926,7 @@ function ar() {
|
|
|
3949
3926
|
((t == null ? void 0 : t.type) === "component" || (t == null ? void 0 : t.type) === void 0) && t && /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
3950
3927
|
/* @__PURE__ */ e(G, { children: "Component" }),
|
|
3951
3928
|
/* @__PURE__ */ e("div", { className: "space-y-2 px-2", children: c && /* @__PURE__ */ e(
|
|
3952
|
-
|
|
3929
|
+
ye,
|
|
3953
3930
|
{
|
|
3954
3931
|
className: "h-8 w-full",
|
|
3955
3932
|
label: "",
|
|
@@ -3974,7 +3951,7 @@ function ar() {
|
|
|
3974
3951
|
((k = l == null ? void 0 : l.customCardPreferences) == null ? void 0 : k.componentName) && /* @__PURE__ */ n(Je, { summary: "Component Settings", children: [
|
|
3975
3952
|
h && h.dataInputs && /* @__PURE__ */ n("div", { className: "space-y-3", children: [
|
|
3976
3953
|
/* @__PURE__ */ e(G, { children: "Input Mapping" }),
|
|
3977
|
-
/* @__PURE__ */ e("div", { className: "px-2", children:
|
|
3954
|
+
/* @__PURE__ */ e("div", { className: "px-2", children: v(h) })
|
|
3978
3955
|
] }),
|
|
3979
3956
|
h && h.settings && /* @__PURE__ */ e("div", { className: "space-y-3", children: /* @__PURE__ */ e("div", { className: "px-2", children: u(h) }) })
|
|
3980
3957
|
] })
|
|
@@ -3992,15 +3969,15 @@ function qe() {
|
|
|
3992
3969
|
);
|
|
3993
3970
|
p(
|
|
3994
3971
|
(f) => {
|
|
3995
|
-
var
|
|
3996
|
-
return (
|
|
3972
|
+
var v;
|
|
3973
|
+
return (v = f.card.preferences) == null ? void 0 : v.filterOnClickColumnIndex;
|
|
3997
3974
|
}
|
|
3998
3975
|
), ce(() => {
|
|
3999
3976
|
o && s(new Array(o.length).fill(!1));
|
|
4000
3977
|
}, [o]);
|
|
4001
|
-
function c(f,
|
|
3978
|
+
function c(f, v) {
|
|
4002
3979
|
var x, u;
|
|
4003
|
-
|
|
3980
|
+
v ? a != null && a.onClickFilter && ((x = a == null ? void 0 : a.onClickFilter) == null ? void 0 : x.length) > 0 ? i({
|
|
4004
3981
|
...a,
|
|
4005
3982
|
onClickFilter: [
|
|
4006
3983
|
...a.onClickFilter,
|
|
@@ -4027,11 +4004,11 @@ function qe() {
|
|
|
4027
4004
|
return b[f] = !1, b;
|
|
4028
4005
|
}));
|
|
4029
4006
|
}
|
|
4030
|
-
function d(f,
|
|
4007
|
+
function d(f, v) {
|
|
4031
4008
|
var u;
|
|
4032
4009
|
const x = (u = a == null ? void 0 : a.onClickFilter) == null ? void 0 : u.map((g) => g.columnIndex === f ? {
|
|
4033
4010
|
...g,
|
|
4034
|
-
expression:
|
|
4011
|
+
expression: v.target.value
|
|
4035
4012
|
} : g);
|
|
4036
4013
|
i({
|
|
4037
4014
|
...a,
|
|
@@ -4039,8 +4016,8 @@ function qe() {
|
|
|
4039
4016
|
});
|
|
4040
4017
|
}
|
|
4041
4018
|
function h(f) {
|
|
4042
|
-
var
|
|
4043
|
-
if (t != null && t[f] || (x = (
|
|
4019
|
+
var v, x, u, g;
|
|
4020
|
+
if (t != null && t[f] || (x = (v = a == null ? void 0 : a.onClickFilter) == null ? void 0 : v.find((b) => b.columnIndex === f)) != null && x.expression)
|
|
4044
4021
|
return /* @__PURE__ */ e(
|
|
4045
4022
|
pe,
|
|
4046
4023
|
{
|
|
@@ -4054,7 +4031,7 @@ function qe() {
|
|
|
4054
4031
|
}
|
|
4055
4032
|
return /* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
4056
4033
|
/* @__PURE__ */ e(G, { children: "On Click" }),
|
|
4057
|
-
o == null ? void 0 : o.map((f,
|
|
4034
|
+
o == null ? void 0 : o.map((f, v) => {
|
|
4058
4035
|
var x, u;
|
|
4059
4036
|
return /* @__PURE__ */ e(
|
|
4060
4037
|
"div",
|
|
@@ -4063,12 +4040,12 @@ function qe() {
|
|
|
4063
4040
|
children: /* @__PURE__ */ n("div", { className: "grow", children: [
|
|
4064
4041
|
/* @__PURE__ */ n("div", { className: "flex items-center space-x-2 py-2", children: [
|
|
4065
4042
|
/* @__PURE__ */ e(
|
|
4066
|
-
|
|
4043
|
+
Rt,
|
|
4067
4044
|
{
|
|
4068
4045
|
checked: !!((x = a == null ? void 0 : a.onClickFilter) != null && x.find(
|
|
4069
|
-
(g) => g.columnIndex ===
|
|
4046
|
+
(g) => g.columnIndex === v
|
|
4070
4047
|
)),
|
|
4071
|
-
onCheckedChange: (g) => c(
|
|
4048
|
+
onCheckedChange: (g) => c(v, g)
|
|
4072
4049
|
}
|
|
4073
4050
|
),
|
|
4074
4051
|
/* @__PURE__ */ e(
|
|
@@ -4079,21 +4056,21 @@ function qe() {
|
|
|
4079
4056
|
}
|
|
4080
4057
|
),
|
|
4081
4058
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: ((u = a == null ? void 0 : a.onClickFilter) == null ? void 0 : u.find(
|
|
4082
|
-
(g) => g.columnIndex ===
|
|
4059
|
+
(g) => g.columnIndex === v
|
|
4083
4060
|
)) && /* @__PURE__ */ e(
|
|
4084
|
-
|
|
4061
|
+
ma,
|
|
4085
4062
|
{
|
|
4086
4063
|
onClick: () => {
|
|
4087
4064
|
s((g) => {
|
|
4088
4065
|
const b = [...g];
|
|
4089
|
-
return b[
|
|
4066
|
+
return b[v] = !g[v], b;
|
|
4090
4067
|
});
|
|
4091
4068
|
},
|
|
4092
4069
|
className: "invisible size-3 cursor-pointer text-gray-400 group-hover:visible"
|
|
4093
4070
|
}
|
|
4094
4071
|
) })
|
|
4095
4072
|
] }),
|
|
4096
|
-
h(
|
|
4073
|
+
h(v)
|
|
4097
4074
|
] })
|
|
4098
4075
|
},
|
|
4099
4076
|
f
|
|
@@ -4101,7 +4078,7 @@ function qe() {
|
|
|
4101
4078
|
})
|
|
4102
4079
|
] });
|
|
4103
4080
|
}
|
|
4104
|
-
function
|
|
4081
|
+
function yt() {
|
|
4105
4082
|
var o, c, d;
|
|
4106
4083
|
const t = p((h) => h.card.preferences), s = p(
|
|
4107
4084
|
(h) => h.card.cfg
|
|
@@ -4131,40 +4108,40 @@ function vt() {
|
|
|
4131
4108
|
);
|
|
4132
4109
|
}
|
|
4133
4110
|
const tt = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
4134
|
-
function
|
|
4111
|
+
function ca(t, s) {
|
|
4135
4112
|
var l, r, i;
|
|
4136
|
-
const a =
|
|
4113
|
+
const a = Ia(t, s);
|
|
4137
4114
|
return ((i = (r = (l = t == null ? void 0 : t.chartOptions) == null ? void 0 : l.scales) == null ? void 0 : r[a]) == null ? void 0 : i.type) || "linear";
|
|
4138
4115
|
}
|
|
4139
4116
|
function nn() {
|
|
4140
|
-
var
|
|
4117
|
+
var J, Q, K, le, me, W;
|
|
4141
4118
|
const [t, s] = j(!1), a = p((q) => {
|
|
4142
4119
|
var L;
|
|
4143
4120
|
return (L = q.card) == null ? void 0 : L.preferences;
|
|
4144
4121
|
}), l = p((q) => {
|
|
4145
4122
|
var L;
|
|
4146
4123
|
return (L = q.card) == null ? void 0 : L.cfg;
|
|
4147
|
-
}), r =
|
|
4148
|
-
|
|
4124
|
+
}), r = Ia(a, l), [i, o] = j(
|
|
4125
|
+
ca(a)
|
|
4149
4126
|
), [c, d] = j(
|
|
4150
|
-
((K = (Q = (
|
|
4127
|
+
((K = (Q = (J = a == null ? void 0 : a.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : Q[r]) == null ? void 0 : K.min) || ""
|
|
4151
4128
|
), [h, f] = j(
|
|
4152
|
-
((
|
|
4153
|
-
), [
|
|
4129
|
+
((W = (me = (le = a == null ? void 0 : a.chartOptions) == null ? void 0 : le.scales) == null ? void 0 : me[r]) == null ? void 0 : W.max) || ""
|
|
4130
|
+
), [v, x] = j(c || h ? "custom" : "auto"), [u, g] = j(""), [b, k] = j(0), [N, V] = j(""), [w, z] = j(""), [F, E] = j(""), U = p(
|
|
4154
4131
|
(q) => q.actions.setCardPreferences
|
|
4155
|
-
), { updateCardInFrame: R } = de(),
|
|
4132
|
+
), { updateCardInFrame: R } = de(), B = p((q) => q.card), m = p((q) => {
|
|
4156
4133
|
var L;
|
|
4157
4134
|
return (L = q.card) == null ? void 0 : L.type;
|
|
4158
|
-
}),
|
|
4135
|
+
}), y = ["pie", "doughnut", "polarArea"].includes(m);
|
|
4159
4136
|
ce(() => {
|
|
4160
|
-
var q, L,
|
|
4161
|
-
o(
|
|
4162
|
-
((
|
|
4163
|
-
), f(((oe = (ue = (
|
|
4164
|
-
((P = (_ = (
|
|
4165
|
-
), k(((
|
|
4137
|
+
var q, L, re, ie, ue, oe, ne, O, _, P, se, Re, je, De;
|
|
4138
|
+
o(ca(a)), d(
|
|
4139
|
+
((re = (L = (q = a == null ? void 0 : a.chartOptions) == null ? void 0 : q.scales) == null ? void 0 : L[r]) == null ? void 0 : re.min) === 0 ? 0 : ""
|
|
4140
|
+
), f(((oe = (ue = (ie = a == null ? void 0 : a.chartOptions) == null ? void 0 : ie.scales) == null ? void 0 : ue[r]) == null ? void 0 : oe.max) || ""), g(
|
|
4141
|
+
((P = (_ = (O = (ne = a == null ? void 0 : a.chartOptions) == null ? void 0 : ne.scales) == null ? void 0 : O[r]) == null ? void 0 : _.ticks) == null ? void 0 : P.stepSize) || ""
|
|
4142
|
+
), k(((se = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : se.decimalPlaces) || 0), V(((Re = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : Re.suffix) || ""), z(((je = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : je.currency) || ""), E(((De = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : De.locale) || "");
|
|
4166
4143
|
}, [t, a, r]);
|
|
4167
|
-
function
|
|
4144
|
+
function M(q, L) {
|
|
4168
4145
|
return L === "" || /^[0-9\b]+$/.test(L) ? Number(L) : Number(q);
|
|
4169
4146
|
}
|
|
4170
4147
|
function C() {
|
|
@@ -4189,13 +4166,13 @@ function nn() {
|
|
|
4189
4166
|
}
|
|
4190
4167
|
),
|
|
4191
4168
|
/* @__PURE__ */ n(
|
|
4192
|
-
|
|
4169
|
+
ve,
|
|
4193
4170
|
{
|
|
4194
4171
|
value: w || "none",
|
|
4195
|
-
onValueChange: (L) =>
|
|
4172
|
+
onValueChange: (L) => z(L === "none" ? "" : L),
|
|
4196
4173
|
children: [
|
|
4197
4174
|
/* @__PURE__ */ e(xe, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(Ne, {}) }),
|
|
4198
|
-
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(
|
|
4175
|
+
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(ke, { children: [
|
|
4199
4176
|
/* @__PURE__ */ e(Se, { children: "Currency" }),
|
|
4200
4177
|
/* @__PURE__ */ e(te, { value: "none", children: "None" }),
|
|
4201
4178
|
q.map((L) => /* @__PURE__ */ e(te, { value: L, children: L }, L))
|
|
@@ -4203,7 +4180,7 @@ function nn() {
|
|
|
4203
4180
|
]
|
|
4204
4181
|
}
|
|
4205
4182
|
),
|
|
4206
|
-
/* @__PURE__ */ n(
|
|
4183
|
+
/* @__PURE__ */ n(ve, { value: F, onValueChange: (L) => E(L), children: [
|
|
4207
4184
|
/* @__PURE__ */ e(
|
|
4208
4185
|
xe,
|
|
4209
4186
|
{
|
|
@@ -4211,7 +4188,7 @@ function nn() {
|
|
|
4211
4188
|
children: /* @__PURE__ */ e(Ne, {})
|
|
4212
4189
|
}
|
|
4213
4190
|
),
|
|
4214
|
-
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(
|
|
4191
|
+
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(ke, { children: [
|
|
4215
4192
|
/* @__PURE__ */ e(Se, { children: "Locale" }),
|
|
4216
4193
|
ot.map((L) => /* @__PURE__ */ e(te, { value: L.locale, children: L.locale }, L.locale))
|
|
4217
4194
|
] }) })
|
|
@@ -4240,7 +4217,7 @@ function nn() {
|
|
|
4240
4217
|
{
|
|
4241
4218
|
id: "min",
|
|
4242
4219
|
value: c,
|
|
4243
|
-
onChange: (q) => d((L) =>
|
|
4220
|
+
onChange: (q) => d((L) => M(L, q.target.value)),
|
|
4244
4221
|
className: `col-span-1 h-8 w-full ${tt}`
|
|
4245
4222
|
}
|
|
4246
4223
|
),
|
|
@@ -4248,7 +4225,7 @@ function nn() {
|
|
|
4248
4225
|
pe,
|
|
4249
4226
|
{
|
|
4250
4227
|
value: h,
|
|
4251
|
-
onChange: (q) => f((L) =>
|
|
4228
|
+
onChange: (q) => f((L) => M(L, q.target.value)),
|
|
4252
4229
|
id: "max",
|
|
4253
4230
|
className: `col-span-1 h-8 w-full ${tt}`
|
|
4254
4231
|
}
|
|
@@ -4260,7 +4237,7 @@ function nn() {
|
|
|
4260
4237
|
pe,
|
|
4261
4238
|
{
|
|
4262
4239
|
value: u,
|
|
4263
|
-
onChange: (q) => g((L) =>
|
|
4240
|
+
onChange: (q) => g((L) => M(L, q.target.value)),
|
|
4264
4241
|
id: "step-size",
|
|
4265
4242
|
className: `col-span-1 h-8 w-full ${tt}`
|
|
4266
4243
|
}
|
|
@@ -4269,9 +4246,9 @@ function nn() {
|
|
|
4269
4246
|
] });
|
|
4270
4247
|
}
|
|
4271
4248
|
function $() {
|
|
4272
|
-
var
|
|
4249
|
+
var ie;
|
|
4273
4250
|
let q = {};
|
|
4274
|
-
|
|
4251
|
+
v === "custom" && (q = {
|
|
4275
4252
|
min: c,
|
|
4276
4253
|
max: h,
|
|
4277
4254
|
ticks: {
|
|
@@ -4283,7 +4260,7 @@ function nn() {
|
|
|
4283
4260
|
chartOptions: {
|
|
4284
4261
|
...a == null ? void 0 : a.chartOptions,
|
|
4285
4262
|
scales: {
|
|
4286
|
-
...(
|
|
4263
|
+
...(ie = a == null ? void 0 : a.chartOptions) == null ? void 0 : ie.scales,
|
|
4287
4264
|
[r]: {
|
|
4288
4265
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
4289
4266
|
type: i,
|
|
@@ -4298,15 +4275,15 @@ function nn() {
|
|
|
4298
4275
|
locale: F
|
|
4299
4276
|
}
|
|
4300
4277
|
};
|
|
4301
|
-
console.log(L),
|
|
4302
|
-
const
|
|
4303
|
-
...
|
|
4278
|
+
console.log(L), U(L);
|
|
4279
|
+
const re = {
|
|
4280
|
+
...B,
|
|
4304
4281
|
preferences: L
|
|
4305
4282
|
};
|
|
4306
|
-
R(
|
|
4283
|
+
R(re);
|
|
4307
4284
|
}
|
|
4308
4285
|
return /* @__PURE__ */ n(pt, { onOpenChange: (q) => s(q), children: [
|
|
4309
|
-
/* @__PURE__ */ e(ft, { asChild: !0, children: /* @__PURE__ */ e(
|
|
4286
|
+
/* @__PURE__ */ e(ft, { asChild: !0, children: /* @__PURE__ */ e(fs, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
4310
4287
|
/* @__PURE__ */ e(gt, { align: "center", className: "max-w-65", children: /* @__PURE__ */ n("div", { className: "grid gap-4", children: [
|
|
4311
4288
|
/* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
4312
4289
|
/* @__PURE__ */ e("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
@@ -4316,14 +4293,14 @@ function nn() {
|
|
|
4316
4293
|
/* @__PURE__ */ n("div", { className: "grid grid-cols-3 items-center gap-2", children: [
|
|
4317
4294
|
/* @__PURE__ */ e(G, { htmlFor: "scale", children: "Type" }),
|
|
4318
4295
|
/* @__PURE__ */ n(
|
|
4319
|
-
|
|
4296
|
+
ve,
|
|
4320
4297
|
{
|
|
4321
|
-
disabled:
|
|
4298
|
+
disabled: y,
|
|
4322
4299
|
value: i,
|
|
4323
4300
|
onValueChange: (q) => o(q),
|
|
4324
4301
|
children: [
|
|
4325
4302
|
/* @__PURE__ */ e(xe, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(Ne, {}) }),
|
|
4326
|
-
/* @__PURE__ */ e(Ce, { id: "type", children: /* @__PURE__ */ n(
|
|
4303
|
+
/* @__PURE__ */ e(Ce, { id: "type", children: /* @__PURE__ */ n(ke, { children: [
|
|
4327
4304
|
/* @__PURE__ */ e(Se, { children: "Option" }),
|
|
4328
4305
|
/* @__PURE__ */ e(te, { value: "linear", children: "Linear" }),
|
|
4329
4306
|
/* @__PURE__ */ e(te, { value: "logarithmic", children: "Logarithmic" })
|
|
@@ -4337,9 +4314,9 @@ function nn() {
|
|
|
4337
4314
|
/* @__PURE__ */ n(
|
|
4338
4315
|
bt,
|
|
4339
4316
|
{
|
|
4340
|
-
disabled:
|
|
4317
|
+
disabled: y,
|
|
4341
4318
|
id: "scale-option",
|
|
4342
|
-
value:
|
|
4319
|
+
value: v,
|
|
4343
4320
|
onValueChange: (q) => x(q),
|
|
4344
4321
|
className: "col-span-2 flex gap-3",
|
|
4345
4322
|
defaultValue: "x",
|
|
@@ -4356,11 +4333,11 @@ function nn() {
|
|
|
4356
4333
|
}
|
|
4357
4334
|
)
|
|
4358
4335
|
] }),
|
|
4359
|
-
|
|
4336
|
+
v === "custom" && i == "linear" && A(),
|
|
4360
4337
|
C(),
|
|
4361
|
-
/* @__PURE__ */ e(
|
|
4338
|
+
/* @__PURE__ */ e(gs, {}),
|
|
4362
4339
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e(
|
|
4363
|
-
|
|
4340
|
+
I,
|
|
4364
4341
|
{
|
|
4365
4342
|
onClick: $,
|
|
4366
4343
|
variant: "secondary",
|
|
@@ -4386,7 +4363,7 @@ function nr({ idx: t }) {
|
|
|
4386
4363
|
(d) => d.actions.setCardPreferences
|
|
4387
4364
|
), r = (c = s == null ? void 0 : s.chartOptions) == null ? void 0 : c.indexAxis, i = a == null ? void 0 : a.find((d) => d.idx === t);
|
|
4388
4365
|
function o(d, h) {
|
|
4389
|
-
(d === "end" || d === "start") &&
|
|
4366
|
+
(d === "end" || d === "start") && bs(ys());
|
|
4390
4367
|
const f = {
|
|
4391
4368
|
display: d !== "none",
|
|
4392
4369
|
align: d,
|
|
@@ -4405,10 +4382,10 @@ function nr({ idx: t }) {
|
|
|
4405
4382
|
]
|
|
4406
4383
|
});
|
|
4407
4384
|
else {
|
|
4408
|
-
const
|
|
4409
|
-
|
|
4385
|
+
const v = { ...i };
|
|
4386
|
+
v.datalabels = f;
|
|
4410
4387
|
const x = a == null ? void 0 : a.map(
|
|
4411
|
-
(u) => u.idx === h ?
|
|
4388
|
+
(u) => u.idx === h ? v : u
|
|
4412
4389
|
);
|
|
4413
4390
|
l({
|
|
4414
4391
|
...s,
|
|
@@ -4417,27 +4394,27 @@ function nr({ idx: t }) {
|
|
|
4417
4394
|
}
|
|
4418
4395
|
}
|
|
4419
4396
|
return /* @__PURE__ */ n(pt, { children: [
|
|
4420
|
-
/* @__PURE__ */ e(ft, { children: /* @__PURE__ */ e(
|
|
4397
|
+
/* @__PURE__ */ e(ft, { children: /* @__PURE__ */ e(dl, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
4421
4398
|
/* @__PURE__ */ e(gt, { className: "w-fit p-1", children: /* @__PURE__ */ n("div", { className: "flex gap-1", children: [
|
|
4422
4399
|
/* @__PURE__ */ e(
|
|
4423
|
-
|
|
4400
|
+
I,
|
|
4424
4401
|
{
|
|
4425
4402
|
onClick: () => o("none", t),
|
|
4426
4403
|
size: "sm",
|
|
4427
4404
|
variant: "secondary",
|
|
4428
4405
|
className: "h-7 p-1 text-xs font-normal",
|
|
4429
|
-
children: /* @__PURE__ */ e(
|
|
4406
|
+
children: /* @__PURE__ */ e(Ye, { className: "size-4" })
|
|
4430
4407
|
}
|
|
4431
4408
|
),
|
|
4432
4409
|
/* @__PURE__ */ e(
|
|
4433
|
-
|
|
4410
|
+
I,
|
|
4434
4411
|
{
|
|
4435
4412
|
onClick: () => o("start", t),
|
|
4436
4413
|
size: "sm",
|
|
4437
4414
|
variant: "secondary",
|
|
4438
4415
|
className: "h-7 p-1 text-xs font-normal",
|
|
4439
4416
|
children: /* @__PURE__ */ e(
|
|
4440
|
-
|
|
4417
|
+
Ys,
|
|
4441
4418
|
{
|
|
4442
4419
|
className: ee("h-4 w-4", {
|
|
4443
4420
|
"rotate-90": r === "y"
|
|
@@ -4447,14 +4424,14 @@ function nr({ idx: t }) {
|
|
|
4447
4424
|
}
|
|
4448
4425
|
),
|
|
4449
4426
|
/* @__PURE__ */ e(
|
|
4450
|
-
|
|
4427
|
+
I,
|
|
4451
4428
|
{
|
|
4452
4429
|
onClick: () => o("center", t),
|
|
4453
4430
|
size: "sm",
|
|
4454
4431
|
variant: "secondary",
|
|
4455
4432
|
className: "h-7 p-1 text-xs font-normal",
|
|
4456
4433
|
children: /* @__PURE__ */ e(
|
|
4457
|
-
|
|
4434
|
+
tl,
|
|
4458
4435
|
{
|
|
4459
4436
|
className: ee("h-4 w-4", {
|
|
4460
4437
|
"rotate-90": r === "y"
|
|
@@ -4464,14 +4441,14 @@ function nr({ idx: t }) {
|
|
|
4464
4441
|
}
|
|
4465
4442
|
),
|
|
4466
4443
|
/* @__PURE__ */ e(
|
|
4467
|
-
|
|
4444
|
+
I,
|
|
4468
4445
|
{
|
|
4469
4446
|
onClick: () => o("end", t),
|
|
4470
4447
|
size: "sm",
|
|
4471
4448
|
variant: "secondary",
|
|
4472
4449
|
className: "h-7 p-1 text-xs font-normal",
|
|
4473
4450
|
children: /* @__PURE__ */ e(
|
|
4474
|
-
|
|
4451
|
+
el,
|
|
4475
4452
|
{
|
|
4476
4453
|
className: ee("h-4 w-4", {
|
|
4477
4454
|
"rotate-90": r === "y"
|
|
@@ -4486,8 +4463,8 @@ function nr({ idx: t }) {
|
|
|
4486
4463
|
function sn() {
|
|
4487
4464
|
const t = p((h) => h.card), s = p(
|
|
4488
4465
|
(h) => {
|
|
4489
|
-
var f,
|
|
4490
|
-
return (x = (
|
|
4466
|
+
var f, v, x;
|
|
4467
|
+
return (x = (v = (f = h == null ? void 0 : h.card) == null ? void 0 : f.preferences) == null ? void 0 : v.chartOptions) == null ? void 0 : x.indexAxis;
|
|
4491
4468
|
}
|
|
4492
4469
|
), { data: a } = Ve(t), l = s === "y" ? "Y axis" : "X axis", r = s === "y" ? "X axis" : "Y axis", {
|
|
4493
4470
|
keys: i,
|
|
@@ -4560,21 +4537,21 @@ function sr({ col: t, idx: s }) {
|
|
|
4560
4537
|
/* @__PURE__ */ e("p", { title: t, children: ln(t) }),
|
|
4561
4538
|
/* @__PURE__ */ n("div", { className: "flex gap-2", children: [
|
|
4562
4539
|
/* @__PURE__ */ e(
|
|
4563
|
-
|
|
4540
|
+
_t,
|
|
4564
4541
|
{
|
|
4565
4542
|
onClick: () => o("bar"),
|
|
4566
4543
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4567
4544
|
}
|
|
4568
4545
|
),
|
|
4569
4546
|
/* @__PURE__ */ e(
|
|
4570
|
-
|
|
4547
|
+
Ht,
|
|
4571
4548
|
{
|
|
4572
4549
|
onClick: () => o("line"),
|
|
4573
4550
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4574
4551
|
}
|
|
4575
4552
|
),
|
|
4576
4553
|
/* @__PURE__ */ e(
|
|
4577
|
-
|
|
4554
|
+
Ps,
|
|
4578
4555
|
{
|
|
4579
4556
|
onClick: () => o("area"),
|
|
4580
4557
|
className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
|
|
@@ -4585,31 +4562,31 @@ function sr({ col: t, idx: s }) {
|
|
|
4585
4562
|
] });
|
|
4586
4563
|
}
|
|
4587
4564
|
function rn() {
|
|
4588
|
-
const t = p((u) => u.selectedConnectionId), s = p((u) => u.selectedDatamodelId), a = p((u) => u.selectedDatabaseName), l = p((u) => u.selectedSchemaName), r = p((u) => u.selectedTableName), i =
|
|
4565
|
+
const t = p((u) => u.selectedConnectionId), s = p((u) => u.selectedDatamodelId), a = p((u) => u.selectedDatabaseName), l = p((u) => u.selectedSchemaName), r = p((u) => u.selectedTableName), i = T((u) => u.dashboard.filters) || [], o = T((u) => u.actions.addFilter), c = T((u) => u.actions.removeFilter), { removeFilterValues: d } = Ze(), { modelItems: h, tableName: f, connectionType: v } = Ae();
|
|
4589
4566
|
function x(u, g = "dashboard") {
|
|
4590
|
-
var
|
|
4567
|
+
var U;
|
|
4591
4568
|
const b = be(u.column_name), k = be(a || ""), N = be(l || ""), V = be(f);
|
|
4592
|
-
let w =
|
|
4569
|
+
let w = xs(
|
|
4593
4570
|
N,
|
|
4594
4571
|
V,
|
|
4595
|
-
|
|
4596
|
-
),
|
|
4597
|
-
const F = (
|
|
4572
|
+
v
|
|
4573
|
+
), z = `${w}.${b}`;
|
|
4574
|
+
const F = (U = h == null ? void 0 : h.find(
|
|
4598
4575
|
(R) => R.id === s
|
|
4599
|
-
)) == null ? void 0 :
|
|
4600
|
-
s && s !== "none" && (
|
|
4576
|
+
)) == null ? void 0 : U.name;
|
|
4577
|
+
s && s !== "none" && (z = `${na}.${F}.${b}`, w = `${na}.${F}`);
|
|
4601
4578
|
const E = i == null ? void 0 : i.find(
|
|
4602
|
-
(R) => R.column ===
|
|
4579
|
+
(R) => R.column === z && R.table === V && (R.database === k || R.database === a)
|
|
4603
4580
|
);
|
|
4604
4581
|
if (E)
|
|
4605
4582
|
d(E.id), c(E.id);
|
|
4606
4583
|
else {
|
|
4607
|
-
const R =
|
|
4584
|
+
const R = We();
|
|
4608
4585
|
return f === "api" && t ? (o({
|
|
4609
4586
|
location: g,
|
|
4610
4587
|
id: R,
|
|
4611
4588
|
//uuidv4(),
|
|
4612
|
-
column:
|
|
4589
|
+
column: z,
|
|
4613
4590
|
title: u.column_name,
|
|
4614
4591
|
dataType: u.data_type,
|
|
4615
4592
|
table: "api",
|
|
@@ -4617,7 +4594,7 @@ function rn() {
|
|
|
4617
4594
|
// database: 'NA',
|
|
4618
4595
|
connectionId: t,
|
|
4619
4596
|
operation: "in",
|
|
4620
|
-
sql:
|
|
4597
|
+
sql: aa(
|
|
4621
4598
|
u.data_type,
|
|
4622
4599
|
w,
|
|
4623
4600
|
b
|
|
@@ -4627,7 +4604,7 @@ function rn() {
|
|
|
4627
4604
|
id: R,
|
|
4628
4605
|
//uuidv4(),
|
|
4629
4606
|
location: g,
|
|
4630
|
-
column:
|
|
4607
|
+
column: z,
|
|
4631
4608
|
//columnName, //`${qualifiedTableName}.${formattedColumnName}`,
|
|
4632
4609
|
title: u.column_name,
|
|
4633
4610
|
dataType: u.data_type,
|
|
@@ -4635,7 +4612,7 @@ function rn() {
|
|
|
4635
4612
|
database: a || "",
|
|
4636
4613
|
connectionId: t || "",
|
|
4637
4614
|
operation: "in",
|
|
4638
|
-
sql:
|
|
4615
|
+
sql: aa(
|
|
4639
4616
|
u.data_type,
|
|
4640
4617
|
w,
|
|
4641
4618
|
b
|
|
@@ -4647,7 +4624,7 @@ function rn() {
|
|
|
4647
4624
|
return { assignFilter: x };
|
|
4648
4625
|
}
|
|
4649
4626
|
function Pe() {
|
|
4650
|
-
const t =
|
|
4627
|
+
const t = T(
|
|
4651
4628
|
(c) => c.dashboard.filters
|
|
4652
4629
|
), s = p((c) => c.frame), { setFrame: a } = de(), { columns: l } = Ae(), { assignFilter: r } = rn();
|
|
4653
4630
|
function i(c) {
|
|
@@ -4666,10 +4643,10 @@ function lr({
|
|
|
4666
4643
|
onSelect: s
|
|
4667
4644
|
}) {
|
|
4668
4645
|
var o;
|
|
4669
|
-
const [a, l] =
|
|
4646
|
+
const [a, l] = sa.useState(!1), [r, i] = sa.useState("");
|
|
4670
4647
|
return /* @__PURE__ */ n(pt, { open: a, onOpenChange: l, children: [
|
|
4671
4648
|
/* @__PURE__ */ e(ft, { asChild: !0, children: /* @__PURE__ */ n(
|
|
4672
|
-
|
|
4649
|
+
I,
|
|
4673
4650
|
{
|
|
4674
4651
|
size: "sm",
|
|
4675
4652
|
variant: "outline",
|
|
@@ -4678,15 +4655,15 @@ function lr({
|
|
|
4678
4655
|
className: "w-full justify-between font-normal",
|
|
4679
4656
|
children: [
|
|
4680
4657
|
r ? (o = t.find((c) => c.column_name === r)) == null ? void 0 : o.column_name : "Select Column...",
|
|
4681
|
-
/* @__PURE__ */ e(
|
|
4658
|
+
/* @__PURE__ */ e(Ns, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
4682
4659
|
]
|
|
4683
4660
|
}
|
|
4684
4661
|
) }),
|
|
4685
|
-
/* @__PURE__ */ e(gt, { className: "w-[200px] p-0", children: /* @__PURE__ */ n(
|
|
4686
|
-
/* @__PURE__ */ e(
|
|
4687
|
-
/* @__PURE__ */ n(
|
|
4688
|
-
/* @__PURE__ */ e(
|
|
4689
|
-
/* @__PURE__ */ e(
|
|
4662
|
+
/* @__PURE__ */ e(gt, { className: "w-[200px] p-0", children: /* @__PURE__ */ n(Cs, { children: [
|
|
4663
|
+
/* @__PURE__ */ e(Ss, { placeholder: "Search column", className: "h-9" }),
|
|
4664
|
+
/* @__PURE__ */ n(ws, { children: [
|
|
4665
|
+
/* @__PURE__ */ e(ks, { children: "No framework found." }),
|
|
4666
|
+
/* @__PURE__ */ e(zs, { children: t.map((c) => /* @__PURE__ */ n(
|
|
4690
4667
|
Os,
|
|
4691
4668
|
{
|
|
4692
4669
|
value: c.column_name,
|
|
@@ -4697,7 +4674,7 @@ function lr({
|
|
|
4697
4674
|
children: [
|
|
4698
4675
|
c.column_name,
|
|
4699
4676
|
/* @__PURE__ */ e(
|
|
4700
|
-
|
|
4677
|
+
Ts,
|
|
4701
4678
|
{
|
|
4702
4679
|
className: ee(
|
|
4703
4680
|
"ml-auto h-4 w-4",
|
|
@@ -4718,7 +4695,7 @@ function rr({
|
|
|
4718
4695
|
}) {
|
|
4719
4696
|
return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ n(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4720
4697
|
/* @__PURE__ */ n(Z, { value: "item-1", children: [
|
|
4721
|
-
/* @__PURE__ */ e(X, { children: `${
|
|
4698
|
+
/* @__PURE__ */ e(X, { children: `${jt(t)} Chart` }),
|
|
4722
4699
|
/* @__PURE__ */ n(Y, { className: "space-y-4 font-mono text-xs", children: [
|
|
4723
4700
|
/* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT x-axis, y-axis-1, y-axis-2,... FROM table" }),
|
|
4724
4701
|
/* @__PURE__ */ n("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
@@ -4745,7 +4722,7 @@ function rr({
|
|
|
4745
4722
|
/* @__PURE__ */ n(Z, { value: "item-2", children: [
|
|
4746
4723
|
/* @__PURE__ */ e(X, { children: "Settings" }),
|
|
4747
4724
|
/* @__PURE__ */ n(Y, { className: "space-y-4 px-2", children: [
|
|
4748
|
-
/* @__PURE__ */ e(
|
|
4725
|
+
/* @__PURE__ */ e(yt, {}),
|
|
4749
4726
|
/* @__PURE__ */ e(sn, {})
|
|
4750
4727
|
] })
|
|
4751
4728
|
] }),
|
|
@@ -4758,7 +4735,7 @@ function rr({
|
|
|
4758
4735
|
] })
|
|
4759
4736
|
] }) });
|
|
4760
4737
|
}
|
|
4761
|
-
function
|
|
4738
|
+
function Bt() {
|
|
4762
4739
|
var r, i, o;
|
|
4763
4740
|
const t = p(
|
|
4764
4741
|
(c) => c.card.cfg
|
|
@@ -4790,14 +4767,14 @@ function Wt() {
|
|
|
4790
4767
|
!["pyramid"].includes(a) && /* @__PURE__ */ e(nn, {})
|
|
4791
4768
|
] }),
|
|
4792
4769
|
/* @__PURE__ */ n(
|
|
4793
|
-
|
|
4770
|
+
ve,
|
|
4794
4771
|
{
|
|
4795
4772
|
value: (o = (i = (r = t == null ? void 0 : t.options) == null ? void 0 : r.plugins) == null ? void 0 : i.datalabels) == null ? void 0 : o.anchor,
|
|
4796
4773
|
onValueChange: l,
|
|
4797
4774
|
defaultValue: "none",
|
|
4798
4775
|
children: [
|
|
4799
4776
|
/* @__PURE__ */ e(xe, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(Ne, { placeholder: "Select position" }) }),
|
|
4800
|
-
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(
|
|
4777
|
+
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(ke, { children: [
|
|
4801
4778
|
/* @__PURE__ */ e(Se, { children: "Data Labels" }),
|
|
4802
4779
|
/* @__PURE__ */ e(te, { value: "none", children: "None" }),
|
|
4803
4780
|
a !== "pyramid" && /* @__PURE__ */ e(te, { value: "start", children: "Start" }),
|
|
@@ -4840,12 +4817,12 @@ function ir({
|
|
|
4840
4817
|
}
|
|
4841
4818
|
return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ n(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
4842
4819
|
/* @__PURE__ */ n(Z, { value: "item-1", children: [
|
|
4843
|
-
/* @__PURE__ */ e(X, { children: `${
|
|
4820
|
+
/* @__PURE__ */ e(X, { children: `${jt(t)} Chart` }),
|
|
4844
4821
|
/* @__PURE__ */ e(Y, { className: "space-y-4 font-mono text-xs", children: s(t) })
|
|
4845
4822
|
] }),
|
|
4846
4823
|
/* @__PURE__ */ n(Z, { value: "item-2", children: [
|
|
4847
4824
|
/* @__PURE__ */ e(X, { children: "Settings" }),
|
|
4848
|
-
/* @__PURE__ */ e(Y, { className: "px-2", children: /* @__PURE__ */ e(
|
|
4825
|
+
/* @__PURE__ */ e(Y, { className: "px-2", children: /* @__PURE__ */ e(Bt, {}) })
|
|
4849
4826
|
] }),
|
|
4850
4827
|
/* @__PURE__ */ n(Z, { value: "item-3", children: [
|
|
4851
4828
|
/* @__PURE__ */ e(X, { children: "Filters" }),
|
|
@@ -4891,9 +4868,9 @@ function dr() {
|
|
|
4891
4868
|
children: ur(t)
|
|
4892
4869
|
}
|
|
4893
4870
|
),
|
|
4894
|
-
/* @__PURE__ */ e("section", { className: "", children: ["line", "bar"].includes(t) && /* @__PURE__ */ e(
|
|
4871
|
+
/* @__PURE__ */ e("section", { className: "", children: ["line", "bar"].includes(t) && /* @__PURE__ */ e(yt, {}) }),
|
|
4895
4872
|
!["kpi"].includes(t) && /* @__PURE__ */ n("div", { className: "space-y-4", children: [
|
|
4896
|
-
/* @__PURE__ */ e(
|
|
4873
|
+
/* @__PURE__ */ e(Bt, {}),
|
|
4897
4874
|
/* @__PURE__ */ e(qe, {}),
|
|
4898
4875
|
/* @__PURE__ */ e(Pe, {})
|
|
4899
4876
|
] })
|
|
@@ -4997,7 +4974,7 @@ function ur(t) {
|
|
|
4997
4974
|
] }) });
|
|
4998
4975
|
}
|
|
4999
4976
|
function hr() {
|
|
5000
|
-
var d, h, f,
|
|
4977
|
+
var d, h, f, v, x;
|
|
5001
4978
|
const t = p((u) => u.card.preferences), s = p(
|
|
5002
4979
|
(u) => u.actions.setCardPreferences
|
|
5003
4980
|
), a = p(
|
|
@@ -5034,7 +5011,7 @@ function hr() {
|
|
|
5034
5011
|
return /* @__PURE__ */ n("div", { children: [
|
|
5035
5012
|
/* @__PURE__ */ n("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
5036
5013
|
/* @__PURE__ */ e(
|
|
5037
|
-
|
|
5014
|
+
Rt,
|
|
5038
5015
|
{
|
|
5039
5016
|
checked: !!((d = t == null ? void 0 : t.formatNumber) != null && d.enabled),
|
|
5040
5017
|
onCheckedChange: (u) => {
|
|
@@ -5056,7 +5033,7 @@ function hr() {
|
|
|
5056
5033
|
/* @__PURE__ */ n("div", { className: "w-full space-y-1", children: [
|
|
5057
5034
|
/* @__PURE__ */ e(G, { children: "Locale" }),
|
|
5058
5035
|
/* @__PURE__ */ n(
|
|
5059
|
-
|
|
5036
|
+
ve,
|
|
5060
5037
|
{
|
|
5061
5038
|
value: l || "none",
|
|
5062
5039
|
onValueChange: (u) => {
|
|
@@ -5070,7 +5047,7 @@ function hr() {
|
|
|
5070
5047
|
},
|
|
5071
5048
|
children: [
|
|
5072
5049
|
/* @__PURE__ */ e(xe, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(Ne, {}) }),
|
|
5073
|
-
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(
|
|
5050
|
+
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(ke, { children: [
|
|
5074
5051
|
/* @__PURE__ */ e(Se, { children: "Format" }),
|
|
5075
5052
|
/* @__PURE__ */ e(te, { value: "none", children: "None" }, "none"),
|
|
5076
5053
|
ot.map((u) => /* @__PURE__ */ e(te, { value: u.locale, children: u.locale }, u.locale))
|
|
@@ -5082,7 +5059,7 @@ function hr() {
|
|
|
5082
5059
|
/* @__PURE__ */ n("div", { className: "w-full space-y-1", children: [
|
|
5083
5060
|
/* @__PURE__ */ e(G, { children: "Currency" }),
|
|
5084
5061
|
/* @__PURE__ */ n(
|
|
5085
|
-
|
|
5062
|
+
ve,
|
|
5086
5063
|
{
|
|
5087
5064
|
value: r || "none",
|
|
5088
5065
|
onValueChange: (u) => {
|
|
@@ -5096,7 +5073,7 @@ function hr() {
|
|
|
5096
5073
|
},
|
|
5097
5074
|
children: [
|
|
5098
5075
|
/* @__PURE__ */ e(xe, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e(Ne, {}) }),
|
|
5099
|
-
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(
|
|
5076
|
+
/* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ n(ke, { children: [
|
|
5100
5077
|
/* @__PURE__ */ e(Se, { children: "Currency" }),
|
|
5101
5078
|
/* @__PURE__ */ e(te, { value: "none", children: "None" }, "none"),
|
|
5102
5079
|
c.map((u) => /* @__PURE__ */ e(te, { value: u, children: u }, u))
|
|
@@ -5110,9 +5087,9 @@ function hr() {
|
|
|
5110
5087
|
/* @__PURE__ */ n("div", { className: "w-full space-y-1", children: [
|
|
5111
5088
|
/* @__PURE__ */ e(G, { children: "Decimals" }),
|
|
5112
5089
|
/* @__PURE__ */ n(
|
|
5113
|
-
|
|
5090
|
+
ve,
|
|
5114
5091
|
{
|
|
5115
|
-
value: ((
|
|
5092
|
+
value: ((v = (f = t == null ? void 0 : t.formatNumber) == null ? void 0 : f.decimalPlaces) == null ? void 0 : v.toString()) || "0",
|
|
5116
5093
|
onValueChange: (u) => {
|
|
5117
5094
|
var g, b, k;
|
|
5118
5095
|
return a(
|
|
@@ -5153,7 +5130,7 @@ function hr() {
|
|
|
5153
5130
|
] }) }),
|
|
5154
5131
|
/* @__PURE__ */ e(ze, { className: "my-3" }),
|
|
5155
5132
|
/* @__PURE__ */ e(
|
|
5156
|
-
|
|
5133
|
+
Ms,
|
|
5157
5134
|
{
|
|
5158
5135
|
colorRanges: i,
|
|
5159
5136
|
setColorRanges: o
|
|
@@ -5294,10 +5271,10 @@ const pr = [
|
|
|
5294
5271
|
value: t
|
|
5295
5272
|
}));
|
|
5296
5273
|
function br() {
|
|
5297
|
-
var d, h, f,
|
|
5274
|
+
var d, h, f, v, x, u, g, b, k, N, V, w, z, F, E, U, R, B;
|
|
5298
5275
|
const t = p((m) => m.card), s = (h = (d = t == null ? void 0 : t.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : h.topoJsonUrl, [a, l] = j(
|
|
5299
|
-
((
|
|
5300
|
-
), { setCardPreferences: r } = de(), { data: i } =
|
|
5276
|
+
((v = (f = t == null ? void 0 : t.preferences) == null ? void 0 : f.mapVisualOptions) == null ? void 0 : v.customTopoJsonUrl) || ""
|
|
5277
|
+
), { setCardPreferences: r } = de(), { data: i } = qt(t), o = Object.keys((i == null ? void 0 : i.objects) || {}).map((m) => ({
|
|
5301
5278
|
label: m,
|
|
5302
5279
|
value: m
|
|
5303
5280
|
})) || [];
|
|
@@ -5306,7 +5283,7 @@ function br() {
|
|
|
5306
5283
|
/* @__PURE__ */ e(ze, { className: "my-4" }),
|
|
5307
5284
|
/* @__PURE__ */ e(Je, { open: !0, summary: "Settings", children: /* @__PURE__ */ n("div", { className: "space-y-3 px-2", children: [
|
|
5308
5285
|
/* @__PURE__ */ e(
|
|
5309
|
-
|
|
5286
|
+
ye,
|
|
5310
5287
|
{
|
|
5311
5288
|
className: "h-9",
|
|
5312
5289
|
options: [
|
|
@@ -5353,7 +5330,7 @@ function br() {
|
|
|
5353
5330
|
});
|
|
5354
5331
|
},
|
|
5355
5332
|
value: a,
|
|
5356
|
-
className: `h-9 w-full ${
|
|
5333
|
+
className: `h-9 w-full ${Be}`,
|
|
5357
5334
|
placeholder: "Custom URL"
|
|
5358
5335
|
}
|
|
5359
5336
|
),
|
|
@@ -5361,18 +5338,18 @@ function br() {
|
|
|
5361
5338
|
/* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
5362
5339
|
/* @__PURE__ */ e(G, { children: "Map Object" }),
|
|
5363
5340
|
/* @__PURE__ */ e(
|
|
5364
|
-
|
|
5341
|
+
ye,
|
|
5365
5342
|
{
|
|
5366
5343
|
className: "h-9",
|
|
5367
5344
|
options: o,
|
|
5368
5345
|
value: ((u = (x = t.preferences) == null ? void 0 : x.mapVisualOptions) == null ? void 0 : u.objectKey) || "",
|
|
5369
5346
|
label: "Map Object",
|
|
5370
5347
|
onValueChange: (m) => {
|
|
5371
|
-
var
|
|
5348
|
+
var y;
|
|
5372
5349
|
r({
|
|
5373
5350
|
...t.preferences,
|
|
5374
5351
|
mapVisualOptions: {
|
|
5375
|
-
...(
|
|
5352
|
+
...(y = t.preferences) == null ? void 0 : y.mapVisualOptions,
|
|
5376
5353
|
objectKey: m
|
|
5377
5354
|
}
|
|
5378
5355
|
});
|
|
@@ -5383,18 +5360,18 @@ function br() {
|
|
|
5383
5360
|
/* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
5384
5361
|
/* @__PURE__ */ e(G, { children: "Projection" }),
|
|
5385
5362
|
/* @__PURE__ */ e(
|
|
5386
|
-
|
|
5363
|
+
ye,
|
|
5387
5364
|
{
|
|
5388
5365
|
className: "h-9",
|
|
5389
5366
|
options: pr,
|
|
5390
5367
|
value: ((b = (g = t.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : b.projection) || "",
|
|
5391
5368
|
label: "Projection",
|
|
5392
5369
|
onValueChange: (m) => {
|
|
5393
|
-
var
|
|
5370
|
+
var y;
|
|
5394
5371
|
r({
|
|
5395
5372
|
...t.preferences,
|
|
5396
5373
|
mapVisualOptions: {
|
|
5397
|
-
...(
|
|
5374
|
+
...(y = t.preferences) == null ? void 0 : y.mapVisualOptions,
|
|
5398
5375
|
projection: m
|
|
5399
5376
|
}
|
|
5400
5377
|
});
|
|
@@ -5405,18 +5382,18 @@ function br() {
|
|
|
5405
5382
|
/* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
5406
5383
|
/* @__PURE__ */ e(G, { children: "Colors" }),
|
|
5407
5384
|
/* @__PURE__ */ e(
|
|
5408
|
-
|
|
5385
|
+
ye,
|
|
5409
5386
|
{
|
|
5410
5387
|
className: "h-9",
|
|
5411
5388
|
options: gr,
|
|
5412
5389
|
value: ((N = (k = t.preferences) == null ? void 0 : k.mapVisualOptions) == null ? void 0 : N.colorScale) || "",
|
|
5413
5390
|
label: "Select Color Scale",
|
|
5414
5391
|
onValueChange: (m) => {
|
|
5415
|
-
var
|
|
5392
|
+
var y;
|
|
5416
5393
|
r({
|
|
5417
5394
|
...t.preferences,
|
|
5418
5395
|
mapVisualOptions: {
|
|
5419
|
-
...(
|
|
5396
|
+
...(y = t.preferences) == null ? void 0 : y.mapVisualOptions,
|
|
5420
5397
|
colorScale: m
|
|
5421
5398
|
}
|
|
5422
5399
|
});
|
|
@@ -5431,16 +5408,16 @@ function br() {
|
|
|
5431
5408
|
/* @__PURE__ */ e(
|
|
5432
5409
|
pe,
|
|
5433
5410
|
{
|
|
5434
|
-
className: `h-9 w-full ${
|
|
5411
|
+
className: `h-9 w-full ${Be}`,
|
|
5435
5412
|
type: "number",
|
|
5436
5413
|
step: 0.1,
|
|
5437
5414
|
value: ((w = (V = t.preferences) == null ? void 0 : V.mapVisualOptions) == null ? void 0 : w.projectionScale) || 1,
|
|
5438
5415
|
onChange: (m) => {
|
|
5439
|
-
var
|
|
5416
|
+
var y;
|
|
5440
5417
|
r({
|
|
5441
5418
|
...t.preferences,
|
|
5442
5419
|
mapVisualOptions: {
|
|
5443
|
-
...(
|
|
5420
|
+
...(y = t.preferences) == null ? void 0 : y.mapVisualOptions,
|
|
5444
5421
|
projectionScale: Number(m.target.value)
|
|
5445
5422
|
}
|
|
5446
5423
|
});
|
|
@@ -5451,19 +5428,19 @@ function br() {
|
|
|
5451
5428
|
/* @__PURE__ */ e(
|
|
5452
5429
|
pe,
|
|
5453
5430
|
{
|
|
5454
|
-
className: `h-9 w-full ${
|
|
5431
|
+
className: `h-9 w-full ${Be}`,
|
|
5455
5432
|
type: "number",
|
|
5456
5433
|
step: 10,
|
|
5457
|
-
value: ((E = (F = (
|
|
5434
|
+
value: ((E = (F = (z = t.preferences) == null ? void 0 : z.mapVisualOptions) == null ? void 0 : F.projectionOffset) == null ? void 0 : E[0]) || 0,
|
|
5458
5435
|
onChange: (m) => {
|
|
5459
|
-
var
|
|
5436
|
+
var y, M, C, A;
|
|
5460
5437
|
r({
|
|
5461
5438
|
...t.preferences,
|
|
5462
5439
|
mapVisualOptions: {
|
|
5463
|
-
...(
|
|
5440
|
+
...(y = t.preferences) == null ? void 0 : y.mapVisualOptions,
|
|
5464
5441
|
projectionOffset: [
|
|
5465
5442
|
Number(m.target.value),
|
|
5466
|
-
((A = (C = (
|
|
5443
|
+
((A = (C = (M = t.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : C.projectionOffset) == null ? void 0 : A[1]) || 0
|
|
5467
5444
|
]
|
|
5468
5445
|
}
|
|
5469
5446
|
});
|
|
@@ -5474,18 +5451,18 @@ function br() {
|
|
|
5474
5451
|
/* @__PURE__ */ e(
|
|
5475
5452
|
pe,
|
|
5476
5453
|
{
|
|
5477
|
-
className: `h-9 w-full ${
|
|
5454
|
+
className: `h-9 w-full ${Be}`,
|
|
5478
5455
|
type: "number",
|
|
5479
5456
|
step: 10,
|
|
5480
|
-
value: ((
|
|
5457
|
+
value: ((B = (R = (U = t.preferences) == null ? void 0 : U.mapVisualOptions) == null ? void 0 : R.projectionOffset) == null ? void 0 : B[1]) || 0,
|
|
5481
5458
|
onChange: (m) => {
|
|
5482
|
-
var
|
|
5459
|
+
var y, M, C, A;
|
|
5483
5460
|
r({
|
|
5484
5461
|
...t.preferences,
|
|
5485
5462
|
mapVisualOptions: {
|
|
5486
|
-
...(
|
|
5463
|
+
...(y = t.preferences) == null ? void 0 : y.mapVisualOptions,
|
|
5487
5464
|
projectionOffset: [
|
|
5488
|
-
((A = (C = (
|
|
5465
|
+
((A = (C = (M = t.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : C.projectionOffset) == null ? void 0 : A[0]) || 0,
|
|
5489
5466
|
Number(m.target.value)
|
|
5490
5467
|
]
|
|
5491
5468
|
}
|
|
@@ -5498,7 +5475,7 @@ function br() {
|
|
|
5498
5475
|
/* @__PURE__ */ e(qe, {})
|
|
5499
5476
|
] });
|
|
5500
5477
|
}
|
|
5501
|
-
function
|
|
5478
|
+
function yr() {
|
|
5502
5479
|
var l;
|
|
5503
5480
|
const t = p((r) => r.card.preferences), { setCardPreferences: s } = p((r) => r.actions);
|
|
5504
5481
|
function a(r) {
|
|
@@ -5537,7 +5514,7 @@ function at({
|
|
|
5537
5514
|
}) {
|
|
5538
5515
|
return /* @__PURE__ */ e("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ n(Ee, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
5539
5516
|
/* @__PURE__ */ n(Z, { value: "item-1", children: [
|
|
5540
|
-
/* @__PURE__ */ e(X, { children: `${
|
|
5517
|
+
/* @__PURE__ */ e(X, { children: `${jt(t)} ${a}` }),
|
|
5541
5518
|
/* @__PURE__ */ e(Y, { children: s || /* @__PURE__ */ n("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5542
5519
|
/* @__PURE__ */ e("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
|
|
5543
5520
|
/* @__PURE__ */ n("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
@@ -5563,9 +5540,9 @@ function at({
|
|
|
5563
5540
|
/* @__PURE__ */ n(Z, { value: "item-2", children: [
|
|
5564
5541
|
/* @__PURE__ */ e(X, { children: "Settings" }),
|
|
5565
5542
|
/* @__PURE__ */ n(Y, { className: "space-y-4 px-2", children: [
|
|
5566
|
-
t === "range" && /* @__PURE__ */ e(
|
|
5567
|
-
t !== "text" && /* @__PURE__ */ e(
|
|
5568
|
-
t === "text" && /* @__PURE__ */ e(
|
|
5543
|
+
t === "range" && /* @__PURE__ */ e(yt, {}),
|
|
5544
|
+
t !== "text" && /* @__PURE__ */ e(Bt, {}),
|
|
5545
|
+
t === "text" && /* @__PURE__ */ e(yr, {})
|
|
5569
5546
|
] })
|
|
5570
5547
|
] }),
|
|
5571
5548
|
!["range", "text"].includes(t) && /* @__PURE__ */ n(Z, { value: "item-3", children: [
|
|
@@ -5577,7 +5554,7 @@ function at({
|
|
|
5577
5554
|
] })
|
|
5578
5555
|
] }) });
|
|
5579
5556
|
}
|
|
5580
|
-
function
|
|
5557
|
+
function vr() {
|
|
5581
5558
|
const t = p(
|
|
5582
5559
|
(l) => {
|
|
5583
5560
|
var r, i;
|
|
@@ -5588,7 +5565,7 @@ function yr() {
|
|
|
5588
5565
|
return /* @__PURE__ */ n("div", { className: "space-y-2", children: [
|
|
5589
5566
|
/* @__PURE__ */ e(G, { children: "Sort" }),
|
|
5590
5567
|
/* @__PURE__ */ e(
|
|
5591
|
-
|
|
5568
|
+
ye,
|
|
5592
5569
|
{
|
|
5593
5570
|
className: "h-8",
|
|
5594
5571
|
label: "Sort Chart",
|
|
@@ -5643,7 +5620,7 @@ function yr() {
|
|
|
5643
5620
|
/* @__PURE__ */ n(Z, { value: "item-2", children: [
|
|
5644
5621
|
/* @__PURE__ */ e(X, { children: "Settings" }),
|
|
5645
5622
|
/* @__PURE__ */ n(Y, { className: "space-y-4 px-2", children: [
|
|
5646
|
-
/* @__PURE__ */ e(
|
|
5623
|
+
/* @__PURE__ */ e(yt, {}),
|
|
5647
5624
|
a(),
|
|
5648
5625
|
/* @__PURE__ */ e(sn, {})
|
|
5649
5626
|
] })
|
|
@@ -5673,7 +5650,7 @@ function xr({}) {
|
|
|
5673
5650
|
] })
|
|
5674
5651
|
] }) }),
|
|
5675
5652
|
/* @__PURE__ */ n("div", { className: "flex items-center space-x-2", children: [
|
|
5676
|
-
/* @__PURE__ */ e(
|
|
5653
|
+
/* @__PURE__ */ e(Rt, { onCheckedChange: (l) => {
|
|
5677
5654
|
s({
|
|
5678
5655
|
...t,
|
|
5679
5656
|
allowDownload: l
|
|
@@ -5745,7 +5722,7 @@ function wr() {
|
|
|
5745
5722
|
switch (a) {
|
|
5746
5723
|
case "stackedBar":
|
|
5747
5724
|
case "stackedLine":
|
|
5748
|
-
return /* @__PURE__ */ e(
|
|
5725
|
+
return /* @__PURE__ */ e(vr, {});
|
|
5749
5726
|
case "pyramid":
|
|
5750
5727
|
return /* @__PURE__ */ e(at, { docContent: Nr, cardType: a });
|
|
5751
5728
|
case "kpi":
|
|
@@ -5782,7 +5759,7 @@ function wr() {
|
|
|
5782
5759
|
return /* @__PURE__ */ e(dr, {});
|
|
5783
5760
|
}
|
|
5784
5761
|
}
|
|
5785
|
-
return /* @__PURE__ */ n(
|
|
5762
|
+
return /* @__PURE__ */ n(Te, { className: "h-full w-full text-sm", children: [
|
|
5786
5763
|
s(t),
|
|
5787
5764
|
/* @__PURE__ */ e(He, { orientation: "horizontal" })
|
|
5788
5765
|
] });
|
|
@@ -5796,7 +5773,7 @@ function kr() {
|
|
|
5796
5773
|
className: "min-h-[250px] min-w-full max-w-lg",
|
|
5797
5774
|
children: [
|
|
5798
5775
|
/* @__PURE__ */ e(
|
|
5799
|
-
|
|
5776
|
+
we,
|
|
5800
5777
|
{
|
|
5801
5778
|
role: "query-section",
|
|
5802
5779
|
className: "flex",
|
|
@@ -5807,7 +5784,7 @@ function kr() {
|
|
|
5807
5784
|
),
|
|
5808
5785
|
/* @__PURE__ */ e(it, { withHandle: !0, className: "border" }),
|
|
5809
5786
|
/* @__PURE__ */ e(
|
|
5810
|
-
|
|
5787
|
+
we,
|
|
5811
5788
|
{
|
|
5812
5789
|
className: "pb-1",
|
|
5813
5790
|
role: "visual-section",
|
|
@@ -5815,7 +5792,7 @@ function kr() {
|
|
|
5815
5792
|
defaultSize: 60,
|
|
5816
5793
|
children: t ? /* @__PURE__ */ n(rt, { direction: "horizontal", children: [
|
|
5817
5794
|
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
|
|
5818
|
-
|
|
5795
|
+
we,
|
|
5819
5796
|
{
|
|
5820
5797
|
className: "flex min-w-[275px]",
|
|
5821
5798
|
minSize: 20,
|
|
@@ -5825,23 +5802,23 @@ function kr() {
|
|
|
5825
5802
|
}
|
|
5826
5803
|
) }),
|
|
5827
5804
|
/* @__PURE__ */ e(it, { className: "border" }),
|
|
5828
|
-
/* @__PURE__ */ e(
|
|
5829
|
-
] }) : /* @__PURE__ */ e(
|
|
5805
|
+
/* @__PURE__ */ e(we, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e(oa, {}) })
|
|
5806
|
+
] }) : /* @__PURE__ */ e(oa, {})
|
|
5830
5807
|
}
|
|
5831
5808
|
)
|
|
5832
5809
|
]
|
|
5833
5810
|
}
|
|
5834
5811
|
);
|
|
5835
5812
|
}
|
|
5836
|
-
function
|
|
5837
|
-
|
|
5838
|
-
const l = p((o) => o.actions.setOnSave), r = p((o) => o.actions.setOnClose), i =
|
|
5813
|
+
function zr({ authToken: t, onSave: s, onClose: a }) {
|
|
5814
|
+
T((o) => o.themeStyle);
|
|
5815
|
+
const l = p((o) => o.actions.setOnSave), r = p((o) => o.actions.setOnClose), i = T((o) => o.actions.setAuthToken);
|
|
5839
5816
|
return ce(() => {
|
|
5840
5817
|
s && l(s), a && r(a);
|
|
5841
5818
|
}, [s, l, a, r]), ce(() => {
|
|
5842
5819
|
t && t.accessToken && i(t);
|
|
5843
5820
|
}, [t, i]), /* @__PURE__ */ e(mt, { FallbackComponent: Fa, children: /* @__PURE__ */ n(
|
|
5844
|
-
|
|
5821
|
+
Ds,
|
|
5845
5822
|
{
|
|
5846
5823
|
style: {
|
|
5847
5824
|
// borderRadius: currentStyle?.chart?.options?.borderRadius,
|
|
@@ -5850,15 +5827,15 @@ function Or({ authToken: t, onSave: s, onClose: a }) {
|
|
|
5850
5827
|
className: "rounded-none",
|
|
5851
5828
|
role: "editor-panel",
|
|
5852
5829
|
children: [
|
|
5853
|
-
/* @__PURE__ */ e(
|
|
5854
|
-
/* @__PURE__ */ e(
|
|
5830
|
+
/* @__PURE__ */ e(Is, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e(Pa, {}) }),
|
|
5831
|
+
/* @__PURE__ */ e(Ls, { children: /* @__PURE__ */ e(kr, {}) })
|
|
5855
5832
|
]
|
|
5856
5833
|
}
|
|
5857
5834
|
) });
|
|
5858
5835
|
}
|
|
5859
|
-
function
|
|
5860
|
-
|
|
5861
|
-
const t =
|
|
5836
|
+
function Or() {
|
|
5837
|
+
T((o) => o.selectedCardId);
|
|
5838
|
+
const t = T((o) => o.selectedSheetId), { setIsVisualEditing: s } = T((o) => o.actions), a = T((o) => o.isVisualEditing), l = T((o) => o.actions.updateFrame);
|
|
5862
5839
|
function r(o) {
|
|
5863
5840
|
t && (l(t, o), s(!1));
|
|
5864
5841
|
}
|
|
@@ -5872,13 +5849,13 @@ function zr() {
|
|
|
5872
5849
|
className: ee("flex grow", {
|
|
5873
5850
|
"max-h-0 overflow-hidden": !a
|
|
5874
5851
|
}),
|
|
5875
|
-
children: /* @__PURE__ */ e(
|
|
5852
|
+
children: /* @__PURE__ */ e(zr, { onSave: r, onClose: i })
|
|
5876
5853
|
}
|
|
5877
5854
|
);
|
|
5878
5855
|
}
|
|
5879
|
-
function
|
|
5880
|
-
const t = p((i) => i.selectedDatabaseName), s = p((i) => i.selectedTableName), a =
|
|
5881
|
-
return /* @__PURE__ */ e(
|
|
5856
|
+
function Tr() {
|
|
5857
|
+
const t = p((i) => i.selectedDatabaseName), s = p((i) => i.selectedTableName), a = T((i) => i.dashboard.filters) || [], { columns: l } = Ae(), { assignFilter: r } = rn();
|
|
5858
|
+
return /* @__PURE__ */ e(Te, { className: "flex-1 basis-0 flex-col px-3", children: l == null ? void 0 : l.map((i) => {
|
|
5882
5859
|
const o = a == null ? void 0 : a.find(
|
|
5883
5860
|
(c) => c.column === be(i.column_name) && c.table === s && c.database === t
|
|
5884
5861
|
);
|
|
@@ -5901,21 +5878,21 @@ function Ir() {
|
|
|
5901
5878
|
);
|
|
5902
5879
|
}) });
|
|
5903
5880
|
}
|
|
5904
|
-
function
|
|
5905
|
-
|
|
5906
|
-
const t =
|
|
5881
|
+
function Mr() {
|
|
5882
|
+
T((s) => s.showFilters);
|
|
5883
|
+
const t = T(
|
|
5907
5884
|
(s) => s.actions.setShowFilters
|
|
5908
5885
|
);
|
|
5909
5886
|
return /* @__PURE__ */ n("section", { className: "relative flex min-w-[320px] grow flex-col border-l px-1", children: [
|
|
5910
5887
|
/* @__PURE__ */ n("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
|
|
5911
5888
|
/* @__PURE__ */ e(G, { className: "px-2 text-lg", children: "Filters" }),
|
|
5912
5889
|
/* @__PURE__ */ e(
|
|
5913
|
-
|
|
5890
|
+
I,
|
|
5914
5891
|
{
|
|
5915
5892
|
onClick: () => t(!1),
|
|
5916
5893
|
className: "h-7 w-7 p-0",
|
|
5917
5894
|
variant: "ghost",
|
|
5918
|
-
children: /* @__PURE__ */ e(
|
|
5895
|
+
children: /* @__PURE__ */ e(ut, {})
|
|
5919
5896
|
}
|
|
5920
5897
|
)
|
|
5921
5898
|
] }),
|
|
@@ -5925,7 +5902,7 @@ function Tr() {
|
|
|
5925
5902
|
ColumnsComponent: () => (
|
|
5926
5903
|
// schemaName, tableName, columns
|
|
5927
5904
|
/* @__PURE__ */ e(
|
|
5928
|
-
|
|
5905
|
+
Tr,
|
|
5929
5906
|
{}
|
|
5930
5907
|
)
|
|
5931
5908
|
)
|
|
@@ -5934,7 +5911,7 @@ function Tr() {
|
|
|
5934
5911
|
] });
|
|
5935
5912
|
}
|
|
5936
5913
|
function Dr() {
|
|
5937
|
-
const t =
|
|
5914
|
+
const t = T((l) => l.dashboard.filters), s = T((l) => l.theme), a = t == null ? void 0 : t.filter((l) => l.hide);
|
|
5938
5915
|
return a != null && a.length ? /* @__PURE__ */ e(
|
|
5939
5916
|
"div",
|
|
5940
5917
|
{
|
|
@@ -5948,7 +5925,7 @@ function Dr() {
|
|
|
5948
5925
|
className: "flex min-w-[250px] max-w-fit flex-col gap-1 p-2",
|
|
5949
5926
|
children: [
|
|
5950
5927
|
/* @__PURE__ */ e(La, { filter: l }),
|
|
5951
|
-
/* @__PURE__ */ e(
|
|
5928
|
+
/* @__PURE__ */ e(Oa, { filter: l })
|
|
5952
5929
|
]
|
|
5953
5930
|
},
|
|
5954
5931
|
l.id
|
|
@@ -5956,8 +5933,8 @@ function Dr() {
|
|
|
5956
5933
|
}
|
|
5957
5934
|
) : null;
|
|
5958
5935
|
}
|
|
5959
|
-
function
|
|
5960
|
-
const t =
|
|
5936
|
+
function Ir() {
|
|
5937
|
+
const t = T((l) => l.showFilters), s = T((l) => l.isVisualEditing), a = T(
|
|
5961
5938
|
(l) => l.isDashboardEditing
|
|
5962
5939
|
);
|
|
5963
5940
|
return /* @__PURE__ */ n(
|
|
@@ -5973,17 +5950,17 @@ function Mr() {
|
|
|
5973
5950
|
children: [
|
|
5974
5951
|
/* @__PURE__ */ n("section", { className: "flex grow flex-col", children: [
|
|
5975
5952
|
a && /* @__PURE__ */ e(Dr, {}),
|
|
5976
|
-
/* @__PURE__ */ e(
|
|
5953
|
+
/* @__PURE__ */ e(Fs, {})
|
|
5977
5954
|
] }),
|
|
5978
|
-
t && /* @__PURE__ */ e("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e(
|
|
5955
|
+
t && /* @__PURE__ */ e("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e(Mr, {}) })
|
|
5979
5956
|
]
|
|
5980
5957
|
}
|
|
5981
5958
|
);
|
|
5982
5959
|
}
|
|
5983
5960
|
function Lr() {
|
|
5984
|
-
const t =
|
|
5961
|
+
const t = T((r) => r.dashboard), s = T((r) => r.actions.setDashboard), a = T(
|
|
5985
5962
|
(r) => r.showDashboardJSON
|
|
5986
|
-
), l =
|
|
5963
|
+
), l = T(
|
|
5987
5964
|
(r) => r.actions.setShowDashboardJSON
|
|
5988
5965
|
);
|
|
5989
5966
|
return /* @__PURE__ */ n(
|
|
@@ -5994,20 +5971,20 @@ function Lr() {
|
|
|
5994
5971
|
}),
|
|
5995
5972
|
children: [
|
|
5996
5973
|
/* @__PURE__ */ n(
|
|
5997
|
-
|
|
5974
|
+
I,
|
|
5998
5975
|
{
|
|
5999
5976
|
variant: "secondary",
|
|
6000
5977
|
size: "sm",
|
|
6001
5978
|
className: "absolute right-2 top-2 z-10 h-8",
|
|
6002
5979
|
onClick: () => l(!1),
|
|
6003
5980
|
children: [
|
|
6004
|
-
/* @__PURE__ */ e(
|
|
5981
|
+
/* @__PURE__ */ e(Ye, { className: "mr-2 h-4 w-4" }),
|
|
6005
5982
|
"Close"
|
|
6006
5983
|
]
|
|
6007
5984
|
}
|
|
6008
5985
|
),
|
|
6009
5986
|
/* @__PURE__ */ e(
|
|
6010
|
-
|
|
5987
|
+
Vs,
|
|
6011
5988
|
{
|
|
6012
5989
|
onChange: (r) => {
|
|
6013
5990
|
if (r)
|
|
@@ -6044,14 +6021,14 @@ function qr({
|
|
|
6044
6021
|
showFooter: s = !0,
|
|
6045
6022
|
...a
|
|
6046
6023
|
}) {
|
|
6047
|
-
return /* @__PURE__ */ e(mt, { FallbackComponent: Fa, children: /* @__PURE__ */ n(
|
|
6048
|
-
/* @__PURE__ */ e(
|
|
6049
|
-
/* @__PURE__ */ n(
|
|
6024
|
+
return /* @__PURE__ */ e(mt, { FallbackComponent: Fa, children: /* @__PURE__ */ n(Es, { dashboardProps: a, children: [
|
|
6025
|
+
/* @__PURE__ */ e(As, {}),
|
|
6026
|
+
/* @__PURE__ */ n(qs, { children: [
|
|
6050
6027
|
/* @__PURE__ */ e(Lr, {}),
|
|
6051
|
-
/* @__PURE__ */ n(
|
|
6052
|
-
t && /* @__PURE__ */ e(
|
|
6053
|
-
/* @__PURE__ */ e(
|
|
6054
|
-
/* @__PURE__ */ e(
|
|
6028
|
+
/* @__PURE__ */ n(Rs, { ...a, children: [
|
|
6029
|
+
t && /* @__PURE__ */ e(Nl, {}),
|
|
6030
|
+
/* @__PURE__ */ e(Or, {}),
|
|
6031
|
+
/* @__PURE__ */ e(Ir, {})
|
|
6055
6032
|
] })
|
|
6056
6033
|
] })
|
|
6057
6034
|
] }) });
|
|
@@ -6059,30 +6036,30 @@ function qr({
|
|
|
6059
6036
|
export {
|
|
6060
6037
|
_r as Dashboard,
|
|
6061
6038
|
Hr as DashboardWC,
|
|
6062
|
-
|
|
6039
|
+
Ue as SelectComponent,
|
|
6063
6040
|
Pr as SemaphorDataProvider,
|
|
6064
6041
|
$r as SemaphorQueryClient,
|
|
6065
6042
|
qr as Surfboard,
|
|
6066
|
-
|
|
6043
|
+
ml as cleanCard,
|
|
6067
6044
|
xa as createSqlGenConfig,
|
|
6068
6045
|
vl as downloadPdf,
|
|
6069
6046
|
be as fmt,
|
|
6070
|
-
|
|
6047
|
+
Ur as getColumnDataType,
|
|
6071
6048
|
_a as getDashbaordStateWithoutData,
|
|
6072
|
-
|
|
6049
|
+
Br as getFilterValueType,
|
|
6073
6050
|
St as getFormattedTableNameForQuery,
|
|
6074
|
-
|
|
6051
|
+
xs as getQualifiedTableName,
|
|
6075
6052
|
Na as getSql,
|
|
6076
6053
|
hn as invalidateToken,
|
|
6077
|
-
|
|
6078
|
-
|
|
6054
|
+
yn as isBooleanDataType,
|
|
6055
|
+
vn as isColumnInSqlGen,
|
|
6079
6056
|
gn as isDateDataType,
|
|
6080
6057
|
Ca as isNumberDataType,
|
|
6081
6058
|
fn as isTextDataType,
|
|
6082
6059
|
Gr as resolveDataType,
|
|
6083
6060
|
Jr as useCard,
|
|
6084
|
-
|
|
6085
|
-
|
|
6061
|
+
Ze as useDashboardActions,
|
|
6062
|
+
T as useDashboardStore,
|
|
6086
6063
|
Wr as useDateFilterHook,
|
|
6087
6064
|
de as useEditorActions,
|
|
6088
6065
|
Ae as useEditorAside,
|