react-semaphor 0.1.428 → 0.1.429
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.
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +72 -71
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +5 -4
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +1031 -622
- package/dist/chunks/analyze-result-contract-BswhsmWT.js +1 -0
- package/dist/chunks/{analyze-result-contract-DnfF8kBb.js → analyze-result-contract-CfOBEwaC.js} +681 -759
- package/dist/chunks/{code-editor-CojfM3qp.js → code-editor-C65eEYyU.js} +2980 -2960
- package/dist/chunks/code-editor-DOh3aYEh.js +138 -0
- package/dist/chunks/{comparison-document-migration-b6c3xiWh.js → comparison-document-migration-DbU_BTxR.js} +1 -1
- package/dist/chunks/{comparison-document-migration-BJH1idOd.js → comparison-document-migration-Dj6xZMCb.js} +2 -2
- package/dist/chunks/csv-utils-Co0WxHke.js +4 -0
- package/dist/chunks/csv-utils-suxSkJGj.js +376 -0
- package/dist/chunks/dashboard-CQfAvRYI.js +1401 -0
- package/dist/chunks/{dashboard-509sbC4_.js → dashboard-agBXhvKo.js} +47563 -44929
- package/dist/chunks/{dashboard-briefing-launcher-B-ZTWJwo.js → dashboard-briefing-launcher-CkH_pthg.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DIdYHNTq.js → dashboard-briefing-launcher-gBNNKqoH.js} +100 -99
- package/dist/chunks/{dashboard-controls-CWprw-Pb.js → dashboard-controls-CAZnIGfT.js} +2 -2
- package/dist/chunks/{dashboard-controls-CbRzWo1N.js → dashboard-controls-CoIxUTvH.js} +114 -113
- package/dist/chunks/{dashboard-json-jO4GQfZk.js → dashboard-json-BMcPjL8-.js} +18 -17
- package/dist/chunks/dashboard-json-D4hFrMkX.js +1 -0
- package/dist/chunks/{edit-dashboard-visual-KgQTjqWp.js → edit-dashboard-visual-Bc8qNfSr.js} +8721 -8481
- package/dist/chunks/edit-dashboard-visual-onhUUXlw.js +182 -0
- package/dist/chunks/{metric-comparison-CWweq9RG.js → metric-comparison-CPoDx56y.js} +1 -1
- package/dist/chunks/{metric-comparison-BKgkMy9r.js → metric-comparison-DVy3fll_.js} +1 -1
- package/dist/chunks/numeric-presentation-CGTcqocU.js +517 -0
- package/dist/chunks/numeric-presentation-Dlb-Dk4c.js +1 -0
- package/dist/chunks/report-preferences-dialog-CPptr_V9.js +690 -0
- package/dist/chunks/report-preferences-dialog-DV_5aHrS.js +1 -0
- package/dist/chunks/source-identity-5OPV4gvg.js +92 -0
- package/dist/chunks/source-identity-Cbo2LOHQ.js +1 -0
- package/dist/chunks/{update-policy-CY2k-pJP.js → update-policy-De2NswtM.js} +1 -1
- package/dist/chunks/{update-policy-BgONreNd.js → update-policy-DnF_74zC.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BiMYdjZP.js → use-create-flow-overlay-state-Bs6gqgjo.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CGsLzp9A.js → use-create-flow-overlay-state-CgQbCrni.js} +97 -96
- package/dist/chunks/validators-B2vUAqTf.js +1 -0
- package/dist/chunks/{validators-Cz-XuORM.js → validators-Bce_J7Vd.js} +19 -13
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +20 -19
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +50 -50
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +2 -2
- package/dist/data-app-sdk/index.js +27 -26
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +25 -24
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +57 -55
- package/dist/format-utils/index.cjs +2 -5
- package/dist/format-utils/index.js +136 -161
- package/dist/index.cjs +1 -1
- package/dist/index.js +158 -155
- package/dist/report-runtime-context/index.cjs +1 -0
- package/dist/report-runtime-context/index.js +394 -0
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +7 -6
- package/dist/types/analytics-protocol.d.ts +0 -4
- package/dist/types/briefings.d.ts +216 -19
- package/dist/types/dashboard-assistant.d.ts +0 -2
- package/dist/types/dashboard-authoring.d.ts +34 -9
- package/dist/types/dashboard.d.ts +93 -9
- package/dist/types/data-app-builder.d.ts +0 -1
- package/dist/types/data-app-codegen-node.d.ts +6 -28
- package/dist/types/data-app-codegen.d.ts +6 -28
- package/dist/types/data-app-sdk-adapters.d.ts +6 -28
- package/dist/types/data-app-sdk-validation.d.ts +6 -29
- package/dist/types/data-app-sdk.d.ts +6 -31
- package/dist/types/format-utils.d.ts +128 -4
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +10 -13
- package/dist/types/main.d.ts +249 -89
- package/dist/types/report-runtime-context.d.ts +99 -0
- package/dist/types/shared.d.ts +34 -9
- package/dist/types/surfboard.d.ts +119 -16
- package/dist/types/types.d.ts +156 -73
- package/dist/types/value-format-preferences.d.ts +126 -0
- package/dist/value-format-preferences/index.cjs +1 -0
- package/dist/value-format-preferences/index.js +635 -0
- package/package.json +11 -1
- package/dist/chunks/analyze-result-contract-ege_u6Nl.js +0 -1
- package/dist/chunks/calendar-preferences-dialog-BF9bNAF_.js +0 -457
- package/dist/chunks/calendar-preferences-dialog-_L9eBQfj.js +0 -1
- package/dist/chunks/code-editor-BoowcKU0.js +0 -138
- package/dist/chunks/dashboard-CMDXBLnG.js +0 -1402
- package/dist/chunks/dashboard-json-BEZrxx_k.js +0 -1
- package/dist/chunks/date-formatter-BTTYdAik.js +0 -1
- package/dist/chunks/date-formatter-D-89jTjG.js +0 -514
- package/dist/chunks/edit-dashboard-visual-D3uhqgm3.js +0 -182
- package/dist/chunks/validators-B4VMLX3_.js +0 -1
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import { parseValueFormatPreferences as _, isReportPreferenceSource as C } from "../value-format-preferences/index.js";
|
|
2
|
+
import { p as g } from "../chunks/validators-Bce_J7Vd.js";
|
|
3
|
+
const M = {
|
|
4
|
+
tz: "UTC",
|
|
5
|
+
weekStart: 1,
|
|
6
|
+
anchor: "now"
|
|
7
|
+
}, b = [
|
|
8
|
+
"tz",
|
|
9
|
+
"weekStart",
|
|
10
|
+
"anchor",
|
|
11
|
+
"fiscalCalendar"
|
|
12
|
+
], w = ["kind", "yearStartMonth"], E = [
|
|
13
|
+
"calendar",
|
|
14
|
+
"valueFormat",
|
|
15
|
+
"preferenceSources"
|
|
16
|
+
], z = ["calendar", "valueFormat"], k = ["tz", "weekStart"], F = [
|
|
17
|
+
"stored",
|
|
18
|
+
"inherited",
|
|
19
|
+
"inheritedSources",
|
|
20
|
+
"resolved",
|
|
21
|
+
"sources"
|
|
22
|
+
], T = [
|
|
23
|
+
"locale",
|
|
24
|
+
"dateStyle",
|
|
25
|
+
"dateTime",
|
|
26
|
+
"defaultCurrency"
|
|
27
|
+
], R = ["dateStyle", "timeStyle"];
|
|
28
|
+
function o(e) {
|
|
29
|
+
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
30
|
+
return !1;
|
|
31
|
+
const r = Object.getPrototypeOf(e);
|
|
32
|
+
return r === null || Object.getPrototypeOf(r) === null;
|
|
33
|
+
}
|
|
34
|
+
function n(e, r, t) {
|
|
35
|
+
const a = new Set(r);
|
|
36
|
+
return Object.keys(e).filter((s) => !a.has(s)).map((s) => ({
|
|
37
|
+
path: t === "$" ? s : `${t}.${s}`,
|
|
38
|
+
code: "unknown_property",
|
|
39
|
+
message: `Unknown property "${s}"`
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
function p(e) {
|
|
43
|
+
try {
|
|
44
|
+
return new Intl.DateTimeFormat("en-US", { timeZone: e }).format(), !0;
|
|
45
|
+
} catch {
|
|
46
|
+
return !1;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function y(e) {
|
|
50
|
+
return Number.isInteger(e) && typeof e == "number" && e >= 0 && e <= 6;
|
|
51
|
+
}
|
|
52
|
+
function d(e, r, t) {
|
|
53
|
+
if (!o(e))
|
|
54
|
+
return {
|
|
55
|
+
ok: !1,
|
|
56
|
+
issues: [
|
|
57
|
+
{
|
|
58
|
+
path: r,
|
|
59
|
+
code: "invalid_type",
|
|
60
|
+
message: "Calendar preferences must be an object"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
};
|
|
64
|
+
const a = n(e, ["tz", "weekStart"], r);
|
|
65
|
+
return (!t || e.tz !== void 0) && (typeof e.tz != "string" || !p(e.tz)) && a.push({
|
|
66
|
+
path: `${r}.tz`,
|
|
67
|
+
code: "invalid_timezone",
|
|
68
|
+
message: "tz must be a valid IANA timezone"
|
|
69
|
+
}), (!t || e.weekStart !== void 0) && !y(e.weekStart) && a.push({
|
|
70
|
+
path: `${r}.weekStart`,
|
|
71
|
+
code: "invalid_week_start",
|
|
72
|
+
message: "weekStart must be an integer from 0 to 6"
|
|
73
|
+
}), a.length ? { ok: !1, issues: a } : {
|
|
74
|
+
ok: !0,
|
|
75
|
+
value: {
|
|
76
|
+
...e.tz !== void 0 ? { tz: e.tz } : {},
|
|
77
|
+
...e.weekStart !== void 0 ? { weekStart: e.weekStart } : {}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function A(e) {
|
|
82
|
+
if (e === "now") return { ok: !0, value: "now" };
|
|
83
|
+
if (!o(e))
|
|
84
|
+
return {
|
|
85
|
+
ok: !1,
|
|
86
|
+
issues: [
|
|
87
|
+
{
|
|
88
|
+
path: "anchor",
|
|
89
|
+
code: "invalid_anchor",
|
|
90
|
+
message: 'anchor must be "now" or an object with an ISO timestamp'
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
};
|
|
94
|
+
const r = n(e, ["iso"], "anchor"), t = e.iso;
|
|
95
|
+
return g(t) === null && r.push({
|
|
96
|
+
path: "anchor.iso",
|
|
97
|
+
code: "invalid_anchor",
|
|
98
|
+
message: "anchor.iso must be an ISO timestamp with an explicit offset"
|
|
99
|
+
}), r.length ? { ok: !1, issues: r } : { ok: !0, value: { iso: t } };
|
|
100
|
+
}
|
|
101
|
+
function $(e) {
|
|
102
|
+
if (!o(e))
|
|
103
|
+
return {
|
|
104
|
+
ok: !1,
|
|
105
|
+
issues: [
|
|
106
|
+
{
|
|
107
|
+
path: "fiscalCalendar",
|
|
108
|
+
code: "invalid_fiscal_calendar",
|
|
109
|
+
message: "fiscalCalendar must be an object"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
};
|
|
113
|
+
const r = n(e, w, "fiscalCalendar");
|
|
114
|
+
return e.kind !== "month_aligned" && r.push({
|
|
115
|
+
path: "fiscalCalendar.kind",
|
|
116
|
+
code: "invalid_fiscal_calendar",
|
|
117
|
+
message: 'fiscalCalendar.kind must be "month_aligned"'
|
|
118
|
+
}), (!Number.isInteger(e.yearStartMonth) || typeof e.yearStartMonth != "number" || e.yearStartMonth < 1 || e.yearStartMonth > 12) && r.push({
|
|
119
|
+
path: "fiscalCalendar.yearStartMonth",
|
|
120
|
+
code: "invalid_fiscal_calendar",
|
|
121
|
+
message: "fiscalCalendar.yearStartMonth must be an integer from 1 to 12"
|
|
122
|
+
}), r.length ? { ok: !1, issues: r } : {
|
|
123
|
+
ok: !0,
|
|
124
|
+
value: {
|
|
125
|
+
kind: "month_aligned",
|
|
126
|
+
yearStartMonth: e.yearStartMonth
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function O(e) {
|
|
131
|
+
if (!o(e))
|
|
132
|
+
return {
|
|
133
|
+
ok: !1,
|
|
134
|
+
issues: [
|
|
135
|
+
{
|
|
136
|
+
path: "$",
|
|
137
|
+
code: "invalid_type",
|
|
138
|
+
message: "Calendar context must be an object"
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
};
|
|
142
|
+
const r = n(e, b, "$");
|
|
143
|
+
(typeof e.tz != "string" || !p(e.tz)) && r.push({
|
|
144
|
+
path: "tz",
|
|
145
|
+
code: "invalid_timezone",
|
|
146
|
+
message: "tz must be a valid IANA timezone"
|
|
147
|
+
}), y(e.weekStart) || r.push({
|
|
148
|
+
path: "weekStart",
|
|
149
|
+
code: "invalid_week_start",
|
|
150
|
+
message: "weekStart must be an integer from 0 to 6"
|
|
151
|
+
});
|
|
152
|
+
const t = A(e.anchor);
|
|
153
|
+
t.ok || r.push(...t.issues);
|
|
154
|
+
let a;
|
|
155
|
+
if (e.fiscalCalendar !== void 0) {
|
|
156
|
+
const s = $(e.fiscalCalendar);
|
|
157
|
+
s.ok ? a = s.value : r.push(...s.issues);
|
|
158
|
+
}
|
|
159
|
+
return r.length || !t.ok ? { ok: !1, issues: r } : {
|
|
160
|
+
ok: !0,
|
|
161
|
+
value: {
|
|
162
|
+
tz: e.tz,
|
|
163
|
+
weekStart: e.weekStart,
|
|
164
|
+
anchor: t.value,
|
|
165
|
+
...a ? { fiscalCalendar: a } : {}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function l(e, r, t) {
|
|
170
|
+
if (!C(e)) {
|
|
171
|
+
t.push({
|
|
172
|
+
path: r,
|
|
173
|
+
code: "invalid_preference_source",
|
|
174
|
+
message: "Preference source is invalid"
|
|
175
|
+
});
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
return e;
|
|
179
|
+
}
|
|
180
|
+
function v(e, r) {
|
|
181
|
+
if (!o(e))
|
|
182
|
+
return {
|
|
183
|
+
ok: !1,
|
|
184
|
+
issues: [
|
|
185
|
+
{
|
|
186
|
+
path: r,
|
|
187
|
+
code: "invalid_type",
|
|
188
|
+
message: "Calendar preference sources must be an object"
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
};
|
|
192
|
+
const t = n(e, k, r), a = l(e.tz, `${r}.tz`, t), s = l(
|
|
193
|
+
e.weekStart,
|
|
194
|
+
`${r}.weekStart`,
|
|
195
|
+
t
|
|
196
|
+
);
|
|
197
|
+
return t.length || !a || !s ? { ok: !1, issues: t } : { ok: !0, value: { tz: a, weekStart: s } };
|
|
198
|
+
}
|
|
199
|
+
function D(e) {
|
|
200
|
+
if (!o(e))
|
|
201
|
+
return {
|
|
202
|
+
ok: !1,
|
|
203
|
+
issues: [
|
|
204
|
+
{
|
|
205
|
+
path: "$",
|
|
206
|
+
code: "invalid_type",
|
|
207
|
+
message: "Calendar preference response must be an object"
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
};
|
|
211
|
+
const r = n(e, F, "$"), t = e.stored === null ? { ok: !0, value: null } : d(e.stored, "stored", !0), a = d(
|
|
212
|
+
e.inherited,
|
|
213
|
+
"inherited",
|
|
214
|
+
!1
|
|
215
|
+
), s = v(
|
|
216
|
+
e.inheritedSources,
|
|
217
|
+
"inheritedSources"
|
|
218
|
+
), c = d(e.resolved, "resolved", !1), i = v(e.sources, "sources");
|
|
219
|
+
for (const u of [t, a, s, c, i])
|
|
220
|
+
u.ok || r.push(...u.issues);
|
|
221
|
+
return r.length || !t.ok || !a.ok || !s.ok || !c.ok || !i.ok ? { ok: !1, issues: r } : {
|
|
222
|
+
ok: !0,
|
|
223
|
+
value: {
|
|
224
|
+
stored: t.value,
|
|
225
|
+
inherited: a.value,
|
|
226
|
+
inheritedSources: s.value,
|
|
227
|
+
resolved: c.value,
|
|
228
|
+
sources: i.value
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function j(e) {
|
|
233
|
+
if (!o(e))
|
|
234
|
+
return {
|
|
235
|
+
ok: !1,
|
|
236
|
+
issues: [
|
|
237
|
+
{
|
|
238
|
+
path: "preferenceSources",
|
|
239
|
+
code: "invalid_type",
|
|
240
|
+
message: "preferenceSources must be an object"
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
};
|
|
244
|
+
const r = n(e, z, "preferenceSources"), t = e.calendar, a = e.valueFormat;
|
|
245
|
+
if (o(t) || r.push({
|
|
246
|
+
path: "preferenceSources.calendar",
|
|
247
|
+
code: "invalid_type",
|
|
248
|
+
message: "Calendar preference sources must be an object"
|
|
249
|
+
}), o(a) || r.push({
|
|
250
|
+
path: "preferenceSources.valueFormat",
|
|
251
|
+
code: "invalid_type",
|
|
252
|
+
message: "Value-format preference sources must be an object"
|
|
253
|
+
}), !o(t) || !o(a))
|
|
254
|
+
return { ok: !1, issues: r };
|
|
255
|
+
r.push(
|
|
256
|
+
...n(
|
|
257
|
+
t,
|
|
258
|
+
k,
|
|
259
|
+
"preferenceSources.calendar"
|
|
260
|
+
),
|
|
261
|
+
...n(
|
|
262
|
+
a,
|
|
263
|
+
T,
|
|
264
|
+
"preferenceSources.valueFormat"
|
|
265
|
+
)
|
|
266
|
+
);
|
|
267
|
+
const s = a.dateTime;
|
|
268
|
+
o(s) ? r.push(
|
|
269
|
+
...n(
|
|
270
|
+
s,
|
|
271
|
+
R,
|
|
272
|
+
"preferenceSources.valueFormat.dateTime"
|
|
273
|
+
)
|
|
274
|
+
) : r.push({
|
|
275
|
+
path: "preferenceSources.valueFormat.dateTime",
|
|
276
|
+
code: "invalid_type",
|
|
277
|
+
message: "Datetime preference sources must be an object"
|
|
278
|
+
});
|
|
279
|
+
const c = l(
|
|
280
|
+
t.tz,
|
|
281
|
+
"preferenceSources.calendar.tz",
|
|
282
|
+
r
|
|
283
|
+
), i = l(
|
|
284
|
+
t.weekStart,
|
|
285
|
+
"preferenceSources.calendar.weekStart",
|
|
286
|
+
r
|
|
287
|
+
), u = l(
|
|
288
|
+
a.locale,
|
|
289
|
+
"preferenceSources.valueFormat.locale",
|
|
290
|
+
r
|
|
291
|
+
), f = l(
|
|
292
|
+
a.dateStyle,
|
|
293
|
+
"preferenceSources.valueFormat.dateStyle",
|
|
294
|
+
r
|
|
295
|
+
), m = o(s) ? l(
|
|
296
|
+
s.dateStyle,
|
|
297
|
+
"preferenceSources.valueFormat.dateTime.dateStyle",
|
|
298
|
+
r
|
|
299
|
+
) : void 0, S = o(s) ? l(
|
|
300
|
+
s.timeStyle,
|
|
301
|
+
"preferenceSources.valueFormat.dateTime.timeStyle",
|
|
302
|
+
r
|
|
303
|
+
) : void 0, h = l(
|
|
304
|
+
a.defaultCurrency,
|
|
305
|
+
"preferenceSources.valueFormat.defaultCurrency",
|
|
306
|
+
r
|
|
307
|
+
);
|
|
308
|
+
return r.length || !c || !i || !u || !f || !m || !S || !h ? { ok: !1, issues: r } : {
|
|
309
|
+
ok: !0,
|
|
310
|
+
value: {
|
|
311
|
+
calendar: {
|
|
312
|
+
tz: c,
|
|
313
|
+
weekStart: i
|
|
314
|
+
},
|
|
315
|
+
valueFormat: {
|
|
316
|
+
locale: u,
|
|
317
|
+
dateStyle: f,
|
|
318
|
+
dateTime: {
|
|
319
|
+
dateStyle: m,
|
|
320
|
+
timeStyle: S
|
|
321
|
+
},
|
|
322
|
+
defaultCurrency: h
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
function P(e) {
|
|
328
|
+
var a;
|
|
329
|
+
const r = _(e);
|
|
330
|
+
if (!r.ok)
|
|
331
|
+
return {
|
|
332
|
+
ok: !1,
|
|
333
|
+
issues: r.issues.map((s) => ({
|
|
334
|
+
path: `valueFormat.${s.path}`,
|
|
335
|
+
code: "invalid_value_format",
|
|
336
|
+
message: s.message
|
|
337
|
+
}))
|
|
338
|
+
};
|
|
339
|
+
const t = r.value;
|
|
340
|
+
return t.locale === void 0 || t.dateStyle === void 0 || ((a = t.dateTime) == null ? void 0 : a.dateStyle) === void 0 || t.dateTime.timeStyle === void 0 || t.defaultCurrency === void 0 ? {
|
|
341
|
+
ok: !1,
|
|
342
|
+
issues: [
|
|
343
|
+
{
|
|
344
|
+
path: "valueFormat",
|
|
345
|
+
code: "invalid_value_format",
|
|
346
|
+
message: "Resolved value-format preferences must be complete"
|
|
347
|
+
}
|
|
348
|
+
]
|
|
349
|
+
} : {
|
|
350
|
+
ok: !0,
|
|
351
|
+
value: {
|
|
352
|
+
locale: t.locale,
|
|
353
|
+
dateStyle: t.dateStyle,
|
|
354
|
+
dateTime: {
|
|
355
|
+
dateStyle: t.dateTime.dateStyle,
|
|
356
|
+
timeStyle: t.dateTime.timeStyle
|
|
357
|
+
},
|
|
358
|
+
defaultCurrency: t.defaultCurrency
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
function K(e) {
|
|
363
|
+
if (!o(e))
|
|
364
|
+
return {
|
|
365
|
+
ok: !1,
|
|
366
|
+
issues: [
|
|
367
|
+
{
|
|
368
|
+
path: "$",
|
|
369
|
+
code: "invalid_type",
|
|
370
|
+
message: "Report runtime context must be an object"
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
};
|
|
374
|
+
const r = n(e, E, "$"), t = O(e.calendar), a = P(e.valueFormat), s = j(e.preferenceSources);
|
|
375
|
+
return t.ok || r.push(
|
|
376
|
+
...t.issues.map((c) => ({
|
|
377
|
+
...c,
|
|
378
|
+
path: c.path === "$" ? "calendar" : `calendar.${c.path}`
|
|
379
|
+
}))
|
|
380
|
+
), a.ok || r.push(...a.issues), s.ok || r.push(...s.issues), r.length || !t.ok || !a.ok || !s.ok ? { ok: !1, issues: r } : {
|
|
381
|
+
ok: !0,
|
|
382
|
+
value: {
|
|
383
|
+
calendar: t.value,
|
|
384
|
+
valueFormat: a.value,
|
|
385
|
+
preferenceSources: s.value
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
export {
|
|
390
|
+
M as DEFAULT_CALENDAR_CONTEXT,
|
|
391
|
+
O as parseCalendarContext,
|
|
392
|
+
D as parseCalendarPreferencesResponse,
|
|
393
|
+
K as parseReportRuntimeContext
|
|
394
|
+
};
|