react-semaphor 0.1.540 → 0.1.542

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 (118) hide show
  1. package/dist/analytics-protocol/index.js +75 -75
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +3 -3
  4. package/dist/briefings/index.js +50 -45
  5. package/dist/chunks/apply-dashboard-operations-Btbp2-6v.js +2260 -0
  6. package/dist/chunks/{assistant-chat-ya7xopaC.js → assistant-chat-oHF5lTjA.js} +12 -12
  7. package/dist/chunks/bookmark-state-CXw7lZ50.js +118 -0
  8. package/dist/chunks/{calendar-day-equality-Bpl15IBo.js → calendar-day-equality-BmJAWduY.js} +180 -207
  9. package/dist/chunks/comparison-window-caption-ChIyd_-L.js +1618 -0
  10. package/dist/chunks/custom-visual-inputs-DUtpYZOk.js +323 -0
  11. package/dist/chunks/{dashboard-briefing-launcher-DJI-zfEq.js → dashboard-briefing-launcher-B-cm719R.js} +18 -18
  12. package/dist/chunks/{dashboard-controls-Dh7HqoKy.js → dashboard-controls-CIn22Qgp.js} +69 -70
  13. package/dist/chunks/{dashboard-filter-value-compatibility-D95O4nd7.js → dashboard-filter-value-compatibility-CwQ_iSNb.js} +2 -2
  14. package/dist/chunks/{dashboard-json-BnmlB71h.js → dashboard-json-ZUYsIExq.js} +4 -4
  15. package/dist/chunks/{dashboard-B6Bithfl.js → dashboard-s5WJBcK8.js} +1 -1
  16. package/dist/chunks/{document-dashboard-inputs-BrYYlRVo.js → document-dashboard-inputs-C6MJVyoI.js} +2357 -4948
  17. package/dist/chunks/document-sheet-utils-BsZUnHRl.js +3619 -0
  18. package/dist/chunks/{edit-dashboard-visual-CydOkSko.js → edit-dashboard-visual-DLdereA7.js} +728 -728
  19. package/dist/chunks/{filter-value-text-BhWugPWE.js → filter-value-text-CYsVYPuD.js} +18 -19
  20. package/dist/chunks/index-CV5rHq5D.js +2673 -0
  21. package/dist/chunks/{matrix-analytical-definition-bcprSe4u.js → matrix-analytical-definition-C7Gb0e12.js} +1 -1
  22. package/dist/chunks/{matrix-card-CJn1hB5V.js → matrix-card-DjwWcCo8.js} +2 -2
  23. package/dist/chunks/{matrix-formatter-DQ8avoIQ.js → matrix-formatter-BnsTX90d.js} +430 -417
  24. package/dist/chunks/{matrix-member-presentation-BNPSDKBG.js → matrix-member-presentation-CQGdVks6.js} +1 -1
  25. package/dist/chunks/{matrix-operation-contract-B8PBF1Gd.js → matrix-operation-contract-8OIO4gob.js} +65 -65
  26. package/dist/chunks/metric-comparison-DEwi9uc2.js +498 -0
  27. package/dist/chunks/numeric-presentation-BSAqPpHt.js +5227 -0
  28. package/dist/chunks/{pivot-header-presentation-MkcKnjn3.js → pivot-header-presentation-DHcx1XGQ.js} +1 -1
  29. package/dist/chunks/{pivot-result-identity-D6hhcRXi.js → pivot-result-identity-DJhXXcns.js} +1 -1
  30. package/dist/chunks/pivot-result-lifecycle-BBlAfBA0.js +1155 -0
  31. package/dist/chunks/raw-temporal-presentation-CZ2r0Vb_.js +585 -0
  32. package/dist/chunks/{report-preferences-dialog-neMDolLg.js → report-preferences-dialog-MRUWpMcJ.js} +75 -75
  33. package/dist/chunks/{report-runtime-context-B984Nq1E.js → report-runtime-context-Dq8XyODK.js} +1 -1
  34. package/dist/chunks/{saved-dashboard-context-CCrLpfSQ.js → saved-dashboard-context-DjPqgFly.js} +233 -206
  35. package/dist/chunks/{selection-reducer-vKIb_jS6.js → selection-reducer-Dj_8xD69.js} +1 -1
  36. package/dist/chunks/{semaphor-ready-indicator--4DWtVBu.js → semaphor-ready-indicator-BWSpRsPj.js} +38555 -40449
  37. package/dist/chunks/{shelf-drop-preview-context-CpdB5ois.js → shelf-drop-preview-context-CQbFLm3q.js} +6 -6
  38. package/dist/chunks/sort-target-MT1WK1vX.js +29 -0
  39. package/dist/chunks/{source-entity-resolution-CVA1a85c.js → source-entity-resolution-BYn9giz3.js} +1 -1
  40. package/dist/chunks/{switch-DWEWiv1J.js → switch-C3jLxlG0.js} +2 -2
  41. package/dist/chunks/table-export-sheet-BHSnuZHd.js +949 -0
  42. package/dist/chunks/table-settings-CLZocegs.js +501 -0
  43. package/dist/chunks/temporal-bucket-D7NBrrtL.js +2071 -0
  44. package/dist/chunks/{token-types-bxUxXDX2.js → token-types-DBbZVQsm.js} +1 -1
  45. package/dist/chunks/{use-create-flow-overlay-state-8g6Zhphh.js → use-create-flow-overlay-state-BJDNqdOh.js} +151 -151
  46. package/dist/chunks/{validators-Ej1DdCXa.js → validators-DMHTpf7a.js} +73 -73
  47. package/dist/dashboard/index.js +2 -2
  48. package/dist/dashboard-authoring/index.js +399 -380
  49. package/dist/data-app-sdk/index.js +5 -5
  50. package/dist/data-app-sdk-adapters/index.js +2 -2
  51. package/dist/data-app-sdk-validation/index.js +9 -9
  52. package/dist/format-utils/index.js +346 -238
  53. package/dist/index.js +174 -175
  54. package/dist/pdf-export-policy/index.js +20 -10
  55. package/dist/report-runtime-context/index.js +1 -1
  56. package/dist/surfboard/index.js +2 -2
  57. package/dist/types/briefings/attachment-outcomes.d.ts +23 -0
  58. package/dist/types/briefings/attachments.d.ts +17 -1
  59. package/dist/types/briefings/index.d.ts +6 -3
  60. package/dist/types/index.js +48 -48
  61. package/dist/types/lib/api/exports-api.d.ts +11 -65
  62. package/dist/types/lib/dashboard-inputs/control-contract-overrides.d.ts +17 -0
  63. package/dist/types/lib/dashboard-viewer/export-table-view.d.ts +2 -0
  64. package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
  65. package/dist/types/lib/hooks/use-dashboard.d.ts +3 -6
  66. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +8 -2
  67. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +8 -6
  68. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +50 -0
  69. package/dist/types/lib/query-context/card-server-request.d.ts +5 -1
  70. package/dist/types/lib/types/common-types.d.ts +7 -0
  71. package/dist/types/lib/types/explorer-types.d.ts +8 -2
  72. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +3 -3
  73. package/dist/types/shared/assistant-context/index.d.ts +1 -1
  74. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +23 -6
  75. package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +173 -0
  76. package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +20 -0
  77. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  78. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +4 -3
  79. package/dist/types/shared/format-utils/attachment-filter-line.d.ts +14 -0
  80. package/dist/types/shared/format-utils/exporters/export-cells.d.ts +90 -0
  81. package/dist/types/shared/format-utils/exporters/export-file-format.d.ts +44 -0
  82. package/dist/types/shared/format-utils/exporters/index.d.ts +6 -0
  83. package/dist/types/shared/format-utils/exporters/xlsx-file.d.ts +90 -0
  84. package/dist/types/shared/format-utils/filter-line.d.ts +7 -0
  85. package/dist/types/shared/format-utils/formatters/date-formatter.d.ts +8 -12
  86. package/dist/types/shared/format-utils/formatters/index.d.ts +1 -1
  87. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +2 -0
  88. package/dist/types/shared/format-utils/index.d.ts +3 -0
  89. package/dist/types/shared/format-utils/matrix-continuation.d.ts +55 -9
  90. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +21 -1
  91. package/dist/types/shared/format-utils/matrix-export-xlsx.d.ts +27 -0
  92. package/dist/types/shared/format-utils/pdf-export-policy.d.ts +9 -0
  93. package/dist/types/shared/format-utils/presentation-execution.d.ts +27 -2
  94. package/dist/types/shared/format-utils/raw-temporal.d.ts +8 -0
  95. package/dist/types/shared/format-utils/table-export/index.d.ts +8 -0
  96. package/dist/types/shared/format-utils/table-export/prepare-table-export.d.ts +50 -0
  97. package/dist/types/shared/format-utils/table-export/table-export-formatting.d.ts +47 -0
  98. package/dist/types/shared/format-utils/table-export/table-export-raw-temporal.d.ts +40 -0
  99. package/dist/types/shared/format-utils/table-export/table-export-result.d.ts +31 -0
  100. package/dist/types/shared/format-utils/table-export/table-export-sheet.d.ts +38 -0
  101. package/dist/types/shared/format-utils/temporal-bucket.d.ts +9 -0
  102. package/package.json +2 -1
  103. package/dist/chunks/aggregate-table-row-presentation-BjK9YfMI.js +0 -979
  104. package/dist/chunks/apply-dashboard-operations-C-iahGka.js +0 -402
  105. package/dist/chunks/bookmark-state-k7y5SNGf.js +0 -331
  106. package/dist/chunks/calculated-field-identity-DcBS2NPP.js +0 -2161
  107. package/dist/chunks/canonical-result-keys-CEQefvdO.js +0 -33
  108. package/dist/chunks/common-types-CUf03Htv.js +0 -288
  109. package/dist/chunks/csv-utils-GUfKyT1J.js +0 -56
  110. package/dist/chunks/custom-visual-inputs-BrUOIwln.js +0 -3288
  111. package/dist/chunks/document-sheet-utils-C1eEldxs.js +0 -1076
  112. package/dist/chunks/index-CqMiAkay.js +0 -3164
  113. package/dist/chunks/matrix-definition-DQDI2okF.js +0 -206
  114. package/dist/chunks/metric-comparison-CojWeLqx.js +0 -392
  115. package/dist/chunks/pivot-result-lifecycle-8qCDmpKc.js +0 -804
  116. package/dist/chunks/raw-temporal-D61lr48Y.js +0 -1464
  117. package/dist/chunks/temporal-bucket-D8JF7zKz.js +0 -575
  118. package/dist/chunks/temporal-bucket-contract-DaOajRC7.js +0 -108
