react-semaphor 0.1.449 → 0.1.454

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 (147) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +119 -112
  3. package/dist/appearance/index.cjs +1 -1
  4. package/dist/appearance/index.js +1 -1
  5. package/dist/brand-studio/index.cjs +4 -4
  6. package/dist/brand-studio/index.js +15 -13
  7. package/dist/briefings/index.cjs +1 -1
  8. package/dist/briefings/index.js +39 -2131
  9. package/dist/chunks/{analyze-result-contract-T-0Ntzys.js → analyze-result-contract-BbRJ-C06.js} +1 -1
  10. package/dist/chunks/{analyze-result-contract-BHb7sUUW.cjs → analyze-result-contract-LPDNldic.cjs} +1 -1
  11. package/dist/chunks/canonical-result-keys-BA0HCP4e.cjs +1 -0
  12. package/dist/chunks/canonical-result-keys-D6avdjpA.js +467 -0
  13. package/dist/chunks/color-CJvdlFM_.js +2162 -0
  14. package/dist/chunks/color-CyB5o13F.cjs +4 -0
  15. package/dist/chunks/{common-types-CQ6SHfLk.cjs → common-types-C57kJ59w.cjs} +1 -1
  16. package/dist/chunks/{common-types-B7Jk3Rtj.js → common-types-H51FLKB7.js} +1 -1
  17. package/dist/chunks/contracts-CoCOpd_i.js +11 -0
  18. package/dist/chunks/contracts-CtB2VONT.cjs +1 -0
  19. package/dist/chunks/dashboard-briefing-launcher-Dwj1i7lr.cjs +26 -0
  20. package/dist/chunks/{dashboard-briefing-launcher-DCHiEkLE.js → dashboard-briefing-launcher-SYroFdae.js} +86 -84
  21. package/dist/chunks/{dashboard-controls-DwRFCcHV.js → dashboard-controls-1LpeU2sz.js} +15 -13
  22. package/dist/chunks/{dashboard-controls-CaFioayc.cjs → dashboard-controls-CpFoh7-A.cjs} +1 -1
  23. package/dist/chunks/dashboard-date-comparison-definition-Ces4alFm.cjs +1 -0
  24. package/dist/chunks/{dashboard-date-comparison-definition-Ba-clViK.js → dashboard-date-comparison-definition-DC3ekV2S.js} +1 -1
  25. package/dist/chunks/{dashboard-json-WoILbfTe.js → dashboard-json-D-T-sQxU.js} +25 -23
  26. package/dist/chunks/dashboard-json-DwSQopc_.cjs +1 -0
  27. package/dist/chunks/edit-dashboard-visual-BEmoQAET.cjs +172 -0
  28. package/dist/chunks/{edit-dashboard-visual-ciFhxqaI.js → edit-dashboard-visual-DqxUq4Bs.js} +6925 -6947
  29. package/dist/chunks/editor-action-buttons-18r2xwei.cjs +16 -0
  30. package/dist/chunks/{editor-action-buttons-BPo_45pM.js → editor-action-buttons-B2l3WIRC.js} +41 -39
  31. package/dist/chunks/format-types-CFHQoIuk.js +1350 -0
  32. package/dist/chunks/format-types-PSZZ7hG8.cjs +1 -0
  33. package/dist/chunks/index-Bn5wlkHt.cjs +4 -0
  34. package/dist/chunks/index-ByFbacH7.cjs +1 -0
  35. package/dist/chunks/index-CACdoqu3.js +318 -0
  36. package/dist/chunks/index-CLB_NGZ8.cjs +1392 -0
  37. package/dist/chunks/index-Ca784dpx.js +3714 -0
  38. package/dist/chunks/{index-CPuawpXJ.js → index-DAoS4BNU.js} +48514 -48484
  39. package/dist/chunks/index-DSKR3nKn.js +421 -0
  40. package/dist/chunks/index-F25jnH0p.cjs +1 -0
  41. package/dist/chunks/matrix-result-contract-CofATICL.js +437 -0
  42. package/dist/chunks/matrix-result-contract-zamd9euI.cjs +1 -0
  43. package/dist/chunks/pivot-header-presentation-DhyQXxKq.cjs +4 -0
  44. package/dist/chunks/pivot-header-presentation-ckYOQ4aZ.js +557 -0
  45. package/dist/chunks/{pivot-result-identity-CDLRT-YG.cjs → pivot-result-identity-Bb4EixVN.cjs} +1 -1
  46. package/dist/chunks/{pivot-result-identity-CwJWpKI7.js → pivot-result-identity-DU1v-5Xk.js} +1 -1
  47. package/dist/chunks/pivot-result-lifecycle-DmcF1ris.cjs +1 -0
  48. package/dist/chunks/pivot-result-lifecycle-sjzIOpvp.js +1641 -0
  49. package/dist/chunks/raw-temporal-contract-BtjH_G-d.cjs +1 -0
  50. package/dist/chunks/raw-temporal-contract-CxncLze5.js +64 -0
  51. package/dist/chunks/report-preferences-dialog-BgSvlDXa.cjs +1 -0
  52. package/dist/chunks/report-preferences-dialog-DDc2WUa0.js +723 -0
  53. package/dist/chunks/{report-runtime-context-C8LZFsqV.cjs → report-runtime-context-DqxS4wbi.cjs} +1 -1
  54. package/dist/chunks/{report-runtime-context-bCy3CVzK.js → report-runtime-context-SM6YO61_.js} +5 -5
  55. package/dist/chunks/saved-temporal-bucket-format-CFfWXRl9.cjs +1 -0
  56. package/dist/chunks/saved-temporal-bucket-format-SGAV0ivR.js +922 -0
  57. package/dist/chunks/{switch-BXet-Sno.js → switch-BeZW-HnS.js} +4350 -5249
  58. package/dist/chunks/switch-D-CCcfhc.cjs +138 -0
  59. package/dist/chunks/temporal-bucket-5UYEotyQ.js +810 -0
  60. package/dist/chunks/temporal-bucket-DHY1y9lq.cjs +1 -0
  61. package/dist/chunks/temporal-bucket-authoring-K1kE6R_z.js +222 -0
  62. package/dist/chunks/temporal-bucket-authoring-o3Emn05L.cjs +1 -0
  63. package/dist/chunks/{temporal-bucket-contract-ChDBWX8I.cjs → temporal-bucket-contract-D2-93DGr.cjs} +1 -1
  64. package/dist/chunks/{temporal-bucket-contract-_F6vNhhH.js → temporal-bucket-contract-D5d-xEl3.js} +1 -1
  65. package/dist/chunks/{token-types-BdQ8kHBm.cjs → token-types-D7CaaI80.cjs} +1 -1
  66. package/dist/chunks/{token-types-BHR58aTy.js → token-types-GbxRUozo.js} +1 -1
  67. package/dist/chunks/{update-policy-BxvYMYz0.cjs → update-policy-BmiOd0PB.cjs} +1 -1
  68. package/dist/chunks/{update-policy-g0rCQ9BM.js → update-policy-hednMF-0.js} +1 -1
  69. package/dist/chunks/validators-BDYprKI9.cjs +1 -0
  70. package/dist/chunks/{validators-Cs74WVie.js → validators-DEmd8Sin.js} +1561 -1197
  71. package/dist/dashboard/index.cjs +1 -1
  72. package/dist/dashboard/index.js +2 -2
  73. package/dist/dashboard-authoring/index.cjs +3 -3
  74. package/dist/dashboard-authoring/index.js +35 -32
  75. package/dist/data-app-builder/index.cjs +1 -1
  76. package/dist/data-app-builder/index.js +2 -2
  77. package/dist/data-app-codegen/index.cjs +1 -1
  78. package/dist/data-app-codegen/index.js +2 -2
  79. package/dist/data-app-codegen-node/index.cjs +1 -1
  80. package/dist/data-app-codegen-node/index.js +3 -3
  81. package/dist/data-app-sdk/index.cjs +1 -1
  82. package/dist/data-app-sdk/index.js +78 -77
  83. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  84. package/dist/data-app-sdk-adapters/index.js +29 -30
  85. package/dist/data-app-sdk-validation/index.cjs +1 -1
  86. package/dist/data-app-sdk-validation/index.js +21 -21
  87. package/dist/format-utils/index.cjs +3 -3
  88. package/dist/format-utils/index.js +156 -140
  89. package/dist/index.cjs +1 -1
  90. package/dist/index.js +157 -155
  91. package/dist/report-runtime-context/index.cjs +1 -1
  92. package/dist/report-runtime-context/index.js +2 -2
  93. package/dist/style.css +1 -1
  94. package/dist/surfboard/index.cjs +1 -1
  95. package/dist/surfboard/index.js +3 -3
  96. package/dist/types/analytics-protocol.d.ts +81 -11
  97. package/dist/types/briefings.d.ts +727 -19
  98. package/dist/types/dashboard-assistant.d.ts +37 -17
  99. package/dist/types/dashboard-authoring.d.ts +61 -14
  100. package/dist/types/dashboard.d.ts +137 -12
  101. package/dist/types/data-app-builder.d.ts +28 -2
  102. package/dist/types/data-app-codegen-node.d.ts +29 -3
  103. package/dist/types/data-app-codegen.d.ts +29 -3
  104. package/dist/types/data-app-sdk-adapters.d.ts +28 -2
  105. package/dist/types/data-app-sdk-validation.d.ts +51 -7
  106. package/dist/types/data-app-sdk.d.ts +55 -10
  107. package/dist/types/format-utils.d.ts +190 -3
  108. package/dist/types/index.cjs +1 -1
  109. package/dist/types/index.js +4 -4
  110. package/dist/types/main.d.ts +128 -33
  111. package/dist/types/shared.d.ts +14 -12
  112. package/dist/types/surfboard.d.ts +138 -13
  113. package/dist/types/types.d.ts +117 -23
  114. package/dist/types/value-format-preferences.d.ts +3 -0
  115. package/package.json +2 -1
  116. package/dist/chunks/card-config-utils-15sRtebL.cjs +0 -1
  117. package/dist/chunks/card-config-utils-BYZ5MJOh.js +0 -16
  118. package/dist/chunks/catalog-field-grounding-Bnx-3tE0.cjs +0 -1
  119. package/dist/chunks/catalog-field-grounding-S2jKwKGD.js +0 -100
  120. package/dist/chunks/dashboard-briefing-launcher-DDgDr2s3.cjs +0 -26
  121. package/dist/chunks/dashboard-date-comparison-definition-DZq0htjG.cjs +0 -1
  122. package/dist/chunks/dashboard-input-contract-DSt8dGzP.js +0 -18
  123. package/dist/chunks/dashboard-input-contract-DV3cshjz.cjs +0 -1
  124. package/dist/chunks/dashboard-json-CYtvwtvj.cjs +0 -1
  125. package/dist/chunks/edit-dashboard-visual-DwKcvlsF.cjs +0 -177
  126. package/dist/chunks/editor-action-buttons-BVmsk0Aj.cjs +0 -16
  127. package/dist/chunks/format-types-CSv0V7mm.cjs +0 -1
  128. package/dist/chunks/format-types-DZGgYj39.js +0 -1663
  129. package/dist/chunks/index-CJdxSyQq.js +0 -2578
  130. package/dist/chunks/index-DPv8_Ild.cjs +0 -1395
  131. package/dist/chunks/index-DRlMUglg.cjs +0 -4
  132. package/dist/chunks/metric-comparison-97zHGEx5.js +0 -387
  133. package/dist/chunks/metric-comparison-CUAJ8n4y.cjs +0 -1
  134. package/dist/chunks/pivot-result-lifecycle-BBabQ_da.js +0 -914
  135. package/dist/chunks/pivot-result-lifecycle-DPc0ANwk.cjs +0 -4
  136. package/dist/chunks/presentation-execution-BLfPTGX_.js +0 -637
  137. package/dist/chunks/presentation-execution-BTV-Q43g.cjs +0 -1
  138. package/dist/chunks/report-preferences-dialog-D9ZCGh9l.js +0 -691
  139. package/dist/chunks/report-preferences-dialog-DaqTEcac.cjs +0 -1
  140. package/dist/chunks/switch-Cjk6G06r.cjs +0 -138
  141. package/dist/chunks/temporal-bucket-BnPxGrAi.js +0 -446
  142. package/dist/chunks/temporal-bucket-authoring-CPTwHzvs.cjs +0 -1
  143. package/dist/chunks/temporal-bucket-authoring-CgOuakGW.js +0 -205
  144. package/dist/chunks/temporal-bucket-pMnV-4Nj.cjs +0 -1
  145. package/dist/chunks/temporal-result-owner-6peubmhU.js +0 -443
  146. package/dist/chunks/temporal-result-owner-f6-i65Fb.cjs +0 -1
  147. package/dist/chunks/validators-9D4KBqKD.cjs +0 -1
