react-semaphor 0.1.544 → 0.1.545

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 (88) hide show
  1. package/dist/analytics-protocol/index.js +35 -34
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +2 -2
  4. package/dist/briefings/index.js +50 -47
  5. package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
  6. package/dist/chunks/{apply-dashboard-operations-Bz4n1Lq6.js → apply-dashboard-operations-CZEMsx8E.js} +778 -958
  7. package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-D7sWTypJ.js} +308 -309
  8. package/dist/chunks/calendar-day-equality-dvoQp1xW.js +410 -0
  9. package/dist/chunks/{comparison-window-caption-BTkrN3W4.js → comparison-window-caption-D4E6IHPD.js} +56 -55
  10. package/dist/chunks/{custom-visual-inputs-DUtpYZOk.js → custom-visual-inputs-DLCD9Y5V.js} +8 -2
  11. package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-B1tMju0u.js} +1 -1
  12. package/dist/chunks/{dashboard-briefing-launcher-DQ_8O_e2.js → dashboard-briefing-launcher-CePgIu0Z.js} +771 -776
  13. package/dist/chunks/{dashboard-controls-8RyBTQUO.js → dashboard-controls-Cq05n3e0.js} +28 -28
  14. package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-CoYRPqxx.js} +3 -3
  15. package/dist/chunks/document-dashboard-inputs-BesAHZvB.js +3112 -0
  16. package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-JPtNfJRb.js} +5624 -5615
  17. package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-ff7osJr7.js} +1 -1
  18. package/dist/chunks/{index-DkAyQvC6.js → index-DRWiuqyd.js} +378 -333
  19. package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DnCyRXJE.js} +13 -13
  20. package/dist/chunks/{numeric-presentation-DESvLiu9.js → numeric-presentation-7X_IrD58.js} +2571 -2572
  21. package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-C3mUgnEx.js} +1 -1
  22. package/dist/chunks/{zoned-wall-clock-MulfA26h.js → relative-date-label-Bk2j94pA.js} +21 -64
  23. package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
  24. package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-DUtuUL_5.js} +631 -603
  25. package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +9415 -0
  26. package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-LrF_kW0l.js} +183 -211
  27. package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
  28. package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-BxF96Yhv.js} +45764 -46519
  29. package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-CNaM_Gmh.js} +885 -866
  30. package/dist/chunks/{switch-C3jLxlG0.js → switch-uDtPgQlQ.js} +44 -45
  31. package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-YzMioA7Y.js} +1 -1
  32. package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-CjB7ig1o.js} +105 -105
  33. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
  34. package/dist/dashboard/index.js +1 -1
  35. package/dist/dashboard-authoring/index.js +556 -544
  36. package/dist/data-app-sdk/index.js +1 -1
  37. package/dist/format-utils/index.js +163 -152
  38. package/dist/index.js +351 -323
  39. package/dist/style.css +1 -1
  40. package/dist/surfboard/index.js +1 -1
  41. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  42. package/dist/types/briefings/attachments.d.ts +33 -6
  43. package/dist/types/briefings/index.d.ts +6 -5
  44. package/dist/types/components/surfboard/filter/types.d.ts +0 -14
  45. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
  46. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
  47. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +35 -1
  48. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +199 -0
  49. package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
  50. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
  51. package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
  52. package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
  53. package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
  54. package/dist/types/lib/download-pdf.d.ts +75 -1
  55. package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
  56. package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
  57. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
  58. package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
  59. package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
  60. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
  61. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
  62. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
  63. package/dist/types/lib/stores/dashboard-store.d.ts +39 -55
  64. package/dist/types/lib/stores/editor-store.d.ts +0 -3
  65. package/dist/types/lib/types/common-types.d.ts +21 -6
  66. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -11
  67. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +12 -12
  68. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
  69. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +92 -0
  70. package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
  71. package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
  72. package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
  73. package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
  74. package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
  75. package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
  76. package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
  77. package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
  78. package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
  79. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
  80. package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
  81. package/package.json +2 -2
  82. package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
  83. package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
  84. package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
  85. package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
  86. package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
  87. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
  88. package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
