react-semaphor 0.1.567 → 0.1.569

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 (128) hide show
  1. package/README.md +0 -7
  2. package/dist/analytics-protocol/index.js +434 -454
  3. package/dist/assistant-context/index.js +1 -1
  4. package/dist/brand-studio/index.js +10 -12
  5. package/dist/briefings/index.js +4 -4
  6. package/dist/chunks/{_commonjsHelpers-DimLPMtv.js → _commonjsHelpers-Bid1ZNYj.js} +271 -222
  7. package/dist/chunks/{assistant-chat-D-IuHHwh.js → assistant-chat-Dzf2Mbph.js} +107 -109
  8. package/dist/chunks/{bookmark-impact-B0estCHn.js → bookmark-impact-Czg6FGt5.js} +2 -2
  9. package/dist/chunks/{bookmark-state-Du3s13_V.js → bookmark-state-CflS88gq.js} +251 -250
  10. package/dist/chunks/{card-filter-builder-DbSmzvem.js → card-filter-builder-BS982X7x.js} +1001 -1000
  11. package/dist/chunks/{code-editor-DJNOsgJH.js → code-editor-BsxHzm9u.js} +43 -45
  12. package/dist/chunks/{comparison-window-caption-CMLb3mut.js → comparison-window-caption-lLTgzOkM.js} +252 -253
  13. package/dist/chunks/{dashboard-f8J9DHh5.js → dashboard-BiYSbxZv.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-DunvZYsU.js → dashboard-briefing-launcher-Bdj7luOr.js} +119 -120
  15. package/dist/chunks/{dashboard-controls-B09cN2Dz.js → dashboard-controls-TViDsnb8.js} +17 -19
  16. package/dist/chunks/dashboard-json-Dg9dQd9U.js +66 -0
  17. package/dist/chunks/{dates-BsJcyoC_.js → dates-BsPrWZIP.js} +8 -8
  18. package/dist/chunks/{edit-dashboard-visual-Cwzbpty8.js → edit-dashboard-visual-C6hoIeEJ.js} +20 -21
  19. package/dist/chunks/{filter-reach-copy-P-kDwUpY.js → filter-reach-copy-hcQ4os0u.js} +862 -852
  20. package/dist/chunks/filter-value-text-CVxEEDVl.js +146 -0
  21. package/dist/chunks/{index-BcXw0CpM.js → index-G4q89J6O.js} +74 -76
  22. package/dist/chunks/{layout-grid-0hIlqEtk.js → layout-grid-BIcoFfdS.js} +1 -1
  23. package/dist/chunks/{list-filter-DkgoCeBm.js → list-filter-C6tYkHyv.js} +1 -1
  24. package/dist/chunks/matrix-analytical-definition-dkS8szLM.js +1253 -0
  25. package/dist/chunks/matrix-member-presentation-DRa-9e6Q.js +169 -0
  26. package/dist/chunks/{matrix-operation-contract-Eb6elidS.js → matrix-operation-contract-DCVinw1o.js} +122 -122
  27. package/dist/chunks/{metric-comparison-ChXUFaZu.js → metric-comparison-n9NsIa-2.js} +175 -128
  28. package/dist/chunks/{palette-4vf2BEEg.js → palette-NjHOE_6B.js} +1 -1
  29. package/dist/chunks/pivot-result-contract-expectations-DkmueDTW.js +55 -0
  30. package/dist/chunks/{pivot-result-identity-BlbLrqaC.js → pivot-result-identity-B89X5xjb.js} +1 -1
  31. package/dist/chunks/raw-temporal-value-DdT0s47W.js +159 -0
  32. package/dist/chunks/{report-preferences-dialog-CbgmdWeZ.js → report-preferences-dialog-Xc8_GFju.js} +26 -28
  33. package/dist/chunks/{report-runtime-context-DnA_PiKo.js → report-runtime-context-BhPzLTbS.js} +1 -1
  34. package/dist/chunks/{resolve-dashboard-input-context-DPKSF3qj.js → resolve-dashboard-input-context-KqvcLcTM.js} +5956 -5880
  35. package/dist/chunks/{save-D6pHmSSP.js → save-C6VmEJTA.js} +1 -1
  36. package/dist/chunks/{saved-dashboard-context-CNudmm9U.js → saved-dashboard-context-BeXXyoD4.js} +6 -6
  37. package/dist/chunks/{semaphor-ready-indicator-CQd-PCCZ.js → semaphor-ready-indicator-BNkaANsG.js} +31011 -30850
  38. package/dist/chunks/{shelf-drop-preview-context-CWS3e20y.js → shelf-drop-preview-context-C_issPBA.js} +18 -20
  39. package/dist/chunks/{stored-dashboard-CrQFT27O.js → stored-dashboard-B6_StAty.js} +232 -234
  40. package/dist/chunks/{table-export-sheet--DUKWk6o.js → table-export-sheet-BWP2joD1.js} +1 -1
  41. package/dist/chunks/{temporal-input-presentation--2r9BLr0.js → temporal-input-presentation-scSWQXAB.js} +4 -4
  42. package/dist/chunks/{token-types-C8JymO8s.js → token-types-iKMplaBL.js} +1 -1
  43. package/dist/chunks/{upload-Cf3wXZT8.js → upload-BRW4Mwrd.js} +1 -1
  44. package/dist/chunks/validators-B8fpdinG.js +3651 -0
  45. package/dist/chunks/{variable-draft-BDxlD0dM.js → variable-draft-BQ3OMjvy.js} +4 -4
  46. package/dist/dashboard/index.js +2 -2
  47. package/dist/dashboard-authoring/index.js +1778 -1741
  48. package/dist/format-utils/index.js +230 -231
  49. package/dist/index.js +236 -237
  50. package/dist/report-runtime-context/index.js +1 -1
  51. package/dist/style.css +1 -1
  52. package/dist/surfboard/index.js +2 -2
  53. package/dist/types/components/surfboard/filter/types.d.ts +5 -4
  54. package/dist/types/components/ui-custom/date-range-presets.d.ts +1 -17
  55. package/dist/types/index.js +9 -9
  56. package/dist/types/lib/document/document-edits.d.ts +8 -3
  57. package/dist/types/lib/document/document-text-style.d.ts +54 -0
  58. package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
  59. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  60. package/dist/types/lib/types/explorer-types.d.ts +2 -2
  61. package/dist/types/lib/types/index.d.ts +1 -1
  62. package/dist/types/lib/utils/card-definition.d.ts +7 -7
  63. package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +84 -0
  64. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +2 -2
  65. package/dist/types/shared/analytics-protocol/contracts.d.ts +8 -17
  66. package/dist/types/shared/analytics-protocol/fixtures.d.ts +3 -2
  67. package/dist/types/shared/analytics-protocol/index.d.ts +2 -4
  68. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +4 -4
  69. package/dist/types/shared/analytics-protocol/relative-date/describe.d.ts +18 -0
  70. package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +7 -0
  71. package/dist/types/shared/analytics-protocol/relative-date/limits.d.ts +3 -0
  72. package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +11 -0
  73. package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +49 -0
  74. package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +76 -0
  75. package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +51 -0
  76. package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +111 -0
  77. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +1 -1
  78. package/dist/types/shared/assistant-protocol/context.d.ts +12 -12
  79. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +0 -2
  80. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +176 -1756
  81. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -4
  82. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +74 -74
  83. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +20 -20
  84. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +8 -2
  85. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +10 -2
  86. package/dist/types/shared/format-utils/filter-detail.d.ts +2 -8
  87. package/dist/types/shared/format-utils/filter-line.d.ts +2 -2
  88. package/dist/types/shared/format-utils/matrix-continuation.d.ts +3 -3
  89. package/dist/types/shared/temporal/index.d.ts +0 -2
  90. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +2 -2
  91. package/package.json +2 -24
  92. package/DATA_APP_SDK.md +0 -339
  93. package/dist/chunks/dashboard-json-BNNCaKEc.js +0 -68
  94. package/dist/chunks/filter-value-text-7zhmth1S.js +0 -163
  95. package/dist/chunks/index-CuHybtft.js +0 -51
  96. package/dist/chunks/matrix-analytical-definition-C9xB_T84.js +0 -717
  97. package/dist/chunks/matrix-card-BSUeSXpD.js +0 -42
  98. package/dist/chunks/matrix-member-presentation-DZNgQpUq.js +0 -105
  99. package/dist/chunks/operators-B3zZoskU.js +0 -66
  100. package/dist/chunks/pivot-result-contract-expectations-Ddh1rNz5.js +0 -56
  101. package/dist/chunks/raw-temporal-value-Bqz8wc7L.js +0 -242
  102. package/dist/chunks/selection-reducer-OaJ-N5uN.js +0 -46
  103. package/dist/chunks/source-entity-resolution-DF6GulDn.js +0 -607
  104. package/dist/chunks/validators-wtjw0aw6.js +0 -3332
  105. package/dist/data-app-sdk/index.js +0 -1412
  106. package/dist/data-app-sdk-adapters/index.js +0 -361
  107. package/dist/data-app-sdk-validation/index.js +0 -1031
  108. package/dist/types/data-app-sdk/adapters.d.ts +0 -35
  109. package/dist/types/data-app-sdk/builders.d.ts +0 -62
  110. package/dist/types/data-app-sdk/contracts.d.ts +0 -419
  111. package/dist/types/data-app-sdk/executor.d.ts +0 -5
  112. package/dist/types/data-app-sdk/field-catalog-validation.d.ts +0 -29
  113. package/dist/types/data-app-sdk/hooks.d.ts +0 -11
  114. package/dist/types/data-app-sdk/index.d.ts +0 -9
  115. package/dist/types/data-app-sdk/provider.d.ts +0 -8
  116. package/dist/types/data-app-sdk/relationship-aware-field-policy.d.ts +0 -21
  117. package/dist/types/data-app-sdk/selection.d.ts +0 -2
  118. package/dist/types/data-app-sdk/validation.d.ts +0 -58
  119. package/dist/types/data-app-sdk-adapters.d.ts +0 -2
  120. package/dist/types/data-app-sdk-validation.d.ts +0 -2
  121. package/dist/types/data-app-sdk.d.ts +0 -2
  122. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +0 -68
  123. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +0 -20
  124. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +0 -314
  125. package/dist/types/shared/analytics-protocol/time-window.d.ts +0 -52
  126. package/dist/types/shared/temporal/relative-date.d.ts +0 -21
  127. package/dist/types/shared/temporal/time-window-periods.d.ts +0 -21
  128. package/src/data-app-sdk/README.md +0 -402
