react-semaphor 0.1.457 → 0.1.459

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.
Files changed (34) hide show
  1. package/dist/brand-studio/index.cjs +1 -1
  2. package/dist/brand-studio/index.js +1 -1
  3. package/dist/chunks/{dashboard-briefing-launcher-DujsUIww.js → dashboard-briefing-launcher-ClCj98sq.js} +3 -3
  4. package/dist/chunks/{dashboard-briefing-launcher-W5sKgsYF.cjs → dashboard-briefing-launcher-DHtEouuH.cjs} +1 -1
  5. package/dist/chunks/{dashboard-controls-DZ5SgVcR.js → dashboard-controls-B8gsKlxc.js} +4 -4
  6. package/dist/chunks/{dashboard-controls-Cbw_M-lb.cjs → dashboard-controls-VRShl9J0.cjs} +1 -1
  7. package/dist/chunks/{dashboard-json-D9V7Vsvn.cjs → dashboard-json-BhvPMpZA.cjs} +1 -1
  8. package/dist/chunks/{dashboard-json-CHfML8Ff.js → dashboard-json-i_Auue_K.js} +2 -2
  9. package/dist/chunks/{edit-dashboard-visual-CLqJGsMx.js → edit-dashboard-visual-B3JF0fe4.js} +646 -640
  10. package/dist/chunks/{edit-dashboard-visual-BLmOGhEP.cjs → edit-dashboard-visual-DWWyT55u.cjs} +10 -10
  11. package/dist/chunks/{editor-action-buttons-C87bPAfR.cjs → editor-action-buttons-BTlCsP63.cjs} +1 -1
  12. package/dist/chunks/{editor-action-buttons-BVN1okyo.js → editor-action-buttons-C9x3nGnb.js} +2 -2
  13. package/dist/chunks/{index--A6SZu3V.js → index-BS2-ZZGf.js} +3833 -3798
  14. package/dist/chunks/{index-BFar58xY.cjs → index-DHF-2AqS.cjs} +3 -3
  15. package/dist/chunks/{report-preferences-dialog-DQtQZ3fF.js → report-preferences-dialog-BDpkcUtz.js} +2 -2
  16. package/dist/chunks/{report-preferences-dialog-DajdnPvA.cjs → report-preferences-dialog-BK0yAJnQ.cjs} +1 -1
  17. package/dist/chunks/{switch-BOBLNHUj.js → switch-DQR-Va05.js} +457 -439
  18. package/dist/chunks/{switch-BHOdIXq3.cjs → switch-f3TuZNLr.cjs} +16 -16
  19. package/dist/dashboard/index.cjs +1 -1
  20. package/dist/dashboard/index.js +1 -1
  21. package/dist/data-app-builder/index.cjs +1 -1
  22. package/dist/data-app-builder/index.js +2 -2
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +6 -6
  25. package/dist/surfboard/index.cjs +1 -1
  26. package/dist/surfboard/index.js +2 -2
  27. package/dist/types/briefings.d.ts +2 -0
  28. package/dist/types/dashboard-authoring.d.ts +2 -0
  29. package/dist/types/dashboard.d.ts +2 -0
  30. package/dist/types/main.d.ts +2 -0
  31. package/dist/types/shared.d.ts +2 -0
  32. package/dist/types/surfboard.d.ts +2 -0
  33. package/dist/types/types.d.ts +2 -0
  34. package/package.json +1 -1
@@ -1,15 +1,15 @@
1
1
  import { jsx as e, jsxs as n, Fragment as we } from "react/jsx-runtime";
2
2
  import * as nd from "react";
3
3
  import an, { useState as K, useEffect as Te, useRef as Ae, useCallback as Ee, useMemo as ce, useId as Bi, useContext as yr, Suspense as ad } from "react";
4
- import { cZ as Yi, aH as wn, aI as Sn, aJ as Tn, aK as kn, aL as _n, aF as us, bj as Lt, bk as Wt, c_ as _i, c$ as ls, aG as rt, d0 as $i, d1 as is, b4 as Aa, aZ as vt, cf as Nr, b2 as ra, bl as la, bi as Bt, d2 as ms, d3 as zi, d4 as sd, d5 as rd, d6 as ji, d7 as ld, d8 as id, d9 as od, da as cd, db as ir, dc as os, az as Gn, n as qi, dd, de as ud, df as Ki, dg as Ui, dh as Gi, di as md, dj as hd, dk as pd, dl as fd, cN as Cr, b1 as Hi, b8 as Qi, dm as In, dn as or, dp as gd, c7 as Da, dq as Wi, dr as Yl, ds as _l, bf as Zn, aN as dn, aO as bt, dt as xd, du as Ji, dv as Xi, bX as st, dw as qt, dx as bd, dy as Zi, dz as vd, dA as eo, dB as yd, dC as Nd, dD as Cd, aD as to, dE as wd, dF as Sd, dG as Td, dH as kd, dI as Dd, dJ as Md, dK as Bs, dL as Id, dM as $l, dN as Ed, dO as zl, dP as Ad, bh as Ot, cc as ia, cd as oa, ce as ca, dQ as no, bI as wr, aM as Sr, dR as ao, dS as Tr, dT as Od, dU as Fd, dV as kr, dW as Rd, dX as Pd, dY as so, dZ as ro, d_ as lo, d$ as tn, e0 as Ld, e1 as Vd, e2 as Bd, e3 as Yd, e4 as io, e5 as oo, H as co, e6 as Dr, e7 as _d, e8 as $d, e9 as zd, ea as Oa, M as jd, eb as qd, ec as Kd, ed as jl, ee as Ud, E as ys, e as Mr, ef as Gd, eg as Ir, bA as Hd, eh as ql, I as ft, ei as Qd, ej as Wd, ek as uo, el as mo, em as Jd, en as Er, eo as Ar, ep as Kl, eq as Ua, er as Xd, es as Zd, et as eu, eu as tu, ev as nu, ew as hs, ex as au, ey as su, ez as ho, eA as po, eB as ru, eC as lu, cq as iu, eD as ou, eE as fo, eF as cu, eG as du, cr as Ns, eH as Cs, bB as Vn, bC as $t, eI as Or, eJ as $n, eK as zn, eL as Dn, eM as aa, eN as uu, eO as mu, eP as hu, eQ as pu, eR as fu, eS as gu, eT as Ul, bp as sn, bq as rn, br as ln, eU as xu, eV as go, eW as bu, eX as vu, eY as xo, eZ as yu, e_ as Nu, e$ as Cu, f0 as wu, f1 as Ys, f2 as Su, f3 as Tu, f4 as ws, f5 as bo, f6 as ku, f7 as Du, f8 as Mu, f9 as Iu, fa as Eu, fb as Au, fc as Ou, fd as Fu, fe as Ru, ff as cr, fg as Pu, fh as Lu, fi as Gl, b3 as dr, a$ as Mn, aP as Vu, aQ as Bu, aS as Yu, aT as _u, aU as $u, aV as zu, aW as ju, aX as qu, aY as Ku, bZ as Uu, fj as Gu, fk as Hu, fl as Fa, fm as Ra, fn as Pa, cG as jn, ch as Fr, ci as Qu, cj as vo, ck as yo, cl as No, bD as Wu, bE as Ju, fo as Xu, fp as Ss, fq as ct, fr as dt, fs as ut, ft as Zu, fu as em, fv as Co, fw as wo, fx as So, fy as To, fz as tm, fA as nm, fB as ur, fC as am, fD as sm, fE as rm, fF as lm, fG as im, fH as om, fI as cm, fJ as dm, fK as um, fL as mm, fM as hm, fN as pm, fO as Pn, fP as Sa, fQ as fm, fR as Hl, fS as gm, fT as xm, fU as _s, fV as Ql, fW as bm, fX as vm, fY as ym, fZ as Nm, f_ as Cm, aB as Rr, aC as La, f$ as $s, g0 as ko, b6 as wm, g1 as ps, g2 as Sm, g3 as Do, g4 as Mo, g5 as Tm, g6 as km, V as Dm, g7 as ns, g8 as Mm, g9 as Wl, ga as Im, gb as Em, gc as Jl, gd as Am, ge as Om, gf as Fm, gg as Rm, gh as Pm, aR as Io, gi as Lm, gj as Vm, gk as Bm, gl as Ym, gm as _m, gn as $m, go as zm, gp as jm, gq as qm, gr as Eo, gs as Km, gt as Um, gu as Ts, cH as ks, gv as Ao, gw as Gm, gx as Hm, gy as Oo, gz as Qm, gA as Wm, gB as Ds, gC as Jm, gD as Xm, gE as Zm, gF as eh, gG as th, gH as Xl, gI as sa, gJ as Fo, gK as nh, ct as ah, gL as Ro, gM as Po, gN as cs, gO as Lo, gP as Vo, gQ as Zl, gR as sh, gS as rh, gT as ds, gU as Pr, gV as lh, gW as fs, h as Va, i as Ba, k as Ya, j as _a, l as $a, m as za, gX as ih, gY as ja, gZ as yn, g_ as mr, g$ as hr, h0 as qa, h1 as Bo, h2 as oh, h3 as zs, h4 as js, h5 as ch, h6 as qs, h7 as dh, h8 as ei, h9 as ti, ha as uh, cP as mh, hb as hh, cQ as ph, cS as fh, cT as gh, u as xh, hc as bh, hd as vh, he as yh, hf as Nh, bW as Ms, hg as Is, hh as ni, hi as Yo, cJ as Ks, hj as Ch, hk as wh, hl as Sh, F as Th, bx as kh, hm as Dh, hn as Mh } from "./index--A6SZu3V.js";
4
+ import { cZ as Yi, aH as wn, aI as Sn, aJ as Tn, aK as kn, aL as _n, aF as us, bj as Lt, bk as Wt, c_ as _i, c$ as ls, aG as rt, d0 as $i, d1 as is, b4 as Aa, aZ as vt, cf as Nr, b2 as ra, bl as la, bi as Bt, d2 as ms, d3 as zi, d4 as sd, d5 as rd, d6 as ji, d7 as ld, d8 as id, d9 as od, da as cd, db as ir, dc as os, az as Gn, n as qi, dd, de as ud, df as Ki, dg as Ui, dh as Gi, di as md, dj as hd, dk as pd, dl as fd, cN as Cr, b1 as Hi, b8 as Qi, dm as In, dn as or, dp as gd, c7 as Da, dq as Wi, dr as Yl, ds as _l, bf as Zn, aN as dn, aO as bt, dt as xd, du as Ji, dv as Xi, bX as st, dw as qt, dx as bd, dy as Zi, dz as vd, dA as eo, dB as yd, dC as Nd, dD as Cd, aD as to, dE as wd, dF as Sd, dG as Td, dH as kd, dI as Dd, dJ as Md, dK as Bs, dL as Id, dM as $l, dN as Ed, dO as zl, dP as Ad, bh as Ot, cc as ia, cd as oa, ce as ca, dQ as no, bI as wr, aM as Sr, dR as ao, dS as Tr, dT as Od, dU as Fd, dV as kr, dW as Rd, dX as Pd, dY as so, dZ as ro, d_ as lo, d$ as tn, e0 as Ld, e1 as Vd, e2 as Bd, e3 as Yd, e4 as io, e5 as oo, H as co, e6 as Dr, e7 as _d, e8 as $d, e9 as zd, ea as Oa, M as jd, eb as qd, ec as Kd, ed as jl, ee as Ud, E as ys, e as Mr, ef as Gd, eg as Ir, bA as Hd, eh as ql, I as ft, ei as Qd, ej as Wd, ek as uo, el as mo, em as Jd, en as Er, eo as Ar, ep as Kl, eq as Ua, er as Xd, es as Zd, et as eu, eu as tu, ev as nu, ew as hs, ex as au, ey as su, ez as ho, eA as po, eB as ru, eC as lu, cq as iu, eD as ou, eE as fo, eF as cu, eG as du, cr as Ns, eH as Cs, bB as Vn, bC as $t, eI as Or, eJ as $n, eK as zn, eL as Dn, eM as aa, eN as uu, eO as mu, eP as hu, eQ as pu, eR as fu, eS as gu, eT as Ul, bp as sn, bq as rn, br as ln, eU as xu, eV as go, eW as bu, eX as vu, eY as xo, eZ as yu, e_ as Nu, e$ as Cu, f0 as wu, f1 as Ys, f2 as Su, f3 as Tu, f4 as ws, f5 as bo, f6 as ku, f7 as Du, f8 as Mu, f9 as Iu, fa as Eu, fb as Au, fc as Ou, fd as Fu, fe as Ru, ff as cr, fg as Pu, fh as Lu, fi as Gl, b3 as dr, a$ as Mn, aP as Vu, aQ as Bu, aS as Yu, aT as _u, aU as $u, aV as zu, aW as ju, aX as qu, aY as Ku, bZ as Uu, fj as Gu, fk as Hu, fl as Fa, fm as Ra, fn as Pa, cG as jn, ch as Fr, ci as Qu, cj as vo, ck as yo, cl as No, bD as Wu, bE as Ju, fo as Xu, fp as Ss, fq as ct, fr as dt, fs as ut, ft as Zu, fu as em, fv as Co, fw as wo, fx as So, fy as To, fz as tm, fA as nm, fB as ur, fC as am, fD as sm, fE as rm, fF as lm, fG as im, fH as om, fI as cm, fJ as dm, fK as um, fL as mm, fM as hm, fN as pm, fO as Pn, fP as Sa, fQ as fm, fR as Hl, fS as gm, fT as xm, fU as _s, fV as Ql, fW as bm, fX as vm, fY as ym, fZ as Nm, f_ as Cm, aB as Rr, aC as La, f$ as $s, g0 as ko, b6 as wm, g1 as ps, g2 as Sm, g3 as Do, g4 as Mo, g5 as Tm, g6 as km, V as Dm, g7 as ns, g8 as Mm, g9 as Wl, ga as Im, gb as Em, gc as Jl, gd as Am, ge as Om, gf as Fm, gg as Rm, gh as Pm, aR as Io, gi as Lm, gj as Vm, gk as Bm, gl as Ym, gm as _m, gn as $m, go as zm, gp as jm, gq as qm, gr as Eo, gs as Km, gt as Um, gu as Ts, cH as ks, gv as Ao, gw as Gm, gx as Hm, gy as Oo, gz as Qm, gA as Wm, gB as Ds, gC as Jm, gD as Xm, gE as Zm, gF as eh, gG as th, gH as Xl, gI as sa, gJ as Fo, gK as nh, ct as ah, gL as Ro, gM as Po, gN as cs, gO as Lo, gP as Vo, gQ as Zl, gR as sh, gS as rh, gT as ds, gU as Pr, gV as lh, gW as fs, h as Va, i as Ba, k as Ya, j as _a, l as $a, m as za, gX as ih, gY as ja, gZ as yn, g_ as mr, g$ as hr, h0 as qa, h1 as Bo, h2 as oh, h3 as zs, h4 as js, h5 as ch, h6 as qs, h7 as dh, h8 as ei, h9 as ti, ha as uh, cP as mh, hb as hh, cQ as ph, cS as fh, cT as gh, u as xh, hc as bh, hd as vh, he as yh, hf as Nh, bW as Ms, hg as Is, hh as ni, hi as Yo, cJ as Ks, hj as Ch, hk as wh, hl as Sh, F as Th, bx as kh, hm as Dh, hn as Mh } from "./index-BS2-ZZGf.js";
5
5
  import { c as We, C as It, X as nt } from "./x-CXDkqdur.js";
6
- import { E as Se, B as ee, N as gs, H as Ga, c as U, O as _, _ as ae, $ as se, a0 as re, a1 as le, a2 as q, D as P, Y as kt, Q as zt, V as Dt, W as Mt, P as Et, a as Vt, b as At, aF as Ma, aL as Lr, aM as _o, aC as Vr, aA as Ih, Z as Be, aN as Eh, L as un, C as qn, T as da, F as ua, G as Ut, I as on, d as mn, u as Ne, R as xs, aO as Br, z as $o, X as Kn, M as Yr, S as Un, aP as Ah, aQ as Oh, aR as zo, ad as Fh, aH as Rh, aS as Ph, aT as Lh, aU as ai, aV as Vh, aW as Bh, aX as Yh, aY as _h, aZ as $h, a_ as zh, a$ as si, b0 as jh, b1 as ri, b2 as ma, b3 as qh, a3 as Ke, b4 as Kh, b5 as _r, b6 as pr, b7 as jo, b8 as Nn, b9 as qo, ba as Uh, bb as Ko, bc as Gh, bd as Hh, be as Kt, K as Uo, bf as pt, bg as Go, r as li, bh as Qh, bi as Wh, bj as Jh, bk as Xh, bl as Zh, bm as ep, bn as tp, bo as np, bp as ap, bq as sp, br as rp, bs as ii, bt as lp, bu as ip, bv as op, bw as cp, bx as dp, J as Es, au as up } from "./switch-BOBLNHUj.js";
6
+ import { E as Se, B as ee, N as gs, H as Ga, c as U, O as _, _ as ae, $ as se, a0 as re, a1 as le, a2 as q, D as P, Y as kt, Q as zt, V as Dt, W as Mt, P as Et, a as Vt, b as At, aF as Ma, aL as Lr, aM as _o, aC as Vr, aA as Ih, Z as Be, aN as Eh, L as un, C as qn, T as da, F as ua, G as Ut, I as on, d as mn, u as Ne, R as xs, aO as Br, z as $o, X as Kn, M as Yr, S as Un, aP as Ah, aQ as Oh, aR as zo, ad as Fh, aH as Rh, aS as Ph, aT as Lh, aU as ai, aV as Vh, aW as Bh, aX as Yh, aY as _h, aZ as $h, a_ as zh, a$ as si, b0 as jh, b1 as ri, b2 as ma, b3 as qh, a3 as Ke, b4 as Kh, b5 as _r, b6 as pr, b7 as jo, b8 as Nn, b9 as qo, ba as Uh, bb as Ko, bc as Gh, bd as Hh, be as Kt, K as Uo, bf as pt, bg as Go, r as li, bh as Qh, bi as Wh, bj as Jh, bk as Xh, bl as Zh, bm as ep, bn as tp, bo as np, bp as ap, bq as sp, br as rp, bs as ii, bt as lp, bu as ip, bv as op, bw as cp, bx as dp, J as Es, au as up } from "./switch-DQR-Va05.js";
7
7
  import { C as mp, h as ha, v as Yn, c as as, M as hp, b as pp, g as fp, d as gp } from "./saved-temporal-bucket-format-SGAV0ivR.js";
8
8
  import "./validators-DEmd8Sin.js";
9
9
  import "./analyze-result-contract-BbRJ-C06.js";
10
10
  import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as Ka } from "../value-format-preferences/index.js";
11
11
  import { C as Gt, M as Ho, a as Qo, E as fr, S as As } from "./search-BHsQIWBV.js";
12
- import { f as xp, F as bp, g as vp, V as Wo, e as yp, C as Np, h as Cp } from "./editor-action-buttons-BVN1okyo.js";
12
+ import { f as xp, F as bp, g as vp, V as Wo, e as yp, C as Np, h as Cp } from "./editor-action-buttons-C9x3nGnb.js";
13
13
  import { f as Hn, r as En, b as Ha, c as cn, e as ta, i as wp, n as Sp, h as Jo, j as Xo, k as Zo, l as Tp, m as gr, o as kp, p as Dp, q as Mp } from "./index-BIFLI8ul.js";
14
14
  import { createPortal as Ip } from "react-dom";
15
15
  import "./index-DSKR3nKn.js";
