react-semaphor 0.1.588 → 0.1.589

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 (24) hide show
  1. package/dist/brand-studio/index.js +5 -5
  2. package/dist/chunks/{assistant-chat-BeM6joPc.js → assistant-chat-DBPa6sJU.js} +5 -5
  3. package/dist/chunks/{card-filter-builder-DmodrhyI.js → card-filter-builder-CGM7ROM0.js} +166 -166
  4. package/dist/chunks/{dashboard-Tu5wT0Cw.js → dashboard-UXH3E31V.js} +1 -1
  5. package/dist/chunks/{dashboard-briefing-launcher-D8jMxIJo.js → dashboard-briefing-launcher-CTFuSWH_.js} +154 -154
  6. package/dist/chunks/{dashboard-controls-uzeAIEkM.js → dashboard-controls-BcxWhOKw.js} +42 -42
  7. package/dist/chunks/{dashboard-json-i5rpFNCg.js → dashboard-json-C-oBcKKC.js} +2 -2
  8. package/dist/chunks/{edit-dashboard-visual-BpEK_Sls.js → edit-dashboard-visual-COjKc_Du.js} +718 -718
  9. package/dist/chunks/{layout-grid-XCYphks2.js → layout-grid-BG__sPkb.js} +1 -1
  10. package/dist/chunks/{list-filter-DGV3fqqv.js → list-filter-Cb8i7N8f.js} +1 -1
  11. package/dist/chunks/{paintbrush-DEEZXhDj.js → paintbrush-C310xSuR.js} +1 -1
  12. package/dist/chunks/{palette-Bgy0H-Nt.js → palette-Ci5P91Zb.js} +1 -1
  13. package/dist/chunks/report-preferences-dialog-DtuOcejh.js +1637 -0
  14. package/dist/chunks/{save-xnRCvMeA.js → save-BhhXfp4s.js} +1 -1
  15. package/dist/chunks/{semaphor-ready-indicator-zU9reNmX.js → semaphor-ready-indicator-HGEnCavj.js} +27084 -26516
  16. package/dist/chunks/{shelf-drop-preview-context-R9sf4oDX.js → shelf-drop-preview-context-DaCXCdMA.js} +108 -108
  17. package/dist/chunks/{style-sheet-parts-D7NbsFL0.js → style-sheet-parts-CmXmKqGw.js} +30 -30
  18. package/dist/chunks/{upload-BXGgYS4g.js → upload-DDYc1Qjj.js} +1 -1
  19. package/dist/dashboard/index.js +1 -1
  20. package/dist/index.js +208 -209
  21. package/dist/style.css +1 -1
  22. package/dist/surfboard/index.js +1 -1
  23. package/package.json +1 -1
  24. package/dist/chunks/report-preferences-dialog-CTM0xfd0.js +0 -2028
@@ -1,17 +1,17 @@
1
1
  import { jsx as t, jsxs as r, Fragment as U } from "react/jsx-runtime";
2
2
  import la, { useState as E, useEffect as Ee, useCallback as ie, useMemo as Y, useLayoutEffect as Ut, useRef as et, useContext as Va } from "react";
3
- import { dK as it, bE as Le, bF as Ve, bH as Be, dL as Ba, b2 as $e, a$ as ot, dM as Pa, dN as lt, dO as Ct, ah as dt, ae as ve, u as w, dP as _a, dQ as Oa, bD as z, dR as za, ag as oe, aZ as Ma, c7 as Ra, dS as Ua, dT as $a, bx as da, bX as be, cr as ca, bW as tt, o as ja, k as qa, dU as Wa, cu as wt, cv as St, cw as kt, cx as Dt, cy as At, cz as Ft, cA as Et, cB as ua, cE as It, dV as Qa, dr as Ka, cj as pt, cg as je, ch as qe, dD as ha, ci as We, c3 as re, cs as Ga, cn as at, dW as Ha, c0 as Ya, dX as ma, bo as ct, bG as Tt, bI as ut, dY as pa, bC as Xa, dZ as Ja, bp as Za, i as en, cK as tn, d_ as an, K as nn, I as fa, bj as rn, L as sn, t as on, d$ as ln, e0 as dn, e1 as ga, e2 as cn, e3 as un, e4 as Ce, e5 as hn, R as ba, e6 as mn, e7 as pn, aW as fn, e8 as gn, e9 as ge, ea as bn, a4 as Lt, eb as xn, ec as ft, ed as vn, ee as $t, ef as yn, eg as Nn, eh as Cn, ei as xa, cV as wn, ej as Sn, ek as kn, el as Dn, dx as Vt, cF as va, em as An, en as jt, eo as Fn, ep as En, eq as In, er as Tn, b1 as Ln, by as Vn, c6 as ya, es as Bn, et as Pn, eu as Xe, ev as _n, ew as On, ex as zn, A as Mn, aL as Rn, aM as Un, ar as $n, aq as jn, ap as qn, ao as Wn, al as Qn, aj as Kn, ey as Gn, ez as Hn, eA as Yn, eB as Xn, eC as Jn, aJ as Zn } from "./semaphor-ready-indicator-zU9reNmX.js";
4
- import { c as Ae, B as L, X as Qe, s as Re, x as xe, L as de, q as Bt, j as Pt, p as er, F as _t, e as Ie, aa as Na, h as Te, f as nt, i as Ca, g as Nt, y as we, z as Se, A as ke, D as De, E as fe, ab as tr } from "./style-sheet-parts-D7NbsFL0.js";
5
- import { L as Ue } from "./layout-grid-XCYphks2.js";
3
+ import { dN as it, bG as Le, bH as Ve, bJ as Be, dO as Ba, b8 as $e, b5 as ot, dP as Pa, dQ as lt, dR as Ct, an as dt, ak as ve, u as w, dS as _a, dT as Oa, bF as z, dU as za, am as oe, b3 as Ra, ca as Ma, dV as Ua, dW as $a, bZ as da, b_ as be, cu as ca, bY as tt, w as ja, q as qa, dX as Wa, cx as wt, cy as St, cz as kt, cA as Dt, cB as At, cC as Ft, cD as Et, cE as ua, cH as It, dY as Qa, du as Ga, cm as pt, cj as je, ck as qe, dG as ha, cl as We, c6 as re, cv as Ka, cq as at, dZ as Ha, c3 as Ya, d_ as ma, bu as ct, bI as Tt, bK as ut, d$ as pa, bE as Xa, e0 as Ja, bv as Za, o as en, cN as tn, e1 as an, W as nn, P as fa, bp as rn, X as sn, G as on, e2 as ln, e3 as dn, e4 as ga, e5 as cn, e6 as un, e7 as Ce, e8 as hn, R as ba, e9 as mn, ea as pn, b0 as fn, eb as gn, ec as ge, ed as bn, aa as Lt, ee as xn, ef as ft, eg as vn, eh as $t, ei as yn, ej as Nn, ek as Cn, el as xa, cY as wn, em as Sn, en as kn, eo as Dn, dA as Vt, cI as va, ep as An, eq as jt, er as Fn, es as En, et as In, eu as Tn, b7 as Ln, bz as Vn, c9 as ya, ev as Bn, ew as Pn, ex as Xe, ey as _n, ez as On, eA as zn, A as Rn, aR as Mn, aS as Un, ax as $n, aw as jn, av as qn, au as Wn, ar as Qn, ap as Gn, eB as Kn, eC as Hn, eD as Yn, eE as Xn, eF as Jn, aP as Zn } from "./semaphor-ready-indicator-HGEnCavj.js";
4
+ import { c as Ae, B as L, X as Qe, s as Me, x as xe, L as de, q as Bt, j as Pt, p as er, F as _t, e as Ie, a8 as Na, h as Te, f as nt, i as Ca, g as Nt, y as we, z as Se, A as ke, D as De, E as fe, a9 as tr } from "./style-sheet-parts-CmXmKqGw.js";
5
+ import { L as Ue } from "./layout-grid-BG__sPkb.js";
6
6
  import { c as J } from "./pickers-DkqmtnTL.js";
7
7
  import { S as ar } from "./validators-CrYXNnNE.js";
8
8
  import "./matrix-operation-contract-JSmproo9.js";
9
9
  import "./analytics-base-schemas-8wz9vqn_.js";
10
10
  import "../value-format-preferences/index.js";
11
11
  import { s as Je } from "./normalize-dashboard-for-dirty-check-XKgH3GFX.js";