@@ -1,12 +1,12 @@
1
- import { H as Q, k as Ve, u as Pe } from "./validators-wtjw0aw6.js";
1
+ import { a5 as Q, f as Ve, r as Pe } from "./validators-B8fpdinG.js";
2
2
  import { z as l } from "zod";
3
- import { Q as B, G as Le, v as $e } from "./matrix-operation-contract-Eb6elidS.js";
4
- import { D as qe, C as Be, r as j, d as je } from "./metric-comparison-ChXUFaZu.js";
3
+ import { P as B, E as Le, q as $e } from "./matrix-operation-contract-DCVinw1o.js";
4
+ import { D as qe, C as Be, r as j, a as je, e as Ue } from "./metric-comparison-n9NsIa-2.js";
5
5
  import "./analytics-base-schemas-BaIQrEzX.js";
6
6
  import { a as O } from "./applied-constraints-DU-wndZ7.js";
7
- import { r as Ue } from "./pivot-result-identity-BlbLrqaC.js";
7
+ import { r as ze } from "./pivot-result-identity-B89X5xjb.js";
8
8
  const ne = 8, re = 6, V = Object.freeze([]);
9
- function ze(e) {
9
+ function We(e) {
10
10
  switch (e.type) {
11
11
  case "table":
12
12
  case "chart":
@@ -17,7 +17,7 @@ function ze(e) {
17
17
  return V;
18
18
  }
19
19
  }
20
- function We(e, t) {
20
+ function Ge(e, t) {
21
21
  switch (e.type) {
22
22
  case "table":
23
23
  case "chart": {
@@ -51,7 +51,7 @@ function _(e) {
51
51
  card: i
52
52
  });
53
53
  for (const s of ((n = r.document) == null ? void 0 : n.sections) || [])
54
- for (const i of ze(s))
54
+ for (const i of We(s))
55
55
  t.push({
56
56
  kind: "documentSectionCard",
57
57
  sheetId: a,
@@ -62,16 +62,16 @@ function _(e) {
62
62
  }
63
63
  return t;
64
64
  }
65
- function Xt(e, t, n) {
65
+ function Zt(e, t, n) {
66
66
  let r = !1;
67
- const a = Ge(e, (i) => i.id !== n.id ? i : (r = !0, i === n ? i : n));
67
+ const a = Qe(e, (i) => i.id !== n.id ? i : (r = !0, i === n ? i : n));
68
68
  if (r || !t) return a;
69
69
  const s = (a.sheets || []).map(
70
70
  (i) => i.id === t && i.kind !== "document" ? { ...i, cards: [...i.cards ?? [], n] } : i
71
71
  );
72
72
  return { ...a, sheets: s };
73
73
  }
74
- function Ge(e, t) {
74
+ function Qe(e, t) {
75
75
  const n = (a, s) => {
76
76
  const i = a.map((o) => t(o, s(o)));
77
77
  return i.every((o, c) => o === a[c]) ? a : i;
@@ -82,7 +82,7 @@ function Ge(e, t) {
82
82
  const I = n(p.cards, (g) => ({ kind: "frameCard", sheetId: s, frameId: p.id, cardId: g.id, card: g }));
83
83
  return I === p.cards ? p : { ...p, cards: I };
84
84
  }), c = (h = (y = a.document) == null ? void 0 : y.sections) == null ? void 0 : h.map(
85
- (p) => We(p, (I) => t(I, { kind: "documentSectionCard", sheetId: s, sectionId: p.id, cardId: I.id, card: I }))
85
+ (p) => Ge(p, (I) => t(I, { kind: "documentSectionCard", sheetId: s, sectionId: p.id, cardId: I.id, card: I }))
86
86
  ), u = !!o && o.some((p, I) => p !== a.frames[I]), d = !!c && c.some((p, I) => p !== a.document.sections[I]);
87
87
  return i === a.cards && !u && !d ? a : {
88
88
  ...a,
@@ -96,7 +96,7 @@ function Ge(e, t) {
96
96
  function P(e) {
97
97
  return !!e && typeof e == "object" && !Array.isArray(e);
98
98
  }
99
- function Zt(e) {
99
+ function en(e) {
100
100
  if (!P(e))
101
101
  return [{ path: "", message: "must be an object." }];
102
102
  const t = [];
@@ -137,7 +137,7 @@ const Ie = "dashboardInput";
137
137
  function se(e) {
138
138
  return e === "label" || e === "value" || e === "start" || e === "end" || e === "range";
139
139
  }
140
- function Qe(e) {
140
+ function Ye(e) {
141
141
  return e === "generatedAt" || e === "pageNumber" || e === "pageCount";
142
142
  }
143
143
  function v(e) {
@@ -152,18 +152,18 @@ function v(e) {
152
152
  ...t.export ? { export: t.export } : {}
153
153
  };
154
154
  if (t.source === "documentMeta")
155
- return Qe(t.key) ? { source: "documentMeta", key: t.key } : void 0;
155
+ return Ye(t.key) ? { source: "documentMeta", key: t.key } : void 0;
156
156
  if (t.source === "data")
157
157
  return typeof t.variableId == "string" && typeof t.export == "string" ? { source: "data", variableId: t.variableId, export: t.export } : void 0;
158
158
  }
159
- function en(e, t) {
159
+ function tn(e, t) {
160
160
  const n = v(e), r = v(t);
161
161
  return !n || !r ? JSON.stringify(e) === JSON.stringify(t) : [.../* @__PURE__ */ new Set([...Object.keys(n), ...Object.keys(r)])].every((s) => n[s] === r[s]);
162
162
  }
163
- function Ye(e) {
163
+ function Je(e) {
164
164
  return x(e) ? e.type === "variable" ? e.ref === void 0 ? [] : [e.ref] : e.type === "when" && x(e.test) && e.test.ref !== void 0 ? [e.test.ref] : [] : [];
165
165
  }
166
- function Je(e, t) {
166
+ function He(e, t) {
167
167
  if (!x(e)) return e;
168
168
  if (e.type === "variable" && e.ref !== void 0) {
169
169
  const n = t(e.ref);
@@ -181,7 +181,7 @@ function x(e) {
181
181
  function ae(e) {
182
182
  return !!e && typeof e == "object" && e.source === Ie;
183
183
  }
184
- function tn(e) {
184
+ function nn(e) {
185
185
  return U(e);
186
186
  }
187
187
  function U(e) {
@@ -198,7 +198,7 @@ function U(e) {
198
198
  let n;
199
199
  const r = (s, i) => {
200
200
  i !== t[s] && (n ?? (n = { ...t }), n[s] = i);
201
- }, a = Je(
201
+ }, a = He(
202
202
  t,
203
203
  (s) => ae(s) ? v(s) ?? s : s
204
204
  );
@@ -214,14 +214,14 @@ function U(e) {
214
214
  s === "ref" && t.type === "variable" || s === "test" && t.type === "when" || s === "inputAliases" || r(s, U(i));
215
215
  return n ?? e;
216
216
  }
217
- function nn(e) {
217
+ function rn(e) {
218
218
  return b(e);
219
219
  }
220
220
  function b(e) {
221
221
  const t = [];
222
222
  for (const n of Array.isArray(e) ? e : [])
223
223
  if (!(!n || typeof n != "object")) {
224
- for (const r of Ye(n)) {
224
+ for (const r of Je(n)) {
225
225
  const a = v(r);
226
226
  a && t.push(a);
227
227
  }
@@ -229,7 +229,7 @@ function b(e) {
229
229
  }
230
230
  return t;
231
231
  }
232
- function He(e) {
232
+ function Xe(e) {
233
233
  var r;
234
234
  const t = (r = e.preferences) == null ? void 0 : r.textVisualOptions, n = t == null ? void 0 : t.richContent;
235
235
  return n && Array.isArray(n.blocks) ? n.blocks.flatMap(
@@ -263,7 +263,7 @@ function Se(e) {
263
263
  const a = { kind: "sheet", sheetId: r.id }, s = [...r.cards ?? [], ...(r.frames ?? []).flatMap((i) => i.cards ?? [])];
264
264
  for (const i of s)
265
265
  if (i.type === "text")
266
- for (const o of He(i))
266
+ for (const o of Xe(i))
267
267
  n.push({ ref: o, place: a, where: { kind: "card", cardId: i.id } });
268
268
  }
269
269
  return ie.set(e, n), n;
@@ -275,19 +275,19 @@ function ge(e, t) {
275
275
  const n = Se(e);
276
276
  return t ? n.filter((r) => Ce(r.place, t)) : [...n];
277
277
  }
278
- function Xe(e, t) {
278
+ function Ze(e, t) {
279
279
  const n = [];
280
280
  for (const { ref: r, place: a } of Se(e))
281
281
  r.source !== "data" || r.variableId !== t || n.some((s) => Ce(s, a)) || n.push(a);
282
282
  return n;
283
283
  }
284
- function rn(e, t) {
284
+ function sn(e, t) {
285
285
  const n = /* @__PURE__ */ new Set();
286
286
  for (const { ref: r } of ge(e, t))
287
287
  r.source === "data" && n.add(r.variableId);
288
288
  return [...n];
289
289
  }
290
- function sn(e, t) {
290
+ function an(e, t) {
291
291
  const n = be("", e).filter(
292
292
  ({ ref: r }) => r.source === "input" && r.inputId === t
293
293
  );
@@ -300,7 +300,7 @@ function sn(e, t) {
300
300
  };
301
301
  }
302
302
  function ke(e, t) {
303
- const n = Xe(e, t);
303
+ const n = Ze(e, t);
304
304
  return n.length ? n.map((r) => ({
305
305
  sheetId: r.sheetId,
306
306
  cardId: t,
@@ -309,12 +309,12 @@ function ke(e, t) {
309
309
  }
310
310
  function C(e, t) {
311
311
  var r;
312
- if (!nt(e, t))
312
+ if (!rt(e, t))
313
313
  return !1;
314
314
  const n = e.scope;
315
315
  switch (n.kind) {
316
316
  case "allSheets":
317
- return ((r = n.sheetKinds) != null && r.length ? t.sheetKind ? n.sheetKinds.includes(t.sheetKind) : !1 : !!t.sheetId || !!t.cardId) && !tt(n.exceptSheetIds, t) && !ue(n.exceptCardIds, t);
317
+ return ((r = n.sheetKinds) != null && r.length ? t.sheetKind ? n.sheetKinds.includes(t.sheetKind) : !1 : !!t.sheetId || !!t.cardId) && !nt(n.exceptSheetIds, t) && !ue(n.exceptCardIds, t);
318
318
  case "sheets":
319
319
  return !!t.sheetId && n.sheetIds.includes(t.sheetId) && !ue(n.exceptCardIds, t);
320
320
  case "cards":
@@ -325,7 +325,7 @@ function C(e, t) {
325
325
  return !1;
326
326
  }
327
327
  }
328
- function an(e, t) {
328
+ function on(e, t) {
329
329
  if (C(e, {
330
330
  sheetId: t.sheetId,
331
331
  sheetKind: t.sheetKind
@@ -348,7 +348,7 @@ function an(e, t) {
348
348
  }
349
349
  }
350
350
  const oe = /* @__PURE__ */ new WeakMap();
351
- function Ze(e) {
351
+ function et(e) {
352
352
  const t = oe.get(e);
353
353
  if (t) return t;
354
354
  const n = /* @__PURE__ */ new Map();
@@ -372,9 +372,9 @@ function Ze(e) {
372
372
  });
373
373
  return oe.set(e, a), a;
374
374
  }
375
- function on(e, t) {
375
+ function cn(e, t) {
376
376
  var a, s;
377
- const n = /* @__PURE__ */ new Set(), r = Ze(e);
377
+ const n = /* @__PURE__ */ new Set(), r = et(e);
378
378
  for (const i of r.values())
379
379
  C(t, {
380
380
  sheetId: i.sheetId,
@@ -401,10 +401,10 @@ function on(e, t) {
401
401
  }) && n.add(`section:${o.id}`);
402
402
  return n;
403
403
  }
404
- function cn(e) {
404
+ function un(e) {
405
405
  return e.kind === "filter" && e.scope.kind === "cards";
406
406
  }
407
- function un(e, t) {
407
+ function dn(e, t) {
408
408
  var s, i, o;
409
409
  const n = (c) => {
410
410
  var u, d;
@@ -459,25 +459,25 @@ function un(e, t) {
459
459
  default:
460
460
  return e;
461
461
  }
462
- return et(e, a) ? e : a;
462
+ return tt(e, a) ? e : a;
463
463
  }
464
464
  function ce(e, t, n, r, a, s) {
465
465
  let i = e;
466
466
  return t != null && t.size && (i = i.filter((o) => !t.has(o))), r && (i = i.filter((o) => n == null ? void 0 : n.has(o))), n != null && n.size && (i = i.map((o) => n.get(o) ?? o)), a != null && a.size && (i = s === "extend" ? [.../* @__PURE__ */ new Set([...i, ...i.flatMap((o) => a.has(o) ? [a.get(o)] : [])])] : i.map((o) => a.get(o) ?? o)), i;
467
467
  }
468
- function et(e, t) {
468
+ function tt(e, t) {
469
469
  return JSON.stringify(e) === JSON.stringify(t);
470
470
  }
471
- function tt(e, t) {
471
+ function nt(e, t) {
472
472
  return !!t.sheetId && !!(e != null && e.includes(t.sheetId));
473
473
  }
474
474
  function ue(e, t) {
475
475
  return !!t.cardId && !!(e != null && e.includes(t.cardId));
476
476
  }
477
- function nt(e, t) {
477
+ function rt(e, t) {
478
478
  return t.sheetKind !== "document" || !e.compatibility || e.compatibility.source === "documentInput" ? !0 : e.compatibility.source === "cardInlineFilter" || e.compatibility.source === "cardControl" ? !!t.cardId && e.compatibility.cardId === t.cardId : !1;
479
479
  }
480
- function dn(e, t, n) {
480
+ function ln(e, t, n) {
481
481
  switch (e.kind) {
482
482
  case "sheets":
483
483
  return e.sheetIds.length > 0 && e.sheetIds.every((r) => r === t);
@@ -489,25 +489,25 @@ function dn(e, t, n) {
489
489
  return !1;
490
490
  }
491
491
  }
492
- function ln(e) {
492
+ function fn(e) {
493
493
  return e.kind === "sheets" && e.sheetIds.length === 0 || e.kind === "cards" && e.cardIds.length === 0;
494
494
  }
495
- function rt(e) {
495
+ function st(e) {
496
496
  return e.kind === "allSheets" || e.kind === "sheets" ? e.exceptCardIds ?? [] : [];
497
497
  }
498
- function fn(e) {
498
+ function mn(e) {
499
499
  return e.kind === "allSheets" ? e.exceptSheetIds ?? [] : [];
500
500
  }
501
- function mn(e, t) {
501
+ function pn(e, t) {
502
502
  var s;
503
503
  if (e.kind !== "allSheets" && e.kind !== "sheets" || !((s = e.exceptCardIds) != null && s.includes(t))) return e;
504
504
  const n = e.exceptCardIds.filter((i) => i !== t), { exceptCardIds: r, ...a } = e;
505
505
  return n.length ? { ...a, exceptCardIds: n } : a;
506
506
  }
507
- function pn(e, t, n) {
507
+ function hn(e, t, n) {
508
508
  var o;
509
509
  if (t.kind !== "allSheets" && t.kind !== "sheets") return t;
510
- const r = rt(e), a = e.kind === "sheets" ? e.sheetIds.filter((c) => n.has(c)) : e.kind === "allSheets" && de(e) ? [...n].filter((c) => {
510
+ const r = st(e), a = e.kind === "sheets" ? e.sheetIds.filter((c) => n.has(c)) : e.kind === "allSheets" && de(e) ? [...n].filter((c) => {
511
511
  var u;
512
512
  return !((u = e.exceptSheetIds) != null && u.includes(c));
513
513
  }) : [], s = [...n].filter((c) => !a.includes(c));
@@ -534,7 +534,7 @@ function de(e) {
534
534
  var t;
535
535
  return e.kind === "allSheets" && (!((t = e.sheetKinds) != null && t.length) || e.sheetKinds.includes("document"));
536
536
  }
537
- function hn(e, t) {
537
+ function yn(e, t) {
538
538
  switch (e.kind) {
539
539
  case "allSheets":
540
540
  case "sheets": {
@@ -547,24 +547,24 @@ function hn(e, t) {
547
547
  return;
548
548
  }
549
549
  }
550
- const st = 6;
551
- function yn(e) {
550
+ const at = 6;
551
+ function In(e) {
552
552
  if (!(e === void 0 || !Number.isFinite(e)) && Number.isInteger(e))
553
- return Math.max(0, Math.min(st, e));
553
+ return Math.max(0, Math.min(at, e));
554
554
  }
555
555
  function we(e) {
556
556
  var t;
557
557
  return ((t = e == null ? void 0 : e.comparison) == null ? void 0 : t.mode) === "explicit" ? e.comparison.spec : void 0;
558
558
  }
559
- function at(e) {
559
+ function it(e) {
560
560
  var t;
561
561
  return ((t = we(e)) == null ? void 0 : t.kind) || "none";
562
562
  }
563
- function In(e) {
563
+ function bn(e) {
564
564
  const t = we(e);
565
565
  return (t == null ? void 0 : t.kind) === "target" ? t.targetValue : void 0;
566
566
  }
567
- function bn(e) {
567
+ function Sn(e) {
568
568
  return (e == null ? void 0 : e.semanticComparisonPolarity) || (e == null ? void 0 : e.comparisonPolarity) || qe;
569
569
  }
570
570
  function Y(e, t) {
@@ -580,17 +580,17 @@ function Y(e, t) {
580
580
  );
581
581
  return a.length === 1 ? a[0][1] : void 0;
582
582
  }
583
- function Sn(e, t) {
583
+ function Cn(e, t) {
584
584
  const n = Y(e, t);
585
585
  return {
586
- comparisonKind: (n == null ? void 0 : n.type) ?? at(t),
586
+ comparisonKind: (n == null ? void 0 : n.type) ?? it(t),
587
587
  metadata: n
588
588
  };
589
589
  }
590
- function Cn(e) {
590
+ function gn(e) {
591
591
  return (e == null ? void 0 : e.showComparison) ?? Be.showComparison;
592
592
  }
593
- function gn(e) {
593
+ function kn(e) {
594
594
  const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
595
595
  return Object.entries(e || {}).forEach(([c, u]) => {
596
596
  const d = u.output;
@@ -611,14 +611,14 @@ function gn(e) {
611
611
  comparisonSeriesLabels: o
612
612
  };
613
613
  }
614
- const it = "SEMAPHOR_CALCULATED_FIELD";
614
+ const ot = "SEMAPHOR_CALCULATED_FIELD";
615
615
  function J(e, t, n) {
616
616
  if (n && (t === "groupby" || t === "pivotby"))
617
617
  return n;
618
618
  if (t === "metric" && e.name === "*" && !e.expression)
619
619
  return e.alias || "count";
620
620
  if (e.alias) return e.alias;
621
- const r = e.entityName && e.entityName !== it ? e.entityName : void 0;
621
+ const r = e.entityName && e.entityName !== ot ? e.entityName : void 0;
622
622
  if (e.role === "metric") {
623
623
  let a = e.aggregate || "metric";
624
624
  if (e.expression) {
@@ -632,14 +632,14 @@ function J(e, t, n) {
632
632
  }
633
633
  return r && r !== e.name ? `${r}_${e.name}` : e.name;
634
634
  }
635
- function kn(e) {
635
+ function wn(e) {
636
636
  return J(e, "detail");
637
637
  }
638
- function ot(e) {
638
+ function ct(e) {
639
639
  const t = e.label;
640
640
  return t && e.labelCount === 1 && (t === e.rawKey || !e.rawKeys.has(t)) ? t : e.rawKey;
641
641
  }
642
- function wn(e) {
642
+ function An(e) {
643
643
  const t = [
644
644
  ...(e.groupByColumns ?? []).map((s) => ({ field: s, role: "groupby" })),
645
645
  ...(e.metricColumns ?? []).map((s) => ({ field: s, role: "metric" })),
@@ -651,7 +651,7 @@ function wn(e) {
651
651
  return new Map(
652
652
  t.map(({ field: s }) => [
653
653
  s,
654
- ot({
654
+ ct({
655
655
  label: s.label,
656
656
  labelCount: s.label ? a.get(s.label) ?? 0 : 0,
657
657
  rawKey: n.get(s),
@@ -660,16 +660,16 @@ function wn(e) {
660
660
  ])
661
661
  );
662
662
  }
663
- const Ae = "text", R = 100, ct = 10, S = "value", ve = ["previous", "change", "percentChange"];
664
- function ut(e) {
663
+ const Ae = "text", R = 100, ut = 10, S = "value", ve = ["previous", "change", "percentChange"];
664
+ function dt(e) {
665
665
  return ve.includes(e);
666
666
  }
667
- const dt = ["up", "down", "flat"];
668
- function An(e, t, n) {
667
+ const lt = ["up", "down", "flat"];
668
+ function vn(e, t, n) {
669
669
  const { signWords: r, absolute: a, percent: s, ...i } = t ?? {};
670
670
  return e !== "change" && e !== "percentChange" ? i : {
671
671
  ...i,
672
- ...(n == null ? void 0 : n.signWords) === void 0 ? { signWords: dt } : {},
672
+ ...(n == null ? void 0 : n.signWords) === void 0 ? { signWords: lt } : {},
673
673
  ...(n == null ? void 0 : n.absolute) === void 0 ? { absolute: !0 } : {},
674
674
  ...e === "percentChange" && (n == null ? void 0 : n.percent) === void 0 ? { percent: !0 } : {}
675
675
  };
@@ -698,7 +698,7 @@ const fe = {
698
698
  answer: /* @__PURE__ */ new WeakMap(),
699
699
  preview: /* @__PURE__ */ new WeakMap()
700
700
  };
701
- function lt(e, t = "answer") {
701
+ function ft(e, t = "answer") {
702
702
  var s;
703
703
  const n = fe[t].get(e);
704
704
  if (n) return n;
@@ -718,10 +718,10 @@ function lt(e, t = "answer") {
718
718
  };
719
719
  return fe[t].set(e, a), a;
720
720
  }
721
- function vn(e) {
721
+ function Tn(e) {
722
722
  return e.type === Ae && typeof e.dataVariableId == "string" && e.dataVariableId.length > 0;
723
723
  }
724
- function Tn(e, t, n) {
724
+ function En(e, t, n) {
725
725
  var r;
726
726
  if (n === S && ((r = e.query.sql) != null && r.trim())) {
727
727
  const a = Object.keys(t)[0];
@@ -733,12 +733,12 @@ function z(e) {
733
733
  const t = Q(e);
734
734
  return t === "string" || t === "unknown" ? "text" : t;
735
735
  }
736
- function ft(e) {
736
+ function mt(e) {
737
737
  return typeof e == "number" ? "number" : typeof e == "boolean" ? "boolean" : "text";
738
738
  }
739
- function mt(e, t, n, r) {
739
+ function pt(e, t, n, r) {
740
740
  var i, o;
741
- const a = Ue(r, e.id, t);
741
+ const a = ze(r, e.id, t);
742
742
  return [
743
743
  a == null ? void 0 : a.outputKey,
744
744
  a == null ? void 0 : a.rawKey,
@@ -748,19 +748,19 @@ function mt(e, t, n, r) {
748
748
  e.name
749
749
  ].find((c) => !!c && n.has(c));
750
750
  }
751
- function En(e, t) {
751
+ function Kn(e, t) {
752
752
  var r;
753
753
  if (e.get.kind === "aggregate")
754
754
  return H(e) ? [S, ...ve] : [S];
755
755
  if (e.get.kind === "list") return [S];
756
756
  if ((r = e.query.sql) != null && r.trim()) return [...t ?? []];
757
757
  const n = e.query.config;
758
- return pt([
758
+ return ht([
759
759
  ...((n == null ? void 0 : n.groupByColumns) ?? []).map((a) => a.name),
760
760
  ...((n == null ? void 0 : n.metricColumns) ?? []).map((a) => a.name)
761
761
  ]);
762
762
  }
763
- function Kn(e, t) {
763
+ function Nn(e, t) {
764
764
  var s, i, o, c;
765
765
  if (e.get.kind === "list") return "list";
766
766
  if ((s = e.query.sql) != null && s.trim()) return;
@@ -770,25 +770,25 @@ function Kn(e, t) {
770
770
  return Q(f) === "unknown" ? void 0 : z(f);
771
771
  };
772
772
  if (e.get.kind === "aggregate")
773
- return ut(t) && H(e) ? "number" : t === S ? r((i = n == null ? void 0 : n.metricColumns) == null ? void 0 : i[0], "metric") : void 0;
773
+ return dt(t) && H(e) ? "number" : t === S ? r((i = n == null ? void 0 : n.metricColumns) == null ? void 0 : i[0], "metric") : void 0;
774
774
  const a = (o = n == null ? void 0 : n.groupByColumns) == null ? void 0 : o.find((u) => u.name === t);
775
775
  return a ? r(a, "groupby") : r((c = n == null ? void 0 : n.metricColumns) == null ? void 0 : c.find((u) => u.name === t), "metric");
776
776
  }
777
- function pt(e) {
777
+ function ht(e) {
778
778
  return [...new Set(e)];
779
779
  }
780
- function ht(e, t, n) {
780
+ function yt(e, t, n) {
781
781
  var p, I, g;
782
782
  const r = t[0] ?? {}, a = new Set(
783
783
  (p = n.columns) != null && p.length ? n.columns.map((m) => m.key) : Object.keys(r)
784
784
  ), s = new Map(
785
785
  (n.columns ?? []).map((m) => [m.key, m.dataType])
786
- ), i = (m, k) => s.has(m) ? z(s.get(m)) : k !== void 0 ? z(k) : ft(r[m]);
786
+ ), i = (m, k) => s.has(m) ? z(s.get(m)) : k !== void 0 ? z(k) : mt(r[m]);
787
787
  if ((I = e.query.sql) != null && I.trim())
788
788
  return [...a].map((m) => ({ part: m, key: m, type: i(m, void 0) }));
789
789
  const o = e.query.config ?? {}, c = [], u = a.size === 1 ? [...a][0] : void 0, d = e.get.kind === "aggregate" || e.get.kind === "list", f = (m, k, te) => {
790
790
  if (c.some((Fe) => Fe.part === te)) return;
791
- const K = mt(m, k, a, n.columnKeyMap) ?? (d ? u : void 0);
791
+ const K = pt(m, k, a, n.columnKeyMap) ?? (d ? u : void 0);
792
792
  if (!K) return;
793
793
  const _e = k === "metric" ? i(K, B(m)) : i(K, m.dataType);
794
794
  c.push({ part: te, key: K, type: _e });
@@ -810,7 +810,7 @@ function W(e, t) {
810
810
  function w(e) {
811
811
  return !!e && typeof e == "object" && !Array.isArray(e);
812
812
  }
813
- function Nn(e) {
813
+ function On(e) {
814
814
  if (!w(e)) return {};
815
815
  const t = w(e.data) ? e.data : e, n = O(e).length ? O(e) : O(t), r = w(t.metadata) ? t.metadata : void 0;
816
816
  return {
@@ -822,17 +822,17 @@ function Nn(e) {
822
822
  ...typeof t.error == "string" && t.error ? { error: t.error } : {}
823
823
  };
824
824
  }
825
- function On(e, t, n = "answer") {
825
+ function Dn(e, t, n = "answer") {
826
826
  var d;
827
827
  const r = (Array.isArray(t.records) ? t.records : []).filter(
828
828
  (f) => !!f && typeof f == "object"
829
829
  ), a = O(t), s = n === "preview" ? { matched: r.length > R ? "beyondCap" : r.length } : {};
830
830
  if (!r.length) return { status: "none", why: "noRows", filterReach: a, ...s };
831
- const i = ht(e, r, t);
831
+ const i = yt(e, r, t);
832
832
  if (e.get.kind === "list") {
833
833
  const f = i[0], y = r.length > R, h = f ? r.map((I) => W(I[f.key], f.type)).filter((I) => I.value !== null) : [];
834
834
  if (!h.length && !y) return { status: "none", why: "noRows", filterReach: a, ...s };
835
- const p = Math.max(1, e.get.limit ?? ct);
835
+ const p = Math.max(1, e.get.limit ?? ut);
836
836
  return {
837
837
  status: "listed",
838
838
  items: h.slice(0, p),
@@ -848,7 +848,7 @@ function On(e, t, n = "answer") {
848
848
  );
849
849
  if (e.get.kind === "aggregate" && ((d = c[S]) == null ? void 0 : d.value) == null)
850
850
  return { status: "none", why: "noRows", filterReach: a, ...s };
851
- const u = H(e) ? yt(e, o, t) : void 0;
851
+ const u = H(e) ? It(e, o, t) : void 0;
852
852
  return {
853
853
  status: "answered",
854
854
  parts: u && "parts" in u ? { ...c, ...u.parts } : c,
@@ -857,7 +857,7 @@ function On(e, t, n = "answer") {
857
857
  ...s
858
858
  };
859
859
  }
860
- function yt(e, t, n) {
860
+ function It(e, t, n) {
861
861
  var o, c;
862
862
  const r = (c = (o = e.query.config) == null ? void 0 : o.metricColumns) == null ? void 0 : c[0], a = r ? Y(n.comparisonMetadata, r) : void 0, s = a == null ? void 0 : a.output;
863
863
  if (!s || s.availability.status !== "available" || !s.comparisonColumnKey)
@@ -898,22 +898,22 @@ function X(e) {
898
898
  kind: "variable",
899
899
  id: s.id,
900
900
  variable: s,
901
- card: lt(s)
901
+ card: ft(s)
902
902
  })
903
903
  )
904
904
  ], a = { targets: r, byId: new Map(r.map((s) => [s.id, s])) };
905
905
  return me.set(e, a), a;
906
906
  }
907
- function It(e) {
907
+ function bt(e) {
908
908
  return X(e).targets;
909
909
  }
910
- function Dn(e, t) {
910
+ function xn(e, t) {
911
911
  return X(e).byId.get(t);
912
912
  }
913
- function bt(e, t) {
913
+ function St(e, t) {
914
914
  return X(e).byId.has(t);
915
915
  }
916
- function St(e, t) {
916
+ function Ct(e, t) {
917
917
  return t.kind === "card" ? [
918
918
  {
919
919
  sheetId: t.sheetId,
@@ -923,17 +923,17 @@ function St(e, t) {
923
923
  }
924
924
  ] : ke(e, t.id);
925
925
  }
926
- function Ct(e, t, n) {
927
- return St(e, n).some(
926
+ function gt(e, t, n) {
927
+ return Ct(e, n).some(
928
928
  (r) => C(t, r)
929
929
  );
930
930
  }
931
- function xn(e, t) {
932
- return It(e).filter(
933
- (n) => n.kind === "variable" && Ct(e, t, n)
931
+ function Rn(e, t) {
932
+ return bt(e).filter(
933
+ (n) => n.kind === "variable" && gt(e, t, n)
934
934
  );
935
935
  }
936
- const gt = ["new", "edit", "delete", "create", "update", "remove"];
936
+ const kt = ["new", "edit", "delete", "create", "update", "remove"];
937
937
  function Te(e, t) {
938
938
  return (e.sheets || []).flatMap(
939
939
  (n) => _({ sheets: [n] }).filter(t).map((r) => ({
@@ -949,20 +949,20 @@ function Te(e, t) {
949
949
  function T(e) {
950
950
  return Te(e, (t) => t.kind !== "documentSectionCard");
951
951
  }
952
- function Rn(e) {
952
+ function Mn(e) {
953
953
  return [
954
954
  ...T(e),
955
955
  ...Te(e, (t) => t.kind === "documentSectionCard")
956
956
  ];
957
957
  }
958
- function Mn(e) {
958
+ function _n(e) {
959
959
  return T(e).map((t) => t.card);
960
960
  }
961
- function _n(e, t, n) {
962
- return n && t === n ? !0 : !bt(e, t);
961
+ function Fn(e, t, n) {
962
+ return n && t === n ? !0 : !St(e, t);
963
963
  }
964
- function Fn(e) {
965
- return !e || e.trim().length === 0 ? { isValid: !1, error: "Card ID cannot be empty" } : e.length < 3 ? { isValid: !1, error: "Card ID must be at least 3 characters" } : e.length > 50 ? { isValid: !1, error: "Card ID must be less than 50 characters" } : /^[a-zA-Z0-9-_]+$/.test(e) ? /^[a-zA-Z0-9]/.test(e) ? gt.includes(e.toLowerCase()) ? {
964
+ function Vn(e) {
965
+ return !e || e.trim().length === 0 ? { isValid: !1, error: "Card ID cannot be empty" } : e.length < 3 ? { isValid: !1, error: "Card ID must be at least 3 characters" } : e.length > 50 ? { isValid: !1, error: "Card ID must be less than 50 characters" } : /^[a-zA-Z0-9-_]+$/.test(e) ? /^[a-zA-Z0-9]/.test(e) ? kt.includes(e.toLowerCase()) ? {
966
966
  isValid: !1,
967
967
  error: `"${e}" is a reserved keyword and cannot be used`
968
968
  } : { isValid: !0 } : {
@@ -973,16 +973,16 @@ function Fn(e) {
973
973
  error: "Card ID can only contain letters, numbers, hyphens, and underscores"
974
974
  };
975
975
  }
976
- function Vn(e, t) {
976
+ function Pn(e, t) {
977
977
  var n;
978
- return (n = kt(e, t)) == null ? void 0 : n.card;
978
+ return (n = wt(e, t)) == null ? void 0 : n.card;
979
979
  }
980
- function kt(e, t) {
980
+ function wt(e, t) {
981
981
  for (const n of T(e))
982
982
  if (n.card.id === t)
983
983
  return n;
984
984
  }
985
- function Pn(e, t) {
985
+ function Ln(e, t) {
986
986
  for (const n of e.sheets || [])
987
987
  for (const r of n.frames || [])
988
988
  for (const a of r.cards || [])
@@ -1004,12 +1004,12 @@ function Ee(e) {
1004
1004
  label: e.label
1005
1005
  };
1006
1006
  }
1007
- function wt(e) {
1007
+ function At(e) {
1008
1008
  var n;
1009
1009
  const t = Ee(e.source);
1010
1010
  return t ? `${(n = e.source) == null ? void 0 : n.kind}:${t.qualifiedEntityName || t.entityName}` : "";
1011
1011
  }
1012
- function At(e) {
1012
+ function vt(e) {
1013
1013
  return [
1014
1014
  e.id,
1015
1015
  e.qualifiedEntityName,
@@ -1019,33 +1019,33 @@ function At(e) {
1019
1019
  e.name,
1020
1020
  // Source-only fields from different datasets can otherwise share a key
1021
1021
  // and the second dataset would be silently dropped.
1022
- wt(e)
1022
+ At(e)
1023
1023
  ].join("|");
1024
1024
  }
1025
- function vt(e) {
1025
+ function Tt(e) {
1026
1026
  return [e.entityName, e.qualifiedEntityName || "", e.entityId || ""].join("|");
1027
1027
  }
1028
- function Ln(e) {
1028
+ function $n(e) {
1029
1029
  return e.entityName || e.qualifiedEntityName || "";
1030
1030
  }
1031
- function Tt(e) {
1031
+ function Et(e) {
1032
1032
  var t, n;
1033
1033
  return !!(e.expression || e.derivedField || (n = (t = e.calculatedFormula) == null ? void 0 : t.inputFields) != null && n.length);
1034
1034
  }
1035
- function Et(e) {
1036
- return Ve(e) ? !0 : e.entityName || e.qualifiedEntityName ? !1 : !e.source || Tt(e);
1035
+ function Kt(e) {
1036
+ return Ve(e) ? !0 : e.entityName || e.qualifiedEntityName ? !1 : !e.source || Et(e);
1037
1037
  }
1038
1038
  function L(e, t) {
1039
- const n = vt(t);
1039
+ const n = Tt(t);
1040
1040
  e.found.has(n) || e.found.set(n, t);
1041
1041
  }
1042
1042
  function E(e, t) {
1043
1043
  var u, d, f;
1044
1044
  if (!e) return;
1045
- const n = At(e);
1045
+ const n = vt(e);
1046
1046
  if (t.visitedFields.has(n)) return;
1047
1047
  t.visitedFields.add(n);
1048
- const r = Et(e);
1048
+ const r = Kt(e);
1049
1049
  if (!r) {
1050
1050
  const y = !e.entityName && !e.qualifiedEntityName ? Ee(e.source) : void 0;
1051
1051
  L(
@@ -1117,7 +1117,7 @@ function ee(e, t) {
1117
1117
  const n = (r = e.qualifiedEntityName) != null && r.includes(".") ? e.qualifiedEntityName : void 0;
1118
1118
  return t === "qualifiedOnly" ? n : t === "preferQualified" ? n || e.entityName || void 0 : e.entityName || void 0;
1119
1119
  }
1120
- function $n(e) {
1120
+ function qn(e) {
1121
1121
  const t = F(!1);
1122
1122
  return E(e, t), { datasets: Array.from(t.found.values()), complete: t.complete };
1123
1123
  }
@@ -1128,38 +1128,38 @@ function Ke(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(),
1128
1128
  c && t.add(c);
1129
1129
  });
1130
1130
  }
1131
- function qn(e, t) {
1131
+ function Bn(e, t) {
1132
1132
  Ke(e, t, /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), {
1133
1133
  preferQualifiedIdentity: !0
1134
1134
  });
1135
1135
  }
1136
- function Bn(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
1136
+ function jn(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
1137
1137
  const a = F(!0, n, r);
1138
1138
  E(e, a), a.found.forEach((s) => {
1139
1139
  const i = ee(s, "qualifiedOnly");
1140
1140
  i && t.add(i);
1141
1141
  });
1142
1142
  }
1143
- function jn(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
1143
+ function Un(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
1144
1144
  Ke(e, t, n, r, {
1145
1145
  includeMetricFilterDatasets: !1
1146
1146
  });
1147
1147
  }
1148
- function Un(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = M) {
1148
+ function zn(e, t, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = M) {
1149
1149
  const s = { ...M, ...a }, i = F(s.includeMetricFilterDatasets, n, r);
1150
1150
  Z(e, i), i.found.forEach((o) => {
1151
1151
  const c = ee(o, s.preferQualifiedIdentity ? "preferQualified" : "name");
1152
1152
  c && t.add(c);
1153
1153
  });
1154
1154
  }
1155
- function zn(e, t) {
1155
+ function Wn(e, t) {
1156
1156
  return t != null && t[e] ? t[e] : (e.includes(".") ? e.slice(e.lastIndexOf(".") + 1) : e).replace(/[_-]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().replace(/\b\w/g, (r) => r.toUpperCase());
1157
1157
  }
1158
- const Wn = {
1158
+ const Gn = {
1159
1159
  database: null,
1160
1160
  schema: null,
1161
1161
  table: null
1162
- }, Gn = "__card_default__", Kt = {
1162
+ }, Qn = "__card_default__", Nt = {
1163
1163
  date: /* @__PURE__ */ new Set([
1164
1164
  "between",
1165
1165
  "not between",
@@ -1198,14 +1198,14 @@ const Wn = {
1198
1198
  ]),
1199
1199
  boolean: /* @__PURE__ */ new Set(["=", "!=", "in", "not in", "is null", "is not null"])
1200
1200
  };
1201
- function Nt(e) {
1201
+ function Ot(e) {
1202
1202
  const t = Q(e);
1203
1203
  return t === "number" || t === "boolean" ? t : t === "date" || t === "datetime" ? "date" : "string";
1204
1204
  }
1205
- function Qn(e, t) {
1206
- return typeof t != "string" ? !1 : Kt[Nt(e)].has(t);
1205
+ function Yn(e, t) {
1206
+ return typeof t != "string" ? !1 : Nt[Ot(e)].has(t);
1207
1207
  }
1208
- const Ot = /* @__PURE__ */ new Set([
1208
+ const Dt = /* @__PURE__ */ new Set([
1209
1209
  "=",
1210
1210
  ">",
1211
1211
  "<",
@@ -1221,19 +1221,20 @@ const Ot = /* @__PURE__ */ new Set([
1221
1221
  "is null",
1222
1222
  "is not null"
1223
1223
  ]);
1224
- function Dt(e, t) {
1224
+ function xt(e, t) {
1225
1225
  return t === "number" ? typeof e == "number" && Number.isFinite(e) : t === "boolean" ? typeof e == "boolean" : t === "date" ? e instanceof Date || typeof e == "string" && e.trim().length > 0 : typeof e == "string" || typeof e == "number" || typeof e == "boolean";
1226
1226
  }
1227
- function xt(e, t, n, r) {
1228
- if (Pe(e.relativeMeta)) {
1227
+ function Rt(e, t, n, r) {
1228
+ const a = Pe(e.relativeMeta);
1229
+ if (a && je(a).dataAnchored) {
1229
1230
  r.push(
1230
1231
  `${n}.relativeMeta counts back from the latest data; a dashboard filter's dates run to now. Use a period counted back from today.`
1231
1232
  );
1232
1233
  return;
1233
1234
  }
1234
- Rt(e.operation, e.values, t, `${n}.values`, r);
1235
+ Mt(e.operation, e.values, t, `${n}.values`, r);
1235
1236
  }
1236
- function Rt(e, t, n, r, a) {
1237
+ function Mt(e, t, n, r, a) {
1237
1238
  if (e === "is null" || e === "is not null") {
1238
1239
  t.length !== 0 && a.push(`${r} must be empty for null filter operations.`);
1239
1240
  return;
@@ -1259,7 +1260,7 @@ function Rt(e, t, n, r, a) {
1259
1260
  return;
1260
1261
  }
1261
1262
  for (const s of t)
1262
- if (!Dt(s, n)) {
1263
+ if (!xt(s, n)) {
1263
1264
  a.push(
1264
1265
  `${r} contains a value that is incompatible with valueType '${n}'.`
1265
1266
  );
@@ -1275,10 +1276,10 @@ const G = {
1275
1276
  rememberedTableSettingsMaxBytes: 262144,
1276
1277
  bookmarkStateMaxBytes: 65536
1277
1278
  }, Ne = 1;
1278
- function Yn(e) {
1279
+ function Jn(e) {
1279
1280
  return new TextEncoder().encode(JSON.stringify(e ?? null)).length;
1280
1281
  }
1281
- function Mt(e) {
1282
+ function _t(e) {
1282
1283
  const t = encodeURIComponent;
1283
1284
  switch (e.kind) {
1284
1285
  case "dimension":
@@ -1299,7 +1300,7 @@ function N(e) {
1299
1300
  return;
1300
1301
  }
1301
1302
  }
1302
- function _t(e) {
1303
+ function Ft(e) {
1303
1304
  if (typeof e != "string") return;
1304
1305
  const t = e.split(":");
1305
1306
  let n;
@@ -1313,12 +1314,12 @@ function _t(e) {
1313
1314
  const r = N(t[1]);
1314
1315
  r && (n = { kind: "result", key: r });
1315
1316
  }
1316
- return n && Mt(n) === e ? n : void 0;
1317
+ return n && _t(n) === e ? n : void 0;
1317
1318
  }
1318
1319
  function D(e) {
1319
- return typeof e == "string" && _t(e) !== void 0;
1320
+ return typeof e == "string" && Ft(e) !== void 0;
1320
1321
  }
1321
- const pe = l.array(l.string()).max(2e3), Ft = l.object({
1322
+ const pe = l.array(l.string()).max(2e3), Vt = l.object({
1322
1323
  order: pe.optional(),
1323
1324
  hidden: pe.optional(),
1324
1325
  labels: l.record(l.string(), l.string().max(G.columnLabelMaxChars)).optional(),
@@ -1359,7 +1360,7 @@ function Oe(e) {
1359
1360
  direction: u
1360
1361
  }))), i.length && (o.widths = Object.fromEntries(i)), Object.keys(o).length ? o : void 0;
1361
1362
  }
1362
- function Jn(e) {
1363
+ function Hn(e) {
1363
1364
  var t, n;
1364
1365
  return !!((t = e == null ? void 0 : e.order) != null && t.length) || !!((n = e == null ? void 0 : e.hidden) != null && n.length) || Object.keys((e == null ? void 0 : e.labels) ?? {}).length > 0 || Object.keys((e == null ? void 0 : e.widths) ?? {}).length > 0;
1365
1366
  }
@@ -1372,13 +1373,13 @@ function xe(e, t) {
1372
1373
  ok: !1,
1373
1374
  error: `Unsupported table settings version ${t}.`
1374
1375
  };
1375
- const n = Ft.safeParse(e);
1376
+ const n = Vt.safeParse(e);
1376
1377
  return n.success ? {
1377
1378
  ok: !0,
1378
1379
  value: Oe(n.data) ?? {}
1379
1380
  } : { ok: !1, error: "Table settings are invalid." };
1380
1381
  }
1381
- function Hn(e, t, n) {
1382
+ function Xn(e, t, n) {
1382
1383
  if (!e || typeof e != "object" || Array.isArray(e)) return {};
1383
1384
  const r = {};
1384
1385
  for (const [a, s] of Object.entries(
@@ -1390,28 +1391,28 @@ function Hn(e, t, n) {
1390
1391
  }
1391
1392
  return r;
1392
1393
  }
1393
- const Vt = /* @__PURE__ */ new Set([
1394
+ const Pt = /* @__PURE__ */ new Set([
1394
1395
  "table",
1395
1396
  "detailTable"
1396
1397
  ]);
1397
1398
  function Re(e) {
1398
- return Vt.has(e.type);
1399
+ return Pt.has(e.type);
1399
1400
  }
1400
- function Pt(e) {
1401
+ function Lt(e) {
1401
1402
  var t, n;
1402
1403
  return Re(e) && ((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : n.allowViewerColumnCustomization) !== !1;
1403
1404
  }
1404
- function Xn(e) {
1405
+ function Zn(e) {
1405
1406
  return new Set(
1406
1407
  T(e).filter(({ card: t }) => Re(t)).map(({ card: t }) => t.id)
1407
1408
  );
1408
1409
  }
1409
- function Zn(e) {
1410
+ function er(e) {
1410
1411
  return new Set(
1411
- T(e).filter(({ card: t }) => Pt(t)).map(({ card: t }) => t.id)
1412
+ T(e).filter(({ card: t }) => Lt(t)).map(({ card: t }) => t.id)
1412
1413
  );
1413
1414
  }
1414
- const $ = 1, er = ["PRIVATE", "TEAM", "DASHBOARD"], Lt = l.object({
1415
+ const $ = 1, tr = ["PRIVATE", "TEAM", "DASHBOARD"], $t = l.object({
1415
1416
  filterId: l.string().min(1),
1416
1417
  name: l.string(),
1417
1418
  operation: l.string(),
@@ -1419,22 +1420,22 @@ const $ = 1, er = ["PRIVATE", "TEAM", "DASHBOARD"], Lt = l.object({
1419
1420
  values: l.array(l.unknown())
1420
1421
  }).passthrough().superRefine((e, t) => {
1421
1422
  const n = [];
1422
- Ot.has(e.operation) ? xt(e, e.valueType, "filterValue", n) : n.push("filterValue.operation must be a valid filter operation.");
1423
+ Dt.has(e.operation) ? Rt(e, e.valueType, "filterValue", n) : n.push("filterValue.operation must be a valid filter operation.");
1423
1424
  for (const r of n) t.addIssue({ code: "custom", message: r });
1424
1425
  }), q = l.unknown().superRefine((e, t) => {
1425
- for (const n of je(e).errors)
1426
+ for (const n of Ue(e).errors)
1426
1427
  t.addIssue({ code: "custom", message: n.message });
1427
- }), $t = l.discriminatedUnion("kind", [
1428
- l.object({ kind: l.literal("filter"), filterValue: Lt }).strict(),
1428
+ }), qt = l.discriminatedUnion("kind", [
1429
+ l.object({ kind: l.literal("filter"), filterValue: $t }).strict(),
1429
1430
  l.object({ kind: l.literal("control"), value: l.unknown() }).strict(),
1430
1431
  l.object({
1431
1432
  kind: l.literal("selection"),
1432
1433
  selection: Le
1433
1434
  }).strict()
1434
- ]), qt = l.union([
1435
+ ]), Bt = l.union([
1435
1436
  l.object({
1436
1437
  status: l.literal("set"),
1437
- value: $t,
1438
+ value: qt,
1438
1439
  comparisonSelection: q.optional()
1439
1440
  }).strict(),
1440
1441
  l.object({
@@ -1442,7 +1443,7 @@ const $ = 1, er = ["PRIVATE", "TEAM", "DASHBOARD"], Lt = l.object({
1442
1443
  comparisonSelection: q.optional()
1443
1444
  }).strict(),
1444
1445
  l.object({ comparisonSelection: q }).strict()
1445
- ]), Me = ["bySheetId", "byCardId", "byDocumentSectionId"], Bt = /* @__PURE__ */ new Set(["version", "selectedSheetId", "inputs", "tableSettings"]), jt = /* @__PURE__ */ new Set(["shared", ...Me]), A = (e) => !!e && typeof e == "object" && !Array.isArray(e);
1446
+ ]), Me = ["bySheetId", "byCardId", "byDocumentSectionId"], jt = /* @__PURE__ */ new Set(["version", "selectedSheetId", "inputs", "tableSettings"]), Ut = /* @__PURE__ */ new Set(["shared", ...Me]), A = (e) => !!e && typeof e == "object" && !Array.isArray(e);
1446
1447
  function ye(e, t, n) {
1447
1448
  if (e === void 0) return;
1448
1449
  if (!A(e)) {
@@ -1451,7 +1452,7 @@ function ye(e, t, n) {
1451
1452
  }
1452
1453
  const r = {};
1453
1454
  for (const [a, s] of Object.entries(e)) {
1454
- const i = a ? qt.safeParse(s) : void 0;
1455
+ const i = a ? Bt.safeParse(s) : void 0;
1455
1456
  i != null && i.success ? r[a] = i.data : t.push({
1456
1457
  target: $e(a) ? "selection" : "input",
1457
1458
  id: a
@@ -1459,18 +1460,18 @@ function ye(e, t, n) {
1459
1460
  }
1460
1461
  return Object.keys(r).length ? r : void 0;
1461
1462
  }
1462
- function Ut(e, t) {
1463
+ function zt(e, t) {
1463
1464
  if (t !== $)
1464
1465
  return { ok: !1, error: `Unsupported bookmark version ${t}.` };
1465
1466
  if (!A(e) || e.version !== $)
1466
1467
  return { ok: !1, error: "The bookmark state is invalid." };
1467
- const n = [], r = Object.keys(e).filter((o) => !Bt.has(o));
1468
+ const n = [], r = Object.keys(e).filter((o) => !jt.has(o));
1468
1469
  let a;
1469
1470
  typeof e.selectedSheetId == "string" && e.selectedSheetId ? a = e.selectedSheetId : e.selectedSheetId !== void 0 && n.push({ target: "sheet", id: String(e.selectedSheetId) });
1470
1471
  const s = {};
1471
1472
  if (A(e.inputs)) {
1472
1473
  r.push(
1473
- ...Object.keys(e.inputs).filter((c) => !jt.has(c)).map((c) => `inputs.${c}`)
1474
+ ...Object.keys(e.inputs).filter((c) => !Ut.has(c)).map((c) => `inputs.${c}`)
1474
1475
  );
1475
1476
  const o = ye(e.inputs.shared, n, "shared");
1476
1477
  o && (s.shared = o);
@@ -1508,118 +1509,118 @@ function Ut(e, t) {
1508
1509
  unknownKeys: r
1509
1510
  };
1510
1511
  }
1511
- function tr(e, t) {
1512
- const n = Ut(e, t);
1512
+ function nr(e, t) {
1513
+ const n = zt(e, t);
1513
1514
  return n.ok ? n.issues.some((r) => r.target === "card") ? { ok: !1, error: "The bookmark table settings are invalid." } : n.issues.length || n.unknownKeys.length ? { ok: !1, error: "The bookmark state is invalid." } : { ok: !0, value: n.value } : n;
1514
1515
  }
1515
1516
  export {
1516
- Ge as $,
1517
+ Qe as $,
1517
1518
  _ as A,
1518
1519
  $ as B,
1519
- Gn as C,
1520
+ Qn as C,
1520
1521
  C as D,
1521
- Wn as E,
1522
- cn as F,
1523
- Dn as G,
1524
- wn as H,
1525
- ze as I,
1526
- rt as J,
1527
- It as K,
1528
- fn as L,
1522
+ Gn as E,
1523
+ un as F,
1524
+ xn as G,
1525
+ An as H,
1526
+ We as I,
1527
+ st as J,
1528
+ bt as K,
1529
+ mn as L,
1529
1530
  de as M,
1530
- Ze as N,
1531
- an as O,
1531
+ et as N,
1532
+ on as O,
1532
1533
  ge as P,
1533
- pn as Q,
1534
- En as R,
1535
- yn as S,
1534
+ hn as Q,
1535
+ Kn as R,
1536
+ In as S,
1536
1537
  J as T,
1537
- kn as U,
1538
+ wn as U,
1538
1539
  G as V,
1539
- ot as W,
1540
+ ct as W,
1540
1541
  ne as X,
1541
1542
  re as Y,
1542
- We as Z,
1543
- Xt as _,
1544
- Ln as a,
1545
- Zt as a0,
1546
- on as a1,
1547
- un as a2,
1548
- dn as a3,
1549
- ln as a4,
1550
- mn as a5,
1551
- hn as a6,
1543
+ Ge as Z,
1544
+ Zt as _,
1545
+ $n as a,
1546
+ en as a0,
1547
+ cn as a1,
1548
+ dn as a2,
1549
+ ln as a3,
1550
+ fn as a4,
1551
+ pn as a5,
1552
+ yn as a6,
1552
1553
  Ae as a7,
1553
1554
  R as a8,
1554
- ct as a9,
1555
- Mn as aA,
1556
- tn as aB,
1557
- Je as aC,
1555
+ ut as a9,
1556
+ _n as aA,
1557
+ nn as aB,
1558
+ He as aC,
1558
1559
  v as aD,
1559
1560
  Y as aE,
1560
- Sn as aF,
1561
- gn as aG,
1562
- Cn as aH,
1561
+ Cn as aF,
1562
+ kn as aG,
1563
+ gn as aH,
1563
1564
  T as aI,
1564
- at as aJ,
1565
- bn as aK,
1565
+ it as aJ,
1566
+ Sn as aK,
1566
1567
  se as aL,
1567
- In as aM,
1568
- Rn as aN,
1569
- Qe as aO,
1570
- _n as aP,
1571
- Fn as aQ,
1572
- Pn as aR,
1573
- en as aS,
1568
+ bn as aM,
1569
+ Mn as aN,
1570
+ Ye as aO,
1571
+ Fn as aP,
1572
+ Vn as aQ,
1573
+ Ln as aR,
1574
+ tn as aS,
1574
1575
  S as aa,
1575
1576
  ve as ab,
1576
- ut as ac,
1577
- dt as ad,
1578
- An as ae,
1577
+ dt as ac,
1578
+ lt as ad,
1579
+ vn as ae,
1579
1580
  H as af,
1580
- lt as ag,
1581
- vn as ah,
1582
- Tn as ai,
1583
- Kn as aj,
1584
- Nn as ak,
1585
- On as al,
1586
- nn as am,
1587
- Xe as an,
1588
- rn as ao,
1589
- sn as ap,
1581
+ ft as ag,
1582
+ Tn as ah,
1583
+ En as ai,
1584
+ Nn as aj,
1585
+ On as ak,
1586
+ Dn as al,
1587
+ rn as am,
1588
+ Ze as an,
1589
+ sn as ao,
1590
+ an as ap,
1590
1591
  ke as aq,
1591
- bt as ar,
1592
- St as as,
1593
- Ct as at,
1594
- xn as au,
1595
- Nt as av,
1596
- Qn as aw,
1597
- Ot as ax,
1598
- xt as ay,
1599
- kt as az,
1600
- qn as b,
1592
+ St as ar,
1593
+ Ct as as,
1594
+ gt as at,
1595
+ Rn as au,
1596
+ Ot as av,
1597
+ Yn as aw,
1598
+ Dt as ax,
1599
+ Rt as ay,
1600
+ wt as az,
1601
+ Bn as b,
1601
1602
  Ke as c,
1602
1603
  Ee as d,
1603
- Bn as e,
1604
- jn as f,
1605
- Un as g,
1606
- zn as h,
1607
- Ut as i,
1604
+ jn as e,
1605
+ Un as f,
1606
+ zn as g,
1607
+ Wn as h,
1608
+ zt as i,
1608
1609
  Ne as j,
1609
- _t as k,
1610
- Jn as l,
1611
- Yn as m,
1610
+ Ft as k,
1611
+ Hn as l,
1612
+ Jn as m,
1612
1613
  Oe as n,
1613
1614
  De as o,
1614
- tr as p,
1615
+ nr as p,
1615
1616
  xe as q,
1616
- $n as r,
1617
- Hn as s,
1618
- Mt as t,
1617
+ qn as r,
1618
+ Xn as s,
1619
+ _t as t,
1619
1620
  Re as u,
1620
- Pt as v,
1621
- Xn as w,
1622
- Zn as x,
1623
- er as y,
1624
- Vn as z
1621
+ Lt as v,
1622
+ Zn as w,
1623
+ er as x,
1624
+ tr as y,
1625
+ Pn as z
1625
1626
  };