react-semaphor 0.1.526 → 0.1.528

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 (180) hide show
  1. package/DATA_APP_SDK.md +5 -1
  2. package/dist/analytics-protocol/index.js +1190 -296
  3. package/dist/brand-studio/index.js +15 -15
  4. package/dist/briefings/index.js +50 -49
  5. package/dist/chunks/{calculated-field-identity-D1ofR4KJ.js → calculated-field-identity-DUu-tCQw.js} +66 -65
  6. package/dist/chunks/{card-config-utils-9sv4e-Vb.js → card-config-utils-BdPceiw8.js} +68 -65
  7. package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
  8. package/dist/chunks/dashboard-BkskKMck.js +14 -0
  9. package/dist/chunks/{dashboard-briefing-launcher-DXz1GhFZ.js → dashboard-briefing-launcher-Bb0RhGRC.js} +372 -359
  10. package/dist/chunks/{dashboard-controls-Df8qOSrs.js → dashboard-controls-loWTHPMi.js} +739 -686
  11. package/dist/chunks/{dashboard-json-Xldp0qww.js → dashboard-json-DUci_SOR.js} +10 -10
  12. package/dist/chunks/{edit-dashboard-visual-COHBqyic.js → edit-dashboard-visual-z9WN26w7.js} +6603 -6572
  13. package/dist/chunks/{editor-action-buttons-DahlP57T.js → editor-action-buttons-CGSFK9S-.js} +266 -267
  14. package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-CdXSo1pb.js} +19 -19
  15. package/dist/chunks/{field-dependencies-v-lJNzC7.js → field-dependencies-CGYic38w.js} +1 -1
  16. package/dist/chunks/{index-CbjuruKe.js → index-CTYnXU85.js} +781 -780
  17. package/dist/chunks/{matrix-analytical-definition-BimC4XIV.js → matrix-analytical-definition-BJyH5-99.js} +1 -1
  18. package/dist/chunks/{matrix-card-CIlz0Dnp.js → matrix-card-DhykwdZs.js} +7 -6
  19. package/dist/chunks/{matrix-control-sources-2VAzGlt8.js → matrix-control-sources-BV9ywFtJ.js} +11 -11
  20. package/dist/chunks/{matrix-definition-E5gXXSTZ.js → matrix-definition-Cdn3LoxW.js} +3 -3
  21. package/dist/chunks/{semantic-format-Baqp8kD_.js → matrix-formatter-1Mm8x8w7.js} +655 -511
  22. package/dist/chunks/{matrix-member-presentation-Bw7-JCrr.js → matrix-member-presentation-BBW0n1iY.js} +1 -1
  23. package/dist/chunks/matrix-operation-contract-Dp7kFpVk.js +1383 -0
  24. package/dist/chunks/{metric-comparison-BphoJ9bq.js → metric-comparison-Crljx_XY.js} +15 -10
  25. package/dist/chunks/{numeric-presentation-VhMUHfrJ.js → numeric-presentation-LvnNY5Ma.js} +68 -68
  26. package/dist/chunks/pivot-header-presentation-CZa3556D.js +618 -0
  27. package/dist/chunks/{pivot-result-identity-BzUQiCEV.js → pivot-result-identity-CY__BuwI.js} +1 -1
  28. package/dist/chunks/{pivot-result-lifecycle-BFO354lk.js → pivot-result-lifecycle-Bqdtknud.js} +259 -204
  29. package/dist/chunks/{raw-temporal-7bFbXd2a.js → raw-temporal-CdnA_OXJ.js} +10 -10
  30. package/dist/chunks/{raw-temporal-contract-BQZIJ1fn.js → raw-temporal-contract-Bc9z83t-.js} +1 -1
  31. package/dist/chunks/relative-date-DAF9J7mt.js +456 -0
  32. package/dist/chunks/{report-preferences-dialog-BcH-0lR-.js → report-preferences-dialog-VV0-Ro6F.js} +131 -132
  33. package/dist/chunks/{report-runtime-context-CxIoGyNM.js → report-runtime-context-CtaGGlit.js} +1 -1
  34. package/dist/chunks/{selection-reducer-NF5C07yM.js → selection-reducer-IZjBSU6Z.js} +47 -26
  35. package/dist/chunks/semantic-format-BBLvfwua.js +192 -0
  36. package/dist/chunks/{semaphor-ready-indicator-BLRDuLr4.js → semaphor-ready-indicator-DbA4mVQL.js} +49909 -46207
  37. package/dist/chunks/{slider-BYIH4icg.js → slider-DpiJG8lv.js} +81 -82
  38. package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
  39. package/dist/chunks/switch-C4YH-W1X.js +24003 -0
  40. package/dist/chunks/{temporal-bucket-PcLFSYWX.js → temporal-bucket-DlFuhCnT.js} +6 -6
  41. package/dist/chunks/{temporal-bucket-contract-DTLDRzgV.js → temporal-bucket-contract-C6lUGPS3.js} +1 -1
  42. package/dist/chunks/temporal-input-presentation-DyMWCZYh.js +195 -0
  43. package/dist/chunks/{token-types-BC6RcUY8.js → token-types-UjyNz95-.js} +1 -1
  44. package/dist/chunks/{validators-CsdOtZI6.js → validators-CQcG0EPN.js} +852 -731
  45. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
  46. package/dist/dashboard/index.js +1 -1
  47. package/dist/dashboard-authoring/index.js +138 -137
  48. package/dist/data-app-sdk/index.js +12 -12
  49. package/dist/data-app-sdk-adapters/index.js +23 -22
  50. package/dist/data-app-sdk-validation/index.js +27 -26
  51. package/dist/format-utils/index.js +247 -329
  52. package/dist/index.js +165 -168
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +1 -1
  56. package/dist/types/briefings/index.d.ts +3 -0
  57. package/dist/types/components/explorer/filters/card-date-filter.d.ts +13 -5
  58. package/dist/types/components/explorer/filters/card-date-selection.d.ts +28 -0
  59. package/dist/types/components/sharing-and-management/dashboard-actions-menu.d.ts +1 -1
  60. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -1
  61. package/dist/types/components/surfboard/download-settings-dialog.d.ts +8 -0
  62. package/dist/types/components/surfboard/filter/types.d.ts +8 -29
  63. package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +5 -1
  64. package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -2
  65. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -21
  66. package/dist/types/components/ui-custom/report-calendar.d.ts +18 -0
  67. package/dist/types/components/visual/aggregated-table/utils/export-utils.d.ts +3 -5
  68. package/dist/types/components/visual/data-table/data-table-toolbar.d.ts +1 -1
  69. package/dist/types/components/visual/pivot-table/utils/pivot-table-export-utils.d.ts +3 -1
  70. package/dist/types/index.js +5 -5
  71. package/dist/types/lib/api/exports-api.d.ts +3 -0
  72. package/dist/types/lib/csv-download.d.ts +9 -0
  73. package/dist/types/lib/csv-encoding-options.d.ts +6 -0
  74. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +2 -1
  75. package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +0 -1
  76. package/dist/types/lib/document/document-input-runtime.d.ts +2 -1
  77. package/dist/types/lib/export-utils.d.ts +17 -15
  78. package/dist/types/lib/hooks/explorer/use-filter-builder.d.ts +2 -2
  79. package/dist/types/lib/hooks/use-relative-date-summarizer.d.ts +7 -0
  80. package/dist/types/lib/matrix-table/matrix-application-adapter.d.ts +3 -2
  81. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  82. package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +1 -1
  83. package/dist/types/lib/matrix-table/matrix-dataset-history.d.ts +47 -0
  84. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +7 -3
  85. package/dist/types/lib/matrix-table/matrix-execution-context.d.ts +2 -0
  86. package/dist/types/lib/matrix-table/matrix-query-transport.d.ts +4 -1
  87. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +105 -4
  88. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +43 -2
  89. package/dist/types/lib/matrix-table/use-matrix.d.ts +6 -0
  90. package/dist/types/lib/query-context/build-card-query-context.d.ts +5 -1
  91. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +0 -1
  92. package/dist/types/lib/query-context/build-global-date-comparison-context.d.ts +1 -2
  93. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +1 -2
  94. package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +10 -0
  95. package/dist/types/lib/query-context/query-auth-scope.d.ts +5 -0
  96. package/dist/types/lib/stores/dashboard-store.d.ts +9 -4
  97. package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -2
  98. package/dist/types/lib/types/common-types.d.ts +5 -0
  99. package/dist/types/lib/types/explorer-types.d.ts +14 -0
  100. package/dist/types/lib/types/semantic-types.d.ts +4 -2
  101. package/dist/types/lib/types/token-types.d.ts +0 -1
  102. package/dist/types/lib/utils/aggregate-expression-utils.d.ts +0 -4
  103. package/dist/types/lib/utils/card-definition.d.ts +1 -1
  104. package/dist/types/lib/utils/date-timezone-utils.d.ts +4 -46
  105. package/dist/types/lib/utils/filter-default-value-utils.d.ts +8 -2
  106. package/dist/types/lib/utils/inline-filter-utils.d.ts +3 -2
  107. package/dist/types/lib/utils/relative-date-description.d.ts +38 -0
  108. package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +89 -0
  109. package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +32 -0
  110. package/dist/types/shared/analytics-protocol/contracts.d.ts +48 -7
  111. package/dist/types/shared/analytics-protocol/index.d.ts +15 -1
  112. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +20 -20
  113. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
  114. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
  115. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +61 -6
  116. package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +63 -0
  117. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +9 -3
  118. package/dist/types/shared/analytics-protocol/operation-temporal-state.d.ts +64 -0
  119. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +61 -0
  120. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +20 -0
  121. package/dist/types/shared/analytics-protocol/runtime-schemas.d.ts +0 -2
  122. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +314 -0
  123. package/dist/types/shared/analytics-protocol/time-window.d.ts +13 -0
  124. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
  125. package/dist/types/shared/format-utils/exporters/csv-utils.d.ts +46 -15
  126. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -3
  127. package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +2 -1
  128. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +2 -2
  129. package/dist/types/shared/format-utils/types/format-types.d.ts +0 -42
  130. package/dist/types/shared/temporal/calendar-periods.d.ts +56 -0
  131. package/dist/types/shared/temporal/index.d.ts +5 -0
  132. package/dist/types/shared/temporal/relative-date.d.ts +21 -0
  133. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +73 -0
  134. package/dist/types/shared/temporal/time-window-periods.d.ts +21 -0
  135. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +23 -0
  136. package/package.json +1 -17
  137. package/src/data-app-sdk/README.md +6 -3
  138. package/dist/chunks/code-highlight-994tgM9v.js +0 -22265
  139. package/dist/chunks/dashboard-CsHvEtjN.js +0 -15
  140. package/dist/chunks/dashboard-date-comparison-definition-BqNhECUr.js +0 -183
  141. package/dist/chunks/matrix-formatter-WBgtebUT.js +0 -341
  142. package/dist/chunks/matrix-operation-contract-D32U2CSw.js +0 -1802
  143. package/dist/chunks/mouse-pointer-2-BZvGk45-.js +0 -19
  144. package/dist/chunks/pivot-header-presentation-CGtudHo7.js +0 -661
  145. package/dist/chunks/pre-block-Cq1RqhZX.js +0 -3987
  146. package/dist/chunks/search-CJz-QQ0Q.js +0 -24
  147. package/dist/chunks/switch-XaAACBrJ.js +0 -2234
  148. package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +0 -222
  149. package/dist/chunks/update-policy-DhAUtiC8.js +0 -913
  150. package/dist/data-app-builder/index.js +0 -3666
  151. package/dist/data-app-builder-browser-runtime/index.js +0 -8
  152. package/dist/data-app-codegen/index.js +0 -22
  153. package/dist/data-app-codegen-node/index.js +0 -1807
  154. package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +0 -7
  155. package/dist/types/components/surfboard/json-to-csv.d.ts +0 -7
  156. package/dist/types/components/visual/data-table/utils/export-utils.d.ts +0 -31
  157. package/dist/types/data-app-builder/browser-runtime.d.ts +0 -174
  158. package/dist/types/data-app-builder/constants.d.ts +0 -14
  159. package/dist/types/data-app-builder/data-app-builder.d.ts +0 -14
  160. package/dist/types/data-app-builder/index.d.ts +0 -1
  161. package/dist/types/data-app-builder/lib/api.d.ts +0 -36
  162. package/dist/types/data-app-builder/lib/context-select.d.ts +0 -3
  163. package/dist/types/data-app-builder/lib/diagnostics.d.ts +0 -12
  164. package/dist/types/data-app-builder/lib/file-tree.d.ts +0 -2
  165. package/dist/types/data-app-builder/types.d.ts +0 -558
  166. package/dist/types/data-app-builder-browser-runtime.d.ts +0 -2
  167. package/dist/types/data-app-builder.d.ts +0 -2
  168. package/dist/types/data-app-codegen/generate-contract.d.ts +0 -26
  169. package/dist/types/data-app-codegen/generated-contract-files.d.ts +0 -7
  170. package/dist/types/data-app-codegen/generated-contract-validation.d.ts +0 -13
  171. package/dist/types/data-app-codegen/index.d.ts +0 -6
  172. package/dist/types/data-app-codegen/live-execution.d.ts +0 -42
  173. package/dist/types/data-app-codegen/node.d.ts +0 -2
  174. package/dist/types/data-app-codegen/update-policy.d.ts +0 -25
  175. package/dist/types/data-app-codegen/validation.d.ts +0 -8
  176. package/dist/types/data-app-codegen-node.d.ts +0 -2
  177. package/dist/types/data-app-codegen.d.ts +0 -2
  178. package/dist/types/shared/analytics-protocol/data-app-codegen-summary.d.ts +0 -418
  179. package/dist/types/shared/format-utils/exporters/pivot-exporter.d.ts +0 -13
  180. package/dist/types/shared/format-utils/exporters/table-exporter.d.ts +0 -10
@@ -1,28 +1,28 @@
1
1
  var ft = Object.defineProperty;
2
2
  var pt = (e, r, t) => r in e ? ft(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
3
  var F = (e, r, t) => pt(e, typeof r != "symbol" ? r + "" : r, t);
4
- import { k as Re, g as yt } from "./numeric-presentation-VhMUHfrJ.js";
5
- import { al as Ae, a5 as ht, a7 as me, $ as ye, t as gt } from "./validators-CsdOtZI6.js";
4
+ import { k as Re, e as yt } from "./numeric-presentation-LvnNY5Ma.js";
5
+ import { F as Ae, am as ht, S as me, ah as ye, t as gt } from "./validators-CQcG0EPN.js";
6
+ import { z as vt, x as bt, u as It, y as Ct, s as Tt, M as wt, o as $t, C as xt, n as Et, P as G } from "./pivot-result-lifecycle-Bqdtknud.js";
6
7
  import "./matrix-continuation-C4sRcjZU.js";
7
- import { $ as vt, a1 as bt } from "./matrix-operation-contract-D32U2CSw.js";
8
- import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as he } from "../value-format-preferences/index.js";
9
- import { k as It, i as Ct, g as Tt, j as wt, e as $t, M as xt, c as kt, b as Et, P as G } from "./pivot-result-lifecycle-BFO354lk.js";
8
+ import { af as kt, ah as St, V as _t } from "./matrix-operation-contract-Dp7kFpVk.js";
10
9
  import { z as T } from "zod";
11
- import { r as St } from "./matrix-definition-E5gXXSTZ.js";
12
- import { h as De, i as ge, r as Me, a as Pe, v as _t, b as Ft } from "./card-config-utils-9sv4e-Vb.js";
13
- import { r as Rt } from "./matrix-card-CIlz0Dnp.js";
14
- import { a as Be, s as At, i as Dt, o as Mt } from "./field-aggregations-BQjogiI1.js";
15
- import { h as re, r as W, c as Pt, R as Bt, v as Ot } from "./raw-temporal-7bFbXd2a.js";
16
- import { r as V, b as Kt, d as Nt, P as Lt } from "./pivot-result-identity-BzUQiCEV.js";
17
- import { v as zt, a as qt } from "./temporal-bucket-contract-DTLDRzgV.js";
18
- import { f as Vt, c as Ut, r as Oe, D as jt } from "./temporal-bucket-PcLFSYWX.js";
19
- import { v as Ke } from "./raw-temporal-contract-BQZIJ1fn.js";
20
- import { r as Gt, a as Ht, b as Wt } from "./canonical-result-keys-CEQefvdO.js";
21
- const Yt = `import pandas as pd
10
+ import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as he } from "../value-format-preferences/index.js";
11
+ import { r as Ft } from "./matrix-definition-Cdn3LoxW.js";
12
+ import { h as De, i as ge, r as Me, a as Pe, v as Rt, b as At } from "./card-config-utils-BdPceiw8.js";
13
+ import { r as Dt } from "./matrix-card-DhykwdZs.js";
14
+ import { a as Oe, s as Mt, i as Pt, o as Ot } from "./field-aggregations-CdXSo1pb.js";
15
+ import { f as re, r as W, c as Bt, R as Kt, v as Nt } from "./raw-temporal-CdnA_OXJ.js";
16
+ import { r as q, b as Lt, d as zt, P as Vt } from "./pivot-result-identity-CY__BuwI.js";
17
+ import { v as qt, a as Ut } from "./temporal-bucket-contract-C6lUGPS3.js";
18
+ import { f as jt, a as Gt, c as Be, D as Ht } from "./temporal-bucket-DlFuhCnT.js";
19
+ import { v as Ke } from "./raw-temporal-contract-Bc9z83t-.js";
20
+ import { r as Wt, a as Yt, b as Zt } from "./canonical-result-keys-CEQefvdO.js";
21
+ const Qt = `import pandas as pd
22
22
  df = pd.DataFrame(data) # 'data' contains the query result
23
23
  result = df.to_dict('records') # must return 'result' as [dict] type