12
- import { bI as qt, be as Wt, eN as Qt, gl as nr, gm as rt, gk as Kt, gn as rr, o as Ke, go as sr, p as ir, gp as or, gq as lr, gr as dr, cG as cr, gs as ur, l as hr, fJ as mr, gt as pr, gu as fr, a as Ot, aO as gr, a4 as br, ck as xr, gv as vr, gw as yr, cv as Nr, gx as Cr, gy as Gt, gz as wr } from "./resolve-dashboard-input-context-DFBIngUZ.js";
13
- import { S as wa } from "./save-xnRCvMeA.js";
14
- import { V as Sr, L as kr, u as Sa, C as ka, F as Dr, a as Ar, A as Fr, b as Er } from "./card-filter-builder-DmodrhyI.js";
12
+ import { bI as qt, be as Wt, eN as Qt, gl as nr, gm as rt, gk as Gt, gn as rr, o as Ge, go as sr, p as ir, gp as or, gq as lr, gr as dr, cG as cr, gs as ur, l as hr, fJ as mr, gt as pr, gu as fr, a as Ot, aO as gr, a4 as br, ck as xr, gv as vr, gw as yr, cv as Nr, gx as Cr, gy as Kt, gz as wr } from "./resolve-dashboard-input-context-DFBIngUZ.js";
13
+ import { S as wa } from "./save-BhhXfp4s.js";
14
+ import { V as Sr, L as kr, u as Sa, C as ka, F as Dr, a as Ar, A as Fr, b as Er } from "./card-filter-builder-CGM7ROM0.js";
15
15
  import { createPortal as Ir } from "react-dom";
16
16
  import { b1 as Ht, aB as Tr } from "./pivot-result-contract-expectations-DbBahmgc.js";
17
17
  import { aA as Lr, ao as Vr, D as Br, a9 as st, S as Pr } from "./bookmark-state-Bn7k3ttp.js";
@@ -20,7 +20,7 @@ import "./schema-C9NPiIru.js";
20
20
  import "./index-CV_Kzou0.js";
21
21
  import "./context-CVXTFljo.js";
22
22
  import { v as _r, G as Or } from "./filter-reach-copy-D5AmDHda.js";
23
- import { a as Yt, d as Xt, c as zr, i as Mr, b as Rr, e as Ur, v as Jt, f as Zt, g as $r } from "./variable-draft-rbtGPvmX.js";
23
+ import { a as Yt, d as Xt, c as zr, i as Rr, b as Mr, e as Ur, v as Jt, f as Zt, g as $r } from "./variable-draft-rbtGPvmX.js";
24
24
  import { g as pe, d as jr, a as qr } from "./index-dGxJTaP1.js";
25
25
  /**
26
26
  * @license lucide-react v0.453.0 - ISC
@@ -71,7 +71,7 @@ const ta = Ae("MonitorSmartphone", [
71
71
  * This source code is licensed under the ISC license.
72
72
  * See the LICENSE file in the root directory of this source tree.
73
73
  */
