react-semaphor 0.1.602 → 0.1.603

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 (107) hide show
  1. package/dist/analytics-protocol/index.js +415 -375
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +8 -8
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{add-to-dashboard-ClhEIFst.js → add-to-dashboard-CFF-wFU-.js} +1 -1
  7. package/dist/chunks/{analytics-base-schemas-DevrgqQb.js → analytics-base-schemas-DsUh5Q3C.js} +14 -12
  8. package/dist/chunks/{assistant-chat-BWF3GYip.js → assistant-chat-B6hNQI1t.js} +146 -146
  9. package/dist/chunks/{bookmark-impact-BF3iRx5a.js → bookmark-impact-Ba2PLcGp.js} +3 -3
  10. package/dist/chunks/{bookmark-state-CBSTdW6q.js → bookmark-state-n7AaNzR_.js} +517 -516
  11. package/dist/chunks/{card-filter-builder-B8XHwMY6.js → card-filter-builder-Y22HizVx.js} +104 -104
  12. package/dist/chunks/{comparison-window-caption-W83qB4V5.js → comparison-window-caption-Ck2TIbnR.js} +69 -69
  13. package/dist/chunks/{context-BJoEFgNl.js → context-UCQ7sere.js} +1 -1
  14. package/dist/chunks/{dashboard-DG5EIYYB.js → dashboard-BghI99oY.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-CBSrhyWZ.js → dashboard-briefing-launcher-DtBAnGiH.js} +103 -103
  16. package/dist/chunks/{dashboard-controls-D6ECO4N1.js → dashboard-controls-CtFXlyjV.js} +53 -53
  17. package/dist/chunks/{dashboard-json-DrJftBSL.js → dashboard-json-DfGBUtCd.js} +5 -5
  18. package/dist/chunks/dates-BnrXF4bb.js +185 -0
  19. package/dist/chunks/{edit-dashboard-visual-BDYAJIbb.js → edit-dashboard-visual-oxt3x1wb.js} +7976 -8184
  20. package/dist/chunks/{filter-line-BXT6y303.js → filter-line-Cy5YYqRL.js} +27 -27
  21. package/dist/chunks/{filter-reach-copy-BukhZmzm.js → filter-reach-copy-CE_ZX147.js} +1590 -1729
  22. package/dist/chunks/{filter-value-text-D3-bf3_b.js → filter-value-text-fWvSDwkl.js} +11 -11
  23. package/dist/chunks/{index-BW0yozjs.js → index-D5rxbtS4.js} +24 -24
  24. package/dist/chunks/{layout-grid-Ds0diMeY.js → layout-grid-9LndRoLa.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-CgQgVeeI.js → matrix-analytical-definition-CCp48UCw.js} +496 -425
  26. package/dist/chunks/matrix-member-presentation-zNehruXR.js +391 -0
  27. package/dist/chunks/{matrix-operation-contract--DkNCOzd.js → matrix-operation-contract-DPBj69D8.js} +3 -2
  28. package/dist/chunks/{metric-comparison-zMylnIkc.js → metric-comparison-B0FR-Q8I.js} +184 -125
  29. package/dist/chunks/{paintbrush-CX8pao1j.js → paintbrush-58FQYY-y.js} +1 -1
  30. package/dist/chunks/{palette-CuA0HlzF.js → palette-Be62Tkoa.js} +1 -1
  31. package/dist/chunks/{pivot-result-contract-expectations-C8KL7hPx.js → pivot-result-contract-expectations-BYqAmG9n.js} +1236 -1190
  32. package/dist/chunks/{pivot-result-identity-C1AOH1PS.js → pivot-result-identity-CAP4--iq.js} +1 -1
  33. package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +3778 -0
  34. package/dist/chunks/{report-preferences-dialog-CbuVNDGi.js → report-preferences-dialog-uJp9GBTM.js} +219 -205
  35. package/dist/chunks/{report-runtime-context-E7USjN7E.js → report-runtime-context-c77_KF9v.js} +2 -2
  36. package/dist/chunks/{resolve-dashboard-input-context-CULCE_hM.js → resolve-dashboard-input-context-Rtl1ffmE.js} +7115 -6963
  37. package/dist/chunks/{save-BKHlDONy.js → save-C5A0JnEV.js} +1 -1
  38. package/dist/chunks/{saved-dashboard-context-C1WlOx5z.js → saved-dashboard-context-tcyTU8jm.js} +193 -207
  39. package/dist/chunks/selection-filter-compiler-DNijjI5y.js +150 -0
  40. package/dist/chunks/{semaphor-ready-indicator-CBIRcDWs.js → semaphor-ready-indicator-FBvunj6S.js} +35550 -35273
  41. package/dist/chunks/{shelf-drop-preview-context-xR69SMA8.js → shelf-drop-preview-context-QKStrcK9.js} +6 -6
  42. package/dist/chunks/{stored-dashboard-BuM8vnWf.js → stored-dashboard-CHozcAY9.js} +621 -616
  43. package/dist/chunks/{style-sheet-parts-Bt9ZNre8.js → style-sheet-parts-CDCG-8Ej.js} +258 -251
  44. package/dist/chunks/{table-export-sheet-DVljtHkG.js → table-export-sheet-ZFIvs6Sj.js} +1 -1
  45. package/dist/chunks/{token-types-D_xKgyVS.js → token-types-XbM6QByy.js} +1 -1
  46. package/dist/chunks/{upload-Dll_M7XQ.js → upload-H15d7uHK.js} +1 -1
  47. package/dist/chunks/{validators-ClWHpYql.js → validators-Baf3VIf5.js} +3 -3
  48. package/dist/chunks/{variable-draft-CDGGl53R.js → variable-draft-C2y8Jp6Z.js} +3 -3
  49. package/dist/dashboard/index.js +2 -2
  50. package/dist/dashboard-authoring/index.js +2466 -2343
  51. package/dist/format-utils/index.js +205 -204
  52. package/dist/index.js +20 -20
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +2 -2
  56. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
  57. package/dist/types/index.js +5 -5
  58. package/dist/types/lib/document/document-edits.d.ts +0 -4
  59. package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
  60. package/dist/types/lib/types/common-types.d.ts +0 -2
  61. package/dist/types/lib/types/explorer-types.d.ts +1 -1
  62. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
  63. package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
  64. package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
  65. package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
  66. package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
  67. package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
  68. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
  69. package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
  70. package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
  71. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
  72. package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
  73. package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
  74. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
  75. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  76. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
  77. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
  78. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
  79. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
  80. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  81. package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
  82. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
  83. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
  84. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
  85. package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
  86. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
  87. package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
  88. package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
  89. package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
  90. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
  91. package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
  92. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
  93. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +3 -0
  94. package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
  95. package/dist/types/shared/format-utils/index.d.ts +1 -0
  96. package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
  97. package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
  98. package/dist/types/shared/temporal/index.d.ts +2 -0
  99. package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
  100. package/dist/types/shared/temporal/temporal.d.ts +27 -0
  101. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
  102. package/dist/usage-events/index.js +1 -1
  103. package/package.json +3 -2
  104. package/dist/chunks/dates-Bz-qM5px.js +0 -164
  105. package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
  106. package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
  107. package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
