react-semaphor 0.1.565 → 0.1.566

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