24
24
  `;
25
- function ro(e) {
25
+ function ao(e) {
26
26
  return {
27
27
  databaseName: (e == null ? void 0 : e.lastSelectedDatabase) || "",
28
28
  schemaName: (e == null ? void 0 : e.lastSelectedSchema) || "",
@@ -31,16 +31,16 @@ function ro(e) {
31
31
  };
32
32
  }
33
33
  function Z(e) {
34
- return e === Yt ? "" : e;
34
+ return e === Qt ? "" : e;
35
35
  }
36
36
  function ne(e, r = e.config) {
37
- return Be({
37
+ return Oe({
38
38
  hasExecutableConfig: De(r, e.type),
39
39
  sql: e.sql,
40
40
  normalizedPython: Z(e.python || "")
41
41
  });
42
42
  }
43
- class Zt extends Error {
43
+ class Xt extends Error {
44
44
  constructor(t) {
45
45
  super(
46
46
  `ambiguous_temporal_grain: Temporal field "${t}" has saved presentation but no valid grouping grain. Reconfigure and resave the field.`
@@ -50,16 +50,16 @@ class Zt extends Error {
50
50
  this.name = "AmbiguousGroupedTemporalGrainError", this.fieldId = t;
51
51
  }
52
52
  }
53
- function Qt(e) {
53
+ function Jt(e) {
54
54
  return Pe(e) || e.semanticTemporalPresentation != null;
55
55
  }
56
- function Xt(e) {
56
+ function er(e) {
57
57
  if (!e.id || !["date", "datetime"].includes(
58
58
  Ae(e.dataType)
59
59
  ))
60
60
  return;
61
61
  if (ht(e.granularity)) return e;
62
- if (!Qt(e)) return;
62
+ if (!Jt(e)) return;
63
63
  if (!Me({
64
64
  fieldId: e.id,
65
65
  dataType: e.dataType,
@@ -68,12 +68,12 @@ function Xt(e) {
68
68
  dateFormat: e.dateFormat,
69
69
  customFormat: e.customFormat
70
70
  }).ok)
71
- throw new Zt(e.id);
71
+ throw new Xt(e.id);
72
72
  return { ...e, granularity: "day" };
73
73
  }
74
74
  function ve(e) {
75
75
  const r = e.cardConfig ?? e.card.config;
76
- if (!r || !e.supportsCardType(e.card.type) || Be({
76
+ if (!r || !e.supportsCardType(e.card.type) || Oe({
77
77
  hasExecutableConfig: De(r),
78
78
  sql: e.card.sql,
79
79
  normalizedPython: Z(e.card.python || "")
@@ -93,12 +93,12 @@ function ve(e) {
93
93
  cardType: e.card.type,
94
94
  cardConfig: r,
95
95
  fields: t.flatMap((n) => {
96
- const o = Xt(n);
96
+ const o = er(n);
97
97
  return o ? [o] : [];
98
98
  })
99
99
  };
100
100
  }
101
- function no(e) {
101
+ function io(e) {
102
102
  if (ge(e.card))
103
103
  return ve({
104
104
  ...e,
@@ -106,15 +106,15 @@ function no(e) {
106
106
  supportsCardType: (r) => r === "table"
107
107
  });
108
108
  }
109
- function oo(e) {
109
+ function co(e) {
110
110
  if (ge(e.card))
111
111
  return ve({
112
112
  ...e,
113
113
  card: e.card,
114
- supportsCardType: Dt
114
+ supportsCardType: Pt
115
115
  });
116
116
  }
117
- function Jt(e) {
117
+ function tr(e) {
118
118
  if (ge(e.card))
119
119
  return ve({
120
120
  ...e,
@@ -122,22 +122,22 @@ function Jt(e) {
122
122
  // Raw detail-table presentation has its own result/adapter contract.
123
123
  // This module remains grouped-only even though the shared producer
124
124
  // registry now recognizes detailTable.
125
- supportsCardType: (r) => r !== "detailTable" && At(r)
125
+ supportsCardType: (r) => r !== "detailTable" && Mt(r)
126
126
  });
127
127
  }
128
128
  const xe = /* @__PURE__ */ new WeakMap();
129
- function er(e) {
129
+ function rr(e) {
130
130
  const r = xe.get(e);
131
131
  if (r) return r;
132
- const t = It(e);
132
+ const t = vt(e);
133
133
  return xe.set(e, t), t;
134
134
  }
135
135
  function j(e, r) {
136
136
  const t = e ?? [], n = r ?? [];
137
137
  return t.length === n.length && t.every((o, a) => o === n[a]);
138
138
  }
139
- function tr(e, r) {
140
- const t = Ct({
139
+ function nr(e, r) {
140
+ const t = bt({
141
141
  groupByFields: r.groupByColumns,
142
142
  metricFields: r.metricColumns,
143
143
  pivotByFields: r.pivotByColumns,
@@ -160,7 +160,7 @@ function tr(e, r) {
160
160
  t.expectedMetricAliases
161
161
  );
162
162
  }
163
- class rr extends Error {
163
+ class or extends Error {
164
164
  constructor(t) {
165
165
  super(
166
166
  `missing_resolved_temporal_format: Saved presentation is missing temporal field "${t.fieldId}" for card "${t.cardId}". Resave the report or Briefing to capture the current dashboard presentation.`
@@ -196,13 +196,13 @@ class L extends Error {
196
196
  function Ne(e, r) {
197
197
  return `${r}:${e}`;
198
198
  }
199
- function nr(e) {
199
+ function ar(e) {
200
200
  var r, t;
201
201
  return (t = (r = e.presentation) == null ? void 0 : r.byFieldRole) == null ? void 0 : t.get(
202
202
  Ne(e.fieldId, e.role)
203
203
  );
204
204
  }
205
- function or(e) {
205
+ function ir(e) {
206
206
  var t;
207
207
  if ((((t = e.cardConfig.metricColumns) == null ? void 0 : t.length) || 0) > 0 || e.binding.role !== "metric")
208
208
  return !1;
@@ -214,7 +214,7 @@ function or(e) {
214
214
  }
215
215
  );
216
216
  }
217
- function ao(e, r) {
217
+ function lo(e, r) {
218
218
  return !r || r.byColumnKey.size === 0 ? e.map((t) => ({ ...t })) : e.map((t) => {
219
219
  const n = { ...t };
220
220
  return r.byColumnKey.forEach((o, a) => {
@@ -225,8 +225,8 @@ function ao(e, r) {
225
225
  }), n;
226
226
  });
227
227
  }
228
- function io(e) {
229
- var p;
228
+ function so(e) {
229
+ var f;
230
230
  if (!e.result || typeof e.result != "object") return !1;
231
231
  const r = e.result;
232
232
  if (e.expectedResultOwner !== void 0 && r.resultOwner !== e.expectedResultOwner)
@@ -237,8 +237,8 @@ function io(e) {
237
237
  const n = Array.isArray(r.records) ? r.records.length : void 0, o = (t.cardConfig.pivotByColumns || []).map((m) => m.id);
238
238
  if (t.cardType === "pivotTable")
239
239
  try {
240
- const m = er(r);
241
- if (!tr(
240
+ const m = rr(r);
241
+ if (!nr(
242
242
  m.pivotResultContract,
243
243
  t.cardConfig
244
244
  ))
@@ -254,15 +254,15 @@ function io(e) {
254
254
  ), b = g.length > 0 && g.every(
255
255
  (C) => {
256
256
  var v;
257
- return ((v = C.pivotIdentity) == null ? void 0 : v.members.length) === 0 && Kt({
257
+ return ((v = C.pivotIdentity) == null ? void 0 : v.members.length) === 0 && Lt({
258
258
  expectedPivotFieldIds: o,
259
259
  classification: m.pivotResultContract.columnClassifications[C.key]
260
260
  });
261
261
  }
262
262
  );
263
263
  return t.fields.every((C) => {
264
- var E;
265
- const v = V(
264
+ var k;
265
+ const v = q(
266
266
  m.columnKeyMap,
267
267
  C.id,
268
268
  C.role
@@ -287,10 +287,10 @@ function io(e) {
287
287
  const w = m.columns.find(
288
288
  (_) => _.key === (v.outputKey || v.rawKey)
289
289
  );
290
- return ((E = w == null ? void 0 : w.temporalBucket) == null ? void 0 : E.granularity) === C.granularity;
290
+ return ((k = w == null ? void 0 : w.temporalBucket) == null ? void 0 : k.granularity) === C.granularity;
291
291
  });
292
292
  } catch (m) {
293
- if (m instanceof wt) return !1;
293
+ if (m instanceof Ct) return !1;
294
294
  throw m;
295
295
  }
296
296
  if (n === 0)
@@ -315,33 +315,33 @@ function io(e) {
315
315
  field: m,
316
316
  role: "detail"
317
317
  }))
318
- ], l = new Set(
318
+ ], c = new Set(
319
319
  i.map(({ field: m, role: g }) => `${g}:${m.id}`)
320
320
  ), d = new Map(
321
321
  (r.columns || []).map((m) => [m.key, m])
322
- ), c = V(
322
+ ), l = q(
323
323
  a,
324
324
  me,
325
325
  "metric"
326
326
  );
327
- if (c) {
328
- if (!or({
327
+ if (l) {
328
+ if (!ir({
329
329
  cardConfig: t.cardConfig,
330
- binding: c,
330
+ binding: l,
331
331
  columns: r.columns || []
332
332
  }))
333
333
  return !1;
334
- l.add(`metric:${me}`);
334
+ c.add(`metric:${me}`);
335
335
  }
336
336
  const s = Object.entries(a.byRole).flatMap(
337
337
  ([m, g]) => Object.keys(g || {}).map((y) => `${m}:${y}`)
338
338
  );
339
- if (s.length !== l.size || s.some((m) => !l.has(m)) || i.some(
340
- ({ field: m, role: g }) => !V(a, m.id, g)
339
+ if (s.length !== c.size || s.some((m) => !c.has(m)) || i.some(
340
+ ({ field: m, role: g }) => !q(a, m.id, g)
341
341
  ))
342
342
  return !1;
343
343
  try {
344
- Nt(
344
+ zt(
345
345
  (r.columns || []).map((m) => ({
346
346
  key: m.key,
347
347
  pivotIdentity: m.pivotIdentity
@@ -352,16 +352,16 @@ function io(e) {
352
352
  }
353
353
  );
354
354
  } catch (m) {
355
- if (m instanceof Lt) return !1;
355
+ if (m instanceof Vt) return !1;
356
356
  throw m;
357
357
  }
358
358
  const u = (r.columns || []).filter((m) => {
359
359
  const g = m.pivotIdentity;
360
360
  return !!(g && g.members.length > 0);
361
361
  });
362
- return n !== 0 && ((p = t.cardConfig.pivotByColumns) != null && p.length) && u.length === 0 ? !1 : t.fields.every((m) => {
362
+ return n !== 0 && ((f = t.cardConfig.pivotByColumns) != null && f.length) && u.length === 0 ? !1 : t.fields.every((m) => {
363
363
  var b;
364
- const g = V(
364
+ const g = q(
365
365
  a,
366
366
  m.id,
367
367
  m.role
@@ -370,14 +370,14 @@ function io(e) {
370
370
  if (g.role === "pivotby") {
371
371
  const v = u.flatMap(
372
372
  (w) => {
373
- var E;
374
- return ((E = w.pivotIdentity) == null ? void 0 : E.members) ?? [];
373
+ var k;
374
+ return ((k = w.pivotIdentity) == null ? void 0 : k.members) ?? [];
375
375
  }
376
376
  ).filter((w) => w.fieldId === m.id);
377
377
  return u.length === 0 ? n === 0 : v.length > 0 && v.every(
378
378
  (w) => {
379
- var E;
380
- return ((E = w.temporalBucket) == null ? void 0 : E.granularity) === m.granularity;
379
+ var k;
380
+ return ((k = w.temporalBucket) == null ? void 0 : k.granularity) === m.granularity;
381
381
  }
382
382
  );
383
383
  }
@@ -405,9 +405,9 @@ function ee(e, r) {
405
405
  if (!o.ok) throw new Error(o.error.code);
406
406
  return o.format;
407
407
  }
408
- function ar(e, r, t = he) {
408
+ function cr(e, r, t = he) {
409
409
  const n = ee(e, "card"), o = ee(e, "semantic"), a = e.semanticTemporalPresentation;
410
- return Oe({
410
+ return Be({
411
411
  metadata: r,
412
412
  ...n ? { cardFormat: n } : {},
413
413
  ...o && a ? {
@@ -423,7 +423,7 @@ function ar(e, r, t = he) {
423
423
  }
424
424
  });
425
425
  }
426
- function ir(e, r = jt, t = "en-US") {
426
+ function lr(e, r = Ht, t = "en-US") {
427
427
  var i;
428
428
  const n = ee(e, "card"), o = ((i = e.semanticTemporalPresentation) == null ? void 0 : i.granularity) === e.granularity ? ee(e, "semantic") : void 0, a = n && n.presentation.mode !== "auto" ? n : o && o.presentation.mode !== "auto" ? o : {
429
429
  presentation: { mode: "auto" }
@@ -438,7 +438,7 @@ function ir(e, r = jt, t = "en-US") {
438
438
  presentation: a.presentation
439
439
  };
440
440
  }
441
- function co(e) {
441
+ function mo(e) {
442
442
  const r = e.activation;
443
443
  if (!r)
444
444
  return {
@@ -453,20 +453,20 @@ function co(e) {
453
453
  byFieldRole: /* @__PURE__ */ new Map()
454
454
  };
455
455
  const t = new Map(
456
- (e.columns || []).map((c) => [c.key, c])
457
- ), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = r.fields.reduce((c, s) => (c.set(s.id, (c.get(s.id) || 0) + 1), c), /* @__PURE__ */ new Map()), l = (c, s) => {
456
+ (e.columns || []).map((l) => [l.key, l])
457
+ ), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = r.fields.reduce((l, s) => (l.set(s.id, (l.get(s.id) || 0) + 1), l), /* @__PURE__ */ new Map()), c = (l, s) => {
458
458
  a.set(
459
- Ne(c.id, c.role),
459
+ Ne(l.id, l.role),
460
460
  s
461
- ), i.get(c.id) === 1 && o.set(c.id, s);
462
- }, d = (c, s, u) => {
463
- if (s.granularity !== c.granularity)
461
+ ), i.get(l.id) === 1 && o.set(l.id, s);
462
+ }, d = (l, s, u) => {
463
+ if (s.granularity !== l.granularity)
464
464
  throw new L(
465
465
  "invalid_temporal_bucket_metadata",
466
- `Result identity "${u}" declares ${s.granularity} buckets for active ${c.granularity} field "${c.id}".`,
467
- { cardId: e.card.id, fieldId: c.id, columnKey: u }
466
+ `Result identity "${u}" declares ${s.granularity} buckets for active ${l.granularity} field "${l.id}".`,
467
+ { cardId: e.card.id, fieldId: l.id, columnKey: u }
468
468
  );
469
- const p = e.executionSnapshot && e.dashboardId ? Tt({
469
+ const f = e.executionSnapshot && e.dashboardId ? It({
470
470
  snapshot: e.executionSnapshot,
471
471
  scope: {
472
472
  dashboardId: e.dashboardId,
@@ -475,57 +475,57 @@ function co(e) {
475
475
  },
476
476
  target: {
477
477
  kind: "field",
478
- fieldId: c.id,
479
- role: c.role
478
+ fieldId: l.id,
479
+ role: l.role
480
480
  }
481
481
  }) : void 0;
482
- if (e.executionSnapshot && !p)
483
- throw new rr({
482
+ if (e.executionSnapshot && !f)
483
+ throw new or({
484
484
  dashboardId: e.dashboardId,
485
485
  cardId: e.card.id,
486
- fieldId: c.id
486
+ fieldId: l.id
487
487
  });
488
488
  return {
489
489
  columnKey: u,
490
- fieldId: c.id,
491
- role: c.role,
490
+ fieldId: l.id,
491
+ role: l.role,
492
492
  metadata: s,
493
- resolved: p ? Oe({
493
+ resolved: f ? Be({
494
494
  metadata: s,
495
- cardFormat: p,
496
- locale: p.locale,
497
- ...p.presentation.mode === "auto" ? {
498
- styles: p.presentation.styles
495
+ cardFormat: f,
496
+ locale: f.locale,
497
+ ...f.presentation.mode === "auto" ? {
498
+ styles: f.presentation.styles
499
499
  } : {}
500
- }) : ar(
501
- c,
500
+ }) : cr(
501
+ l,
502
502
  s,
503
503
  e.valueFormatPreferences ?? he
504
504
  )
505
505
  };
506
506
  };
507
- for (const c of r.fields) {
508
- const s = V(
507
+ for (const l of r.fields) {
508
+ const s = q(
509
509
  e.columnKeyMap,
510
- c.id,
511
- c.role
510
+ l.id,
511
+ l.role
512
512
  );
513
513
  if (!s) {
514
514
  if (e.columns === void 0 && e.columnKeyMap === void 0 && (e.resultRowCount === void 0 || e.resultRowCount === 0))
515
515
  continue;
516
516
  throw new L(
517
517
  "missing_temporal_column_binding",
518
- `Activated temporal field "${c.id}" has no authoritative result-column binding.`,
519
- { cardId: e.card.id, fieldId: c.id, columnKey: c.name }
518
+ `Activated temporal field "${l.id}" has no authoritative result-column binding.`,
519
+ { cardId: e.card.id, fieldId: l.id, columnKey: l.name }
520
520
  );
521
521
  }
522
522
  if (s.role === "pivotby") {
523
523
  const y = (e.columns || []).filter(
524
- (E) => E.pivotIdentity !== void 0
524
+ (k) => k.pivotIdentity !== void 0
525
525
  ), b = y.flatMap(
526
- (E) => {
526
+ (k) => {
527
527
  var _;
528
- return (((_ = E.pivotIdentity) == null ? void 0 : _.members) || []).filter((M) => M.fieldId === c.id).map((M) => ({ column: E, member: M }));
528
+ return (((_ = k.pivotIdentity) == null ? void 0 : _.members) || []).filter((M) => M.fieldId === l.id).map((M) => ({ column: k, member: M }));
529
529
  }
530
530
  );
531
531
  if (b.length === 0) {
@@ -533,7 +533,7 @@ function co(e) {
533
533
  continue;
534
534
  throw new ae({
535
535
  cardId: e.card.id,
536
- fieldId: c.id,
536
+ fieldId: l.id,
537
537
  columnKey: s.outputKey || s.rawKey
538
538
  });
539
539
  }
@@ -541,10 +541,10 @@ function co(e) {
541
541
  if (!C.member.temporalBucket)
542
542
  throw new ae({
543
543
  cardId: e.card.id,
544
- fieldId: c.id,
544
+ fieldId: l.id,
545
545
  columnKey: C.column.key
546
546
  });
547
- const v = zt(
547
+ const v = qt(
548
548
  C.member.temporalBucket
549
549
  );
550
550
  if (!v.ok || !v.value)
@@ -553,53 +553,53 @@ function co(e) {
553
553
  v.ok ? `Pivot result column "${C.column.key}" has no validated temporal bucket metadata.` : v.error.message,
554
554
  {
555
555
  cardId: e.card.id,
556
- fieldId: c.id,
556
+ fieldId: l.id,
557
557
  columnKey: C.column.key
558
558
  }
559
559
  );
560
560
  const w = d(
561
- c,
561
+ l,
562
562
  v.value,
563
563
  C.column.key
564
564
  );
565
- for (const { column: E, member: _ } of b)
565
+ for (const { column: k, member: _ } of b)
566
566
  if (!_.temporalBucket || JSON.stringify(_.temporalBucket) !== JSON.stringify(C.member.temporalBucket))
567
567
  throw new L(
568
568
  "invalid_temporal_bucket_metadata",
569
- `Pivot result column "${E.key}" has contradictory bucket metadata for field "${c.id}".`,
570
- { cardId: e.card.id, fieldId: c.id, columnKey: E.key }
569
+ `Pivot result column "${k.key}" has contradictory bucket metadata for field "${l.id}".`,
570
+ { cardId: e.card.id, fieldId: l.id, columnKey: k.key }
571
571
  );
572
- l(c, w);
572
+ c(l, w);
573
573
  continue;
574
574
  }
575
- const u = s.outputKey || s.rawKey, p = t.get(u);
576
- if (!(p != null && p.temporalBucket))
575
+ const u = s.outputKey || s.rawKey, f = t.get(u);
576
+ if (!(f != null && f.temporalBucket))
577
577
  throw new ae({
578
578
  cardId: e.card.id,
579
- fieldId: c.id,
579
+ fieldId: l.id,
580
580
  columnKey: u
581
581
  });
582
- const m = qt(p, {
582
+ const m = Ut(f, {
583
583
  metadataRequired: !0
584
584
  });
585
585
  if (!m.ok || !m.value)
586
586
  throw new L(
587
587
  "invalid_temporal_bucket_metadata",
588
588
  m.ok ? `Result column "${u}" has no validated temporal bucket metadata.` : m.error.message,
589
- { cardId: e.card.id, fieldId: c.id, columnKey: u }
589
+ { cardId: e.card.id, fieldId: l.id, columnKey: u }
590
590
  );
591
591
  const g = d(
592
- c,
592
+ l,
593
593
  m.value,
594
594
  u
595
595
  );
596
- n.set(u, g), l(c, g);
596
+ n.set(u, g), c(l, g);
597
597
  }
598
598
  return { byColumnKey: n, byFieldId: o, byFieldRole: a };
599
599
  }
600
- function lo(e) {
600
+ function uo(e) {
601
601
  var t, n;
602
- const r = e.role ? nr({
602
+ const r = e.role ? ar({
603
603
  presentation: e.presentation,
604
604
  fieldId: e.fieldId,
605
605
  role: e.role
@@ -621,13 +621,13 @@ function Le(e) {
621
621
  }
622
622
  );
623
623
  try {
624
- return Vt({
624
+ return jt({
625
625
  value: e.value,
626
626
  metadata: e.presentation.metadata,
627
627
  format: e.presentation.resolved.format
628
628
  });
629
629
  } catch (r) {
630
- throw r instanceof Ut ? new L(
630
+ throw r instanceof Gt ? new L(
631
631
  r.code,
632
632
  r.message,
633
633
  {
@@ -645,16 +645,16 @@ class S extends Error {
645
645
  function ze() {
646
646
  return { type: "raw_temporal", presentation: { mode: "auto" } };
647
647
  }
648
- function cr(e) {
648
+ function sr(e) {
649
649
  if (e.locale || e.relative || e.timezone && e.timezone !== "auto" || e.sourceTimezone && e.sourceTimezone !== "auto" || e.prefix || e.suffix)
650
650
  throw new S(
651
651
  "invalid_raw_temporal_format",
652
652
  "Activated raw temporal presentation contains unsupported locale, relative-time, timezone, prefix, or suffix settings."
653
653
  );
654
654
  }
655
- function qe(e) {
655
+ function Ve(e) {
656
656
  const r = e.format;
657
- if ((r == null ? void 0 : r.type) === "date" && (cr(r), r.pattern))
657
+ if ((r == null ? void 0 : r.type) === "date" && (sr(r), r.pattern))
658
658
  return {
659
659
  type: "raw_temporal",
660
660
  presentation: {
@@ -723,17 +723,17 @@ function be(e) {
723
723
  presentation: { mode: "auto" }
724
724
  };
725
725
  }
726
- function so(e) {
726
+ function fo(e) {
727
727
  return e === "instant" ? "yyyy-MM-dd'T'HH:mm:ssXXX" : e === "wall_datetime" ? "yyyy-MM-dd'T'HH:mm:ss" : "yyyy-MM-dd";
728
728
  }
729
- function mo(e) {
730
- Ot({
729
+ function po(e) {
730
+ Nt({
731
731
  dialect: "date_fns",
732
732
  pattern: e.pattern,
733
733
  valueKind: e.valueKind
734
734
  });
735
735
  }
736
- function lr(e) {
736
+ function dr(e) {
737
737
  const r = be(e.settings);
738
738
  if (!r)
739
739
  throw new S(
@@ -758,9 +758,9 @@ function lr(e) {
758
758
  );
759
759
  return a.text;
760
760
  }
761
- function uo(e) {
761
+ function yo(e) {
762
762
  try {
763
- return { ok: !0, text: lr(e) };
763
+ return { ok: !0, text: dr(e) };
764
764
  } catch (r) {
765
765
  return {
766
766
  ok: !1,
@@ -768,14 +768,14 @@ function uo(e) {
768
768
  };
769
769
  }
770
770
  }
771
- function Ve(e) {
771
+ function qe(e) {
772
772
  var t;
773
773
  const r = e.effectiveCardConfig ?? e.card.config;
774
774
  return ne(e.card, r) === "freeform" && !!((t = e.card.sql) != null && t.trim()) && !Z(e.card.python || "").trim();
775
775
  }
776
- function sr(e) {
776
+ function mr(e) {
777
777
  var r, t;
778
- return e.type !== "table" && e.type !== "detailTable" || !Ve({ card: e }) ? !1 : Object.values(
778
+ return e.type !== "table" && e.type !== "detailTable" || !qe({ card: e }) ? !1 : Object.values(
779
779
  ((t = (r = e.preferences) == null ? void 0 : r.tablePrefs) == null ? void 0 : t.columnSettingsMap) || {}
780
780
  ).some(
781
781
  (n) => {
@@ -784,9 +784,9 @@ function sr(e) {
784
784
  }
785
785
  );
786
786
  }
787
- function fo(e) {
787
+ function ho(e) {
788
788
  var t, n, o;
789
- if (!sr(e)) return e;
789
+ if (!mr(e)) return e;
790
790
  const r = ((n = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : n.columnSettingsMap) || {};
791
791
  return {
792
792
  ...e,
@@ -796,10 +796,10 @@ function fo(e) {
796
796
  ...(o = e.preferences) == null ? void 0 : o.tablePrefs,
797
797
  columnSettingsMap: Object.fromEntries(
798
798
  Object.entries(r).map(([a, i]) => {
799
- var l, d, c;
799
+ var c, d, l;
800
800
  return [
801
801
  a,
802
- i.type === "date" && ((l = i.dateFormat) == null ? void 0 : l.useRelativeTime) !== !0 && ((d = i.dateFormat) == null ? void 0 : d.useCustomFormat) === !0 && !((c = i.dateFormat.customFormat) != null && c.trim()) ? {
802
+ i.type === "date" && ((c = i.dateFormat) == null ? void 0 : c.useRelativeTime) !== !0 && ((d = i.dateFormat) == null ? void 0 : d.useCustomFormat) === !0 && !((l = i.dateFormat.customFormat) != null && l.trim()) ? {
803
803
  ...i,
804
804
  dateFormat: {
805
805
  ...i.dateFormat,
@@ -815,7 +815,7 @@ function fo(e) {
815
815
  }
816
816
  };
817
817
  }
818
- function dr() {
818
+ function ur() {
819
819
  return {
820
820
  activatedColumnKeys: /* @__PURE__ */ new Set(),
821
821
  byColumnKey: /* @__PURE__ */ new Map(),
@@ -825,7 +825,7 @@ function dr() {
825
825
  function ue(e, r) {
826
826
  return e === void 0 ? { kind: "invalid", error: r } : {
827
827
  kind: "invalid",
828
- error: e instanceof S ? e : e instanceof Bt ? new S(
828
+ error: e instanceof S ? e : e instanceof Kt ? new S(
829
829
  e.code,
830
830
  e.message,
831
831
  r.context
@@ -836,7 +836,7 @@ function ue(e, r) {
836
836
  )
837
837
  };
838
838
  }
839
- function mr(e) {
839
+ function fr(e) {
840
840
  var o;
841
841
  if (e.cardType !== "detailTable" || e.resultOwner !== "config")
842
842
  return { kind: "inactive" };
@@ -858,25 +858,25 @@ function mr(e) {
858
858
  s.id,
859
859
  s
860
860
  ])
861
- ), l = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
861
+ ), c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
862
862
  for (const s of a) {
863
863
  const u = Array.from(i).flatMap(
864
- ([w, E]) => {
865
- const _ = V(
864
+ ([w, k]) => {
865
+ const _ = q(
866
866
  n,
867
867
  w,
868
868
  "detail"
869
869
  );
870
- return _ && _.role === "detail" && (_.outputKey ?? _.rawKey) === s.key ? [{ field: E, binding: _ }] : [];
870
+ return _ && _.role === "detail" && (_.outputKey ?? _.rawKey) === s.key ? [{ field: k, binding: _ }] : [];
871
871
  }
872
- ), p = u.length === 1 ? u[0] : null;
873
- if (!p || typeof p.binding.rawKey != "string" || p.binding.rawKey.trim().length === 0 || p.binding.outputKey !== void 0 && (typeof p.binding.outputKey != "string" || p.binding.outputKey.trim().length === 0))
872
+ ), f = u.length === 1 ? u[0] : null;
873
+ if (!f || typeof f.binding.rawKey != "string" || f.binding.rawKey.trim().length === 0 || f.binding.outputKey !== void 0 && (typeof f.binding.outputKey != "string" || f.binding.outputKey.trim().length === 0))
874
874
  throw new S(
875
875
  "missing_raw_temporal_column_binding",
876
876
  `Raw temporal result column "${s.key}" does not have one valid exact detail result binding.`,
877
877
  { columnKey: s.key }
878
878
  );
879
- const { field: m, binding: g } = p, y = g.outputKey ?? g.rawKey, b = Ke(s, {
879
+ const { field: m, binding: g } = f, y = g.outputKey ?? g.rawKey, b = Ke(s, {
880
880
  metadataRequired: !0
881
881
  });
882
882
  if (!b)
@@ -886,7 +886,7 @@ function mr(e) {
886
886
  { fieldId: m.id, columnKey: y }
887
887
  );
888
888
  const C = W({
889
- format: qe(m),
889
+ format: Ve(m),
890
890
  preferences: e.preferences,
891
891
  calendar: e.calendar
892
892
  }), v = {
@@ -903,14 +903,14 @@ function mr(e) {
903
903
  `Raw temporal result row ${w} is missing column "${y}".`,
904
904
  { fieldId: m.id, columnKey: y }
905
905
  );
906
- l.set(y, v), d.set(m.id, v);
906
+ c.set(y, v), d.set(m.id, v);
907
907
  }
908
- const c = {
909
- activatedColumnKeys: new Set(l.keys()),
910
- byColumnKey: l,
908
+ const l = {
909
+ activatedColumnKeys: new Set(c.keys()),
910
+ byColumnKey: c,
911
911
  byFieldId: d
912
912
  };
913
- return r.length === 0 ? { kind: "loaded_empty", presentation: c } : { kind: "loaded_valid", presentation: c };
913
+ return r.length === 0 ? { kind: "loaded_empty", presentation: l } : { kind: "loaded_valid", presentation: l };
914
914
  } catch (a) {
915
915
  return ue(
916
916
  a,
@@ -921,22 +921,22 @@ function mr(e) {
921
921
  );
922
922
  }
923
923
  }
924
- function ur(e) {
924
+ function pr(e) {
925
925
  var n, o, a;
926
926
  const r = e.effectiveCardConfig ?? e.card.config, t = ne(
927
927
  e.card,
928
928
  r
929
929
  );
930
930
  if (e.card.type === "detailTable" && t === "config") {
931
- const i = !!((n = e.columns) != null && n.some((l) => l.rawTemporal));
931
+ const i = !!((n = e.columns) != null && n.some((c) => c.rawTemporal));
932
932
  return i && e.records !== void 0 && !e.columnKeyMap ? {
933
933
  kind: "invalid",
934
934
  error: new S(
935
935
  "missing_raw_temporal_result_contract",
936
936
  "Activated raw temporal detail results require records, columns, and columnKeyMap atomically."
937
937
  )
938
- } : e.records !== void 0 && !i ? { kind: "inactive" } : ke(
939
- mr({
938
+ } : e.records !== void 0 && !i ? { kind: "inactive" } : Ee(
939
+ fr({
940
940
  cardType: e.card.type,
941
941
  resultOwner: t,
942
942
  effectiveCardConfig: r,
@@ -951,8 +951,8 @@ function ur(e) {
951
951
  e
952
952
  );
953
953
  }
954
- return ke(
955
- fr({
954
+ return Ee(
955
+ yr({
956
956
  resultOwner: t,
957
957
  sql: e.card.sql,
958
958
  normalizedPython: Z(
@@ -967,22 +967,22 @@ function ur(e) {
967
967
  e
968
968
  );
969
969
  }
970
- function po(e) {
970
+ function go(e) {
971
971
  var n, o, a;
972
972
  const r = e.effectiveCardConfig ?? e.card.config, t = ne(
973
973
  e.card,
974
974
  r
975
975
  );
976
- return e.card.type === "detailTable" && t === "config" ? !!((n = e.columns) != null && n.some((i) => i.rawTemporal)) : Ve(e) ? Object.values(
976
+ return e.card.type === "detailTable" && t === "config" ? !!((n = e.columns) != null && n.some((i) => i.rawTemporal)) : qe(e) ? Object.values(
977
977
  ((a = (o = e.card.preferences) == null ? void 0 : o.tablePrefs) == null ? void 0 : a.columnSettingsMap) || {}
978
978
  ).some(
979
979
  (i) => {
980
- var l;
981
- return i.type === "date" && !((l = i.dateFormat) != null && l.useRelativeTime);
980
+ var c;
981
+ return i.type === "date" && !((c = i.dateFormat) != null && c.useRelativeTime);
982
982
  }
983
983
  ) : !1;
984
984
  }
985
- function ke(e, r) {
985
+ function Ee(e, r) {
986
986
  if (!r.executionSnapshot || e.kind === "inactive" || e.kind === "loading" || e.kind === "invalid")
987
987
  return e;
988
988
  if (!r.dashboardId)
@@ -995,7 +995,7 @@ function ke(e, r) {
995
995
  };
996
996
  const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
997
997
  for (const o of e.presentation.activatedColumnKeys) {
998
- const a = $t({
998
+ const a = Tt({
999
999
  snapshot: r.executionSnapshot,
1000
1000
  scope: {
1001
1001
  dashboardId: r.dashboardId,
@@ -1007,11 +1007,11 @@ function ke(e, r) {
1007
1007
  if (!a)
1008
1008
  return {
1009
1009
  kind: "invalid",
1010
- error: new xt(o)
1010
+ error: new wt(o)
1011
1011
  };
1012
1012
  const i = e.presentation.byColumnKey.get(o);
1013
1013
  if (!i) continue;
1014
- const l = {
1014
+ const c = {
1015
1015
  ...i,
1016
1016
  format: a,
1017
1017
  formatValue: re({
@@ -1019,7 +1019,7 @@ function ke(e, r) {
1019
1019
  format: a
1020
1020
  })
1021
1021
  };
1022
- t.set(i.columnKey, l), i.fieldId && n.set(i.fieldId, l);
1022
+ t.set(i.columnKey, c), i.fieldId && n.set(i.fieldId, c);
1023
1023
  }
1024
1024
  return {
1025
1025
  ...e,
@@ -1030,7 +1030,7 @@ function ke(e, r) {
1030
1030
  }
1031
1031
  };
1032
1032
  }
1033
- function fr(e) {
1033
+ function yr(e) {
1034
1034
  var t, n;
1035
1035
  if (e.resultOwner !== "freeform" || !((t = e.sql) != null && t.trim()) || (n = e.normalizedPython) != null && n.trim())
1036
1036
  return { kind: "inactive" };
@@ -1046,81 +1046,81 @@ function fr(e) {
1046
1046
  if (!e.records) return { kind: "loading" };
1047
1047
  try {
1048
1048
  const o = /* @__PURE__ */ new Map(), a = new Set(
1049
- r.map(([c]) => c)
1050
- ), i = /* @__PURE__ */ new Map(), l = [...e.columns || []];
1051
- for (const [c, s] of r) {
1049
+ r.map(([l]) => l)
1050
+ ), i = /* @__PURE__ */ new Map(), c = [...e.columns || []];
1051
+ for (const [l, s] of r) {
1052
1052
  const u = be(
1053
1053
  s.dateFormat
1054
1054
  );
1055
1055
  if (!u) continue;
1056
- const p = Pt({
1057
- columnKey: c,
1056
+ const f = Bt({
1057
+ columnKey: l,
1058
1058
  values: e.records.map((b) => {
1059
- if (!Object.prototype.hasOwnProperty.call(b, c))
1059
+ if (!Object.prototype.hasOwnProperty.call(b, l))
1060
1060
  throw new S(
1061
1061
  "missing_raw_temporal_result_contract",
1062
- `Declared SQL temporal column "${c}" is absent from a physical result row.`,
1063
- { columnKey: c }
1062
+ `Declared SQL temporal column "${l}" is absent from a physical result row.`,
1063
+ { columnKey: l }
1064
1064
  );
1065
- const C = b[c];
1065
+ const C = b[l];
1066
1066
  return C === null || typeof C == "string" ? C : String(C);
1067
1067
  })
1068
1068
  });
1069
- if (i.set(c, p), p.status !== "classified") continue;
1070
- let m = l.findIndex(
1071
- (b) => b.key === c
1069
+ if (i.set(l, f), f.status !== "classified") continue;
1070
+ let m = c.findIndex(
1071
+ (b) => b.key === l
1072
1072
  );
1073
1073
  if (e.columns && m < 0)
1074
1074
  throw new S(
1075
1075
  "missing_raw_temporal_result_contract",
1076
- `Classified SQL temporal column "${c}" is absent from result columns.`,
1077
- { columnKey: c }
1076
+ `Classified SQL temporal column "${l}" is absent from result columns.`,
1077
+ { columnKey: l }
1078
1078
  );
1079
- m < 0 && (m = l.length, l.push({
1080
- key: c,
1081
- name: c,
1082
- label: c,
1079
+ m < 0 && (m = c.length, c.push({
1080
+ key: l,
1081
+ name: l,
1082
+ label: l,
1083
1083
  role: "dimension",
1084
1084
  dataType: "string"
1085
1085
  }));
1086
1086
  const g = {
1087
- ...l[m],
1087
+ ...c[m],
1088
1088
  role: "date",
1089
- dataType: p.metadata.valueKind === "date" ? "date" : "datetime",
1090
- rawTemporal: p.metadata
1089
+ dataType: f.metadata.valueKind === "date" ? "date" : "datetime",
1090
+ rawTemporal: f.metadata
1091
1091
  };
1092
1092
  Ke(g, {
1093
1093
  metadataRequired: !0
1094
- }), l[m] = g;
1094
+ }), c[m] = g;
1095
1095
  const y = W({
1096
1096
  format: u,
1097
1097
  preferences: e.preferences,
1098
1098
  calendar: e.calendar
1099
1099
  });
1100
- o.set(c, {
1101
- columnKey: c,
1102
- metadata: p.metadata,
1100
+ o.set(l, {
1101
+ columnKey: l,
1102
+ metadata: f.metadata,
1103
1103
  format: y,
1104
1104
  formatValue: re({
1105
- metadata: p.metadata,
1105
+ metadata: f.metadata,
1106
1106
  format: y
1107
1107
  })
1108
1108
  });
1109
1109
  }
1110
1110
  const d = {
1111
- ...dr(),
1111
+ ...ur(),
1112
1112
  activatedColumnKeys: a,
1113
1113
  byColumnKey: o
1114
1114
  };
1115
1115
  return e.records.length === 0 ? {
1116
1116
  kind: "loaded_empty",
1117
1117
  presentation: d,
1118
- adaptedColumns: l,
1118
+ adaptedColumns: c,
1119
1119
  sqlClassifications: i
1120
1120
  } : {
1121
1121
  kind: "loaded_valid",
1122
1122
  presentation: d,
1123
- adaptedColumns: l,
1123
+ adaptedColumns: c,
1124
1124
  sqlClassifications: i
1125
1125
  };
1126
1126
  } catch (o) {
@@ -1133,7 +1133,7 @@ function fr(e) {
1133
1133
  );
1134
1134
  }
1135
1135
  }
1136
- function yo(e) {
1136
+ function vo(e) {
1137
1137
  if (e.value !== null && typeof e.value != "string")
1138
1138
  return {
1139
1139
  value: e.value,
@@ -1150,11 +1150,11 @@ function yo(e) {
1150
1150
  const r = e.presentation.formatValue(e.value);
1151
1151
  return { value: e.value, label: r.text, result: r };
1152
1152
  }
1153
- function ho(e) {
1153
+ function bo(e) {
1154
1154
  if (!e.result || typeof e.result != "object") return !1;
1155
1155
  const r = e.result;
1156
1156
  if (e.expectedResultOwner !== void 0 && r.resultOwner !== e.expectedResultOwner || !Array.isArray(r.records)) return !1;
1157
- const t = ur({
1157
+ const t = pr({
1158
1158
  card: e.card,
1159
1159
  effectiveCardConfig: e.effectiveCardConfig,
1160
1160
  records: r.records,
@@ -1165,36 +1165,36 @@ function ho(e) {
1165
1165
  });
1166
1166
  return t.kind === "inactive" || t.kind === "loaded_empty" || t.kind === "loaded_valid";
1167
1167
  }
1168
- function Ee(e) {
1168
+ function ke(e) {
1169
1169
  return !e || typeof e != "object" ? !1 : Array.isArray(e.cards);
1170
1170
  }
1171
- function pr(e) {
1171
+ function hr(e) {
1172
1172
  if (!e)
1173
1173
  return null;
1174
1174
  if (typeof e == "string")
1175
1175
  try {
1176
1176
  const r = JSON.parse(e);
1177
- return Ee(r) ? r : null;
1177
+ return ke(r) ? r : null;
1178
1178
  } catch {
1179
1179
  return null;
1180
1180
  }
1181
- return Ee(e) ? e : null;
1181
+ return ke(e) ? e : null;
1182
1182
  }
1183
1183
  function Ue(e) {
1184
1184
  var r;
1185
1185
  return (r = e == null ? void 0 : e.cards) != null && r.length ? e.activeCardId && e.cards.find((t) => t.id === e.activeCardId) || e.cards[0] : null;
1186
1186
  }
1187
- function go(e) {
1187
+ function Io(e) {
1188
1188
  var t;
1189
1189
  const r = (e == null ? void 0 : e.frameObject) ?? ((t = e == null ? void 0 : e.visual) == null ? void 0 : t.frameObject);
1190
- return Ue(pr(r));
1190
+ return Ue(hr(r));
1191
1191
  }
1192
1192
  function Ie(e) {
1193
1193
  if (!(e != null && e.expectedType)) return "table";
1194
1194
  const r = Array.isArray(e.expectedType) ? e.expectedType[0] : e.expectedType;
1195
- return hr(r) ? r : "table";
1195
+ return vr(r) ? r : "table";
1196
1196
  }
1197
- const yr = [
1197
+ const gr = [
1198
1198
  "bar",
1199
1199
  "horizontalBar",
1200
1200
  "line",
@@ -1225,8 +1225,8 @@ const yr = [
1225
1225
  "treemap",
1226
1226
  "custom"
1227
1227
  ];
1228
- function hr(e) {
1229
- return yr.includes(e);
1228
+ function vr(e) {
1229
+ return gr.includes(e);
1230
1230
  }
1231
1231
  function Y(e) {
1232
1232
  const r = e.position;
@@ -1277,14 +1277,14 @@ function Ge(e, r) {
1277
1277
  return (u == null ? void 0 : u.kind) === "number" && u.start === r;
1278
1278
  });
1279
1279
  if (a) return a;
1280
- const l = n.sort(
1280
+ const c = n.sort(
1281
1281
  (s, u) => Y(s) - Y(u)
1282
1282
  ).find((s) => {
1283
1283
  const u = H(s.position);
1284
1284
  return (u == null ? void 0 : u.kind) === "range" && r >= u.start && r <= u.end;
1285
1285
  });
1286
- if (l) return l;
1287
- const c = o.map((s) => ({
1286
+ if (c) return c;
1287
+ const l = o.map((s) => ({
1288
1288
  slot: s,
1289
1289
  parsed: H(s.position)
1290
1290
  })).filter((s) => {
@@ -1292,26 +1292,26 @@ function Ge(e, r) {
1292
1292
  return ((u = s.parsed) == null ? void 0 : u.kind) === "dynamic";
1293
1293
  }).sort(
1294
1294
  (s, u) => {
1295
- var p, m;
1296
- return (((p = s.parsed) == null ? void 0 : p.start) ?? 0) - (((m = u.parsed) == null ? void 0 : m.start) ?? 0);
1295
+ var f, m;
1296
+ return (((f = s.parsed) == null ? void 0 : f.start) ?? 0) - (((m = u.parsed) == null ? void 0 : m.start) ?? 0);
1297
1297
  }
1298
1298
  ).filter((s) => {
1299
1299
  var u;
1300
1300
  return r >= (((u = s.parsed) == null ? void 0 : u.start) ?? 0);
1301
1301
  }).sort(
1302
1302
  (s, u) => {
1303
- var p, m;
1304
- return (((p = u.parsed) == null ? void 0 : p.start) ?? 0) - (((m = s.parsed) == null ? void 0 : m.start) ?? 0);
1303
+ var f, m;
1304
+ return (((f = u.parsed) == null ? void 0 : f.start) ?? 0) - (((m = s.parsed) == null ? void 0 : m.start) ?? 0);
1305
1305
  }
1306
1306
  )[0];
1307
- return c == null ? void 0 : c.slot;
1307
+ return l == null ? void 0 : l.slot;
1308
1308
  }
1309
- function gr(e, r) {
1309
+ function br(e, r) {
1310
1310
  const t = Ge(e, r);
1311
1311
  if (t)
1312
1312
  return Ie(t);
1313
1313
  }
1314
- function vr(e, r) {
1314
+ function Ir(e, r) {
1315
1315
  var n;
1316
1316
  const t = (n = e == null ? void 0 : e.customCardPreferences) == null ? void 0 : n.slotIndex;
1317
1317
  return typeof t == "number" ? t : r;
@@ -1334,18 +1334,18 @@ function Se(e, r) {
1334
1334
  }
1335
1335
  return !1;
1336
1336
  }
1337
- function br(e) {
1337
+ function Cr(e) {
1338
1338
  const r = [];
1339
1339
  let t = -1;
1340
1340
  e.forEach((n, o) => {
1341
- const a = vr(n, o);
1341
+ const a = Ir(n, o);
1342
1342
  a > t && (t = a), r[a] = n ?? null;
1343
1343
  });
1344
1344
  for (let n = 0; n <= t; n += 1)
1345
1345
  n in r || (r[n] = null);
1346
1346
  return r;
1347
1347
  }
1348
- function vo(e) {
1348
+ function Co(e) {
1349
1349
  return e.map((r, t) => !r.customCardPreferences || r.customCardPreferences.slotIndex === t ? r : {
1350
1350
  ...r,
1351
1351
  customCardPreferences: {
@@ -1354,17 +1354,17 @@ function vo(e) {
1354
1354
  }
1355
1355
  });
1356
1356
  }
1357
- function bo(e) {
1357
+ function To(e) {
1358
1358
  const r = je(e);
1359
1359
  if (r)
1360
1360
  return Ie(r);
1361
1361
  }
1362
- function Io(e, r, t) {
1362
+ function wo(e, r, t) {
1363
1363
  if (!e) return;
1364
- const n = gr(t, r);
1364
+ const n = br(t, r);
1365
1365
  return e.type === "custom" && n ? n : e.type;
1366
1366
  }
1367
- function Co(e, r, t) {
1367
+ function $o(e, r, t) {
1368
1368
  var g;
1369
1369
  const n = {
1370
1370
  dataSource: t.dataSource,
@@ -1383,19 +1383,19 @@ function Co(e, r, t) {
1383
1383
  pluginChartType: r.chartType,
1384
1384
  minInputs: r.minInputs,
1385
1385
  maxInputs: r.maxInputs
1386
- }, a = r.minInputs || 1, l = e.map((y) => ({ slot: y, parsed: H(y.position) })).filter((y) => y.parsed !== null).reduce((y, b) => {
1386
+ }, a = r.minInputs || 1, c = e.map((y) => ({ slot: y, parsed: H(y.position) })).filter((y) => y.parsed !== null).reduce((y, b) => {
1387
1387
  const C = b.parsed.end;
1388
1388
  return Number.isFinite(C) ? Math.max(y, C) : y;
1389
- }, -1), d = Math.max(a, l + 1), c = je(e), s = c ? Y(c) : 0;
1389
+ }, -1), d = Math.max(a, c + 1), l = je(e), s = l ? Y(l) : 0;
1390
1390
  let u = !1;
1391
- const p = [];
1391
+ const f = [];
1392
1392
  for (let y = 0; y < d; y += 1) {
1393
- const b = Ge(e, y), C = Ie(b), v = !u && y === s, w = y, E = {
1393
+ const b = Ge(e, y), C = Ie(b), v = !u && y === s, w = y, k = {
1394
1394
  ...n,
1395
- id: _t(),
1396
- title: (v ? c == null ? void 0 : c.label : b == null ? void 0 : b.label) || `Tab ${y + 1}`,
1397
- tabTitle: (v ? c == null ? void 0 : c.label : b == null ? void 0 : b.label) || `Tab ${y + 1}`,
1398
- description: (v ? c == null ? void 0 : c.description : b == null ? void 0 : b.description) || "",
1395
+ id: Rt(),
1396
+ title: (v ? l == null ? void 0 : l.label : b == null ? void 0 : b.label) || `Tab ${y + 1}`,
1397
+ tabTitle: (v ? l == null ? void 0 : l.label : b == null ? void 0 : b.label) || `Tab ${y + 1}`,
1398
+ description: (v ? l == null ? void 0 : l.description : b == null ? void 0 : b.description) || "",
1399
1399
  type: C,
1400
1400
  sql: "",
1401
1401
  preferences: {
@@ -1413,32 +1413,32 @@ function Co(e, r, t) {
1413
1413
  }
1414
1414
  }
1415
1415
  };
1416
- v && (u = !0), p.push(E);
1416
+ v && (u = !0), f.push(k);
1417
1417
  }
1418
- if (!u && p.length > 0) {
1419
- const y = ((g = p[0].customCardPreferences) == null ? void 0 : g.slotIndex) ?? 0;
1420
- p[0] = {
1421
- ...p[0],
1422
- type: p[0].type,
1418
+ if (!u && f.length > 0) {
1419
+ const y = ((g = f[0].customCardPreferences) == null ? void 0 : g.slotIndex) ?? 0;
1420
+ f[0] = {
1421
+ ...f[0],
1422
+ type: f[0].type,
1423
1423
  customCardPreferences: {
1424
1424
  ...o,
1425
1425
  slotIndex: y
1426
1426
  }
1427
1427
  };
1428
1428
  }
1429
- const m = p.findIndex(
1429
+ const m = f.findIndex(
1430
1430
  (y) => {
1431
1431
  var b;
1432
1432
  return !!((b = y.customCardPreferences) != null && b.url);
1433
1433
  }
1434
1434
  );
1435
1435
  if (m > 0) {
1436
- const [y] = p.splice(m, 1);
1437
- p.unshift(y);
1436
+ const [y] = f.splice(m, 1);
1437
+ f.unshift(y);
1438
1438
  }
1439
- return p;
1439
+ return f;
1440
1440
  }
1441
- function Ir({
1441
+ function Tr({
1442
1442
  frame: e,
1443
1443
  configCard: r,
1444
1444
  isMultiInputVisual: t
@@ -1448,15 +1448,15 @@ function Ir({
1448
1448
  return e.cards;
1449
1449
  const n = (o = r.customCardPreferences) == null ? void 0 : o.dataInputCardIds;
1450
1450
  return n ? Object.keys(n).sort((a, i) => Number(a) - Number(i)).map((a) => {
1451
- var l;
1452
- const i = (l = n[a]) == null ? void 0 : l.cardId;
1451
+ var c;
1452
+ const i = (c = n[a]) == null ? void 0 : c.cardId;
1453
1453
  return e.cards.find((d) => d.id === i) || null;
1454
1454
  }) : e.cards;
1455
1455
  }
1456
- function Cr(e, r) {
1456
+ function wr(e, r) {
1457
1457
  return r && Se(r, e.cards) ? r : e.cards.find((t) => Se(t, e.cards)) || null;
1458
1458
  }
1459
- function Tr(e, r) {
1459
+ function $r(e, r) {
1460
1460
  var o, a;
1461
1461
  if (!e) return null;
1462
1462
  const t = r == null ? void 0 : r.visualType;
@@ -1466,10 +1466,10 @@ function Tr(e, r) {
1466
1466
  const n = (o = e.customCardPreferences) == null ? void 0 : o.visualType;
1467
1467
  return n || ((a = e.customCardPreferences) != null && a.dataInputCardIds ? "multiple" : null);
1468
1468
  }
1469
- function To(e) {
1469
+ function xo(e) {
1470
1470
  return e.visualType === "multiple" || e.slots && e.slots.length > 0 || (e.minInputs || 0) > 1 || (e.maxInputs || 0) > 1 || (e.dataInputs || []).length > 1 ? "multiple" : "single";
1471
1471
  }
1472
- function wo(e) {
1472
+ function Eo(e) {
1473
1473
  return Array.isArray(e) ? { records: e } : e;
1474
1474
  }
1475
1475
  class Q extends Error {
@@ -1483,7 +1483,7 @@ class Q extends Error {
1483
1483
  this.name = "TemporalSnapshotSelectionError", this.selection = t;
1484
1484
  }
1485
1485
  }
1486
- function wr(e, r) {
1486
+ function xr(e, r) {
1487
1487
  var o;
1488
1488
  const t = [], n = /* @__PURE__ */ new Map();
1489
1489
  for (const a of r) {
@@ -1494,60 +1494,60 @@ function wr(e, r) {
1494
1494
  );
1495
1495
  if (a.sheetId && i.length === 0)
1496
1496
  throw new Q(a);
1497
- let l = !a.cardId;
1497
+ let c = !a.cardId;
1498
1498
  for (const d of i) {
1499
- const c = (((o = d.document) == null ? void 0 : o.sections) || []).flatMap(
1500
- (p) => Mt(p)
1499
+ const l = (((o = d.document) == null ? void 0 : o.sections) || []).flatMap(
1500
+ (f) => Ot(f)
1501
1501
  ), s = (d.frames || []).flatMap(
1502
- (p) => $r(p, a.cardId)
1502
+ (f) => Er(f, a.cardId)
1503
1503
  );
1504
- s.length > 0 && (l = !0);
1504
+ s.length > 0 && (c = !0);
1505
1505
  const u = [
1506
1506
  ...s,
1507
1507
  ...(d.cards || []).filter(
1508
- (p) => !a.cardId || a.cardId === p.id
1508
+ (f) => !a.cardId || a.cardId === f.id
1509
1509
  ),
1510
- ...c.filter(
1511
- (p) => !a.cardId || a.cardId === p.id
1510
+ ...l.filter(
1511
+ (f) => !a.cardId || a.cardId === f.id
1512
1512
  )
1513
1513
  ];
1514
- for (const p of u) {
1515
- l = !0;
1514
+ for (const f of u) {
1515
+ c = !0;
1516
1516
  const m = n.get(a.attachmentIndex) ?? /* @__PURE__ */ new Set();
1517
- m.has(p.id) || (m.add(p.id), n.set(a.attachmentIndex, m), t.push({
1518
- card: p,
1517
+ m.has(f.id) || (m.add(f.id), n.set(a.attachmentIndex, m), t.push({
1518
+ card: f,
1519
1519
  ...a.attachmentIndex !== void 0 ? { attachmentIndex: a.attachmentIndex } : {}
1520
1520
  }));
1521
1521
  }
1522
1522
  }
1523
- if (!l)
1523
+ if (!c)
1524
1524
  throw new Q(a);
1525
1525
  }
1526
1526
  return t;
1527
1527
  }
1528
- function $r(e, r) {
1528
+ function Er(e, r) {
1529
1529
  var i;
1530
- const t = r ? (i = e.cards) == null ? void 0 : i.find((l) => l.id === r) : Ue(e);
1530
+ const t = r ? (i = e.cards) == null ? void 0 : i.find((c) => c.id === r) : Ue(e);
1531
1531
  if (!t) return [];
1532
- const n = Cr(e, t), o = (e.cards || []).filter(
1533
- (l) => {
1532
+ const n = wr(e, t), o = (e.cards || []).filter(
1533
+ (c) => {
1534
1534
  var d;
1535
- return typeof ((d = l.customCardPreferences) == null ? void 0 : d.slotIndex) == "number";
1535
+ return typeof ((d = c.customCardPreferences) == null ? void 0 : d.slotIndex) == "number";
1536
1536
  }
1537
- ).length > 1, a = n != null && (Tr(n) === "multiple" || o);
1538
- return !n || !a ? [t] : br(
1539
- Ir({
1537
+ ).length > 1, a = n != null && ($r(n) === "multiple" || o);
1538
+ return !n || !a ? [t] : Cr(
1539
+ Tr({
1540
1540
  frame: e,
1541
1541
  configCard: n,
1542
1542
  isMultiInputVisual: !0
1543
1543
  })
1544
- ).filter((l) => l !== null);
1544
+ ).filter((c) => c !== null);
1545
1545
  }
1546
- function $o(e) {
1547
- return wr(e.dashboard, e.selections).flatMap(
1546
+ function ko(e) {
1547
+ return xr(e.dashboard, e.selections).flatMap(
1548
1548
  ({ card: r, attachmentIndex: t }) => {
1549
- var s, u, p, m;
1550
- const n = ((s = e.resolveCardConfig) == null ? void 0 : s.call(e, r)) ?? r.config, o = Jt({
1549
+ var s, u, f, m;
1550
+ const n = ((s = e.resolveCardConfig) == null ? void 0 : s.call(e, r)) ?? r.config, o = tr({
1551
1551
  card: r,
1552
1552
  cardConfig: n
1553
1553
  }), a = {
@@ -1561,7 +1561,7 @@ function $o(e) {
1561
1561
  fieldId: g.id,
1562
1562
  role: g.role
1563
1563
  },
1564
- format: ir(
1564
+ format: lr(
1565
1565
  g,
1566
1566
  {
1567
1567
  dateStyle: e.valueFormatPreferences.dateStyle,
@@ -1569,7 +1569,7 @@ function $o(e) {
1569
1569
  },
1570
1570
  e.valueFormatPreferences.locale
1571
1571
  )
1572
- })) : [], l = [], d = ne(r, n), c = Z(
1572
+ })) : [], c = [], d = ne(r, n), l = Z(
1573
1573
  r.python || ""
1574
1574
  );
1575
1575
  if (r.type === "detailTable" && d === "config") {
@@ -1592,7 +1592,7 @@ function $o(e) {
1592
1592
  }))
1593
1593
  ], b = /* @__PURE__ */ new Map(), C = new Set(
1594
1594
  y.map(
1595
- ({ field: v, role: w }) => Gt(v, w)
1595
+ ({ field: v, role: w }) => Wt(v, w)
1596
1596
  )
1597
1597
  );
1598
1598
  for (const { field: v } of y) {
@@ -1602,32 +1602,32 @@ function $o(e) {
1602
1602
  for (const v of g) {
1603
1603
  const w = Ae(v.dataType);
1604
1604
  if (w !== "date" && w !== "datetime") continue;
1605
- const E = Ht(v), _ = v.label, M = Wt({
1605
+ const k = Yt(v), _ = v.label, M = Zt({
1606
1606
  label: _,
1607
1607
  labelCount: _ && b.get(_) || 0,
1608
- rawKey: E,
1608
+ rawKey: k,
1609
1609
  rawKeys: C
1610
1610
  });
1611
1611
  if (!M) throw new Q(a);
1612
- l.push({
1612
+ c.push({
1613
1613
  scope: a,
1614
1614
  target: { kind: "column", columnKey: M },
1615
1615
  format: W({
1616
- format: qe(v),
1616
+ format: Ve(v),
1617
1617
  preferences: e.valueFormatPreferences,
1618
1618
  calendar: e.calendar
1619
1619
  })
1620
1620
  });
1621
1621
  }
1622
- } else if (d === "freeform" && ((u = r.sql) != null && u.trim()) && !c.trim())
1622
+ } else if (d === "freeform" && ((u = r.sql) != null && u.trim()) && !l.trim())
1623
1623
  for (const [g, y] of Object.entries(
1624
- ((m = (p = r.preferences) == null ? void 0 : p.tablePrefs) == null ? void 0 : m.columnSettingsMap) || {}
1624
+ ((m = (f = r.preferences) == null ? void 0 : f.tablePrefs) == null ? void 0 : m.columnSettingsMap) || {}
1625
1625
  )) {
1626
1626
  if (y.type !== "date") continue;
1627
1627
  const b = be(
1628
1628
  y.dateFormat
1629
1629
  );
1630
- b && l.push({
1630
+ b && c.push({
1631
1631
  scope: a,
1632
1632
  target: { kind: "column", columnKey: g },
1633
1633
  format: W({
@@ -1637,16 +1637,16 @@ function $o(e) {
1637
1637
  })
1638
1638
  });
1639
1639
  }
1640
- return [...i, ...l];
1640
+ return [...i, ...c];
1641
1641
  }
1642
1642
  );
1643
1643
  }
1644
- const xr = /* @__PURE__ */ new Set([
1644
+ const kr = /* @__PURE__ */ new Set([
1645
1645
  "table",
1646
1646
  "aggregateTable",
1647
1647
  "pivotTable",
1648
1648
  "detailTable"
1649
- ]), kr = /* @__PURE__ */ new Set([
1649
+ ]), Sr = /* @__PURE__ */ new Set([
1650
1650
  "bar",
1651
1651
  "horizontalBar",
1652
1652
  "line",
@@ -1677,34 +1677,34 @@ const xr = /* @__PURE__ */ new Set([
1677
1677
  "treemap",
1678
1678
  "custom"
1679
1679
  ]);
1680
- function xo(e) {
1680
+ function So(e) {
1681
1681
  var o, a, i;
1682
- const r = kr.has(e.type) && (e.type !== "custom" || !!((o = e.customCardPreferences) != null && o.url));
1682
+ const r = Sr.has(e.type) && (e.type !== "custom" || !!((o = e.customCardPreferences) != null && o.url));
1683
1683
  let t = !1;
1684
1684
  try {
1685
- t = !!Rt(e);
1685
+ t = !!Dt(e);
1686
1686
  } catch {
1687
1687
  return { formats: [], defaultFormat: null };
1688
1688
  }
1689
- return e.type === "text" || !r || !t && Ft(e) ? { formats: [], defaultFormat: null } : {
1690
- formats: Er({
1689
+ return e.type === "text" || !r || !t && At(e) ? { formats: [], defaultFormat: null } : {
1690
+ formats: _r({
1691
1691
  cardType: e.type,
1692
1692
  allowDownload: (a = e.preferences) == null ? void 0 : a.allowDownload
1693
1693
  }),
1694
- defaultFormat: Sr({
1694
+ defaultFormat: Fr({
1695
1695
  cardType: e.type,
1696
1696
  allowDownload: (i = e.preferences) == null ? void 0 : i.allowDownload
1697
1697
  })
1698
1698
  };
1699
1699
  }
1700
- function Er(e) {
1700
+ function _r(e) {
1701
1701
  return e.allowDownload === !1 ? ["pdf"] : ["pdf", "csv"];
1702
1702
  }
1703
- function Sr(e) {
1704
- return xr.has(e.cardType) && e.allowDownload !== !1 ? "csv" : "pdf";
1703
+ function Fr(e) {
1704
+ return kr.has(e.cardType) && e.allowDownload !== !1 ? "csv" : "pdf";
1705
1705
  }
1706
- function ko(e) {
1707
- const { config: r } = e, t = St({
1706
+ function _o(e) {
1707
+ const { config: r } = e, t = Ft({
1708
1708
  spec: r.spec,
1709
1709
  presentation: r.presentation,
1710
1710
  defaults: r.defaultView,
@@ -1724,7 +1724,7 @@ function ko(e) {
1724
1724
  }
1725
1725
  });
1726
1726
  }
1727
- const _r = T.object({
1727
+ const Rr = T.object({
1728
1728
  connection_id: T.string().min(1),
1729
1729
  cardType: T.literal("matrixTable"),
1730
1730
  resultOwner: T.literal("config"),
@@ -1739,7 +1739,7 @@ const _r = T.object({
1739
1739
  semanticDomainId: T.string().optional()
1740
1740
  }).passthrough(),
1741
1741
  active_filters: T.array(T.unknown()).default([])
1742
- }).passthrough(), Eo = _r.extend({
1742
+ }).passthrough(), Fo = Rr.extend({
1743
1743
  dashboardId: T.string().min(1),
1744
1744
  cardId: T.string().min(1),
1745
1745
  formatOptions: T.object({
@@ -1754,7 +1754,7 @@ const _r = T.object({
1754
1754
  });
1755
1755
  })
1756
1756
  });
1757
- function So(e) {
1757
+ function Ro(e) {
1758
1758
  return {
1759
1759
  ...e.controls,
1760
1760
  type: "card",
@@ -1774,52 +1774,46 @@ function So(e) {
1774
1774
  },
1775
1775
  active_filters: e.activeFilters,
1776
1776
  formatOptions: {
1777
- ...e.matrix.format === "csv" ? { acquisition: "continuation" } : {},
1777
+ ...e.matrix.format === "csv" ? {
1778
+ acquisition: "continuation",
1779
+ ...e.csvEncoding ? { csvEncoding: e.csvEncoding } : {}
1780
+ } : {},
1778
1781
  matrix: e.matrix,
1779
1782
  delimiter: e.delimiter,
1780
1783
  includeHeaders: e.includeHeaders,
1781
1784
  timezone: e.reportContext.calendar.tz,
1782
- presentationExecutionSnapshot: kt({
1785
+ presentationExecutionSnapshot: $t({
1783
1786
  reportContext: e.reportContext,
1784
1787
  resolvedFormats: []
1785
1788
  })
1786
1789
  }
1787
1790
  };
1788
1791
  }
1789
- const ie = T.number().int().nonnegative(), _o = T.discriminatedUnion("status", [
1792
+ const ie = T.number().int().nonnegative(), Ao = T.discriminatedUnion("status", [
1790
1793
  T.object({
1791
1794
  status: T.literal("ok"),
1792
1795
  request: ye,
1793
- layout: vt,
1794
- rows: T.array(bt).readonly(),
1796
+ layout: kt,
1797
+ rows: T.array(St).readonly(),
1795
1798
  usage: T.object({ rows: ie, cells: ie, bytes: ie }).strict()
1796
1799
  }).strict(),
1797
1800
  T.object({
1798
1801
  status: T.literal("failed"),
1799
1802
  failure: T.object({
1800
- code: T.enum([
1801
- "invalid_request",
1802
- "unsupported_capability",
1803
- "stale_cursor",
1804
- "forbidden",
1805
- "budget_exceeded",
1806
- "source_truncated",
1807
- "execution_failed",
1808
- "cancelled"
1809
- ]),
1803
+ code: T.enum(_t),
1810
1804
  limit: T.enum(["rows", "bytes"]).optional(),
1811
1805
  message: T.string().min(1),
1812
1806
  retryable: T.boolean()
1813
1807
  }).strict()
1814
1808
  }).strict()
1815
1809
  ]);
1816
- function Fr(e) {
1810
+ function Ar(e) {
1817
1811
  return !!e && typeof e == "object" && !Array.isArray(e);
1818
1812
  }
1819
1813
  function P(e, r, t) {
1820
- return Fr(e) ? e : (t.push({ field: r, message: "Expected an object." }), {});
1814
+ return Ar(e) ? e : (t.push({ field: r, message: "Expected an object." }), {});
1821
1815
  }
1822
- function B(e, r, t, n) {
1816
+ function O(e, r, t, n) {
1823
1817
  const o = new Set(t);
1824
1818
  Object.keys(e).forEach((a) => {
1825
1819
  o.has(a) || n.push({
@@ -1861,11 +1855,11 @@ function Ce(e, r, t) {
1861
1855
  }
1862
1856
  function _e(e, r, t) {
1863
1857
  const n = P(e, r, t);
1864
- B(n, r, ["tokens", "components"], t);
1858
+ O(n, r, ["tokens", "components"], t);
1865
1859
  const o = {};
1866
1860
  if (n.tokens !== void 0) {
1867
1861
  const a = P(n.tokens, `${r}.tokens`, t);
1868
- B(
1862
+ O(
1869
1863
  a,
1870
1864
  `${r}.tokens`,
1871
1865
  ["color", "typography"],
@@ -1873,7 +1867,7 @@ function _e(e, r, t) {
1873
1867
  );
1874
1868
  const i = {};
1875
1869
  if (a.color !== void 0) {
1876
- const l = P(
1870
+ const c = P(
1877
1871
  a.color,
1878
1872
  `${r}.tokens.color`,
1879
1873
  t
@@ -1890,38 +1884,38 @@ function _e(e, r, t) {
1890
1884
  "warning",
1891
1885
  "info"
1892
1886
  ];
1893
- B(l, `${r}.tokens.color`, d, t);
1894
- const c = {};
1887
+ O(c, `${r}.tokens.color`, d, t);
1888
+ const l = {};
1895
1889
  d.forEach((s) => {
1896
1890
  const u = N(
1897
- l[s],
1891
+ c[s],
1898
1892
  `${r}.tokens.color.${s}`,
1899
1893
  120,
1900
1894
  t
1901
1895
  );
1902
- u !== void 0 && (c[s] = u);
1903
- }), i.color = c;
1896
+ u !== void 0 && (l[s] = u);
1897
+ }), i.color = l;
1904
1898
  }
1905
1899
  if (a.typography !== void 0) {
1906
- const l = P(
1900
+ const c = P(
1907
1901
  a.typography,
1908
1902
  `${r}.tokens.typography`,
1909
1903
  t
1910
1904
  );
1911
- B(
1912
- l,
1905
+ O(
1906
+ c,
1913
1907
  `${r}.tokens.typography`,
1914
1908
  ["fontFamily", "monoFontFamily"],
1915
1909
  t
1916
1910
  );
1917
1911
  const d = N(
1918
- l.fontFamily,
1912
+ c.fontFamily,
1919
1913
  `${r}.tokens.typography.fontFamily`,
1920
1914
  500,
1921
1915
  t,
1922
1916
  { allowEmpty: !0 }
1923
- ), c = N(
1924
- l.monoFontFamily,
1917
+ ), l = N(
1918
+ c.monoFontFamily,
1925
1919
  `${r}.tokens.typography.monoFontFamily`,
1926
1920
  500,
1927
1921
  t,
@@ -1929,7 +1923,7 @@ function _e(e, r, t) {
1929
1923
  );
1930
1924
  i.typography = {
1931
1925
  ...d !== void 0 ? { fontFamily: d } : {},
1932
- ...c !== void 0 ? { monoFontFamily: c } : {}
1926
+ ...l !== void 0 ? { monoFontFamily: l } : {}
1933
1927
  };
1934
1928
  }
1935
1929
  o.tokens = i;
@@ -1940,21 +1934,21 @@ function _e(e, r, t) {
1940
1934
  `${r}.components`,
1941
1935
  t
1942
1936
  );
1943
- if (B(a, `${r}.components`, ["chart"], t), a.chart !== void 0) {
1937
+ if (O(a, `${r}.components`, ["chart"], t), a.chart !== void 0) {
1944
1938
  const i = P(
1945
1939
  a.chart,
1946
1940
  `${r}.components.chart`,
1947
1941
  t
1948
1942
  );
1949
- B(i, `${r}.components.chart`, ["palette"], t);
1950
- let l;
1943
+ O(i, `${r}.components.chart`, ["palette"], t);
1944
+ let c;
1951
1945
  i.palette !== void 0 && (Array.isArray(i.palette) ? i.palette.length > 20 ? t.push({
1952
1946
  field: `${r}.components.chart.palette`,
1953
1947
  message: "Expected 20 colors or fewer."
1954
- }) : l = i.palette.map(
1955
- (d, c) => N(
1948
+ }) : c = i.palette.map(
1949
+ (d, l) => N(
1956
1950
  d,
1957
- `${r}.components.chart.palette.${c}`,
1951
+ `${r}.components.chart.palette.${l}`,
1958
1952
  120,
1959
1953
  t
1960
1954
  )
@@ -1962,19 +1956,19 @@ function _e(e, r, t) {
1962
1956
  field: `${r}.components.chart.palette`,
1963
1957
  message: "Expected an array."
1964
1958
  })), o.components = {
1965
- chart: l ? { palette: l } : {}
1959
+ chart: c ? { palette: c } : {}
1966
1960
  };
1967
1961
  }
1968
1962
  }
1969
1963
  return o;
1970
1964
  }
1971
- function Rr(e, r) {
1965
+ function Dr(e, r) {
1972
1966
  const t = "presentation.appearance", n = P(e, t, r);
1973
- B(n, t, ["version", "schemes"], r);
1967
+ O(n, t, ["version", "schemes"], r);
1974
1968
  const o = {};
1975
1969
  if (n.version !== void 0 && (typeof n.version != "number" || !Number.isFinite(n.version) ? r.push({ field: `${t}.version`, message: "Expected a number." }) : o.version = n.version), n.schemes !== void 0) {
1976
1970
  const a = P(n.schemes, `${t}.schemes`, r);
1977
- B(a, `${t}.schemes`, ["light", "dark"], r), o.schemes = {
1971
+ O(a, `${t}.schemes`, ["light", "dark"], r), o.schemes = {
1978
1972
  ...a.light !== void 0 ? {
1979
1973
  light: _e(
1980
1974
  a.light,
@@ -1993,9 +1987,9 @@ function Rr(e, r) {
1993
1987
  }
1994
1988
  return o;
1995
1989
  }
1996
- function Ar(e, r) {
1990
+ function Mr(e, r) {
1997
1991
  const t = "presentation.brandOverrides", n = P(e, t, r);
1998
- B(n, t, ["brandName", "logoUrl", "link"], r);
1992
+ O(n, t, ["brandName", "logoUrl", "link"], r);
1999
1993
  const o = N(
2000
1994
  n.brandName,
2001
1995
  `${t}.brandName`,
@@ -2008,7 +2002,7 @@ function Ar(e, r) {
2008
2002
  ...i !== void 0 ? { link: i } : {}
2009
2003
  };
2010
2004
  }
2011
- function Dr(e, r) {
2005
+ function Pr(e, r) {
2012
2006
  const t = "presentation.fragments", n = P(e, t, r), o = [
2013
2007
  "preHeaderText",
2014
2008
  "headerBannerHtml",
@@ -2017,22 +2011,22 @@ function Dr(e, r) {
2017
2011
  "disclaimerHtml",
2018
2012
  "unsubscribeUrl"
2019
2013
  ];
2020
- B(n, t, o, r);
2014
+ O(n, t, o, r);
2021
2015
  const a = {};
2022
2016
  return o.forEach((i) => {
2023
- const l = i === "unsubscribeUrl" ? Ce(n[i], `${t}.${i}`, r) : N(
2017
+ const c = i === "unsubscribeUrl" ? Ce(n[i], `${t}.${i}`, r) : N(
2024
2018
  n[i],
2025
2019
  `${t}.${i}`,
2026
2020
  i === "preHeaderText" ? 200 : 5e3,
2027
2021
  r,
2028
2022
  { trim: i === "preHeaderText" }
2029
2023
  );
2030
- l !== void 0 && (a[i] = l);
2024
+ c !== void 0 && (a[i] = c);
2031
2025
  }), a;
2032
2026
  }
2033
- function Mr(e) {
2027
+ function Or(e) {
2034
2028
  const r = [], t = {};
2035
- if (e.appearance !== void 0 && (t.appearance = Rr(e.appearance, r)), e.brandOverrides !== void 0 && (t.brandOverrides = Ar(e.brandOverrides, r)), e.fragments !== void 0 && (t.fragments = Dr(e.fragments, r)), e.viewUrl !== void 0) {
2029
+ if (e.appearance !== void 0 && (t.appearance = Dr(e.appearance, r)), e.brandOverrides !== void 0 && (t.brandOverrides = Mr(e.brandOverrides, r)), e.fragments !== void 0 && (t.fragments = Pr(e.fragments, r)), e.viewUrl !== void 0) {
2036
2030
  const n = Ce(e.viewUrl, "presentation.viewUrl", r);
2037
2031
  n !== void 0 && (t.viewUrl = n);
2038
2032
  }
@@ -2054,13 +2048,13 @@ const X = [
2054
2048
  3: "third",
2055
2049
  4: "fourth",
2056
2050
  [-1]: "last"
2057
- }, Fo = {
2051
+ }, Do = {
2058
2052
  frequency: "weekly",
2059
2053
  hour: 9,
2060
2054
  minute: 0,
2061
2055
  weekdays: [1]
2062
2056
  }, A = { ok: !1, issue: "Choose a supported schedule." };
2063
- function Pr(e) {
2057
+ function Br(e) {
2064
2058
  if (typeof e != "string" || e.length === 0 || e !== e.trim() || /^(?:(?:UTC|GMT)[+-]|[+-]\d{2}:\d{2}$)/.test(e))
2065
2059
  return !1;
2066
2060
  try {
@@ -2069,7 +2063,7 @@ function Pr(e) {
2069
2063
  return !1;
2070
2064
  }
2071
2065
  }
2072
- function Br(e) {
2066
+ function Kr(e) {
2073
2067
  return Number.isInteger(e.minute) && e.minute >= 0 && e.minute <= 59 && Number.isInteger(e.hour) && e.hour >= 0 && e.hour <= 23;
2074
2068
  }
2075
2069
  function Ze(e) {
@@ -2088,20 +2082,20 @@ function Qe(e) {
2088
2082
  const n = e.includes("last") ? [...t, "last"] : t;
2089
2083
  return n.length > 0 ? n : null;
2090
2084
  }
2091
- function q(e, r) {
2085
+ function V(e, r) {
2092
2086
  const t = [];
2093
2087
  for (let n = 0; n < 12 / e; n += 1)
2094
2088
  t.push((r + n * e) % 12);
2095
2089
  return t.sort((n, o) => n - o);
2096
2090
  }
2097
- function Or(e, r) {
2098
- return e === 1 ? "*" : q(e, r).map((t) => t + 1).join(",");
2091
+ function Nr(e, r) {
2092
+ return e === 1 ? "*" : V(e, r).map((t) => t + 1).join(",");
2099
2093
  }
2100
2094
  function Xe(e, r) {
2101
- return e.every((t) => jr(t, r));
2095
+ return e.every((t) => Hr(t, r));
2102
2096
  }
2103
- function Ro(e) {
2104
- if (!Br(e))
2097
+ function Mo(e) {
2098
+ if (!Kr(e))
2105
2099
  throw new Error("Choose a valid schedule time.");
2106
2100
  const r = `${e.minute} ${e.hour}`;
2107
2101
  switch (e.frequency) {
@@ -2115,14 +2109,14 @@ function Ro(e) {
2115
2109
  case "monthly": {
2116
2110
  if (!We.includes(e.interval) || !Number.isInteger(e.startMonth) || e.startMonth < 0 || e.startMonth >= e.interval)
2117
2111
  throw new Error("Choose a valid month cycle.");
2118
- const t = Or(e.interval, e.startMonth);
2112
+ const t = Nr(e.interval, e.startMonth);
2119
2113
  if (e.on.type === "days") {
2120
2114
  const i = Qe(e.on.days);
2121
2115
  if (!i) throw new Error("Choose at least one day of the month.");
2122
- const l = q(e.interval, e.startMonth);
2123
- if (!Xe(i, l))
2116
+ const c = V(e.interval, e.startMonth);
2117
+ if (!Xe(i, c))
2124
2118
  throw new Error("Choose a day that occurs in the chosen months.");
2125
- const d = i.map((c) => c === "last" ? "L" : String(c)).join(",");
2119
+ const d = i.map((l) => l === "last" ? "L" : String(l)).join(",");
2126
2120
  return `${r} ${d} ${t} *`;
2127
2121
  }
2128
2122
  const { ordinal: n, weekday: o } = e.on;
@@ -2133,20 +2127,20 @@ function Ro(e) {
2133
2127
  }
2134
2128
  }
2135
2129
  }
2136
- function Kr(e) {
2130
+ function Lr(e) {
2137
2131
  if (e === "*") return { interval: 1, startMonth: 0 };
2138
2132
  const r = e.split(",");
2139
2133
  if (r.some((i) => !/^([1-9]|1[0-2])$/.test(i))) return null;
2140
2134
  const t = r.map((i) => Number(i) - 1), n = 12 / t.length;
2141
2135
  if (!We.includes(n))
2142
2136
  return null;
2143
- const o = t[0], a = q(
2137
+ const o = t[0], a = V(
2144
2138
  n,
2145
2139
  o
2146
2140
  );
2147
- return o >= n || a.length !== t.length || a.some((i, l) => i !== t[l]) ? null : { interval: n, startMonth: o };
2141
+ return o >= n || a.length !== t.length || a.some((i, c) => i !== t[c]) ? null : { interval: n, startMonth: o };
2148
2142
  }
2149
- function Nr(e) {
2143
+ function zr(e) {
2150
2144
  const r = e.split(",");
2151
2145
  if (r.some((o) => !/^(L|[1-9]|[12]\d|3[01])$/.test(o))) return null;
2152
2146
  const t = r.map(
@@ -2154,7 +2148,7 @@ function Nr(e) {
2154
2148
  ), n = Qe(t);
2155
2149
  return !n || n.some((o, a) => o !== t[a]) ? null : n;
2156
2150
  }
2157
- function Lr(e) {
2151
+ function Vr(e) {
2158
2152
  const r = /^([A-Z]{3})(?:#([1-4])|(L))$/.exec(e);
2159
2153
  if (!r) return null;
2160
2154
  const t = He.get(r[1]);
@@ -2171,63 +2165,63 @@ function Je(e) {
2171
2165
  const [t, n, o, a, i] = r;
2172
2166
  if (!/^(0|[1-9]\d?)$/.test(t) || !/^(0|[1-9]\d?)$/.test(n))
2173
2167
  return A;
2174
- const l = Number(t), d = Number(n);
2175
- if (l > 59 || d > 23) return A;
2168
+ const c = Number(t), d = Number(n);
2169
+ if (c > 59 || d > 23) return A;
2176
2170
  if (a === "*" && o === "*" && i === "*")
2177
2171
  return {
2178
2172
  ok: !0,
2179
- value: { frequency: "daily", hour: d, minute: l, weekdaysOnly: !1 }
2173
+ value: { frequency: "daily", hour: d, minute: c, weekdaysOnly: !1 }
2180
2174
  };
2181
2175
  if (a === "*" && o === "*" && !i.includes("#") && !i.endsWith("L")) {
2182
2176
  const u = i.split(",").map((g) => He.get(g));
2183
2177
  if (u.some((g) => g === void 0)) return A;
2184
- const p = u, m = Ze(p);
2185
- return !m || m.some((g, y) => g !== p[y]) ? A : m.length === te.length && m.every((g, y) => g === te[y]) ? {
2178
+ const f = u, m = Ze(f);
2179
+ return !m || m.some((g, y) => g !== f[y]) ? A : m.length === te.length && m.every((g, y) => g === te[y]) ? {
2186
2180
  ok: !0,
2187
- value: { frequency: "daily", hour: d, minute: l, weekdaysOnly: !0 }
2181
+ value: { frequency: "daily", hour: d, minute: c, weekdaysOnly: !0 }
2188
2182
  } : {
2189
2183
  ok: !0,
2190
- value: { frequency: "weekly", hour: d, minute: l, weekdays: m }
2184
+ value: { frequency: "weekly", hour: d, minute: c, weekdays: m }
2191
2185
  };
2192
2186
  }
2193
- const c = Kr(a);
2194
- if (!c) return A;
2187
+ const l = Lr(a);
2188
+ if (!l) return A;
2195
2189
  if (o !== "*" && i === "*") {
2196
- const s = Nr(o), u = q(c.interval, c.startMonth);
2190
+ const s = zr(o), u = V(l.interval, l.startMonth);
2197
2191
  return !s || !Xe(s, u) ? A : {
2198
2192
  ok: !0,
2199
2193
  value: {
2200
2194
  frequency: "monthly",
2201
2195
  hour: d,
2202
- minute: l,
2203
- ...c,
2196
+ minute: c,
2197
+ ...l,
2204
2198
  on: { type: "days", days: s }
2205
2199
  }
2206
2200
  };
2207
2201
  }
2208
2202
  if (o === "*" && i !== "*") {
2209
- const s = Lr(i);
2203
+ const s = Vr(i);
2210
2204
  return s ? {
2211
2205
  ok: !0,
2212
2206
  value: {
2213
2207
  frequency: "monthly",
2214
2208
  hour: d,
2215
- minute: l,
2216
- ...c,
2209
+ minute: c,
2210
+ ...l,
2217
2211
  on: { type: "weekday", ...s }
2218
2212
  }
2219
2213
  } : A;
2220
2214
  }
2221
2215
  return A;
2222
2216
  }
2223
- function zr(e, r, t) {
2217
+ function qr(e, r, t) {
2224
2218
  return new Intl.DateTimeFormat(t, {
2225
2219
  hour: "numeric",
2226
2220
  minute: "2-digit",
2227
2221
  timeZone: "UTC"
2228
2222
  }).format(new Date(Date.UTC(2020, 0, 1, e, r)));
2229
2223
  }
2230
- function qr(e, r) {
2224
+ function Ur(e, r) {
2231
2225
  var t;
2232
2226
  if (e === "UTC") return "UTC";
2233
2227
  try {
@@ -2242,26 +2236,26 @@ function qr(e, r) {
2242
2236
  function Fe(e) {
2243
2237
  return e.length <= 1 ? e.join("") : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
2244
2238
  }
2245
- function Vr(e) {
2239
+ function jr(e) {
2246
2240
  const r = e % 100;
2247
2241
  return r >= 11 && r <= 13 ? `${e}th` : `${e}${["th", "st", "nd", "rd"][e % 10] ?? "th"}`;
2248
2242
  }
2249
- function Ur(e, r, t) {
2243
+ function Gr(e, r, t) {
2250
2244
  const n = (a, i) => new Intl.DateTimeFormat(t, { month: i, timeZone: "UTC" }).format(
2251
2245
  new Date(Date.UTC(2020, a, 1))
2252
2246
  );
2253
2247
  if (e === 1) return "every month";
2254
2248
  if (e === 12) return `${n(r, "long")} each year`;
2255
- const o = q(e, r).map((a) => n(a, "short")).join(", ");
2249
+ const o = V(e, r).map((a) => n(a, "short")).join(", ");
2256
2250
  return e === 3 ? `each quarter (${o})` : `every ${e} months (${o})`;
2257
2251
  }
2258
- function Ao(e, r, t = "en-US") {
2252
+ function Po(e, r, t = "en-US") {
2259
2253
  const n = Je(e);
2260
2254
  if (!n.ok) return null;
2261
2255
  try {
2262
- const o = n.value, a = qr(r, t);
2256
+ const o = n.value, a = Ur(r, t);
2263
2257
  if (!a) return null;
2264
- const i = `at ${zr(o.hour, o.minute, t)} ${a}`, l = (d) => new Intl.DateTimeFormat(t, {
2258
+ const i = `at ${qr(o.hour, o.minute, t)} ${a}`, c = (d) => new Intl.DateTimeFormat(t, {
2265
2259
  weekday: "long",
2266
2260
  timeZone: "UTC"
2267
2261
  }).format(new Date(Date.UTC(2023, 0, 1 + d)));
@@ -2269,15 +2263,15 @@ function Ao(e, r, t = "en-US") {
2269
2263
  case "daily":
2270
2264
  return o.weekdaysOnly ? `Every weekday, Monday to Friday, ${i}` : `Every day ${i}`;
2271
2265
  case "weekly":
2272
- return `Every ${Fe(o.weekdays.map(l))} ${i}`;
2266
+ return `Every ${Fe(o.weekdays.map(c))} ${i}`;
2273
2267
  case "monthly": {
2274
- const d = Ur(o.interval, o.startMonth, t);
2268
+ const d = Gr(o.interval, o.startMonth, t);
2275
2269
  if (o.on.type === "weekday")
2276
- return `On the ${Ye[o.on.ordinal]} ${l(o.on.weekday)} of ${d} ${i}`;
2277
- const c = o.on.days.map(
2278
- (s) => s === "last" ? "last day" : Vr(s)
2270
+ return `On the ${Ye[o.on.ordinal]} ${c(o.on.weekday)} of ${d} ${i}`;
2271
+ const l = o.on.days.map(
2272
+ (s) => s === "last" ? "last day" : jr(s)
2279
2273
  );
2280
- return `On the ${Fe(c)} of ${d} ${i}`;
2274
+ return `On the ${Fe(l)} of ${d} ${i}`;
2281
2275
  }
2282
2276
  }
2283
2277
  } catch {
@@ -2285,22 +2279,22 @@ function Ao(e, r, t = "en-US") {
2285
2279
  }
2286
2280
  }
2287
2281
  const et = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2288
- function jr(e, r) {
2282
+ function Hr(e, r) {
2289
2283
  return e === "last" || r.some((t) => e <= et[t]);
2290
2284
  }
2291
- function Do(e) {
2285
+ function Oo(e) {
2292
2286
  if (e.frequency !== "monthly" || e.on.type !== "days") return null;
2293
2287
  const r = e.on.days.filter((o) => o !== "last");
2294
2288
  if (r.length === 0) return null;
2295
- const t = Math.max(...r), n = q(e.interval, e.startMonth).filter(
2289
+ const t = Math.max(...r), n = V(e.interval, e.startMonth).filter(
2296
2290
  (o) => t > (o === 1 ? 28 : et[o])
2297
2291
  );
2298
2292
  return n.length > 0 ? { day: t, months: n } : null;
2299
2293
  }
2300
- function Gr(e, r) {
2294
+ function Wr(e, r) {
2301
2295
  return new Date(Date.UTC(e, r + 1, 0)).getUTCDate();
2302
2296
  }
2303
- function Hr(e, r, t, n) {
2297
+ function Yr(e, r, t, n) {
2304
2298
  const o = new Date(Date.UTC(r, t, n)).getUTCDay();
2305
2299
  switch (e.frequency) {
2306
2300
  case "daily":
@@ -2308,18 +2302,18 @@ function Hr(e, r, t, n) {
2308
2302
  case "weekly":
2309
2303
  return e.weekdays.includes(o);
2310
2304
  case "monthly": {
2311
- if (!q(e.interval, e.startMonth).includes(t))
2305
+ if (!V(e.interval, e.startMonth).includes(t))
2312
2306
  return !1;
2313
- const a = Gr(r, t);
2307
+ const a = Wr(r, t);
2314
2308
  return e.on.type === "days" ? e.on.days.some(
2315
2309
  (i) => i === "last" ? n === a : i === n
2316
2310
  ) : o !== e.on.weekday ? !1 : e.on.ordinal === -1 ? n + 7 > a : Math.ceil(n / 7) === e.on.ordinal;
2317
2311
  }
2318
2312
  }
2319
2313
  }
2320
- function Mo(e, r, t, n) {
2314
+ function Bo(e, r, t, n) {
2321
2315
  const o = Je(e);
2322
- if (!o.ok || !Pr(r)) return [];
2316
+ if (!o.ok || !Br(r)) return [];
2323
2317
  const a = o.value, i = new Intl.DateTimeFormat("en-US", {
2324
2318
  timeZone: r,
2325
2319
  hourCycle: "h23",
@@ -2328,41 +2322,41 @@ function Mo(e, r, t, n) {
2328
2322
  day: "numeric",
2329
2323
  hour: "numeric",
2330
2324
  minute: "numeric"
2331
- }).formatToParts(t), l = (s) => {
2325
+ }).formatToParts(t), c = (s) => {
2332
2326
  var u;
2333
- return Number((u = i.find((p) => p.type === s)) == null ? void 0 : u.value);
2334
- }, d = new Date(Date.UTC(l("year"), l("month") - 1, l("day")));
2335
- l("hour") * 60 + l("minute") >= a.hour * 60 + a.minute && d.setUTCDate(d.getUTCDate() + 1);
2336
- const c = [];
2337
- for (let s = 0; s < 366 * 4 * (n + 1) && c.length < n; s += 1)
2338
- Hr(a, d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()) && c.push(d.toISOString().slice(0, 10)), d.setUTCDate(d.getUTCDate() + 1);
2339
- return c;
2340
- }
2341
- function Po(e) {
2327
+ return Number((u = i.find((f) => f.type === s)) == null ? void 0 : u.value);
2328
+ }, d = new Date(Date.UTC(c("year"), c("month") - 1, c("day")));
2329
+ c("hour") * 60 + c("minute") >= a.hour * 60 + a.minute && d.setUTCDate(d.getUTCDate() + 1);
2330
+ const l = [];
2331
+ for (let s = 0; s < 366 * 4 * (n + 1) && l.length < n; s += 1)
2332
+ Yr(a, d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()) && l.push(d.toISOString().slice(0, 10)), d.setUTCDate(d.getUTCDate() + 1);
2333
+ return l;
2334
+ }
2335
+ function Ko(e) {
2342
2336
  return e != null && e.role ? e.type === "tenant" ? e.role === "POWER_USER" : ["AUTHOR", "ADMIN", "SUPER_ADMIN"].includes(e.role) : !1;
2343
2337
  }
2344
- function Bo(e) {
2338
+ function No(e) {
2345
2339
  return e.canCreate ? [
2346
2340
  ...e.scheduledReportAvailable ? ["scheduled_report"] : [],
2347
2341
  ...e.analyticalBriefingsEnabled ? ["analytical_briefing"] : []
2348
2342
  ] : [];
2349
2343
  }
2350
- function Wr(e) {
2344
+ function Zr(e) {
2351
2345
  const r = (e == null ? void 0 : e.channels) ?? [];
2352
2346
  return r.length === 1 && r[0] === "EMAIL";
2353
2347
  }
2354
- function Yr(e) {
2355
- return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 && Wr(e.deliveryConfig) ? e.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
2348
+ function Qr(e) {
2349
+ return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 && Zr(e.deliveryConfig) ? e.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
2356
2350
  }
2357
- function Oo(e) {
2358
- const r = Yr(e), t = r === "Scheduled report" || r === "On-demand report" ? "report" : "briefing";
2351
+ function Lo(e) {
2352
+ const r = Qr(e), t = r === "Scheduled report" || r === "On-demand report" ? "report" : "briefing";
2359
2353
  return {
2360
2354
  typeLabel: r,
2361
2355
  noun: t,
2362
2356
  pluralNoun: t === "report" ? "reports" : "briefings"
2363
2357
  };
2364
2358
  }
2365
- const fe = "BRIEFING", Zr = ["markdown", "html"], pe = ["markdown"], ce = 20, h = {
2359
+ const fe = "BRIEFING", Xr = ["markdown", "html"], pe = ["markdown"], ce = 20, h = {
2366
2360
  name: 500,
2367
2361
  description: 2e3,
2368
2362
  instruction: 5e4,
@@ -2391,7 +2385,7 @@ const fe = "BRIEFING", Zr = ["markdown", "html"], pe = ["markdown"], ce = 20, h
2391
2385
  // tiny tiles in narrow client panels; 2-up was the chosen layout).
2392
2386
  maxKpiTiles: 8
2393
2387
  };
2394
- function Qr(e) {
2388
+ function Jr(e) {
2395
2389
  if (e === null || typeof e != "object" || Array.isArray(e))
2396
2390
  return !1;
2397
2391
  const r = e;
@@ -2403,15 +2397,15 @@ function Qr(e) {
2403
2397
  const n = t;
2404
2398
  return (n.kind === "metric" && typeof n.metricId == "string" && !!n.metricId.trim() || n.kind === "column" && typeof n.columnKey == "string" && !!n.columnKey.trim() || n.kind === "matrix_measure" && typeof n.measureId == "string" && !!n.measureId.trim()) && Re(r.format).ok;
2405
2399
  }
2406
- function Xr(e) {
2407
- return e == null ? "" : Qr(e) ? yt(e.value, e.format) : String(e);
2400
+ function en(e) {
2401
+ return e == null ? "" : Jr(e) ? yt(e.value, e.format) : String(e);
2408
2402
  }
2409
- function Ko(e) {
2403
+ function zo(e) {
2410
2404
  return [e.delta, e.percentChange].filter(
2411
2405
  (r) => r != null
2412
- ).map(Xr).filter(Boolean).join(" / ");
2406
+ ).map(en).filter(Boolean).join(" / ");
2413
2407
  }
2414
- const tt = new Set(Zr), Jr = /* @__PURE__ */ new Set([
2408
+ const tt = new Set(Xr), tn = /* @__PURE__ */ new Set([
2415
2409
  "EMAIL",
2416
2410
  "WEBHOOK",
2417
2411
  "SLACK",
@@ -2422,45 +2416,46 @@ const tt = new Set(Zr), Jr = /* @__PURE__ */ new Set([
2422
2416
  maxPlanningIterations: { min: 1, max: 10 },
2423
2417
  maxRows: { min: 1, max: 1e5 },
2424
2418
  timeoutMs: { min: 1e3, max: 30 * 6e4 }
2425
- }, en = /* @__PURE__ */ new Set([
2419
+ }, rn = /* @__PURE__ */ new Set([
2426
2420
  "letter",
2427
2421
  "legal",
2428
2422
  "a4",
2429
2423
  "a3",
2430
2424
  "tabloid"
2431
- ]), tn = /* @__PURE__ */ new Set([
2425
+ ]), nn = /* @__PURE__ */ new Set([
2432
2426
  "portrait",
2433
2427
  "landscape"
2434
- ]), rn = /* @__PURE__ */ new Set([",", ";", " "]), nn = /* @__PURE__ */ new Set([
2428
+ ]), on = /* @__PURE__ */ new Set([",", ";", " "]), an = new Set(xt), cn = /* @__PURE__ */ new Set([
2435
2429
  "current",
2436
2430
  "all"
2437
- ]), on = /* @__PURE__ */ new Set([
2431
+ ]), ln = /* @__PURE__ */ new Set([
2438
2432
  "concise",
2439
2433
  "balanced",
2440
2434
  "detailed"
2441
- ]), an = /* @__PURE__ */ new Set([
2435
+ ]), sn = /* @__PURE__ */ new Set([
2442
2436
  "info",
2443
2437
  "positive",
2444
2438
  "warning",
2445
2439
  "critical"
2446
- ]), cn = /* @__PURE__ */ new Set([
2440
+ ]), dn = /* @__PURE__ */ new Set([
2447
2441
  "text",
2448
2442
  "number",
2449
2443
  "currency",
2450
2444
  "percent",
2451
2445
  "date",
2452
2446
  "boolean"
2453
- ]), ln = /* @__PURE__ */ new Set([
2447
+ ]), mn = /* @__PURE__ */ new Set([
2454
2448
  "left",
2455
2449
  "center",
2456
2450
  "right"
2457
- ]), sn = [
2451
+ ]), un = [
2458
2452
  "matrix",
2459
2453
  "pageSize",
2460
2454
  "orientation",
2461
2455
  "includeFilters",
2462
2456
  "includeTimestamp",
2463
2457
  "delimiter",
2458
+ "csvEncoding",
2464
2459
  "includeHeaders",
2465
2460
  "useFormattedValues",
2466
2461
  "sheetSelection",
@@ -2492,16 +2487,16 @@ class oe extends Error {
2492
2487
  function rt(e) {
2493
2488
  return typeof e == "object" && e !== null && !Array.isArray(e);
2494
2489
  }
2495
- function f(e, r, t) {
2490
+ function p(e, r, t) {
2496
2491
  e.push({ field: r, message: t });
2497
2492
  }
2498
- function k(e, r, t) {
2499
- return rt(e) ? e : (f(t, r, "Expected an object."), {});
2493
+ function E(e, r, t) {
2494
+ return rt(e) ? e : (p(t, r, "Expected an object."), {});
2500
2495
  }
2501
2496
  function I(e, r, t, n) {
2502
2497
  const o = new Set(t);
2503
2498
  Object.keys(e).forEach((a) => {
2504
- o.has(a) || f(
2499
+ o.has(a) || p(
2505
2500
  n,
2506
2501
  r ? `${r}.${a}` : a,
2507
2502
  `Unexpected field "${a}".`
@@ -2510,31 +2505,31 @@ function I(e, r, t, n) {
2510
2505
  }
2511
2506
  function $(e, r, t, n) {
2512
2507
  if (typeof e != "string")
2513
- return f(n, r, "Expected a string."), "";
2508
+ return p(n, r, "Expected a string."), "";
2514
2509
  const o = e.trim();
2515
- return o ? (o.length > t && f(n, r, `Must be ${t} characters or fewer.`), o) : (f(n, r, "Required value cannot be empty."), "");
2510
+ return o ? (o.length > t && p(n, r, `Must be ${t} characters or fewer.`), o) : (p(n, r, "Required value cannot be empty."), "");
2516
2511
  }
2517
2512
  function x(e, r, t, n) {
2518
2513
  if (e == null)
2519
2514
  return;
2520
2515
  if (typeof e != "string") {
2521
- f(n, r, "Expected a string.");
2516
+ p(n, r, "Expected a string.");
2522
2517
  return;
2523
2518
  }
2524
2519
  const o = e.trim();
2525
2520
  if (o)
2526
- return o.length > t && f(n, r, `Must be ${t} characters or fewer.`), o;
2521
+ return o.length > t && p(n, r, `Must be ${t} characters or fewer.`), o;
2527
2522
  }
2528
- function dn(e, r, t, n) {
2523
+ function fn(e, r, t, n) {
2529
2524
  if (typeof e != "string")
2530
- return f(n, r, "Expected a string."), "";
2525
+ return p(n, r, "Expected a string."), "";
2531
2526
  const o = e.trim();
2532
- return o.length > t && f(n, r, `Must be ${t} characters or fewer.`), o;
2527
+ return o.length > t && p(n, r, `Must be ${t} characters or fewer.`), o;
2533
2528
  }
2534
- function mn(e, r, t) {
2529
+ function pn(e, r, t) {
2535
2530
  if (e != null) {
2536
2531
  if (!Number.isInteger(e) || Number(e) < 0) {
2537
- f(t, r, "Expected a non-negative integer.");
2532
+ p(t, r, "Expected a non-negative integer.");
2538
2533
  return;
2539
2534
  }
2540
2535
  return Number(e);
@@ -2542,33 +2537,33 @@ function mn(e, r, t) {
2542
2537
  }
2543
2538
  function D(e, r, t, n = {}) {
2544
2539
  if (e == null)
2545
- return n.required ? (f(t, r, "Expected at least one evidence id."), []) : void 0;
2540
+ return n.required ? (p(t, r, "Expected at least one evidence id."), []) : void 0;
2546
2541
  if (!Array.isArray(e))
2547
- return f(t, r, "Expected an array."), n.required ? [] : void 0;
2542
+ return p(t, r, "Expected an array."), n.required ? [] : void 0;
2548
2543
  const o = [];
2549
2544
  return e.forEach((a, i) => {
2550
- const l = $(
2545
+ const c = $(
2551
2546
  a,
2552
2547
  `${r}.${i}`,
2553
2548
  h.id,
2554
2549
  t
2555
2550
  );
2556
- l && !o.includes(l) && o.push(l);
2557
- }), n.required && o.length === 0 && f(t, r, "Expected at least one evidence id."), o.length > 0 || n.required ? o : void 0;
2551
+ c && !o.includes(c) && o.push(c);
2552
+ }), n.required && o.length === 0 && p(t, r, "Expected at least one evidence id."), o.length > 0 || n.required ? o : void 0;
2558
2553
  }
2559
2554
  function z(e, r, t, n) {
2560
- return e == null ? r : typeof e != "boolean" ? (f(n, t, "Expected a boolean."), r) : e;
2555
+ return e == null ? r : typeof e != "boolean" ? (p(n, t, "Expected a boolean."), r) : e;
2561
2556
  }
2562
- function un(e, r) {
2563
- return e == null ? "ACTIVE" : e === "ACTIVE" || e === "PAUSED" || e === "DISABLED" ? e : (f(r, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
2557
+ function yn(e, r) {
2558
+ return e == null ? "ACTIVE" : e === "ACTIVE" || e === "PAUSED" || e === "DISABLED" ? e : (p(r, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
2564
2559
  }
2565
- function fn(e) {
2560
+ function hn(e) {
2566
2561
  return e.includes("@") && e.includes(".") && !e.includes(" ");
2567
2562
  }
2568
2563
  function nt(e, r) {
2569
2564
  if (e == null)
2570
2565
  return { type: "project" };
2571
- const t = k(e, "source", r), n = t.type;
2566
+ const t = E(e, "source", r), n = t.type;
2572
2567
  return n === "project" ? (I(t, "source", ["type"], r), { type: "project" }) : n === "dashboard" ? (I(t, "source", ["type", "dashboardId"], r), {
2573
2568
  type: "dashboard",
2574
2569
  dashboardId: $(
@@ -2577,10 +2572,10 @@ function nt(e, r) {
2577
2572
  h.id,
2578
2573
  r
2579
2574
  )
2580
- }) : (f(r, "source.type", "Expected project or dashboard."), { type: "project" });
2575
+ }) : (p(r, "source.type", "Expected project or dashboard."), { type: "project" });
2581
2576
  }
2582
2577
  function ot(e, r) {
2583
- const t = k(e, "body", r), n = t.type;
2578
+ const t = E(e, "body", r), n = t.type;
2584
2579
  return n === "generated_analysis" ? (I(t, "body", ["type", "instruction"], r), {
2585
2580
  type: "generated_analysis",
2586
2581
  instruction: $(
@@ -2591,25 +2586,25 @@ function ot(e, r) {
2591
2586
  )
2592
2587
  }) : n === "custom_message" ? (I(t, "body", ["type", "message"], r), {
2593
2588
  type: "custom_message",
2594
- message: dn(
2589
+ message: fn(
2595
2590
  t.message,
2596
2591
  "body.message",
2597
2592
  h.customMessage,
2598
2593
  r
2599
2594
  )
2600
- }) : n === "none" ? (I(t, "body", ["type"], r), { type: "none" }) : (f(
2595
+ }) : n === "none" ? (I(t, "body", ["type"], r), { type: "none" }) : (p(
2601
2596
  r,
2602
2597
  "body.type",
2603
2598
  "Expected generated_analysis, custom_message, or none."
2604
2599
  ), { type: "none" });
2605
2600
  }
2606
- function pn(e, r) {
2601
+ function gn(e, r) {
2607
2602
  if (e == null)
2608
2603
  return [...pe];
2609
2604
  if (!Array.isArray(e))
2610
- return f(r, "presentation.artifactFormats", "Expected an array."), [...pe];
2605
+ return p(r, "presentation.artifactFormats", "Expected an array."), [...pe];
2611
2606
  if (e.length === 0)
2612
- return f(
2607
+ return p(
2613
2608
  r,
2614
2609
  "presentation.artifactFormats",
2615
2610
  "Choose at least one artifact format."
@@ -2617,7 +2612,7 @@ function pn(e, r) {
2617
2612
  const t = [];
2618
2613
  return e.forEach((n, o) => {
2619
2614
  if (typeof n != "string" || !tt.has(n)) {
2620
- f(
2615
+ p(
2621
2616
  r,
2622
2617
  `presentation.artifactFormats.${o}`,
2623
2618
  "Expected markdown or html."
@@ -2634,7 +2629,7 @@ function at(e, r) {
2634
2629
  includeEvidence: !0,
2635
2630
  includeSql: !0
2636
2631
  };
2637
- const t = k(e, "presentation", r);
2632
+ const t = E(e, "presentation", r);
2638
2633
  I(
2639
2634
  t,
2640
2635
  "presentation",
@@ -2653,7 +2648,7 @@ function at(e, r) {
2653
2648
  r
2654
2649
  );
2655
2650
  const n = {
2656
- artifactFormats: pn(t.artifactFormats, r),
2651
+ artifactFormats: gn(t.artifactFormats, r),
2657
2652
  includeEvidence: z(
2658
2653
  t.includeEvidence,
2659
2654
  !0,
@@ -2683,11 +2678,11 @@ function at(e, r) {
2683
2678
  r
2684
2679
  );
2685
2680
  o && (n.audience = o), a && (n.tone = a), i && (n.format = i);
2686
- const l = Mr(t);
2687
- return l.issues.forEach((d) => f(r, d.field, d.message)), Object.assign(n, l.value), n;
2681
+ const c = Or(t);
2682
+ return c.issues.forEach((d) => p(r, d.field, d.message)), Object.assign(n, c.value), n;
2688
2683
  }
2689
- function yn(e, r, t) {
2690
- return Array.isArray(e) ? (e.length === 0 && f(t, r, "Expected at least one item."), e.length > R.maxListItems && f(
2684
+ function vn(e, r, t) {
2685
+ return Array.isArray(e) ? (e.length === 0 && p(t, r, "Expected at least one item."), e.length > R.maxListItems && p(
2691
2686
  t,
2692
2687
  r,
2693
2688
  `Must have ${R.maxListItems} items or fewer.`
@@ -2698,10 +2693,10 @@ function yn(e, r, t) {
2698
2693
  h.contentItem,
2699
2694
  t
2700
2695
  )
2701
- ).filter(Boolean)) : (f(t, r, "Expected an array."), []);
2696
+ ).filter(Boolean)) : (p(t, r, "Expected an array."), []);
2702
2697
  }
2703
- function hn(e, r, t) {
2704
- const n = k(e, r, t);
2698
+ function bn(e, r, t) {
2699
+ const n = E(e, r, t);
2705
2700
  if (n.kind === "metric")
2706
2701
  return I(n, r, ["kind", "metricId"], t), {
2707
2702
  kind: "metric",
@@ -2732,7 +2727,7 @@ function hn(e, r, t) {
2732
2727
  t
2733
2728
  )
2734
2729
  };
2735
- f(
2730
+ p(
2736
2731
  t,
2737
2732
  `${r}.kind`,
2738
2733
  "Expected metric, column, or matrix_measure."
@@ -2741,17 +2736,17 @@ function hn(e, r, t) {
2741
2736
  function it(e, r, t) {
2742
2737
  if (e === null || typeof e != "object" || Array.isArray(e))
2743
2738
  return;
2744
- const n = k(e, r, t);
2739
+ const n = E(e, r, t);
2745
2740
  if (!Object.prototype.hasOwnProperty.call(n, "target") && !Object.prototype.hasOwnProperty.call(n, "format"))
2746
2741
  return;
2747
- I(n, r, ["value", "target", "format"], t), (typeof n.value != "number" || !Number.isFinite(n.value)) && f(t, `${r}.value`, "Expected a finite number.");
2748
- const o = hn(
2742
+ I(n, r, ["value", "target", "format"], t), (typeof n.value != "number" || !Number.isFinite(n.value)) && p(t, `${r}.value`, "Expected a finite number.");
2743
+ const o = bn(
2749
2744
  n.target,
2750
2745
  `${r}.target`,
2751
2746
  t
2752
2747
  ), a = Re(n.format);
2753
2748
  if (a.ok || a.issues.forEach(
2754
- (i) => f(
2749
+ (i) => p(
2755
2750
  t,
2756
2751
  i.path === "$" ? `${r}.format` : `${r}.format.${i.path}`,
2757
2752
  i.message
@@ -2764,106 +2759,106 @@ function K(e, r, t) {
2764
2759
  return e;
2765
2760
  if (typeof e == "number") {
2766
2761
  if (!Number.isFinite(e)) {
2767
- f(t, r, "Expected a finite number.");
2762
+ p(t, r, "Expected a finite number.");
2768
2763
  return;
2769
2764
  }
2770
2765
  return e;
2771
2766
  }
2772
2767
  const n = it(e, r, t);
2773
2768
  if (n) return n;
2774
- f(
2769
+ p(
2775
2770
  t,
2776
2771
  r,
2777
2772
  "Expected a string, number, or structured numeric value."
2778
2773
  );
2779
2774
  }
2780
- function gn(e, r, t) {
2775
+ function In(e, r, t) {
2781
2776
  if (e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean")
2782
- return typeof e == "string" && e.length > h.contentCell ? (f(
2777
+ return typeof e == "string" && e.length > h.contentCell ? (p(
2783
2778
  t,
2784
2779
  r,
2785
2780
  `Must be ${h.contentCell} characters or fewer.`
2786
- ), e.slice(0, h.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (f(t, r, "Expected a finite number."), null) : e;
2781
+ ), e.slice(0, h.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (p(t, r, "Expected a finite number."), null) : e;
2787
2782
  const n = it(e, r, t);
2788
- return n || (f(
2783
+ return n || (p(
2789
2784
  t,
2790
2785
  r,
2791
2786
  "Expected a string, number, boolean, structured numeric value, or null."
2792
2787
  ), null);
2793
2788
  }
2794
- function vn(e, r, t) {
2789
+ function Cn(e, r, t) {
2795
2790
  if (!Array.isArray(e))
2796
- return f(t, r, "Expected an array."), [];
2797
- e.length === 0 && f(t, r, "Expected at least one column."), e.length > R.maxTableColumns && f(
2791
+ return p(t, r, "Expected an array."), [];
2792
+ e.length === 0 && p(t, r, "Expected at least one column."), e.length > R.maxTableColumns && p(
2798
2793
  t,
2799
2794
  r,
2800
2795
  `Must have ${R.maxTableColumns} columns or fewer.`
2801
2796
  );
2802
2797
  const n = /* @__PURE__ */ new Set();
2803
2798
  return e.slice(0, R.maxTableColumns).map((o, a) => {
2804
- const i = `${r}.${a}`, l = k(o, i, t);
2805
- I(l, i, ["key", "label", "kind", "align"], t);
2799
+ const i = `${r}.${a}`, c = E(o, i, t);
2800
+ I(c, i, ["key", "label", "kind", "align"], t);
2806
2801
  const d = $(
2807
- l.key,
2802
+ c.key,
2808
2803
  `${i}.key`,
2809
2804
  h.id,
2810
2805
  t
2811
2806
  );
2812
- d && (n.has(d) && f(t, `${i}.key`, "Column key must be unique."), n.add(d));
2813
- const c = $(
2814
- l.label,
2807
+ d && (n.has(d) && p(t, `${i}.key`, "Column key must be unique."), n.add(d));
2808
+ const l = $(
2809
+ c.label,
2815
2810
  `${i}.label`,
2816
2811
  h.contentTitle,
2817
2812
  t
2818
- ), s = O(
2819
- l.kind,
2813
+ ), s = B(
2814
+ c.kind,
2820
2815
  `${i}.kind`,
2821
- cn,
2816
+ dn,
2822
2817
  "text, number, currency, percent, date, or boolean",
2823
2818
  t
2824
- ), u = O(
2825
- l.align,
2819
+ ), u = B(
2820
+ c.align,
2826
2821
  `${i}.align`,
2827
- ln,
2822
+ mn,
2828
2823
  "left, center, or right",
2829
2824
  t
2830
2825
  );
2831
2826
  return {
2832
2827
  key: d,
2833
- label: c,
2828
+ label: l,
2834
2829
  ...s ? { kind: s } : {},
2835
2830
  ...u ? { align: u } : {}
2836
2831
  };
2837
2832
  });
2838
2833
  }
2839
- function bn(e, r, t, n) {
2834
+ function Tn(e, r, t, n) {
2840
2835
  if (!Array.isArray(e))
2841
- return f(n, r, "Expected an array."), [];
2842
- e.length > R.maxTableRows && f(
2836
+ return p(n, r, "Expected an array."), [];
2837
+ e.length > R.maxTableRows && p(
2843
2838
  n,
2844
2839
  r,
2845
2840
  `Must have ${R.maxTableRows} rows or fewer.`
2846
2841
  );
2847
2842
  const o = new Set(t.map((a) => a.key).filter(Boolean));
2848
2843
  return e.slice(0, R.maxTableRows).map((a, i) => {
2849
- const l = `${r}.${i}`, d = k(a, l, n);
2850
- return Object.keys(d).forEach((c) => {
2851
- o.has(c) || f(n, `${l}.${c}`, `Unexpected table cell "${c}".`);
2844
+ const c = `${r}.${i}`, d = E(a, c, n);
2845
+ return Object.keys(d).forEach((l) => {
2846
+ o.has(l) || p(n, `${c}.${l}`, `Unexpected table cell "${l}".`);
2852
2847
  }), Object.fromEntries(
2853
- t.map((c) => [
2854
- c.key,
2855
- gn(d[c.key] ?? null, `${l}.${c.key}`, n)
2848
+ t.map((l) => [
2849
+ l.key,
2850
+ In(d[l.key] ?? null, `${c}.${l.key}`, n)
2856
2851
  ])
2857
2852
  );
2858
2853
  });
2859
2854
  }
2860
- function In(e, r, t) {
2861
- const n = `content.blocks.${r}`, o = k(e, n, t), a = o.type;
2855
+ function wn(e, r, t) {
2856
+ const n = `content.blocks.${r}`, o = E(e, n, t), a = o.type;
2862
2857
  if (a === "heading") {
2863
2858
  I(o, n, ["type", "text", "level", "evidenceIds"], t);
2864
2859
  const i = o.level === void 0 || o.level === null ? void 0 : o.level === 2 || o.level === 3 ? o.level : void 0;
2865
- o.level !== void 0 && o.level !== null && i === void 0 && f(t, `${n}.level`, "Expected 2 or 3.");
2866
- const l = D(o.evidenceIds, `${n}.evidenceIds`, t);
2860
+ o.level !== void 0 && o.level !== null && i === void 0 && p(t, `${n}.level`, "Expected 2 or 3.");
2861
+ const c = D(o.evidenceIds, `${n}.evidenceIds`, t);
2867
2862
  return {
2868
2863
  type: "heading",
2869
2864
  text: $(
@@ -2873,7 +2868,7 @@ function In(e, r, t) {
2873
2868
  t
2874
2869
  ),
2875
2870
  ...i ? { level: i } : {},
2876
- ...l ? { evidenceIds: l } : {}
2871
+ ...c ? { evidenceIds: c } : {}
2877
2872
  };
2878
2873
  }
2879
2874
  if (a === "paragraph") {
@@ -2897,10 +2892,10 @@ function In(e, r, t) {
2897
2892
  `${n}.title`,
2898
2893
  h.contentTitle,
2899
2894
  t
2900
- ), l = O(
2895
+ ), c = B(
2901
2896
  o.severity,
2902
2897
  `${n}.severity`,
2903
- an,
2898
+ sn,
2904
2899
  "info, positive, warning, or critical",
2905
2900
  t
2906
2901
  );
@@ -2913,7 +2908,7 @@ function In(e, r, t) {
2913
2908
  h.contentText,
2914
2909
  t
2915
2910
  ),
2916
- ...l ? { severity: l } : {},
2911
+ ...c ? { severity: c } : {},
2917
2912
  evidenceIds: D(o.evidenceIds, `${n}.evidenceIds`, t, {
2918
2913
  required: !0
2919
2914
  }) ?? []
@@ -2926,12 +2921,12 @@ function In(e, r, t) {
2926
2921
  `${n}.title`,
2927
2922
  h.contentTitle,
2928
2923
  t
2929
- ), l = D(o.evidenceIds, `${n}.evidenceIds`, t);
2924
+ ), c = D(o.evidenceIds, `${n}.evidenceIds`, t);
2930
2925
  return {
2931
2926
  type: a,
2932
2927
  ...i ? { title: i } : {},
2933
- items: yn(o.items, `${n}.items`, t),
2934
- ...l ? { evidenceIds: l } : {}
2928
+ items: vn(o.items, `${n}.items`, t),
2929
+ ...c ? { evidenceIds: c } : {}
2935
2930
  };
2936
2931
  }
2937
2932
  if (a === "metric") {
@@ -2951,12 +2946,12 @@ function In(e, r, t) {
2951
2946
  t
2952
2947
  );
2953
2948
  const i = K(o.value, `${n}.value`, t) ?? "";
2954
- i === "" && f(
2949
+ i === "" && p(
2955
2950
  t,
2956
2951
  `${n}.value`,
2957
2952
  "Expected a non-empty string, number, or structured numeric value."
2958
2953
  );
2959
- const l = o.previousValue === void 0 || o.previousValue === null ? o.previousValue : K(
2954
+ const c = o.previousValue === void 0 || o.previousValue === null ? o.previousValue : K(
2960
2955
  o.previousValue,
2961
2956
  `${n}.previousValue`,
2962
2957
  t
@@ -2964,7 +2959,7 @@ function In(e, r, t) {
2964
2959
  o.delta,
2965
2960
  `${n}.delta`,
2966
2961
  t
2967
- ), c = o.percentChange === void 0 || o.percentChange === null ? o.percentChange : K(
2962
+ ), l = o.percentChange === void 0 || o.percentChange === null ? o.percentChange : K(
2968
2963
  o.percentChange,
2969
2964
  `${n}.percentChange`,
2970
2965
  t
@@ -2983,9 +2978,9 @@ function In(e, r, t) {
2983
2978
  t
2984
2979
  ),
2985
2980
  value: i,
2986
- ...l !== void 0 ? { previousValue: l } : {},
2981
+ ...c !== void 0 ? { previousValue: c } : {},
2987
2982
  ...d !== void 0 ? { delta: d } : {},
2988
- ...c !== void 0 ? { percentChange: c } : {},
2983
+ ...l !== void 0 ? { percentChange: l } : {},
2989
2984
  ...s ? { unit: s } : {},
2990
2985
  ...u ? { evidenceIds: u } : {}
2991
2986
  };
@@ -2997,17 +2992,17 @@ function In(e, r, t) {
2997
2992
  `${n}.title`,
2998
2993
  h.contentTitle,
2999
2994
  t
3000
- ), l = Array.isArray(o.tiles) ? o.tiles : [];
3001
- Array.isArray(o.tiles) || f(t, `${n}.tiles`, "Expected an array."), l.length === 0 && f(t, `${n}.tiles`, "Expected at least one tile."), l.length > R.maxKpiTiles && f(
2995
+ ), c = Array.isArray(o.tiles) ? o.tiles : [];
2996
+ Array.isArray(o.tiles) || p(t, `${n}.tiles`, "Expected an array."), c.length === 0 && p(t, `${n}.tiles`, "Expected at least one tile."), c.length > R.maxKpiTiles && p(
3002
2997
  t,
3003
2998
  `${n}.tiles`,
3004
2999
  `Must have ${R.maxKpiTiles} tiles or fewer.`
3005
3000
  );
3006
- const d = l.slice(0, R.maxKpiTiles).map((s, u) => {
3007
- const p = `${n}.tiles.${u}`, m = k(s, p, t);
3001
+ const d = c.slice(0, R.maxKpiTiles).map((s, u) => {
3002
+ const f = `${n}.tiles.${u}`, m = E(s, f, t);
3008
3003
  I(
3009
3004
  m,
3010
- p,
3005
+ f,
3011
3006
  [
3012
3007
  "label",
3013
3008
  "value",
@@ -3021,40 +3016,40 @@ function In(e, r, t) {
3021
3016
  );
3022
3017
  const g = K(
3023
3018
  m.value,
3024
- `${p}.value`,
3019
+ `${f}.value`,
3025
3020
  t
3026
3021
  ) ?? "";
3027
- g === "" && f(
3022
+ g === "" && p(
3028
3023
  t,
3029
- `${p}.value`,
3024
+ `${f}.value`,
3030
3025
  "Expected a non-empty string, number, or structured numeric value."
3031
3026
  );
3032
3027
  const y = m.previousValue === void 0 || m.previousValue === null ? m.previousValue : K(
3033
3028
  m.previousValue,
3034
- `${p}.previousValue`,
3029
+ `${f}.previousValue`,
3035
3030
  t
3036
3031
  ), b = m.delta === void 0 || m.delta === null ? m.delta : K(
3037
3032
  m.delta,
3038
- `${p}.delta`,
3033
+ `${f}.delta`,
3039
3034
  t
3040
3035
  ), C = m.percentChange === void 0 || m.percentChange === null ? m.percentChange : K(
3041
3036
  m.percentChange,
3042
- `${p}.percentChange`,
3037
+ `${f}.percentChange`,
3043
3038
  t
3044
3039
  ), v = x(
3045
3040
  m.unit,
3046
- `${p}.unit`,
3041
+ `${f}.unit`,
3047
3042
  h.contentTitle,
3048
3043
  t
3049
3044
  ), w = D(
3050
3045
  m.evidenceIds,
3051
- `${p}.evidenceIds`,
3046
+ `${f}.evidenceIds`,
3052
3047
  t
3053
3048
  );
3054
3049
  return {
3055
3050
  label: $(
3056
3051
  m.label,
3057
- `${p}.label`,
3052
+ `${f}.label`,
3058
3053
  h.contentTitle,
3059
3054
  t
3060
3055
  ),
@@ -3065,7 +3060,7 @@ function In(e, r, t) {
3065
3060
  ...v ? { unit: v } : {},
3066
3061
  ...w ? { evidenceIds: w } : {}
3067
3062
  };
3068
- }), c = D(
3063
+ }), l = D(
3069
3064
  o.evidenceIds,
3070
3065
  `${n}.evidenceIds`,
3071
3066
  t
@@ -3074,14 +3069,14 @@ function In(e, r, t) {
3074
3069
  type: "kpi_grid",
3075
3070
  ...i ? { title: i } : {},
3076
3071
  tiles: d,
3077
- ...c ? { evidenceIds: c } : {}
3072
+ ...l ? { evidenceIds: l } : {}
3078
3073
  };
3079
3074
  }
3080
3075
  if (a === "progress") {
3081
3076
  I(o, n, ["type", "label", "value", "detail", "evidenceIds"], t);
3082
3077
  const i = typeof o.value == "number" && Number.isFinite(o.value) ? o.value : 0;
3083
- (typeof o.value != "number" || !Number.isFinite(o.value)) && f(t, `${n}.value`, "Expected a finite number.");
3084
- const l = x(
3078
+ (typeof o.value != "number" || !Number.isFinite(o.value)) && p(t, `${n}.value`, "Expected a finite number.");
3079
+ const c = x(
3085
3080
  o.detail,
3086
3081
  `${n}.detail`,
3087
3082
  h.contentText,
@@ -3096,7 +3091,7 @@ function In(e, r, t) {
3096
3091
  t
3097
3092
  ),
3098
3093
  value: i,
3099
- ...l ? { detail: l } : {},
3094
+ ...c ? { detail: c } : {},
3100
3095
  ...d ? { evidenceIds: d } : {}
3101
3096
  };
3102
3097
  }
@@ -3107,7 +3102,7 @@ function In(e, r, t) {
3107
3102
  ["type", "id", "title", "columns", "rows", "caption", "totalRows", "evidenceIds"],
3108
3103
  t
3109
3104
  );
3110
- const i = vn(o.columns, `${n}.columns`, t), l = x(
3105
+ const i = Cn(o.columns, `${n}.columns`, t), c = x(
3111
3106
  o.title,
3112
3107
  `${n}.title`,
3113
3108
  h.contentTitle,
@@ -3117,12 +3112,12 @@ function In(e, r, t) {
3117
3112
  `${n}.id`,
3118
3113
  h.id,
3119
3114
  t
3120
- ), c = x(
3115
+ ), l = x(
3121
3116
  o.caption,
3122
3117
  `${n}.caption`,
3123
3118
  h.contentItem,
3124
3119
  t
3125
- ), s = mn(
3120
+ ), s = pn(
3126
3121
  o.totalRows,
3127
3122
  `${n}.totalRows`,
3128
3123
  t
@@ -3130,10 +3125,10 @@ function In(e, r, t) {
3130
3125
  return {
3131
3126
  type: "table",
3132
3127
  ...d ? { id: d } : {},
3133
- ...l ? { title: l } : {},
3128
+ ...c ? { title: c } : {},
3134
3129
  columns: i,
3135
- rows: bn(o.rows, `${n}.rows`, i, t),
3136
- ...c ? { caption: c } : {},
3130
+ rows: Tn(o.rows, `${n}.rows`, i, t),
3131
+ ...l ? { caption: l } : {},
3137
3132
  ...s !== void 0 ? { totalRows: s } : {},
3138
3133
  ...u ? { evidenceIds: u } : {}
3139
3134
  };
@@ -3161,7 +3156,7 @@ function In(e, r, t) {
3161
3156
  `${n}.title`,
3162
3157
  h.contentTitle,
3163
3158
  t
3164
- ), l = $(
3159
+ ), c = $(
3165
3160
  o.sql,
3166
3161
  `${n}.sql`,
3167
3162
  h.contentSql,
@@ -3170,11 +3165,11 @@ function In(e, r, t) {
3170
3165
  return {
3171
3166
  type: "sql",
3172
3167
  ...i ? { title: i } : {},
3173
- sql: l,
3168
+ sql: c,
3174
3169
  ...d ? { evidenceIds: d } : {}
3175
3170
  };
3176
3171
  }
3177
- return f(
3172
+ return p(
3178
3173
  t,
3179
3174
  `${n}.type`,
3180
3175
  "Expected heading, paragraph, finding, bullets, metric, kpi_grid, progress, table, actions, limitations, sql, or evidence_appendix."
@@ -3183,9 +3178,9 @@ function In(e, r, t) {
3183
3178
  text: ""
3184
3179
  };
3185
3180
  }
3186
- function Cn(e) {
3187
- const r = [], t = k(e, "content", r);
3188
- I(t, "content", ["version", "title", "summary", "blocks"], r), t.version !== 1 && f(r, "content.version", "Expected version 1.");
3181
+ function $n(e) {
3182
+ const r = [], t = E(e, "content", r);
3183
+ I(t, "content", ["version", "title", "summary", "blocks"], r), t.version !== 1 && p(r, "content.version", "Expected version 1.");
3189
3184
  const n = x(
3190
3185
  t.title,
3191
3186
  "content.title",
@@ -3197,14 +3192,14 @@ function Cn(e) {
3197
3192
  h.contentSummary,
3198
3193
  r
3199
3194
  );
3200
- Array.isArray(t.blocks) || f(r, "content.blocks", "Expected an array.");
3195
+ Array.isArray(t.blocks) || p(r, "content.blocks", "Expected an array.");
3201
3196
  const a = Array.isArray(t.blocks) ? t.blocks : [];
3202
- a.length === 0 && f(r, "content.blocks", "Expected at least one block."), a.length > R.maxBlocks && f(
3197
+ a.length === 0 && p(r, "content.blocks", "Expected at least one block."), a.length > R.maxBlocks && p(
3203
3198
  r,
3204
3199
  "content.blocks",
3205
3200
  `Must have ${R.maxBlocks} blocks or fewer.`
3206
3201
  );
3207
- const i = a.slice(0, R.maxBlocks).map((l, d) => In(l, d, r));
3202
+ const i = a.slice(0, R.maxBlocks).map((c, d) => wn(c, d, r));
3208
3203
  return Te(r), {
3209
3204
  version: 1,
3210
3205
  ...n ? { title: n } : {},
@@ -3212,11 +3207,11 @@ function Cn(e) {
3212
3207
  blocks: i
3213
3208
  };
3214
3209
  }
3215
- function No(e) {
3210
+ function Vo(e) {
3216
3211
  try {
3217
3212
  return {
3218
3213
  valid: !0,
3219
- value: Cn(e),
3214
+ value: $n(e),
3220
3215
  issues: []
3221
3216
  };
3222
3217
  } catch (r) {
@@ -3226,94 +3221,100 @@ function No(e) {
3226
3221
  }
3227
3222
  }
3228
3223
  function J(e, r, t, n) {
3229
- return typeof e == "string" && t.includes(e) ? e : (f(n, r, `Expected ${t.join(" or ")}.`), t[0]);
3224
+ return typeof e == "string" && t.includes(e) ? e : (p(n, r, `Expected ${t.join(" or ")}.`), t[0]);
3230
3225
  }
3231
- function O(e, r, t, n, o) {
3226
+ function B(e, r, t, n, o) {
3232
3227
  if (e != null) {
3233
3228
  if (typeof e == "string" && t.has(e))
3234
3229
  return e;
3235
- f(o, r, `Expected ${n}.`);
3230
+ p(o, r, `Expected ${n}.`);
3236
3231
  }
3237
3232
  }
3238
- function Tn(e, r, t) {
3233
+ function xn(e, r, t) {
3239
3234
  if (e != null) {
3240
3235
  if (!Array.isArray(e)) {
3241
- f(t, r, "Expected an array.");
3236
+ p(t, r, "Expected an array.");
3242
3237
  return;
3243
3238
  }
3244
3239
  return e;
3245
3240
  }
3246
3241
  }
3247
- function wn(e, r, t) {
3242
+ function En(e, r, t) {
3248
3243
  if (e != null) {
3249
3244
  if (!rt(e)) {
3250
- f(t, r, "Expected an object.");
3245
+ p(t, r, "Expected an object.");
3251
3246
  return;
3252
3247
  }
3253
3248
  return e;
3254
3249
  }
3255
3250
  }
3256
- function $n(e, r, t) {
3251
+ function kn(e, r, t) {
3257
3252
  if (e == null)
3258
3253
  return;
3259
- const n = k(e, r, t);
3260
- I(n, r, sn, t);
3254
+ const n = E(e, r, t);
3255
+ I(n, r, un, t);
3261
3256
  const o = {};
3262
3257
  if (n.matrix !== void 0) {
3263
- const c = k(n.matrix, `${r}.matrix`, t);
3264
- I(c, `${r}.matrix`, ["config", "content"], t);
3265
- const s = gt.safeParse(c.config);
3266
- s.success || f(t, `${r}.matrix.config`, "Expected a valid Matrix definition.");
3267
- const u = O(
3268
- c.content,
3258
+ const s = E(n.matrix, `${r}.matrix`, t);
3259
+ I(s, `${r}.matrix`, ["config", "content"], t);
3260
+ const u = gt.safeParse(s.config);
3261
+ u.success || p(t, `${r}.matrix.config`, "Expected a valid Matrix definition.");
3262
+ const f = B(
3263
+ s.content,
3269
3264
  `${r}.matrix.content`,
3270
3265
  /* @__PURE__ */ new Set(["current", "all", "flat"]),
3271
3266
  "current, all, or flat",
3272
3267
  t
3273
3268
  );
3274
- u || f(t, `${r}.matrix.content`, "Choose Matrix export content."), s.success && u && (o.matrix = { config: s.data, content: u });
3269
+ f || p(t, `${r}.matrix.content`, "Choose Matrix export content."), u.success && f && (o.matrix = { config: u.data, content: f });
3275
3270
  }
3276
- const a = O(
3271
+ const a = B(
3277
3272
  n.pageSize,
3278
3273
  `${r}.pageSize`,
3279
- en,
3274
+ rn,
3280
3275
  "letter, legal, a4, a3, or tabloid",
3281
3276
  t
3282
- ), i = O(
3277
+ ), i = B(
3283
3278
  n.orientation,
3284
3279
  `${r}.orientation`,
3285
- tn,
3280
+ nn,
3286
3281
  "portrait or landscape",
3287
3282
  t
3288
- ), l = O(
3283
+ ), c = B(
3289
3284
  n.delimiter,
3290
3285
  `${r}.delimiter`,
3291
- rn,
3286
+ on,
3292
3287
  "comma, semicolon, or tab",
3293
3288
  t
3294
- ), d = O(
3289
+ ), d = B(
3290
+ n.csvEncoding,
3291
+ `${r}.csvEncoding`,
3292
+ an,
3293
+ "utf-8-bom or utf-8",
3294
+ t
3295
+ ), l = B(
3295
3296
  n.sheetSelection,
3296
3297
  `${r}.sheetSelection`,
3297
- nn,
3298
+ cn,
3298
3299
  "current or all",
3299
3300
  t
3300
3301
  );
3301
- a && (o.pageSize = a), i && (o.orientation = i), l && (o.delimiter = l), d && (o.sheetSelection = d);
3302
- for (const c of [
3302
+ a && (o.pageSize = a), i && (o.orientation = i), c && (o.delimiter = c), d && (o.csvEncoding = d), l && (o.sheetSelection = l);
3303
+ for (const s of [
3303
3304
  "includeFilters",
3304
3305
  "includeTimestamp",
3305
3306
  "includeHeaders",
3306
3307
  "useFormattedValues",
3307
3308
  "allowDownload"
3308
3309
  ])
3309
- if (!(n[c] === void 0 || n[c] === null)) {
3310
- if (typeof n[c] != "boolean") {
3311
- f(t, `${r}.${c}`, "Expected a boolean.");
3310
+ if (!(n[s] === void 0 || n[s] === null)) {
3311
+ if (typeof n[s] != "boolean") {
3312
+ p(t, `${r}.${s}`, "Expected a boolean.");
3312
3313
  continue;
3313
3314
  }
3314
- o[c] = n[c];
3315
+ o[s] = n[s];
3315
3316
  }
3316
- for (const c of [
3317
+ for (const s of [
3317
3318
  "currentSheetId",
3318
3319
  "currentSheetName",
3319
3320
  "filterLine",
@@ -3321,15 +3322,15 @@ function $n(e, r, t) {
3321
3322
  "cardType",
3322
3323
  "theme"
3323
3324
  ]) {
3324
- const s = x(
3325
- n[c],
3326
- `${r}.${c}`,
3325
+ const u = x(
3326
+ n[s],
3327
+ `${r}.${s}`,
3327
3328
  h.id,
3328
3329
  t
3329
3330
  );
3330
- s && (o[c] = s);
3331
+ u && (o[s] = u);
3331
3332
  }
3332
- for (const c of [
3333
+ for (const s of [
3333
3334
  "filterValues",
3334
3335
  "inlineFilterValues",
3335
3336
  "sheetFilterValues",
@@ -3337,17 +3338,17 @@ function $n(e, r, t) {
3337
3338
  "cardControlDefinitions",
3338
3339
  "controlBindings"
3339
3340
  ]) {
3340
- const s = Tn(n[c], `${r}.${c}`, t);
3341
- s && (o[c] = s);
3341
+ const u = xn(n[s], `${r}.${s}`, t);
3342
+ u && (o[s] = u);
3342
3343
  }
3343
- for (const c of [
3344
+ for (const s of [
3344
3345
  "controlValues",
3345
3346
  "tablePreferences",
3346
3347
  "dashboardInputExecutionSnapshot",
3347
3348
  "printInputCapture"
3348
3349
  ]) {
3349
- const s = wn(n[c], `${r}.${c}`, t);
3350
- s && (o[c] = s);
3350
+ const u = En(n[s], `${r}.${s}`, t);
3351
+ u && (o[s] = u);
3351
3352
  }
3352
3353
  return Object.keys(o).length > 0 ? o : void 0;
3353
3354
  }
@@ -3361,15 +3362,15 @@ function se(e, r, t, n) {
3361
3362
  return o && (e.title = o), e;
3362
3363
  }
3363
3364
  function de(e, r, t, n) {
3364
- const o = $n(r, t, n);
3365
- return o != null && o.printInputCapture && e.type !== "dashboard" && f(
3365
+ const o = kn(r, t, n);
3366
+ return o != null && o.printInputCapture && e.type !== "dashboard" && p(
3366
3367
  n,
3367
3368
  `${t}.printInputCapture`,
3368
3369
  "Only a full dashboard attachment can carry printInputCapture."
3369
3370
  ), o && (e.settings = o), e;
3370
3371
  }
3371
- function xn(e, r, t) {
3372
- const n = `attachments.${r}`, o = k(e, n, t), a = o.type;
3372
+ function Sn(e, r, t) {
3373
+ const n = `attachments.${r}`, o = E(e, n, t), a = o.type;
3373
3374
  if (a === "dashboard") {
3374
3375
  I(
3375
3376
  o,
@@ -3459,13 +3460,13 @@ function xn(e, r, t) {
3459
3460
  );
3460
3461
  return de(i, o.settings, `${n}.settings`, t);
3461
3462
  }
3462
- return f(
3463
+ return p(
3463
3464
  t,
3464
3465
  `${n}.type`,
3465
3466
  "Expected dashboard, dashboard_sheet, document_sheet, or card."
3466
3467
  ), { type: "dashboard", dashboardId: "", format: "pdf" };
3467
3468
  }
3468
- function kn(e) {
3469
+ function _n(e) {
3469
3470
  switch (e.type) {
3470
3471
  case "dashboard":
3471
3472
  return `${e.type}:${e.dashboardId}:${e.format}`;
@@ -3480,24 +3481,24 @@ function ct(e, r) {
3480
3481
  if (e == null)
3481
3482
  return [];
3482
3483
  if (!Array.isArray(e))
3483
- return f(r, "attachments", "Expected an array."), [];
3484
- e.length > ce && f(
3484
+ return p(r, "attachments", "Expected an array."), [];
3485
+ e.length > ce && p(
3485
3486
  r,
3486
3487
  "attachments",
3487
3488
  `Choose ${ce} attachments or fewer.`
3488
3489
  );
3489
- const t = e.slice(0, ce).map((o, a) => xn(o, a, r)), n = /* @__PURE__ */ new Set();
3490
+ const t = e.slice(0, ce).map((o, a) => Sn(o, a, r)), n = /* @__PURE__ */ new Set();
3490
3491
  return t.forEach((o, a) => {
3491
- var l;
3492
- (l = o.settings) != null && l.matrix && (o.type !== "card" || o.settings.cardType !== "matrixTable" || o.settings.matrix.content === "flat" && o.format !== "csv") && f(r, `attachments.${a}.settings.matrix`, "Matrix settings require a matrixTable card attachment; flat content requires CSV.");
3493
- const i = kn(o);
3494
- n.has(i) && f(r, `attachments.${a}`, "Duplicate attachment."), n.add(i);
3492
+ var c;
3493
+ (c = o.settings) != null && c.matrix && (o.type !== "card" || o.settings.cardType !== "matrixTable" || o.settings.matrix.content === "flat" && o.format !== "csv") && p(r, `attachments.${a}.settings.matrix`, "Matrix settings require a matrixTable card attachment; flat content requires CSV.");
3494
+ const i = _n(o);
3495
+ n.has(i) && p(r, `attachments.${a}`, "Duplicate attachment."), n.add(i);
3495
3496
  }), t;
3496
3497
  }
3497
3498
  function lt(e, r) {
3498
3499
  if (e == null)
3499
3500
  return;
3500
- const t = k(e, "limits", r);
3501
+ const t = E(e, "limits", r);
3501
3502
  I(t, "limits", Object.keys(le), r);
3502
3503
  const n = {};
3503
3504
  return Object.keys(le).forEach((o) => {
@@ -3506,7 +3507,7 @@ function lt(e, r) {
3506
3507
  return;
3507
3508
  const i = le[o];
3508
3509
  if (typeof a != "number" || !Number.isInteger(a) || a < i.min || a > i.max) {
3509
- f(
3510
+ p(
3510
3511
  r,
3511
3512
  `limits.${o}`,
3512
3513
  `Expected an integer between ${i.min} and ${i.max}.`
@@ -3521,36 +3522,36 @@ function Te(e) {
3521
3522
  throw new oe(e);
3522
3523
  }
3523
3524
  function st(e, r, t) {
3524
- !(e.type === "generated_analysis" || e.type === "custom_message" && !!e.message.trim()) && r.length === 0 && f(
3525
+ !(e.type === "generated_analysis" || e.type === "custom_message" && !!e.message.trim()) && r.length === 0 && p(
3525
3526
  t,
3526
3527
  "body",
3527
3528
  "Add briefing instructions, a custom message, or at least one attachment."
3528
3529
  );
3529
3530
  }
3530
- function En(e, r, t) {
3531
+ function Fn(e, r, t) {
3531
3532
  e == null || e.forEach((n, o) => {
3532
3533
  const a = `${t}.${o}.scope`, i = n.scope.attachmentIndex;
3533
3534
  if (i === void 0)
3534
3535
  throw new G(
3535
3536
  `${a}.attachmentIndex must identify the attachment that owns this presentation entry.`
3536
3537
  );
3537
- const l = r[i];
3538
- if (!l)
3538
+ const c = r[i];
3539
+ if (!c)
3539
3540
  throw new G(
3540
3541
  `${a}.attachmentIndex must identify an existing attachment.`
3541
3542
  );
3542
- if (n.scope.dashboardId !== l.dashboardId)
3543
+ if (n.scope.dashboardId !== c.dashboardId)
3543
3544
  throw new G(
3544
3545
  `${a}.dashboardId must match the dashboard selected by the referenced attachment.`
3545
3546
  );
3546
- if (l.type === "card" && n.scope.cardId !== l.cardId)
3547
+ if (c.type === "card" && n.scope.cardId !== c.cardId)
3547
3548
  throw new G(
3548
3549
  `${a}.cardId must match the card selected by the referenced attachment.`
3549
3550
  );
3550
3551
  });
3551
3552
  }
3552
3553
  function dt(e) {
3553
- const r = [], t = k(e, "jobConfig", r);
3554
+ const r = [], t = E(e, "jobConfig", r);
3554
3555
  I(
3555
3556
  t,
3556
3557
  "jobConfig",
@@ -3564,23 +3565,23 @@ function dt(e) {
3564
3565
  "limits"
3565
3566
  ],
3566
3567
  r
3567
- ), t.kind !== fe && f(r, "kind", "Expected BRIEFING.");
3568
+ ), t.kind !== fe && p(r, "kind", "Expected BRIEFING.");
3568
3569
  let n;
3569
3570
  try {
3570
3571
  n = Et(
3571
3572
  t.presentationExecutionSnapshot
3572
3573
  );
3573
- } catch (c) {
3574
- if (c instanceof G)
3575
- throw c;
3576
- f(
3574
+ } catch (l) {
3575
+ if (l instanceof G)
3576
+ throw l;
3577
+ p(
3577
3578
  r,
3578
3579
  "jobConfig.presentationExecutionSnapshot",
3579
- c instanceof Error ? c.message : "Invalid presentation snapshot."
3580
+ l instanceof Error ? l.message : "Invalid presentation snapshot."
3580
3581
  );
3581
3582
  }
3582
- const o = nt(t.source, r), a = ot(t.body, r), i = ct(t.attachments, r), l = at(t.presentation, r), d = lt(t.limits, r);
3583
- return st(a, i, r), En(
3583
+ const o = nt(t.source, r), a = ot(t.body, r), i = ct(t.attachments, r), c = at(t.presentation, r), d = lt(t.limits, r);
3584
+ return st(a, i, r), Fn(
3584
3585
  n == null ? void 0 : n.resolvedFormats,
3585
3586
  i,
3586
3587
  "jobConfig.presentationExecutionSnapshot.resolvedFormats"
@@ -3590,21 +3591,21 @@ function dt(e) {
3590
3591
  source: o,
3591
3592
  body: a,
3592
3593
  attachments: i,
3593
- presentation: l,
3594
+ presentation: c,
3594
3595
  ...d ? { limits: d } : {}
3595
3596
  };
3596
3597
  }
3597
- function Lo(e) {
3598
+ function qo(e) {
3598
3599
  return dt({
3599
3600
  ...e,
3600
3601
  kind: fe
3601
3602
  });
3602
3603
  }
3603
3604
  function we(e, r, t, n = "deliveryConfig.recipients") {
3604
- const o = `${n}.${r}`, a = k(e, o, t), i = a.type;
3605
+ const o = `${n}.${r}`, a = E(e, o, t), i = a.type;
3605
3606
  if (i === "email") {
3606
3607
  I(a, o, ["type", "address", "name"], t);
3607
- const l = $(
3608
+ const c = $(
3608
3609
  a.address,
3609
3610
  `${o}.address`,
3610
3611
  h.id,
@@ -3615,9 +3616,9 @@ function we(e, r, t, n = "deliveryConfig.recipients") {
3615
3616
  h.attachmentTitle,
3616
3617
  t
3617
3618
  );
3618
- return l && !fn(l) && f(t, `${o}.address`, "Email address is invalid."), {
3619
+ return c && !hn(c) && p(t, `${o}.address`, "Email address is invalid."), {
3619
3620
  type: "email",
3620
- address: l,
3621
+ address: c,
3621
3622
  ...d ? { name: d } : {}
3622
3623
  };
3623
3624
  }
@@ -3645,24 +3646,24 @@ function we(e, r, t, n = "deliveryConfig.recipients") {
3645
3646
  h.id,
3646
3647
  t
3647
3648
  )
3648
- }) : (f(
3649
+ }) : (p(
3649
3650
  t,
3650
3651
  `${o}.type`,
3651
3652
  "Expected email, user, tenant_user, or group."
3652
3653
  ), { type: "email", address: "" });
3653
3654
  }
3654
- function Sn(e, r) {
3655
+ function Rn(e, r) {
3655
3656
  return e == null ? [] : Array.isArray(e) ? e.map(
3656
3657
  (t, n) => we(t, n, r)
3657
- ) : (f(r, "deliveryConfig.recipients", "Expected an array."), []);
3658
+ ) : (p(r, "deliveryConfig.recipients", "Expected an array."), []);
3658
3659
  }
3659
- function _n(e, r) {
3660
+ function An(e, r) {
3660
3661
  if (!Array.isArray(e))
3661
- return f(r, "deliveryConfig.channels", "Expected an array."), [];
3662
+ return p(r, "deliveryConfig.channels", "Expected an array."), [];
3662
3663
  const t = [];
3663
3664
  return e.forEach((n, o) => {
3664
3665
  if (!mt(n)) {
3665
- f(
3666
+ p(
3666
3667
  r,
3667
3668
  `deliveryConfig.channels.${o}`,
3668
3669
  "Expected EMAIL, WEBHOOK, SLACK, IN_APP, or TELEGRAM."
@@ -3672,29 +3673,29 @@ function _n(e, r) {
3672
3673
  t.includes(n) || t.push(n);
3673
3674
  }), t;
3674
3675
  }
3675
- function Fn(e, r, t) {
3676
+ function Dn(e, r, t) {
3676
3677
  if (e == null)
3677
3678
  return;
3678
- const n = k(e, r, t), o = {};
3679
+ const n = E(e, r, t), o = {};
3679
3680
  return Object.entries(n).forEach(([a, i]) => {
3680
3681
  if (typeof i != "string") {
3681
- f(t, `${r}.${a}`, "Expected a string.");
3682
+ p(t, `${r}.${a}`, "Expected a string.");
3682
3683
  return;
3683
3684
  }
3684
3685
  o[a] = i.trim();
3685
3686
  }), Object.keys(o).length > 0 ? o : void 0;
3686
3687
  }
3687
- function Rn(e, r, t) {
3688
+ function Mn(e, r, t) {
3688
3689
  if (e == null)
3689
3690
  return;
3690
- const n = k(e, r, t);
3691
+ const n = E(e, r, t);
3691
3692
  I(
3692
3693
  n,
3693
3694
  r,
3694
3695
  ["url", "method", "headers", "secretEncrypted"],
3695
3696
  t
3696
3697
  );
3697
- const o = n.method === void 0 || n.method === null ? void 0 : J(n.method, `${r}.method`, ["POST", "PUT"], t), a = Fn(n.headers, `${r}.headers`, t), i = x(
3698
+ const o = n.method === void 0 || n.method === null ? void 0 : J(n.method, `${r}.method`, ["POST", "PUT"], t), a = Dn(n.headers, `${r}.headers`, t), i = x(
3698
3699
  n.secretEncrypted,
3699
3700
  `${r}.secretEncrypted`,
3700
3701
  2e3,
@@ -3707,8 +3708,8 @@ function Rn(e, r, t) {
3707
3708
  ...i ? { secretEncrypted: i } : {}
3708
3709
  };
3709
3710
  }
3710
- function An(e, r, t) {
3711
- const n = k(e, r, t), o = n.type;
3711
+ function Pn(e, r, t) {
3712
+ const n = E(e, r, t), o = n.type;
3712
3713
  if (o === "channel") {
3713
3714
  I(
3714
3715
  n,
@@ -3739,20 +3740,20 @@ function An(e, r, t) {
3739
3740
  ...i !== void 0 ? { isPrivate: i } : {}
3740
3741
  };
3741
3742
  }
3742
- return o === "dm" ? (I(n, r, ["type", "recipient"], t), f(
3743
+ return o === "dm" ? (I(n, r, ["type", "recipient"], t), p(
3743
3744
  t,
3744
3745
  `${r}.type`,
3745
3746
  "Slack DM delivery is not supported in V1."
3746
3747
  ), {
3747
3748
  type: "dm",
3748
3749
  recipient: we(n.recipient, 0, t, `${r}.recipient`)
3749
- }) : (f(t, `${r}.type`, "Expected channel."), { type: "channel", channelId: "" });
3750
+ }) : (p(t, `${r}.type`, "Expected channel."), { type: "channel", channelId: "" });
3750
3751
  }
3751
- function Dn(e, r, t) {
3752
+ function On(e, r, t) {
3752
3753
  if (e == null)
3753
3754
  return;
3754
3755
  if (!Array.isArray(e)) {
3755
- f(t, r, "Expected an array.");
3756
+ p(t, r, "Expected an array.");
3756
3757
  return;
3757
3758
  }
3758
3759
  const n = e.map(
@@ -3760,10 +3761,10 @@ function Dn(e, r, t) {
3760
3761
  );
3761
3762
  return n.length > 0 ? n : void 0;
3762
3763
  }
3763
- function Mn(e, r, t) {
3764
+ function Bn(e, r, t) {
3764
3765
  if (e == null)
3765
3766
  return;
3766
- const n = k(e, r, t);
3767
+ const n = E(e, r, t);
3767
3768
  I(
3768
3769
  n,
3769
3770
  r,
@@ -3776,7 +3777,7 @@ function Mn(e, r, t) {
3776
3777
  ],
3777
3778
  t
3778
3779
  );
3779
- const o = Dn(
3780
+ const o = On(
3780
3781
  n.threadMentions,
3781
3782
  `${r}.threadMentions`,
3782
3783
  t
@@ -3790,14 +3791,14 @@ function Mn(e, r, t) {
3790
3791
  !0,
3791
3792
  `${r}.includeDashboardLink`,
3792
3793
  t
3793
- ), l = z(
3794
+ ), c = z(
3794
3795
  n.includeBriefingLink,
3795
3796
  !0,
3796
3797
  `${r}.includeBriefingLink`,
3797
3798
  t
3798
3799
  );
3799
3800
  return {
3800
- destination: An(
3801
+ destination: Pn(
3801
3802
  n.destination,
3802
3803
  `${r}.destination`,
3803
3804
  t
@@ -3805,11 +3806,11 @@ function Mn(e, r, t) {
3805
3806
  ...o ? { threadMentions: o } : {},
3806
3807
  ...n.postThreadDetail !== void 0 ? { postThreadDetail: a } : {},
3807
3808
  ...n.includeDashboardLink !== void 0 ? { includeDashboardLink: i } : {},
3808
- ...n.includeBriefingLink !== void 0 ? { includeBriefingLink: l } : {}
3809
+ ...n.includeBriefingLink !== void 0 ? { includeBriefingLink: c } : {}
3809
3810
  };
3810
3811
  }
3811
- function Pn(e, r, t) {
3812
- const n = k(e, r, t);
3812
+ function Kn(e, r, t) {
3813
+ const n = E(e, r, t);
3813
3814
  I(
3814
3815
  n,
3815
3816
  r,
@@ -3824,10 +3825,10 @@ function Pn(e, r, t) {
3824
3825
  ],
3825
3826
  t
3826
3827
  );
3827
- const o = O(
3828
+ const o = B(
3828
3829
  n.formatProfile,
3829
3830
  `${r}.formatProfile`,
3830
- on,
3831
+ ln,
3831
3832
  "concise, balanced, or detailed",
3832
3833
  t
3833
3834
  ), a = x(
@@ -3840,7 +3841,7 @@ function Pn(e, r, t) {
3840
3841
  `${r}.titleOverride`,
3841
3842
  500,
3842
3843
  t
3843
- ), l = x(
3844
+ ), c = x(
3844
3845
  n.summaryOverride,
3845
3846
  `${r}.summaryOverride`,
3846
3847
  2e3,
@@ -3850,11 +3851,11 @@ function Pn(e, r, t) {
3850
3851
  !0,
3851
3852
  `${r}.actionBlockVisible`,
3852
3853
  t
3853
- ), c = Rn(
3854
+ ), l = Mn(
3854
3855
  n.webhookConfig,
3855
3856
  `${r}.webhookConfig`,
3856
3857
  t
3857
- ), s = Mn(
3858
+ ), s = Bn(
3858
3859
  n.slackConfig,
3859
3860
  `${r}.slackConfig`,
3860
3861
  t
@@ -3863,59 +3864,59 @@ function Pn(e, r, t) {
3863
3864
  ...o ? { formatProfile: o } : {},
3864
3865
  ...a ? { subjectOverride: a } : {},
3865
3866
  ...i ? { titleOverride: i } : {},
3866
- ...l ? { summaryOverride: l } : {},
3867
+ ...c ? { summaryOverride: c } : {},
3867
3868
  ...n.actionBlockVisible !== void 0 ? { actionBlockVisible: d } : {},
3868
3869
  ...s ? { slackConfig: s } : {},
3869
- ...c ? { webhookConfig: c } : {}
3870
+ ...l ? { webhookConfig: l } : {}
3870
3871
  };
3871
3872
  }
3872
- function Bn(e, r) {
3873
+ function Nn(e, r) {
3873
3874
  if (e == null)
3874
3875
  return;
3875
- const t = k(e, "deliveryConfig.channelConfigs", r), n = {};
3876
+ const t = E(e, "deliveryConfig.channelConfigs", r), n = {};
3876
3877
  return Object.entries(t).forEach(([o, a]) => {
3877
3878
  if (!mt(o)) {
3878
- f(
3879
+ p(
3879
3880
  r,
3880
3881
  `deliveryConfig.channelConfigs.${o}`,
3881
3882
  "Expected a supported delivery channel."
3882
3883
  );
3883
3884
  return;
3884
3885
  }
3885
- n[o] = Pn(
3886
+ n[o] = Kn(
3886
3887
  a,
3887
3888
  `deliveryConfig.channelConfigs.${o}`,
3888
3889
  r
3889
3890
  );
3890
3891
  }), Object.keys(n).length > 0 ? n : void 0;
3891
3892
  }
3892
- function On(e, r) {
3893
- var d, c, s;
3893
+ function Ln(e, r) {
3894
+ var d, l, s;
3894
3895
  if (e == null)
3895
3896
  return null;
3896
- const t = k(e, "deliveryConfig", r);
3897
+ const t = E(e, "deliveryConfig", r);
3897
3898
  I(
3898
3899
  t,
3899
3900
  "deliveryConfig",
3900
3901
  ["recipients", "channels", "channelConfigs"],
3901
3902
  r
3902
3903
  );
3903
- const n = Bn(t.channelConfigs, r), o = Sn(t.recipients, r), a = _n(t.channels, r), i = ((c = (d = n == null ? void 0 : n.SLACK) == null ? void 0 : d.slackConfig) == null ? void 0 : c.destination.type) === "channel" && !!n.SLACK.slackConfig.destination.channelId.trim();
3904
+ const n = Nn(t.channelConfigs, r), o = Rn(t.recipients, r), a = An(t.channels, r), i = ((l = (d = n == null ? void 0 : n.SLACK) == null ? void 0 : d.slackConfig) == null ? void 0 : l.destination.type) === "channel" && !!n.SLACK.slackConfig.destination.channelId.trim();
3904
3905
  return a.some(
3905
3906
  (u) => u !== "SLACK"
3906
- ) && o.length === 0 && f(
3907
+ ) && o.length === 0 && p(
3907
3908
  r,
3908
3909
  "deliveryConfig.recipients",
3909
3910
  "Add at least one recipient or remove delivery config."
3910
- ), a.length === 0 && f(
3911
+ ), a.length === 0 && p(
3911
3912
  r,
3912
3913
  "deliveryConfig.channels",
3913
3914
  "Choose at least one delivery channel or remove delivery config."
3914
- ), a.includes("SLACK") && !i && f(
3915
+ ), a.includes("SLACK") && !i && p(
3915
3916
  r,
3916
3917
  "deliveryConfig.channelConfigs.SLACK.slackConfig.destination.channelId",
3917
3918
  "Choose a Slack channel destination."
3918
- ), !a.includes("SLACK") && ((s = n == null ? void 0 : n.SLACK) != null && s.slackConfig) && f(
3919
+ ), !a.includes("SLACK") && ((s = n == null ? void 0 : n.SLACK) != null && s.slackConfig) && p(
3919
3920
  r,
3920
3921
  "deliveryConfig.channelConfigs.SLACK",
3921
3922
  "Slack config requires SLACK in deliveryConfig.channels."
@@ -3926,7 +3927,7 @@ function On(e, r) {
3926
3927
  };
3927
3928
  }
3928
3929
  function $e(e) {
3929
- const r = [], t = k(e, "draft", r);
3930
+ const r = [], t = E(e, "draft", r);
3930
3931
  I(
3931
3932
  t,
3932
3933
  "draft",
@@ -3955,28 +3956,28 @@ function $e(e) {
3955
3956
  "description",
3956
3957
  h.description,
3957
3958
  r
3958
- ) ?? null, a = x(t.scheduleExpr, "scheduleExpr", 500, r) ?? null, i = x(t.timezone, "timezone", 200, r) ?? "UTC", l = un(t.status, r), d = nt(t.source, r), c = ot(t.body, r), s = ct(t.attachments, r), u = at(t.presentation, r), p = lt(t.limits, r), m = On(t.deliveryConfig, r);
3959
- return st(c, s, r), Te(r), {
3959
+ ) ?? null, a = x(t.scheduleExpr, "scheduleExpr", 500, r) ?? null, i = x(t.timezone, "timezone", 200, r) ?? "UTC", c = yn(t.status, r), d = nt(t.source, r), l = ot(t.body, r), s = ct(t.attachments, r), u = at(t.presentation, r), f = lt(t.limits, r), m = Ln(t.deliveryConfig, r);
3960
+ return st(l, s, r), Te(r), {
3960
3961
  name: n,
3961
3962
  description: o,
3962
- status: l,
3963
+ status: c,
3963
3964
  scheduleExpr: a,
3964
3965
  timezone: i,
3965
3966
  source: d,
3966
- body: c,
3967
+ body: l,
3967
3968
  attachments: s,
3968
3969
  presentation: u,
3969
- ...p ? { limits: p } : {},
3970
+ ...f ? { limits: f } : {},
3970
3971
  deliveryConfig: m
3971
3972
  };
3972
3973
  }
3973
- function zo(e) {
3974
+ function Uo(e) {
3974
3975
  return $e(e);
3975
3976
  }
3976
- function qo(e) {
3977
+ function jo(e) {
3977
3978
  return $e(e);
3978
3979
  }
3979
- function Vo(e) {
3980
+ function Go(e) {
3980
3981
  try {
3981
3982
  return { valid: !0, value: $e(e), issues: [] };
3982
3983
  } catch (r) {
@@ -3985,7 +3986,7 @@ function Vo(e) {
3985
3986
  throw r;
3986
3987
  }
3987
3988
  }
3988
- function Uo(e) {
3989
+ function Ho(e) {
3989
3990
  try {
3990
3991
  return { valid: !0, value: dt(e), issues: [] };
3991
3992
  } catch (r) {
@@ -3994,105 +3995,105 @@ function Uo(e) {
3994
3995
  throw r;
3995
3996
  }
3996
3997
  }
3997
- function jo(e) {
3998
+ function Wo(e) {
3998
3999
  return typeof e == "string" && tt.has(e);
3999
4000
  }
4000
4001
  function mt(e) {
4001
- return typeof e == "string" && Jr.has(e);
4002
+ return typeof e == "string" && tn.has(e);
4002
4003
  }
4003
4004
  export {
4004
- Pr as $,
4005
- fo as A,
4006
- $o as B,
4007
- Er as C,
4008
- ko as D,
4009
- So as E,
4005
+ Br as $,
4006
+ ho as A,
4007
+ ko as B,
4008
+ _r as C,
4009
+ _o as D,
4010
+ Ro as E,
4010
4011
  ne as F,
4011
- nr as G,
4012
- no as H,
4013
- yo as I,
4012
+ ar as G,
4013
+ io as H,
4014
+ vo as I,
4014
4015
  L as J,
4015
- lo as K,
4016
- Zt as L,
4017
- er as M,
4018
- tr as N,
4019
- ur as O,
4020
- Yt as P,
4021
- mr as Q,
4016
+ uo as K,
4017
+ Xt as L,
4018
+ rr as M,
4019
+ nr as N,
4020
+ pr as O,
4021
+ Qt as P,
4022
+ fr as Q,
4022
4023
  be as R,
4023
- ir as S,
4024
- po as T,
4025
- ao as U,
4026
- so as V,
4027
- mo as W,
4028
- uo as X,
4029
- Ve as Y,
4024
+ lr as S,
4025
+ go as T,
4026
+ lo as U,
4027
+ fo as V,
4028
+ po as W,
4029
+ yo as X,
4030
+ qe as Y,
4030
4031
  S as Z,
4031
- xo as _,
4032
- vr as a,
4032
+ So as _,
4033
+ Ir as a,
4033
4034
  Je as a0,
4034
- Ro as a1,
4035
- q as a2,
4036
- Do as a3,
4037
- jr as a4,
4038
- Mo as a5,
4035
+ Mo as a1,
4036
+ V as a2,
4037
+ Oo as a3,
4038
+ Hr as a4,
4039
+ Bo as a5,
4039
4040
  Qe as a6,
4040
- Fo as a7,
4041
- Wr as a8,
4042
- Po as a9,
4043
- Eo as aA,
4044
- _r as aB,
4045
- Sr as aC,
4046
- Yr as aD,
4047
- sr as aa,
4048
- pr as ab,
4041
+ Do as a7,
4042
+ Zr as a8,
4043
+ Ko as a9,
4044
+ Fo as aA,
4045
+ Rr as aB,
4046
+ Fr as aC,
4047
+ Qr as aD,
4048
+ mr as aa,
4049
+ hr as ab,
4049
4050
  Ue as ac,
4050
- go as ad,
4051
- _o as ae,
4051
+ Io as ad,
4052
+ Ao as ae,
4052
4053
  fe as af,
4053
- Zr as ag,
4054
+ Xr as ag,
4054
4055
  pe as ah,
4055
4056
  ce as ai,
4056
4057
  h as aj,
4057
4058
  R as ak,
4058
- Qr as al,
4059
- Xr as am,
4060
- Ko as an,
4059
+ Jr as al,
4060
+ en as am,
4061
+ zo as an,
4061
4062
  oe as ao,
4062
- Cn as ap,
4063
- No as aq,
4063
+ $n as ap,
4064
+ Vo as aq,
4064
4065
  dt as ar,
4065
- Lo as as,
4066
+ qo as as,
4066
4067
  $e as at,
4067
- zo as au,
4068
- qo as av,
4069
- Vo as aw,
4070
- Uo as ax,
4071
- jo as ay,
4068
+ Uo as au,
4069
+ jo as av,
4070
+ Go as aw,
4071
+ Ho as ax,
4072
+ Wo as ay,
4072
4073
  mt as az,
4073
- Io as b,
4074
- br as c,
4075
- Oo as d,
4076
- Ao as e,
4077
- Cr as f,
4078
- Ir as g,
4079
- Bo as h,
4074
+ wo as b,
4075
+ Cr as c,
4076
+ Lo as d,
4077
+ Po as e,
4078
+ wr as f,
4079
+ Tr as g,
4080
+ No as h,
4080
4081
  Se as i,
4081
4082
  Z as j,
4082
- To as k,
4083
- Co as l,
4083
+ xo as k,
4084
+ $o as l,
4084
4085
  Ge as m,
4085
- wo as n,
4086
- vo as o,
4086
+ Eo as n,
4087
+ Co as o,
4087
4088
  Ie as p,
4088
- bo as q,
4089
- Tr as r,
4090
- Xt as s,
4091
- ro as t,
4092
- co as u,
4093
- Jt as v,
4094
- io as w,
4095
- ho as x,
4089
+ To as q,
4090
+ $r as r,
4091
+ er as s,
4092
+ ao as t,
4093
+ mo as u,
4094
+ tr as v,
4095
+ so as w,
4096
+ bo as x,
4096
4097
  Le as y,
4097
- oo as z
4098
+ co as z
4098
4099
  };