@@ -0,0 +1,410 @@
1
+ import { r as B } from "./metric-comparison-DEwi9uc2.js";
2
+ import { l as F } from "./validators-DMHTpf7a.js";
3
+ import { a as W, w as y, z as S } from "./zoned-wall-clock-BkxV9jS2.js";
4
+ function j(t, e) {
5
+ return B({ ...t, role: e });
6
+ }
7
+ function it(t, e) {
8
+ if (e.id) {
9
+ const n = [];
10
+ t.forEach(
11
+ ({ fields: s }, o) => s.forEach((r, a) => {
12
+ r.id === e.id && n.push({ group: o, index: a });
13
+ })
14
+ );
15
+ const i = e.alias ? n.find(
16
+ ({ group: s, index: o }) => j(t[s].fields[o], t[s].role) === e.alias
17
+ ) : void 0;
18
+ if (i) return i;
19
+ if (n.length === 1) return n[0];
20
+ }
21
+ for (let n = 0; n < t.length; n += 1) {
22
+ const i = t[n].fields.findIndex(
23
+ (s) => s.name === e.name && s.entityName === e.entityName && (s.alias === e.alias || !e.alias)
24
+ );
25
+ if (i !== -1) return { group: n, index: i };
26
+ }
27
+ }
28
+ function w(t, e) {
29
+ const n = t.split(".").map((a) => a.trim()), i = e.split(".").map((a) => a.trim());
30
+ if (n.length === 0 || i.length === 0 || n.some((a) => !a) || i.some((a) => !a))
31
+ return !1;
32
+ const [s, o] = n.length <= i.length ? [n, i] : [i, n], r = o.length - s.length;
33
+ return s.every((a, c) => a === o[c + r]);
34
+ }
35
+ function P(t, e) {
36
+ const n = t.split("."), i = e.split("."), s = n.pop(), o = i.pop();
37
+ return !!(s && s === o && n.length > 0 && i.length > 0 && w(
38
+ n.join("."),
39
+ i.join(".")
40
+ ));
41
+ }
42
+ function R(t) {
43
+ const e = t.map((i) => i.trim()).filter(Boolean);
44
+ if (e.every(
45
+ (i, s) => e.slice(s + 1).every(
46
+ (o) => w(i, o)
47
+ )
48
+ ))
49
+ return [...e].sort(
50
+ (i, s) => s.split(".").length - i.split(".").length
51
+ )[0];
52
+ }
53
+ function m(t) {
54
+ return typeof t == "object" && t !== null && !Array.isArray(t);
55
+ }
56
+ function M(t) {
57
+ if (typeof t != "string") return "";
58
+ const e = t.split(".").map((n) => n.trim());
59
+ return e.length > 1 && e.every(Boolean) ? e.join(".") : "";
60
+ }
61
+ function _(t) {
62
+ if (typeof t != "string") return "";
63
+ const e = t.split(".").map((n) => n.trim());
64
+ return e.length > 0 && e.every(Boolean) ? e.join(".") : "";
65
+ }
66
+ function d(t) {
67
+ return typeof t == "string" ? t.trim() : "";
68
+ }
69
+ function L(t, e) {
70
+ return t.every(
71
+ (n, i) => t.slice(i + 1).every((s) => e(n, s))
72
+ );
73
+ }
74
+ function O(t, e) {
75
+ const n = d(t.id), i = d(t.name), s = d(e.entityId), o = d(e.entityName);
76
+ return !i || !s && !o ? !1 : (!s || s === n || s === i) && (!o || o === i);
77
+ }
78
+ function Q(t) {
79
+ const e = m(t.semanticContext) ? t.semanticContext : void 0, n = m(t.fieldMeta) ? t.fieldMeta : void 0, i = d(e == null ? void 0 : e.semanticDomainId), s = Array.isArray(e == null ? void 0 : e.selectedEntities) ? e.selectedEntities.filter(
80
+ (I) => m(I) && I.type === "dataset"
81
+ ) : [];
82
+ if (!!!(i || s.length > 0 || (n == null ? void 0 : n.entityType) === "dataset")) return;
83
+ if (!i)
84
+ return { status: "unresolved", reason: "incomplete_source_identity" };
85
+ const r = d(n == null ? void 0 : n.entityId), a = d(n == null ? void 0 : n.entityName), c = !!(r || a), l = c ? s.filter(
86
+ (I) => O(I, {
87
+ entityId: r,
88
+ entityName: a
89
+ })
90
+ ) : s;
91
+ if (l.length > 1)
92
+ return { status: "unresolved", reason: "incomplete_source_identity" };
93
+ if (c && s.length > 0 && l.length === 0)
94
+ return { status: "unresolved", reason: "divergent_source_identity" };
95
+ const u = l[0], f = d(u == null ? void 0 : u.domainId), D = d(u == null ? void 0 : u.id), p = d(u == null ? void 0 : u.name);
96
+ if (f && f !== i)
97
+ return { status: "unresolved", reason: "divergent_source_identity" };
98
+ const q = D, A = p || a;
99
+ return A ? {
100
+ status: "resolved",
101
+ source: {
102
+ kind: "semantic",
103
+ domainId: i,
104
+ datasetName: A,
105
+ ...q ? { datasetId: q } : {}
106
+ }
107
+ } : { status: "unresolved", reason: "incomplete_source_identity" };
108
+ }
109
+ function Y(t, e) {
110
+ const n = d(t.connectionId), i = m(t.semanticContext) ? t.semanticContext : void 0, s = d(i == null ? void 0 : i.connectionId);
111
+ if (n && s && n !== s)
112
+ return { status: "unresolved", reason: "divergent_source_identity" };
113
+ const o = n || s, r = m(t.fieldMeta) ? t.fieldMeta : void 0, a = e.split(".").slice(0, -1).join("."), c = _(t.qualifiedTableName), l = _(
114
+ r == null ? void 0 : r.qualifiedEntityName
115
+ ), u = [
116
+ c,
117
+ l,
118
+ a
119
+ ].filter(Boolean), f = R(u);
120
+ return !f && u.length > 0 ? { status: "unresolved", reason: "divergent_source_identity" } : !o || !f ? { status: "unresolved", reason: "incomplete_source_identity" } : {
121
+ status: "resolved",
122
+ source: { kind: "physical", connectionId: o, tableName: f }
123
+ };
124
+ }
125
+ function H(t, e) {
126
+ const n = m(t.fieldMeta) ? t.fieldMeta : void 0, i = typeof (n == null ? void 0 : n.qualifiedFieldName) == "string" ? n.qualifiedFieldName.trim() : "", s = M(
127
+ n == null ? void 0 : n.qualifiedFieldName
128
+ ), o = typeof t.column == "string" ? t.column.trim() : "", r = M(o), a = typeof t.qualifiedTableName == "string" ? t.qualifiedTableName.trim() : "", c = _(
129
+ t.qualifiedTableName
130
+ );
131
+ if (i && !s || e && a && !c || o.includes(".") && !r)
132
+ return { status: "unresolved", reason: "incomplete_field_identity" };
133
+ const l = r.split("."), u = r ? l[l.length - 1] : o, f = e && c && u ? `${c}.${u}` : "", D = [
134
+ s,
135
+ r,
136
+ f
137
+ ].filter(Boolean);
138
+ if (!L(
139
+ D,
140
+ P
141
+ ))
142
+ return { status: "unresolved", reason: "divergent_field_identity" };
143
+ const p = r || s || f;
144
+ return p ? { status: "resolved", qualifiedFieldName: p } : { status: "unresolved", reason: "incomplete_field_identity" };
145
+ }
146
+ function G(t) {
147
+ if (!m(t))
148
+ return { status: "ineligible", reason: "invalid_input" };
149
+ if (t.kind === "global-date")
150
+ return { status: "eligible", kind: "global_date" };
151
+ const e = F(t.dataType);
152
+ if (e !== "date" && e !== "datetime")
153
+ return { status: "ineligible", reason: "non_date_filter" };
154
+ const n = m(t.fieldMeta) ? t.fieldMeta : void 0, i = F(
155
+ n == null ? void 0 : n.dataType
156
+ );
157
+ if ((n == null ? void 0 : n.dataType) !== void 0 && i !== "date" && i !== "datetime")
158
+ return { status: "ineligible", reason: "non_date_filter" };
159
+ if (t.customFilterPreferences)
160
+ return { status: "ineligible", reason: "custom_filter" };
161
+ if (t.targetColumns !== void 0 && (!Array.isArray(t.targetColumns) || t.targetColumns.length > 0))
162
+ return { status: "ineligible", reason: "multi_target_filter" };
163
+ const s = Q(t), o = H(t, s === void 0);
164
+ if (o.status === "unresolved")
165
+ return { status: "ineligible", reason: o.reason };
166
+ const r = s || Y(t, o.qualifiedFieldName);
167
+ return r.status === "resolved" ? {
168
+ status: "eligible",
169
+ kind: "field_date",
170
+ qualifiedFieldName: o.qualifiedFieldName,
171
+ source: r.source
172
+ } : { status: "ineligible", reason: r.reason };
173
+ }
174
+ function J(t) {
175
+ if (!m(t) || t.kind !== "filter" || !m(t.filter))
176
+ return { status: "ineligible", reason: "invalid_input" };
177
+ const e = G(
178
+ t.filter
179
+ );
180
+ return e.status === "ineligible" ? e : e.kind === "field_date" && m(t.compatibility) && t.compatibility.source === "cardInlineFilter" ? { status: "ineligible", reason: "card_inline_filter" } : e;
181
+ }
182
+ function st(t) {
183
+ return J(t).status === "eligible";
184
+ }
185
+ function ot(t) {
186
+ return `compat-filter:${t}`;
187
+ }
188
+ function rt(t) {
189
+ return `compat-control:${t}`;
190
+ }
191
+ function at(t, e) {
192
+ return `compat-inline-filter:${t}:${e}`;
193
+ }
194
+ function ut(t, e) {
195
+ return `compat-card-control:${t}:${e}`;
196
+ }
197
+ const T = 864e5, E = {
198
+ second: 1e3,
199
+ minute: 6e4,
200
+ hour: 36e5
201
+ };
202
+ function N(t, e) {
203
+ return {
204
+ ...S(t, e),
205
+ millisecond: (t.getTime() % 1e3 + 1e3) % 1e3
206
+ };
207
+ }
208
+ function g(t, e) {
209
+ return W(t, e);
210
+ }
211
+ function v(t) {
212
+ const e = new Date(t);
213
+ return {
214
+ year: e.getUTCFullYear(),
215
+ month: e.getUTCMonth() + 1,
216
+ day: e.getUTCDate(),
217
+ hour: e.getUTCHours(),
218
+ minute: e.getUTCMinutes(),
219
+ second: e.getUTCSeconds(),
220
+ millisecond: e.getUTCMilliseconds()
221
+ };
222
+ }
223
+ function U(t, e) {
224
+ const n = /* @__PURE__ */ new Date(0);
225
+ return n.setUTCFullYear(t, e, 0), n.getUTCDate();
226
+ }
227
+ function C(t, e) {
228
+ const n = t.year * 12 + (t.month - 1) + e, i = Math.floor(n / 12), s = n - i * 12 + 1;
229
+ return { ...t, year: i, month: s, day: Math.min(t.day, U(i, s)) };
230
+ }
231
+ function h(t, e, n) {
232
+ if (e === 0) return t;
233
+ switch (n) {
234
+ case "second":
235
+ case "minute":
236
+ case "hour":
237
+ return v(
238
+ y(t) + e * E[n]
239
+ );
240
+ case "day":
241
+ return v(y(t) + e * T);
242
+ case "week":
243
+ return v(y(t) + e * 7 * T);
244
+ case "month":
245
+ return C(t, e);
246
+ case "quarter":
247
+ return C(t, e * 3);
248
+ case "year":
249
+ return C(t, e * 12);
250
+ }
251
+ }
252
+ function K(t) {
253
+ return new Date(
254
+ y({ ...t, hour: 0, minute: 0, second: 0 })
255
+ ).getUTCDay();
256
+ }
257
+ function k(t) {
258
+ var n;
259
+ const e = (n = t.fiscalCalendar) == null ? void 0 : n.yearStartMonth;
260
+ return e && e >= 1 && e <= 12 ? e : 1;
261
+ }
262
+ function V(t, e, n) {
263
+ const i = { ...t, hour: 0, minute: 0, second: 0, millisecond: 0 };
264
+ switch (e) {
265
+ case "day":
266
+ return i;
267
+ case "week":
268
+ return h(
269
+ i,
270
+ -((K(t) - n.weekStart + 7) % 7),
271
+ "day"
272
+ );
273
+ case "month":
274
+ return { ...i, day: 1 };
275
+ case "quarter": {
276
+ const s = (t.month - k(n) + 12) % 12;
277
+ return C({ ...i, day: 1 }, -(s % 3));
278
+ }
279
+ case "year": {
280
+ const s = k(n);
281
+ return {
282
+ ...i,
283
+ year: t.month >= s ? t.year : t.year - 1,
284
+ month: s,
285
+ day: 1
286
+ };
287
+ }
288
+ }
289
+ }
290
+ function b(t, e, n, i = 0) {
291
+ const s = E[e];
292
+ if (s !== void 0) {
293
+ const a = N(t, n.tz), c = a.millisecond + (e === "second" ? 0 : a.second * 1e3) + (e === "hour" ? a.minute * 6e4 : 0), l = t.getTime() - c + i * s;
294
+ return { start: new Date(l), endExclusive: new Date(l + s) };
295
+ }
296
+ const o = e, r = h(
297
+ V(N(t, n.tz), o, n),
298
+ i,
299
+ e
300
+ );
301
+ return {
302
+ start: g(r, n.tz),
303
+ endExclusive: g(h(r, 1, e), n.tz)
304
+ };
305
+ }
306
+ function x(t, e, n) {
307
+ return b(t, e, n).start;
308
+ }
309
+ function z(t, e, n) {
310
+ return new Date(b(t, e, n).endExclusive.getTime() - 1);
311
+ }
312
+ function X(t, e, n, i) {
313
+ return e === 0 ? t : g(
314
+ h(N(t, i.tz), e, n),
315
+ i.tz
316
+ );
317
+ }
318
+ function ct(t, e, n) {
319
+ const i = (s) => {
320
+ const { year: o, month: r, day: a } = S(s, n);
321
+ return y({ year: o, month: r, day: a, hour: 0, minute: 0, second: 0 });
322
+ };
323
+ return Math.round((i(e) - i(t)) / T);
324
+ }
325
+ const Z = /^(\d{4})-(\d{2})-(\d{2})$/;
326
+ function dt(t, e) {
327
+ const { year: n, month: i, day: s } = S(t, e);
328
+ return `${String(n).padStart(4, "0")}-${String(i).padStart(2, "0")}-${String(s).padStart(2, "0")}`;
329
+ }
330
+ function $(t) {
331
+ const e = Z.exec(t);
332
+ if (!e) return null;
333
+ const n = Number(e[1]), i = Number(e[2]), s = Number(e[3]);
334
+ return i < 1 || i > 12 || s < 1 || s > U(n, i) ? null : { year: n, month: i, day: s };
335
+ }
336
+ function lt(t, e) {
337
+ const n = $(t);
338
+ if (!n) return null;
339
+ const i = { ...n, hour: 0, minute: 0, second: 0, millisecond: 0 };
340
+ return {
341
+ start: g(i, e),
342
+ endExclusive: g(h(i, 1, "day"), e)
343
+ };
344
+ }
345
+ function mt(t, e, n) {
346
+ const i = (o) => new Date(b(n, t.unit, e, o).endExclusive.getTime() - 1), s = (o) => b(n, t.unit, e, o).start;
347
+ switch (t.mode) {
348
+ case "last":
349
+ return t.unit === "minute" || t.unit === "hour" ? {
350
+ start: new Date(
351
+ n.getTime() - t.n * E[t.unit]
352
+ ),
353
+ end: n
354
+ } : t.complete ? { start: s(-t.n), end: i(-1) } : { start: X(n, -t.n, t.unit, e), end: n };
355
+ case "this": {
356
+ if (t.boundary && t.unit === "month") {
357
+ const o = t.boundary === "first_day" ? x(n, "month", e) : z(n, "month", e);
358
+ return {
359
+ start: x(o, "day", e),
360
+ end: z(o, "day", e)
361
+ };
362
+ }
363
+ return { start: s(0), end: t.toDate ? n : i(0) };
364
+ }
365
+ case "previous":
366
+ return { start: s(-1), end: i(-1) };
367
+ case "between":
368
+ return { start: s(t.from), end: i(t.to) };
369
+ }
370
+ }
371
+ function ft(t) {
372
+ const { operation: e, values: n, temporalPrecision: i } = t;
373
+ if (e !== "=" && e !== "!=" || i === "minute")
374
+ return null;
375
+ const s = Array.isArray(n) ? n : [n];
376
+ if (s.length !== 1 || typeof s[0] != "string") return null;
377
+ const o = s[0].trim();
378
+ return $(o) ? { operation: e, day: o } : null;
379
+ }
380
+ export {
381
+ P as A,
382
+ w as B,
383
+ E,
384
+ j as a,
385
+ O as b,
386
+ J as c,
387
+ rt as d,
388
+ at as e,
389
+ it as f,
390
+ ot as g,
391
+ ut as h,
392
+ st as i,
393
+ g as j,
394
+ U as k,
395
+ h as l,
396
+ K as m,
397
+ x as n,
398
+ z as o,
399
+ b as p,
400
+ ct as q,
401
+ G as r,
402
+ X as s,
403
+ dt as t,
404
+ $ as u,
405
+ lt as v,
406
+ N as w,
407
+ mt as x,
408
+ ft as y,
409
+ R as z
410
+ };
@@ -2,7 +2,7 @@ var Qe = Object.defineProperty;
2
2
  var et = (e, t, r) => t in e ? Qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var fe = (e, t, r) => et(e, typeof t != "symbol" ? t + "" : t, r);