@@ -1,9 +1,10 @@
1
1
  import { toSemaphorInputSnapshots as jr, toSemaphorInputBinding as Hr, toSemaphorActiveInputSnapshots as X, toSemaphorMatrixIntent as Pr, toSemaphorSqlIntent as Vr, toSemaphorInputOptionsIntent as Qr, toSemaphorRecordsIntent as Ur, toSemaphorAnalysisQueryOptions as Gr, toSemaphorAnalysisIntent as Jr, toSemaphorMetricIntent as Yr, hasSemaphorInputValue as ue, normalizeSemaphorInputOptions as hr, toSemaphorInputSpec as br } from "../data-app-sdk-adapters/index.js";
2
2
  import { jsxs as p, Fragment as vr, jsx as a } from "react/jsx-runtime";
3
- import { createContext as Ie, useContext as Q, useState as z, useRef as E, useEffect as B, useMemo as I, Fragment as Xr, useId as Sr, useCallback as D, useReducer as Zr } from "react";
4
- import { j as et, a4 as rt, x as tt } from "../chunks/validators-Cs74WVie.js";
5
- import { c as ao, a5 as lo } from "../chunks/validators-Cs74WVie.js";
6
- import "../chunks/analyze-result-contract-T-0Ntzys.js";
3
+ import { createContext as Ie, useContext as Q, useState as z, useRef as E, useEffect as D, useMemo as I, Fragment as Xr, useId as Sr, useCallback as B, useReducer as Zr } from "react";
4
+ import { m as et, aj as rt, B as tt } from "../chunks/validators-DEmd8Sin.js";
5
+ import { c as lo, ak as uo } from "../chunks/validators-DEmd8Sin.js";
6
+ import "../chunks/analyze-result-contract-BbRJ-C06.js";
7
+ import "../value-format-preferences/index.js";
7
8
  import { M as nt, a as it, S as ot, E as st, C as at } from "../chunks/search-BHsQIWBV.js";