@@ -1,454 +0,0 @@
1
- var O = Object.defineProperty;
2
- var P = (t, e, n) => e in t ? O(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var b = (t, e, n) => P(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { j as U, r as W, aM as E } from "./validators-ClWHpYql.js";
5
- import { R as x } from "./analytics-base-schemas-DevrgqQb.js";
6
- const k = /* @__PURE__ */ new Map();
7
- function y(t, e) {
8
- let n = k.get(e);
9
- n || (n = new Intl.DateTimeFormat("en-CA", {
10
- calendar: "gregory",
11
- numberingSystem: "latn",
12
- timeZone: e,
13
- year: "numeric",
14
- month: "2-digit",
15
- day: "2-digit",
16
- hour: "2-digit",
17
- minute: "2-digit",
18
- second: "2-digit",
19
- hourCycle: "h23"
20
- }), k.set(e, n));
21
- const r = n.formatToParts(t), o = (a) => {
22
- var i;
23
- return Number((i = r.find((u) => u.type === a)) == null ? void 0 : i.value);
24
- };
25
- return {
26
- year: o("year"),
27
- month: o("month"),
28
- day: o("day"),
29
- hour: o("hour"),
30
- minute: o("minute"),
31
- second: o("second")
32
- };
33
- }
34
- function s(t) {
35
- const e = /* @__PURE__ */ new Date(0);
36
- return e.setUTCFullYear(t.year, t.month - 1, t.day), e.setUTCHours(t.hour, t.minute, t.second, t.millisecond ?? 0), e.getTime();
37
- }
38
- function l(t, e) {
39
- const n = t - (t % 1e3 + 1e3) % 1e3;
40
- return s(y(new Date(n), e)) - n;
41
- }
42
- const v = 864e5;
43
- function K(t, e) {
44
- const n = F(t, e);
45
- if (n.length) return n[0];
46
- const r = s(t);
47
- return new Date(r - l(r - v, e));
48
- }
49
- function F(t, e) {
50
- const n = s(t), r = l(n - v, e), o = l(n + v, e);
51
- return [.../* @__PURE__ */ new Set([r, o])].map((a) => n - a).filter((a) => l(a, e) === n - a).sort((a, i) => a - i).map((a) => new Date(a));
52
- }
53
- const D = 864e5, w = {
54
- second: 1e3,
55
- minute: 6e4,
56
- hour: 36e5
57
- };
58
- function g(t, e) {
59
- return {
60
- ...y(t, e),
61
- millisecond: (t.getTime() % 1e3 + 1e3) % 1e3
62
- };
63
- }
64
- function d(t, e) {
65
- return K(t, e);
66
- }
67
- function p(t) {
68
- const e = new Date(t);
69
- return {
70
- year: e.getUTCFullYear(),
71
- month: e.getUTCMonth() + 1,
72
- day: e.getUTCDate(),
73
- hour: e.getUTCHours(),
74
- minute: e.getUTCMinutes(),
75
- second: e.getUTCSeconds(),
76
- millisecond: e.getUTCMilliseconds()
77
- };
78
- }
79
- function S(t, e) {
80
- const n = /* @__PURE__ */ new Date(0);
81
- return n.setUTCFullYear(t, e, 0), n.getUTCDate();
82
- }
83
- function m(t, e) {
84
- const n = t.year * 12 + (t.month - 1) + e, r = Math.floor(n / 12), o = n - r * 12 + 1;
85
- return { ...t, year: r, month: o, day: Math.min(t.day, S(r, o)) };
86
- }
87
- function f(t, e, n) {
88
- if (e === 0) return t;
89
- switch (n) {
90
- case "second":
91
- case "minute":
92
- case "hour":
93
- return p(
94
- s(t) + e * w[n]
95
- );
96
- case "day":
97
- return p(s(t) + e * D);
98
- case "week":
99
- return p(s(t) + e * 7 * D);
100
- case "month":
101
- return m(t, e);
102
- case "quarter":
103
- return m(t, e * 3);
104
- case "year":
105
- return m(t, e * 12);
106
- }
107
- }
108
- function j(t) {
109
- return new Date(
110
- s({ ...t, hour: 0, minute: 0, second: 0 })
111
- ).getUTCDay();
112
- }
113
- function A(t) {
114
- var n;
115
- const e = (n = t.fiscalCalendar) == null ? void 0 : n.yearStartMonth;
116
- return e && e >= 1 && e <= 12 ? e : 1;
117
- }
118
- function Y(t, e, n) {
119
- const r = { ...t, hour: 0, minute: 0, second: 0, millisecond: 0 };
120
- switch (e) {
121
- case "day":
122
- return r;
123
- case "week":
124
- return f(
125
- r,
126
- -((j(t) - n.weekStart + 7) % 7),
127
- "day"
128
- );
129
- case "month":
130
- return { ...r, day: 1 };
131
- case "quarter": {
132
- const o = (t.month - A(n) + 12) % 12;
133
- return m({ ...r, day: 1 }, -(o % 3));
134
- }
135
- case "year": {
136
- const o = A(n);
137
- return {
138
- ...r,
139
- year: t.month >= o ? t.year : t.year - 1,
140
- month: o,
141
- day: 1
142
- };
143
- }
144
- }
145
- }
146
- function _(t, e, n, r = 0) {
147
- const o = w[e];
148
- if (o !== void 0) {
149
- const u = g(t, n.tz), L = u.millisecond + (e === "second" ? 0 : u.second * 1e3) + (e === "hour" ? u.minute * 6e4 : 0), C = t.getTime() - L + r * o;
150
- return { start: new Date(C), endExclusive: new Date(C + o) };
151
- }
152
- const a = e, i = f(
153
- Y(g(t, n.tz), a, n),
154
- r,
155
- e
156
- );
157
- return {
158
- start: d(i, n.tz),
159
- endExclusive: d(f(i, 1, e), n.tz)
160
- };
161
- }
162
- function ct(t, e, n) {
163
- return _(t, e, n).start;
164
- }
165
- function dt(t, e, n) {
166
- return new Date(_(t, e, n).endExclusive.getTime() - 1);
167
- }
168
- function ft(t, e, n, r) {
169
- return e === 0 ? t : d(
170
- f(g(t, r.tz), e, n),
171
- r.tz
172
- );
173
- }
174
- function lt(t, e, n) {
175
- const r = (o) => {
176
- const { year: a, month: i, day: u } = y(o, n);
177
- return s({ year: a, month: i, day: u, hour: 0, minute: 0, second: 0 });
178
- };
179
- return Math.round((r(e) - r(t)) / D);
180
- }
181
- const B = /^(\d{4})-(\d{2})-(\d{2})$/;
182
- function mt(t, e) {
183
- const { year: n, month: r, day: o } = y(t, e);
184
- return `${String(n).padStart(4, "0")}-${String(r).padStart(2, "0")}-${String(o).padStart(2, "0")}`;
185
- }
186
- function q(t) {
187
- const e = B.exec(t);
188
- if (!e) return null;
189
- const n = Number(e[1]), r = Number(e[2]), o = Number(e[3]);
190
- return r < 1 || r > 12 || o < 1 || o > S(n, r) ? null : { year: n, month: r, day: o };
191
- }
192
- function ht(t, e) {
193
- const n = q(t);
194
- if (!n) return null;
195
- const r = { ...n, hour: 0, minute: 0, second: 0, millisecond: 0 };
196
- return {
197
- start: d(r, e),
198
- endExclusive: d(f(r, 1, "day"), e)
199
- };
200
- }
201
- const yt = {
202
- direction: "last",
203
- count: 7,
204
- unit: "day",
205
- includeCurrent: !0,
206
- toDate: !1
207
- }, V = /* @__PURE__ */ new Set(["minute", "hour"]), T = (t) => V.has(t);
208
- function z(t) {
209
- const { direction: e, unit: n } = t;
210
- return T(n) ? { direction: "last", count: t.count, unit: n, includeCurrent: !0, toDate: !1 } : e === "this" || t.count === 1 && t.includeCurrent ? { direction: "this", count: 1, unit: n, includeCurrent: !0, toDate: e === "this" && t.toDate } : { direction: e, count: t.count, unit: n, includeCurrent: t.includeCurrent, toDate: !1 };
211
- }
212
- function H(t) {
213
- const { direction: e, count: n, unit: r } = t;
214
- if (T(r) && e !== "last") return `Only the last ${r}s can be picked.`;
215
- if (e === "this") return;
216
- if (!Number.isInteger(n) || n < 1) return "Enter a whole number, 1 or more.";
217
- const o = E[r];
218
- if (n > o) return `At most ${o.toLocaleString("en-US")} ${r}s (ten years).`;
219
- }
220
- function Tt(t) {
221
- if (H(t)) return;
222
- const e = z(t);
223
- if (T(e.unit)) return { kind: "rolling", unit: e.unit, n: e.count, anchor: "now" };
224
- const n = e.unit;
225
- if (e.direction === "this") return { kind: "periods", unit: n, from: 0, to: 0, ...e.toDate ? { toDate: !0 } : {}, anchor: "now" };
226
- const [r, o] = e.direction === "last" ? e.includeCurrent ? [-(e.count - 1), 0] : [-e.count, -1] : e.includeCurrent ? [0, e.count - 1] : [1, e.count];
227
- return { kind: "periods", unit: n, from: r, to: o, anchor: "now" };
228
- }
229
- function pt(t) {
230
- if (t.kind === "rolling")
231
- return t.anchor === "now" && T(t.unit) ? { direction: "last", count: t.n, unit: t.unit, includeCurrent: !0, toDate: !1 } : void 0;
232
- if (t.kind !== "periods" || t.anchor !== "now") return;
233
- const { unit: e, from: n, to: r } = t, o = (a, i, u) => ({
234
- direction: a,
235
- count: i,
236
- unit: e,
237
- includeCurrent: u,
238
- toDate: !1
239
- });
240
- if (n === 0 && r === 0) return { ...o("this", 1, !0), toDate: !!t.toDate };
241
- if (!t.toDate) {
242
- if (r === 0 && n < 0) return o("last", 1 - n, !0);
243
- if (r === -1 && n <= -1) return o("last", -n, !1);
244
- if (n === 0 && r > 0) return o("next", r + 1, !0);
245
- if (n === 1 && r >= 1) return o("next", r, !1);
246
- }
247
- }
248
- const vt = {
249
- side: "before",
250
- point: { kind: "ago", count: 30, unit: "day" },
251
- inclusive: !1
252
- };
253
- function Z(t) {
254
- const { point: e } = t;
255
- if (e.kind === "now" || e.kind === "current") return;
256
- if (!Number.isInteger(e.count) || e.count < 1) return "Enter a whole number, 1 or more.";
257
- const n = E[e.unit];
258
- if (e.count > n) return `At most ${n.toLocaleString("en-US")} ${e.unit}s (ten years).`;
259
- }
260
- function R(t) {
261
- if (t === "<" || t === "<=") return { side: "before", inclusive: t === "<=" };
262
- if (t === ">" || t === ">=") return { side: "after", inclusive: t === ">=" };
263
- }
264
- const h = (t, e) => t === "before" ? e ? "<=" : "<" : e ? ">=" : ">";
265
- function Dt(t) {
266
- if (Z(t)) return;
267
- const { side: e, point: n, inclusive: r } = t;
268
- if (n.kind === "now")
269
- return {
270
- operator: h(e, e === "before"),
271
- window: { kind: "periods", unit: "day", from: 0, to: 0, toDate: !0, anchor: "now" }
272
- };
273
- const o = n.kind === "current" ? 0 : n.kind === "ago" ? -n.count : n.count;
274
- return {
275
- operator: h(e, r),
276
- window: { kind: "periods", unit: n.unit, from: o, to: o, anchor: "now" }
277
- };
278
- }
279
- function G(t, e) {
280
- var i;
281
- const n = (i = R(t)) == null ? void 0 : i.side;
282
- if (!n || e.kind !== "periods" || e.anchor !== "now" || e.from !== e.to) return;
283
- const { unit: r, from: o } = e;
284
- if (e.toDate)
285
- return r === "day" && o === 0 && t === h(n, n === "before") ? { side: n, point: { kind: "now" }, inclusive: !1 } : void 0;
286
- const a = o === 0 ? { kind: "current", unit: r } : { kind: o < 0 ? "ago" : "ahead", count: Math.abs(o), unit: r };
287
- return { side: n, point: a, inclusive: t === "<=" || t === ">=" };
288
- }
289
- function J(t) {
290
- if (t.kind === "now") return "now";
291
- const { unit: e } = t;
292
- if (t.kind === "current") return e === "day" ? "today" : `this ${e}`;
293
- const { count: n } = t;
294
- return e === "day" && n === 1 ? t.kind === "ago" ? "yesterday" : "tomorrow" : `${n} ${n === 1 ? e : `${e}s`} ${t.kind === "ago" ? "ago" : "from now"}`;
295
- }
296
- const X = {
297
- "<": "Before",
298
- "<=": "On or before",
299
- ">": "After",
300
- ">=": "On or after"
301
- };
302
- function N(t) {
303
- return X[t];
304
- }
305
- function Q(t) {
306
- const e = t.point.kind === "now" ? t.side === "before" ? "<" : ">" : h(t.side, t.inclusive);
307
- return `${N(e)} ${J(t.point)}`;
308
- }
309
- function gt(t, e) {
310
- if (!R(t)) return;
311
- const r = G(t, e);
312
- if (r) return Q(r);
313
- const o = U(e).label;
314
- return `${N(t)} the ${W(t)} of ${o.charAt(0).toLowerCase()}${o.slice(1)}`;
315
- }
316
- class c extends Error {
317
- constructor(n) {
318
- super(n);
319
- b(this, "code");
320
- this.name = "RawTemporalMetadataContractError", this.code = x.invalidMetadata;
321
- }
322
- }
323
- function tt(t) {
324
- if (t === null || typeof t != "object" || Array.isArray(t))
325
- return !1;
326
- const e = Object.getPrototypeOf(t);
327
- return e === null || e === Object.prototype;
328
- }
329
- function et(t) {
330
- if (!tt(t))
331
- throw new c(
332
- "Raw temporal metadata must be an object."
333
- );
334
- const e = Object.keys(t);
335
- if (e.length !== 2 || !e.includes("kind") || !e.includes("valueKind"))
336
- throw new c(
337
- "Raw temporal metadata must contain only kind and valueKind."
338
- );
339
- if (t.kind !== "raw_temporal")
340
- throw new c(
341
- "Raw temporal metadata kind must be raw_temporal."
342
- );
343
- if (t.valueKind !== "date" && t.valueKind !== "wall_datetime" && t.valueKind !== "instant")
344
- throw new c(
345
- "Raw temporal valueKind must be date, wall_datetime, or instant."
346
- );
347
- return {
348
- kind: "raw_temporal",
349
- valueKind: t.valueKind
350
- };
351
- }
352
- function Ct(t, e) {
353
- if (!t.rawTemporal) {
354
- if (e.metadataRequired)
355
- throw new c(
356
- "Activated raw temporal result is missing metadata."
357
- );
358
- return;
359
- }
360
- if (t.temporalBucket)
361
- throw new c(
362
- "A result column cannot carry both raw and grouped temporal metadata."
363
- );
364
- const n = et(t.rawTemporal), r = n.valueKind === "date" ? "date" : "datetime";
365
- if (t.dataType !== r)
366
- throw new c(
367
- `${n.valueKind} raw temporal values require dataType ${r}.`
368
- );
369
- return n;
370
- }
371
- const M = /^(\d{4})-(\d{2})-(\d{2})$/, $ = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?$/, I = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|[+-]\d{2}:\d{2})$/;
372
- function bt(t) {
373
- if (M.test(t)) return "date";
374
- if (I.test(t)) return "instant";
375
- if ($.test(t)) return "wall_datetime";
376
- }
377
- function nt(t) {
378
- return t % 4 === 0 && (t % 100 !== 0 || t % 400 === 0);
379
- }
380
- function rt(t, e) {
381
- return e === 2 ? nt(t) ? 29 : 28 : [4, 6, 9, 11].includes(e) ? 30 : 31;
382
- }
383
- function ot(t) {
384
- return t.year >= 1 && t.year <= 9999 && t.month >= 1 && t.month <= 12 && t.day >= 1 && t.day <= rt(t.year, t.month) && t.hour >= 0 && t.hour <= 23 && t.minute >= 0 && t.minute <= 59 && t.second >= 0 && t.second <= 59;
385
- }
386
- function at(t) {
387
- return {
388
- year: Number(t[1]),
389
- month: Number(t[2]),
390
- day: Number(t[3]),
391
- hour: Number(t[4] ?? 0),
392
- minute: Number(t[5] ?? 0),
393
- second: Number(t[6] ?? 0),
394
- fraction: t[7] ?? ""
395
- };
396
- }
397
- function kt(t, e) {
398
- const n = e === "date" ? t.match(M) : e === "wall_datetime" ? t.match($) : t.match(I);
399
- if (!n) return { status: "invalid_shape" };
400
- const r = at(n);
401
- if (!ot(r)) return { status: "out_of_range" };
402
- if (e === "instant") {
403
- const o = n[8];
404
- if (o && o !== "Z") {
405
- const [i, u] = o.slice(1).split(":").map(Number);
406
- if (i > 23 || u > 59) return { status: "out_of_range" };
407
- }
408
- const a = new Date(t.replace(" ", "T"));
409
- return Number.isNaN(a.getTime()) ? { status: "out_of_range" } : { status: "valid", fields: r, instant: a };
410
- }
411
- return { status: "valid", fields: r };
412
- }
413
- export {
414
- S as A,
415
- j as B,
416
- Y as C,
417
- vt as D,
418
- w as E,
419
- _ as F,
420
- ct as G,
421
- dt as H,
422
- ft as I,
423
- lt as J,
424
- mt as K,
425
- q as L,
426
- ht as M,
427
- c as R,
428
- kt as a,
429
- Dt as b,
430
- bt as c,
431
- gt as d,
432
- Z as e,
433
- N as f,
434
- h as g,
435
- R as h,
436
- d as i,
437
- Q as j,
438
- J as k,
439
- yt as l,
440
- H as m,
441
- T as n,
442
- z as o,
443
- et as p,
444
- pt as q,
445
- G as r,
446
- f as s,
447
- Tt as t,
448
- y as u,
449
- Ct as v,
450
- g as w,
451
- s as x,
452
- K as y,
453
- F as z
454
- };
@@ -1,131 +0,0 @@
1
- import { i as d } from "./matrix-analytical-definition-CgQgVeeI.js";
2
- function m(e, t) {
3
- var a, l;
4
- const n = e.name.split(".").pop(), r = (a = e.fieldMeta) == null ? void 0 : a.qualifiedFieldName, i = !!(t.qualifiedFieldName && (r || e.name) === t.qualifiedFieldName), o = !((l = t.qualifiedFieldName) != null && l.includes(".")) && n === t.name;
5
- return i || o;
6
- }
7
- function c(e) {
8
- var t;
9
- return !e.negate && (e.logicalOperator === "AND" || e.conditions.length + (((t = e.groups) == null ? void 0 : t.length) ?? 0) <= 1);
10
- }
11
- function F(e, t, n) {
12
- const r = t.filter((i) => !!i);
13
- return e ? r.length ? Array.isArray(e.conditions) && c(e) ? { ...e, logicalOperator: "AND", groups: [...e.groups ?? [], ...r] } : { id: n, logicalOperator: "AND", negate: !1, conditions: [], groups: [e, ...r] } : e : r.length ? { id: n, logicalOperator: "AND", negate: !1, conditions: [], groups: r } : void 0;
14
- }
15
- function g(e) {
16
- return !e || !Array.isArray(e.conditions) ? [] : c(e) ? [
17
- ...e.conditions,
18
- ...(e.groups ?? []).flatMap((t) => g(t))
19
- ] : [];
20
- }
21
- function A(e, t) {
22
- const n = e.filters;
23
- if (!n || !Array.isArray(n.conditions) || !c(n) || !t.length)
24
- return e;
25
- const r = (o, a) => {
26
- var p;
27
- if (d(o.filterId)) return !1;
28
- const l = { name: a.field.name, qualifiedFieldName: a.field.qualifiedFieldName }, s = !((p = o.fieldMeta) != null && p.qualifiedFieldName);
29
- return m(o, l) || s && o.name === l.name;
30
- }, i = n.conditions.filter(
31
- (o) => !t.some((a) => r(a, o))
32
- );
33
- return i.length === n.conditions.length ? e : { ...e, filters: { ...n, conditions: i } };
34
- }
35
- function O(e, t) {
36
- return {
37
- id: t,
38
- field: e.field,
39
- operator: e.operator,
40
- value: e.value,
41
- label: e.label,
42
- temporalBucket: e.temporalBucket,
43
- ...e.rawTemporal ? { rawTemporal: e.rawTemporal } : {}
44
- };
45
- }
46
- function u(e) {
47
- var t;
48
- return JSON.stringify([
49
- ((t = e.field) == null ? void 0 : t.id) ?? "",
50
- e.operator,
51
- e.value ?? null,
52
- e.temporalBucket ?? null,
53
- e.rawTemporal ?? null
54
- ]);
55
- }
56
- function N(e) {
57
- return JSON.stringify(e.map(u).sort());
58
- }
59
- function f(e) {
60
- const t = /* @__PURE__ */ new Map();
61
- for (const n of e)
62
- for (const r of n.tuples) {
63
- const i = r.conditions.filter(
64
- (l) => {
65
- var s;
66
- return (s = l.field) == null ? void 0 : s.id;
67
- }
68
- );
69
- if (i.length === 0) continue;
70
- let o = t.get(n.sourceCardId);
71
- o || (o = /* @__PURE__ */ new Map(), t.set(n.sourceCardId, o));
72
- const a = [...i].sort(
73
- (l, s) => u(l).localeCompare(u(s))
74
- );
75
- o.set(N(a), a);
76
- }
77
- return [...t.entries()].sort(([n], [r]) => n.localeCompare(r)).map(([n, r]) => ({
78
- sourceCardId: n,
79
- tuples: [...r.entries()].sort(([i], [o]) => i.localeCompare(o)).map(([, i]) => ({ conditions: i }))
80
- }));
81
- }
82
- function w(e) {
83
- const t = f(e);
84
- if (t.length !== 0)
85
- return {
86
- id: "selection",
87
- logicalOperator: "AND",
88
- negate: !1,
89
- conditions: [],
90
- groups: t.map((n) => {
91
- const r = `selection:${n.sourceCardId}`;
92
- return {
93
- id: r,
94
- logicalOperator: "OR",
95
- negate: !1,
96
- conditions: [],
97
- groups: n.tuples.map((i, o) => {
98
- const a = `${r}:${o}`;
99
- return {
100
- id: a,
101
- logicalOperator: "AND",
102
- negate: !1,
103
- conditions: i.conditions.map((l, s) => ({
104
- ...l,
105
- id: `${a}:${s}`
106
- })),
107
- groups: []
108
- };
109
- })
110
- };
111
- })
112
- };
113
- }
114
- function h(e) {
115
- return JSON.stringify(
116
- f(e).map((t) => [
117
- t.sourceCardId,
118
- t.tuples.map((n) => n.conditions.map(u))
119
- ])
120
- );
121
- }
122
- export {
123
- w as c,
124
- m as f,
125
- c as i,
126
- F as n,
127
- h as s,
128
- O as t,
129
- g as u,
130
- A as w
131
- };