@@ -1,17 +1,17 @@
1
1
  import { c as W, C as Se } from "./x-4f5U2XwU.js";
2
2
  import { useEffect as K, forwardRef as nt, useMemo as H, useState as z, useRef as se, useCallback as F, Fragment as st } from "react";
3
- import { Z as qe, _ as ot, aE as dt, u as it, f as ct, aF as ut, aG as mt, aH as De, aI as pt, aJ as ft, aK as Me, aL as ze, aM as ht, aN as gt, aO as bt, aP as xt, aQ as vt, aR as yt } from "./semaphor-ready-indicator--4DWtVBu.js";
3
+ import { Z as qe, _ as ot, aE as dt, u as it, f as ct, aF as ut, aG as mt, aH as De, aI as pt, aJ as ft, aK as Me, aL as ze, aM as ht, aN as gt, aO as bt, aP as xt, aQ as vt, aR as yt } from "./semaphor-ready-indicator-BWSpRsPj.js";
4
4
  import { jsx as t, jsxs as o, Fragment as X } from "react/jsx-runtime";
5
5
  import "./index-CuHybtft.js";
6
- import "./validators-Ej1DdCXa.js";
7
- import "./matrix-operation-contract-B8PBF1Gd.js";
6
+ import "./validators-DMHTpf7a.js";
7
+ import "./matrix-operation-contract-8OIO4gob.js";
8
8
  import "./analytics-base-schemas-BFAoRlkU.js";
