semaphor 0.0.79 → 0.0.81
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-BKVjVA8S.js +60635 -0
- package/dist/chunks/index-CERhp7TQ.js +245 -0
- package/dist/chunks/index-D5fUelI7.js +367 -0
- package/dist/chunks/{index-xD7LZFEm.js → index-DxQQOmb2.js} +907 -920
- package/dist/chunks/{lucide-react-gzKKmZHH.js → lucide-react-CDOQx4us.js} +1 -1
- package/dist/chunks/{lucide-react-DAVXh0-V.js → lucide-react-CRf9jpQL.js} +6 -8
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +2 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +12 -12
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -5
- package/dist/types/dashboard.d.ts +5 -0
- package/dist/types/main.d.ts +35 -1656
- package/dist/types/surfboard.d.ts +5 -0
- package/dist/types/types.d.ts +5 -0
- package/package.json +39 -33
- package/dist/chunks/index-5EyduRKw.js +0 -245
- package/dist/chunks/index-7j85QQRg.js +0 -61900
- package/dist/chunks/index-tJEATyF7.js +0 -443
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as q, p as hs, u as z, n as
|
|
1
|
+
import { c as q, p as hs, u as z, n as Is, o as ve, q as e, r as Ts, s as Ds, t as F, j as Ms, v as Ls, w as Es, x as As, y as Vs, L as H, z as re, A as oa, E as ca, H as da, J as ua, K as rt, M as it, N as ot, O as Ys, Q as W, R as Je, V as u, W as ct, F as ha, Y as We, Z as Ye, _ as qs, $ as ma, a0 as Rs, a1 as fe, a2 as ge, a3 as je, a4 as be, a5 as Oe, a6 as ye, a7 as Q, T as _s, a8 as Hs, a9 as $s, aa as Ps, ab as xa, ac as pa, ad as xe, ae as dt, af as ut, ag as fa, ah as ht, C as mt, ai as xt, aj as ga, B as pt, ak as ms, al as ft, am as Xs, an as ja, ao as Ss, ap as me, aq as ke, ar as de, as as xs, at as ba, au as gt, av as jt, aw as ya, ax as bt, ay as yt, az as vt, aA as Ct, aB as Nt, aC as qe, aD as ws, aE as St, a as wt, aF as Ke, aG as ks, aH as Ve, aI as Os, aJ as kt, aK as Ot, aL as zt, aM as Ft, aN as It, aO as Tt, aP as Ns, aQ as Dt, aR as Zs, aS as Mt, aT as ea, aU as Lt, aV as Et, aW as At, aX as Vt, aY as va, aZ as ce, a_ as Bs, a$ as Ca, b0 as qt, b1 as Rt, b2 as rs, b3 as _t, b4 as Ht, b5 as $t, b6 as Pt, b7 as Bt, b8 as Ut, b9 as Gt, l as Kt, ba as ps, bb as Na, bc as Sa, bd as wa, be as is, bf as ka, bg as os, bh as sa, bi as Qt, bj as Jt, bk as fs, bl as gs, bm as js, bn as Wt, bo as Yt, X as Oa, bp as Xt, bq as Zt, br as en, bs, bt as Te, f as sn, bu as Ge, bv as za, bw as an, bx as tn, by as cs, bz as nn, bA as ln, bB as rn, bC as aa, bD as on, bE as cn, bF as dn, bG as un, bH as hn, bI as mn, bJ as xn, bK as pn, bL as De, bM as U, bN as G, bO as Us, bP as K, bQ as fn, bR as Fa, bS as gn, bT as jn, bU as bn, bV as yn, bW as vn, bX as Cn, bY as Nn, bZ as Sn, b_ as wn } from "./index-BKVjVA8S.js";
|
|
2
2
|
import * as ta from "react";
|
|
3
|
-
import ze, { useState as R, useMemo as zs, useEffect as Z, useRef as Xe, Suspense as
|
|
3
|
+
import ze, { useState as R, useMemo as zs, useEffect as Z, useRef as Xe, Suspense as kn } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -8,7 +8,7 @@ import "react-dom";
|
|
|
8
8
|
* This source code is licensed under the ISC license.
|
|
9
9
|
* See the LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
11
|
+
const On = q("Box", [
|
|
12
12
|
[
|
|
13
13
|
"path",
|
|
14
14
|
{
|
|
@@ -104,7 +104,7 @@ const Da = q("ChartScatter", [
|
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
106
|
*/
|
|
107
|
-
const
|
|
107
|
+
const Fn = q("CircleX", [
|
|
108
108
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
109
109
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
110
110
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -115,7 +115,7 @@ const On = q("CircleX", [
|
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
117
|
*/
|
|
118
|
-
const
|
|
118
|
+
const In = q("CopyPlus", [
|
|
119
119
|
["line", { x1: "15", x2: "15", y1: "12", y2: "18", key: "1p7wdc" }],
|
|
120
120
|
["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
|
|
121
121
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
@@ -127,7 +127,7 @@ const Fn = q("CopyPlus", [
|
|
|
127
127
|
* This source code is licensed under the ISC license.
|
|
128
128
|
* See the LICENSE file in the root directory of this source tree.
|
|
129
129
|
*/
|
|
130
|
-
const
|
|
130
|
+
const Tn = q("Database", [
|
|
131
131
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
132
132
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
133
133
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
@@ -149,7 +149,7 @@ const Ma = q("EllipsisVertical", [
|
|
|
149
149
|
* This source code is licensed under the ISC license.
|
|
150
150
|
* See the LICENSE file in the root directory of this source tree.
|
|
151
151
|
*/
|
|
152
|
-
const
|
|
152
|
+
const Dn = q("Eraser", [
|
|
153
153
|
[
|
|
154
154
|
"path",
|
|
155
155
|
{
|
|
@@ -166,7 +166,7 @@ const Tn = q("Eraser", [
|
|
|
166
166
|
* This source code is licensed under the ISC license.
|
|
167
167
|
* See the LICENSE file in the root directory of this source tree.
|
|
168
168
|
*/
|
|
169
|
-
const
|
|
169
|
+
const Mn = q("EyeClosed", [
|
|
170
170
|
["path", { d: "m15 18-.722-3.25", key: "1j64jw" }],
|
|
171
171
|
["path", { d: "M2 8a10.645 10.645 0 0 0 20 0", key: "1e7gxb" }],
|
|
172
172
|
["path", { d: "m20 15-1.726-2.05", key: "1cnuld" }],
|
|
@@ -179,7 +179,7 @@ const Dn = q("EyeClosed", [
|
|
|
179
179
|
* This source code is licensed under the ISC license.
|
|
180
180
|
* See the LICENSE file in the root directory of this source tree.
|
|
181
181
|
*/
|
|
182
|
-
const
|
|
182
|
+
const Ln = q("Eye", [
|
|
183
183
|
[
|
|
184
184
|
"path",
|
|
185
185
|
{
|
|
@@ -195,7 +195,7 @@ const Mn = q("Eye", [
|
|
|
195
195
|
* This source code is licensed under the ISC license.
|
|
196
196
|
* See the LICENSE file in the root directory of this source tree.
|
|
197
197
|
*/
|
|
198
|
-
const
|
|
198
|
+
const En = q("Glasses", [
|
|
199
199
|
["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
|
|
200
200
|
["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
|
|
201
201
|
["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
|
|
@@ -208,7 +208,7 @@ const Ln = q("Glasses", [
|
|
|
208
208
|
* This source code is licensed under the ISC license.
|
|
209
209
|
* See the LICENSE file in the root directory of this source tree.
|
|
210
210
|
*/
|
|
211
|
-
const
|
|
211
|
+
const An = q("Hammer", [
|
|
212
212
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
213
213
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
214
214
|
[
|
|
@@ -225,7 +225,7 @@ const En = q("Hammer", [
|
|
|
225
225
|
* This source code is licensed under the ISC license.
|
|
226
226
|
* See the LICENSE file in the root directory of this source tree.
|
|
227
227
|
*/
|
|
228
|
-
const
|
|
228
|
+
const Vn = q("Hash", [
|
|
229
229
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
230
230
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
231
231
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
@@ -237,7 +237,7 @@ const An = q("Hash", [
|
|
|
237
237
|
* This source code is licensed under the ISC license.
|
|
238
238
|
* See the LICENSE file in the root directory of this source tree.
|
|
239
239
|
*/
|
|
240
|
-
const
|
|
240
|
+
const qn = q("House", [
|
|
241
241
|
["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
|
|
242
242
|
[
|
|
243
243
|
"path",
|
|
@@ -264,7 +264,7 @@ const La = q("Key", [
|
|
|
264
264
|
* This source code is licensed under the ISC license.
|
|
265
265
|
* See the LICENSE file in the root directory of this source tree.
|
|
266
266
|
*/
|
|
267
|
-
const
|
|
267
|
+
const Rn = q("ListEnd", [
|
|
268
268
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
269
269
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
270
270
|
["path", { d: "M10 18H3", key: "13769t" }],
|
|
@@ -277,7 +277,7 @@ const qn = q("ListEnd", [
|
|
|
277
277
|
* This source code is licensed under the ISC license.
|
|
278
278
|
* See the LICENSE file in the root directory of this source tree.
|
|
279
279
|
*/
|
|
280
|
-
const
|
|
280
|
+
const _n = q("ListStart", [
|
|
281
281
|
["path", { d: "M16 12H3", key: "1a2rj7" }],
|
|
282
282
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
283
283
|
["path", { d: "M10 6H3", key: "lf8lx7" }],
|
|
@@ -290,7 +290,7 @@ const Rn = q("ListStart", [
|
|
|
290
290
|
* This source code is licensed under the ISC license.
|
|
291
291
|
* See the LICENSE file in the root directory of this source tree.
|
|
292
292
|
*/
|
|
293
|
-
const
|
|
293
|
+
const Hn = q("ListX", [
|
|
294
294
|
["path", { d: "M11 12H3", key: "51ecnj" }],
|
|
295
295
|
["path", { d: "M16 6H3", key: "1wxfjs" }],
|
|
296
296
|
["path", { d: "M16 18H3", key: "12xzn7" }],
|
|
@@ -329,7 +329,7 @@ const Ea = q("Map", [
|
|
|
329
329
|
* This source code is licensed under the ISC license.
|
|
330
330
|
* See the LICENSE file in the root directory of this source tree.
|
|
331
331
|
*/
|
|
332
|
-
const
|
|
332
|
+
const $n = q("MessageSquareMore", [
|
|
333
333
|
["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" }],
|
|
334
334
|
["path", { d: "M8 10h.01", key: "19clt8" }],
|
|
335
335
|
["path", { d: "M12 10h.01", key: "1nrarc" }],
|
|
@@ -341,7 +341,7 @@ const Hn = q("MessageSquareMore", [
|
|
|
341
341
|
* This source code is licensed under the ISC license.
|
|
342
342
|
* See the LICENSE file in the root directory of this source tree.
|
|
343
343
|
*/
|
|
344
|
-
const
|
|
344
|
+
const Pn = q("Network", [
|
|
345
345
|
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
|
|
346
346
|
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
|
|
347
347
|
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
|
|
@@ -370,7 +370,7 @@ const Aa = q("Pencil", [
|
|
|
370
370
|
* This source code is licensed under the ISC license.
|
|
371
371
|
* See the LICENSE file in the root directory of this source tree.
|
|
372
372
|
*/
|
|
373
|
-
const
|
|
373
|
+
const Bn = q("Play", [
|
|
374
374
|
["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
|
|
375
375
|
]);
|
|
376
376
|
/**
|
|
@@ -379,7 +379,7 @@ const Pn = q("Play", [
|
|
|
379
379
|
* This source code is licensed under the ISC license.
|
|
380
380
|
* See the LICENSE file in the root directory of this source tree.
|
|
381
381
|
*/
|
|
382
|
-
const
|
|
382
|
+
const Un = q("Plug2", [
|
|
383
383
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
384
384
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
385
385
|
["path", { d: "M12 17v5", key: "bb1du9" }],
|
|
@@ -392,7 +392,7 @@ const Bn = q("Plug2", [
|
|
|
392
392
|
* This source code is licensed under the ISC license.
|
|
393
393
|
* See the LICENSE file in the root directory of this source tree.
|
|
394
394
|
*/
|
|
395
|
-
const
|
|
395
|
+
const Gn = q("Save", [
|
|
396
396
|
[
|
|
397
397
|
"path",
|
|
398
398
|
{
|
|
@@ -426,7 +426,7 @@ const Va = q("Shapes", [
|
|
|
426
426
|
* This source code is licensed under the ISC license.
|
|
427
427
|
* See the LICENSE file in the root directory of this source tree.
|
|
428
428
|
*/
|
|
429
|
-
const
|
|
429
|
+
const Kn = q("ShieldQuestion", [
|
|
430
430
|
[
|
|
431
431
|
"path",
|
|
432
432
|
{
|
|
@@ -443,7 +443,7 @@ const Gn = q("ShieldQuestion", [
|
|
|
443
443
|
* This source code is licensed under the ISC license.
|
|
444
444
|
* See the LICENSE file in the root directory of this source tree.
|
|
445
445
|
*/
|
|
446
|
-
const
|
|
446
|
+
const Qn = q("Sigma", [
|
|
447
447
|
[
|
|
448
448
|
"path",
|
|
449
449
|
{
|
|
@@ -458,7 +458,7 @@ const Kn = q("Sigma", [
|
|
|
458
458
|
* This source code is licensed under the ISC license.
|
|
459
459
|
* See the LICENSE file in the root directory of this source tree.
|
|
460
460
|
*/
|
|
461
|
-
const
|
|
461
|
+
const Jn = q("SwatchBook", [
|
|
462
462
|
["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
|
|
463
463
|
["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
|
|
464
464
|
["path", { d: "M 7 17h.01", key: "1euzgo" }],
|
|
@@ -476,7 +476,7 @@ const Qn = q("SwatchBook", [
|
|
|
476
476
|
* This source code is licensed under the ISC license.
|
|
477
477
|
* See the LICENSE file in the root directory of this source tree.
|
|
478
478
|
*/
|
|
479
|
-
const
|
|
479
|
+
const Wn = q("Tag", [
|
|
480
480
|
[
|
|
481
481
|
"path",
|
|
482
482
|
{
|
|
@@ -492,7 +492,7 @@ const Jn = q("Tag", [
|
|
|
492
492
|
* This source code is licensed under the ISC license.
|
|
493
493
|
* See the LICENSE file in the root directory of this source tree.
|
|
494
494
|
*/
|
|
495
|
-
const
|
|
495
|
+
const Yn = q("ToggleLeft", [
|
|
496
496
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "6", ry: "6", key: "f2vt7d" }],
|
|
497
497
|
["circle", { cx: "8", cy: "12", r: "2", key: "1nvbw3" }]
|
|
498
498
|
]);
|
|
@@ -513,7 +513,7 @@ const Qs = q("Type", [
|
|
|
513
513
|
* This source code is licensed under the ISC license.
|
|
514
514
|
* See the LICENSE file in the root directory of this source tree.
|
|
515
515
|
*/
|
|
516
|
-
const
|
|
516
|
+
const Xn = q("User", [
|
|
517
517
|
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
518
518
|
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
519
519
|
]);
|
|
@@ -526,17 +526,17 @@ function qa(s) {
|
|
|
526
526
|
return {
|
|
527
527
|
...a,
|
|
528
528
|
frames: (n = a.frames) == null ? void 0 : n.map((l) => {
|
|
529
|
-
var
|
|
529
|
+
var o;
|
|
530
530
|
return {
|
|
531
531
|
...l,
|
|
532
|
-
cards: (
|
|
532
|
+
cards: (o = l.cards) == null ? void 0 : o.map((r) => Zn(r))
|
|
533
533
|
};
|
|
534
534
|
})
|
|
535
535
|
};
|
|
536
536
|
})
|
|
537
537
|
};
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function Zn(s) {
|
|
540
540
|
var t, a, n, l;
|
|
541
541
|
return {
|
|
542
542
|
...s,
|
|
@@ -545,18 +545,18 @@ function Xn(s) {
|
|
|
545
545
|
data: {
|
|
546
546
|
...(t = s.cfg) == null ? void 0 : t.data,
|
|
547
547
|
labels: [],
|
|
548
|
-
datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((
|
|
549
|
-
...
|
|
548
|
+
datasets: (l = (n = (a = s.cfg) == null ? void 0 : a.data) == null ? void 0 : n.datasets) == null ? void 0 : l.map((o) => ({
|
|
549
|
+
...o,
|
|
550
550
|
data: []
|
|
551
551
|
}))
|
|
552
552
|
}
|
|
553
553
|
},
|
|
554
|
-
customCfg:
|
|
554
|
+
customCfg: el(s.customCfg),
|
|
555
555
|
// if customCfg is present, clean it, otherwise return null{
|
|
556
556
|
data: []
|
|
557
557
|
};
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function el(s) {
|
|
560
560
|
var t, a;
|
|
561
561
|
return s ? {
|
|
562
562
|
...s,
|
|
@@ -570,7 +570,7 @@ function Zn(s) {
|
|
|
570
570
|
}
|
|
571
571
|
} : null;
|
|
572
572
|
}
|
|
573
|
-
async function
|
|
573
|
+
async function sl(s, t, a, n) {
|
|
574
574
|
if (!n)
|
|
575
575
|
return null;
|
|
576
576
|
const l = JSON.stringify(t);
|
|
@@ -581,56 +581,56 @@ async function el(s, t, a, n) {
|
|
|
581
581
|
operation: "create"
|
|
582
582
|
});
|
|
583
583
|
}
|
|
584
|
-
async function
|
|
584
|
+
async function Fs(s, t) {
|
|
585
585
|
if (!t)
|
|
586
586
|
return null;
|
|
587
|
-
const { id: a, template: n, filterValues: l, isDefault:
|
|
587
|
+
const { id: a, template: n, filterValues: l, isDefault: o, shared: r } = s;
|
|
588
588
|
return await hs("https://semaphor.cloud/api/v1/lens", t, {
|
|
589
589
|
lensId: a,
|
|
590
590
|
template: n,
|
|
591
591
|
filterValues: l,
|
|
592
|
-
isDefault:
|
|
592
|
+
isDefault: o,
|
|
593
593
|
shared: r,
|
|
594
594
|
operation: "update"
|
|
595
595
|
});
|
|
596
596
|
}
|
|
597
|
-
async function
|
|
597
|
+
async function al(s, t) {
|
|
598
598
|
return t ? await hs("https://semaphor.cloud/api/v1/lens", t, {
|
|
599
599
|
operation: "delete",
|
|
600
600
|
lensId: s
|
|
601
601
|
}) : null;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
const [s, t] = R(""), [a, n] = R(!1), l = z((j) => j.lenses), { setLenses:
|
|
603
|
+
function tl() {
|
|
604
|
+
const [s, t] = R(""), [a, n] = R(!1), l = z((j) => j.lenses), { setLenses: o, setSelectedLensId: r } = Is(), [c, i] = R(!1), [x, d] = R(!1), y = z((j) => j.dashboard), f = z((j) => j.filterValues), { authToken: m } = ve();
|
|
605
605
|
async function g() {
|
|
606
|
-
|
|
606
|
+
i(!0);
|
|
607
607
|
const j = qa(
|
|
608
608
|
y
|
|
609
|
-
),
|
|
609
|
+
), T = await sl(
|
|
610
610
|
s,
|
|
611
611
|
j,
|
|
612
612
|
f,
|
|
613
613
|
m == null ? void 0 : m.accessToken
|
|
614
614
|
);
|
|
615
|
-
|
|
615
|
+
T && (o([...l || [], T]), r(T.id), d(!1)), i(!1);
|
|
616
616
|
}
|
|
617
|
-
return /* @__PURE__ */ e.jsxs(
|
|
618
|
-
/* @__PURE__ */ e.jsx(
|
|
617
|
+
return /* @__PURE__ */ e.jsxs(Ts, { open: x, onOpenChange: d, children: [
|
|
618
|
+
/* @__PURE__ */ e.jsx(Ds, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
619
619
|
F,
|
|
620
620
|
{
|
|
621
621
|
variant: "secondary",
|
|
622
622
|
className: "h-7 p-2",
|
|
623
623
|
size: "sm",
|
|
624
624
|
children: [
|
|
625
|
-
/* @__PURE__ */ e.jsx(
|
|
625
|
+
/* @__PURE__ */ e.jsx(Ms, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
626
626
|
"Lens"
|
|
627
627
|
]
|
|
628
628
|
}
|
|
629
629
|
) }),
|
|
630
|
-
/* @__PURE__ */ e.jsxs(
|
|
631
|
-
/* @__PURE__ */ e.jsxs(
|
|
632
|
-
/* @__PURE__ */ e.jsx(
|
|
633
|
-
/* @__PURE__ */ e.jsx(
|
|
630
|
+
/* @__PURE__ */ e.jsxs(Ls, { className: "sm:max-w-[425px]", children: [
|
|
631
|
+
/* @__PURE__ */ e.jsxs(Es, { children: [
|
|
632
|
+
/* @__PURE__ */ e.jsx(As, { children: "Create Lens" }),
|
|
633
|
+
/* @__PURE__ */ e.jsx(Vs, { children: "Lenses are private by default and are only visible to you." })
|
|
634
634
|
] }),
|
|
635
635
|
/* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
|
|
636
636
|
/* @__PURE__ */ e.jsx(H, { className: "text-right", children: "Name" }),
|
|
@@ -661,15 +661,15 @@ function al() {
|
|
|
661
661
|
] })
|
|
662
662
|
] });
|
|
663
663
|
}
|
|
664
|
-
function
|
|
665
|
-
const [s, t] = R(!1), a = z((d) => d.lenses), n = z((d) => d.selectedLensId), { setLenses: l, setSelectedLensId:
|
|
664
|
+
function nl() {
|
|
665
|
+
const [s, t] = R(!1), a = z((d) => d.lenses), n = z((d) => d.selectedLensId), { setLenses: l, setSelectedLensId: o } = Is(), { authToken: r } = ve();
|
|
666
666
|
async function c(d) {
|
|
667
|
-
|
|
667
|
+
o(d);
|
|
668
668
|
}
|
|
669
|
-
async function
|
|
670
|
-
if (await
|
|
669
|
+
async function i(d) {
|
|
670
|
+
if (await al(d, r == null ? void 0 : r.accessToken)) {
|
|
671
671
|
const f = a == null ? void 0 : a.filter((m) => m.id !== d);
|
|
672
|
-
l(f || []),
|
|
672
|
+
l(f || []), o("original");
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
675
|
async function x(d) {
|
|
@@ -685,18 +685,18 @@ function tl() {
|
|
|
685
685
|
...d,
|
|
686
686
|
isDefault: !d.isDefault
|
|
687
687
|
};
|
|
688
|
-
await
|
|
688
|
+
await Fs(f, r == null ? void 0 : r.accessToken);
|
|
689
689
|
const m = a == null ? void 0 : a.find((g) => g.isDefault);
|
|
690
690
|
if (m && m.id !== d.id) {
|
|
691
691
|
const g = {
|
|
692
692
|
...m,
|
|
693
693
|
isDefault: !1
|
|
694
694
|
};
|
|
695
|
-
await
|
|
695
|
+
await Fs(g, r == null ? void 0 : r.accessToken);
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
698
|
return /* @__PURE__ */ e.jsxs(ca, { open: s, onOpenChange: t, children: [
|
|
699
|
-
/* @__PURE__ */ e.jsx(da, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(
|
|
699
|
+
/* @__PURE__ */ e.jsx(da, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { variant: "ghost", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(En, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
|
|
700
700
|
/* @__PURE__ */ e.jsxs(ua, { align: "end", className: "w-60", children: [
|
|
701
701
|
/* @__PURE__ */ e.jsx(rt, { className: "px-3", children: "Lenses" }),
|
|
702
702
|
/* @__PURE__ */ e.jsx(it, {}),
|
|
@@ -716,7 +716,7 @@ function tl() {
|
|
|
716
716
|
/* @__PURE__ */ e.jsx("p", { children: d.name }),
|
|
717
717
|
/* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-3", children: [
|
|
718
718
|
/* @__PURE__ */ e.jsx(
|
|
719
|
-
|
|
719
|
+
qn,
|
|
720
720
|
{
|
|
721
721
|
onClick: (y) => {
|
|
722
722
|
y.preventDefault(), x(d);
|
|
@@ -735,7 +735,7 @@ function tl() {
|
|
|
735
735
|
Je,
|
|
736
736
|
{
|
|
737
737
|
onClick: (y) => {
|
|
738
|
-
y.preventDefault(),
|
|
738
|
+
y.preventDefault(), i(d.id);
|
|
739
739
|
},
|
|
740
740
|
className: "invisible size-3.5 text-muted-foreground hover:cursor-pointer hover:text-foreground group-hover:visible",
|
|
741
741
|
strokeWidth: 1.5
|
|
@@ -752,14 +752,14 @@ function tl() {
|
|
|
752
752
|
] })
|
|
753
753
|
] });
|
|
754
754
|
}
|
|
755
|
-
function
|
|
756
|
-
const { authToken: s } =
|
|
755
|
+
function ll() {
|
|
756
|
+
const { authToken: s } = ve(), t = z((p) => p.lenses), a = z((p) => p.selectedLensId), n = t == null ? void 0 : t.find((p) => p.id === a), l = z((p) => p.dashboard);
|
|
757
757
|
z((p) => p.selectedSheetId);
|
|
758
|
-
const
|
|
758
|
+
const o = z(
|
|
759
759
|
(p) => p.isDashboardEditing
|
|
760
760
|
), r = u(
|
|
761
761
|
(p) => p.selectedConnectionId
|
|
762
|
-
), [c,
|
|
762
|
+
), [c, i] = R(!1), x = z((p) => p.filterValues), d = z((p) => p.isVisualEditing), y = z((p) => p.showFilters);
|
|
763
763
|
z(
|
|
764
764
|
(p) => p.showDashboardJSON
|
|
765
765
|
);
|
|
@@ -767,12 +767,11 @@ function nl() {
|
|
|
767
767
|
(p) => p.actions.setShowFilters
|
|
768
768
|
), { addFrame: g, setSelectedFrameId: j } = z(
|
|
769
769
|
(p) => p.actions
|
|
770
|
-
), { getSelectedSheet:
|
|
770
|
+
), { getSelectedSheet: T, setIsDashboardEditing: C, setShowDashboardJSON: M } = z((p) => p.actions), I = T(), { tenantId: V, endUserId: N } = zs(
|
|
771
771
|
() => ct(s == null ? void 0 : s.accessToken),
|
|
772
772
|
[s == null ? void 0 : s.accessToken]
|
|
773
|
-
),
|
|
774
|
-
if (!
|
|
775
|
-
return;
|
|
773
|
+
), w = zs(() => V || N, [V, N]), L = () => {
|
|
774
|
+
if (!o || !I) return;
|
|
776
775
|
const p = {
|
|
777
776
|
connectionId: r,
|
|
778
777
|
id: We(),
|
|
@@ -789,26 +788,25 @@ function nl() {
|
|
|
789
788
|
type: "bar",
|
|
790
789
|
sql: "select COUNT(*) from YOUR_TABLE",
|
|
791
790
|
data: []
|
|
792
|
-
},
|
|
791
|
+
}, O = {
|
|
793
792
|
id: We(),
|
|
794
793
|
cards: [p],
|
|
795
794
|
activeCardId: p.id
|
|
796
795
|
};
|
|
797
|
-
g(I.id,
|
|
796
|
+
g(I.id, O), j(O.id);
|
|
798
797
|
}, h = () => {
|
|
799
798
|
C(!0);
|
|
800
799
|
};
|
|
801
800
|
async function v() {
|
|
802
|
-
if (
|
|
803
|
-
return;
|
|
801
|
+
if (i(!0), !a || !n) return;
|
|
804
802
|
const p = qa(
|
|
805
803
|
l
|
|
806
|
-
),
|
|
804
|
+
), O = JSON.stringify(p), E = {
|
|
807
805
|
...n,
|
|
808
|
-
template:
|
|
806
|
+
template: O,
|
|
809
807
|
filterValues: x
|
|
810
808
|
};
|
|
811
|
-
await
|
|
809
|
+
await Fs(E, s == null ? void 0 : s.accessToken), Ye.success("Lens saved"), f == null || f(p), i(!1);
|
|
812
810
|
}
|
|
813
811
|
return d ? null : /* @__PURE__ */ e.jsxs(
|
|
814
812
|
"div",
|
|
@@ -818,23 +816,23 @@ function nl() {
|
|
|
818
816
|
children: [
|
|
819
817
|
!d && /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ e.jsx(H, { children: n == null ? void 0 : n.name }) }),
|
|
820
818
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
821
|
-
|
|
822
|
-
!d &&
|
|
823
|
-
|
|
819
|
+
o && !d && w && /* @__PURE__ */ e.jsx(tl, {}),
|
|
820
|
+
!d && w && /* @__PURE__ */ e.jsx(nl, {}),
|
|
821
|
+
o && !d && /* @__PURE__ */ e.jsxs(
|
|
824
822
|
F,
|
|
825
823
|
{
|
|
826
824
|
variant: "secondary",
|
|
827
825
|
className: "h-7 p-2",
|
|
828
826
|
size: "sm",
|
|
829
|
-
disabled: !
|
|
830
|
-
onClick:
|
|
827
|
+
disabled: !o,
|
|
828
|
+
onClick: L,
|
|
831
829
|
children: [
|
|
832
|
-
/* @__PURE__ */ e.jsx(
|
|
830
|
+
/* @__PURE__ */ e.jsx(Ms, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
|
|
833
831
|
"Frame"
|
|
834
832
|
]
|
|
835
833
|
}
|
|
836
834
|
),
|
|
837
|
-
!
|
|
835
|
+
!o && /* @__PURE__ */ e.jsx(
|
|
838
836
|
F,
|
|
839
837
|
{
|
|
840
838
|
variant: "ghost",
|
|
@@ -844,20 +842,20 @@ function nl() {
|
|
|
844
842
|
children: /* @__PURE__ */ e.jsx(Aa, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
845
843
|
}
|
|
846
844
|
),
|
|
847
|
-
|
|
845
|
+
o && !d && /* @__PURE__ */ e.jsx(
|
|
848
846
|
F,
|
|
849
847
|
{
|
|
850
848
|
variant: "ghost",
|
|
851
849
|
role: "close",
|
|
852
850
|
className: "h-7 p-2",
|
|
853
851
|
onClick: () => {
|
|
854
|
-
C(!1),
|
|
852
|
+
C(!1), M(!1);
|
|
855
853
|
},
|
|
856
854
|
size: "sm",
|
|
857
855
|
children: /* @__PURE__ */ e.jsx(Je, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
858
856
|
}
|
|
859
857
|
),
|
|
860
|
-
|
|
858
|
+
o && !d && w && /* @__PURE__ */ e.jsx(
|
|
861
859
|
F,
|
|
862
860
|
{
|
|
863
861
|
className: "h-7 p-2",
|
|
@@ -865,10 +863,10 @@ function nl() {
|
|
|
865
863
|
disabled: c,
|
|
866
864
|
onClick: v,
|
|
867
865
|
size: "sm",
|
|
868
|
-
children: /* @__PURE__ */ e.jsx(
|
|
866
|
+
children: /* @__PURE__ */ e.jsx(Gn, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
869
867
|
}
|
|
870
868
|
),
|
|
871
|
-
!y && !d &&
|
|
869
|
+
!y && !d && o && /* @__PURE__ */ e.jsx(
|
|
872
870
|
F,
|
|
873
871
|
{
|
|
874
872
|
className: "h-7 p-2",
|
|
@@ -878,7 +876,7 @@ function nl() {
|
|
|
878
876
|
children: /* @__PURE__ */ e.jsx(ha, { className: "h-4 w-4", strokeWidth: 1.5 })
|
|
879
877
|
}
|
|
880
878
|
),
|
|
881
|
-
!d &&
|
|
879
|
+
!d && o && !1,
|
|
882
880
|
!d && !1
|
|
883
881
|
] })
|
|
884
882
|
]
|
|
@@ -891,30 +889,30 @@ function Ue({
|
|
|
891
889
|
value: a,
|
|
892
890
|
isLoading: n,
|
|
893
891
|
isError: l,
|
|
894
|
-
connectionTooltip:
|
|
892
|
+
connectionTooltip: o,
|
|
895
893
|
onChange: r,
|
|
896
894
|
showNone: c = !1,
|
|
897
|
-
className:
|
|
895
|
+
className: i,
|
|
898
896
|
showIcon: x = !0,
|
|
899
897
|
disabled: d = !1
|
|
900
898
|
}) {
|
|
901
899
|
const y = n ? "Loading..." : l ? "Error" : a;
|
|
902
900
|
function f() {
|
|
903
901
|
if (s === "Connection")
|
|
904
|
-
return /* @__PURE__ */ e.jsx(
|
|
902
|
+
return /* @__PURE__ */ e.jsx(Un, { className: "size-4 rotate-90" });
|
|
905
903
|
if (s === "Database")
|
|
906
|
-
return /* @__PURE__ */ e.jsx(
|
|
904
|
+
return /* @__PURE__ */ e.jsx(Tn, { className: "size-4" });
|
|
907
905
|
if (s === "Schema")
|
|
908
|
-
return /* @__PURE__ */ e.jsx(
|
|
906
|
+
return /* @__PURE__ */ e.jsx(Pn, { className: "size-4" });
|
|
909
907
|
if (s === "Table")
|
|
910
|
-
return /* @__PURE__ */ e.jsx(
|
|
908
|
+
return /* @__PURE__ */ e.jsx(_s, { className: "size-4" });
|
|
911
909
|
if (s === "Model")
|
|
912
|
-
return /* @__PURE__ */ e.jsx(
|
|
910
|
+
return /* @__PURE__ */ e.jsx(On, { className: "size-4" });
|
|
913
911
|
}
|
|
914
912
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
915
|
-
x && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children:
|
|
913
|
+
x && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: o ? /* @__PURE__ */ e.jsxs(qs, { children: [
|
|
916
914
|
/* @__PURE__ */ e.jsx(ma, { children: f() }),
|
|
917
|
-
/* @__PURE__ */ e.jsx(
|
|
915
|
+
/* @__PURE__ */ e.jsx(Rs, { className: "text-xs", align: "start", children: o })
|
|
918
916
|
] }) : f() }),
|
|
919
917
|
/* @__PURE__ */ e.jsxs(fe, { disabled: d, value: y, onValueChange: r, children: [
|
|
920
918
|
/* @__PURE__ */ e.jsx(
|
|
@@ -922,7 +920,7 @@ function Ue({
|
|
|
922
920
|
{
|
|
923
921
|
className: W(
|
|
924
922
|
"h-9 w-full focus:ring-1 focus:ring-offset-0",
|
|
925
|
-
|
|
923
|
+
i
|
|
926
924
|
),
|
|
927
925
|
children: /* @__PURE__ */ e.jsx(
|
|
928
926
|
je,
|
|
@@ -932,7 +930,7 @@ function Ue({
|
|
|
932
930
|
)
|
|
933
931
|
}
|
|
934
932
|
),
|
|
935
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
933
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
936
934
|
n ? /* @__PURE__ */ e.jsx(ye, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(ye, { children: s }),
|
|
937
935
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
938
936
|
c && /* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
|
|
@@ -943,23 +941,23 @@ function Ue({
|
|
|
943
941
|
] })
|
|
944
942
|
] });
|
|
945
943
|
}
|
|
946
|
-
function
|
|
944
|
+
function rl({ column: s }) {
|
|
947
945
|
const [t, a] = R(!1), n = u((m) => m.selectedTableName), l = u(
|
|
948
946
|
(m) => m.selectedSchemaName
|
|
949
|
-
),
|
|
947
|
+
), o = u(
|
|
950
948
|
(m) => m.selectedDatamodelId
|
|
951
|
-
), r = u((m) => m.sqlGen), { modelItems: c } = Re(),
|
|
949
|
+
), r = u((m) => m.sqlGen), { modelItems: c } = Re(), i = u((m) => m.actions.setSqlGen), x = u((m) => m.actions.setCardSql), d = u((m) => m.actions.setRunSql);
|
|
952
950
|
function y(m, g) {
|
|
953
|
-
var
|
|
954
|
-
const j = xa(m, r, g),
|
|
955
|
-
(I) => I.id ===
|
|
956
|
-
)) == null ? void 0 :
|
|
957
|
-
|
|
951
|
+
var M;
|
|
952
|
+
const j = xa(m, r, g), T = (M = c == null ? void 0 : c.find(
|
|
953
|
+
(I) => I.id === o
|
|
954
|
+
)) == null ? void 0 : M.name;
|
|
955
|
+
i(j);
|
|
958
956
|
const C = pa(
|
|
959
957
|
j,
|
|
960
958
|
xe(l || ""),
|
|
961
959
|
xe(n),
|
|
962
|
-
|
|
960
|
+
T
|
|
963
961
|
);
|
|
964
962
|
C && (x(C), d(!0)), a(!1);
|
|
965
963
|
}
|
|
@@ -1007,10 +1005,10 @@ function ll({ column: s }) {
|
|
|
1007
1005
|
)
|
|
1008
1006
|
] });
|
|
1009
1007
|
}
|
|
1010
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1011
|
-
/* @__PURE__ */ e.jsx(
|
|
1008
|
+
return /* @__PURE__ */ e.jsxs(Hs, { openDelay: 0, open: t, onOpenChange: a, children: [
|
|
1009
|
+
/* @__PURE__ */ e.jsx($s, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ma, { className: "invisible size-3.5 cursor-pointer text-foreground/40 group-hover:visible" }) }),
|
|
1012
1010
|
/* @__PURE__ */ e.jsx(
|
|
1013
|
-
|
|
1011
|
+
Ps,
|
|
1014
1012
|
{
|
|
1015
1013
|
align: "center",
|
|
1016
1014
|
className: "w-20 rounded-md p-0 shadow-none",
|
|
@@ -1020,73 +1018,73 @@ function ll({ column: s }) {
|
|
|
1020
1018
|
] });
|
|
1021
1019
|
}
|
|
1022
1020
|
function Ra({ column: s }) {
|
|
1023
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1021
|
+
return /* @__PURE__ */ e.jsxs(qs, { children: [
|
|
1024
1022
|
/* @__PURE__ */ e.jsx(dt, { asChild: !0, children: ut.includes(s.data_type.toLowerCase()) ? (
|
|
1025
1023
|
// <span className=" font-thin">T</span>
|
|
1026
1024
|
/* @__PURE__ */ e.jsx(Qs, { className: "size-3" })
|
|
1027
1025
|
) : fa.includes(s.data_type.toLowerCase()) ? (
|
|
1028
1026
|
//
|
|
1029
|
-
/* @__PURE__ */ e.jsx(
|
|
1030
|
-
) : ht.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(mt, { className: "size-3" }) : xt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(
|
|
1031
|
-
/* @__PURE__ */ e.jsx(
|
|
1027
|
+
/* @__PURE__ */ e.jsx(Vn, { className: "size-3" })
|
|
1028
|
+
) : ht.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(mt, { className: "size-3" }) : xt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Yn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(Kn, { className: "size-3" }) }),
|
|
1029
|
+
/* @__PURE__ */ e.jsx(Rs, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
|
|
1032
1030
|
] });
|
|
1033
1031
|
}
|
|
1034
|
-
function
|
|
1032
|
+
function il({
|
|
1035
1033
|
schemaName: s,
|
|
1036
1034
|
tableName: t,
|
|
1037
1035
|
columns: a,
|
|
1038
1036
|
status: n
|
|
1039
1037
|
}) {
|
|
1040
|
-
const l = u((h) => h.sqlGen),
|
|
1038
|
+
const l = u((h) => h.sqlGen), o = u(
|
|
1041
1039
|
(h) => h.selectedConnectionId
|
|
1042
1040
|
), r = u(
|
|
1043
1041
|
(h) => h.selectedDatabaseName
|
|
1044
1042
|
), c = u(
|
|
1045
1043
|
(h) => h.selectedSchemaName
|
|
1046
|
-
),
|
|
1044
|
+
), i = u((h) => h.selectedTableName), x = u(
|
|
1047
1045
|
(h) => h.selectedDatamodelId
|
|
1048
1046
|
), d = z(
|
|
1049
1047
|
(h) => h.dashboard.aiScopeTables
|
|
1050
1048
|
), { setAIScopeTables: y } = z((h) => h.actions), f = u((h) => h.actions.setRunSql), m = u((h) => h.actions.setSqlGen), g = u(
|
|
1051
1049
|
(h) => h.actions.setIsShowingVisual
|
|
1052
|
-
), j = u((h) => h.actions.setCardSql), { connectionType:
|
|
1053
|
-
function
|
|
1054
|
-
var
|
|
1050
|
+
), j = u((h) => h.actions.setCardSql), { connectionType: T, modelItems: C } = Re();
|
|
1051
|
+
function M(h) {
|
|
1052
|
+
var E;
|
|
1055
1053
|
const v = xa(h, l);
|
|
1056
1054
|
m(v);
|
|
1057
|
-
const p = (
|
|
1055
|
+
const p = (E = C == null ? void 0 : C.find(
|
|
1058
1056
|
($) => $.id === x
|
|
1059
|
-
)) == null ? void 0 :
|
|
1060
|
-
|
|
1057
|
+
)) == null ? void 0 : E.name, O = pa(v, xe(s), xe(t), p);
|
|
1058
|
+
O && (j(O), f(!0));
|
|
1061
1059
|
}
|
|
1062
1060
|
function I() {
|
|
1063
1061
|
return (d == null ? void 0 : d.find(
|
|
1064
|
-
(h) => h.connectinonId ===
|
|
1062
|
+
(h) => h.connectinonId === o && h.tableName === i
|
|
1065
1063
|
)) !== void 0;
|
|
1066
1064
|
}
|
|
1067
|
-
function
|
|
1068
|
-
if (h === !0 &&
|
|
1065
|
+
function V(h) {
|
|
1066
|
+
if (h === !0 && i && o) {
|
|
1069
1067
|
const v = {
|
|
1070
|
-
connectinonId:
|
|
1071
|
-
connectionType:
|
|
1068
|
+
connectinonId: o,
|
|
1069
|
+
connectionType: T,
|
|
1072
1070
|
databaseName: r,
|
|
1073
1071
|
schemaName: c,
|
|
1074
|
-
tableName:
|
|
1075
|
-
},
|
|
1076
|
-
(
|
|
1077
|
-
(Y) => Y.connectinonId ===
|
|
1072
|
+
tableName: i
|
|
1073
|
+
}, O = [...d || [], v].filter(
|
|
1074
|
+
(E, $, B) => B.findIndex(
|
|
1075
|
+
(Y) => Y.connectinonId === E.connectinonId && Y.tableName === E.tableName
|
|
1078
1076
|
) === $
|
|
1079
1077
|
);
|
|
1080
|
-
y(
|
|
1078
|
+
y(O), Ye.success(`Added '${i}' to AI Scope`, {
|
|
1081
1079
|
position: "top-right",
|
|
1082
1080
|
duration: 2500,
|
|
1083
1081
|
richColors: !0
|
|
1084
1082
|
});
|
|
1085
1083
|
} else {
|
|
1086
1084
|
const v = (d || []).filter(
|
|
1087
|
-
(p) => p.connectinonId !==
|
|
1085
|
+
(p) => p.connectinonId !== o && p.tableName !== i
|
|
1088
1086
|
);
|
|
1089
|
-
y(v), Ye(`Removed '${
|
|
1087
|
+
y(v), Ye(`Removed '${i}' from AI Scope`, {
|
|
1090
1088
|
position: "top-right",
|
|
1091
1089
|
duration: 2e3,
|
|
1092
1090
|
richColors: !0
|
|
@@ -1094,22 +1092,22 @@ function rl({
|
|
|
1094
1092
|
}
|
|
1095
1093
|
}
|
|
1096
1094
|
function N() {
|
|
1097
|
-
var
|
|
1095
|
+
var E;
|
|
1098
1096
|
let h = ja(s, t);
|
|
1099
|
-
const v = (
|
|
1097
|
+
const v = (E = C == null ? void 0 : C.find(
|
|
1100
1098
|
($) => $.id === x
|
|
1101
|
-
)) == null ? void 0 :
|
|
1102
|
-
console.log("modelName", v), x && x !== "none" && (h = `${
|
|
1099
|
+
)) == null ? void 0 : E.name;
|
|
1100
|
+
console.log("modelName", v), x && x !== "none" && (h = `${Ss}.${v}`);
|
|
1103
1101
|
let p = h;
|
|
1104
1102
|
return (($) => /[A-Z]/.test($))(t) && (p = p.split(".").map((B) => `"${B}"`).join(".")), p;
|
|
1105
1103
|
}
|
|
1106
|
-
function
|
|
1104
|
+
function w() {
|
|
1107
1105
|
const h = N();
|
|
1108
1106
|
g(!1);
|
|
1109
|
-
const v =
|
|
1107
|
+
const v = T === "MSSQL" ? `SELECT top 10 * FROM ${h}` : `SELECT * FROM ${h} LIMIT 10`;
|
|
1110
1108
|
j(v), f(!0);
|
|
1111
1109
|
}
|
|
1112
|
-
function
|
|
1110
|
+
function L() {
|
|
1113
1111
|
const h = N();
|
|
1114
1112
|
j(`SELECT COUNT(*) as count FROM ${h}`), f(!0);
|
|
1115
1113
|
}
|
|
@@ -1120,7 +1118,7 @@ function rl({
|
|
|
1120
1118
|
{
|
|
1121
1119
|
title: `${I() ? "Remove from" : "Add to"} AI Scope`,
|
|
1122
1120
|
pressed: I(),
|
|
1123
|
-
onPressedChange:
|
|
1121
|
+
onPressedChange: V,
|
|
1124
1122
|
variant: "outline",
|
|
1125
1123
|
className: "h-9 px-2",
|
|
1126
1124
|
children: /* @__PURE__ */ e.jsx(
|
|
@@ -1138,12 +1136,12 @@ function rl({
|
|
|
1138
1136
|
F,
|
|
1139
1137
|
{
|
|
1140
1138
|
disabled: n !== "Success",
|
|
1141
|
-
onClick:
|
|
1139
|
+
onClick: w,
|
|
1142
1140
|
size: "sm",
|
|
1143
1141
|
variant: "secondary",
|
|
1144
1142
|
className: "flex",
|
|
1145
1143
|
children: [
|
|
1146
|
-
n !== "Success" ? /* @__PURE__ */ e.jsx(Ze, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(
|
|
1144
|
+
n !== "Success" ? /* @__PURE__ */ e.jsx(Ze, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Jn, { className: "mr-2 size-4" }),
|
|
1147
1145
|
"Top 10"
|
|
1148
1146
|
]
|
|
1149
1147
|
}
|
|
@@ -1152,26 +1150,26 @@ function rl({
|
|
|
1152
1150
|
F,
|
|
1153
1151
|
{
|
|
1154
1152
|
disabled: n !== "Success",
|
|
1155
|
-
onClick:
|
|
1153
|
+
onClick: L,
|
|
1156
1154
|
size: "sm",
|
|
1157
1155
|
variant: "secondary",
|
|
1158
1156
|
className: "flex",
|
|
1159
1157
|
children: [
|
|
1160
|
-
n !== "Success" ? /* @__PURE__ */ e.jsx(Ze, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(
|
|
1158
|
+
n !== "Success" ? /* @__PURE__ */ e.jsx(Ze, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Qn, { className: "mr-2 size-4" }),
|
|
1161
1159
|
"Count"
|
|
1162
1160
|
]
|
|
1163
1161
|
}
|
|
1164
1162
|
)
|
|
1165
1163
|
] }),
|
|
1166
1164
|
/* @__PURE__ */ e.jsxs(
|
|
1167
|
-
|
|
1165
|
+
ms,
|
|
1168
1166
|
{
|
|
1169
1167
|
className: "flex-1 basis-0 overflow-y-auto border-b border-t border-muted py-3",
|
|
1170
1168
|
children: [
|
|
1171
1169
|
a == null ? void 0 : a.map((h) => /* @__PURE__ */ e.jsxs(
|
|
1172
1170
|
"div",
|
|
1173
1171
|
{
|
|
1174
|
-
onClick: () =>
|
|
1172
|
+
onClick: () => M(h),
|
|
1175
1173
|
className: W(
|
|
1176
1174
|
"group mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
1177
1175
|
{
|
|
@@ -1188,7 +1186,7 @@ function rl({
|
|
|
1188
1186
|
{
|
|
1189
1187
|
onClick: (v) => v.stopPropagation(),
|
|
1190
1188
|
className: "flex items-center justify-end",
|
|
1191
|
-
children: fa.includes(h.data_type) && /* @__PURE__ */ e.jsx(
|
|
1189
|
+
children: fa.includes(h.data_type) && /* @__PURE__ */ e.jsx(rl, { column: h })
|
|
1192
1190
|
}
|
|
1193
1191
|
)
|
|
1194
1192
|
]
|
|
@@ -1205,15 +1203,15 @@ function rl({
|
|
|
1205
1203
|
function Re(s, t) {
|
|
1206
1204
|
var Pe, ss, as, ts, Be;
|
|
1207
1205
|
let a = zs(() => [], []);
|
|
1208
|
-
const n =
|
|
1206
|
+
const n = ve().authToken || s, l = u(
|
|
1209
1207
|
(S) => S.selectedConnectionId
|
|
1210
|
-
),
|
|
1208
|
+
), o = u(
|
|
1211
1209
|
(S) => S.selectedDatamodelId
|
|
1212
1210
|
), r = u(
|
|
1213
1211
|
(S) => S.selectedDatabaseName
|
|
1214
1212
|
), c = u(
|
|
1215
1213
|
(S) => S.selectedSchemaName
|
|
1216
|
-
),
|
|
1214
|
+
), i = u((S) => S.selectedTableName), x = u(
|
|
1217
1215
|
(S) => S.actions.setCurrentColumns
|
|
1218
1216
|
), d = u(
|
|
1219
1217
|
(S) => S.actions.setSelectedConnectionId
|
|
@@ -1226,34 +1224,34 @@ function Re(s, t) {
|
|
|
1226
1224
|
), g = u(
|
|
1227
1225
|
(S) => S.actions.setSelectedTableName
|
|
1228
1226
|
), j = u((S) => S.actions.setCardSql);
|
|
1229
|
-
function
|
|
1227
|
+
function T(S) {
|
|
1230
1228
|
return l && r && c && r !== "NA" ? !0 : l && S === "API" ? !1 : !!(l && S === "S3");
|
|
1231
1229
|
}
|
|
1232
1230
|
function C(S) {
|
|
1233
|
-
return !!(l && r && r !== "NA" && c &&
|
|
1231
|
+
return !!(l && r && r !== "NA" && c && i || l && (S === "S3" || S === "API") || o && o);
|
|
1234
1232
|
}
|
|
1235
|
-
function
|
|
1233
|
+
function M(S) {
|
|
1236
1234
|
return l && S ? !(S === "API" || S === "S3") : !1;
|
|
1237
1235
|
}
|
|
1238
1236
|
const {
|
|
1239
1237
|
data: I,
|
|
1240
|
-
isLoading:
|
|
1238
|
+
isLoading: V,
|
|
1241
1239
|
isError: N
|
|
1242
1240
|
} = me({
|
|
1243
1241
|
queryKey: ["connections"],
|
|
1244
|
-
queryFn: () =>
|
|
1242
|
+
queryFn: () => ke(
|
|
1245
1243
|
"https://semaphor.cloud/api/v1/connections",
|
|
1246
1244
|
(n == null ? void 0 : n.accessToken) || ""
|
|
1247
1245
|
),
|
|
1248
1246
|
enabled: !!(n != null && n.accessToken)
|
|
1249
1247
|
// Only fetch if authToken is present
|
|
1250
1248
|
}), {
|
|
1251
|
-
data:
|
|
1252
|
-
isLoading:
|
|
1249
|
+
data: w,
|
|
1250
|
+
isLoading: L,
|
|
1253
1251
|
isError: h
|
|
1254
1252
|
} = me({
|
|
1255
1253
|
queryKey: ["models", l],
|
|
1256
|
-
queryFn: () =>
|
|
1254
|
+
queryFn: () => ke(
|
|
1257
1255
|
"https://semaphor.cloud/api/v1/datamodels",
|
|
1258
1256
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1259
1257
|
{
|
|
@@ -1264,32 +1262,32 @@ function Re(s, t) {
|
|
|
1264
1262
|
// Only fetch if authToken is present
|
|
1265
1263
|
}), v = I == null ? void 0 : I.connections.find(
|
|
1266
1264
|
(S) => S.id === l
|
|
1267
|
-
), p = v == null ? void 0 : v.type,
|
|
1268
|
-
data:
|
|
1265
|
+
), p = v == null ? void 0 : v.type, O = (v == null ? void 0 : v.type) === "API" || (v == null ? void 0 : v.type) === "S3", {
|
|
1266
|
+
data: E,
|
|
1269
1267
|
isLoading: $,
|
|
1270
1268
|
isFetching: B,
|
|
1271
1269
|
isError: Y,
|
|
1272
1270
|
refetch: le
|
|
1273
1271
|
} = me({
|
|
1274
1272
|
queryKey: ["databases", l],
|
|
1275
|
-
queryFn: () =>
|
|
1273
|
+
queryFn: () => ke(
|
|
1276
1274
|
"https://semaphor.cloud/api/v1/databases",
|
|
1277
1275
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1278
1276
|
{
|
|
1279
1277
|
connection_id: l
|
|
1280
1278
|
}
|
|
1281
1279
|
),
|
|
1282
|
-
enabled:
|
|
1280
|
+
enabled: M(p)
|
|
1283
1281
|
// !!selectedConnectionId && !isNonDbConnection, //currentConnection?.type !== 'API', // Only fetch if connectionId is present
|
|
1284
1282
|
}), {
|
|
1285
1283
|
data: J,
|
|
1286
1284
|
isLoading: ne,
|
|
1287
|
-
isFetching:
|
|
1285
|
+
isFetching: k,
|
|
1288
1286
|
isError: _,
|
|
1289
1287
|
refetch: ee
|
|
1290
1288
|
} = me({
|
|
1291
1289
|
queryKey: ["schemas", l, r],
|
|
1292
|
-
queryFn: () =>
|
|
1290
|
+
queryFn: () => ke(
|
|
1293
1291
|
"https://semaphor.cloud/api/v1/schemas",
|
|
1294
1292
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1295
1293
|
{
|
|
@@ -1297,11 +1295,11 @@ function Re(s, t) {
|
|
|
1297
1295
|
database_name: r
|
|
1298
1296
|
}
|
|
1299
1297
|
),
|
|
1300
|
-
enabled: !!l && !!r && !
|
|
1298
|
+
enabled: !!l && !!r && !O && r !== "NA"
|
|
1301
1299
|
//currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
|
|
1302
1300
|
}), {
|
|
1303
|
-
data:
|
|
1304
|
-
isLoading:
|
|
1301
|
+
data: A,
|
|
1302
|
+
isLoading: D,
|
|
1305
1303
|
isFetching: se,
|
|
1306
1304
|
isError: P,
|
|
1307
1305
|
refetch: X
|
|
@@ -1312,7 +1310,7 @@ function Re(s, t) {
|
|
|
1312
1310
|
r,
|
|
1313
1311
|
c
|
|
1314
1312
|
],
|
|
1315
|
-
queryFn: () =>
|
|
1313
|
+
queryFn: () => ke(
|
|
1316
1314
|
"https://semaphor.cloud/api/v1/tables",
|
|
1317
1315
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1318
1316
|
{
|
|
@@ -1321,31 +1319,31 @@ function Re(s, t) {
|
|
|
1321
1319
|
schema_name: c
|
|
1322
1320
|
}
|
|
1323
1321
|
),
|
|
1324
|
-
enabled:
|
|
1322
|
+
enabled: T(p)
|
|
1325
1323
|
}), {
|
|
1326
1324
|
data: ie,
|
|
1327
|
-
isLoading:
|
|
1325
|
+
isLoading: Ne,
|
|
1328
1326
|
isFetching: Le,
|
|
1329
|
-
isError:
|
|
1327
|
+
isError: Se
|
|
1330
1328
|
} = me({
|
|
1331
1329
|
queryKey: [
|
|
1332
1330
|
"columns",
|
|
1333
1331
|
l,
|
|
1334
1332
|
r,
|
|
1335
|
-
|
|
1333
|
+
o,
|
|
1336
1334
|
c,
|
|
1337
|
-
|
|
1335
|
+
i
|
|
1338
1336
|
],
|
|
1339
|
-
queryFn: () =>
|
|
1337
|
+
queryFn: () => ke(
|
|
1340
1338
|
"https://semaphor.cloud/api/v1/columns",
|
|
1341
1339
|
(n == null ? void 0 : n.accessToken) || "",
|
|
1342
1340
|
{
|
|
1343
1341
|
connection_id: l,
|
|
1344
|
-
datamodel_id:
|
|
1342
|
+
datamodel_id: o || "",
|
|
1345
1343
|
// don't pass undefined. Pass empty string
|
|
1346
1344
|
database_name: r,
|
|
1347
1345
|
schema_name: c,
|
|
1348
|
-
table_name:
|
|
1346
|
+
table_name: i
|
|
1349
1347
|
}
|
|
1350
1348
|
),
|
|
1351
1349
|
enabled: C(p)
|
|
@@ -1361,14 +1359,14 @@ function Re(s, t) {
|
|
|
1361
1359
|
x(a);
|
|
1362
1360
|
}, [ie, x, a]), Z(() => {
|
|
1363
1361
|
}, [
|
|
1364
|
-
|
|
1362
|
+
O,
|
|
1365
1363
|
j,
|
|
1366
1364
|
g,
|
|
1367
1365
|
m,
|
|
1368
1366
|
f,
|
|
1369
1367
|
v
|
|
1370
1368
|
]);
|
|
1371
|
-
const Fe = (v == null ? void 0 : v.type) === "API" ? (Pe = v == null ? void 0 : v.type) == null ? void 0 : Pe.toLowerCase() :
|
|
1369
|
+
const Fe = (v == null ? void 0 : v.type) === "API" ? (Pe = v == null ? void 0 : v.type) == null ? void 0 : Pe.toLowerCase() : i || "", we = O ? "" : c || "";
|
|
1372
1370
|
function ae(S) {
|
|
1373
1371
|
m(S), g("");
|
|
1374
1372
|
}
|
|
@@ -1381,52 +1379,52 @@ function Re(s, t) {
|
|
|
1381
1379
|
function es(S) {
|
|
1382
1380
|
y(S === "none" ? "" : S), S !== "none" && S !== "" && f("");
|
|
1383
1381
|
}
|
|
1384
|
-
|
|
1382
|
+
E && ((ss = E == null ? void 0 : E.databases) == null ? void 0 : ss.length) > 0, J && ((as = J == null ? void 0 : J.schemas) == null ? void 0 : as.length) > 0, ie && ((ts = ie == null ? void 0 : ie.columns) == null ? void 0 : ts.length) > 0 && (a = ie.columns.map((S) => ({
|
|
1385
1383
|
...S,
|
|
1386
1384
|
data_type: S.data_type.toLowerCase()
|
|
1387
|
-
}))), Y && (a = []), (
|
|
1385
|
+
}))), Y && (a = []), (Se || N) && (a = []);
|
|
1388
1386
|
const Ee = I == null ? void 0 : I.connections.map(
|
|
1389
1387
|
(S) => ({
|
|
1390
1388
|
id: S.id,
|
|
1391
1389
|
name: S.name,
|
|
1392
1390
|
type: S.type
|
|
1393
1391
|
})
|
|
1394
|
-
), He = (Be =
|
|
1392
|
+
), He = (Be = w == null ? void 0 : w.datamodels) == null ? void 0 : Be.map((S) => ({
|
|
1395
1393
|
id: S.id,
|
|
1396
1394
|
name: S.name
|
|
1397
|
-
})), $e =
|
|
1395
|
+
})), $e = E == null ? void 0 : E.databases.map((S) => ({
|
|
1398
1396
|
id: S.database_name,
|
|
1399
1397
|
name: S.database_name
|
|
1400
1398
|
})), Ae = J == null ? void 0 : J.schemas.map((S) => ({
|
|
1401
1399
|
id: S.schema_name,
|
|
1402
1400
|
name: S.schema_name
|
|
1403
|
-
})),
|
|
1401
|
+
})), vs = A == null ? void 0 : A.tables.map((S) => ({
|
|
1404
1402
|
id: S.table_name,
|
|
1405
1403
|
name: S.table_name
|
|
1406
1404
|
}));
|
|
1407
1405
|
return {
|
|
1408
1406
|
connectionItems: Ee,
|
|
1409
|
-
isConnectionsLoading:
|
|
1407
|
+
isConnectionsLoading: V,
|
|
1410
1408
|
isConnectionsError: N,
|
|
1411
1409
|
modelItems: He,
|
|
1412
|
-
isModelsLoading:
|
|
1410
|
+
isModelsLoading: L,
|
|
1413
1411
|
isModelsError: h,
|
|
1414
1412
|
databaseItems: $e,
|
|
1415
1413
|
isDatabasesLoadingOrFetching: $ || B,
|
|
1416
1414
|
isDatabaseError: Y,
|
|
1417
1415
|
schemaItems: Ae,
|
|
1418
|
-
isSchemaLoadingOrFetching: ne ||
|
|
1416
|
+
isSchemaLoadingOrFetching: ne || k,
|
|
1419
1417
|
isSchemaError: _,
|
|
1420
|
-
tableItems:
|
|
1421
|
-
isTableLoadingOrFetching:
|
|
1418
|
+
tableItems: vs,
|
|
1419
|
+
isTableLoadingOrFetching: D || se,
|
|
1422
1420
|
isTableError: P,
|
|
1423
1421
|
columns: a,
|
|
1424
|
-
isColumnsLoadingOrFetching:
|
|
1425
|
-
isColumnsError:
|
|
1426
|
-
isNonDbConnection:
|
|
1422
|
+
isColumnsLoadingOrFetching: Ne || Le,
|
|
1423
|
+
isColumnsError: Se,
|
|
1424
|
+
isNonDbConnection: O,
|
|
1427
1425
|
connectionType: p,
|
|
1428
1426
|
tableName: Fe,
|
|
1429
|
-
schemaName:
|
|
1427
|
+
schemaName: we,
|
|
1430
1428
|
handleConnectionChange: he,
|
|
1431
1429
|
handleDatamodelChange: es,
|
|
1432
1430
|
handleDatabaseChange: ue,
|
|
@@ -1445,11 +1443,11 @@ function _a({
|
|
|
1445
1443
|
(P) => P.selectedDatabaseName
|
|
1446
1444
|
), l = u(
|
|
1447
1445
|
(P) => P.selectedSchemaName
|
|
1448
|
-
),
|
|
1446
|
+
), o = u((P) => P.selectedTableName), r = u(
|
|
1449
1447
|
(P) => P.actions.setSelectedTableName
|
|
1450
1448
|
), {
|
|
1451
1449
|
connectionItems: c,
|
|
1452
|
-
modelItems:
|
|
1450
|
+
modelItems: i,
|
|
1453
1451
|
schemaItems: x,
|
|
1454
1452
|
databaseItems: d,
|
|
1455
1453
|
tableItems: y,
|
|
@@ -1457,19 +1455,19 @@ function _a({
|
|
|
1457
1455
|
isConnectionsLoading: m,
|
|
1458
1456
|
isModelsLoading: g,
|
|
1459
1457
|
isConnectionsError: j,
|
|
1460
|
-
isModelsError:
|
|
1458
|
+
isModelsError: T,
|
|
1461
1459
|
isDatabasesLoadingOrFetching: C,
|
|
1462
|
-
isDatabaseError:
|
|
1460
|
+
isDatabaseError: M,
|
|
1463
1461
|
isSchemaLoadingOrFetching: I,
|
|
1464
|
-
isSchemaError:
|
|
1462
|
+
isSchemaError: V,
|
|
1465
1463
|
isColumnsError: N,
|
|
1466
|
-
isColumnsLoadingOrFetching:
|
|
1467
|
-
isTableLoadingOrFetching:
|
|
1464
|
+
isColumnsLoadingOrFetching: w,
|
|
1465
|
+
isTableLoadingOrFetching: L,
|
|
1468
1466
|
isTableError: h,
|
|
1469
1467
|
connectionType: v,
|
|
1470
1468
|
isNonDbConnection: p,
|
|
1471
|
-
handleConnectionChange:
|
|
1472
|
-
handleDatabaseChange:
|
|
1469
|
+
handleConnectionChange: O,
|
|
1470
|
+
handleDatabaseChange: E,
|
|
1473
1471
|
handleSchemaChange: $,
|
|
1474
1472
|
handleDatamodelChange: B,
|
|
1475
1473
|
tableName: Y,
|
|
@@ -1477,28 +1475,27 @@ function _a({
|
|
|
1477
1475
|
} = Re();
|
|
1478
1476
|
function J() {
|
|
1479
1477
|
return s ? s(le, Y, f) : /* @__PURE__ */ e.jsx(
|
|
1480
|
-
|
|
1478
|
+
il,
|
|
1481
1479
|
{
|
|
1482
1480
|
schemaName: le,
|
|
1483
1481
|
tableName: Y,
|
|
1484
1482
|
columns: f,
|
|
1485
|
-
status:
|
|
1483
|
+
status: w ? "Loading..." : N ? "Error" : "Success"
|
|
1486
1484
|
}
|
|
1487
1485
|
);
|
|
1488
1486
|
}
|
|
1489
1487
|
function ne() {
|
|
1490
1488
|
window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
|
|
1491
1489
|
}
|
|
1492
|
-
function
|
|
1493
|
-
if (!t || v === "S3" || v === "API")
|
|
1494
|
-
return null;
|
|
1490
|
+
function k() {
|
|
1491
|
+
if (!t || v === "S3" || v === "API") return null;
|
|
1495
1492
|
if (!a || a === "none")
|
|
1496
1493
|
return /* @__PURE__ */ e.jsx(
|
|
1497
1494
|
Ue,
|
|
1498
1495
|
{
|
|
1499
1496
|
showNone: !0,
|
|
1500
|
-
onChange:
|
|
1501
|
-
isError:
|
|
1497
|
+
onChange: E,
|
|
1498
|
+
isError: M,
|
|
1502
1499
|
isLoading: C,
|
|
1503
1500
|
items: d,
|
|
1504
1501
|
value: n || "",
|
|
@@ -1515,28 +1512,27 @@ function _a({
|
|
|
1515
1512
|
] });
|
|
1516
1513
|
}
|
|
1517
1514
|
function ee() {
|
|
1518
|
-
if (!t || v === "S3" || v === "API")
|
|
1519
|
-
return null;
|
|
1515
|
+
if (!t || v === "S3" || v === "API") return null;
|
|
1520
1516
|
if (!n || n === "none")
|
|
1521
1517
|
return /* @__PURE__ */ e.jsx(
|
|
1522
1518
|
Ue,
|
|
1523
1519
|
{
|
|
1524
1520
|
showNone: !0,
|
|
1525
1521
|
onChange: B,
|
|
1526
|
-
isError:
|
|
1522
|
+
isError: T,
|
|
1527
1523
|
isLoading: g,
|
|
1528
|
-
items:
|
|
1524
|
+
items: i,
|
|
1529
1525
|
value: a || "",
|
|
1530
1526
|
title: "Model"
|
|
1531
1527
|
}
|
|
1532
1528
|
);
|
|
1533
1529
|
}
|
|
1534
|
-
function
|
|
1530
|
+
function A() {
|
|
1535
1531
|
return !t || v === "S3" || v === "API" || !n || n === "none" ? null : /* @__PURE__ */ e.jsx(
|
|
1536
1532
|
Ue,
|
|
1537
1533
|
{
|
|
1538
1534
|
onChange: $,
|
|
1539
|
-
isError:
|
|
1535
|
+
isError: V,
|
|
1540
1536
|
isLoading: I,
|
|
1541
1537
|
items: x,
|
|
1542
1538
|
value: l || "",
|
|
@@ -1544,7 +1540,7 @@ function _a({
|
|
|
1544
1540
|
}
|
|
1545
1541
|
);
|
|
1546
1542
|
}
|
|
1547
|
-
function
|
|
1543
|
+
function D() {
|
|
1548
1544
|
function P() {
|
|
1549
1545
|
let X = !1;
|
|
1550
1546
|
return v === "API" ? (X = !1, X) : ((v === "S3" || t && n && n !== "none" && l) && (X = !0), X);
|
|
@@ -1555,8 +1551,8 @@ function _a({
|
|
|
1555
1551
|
onChange: r,
|
|
1556
1552
|
isError: h,
|
|
1557
1553
|
items: y,
|
|
1558
|
-
isLoading:
|
|
1559
|
-
value:
|
|
1554
|
+
isLoading: L,
|
|
1555
|
+
value: o || "",
|
|
1560
1556
|
title: "Table"
|
|
1561
1557
|
}
|
|
1562
1558
|
) : null;
|
|
@@ -1569,7 +1565,7 @@ function _a({
|
|
|
1569
1565
|
items: c,
|
|
1570
1566
|
title: "Connection",
|
|
1571
1567
|
value: t || "",
|
|
1572
|
-
onChange:
|
|
1568
|
+
onChange: O,
|
|
1573
1569
|
isLoading: m,
|
|
1574
1570
|
isError: j,
|
|
1575
1571
|
connectionTooltip: ((se = c == null ? void 0 : c.find(
|
|
@@ -1579,9 +1575,9 @@ function _a({
|
|
|
1579
1575
|
),
|
|
1580
1576
|
ee(),
|
|
1581
1577
|
_(),
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1578
|
+
k(),
|
|
1579
|
+
A(),
|
|
1580
|
+
D()
|
|
1585
1581
|
] }),
|
|
1586
1582
|
J(),
|
|
1587
1583
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-end justify-center gap-2 px-6 py-4", children: /* @__PURE__ */ e.jsxs(
|
|
@@ -1592,17 +1588,17 @@ function _a({
|
|
|
1592
1588
|
variant: "secondary",
|
|
1593
1589
|
className: "w-full",
|
|
1594
1590
|
children: [
|
|
1595
|
-
/* @__PURE__ */ e.jsx(
|
|
1591
|
+
/* @__PURE__ */ e.jsx($n, { className: "mr-2 size-4" }),
|
|
1596
1592
|
"Help"
|
|
1597
1593
|
]
|
|
1598
1594
|
}
|
|
1599
1595
|
) })
|
|
1600
1596
|
] });
|
|
1601
1597
|
}
|
|
1602
|
-
function
|
|
1598
|
+
function ol(s) {
|
|
1603
1599
|
const t = s.toUpperCase().indexOf("WHERE"), a = s.toUpperCase().indexOf("GROUP BY"), n = s.toUpperCase().indexOf("LIMIT"), l = s.toUpperCase().indexOf("ORDER BY");
|
|
1604
|
-
let
|
|
1605
|
-
if (l !== -1 && (
|
|
1600
|
+
let o = s.length;
|
|
1601
|
+
if (l !== -1 && (o = l), n !== -1 && n < o && (o = n), t !== -1) {
|
|
1606
1602
|
const r = s.substring(0, t), c = s.substring(t);
|
|
1607
1603
|
return `${r} {{ filters | where }} AND ${c.substring(
|
|
1608
1604
|
6
|
|
@@ -1611,20 +1607,20 @@ function il(s) {
|
|
|
1611
1607
|
const r = s.substring(0, a), c = s.substring(a);
|
|
1612
1608
|
return `${r} {{ filters | where }} ${c}`;
|
|
1613
1609
|
} else {
|
|
1614
|
-
const r = s.substring(0,
|
|
1610
|
+
const r = s.substring(0, o), c = s.substring(o);
|
|
1615
1611
|
return `${r} {{ filters | where }} ${c}`;
|
|
1616
1612
|
}
|
|
1617
1613
|
}
|
|
1618
|
-
function
|
|
1614
|
+
function cl({
|
|
1619
1615
|
error: s,
|
|
1620
1616
|
setShowAIDialog: t,
|
|
1621
1617
|
setUserInputforAI: a,
|
|
1622
1618
|
setTriggerAIRun: n
|
|
1623
1619
|
}) {
|
|
1624
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1625
|
-
/* @__PURE__ */ e.jsx(
|
|
1626
|
-
/* @__PURE__ */ e.jsx(
|
|
1627
|
-
/* @__PURE__ */ e.jsx(
|
|
1620
|
+
return /* @__PURE__ */ e.jsxs(Hs, { openDelay: 0, children: [
|
|
1621
|
+
/* @__PURE__ */ e.jsx($s, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { variant: "link", className: "h-5 p-0", children: /* @__PURE__ */ e.jsx(Fn, { className: "h-4 w-4 text-red-500" }) }) }),
|
|
1622
|
+
/* @__PURE__ */ e.jsx(Ps, { align: "start", className: "min-w-fit max-w-[500px]", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-2", children: [
|
|
1623
|
+
/* @__PURE__ */ e.jsx(ms, { className: "max-h-[250px] min-h-0 overflow-scroll", children: /* @__PURE__ */ e.jsx("p", { className: "overflow-auto rounded-md bg-muted p-2 text-xs leading-relaxed", children: s }) }),
|
|
1628
1624
|
/* @__PURE__ */ e.jsxs(
|
|
1629
1625
|
F,
|
|
1630
1626
|
{
|
|
@@ -1634,7 +1630,7 @@ function ol({
|
|
|
1634
1630
|
size: "sm",
|
|
1635
1631
|
variant: "outline",
|
|
1636
1632
|
children: [
|
|
1637
|
-
/* @__PURE__ */ e.jsx(
|
|
1633
|
+
/* @__PURE__ */ e.jsx(An, { className: "mr-2 h-4 w-4" }),
|
|
1638
1634
|
"Debug with AI"
|
|
1639
1635
|
]
|
|
1640
1636
|
}
|
|
@@ -1642,56 +1638,55 @@ function ol({
|
|
|
1642
1638
|
] }) }) })
|
|
1643
1639
|
] });
|
|
1644
1640
|
}
|
|
1645
|
-
function
|
|
1641
|
+
function dl({
|
|
1646
1642
|
text: s,
|
|
1647
1643
|
onCheckedChange: t,
|
|
1648
1644
|
checked: a
|
|
1649
1645
|
}) {
|
|
1650
1646
|
return /* @__PURE__ */ e.jsxs("div", { className: "xbg-red-100 ml-6 flex items-center gap-2", children: [
|
|
1651
|
-
/* @__PURE__ */ e.jsx(
|
|
1647
|
+
/* @__PURE__ */ e.jsx(xs, { checked: a, onCheckedChange: t }),
|
|
1652
1648
|
/* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
|
|
1653
1649
|
] });
|
|
1654
1650
|
}
|
|
1655
|
-
function
|
|
1656
|
-
const { authToken: s } =
|
|
1657
|
-
(
|
|
1651
|
+
function ul() {
|
|
1652
|
+
const { authToken: s } = ve(), t = u(
|
|
1653
|
+
(o) => o.selectedConnectionId
|
|
1658
1654
|
), { data: a } = me({
|
|
1659
1655
|
queryKey: ["connections"],
|
|
1660
|
-
queryFn: () =>
|
|
1656
|
+
queryFn: () => ke(
|
|
1661
1657
|
"https://semaphor.cloud/api/v1/connections",
|
|
1662
1658
|
(s == null ? void 0 : s.accessToken) || ""
|
|
1663
1659
|
),
|
|
1664
1660
|
enabled: !!(s != null && s.accessToken)
|
|
1665
1661
|
// Only fetch if authToken is present
|
|
1666
1662
|
}), n = a == null ? void 0 : a.connections.find(
|
|
1667
|
-
(
|
|
1663
|
+
(o) => o.id === t
|
|
1668
1664
|
);
|
|
1669
1665
|
return n == null ? void 0 : n.type;
|
|
1670
1666
|
}
|
|
1671
|
-
function
|
|
1672
|
-
const { authToken: s } =
|
|
1667
|
+
function hl() {
|
|
1668
|
+
const { authToken: s } = ve(), t = Xe(null), a = u((i) => i.applyFilters), [n, l] = R(""), o = u((i) => i.filterValues), r = u((i) => i.card.sql), c = ul();
|
|
1673
1669
|
return /* @__PURE__ */ e.jsxs(
|
|
1674
|
-
|
|
1670
|
+
Hs,
|
|
1675
1671
|
{
|
|
1676
1672
|
openDelay: 0,
|
|
1677
|
-
onOpenChange: async (
|
|
1678
|
-
if (!
|
|
1679
|
-
return;
|
|
1673
|
+
onOpenChange: async (i) => {
|
|
1674
|
+
if (!i) return;
|
|
1680
1675
|
console.log("onOpenChange");
|
|
1681
1676
|
const x = await hs(
|
|
1682
1677
|
"https://semaphor.cloud/api/v1/filter-sql",
|
|
1683
1678
|
(s == null ? void 0 : s.accessToken) || "",
|
|
1684
1679
|
{
|
|
1685
1680
|
sql: r,
|
|
1686
|
-
active_filters:
|
|
1681
|
+
active_filters: o,
|
|
1687
1682
|
connection_type: c
|
|
1688
1683
|
}
|
|
1689
1684
|
);
|
|
1690
1685
|
console.log(x), x.sql ? (console.log(x.records), l(x.sql)) : l("Error");
|
|
1691
1686
|
},
|
|
1692
1687
|
children: [
|
|
1693
|
-
/* @__PURE__ */ e.jsx(
|
|
1694
|
-
/* @__PURE__ */ e.jsxs(
|
|
1688
|
+
/* @__PURE__ */ e.jsx($s, { asChild: !0, children: a && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "| Filter Query" }) }),
|
|
1689
|
+
/* @__PURE__ */ e.jsxs(Ps, { align: "end", className: "w-[600px]", children: [
|
|
1695
1690
|
/* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-sm bg-muted p-2", children: /* @__PURE__ */ e.jsxs("code", { ref: t, className: "font-mono text-sm", children: [
|
|
1696
1691
|
n,
|
|
1697
1692
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1711,7 +1706,7 @@ function ul() {
|
|
|
1711
1706
|
}
|
|
1712
1707
|
);
|
|
1713
1708
|
}
|
|
1714
|
-
const
|
|
1709
|
+
const ml = `
|
|
1715
1710
|
|
|
1716
1711
|
Use the following syntax to create a chart query. Please replace the x-axis, y-axis, stack-by, label, and measure with the actual column names of the table.
|
|
1717
1712
|
|
|
@@ -1758,73 +1753,73 @@ SELECT label, measure FROM table
|
|
|
1758
1753
|
- Label - Category
|
|
1759
1754
|
- Measure - Number
|
|
1760
1755
|
`;
|
|
1761
|
-
function
|
|
1756
|
+
function xl({
|
|
1762
1757
|
open: s,
|
|
1763
1758
|
setOpen: t,
|
|
1764
1759
|
userInput: a,
|
|
1765
1760
|
setUserInput: n,
|
|
1766
1761
|
triggerAIRun: l,
|
|
1767
|
-
setTriggerAIRun:
|
|
1762
|
+
setTriggerAIRun: o
|
|
1768
1763
|
}) {
|
|
1769
|
-
const r = Xe(null), c = Xe(null), { authToken:
|
|
1764
|
+
const r = Xe(null), c = Xe(null), { authToken: i } = ve(), [x, d] = R(!1), y = u((k) => k.actions.setCardSql), f = z((k) => k.dashboard.baseQueries), m = u((k) => k.actions.setRunSql), g = u((k) => k.actions.setCardType), [j, T] = R([]), C = u((k) => k.currentColumns), M = u((k) => k.card.sql), I = u((k) => k.selectedTableName), V = `
|
|
1770
1765
|
${a}
|
|
1771
1766
|
|
|
1772
1767
|
Database Query Dialect: ${I === "api" || I === "s3" ? "DuckDb" : ""}
|
|
1773
1768
|
Table Name: ${I}
|
|
1774
|
-
Table Columns: ${C == null ? void 0 : C.map((
|
|
1775
|
-
User SQL: ${
|
|
1769
|
+
Table Columns: ${C == null ? void 0 : C.map((k) => `${k.column_name} | ${k.data_type}`).join(", ")}
|
|
1770
|
+
User SQL: ${M}
|
|
1776
1771
|
${f && `Base Queries: ${JSON.stringify(f)} `}`, N = ` When the user asks for a specific chart please use the following query structure to generate the chart query. Do not make up the column names. Use only the table columns provided above for the query. Replace x-axis, y-axis, and lables with the appropriate column names.
|
|
1777
|
-
Visual Query Syntax: ${
|
|
1772
|
+
Visual Query Syntax: ${ml}`, { data: w, isLoading: L, isFetching: h, isError: v, refetch: p } = me({
|
|
1778
1773
|
queryKey: ["ai-query"],
|
|
1779
|
-
queryFn: () =>
|
|
1774
|
+
queryFn: () => ke(
|
|
1780
1775
|
"https://semaphor.cloud/api/v1/ai",
|
|
1781
|
-
(
|
|
1776
|
+
(i == null ? void 0 : i.accessToken) || "",
|
|
1782
1777
|
{
|
|
1783
|
-
user_content: `userContent: ${
|
|
1778
|
+
user_content: `userContent: ${V} ${x ? N : ""}`
|
|
1784
1779
|
}
|
|
1785
1780
|
),
|
|
1786
1781
|
enabled: !1
|
|
1787
1782
|
// Do not run by default.
|
|
1788
1783
|
});
|
|
1789
|
-
function k
|
|
1790
|
-
if (
|
|
1784
|
+
function O(k) {
|
|
1785
|
+
if (k.toLowerCase().includes("bar"))
|
|
1791
1786
|
g("bar");
|
|
1792
|
-
else if (
|
|
1787
|
+
else if (k.toLowerCase().includes("line"))
|
|
1793
1788
|
g("line");
|
|
1794
|
-
else if (
|
|
1789
|
+
else if (k.toLowerCase().includes("bubble"))
|
|
1795
1790
|
g("bubble");
|
|
1796
|
-
else if (
|
|
1791
|
+
else if (k.toLowerCase().includes("scatter"))
|
|
1797
1792
|
g("scatter");
|
|
1798
|
-
else if (
|
|
1793
|
+
else if (k.toLowerCase().includes("stacked"))
|
|
1799
1794
|
g("stackedBar");
|
|
1800
|
-
else if (
|
|
1795
|
+
else if (k.toLowerCase().includes("pie"))
|
|
1801
1796
|
g("pie");
|
|
1802
|
-
else if (
|
|
1797
|
+
else if (k.toLowerCase().includes("donut") || k.toLowerCase().includes("doughnut"))
|
|
1803
1798
|
g("doughnut");
|
|
1804
|
-
else if (
|
|
1799
|
+
else if (k.toLowerCase().includes("radar"))
|
|
1805
1800
|
g("radar");
|
|
1806
1801
|
else
|
|
1807
1802
|
return g("bar"), !1;
|
|
1808
1803
|
return !0;
|
|
1809
1804
|
}
|
|
1810
1805
|
Z(() => {
|
|
1811
|
-
|
|
1812
|
-
}, [
|
|
1813
|
-
const
|
|
1806
|
+
w && T((k) => [...k, { role: "ai", content: w.response }]);
|
|
1807
|
+
}, [w]), Z(() => {
|
|
1808
|
+
const k = setTimeout(() => {
|
|
1814
1809
|
var _;
|
|
1815
1810
|
c.current && (c.current.scroll({
|
|
1816
1811
|
top: c.current.scrollHeight,
|
|
1817
1812
|
behavior: "smooth"
|
|
1818
1813
|
}), (_ = r.current) == null || _.focus());
|
|
1819
1814
|
}, 100);
|
|
1820
|
-
return () => clearTimeout(
|
|
1815
|
+
return () => clearTimeout(k);
|
|
1821
1816
|
}, [j]);
|
|
1822
|
-
function
|
|
1823
|
-
a && (
|
|
1817
|
+
function E() {
|
|
1818
|
+
a && (T((k) => [...k, { role: "user", content: a }]), O(a) && d(!0), n(""), p());
|
|
1824
1819
|
}
|
|
1825
1820
|
Z(() => {
|
|
1826
|
-
l && (
|
|
1827
|
-
}, [l,
|
|
1821
|
+
l && (E(), o(!1));
|
|
1822
|
+
}, [l, o]);
|
|
1828
1823
|
const $ = {
|
|
1829
1824
|
//seleect a darker color
|
|
1830
1825
|
// color: '#000',
|
|
@@ -1852,9 +1847,9 @@ function ml({
|
|
|
1852
1847
|
listStyleType: "disc"
|
|
1853
1848
|
}, le = {
|
|
1854
1849
|
// Override how paragraphs are rendered
|
|
1855
|
-
p: ({ node:
|
|
1856
|
-
code: ({ node:
|
|
1857
|
-
pre: ({ node:
|
|
1850
|
+
p: ({ node: k, ..._ }) => /* @__PURE__ */ e.jsx("p", { style: $, ..._ }),
|
|
1851
|
+
code: ({ node: k, ..._ }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ..._ }),
|
|
1852
|
+
pre: ({ node: k, ..._ }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: B, children: [
|
|
1858
1853
|
/* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: _.children }),
|
|
1859
1854
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
|
|
1860
1855
|
/* @__PURE__ */ e.jsx(F, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(ba, {}) }),
|
|
@@ -1862,8 +1857,8 @@ function ml({
|
|
|
1862
1857
|
F,
|
|
1863
1858
|
{
|
|
1864
1859
|
onClick: (ee) => {
|
|
1865
|
-
const
|
|
1866
|
-
|
|
1860
|
+
const A = J(ee);
|
|
1861
|
+
A && (t(!1), y(A), m(!0));
|
|
1867
1862
|
},
|
|
1868
1863
|
size: "sm",
|
|
1869
1864
|
variant: "outline",
|
|
@@ -1872,39 +1867,38 @@ function ml({
|
|
|
1872
1867
|
)
|
|
1873
1868
|
] })
|
|
1874
1869
|
] }),
|
|
1875
|
-
li: ({ node:
|
|
1870
|
+
li: ({ node: k, ..._ }) => /* @__PURE__ */ e.jsx("li", { style: Y, ..._ })
|
|
1876
1871
|
// You can add more overrides for other elements like h1, h2, etc.
|
|
1877
1872
|
};
|
|
1878
|
-
function J(
|
|
1879
|
-
const _ =
|
|
1880
|
-
if (!_)
|
|
1881
|
-
return;
|
|
1873
|
+
function J(k) {
|
|
1874
|
+
const _ = k.currentTarget.closest("pre");
|
|
1875
|
+
if (!_) return;
|
|
1882
1876
|
const ee = _.textContent || _.innerText;
|
|
1883
|
-
return navigator.clipboard.writeText(ee).then(() => console.log("Text copied to clipboard")).catch((
|
|
1877
|
+
return navigator.clipboard.writeText(ee).then(() => console.log("Text copied to clipboard")).catch((A) => console.error("Error in copying text: ", A)), ee;
|
|
1884
1878
|
}
|
|
1885
1879
|
function ne() {
|
|
1886
|
-
return j == null ? void 0 : j.map((
|
|
1880
|
+
return j == null ? void 0 : j.map((k, _) => k.role === "user" ? /* @__PURE__ */ e.jsxs(
|
|
1887
1881
|
"div",
|
|
1888
1882
|
{
|
|
1889
1883
|
className: "flex items-start rounded-md bg-muted p-3 text-sm",
|
|
1890
1884
|
children: [
|
|
1891
|
-
/* @__PURE__ */ e.jsx(
|
|
1892
|
-
/* @__PURE__ */ e.jsx("div", { children:
|
|
1885
|
+
/* @__PURE__ */ e.jsx(Xn, { className: "mr-2 h-5 w-5" }),
|
|
1886
|
+
/* @__PURE__ */ e.jsx("div", { children: k.content })
|
|
1893
1887
|
]
|
|
1894
1888
|
},
|
|
1895
1889
|
_
|
|
1896
|
-
) :
|
|
1890
|
+
) : k.role === "ai" ? /* @__PURE__ */ e.jsx(
|
|
1897
1891
|
yt,
|
|
1898
1892
|
{
|
|
1899
1893
|
className: "w-full overflow-auto py-1",
|
|
1900
1894
|
components: le,
|
|
1901
|
-
children:
|
|
1895
|
+
children: w == null ? void 0 : w.response.replace(/DuckDB/gi, "Semaphor")
|
|
1902
1896
|
},
|
|
1903
1897
|
_
|
|
1904
1898
|
) : /* @__PURE__ */ e.jsx("div", {}, _));
|
|
1905
1899
|
}
|
|
1906
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1907
|
-
/* @__PURE__ */ e.jsx(
|
|
1900
|
+
return /* @__PURE__ */ e.jsxs(Ts, { open: s, onOpenChange: t, children: [
|
|
1901
|
+
/* @__PURE__ */ e.jsx(Ds, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
1908
1902
|
F,
|
|
1909
1903
|
{
|
|
1910
1904
|
size: "sm",
|
|
@@ -1914,13 +1908,13 @@ function ml({
|
|
|
1914
1908
|
}
|
|
1915
1909
|
) }),
|
|
1916
1910
|
/* @__PURE__ */ e.jsxs(
|
|
1917
|
-
|
|
1911
|
+
Ls,
|
|
1918
1912
|
{
|
|
1919
1913
|
className: "flex flex-col justify-between overflow-auto sm:max-w-[425px] md:max-h-[625px] md:min-w-[625px]",
|
|
1920
1914
|
children: [
|
|
1921
|
-
/* @__PURE__ */ e.jsxs(
|
|
1922
|
-
/* @__PURE__ */ e.jsx(
|
|
1923
|
-
/* @__PURE__ */ e.jsx(
|
|
1915
|
+
/* @__PURE__ */ e.jsxs(Es, { children: [
|
|
1916
|
+
/* @__PURE__ */ e.jsx(As, { children: "Assistant" }),
|
|
1917
|
+
/* @__PURE__ */ e.jsx(Vs, { children: "What can I help you with?" })
|
|
1924
1918
|
] }),
|
|
1925
1919
|
/* @__PURE__ */ e.jsx(
|
|
1926
1920
|
"div",
|
|
@@ -1939,20 +1933,20 @@ function ml({
|
|
|
1939
1933
|
{
|
|
1940
1934
|
autoFocus: !0,
|
|
1941
1935
|
ref: r,
|
|
1942
|
-
onKeyDown: (
|
|
1943
|
-
|
|
1936
|
+
onKeyDown: (k) => {
|
|
1937
|
+
k.key === "Enter" && !k.shiftKey && (k.preventDefault(), n(""), E());
|
|
1944
1938
|
},
|
|
1945
1939
|
placeholder: "Type your question here...",
|
|
1946
|
-
onFocus: (
|
|
1947
|
-
const _ =
|
|
1940
|
+
onFocus: (k) => {
|
|
1941
|
+
const _ = k.target, ee = _.value.length;
|
|
1948
1942
|
_.setSelectionRange(ee, ee);
|
|
1949
1943
|
},
|
|
1950
1944
|
className: W(
|
|
1951
1945
|
"max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
|
|
1952
1946
|
),
|
|
1953
|
-
disabled:
|
|
1947
|
+
disabled: L || h,
|
|
1954
1948
|
value: a,
|
|
1955
|
-
onChange: (
|
|
1949
|
+
onChange: (k) => n(k.target.value)
|
|
1956
1950
|
}
|
|
1957
1951
|
),
|
|
1958
1952
|
" ",
|
|
@@ -1962,8 +1956,8 @@ function ml({
|
|
|
1962
1956
|
className: "h-8",
|
|
1963
1957
|
size: "sm",
|
|
1964
1958
|
variant: "ghost",
|
|
1965
|
-
onClick:
|
|
1966
|
-
children: !
|
|
1959
|
+
onClick: E,
|
|
1960
|
+
children: !L && !h ? /* @__PURE__ */ e.jsx(bt, {}) : /* @__PURE__ */ e.jsx(Ze, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
|
|
1967
1961
|
}
|
|
1968
1962
|
)
|
|
1969
1963
|
] })
|
|
@@ -1980,24 +1974,25 @@ var Ha = {
|
|
|
1980
1974
|
className: void 0,
|
|
1981
1975
|
style: void 0,
|
|
1982
1976
|
attr: void 0
|
|
1983
|
-
}, na = ze.createContext && /* @__PURE__ */ ze.createContext(Ha),
|
|
1984
|
-
function
|
|
1985
|
-
if (s == null)
|
|
1986
|
-
|
|
1987
|
-
var a = fl(s, t), n, l;
|
|
1977
|
+
}, na = ze.createContext && /* @__PURE__ */ ze.createContext(Ha), pl = ["attr", "size", "title"];
|
|
1978
|
+
function fl(s, t) {
|
|
1979
|
+
if (s == null) return {};
|
|
1980
|
+
var a = gl(s, t), n, l;
|
|
1988
1981
|
if (Object.getOwnPropertySymbols) {
|
|
1989
|
-
var
|
|
1990
|
-
for (l = 0; l <
|
|
1991
|
-
n =
|
|
1982
|
+
var o = Object.getOwnPropertySymbols(s);
|
|
1983
|
+
for (l = 0; l < o.length; l++)
|
|
1984
|
+
n = o[l], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (a[n] = s[n]);
|
|
1992
1985
|
}
|
|
1993
1986
|
return a;
|
|
1994
1987
|
}
|
|
1995
|
-
function
|
|
1996
|
-
if (s == null)
|
|
1997
|
-
|
|
1998
|
-
var
|
|
1999
|
-
|
|
2000
|
-
|
|
1988
|
+
function gl(s, t) {
|
|
1989
|
+
if (s == null) return {};
|
|
1990
|
+
var a = {};
|
|
1991
|
+
for (var n in s)
|
|
1992
|
+
if (Object.prototype.hasOwnProperty.call(s, n)) {
|
|
1993
|
+
if (t.indexOf(n) >= 0) continue;
|
|
1994
|
+
a[n] = s[n];
|
|
1995
|
+
}
|
|
2001
1996
|
return a;
|
|
2002
1997
|
}
|
|
2003
1998
|
function ds() {
|
|
@@ -2024,28 +2019,26 @@ function us(s) {
|
|
|
2024
2019
|
for (var t = 1; t < arguments.length; t++) {
|
|
2025
2020
|
var a = arguments[t] != null ? arguments[t] : {};
|
|
2026
2021
|
t % 2 ? la(Object(a), !0).forEach(function(n) {
|
|
2027
|
-
|
|
2022
|
+
jl(s, n, a[n]);
|
|
2028
2023
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(a)) : la(Object(a)).forEach(function(n) {
|
|
2029
2024
|
Object.defineProperty(s, n, Object.getOwnPropertyDescriptor(a, n));
|
|
2030
2025
|
});
|
|
2031
2026
|
}
|
|
2032
2027
|
return s;
|
|
2033
2028
|
}
|
|
2034
|
-
function
|
|
2035
|
-
return t =
|
|
2029
|
+
function jl(s, t, a) {
|
|
2030
|
+
return t = bl(t), t in s ? Object.defineProperty(s, t, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : s[t] = a, s;
|
|
2036
2031
|
}
|
|
2037
|
-
function
|
|
2038
|
-
var t =
|
|
2039
|
-
return typeof t == "symbol" ? t :
|
|
2032
|
+
function bl(s) {
|
|
2033
|
+
var t = yl(s, "string");
|
|
2034
|
+
return typeof t == "symbol" ? t : t + "";
|
|
2040
2035
|
}
|
|
2041
|
-
function
|
|
2042
|
-
if (typeof s != "object" || s
|
|
2043
|
-
return s;
|
|
2036
|
+
function yl(s, t) {
|
|
2037
|
+
if (typeof s != "object" || !s) return s;
|
|
2044
2038
|
var a = s[Symbol.toPrimitive];
|
|
2045
2039
|
if (a !== void 0) {
|
|
2046
2040
|
var n = a.call(s, t || "default");
|
|
2047
|
-
if (typeof n != "object")
|
|
2048
|
-
return n;
|
|
2041
|
+
if (typeof n != "object") return n;
|
|
2049
2042
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2050
2043
|
}
|
|
2051
2044
|
return (t === "string" ? String : Number)(s);
|
|
@@ -2055,76 +2048,76 @@ function $a(s) {
|
|
|
2055
2048
|
key: a
|
|
2056
2049
|
}, t.attr), $a(t.child)));
|
|
2057
2050
|
}
|
|
2058
|
-
function
|
|
2059
|
-
return (t) => /* @__PURE__ */ ze.createElement(
|
|
2051
|
+
function Ce(s) {
|
|
2052
|
+
return (t) => /* @__PURE__ */ ze.createElement(vl, ds({
|
|
2060
2053
|
attr: us({}, s.attr)
|
|
2061
2054
|
}, t), $a(s.child));
|
|
2062
2055
|
}
|
|
2063
|
-
function
|
|
2056
|
+
function vl(s) {
|
|
2064
2057
|
var t = (a) => {
|
|
2065
2058
|
var {
|
|
2066
2059
|
attr: n,
|
|
2067
2060
|
size: l,
|
|
2068
|
-
title:
|
|
2069
|
-
} = s, r =
|
|
2070
|
-
return a.className && (
|
|
2061
|
+
title: o
|
|
2062
|
+
} = s, r = fl(s, pl), c = l || a.size || "1em", i;
|
|
2063
|
+
return a.className && (i = a.className), s.className && (i = (i ? i + " " : "") + s.className), /* @__PURE__ */ ze.createElement("svg", ds({
|
|
2071
2064
|
stroke: "currentColor",
|
|
2072
2065
|
fill: "currentColor",
|
|
2073
2066
|
strokeWidth: "0"
|
|
2074
2067
|
}, a.attr, n, r, {
|
|
2075
|
-
className:
|
|
2068
|
+
className: i,
|
|
2076
2069
|
style: us(us({
|
|
2077
2070
|
color: s.color || a.color
|
|
2078
2071
|
}, a.style), s.style),
|
|
2079
2072
|
height: c,
|
|
2080
2073
|
width: c,
|
|
2081
2074
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2082
|
-
}),
|
|
2075
|
+
}), o && /* @__PURE__ */ ze.createElement("title", null, o), s.children);
|
|
2083
2076
|
};
|
|
2084
2077
|
return na !== void 0 ? /* @__PURE__ */ ze.createElement(na.Consumer, null, (a) => t(a)) : t(Ha);
|
|
2085
2078
|
}
|
|
2086
|
-
function
|
|
2087
|
-
return
|
|
2079
|
+
function Cl(s) {
|
|
2080
|
+
return Ce({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(s);
|
|
2088
2081
|
}
|
|
2089
|
-
function
|
|
2082
|
+
function Nl() {
|
|
2090
2083
|
const [s, t] = R({
|
|
2091
2084
|
queryKey: [],
|
|
2092
2085
|
queryData: null
|
|
2093
|
-
}), { theme: a } = Ct(), n = Nt(), l = Xe(),
|
|
2086
|
+
}), { theme: a } = Ct(), n = Nt(), l = Xe(), o = Xe(), [r, c] = R(!1), [i, x] = R(!1), [d, y] = R(!1), [f, m] = R(""), [g, j] = R(!1), T = z((b) => b.selectedSheetId);
|
|
2094
2087
|
z((b) => b.dashboard.baseQueries);
|
|
2095
|
-
const C = u((b) => b.card),
|
|
2088
|
+
const C = u((b) => b.card), M = z((b) => b.theme), I = u((b) => b.isShowingVisual);
|
|
2096
2089
|
z((b) => b.onAcceptChanges);
|
|
2097
|
-
const
|
|
2090
|
+
const V = u(
|
|
2098
2091
|
(b) => b.selectedConnectionId
|
|
2099
2092
|
), N = u(
|
|
2100
2093
|
(b) => b.selectedDatabaseName
|
|
2101
|
-
),
|
|
2094
|
+
), w = u(
|
|
2102
2095
|
(b) => b.selectedDatamodelId
|
|
2103
|
-
),
|
|
2096
|
+
), L = u(
|
|
2104
2097
|
(b) => b.selectedSchemaName
|
|
2105
2098
|
);
|
|
2106
2099
|
z(
|
|
2107
2100
|
(b) => b.actions.updateFrameCard
|
|
2108
2101
|
);
|
|
2109
|
-
const h = u((b) => b.selectedTableName), v = u((b) => b.card.sql), p = u((b) => b.card.python),
|
|
2110
|
-
(b) => b.sheetId ===
|
|
2102
|
+
const h = u((b) => b.selectedTableName), v = u((b) => b.card.sql), p = u((b) => b.card.python), O = u((b) => b.frame), E = z((b) => b.dashboard.filters), $ = z((b) => b.filterValues), B = E == null ? void 0 : E.filter(
|
|
2103
|
+
(b) => b.sheetId === T || !b.sheetId
|
|
2111
2104
|
), Y = $ == null ? void 0 : $.filter(
|
|
2112
|
-
(b) => (B == null ? void 0 : B.some((te) => te.id === b.filterId)) || b.filterId.endsWith(
|
|
2105
|
+
(b) => (B == null ? void 0 : B.some((te) => te.id === b.filterId)) || b.filterId.endsWith(T)
|
|
2113
2106
|
), le = u((b) => b.applyFilters), {
|
|
2114
2107
|
setCardCustomCfg: J,
|
|
2115
2108
|
setQueryResultColumns: ne,
|
|
2116
|
-
setFilterValues:
|
|
2109
|
+
setFilterValues: k,
|
|
2117
2110
|
setCardSql: _,
|
|
2118
2111
|
setCard: ee,
|
|
2119
|
-
setCardPython:
|
|
2120
|
-
setQueryError:
|
|
2112
|
+
setCardPython: A,
|
|
2113
|
+
setQueryError: D,
|
|
2121
2114
|
setPythonStdOut: se,
|
|
2122
2115
|
setCardPreferences: P
|
|
2123
2116
|
} = u((b) => b.actions), X = u((b) => b.onSave), ie = u(
|
|
2124
2117
|
(b) => b.actions.setApplyFilters
|
|
2125
|
-
),
|
|
2118
|
+
), Ne = u((b) => b.onClose), Le = u((b) => b.actions.setSqlGen), Se = u((b) => b.runSql), Fe = u((b) => b.actions.setRunSql);
|
|
2126
2119
|
u((b) => b.actions.setCardCfg);
|
|
2127
|
-
const
|
|
2120
|
+
const we = u(
|
|
2128
2121
|
(b) => b.actions.setIsSqlRunning
|
|
2129
2122
|
), {
|
|
2130
2123
|
data: ae,
|
|
@@ -2141,7 +2134,7 @@ function Cl() {
|
|
|
2141
2134
|
position: "top-center",
|
|
2142
2135
|
richColors: !0
|
|
2143
2136
|
}), se((ae == null ? void 0 : ae.output) || ""), ae.records.length > 0)) {
|
|
2144
|
-
const { dimensionKeys: b } =
|
|
2137
|
+
const { dimensionKeys: b } = ws(ae.records);
|
|
2145
2138
|
ne(b);
|
|
2146
2139
|
}
|
|
2147
2140
|
}, [
|
|
@@ -2150,7 +2143,7 @@ function Cl() {
|
|
|
2150
2143
|
ne,
|
|
2151
2144
|
se
|
|
2152
2145
|
]), Z(() => {
|
|
2153
|
-
(ue || he) &&
|
|
2146
|
+
(ue || he) && we(!0), (Ee || es) && we(!1), Ee ? (D(He.message), ne([]), se("")) : D("");
|
|
2154
2147
|
}, [
|
|
2155
2148
|
ue,
|
|
2156
2149
|
he,
|
|
@@ -2158,14 +2151,14 @@ function Cl() {
|
|
|
2158
2151
|
se,
|
|
2159
2152
|
Ee,
|
|
2160
2153
|
es,
|
|
2161
|
-
|
|
2154
|
+
we,
|
|
2162
2155
|
ne,
|
|
2163
|
-
|
|
2156
|
+
D,
|
|
2164
2157
|
He
|
|
2165
2158
|
]), Z(() => {
|
|
2166
|
-
|
|
2167
|
-
}, [
|
|
2168
|
-
function
|
|
2159
|
+
Se && (Ae(), Fe(!1));
|
|
2160
|
+
}, [Se, Ae, Fe]);
|
|
2161
|
+
function vs() {
|
|
2169
2162
|
const b = n.getQueryData($e);
|
|
2170
2163
|
s.queryData || t({
|
|
2171
2164
|
queryKey: $e,
|
|
@@ -2173,7 +2166,7 @@ function Cl() {
|
|
|
2173
2166
|
}), n.setQueryData($e, null), _(""), Le({}), J(""), P({});
|
|
2174
2167
|
}
|
|
2175
2168
|
const Pe = (b) => {
|
|
2176
|
-
|
|
2169
|
+
o.current = b;
|
|
2177
2170
|
};
|
|
2178
2171
|
function ss(b, te) {
|
|
2179
2172
|
if (b.length === 0)
|
|
@@ -2197,34 +2190,34 @@ function Cl() {
|
|
|
2197
2190
|
}
|
|
2198
2191
|
function as() {
|
|
2199
2192
|
let b = v;
|
|
2200
|
-
v && !v.includes("{{") && (b =
|
|
2193
|
+
v && !v.includes("{{") && (b = ol(v), _(b));
|
|
2201
2194
|
const te = {
|
|
2202
2195
|
...C,
|
|
2203
|
-
lastSelectedSchema:
|
|
2204
|
-
lastSelectedDatamodelId:
|
|
2196
|
+
lastSelectedSchema: L,
|
|
2197
|
+
lastSelectedDatamodelId: w,
|
|
2205
2198
|
lastSelectedDatabase: N,
|
|
2206
2199
|
lastSelectedTable: h,
|
|
2207
|
-
connectionId:
|
|
2200
|
+
connectionId: V,
|
|
2208
2201
|
type: I ? C.type : "table",
|
|
2209
2202
|
sql: b,
|
|
2210
2203
|
customCfg: I ? C.customCfg : null
|
|
2211
|
-
}, Ie =
|
|
2212
|
-
(
|
|
2204
|
+
}, Ie = O.cards.map(
|
|
2205
|
+
(Cs) => Cs.id === C.id ? te : Cs
|
|
2213
2206
|
), oe = {
|
|
2214
|
-
...
|
|
2207
|
+
...O,
|
|
2215
2208
|
cards: Ie,
|
|
2216
|
-
activeCardId: ss(Ie,
|
|
2209
|
+
activeCardId: ss(Ie, O.activeCardId)
|
|
2217
2210
|
};
|
|
2218
2211
|
X == null || X(oe);
|
|
2219
2212
|
}
|
|
2220
2213
|
function ts() {
|
|
2221
2214
|
const { queryKey: b, queryData: te } = s;
|
|
2222
|
-
b && te && n.setQueryData(b, te),
|
|
2215
|
+
b && te && n.setQueryData(b, te), Ne == null || Ne();
|
|
2223
2216
|
}
|
|
2224
2217
|
Z(() => {
|
|
2225
|
-
const b = l.current, te =
|
|
2218
|
+
const b = l.current, te = o.current;
|
|
2226
2219
|
if (b) {
|
|
2227
|
-
const Ie = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", oe =
|
|
2220
|
+
const Ie = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", oe = M === "system" ? Ie : M;
|
|
2228
2221
|
b.editor.defineTheme("default", {
|
|
2229
2222
|
// base: theme === 'light' ? 'hc-light' : 'vs-dark',
|
|
2230
2223
|
base: oe === "light" ? "vs" : "vs-dark",
|
|
@@ -2243,13 +2236,13 @@ function Cl() {
|
|
|
2243
2236
|
}
|
|
2244
2237
|
), () => {
|
|
2245
2238
|
};
|
|
2246
|
-
}, [a,
|
|
2239
|
+
}, [a, M, l.current]);
|
|
2247
2240
|
function Be(b) {
|
|
2248
2241
|
l.current = b;
|
|
2249
2242
|
}
|
|
2250
2243
|
function S() {
|
|
2251
2244
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2252
|
-
|
|
2245
|
+
i && /* @__PURE__ */ e.jsx(
|
|
2253
2246
|
"div",
|
|
2254
2247
|
{
|
|
2255
2248
|
className: "xbg-yellow-100 relative flex w-1/3 min-w-0 grow overflow-hidden border-l p-1 text-xs",
|
|
@@ -2257,15 +2250,15 @@ function Cl() {
|
|
|
2257
2250
|
children: /* @__PURE__ */ e.jsxs("div", { className: "w-[99%]", children: [
|
|
2258
2251
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-3", children: [
|
|
2259
2252
|
/* @__PURE__ */ e.jsx(
|
|
2260
|
-
|
|
2253
|
+
dl,
|
|
2261
2254
|
{
|
|
2262
2255
|
checked: le,
|
|
2263
2256
|
onCheckedChange: () => ie(!le),
|
|
2264
2257
|
text: "Apply Filters"
|
|
2265
2258
|
}
|
|
2266
2259
|
),
|
|
2267
|
-
/* @__PURE__ */ e.jsx(
|
|
2268
|
-
Y &&
|
|
2260
|
+
/* @__PURE__ */ e.jsx(hl, {}),
|
|
2261
|
+
Y && i && /* @__PURE__ */ e.jsx(
|
|
2269
2262
|
Je,
|
|
2270
2263
|
{
|
|
2271
2264
|
onClick: () => x(!1),
|
|
@@ -2280,7 +2273,7 @@ function Cl() {
|
|
|
2280
2273
|
onChange: (b) => {
|
|
2281
2274
|
if (b)
|
|
2282
2275
|
try {
|
|
2283
|
-
JSON.parse(b),
|
|
2276
|
+
JSON.parse(b), k(JSON.parse(b));
|
|
2284
2277
|
} catch {
|
|
2285
2278
|
}
|
|
2286
2279
|
},
|
|
@@ -2307,7 +2300,7 @@ function Cl() {
|
|
|
2307
2300
|
] })
|
|
2308
2301
|
}
|
|
2309
2302
|
),
|
|
2310
|
-
Y && !
|
|
2303
|
+
Y && !i && /* @__PURE__ */ e.jsx(
|
|
2311
2304
|
ha,
|
|
2312
2305
|
{
|
|
2313
2306
|
onClick: () => x(!0),
|
|
@@ -2323,7 +2316,7 @@ function Cl() {
|
|
|
2323
2316
|
}
|
|
2324
2317
|
function tt() {
|
|
2325
2318
|
return /* @__PURE__ */ e.jsxs(
|
|
2326
|
-
|
|
2319
|
+
ks,
|
|
2327
2320
|
{
|
|
2328
2321
|
className: "flex grow pb-1",
|
|
2329
2322
|
direction: "vertical",
|
|
@@ -2375,7 +2368,7 @@ function Cl() {
|
|
|
2375
2368
|
}
|
|
2376
2369
|
),
|
|
2377
2370
|
r && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2378
|
-
/* @__PURE__ */ e.jsx(
|
|
2371
|
+
/* @__PURE__ */ e.jsx(Os, { withHandle: !0, className: "border" }),
|
|
2379
2372
|
/* @__PURE__ */ e.jsxs(
|
|
2380
2373
|
Ve,
|
|
2381
2374
|
{
|
|
@@ -2395,7 +2388,7 @@ function Cl() {
|
|
|
2395
2388
|
className: "pt-3",
|
|
2396
2389
|
theme: "default",
|
|
2397
2390
|
onChange: (b) => {
|
|
2398
|
-
|
|
2391
|
+
A(b && b.trim() || "");
|
|
2399
2392
|
},
|
|
2400
2393
|
value: p || kt,
|
|
2401
2394
|
options: {
|
|
@@ -2464,13 +2457,13 @@ function Cl() {
|
|
|
2464
2457
|
size: "sm",
|
|
2465
2458
|
variant: "outline",
|
|
2466
2459
|
children: [
|
|
2467
|
-
ue || he ? /* @__PURE__ */ e.jsx(Ze, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(
|
|
2460
|
+
ue || he ? /* @__PURE__ */ e.jsx(Ze, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(Bn, { className: "mr-2 h-4 w-4" }),
|
|
2468
2461
|
"Run"
|
|
2469
2462
|
]
|
|
2470
2463
|
}
|
|
2471
2464
|
),
|
|
2472
2465
|
Ee && /* @__PURE__ */ e.jsx(
|
|
2473
|
-
|
|
2466
|
+
cl,
|
|
2474
2467
|
{
|
|
2475
2468
|
error: He.message,
|
|
2476
2469
|
setShowAIDialog: y,
|
|
@@ -2481,12 +2474,12 @@ function Cl() {
|
|
|
2481
2474
|
/* @__PURE__ */ e.jsxs(
|
|
2482
2475
|
F,
|
|
2483
2476
|
{
|
|
2484
|
-
onClick:
|
|
2477
|
+
onClick: vs,
|
|
2485
2478
|
className: "",
|
|
2486
2479
|
size: "sm",
|
|
2487
2480
|
variant: "outline",
|
|
2488
2481
|
children: [
|
|
2489
|
-
/* @__PURE__ */ e.jsx(
|
|
2482
|
+
/* @__PURE__ */ e.jsx(Dn, { className: "mr-2 size-4" }),
|
|
2490
2483
|
"Clear"
|
|
2491
2484
|
]
|
|
2492
2485
|
}
|
|
@@ -2499,11 +2492,11 @@ function Cl() {
|
|
|
2499
2492
|
className: "",
|
|
2500
2493
|
size: "sm",
|
|
2501
2494
|
variant: "outline",
|
|
2502
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2495
|
+
children: /* @__PURE__ */ e.jsx(Cl, { className: "size-4 text-foreground/70" })
|
|
2503
2496
|
}
|
|
2504
2497
|
),
|
|
2505
2498
|
/* @__PURE__ */ e.jsx(
|
|
2506
|
-
|
|
2499
|
+
xl,
|
|
2507
2500
|
{
|
|
2508
2501
|
open: d,
|
|
2509
2502
|
setOpen: y,
|
|
@@ -2549,26 +2542,26 @@ function Cl() {
|
|
|
2549
2542
|
)
|
|
2550
2543
|
);
|
|
2551
2544
|
}
|
|
2552
|
-
function
|
|
2545
|
+
function Sl({ data: s }) {
|
|
2553
2546
|
var r;
|
|
2554
2547
|
const [t, a] = ze.useState([]), l = Object.keys(s[0]).map((c) => ({
|
|
2555
2548
|
// header: key,
|
|
2556
2549
|
accessorKey: c,
|
|
2557
|
-
header: ({ column:
|
|
2558
|
-
const x =
|
|
2550
|
+
header: ({ column: i }) => {
|
|
2551
|
+
const x = i.getIsSorted();
|
|
2559
2552
|
return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
|
|
2560
2553
|
"div",
|
|
2561
2554
|
{
|
|
2562
2555
|
className: "flex cursor-pointer items-center",
|
|
2563
|
-
onClick: () =>
|
|
2556
|
+
onClick: () => i.toggleSorting(i.getIsSorted() === "asc"),
|
|
2564
2557
|
children: [
|
|
2565
2558
|
c,
|
|
2566
|
-
x === "asc" ? /* @__PURE__ */ e.jsx(
|
|
2559
|
+
x === "asc" ? /* @__PURE__ */ e.jsx(Ot, { className: "ml-2 h-5 w-5" }) : x === "desc" ? /* @__PURE__ */ e.jsx(zt, { className: "ml-2 h-5 w-5" }) : null
|
|
2567
2560
|
]
|
|
2568
2561
|
}
|
|
2569
2562
|
) });
|
|
2570
2563
|
}
|
|
2571
|
-
})),
|
|
2564
|
+
})), o = Ft({
|
|
2572
2565
|
data: s,
|
|
2573
2566
|
columns: l,
|
|
2574
2567
|
getCoreRowModel: Lt(),
|
|
@@ -2581,74 +2574,75 @@ function Nl({ data: s }) {
|
|
|
2581
2574
|
}
|
|
2582
2575
|
});
|
|
2583
2576
|
return /* @__PURE__ */ e.jsxs(It, { children: [
|
|
2584
|
-
/* @__PURE__ */ e.jsx(Tt, { children:
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
) },
|
|
2588
|
-
/* @__PURE__ */ e.jsx(Mt, { children: (r =
|
|
2589
|
-
|
|
2577
|
+
/* @__PURE__ */ e.jsx(Tt, { children: o.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(Ns, { children: c.headers.map((i) => /* @__PURE__ */ e.jsx(Dt, { className: "sticky top-0 bg-muted", children: i.isPlaceholder ? null : Zs(
|
|
2578
|
+
i.column.columnDef.header,
|
|
2579
|
+
i.getContext()
|
|
2580
|
+
) }, i.id)) }, c.id)) }),
|
|
2581
|
+
/* @__PURE__ */ e.jsx(Mt, { children: (r = o.getRowModel().rows) != null && r.length ? o.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
|
|
2582
|
+
Ns,
|
|
2590
2583
|
{
|
|
2591
2584
|
className: "whitespace-nowrap py-2",
|
|
2592
2585
|
"data-state": c.getIsSelected() && "selected",
|
|
2593
|
-
children: c.getVisibleCells().map((
|
|
2586
|
+
children: c.getVisibleCells().map((i) => /* @__PURE__ */ e.jsx(ea, { children: Zs(i.column.columnDef.cell, i.getContext()) }, i.id))
|
|
2594
2587
|
},
|
|
2595
2588
|
c.id
|
|
2596
|
-
)) : /* @__PURE__ */ e.jsx(
|
|
2589
|
+
)) : /* @__PURE__ */ e.jsx(Ns, { children: /* @__PURE__ */ e.jsx(ea, { colSpan: l.length, className: "h-24 text-center", children: "No results." }) }) })
|
|
2597
2590
|
] });
|
|
2598
2591
|
}
|
|
2599
|
-
function
|
|
2600
|
-
var
|
|
2601
|
-
const t = z((
|
|
2602
|
-
colors: ((
|
|
2592
|
+
function wl({ card: s }) {
|
|
2593
|
+
var f, m, g, j, T, C, M, I, V, N;
|
|
2594
|
+
const { authToken: t } = ve(), a = Vt(t == null ? void 0 : t.accessToken), n = z((w) => w.themeStyle), l = {
|
|
2595
|
+
colors: ((m = (f = n == null ? void 0 : n.chart) == null ? void 0 : f.dataset) == null ? void 0 : m.backgroundColor) || []
|
|
2603
2596
|
};
|
|
2604
|
-
(
|
|
2605
|
-
const { getCard:
|
|
2597
|
+
(g = s.customCardPreferences) != null && g.inputData;
|
|
2598
|
+
const { getCard: o } = va(((j = s.customCardPreferences) == null ? void 0 : j.url) || ""), r = ((T = s.customCardPreferences) == null ? void 0 : T.visualType) || "single", c = u((w) => w.frame);
|
|
2606
2599
|
ce();
|
|
2607
|
-
const { data:
|
|
2608
|
-
if (!((
|
|
2600
|
+
const { data: i } = qe(s);
|
|
2601
|
+
if (!((C = s.customCardPreferences) != null && C.componentName))
|
|
2609
2602
|
return null;
|
|
2610
|
-
const
|
|
2611
|
-
(
|
|
2612
|
-
),
|
|
2613
|
-
console.log("data",
|
|
2614
|
-
},
|
|
2615
|
-
((
|
|
2616
|
-
).map((
|
|
2617
|
-
var
|
|
2618
|
-
const
|
|
2619
|
-
return
|
|
2603
|
+
const x = o(
|
|
2604
|
+
(M = s.customCardPreferences) == null ? void 0 : M.componentName
|
|
2605
|
+
), d = (w) => {
|
|
2606
|
+
console.log("data", w), s.customCardPreferences;
|
|
2607
|
+
}, y = Object.keys(
|
|
2608
|
+
((I = s.customCardPreferences) == null ? void 0 : I.dataInputCardIds) || {}
|
|
2609
|
+
).map((w) => {
|
|
2610
|
+
var v, p, O;
|
|
2611
|
+
const L = (p = (v = s.customCardPreferences) == null ? void 0 : v.dataInputCardIds) == null ? void 0 : p[w].cardId, h = (O = c == null ? void 0 : c.cards) == null ? void 0 : O.find((E) => E.id === L);
|
|
2612
|
+
return h || null;
|
|
2620
2613
|
});
|
|
2621
2614
|
return /* @__PURE__ */ e.jsx("div", { className: "semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto", children: /* @__PURE__ */ e.jsxs(
|
|
2622
|
-
|
|
2615
|
+
kn,
|
|
2623
2616
|
{
|
|
2624
2617
|
fallback: /* @__PURE__ */ e.jsx(e.Fragment, {}),
|
|
2625
2618
|
children: [
|
|
2626
|
-
|
|
2627
|
-
|
|
2619
|
+
x && r === "single" && /* @__PURE__ */ e.jsx(
|
|
2620
|
+
x,
|
|
2628
2621
|
{
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2622
|
+
params: a,
|
|
2623
|
+
theme: l,
|
|
2624
|
+
settings: (V = s.customCardPreferences) == null ? void 0 : V.settings,
|
|
2625
|
+
onDataChange: d,
|
|
2626
|
+
data: (i == null ? void 0 : i.records) || []
|
|
2633
2627
|
}
|
|
2634
2628
|
),
|
|
2635
|
-
|
|
2636
|
-
|
|
2629
|
+
x && r === "multiple" && /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e.jsx(
|
|
2630
|
+
x,
|
|
2637
2631
|
{
|
|
2638
|
-
theme:
|
|
2639
|
-
onDataChange:
|
|
2640
|
-
settings:
|
|
2641
|
-
(
|
|
2642
|
-
var
|
|
2643
|
-
return (
|
|
2632
|
+
theme: l,
|
|
2633
|
+
onDataChange: d,
|
|
2634
|
+
settings: y.map(
|
|
2635
|
+
(w) => {
|
|
2636
|
+
var L;
|
|
2637
|
+
return (L = w == null ? void 0 : w.customCardPreferences) == null ? void 0 : L.settings;
|
|
2644
2638
|
}
|
|
2645
2639
|
),
|
|
2646
|
-
data:
|
|
2640
|
+
data: y.map((w) => (w == null ? void 0 : w.data) || [])
|
|
2647
2641
|
}
|
|
2648
2642
|
) })
|
|
2649
2643
|
]
|
|
2650
2644
|
},
|
|
2651
|
-
(
|
|
2645
|
+
(N = s.customCardPreferences) == null ? void 0 : N.componentName
|
|
2652
2646
|
) });
|
|
2653
2647
|
}
|
|
2654
2648
|
function Pa({
|
|
@@ -2658,14 +2652,13 @@ function Pa({
|
|
|
2658
2652
|
...t
|
|
2659
2653
|
}) {
|
|
2660
2654
|
var m, g;
|
|
2661
|
-
const a = u((j) => j.card), n = ((m = a.customCardPreferences) == null ? void 0 : m.showCardHeader) ?? !0, l = u((j) => j.frame),
|
|
2655
|
+
const a = u((j) => j.card), n = ((m = a.customCardPreferences) == null ? void 0 : m.showCardHeader) ?? !0, l = u((j) => j.frame), o = z((j) => j.dashboard.filters);
|
|
2662
2656
|
u((j) => j.actions.setRunSql);
|
|
2663
|
-
const { updateFilter: r } =
|
|
2664
|
-
if (!a.id)
|
|
2665
|
-
return null;
|
|
2657
|
+
const { updateFilter: r } = Is(), c = o == null ? void 0 : o.find((j) => j.id === l.filterId), { data: i } = qe(a), { setCard: x } = ce(), { data: d } = Bs(a);
|
|
2658
|
+
if (!a.id) return null;
|
|
2666
2659
|
let y;
|
|
2667
|
-
|
|
2668
|
-
data:
|
|
2660
|
+
i != null && i.records && (i == null ? void 0 : i.records.length) > 0 && (y = Ca({
|
|
2661
|
+
data: i == null ? void 0 : i.records,
|
|
2669
2662
|
cardType: a.type,
|
|
2670
2663
|
cfg: a.cfg,
|
|
2671
2664
|
customCfg: a.customCfg,
|
|
@@ -2673,23 +2666,23 @@ function Pa({
|
|
|
2673
2666
|
topoJson: d
|
|
2674
2667
|
}));
|
|
2675
2668
|
function f(j) {
|
|
2676
|
-
return /* @__PURE__ */ e.jsx(
|
|
2669
|
+
return /* @__PURE__ */ e.jsx(wl, { card: j });
|
|
2677
2670
|
}
|
|
2678
2671
|
return /* @__PURE__ */ e.jsxs(
|
|
2679
|
-
|
|
2672
|
+
qt,
|
|
2680
2673
|
{
|
|
2681
2674
|
role: "editor-visual-card",
|
|
2682
2675
|
className: W("relative flex h-full flex-col rounded-none", s),
|
|
2683
2676
|
...t,
|
|
2684
2677
|
children: [
|
|
2685
|
-
n && /* @__PURE__ */ e.jsxs(
|
|
2678
|
+
n && /* @__PURE__ */ e.jsxs(Rt, { className: "flex flex-row items-start justify-between py-4", children: [
|
|
2686
2679
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2687
2680
|
/* @__PURE__ */ e.jsx(
|
|
2688
2681
|
rs,
|
|
2689
2682
|
{
|
|
2690
2683
|
text: a.title,
|
|
2691
2684
|
onSave: (j) => x({ ...a, title: j }),
|
|
2692
|
-
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(
|
|
2685
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-5", children: /* @__PURE__ */ e.jsx(_t, { className: "text-base", children: a.title || "Edit title..." }) })
|
|
2693
2686
|
},
|
|
2694
2687
|
a.title
|
|
2695
2688
|
),
|
|
@@ -2698,7 +2691,7 @@ function Pa({
|
|
|
2698
2691
|
{
|
|
2699
2692
|
text: a.description || "",
|
|
2700
2693
|
onSave: (j) => x({ ...a, description: j }),
|
|
2701
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2694
|
+
children: /* @__PURE__ */ e.jsx(Ht, { children: a.description || "Edit description..." })
|
|
2702
2695
|
},
|
|
2703
2696
|
a.description
|
|
2704
2697
|
)
|
|
@@ -2713,33 +2706,33 @@ function Pa({
|
|
|
2713
2706
|
children: /* @__PURE__ */ e.jsx(H, { children: c.title })
|
|
2714
2707
|
}
|
|
2715
2708
|
),
|
|
2716
|
-
|
|
2709
|
+
$t(c)
|
|
2717
2710
|
] })
|
|
2718
2711
|
] }),
|
|
2719
|
-
/* @__PURE__ */ e.jsxs(
|
|
2712
|
+
/* @__PURE__ */ e.jsxs(Pt, { className: "flex grow flex-col", children: [
|
|
2720
2713
|
a.type === "custom" && f(a),
|
|
2721
2714
|
!["table", "custom"].includes(a.type) && y && // <ChartJsVisual key={visualKey} cfg={cfg} />
|
|
2722
2715
|
/* @__PURE__ */ e.jsx(
|
|
2723
|
-
|
|
2716
|
+
Bt,
|
|
2724
2717
|
{
|
|
2725
2718
|
cfg: y
|
|
2726
2719
|
},
|
|
2727
2720
|
JSON.stringify(y) + JSON.stringify(a.preferences) + ((g = a == null ? void 0 : a.preferences) == null ? void 0 : g.customVisualCode)
|
|
2728
2721
|
),
|
|
2729
|
-
a.type === "table" && (
|
|
2730
|
-
/* @__PURE__ */ e.jsx(
|
|
2722
|
+
a.type === "table" && (i == null ? void 0 : i.records) && (i == null ? void 0 : i.records.length) > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
|
|
2723
|
+
/* @__PURE__ */ e.jsx(Ut, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Gt, { card: a, data: i == null ? void 0 : i.records }) })
|
|
2731
2724
|
] })
|
|
2732
2725
|
]
|
|
2733
2726
|
}
|
|
2734
2727
|
);
|
|
2735
2728
|
}
|
|
2736
|
-
function
|
|
2737
|
-
const [s, t] = R(!1), [a, n] = R(""), [l,
|
|
2729
|
+
function kl() {
|
|
2730
|
+
const [s, t] = R(!1), [a, n] = R(""), [l, o] = R(""), [r, c] = R(""), [i, x] = R(""), d = u((N) => N.card), y = u(
|
|
2738
2731
|
(N) => N.card.customCfg
|
|
2739
2732
|
), { data: f } = qe(d), { data: m } = Bs(d), { setCardCustomCfg: g, setCustomVisualCode: j } = ce();
|
|
2740
|
-
function
|
|
2733
|
+
function T(N) {
|
|
2741
2734
|
var h, v;
|
|
2742
|
-
const
|
|
2735
|
+
const w = {
|
|
2743
2736
|
...N,
|
|
2744
2737
|
data: {
|
|
2745
2738
|
...N == null ? void 0 : N.data,
|
|
@@ -2749,12 +2742,11 @@ function wl() {
|
|
|
2749
2742
|
}))
|
|
2750
2743
|
}
|
|
2751
2744
|
};
|
|
2752
|
-
return JSON.stringify(
|
|
2745
|
+
return JSON.stringify(w, null, 1);
|
|
2753
2746
|
}
|
|
2754
2747
|
function C() {
|
|
2755
|
-
var
|
|
2756
|
-
if (!(f != null && f.records) || (f == null ? void 0 : f.records.length) === 0)
|
|
2757
|
-
return;
|
|
2748
|
+
var w, L;
|
|
2749
|
+
if (!(f != null && f.records) || (f == null ? void 0 : f.records.length) === 0) return;
|
|
2758
2750
|
const N = Ca({
|
|
2759
2751
|
data: f == null ? void 0 : f.records,
|
|
2760
2752
|
cardType: d.type,
|
|
@@ -2762,48 +2754,48 @@ function wl() {
|
|
|
2762
2754
|
preferences: d.preferences,
|
|
2763
2755
|
topoJson: m
|
|
2764
2756
|
});
|
|
2765
|
-
N && (n(JSON.stringify(N, null, 1)), (
|
|
2757
|
+
N && (n(JSON.stringify(N, null, 1)), (w = d == null ? void 0 : d.preferences) != null && w.customVisualCode && c((L = d == null ? void 0 : d.preferences) == null ? void 0 : L.customVisualCode), y && o(JSON.stringify(y, null, 1)));
|
|
2766
2758
|
}
|
|
2767
|
-
function
|
|
2759
|
+
function M() {
|
|
2768
2760
|
if (r && j(r), !!l)
|
|
2769
2761
|
try {
|
|
2770
2762
|
const N = JSON.parse(l);
|
|
2771
|
-
return N ? (g(N), x(""),
|
|
2763
|
+
return N ? (g(N), x(""), o(""), N) : void 0;
|
|
2772
2764
|
} catch (N) {
|
|
2773
2765
|
console.log(N), x("Invalid JSON");
|
|
2774
2766
|
}
|
|
2775
2767
|
}
|
|
2776
2768
|
function I() {
|
|
2777
|
-
|
|
2769
|
+
o(""), g(null);
|
|
2778
2770
|
}
|
|
2779
|
-
function
|
|
2771
|
+
function V() {
|
|
2780
2772
|
let N;
|
|
2781
2773
|
if (y) {
|
|
2782
|
-
const
|
|
2783
|
-
return N =
|
|
2774
|
+
const w = sa.cloneDeep(d.cfg), L = sa.merge(w, y);
|
|
2775
|
+
return N = T(L), N;
|
|
2784
2776
|
}
|
|
2785
|
-
return a ? (N =
|
|
2777
|
+
return a ? (N = T(JSON.parse(a)), N) : "";
|
|
2786
2778
|
}
|
|
2787
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2788
|
-
/* @__PURE__ */ e.jsx(
|
|
2779
|
+
return /* @__PURE__ */ e.jsxs(Ts, { open: s, onOpenChange: t, children: [
|
|
2780
|
+
/* @__PURE__ */ e.jsx(Ds, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
2789
2781
|
F,
|
|
2790
2782
|
{
|
|
2791
2783
|
onClick: C,
|
|
2792
2784
|
className: ` ${y && "border-foreground/50 dark:border-foreground/70"}`,
|
|
2793
2785
|
size: "sm",
|
|
2794
2786
|
variant: "outline",
|
|
2795
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2787
|
+
children: /* @__PURE__ */ e.jsx(Kt, { className: "h-4 w-4" })
|
|
2796
2788
|
}
|
|
2797
2789
|
) }),
|
|
2798
2790
|
/* @__PURE__ */ e.jsxs(
|
|
2799
|
-
|
|
2791
|
+
Ls,
|
|
2800
2792
|
{
|
|
2801
2793
|
className: "max-h-[70vh] min-h-[70vh] overflow-auto sm:min-w-[900px] lg:min-w-[1200px]",
|
|
2802
2794
|
children: [
|
|
2803
|
-
/* @__PURE__ */ e.jsxs(
|
|
2795
|
+
/* @__PURE__ */ e.jsxs(Es, { className: "", children: [
|
|
2804
2796
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2805
|
-
/* @__PURE__ */ e.jsx(
|
|
2806
|
-
/* @__PURE__ */ e.jsxs(
|
|
2797
|
+
/* @__PURE__ */ e.jsx(As, { children: "Customize Card" }),
|
|
2798
|
+
/* @__PURE__ */ e.jsxs(qs, { children: [
|
|
2807
2799
|
/* @__PURE__ */ e.jsx(ma, { children: /* @__PURE__ */ e.jsx(
|
|
2808
2800
|
La,
|
|
2809
2801
|
{
|
|
@@ -2813,10 +2805,10 @@ function wl() {
|
|
|
2813
2805
|
className: "size-3 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground"
|
|
2814
2806
|
}
|
|
2815
2807
|
) }),
|
|
2816
|
-
/* @__PURE__ */ e.jsx(
|
|
2808
|
+
/* @__PURE__ */ e.jsx(Rs, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
|
|
2817
2809
|
] })
|
|
2818
2810
|
] }),
|
|
2819
|
-
/* @__PURE__ */ e.jsxs(
|
|
2811
|
+
/* @__PURE__ */ e.jsxs(Vs, { children: [
|
|
2820
2812
|
"See the configuration options and documentation",
|
|
2821
2813
|
/* @__PURE__ */ e.jsx(
|
|
2822
2814
|
"a",
|
|
@@ -2830,7 +2822,7 @@ function wl() {
|
|
|
2830
2822
|
] })
|
|
2831
2823
|
] }),
|
|
2832
2824
|
/* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
|
|
2833
|
-
/* @__PURE__ */ e.jsx(
|
|
2825
|
+
/* @__PURE__ */ e.jsx(ps, { FallbackComponent: Na, children: /* @__PURE__ */ e.jsx(Pa, { className: "w-1/2 rounded shadow-none" }) }),
|
|
2834
2826
|
/* @__PURE__ */ e.jsxs(Sa, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
|
|
2835
2827
|
/* @__PURE__ */ e.jsxs(wa, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
|
|
2836
2828
|
/* @__PURE__ */ e.jsxs(is, { value: "custom-config", children: [
|
|
@@ -2878,8 +2870,8 @@ function wl() {
|
|
|
2878
2870
|
renderLineHighlight: "none"
|
|
2879
2871
|
},
|
|
2880
2872
|
defaultLanguage: "json",
|
|
2881
|
-
value:
|
|
2882
|
-
onChange: (N) =>
|
|
2873
|
+
value: V(),
|
|
2874
|
+
onChange: (N) => o(N)
|
|
2883
2875
|
}
|
|
2884
2876
|
)
|
|
2885
2877
|
}
|
|
@@ -2916,7 +2908,7 @@ function wl() {
|
|
|
2916
2908
|
] })
|
|
2917
2909
|
] }),
|
|
2918
2910
|
/* @__PURE__ */ e.jsxs(oa, { className: "flex items-center", children: [
|
|
2919
|
-
/* @__PURE__ */ e.jsx(H, { className: "mr-2 text-red-500", children:
|
|
2911
|
+
/* @__PURE__ */ e.jsx(H, { className: "mr-2 text-red-500", children: i }),
|
|
2920
2912
|
/* @__PURE__ */ e.jsx(
|
|
2921
2913
|
F,
|
|
2922
2914
|
{
|
|
@@ -2926,7 +2918,7 @@ function wl() {
|
|
|
2926
2918
|
children: "Reset"
|
|
2927
2919
|
}
|
|
2928
2920
|
),
|
|
2929
|
-
/* @__PURE__ */ e.jsx(F, { onClick:
|
|
2921
|
+
/* @__PURE__ */ e.jsx(F, { onClick: M, variant: "outline", children: "Apply" }),
|
|
2930
2922
|
/* @__PURE__ */ e.jsx(F, { onClick: () => t(!1), variant: "outline", children: "Close" })
|
|
2931
2923
|
] })
|
|
2932
2924
|
]
|
|
@@ -2935,59 +2927,59 @@ function wl() {
|
|
|
2935
2927
|
] });
|
|
2936
2928
|
}
|
|
2937
2929
|
function Ba(s) {
|
|
2938
|
-
return
|
|
2930
|
+
return Ce({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
|
|
2939
2931
|
}
|
|
2940
2932
|
function Ua(s) {
|
|
2941
|
-
return
|
|
2933
|
+
return Ce({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24a8,8,0,0,0-8,8V88a8,8,0,0,0,8,8,32,32,0,1,1-27.72,16,8,8,0,0,0-2.93-10.93l-48.5-28A8,8,0,0,0,37.92,76,104,104,0,1,0,128,24ZM48.09,91.1,83,111.26A48.09,48.09,0,0,0,80,128c0,1.53.08,3,.22,4.52L41.28,143A88.16,88.16,0,0,1,48.09,91.1Zm-2.67,67.31,39-10.44A48.1,48.1,0,0,0,120,175.32v40.31A88.2,88.2,0,0,1,45.42,158.41ZM136,215.63V175.32a48,48,0,0,0,0-94.65V40.36a88,88,0,0,1,0,175.27Z" }, child: [] }] })(s);
|
|
2942
2934
|
}
|
|
2943
2935
|
function Ga(s) {
|
|
2944
|
-
return
|
|
2936
|
+
return Ce({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
|
|
2945
2937
|
}
|
|
2946
2938
|
function Ka(s) {
|
|
2947
|
-
return
|
|
2939
|
+
return Ce({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
|
|
2948
2940
|
}
|
|
2949
2941
|
function Qa(s) {
|
|
2950
|
-
return
|
|
2942
|
+
return Ce({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m2 19.99 7.5-7.51 4 4 7.09-7.97L22 9.92l-8.5 9.56-4-4-6 6.01-1.5-1.5zm1.5-4.5 6-6.01 4 4L22 3.92l-1.41-1.41-7.09 7.97-4-4L2 13.99l1.5 1.5z" }, child: [] }] })(s);
|
|
2951
2943
|
}
|
|
2952
2944
|
function Ja(s) {
|
|
2953
|
-
return
|
|
2945
|
+
return Ce({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
|
|
2954
2946
|
}
|
|
2955
2947
|
function Wa(s) {
|
|
2956
|
-
return
|
|
2948
|
+
return Ce({ tag: "svg", attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z" }, child: [] }] })(s);
|
|
2957
2949
|
}
|
|
2958
2950
|
function Ya(s) {
|
|
2959
|
-
return
|
|
2951
|
+
return Ce({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
|
|
2960
2952
|
}
|
|
2961
2953
|
function Xa(s) {
|
|
2962
2954
|
const [t, a] = R(null);
|
|
2963
2955
|
return Z(() => {
|
|
2964
2956
|
s && (async () => {
|
|
2965
|
-
const
|
|
2966
|
-
a(
|
|
2957
|
+
const o = (await import("./lucide-react-CRf9jpQL.js"))[s];
|
|
2958
|
+
a(o);
|
|
2967
2959
|
})();
|
|
2968
2960
|
}, [s]), t;
|
|
2969
2961
|
}
|
|
2970
2962
|
function Za() {
|
|
2971
|
-
const { authToken: s } =
|
|
2963
|
+
const { authToken: s } = ve(), { data: t, isLoading: a, isFetching: n, isError: l } = me({
|
|
2972
2964
|
queryKey: ["plugins", s == null ? void 0 : s.accessToken],
|
|
2973
|
-
queryFn: () =>
|
|
2965
|
+
queryFn: () => Qt(s == null ? void 0 : s.accessToken)
|
|
2974
2966
|
// staleTime: Infinity,
|
|
2975
2967
|
});
|
|
2976
2968
|
return { data: t, isLoading: a, isFetching: n, isError: l };
|
|
2977
2969
|
}
|
|
2978
|
-
function
|
|
2970
|
+
function Ol({
|
|
2979
2971
|
onChartTypeChange: s
|
|
2980
2972
|
}) {
|
|
2981
2973
|
const [t, a] = R([]), { data: n } = Za();
|
|
2982
2974
|
return Z(() => {
|
|
2983
2975
|
(async () => {
|
|
2984
|
-
var
|
|
2976
|
+
var o;
|
|
2985
2977
|
if (n) {
|
|
2986
2978
|
const c = (await Promise.all(
|
|
2987
|
-
(
|
|
2979
|
+
(o = n == null ? void 0 : n.plugins) == null ? void 0 : o.map(async (i) => (await Jt(i.value)).visuals.map((y) => ({
|
|
2988
2980
|
name: y.name,
|
|
2989
2981
|
icon: y.icon,
|
|
2990
|
-
url:
|
|
2982
|
+
url: i.value
|
|
2991
2983
|
})))
|
|
2992
2984
|
)).flat();
|
|
2993
2985
|
a(c);
|
|
@@ -2995,14 +2987,14 @@ function kl({
|
|
|
2995
2987
|
})();
|
|
2996
2988
|
}, [n]), t.length === 0 ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2997
2989
|
/* @__PURE__ */ e.jsx(de, { className: "my-2" }),
|
|
2998
|
-
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l,
|
|
2990
|
+
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 place-items-center", children: t.map((l, o) => /* @__PURE__ */ e.jsx(
|
|
2999
2991
|
zl,
|
|
3000
2992
|
{
|
|
3001
2993
|
text: l.name,
|
|
3002
2994
|
onClick: () => s("custom", l),
|
|
3003
2995
|
icon: l.icon
|
|
3004
2996
|
},
|
|
3005
|
-
l.url + l.name +
|
|
2997
|
+
l.url + l.name + o
|
|
3006
2998
|
)) })
|
|
3007
2999
|
] });
|
|
3008
3000
|
}
|
|
@@ -3014,11 +3006,11 @@ const zl = ({
|
|
|
3014
3006
|
const n = Xa(t || ""), l = s.charAt(0).toUpperCase();
|
|
3015
3007
|
return /* @__PURE__ */ e.jsx(F, { onClick: a, title: s, variant: "ghost", children: n ? /* @__PURE__ */ e.jsx(n, { className: "h-4 w-4" }) : l });
|
|
3016
3008
|
};
|
|
3017
|
-
function
|
|
3009
|
+
function Fl() {
|
|
3018
3010
|
var d, y;
|
|
3019
|
-
const [s, t] = R(!1), a = u((f) => f.card), n = a.type, { setCardType: l, setCardPreferences:
|
|
3011
|
+
const [s, t] = R(!1), a = u((f) => f.card), n = a.type, { setCardType: l, setCardPreferences: o, setChartOrientation: r } = u((f) => f.actions), { setCardCustomCfg: c, setCustomCardPreferences: i } = ce();
|
|
3020
3012
|
function x(f, m) {
|
|
3021
|
-
c(null),
|
|
3013
|
+
c(null), o({}), l(f), m && i({
|
|
3022
3014
|
type: "component",
|
|
3023
3015
|
visualType: "single",
|
|
3024
3016
|
url: m.url,
|
|
@@ -3026,9 +3018,9 @@ function Ol() {
|
|
|
3026
3018
|
icon: m.icon
|
|
3027
3019
|
}), t(!1);
|
|
3028
3020
|
}
|
|
3029
|
-
return /* @__PURE__ */ e.jsxs(
|
|
3030
|
-
/* @__PURE__ */ e.jsx(
|
|
3031
|
-
|
|
3021
|
+
return /* @__PURE__ */ e.jsxs(fs, { open: s, onOpenChange: t, children: [
|
|
3022
|
+
/* @__PURE__ */ e.jsx(gs, { asChild: !0, children: /* @__PURE__ */ e.jsx(F, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(
|
|
3023
|
+
Il,
|
|
3032
3024
|
{
|
|
3033
3025
|
className: "h-4 w-4",
|
|
3034
3026
|
chartType: n,
|
|
@@ -3036,7 +3028,7 @@ function Ol() {
|
|
|
3036
3028
|
componentName: (y = a.customCardPreferences) == null ? void 0 : y.componentName
|
|
3037
3029
|
}
|
|
3038
3030
|
) }) }),
|
|
3039
|
-
/* @__PURE__ */ e.jsxs(
|
|
3031
|
+
/* @__PURE__ */ e.jsxs(js, { className: "w-50", children: [
|
|
3040
3032
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-4 place-items-center", children: [
|
|
3041
3033
|
/* @__PURE__ */ e.jsx(
|
|
3042
3034
|
F,
|
|
@@ -3146,7 +3138,7 @@ function Ol() {
|
|
|
3146
3138
|
{
|
|
3147
3139
|
onClick: () => x("table"),
|
|
3148
3140
|
variant: "ghost",
|
|
3149
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3141
|
+
children: /* @__PURE__ */ e.jsx(_s, { className: "size-5" })
|
|
3150
3142
|
}
|
|
3151
3143
|
),
|
|
3152
3144
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3182,11 +3174,11 @@ function Ol() {
|
|
|
3182
3174
|
}
|
|
3183
3175
|
)
|
|
3184
3176
|
] }),
|
|
3185
|
-
/* @__PURE__ */ e.jsx(
|
|
3177
|
+
/* @__PURE__ */ e.jsx(Ol, { onChartTypeChange: x })
|
|
3186
3178
|
] })
|
|
3187
3179
|
] });
|
|
3188
3180
|
}
|
|
3189
|
-
function
|
|
3181
|
+
function Il({
|
|
3190
3182
|
chartType: s,
|
|
3191
3183
|
className: t,
|
|
3192
3184
|
customIcon: a,
|
|
@@ -3227,22 +3219,22 @@ function Fl({
|
|
|
3227
3219
|
case "custom":
|
|
3228
3220
|
return a && l ? /* @__PURE__ */ e.jsx(l, { className: t }) : n ? n == null ? void 0 : n.charAt(0).toUpperCase() : /* @__PURE__ */ e.jsx(Va, { className: t });
|
|
3229
3221
|
default:
|
|
3230
|
-
return /* @__PURE__ */ e.jsx(
|
|
3222
|
+
return /* @__PURE__ */ e.jsx(_s, { className: t });
|
|
3231
3223
|
}
|
|
3232
3224
|
}
|
|
3233
|
-
function
|
|
3225
|
+
function Tl() {
|
|
3234
3226
|
var l;
|
|
3235
|
-
const s = u((
|
|
3227
|
+
const s = u((o) => o.card), t = ((l = s.customCardPreferences) == null ? void 0 : l.showCardHeader) ?? !0, { setCustomCardPreferences: a } = ce(), n = (o) => {
|
|
3236
3228
|
s.customCardPreferences && a({
|
|
3237
3229
|
...s.customCardPreferences,
|
|
3238
|
-
showCardHeader:
|
|
3230
|
+
showCardHeader: o === !0
|
|
3239
3231
|
});
|
|
3240
3232
|
};
|
|
3241
3233
|
return /* @__PURE__ */ e.jsxs(ca, { children: [
|
|
3242
3234
|
/* @__PURE__ */ e.jsx(da, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ma, { className: "size-4 cursor-pointer text-muted-foreground/70 transition-colors hover:text-muted-foreground" }) }),
|
|
3243
3235
|
/* @__PURE__ */ e.jsxs(ua, { align: "start", className: "w-40 text-muted-foreground", children: [
|
|
3244
3236
|
/* @__PURE__ */ e.jsx(
|
|
3245
|
-
|
|
3237
|
+
Wt,
|
|
3246
3238
|
{
|
|
3247
3239
|
checked: t,
|
|
3248
3240
|
onCheckedChange: n,
|
|
@@ -3250,7 +3242,7 @@ function Il() {
|
|
|
3250
3242
|
}
|
|
3251
3243
|
),
|
|
3252
3244
|
/* @__PURE__ */ e.jsxs(
|
|
3253
|
-
|
|
3245
|
+
Yt,
|
|
3254
3246
|
{
|
|
3255
3247
|
onClick: () => {
|
|
3256
3248
|
navigator.clipboard.writeText(s.id), Ye.success("Card ID copied to clipboard");
|
|
@@ -3266,11 +3258,10 @@ function Il() {
|
|
|
3266
3258
|
] });
|
|
3267
3259
|
}
|
|
3268
3260
|
function ra() {
|
|
3269
|
-
const s = u((h) => h.frame), t = u((h) => h.card), a = u((h) => h.isShowingVisual), n = u((h) => h.isSqlRunning), l = u((h) => h.queryError),
|
|
3261
|
+
const s = u((h) => h.frame), t = u((h) => h.card), a = u((h) => h.isShowingVisual), n = u((h) => h.isSqlRunning), l = u((h) => h.queryError), o = u((h) => h.pythonStdOut), r = u((h) => h.actions.setRunSql);
|
|
3270
3262
|
u((h) => h.onSave), u((h) => h.onClose), u((h) => h.actions.setCardSql), u((h) => h.actions.setCardType), u((h) => h.actions.setSqlGen);
|
|
3271
|
-
const { setFrame: c, setCard:
|
|
3272
|
-
if (!t)
|
|
3273
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
3263
|
+
const { setFrame: c, setCard: i, updateCardInFrame: x } = ce(), { data: d, isLoading: y, isFetching: f } = qe(t);
|
|
3264
|
+
if (!t) return /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
|
|
3274
3265
|
function m() {
|
|
3275
3266
|
const h = {
|
|
3276
3267
|
connectionId: t.connectionId,
|
|
@@ -3297,7 +3288,7 @@ function ra() {
|
|
|
3297
3288
|
cards: [...s.cards, h],
|
|
3298
3289
|
activeCardId: h.id
|
|
3299
3290
|
};
|
|
3300
|
-
c(v),
|
|
3291
|
+
c(v), i(h);
|
|
3301
3292
|
}
|
|
3302
3293
|
function j() {
|
|
3303
3294
|
const h = {
|
|
@@ -3308,35 +3299,34 @@ function ra() {
|
|
|
3308
3299
|
};
|
|
3309
3300
|
g(h);
|
|
3310
3301
|
}
|
|
3311
|
-
function
|
|
3312
|
-
const v = s.cards.filter((
|
|
3302
|
+
function T(h) {
|
|
3303
|
+
const v = s.cards.filter((E) => E.id !== h), p = v[0], O = {
|
|
3313
3304
|
...s,
|
|
3314
3305
|
cards: v,
|
|
3315
3306
|
// update the active card to the first card in the frame
|
|
3316
3307
|
activeCardId: p.id
|
|
3317
3308
|
};
|
|
3318
|
-
c(
|
|
3309
|
+
c(O), i(p);
|
|
3319
3310
|
}
|
|
3320
3311
|
function C(h) {
|
|
3321
3312
|
const v = {
|
|
3322
3313
|
...s,
|
|
3323
|
-
cards: s.cards.map((
|
|
3314
|
+
cards: s.cards.map((O) => O.id === t.id ? t : O),
|
|
3324
3315
|
activeCardId: h
|
|
3325
3316
|
};
|
|
3326
3317
|
c(v);
|
|
3327
|
-
const p = v.cards.find((
|
|
3328
|
-
p.sql && r(!0),
|
|
3318
|
+
const p = v.cards.find((O) => O.id === h);
|
|
3319
|
+
p.sql && r(!0), i(p);
|
|
3329
3320
|
}
|
|
3330
|
-
const
|
|
3321
|
+
const M = (h, v) => {
|
|
3331
3322
|
console.log("handleDragStart", v), h.dataTransfer.setData("tabIndex", v.toString());
|
|
3332
3323
|
}, I = (h) => {
|
|
3333
3324
|
h.preventDefault();
|
|
3334
|
-
},
|
|
3325
|
+
}, V = (h, v) => {
|
|
3335
3326
|
const p = h.dataTransfer.getData("tabIndex");
|
|
3336
|
-
if (p === v.toString())
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
k.splice(v, 0, V), c({ ...s, cards: k });
|
|
3327
|
+
if (p === v.toString()) return;
|
|
3328
|
+
const O = Array.from(s.cards), [E] = O.splice(parseInt(p), 1);
|
|
3329
|
+
O.splice(v, 0, E), c({ ...s, cards: O });
|
|
3340
3330
|
};
|
|
3341
3331
|
function N(h, v) {
|
|
3342
3332
|
return h.cards.length === 1 && (v.displayTab === !0 || v.displayTab === void 0) || h.activeCardId !== v.id && (v.displayTab === !0 || v.displayTab === void 0) ? null : /* @__PURE__ */ e.jsx(
|
|
@@ -3344,16 +3334,16 @@ function ra() {
|
|
|
3344
3334
|
{
|
|
3345
3335
|
onClick: () => {
|
|
3346
3336
|
const p = v.displayTab === void 0 ? !1 : !v.displayTab;
|
|
3347
|
-
|
|
3337
|
+
i({ ...v, displayTab: p }), x({
|
|
3348
3338
|
...v,
|
|
3349
3339
|
displayTab: p
|
|
3350
3340
|
});
|
|
3351
3341
|
},
|
|
3352
|
-
children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(
|
|
3342
|
+
children: v.displayTab === !0 || v.displayTab === void 0 ? /* @__PURE__ */ e.jsx(Ln, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" }) : /* @__PURE__ */ e.jsx(Mn, { className: "mr-2 size-3.5 text-muted-foreground hover:text-foreground" })
|
|
3353
3343
|
}
|
|
3354
3344
|
);
|
|
3355
3345
|
}
|
|
3356
|
-
function
|
|
3346
|
+
function w() {
|
|
3357
3347
|
return /* @__PURE__ */ e.jsxs(
|
|
3358
3348
|
Sa,
|
|
3359
3349
|
{
|
|
@@ -3361,32 +3351,32 @@ function ra() {
|
|
|
3361
3351
|
value: s.activeCardId,
|
|
3362
3352
|
className: "flex grow flex-col",
|
|
3363
3353
|
children: [
|
|
3364
|
-
s.cards.map((h) => /* @__PURE__ */ e.jsx(os, { className: "mt-0 grow", value: h.id, children:
|
|
3354
|
+
s.cards.map((h) => /* @__PURE__ */ e.jsx(os, { className: "mt-0 grow", value: h.id, children: L() }, h.id)),
|
|
3365
3355
|
/* @__PURE__ */ e.jsx(wa, { className: "group mx-6 justify-between", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
3366
3356
|
s.cards.map((h, v) => /* @__PURE__ */ e.jsx(
|
|
3367
3357
|
rs,
|
|
3368
3358
|
{
|
|
3369
3359
|
text: h.tabTitle || h.title,
|
|
3370
3360
|
onSave: (p) => {
|
|
3371
|
-
|
|
3361
|
+
i({ ...t, tabTitle: p }), x({ ...t, tabTitle: p });
|
|
3372
3362
|
},
|
|
3373
3363
|
children: /* @__PURE__ */ e.jsxs(
|
|
3374
3364
|
is,
|
|
3375
3365
|
{
|
|
3376
3366
|
draggable: !0,
|
|
3377
|
-
onDragStart: (p) =>
|
|
3367
|
+
onDragStart: (p) => M(p, v),
|
|
3378
3368
|
onDragOver: I,
|
|
3379
|
-
onDrop: (p) =>
|
|
3369
|
+
onDrop: (p) => V(p, v),
|
|
3380
3370
|
className: "",
|
|
3381
3371
|
value: h.id,
|
|
3382
3372
|
children: [
|
|
3383
3373
|
N(s, h),
|
|
3384
3374
|
h.tabTitle || h.title,
|
|
3385
3375
|
s.activeCardId === h.id && s.cards.length > 1 && /* @__PURE__ */ e.jsx(
|
|
3386
|
-
|
|
3376
|
+
Oa,
|
|
3387
3377
|
{
|
|
3388
3378
|
className: "ml-2 size-3.5 text-muted-foreground hover:text-foreground",
|
|
3389
|
-
onClick: () =>
|
|
3379
|
+
onClick: () => T(h.id)
|
|
3390
3380
|
}
|
|
3391
3381
|
)
|
|
3392
3382
|
]
|
|
@@ -3401,7 +3391,7 @@ function ra() {
|
|
|
3401
3391
|
className: "ml-1 h-8 px-2 hover:bg-muted-foreground/50",
|
|
3402
3392
|
variant: "outline",
|
|
3403
3393
|
onClick: m,
|
|
3404
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3394
|
+
children: /* @__PURE__ */ e.jsx(Ms, { className: "h-4 w-4" })
|
|
3405
3395
|
}
|
|
3406
3396
|
),
|
|
3407
3397
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3410,7 +3400,7 @@ function ra() {
|
|
|
3410
3400
|
className: "invisible ml-1 h-8 px-2 hover:bg-muted-foreground/50 group-hover:visible",
|
|
3411
3401
|
variant: "outline",
|
|
3412
3402
|
onClick: j,
|
|
3413
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3403
|
+
children: /* @__PURE__ */ e.jsx(In, { className: "h-4 w-4" })
|
|
3414
3404
|
}
|
|
3415
3405
|
)
|
|
3416
3406
|
] }) })
|
|
@@ -3418,37 +3408,36 @@ function ra() {
|
|
|
3418
3408
|
}
|
|
3419
3409
|
);
|
|
3420
3410
|
}
|
|
3421
|
-
function
|
|
3422
|
-
return t.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(
|
|
3423
|
-
|
|
3411
|
+
function L() {
|
|
3412
|
+
return t.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(Xt, { card: t, data: d == null ? void 0 : d.records }) }) }) : t.type === "text" ? /* @__PURE__ */ e.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(ms, { className: "mx-3 my-6 h-[300px] overflow-y-auto break-words px-3", children: /* @__PURE__ */ e.jsx(
|
|
3413
|
+
Zt,
|
|
3424
3414
|
{
|
|
3425
3415
|
isLoading: n,
|
|
3426
3416
|
card: t,
|
|
3427
3417
|
data: d == null ? void 0 : d.records
|
|
3428
3418
|
}
|
|
3429
|
-
) }) }) : /* @__PURE__ */ e.jsx(
|
|
3419
|
+
) }) }) }) : /* @__PURE__ */ e.jsx(ps, { FallbackComponent: Na, children: /* @__PURE__ */ e.jsx(Pa, { className: "grow border-none shadow-none" }) });
|
|
3430
3420
|
}
|
|
3431
3421
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col py-3", children: [
|
|
3432
3422
|
(y || f) && /* @__PURE__ */ e.jsx(Ze, { className: "absolute bottom-0 left-0 right-0 top-0 z-50 m-auto h-10 w-10 animate-spin text-foreground/10" }),
|
|
3433
3423
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
|
|
3434
3424
|
a && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
|
|
3435
|
-
/* @__PURE__ */ e.jsx(
|
|
3436
|
-
!["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx(
|
|
3437
|
-
/* @__PURE__ */ e.jsx(
|
|
3425
|
+
/* @__PURE__ */ e.jsx(Fl, {}),
|
|
3426
|
+
!["table", "custom"].includes(t.type) && /* @__PURE__ */ e.jsx(kl, {}),
|
|
3427
|
+
/* @__PURE__ */ e.jsx(Tl, {})
|
|
3438
3428
|
] }),
|
|
3439
|
-
/* @__PURE__ */ e.jsx(
|
|
3429
|
+
/* @__PURE__ */ e.jsx(Ml, {})
|
|
3440
3430
|
] }),
|
|
3441
|
-
a ?
|
|
3442
|
-
|
|
3443
|
-
(d == null ? void 0 : d.records) && (d == null ? void 0 : d.records.length) > 0 && /* @__PURE__ */ e.jsx(
|
|
3431
|
+
a ? w() : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
|
|
3432
|
+
o && /* @__PURE__ */ e.jsx(Dl, {}),
|
|
3433
|
+
(d == null ? void 0 : d.records) && (d == null ? void 0 : d.records.length) > 0 && /* @__PURE__ */ e.jsx(Sl, { data: (d == null ? void 0 : d.records) || [] }),
|
|
3444
3434
|
l && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: l })
|
|
3445
3435
|
] })
|
|
3446
3436
|
] });
|
|
3447
3437
|
}
|
|
3448
|
-
function
|
|
3438
|
+
function Dl() {
|
|
3449
3439
|
const s = u((a) => a.pythonStdOut);
|
|
3450
|
-
if (!s)
|
|
3451
|
-
return null;
|
|
3440
|
+
if (!s) return null;
|
|
3452
3441
|
const t = s.replace(/\n/g, "<br>");
|
|
3453
3442
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3454
3443
|
/* @__PURE__ */ e.jsx("p", { className: "font-mono text-sm", children: "Output:" }),
|
|
@@ -3462,14 +3451,14 @@ function Tl() {
|
|
|
3462
3451
|
/* @__PURE__ */ e.jsx(de, { className: "mb-2" })
|
|
3463
3452
|
] });
|
|
3464
3453
|
}
|
|
3465
|
-
function
|
|
3454
|
+
function Ml() {
|
|
3466
3455
|
const s = u((a) => a.isShowingVisual), t = u(
|
|
3467
3456
|
(a) => a.actions.setIsShowingVisual
|
|
3468
3457
|
);
|
|
3469
3458
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
3470
3459
|
/* @__PURE__ */ e.jsx(H, { htmlFor: "visualize", children: "Chart" }),
|
|
3471
3460
|
/* @__PURE__ */ e.jsx(
|
|
3472
|
-
|
|
3461
|
+
en,
|
|
3473
3462
|
{
|
|
3474
3463
|
checked: s,
|
|
3475
3464
|
onCheckedChange: () => t(!s),
|
|
@@ -3479,13 +3468,13 @@ function Dl() {
|
|
|
3479
3468
|
)
|
|
3480
3469
|
] });
|
|
3481
3470
|
}
|
|
3482
|
-
function
|
|
3471
|
+
function Ll({
|
|
3483
3472
|
options: s,
|
|
3484
3473
|
value: t,
|
|
3485
3474
|
onValueChange: a
|
|
3486
3475
|
}) {
|
|
3487
3476
|
return /* @__PURE__ */ e.jsx(
|
|
3488
|
-
|
|
3477
|
+
bs,
|
|
3489
3478
|
{
|
|
3490
3479
|
value: t,
|
|
3491
3480
|
onValueChange: a,
|
|
@@ -3513,9 +3502,9 @@ function pe({
|
|
|
3513
3502
|
children: /* @__PURE__ */ e.jsx(je, { placeholder: s })
|
|
3514
3503
|
}
|
|
3515
3504
|
),
|
|
3516
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
3505
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
3517
3506
|
/* @__PURE__ */ e.jsx(ye, { children: s }),
|
|
3518
|
-
t.map((
|
|
3507
|
+
t.map((o) => /* @__PURE__ */ e.jsx(Q, { value: o.value, children: o.label }, o.value))
|
|
3519
3508
|
] }) })
|
|
3520
3509
|
] });
|
|
3521
3510
|
}
|
|
@@ -3533,48 +3522,47 @@ function Qe({
|
|
|
3533
3522
|
children: [
|
|
3534
3523
|
/* @__PURE__ */ e.jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4", children: [
|
|
3535
3524
|
/* @__PURE__ */ e.jsx(H, { children: t }),
|
|
3536
|
-
/* @__PURE__ */ e.jsx(
|
|
3525
|
+
/* @__PURE__ */ e.jsx(sn, { className: "h-4 w-4" })
|
|
3537
3526
|
] }),
|
|
3538
3527
|
/* @__PURE__ */ e.jsx("div", { className: "transition-all ease-in-out", children: s })
|
|
3539
3528
|
]
|
|
3540
3529
|
}
|
|
3541
3530
|
);
|
|
3542
3531
|
}
|
|
3543
|
-
function
|
|
3544
|
-
var j,
|
|
3532
|
+
function El() {
|
|
3533
|
+
var j, T;
|
|
3545
3534
|
const s = u(
|
|
3546
3535
|
(C) => C.card.customCardPreferences
|
|
3547
|
-
), { data: t } = Za(), a = (t == null ? void 0 : t.plugins) || [], n = u((C) => C.card), l = u((C) => C.frame),
|
|
3536
|
+
), { data: t } = Za(), a = (t == null ? void 0 : t.plugins) || [], n = u((C) => C.card), l = u((C) => C.frame), o = (s == null ? void 0 : s.visualType) || "single", { setCustomCardPreferences: r } = ce(), { components: c, manifest: i } = va(
|
|
3548
3537
|
(s == null ? void 0 : s.url) || ""
|
|
3549
|
-
), x = (j =
|
|
3538
|
+
), x = (j = i == null ? void 0 : i.visuals) == null ? void 0 : j.find(
|
|
3550
3539
|
(C) => C.name === (s == null ? void 0 : s.componentName)
|
|
3551
3540
|
);
|
|
3552
|
-
function d(C,
|
|
3553
|
-
if (!s)
|
|
3554
|
-
|
|
3555
|
-
const O = {
|
|
3541
|
+
function d(C, M) {
|
|
3542
|
+
if (!s) return;
|
|
3543
|
+
const V = {
|
|
3556
3544
|
...(s == null ? void 0 : s.dataInputCardIds) || {},
|
|
3557
3545
|
[C]: {
|
|
3558
|
-
cardId:
|
|
3546
|
+
cardId: M,
|
|
3559
3547
|
hookRef: null
|
|
3560
3548
|
}
|
|
3561
3549
|
};
|
|
3562
3550
|
r({
|
|
3563
3551
|
...s,
|
|
3564
|
-
dataInputCardIds:
|
|
3552
|
+
dataInputCardIds: V
|
|
3565
3553
|
});
|
|
3566
3554
|
}
|
|
3567
3555
|
function y(C) {
|
|
3568
|
-
var I,
|
|
3569
|
-
const
|
|
3570
|
-
var
|
|
3571
|
-
return ((
|
|
3556
|
+
var I, V;
|
|
3557
|
+
const M = (I = l == null ? void 0 : l.cards) == null ? void 0 : I.filter((N) => {
|
|
3558
|
+
var w;
|
|
3559
|
+
return ((w = N == null ? void 0 : N.customCardPreferences) == null ? void 0 : w.visualType) !== "multiple";
|
|
3572
3560
|
}).map((N) => ({
|
|
3573
3561
|
value: N.id,
|
|
3574
3562
|
label: N.tabTitle || N.title
|
|
3575
3563
|
}));
|
|
3576
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (
|
|
3577
|
-
var
|
|
3564
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: (V = C == null ? void 0 : C.dataInputs) == null ? void 0 : V.map((N, w) => {
|
|
3565
|
+
var L, h;
|
|
3578
3566
|
return /* @__PURE__ */ e.jsxs(
|
|
3579
3567
|
"div",
|
|
3580
3568
|
{
|
|
@@ -3586,59 +3574,59 @@ function Ll() {
|
|
|
3586
3574
|
{
|
|
3587
3575
|
className: "col-span-6 h-8 w-full justify-between",
|
|
3588
3576
|
label: "",
|
|
3589
|
-
options:
|
|
3590
|
-
value: ((h = (
|
|
3591
|
-
onValueChange: (v) => d(
|
|
3577
|
+
options: M || [],
|
|
3578
|
+
value: ((h = (L = s == null ? void 0 : s.dataInputCardIds) == null ? void 0 : L[w]) == null ? void 0 : h.cardId) || "",
|
|
3579
|
+
onValueChange: (v) => d(w, v)
|
|
3592
3580
|
}
|
|
3593
3581
|
)
|
|
3594
3582
|
]
|
|
3595
3583
|
},
|
|
3596
|
-
|
|
3584
|
+
w + Math.random()
|
|
3597
3585
|
);
|
|
3598
3586
|
}) });
|
|
3599
3587
|
}
|
|
3600
|
-
function f(C,
|
|
3601
|
-
var
|
|
3588
|
+
function f(C, M, I = []) {
|
|
3589
|
+
var V, N;
|
|
3602
3590
|
return s ? C === "input" ? /* @__PURE__ */ e.jsx(
|
|
3603
3591
|
re,
|
|
3604
3592
|
{
|
|
3605
3593
|
className: `h-8 w-full ${Ge}`,
|
|
3606
|
-
value: ((
|
|
3607
|
-
onChange: (
|
|
3594
|
+
value: ((V = s == null ? void 0 : s.settings) == null ? void 0 : V[M]) || "",
|
|
3595
|
+
onChange: (w) => {
|
|
3608
3596
|
r({
|
|
3609
3597
|
...s,
|
|
3610
3598
|
settings: {
|
|
3611
3599
|
...s == null ? void 0 : s.settings,
|
|
3612
|
-
[
|
|
3600
|
+
[M]: w.target.value
|
|
3613
3601
|
}
|
|
3614
3602
|
});
|
|
3615
3603
|
}
|
|
3616
3604
|
},
|
|
3617
|
-
|
|
3605
|
+
M
|
|
3618
3606
|
) : C === "select" ? /* @__PURE__ */ e.jsx(
|
|
3619
3607
|
pe,
|
|
3620
3608
|
{
|
|
3621
3609
|
className: "h-8 w-full",
|
|
3622
3610
|
label: "",
|
|
3623
3611
|
options: I,
|
|
3624
|
-
value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[
|
|
3625
|
-
onValueChange: (
|
|
3612
|
+
value: ((N = s == null ? void 0 : s.settings) == null ? void 0 : N[M]) || "",
|
|
3613
|
+
onValueChange: (w) => {
|
|
3626
3614
|
r({
|
|
3627
3615
|
...s,
|
|
3628
|
-
settings: { ...s == null ? void 0 : s.settings, [
|
|
3616
|
+
settings: { ...s == null ? void 0 : s.settings, [M]: w }
|
|
3629
3617
|
});
|
|
3630
3618
|
}
|
|
3631
3619
|
}
|
|
3632
3620
|
) : null : null;
|
|
3633
3621
|
}
|
|
3634
3622
|
function m(C) {
|
|
3635
|
-
const
|
|
3636
|
-
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children:
|
|
3637
|
-
/* @__PURE__ */ e.jsx(H, { children:
|
|
3623
|
+
const M = Object.entries((C == null ? void 0 : C.settings) || {});
|
|
3624
|
+
return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: M.map(([I, V]) => /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
3625
|
+
/* @__PURE__ */ e.jsx(H, { children: V.title }),
|
|
3638
3626
|
f(
|
|
3639
|
-
|
|
3627
|
+
V.ui,
|
|
3640
3628
|
I,
|
|
3641
|
-
|
|
3629
|
+
V.options
|
|
3642
3630
|
)
|
|
3643
3631
|
] }, I)) });
|
|
3644
3632
|
}
|
|
@@ -3672,13 +3660,13 @@ function Ll() {
|
|
|
3672
3660
|
}
|
|
3673
3661
|
) }) }),
|
|
3674
3662
|
((s == null ? void 0 : s.type) === "component" || (s == null ? void 0 : s.type) === void 0) && /* @__PURE__ */ e.jsx(
|
|
3675
|
-
|
|
3663
|
+
Ll,
|
|
3676
3664
|
{
|
|
3677
3665
|
options: [
|
|
3678
3666
|
{ value: "single", label: "Single Visual" },
|
|
3679
3667
|
{ value: "multiple", label: "Multi-Visual" }
|
|
3680
3668
|
],
|
|
3681
|
-
value:
|
|
3669
|
+
value: o,
|
|
3682
3670
|
onValueChange: g
|
|
3683
3671
|
}
|
|
3684
3672
|
),
|
|
@@ -3690,7 +3678,7 @@ function Ll() {
|
|
|
3690
3678
|
className: "h-8 w-full",
|
|
3691
3679
|
label: "",
|
|
3692
3680
|
options: (c == null ? void 0 : c.filter(
|
|
3693
|
-
(C) => C.type ===
|
|
3681
|
+
(C) => C.type === o
|
|
3694
3682
|
).map((C) => ({
|
|
3695
3683
|
value: C.name,
|
|
3696
3684
|
label: C.name
|
|
@@ -3707,7 +3695,7 @@ function Ll() {
|
|
|
3707
3695
|
] }) })
|
|
3708
3696
|
] }) }) }),
|
|
3709
3697
|
/* @__PURE__ */ e.jsx(de, { className: "my-4" }),
|
|
3710
|
-
((
|
|
3698
|
+
((T = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : T.componentName) && /* @__PURE__ */ e.jsxs(Qe, { summary: "Component Settings", children: [
|
|
3711
3699
|
x && x.dataInputs && /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
3712
3700
|
/* @__PURE__ */ e.jsx(H, { children: "Input Mapping" }),
|
|
3713
3701
|
/* @__PURE__ */ e.jsx("div", { className: "px-2", children: y(x) })
|
|
@@ -3723,7 +3711,7 @@ function Me() {
|
|
|
3723
3711
|
u(
|
|
3724
3712
|
(d) => d.card.cfg
|
|
3725
3713
|
);
|
|
3726
|
-
const a = u((d) => d.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences:
|
|
3714
|
+
const a = u((d) => d.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: l, setCardPreferences: o } = u((d) => d.actions), r = u(
|
|
3727
3715
|
(d) => d.queryResultColumns
|
|
3728
3716
|
);
|
|
3729
3717
|
u(
|
|
@@ -3736,7 +3724,7 @@ function Me() {
|
|
|
3736
3724
|
}, [r]);
|
|
3737
3725
|
function c(d, y) {
|
|
3738
3726
|
var f, m;
|
|
3739
|
-
y ? a != null && a.onClickFilter && ((f = a == null ? void 0 : a.onClickFilter) == null ? void 0 : f.length) > 0 ?
|
|
3727
|
+
y ? a != null && a.onClickFilter && ((f = a == null ? void 0 : a.onClickFilter) == null ? void 0 : f.length) > 0 ? o({
|
|
3740
3728
|
...a,
|
|
3741
3729
|
onClickFilter: [
|
|
3742
3730
|
...a.onClickFilter,
|
|
@@ -3745,7 +3733,7 @@ function Me() {
|
|
|
3745
3733
|
expression: ""
|
|
3746
3734
|
}
|
|
3747
3735
|
]
|
|
3748
|
-
}) :
|
|
3736
|
+
}) : o({
|
|
3749
3737
|
...a,
|
|
3750
3738
|
onClickFilter: [
|
|
3751
3739
|
{
|
|
@@ -3753,7 +3741,7 @@ function Me() {
|
|
|
3753
3741
|
expression: ""
|
|
3754
3742
|
}
|
|
3755
3743
|
]
|
|
3756
|
-
}) : (
|
|
3744
|
+
}) : (o({
|
|
3757
3745
|
...a,
|
|
3758
3746
|
onClickFilter: (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.filter(
|
|
3759
3747
|
(g) => g.columnIndex !== d
|
|
@@ -3763,13 +3751,13 @@ function Me() {
|
|
|
3763
3751
|
return j[d] = !1, j;
|
|
3764
3752
|
}));
|
|
3765
3753
|
}
|
|
3766
|
-
function
|
|
3754
|
+
function i(d, y) {
|
|
3767
3755
|
var m;
|
|
3768
3756
|
const f = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.map((g) => g.columnIndex === d ? {
|
|
3769
3757
|
...g,
|
|
3770
3758
|
expression: y.target.value
|
|
3771
3759
|
} : g);
|
|
3772
|
-
|
|
3760
|
+
o({
|
|
3773
3761
|
...a,
|
|
3774
3762
|
onClickFilter: f
|
|
3775
3763
|
});
|
|
@@ -3781,7 +3769,7 @@ function Me() {
|
|
|
3781
3769
|
re,
|
|
3782
3770
|
{
|
|
3783
3771
|
value: (g = (m = a == null ? void 0 : a.onClickFilter) == null ? void 0 : m.find((j) => j.columnIndex === d)) == null ? void 0 : g.expression,
|
|
3784
|
-
onChange: (j) =>
|
|
3772
|
+
onChange: (j) => i(d, j),
|
|
3785
3773
|
type: "text",
|
|
3786
3774
|
className: "h-9 w-full font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
3787
3775
|
placeholder: "Expression"
|
|
@@ -3799,7 +3787,7 @@ function Me() {
|
|
|
3799
3787
|
children: /* @__PURE__ */ e.jsxs("div", { className: "grow", children: [
|
|
3800
3788
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2 py-2", children: [
|
|
3801
3789
|
/* @__PURE__ */ e.jsx(
|
|
3802
|
-
|
|
3790
|
+
xs,
|
|
3803
3791
|
{
|
|
3804
3792
|
checked: !!((f = a == null ? void 0 : a.onClickFilter) != null && f.find(
|
|
3805
3793
|
(g) => g.columnIndex === y
|
|
@@ -3837,20 +3825,20 @@ function Me() {
|
|
|
3837
3825
|
})
|
|
3838
3826
|
] });
|
|
3839
3827
|
}
|
|
3840
|
-
function
|
|
3841
|
-
var r, c,
|
|
3828
|
+
function ys() {
|
|
3829
|
+
var r, c, i;
|
|
3842
3830
|
const s = u((x) => x.card.preferences), t = u(
|
|
3843
3831
|
(x) => x.card.cfg
|
|
3844
3832
|
), { setCardCfg: a, setCardPreferences: n, setChartOrientation: l } = u((x) => x.actions);
|
|
3845
3833
|
(r = t == null ? void 0 : t.options) != null && r.indexAxis;
|
|
3846
|
-
function
|
|
3834
|
+
function o(x) {
|
|
3847
3835
|
l(x);
|
|
3848
3836
|
}
|
|
3849
3837
|
return /* @__PURE__ */ e.jsxs(
|
|
3850
|
-
|
|
3838
|
+
bs,
|
|
3851
3839
|
{
|
|
3852
|
-
value: ((c = s == null ? void 0 : s.chartOptions) == null ? void 0 : c.indexAxis) || ((
|
|
3853
|
-
onValueChange:
|
|
3840
|
+
value: ((c = s == null ? void 0 : s.chartOptions) == null ? void 0 : c.indexAxis) || ((i = t == null ? void 0 : t.options) == null ? void 0 : i.indexAxis) || "x",
|
|
3841
|
+
onValueChange: o,
|
|
3854
3842
|
className: "flex gap-3",
|
|
3855
3843
|
defaultValue: "x",
|
|
3856
3844
|
children: [
|
|
@@ -3868,44 +3856,44 @@ function bs() {
|
|
|
3868
3856
|
}
|
|
3869
3857
|
const ns = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
|
|
3870
3858
|
function ia(s, t) {
|
|
3871
|
-
var n, l,
|
|
3872
|
-
const a =
|
|
3873
|
-
return ((
|
|
3859
|
+
var n, l, o;
|
|
3860
|
+
const a = za(s, t);
|
|
3861
|
+
return ((o = (l = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : l[a]) == null ? void 0 : o.type) || "linear";
|
|
3874
3862
|
}
|
|
3875
3863
|
function et() {
|
|
3876
|
-
var le, J, ne,
|
|
3877
|
-
const [s, t] = R(!1), a = u((
|
|
3878
|
-
var
|
|
3879
|
-
return (
|
|
3880
|
-
}), n = u((
|
|
3881
|
-
var
|
|
3882
|
-
return (
|
|
3883
|
-
}), l =
|
|
3864
|
+
var le, J, ne, k, _, ee;
|
|
3865
|
+
const [s, t] = R(!1), a = u((A) => {
|
|
3866
|
+
var D;
|
|
3867
|
+
return (D = A.card) == null ? void 0 : D.preferences;
|
|
3868
|
+
}), n = u((A) => {
|
|
3869
|
+
var D;
|
|
3870
|
+
return (D = A.card) == null ? void 0 : D.cfg;
|
|
3871
|
+
}), l = za(a, n), [o, r] = R(
|
|
3884
3872
|
ia(a)
|
|
3885
|
-
), [c,
|
|
3873
|
+
), [c, i] = R(
|
|
3886
3874
|
((ne = (J = (le = a == null ? void 0 : a.chartOptions) == null ? void 0 : le.scales) == null ? void 0 : J[l]) == null ? void 0 : ne.min) || ""
|
|
3887
3875
|
), [x, d] = R(
|
|
3888
|
-
((ee = (_ = (
|
|
3889
|
-
), [y, f] = R(c || x ? "custom" : "auto"), [m, g] = R(""), [j,
|
|
3890
|
-
(
|
|
3891
|
-
), { updateCardInFrame: h } = ce(), v = u((
|
|
3892
|
-
var
|
|
3893
|
-
return (
|
|
3894
|
-
}),
|
|
3876
|
+
((ee = (_ = (k = a == null ? void 0 : a.chartOptions) == null ? void 0 : k.scales) == null ? void 0 : _[l]) == null ? void 0 : ee.max) || ""
|
|
3877
|
+
), [y, f] = R(c || x ? "custom" : "auto"), [m, g] = R(""), [j, T] = R(0), [C, M] = R(""), [I, V] = R(""), [N, w] = R(""), L = u(
|
|
3878
|
+
(A) => A.actions.setCardPreferences
|
|
3879
|
+
), { updateCardInFrame: h } = ce(), v = u((A) => A.card), p = u((A) => {
|
|
3880
|
+
var D;
|
|
3881
|
+
return (D = A.card) == null ? void 0 : D.type;
|
|
3882
|
+
}), O = ["pie", "doughnut", "polarArea"].includes(p);
|
|
3895
3883
|
Z(() => {
|
|
3896
|
-
var
|
|
3897
|
-
r(ia(a)),
|
|
3898
|
-
((se = (
|
|
3884
|
+
var A, D, se, P, X, ie, Ne, Le, Se, Fe, we, ae, ue, he;
|
|
3885
|
+
r(ia(a)), i(
|
|
3886
|
+
((se = (D = (A = a == null ? void 0 : a.chartOptions) == null ? void 0 : A.scales) == null ? void 0 : D[l]) == null ? void 0 : se.min) === 0 ? 0 : ""
|
|
3899
3887
|
), d(((ie = (X = (P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : X[l]) == null ? void 0 : ie.max) || ""), g(
|
|
3900
|
-
((Fe = (
|
|
3901
|
-
),
|
|
3888
|
+
((Fe = (Se = (Le = (Ne = a == null ? void 0 : a.chartOptions) == null ? void 0 : Ne.scales) == null ? void 0 : Le[l]) == null ? void 0 : Se.ticks) == null ? void 0 : Fe.stepSize) || ""
|
|
3889
|
+
), T(((we = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : we.decimalPlaces) || 0), M(((ae = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ae.suffix) || ""), V(((ue = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : ue.currency) || ""), w(((he = a == null ? void 0 : a.numberAxisFormat) == null ? void 0 : he.locale) || "");
|
|
3902
3890
|
}, [s, a, l]);
|
|
3903
|
-
function
|
|
3904
|
-
return
|
|
3891
|
+
function E(A, D) {
|
|
3892
|
+
return D === "" || /^[0-9\b]+$/.test(D) ? Number(D) : Number(A);
|
|
3905
3893
|
}
|
|
3906
3894
|
function $() {
|
|
3907
|
-
const
|
|
3908
|
-
...new Set(cs.map((
|
|
3895
|
+
const A = [
|
|
3896
|
+
...new Set(cs.map((D) => D.currency))
|
|
3909
3897
|
];
|
|
3910
3898
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3911
3899
|
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-6 items-center gap-2", children: [
|
|
@@ -3928,18 +3916,18 @@ function et() {
|
|
|
3928
3916
|
fe,
|
|
3929
3917
|
{
|
|
3930
3918
|
value: I || "none",
|
|
3931
|
-
onValueChange: (
|
|
3919
|
+
onValueChange: (D) => V(D === "none" ? "" : D),
|
|
3932
3920
|
children: [
|
|
3933
3921
|
/* @__PURE__ */ e.jsx(ge, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
|
|
3934
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
3922
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
3935
3923
|
/* @__PURE__ */ e.jsx(ye, { children: "Currency" }),
|
|
3936
3924
|
/* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }),
|
|
3937
|
-
|
|
3925
|
+
A.map((D) => /* @__PURE__ */ e.jsx(Q, { value: D, children: D }, D))
|
|
3938
3926
|
] }) })
|
|
3939
3927
|
]
|
|
3940
3928
|
}
|
|
3941
3929
|
),
|
|
3942
|
-
/* @__PURE__ */ e.jsxs(fe, { value: N, onValueChange: (
|
|
3930
|
+
/* @__PURE__ */ e.jsxs(fe, { value: N, onValueChange: (D) => w(D), children: [
|
|
3943
3931
|
/* @__PURE__ */ e.jsx(
|
|
3944
3932
|
ge,
|
|
3945
3933
|
{
|
|
@@ -3947,9 +3935,9 @@ function et() {
|
|
|
3947
3935
|
children: /* @__PURE__ */ e.jsx(je, {})
|
|
3948
3936
|
}
|
|
3949
3937
|
),
|
|
3950
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
3938
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
3951
3939
|
/* @__PURE__ */ e.jsx(ye, { children: "Locale" }),
|
|
3952
|
-
cs.map((
|
|
3940
|
+
cs.map((D) => /* @__PURE__ */ e.jsx(Q, { value: D.locale, children: D.locale }, D.locale))
|
|
3953
3941
|
] }) })
|
|
3954
3942
|
] })
|
|
3955
3943
|
] }),
|
|
@@ -3959,7 +3947,7 @@ function et() {
|
|
|
3959
3947
|
re,
|
|
3960
3948
|
{
|
|
3961
3949
|
value: j,
|
|
3962
|
-
onChange: (
|
|
3950
|
+
onChange: (D) => T(Number(D.target.value)),
|
|
3963
3951
|
id: "format",
|
|
3964
3952
|
className: `col-span-6 h-8 w-full tracking-wide ${ns}`
|
|
3965
3953
|
}
|
|
@@ -3976,7 +3964,7 @@ function et() {
|
|
|
3976
3964
|
{
|
|
3977
3965
|
id: "min",
|
|
3978
3966
|
value: c,
|
|
3979
|
-
onChange: (
|
|
3967
|
+
onChange: (A) => i((D) => E(D, A.target.value)),
|
|
3980
3968
|
className: `col-span-1 h-8 w-full ${ns}`
|
|
3981
3969
|
}
|
|
3982
3970
|
),
|
|
@@ -3984,7 +3972,7 @@ function et() {
|
|
|
3984
3972
|
re,
|
|
3985
3973
|
{
|
|
3986
3974
|
value: x,
|
|
3987
|
-
onChange: (
|
|
3975
|
+
onChange: (A) => d((D) => E(D, A.target.value)),
|
|
3988
3976
|
id: "max",
|
|
3989
3977
|
className: `col-span-1 h-8 w-full ${ns}`
|
|
3990
3978
|
}
|
|
@@ -3996,7 +3984,7 @@ function et() {
|
|
|
3996
3984
|
re,
|
|
3997
3985
|
{
|
|
3998
3986
|
value: m,
|
|
3999
|
-
onChange: (
|
|
3987
|
+
onChange: (A) => g((D) => E(D, A.target.value)),
|
|
4000
3988
|
id: "step-size",
|
|
4001
3989
|
className: `col-span-1 h-8 w-full ${ns}`
|
|
4002
3990
|
}
|
|
@@ -4006,15 +3994,15 @@ function et() {
|
|
|
4006
3994
|
}
|
|
4007
3995
|
function Y() {
|
|
4008
3996
|
var P;
|
|
4009
|
-
let
|
|
4010
|
-
y === "custom" && (
|
|
3997
|
+
let A = {};
|
|
3998
|
+
y === "custom" && (A = {
|
|
4011
3999
|
min: c,
|
|
4012
4000
|
max: x,
|
|
4013
4001
|
ticks: {
|
|
4014
4002
|
stepSize: m
|
|
4015
4003
|
}
|
|
4016
4004
|
});
|
|
4017
|
-
const
|
|
4005
|
+
const D = {
|
|
4018
4006
|
...a || {},
|
|
4019
4007
|
chartOptions: {
|
|
4020
4008
|
...a == null ? void 0 : a.chartOptions,
|
|
@@ -4022,8 +4010,8 @@ function et() {
|
|
|
4022
4010
|
...(P = a == null ? void 0 : a.chartOptions) == null ? void 0 : P.scales,
|
|
4023
4011
|
[l]: {
|
|
4024
4012
|
// ...cardPreferences?.chartOptions?.scales?.[axis],
|
|
4025
|
-
type:
|
|
4026
|
-
...
|
|
4013
|
+
type: o,
|
|
4014
|
+
...o === "linear" ? A : {}
|
|
4027
4015
|
}
|
|
4028
4016
|
}
|
|
4029
4017
|
},
|
|
@@ -4034,16 +4022,16 @@ function et() {
|
|
|
4034
4022
|
locale: N
|
|
4035
4023
|
}
|
|
4036
4024
|
};
|
|
4037
|
-
console.log(
|
|
4025
|
+
console.log(D), L(D);
|
|
4038
4026
|
const se = {
|
|
4039
4027
|
...v,
|
|
4040
|
-
preferences:
|
|
4028
|
+
preferences: D
|
|
4041
4029
|
};
|
|
4042
4030
|
h(se);
|
|
4043
4031
|
}
|
|
4044
|
-
return /* @__PURE__ */ e.jsxs(
|
|
4045
|
-
/* @__PURE__ */ e.jsx(
|
|
4046
|
-
/* @__PURE__ */ e.jsx(
|
|
4032
|
+
return /* @__PURE__ */ e.jsxs(fs, { onOpenChange: (A) => t(A), children: [
|
|
4033
|
+
/* @__PURE__ */ e.jsx(gs, { asChild: !0, children: /* @__PURE__ */ e.jsx(an, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
|
|
4034
|
+
/* @__PURE__ */ e.jsx(js, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
|
|
4047
4035
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4048
4036
|
/* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
|
|
4049
4037
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-muted-foreground", children: "Set the scale for the number axis" })
|
|
@@ -4054,12 +4042,12 @@ function et() {
|
|
|
4054
4042
|
/* @__PURE__ */ e.jsxs(
|
|
4055
4043
|
fe,
|
|
4056
4044
|
{
|
|
4057
|
-
disabled:
|
|
4058
|
-
value:
|
|
4059
|
-
onValueChange: (
|
|
4045
|
+
disabled: O,
|
|
4046
|
+
value: o,
|
|
4047
|
+
onValueChange: (A) => r(A),
|
|
4060
4048
|
children: [
|
|
4061
4049
|
/* @__PURE__ */ e.jsx(ge, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
|
|
4062
|
-
/* @__PURE__ */ e.jsx(be, { id: "type", children: /* @__PURE__ */ e.jsxs(
|
|
4050
|
+
/* @__PURE__ */ e.jsx(be, { id: "type", children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
4063
4051
|
/* @__PURE__ */ e.jsx(ye, { children: "Option" }),
|
|
4064
4052
|
/* @__PURE__ */ e.jsx(Q, { value: "linear", children: "Linear" }),
|
|
4065
4053
|
/* @__PURE__ */ e.jsx(Q, { value: "logarithmic", children: "Logarithmic" })
|
|
@@ -4068,15 +4056,15 @@ function et() {
|
|
|
4068
4056
|
}
|
|
4069
4057
|
)
|
|
4070
4058
|
] }),
|
|
4071
|
-
|
|
4059
|
+
o == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
|
|
4072
4060
|
/* @__PURE__ */ e.jsx(H, { htmlFor: "scale-option", children: "Setup" }),
|
|
4073
4061
|
/* @__PURE__ */ e.jsxs(
|
|
4074
|
-
|
|
4062
|
+
bs,
|
|
4075
4063
|
{
|
|
4076
|
-
disabled:
|
|
4064
|
+
disabled: O,
|
|
4077
4065
|
id: "scale-option",
|
|
4078
4066
|
value: y,
|
|
4079
|
-
onValueChange: (
|
|
4067
|
+
onValueChange: (A) => f(A),
|
|
4080
4068
|
className: "col-span-2 flex gap-3",
|
|
4081
4069
|
defaultValue: "x",
|
|
4082
4070
|
children: [
|
|
@@ -4092,9 +4080,9 @@ function et() {
|
|
|
4092
4080
|
}
|
|
4093
4081
|
)
|
|
4094
4082
|
] }),
|
|
4095
|
-
y === "custom" &&
|
|
4083
|
+
y === "custom" && o == "linear" && B(),
|
|
4096
4084
|
$(),
|
|
4097
|
-
/* @__PURE__ */ e.jsx(
|
|
4085
|
+
/* @__PURE__ */ e.jsx(tn, {}),
|
|
4098
4086
|
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
|
|
4099
4087
|
F,
|
|
4100
4088
|
{
|
|
@@ -4108,28 +4096,28 @@ function et() {
|
|
|
4108
4096
|
] }) })
|
|
4109
4097
|
] });
|
|
4110
4098
|
}
|
|
4111
|
-
function
|
|
4099
|
+
function Al({ idx: s }) {
|
|
4112
4100
|
var c;
|
|
4113
|
-
const t = u((
|
|
4101
|
+
const t = u((i) => {
|
|
4114
4102
|
var x;
|
|
4115
|
-
return (x =
|
|
4103
|
+
return (x = i.card) == null ? void 0 : x.preferences;
|
|
4116
4104
|
}), a = u(
|
|
4117
|
-
(
|
|
4105
|
+
(i) => {
|
|
4118
4106
|
var x;
|
|
4119
|
-
return (x =
|
|
4107
|
+
return (x = i.card.preferences) == null ? void 0 : x.datasetOptions;
|
|
4120
4108
|
}
|
|
4121
4109
|
), n = u(
|
|
4122
|
-
(
|
|
4123
|
-
), l = (c = t == null ? void 0 : t.chartOptions) == null ? void 0 : c.indexAxis,
|
|
4124
|
-
function r(
|
|
4125
|
-
(
|
|
4110
|
+
(i) => i.actions.setCardPreferences
|
|
4111
|
+
), l = (c = t == null ? void 0 : t.chartOptions) == null ? void 0 : c.indexAxis, o = a == null ? void 0 : a.find((i) => i.idx === s);
|
|
4112
|
+
function r(i, x) {
|
|
4113
|
+
(i === "end" || i === "start") && nn(ln());
|
|
4126
4114
|
const d = {
|
|
4127
|
-
display:
|
|
4128
|
-
align:
|
|
4129
|
-
anchor:
|
|
4115
|
+
display: i !== "none",
|
|
4116
|
+
align: i,
|
|
4117
|
+
anchor: i,
|
|
4130
4118
|
clamp: !0
|
|
4131
4119
|
};
|
|
4132
|
-
if (!
|
|
4120
|
+
if (!o)
|
|
4133
4121
|
n({
|
|
4134
4122
|
...t,
|
|
4135
4123
|
datasetOptions: [
|
|
@@ -4141,7 +4129,7 @@ function El({ idx: s }) {
|
|
|
4141
4129
|
]
|
|
4142
4130
|
});
|
|
4143
4131
|
else {
|
|
4144
|
-
const y = { ...
|
|
4132
|
+
const y = { ...o };
|
|
4145
4133
|
y.datalabels = d;
|
|
4146
4134
|
const f = a == null ? void 0 : a.map(
|
|
4147
4135
|
(m) => m.idx === x ? y : m
|
|
@@ -4152,9 +4140,9 @@ function El({ idx: s }) {
|
|
|
4152
4140
|
});
|
|
4153
4141
|
}
|
|
4154
4142
|
}
|
|
4155
|
-
return /* @__PURE__ */ e.jsxs(
|
|
4156
|
-
/* @__PURE__ */ e.jsx(
|
|
4157
|
-
/* @__PURE__ */ e.jsx(
|
|
4143
|
+
return /* @__PURE__ */ e.jsxs(fs, { children: [
|
|
4144
|
+
/* @__PURE__ */ e.jsx(gs, { children: /* @__PURE__ */ e.jsx(Wn, { className: "invisible size-4 rotate-[135deg] cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible" }) }),
|
|
4145
|
+
/* @__PURE__ */ e.jsx(js, { className: "w-fit p-1", children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
|
|
4158
4146
|
/* @__PURE__ */ e.jsx(
|
|
4159
4147
|
F,
|
|
4160
4148
|
{
|
|
@@ -4162,7 +4150,7 @@ function El({ idx: s }) {
|
|
|
4162
4150
|
size: "sm",
|
|
4163
4151
|
variant: "secondary",
|
|
4164
4152
|
className: "h-7 p-1 text-xs font-normal",
|
|
4165
|
-
children: /* @__PURE__ */ e.jsx(
|
|
4153
|
+
children: /* @__PURE__ */ e.jsx(Oa, { className: "size-4" })
|
|
4166
4154
|
}
|
|
4167
4155
|
),
|
|
4168
4156
|
/* @__PURE__ */ e.jsx(
|
|
@@ -4173,7 +4161,7 @@ function El({ idx: s }) {
|
|
|
4173
4161
|
variant: "secondary",
|
|
4174
4162
|
className: "h-7 p-1 text-xs font-normal",
|
|
4175
4163
|
children: /* @__PURE__ */ e.jsx(
|
|
4176
|
-
|
|
4164
|
+
Rn,
|
|
4177
4165
|
{
|
|
4178
4166
|
className: W("h-4 w-4", {
|
|
4179
4167
|
"rotate-90": l === "y"
|
|
@@ -4190,7 +4178,7 @@ function El({ idx: s }) {
|
|
|
4190
4178
|
variant: "secondary",
|
|
4191
4179
|
className: "h-7 p-1 text-xs font-normal",
|
|
4192
4180
|
children: /* @__PURE__ */ e.jsx(
|
|
4193
|
-
|
|
4181
|
+
Hn,
|
|
4194
4182
|
{
|
|
4195
4183
|
className: W("h-4 w-4", {
|
|
4196
4184
|
"rotate-90": l === "y"
|
|
@@ -4207,7 +4195,7 @@ function El({ idx: s }) {
|
|
|
4207
4195
|
variant: "secondary",
|
|
4208
4196
|
className: "h-7 p-1 text-xs font-normal",
|
|
4209
4197
|
children: /* @__PURE__ */ e.jsx(
|
|
4210
|
-
|
|
4198
|
+
_n,
|
|
4211
4199
|
{
|
|
4212
4200
|
className: W("h-4 w-4", {
|
|
4213
4201
|
"rotate-90": l === "y"
|
|
@@ -4226,21 +4214,21 @@ function st() {
|
|
|
4226
4214
|
return (f = (y = (d = x == null ? void 0 : x.card) == null ? void 0 : d.preferences) == null ? void 0 : y.chartOptions) == null ? void 0 : f.indexAxis;
|
|
4227
4215
|
}
|
|
4228
4216
|
), { data: a } = qe(s), n = t === "y" ? "Y axis" : "X axis", l = t === "y" ? "X axis" : "Y axis", {
|
|
4229
|
-
keys:
|
|
4217
|
+
keys: o,
|
|
4230
4218
|
metricKeys: r,
|
|
4231
4219
|
dimensionKeys: c
|
|
4232
|
-
} =
|
|
4233
|
-
let
|
|
4220
|
+
} = ws((a == null ? void 0 : a.records) || []);
|
|
4221
|
+
let i = r;
|
|
4234
4222
|
if (["stackedBar", "stackedLine"].includes(s.type)) {
|
|
4235
|
-
const x =
|
|
4223
|
+
const x = rn({
|
|
4236
4224
|
dataArray: (a == null ? void 0 : a.records) || [],
|
|
4237
4225
|
groupKey: c[0],
|
|
4238
4226
|
pivotKey: c[1],
|
|
4239
|
-
valueKey:
|
|
4240
|
-
}), { metricKeys: d } =
|
|
4241
|
-
|
|
4227
|
+
valueKey: i[0]
|
|
4228
|
+
}), { metricKeys: d } = ws(x);
|
|
4229
|
+
i = d;
|
|
4242
4230
|
}
|
|
4243
|
-
return
|
|
4231
|
+
return o.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4244
4232
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
4245
4233
|
/* @__PURE__ */ e.jsx(H, { children: n }),
|
|
4246
4234
|
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md bg-muted/70 px-2 py-1 hover:bg-muted", children: /* @__PURE__ */ e.jsx("p", { children: c[0] }) }) })
|
|
@@ -4250,23 +4238,23 @@ function st() {
|
|
|
4250
4238
|
/* @__PURE__ */ e.jsx(H, { children: l }),
|
|
4251
4239
|
/* @__PURE__ */ e.jsx(et, {})
|
|
4252
4240
|
] }),
|
|
4253
|
-
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children:
|
|
4241
|
+
/* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: i.map((x, d) => /* @__PURE__ */ e.jsx(Vl, { col: x, idx: d }, x)) })
|
|
4254
4242
|
] })
|
|
4255
4243
|
] });
|
|
4256
4244
|
}
|
|
4257
|
-
function
|
|
4245
|
+
function Vl({ col: s, idx: t }) {
|
|
4258
4246
|
const a = u((c) => {
|
|
4259
|
-
var
|
|
4260
|
-
return (
|
|
4247
|
+
var i;
|
|
4248
|
+
return (i = c.card) == null ? void 0 : i.preferences;
|
|
4261
4249
|
}), n = u(
|
|
4262
4250
|
(c) => {
|
|
4263
|
-
var
|
|
4264
|
-
return (
|
|
4251
|
+
var i;
|
|
4252
|
+
return (i = c.card.preferences) == null ? void 0 : i.datasetOptions;
|
|
4265
4253
|
}
|
|
4266
|
-
), l = n == null ? void 0 : n.find((c) => c.idx === t), { setCardPreferences:
|
|
4254
|
+
), l = n == null ? void 0 : n.find((c) => c.idx === t), { setCardPreferences: o } = u((c) => c.actions);
|
|
4267
4255
|
function r(c) {
|
|
4268
4256
|
if (!l)
|
|
4269
|
-
|
|
4257
|
+
o({
|
|
4270
4258
|
...a,
|
|
4271
4259
|
datasetOptions: [
|
|
4272
4260
|
...n || [],
|
|
@@ -4278,12 +4266,12 @@ function Al({ col: s, idx: t }) {
|
|
|
4278
4266
|
]
|
|
4279
4267
|
});
|
|
4280
4268
|
else {
|
|
4281
|
-
const
|
|
4282
|
-
|
|
4269
|
+
const i = { ...l };
|
|
4270
|
+
i.type = c === "area" ? "line" : c, i.fill = c === "area" ? "origin" : "";
|
|
4283
4271
|
const x = n == null ? void 0 : n.map(
|
|
4284
|
-
(d) => d.idx === t ?
|
|
4272
|
+
(d) => d.idx === t ? i : d
|
|
4285
4273
|
);
|
|
4286
|
-
|
|
4274
|
+
o({
|
|
4287
4275
|
...a,
|
|
4288
4276
|
datasetOptions: x
|
|
4289
4277
|
});
|
|
@@ -4320,35 +4308,35 @@ function Al({ col: s, idx: t }) {
|
|
|
4320
4308
|
className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
|
|
4321
4309
|
}
|
|
4322
4310
|
),
|
|
4323
|
-
/* @__PURE__ */ e.jsx(
|
|
4311
|
+
/* @__PURE__ */ e.jsx(Al, { idx: t })
|
|
4324
4312
|
] })
|
|
4325
4313
|
] });
|
|
4326
4314
|
}
|
|
4327
4315
|
function at() {
|
|
4328
|
-
const s = u((f) => f.selectedConnectionId), t = u((f) => f.selectedDatamodelId), a = u((f) => f.selectedDatabaseName), n = u((f) => f.selectedSchemaName), l = u((f) => f.selectedTableName),
|
|
4316
|
+
const s = u((f) => f.selectedConnectionId), t = u((f) => f.selectedDatamodelId), a = u((f) => f.selectedDatabaseName), n = u((f) => f.selectedSchemaName), l = u((f) => f.selectedTableName), o = z((f) => f.dashboard.filters) || [], r = z((f) => f.actions.addFilter), c = z((f) => f.actions.removeFilter), i = z(
|
|
4329
4317
|
(f) => f.actions.removeFilterValue
|
|
4330
4318
|
), { modelItems: x, tableName: d } = Re();
|
|
4331
4319
|
function y(f, m = "dashboard") {
|
|
4332
|
-
var
|
|
4333
|
-
const g = xe(f.column_name), j = xe(a || ""),
|
|
4334
|
-
let
|
|
4335
|
-
|
|
4320
|
+
var w;
|
|
4321
|
+
const g = xe(f.column_name), j = xe(a || ""), T = xe(n || ""), C = xe(d);
|
|
4322
|
+
let M = ja(
|
|
4323
|
+
T,
|
|
4336
4324
|
C
|
|
4337
|
-
), I = `${
|
|
4338
|
-
const
|
|
4339
|
-
(
|
|
4340
|
-
)) == null ? void 0 :
|
|
4341
|
-
t && t !== "none" && (I = `${
|
|
4342
|
-
const N =
|
|
4343
|
-
(
|
|
4325
|
+
), I = `${M}.${g}`;
|
|
4326
|
+
const V = (w = x == null ? void 0 : x.find(
|
|
4327
|
+
(L) => L.id === t
|
|
4328
|
+
)) == null ? void 0 : w.name;
|
|
4329
|
+
t && t !== "none" && (I = `${Ss}.${V}.${g}`, M = `${Ss}.${V}`);
|
|
4330
|
+
const N = o == null ? void 0 : o.find(
|
|
4331
|
+
(L) => L.column === I && L.table === C && (L.database === j || L.database === a)
|
|
4344
4332
|
);
|
|
4345
4333
|
if (N)
|
|
4346
|
-
|
|
4334
|
+
i(N.id), c(N.id);
|
|
4347
4335
|
else {
|
|
4348
|
-
const
|
|
4336
|
+
const L = We();
|
|
4349
4337
|
return d === "api" && s ? (r({
|
|
4350
4338
|
location: m,
|
|
4351
|
-
id:
|
|
4339
|
+
id: L,
|
|
4352
4340
|
//uuidv4(),
|
|
4353
4341
|
column: I,
|
|
4354
4342
|
title: f.column_name,
|
|
@@ -4360,12 +4348,12 @@ function at() {
|
|
|
4360
4348
|
operation: "in",
|
|
4361
4349
|
sql: aa(
|
|
4362
4350
|
f.data_type,
|
|
4363
|
-
|
|
4351
|
+
M,
|
|
4364
4352
|
g
|
|
4365
4353
|
)
|
|
4366
4354
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4367
|
-
}),
|
|
4368
|
-
id:
|
|
4355
|
+
}), L) : (r({
|
|
4356
|
+
id: L,
|
|
4369
4357
|
//uuidv4(),
|
|
4370
4358
|
location: m,
|
|
4371
4359
|
column: I,
|
|
@@ -4378,11 +4366,11 @@ function at() {
|
|
|
4378
4366
|
operation: "in",
|
|
4379
4367
|
sql: aa(
|
|
4380
4368
|
f.data_type,
|
|
4381
|
-
|
|
4369
|
+
M,
|
|
4382
4370
|
g
|
|
4383
4371
|
)
|
|
4384
4372
|
//DATE_DATA_TYPES.includes(column.data_type) ? dateSql : sql,
|
|
4385
|
-
}),
|
|
4373
|
+
}), L);
|
|
4386
4374
|
}
|
|
4387
4375
|
}
|
|
4388
4376
|
return { assignFilter: y };
|
|
@@ -4391,25 +4379,25 @@ function _e() {
|
|
|
4391
4379
|
const s = z(
|
|
4392
4380
|
(c) => c.dashboard.filters
|
|
4393
4381
|
), t = u((c) => c.frame), { setFrame: a } = ce(), { columns: n } = Re(), { assignFilter: l } = at();
|
|
4394
|
-
function
|
|
4395
|
-
const
|
|
4396
|
-
a({ ...t, filterId:
|
|
4382
|
+
function o(c) {
|
|
4383
|
+
const i = l(c, "frame");
|
|
4384
|
+
a({ ...t, filterId: i });
|
|
4397
4385
|
}
|
|
4398
4386
|
const r = s == null ? void 0 : s.find((c) => c.id === t.filterId);
|
|
4399
4387
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
4400
4388
|
/* @__PURE__ */ e.jsx(H, { children: "Card Filter" }),
|
|
4401
|
-
/* @__PURE__ */ e.jsx(
|
|
4402
|
-
r && /* @__PURE__ */ e.jsx(
|
|
4389
|
+
/* @__PURE__ */ e.jsx(ql, { onSelect: o, columns: n }),
|
|
4390
|
+
r && /* @__PURE__ */ e.jsx(on, { filter: r })
|
|
4403
4391
|
] });
|
|
4404
4392
|
}
|
|
4405
|
-
function
|
|
4393
|
+
function ql({
|
|
4406
4394
|
columns: s,
|
|
4407
4395
|
onSelect: t
|
|
4408
4396
|
}) {
|
|
4409
4397
|
var r;
|
|
4410
|
-
const [a, n] = ta.useState(!1), [l,
|
|
4411
|
-
return /* @__PURE__ */ e.jsxs(
|
|
4412
|
-
/* @__PURE__ */ e.jsx(
|
|
4398
|
+
const [a, n] = ta.useState(!1), [l, o] = ta.useState("");
|
|
4399
|
+
return /* @__PURE__ */ e.jsxs(fs, { open: a, onOpenChange: n, children: [
|
|
4400
|
+
/* @__PURE__ */ e.jsx(gs, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
4413
4401
|
F,
|
|
4414
4402
|
{
|
|
4415
4403
|
size: "sm",
|
|
@@ -4419,21 +4407,21 @@ function Vl({
|
|
|
4419
4407
|
className: "w-full justify-between font-normal",
|
|
4420
4408
|
children: [
|
|
4421
4409
|
l ? (r = s.find((c) => c.column_name === l)) == null ? void 0 : r.column_name : "Select Column...",
|
|
4422
|
-
/* @__PURE__ */ e.jsx(
|
|
4410
|
+
/* @__PURE__ */ e.jsx(cn, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
4423
4411
|
]
|
|
4424
4412
|
}
|
|
4425
4413
|
) }),
|
|
4426
|
-
/* @__PURE__ */ e.jsx(
|
|
4427
|
-
/* @__PURE__ */ e.jsx(
|
|
4428
|
-
/* @__PURE__ */ e.jsxs(
|
|
4429
|
-
/* @__PURE__ */ e.jsx(
|
|
4430
|
-
/* @__PURE__ */ e.jsx(
|
|
4431
|
-
|
|
4414
|
+
/* @__PURE__ */ e.jsx(js, { className: "w-[200px] p-0", children: /* @__PURE__ */ e.jsxs(dn, { children: [
|
|
4415
|
+
/* @__PURE__ */ e.jsx(un, { placeholder: "Search column", className: "h-9" }),
|
|
4416
|
+
/* @__PURE__ */ e.jsxs(hn, { children: [
|
|
4417
|
+
/* @__PURE__ */ e.jsx(mn, { children: "No framework found." }),
|
|
4418
|
+
/* @__PURE__ */ e.jsx(xn, { children: s.map((c) => /* @__PURE__ */ e.jsxs(
|
|
4419
|
+
pn,
|
|
4432
4420
|
{
|
|
4433
4421
|
value: c.column_name,
|
|
4434
|
-
onSelect: (
|
|
4435
|
-
const x =
|
|
4436
|
-
|
|
4422
|
+
onSelect: (i) => {
|
|
4423
|
+
const x = i === l ? "" : i;
|
|
4424
|
+
o(x), n(!1), x && t(c);
|
|
4437
4425
|
},
|
|
4438
4426
|
children: [
|
|
4439
4427
|
c.column_name,
|
|
@@ -4454,7 +4442,7 @@ function Vl({
|
|
|
4454
4442
|
] }) })
|
|
4455
4443
|
] });
|
|
4456
4444
|
}
|
|
4457
|
-
function
|
|
4445
|
+
function Rl({
|
|
4458
4446
|
cardType: s
|
|
4459
4447
|
}) {
|
|
4460
4448
|
return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(De, { defaultValue: ["item-2"], type: "multiple", children: [
|
|
@@ -4486,7 +4474,7 @@ function ql({
|
|
|
4486
4474
|
/* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
|
|
4487
4475
|
/* @__PURE__ */ e.jsx(G, { children: "Settings" }),
|
|
4488
4476
|
/* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
|
|
4489
|
-
/* @__PURE__ */ e.jsx(
|
|
4477
|
+
/* @__PURE__ */ e.jsx(ys, {}),
|
|
4490
4478
|
/* @__PURE__ */ e.jsx(st, {})
|
|
4491
4479
|
] })
|
|
4492
4480
|
] }),
|
|
@@ -4500,13 +4488,13 @@ function ql({
|
|
|
4500
4488
|
] }) });
|
|
4501
4489
|
}
|
|
4502
4490
|
function Js() {
|
|
4503
|
-
var l,
|
|
4491
|
+
var l, o, r;
|
|
4504
4492
|
const s = u(
|
|
4505
4493
|
(c) => c.card.cfg
|
|
4506
4494
|
), t = u((c) => c.actions.setCardCfg), a = u((c) => c.card.type);
|
|
4507
4495
|
function n(c) {
|
|
4508
4496
|
var d;
|
|
4509
|
-
const
|
|
4497
|
+
const i = {
|
|
4510
4498
|
datalabels: {
|
|
4511
4499
|
display: c !== "none",
|
|
4512
4500
|
align: c,
|
|
@@ -4519,7 +4507,7 @@ function Js() {
|
|
|
4519
4507
|
...s == null ? void 0 : s.options,
|
|
4520
4508
|
plugins: {
|
|
4521
4509
|
...(d = s == null ? void 0 : s.options) == null ? void 0 : d.plugins,
|
|
4522
|
-
...
|
|
4510
|
+
...i
|
|
4523
4511
|
}
|
|
4524
4512
|
}
|
|
4525
4513
|
};
|
|
@@ -4533,12 +4521,12 @@ function Js() {
|
|
|
4533
4521
|
/* @__PURE__ */ e.jsxs(
|
|
4534
4522
|
fe,
|
|
4535
4523
|
{
|
|
4536
|
-
value: (r = (
|
|
4524
|
+
value: (r = (o = (l = s == null ? void 0 : s.options) == null ? void 0 : l.plugins) == null ? void 0 : o.datalabels) == null ? void 0 : r.anchor,
|
|
4537
4525
|
onValueChange: n,
|
|
4538
4526
|
defaultValue: "none",
|
|
4539
4527
|
children: [
|
|
4540
4528
|
/* @__PURE__ */ e.jsx(ge, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, { placeholder: "Select position" }) }),
|
|
4541
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
4529
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
4542
4530
|
/* @__PURE__ */ e.jsx(ye, { children: "Data Labels" }),
|
|
4543
4531
|
/* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }),
|
|
4544
4532
|
a !== "pyramid" && /* @__PURE__ */ e.jsx(Q, { value: "start", children: "Start" }),
|
|
@@ -4550,13 +4538,12 @@ function Js() {
|
|
|
4550
4538
|
)
|
|
4551
4539
|
] });
|
|
4552
4540
|
}
|
|
4553
|
-
function
|
|
4541
|
+
function _l({
|
|
4554
4542
|
cardType: s
|
|
4555
4543
|
}) {
|
|
4556
4544
|
function t(a) {
|
|
4557
|
-
const n = "SELECT label, [group], x-axis, y-axis, radius FROM table", l = "SELECT label, [group], x-axis, y-axis FROM table";
|
|
4558
4545
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
4559
|
-
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: a === "bubble" ?
|
|
4546
|
+
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: a === "bubble" ? "SELECT label, [group], x-axis, y-axis, radius FROM table" : "SELECT label, [group], x-axis, y-axis FROM table" }),
|
|
4560
4547
|
/* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
|
|
4561
4548
|
/* @__PURE__ */ e.jsx("li", { children: "label - category" }),
|
|
4562
4549
|
/* @__PURE__ */ e.jsx("li", { children: "group - category" }),
|
|
@@ -4570,7 +4557,7 @@ function Rl({
|
|
|
4570
4557
|
"a",
|
|
4571
4558
|
{
|
|
4572
4559
|
target: "_blank",
|
|
4573
|
-
onClick: (
|
|
4560
|
+
onClick: (o) => o.stopPropagation(),
|
|
4574
4561
|
className: "text-blue-700",
|
|
4575
4562
|
href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
|
|
4576
4563
|
children: "example"
|
|
@@ -4598,7 +4585,7 @@ function Rl({
|
|
|
4598
4585
|
] })
|
|
4599
4586
|
] }) });
|
|
4600
4587
|
}
|
|
4601
|
-
const
|
|
4588
|
+
const Hl = {
|
|
4602
4589
|
datasets: [
|
|
4603
4590
|
{
|
|
4604
4591
|
type: "line",
|
|
@@ -4611,7 +4598,7 @@ const _l = {
|
|
|
4611
4598
|
data: []
|
|
4612
4599
|
}
|
|
4613
4600
|
]
|
|
4614
|
-
},
|
|
4601
|
+
}, $l = {
|
|
4615
4602
|
datasets: [
|
|
4616
4603
|
{
|
|
4617
4604
|
fill: "origin",
|
|
@@ -4621,7 +4608,7 @@ const _l = {
|
|
|
4621
4608
|
}
|
|
4622
4609
|
]
|
|
4623
4610
|
};
|
|
4624
|
-
function
|
|
4611
|
+
function Pl() {
|
|
4625
4612
|
const s = u((t) => t.card.type);
|
|
4626
4613
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 p-6", children: [
|
|
4627
4614
|
/* @__PURE__ */ e.jsx(
|
|
@@ -4630,10 +4617,10 @@ function $l() {
|
|
|
4630
4617
|
className: " ",
|
|
4631
4618
|
type: "single",
|
|
4632
4619
|
collapsible: !0,
|
|
4633
|
-
children:
|
|
4620
|
+
children: Bl(s)
|
|
4634
4621
|
}
|
|
4635
4622
|
),
|
|
4636
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(
|
|
4623
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: ["line", "bar"].includes(s) && /* @__PURE__ */ e.jsx(ys, {}) }),
|
|
4637
4624
|
!["kpi"].includes(s) && /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
4638
4625
|
/* @__PURE__ */ e.jsx(Js, {}),
|
|
4639
4626
|
/* @__PURE__ */ e.jsx(Me, {}),
|
|
@@ -4641,7 +4628,7 @@ function $l() {
|
|
|
4641
4628
|
] })
|
|
4642
4629
|
] });
|
|
4643
4630
|
}
|
|
4644
|
-
function
|
|
4631
|
+
function Bl(s) {
|
|
4645
4632
|
if (["line", "bar"].includes(s))
|
|
4646
4633
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
4647
4634
|
/* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
|
|
@@ -4662,7 +4649,7 @@ function Pl(s) {
|
|
|
4662
4649
|
/* @__PURE__ */ e.jsx("b", { children: "Customize" }),
|
|
4663
4650
|
" and change the `type` property in the dataset."
|
|
4664
4651
|
] }),
|
|
4665
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
4652
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Hl, null, 2) })
|
|
4666
4653
|
] })
|
|
4667
4654
|
] }),
|
|
4668
4655
|
/* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
|
|
@@ -4683,7 +4670,7 @@ function Pl(s) {
|
|
|
4683
4670
|
),
|
|
4684
4671
|
"for more options."
|
|
4685
4672
|
] }),
|
|
4686
|
-
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(
|
|
4673
|
+
/* @__PURE__ */ e.jsx("pre", { children: JSON.stringify($l, null, 2) })
|
|
4687
4674
|
] })
|
|
4688
4675
|
] })
|
|
4689
4676
|
] });
|
|
@@ -4738,8 +4725,8 @@ function Pl(s) {
|
|
|
4738
4725
|
] })
|
|
4739
4726
|
] }) });
|
|
4740
4727
|
}
|
|
4741
|
-
function
|
|
4742
|
-
var
|
|
4728
|
+
function Ul() {
|
|
4729
|
+
var i, x, d, y, f;
|
|
4743
4730
|
const s = u((m) => m.card.preferences), t = u(
|
|
4744
4731
|
(m) => m.actions.setCardPreferences
|
|
4745
4732
|
), a = u(
|
|
@@ -4765,7 +4752,7 @@ function Bl() {
|
|
|
4765
4752
|
u(
|
|
4766
4753
|
(m) => m.actions.setFilterOnClickField
|
|
4767
4754
|
);
|
|
4768
|
-
const
|
|
4755
|
+
const o = u(
|
|
4769
4756
|
(m) => {
|
|
4770
4757
|
var g, j;
|
|
4771
4758
|
return (j = (g = m.card.preferences) == null ? void 0 : g.formatNumber) == null ? void 0 : j.colorRanges;
|
|
@@ -4776,9 +4763,9 @@ function Bl() {
|
|
|
4776
4763
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
4777
4764
|
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
|
|
4778
4765
|
/* @__PURE__ */ e.jsx(
|
|
4779
|
-
|
|
4766
|
+
xs,
|
|
4780
4767
|
{
|
|
4781
|
-
checked: !!((
|
|
4768
|
+
checked: !!((i = s == null ? void 0 : s.formatNumber) != null && i.enabled),
|
|
4782
4769
|
onCheckedChange: (m) => {
|
|
4783
4770
|
t({
|
|
4784
4771
|
...s,
|
|
@@ -4802,17 +4789,17 @@ function Bl() {
|
|
|
4802
4789
|
{
|
|
4803
4790
|
value: n || "none",
|
|
4804
4791
|
onValueChange: (m) => {
|
|
4805
|
-
var g, j,
|
|
4792
|
+
var g, j, T;
|
|
4806
4793
|
return a(
|
|
4807
4794
|
((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
|
|
4808
4795
|
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.currency) || "",
|
|
4809
4796
|
m,
|
|
4810
|
-
((
|
|
4797
|
+
((T = s == null ? void 0 : s.formatNumber) == null ? void 0 : T.suffix) || ""
|
|
4811
4798
|
);
|
|
4812
4799
|
},
|
|
4813
4800
|
children: [
|
|
4814
4801
|
/* @__PURE__ */ e.jsx(ge, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
|
|
4815
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
4802
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
4816
4803
|
/* @__PURE__ */ e.jsx(ye, { children: "Format" }),
|
|
4817
4804
|
/* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
|
|
4818
4805
|
cs.map((m) => /* @__PURE__ */ e.jsx(Q, { value: m.locale, children: m.locale }, m.locale))
|
|
@@ -4828,17 +4815,17 @@ function Bl() {
|
|
|
4828
4815
|
{
|
|
4829
4816
|
value: l || "none",
|
|
4830
4817
|
onValueChange: (m) => {
|
|
4831
|
-
var g, j,
|
|
4818
|
+
var g, j, T;
|
|
4832
4819
|
console.log("currency", m), a(
|
|
4833
4820
|
((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
|
|
4834
4821
|
m === "none" ? "" : m,
|
|
4835
4822
|
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.locale) || "",
|
|
4836
|
-
((
|
|
4823
|
+
((T = s == null ? void 0 : s.formatNumber) == null ? void 0 : T.suffix) || ""
|
|
4837
4824
|
);
|
|
4838
4825
|
},
|
|
4839
4826
|
children: [
|
|
4840
4827
|
/* @__PURE__ */ e.jsx(ge, { className: "col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(je, {}) }),
|
|
4841
|
-
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(
|
|
4828
|
+
/* @__PURE__ */ e.jsx(be, { children: /* @__PURE__ */ e.jsxs(Oe, { children: [
|
|
4842
4829
|
/* @__PURE__ */ e.jsx(ye, { children: "Currency" }),
|
|
4843
4830
|
/* @__PURE__ */ e.jsx(Q, { value: "none", children: "None" }, "none"),
|
|
4844
4831
|
c.map((m) => /* @__PURE__ */ e.jsx(Q, { value: m, children: m }, m))
|
|
@@ -4856,12 +4843,12 @@ function Bl() {
|
|
|
4856
4843
|
{
|
|
4857
4844
|
value: ((y = (d = s == null ? void 0 : s.formatNumber) == null ? void 0 : d.decimalPlaces) == null ? void 0 : y.toString()) || "0",
|
|
4858
4845
|
onValueChange: (m) => {
|
|
4859
|
-
var g, j,
|
|
4846
|
+
var g, j, T;
|
|
4860
4847
|
return a(
|
|
4861
4848
|
Number(m),
|
|
4862
4849
|
((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.currency) || "",
|
|
4863
4850
|
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.locale) || "",
|
|
4864
|
-
((
|
|
4851
|
+
((T = s == null ? void 0 : s.formatNumber) == null ? void 0 : T.suffix) || ""
|
|
4865
4852
|
);
|
|
4866
4853
|
},
|
|
4867
4854
|
children: [
|
|
@@ -4880,11 +4867,11 @@ function Bl() {
|
|
|
4880
4867
|
className: "h-8 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
4881
4868
|
placeholder: "K, M, B, %",
|
|
4882
4869
|
onChange: (m) => {
|
|
4883
|
-
var g, j,
|
|
4870
|
+
var g, j, T;
|
|
4884
4871
|
return a(
|
|
4885
4872
|
((g = s == null ? void 0 : s.formatNumber) == null ? void 0 : g.decimalPlaces) || 0,
|
|
4886
4873
|
((j = s == null ? void 0 : s.formatNumber) == null ? void 0 : j.currency) || "",
|
|
4887
|
-
((
|
|
4874
|
+
((T = s == null ? void 0 : s.formatNumber) == null ? void 0 : T.locale) || "",
|
|
4888
4875
|
m.target.value
|
|
4889
4876
|
);
|
|
4890
4877
|
}
|
|
@@ -4895,16 +4882,16 @@ function Bl() {
|
|
|
4895
4882
|
] }) }),
|
|
4896
4883
|
/* @__PURE__ */ e.jsx(de, { className: "my-3" }),
|
|
4897
4884
|
/* @__PURE__ */ e.jsx(
|
|
4898
|
-
|
|
4885
|
+
fn,
|
|
4899
4886
|
{
|
|
4900
|
-
colorRanges:
|
|
4887
|
+
colorRanges: o,
|
|
4901
4888
|
setColorRanges: r
|
|
4902
4889
|
}
|
|
4903
4890
|
)
|
|
4904
4891
|
] })
|
|
4905
4892
|
] });
|
|
4906
4893
|
}
|
|
4907
|
-
function
|
|
4894
|
+
function Gl() {
|
|
4908
4895
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-6 px-6 py-2", children: [
|
|
4909
4896
|
/* @__PURE__ */ e.jsx(De, { type: "single", collapsible: !0, children: /* @__PURE__ */ e.jsxs(U, { value: "item-1", children: [
|
|
4910
4897
|
/* @__PURE__ */ e.jsx(G, { className: "", children: "KPI Query" }),
|
|
@@ -4930,12 +4917,12 @@ function Ul() {
|
|
|
4930
4917
|
] })
|
|
4931
4918
|
] })
|
|
4932
4919
|
] }) }),
|
|
4933
|
-
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(
|
|
4920
|
+
/* @__PURE__ */ e.jsx("section", { className: "", children: /* @__PURE__ */ e.jsx(Ul, {}) }),
|
|
4934
4921
|
/* @__PURE__ */ e.jsx("div", {}),
|
|
4935
4922
|
/* @__PURE__ */ e.jsx("div", {})
|
|
4936
4923
|
] });
|
|
4937
4924
|
}
|
|
4938
|
-
const
|
|
4925
|
+
const Kl = [
|
|
4939
4926
|
{
|
|
4940
4927
|
label: "Mercator",
|
|
4941
4928
|
value: "mercator"
|
|
@@ -4992,7 +4979,7 @@ const Gl = [
|
|
|
4992
4979
|
label: "Natural Earth 1",
|
|
4993
4980
|
value: "naturalEarth1"
|
|
4994
4981
|
}
|
|
4995
|
-
],
|
|
4982
|
+
], Ql = [
|
|
4996
4983
|
"blues",
|
|
4997
4984
|
"brBG",
|
|
4998
4985
|
"buGn",
|
|
@@ -5031,15 +5018,15 @@ const Gl = [
|
|
|
5031
5018
|
"ylGnBu",
|
|
5032
5019
|
"ylOrBr",
|
|
5033
5020
|
"ylOrRd"
|
|
5034
|
-
],
|
|
5021
|
+
], Jl = Ql.map((s) => ({
|
|
5035
5022
|
label: s,
|
|
5036
5023
|
value: s
|
|
5037
5024
|
}));
|
|
5038
|
-
function
|
|
5039
|
-
var
|
|
5040
|
-
const s = u((p) => p.card), t = (x = (
|
|
5025
|
+
function Wl() {
|
|
5026
|
+
var i, x, d, y, f, m, g, j, T, C, M, I, V, N, w, L, h, v;
|
|
5027
|
+
const s = u((p) => p.card), t = (x = (i = s == null ? void 0 : s.preferences) == null ? void 0 : i.mapVisualOptions) == null ? void 0 : x.topoJsonUrl, [a, n] = R(
|
|
5041
5028
|
((y = (d = s == null ? void 0 : s.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : y.customTopoJsonUrl) || ""
|
|
5042
|
-
), { setCardPreferences: l } = ce(), { data:
|
|
5029
|
+
), { setCardPreferences: l } = ce(), { data: o } = Bs(s), r = Object.keys((o == null ? void 0 : o.objects) || {}).map((p) => ({
|
|
5043
5030
|
label: p,
|
|
5044
5031
|
value: p
|
|
5045
5032
|
})) || [], c = [
|
|
@@ -5099,7 +5086,7 @@ function Jl() {
|
|
|
5099
5086
|
placeholder: "Custom URL"
|
|
5100
5087
|
}
|
|
5101
5088
|
),
|
|
5102
|
-
|
|
5089
|
+
o && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
5103
5090
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
5104
5091
|
/* @__PURE__ */ e.jsx(H, { children: "Map Object" }),
|
|
5105
5092
|
/* @__PURE__ */ e.jsx(
|
|
@@ -5110,11 +5097,11 @@ function Jl() {
|
|
|
5110
5097
|
value: ((m = (f = s.preferences) == null ? void 0 : f.mapVisualOptions) == null ? void 0 : m.objectKey) || "",
|
|
5111
5098
|
label: "Map Object",
|
|
5112
5099
|
onValueChange: (p) => {
|
|
5113
|
-
var
|
|
5100
|
+
var O;
|
|
5114
5101
|
l({
|
|
5115
5102
|
...s.preferences,
|
|
5116
5103
|
mapVisualOptions: {
|
|
5117
|
-
...(
|
|
5104
|
+
...(O = s.preferences) == null ? void 0 : O.mapVisualOptions,
|
|
5118
5105
|
objectKey: p
|
|
5119
5106
|
}
|
|
5120
5107
|
});
|
|
@@ -5128,15 +5115,15 @@ function Jl() {
|
|
|
5128
5115
|
pe,
|
|
5129
5116
|
{
|
|
5130
5117
|
className: "h-9",
|
|
5131
|
-
options:
|
|
5118
|
+
options: Kl,
|
|
5132
5119
|
value: ((j = (g = s.preferences) == null ? void 0 : g.mapVisualOptions) == null ? void 0 : j.projection) || "",
|
|
5133
5120
|
label: "Projection",
|
|
5134
5121
|
onValueChange: (p) => {
|
|
5135
|
-
var
|
|
5122
|
+
var O;
|
|
5136
5123
|
l({
|
|
5137
5124
|
...s.preferences,
|
|
5138
5125
|
mapVisualOptions: {
|
|
5139
|
-
...(
|
|
5126
|
+
...(O = s.preferences) == null ? void 0 : O.mapVisualOptions,
|
|
5140
5127
|
projection: p
|
|
5141
5128
|
}
|
|
5142
5129
|
});
|
|
@@ -5150,15 +5137,15 @@ function Jl() {
|
|
|
5150
5137
|
pe,
|
|
5151
5138
|
{
|
|
5152
5139
|
className: "h-9",
|
|
5153
|
-
options:
|
|
5154
|
-
value: ((C = (
|
|
5140
|
+
options: Jl,
|
|
5141
|
+
value: ((C = (T = s.preferences) == null ? void 0 : T.mapVisualOptions) == null ? void 0 : C.colorScale) || "",
|
|
5155
5142
|
label: "Select Color Scale",
|
|
5156
5143
|
onValueChange: (p) => {
|
|
5157
|
-
var
|
|
5144
|
+
var O;
|
|
5158
5145
|
l({
|
|
5159
5146
|
...s.preferences,
|
|
5160
5147
|
mapVisualOptions: {
|
|
5161
|
-
...(
|
|
5148
|
+
...(O = s.preferences) == null ? void 0 : O.mapVisualOptions,
|
|
5162
5149
|
colorScale: p
|
|
5163
5150
|
}
|
|
5164
5151
|
});
|
|
@@ -5176,13 +5163,13 @@ function Jl() {
|
|
|
5176
5163
|
className: `h-9 w-full ${Ge}`,
|
|
5177
5164
|
type: "number",
|
|
5178
5165
|
step: 0.1,
|
|
5179
|
-
value: ((I = (
|
|
5166
|
+
value: ((I = (M = s.preferences) == null ? void 0 : M.mapVisualOptions) == null ? void 0 : I.projectionScale) || 1,
|
|
5180
5167
|
onChange: (p) => {
|
|
5181
|
-
var
|
|
5168
|
+
var O;
|
|
5182
5169
|
l({
|
|
5183
5170
|
...s.preferences,
|
|
5184
5171
|
mapVisualOptions: {
|
|
5185
|
-
...(
|
|
5172
|
+
...(O = s.preferences) == null ? void 0 : O.mapVisualOptions,
|
|
5186
5173
|
projectionScale: Number(p.target.value)
|
|
5187
5174
|
}
|
|
5188
5175
|
});
|
|
@@ -5196,16 +5183,16 @@ function Jl() {
|
|
|
5196
5183
|
className: `h-9 w-full ${Ge}`,
|
|
5197
5184
|
type: "number",
|
|
5198
5185
|
step: 10,
|
|
5199
|
-
value: ((
|
|
5186
|
+
value: ((w = (N = (V = s.preferences) == null ? void 0 : V.mapVisualOptions) == null ? void 0 : N.projectionOffset) == null ? void 0 : w[0]) || 0,
|
|
5200
5187
|
onChange: (p) => {
|
|
5201
|
-
var
|
|
5188
|
+
var O, E, $, B;
|
|
5202
5189
|
l({
|
|
5203
5190
|
...s.preferences,
|
|
5204
5191
|
mapVisualOptions: {
|
|
5205
|
-
...(
|
|
5192
|
+
...(O = s.preferences) == null ? void 0 : O.mapVisualOptions,
|
|
5206
5193
|
projectionOffset: [
|
|
5207
5194
|
Number(p.target.value),
|
|
5208
|
-
((B = ($ = (
|
|
5195
|
+
((B = ($ = (E = s.preferences) == null ? void 0 : E.mapVisualOptions) == null ? void 0 : $.projectionOffset) == null ? void 0 : B[1]) || 0
|
|
5209
5196
|
]
|
|
5210
5197
|
}
|
|
5211
5198
|
});
|
|
@@ -5219,15 +5206,15 @@ function Jl() {
|
|
|
5219
5206
|
className: `h-9 w-full ${Ge}`,
|
|
5220
5207
|
type: "number",
|
|
5221
5208
|
step: 10,
|
|
5222
|
-
value: ((v = (h = (
|
|
5209
|
+
value: ((v = (h = (L = s.preferences) == null ? void 0 : L.mapVisualOptions) == null ? void 0 : h.projectionOffset) == null ? void 0 : v[1]) || 0,
|
|
5223
5210
|
onChange: (p) => {
|
|
5224
|
-
var
|
|
5211
|
+
var O, E, $, B;
|
|
5225
5212
|
l({
|
|
5226
5213
|
...s.preferences,
|
|
5227
5214
|
mapVisualOptions: {
|
|
5228
|
-
...(
|
|
5215
|
+
...(O = s.preferences) == null ? void 0 : O.mapVisualOptions,
|
|
5229
5216
|
projectionOffset: [
|
|
5230
|
-
((B = ($ = (
|
|
5217
|
+
((B = ($ = (E = s.preferences) == null ? void 0 : E.mapVisualOptions) == null ? void 0 : $.projectionOffset) == null ? void 0 : B[0]) || 0,
|
|
5231
5218
|
Number(p.target.value)
|
|
5232
5219
|
]
|
|
5233
5220
|
}
|
|
@@ -5240,7 +5227,7 @@ function Jl() {
|
|
|
5240
5227
|
/* @__PURE__ */ e.jsx(Me, {})
|
|
5241
5228
|
] });
|
|
5242
5229
|
}
|
|
5243
|
-
function
|
|
5230
|
+
function Yl() {
|
|
5244
5231
|
var n;
|
|
5245
5232
|
const s = u((l) => l.card.preferences), { setCardPreferences: t } = u((l) => l.actions);
|
|
5246
5233
|
function a(l) {
|
|
@@ -5253,7 +5240,7 @@ function Wl() {
|
|
|
5253
5240
|
});
|
|
5254
5241
|
}
|
|
5255
5242
|
return /* @__PURE__ */ e.jsxs(
|
|
5256
|
-
|
|
5243
|
+
bs,
|
|
5257
5244
|
{
|
|
5258
5245
|
value: (n = s == null ? void 0 : s.textVisualOptions) != null && n.isDynamicText ? "dynamic" : "static",
|
|
5259
5246
|
onValueChange: a,
|
|
@@ -5305,9 +5292,9 @@ function ls({
|
|
|
5305
5292
|
/* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
|
|
5306
5293
|
/* @__PURE__ */ e.jsx(G, { children: "Settings" }),
|
|
5307
5294
|
/* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
|
|
5308
|
-
s === "range" && /* @__PURE__ */ e.jsx(
|
|
5295
|
+
s === "range" && /* @__PURE__ */ e.jsx(ys, {}),
|
|
5309
5296
|
s !== "text" && /* @__PURE__ */ e.jsx(Js, {}),
|
|
5310
|
-
s === "text" && /* @__PURE__ */ e.jsx(
|
|
5297
|
+
s === "text" && /* @__PURE__ */ e.jsx(Yl, {})
|
|
5311
5298
|
] })
|
|
5312
5299
|
] }),
|
|
5313
5300
|
!["range", "text"].includes(s) && /* @__PURE__ */ e.jsxs(U, { value: "item-3", children: [
|
|
@@ -5319,11 +5306,11 @@ function ls({
|
|
|
5319
5306
|
] })
|
|
5320
5307
|
] }) });
|
|
5321
5308
|
}
|
|
5322
|
-
function
|
|
5309
|
+
function Xl() {
|
|
5323
5310
|
const s = u(
|
|
5324
5311
|
(n) => {
|
|
5325
|
-
var l,
|
|
5326
|
-
return (
|
|
5312
|
+
var l, o;
|
|
5313
|
+
return (o = (l = n == null ? void 0 : n.card) == null ? void 0 : l.preferences) == null ? void 0 : o.sortChart;
|
|
5327
5314
|
}
|
|
5328
5315
|
), { setSortChart: t } = ce();
|
|
5329
5316
|
function a() {
|
|
@@ -5385,7 +5372,7 @@ function Yl() {
|
|
|
5385
5372
|
/* @__PURE__ */ e.jsxs(U, { value: "item-2", children: [
|
|
5386
5373
|
/* @__PURE__ */ e.jsx(G, { children: "Settings" }),
|
|
5387
5374
|
/* @__PURE__ */ e.jsxs(K, { className: "space-y-4 px-2", children: [
|
|
5388
|
-
/* @__PURE__ */ e.jsx(
|
|
5375
|
+
/* @__PURE__ */ e.jsx(ys, {}),
|
|
5389
5376
|
a(),
|
|
5390
5377
|
/* @__PURE__ */ e.jsx(st, {})
|
|
5391
5378
|
] })
|
|
@@ -5399,7 +5386,7 @@ function Yl() {
|
|
|
5399
5386
|
] })
|
|
5400
5387
|
] }) });
|
|
5401
5388
|
}
|
|
5402
|
-
function
|
|
5389
|
+
function Zl({}) {
|
|
5403
5390
|
const s = u((n) => {
|
|
5404
5391
|
var l;
|
|
5405
5392
|
return (l = n.card) == null ? void 0 : l.preferences;
|
|
@@ -5420,7 +5407,7 @@ function Xl({}) {
|
|
|
5420
5407
|
] })
|
|
5421
5408
|
] }) }),
|
|
5422
5409
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
5423
|
-
/* @__PURE__ */ e.jsx(
|
|
5410
|
+
/* @__PURE__ */ e.jsx(xs, { onCheckedChange: a, id: "allow-download" }),
|
|
5424
5411
|
/* @__PURE__ */ e.jsx(
|
|
5425
5412
|
"label",
|
|
5426
5413
|
{
|
|
@@ -5432,7 +5419,7 @@ function Xl({}) {
|
|
|
5432
5419
|
] })
|
|
5433
5420
|
] });
|
|
5434
5421
|
}
|
|
5435
|
-
const
|
|
5422
|
+
const er = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5436
5423
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT dimension, cohort, metric FROM table" }),
|
|
5437
5424
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
5438
5425
|
"See ",
|
|
@@ -5448,7 +5435,7 @@ const Zl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
5448
5435
|
),
|
|
5449
5436
|
" in the docs."
|
|
5450
5437
|
] })
|
|
5451
|
-
] }),
|
|
5438
|
+
] }), sr = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5452
5439
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT y-axis, label, range-from, range-to, range-value FROM table" }),
|
|
5453
5440
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
5454
5441
|
"See ",
|
|
@@ -5464,7 +5451,7 @@ const Zl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
5464
5451
|
),
|
|
5465
5452
|
" in the docs."
|
|
5466
5453
|
] })
|
|
5467
|
-
] }),
|
|
5454
|
+
] }), ar = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
|
|
5468
5455
|
/* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT text FROM table limit 1" }),
|
|
5469
5456
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
5470
5457
|
"See ",
|
|
@@ -5481,22 +5468,22 @@ const Zl = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
|
|
|
5481
5468
|
" in the docs."
|
|
5482
5469
|
] })
|
|
5483
5470
|
] });
|
|
5484
|
-
function
|
|
5471
|
+
function tr() {
|
|
5485
5472
|
const s = u((a) => a.card.type);
|
|
5486
5473
|
function t(a) {
|
|
5487
5474
|
switch (a) {
|
|
5488
5475
|
case "stackedBar":
|
|
5489
5476
|
case "stackedLine":
|
|
5490
|
-
return /* @__PURE__ */ e.jsx(
|
|
5477
|
+
return /* @__PURE__ */ e.jsx(Xl, {});
|
|
5491
5478
|
case "pyramid":
|
|
5492
|
-
return /* @__PURE__ */ e.jsx(ls, { docContent:
|
|
5479
|
+
return /* @__PURE__ */ e.jsx(ls, { docContent: er, cardType: a });
|
|
5493
5480
|
case "kpi":
|
|
5494
|
-
return /* @__PURE__ */ e.jsx(
|
|
5481
|
+
return /* @__PURE__ */ e.jsx(Gl, {});
|
|
5495
5482
|
case "line":
|
|
5496
5483
|
case "bar":
|
|
5497
|
-
return /* @__PURE__ */ e.jsx(
|
|
5484
|
+
return /* @__PURE__ */ e.jsx(Rl, { cardType: a });
|
|
5498
5485
|
case "range":
|
|
5499
|
-
return /* @__PURE__ */ e.jsx(ls, { docContent:
|
|
5486
|
+
return /* @__PURE__ */ e.jsx(ls, { docContent: sr, cardType: a });
|
|
5500
5487
|
case "pie":
|
|
5501
5488
|
case "doughnut":
|
|
5502
5489
|
case "polarArea":
|
|
@@ -5504,32 +5491,32 @@ function ar() {
|
|
|
5504
5491
|
return /* @__PURE__ */ e.jsx(ls, { cardType: a });
|
|
5505
5492
|
case "bubble":
|
|
5506
5493
|
case "scatter":
|
|
5507
|
-
return /* @__PURE__ */ e.jsx(
|
|
5494
|
+
return /* @__PURE__ */ e.jsx(_l, { cardType: a });
|
|
5508
5495
|
case "table":
|
|
5509
|
-
return /* @__PURE__ */ e.jsx(
|
|
5496
|
+
return /* @__PURE__ */ e.jsx(Zl, { cardType: a });
|
|
5510
5497
|
case "text":
|
|
5511
5498
|
return /* @__PURE__ */ e.jsx(
|
|
5512
5499
|
ls,
|
|
5513
5500
|
{
|
|
5514
|
-
docContent:
|
|
5501
|
+
docContent: ar,
|
|
5515
5502
|
cardType: a,
|
|
5516
5503
|
suffix: "Visual"
|
|
5517
5504
|
}
|
|
5518
5505
|
);
|
|
5519
5506
|
case "map":
|
|
5520
|
-
return /* @__PURE__ */ e.jsx(
|
|
5507
|
+
return /* @__PURE__ */ e.jsx(Wl, {});
|
|
5521
5508
|
case "custom":
|
|
5522
|
-
return /* @__PURE__ */ e.jsx(
|
|
5509
|
+
return /* @__PURE__ */ e.jsx(El, {});
|
|
5523
5510
|
default:
|
|
5524
|
-
return /* @__PURE__ */ e.jsx(
|
|
5511
|
+
return /* @__PURE__ */ e.jsx(Pl, {});
|
|
5525
5512
|
}
|
|
5526
5513
|
}
|
|
5527
|
-
return /* @__PURE__ */ e.jsx(
|
|
5514
|
+
return /* @__PURE__ */ e.jsx(ms, { className: "h-full w-full text-sm", children: t(s) });
|
|
5528
5515
|
}
|
|
5529
|
-
function
|
|
5516
|
+
function nr() {
|
|
5530
5517
|
const s = u((t) => t.isShowingVisual);
|
|
5531
5518
|
return /* @__PURE__ */ e.jsxs(
|
|
5532
|
-
|
|
5519
|
+
ks,
|
|
5533
5520
|
{
|
|
5534
5521
|
direction: "vertical",
|
|
5535
5522
|
className: "min-h-[250px] min-w-full max-w-lg",
|
|
@@ -5541,10 +5528,10 @@ function tr() {
|
|
|
5541
5528
|
className: "flex",
|
|
5542
5529
|
minSize: 20,
|
|
5543
5530
|
defaultSize: 40,
|
|
5544
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5531
|
+
children: /* @__PURE__ */ e.jsx(Nl, {})
|
|
5545
5532
|
}
|
|
5546
5533
|
),
|
|
5547
|
-
/* @__PURE__ */ e.jsx(
|
|
5534
|
+
/* @__PURE__ */ e.jsx(Os, { withHandle: !0, className: "border" }),
|
|
5548
5535
|
/* @__PURE__ */ e.jsx(
|
|
5549
5536
|
Ve,
|
|
5550
5537
|
{
|
|
@@ -5552,7 +5539,7 @@ function tr() {
|
|
|
5552
5539
|
role: "visual-section",
|
|
5553
5540
|
minSize: 0,
|
|
5554
5541
|
defaultSize: 60,
|
|
5555
|
-
children: s ? /* @__PURE__ */ e.jsxs(
|
|
5542
|
+
children: s ? /* @__PURE__ */ e.jsxs(ks, { direction: "horizontal", children: [
|
|
5556
5543
|
/* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
5557
5544
|
Ve,
|
|
5558
5545
|
{
|
|
@@ -5560,10 +5547,10 @@ function tr() {
|
|
|
5560
5547
|
minSize: 20,
|
|
5561
5548
|
defaultSize: 25,
|
|
5562
5549
|
maxSize: 30,
|
|
5563
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5550
|
+
children: /* @__PURE__ */ e.jsx(tr, {})
|
|
5564
5551
|
}
|
|
5565
5552
|
) }),
|
|
5566
|
-
/* @__PURE__ */ e.jsx(
|
|
5553
|
+
/* @__PURE__ */ e.jsx(Os, { className: "border" }),
|
|
5567
5554
|
/* @__PURE__ */ e.jsx(Ve, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(ra, {}) })
|
|
5568
5555
|
] }) : /* @__PURE__ */ e.jsx(ra, {})
|
|
5569
5556
|
}
|
|
@@ -5572,15 +5559,15 @@ function tr() {
|
|
|
5572
5559
|
}
|
|
5573
5560
|
);
|
|
5574
5561
|
}
|
|
5575
|
-
function
|
|
5562
|
+
function lr({ authToken: s, onSave: t, onClose: a }) {
|
|
5576
5563
|
z((r) => r.themeStyle);
|
|
5577
|
-
const n = u((r) => r.actions.setOnSave), l = u((r) => r.actions.setOnClose),
|
|
5564
|
+
const n = u((r) => r.actions.setOnSave), l = u((r) => r.actions.setOnClose), o = z((r) => r.actions.setAuthToken);
|
|
5578
5565
|
return Z(() => {
|
|
5579
5566
|
t && n(t), a && l(a);
|
|
5580
5567
|
}, [t, n, a, l]), Z(() => {
|
|
5581
|
-
s && s.accessToken &&
|
|
5582
|
-
}, [s,
|
|
5583
|
-
|
|
5568
|
+
s && s.accessToken && o(s);
|
|
5569
|
+
}, [s, o]), /* @__PURE__ */ e.jsx(ps, { FallbackComponent: Fa, children: /* @__PURE__ */ e.jsxs(
|
|
5570
|
+
gn,
|
|
5584
5571
|
{
|
|
5585
5572
|
style: {
|
|
5586
5573
|
// borderRadius: currentStyle?.chart?.options?.borderRadius,
|
|
@@ -5589,19 +5576,19 @@ function nr({ authToken: s, onSave: t, onClose: a }) {
|
|
|
5589
5576
|
className: "rounded-none",
|
|
5590
5577
|
role: "editor-panel",
|
|
5591
5578
|
children: [
|
|
5592
|
-
/* @__PURE__ */ e.jsx(
|
|
5593
|
-
/* @__PURE__ */ e.jsx(
|
|
5579
|
+
/* @__PURE__ */ e.jsx(jn, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(_a, {}) }),
|
|
5580
|
+
/* @__PURE__ */ e.jsx(bn, { children: /* @__PURE__ */ e.jsx(nr, {}) })
|
|
5594
5581
|
]
|
|
5595
5582
|
}
|
|
5596
5583
|
) });
|
|
5597
5584
|
}
|
|
5598
|
-
function
|
|
5585
|
+
function rr() {
|
|
5599
5586
|
z((r) => r.selectedCardId);
|
|
5600
5587
|
const s = z((r) => r.selectedSheetId), { setIsVisualEditing: t } = z((r) => r.actions), a = z((r) => r.isVisualEditing), n = z((r) => r.actions.updateFrame);
|
|
5601
5588
|
function l(r) {
|
|
5602
5589
|
s && (n(s, r), t(!1));
|
|
5603
5590
|
}
|
|
5604
|
-
function
|
|
5591
|
+
function o() {
|
|
5605
5592
|
t(!1);
|
|
5606
5593
|
}
|
|
5607
5594
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -5611,11 +5598,11 @@ function lr() {
|
|
|
5611
5598
|
className: W("flex grow", {
|
|
5612
5599
|
"max-h-0 overflow-hidden": !a
|
|
5613
5600
|
}),
|
|
5614
|
-
children: /* @__PURE__ */ e.jsx(
|
|
5601
|
+
children: /* @__PURE__ */ e.jsx(lr, { onSave: l, onClose: o })
|
|
5615
5602
|
}
|
|
5616
5603
|
);
|
|
5617
5604
|
}
|
|
5618
|
-
function
|
|
5605
|
+
function ir() {
|
|
5619
5606
|
u((r) => r.selectedConnectionId), u((r) => r.selectedDatamodelId);
|
|
5620
5607
|
const s = u((r) => r.selectedDatabaseName);
|
|
5621
5608
|
u((r) => r.selectedSchemaName);
|
|
@@ -5623,15 +5610,15 @@ function rr() {
|
|
|
5623
5610
|
z((r) => r.actions.addFilter), z((r) => r.actions.removeFilter), z(
|
|
5624
5611
|
(r) => r.actions.removeFilterValue
|
|
5625
5612
|
);
|
|
5626
|
-
const { modelItems: n, columns: l } = Re(), { assignFilter:
|
|
5613
|
+
const { modelItems: n, columns: l } = Re(), { assignFilter: o } = at();
|
|
5627
5614
|
return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: l == null ? void 0 : l.map((r) => {
|
|
5628
5615
|
const c = a == null ? void 0 : a.find(
|
|
5629
|
-
(
|
|
5616
|
+
(i) => i.column === xe(r.column_name) && i.table === t && i.database === s
|
|
5630
5617
|
);
|
|
5631
5618
|
return /* @__PURE__ */ e.jsx(
|
|
5632
5619
|
"div",
|
|
5633
5620
|
{
|
|
5634
|
-
onClick: () =>
|
|
5621
|
+
onClick: () => o(r),
|
|
5635
5622
|
className: W(
|
|
5636
5623
|
"group flex cursor-pointer items-center justify-between border border-dashed border-background px-3 py-[6px] text-sm transition-colors hover:bg-muted/50",
|
|
5637
5624
|
{
|
|
@@ -5647,7 +5634,7 @@ function rr() {
|
|
|
5647
5634
|
);
|
|
5648
5635
|
}) });
|
|
5649
5636
|
}
|
|
5650
|
-
function
|
|
5637
|
+
function or() {
|
|
5651
5638
|
z((t) => t.showFilters);
|
|
5652
5639
|
const s = z(
|
|
5653
5640
|
(t) => t.actions.setShowFilters
|
|
@@ -5671,7 +5658,7 @@ function ir() {
|
|
|
5671
5658
|
ColumnsComponent: () => (
|
|
5672
5659
|
// schemaName, tableName, columns
|
|
5673
5660
|
/* @__PURE__ */ e.jsx(
|
|
5674
|
-
|
|
5661
|
+
ir,
|
|
5675
5662
|
{}
|
|
5676
5663
|
)
|
|
5677
5664
|
)
|
|
@@ -5679,7 +5666,7 @@ function ir() {
|
|
|
5679
5666
|
) })
|
|
5680
5667
|
] });
|
|
5681
5668
|
}
|
|
5682
|
-
function
|
|
5669
|
+
function cr() {
|
|
5683
5670
|
const s = z((a) => a.showFilters), t = z((a) => a.isVisualEditing);
|
|
5684
5671
|
return /* @__PURE__ */ e.jsxs(
|
|
5685
5672
|
"div",
|
|
@@ -5690,13 +5677,13 @@ function or() {
|
|
|
5690
5677
|
"flex grow": !t
|
|
5691
5678
|
}),
|
|
5692
5679
|
children: [
|
|
5693
|
-
/* @__PURE__ */ e.jsx(
|
|
5694
|
-
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(
|
|
5680
|
+
/* @__PURE__ */ e.jsx(yn, {}),
|
|
5681
|
+
s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(or, {}) })
|
|
5695
5682
|
]
|
|
5696
5683
|
}
|
|
5697
5684
|
);
|
|
5698
5685
|
}
|
|
5699
|
-
function
|
|
5686
|
+
function dr() {
|
|
5700
5687
|
const s = z((n) => n.dashboard), t = z((n) => n.actions.setDashboard), a = z(
|
|
5701
5688
|
(n) => n.showDashboardJSON
|
|
5702
5689
|
);
|
|
@@ -5709,7 +5696,7 @@ function cr() {
|
|
|
5709
5696
|
hidden: !a
|
|
5710
5697
|
}),
|
|
5711
5698
|
children: /* @__PURE__ */ e.jsx(
|
|
5712
|
-
|
|
5699
|
+
vn,
|
|
5713
5700
|
{
|
|
5714
5701
|
onChange: (n) => {
|
|
5715
5702
|
if (n)
|
|
@@ -5740,65 +5727,65 @@ function cr() {
|
|
|
5740
5727
|
}
|
|
5741
5728
|
);
|
|
5742
5729
|
}
|
|
5743
|
-
function
|
|
5730
|
+
function xr({
|
|
5744
5731
|
showControls: s = !1,
|
|
5745
5732
|
showFooter: t = !0,
|
|
5746
5733
|
...a
|
|
5747
5734
|
}) {
|
|
5748
|
-
return /* @__PURE__ */ e.jsx(
|
|
5749
|
-
/* @__PURE__ */ e.jsx(
|
|
5750
|
-
/* @__PURE__ */ e.jsxs(
|
|
5751
|
-
/* @__PURE__ */ e.jsx(
|
|
5752
|
-
/* @__PURE__ */ e.jsxs(
|
|
5753
|
-
s && /* @__PURE__ */ e.jsx(
|
|
5754
|
-
/* @__PURE__ */ e.jsx(
|
|
5755
|
-
/* @__PURE__ */ e.jsx(
|
|
5735
|
+
return /* @__PURE__ */ e.jsx(ps, { FallbackComponent: Fa, children: /* @__PURE__ */ e.jsxs(Cn, { dashboardProps: a, children: [
|
|
5736
|
+
/* @__PURE__ */ e.jsx(Nn, {}),
|
|
5737
|
+
/* @__PURE__ */ e.jsxs(Sn, { children: [
|
|
5738
|
+
/* @__PURE__ */ e.jsx(dr, {}),
|
|
5739
|
+
/* @__PURE__ */ e.jsxs(wn, { ...a, children: [
|
|
5740
|
+
s && /* @__PURE__ */ e.jsx(ll, {}),
|
|
5741
|
+
/* @__PURE__ */ e.jsx(rr, {}),
|
|
5742
|
+
/* @__PURE__ */ e.jsx(cr, {})
|
|
5756
5743
|
] })
|
|
5757
5744
|
] })
|
|
5758
5745
|
] }) });
|
|
5759
5746
|
}
|
|
5760
5747
|
export {
|
|
5761
5748
|
Ue as A,
|
|
5762
|
-
|
|
5749
|
+
On as B,
|
|
5763
5750
|
zn as C,
|
|
5764
|
-
|
|
5751
|
+
xr as D,
|
|
5765
5752
|
Ma as E,
|
|
5766
5753
|
qa as F,
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5754
|
+
En as G,
|
|
5755
|
+
An as H,
|
|
5756
|
+
Zn as I,
|
|
5770
5757
|
La as K,
|
|
5771
|
-
|
|
5758
|
+
Rn as L,
|
|
5772
5759
|
Ea as M,
|
|
5773
|
-
|
|
5760
|
+
Pn as N,
|
|
5774
5761
|
Aa as P,
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5762
|
+
Gn as S,
|
|
5763
|
+
Wn as T,
|
|
5764
|
+
Xn as U,
|
|
5778
5765
|
Gs as a,
|
|
5779
5766
|
Ks as b,
|
|
5780
5767
|
Ia as c,
|
|
5781
5768
|
Ta as d,
|
|
5782
5769
|
Da as e,
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5770
|
+
Fn as f,
|
|
5771
|
+
In as g,
|
|
5772
|
+
Tn as h,
|
|
5773
|
+
Dn as i,
|
|
5774
|
+
Ln as j,
|
|
5775
|
+
Mn as k,
|
|
5776
|
+
Vn as l,
|
|
5777
|
+
qn as m,
|
|
5778
|
+
_n as n,
|
|
5779
|
+
Hn as o,
|
|
5793
5780
|
Ze as p,
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5781
|
+
$n as q,
|
|
5782
|
+
Bn as r,
|
|
5783
|
+
Un as s,
|
|
5797
5784
|
Va as t,
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5785
|
+
Kn as u,
|
|
5786
|
+
Qn as v,
|
|
5787
|
+
Jn as w,
|
|
5788
|
+
Yn as x,
|
|
5802
5789
|
Qs as y,
|
|
5803
5790
|
Re as z
|
|
5804
5791
|
};
|