4
4
  import { i as tt, j as V, m as rt, Q as ne, f as Ie, F as $e, P as ot, r as nt, M as at, v as st, c as it, p as lt, J as ct, a as j, G as ut, I as mt } from "./temporal-bucket-D7NBrrtL.js";
5
- import { i as _e, m as te, j as De, k as dt, l as Re, a as ge, d as ft, n as $ } from "./matrix-formatter-CxJLkztA.js";
5
+ import { i as _e, m as te, j as De, k as dt, l as Re, a as ge, d as ft, n as $ } from "./matrix-formatter-DnCyRXJE.js";
6
6
  import { h as Z, e as gt, p as pt, k as yt } from "./export-file-format-C-tJsxsf.js";
7
7
  import { aC as U, l as ht, w as X, aB as bt, y as ae, x as wt } from "./validators-DMHTpf7a.js";
8
8
  import "./matrix-operation-contract-8OIO4gob.js";
@@ -11,10 +11,11 @@ import "zod";
11
11
  import { A as Pe, a as vt, t as pe, s as Tt, P as ye, l as Ct, o as xt, v as St, G as O } from "./pivot-result-lifecycle-DM4CyGKs.js";
12
12
  import { PDF_SAFETY_LIMIT_EXCEEDED as Ne, getUtf8ByteLength as Et, FAST_PDF_POLICY as kt } from "../pdf-export-policy/index.js";
