react-semaphor 0.1.559 → 0.1.560
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.js +368 -361
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +9 -9
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/analytics-base-schemas-CHLxsPfX.js +630 -0
- package/dist/chunks/{assistant-chat-B_4bVE6I.js → assistant-chat-Bu2fFm_I.js} +206 -207
- package/dist/chunks/{bookmark-state-ssqrs5oP.js → bookmark-state-BFY9oNmr.js} +3 -3
- package/dist/chunks/{braces-Rdxa3H-s.js → braces-Da41xfUd.js} +1 -1
- package/dist/chunks/{comparison-window-caption-CKzQ5LcF.js → comparison-window-caption-4FNkMrzE.js} +166 -166
- package/dist/chunks/{context-DVy4HOU0.js → context-BgPDzLHZ.js} +1 -1
- package/dist/chunks/{custom-visual-inputs-zVa9wX_o.js → custom-visual-inputs-Dz-enUNR.js} +1 -1
- package/dist/chunks/{dashboard-BziwOVpZ.js → dashboard-_MeBuy67.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CbeNR-YI.js → dashboard-briefing-launcher-CEi4Pr_v.js} +1152 -1166
- package/dist/chunks/{dashboard-controls-RD6UJs1r.js → dashboard-controls-Bi7fyG-4.js} +98 -98
- package/dist/chunks/{dashboard-json-DGpv17vL.js → dashboard-json-B1mU_OMa.js} +5 -5
- package/dist/chunks/{document-dashboard-inputs-ChVkcBuu.js → document-dashboard-inputs-CkWfDB8c.js} +64 -64
- package/dist/chunks/{edit-dashboard-visual-AQ2pQkFp.js → edit-dashboard-visual-0CJN31Y3.js} +8375 -8615
- package/dist/chunks/filter-reach-copy-BF4w4kI2.js +3738 -0
- package/dist/chunks/{filter-value-text-B4l-xqJT.js → filter-value-text-CRC-K_l_.js} +3 -3
- package/dist/chunks/{global-date-filter-utils-DBzEOX9M.js → global-date-filter-utils-D8365uPH.js} +4068 -3401
- package/dist/chunks/{index-B1Xr7W24.js → index-DtHidOPV.js} +579 -604
- package/dist/chunks/{layout-grid-Bbz3zKif.js → layout-grid-BvsH4RY2.js} +1 -1
- package/dist/chunks/{list-filter-3sbH0Uy1.js → list-filter-Dg0otx5E.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-CEe3PGEo.js → matrix-analytical-definition-CM18W8w6.js} +4 -4
- package/dist/chunks/{matrix-card-BRNGb1C4.js → matrix-card-HPskLaPy.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-CEegvTqg.js → matrix-member-presentation-Bbrfrke4.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-COxrfQTS.js → matrix-operation-contract-WPv4R-H_.js} +110 -110
- package/dist/chunks/{metric-comparison-DQx-uX__.js → metric-comparison-ljMKYZKa.js} +2 -2
- package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-Ccn1zaxl.js} +1 -1
- package/dist/chunks/{palette-DMJtp3Vn.js → palette-Bsh376zO.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-DOYhqeZb.js → pivot-result-contract-expectations-Bl5suy4-.js} +602 -696
- package/dist/chunks/{pivot-result-identity-CAj8SiRL.js → pivot-result-identity-vS9TSh4f.js} +1 -1
- package/dist/chunks/{raw-temporal-presentation-BmT7z6NH.js → raw-temporal-presentation-BHm7s-hz.js} +230 -274
- package/dist/chunks/{report-preferences-dialog-0sc8B1lh.js → report-preferences-dialog-BV8L0SeS.js} +55 -55
- package/dist/chunks/{report-runtime-context-bYoExeWr.js → report-runtime-context-BZQh9ywy.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-B_C_VAJH.js → resolve-dashboard-input-context-CAMiWvyR.js} +1749 -1989
- package/dist/chunks/{save-DSb1jTtG.js → save-B5EAsgQF.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-BQWM3ldX.js → saved-dashboard-context-n2Wn11cV.js} +57 -57
- package/dist/chunks/{selection-reducer-DSzMWb4x.js → selection-reducer-D0YnaAD9.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-Bz14Oma5.js → semaphor-ready-indicator-XLBLOJ2V.js} +38374 -39104
- package/dist/chunks/{shelf-drop-preview-context-DBHAkgch.js → shelf-drop-preview-context-DHMa54a-.js} +570 -570
- package/dist/chunks/{source-entity-resolution-BOrmNCEM.js → source-entity-resolution-dUG5VWRm.js} +1 -1
- package/dist/chunks/{switch-Dq8XPFpT.js → switch-ByxH4M7t.js} +3 -3
- package/dist/chunks/{table-export-sheet-C_RvEUyO.js → table-export-sheet-C_GdeTYU.js} +1 -1
- package/dist/chunks/{table-settings-DXj_zXwS.js → table-settings-Imz0FgWi.js} +6 -6
- package/dist/chunks/{temporal-input-presentation-AhLSkGPf.js → temporal-input-presentation-uvNK_tM0.js} +1109 -820
- package/dist/chunks/{token-types-LCYMJ3pa.js → token-types-CQtXUVMy.js} +1 -1
- package/dist/chunks/{upload-Dr_WAxHQ.js → upload-wbR-NVzq.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BK3YFkfc.js → use-create-flow-overlay-state-CEBaLOKC.js} +6 -6
- package/dist/chunks/{validators-C87JPd-_.js → validators-CXTneCA4.js} +1206 -1579
- package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-B1n_WjW3.js} +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2207 -1497
- package/dist/data-app-sdk/index.js +5 -5
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +6 -6
- package/dist/format-utils/index.js +181 -176
- package/dist/index.js +22 -22
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/editor/editor-aside/utils.d.ts +1 -1
- package/dist/types/components/visual/data-table/types/data-table.d.ts +5 -20
- package/dist/types/index.js +6 -6
- package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
- package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
- package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
- package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
- package/dist/types/lib/stores/editor-store.d.ts +39 -9
- package/dist/types/lib/stores/table-actions.d.ts +9 -3
- package/dist/types/lib/table-formatting/index.d.ts +0 -2
- package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
- package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
- package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
- package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
- package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
- package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
- package/dist/types/lib/types/common-types.d.ts +40 -47
- package/dist/types/lib/types/explorer-types.d.ts +11 -43
- package/dist/types/lib/utils/card-config-utils.d.ts +8 -0
- package/dist/types/lib/utils/card-definition.d.ts +9 -187
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +159 -513
- package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
- package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
- package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
- package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
- package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
- package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
- package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
- package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
- package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +24 -24
- package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
- package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
- package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
- package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -1
- package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
- package/dist/types/shared/format-utils/index.d.ts +2 -0
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
- package/dist/types/shared/format-utils/raw-temporal.d.ts +15 -1
- package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
- package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
- package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
- package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
- package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
- package/package.json +1 -1
- package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
- package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
- package/dist/chunks/filter-reach-copy-B5Y7FHzg.js +0 -3411
- package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
- package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
|
@@ -1,105 +1,106 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
1
|
+
var Pt = Object.defineProperty;
|
|
2
|
+
var Lt = (e, t, r) => t in e ? Pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var x = (e, t, r) => Lt(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { a$ as et, b0 as jt, b1 as Kt, l as Ht, a3 as Zt, X as F, o as qt } from "./validators-CXTneCA4.js";
|
|
5
5
|
import { z as f } from "zod";
|
|
6
|
-
import { E as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
6
|
+
import { E as tt, l as rt } from "./export-file-format-C-tJsxsf.js";
|
|
7
|
+
import "./matrix-operation-contract-WPv4R-H_.js";
|
|
8
|
+
import { k as Bt, i as V } from "./analytics-base-schemas-CHLxsPfX.js";
|
|
9
|
+
import { b as Vt } from "./report-runtime-context-BZQh9ywy.js";
|
|
10
|
+
import { canonicalizeSupportedLocale as A, canonicalizeSupportedCurrencyCode as ye, DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as Gt } from "../value-format-preferences/index.js";
|
|
11
|
+
import { p as Wt, z as Xt } from "./zoned-wall-clock-B1n_WjW3.js";
|
|
12
|
+
function Q(e) {
|
|
12
13
|
if (!e || typeof e != "object") return !1;
|
|
13
14
|
const t = e.type;
|
|
14
15
|
return t === "number" || t === "currency" || t === "percent" || t === "scientific";
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
17
|
+
function Ya(e) {
|
|
18
|
+
return Q(e) || !!e && typeof e == "object" && e.type === "duration";
|
|
18
19
|
}
|
|
19
|
-
const
|
|
20
|
+
const nt = [
|
|
20
21
|
"day",
|
|
21
22
|
"hour",
|
|
22
23
|
"minute",
|
|
23
24
|
"second",
|
|
24
25
|
"millisecond"
|
|
25
|
-
],
|
|
26
|
+
], ge = {
|
|
26
27
|
day: 864e5,
|
|
27
28
|
hour: 36e5,
|
|
28
29
|
minute: 6e4,
|
|
29
30
|
second: 1e3,
|
|
30
31
|
millisecond: 1
|
|
31
|
-
},
|
|
32
|
+
}, Jt = {
|
|
32
33
|
day: "d",
|
|
33
34
|
hour: "hr",
|
|
34
35
|
minute: "min",
|
|
35
36
|
second: "s",
|
|
36
37
|
millisecond: "ms"
|
|
37
|
-
},
|
|
38
|
+
}, Qt = {
|
|
38
39
|
day: ["day", "days"],
|
|
39
40
|
hour: ["hour", "hours"],
|
|
40
41
|
minute: ["minute", "minutes"],
|
|
41
42
|
second: ["second", "seconds"],
|
|
42
43
|
millisecond: ["millisecond", "milliseconds"]
|
|
43
44
|
};
|
|
44
|
-
function
|
|
45
|
+
function er(e) {
|
|
45
46
|
return e === "day" || e === "hour" || e === "minute" || e === "second" || e === "millisecond";
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
-
return
|
|
48
|
+
function at(e, t) {
|
|
49
|
+
return er(e) ? e : t;
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
return
|
|
51
|
+
function be(e, t) {
|
|
52
|
+
return nt.indexOf(at(e, t));
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
-
const r =
|
|
55
|
-
return
|
|
54
|
+
function tr(e, t) {
|
|
55
|
+
const r = be(e, "day"), n = be(t, "second"), a = Math.min(r, n), i = Math.max(r, n);
|
|
56
|
+
return nt.slice(a, i + 1);
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
-
return e *
|
|
58
|
+
function rr(e, t) {
|
|
59
|
+
return e * ge[at(t, "second")];
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
const r =
|
|
61
|
+
function nr(e, t) {
|
|
62
|
+
const r = tr(t.largestUnit, t.smallestUnit), n = r[r.length - 1], a = ge[n];
|
|
62
63
|
let i = Math.round(e / a) * a;
|
|
63
64
|
return r.map((o) => {
|
|
64
|
-
const
|
|
65
|
-
return i -=
|
|
65
|
+
const c = ge[o], s = Math.floor(i / c);
|
|
66
|
+
return i -= s * c, { unit: o, value: s };
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
function
|
|
69
|
+
function ar(e, t) {
|
|
69
70
|
const r = e.filter((i) => i.value !== 0), n = r.length > 0 ? r : [e[e.length - 1]], a = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : n.length;
|
|
70
|
-
return n.slice(0, a).map((i) => `${i.value}${
|
|
71
|
+
return n.slice(0, a).map((i) => `${i.value}${Jt[i.unit]}`).join(" ");
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
+
function ir(e, t) {
|
|
73
74
|
const r = e.filter((i) => i.value !== 0), n = r.length > 0 ? r : [e[e.length - 1]], a = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : n.length;
|
|
74
75
|
return n.slice(0, a).map((i) => {
|
|
75
|
-
const [o,
|
|
76
|
-
return `${i.value} ${i.value === 1 ? o :
|
|
76
|
+
const [o, c] = Qt[i.unit];
|
|
77
|
+
return `${i.value} ${i.value === 1 ? o : c}`;
|
|
77
78
|
}).join(" ");
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function or(e) {
|
|
80
81
|
const t = e.some(
|
|
81
|
-
(
|
|
82
|
-
), r = e.some((
|
|
82
|
+
(s) => s.unit === "day" && s.value !== 0
|
|
83
|
+
), r = e.some((s) => s.unit === "millisecond"), n = e.findIndex((s) => s.value !== 0), a = Math.max(0, e.length - 2), i = t ? 0 : n === -1 ? a : Math.min(n, a), o = n === -1 ? e.slice(a) : e.slice(i);
|
|
83
84
|
if (o.length === 0)
|
|
84
85
|
return "0";
|
|
85
|
-
const
|
|
86
|
-
return r ?
|
|
86
|
+
const c = o.map((s, u) => s.unit === "millisecond" ? String(s.value).padStart(3, "0") : u === 0 ? String(s.value) : String(s.value).padStart(2, "0")).join(":");
|
|
87
|
+
return r ? c.replace(/:(\d{3})$/, ".$1") : c;
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
+
function sr(e, t, r) {
|
|
89
90
|
const n = `${r.prefix || ""}${e}${r.suffix || ""}`;
|
|
90
91
|
return t ? r.negativeInParentheses ? `(${n})` : `-${n}` : n;
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
+
function cr(e, t = {}) {
|
|
93
94
|
if (e == null)
|
|
94
95
|
return "";
|
|
95
96
|
const r = typeof e == "number" ? e : typeof e == "string" && e.trim() ? Number(e) : NaN;
|
|
96
97
|
if (!Number.isFinite(r))
|
|
97
98
|
return "";
|
|
98
|
-
const n = t.inputUnit || "second", a = t.outputStyle === "digital" || t.outputStyle === "long" ? t.outputStyle : "compact", i = r < 0, o = Math.abs(
|
|
99
|
-
return
|
|
99
|
+
const n = t.inputUnit || "second", a = t.outputStyle === "digital" || t.outputStyle === "long" ? t.outputStyle : "compact", i = r < 0, o = Math.abs(rr(r, n)), c = nr(o, t), s = a === "digital" ? or(c) : a === "long" ? ir(c, t.maxUnits) : ar(c, t.maxUnits);
|
|
100
|
+
return sr(s, i, t);
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
-
return
|
|
102
|
+
function it(e, t) {
|
|
103
|
+
return cr(
|
|
103
104
|
e !== null && typeof e == "object" ? e.value : e,
|
|
104
105
|
{
|
|
105
106
|
inputUnit: t.inputUnit,
|
|
@@ -113,116 +114,119 @@ function Ve(e, t) {
|
|
|
113
114
|
}
|
|
114
115
|
);
|
|
115
116
|
}
|
|
116
|
-
let
|
|
117
|
-
function
|
|
117
|
+
let $e;
|
|
118
|
+
function Me(e, t) {
|
|
118
119
|
const r = e.format;
|
|
119
120
|
return r(t);
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
-
if (
|
|
122
|
+
function ur(e, t) {
|
|
123
|
+
if ($e ?? ($e = Me(
|
|
123
124
|
new Intl.NumberFormat("en-US", { useGrouping: !1, maximumFractionDigits: 6 }),
|
|
124
125
|
"9007199254740993.000009"
|
|
125
|
-
) === "9007199254740993.000009"),
|
|
126
|
+
) === "9007199254740993.000009"), !$e)
|
|
126
127
|
throw new RangeError("This runtime cannot format exact decimal strings.");
|
|
127
128
|
const r = Number(e);
|
|
128
129
|
if (!Number.isFinite(r) || r === 0 && e !== "0")
|
|
129
130
|
throw new RangeError("Exact value is outside the Intl formatting range; use raw text.");
|
|
130
|
-
return
|
|
131
|
+
return Me(t, e);
|
|
131
132
|
}
|
|
132
|
-
function
|
|
133
|
+
function O(e) {
|
|
133
134
|
return typeof e == "number" ? e < 0 : e.value.startsWith("-");
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
-
return typeof e == "number" ? Math.abs(e) :
|
|
136
|
+
function C(e) {
|
|
137
|
+
return typeof e == "number" ? Math.abs(e) : O(e) ? { ...e, value: e.value.slice(1) } : e;
|
|
137
138
|
}
|
|
138
|
-
function
|
|
139
|
+
function lr(e) {
|
|
140
|
+
return typeof e == "number" ? e === 0 : /^-?0*(\.0*)?$/.test(e.value);
|
|
141
|
+
}
|
|
142
|
+
function ot(e, t) {
|
|
139
143
|
return typeof e == "number" ? e * t : {
|
|
140
144
|
kind: "exact_number",
|
|
141
145
|
type: "decimal",
|
|
142
|
-
value:
|
|
146
|
+
value: et(e.value, t)
|
|
143
147
|
};
|
|
144
148
|
}
|
|
145
|
-
function
|
|
149
|
+
function G(e, t) {
|
|
146
150
|
return t === 0 ? e : typeof e == "number" ? e / 10 ** t : {
|
|
147
151
|
kind: "exact_number",
|
|
148
152
|
type: "decimal",
|
|
149
|
-
value:
|
|
153
|
+
value: et(e.value, `1e-${t}`)
|
|
150
154
|
};
|
|
151
155
|
}
|
|
152
|
-
function
|
|
153
|
-
return typeof e == "number" ? t.format(e) :
|
|
156
|
+
function M(e, t) {
|
|
157
|
+
return typeof e == "number" ? t.format(e) : ur(e.value, t);
|
|
154
158
|
}
|
|
155
|
-
function
|
|
159
|
+
function Ne(e) {
|
|
156
160
|
if (!e) return !1;
|
|
157
161
|
const t = e.toLowerCase().replace("_", "-");
|
|
158
162
|
return t === "en-in" || t.startsWith("en-in-");
|
|
159
163
|
}
|
|
160
|
-
function
|
|
161
|
-
const r =
|
|
162
|
-
return n(1e12) ? { power: 12, suffix: "T" } : n(1e9) ? { power: 9, suffix: "B" } :
|
|
164
|
+
function Ie(e, t) {
|
|
165
|
+
const r = C(e), n = (a) => typeof r == "number" ? r >= a : jt(r.value, String(a)) >= 0;
|
|
166
|
+
return n(1e12) ? { power: 12, suffix: "T" } : n(1e9) ? { power: 9, suffix: "B" } : Ne(t) && n(1e7) ? { power: 7, suffix: "Cr" } : n(1e6) ? { power: 6, suffix: "M" } : Ne(t) && n(1e5) ? { power: 5, suffix: "L" } : n(1e3) ? { power: 3, suffix: "K" } : { power: 0, suffix: "" };
|
|
163
167
|
}
|
|
164
|
-
function
|
|
168
|
+
function he(e, t) {
|
|
165
169
|
try {
|
|
166
|
-
const r =
|
|
167
|
-
return
|
|
170
|
+
const r = I(t);
|
|
171
|
+
return Ie(e, r);
|
|
168
172
|
} catch {
|
|
169
|
-
return
|
|
173
|
+
return Ie(e, "en-US");
|
|
170
174
|
}
|
|
171
175
|
}
|
|
172
|
-
const
|
|
173
|
-
function
|
|
176
|
+
const st = 500, Y = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map();
|
|
177
|
+
function D(e, t = {}) {
|
|
174
178
|
const r = `${e}|${JSON.stringify(t)}`;
|
|
175
|
-
let n =
|
|
176
|
-
return n || (n = new Intl.NumberFormat(e, t),
|
|
179
|
+
let n = Y.get(r);
|
|
180
|
+
return n || (n = new Intl.NumberFormat(e, t), Y.size >= st && Y.clear(), Y.set(r, n)), n;
|
|
177
181
|
}
|
|
178
|
-
function
|
|
179
|
-
let t =
|
|
182
|
+
function mr(e) {
|
|
183
|
+
let t = P.get(e);
|
|
180
184
|
if (t === void 0) {
|
|
181
185
|
try {
|
|
182
|
-
|
|
186
|
+
D(e), t = !0;
|
|
183
187
|
} catch {
|
|
184
188
|
t = !1;
|
|
185
189
|
}
|
|
186
|
-
|
|
190
|
+
P.size >= st && P.clear(), P.set(e, t);
|
|
187
191
|
}
|
|
188
192
|
return t;
|
|
189
193
|
}
|
|
190
|
-
function
|
|
191
|
-
return e &&
|
|
194
|
+
function I(e) {
|
|
195
|
+
return e && mr(e) ? e : "en-US";
|
|
192
196
|
}
|
|
193
|
-
function
|
|
197
|
+
function De(e, t) {
|
|
194
198
|
if (e == null || Number.isNaN(e))
|
|
195
199
|
return "";
|
|
196
|
-
const r =
|
|
200
|
+
const r = I(t == null ? void 0 : t.locale);
|
|
197
201
|
let n = e;
|
|
198
|
-
if (t != null && t.multiplyBy && (n =
|
|
199
|
-
const { power: i, suffix: o } =
|
|
200
|
-
n =
|
|
201
|
-
const
|
|
202
|
+
if (t != null && t.multiplyBy && (n = ot(n, t.multiplyBy)), t != null && t.useSuffix) {
|
|
203
|
+
const { power: i, suffix: o } = he(n, r);
|
|
204
|
+
n = G(n, i);
|
|
205
|
+
const c = M(n, D(r, {
|
|
202
206
|
minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
|
|
203
207
|
maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2,
|
|
204
208
|
useGrouping: (t == null ? void 0 : t.useGrouping) ?? !0
|
|
205
209
|
}));
|
|
206
|
-
return `${(t == null ? void 0 : t.prefix) ?? ""}${
|
|
210
|
+
return `${(t == null ? void 0 : t.prefix) ?? ""}${c}${o}${(t == null ? void 0 : t.suffix) ?? ""}`;
|
|
207
211
|
}
|
|
208
|
-
const a =
|
|
212
|
+
const a = M(n, D(r, {
|
|
209
213
|
minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
|
|
210
214
|
maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2,
|
|
211
215
|
useGrouping: (t == null ? void 0 : t.useGrouping) ?? !0
|
|
212
216
|
}));
|
|
213
|
-
if (t != null && t.negativeInParentheses &&
|
|
217
|
+
if (t != null && t.negativeInParentheses && O(n)) {
|
|
214
218
|
const i = a.replace("-", "");
|
|
215
219
|
return `(${(t == null ? void 0 : t.prefix) ?? ""}${i}${(t == null ? void 0 : t.suffix) ?? ""})`;
|
|
216
220
|
}
|
|
217
221
|
return `${(t == null ? void 0 : t.prefix) ?? ""}${a}${(t == null ? void 0 : t.suffix) ?? ""}`;
|
|
218
222
|
}
|
|
219
|
-
function
|
|
223
|
+
function ct(e, t) {
|
|
220
224
|
if (e == null || Number.isNaN(e))
|
|
221
225
|
return "";
|
|
222
|
-
const r =
|
|
226
|
+
const r = I(t == null ? void 0 : t.locale), n = (t == null ? void 0 : t.currency) || "USD", a = O(e), i = !!(t != null && t.negativeInParentheses && a), o = i ? C(e) : e;
|
|
223
227
|
try {
|
|
224
228
|
if (t != null && t.useSuffix) {
|
|
225
|
-
const { power:
|
|
229
|
+
const { power: s, suffix: u } = he(o, r), l = G(o, s), y = `${M(l, D(r, {
|
|
226
230
|
style: "currency",
|
|
227
231
|
currency: n,
|
|
228
232
|
minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
|
|
@@ -231,52 +235,61 @@ function Xe(e, t) {
|
|
|
231
235
|
}))}${u}`;
|
|
232
236
|
return i ? `(${y})` : y;
|
|
233
237
|
}
|
|
234
|
-
const
|
|
238
|
+
const c = M(o, D(r, {
|
|
235
239
|
style: "currency",
|
|
236
240
|
currency: n,
|
|
237
241
|
minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
|
|
238
242
|
maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2,
|
|
239
243
|
useGrouping: (t == null ? void 0 : t.useGrouping) ?? !0
|
|
240
244
|
}));
|
|
241
|
-
return i ? `(${
|
|
245
|
+
return i ? `(${c})` : c;
|
|
242
246
|
} catch {
|
|
243
|
-
const
|
|
244
|
-
|
|
247
|
+
const c = C(e), s = t != null && t.useSuffix ? he(c, r) : { power: 0, suffix: "" }, u = De(
|
|
248
|
+
G(c, s.power),
|
|
245
249
|
{
|
|
246
250
|
locale: r,
|
|
247
251
|
minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
|
|
248
252
|
maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2,
|
|
249
253
|
useGrouping: (t == null ? void 0 : t.useGrouping) ?? !0
|
|
250
254
|
}
|
|
251
|
-
), l = `${n} ${u}${
|
|
255
|
+
), l = `${n} ${u}${s.suffix}`;
|
|
252
256
|
return a ? t != null && t.negativeInParentheses ? `(${l})` : `-${l}` : l;
|
|
253
257
|
}
|
|
254
258
|
}
|
|
255
|
-
function
|
|
259
|
+
function ut(e, t) {
|
|
256
260
|
if (e == null || Number.isNaN(e))
|
|
257
261
|
return "";
|
|
258
|
-
const r =
|
|
259
|
-
return
|
|
262
|
+
const r = I(t == null ? void 0 : t.locale), a = (t == null ? void 0 : t.alreadyPercent) ?? (t == null ? void 0 : t.percentValueMode) === "whole" ? G(e, 2) : e;
|
|
263
|
+
return M(a, D(r, {
|
|
260
264
|
style: "percent",
|
|
261
265
|
minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
|
|
262
266
|
maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2,
|
|
263
267
|
useGrouping: (t == null ? void 0 : t.useGrouping) ?? !0
|
|
264
268
|
}));
|
|
265
269
|
}
|
|
266
|
-
function
|
|
270
|
+
function lt(e, t) {
|
|
267
271
|
if (e == null || Number.isNaN(e))
|
|
268
272
|
return "";
|
|
269
|
-
const r =
|
|
270
|
-
return
|
|
273
|
+
const r = I(t == null ? void 0 : t.locale);
|
|
274
|
+
return M(e, D(r, {
|
|
271
275
|
notation: "scientific",
|
|
272
276
|
minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
|
|
273
277
|
maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2
|
|
274
278
|
}));
|
|
275
279
|
}
|
|
276
|
-
function
|
|
280
|
+
function dr(e, t) {
|
|
281
|
+
const r = t ?? "auto", n = r === "never" ? C(e) : e, a = !O(n) && (r === "always" || r === "exceptZero" && !lr(n));
|
|
282
|
+
return { value: n, plus: a };
|
|
283
|
+
}
|
|
284
|
+
function Pa(e) {
|
|
285
|
+
if (!e || !("signDisplay" in e)) return e;
|
|
286
|
+
const { signDisplay: t, ...r } = e;
|
|
287
|
+
return r;
|
|
288
|
+
}
|
|
289
|
+
function mt(e, t) {
|
|
277
290
|
if (e == null || Number.isNaN(e))
|
|
278
291
|
return "";
|
|
279
|
-
const r = t.scale === void 0 ? e :
|
|
292
|
+
const r = t.scale === void 0 ? e : ot(e, t.scale), n = dr(r, t.signDisplay), a = n.value, i = n.plus ? "+" : "", o = t.negativeStyle === "parentheses" && O(a), c = o ? C(a) : a, s = {
|
|
280
293
|
style: t.type === "number" ? "decimal" : t.type,
|
|
281
294
|
locale: t.locale,
|
|
282
295
|
currency: t.currency,
|
|
@@ -286,42 +299,42 @@ function et(e, t) {
|
|
|
286
299
|
percentValueMode: t.percentValueMode,
|
|
287
300
|
useSuffix: t.compact
|
|
288
301
|
};
|
|
289
|
-
let
|
|
302
|
+
let u;
|
|
290
303
|
switch (t.type) {
|
|
291
304
|
case "currency":
|
|
292
|
-
|
|
305
|
+
u = ct(c, s);
|
|
293
306
|
break;
|
|
294
307
|
case "percent":
|
|
295
|
-
|
|
308
|
+
u = ut(c, s);
|
|
296
309
|
break;
|
|
297
310
|
case "scientific":
|
|
298
|
-
|
|
311
|
+
u = lt(c, s);
|
|
299
312
|
break;
|
|
300
313
|
default:
|
|
301
|
-
|
|
314
|
+
u = De(c, s);
|
|
302
315
|
break;
|
|
303
316
|
}
|
|
304
|
-
const
|
|
305
|
-
return
|
|
317
|
+
const l = `${t.prefix ?? ""}${i}${u}${t.suffix ?? ""}`;
|
|
318
|
+
return o ? `(${l})` : l;
|
|
306
319
|
}
|
|
307
|
-
function
|
|
308
|
-
return t.type === "duration" ? e == null ? "" :
|
|
320
|
+
function La(e, t) {
|
|
321
|
+
return t.type === "duration" ? e == null ? "" : it(e, t) : mt(e, t);
|
|
309
322
|
}
|
|
310
|
-
function
|
|
323
|
+
function ja(e, t, r = "en-US") {
|
|
311
324
|
if (e == null || typeof e == "number" && isNaN(e))
|
|
312
325
|
return "";
|
|
313
326
|
if ((t == null ? void 0 : t.style) === "duration")
|
|
314
|
-
return
|
|
327
|
+
return it(e, {
|
|
315
328
|
...t.duration,
|
|
316
329
|
prefix: t.prefix,
|
|
317
330
|
suffix: t.suffix,
|
|
318
331
|
negativeStyle: t.negativeStyle
|
|
319
332
|
});
|
|
320
|
-
const n =
|
|
321
|
-
return i === "currency" &&
|
|
333
|
+
const n = I((t == null ? void 0 : t.locale) || r), a = (t == null ? void 0 : t.style) || "decimal", i = a === "decimal" ? "number" : a;
|
|
334
|
+
return i === "currency" && D(n, {
|
|
322
335
|
style: "currency",
|
|
323
336
|
currency: (t == null ? void 0 : t.currency) || "USD"
|
|
324
|
-
}),
|
|
337
|
+
}), mt(e, {
|
|
325
338
|
type: i,
|
|
326
339
|
locale: n,
|
|
327
340
|
currency: i === "currency" ? (t == null ? void 0 : t.currency) || "USD" : void 0,
|
|
@@ -336,7 +349,7 @@ function ha(e, t, r = "en-US") {
|
|
|
336
349
|
suffix: t == null ? void 0 : t.suffix
|
|
337
350
|
});
|
|
338
351
|
}
|
|
339
|
-
function
|
|
352
|
+
function Ka(e, t, r) {
|
|
340
353
|
const n = {
|
|
341
354
|
style: t === "currency" ? "currency" : t === "percent" ? "percent" : "decimal",
|
|
342
355
|
locale: r == null ? void 0 : r.locale,
|
|
@@ -351,67 +364,67 @@ function pa(e, t, r) {
|
|
|
351
364
|
};
|
|
352
365
|
switch (t) {
|
|
353
366
|
case "currency":
|
|
354
|
-
return
|
|
367
|
+
return ct(e, n);
|
|
355
368
|
case "percent":
|
|
356
|
-
return
|
|
369
|
+
return ut(e, n);
|
|
357
370
|
case "scientific":
|
|
358
|
-
return
|
|
371
|
+
return lt(e, n);
|
|
359
372
|
default:
|
|
360
|
-
return
|
|
373
|
+
return De(e, n);
|
|
361
374
|
}
|
|
362
375
|
}
|
|
363
|
-
const
|
|
364
|
-
function
|
|
365
|
-
const n =
|
|
376
|
+
const Ha = 6048e5, Za = 864e5, dt = 6e4, ft = 36e5, qa = 525600, Ba = 43200, Va = 1440;
|
|
377
|
+
function Ga(e, t) {
|
|
378
|
+
const n = hr(e);
|
|
366
379
|
let a;
|
|
367
380
|
if (n.date) {
|
|
368
|
-
const
|
|
369
|
-
a =
|
|
381
|
+
const s = pr(n.date, 2);
|
|
382
|
+
a = wr(s.restDateString, s.year);
|
|
370
383
|
}
|
|
371
384
|
if (!a || isNaN(a.getTime()))
|
|
372
385
|
return /* @__PURE__ */ new Date(NaN);
|
|
373
386
|
const i = a.getTime();
|
|
374
|
-
let o = 0,
|
|
375
|
-
if (n.time && (o =
|
|
387
|
+
let o = 0, c;
|
|
388
|
+
if (n.time && (o = Tr(n.time), isNaN(o)))
|
|
376
389
|
return /* @__PURE__ */ new Date(NaN);
|
|
377
390
|
if (n.timezone) {
|
|
378
|
-
if (
|
|
391
|
+
if (c = Sr(n.timezone), isNaN(c))
|
|
379
392
|
return /* @__PURE__ */ new Date(NaN);
|
|
380
393
|
} else {
|
|
381
|
-
const
|
|
394
|
+
const s = new Date(i + o), u = /* @__PURE__ */ new Date(0);
|
|
382
395
|
return u.setFullYear(
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
396
|
+
s.getUTCFullYear(),
|
|
397
|
+
s.getUTCMonth(),
|
|
398
|
+
s.getUTCDate()
|
|
386
399
|
), u.setHours(
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
400
|
+
s.getUTCHours(),
|
|
401
|
+
s.getUTCMinutes(),
|
|
402
|
+
s.getUTCSeconds(),
|
|
403
|
+
s.getUTCMilliseconds()
|
|
391
404
|
), u;
|
|
392
405
|
}
|
|
393
|
-
return new Date(i + o +
|
|
406
|
+
return new Date(i + o + c);
|
|
394
407
|
}
|
|
395
|
-
const
|
|
408
|
+
const L = {
|
|
396
409
|
dateTimeDelimiter: /[T ]/,
|
|
397
410
|
timeZoneDelimiter: /[Z ]/i,
|
|
398
411
|
timezone: /([Z+-].*)$/
|
|
399
|
-
},
|
|
400
|
-
function
|
|
401
|
-
const t = {}, r = e.split(
|
|
412
|
+
}, fr = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, yr = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, gr = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
413
|
+
function hr(e) {
|
|
414
|
+
const t = {}, r = e.split(L.dateTimeDelimiter);
|
|
402
415
|
let n;
|
|
403
416
|
if (r.length > 2)
|
|
404
417
|
return t;
|
|
405
|
-
if (/:/.test(r[0]) ? n = r[0] : (t.date = r[0], n = r[1],
|
|
418
|
+
if (/:/.test(r[0]) ? n = r[0] : (t.date = r[0], n = r[1], L.timeZoneDelimiter.test(t.date) && (t.date = e.split(L.timeZoneDelimiter)[0], n = e.substr(
|
|
406
419
|
t.date.length,
|
|
407
420
|
e.length
|
|
408
421
|
))), n) {
|
|
409
|
-
const a =
|
|
422
|
+
const a = L.timezone.exec(n);
|
|
410
423
|
a ? (t.time = n.replace(a[1], ""), t.timezone = a[1]) : t.time = n;
|
|
411
424
|
}
|
|
412
425
|
return t;
|
|
413
426
|
}
|
|
414
|
-
function
|
|
427
|
+
function pr(e, t) {
|
|
415
428
|
const r = new RegExp(
|
|
416
429
|
"^(?:(\\d{4}|[+-]\\d{" + (4 + t) + "})|(\\d{2}|[+-]\\d{" + (2 + t) + "})$)"
|
|
417
430
|
), n = e.match(r);
|
|
@@ -422,67 +435,67 @@ function Jt(e, t) {
|
|
|
422
435
|
restDateString: e.slice((n[1] || n[2]).length)
|
|
423
436
|
};
|
|
424
437
|
}
|
|
425
|
-
function
|
|
438
|
+
function wr(e, t) {
|
|
426
439
|
if (t === null) return /* @__PURE__ */ new Date(NaN);
|
|
427
|
-
const r = e.match(
|
|
440
|
+
const r = e.match(fr);
|
|
428
441
|
if (!r) return /* @__PURE__ */ new Date(NaN);
|
|
429
|
-
const n = !!r[4], a =
|
|
442
|
+
const n = !!r[4], a = E(r[1]), i = E(r[2]) - 1, o = E(r[3]), c = E(r[4]), s = E(r[5]) - 1;
|
|
430
443
|
if (n)
|
|
431
|
-
return
|
|
444
|
+
return _r(t, c, s) ? Dr(t, c, s) : /* @__PURE__ */ new Date(NaN);
|
|
432
445
|
{
|
|
433
446
|
const u = /* @__PURE__ */ new Date(0);
|
|
434
|
-
return !
|
|
447
|
+
return !vr(t, i, o) || !kr(t, a) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(t, i, Math.max(a, o)), u);
|
|
435
448
|
}
|
|
436
449
|
}
|
|
437
|
-
function
|
|
450
|
+
function E(e) {
|
|
438
451
|
return e ? parseInt(e) : 1;
|
|
439
452
|
}
|
|
440
|
-
function
|
|
441
|
-
const t = e.match(
|
|
453
|
+
function Tr(e) {
|
|
454
|
+
const t = e.match(yr);
|
|
442
455
|
if (!t) return NaN;
|
|
443
|
-
const r =
|
|
444
|
-
return
|
|
456
|
+
const r = ae(t[1]), n = ae(t[2]), a = ae(t[3]);
|
|
457
|
+
return br(r, n, a) ? r * ft + n * dt + a * 1e3 : NaN;
|
|
445
458
|
}
|
|
446
|
-
function
|
|
459
|
+
function ae(e) {
|
|
447
460
|
return e && parseFloat(e.replace(",", ".")) || 0;
|
|
448
461
|
}
|
|
449
|
-
function
|
|
462
|
+
function Sr(e) {
|
|
450
463
|
if (e === "Z") return 0;
|
|
451
|
-
const t = e.match(
|
|
464
|
+
const t = e.match(gr);
|
|
452
465
|
if (!t) return 0;
|
|
453
466
|
const r = t[1] === "+" ? -1 : 1, n = parseInt(t[2]), a = t[3] && parseInt(t[3]) || 0;
|
|
454
|
-
return
|
|
467
|
+
return $r(n, a) ? r * (n * ft + a * dt) : NaN;
|
|
455
468
|
}
|
|
456
|
-
function
|
|
469
|
+
function Dr(e, t, r) {
|
|
457
470
|
const n = /* @__PURE__ */ new Date(0);
|
|
458
471
|
n.setUTCFullYear(e, 0, 4);
|
|
459
472
|
const a = n.getUTCDay() || 7, i = (t - 1) * 7 + r + 1 - a;
|
|
460
473
|
return n.setUTCDate(n.getUTCDate() + i), n;
|
|
461
474
|
}
|
|
462
|
-
const
|
|
463
|
-
function
|
|
475
|
+
const xr = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
476
|
+
function yt(e) {
|
|
464
477
|
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
465
478
|
}
|
|
466
|
-
function
|
|
467
|
-
return t >= 0 && t <= 11 && r >= 1 && r <= (
|
|
479
|
+
function vr(e, t, r) {
|
|
480
|
+
return t >= 0 && t <= 11 && r >= 1 && r <= (xr[t] || (yt(e) ? 29 : 28));
|
|
468
481
|
}
|
|
469
|
-
function
|
|
470
|
-
return t >= 1 && t <= (
|
|
482
|
+
function kr(e, t) {
|
|
483
|
+
return t >= 1 && t <= (yt(e) ? 366 : 365);
|
|
471
484
|
}
|
|
472
|
-
function
|
|
485
|
+
function _r(e, t, r) {
|
|
473
486
|
return t >= 1 && t <= 53 && r >= 0 && r <= 6;
|
|
474
487
|
}
|
|
475
|
-
function
|
|
488
|
+
function br(e, t, r) {
|
|
476
489
|
return e === 24 ? t === 0 && r === 0 : r >= 0 && r < 60 && t >= 0 && t < 60 && e >= 0 && e < 25;
|
|
477
490
|
}
|
|
478
|
-
function
|
|
491
|
+
function $r(e, t) {
|
|
479
492
|
return t >= 0 && t <= 59;
|
|
480
493
|
}
|
|
481
|
-
function
|
|
482
|
-
const r =
|
|
483
|
-
return "formatToParts" in r ?
|
|
494
|
+
function Mr(e, t) {
|
|
495
|
+
const r = Cr(t);
|
|
496
|
+
return "formatToParts" in r ? Ir(r, e) : Er(r, e);
|
|
484
497
|
}
|
|
485
|
-
const
|
|
498
|
+
const Nr = {
|
|
486
499
|
year: 0,
|
|
487
500
|
month: 1,
|
|
488
501
|
day: 2,
|
|
@@ -490,11 +503,11 @@ const lr = {
|
|
|
490
503
|
minute: 4,
|
|
491
504
|
second: 5
|
|
492
505
|
};
|
|
493
|
-
function
|
|
506
|
+
function Ir(e, t) {
|
|
494
507
|
try {
|
|
495
508
|
const r = e.formatToParts(t), n = [];
|
|
496
509
|
for (let a = 0; a < r.length; a++) {
|
|
497
|
-
const i =
|
|
510
|
+
const i = Nr[r[a].type];
|
|
498
511
|
i !== void 0 && (n[i] = parseInt(r[a].value, 10));
|
|
499
512
|
}
|
|
500
513
|
return n;
|
|
@@ -504,7 +517,7 @@ function mr(e, t) {
|
|
|
504
517
|
throw r;
|
|
505
518
|
}
|
|
506
519
|
}
|
|
507
|
-
function
|
|
520
|
+
function Er(e, t) {
|
|
508
521
|
const r = e.format(t), n = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);
|
|
509
522
|
return [
|
|
510
523
|
parseInt(n[3], 10),
|
|
@@ -515,7 +528,7 @@ function dr(e, t) {
|
|
|
515
528
|
parseInt(n[6], 10)
|
|
516
529
|
];
|
|
517
530
|
}
|
|
518
|
-
const
|
|
531
|
+
const ie = {}, Ee = new Intl.DateTimeFormat("en-US", {
|
|
519
532
|
hourCycle: "h23",
|
|
520
533
|
timeZone: "America/New_York",
|
|
521
534
|
year: "numeric",
|
|
@@ -524,9 +537,9 @@ const te = {}, _e = new Intl.DateTimeFormat("en-US", {
|
|
|
524
537
|
hour: "2-digit",
|
|
525
538
|
minute: "2-digit",
|
|
526
539
|
second: "2-digit"
|
|
527
|
-
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")),
|
|
528
|
-
function
|
|
529
|
-
return
|
|
540
|
+
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), Fr = Ee === "06/25/2014, 00:00:00" || Ee === "06/25/2014 00:00:00";
|
|
541
|
+
function Cr(e) {
|
|
542
|
+
return ie[e] || (ie[e] = Fr ? new Intl.DateTimeFormat("en-US", {
|
|
530
543
|
hourCycle: "h23",
|
|
531
544
|
timeZone: e,
|
|
532
545
|
year: "numeric",
|
|
@@ -544,74 +557,74 @@ function yr(e) {
|
|
|
544
557
|
hour: "2-digit",
|
|
545
558
|
minute: "2-digit",
|
|
546
559
|
second: "2-digit"
|
|
547
|
-
})),
|
|
560
|
+
})), ie[e];
|
|
548
561
|
}
|
|
549
|
-
function
|
|
550
|
-
const
|
|
551
|
-
return
|
|
562
|
+
function xe(e, t, r, n, a, i, o) {
|
|
563
|
+
const c = /* @__PURE__ */ new Date(0);
|
|
564
|
+
return c.setUTCFullYear(e, t, r), c.setUTCHours(n, a, i, o), c;
|
|
552
565
|
}
|
|
553
|
-
const
|
|
566
|
+
const Fe = 36e5, Ur = 6e4, oe = {
|
|
554
567
|
timezoneZ: /^(Z)$/,
|
|
555
568
|
timezoneHH: /^([+-]\d{2})$/,
|
|
556
569
|
timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
|
|
557
570
|
};
|
|
558
|
-
function
|
|
571
|
+
function gt(e, t, r) {
|
|
559
572
|
if (!e)
|
|
560
573
|
return 0;
|
|
561
|
-
let n =
|
|
574
|
+
let n = oe.timezoneZ.exec(e);
|
|
562
575
|
if (n)
|
|
563
576
|
return 0;
|
|
564
577
|
let a, i;
|
|
565
|
-
if (n =
|
|
566
|
-
return a = parseInt(n[1], 10),
|
|
567
|
-
if (n =
|
|
578
|
+
if (n = oe.timezoneHH.exec(e), n)
|
|
579
|
+
return a = parseInt(n[1], 10), Ce(a) ? -(a * Fe) : NaN;
|
|
580
|
+
if (n = oe.timezoneHHMM.exec(e), n) {
|
|
568
581
|
a = parseInt(n[2], 10);
|
|
569
582
|
const o = parseInt(n[3], 10);
|
|
570
|
-
return
|
|
583
|
+
return Ce(a, o) ? (i = Math.abs(a) * Fe + o * Ur, n[1] === "+" ? -i : i) : NaN;
|
|
571
584
|
}
|
|
572
|
-
if (
|
|
585
|
+
if (Or(e)) {
|
|
573
586
|
t = new Date(t || Date.now());
|
|
574
|
-
const o = r ? t :
|
|
575
|
-
return -(r ?
|
|
587
|
+
const o = r ? t : zr(t), c = pe(o, e);
|
|
588
|
+
return -(r ? c : Ar(t, c, e));
|
|
576
589
|
}
|
|
577
590
|
return NaN;
|
|
578
591
|
}
|
|
579
|
-
function
|
|
580
|
-
return
|
|
592
|
+
function zr(e) {
|
|
593
|
+
return xe(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
|
|
581
594
|
}
|
|
582
|
-
function
|
|
583
|
-
const r =
|
|
595
|
+
function pe(e, t) {
|
|
596
|
+
const r = Mr(e, t), n = xe(r[0], r[1] - 1, r[2], r[3] % 24, r[4], r[5], 0).getTime();
|
|
584
597
|
let a = e.getTime();
|
|
585
598
|
const i = a % 1e3;
|
|
586
599
|
return a -= i >= 0 ? i : 1e3 + i, n - a;
|
|
587
600
|
}
|
|
588
|
-
function
|
|
601
|
+
function Ar(e, t, r) {
|
|
589
602
|
let a = e.getTime() - t;
|
|
590
|
-
const i =
|
|
603
|
+
const i = pe(new Date(a), r);
|
|
591
604
|
if (t === i)
|
|
592
605
|
return t;
|
|
593
606
|
a -= i - t;
|
|
594
|
-
const o =
|
|
607
|
+
const o = pe(new Date(a), r);
|
|
595
608
|
return i === o ? i : Math.max(i, o);
|
|
596
609
|
}
|
|
597
|
-
function
|
|
610
|
+
function Ce(e, t) {
|
|
598
611
|
return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
|
|
599
612
|
}
|
|
600
|
-
const
|
|
601
|
-
function
|
|
602
|
-
if (
|
|
613
|
+
const Ue = {};
|
|
614
|
+
function Or(e) {
|
|
615
|
+
if (Ue[e])
|
|
603
616
|
return !0;
|
|
604
617
|
try {
|
|
605
|
-
return new Intl.DateTimeFormat(void 0, { timeZone: e }),
|
|
618
|
+
return new Intl.DateTimeFormat(void 0, { timeZone: e }), Ue[e] = !0, !0;
|
|
606
619
|
} catch {
|
|
607
620
|
return !1;
|
|
608
621
|
}
|
|
609
622
|
}
|
|
610
|
-
function
|
|
623
|
+
function ze(e) {
|
|
611
624
|
const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
|
|
612
625
|
return t.setUTCFullYear(e.getFullYear()), +e - +t;
|
|
613
626
|
}
|
|
614
|
-
const
|
|
627
|
+
const ht = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, se = 36e5, Ae = 6e4, Rr = 2, w = {
|
|
615
628
|
dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
|
|
616
629
|
datePattern: /^([0-9W+-]+)(.*)/,
|
|
617
630
|
// year tokens
|
|
@@ -643,14 +656,14 @@ const it = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)
|
|
|
643
656
|
HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
644
657
|
HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
645
658
|
// time zone tokens (to identify the presence of a tz)
|
|
646
|
-
timeZone:
|
|
659
|
+
timeZone: ht
|
|
647
660
|
};
|
|
648
|
-
function
|
|
661
|
+
function Oe(e, t = {}) {
|
|
649
662
|
if (arguments.length < 1)
|
|
650
663
|
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
651
664
|
if (e === null)
|
|
652
665
|
return /* @__PURE__ */ new Date(NaN);
|
|
653
|
-
const r = t.additionalDigits == null ?
|
|
666
|
+
const r = t.additionalDigits == null ? Rr : Number(t.additionalDigits);
|
|
654
667
|
if (r !== 2 && r !== 1 && r !== 0)
|
|
655
668
|
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
656
669
|
if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
|
|
@@ -659,36 +672,36 @@ function Ee(e, t = {}) {
|
|
|
659
672
|
return new Date(e);
|
|
660
673
|
if (Object.prototype.toString.call(e) !== "[object String]")
|
|
661
674
|
return /* @__PURE__ */ new Date(NaN);
|
|
662
|
-
const n =
|
|
675
|
+
const n = Yr(e), { year: a, restDateString: i } = Pr(n.date, r), o = Lr(i, a);
|
|
663
676
|
if (o === null || isNaN(o.getTime()))
|
|
664
677
|
return /* @__PURE__ */ new Date(NaN);
|
|
665
678
|
if (o) {
|
|
666
|
-
const
|
|
667
|
-
let
|
|
668
|
-
if (n.time && (
|
|
679
|
+
const c = o.getTime();
|
|
680
|
+
let s = 0, u;
|
|
681
|
+
if (n.time && (s = jr(n.time), s === null || isNaN(s)))
|
|
669
682
|
return /* @__PURE__ */ new Date(NaN);
|
|
670
683
|
if (n.timeZone || t.timeZone) {
|
|
671
|
-
if (u =
|
|
684
|
+
if (u = gt(n.timeZone || t.timeZone, new Date(c + s)), isNaN(u))
|
|
672
685
|
return /* @__PURE__ */ new Date(NaN);
|
|
673
686
|
} else
|
|
674
|
-
u =
|
|
675
|
-
return new Date(
|
|
687
|
+
u = ze(new Date(c + s)), u = ze(new Date(c + s + u));
|
|
688
|
+
return new Date(c + s + u);
|
|
676
689
|
} else
|
|
677
690
|
return /* @__PURE__ */ new Date(NaN);
|
|
678
691
|
}
|
|
679
|
-
function
|
|
692
|
+
function Yr(e) {
|
|
680
693
|
const t = {};
|
|
681
|
-
let r =
|
|
682
|
-
if (r ? (t.date = r[1], n = r[3]) : (r =
|
|
683
|
-
const a =
|
|
694
|
+
let r = w.dateTimePattern.exec(e), n;
|
|
695
|
+
if (r ? (t.date = r[1], n = r[3]) : (r = w.datePattern.exec(e), r ? (t.date = r[1], n = r[2]) : (t.date = null, n = e)), n) {
|
|
696
|
+
const a = w.timeZone.exec(n);
|
|
684
697
|
a ? (t.time = n.replace(a[1], ""), t.timeZone = a[1].trim()) : t.time = n;
|
|
685
698
|
}
|
|
686
699
|
return t;
|
|
687
700
|
}
|
|
688
|
-
function
|
|
701
|
+
function Pr(e, t) {
|
|
689
702
|
if (e) {
|
|
690
|
-
const r =
|
|
691
|
-
let a =
|
|
703
|
+
const r = w.YYY[t], n = w.YYYYY[t];
|
|
704
|
+
let a = w.YYYY.exec(e) || n.exec(e);
|
|
692
705
|
if (a) {
|
|
693
706
|
const i = a[1];
|
|
694
707
|
return {
|
|
@@ -696,7 +709,7 @@ function vr(e, t) {
|
|
|
696
709
|
restDateString: e.slice(i.length)
|
|
697
710
|
};
|
|
698
711
|
}
|
|
699
|
-
if (a =
|
|
712
|
+
if (a = w.YY.exec(e) || r.exec(e), a) {
|
|
700
713
|
const i = a[1];
|
|
701
714
|
return {
|
|
702
715
|
year: parseInt(i, 10) * 100,
|
|
@@ -708,155 +721,339 @@ function vr(e, t) {
|
|
|
708
721
|
year: null
|
|
709
722
|
};
|
|
710
723
|
}
|
|
711
|
-
function
|
|
724
|
+
function Lr(e, t) {
|
|
712
725
|
if (t === null)
|
|
713
726
|
return null;
|
|
714
727
|
let r, n, a;
|
|
715
728
|
if (!e || !e.length)
|
|
716
729
|
return r = /* @__PURE__ */ new Date(0), r.setUTCFullYear(t), r;
|
|
717
|
-
let i =
|
|
730
|
+
let i = w.MM.exec(e);
|
|
718
731
|
if (i)
|
|
719
|
-
return r = /* @__PURE__ */ new Date(0), n = parseInt(i[1], 10) - 1,
|
|
720
|
-
if (i =
|
|
732
|
+
return r = /* @__PURE__ */ new Date(0), n = parseInt(i[1], 10) - 1, Ye(t, n) ? (r.setUTCFullYear(t, n), r) : /* @__PURE__ */ new Date(NaN);
|
|
733
|
+
if (i = w.DDD.exec(e), i) {
|
|
721
734
|
r = /* @__PURE__ */ new Date(0);
|
|
722
735
|
const o = parseInt(i[1], 10);
|
|
723
|
-
return
|
|
736
|
+
return Zr(t, o) ? (r.setUTCFullYear(t, 0, o), r) : /* @__PURE__ */ new Date(NaN);
|
|
724
737
|
}
|
|
725
|
-
if (i =
|
|
738
|
+
if (i = w.MMDD.exec(e), i) {
|
|
726
739
|
r = /* @__PURE__ */ new Date(0), n = parseInt(i[1], 10) - 1;
|
|
727
740
|
const o = parseInt(i[2], 10);
|
|
728
|
-
return
|
|
741
|
+
return Ye(t, n, o) ? (r.setUTCFullYear(t, n, o), r) : /* @__PURE__ */ new Date(NaN);
|
|
729
742
|
}
|
|
730
|
-
if (i =
|
|
731
|
-
return a = parseInt(i[1], 10) - 1,
|
|
732
|
-
if (i =
|
|
743
|
+
if (i = w.Www.exec(e), i)
|
|
744
|
+
return a = parseInt(i[1], 10) - 1, Pe(a) ? Re(t, a) : /* @__PURE__ */ new Date(NaN);
|
|
745
|
+
if (i = w.WwwD.exec(e), i) {
|
|
733
746
|
a = parseInt(i[1], 10) - 1;
|
|
734
747
|
const o = parseInt(i[2], 10) - 1;
|
|
735
|
-
return
|
|
748
|
+
return Pe(a, o) ? Re(t, a, o) : /* @__PURE__ */ new Date(NaN);
|
|
736
749
|
}
|
|
737
750
|
return null;
|
|
738
751
|
}
|
|
739
|
-
function
|
|
740
|
-
let t, r, n =
|
|
752
|
+
function jr(e) {
|
|
753
|
+
let t, r, n = w.HH.exec(e);
|
|
741
754
|
if (n)
|
|
742
|
-
return t = parseFloat(n[1].replace(",", ".")),
|
|
743
|
-
if (n =
|
|
744
|
-
return t = parseInt(n[1], 10), r = parseFloat(n[2].replace(",", ".")),
|
|
745
|
-
if (n =
|
|
755
|
+
return t = parseFloat(n[1].replace(",", ".")), ce(t) ? t % 24 * se : NaN;
|
|
756
|
+
if (n = w.HHMM.exec(e), n)
|
|
757
|
+
return t = parseInt(n[1], 10), r = parseFloat(n[2].replace(",", ".")), ce(t, r) ? t % 24 * se + r * Ae : NaN;
|
|
758
|
+
if (n = w.HHMMSS.exec(e), n) {
|
|
746
759
|
t = parseInt(n[1], 10), r = parseInt(n[2], 10);
|
|
747
760
|
const a = parseFloat(n[3].replace(",", "."));
|
|
748
|
-
return
|
|
761
|
+
return ce(t, r, a) ? t % 24 * se + r * Ae + a * 1e3 : NaN;
|
|
749
762
|
}
|
|
750
763
|
return null;
|
|
751
764
|
}
|
|
752
|
-
function
|
|
765
|
+
function Re(e, t, r) {
|
|
753
766
|
t = t || 0, r = r || 0;
|
|
754
767
|
const n = /* @__PURE__ */ new Date(0);
|
|
755
768
|
n.setUTCFullYear(e, 0, 4);
|
|
756
769
|
const a = n.getUTCDay() || 7, i = t * 7 + r + 1 - a;
|
|
757
770
|
return n.setUTCDate(n.getUTCDate() + i), n;
|
|
758
771
|
}
|
|
759
|
-
const
|
|
760
|
-
function
|
|
772
|
+
const Kr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Hr = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
773
|
+
function pt(e) {
|
|
761
774
|
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
762
775
|
}
|
|
763
|
-
function
|
|
776
|
+
function Ye(e, t, r) {
|
|
764
777
|
if (t < 0 || t > 11)
|
|
765
778
|
return !1;
|
|
766
779
|
if (r != null) {
|
|
767
780
|
if (r < 1)
|
|
768
781
|
return !1;
|
|
769
|
-
const n =
|
|
770
|
-
if (n && r >
|
|
782
|
+
const n = pt(e);
|
|
783
|
+
if (n && r > Hr[t] || !n && r > Kr[t])
|
|
771
784
|
return !1;
|
|
772
785
|
}
|
|
773
786
|
return !0;
|
|
774
787
|
}
|
|
775
|
-
function
|
|
788
|
+
function Zr(e, t) {
|
|
776
789
|
if (t < 1)
|
|
777
790
|
return !1;
|
|
778
|
-
const r =
|
|
791
|
+
const r = pt(e);
|
|
779
792
|
return !(r && t > 366 || !r && t > 365);
|
|
780
793
|
}
|
|
781
|
-
function
|
|
794
|
+
function Pe(e, t) {
|
|
782
795
|
return !(e < 0 || e > 52 || t != null && (t < 0 || t > 6));
|
|
783
796
|
}
|
|
784
|
-
function
|
|
797
|
+
function ce(e, t, r) {
|
|
785
798
|
return !(e < 0 || e >= 25 || t != null && (t < 0 || t >= 60) || r != null && (r < 0 || r >= 60));
|
|
786
799
|
}
|
|
787
|
-
function
|
|
788
|
-
if (typeof e == "string" && !e.match(
|
|
789
|
-
return
|
|
790
|
-
e =
|
|
791
|
-
const n =
|
|
800
|
+
function ee(e, t, r) {
|
|
801
|
+
if (typeof e == "string" && !e.match(ht))
|
|
802
|
+
return Oe(e, { ...r, timeZone: t });
|
|
803
|
+
e = Oe(e, r);
|
|
804
|
+
const n = xe(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), a = gt(t, new Date(n));
|
|
792
805
|
return new Date(n + a);
|
|
793
806
|
}
|
|
794
|
-
const
|
|
795
|
-
function
|
|
807
|
+
const qr = 5 * 1024 * 1024, Wa = 64 * 1024 * 1024, W = f.number().int().positive().max(Number.MAX_SAFE_INTEGER), H = f.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER), X = H.refine((e) => e > 0), Br = (e) => !!e && e !== "." && e !== ".." && !e.includes("/") && !e.includes("\\");
|
|
808
|
+
function _(e, t) {
|
|
796
809
|
const r = t.split("/");
|
|
797
|
-
if (r.length !== 5 || r[0] !== "exports" || r[1] !== e || r[2] !== "attempts" || !r.every(
|
|
810
|
+
if (r.length !== 5 || r[0] !== "exports" || r[1] !== e || r[2] !== "attempts" || !r.every(Br))
|
|
798
811
|
throw new Error("Invalid Matrix export artifact namespace.");
|
|
799
812
|
return { attemptId: r[3], filename: r[4] };
|
|
800
813
|
}
|
|
801
|
-
function
|
|
814
|
+
function Xa(e, t, r) {
|
|
802
815
|
const n = `exports/${e}/attempts/${t}/${r}`;
|
|
803
|
-
return
|
|
816
|
+
return _(e, n), n;
|
|
804
817
|
}
|
|
805
|
-
const
|
|
818
|
+
const Ja = f.object({
|
|
806
819
|
acquisition: f.literal("continuation"),
|
|
807
820
|
jobId: f.string().min(1),
|
|
808
|
-
sequence:
|
|
809
|
-
deadlineAt:
|
|
810
|
-
}),
|
|
821
|
+
sequence: X,
|
|
822
|
+
deadlineAt: W
|
|
823
|
+
}), Vr = [
|
|
811
824
|
"application/json",
|
|
812
|
-
...
|
|
813
|
-
],
|
|
825
|
+
...tt.map((e) => rt(e).partContentType)
|
|
826
|
+
], Gr = f.object({
|
|
814
827
|
key: f.string(),
|
|
815
828
|
content: f.string(),
|
|
816
|
-
contentType: f.enum(
|
|
829
|
+
contentType: f.enum(Vr),
|
|
817
830
|
encoding: f.literal("gzip-base64").optional()
|
|
818
831
|
// Transport-only compression: JSON (layout, sheet layout) and Excel rows. CSV travels as it always has.
|
|
819
|
-
}).refine((e) => !e.encoding || e.contentType === "application/json" || e.contentType ===
|
|
820
|
-
f.object({ kind: f.literal("work"), sequence:
|
|
821
|
-
f.object({ kind: f.literal("committed"), sequence:
|
|
832
|
+
}).refine((e) => !e.encoding || e.contentType === "application/json" || e.contentType === rt("xlsx").partContentType, "Unsupported Matrix artifact encoding."), Wr = f.discriminatedUnion("kind", [
|
|
833
|
+
f.object({ kind: f.literal("work"), sequence: X, checkpointKey: f.string(), objects: f.array(Gr).min(2).max(4), deadlineAt: W }),
|
|
834
|
+
f.object({ kind: f.literal("committed"), sequence: X, done: f.boolean(), deadlineAt: W })
|
|
822
835
|
]);
|
|
823
|
-
function
|
|
836
|
+
function Xr(e) {
|
|
824
837
|
const t = JSON.stringify(e);
|
|
825
|
-
if (t === void 0 || new TextEncoder().encode(t).byteLength >
|
|
838
|
+
if (t === void 0 || new TextEncoder().encode(t).byteLength > qr)
|
|
826
839
|
throw new RangeError("Matrix export batch exceeds its transport byte limit.");
|
|
827
840
|
}
|
|
828
|
-
function
|
|
829
|
-
const r =
|
|
830
|
-
if (
|
|
841
|
+
function Qa(e, t) {
|
|
842
|
+
const r = Wr.parse(e);
|
|
843
|
+
if (Xr(e), r.deadlineAt !== t.deadlineAt) throw new Error("Matrix deadline does not match the job.");
|
|
831
844
|
if (r.sequence !== t.sequence + (r.kind === "committed" ? 1 : 0))
|
|
832
845
|
throw new Error("Invalid Matrix batch sequence.");
|
|
833
846
|
if (r.kind === "work") {
|
|
834
|
-
|
|
847
|
+
_(t.jobId, r.checkpointKey);
|
|
835
848
|
for (const n of r.objects)
|
|
836
|
-
|
|
849
|
+
_(t.jobId, n.key);
|
|
837
850
|
}
|
|
838
851
|
return r;
|
|
839
852
|
}
|
|
840
|
-
const
|
|
853
|
+
const Jr = f.object({
|
|
841
854
|
acquisition: f.literal("continuation"),
|
|
842
|
-
deadlineAt:
|
|
843
|
-
chunks: f.array(f.object({ chunkNumber:
|
|
844
|
-
totalRows:
|
|
845
|
-
totalBytes:
|
|
855
|
+
deadlineAt: W,
|
|
856
|
+
chunks: f.array(f.object({ chunkNumber: X, dataKey: f.string() })).min(1),
|
|
857
|
+
totalRows: H,
|
|
858
|
+
totalBytes: H,
|
|
846
859
|
fileKey: f.string().min(1).optional(),
|
|
847
|
-
fileSize:
|
|
860
|
+
fileSize: H.optional(),
|
|
848
861
|
/** The file the job writes; absent means CSV (manifests from before Excel). */
|
|
849
|
-
format: f.enum(
|
|
862
|
+
format: f.enum(tt).optional(),
|
|
850
863
|
/** Excel only: the sheet layout the layout batch stored, which compaction wraps the rows in. */
|
|
851
864
|
sheetKey: f.string().min(1).optional()
|
|
852
865
|
}).refine((e) => e.fileKey === void 0 == (e.fileSize === void 0), "Incomplete published Matrix artifact.").refine((e) => e.format === "xlsx" == (e.sheetKey !== void 0), "An Excel Matrix manifest names its sheet layout, and only it does.");
|
|
853
|
-
function
|
|
854
|
-
const n =
|
|
866
|
+
function ei(e, t, r) {
|
|
867
|
+
const n = Jr.parse(e);
|
|
855
868
|
if (n.deadlineAt !== r) throw new Error("Matrix deadline does not match the job.");
|
|
856
869
|
return n.chunks.forEach((a, i) => {
|
|
857
870
|
if (a.chunkNumber !== i + 1) throw new Error("Invalid committed Matrix chunk order.");
|
|
858
|
-
|
|
859
|
-
}), n.fileKey !== void 0 &&
|
|
871
|
+
_(t, a.dataKey);
|
|
872
|
+
}), n.fileKey !== void 0 && _(t, n.fileKey), n.sheetKey !== void 0 && _(t, n.sheetKey), n;
|
|
873
|
+
}
|
|
874
|
+
const Qr = "en-US", Le = [
|
|
875
|
+
"compact",
|
|
876
|
+
"maximumFractionDigits",
|
|
877
|
+
"minimumFractionDigits",
|
|
878
|
+
"negativeStyle",
|
|
879
|
+
"type",
|
|
880
|
+
"useGrouping"
|
|
881
|
+
];
|
|
882
|
+
function en(e) {
|
|
883
|
+
if (e.type !== "currency" || Object.prototype.hasOwnProperty.call(e, "currency") || Object.prototype.hasOwnProperty.call(e, "locale"))
|
|
884
|
+
return !1;
|
|
885
|
+
const t = Object.keys(e).sort();
|
|
886
|
+
return t.length === Le.length && Le.every(
|
|
887
|
+
(r, n) => t[n] === r
|
|
888
|
+
) && typeof e.minimumFractionDigits == "number" && typeof e.maximumFractionDigits == "number" && e.useGrouping === !0 && e.negativeStyle === "minus" && typeof e.compact == "boolean";
|
|
889
|
+
}
|
|
890
|
+
function je(e) {
|
|
891
|
+
if (typeof e != "string")
|
|
892
|
+
return;
|
|
893
|
+
const t = e.trim();
|
|
894
|
+
if (!(!t || t.toLowerCase() === "none"))
|
|
895
|
+
return t;
|
|
896
|
+
}
|
|
897
|
+
function Z(e) {
|
|
898
|
+
if (!(typeof e != "number" || !Number.isFinite(e)))
|
|
899
|
+
return Math.max(0, Math.min(10, Math.trunc(e)));
|
|
900
|
+
}
|
|
901
|
+
function tn(e) {
|
|
902
|
+
return e === "currency" ? 2 : e === "percent" ? 1 : e === "scientific" ? 2 : 0;
|
|
903
|
+
}
|
|
904
|
+
function rn(e, t, r) {
|
|
905
|
+
const n = Z(t.minimumFractionDigits), a = Z(t.maximumFractionDigits);
|
|
906
|
+
if (typeof n == "number" || typeof a == "number") {
|
|
907
|
+
const c = n ?? 0, s = a ?? Math.max(c, 2);
|
|
908
|
+
return {
|
|
909
|
+
minimumFractionDigits: Math.min(c, s),
|
|
910
|
+
maximumFractionDigits: Math.max(c, s)
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
const i = Z(t.decimals);
|
|
914
|
+
if (typeof i == "number")
|
|
915
|
+
return {
|
|
916
|
+
minimumFractionDigits: i,
|
|
917
|
+
maximumFractionDigits: i
|
|
918
|
+
};
|
|
919
|
+
if (r != null && r.preserveOmittedProperties)
|
|
920
|
+
return {};
|
|
921
|
+
const o = tn(e);
|
|
922
|
+
return {
|
|
923
|
+
minimumFractionDigits: o,
|
|
924
|
+
maximumFractionDigits: o
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
function nn(e, t) {
|
|
928
|
+
if (!(typeof t != "string" || e === "percent" && t === "%"))
|
|
929
|
+
return t;
|
|
930
|
+
}
|
|
931
|
+
function Ke(e) {
|
|
932
|
+
const t = je(e.locale), r = je(e.currency), n = nn(e.type, e.suffix);
|
|
933
|
+
return {
|
|
934
|
+
...e,
|
|
935
|
+
...t !== e.locale ? { locale: t } : {},
|
|
936
|
+
...r !== e.currency ? { currency: r } : {},
|
|
937
|
+
...n !== e.suffix ? { suffix: n } : {}
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
function v(e, t, r) {
|
|
941
|
+
const n = { ...t, type: e };
|
|
942
|
+
if ((r == null ? void 0 : r.numericInput) === "canonical" && Q(n))
|
|
943
|
+
return Ke(n);
|
|
944
|
+
const a = rn(e, t, r), i = typeof t.prefix == "string" ? t.prefix : void 0, o = {
|
|
945
|
+
type: e,
|
|
946
|
+
locale: t.locale,
|
|
947
|
+
minimumFractionDigits: a.minimumFractionDigits,
|
|
948
|
+
maximumFractionDigits: a.maximumFractionDigits,
|
|
949
|
+
useGrouping: typeof t.useGrouping == "boolean" ? t.useGrouping : typeof t.thousandsSeparator == "boolean" ? t.thousandsSeparator : !0,
|
|
950
|
+
prefix: i,
|
|
951
|
+
suffix: t.suffix,
|
|
952
|
+
negativeStyle: t.negativeStyle || "minus",
|
|
953
|
+
compact: !!t.compact,
|
|
954
|
+
scale: typeof t.scale == "number" ? t.scale : void 0,
|
|
955
|
+
...t.signDisplay ? { signDisplay: t.signDisplay } : {}
|
|
956
|
+
};
|
|
957
|
+
return e === "currency" && t.currency && (o.currency = t.currency), e === "percent" && (o.percentValueMode = t.percentValueMode || "fraction"), Ke(o);
|
|
958
|
+
}
|
|
959
|
+
function He(e) {
|
|
960
|
+
return {
|
|
961
|
+
type: "date",
|
|
962
|
+
locale: e.locale || Qr,
|
|
963
|
+
pattern: e.pattern,
|
|
964
|
+
// A stored pattern's token set and a preset carry to every reader (column formats ledger P5-45).
|
|
965
|
+
...e.dialect ? { dialect: e.dialect } : {},
|
|
966
|
+
...e.preset ? { preset: e.preset } : {},
|
|
967
|
+
relative: !!e.relative,
|
|
968
|
+
timezone: e.timezone,
|
|
969
|
+
sourceTimezone: e.sourceTimezone,
|
|
970
|
+
prefix: e.prefix,
|
|
971
|
+
suffix: e.suffix
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
function ue(e) {
|
|
975
|
+
return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
|
|
976
|
+
}
|
|
977
|
+
function Ze(e) {
|
|
978
|
+
const t = Z(e.maxUnits);
|
|
979
|
+
return {
|
|
980
|
+
type: "duration",
|
|
981
|
+
inputUnit: ue(e.inputUnit) ? e.inputUnit : "second",
|
|
982
|
+
outputStyle: e.outputStyle === "digital" || e.outputStyle === "long" ? e.outputStyle : "compact",
|
|
983
|
+
largestUnit: ue(e.largestUnit) ? e.largestUnit : void 0,
|
|
984
|
+
smallestUnit: ue(e.smallestUnit) ? e.smallestUnit : "second",
|
|
985
|
+
maxUnits: t,
|
|
986
|
+
prefix: e.prefix,
|
|
987
|
+
suffix: e.suffix,
|
|
988
|
+
negativeStyle: e.negativeStyle || "minus"
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
function qe(e) {
|
|
992
|
+
return {
|
|
993
|
+
type: "string",
|
|
994
|
+
prefix: e.prefix,
|
|
995
|
+
suffix: e.suffix
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
function ti(e, t) {
|
|
999
|
+
if (!e)
|
|
1000
|
+
return;
|
|
1001
|
+
if (typeof e == "string") {
|
|
1002
|
+
const n = e.trim().toLowerCase();
|
|
1003
|
+
return n === "currency" ? v(
|
|
1004
|
+
"currency",
|
|
1005
|
+
{ type: "currency" },
|
|
1006
|
+
t
|
|
1007
|
+
) : n === "percentage" || n === "percent" ? v(
|
|
1008
|
+
"percent",
|
|
1009
|
+
{
|
|
1010
|
+
type: "percentage",
|
|
1011
|
+
percentValueMode: "fraction"
|
|
1012
|
+
},
|
|
1013
|
+
t
|
|
1014
|
+
) : n === "scientific" ? v(
|
|
1015
|
+
"scientific",
|
|
1016
|
+
{ type: "scientific" },
|
|
1017
|
+
t
|
|
1018
|
+
) : n === "date" ? He({}) : n === "duration" ? Ze({}) : n === "string" ? qe({}) : n === "number" ? v(
|
|
1019
|
+
"number",
|
|
1020
|
+
{ type: "number" },
|
|
1021
|
+
t
|
|
1022
|
+
) : void 0;
|
|
1023
|
+
}
|
|
1024
|
+
if ("type" in e && e.type === "temporal_bucket") {
|
|
1025
|
+
const n = Bt.safeParse(e);
|
|
1026
|
+
return n.success ? n.data : void 0;
|
|
1027
|
+
}
|
|
1028
|
+
const r = e;
|
|
1029
|
+
if ((t == null ? void 0 : t.numericInput) === "canonical") {
|
|
1030
|
+
const n = r.type === "percentage" ? { ...r, type: "percent" } : r;
|
|
1031
|
+
if (Q(n))
|
|
1032
|
+
return v(n.type, n, t);
|
|
1033
|
+
}
|
|
1034
|
+
if (r.type === "percentage")
|
|
1035
|
+
return v(
|
|
1036
|
+
"percent",
|
|
1037
|
+
{
|
|
1038
|
+
...r,
|
|
1039
|
+
percentValueMode: r.percentValueMode || "fraction"
|
|
1040
|
+
},
|
|
1041
|
+
t
|
|
1042
|
+
);
|
|
1043
|
+
if (r.type === "number" || r.type === "currency" || r.type === "percent" || r.type === "scientific") {
|
|
1044
|
+
const n = v(
|
|
1045
|
+
r.type,
|
|
1046
|
+
r,
|
|
1047
|
+
t
|
|
1048
|
+
);
|
|
1049
|
+
return en(r) ? { ...n, currency: "USD" } : n;
|
|
1050
|
+
}
|
|
1051
|
+
if (r.type === "date")
|
|
1052
|
+
return He(r);
|
|
1053
|
+
if (r.type === "duration")
|
|
1054
|
+
return Ze(r);
|
|
1055
|
+
if (r.type === "string")
|
|
1056
|
+
return qe(r);
|
|
860
1057
|
}
|
|
861
1058
|
function g(e) {
|
|
862
1059
|
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
@@ -869,7 +1066,7 @@ function g(e) {
|
|
|
869
1066
|
) ? t.constructor : void 0;
|
|
870
1067
|
return typeof r == "function" && Function.prototype.toString.call(r) === Function.prototype.toString.call(Object);
|
|
871
1068
|
}
|
|
872
|
-
const
|
|
1069
|
+
const an = [
|
|
873
1070
|
"type",
|
|
874
1071
|
"locale",
|
|
875
1072
|
"minimumFractionDigits",
|
|
@@ -881,24 +1078,25 @@ const Ur = [
|
|
|
881
1078
|
"compact",
|
|
882
1079
|
"scale",
|
|
883
1080
|
"currency",
|
|
884
|
-
"percentValueMode"
|
|
1081
|
+
"percentValueMode",
|
|
1082
|
+
"signDisplay"
|
|
885
1083
|
];
|
|
886
|
-
function
|
|
1084
|
+
function on(e) {
|
|
887
1085
|
if (!g(e))
|
|
888
1086
|
return {
|
|
889
1087
|
ok: !1,
|
|
890
1088
|
issues: [{ path: "$", message: "Numeric format must be an object." }]
|
|
891
1089
|
};
|
|
892
|
-
const t = [], r = new Set(
|
|
1090
|
+
const t = [], r = new Set(an);
|
|
893
1091
|
Object.keys(e).filter((i) => !r.has(i)).forEach(
|
|
894
1092
|
(i) => t.push({ path: i, message: `Unknown property "${i}".` })
|
|
895
1093
|
), e.type !== "number" && e.type !== "currency" && e.type !== "percent" && e.type !== "scientific" && t.push({
|
|
896
1094
|
path: "type",
|
|
897
1095
|
message: "Expected number, currency, percent, or scientific."
|
|
898
1096
|
});
|
|
899
|
-
const n = e.locale === void 0 ? void 0 :
|
|
1097
|
+
const n = e.locale === void 0 ? void 0 : A(e.locale);
|
|
900
1098
|
e.locale !== void 0 && !n && t.push({ path: "locale", message: "Expected a supported BCP 47 locale." });
|
|
901
|
-
const a = e.currency === void 0 ? void 0 :
|
|
1099
|
+
const a = e.currency === void 0 ? void 0 : ye(e.currency);
|
|
902
1100
|
e.currency !== void 0 && !a && t.push({
|
|
903
1101
|
path: "currency",
|
|
904
1102
|
message: "Expected a supported ISO 4217 currency code."
|
|
@@ -924,7 +1122,10 @@ function zr(e) {
|
|
|
924
1122
|
}), e.percentValueMode !== void 0 && e.percentValueMode !== "fraction" && e.percentValueMode !== "whole" && t.push({
|
|
925
1123
|
path: "percentValueMode",
|
|
926
1124
|
message: "Expected fraction or whole."
|
|
927
|
-
}), e.scale !== void 0 && (typeof e.scale != "number" || !Number.isFinite(e.scale)) && t.push({ path: "scale", message: "Expected a finite number." }),
|
|
1125
|
+
}), e.scale !== void 0 && (typeof e.scale != "number" || !Number.isFinite(e.scale)) && t.push({ path: "scale", message: "Expected a finite number." }), e.signDisplay !== void 0 && e.signDisplay !== "auto" && e.signDisplay !== "always" && e.signDisplay !== "exceptZero" && e.signDisplay !== "never" && t.push({
|
|
1126
|
+
path: "signDisplay",
|
|
1127
|
+
message: "Expected auto, always, exceptZero, or never."
|
|
1128
|
+
}), t.length > 0 ? { ok: !1, issues: t } : {
|
|
928
1129
|
ok: !0,
|
|
929
1130
|
value: {
|
|
930
1131
|
type: e.type,
|
|
@@ -942,12 +1143,15 @@ function zr(e) {
|
|
|
942
1143
|
...a ? { currency: a } : {},
|
|
943
1144
|
...e.percentValueMode !== void 0 ? {
|
|
944
1145
|
percentValueMode: e.percentValueMode
|
|
1146
|
+
} : {},
|
|
1147
|
+
...e.signDisplay !== void 0 ? {
|
|
1148
|
+
signDisplay: e.signDisplay
|
|
945
1149
|
} : {}
|
|
946
1150
|
}
|
|
947
1151
|
};
|
|
948
1152
|
}
|
|
949
|
-
function
|
|
950
|
-
const t =
|
|
1153
|
+
function sn(e) {
|
|
1154
|
+
const t = on(e);
|
|
951
1155
|
if (!t.ok)
|
|
952
1156
|
return t;
|
|
953
1157
|
const r = [];
|
|
@@ -965,7 +1169,7 @@ function Ar(e) {
|
|
|
965
1169
|
message: "Resolved currency formats require an explicit currency."
|
|
966
1170
|
}), r.length > 0 ? { ok: !1, issues: r } : t;
|
|
967
1171
|
}
|
|
968
|
-
function
|
|
1172
|
+
function ri(e) {
|
|
969
1173
|
var n;
|
|
970
1174
|
const t = /* @__PURE__ */ new Set();
|
|
971
1175
|
if (e.snapshot.resolvedFormats.forEach((a, i) => {
|
|
@@ -1002,7 +1206,7 @@ function $a(e) {
|
|
|
1002
1206
|
`resolvedFormats is missing visible export column "${r}"`
|
|
1003
1207
|
);
|
|
1004
1208
|
}
|
|
1005
|
-
function
|
|
1209
|
+
function cn(e, t) {
|
|
1006
1210
|
const r = new Intl.NumberFormat(e, {
|
|
1007
1211
|
style: "currency",
|
|
1008
1212
|
currency: t
|
|
@@ -1012,7 +1216,7 @@ function Yr(e, t) {
|
|
|
1012
1216
|
maximumFractionDigits: r.maximumFractionDigits
|
|
1013
1217
|
};
|
|
1014
1218
|
}
|
|
1015
|
-
function
|
|
1219
|
+
function un(e) {
|
|
1016
1220
|
if (e.minimumFractionDigits !== void 0 || e.maximumFractionDigits !== void 0) {
|
|
1017
1221
|
const r = e.minimumFractionDigits ?? 0;
|
|
1018
1222
|
return {
|
|
@@ -1026,20 +1230,20 @@ function Rr(e) {
|
|
|
1026
1230
|
maximumFractionDigits: t
|
|
1027
1231
|
};
|
|
1028
1232
|
}
|
|
1029
|
-
function
|
|
1030
|
-
const n =
|
|
1233
|
+
function ni(e, t, r) {
|
|
1234
|
+
const n = A(e.locale) ?? t.locale, a = e.type === "number" || e.type === "currency" ? ye(r) : void 0;
|
|
1031
1235
|
if (!(e.type === "currency" || a !== void 0))
|
|
1032
1236
|
return {
|
|
1033
1237
|
...e,
|
|
1034
1238
|
locale: n,
|
|
1035
|
-
...
|
|
1239
|
+
...un(e)
|
|
1036
1240
|
};
|
|
1037
|
-
const o = a ??
|
|
1241
|
+
const o = a ?? ye(e.currency) ?? t.defaultCurrency, c = cn(
|
|
1038
1242
|
n,
|
|
1039
1243
|
o
|
|
1040
|
-
),
|
|
1041
|
-
|
|
1042
|
-
e.maximumFractionDigits ??
|
|
1244
|
+
), s = c.minimumFractionDigits ?? 0, u = c.maximumFractionDigits ?? s, l = e.minimumFractionDigits ?? Math.min(
|
|
1245
|
+
s,
|
|
1246
|
+
e.maximumFractionDigits ?? s
|
|
1043
1247
|
), d = e.maximumFractionDigits ?? Math.max(
|
|
1044
1248
|
l,
|
|
1045
1249
|
u
|
|
@@ -1053,7 +1257,7 @@ function Ia(e, t, r) {
|
|
|
1053
1257
|
maximumFractionDigits: d
|
|
1054
1258
|
};
|
|
1055
1259
|
}
|
|
1056
|
-
const
|
|
1260
|
+
const ln = [
|
|
1057
1261
|
"YYYY",
|
|
1058
1262
|
"MMMM",
|
|
1059
1263
|
"MMM",
|
|
@@ -1063,23 +1267,33 @@ const Or = [
|
|
|
1063
1267
|
"HH",
|
|
1064
1268
|
"mm",
|
|
1065
1269
|
"ss"
|
|
1066
|
-
],
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1270
|
+
], mn = /* @__PURE__ */ new Set([" ", "-", "/", ":", ".", ",", "T"]), j = [
|
|
1271
|
+
"day",
|
|
1272
|
+
"week",
|
|
1273
|
+
"month",
|
|
1274
|
+
"quarter",
|
|
1275
|
+
"year"
|
|
1276
|
+
], wt = {
|
|
1277
|
+
week_of_short: ["week"],
|
|
1278
|
+
week_of_long: ["week"],
|
|
1279
|
+
quarter_short: ["quarter"],
|
|
1280
|
+
quarter_long: ["quarter"],
|
|
1281
|
+
fiscal_quarter_short: ["quarter"],
|
|
1282
|
+
fiscal_year: ["year"],
|
|
1283
|
+
short: j,
|
|
1284
|
+
long: j,
|
|
1285
|
+
numeric: j,
|
|
1286
|
+
iso: j
|
|
1073
1287
|
};
|
|
1074
|
-
function
|
|
1075
|
-
return typeof e == "string" && Object.prototype.hasOwnProperty.call(
|
|
1288
|
+
function dn(e) {
|
|
1289
|
+
return typeof e == "string" && Object.prototype.hasOwnProperty.call(wt, e);
|
|
1076
1290
|
}
|
|
1077
|
-
function
|
|
1078
|
-
return
|
|
1291
|
+
function fn(e, t) {
|
|
1292
|
+
return ln.find(
|
|
1079
1293
|
(r) => e.startsWith(r, t)
|
|
1080
1294
|
);
|
|
1081
1295
|
}
|
|
1082
|
-
function
|
|
1296
|
+
function R(e) {
|
|
1083
1297
|
var a;
|
|
1084
1298
|
if (!e || e.trim() !== e)
|
|
1085
1299
|
return {
|
|
@@ -1090,7 +1304,7 @@ function C(e) {
|
|
|
1090
1304
|
const t = [];
|
|
1091
1305
|
let r = 0, n = !1;
|
|
1092
1306
|
for (; r < e.length; ) {
|
|
1093
|
-
const i =
|
|
1307
|
+
const i = fn(e, r);
|
|
1094
1308
|
if (i) {
|
|
1095
1309
|
if (n)
|
|
1096
1310
|
return {
|
|
@@ -1102,7 +1316,7 @@ function C(e) {
|
|
|
1102
1316
|
continue;
|
|
1103
1317
|
}
|
|
1104
1318
|
const o = e[r];
|
|
1105
|
-
if (!
|
|
1319
|
+
if (!mn.has(o))
|
|
1106
1320
|
return {
|
|
1107
1321
|
ok: !1,
|
|
1108
1322
|
code: "invalid_temporal_bucket_pattern",
|
|
@@ -1114,8 +1328,8 @@ function C(e) {
|
|
|
1114
1328
|
code: "invalid_temporal_bucket_pattern",
|
|
1115
1329
|
message: "Temporal bucket patterns cannot begin with a separator."
|
|
1116
1330
|
};
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1331
|
+
const c = t[t.length - 1];
|
|
1332
|
+
c.kind === "literal" ? c.value += o : t.push({ kind: "literal", value: o }), r += 1, n = !1;
|
|
1119
1333
|
}
|
|
1120
1334
|
return ((a = t[t.length - 1]) == null ? void 0 : a.kind) !== "token" ? {
|
|
1121
1335
|
ok: !1,
|
|
@@ -1123,55 +1337,55 @@ function C(e) {
|
|
|
1123
1337
|
message: "Temporal bucket patterns cannot end with a separator."
|
|
1124
1338
|
} : { ok: !0, segments: t };
|
|
1125
1339
|
}
|
|
1126
|
-
function
|
|
1340
|
+
function yn(e) {
|
|
1127
1341
|
return e.flatMap(
|
|
1128
1342
|
(t) => t.kind === "token" ? [t.value] : []
|
|
1129
1343
|
);
|
|
1130
1344
|
}
|
|
1131
|
-
function
|
|
1345
|
+
function Be(e, t) {
|
|
1132
1346
|
return e.filter((r) => t.includes(r)).length === 1;
|
|
1133
1347
|
}
|
|
1134
|
-
function
|
|
1348
|
+
function K(e, t) {
|
|
1135
1349
|
return e.some((r) => t.includes(r));
|
|
1136
1350
|
}
|
|
1137
|
-
function
|
|
1351
|
+
function gn(e) {
|
|
1138
1352
|
return new Set(e).size !== e.length;
|
|
1139
1353
|
}
|
|
1140
|
-
function
|
|
1141
|
-
if (
|
|
1142
|
-
const r = ["YYYY", "YY"], n = ["MMMM", "MMM", "MM"], a = ["HH", "mm", "ss"], i =
|
|
1354
|
+
function hn(e, t) {
|
|
1355
|
+
if (gn(e)) return !1;
|
|
1356
|
+
const r = ["YYYY", "YY"], n = ["MMMM", "MMM", "MM"], a = ["HH", "mm", "ss"], i = Be(e, r), o = Be(e, n), c = e.includes("DD"), s = K(e, a);
|
|
1143
1357
|
switch (t) {
|
|
1144
1358
|
case "second":
|
|
1145
|
-
return e.includes("HH") && e.includes("mm") && e.includes("ss") && (!
|
|
1359
|
+
return e.includes("HH") && e.includes("mm") && e.includes("ss") && (!K(e, [...r, ...n, "DD"]) || i && o && c);
|
|
1146
1360
|
case "minute":
|
|
1147
|
-
return e.includes("HH") && e.includes("mm") && (!
|
|
1361
|
+
return e.includes("HH") && e.includes("mm") && (!K(e, [...r, ...n, "DD"]) || i && o && c);
|
|
1148
1362
|
case "hour":
|
|
1149
|
-
return e.includes("HH") && (!
|
|
1363
|
+
return e.includes("HH") && (!K(e, [...r, ...n, "DD"]) || i && o && c);
|
|
1150
1364
|
case "day":
|
|
1151
1365
|
case "week":
|
|
1152
|
-
return i && o &&
|
|
1366
|
+
return i && o && c && !s;
|
|
1153
1367
|
case "month":
|
|
1154
|
-
return i && o && !
|
|
1368
|
+
return i && o && !c && !s;
|
|
1155
1369
|
case "quarter":
|
|
1156
1370
|
return !1;
|
|
1157
1371
|
case "year":
|
|
1158
|
-
return i && !o && !
|
|
1372
|
+
return i && !o && !c && !s;
|
|
1159
1373
|
}
|
|
1160
1374
|
}
|
|
1161
|
-
function
|
|
1375
|
+
function Tt(e, t) {
|
|
1162
1376
|
if (e.presentation.mode === "auto")
|
|
1163
1377
|
return { ok: !0 };
|
|
1164
1378
|
if (e.presentation.mode === "preset") {
|
|
1165
|
-
const n =
|
|
1166
|
-
return n
|
|
1379
|
+
const n = wt[e.presentation.preset];
|
|
1380
|
+
return n.includes(t) ? { ok: !0 } : {
|
|
1167
1381
|
ok: !1,
|
|
1168
1382
|
code: "incompatible_temporal_bucket_preset",
|
|
1169
|
-
message: `Preset ${e.presentation.preset} requires ${n} granularity.`
|
|
1383
|
+
message: `Preset ${e.presentation.preset} requires ${n.join(", ")} granularity.`
|
|
1170
1384
|
};
|
|
1171
1385
|
}
|
|
1172
|
-
const r =
|
|
1173
|
-
return r.ok ?
|
|
1174
|
-
|
|
1386
|
+
const r = R(e.presentation.pattern);
|
|
1387
|
+
return r.ok ? hn(
|
|
1388
|
+
yn(r.segments),
|
|
1175
1389
|
t
|
|
1176
1390
|
) ? { ok: !0, segments: r.segments } : {
|
|
1177
1391
|
ok: !1,
|
|
@@ -1179,18 +1393,21 @@ function ct(e, t) {
|
|
|
1179
1393
|
message: `Pattern ${e.presentation.pattern} is not compatible with ${t} granularity.`
|
|
1180
1394
|
} : r;
|
|
1181
1395
|
}
|
|
1182
|
-
function
|
|
1396
|
+
function ai(e, t) {
|
|
1183
1397
|
if (!(!e || !t))
|
|
1184
|
-
return
|
|
1398
|
+
return Tt(e, t).ok ? e : void 0;
|
|
1399
|
+
}
|
|
1400
|
+
function ii(e) {
|
|
1401
|
+
return e.preset ? { mode: "preset", preset: e.preset } : e.pattern ? { mode: "pattern", dialect: e.dialect ?? "semaphor_tokens", pattern: e.pattern } : { mode: "auto" };
|
|
1185
1402
|
}
|
|
1186
1403
|
class N extends Error {
|
|
1187
1404
|
constructor(r, n) {
|
|
1188
1405
|
super(n);
|
|
1189
|
-
|
|
1406
|
+
x(this, "code");
|
|
1190
1407
|
this.name = "RawTemporalFormatContractError", this.code = r;
|
|
1191
1408
|
}
|
|
1192
1409
|
}
|
|
1193
|
-
const
|
|
1410
|
+
const pn = [
|
|
1194
1411
|
"SSSSSSSSS",
|
|
1195
1412
|
"SSSSSSSS",
|
|
1196
1413
|
"SSSSSSS",
|
|
@@ -1200,7 +1417,7 @@ const qr = [
|
|
|
1200
1417
|
"SSS",
|
|
1201
1418
|
"SS",
|
|
1202
1419
|
"S"
|
|
1203
|
-
],
|
|
1420
|
+
], St = /^(\d{4})-(\d{2})-(\d{2})$/, Dt = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?$/, xt = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|[+-]\d{2}:\d{2})$/, wn = [
|
|
1204
1421
|
"yyyy",
|
|
1205
1422
|
"MMMM",
|
|
1206
1423
|
"LLLL",
|
|
@@ -1222,7 +1439,7 @@ const qr = [
|
|
|
1222
1439
|
"m",
|
|
1223
1440
|
"s",
|
|
1224
1441
|
"a"
|
|
1225
|
-
],
|
|
1442
|
+
], Tn = /* @__PURE__ */ new Set([
|
|
1226
1443
|
"HH",
|
|
1227
1444
|
"H",
|
|
1228
1445
|
"hh",
|
|
@@ -1232,9 +1449,9 @@ const qr = [
|
|
|
1232
1449
|
"ss",
|
|
1233
1450
|
"s",
|
|
1234
1451
|
"a",
|
|
1235
|
-
...
|
|
1236
|
-
]),
|
|
1237
|
-
function
|
|
1452
|
+
...pn
|
|
1453
|
+
]), Sn = /* @__PURE__ */ new Set(["zzz", "XXX"]), le = /* @__PURE__ */ new Set(["short", "medium", "long"]);
|
|
1454
|
+
function S(e, t) {
|
|
1238
1455
|
return Object.keys(e).length === t.length && t.every((n) => n in e);
|
|
1239
1456
|
}
|
|
1240
1457
|
function m(e) {
|
|
@@ -1243,7 +1460,7 @@ function m(e) {
|
|
|
1243
1460
|
e
|
|
1244
1461
|
);
|
|
1245
1462
|
}
|
|
1246
|
-
function
|
|
1463
|
+
function vt(e) {
|
|
1247
1464
|
if (!e || e.trim() !== e || e.length > 256)
|
|
1248
1465
|
return m(
|
|
1249
1466
|
"date_fns patterns must be non-empty, trimmed, and at most 256 characters."
|
|
@@ -1259,19 +1476,19 @@ function dt(e) {
|
|
|
1259
1476
|
r("'"), n += 2;
|
|
1260
1477
|
continue;
|
|
1261
1478
|
}
|
|
1262
|
-
let o = "",
|
|
1479
|
+
let o = "", c = !1;
|
|
1263
1480
|
for (n += 1; n < e.length; ) {
|
|
1264
1481
|
if (e[n] === "'") {
|
|
1265
1482
|
if (e[n + 1] === "'") {
|
|
1266
1483
|
o += "'", n += 2;
|
|
1267
1484
|
continue;
|
|
1268
1485
|
}
|
|
1269
|
-
|
|
1486
|
+
c = !0, n += 1;
|
|
1270
1487
|
break;
|
|
1271
1488
|
}
|
|
1272
1489
|
o += e[n], n += 1;
|
|
1273
1490
|
}
|
|
1274
|
-
if (!
|
|
1491
|
+
if (!c)
|
|
1275
1492
|
return m("date_fns pattern has an unclosed quote.");
|
|
1276
1493
|
r(o);
|
|
1277
1494
|
continue;
|
|
@@ -1279,18 +1496,18 @@ function dt(e) {
|
|
|
1279
1496
|
if (e[n] === "S") {
|
|
1280
1497
|
let o = n + 1;
|
|
1281
1498
|
for (; e[o] === "S"; ) o += 1;
|
|
1282
|
-
const
|
|
1283
|
-
if (
|
|
1499
|
+
const c = e.slice(n, o);
|
|
1500
|
+
if (c.length > 9)
|
|
1284
1501
|
return m(
|
|
1285
1502
|
"date_fns fractional-second tokens support at most nine digits."
|
|
1286
1503
|
);
|
|
1287
1504
|
t.push({
|
|
1288
1505
|
kind: "token",
|
|
1289
|
-
value:
|
|
1506
|
+
value: c
|
|
1290
1507
|
}), n = o;
|
|
1291
1508
|
continue;
|
|
1292
1509
|
}
|
|
1293
|
-
const a =
|
|
1510
|
+
const a = wn.find(
|
|
1294
1511
|
(o) => e.startsWith(o, n)
|
|
1295
1512
|
);
|
|
1296
1513
|
if (a) {
|
|
@@ -1306,16 +1523,16 @@ function dt(e) {
|
|
|
1306
1523
|
}
|
|
1307
1524
|
return t.some((a) => a.kind === "token") ? t : m("date_fns patterns must contain at least one token.");
|
|
1308
1525
|
}
|
|
1309
|
-
function
|
|
1526
|
+
function kt(e, t) {
|
|
1310
1527
|
if (e === "semaphor_tokens") {
|
|
1311
|
-
const r =
|
|
1528
|
+
const r = R(t);
|
|
1312
1529
|
r.ok || m(r.message);
|
|
1313
1530
|
return;
|
|
1314
1531
|
}
|
|
1315
|
-
|
|
1532
|
+
vt(t);
|
|
1316
1533
|
}
|
|
1317
|
-
function
|
|
1318
|
-
return !g(e) || !
|
|
1534
|
+
function Dn(e) {
|
|
1535
|
+
return !g(e) || !S(e, ["dateStyle", "dateTime"]) ? m("Automatic raw temporal styles are incomplete.") : le.has(e.dateStyle) ? !g(e.dateTime) || !S(e.dateTime, ["dateStyle", "timeStyle"]) || !le.has(e.dateTime.dateStyle) || !le.has(e.dateTime.timeStyle) ? m(
|
|
1319
1536
|
"Automatic dateTime styles are incomplete or invalid."
|
|
1320
1537
|
) : {
|
|
1321
1538
|
dateStyle: e.dateStyle,
|
|
@@ -1325,29 +1542,35 @@ function Wr(e) {
|
|
|
1325
1542
|
}
|
|
1326
1543
|
} : m("Automatic dateStyle is invalid.");
|
|
1327
1544
|
}
|
|
1328
|
-
function
|
|
1545
|
+
function ve(e) {
|
|
1329
1546
|
const t = ["type", "locale", "calendarTimezone", "presentation"], r = [...t, "sourceTimezone"];
|
|
1330
|
-
if (!g(e) || !
|
|
1547
|
+
if (!g(e) || !S(e, t) && !S(e, r) || e.type !== "raw_temporal")
|
|
1331
1548
|
return m("Resolved raw temporal format has an invalid shape.");
|
|
1332
|
-
const n =
|
|
1333
|
-
return n ? typeof e.calendarTimezone != "string" || !
|
|
1549
|
+
const n = A(e.locale);
|
|
1550
|
+
return n ? typeof e.calendarTimezone != "string" || !V(e.calendarTimezone) ? m(
|
|
1334
1551
|
"Raw temporal calendarTimezone must be a valid IANA timezone."
|
|
1335
|
-
) : e.sourceTimezone !== void 0 && (typeof e.sourceTimezone != "string" || !
|
|
1552
|
+
) : e.sourceTimezone !== void 0 && (typeof e.sourceTimezone != "string" || !V(e.sourceTimezone)) ? m(
|
|
1336
1553
|
"Raw temporal sourceTimezone must be a valid IANA timezone."
|
|
1337
|
-
) : g(e.presentation) ? e.presentation.mode === "auto" ?
|
|
1554
|
+
) : g(e.presentation) ? e.presentation.mode === "auto" ? S(e.presentation, ["mode", "styles"]) ? {
|
|
1338
1555
|
type: "raw_temporal",
|
|
1339
1556
|
locale: n,
|
|
1340
1557
|
calendarTimezone: e.calendarTimezone,
|
|
1341
1558
|
...e.sourceTimezone ? { sourceTimezone: e.sourceTimezone } : {},
|
|
1342
1559
|
presentation: {
|
|
1343
1560
|
mode: "auto",
|
|
1344
|
-
styles:
|
|
1561
|
+
styles: Dn(e.presentation.styles)
|
|
1345
1562
|
}
|
|
1346
1563
|
} : m(
|
|
1347
1564
|
"Automatic raw temporal presentation has unknown fields."
|
|
1348
|
-
) : e.presentation.mode
|
|
1565
|
+
) : e.presentation.mode === "preset" ? !S(e.presentation, ["mode", "preset"]) || !Mt(e.presentation.preset) ? m("Preset raw temporal presentation has an invalid shape.") : {
|
|
1566
|
+
type: "raw_temporal",
|
|
1567
|
+
locale: n,
|
|
1568
|
+
calendarTimezone: e.calendarTimezone,
|
|
1569
|
+
...e.sourceTimezone ? { sourceTimezone: e.sourceTimezone } : {},
|
|
1570
|
+
presentation: { mode: "preset", preset: e.presentation.preset }
|
|
1571
|
+
} : e.presentation.mode !== "pattern" || !S(e.presentation, ["mode", "dialect", "pattern"]) || e.presentation.dialect !== "semaphor_tokens" && e.presentation.dialect !== "date_fns" || typeof e.presentation.pattern != "string" ? m(
|
|
1349
1572
|
"Pattern raw temporal presentation has an invalid shape."
|
|
1350
|
-
) : (
|
|
1573
|
+
) : (kt(e.presentation.dialect, e.presentation.pattern), {
|
|
1351
1574
|
type: "raw_temporal",
|
|
1352
1575
|
locale: n,
|
|
1353
1576
|
calendarTimezone: e.calendarTimezone,
|
|
@@ -1359,8 +1582,8 @@ function pe(e) {
|
|
|
1359
1582
|
}
|
|
1360
1583
|
}) : m("Raw temporal presentation must be an object.") : m("Raw temporal locale is invalid or unsupported.");
|
|
1361
1584
|
}
|
|
1362
|
-
function
|
|
1363
|
-
var
|
|
1585
|
+
function xn(e) {
|
|
1586
|
+
var c, s, u;
|
|
1364
1587
|
if (e.format) {
|
|
1365
1588
|
if (!g(e.format))
|
|
1366
1589
|
return m(
|
|
@@ -1375,27 +1598,30 @@ function Xr(e) {
|
|
|
1375
1598
|
);
|
|
1376
1599
|
const d = e.format.presentation;
|
|
1377
1600
|
if (d.mode === "auto") {
|
|
1378
|
-
if (!
|
|
1601
|
+
if (!S(d, ["mode"]))
|
|
1379
1602
|
return m(
|
|
1380
1603
|
"Automatic authored raw temporal format has unknown fields."
|
|
1381
1604
|
);
|
|
1605
|
+
} else if (d.mode === "preset") {
|
|
1606
|
+
if (!S(d, ["mode", "preset"]) || !Mt(d.preset))
|
|
1607
|
+
return m("Authored raw temporal preset has an invalid shape.");
|
|
1382
1608
|
} else {
|
|
1383
|
-
if (d.mode !== "pattern" || !
|
|
1609
|
+
if (d.mode !== "pattern" || !S(d, ["mode", "dialect", "pattern"]) || d.dialect !== "semaphor_tokens" && d.dialect !== "date_fns" || typeof d.pattern != "string")
|
|
1384
1610
|
return m(
|
|
1385
1611
|
"Authored raw temporal pattern has an invalid shape."
|
|
1386
1612
|
);
|
|
1387
|
-
|
|
1613
|
+
kt(d.dialect, d.pattern);
|
|
1388
1614
|
}
|
|
1389
1615
|
}
|
|
1390
|
-
const t = (
|
|
1391
|
-
if (t !== void 0 && t !== "auto" && !
|
|
1616
|
+
const t = (c = e.format) == null ? void 0 : c.timezone, r = (s = e.format) == null ? void 0 : s.sourceTimezone, n = t && t !== "auto" ? t : e.calendar.tz, a = r && r !== "auto" ? r === "local" ? Intl.DateTimeFormat().resolvedOptions().timeZone : r : void 0;
|
|
1617
|
+
if (t !== void 0 && t !== "auto" && !V(n) || a !== void 0 && !V(a))
|
|
1392
1618
|
return m("Authored raw temporal timezone is invalid.");
|
|
1393
1619
|
const i = ((u = e.format) == null ? void 0 : u.presentation) ?? { mode: "auto" }, o = {
|
|
1394
1620
|
type: "raw_temporal",
|
|
1395
1621
|
locale: e.preferences.locale,
|
|
1396
1622
|
calendarTimezone: n,
|
|
1397
1623
|
...a ? { sourceTimezone: a } : {},
|
|
1398
|
-
presentation: i.mode === "pattern" ? { ...i } : {
|
|
1624
|
+
presentation: i.mode === "pattern" || i.mode === "preset" ? { ...i } : {
|
|
1399
1625
|
mode: "auto",
|
|
1400
1626
|
styles: {
|
|
1401
1627
|
dateStyle: e.preferences.dateStyle,
|
|
@@ -1403,20 +1629,20 @@ function Xr(e) {
|
|
|
1403
1629
|
}
|
|
1404
1630
|
}
|
|
1405
1631
|
};
|
|
1406
|
-
return
|
|
1632
|
+
return ve(o);
|
|
1407
1633
|
}
|
|
1408
|
-
function
|
|
1409
|
-
if (
|
|
1410
|
-
if (
|
|
1411
|
-
if (
|
|
1634
|
+
function vn(e) {
|
|
1635
|
+
if (St.test(e)) return "date";
|
|
1636
|
+
if (xt.test(e)) return "instant";
|
|
1637
|
+
if (Dt.test(e)) return "wall_datetime";
|
|
1412
1638
|
}
|
|
1413
|
-
function
|
|
1639
|
+
function oi(e) {
|
|
1414
1640
|
const t = /* @__PURE__ */ new Set();
|
|
1415
1641
|
let r = !1;
|
|
1416
1642
|
for (const n of e.values) {
|
|
1417
1643
|
if (n === null) continue;
|
|
1418
1644
|
r = !0;
|
|
1419
|
-
const a =
|
|
1645
|
+
const a = vn(n);
|
|
1420
1646
|
a && t.add(a);
|
|
1421
1647
|
}
|
|
1422
1648
|
if (!r) return { status: "empty" };
|
|
@@ -1434,7 +1660,7 @@ function Fa(e) {
|
|
|
1434
1660
|
}
|
|
1435
1661
|
};
|
|
1436
1662
|
}
|
|
1437
|
-
function
|
|
1663
|
+
function si(e) {
|
|
1438
1664
|
return {
|
|
1439
1665
|
version: 1,
|
|
1440
1666
|
columns: Object.fromEntries(
|
|
@@ -1445,7 +1671,7 @@ function Ca(e) {
|
|
|
1445
1671
|
)
|
|
1446
1672
|
};
|
|
1447
1673
|
}
|
|
1448
|
-
function
|
|
1674
|
+
function kn(e) {
|
|
1449
1675
|
if (!g(e) || e.version !== 1 || !g(e.columns) || Object.keys(e).some((n) => n !== "version" && n !== "columns"))
|
|
1450
1676
|
throw new N(
|
|
1451
1677
|
"invalid_raw_temporal_format",
|
|
@@ -1468,9 +1694,9 @@ function Qr(e) {
|
|
|
1468
1694
|
}
|
|
1469
1695
|
return { version: 1, columns: t };
|
|
1470
1696
|
}
|
|
1471
|
-
function
|
|
1697
|
+
function ci(e) {
|
|
1472
1698
|
if (e.length === 0) return;
|
|
1473
|
-
const t = e.map(
|
|
1699
|
+
const t = e.map(kn), r = Object.keys(t[0].columns).sort();
|
|
1474
1700
|
for (let n = 1; n < t.length; n += 1) {
|
|
1475
1701
|
const a = Object.keys(t[n].columns).sort();
|
|
1476
1702
|
if (a.length !== r.length || a.some((i, o) => i !== r[o]))
|
|
@@ -1490,16 +1716,16 @@ function Ua(e) {
|
|
|
1490
1716
|
`Declared SQL temporal column "${n}" has inconsistent semantics across export chunks. Normalize it to one kind.`
|
|
1491
1717
|
);
|
|
1492
1718
|
}
|
|
1493
|
-
function
|
|
1719
|
+
function _n(e) {
|
|
1494
1720
|
return e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0);
|
|
1495
1721
|
}
|
|
1496
|
-
function
|
|
1497
|
-
return t === 2 ?
|
|
1722
|
+
function bn(e, t) {
|
|
1723
|
+
return t === 2 ? _n(e) ? 29 : 28 : [4, 6, 9, 11].includes(t) ? 30 : 31;
|
|
1498
1724
|
}
|
|
1499
|
-
function
|
|
1500
|
-
return e.year >= 1 && e.year <= 9999 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <=
|
|
1725
|
+
function $n(e) {
|
|
1726
|
+
return e.year >= 1 && e.year <= 9999 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= bn(e.year, e.month) && e.hour >= 0 && e.hour <= 23 && e.minute >= 0 && e.minute <= 59 && e.second >= 0 && e.second <= 59;
|
|
1501
1727
|
}
|
|
1502
|
-
function
|
|
1728
|
+
function Mn(e) {
|
|
1503
1729
|
return {
|
|
1504
1730
|
year: Number(e[1]),
|
|
1505
1731
|
month: Number(e[2]),
|
|
@@ -1510,47 +1736,47 @@ function nn(e) {
|
|
|
1510
1736
|
fraction: e[7] ?? ""
|
|
1511
1737
|
};
|
|
1512
1738
|
}
|
|
1513
|
-
function
|
|
1514
|
-
const r = t === "date" ? e.match(
|
|
1739
|
+
function Nn(e, t) {
|
|
1740
|
+
const r = t === "date" ? e.match(St) : t === "wall_datetime" ? e.match(Dt) : e.match(xt);
|
|
1515
1741
|
if (!r) return { status: "invalid_shape" };
|
|
1516
|
-
const n =
|
|
1517
|
-
if (
|
|
1742
|
+
const n = Mn(r);
|
|
1743
|
+
if (!$n(n)) return { status: "out_of_range" };
|
|
1518
1744
|
if (t === "instant") {
|
|
1519
1745
|
const a = r[8];
|
|
1520
1746
|
if (a && a !== "Z") {
|
|
1521
|
-
const [o,
|
|
1522
|
-
if (o > 23 ||
|
|
1747
|
+
const [o, c] = a.slice(1).split(":").map(Number);
|
|
1748
|
+
if (o > 23 || c > 59) return { status: "out_of_range" };
|
|
1523
1749
|
}
|
|
1524
1750
|
const i = new Date(e.replace(" ", "T"));
|
|
1525
1751
|
return Number.isNaN(i.getTime()) ? { status: "out_of_range" } : { status: "valid", fields: n, instant: i };
|
|
1526
1752
|
}
|
|
1527
1753
|
return { status: "valid", fields: n };
|
|
1528
1754
|
}
|
|
1529
|
-
function
|
|
1755
|
+
function we(e) {
|
|
1530
1756
|
const t = /* @__PURE__ */ new Date(0);
|
|
1531
1757
|
return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(e.hour, e.minute, e.second, 0), t;
|
|
1532
1758
|
}
|
|
1533
|
-
function
|
|
1759
|
+
function ke(e, t) {
|
|
1534
1760
|
const r = e.fraction ? `.${e.fraction.padEnd(3, "0").slice(0, 3)}` : "";
|
|
1535
|
-
return
|
|
1761
|
+
return ee(
|
|
1536
1762
|
`${String(e.year).padStart(4, "0")}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}T${String(e.hour).padStart(2, "0")}:${String(e.minute).padStart(2, "0")}:${String(e.second).padStart(2, "0")}${r}`,
|
|
1537
1763
|
t
|
|
1538
1764
|
);
|
|
1539
1765
|
}
|
|
1540
|
-
function
|
|
1766
|
+
function _t(e, t) {
|
|
1541
1767
|
const r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
1542
|
-
let a, i, o,
|
|
1768
|
+
let a, i, o, c;
|
|
1543
1769
|
return {
|
|
1544
|
-
number(
|
|
1770
|
+
number(s, u = 1) {
|
|
1545
1771
|
let l = r.get(u);
|
|
1546
1772
|
return l || (l = new Intl.NumberFormat(e, {
|
|
1547
1773
|
useGrouping: !1,
|
|
1548
1774
|
minimumIntegerDigits: u,
|
|
1549
1775
|
maximumFractionDigits: 0
|
|
1550
|
-
}), r.set(u, l)), l.format(
|
|
1776
|
+
}), r.set(u, l)), l.format(s);
|
|
1551
1777
|
},
|
|
1552
|
-
month(
|
|
1553
|
-
var
|
|
1778
|
+
month(s, u, l) {
|
|
1779
|
+
var T;
|
|
1554
1780
|
const d = `${u}:${l ? "standalone" : "contextual"}`;
|
|
1555
1781
|
let y = n.get(d);
|
|
1556
1782
|
if (!y) {
|
|
@@ -1561,18 +1787,18 @@ function yt(e, t) {
|
|
|
1561
1787
|
};
|
|
1562
1788
|
l || (h.day = "numeric"), y = new Intl.DateTimeFormat(e, h), n.set(d, y);
|
|
1563
1789
|
}
|
|
1564
|
-
return ((
|
|
1790
|
+
return ((T = y.formatToParts(s).find((h) => h.type === "month")) == null ? void 0 : T.value) ?? "";
|
|
1565
1791
|
},
|
|
1566
|
-
dayPeriod(
|
|
1792
|
+
dayPeriod(s) {
|
|
1567
1793
|
var u;
|
|
1568
1794
|
return a ?? (a = new Intl.DateTimeFormat(e, {
|
|
1569
1795
|
calendar: "gregory",
|
|
1570
1796
|
timeZone: "UTC",
|
|
1571
1797
|
hour: "numeric",
|
|
1572
1798
|
hour12: !0
|
|
1573
|
-
})), ((u = a.formatToParts(
|
|
1799
|
+
})), ((u = a.formatToParts(s).find((l) => l.type === "dayPeriod")) == null ? void 0 : u.value) ?? "";
|
|
1574
1800
|
},
|
|
1575
|
-
instantFields(
|
|
1801
|
+
instantFields(s) {
|
|
1576
1802
|
i ?? (i = new Intl.DateTimeFormat("en-CA", {
|
|
1577
1803
|
calendar: "gregory",
|
|
1578
1804
|
numberingSystem: "latn",
|
|
@@ -1585,9 +1811,9 @@ function yt(e, t) {
|
|
|
1585
1811
|
second: "2-digit",
|
|
1586
1812
|
hourCycle: "h23"
|
|
1587
1813
|
}));
|
|
1588
|
-
const u = i.formatToParts(
|
|
1814
|
+
const u = i.formatToParts(s), l = (d) => {
|
|
1589
1815
|
var y;
|
|
1590
|
-
return Number((y = u.find((
|
|
1816
|
+
return Number((y = u.find((T) => T.type === d)) == null ? void 0 : y.value);
|
|
1591
1817
|
};
|
|
1592
1818
|
return {
|
|
1593
1819
|
year: l("year"),
|
|
@@ -1599,22 +1825,22 @@ function yt(e, t) {
|
|
|
1599
1825
|
fraction: ""
|
|
1600
1826
|
};
|
|
1601
1827
|
},
|
|
1602
|
-
timezoneName(
|
|
1828
|
+
timezoneName(s) {
|
|
1603
1829
|
var u;
|
|
1604
1830
|
return o ?? (o = new Intl.DateTimeFormat(e, {
|
|
1605
1831
|
calendar: "gregory",
|
|
1606
1832
|
timeZone: t,
|
|
1607
1833
|
timeZoneName: "short"
|
|
1608
|
-
})), ((u = o.formatToParts(
|
|
1834
|
+
})), ((u = o.formatToParts(s).find((l) => l.type === "timeZoneName")) == null ? void 0 : u.value) ?? "";
|
|
1609
1835
|
},
|
|
1610
|
-
timezoneOffset(
|
|
1836
|
+
timezoneOffset(s) {
|
|
1611
1837
|
var d;
|
|
1612
|
-
|
|
1838
|
+
c ?? (c = new Intl.DateTimeFormat("en-US", {
|
|
1613
1839
|
calendar: "gregory",
|
|
1614
1840
|
timeZone: t,
|
|
1615
1841
|
timeZoneName: "longOffset"
|
|
1616
1842
|
}));
|
|
1617
|
-
const u = (d =
|
|
1843
|
+
const u = (d = c.formatToParts(s).find((y) => y.type === "timeZoneName")) == null ? void 0 : d.value;
|
|
1618
1844
|
if (!u)
|
|
1619
1845
|
return m("Unable to resolve the instant timezone offset.");
|
|
1620
1846
|
const l = u.replace(/^GMT/, "");
|
|
@@ -1622,7 +1848,7 @@ function yt(e, t) {
|
|
|
1622
1848
|
}
|
|
1623
1849
|
};
|
|
1624
1850
|
}
|
|
1625
|
-
function
|
|
1851
|
+
function In(e, t, r, n, a) {
|
|
1626
1852
|
if (/^S{1,9}$/.test(e)) {
|
|
1627
1853
|
const i = t.fraction.padEnd(e.length, "0").slice(0, e.length);
|
|
1628
1854
|
return n.number(Number(i), e.length);
|
|
@@ -1683,47 +1909,47 @@ function on(e, t, r, n, a) {
|
|
|
1683
1909
|
);
|
|
1684
1910
|
}
|
|
1685
1911
|
}
|
|
1686
|
-
function
|
|
1687
|
-
const a =
|
|
1912
|
+
function En(e, t, r, n) {
|
|
1913
|
+
const a = we(t);
|
|
1688
1914
|
return e.map(
|
|
1689
|
-
(i) => i.kind === "literal" ? i.value :
|
|
1915
|
+
(i) => i.kind === "literal" ? i.value : In(i.value, t, a, r, n)
|
|
1690
1916
|
).join("");
|
|
1691
1917
|
}
|
|
1692
|
-
function
|
|
1693
|
-
const n = t === "date_fns" ?
|
|
1694
|
-
const i =
|
|
1918
|
+
function bt(e, t, r) {
|
|
1919
|
+
const n = t === "date_fns" ? vt(r) : (() => {
|
|
1920
|
+
const i = R(r);
|
|
1695
1921
|
return i.ok ? i.segments : m(i.message);
|
|
1696
1922
|
})(), a = n.filter((i) => i.kind === "token").map((i) => i.value);
|
|
1697
|
-
return e === "date" && a.some((i) =>
|
|
1923
|
+
return e === "date" && a.some((i) => Tn.has(i)) ? m("Date patterns cannot contain time tokens.") : e !== "instant" && a.some((i) => Sn.has(i)) ? m("Timezone pattern tokens require an instant value.") : n;
|
|
1698
1924
|
}
|
|
1699
|
-
function
|
|
1700
|
-
|
|
1925
|
+
function Fn(e) {
|
|
1926
|
+
bt(
|
|
1701
1927
|
e.valueKind ?? "instant",
|
|
1702
1928
|
e.dialect,
|
|
1703
1929
|
e.pattern
|
|
1704
1930
|
);
|
|
1705
1931
|
}
|
|
1706
|
-
function
|
|
1707
|
-
const a =
|
|
1932
|
+
function Cn(e, t, r, n) {
|
|
1933
|
+
const a = bt(
|
|
1708
1934
|
e.valueKind,
|
|
1709
1935
|
r,
|
|
1710
1936
|
n
|
|
1711
|
-
), i =
|
|
1937
|
+
), i = _t(t.locale, t.calendarTimezone);
|
|
1712
1938
|
return (o) => {
|
|
1713
|
-
const
|
|
1939
|
+
const c = e.valueKind === "wall_datetime" && t.sourceTimezone ? ke(o.fields, t.sourceTimezone) : void 0, s = e.valueKind === "instant" ? {
|
|
1714
1940
|
...i.instantFields(o.instant),
|
|
1715
1941
|
fraction: o.fields.fraction
|
|
1716
|
-
} :
|
|
1717
|
-
...i.instantFields(
|
|
1942
|
+
} : c ? {
|
|
1943
|
+
...i.instantFields(c),
|
|
1718
1944
|
fraction: o.fields.fraction
|
|
1719
1945
|
} : o.fields;
|
|
1720
|
-
return
|
|
1946
|
+
return En(a, s, i, o.instant ?? c);
|
|
1721
1947
|
};
|
|
1722
1948
|
}
|
|
1723
|
-
function
|
|
1724
|
-
const r =
|
|
1949
|
+
function $t(e, t) {
|
|
1950
|
+
const r = _t(t.locale, t.calendarTimezone);
|
|
1725
1951
|
return (n) => {
|
|
1726
|
-
const a = e.valueKind === "instant" ? r.instantFields(n.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? r.instantFields(
|
|
1952
|
+
const a = e.valueKind === "instant" ? r.instantFields(n.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? r.instantFields(ke(n.fields, t.sourceTimezone)) : n.fields;
|
|
1727
1953
|
return {
|
|
1728
1954
|
year: a.year,
|
|
1729
1955
|
month: a.month,
|
|
@@ -1734,7 +1960,31 @@ function ln(e, t) {
|
|
|
1734
1960
|
};
|
|
1735
1961
|
};
|
|
1736
1962
|
}
|
|
1737
|
-
|
|
1963
|
+
const Un = /* @__PURE__ */ new Set(["short", "long", "numeric", "iso"]);
|
|
1964
|
+
function Mt(e) {
|
|
1965
|
+
return typeof e == "string" && Un.has(e);
|
|
1966
|
+
}
|
|
1967
|
+
function zn(e, t, r) {
|
|
1968
|
+
const n = $t(e, t), a = e.valueKind !== "date", i = (c, s = 2) => String(c).padStart(s, "0");
|
|
1969
|
+
if (r === "iso")
|
|
1970
|
+
return (c) => {
|
|
1971
|
+
const s = n(c), u = `${i(s.year, 4)}-${i(s.month)}-${i(s.day)}`;
|
|
1972
|
+
return a ? `${u} ${i(s.hour)}:${i(s.minute)}` : u;
|
|
1973
|
+
};
|
|
1974
|
+
const o = new Intl.DateTimeFormat(t.locale, {
|
|
1975
|
+
calendar: "gregory",
|
|
1976
|
+
timeZone: "UTC",
|
|
1977
|
+
year: "numeric",
|
|
1978
|
+
month: r,
|
|
1979
|
+
day: "numeric",
|
|
1980
|
+
...a ? { hour: "numeric", minute: "2-digit" } : {}
|
|
1981
|
+
});
|
|
1982
|
+
return (c) => {
|
|
1983
|
+
const s = n(c), u = /* @__PURE__ */ new Date(0);
|
|
1984
|
+
return u.setUTCFullYear(s.year, s.month - 1, s.day), u.setUTCHours(s.hour, s.minute, s.second, 0), o.format(u);
|
|
1985
|
+
};
|
|
1986
|
+
}
|
|
1987
|
+
function An(e, t) {
|
|
1738
1988
|
const r = t.presentation.mode === "auto" ? t.presentation.styles : m("Automatic raw temporal formatting requires styles.");
|
|
1739
1989
|
if (e.valueKind === "date") {
|
|
1740
1990
|
const o = new Intl.DateTimeFormat(t.locale, {
|
|
@@ -1742,7 +1992,7 @@ function mn(e, t) {
|
|
|
1742
1992
|
timeZone: "UTC",
|
|
1743
1993
|
dateStyle: r.dateStyle
|
|
1744
1994
|
});
|
|
1745
|
-
return (
|
|
1995
|
+
return (c) => o.format(we(c.fields));
|
|
1746
1996
|
}
|
|
1747
1997
|
const n = e.valueKind === "instant", a = !n && r.dateTime.timeStyle === "long" ? "medium" : r.dateTime.timeStyle, i = new Intl.DateTimeFormat(t.locale, {
|
|
1748
1998
|
calendar: "gregory",
|
|
@@ -1750,9 +2000,9 @@ function mn(e, t) {
|
|
|
1750
2000
|
dateStyle: r.dateTime.dateStyle,
|
|
1751
2001
|
timeStyle: a
|
|
1752
2002
|
});
|
|
1753
|
-
return (o) => n ? i.format(o.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? i.format(
|
|
2003
|
+
return (o) => n ? i.format(o.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? i.format(ke(o.fields, t.sourceTimezone)) : i.format(we(o.fields));
|
|
1754
2004
|
}
|
|
1755
|
-
function
|
|
2005
|
+
function Ve(e, t, r) {
|
|
1756
2006
|
return {
|
|
1757
2007
|
ok: !1,
|
|
1758
2008
|
text: e,
|
|
@@ -1762,18 +2012,18 @@ function Ae(e, t, r) {
|
|
|
1762
2012
|
}
|
|
1763
2013
|
};
|
|
1764
2014
|
}
|
|
1765
|
-
function
|
|
1766
|
-
const t =
|
|
2015
|
+
function On(e) {
|
|
2016
|
+
const t = Wt(e.metadata), r = ve(e.format), n = r.presentation.mode === "auto" ? An(t, r) : r.presentation.mode === "preset" ? zn(t, r, r.presentation.preset) : Cn(
|
|
1767
2017
|
t,
|
|
1768
2018
|
r,
|
|
1769
2019
|
r.presentation.dialect,
|
|
1770
2020
|
r.presentation.pattern
|
|
1771
|
-
), a =
|
|
2021
|
+
), a = $t(t, r);
|
|
1772
2022
|
return (i) => {
|
|
1773
2023
|
if (i === null)
|
|
1774
2024
|
return { ok: !0, text: "", status: "empty" };
|
|
1775
|
-
const o =
|
|
1776
|
-
return o.status === "invalid_shape" ?
|
|
2025
|
+
const o = Nn(i, t.valueKind);
|
|
2026
|
+
return o.status === "invalid_shape" ? Ve(i, t, "invalid_raw_temporal_value") : o.status === "out_of_range" ? Ve(i, t, "out_of_range_raw_temporal_value") : {
|
|
1777
2027
|
ok: !0,
|
|
1778
2028
|
text: n(o),
|
|
1779
2029
|
status: "formatted",
|
|
@@ -1781,24 +2031,24 @@ function dn(e) {
|
|
|
1781
2031
|
};
|
|
1782
2032
|
};
|
|
1783
2033
|
}
|
|
1784
|
-
function
|
|
1785
|
-
return
|
|
2034
|
+
function Rn(e) {
|
|
2035
|
+
return On({
|
|
1786
2036
|
metadata: e.metadata,
|
|
1787
2037
|
format: e.format
|
|
1788
2038
|
})(e.value);
|
|
1789
2039
|
}
|
|
1790
|
-
const
|
|
2040
|
+
const Yn = {
|
|
1791
2041
|
dateStyle: "short",
|
|
1792
2042
|
dateTime: { dateStyle: "short", timeStyle: "short" }
|
|
1793
2043
|
};
|
|
1794
|
-
class
|
|
2044
|
+
class q extends Error {
|
|
1795
2045
|
constructor(r, n) {
|
|
1796
2046
|
super(n);
|
|
1797
|
-
|
|
2047
|
+
x(this, "code");
|
|
1798
2048
|
this.name = "TemporalBucketContractError", this.code = r;
|
|
1799
2049
|
}
|
|
1800
2050
|
}
|
|
1801
|
-
const
|
|
2051
|
+
const Pn = [
|
|
1802
2052
|
"Jan",
|
|
1803
2053
|
"Feb",
|
|
1804
2054
|
"Mar",
|
|
@@ -1811,7 +2061,7 @@ const gn = [
|
|
|
1811
2061
|
"Oct",
|
|
1812
2062
|
"Nov",
|
|
1813
2063
|
"Dec"
|
|
1814
|
-
],
|
|
2064
|
+
], Ln = [
|
|
1815
2065
|
"January",
|
|
1816
2066
|
"February",
|
|
1817
2067
|
"March",
|
|
@@ -1825,31 +2075,31 @@ const gn = [
|
|
|
1825
2075
|
"November",
|
|
1826
2076
|
"December"
|
|
1827
2077
|
];
|
|
1828
|
-
function
|
|
2078
|
+
function me(e) {
|
|
1829
2079
|
return {
|
|
1830
2080
|
ok: !1,
|
|
1831
2081
|
error: { code: "invalid_temporal_bucket_value", message: e }
|
|
1832
2082
|
};
|
|
1833
2083
|
}
|
|
1834
|
-
function
|
|
2084
|
+
function jn(e) {
|
|
1835
2085
|
return e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0);
|
|
1836
2086
|
}
|
|
1837
|
-
function
|
|
1838
|
-
return t === 2 ?
|
|
2087
|
+
function Kn(e, t) {
|
|
2088
|
+
return t === 2 ? jn(e) ? 29 : 28 : [4, 6, 9, 11].includes(t) ? 30 : 31;
|
|
1839
2089
|
}
|
|
1840
|
-
function
|
|
2090
|
+
function Hn(e, t, r) {
|
|
1841
2091
|
const n = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4], a = t < 3 ? e - 1 : e;
|
|
1842
2092
|
return (a + Math.floor(a / 4) - Math.floor(a / 100) + Math.floor(a / 400) + n[t - 1] + r) % 7;
|
|
1843
2093
|
}
|
|
1844
|
-
function
|
|
2094
|
+
function te(e) {
|
|
1845
2095
|
var t;
|
|
1846
2096
|
return (t = e.calendar.fiscalCalendar) == null ? void 0 : t.yearStartMonth;
|
|
1847
2097
|
}
|
|
1848
|
-
function
|
|
2098
|
+
function Zn(e, t) {
|
|
1849
2099
|
return (e - t + 12) % 12 % 3 === 0;
|
|
1850
2100
|
}
|
|
1851
|
-
function
|
|
1852
|
-
const { granularity: r } = t, n =
|
|
2101
|
+
function qn(e, t) {
|
|
2102
|
+
const { granularity: r } = t, n = te(t) ?? 1;
|
|
1853
2103
|
switch (r) {
|
|
1854
2104
|
case "second":
|
|
1855
2105
|
return !0;
|
|
@@ -1860,20 +2110,20 @@ function vn(e, t) {
|
|
|
1860
2110
|
case "day":
|
|
1861
2111
|
return !0;
|
|
1862
2112
|
case "week":
|
|
1863
|
-
return
|
|
2113
|
+
return Hn(e.year, e.month, e.day) === t.calendar.weekStart;
|
|
1864
2114
|
case "month":
|
|
1865
2115
|
return e.day === 1;
|
|
1866
2116
|
case "quarter":
|
|
1867
|
-
return e.day === 1 &&
|
|
2117
|
+
return e.day === 1 && Zn(e.month, n);
|
|
1868
2118
|
case "year":
|
|
1869
2119
|
return e.day === 1 && e.month === n;
|
|
1870
2120
|
}
|
|
1871
2121
|
}
|
|
1872
|
-
function
|
|
2122
|
+
function Nt(e, t) {
|
|
1873
2123
|
if (e === null) return { ok: !0, value: null };
|
|
1874
2124
|
const r = t.granularity === "second" || t.granularity === "minute" || t.granularity === "hour", n = r ? /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})$/.exec(e) : /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
1875
2125
|
if (!n)
|
|
1876
|
-
return
|
|
2126
|
+
return me(
|
|
1877
2127
|
`Expected ${r ? "YYYY-MM-DDTHH:mm:ss" : "YYYY-MM-DD"} for ${t.granularity} granularity.`
|
|
1878
2128
|
);
|
|
1879
2129
|
const a = {
|
|
@@ -1884,17 +2134,17 @@ function ht(e, t) {
|
|
|
1884
2134
|
minute: r ? Number(n[5]) : 0,
|
|
1885
2135
|
second: r ? Number(n[6]) : 0
|
|
1886
2136
|
};
|
|
1887
|
-
return a.year < 1 || a.month < 1 || a.month > 12 || a.day < 1 || a.day >
|
|
2137
|
+
return a.year < 1 || a.month < 1 || a.month > 12 || a.day < 1 || a.day > Kn(a.year, a.month) || a.hour > 23 || a.minute > 59 || a.second > 59 ? me(`Invalid canonical ${t.granularity} bucket value ${e}.`) : qn(a, t) ? { ok: !0, value: a } : me(
|
|
1888
2138
|
`Canonical value ${e} is not aligned to ${t.granularity} granularity and its governed Calendar.`
|
|
1889
2139
|
);
|
|
1890
2140
|
}
|
|
1891
|
-
function
|
|
1892
|
-
const { granularity: t, calendar: r } = e, n = (o,
|
|
2141
|
+
function ui(e) {
|
|
2142
|
+
const { granularity: t, calendar: r } = e, n = (o, c) => new Intl.DateTimeFormat("en-US", { ...o, timeZone: "UTC" }).format(c), a = [`by ${t} in the ${r.tz} calendar`];
|
|
1893
2143
|
t === "week" && a.push(`weeks starting on ${n({ weekday: "long" }, new Date(Date.UTC(2023, 0, 1 + r.weekStart)))}`);
|
|
1894
|
-
const i =
|
|
2144
|
+
const i = te(e);
|
|
1895
2145
|
return i && (t === "quarter" || t === "year") && a.push(`the fiscal year starting in ${n({ month: "long" }, new Date(Date.UTC(2e3, i - 1, 1)))}`), `${a.join(", ")}; each value is a bucket's start`;
|
|
1896
2146
|
}
|
|
1897
|
-
function
|
|
2147
|
+
function It(e) {
|
|
1898
2148
|
if (!g(e))
|
|
1899
2149
|
return {
|
|
1900
2150
|
ok: !1,
|
|
@@ -1908,33 +2158,33 @@ function pt(e) {
|
|
|
1908
2158
|
if (!g(n))
|
|
1909
2159
|
t.push({ path: "presentation", message: "Expected a presentation object." });
|
|
1910
2160
|
else {
|
|
1911
|
-
const o = n.mode,
|
|
1912
|
-
for (const
|
|
1913
|
-
|
|
1914
|
-
path: `presentation.${
|
|
1915
|
-
message: `Unknown property "${
|
|
2161
|
+
const o = n.mode, c = o === "preset" ? /* @__PURE__ */ new Set(["mode", "preset"]) : o === "pattern" ? /* @__PURE__ */ new Set(["mode", "pattern"]) : o === "auto" ? /* @__PURE__ */ new Set(["mode", "styles"]) : /* @__PURE__ */ new Set(["mode"]);
|
|
2162
|
+
for (const s of Object.keys(n))
|
|
2163
|
+
c.has(s) || t.push({
|
|
2164
|
+
path: `presentation.${s}`,
|
|
2165
|
+
message: `Unknown property "${s}".`
|
|
1916
2166
|
});
|
|
1917
2167
|
if (o === "preset")
|
|
1918
|
-
|
|
2168
|
+
dn(n.preset) || t.push({ path: "presentation.preset", message: "Expected a supported preset." });
|
|
1919
2169
|
else if (o === "pattern")
|
|
1920
2170
|
if (typeof n.pattern != "string" || !n.pattern)
|
|
1921
2171
|
t.push({ path: "presentation.pattern", message: "Expected a non-empty pattern." });
|
|
1922
2172
|
else {
|
|
1923
|
-
const
|
|
1924
|
-
|
|
2173
|
+
const s = R(n.pattern);
|
|
2174
|
+
s.ok || t.push({
|
|
1925
2175
|
path: "presentation.pattern",
|
|
1926
|
-
message:
|
|
2176
|
+
message: s.message
|
|
1927
2177
|
});
|
|
1928
2178
|
}
|
|
1929
2179
|
else if (o === "auto") {
|
|
1930
|
-
const
|
|
1931
|
-
(!g(
|
|
1932
|
-
String(
|
|
2180
|
+
const s = n.styles;
|
|
2181
|
+
(!g(s) || !["short", "medium", "long"].includes(String(s.dateStyle)) || !g(s.dateTime) || !["short", "medium", "long"].includes(
|
|
2182
|
+
String(s.dateTime.dateStyle)
|
|
1933
2183
|
) || !["short", "medium", "long"].includes(
|
|
1934
|
-
String(
|
|
1935
|
-
) || Object.keys(
|
|
2184
|
+
String(s.dateTime.timeStyle)
|
|
2185
|
+
) || Object.keys(s).some(
|
|
1936
2186
|
(u) => u !== "dateStyle" && u !== "dateTime"
|
|
1937
|
-
) || Object.keys(
|
|
2187
|
+
) || Object.keys(s.dateTime).some(
|
|
1938
2188
|
(u) => u !== "dateStyle" && u !== "timeStyle"
|
|
1939
2189
|
)) && t.push({
|
|
1940
2190
|
path: "presentation.styles",
|
|
@@ -1943,7 +2193,7 @@ function pt(e) {
|
|
|
1943
2193
|
} else
|
|
1944
2194
|
t.push({ path: "presentation.mode", message: "Expected auto, preset, or pattern." });
|
|
1945
2195
|
}
|
|
1946
|
-
const a =
|
|
2196
|
+
const a = A(e.locale);
|
|
1947
2197
|
if (a || t.push({ path: "locale", message: "Expected a supported base BCP 47 locale." }), t.length > 0 || !a || !g(n))
|
|
1948
2198
|
return { ok: !1, issues: t };
|
|
1949
2199
|
if (n.mode === "auto") {
|
|
@@ -1981,47 +2231,47 @@ function pt(e) {
|
|
|
1981
2231
|
}
|
|
1982
2232
|
};
|
|
1983
2233
|
}
|
|
1984
|
-
function
|
|
2234
|
+
function Bn(e, t) {
|
|
1985
2235
|
const r = !!t.calendar.fiscalCalendar;
|
|
1986
|
-
return e === "fiscal_quarter_short" || e === "fiscal_year" ? r : e === "quarter_short" || e === "quarter_long" ? !r : !0;
|
|
2236
|
+
return e === "fiscal_quarter_short" || e === "fiscal_year" ? r : e === "quarter_short" || e === "quarter_long" || Ut(e) && (t.granularity === "quarter" || t.granularity === "year") ? !r : !0;
|
|
1987
2237
|
}
|
|
1988
|
-
function
|
|
1989
|
-
return
|
|
2238
|
+
function Et(e, t) {
|
|
2239
|
+
return Tt(e, t.granularity).ok ? e.presentation.mode === "preset" ? Bn(e.presentation.preset, t) : !(e.presentation.mode === "pattern" && t.calendar.fiscalCalendar && (t.granularity === "quarter" || t.granularity === "year")) : !1;
|
|
1990
2240
|
}
|
|
1991
|
-
function
|
|
2241
|
+
function Ge(e, t) {
|
|
1992
2242
|
if (!(!e || e.presentation.mode === "auto"))
|
|
1993
|
-
return
|
|
2243
|
+
return Et(e, t) ? { type: "temporal_bucket", presentation: e.presentation } : void 0;
|
|
1994
2244
|
}
|
|
1995
|
-
function
|
|
2245
|
+
function Vn(e) {
|
|
1996
2246
|
var a;
|
|
1997
|
-
const t =
|
|
2247
|
+
const t = A(e.locale);
|
|
1998
2248
|
if (!t)
|
|
1999
|
-
throw new
|
|
2249
|
+
throw new q(
|
|
2000
2250
|
"invalid_temporal_bucket_format",
|
|
2001
2251
|
"Temporal bucket locale must be a supported base BCP 47 locale."
|
|
2002
2252
|
);
|
|
2003
|
-
const r =
|
|
2253
|
+
const r = Ge(e.cardFormat, e.metadata);
|
|
2004
2254
|
if (r)
|
|
2005
2255
|
return { format: { ...r, locale: t }, source: "card" };
|
|
2006
|
-
const n = ((a = e.semanticFormat) == null ? void 0 : a.granularity) === e.metadata.granularity ?
|
|
2256
|
+
const n = ((a = e.semanticFormat) == null ? void 0 : a.granularity) === e.metadata.granularity ? Ge(e.semanticFormat.format, e.metadata) : void 0;
|
|
2007
2257
|
return n ? { format: { ...n, locale: t }, source: "semantic" } : {
|
|
2008
2258
|
format: {
|
|
2009
2259
|
type: "temporal_bucket",
|
|
2010
2260
|
locale: t,
|
|
2011
2261
|
presentation: {
|
|
2012
2262
|
mode: "auto",
|
|
2013
|
-
styles: e.styles ??
|
|
2263
|
+
styles: e.styles ?? Yn
|
|
2014
2264
|
}
|
|
2015
2265
|
},
|
|
2016
2266
|
source: "automatic"
|
|
2017
2267
|
};
|
|
2018
2268
|
}
|
|
2019
|
-
function
|
|
2269
|
+
function p(e, t = 2) {
|
|
2020
2270
|
return String(e).padStart(t, "0");
|
|
2021
2271
|
}
|
|
2022
|
-
function
|
|
2272
|
+
function U(e, t, r) {
|
|
2023
2273
|
if (t === "en-US")
|
|
2024
|
-
return (r === "short" ?
|
|
2274
|
+
return (r === "short" ? Pn : Ln)[e - 1];
|
|
2025
2275
|
const n = new Date(Date.UTC(2e3, e - 1, 15));
|
|
2026
2276
|
return new Intl.DateTimeFormat(t, {
|
|
2027
2277
|
calendar: "gregory",
|
|
@@ -2029,190 +2279,219 @@ function q(e, t, r) {
|
|
|
2029
2279
|
timeZone: "UTC"
|
|
2030
2280
|
}).format(n);
|
|
2031
2281
|
}
|
|
2032
|
-
function
|
|
2282
|
+
function Gn(e, t, r) {
|
|
2033
2283
|
return t.map((n) => {
|
|
2034
2284
|
if (n.kind === "literal") return n.value;
|
|
2035
2285
|
switch (n.value) {
|
|
2036
2286
|
case "YYYY":
|
|
2037
|
-
return
|
|
2287
|
+
return p(e.year, 4);
|
|
2038
2288
|
case "YY":
|
|
2039
|
-
return
|
|
2289
|
+
return p(e.year % 100);
|
|
2040
2290
|
case "MMMM":
|
|
2041
|
-
return
|
|
2291
|
+
return U(e.month, r, "long");
|
|
2042
2292
|
case "MMM":
|
|
2043
|
-
return
|
|
2293
|
+
return U(e.month, r, "short");
|
|
2044
2294
|
case "MM":
|
|
2045
|
-
return
|
|
2295
|
+
return p(e.month);
|
|
2046
2296
|
case "DD":
|
|
2047
|
-
return
|
|
2297
|
+
return p(e.day);
|
|
2048
2298
|
case "HH":
|
|
2049
|
-
return
|
|
2299
|
+
return p(e.hour);
|
|
2050
2300
|
case "mm":
|
|
2051
|
-
return
|
|
2301
|
+
return p(e.minute);
|
|
2052
2302
|
case "ss":
|
|
2053
|
-
return
|
|
2303
|
+
return p(e.second);
|
|
2054
2304
|
}
|
|
2055
2305
|
}).join("");
|
|
2056
2306
|
}
|
|
2057
|
-
const
|
|
2058
|
-
function
|
|
2059
|
-
const r = `${e}:${JSON.stringify(t)}`, n =
|
|
2307
|
+
const We = /* @__PURE__ */ new Map();
|
|
2308
|
+
function b(e, t) {
|
|
2309
|
+
const r = `${e}:${JSON.stringify(t)}`, n = We.get(r);
|
|
2060
2310
|
if (n) return n;
|
|
2061
2311
|
const a = new Intl.DateTimeFormat(e, t);
|
|
2062
|
-
return
|
|
2312
|
+
return We.set(r, a), a;
|
|
2063
2313
|
}
|
|
2064
|
-
function
|
|
2314
|
+
function z(e) {
|
|
2065
2315
|
const t = /* @__PURE__ */ new Date(0);
|
|
2066
2316
|
return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(e.hour, e.minute, e.second, 0), t;
|
|
2067
2317
|
}
|
|
2068
|
-
function
|
|
2069
|
-
return
|
|
2318
|
+
function Xe(e, t, r) {
|
|
2319
|
+
return b(t, {
|
|
2070
2320
|
calendar: "gregory",
|
|
2071
2321
|
dateStyle: r,
|
|
2072
2322
|
timeZone: "UTC"
|
|
2073
|
-
}).format(
|
|
2323
|
+
}).format(z(e));
|
|
2074
2324
|
}
|
|
2075
|
-
function
|
|
2076
|
-
return
|
|
2325
|
+
function Wn(e, t, r) {
|
|
2326
|
+
return b(t, {
|
|
2077
2327
|
calendar: "gregory",
|
|
2078
2328
|
dateStyle: r.dateStyle,
|
|
2079
2329
|
// Grouped buckets are civil values, not instants. Long time styles would
|
|
2080
2330
|
// append a zone label that the canonical value does not semantically own.
|
|
2081
2331
|
timeStyle: r.timeStyle === "long" ? "medium" : r.timeStyle,
|
|
2082
2332
|
timeZone: "UTC"
|
|
2083
|
-
}).format(
|
|
2333
|
+
}).format(z(e));
|
|
2084
2334
|
}
|
|
2085
|
-
function
|
|
2335
|
+
function Xn(e, t, r) {
|
|
2086
2336
|
var a;
|
|
2087
2337
|
if (r === "short") {
|
|
2088
|
-
const i =
|
|
2338
|
+
const i = z(e), o = b(t, {
|
|
2089
2339
|
calendar: "gregory",
|
|
2090
2340
|
dateStyle: "short",
|
|
2091
2341
|
timeZone: "UTC"
|
|
2092
|
-
}).formatToParts(i),
|
|
2342
|
+
}).formatToParts(i), c = o.findIndex((l) => l.type === "month"), s = o.findIndex((l) => l.type === "year"), u = (a = b(t, {
|
|
2093
2343
|
calendar: "gregory",
|
|
2094
2344
|
timeZone: "UTC",
|
|
2095
2345
|
year: "numeric"
|
|
2096
2346
|
}).formatToParts(i).find((l) => l.type === "year")) == null ? void 0 : a.value;
|
|
2097
|
-
if (
|
|
2098
|
-
const l = Math.min(
|
|
2347
|
+
if (c >= 0 && s >= 0 && u) {
|
|
2348
|
+
const l = Math.min(c, s), d = Math.max(c, s);
|
|
2099
2349
|
let y = !1;
|
|
2100
|
-
return o.slice(l, d + 1).filter((
|
|
2350
|
+
return o.slice(l, d + 1).filter((T) => T.type === "day" ? (y = !0, !1) : y && T.type === "literal" ? (y = !1, !1) : !0).map((T) => T.type === "year" ? u : T.value).join("");
|
|
2101
2351
|
}
|
|
2102
2352
|
}
|
|
2103
|
-
return
|
|
2353
|
+
return b(t, {
|
|
2104
2354
|
calendar: "gregory",
|
|
2105
2355
|
month: r === "short" ? "numeric" : r === "medium" ? "short" : "long",
|
|
2106
2356
|
timeZone: "UTC",
|
|
2107
2357
|
year: "numeric"
|
|
2108
|
-
}).format(
|
|
2358
|
+
}).format(z(e));
|
|
2109
2359
|
}
|
|
2110
|
-
function
|
|
2360
|
+
function Ft(e, t) {
|
|
2111
2361
|
return Math.floor((e.month - t + 12) % 12 / 3) + 1;
|
|
2112
2362
|
}
|
|
2113
|
-
function
|
|
2363
|
+
function Je(e, t) {
|
|
2114
2364
|
return t === 1 || e.month < t ? e.year : e.year + 1;
|
|
2115
2365
|
}
|
|
2116
|
-
function
|
|
2366
|
+
function Ct(e) {
|
|
2117
2367
|
return e === 1 ? "1st" : e === 2 ? "2nd" : e === 3 ? "3rd" : `${e}th`;
|
|
2118
2368
|
}
|
|
2119
|
-
function
|
|
2120
|
-
|
|
2369
|
+
function Ut(e) {
|
|
2370
|
+
return e === "short" || e === "long" || e === "numeric" || e === "iso";
|
|
2371
|
+
}
|
|
2372
|
+
function de(e, t, r) {
|
|
2373
|
+
return t === "iso" ? `${p(e.year, 4)}-${p(e.month)}-${p(e.day)}` : b(r, {
|
|
2374
|
+
calendar: "gregory",
|
|
2375
|
+
month: t === "numeric" ? "numeric" : t === "long" ? "long" : "short",
|
|
2376
|
+
day: "numeric",
|
|
2377
|
+
year: "numeric",
|
|
2378
|
+
timeZone: "UTC"
|
|
2379
|
+
}).format(z(e));
|
|
2380
|
+
}
|
|
2381
|
+
function Jn(e, t, r, n) {
|
|
2382
|
+
const a = Ft(e, 1);
|
|
2383
|
+
switch (n) {
|
|
2384
|
+
case "week":
|
|
2385
|
+
return t === "numeric" || t === "iso" ? de(e, t, r) : `Week of ${de(e, t, r)}`;
|
|
2386
|
+
case "month":
|
|
2387
|
+
return t === "iso" ? `${p(e.year, 4)}-${p(e.month)}` : t === "numeric" ? `${p(e.month)}/${p(e.year, 4)}` : `${U(e.month, r, t === "long" ? "long" : "short")} ${e.year}`;
|
|
2388
|
+
case "quarter":
|
|
2389
|
+
return t === "iso" ? `${p(e.year, 4)}-Q${a}` : t === "long" ? `${Ct(a)} Quarter ${e.year}` : `Q${a} ${e.year}`;
|
|
2390
|
+
case "year":
|
|
2391
|
+
return String(e.year);
|
|
2392
|
+
default:
|
|
2393
|
+
return de(e, t, r);
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
function Te(e, t, r, n) {
|
|
2397
|
+
if (Ut(t))
|
|
2398
|
+
return Jn(e, t, r, n.granularity);
|
|
2399
|
+
const a = te(n) ?? 1, i = Ft(e, a);
|
|
2121
2400
|
switch (t) {
|
|
2122
2401
|
case "week_of_short":
|
|
2123
|
-
return `Week of ${
|
|
2402
|
+
return `Week of ${U(e.month, r, "short")} ${e.day}, ${e.year}`;
|
|
2124
2403
|
case "week_of_long":
|
|
2125
|
-
return `Week of ${
|
|
2404
|
+
return `Week of ${U(e.month, r, "long")} ${e.day}, ${e.year}`;
|
|
2126
2405
|
case "quarter_short":
|
|
2127
2406
|
return `Q${i} ${e.year}`;
|
|
2128
2407
|
case "quarter_long":
|
|
2129
|
-
return `${
|
|
2408
|
+
return `${Ct(i)} Quarter ${e.year}`;
|
|
2130
2409
|
case "fiscal_quarter_short":
|
|
2131
|
-
return `Q${i} FY${
|
|
2410
|
+
return `Q${i} FY${Je(e, a)}`;
|
|
2132
2411
|
case "fiscal_year":
|
|
2133
|
-
return `FY${
|
|
2412
|
+
return `FY${Je(e, a)}`;
|
|
2134
2413
|
}
|
|
2135
2414
|
}
|
|
2136
|
-
function
|
|
2137
|
-
const a =
|
|
2415
|
+
function Qn(e, t, r, n) {
|
|
2416
|
+
const a = te(t);
|
|
2138
2417
|
switch (t.granularity) {
|
|
2139
2418
|
case "second":
|
|
2140
2419
|
case "minute":
|
|
2141
2420
|
case "hour":
|
|
2142
|
-
return
|
|
2421
|
+
return Wn(e, r, n.dateTime);
|
|
2143
2422
|
case "day":
|
|
2144
|
-
return
|
|
2423
|
+
return Xe(e, r, n.dateStyle);
|
|
2145
2424
|
case "week":
|
|
2146
|
-
return `Week of ${
|
|
2425
|
+
return `Week of ${Xe(e, r, n.dateStyle)}`;
|
|
2147
2426
|
case "month":
|
|
2148
|
-
return
|
|
2427
|
+
return Xn(e, r, n.dateStyle);
|
|
2149
2428
|
case "quarter":
|
|
2150
|
-
return
|
|
2429
|
+
return Te(
|
|
2151
2430
|
e,
|
|
2152
2431
|
a ? "fiscal_quarter_short" : "quarter_short",
|
|
2153
2432
|
r,
|
|
2154
2433
|
t
|
|
2155
2434
|
);
|
|
2156
2435
|
case "year":
|
|
2157
|
-
return a ?
|
|
2436
|
+
return a ? Te(e, "fiscal_year", r, t) : String(e.year);
|
|
2158
2437
|
}
|
|
2159
2438
|
}
|
|
2160
|
-
function
|
|
2439
|
+
function li(e, t) {
|
|
2161
2440
|
if (t.granularity !== "second" && t.granularity !== "minute" && t.granularity !== "hour" && t.granularity !== "day" && t.granularity !== "month")
|
|
2162
2441
|
return;
|
|
2163
|
-
const r =
|
|
2442
|
+
const r = Nt(e, t);
|
|
2164
2443
|
if (!r.ok || r.value === null) return;
|
|
2165
|
-
const { year: n, month: a, day: i, hour: o, minute:
|
|
2166
|
-
return { year: n, month: a, day: i, hour: o, minute:
|
|
2444
|
+
const { year: n, month: a, day: i, hour: o, minute: c, second: s } = r.value;
|
|
2445
|
+
return { year: n, month: a, day: i, hour: o, minute: c, second: s };
|
|
2167
2446
|
}
|
|
2168
|
-
function
|
|
2169
|
-
const t =
|
|
2170
|
-
if (!t.ok || !
|
|
2171
|
-
throw new
|
|
2447
|
+
function ea(e) {
|
|
2448
|
+
const t = It(e.format);
|
|
2449
|
+
if (!t.ok || !Et(t.value, e.metadata))
|
|
2450
|
+
throw new q(
|
|
2172
2451
|
"invalid_temporal_bucket_format",
|
|
2173
2452
|
"Resolved temporal bucket format is invalid or inapplicable to its metadata."
|
|
2174
2453
|
);
|
|
2175
|
-
const r =
|
|
2454
|
+
const r = Nt(e.value, e.metadata);
|
|
2176
2455
|
if (!r.ok)
|
|
2177
|
-
throw new
|
|
2456
|
+
throw new q(
|
|
2178
2457
|
r.error.code,
|
|
2179
2458
|
r.error.message
|
|
2180
2459
|
);
|
|
2181
2460
|
if (r.value === null) return "(Blank)";
|
|
2182
2461
|
const { presentation: n, locale: a } = t.value;
|
|
2183
2462
|
if (n.mode === "auto")
|
|
2184
|
-
return
|
|
2463
|
+
return Qn(
|
|
2185
2464
|
r.value,
|
|
2186
2465
|
e.metadata,
|
|
2187
2466
|
a,
|
|
2188
2467
|
n.styles
|
|
2189
2468
|
);
|
|
2190
2469
|
if (n.mode === "preset")
|
|
2191
|
-
return
|
|
2470
|
+
return Te(
|
|
2192
2471
|
r.value,
|
|
2193
2472
|
n.preset,
|
|
2194
2473
|
a,
|
|
2195
2474
|
e.metadata
|
|
2196
2475
|
);
|
|
2197
|
-
const i =
|
|
2476
|
+
const i = R(n.pattern);
|
|
2198
2477
|
if (!i.ok)
|
|
2199
|
-
throw new
|
|
2478
|
+
throw new q(
|
|
2200
2479
|
"invalid_temporal_bucket_format",
|
|
2201
2480
|
i.message
|
|
2202
2481
|
);
|
|
2203
|
-
return
|
|
2482
|
+
return Gn(r.value, i.segments, a);
|
|
2204
2483
|
}
|
|
2205
|
-
function
|
|
2484
|
+
function mi(e, t) {
|
|
2206
2485
|
return t.levelLabels[e.id] ?? e.field.label ?? e.field.name;
|
|
2207
2486
|
}
|
|
2208
|
-
function
|
|
2487
|
+
function di(e, t) {
|
|
2209
2488
|
return t.measureLabels[e.id] ?? (e.kind === "aggregate" ? e.field.label ?? e.field.name : e.definition.label);
|
|
2210
2489
|
}
|
|
2211
|
-
function
|
|
2212
|
-
return
|
|
2490
|
+
function fi(e) {
|
|
2491
|
+
return qt.parse(ta(e));
|
|
2213
2492
|
}
|
|
2214
|
-
function
|
|
2215
|
-
const t =
|
|
2493
|
+
function ta(e) {
|
|
2494
|
+
const t = Kt.parse(e), r = (n) => ({
|
|
2216
2495
|
grand: { visible: !0, position: "after" },
|
|
2217
2496
|
levels: Object.fromEntries(
|
|
2218
2497
|
n.map((a) => [
|
|
@@ -2221,7 +2500,7 @@ function En(e) {
|
|
|
2221
2500
|
])
|
|
2222
2501
|
)
|
|
2223
2502
|
});
|
|
2224
|
-
return
|
|
2503
|
+
return Ht.parse({
|
|
2225
2504
|
version: 1,
|
|
2226
2505
|
spec: t,
|
|
2227
2506
|
presentation: {
|
|
@@ -2239,32 +2518,32 @@ function En(e) {
|
|
|
2239
2518
|
}
|
|
2240
2519
|
});
|
|
2241
2520
|
}
|
|
2242
|
-
function
|
|
2243
|
-
const r = new Map(e.map((n) => [
|
|
2244
|
-
for (const n of t ?? []) r.set(
|
|
2521
|
+
function ra(e, t) {
|
|
2522
|
+
const r = new Map(e.map((n) => [F(n), n]));
|
|
2523
|
+
for (const n of t ?? []) r.set(F(n), n);
|
|
2245
2524
|
return [...r.values()];
|
|
2246
2525
|
}
|
|
2247
|
-
function
|
|
2248
|
-
const { spec: t, presentation: r, defaults: n, session: a } =
|
|
2249
|
-
|
|
2526
|
+
function yi(e) {
|
|
2527
|
+
const { spec: t, presentation: r, defaults: n, session: a } = Zt.parse(e), i = new Map(
|
|
2528
|
+
ra(t.sorts, a == null ? void 0 : a.sorts).map((c) => [F(c), c])
|
|
2250
2529
|
);
|
|
2251
|
-
for (const
|
|
2252
|
-
for (const
|
|
2530
|
+
for (const c of ["rows", "columns"])
|
|
2531
|
+
for (const s of t[c]) {
|
|
2253
2532
|
const u = {
|
|
2254
|
-
axis:
|
|
2255
|
-
levelId:
|
|
2533
|
+
axis: c,
|
|
2534
|
+
levelId: s.id,
|
|
2256
2535
|
scope: { kind: "level" },
|
|
2257
2536
|
target: { kind: "member" },
|
|
2258
2537
|
direction: "asc",
|
|
2259
2538
|
nulls: "last"
|
|
2260
2539
|
};
|
|
2261
|
-
i.has(
|
|
2540
|
+
i.has(F(u)) || i.set(F(u), u);
|
|
2262
2541
|
}
|
|
2263
|
-
const o = (
|
|
2264
|
-
depth: Math.min(
|
|
2542
|
+
const o = (c, s) => ({
|
|
2543
|
+
depth: Math.min(c.depth, Math.max(0, s - 1)),
|
|
2265
2544
|
// Leaf toggles are valid but have no effect. Collapsed ancestors retain dormant overrides.
|
|
2266
|
-
overrides:
|
|
2267
|
-
(u) => u.path.length <
|
|
2545
|
+
overrides: c.overrides.filter(
|
|
2546
|
+
(u) => u.path.length < s
|
|
2268
2547
|
)
|
|
2269
2548
|
});
|
|
2270
2549
|
return {
|
|
@@ -2280,35 +2559,35 @@ function Pa(e) {
|
|
|
2280
2559
|
}
|
|
2281
2560
|
};
|
|
2282
2561
|
}
|
|
2283
|
-
class
|
|
2562
|
+
class Qe extends Error {
|
|
2284
2563
|
constructor(r) {
|
|
2285
2564
|
super(
|
|
2286
2565
|
`invalid_presentation_execution_snapshot: ${r} Resave this report before running it again.`
|
|
2287
2566
|
);
|
|
2288
|
-
|
|
2289
|
-
|
|
2567
|
+
x(this, "code", "invalid_presentation_execution_snapshot");
|
|
2568
|
+
x(this, "deliveryBlocking", !0);
|
|
2290
2569
|
this.name = "PresentationExecutionSnapshotError";
|
|
2291
2570
|
}
|
|
2292
2571
|
}
|
|
2293
|
-
class
|
|
2572
|
+
class gi extends Error {
|
|
2294
2573
|
constructor(r) {
|
|
2295
2574
|
super(
|
|
2296
2575
|
`missing_resolved_raw_temporal_format: Column "${r}" has no captured presentation. Resave this report before running it again.`
|
|
2297
2576
|
);
|
|
2298
|
-
|
|
2299
|
-
|
|
2577
|
+
x(this, "code", "missing_resolved_raw_temporal_format");
|
|
2578
|
+
x(this, "deliveryBlocking", !0);
|
|
2300
2579
|
this.name = "MissingResolvedRawTemporalFormatError";
|
|
2301
2580
|
}
|
|
2302
2581
|
}
|
|
2303
|
-
function
|
|
2582
|
+
function k(e, t, r) {
|
|
2304
2583
|
const n = new Set(t), a = Object.keys(e).find((i) => !n.has(i));
|
|
2305
2584
|
if (a)
|
|
2306
2585
|
throw new Error(`${r} contains unknown property "${a}"`);
|
|
2307
2586
|
}
|
|
2308
|
-
function
|
|
2587
|
+
function na(e, t = "scope") {
|
|
2309
2588
|
if (!g(e))
|
|
2310
2589
|
throw new Error(`${t} must be an object`);
|
|
2311
|
-
|
|
2590
|
+
k(
|
|
2312
2591
|
e,
|
|
2313
2592
|
["dashboardId", "cardId", "attachmentIndex"],
|
|
2314
2593
|
t
|
|
@@ -2330,22 +2609,22 @@ function Cn(e, t = "scope") {
|
|
|
2330
2609
|
...typeof a == "number" ? { attachmentIndex: a } : {}
|
|
2331
2610
|
};
|
|
2332
2611
|
}
|
|
2333
|
-
function
|
|
2612
|
+
function $(e, t, r, n) {
|
|
2334
2613
|
if (e.kind !== t) return;
|
|
2335
|
-
|
|
2614
|
+
k(e, ["kind", r], n);
|
|
2336
2615
|
const a = e[r];
|
|
2337
2616
|
if (typeof a != "string" || !a.trim())
|
|
2338
2617
|
throw new Error(`${n}.${r} is required`);
|
|
2339
2618
|
return a;
|
|
2340
2619
|
}
|
|
2341
|
-
function
|
|
2620
|
+
function fe(e, t) {
|
|
2342
2621
|
if (!g(e))
|
|
2343
2622
|
throw new Error(`${t} must be an object`);
|
|
2344
|
-
const r =
|
|
2623
|
+
const r = $(e, "metric", "metricId", t);
|
|
2345
2624
|
if (r) return { kind: "metric", metricId: r };
|
|
2346
|
-
const n =
|
|
2625
|
+
const n = $(e, "column", "columnKey", t);
|
|
2347
2626
|
if (n) return { kind: "column", columnKey: n };
|
|
2348
|
-
const a =
|
|
2627
|
+
const a = $(
|
|
2349
2628
|
e,
|
|
2350
2629
|
"matrix_measure",
|
|
2351
2630
|
"measureId",
|
|
@@ -2354,7 +2633,7 @@ function se(e, t) {
|
|
|
2354
2633
|
if (a) return { kind: "matrix_measure", measureId: a };
|
|
2355
2634
|
throw new Error(`${t} is not a valid numeric presentation target`);
|
|
2356
2635
|
}
|
|
2357
|
-
const
|
|
2636
|
+
const aa = [
|
|
2358
2637
|
"type",
|
|
2359
2638
|
"inputUnit",
|
|
2360
2639
|
"outputStyle",
|
|
@@ -2365,12 +2644,12 @@ const Un = [
|
|
|
2365
2644
|
"suffix",
|
|
2366
2645
|
"negativeStyle"
|
|
2367
2646
|
];
|
|
2368
|
-
function
|
|
2647
|
+
function ia(e) {
|
|
2369
2648
|
return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
|
|
2370
2649
|
}
|
|
2371
|
-
const
|
|
2372
|
-
function
|
|
2373
|
-
if (
|
|
2650
|
+
const oa = ["type", "locale", "pattern", "timezone", "sourceTimezone"];
|
|
2651
|
+
function sa(e, t) {
|
|
2652
|
+
if (k(e, oa, t), typeof e.locale != "string" || !e.locale.trim())
|
|
2374
2653
|
throw new Error(`${t}.locale must be a non-empty string`);
|
|
2375
2654
|
for (const r of ["pattern", "timezone", "sourceTimezone"])
|
|
2376
2655
|
if (e[r] !== void 0 && typeof e[r] != "string")
|
|
@@ -2383,10 +2662,10 @@ function Yn(e, t) {
|
|
|
2383
2662
|
...typeof e.sourceTimezone == "string" ? { sourceTimezone: e.sourceTimezone } : {}
|
|
2384
2663
|
};
|
|
2385
2664
|
}
|
|
2386
|
-
function
|
|
2387
|
-
|
|
2665
|
+
function ca(e, t) {
|
|
2666
|
+
k(e, aa, t);
|
|
2388
2667
|
for (const i of ["inputUnit", "largestUnit", "smallestUnit"])
|
|
2389
|
-
if (e[i] !== void 0 && !
|
|
2668
|
+
if (e[i] !== void 0 && !ia(e[i]))
|
|
2390
2669
|
throw new Error(`${t}.${i} must be a duration unit`);
|
|
2391
2670
|
const r = e.outputStyle;
|
|
2392
2671
|
if (r !== void 0 && r !== "compact" && r !== "digital" && r !== "long")
|
|
@@ -2412,11 +2691,11 @@ function Rn(e, t) {
|
|
|
2412
2691
|
...a !== void 0 ? { negativeStyle: a } : {}
|
|
2413
2692
|
};
|
|
2414
2693
|
}
|
|
2415
|
-
function
|
|
2694
|
+
function ua(e, t) {
|
|
2416
2695
|
if (!g(e))
|
|
2417
2696
|
throw new Error(`${t} must be an object`);
|
|
2418
2697
|
if (e.kind === "field") {
|
|
2419
|
-
|
|
2698
|
+
k(e, ["kind", "fieldId", "role"], t);
|
|
2420
2699
|
const a = typeof e.fieldId == "string" ? e.fieldId.trim() : "";
|
|
2421
2700
|
if (!a)
|
|
2422
2701
|
throw new Error(`${t}.fieldId is required`);
|
|
@@ -2429,9 +2708,9 @@ function On(e, t) {
|
|
|
2429
2708
|
...i ? { role: i } : {}
|
|
2430
2709
|
};
|
|
2431
2710
|
}
|
|
2432
|
-
const r =
|
|
2711
|
+
const r = $(e, "column", "columnKey", t);
|
|
2433
2712
|
if (r) return { kind: "column", columnKey: r };
|
|
2434
|
-
const n =
|
|
2713
|
+
const n = $(
|
|
2435
2714
|
e,
|
|
2436
2715
|
"matrix_axis",
|
|
2437
2716
|
"axisInstanceId",
|
|
@@ -2440,22 +2719,22 @@ function On(e, t) {
|
|
|
2440
2719
|
if (n) return { kind: "matrix_axis", axisInstanceId: n };
|
|
2441
2720
|
throw new Error(`${t} is not a valid temporal bucket presentation target`);
|
|
2442
2721
|
}
|
|
2443
|
-
function
|
|
2722
|
+
function la(e, t) {
|
|
2444
2723
|
if (!g(e))
|
|
2445
2724
|
throw new Error(`${t} must be an object`);
|
|
2446
|
-
const r =
|
|
2725
|
+
const r = $(e, "column", "columnKey", t);
|
|
2447
2726
|
if (!r)
|
|
2448
2727
|
throw new Error(`${t} must identify a column`);
|
|
2449
2728
|
return { kind: "column", columnKey: r };
|
|
2450
2729
|
}
|
|
2451
|
-
function
|
|
2730
|
+
function ma(e) {
|
|
2452
2731
|
return [
|
|
2453
2732
|
e.dashboardId,
|
|
2454
2733
|
e.cardId ?? null,
|
|
2455
2734
|
e.attachmentIndex ?? null
|
|
2456
2735
|
];
|
|
2457
2736
|
}
|
|
2458
|
-
function
|
|
2737
|
+
function J(e) {
|
|
2459
2738
|
switch (e.kind) {
|
|
2460
2739
|
case "metric":
|
|
2461
2740
|
return [e.kind, e.metricId];
|
|
@@ -2469,37 +2748,37 @@ function V(e) {
|
|
|
2469
2748
|
return [e.kind, e.axisInstanceId];
|
|
2470
2749
|
}
|
|
2471
2750
|
}
|
|
2472
|
-
function
|
|
2751
|
+
function re(e, t) {
|
|
2473
2752
|
return e.dashboardId === t.dashboardId && e.cardId === t.cardId && e.attachmentIndex === t.attachmentIndex;
|
|
2474
2753
|
}
|
|
2475
|
-
function
|
|
2476
|
-
const r =
|
|
2754
|
+
function ne(e, t) {
|
|
2755
|
+
const r = J(e), n = J(t);
|
|
2477
2756
|
return r.length === n.length && r.every((a, i) => a === n[i]);
|
|
2478
2757
|
}
|
|
2479
|
-
function
|
|
2758
|
+
function da(e) {
|
|
2480
2759
|
if (!Array.isArray(e))
|
|
2481
2760
|
throw new Error("resolvedFormats must be an array");
|
|
2482
2761
|
const t = /* @__PURE__ */ new Set();
|
|
2483
2762
|
return e.map((r, n) => {
|
|
2484
|
-
var
|
|
2763
|
+
var s, u;
|
|
2485
2764
|
const a = `resolvedFormats.${n}`;
|
|
2486
2765
|
if (!g(r))
|
|
2487
2766
|
throw new Error(`${a} must be an object`);
|
|
2488
|
-
|
|
2489
|
-
const i =
|
|
2767
|
+
k(r, ["scope", "target", "format"], a);
|
|
2768
|
+
const i = na(r.scope, `${a}.scope`);
|
|
2490
2769
|
if (!g(r.format))
|
|
2491
2770
|
throw new Error(`${a}.format must be an object`);
|
|
2492
2771
|
let o;
|
|
2493
2772
|
switch (r.format.type) {
|
|
2494
2773
|
case "temporal_bucket": {
|
|
2495
|
-
const l =
|
|
2774
|
+
const l = It(r.format);
|
|
2496
2775
|
if (!l.ok)
|
|
2497
2776
|
throw new Error(
|
|
2498
|
-
`${a}.format is invalid: ${((
|
|
2777
|
+
`${a}.format is invalid: ${((s = l.issues[0]) == null ? void 0 : s.message) ?? "invalid value"}`
|
|
2499
2778
|
);
|
|
2500
2779
|
o = {
|
|
2501
2780
|
scope: i,
|
|
2502
|
-
target:
|
|
2781
|
+
target: ua(r.target, `${a}.target`),
|
|
2503
2782
|
format: l.value
|
|
2504
2783
|
};
|
|
2505
2784
|
break;
|
|
@@ -2507,42 +2786,42 @@ function jn(e) {
|
|
|
2507
2786
|
case "raw_temporal":
|
|
2508
2787
|
o = {
|
|
2509
2788
|
scope: i,
|
|
2510
|
-
target:
|
|
2511
|
-
format:
|
|
2789
|
+
target: la(r.target, `${a}.target`),
|
|
2790
|
+
format: ve(r.format)
|
|
2512
2791
|
};
|
|
2513
2792
|
break;
|
|
2514
2793
|
case "number":
|
|
2515
2794
|
case "currency":
|
|
2516
2795
|
case "percent":
|
|
2517
2796
|
case "scientific": {
|
|
2518
|
-
const l =
|
|
2797
|
+
const l = sn(r.format);
|
|
2519
2798
|
if (!l.ok)
|
|
2520
2799
|
throw new Error(
|
|
2521
2800
|
`${a}.format is invalid: ${((u = l.issues[0]) == null ? void 0 : u.message) ?? "invalid value"}`
|
|
2522
2801
|
);
|
|
2523
2802
|
o = {
|
|
2524
2803
|
scope: i,
|
|
2525
|
-
target:
|
|
2804
|
+
target: fe(r.target, `${a}.target`),
|
|
2526
2805
|
format: l.value
|
|
2527
2806
|
};
|
|
2528
2807
|
break;
|
|
2529
2808
|
}
|
|
2530
2809
|
case "date": {
|
|
2531
|
-
const l =
|
|
2810
|
+
const l = fe(r.target, `${a}.target`);
|
|
2532
2811
|
if (l.kind !== "column")
|
|
2533
2812
|
throw new Error(`${a}.target must identify a column for a date format`);
|
|
2534
2813
|
o = {
|
|
2535
2814
|
scope: i,
|
|
2536
2815
|
target: l,
|
|
2537
|
-
format:
|
|
2816
|
+
format: sa(r.format, `${a}.format`)
|
|
2538
2817
|
};
|
|
2539
2818
|
break;
|
|
2540
2819
|
}
|
|
2541
2820
|
case "duration":
|
|
2542
2821
|
o = {
|
|
2543
2822
|
scope: i,
|
|
2544
|
-
target:
|
|
2545
|
-
format:
|
|
2823
|
+
target: fe(r.target, `${a}.target`),
|
|
2824
|
+
format: ca(
|
|
2546
2825
|
r.format,
|
|
2547
2826
|
`${a}.format`
|
|
2548
2827
|
)
|
|
@@ -2551,28 +2830,28 @@ function jn(e) {
|
|
|
2551
2830
|
default:
|
|
2552
2831
|
throw new Error(`${a}.format.type is unsupported`);
|
|
2553
2832
|
}
|
|
2554
|
-
const
|
|
2555
|
-
...
|
|
2556
|
-
...
|
|
2833
|
+
const c = JSON.stringify([
|
|
2834
|
+
...ma(o.scope),
|
|
2835
|
+
...J(o.target)
|
|
2557
2836
|
]);
|
|
2558
|
-
if (t.has(
|
|
2837
|
+
if (t.has(c))
|
|
2559
2838
|
throw new Error(
|
|
2560
2839
|
`${a} duplicates a scoped presentation target`
|
|
2561
2840
|
);
|
|
2562
|
-
return t.add(
|
|
2841
|
+
return t.add(c), o;
|
|
2563
2842
|
});
|
|
2564
2843
|
}
|
|
2565
|
-
function
|
|
2844
|
+
function fa(e) {
|
|
2566
2845
|
try {
|
|
2567
2846
|
if (!g(e))
|
|
2568
2847
|
throw new Error("presentation execution snapshot must be an object");
|
|
2569
|
-
if (
|
|
2848
|
+
if (k(
|
|
2570
2849
|
e,
|
|
2571
2850
|
["version", "reportContext", "resolvedFormats"],
|
|
2572
2851
|
"presentation execution snapshot"
|
|
2573
2852
|
), e.version !== 1)
|
|
2574
2853
|
throw new Error("presentation execution snapshot version must be 1");
|
|
2575
|
-
const t =
|
|
2854
|
+
const t = Vt(e.reportContext);
|
|
2576
2855
|
if (!t.ok) {
|
|
2577
2856
|
const r = t.issues[0];
|
|
2578
2857
|
throw new Error(
|
|
@@ -2582,50 +2861,50 @@ function Kn(e) {
|
|
|
2582
2861
|
return {
|
|
2583
2862
|
version: 1,
|
|
2584
2863
|
reportContext: t.value,
|
|
2585
|
-
resolvedFormats:
|
|
2864
|
+
resolvedFormats: da(e.resolvedFormats)
|
|
2586
2865
|
};
|
|
2587
2866
|
} catch (t) {
|
|
2588
|
-
throw t instanceof
|
|
2867
|
+
throw t instanceof Qe ? t : new Qe(
|
|
2589
2868
|
t instanceof Error ? t.message : "Snapshot is invalid."
|
|
2590
2869
|
);
|
|
2591
2870
|
}
|
|
2592
2871
|
}
|
|
2593
|
-
function
|
|
2594
|
-
return
|
|
2872
|
+
function hi(e) {
|
|
2873
|
+
return fa({
|
|
2595
2874
|
version: 1,
|
|
2596
2875
|
reportContext: e.reportContext,
|
|
2597
2876
|
resolvedFormats: [...e.resolvedFormats]
|
|
2598
2877
|
});
|
|
2599
2878
|
}
|
|
2600
|
-
function
|
|
2601
|
-
const t =
|
|
2602
|
-
return
|
|
2879
|
+
function pi(e) {
|
|
2880
|
+
const t = ya(e);
|
|
2881
|
+
return Q(t) ? t : void 0;
|
|
2603
2882
|
}
|
|
2604
|
-
function
|
|
2883
|
+
function ya(e) {
|
|
2605
2884
|
const t = e.snapshot.resolvedFormats.find(
|
|
2606
|
-
(r) => r.format.type !== "temporal_bucket" && r.format.type !== "raw_temporal" && r.format.type !== "date" &&
|
|
2885
|
+
(r) => r.format.type !== "temporal_bucket" && r.format.type !== "raw_temporal" && r.format.type !== "date" && re(r.scope, e.scope) && ne(r.target, e.target)
|
|
2607
2886
|
);
|
|
2608
2887
|
return t == null ? void 0 : t.format;
|
|
2609
2888
|
}
|
|
2610
|
-
function
|
|
2889
|
+
function wi(e) {
|
|
2611
2890
|
const t = e.snapshot.resolvedFormats.find(
|
|
2612
|
-
(r) => r.format.type === "date" &&
|
|
2891
|
+
(r) => r.format.type === "date" && re(r.scope, e.scope) && ne(r.target, e.target)
|
|
2613
2892
|
);
|
|
2614
2893
|
return t == null ? void 0 : t.format;
|
|
2615
2894
|
}
|
|
2616
|
-
function
|
|
2895
|
+
function Ti(e) {
|
|
2617
2896
|
const t = e.snapshot.resolvedFormats.find(
|
|
2618
|
-
(r) => r.format.type === "raw_temporal" &&
|
|
2897
|
+
(r) => r.format.type === "raw_temporal" && re(r.scope, e.scope) && ne(r.target, e.target)
|
|
2619
2898
|
);
|
|
2620
2899
|
return t == null ? void 0 : t.format;
|
|
2621
2900
|
}
|
|
2622
|
-
function
|
|
2901
|
+
function Si(e) {
|
|
2623
2902
|
const t = e.snapshot.resolvedFormats.find(
|
|
2624
|
-
(r) => r.format.type === "temporal_bucket" &&
|
|
2903
|
+
(r) => r.format.type === "temporal_bucket" && re(r.scope, e.scope) && ne(r.target, e.target)
|
|
2625
2904
|
);
|
|
2626
2905
|
return t == null ? void 0 : t.format;
|
|
2627
2906
|
}
|
|
2628
|
-
function
|
|
2907
|
+
function Di(e) {
|
|
2629
2908
|
var a;
|
|
2630
2909
|
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
2631
2910
|
if (e.snapshot.resolvedFormats.forEach((i, o) => {
|
|
@@ -2638,12 +2917,12 @@ function Ba(e) {
|
|
|
2638
2917
|
`resolvedFormats.${o}.scope must match the executing dashboard/card`
|
|
2639
2918
|
);
|
|
2640
2919
|
if (i.target.kind === "field" && i.format.type === "temporal_bucket") {
|
|
2641
|
-
const
|
|
2642
|
-
if (r.has(
|
|
2920
|
+
const c = JSON.stringify(J(i.target));
|
|
2921
|
+
if (r.has(c))
|
|
2643
2922
|
throw new Error(
|
|
2644
2923
|
`resolvedFormats.${o} duplicates export field "${i.target.fieldId}"`
|
|
2645
2924
|
);
|
|
2646
|
-
r.add(
|
|
2925
|
+
r.add(c);
|
|
2647
2926
|
return;
|
|
2648
2927
|
}
|
|
2649
2928
|
if (i.target.kind !== "column")
|
|
@@ -2666,78 +2945,78 @@ function Ba(e) {
|
|
|
2666
2945
|
`resolvedFormats is missing visible export column "${n}"`
|
|
2667
2946
|
);
|
|
2668
2947
|
}
|
|
2669
|
-
const
|
|
2670
|
-
function
|
|
2948
|
+
const ga = /* @__PURE__ */ new Set(["short", "medium", "long"]), ha = /^(\d{4})-(\d{2})-(\d{2})$/, pa = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, wa = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, _e = " – ";
|
|
2949
|
+
function xi(e) {
|
|
2671
2950
|
if (!g(e)) return;
|
|
2672
2951
|
const t = Object.keys(e);
|
|
2673
2952
|
if (e.mode === "period_label" && t.length === 1)
|
|
2674
2953
|
return { mode: "period_label" };
|
|
2675
|
-
if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" &&
|
|
2954
|
+
if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" && ga.has(e.dateStyle))
|
|
2676
2955
|
return { mode: "style", dateStyle: e.dateStyle };
|
|
2677
|
-
if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" &&
|
|
2956
|
+
if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" && Ta(e.pattern) === null)
|
|
2678
2957
|
return {
|
|
2679
2958
|
mode: "pattern",
|
|
2680
2959
|
dialect: "semaphor_tokens",
|
|
2681
2960
|
pattern: e.pattern
|
|
2682
2961
|
};
|
|
2683
2962
|
}
|
|
2684
|
-
function
|
|
2963
|
+
function Ta(e) {
|
|
2685
2964
|
try {
|
|
2686
|
-
return
|
|
2965
|
+
return Fn({ dialect: "semaphor_tokens", pattern: e }), null;
|
|
2687
2966
|
} catch (t) {
|
|
2688
2967
|
return t instanceof Error ? t.message : "The pattern is invalid.";
|
|
2689
2968
|
}
|
|
2690
2969
|
}
|
|
2691
|
-
function
|
|
2970
|
+
function vi(e) {
|
|
2692
2971
|
const { value: t, part: r, presentation: n, preferences: a, calendar: i } = e;
|
|
2693
2972
|
if ((n == null ? void 0 : n.mode) === "period_label" && t.periodLabel && r === "range")
|
|
2694
2973
|
return { ok: !0, text: t.periodLabel };
|
|
2695
|
-
const [o,
|
|
2974
|
+
const [o, c] = t.bounds, u = c === void 0 || r === "start" ? [{ raw: o, role: "start" }] : r === "end" ? [{ raw: c, role: "end" }] : [
|
|
2696
2975
|
{ raw: o, role: "start" },
|
|
2697
|
-
{ raw:
|
|
2698
|
-
], l = u.map(({ raw: h }) =>
|
|
2976
|
+
{ raw: c, role: "end" }
|
|
2977
|
+
], l = u.map(({ raw: h }) => va(h, i.tz));
|
|
2699
2978
|
if (l.some((h) => h === null))
|
|
2700
2979
|
return {
|
|
2701
2980
|
ok: !1,
|
|
2702
|
-
text: u.map(({ raw: h }) => h).join(
|
|
2981
|
+
text: u.map(({ raw: h }) => h).join(_e),
|
|
2703
2982
|
diagnostic: {
|
|
2704
2983
|
code: "invalid_temporal_input_value",
|
|
2705
2984
|
message: "A date input bound is not a date or an instant."
|
|
2706
2985
|
}
|
|
2707
2986
|
};
|
|
2708
2987
|
const d = t.precision === "day" ? l.map(
|
|
2709
|
-
(h,
|
|
2988
|
+
(h, Yt) => _a(h, u[Yt].role, i.tz)
|
|
2710
2989
|
) : [], y = d.length > 0 && d.every((h) => h !== null) ? d : null;
|
|
2711
|
-
return { ok: !0, text: y ?
|
|
2712
|
-
l.map((h) =>
|
|
2990
|
+
return { ok: !0, text: y ? Sa(y, n, a, i) : Da(
|
|
2991
|
+
l.map((h) => ka(h, i.tz)),
|
|
2713
2992
|
n,
|
|
2714
2993
|
a,
|
|
2715
2994
|
i
|
|
2716
2995
|
) };
|
|
2717
2996
|
}
|
|
2718
|
-
function
|
|
2997
|
+
function Sa(e, t, r, n) {
|
|
2719
2998
|
const [a, i = a] = e;
|
|
2720
2999
|
if ((t == null ? void 0 : t.mode) === "pattern")
|
|
2721
|
-
return
|
|
3000
|
+
return Ot(
|
|
2722
3001
|
e.map(
|
|
2723
|
-
(
|
|
3002
|
+
(s) => At(Se(s), "date", t.pattern, r, n)
|
|
2724
3003
|
)
|
|
2725
3004
|
);
|
|
2726
3005
|
const o = (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : r.dateStyle;
|
|
2727
3006
|
if (!t || t.mode === "period_label") {
|
|
2728
|
-
const
|
|
2729
|
-
if (
|
|
2730
|
-
return
|
|
2731
|
-
value:
|
|
3007
|
+
const s = ba(a, i, n);
|
|
3008
|
+
if (s)
|
|
3009
|
+
return ea({
|
|
3010
|
+
value: Se(a),
|
|
2732
3011
|
metadata: {
|
|
2733
3012
|
kind: "temporal_bucket",
|
|
2734
|
-
granularity:
|
|
3013
|
+
granularity: s,
|
|
2735
3014
|
calendar: { tz: n.tz, weekStart: n.weekStart ?? 1 }
|
|
2736
3015
|
},
|
|
2737
|
-
format:
|
|
3016
|
+
format: Vn({
|
|
2738
3017
|
metadata: {
|
|
2739
3018
|
kind: "temporal_bucket",
|
|
2740
|
-
granularity:
|
|
3019
|
+
granularity: s,
|
|
2741
3020
|
calendar: { tz: n.tz, weekStart: n.weekStart ?? 1 }
|
|
2742
3021
|
},
|
|
2743
3022
|
locale: r.locale,
|
|
@@ -2745,19 +3024,19 @@ function Wn(e, t, r, n) {
|
|
|
2745
3024
|
}).format
|
|
2746
3025
|
});
|
|
2747
3026
|
}
|
|
2748
|
-
const
|
|
3027
|
+
const c = new Intl.DateTimeFormat(r.locale, {
|
|
2749
3028
|
calendar: "gregory",
|
|
2750
3029
|
timeZone: "UTC",
|
|
2751
3030
|
dateStyle: o
|
|
2752
3031
|
});
|
|
2753
|
-
return
|
|
3032
|
+
return Ma(a, i) ? c.format(B(a)) : zt(c, B(a), B(i));
|
|
2754
3033
|
}
|
|
2755
|
-
function
|
|
3034
|
+
function Da(e, t, r, n) {
|
|
2756
3035
|
if ((t == null ? void 0 : t.mode) === "pattern")
|
|
2757
|
-
return
|
|
3036
|
+
return Ot(
|
|
2758
3037
|
e.map(
|
|
2759
|
-
(
|
|
2760
|
-
|
|
3038
|
+
(c) => At(
|
|
3039
|
+
c.toISOString(),
|
|
2761
3040
|
"instant",
|
|
2762
3041
|
t.pattern,
|
|
2763
3042
|
r,
|
|
@@ -2771,14 +3050,14 @@ function Xn(e, t, r, n) {
|
|
|
2771
3050
|
dateStyle: (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : r.dateTime.dateStyle,
|
|
2772
3051
|
timeStyle: r.dateTime.timeStyle
|
|
2773
3052
|
}), [i, o] = e;
|
|
2774
|
-
return o && o.getTime() !== i.getTime() ?
|
|
3053
|
+
return o && o.getTime() !== i.getTime() ? zt(a, i, o) : a.format(i);
|
|
2775
3054
|
}
|
|
2776
|
-
function
|
|
3055
|
+
function zt(e, t, r) {
|
|
2777
3056
|
const n = e;
|
|
2778
|
-
return typeof n.formatRange == "function" ? n.formatRange(t, r) : `${e.format(t)}${
|
|
3057
|
+
return typeof n.formatRange == "function" ? n.formatRange(t, r) : `${e.format(t)}${_e}${e.format(r)}`;
|
|
2779
3058
|
}
|
|
2780
|
-
function
|
|
2781
|
-
const i =
|
|
3059
|
+
function At(e, t, r, n, a) {
|
|
3060
|
+
const i = xn({
|
|
2782
3061
|
format: {
|
|
2783
3062
|
type: "raw_temporal",
|
|
2784
3063
|
presentation: { mode: "pattern", dialect: "semaphor_tokens", pattern: r }
|
|
@@ -2786,154 +3065,164 @@ function St(e, t, r, n, a) {
|
|
|
2786
3065
|
// Temporal formatting reads no currency.
|
|
2787
3066
|
preferences: {
|
|
2788
3067
|
...n,
|
|
2789
|
-
defaultCurrency:
|
|
3068
|
+
defaultCurrency: Gt.defaultCurrency
|
|
2790
3069
|
},
|
|
2791
3070
|
calendar: { tz: a.tz }
|
|
2792
|
-
}), o = t === "date" &&
|
|
2793
|
-
return
|
|
2794
|
-
value: o === t ? e :
|
|
3071
|
+
}), o = t === "date" && xa(r) ? "instant" : t;
|
|
3072
|
+
return Rn({
|
|
3073
|
+
value: o === t ? e : ee(`${e}T00:00:00`, a.tz).toISOString(),
|
|
2795
3074
|
metadata: { kind: "raw_temporal", valueKind: o },
|
|
2796
3075
|
format: i
|
|
2797
3076
|
}).text;
|
|
2798
3077
|
}
|
|
2799
|
-
function
|
|
3078
|
+
function xa(e) {
|
|
2800
3079
|
return /HH|mm|ss/.test(e);
|
|
2801
3080
|
}
|
|
2802
|
-
function
|
|
2803
|
-
return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(
|
|
3081
|
+
function Ot(e) {
|
|
3082
|
+
return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(_e);
|
|
2804
3083
|
}
|
|
2805
|
-
function
|
|
2806
|
-
const r =
|
|
3084
|
+
function va(e, t) {
|
|
3085
|
+
const r = ha.exec(e);
|
|
2807
3086
|
if (r) {
|
|
2808
3087
|
const a = {
|
|
2809
3088
|
year: Number(r[1]),
|
|
2810
3089
|
month: Number(r[2]),
|
|
2811
3090
|
day: Number(r[3])
|
|
2812
3091
|
};
|
|
2813
|
-
return
|
|
3092
|
+
return Na(a) ? { kind: "date", date: a } : null;
|
|
2814
3093
|
}
|
|
2815
|
-
const n =
|
|
3094
|
+
const n = wa.test(e) ? new Date(e.replace(" ", "T")) : pa.test(e) ? ee(e.replace(" ", "T"), t) : null;
|
|
2816
3095
|
return n && !Number.isNaN(n.getTime()) ? { kind: "instant", instant: n } : null;
|
|
2817
3096
|
}
|
|
2818
|
-
function
|
|
2819
|
-
return e.kind === "instant" ? e.instant :
|
|
3097
|
+
function ka(e, t) {
|
|
3098
|
+
return e.kind === "instant" ? e.instant : ee(`${Se(e.date)}T00:00:00`, t);
|
|
2820
3099
|
}
|
|
2821
|
-
function
|
|
3100
|
+
function _a(e, t, r) {
|
|
2822
3101
|
if (e.kind === "date") return e.date;
|
|
2823
|
-
const n =
|
|
2824
|
-
if (n.hour === 0 && n.minute === 0 && n.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? a :
|
|
3102
|
+
const n = Xt(e.instant, r), a = { year: n.year, month: n.month, day: n.day };
|
|
3103
|
+
if (n.hour === 0 && n.minute === 0 && n.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? a : $a(a, -1);
|
|
2825
3104
|
const o = n.hour === 23 && n.minute === 59 && n.second === 59;
|
|
2826
3105
|
return t === "end" && o ? a : null;
|
|
2827
3106
|
}
|
|
2828
|
-
function
|
|
2829
|
-
return r.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !==
|
|
3107
|
+
function ba(e, t, r) {
|
|
3108
|
+
return r.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !== Rt(t.year, t.month) ? null : e.month === t.month ? "month" : e.month % 3 === 1 && t.month === e.month + 2 ? "quarter" : e.month === 1 && t.month === 12 ? "year" : null;
|
|
2830
3109
|
}
|
|
2831
|
-
function
|
|
3110
|
+
function Se(e) {
|
|
2832
3111
|
return `${String(e.year).padStart(4, "0")}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}`;
|
|
2833
3112
|
}
|
|
2834
|
-
function
|
|
3113
|
+
function B(e) {
|
|
2835
3114
|
const t = /* @__PURE__ */ new Date(0);
|
|
2836
3115
|
return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(0, 0, 0, 0), t;
|
|
2837
3116
|
}
|
|
2838
|
-
function
|
|
2839
|
-
const r =
|
|
3117
|
+
function $a(e, t) {
|
|
3118
|
+
const r = B(e);
|
|
2840
3119
|
return r.setUTCDate(r.getUTCDate() + t), {
|
|
2841
3120
|
year: r.getUTCFullYear(),
|
|
2842
3121
|
month: r.getUTCMonth() + 1,
|
|
2843
3122
|
day: r.getUTCDate()
|
|
2844
3123
|
};
|
|
2845
3124
|
}
|
|
2846
|
-
function
|
|
3125
|
+
function Ma(e, t) {
|
|
2847
3126
|
return e.year === t.year && e.month === t.month && e.day === t.day;
|
|
2848
3127
|
}
|
|
2849
|
-
function
|
|
3128
|
+
function Rt(e, t) {
|
|
2850
3129
|
return new Date(Date.UTC(e, t, 0)).getUTCDate();
|
|
2851
3130
|
}
|
|
2852
|
-
function
|
|
2853
|
-
return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <=
|
|
3131
|
+
function Na(e) {
|
|
3132
|
+
return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= Rt(e.year, e.month);
|
|
2854
3133
|
}
|
|
2855
3134
|
export {
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
3135
|
+
q as $,
|
|
3136
|
+
Wr as A,
|
|
3137
|
+
Xr as B,
|
|
3138
|
+
Qa as C,
|
|
3139
|
+
Jr as D,
|
|
3140
|
+
ei as E,
|
|
3141
|
+
on as F,
|
|
3142
|
+
sn as G,
|
|
3143
|
+
ri as H,
|
|
3144
|
+
cn as I,
|
|
3145
|
+
ni as J,
|
|
3146
|
+
na as K,
|
|
3147
|
+
da as L,
|
|
3148
|
+
gi as M,
|
|
3149
|
+
fa as N,
|
|
3150
|
+
hi as O,
|
|
3151
|
+
Qe as P,
|
|
3152
|
+
pi as Q,
|
|
2874
3153
|
N as R,
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
Za as
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
3154
|
+
wi as S,
|
|
3155
|
+
Si as T,
|
|
3156
|
+
Di as U,
|
|
3157
|
+
ln as V,
|
|
3158
|
+
dn as W,
|
|
3159
|
+
R as X,
|
|
3160
|
+
Tt as Y,
|
|
3161
|
+
ai as Z,
|
|
3162
|
+
Yn as _,
|
|
3163
|
+
ya as a,
|
|
3164
|
+
Nt as a0,
|
|
3165
|
+
ui as a1,
|
|
3166
|
+
It as a2,
|
|
3167
|
+
Vn as a3,
|
|
3168
|
+
li as a4,
|
|
3169
|
+
ea as a5,
|
|
3170
|
+
ve as a6,
|
|
3171
|
+
vn as a7,
|
|
3172
|
+
si as a8,
|
|
3173
|
+
kn as a9,
|
|
3174
|
+
v as aA,
|
|
3175
|
+
He as aB,
|
|
3176
|
+
je as aC,
|
|
3177
|
+
ci as aa,
|
|
3178
|
+
Rn as ab,
|
|
3179
|
+
xi as ac,
|
|
3180
|
+
Ta as ad,
|
|
3181
|
+
vi as ae,
|
|
3182
|
+
yi as af,
|
|
3183
|
+
Pa as ag,
|
|
3184
|
+
mi as ah,
|
|
3185
|
+
Ga as ai,
|
|
3186
|
+
en as aj,
|
|
3187
|
+
di as ak,
|
|
3188
|
+
fi as al,
|
|
3189
|
+
ta as am,
|
|
3190
|
+
ra as an,
|
|
3191
|
+
Qr as ao,
|
|
3192
|
+
dr as ap,
|
|
3193
|
+
Va as aq,
|
|
3194
|
+
Ba as ar,
|
|
3195
|
+
qa as as,
|
|
3196
|
+
dt as at,
|
|
3197
|
+
Za as au,
|
|
3198
|
+
Ha as av,
|
|
3199
|
+
gt as aw,
|
|
3200
|
+
Oe as ax,
|
|
3201
|
+
ee as ay,
|
|
3202
|
+
Ze as az,
|
|
3203
|
+
La as b,
|
|
3204
|
+
oi as c,
|
|
3205
|
+
ti as d,
|
|
3206
|
+
Ya as e,
|
|
3207
|
+
Ti as f,
|
|
3208
|
+
De as g,
|
|
3209
|
+
ct as h,
|
|
3210
|
+
Q as i,
|
|
3211
|
+
ut as j,
|
|
3212
|
+
lt as k,
|
|
3213
|
+
mt as l,
|
|
3214
|
+
ja as m,
|
|
3215
|
+
Ka as n,
|
|
3216
|
+
cr as o,
|
|
3217
|
+
On as p,
|
|
3218
|
+
it as q,
|
|
3219
|
+
xn as r,
|
|
3220
|
+
ii as s,
|
|
3221
|
+
qr as t,
|
|
3222
|
+
Wa as u,
|
|
3223
|
+
Fn as v,
|
|
3224
|
+
W as w,
|
|
3225
|
+
_ as x,
|
|
3226
|
+
Xa as y,
|
|
3227
|
+
Ja as z
|
|
2939
3228
|
};
|