@@ -430,7 +430,7 @@ function af({
430
430
  r([]);
431
431
  }, u = () => {
432
432
  if (s.length === 0) return;
433
- const h = s[0], v = h.connectionId || "", I = h.connectionType || "", x = s.some((A) => A.type === "dataset") ? "semanticDomain" : "database";
433
+ const h = s[0], v = h.connectionId || "", I = h.connectionType || "", x = s.some((O) => O.type === "dataset") ? "semanticDomain" : "database";
434
434
  c({
435
435
  connectionId: v,
436
436
  connectionType: I,
@@ -645,7 +645,7 @@ function of({
645
645
  const [s, r] = K(
646
646
  () => lf(t, a)
647
647
  ), [c, l] = K(/* @__PURE__ */ new Set()), i = () => {
648
- const M = s.joins.length > 0 ? Math.max(...s.joins.map((O) => O.sequence)) + 1 : 1, T = {
648
+ const M = s.joins.length > 0 ? Math.max(...s.joins.map((E) => E.sequence)) + 1 : 1, T = {
649
649
  id: `join-${Date.now()}`,
650
650
  source: {
651
651
  type: "table",
@@ -680,9 +680,9 @@ function of({
680
680
  }), l(new Set([...c].filter((T) => T !== M)));
681
681
  }, d = (M, T) => {
682
682
  var b, R, B, f, L;
683
- const O = s.joins.find((D) => D.id === M);
684
- if (!O) return;
685
- const S = { ...O, ...T };
683
+ const E = s.joins.find((D) => D.id === M);
684
+ if (!E) return;
685
+ const S = { ...E, ...T };
686
686
  if ((b = S.source) != null && b.name && ((R = S.target) != null && R.name) && S.source.name === S.target.name) {
687
687
  rt.error("Self-joins are not yet supported", {
688
688
  description: `Joining ${S.source.name} to itself is not currently supported. Please select a different target table.`
@@ -701,7 +701,7 @@ function of({
701
701
  });
702
702
  return;
703
703
  }
704
- const E = s.joins.map(
704
+ const A = s.joins.map(
705
705
  (D) => D.id === M ? S : D
706
706
  );
707
707
  if ((f = S.source) != null && f.name && ((L = S.target) != null && L.name) && S.joinKeyGroups[0].keys.length === 0) {
@@ -742,11 +742,11 @@ function of({
742
742
  $[0] = {
743
743
  ...$[0],
744
744
  keys: [V]
745
- }, S.joinKeyGroups = $, E[E.findIndex((Y) => Y.id === M)] = S;
745
+ }, S.joinKeyGroups = $, A[A.findIndex((Y) => Y.id === M)] = S;
746
746
  }
747
747
  r({
748
748
  ...s,
749
- joins: E
749
+ joins: A
750
750
  });
751
751
  };
752
752
  return {
@@ -757,31 +757,31 @@ function of({
757
757
  removeJoin: o,
758
758
  updateJoin: d,
759
759
  moveJoinUp: (M) => {
760
- const T = s.joins.findIndex((O) => O.id === M);
760
+ const T = s.joins.findIndex((E) => E.id === M);
761
761
  if (T > 0) {
762
- const O = [...s.joins], S = { ...O[T] }, k = { ...O[T - 1] };
763
- O[T] = k, O[T - 1] = S, O.forEach((b, R) => {
762
+ const E = [...s.joins], S = { ...E[T] }, k = { ...E[T - 1] };
763
+ E[T] = k, E[T - 1] = S, E.forEach((b, R) => {
764
764
  b.sequence = R + 1;
765
765
  });
766
- const E = {
766
+ const A = {
767
767
  ...s,
768
- joins: O
768
+ joins: E
769
769
  };
770
- r(E);
770
+ r(A);
771
771
  }
772
772
  },
773
773
  moveJoinDown: (M) => {
774
- const T = s.joins.findIndex((O) => O.id === M);
774
+ const T = s.joins.findIndex((E) => E.id === M);
775
775
  if (T < s.joins.length - 1) {
776
- const O = [...s.joins], S = { ...O[T] }, k = { ...O[T + 1] };
777
- O[T] = k, O[T + 1] = S, O.forEach((b, R) => {
776
+ const E = [...s.joins], S = { ...E[T] }, k = { ...E[T + 1] };
777
+ E[T] = k, E[T + 1] = S, E.forEach((b, R) => {
778
778
  b.sequence = R + 1;
779
779
  });
780
- const E = {
780
+ const A = {
781
781
  ...s,
782
- joins: O
782
+ joins: E
783
783
  };
784
- r(E);
784
+ r(A);
785
785
  }
786
786
  },
787
787
  toggleJoinExpansion: (M) => {
@@ -797,39 +797,39 @@ function of({
797
797
  return a.filter(
798
798
  (S) => S.name === s.baseEntity.name
799
799
  );
800
- const O = /* @__PURE__ */ new Set();
801
- return s.baseEntity.name && O.add(s.baseEntity.name), s.joins.slice(0, T).forEach((S) => {
802
- O.add(S.source.name), O.add(S.target.name);
803
- }), a.filter((S) => O.has(S.name));
800
+ const E = /* @__PURE__ */ new Set();
801
+ return s.baseEntity.name && E.add(s.baseEntity.name), s.joins.slice(0, T).forEach((S) => {
802
+ E.add(S.source.name), E.add(S.target.name);
803
+ }), a.filter((S) => E.has(S.name));
804
804
  },
805
805
  getAvailableTargetEntities: (M) => a.filter((T) => T.name !== M),
806
806
  addJoinKeyGroup: (M) => {
807
807
  const T = s.joins.find((S) => S.id === M);
808
808
  if (!T) return;
809
- const O = [...T.joinKeyGroups, mi()];
810
- d(M, { joinKeyGroups: O });
809
+ const E = [...T.joinKeyGroups, mi()];
810
+ d(M, { joinKeyGroups: E });
811
811
  },
812
- updateGroupOperator: (M, T, O) => {
813
- const S = s.joins.find((E) => E.id === M);
812
+ updateGroupOperator: (M, T, E) => {
813
+ const S = s.joins.find((A) => A.id === M);
814
814
  if (!S) return;
815
815
  const k = [...S.joinKeyGroups];
816
- k[T] = { ...k[T], operator: O }, d(M, { joinKeyGroups: k });
816
+ k[T] = { ...k[T], operator: E }, d(M, { joinKeyGroups: k });
817
817
  },
818
818
  removeJoinKeyGroup: (M, T) => {
819
- const O = s.joins.find((k) => k.id === M);
820
- if (!O) return;
821
- const S = [...O.joinKeyGroups];
819
+ const E = s.joins.find((k) => k.id === M);
820
+ if (!E) return;
821
+ const S = [...E.joinKeyGroups];
822
822
  S.splice(T, 1), d(M, { joinKeyGroups: S });
823
823
  },
824
824
  addJoinKey: (M, T) => {
825
- const O = s.joins.find((R) => R.id === M);
826
- if (!O) return;
825
+ const E = s.joins.find((R) => R.id === M);
826
+ if (!E) return;
827
827
  const S = a.find(
828
- (R) => R.name === O.source.name
828
+ (R) => R.name === E.source.name
829
829
  ), k = a.find(
830
- (R) => R.name === O.target.name
831
- ), E = [...O.joinKeyGroups];
832
- E[T] || (E[T] = mi());
830
+ (R) => R.name === E.target.name
831
+ ), A = [...E.joinKeyGroups];
832
+ A[T] || (A[T] = mi());
833
833
  const b = {
834
834
  id: `key-${Date.now()}`,
835
835
  source: {
@@ -854,41 +854,41 @@ function of({
854
854
  },
855
855
  operator: "="
856
856
  };
857
- E[T] = {
858
- ...E[T],
859
- keys: [...E[T].keys, b]
860
- }, d(M, { joinKeyGroups: E });
857
+ A[T] = {
858
+ ...A[T],
859
+ keys: [...A[T].keys, b]
860
+ }, d(M, { joinKeyGroups: A });
861
861
  },
862
- updateJoinKey: (M, T, O, S, k) => {
863
- const E = s.joins.find((L) => L.id === M);
864
- if (!E) return;
862
+ updateJoinKey: (M, T, E, S, k) => {
863
+ const A = s.joins.find((L) => L.id === M);
864
+ if (!A) return;
865
865
  const b = a.find(
866
- (L) => L.name === E.source.name
866
+ (L) => L.name === A.source.name
867
867
  ), R = a.find(
868
- (L) => L.name === E.target.name
869
- ), B = [...E.joinKeyGroups], f = B[T].keys[O];
870
- S === "sourceColumnName" && b ? B[T].keys[O] = {
868
+ (L) => L.name === A.target.name
869
+ ), B = [...A.joinKeyGroups], f = B[T].keys[E];
870
+ S === "sourceColumnName" && b ? B[T].keys[E] = {
871
871
  ...f,
872
872
  source: {
873
873
  ...f.source,
874
874
  name: k
875
875
  }
876
- } : S === "targetColumnName" && R ? B[T].keys[O] = {
876
+ } : S === "targetColumnName" && R ? B[T].keys[E] = {
877
877
  ...f,
878
878
  target: {
879
879
  ...f.target,
880
880
  name: k
881
881
  }
882
- } : S === "operator" && (B[T].keys[O] = {
882
+ } : S === "operator" && (B[T].keys[E] = {
883
883
  ...f,
884
884
  operator: k
885
885
  }), d(M, { joinKeyGroups: B });
886
886
  },
887
- removeJoinKey: (M, T, O) => {
888
- const S = s.joins.find((E) => E.id === M);
887
+ removeJoinKey: (M, T, E) => {
888
+ const S = s.joins.find((A) => A.id === M);
889
889
  if (!S) return;
890
890
  const k = [...S.joinKeyGroups];
891
- k[T].keys.splice(O, 1), d(M, { joinKeyGroups: k });
891
+ k[T].keys.splice(E, 1), d(M, { joinKeyGroups: k });
892
892
  },
893
893
  generateSQLPreview: () => {
894
894
  const M = [...s.joins].sort(
@@ -896,14 +896,14 @@ function of({
896
896
  ), T = s.baseEntity;
897
897
  if (!T.name)
898
898
  return "SELECT * FROM table -- Please select a base entity";
899
- let O = `SELECT *
899
+ let E = `SELECT *
900
900
  FROM ${T.name}`;
901
901
  return M.forEach((S) => {
902
902
  const k = a.find(
903
903
  (R) => R.name === S.target.name
904
904
  );
905
905
  if (!k) return;
906
- const E = S.joinKeyGroups.filter((R) => R.keys && R.keys.length > 0).map((R) => {
906
+ const A = S.joinKeyGroups.filter((R) => R.keys && R.keys.length > 0).map((R) => {
907
907
  const B = R.keys.filter(
908
908
  (f) => {
909
909
  var L, D, F, V;
@@ -913,11 +913,11 @@ FROM ${T.name}`;
913
913
  (f) => `${f.source.entityName}.${f.source.name} ${f.operator} ${f.target.entityName}.${f.target.name}`
914
914
  );
915
915
  return B.length > 1 ? `(${B.join(` ${R.operator} `)})` : B[0];
916
- }).filter(Boolean), b = E.length > 1 ? E.join(" OR ") : E[0] || "condition_here";
917
- O += `
916
+ }).filter(Boolean), b = A.length > 1 ? A.join(" OR ") : A[0] || "condition_here";
917
+ E += `
918
918
  ${S.joinType} JOIN ${k.name}
919
919
  ON ${b}`;
920
- }), O;
920
+ }), E;
921
921
  },
922
922
  isValidConfiguration: () => !(!s.baseEntity.name || s.joins.some(
923
923
  (S) => !S.source.name || !S.target.name
@@ -926,7 +926,7 @@ ${S.joinType} JOIN ${k.name}
926
926
  ) || s.joins.some(
927
927
  (S) => S.joinKeyGroups.some(
928
928
  (k) => k.keys.some(
929
- (E) => !E.source.name || !E.target.name || !E.operator
929
+ (A) => !A.source.name || !A.target.name || !A.operator
930
930
  )
931
931
  )
932
932
  ))
@@ -970,20 +970,20 @@ function hf({
970
970
  getAvailableSourceEntities: N,
971
971
  getAvailableTargetEntities: x,
972
972
  addJoinKeyGroup: w,
973
- updateGroupOperator: A,
973
+ updateGroupOperator: O,
974
974
  removeJoinKeyGroup: C,
975
975
  addJoinKey: y,
976
976
  updateJoinKey: M,
977
977
  removeJoinKey: T,
978
- generateSQLPreview: O,
978
+ generateSQLPreview: E,
979
979
  isValidConfiguration: S
980
980
  } = of({
981
981
  initialJoinPlan: t,
982
982
  availableDataSources: a
983
- }), [k, E] = K(/* @__PURE__ */ new Set()), [b, R] = K(!1), B = (F) => {
983
+ }), [k, A] = K(/* @__PURE__ */ new Set()), [b, R] = K(!1), B = (F) => {
984
984
  const V = i.find(($) => $.entityName === F);
985
985
  return (V == null ? void 0 : V.columns) || [];
986
- }, f = (F) => E((V) => {
986
+ }, f = (F) => A((V) => {
987
987
  const $ = new Set(V);
988
988
  return $.has(F) ? $.delete(F) : $.add(F), $;
989
989
  }), L = [];
@@ -1293,7 +1293,7 @@ function hf({
1293
1293
  getColumnsForEntity: B,
1294
1294
  addJoinKey: y,
1295
1295
  addJoinKeyGroup: w,
1296
- updateGroupOperator: A,
1296
+ updateGroupOperator: O,
1297
1297
  removeJoinKeyGroup: C,
1298
1298
  updateJoinKey: M,
1299
1299
  removeJoinKey: T,
@@ -1369,7 +1369,7 @@ function hf({
1369
1369
  ]
1370
1370
  }
1371
1371
  ),
1372
- b && /* @__PURE__ */ e("div", { className: "rounded-[5px] border border-border/60 bg-muted/40 p-3", children: /* @__PURE__ */ e("code", { className: "block whitespace-pre-wrap break-all font-mono text-[11px] text-muted-foreground", children: O() }) })
1372
+ b && /* @__PURE__ */ e("div", { className: "rounded-[5px] border border-border/60 bg-muted/40 p-3", children: /* @__PURE__ */ e("code", { className: "block whitespace-pre-wrap break-all font-mono text-[11px] text-muted-foreground", children: E() }) })
1373
1373
  ] }),
1374
1374
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-2 border-t border-border pt-4", children: [
1375
1375
  /* @__PURE__ */ n(
@@ -1776,7 +1776,7 @@ function bf({
1776
1776
  onOpenChange: a,
1777
1777
  variant: s = "button"
1778
1778
  } = {}) {
1779
- var w, A;
1779
+ var w, O;
1780
1780
  const r = P((C) => C.card), { autoJoinMetadata: c } = Bt(r), l = P(
1781
1781
  (C) => C.actions.updateCardConfig
1782
1782
  ), i = ((w = r == null ? void 0 : r.config) == null ? void 0 : w.joinPlan) || {
@@ -1790,7 +1790,7 @@ function bf({
1790
1790
  dialect: "none"
1791
1791
  },
1792
1792
  joins: []
1793
- }, [o, d] = K(!1), u = t !== void 0, m = u ? t : o, g = u ? a : d, p = ((A = r == null ? void 0 : r.dataSource) == null ? void 0 : A.selectedEntities) || [], h = (C) => {
1793
+ }, [o, d] = K(!1), u = t !== void 0, m = u ? t : o, g = u ? a : d, p = ((O = r == null ? void 0 : r.dataSource) == null ? void 0 : O.selectedEntities) || [], h = (C) => {
1794
1794
  l(r.id, {
1795
1795
  ...r == null ? void 0 : r.config,
1796
1796
  joinPlan: C
@@ -1804,19 +1804,19 @@ function bf({
1804
1804
  g(!1);
1805
1805
  }, N = () => {
1806
1806
  const C = [...i.joins].sort(
1807
- (T, O) => T.sequence - O.sequence
1807
+ (T, E) => T.sequence - E.sequence
1808
1808
  ), y = i.baseEntity;
1809
1809
  if (!y.name)
1810
1810
  return "SELECT * FROM table -- Please select a base entity";
1811
1811
  let M = `SELECT *
1812
1812
  FROM ${y.name}`;
1813
1813
  return C.forEach((T) => {
1814
- const O = p.find(
1815
- (E) => E.name === T.target.name
1814
+ const E = p.find(
1815
+ (A) => A.name === T.target.name
1816
1816
  );
1817
- if (!O) return;
1818
- const S = T.joinKeyGroups.filter((E) => E.keys && E.keys.length > 0).map((E) => {
1819
- const b = E.keys.filter(
1817
+ if (!E) return;
1818
+ const S = T.joinKeyGroups.filter((A) => A.keys && A.keys.length > 0).map((A) => {
1819
+ const b = A.keys.filter(
1820
1820
  (R) => {
1821
1821
  var B, f, L, D;
1822
1822
  return ((B = R.source) == null ? void 0 : B.name) && ((f = R.target) == null ? void 0 : f.name) && ((L = R.source) == null ? void 0 : L.entityName) && ((D = R.target) == null ? void 0 : D.entityName);
@@ -1824,10 +1824,10 @@ FROM ${y.name}`;
1824
1824
  ).map(
1825
1825
  (R) => `${R.source.entityName}.${R.source.name} ${R.operator} ${R.target.entityName}.${R.target.name}`
1826
1826
  );
1827
- return b.length > 1 ? `(${b.join(` ${E.operator} `)})` : b[0];
1827
+ return b.length > 1 ? `(${b.join(` ${A.operator} `)})` : b[0];
1828
1828
  }).filter(Boolean), k = S.length > 1 ? S.join(" OR ") : S[0] || "condition_here";
1829
1829
  M += `
1830
- ${T.joinType} JOIN ${O.name}
1830
+ ${T.joinType} JOIN ${E.name}
1831
1831
  ON ${k}`;
1832
1832
  }), M;
1833
1833
  };
@@ -1897,7 +1897,7 @@ ${T.joinType} JOIN ${O.name}
1897
1897
  ] });
1898
1898
  }
1899
1899
  function vf() {
1900
- var k, E, b, R, B, f, L;
1900
+ var k, A, b, R, B, f, L;
1901
1901
  const [t, a] = K(!1), [s, r] = K(!1), [c, l] = K(!1), i = P((D) => D.card.dataSource), o = P((D) => D.card), d = P((D) => D.isDevMode), { updateCardConfig: u, updateDataSource: m } = Se(), { autoJoinMetadata: g } = Bt(o), h = {
1902
1902
  ...{
1903
1903
  connectionId: "",
@@ -1907,10 +1907,10 @@ function vf() {
1907
1907
  },
1908
1908
  ...i,
1909
1909
  selectedEntities: (i == null ? void 0 : i.selectedEntities) || []
1910
- }, v = sd(h.selectedEntities), I = v.length, N = I === 0 ? "Choose dataset" : I === 1 ? Ws(v[0]) : `${I} datasets`, x = ((b = (E = (k = o == null ? void 0 : o.config) == null ? void 0 : k.joinPlan) == null ? void 0 : E.joins) == null ? void 0 : b.length) ?? 0, w = ui(
1910
+ }, v = sd(h.selectedEntities), I = v.length, N = I === 0 ? "Choose dataset" : I === 1 ? Ws(v[0]) : `${I} datasets`, x = ((b = (A = (k = o == null ? void 0 : o.config) == null ? void 0 : k.joinPlan) == null ? void 0 : A.joins) == null ? void 0 : b.length) ?? 0, w = ui(
1911
1911
  (R = o == null ? void 0 : o.config) == null ? void 0 : R.joinPlan,
1912
1912
  v
1913
- ), A = w.length > 0, C = !d && (I > 1 || x > 0), y = !!(g != null && g.autoResolved);
1913
+ ), O = w.length > 0, C = !d && (I > 1 || x > 0), y = !!(g != null && g.autoResolved);
1914
1914
  ((f = (B = g == null ? void 0 : g.resolvedJoinPlan) == null ? void 0 : B.joins) == null ? void 0 : f.length) ?? ((L = g == null ? void 0 : g.relationshipsUsed) == null || L.length);
1915
1915
  const M = x > 0 ? `${x} join${x === 1 ? "" : "s"}` : I < 2 ? null : y ? "auto" : null, T = (D) => {
1916
1916
  var V;
@@ -1927,7 +1927,7 @@ function vf() {
1927
1927
  } : {},
1928
1928
  selectedEntities: F
1929
1929
  });
1930
- }, O = () => {
1930
+ }, E = () => {
1931
1931
  o && u(o.id, {
1932
1932
  ...o.config,
1933
1933
  joinPlan: void 0
@@ -2032,7 +2032,7 @@ function vf() {
2032
2032
  ] }),
2033
2033
  C && /* @__PURE__ */ n("div", { className: "border-t border-border/60 px-3 py-2.5", children: [
2034
2034
  /* @__PURE__ */ e("div", { className: "mb-1.5 flex items-center justify-between", children: /* @__PURE__ */ e("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Join" }) }),
2035
- A ? /* @__PURE__ */ n("div", { className: "space-y-2 rounded-control border border-amber-300/70 bg-amber-50/70 p-2.5 text-[11px] text-amber-950 dark:border-amber-700/70 dark:bg-amber-950/20 dark:text-amber-100", children: [
2035
+ O ? /* @__PURE__ */ n("div", { className: "space-y-2 rounded-control border border-amber-300/70 bg-amber-50/70 p-2.5 text-[11px] text-amber-950 dark:border-amber-700/70 dark:bg-amber-950/20 dark:text-amber-100", children: [
2036
2036
  /* @__PURE__ */ n("div", { className: "flex gap-2", children: [
2037
2037
  /* @__PURE__ */ e(rd, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
2038
2038
  /* @__PURE__ */ n("div", { className: "min-w-0", children: [
@@ -2053,7 +2053,7 @@ function vf() {
2053
2053
  "button",
2054
2054
  {
2055
2055
  type: "button",
2056
- onClick: O,
2056
+ onClick: E,
2057
2057
  className: "rounded-control border border-amber-500/60 bg-background px-2 py-1 text-[11px] font-medium text-foreground transition-colors hover:bg-amber-100 dark:bg-background dark:hover:bg-amber-950/60",
2058
2058
  children: "Remove saved join"
2059
2059
  }
@@ -2116,7 +2116,7 @@ function vf() {
2116
2116
  dataSource: h
2117
2117
  }
2118
2118
  ),
2119
- C && !A && /* @__PURE__ */ e("div", { className: "hidden", children: /* @__PURE__ */ e(bf, { open: c, onOpenChange: l }) })
2119
+ C && !O && /* @__PURE__ */ e("div", { className: "hidden", children: /* @__PURE__ */ e(bf, { open: c, onOpenChange: l }) })
2120
2120
  ] });
2121
2121
  }
2122
2122
  function Ws(t) {
@@ -2326,7 +2326,7 @@ function Of({
2326
2326
  }
2327
2327
  ), h = Ma(
2328
2328
  (Z) => Z.currentAIContext.selectedEntities
2329
- ), v = h.length, { setCurrentAIContext: I } = Lr(), [N, x] = K(""), [w, A] = K(""), [C, y] = K(""), [M, T] = K("draft"), [O, S] = K("draft"), [k, E] = K(""), [b, R] = K(!1), [B, f] = K({ status: "idle" }), [L, D] = K(
2329
+ ), v = h.length, { setCurrentAIContext: I } = Lr(), [N, x] = K(""), [w, O] = K(""), [C, y] = K(""), [M, T] = K("draft"), [E, S] = K("draft"), [k, A] = K(""), [b, R] = K(!1), [B, f] = K({ status: "idle" }), [L, D] = K(
2330
2330
  Js
2331
2331
  ), [F, V] = K(!1), [$, Y] = K(
2332
2332
  () => ss("inline-query-session")
@@ -2850,7 +2850,7 @@ function Of({
2850
2850
  attemptCount: 0,
2851
2851
  hasTools: !1,
2852
2852
  finalOutcome: "drafting"
2853
- }), Pe(), ke(), A(de), y(""), T(oe), E(Le), R(!1), f({ status: "idle" }), j.current += 1, at([]), V(!0);
2853
+ }), Pe(), ke(), O(de), y(""), T(oe), A(Le), R(!1), f({ status: "idle" }), j.current += 1, at([]), V(!0);
2854
2854
  const Zt = kf({
2855
2855
  request: de,
2856
2856
  mode: oe,
@@ -2886,7 +2886,7 @@ function Of({
2886
2886
  [l, C]
2887
2887
  ), Jt = C.trim().length > 0, hn = ["valid", "invalid", "error"].includes(
2888
2888
  B.status
2889
- ), On = Jt && hn, jt = B.status === "invalid", Wa = B.status === "validating", pa = Jt && w.length > 0 && w === N.trim(), pn = gt.length > 0, fa = N.trim().length > 0, Xt = pa && M === "draft", fn = pa && M === "refine" && k === gt, gn = O === "refine" && !pn ? "draft" : O, Ja = (gn === "refine" ? fn : Xt) ? "Open composer preview" : "Generate composer SQL", Xa = N.trim().length > 0 || w.trim().length > 0 || Jt || B.status !== "idle" || L.timelineSteps.length > 0, ga = Ee(
2889
+ ), On = Jt && hn, jt = B.status === "invalid", Wa = B.status === "validating", pa = Jt && w.length > 0 && w === N.trim(), pn = gt.length > 0, fa = N.trim().length > 0, Xt = pa && M === "draft", fn = pa && M === "refine" && k === gt, gn = E === "refine" && !pn ? "draft" : E, Ja = (gn === "refine" ? fn : Xt) ? "Open composer preview" : "Generate composer SQL", Xa = N.trim().length > 0 || w.trim().length > 0 || Jt || B.status !== "idle" || L.timelineSteps.length > 0, ga = Ee(
2890
2890
  (Z = "draft") => {
2891
2891
  if (ve)
2892
2892
  return;
@@ -2912,7 +2912,7 @@ function Of({
2912
2912
  },
2913
2913
  [ye]
2914
2914
  ), Za = Ee(() => {
2915
- ve || (ye("cancelled"), $e.current = !1, j.current += 1, _e.current = "", De.current = 0, x(""), A(""), y(""), T("draft"), S("draft"), E(""), R(!1), f({ status: "idle" }), ke(), at([]), je((Z) => ({
2915
+ ve || (ye("cancelled"), $e.current = !1, j.current += 1, _e.current = "", De.current = 0, x(""), O(""), y(""), T("draft"), S("draft"), A(""), R(!1), f({ status: "idle" }), ke(), at([]), je((Z) => ({
2916
2916
  ...Js,
2917
2917
  runId: Z.runId
2918
2918
  })));
@@ -3473,7 +3473,7 @@ function Vf({
3473
3473
  (ie) => ie.selectedSchemaName
3474
3474
  );
3475
3475
  P((ie) => ie.showAIDialog);
3476
- const w = P((ie) => ie.selectedTableName), A = Ne(
3476
+ const w = P((ie) => ie.selectedTableName), O = Ne(
3477
3477
  (ie) => {
3478
3478
  var Ge, lt;
3479
3479
  return ((lt = (Ge = ie.dashboard) == null ? void 0 : Ge.filters) == null ? void 0 : lt.length) ?? 0;
@@ -3496,23 +3496,23 @@ function Vf({
3496
3496
  );
3497
3497
  },
3498
3498
  [M, (Je = y == null ? void 0 : y.customCardPreferences) == null ? void 0 : Je.componentName]
3499
- ), O = En(y, T), S = ce(
3499
+ ), E = En(y, T), S = ce(
3500
3500
  () => Ha({
3501
3501
  frame: u,
3502
3502
  configCard: y,
3503
- isMultiInputVisual: O === "multiple"
3503
+ isMultiInputVisual: E === "multiple"
3504
3504
  }),
3505
- [u, y, O]
3505
+ [u, y, E]
3506
3506
  ), k = ce(() => {
3507
3507
  const ie = S.findIndex(
3508
3508
  (Ge) => (Ge == null ? void 0 : Ge.id) === (m == null ? void 0 : m.id)
3509
3509
  );
3510
3510
  return ie < 0 ? -1 : cn(m, ie);
3511
- }, [S, m]), E = ce(() => !y || O !== "multiple" || k < 0 ? m.type : ta(
3511
+ }, [S, m]), A = ce(() => !y || E !== "multiple" || k < 0 ? m.type : ta(
3512
3512
  m,
3513
3513
  k,
3514
3514
  T == null ? void 0 : T.slots
3515
- ) ?? m.type, [y, O, k, m, T == null ? void 0 : T.slots]), b = ce(() => E !== m.type ? { ...m, type: E } : m, [m, E]), R = ce(() => A === 0 ? null : Tf(m == null ? void 0 : m.sql), [m == null ? void 0 : m.sql, A]), B = Ae(!0), {
3515
+ ) ?? m.type, [y, E, k, m, T == null ? void 0 : T.slots]), b = ce(() => A !== m.type ? { ...m, type: A } : m, [m, A]), R = ce(() => O === 0 ? null : Tf(m == null ? void 0 : m.sql), [m == null ? void 0 : m.sql, O]), B = Ae(!0), {
3516
3516
  setCardCustomCfg: f,
3517
3517
  setQueryResultColumns: L,
3518
3518
  setCardSql: D,
@@ -3956,8 +3956,8 @@ function zf({
3956
3956
  onSortChange: l,
3957
3957
  isLoading: i
3958
3958
  }) {
3959
- var S, k, E, b, R, B;
3960
- const o = an.useMemo(() => Object.keys(t[0] ?? {}), [t]), d = a.sql && !((k = (S = a.preferences) == null ? void 0 : S.tablePrefs) != null && k.enableDevModePagination) ? (b = (E = a.preferences) == null ? void 0 : E.tablePrefs) == null ? void 0 : b.pageSize : void 0, u = an.useMemo(
3959
+ var S, k, A, b, R, B;
3960
+ const o = an.useMemo(() => Object.keys(t[0] ?? {}), [t]), d = a.sql && !((k = (S = a.preferences) == null ? void 0 : S.tablePrefs) != null && k.enableDevModePagination) ? (b = (A = a.preferences) == null ? void 0 : A.tablePrefs) == null ? void 0 : b.pageSize : void 0, u = an.useMemo(
3961
3961
  () => {
3962
3962
  var f;
3963
3963
  return eo((f = a.config) == null ? void 0 : f.sortByColumns);
@@ -3987,7 +3987,7 @@ function zf({
3987
3987
  for (const L of o)
3988
3988
  f[L] = _f(t, L);
3989
3989
  return f;
3990
- }, [o, t]), A = an.useMemo(
3990
+ }, [o, t]), O = an.useMemo(
3991
3991
  () => o.map((f) => {
3992
3992
  const D = w[f] === "number";
3993
3993
  return {
@@ -4028,9 +4028,9 @@ function zf({
4028
4028
  };
4029
4029
  }),
4030
4030
  [m, w, o]
4031
- ), C = Math.max(A.length, 1), y = wd({
4031
+ ), C = Math.max(O.length, 1), y = wd({
4032
4032
  data: t,
4033
- columns: A,
4033
+ columns: O,
4034
4034
  getCoreRowModel: kd(),
4035
4035
  getPaginationRowModel: I === "client" ? Td() : void 0,
4036
4036
  onSortingChange: h,
@@ -4043,7 +4043,7 @@ function zf({
4043
4043
  sorting: x,
4044
4044
  pagination: v
4045
4045
  }
4046
- }), M = I === "server" && s ? s.totalCount : t.length, T = I !== "disabled" && (I === "server" || M > 10), O = o.length > 0 ? `${o.length * 144}px` : "100%";
4046
+ }), M = I === "server" && s ? s.totalCount : t.length, T = I !== "disabled" && (I === "server" || M > 10), E = o.length > 0 ? `${o.length * 144}px` : "100%";
4047
4047
  return /* @__PURE__ */ n("div", { className: "relative flex h-full min-h-0 w-full flex-col", children: [
4048
4048
  i && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-20 flex items-center justify-center bg-background/50", children: /* @__PURE__ */ e(un, { className: "h-5 w-5 animate-spin text-muted-foreground" }) }),
4049
4049
  /* @__PURE__ */ n(Dd, { className: "relative min-h-0 w-full grow overflow-auto rounded-none border-0 bg-transparent text-foreground", children: [
@@ -4051,7 +4051,7 @@ function zf({
4051
4051
  "table",
4052
4052
  {
4053
4053
  className: "w-full text-sm [border-spacing:0]",
4054
- style: { minWidth: O },
4054
+ style: { minWidth: E },
4055
4055
  children: [
4056
4056
  /* @__PURE__ */ e(Md, { className: "sticky top-0 z-10 bg-muted [&_tr]:border-b-0", children: y.getHeaderGroups().map((f) => /* @__PURE__ */ e(
4057
4057
  Bs,
@@ -4197,8 +4197,8 @@ function jf({ className: t }) {
4197
4197
  if (h === v)
4198
4198
  return I;
4199
4199
  if (v === "detailTable") {
4200
- const w = (M) => M == null ? void 0 : M.toLowerCase().replace(/\s+/g, "").trim(), A = (M, T) => {
4201
- const O = [
4200
+ const w = (M) => M == null ? void 0 : M.toLowerCase().replace(/\s+/g, "").trim(), O = (M, T) => {
4201
+ const E = [
4202
4202
  w(M.label),
4203
4203
  w(M.qualifiedFieldName),
4204
4204
  w(M.name)
@@ -4207,7 +4207,7 @@ function jf({ className: t }) {
4207
4207
  w(T.qualifiedFieldName),
4208
4208
  w(T.name)
4209
4209
  ].filter(Boolean);
4210
- return O.some(
4210
+ return E.some(
4211
4211
  (k) => S.includes(k)
4212
4212
  );
4213
4213
  }, C = (I.groupByColumns || []).map(
@@ -4217,7 +4217,7 @@ function jf({ className: t }) {
4217
4217
  })
4218
4218
  ), y = ((x = I.sortByColumns) == null ? void 0 : x.filter(
4219
4219
  (M) => C.some(
4220
- (T) => A(M, T)
4220
+ (T) => O(M, T)
4221
4221
  )
4222
4222
  )) ?? [];
4223
4223
  return {
@@ -4250,8 +4250,8 @@ function jf({ className: t }) {
4250
4250
  };
4251
4251
  else {
4252
4252
  const w = (I.detailColumns || []).map(
4253
- (A) => ({
4254
- ...A,
4253
+ (O) => ({
4254
+ ...O,
4255
4255
  role: "groupby"
4256
4256
  })
4257
4257
  );
@@ -4501,9 +4501,9 @@ function dc({
4501
4501
  debugPayloads: t,
4502
4502
  className: a
4503
4503
  }) {
4504
- const [s, r] = K(null), c = P((A) => A.card), l = P((A) => A.frame), i = Ne((A) => A.selectedSheetId), o = Ne((A) => {
4504
+ const [s, r] = K(null), c = P((O) => O.card), l = P((O) => O.frame), i = Ne((O) => O.selectedSheetId), o = Ne((O) => {
4505
4505
  var C;
4506
- return (C = A.dashboard) == null ? void 0 : C.id;
4506
+ return (C = O.dashboard) == null ? void 0 : C.id;
4507
4507
  }), d = ce(
4508
4508
  () => ({
4509
4509
  cardId: c.id || null,
@@ -4539,64 +4539,64 @@ function dc({
4539
4539
  { label: "Dashboard ID", value: o || "" }
4540
4540
  ],
4541
4541
  [c.id, l.id, i, o]
4542
- ), p = (A) => u[A] !== void 0, h = ce(() => {
4542
+ ), p = (O) => u[O] !== void 0, h = ce(() => {
4543
4543
  if (!s)
4544
4544
  return null;
4545
- const A = u[s];
4546
- if (A === void 0)
4545
+ const O = u[s];
4546
+ if (O === void 0)
4547
4547
  return null;
4548
- const C = s === "queryResponse" ? Hf(A) : { value: A }, y = yi(C.value);
4548
+ const C = s === "queryResponse" ? Hf(O) : { value: O }, y = yi(C.value);
4549
4549
  return y ? {
4550
4550
  target: s,
4551
4551
  title: Jn(s),
4552
4552
  json: y,
4553
4553
  truncationMessage: C.truncationMessage
4554
4554
  } : null;
4555
- }, [s, u]), v = h ? h.title : "Inspect payload", I = async (A) => {
4556
- const C = u[A];
4555
+ }, [s, u]), v = h ? h.title : "Inspect payload", I = async (O) => {
4556
+ const C = u[O];
4557
4557
  if (C === void 0)
4558
- return rt.error(`No ${Jn(A).toLowerCase()} available`), !1;
4558
+ return rt.error(`No ${Jn(O).toLowerCase()} available`), !1;
4559
4559
  const y = yi(C);
4560
4560
  if (!y)
4561
4561
  return rt.error(
4562
- `Unable to serialize ${Jn(A).toLowerCase()}`
4562
+ `Unable to serialize ${Jn(O).toLowerCase()}`
4563
4563
  ), !1;
4564
4564
  try {
4565
- return await vi.writeTextToClipboard(y) ? (rt.success(`${Jn(A)} copied`), !0) : (rt.error("Clipboard is not available"), !1);
4565
+ return await vi.writeTextToClipboard(y) ? (rt.success(`${Jn(O)} copied`), !0) : (rt.error("Clipboard is not available"), !1);
4566
4566
  } catch (M) {
4567
- return console.error("Failed to copy debug payload", M), rt.error(`Unable to copy ${Jn(A).toLowerCase()}`), !1;
4567
+ return console.error("Failed to copy debug payload", M), rt.error(`Unable to copy ${Jn(O).toLowerCase()}`), !1;
4568
4568
  }
4569
- }, N = async () => h ? I(h.target) : !1, x = async (A) => {
4570
- if (!A.value)
4569
+ }, N = async () => h ? I(h.target) : !1, x = async (O) => {
4570
+ if (!O.value)
4571
4571
  return !1;
4572
4572
  try {
4573
- return await vi.writeTextToClipboard(A.value) ? !0 : (rt.error("Clipboard is not available"), !1);
4573
+ return await vi.writeTextToClipboard(O.value) ? !0 : (rt.error("Clipboard is not available"), !1);
4574
4574
  } catch (C) {
4575
- return console.error("Failed to copy card detail", C), rt.error(`Unable to copy ${A.label}`), !1;
4575
+ return console.error("Failed to copy card detail", C), rt.error(`Unable to copy ${O.label}`), !1;
4576
4576
  }
4577
- }, w = (A) => {
4578
- if (u[A] === void 0) {
4579
- rt.error(`No ${Jn(A).toLowerCase()} available`);
4577
+ }, w = (O) => {
4578
+ if (u[O] === void 0) {
4579
+ rt.error(`No ${Jn(O).toLowerCase()} available`);
4580
4580
  return;
4581
4581
  }
4582
- r(A);
4582
+ r(O);
4583
4583
  };
4584
4584
  return /* @__PURE__ */ n("div", { className: U("mb-2 min-w-0 px-3", a), children: [
4585
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-x-6 gap-y-1 md:grid-cols-2", children: g.map((A) => /* @__PURE__ */ n(
4585
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-x-6 gap-y-1 md:grid-cols-2", children: g.map((O) => /* @__PURE__ */ n(
4586
4586
  zr,
4587
4587
  {
4588
- text: A.value,
4589
- "aria-label": Uf(A.label),
4590
- title: A.value ? `Copy ${A.label}` : "N/A",
4591
- disabled: !A.value,
4592
- onCopy: () => x(A),
4588
+ text: O.value,
4589
+ "aria-label": Uf(O.label),
4590
+ title: O.value ? `Copy ${O.label}` : "N/A",
4591
+ disabled: !O.value,
4592
+ onCopy: () => x(O),
4593
4593
  className: "min-w-0 py-1.5",
4594
4594
  children: [
4595
- /* @__PURE__ */ e("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: A.label }),
4596
- /* @__PURE__ */ e("code", { className: "mt-1 block truncate font-mono text-[12px] leading-5 text-foreground", children: A.value || "N/A" })
4595
+ /* @__PURE__ */ e("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: O.label }),
4596
+ /* @__PURE__ */ e("code", { className: "mt-1 block truncate font-mono text-[12px] leading-5 text-foreground", children: O.value || "N/A" })
4597
4597
  ]
4598
4598
  },
4599
- A.label
4599
+ O.label
4600
4600
  )) }),
4601
4601
  m && /* @__PURE__ */ n("div", { className: "mt-2 border-t border-border/60 pt-2", children: [
4602
4602
  /* @__PURE__ */ n("div", { className: "flex min-h-7 items-center justify-between gap-3", children: [
@@ -4615,18 +4615,18 @@ function dc({
4615
4615
  ]
4616
4616
  }
4617
4617
  ) }),
4618
- /* @__PURE__ */ e(ca, { align: "end", className: "w-48 p-1", children: Gf.map((A) => /* @__PURE__ */ e(
4618
+ /* @__PURE__ */ e(ca, { align: "end", className: "w-48 p-1", children: Gf.map((O) => /* @__PURE__ */ e(
4619
4619
  st,
4620
4620
  {
4621
- disabled: !p(A.target),
4622
- onSelect: () => w(A.target),
4621
+ disabled: !p(O.target),
4622
+ onSelect: () => w(O.target),
4623
4623
  className: U(
4624
4624
  "h-7 rounded-control px-2 text-[12px] font-normal leading-4",
4625
- s === A.target && "bg-accent"
4625
+ s === O.target && "bg-accent"
4626
4626
  ),
4627
- children: A.label
4627
+ children: O.label
4628
4628
  },
4629
- `preview-${A.target}`
4629
+ `preview-${O.target}`
4630
4630
  )) })
4631
4631
  ] })
4632
4632
  ] }),
@@ -4774,9 +4774,10 @@ function mc({
4774
4774
  showCardDetails: u = !1,
4775
4775
  defaultSqlExpanded: m = !1,
4776
4776
  debugPayloads: g,
4777
- className: p
4777
+ className: p,
4778
+ embedded: h = !1
4778
4779
  }) {
4779
- const h = Bi(), [v, I] = K(!1), N = !!i, x = !!(l && a), w = u, A = !!(d && o), C = N || x || w ? /* @__PURE__ */ n(we, { children: [
4780
+ const v = Bi(), [I, N] = K(!1), x = h ? "px-3" : "px-0", w = !!i, O = !!(l && a), C = u, y = !!(d && o), M = w || O || C ? /* @__PURE__ */ n(we, { children: [
4780
4781
  i ? /* @__PURE__ */ e(
4781
4782
  ee,
4782
4783
  {
@@ -4800,11 +4801,11 @@ function mc({
4800
4801
  u ? /* @__PURE__ */ e(
4801
4802
  cc,
4802
4803
  {
4803
- isOpen: v,
4804
- onClick: () => I((M) => !M)
4804
+ isOpen: I,
4805
+ onClick: () => N((E) => !E)
4805
4806
  }
4806
4807
  ) : null
4807
- ] }) : null, y = A ? /* @__PURE__ */ e(
4808
+ ] }) : null, T = y ? /* @__PURE__ */ e(
4808
4809
  ee,
4809
4810
  {
4810
4811
  type: "button",
@@ -4816,18 +4817,18 @@ function mc({
4816
4817
  }
4817
4818
  ) : null;
4818
4819
  return /* @__PURE__ */ n(lc, { className: U("w-full", p), children: [
4819
- /* @__PURE__ */ n(ic, { className: "px-0", children: [
4820
+ /* @__PURE__ */ n(ic, { className: x, children: [
4820
4821
  /* @__PURE__ */ e(
4821
4822
  "span",
4822
4823
  {
4823
- id: h,
4824
+ id: v,
4824
4825
  className: "min-w-0 truncate text-[13px] font-medium text-foreground",
4825
4826
  children: s
4826
4827
  }
4827
4828
  ),
4828
- C || y ? /* @__PURE__ */ n(oc, { children: [
4829
- C,
4830
- y
4829
+ M || T ? /* @__PURE__ */ n(oc, { children: [
4830
+ M,
4831
+ T
4831
4832
  ] }) : null
4832
4833
  ] }),
4833
4834
  /* @__PURE__ */ e(
@@ -4836,11 +4837,15 @@ function mc({
4836
4837
  text: t,
4837
4838
  "aria-label": "Copy error message",
4838
4839
  title: "Copy error message",
4839
- className: U("max-h-60 overflow-auto", r),
4840
- children: /* @__PURE__ */ e("span", { role: "alert", "aria-labelledby": h, children: /* @__PURE__ */ e("p", { className: "whitespace-pre-wrap break-all text-[12px] leading-[1.55] text-muted-foreground", children: t }) })
4840
+ className: U(
4841
+ "max-h-60 overflow-auto",
4842
+ x,
4843
+ r
4844
+ ),
4845
+ children: /* @__PURE__ */ e("span", { role: "alert", "aria-labelledby": v, children: /* @__PURE__ */ e("p", { className: "whitespace-pre-wrap break-all text-[12px] leading-[1.55] text-muted-foreground", children: t }) })
4841
4846
  }
4842
4847
  ),
4843
- u && v ? /* @__PURE__ */ e(dc, { debugPayloads: g, className: "mt-2" }) : null,
4848
+ u && I ? /* @__PURE__ */ e(dc, { debugPayloads: g, className: "mt-2" }) : null,
4844
4849
  a ? /* @__PURE__ */ e(
4845
4850
  uc,
4846
4851
  {
@@ -4850,7 +4855,7 @@ function mc({
4850
4855
  copyAriaLabel: "Copy failed query",
4851
4856
  collapsible: !0,
4852
4857
  defaultOpen: m,
4853
- headerClassName: "px-0",
4858
+ headerClassName: x,
4854
4859
  className: U("mt-1", c && "min-h-7 flex-1"),
4855
4860
  bodyClassName: U(
4856
4861
  "max-h-80",
@@ -4869,6 +4874,7 @@ function Wf(t) {
4869
4874
  mc,
4870
4875
  {
4871
4876
  ...s,
4877
+ embedded: !0,
4872
4878
  className: U("overflow-auto", a)
4873
4879
  }
4874
4880
  );
@@ -4960,7 +4966,7 @@ function pc({
4960
4966
  [d, r]
4961
4967
  ), { manifest: w } = In(
4962
4968
  ((Ct = x == null ? void 0 : x.customCardPreferences) == null ? void 0 : Ct.url) || ""
4963
- ), A = ce(
4969
+ ), O = ce(
4964
4970
  () => {
4965
4971
  var te;
4966
4972
  return (te = w == null ? void 0 : w.visuals) == null ? void 0 : te.find(
@@ -4971,7 +4977,7 @@ function pc({
4971
4977
  );
4972
4978
  },
4973
4979
  [w, (wt = x == null ? void 0 : x.customCardPreferences) == null ? void 0 : wt.componentName]
4974
- ), C = En(x, A), y = ce(
4980
+ ), C = En(x, O), y = ce(
4975
4981
  () => Ha({
4976
4982
  frame: d,
4977
4983
  configCard: x,
@@ -4986,11 +4992,11 @@ function pc({
4986
4992
  }, [y, r]), T = ce(() => !x || C !== "multiple" || M < 0 ? r.type : ta(
4987
4993
  r,
4988
4994
  M,
4989
- A == null ? void 0 : A.slots
4990
- ) ?? r.type, [x, C, M, r, A == null ? void 0 : A.slots]), O = T ?? r.type, S = ce(
4991
- () => O === r.type ? r : { ...r, type: O },
4992
- [r, O]
4993
- ), k = S.type === "table" || S.type === "matrixTable" || S.type === "pivotTable" || S.type === "aggregateTable" || S.type === "detailTable", E = ce(() => T !== r.type ? { ...r, type: T } : r, [r, T]), { data: b, isLoading: R, isFetching: B, errorMessage: f, errorSql: L, pagination: D } = Bt(E), F = !!f, V = O === "matrixTable" && Od(b), $ = Fd({
4995
+ O == null ? void 0 : O.slots
4996
+ ) ?? r.type, [x, C, M, r, O == null ? void 0 : O.slots]), E = T ?? r.type, S = ce(
4997
+ () => E === r.type ? r : { ...r, type: E },
4998
+ [r, E]
4999
+ ), k = S.type === "table" || S.type === "matrixTable" || S.type === "pivotTable" || S.type === "aggregateTable" || S.type === "detailTable", A = ce(() => T !== r.type ? { ...r, type: T } : r, [r, T]), { data: b, isLoading: R, isFetching: B, errorMessage: f, errorSql: L, pagination: D } = Bt(A), F = !!f, V = E === "matrixTable" && Od(b), $ = Fd({
4994
5000
  data: b,
4995
5001
  isLoading: R,
4996
5002
  isFetching: B
@@ -5005,7 +5011,7 @@ function pc({
5005
5011
  }), fe = Xe.sql, je = Xe.python, Fe = b == null ? void 0 : b.records, ze = ce(
5006
5012
  () => ({
5007
5013
  id: De,
5008
- type: O,
5014
+ type: E,
5009
5015
  config: _e,
5010
5016
  interactionConfig: tt,
5011
5017
  preferences: Qe,
@@ -5017,7 +5023,7 @@ function pc({
5017
5023
  }),
5018
5024
  [
5019
5025
  De,
5020
- O,
5026
+ E,
5021
5027
  _e,
5022
5028
  tt,
5023
5029
  Qe,
@@ -5027,12 +5033,12 @@ function pc({
5027
5033
  je
5028
5034
  ]
5029
5035
  ), G = ce(
5030
- () => O === "pivotTable" ? Rd({
5036
+ () => E === "pivotTable" ? Rd({
5031
5037
  data: b,
5032
5038
  card: S,
5033
5039
  isPending: R || B
5034
5040
  }) : { kind: "not_loaded" },
5035
- [S, O, b, B, R]
5041
+ [S, E, b, B, R]
5036
5042
  ), Ce = Pd(
5037
5043
  S,
5038
5044
  G,
@@ -5071,7 +5077,7 @@ function pc({
5071
5077
  return !De || !Fe ? null : ro({
5072
5078
  card: ze,
5073
5079
  data: Fe,
5074
- cardType: O,
5080
+ cardType: E,
5075
5081
  queryConfig: Ze,
5076
5082
  // cfg: card.cfg,
5077
5083
  customCfg: $e,
@@ -5094,7 +5100,7 @@ function pc({
5094
5100
  b == null ? void 0 : b.columns,
5095
5101
  b == null ? void 0 : b.columnKeyMap,
5096
5102
  (pe = b == null ? void 0 : b.metadata) == null ? void 0 : pe.comparisonMetadata,
5097
- O,
5103
+ E,
5098
5104
  ge,
5099
5105
  Me
5100
5106
  ]);
@@ -5103,7 +5109,7 @@ function pc({
5103
5109
  }
5104
5110
  function Ge() {
5105
5111
  var te;
5106
- if (b != null && b.records && (b == null ? void 0 : b.records.length) === 0 && !R && !B && !V && O !== "pivotTable")
5112
+ if (b != null && b.records && (b == null ? void 0 : b.records.length) === 0 && !R && !B && !V && E !== "pivotTable")
5107
5113
  return f ? /* @__PURE__ */ e("div", { className: "flex h-full flex-col items-start justify-start overflow-auto", children: /* @__PURE__ */ e(
5108
5114
  Os,
5109
5115
  {
@@ -5119,9 +5125,9 @@ function pc({
5119
5125
  /* @__PURE__ */ e("p", { className: "text-[12px] text-muted-foreground", children: "No results to display" })
5120
5126
  ] });
5121
5127
  if ((R || B) && (!(b != null && b.records) || b.records.length === 0) && !V)
5122
- return O === "table" || O === "detailTable" ? /* @__PURE__ */ e("div", { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: /* @__PURE__ */ e($d, {}) }) : /* @__PURE__ */ e("div", { className: "z-50 flex h-full items-center justify-center", children: /* @__PURE__ */ e(tn, { size: "md", color: "muted", "aria-label": "Loading data" }) });
5128
+ return E === "table" || E === "detailTable" ? /* @__PURE__ */ e("div", { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: /* @__PURE__ */ e($d, {}) }) : /* @__PURE__ */ e("div", { className: "z-50 flex h-full items-center justify-center", children: /* @__PURE__ */ e(tn, { size: "md", color: "muted", "aria-label": "Loading data" }) });
5123
5129
  if (!S.id) return null;
5124
- if (O === "custom")
5130
+ if (E === "custom")
5125
5131
  return ie(r);
5126
5132
  if (![
5127
5133
  "table",
@@ -5130,14 +5136,14 @@ function pc({
5130
5136
  "aggregateTable",
5131
5137
  "detailTable",
5132
5138
  "custom"
5133
- ].includes(O) && Je)
5139
+ ].includes(E) && Je)
5134
5140
  return /* @__PURE__ */ e("div", { className: "relative h-full min-h-0 w-full flex-1 grow basis-0", children: R || B ? /* @__PURE__ */ e(we, {}) : /* @__PURE__ */ e(
5135
5141
  zd,
5136
5142
  {
5137
5143
  cfg: Je
5138
5144
  }
5139
5145
  ) });
5140
- if (O === "table" || O === "detailTable")
5146
+ if (E === "table" || E === "detailTable")
5141
5147
  return /* @__PURE__ */ e("div", { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: /* @__PURE__ */ e(
5142
5148
  Oa,
5143
5149
  {
@@ -5153,7 +5159,7 @@ function pc({
5153
5159
  isLoading: R || B
5154
5160
  }
5155
5161
  ) });
5156
- if (O === "matrixTable")
5162
+ if (E === "matrixTable")
5157
5163
  return /* @__PURE__ */ e("div", { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: /* @__PURE__ */ e(
5158
5164
  jd,
5159
5165
  {
@@ -5162,7 +5168,7 @@ function pc({
5162
5168
  isLoading: $
5163
5169
  }
5164
5170
  ) });
5165
- if (O === "pivotTable" && Ce)
5171
+ if (E === "pivotTable" && Ce)
5166
5172
  return /* @__PURE__ */ e("div", { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: /* @__PURE__ */ e(
5167
5173
  qd,
5168
5174
  {
@@ -5185,7 +5191,7 @@ function pc({
5185
5191
  }
5186
5192
  }
5187
5193
  ) });
5188
- if (O === "aggregateTable")
5194
+ if (E === "aggregateTable")
5189
5195
  return /* @__PURE__ */ e("div", { className: "relative mb-2 flex h-full min-h-0 w-full flex-1 grow basis-0", children: /* @__PURE__ */ e(
5190
5196
  Ud,
5191
5197
  {
@@ -5456,9 +5462,9 @@ function ag({
5456
5462
  className: a,
5457
5463
  label: s = "Customize Visual"
5458
5464
  } = {}) {
5459
- const [r, c] = K(!1), [l, i] = K(""), [o, d] = K(""), [u, m] = K(""), [g, p] = K(""), h = P((k) => k.card), v = Ot(), I = P((k) => k.card.customCfg), N = I ? JSON.stringify(I, null, 2) : "", x = ce(() => v !== h.type ? { ...h, type: v } : h, [h, v]), { data: w } = Bt(x), { data: A } = kr(h), C = so(h, w == null ? void 0 : w.records), { setCardCustomCfg: y, setCustomVisualCode: M } = Se(), T = () => {
5460
- var E, b, R;
5461
- if (!((E = w == null ? void 0 : w.records) != null && E.length)) return;
5465
+ const [r, c] = K(!1), [l, i] = K(""), [o, d] = K(""), [u, m] = K(""), [g, p] = K(""), h = P((k) => k.card), v = Ot(), I = P((k) => k.card.customCfg), N = I ? JSON.stringify(I, null, 2) : "", x = ce(() => v !== h.type ? { ...h, type: v } : h, [h, v]), { data: w } = Bt(x), { data: O } = kr(h), C = so(h, w == null ? void 0 : w.records), { setCardCustomCfg: y, setCustomVisualCode: M } = Se(), T = () => {
5466
+ var A, b, R;
5467
+ if (!((A = w == null ? void 0 : w.records) != null && A.length)) return;
5462
5468
  const k = ro({
5463
5469
  card: h,
5464
5470
  data: w.records,
@@ -5466,7 +5472,7 @@ function ag({
5466
5472
  queryConfig: h.queryConfig,
5467
5473
  //cfg: card.cfg,
5468
5474
  preferences: h.preferences,
5469
- topoJson: A,
5475
+ topoJson: O,
5470
5476
  comparisonMetadata: (b = w == null ? void 0 : w.metadata) == null ? void 0 : b.comparisonMetadata,
5471
5477
  numericPresentation: C,
5472
5478
  resultColumns: w == null ? void 0 : w.columns,
@@ -5477,16 +5483,16 @@ function ag({
5477
5483
  const B = Qd(k, I);
5478
5484
  d(Ni(B));
5479
5485
  }
5480
- }, O = () => {
5486
+ }, E = () => {
5481
5487
  try {
5482
5488
  if (u && M(u), o) {
5483
5489
  const k = JSON.parse(
5484
5490
  o
5485
- ), E = Wd(
5491
+ ), A = Wd(
5486
5492
  JSON.parse(l),
5487
5493
  k
5488
5494
  );
5489
- y(E), p("");
5495
+ y(A), p("");
5490
5496
  }
5491
5497
  } catch {
5492
5498
  p("Invalid JSON configuration");
@@ -5543,7 +5549,7 @@ function ag({
5543
5549
  onReset: () => {
5544
5550
  d(l), y(null);
5545
5551
  },
5546
- onApply: O,
5552
+ onApply: E,
5547
5553
  onClose: () => c(!1)
5548
5554
  }
5549
5555
  )
@@ -5710,67 +5716,67 @@ function og(t) {
5710
5716
  }
5711
5717
  function gc({ onChartSelect: t, onClose: a }) {
5712
5718
  const [s, r] = K(""), { starredCharts: c, isStarred: l, toggleStar: i } = Er(), { data: o = [], isLoading: d } = Ar(), { setCardType: u, setCardPreferences: m, setIsDevMode: g } = P(
5713
- (E) => E.actions
5714
- ), p = P((E) => E.card), h = P((E) => E.isDevMode), {
5719
+ (A) => A.actions
5720
+ ), p = P((A) => A.card), h = P((A) => A.isDevMode), {
5715
5721
  setCardCustomCfg: v,
5716
5722
  setCustomCardPreferences: I,
5717
5723
  setVisualizationMode: N,
5718
5724
  setQueryConfig: x,
5719
5725
  replaceFrameCards: w,
5720
- clearModeDrafts: A,
5726
+ clearModeDrafts: O,
5721
5727
  initializeModeDrafts: C
5722
5728
  } = Se(), y = ce(() => {
5723
- const E = og({ isDevMode: h });
5724
- if (!s) return E;
5729
+ const A = og({ isDevMode: h });
5730
+ if (!s) return A;
5725
5731
  const b = s.toLowerCase();
5726
- return E.filter(
5732
+ return A.filter(
5727
5733
  (R) => R.name.toLowerCase().includes(b)
5728
5734
  );
5729
5735
  }, [h, s]), M = ce(() => {
5730
- const E = o.filter(
5736
+ const A = o.filter(
5731
5737
  (R) => R.componentType === "chart" && R.pluginType !== "standard"
5732
5738
  );
5733
- if (!s) return E;
5739
+ if (!s) return A;
5734
5740
  const b = s.toLowerCase();
5735
- return E.filter(
5741
+ return A.filter(
5736
5742
  (R) => R.name.toLowerCase().includes(b)
5737
5743
  );
5738
- }, [o, s]), T = (E) => {
5739
- v(null), m({}), N("builtin"), u(E), ["custom", "text", "map"].includes(E) && (g(!0), x(void 0)), t == null || t(E), a == null || a();
5740
- }, O = (E) => {
5744
+ }, [o, s]), T = (A) => {
5745
+ v(null), m({}), N("builtin"), u(A), ["custom", "text", "map"].includes(A) && (g(!0), x(void 0)), t == null || t(A), a == null || a();
5746
+ }, E = (A) => {
5741
5747
  v(null), m({}), N("builtin"), x(void 0);
5742
- const b = Jo(E);
5743
- if (b === "multiple" && E.slots && E.slots.length > 0) {
5744
- A();
5745
- const B = Xo(E.slots, E, p);
5748
+ const b = Jo(A);
5749
+ if (b === "multiple" && A.slots && A.slots.length > 0) {
5750
+ O();
5751
+ const B = Xo(A.slots, A, p);
5746
5752
  w(B), B[0] && C(B[0]), a == null || a();
5747
5753
  return;
5748
5754
  } else
5749
5755
  u("custom"), I({
5750
5756
  type: "component",
5751
5757
  visualType: b,
5752
- url: E.url,
5753
- componentName: E.name,
5754
- icon: E.icon,
5755
- pluginChartType: E.chartType,
5756
- minInputs: E.minInputs,
5757
- maxInputs: E.maxInputs
5758
+ url: A.url,
5759
+ componentName: A.name,
5760
+ icon: A.icon,
5761
+ pluginChartType: A.chartType,
5762
+ minInputs: A.minInputs,
5763
+ maxInputs: A.maxInputs
5758
5764
  });
5759
- t == null || t("custom", E), a == null || a();
5760
- }, S = (E) => {
5765
+ t == null || t("custom", A), a == null || a();
5766
+ }, S = (A) => {
5761
5767
  const b = {
5762
5768
  type: "default",
5763
- id: E.id,
5764
- name: E.name
5769
+ id: A.id,
5770
+ name: A.name
5765
5771
  };
5766
5772
  i(b);
5767
- }, k = (E) => {
5773
+ }, k = (A) => {
5768
5774
  const b = {
5769
5775
  type: "custom",
5770
- id: E.name,
5771
- url: E.url,
5772
- icon: E.icon,
5773
- name: E.name
5776
+ id: A.name,
5777
+ url: A.url,
5778
+ icon: A.icon,
5779
+ name: A.name
5774
5780
  };
5775
5781
  i(b);
5776
5782
  };
@@ -5783,40 +5789,40 @@ function gc({ onChartSelect: t, onClose: a }) {
5783
5789
  type: "text",
5784
5790
  placeholder: "Search charts",
5785
5791
  value: s,
5786
- onChange: (E) => r(E.target.value),
5792
+ onChange: (A) => r(A.target.value),
5787
5793
  className: "h-full w-full bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground focus:outline-none"
5788
5794
  }
5789
5795
  )
5790
5796
  ] }),
5791
5797
  /* @__PURE__ */ n("div", { className: "max-h-[360px] overflow-y-auto pr-1", children: [
5792
- y.length > 0 && /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1.5", children: y.map((E) => /* @__PURE__ */ e(
5798
+ y.length > 0 && /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1.5", children: y.map((A) => /* @__PURE__ */ e(
5793
5799
  Ci,
5794
5800
  {
5795
- chartType: E.id,
5796
- chartName: E.name,
5801
+ chartType: A.id,
5802
+ chartName: A.name,
5797
5803
  isCustom: !1,
5798
- isStarred: l("default", E.id),
5799
- onSelect: () => T(E.id),
5800
- onToggleStar: () => S(E)
5804
+ isStarred: l("default", A.id),
5805
+ onSelect: () => T(A.id),
5806
+ onToggleStar: () => S(A)
5801
5807
  },
5802
- E.id
5808
+ A.id
5803
5809
  )) }),
5804
5810
  M.length > 0 && /* @__PURE__ */ n(we, { children: [
5805
5811
  y.length > 0 && /* @__PURE__ */ n("div", { className: "my-3 flex items-center gap-1.5", children: [
5806
5812
  /* @__PURE__ */ e("span", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Custom charts" }),
5807
5813
  /* @__PURE__ */ e("span", { className: "font-mono text-[10px] tabular-nums text-muted-foreground/70", children: M.length })
5808
5814
  ] }),
5809
- /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1.5", children: M.map((E, b) => /* @__PURE__ */ e(
5815
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-1.5", children: M.map((A, b) => /* @__PURE__ */ e(
5810
5816
  Ci,
5811
5817
  {
5812
- chartName: E.name,
5818
+ chartName: A.name,
5813
5819
  isCustom: !0,
5814
- pluginName: E.pluginName,
5815
- isStarred: l("custom", E.name),
5816
- onSelect: () => O(E),
5817
- onToggleStar: () => k(E)
5820
+ pluginName: A.pluginName,
5821
+ isStarred: l("custom", A.name),
5822
+ onSelect: () => E(A),
5823
+ onToggleStar: () => k(A)
5818
5824
  },
5819
- `${E.url}-${E.name}-${b}`
5825
+ `${A.url}-${A.name}-${b}`
5820
5826
  )) })
5821
5827
  ] }),
5822
5828
  d && /* @__PURE__ */ e("div", { className: "mt-3 py-4 text-center text-[11px] text-muted-foreground", children: "Loading custom charts…" }),
@@ -5828,7 +5834,7 @@ function cg({
5828
5834
  selectedChart: t,
5829
5835
  onChartChange: a
5830
5836
  }) {
5831
- var M, T, O, S;
5837
+ var M, T, E, S;
5832
5838
  const s = P((k) => k.card), r = P((k) => k.frame), c = P((k) => k.isDevMode), {
5833
5839
  replaceFrameCards: l,
5834
5840
  clearModeDrafts: i,
@@ -5843,25 +5849,25 @@ function cg({
5843
5849
  () => {
5844
5850
  var k;
5845
5851
  return (k = m == null ? void 0 : m.visuals) == null ? void 0 : k.find(
5846
- (E) => {
5852
+ (A) => {
5847
5853
  var b;
5848
- return E.name === ((b = u == null ? void 0 : u.customCardPreferences) == null ? void 0 : b.componentName);
5854
+ return A.name === ((b = u == null ? void 0 : u.customCardPreferences) == null ? void 0 : b.componentName);
5849
5855
  }
5850
5856
  );
5851
5857
  },
5852
5858
  [m, (T = u == null ? void 0 : u.customCardPreferences) == null ? void 0 : T.componentName]
5853
- ), p = En(u, g) === "multiple", h = Ot(), v = p ? h : t ?? s.type, I = (O = s == null ? void 0 : s.customCardPreferences) == null ? void 0 : O.componentName, N = (S = u == null ? void 0 : u.customCardPreferences) == null ? void 0 : S.componentName, x = p && !!N, w = ce(() => {
5854
- const k = Kl.find((E) => E.id === v);
5859
+ ), p = En(u, g) === "multiple", h = Ot(), v = p ? h : t ?? s.type, I = (E = s == null ? void 0 : s.customCardPreferences) == null ? void 0 : E.componentName, N = (S = u == null ? void 0 : u.customCardPreferences) == null ? void 0 : S.componentName, x = p && !!N, w = ce(() => {
5860
+ const k = Kl.find((A) => A.id === v);
5855
5861
  return k ? k.label : v === "custom" ? I || "Custom Visual" : "Select chart type";
5856
- }, [v, I]), A = ce(() => {
5857
- const k = Kl.find((E) => E.id === v);
5862
+ }, [v, I]), O = ce(() => {
5863
+ const k = Kl.find((A) => A.id === v);
5858
5864
  if (k) {
5859
- const E = k.icon;
5860
- return /* @__PURE__ */ e(E, { className: "h-4 w-4" });
5865
+ const A = k.icon;
5866
+ return /* @__PURE__ */ e(A, { className: "h-4 w-4" });
5861
5867
  }
5862
5868
  if (v === "custom" && I) {
5863
- const E = mo(I);
5864
- return E || /* @__PURE__ */ e(
5869
+ const A = mo(I);
5870
+ return A || /* @__PURE__ */ e(
5865
5871
  qr,
5866
5872
  {
5867
5873
  chartName: I,
@@ -5875,7 +5881,7 @@ function cg({
5875
5881
  return {
5876
5882
  displayChartType: v,
5877
5883
  displayLabel: w,
5878
- displayIcon: A,
5884
+ displayIcon: O,
5879
5885
  showBadge: x,
5880
5886
  badgeLabel: N,
5881
5887
  isMultiInputContext: p,
@@ -5884,7 +5890,7 @@ function cg({
5884
5890
  },
5885
5891
  handleClearCustomVisual: (k) => {
5886
5892
  k.stopPropagation();
5887
- const E = {
5893
+ const A = {
5888
5894
  ...s,
5889
5895
  type: "bar",
5890
5896
  sql: "",
@@ -5899,7 +5905,7 @@ function cg({
5899
5905
  description: void 0,
5900
5906
  info: void 0
5901
5907
  };
5902
- l([E]), i(), o(E), c && d(!0), a == null || a("bar");
5908
+ l([A]), i(), o(A), c && d(!0), a == null || a("bar");
5903
5909
  }
5904
5910
  };
5905
5911
  }
@@ -6058,7 +6064,7 @@ function ug({
6058
6064
  selectedChart: t,
6059
6065
  onChartChange: a
6060
6066
  }) {
6061
- var A, C;
6067
+ var O, C;
6062
6068
  const [s, r] = K(!1), c = P((y) => y.card), { setCardType: l, setCardPreferences: i } = P(
6063
6069
  (y) => y.actions
6064
6070
  ), {
@@ -6089,7 +6095,7 @@ function ug({
6089
6095
  isCustom: !1
6090
6096
  }))
6091
6097
  ].slice(0, bc);
6092
- }, [h, v, I]), x = t === "custom" && ((A = c == null ? void 0 : c.customCardPreferences) == null ? void 0 : A.componentName);
6098
+ }, [h, v, I]), x = t === "custom" && ((O = c == null ? void 0 : c.customCardPreferences) == null ? void 0 : O.componentName);
6093
6099
  return N.some(
6094
6100
  (y) => {
6095
6101
  var M;
@@ -6113,7 +6119,7 @@ function vc({
6113
6119
  compactMore: s = !1,
6114
6120
  responsiveCompact: r = !1
6115
6121
  }) {
6116
- var O, S;
6122
+ var E, S;
6117
6123
  const [c, l] = K(!1), i = P((k) => k.card), { setCardType: o, setCardPreferences: d } = P(
6118
6124
  (k) => k.actions
6119
6125
  ), {
@@ -6123,11 +6129,11 @@ function vc({
6123
6129
  replaceFrameCards: p,
6124
6130
  clearModeDrafts: h,
6125
6131
  initializeModeDrafts: v
6126
- } = Se(), { starredCharts: I } = Er(), { data: N = [] } = Ar(), x = P((k) => k.isDevMode), w = ((O = i == null ? void 0 : i.customCardPreferences) == null ? void 0 : O.componentName) ?? null, A = ce(() => {
6132
+ } = Se(), { starredCharts: I } = Er(), { data: N = [] } = Ar(), x = P((k) => k.isDevMode), w = ((E = i == null ? void 0 : i.customCardPreferences) == null ? void 0 : E.componentName) ?? null, O = ce(() => {
6127
6133
  const k = I.filter(
6128
6134
  (f) => f.type === "default" ? Ia(f.id, { isDevMode: x }) : N.some((L) => L.name === f.id)
6129
- ), E = new Set(k.map((f) => f.id)), b = xc.filter(
6130
- (f) => !E.has(f.id) && Ia(f.id, { isDevMode: x })
6135
+ ), A = new Set(k.map((f) => f.id)), b = xc.filter(
6136
+ (f) => !A.has(f.id) && Ia(f.id, { isDevMode: x })
6131
6137
  ), R = [
6132
6138
  ...k.map((f) => ({
6133
6139
  id: f.id,
@@ -6172,15 +6178,15 @@ function vc({
6172
6178
  x
6173
6179
  ]), C = t === "custom" && w, y = (k) => {
6174
6180
  if (k.isCustom) {
6175
- const E = N.find((B) => B.name === k.id);
6176
- if (!E) return;
6181
+ const A = N.find((B) => B.name === k.id);
6182
+ if (!A) return;
6177
6183
  u(null), d({}), g(void 0);
6178
- const b = Jo(E);
6179
- if (b === "multiple" && E.slots && E.slots.length > 0) {
6184
+ const b = Jo(A);
6185
+ if (b === "multiple" && A.slots && A.slots.length > 0) {
6180
6186
  h();
6181
6187
  const B = Xo(
6182
- E.slots,
6183
- E,
6188
+ A.slots,
6189
+ A,
6184
6190
  i
6185
6191
  );
6186
6192
  p(B), B[0] && v(B[0]);
@@ -6189,26 +6195,26 @@ function vc({
6189
6195
  o("custom"), m({
6190
6196
  type: "component",
6191
6197
  visualType: b,
6192
- url: E.url,
6193
- componentName: E.name,
6194
- icon: E.icon,
6195
- pluginChartType: E.chartType,
6196
- minInputs: E.minInputs,
6197
- maxInputs: E.maxInputs
6198
+ url: A.url,
6199
+ componentName: A.name,
6200
+ icon: A.icon,
6201
+ pluginChartType: A.chartType,
6202
+ minInputs: A.minInputs,
6203
+ maxInputs: A.maxInputs
6198
6204
  }), a("custom");
6199
6205
  return;
6200
6206
  }
6201
6207
  a(k.id);
6202
- }, M = A.some(
6208
+ }, M = O.some(
6203
6209
  (k) => {
6204
- var E;
6205
- return k.isCustom ? C && ((E = i == null ? void 0 : i.customCardPreferences) == null ? void 0 : E.componentName) === k.id : t === k.id;
6210
+ var A;
6211
+ return k.isCustom ? C && ((A = i == null ? void 0 : i.customCardPreferences) == null ? void 0 : A.componentName) === k.id : t === k.id;
6206
6212
  }
6207
6213
  ), T = M ? "More" : t === "custom" ? ((S = i == null ? void 0 : i.customCardPreferences) == null ? void 0 : S.componentName) || "Custom" : Ea[t] || "More";
6208
6214
  return /* @__PURE__ */ e("div", { className: "flex items-center", children: /* @__PURE__ */ n("div", { className: "inline-flex h-7 items-center overflow-hidden rounded-control border border-input bg-background", children: [
6209
- A.map((k) => {
6215
+ O.map((k) => {
6210
6216
  var R;
6211
- const E = k.icon, b = k.isCustom ? C && ((R = i == null ? void 0 : i.customCardPreferences) == null ? void 0 : R.componentName) === k.id : t === k.id;
6217
+ const A = k.icon, b = k.isCustom ? C && ((R = i == null ? void 0 : i.customCardPreferences) == null ? void 0 : R.componentName) === k.id : t === k.id;
6212
6218
  return /* @__PURE__ */ n(
6213
6219
  Dt,
6214
6220
  {
@@ -6226,7 +6232,7 @@ function vc({
6226
6232
  b && "bg-foreground/[0.08] font-medium text-foreground"
6227
6233
  ),
6228
6234
  children: [
6229
- E ? /* @__PURE__ */ e(E, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(
6235
+ A ? /* @__PURE__ */ e(A, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(
6230
6236
  qr,
6231
6237
  {
6232
6238
  chartName: k.label,
@@ -6358,18 +6364,18 @@ function Kr({
6358
6364
  triggerVariant: a = "icon",
6359
6365
  label: s = "Display Options"
6360
6366
  }) {
6361
- var I, N, x, w, A, C, y, M, T, O;
6362
- const r = P((S) => S.card), { setCardPreferences: c, updateCardInFrame: l, setCard: i } = Se(), [o, d] = K(!1), u = ((N = (I = r.preferences) == null ? void 0 : I.displayOptions) == null ? void 0 : N.showFilterInfo) ?? !0, m = ((w = (x = r.preferences) == null ? void 0 : x.displayOptions) == null ? void 0 : w.showCardToolbar) ?? !0, g = ((C = (A = r.preferences) == null ? void 0 : A.displayOptions) == null ? void 0 : C.showChrome) ?? !0, p = ((M = (y = r.preferences) == null ? void 0 : y.displayOptions) == null ? void 0 : M.allowScroll) ?? !0, h = ((O = (T = r.preferences) == null ? void 0 : T.displayOptions) == null ? void 0 : O.showInlineFilterBar) ?? !0, v = (S, k) => {
6367
+ var I, N, x, w, O, C, y, M, T, E;
6368
+ const r = P((S) => S.card), { setCardPreferences: c, updateCardInFrame: l, setCard: i } = Se(), [o, d] = K(!1), u = ((N = (I = r.preferences) == null ? void 0 : I.displayOptions) == null ? void 0 : N.showFilterInfo) ?? !0, m = ((w = (x = r.preferences) == null ? void 0 : x.displayOptions) == null ? void 0 : w.showCardToolbar) ?? !0, g = ((C = (O = r.preferences) == null ? void 0 : O.displayOptions) == null ? void 0 : C.showChrome) ?? !0, p = ((M = (y = r.preferences) == null ? void 0 : y.displayOptions) == null ? void 0 : M.allowScroll) ?? !0, h = ((E = (T = r.preferences) == null ? void 0 : T.displayOptions) == null ? void 0 : E.showInlineFilterBar) ?? !0, v = (S, k) => {
6363
6369
  var R;
6364
- const E = {
6370
+ const A = {
6365
6371
  ...r.preferences,
6366
6372
  displayOptions: {
6367
6373
  ...(R = r.preferences) == null ? void 0 : R.displayOptions,
6368
6374
  [S]: k
6369
6375
  }
6370
6376
  };
6371
- c(E);
6372
- const b = { ...r, preferences: E };
6377
+ c(A);
6378
+ const b = { ...r, preferences: A };
6373
6379
  i(b), l(b);
6374
6380
  };
6375
6381
  return /* @__PURE__ */ e("div", { className: U("flex items-center", t), children: /* @__PURE__ */ n(ia, { modal: !1, open: o, onOpenChange: d, children: [
@@ -6494,7 +6500,7 @@ function Ur({
6494
6500
  (F) => mu(F, y)
6495
6501
  ))
6496
6502
  return;
6497
- const S = y.qualifiedFieldName ? y.qualifiedFieldName.split(".").slice(0, -1).join(".") : y.qualifiedEntityName || y.entityName, k = hu(y), E = pu(l == null ? void 0 : l.dataSource, {
6503
+ const S = y.qualifiedFieldName ? y.qualifiedFieldName.split(".").slice(0, -1).join(".") : y.qualifiedEntityName || y.entityName, k = hu(y), A = pu(l == null ? void 0 : l.dataSource, {
6498
6504
  connectionId: i || ((L = l == null ? void 0 : l.dataSource) == null ? void 0 : L.connectionId),
6499
6505
  connectionType: (D = l == null ? void 0 : l.dataSource) == null ? void 0 : D.connectionType
6500
6506
  }), b = {
@@ -6509,7 +6515,7 @@ function Ur({
6509
6515
  operation: "in",
6510
6516
  sql: "",
6511
6517
  fieldMeta: k,
6512
- semanticContext: E,
6518
+ semanticContext: A,
6513
6519
  width: 250
6514
6520
  // Default width for inline filters
6515
6521
  };
@@ -6527,14 +6533,14 @@ function Ur({
6527
6533
  }
6528
6534
  function w(y, M) {
6529
6535
  const T = v.map(
6530
- (E) => E.id === y ? { ...E, ...M } : E
6536
+ (A) => A.id === y ? { ...A, ...M } : A
6531
6537
  );
6532
6538
  if (d({
6533
6539
  ...l,
6534
6540
  inlineFilters: T
6535
6541
  }), !(Object.prototype.hasOwnProperty.call(M, "defaultValues") || Object.prototype.hasOwnProperty.call(M, "defaultDateFilter")))
6536
6542
  return;
6537
- const S = T.find((E) => E.id === y);
6543
+ const S = T.find((A) => A.id === y);
6538
6544
  if (!S)
6539
6545
  return;
6540
6546
  const k = Ah(
@@ -6744,70 +6750,70 @@ function bg({
6744
6750
  sql: t.sql,
6745
6751
  controlBindings: t.controlBindings
6746
6752
  }), g = Oh(t), p = new Set(
6747
- s.map((A) => bs(A.controlId, A.target))
6753
+ s.map((O) => bs(O.controlId, O.target))
6748
6754
  ), h = o.some(
6749
- (A) => zo({
6755
+ (O) => zo({
6750
6756
  card: t,
6751
- control: A
6757
+ control: O
6752
6758
  }).some(
6753
- (C) => !p.has(bs(A.id, C.value))
6759
+ (C) => !p.has(bs(O.id, C.value))
6754
6760
  )
6755
- ), v = i ? 0 : s.reduce((A, C) => {
6761
+ ), v = i ? 0 : s.reduce((O, C) => {
6756
6762
  const y = I(C.target), M = Object.values(C.mapping).filter((T) => {
6757
- const O = C.target === "config_metric_selector" || C.target === "config_field_selector" ? typeof T == "string" ? T : T == null ? void 0 : T.id : typeof T == "string" ? T : void 0;
6758
- return typeof O == "string" && !y.some((S) => S.value === O);
6763
+ const E = C.target === "config_metric_selector" || C.target === "config_field_selector" ? typeof T == "string" ? T : T == null ? void 0 : T.id : typeof T == "string" ? T : void 0;
6764
+ return typeof E == "string" && !y.some((S) => S.value === E);
6759
6765
  }).length;
6760
- return A + M;
6766
+ return O + M;
6761
6767
  }, 0);
6762
- function I(A) {
6768
+ function I(O) {
6763
6769
  var C, y, M, T;
6764
- switch (A) {
6770
+ switch (O) {
6765
6771
  case "config_metric_selector":
6766
- return l ? l.filter((O) => !!O.target).map((O) => ({
6767
- value: O.target.id,
6768
- label: O.target.label || O.option.label,
6769
- target: O.target
6770
- })) : ((y = (C = t.config) == null ? void 0 : C.metricColumns) == null ? void 0 : y.map((O) => ({
6771
- value: O.id,
6772
- label: O.label || O.id,
6773
- target: O
6772
+ return l ? l.filter((E) => !!E.target).map((E) => ({
6773
+ value: E.target.id,
6774
+ label: E.target.label || E.option.label,
6775
+ target: E.target
6776
+ })) : ((y = (C = t.config) == null ? void 0 : C.metricColumns) == null ? void 0 : y.map((E) => ({
6777
+ value: E.id,
6778
+ label: E.label || E.id,
6779
+ target: E
6774
6780
  }))) || [];
6775
6781
  case "config_field_selector":
6776
- return c ? c.filter((O) => !!O.target).map((O) => ({
6777
- value: O.target.id,
6778
- label: O.target.label || O.option.label,
6779
- target: O.target
6780
- })) : ((T = (M = t.config) == null ? void 0 : M.groupByColumns) == null ? void 0 : T.map((O) => ({
6781
- value: O.id,
6782
- label: O.label || O.id,
6783
- target: O
6782
+ return c ? c.filter((E) => !!E.target).map((E) => ({
6783
+ value: E.target.id,
6784
+ label: E.target.label || E.option.label,
6785
+ target: E.target
6786
+ })) : ((T = (M = t.config) == null ? void 0 : M.groupByColumns) == null ? void 0 : T.map((E) => ({
6787
+ value: E.id,
6788
+ label: E.label || E.id,
6789
+ target: E
6784
6790
  }))) || [];
6785
6791
  case "config_aggregation":
6786
- return (g.config_aggregation || []).map((O) => ({
6787
- value: O,
6788
- label: O
6792
+ return (g.config_aggregation || []).map((E) => ({
6793
+ value: E,
6794
+ label: E
6789
6795
  }));
6790
6796
  case "config_grain":
6791
- return (g.config_grain || []).map((O) => ({
6792
- value: O,
6793
- label: O.charAt(0).toUpperCase() + O.slice(1)
6797
+ return (g.config_grain || []).map((E) => ({
6798
+ value: E,
6799
+ label: E.charAt(0).toUpperCase() + E.slice(1)
6794
6800
  }));
6795
6801
  default:
6796
6802
  return [];
6797
6803
  }
6798
6804
  }
6799
- const N = (A, C) => {
6805
+ const N = (O, C) => {
6800
6806
  r(
6801
- s.map((y, M) => M !== A ? y : C(y))
6807
+ s.map((y, M) => M !== O ? y : C(y))
6802
6808
  );
6803
- }, x = (A) => {
6804
- r(s.filter((C, y) => y !== A));
6809
+ }, x = (O) => {
6810
+ r(s.filter((C, y) => y !== O));
6805
6811
  }, w = () => {
6806
- const A = xg(t, o, s);
6807
- A && r([...s, A]);
6812
+ const O = xg(t, o, s);
6813
+ O && r([...s, O]);
6808
6814
  };
6809
6815
  if (typeof t.sql == "string" && t.sql.trim().length > 0) {
6810
- const A = m.map(
6816
+ const O = m.map(
6811
6817
  ({ controlId: C, paramId: y }) => {
6812
6818
  const M = o.find(
6813
6819
  (T) => T.id === C
@@ -6825,7 +6831,7 @@ function bg({
6825
6831
  };
6826
6832
  }
6827
6833
  );
6828
- return /* @__PURE__ */ e("div", { className: "space-y-2", children: A.length === 0 ? /* @__PURE__ */ e("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: "This card is currently using raw SQL. Reference a control directly in the SQL editor with syntax like `[[param.metric]]`." }) : A.map((C) => /* @__PURE__ */ e(
6834
+ return /* @__PURE__ */ e("div", { className: "space-y-2", children: O.length === 0 ? /* @__PURE__ */ e("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: "This card is currently using raw SQL. Reference a control directly in the SQL editor with syntax like `[[param.metric]]`." }) : O.map((C) => /* @__PURE__ */ e(
6829
6835
  "div",
6830
6836
  {
6831
6837
  className: "rounded-md border p-3",
@@ -6859,28 +6865,28 @@ function bg({
6859
6865
  " attention before save. Replace each missing target or choose Not mapped."
6860
6866
  ] })
6861
6867
  ] }) : null,
6862
- s.length === 0 ? /* @__PURE__ */ e("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: "This card is not using any controls yet." }) : s.map((A, C) => {
6863
- const y = g[A.target] || [], M = o.find(
6864
- (f) => f.id === A.controlId
6865
- ), T = M ? Fh(M) : null, O = (T == null ? void 0 : T.source.kind) === "manual" ? T.source.options : [], S = I(A.target), k = Array.from(
6868
+ s.length === 0 ? /* @__PURE__ */ e("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: "This card is not using any controls yet." }) : s.map((O, C) => {
6869
+ const y = g[O.target] || [], M = o.find(
6870
+ (f) => f.id === O.controlId
6871
+ ), T = M ? Fh(M) : null, E = (T == null ? void 0 : T.source.kind) === "manual" ? T.source.options : [], S = I(O.target), k = Array.from(
6866
6872
  /* @__PURE__ */ new Set([
6867
- ...O.map((f) => f.value),
6868
- ...Object.keys(A.mapping)
6873
+ ...E.map((f) => f.value),
6874
+ ...Object.keys(O.mapping)
6869
6875
  ])
6870
6876
  ).map((f) => {
6871
- const L = O.find((D) => D.value === f);
6877
+ const L = E.find((D) => D.value === f);
6872
6878
  return {
6873
6879
  value: f,
6874
6880
  label: (L == null ? void 0 : L.label) || f
6875
6881
  };
6876
- }), E = `${A.controlId}-${A.target}-${C}`, b = d[E] ?? C === 0, R = Object.keys(A.mapping).length, B = M != null && M.type ? pg[M.type] || M.type : null;
6882
+ }), A = `${O.controlId}-${O.target}-${C}`, b = d[A] ?? C === 0, R = Object.keys(O.mapping).length, B = M != null && M.type ? pg[M.type] || M.type : null;
6877
6883
  return /* @__PURE__ */ n(
6878
6884
  sn,
6879
6885
  {
6880
6886
  open: b,
6881
6887
  onOpenChange: (f) => u((L) => ({
6882
6888
  ...L,
6883
- [E]: f
6889
+ [A]: f
6884
6890
  })),
6885
6891
  className: "rounded-md border",
6886
6892
  children: [
@@ -6924,7 +6930,7 @@ function bg({
6924
6930
  /* @__PURE__ */ e(ln, { className: "space-y-3 border-t px-3 pb-3 pt-2", children: k.length === 0 ? /* @__PURE__ */ e("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: "Add choices to this control first so you can decide what each choice changes in the card." }) : S.length === 0 ? /* @__PURE__ */ e("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: "No matching targets are available for this binding yet." }) : /* @__PURE__ */ n("div", { className: "space-y-2", children: [
6925
6931
  /* @__PURE__ */ e(_, { className: "text-xs", children: "Map each choice" }),
6926
6932
  /* @__PURE__ */ e("div", { className: "space-y-2", children: k.map((f) => {
6927
- const L = A.mapping[f.value], D = A.target === "config_metric_selector" || A.target === "config_field_selector" ? typeof L == "string" ? L : L == null ? void 0 : L.id : typeof L == "string" ? L : void 0, F = !i && typeof D == "string" && !S.some((Y) => Y.value === D), V = fg(
6933
+ const L = O.mapping[f.value], D = O.target === "config_metric_selector" || O.target === "config_field_selector" ? typeof L == "string" ? L : L == null ? void 0 : L.id : typeof L == "string" ? L : void 0, F = !i && typeof D == "string" && !S.some((Y) => Y.value === D), V = fg(
6928
6934
  L,
6929
6935
  D
6930
6936
  ), $ = D && F ? [
@@ -7006,7 +7012,7 @@ function bg({
7006
7012
  ] })
7007
7013
  ]
7008
7014
  },
7009
- `${A.controlId}-${A.target}-${f.value}`
7015
+ `${O.controlId}-${O.target}-${f.value}`
7010
7016
  );
7011
7017
  }) }),
7012
7018
  y.length > 0 && /* @__PURE__ */ n("p", { className: "text-[11px] text-muted-foreground", children: [
@@ -7016,7 +7022,7 @@ function bg({
7016
7022
  ] }) })
7017
7023
  ]
7018
7024
  },
7019
- E
7025
+ A
7020
7026
  );
7021
7027
  }),
7022
7028
  h ? /* @__PURE__ */ n(ee, { type: "button", variant: "outline", size: "sm", onClick: w, children: [
@@ -7069,17 +7075,17 @@ function Ng({
7069
7075
  bindings: r,
7070
7076
  controls: l,
7071
7077
  ...d
7072
- }), { preferences: m, resolveBoundCurrency: g } = vu(t, s), [p, h] = K(""), [v, I] = K(""), N = o.find((A) => A.key === v), x = !!(p && N) && !r.some(
7073
- (A) => A.presentationTarget && N && xo(A.presentationTarget) === N.key
7074
- ), w = (A) => {
7078
+ }), { preferences: m, resolveBoundCurrency: g } = vu(t, s), [p, h] = K(""), [v, I] = K(""), N = o.find((O) => O.key === v), x = !!(p && N) && !r.some(
7079
+ (O) => O.presentationTarget && N && xo(O.presentationTarget) === N.key
7080
+ ), w = (O) => {
7075
7081
  if (!m)
7076
7082
  return;
7077
7083
  const C = Cu({
7078
7084
  card: t,
7079
- target: A,
7085
+ target: O,
7080
7086
  resultColumnKeys: s,
7081
7087
  valueFormatPreferences: m,
7082
- boundCurrency: g(A)
7088
+ boundCurrency: g(O)
7083
7089
  });
7084
7090
  if (C)
7085
7091
  return Op(1e3, C);
@@ -7089,17 +7095,17 @@ function Ng({
7089
7095
  /* @__PURE__ */ e("h5", { className: "text-xs font-medium", children: "Currency presentation" }),
7090
7096
  /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: "Change only the display currency for an explicit metric or column." })
7091
7097
  ] }),
7092
- r.map((A, C) => /* @__PURE__ */ n(
7098
+ r.map((O, C) => /* @__PURE__ */ n(
7093
7099
  "div",
7094
7100
  {
7095
7101
  className: "flex items-center gap-2 rounded-control border border-border/60 px-2 py-1.5 text-xs",
7096
7102
  children: [
7097
7103
  /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate", children: [
7098
- A.controlId,
7104
+ O.controlId,
7099
7105
  " →",
7100
7106
  " ",
7101
- yg(A.presentationTarget),
7102
- A.presentationTarget ? ` · ${w(A.presentationTarget) ?? "unavailable"}` : null
7107
+ yg(O.presentationTarget),
7108
+ O.presentationTarget ? ` · ${w(O.presentationTarget) ?? "unavailable"}` : null
7103
7109
  ] }),
7104
7110
  /* @__PURE__ */ e(
7105
7111
  ee,
@@ -7112,20 +7118,20 @@ function Ng({
7112
7118
  )
7113
7119
  ]
7114
7120
  },
7115
- `${A.controlId}:${JSON.stringify(A.presentationTarget)}`
7121
+ `${O.controlId}:${JSON.stringify(O.presentationTarget)}`
7116
7122
  )),
7117
- u.length > 0 ? /* @__PURE__ */ e("div", { className: "space-y-1 text-xs text-destructive", children: u.map((A, C) => /* @__PURE__ */ n("p", { children: [
7118
- A.controlId ? `${A.controlId}: ` : "",
7119
- A.code.split("_").join(" ")
7120
- ] }, `${A.controlId || "binding"}:${A.code}:${C}`)) }) : null,
7123
+ u.length > 0 ? /* @__PURE__ */ e("div", { className: "space-y-1 text-xs text-destructive", children: u.map((O, C) => /* @__PURE__ */ n("p", { children: [
7124
+ O.controlId ? `${O.controlId}: ` : "",
7125
+ O.code.split("_").join(" ")
7126
+ ] }, `${O.controlId || "binding"}:${O.code}:${C}`)) }) : null,
7121
7127
  /* @__PURE__ */ n("div", { className: "grid grid-cols-[1fr_1fr_auto] gap-2", children: [
7122
7128
  /* @__PURE__ */ n(ae, { value: p, onValueChange: h, children: [
7123
7129
  /* @__PURE__ */ e(se, { size: "xs", children: /* @__PURE__ */ e(re, { placeholder: "Currency control" }) }),
7124
- /* @__PURE__ */ e(le, { children: i.map((A) => /* @__PURE__ */ e(q, { value: A.id, children: A.label }, A.id)) })
7130
+ /* @__PURE__ */ e(le, { children: i.map((O) => /* @__PURE__ */ e(q, { value: O.id, children: O.label }, O.id)) })
7125
7131
  ] }),
7126
7132
  /* @__PURE__ */ n(ae, { value: v, onValueChange: I, children: [
7127
7133
  /* @__PURE__ */ e(se, { size: "xs", children: /* @__PURE__ */ e(re, { placeholder: "Target" }) }),
7128
- /* @__PURE__ */ e(le, { children: o.map((A) => /* @__PURE__ */ e(q, { value: A.key, children: A.label }, A.key)) })
7134
+ /* @__PURE__ */ e(le, { children: o.map((O) => /* @__PURE__ */ e(q, { value: O.key, children: O.label }, O.key)) })
7129
7135
  ] }),
7130
7136
  /* @__PURE__ */ e(
7131
7137
  ee,
@@ -7171,7 +7177,7 @@ function Gr({
7171
7177
  }, [o == null ? void 0 : o.id, l, I]), Te(() => {
7172
7178
  !l && I !== null && N(null);
7173
7179
  }, [l, I]);
7174
- const x = ce(() => I ? (d == null ? void 0 : d.cards.find((D) => D.id === I)) || ((o == null ? void 0 : o.id) === I ? o : void 0) : o, [o, d == null ? void 0 : d.cards, I]), w = (x == null ? void 0 : x.controls) || [], A = x ? Rh(m, { excludeCardId: x.id }) : p.map((D) => D.id), C = ((x == null ? void 0 : x.controlBindings) || []).filter(
7180
+ const x = ce(() => I ? (d == null ? void 0 : d.cards.find((D) => D.id === I)) || ((o == null ? void 0 : o.id) === I ? o : void 0) : o, [o, d == null ? void 0 : d.cards, I]), w = (x == null ? void 0 : x.controls) || [], O = x ? Rh(m, { excludeCardId: x.id }) : p.map((D) => D.id), C = ((x == null ? void 0 : x.controlBindings) || []).filter(
7175
7181
  wu
7176
7182
  ), y = ((x == null ? void 0 : x.controlBindings) || []).filter(
7177
7183
  Ys
@@ -7186,7 +7192,7 @@ function Gr({
7186
7192
  D
7187
7193
  ])
7188
7194
  )
7189
- }, O = {
7195
+ }, E = {
7190
7196
  choices: Lh(x),
7191
7197
  targetMap: Object.fromEntries(
7192
7198
  (((L = x == null ? void 0 : x.config) == null ? void 0 : L.metricColumns) || []).map((D) => [
@@ -7197,10 +7203,10 @@ function Gr({
7197
7203
  }, S = T.choices.map((D) => ({
7198
7204
  option: D,
7199
7205
  target: T.targetMap[D.value]
7200
- })), k = O.choices.map((D) => ({
7206
+ })), k = E.choices.map((D) => ({
7201
7207
  option: D,
7202
- target: O.targetMap[D.value]
7203
- })), E = (D, F) => {
7208
+ target: E.targetMap[D.value]
7209
+ })), A = (D, F) => {
7204
7210
  if (!x)
7205
7211
  return;
7206
7212
  const V = (F == null ? void 0 : F.type) === "rename" ? ai(x, {
@@ -7307,12 +7313,12 @@ function Gr({
7307
7313
  scope: "card",
7308
7314
  card: x,
7309
7315
  controls: w,
7310
- reservedControlIds: A,
7316
+ reservedControlIds: O,
7311
7317
  usageByControlId: M,
7312
7318
  availableFieldChoices: S,
7313
7319
  availableMetricChoices: k,
7314
7320
  onCreateFlowActiveChange: i,
7315
- onChange: (D, F, V) => E(D, V),
7321
+ onChange: (D, F, V) => A(D, V),
7316
7322
  emptyMessage: "No card-scoped controls yet."
7317
7323
  }
7318
7324
  ),
@@ -7468,14 +7474,14 @@ function Sg({
7468
7474
  var z;
7469
7475
  return Y.name === ((z = s == null ? void 0 : s.customCardPreferences) == null ? void 0 : z.componentName);
7470
7476
  }
7471
- ), N = En(s, v) === "multiple", x = (v == null ? void 0 : v.minInputs) ?? ((F = s == null ? void 0 : s.customCardPreferences) == null ? void 0 : F.minInputs) ?? 1, w = (v == null ? void 0 : v.maxInputs) ?? ((V = s == null ? void 0 : s.customCardPreferences) == null ? void 0 : V.maxInputs), A = ce(
7477
+ ), N = En(s, v) === "multiple", x = (v == null ? void 0 : v.minInputs) ?? ((F = s == null ? void 0 : s.customCardPreferences) == null ? void 0 : F.minInputs) ?? 1, w = (v == null ? void 0 : v.maxInputs) ?? ((V = s == null ? void 0 : s.customCardPreferences) == null ? void 0 : V.maxInputs), O = ce(
7472
7478
  () => Ha({
7473
7479
  frame: r,
7474
7480
  configCard: s,
7475
7481
  isMultiInputVisual: N
7476
7482
  }),
7477
7483
  [r, s, N]
7478
- ), C = N ? A.filter(Boolean).length : r.cards.length, y = i ? !1 : w ? C < w : !0, M = C > Math.max(x || 1, 1), T = !!(($ = s == null ? void 0 : s.customCardPreferences) != null && $.dataInputCardIds), O = (Y, z) => {
7484
+ ), C = N ? O.filter(Boolean).length : r.cards.length, y = i ? !1 : w ? C < w : !0, M = C > Math.max(x || 1, 1), T = !!(($ = s == null ? void 0 : s.customCardPreferences) != null && $.dataInputCardIds), E = (Y, z) => {
7479
7485
  Y.dataTransfer.setData("tabIndex", z.toString());
7480
7486
  }, S = (Y) => {
7481
7487
  Y.preventDefault();
@@ -7485,7 +7491,7 @@ function Sg({
7485
7491
  const J = Array.from(r.cards), [j] = J.splice(parseInt(Q), 1);
7486
7492
  J.splice(z, 0, j), o({ ...r, cards: J });
7487
7493
  };
7488
- function E(Y) {
7494
+ function A(Y) {
7489
7495
  const z = (s == null ? void 0 : s.id) === Y;
7490
7496
  if (!(T && z ? r.cards.length > 1 : M)) return;
7491
7497
  let J = r.cards.filter((ue) => ue.id !== Y);
@@ -7522,7 +7528,7 @@ function Sg({
7522
7528
  ...c.customCardPreferences,
7523
7529
  slotIndex: N ? Math.max(
7524
7530
  -1,
7525
- ...A.map(
7531
+ ...O.map(
7526
7532
  (z, Q) => cn(z, Q)
7527
7533
  )
7528
7534
  ) + 1 : c.customCardPreferences.slotIndex
@@ -7537,7 +7543,7 @@ function Sg({
7537
7543
  let z = N ? "table" : "bar", Q = "Title", J = "";
7538
7544
  const j = N ? Math.max(
7539
7545
  -1,
7540
- ...A.map(
7546
+ ...O.map(
7541
7547
  (ue, xe) => cn(ue, xe)
7542
7548
  )
7543
7549
  ) + 1 : C;
@@ -7615,7 +7621,7 @@ function Sg({
7615
7621
  Ut,
7616
7622
  {
7617
7623
  draggable: !N && !i,
7618
- onDragStart: N || i ? void 0 : (xe) => O(xe, z),
7624
+ onDragStart: N || i ? void 0 : (xe) => E(xe, z),
7619
7625
  onDragOver: N || i ? void 0 : S,
7620
7626
  onDrop: N || i ? void 0 : (xe) => k(xe, z),
7621
7627
  className: U(
@@ -7680,7 +7686,7 @@ function Sg({
7680
7686
  nt,
7681
7687
  {
7682
7688
  className: "h-3 w-3 text-muted-foreground hover:text-foreground",
7683
- onClick: () => E(Y.id)
7689
+ onClick: () => A(Y.id)
7684
7690
  }
7685
7691
  )
7686
7692
  ]
@@ -7734,17 +7740,17 @@ function Bn({
7734
7740
  mergeDraftsIntoCard: h,
7735
7741
  clearModeDrafts: v,
7736
7742
  initializeModeDrafts: I
7737
- } = Se(), [N, x] = K({}), [w, A] = K(
7743
+ } = Se(), [N, x] = K({}), [w, O] = K(
7738
7744
  () => /* @__PURE__ */ new Set()
7739
7745
  ), { authToken: C } = Gn(), y = Yh(C == null ? void 0 : C.accessToken), { compiledAppearance: M } = _h(), T = ce(
7740
7746
  () => ku(M),
7741
7747
  [M]
7742
7748
  ), {
7743
- getCard: O,
7749
+ getCard: E,
7744
7750
  manifest: S,
7745
7751
  isLoading: k
7746
- } = In(((yt = o == null ? void 0 : o.customCardPreferences) == null ? void 0 : yt.url) || ""), E = (at = o == null ? void 0 : o.customCardPreferences) == null ? void 0 : at.componentName, b = E ? O(E) : null, R = (Ct = S == null ? void 0 : S.visuals) == null ? void 0 : Ct.find(
7747
- (pe) => pe.name === E
7752
+ } = In(((yt = o == null ? void 0 : o.customCardPreferences) == null ? void 0 : yt.url) || ""), A = (at = o == null ? void 0 : o.customCardPreferences) == null ? void 0 : at.componentName, b = A ? E(A) : null, R = (Ct = S == null ? void 0 : S.visuals) == null ? void 0 : Ct.find(
7753
+ (pe) => pe.name === A
7748
7754
  ), B = En(o, R), f = l && B === "multiple" && !!o, L = ce(() => Ha({
7749
7755
  frame: r,
7750
7756
  configCard: o,
@@ -7791,7 +7797,7 @@ function Bn({
7791
7797
  []
7792
7798
  ), mt = Ee(
7793
7799
  (pe, te) => {
7794
- A((ke) => {
7800
+ O((ke) => {
7795
7801
  const ve = new Set(ke);
7796
7802
  return te ? ve.add(pe) : ve.delete(pe), ve;
7797
7803
  });
@@ -8061,8 +8067,8 @@ function Nc({
8061
8067
  );
8062
8068
  },
8063
8069
  [l, g, s]
8064
- ), x = !!g, w = h !== g, A = g !== d, C = !h || !v.valid || w || A, y = h ? v.valid ? w ? "Unapplied changes" : "Pending save" : "Needs attention" : "Draft", M = !h || w || A ? "outline" : "destructive", T = h ? v.valid ? w ? "The preview still reflects the last applied code until you apply this draft." : A ? "Preview reflects pending changes. Accept changes to save them." : "" : v.error || "Visual code is invalid." : "Paste visual code or generate one before saving this card.";
8065
- function O() {
8070
+ ), x = !!g, w = h !== g, O = g !== d, C = !h || !v.valid || w || O, y = h ? v.valid ? w ? "Unapplied changes" : "Pending save" : "Needs attention" : "Draft", M = !h || w || O ? "outline" : "destructive", T = h ? v.valid ? w ? "The preview still reflects the last applied code until you apply this draft." : O ? "Preview reflects pending changes. Accept changes to save them." : "" : v.error || "Visual code is invalid." : "Paste visual code or generate one before saving this card.";
8071
+ function E() {
8066
8072
  if (!v.valid) {
8067
8073
  rt.error(v.error || "Visual code is invalid.");
8068
8074
  return;
@@ -8087,7 +8093,7 @@ function Nc({
8087
8093
  g ? "Dynamic visual changes saved." : "Dynamic visual cleared."
8088
8094
  );
8089
8095
  }
8090
- function E() {
8096
+ function A() {
8091
8097
  m(d), p(d), c(!1);
8092
8098
  }
8093
8099
  function b() {
@@ -8123,7 +8129,7 @@ function Nc({
8123
8129
  open: r,
8124
8130
  onOpenChange: (B) => {
8125
8131
  if (!B) {
8126
- E();
8132
+ A();
8127
8133
  return;
8128
8134
  }
8129
8135
  c(!0);
@@ -8210,7 +8216,7 @@ function Nc({
8210
8216
  type: "button",
8211
8217
  size: "sm",
8212
8218
  className: "h-8 gap-1.5 px-3 text-xs",
8213
- onClick: O,
8219
+ onClick: E,
8214
8220
  disabled: !w || !v.valid,
8215
8221
  children: [
8216
8222
  /* @__PURE__ */ e(Cr, { className: "h-3.5 w-3.5 shrink-0" }),
@@ -8262,7 +8268,7 @@ function Nc({
8262
8268
  variant: "outline",
8263
8269
  size: "sm",
8264
8270
  className: "h-8 px-3 text-xs",
8265
- onClick: E,
8271
+ onClick: A,
8266
8272
  children: "Cancel"
8267
8273
  }
8268
8274
  ),
@@ -8273,7 +8279,7 @@ function Nc({
8273
8279
  size: "sm",
8274
8280
  className: "h-8 px-3 text-xs",
8275
8281
  onClick: k,
8276
- disabled: !A,
8282
+ disabled: !O,
8277
8283
  children: "Accept changes"
8278
8284
  }
8279
8285
  )
@@ -8397,7 +8403,7 @@ function Zs({
8397
8403
  var Ct, wt, St, pe, te, ke, ve;
8398
8404
  const o = Qi(), d = P((me) => me.frame), u = P((me) => me.card), m = P((me) => me.isDevMode), g = P((me) => me.editorContext), p = (g == null ? void 0 : g.type) === "documentSection", h = P((me) => me.isShowingVisual), v = P(
8399
8405
  (me) => me.actions.setIsShowingVisual
8400
- ), I = Ne((me) => me.isVisualEditing), { isConsoleMode: N } = Uu(), x = P((me) => me.pythonStdOut), w = P((me) => me.actions.setRunSql), A = Ot(), C = A === "table" || A === "detailTable" || A === "matrixTable", y = u.type === "table" || u.type === "detailTable", T = _r(A) && !!(a != null && a.onOpen), S = ma(u) === "dynamic", [k, E] = K(!1), b = l ?? k, R = i ?? E, {
8406
+ ), I = Ne((me) => me.isVisualEditing), { isConsoleMode: N } = Uu(), x = P((me) => me.pythonStdOut), w = P((me) => me.actions.setRunSql), O = Ot(), C = O === "table" || O === "detailTable" || O === "matrixTable", y = u.type === "table" || u.type === "detailTable", T = _r(O) && !!(a != null && a.onOpen), S = ma(u) === "dynamic", [k, A] = K(!1), b = l ?? k, R = i ?? A, {
8401
8407
  setFrame: B,
8402
8408
  setCard: f,
8403
8409
  setActiveTabCardId: L,
@@ -8409,7 +8415,7 @@ function Zs({
8409
8415
  updatePageSize: Y,
8410
8416
  updateCardInFrame: z,
8411
8417
  setCardType: Q
8412
- } = Se(), J = ce(() => A !== u.type ? { ...u, type: A } : u, [u, A]), {
8418
+ } = Se(), J = ce(() => O !== u.type ? { ...u, type: O } : u, [u, O]), {
8413
8419
  data: j,
8414
8420
  isLoading: X,
8415
8421
  isFetching: W,
@@ -9286,7 +9292,7 @@ function Sc() {
9286
9292
  };
9287
9293
  }),
9288
9294
  [x, m == null ? void 0 : m.slots]
9289
- ), A = ce(
9295
+ ), O = ce(
9290
9296
  () => Eg({
9291
9297
  slots: m == null ? void 0 : m.slots,
9292
9298
  cards: w,
@@ -9314,7 +9320,7 @@ function Sc() {
9314
9320
  return f ? (Array.isArray(f) ? f : [f]).join(", ") : null;
9315
9321
  }
9316
9322
  function T(f, L, D = [], F = "", V, $, Y) {
9317
- const z = O({
9323
+ const z = E({
9318
9324
  key: L,
9319
9325
  defaultValue: F,
9320
9326
  settingsValue: $,
@@ -9359,7 +9365,7 @@ function Sc() {
9359
9365
  }
9360
9366
  ) : null;
9361
9367
  }
9362
- function O({
9368
+ function E({
9363
9369
  key: f,
9364
9370
  defaultValue: L,
9365
9371
  settingsValue: D,
@@ -9414,7 +9420,7 @@ function Sc() {
9414
9420
  })
9415
9421
  ] });
9416
9422
  }
9417
- function E() {
9423
+ function A() {
9418
9424
  return /* @__PURE__ */ n(we, { children: [
9419
9425
  p && /* @__PURE__ */ n("div", { className: "space-y-3", children: [
9420
9426
  /* @__PURE__ */ e(_, { children: "Slot Guide" }),
@@ -9441,7 +9447,7 @@ function Sc() {
9441
9447
  ] })
9442
9448
  ] }) })
9443
9449
  ] }),
9444
- p && A.length > 0 && /* @__PURE__ */ e(Co, { className: "mt-3 border-yellow-500/40 bg-yellow-500/10 text-yellow-900 dark:text-yellow-100", children: /* @__PURE__ */ e(wo, { children: /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs", children: A.map((f, L) => /* @__PURE__ */ e("li", { children: f.message }, `${f.type}-${L}`)) }) }) }),
9450
+ p && O.length > 0 && /* @__PURE__ */ e(Co, { className: "mt-3 border-yellow-500/40 bg-yellow-500/10 text-yellow-900 dark:text-yellow-100", children: /* @__PURE__ */ e(wo, { children: /* @__PURE__ */ e("ul", { className: "list-disc space-y-1 pl-4 text-xs", children: O.map((f, L) => /* @__PURE__ */ e("li", { children: f.message }, `${f.type}-${L}`)) }) }) }),
9445
9451
  m && !p && m.settings && /* @__PURE__ */ e("div", { className: "space-y-3", children: /* @__PURE__ */ e("div", { className: "px-2", children: k({
9446
9452
  settingsSchema: m.settings,
9447
9453
  settingsField: "settings",
@@ -9584,7 +9590,7 @@ function Sc() {
9584
9590
  )
9585
9591
  ] })
9586
9592
  ] }) }),
9587
- /* @__PURE__ */ e(ut, { children: E() })
9593
+ /* @__PURE__ */ e(ut, { children: A() })
9588
9594
  ] })
9589
9595
  ]
9590
9596
  }
@@ -9777,7 +9783,7 @@ function Qa({
9777
9783
  reportDefaults: l,
9778
9784
  showAutoFormat: i = !0
9779
9785
  }) {
9780
- var k, E;
9786
+ var k, A;
9781
9787
  const o = t.type || "auto", d = Fg(t, {
9782
9788
  preserveSparseCurrency: !!l
9783
9789
  }), u = (b) => {
@@ -9792,7 +9798,7 @@ function Qa({
9792
9798
  p
9793
9799
  ) : void 0, I = g ?? v ?? vs(o), N = o === "currency" && d.decimalPlaces === void 0 && d.minimumFractionDigits === void 0 && d.maximumFractionDigits === void 0, [x, w] = K(
9794
9800
  () => String(I)
9795
- ), [A, C] = K(
9801
+ ), [O, C] = K(
9796
9802
  () => d.multiplyBy !== void 0 ? String(d.multiplyBy) : ""
9797
9803
  ), y = (b) => {
9798
9804
  const R = Tc(
@@ -9810,7 +9816,7 @@ function Qa({
9810
9816
  b
9811
9817
  ) : kc(d, b), T = ((k = Si.find(
9812
9818
  (b) => b.value === (l == null ? void 0 : l.currency)
9813
- )) == null ? void 0 : k.label) ?? (l == null ? void 0 : l.currency), O = ((E = Ti.find((b) => b.value === (l == null ? void 0 : l.locale))) == null ? void 0 : E.label) ?? (l == null ? void 0 : l.locale), S = o === "number" || o === "currency" || o === "percent" || o === "scientific";
9819
+ )) == null ? void 0 : k.label) ?? (l == null ? void 0 : l.currency), E = ((A = Ti.find((b) => b.value === (l == null ? void 0 : l.locale))) == null ? void 0 : A.label) ?? (l == null ? void 0 : l.locale), S = o === "number" || o === "currency" || o === "percent" || o === "scientific";
9814
9820
  return Te(() => {
9815
9821
  w(String(I));
9816
9822
  }, [I]), Te(() => {
@@ -9975,7 +9981,7 @@ function Qa({
9975
9981
  className: "text-xs",
9976
9982
  children: [
9977
9983
  "Report default — ",
9978
- O
9984
+ E
9979
9985
  ]
9980
9986
  }
9981
9987
  ),
@@ -10043,7 +10049,7 @@ function Qa({
10043
10049
  type: "text",
10044
10050
  inputMode: "decimal",
10045
10051
  placeholder: "100",
10046
- value: A,
10052
+ value: O,
10047
10053
  onClick: u,
10048
10054
  onPointerDown: u,
10049
10055
  onKeyDown: u,
@@ -11041,7 +11047,7 @@ const Gg = [
11041
11047
  value: t
11042
11048
  }));
11043
11049
  function Wg() {
11044
- var d, u, m, g, p, h, v, I, N, x, w, A, C, y, M, T, O, S;
11050
+ var d, u, m, g, p, h, v, I, N, x, w, O, C, y, M, T, E, S;
11045
11051
  const t = P((k) => k.card), a = (u = (d = t == null ? void 0 : t.preferences) == null ? void 0 : d.mapVisualOptions) == null ? void 0 : u.topoJsonUrl, [s, r] = K(
11046
11052
  ((g = (m = t == null ? void 0 : t.preferences) == null ? void 0 : m.mapVisualOptions) == null ? void 0 : g.customTopoJsonUrl) || ""
11047
11053
  ), { setCardPreferences: c } = Se(), { data: l } = kr(t), i = Object.keys((l == null ? void 0 : l.objects) || {}).map((k) => ({
@@ -11114,11 +11120,11 @@ function Wg() {
11114
11120
  value: ((h = (p = t.preferences) == null ? void 0 : p.mapVisualOptions) == null ? void 0 : h.objectKey) || "",
11115
11121
  label: "Map Object",
11116
11122
  onValueChange: (k) => {
11117
- var E;
11123
+ var A;
11118
11124
  c({
11119
11125
  ...t.preferences,
11120
11126
  mapVisualOptions: {
11121
- ...(E = t.preferences) == null ? void 0 : E.mapVisualOptions,
11127
+ ...(A = t.preferences) == null ? void 0 : A.mapVisualOptions,
11122
11128
  objectKey: k
11123
11129
  }
11124
11130
  });
@@ -11136,11 +11142,11 @@ function Wg() {
11136
11142
  value: ((I = (v = t.preferences) == null ? void 0 : v.mapVisualOptions) == null ? void 0 : I.projection) || "",
11137
11143
  label: "Projection",
11138
11144
  onValueChange: (k) => {
11139
- var E;
11145
+ var A;
11140
11146
  c({
11141
11147
  ...t.preferences,
11142
11148
  mapVisualOptions: {
11143
- ...(E = t.preferences) == null ? void 0 : E.mapVisualOptions,
11149
+ ...(A = t.preferences) == null ? void 0 : A.mapVisualOptions,
11144
11150
  projection: k
11145
11151
  }
11146
11152
  });
@@ -11158,11 +11164,11 @@ function Wg() {
11158
11164
  value: ((x = (N = t.preferences) == null ? void 0 : N.mapVisualOptions) == null ? void 0 : x.colorScale) || "",
11159
11165
  label: "Select Color Scale",
11160
11166
  onValueChange: (k) => {
11161
- var E;
11167
+ var A;
11162
11168
  c({
11163
11169
  ...t.preferences,
11164
11170
  mapVisualOptions: {
11165
- ...(E = t.preferences) == null ? void 0 : E.mapVisualOptions,
11171
+ ...(A = t.preferences) == null ? void 0 : A.mapVisualOptions,
11166
11172
  colorScale: k
11167
11173
  }
11168
11174
  });
@@ -11180,13 +11186,13 @@ function Wg() {
11180
11186
  className: `h-9 w-full ${Nn}`,
11181
11187
  type: "number",
11182
11188
  step: 0.1,
11183
- value: ((A = (w = t.preferences) == null ? void 0 : w.mapVisualOptions) == null ? void 0 : A.projectionScale) || 1,
11189
+ value: ((O = (w = t.preferences) == null ? void 0 : w.mapVisualOptions) == null ? void 0 : O.projectionScale) || 1,
11184
11190
  onChange: (k) => {
11185
- var E;
11191
+ var A;
11186
11192
  c({
11187
11193
  ...t.preferences,
11188
11194
  mapVisualOptions: {
11189
- ...(E = t.preferences) == null ? void 0 : E.mapVisualOptions,
11195
+ ...(A = t.preferences) == null ? void 0 : A.mapVisualOptions,
11190
11196
  projectionScale: Number(k.target.value)
11191
11197
  }
11192
11198
  });
@@ -11202,11 +11208,11 @@ function Wg() {
11202
11208
  step: 10,
11203
11209
  value: ((M = (y = (C = t.preferences) == null ? void 0 : C.mapVisualOptions) == null ? void 0 : y.projectionOffset) == null ? void 0 : M[0]) || 0,
11204
11210
  onChange: (k) => {
11205
- var E, b, R, B;
11211
+ var A, b, R, B;
11206
11212
  c({
11207
11213
  ...t.preferences,
11208
11214
  mapVisualOptions: {
11209
- ...(E = t.preferences) == null ? void 0 : E.mapVisualOptions,
11215
+ ...(A = t.preferences) == null ? void 0 : A.mapVisualOptions,
11210
11216
  projectionOffset: [
11211
11217
  Number(k.target.value),
11212
11218
  ((B = (R = (b = t.preferences) == null ? void 0 : b.mapVisualOptions) == null ? void 0 : R.projectionOffset) == null ? void 0 : B[1]) || 0
@@ -11223,13 +11229,13 @@ function Wg() {
11223
11229
  className: `h-9 w-full ${Nn}`,
11224
11230
  type: "number",
11225
11231
  step: 10,
11226
- value: ((S = (O = (T = t.preferences) == null ? void 0 : T.mapVisualOptions) == null ? void 0 : O.projectionOffset) == null ? void 0 : S[1]) || 0,
11232
+ value: ((S = (E = (T = t.preferences) == null ? void 0 : T.mapVisualOptions) == null ? void 0 : E.projectionOffset) == null ? void 0 : S[1]) || 0,
11227
11233
  onChange: (k) => {
11228
- var E, b, R, B;
11234
+ var A, b, R, B;
11229
11235
  c({
11230
11236
  ...t.preferences,
11231
11237
  mapVisualOptions: {
11232
- ...(E = t.preferences) == null ? void 0 : E.mapVisualOptions,
11238
+ ...(A = t.preferences) == null ? void 0 : A.mapVisualOptions,
11233
11239
  projectionOffset: [
11234
11240
  ((B = (R = (b = t.preferences) == null ? void 0 : b.mapVisualOptions) == null ? void 0 : R.projectionOffset) == null ? void 0 : B[0]) || 0,
11235
11241
  Number(k.target.value)
@@ -11522,9 +11528,9 @@ function Ic({
11522
11528
  ), I = sm(
11523
11529
  h,
11524
11530
  p
11525
- ), N = cm(g), x = g === "table", w = g === "table", A = ((Q = v[0]) == null ? void 0 : Q.value) || "", C = rm(
11531
+ ), N = cm(g), x = g === "table", w = g === "table", O = ((Q = v[0]) == null ? void 0 : Q.value) || "", C = rm(
11526
11532
  (J = i == null ? void 0 : i.tablePrefs) == null ? void 0 : J.conditionalFormatting
11527
- ), y = lm(o), M = im(h), T = om(h), [O, S] = K("style");
11533
+ ), y = lm(o), M = im(h), T = om(h), [E, S] = K("style");
11528
11534
  Te(() => {
11529
11535
  if (s === "style") {
11530
11536
  S("style");
@@ -11546,11 +11552,11 @@ function Ic({
11546
11552
  var X;
11547
11553
  return ((X = j.comparison) == null ? void 0 : X.mode) === "explicit";
11548
11554
  }
11549
- ), E = (i == null ? void 0 : i.comparisonPresentation) || {}, b = (j) => {
11555
+ ), A = (i == null ? void 0 : i.comparisonPresentation) || {}, b = (j) => {
11550
11556
  d({
11551
11557
  ...i,
11552
11558
  comparisonPresentation: {
11553
- ...E,
11559
+ ...A,
11554
11560
  ...j
11555
11561
  }
11556
11562
  });
@@ -11653,7 +11659,7 @@ function Ic({
11653
11659
  {
11654
11660
  id: "show-table-comparison",
11655
11661
  size: "xs",
11656
- checked: E.showComparison !== !1,
11662
+ checked: A.showComparison !== !1,
11657
11663
  onCheckedChange: (j) => b({ showComparison: j })
11658
11664
  }
11659
11665
  )
@@ -11661,7 +11667,7 @@ function Ic({
11661
11667
  /* @__PURE__ */ e(
11662
11668
  Mc,
11663
11669
  {
11664
- value: E,
11670
+ value: A,
11665
11671
  onChange: b
11666
11672
  }
11667
11673
  )
@@ -11669,7 +11675,7 @@ function Ic({
11669
11675
  return /* @__PURE__ */ e("div", { className: "px-4 py-3", children: /* @__PURE__ */ n(
11670
11676
  da,
11671
11677
  {
11672
- value: O,
11678
+ value: E,
11673
11679
  onValueChange: (j) => S(j),
11674
11680
  className: "space-y-4",
11675
11681
  children: [
@@ -11711,10 +11717,10 @@ function Ic({
11711
11717
  onShowAllColumns: V
11712
11718
  }
11713
11719
  ) : /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-muted-foreground", children: "Column visibility is available for table cards." }) }),
11714
- /* @__PURE__ */ e(on, { value: "conditional-formatting", className: "mt-0", children: N ? A ? /* @__PURE__ */ e(
11720
+ /* @__PURE__ */ e(on, { value: "conditional-formatting", className: "mt-0", children: N ? O ? /* @__PURE__ */ e(
11715
11721
  mm,
11716
11722
  {
11717
- columnId: A,
11723
+ columnId: O,
11718
11724
  availableColumns: v,
11719
11725
  conditionalRules: C.rules,
11720
11726
  onConditionalRulesChange: R,
@@ -11761,10 +11767,10 @@ function nx({ color: t, onColorChange: a, onClose: s }) {
11761
11767
  const g = (N) => {
11762
11768
  c(N), h(N, l, o);
11763
11769
  }, p = (N) => {
11764
- const x = N.currentTarget.getBoundingClientRect(), w = Math.max(0, Math.min(1, (N.clientX - x.left) / x.width)), A = Math.max(0, Math.min(1, (N.clientY - x.top) / x.height)), C = w * 100, y = (1 - A) * 100;
11770
+ const x = N.currentTarget.getBoundingClientRect(), w = Math.max(0, Math.min(1, (N.clientX - x.left) / x.width)), O = Math.max(0, Math.min(1, (N.clientY - x.top) / x.height)), C = w * 100, y = (1 - O) * 100;
11765
11771
  i(C), d(y), h(r, C, y);
11766
11772
  }, h = (N, x, w) => {
11767
- const A = sx(N, x, w), C = ax(A.r, A.g, A.b);
11773
+ const O = sx(N, x, w), C = ax(O.r, O.g, O.b);
11768
11774
  m(C);
11769
11775
  }, v = (N) => {
11770
11776
  if (m(N), /^#[0-9A-Fa-f]{6}$/.test(N)) {
@@ -11960,7 +11966,7 @@ const rx = [
11960
11966
  // yellow-400
11961
11967
  ];
11962
11968
  function lx() {
11963
- var y, M, T, O, S, k, E, b, R, B;
11969
+ var y, M, T, E, S, k, A, b, R, B;
11964
11970
  const t = P((f) => f.card), a = P((f) => {
11965
11971
  var L;
11966
11972
  return (L = f.card) == null ? void 0 : L.preferences;
@@ -12058,9 +12064,9 @@ function lx() {
12058
12064
  [f]: D
12059
12065
  }));
12060
12066
  };
12061
- if (!h.length || !((t == null ? void 0 : t.type) === "stackedBar" || (t == null ? void 0 : t.type) === "stackedLine" ? ((S = (O = t == null ? void 0 : t.config) == null ? void 0 : O.groupByColumns) == null ? void 0 : S.length) || ((E = (k = t == null ? void 0 : t.config) == null ? void 0 : k.pivotByColumns) == null ? void 0 : E.length) : (R = (b = t == null ? void 0 : t.config) == null ? void 0 : b.groupByColumns) == null ? void 0 : R.length) || ["table", "kpi", "text", "custom", "heatmap"].includes(s))
12067
+ if (!h.length || !((t == null ? void 0 : t.type) === "stackedBar" || (t == null ? void 0 : t.type) === "stackedLine" ? ((S = (E = t == null ? void 0 : t.config) == null ? void 0 : E.groupByColumns) == null ? void 0 : S.length) || ((A = (k = t == null ? void 0 : t.config) == null ? void 0 : k.pivotByColumns) == null ? void 0 : A.length) : (R = (b = t == null ? void 0 : t.config) == null ? void 0 : b.groupByColumns) == null ? void 0 : R.length) || ["table", "kpi", "text", "custom", "heatmap"].includes(s))
12062
12068
  return null;
12063
- const A = () => {
12069
+ const O = () => {
12064
12070
  const f = {
12065
12071
  ...a || {},
12066
12072
  colorConfig: {
@@ -12088,7 +12094,7 @@ function lx() {
12088
12094
  "button",
12089
12095
  {
12090
12096
  className: "ml-auto flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",
12091
- onClick: A,
12097
+ onClick: O,
12092
12098
  children: [
12093
12099
  /* @__PURE__ */ e(xs, { className: "h-3 w-3" }),
12094
12100
  "Reset All"
@@ -12272,7 +12278,7 @@ function Qt({
12272
12278
  ] });
12273
12279
  }
12274
12280
  function nr({ axis: t, label: a, type: s, config: r, onChange: c, defaultTitle: l, hidePosition: i }) {
12275
- var v, I, N, x, w, A, C, y, M, T, O, S, k, E;
12281
+ var v, I, N, x, w, O, C, y, M, T, E, S, k, A;
12276
12282
  const o = bm({
12277
12283
  formatMode: r == null ? void 0 : r.formatMode,
12278
12284
  formatOptions: r == null ? void 0 : r.formatOptions
@@ -12410,7 +12416,7 @@ function nr({ axis: t, label: a, type: s, config: r, onChange: c, defaultTitle:
12410
12416
  Ke,
12411
12417
  {
12412
12418
  size: "sm",
12413
- checked: ((A = r == null ? void 0 : r.labels) == null ? void 0 : A.enabled) !== !1,
12419
+ checked: ((O = r == null ? void 0 : r.labels) == null ? void 0 : O.enabled) !== !1,
12414
12420
  onCheckedChange: (b) => m("enabled", b)
12415
12421
  }
12416
12422
  )
@@ -12487,7 +12493,7 @@ function nr({ axis: t, label: a, type: s, config: r, onChange: c, defaultTitle:
12487
12493
  {
12488
12494
  type: "number",
12489
12495
  placeholder: "auto",
12490
- value: ((O = r == null ? void 0 : r.scale) == null ? void 0 : O.max) === "auto" || ((S = r == null ? void 0 : r.scale) == null ? void 0 : S.max) === void 0 ? "" : String(r.scale.max),
12496
+ value: ((E = r == null ? void 0 : r.scale) == null ? void 0 : E.max) === "auto" || ((S = r == null ? void 0 : r.scale) == null ? void 0 : S.max) === void 0 ? "" : String(r.scale.max),
12491
12497
  onSave: (b) => g("max", b),
12492
12498
  className: ""
12493
12499
  }
@@ -12500,7 +12506,7 @@ function nr({ axis: t, label: a, type: s, config: r, onChange: c, defaultTitle:
12500
12506
  {
12501
12507
  type: "number",
12502
12508
  placeholder: "auto",
12503
- value: ((k = r == null ? void 0 : r.scale) == null ? void 0 : k.stepSize) === "auto" || ((E = r == null ? void 0 : r.scale) == null ? void 0 : E.stepSize) === void 0 ? "" : String(r.scale.stepSize),
12509
+ value: ((k = r == null ? void 0 : r.scale) == null ? void 0 : k.stepSize) === "auto" || ((A = r == null ? void 0 : r.scale) == null ? void 0 : A.stepSize) === void 0 ? "" : String(r.scale.stepSize),
12504
12510
  onSave: (b) => g("stepSize", b),
12505
12511
  className: ""
12506
12512
  }
@@ -12730,10 +12736,10 @@ function cx() {
12730
12736
  preferences: j
12731
12737
  };
12732
12738
  l(X);
12733
- }, A = () => {
12739
+ }, O = () => {
12734
12740
  const $ = a;
12735
12741
  return $ === "stackedBar" || $ === "stackedLine" || $ === "pie" || $ === "doughnut" ? "center" : o ? "right" : "top";
12736
- }, C = a !== "treemap" && a !== "heatmap", y = a !== "treemap", M = A();
12742
+ }, C = a !== "treemap" && a !== "heatmap", y = a !== "treemap", M = O();
12737
12743
  let T = [];
12738
12744
  if (C)
12739
12745
  if (m)
@@ -12744,7 +12750,7 @@ function cx() {
12744
12750
  const $ = o ? ["center", "left", "right"] : ["center", "top", "bottom"];
12745
12751
  T = ["auto", ...a === "bullet" ? $ : $.filter((z) => z !== M), "custom"];
12746
12752
  }
12747
- const O = () => Kt(M), S = ["center", "start", "end"], k = ["center", "start", "end", "top", "bottom"], E = (v == null ? void 0 : v.formatMode) || (v != null && v.format && !["auto"].includes(v.format) ? "override" : "inherit"), b = (v == null ? void 0 : v.format) === "none";
12753
+ const E = () => Kt(M), S = ["center", "start", "end"], k = ["center", "start", "end", "top", "bottom"], A = (v == null ? void 0 : v.formatMode) || (v != null && v.format && !["auto"].includes(v.format) ? "override" : "inherit"), b = (v == null ? void 0 : v.format) === "none";
12748
12754
  return /* @__PURE__ */ n(ct, { value: "data-labels", className: "border-b-0", children: [
12749
12755
  /* @__PURE__ */ e(dt, { className: "flex w-full items-center gap-2 py-2 text-[12px] font-medium hover:no-underline", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
12750
12756
  /* @__PURE__ */ e(tf, { className: "h-4 w-4 text-muted-foreground" }),
@@ -12772,7 +12778,7 @@ function cx() {
12772
12778
  onValueChange: ($) => x("position", $),
12773
12779
  children: [
12774
12780
  /* @__PURE__ */ e(se, { className: "h-8 text-xs", children: /* @__PURE__ */ e(re, {}) }),
12775
- /* @__PURE__ */ e(le, { children: T.map(($) => /* @__PURE__ */ e(q, { value: $, className: "text-xs", children: $ === "auto" ? O() : $ === "custom" ? "Custom (Advanced)" : Kt($) }, $)) })
12781
+ /* @__PURE__ */ e(le, { children: T.map(($) => /* @__PURE__ */ e(q, { value: $, className: "text-xs", children: $ === "auto" ? E() : $ === "custom" ? "Custom (Advanced)" : Kt($) }, $)) })
12776
12782
  ]
12777
12783
  }
12778
12784
  )
@@ -12828,12 +12834,12 @@ function cx() {
12828
12834
  Ke,
12829
12835
  {
12830
12836
  size: "sm",
12831
- checked: E === "override",
12837
+ checked: A === "override",
12832
12838
  onCheckedChange: ($) => x("formatMode", $ ? "override" : "inherit")
12833
12839
  }
12834
12840
  )
12835
12841
  ] }),
12836
- E === "override" && /* @__PURE__ */ n(we, { children: [
12842
+ A === "override" && /* @__PURE__ */ n(we, { children: [
12837
12843
  /* @__PURE__ */ n("div", { className: "flex items-center justify-between", children: [
12838
12844
  /* @__PURE__ */ n("div", { className: "space-y-1", children: [
12839
12845
  /* @__PURE__ */ e(_, { className: "text-xs font-medium", children: "Raw Value" }),
@@ -13237,7 +13243,7 @@ function hx() {
13237
13243
  L.trim() || delete D[f], x({
13238
13244
  rangeKeys: Object.keys(D).length > 0 ? D : void 0
13239
13245
  });
13240
- }, A = (f, L) => {
13246
+ }, O = (f, L) => {
13241
13247
  const D = L === "" ? void 0 : Number(L), F = {
13242
13248
  ...l.ranges || {}
13243
13249
  };
@@ -13264,7 +13270,7 @@ function hx() {
13264
13270
  u(f), x({ showRanges: f });
13265
13271
  }, T = (f) => {
13266
13272
  g(f), x({ rangesArePercentages: f });
13267
- }, O = l.orientation || (((B = t == null ? void 0 : t.chartOptions) == null ? void 0 : B.indexAxis) === "y" ? "horizontal" : "vertical"), S = (f) => {
13273
+ }, E = l.orientation || (((B = t == null ? void 0 : t.chartOptions) == null ? void 0 : B.indexAxis) === "y" ? "horizontal" : "vertical"), S = (f) => {
13268
13274
  x({ orientation: f }), c(f === "horizontal" ? "y" : "x");
13269
13275
  }, k = [
13270
13276
  { value: "__none", label: "None" },
@@ -13272,7 +13278,7 @@ function hx() {
13272
13278
  value: f.value,
13273
13279
  label: f.label
13274
13280
  }))
13275
- ], E = k, b = (f) => {
13281
+ ], A = k, b = (f) => {
13276
13282
  if (v(f), !f) {
13277
13283
  x({
13278
13284
  comparativeMetricKey: void 0,
@@ -13308,7 +13314,7 @@ function hx() {
13308
13314
  /* @__PURE__ */ n(
13309
13315
  ae,
13310
13316
  {
13311
- value: O,
13317
+ value: E,
13312
13318
  onValueChange: (f) => S(f),
13313
13319
  children: [
13314
13320
  /* @__PURE__ */ e(se, { className: "h-8 text-xs", children: /* @__PURE__ */ e(re, {}) }),
@@ -13475,7 +13481,7 @@ function hx() {
13475
13481
  },
13476
13482
  children: [
13477
13483
  /* @__PURE__ */ e(se, { className: "h-8 text-xs", children: /* @__PURE__ */ e(re, { placeholder: "Select column" }) }),
13478
- /* @__PURE__ */ e(le, { children: E.map((Y) => /* @__PURE__ */ e(
13484
+ /* @__PURE__ */ e(le, { children: A.map((Y) => /* @__PURE__ */ e(
13479
13485
  q,
13480
13486
  {
13481
13487
  value: Y.value,
@@ -13513,7 +13519,7 @@ function hx() {
13513
13519
  type: "number",
13514
13520
  placeholder: m ? "0.80" : "Static value",
13515
13521
  value: ((V = l.ranges) == null ? void 0 : V[f]) === void 0 ? "" : String(($ = l.ranges) == null ? void 0 : $[f]),
13516
- onCommit: (Y) => A(f, Y),
13522
+ onCommit: (Y) => O(f, Y),
13517
13523
  className: "h-8 text-xs"
13518
13524
  }
13519
13525
  )
@@ -13534,7 +13540,7 @@ function Fi(t) {
13534
13540
  return a;
13535
13541
  }
13536
13542
  function px() {
13537
- var y, M, T, O, S, k, E, b, R, B, f, L;
13543
+ var y, M, T, E, S, k, A, b, R, B, f, L;
13538
13544
  const t = P((D) => D.card.preferences), a = P((D) => D.card), s = Ot(), r = P((D) => D.isDevMode), { setCardPreferences: c, updateCardInFrame: l } = Se(), i = s === "bubble", o = s === "scatter", d = ce(
13539
13545
  () => (t == null ? void 0 : t.bubbleScatterConfig) || {},
13540
13546
  [t == null ? void 0 : t.bubbleScatterConfig]
@@ -13595,7 +13601,7 @@ function px() {
13595
13601
  ...D
13596
13602
  });
13597
13603
  N(F);
13598
- }, A = (D) => {
13604
+ }, O = (D) => {
13599
13605
  I(D), w({
13600
13606
  enableGrouping: D,
13601
13607
  groupKey: D ? d.groupKey : void 0
@@ -13647,7 +13653,7 @@ function px() {
13647
13653
  {
13648
13654
  size: "sm",
13649
13655
  checked: v,
13650
- onCheckedChange: A
13656
+ onCheckedChange: O
13651
13657
  }
13652
13658
  )
13653
13659
  ] }),
@@ -13785,7 +13791,7 @@ function px() {
13785
13791
  className: "h-8 text-xs",
13786
13792
  type: "number",
13787
13793
  placeholder: "30",
13788
- value: ((O = d.maxRadius) == null ? void 0 : O.toString()) || "",
13794
+ value: ((E = d.maxRadius) == null ? void 0 : E.toString()) || "",
13789
13795
  onCommit: (D) => w({ maxRadius: D ? Number(D) : void 0 })
13790
13796
  }
13791
13797
  )
@@ -13861,7 +13867,7 @@ function px() {
13861
13867
  }
13862
13868
  )
13863
13869
  ] }),
13864
- ((b = (E = t == null ? void 0 : t.xAxisConfig) == null ? void 0 : E.name) == null ? void 0 : b.enabled) && /* @__PURE__ */ n("div", { className: "grid grid-cols-2 gap-2", children: [
13870
+ ((b = (A = t == null ? void 0 : t.xAxisConfig) == null ? void 0 : A.name) == null ? void 0 : b.enabled) && /* @__PURE__ */ n("div", { className: "grid grid-cols-2 gap-2", children: [
13865
13871
  /* @__PURE__ */ n("div", { className: "space-y-1", children: [
13866
13872
  /* @__PURE__ */ e(_, { className: "text-xs", children: "X Title" }),
13867
13873
  /* @__PURE__ */ e(
@@ -14085,7 +14091,7 @@ function Rs({
14085
14091
  positionOptions: c,
14086
14092
  showAppearance: l = !0
14087
14093
  }) {
14088
- var v, I, N, x, w, A;
14094
+ var v, I, N, x, w, O;
14089
14095
  const i = c ?? (s ? ["auto", "center", "left", "right", "custom"] : ["auto", "center", "top", "bottom", "custom"]), o = r ? ["auto", "number", "currency", "percent", "none"] : ["number", "currency", "percent", "none"], d = (C, y) => {
14090
14096
  const M = {
14091
14097
  ...t,
@@ -14263,7 +14269,7 @@ function Rs({
14263
14269
  /* @__PURE__ */ n(
14264
14270
  ae,
14265
14271
  {
14266
- value: ((A = p.font) == null ? void 0 : A.weight) || "normal",
14272
+ value: ((O = p.font) == null ? void 0 : O.weight) || "normal",
14267
14273
  onValueChange: (C) => u("weight", C),
14268
14274
  children: [
14269
14275
  /* @__PURE__ */ e(se, { className: "h-7 w-24 text-xs", children: /* @__PURE__ */ e(re, {}) }),
@@ -14353,16 +14359,16 @@ function kx() {
14353
14359
  function Dx({ metricKey: t, idx: a }) {
14354
14360
  var x;
14355
14361
  const [s, r] = K(!1), c = P((w) => {
14356
- var A;
14357
- return (A = w.card) == null ? void 0 : A.preferences;
14362
+ var O;
14363
+ return (O = w.card) == null ? void 0 : O.preferences;
14358
14364
  }), l = P(
14359
14365
  (w) => {
14360
- var A, C;
14361
- return (C = (A = w.card) == null ? void 0 : A.preferences) == null ? void 0 : C.datasetOptions;
14366
+ var O, C;
14367
+ return (C = (O = w.card) == null ? void 0 : O.preferences) == null ? void 0 : C.datasetOptions;
14362
14368
  }
14363
14369
  ), i = l == null ? void 0 : l.find((w) => w.idx === a), { setCardPreferences: o } = P((w) => w.actions), d = (i == null ? void 0 : i.type) || "bar", u = (i == null ? void 0 : i.yAxisId) || "y", m = ((x = i == null ? void 0 : i.dataLabels) == null ? void 0 : x.enabled) ?? !1, g = d === "line" ? Ns : Cs;
14364
14370
  function p(w) {
14365
- const A = {
14371
+ const O = {
14366
14372
  idx: a,
14367
14373
  type: d,
14368
14374
  yAxisId: u,
@@ -14372,11 +14378,11 @@ function Dx({ metricKey: t, idx: a }) {
14372
14378
  if (!i)
14373
14379
  o({
14374
14380
  ...c || {},
14375
- datasetOptions: [...l || [], A]
14381
+ datasetOptions: [...l || [], O]
14376
14382
  });
14377
14383
  else {
14378
14384
  const C = l == null ? void 0 : l.map(
14379
- (y) => y.idx === a ? { ...y, ...A } : y
14385
+ (y) => y.idx === a ? { ...y, ...O } : y
14380
14386
  );
14381
14387
  o({
14382
14388
  ...c || {},
@@ -14447,7 +14453,7 @@ function Dx({ metricKey: t, idx: a }) {
14447
14453
  /* @__PURE__ */ n("div", { className: "flex items-end gap-4", children: [
14448
14454
  /* @__PURE__ */ n("div", { className: "flex-1 space-y-1.5", children: [
14449
14455
  /* @__PURE__ */ e(_, { className: "text-xs text-muted-foreground", children: "Chart Type" }),
14450
- /* @__PURE__ */ e("div", { className: "flex gap-2", children: Nx.map(({ type: w, icon: A, label: C }) => /* @__PURE__ */ n(
14456
+ /* @__PURE__ */ e("div", { className: "flex gap-2", children: Nx.map(({ type: w, icon: O, label: C }) => /* @__PURE__ */ n(
14451
14457
  "button",
14452
14458
  {
14453
14459
  onClick: () => h(w),
@@ -14456,7 +14462,7 @@ function Dx({ metricKey: t, idx: a }) {
14456
14462
  d === w ? "border-primary bg-primary/10 text-primary" : "border-border bg-background text-muted-foreground hover:bg-muted"
14457
14463
  ),
14458
14464
  children: [
14459
- /* @__PURE__ */ e(A, { className: "h-3.5 w-3.5 text-foreground/60" }),
14465
+ /* @__PURE__ */ e(O, { className: "h-3.5 w-3.5 text-foreground/60" }),
14460
14466
  /* @__PURE__ */ e("span", { children: C })
14461
14467
  ]
14462
14468
  },
@@ -14493,12 +14499,12 @@ function Dx({ metricKey: t, idx: a }) {
14493
14499
  onValueChange: (w) => p({ lineStyle: w }),
14494
14500
  children: [
14495
14501
  /* @__PURE__ */ e(se, { className: "h-8 w-full text-xs", children: /* @__PURE__ */ e(re, {}) }),
14496
- /* @__PURE__ */ e(le, { children: Sx.map(({ value: w, label: A }) => /* @__PURE__ */ e(
14502
+ /* @__PURE__ */ e(le, { children: Sx.map(({ value: w, label: O }) => /* @__PURE__ */ e(
14497
14503
  q,
14498
14504
  {
14499
14505
  value: w,
14500
14506
  className: "text-xs",
14501
- children: A
14507
+ children: O
14502
14508
  },
14503
14509
  w
14504
14510
  )) })
@@ -14537,12 +14543,12 @@ function Dx({ metricKey: t, idx: a }) {
14537
14543
  onValueChange: (w) => p({ pointStyle: w }),
14538
14544
  children: [
14539
14545
  /* @__PURE__ */ e(se, { className: "h-8 w-full text-xs", children: /* @__PURE__ */ e(re, {}) }),
14540
- /* @__PURE__ */ e(le, { children: wx.map(({ value: w, label: A }) => /* @__PURE__ */ e(
14546
+ /* @__PURE__ */ e(le, { children: wx.map(({ value: w, label: O }) => /* @__PURE__ */ e(
14541
14547
  q,
14542
14548
  {
14543
14549
  value: w,
14544
14550
  className: "text-xs",
14545
- children: A
14551
+ children: O
14546
14552
  },
14547
14553
  w
14548
14554
  )) })
@@ -14647,7 +14653,7 @@ function Rx({ metricKey: t, idx: a }) {
14647
14653
  });
14648
14654
  else {
14649
14655
  const w = l == null ? void 0 : l.map(
14650
- (A) => A.idx === a ? { ...A, ...x } : A
14656
+ (O) => O.idx === a ? { ...O, ...x } : O
14651
14657
  );
14652
14658
  o({
14653
14659
  ...c || {},
@@ -14859,8 +14865,8 @@ function Yx({ metricKey: t, idx: a }) {
14859
14865
  return (w = x.card) == null ? void 0 : w.preferences;
14860
14866
  }), l = P(
14861
14867
  (x) => {
14862
- var w, A;
14863
- return (A = (w = x.card) == null ? void 0 : w.preferences) == null ? void 0 : A.datasetOptions;
14868
+ var w, O;
14869
+ return (O = (w = x.card) == null ? void 0 : w.preferences) == null ? void 0 : O.datasetOptions;
14864
14870
  }
14865
14871
  ), i = l == null ? void 0 : l.find((x) => x.idx === a), { setCardPreferences: o } = P((x) => x.actions), d = (i == null ? void 0 : i.lineStyle) || "solid", u = (i == null ? void 0 : i.pointRadius) ?? 3, m = (i == null ? void 0 : i.pointStyle) || "circle", g = ((N = i == null ? void 0 : i.dataLabels) == null ? void 0 : N.enabled) ?? !1, p = rr.find((x) => x.value === d) || rr[0];
14866
14872
  function h(x) {
@@ -14878,12 +14884,12 @@ function Yx({ metricKey: t, idx: a }) {
14878
14884
  datasetOptions: [...l || [], w]
14879
14885
  });
14880
14886
  else {
14881
- const A = l == null ? void 0 : l.map(
14887
+ const O = l == null ? void 0 : l.map(
14882
14888
  (C) => C.idx === a ? { ...C, ...w } : C
14883
14889
  );
14884
14890
  o({
14885
14891
  ...c || {},
14886
- datasetOptions: A
14892
+ datasetOptions: O
14887
14893
  });
14888
14894
  }
14889
14895
  }
@@ -15411,10 +15417,10 @@ function tb(t) {
15411
15417
  };
15412
15418
  }
15413
15419
  function nb() {
15414
- var w, A;
15420
+ var w, O;
15415
15421
  const t = P((C) => C.card), a = P(
15416
15422
  (C) => C.actions.updateCardConfig
15417
- ), s = Ot(), { scopedFields: r } = Mo(), c = ((w = t.config) == null ? void 0 : w.metricColumns) || [], l = ((A = t.config) == null ? void 0 : A.summary) || {}, i = l.breakdownDimensions || [], o = i.length > 0, d = Zx.includes(s), u = c.length > 0, m = l.enabled === !0, g = d && u, p = Array.from(
15423
+ ), s = Ot(), { scopedFields: r } = Mo(), c = ((w = t.config) == null ? void 0 : w.metricColumns) || [], l = ((O = t.config) == null ? void 0 : O.summary) || {}, i = l.breakdownDimensions || [], o = i.length > 0, d = Zx.includes(s), u = c.length > 0, m = l.enabled === !0, g = d && u, p = Array.from(
15418
15424
  new Map(
15419
15425
  r.filter(eb).map((C) => [Ln(C), tb(C)])
15420
15426
  ).values()
@@ -15435,12 +15441,12 @@ function nb() {
15435
15441
  }, N = (C, y) => {
15436
15442
  const M = Ln(C), T = p.filter(
15437
15443
  (S) => v.has(Ln(S))
15438
- ), O = y ? v.has(M) ? T : [...T, C].slice(0, lr) : T.filter(
15444
+ ), E = y ? v.has(M) ? T : [...T, C].slice(0, lr) : T.filter(
15439
15445
  (S) => Ln(S) !== M
15440
15446
  );
15441
15447
  I({
15442
- breakdownDimensions: O,
15443
- ...O.length > 0 ? { showOnCard: !0 } : {}
15448
+ breakdownDimensions: E,
15449
+ ...E.length > 0 ? { showOnCard: !0 } : {}
15444
15450
  });
15445
15451
  };
15446
15452
  return /* @__PURE__ */ n(ct, { value: "summary", className: "border-none", children: [
@@ -15533,7 +15539,7 @@ function nb() {
15533
15539
  ] })
15534
15540
  ] }),
15535
15541
  p.length === 0 ? /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "No dimension fields available for breakdown." }) : /* @__PURE__ */ e("ul", { className: "max-h-40 space-y-1 overflow-y-auto", children: p.map((C) => {
15536
- const y = Ln(C), M = v.has(y), T = v.size >= lr, O = !m || !M && T;
15542
+ const y = Ln(C), M = v.has(y), T = v.size >= lr, E = !m || !M && T;
15537
15543
  return /* @__PURE__ */ n(
15538
15544
  "li",
15539
15545
  {
@@ -15544,7 +15550,7 @@ function nb() {
15544
15550
  {
15545
15551
  id: `summary-breakdown-${y}`,
15546
15552
  checked: M,
15547
- disabled: O,
15553
+ disabled: E,
15548
15554
  onCheckedChange: (S) => N(C, S === !0)
15549
15555
  }
15550
15556
  ),
@@ -15726,8 +15732,8 @@ function ib() {
15726
15732
  })), r && i(!0);
15727
15733
  };
15728
15734
  Te(() => {
15729
- var x, w, A, C;
15730
- c ? ((x = t.current) == null || x.resize(0), (w = a.current) == null || w.resize(0)) : ((A = t.current) == null || A.resize(Ri), (C = a.current) == null || C.resize(25));
15735
+ var x, w, O, C;
15736
+ c ? ((x = t.current) == null || x.resize(0), (w = a.current) == null || w.resize(0)) : ((O = t.current) == null || O.resize(Ri), (C = a.current) == null || C.resize(25));
15731
15737
  }, [c]);
15732
15738
  const [v, I] = K(!1), N = u ? {
15733
15739
  show: g,
@@ -15824,19 +15830,19 @@ function ob(t) {
15824
15830
  setRunSql: h,
15825
15831
  switchCardType: v,
15826
15832
  setQueryConfig: I
15827
- } = Se(), N = P((G) => G.currentAssitantScope) || [], x = P((G) => G.userInputForAI), w = P((G) => G.triggerAIRun), A = P((G) => G.card), C = P(
15833
+ } = Se(), N = P((G) => G.currentAssitantScope) || [], x = P((G) => G.userInputForAI), w = P((G) => G.triggerAIRun), O = P((G) => G.card), C = P(
15828
15834
  (G) => G.selectedDatabaseName
15829
15835
  ), y = P((G) => G.selectedTableName), M = P(
15830
15836
  (G) => G.selectedConnectionId
15831
15837
  ), T = P(
15832
15838
  (G) => G.selectedSchemaName
15833
- ), O = Ne(
15839
+ ), E = Ne(
15834
15840
  (G) => G.dashboard.aiScopeTables
15835
15841
  ), {
15836
15842
  errorMessage: S,
15837
15843
  refetch: k,
15838
- data: E
15839
- } = Bt(A), { setTriggerAIRun: b, setCurrentAssitantScope: R, setCardConfig: B } = Se(), { selectedDatamodelName: f, connectionType: L, selectedDatamodelId: D } = Dm(), F = (ze = qi().data) == null ? void 0 : ze.assistantProfileId, V = Ae(ns()), $ = Ae(null), Y = Ae(o), z = Ae(!1), Q = () => {
15844
+ data: A
15845
+ } = Bt(O), { setTriggerAIRun: b, setCurrentAssitantScope: R, setCardConfig: B } = Se(), { selectedDatamodelName: f, connectionType: L, selectedDatamodelId: D } = Dm(), F = (ze = qi().data) == null ? void 0 : ze.assistantProfileId, V = Ae(ns()), $ = Ae(null), Y = Ae(o), z = Ae(!1), Q = () => {
15840
15846
  const G = $.current;
15841
15847
  G && ($.current = null, V.current = ns(), G === "clear" && j([]));
15842
15848
  }, {
@@ -16060,11 +16066,11 @@ function ob(t) {
16060
16066
  datamodelId: D || ""
16061
16067
  };
16062
16068
  if (!Am(
16063
- [...O || [], ...N],
16069
+ [...E || [], ...N],
16064
16070
  G
16065
16071
  ) || N.length === 0) {
16066
16072
  const Pe = Jl([
16067
- ...O || [],
16073
+ ...E || [],
16068
16074
  ...N,
16069
16075
  G
16070
16076
  ]).filter(
@@ -16109,7 +16115,7 @@ function Pi({
16109
16115
  onFullscreenChange: a,
16110
16116
  fullscreenContainer: s
16111
16117
  }) {
16112
- const r = Ae(null), c = Ae(!1), [l, i] = K(!1), [o, d] = K(pp), [u, m] = K(!1), [g, p] = K(!1), [h, v] = K(!1), [I, N] = K(0), x = t ?? h, w = Qh(), { setCurrentAIContext: A, setHasEditorEntitySelectionOverride: C } = Lr(), { clearQueue: y } = Wh(), { clearFileAttachments: M } = Jh(), T = Xh("editor"), { selectedEntities: O } = Yi("editor"), S = P((he) => he.card.id), k = P((he) => he.card.dataSource), E = P(
16118
+ const r = Ae(null), c = Ae(!1), [l, i] = K(!1), [o, d] = K(pp), [u, m] = K(!1), [g, p] = K(!1), [h, v] = K(!1), [I, N] = K(0), x = t ?? h, w = Qh(), { setCurrentAIContext: O, setHasEditorEntitySelectionOverride: C } = Lr(), { clearQueue: y } = Wh(), { clearFileAttachments: M } = Jh(), T = Xh("editor"), { selectedEntities: E } = Yi("editor"), S = P((he) => he.card.id), k = P((he) => he.card.dataSource), A = P(
16113
16119
  (he) => {
16114
16120
  var ge;
16115
16121
  return (ge = he.card.dataSource) == null ? void 0 : ge.selectedEntities;
@@ -16149,13 +16155,13 @@ function Pi({
16149
16155
  var he;
16150
16156
  B && !c.current && ((he = r.current) == null || he.focus()), c.current = B;
16151
16157
  }, [B]), Te(() => {
16152
- B && (C(!1), A({
16153
- selectedEntities: E || []
16158
+ B && (C(!1), O({
16159
+ selectedEntities: A || []
16154
16160
  }));
16155
16161
  }, [
16156
16162
  S,
16157
- E,
16158
16163
  A,
16164
+ O,
16159
16165
  C,
16160
16166
  B
16161
16167
  ]), Rm({
@@ -16203,8 +16209,8 @@ function Pi({
16203
16209
  ge === "sql" ? (b(he), R(!0)) : ge === "python" && (D(he), R(!0));
16204
16210
  }
16205
16211
  function fe() {
16206
- w.selectedEntities.length === 0 && A({
16207
- selectedEntities: O
16212
+ w.selectedEntities.length === 0 && O({
16213
+ selectedEntities: E
16208
16214
  });
16209
16215
  }
16210
16216
  function je(he) {
@@ -16415,13 +16421,13 @@ function Pi({
16415
16421
  /* @__PURE__ */ e(
16416
16422
  ji,
16417
16423
  {
16418
- incomingSelectedEntities: O,
16424
+ incomingSelectedEntities: E,
16419
16425
  open: g,
16420
16426
  onOpenChange: p,
16421
16427
  dataSource: k || $m,
16422
16428
  dialogMode: "aiContext",
16423
16429
  onSaveSelectedEntities: (he) => {
16424
- C(!0), A({
16430
+ C(!0), O({
16425
16431
  ...w,
16426
16432
  selectedEntities: he
16427
16433
  });
@@ -17192,7 +17198,7 @@ function Oc({
17192
17198
  editingCondition: c,
17193
17199
  onSave: l
17194
17200
  }) {
17195
- var A, C;
17201
+ var O, C;
17196
17202
  const i = !!c, [o, d] = K(i ? "values" : "fields"), [u, m] = K(""), [g, p] = K({
17197
17203
  id: (c == null ? void 0 : c.id) || Yn(),
17198
17204
  field: (c == null ? void 0 : c.field) || null,
@@ -17200,7 +17206,7 @@ function Oc({
17200
17206
  }), h = s.filter((y) => {
17201
17207
  var T;
17202
17208
  return i ? !1 : !((T = r == null ? void 0 : r.conditions) == null ? void 0 : T.some(
17203
- (O) => O.field.id === y.id
17209
+ (E) => E.field.id === y.id
17204
17210
  )) && y.label.toLowerCase().includes(u.toLowerCase());
17205
17211
  }), v = (y) => {
17206
17212
  p({
@@ -17218,7 +17224,7 @@ function Oc({
17218
17224
  let M;
17219
17225
  if (i) {
17220
17226
  const T = ((r == null ? void 0 : r.conditions) || []).map(
17221
- (O) => O.id === c.id ? y : O
17227
+ (E) => E.id === c.id ? y : E
17222
17228
  );
17223
17229
  M = {
17224
17230
  ...r,
@@ -17269,7 +17275,7 @@ function Oc({
17269
17275
  return Te(() => {
17270
17276
  t && w();
17271
17277
  }, [t, i, c]), /* @__PURE__ */ e(wn, { open: t, onOpenChange: a, children: /* @__PURE__ */ n(Sn, { className: "max-w-2xl", children: [
17272
- /* @__PURE__ */ e(Tn, { children: /* @__PURE__ */ e(kn, { children: i ? `Edit Filter: ${(A = g.field) == null ? void 0 : A.label}` : o === "fields" ? "Select Field to Filter" : `Select Values for ${(C = g.field) == null ? void 0 : C.label}` }) }),
17278
+ /* @__PURE__ */ e(Tn, { children: /* @__PURE__ */ e(kn, { children: i ? `Edit Filter: ${(O = g.field) == null ? void 0 : O.label}` : o === "fields" ? "Select Field to Filter" : `Select Values for ${(C = g.field) == null ? void 0 : C.label}` }) }),
17273
17279
  /* @__PURE__ */ n("div", { className: "space-y-4", children: [
17274
17280
  !i && (r == null ? void 0 : r.conditions) && r.conditions.length > 0 && o === "fields" && /* @__PURE__ */ n("div", { className: "space-y-2", children: [
17275
17281
  /* @__PURE__ */ e(_, { className: "text-xs font-medium text-muted-foreground", children: "Current Filters:" }),
@@ -17506,7 +17512,7 @@ function Sb({
17506
17512
  ) ?? wb, {
17507
17513
  scopedFields: y,
17508
17514
  valuePickFilterableFields: M
17509
- } = ks(), { userContext: T } = wr(), { tokenProps: O } = Gn(), S = (T == null ? void 0 : T.type) === "organization", k = Or() ?? void 0, E = bo() ?? Ka, {
17515
+ } = ks(), { userContext: T } = wr(), { tokenProps: E } = Gn(), S = (T == null ? void 0 : T.type) === "organization", k = Or() ?? void 0, A = bo() ?? Ka, {
17510
17516
  updateLabel: b,
17511
17517
  handleAggregationChange: R,
17512
17518
  handleDetailDateFormatChange: B,
@@ -17592,7 +17598,7 @@ function Sb({
17592
17598
  const be = a === "groupBy" ? oi(
17593
17599
  Ie,
17594
17600
  Je.format,
17595
- E
17601
+ A
17596
17602
  ).find(
17597
17603
  (xt) => xt.value === "custom"
17598
17604
  ) : void 0, Ye = a === "groupBy" ? lt || (((ne = be == null ? void 0 : be.format) == null ? void 0 : ne.presentation.mode) === "pattern" ? be.format.presentation.pattern : "") : lt;
@@ -17682,7 +17688,7 @@ function Sb({
17682
17688
  ), Z = a === "groupBy" && ge ? oi(
17683
17689
  ge,
17684
17690
  Je.format,
17685
- E
17691
+ A
17686
17692
  ) : a === "detailColumns" ? ub(ge ?? "day") : [], de = at ? "custom" : !ge && a === "groupBy" ? void 0 : Z.some((H) => H.value === ie) ? ie : ((ol = Z[0]) == null ? void 0 : ol.value) ?? "YYYY-MM-DD", oe = !!i && rp.includes(i), Le = !!i && lp.includes(i), Re = ce(
17687
17693
  () => xn == null ? void 0 : xn.find((H) => pt(H.dataType || "") === "date"),
17688
17694
  [xn]
@@ -18952,7 +18958,7 @@ function Eb({
18952
18958
  h && ((X = m == null ? void 0 : m.customCardPreferences) != null && X.url);
18953
18959
  const v = Mp(p == null ? void 0 : p.slots), I = P(
18954
18960
  (W) => W.actions.updateCardConfig
18955
- ), N = P((W) => W.actions.updateCard), x = P((W) => W.actions.updateFrame), w = Ne((W) => W.isVisualEditing), A = Ne((W) => W.selectedSheetId), C = Ne(
18961
+ ), N = P((W) => W.actions.updateCard), x = P((W) => W.actions.updateFrame), w = Ne((W) => W.isVisualEditing), O = Ne((W) => W.selectedSheetId), C = Ne(
18956
18962
  (W) => W.actions.updateSheetCalculatedFields
18957
18963
  ), y = Ne(
18958
18964
  (W) => W.actions.updateDashboardCalculatedFields
@@ -18961,7 +18967,7 @@ function Eb({
18961
18967
  var ue;
18962
18968
  return W.visualEditPendingDashboardCalculatedFields ?? ((ue = W.dashboard) == null ? void 0 : ue.calculatedFields);
18963
18969
  }
18964
- ) ?? Ib, { scopedFields: O } = Mo(), { userContext: S } = wr(), k = h && (m == null ? void 0 : m.id) === d.id && v ? v : d == null ? void 0 : d.type, E = k === "detailTable", b = t.length > 0 || s.length > 0 || c.length > 0, R = !E && (k !== "kpi" || s.length <= 2), B = !E, f = !E && k !== "kpi", L = k !== "kpi" && b, D = E, F = "Drop sort fields here", V = (S == null ? void 0 : S.type) === "organization", $ = [
18970
+ ) ?? Ib, { scopedFields: E } = Mo(), { userContext: S } = wr(), k = h && (m == null ? void 0 : m.id) === d.id && v ? v : d == null ? void 0 : d.type, A = k === "detailTable", b = t.length > 0 || s.length > 0 || c.length > 0, R = !A && (k !== "kpi" || s.length <= 2), B = !A, f = !A && k !== "kpi", L = k !== "kpi" && b, D = A, F = "Drop sort fields here", V = (S == null ? void 0 : S.type) === "organization", $ = [
18965
18971
  "pie",
18966
18972
  "doughnut",
18967
18973
  "polar",
@@ -19074,7 +19080,7 @@ function Eb({
19074
19080
  {
19075
19081
  open: i,
19076
19082
  onOpenChange: o,
19077
- availableFields: O,
19083
+ availableFields: E,
19078
19084
  initialFieldType: "metric",
19079
19085
  allowedFieldTypes: ["metric"],
19080
19086
  onSave: (W) => {
@@ -19103,7 +19109,7 @@ function Eb({
19103
19109
  nextSharedFields: xe,
19104
19110
  currentSharedFields: ue,
19105
19111
  isVisualEditing: w,
19106
- selectedSheetId: A,
19112
+ selectedSheetId: O,
19107
19113
  updateFrame: x,
19108
19114
  updateSheetCalculatedFields: C
19109
19115
  });
@@ -19125,7 +19131,7 @@ function Eb({
19125
19131
  ] });
19126
19132
  }
19127
19133
  function Ab() {
19128
- var w, A, C;
19134
+ var w, O, C;
19129
19135
  const t = P((y) => {
19130
19136
  var M;
19131
19137
  return (M = y.card) == null ? void 0 : M.type;
@@ -19136,7 +19142,7 @@ function Ab() {
19136
19142
  }
19137
19143
  ), o = P((y) => y.card), d = P((y) => y.frame), u = Hn(d, o), { manifest: m } = In(
19138
19144
  ((w = u == null ? void 0 : u.customCardPreferences) == null ? void 0 : w.url) || ""
19139
- ), g = (A = m == null ? void 0 : m.visuals) == null ? void 0 : A.find(
19145
+ ), g = (O = m == null ? void 0 : m.visuals) == null ? void 0 : O.find(
19140
19146
  (y) => {
19141
19147
  var M;
19142
19148
  return y.name === ((M = u == null ? void 0 : u.customCardPreferences) == null ? void 0 : M.componentName);
@@ -19326,7 +19332,7 @@ function Fb({
19326
19332
  detailFields: d,
19327
19333
  activeField: u
19328
19334
  }) {
19329
- var T, O;
19335
+ var T, E;
19330
19336
  const [m, g] = K(!1), p = P((S) => S.card), h = P((S) => S.editorContext), v = P(
19331
19337
  (S) => S.actions.updateCardConfig
19332
19338
  ), I = (h == null ? void 0 : h.type) === "documentSection", { autoJoinMetadata: N } = Bt(p), x = ((T = p == null ? void 0 : p.config) == null ? void 0 : T.joinPlan) || (N != null && N.autoResolved ? N.resolvedJoinPlan : {
@@ -19340,7 +19346,7 @@ function Fb({
19340
19346
  dialect: "none"
19341
19347
  },
19342
19348
  joins: []
19343
- }), w = ((O = p == null ? void 0 : p.dataSource) == null ? void 0 : O.selectedEntities) || [], A = (S) => {
19349
+ }), w = ((E = p == null ? void 0 : p.dataSource) == null ? void 0 : E.selectedEntities) || [], O = (S) => {
19344
19350
  v(p.id, {
19345
19351
  ...p == null ? void 0 : p.config,
19346
19352
  joinPlan: S
@@ -19402,7 +19408,7 @@ function Fb({
19402
19408
  onOpenChange: g,
19403
19409
  joinPlan: x,
19404
19410
  availableDataSources: w,
19405
- onSave: A,
19411
+ onSave: O,
19406
19412
  onCancel: y,
19407
19413
  onRemove: C,
19408
19414
  children: /* @__PURE__ */ e("div", {})
@@ -19454,7 +19460,7 @@ function Rb({
19454
19460
  }, d = (C) => {
19455
19461
  const y = (M) => {
19456
19462
  if (M.id === C) {
19457
- const T = i[0] || o, O = pt(T.dataType) === "date";
19463
+ const T = i[0] || o, E = pt(T.dataType) === "date";
19458
19464
  return {
19459
19465
  ...M,
19460
19466
  conditions: [
@@ -19462,8 +19468,8 @@ function Rb({
19462
19468
  {
19463
19469
  id: `condition-${Date.now()}`,
19464
19470
  field: T,
19465
- operator: O ? "between" : "=",
19466
- value: O ? [] : ""
19471
+ operator: E ? "between" : "=",
19472
+ value: E ? [] : ""
19467
19473
  }
19468
19474
  ]
19469
19475
  };
@@ -19477,7 +19483,7 @@ function Rb({
19477
19483
  }, u = (C) => {
19478
19484
  const y = (M) => {
19479
19485
  if (M.id === C) {
19480
- const T = i[0] || o, O = pt(T.dataType) === "date";
19486
+ const T = i[0] || o, E = pt(T.dataType) === "date";
19481
19487
  return {
19482
19488
  ...M,
19483
19489
  groups: [
@@ -19490,8 +19496,8 @@ function Rb({
19490
19496
  {
19491
19497
  id: `condition-${Date.now()}`,
19492
19498
  field: T,
19493
- operator: O ? "between" : "=",
19494
- value: O ? [] : ""
19499
+ operator: E ? "between" : "=",
19500
+ value: E ? [] : ""
19495
19501
  }
19496
19502
  ],
19497
19503
  groups: []
@@ -19508,7 +19514,7 @@ function Rb({
19508
19514
  }, m = (C, y) => {
19509
19515
  const M = (T) => T.id === C ? {
19510
19516
  ...T,
19511
- conditions: T.conditions.filter((O) => O.id !== y)
19517
+ conditions: T.conditions.filter((E) => E.id !== y)
19512
19518
  } : {
19513
19519
  ...T,
19514
19520
  groups: T.groups.map(M)
@@ -19517,7 +19523,7 @@ function Rb({
19517
19523
  }, g = (C, y) => {
19518
19524
  const M = (T) => T.id === C ? {
19519
19525
  ...T,
19520
- groups: T.groups.filter((O) => O.id !== y)
19526
+ groups: T.groups.filter((E) => E.id !== y)
19521
19527
  } : {
19522
19528
  ...T,
19523
19529
  groups: T.groups.map(M)
@@ -19528,7 +19534,7 @@ function Rb({
19528
19534
  throw new Error(
19529
19535
  "Use a dedicated method to update the field property with a Field object"
19530
19536
  );
19531
- const O = (S) => S.id === C ? {
19537
+ const E = (S) => S.id === C ? {
19532
19538
  ...S,
19533
19539
  conditions: S.conditions.map((k) => k.id === y ? {
19534
19540
  ...k,
@@ -19536,16 +19542,16 @@ function Rb({
19536
19542
  } : k)
19537
19543
  } : {
19538
19544
  ...S,
19539
- groups: S.groups.map(O)
19545
+ groups: S.groups.map(E)
19540
19546
  };
19541
- r(O(s));
19547
+ r(E(s));
19542
19548
  }, h = (C, y, M) => {
19543
- const T = (O) => O.id === C ? {
19544
- ...O,
19545
- conditions: O.conditions.map((S) => S.id === y ? { ...S, ...M } : S)
19549
+ const T = (E) => E.id === C ? {
19550
+ ...E,
19551
+ conditions: E.conditions.map((S) => S.id === y ? { ...S, ...M } : S)
19546
19552
  } : {
19547
- ...O,
19548
- groups: O.groups.map(T)
19553
+ ...E,
19554
+ groups: E.groups.map(T)
19549
19555
  };
19550
19556
  r(T(s));
19551
19557
  }, v = (C, y) => {
@@ -19567,74 +19573,74 @@ function Rb({
19567
19573
  };
19568
19574
  r(M(s));
19569
19575
  }, N = (C, y, M) => {
19570
- const T = (O) => O.id === C ? {
19571
- ...O,
19572
- conditions: fs(O.conditions, y, M)
19576
+ const T = (E) => E.id === C ? {
19577
+ ...E,
19578
+ conditions: fs(E.conditions, y, M)
19573
19579
  } : {
19574
- ...O,
19575
- groups: O.groups.map(T)
19580
+ ...E,
19581
+ groups: E.groups.map(T)
19576
19582
  };
19577
19583
  r(T(s));
19578
19584
  }, x = (C, y, M) => {
19579
- const T = (O) => O.id === C ? {
19580
- ...O,
19581
- groups: fs(O.groups, y, M)
19585
+ const T = (E) => E.id === C ? {
19586
+ ...E,
19587
+ groups: fs(E.groups, y, M)
19582
19588
  } : {
19583
- ...O,
19584
- groups: O.groups.map(T)
19589
+ ...E,
19590
+ groups: E.groups.map(T)
19585
19591
  };
19586
19592
  r(T(s));
19587
19593
  }, w = (C) => {
19588
19594
  if (!C || C.conditions.length === 0 && C.groups.length === 0)
19589
19595
  return "-- No filters defined";
19590
19596
  const y = (T) => {
19591
- let O = "";
19592
- typeof T.field == "object" ? O = T.field.entityName ? `${T.field.entityName}.${T.field.name}` : T.field.name : O = String(T.field);
19597
+ let E = "";
19598
+ typeof T.field == "object" ? E = T.field.entityName ? `${T.field.entityName}.${T.field.name}` : T.field.name : E = String(T.field);
19593
19599
  const S = T.operator;
19594
19600
  let k = T.value;
19595
19601
  if (T.field.dataType === "string" && !["in", "not in"].includes(T.operator))
19596
19602
  typeof k == "string" ? k = `'${k}'` : Array.isArray(k) && (k = `'${k.join(", ")}'`);
19597
19603
  else if (T.field.dataType === "date" || T.field.dataType === "datetime" || T.field.dataType === "timestamp")
19598
19604
  if (T.operator === "between" && Array.isArray(k) && k.length === 2) {
19599
- const E = k[0] ? `'${k[0]}'` : "NULL", b = k[1] ? `'${k[1]}'` : "NULL";
19600
- return `${O} BETWEEN ${E} AND ${b}`;
19605
+ const A = k[0] ? `'${k[0]}'` : "NULL", b = k[1] ? `'${k[1]}'` : "NULL";
19606
+ return `${E} BETWEEN ${A} AND ${b}`;
19601
19607
  } else if ((T.operator === "in" || T.operator === "not in") && Array.isArray(k)) {
19602
- const E = k.map((b) => b ? `'${b}'` : "NULL").join(", ");
19603
- return `${O} ${S} (${E})`;
19608
+ const A = k.map((b) => b ? `'${b}'` : "NULL").join(", ");
19609
+ return `${E} ${S} (${A})`;
19604
19610
  } else typeof k == "string" || k instanceof Date ? k = `'${k}'` : Array.isArray(k) && k.length > 0 && (k = `'${k[0]}'`);
19605
19611
  else if (["in", "not in"].includes(T.operator)) {
19606
- let E = [];
19607
- Array.isArray(k) ? E = k.map(
19612
+ let A = [];
19613
+ Array.isArray(k) ? A = k.map(
19608
19614
  (b) => typeof b == "string" ? `'${b}'` : String(b)
19609
- ) : typeof k == "string" ? E = k.split(",").map((b) => {
19615
+ ) : typeof k == "string" ? A = k.split(",").map((b) => {
19610
19616
  const R = b.trim();
19611
19617
  return T.field.dataType === "string" ? `'${R}'` : R;
19612
- }) : typeof k == "number" && (E = [String(k)]), k = `(${E.join(", ")})`;
19618
+ }) : typeof k == "number" && (A = [String(k)]), k = `(${A.join(", ")})`;
19613
19619
  }
19614
19620
  switch (S) {
19615
19621
  case "contains":
19616
- return typeof k == "string" ? `${O} LIKE '%${k.replace(/'/g, "")}'` : `${O} LIKE '%${String(k)}'`;
19622
+ return typeof k == "string" ? `${E} LIKE '%${k.replace(/'/g, "")}'` : `${E} LIKE '%${String(k)}'`;
19617
19623
  case "startsWith":
19618
- return typeof k == "string" ? `${O} LIKE '${k.replace(/'/g, "")}%'` : `${O} LIKE '${String(k)}%'`;
19624
+ return typeof k == "string" ? `${E} LIKE '${k.replace(/'/g, "")}%'` : `${E} LIKE '${String(k)}%'`;
19619
19625
  case "endsWith":
19620
- return typeof k == "string" ? `${O} LIKE '%${k.replace(/'/g, "")}'` : `${O} LIKE '%${String(k)}'`;
19626
+ return typeof k == "string" ? `${E} LIKE '%${k.replace(/'/g, "")}'` : `${E} LIKE '%${String(k)}'`;
19621
19627
  case "isNull":
19622
- return `${O} IS NULL`;
19628
+ return `${E} IS NULL`;
19623
19629
  case "isNotNull":
19624
- return `${O} IS NOT NULL`;
19630
+ return `${E} IS NOT NULL`;
19625
19631
  default:
19626
- return `${O} ${S} ${k}`;
19632
+ return `${E} ${S} ${k}`;
19627
19633
  }
19628
19634
  }, M = (T) => {
19629
- const O = T.conditions.map(y), S = T.groups.map(
19635
+ const E = T.conditions.map(y), S = T.groups.map(
19630
19636
  (R) => M(R)
19631
- ), k = [...O, ...S].filter(Boolean);
19637
+ ), k = [...E, ...S].filter(Boolean);
19632
19638
  if (k.length === 0) return "";
19633
- const E = k.join(` ${T.logicalOperator} `), b = k.length > 1 ? `(${E})` : E;
19639
+ const A = k.join(` ${T.logicalOperator} `), b = k.length > 1 ? `(${A})` : A;
19634
19640
  return T.negate ? `NOT ${b}` : b;
19635
19641
  };
19636
19642
  return M(C);
19637
- }, A = s.conditions.length > 0 || s.groups.length > 0;
19643
+ }, O = s.conditions.length > 0 || s.groups.length > 0;
19638
19644
  return {
19639
19645
  currentFilters: s,
19640
19646
  setCurrentFilters: r,
@@ -19651,7 +19657,7 @@ function Rb({
19651
19657
  reorderConditions: N,
19652
19658
  reorderGroups: x,
19653
19659
  generateSQLPreview: w,
19654
- hasAnyFilters: A
19660
+ hasAnyFilters: O
19655
19661
  };
19656
19662
  }
19657
19663
  function Pb({
@@ -20127,9 +20133,9 @@ function Fc({
20127
20133
  {
20128
20134
  value: t.field,
20129
20135
  onValueChange: (w) => {
20130
- const A = w, C = pt(A.dataType) === "date";
20136
+ const O = w, C = pt(O.dataType) === "date";
20131
20137
  d(s, t.id, {
20132
- field: A,
20138
+ field: O,
20133
20139
  value: "",
20134
20140
  // For date fields, default to 'between' operator
20135
20141
  operator: C ? "between" : "="
@@ -20274,26 +20280,26 @@ function Hb({
20274
20280
  attributes: N,
20275
20281
  listeners: x,
20276
20282
  setNodeRef: w,
20277
- transform: A,
20283
+ transform: O,
20278
20284
  transition: C,
20279
20285
  isDragging: y
20280
20286
  } = Ts({ id: t.id }), M = {
20281
- transform: Ds.Transform.toString(A),
20287
+ transform: Ds.Transform.toString(O),
20282
20288
  transition: C
20283
20289
  }, T = (S) => {
20284
- const { active: k, over: E } = S;
20285
- if (E && k.id !== E.id) {
20290
+ const { active: k, over: A } = S;
20291
+ if (A && k.id !== A.id) {
20286
20292
  const b = t.conditions.findIndex(
20287
20293
  (B) => B.id === k.id
20288
20294
  ), R = t.conditions.findIndex(
20289
- (B) => B.id === E.id
20295
+ (B) => B.id === A.id
20290
20296
  );
20291
20297
  b !== -1 && R !== -1 && u(t.id, b, R);
20292
20298
  }
20293
- }, O = (S) => {
20294
- const { active: k, over: E } = S;
20295
- if (E && k.id !== E.id && s) {
20296
- const b = t.groups.findIndex((B) => B.id === k.id), R = t.groups.findIndex((B) => B.id === E.id);
20299
+ }, E = (S) => {
20300
+ const { active: k, over: A } = S;
20301
+ if (A && k.id !== A.id && s) {
20302
+ const b = t.groups.findIndex((B) => B.id === k.id), R = t.groups.findIndex((B) => B.id === A.id);
20297
20303
  b !== -1 && R !== -1 && m(s, b, R);
20298
20304
  }
20299
20305
  };
@@ -20399,7 +20405,7 @@ function Hb({
20399
20405
  })
20400
20406
  ),
20401
20407
  collisionDetection: zn,
20402
- onDragEnd: O,
20408
+ onDragEnd: E,
20403
20409
  children: /* @__PURE__ */ e(
20404
20410
  Dn,
20405
20411
  {
@@ -20467,7 +20473,7 @@ function Qb({
20467
20473
  reorderConditions: N,
20468
20474
  reorderGroups: x,
20469
20475
  generateSQLPreview: w,
20470
- hasAnyFilters: A,
20476
+ hasAnyFilters: O,
20471
20477
  setCurrentFilters: C
20472
20478
  } = Rb({
20473
20479
  initialFilters: t,
@@ -20477,8 +20483,8 @@ function Qb({
20477
20483
  yn(hr, {
20478
20484
  coordinateGetter: mr
20479
20485
  })
20480
- ), [M, T] = K(!1), O = (E, b, R) => {
20481
- const B = (f) => f.id === E ? {
20486
+ ), [M, T] = K(!1), E = (A, b, R) => {
20487
+ const B = (f) => f.id === A ? {
20482
20488
  ...f,
20483
20489
  conditions: f.conditions.map((L) => L.id === b ? {
20484
20490
  ...L,
@@ -20490,7 +20496,7 @@ function Qb({
20490
20496
  groups: f.groups.map(B)
20491
20497
  };
20492
20498
  C(B(l));
20493
- }, S = (E, b = 0, R) => b === 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg", children: /* @__PURE__ */ n("div", { className: "p-3 px-0", children: [
20499
+ }, S = (A, b = 0, R) => b === 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg", children: /* @__PURE__ */ n("div", { className: "p-3 px-0", children: [
20494
20500
  /* @__PURE__ */ e(
20495
20501
  $n,
20496
20502
  {
@@ -20499,28 +20505,28 @@ function Qb({
20499
20505
  onDragEnd: (B) => {
20500
20506
  const { active: f, over: L } = B;
20501
20507
  if (L && f.id !== L.id) {
20502
- const D = E.conditions.findIndex(
20508
+ const D = A.conditions.findIndex(
20503
20509
  (V) => V.id === f.id
20504
- ), F = E.conditions.findIndex(
20510
+ ), F = A.conditions.findIndex(
20505
20511
  (V) => V.id === L.id
20506
20512
  );
20507
- D !== -1 && F !== -1 && N(E.id, D, F);
20513
+ D !== -1 && F !== -1 && N(A.id, D, F);
20508
20514
  }
20509
20515
  },
20510
20516
  children: /* @__PURE__ */ e(
20511
20517
  Dn,
20512
20518
  {
20513
- items: E.conditions.map((B) => B.id),
20519
+ items: A.conditions.map((B) => B.id),
20514
20520
  strategy: aa,
20515
- children: E.conditions.map((B, f) => /* @__PURE__ */ e(
20521
+ children: A.conditions.map((B, f) => /* @__PURE__ */ e(
20516
20522
  Fc,
20517
20523
  {
20518
20524
  condition: B,
20519
20525
  index: f,
20520
- groupId: E.id,
20521
- groupLogicalOperator: E.logicalOperator,
20526
+ groupId: A.id,
20527
+ groupLogicalOperator: A.logicalOperator,
20522
20528
  onUpdateCondition: p,
20523
- onUpdateField: O,
20529
+ onUpdateField: E,
20524
20530
  onRemoveCondition: m,
20525
20531
  onUpdateGroupOperator: v,
20526
20532
  availableFields: i,
@@ -20540,21 +20546,21 @@ function Qb({
20540
20546
  onDragEnd: (B) => {
20541
20547
  const { active: f, over: L } = B;
20542
20548
  if (L && f.id !== L.id) {
20543
- const D = E.groups.findIndex(
20549
+ const D = A.groups.findIndex(
20544
20550
  (V) => V.id === f.id
20545
- ), F = E.groups.findIndex(
20551
+ ), F = A.groups.findIndex(
20546
20552
  (V) => V.id === L.id
20547
20553
  );
20548
- D !== -1 && F !== -1 && x(E.id, D, F);
20554
+ D !== -1 && F !== -1 && x(A.id, D, F);
20549
20555
  }
20550
20556
  },
20551
20557
  children: /* @__PURE__ */ e(
20552
20558
  Dn,
20553
20559
  {
20554
- items: E.groups.map((B) => B.id),
20560
+ items: A.groups.map((B) => B.id),
20555
20561
  strategy: aa,
20556
- children: E.groups.map(
20557
- (B) => S(B, b + 1, E.id)
20562
+ children: A.groups.map(
20563
+ (B) => S(B, b + 1, A.id)
20558
20564
  )
20559
20565
  }
20560
20566
  )
@@ -20567,7 +20573,7 @@ function Qb({
20567
20573
  size: "sm",
20568
20574
  className: "h-7 text-xs",
20569
20575
  variant: "outline",
20570
- onClick: () => d(E.id),
20576
+ onClick: () => d(A.id),
20571
20577
  children: [
20572
20578
  /* @__PURE__ */ e(vt, { className: "mr-1 h-3 w-3" }),
20573
20579
  "Add Condition"
@@ -20580,7 +20586,7 @@ function Qb({
20580
20586
  variant: "outline",
20581
20587
  size: "sm",
20582
20588
  className: "h-7 text-xs",
20583
- onClick: () => u(E.id),
20589
+ onClick: () => u(A.id),
20584
20590
  children: [
20585
20591
  /* @__PURE__ */ e(vt, { className: "mr-1 h-3 w-3" }),
20586
20592
  "Add Group"
@@ -20588,17 +20594,17 @@ function Qb({
20588
20594
  }
20589
20595
  )
20590
20596
  ] })
20591
- ] }) }, E.id) : /* @__PURE__ */ e(
20597
+ ] }) }, A.id) : /* @__PURE__ */ e(
20592
20598
  Hb,
20593
20599
  {
20594
- group: E,
20600
+ group: A,
20595
20601
  depth: b,
20596
20602
  parentGroupId: R,
20597
20603
  onUpdateGroupOperator: v,
20598
20604
  onUpdateGroupNegate: I,
20599
20605
  onRemoveGroup: g,
20600
20606
  onUpdateCondition: p,
20601
- onUpdateField: O,
20607
+ onUpdateField: E,
20602
20608
  onRemoveCondition: m,
20603
20609
  onReorderConditions: N,
20604
20610
  onReorderGroups: x,
@@ -20608,7 +20614,7 @@ function Qb({
20608
20614
  renderFilterGroup: S,
20609
20615
  updateConditionFields: h
20610
20616
  },
20611
- E.id
20617
+ A.id
20612
20618
  ), k = Bo(t);
20613
20619
  return /* @__PURE__ */ n("div", { className: "space-y-4", children: [
20614
20620
  /* @__PURE__ */ e(lo, { children: /* @__PURE__ */ e(io, { className: "p-4", children: /* @__PURE__ */ n("div", { className: "space-y-4", children: [
@@ -20623,7 +20629,7 @@ function Qb({
20623
20629
  size: "sm",
20624
20630
  id: "advanced-mode",
20625
20631
  checked: M,
20626
- onCheckedChange: (E) => T(E)
20632
+ onCheckedChange: (A) => T(A)
20627
20633
  }
20628
20634
  ),
20629
20635
  /* @__PURE__ */ e(
@@ -20635,7 +20641,7 @@ function Qb({
20635
20641
  }
20636
20642
  )
20637
20643
  ] }) }),
20638
- A && /* @__PURE__ */ n("div", { className: "mt-4 border-t border-border pt-4", children: [
20644
+ O && /* @__PURE__ */ n("div", { className: "mt-4 border-t border-border pt-4", children: [
20639
20645
  /* @__PURE__ */ e("div", { className: "mb-2 text-xs font-medium text-muted-foreground", children: "SQL WHERE Clause Preview" }),
20640
20646
  /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-md border bg-muted p-3", children: /* @__PURE__ */ e("pre", { className: "whitespace-pre-wrap font-mono text-xs text-muted-foreground", children: w(l) }) })
20641
20647
  ] })
@@ -20647,7 +20653,7 @@ function Qb({
20647
20653
  ee,
20648
20654
  {
20649
20655
  size: "sm",
20650
- onClick: () => s(A ? l : null),
20656
+ onClick: () => s(O ? l : null),
20651
20657
  children: "Apply Filters"
20652
20658
  }
20653
20659
  )
@@ -20702,7 +20708,7 @@ function Jb({
20702
20708
  getFieldsForContainer: s,
20703
20709
  setFieldsForContainer: r
20704
20710
  }) {
20705
- var w, A;
20711
+ var w, O;
20706
20712
  const [c, l] = K(null), i = P((C) => C.card), o = P(
20707
20713
  (C) => C.actions.updateCardConfig
20708
20714
  ), d = P(
@@ -20710,7 +20716,7 @@ function Jb({
20710
20716
  ), u = (w = i == null ? void 0 : i.config) == null ? void 0 : w.joinPlan, m = Ee(
20711
20717
  (C) => C.entityName === Pp || C.entityName === "calculated_fields" || C.qualifiedEntityName === "calculated_fields",
20712
20718
  []
20713
- ), g = (A = i == null ? void 0 : i.dataSource) == null ? void 0 : A.semanticDomainId, { data: p } = oh(g), h = [
20719
+ ), g = (O = i == null ? void 0 : i.dataSource) == null ? void 0 : O.semanticDomainId, { data: p } = oh(g), h = [
20714
20720
  ...a,
20715
20721
  ...s("groupBy"),
20716
20722
  ...s("pivotBy"),
@@ -20724,13 +20730,13 @@ function Jb({
20724
20730
  l(C.active.id);
20725
20731
  }, []), N = Ee(
20726
20732
  (C) => {
20727
- var E;
20733
+ var A;
20728
20734
  const { active: y, over: M } = C;
20729
20735
  if (!M || !t) {
20730
20736
  l(null);
20731
20737
  return;
20732
20738
  }
20733
- const T = y.id, O = M.id, S = v(T), k = v(O) || O;
20739
+ const T = y.id, E = M.id, S = v(T), k = v(E) || E;
20734
20740
  if (k === "sortBy") {
20735
20741
  if (S === "source") {
20736
20742
  const b = a.find((B) => B.id === T);
@@ -20814,7 +20820,7 @@ function Jb({
20814
20820
  if (ch(b, {
20815
20821
  joinabilityMap: p.joinabilityMap,
20816
20822
  selectedFields: R,
20817
- baseEntityName: (E = u == null ? void 0 : u.baseEntity) == null ? void 0 : E.name,
20823
+ baseEntityName: (A = u == null ? void 0 : u.baseEntity) == null ? void 0 : A.name,
20818
20824
  // Pass authoritative base entity
20819
20825
  datasetAliases: p.datasets
20820
20826
  }).state === "unreachable") {
@@ -20925,7 +20931,7 @@ function Jb({
20925
20931
  return;
20926
20932
  }
20927
20933
  if (S && k && S === k && S !== "source") {
20928
- const b = s(S), R = b.findIndex((f) => f.id === T), B = b.findIndex((f) => f.id === O);
20934
+ const b = s(S), R = b.findIndex((f) => f.id === T), B = b.findIndex((f) => f.id === E);
20929
20935
  if (R !== B) {
20930
20936
  const f = fs(b, R, B);
20931
20937
  r(S, f);
@@ -21251,9 +21257,9 @@ function ov({
21251
21257
  (fe) => fe.inlineFilterValuesMap[(r == null ? void 0 : r.id) || ""]
21252
21258
  ), d = P(
21253
21259
  (fe) => fe.actions.removeCardInlineFilterValue
21254
- ), u = Ne((fe) => fe.filterValues), m = Ne((fe) => fe.selectedSheetId), { updateCardConfig: g, setCard: p, updateCardInFrame: h, setShowAIDialog: v } = Se(), I = P((fe) => fe.showAIDialog), N = P((fe) => fe.isDevMode), x = Ne((fe) => fe.isVisualEditing), [w, A] = K(!1), [C, y] = K(!1), [M, T] = K(!1), [O, S] = K(
21260
+ ), u = Ne((fe) => fe.filterValues), m = Ne((fe) => fe.selectedSheetId), { updateCardConfig: g, setCard: p, updateCardInFrame: h, setShowAIDialog: v } = Se(), I = P((fe) => fe.showAIDialog), N = P((fe) => fe.isDevMode), x = Ne((fe) => fe.isVisualEditing), [w, O] = K(!1), [C, y] = K(!1), [M, T] = K(!1), [E, S] = K(
21255
21261
  null
21256
- ), { config: k } = yr(Sr).tokenProps, E = (k == null ? void 0 : k.showInfoTab) !== !1, b = (k == null ? void 0 : k.showQueryDebugTools) !== !1, [R, B] = sv();
21262
+ ), { config: k } = yr(Sr).tokenProps, A = (k == null ? void 0 : k.showInfoTab) !== !1, b = (k == null ? void 0 : k.showQueryDebugTools) !== !1, [R, B] = sv();
21257
21263
  P(
21258
21264
  (fe) => {
21259
21265
  var je;
@@ -21451,7 +21457,7 @@ function ov({
21451
21457
  ] })
21452
21458
  ] }),
21453
21459
  /* @__PURE__ */ n("div", { className: "flex min-h-0 grow flex-col", children: [
21454
- t === "chart" ? $ ? /* @__PURE__ */ e(rv, { showInfoTab: E }) : /* @__PURE__ */ e("div", { className: "flex grow flex-col", children: /* @__PURE__ */ e(
21460
+ t === "chart" ? $ ? /* @__PURE__ */ e(rv, { showInfoTab: A }) : /* @__PURE__ */ e("div", { className: "flex grow flex-col", children: /* @__PURE__ */ e(
21455
21461
  tv,
21456
21462
  {
21457
21463
  card: r,
@@ -21493,7 +21499,7 @@ function ov({
21493
21499
  }
21494
21500
  )
21495
21501
  ] }),
21496
- t === "info" && E && /* @__PURE__ */ e("div", { className: "flex min-h-0 flex-1 flex-col pb-2", children: /* @__PURE__ */ e("div", { className: "flex min-h-0 flex-1 flex-col rounded-md bg-background px-1", children: $ ? /* @__PURE__ */ e(
21502
+ t === "info" && A && /* @__PURE__ */ e("div", { className: "flex min-h-0 flex-1 flex-col pb-2", children: /* @__PURE__ */ e("div", { className: "flex min-h-0 flex-1 flex-col rounded-md bg-background px-1", children: $ ? /* @__PURE__ */ e(
21497
21503
  Wf,
21498
21504
  {
21499
21505
  error: $,
@@ -21546,12 +21552,12 @@ function ov({
21546
21552
  )
21547
21553
  ) }) })
21548
21554
  ] }),
21549
- O && /* @__PURE__ */ e(
21555
+ E && /* @__PURE__ */ e(
21550
21556
  Dr,
21551
21557
  {
21552
21558
  open: C,
21553
21559
  onOpenChange: y,
21554
- feedbackData: O
21560
+ feedbackData: E
21555
21561
  }
21556
21562
  )
21557
21563
  ] })
@@ -21619,19 +21625,19 @@ function uv({ column: t, isSelected: a, onSelect: s, availableFields: r, width:
21619
21625
  document.addEventListener("mousemove", Q), document.addEventListener("mouseup", J);
21620
21626
  }, [c, t.id, l]), x = (V = i == null ? void 0 : i.config) == null ? void 0 : V.filters, w = ($ = x == null ? void 0 : x.conditions) == null ? void 0 : $.some(
21621
21627
  (z) => z.field.name === t.name && z.field.qualifiedEntityName === t.qualifiedEntityName
21622
- ), A = (z) => {
21628
+ ), O = (z) => {
21623
21629
  z ? m(i.id, z) : o(i.id, { filters: void 0 });
21624
21630
  }, {
21625
21631
  attributes: C,
21626
21632
  listeners: y,
21627
21633
  setNodeRef: M,
21628
21634
  transform: T,
21629
- transition: O,
21635
+ transition: E,
21630
21636
  isDragging: S
21631
21637
  } = Ts({ id: t.id }), k = {
21632
21638
  transform: Ds.Transform.toString(T),
21633
- transition: O
21634
- }, E = pt(t.dataType), b = mv(E), R = () => {
21639
+ transition: E
21640
+ }, A = pt(t.dataType), b = mv(A), R = () => {
21635
21641
  var J;
21636
21642
  const z = ((J = i == null ? void 0 : i.config) == null ? void 0 : J.sortByColumns) || [], Q = z.findIndex((j) => j.name === t.name);
21637
21643
  if (Q !== -1) {
@@ -21827,7 +21833,7 @@ function uv({ column: t, isSelected: a, onSelect: s, availableFields: r, width:
21827
21833
  editingCondition: w ? (Y = x == null ? void 0 : x.conditions) == null ? void 0 : Y.find(
21828
21834
  (z) => z.field.name === t.name && z.field.qualifiedEntityName === t.qualifiedEntityName
21829
21835
  ) : void 0,
21830
- onSave: A
21836
+ onSave: O
21831
21837
  }
21832
21838
  )
21833
21839
  ]
@@ -21852,7 +21858,7 @@ function hv({
21852
21858
  sourceFields: r = [],
21853
21859
  filterableFields: c = r
21854
21860
  }) {
21855
- var S, k, E, b;
21861
+ var S, k, A, b;
21856
21862
  const l = P((R) => R.card), { updateCardConfig: i } = Se(), [o, d] = K(null), [u, m] = K({}), [g, p] = K(!1), h = ce(() => {
21857
21863
  var f, L;
21858
21864
  const R = ((f = l == null ? void 0 : l.config) == null ? void 0 : f.groupByColumns) || [], B = ((L = l == null ? void 0 : l.config) == null ? void 0 : L.metricColumns) || [];
@@ -21862,7 +21868,7 @@ function hv({
21862
21868
  return r.filter((B) => !R.has(`${B.qualifiedEntityName}.${B.name}`));
21863
21869
  }, [r, h]), { data: I, isLoading: N } = Bt(l), x = (I == null ? void 0 : I.records) || [], w = Ee((R, B) => {
21864
21870
  m((f) => ({ ...f, [R]: B }));
21865
- }, []), A = Ee((R) => {
21871
+ }, []), O = Ee((R) => {
21866
21872
  var D, F;
21867
21873
  const B = pt(R.dataType), f = ((D = l == null ? void 0 : l.config) == null ? void 0 : D.groupByColumns) || [], L = ((F = l == null ? void 0 : l.config) == null ? void 0 : F.metricColumns) || [];
21868
21874
  if (B === "number") {
@@ -21886,7 +21892,7 @@ function hv({
21886
21892
  });
21887
21893
  }
21888
21894
  p(!1);
21889
- }, [(E = l == null ? void 0 : l.config) == null ? void 0 : E.groupByColumns, (b = l == null ? void 0 : l.config) == null ? void 0 : b.metricColumns, l.id, i]), C = ja(
21895
+ }, [(A = l == null ? void 0 : l.config) == null ? void 0 : A.groupByColumns, (b = l == null ? void 0 : l.config) == null ? void 0 : b.metricColumns, l.id, i]), C = ja(
21890
21896
  yn(qa, {
21891
21897
  activationConstraint: {
21892
21898
  distance: 8
@@ -21905,7 +21911,7 @@ function hv({
21905
21911
  metricColumns: $
21906
21912
  });
21907
21913
  }
21908
- }, T = o ? h.find((R) => R.id === o) : null, O = (R) => {
21914
+ }, T = o ? h.find((R) => R.id === o) : null, E = (R) => {
21909
21915
  let B = "";
21910
21916
  for (; R >= 0; )
21911
21917
  B = String.fromCharCode(R % 26 + 65) + B, R = Math.floor(R / 26) - 1;
@@ -21940,7 +21946,7 @@ function hv({
21940
21946
  minWidth: u[R.id] ? `${u[R.id]}px` : "120px"
21941
21947
  },
21942
21948
  className: "border-r border-border bg-muted/30 px-2 py-1 text-center text-xs font-medium text-muted-foreground",
21943
- children: O(B)
21949
+ children: E(B)
21944
21950
  },
21945
21951
  `letter-${R.id}`
21946
21952
  ))
@@ -21990,7 +21996,7 @@ function hv({
21990
21996
  za,
21991
21997
  {
21992
21998
  value: R.label || R.name,
21993
- onSelect: () => A(R),
21999
+ onSelect: () => O(R),
21994
22000
  children: [
21995
22001
  /* @__PURE__ */ e(f, { className: "mr-2 h-3.5 w-3.5 text-muted-foreground" }),
21996
22002
  /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
@@ -22096,39 +22102,39 @@ function fv({
22096
22102
  entityGroups: t,
22097
22103
  isLoading: a = !1
22098
22104
  }) {
22099
- var A, C;
22100
- const s = P((y) => y.card), { updateCardConfig: r, removeGroupByColumn: c, removeMetricColumn: l } = Se(), [i, o] = K(!0), [d, u] = K(""), [m, g] = K(/* @__PURE__ */ new Set()), p = ((A = s == null ? void 0 : s.config) == null ? void 0 : A.groupByColumns) || [], h = ((C = s == null ? void 0 : s.config) == null ? void 0 : C.metricColumns) || [], v = (y) => {
22105
+ var O, C;
22106
+ const s = P((y) => y.card), { updateCardConfig: r, removeGroupByColumn: c, removeMetricColumn: l } = Se(), [i, o] = K(!0), [d, u] = K(""), [m, g] = K(/* @__PURE__ */ new Set()), p = ((O = s == null ? void 0 : s.config) == null ? void 0 : O.groupByColumns) || [], h = ((C = s == null ? void 0 : s.config) == null ? void 0 : C.metricColumns) || [], v = (y) => {
22101
22107
  const M = new Set(m);
22102
22108
  M.has(y) ? M.delete(y) : M.add(y), g(M);
22103
22109
  }, I = (y) => p.some((M) => M.name === y.name && M.qualifiedEntityName === y.qualifiedEntityName) || h.some((M) => M.name === y.name && M.qualifiedEntityName === y.qualifiedEntityName), N = (y, M) => {
22104
22110
  if (M)
22105
22111
  if (pt(y.dataType) === "number") {
22106
- const O = {
22112
+ const E = {
22107
22113
  ...y,
22108
22114
  id: `metric-${y.id}-${Date.now()}`,
22109
22115
  role: "metric",
22110
22116
  aggregate: "SUM"
22111
22117
  };
22112
22118
  r(s.id, {
22113
- metricColumns: [...h, O]
22119
+ metricColumns: [...h, E]
22114
22120
  });
22115
22121
  } else {
22116
- const O = {
22122
+ const E = {
22117
22123
  ...y,
22118
22124
  id: `groupby-${y.id}-${Date.now()}`,
22119
22125
  role: "groupby"
22120
22126
  };
22121
22127
  r(s.id, {
22122
- groupByColumns: [...p, O]
22128
+ groupByColumns: [...p, E]
22123
22129
  });
22124
22130
  }
22125
22131
  else {
22126
22132
  const T = p.findIndex(
22127
22133
  (S) => S.name === y.name && S.qualifiedEntityName === y.qualifiedEntityName
22128
- ), O = h.findIndex(
22134
+ ), E = h.findIndex(
22129
22135
  (S) => S.name === y.name && S.qualifiedEntityName === y.qualifiedEntityName
22130
22136
  );
22131
- T !== -1 && c(s.id, p[T].id), O !== -1 && l(s.id, h[O].id);
22137
+ T !== -1 && c(s.id, p[T].id), E !== -1 && l(s.id, h[E].id);
22132
22138
  }
22133
22139
  }, x = (y) => {
22134
22140
  if (!d) return y;
@@ -22266,8 +22272,8 @@ function fv({
22266
22272
  /* @__PURE__ */ e("span", { className: "flex-1 truncate text-left", children: y.label || y.entityName }),
22267
22273
  /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: M.length })
22268
22274
  ] }),
22269
- /* @__PURE__ */ e(ln, { children: /* @__PURE__ */ e("div", { className: "ml-4 space-y-0.5 border-l border-border pl-2", children: M.map((O) => {
22270
- const S = w(O.dataType), k = I(O);
22275
+ /* @__PURE__ */ e(ln, { children: /* @__PURE__ */ e("div", { className: "ml-4 space-y-0.5 border-l border-border pl-2", children: M.map((E) => {
22276
+ const S = w(E.dataType), k = I(E);
22271
22277
  return /* @__PURE__ */ n(
22272
22278
  "label",
22273
22279
  {
@@ -22280,15 +22286,15 @@ function fv({
22280
22286
  Wt,
22281
22287
  {
22282
22288
  checked: k,
22283
- onCheckedChange: (E) => N(O, E),
22289
+ onCheckedChange: (A) => N(E, A),
22284
22290
  className: "h-3.5 w-3.5"
22285
22291
  }
22286
22292
  ),
22287
22293
  /* @__PURE__ */ e(S, { className: "h-3.5 w-3.5 text-muted-foreground" }),
22288
- /* @__PURE__ */ e("span", { className: "flex-1 truncate", children: O.label || O.name })
22294
+ /* @__PURE__ */ e("span", { className: "flex-1 truncate", children: E.label || E.name })
22289
22295
  ]
22290
22296
  },
22291
- O.id
22297
+ E.id
22292
22298
  );
22293
22299
  }) }) })
22294
22300
  ]
@@ -22343,8 +22349,8 @@ function xv({
22343
22349
  const g = (v) => {
22344
22350
  const I = `[${v.label || v.name}]`, N = m.current;
22345
22351
  if (N) {
22346
- const x = N.selectionStart || 0, w = N.selectionEnd || 0, A = t.slice(0, x) + I + t.slice(w);
22347
- a(A), setTimeout(() => {
22352
+ const x = N.selectionStart || 0, w = N.selectionEnd || 0, O = t.slice(0, x) + I + t.slice(w);
22353
+ a(O), setTimeout(() => {
22348
22354
  N.setSelectionRange(x + I.length, x + I.length), N.focus();
22349
22355
  }, 0);
22350
22356
  } else
@@ -22541,7 +22547,7 @@ function vv() {
22541
22547
  P((Y) => Y.activeTabCardId), P(
22542
22548
  (Y) => Y.actions.getAvailableFields
22543
22549
  );
22544
- const { addCard: I, removeCard: N, updateCard: x, setActiveCard: w, updateFilters: A } = Se(), {
22550
+ const { addCard: I, removeCard: N, updateCard: x, setActiveCard: w, updateFilters: O } = Se(), {
22545
22551
  columnFields: C = [],
22546
22552
  scopedFields: y = [],
22547
22553
  filterableFields: M = []
@@ -22551,16 +22557,16 @@ function vv() {
22551
22557
  distance: 8
22552
22558
  }
22553
22559
  })
22554
- ), O = v, {
22560
+ ), E = v, {
22555
22561
  getFieldsForContainer: S,
22556
22562
  setFieldsForContainer: k
22557
- } = Ao(O), { activeField: E, handleDragStart: b, handleDragEnd: R } = Jb({
22563
+ } = Ao(E), { activeField: A, handleDragStart: b, handleDragEnd: R } = Jb({
22558
22564
  activeCardId: h.activeCardId,
22559
22565
  sourceFields: y,
22560
22566
  getFieldsForContainer: S,
22561
22567
  setFieldsForContainer: k
22562
22568
  }), B = (Y, z) => {
22563
- z && A(Y, z);
22569
+ z && O(Y, z);
22564
22570
  }, f = (Y) => {
22565
22571
  var z;
22566
22572
  x(Y, {
@@ -22575,7 +22581,7 @@ function vv() {
22575
22581
  return Y.groups.forEach((Q) => {
22576
22582
  z += D(Q);
22577
22583
  }), z;
22578
- }, F = D(((V = O == null ? void 0 : O.config) == null ? void 0 : V.filters) || null);
22584
+ }, F = D(((V = E == null ? void 0 : E.config) == null ? void 0 : V.filters) || null);
22579
22585
  return /* @__PURE__ */ n(
22580
22586
  $n,
22581
22587
  {
@@ -22603,7 +22609,7 @@ function vv() {
22603
22609
  metricsFields: S("metrics"),
22604
22610
  sortByFields: S("sortBy"),
22605
22611
  detailFields: S("detailColumns"),
22606
- activeField: E,
22612
+ activeField: A,
22607
22613
  isVisible: i,
22608
22614
  onToggleVisibility: () => o(!i)
22609
22615
  }
@@ -22616,7 +22622,7 @@ function vv() {
22616
22622
  onViewChange: a,
22617
22623
  onFiltersClick: () => r(!0),
22618
22624
  filterCount: F,
22619
- activeCard: O,
22625
+ activeCard: E,
22620
22626
  columns: C,
22621
22627
  getFieldsForContainer: S,
22622
22628
  cards: h.cards,
@@ -22638,11 +22644,11 @@ function vv() {
22638
22644
  }
22639
22645
  ) })
22640
22646
  ] }),
22641
- O && /* @__PURE__ */ e(
22647
+ E && /* @__PURE__ */ e(
22642
22648
  Wb,
22643
22649
  {
22644
- cardId: O.id,
22645
- filters: (($ = O.config) == null ? void 0 : $.filters) || null,
22650
+ cardId: E.id,
22651
+ filters: (($ = E.config) == null ? void 0 : $.filters) || null,
22646
22652
  onFiltersChange: B,
22647
22653
  onClearFilters: f,
22648
22654
  availableFields: L,
@@ -22650,7 +22656,7 @@ function vv() {
22650
22656
  onOpenChange: r
22651
22657
  }
22652
22658
  ),
22653
- /* @__PURE__ */ e(Yo, { dropAnimation: null, children: /* @__PURE__ */ e(cv, { activeField: E || null }) })
22659
+ /* @__PURE__ */ e(Yo, { dropAnimation: null, children: /* @__PURE__ */ e(cv, { activeField: A || null }) })
22654
22660
  ]
22655
22661
  }
22656
22662
  );
@@ -22661,24 +22667,24 @@ function yv({ authToken: t, onSave: a, onClose: s }) {
22661
22667
  d("editor", T);
22662
22668
  },
22663
22669
  [d]
22664
- ), { setAuthToken: I } = $o(), { setShowAIDialog: N, setOnSave: x, setOnClose: w } = Se(), { setActiveAssistantType: A } = Lr();
22670
+ ), { setAuthToken: I } = $o(), { setShowAIDialog: N, setOnSave: x, setOnClose: w } = Se(), { setActiveAssistantType: O } = Lr();
22665
22671
  Te(() => {
22666
22672
  a && x(a), s && w(s);
22667
22673
  }, [a, x, s, w]), Te(() => {
22668
22674
  t && t.accessToken && I(t);
22669
22675
  }, [t, I]), Te(() => {
22670
- var T, O;
22671
- c ? ((T = r.current) == null || T.resize(40), o("editor", !0), A("editor")) : ((O = r.current) == null || O.resize(0), o("editor", !1), m === "editor" && i(null), A(null));
22676
+ var T, E;
22677
+ c ? ((T = r.current) == null || T.resize(40), o("editor", !0), O("editor")) : ((E = r.current) == null || E.resize(0), o("editor", !1), m === "editor" && i(null), O(null));
22672
22678
  }, [
22673
22679
  c,
22674
22680
  o,
22675
- A,
22681
+ O,
22676
22682
  i,
22677
22683
  m
22678
22684
  ]);
22679
22685
  function C(T) {
22680
- var O;
22681
- T < 1 ? (N(!1), o("editor", !1), m === "editor" && i(null), A(null), (O = r.current) == null || O.resize(0)) : (c || (N(!0), A("editor")), u.isOpen || o("editor", !0));
22686
+ var E;
22687
+ T < 1 ? (N(!1), o("editor", !1), m === "editor" && i(null), O(null), (E = r.current) == null || E.resize(0)) : (c || (N(!0), O("editor")), u.isOpen || o("editor", !0));
22682
22688
  }
22683
22689
  function y() {
22684
22690
  return /* @__PURE__ */ n(we, { children: [
@@ -22804,7 +22810,7 @@ function zv() {
22804
22810
  (h) => h.actions.updateDocumentSectionCard
22805
22811
  ), m = kh();
22806
22812
  async function g(h) {
22807
- var w, A, C;
22813
+ var w, O, C;
22808
22814
  if ((c == null ? void 0 : c.type) === "documentSection") {
22809
22815
  const y = Dh(
22810
22816
  h,
@@ -22833,7 +22839,7 @@ function zv() {
22833
22839
  var M;
22834
22840
  return y.id === t && ((M = y.frames) == null ? void 0 : M.some((T) => T.id === h.id));
22835
22841
  }
22836
- ) : !1, I = (C = (A = a == null ? void 0 : a.sheets) == null ? void 0 : A.find(
22842
+ ) : !1, I = (C = (O = a == null ? void 0 : a.sheets) == null ? void 0 : O.find(
22837
22843
  (y) => {
22838
22844
  var M;
22839
22845
  return (M = y.frames) == null ? void 0 : M.some((T) => T.id === h.id);