13
13
  import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as At } from "../value-format-preferences/index.js";
14
- import { z as Lt, g as Ft } from "./zoned-wall-clock-MulfA26h.js";
15
- import { p as Mt } from "./pivot-header-presentation-DHcx1XGQ.js";
16
- import { d as It, c as he } from "./pivot-result-identity-DJhXXcns.js";
17
- import { v as $t } from "./raw-temporal-contract-C51YG48G.js";
14
+ import { z as Lt } from "./zoned-wall-clock-BkxV9jS2.js";
15
+ import { p as Ft } from "./pivot-header-presentation-DHcx1XGQ.js";
16
+ import { d as Mt, c as he } from "./pivot-result-identity-DJhXXcns.js";
17
+ import { v as It } from "./raw-temporal-contract-C51YG48G.js";
18
+ import { g as $t } from "./relative-date-label-Bk2j94pA.js";
18
19
  function _t(e, t, r) {
19
20
  const o = {
20
21
  ...t,
@@ -73,7 +74,7 @@ function we(e, t) {
73
74
  throw new RangeError("Comparison precision must be an integer from 0 to 6.");
74
75
  return e;
75
76
  }
76
- function mo(e, t) {
77
+ function fo(e, t) {
77
78
  const r = {
78
79
  mode: t.displayMode,
79
80
  current: q(
@@ -220,21 +221,21 @@ function P(e) {
220
221
  return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : Ce(t, r, !1) ?? n;
221
222
  }
222
223
  }
223
- function fo(e) {
224
+ function go(e) {
224
225
  return e.kind === "empty" ? "" : e.text;
225
226
  }
226
- const Ve = 1e4, Xt = 1e6, go = 5e6, po = 1024 ** 3, yo = 1024 ** 3;
227
- function ho(e) {
227
+ const Ve = 1e4, Xt = 1e6, po = 5e6, yo = 1024 ** 3, ho = 1024 ** 3;
228
+ function bo(e) {
228
229
  return e > Ve;
229
230
  }
230
- function bo(e) {
231
+ function wo(e) {
231
232
  return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= Ve ? "direct" : e.loadedRowCount <= Xt ? "background" : "blocked";
232
233
  }
233
- const wo = {
234
+ const vo = {
234
235
  rowLabels: "tabular",
235
236
  subtotals: "after"
236
237
  };
237
- function vo(e, t) {
238
+ function To(e, t) {
238
239
  const r = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, o = e.totals.rows;
239
240
  return {
240
241
  ...e,
@@ -386,10 +387,10 @@ function tr(e, t, r) {
386
387
  csvRows: (d, s) => d.map((f, b) => v(f, b ? d[b - 1] : s ?? void 0))
387
388
  };
388
389
  }
389
- function To(e) {
390
+ function Co(e) {
390
391
  return e.columns.map((t) => Z(t.label));
391
392
  }
392
- function Co(e, t, r) {
393
+ function xo(e, t, r) {
393
394
  return rr(e, t, r).map((o, n) => {
394
395
  const i = t.columns[n];
395
396
  return i.kind === "measure" ? Ue(o, e.values[n], r.measureSemantics.get(i.measureId)) : Z(o);
@@ -487,7 +488,7 @@ function nr(e, t, r) {
487
488
  groupLevelLabel: m ? Pe(m, t.presentation) : "Measures"
488
489
  };
489
490
  }
490
- function xo(e) {
491
+ function So(e) {
491
492
  const { layout: t, rows: r, report: o } = e, n = {
492
493
  ...e.request,
493
494
  presentation: Zt(t, r, e.request.presentation)
@@ -535,7 +536,7 @@ async function sr(e) {
535
536
  return { message: t };
536
537
  }
537
538
  }
538
- async function So(e) {
539
+ async function Eo(e) {
539
540
  if (!e.token) throw new Error("Missing auth token for PDF export");
540
541
  if (Et(e.serializedPayload) > kt.maxRequestBytes)
541
542
  throw new Error("Fast-path PDF request exceeds the structured body limit");
@@ -556,7 +557,7 @@ async function So(e) {
556
557
  return r;
557
558
  }
558
559
  const ir = /* @__PURE__ */ new Set(["short", "medium", "long"]), lr = /^(\d{4})-(\d{2})-(\d{2})$/, cr = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, ur = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, se = " – ";
559
- function Eo(e) {
560
+ function ko(e) {
560
561
  if (!ot(e)) return;
561
562
  const t = Object.keys(e);
562
563
  if (e.mode === "period_label" && t.length === 1)
@@ -577,7 +578,7 @@ function mr(e) {
577
578
  return t instanceof Error ? t.message : "The pattern is invalid.";
578
579
  }
579
580
  }
580
- function ko(e) {
581
+ function Ao(e) {
581
582
  const { value: t, part: r, presentation: o, preferences: n, calendar: i } = e;
582
583
  if ((o == null ? void 0 : o.mode) === "period_label" && t.periodLabel && r === "range")
583
584
  return { ok: !0, text: t.periodLabel };
@@ -788,7 +789,7 @@ function Sr(e) {
788
789
  function Er(e, t) {
789
790
  return t || `Grand ${Ge(e)}`;
790
791
  }
791
- function Ao(e) {
792
+ function Lo(e) {
792
793
  const t = e.context.groupColumnKeys.indexOf(e.columnKey);
793
794
  if (t < 0)
794
795
  throw new Error(
@@ -875,7 +876,7 @@ function He(e) {
875
876
  })
876
877
  };
877
878
  }
878
- function Lo(e) {
879
+ function Fo(e) {
879
880
  const t = He(e).cells.find(
880
881
  (r) => r.columnKey === e.columnKey
881
882
  );
@@ -931,7 +932,7 @@ function We(e) {
931
932
  const t = e == null ? void 0 : e.sql, r = e == null ? void 0 : e.python;
932
933
  return (e == null ? void 0 : e.resultOwner) === "freeform" && typeof t == "string" && !!t.trim() && (typeof r != "string" || !r.trim());
933
934
  }
934
- function Fo(e) {
935
+ function Mo(e) {
935
936
  return e.formatting.useFormattedValues !== !1 && We(e.queryPayload) && Xe(e.formatting).size > 0;
936
937
  }
937
938
  function Ir(e, t) {
@@ -963,7 +964,7 @@ function $r(e) {
963
964
  const u = n.get(l);
964
965
  let g;
965
966
  if (u != null && u.rawTemporal)
966
- g = $t(u, {
967
+ g = It(u, {
967
968
  metadataRequired: !0
968
969
  }), r.add(l);
969
970
  else if (i) {
@@ -1051,7 +1052,7 @@ function Vr(e) {
1051
1052
  function Ur(e) {
1052
1053
  return e.calendar.fiscalCalendar && (e.granularity === "quarter" || e.granularity === "year") ? "fiscal" : e.granularity;
1053
1054
  }
1054
- function Mo(e) {
1055
+ function Io(e) {
1055
1056
  const { formatting: t, queryPayload: r } = e, o = t.useFormattedValues, n = t.scope, i = (s) => vt({ snapshot: t.presentationExecutionSnapshot, scope: n, target: { kind: "column", columnKey: s } }), a = (s) => Tt({ snapshot: t.presentationExecutionSnapshot, scope: n, target: { kind: "column", columnKey: s } });
1056
1057
  function l(s) {
1057
1058
  var b;
@@ -1066,7 +1067,7 @@ function Mo(e) {
1066
1067
  const b = s == null ? void 0 : s.pivotIdentity;
1067
1068
  if (!b || !b.members || b.members.length === 0) return;
1068
1069
  const y = he({ identity: b, columnKey: (s == null ? void 0 : s.key) || (s == null ? void 0 : s.field) || "" });
1069
- return Mt({
1070
+ return Ft({
1070
1071
  members: y,
1071
1072
  metricLabel: (s == null ? void 0 : s.label) || (s == null ? void 0 : s.headerName),
1072
1073
  mode: o ? "formatted" : "canonical",
@@ -1096,7 +1097,7 @@ function Mo(e) {
1096
1097
  const c = S == null ? void 0 : S.pivotByColumns, h = Array.isArray(c) ? c.flatMap(
1097
1098
  (T) => Y(T) && typeof T.id == "string" && T.id ? [T.id] : []
1098
1099
  ) : [];
1099
- It(
1100
+ Mt(
1100
1101
  y.map((T) => ({ key: N(T) || "<unknown>", pivotIdentity: T.pivotIdentity })),
1101
1102
  {
1102
1103
  expectedPivotFieldIds: h,
@@ -1279,7 +1280,7 @@ function Le(e, t) {
1279
1280
  return e;
1280
1281
  }
1281
1282
  }
1282
- function Io(e) {
1283
+ function $o(e) {
1283
1284
  if (!ie(e))
1284
1285
  throw new Error("formatting must be an object");
1285
1286
  const t = ["reportContext", "resolvedFormats"].find(
@@ -1357,7 +1358,7 @@ function Io(e) {
1357
1358
  ...typeof e.title == "string" ? { title: e.title } : {}
1358
1359
  };
1359
1360
  }
1360
- function $o(e) {
1361
+ function _o(e) {
1361
1362
  const t = e.formatOptions, r = (o) => ie(o) ? o : void 0;
1362
1363
  return {
1363
1364
  scope: { dashboardId: e.dashboardId, cardId: e.cardId },
@@ -1400,7 +1401,7 @@ function jr(e, t) {
1400
1401
  function Me(e, t = {}) {
1401
1402
  const { name: r, operation: o, values: n, valueType: i } = e, a = t.label ?? Ze(r), l = jr(e, t.relativeDates);
1402
1403
  if (l) {
1403
- const u = Ft(l);
1404
+ const u = $t(l);
1404
1405
  if (u)
1405
1406
  return o === "between" ? `${a}: ${u}` : `${a} not in ${u}`;
1406
1407
  }
@@ -1476,7 +1477,7 @@ function Me(e, t = {}) {
1476
1477
  return `${a}: ${ee(n, m)}`;
1477
1478
  }
1478
1479
  }
1479
- function _o(e, t = {}) {
1480
+ function Do(e, t = {}) {
1480
1481
  if (!e || e.length === 0)
1481
1482
  return "";
1482
1483
  const r = /* @__PURE__ */ new Map();
@@ -1495,7 +1496,7 @@ function _o(e, t = {}) {
1495
1496
  }
1496
1497
  }), o.join(" | ");
1497
1498
  }
1498
- function Do(e) {
1499
+ function Ro(e) {
1499
1500
  return ((e == null ? void 0 : e.filterValues) ?? []).filter(Gr).map(Hr);
1500
1501
  }
1501
1502
  function Gr(e) {
@@ -1525,7 +1526,7 @@ function Wr(e, t) {
1525
1526
  return;
1526
1527
  }
1527
1528
  }
1528
- function Ro(e, t, r, o = !1) {
1529
+ function Po(e, t, r, o = !1) {
1529
1530
  const n = Yr(
1530
1531
  e,
1531
1532
  t,
@@ -1570,44 +1571,44 @@ function Yr(e, t, r, o = !1) {
1570
1571
  return { start: e.start, end: `before ${e.end}` };
1571
1572
  }
1572
1573
  export {
1573
- Mo as A,
1574
- Io as B,
1575
- $o as C,
1574
+ Io as A,
1575
+ $o as B,
1576
+ _o as C,
1576
1577
  Ve as D,
1577
- Fo as E,
1578
+ Mo as E,
1578
1579
  Xt as F,
1579
1580
  Fe as G,
1580
1581
  zr as H,
1581
1582
  Me as I,
1582
- _o as J,
1583
- Do as K,
1583
+ Do as J,
1584
+ Ro as K,
1584
1585
  Cr as L,
1585
- go as M,
1586
+ po as M,
1586
1587
  oe as N,
1587
1588
  xr as O,
1588
1589
  Qt as P,
1589
1590
  Sr as Q,
1590
1591
  Er as R,
1591
- Ao as S,
1592
+ Lo as S,
1592
1593
  He as T,
1593
- Lo as U,
1594
+ Fo as U,
1594
1595
  kr as V,
1595
1596
  er as W,
1596
1597
  Yr as X,
1597
- mo as a,
1598
- po as b,
1599
- yo as c,
1600
- ho as d,
1601
- fo as e,
1602
- Ro as f,
1603
- bo as g,
1604
- To as h,
1605
- Co as i,
1598
+ fo as a,
1599
+ yo as b,
1600
+ ho as c,
1601
+ bo as d,
1602
+ go as e,
1603
+ Po as f,
1604
+ wo as g,
1605
+ Co as h,
1606
+ xo as i,
1606
1607
  or as j,
1607
- xo as k,
1608
- wo as l,
1608
+ So as k,
1609
+ vo as l,
1609
1610
  rr as m,
1610
- vo as n,
1611
+ To as n,
1611
1612
  Wt as o,
1612
1613
  tr as p,
1613
1614
  Zt as q,
@@ -1616,8 +1617,8 @@ export {
1616
1617
  P as t,
1617
1618
  ar as u,
1618
1619
  sr as v,
1619
- So as w,
1620
- Eo as x,
1620
+ Eo as w,
1621
+ ko as x,
1621
1622
  mr as y,
1622
- ko as z
1623
+ Ao as z
1623
1624
  };