react-semaphor 0.1.558 → 0.1.560

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 (139) hide show
  1. package/dist/analytics-protocol/index.js +368 -358
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +9 -9
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/analytics-base-schemas-CHLxsPfX.js +630 -0
  7. package/dist/chunks/{assistant-chat-BCWoP6Rf.js → assistant-chat-Bu2fFm_I.js} +206 -207
  8. package/dist/chunks/{bookmark-state-PjQpxbG7.js → bookmark-state-BFY9oNmr.js} +3 -3
  9. package/dist/chunks/{braces-D5Ucy7q1.js → braces-Da41xfUd.js} +1 -1
  10. package/dist/chunks/{comparison-window-caption-Dc7BaCMz.js → comparison-window-caption-4FNkMrzE.js} +213 -213
  11. package/dist/chunks/{context-DVy4HOU0.js → context-BgPDzLHZ.js} +1 -1
  12. package/dist/chunks/{custom-visual-inputs-B-DLRGrV.js → custom-visual-inputs-Dz-enUNR.js} +1 -1
  13. package/dist/chunks/{dashboard-wK6Bai4V.js → dashboard-_MeBuy67.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-Coqghdn6.js → dashboard-briefing-launcher-CEi4Pr_v.js} +1152 -1166
  15. package/dist/chunks/{dashboard-controls-BYWSM2RM.js → dashboard-controls-Bi7fyG-4.js} +98 -98
  16. package/dist/chunks/{dashboard-json-pPTB5gj0.js → dashboard-json-B1mU_OMa.js} +5 -5
  17. package/dist/chunks/{document-dashboard-inputs-PY_7Xm55.js → document-dashboard-inputs-CkWfDB8c.js} +64 -64
  18. package/dist/chunks/{edit-dashboard-visual-BODxuUeq.js → edit-dashboard-visual-0CJN31Y3.js} +8274 -8514
  19. package/dist/chunks/filter-reach-copy-BF4w4kI2.js +3738 -0
  20. package/dist/chunks/{filter-value-text-CUBpotVN.js → filter-value-text-CRC-K_l_.js} +3 -3
  21. package/dist/chunks/{global-date-filter-utils-BsFqnnbA.js → global-date-filter-utils-D8365uPH.js} +4088 -3416
  22. package/dist/chunks/{index-DP_wQl0v.js → index-DtHidOPV.js} +579 -604
  23. package/dist/chunks/{layout-grid-CkoXmv0L.js → layout-grid-BvsH4RY2.js} +1 -1
  24. package/dist/chunks/{list-filter-B4i25kuc.js → list-filter-Dg0otx5E.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-4GTUDheD.js → matrix-analytical-definition-CM18W8w6.js} +41 -41
  26. package/dist/chunks/{matrix-card-fS_4O7zA.js → matrix-card-HPskLaPy.js} +3 -3
  27. package/dist/chunks/{matrix-member-presentation-Dj7HaAHC.js → matrix-member-presentation-Bbrfrke4.js} +1 -1
  28. package/dist/chunks/{matrix-operation-contract-CpgLZ7E5.js → matrix-operation-contract-WPv4R-H_.js} +130 -130
  29. package/dist/chunks/{metric-comparison-C8LY7GG5.js → metric-comparison-ljMKYZKa.js} +2 -2
  30. package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-Ccn1zaxl.js} +1 -1
  31. package/dist/chunks/{palette-stlpjVk4.js → palette-Bsh376zO.js} +1 -1
  32. package/dist/chunks/{pivot-result-contract-expectations-DMk-mKhG.js → pivot-result-contract-expectations-Bl5suy4-.js} +602 -696
  33. package/dist/chunks/{pivot-result-identity-CrQ54Xbj.js → pivot-result-identity-vS9TSh4f.js} +1 -1
  34. package/dist/chunks/{raw-temporal-presentation-BI2z2LlB.js → raw-temporal-presentation-BHm7s-hz.js} +230 -274
  35. package/dist/chunks/{report-preferences-dialog-Dc-YyVwf.js → report-preferences-dialog-BV8L0SeS.js} +55 -55
  36. package/dist/chunks/{report-runtime-context-CohdtiMg.js → report-runtime-context-BZQh9ywy.js} +2 -2
  37. package/dist/chunks/{resolve-dashboard-input-context-BZYI1hB0.js → resolve-dashboard-input-context-CAMiWvyR.js} +2021 -2239
  38. package/dist/chunks/{save-C1dgxgAu.js → save-B5EAsgQF.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-CIBoMq46.js → saved-dashboard-context-n2Wn11cV.js} +57 -57
  40. package/dist/chunks/{selection-reducer-_d6aKJnj.js → selection-reducer-D0YnaAD9.js} +1 -1
  41. package/dist/chunks/{semaphor-ready-indicator-ERTLU7B4.js → semaphor-ready-indicator-XLBLOJ2V.js} +38446 -39176
  42. package/dist/chunks/{shelf-drop-preview-context-fEnx6iL_.js → shelf-drop-preview-context-DHMa54a-.js} +570 -570
  43. package/dist/chunks/source-entity-resolution-dUG5VWRm.js +607 -0
  44. package/dist/chunks/{switch-BqUan2mN.js → switch-ByxH4M7t.js} +3 -3
  45. package/dist/chunks/{table-export-sheet-CTCTA_bd.js → table-export-sheet-C_GdeTYU.js} +1 -1
  46. package/dist/chunks/{table-settings-DF1gdVQR.js → table-settings-Imz0FgWi.js} +8 -8
  47. package/dist/chunks/{temporal-input-presentation-DoSniQj1.js → temporal-input-presentation-uvNK_tM0.js} +1109 -820
  48. package/dist/chunks/{token-types-DFyLflLY.js → token-types-CQtXUVMy.js} +1 -1
  49. package/dist/chunks/{upload-DcoyjkRV.js → upload-wbR-NVzq.js} +1 -1
  50. package/dist/chunks/{use-create-flow-overlay-state-xhb9YFg-.js → use-create-flow-overlay-state-CEBaLOKC.js} +6 -6
  51. package/dist/chunks/validators-CXTneCA4.js +3453 -0
  52. package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-B1n_WjW3.js} +1 -1
  53. package/dist/dashboard/index.js +2 -2
  54. package/dist/dashboard-authoring/index.js +2207 -1496
  55. package/dist/data-app-sdk/index.js +20 -20
  56. package/dist/data-app-sdk-adapters/index.js +3 -3
  57. package/dist/data-app-sdk-validation/index.js +6 -6
  58. package/dist/format-utils/index.js +181 -176
  59. package/dist/index.js +22 -22
  60. package/dist/report-runtime-context/index.js +2 -2
  61. package/dist/style.css +1 -1
  62. package/dist/surfboard/index.js +2 -2
  63. package/dist/types/components/editor/editor-aside/utils.d.ts +1 -1
  64. package/dist/types/components/visual/data-table/types/data-table.d.ts +5 -20
  65. package/dist/types/index.js +6 -6
  66. package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
  67. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
  68. package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
  69. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
  70. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
  71. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
  72. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  73. package/dist/types/lib/stores/editor-store.d.ts +39 -9
  74. package/dist/types/lib/stores/table-actions.d.ts +9 -3
  75. package/dist/types/lib/table-formatting/index.d.ts +0 -2
  76. package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
  77. package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
  78. package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
  79. package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
  80. package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
  81. package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
  82. package/dist/types/lib/types/common-types.d.ts +40 -47
  83. package/dist/types/lib/types/explorer-types.d.ts +13 -44
  84. package/dist/types/lib/utils/card-config-utils.d.ts +9 -1
  85. package/dist/types/lib/utils/card-definition.d.ts +9 -187
  86. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +159 -513
  87. package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
  88. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
  89. package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
  90. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
  91. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
  92. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
  93. package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
  94. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
  95. package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
  96. package/dist/types/shared/analytics-protocol/source-capabilities.d.ts +21 -0
  97. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
  98. package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
  99. package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
  100. package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
  101. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
  102. package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
  103. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +24 -24
  104. package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
  105. package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
  106. package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
  107. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +14 -0
  108. package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
  109. package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
  110. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
  111. package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
  112. package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
  113. package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
  114. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
  115. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +2 -0
  116. package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
  117. package/dist/types/shared/dashboard-authoring/legacy-table-routing.d.ts +4 -2
  118. package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
  119. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
  120. package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
  121. package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
  122. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -1
  123. package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
  124. package/dist/types/shared/format-utils/index.d.ts +2 -0
  125. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
  126. package/dist/types/shared/format-utils/raw-temporal.d.ts +15 -1
  127. package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
  128. package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
  129. package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
  130. package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
  131. package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
  132. package/package.json +1 -1
  133. package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
  134. package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
  135. package/dist/chunks/filter-reach-copy-BvJH9JO-.js +0 -3411
  136. package/dist/chunks/source-entity-resolution-DXW1HpKf.js +0 -816
  137. package/dist/chunks/validators-hmfNNQz8.js +0 -3595
  138. package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
  139. package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