9
9
  import "zod";
10
10
  import "../value-format-preferences/index.js";
11
11
  import { c as R } from "./class-utils-Df1OVOT1.js";
12
- import { m as Re, n as je, o as Be, p as $e, x as Qe, B as E, l as M, q as Ue, r as oe, s as de, t as ie, u as ce, v as ue } from "./switch-DWEWiv1J.js";
13
- import { B as Ct, C as kt, D as G, E as we, F as Te, G as me, H as pe, I as Nt, J as St, K as _e, L as Dt, M as wt, N as J, O as Tt, P as Ve, Q as Ye, R as He, S as Xe, T as Ge, U as _t, V as Vt, W as Le, X as Lt, Y as Ee, Z as Et, _ as It, $ as Ft, a0 as Ot, a1 as fe } from "./document-dashboard-inputs-BrYYlRVo.js";
14
- import { C as Ie } from "./selection-reducer-vKIb_jS6.js";
12
+ import { m as Re, n as je, o as Be, p as $e, x as Qe, B as E, l as M, q as Ue, r as oe, s as de, t as ie, u as ce, v as ue } from "./switch-C3jLxlG0.js";
13
+ import { D as Ct, E as kt, F as G, G as we, H as Te, I as me, J as pe, K as Nt, L as St, M as _e, N as Dt, O as wt, P as J, Q as Tt, R as Ve, S as Ye, T as He, U as Xe, V as Ge, W as _t, X as Vt, Y as Le, Z as Lt, _ as Ee, $ as Et, a0 as It, a1 as Ft, a2 as Ot, a3 as fe } from "./document-dashboard-inputs-C6MJVyoI.js";
14
+ import { C as Ie } from "./selection-reducer-Dj_8xD69.js";
15
15
  /**
16
16
  * @license lucide-react v0.453.0 - ISC
17
17
  *
@@ -28,7 +28,7 @@ const At = W("CircleCheck", [
28
28
  * This source code is licensed under the ISC license.
29
29
  * See the LICENSE file in the root directory of this source tree.
30
30
  */