8
9
  import { X as lt, C as dt, j as ut } from "../chunks/x-CXDkqdur.js";
9
10
  function me(e, r, t = {}) {
@@ -13,13 +14,13 @@ function me(e, r, t = {}) {
13
14
  role: r
14
15
  };
15
16
  }
16
- function Gi(e) {
17
+ function Ji(e) {
17
18
  return e;
18
19
  }
19
- function Ji(e) {
20
+ function Yi(e) {
20
21
  return e;
21
22
  }
22
- const Yi = {
23
+ const Xi = {
23
24
  source: {
24
25
  semantic(e) {
25
26
  return {
@@ -1559,7 +1560,7 @@ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1559
1560
  textOverflow: "ellipsis",
1560
1561
  whiteSpace: "nowrap"
1561
1562
  }
1562
- }, Ee = 10, Re = 100, Ot = 25, Dt = 500, Ar = {
1563
+ }, Ee = 10, Re = 100, Ot = 25, Bt = 500, Ar = {
1563
1564
  enabled: !1,
1564
1565
  queries: [],
1565
1566
  issues: [],
@@ -1569,7 +1570,7 @@ const ye = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
1569
1570
  }, Ve = Ie(null), Qe = Ie(null), Ue = Ie(
1570
1571
  void 0
1571
1572
  ), V = [];
1572
- function Bt({
1573
+ function Dt({
1573
1574
  debug: e,
1574
1575
  children: r
1575
1576
  }) {
@@ -1578,9 +1579,9 @@ function Bt({
1578
1579
  t,
1579
1580
  Or
1580
1581
  ), o = E(n), u = Sr(), [f, d] = z({ open: !1 });
1581
- o.current = n, B(() => {
1582
+ o.current = n, D(() => {
1582
1583
  i({ type: "config", config: t });
1583
- }, [t]), B(() => {
1584
+ }, [t]), D(() => {
1584
1585
  if (!n.enabled || !n.exposeWindowBridge || typeof window > "u")
1585
1586
  return;
1586
1587
  const h = Kn(() => o.current);
@@ -1591,11 +1592,11 @@ function Bt({
1591
1592
  Wt(u);
1592
1593
  };
1593
1594
  }, [u, n.enabled, n.exposeWindowBridge]);
1594
- const c = I(() => ({ state: n, dispatch: i }), [n]), g = D((h) => {
1595
+ const c = I(() => ({ state: n, dispatch: i }), [n]), g = B((h) => {
1595
1596
  d({ open: !0, focus: h });
1596
- }, []), m = D(() => {
1597
+ }, []), m = B(() => {
1597
1598
  d((h) => ({ ...h, open: !1 }));
1598
- }, []), v = D((h) => {
1599
+ }, []), v = B((h) => {
1599
1600
  d({ open: !0, focus: h });
1600
1601
  }, []), y = I(
1601
1602
  () => ({
@@ -1633,7 +1634,7 @@ function Cr() {
1633
1634
  const e = V[V.length - 1];
1634
1635
  e ? window.__SEMAPHOR_DEVTOOLS__ = e.bridge : delete window.__SEMAPHOR_DEVTOOLS__;
1635
1636
  }
1636
- function Xi({
1637
+ function Zi({
1637
1638
  id: e,
1638
1639
  title: r,
1639
1640
  children: t
@@ -1649,11 +1650,11 @@ function _t({
1649
1650
  style: i
1650
1651
  } = {}) {
1651
1652
  const o = Tr(), u = Q(Qe), [f, d] = z(""), [c, g] = z(!1), m = E(null), v = E(null), y = u == null ? void 0 : u.openDevtools, h = u == null ? void 0 : u.closeDevtools, C = (u == null ? void 0 : u.open) === !0;
1652
- B(() => {
1653
+ D(() => {
1653
1654
  qr();
1654
- }, []), B(() => {
1655
+ }, []), D(() => {
1655
1656
  r && o.enabled && (y == null || y());
1656
- }, [r, o.enabled, y]), B(() => {
1657
+ }, [r, o.enabled, y]), D(() => {
1657
1658
  if (!C || !h)
1658
1659
  return;
1659
1660
  const S = (w) => {
@@ -1881,7 +1882,7 @@ function _t({
1881
1882
  ) : null
1882
1883
  ] });
1883
1884
  }
1884
- function Zi({
1885
+ function eo({
1885
1886
  queryId: e,
1886
1887
  viewId: r,
1887
1888
  label: t,
@@ -1890,7 +1891,7 @@ function Zi({
1890
1891
  } = {}) {
1891
1892
  var m, v;
1892
1893
  const o = Tr(), u = Q(Qe), f = Q(Ue);
1893
- B(() => {
1894
+ D(() => {
1894
1895
  qr();
1895
1896
  }, []);
1896
1897
  const d = r || (f == null ? void 0 : f.id), c = I(
@@ -1997,18 +1998,18 @@ function Nt({
1997
1998
  ie
1998
1999
  ]
1999
2000
  );
2000
- B(() => {
2001
+ D(() => {
2001
2002
  if (!(!d || !c))
2002
2003
  return c({ type: "register", descriptor: Ze }), () => {
2003
2004
  c({ type: "unregister", traceKey: H });
2004
2005
  };
2005
2006
  }, [Ze, c, d, H]);
2006
- const M = D(
2007
+ const M = B(
2007
2008
  (q, U) => {
2008
2009
  !d || !c || c({ type: "event", traceKey: H, event: q, latestAttempt: U });
2009
2010
  },
2010
2011
  [c, d, H]
2011
- ), er = D(() => {
2012
+ ), er = B(() => {
2012
2013
  M(
2013
2014
  {
2014
2015
  type: "query_started",
@@ -2017,7 +2018,7 @@ function Nt({
2017
2018
  },
2018
2019
  { status: "loading" }
2019
2020
  );
2020
- }, [M, k]), rr = D(
2021
+ }, [M, k]), rr = B(
2021
2022
  (q, U) => {
2022
2023
  const se = gr(q), ae = Un(q), zr = Gn(q), ir = pr(q);
2023
2024
  M(
@@ -2045,7 +2046,7 @@ function Nt({
2045
2046
  );
2046
2047
  },
2047
2048
  [M, k]
2048
- ), ge = D(
2049
+ ), ge = B(
2049
2050
  (q, U) => {
2050
2051
  const se = gr(q), ae = q instanceof Error ? q.message : String(q);
2051
2052
  M(
@@ -2066,7 +2067,7 @@ function Nt({
2066
2067
  );
2067
2068
  },
2068
2069
  [M, k]
2069
- ), tr = D(
2070
+ ), tr = B(
2070
2071
  (q) => {
2071
2072
  M(
2072
2073
  {
@@ -2078,7 +2079,7 @@ function Nt({
2078
2079
  );
2079
2080
  },
2080
2081
  [M, k]
2081
- ), nr = D(
2082
+ ), nr = B(
2082
2083
  (q) => {
2083
2084
  ge(q, 0);
2084
2085
  },
@@ -2243,7 +2244,7 @@ function zt({
2243
2244
  render: () => /* @__PURE__ */ a("pre", { style: s.codeBlock, children: In(e) })
2244
2245
  });
2245
2246
  const u = (C = o[0]) == null ? void 0 : C.id, f = e.traceId || `${e.viewId ?? ""}:${e.queryId}`, [d, c] = z(u), g = E(f), m = E(!1), v = o.map((l) => l.id).join("|");
2246
- B(() => {
2247
+ D(() => {
2247
2248
  if (g.current !== f) {
2248
2249
  g.current = f, m.current = !1, c(u);
2249
2250
  return;
@@ -2981,7 +2982,7 @@ function Rn(e, r) {
2981
2982
  return e;
2982
2983
  switch (r.type) {
2983
2984
  case "register":
2984
- return Dn(Ln(e, r.descriptor));
2985
+ return Bn(Ln(e, r.descriptor));
2985
2986
  case "unregister":
2986
2987
  return $n(e, r.traceKey);
2987
2988
  case "event":
@@ -2992,8 +2993,8 @@ function Rn(e, r) {
2992
2993
  }
2993
2994
  function Ln(e, r) {
2994
2995
  const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = Je(), o = {
2995
- ...t || Bn(r),
2996
- ...Dr(r),
2996
+ ...t || Dn(r),
2997
+ ...Br(r),
2997
2998
  traceKey: r.traceKey,
2998
2999
  latestAttempt: (t == null ? void 0 : t.latestAttempt) || { status: "idle" },
2999
3000
  recentEvents: (t == null ? void 0 : t.recentEvents) || [],
@@ -3048,7 +3049,7 @@ function On(e, r) {
3048
3049
  }
3049
3050
  };
3050
3051
  }
3051
- function Dn(e) {
3052
+ function Bn(e) {
3052
3053
  if (e.order.length <= e.maxQueries)
3053
3054
  return e;
3054
3055
  const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i, o) => i.mounted !== o.mounted ? i.mounted ? 1 : -1 : i.lastEventAt - o.lastEventAt), t = e.order.length - e.maxQueries, n = new Set(
@@ -3062,10 +3063,10 @@ function Dn(e) {
3062
3063
  )
3063
3064
  } : e;
3064
3065
  }
3065
- function Bn(e) {
3066
+ function Dn(e) {
3066
3067
  const r = Je();
3067
3068
  return {
3068
- ...Dr(e),
3069
+ ...Br(e),
3069
3070
  traceKey: e.traceKey,
3070
3071
  latestAttempt: { status: "idle" },
3071
3072
  recentEvents: [],
@@ -3074,7 +3075,7 @@ function Bn(e) {
3074
3075
  lastEventAt: r
3075
3076
  };
3076
3077
  }
3077
- function Dr(e) {
3078
+ function Br(e) {
3078
3079
  var n;
3079
3080
  const r = Hn(e.spec), t = Pn(
3080
3081
  e.spec,
@@ -3163,7 +3164,7 @@ function Wn(e) {
3163
3164
  maxQueries: cr(
3164
3165
  e.maxQueries,
3165
3166
  Re,
3166
- Dt
3167
+ Bt
3167
3168
  )
3168
3169
  };
3169
3170
  }
@@ -3290,7 +3291,7 @@ function Hn(e) {
3290
3291
  }
3291
3292
  function Pn(e, r) {
3292
3293
  const t = [
3293
- ...(e.inputs || []).map(Br),
3294
+ ...(e.inputs || []).map(Dr),
3294
3295
  ...(r || []).map((n) => n.field)
3295
3296
  ];
3296
3297
  return Y(t);
@@ -3301,13 +3302,13 @@ function Y(e) {
3301
3302
  t && fe(t) && r.set(Ge(t), t);
3302
3303
  }), [...r.values()];
3303
3304
  }
3304
- function Br(e) {
3305
+ function Dr(e) {
3305
3306
  if (!e || typeof e != "object")
3306
3307
  return;
3307
3308
  const r = e.toAnalyticsInput;
3308
3309
  if (typeof r == "function") {
3309
3310
  const n = r.call(e);
3310
- return Br(n);
3311
+ return Dr(n);
3311
3312
  }
3312
3313
  const t = e.field;
3313
3314
  return fe(t) ? t : void 0;
@@ -3621,9 +3622,9 @@ function ze(e) {
3621
3622
  const r = e;
3622
3623
  return `{${Object.keys(r).sort().map((t) => `${JSON.stringify(t)}:${ze(r[t])}`).join(",")}}`;
3623
3624
  }
3624
- const De = {
3625
+ const Be = {
3625
3626
  primaryValue: null
3626
- }, Be = {}, pi = { records: [] }, Ke = { options: [] }, gi = { records: [] }, We = {};
3627
+ }, De = {}, pi = { records: [] }, Ke = { options: [] }, gi = { records: [] }, We = {};
3627
3628
  function mi(e) {
3628
3629
  const r = X(e.inputs), t = Gr(e);
3629
3630
  try {
@@ -3638,14 +3639,14 @@ function mi(e) {
3638
3639
  i,
3639
3640
  t
3640
3641
  ),
3641
- idleData: Be
3642
+ idleData: De
3642
3643
  } : {
3643
3644
  intent: n,
3644
3645
  error: null,
3645
3646
  activeInputs: r,
3646
3647
  analysisOptions: t,
3647
3648
  queryKey: A(n, r, void 0, t),
3648
- idleData: Be
3649
+ idleData: De
3649
3650
  };
3650
3651
  } catch (n) {
3651
3652
  const i = Z(n, "analysis");
@@ -3659,7 +3660,7 @@ function mi(e) {
3659
3660
  i,
3660
3661
  t
3661
3662
  ),
3662
- idleData: Be
3663
+ idleData: De
3663
3664
  };
3664
3665
  }
3665
3666
  }
@@ -3671,13 +3672,13 @@ function yi(e) {
3671
3672
  error: n,
3672
3673
  activeInputs: r,
3673
3674
  queryKey: A(void 0, r, n),
3674
- idleData: De
3675
+ idleData: Be
3675
3676
  } : {
3676
3677
  intent: t,
3677
3678
  error: null,
3678
3679
  activeInputs: r,
3679
3680
  queryKey: A(t, r),
3680
- idleData: De
3681
+ idleData: Be
3681
3682
  };
3682
3683
  } catch (t) {
3683
3684
  const n = Z(t, "metric");
@@ -3685,7 +3686,7 @@ function yi(e) {
3685
3686
  error: n,
3686
3687
  activeInputs: r,
3687
3688
  queryKey: A(void 0, r, n),
3688
- idleData: De
3689
+ idleData: Be
3689
3690
  };
3690
3691
  }
3691
3692
  }
@@ -4062,18 +4063,18 @@ function $i() {
4062
4063
  function Oi() {
4063
4064
  return Q(Mr);
4064
4065
  }
4065
- function eo(e) {
4066
+ function ro(e) {
4066
4067
  const [r, t] = z(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : r, o = I(
4067
4068
  () => hr(e.options),
4068
4069
  [e.options]
4069
- ), u = D(
4070
+ ), u = B(
4070
4071
  (d) => {
4071
4072
  var g;
4072
4073
  const c = d;
4073
4074
  (g = e.onValueChange) == null || g.call(e, c), n || t(c);
4074
4075
  },
4075
4076
  [n, e]
4076
- ), f = D(() => u(void 0), [u]);
4077
+ ), f = B(() => u(void 0), [u]);
4077
4078
  return I(() => {
4078
4079
  const d = br(e);
4079
4080
  return {
@@ -4103,9 +4104,9 @@ function eo(e) {
4103
4104
  };
4104
4105
  }, [f, o, u, e, i]);
4105
4106
  }
4106
- function ro(e) {
4107
+ function to(e) {
4107
4108
  const [r, t] = z(() => Mi(e));
4108
- return B(() => {
4109
+ return D(() => {
4109
4110
  t((n) => {
4110
4111
  let i = n;
4111
4112
  for (const o of e)
@@ -4153,13 +4154,13 @@ function ro(e) {
4153
4154
  [e, r]
4154
4155
  );
4155
4156
  }
4156
- function to(e, r) {
4157
- const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = I(() => Bi(t), [t]);
4158
- B(() => {
4159
- Di(e.value, t) || e.clear();
4157
+ function no(e, r) {
4158
+ const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = I(() => Di(t), [t]);
4159
+ D(() => {
4160
+ Bi(e.value, t) || e.clear();
4160
4161
  }, [e, n, r == null ? void 0 : r.status, t]);
4161
4162
  }
4162
- function Di(e, r) {
4163
+ function Bi(e, r) {
4163
4164
  if (!ue(e) || r === void 0)
4164
4165
  return !0;
4165
4166
  const t = new Set(
@@ -4169,13 +4170,13 @@ function Di(e, r) {
4169
4170
  (i) => t.has(mr(i))
4170
4171
  );
4171
4172
  }
4172
- function Bi(e) {
4173
+ function Di(e) {
4173
4174
  return JSON.stringify((e || []).map((r) => r.value));
4174
4175
  }
4175
4176
  function mr(e) {
4176
4177
  return `${typeof e}:${String(e)}`;
4177
4178
  }
4178
- function no(e, r = {}) {
4179
+ function io(e, r = {}) {
4179
4180
  const t = I(
4180
4181
  () => r.inputs ? {
4181
4182
  ...e,
@@ -4237,7 +4238,7 @@ function no(e, r = {}) {
4237
4238
  i.start,
4238
4239
  i.success
4239
4240
  ]
4240
- ), f = D(
4241
+ ), f = B(
4241
4242
  (l) => {
4242
4243
  var K, T, N, $, S, w, L, x, O;
4243
4244
  const b = n.request;
@@ -4289,7 +4290,7 @@ function no(e, r = {}) {
4289
4290
  n.request.activeInputs,
4290
4291
  u
4291
4292
  ), c = i.queryId, g = i.validationFailure;
4292
- B(() => {
4293
+ D(() => {
4293
4294
  const l = n.request.error;
4294
4295
  if (!l) {
4295
4296
  o.current = null;
@@ -4512,7 +4513,7 @@ function Ni(e, r, t, n, i) {
4512
4513
  error: null,
4513
4514
  isStale: !1
4514
4515
  });
4515
- return u.current = r, f.current = n, B(() => {
4516
+ return u.current = r, f.current = n, D(() => {
4516
4517
  let g;
4517
4518
  try {
4518
4519
  g = u.current({
@@ -4570,7 +4571,7 @@ function Se(e) {
4570
4571
  function Fi(e) {
4571
4572
  return !e || typeof e == "boolean" || e.enabled === !1 ? null : e.autoRenderDevtools === !0 ? {} : e.autoRenderDevtools ? e.autoRenderDevtools : null;
4572
4573
  }
4573
- function io({
4574
+ function oo({
4574
4575
  token: e,
4575
4576
  apiBaseUrl: r,
4576
4577
  executor: t,
@@ -4587,26 +4588,26 @@ function io({
4587
4588
  }),
4588
4589
  [f, d, m, u]
4589
4590
  );
4590
- return /* @__PURE__ */ a(Bt, { debug: d, children: /* @__PURE__ */ p(Mr.Provider, { value: v, children: [
4591
+ return /* @__PURE__ */ a(Dt, { debug: d, children: /* @__PURE__ */ p(Mr.Provider, { value: v, children: [
4591
4592
  i,
4592
4593
  c ? /* @__PURE__ */ a(_t, { ...c }) : null
4593
4594
  ] }) });
4594
4595
  }
4595
4596
  export {
4596
- io as SemaphorDataAppProvider,
4597
+ oo as SemaphorDataAppProvider,
4597
4598
  _t as SemaphorDevtools,
4598
- Zi as SemaphorDevtoolsInspectButton,
4599
- Xi as SemaphorViewBoundary,
4599
+ eo as SemaphorDevtoolsInspectButton,
4600
+ Zi as SemaphorViewBoundary,
4600
4601
  Ii as createSemaphorQueryExecutor,
4601
- Gi as defineSemaphorDataApp,
4602
- Ji as defineSemaphorInput,
4603
- Di as isSemaphorInputValueValidForOptions,
4604
- Yi as semaphor,
4605
- ao as semaphorMetricAggregate,
4606
- lo as semaphorMetricMeasureBindingKey,
4607
- to as useClearInvalidSemaphorInputValue,
4602
+ Ji as defineSemaphorDataApp,
4603
+ Yi as defineSemaphorInput,
4604
+ Bi as isSemaphorInputValueValidForOptions,
4605
+ Xi as semaphor,
4606
+ lo as semaphorMetricAggregate,
4607
+ uo as semaphorMetricMeasureBindingKey,
4608
+ no as useClearInvalidSemaphorInputValue,
4608
4609
  Tr as useSemaphorDevtools,
4609
- eo as useSemaphorInput,
4610
- ro as useSemaphorInputs,
4611
- no as useSemaphorQuery
4610
+ ro as useSemaphorInput,
4611
+ to as useSemaphorInputs,
4612
+ io as useSemaphorQuery
4612
4613
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../chunks/validators-9D4KBqKD.cjs"),v=require("../chunks/operators-DrTQsJXv.cjs");require("../chunks/analyze-result-contract-BHb7sUUW.cjs");function p(i){var n,e,a;const t=b(i);return{version:1,kind:"metric",id:i.id,label:i.label,source:s(i),measures:t,primaryMeasure:M(i,t),dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,dimensions:(n=i.dimensions)==null?void 0:n.map(r=>o(r,"dimension")),comparison:G(i.comparison),orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...(e=i.filters)!=null&&e.length?{filters:i.filters}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...(a=i.derivedFields)!=null&&a.length?{derivedFields:i.derivedFields}:{}}}function c(i){return{...p(i),...i.timeWindow?{timeWindow:i.timeWindow}:{},...i.analysis?{analysis:i.analysis}:{}}}function F(i){return{...i.chartTitle?{chartTitle:i.chartTitle}:{},...i.chartType?{chartType:i.chartType}:{},...i.driverMode?{driverMode:i.driverMode}:{},...i.includePopulation!==void 0?{includePopulation:i.includePopulation}:{},...i.calendarContext?{calendarContext:i.calendarContext}:{}}}function M(i,t){if(!i.primaryMeasure)return t[0]||{name:"",role:"measure"};const n=o(i.primaryMeasure,"measure"),e=A(n,t),a=e.length===1?e[0]:void 0;return a?I(n,a):n}function b(i){const t=[];for(const n of i.measures.map(e=>o(e,"measure"))){if(!n.name)continue;const e=t.findIndex(a=>R(a,n));if(e===-1){t.push(n);continue}t[e]=I(t[e],n)}return t}function R(i,t){return u.semaphorFieldRefsMatch(i,t)&&d(i)===d(t)}function H(i,t){return d(t)===d(i)}function w(i,t){return t.name!==i.name||i.source&&!u.semaphorFieldRefsMatch(t,i)?!1:H(i,t)}function A(i,t){const n=t.filter(e=>w(i,e));return i.aggregate!==void 0,n}function d(i){return u.semaphorMetricAggregate(i)}function I(i,t){if(i.aggregate&&t.aggregate&&i.aggregate!==t.aggregate)throw new Error(`Measure "${i.name}" was requested with conflicting aggregate semantics: ${i.aggregate} and ${t.aggregate}.`);return{...u.preferSemaphorFieldRefMetadata(i,t),aggregate:i.aggregate||t.aggregate}}function k(i){var n,e;if("sort"in i)throw new Error("semaphor.records supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet.");if(!V(i))throw new Error("semaphor.records needs at least one field.");const t=B(i.fields);return{version:1,kind:"records",id:i.id,label:i.label,source:s(i),fields:t,dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,...i.timeWindow?{timeWindow:i.timeWindow}:{},...(n=i.filters)!=null&&n.length?{filters:i.filters}:{},orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...i.pagination?{pagination:i.pagination}:{},...i.totals?{totals:{mode:"server",measures:i.totals.measures.map(a=>o(a,"measure"))}}:{},...(e=i.derivedFields)!=null&&e.length?{derivedFields:i.derivedFields}:{}}}function B(i){return i.map(t=>{const n=o(t);if(!n.role)throw new Error(`semaphor.records field "${n.name}" needs an explicit role.`);return n})}function x(i){var t,n,e;return{version:1,kind:"inputOptions",id:i.id,label:i.label,inputId:i.inputId,source:s(i),labelField:o(i.labelField,"dimension"),valueField:o(i.valueField,"dimension"),...i.searchField?{searchField:o(i.searchField,"dimension")}:{},...(t=i.disambiguationFields)!=null&&t.length?{disambiguationFields:i.disambiguationFields.map(a=>o(a,"dimension"))}:{},...i.population?{population:i.population}:{},...i.dependencies?{dependencies:i.dependencies}:{},search:i.search,limit:i.limit,...(n=i.inputs)!=null&&n.length?{inputs:i.inputs.map(a=>f(a))}:{},...(e=i.derivedFields)!=null&&e.length?{derivedFields:i.derivedFields}:{}}}function O(i){var t;return{version:1,kind:"sql",id:i.id,label:i.label,source:i.source,sql:i.sql,...i.defaultParameters?{defaultParameters:i.defaultParameters}:{},...i.pythonCode?{pythonCode:i.pythonCode}:{},...(t=i.fields)!=null&&t.length?{fields:i.fields.map(n=>o(n))}:{},inputs:l(i.inputs),limit:i.limit,...i.pagination?{pagination:i.pagination}:{},rationale:i.rationale}}function P(i){var t,n;return{version:1,kind:"matrix",id:i.id,label:i.label,source:s(i),rows:i.rows.map(e=>g(e,"dimension")),...i.columns?{columns:i.columns.map(e=>g(e,"dimension"))}:{},values:i.values.map(z),...(t=i.filters)!=null&&t.length?{filters:i.filters}:{},inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},...i.totals?{totals:i.totals}:{},...(n=i.sort)!=null&&n.length?{sort:i.sort}:{},...i.expansion?{expansion:i.expansion}:{},...i.layout?{layout:i.layout}:{},...i.displayLimits?{displayLimits:i.displayLimits}:{}}}function g(i,t){return C(i)?{...i,field:o(i.field,t)}:{field:o(i,t)}}function z(i){return T(i)?{...i,field:o(i.field,"measure")}:{field:o(i,"measure"),aggregate:i.aggregate}}function C(i){return"field"in i}function T(i){return"field"in i}function f(i){if("toAnalyticsInput"in i){const r=i.toAnalyticsInput();return{inputId:r.inputId,kind:r.kind,...r.controlRole?{controlRole:r.controlRole}:{},...r.operator?{operator:r.operator}:{},...r.field?{field:r.field}:{},...r.relationshipHint?{relationshipHint:r.relationshipHint}:{}}}if("id"in i){const r=h(i);return{inputId:r.inputId,kind:r.kind,...r.controlRole?{controlRole:r.controlRole}:{},...r.operator?{operator:r.operator}:{},...r.field?{field:r.field}:{},...r.relationshipHint?{relationshipHint:r.relationshipHint}:{}}}const t="kind"in i?i.kind:void 0,n="operator"in i?S(i.operator,i.inputId):void 0,e="controlRole"in i?i.controlRole:"role"in i?i.role:void 0,a=q(e)?e:void 0;return{inputId:i.inputId,...t?{kind:t}:{},...a?{controlRole:a}:{},...n?{operator:n}:{},...i.field?{field:i.field}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}function q(i){return i==="grain"||i==="measure"||i==="dimension"||i==="aggregation"||i==="sqlParam"}function W(i){const t=l(i);return t.length>0?t:void 0}function y(i){return(i||[]).map(L)}function $(i){return y(i).filter(t=>t.isActive)}function h(i){if(i.kind==="filter"){const t=S(i.operator,i.id);return{inputId:i.id,kind:i.kind,label:i.label,field:o(i.field,"dimension"),operator:t||"in",...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}return{inputId:i.id,kind:i.kind,label:i.label,controlRole:i.role}}function E(i=[]){return i.map(t=>typeof t=="object"?t:{label:String(t),value:t})}function m(i){return i==null?!1:Array.isArray(i)?i.length>0:typeof i=="string"?i.trim().length>0:!0}function L(i){if("toAnalyticsInput"in i)return i.toAnalyticsInput();if("kind"in i&&"isActive"in i)return i;if("id"in i){const t=h(i),n=Object.prototype.hasOwnProperty.call(i,"value")?i.value:i.defaultValue;return{inputId:t.inputId,kind:t.kind,label:t.label,...t.field?{field:t.field}:{},...t.operator?{operator:t.operator}:{},...t.controlRole?{controlRole:t.controlRole}:{},...t.relationshipHint?{relationshipHint:t.relationshipHint}:{},value:n,isActive:m(n)}}return{...i,kind:"filter",isActive:m(i.value),value:i.value}}function s(i){return i.source}function V(i){var t;return!!((t=i.fields)!=null&&t.length)}function o(i,t){return{...i,role:i.role||t}}function l(i){return(i||[]).map(f)}function G(i){if(i)return i}function S(i,t){if(i===void 0)return;const n=v.normalizeSemaphorInputOperator(i);if(!n)throw new Error(`useSemaphorInput "${t}" uses unsupported filter operator "${i}".`);return n}exports.hasSemaphorInputValue=m;exports.normalizeSemaphorInputOptions=E;exports.toSemaphorActiveInputSnapshots=$;exports.toSemaphorAnalysisIntent=c;exports.toSemaphorAnalysisQueryOptions=F;exports.toSemaphorInputBinding=f;exports.toSemaphorInputBindings=W;exports.toSemaphorInputOptionsIntent=x;exports.toSemaphorInputSnapshots=y;exports.toSemaphorInputSpec=h;exports.toSemaphorMatrixIntent=P;exports.toSemaphorMetricIntent=p;exports.toSemaphorRecordsIntent=k;exports.toSemaphorSqlIntent=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../chunks/validators-BDYprKI9.cjs"),v=require("../chunks/operators-DrTQsJXv.cjs");require("../chunks/analyze-result-contract-LPDNldic.cjs");require("../value-format-preferences/index.cjs");function p(i){var n,e,a;const t=b(i);return{version:1,kind:"metric",id:i.id,label:i.label,source:s(i),measures:t,primaryMeasure:M(i,t),dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,dimensions:(n=i.dimensions)==null?void 0:n.map(r=>o(r,"dimension")),comparison:G(i.comparison),orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...(e=i.filters)!=null&&e.length?{filters:i.filters}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...(a=i.derivedFields)!=null&&a.length?{derivedFields:i.derivedFields}:{}}}function c(i){return{...p(i),...i.timeWindow?{timeWindow:i.timeWindow}:{},...i.analysis?{analysis:i.analysis}:{}}}function F(i){return{...i.chartTitle?{chartTitle:i.chartTitle}:{},...i.chartType?{chartType:i.chartType}:{},...i.driverMode?{driverMode:i.driverMode}:{},...i.includePopulation!==void 0?{includePopulation:i.includePopulation}:{},...i.calendarContext?{calendarContext:i.calendarContext}:{}}}function M(i,t){if(!i.primaryMeasure)return t[0]||{name:"",role:"measure"};const n=o(i.primaryMeasure,"measure"),e=A(n,t),a=e.length===1?e[0]:void 0;return a?I(n,a):n}function b(i){const t=[];for(const n of i.measures.map(e=>o(e,"measure"))){if(!n.name)continue;const e=t.findIndex(a=>R(a,n));if(e===-1){t.push(n);continue}t[e]=I(t[e],n)}return t}function R(i,t){return u.semaphorFieldRefsMatch(i,t)&&d(i)===d(t)}function H(i,t){return d(t)===d(i)}function w(i,t){return t.name!==i.name||i.source&&!u.semaphorFieldRefsMatch(t,i)?!1:H(i,t)}function A(i,t){const n=t.filter(e=>w(i,e));return i.aggregate!==void 0,n}function d(i){return u.semaphorMetricAggregate(i)}function I(i,t){if(i.aggregate&&t.aggregate&&i.aggregate!==t.aggregate)throw new Error(`Measure "${i.name}" was requested with conflicting aggregate semantics: ${i.aggregate} and ${t.aggregate}.`);return{...u.preferSemaphorFieldRefMetadata(i,t),aggregate:i.aggregate||t.aggregate}}function k(i){var n,e;if("sort"in i)throw new Error("semaphor.records supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet.");if(!V(i))throw new Error("semaphor.records needs at least one field.");const t=B(i.fields);return{version:1,kind:"records",id:i.id,label:i.label,source:s(i),fields:t,dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,...i.timeWindow?{timeWindow:i.timeWindow}:{},...(n=i.filters)!=null&&n.length?{filters:i.filters}:{},orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...i.pagination?{pagination:i.pagination}:{},...i.totals?{totals:{mode:"server",measures:i.totals.measures.map(a=>o(a,"measure"))}}:{},...(e=i.derivedFields)!=null&&e.length?{derivedFields:i.derivedFields}:{}}}function B(i){return i.map(t=>{const n=o(t);if(!n.role)throw new Error(`semaphor.records field "${n.name}" needs an explicit role.`);return n})}function x(i){var t,n,e;return{version:1,kind:"inputOptions",id:i.id,label:i.label,inputId:i.inputId,source:s(i),labelField:o(i.labelField,"dimension"),valueField:o(i.valueField,"dimension"),...i.searchField?{searchField:o(i.searchField,"dimension")}:{},...(t=i.disambiguationFields)!=null&&t.length?{disambiguationFields:i.disambiguationFields.map(a=>o(a,"dimension"))}:{},...i.population?{population:i.population}:{},...i.dependencies?{dependencies:i.dependencies}:{},search:i.search,limit:i.limit,...(n=i.inputs)!=null&&n.length?{inputs:i.inputs.map(a=>f(a))}:{},...(e=i.derivedFields)!=null&&e.length?{derivedFields:i.derivedFields}:{}}}function O(i){var t;return{version:1,kind:"sql",id:i.id,label:i.label,source:i.source,sql:i.sql,...i.defaultParameters?{defaultParameters:i.defaultParameters}:{},...i.pythonCode?{pythonCode:i.pythonCode}:{},...(t=i.fields)!=null&&t.length?{fields:i.fields.map(n=>o(n))}:{},inputs:l(i.inputs),limit:i.limit,...i.pagination?{pagination:i.pagination}:{},rationale:i.rationale}}function P(i){var t,n;return{version:1,kind:"matrix",id:i.id,label:i.label,source:s(i),rows:i.rows.map(e=>g(e,"dimension")),columns:(i.columns??[]).map(e=>g(e,"dimension")),values:i.values.map(z),...(t=i.filters)!=null&&t.length?{filters:i.filters}:{},inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},...i.totals?{totals:i.totals}:{},...(n=i.sort)!=null&&n.length?{sort:i.sort}:{},...i.expansion?{expansion:i.expansion}:{},...i.layout?{layout:i.layout}:{},...i.displayLimits?{displayLimits:i.displayLimits}:{}}}function g(i,t){return C(i)?{...i,field:o(i.field,t)}:{field:o(i,t)}}function z(i){return T(i)?{...i,field:o(i.field,"measure")}:{field:o(i,"measure"),aggregate:i.aggregate}}function C(i){return"field"in i}function T(i){return"field"in i}function f(i){if("toAnalyticsInput"in i){const r=i.toAnalyticsInput();return{inputId:r.inputId,kind:r.kind,...r.controlRole?{controlRole:r.controlRole}:{},...r.operator?{operator:r.operator}:{},...r.field?{field:r.field}:{},...r.relationshipHint?{relationshipHint:r.relationshipHint}:{}}}if("id"in i){const r=h(i);return{inputId:r.inputId,kind:r.kind,...r.controlRole?{controlRole:r.controlRole}:{},...r.operator?{operator:r.operator}:{},...r.field?{field:r.field}:{},...r.relationshipHint?{relationshipHint:r.relationshipHint}:{}}}const t="kind"in i?i.kind:void 0,n="operator"in i?S(i.operator,i.inputId):void 0,e="controlRole"in i?i.controlRole:"role"in i?i.role:void 0,a=q(e)?e:void 0;return{inputId:i.inputId,...t?{kind:t}:{},...a?{controlRole:a}:{},...n?{operator:n}:{},...i.field?{field:i.field}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}function q(i){return i==="grain"||i==="measure"||i==="dimension"||i==="aggregation"||i==="sqlParam"}function W(i){const t=l(i);return t.length>0?t:void 0}function y(i){return(i||[]).map(L)}function $(i){return y(i).filter(t=>t.isActive)}function h(i){if(i.kind==="filter"){const t=S(i.operator,i.id);return{inputId:i.id,kind:i.kind,label:i.label,field:o(i.field,"dimension"),operator:t||"in",...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}return{inputId:i.id,kind:i.kind,label:i.label,controlRole:i.role}}function E(i=[]){return i.map(t=>typeof t=="object"?t:{label:String(t),value:t})}function m(i){return i==null?!1:Array.isArray(i)?i.length>0:typeof i=="string"?i.trim().length>0:!0}function L(i){if("toAnalyticsInput"in i)return i.toAnalyticsInput();if("kind"in i&&"isActive"in i)return i;if("id"in i){const t=h(i),n=Object.prototype.hasOwnProperty.call(i,"value")?i.value:i.defaultValue;return{inputId:t.inputId,kind:t.kind,label:t.label,...t.field?{field:t.field}:{},...t.operator?{operator:t.operator}:{},...t.controlRole?{controlRole:t.controlRole}:{},...t.relationshipHint?{relationshipHint:t.relationshipHint}:{},value:n,isActive:m(n)}}return{...i,kind:"filter",isActive:m(i.value),value:i.value}}function s(i){return i.source}function V(i){var t;return!!((t=i.fields)!=null&&t.length)}function o(i,t){return{...i,role:i.role||t}}function l(i){return(i||[]).map(f)}function G(i){if(i)return i}function S(i,t){if(i===void 0)return;const n=v.normalizeSemaphorInputOperator(i);if(!n)throw new Error(`useSemaphorInput "${t}" uses unsupported filter operator "${i}".`);return n}exports.hasSemaphorInputValue=m;exports.normalizeSemaphorInputOptions=E;exports.toSemaphorActiveInputSnapshots=$;exports.toSemaphorAnalysisIntent=c;exports.toSemaphorAnalysisQueryOptions=F;exports.toSemaphorInputBinding=f;exports.toSemaphorInputBindings=W;exports.toSemaphorInputOptionsIntent=x;exports.toSemaphorInputSnapshots=y;exports.toSemaphorInputSpec=h;exports.toSemaphorMatrixIntent=P;exports.toSemaphorMetricIntent=p;exports.toSemaphorRecordsIntent=k;exports.toSemaphorSqlIntent=O;
@@ -1,7 +1,8 @@
1
- import { s as m, p as I, c } from "../chunks/validators-Cs74WVie.js";
2
- import { n as F } from "../chunks/operators-C8TxpM4C.js";
3
- import "../chunks/analyze-result-contract-T-0Ntzys.js";
4
- function p(i) {
1
+ import { s as m, p as I, c } from "../chunks/validators-DEmd8Sin.js";
2
+ import { n as p } from "../chunks/operators-C8TxpM4C.js";
3
+ import "../chunks/analyze-result-contract-BbRJ-C06.js";
4
+ import "../value-format-preferences/index.js";
5
+ function F(i) {
5
6
  var n, r, a;
6
7
  const t = M(i);
7
8
  return {
@@ -27,14 +28,14 @@ function p(i) {
27
28
  ...(a = i.derivedFields) != null && a.length ? { derivedFields: i.derivedFields } : {}
28
29
  };
29
30
  }
30
- function L(i) {
31
+ function G(i) {
31
32
  return {
32
- ...p(i),
33
+ ...F(i),
33
34
  ...i.timeWindow ? { timeWindow: i.timeWindow } : {},
34
35
  ...i.analysis ? { analysis: i.analysis } : {}
35
36
  };
36
37
  }
37
- function G(i) {
38
+ function V(i) {
38
39
  return {
39
40
  ...i.chartTitle ? { chartTitle: i.chartTitle } : {},
40
41
  ...i.chartType ? { chartType: i.chartType } : {},
@@ -98,7 +99,7 @@ function h(i, t) {
98
99
  aggregate: i.aggregate || t.aggregate
99
100
  };
100
101
  }
101
- function V(i) {
102
+ function j(i) {
102
103
  var n, r;
103
104
  if ("sort" in i)
104
105
  throw new Error(
@@ -147,7 +148,7 @@ function k(i) {
147
148
  return n;
148
149
  });
149
150
  }
150
- function j(i) {
151
+ function q(i) {
151
152
  var t, n, r;
152
153
  return {
153
154
  version: 1,
@@ -172,7 +173,7 @@ function j(i) {
172
173
  ...(r = i.derivedFields) != null && r.length ? { derivedFields: i.derivedFields } : {}
173
174
  };
174
175
  }
175
- function q(i) {
176
+ function Q(i) {
176
177
  var t;
177
178
  return {
178
179
  version: 1,
@@ -190,7 +191,7 @@ function q(i) {
190
191
  rationale: i.rationale
191
192
  };
192
193
  }
193
- function Q(i) {
194
+ function D(i) {
194
195
  var t, n;
195
196
  return {
196
197
  version: 1,
@@ -199,11 +200,9 @@ function Q(i) {
199
200
  label: i.label,
200
201
  source: u(i),
201
202
  rows: i.rows.map((r) => s(r, "dimension")),
202
- ...i.columns ? {
203
- columns: i.columns.map(
204
- (r) => s(r, "dimension")
205
- )
206
- } : {},
203
+ columns: (i.columns ?? []).map(
204
+ (r) => s(r, "dimension")
205
+ ),
207
206
  values: i.values.map(A),
208
207
  ...(t = i.filters) != null && t.length ? { filters: i.filters } : {},
209
208
  inputs: l(i.inputs),
@@ -274,14 +273,14 @@ function g(i) {
274
273
  function C(i) {
275
274
  return i === "grain" || i === "measure" || i === "dimension" || i === "aggregation" || i === "sqlParam";
276
275
  }
277
- function D(i) {
276
+ function J(i) {
278
277
  const t = l(i);
279
278
  return t.length > 0 ? t : void 0;
280
279
  }
281
280
  function O(i) {
282
281
  return (i || []).map(P);
283
282
  }
284
- function J(i) {
283
+ function K(i) {
285
284
  return O(i).filter((t) => t.isActive);
286
285
  }
287
286
  function y(i) {
@@ -303,7 +302,7 @@ function y(i) {
303
302
  controlRole: i.role
304
303
  };
305
304
  }
306
- function K(i = []) {
305
+ function N(i = []) {
307
306
  return i.map(
308
307
  (t) => typeof t == "object" ? t : {
309
308
  label: String(t),
@@ -365,7 +364,7 @@ function T(i) {
365
364
  function v(i, t) {
366
365
  if (i === void 0)
367
366
  return;
368
- const n = F(i);
367
+ const n = p(i);
369
368
  if (!n)
370
369
  throw new Error(
371
370
  `useSemaphorInput "${t}" uses unsupported filter operator "${i}".`
@@ -374,17 +373,17 @@ function v(i, t) {
374
373
  }
375
374
  export {
376
375
  f as hasSemaphorInputValue,
377
- K as normalizeSemaphorInputOptions,
378
- J as toSemaphorActiveInputSnapshots,
379
- L as toSemaphorAnalysisIntent,
380
- G as toSemaphorAnalysisQueryOptions,
376
+ N as normalizeSemaphorInputOptions,
377
+ K as toSemaphorActiveInputSnapshots,
378
+ G as toSemaphorAnalysisIntent,
379
+ V as toSemaphorAnalysisQueryOptions,
381
380
  g as toSemaphorInputBinding,
382
- D as toSemaphorInputBindings,
383
- j as toSemaphorInputOptionsIntent,
381
+ J as toSemaphorInputBindings,
382
+ q as toSemaphorInputOptionsIntent,
384
383
  O as toSemaphorInputSnapshots,
385
384
  y as toSemaphorInputSpec,
386
- Q as toSemaphorMatrixIntent,
387
- p as toSemaphorMetricIntent,
388
- V as toSemaphorRecordsIntent,
389
- q as toSemaphorSqlIntent
385
+ D as toSemaphorMatrixIntent,
386
+ F as toSemaphorMetricIntent,
387
+ j as toSemaphorRecordsIntent,
388
+ Q as toSemaphorSqlIntent
390
389
  };