@@ -1,23 +1,23 @@
1
- var Fe = Object.defineProperty;
2
- var Re = (e, n, t) => n in e ? Fe(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
- var L = (e, n, t) => Re(e, typeof n != "symbol" ? n + "" : n, t);
4
- import { ai as Ne, L as Be, r as ae, E as se, k as Me, K as Le, P as B } from "./temporal-input-presentation-DoSniQj1.js";
5
- import { Y as J, ab as Ue, o as Pe } from "./validators-hmfNNQz8.js";
6
- import { l as ze, C as Ve } from "./export-file-format-C-tJsxsf.js";
1
+ var De = Object.defineProperty;
2
+ var _e = (e, n, t) => n in e ? De(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
+ var R = (e, n, t) => _e(e, typeof n != "symbol" ? n + "" : n, t);
4
+ import { af as Oe, O as Fe, r as re, G as le, l as Ne, N as Re, P as N } from "./temporal-input-presentation-uvNK_tM0.js";
5
+ import { a4 as W, aj as Be, o as Me } from "./validators-CXTneCA4.js";
6
+ import { l as Le, C as Ue } from "./export-file-format-C-tJsxsf.js";
7
7
  import { z as y } from "zod";
8
- import { af as je, ah as qe, U as Ke } from "./matrix-operation-contract-CpgLZ7E5.js";
9
- import "./analytics-base-schemas-BUFUoO6G.js";
8
+ import { af as Pe, ah as Ve, U as ze } from "./matrix-operation-contract-WPv4R-H_.js";
9
+ import "./analytics-base-schemas-CHLxsPfX.js";
10
10
  import "../value-format-preferences/index.js";
11
- import { r as He } from "./rendered-file-D8xEuVVx.js";
12
- import { cQ as Ge, cR as We, cS as Xe, r as Ze, n as Ye } from "./global-date-filter-utils-BsFqnnbA.js";
13
- import { r as Je } from "./matrix-card-fS_4O7zA.js";
14
- import { z as Qe } from "./table-settings-DF1gdVQR.js";
15
- import { r as et, a as tt, b as nt, c as rt, d as ot } from "./raw-temporal-presentation-BI2z2LlB.js";
11
+ import { r as je } from "./rendered-file-D8xEuVVx.js";
12
+ import { N as qe, O as Ke, P as He, r as Ge, n as We, a as Xe } from "./global-date-filter-utils-D8365uPH.js";
13
+ import { r as Ze } from "./matrix-card-HPskLaPy.js";
14
+ import { x as Ye } from "./table-settings-Imz0FgWi.js";
15
+ import { r as Je, a as Qe, b as et } from "./raw-temporal-presentation-BHm7s-hz.js";
16
16
  import "./index-CJW5BdWT.js";
17
17
  import "./index-CuHybtft.js";
18
18
  import "./_commonjsHelpers-DimLPMtv.js";
19
- import { f as at, r as it, b as ct, g as lt } from "./custom-visual-inputs-B-DLRGrV.js";
20
- const dt = /* @__PURE__ */ new Set(["table", "detailTable"]), st = /* @__PURE__ */ new Set([
19
+ import { f as tt, r as nt, b as rt, g as ot } from "./custom-visual-inputs-Dz-enUNR.js";
20
+ const at = /* @__PURE__ */ new Set(["table", "detailTable"]), it = /* @__PURE__ */ new Set([
21
21
  "bar",
22
22
  "horizontalBar",
23
23
  "line",
@@ -45,30 +45,30 @@ const dt = /* @__PURE__ */ new Set(["table", "detailTable"]), st = /* @__PURE__
45
45
  "treemap",
46
46
  "custom"
47
47
  ]);
48
- function Xn(e) {
48
+ function Kn(e) {
49
49
  var o, a, i;
50
- const n = st.has(e.type) && (e.type !== "custom" || !!((o = e.customCardPreferences) != null && o.url));
50
+ const n = it.has(e.type) && (e.type !== "custom" || !!((o = e.customCardPreferences) != null && o.url));
51
51
  let t = !1;
52
52
  try {
53
- t = !!Je(e);
53
+ t = !!Ze(e);
54
54
  } catch {
55
55
  return { formats: [], defaultFormat: null };
56
56
  }
57
- return e.type === "text" || !n || !t && Ge(e) ? { formats: [], defaultFormat: null } : {
58
- formats: ut({
57
+ return e.type === "text" || !n || !t && qe(e) ? { formats: [], defaultFormat: null } : {
58
+ formats: dt({
59
59
  cardType: e.type,
60
60
  allowDownload: (a = e.preferences) == null ? void 0 : a.allowDownload
61
61
  }).filter((c) => c !== "xlsx" || e.type !== "matrixTable" || t),
62
- defaultFormat: pt({
62
+ defaultFormat: st({
63
63
  cardType: e.type,
64
64
  allowDownload: (i = e.preferences) == null ? void 0 : i.allowDownload
65
65
  })
66
66
  };
67
67
  }
68
- function Q(e) {
68
+ function X(e) {
69
69
  return e === "table" || e === "detailTable";
70
70
  }
71
- function mt(e) {
71
+ function ct(e) {
72
72
  var t, r;
73
73
  if (e.type !== "card")
74
74
  return { kind: "rendered", format: e.format };
@@ -80,33 +80,33 @@ function mt(e) {
80
80
  return n ? { kind: "matrix_pdf" } : { kind: "rendered", format: "pdf" };
81
81
  case "csv":
82
82
  case "xlsx":
83
- return n || Q((r = e.settings) == null ? void 0 : r.cardType) ? { kind: "export_job", format: e.format } : { kind: "rendered", format: "csv" };
83
+ return n || X((r = e.settings) == null ? void 0 : r.cardType) ? { kind: "export_job", format: e.format } : { kind: "rendered", format: "csv" };
84
84
  }
85
85
  }
86
- function Zn(e) {
87
- return mt(e).kind === "export_job";
86
+ function Hn(e) {
87
+ return ct(e).kind === "export_job";
88
88
  }
89
- function ft(e) {
90
- const { label: n, extension: t, contentType: r } = e === "pdf" || e === "png" ? He(e) : ze(e);
89
+ function lt(e) {
90
+ const { label: n, extension: t, contentType: r } = e === "pdf" || e === "png" ? je(e) : Le(e);
91
91
  return { label: n, extension: t, contentType: r };
92
92
  }
93
- function ut(e) {
94
- return e.allowDownload === !1 ? ["pdf", "png"] : e.cardType === "matrixTable" || Q(e.cardType) ? ["pdf", "png", "csv", "xlsx"] : ["pdf", "png", "csv"];
93
+ function dt(e) {
94
+ return e.allowDownload === !1 ? ["pdf", "png"] : e.cardType === "matrixTable" || X(e.cardType) ? ["pdf", "png", "csv", "xlsx"] : ["pdf", "png", "csv"];
95
95
  }
96
- function Yn(e) {
97
- return ft(e).label;
96
+ function Gn(e) {
97
+ return lt(e).label;
98
98
  }
99
- function pt(e) {
100
- return dt.has(e.cardType) && e.allowDownload !== !1 ? "csv" : "pdf";
99
+ function st(e) {
100
+ return at.has(e.cardType) && e.allowDownload !== !1 ? "csv" : "pdf";
101
101
  }
102
- function Jn(e) {
103
- const { config: n } = e, t = Ne({
102
+ function Wn(e) {
103
+ const { config: n } = e, t = Oe({
104
104
  spec: n.spec,
105
105
  presentation: n.presentation,
106
106
  defaults: n.defaultView,
107
107
  session: e.purpose === "manual" ? e.session : void 0
108
108
  });
109
- return J.parse({
109
+ return W.parse({
110
110
  spec: t.spec,
111
111
  presentation: t.presentation,
112
112
  ...e.content === "flat" ? { mode: "flat", format: e.format === "xlsx" ? "xlsx" : "csv" } : {
@@ -120,7 +120,7 @@ function Jn(e) {
120
120
  }
121
121
  });
122
122
  }
123
- const ht = y.object({
123
+ const mt = y.object({
124
124
  connection_id: y.string().min(1),
125
125
  cardType: y.literal("matrixTable"),
126
126
  resultOwner: y.literal("config"),
@@ -135,11 +135,11 @@ const ht = y.object({
135
135
  semanticDomainId: y.string().optional()
136
136
  }).passthrough(),
137
137
  active_filters: y.array(y.unknown()).default([])
138
- }).passthrough(), Qn = ht.extend({
138
+ }).passthrough(), Xn = mt.extend({
139
139
  dashboardId: y.string().min(1),
140
140
  cardId: y.string().min(1),
141
141
  formatOptions: y.object({
142
- matrix: J,
142
+ matrix: W,
143
143
  acquisition: y.literal("continuation").optional(),
144
144
  presentationExecutionSnapshot: y.unknown()
145
145
  }).passthrough().superRefine((e, n) => {
@@ -150,7 +150,7 @@ const ht = y.object({
150
150
  });
151
151
  })
152
152
  });
153
- function er(e) {
153
+ function Zn(e) {
154
154
  return {
155
155
  ...e.controls,
156
156
  type: "card",
@@ -178,215 +178,190 @@ function er(e) {
178
178
  delimiter: e.delimiter,
179
179
  includeHeaders: e.includeHeaders,
180
180
  timezone: e.reportContext.calendar.tz,
181
- presentationExecutionSnapshot: Be({
181
+ presentationExecutionSnapshot: Fe({
182
182
  reportContext: e.reportContext,
183
183
  resolvedFormats: []
184
184
  })
185
185
  }
186
186
  };
187
187
  }
188
- const K = y.number().int().nonnegative(), tr = y.discriminatedUnion("status", [
188
+ const V = y.number().int().nonnegative(), Yn = y.discriminatedUnion("status", [
189
189
  y.object({
190
190
  status: y.literal("ok"),
191
- request: J,
192
- layout: je,
193
- rows: y.array(qe).readonly(),
194
- usage: y.object({ rows: K, cells: K, bytes: K }).strict()
191
+ request: W,
192
+ layout: Pe,
193
+ rows: y.array(Ve).readonly(),
194
+ usage: y.object({ rows: V, cells: V, bytes: V }).strict()
195
195
  }).strict(),
196
196
  y.object({
197
197
  status: y.literal("failed"),
198
198
  failure: y.object({
199
- code: y.enum(Ke),
199
+ code: y.enum(ze),
200
200
  limit: y.enum(["rows", "bytes"]).optional(),
201
201
  message: y.string().min(1),
202
202
  retryable: y.boolean()
203
203
  }).strict()
204
204
  }).strict()
205
205
  ]);
206
- function ie(e) {
206
+ function oe(e) {
207
207
  return !e || typeof e != "object" ? !1 : Array.isArray(e.cards);
208
208
  }
209
- function yt(e) {
209
+ function ft(e) {
210
210
  if (!e)
211
211
  return null;
212
212
  if (typeof e == "string")
213
213
  try {
214
214
  const n = JSON.parse(e);
215
- return ie(n) ? n : null;
215
+ return oe(n) ? n : null;
216
216
  } catch {
217
217
  return null;
218
218
  }
219
- return ie(e) ? e : null;
219
+ return oe(e) ? e : null;
220
220
  }
221
- function me(e) {
221
+ function de(e) {
222
222
  var n;
223
223
  return (n = e == null ? void 0 : e.cards) != null && n.length ? e.activeCardId && e.cards.find((t) => t.id === e.activeCardId) || e.cards[0] : null;
224
224
  }
225
- function nr(e) {
225
+ function Jn(e) {
226
226
  var t;
227
227
  const n = (e == null ? void 0 : e.frameObject) ?? ((t = e == null ? void 0 : e.visual) == null ? void 0 : t.frameObject);
228
- return me(yt(n));
228
+ return de(ft(n));
229
229
  }
230
- class U extends Error {
230
+ class B extends Error {
231
231
  constructor(t) {
232
232
  const r = t.cardId ? `card "${t.cardId}"` : t.sheetId ? `sheet "${t.sheetId}"` : `dashboard "${t.dashboardId}"`;
233
233
  super(
234
234
  `Unable to resolve ${r} while capturing report presentation. Refresh the authoring page and select the attachment again.`
235
235
  );
236
- L(this, "code", "temporal_snapshot_target_not_found");
237
- L(this, "selection");
236
+ R(this, "code", "temporal_snapshot_target_not_found");
237
+ R(this, "selection");
238
238
  this.name = "TemporalSnapshotSelectionError", this.selection = t;
239
239
  }
240
240
  }
241
- function gt(e, n) {
241
+ function ut(e, n) {
242
242
  var o;
243
243
  const t = [], r = /* @__PURE__ */ new Map();
244
244
  for (const a of n) {
245
245
  if (a.dashboardId !== e.id)
246
- throw new U(a);
246
+ throw new B(a);
247
247
  const i = (e.sheets || []).filter(
248
248
  (l) => !a.sheetId || a.sheetId === l.id
249
249
  );
250
250
  if (a.sheetId && i.length === 0)
251
- throw new U(a);
251
+ throw new B(a);
252
252
  let c = !a.cardId;
253
253
  for (const l of i) {
254
254
  const m = (((o = l.document) == null ? void 0 : o.sections) || []).flatMap(
255
- (h) => Qe(h)
255
+ (p) => Ye(p)
256
256
  ), s = (l.frames || []).flatMap(
257
- (h) => bt(h, a.cardId)
257
+ (p) => pt(p, a.cardId)
258
258
  );
259
259
  s.length > 0 && (c = !0);
260
260
  const u = [
261
261
  ...s,
262
262
  ...(l.cards || []).filter(
263
- (h) => !a.cardId || a.cardId === h.id
263
+ (p) => !a.cardId || a.cardId === p.id
264
264
  ),
265
265
  ...m.filter(
266
- (h) => !a.cardId || a.cardId === h.id
266
+ (p) => !a.cardId || a.cardId === p.id
267
267
  )
268
268
  ];
269
- for (const h of u) {
269
+ for (const p of u) {
270
270
  c = !0;
271
271
  const g = r.get(a.attachmentIndex) ?? /* @__PURE__ */ new Set();
272
- g.has(h.id) || (g.add(h.id), r.set(a.attachmentIndex, g), t.push({
273
- card: h,
272
+ g.has(p.id) || (g.add(p.id), r.set(a.attachmentIndex, g), t.push({
273
+ card: p,
274
274
  ...a.attachmentIndex !== void 0 ? { attachmentIndex: a.attachmentIndex } : {}
275
275
  }));
276
276
  }
277
277
  }
278
278
  if (!c)
279
- throw new U(a);
279
+ throw new B(a);
280
280
  }
281
281
  return t;
282
282
  }
283
- function bt(e, n) {
283
+ function pt(e, n) {
284
284
  var i;
285
- const t = n ? (i = e.cards) == null ? void 0 : i.find((c) => c.id === n) : me(e);
285
+ const t = n ? (i = e.cards) == null ? void 0 : i.find((c) => c.id === n) : de(e);
286
286
  if (!t) return [];
287
- const r = at(e, t), o = (e.cards || []).filter(
287
+ const r = tt(e, t), o = (e.cards || []).filter(
288
288
  (c) => {
289
289
  var l;
290
290
  return typeof ((l = c.customCardPreferences) == null ? void 0 : l.slotIndex) == "number";
291
291
  }
292
- ).length > 1, a = r != null && (it(r) === "multiple" || o);
293
- return !r || !a ? [t] : ct(
294
- lt({
292
+ ).length > 1, a = r != null && (nt(r) === "multiple" || o);
293
+ return !r || !a ? [t] : rt(
294
+ ot({
295
295
  frame: e,
296
296
  configCard: r,
297
297
  isMultiInputVisual: !0
298
298
  })
299
299
  ).filter((c) => c !== null);
300
300
  }
301
- function rr(e) {
302
- return gt(e.dashboard, e.selections).flatMap(
301
+ function Qn(e) {
302
+ return ut(e.dashboard, e.selections).flatMap(
303
303
  ({ card: n, attachmentIndex: t }) => {
304
- var s, u, h, g;
305
- const r = ((s = e.resolveCardConfig) == null ? void 0 : s.call(e, n)) ?? n.config, o = We({
304
+ var s, u;
305
+ const r = ((s = e.resolveCardConfig) == null ? void 0 : s.call(e, n)) ?? n.config, o = Ke({
306
306
  card: n,
307
307
  cardConfig: r
308
308
  }), a = {
309
309
  dashboardId: e.dashboard.id,
310
310
  cardId: n.id,
311
311
  ...t !== void 0 ? { attachmentIndex: t } : {}
312
- }, i = o ? o.fields.map((E) => ({
312
+ }, i = o ? o.fields.map((p) => ({
313
313
  scope: a,
314
314
  target: {
315
315
  kind: "field",
316
- fieldId: E.id,
317
- role: E.role
316
+ fieldId: p.id,
317
+ role: p.role
318
318
  },
319
- format: Xe(
320
- E,
319
+ format: He(
320
+ p,
321
321
  {
322
322
  dateStyle: e.valueFormatPreferences.dateStyle,
323
323
  dateTime: { ...e.valueFormatPreferences.dateTime }
324
324
  },
325
325
  e.valueFormatPreferences.locale
326
326
  )
327
- })) : [], c = [], l = Ze(n, r), m = Ye(
327
+ })) : [], c = [], l = Ge(n, r), m = We(
328
328
  n.python || ""
329
329
  );
330
330
  if (n.type === "detailTable" && l === "config") {
331
- const E = (r == null ? void 0 : r.detailColumns) || [], C = [
332
- ...((r == null ? void 0 : r.groupByColumns) || []).map(($) => ({
333
- field: $,
334
- role: "groupby"
335
- })),
336
- ...((r == null ? void 0 : r.metricColumns) || []).map(($) => ({
337
- field: $,
338
- role: "metric"
339
- })),
340
- ...((r == null ? void 0 : r.pivotByColumns) || []).map(($) => ({
341
- field: $,
342
- role: "pivotby"
343
- })),
344
- ...E.map(($) => ({
345
- field: $,
346
- role: "detail"
347
- }))
348
- ], _ = /* @__PURE__ */ new Map(), M = new Set(
349
- C.map(
350
- ({ field: $, role: T }) => et($, T)
351
- )
352
- );
353
- for (const { field: $ } of C) {
354
- const T = $.label;
355
- T && _.set(T, (_.get(T) || 0) + 1);
356
- }
357
- for (const $ of E) {
358
- const T = Ue($.dataType);
359
- if (T !== "date" && T !== "datetime") continue;
360
- const Oe = tt($), q = $.label, oe = nt({
361
- label: q,
362
- labelCount: q && _.get(q) || 0,
363
- rawKey: Oe,
364
- rawKeys: M
365
- });
366
- if (!oe) throw new U(a);
331
+ const p = (r == null ? void 0 : r.detailColumns) || [], g = Je({
332
+ groupByColumns: r == null ? void 0 : r.groupByColumns,
333
+ metricColumns: r == null ? void 0 : r.metricColumns,
334
+ pivotByColumns: r == null ? void 0 : r.pivotByColumns,
335
+ detailColumns: p
336
+ });
337
+ for (const E of p) {
338
+ const A = Be(E.dataType);
339
+ if (A !== "date" && A !== "datetime") continue;
340
+ const F = g.get(E);
341
+ if (!F) throw new B(a);
367
342
  c.push({
368
343
  scope: a,
369
- target: { kind: "column", columnKey: oe },
370
- format: ae({
371
- format: rt($),
344
+ target: { kind: "column", columnKey: F },
345
+ format: re({
346
+ format: Qe(E),
372
347
  preferences: e.valueFormatPreferences,
373
348
  calendar: e.calendar
374
349
  })
375
350
  });
376
351
  }
377
352
  } else if (l === "freeform" && ((u = n.sql) != null && u.trim()) && !m.trim())
378
- for (const [E, C] of Object.entries(
379
- ((g = (h = n.preferences) == null ? void 0 : h.tablePrefs) == null ? void 0 : g.columnSettingsMap) || {}
353
+ for (const [p, g] of Object.entries(
354
+ Xe(n)
380
355
  )) {
381
- if (C.type !== "date") continue;
382
- const _ = ot(
383
- C.dateFormat
356
+ if (g.type !== "date") continue;
357
+ const E = et(
358
+ g.dateFormat
384
359
  );
385
- _ && c.push({
360
+ E && c.push({
386
361
  scope: a,
387
- target: { kind: "column", columnKey: E },
388
- format: ae({
389
- format: _,
362
+ target: { kind: "column", columnKey: p },
363
+ format: re({
364
+ format: E,
390
365
  preferences: e.valueFormatPreferences,
391
366
  calendar: e.calendar
392
367
  })
@@ -396,13 +371,13 @@ function rr(e) {
396
371
  }
397
372
  );
398
373
  }
399
- function It(e) {
374
+ function ht(e) {
400
375
  return !!e && typeof e == "object" && !Array.isArray(e);
401
376
  }
402
- function A(e, n, t) {
403
- return It(e) ? e : (t.push({ field: n, message: "Expected an object." }), {});
377
+ function T(e, n, t) {
378
+ return ht(e) ? e : (t.push({ field: n, message: "Expected an object." }), {});
404
379
  }
405
- function w(e, n, t, r) {
380
+ function S(e, n, t, r) {
406
381
  const o = new Set(t);
407
382
  Object.keys(e).forEach((a) => {
408
383
  o.has(a) || r.push({
@@ -411,7 +386,7 @@ function w(e, n, t, r) {
411
386
  });
412
387
  });
413
388
  }
414
- function F(e, n, t, r, o = {}) {
389
+ function D(e, n, t, r, o = {}) {
415
390
  if (e == null)
416
391
  return;
417
392
  if (typeof e != "string") {
@@ -432,8 +407,8 @@ function F(e, n, t, r, o = {}) {
432
407
  }
433
408
  return a;
434
409
  }
435
- function ee(e, n, t) {
436
- const r = F(e, n, 2e3, t);
410
+ function Z(e, n, t) {
411
+ const r = D(e, n, 2e3, t);
437
412
  if (r)
438
413
  try {
439
414
  return new URL(r), r;
@@ -442,13 +417,13 @@ function ee(e, n, t) {
442
417
  return;
443
418
  }
444
419
  }
445
- function ce(e, n, t) {
446
- const r = A(e, n, t);
447
- w(r, n, ["tokens", "components"], t);
420
+ function ae(e, n, t) {
421
+ const r = T(e, n, t);
422
+ S(r, n, ["tokens", "components"], t);
448
423
  const o = {};
449
424
  if (r.tokens !== void 0) {
450
- const a = A(r.tokens, `${n}.tokens`, t);
451
- w(
425
+ const a = T(r.tokens, `${n}.tokens`, t);
426
+ S(
452
427
  a,
453
428
  `${n}.tokens`,
454
429
  ["color", "typography"],
@@ -456,7 +431,7 @@ function ce(e, n, t) {
456
431
  );
457
432
  const i = {};
458
433
  if (a.color !== void 0) {
459
- const c = A(
434
+ const c = T(
460
435
  a.color,
461
436
  `${n}.tokens.color`,
462
437
  t
@@ -473,10 +448,10 @@ function ce(e, n, t) {
473
448
  "warning",
474
449
  "info"
475
450
  ];
476
- w(c, `${n}.tokens.color`, l, t);
451
+ S(c, `${n}.tokens.color`, l, t);
477
452
  const m = {};
478
453
  l.forEach((s) => {
479
- const u = F(
454
+ const u = D(
480
455
  c[s],
481
456
  `${n}.tokens.color.${s}`,
482
457
  120,
@@ -486,24 +461,24 @@ function ce(e, n, t) {
486
461
  }), i.color = m;
487
462
  }
488
463
  if (a.typography !== void 0) {
489
- const c = A(
464
+ const c = T(
490
465
  a.typography,
491
466
  `${n}.tokens.typography`,
492
467
  t
493
468
  );
494
- w(
469
+ S(
495
470
  c,
496
471
  `${n}.tokens.typography`,
497
472
  ["fontFamily", "monoFontFamily"],
498
473
  t
499
474
  );
500
- const l = F(
475
+ const l = D(
501
476
  c.fontFamily,
502
477
  `${n}.tokens.typography.fontFamily`,
503
478
  500,
504
479
  t,
505
480
  { allowEmpty: !0 }
506
- ), m = F(
481
+ ), m = D(
507
482
  c.monoFontFamily,
508
483
  `${n}.tokens.typography.monoFontFamily`,
509
484
  500,
@@ -518,24 +493,24 @@ function ce(e, n, t) {
518
493
  o.tokens = i;
519
494
  }
520
495
  if (r.components !== void 0) {
521
- const a = A(
496
+ const a = T(
522
497
  r.components,
523
498
  `${n}.components`,
524
499
  t
525
500
  );
526
- if (w(a, `${n}.components`, ["chart"], t), a.chart !== void 0) {
527
- const i = A(
501
+ if (S(a, `${n}.components`, ["chart"], t), a.chart !== void 0) {
502
+ const i = T(
528
503
  a.chart,
529
504
  `${n}.components.chart`,
530
505
  t
531
506
  );
532
- w(i, `${n}.components.chart`, ["palette"], t);
507
+ S(i, `${n}.components.chart`, ["palette"], t);
533
508
  let c;
534
509
  i.palette !== void 0 && (Array.isArray(i.palette) ? i.palette.length > 20 ? t.push({
535
510
  field: `${n}.components.chart.palette`,
536
511
  message: "Expected 20 colors or fewer."
537
512
  }) : c = i.palette.map(
538
- (l, m) => F(
513
+ (l, m) => D(
539
514
  l,
540
515
  `${n}.components.chart.palette.${m}`,
541
516
  120,
@@ -551,22 +526,22 @@ function ce(e, n, t) {
551
526
  }
552
527
  return o;
553
528
  }
554
- function vt(e, n) {
555
- const t = "presentation.appearance", r = A(e, t, n);
556
- w(r, t, ["version", "schemes"], n);
529
+ function yt(e, n) {
530
+ const t = "presentation.appearance", r = T(e, t, n);
531
+ S(r, t, ["version", "schemes"], n);
557
532
  const o = {};
558
533
  if (r.version !== void 0 && (typeof r.version != "number" || !Number.isFinite(r.version) ? n.push({ field: `${t}.version`, message: "Expected a number." }) : o.version = r.version), r.schemes !== void 0) {
559
- const a = A(r.schemes, `${t}.schemes`, n);
560
- w(a, `${t}.schemes`, ["light", "dark"], n), o.schemes = {
534
+ const a = T(r.schemes, `${t}.schemes`, n);
535
+ S(a, `${t}.schemes`, ["light", "dark"], n), o.schemes = {
561
536
  ...a.light !== void 0 ? {
562
- light: ce(
537
+ light: ae(
563
538
  a.light,
564
539
  `${t}.schemes.light`,
565
540
  n
566
541
  )
567
542
  } : {},
568
543
  ...a.dark !== void 0 ? {
569
- dark: ce(
544
+ dark: ae(
570
545
  a.dark,
571
546
  `${t}.schemes.dark`,
572
547
  n
@@ -576,23 +551,23 @@ function vt(e, n) {
576
551
  }
577
552
  return o;
578
553
  }
579
- function Et(e, n) {
580
- const t = "presentation.brandOverrides", r = A(e, t, n);
581
- w(r, t, ["brandName", "logoUrl", "link"], n);
582
- const o = F(
554
+ function gt(e, n) {
555
+ const t = "presentation.brandOverrides", r = T(e, t, n);
556
+ S(r, t, ["brandName", "logoUrl", "link"], n);
557
+ const o = D(
583
558
  r.brandName,
584
559
  `${t}.brandName`,
585
560
  200,
586
561
  n
587
- ), a = ee(r.logoUrl, `${t}.logoUrl`, n), i = F(r.link, `${t}.link`, 120, n);
562
+ ), a = Z(r.logoUrl, `${t}.logoUrl`, n), i = D(r.link, `${t}.link`, 120, n);
588
563
  return {
589
564
  ...o !== void 0 ? { brandName: o } : {},
590
565
  ...a !== void 0 ? { logoUrl: a } : {},
591
566
  ...i !== void 0 ? { link: i } : {}
592
567
  };
593
568
  }
594
- function $t(e, n) {
595
- const t = "presentation.fragments", r = A(e, t, n), o = [
569
+ function bt(e, n) {
570
+ const t = "presentation.fragments", r = T(e, t, n), o = [
596
571
  "preHeaderText",
597
572
  "headerBannerHtml",
598
573
  "signatureHtml",
@@ -600,10 +575,10 @@ function $t(e, n) {
600
575
  "disclaimerHtml",
601
576
  "unsubscribeUrl"
602
577
  ];
603
- w(r, t, o, n);
578
+ S(r, t, o, n);
604
579
  const a = {};
605
580
  return o.forEach((i) => {
606
- const c = i === "unsubscribeUrl" ? ee(r[i], `${t}.${i}`, n) : F(
581
+ const c = i === "unsubscribeUrl" ? Z(r[i], `${t}.${i}`, n) : D(
607
582
  r[i],
608
583
  `${t}.${i}`,
609
584
  i === "preHeaderText" ? 200 : 5e3,
@@ -613,15 +588,15 @@ function $t(e, n) {
613
588
  c !== void 0 && (a[i] = c);
614
589
  }), a;
615
590
  }
616
- function xt(e) {
591
+ function It(e) {
617
592
  const n = [], t = {};
618
- if (e.appearance !== void 0 && (t.appearance = vt(e.appearance, n)), e.brandOverrides !== void 0 && (t.brandOverrides = Et(e.brandOverrides, n)), e.fragments !== void 0 && (t.fragments = $t(e.fragments, n)), e.viewUrl !== void 0) {
619
- const r = ee(e.viewUrl, "presentation.viewUrl", n);
593
+ if (e.appearance !== void 0 && (t.appearance = yt(e.appearance, n)), e.brandOverrides !== void 0 && (t.brandOverrides = gt(e.brandOverrides, n)), e.fragments !== void 0 && (t.fragments = bt(e.fragments, n)), e.viewUrl !== void 0) {
594
+ const r = Z(e.viewUrl, "presentation.viewUrl", n);
620
595
  r !== void 0 && (t.viewUrl = r);
621
596
  }
622
597
  return { value: t, issues: n };
623
598
  }
624
- const P = [
599
+ const M = [
625
600
  "SUN",
626
601
  "MON",
627
602
  "TUE",
@@ -629,21 +604,21 @@ const P = [
629
604
  "THU",
630
605
  "FRI",
631
606
  "SAT"
632
- ], fe = new Map(
633
- P.map((e, n) => [e, n])
634
- ), V = [1, 2, 3, 4, 5], ue = [1, 2, 3, 6, 12], pe = {
607
+ ], se = new Map(
608
+ M.map((e, n) => [e, n])
609
+ ), U = [1, 2, 3, 4, 5], me = [1, 2, 3, 6, 12], fe = {
635
610
  1: "first",
636
611
  2: "second",
637
612
  3: "third",
638
613
  4: "fourth",
639
614
  [-1]: "last"
640
- }, or = {
615
+ }, er = {
641
616
  frequency: "weekly",
642
617
  hour: 9,
643
618
  minute: 0,
644
619
  weekdays: [1]
645
- }, S = { ok: !1, issue: "Choose a supported schedule." };
646
- function Ct(e) {
620
+ }, x = { ok: !1, issue: "Choose a supported schedule." };
621
+ function vt(e) {
647
622
  if (typeof e != "string" || e.length === 0 || e !== e.trim() || /^(?:(?:UTC|GMT)[+-]|[+-]\d{2}:\d{2}$)/.test(e))
648
623
  return !1;
649
624
  try {
@@ -652,17 +627,17 @@ function Ct(e) {
652
627
  return !1;
653
628
  }
654
629
  }
655
- function Tt(e) {
630
+ function Et(e) {
656
631
  return Number.isInteger(e.minute) && e.minute >= 0 && e.minute <= 59 && Number.isInteger(e.hour) && e.hour >= 0 && e.hour <= 23;
657
632
  }
658
- function he(e) {
633
+ function ue(e) {
659
634
  if (e.length === 0) return null;
660
635
  const n = [...e].sort((t, r) => t - r);
661
636
  return n.some(
662
637
  (t, r) => !Number.isInteger(t) || t < 0 || t > 6 || r > 0 && t === n[r - 1]
663
638
  ) ? null : n;
664
639
  }
665
- function ye(e) {
640
+ function pe(e) {
666
641
  const t = [...e.filter((o) => o !== "last")].sort((o, a) => o - a);
667
642
  if (t.some(
668
643
  (o, a) => !Number.isInteger(o) || o < 1 || o > 31 || a > 0 && o === t[a - 1]
@@ -671,101 +646,101 @@ function ye(e) {
671
646
  const r = e.includes("last") ? [...t, "last"] : t;
672
647
  return r.length > 0 ? r : null;
673
648
  }
674
- function N(e, n) {
649
+ function O(e, n) {
675
650
  const t = [];
676
651
  for (let r = 0; r < 12 / e; r += 1)
677
652
  t.push((n + r * e) % 12);
678
653
  return t.sort((r, o) => r - o);
679
654
  }
680
- function St(e, n) {
681
- return e === 1 ? "*" : N(e, n).map((t) => t + 1).join(",");
655
+ function $t(e, n) {
656
+ return e === 1 ? "*" : O(e, n).map((t) => t + 1).join(",");
682
657
  }
683
- function ge(e, n) {
684
- return e.every((t) => Rt(t, n));
658
+ function he(e, n) {
659
+ return e.every((t) => Dt(t, n));
685
660
  }
686
- function ar(e) {
687
- if (!Tt(e))
661
+ function tr(e) {
662
+ if (!Et(e))
688
663
  throw new Error("Choose a valid schedule time.");
689
664
  const n = `${e.minute} ${e.hour}`;
690
665
  switch (e.frequency) {
691
666
  case "daily":
692
- return e.weekdaysOnly ? `${n} * * ${V.map((t) => P[t]).join(",")}` : `${n} * * *`;
667
+ return e.weekdaysOnly ? `${n} * * ${U.map((t) => M[t]).join(",")}` : `${n} * * *`;
693
668
  case "weekly": {
694
- const t = he(e.weekdays);
669
+ const t = ue(e.weekdays);
695
670
  if (!t) throw new Error("Choose at least one weekday.");
696
- return `${n} * * ${t.map((r) => P[r]).join(",")}`;
671
+ return `${n} * * ${t.map((r) => M[r]).join(",")}`;
697
672
  }
698
673
  case "monthly": {
699
- if (!ue.includes(e.interval) || !Number.isInteger(e.startMonth) || e.startMonth < 0 || e.startMonth >= e.interval)
674
+ if (!me.includes(e.interval) || !Number.isInteger(e.startMonth) || e.startMonth < 0 || e.startMonth >= e.interval)
700
675
  throw new Error("Choose a valid month cycle.");
701
- const t = St(e.interval, e.startMonth);
676
+ const t = $t(e.interval, e.startMonth);
702
677
  if (e.on.type === "days") {
703
- const i = ye(e.on.days);
678
+ const i = pe(e.on.days);
704
679
  if (!i) throw new Error("Choose at least one day of the month.");
705
- const c = N(e.interval, e.startMonth);
706
- if (!ge(i, c))
680
+ const c = O(e.interval, e.startMonth);
681
+ if (!he(i, c))
707
682
  throw new Error("Choose a day that occurs in the chosen months.");
708
683
  const l = i.map((m) => m === "last" ? "L" : String(m)).join(",");
709
684
  return `${n} ${l} ${t} *`;
710
685
  }
711
686
  const { ordinal: r, weekday: o } = e.on;
712
- if (!Number.isInteger(o) || o < 0 || o > 6 || !(r in pe))
687
+ if (!Number.isInteger(o) || o < 0 || o > 6 || !(r in fe))
713
688
  throw new Error("Choose a valid weekday.");
714
- const a = P[o];
689
+ const a = M[o];
715
690
  return `${n} * ${t} ${r === -1 ? `${a}L` : `${a}#${r}`}`;
716
691
  }
717
692
  }
718
693
  }
719
- function kt(e) {
694
+ function xt(e) {
720
695
  if (e === "*") return { interval: 1, startMonth: 0 };
721
696
  const n = e.split(",");
722
697
  if (n.some((i) => !/^([1-9]|1[0-2])$/.test(i))) return null;
723
698
  const t = n.map((i) => Number(i) - 1), r = 12 / t.length;
724
- if (!ue.includes(r))
699
+ if (!me.includes(r))
725
700
  return null;
726
- const o = t[0], a = N(
701
+ const o = t[0], a = O(
727
702
  r,
728
703
  o
729
704
  );
730
705
  return o >= r || a.length !== t.length || a.some((i, c) => i !== t[c]) ? null : { interval: r, startMonth: o };
731
706
  }
732
- function At(e) {
707
+ function Ct(e) {
733
708
  const n = e.split(",");
734
709
  if (n.some((o) => !/^(L|[1-9]|[12]\d|3[01])$/.test(o))) return null;
735
710
  const t = n.map(
736
711
  (o) => o === "L" ? "last" : Number(o)
737
- ), r = ye(t);
712
+ ), r = pe(t);
738
713
  return !r || r.some((o, a) => o !== t[a]) ? null : r;
739
714
  }
740
- function wt(e) {
715
+ function Tt(e) {
741
716
  const n = /^([A-Z]{3})(?:#([1-4])|(L))$/.exec(e);
742
717
  if (!n) return null;
743
- const t = fe.get(n[1]);
718
+ const t = se.get(n[1]);
744
719
  return t === void 0 ? null : {
745
720
  weekday: t,
746
721
  ordinal: n[3] ? -1 : Number(n[2])
747
722
  };
748
723
  }
749
- function be(e) {
724
+ function ye(e) {
750
725
  if (typeof e != "string" || e.length === 0 || e !== e.trim() || e.includes(" "))
751
- return S;
726
+ return x;
752
727
  const n = e.split(" ");
753
- if (n.length !== 5) return S;
728
+ if (n.length !== 5) return x;
754
729
  const [t, r, o, a, i] = n;
755
730
  if (!/^(0|[1-9]\d?)$/.test(t) || !/^(0|[1-9]\d?)$/.test(r))
756
- return S;
731
+ return x;
757
732
  const c = Number(t), l = Number(r);
758
- if (c > 59 || l > 23) return S;
733
+ if (c > 59 || l > 23) return x;
759
734
  if (a === "*" && o === "*" && i === "*")
760
735
  return {
761
736
  ok: !0,
762
737
  value: { frequency: "daily", hour: l, minute: c, weekdaysOnly: !1 }
763
738
  };
764
739
  if (a === "*" && o === "*" && !i.includes("#") && !i.endsWith("L")) {
765
- const u = i.split(",").map((E) => fe.get(E));
766
- if (u.some((E) => E === void 0)) return S;
767
- const h = u, g = he(h);
768
- return !g || g.some((E, C) => E !== h[C]) ? S : g.length === V.length && g.every((E, C) => E === V[C]) ? {
740
+ const u = i.split(",").map((E) => se.get(E));
741
+ if (u.some((E) => E === void 0)) return x;
742
+ const p = u, g = ue(p);
743
+ return !g || g.some((E, A) => E !== p[A]) ? x : g.length === U.length && g.every((E, A) => E === U[A]) ? {
769
744
  ok: !0,
770
745
  value: { frequency: "daily", hour: l, minute: c, weekdaysOnly: !0 }
771
746
  } : {
@@ -773,11 +748,11 @@ function be(e) {
773
748
  value: { frequency: "weekly", hour: l, minute: c, weekdays: g }
774
749
  };
775
750
  }
776
- const m = kt(a);
777
- if (!m) return S;
751
+ const m = xt(a);
752
+ if (!m) return x;
778
753
  if (o !== "*" && i === "*") {
779
- const s = At(o), u = N(m.interval, m.startMonth);
780
- return !s || !ge(s, u) ? S : {
754
+ const s = Ct(o), u = O(m.interval, m.startMonth);
755
+ return !s || !he(s, u) ? x : {
781
756
  ok: !0,
782
757
  value: {
783
758
  frequency: "monthly",
@@ -789,7 +764,7 @@ function be(e) {
789
764
  };
790
765
  }
791
766
  if (o === "*" && i !== "*") {
792
- const s = wt(i);
767
+ const s = Tt(i);
793
768
  return s ? {
794
769
  ok: !0,
795
770
  value: {
@@ -799,18 +774,18 @@ function be(e) {
799
774
  ...m,
800
775
  on: { type: "weekday", ...s }
801
776
  }
802
- } : S;
777
+ } : x;
803
778
  }
804
- return S;
779
+ return x;
805
780
  }
806
- function Dt(e, n, t) {
781
+ function St(e, n, t) {
807
782
  return new Intl.DateTimeFormat(t, {
808
783
  hour: "numeric",
809
784
  minute: "2-digit",
810
785
  timeZone: "UTC"
811
786
  }).format(new Date(Date.UTC(2020, 0, 1, e, n)));
812
787
  }
813
- function _t(e, n) {
788
+ function kt(e, n) {
814
789
  var t;
815
790
  if (e === "UTC") return "UTC";
816
791
  try {
@@ -822,29 +797,29 @@ function _t(e, n) {
822
797
  return null;
823
798
  }
824
799
  }
825
- function le(e) {
800
+ function ie(e) {
826
801
  return e.length <= 1 ? e.join("") : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
827
802
  }
828
- function Ot(e) {
803
+ function At(e) {
829
804
  const n = e % 100;
830
805
  return n >= 11 && n <= 13 ? `${e}th` : `${e}${["th", "st", "nd", "rd"][e % 10] ?? "th"}`;
831
806
  }
832
- function Ft(e, n, t) {
807
+ function wt(e, n, t) {
833
808
  const r = (a, i) => new Intl.DateTimeFormat(t, { month: i, timeZone: "UTC" }).format(
834
809
  new Date(Date.UTC(2020, a, 1))
835
810
  );
836
811
  if (e === 1) return "every month";
837
812
  if (e === 12) return `${r(n, "long")} each year`;
838
- const o = N(e, n).map((a) => r(a, "short")).join(", ");
813
+ const o = O(e, n).map((a) => r(a, "short")).join(", ");
839
814
  return e === 3 ? `each quarter (${o})` : `every ${e} months (${o})`;
840
815
  }
841
- function ir(e, n, t = "en-US") {
842
- const r = be(e);
816
+ function nr(e, n, t = "en-US") {
817
+ const r = ye(e);
843
818
  if (!r.ok) return null;
844
819
  try {
845
- const o = r.value, a = _t(n, t);
820
+ const o = r.value, a = kt(n, t);
846
821
  if (!a) return null;
847
- const i = `at ${Dt(o.hour, o.minute, t)} ${a}`, c = (l) => new Intl.DateTimeFormat(t, {
822
+ const i = `at ${St(o.hour, o.minute, t)} ${a}`, c = (l) => new Intl.DateTimeFormat(t, {
848
823
  weekday: "long",
849
824
  timeZone: "UTC"
850
825
  }).format(new Date(Date.UTC(2023, 0, 1 + l)));
@@ -852,57 +827,57 @@ function ir(e, n, t = "en-US") {
852
827
  case "daily":
853
828
  return o.weekdaysOnly ? `Every weekday, Monday to Friday, ${i}` : `Every day ${i}`;
854
829
  case "weekly":
855
- return `Every ${le(o.weekdays.map(c))} ${i}`;
830
+ return `Every ${ie(o.weekdays.map(c))} ${i}`;
856
831
  case "monthly": {
857
- const l = Ft(o.interval, o.startMonth, t);
832
+ const l = wt(o.interval, o.startMonth, t);
858
833
  if (o.on.type === "weekday")
859
- return `On the ${pe[o.on.ordinal]} ${c(o.on.weekday)} of ${l} ${i}`;
834
+ return `On the ${fe[o.on.ordinal]} ${c(o.on.weekday)} of ${l} ${i}`;
860
835
  const m = o.on.days.map(
861
- (s) => s === "last" ? "last day" : Ot(s)
836
+ (s) => s === "last" ? "last day" : At(s)
862
837
  );
863
- return `On the ${le(m)} of ${l} ${i}`;
838
+ return `On the ${ie(m)} of ${l} ${i}`;
864
839
  }
865
840
  }
866
841
  } catch {
867
842
  return null;
868
843
  }
869
844
  }
870
- const Ie = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
871
- function Rt(e, n) {
872
- return e === "last" || n.some((t) => e <= Ie[t]);
845
+ const ge = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
846
+ function Dt(e, n) {
847
+ return e === "last" || n.some((t) => e <= ge[t]);
873
848
  }
874
- function cr(e) {
849
+ function rr(e) {
875
850
  if (e.frequency !== "monthly" || e.on.type !== "days") return null;
876
851
  const n = e.on.days.filter((o) => o !== "last");
877
852
  if (n.length === 0) return null;
878
- const t = Math.max(...n), r = N(e.interval, e.startMonth).filter(
879
- (o) => t > (o === 1 ? 28 : Ie[o])
853
+ const t = Math.max(...n), r = O(e.interval, e.startMonth).filter(
854
+ (o) => t > (o === 1 ? 28 : ge[o])
880
855
  );
881
856
  return r.length > 0 ? { day: t, months: r } : null;
882
857
  }
883
- function Nt(e, n) {
858
+ function _t(e, n) {
884
859
  return new Date(Date.UTC(e, n + 1, 0)).getUTCDate();
885
860
  }
886
- function Bt(e, n, t, r) {
861
+ function Ot(e, n, t, r) {
887
862
  const o = new Date(Date.UTC(n, t, r)).getUTCDay();
888
863
  switch (e.frequency) {
889
864
  case "daily":
890
- return !e.weekdaysOnly || V.includes(o);
865
+ return !e.weekdaysOnly || U.includes(o);
891
866
  case "weekly":
892
867
  return e.weekdays.includes(o);
893
868
  case "monthly": {
894
- if (!N(e.interval, e.startMonth).includes(t))
869
+ if (!O(e.interval, e.startMonth).includes(t))
895
870
  return !1;
896
- const a = Nt(n, t);
871
+ const a = _t(n, t);
897
872
  return e.on.type === "days" ? e.on.days.some(
898
873
  (i) => i === "last" ? r === a : i === r
899
874
  ) : o !== e.on.weekday ? !1 : e.on.ordinal === -1 ? r + 7 > a : Math.ceil(r / 7) === e.on.ordinal;
900
875
  }
901
876
  }
902
877
  }
903
- function lr(e, n, t, r) {
904
- const o = be(e);
905
- if (!o.ok || !Ct(n)) return [];
878
+ function or(e, n, t, r) {
879
+ const o = ye(e);
880
+ if (!o.ok || !vt(n)) return [];
906
881
  const a = o.value, i = new Intl.DateTimeFormat("en-US", {
907
882
  timeZone: n,
908
883
  hourCycle: "h23",
@@ -913,15 +888,15 @@ function lr(e, n, t, r) {
913
888
  minute: "numeric"
914
889
  }).formatToParts(t), c = (s) => {
915
890
  var u;
916
- return Number((u = i.find((h) => h.type === s)) == null ? void 0 : u.value);
891
+ return Number((u = i.find((p) => p.type === s)) == null ? void 0 : u.value);
917
892
  }, l = new Date(Date.UTC(c("year"), c("month") - 1, c("day")));
918
893
  c("hour") * 60 + c("minute") >= a.hour * 60 + a.minute && l.setUTCDate(l.getUTCDate() + 1);
919
894
  const m = [];
920
895
  for (let s = 0; s < 366 * 4 * (r + 1) && m.length < r; s += 1)
921
- Bt(a, l.getUTCFullYear(), l.getUTCMonth(), l.getUTCDate()) && m.push(l.toISOString().slice(0, 10)), l.setUTCDate(l.getUTCDate() + 1);
896
+ Ot(a, l.getUTCFullYear(), l.getUTCMonth(), l.getUTCDate()) && m.push(l.toISOString().slice(0, 10)), l.setUTCDate(l.getUTCDate() + 1);
922
897
  return m;
923
898
  }
924
- const Mt = Object.freeze([
899
+ const Ft = Object.freeze([
925
900
  "PDF_ROW_LIMIT_EXCEEDED",
926
901
  "PDF_SIZE_LIMIT_EXCEEDED",
927
902
  "TABLE_COMPLETENESS_UNVERIFIED",
@@ -937,14 +912,14 @@ const Mt = Object.freeze([
937
912
  "EXPORT_NO_ROWS",
938
913
  // A dashboard sheet too tall for one image (PNG exports PN-D7).
939
914
  "IMAGE_TOO_LARGE"
940
- ]), Lt = new Set(Mt);
941
- function Ut(e) {
942
- return typeof e == "string" && Lt.has(e);
915
+ ]), Nt = new Set(Ft);
916
+ function Rt(e) {
917
+ return typeof e == "string" && Nt.has(e);
943
918
  }
944
- function Pt(e) {
919
+ function Bt(e) {
945
920
  if (!e || typeof e != "object" || Array.isArray(e)) return null;
946
921
  const n = e;
947
- return typeof n.index != "number" || !Number.isInteger(n.index) || n.index < 0 || typeof n.title != "string" || !ve.includes(n.format) || !Ut(n.code) || typeof n.reason != "string" || typeof n.diagnostic != "string" ? null : {
922
+ return typeof n.index != "number" || !Number.isInteger(n.index) || n.index < 0 || typeof n.title != "string" || !be.includes(n.format) || !Rt(n.code) || typeof n.reason != "string" || typeof n.diagnostic != "string" ? null : {
948
923
  index: n.index,
949
924
  title: n.title,
950
925
  format: n.format,
@@ -953,39 +928,39 @@ function Pt(e) {
953
928
  diagnostic: n.diagnostic
954
929
  };
955
930
  }
956
- function dr(e) {
931
+ function ar(e) {
957
932
  if (!e || typeof e != "object" || Array.isArray(e)) return [];
958
933
  const n = e.omittedAttachments;
959
934
  return Array.isArray(n) ? n.flatMap((t) => {
960
- const r = Pt(t);
935
+ const r = Bt(t);
961
936
  return r ? [r] : [];
962
937
  }) : [];
963
938
  }
964
- function sr(e) {
939
+ function ir(e) {
965
940
  return e != null && e.role ? e.type === "tenant" ? e.role === "POWER_USER" : ["AUTHOR", "ADMIN", "SUPER_ADMIN"].includes(e.role) : !1;
966
941
  }
967
- function mr(e) {
942
+ function cr(e) {
968
943
  return e.canCreate ? [
969
944
  ...e.scheduledReportAvailable ? ["scheduled_report"] : [],
970
945
  ...e.analyticalBriefingsEnabled ? ["analytical_briefing"] : []
971
946
  ] : [];
972
947
  }
973
- function zt(e) {
948
+ function Mt(e) {
974
949
  const n = (e == null ? void 0 : e.channels) ?? [];
975
950
  return n.length === 1 && n[0] === "EMAIL";
976
951
  }
977
- function Vt(e) {
978
- return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 && zt(e.deliveryConfig) ? e.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
952
+ function Lt(e) {
953
+ return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 && Mt(e.deliveryConfig) ? e.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
979
954
  }
980
- function fr(e) {
981
- const n = Vt(e), t = n === "Scheduled report" || n === "On-demand report" ? "report" : "briefing";
955
+ function lr(e) {
956
+ const n = Lt(e), t = n === "Scheduled report" || n === "On-demand report" ? "report" : "briefing";
982
957
  return {
983
958
  typeLabel: n,
984
959
  noun: t,
985
960
  pluralNoun: t === "report" ? "reports" : "briefings"
986
961
  };
987
962
  }
988
- const Z = "BRIEFING", jt = ["markdown", "html"], Y = ["markdown"], H = 20, f = {
963
+ const H = "BRIEFING", Ut = ["markdown", "html"], G = ["markdown"], z = 20, f = {
989
964
  name: 500,
990
965
  description: 2e3,
991
966
  instruction: 5e4,
@@ -1001,7 +976,7 @@ const Z = "BRIEFING", jt = ["markdown", "html"], Y = ["markdown"], H = 20, f = {
1001
976
  presentationTone: 500,
1002
977
  presentationFormat: 2e3,
1003
978
  id: 500
1004
- }, x = {
979
+ }, $ = {
1005
980
  maxBlocks: 50,
1006
981
  maxTableRows: 100,
1007
982
  maxTableColumns: 20,
@@ -1014,7 +989,7 @@ const Z = "BRIEFING", jt = ["markdown", "html"], Y = ["markdown"], H = 20, f = {
1014
989
  // tiny tiles in narrow client panels; 2-up was the chosen layout).
1015
990
  maxKpiTiles: 8
1016
991
  };
1017
- function qt(e) {
992
+ function Pt(e) {
1018
993
  if (e === null || typeof e != "object" || Array.isArray(e))
1019
994
  return !1;
1020
995
  const n = e;
@@ -1024,60 +999,60 @@ function qt(e) {
1024
999
  if (t === null || typeof t != "object" || Array.isArray(t))
1025
1000
  return !1;
1026
1001
  const r = t;
1027
- return (r.kind === "metric" && typeof r.metricId == "string" && !!r.metricId.trim() || r.kind === "column" && typeof r.columnKey == "string" && !!r.columnKey.trim() || r.kind === "matrix_measure" && typeof r.measureId == "string" && !!r.measureId.trim()) && se(n.format).ok;
1002
+ return (r.kind === "metric" && typeof r.metricId == "string" && !!r.metricId.trim() || r.kind === "column" && typeof r.columnKey == "string" && !!r.columnKey.trim() || r.kind === "matrix_measure" && typeof r.measureId == "string" && !!r.measureId.trim()) && le(n.format).ok;
1028
1003
  }
1029
- function Kt(e) {
1030
- return e == null ? "" : qt(e) ? Me(e.value, e.format) : String(e);
1004
+ function Vt(e) {
1005
+ return e == null ? "" : Pt(e) ? Ne(e.value, e.format) : String(e);
1031
1006
  }
1032
- function ur(e) {
1007
+ function dr(e) {
1033
1008
  return [e.delta, e.percentChange].filter(
1034
1009
  (n) => n != null
1035
- ).map(Kt).filter(Boolean).join(" / ");
1010
+ ).map(Vt).filter(Boolean).join(" / ");
1036
1011
  }
1037
- const ve = ["pdf", "png", "csv", "xlsx"], Ee = new Set(jt), Ht = /* @__PURE__ */ new Set([
1012
+ const be = ["pdf", "png", "csv", "xlsx"], Ie = new Set(Ut), zt = /* @__PURE__ */ new Set([
1038
1013
  "EMAIL",
1039
1014
  "WEBHOOK",
1040
1015
  "SLACK",
1041
1016
  "IN_APP",
1042
1017
  "TELEGRAM"
1043
- ]), G = {
1018
+ ]), j = {
1044
1019
  maxToolCalls: { min: 1, max: 100 },
1045
1020
  maxPlanningIterations: { min: 1, max: 10 },
1046
1021
  maxRows: { min: 1, max: 1e5 },
1047
1022
  timeoutMs: { min: 1e3, max: 30 * 6e4 }
1048
- }, Gt = /* @__PURE__ */ new Set([
1023
+ }, jt = /* @__PURE__ */ new Set([
1049
1024
  "letter",
1050
1025
  "legal",
1051
1026
  "a4",
1052
1027
  "a3",
1053
1028
  "tabloid"
1054
- ]), Wt = /* @__PURE__ */ new Set([
1029
+ ]), qt = /* @__PURE__ */ new Set([
1055
1030
  "portrait",
1056
1031
  "landscape"
1057
- ]), Xt = /* @__PURE__ */ new Set([",", ";", " "]), Zt = new Set(Ve), Yt = /* @__PURE__ */ new Set([
1032
+ ]), Kt = /* @__PURE__ */ new Set([",", ";", " "]), Ht = new Set(Ue), Gt = /* @__PURE__ */ new Set([
1058
1033
  "current",
1059
1034
  "all"
1060
- ]), Jt = /* @__PURE__ */ new Set([
1035
+ ]), Wt = /* @__PURE__ */ new Set([
1061
1036
  "concise",
1062
1037
  "balanced",
1063
1038
  "detailed"
1064
- ]), Qt = /* @__PURE__ */ new Set([
1039
+ ]), Xt = /* @__PURE__ */ new Set([
1065
1040
  "info",
1066
1041
  "positive",
1067
1042
  "warning",
1068
1043
  "critical"
1069
- ]), en = /* @__PURE__ */ new Set([
1044
+ ]), Zt = /* @__PURE__ */ new Set([
1070
1045
  "text",
1071
1046
  "number",
1072
1047
  "currency",
1073
1048
  "percent",
1074
1049
  "date",
1075
1050
  "boolean"
1076
- ]), tn = /* @__PURE__ */ new Set([
1051
+ ]), Yt = /* @__PURE__ */ new Set([
1077
1052
  "left",
1078
1053
  "center",
1079
1054
  "right"
1080
- ]), nn = [
1055
+ ]), Jt = [
1081
1056
  "matrix",
1082
1057
  "pageSize",
1083
1058
  "orientation",
@@ -1108,23 +1083,23 @@ const ve = ["pdf", "png", "csv", "xlsx"], Ee = new Set(jt), Ht = /* @__PURE__ */
1108
1083
  "allowDownload",
1109
1084
  "theme"
1110
1085
  ];
1111
- class j extends Error {
1086
+ class P extends Error {
1112
1087
  constructor(t) {
1113
1088
  super(t.map((r) => `${r.field}: ${r.message}`).join("; "));
1114
- L(this, "issues");
1089
+ R(this, "issues");
1115
1090
  this.name = "BriefingContractError", this.issues = t;
1116
1091
  }
1117
1092
  }
1118
- function $e(e) {
1093
+ function ve(e) {
1119
1094
  return typeof e == "object" && e !== null && !Array.isArray(e);
1120
1095
  }
1121
1096
  function d(e, n, t) {
1122
1097
  e.push({ field: n, message: t });
1123
1098
  }
1124
1099
  function v(e, n, t) {
1125
- return $e(e) ? e : (d(t, n, "Expected an object."), {});
1100
+ return ve(e) ? e : (d(t, n, "Expected an object."), {});
1126
1101
  }
1127
- function p(e, n, t, r) {
1102
+ function h(e, n, t, r) {
1128
1103
  const o = new Set(t);
1129
1104
  Object.keys(e).forEach((a) => {
1130
1105
  o.has(a) || d(
@@ -1151,13 +1126,13 @@ function I(e, n, t, r) {
1151
1126
  if (o)
1152
1127
  return o.length > t && d(r, n, `Must be ${t} characters or fewer.`), o;
1153
1128
  }
1154
- function rn(e, n, t, r) {
1129
+ function Qt(e, n, t, r) {
1155
1130
  if (typeof e != "string")
1156
1131
  return d(r, n, "Expected a string."), "";
1157
1132
  const o = e.trim();
1158
1133
  return o.length > t && d(r, n, `Must be ${t} characters or fewer.`), o;
1159
1134
  }
1160
- function on(e, n, t) {
1135
+ function en(e, n, t) {
1161
1136
  if (e != null) {
1162
1137
  if (!Number.isInteger(e) || Number(e) < 0) {
1163
1138
  d(t, n, "Expected a non-negative integer.");
@@ -1166,7 +1141,7 @@ function on(e, n, t) {
1166
1141
  return Number(e);
1167
1142
  }
1168
1143
  }
1169
- function k(e, n, t, r = {}) {
1144
+ function C(e, n, t, r = {}) {
1170
1145
  if (e == null)
1171
1146
  return r.required ? (d(t, n, "Expected at least one evidence id."), []) : void 0;
1172
1147
  if (!Array.isArray(e))
@@ -1182,20 +1157,20 @@ function k(e, n, t, r = {}) {
1182
1157
  c && !o.includes(c) && o.push(c);
1183
1158
  }), r.required && o.length === 0 && d(t, n, "Expected at least one evidence id."), o.length > 0 || r.required ? o : void 0;
1184
1159
  }
1185
- function R(e, n, t, r) {
1160
+ function _(e, n, t, r) {
1186
1161
  return e == null ? n : typeof e != "boolean" ? (d(r, t, "Expected a boolean."), n) : e;
1187
1162
  }
1188
- function an(e, n) {
1163
+ function tn(e, n) {
1189
1164
  return e == null ? "ACTIVE" : e === "ACTIVE" || e === "PAUSED" || e === "DISABLED" ? e : (d(n, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
1190
1165
  }
1191
- function cn(e) {
1166
+ function nn(e) {
1192
1167
  return e.includes("@") && e.includes(".") && !e.includes(" ");
1193
1168
  }
1194
- function xe(e, n) {
1169
+ function Ee(e, n) {
1195
1170
  if (e == null)
1196
1171
  return { type: "project" };
1197
1172
  const t = v(e, "source", n), r = t.type;
1198
- return r === "project" ? (p(t, "source", ["type"], n), { type: "project" }) : r === "dashboard" ? (p(t, "source", ["type", "dashboardId"], n), {
1173
+ return r === "project" ? (h(t, "source", ["type"], n), { type: "project" }) : r === "dashboard" ? (h(t, "source", ["type", "dashboardId"], n), {
1199
1174
  type: "dashboard",
1200
1175
  dashboardId: b(
1201
1176
  t.dashboardId,
@@ -1205,9 +1180,9 @@ function xe(e, n) {
1205
1180
  )
1206
1181
  }) : (d(n, "source.type", "Expected project or dashboard."), { type: "project" });
1207
1182
  }
1208
- function Ce(e, n) {
1183
+ function $e(e, n) {
1209
1184
  const t = v(e, "body", n), r = t.type;
1210
- return r === "generated_analysis" ? (p(t, "body", ["type", "instruction"], n), {
1185
+ return r === "generated_analysis" ? (h(t, "body", ["type", "instruction"], n), {
1211
1186
  type: "generated_analysis",
1212
1187
  instruction: b(
1213
1188
  t.instruction,
@@ -1215,25 +1190,25 @@ function Ce(e, n) {
1215
1190
  f.instruction,
1216
1191
  n
1217
1192
  )
1218
- }) : r === "custom_message" ? (p(t, "body", ["type", "message"], n), {
1193
+ }) : r === "custom_message" ? (h(t, "body", ["type", "message"], n), {
1219
1194
  type: "custom_message",
1220
- message: rn(
1195
+ message: Qt(
1221
1196
  t.message,
1222
1197
  "body.message",
1223
1198
  f.customMessage,
1224
1199
  n
1225
1200
  )
1226
- }) : r === "none" ? (p(t, "body", ["type"], n), { type: "none" }) : (d(
1201
+ }) : r === "none" ? (h(t, "body", ["type"], n), { type: "none" }) : (d(
1227
1202
  n,
1228
1203
  "body.type",
1229
1204
  "Expected generated_analysis, custom_message, or none."
1230
1205
  ), { type: "none" });
1231
1206
  }
1232
- function ln(e, n) {
1207
+ function rn(e, n) {
1233
1208
  if (e == null)
1234
- return [...Y];
1209
+ return [...G];
1235
1210
  if (!Array.isArray(e))
1236
- return d(n, "presentation.artifactFormats", "Expected an array."), [...Y];
1211
+ return d(n, "presentation.artifactFormats", "Expected an array."), [...G];
1237
1212
  if (e.length === 0)
1238
1213
  return d(
1239
1214
  n,
@@ -1242,7 +1217,7 @@ function ln(e, n) {
1242
1217
  ), [];
1243
1218
  const t = [];
1244
1219
  return e.forEach((r, o) => {
1245
- if (typeof r != "string" || !Ee.has(r)) {
1220
+ if (typeof r != "string" || !Ie.has(r)) {
1246
1221
  d(
1247
1222
  n,
1248
1223
  `presentation.artifactFormats.${o}`,
@@ -1253,15 +1228,15 @@ function ln(e, n) {
1253
1228
  t.includes(r) || t.push(r);
1254
1229
  }), t;
1255
1230
  }
1256
- function Te(e, n) {
1231
+ function xe(e, n) {
1257
1232
  if (e == null)
1258
1233
  return {
1259
- artifactFormats: [...Y],
1234
+ artifactFormats: [...G],
1260
1235
  includeEvidence: !0,
1261
1236
  includeSql: !0
1262
1237
  };
1263
1238
  const t = v(e, "presentation", n);
1264
- p(
1239
+ h(
1265
1240
  t,
1266
1241
  "presentation",
1267
1242
  [
@@ -1279,14 +1254,14 @@ function Te(e, n) {
1279
1254
  n
1280
1255
  );
1281
1256
  const r = {
1282
- artifactFormats: ln(t.artifactFormats, n),
1283
- includeEvidence: R(
1257
+ artifactFormats: rn(t.artifactFormats, n),
1258
+ includeEvidence: _(
1284
1259
  t.includeEvidence,
1285
1260
  !0,
1286
1261
  "presentation.includeEvidence",
1287
1262
  n
1288
1263
  ),
1289
- includeSql: R(
1264
+ includeSql: _(
1290
1265
  t.includeSql,
1291
1266
  !0,
1292
1267
  "presentation.includeSql",
@@ -1309,15 +1284,15 @@ function Te(e, n) {
1309
1284
  n
1310
1285
  );
1311
1286
  o && (r.audience = o), a && (r.tone = a), i && (r.format = i);
1312
- const c = xt(t);
1287
+ const c = It(t);
1313
1288
  return c.issues.forEach((l) => d(n, l.field, l.message)), Object.assign(r, c.value), r;
1314
1289
  }
1315
- function dn(e, n, t) {
1316
- return Array.isArray(e) ? (e.length === 0 && d(t, n, "Expected at least one item."), e.length > x.maxListItems && d(
1290
+ function on(e, n, t) {
1291
+ return Array.isArray(e) ? (e.length === 0 && d(t, n, "Expected at least one item."), e.length > $.maxListItems && d(
1317
1292
  t,
1318
1293
  n,
1319
- `Must have ${x.maxListItems} items or fewer.`
1320
- ), e.slice(0, x.maxListItems).map(
1294
+ `Must have ${$.maxListItems} items or fewer.`
1295
+ ), e.slice(0, $.maxListItems).map(
1321
1296
  (r, o) => b(
1322
1297
  r,
1323
1298
  `${n}.${o}`,
@@ -1326,10 +1301,10 @@ function dn(e, n, t) {
1326
1301
  )
1327
1302
  ).filter(Boolean)) : (d(t, n, "Expected an array."), []);
1328
1303
  }
1329
- function sn(e, n, t) {
1304
+ function an(e, n, t) {
1330
1305
  const r = v(e, n, t);
1331
1306
  if (r.kind === "metric")
1332
- return p(r, n, ["kind", "metricId"], t), {
1307
+ return h(r, n, ["kind", "metricId"], t), {
1333
1308
  kind: "metric",
1334
1309
  metricId: b(
1335
1310
  r.metricId,
@@ -1339,7 +1314,7 @@ function sn(e, n, t) {
1339
1314
  )
1340
1315
  };
1341
1316
  if (r.kind === "column")
1342
- return p(r, n, ["kind", "columnKey"], t), {
1317
+ return h(r, n, ["kind", "columnKey"], t), {
1343
1318
  kind: "column",
1344
1319
  columnKey: b(
1345
1320
  r.columnKey,
@@ -1349,7 +1324,7 @@ function sn(e, n, t) {
1349
1324
  )
1350
1325
  };
1351
1326
  if (r.kind === "matrix_measure")
1352
- return p(r, n, ["kind", "measureId"], t), {
1327
+ return h(r, n, ["kind", "measureId"], t), {
1353
1328
  kind: "matrix_measure",
1354
1329
  measureId: b(
1355
1330
  r.measureId,
@@ -1364,18 +1339,18 @@ function sn(e, n, t) {
1364
1339
  "Expected metric, column, or matrix_measure."
1365
1340
  );
1366
1341
  }
1367
- function Se(e, n, t) {
1342
+ function Ce(e, n, t) {
1368
1343
  if (e === null || typeof e != "object" || Array.isArray(e))
1369
1344
  return;
1370
1345
  const r = v(e, n, t);
1371
1346
  if (!Object.prototype.hasOwnProperty.call(r, "target") && !Object.prototype.hasOwnProperty.call(r, "format"))
1372
1347
  return;
1373
- p(r, n, ["value", "target", "format"], t), (typeof r.value != "number" || !Number.isFinite(r.value)) && d(t, `${n}.value`, "Expected a finite number.");
1374
- const o = sn(
1348
+ h(r, n, ["value", "target", "format"], t), (typeof r.value != "number" || !Number.isFinite(r.value)) && d(t, `${n}.value`, "Expected a finite number.");
1349
+ const o = an(
1375
1350
  r.target,
1376
1351
  `${n}.target`,
1377
1352
  t
1378
- ), a = se(r.format);
1353
+ ), a = le(r.format);
1379
1354
  if (a.ok || a.issues.forEach(
1380
1355
  (i) => d(
1381
1356
  t,
@@ -1385,7 +1360,7 @@ function Se(e, n, t) {
1385
1360
  ), !(typeof r.value != "number" || !Number.isFinite(r.value) || !o || !a.ok))
1386
1361
  return { value: r.value, target: o, format: a.value };
1387
1362
  }
1388
- function O(e, n, t) {
1363
+ function w(e, n, t) {
1389
1364
  if (typeof e == "string")
1390
1365
  return e;
1391
1366
  if (typeof e == "number") {
@@ -1395,7 +1370,7 @@ function O(e, n, t) {
1395
1370
  }
1396
1371
  return e;
1397
1372
  }
1398
- const r = Se(e, n, t);
1373
+ const r = Ce(e, n, t);
1399
1374
  if (r) return r;
1400
1375
  d(
1401
1376
  t,
@@ -1403,32 +1378,32 @@ function O(e, n, t) {
1403
1378
  "Expected a string, number, or structured numeric value."
1404
1379
  );
1405
1380
  }
1406
- function mn(e, n, t) {
1381
+ function cn(e, n, t) {
1407
1382
  if (e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean")
1408
1383
  return typeof e == "string" && e.length > f.contentCell ? (d(
1409
1384
  t,
1410
1385
  n,
1411
1386
  `Must be ${f.contentCell} characters or fewer.`
1412
1387
  ), e.slice(0, f.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (d(t, n, "Expected a finite number."), null) : e;
1413
- const r = Se(e, n, t);
1388
+ const r = Ce(e, n, t);
1414
1389
  return r || (d(
1415
1390
  t,
1416
1391
  n,
1417
1392
  "Expected a string, number, boolean, structured numeric value, or null."
1418
1393
  ), null);
1419
1394
  }
1420
- function fn(e, n, t) {
1395
+ function ln(e, n, t) {
1421
1396
  if (!Array.isArray(e))
1422
1397
  return d(t, n, "Expected an array."), [];
1423
- e.length === 0 && d(t, n, "Expected at least one column."), e.length > x.maxTableColumns && d(
1398
+ e.length === 0 && d(t, n, "Expected at least one column."), e.length > $.maxTableColumns && d(
1424
1399
  t,
1425
1400
  n,
1426
- `Must have ${x.maxTableColumns} columns or fewer.`
1401
+ `Must have ${$.maxTableColumns} columns or fewer.`
1427
1402
  );
1428
1403
  const r = /* @__PURE__ */ new Set();
1429
- return e.slice(0, x.maxTableColumns).map((o, a) => {
1404
+ return e.slice(0, $.maxTableColumns).map((o, a) => {
1430
1405
  const i = `${n}.${a}`, c = v(o, i, t);
1431
- p(c, i, ["key", "label", "kind", "align"], t);
1406
+ h(c, i, ["key", "label", "kind", "align"], t);
1432
1407
  const l = b(
1433
1408
  c.key,
1434
1409
  `${i}.key`,
@@ -1441,16 +1416,16 @@ function fn(e, n, t) {
1441
1416
  `${i}.label`,
1442
1417
  f.contentTitle,
1443
1418
  t
1444
- ), s = D(
1419
+ ), s = k(
1445
1420
  c.kind,
1446
1421
  `${i}.kind`,
1447
- en,
1422
+ Zt,
1448
1423
  "text, number, currency, percent, date, or boolean",
1449
1424
  t
1450
- ), u = D(
1425
+ ), u = k(
1451
1426
  c.align,
1452
1427
  `${i}.align`,
1453
- tn,
1428
+ Yt,
1454
1429
  "left, center, or right",
1455
1430
  t
1456
1431
  );
@@ -1462,34 +1437,34 @@ function fn(e, n, t) {
1462
1437
  };
1463
1438
  });
1464
1439
  }
1465
- function un(e, n, t, r) {
1440
+ function dn(e, n, t, r) {
1466
1441
  if (!Array.isArray(e))
1467
1442
  return d(r, n, "Expected an array."), [];
1468
- e.length > x.maxTableRows && d(
1443
+ e.length > $.maxTableRows && d(
1469
1444
  r,
1470
1445
  n,
1471
- `Must have ${x.maxTableRows} rows or fewer.`
1446
+ `Must have ${$.maxTableRows} rows or fewer.`
1472
1447
  );
1473
1448
  const o = new Set(t.map((a) => a.key).filter(Boolean));
1474
- return e.slice(0, x.maxTableRows).map((a, i) => {
1449
+ return e.slice(0, $.maxTableRows).map((a, i) => {
1475
1450
  const c = `${n}.${i}`, l = v(a, c, r);
1476
1451
  return Object.keys(l).forEach((m) => {
1477
1452
  o.has(m) || d(r, `${c}.${m}`, `Unexpected table cell "${m}".`);
1478
1453
  }), Object.fromEntries(
1479
1454
  t.map((m) => [
1480
1455
  m.key,
1481
- mn(l[m.key] ?? null, `${c}.${m.key}`, r)
1456
+ cn(l[m.key] ?? null, `${c}.${m.key}`, r)
1482
1457
  ])
1483
1458
  );
1484
1459
  });
1485
1460
  }
1486
- function pn(e, n, t) {
1461
+ function sn(e, n, t) {
1487
1462
  const r = `content.blocks.${n}`, o = v(e, r, t), a = o.type;
1488
1463
  if (a === "heading") {
1489
- p(o, r, ["type", "text", "level", "evidenceIds"], t);
1464
+ h(o, r, ["type", "text", "level", "evidenceIds"], t);
1490
1465
  const i = o.level === void 0 || o.level === null ? void 0 : o.level === 2 || o.level === 3 ? o.level : void 0;
1491
1466
  o.level !== void 0 && o.level !== null && i === void 0 && d(t, `${r}.level`, "Expected 2 or 3.");
1492
- const c = k(o.evidenceIds, `${r}.evidenceIds`, t);
1467
+ const c = C(o.evidenceIds, `${r}.evidenceIds`, t);
1493
1468
  return {
1494
1469
  type: "heading",
1495
1470
  text: b(
@@ -1503,8 +1478,8 @@ function pn(e, n, t) {
1503
1478
  };
1504
1479
  }
1505
1480
  if (a === "paragraph") {
1506
- p(o, r, ["type", "text", "evidenceIds"], t);
1507
- const i = k(o.evidenceIds, `${r}.evidenceIds`, t);
1481
+ h(o, r, ["type", "text", "evidenceIds"], t);
1482
+ const i = C(o.evidenceIds, `${r}.evidenceIds`, t);
1508
1483
  return {
1509
1484
  type: "paragraph",
1510
1485
  text: b(
@@ -1517,16 +1492,16 @@ function pn(e, n, t) {
1517
1492
  };
1518
1493
  }
1519
1494
  if (a === "finding") {
1520
- p(o, r, ["type", "title", "text", "severity", "evidenceIds"], t);
1495
+ h(o, r, ["type", "title", "text", "severity", "evidenceIds"], t);
1521
1496
  const i = I(
1522
1497
  o.title,
1523
1498
  `${r}.title`,
1524
1499
  f.contentTitle,
1525
1500
  t
1526
- ), c = D(
1501
+ ), c = k(
1527
1502
  o.severity,
1528
1503
  `${r}.severity`,
1529
- Qt,
1504
+ Xt,
1530
1505
  "info, positive, warning, or critical",
1531
1506
  t
1532
1507
  );
@@ -1540,28 +1515,28 @@ function pn(e, n, t) {
1540
1515
  t
1541
1516
  ),
1542
1517
  ...c ? { severity: c } : {},
1543
- evidenceIds: k(o.evidenceIds, `${r}.evidenceIds`, t, {
1518
+ evidenceIds: C(o.evidenceIds, `${r}.evidenceIds`, t, {
1544
1519
  required: !0
1545
1520
  }) ?? []
1546
1521
  };
1547
1522
  }
1548
1523
  if (a === "bullets" || a === "actions" || a === "limitations") {
1549
- p(o, r, ["type", "title", "items", "evidenceIds"], t);
1524
+ h(o, r, ["type", "title", "items", "evidenceIds"], t);
1550
1525
  const i = I(
1551
1526
  o.title,
1552
1527
  `${r}.title`,
1553
1528
  f.contentTitle,
1554
1529
  t
1555
- ), c = k(o.evidenceIds, `${r}.evidenceIds`, t);
1530
+ ), c = C(o.evidenceIds, `${r}.evidenceIds`, t);
1556
1531
  return {
1557
1532
  type: a,
1558
1533
  ...i ? { title: i } : {},
1559
- items: dn(o.items, `${r}.items`, t),
1534
+ items: on(o.items, `${r}.items`, t),
1560
1535
  ...c ? { evidenceIds: c } : {}
1561
1536
  };
1562
1537
  }
1563
1538
  if (a === "metric") {
1564
- p(
1539
+ h(
1565
1540
  o,
1566
1541
  r,
1567
1542
  [
@@ -1576,21 +1551,21 @@ function pn(e, n, t) {
1576
1551
  ],
1577
1552
  t
1578
1553
  );
1579
- const i = O(o.value, `${r}.value`, t) ?? "";
1554
+ const i = w(o.value, `${r}.value`, t) ?? "";
1580
1555
  i === "" && d(
1581
1556
  t,
1582
1557
  `${r}.value`,
1583
1558
  "Expected a non-empty string, number, or structured numeric value."
1584
1559
  );
1585
- const c = o.previousValue === void 0 || o.previousValue === null ? o.previousValue : O(
1560
+ const c = o.previousValue === void 0 || o.previousValue === null ? o.previousValue : w(
1586
1561
  o.previousValue,
1587
1562
  `${r}.previousValue`,
1588
1563
  t
1589
- ), l = o.delta === void 0 || o.delta === null ? o.delta : O(
1564
+ ), l = o.delta === void 0 || o.delta === null ? o.delta : w(
1590
1565
  o.delta,
1591
1566
  `${r}.delta`,
1592
1567
  t
1593
- ), m = o.percentChange === void 0 || o.percentChange === null ? o.percentChange : O(
1568
+ ), m = o.percentChange === void 0 || o.percentChange === null ? o.percentChange : w(
1594
1569
  o.percentChange,
1595
1570
  `${r}.percentChange`,
1596
1571
  t
@@ -1599,7 +1574,7 @@ function pn(e, n, t) {
1599
1574
  `${r}.unit`,
1600
1575
  f.contentTitle,
1601
1576
  t
1602
- ), u = k(o.evidenceIds, `${r}.evidenceIds`, t);
1577
+ ), u = C(o.evidenceIds, `${r}.evidenceIds`, t);
1603
1578
  return {
1604
1579
  type: "metric",
1605
1580
  label: b(
@@ -1617,23 +1592,23 @@ function pn(e, n, t) {
1617
1592
  };
1618
1593
  }
1619
1594
  if (a === "kpi_grid") {
1620
- p(o, r, ["type", "title", "tiles", "evidenceIds"], t);
1595
+ h(o, r, ["type", "title", "tiles", "evidenceIds"], t);
1621
1596
  const i = I(
1622
1597
  o.title,
1623
1598
  `${r}.title`,
1624
1599
  f.contentTitle,
1625
1600
  t
1626
1601
  ), c = Array.isArray(o.tiles) ? o.tiles : [];
1627
- Array.isArray(o.tiles) || d(t, `${r}.tiles`, "Expected an array."), c.length === 0 && d(t, `${r}.tiles`, "Expected at least one tile."), c.length > x.maxKpiTiles && d(
1602
+ Array.isArray(o.tiles) || d(t, `${r}.tiles`, "Expected an array."), c.length === 0 && d(t, `${r}.tiles`, "Expected at least one tile."), c.length > $.maxKpiTiles && d(
1628
1603
  t,
1629
1604
  `${r}.tiles`,
1630
- `Must have ${x.maxKpiTiles} tiles or fewer.`
1605
+ `Must have ${$.maxKpiTiles} tiles or fewer.`
1631
1606
  );
1632
- const l = c.slice(0, x.maxKpiTiles).map((s, u) => {
1633
- const h = `${r}.tiles.${u}`, g = v(s, h, t);
1634
- p(
1607
+ const l = c.slice(0, $.maxKpiTiles).map((s, u) => {
1608
+ const p = `${r}.tiles.${u}`, g = v(s, p, t);
1609
+ h(
1635
1610
  g,
1636
- h,
1611
+ p,
1637
1612
  [
1638
1613
  "label",
1639
1614
  "value",
@@ -1645,53 +1620,53 @@ function pn(e, n, t) {
1645
1620
  ],
1646
1621
  t
1647
1622
  );
1648
- const E = O(
1623
+ const E = w(
1649
1624
  g.value,
1650
- `${h}.value`,
1625
+ `${p}.value`,
1651
1626
  t
1652
1627
  ) ?? "";
1653
1628
  E === "" && d(
1654
1629
  t,
1655
- `${h}.value`,
1630
+ `${p}.value`,
1656
1631
  "Expected a non-empty string, number, or structured numeric value."
1657
1632
  );
1658
- const C = g.previousValue === void 0 || g.previousValue === null ? g.previousValue : O(
1633
+ const A = g.previousValue === void 0 || g.previousValue === null ? g.previousValue : w(
1659
1634
  g.previousValue,
1660
- `${h}.previousValue`,
1635
+ `${p}.previousValue`,
1661
1636
  t
1662
- ), _ = g.delta === void 0 || g.delta === null ? g.delta : O(
1637
+ ), F = g.delta === void 0 || g.delta === null ? g.delta : w(
1663
1638
  g.delta,
1664
- `${h}.delta`,
1639
+ `${p}.delta`,
1665
1640
  t
1666
- ), M = g.percentChange === void 0 || g.percentChange === null ? g.percentChange : O(
1641
+ ), ee = g.percentChange === void 0 || g.percentChange === null ? g.percentChange : w(
1667
1642
  g.percentChange,
1668
- `${h}.percentChange`,
1643
+ `${p}.percentChange`,
1669
1644
  t
1670
- ), $ = I(
1645
+ ), te = I(
1671
1646
  g.unit,
1672
- `${h}.unit`,
1647
+ `${p}.unit`,
1673
1648
  f.contentTitle,
1674
1649
  t
1675
- ), T = k(
1650
+ ), ne = C(
1676
1651
  g.evidenceIds,
1677
- `${h}.evidenceIds`,
1652
+ `${p}.evidenceIds`,
1678
1653
  t
1679
1654
  );
1680
1655
  return {
1681
1656
  label: b(
1682
1657
  g.label,
1683
- `${h}.label`,
1658
+ `${p}.label`,
1684
1659
  f.contentTitle,
1685
1660
  t
1686
1661
  ),
1687
1662
  value: E,
1688
- ...C !== void 0 ? { previousValue: C } : {},
1689
- ..._ !== void 0 ? { delta: _ } : {},
1690
- ...M !== void 0 ? { percentChange: M } : {},
1691
- ...$ ? { unit: $ } : {},
1692
- ...T ? { evidenceIds: T } : {}
1663
+ ...A !== void 0 ? { previousValue: A } : {},
1664
+ ...F !== void 0 ? { delta: F } : {},
1665
+ ...ee !== void 0 ? { percentChange: ee } : {},
1666
+ ...te ? { unit: te } : {},
1667
+ ...ne ? { evidenceIds: ne } : {}
1693
1668
  };
1694
- }), m = k(
1669
+ }), m = C(
1695
1670
  o.evidenceIds,
1696
1671
  `${r}.evidenceIds`,
1697
1672
  t
@@ -1704,7 +1679,7 @@ function pn(e, n, t) {
1704
1679
  };
1705
1680
  }
1706
1681
  if (a === "progress") {
1707
- p(o, r, ["type", "label", "value", "detail", "evidenceIds"], t);
1682
+ h(o, r, ["type", "label", "value", "detail", "evidenceIds"], t);
1708
1683
  const i = typeof o.value == "number" && Number.isFinite(o.value) ? o.value : 0;
1709
1684
  (typeof o.value != "number" || !Number.isFinite(o.value)) && d(t, `${r}.value`, "Expected a finite number.");
1710
1685
  const c = I(
@@ -1712,7 +1687,7 @@ function pn(e, n, t) {
1712
1687
  `${r}.detail`,
1713
1688
  f.contentText,
1714
1689
  t
1715
- ), l = k(o.evidenceIds, `${r}.evidenceIds`, t);
1690
+ ), l = C(o.evidenceIds, `${r}.evidenceIds`, t);
1716
1691
  return {
1717
1692
  type: "progress",
1718
1693
  label: b(
@@ -1727,13 +1702,13 @@ function pn(e, n, t) {
1727
1702
  };
1728
1703
  }
1729
1704
  if (a === "table") {
1730
- p(
1705
+ h(
1731
1706
  o,
1732
1707
  r,
1733
1708
  ["type", "id", "title", "columns", "rows", "caption", "totalRows", "evidenceIds"],
1734
1709
  t
1735
1710
  );
1736
- const i = fn(o.columns, `${r}.columns`, t), c = I(
1711
+ const i = ln(o.columns, `${r}.columns`, t), c = I(
1737
1712
  o.title,
1738
1713
  `${r}.title`,
1739
1714
  f.contentTitle,
@@ -1748,24 +1723,24 @@ function pn(e, n, t) {
1748
1723
  `${r}.caption`,
1749
1724
  f.contentItem,
1750
1725
  t
1751
- ), s = on(
1726
+ ), s = en(
1752
1727
  o.totalRows,
1753
1728
  `${r}.totalRows`,
1754
1729
  t
1755
- ), u = k(o.evidenceIds, `${r}.evidenceIds`, t);
1730
+ ), u = C(o.evidenceIds, `${r}.evidenceIds`, t);
1756
1731
  return {
1757
1732
  type: "table",
1758
1733
  ...l ? { id: l } : {},
1759
1734
  ...c ? { title: c } : {},
1760
1735
  columns: i,
1761
- rows: un(o.rows, `${r}.rows`, i, t),
1736
+ rows: dn(o.rows, `${r}.rows`, i, t),
1762
1737
  ...m ? { caption: m } : {},
1763
1738
  ...s !== void 0 ? { totalRows: s } : {},
1764
1739
  ...u ? { evidenceIds: u } : {}
1765
1740
  };
1766
1741
  }
1767
1742
  if (a === "evidence_appendix") {
1768
- p(o, r, ["type", "title", "evidenceIds"], t);
1743
+ h(o, r, ["type", "title", "evidenceIds"], t);
1769
1744
  const i = I(
1770
1745
  o.title,
1771
1746
  `${r}.title`,
@@ -1775,13 +1750,13 @@ function pn(e, n, t) {
1775
1750
  return {
1776
1751
  type: "evidence_appendix",
1777
1752
  ...i ? { title: i } : {},
1778
- evidenceIds: k(o.evidenceIds, `${r}.evidenceIds`, t, {
1753
+ evidenceIds: C(o.evidenceIds, `${r}.evidenceIds`, t, {
1779
1754
  required: !0
1780
1755
  }) ?? []
1781
1756
  };
1782
1757
  }
1783
1758
  if (a === "sql") {
1784
- p(o, r, ["type", "title", "sql", "evidenceIds"], t);
1759
+ h(o, r, ["type", "title", "sql", "evidenceIds"], t);
1785
1760
  const i = I(
1786
1761
  o.title,
1787
1762
  `${r}.title`,
@@ -1792,7 +1767,7 @@ function pn(e, n, t) {
1792
1767
  `${r}.sql`,
1793
1768
  f.contentSql,
1794
1769
  t
1795
- ), l = k(o.evidenceIds, `${r}.evidenceIds`, t);
1770
+ ), l = C(o.evidenceIds, `${r}.evidenceIds`, t);
1796
1771
  return {
1797
1772
  type: "sql",
1798
1773
  ...i ? { title: i } : {},
@@ -1809,9 +1784,9 @@ function pn(e, n, t) {
1809
1784
  text: ""
1810
1785
  };
1811
1786
  }
1812
- function hn(e) {
1787
+ function mn(e) {
1813
1788
  const n = [], t = v(e, "content", n);
1814
- p(t, "content", ["version", "title", "summary", "blocks"], n), t.version !== 1 && d(n, "content.version", "Expected version 1.");
1789
+ h(t, "content", ["version", "title", "summary", "blocks"], n), t.version !== 1 && d(n, "content.version", "Expected version 1.");
1815
1790
  const r = I(
1816
1791
  t.title,
1817
1792
  "content.title",
@@ -1825,43 +1800,43 @@ function hn(e) {
1825
1800
  );
1826
1801
  Array.isArray(t.blocks) || d(n, "content.blocks", "Expected an array.");
1827
1802
  const a = Array.isArray(t.blocks) ? t.blocks : [];
1828
- a.length === 0 && d(n, "content.blocks", "Expected at least one block."), a.length > x.maxBlocks && d(
1803
+ a.length === 0 && d(n, "content.blocks", "Expected at least one block."), a.length > $.maxBlocks && d(
1829
1804
  n,
1830
1805
  "content.blocks",
1831
- `Must have ${x.maxBlocks} blocks or fewer.`
1806
+ `Must have ${$.maxBlocks} blocks or fewer.`
1832
1807
  );
1833
- const i = a.slice(0, x.maxBlocks).map((c, l) => pn(c, l, n));
1834
- return te(n), {
1808
+ const i = a.slice(0, $.maxBlocks).map((c, l) => sn(c, l, n));
1809
+ return Y(n), {
1835
1810
  version: 1,
1836
1811
  ...r ? { title: r } : {},
1837
1812
  ...o ? { summary: o } : {},
1838
1813
  blocks: i
1839
1814
  };
1840
1815
  }
1841
- function pr(e) {
1816
+ function sr(e) {
1842
1817
  try {
1843
1818
  return {
1844
1819
  valid: !0,
1845
- value: hn(e),
1820
+ value: mn(e),
1846
1821
  issues: []
1847
1822
  };
1848
1823
  } catch (n) {
1849
- if (n instanceof j)
1824
+ if (n instanceof P)
1850
1825
  return { valid: !1, issues: n.issues };
1851
1826
  throw n;
1852
1827
  }
1853
1828
  }
1854
- function z(e, n, t, r) {
1829
+ function L(e, n, t, r) {
1855
1830
  return typeof e == "string" && t.includes(e) ? e : (d(r, n, `Expected ${t.join(" or ")}.`), t[0]);
1856
1831
  }
1857
- function D(e, n, t, r, o) {
1832
+ function k(e, n, t, r, o) {
1858
1833
  if (e != null) {
1859
1834
  if (typeof e == "string" && t.has(e))
1860
1835
  return e;
1861
1836
  d(o, n, `Expected ${r}.`);
1862
1837
  }
1863
1838
  }
1864
- function yn(e, n, t) {
1839
+ function fn(e, n, t) {
1865
1840
  if (e != null) {
1866
1841
  if (!Array.isArray(e)) {
1867
1842
  d(t, n, "Expected an array.");
@@ -1870,63 +1845,63 @@ function yn(e, n, t) {
1870
1845
  return e;
1871
1846
  }
1872
1847
  }
1873
- function gn(e, n, t) {
1848
+ function un(e, n, t) {
1874
1849
  if (e != null) {
1875
- if (!$e(e)) {
1850
+ if (!ve(e)) {
1876
1851
  d(t, n, "Expected an object.");
1877
1852
  return;
1878
1853
  }
1879
1854
  return e;
1880
1855
  }
1881
1856
  }
1882
- function bn(e, n, t) {
1857
+ function pn(e, n, t) {
1883
1858
  if (e == null)
1884
1859
  return;
1885
1860
  const r = v(e, n, t);
1886
- p(r, n, nn, t);
1861
+ h(r, n, Jt, t);
1887
1862
  const o = {};
1888
1863
  if (r.matrix !== void 0) {
1889
1864
  const s = v(r.matrix, `${n}.matrix`, t);
1890
- p(s, `${n}.matrix`, ["config", "content"], t);
1891
- const u = Pe.safeParse(s.config);
1865
+ h(s, `${n}.matrix`, ["config", "content"], t);
1866
+ const u = Me.safeParse(s.config);
1892
1867
  u.success || d(t, `${n}.matrix.config`, "Expected a valid Matrix definition.");
1893
- const h = D(
1868
+ const p = k(
1894
1869
  s.content,
1895
1870
  `${n}.matrix.content`,
1896
1871
  /* @__PURE__ */ new Set(["current", "all", "flat"]),
1897
1872
  "current, all, or flat",
1898
1873
  t
1899
1874
  );
1900
- h || d(t, `${n}.matrix.content`, "Choose Matrix export content."), u.success && h && (o.matrix = { config: u.data, content: h });
1875
+ p || d(t, `${n}.matrix.content`, "Choose Matrix export content."), u.success && p && (o.matrix = { config: u.data, content: p });
1901
1876
  }
1902
- const a = D(
1877
+ const a = k(
1903
1878
  r.pageSize,
1904
1879
  `${n}.pageSize`,
1905
- Gt,
1880
+ jt,
1906
1881
  "letter, legal, a4, a3, or tabloid",
1907
1882
  t
1908
- ), i = D(
1883
+ ), i = k(
1909
1884
  r.orientation,
1910
1885
  `${n}.orientation`,
1911
- Wt,
1886
+ qt,
1912
1887
  "portrait or landscape",
1913
1888
  t
1914
- ), c = D(
1889
+ ), c = k(
1915
1890
  r.delimiter,
1916
1891
  `${n}.delimiter`,
1917
- Xt,
1892
+ Kt,
1918
1893
  "comma, semicolon, or tab",
1919
1894
  t
1920
- ), l = D(
1895
+ ), l = k(
1921
1896
  r.csvEncoding,
1922
1897
  `${n}.csvEncoding`,
1923
- Zt,
1898
+ Ht,
1924
1899
  "utf-8-bom or utf-8",
1925
1900
  t
1926
- ), m = D(
1901
+ ), m = k(
1927
1902
  r.sheetSelection,
1928
1903
  `${n}.sheetSelection`,
1929
- Yt,
1904
+ Gt,
1930
1905
  "current or all",
1931
1906
  t
1932
1907
  );
@@ -1968,7 +1943,7 @@ function bn(e, n, t) {
1968
1943
  "cardControlDefinitions",
1969
1944
  "controlBindings"
1970
1945
  ]) {
1971
- const u = yn(r[s], `${n}.${s}`, t);
1946
+ const u = fn(r[s], `${n}.${s}`, t);
1972
1947
  u && (o[s] = u);
1973
1948
  }
1974
1949
  for (const s of [
@@ -1977,12 +1952,12 @@ function bn(e, n, t) {
1977
1952
  "dashboardInputExecutionSnapshot",
1978
1953
  "printInputCapture"
1979
1954
  ]) {
1980
- const u = gn(r[s], `${n}.${s}`, t);
1955
+ const u = un(r[s], `${n}.${s}`, t);
1981
1956
  u && (o[s] = u);
1982
1957
  }
1983
1958
  return Object.keys(o).length > 0 ? o : void 0;
1984
1959
  }
1985
- function W(e, n, t, r) {
1960
+ function q(e, n, t, r) {
1986
1961
  const o = I(
1987
1962
  n,
1988
1963
  t,
@@ -1991,24 +1966,24 @@ function W(e, n, t, r) {
1991
1966
  );
1992
1967
  return o && (e.title = o), e;
1993
1968
  }
1994
- function X(e, n, t, r) {
1995
- const o = bn(n, t, r);
1969
+ function K(e, n, t, r) {
1970
+ const o = pn(n, t, r);
1996
1971
  return o != null && o.printInputCapture && e.type !== "dashboard" && d(
1997
1972
  r,
1998
1973
  `${t}.printInputCapture`,
1999
1974
  "Only a full dashboard attachment can carry printInputCapture."
2000
1975
  ), o && (e.settings = o), e;
2001
1976
  }
2002
- function In(e, n, t) {
1977
+ function hn(e, n, t) {
2003
1978
  const r = `attachments.${n}`, o = v(e, r, t), a = o.type;
2004
1979
  if (a === "dashboard") {
2005
- p(
1980
+ h(
2006
1981
  o,
2007
1982
  r,
2008
1983
  ["type", "dashboardId", "format", "title", "settings"],
2009
1984
  t
2010
1985
  );
2011
- const i = W(
1986
+ const i = q(
2012
1987
  {
2013
1988
  type: "dashboard",
2014
1989
  dashboardId: b(
@@ -2017,22 +1992,22 @@ function In(e, n, t) {
2017
1992
  f.id,
2018
1993
  t
2019
1994
  ),
2020
- format: z(o.format, `${r}.format`, ["pdf"], t)
1995
+ format: L(o.format, `${r}.format`, ["pdf"], t)
2021
1996
  },
2022
1997
  o.title,
2023
1998
  `${r}.title`,
2024
1999
  t
2025
2000
  );
2026
- return X(i, o.settings, `${r}.settings`, t);
2001
+ return K(i, o.settings, `${r}.settings`, t);
2027
2002
  }
2028
2003
  if (a === "dashboard_sheet" || a === "document_sheet") {
2029
- p(
2004
+ h(
2030
2005
  o,
2031
2006
  r,
2032
2007
  ["type", "dashboardId", "sheetId", "format", "title", "settings"],
2033
2008
  t
2034
2009
  );
2035
- const i = W(
2010
+ const i = q(
2036
2011
  {
2037
2012
  type: a,
2038
2013
  dashboardId: b(
@@ -2047,7 +2022,7 @@ function In(e, n, t) {
2047
2022
  f.id,
2048
2023
  t
2049
2024
  ),
2050
- format: z(
2025
+ format: L(
2051
2026
  o.format,
2052
2027
  `${r}.format`,
2053
2028
  a === "dashboard_sheet" ? ["pdf", "png"] : ["pdf"],
@@ -2058,18 +2033,18 @@ function In(e, n, t) {
2058
2033
  `${r}.title`,
2059
2034
  t
2060
2035
  );
2061
- return de(
2062
- X(i, o.settings, `${r}.settings`, t)
2036
+ return ce(
2037
+ K(i, o.settings, `${r}.settings`, t)
2063
2038
  );
2064
2039
  }
2065
2040
  if (a === "card") {
2066
- p(
2041
+ h(
2067
2042
  o,
2068
2043
  r,
2069
2044
  ["type", "dashboardId", "cardId", "format", "title", "settings"],
2070
2045
  t
2071
2046
  );
2072
- const i = W(
2047
+ const i = q(
2073
2048
  {
2074
2049
  type: "card",
2075
2050
  dashboardId: b(
@@ -2084,10 +2059,10 @@ function In(e, n, t) {
2084
2059
  f.id,
2085
2060
  t
2086
2061
  ),
2087
- format: z(
2062
+ format: L(
2088
2063
  o.format,
2089
2064
  `${r}.format`,
2090
- ve,
2065
+ be,
2091
2066
  t
2092
2067
  )
2093
2068
  },
@@ -2095,8 +2070,8 @@ function In(e, n, t) {
2095
2070
  `${r}.title`,
2096
2071
  t
2097
2072
  );
2098
- return de(
2099
- X(i, o.settings, `${r}.settings`, t)
2073
+ return ce(
2074
+ K(i, o.settings, `${r}.settings`, t)
2100
2075
  );
2101
2076
  }
2102
2077
  return d(
@@ -2105,7 +2080,7 @@ function In(e, n, t) {
2105
2080
  "Expected dashboard, dashboard_sheet, document_sheet, or card."
2106
2081
  ), { type: "dashboard", dashboardId: "", format: "pdf" };
2107
2082
  }
2108
- function de(e) {
2083
+ function ce(e) {
2109
2084
  if (e.format !== "png" || !e.settings) return e;
2110
2085
  const {
2111
2086
  pageSize: n,
@@ -2115,7 +2090,7 @@ function de(e) {
2115
2090
  } = e.settings, { settings: a, ...i } = e;
2116
2091
  return Object.keys(o).length > 0 ? { ...i, settings: o } : i;
2117
2092
  }
2118
- function vn(e) {
2093
+ function yn(e) {
2119
2094
  switch (e.type) {
2120
2095
  case "dashboard":
2121
2096
  return `${e.type}:${e.dashboardId}:${e.format}`;
@@ -2126,35 +2101,35 @@ function vn(e) {
2126
2101
  return `${e.type}:${e.dashboardId}:${e.cardId}:${e.format}`;
2127
2102
  }
2128
2103
  }
2129
- function ke(e, n) {
2104
+ function Te(e, n) {
2130
2105
  if (e == null)
2131
2106
  return [];
2132
2107
  if (!Array.isArray(e))
2133
2108
  return d(n, "attachments", "Expected an array."), [];
2134
- e.length > H && d(
2109
+ e.length > z && d(
2135
2110
  n,
2136
2111
  "attachments",
2137
- `Choose ${H} attachments or fewer.`
2112
+ `Choose ${z} attachments or fewer.`
2138
2113
  );
2139
- const t = e.slice(0, H).map((o, a) => In(o, a, n)), r = /* @__PURE__ */ new Set();
2114
+ const t = e.slice(0, z).map((o, a) => hn(o, a, n)), r = /* @__PURE__ */ new Set();
2140
2115
  return t.forEach((o, a) => {
2141
2116
  var c, l, m, s;
2142
- (c = o.settings) != null && c.matrix && (o.type !== "card" || o.settings.cardType !== "matrixTable" || o.settings.matrix.content === "flat" && o.format === "pdf") && d(n, `attachments.${a}.settings.matrix`, "Matrix settings require a matrixTable card attachment; flat content requires CSV or Excel."), o.format === "png" && ((l = o.settings) != null && l.matrix) && o.settings.matrix.content !== "current" && d(n, `attachments.${a}.settings.matrix.content`, "A Matrix PNG image shows the current layout."), o.format === "xlsx" && !((m = o.settings) != null && m.matrix) && !Q((s = o.settings) == null ? void 0 : s.cardType) && d(n, `attachments.${a}.format`, "Excel attachments require a Table, Detail Table or Matrix card.");
2143
- const i = vn(o);
2117
+ (c = o.settings) != null && c.matrix && (o.type !== "card" || o.settings.cardType !== "matrixTable" || o.settings.matrix.content === "flat" && o.format === "pdf") && d(n, `attachments.${a}.settings.matrix`, "Matrix settings require a matrixTable card attachment; flat content requires CSV or Excel."), o.format === "png" && ((l = o.settings) != null && l.matrix) && o.settings.matrix.content !== "current" && d(n, `attachments.${a}.settings.matrix.content`, "A Matrix PNG image shows the current layout."), o.format === "xlsx" && !((m = o.settings) != null && m.matrix) && !X((s = o.settings) == null ? void 0 : s.cardType) && d(n, `attachments.${a}.format`, "Excel attachments require a Table, Detail Table or Matrix card.");
2118
+ const i = yn(o);
2144
2119
  r.has(i) && d(n, `attachments.${a}`, "Duplicate attachment."), r.add(i);
2145
2120
  }), t;
2146
2121
  }
2147
- function Ae(e, n) {
2122
+ function Se(e, n) {
2148
2123
  if (e == null)
2149
2124
  return;
2150
2125
  const t = v(e, "limits", n);
2151
- p(t, "limits", Object.keys(G), n);
2126
+ h(t, "limits", Object.keys(j), n);
2152
2127
  const r = {};
2153
- return Object.keys(G).forEach((o) => {
2128
+ return Object.keys(j).forEach((o) => {
2154
2129
  const a = t[o];
2155
2130
  if (a == null)
2156
2131
  return;
2157
- const i = G[o];
2132
+ const i = j[o];
2158
2133
  if (typeof a != "number" || !Number.isInteger(a) || a < i.min || a > i.max) {
2159
2134
  d(
2160
2135
  n,
@@ -2166,42 +2141,42 @@ function Ae(e, n) {
2166
2141
  r[o] = a;
2167
2142
  }), Object.keys(r).length > 0 ? r : void 0;
2168
2143
  }
2169
- function te(e) {
2144
+ function Y(e) {
2170
2145
  if (e.length > 0)
2171
- throw new j(e);
2146
+ throw new P(e);
2172
2147
  }
2173
- function we(e, n, t) {
2148
+ function ke(e, n, t) {
2174
2149
  !(e.type === "generated_analysis" || e.type === "custom_message" && !!e.message.trim()) && n.length === 0 && d(
2175
2150
  t,
2176
2151
  "body",
2177
2152
  "Add briefing instructions, a custom message, or at least one attachment."
2178
2153
  );
2179
2154
  }
2180
- function En(e, n, t) {
2155
+ function gn(e, n, t) {
2181
2156
  e == null || e.forEach((r, o) => {
2182
2157
  const a = `${t}.${o}.scope`, i = r.scope.attachmentIndex;
2183
2158
  if (i === void 0)
2184
- throw new B(
2159
+ throw new N(
2185
2160
  `${a}.attachmentIndex must identify the attachment that owns this presentation entry.`
2186
2161
  );
2187
2162
  const c = n[i];
2188
2163
  if (!c)
2189
- throw new B(
2164
+ throw new N(
2190
2165
  `${a}.attachmentIndex must identify an existing attachment.`
2191
2166
  );
2192
2167
  if (r.scope.dashboardId !== c.dashboardId)
2193
- throw new B(
2168
+ throw new N(
2194
2169
  `${a}.dashboardId must match the dashboard selected by the referenced attachment.`
2195
2170
  );
2196
2171
  if (c.type === "card" && r.scope.cardId !== c.cardId)
2197
- throw new B(
2172
+ throw new N(
2198
2173
  `${a}.cardId must match the card selected by the referenced attachment.`
2199
2174
  );
2200
2175
  });
2201
2176
  }
2202
- function De(e) {
2177
+ function Ae(e) {
2203
2178
  const n = [], t = v(e, "jobConfig", n);
2204
- p(
2179
+ h(
2205
2180
  t,
2206
2181
  "jobConfig",
2207
2182
  [
@@ -2214,14 +2189,14 @@ function De(e) {
2214
2189
  "limits"
2215
2190
  ],
2216
2191
  n
2217
- ), t.kind !== Z && d(n, "kind", "Expected BRIEFING.");
2192
+ ), t.kind !== H && d(n, "kind", "Expected BRIEFING.");
2218
2193
  let r;
2219
2194
  try {
2220
- r = Le(
2195
+ r = Re(
2221
2196
  t.presentationExecutionSnapshot
2222
2197
  );
2223
2198
  } catch (m) {
2224
- if (m instanceof B)
2199
+ if (m instanceof N)
2225
2200
  throw m;
2226
2201
  d(
2227
2202
  n,
@@ -2229,13 +2204,13 @@ function De(e) {
2229
2204
  m instanceof Error ? m.message : "Invalid presentation snapshot."
2230
2205
  );
2231
2206
  }
2232
- const o = xe(t.source, n), a = Ce(t.body, n), i = ke(t.attachments, n), c = Te(t.presentation, n), l = Ae(t.limits, n);
2233
- return we(a, i, n), En(
2207
+ const o = Ee(t.source, n), a = $e(t.body, n), i = Te(t.attachments, n), c = xe(t.presentation, n), l = Se(t.limits, n);
2208
+ return ke(a, i, n), gn(
2234
2209
  r == null ? void 0 : r.resolvedFormats,
2235
2210
  i,
2236
2211
  "jobConfig.presentationExecutionSnapshot.resolvedFormats"
2237
- ), te(n), {
2238
- kind: Z,
2212
+ ), Y(n), {
2213
+ kind: H,
2239
2214
  presentationExecutionSnapshot: r,
2240
2215
  source: o,
2241
2216
  body: a,
@@ -2244,16 +2219,16 @@ function De(e) {
2244
2219
  ...l ? { limits: l } : {}
2245
2220
  };
2246
2221
  }
2247
- function hr(e) {
2248
- return De({
2222
+ function mr(e) {
2223
+ return Ae({
2249
2224
  ...e,
2250
- kind: Z
2225
+ kind: H
2251
2226
  });
2252
2227
  }
2253
- function ne(e, n, t, r = "deliveryConfig.recipients") {
2228
+ function J(e, n, t, r = "deliveryConfig.recipients") {
2254
2229
  const o = `${r}.${n}`, a = v(e, o, t), i = a.type;
2255
2230
  if (i === "email") {
2256
- p(a, o, ["type", "address", "name"], t);
2231
+ h(a, o, ["type", "address", "name"], t);
2257
2232
  const c = b(
2258
2233
  a.address,
2259
2234
  `${o}.address`,
@@ -2265,13 +2240,13 @@ function ne(e, n, t, r = "deliveryConfig.recipients") {
2265
2240
  f.attachmentTitle,
2266
2241
  t
2267
2242
  );
2268
- return c && !cn(c) && d(t, `${o}.address`, "Email address is invalid."), {
2243
+ return c && !nn(c) && d(t, `${o}.address`, "Email address is invalid."), {
2269
2244
  type: "email",
2270
2245
  address: c,
2271
2246
  ...l ? { name: l } : {}
2272
2247
  };
2273
2248
  }
2274
- return i === "user" ? (p(a, o, ["type", "userId"], t), {
2249
+ return i === "user" ? (h(a, o, ["type", "userId"], t), {
2275
2250
  type: "user",
2276
2251
  userId: b(
2277
2252
  a.userId,
@@ -2279,7 +2254,7 @@ function ne(e, n, t, r = "deliveryConfig.recipients") {
2279
2254
  f.id,
2280
2255
  t
2281
2256
  )
2282
- }) : i === "tenant_user" ? (p(a, o, ["type", "tenantUserId"], t), {
2257
+ }) : i === "tenant_user" ? (h(a, o, ["type", "tenantUserId"], t), {
2283
2258
  type: "tenant_user",
2284
2259
  tenantUserId: b(
2285
2260
  a.tenantUserId,
@@ -2287,7 +2262,7 @@ function ne(e, n, t, r = "deliveryConfig.recipients") {
2287
2262
  f.id,
2288
2263
  t
2289
2264
  )
2290
- }) : i === "group" ? (p(a, o, ["type", "groupId"], t), {
2265
+ }) : i === "group" ? (h(a, o, ["type", "groupId"], t), {
2291
2266
  type: "group",
2292
2267
  groupId: b(
2293
2268
  a.groupId,
@@ -2301,17 +2276,17 @@ function ne(e, n, t, r = "deliveryConfig.recipients") {
2301
2276
  "Expected email, user, tenant_user, or group."
2302
2277
  ), { type: "email", address: "" });
2303
2278
  }
2304
- function $n(e, n) {
2279
+ function bn(e, n) {
2305
2280
  return e == null ? [] : Array.isArray(e) ? e.map(
2306
- (t, r) => ne(t, r, n)
2281
+ (t, r) => J(t, r, n)
2307
2282
  ) : (d(n, "deliveryConfig.recipients", "Expected an array."), []);
2308
2283
  }
2309
- function xn(e, n) {
2284
+ function In(e, n) {
2310
2285
  if (!Array.isArray(e))
2311
2286
  return d(n, "deliveryConfig.channels", "Expected an array."), [];
2312
2287
  const t = [];
2313
2288
  return e.forEach((r, o) => {
2314
- if (!_e(r)) {
2289
+ if (!we(r)) {
2315
2290
  d(
2316
2291
  n,
2317
2292
  `deliveryConfig.channels.${o}`,
@@ -2322,7 +2297,7 @@ function xn(e, n) {
2322
2297
  t.includes(r) || t.push(r);
2323
2298
  }), t;
2324
2299
  }
2325
- function Cn(e, n, t) {
2300
+ function vn(e, n, t) {
2326
2301
  if (e == null)
2327
2302
  return;
2328
2303
  const r = v(e, n, t), o = {};
@@ -2334,17 +2309,17 @@ function Cn(e, n, t) {
2334
2309
  o[a] = i.trim();
2335
2310
  }), Object.keys(o).length > 0 ? o : void 0;
2336
2311
  }
2337
- function Tn(e, n, t) {
2312
+ function En(e, n, t) {
2338
2313
  if (e == null)
2339
2314
  return;
2340
2315
  const r = v(e, n, t);
2341
- p(
2316
+ h(
2342
2317
  r,
2343
2318
  n,
2344
2319
  ["url", "method", "headers", "secretEncrypted"],
2345
2320
  t
2346
2321
  );
2347
- const o = r.method === void 0 || r.method === null ? void 0 : z(r.method, `${n}.method`, ["POST", "PUT"], t), a = Cn(r.headers, `${n}.headers`, t), i = I(
2322
+ const o = r.method === void 0 || r.method === null ? void 0 : L(r.method, `${n}.method`, ["POST", "PUT"], t), a = vn(r.headers, `${n}.headers`, t), i = I(
2348
2323
  r.secretEncrypted,
2349
2324
  `${n}.secretEncrypted`,
2350
2325
  2e3,
@@ -2357,10 +2332,10 @@ function Tn(e, n, t) {
2357
2332
  ...i ? { secretEncrypted: i } : {}
2358
2333
  };
2359
2334
  }
2360
- function Sn(e, n, t) {
2335
+ function $n(e, n, t) {
2361
2336
  const r = v(e, n, t), o = r.type;
2362
2337
  if (o === "channel") {
2363
- p(
2338
+ h(
2364
2339
  r,
2365
2340
  n,
2366
2341
  ["type", "channelId", "channelName", "isPrivate"],
@@ -2371,7 +2346,7 @@ function Sn(e, n, t) {
2371
2346
  `${n}.channelName`,
2372
2347
  f.attachmentTitle,
2373
2348
  t
2374
- ), i = r.isPrivate === void 0 || r.isPrivate === null ? void 0 : R(
2349
+ ), i = r.isPrivate === void 0 || r.isPrivate === null ? void 0 : _(
2375
2350
  r.isPrivate,
2376
2351
  !1,
2377
2352
  `${n}.isPrivate`,
@@ -2389,16 +2364,16 @@ function Sn(e, n, t) {
2389
2364
  ...i !== void 0 ? { isPrivate: i } : {}
2390
2365
  };
2391
2366
  }
2392
- return o === "dm" ? (p(r, n, ["type", "recipient"], t), d(
2367
+ return o === "dm" ? (h(r, n, ["type", "recipient"], t), d(
2393
2368
  t,
2394
2369
  `${n}.type`,
2395
2370
  "Slack DM delivery is not supported in V1."
2396
2371
  ), {
2397
2372
  type: "dm",
2398
- recipient: ne(r.recipient, 0, t, `${n}.recipient`)
2373
+ recipient: J(r.recipient, 0, t, `${n}.recipient`)
2399
2374
  }) : (d(t, `${n}.type`, "Expected channel."), { type: "channel", channelId: "" });
2400
2375
  }
2401
- function kn(e, n, t) {
2376
+ function xn(e, n, t) {
2402
2377
  if (e == null)
2403
2378
  return;
2404
2379
  if (!Array.isArray(e)) {
@@ -2406,15 +2381,15 @@ function kn(e, n, t) {
2406
2381
  return;
2407
2382
  }
2408
2383
  const r = e.map(
2409
- (o, a) => ne(o, a, t, n)
2384
+ (o, a) => J(o, a, t, n)
2410
2385
  );
2411
2386
  return r.length > 0 ? r : void 0;
2412
2387
  }
2413
- function An(e, n, t) {
2388
+ function Cn(e, n, t) {
2414
2389
  if (e == null)
2415
2390
  return;
2416
2391
  const r = v(e, n, t);
2417
- p(
2392
+ h(
2418
2393
  r,
2419
2394
  n,
2420
2395
  [
@@ -2426,28 +2401,28 @@ function An(e, n, t) {
2426
2401
  ],
2427
2402
  t
2428
2403
  );
2429
- const o = kn(
2404
+ const o = xn(
2430
2405
  r.threadMentions,
2431
2406
  `${n}.threadMentions`,
2432
2407
  t
2433
- ), a = R(
2408
+ ), a = _(
2434
2409
  r.postThreadDetail,
2435
2410
  !0,
2436
2411
  `${n}.postThreadDetail`,
2437
2412
  t
2438
- ), i = R(
2413
+ ), i = _(
2439
2414
  r.includeDashboardLink,
2440
2415
  !0,
2441
2416
  `${n}.includeDashboardLink`,
2442
2417
  t
2443
- ), c = R(
2418
+ ), c = _(
2444
2419
  r.includeBriefingLink,
2445
2420
  !0,
2446
2421
  `${n}.includeBriefingLink`,
2447
2422
  t
2448
2423
  );
2449
2424
  return {
2450
- destination: Sn(
2425
+ destination: $n(
2451
2426
  r.destination,
2452
2427
  `${n}.destination`,
2453
2428
  t
@@ -2458,9 +2433,9 @@ function An(e, n, t) {
2458
2433
  ...r.includeBriefingLink !== void 0 ? { includeBriefingLink: c } : {}
2459
2434
  };
2460
2435
  }
2461
- function wn(e, n, t) {
2436
+ function Tn(e, n, t) {
2462
2437
  const r = v(e, n, t);
2463
- p(
2438
+ h(
2464
2439
  r,
2465
2440
  n,
2466
2441
  [
@@ -2474,10 +2449,10 @@ function wn(e, n, t) {
2474
2449
  ],
2475
2450
  t
2476
2451
  );
2477
- const o = D(
2452
+ const o = k(
2478
2453
  r.formatProfile,
2479
2454
  `${n}.formatProfile`,
2480
- Jt,
2455
+ Wt,
2481
2456
  "concise, balanced, or detailed",
2482
2457
  t
2483
2458
  ), a = I(
@@ -2495,16 +2470,16 @@ function wn(e, n, t) {
2495
2470
  `${n}.summaryOverride`,
2496
2471
  2e3,
2497
2472
  t
2498
- ), l = R(
2473
+ ), l = _(
2499
2474
  r.actionBlockVisible,
2500
2475
  !0,
2501
2476
  `${n}.actionBlockVisible`,
2502
2477
  t
2503
- ), m = Tn(
2478
+ ), m = En(
2504
2479
  r.webhookConfig,
2505
2480
  `${n}.webhookConfig`,
2506
2481
  t
2507
- ), s = An(
2482
+ ), s = Cn(
2508
2483
  r.slackConfig,
2509
2484
  `${n}.slackConfig`,
2510
2485
  t
@@ -2519,12 +2494,12 @@ function wn(e, n, t) {
2519
2494
  ...m ? { webhookConfig: m } : {}
2520
2495
  };
2521
2496
  }
2522
- function Dn(e, n) {
2497
+ function Sn(e, n) {
2523
2498
  if (e == null)
2524
2499
  return;
2525
2500
  const t = v(e, "deliveryConfig.channelConfigs", n), r = {};
2526
2501
  return Object.entries(t).forEach(([o, a]) => {
2527
- if (!_e(o)) {
2502
+ if (!we(o)) {
2528
2503
  d(
2529
2504
  n,
2530
2505
  `deliveryConfig.channelConfigs.${o}`,
@@ -2532,25 +2507,25 @@ function Dn(e, n) {
2532
2507
  );
2533
2508
  return;
2534
2509
  }
2535
- r[o] = wn(
2510
+ r[o] = Tn(
2536
2511
  a,
2537
2512
  `deliveryConfig.channelConfigs.${o}`,
2538
2513
  n
2539
2514
  );
2540
2515
  }), Object.keys(r).length > 0 ? r : void 0;
2541
2516
  }
2542
- function _n(e, n) {
2517
+ function kn(e, n) {
2543
2518
  var l, m, s;
2544
2519
  if (e == null)
2545
2520
  return null;
2546
2521
  const t = v(e, "deliveryConfig", n);
2547
- p(
2522
+ h(
2548
2523
  t,
2549
2524
  "deliveryConfig",
2550
2525
  ["recipients", "channels", "channelConfigs"],
2551
2526
  n
2552
2527
  );
2553
- const r = Dn(t.channelConfigs, n), o = $n(t.recipients, n), a = xn(t.channels, n), i = ((m = (l = r == null ? void 0 : r.SLACK) == null ? void 0 : l.slackConfig) == null ? void 0 : m.destination.type) === "channel" && !!r.SLACK.slackConfig.destination.channelId.trim();
2528
+ const r = Sn(t.channelConfigs, n), o = bn(t.recipients, n), a = In(t.channels, n), i = ((m = (l = r == null ? void 0 : r.SLACK) == null ? void 0 : l.slackConfig) == null ? void 0 : m.destination.type) === "channel" && !!r.SLACK.slackConfig.destination.channelId.trim();
2554
2529
  return a.some(
2555
2530
  (u) => u !== "SLACK"
2556
2531
  ) && o.length === 0 && d(
@@ -2575,9 +2550,9 @@ function _n(e, n) {
2575
2550
  ...r ? { channelConfigs: r } : {}
2576
2551
  };
2577
2552
  }
2578
- function re(e) {
2553
+ function Q(e) {
2579
2554
  const n = [], t = v(e, "draft", n);
2580
- p(
2555
+ h(
2581
2556
  t,
2582
2557
  "draft",
2583
2558
  [
@@ -2605,8 +2580,8 @@ function re(e) {
2605
2580
  "description",
2606
2581
  f.description,
2607
2582
  n
2608
- ) ?? null, a = I(t.scheduleExpr, "scheduleExpr", 500, n) ?? null, i = I(t.timezone, "timezone", 200, n) ?? "UTC", c = an(t.status, n), l = xe(t.source, n), m = Ce(t.body, n), s = ke(t.attachments, n), u = Te(t.presentation, n), h = Ae(t.limits, n), g = _n(t.deliveryConfig, n);
2609
- return we(m, s, n), te(n), {
2583
+ ) ?? null, a = I(t.scheduleExpr, "scheduleExpr", 500, n) ?? null, i = I(t.timezone, "timezone", 200, n) ?? "UTC", c = tn(t.status, n), l = Ee(t.source, n), m = $e(t.body, n), s = Te(t.attachments, n), u = xe(t.presentation, n), p = Se(t.limits, n), g = kn(t.deliveryConfig, n);
2584
+ return ke(m, s, n), Y(n), {
2610
2585
  name: r,
2611
2586
  description: o,
2612
2587
  status: c,
@@ -2616,96 +2591,96 @@ function re(e) {
2616
2591
  body: m,
2617
2592
  attachments: s,
2618
2593
  presentation: u,
2619
- ...h ? { limits: h } : {},
2594
+ ...p ? { limits: p } : {},
2620
2595
  deliveryConfig: g
2621
2596
  };
2622
2597
  }
2623
- function yr(e) {
2624
- return re(e);
2598
+ function fr(e) {
2599
+ return Q(e);
2625
2600
  }
2626
- function gr(e) {
2627
- return re(e);
2601
+ function ur(e) {
2602
+ return Q(e);
2628
2603
  }
2629
- function br(e) {
2604
+ function pr(e) {
2630
2605
  try {
2631
- return { valid: !0, value: re(e), issues: [] };
2606
+ return { valid: !0, value: Q(e), issues: [] };
2632
2607
  } catch (n) {
2633
- if (n instanceof j)
2608
+ if (n instanceof P)
2634
2609
  return { valid: !1, issues: n.issues };
2635
2610
  throw n;
2636
2611
  }
2637
2612
  }
2638
- function Ir(e) {
2613
+ function hr(e) {
2639
2614
  try {
2640
- return { valid: !0, value: De(e), issues: [] };
2615
+ return { valid: !0, value: Ae(e), issues: [] };
2641
2616
  } catch (n) {
2642
- if (n instanceof j)
2617
+ if (n instanceof P)
2643
2618
  return { valid: !1, issues: n.issues };
2644
2619
  throw n;
2645
2620
  }
2646
2621
  }
2647
- function vr(e) {
2648
- return typeof e == "string" && Ee.has(e);
2622
+ function yr(e) {
2623
+ return typeof e == "string" && Ie.has(e);
2649
2624
  }
2650
- function _e(e) {
2651
- return typeof e == "string" && Ht.has(e);
2625
+ function we(e) {
2626
+ return typeof e == "string" && zt.has(e);
2652
2627
  }
2653
2628
  export {
2654
- Q as $,
2629
+ X as $,
2655
2630
  f as A,
2656
- Z as B,
2657
- x as C,
2658
- or as D,
2659
- qt as E,
2660
- Kt as F,
2661
- ur as G,
2662
- ve as H,
2663
- j as I,
2664
- hn as J,
2665
- pr as K,
2666
- De as L,
2667
- H as M,
2668
- hr as N,
2669
- re as O,
2670
- yr as P,
2671
- gr as Q,
2672
- br as R,
2673
- Ir as S,
2674
- vr as T,
2675
- _e as U,
2676
- Qn as V,
2677
- ht as W,
2678
- ft as X,
2679
- Zn as Y,
2680
- mt as Z,
2681
- pt as _,
2682
- mr as a,
2683
- Mt as a0,
2684
- Ut as a1,
2685
- Vt as a2,
2686
- ut as b,
2687
- Jn as c,
2688
- ir as d,
2689
- er as e,
2690
- rr as f,
2691
- fr as g,
2692
- Xn as h,
2693
- Yn as i,
2694
- Ct as j,
2695
- ar as k,
2696
- N as l,
2697
- cr as m,
2698
- Rt as n,
2699
- lr as o,
2700
- be as p,
2701
- ye as q,
2702
- zt as r,
2703
- dr as s,
2704
- sr as t,
2705
- yt as u,
2706
- me as v,
2707
- nr as w,
2708
- tr as x,
2709
- jt as y,
2710
- Y as z
2631
+ H as B,
2632
+ $ as C,
2633
+ er as D,
2634
+ Pt as E,
2635
+ Vt as F,
2636
+ dr as G,
2637
+ be as H,
2638
+ P as I,
2639
+ mn as J,
2640
+ sr as K,
2641
+ Ae as L,
2642
+ z as M,
2643
+ mr as N,
2644
+ Q as O,
2645
+ fr as P,
2646
+ ur as Q,
2647
+ pr as R,
2648
+ hr as S,
2649
+ yr as T,
2650
+ we as U,
2651
+ Xn as V,
2652
+ mt as W,
2653
+ lt as X,
2654
+ Hn as Y,
2655
+ ct as Z,
2656
+ st as _,
2657
+ cr as a,
2658
+ Ft as a0,
2659
+ Rt as a1,
2660
+ Lt as a2,
2661
+ dt as b,
2662
+ Wn as c,
2663
+ nr as d,
2664
+ Zn as e,
2665
+ Qn as f,
2666
+ lr as g,
2667
+ Kn as h,
2668
+ Gn as i,
2669
+ vt as j,
2670
+ tr as k,
2671
+ O as l,
2672
+ rr as m,
2673
+ Dt as n,
2674
+ or as o,
2675
+ ye as p,
2676
+ pe as q,
2677
+ Mt as r,
2678
+ ar as s,
2679
+ ir as t,
2680
+ ft as u,
2681
+ de as v,
2682
+ Jn as w,
2683
+ Yn as x,
2684
+ Ut as y,
2685
+ G as z
2711
2686
  };