31
- const ar = W("FilterX", [
31
+ const ra = W("FilterX", [
32
32
  ["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
33
33
  ["path", { d: "m22 3-5 5", key: "12jva0" }],
34
34
  ["path", { d: "m17 3 5 5", key: "k36vhe" }]
@@ -56,7 +56,7 @@ const Mt = W("Link2", [
56
56
  ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
57
57
  ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
58
58
  ]);
59
- function lr() {
59
+ function la() {
60
60
  const s = qe((g) => g.card.dataSource), {
61
61
  setSelectedConnectionId: n,
62
62
  setSelectedDatabaseName: u,
@@ -78,7 +78,7 @@ function lr() {
78
78
  b
79
79
  ]);
80
80
  }
81
- function nr({
81
+ function na({
82
82
  type: s,
83
83
  isLinked: n,
84
84
  className: u,
@@ -466,7 +466,7 @@ function $t(s) {
466
466
  defaultValue: J(u, void 0)
467
467
  };
468
468
  }
469
- function sr({
469
+ function sa({
470
470
  scope: s,
471
471
  controls: n,
472
472
  reservedControlIds: u,
@@ -491,7 +491,7 @@ function sr({
491
491
  null
492
492
  ), [We, Q] = z(
493
493
  null
494
- ), [r, D] = z(
494
+ ), [a, D] = z(
495
495
  () => g ? {
496
496
  step: 1,
497
497
  control: G(s, n, Array.from(O))
@@ -501,7 +501,7 @@ function sr({
501
501
  if (!T)
502
502
  return e;
503
503
  const l = new Set(T);
504
- return e.filter((a) => l.has(a.value));
504
+ return e.filter((r) => l.has(r.value));
505
505
  }, [T, S, s]), Pe = F(
506
506
  (e) => {
507
507
  const l = we({
@@ -511,55 +511,55 @@ function sr({
511
511
  });
512
512
  if (!T)
513
513
  return l;
514
- const a = new Set(T);
515
- return l.filter((d) => a.has(d.value));
514
+ const r = new Set(T);
515
+ return l.filter((d) => r.has(d.value));
516
516
  },
517
517
  [T, S, s]
518
518
  ), L = F(
519
519
  (e) => s === "dashboard" && (e === "field_selector" || e === "metric_selector"),
520
520
  [s]
521
521
  ), ee = H(
522
- () => r ? Te(
522
+ () => a ? Te(
523
523
  x || [],
524
- r.control.type
524
+ a.control.type
525
525
  ) : [],
526
- [r, x]
526
+ [a, x]
527
527
  ), Y = H(() => {
528
- if (!r)
528
+ if (!a)
529
529
  return {
530
530
  fields: p || [],
531
531
  metrics: N || []
532
532
  };
533
- if (!L(r.control.type))
533
+ if (!L(a.control.type))
534
534
  return {
535
535
  fields: p || [],
536
536
  metrics: N || []
537
537
  };
538
- const e = r.selectedCardIds || [], l = me({
539
- controlType: r.control.type,
538
+ const e = a.selectedCardIds || [], l = me({
539
+ controlType: a.control.type,
540
540
  participants: x || [],
541
541
  selectedCardIds: e
542
542
  });
543
543
  return {
544
- fields: r.control.type === "field_selector" ? l.choices.map((a) => ({
545
- option: a,
546
- target: l.fieldTargetMap[a.value]
544
+ fields: a.control.type === "field_selector" ? l.choices.map((r) => ({
545
+ option: r,
546
+ target: l.fieldTargetMap[r.value]
547
547
  })) : [],
548
- metrics: r.control.type === "metric_selector" ? l.choices.map((a) => ({
549
- option: a,
550
- target: l.metricTargetMap[a.value]
548
+ metrics: a.control.type === "metric_selector" ? l.choices.map((r) => ({
549
+ option: r,
550
+ target: l.metricTargetMap[r.value]
551
551
  })) : []
552
552
  };
553
553
  }, [
554
554
  p,
555
555
  N,
556
- r,
556
+ a,
557
557
  L,
558
558
  x
559
559
  ]);
560
560
  K(() => {
561
- _ == null || _(!!r);
562
- }, [r, _]), K(() => {
561
+ _ == null || _(!!a);
562
+ }, [a, _]), K(() => {
563
563
  const e = g && !ge.current;
564
564
  ge.current = g, e && (D({
565
565
  step: 1,
@@ -578,19 +578,19 @@ function sr({
578
578
  fields: p || [],
579
579
  metrics: N || []
580
580
  };
581
- const a = me({
581
+ const r = me({
582
582
  controlType: e.type,
583
583
  participants: x || [],
584
584
  selectedCardIds: l
585
585
  });
586
586
  return {
587
- fields: e.type === "field_selector" ? a.choices.map((d) => ({
587
+ fields: e.type === "field_selector" ? r.choices.map((d) => ({
588
588
  option: d,
589
- target: a.fieldTargetMap[d.value]
589
+ target: r.fieldTargetMap[d.value]
590
590
  })) : [],
591
- metrics: e.type === "metric_selector" ? a.choices.map((d) => ({
591
+ metrics: e.type === "metric_selector" ? r.choices.map((d) => ({
592
592
  option: d,
593
- target: a.metricTargetMap[d.value]
593
+ target: r.metricTargetMap[d.value]
594
594
  })) : []
595
595
  };
596
596
  }, te = (e) => {
@@ -599,13 +599,13 @@ function sr({
599
599
  nextControl: e.control,
600
600
  cardBindingsById: void 0
601
601
  };
602
- const l = (f == null ? void 0 : f[e.control.id]) || [], a = me({
602
+ const l = (f == null ? void 0 : f[e.control.id]) || [], r = me({
603
603
  controlType: e.control.type,
604
604
  participants: x || [],
605
605
  selectedCardIds: e.nextSelectedCardIds
606
606
  }), d = Ft({
607
607
  control: e.control,
608
- choices: a.choices
608
+ choices: r.choices
609
609
  }), m = Object.fromEntries(
610
610
  l.filter((h) => !e.nextSelectedCardIds.includes(h)).map((h) => [h, void 0])
611
611
  );
@@ -622,18 +622,18 @@ function sr({
622
622
  cardBindingsById: m
623
623
  };
624
624
  }, V = F(
625
- (e, l = i, a = { type: "update" }) => {
625
+ (e, l = i, r = { type: "update" }) => {
626
626
  const d = e.map((m) => (pe({
627
627
  control: m,
628
628
  defaultValues: l
629
629
  }), Nt(
630
630
  m
631
631
  )));
632
- k(d, l, a);
632
+ k(d, l, r);
633
633
  },
634
634
  [i, k]
635
635
  ), B = (e, l) => {
636
- const a = n.find(
636
+ const r = n.find(
637
637
  (C) => C.id === e
638
638
  );
639
639
  let d = n.map((C) => C.id !== e ? C : l(C));
@@ -641,7 +641,7 @@ function sr({
641
641
  (C) => C.id === e
642
642
  );
643
643
  let h, c;
644
- if (m && (!a || Et({ control: a }, { control: m })) && s === "dashboard" && (m.type === "field_selector" || m.type === "metric_selector")) {
644
+ if (m && (!r || Et({ control: r }, { control: m })) && s === "dashboard" && (m.type === "field_selector" || m.type === "metric_selector")) {
645
645
  const C = (f == null ? void 0 : f[m.id]) || [], q = te({
646
646
  control: m,
647
647
  nextSelectedCardIds: C
@@ -649,24 +649,24 @@ function sr({
649
649
  d = d.map(
650
650
  (A) => A.id === e ? q.nextControl : A
651
651
  ), h = q.cardBindingsById, c = [m.id];
652
- } else if (a && (!m || !It(m.type)) && s === "dashboard" && (a.type === "field_selector" || a.type === "metric_selector")) {
653
- const C = (f == null ? void 0 : f[a.id]) || [];
652
+ } else if (r && (!m || !It(m.type)) && s === "dashboard" && (r.type === "field_selector" || r.type === "metric_selector")) {
653
+ const C = (f == null ? void 0 : f[r.id]) || [];
654
654
  h = Object.fromEntries(
655
655
  C.map((q) => [q, void 0])
656
- ), c = [a.id];
656
+ ), c = [r.id];
657
657
  }
658
658
  const y = d.find(
659
659
  (C) => C.id === e
660
660
  );
661
661
  let w = i;
662
- if (a && y) {
662
+ if (r && y) {
663
663
  const C = pe({
664
- control: a,
664
+ control: r,
665
665
  defaultValues: i
666
666
  });
667
- a.source.kind === "manual" && y.source.kind === "sql_query" && (U.current[e] = C);
668
- const q = C === void 0 && a.source.kind === "sql_query" && y.source.kind === "manual" ? U.current[e] : C, A = Le({
669
- previousControl: a,
667
+ r.source.kind === "manual" && y.source.kind === "sql_query" && (U.current[e] = C);
668
+ const q = C === void 0 && r.source.kind === "sql_query" && y.source.kind === "manual" ? U.current[e] : C, A = Le({
669
+ previousControl: r,
670
670
  nextControl: y,
671
671
  currentDefaultValue: q
672
672
  });
@@ -682,37 +682,37 @@ function sr({
682
682
  }, tt = (e, l) => {
683
683
  if (!l.trim())
684
684
  return;
685
- const a = Ot(l);
686
- if (a === e || O.has(a) || n.some(
687
- (h) => h.id === a && h.id !== e
685
+ const r = Ot(l);
686
+ if (r === e || O.has(r) || n.some(
687
+ (h) => h.id === r && h.id !== e
688
688
  ))
689
689
  return;
690
690
  const d = n.map(
691
- (h) => h.id === e ? { ...h, id: a } : h
691
+ (h) => h.id === e ? { ...h, id: r } : h
692
692
  );
693
693
  if (!i) {
694
694
  V(d, void 0, {
695
695
  type: "rename",
696
696
  oldId: e,
697
- newId: a
697
+ newId: r
698
698
  });
699
699
  return;
700
700
  }
701
701
  const m = { ...i };
702
- Object.prototype.hasOwnProperty.call(m, e) && (m[a] = m[e], delete m[e]), V(d, m, {
702
+ Object.prototype.hasOwnProperty.call(m, e) && (m[r] = m[e], delete m[e]), V(d, m, {
703
703
  type: "rename",
704
704
  oldId: e,
705
- newId: a
705
+ newId: r
706
706
  });
707
- }, rt = (e) => {
707
+ }, at = (e) => {
708
708
  const l = n.filter((d) => d.id !== e);
709
709
  if (!i) {
710
710
  V(l, void 0, { type: "remove", controlId: e });
711
711
  return;
712
712
  }
713
- const a = { ...i };
714
- delete a[e], V(l, a, { type: "remove", controlId: e });
715
- }, at = F(() => {
713
+ const r = { ...i };
714
+ delete r[e], V(l, r, { type: "remove", controlId: e });
715
+ }, rt = F(() => {
716
716
  j.current = void 0, D({
717
717
  step: 1,
718
718
  control: G(s, n, Array.from(O))
@@ -720,16 +720,16 @@ function sr({
720
720
  }, [n, O, s]), $ = (e) => {
721
721
  D(
722
722
  (l) => l && (() => {
723
- const a = e(l.control);
724
- l.control.source.kind === "manual" && a.source.kind === "sql_query" && (j.current = l.defaultValue);
725
- const d = l.defaultValue === void 0 && l.control.source.kind === "sql_query" && a.source.kind === "manual" ? j.current : l.defaultValue, m = Le({
723
+ const r = e(l.control);
724
+ l.control.source.kind === "manual" && r.source.kind === "sql_query" && (j.current = l.defaultValue);
725
+ const d = l.defaultValue === void 0 && l.control.source.kind === "sql_query" && r.source.kind === "manual" ? j.current : l.defaultValue, m = Le({
726
726
  previousControl: l.control,
727
- nextControl: a,
727
+ nextControl: r,
728
728
  currentDefaultValue: d
729
729
  });
730
- return a.source.kind === "manual" && (j.current = m), {
730
+ return r.source.kind === "manual" && (j.current = m), {
731
731
  ...l,
732
- control: a,
732
+ control: r,
733
733
  defaultValue: m
734
734
  };
735
735
  })()
@@ -741,85 +741,85 @@ function sr({
741
741
  defaultValue: e
742
742
  })
743
743
  );
744
- }, re = (() => {
745
- if (!r)
744
+ }, ae = (() => {
745
+ if (!a)
746
746
  return !1;
747
- if (r.step === 2 && L(r.control.type))
748
- return (r.selectedCardIds || []).length > 0 && St({
747
+ if (a.step === 2 && L(a.control.type))
748
+ return (a.selectedCardIds || []).length > 0 && St({
749
749
  participants: x || [],
750
- selectedCardIds: r.selectedCardIds || [],
751
- control: r.control,
752
- selected: r.matrixTargetIds
750
+ selectedCardIds: a.selectedCardIds || [],
751
+ control: a.control,
752
+ selected: a.matrixTargetIds
753
753
  });
754
- if (r.step !== 2 && r.step !== 3 || !r.control.label.trim())
754
+ if (a.step !== 2 && a.step !== 3 || !a.control.label.trim())
755
755
  return !1;
756
- const l = r.control.source.kind === "sql_query" ? r.control : _e(r.control);
756
+ const l = a.control.source.kind === "sql_query" ? a.control : _e(a.control);
757
757
  if (l.source.kind === "manual" && (Dt(l) && l.source.options.length === 0 || l.source.options.some(
758
758
  (d) => d.label.trim().length === 0 || d.value.trim().length === 0
759
759
  )))
760
760
  return !1;
761
761
  if (l.source.kind === "sql_query") {
762
- const { connectionId: a, sql: d, valueColumn: m } = l.source;
763
- return a.trim().length > 0 && d.trim().length > 0 && m.trim().length > 0;
762
+ const { connectionId: r, sql: d, valueColumn: m } = l.source;
763
+ return r.trim().length > 0 && d.trim().length > 0 && m.trim().length > 0;
764
764
  }
765
765
  return wt(
766
- J(l, r.defaultValue)
766
+ J(l, a.defaultValue)
767
767
  );
768
768
  })(), ve = () => {
769
769
  var h;
770
- if (!r)
770
+ if (!a)
771
771
  return;
772
- const e = _e(r.control), l = Lt({
772
+ const e = _e(a.control), l = Lt({
773
773
  label: e.label,
774
774
  fallbackId: e.id,
775
775
  existingControls: n,
776
776
  reservedIds: Array.from(O)
777
- }), a = {
777
+ }), r = {
778
778
  ...e,
779
779
  id: l
780
- }, d = s === "dashboard" && (a.type === "field_selector" || a.type === "metric_selector") && ((h = r.selectedCardIds) != null && h.length) ? Ee({
781
- control: a,
780
+ }, d = s === "dashboard" && (r.type === "field_selector" || r.type === "metric_selector") && ((h = a.selectedCardIds) != null && h.length) ? Ee({
781
+ control: r,
782
782
  participants: x || [],
783
- selectedCardIds: r.selectedCardIds,
784
- matrixTargetIds: r.matrixTargetIds
783
+ selectedCardIds: a.selectedCardIds,
784
+ matrixTargetIds: a.matrixTargetIds
785
785
  }) : void 0, m = J(
786
- a,
787
- r.defaultValue
786
+ r,
787
+ a.defaultValue
788
788
  );
789
789
  D({
790
- step: s === "dashboard" && (a.type === "field_selector" || a.type === "metric_selector") ? 4 : 3,
791
- control: a,
790
+ step: s === "dashboard" && (r.type === "field_selector" || r.type === "metric_selector") ? 4 : 3,
791
+ control: r,
792
792
  defaultValue: m,
793
793
  createdControlId: l,
794
- selectedCardIds: r.selectedCardIds,
795
- matrixTargetIds: r.matrixTargetIds,
794
+ selectedCardIds: a.selectedCardIds,
795
+ matrixTargetIds: a.matrixTargetIds,
796
796
  cardBindingsById: d
797
797
  });
798
- }, ae = F(() => {
798
+ }, re = F(() => {
799
799
  D(null);
800
800
  }, []), ye = F(() => {
801
- if (!(r != null && r.createdControlId)) {
801
+ if (!(a != null && a.createdControlId)) {
802
802
  D(null);
803
803
  return;
804
804
  }
805
- const e = r.control, l = r.createdControlId, a = J(
805
+ const e = a.control, l = a.createdControlId, r = J(
806
806
  e,
807
- r.defaultValue
807
+ a.defaultValue
808
808
  );
809
809
  if (i) {
810
810
  const d = { ...i };
811
- a === void 0 ? delete d[l] : d[l] = a, V(
811
+ r === void 0 ? delete d[l] : d[l] = r, V(
812
812
  [
813
813
  ...n,
814
814
  {
815
815
  ...e,
816
- defaultValue: a
816
+ defaultValue: r
817
817
  }
818
818
  ],
819
819
  d,
820
820
  {
821
821
  type: "add",
822
- cardBindingsById: r.cardBindingsById
822
+ cardBindingsById: a.cardBindingsById
823
823
  }
824
824
  );
825
825
  } else
@@ -828,39 +828,39 @@ function sr({
828
828
  ...n,
829
829
  {
830
830
  ...e,
831
- defaultValue: a
831
+ defaultValue: r
832
832
  }
833
833
  ],
834
834
  void 0,
835
835
  {
836
836
  type: "add",
837
- cardBindingsById: r.cardBindingsById
837
+ cardBindingsById: a.cardBindingsById
838
838
  }
839
839
  );
840
840
  Q(l), D(null), I == null || I();
841
- }, [n, r, i, V, I]), lt = r ? L(r.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], Ce = r != null && r.createdControlId ? `[[param.${r.createdControlId}]]` : r ? `[[param.${Tt(r.control.label) || r.control.id}]]` : "", le = Ve({
841
+ }, [n, a, i, V, I]), lt = a ? L(a.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], Ce = a != null && a.createdControlId ? `[[param.${a.createdControlId}]]` : a ? `[[param.${Tt(a.control.label) || a.control.id}]]` : "", le = Ve({
842
842
  controls: n,
843
843
  defaultValues: i
844
- }), ne = r ? [...n, r.control] : n, ke = r ? Ve({
844
+ }), ne = a ? [...n, a.control] : n, ke = a ? Ve({
845
845
  controls: ne,
846
846
  defaultValues: i,
847
847
  overrides: [
848
848
  {
849
- controlId: r.control.id,
850
- value: r.defaultValue
849
+ controlId: a.control.id,
850
+ value: a.defaultValue
851
851
  }
852
852
  ]
853
853
  }) : le;
854
854
  return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
855
- r ? /* @__PURE__ */ o("div", { className: "space-y-4 pb-1", children: [
855
+ a ? /* @__PURE__ */ o("div", { className: "space-y-4 pb-1", children: [
856
856
  /* @__PURE__ */ t(
857
857
  Rt,
858
858
  {
859
- currentStep: r.step,
859
+ currentStep: a.step,
860
860
  labels: lt
861
861
  }
862
862
  ),
863
- r.step === 1 && (() => {
863
+ a.step === 1 && (() => {
864
864
  const e = /* @__PURE__ */ new Set([
865
865
  "grain_selector",
866
866
  "aggregation_selector",
@@ -871,7 +871,7 @@ function sr({
871
871
  // keeping the shared definitions for existing controls.
872
872
  "date",
873
873
  "text"
874
- ]), a = be.filter(
874
+ ]), r = be.filter(
875
875
  (h) => !e.has(h.value) && !l.has(h.value)
876
876
  ), d = be.filter(
877
877
  (h) => e.has(h.value)
@@ -897,9 +897,9 @@ function sr({
897
897
  );
898
898
  return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
899
899
  s === "card" && (S == null ? void 0 : S.sql) == null ? /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Explorer cards support displayed metric, group by field, aggregation, and time grain controls here." }) : null,
900
- a.length > 0 && /* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
900
+ r.length > 0 && /* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
901
901
  /* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Input controls" }),
902
- /* @__PURE__ */ t("div", { className: "grid gap-1.5 sm:grid-cols-2", children: a.map(m) })
902
+ /* @__PURE__ */ t("div", { className: "grid gap-1.5 sm:grid-cols-2", children: r.map(m) })
903
903
  ] }),
904
904
  d.length > 0 && /* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
905
905
  /* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Data-driven controls" }),
@@ -914,7 +914,7 @@ function sr({
914
914
  type: "button",
915
915
  variant: "outline",
916
916
  size: "xs",
917
- onClick: ae,
917
+ onClick: re,
918
918
  children: "Back to controls"
919
919
  }
920
920
  )
@@ -922,12 +922,12 @@ function sr({
922
922
  )
923
923
  ] });
924
924
  })(),
925
- r.step === 2 && L(r.control.type) && /* @__PURE__ */ o("div", { className: "space-y-3", children: [
925
+ a.step === 2 && L(a.control.type) && /* @__PURE__ */ o("div", { className: "space-y-3", children: [
926
926
  /* @__PURE__ */ o("div", { className: "space-y-3", children: [
927
927
  /* @__PURE__ */ t(
928
928
  Je,
929
929
  {
930
- control: r.control,
930
+ control: a.control,
931
931
  onChange: (e) => $((l) => ({
932
932
  ...l,
933
933
  label: e
@@ -937,7 +937,7 @@ function sr({
937
937
  /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Choose which cards should respond to this shared control." })
938
938
  ] }),
939
939
  ee.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-control border border-border/60 bg-muted/30 px-3 py-2.5 text-[12px] text-muted-foreground", children: "No eligible cards are available yet. Add compatible metrics or group-by fields to cards first." }) : /* @__PURE__ */ t("div", { className: "space-y-1 rounded-control border border-border/60 bg-background p-2", children: ee.map((e) => {
940
- const l = (r.selectedCardIds || []).includes(e.cardId);
940
+ const l = (a.selectedCardIds || []).includes(e.cardId);
941
941
  return /* @__PURE__ */ o(
942
942
  "label",
943
943
  {
@@ -947,10 +947,10 @@ function sr({
947
947
  mt,
948
948
  {
949
949
  checked: l,
950
- onCheckedChange: (a) => D(
950
+ onCheckedChange: (r) => D(
951
951
  (d) => d && {
952
952
  ...d,
953
- selectedCardIds: a === !0 ? [
953
+ selectedCardIds: r === !0 ? [
954
954
  ...d.selectedCardIds || [],
955
955
  e.cardId
956
956
  ] : (d.selectedCardIds || []).filter(
@@ -962,7 +962,7 @@ function sr({
962
962
  ),
963
963
  /* @__PURE__ */ o("div", { className: "min-w-0", children: [
964
964
  /* @__PURE__ */ t("div", { className: "font-medium text-foreground", children: e.title }),
965
- /* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: r.control.type === "field_selector" ? `${e.fieldChoices.length} compatible group-by fields` : `${e.metricChoices.length} compatible metrics` })
965
+ /* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: a.control.type === "field_selector" ? `${e.fieldChoices.length} compatible group-by fields` : `${e.metricChoices.length} compatible metrics` })
966
966
  ] })
967
967
  ]
968
968
  },
@@ -973,10 +973,10 @@ function sr({
973
973
  De,
974
974
  {
975
975
  participants: ee,
976
- selectedCardIds: r.selectedCardIds || [],
977
- control: r.control,
978
- selected: r.matrixTargetIds,
979
- onChange: (e, l) => D((a) => a && { ...a, matrixTargetIds: { ...a.matrixTargetIds, [e]: l } })
976
+ selectedCardIds: a.selectedCardIds || [],
977
+ control: a.control,
978
+ selected: a.matrixTargetIds,
979
+ onChange: (e, l) => D((r) => r && { ...r, matrixTargetIds: { ...r.matrixTargetIds, [e]: l } })
980
980
  }
981
981
  ),
982
982
  /* @__PURE__ */ t(
@@ -1009,18 +1009,18 @@ function sr({
1009
1009
  step: 3
1010
1010
  }
1011
1011
  ),
1012
- disabled: !re,
1012
+ disabled: !ae,
1013
1013
  children: "Next"
1014
1014
  }
1015
1015
  )
1016
1016
  }
1017
1017
  )
1018
1018
  ] }),
1019
- r.step === 2 && !L(r.control.type) && /* @__PURE__ */ t(
1019
+ a.step === 2 && !L(a.control.type) && /* @__PURE__ */ t(
1020
1020
  Fe,
1021
1021
  {
1022
- control: r.control,
1023
- defaultValue: r.defaultValue,
1022
+ control: a.control,
1023
+ defaultValue: a.defaultValue,
1024
1024
  availableFieldChoices: Y.fields,
1025
1025
  availableMetricChoices: Y.metrics,
1026
1026
  previewControlDefinitions: ne,
@@ -1038,14 +1038,14 @@ function sr({
1038
1038
  }
1039
1039
  ),
1040
1040
  onNext: ve,
1041
- nextDisabled: !re
1041
+ nextDisabled: !ae
1042
1042
  }
1043
1043
  ),
1044
- r.step === 3 && L(r.control.type) && /* @__PURE__ */ t(
1044
+ a.step === 3 && L(a.control.type) && /* @__PURE__ */ t(
1045
1045
  Fe,
1046
1046
  {
1047
- control: r.control,
1048
- defaultValue: r.defaultValue,
1047
+ control: a.control,
1048
+ defaultValue: a.defaultValue,
1049
1049
  availableFieldChoices: Y.fields,
1050
1050
  availableMetricChoices: Y.metrics,
1051
1051
  previewControlDefinitions: ne,
@@ -1063,13 +1063,13 @@ function sr({
1063
1063
  }
1064
1064
  ),
1065
1065
  onNext: ve,
1066
- nextDisabled: !re
1066
+ nextDisabled: !ae
1067
1067
  }
1068
1068
  ),
1069
- r.step === 3 && !L(r.control.type) && /* @__PURE__ */ t(
1069
+ a.step === 3 && !L(a.control.type) && /* @__PURE__ */ t(
1070
1070
  Ae,
1071
1071
  {
1072
- control: r.control,
1072
+ control: a.control,
1073
1073
  scope: s,
1074
1074
  createdReference: Ce,
1075
1075
  explorerContent: /* @__PURE__ */ o(X, { children: [
@@ -1086,21 +1086,21 @@ function sr({
1086
1086
  step: 2
1087
1087
  }
1088
1088
  ),
1089
- onCancel: ae,
1089
+ onCancel: re,
1090
1090
  onDone: ye
1091
1091
  }
1092
1092
  ),
1093
- r.step === 4 && L(r.control.type) && /* @__PURE__ */ t(
1093
+ a.step === 4 && L(a.control.type) && /* @__PURE__ */ t(
1094
1094
  Ae,
1095
1095
  {
1096
- control: r.control,
1096
+ control: a.control,
1097
1097
  scope: s,
1098
1098
  createdReference: Ce,
1099
1099
  summaryDetail: /* @__PURE__ */ o(X, { children: [
1100
1100
  "Used by ",
1101
- (r.selectedCardIds || []).length,
1101
+ (a.selectedCardIds || []).length,
1102
1102
  " selected card",
1103
- (r.selectedCardIds || []).length === 1 ? "" : "s"
1103
+ (a.selectedCardIds || []).length === 1 ? "" : "s"
1104
1104
  ] }),
1105
1105
  explorerContent: /* @__PURE__ */ t(X, { children: "Selected cards have been set up to respond to this control automatically." }),
1106
1106
  sqlDescription: "SQL cards can still reference this control directly in the SQL editor.",
@@ -1110,14 +1110,14 @@ function sr({
1110
1110
  step: 3
1111
1111
  }
1112
1112
  ),
1113
- onCancel: ae,
1113
+ onCancel: re,
1114
1114
  onDone: ye
1115
1115
  }
1116
1116
  )
1117
1117
  ] }) : null,
1118
- !r && n.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: b }) : null,
1119
- !r && n.map((e) => {
1120
- const l = et(e), a = v == null ? void 0 : v[e.id], d = pe({
1118
+ !a && n.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: b }) : null,
1119
+ !a && n.map((e) => {
1120
+ const l = et(e), r = v == null ? void 0 : v[e.id], d = pe({
1121
1121
  control: e,
1122
1122
  defaultValues: i
1123
1123
  }), m = We === e.id, h = "inline-flex shrink-0 items-center rounded-[4px] border border-border/60 bg-muted/40 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground";
@@ -1145,7 +1145,7 @@ function sr({
1145
1145
  ] }),
1146
1146
  /* @__PURE__ */ o("div", { className: "mt-0.5 text-[12px] text-muted-foreground", children: [
1147
1147
  Xe(e),
1148
- a != null && a.status ? ` · ${a.status}` : ""
1148
+ r != null && r.status ? ` · ${r.status}` : ""
1149
1149
  ] })
1150
1150
  ] })
1151
1151
  ]
@@ -1158,7 +1158,7 @@ function sr({
1158
1158
  size: "xs",
1159
1159
  variant: "ghost",
1160
1160
  className: "h-7 w-7 shrink-0 p-0 text-muted-foreground",
1161
- onClick: () => rt(e.id),
1161
+ onClick: () => at(e.id),
1162
1162
  "aria-label": `Remove ${e.label}`,
1163
1163
  children: /* @__PURE__ */ t(pt, { className: "h-3.5 w-3.5" })
1164
1164
  }
@@ -1387,13 +1387,13 @@ function sr({
1387
1387
  e.id
1388
1388
  );
1389
1389
  }),
1390
- !r && /* @__PURE__ */ o(
1390
+ !a && /* @__PURE__ */ o(
1391
1391
  E,
1392
1392
  {
1393
1393
  type: "button",
1394
1394
  variant: "outline",
1395
1395
  size: "xs",
1396
- onClick: at,
1396
+ onClick: rt,
1397
1397
  children: [
1398
1398
  /* @__PURE__ */ t(yt, { className: "h-3.5 w-3.5" }),
1399
1399
  "Add control"
@@ -1402,7 +1402,7 @@ function sr({
1402
1402
  )
1403
1403
  ] });
1404
1404
  }
1405
- function or(s) {
1405
+ function oa(s) {
1406
1406
  const {
1407
1407
  open: n,
1408
1408
  onOpenChange: u,
@@ -1437,13 +1437,13 @@ function or(s) {
1437
1437
  };
1438
1438
  }
1439
1439
  export {
1440
- sr as C,
1441
- ar as F,
1440
+ sa as C,
1441
+ ra as F,
1442
1442
  zt as I,
1443
1443
  qt as L,
1444
- nr as V,
1444
+ na as V,
1445
1445
  Mt as a,
1446
- lr as b,
1446
+ la as b,
1447
1447
  At as c,
1448
- or as u
1448
+ oa as u
1449
1449
  };