74
- const Kr = Ae("MousePointer2", [
74
+ const Gr = Ae("MousePointer2", [
75
75
  [
76
76
  "path",
77
77
  {
@@ -86,7 +86,7 @@ const Kr = Ae("MousePointer2", [
86
86
  * This source code is licensed under the ISC license.
87
87
  * See the LICENSE file in the root directory of this source tree.
88
88
  */
89
- const Gr = Ae("Newspaper", [
89
+ const Kr = Ae("Newspaper", [
90
90
  [
91
91
  "path",
92
92
  {
@@ -170,7 +170,7 @@ function Xr({
170
170
  /* @__PURE__ */ r("div", { className: "space-y-3 px-4 py-3", children: [
171
171
  /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Create a saved visual that can be reused across dashboards." }),
172
172
  /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
173
- /* @__PURE__ */ t(Re, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
173
+ /* @__PURE__ */ t(Me, { htmlFor: "visual-title", className: "text-[12px]", children: "Name" }),
174
174
  /* @__PURE__ */ t(
175
175
  xe,
176
176
  {
@@ -187,7 +187,7 @@ function Xr({
187
187
  )
188
188
  ] }),
189
189
  /* @__PURE__ */ r("div", { className: "space-y-1.5", children: [
190
- /* @__PURE__ */ t(Re, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
190
+ /* @__PURE__ */ t(Me, { htmlFor: "visual-description", className: "text-[12px]", children: "Description" }),
191
191
  /* @__PURE__ */ t(
192
192
  xe,
193
193
  {
@@ -357,7 +357,7 @@ function ts() {
357
357
  ), a = Jr(e);
358
358
  return { getUpdatedFrame: ie(() => {
359
359
  var N;
360
- Ma();
360
+ Ra();
361
361
  const {
362
362
  frame: n,
363
363
  card: i,
@@ -412,7 +412,7 @@ function Pe() {
412
412
  setIsDashboardEditing: O,
413
413
  setIsVisualEditing: b,
414
414
  clearSelectedFrameId: S
415
- } = ve(), v = w((_) => _.selectedSheetId), T = w((_) => _.selectedFrameId), F = w((_) => _.dashboard), G = w(
415
+ } = ve(), v = w((_) => _.selectedSheetId), T = w((_) => _.selectedFrameId), F = w((_) => _.dashboard), K = w(
416
416
  (_) => _.inlineFilterValuesMap
417
417
  ), P = _a((i == null ? void 0 : i.id) || "", {
418
418
  enabled: !!(i != null && i.id) && !!(e != null && e.accessToken)
@@ -447,7 +447,7 @@ function Pe() {
447
447
  dashboard: F,
448
448
  selectedSheetId: v,
449
449
  selectedFrameId: T,
450
- inlineFilterValuesMap: G
450
+ inlineFilterValuesMap: K
451
451
  }))
452
452
  throw new Error("Failed to setup editor with visual data");
453
453
  return { success: !0, fromCache: Z };
@@ -481,7 +481,7 @@ function Pe() {
481
481
  F,
482
482
  v,
483
483
  T,
484
- G
484
+ K
485
485
  ]
486
486
  ), X = ie(
487
487
  async (_) => {
@@ -502,12 +502,12 @@ function Pe() {
502
502
  const j = Da(ae);
503
503
  if (!(j != null && j.cards) || j.cards.length === 0)
504
504
  return te("Visual frame is malformed");
505
- const M = {
505
+ const R = {
506
506
  ...Oa(j),
507
507
  visualId: _.id
508
508
  // Link this frame to the library visual
509
509
  };
510
- return await n(v, M), O(!0), { success: !0, fromCache: I };
510
+ return await n(v, R), O(!0), { success: !0, fromCache: I };
511
511
  } catch (H) {
512
512
  return console.error("Error adding visual:", H), te(
513
513
  H instanceof Error ? H.message : "Failed to add visual to dashboard"
@@ -556,7 +556,7 @@ function as(e, a) {
556
556
  }
557
557
  function ns(e) {
558
558
  const a = (e || "").toLowerCase();
559
- return a.includes("table") ? Bt : a.includes("pie") || a.includes("donut") ? Qa : a.includes("line") ? Ka : a.includes("bar") ? er : Ue;
559
+ return a.includes("table") ? Bt : a.includes("pie") || a.includes("donut") ? Qa : a.includes("line") ? Ga : a.includes("bar") ? er : Ue;
560
560
  }
561
561
  function rs({ visual: e }) {
562
562
  const a = e.ownership.status === "public" ? "Public" : e.ownership.status === "shared" || e.ownership.sharedCount > 0 ? "Shared" : "Private";
@@ -574,10 +574,10 @@ function ji({
574
574
  l(/* @__PURE__ */ new Set()), h(null), m(null), g(!1), N(null);
575
575
  }, D = () => {
576
576
  a(!1), B();
577
- }, { selectVisual: O } = Ct(), { handleAddLibraryVisual: b, handleEditLibraryVisual: S } = Pe(), { isConsoleMode: v } = Ra(), {
577
+ }, { selectVisual: O } = Ct(), { handleAddLibraryVisual: b, handleEditLibraryVisual: S } = Pe(), { isConsoleMode: v } = Ma(), {
578
578
  resources: T,
579
579
  isLoading: F,
580
- isError: G,
580
+ isError: K,
581
581
  createResource: P,
582
582
  updateResource: Q,
583
583
  deleteResourceAsync: X,
@@ -593,7 +593,7 @@ function ji({
593
593
  startUpdating: H,
594
594
  stopUpdating: I,
595
595
  isUpdating: ae
596
- } = $a(), j = T, M = Y(() => {
596
+ } = $a(), j = T, R = Y(() => {
597
597
  const C = n.trim().toLowerCase();
598
598
  return C ? j.filter(
599
599
  (q) => {
@@ -610,23 +610,23 @@ function ji({
610
610
  (C) => C.permissions.canDelete
611
611
  ), he = ne.filter(
612
612
  (C) => C.permissions.canShare
613
- ), ye = M.length > 0 && M.every(
613
+ ), ye = R.length > 0 && R.every(
614
614
  (C) => o.has(C.id)
615
- ), x = M.some(
615
+ ), x = R.some(
616
616
  (C) => o.has(C.id)
617
- ), R = (C) => {
617
+ ), M = (C) => {
618
618
  const q = new Set(o);
619
619
  C(q), l(q);
620
620
  }, $ = (C) => {
621
- R((q) => {
621
+ M((q) => {
622
622
  q.has(C) ? q.delete(C) : q.add(C);
623
623
  });
624
- }, K = () => {
624
+ }, G = () => {
625
625
  l((C) => {
626
626
  const q = new Set(C);
627
- return ye ? M.forEach(
627
+ return ye ? R.forEach(
628
628
  (ee) => q.delete(ee.id)
629
- ) : M.forEach(
629
+ ) : R.forEach(
630
630
  (ee) => q.add(ee.id)
631
631
  ), q;
632
632
  });
@@ -648,7 +648,7 @@ function ji({
648
648
  V(C), _(C, {
649
649
  onSettled: () => V(null)
650
650
  });
651
- }, Ge = () => {
651
+ }, Ke = () => {
652
652
  if (ue.length === 0) {
653
653
  z.error("Select a visual you can delete");
654
654
  return;
@@ -705,7 +705,7 @@ function ji({
705
705
  );
706
706
  }, ce = (C) => {
707
707
  a(C), C || B();
708
- }, Me = y ? 1 : ue.length;
708
+ }, Re = y ? 1 : ue.length;
709
709
  return /* @__PURE__ */ r(U, { children: [
710
710
  /* @__PURE__ */ t(Le, { open: e, onOpenChange: ce, children: /* @__PURE__ */ r(
711
711
  Ve,
@@ -763,18 +763,18 @@ function ji({
763
763
  }
764
764
  )
765
765
  ] }),
766
- /* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: F ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(Yr, {}) }) : G ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ t("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : M.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
766
+ /* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-auto", children: F ? /* @__PURE__ */ t("div", { className: "p-3", children: /* @__PURE__ */ t(Yr, {}) }) : K ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: /* @__PURE__ */ t("p", { className: "text-[13px] text-destructive", children: "Failed to load visuals" }) }) : R.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-2 px-4 py-12 text-center", children: [
767
767
  /* @__PURE__ */ t(Ue, { className: "h-5 w-5 text-muted-foreground/60" }),
768
768
  /* @__PURE__ */ t("p", { className: "text-[13px] font-medium", children: n ? "No visuals found" : "No visuals yet" }),
769
769
  /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: n ? "Try a different search." : "Create a saved visual to add it here." })
770
770
  ] }) : /* @__PURE__ */ t(
771
771
  ss,
772
772
  {
773
- visuals: M,
773
+ visuals: R,
774
774
  selectedIds: o,
775
775
  allFilteredSelected: ye,
776
776
  someFilteredSelected: x,
777
- onSelectAll: K,
777
+ onSelectAll: G,
778
778
  onToggleSelection: $,
779
779
  onAddVisual: le,
780
780
  onOpenVisual: ht,
@@ -824,7 +824,7 @@ function ji({
824
824
  size: "xs",
825
825
  variant: "outline",
826
826
  className: "text-destructive hover:text-destructive",
827
- onClick: Ge,
827
+ onClick: Ke,
828
828
  disabled: ue.length === 0,
829
829
  children: [
830
830
  /* @__PURE__ */ t(tt, { className: "h-3.5 w-3.5" }),
@@ -901,9 +901,9 @@ function ji({
901
901
  /* @__PURE__ */ r(kt, { children: [
902
902
  /* @__PURE__ */ r(Dt, { children: [
903
903
  "Delete ",
904
- Me,
904
+ Re,
905
905
  " visual",
906
- Me === 1 ? "" : "s",
906
+ Re === 1 ? "" : "s",
907
907
  "?"
908
908
  ] }),
909
909
  /* @__PURE__ */ t(At, { children: "This cannot be undone. Visuals already added to dashboards may need to be removed from those dashboards separately." })
@@ -916,7 +916,7 @@ function ji({
916
916
  onClick: (C) => {
917
917
  C.preventDefault(), mt();
918
918
  },
919
- disabled: Z || Me === 0,
919
+ disabled: Z || Re === 0,
920
920
  children: [
921
921
  Z ? /* @__PURE__ */ t(de, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(tt, { className: "h-3.5 w-3.5" }),
922
922
  Z ? "Deleting..." : "Delete"
@@ -1127,7 +1127,7 @@ function os({
1127
1127
  onClick: () => o(e.id),
1128
1128
  disabled: l === e.id,
1129
1129
  children: [
1130
- l === e.id ? /* @__PURE__ */ t(de, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(Ga, { className: "h-3.5 w-3.5" }),
1130
+ l === e.id ? /* @__PURE__ */ t(de, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(Ka, { className: "h-3.5 w-3.5" }),
1131
1131
  l === e.id ? "Duplicating..." : "Duplicate"
1132
1132
  ]
1133
1133
  }
@@ -1213,7 +1213,7 @@ function qi(e, a, s = !1) {
1213
1213
  }));
1214
1214
  }, [u, o]), l;
1215
1215
  }
1216
- function Mt(e) {
1216
+ function Rt(e) {
1217
1217
  var a;
1218
1218
  for (const s of e.cards)
1219
1219
  if (s.type === "matrixTable" && !ar.safeParse((a = s.config) == null ? void 0 : a.matrix).success)
@@ -1227,7 +1227,7 @@ function gt({
1227
1227
  const s = oe((o) => o.onSave), { getUpdatedFrame: n } = Pe();
1228
1228
  function i() {
1229
1229
  const o = n();
1230
- Mt(o) && (s == null || s(o));
1230
+ Rt(o) && (s == null || s(o));
1231
1231
  }
1232
1232
  return /* @__PURE__ */ r(
1233
1233
  L,
@@ -1253,7 +1253,7 @@ function ls({
1253
1253
  {
1254
1254
  onClick: () => {
1255
1255
  const p = l();
1256
- if (!Mt(p))
1256
+ if (!Rt(p))
1257
1257
  return;
1258
1258
  const m = (c == null ? void 0 : c.visualId) || (u == null ? void 0 : u.id);
1259
1259
  if (!m) {
@@ -1313,7 +1313,7 @@ function ds({
1313
1313
  n(!0);
1314
1314
  try {
1315
1315
  const y = h();
1316
- if (!Mt(y)) {
1316
+ if (!Rt(y)) {
1317
1317
  n(!1);
1318
1318
  return;
1319
1319
  }
@@ -1439,7 +1439,7 @@ function cs({
1439
1439
  ] }),
1440
1440
  /* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
1441
1441
  /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
1442
- /* @__PURE__ */ t(Re, { htmlFor: "name", children: "Name" }),
1442
+ /* @__PURE__ */ t(Me, { htmlFor: "name", children: "Name" }),
1443
1443
  /* @__PURE__ */ t(
1444
1444
  xe,
1445
1445
  {
@@ -1452,7 +1452,7 @@ function cs({
1452
1452
  )
1453
1453
  ] }),
1454
1454
  /* @__PURE__ */ r("div", { className: "grid gap-2", children: [
1455
- /* @__PURE__ */ t(Re, { htmlFor: "description", children: "Description (optional)" }),
1455
+ /* @__PURE__ */ t(Me, { htmlFor: "description", children: "Description (optional)" }),
1456
1456
  /* @__PURE__ */ t(
1457
1457
  pa,
1458
1458
  {
@@ -1492,7 +1492,7 @@ function us() {
1492
1492
  try {
1493
1493
  const S = {
1494
1494
  ...i,
1495
- id: Kt(),
1495
+ id: Gt(),
1496
1496
  visualId: b.id
1497
1497
  // Link to the newly created library visual
1498
1498
  };
@@ -1542,32 +1542,32 @@ function us() {
1542
1542
  return;
1543
1543
  }
1544
1544
  n(b.saveToCurrentDashboard), o(T), u(F);
1545
- const G = {
1545
+ const K = {
1546
1546
  title: b.name,
1547
1547
  description: b.description,
1548
1548
  frameObject: T,
1549
1549
  // Card title synced for single-card frames
1550
1550
  isPrivate: !1
1551
1551
  };
1552
- D.mutate(G);
1552
+ D.mutate(K);
1553
1553
  } else if (b.saveToCurrentDashboard) {
1554
1554
  const F = {
1555
1555
  ...T,
1556
1556
  // Card title already synced
1557
- id: Kt(),
1557
+ id: Gt(),
1558
1558
  visualId: void 0
1559
1559
  // Explicitly no visualId for local visuals
1560
1560
  };
1561
1561
  try {
1562
- const G = await k(T, {
1562
+ const K = await k(T, {
1563
1563
  previousFrame: rt(m, T.id)
1564
1564
  });
1565
1565
  y(p, F, {
1566
- semanticExecutionPayload: G
1566
+ semanticExecutionPayload: K
1567
1567
  }), z.success("Visual saved to dashboard"), a(!1), N(!1);
1568
- } catch (G) {
1569
- console.error("Failed to save visual to dashboard:", G), z.error(
1570
- G instanceof Error ? G.message : "Failed to prepare semantic metadata for the visual"
1568
+ } catch (K) {
1569
+ console.error("Failed to save visual to dashboard:", K), z.error(
1570
+ K instanceof Error ? K.message : "Failed to prepare semantic metadata for the visual"
1571
1571
  );
1572
1572
  }
1573
1573
  }
@@ -1629,7 +1629,7 @@ function Wi(e = {}) {
1629
1629
  setTimeout(() => {
1630
1630
  p(!1), z.success("Changes applied. Visual is now local to this dashboard"), c(!1);
1631
1631
  }, 300);
1632
- }, G = (P) => {
1632
+ }, K = (P) => {
1633
1633
  f(P), D(!0);
1634
1634
  };
1635
1635
  return /* @__PURE__ */ r(U, { children: [
@@ -1672,7 +1672,7 @@ function Wi(e = {}) {
1672
1672
  /* @__PURE__ */ r(
1673
1673
  re,
1674
1674
  {
1675
- onClick: () => G("local"),
1675
+ onClick: () => K("local"),
1676
1676
  disabled: v,
1677
1677
  children: [
1678
1678
  /* @__PURE__ */ t(be, { className: "h-3.5 w-3.5" }),
@@ -1683,7 +1683,7 @@ function Wi(e = {}) {
1683
1683
  /* @__PURE__ */ r(
1684
1684
  re,
1685
1685
  {
1686
- onClick: () => G("library"),
1686
+ onClick: () => K("library"),
1687
1687
  disabled: v,
1688
1688
  children: [
1689
1689
  /* @__PURE__ */ t(kr, { className: "h-3.5 w-3.5" }),
@@ -1694,7 +1694,7 @@ function Wi(e = {}) {
1694
1694
  /* @__PURE__ */ r(
1695
1695
  re,
1696
1696
  {
1697
- onClick: () => G("both"),
1697
+ onClick: () => K("both"),
1698
1698
  disabled: v,
1699
1699
  children: [
1700
1700
  /* @__PURE__ */ t(tn, { className: "h-3.5 w-3.5" }),
@@ -1728,7 +1728,7 @@ function Qi({ className: e }) {
1728
1728
  const a = oe((h) => h.isDevMode), s = oe((h) => h.card.type), n = w((h) => h.isVisualEditing), { setIsDevMode: i } = dt(), { config: o } = Va(an).tokenProps, l = (o == null ? void 0 : o.showAdvancedMode) !== !1;
1729
1729
  if (!n || !l || !rr(s))
1730
1730
  return null;
1731
- const u = a ? Kr : Qr, c = a ? "Visual editor" : "SQL editor", d = a ? "Switch to visual editor" : "Switch to SQL editor";
1731
+ const u = a ? Gr : Qr, c = a ? "Visual editor" : "SQL editor", d = a ? "Switch to visual editor" : "Switch to SQL editor";
1732
1732
  return /* @__PURE__ */ r(
1733
1733
  "button",
1734
1734
  {
@@ -1747,13 +1747,13 @@ function Qi({ className: e }) {
1747
1747
  }
1748
1748
  );
1749
1749
  }
1750
- function Ki() {
1750
+ function Gi() {
1751
1751
  const e = nn() === "sm", a = w((c) => c.isDashboardEditing), s = w((c) => c.isVisualEditing), n = w((c) => {
1752
1752
  var h;
1753
1753
  const d = ((h = c.dashboard) == null ? void 0 : h.sheets) ?? [];
1754
1754
  return d.find((p) => p.id === c.selectedSheetId) ?? d[0];
1755
1755
  }), i = w((c) => c.actions.arrangeSheet), o = w((c) => c.actions.undoArrange);
1756
- if (!a || s || !n || Ke(n)) return null;
1756
+ if (!a || s || !n || Ge(n)) return null;
1757
1757
  const l = !(n.frames ?? []).length, u = (c) => {
1758
1758
  const d = i(n.id, { keepOrder: c });
1759
1759
  if (!d.ok) {
@@ -1809,11 +1809,11 @@ function Ki() {
1809
1809
  ] })
1810
1810
  ] });
1811
1811
  }
1812
- function Gi() {
1812
+ function Ki() {
1813
1813
  const e = w((i) => i.screenSizesOpen), a = w((i) => {
1814
1814
  var u, c;
1815
1815
  const o = ((u = i.dashboard) == null ? void 0 : u.sheets) ?? [], l = o.find((d) => d.id === i.selectedSheetId) ?? o[0];
1816
- return !!l && !Ke(l) && !!((c = l.frames) != null && c.length);
1816
+ return !!l && !Ge(l) && !!((c = l.frames) != null && c.length);
1817
1817
  }), s = w((i) => i.actions.setScreenSizesOpen), n = fa(
1818
1818
  "screen-sizes",
1819
1819
  "lg",
@@ -2722,7 +2722,7 @@ function Ds({
2722
2722
  return /* @__PURE__ */ r("div", { className: "flex items-center gap-2 rounded-control px-1 py-1 transition-colors hover:bg-muted/40 focus-within:bg-muted/40", children: [
2723
2723
  /* @__PURE__ */ t(It, { id: e, checked: s, onCheckedChange: n }),
2724
2724
  /* @__PURE__ */ t(
2725
- Re,
2725
+ Me,
2726
2726
  {
2727
2727
  htmlFor: e,
2728
2728
  className: "cursor-pointer text-[12px] font-normal leading-[1.3]",
@@ -2742,7 +2742,7 @@ function eo({
2742
2742
  var O;
2743
2743
  const [l, u] = E(null), c = w((b) => b.dashboard), d = w((b) => b.selectedSheetId), h = w((b) => b.showFilters), p = w((b) => b.actions), { setDocumentPanelTarget: m, setShowFilters: f } = p, g = (O = c.sheets) == null ? void 0 : O.find(
2744
2744
  (b) => b.id === d
2745
- ), y = Ke(g), N = ie((b) => {
2745
+ ), y = Ge(g), N = ie((b) => {
2746
2746
  window.setTimeout(() => {
2747
2747
  u(b);
2748
2748
  }, 0);
@@ -2951,7 +2951,7 @@ function Is(e, a) {
2951
2951
  const s = hr(e);
2952
2952
  return new Set(
2953
2953
  (e.sheets ?? []).map((i) => {
2954
- const o = { sheetId: i.id, cardId: a, sheetKind: Ke(i) ? "document" : "dashboard" };
2954
+ const o = { sheetId: i.id, cardId: a, sheetKind: Ge(i) ? "document" : "dashboard" };
2955
2955
  return s.filter((l) => Br(l, o)).map((l) => l.runtimeScope === "shared" ? l.id : `${l.id}@${i.id}`).join(`
2956
2956
  `);
2957
2957
  })
@@ -3049,7 +3049,7 @@ function Ps(e) {
3049
3049
  function _s(e) {
3050
3050
  return e.mode === "period" ? gr(e.spec) : void 0;
3051
3051
  }
3052
- const Rt = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", Os = {
3052
+ const Mt = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", Os = {
3053
3053
  connectionId: "",
3054
3054
  connectionType: "",
3055
3055
  mode: "semanticDomain",
@@ -3064,7 +3064,7 @@ function se({
3064
3064
  }) {
3065
3065
  return /* @__PURE__ */ r("div", { className: i, children: [
3066
3066
  /* @__PURE__ */ r("div", { className: "mb-1 flex min-h-5 items-center justify-between gap-2", children: [
3067
- /* @__PURE__ */ t("p", { className: Rt, children: e }),
3067
+ /* @__PURE__ */ t("p", { className: Mt, children: e }),
3068
3068
  s
3069
3069
  ] }),
3070
3070
  n,
@@ -3097,27 +3097,27 @@ function zs(e) {
3097
3097
  if (a)
3098
3098
  return a.label || a.name;
3099
3099
  }
3100
- function Ms(e) {
3100
+ function Rs(e) {
3101
3101
  const a = Ot(e);
3102
3102
  return a === "date" ? "date" : a === "string" ? "text" : a === "number" ? "number" : a === "boolean" ? "yes/no" : a;
3103
3103
  }
3104
3104
  const oa = "__new_calculated_field__";
3105
- function Rs({
3105
+ function Ms({
3106
3106
  draft: e,
3107
3107
  onChange: a,
3108
3108
  handle: s,
3109
3109
  onCalculatedFieldOpenChange: n
3110
3110
  }) {
3111
- var _, te, Z, H, I, ae, j, M, ne, ue, he, ye;
3111
+ var _, te, Z, H, I, ae, j, R, ne, ue, he, ye;
3112
3112
  const { tokenProps: i } = $e(), o = ((_ = i.config) == null ? void 0 : _.showAdvancedMode) !== !1, l = ((te = i.config) == null ? void 0 : te.showDirectSource) !== !1, { connections: u } = va(), [c, d] = E(!1), [h, p] = E(!1), [m, f] = E(!1), g = (x) => {
3113
3113
  p(x), n == null || n(x);
3114
- }, { fields: y, isLoading: N, error: k } = Bs(e.mode === "data" ? e.dataSource : void 0), V = [...e.calculatedFields ?? [], ...y], B = (x) => x && (V.find((R) => R.id === x.id) ?? V.find((R) => Us(R, x))), D = [
3114
+ }, { fields: y, isLoading: N, error: k } = Bs(e.mode === "data" ? e.dataSource : void 0), V = [...e.calculatedFields ?? [], ...y], B = (x) => x && (V.find((M) => M.id === x.id) ?? V.find((M) => Us(M, x))), D = [
3115
3115
  ...V,
3116
3116
  ...[e.field, e.sortField].filter(
3117
- (x) => !!x && !B(x) && !V.some((R) => R.id === x.id)
3117
+ (x) => !!x && !B(x) && !V.some((M) => M.id === x.id)
3118
3118
  )
3119
- ], O = ((Z = B(e.field)) == null ? void 0 : Z.id) ?? ((H = e.field) == null ? void 0 : H.id) ?? "", b = ((I = B(e.sortField ?? e.field)) == null ? void 0 : I.id) ?? ((ae = e.sortField ?? e.field) == null ? void 0 : ae.id) ?? "", S = (x) => a({ ...e, ...x }), v = zs(e.dataSource), T = ((j = e.dataSource) == null ? void 0 : j.mode) === "database" ? Bt : jt, F = "mt-1 inline-flex items-center gap-1 text-[11px] font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline", G = {
3120
- connectionId: ((M = e.dataSource) == null ? void 0 : M.connectionId) || e.connectionId,
3119
+ ], O = ((Z = B(e.field)) == null ? void 0 : Z.id) ?? ((H = e.field) == null ? void 0 : H.id) ?? "", b = ((I = B(e.sortField ?? e.field)) == null ? void 0 : I.id) ?? ((ae = e.sortField ?? e.field) == null ? void 0 : ae.id) ?? "", S = (x) => a({ ...e, ...x }), v = zs(e.dataSource), T = ((j = e.dataSource) == null ? void 0 : j.mode) === "database" ? Bt : jt, F = "mt-1 inline-flex items-center gap-1 text-[11px] font-medium text-muted-foreground underline-offset-2 hover:text-foreground hover:underline", K = {
3120
+ connectionId: ((R = e.dataSource) == null ? void 0 : R.connectionId) || e.connectionId,
3121
3121
  dataSource: e.dataSource,
3122
3122
  config: e.conditions ? { filters: e.conditions } : {},
3123
3123
  cardType: "text"
@@ -3126,10 +3126,10 @@ function Rs({
3126
3126
  g(!0);
3127
3127
  return;
3128
3128
  }
3129
- const R = D.find((K) => K.id === x);
3130
- if (!R) return;
3131
- const $ = Yt(R).some((K) => K.value === e.get) && e.field !== void 0;
3132
- S({ field: R, get: $ ? e.get : Xt(R) });
3129
+ const M = D.find((G) => G.id === x);
3130
+ if (!M) return;
3131
+ const $ = Yt(M).some((G) => G.value === e.get) && e.field !== void 0;
3132
+ S({ field: M, get: $ ? e.get : Xt(M) });
3133
3133
  };
3134
3134
  return h ? /* @__PURE__ */ t(
3135
3135
  Fn,
@@ -3139,13 +3139,13 @@ function Rs({
3139
3139
  onOpenChange: g,
3140
3140
  availableFields: D,
3141
3141
  cardId: e.id,
3142
- source: G,
3142
+ source: K,
3143
3143
  onSave: (x) => {
3144
- const R = { ...x, fieldScope: x.fieldScope ?? "card" };
3144
+ const M = { ...x, fieldScope: x.fieldScope ?? "card" };
3145
3145
  S({
3146
- calculatedFields: [...(e.calculatedFields ?? []).filter(($) => $.id !== R.id), R],
3147
- field: R,
3148
- get: Xt(R)
3146
+ calculatedFields: [...(e.calculatedFields ?? []).filter(($) => $.id !== M.id), M],
3147
+ field: M,
3148
+ get: Xt(M)
3149
3149
  }), g(!1);
3150
3150
  }
3151
3151
  }
@@ -3242,9 +3242,9 @@ function Rs({
3242
3242
  incomingSelectedEntities: ((he = e.dataSource) == null ? void 0 : he.selectedEntities) ?? [],
3243
3243
  onDataSourceChange: (x) => {
3244
3244
  var $;
3245
- const R = JSON.stringify(x.selectedEntities) === JSON.stringify(($ = e.dataSource) == null ? void 0 : $.selectedEntities);
3245
+ const M = JSON.stringify(x.selectedEntities) === JSON.stringify(($ = e.dataSource) == null ? void 0 : $.selectedEntities);
3246
3246
  S(
3247
- R ? { dataSource: x } : { dataSource: x, field: void 0, sortField: void 0, conditions: null, calculatedFields: void 0 }
3247
+ M ? { dataSource: x } : { dataSource: x, field: void 0, sortField: void 0, conditions: null, calculatedFields: void 0 }
3248
3248
  );
3249
3249
  }
3250
3250
  }
@@ -3255,7 +3255,7 @@ function Rs({
3255
3255
  /* @__PURE__ */ r(De, { children: [
3256
3256
  D.map((x) => /* @__PURE__ */ t(fe, { value: x.id, children: /* @__PURE__ */ r("span", { className: "flex items-center gap-2", children: [
3257
3257
  /* @__PURE__ */ t("span", { children: x.label || x.name }),
3258
- /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: Ms(x.dataType) })
3258
+ /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: Rs(x.dataType) })
3259
3259
  ] }) }, x.id)),
3260
3260
  /* @__PURE__ */ t(tr, {}),
3261
3261
  /* @__PURE__ */ t(fe, { value: oa, children: /* @__PURE__ */ r("span", { className: "flex items-center gap-1.5", children: [
@@ -3293,23 +3293,23 @@ function Rs({
3293
3293
  )
3294
3294
  }
3295
3295
  ) : null,
3296
- e.field && !Mr(e.get) && e.get !== "only" ? /* @__PURE__ */ r("div", { className: J("col-span-2 grid gap-3", e.get === "list" ? "grid-cols-3" : "grid-cols-2"), children: [
3296
+ e.field && !Rr(e.get) && e.get !== "only" ? /* @__PURE__ */ r("div", { className: J("col-span-2 grid gap-3", e.get === "list" ? "grid-cols-3" : "grid-cols-2"), children: [
3297
3297
  /* @__PURE__ */ t(se, { label: "Order by", children: /* @__PURE__ */ r(
3298
3298
  we,
3299
3299
  {
3300
3300
  value: `${b}|${e.sortDirection}`,
3301
3301
  onValueChange: (x) => {
3302
- const R = x.lastIndexOf("|"), $ = x.slice(0, R), K = x.slice(R + 1);
3303
- S({ sortField: D.find((le) => le.id === $), sortDirection: K });
3302
+ const M = x.lastIndexOf("|"), $ = x.slice(0, M), G = x.slice(M + 1);
3303
+ S({ sortField: D.find((le) => le.id === $), sortDirection: G });
3304
3304
  },
3305
3305
  children: [
3306
3306
  /* @__PURE__ */ t(Se, { size: "xs", "aria-label": "Order by", children: /* @__PURE__ */ t(ke, {}) }),
3307
3307
  /* @__PURE__ */ t(De, { children: D.flatMap(
3308
- (x) => ["asc", "desc"].map((R) => /* @__PURE__ */ r(fe, { value: `${x.id}|${R}`, children: [
3308
+ (x) => ["asc", "desc"].map((M) => /* @__PURE__ */ r(fe, { value: `${x.id}|${M}`, children: [
3309
3309
  x.label || x.name,
3310
3310
  ", ",
3311
- $s(x, R)
3312
- ] }, `${x.id}|${R}`))
3311
+ $s(x, M)
3312
+ ] }, `${x.id}|${M}`))
3313
3313
  ) })
3314
3314
  ]
3315
3315
  }
@@ -3325,8 +3325,8 @@ function Rs({
3325
3325
  value: e.listLimit ?? "",
3326
3326
  placeholder: "10",
3327
3327
  onChange: (x) => {
3328
- const R = Number.parseInt(x.target.value, 10);
3329
- S({ listLimit: Number.isFinite(R) && R > 0 ? Math.min(R, st) : void 0 });
3328
+ const M = Number.parseInt(x.target.value, 10);
3329
+ S({ listLimit: Number.isFinite(M) && M > 0 ? Math.min(M, st) : void 0 });
3330
3330
  },
3331
3331
  "aria-label": "Show up to"
3332
3332
  }
@@ -3353,7 +3353,7 @@ function Rs({
3353
3353
  {
3354
3354
  filters: e.conditions ?? null,
3355
3355
  availableFields: D,
3356
- source: G,
3356
+ source: K,
3357
3357
  onChange: (x) => S({ conditions: x })
3358
3358
  },
3359
3359
  JSON.stringify(((ye = e.dataSource) == null ? void 0 : ye.selectedEntities) ?? null)
@@ -3422,7 +3422,7 @@ function Qs({
3422
3422
  }) {
3423
3423
  var Z, H;
3424
3424
  const n = w((I) => I.dashboard), i = w((I) => I.selectedSheetId), o = w((I) => I.actions.saveVariableChange), [l, u] = E(
3425
- () => e ? Rr(e) : Ur()
3425
+ () => e ? Mr(e) : Ur()
3426
3426
  ), [c, d] = E("data"), [h, p] = E(!1), m = (I) => {
3427
3427
  p(I), s == null || s(I);
3428
3428
  }, [f, g] = E([]), [y, N] = E(null), k = !e, V = Ws(l), B = Y(
@@ -3444,30 +3444,30 @@ function Qs({
3444
3444
  variables: [...(n.variables ?? []).filter((I) => I.id !== v.id), v]
3445
3445
  }),
3446
3446
  [n, v]
3447
- ), F = $r(l), G = ct(), P = w((I) => I.actions.mergeSemanticExecutionPayload), [Q, X] = E(!1), _ = async () => {
3447
+ ), F = $r(l), K = ct(), P = w((I) => I.actions.mergeSemanticExecutionPayload), [Q, X] = E(!1), _ = async () => {
3448
3448
  const I = Jt(l, n);
3449
3449
  X(!0);
3450
3450
  let ae;
3451
3451
  try {
3452
- const M = Nr(n, e ? { kind: "update", id: e.id, patch: I } : { kind: "add", variable: I });
3453
- if (!M.ok) {
3454
- X(!1), g(M.issues);
3452
+ const R = Nr(n, e ? { kind: "update", id: e.id, patch: I } : { kind: "add", variable: I });
3453
+ if (!R.ok) {
3454
+ X(!1), g(R.issues);
3455
3455
  return;
3456
3456
  }
3457
- const [ne] = M.queryFrames;
3458
- ae = ne ? await G(ne, e ? { previousFrame: Cr(n, e) } : void 0) : { domainsById: {} };
3459
- } catch (M) {
3457
+ const [ne] = R.queryFrames;
3458
+ ae = ne ? await K(ne, e ? { previousFrame: Cr(n, e) } : void 0) : { domainsById: {} };
3459
+ } catch (R) {
3460
3460
  X(!1), g([
3461
3461
  {
3462
3462
  code: "queryMissing",
3463
- message: M instanceof Error && M.message ? M.message : "The data source's details could not be loaded.",
3463
+ message: R instanceof Error && R.message ? R.message : "The data source's details could not be loaded.",
3464
3464
  fix: "Try again, or choose the source again."
3465
3465
  }
3466
3466
  ]);
3467
3467
  return;
3468
3468
  }
3469
3469
  const j = o(
3470
- k ? { kind: "add", variable: I } : { kind: "update", id: I.id, patch: Ks(I) }
3470
+ k ? { kind: "add", variable: I } : { kind: "update", id: I.id, patch: Gs(I) }
3471
3471
  );
3472
3472
  if (X(!1), !j.ok) {
3473
3473
  g(j.issues);
@@ -3478,7 +3478,7 @@ function Qs({
3478
3478
  if (!e) return;
3479
3479
  const ae = o({ kind: "remove", id: e.id, confirmed: I });
3480
3480
  if (!ae.ok) {
3481
- const j = ae.issues.find((M) => M.code === "inUse");
3481
+ const j = ae.issues.find((R) => R.code === "inUse");
3482
3482
  if (j && !I) {
3483
3483
  N(j);
3484
3484
  return;
@@ -3500,7 +3500,7 @@ function Qs({
3500
3500
  /* @__PURE__ */ r("div", { className: "min-w-0", children: [
3501
3501
  /* @__PURE__ */ r("p", { className: "flex items-center gap-2", children: [
3502
3502
  /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: k ? "New variable" : e.label || e.name }),
3503
- /* @__PURE__ */ t("span", { className: Rt, children: "Variable from data" })
3503
+ /* @__PURE__ */ t("span", { className: Mt, children: "Variable from data" })
3504
3504
  ] }),
3505
3505
  /* @__PURE__ */ t("p", { className: "mt-0.5 truncate text-[10px] leading-3 text-muted-foreground/70", children: "Available on every tab and Document of this dashboard" })
3506
3506
  ] })
@@ -3535,7 +3535,7 @@ function Qs({
3535
3535
  )) }),
3536
3536
  /* @__PURE__ */ r("div", { className: J("min-h-0 flex-1 overflow-y-auto", c === "filters" || h ? "" : "space-y-4 px-4 py-4"), children: [
3537
3537
  c === "data" ? /* @__PURE__ */ t(
3538
- Rs,
3538
+ Ms,
3539
3539
  {
3540
3540
  draft: l,
3541
3541
  onChange: u,
@@ -3543,7 +3543,7 @@ function Qs({
3543
3543
  onCalculatedFieldOpenChange: m
3544
3544
  }
3545
3545
  ) : null,
3546
- c === "filters" ? /* @__PURE__ */ t(Gs, { draft: l, draftDashboard: T }) : null,
3546
+ c === "filters" ? /* @__PURE__ */ t(Ks, { draft: l, draftDashboard: T }) : null,
3547
3547
  c === "display" ? /* @__PURE__ */ t(Xs, { draft: l, onChange: u }) : null
3548
3548
  ] }),
3549
3549
  h ? null : /* @__PURE__ */ r(U, { children: [
@@ -3597,7 +3597,7 @@ function Qs({
3597
3597
  }
3598
3598
  );
3599
3599
  }
3600
- function Ks(e) {
3600
+ function Gs(e) {
3601
3601
  const { id: a, ...s } = e;
3602
3602
  return {
3603
3603
  ...s,
@@ -3607,7 +3607,7 @@ function Ks(e) {
3607
3607
  emptyText: s.emptyText
3608
3608
  };
3609
3609
  }
3610
- function Gs({ draft: e, draftDashboard: a }) {
3610
+ function Ks({ draft: e, draftDashboard: a }) {
3611
3611
  const s = Y(() => br(a), [a]), n = s.inputs.filter(
3612
3612
  (o) => s.reachedVariables({ inputId: o.input.id }).some((l) => l.variableId === e.id)
3613
3613
  ), i = e.mode === "sql" && xr(e.sql);
@@ -3708,7 +3708,7 @@ function Js({
3708
3708
  selectedSheetId: i
3709
3709
  }) {
3710
3710
  var S;
3711
- const o = s.sheets ?? [], l = Y(() => Is(s, a.id), [s, a.id]), [u, c] = E(void 0), d = (l ? u : void 0) ?? i ?? ((S = o[0]) == null ? void 0 : S.id), h = o.find((v) => v.id === d), p = w((v) => d ? v.documentSectionRuntimeBySheetId[d] : void 0), m = !!(h && Ke(h)), f = Y(
3711
+ const o = s.sheets ?? [], l = Y(() => Is(s, a.id), [s, a.id]), [u, c] = E(void 0), d = (l ? u : void 0) ?? i ?? ((S = o[0]) == null ? void 0 : S.id), h = o.find((v) => v.id === d), p = w((v) => d ? v.documentSectionRuntimeBySheetId[d] : void 0), m = !!(h && Ge(h)), f = Y(
3712
3712
  () => d ? m ? p ? { kind: "document", sheetId: d, runtime: p } : void 0 : { kind: "sheet", sheetId: d } : void 0,
3713
3713
  [m, p, d]
3714
3714
  ), g = Y(() => n || !f ? [] : [a], [n, a, f]), N = Tn({
@@ -3744,7 +3744,7 @@ function Js({
3744
3744
  }
3745
3745
  return /* @__PURE__ */ r("div", { className: "shrink-0 border-t border-border/60 bg-muted/30 px-4 py-2.5", "data-testid": "variable-preview", children: [
3746
3746
  /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
3747
- /* @__PURE__ */ t("span", { className: Rt, children: l ? "Preview on" : "Preview" }),
3747
+ /* @__PURE__ */ t("span", { className: Mt, children: l ? "Preview on" : "Preview" }),
3748
3748
  l ? /* @__PURE__ */ r(we, { value: d ?? "", onValueChange: c, disabled: !!n, children: [
3749
3749
  /* @__PURE__ */ t(Se, { size: "xs", className: "h-6 w-auto gap-1.5 px-2 text-[12px]", "aria-label": "Preview place", children: /* @__PURE__ */ t(ke, {}) }),
3750
3750
  /* @__PURE__ */ t(De, { children: o.map((v) => /* @__PURE__ */ t(fe, { value: v.id, children: v.title || v.id }, v.id)) })
@@ -3763,7 +3763,7 @@ function Zs(e, a, s) {
3763
3763
  ] }), o = (h) => h === void 0 ? "" : h === "beyondCap" ? `more than ${st} match` : `${h} ${h === 1 ? "match" : "matches"}`, l = "filterReach" in a ? a.filterReach : [], u = l.filter((h) => h.status === "applied").length, c = l.length - u, d = l.length ? ` · ${u} ${u === 1 ? "filter" : "filters"} applied${c ? `, ${c} skipped` : ""}` : "";
3764
3764
  switch (a.status) {
3765
3765
  case "answered": {
3766
- const h = Pr(e, Object.keys(a.parts))[0], p = h ? a.parts[h] : void 0, m = p && Gt(p, e.presentation, s) || "(empty)", f = `${o(a.matched)}${d}`.replace(/^ · /, ""), g = wr(e, a, s);
3766
+ const h = Pr(e, Object.keys(a.parts))[0], p = h ? a.parts[h] : void 0, m = p && Kt(p, e.presentation, s) || "(empty)", f = `${o(a.matched)}${d}`.replace(/^ · /, ""), g = wr(e, a, s);
3767
3767
  return g && typeof g == "object" && "unavailable" in g ? { body: n(m), meta: f, unavailable: g.unavailable } : g === "noPrevious" ? { body: n(m), meta: `${f} · Nothing in the period before to compare with.`.replace(/^ · /, "") } : g ? {
3768
3768
  body: /* @__PURE__ */ r(U, { children: [
3769
3769
  n(g.value),
@@ -3778,7 +3778,7 @@ function Zs(e, a, s) {
3778
3778
  } : { body: n(m), meta: f };
3779
3779
  }
3780
3780
  case "listed": {
3781
- const h = a.items.map((m) => Gt(m, e.presentation, s)), p = a.more === "beyondCap" ? " and more" : a.more ? ` and ${a.more} more` : "";
3781
+ const h = a.items.map((m) => Kt(m, e.presentation, s)), p = a.more === "beyondCap" ? " and more" : a.more ? ` and ${a.more} more` : "";
3782
3782
  return { body: n(`${h.join(e.get.kind === "list" ? e.get.separator ?? ", " : ", ")}${p}`), meta: `${o(a.matched)}${d}` };
3783
3783
  }
3784
3784
  case "none":
@@ -3849,7 +3849,7 @@ function ei({
3849
3849
  onClick: n,
3850
3850
  "aria-label": "Reports & briefings",
3851
3851
  children: [
3852
- /* @__PURE__ */ t(Gr, { className: "h-3.5 w-3.5" }),
3852
+ /* @__PURE__ */ t(Kr, { className: "h-3.5 w-3.5" }),
3853
3853
  "Reports & briefings",
3854
3854
  i ? /* @__PURE__ */ t("span", { className: "ml-0.5 rounded-control bg-muted px-1 text-[10px] tabular-nums text-foreground/70", children: a }) : null
3855
3855
  ]
@@ -4464,7 +4464,7 @@ async function fi(e) {
4464
4464
  return s;
4465
4465
  }
4466
4466
  const gi = {
4467
- listBriefings: Kn,
4467
+ listBriefings: Gn,
4468
4468
  getBriefing: Qn,
4469
4469
  pauseBriefing: Wn,
4470
4470
  resumeBriefing: qn,
@@ -4472,7 +4472,7 @@ const gi = {
4472
4472
  runBriefingNow: $n
4473
4473
  };
4474
4474
  function ro(e) {
4475
- return /* @__PURE__ */ t(Mn, { authToken: e.token ? { accessToken: e.token } : void 0, children: /* @__PURE__ */ t(Rn, { children: /* @__PURE__ */ t(bi, { ...e }) }) });
4475
+ return /* @__PURE__ */ t(Rn, { authToken: e.token ? { accessToken: e.token } : void 0, children: /* @__PURE__ */ t(Mn, { children: /* @__PURE__ */ t(bi, { ...e }) }) });
4476
4476
  }
4477
4477
  function bi({
4478
4478
  dashboardId: e,
@@ -4495,30 +4495,30 @@ function bi({
4495
4495
  h ? "author" : "list"
4496
4496
  ), [S, v] = E(
4497
4497
  h ?? "analytical_briefing"
4498
- ), [T, F] = E("dashboard"), [G, P] = E(
4498
+ ), [T, F] = E("dashboard"), [K, P] = E(
4499
4499
  []
4500
- ), [Q, X] = E(null), _ = h && !N && !Q ? "list" : O, [te, Z] = E(!1), [H, I] = E(null), [ae, j] = E(null), [M, ne] = E(
4500
+ ), [Q, X] = E(null), _ = h && !N && !Q ? "list" : O, [te, Z] = E(!1), [H, I] = E(null), [ae, j] = E(null), [R, ne] = E(
4501
4501
  null
4502
4502
  ), [ue, he] = E(null), ye = et(null), x = et(B);
4503
4503
  Ee(() => {
4504
4504
  const A = B && !x.current;
4505
4505
  x.current = B, !(!A || !h) && (X(null), F("dashboard"), v(h), b("author"), he(null));
4506
4506
  }, [B, h]);
4507
- const R = Lt(), $ = s ?? (g == null ? void 0 : g.apiServiceUrl), K = n ?? (f == null ? void 0 : f.accessToken), le = Y(() => ({ ...gi, ...m }), [m]), [_e, ht] = E(null);
4507
+ const M = Lt(), $ = s ?? (g == null ? void 0 : g.apiServiceUrl), G = n ?? (f == null ? void 0 : f.accessToken), le = Y(() => ({ ...gi, ...m }), [m]), [_e, ht] = E(null);
4508
4508
  Ee(() => {
4509
- if (!p || !$ || !K) return;
4509
+ if (!p || !$ || !G) return;
4510
4510
  let A = !0;
4511
- return le.getBriefing($, K, p.briefingId).then(({ briefing: W }) => {
4511
+ return le.getBriefing($, G, p.briefingId).then(({ briefing: W }) => {
4512
4512
  A && (X(W), ht(p), b("author"));
4513
4513
  }, (W) => {
4514
4514
  A && z.error(W instanceof Error ? W.message : "Could not open the run.");
4515
4515
  }), () => {
4516
4516
  A = !1;
4517
4517
  };
4518
- }, [p, $, K, le]);
4519
- const Fe = hi(a), Ge = Y(() => {
4518
+ }, [p, $, G, le]);
4519
+ const Fe = hi(a), Ke = Y(() => {
4520
4520
  const A = pi(
4521
- G,
4521
+ K,
4522
4522
  T,
4523
4523
  e
4524
4524
  );
@@ -4528,7 +4528,7 @@ function bi({
4528
4528
  return A.filter(
4529
4529
  (He) => pe(He).noun === W
4530
4530
  );
4531
- }, [e, G, T, h]), mt = Y(() => T === "dashboard" ? {
4531
+ }, [e, K, T, h]), mt = Y(() => T === "dashboard" ? {
4532
4532
  source: { type: "dashboard", dashboardId: e },
4533
4533
  label: Fe,
4534
4534
  detail: mi(Fe)
@@ -4536,19 +4536,19 @@ function bi({
4536
4536
  source: { type: "project" },
4537
4537
  label: "This project",
4538
4538
  detail: "Use any data in this project."
4539
- }, [e, Fe, T]), Oe = !!($ && K), ze = qr({
4539
+ }, [e, Fe, T]), Oe = !!($ && G), ze = qr({
4540
4540
  canCreate: y.canCreate,
4541
4541
  analyticalBriefingsEnabled: y.analyticalBriefingsEnabled,
4542
4542
  scheduledReportAvailable: T === "dashboard"
4543
4543
  }), ce = ie(async () => {
4544
- if (!(!$ || !K)) {
4544
+ if (!(!$ || !G)) {
4545
4545
  Z(!0), he(null);
4546
4546
  try {
4547
4547
  P(
4548
4548
  await fi({
4549
4549
  apiClient: le,
4550
4550
  apiServiceUrl: $,
4551
- token: K
4551
+ token: G
4552
4552
  })
4553
4553
  );
4554
4554
  } catch (A) {
@@ -4559,21 +4559,21 @@ function bi({
4559
4559
  Z(!1);
4560
4560
  }
4561
4561
  }
4562
- }, [le, $, K]);
4562
+ }, [le, $, G]);
4563
4563
  Ee(() => {
4564
4564
  !B || _ !== "list" || !Oe || ce();
4565
4565
  }, [Oe, _, ce, B]);
4566
- const Me = () => {
4566
+ const Re = () => {
4567
4567
  X(null), F("dashboard"), b("list"), D(!0);
4568
4568
  }, C = (A) => {
4569
4569
  X(null), v(A), b("author");
4570
4570
  }, q = async (A) => {
4571
- if (!(!$ || !K)) {
4571
+ if (!(!$ || !G)) {
4572
4572
  I(A), he(null);
4573
4573
  try {
4574
4574
  const W = await le.getBriefing(
4575
4575
  $,
4576
- K,
4576
+ G,
4577
4577
  A
4578
4578
  );
4579
4579
  X(W.briefing), b("author");
@@ -4586,16 +4586,16 @@ function bi({
4586
4586
  }
4587
4587
  }
4588
4588
  }, ee = async (A) => {
4589
- if (!(!$ || !K)) {
4589
+ if (!(!$ || !G)) {
4590
4590
  j(A.id);
4591
4591
  try {
4592
4592
  const W = await le.runBriefingNow(
4593
4593
  $,
4594
- K,
4594
+ G,
4595
4595
  A.id,
4596
4596
  { requestId: xi() }
4597
4597
  );
4598
- R.track({ kind: "briefing", id: W.run.id, title: A.name, briefingId: A.id }), ce();
4598
+ M.track({ kind: "briefing", id: W.run.id, title: A.name, briefingId: A.id }), ce();
4599
4599
  } catch (W) {
4600
4600
  z.error(
4601
4601
  W instanceof Error ? W.message : "Could not start the run."
@@ -4605,17 +4605,17 @@ function bi({
4605
4605
  }
4606
4606
  }
4607
4607
  }, me = async (A) => {
4608
- if (!$ || !K) return;
4608
+ if (!$ || !G) return;
4609
4609
  const { noun: W } = pe(A), He = W === "report" ? "Report" : "Briefing";
4610
4610
  j(A.id);
4611
4611
  try {
4612
4612
  const Ye = A.status === "PAUSED" ? await le.resumeBriefing(
4613
4613
  $,
4614
- K,
4614
+ G,
4615
4615
  A.id
4616
4616
  ) : await le.pauseBriefing(
4617
4617
  $,
4618
- K,
4618
+ G,
4619
4619
  A.id
4620
4620
  );
4621
4621
  z.success(
@@ -4629,13 +4629,13 @@ function bi({
4629
4629
  j(null);
4630
4630
  }
4631
4631
  }, Ne = async () => {
4632
- if (!M || !$ || !K) return;
4633
- const A = M;
4632
+ if (!R || !$ || !G) return;
4633
+ const A = R;
4634
4634
  j(A.id);
4635
4635
  try {
4636
4636
  await le.deleteBriefing(
4637
4637
  $,
4638
- K,
4638
+ G,
4639
4639
  A.id
4640
4640
  );
4641
4641
  const { noun: W } = pe(A);
@@ -4647,15 +4647,15 @@ function bi({
4647
4647
  } finally {
4648
4648
  j(null);
4649
4649
  }
4650
- }, La = Ge.length;
4651
- return y.surfaceVisible ? /* @__PURE__ */ r(Gn, { open: B, onOpenChange: D, children: [
4650
+ }, La = Ke.length;
4651
+ return y.surfaceVisible ? /* @__PURE__ */ r(Kn, { open: B, onOpenChange: D, children: [
4652
4652
  d ? null : /* @__PURE__ */ t(
4653
4653
  ei,
4654
4654
  {
4655
4655
  disabled: i || !Oe,
4656
4656
  briefingCount: La,
4657
4657
  className: o,
4658
- onClick: Me
4658
+ onClick: Re
4659
4659
  }
4660
4660
  ),
4661
4661
  /* @__PURE__ */ r(
@@ -4731,7 +4731,7 @@ function bi({
4731
4731
  _ === "list" ? /* @__PURE__ */ t(
4732
4732
  li,
4733
4733
  {
4734
- briefings: Ge,
4734
+ briefings: Ke,
4735
4735
  dashboardLabel: Fe,
4736
4736
  sourceView: T,
4737
4737
  error: ue,
@@ -4766,7 +4766,7 @@ function bi({
4766
4766
  Zn,
4767
4767
  {
4768
4768
  apiServiceUrl: $,
4769
- token: K,
4769
+ token: G,
4770
4770
  briefing: Q,
4771
4771
  initialRunId: _e && (Q == null ? void 0 : Q.id) === _e.briefingId ? _e.runId : void 0,
4772
4772
  intent: S,
@@ -4796,7 +4796,7 @@ function bi({
4796
4796
  /* @__PURE__ */ t(
4797
4797
  wt,
4798
4798
  {
4799
- open: !!M,
4799
+ open: !!R,
4800
4800
  onOpenChange: (A) => {
4801
4801
  A || ne(null);
4802
4802
  },
@@ -4805,12 +4805,12 @@ function bi({
4805
4805
  /* @__PURE__ */ r(Dt, { children: [
4806
4806
  "Delete",
4807
4807
  " ",
4808
- M ? pe(M).noun : "briefing",
4808
+ R ? pe(R).noun : "briefing",
4809
4809
  "?"
4810
4810
  ] }),
4811
4811
  /* @__PURE__ */ r(At, { children: [
4812
4812
  "This permanently deletes ",
4813
- /* @__PURE__ */ t("strong", { children: M == null ? void 0 : M.name }),
4813
+ /* @__PURE__ */ t("strong", { children: R == null ? void 0 : R.name }),
4814
4814
  ". Recipients will stop receiving it."
4815
4815
  ] })
4816
4816
  ] }),
@@ -4824,7 +4824,7 @@ function bi({
4824
4824
  children: [
4825
4825
  "Delete",
4826
4826
  " ",
4827
- M ? pe(M).noun : "briefing"
4827
+ R ? pe(R).noun : "briefing"
4828
4828
  ]
4829
4829
  }
4830
4830
  )
@@ -4840,12 +4840,12 @@ function xi() {
4840
4840
  export {
4841
4841
  Qi as A,
4842
4842
  Hi as D,
4843
- Gi as S,
4843
+ Ki as S,
4844
4844
  Xi as U,
4845
4845
  ji as V,
4846
4846
  ei as W,
4847
4847
  Wi as a,
4848
- Ki as b,
4848
+ Gi as b,
4849
4849
  Yi as c,
4850
4850
  Zi as d,
4851
4851
  fs as e,