@epam/statgpt-sdmx-toolkit 0.4.0-rc.9 → 0.4.0
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/api/availability-api.d.ts +1 -1
- package/api/dataset-api.d.ts +3 -3
- package/api/hierarchy-api.d.ts +8 -0
- package/api/index.d.ts +1 -0
- package/api/sdmx-api-client.d.ts +5 -4
- package/api/sdmx-config.d.ts +2 -0
- package/index.cjs +2 -2
- package/index.mjs +1366 -1226
- package/models/index.d.ts +1 -0
- package/models/structural-metadata/glossary.d.ts +8 -0
- package/models/structural-metadata/hierarchy.d.ts +27 -0
- package/models/structural-metadata/structural-metadata.d.ts +5 -0
- package/package.json +3 -3
- package/utils/download.d.ts +1 -1
- package/utils/hierarchy-utils.d.ts +8 -0
- package/utils/index.d.ts +1 -0
- package/utils/wildcards.d.ts +1 -1
package/index.mjs
CHANGED
|
@@ -1,192 +1,197 @@
|
|
|
1
|
-
const
|
|
1
|
+
const z = (t) => {
|
|
2
2
|
if (t != null) {
|
|
3
3
|
const e = t.split("=");
|
|
4
4
|
return e.length === 1 ? t : e[1];
|
|
5
5
|
}
|
|
6
|
-
},
|
|
6
|
+
}, C = (t) => {
|
|
7
7
|
if (t == null)
|
|
8
8
|
return {};
|
|
9
|
-
const e =
|
|
9
|
+
const e = z(t), n = {
|
|
10
10
|
agency: "",
|
|
11
11
|
id: "",
|
|
12
12
|
version: ""
|
|
13
13
|
};
|
|
14
14
|
return e && (e.includes(":") && (n.agency = e.split(":")[0], n.id = e.split(":")[1].split("(")[0]), e.includes("(") && e.includes(")") && (n.version = e.split("(")[1]?.split(")")[0])), n;
|
|
15
|
-
},
|
|
16
|
-
const [e, n] = t.split(")."), { agency: r, id: s, version: a } =
|
|
15
|
+
}, nt = (t) => {
|
|
16
|
+
const [e, n] = t.split(")."), { agency: r, id: s, version: a } = C(e + ")");
|
|
17
17
|
return { childId: n, agency: r, id: s, version: a };
|
|
18
|
-
},
|
|
18
|
+
}, ue = (t, e, n) => {
|
|
19
19
|
const r = e === "" ? "" : `(${e})`;
|
|
20
20
|
return `${n}:${t}${r}`;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
23
|
-
function
|
|
22
|
+
var de = /* @__PURE__ */ ((t) => (t.DESCENDANTS = "descendants", t.NONE = "none", t.ALL = "all", t))(de || {}), rt = /* @__PURE__ */ ((t) => (t.EXACT = "exact", t.AVAILABLE = "available", t))(rt || {});
|
|
23
|
+
function Nt(t) {
|
|
24
24
|
return {
|
|
25
25
|
data: {
|
|
26
26
|
codelists: t.data.codelists,
|
|
27
27
|
conceptSchemes: t.data.conceptSchemes,
|
|
28
|
-
dataConstraints: t.data.dataConstraints?.map(
|
|
28
|
+
dataConstraints: t.data.dataConstraints?.map(Rt),
|
|
29
29
|
dataflows: t.data.dataflows,
|
|
30
30
|
dataStructures: t.data.dataStructures,
|
|
31
31
|
metadataStructures: t.data.metadataStructures
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Rt(t) {
|
|
36
36
|
return {
|
|
37
37
|
...t,
|
|
38
|
-
cubeRegions: t.cubeRegions?.map(
|
|
38
|
+
cubeRegions: t.cubeRegions?.map(kt)
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function kt(t) {
|
|
42
42
|
return {
|
|
43
43
|
isIncluded: t.include,
|
|
44
|
-
memberSelection: t.keyValues.map(
|
|
44
|
+
memberSelection: t.keyValues.map(_t)
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function _t(t) {
|
|
48
48
|
return {
|
|
49
49
|
included: t.include,
|
|
50
50
|
componentId: t.id,
|
|
51
|
-
selectionValues: t.values.map(
|
|
51
|
+
selectionValues: t.values.map(It)
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function It(t) {
|
|
55
55
|
return {
|
|
56
56
|
memberValue: t.value
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
const
|
|
60
|
-
class
|
|
59
|
+
const Yt = (t = "", e = "", n = "") => `sdmx/3.0/availability/dataflow/${t}/${e}/${n}`;
|
|
60
|
+
class Ua {
|
|
61
61
|
constructor(e) {
|
|
62
62
|
this.client = e;
|
|
63
63
|
}
|
|
64
|
-
async getConstraints(e, n) {
|
|
65
|
-
const { agency:
|
|
64
|
+
async getConstraints(e, n, r) {
|
|
65
|
+
const { agency: s, id: a, version: o } = C(e), c = {
|
|
66
66
|
filters: n || [],
|
|
67
|
-
mode:
|
|
68
|
-
references:
|
|
69
|
-
}, i =
|
|
70
|
-
if (
|
|
71
|
-
const
|
|
67
|
+
mode: rt.AVAILABLE,
|
|
68
|
+
references: de.NONE
|
|
69
|
+
}, i = Yt(s, a, o), u = !!this.client.config.sdmxProxyUrl, d = u || this.client.config.isDialProxyMode, l = u ? this.client.config.sdmxProxyUrl : this.client.config.constrainsApiUrl || this.client.config.apiUrl;
|
|
70
|
+
if (d) {
|
|
71
|
+
const m = await this.client.postRequest(
|
|
72
72
|
i,
|
|
73
|
-
{ body:
|
|
74
|
-
|
|
73
|
+
{ body: c },
|
|
74
|
+
l,
|
|
75
|
+
r
|
|
75
76
|
);
|
|
76
|
-
return
|
|
77
|
+
return Nt(m);
|
|
77
78
|
}
|
|
78
79
|
return await this.client.postRequest(
|
|
79
80
|
i,
|
|
80
|
-
{ body:
|
|
81
|
-
|
|
81
|
+
{ body: c },
|
|
82
|
+
l,
|
|
83
|
+
r
|
|
82
84
|
);
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
|
-
var
|
|
86
|
-
const
|
|
87
|
+
var G = /* @__PURE__ */ ((t) => (t.CSV = "csv", t.JSON = "json", t.XML = "xml", t))(G || {}), Ct = /* @__PURE__ */ ((t) => (t.ID = "id", t.NAME = "name", t.ID_NAME = "both", t))(Ct || {}), St = /* @__PURE__ */ ((t) => (t.FULL_DATASET = "full", t.DATA_IN_TABLE = "query", t))(St || {});
|
|
88
|
+
const Lt = (t, e) => {
|
|
87
89
|
switch (t) {
|
|
88
|
-
case
|
|
89
|
-
return
|
|
90
|
+
case G.CSV:
|
|
91
|
+
return _e(
|
|
90
92
|
"application/vnd.sdmx.data+csv;version=2.0.0",
|
|
91
93
|
e
|
|
92
94
|
);
|
|
93
|
-
case
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
);
|
|
98
|
-
case X.JSON:
|
|
99
|
-
return B(`application/${t}`, e);
|
|
95
|
+
case G.XML:
|
|
96
|
+
return "application/vnd.sdmx.data+xml;version=3.0.0";
|
|
97
|
+
case G.JSON:
|
|
98
|
+
return "application/vnd.sdmx.data+json;version=2.1";
|
|
100
99
|
default:
|
|
101
|
-
return
|
|
100
|
+
return _e(
|
|
102
101
|
"application/vnd.sdmx.data+csv;version=2.0.0",
|
|
103
102
|
e
|
|
104
103
|
);
|
|
105
104
|
}
|
|
106
|
-
},
|
|
107
|
-
var
|
|
108
|
-
const
|
|
109
|
-
const { filterKey: r, timeFilter: s } = n, { agency: a, id: o, version:
|
|
110
|
-
return `${`${
|
|
111
|
-
},
|
|
112
|
-
class
|
|
105
|
+
}, _e = (t, e) => `${t}; labels=${e}`;
|
|
106
|
+
var st = /* @__PURE__ */ ((t) => (t.REFERENCE_PARTIAL = "referencepartial", t.FULL = "full", t))(st || {});
|
|
107
|
+
const $t = "all", Wt = "sdmx/3.0/data/dataflow", at = "&", Ie = ":", qt = "=", Ut = "+", Ha = ",", Ht = "*", Ye = (t, e, n) => {
|
|
108
|
+
const { filterKey: r, timeFilter: s } = n, { agency: a, id: o, version: c } = C(t), i = [s || "", e].filter((d) => !!d).join(at);
|
|
109
|
+
return `${`${Wt}/${a}/${o}/${c}`}/${r || Ht}?${i}`;
|
|
110
|
+
}, Ft = (t = "", e = "", n = "", r = de.DESCENDANTS) => `sdmx/3.0/structure/dataflow/${t}/${e}/${n}?references=${r}&detail=${st.REFERENCE_PARTIAL}`;
|
|
111
|
+
class Fa {
|
|
113
112
|
constructor(e) {
|
|
114
113
|
this.client = e;
|
|
115
114
|
}
|
|
116
|
-
async getDataSet(e, n) {
|
|
117
|
-
const { agency:
|
|
115
|
+
async getDataSet(e, n, r) {
|
|
116
|
+
const { agency: s, id: a, version: o } = C(e);
|
|
118
117
|
return await this.client.getRequest(
|
|
119
|
-
|
|
118
|
+
Ft(s, a, o, n),
|
|
119
|
+
void 0,
|
|
120
|
+
r
|
|
120
121
|
);
|
|
121
122
|
}
|
|
122
|
-
async getDatasetData(e, n) {
|
|
123
|
-
const
|
|
123
|
+
async getDatasetData(e, n, r) {
|
|
124
|
+
const s = new URLSearchParams({
|
|
124
125
|
includeHistory: "false",
|
|
125
126
|
limit: "1000",
|
|
126
|
-
attributes:
|
|
127
|
+
attributes: $t,
|
|
127
128
|
dimensionAtObservation: "TIME_PERIOD"
|
|
128
129
|
// TODO: use time dimensions
|
|
129
|
-
}).toString(),
|
|
130
|
-
return await this.client.getRequest(
|
|
130
|
+
}).toString(), a = Ye(e, s, n);
|
|
131
|
+
return await this.client.getRequest(
|
|
132
|
+
a,
|
|
133
|
+
void 0,
|
|
134
|
+
r
|
|
135
|
+
);
|
|
131
136
|
}
|
|
132
|
-
async downloadDataSet(e, n, r, s, a, o,
|
|
133
|
-
const
|
|
134
|
-
format: n,
|
|
137
|
+
async downloadDataSet(e, n, r, s, a, o, c = !1, i) {
|
|
138
|
+
const u = new URLSearchParams({
|
|
135
139
|
compress: "false",
|
|
136
|
-
attributes:
|
|
140
|
+
attributes: c ? "all" : "none",
|
|
137
141
|
limit: "1000"
|
|
138
|
-
}).toString(),
|
|
142
|
+
}).toString(), d = Ye(e, u, a);
|
|
139
143
|
return this.client.streamRequest(
|
|
140
|
-
|
|
144
|
+
d,
|
|
141
145
|
{
|
|
142
146
|
method: "GET",
|
|
143
147
|
headers: {
|
|
144
|
-
Accept:
|
|
148
|
+
Accept: Lt(n, s),
|
|
145
149
|
"Accept-language": r
|
|
146
150
|
}
|
|
147
151
|
},
|
|
148
|
-
o
|
|
152
|
+
o,
|
|
153
|
+
i
|
|
149
154
|
);
|
|
150
155
|
}
|
|
151
156
|
}
|
|
152
|
-
const Qt = (t, e) => t.error || t.message || `${e.status} ${e.statusText}`,
|
|
153
|
-
class
|
|
157
|
+
const Qt = (t, e) => t.error || t.message || `${e.status} ${e.statusText}`, Bt = "application/json", Vt = "Content-Type", X = "Api-Key", Gt = "X-CONVERSATION-ID", j = "Ocp-Apim-Subscription-Key", Ce = "X-Source-Artefact-Urn";
|
|
158
|
+
class Se extends Error {
|
|
154
159
|
constructor(e) {
|
|
155
160
|
super(e.message), this.isHttpError = !0, this.name = "HttpError", this.code = e.code, this.status = e.status, this.details = e.details, this.displayMessage = e.displayMessage;
|
|
156
161
|
}
|
|
157
162
|
}
|
|
158
|
-
const
|
|
163
|
+
const ot = 6048e5, Xt = 864e5, le = 6e4, fe = 36e5, jt = 1e3, Le = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
159
164
|
function E(t, e) {
|
|
160
|
-
return typeof t == "function" ? t(e) : t && typeof t == "object" &&
|
|
165
|
+
return typeof t == "function" ? t(e) : t && typeof t == "object" && Le in t ? t[Le](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
161
166
|
}
|
|
162
|
-
function
|
|
167
|
+
function p(t, e) {
|
|
163
168
|
return E(e || t, t);
|
|
164
169
|
}
|
|
165
|
-
function
|
|
166
|
-
const r =
|
|
170
|
+
function it(t, e, n) {
|
|
171
|
+
const r = p(t, n?.in);
|
|
167
172
|
return isNaN(e) ? E(n?.in || t, NaN) : (e && r.setDate(r.getDate() + e), r);
|
|
168
173
|
}
|
|
169
|
-
let
|
|
170
|
-
function
|
|
171
|
-
return
|
|
174
|
+
let zt = {};
|
|
175
|
+
function $() {
|
|
176
|
+
return zt;
|
|
172
177
|
}
|
|
173
|
-
function
|
|
174
|
-
const n =
|
|
178
|
+
function I(t, e) {
|
|
179
|
+
const n = $(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, s = p(t, e?.in), a = s.getDay(), o = (a < r ? 7 : 0) + a - r;
|
|
175
180
|
return s.setDate(s.getDate() - o), s.setHours(0, 0, 0, 0), s;
|
|
176
181
|
}
|
|
177
182
|
function L(t, e) {
|
|
178
|
-
return
|
|
183
|
+
return I(t, { ...e, weekStartsOn: 1 });
|
|
179
184
|
}
|
|
180
|
-
function
|
|
181
|
-
const n =
|
|
185
|
+
function ct(t, e) {
|
|
186
|
+
const n = p(t, e?.in), r = n.getFullYear(), s = E(n, 0);
|
|
182
187
|
s.setFullYear(r + 1, 0, 4), s.setHours(0, 0, 0, 0);
|
|
183
188
|
const a = L(s), o = E(n, 0);
|
|
184
189
|
o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0);
|
|
185
|
-
const
|
|
186
|
-
return n.getTime() >= a.getTime() ? r + 1 : n.getTime() >=
|
|
190
|
+
const c = L(o);
|
|
191
|
+
return n.getTime() >= a.getTime() ? r + 1 : n.getTime() >= c.getTime() ? r : r - 1;
|
|
187
192
|
}
|
|
188
|
-
function
|
|
189
|
-
const e =
|
|
193
|
+
function K(t) {
|
|
194
|
+
const e = p(t), n = new Date(
|
|
190
195
|
Date.UTC(
|
|
191
196
|
e.getFullYear(),
|
|
192
197
|
e.getMonth(),
|
|
@@ -199,40 +204,40 @@ function z(t) {
|
|
|
199
204
|
);
|
|
200
205
|
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
201
206
|
}
|
|
202
|
-
function
|
|
207
|
+
function Kt(t, ...e) {
|
|
203
208
|
const n = E.bind(
|
|
204
209
|
null,
|
|
205
210
|
e.find((r) => typeof r == "object")
|
|
206
211
|
);
|
|
207
212
|
return e.map(n);
|
|
208
213
|
}
|
|
209
|
-
function
|
|
210
|
-
const n =
|
|
214
|
+
function $e(t, e) {
|
|
215
|
+
const n = p(t, e?.in);
|
|
211
216
|
return n.setHours(0, 0, 0, 0), n;
|
|
212
217
|
}
|
|
213
|
-
function
|
|
214
|
-
const [r, s] =
|
|
218
|
+
function Jt(t, e, n) {
|
|
219
|
+
const [r, s] = Kt(
|
|
215
220
|
n?.in,
|
|
216
221
|
t,
|
|
217
222
|
e
|
|
218
|
-
), a =
|
|
219
|
-
return Math.round((
|
|
223
|
+
), a = $e(r), o = $e(s), c = +a - K(a), i = +o - K(o);
|
|
224
|
+
return Math.round((c - i) / Xt);
|
|
220
225
|
}
|
|
221
|
-
function
|
|
222
|
-
const n =
|
|
226
|
+
function Zt(t, e) {
|
|
227
|
+
const n = ct(t, e), r = E(t, 0);
|
|
223
228
|
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), L(r);
|
|
224
229
|
}
|
|
225
|
-
function
|
|
230
|
+
function en(t) {
|
|
226
231
|
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
227
232
|
}
|
|
228
|
-
function
|
|
229
|
-
return !(!
|
|
233
|
+
function ne(t) {
|
|
234
|
+
return !(!en(t) && typeof t != "number" || isNaN(+p(t)));
|
|
230
235
|
}
|
|
231
|
-
function
|
|
232
|
-
const n =
|
|
236
|
+
function tn(t, e) {
|
|
237
|
+
const n = p(t, e?.in);
|
|
233
238
|
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
234
239
|
}
|
|
235
|
-
const
|
|
240
|
+
const nn = {
|
|
236
241
|
lessThanXSeconds: {
|
|
237
242
|
one: "less than a second",
|
|
238
243
|
other: "less than {{count}} seconds"
|
|
@@ -294,77 +299,77 @@ const Zt = {
|
|
|
294
299
|
one: "almost 1 year",
|
|
295
300
|
other: "almost {{count}} years"
|
|
296
301
|
}
|
|
297
|
-
},
|
|
302
|
+
}, rn = (t, e, n) => {
|
|
298
303
|
let r;
|
|
299
|
-
const s =
|
|
304
|
+
const s = nn[t];
|
|
300
305
|
return typeof s == "string" ? r = s : e === 1 ? r = s.one : r = s.other.replace("{{count}}", e.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
301
306
|
};
|
|
302
|
-
function
|
|
307
|
+
function ee(t) {
|
|
303
308
|
return (e = {}) => {
|
|
304
309
|
const n = e.width ? String(e.width) : t.defaultWidth;
|
|
305
310
|
return t.formats[n] || t.formats[t.defaultWidth];
|
|
306
311
|
};
|
|
307
312
|
}
|
|
308
|
-
const
|
|
313
|
+
const sn = {
|
|
309
314
|
full: "EEEE, MMMM do, y",
|
|
310
315
|
long: "MMMM do, y",
|
|
311
316
|
medium: "MMM d, y",
|
|
312
317
|
short: "MM/dd/yyyy"
|
|
313
|
-
},
|
|
318
|
+
}, an = {
|
|
314
319
|
full: "h:mm:ss a zzzz",
|
|
315
320
|
long: "h:mm:ss a z",
|
|
316
321
|
medium: "h:mm:ss a",
|
|
317
322
|
short: "h:mm a"
|
|
318
|
-
},
|
|
323
|
+
}, on = {
|
|
319
324
|
full: "{{date}} 'at' {{time}}",
|
|
320
325
|
long: "{{date}} 'at' {{time}}",
|
|
321
326
|
medium: "{{date}}, {{time}}",
|
|
322
327
|
short: "{{date}}, {{time}}"
|
|
323
|
-
},
|
|
324
|
-
date:
|
|
325
|
-
formats:
|
|
328
|
+
}, cn = {
|
|
329
|
+
date: ee({
|
|
330
|
+
formats: sn,
|
|
326
331
|
defaultWidth: "full"
|
|
327
332
|
}),
|
|
328
|
-
time:
|
|
329
|
-
formats:
|
|
333
|
+
time: ee({
|
|
334
|
+
formats: an,
|
|
330
335
|
defaultWidth: "full"
|
|
331
336
|
}),
|
|
332
|
-
dateTime:
|
|
333
|
-
formats:
|
|
337
|
+
dateTime: ee({
|
|
338
|
+
formats: on,
|
|
334
339
|
defaultWidth: "full"
|
|
335
340
|
})
|
|
336
|
-
},
|
|
341
|
+
}, un = {
|
|
337
342
|
lastWeek: "'last' eeee 'at' p",
|
|
338
343
|
yesterday: "'yesterday at' p",
|
|
339
344
|
today: "'today at' p",
|
|
340
345
|
tomorrow: "'tomorrow at' p",
|
|
341
346
|
nextWeek: "eeee 'at' p",
|
|
342
347
|
other: "P"
|
|
343
|
-
},
|
|
344
|
-
function
|
|
348
|
+
}, dn = (t, e, n, r) => un[t];
|
|
349
|
+
function U(t) {
|
|
345
350
|
return (e, n) => {
|
|
346
351
|
const r = n?.context ? String(n.context) : "standalone";
|
|
347
352
|
let s;
|
|
348
353
|
if (r === "formatting" && t.formattingValues) {
|
|
349
|
-
const o = t.defaultFormattingWidth || t.defaultWidth,
|
|
350
|
-
s = t.formattingValues[
|
|
354
|
+
const o = t.defaultFormattingWidth || t.defaultWidth, c = n?.width ? String(n.width) : o;
|
|
355
|
+
s = t.formattingValues[c] || t.formattingValues[o];
|
|
351
356
|
} else {
|
|
352
|
-
const o = t.defaultWidth,
|
|
353
|
-
s = t.values[
|
|
357
|
+
const o = t.defaultWidth, c = n?.width ? String(n.width) : t.defaultWidth;
|
|
358
|
+
s = t.values[c] || t.values[o];
|
|
354
359
|
}
|
|
355
360
|
const a = t.argumentCallback ? t.argumentCallback(e) : e;
|
|
356
361
|
return s[a];
|
|
357
362
|
};
|
|
358
363
|
}
|
|
359
|
-
const
|
|
364
|
+
const ln = {
|
|
360
365
|
narrow: ["B", "A"],
|
|
361
366
|
abbreviated: ["BC", "AD"],
|
|
362
367
|
wide: ["Before Christ", "Anno Domini"]
|
|
363
|
-
},
|
|
368
|
+
}, fn = {
|
|
364
369
|
narrow: ["1", "2", "3", "4"],
|
|
365
370
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
366
371
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
367
|
-
},
|
|
372
|
+
}, mn = {
|
|
368
373
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
369
374
|
abbreviated: [
|
|
370
375
|
"Jan",
|
|
@@ -394,7 +399,7 @@ const cn = {
|
|
|
394
399
|
"November",
|
|
395
400
|
"December"
|
|
396
401
|
]
|
|
397
|
-
},
|
|
402
|
+
}, hn = {
|
|
398
403
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
399
404
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
400
405
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -407,7 +412,7 @@ const cn = {
|
|
|
407
412
|
"Friday",
|
|
408
413
|
"Saturday"
|
|
409
414
|
]
|
|
410
|
-
},
|
|
415
|
+
}, gn = {
|
|
411
416
|
narrow: {
|
|
412
417
|
am: "a",
|
|
413
418
|
pm: "p",
|
|
@@ -438,7 +443,7 @@ const cn = {
|
|
|
438
443
|
evening: "evening",
|
|
439
444
|
night: "night"
|
|
440
445
|
}
|
|
441
|
-
},
|
|
446
|
+
}, wn = {
|
|
442
447
|
narrow: {
|
|
443
448
|
am: "a",
|
|
444
449
|
pm: "p",
|
|
@@ -469,7 +474,7 @@ const cn = {
|
|
|
469
474
|
evening: "in the evening",
|
|
470
475
|
night: "at night"
|
|
471
476
|
}
|
|
472
|
-
},
|
|
477
|
+
}, yn = (t, e) => {
|
|
473
478
|
const n = Number(t), r = n % 100;
|
|
474
479
|
if (r > 20 || r < 10)
|
|
475
480
|
switch (r % 10) {
|
|
@@ -481,43 +486,43 @@ const cn = {
|
|
|
481
486
|
return n + "rd";
|
|
482
487
|
}
|
|
483
488
|
return n + "th";
|
|
484
|
-
},
|
|
485
|
-
ordinalNumber:
|
|
486
|
-
era:
|
|
487
|
-
values:
|
|
489
|
+
}, pn = {
|
|
490
|
+
ordinalNumber: yn,
|
|
491
|
+
era: U({
|
|
492
|
+
values: ln,
|
|
488
493
|
defaultWidth: "wide"
|
|
489
494
|
}),
|
|
490
|
-
quarter:
|
|
491
|
-
values:
|
|
495
|
+
quarter: U({
|
|
496
|
+
values: fn,
|
|
492
497
|
defaultWidth: "wide",
|
|
493
498
|
argumentCallback: (t) => t - 1
|
|
494
499
|
}),
|
|
495
|
-
month:
|
|
496
|
-
values:
|
|
500
|
+
month: U({
|
|
501
|
+
values: mn,
|
|
497
502
|
defaultWidth: "wide"
|
|
498
503
|
}),
|
|
499
|
-
day:
|
|
500
|
-
values:
|
|
504
|
+
day: U({
|
|
505
|
+
values: hn,
|
|
501
506
|
defaultWidth: "wide"
|
|
502
507
|
}),
|
|
503
|
-
dayPeriod:
|
|
504
|
-
values:
|
|
508
|
+
dayPeriod: U({
|
|
509
|
+
values: gn,
|
|
505
510
|
defaultWidth: "wide",
|
|
506
|
-
formattingValues:
|
|
511
|
+
formattingValues: wn,
|
|
507
512
|
defaultFormattingWidth: "wide"
|
|
508
513
|
})
|
|
509
514
|
};
|
|
510
|
-
function
|
|
515
|
+
function H(t) {
|
|
511
516
|
return (e, n = {}) => {
|
|
512
517
|
const r = n.width, s = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], a = e.match(s);
|
|
513
518
|
if (!a)
|
|
514
519
|
return null;
|
|
515
|
-
const o = a[0],
|
|
520
|
+
const o = a[0], c = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], i = Array.isArray(c) ? Dn(c, (l) => l.test(o)) : (
|
|
516
521
|
// [TODO] -- I challenge you to fix the type
|
|
517
|
-
|
|
522
|
+
bn(c, (l) => l.test(o))
|
|
518
523
|
);
|
|
519
524
|
let u;
|
|
520
|
-
u = t.valueCallback ? t.valueCallback(
|
|
525
|
+
u = t.valueCallback ? t.valueCallback(i) : i, u = n.valueCallback ? (
|
|
521
526
|
// [TODO] -- I challenge you to fix the type
|
|
522
527
|
n.valueCallback(u)
|
|
523
528
|
) : u;
|
|
@@ -525,17 +530,17 @@ function Q(t) {
|
|
|
525
530
|
return { value: u, rest: d };
|
|
526
531
|
};
|
|
527
532
|
}
|
|
528
|
-
function
|
|
533
|
+
function bn(t, e) {
|
|
529
534
|
for (const n in t)
|
|
530
535
|
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
531
536
|
return n;
|
|
532
537
|
}
|
|
533
|
-
function
|
|
538
|
+
function Dn(t, e) {
|
|
534
539
|
for (let n = 0; n < t.length; n++)
|
|
535
540
|
if (e(t[n]))
|
|
536
541
|
return n;
|
|
537
542
|
}
|
|
538
|
-
function
|
|
543
|
+
function Tn(t) {
|
|
539
544
|
return (e, n = {}) => {
|
|
540
545
|
const r = e.match(t.matchPattern);
|
|
541
546
|
if (!r) return null;
|
|
@@ -543,27 +548,27 @@ function yn(t) {
|
|
|
543
548
|
if (!a) return null;
|
|
544
549
|
let o = t.valueCallback ? t.valueCallback(a[0]) : a[0];
|
|
545
550
|
o = n.valueCallback ? n.valueCallback(o) : o;
|
|
546
|
-
const
|
|
547
|
-
return { value: o, rest:
|
|
551
|
+
const c = e.slice(s.length);
|
|
552
|
+
return { value: o, rest: c };
|
|
548
553
|
};
|
|
549
554
|
}
|
|
550
|
-
const
|
|
555
|
+
const En = /^(\d+)(th|st|nd|rd)?/i, xn = /\d+/i, Pn = {
|
|
551
556
|
narrow: /^(b|a)/i,
|
|
552
557
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
553
558
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
554
|
-
},
|
|
559
|
+
}, vn = {
|
|
555
560
|
any: [/^b/i, /^(a|c)/i]
|
|
556
|
-
},
|
|
561
|
+
}, Mn = {
|
|
557
562
|
narrow: /^[1234]/i,
|
|
558
563
|
abbreviated: /^q[1234]/i,
|
|
559
564
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
560
|
-
},
|
|
565
|
+
}, On = {
|
|
561
566
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
562
|
-
},
|
|
567
|
+
}, An = {
|
|
563
568
|
narrow: /^[jfmasond]/i,
|
|
564
569
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
565
570
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
566
|
-
},
|
|
571
|
+
}, Nn = {
|
|
567
572
|
narrow: [
|
|
568
573
|
/^j/i,
|
|
569
574
|
/^f/i,
|
|
@@ -592,18 +597,18 @@ const bn = /^(\d+)(th|st|nd|rd)?/i, Dn = /\d+/i, Tn = {
|
|
|
592
597
|
/^n/i,
|
|
593
598
|
/^d/i
|
|
594
599
|
]
|
|
595
|
-
},
|
|
600
|
+
}, Rn = {
|
|
596
601
|
narrow: /^[smtwf]/i,
|
|
597
602
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
598
603
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
599
604
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
600
|
-
},
|
|
605
|
+
}, kn = {
|
|
601
606
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
602
607
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
603
|
-
},
|
|
608
|
+
}, _n = {
|
|
604
609
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
605
610
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
606
|
-
},
|
|
611
|
+
}, In = {
|
|
607
612
|
any: {
|
|
608
613
|
am: /^a/i,
|
|
609
614
|
pm: /^p/i,
|
|
@@ -614,97 +619,97 @@ const bn = /^(\d+)(th|st|nd|rd)?/i, Dn = /\d+/i, Tn = {
|
|
|
614
619
|
evening: /evening/i,
|
|
615
620
|
night: /night/i
|
|
616
621
|
}
|
|
617
|
-
},
|
|
618
|
-
ordinalNumber:
|
|
619
|
-
matchPattern:
|
|
620
|
-
parsePattern:
|
|
622
|
+
}, Yn = {
|
|
623
|
+
ordinalNumber: Tn({
|
|
624
|
+
matchPattern: En,
|
|
625
|
+
parsePattern: xn,
|
|
621
626
|
valueCallback: (t) => parseInt(t, 10)
|
|
622
627
|
}),
|
|
623
|
-
era:
|
|
624
|
-
matchPatterns:
|
|
628
|
+
era: H({
|
|
629
|
+
matchPatterns: Pn,
|
|
625
630
|
defaultMatchWidth: "wide",
|
|
626
|
-
parsePatterns:
|
|
631
|
+
parsePatterns: vn,
|
|
627
632
|
defaultParseWidth: "any"
|
|
628
633
|
}),
|
|
629
|
-
quarter:
|
|
630
|
-
matchPatterns:
|
|
634
|
+
quarter: H({
|
|
635
|
+
matchPatterns: Mn,
|
|
631
636
|
defaultMatchWidth: "wide",
|
|
632
|
-
parsePatterns:
|
|
637
|
+
parsePatterns: On,
|
|
633
638
|
defaultParseWidth: "any",
|
|
634
639
|
valueCallback: (t) => t + 1
|
|
635
640
|
}),
|
|
636
|
-
month:
|
|
637
|
-
matchPatterns:
|
|
641
|
+
month: H({
|
|
642
|
+
matchPatterns: An,
|
|
638
643
|
defaultMatchWidth: "wide",
|
|
639
|
-
parsePatterns:
|
|
644
|
+
parsePatterns: Nn,
|
|
640
645
|
defaultParseWidth: "any"
|
|
641
646
|
}),
|
|
642
|
-
day:
|
|
643
|
-
matchPatterns:
|
|
647
|
+
day: H({
|
|
648
|
+
matchPatterns: Rn,
|
|
644
649
|
defaultMatchWidth: "wide",
|
|
645
|
-
parsePatterns:
|
|
650
|
+
parsePatterns: kn,
|
|
646
651
|
defaultParseWidth: "any"
|
|
647
652
|
}),
|
|
648
|
-
dayPeriod:
|
|
649
|
-
matchPatterns:
|
|
653
|
+
dayPeriod: H({
|
|
654
|
+
matchPatterns: _n,
|
|
650
655
|
defaultMatchWidth: "any",
|
|
651
|
-
parsePatterns:
|
|
656
|
+
parsePatterns: In,
|
|
652
657
|
defaultParseWidth: "any"
|
|
653
658
|
})
|
|
654
|
-
},
|
|
659
|
+
}, ut = {
|
|
655
660
|
code: "en-US",
|
|
656
|
-
formatDistance:
|
|
657
|
-
formatLong:
|
|
658
|
-
formatRelative:
|
|
659
|
-
localize:
|
|
660
|
-
match:
|
|
661
|
+
formatDistance: rn,
|
|
662
|
+
formatLong: cn,
|
|
663
|
+
formatRelative: dn,
|
|
664
|
+
localize: pn,
|
|
665
|
+
match: Yn,
|
|
661
666
|
options: {
|
|
662
667
|
weekStartsOn: 0,
|
|
663
668
|
firstWeekContainsDate: 1
|
|
664
669
|
}
|
|
665
670
|
};
|
|
666
|
-
function
|
|
667
|
-
const n =
|
|
668
|
-
return
|
|
671
|
+
function Cn(t, e) {
|
|
672
|
+
const n = p(t, e?.in);
|
|
673
|
+
return Jt(n, tn(n)) + 1;
|
|
669
674
|
}
|
|
670
|
-
function
|
|
671
|
-
const n =
|
|
672
|
-
return Math.round(r /
|
|
675
|
+
function dt(t, e) {
|
|
676
|
+
const n = p(t, e?.in), r = +L(n) - +Zt(n);
|
|
677
|
+
return Math.round(r / ot) + 1;
|
|
673
678
|
}
|
|
674
|
-
function
|
|
675
|
-
const n =
|
|
679
|
+
function me(t, e) {
|
|
680
|
+
const n = p(t, e?.in), r = n.getFullYear(), s = $(), a = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? s.firstWeekContainsDate ?? s.locale?.options?.firstWeekContainsDate ?? 1, o = E(e?.in || t, 0);
|
|
676
681
|
o.setFullYear(r + 1, 0, a), o.setHours(0, 0, 0, 0);
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
-
const u =
|
|
680
|
-
return +n >= +
|
|
682
|
+
const c = I(o, e), i = E(e?.in || t, 0);
|
|
683
|
+
i.setFullYear(r, 0, a), i.setHours(0, 0, 0, 0);
|
|
684
|
+
const u = I(i, e);
|
|
685
|
+
return +n >= +c ? r + 1 : +n >= +u ? r : r - 1;
|
|
681
686
|
}
|
|
682
|
-
function
|
|
683
|
-
const n =
|
|
684
|
-
return a.setFullYear(s, 0, r), a.setHours(0, 0, 0, 0),
|
|
687
|
+
function Sn(t, e) {
|
|
688
|
+
const n = $(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, s = me(t, e), a = E(e?.in || t, 0);
|
|
689
|
+
return a.setFullYear(s, 0, r), a.setHours(0, 0, 0, 0), I(a, e);
|
|
685
690
|
}
|
|
686
|
-
function
|
|
687
|
-
const n =
|
|
688
|
-
return Math.round(r /
|
|
691
|
+
function lt(t, e) {
|
|
692
|
+
const n = p(t, e?.in), r = +I(n, e) - +Sn(n, e);
|
|
693
|
+
return Math.round(r / ot) + 1;
|
|
689
694
|
}
|
|
690
|
-
function
|
|
695
|
+
function g(t, e) {
|
|
691
696
|
const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
|
|
692
697
|
return n + r;
|
|
693
698
|
}
|
|
694
|
-
const
|
|
699
|
+
const R = {
|
|
695
700
|
// Year
|
|
696
701
|
y(t, e) {
|
|
697
702
|
const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
698
|
-
return
|
|
703
|
+
return g(e === "yy" ? r % 100 : r, e.length);
|
|
699
704
|
},
|
|
700
705
|
// Month
|
|
701
706
|
M(t, e) {
|
|
702
707
|
const n = t.getMonth();
|
|
703
|
-
return e === "M" ? String(n + 1) :
|
|
708
|
+
return e === "M" ? String(n + 1) : g(n + 1, 2);
|
|
704
709
|
},
|
|
705
710
|
// Day of the month
|
|
706
711
|
d(t, e) {
|
|
707
|
-
return
|
|
712
|
+
return g(t.getDate(), e.length);
|
|
708
713
|
},
|
|
709
714
|
// AM or PM
|
|
710
715
|
a(t, e) {
|
|
@@ -723,35 +728,35 @@ const N = {
|
|
|
723
728
|
},
|
|
724
729
|
// Hour [1-12]
|
|
725
730
|
h(t, e) {
|
|
726
|
-
return
|
|
731
|
+
return g(t.getHours() % 12 || 12, e.length);
|
|
727
732
|
},
|
|
728
733
|
// Hour [0-23]
|
|
729
734
|
H(t, e) {
|
|
730
|
-
return
|
|
735
|
+
return g(t.getHours(), e.length);
|
|
731
736
|
},
|
|
732
737
|
// Minute
|
|
733
738
|
m(t, e) {
|
|
734
|
-
return
|
|
739
|
+
return g(t.getMinutes(), e.length);
|
|
735
740
|
},
|
|
736
741
|
// Second
|
|
737
742
|
s(t, e) {
|
|
738
|
-
return
|
|
743
|
+
return g(t.getSeconds(), e.length);
|
|
739
744
|
},
|
|
740
745
|
// Fraction of second
|
|
741
746
|
S(t, e) {
|
|
742
747
|
const n = e.length, r = t.getMilliseconds(), s = Math.trunc(
|
|
743
748
|
r * Math.pow(10, n - 3)
|
|
744
749
|
);
|
|
745
|
-
return
|
|
750
|
+
return g(s, e.length);
|
|
746
751
|
}
|
|
747
|
-
},
|
|
752
|
+
}, S = {
|
|
748
753
|
midnight: "midnight",
|
|
749
754
|
noon: "noon",
|
|
750
755
|
morning: "morning",
|
|
751
756
|
afternoon: "afternoon",
|
|
752
757
|
evening: "evening",
|
|
753
758
|
night: "night"
|
|
754
|
-
},
|
|
759
|
+
}, We = {
|
|
755
760
|
// Era
|
|
756
761
|
G: function(t, e, n) {
|
|
757
762
|
const r = t.getFullYear() > 0 ? 1 : 0;
|
|
@@ -774,21 +779,21 @@ const N = {
|
|
|
774
779
|
const r = t.getFullYear(), s = r > 0 ? r : 1 - r;
|
|
775
780
|
return n.ordinalNumber(s, { unit: "year" });
|
|
776
781
|
}
|
|
777
|
-
return
|
|
782
|
+
return R.y(t, e);
|
|
778
783
|
},
|
|
779
784
|
// Local week-numbering year
|
|
780
785
|
Y: function(t, e, n, r) {
|
|
781
|
-
const s =
|
|
786
|
+
const s = me(t, r), a = s > 0 ? s : 1 - s;
|
|
782
787
|
if (e === "YY") {
|
|
783
788
|
const o = a % 100;
|
|
784
|
-
return
|
|
789
|
+
return g(o, 2);
|
|
785
790
|
}
|
|
786
|
-
return e === "Yo" ? n.ordinalNumber(a, { unit: "year" }) :
|
|
791
|
+
return e === "Yo" ? n.ordinalNumber(a, { unit: "year" }) : g(a, e.length);
|
|
787
792
|
},
|
|
788
793
|
// ISO week-numbering year
|
|
789
794
|
R: function(t, e) {
|
|
790
|
-
const n =
|
|
791
|
-
return
|
|
795
|
+
const n = ct(t);
|
|
796
|
+
return g(n, e.length);
|
|
792
797
|
},
|
|
793
798
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
794
799
|
// The main difference between `y` and `u` localizers are B.C. years:
|
|
@@ -801,7 +806,7 @@ const N = {
|
|
|
801
806
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
802
807
|
u: function(t, e) {
|
|
803
808
|
const n = t.getFullYear();
|
|
804
|
-
return
|
|
809
|
+
return g(n, e.length);
|
|
805
810
|
},
|
|
806
811
|
// Quarter
|
|
807
812
|
Q: function(t, e, n) {
|
|
@@ -812,7 +817,7 @@ const N = {
|
|
|
812
817
|
return String(r);
|
|
813
818
|
// 01, 02, 03, 04
|
|
814
819
|
case "QQ":
|
|
815
|
-
return
|
|
820
|
+
return g(r, 2);
|
|
816
821
|
// 1st, 2nd, 3rd, 4th
|
|
817
822
|
case "Qo":
|
|
818
823
|
return n.ordinalNumber(r, { unit: "quarter" });
|
|
@@ -844,7 +849,7 @@ const N = {
|
|
|
844
849
|
return String(r);
|
|
845
850
|
// 01, 02, 03, 04
|
|
846
851
|
case "qq":
|
|
847
|
-
return
|
|
852
|
+
return g(r, 2);
|
|
848
853
|
// 1st, 2nd, 3rd, 4th
|
|
849
854
|
case "qo":
|
|
850
855
|
return n.ordinalNumber(r, { unit: "quarter" });
|
|
@@ -873,7 +878,7 @@ const N = {
|
|
|
873
878
|
switch (e) {
|
|
874
879
|
case "M":
|
|
875
880
|
case "MM":
|
|
876
|
-
return
|
|
881
|
+
return R.M(t, e);
|
|
877
882
|
// 1st, 2nd, ..., 12th
|
|
878
883
|
case "Mo":
|
|
879
884
|
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
@@ -902,7 +907,7 @@ const N = {
|
|
|
902
907
|
return String(r + 1);
|
|
903
908
|
// 01, 02, ..., 12
|
|
904
909
|
case "LL":
|
|
905
|
-
return
|
|
910
|
+
return g(r + 1, 2);
|
|
906
911
|
// 1st, 2nd, ..., 12th
|
|
907
912
|
case "Lo":
|
|
908
913
|
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
@@ -924,22 +929,22 @@ const N = {
|
|
|
924
929
|
},
|
|
925
930
|
// Local week of year
|
|
926
931
|
w: function(t, e, n, r) {
|
|
927
|
-
const s =
|
|
928
|
-
return e === "wo" ? n.ordinalNumber(s, { unit: "week" }) :
|
|
932
|
+
const s = lt(t, r);
|
|
933
|
+
return e === "wo" ? n.ordinalNumber(s, { unit: "week" }) : g(s, e.length);
|
|
929
934
|
},
|
|
930
935
|
// ISO week of year
|
|
931
936
|
I: function(t, e, n) {
|
|
932
|
-
const r =
|
|
933
|
-
return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) :
|
|
937
|
+
const r = dt(t);
|
|
938
|
+
return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : g(r, e.length);
|
|
934
939
|
},
|
|
935
940
|
// Day of the month
|
|
936
941
|
d: function(t, e, n) {
|
|
937
|
-
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) :
|
|
942
|
+
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : R.d(t, e);
|
|
938
943
|
},
|
|
939
944
|
// Day of year
|
|
940
945
|
D: function(t, e, n) {
|
|
941
|
-
const r =
|
|
942
|
-
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) :
|
|
946
|
+
const r = Cn(t);
|
|
947
|
+
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : g(r, e.length);
|
|
943
948
|
},
|
|
944
949
|
// Day of week
|
|
945
950
|
E: function(t, e, n) {
|
|
@@ -981,7 +986,7 @@ const N = {
|
|
|
981
986
|
return String(a);
|
|
982
987
|
// Padded numerical value
|
|
983
988
|
case "ee":
|
|
984
|
-
return
|
|
989
|
+
return g(a, 2);
|
|
985
990
|
// 1st, 2nd, ..., 7th
|
|
986
991
|
case "eo":
|
|
987
992
|
return n.ordinalNumber(a, { unit: "day" });
|
|
@@ -1018,7 +1023,7 @@ const N = {
|
|
|
1018
1023
|
return String(a);
|
|
1019
1024
|
// Padded numerical value
|
|
1020
1025
|
case "cc":
|
|
1021
|
-
return
|
|
1026
|
+
return g(a, e.length);
|
|
1022
1027
|
// 1st, 2nd, ..., 7th
|
|
1023
1028
|
case "co":
|
|
1024
1029
|
return n.ordinalNumber(a, { unit: "day" });
|
|
@@ -1055,7 +1060,7 @@ const N = {
|
|
|
1055
1060
|
return String(s);
|
|
1056
1061
|
// 02
|
|
1057
1062
|
case "ii":
|
|
1058
|
-
return
|
|
1063
|
+
return g(s, e.length);
|
|
1059
1064
|
// 2nd
|
|
1060
1065
|
case "io":
|
|
1061
1066
|
return n.ordinalNumber(s, { unit: "day" });
|
|
@@ -1115,7 +1120,7 @@ const N = {
|
|
|
1115
1120
|
b: function(t, e, n) {
|
|
1116
1121
|
const r = t.getHours();
|
|
1117
1122
|
let s;
|
|
1118
|
-
switch (r === 12 ? s =
|
|
1123
|
+
switch (r === 12 ? s = S.noon : r === 0 ? s = S.midnight : s = r / 12 >= 1 ? "pm" : "am", e) {
|
|
1119
1124
|
case "b":
|
|
1120
1125
|
case "bb":
|
|
1121
1126
|
return n.dayPeriod(s, {
|
|
@@ -1143,7 +1148,7 @@ const N = {
|
|
|
1143
1148
|
B: function(t, e, n) {
|
|
1144
1149
|
const r = t.getHours();
|
|
1145
1150
|
let s;
|
|
1146
|
-
switch (r >= 17 ? s =
|
|
1151
|
+
switch (r >= 17 ? s = S.evening : r >= 12 ? s = S.afternoon : r >= 4 ? s = S.morning : s = S.night, e) {
|
|
1147
1152
|
case "B":
|
|
1148
1153
|
case "BB":
|
|
1149
1154
|
case "BBB":
|
|
@@ -1169,33 +1174,33 @@ const N = {
|
|
|
1169
1174
|
let r = t.getHours() % 12;
|
|
1170
1175
|
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1171
1176
|
}
|
|
1172
|
-
return
|
|
1177
|
+
return R.h(t, e);
|
|
1173
1178
|
},
|
|
1174
1179
|
// Hour [0-23]
|
|
1175
1180
|
H: function(t, e, n) {
|
|
1176
|
-
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) :
|
|
1181
|
+
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : R.H(t, e);
|
|
1177
1182
|
},
|
|
1178
1183
|
// Hour [0-11]
|
|
1179
1184
|
K: function(t, e, n) {
|
|
1180
1185
|
const r = t.getHours() % 12;
|
|
1181
|
-
return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) :
|
|
1186
|
+
return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : g(r, e.length);
|
|
1182
1187
|
},
|
|
1183
1188
|
// Hour [1-24]
|
|
1184
1189
|
k: function(t, e, n) {
|
|
1185
1190
|
let r = t.getHours();
|
|
1186
|
-
return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) :
|
|
1191
|
+
return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : g(r, e.length);
|
|
1187
1192
|
},
|
|
1188
1193
|
// Minute
|
|
1189
1194
|
m: function(t, e, n) {
|
|
1190
|
-
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) :
|
|
1195
|
+
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : R.m(t, e);
|
|
1191
1196
|
},
|
|
1192
1197
|
// Second
|
|
1193
1198
|
s: function(t, e, n) {
|
|
1194
|
-
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) :
|
|
1199
|
+
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : R.s(t, e);
|
|
1195
1200
|
},
|
|
1196
1201
|
// Fraction of second
|
|
1197
1202
|
S: function(t, e) {
|
|
1198
|
-
return
|
|
1203
|
+
return R.S(t, e);
|
|
1199
1204
|
},
|
|
1200
1205
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1201
1206
|
X: function(t, e, n) {
|
|
@@ -1205,16 +1210,16 @@ const N = {
|
|
|
1205
1210
|
switch (e) {
|
|
1206
1211
|
// Hours and optional minutes
|
|
1207
1212
|
case "X":
|
|
1208
|
-
return
|
|
1213
|
+
return Ue(r);
|
|
1209
1214
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1210
1215
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1211
1216
|
// so this token always has the same output as `XX`
|
|
1212
1217
|
case "XXXX":
|
|
1213
1218
|
case "XX":
|
|
1214
|
-
return
|
|
1219
|
+
return Y(r);
|
|
1215
1220
|
// Hours and minutes with `:` delimiter
|
|
1216
1221
|
default:
|
|
1217
|
-
return
|
|
1222
|
+
return Y(r, ":");
|
|
1218
1223
|
}
|
|
1219
1224
|
},
|
|
1220
1225
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
@@ -1223,16 +1228,16 @@ const N = {
|
|
|
1223
1228
|
switch (e) {
|
|
1224
1229
|
// Hours and optional minutes
|
|
1225
1230
|
case "x":
|
|
1226
|
-
return
|
|
1231
|
+
return Ue(r);
|
|
1227
1232
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1228
1233
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1229
1234
|
// so this token always has the same output as `xx`
|
|
1230
1235
|
case "xxxx":
|
|
1231
1236
|
case "xx":
|
|
1232
|
-
return
|
|
1237
|
+
return Y(r);
|
|
1233
1238
|
// Hours and minutes with `:` delimiter
|
|
1234
1239
|
default:
|
|
1235
|
-
return
|
|
1240
|
+
return Y(r, ":");
|
|
1236
1241
|
}
|
|
1237
1242
|
},
|
|
1238
1243
|
// Timezone (GMT)
|
|
@@ -1243,9 +1248,9 @@ const N = {
|
|
|
1243
1248
|
case "O":
|
|
1244
1249
|
case "OO":
|
|
1245
1250
|
case "OOO":
|
|
1246
|
-
return "GMT" +
|
|
1251
|
+
return "GMT" + qe(r, ":");
|
|
1247
1252
|
default:
|
|
1248
|
-
return "GMT" +
|
|
1253
|
+
return "GMT" + Y(r, ":");
|
|
1249
1254
|
}
|
|
1250
1255
|
},
|
|
1251
1256
|
// Timezone (specific non-location)
|
|
@@ -1256,33 +1261,33 @@ const N = {
|
|
|
1256
1261
|
case "z":
|
|
1257
1262
|
case "zz":
|
|
1258
1263
|
case "zzz":
|
|
1259
|
-
return "GMT" +
|
|
1264
|
+
return "GMT" + qe(r, ":");
|
|
1260
1265
|
default:
|
|
1261
|
-
return "GMT" +
|
|
1266
|
+
return "GMT" + Y(r, ":");
|
|
1262
1267
|
}
|
|
1263
1268
|
},
|
|
1264
1269
|
// Seconds timestamp
|
|
1265
1270
|
t: function(t, e, n) {
|
|
1266
1271
|
const r = Math.trunc(+t / 1e3);
|
|
1267
|
-
return
|
|
1272
|
+
return g(r, e.length);
|
|
1268
1273
|
},
|
|
1269
1274
|
// Milliseconds timestamp
|
|
1270
1275
|
T: function(t, e, n) {
|
|
1271
|
-
return
|
|
1276
|
+
return g(+t, e.length);
|
|
1272
1277
|
}
|
|
1273
1278
|
};
|
|
1274
|
-
function
|
|
1279
|
+
function qe(t, e = "") {
|
|
1275
1280
|
const n = t > 0 ? "-" : "+", r = Math.abs(t), s = Math.trunc(r / 60), a = r % 60;
|
|
1276
|
-
return a === 0 ? n + String(s) : n + String(s) + e +
|
|
1281
|
+
return a === 0 ? n + String(s) : n + String(s) + e + g(a, 2);
|
|
1277
1282
|
}
|
|
1278
|
-
function
|
|
1279
|
-
return t % 60 === 0 ? (t > 0 ? "-" : "+") +
|
|
1283
|
+
function Ue(t, e) {
|
|
1284
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + g(Math.abs(t) / 60, 2) : Y(t, e);
|
|
1280
1285
|
}
|
|
1281
|
-
function
|
|
1282
|
-
const n = t > 0 ? "-" : "+", r = Math.abs(t), s =
|
|
1286
|
+
function Y(t, e = "") {
|
|
1287
|
+
const n = t > 0 ? "-" : "+", r = Math.abs(t), s = g(Math.trunc(r / 60), 2), a = g(r % 60, 2);
|
|
1283
1288
|
return n + s + e + a;
|
|
1284
1289
|
}
|
|
1285
|
-
const
|
|
1290
|
+
const He = (t, e) => {
|
|
1286
1291
|
switch (t) {
|
|
1287
1292
|
case "P":
|
|
1288
1293
|
return e.date({ width: "short" });
|
|
@@ -1293,7 +1298,7 @@ const $e = (t, e) => {
|
|
|
1293
1298
|
default:
|
|
1294
1299
|
return e.date({ width: "full" });
|
|
1295
1300
|
}
|
|
1296
|
-
},
|
|
1301
|
+
}, ft = (t, e) => {
|
|
1297
1302
|
switch (t) {
|
|
1298
1303
|
case "p":
|
|
1299
1304
|
return e.time({ width: "short" });
|
|
@@ -1304,10 +1309,10 @@ const $e = (t, e) => {
|
|
|
1304
1309
|
default:
|
|
1305
1310
|
return e.time({ width: "full" });
|
|
1306
1311
|
}
|
|
1307
|
-
},
|
|
1312
|
+
}, Ln = (t, e) => {
|
|
1308
1313
|
const n = t.match(/(P+)(p+)?/) || [], r = n[1], s = n[2];
|
|
1309
1314
|
if (!s)
|
|
1310
|
-
return
|
|
1315
|
+
return He(t, e);
|
|
1311
1316
|
let a;
|
|
1312
1317
|
switch (r) {
|
|
1313
1318
|
case "P":
|
|
@@ -1323,78 +1328,78 @@ const $e = (t, e) => {
|
|
|
1323
1328
|
a = e.dateTime({ width: "full" });
|
|
1324
1329
|
break;
|
|
1325
1330
|
}
|
|
1326
|
-
return a.replace("{{date}}",
|
|
1327
|
-
},
|
|
1328
|
-
p:
|
|
1329
|
-
P:
|
|
1330
|
-
},
|
|
1331
|
-
function
|
|
1332
|
-
return
|
|
1331
|
+
return a.replace("{{date}}", He(r, e)).replace("{{time}}", ft(s, e));
|
|
1332
|
+
}, re = {
|
|
1333
|
+
p: ft,
|
|
1334
|
+
P: Ln
|
|
1335
|
+
}, $n = /^D+$/, Wn = /^Y+$/, qn = ["D", "DD", "YY", "YYYY"];
|
|
1336
|
+
function mt(t) {
|
|
1337
|
+
return $n.test(t);
|
|
1333
1338
|
}
|
|
1334
|
-
function
|
|
1335
|
-
return
|
|
1339
|
+
function ht(t) {
|
|
1340
|
+
return Wn.test(t);
|
|
1336
1341
|
}
|
|
1337
|
-
function
|
|
1338
|
-
const r =
|
|
1339
|
-
if (console.warn(r),
|
|
1342
|
+
function se(t, e, n) {
|
|
1343
|
+
const r = Un(t, e, n);
|
|
1344
|
+
if (console.warn(r), qn.includes(t)) throw new RangeError(r);
|
|
1340
1345
|
}
|
|
1341
|
-
function
|
|
1346
|
+
function Un(t, e, n) {
|
|
1342
1347
|
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
1343
1348
|
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1344
1349
|
}
|
|
1345
|
-
const
|
|
1346
|
-
function
|
|
1347
|
-
const r =
|
|
1348
|
-
if (!
|
|
1350
|
+
const Hn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Fn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Qn = /^'([^]*?)'?$/, Bn = /''/g, Vn = /[a-zA-Z]/;
|
|
1351
|
+
function Gn(t, e, n) {
|
|
1352
|
+
const r = $(), s = r.locale ?? ut, a = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, c = p(t, n?.in);
|
|
1353
|
+
if (!ne(c))
|
|
1349
1354
|
throw new RangeError("Invalid time value");
|
|
1350
|
-
let
|
|
1355
|
+
let i = e.match(Fn).map((d) => {
|
|
1351
1356
|
const l = d[0];
|
|
1352
1357
|
if (l === "p" || l === "P") {
|
|
1353
|
-
const
|
|
1354
|
-
return
|
|
1358
|
+
const m = re[l];
|
|
1359
|
+
return m(d, s.formatLong);
|
|
1355
1360
|
}
|
|
1356
1361
|
return d;
|
|
1357
|
-
}).join("").match(
|
|
1362
|
+
}).join("").match(Hn).map((d) => {
|
|
1358
1363
|
if (d === "''")
|
|
1359
1364
|
return { isToken: !1, value: "'" };
|
|
1360
1365
|
const l = d[0];
|
|
1361
1366
|
if (l === "'")
|
|
1362
|
-
return { isToken: !1, value:
|
|
1363
|
-
if (
|
|
1367
|
+
return { isToken: !1, value: Xn(d) };
|
|
1368
|
+
if (We[l])
|
|
1364
1369
|
return { isToken: !0, value: d };
|
|
1365
|
-
if (l.match(
|
|
1370
|
+
if (l.match(Vn))
|
|
1366
1371
|
throw new RangeError(
|
|
1367
1372
|
"Format string contains an unescaped latin alphabet character `" + l + "`"
|
|
1368
1373
|
);
|
|
1369
1374
|
return { isToken: !1, value: d };
|
|
1370
1375
|
});
|
|
1371
|
-
s.localize.preprocessor && (
|
|
1376
|
+
s.localize.preprocessor && (i = s.localize.preprocessor(c, i));
|
|
1372
1377
|
const u = {
|
|
1373
1378
|
firstWeekContainsDate: a,
|
|
1374
1379
|
weekStartsOn: o,
|
|
1375
1380
|
locale: s
|
|
1376
1381
|
};
|
|
1377
|
-
return
|
|
1382
|
+
return i.map((d) => {
|
|
1378
1383
|
if (!d.isToken) return d.value;
|
|
1379
1384
|
const l = d.value;
|
|
1380
|
-
(
|
|
1381
|
-
const
|
|
1382
|
-
return
|
|
1385
|
+
(ht(l) || mt(l)) && se(l, e, String(t));
|
|
1386
|
+
const m = We[l[0]];
|
|
1387
|
+
return m(c, l, s.localize, u);
|
|
1383
1388
|
}).join("");
|
|
1384
1389
|
}
|
|
1385
|
-
function
|
|
1390
|
+
function Xn(t) {
|
|
1386
1391
|
const e = t.match(Qn);
|
|
1387
|
-
return e ? e[1].replace(
|
|
1392
|
+
return e ? e[1].replace(Bn, "'") : t;
|
|
1388
1393
|
}
|
|
1389
|
-
function
|
|
1390
|
-
return Object.assign({},
|
|
1394
|
+
function jn() {
|
|
1395
|
+
return Object.assign({}, $());
|
|
1391
1396
|
}
|
|
1392
|
-
function
|
|
1393
|
-
const n =
|
|
1397
|
+
function zn(t, e) {
|
|
1398
|
+
const n = p(t, e?.in).getDay();
|
|
1394
1399
|
return n === 0 ? 7 : n;
|
|
1395
1400
|
}
|
|
1396
|
-
function
|
|
1397
|
-
const n =
|
|
1401
|
+
function Kn(t, e) {
|
|
1402
|
+
const n = Jn(e) ? new e(0) : E(e, 0);
|
|
1398
1403
|
return n.setFullYear(t.getFullYear(), t.getMonth(), t.getDate()), n.setHours(
|
|
1399
1404
|
t.getHours(),
|
|
1400
1405
|
t.getMinutes(),
|
|
@@ -1402,17 +1407,17 @@ function Xn(t, e) {
|
|
|
1402
1407
|
t.getMilliseconds()
|
|
1403
1408
|
), n;
|
|
1404
1409
|
}
|
|
1405
|
-
function
|
|
1410
|
+
function Jn(t) {
|
|
1406
1411
|
return typeof t == "function" && t.prototype?.constructor === t;
|
|
1407
1412
|
}
|
|
1408
|
-
const
|
|
1409
|
-
class
|
|
1413
|
+
const Zn = 10;
|
|
1414
|
+
class gt {
|
|
1410
1415
|
subPriority = 0;
|
|
1411
1416
|
validate(e, n) {
|
|
1412
1417
|
return !0;
|
|
1413
1418
|
}
|
|
1414
1419
|
}
|
|
1415
|
-
class
|
|
1420
|
+
class er extends gt {
|
|
1416
1421
|
constructor(e, n, r, s, a) {
|
|
1417
1422
|
super(), this.value = e, this.validateValue = n, this.setValue = r, this.priority = s, a && (this.subPriority = a);
|
|
1418
1423
|
}
|
|
@@ -1423,21 +1428,21 @@ class zn extends lt {
|
|
|
1423
1428
|
return this.setValue(e, n, this.value, r);
|
|
1424
1429
|
}
|
|
1425
1430
|
}
|
|
1426
|
-
class
|
|
1427
|
-
priority =
|
|
1431
|
+
class tr extends gt {
|
|
1432
|
+
priority = Zn;
|
|
1428
1433
|
subPriority = -1;
|
|
1429
1434
|
constructor(e, n) {
|
|
1430
1435
|
super(), this.context = e || ((r) => E(n, r));
|
|
1431
1436
|
}
|
|
1432
1437
|
set(e, n) {
|
|
1433
|
-
return n.timestampIsSet ? e : E(e,
|
|
1438
|
+
return n.timestampIsSet ? e : E(e, Kn(e, this.context));
|
|
1434
1439
|
}
|
|
1435
1440
|
}
|
|
1436
|
-
class
|
|
1441
|
+
class h {
|
|
1437
1442
|
run(e, n, r, s) {
|
|
1438
1443
|
const a = this.parse(e, n, r, s);
|
|
1439
1444
|
return a ? {
|
|
1440
|
-
setter: new
|
|
1445
|
+
setter: new er(
|
|
1441
1446
|
a.value,
|
|
1442
1447
|
this.validate,
|
|
1443
1448
|
this.set,
|
|
@@ -1451,7 +1456,7 @@ class m {
|
|
|
1451
1456
|
return !0;
|
|
1452
1457
|
}
|
|
1453
1458
|
}
|
|
1454
|
-
class
|
|
1459
|
+
class nr extends h {
|
|
1455
1460
|
priority = 140;
|
|
1456
1461
|
parse(e, n, r) {
|
|
1457
1462
|
switch (n) {
|
|
@@ -1523,7 +1528,7 @@ function T(t, e) {
|
|
|
1523
1528
|
rest: t.rest
|
|
1524
1529
|
};
|
|
1525
1530
|
}
|
|
1526
|
-
function
|
|
1531
|
+
function y(t, e) {
|
|
1527
1532
|
const n = e.match(t);
|
|
1528
1533
|
return n ? {
|
|
1529
1534
|
value: parseInt(n[0], 10),
|
|
@@ -1541,42 +1546,42 @@ function A(t, e) {
|
|
|
1541
1546
|
};
|
|
1542
1547
|
const r = n[1] === "+" ? 1 : -1, s = n[2] ? parseInt(n[2], 10) : 0, a = n[3] ? parseInt(n[3], 10) : 0, o = n[5] ? parseInt(n[5], 10) : 0;
|
|
1543
1548
|
return {
|
|
1544
|
-
value: r * (s *
|
|
1549
|
+
value: r * (s * fe + a * le + o * jt),
|
|
1545
1550
|
rest: e.slice(n[0].length)
|
|
1546
1551
|
};
|
|
1547
1552
|
}
|
|
1548
|
-
function
|
|
1549
|
-
return
|
|
1553
|
+
function wt(t) {
|
|
1554
|
+
return y(D.anyDigitsSigned, t);
|
|
1550
1555
|
}
|
|
1551
1556
|
function b(t, e) {
|
|
1552
1557
|
switch (t) {
|
|
1553
1558
|
case 1:
|
|
1554
|
-
return
|
|
1559
|
+
return y(D.singleDigit, e);
|
|
1555
1560
|
case 2:
|
|
1556
|
-
return
|
|
1561
|
+
return y(D.twoDigits, e);
|
|
1557
1562
|
case 3:
|
|
1558
|
-
return
|
|
1563
|
+
return y(D.threeDigits, e);
|
|
1559
1564
|
case 4:
|
|
1560
|
-
return
|
|
1565
|
+
return y(D.fourDigits, e);
|
|
1561
1566
|
default:
|
|
1562
|
-
return
|
|
1567
|
+
return y(new RegExp("^\\d{1," + t + "}"), e);
|
|
1563
1568
|
}
|
|
1564
1569
|
}
|
|
1565
1570
|
function J(t, e) {
|
|
1566
1571
|
switch (t) {
|
|
1567
1572
|
case 1:
|
|
1568
|
-
return
|
|
1573
|
+
return y(D.singleDigitSigned, e);
|
|
1569
1574
|
case 2:
|
|
1570
|
-
return
|
|
1575
|
+
return y(D.twoDigitsSigned, e);
|
|
1571
1576
|
case 3:
|
|
1572
|
-
return
|
|
1577
|
+
return y(D.threeDigitsSigned, e);
|
|
1573
1578
|
case 4:
|
|
1574
|
-
return
|
|
1579
|
+
return y(D.fourDigitsSigned, e);
|
|
1575
1580
|
default:
|
|
1576
|
-
return
|
|
1581
|
+
return y(new RegExp("^-?\\d{1," + t + "}"), e);
|
|
1577
1582
|
}
|
|
1578
1583
|
}
|
|
1579
|
-
function
|
|
1584
|
+
function he(t) {
|
|
1580
1585
|
switch (t) {
|
|
1581
1586
|
case "morning":
|
|
1582
1587
|
return 4;
|
|
@@ -1590,21 +1595,21 @@ function me(t) {
|
|
|
1590
1595
|
return 0;
|
|
1591
1596
|
}
|
|
1592
1597
|
}
|
|
1593
|
-
function
|
|
1598
|
+
function yt(t, e) {
|
|
1594
1599
|
const n = e > 0, r = n ? e : 1 - e;
|
|
1595
1600
|
let s;
|
|
1596
1601
|
if (r <= 50)
|
|
1597
1602
|
s = t || 100;
|
|
1598
1603
|
else {
|
|
1599
|
-
const a = r + 50, o = Math.trunc(a / 100) * 100,
|
|
1600
|
-
s = t + o - (
|
|
1604
|
+
const a = r + 50, o = Math.trunc(a / 100) * 100, c = t >= a % 100;
|
|
1605
|
+
s = t + o - (c ? 100 : 0);
|
|
1601
1606
|
}
|
|
1602
1607
|
return n ? s : 1 - s;
|
|
1603
1608
|
}
|
|
1604
|
-
function
|
|
1609
|
+
function pt(t) {
|
|
1605
1610
|
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
1606
1611
|
}
|
|
1607
|
-
class
|
|
1612
|
+
class rr extends h {
|
|
1608
1613
|
priority = 130;
|
|
1609
1614
|
incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
|
|
1610
1615
|
parse(e, n, r) {
|
|
@@ -1632,7 +1637,7 @@ class er extends m {
|
|
|
1632
1637
|
set(e, n, r) {
|
|
1633
1638
|
const s = e.getFullYear();
|
|
1634
1639
|
if (r.isTwoDigitYear) {
|
|
1635
|
-
const o =
|
|
1640
|
+
const o = yt(
|
|
1636
1641
|
r.year,
|
|
1637
1642
|
s
|
|
1638
1643
|
);
|
|
@@ -1642,7 +1647,7 @@ class er extends m {
|
|
|
1642
1647
|
return e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1643
1648
|
}
|
|
1644
1649
|
}
|
|
1645
|
-
class
|
|
1650
|
+
class sr extends h {
|
|
1646
1651
|
priority = 130;
|
|
1647
1652
|
parse(e, n, r) {
|
|
1648
1653
|
const s = (a) => ({
|
|
@@ -1667,20 +1672,20 @@ class tr extends m {
|
|
|
1667
1672
|
return n.isTwoDigitYear || n.year > 0;
|
|
1668
1673
|
}
|
|
1669
1674
|
set(e, n, r, s) {
|
|
1670
|
-
const a =
|
|
1675
|
+
const a = me(e, s);
|
|
1671
1676
|
if (r.isTwoDigitYear) {
|
|
1672
|
-
const
|
|
1677
|
+
const c = yt(
|
|
1673
1678
|
r.year,
|
|
1674
1679
|
a
|
|
1675
1680
|
);
|
|
1676
1681
|
return e.setFullYear(
|
|
1677
|
-
|
|
1682
|
+
c,
|
|
1678
1683
|
0,
|
|
1679
1684
|
s.firstWeekContainsDate
|
|
1680
|
-
), e.setHours(0, 0, 0, 0),
|
|
1685
|
+
), e.setHours(0, 0, 0, 0), I(e, s);
|
|
1681
1686
|
}
|
|
1682
1687
|
const o = !("era" in n) || n.era === 1 ? r.year : 1 - r.year;
|
|
1683
|
-
return e.setFullYear(o, 0, s.firstWeekContainsDate), e.setHours(0, 0, 0, 0),
|
|
1688
|
+
return e.setFullYear(o, 0, s.firstWeekContainsDate), e.setHours(0, 0, 0, 0), I(e, s);
|
|
1684
1689
|
}
|
|
1685
1690
|
incompatibleTokens = [
|
|
1686
1691
|
"y",
|
|
@@ -1698,7 +1703,7 @@ class tr extends m {
|
|
|
1698
1703
|
"T"
|
|
1699
1704
|
];
|
|
1700
1705
|
}
|
|
1701
|
-
class
|
|
1706
|
+
class ar extends h {
|
|
1702
1707
|
priority = 130;
|
|
1703
1708
|
parse(e, n) {
|
|
1704
1709
|
return J(n === "R" ? 4 : n.length, e);
|
|
@@ -1725,7 +1730,7 @@ class nr extends m {
|
|
|
1725
1730
|
"T"
|
|
1726
1731
|
];
|
|
1727
1732
|
}
|
|
1728
|
-
class
|
|
1733
|
+
class or extends h {
|
|
1729
1734
|
priority = 130;
|
|
1730
1735
|
parse(e, n) {
|
|
1731
1736
|
return J(n === "u" ? 4 : n.length, e);
|
|
@@ -1735,7 +1740,7 @@ class rr extends m {
|
|
|
1735
1740
|
}
|
|
1736
1741
|
incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
|
|
1737
1742
|
}
|
|
1738
|
-
class
|
|
1743
|
+
class ir extends h {
|
|
1739
1744
|
priority = 120;
|
|
1740
1745
|
parse(e, n, r) {
|
|
1741
1746
|
switch (n) {
|
|
@@ -1797,7 +1802,7 @@ class sr extends m {
|
|
|
1797
1802
|
"T"
|
|
1798
1803
|
];
|
|
1799
1804
|
}
|
|
1800
|
-
class
|
|
1805
|
+
class cr extends h {
|
|
1801
1806
|
priority = 120;
|
|
1802
1807
|
parse(e, n, r) {
|
|
1803
1808
|
switch (n) {
|
|
@@ -1859,7 +1864,7 @@ class ar extends m {
|
|
|
1859
1864
|
"T"
|
|
1860
1865
|
];
|
|
1861
1866
|
}
|
|
1862
|
-
class
|
|
1867
|
+
class ur extends h {
|
|
1863
1868
|
incompatibleTokens = [
|
|
1864
1869
|
"Y",
|
|
1865
1870
|
"R",
|
|
@@ -1882,7 +1887,7 @@ class or extends m {
|
|
|
1882
1887
|
// 1, 2, ..., 12
|
|
1883
1888
|
case "M":
|
|
1884
1889
|
return T(
|
|
1885
|
-
|
|
1890
|
+
y(D.month, e),
|
|
1886
1891
|
s
|
|
1887
1892
|
);
|
|
1888
1893
|
// 01, 02, ..., 12
|
|
@@ -1922,7 +1927,7 @@ class or extends m {
|
|
|
1922
1927
|
return e.setMonth(r, 1), e.setHours(0, 0, 0, 0), e;
|
|
1923
1928
|
}
|
|
1924
1929
|
}
|
|
1925
|
-
class
|
|
1930
|
+
class dr extends h {
|
|
1926
1931
|
priority = 110;
|
|
1927
1932
|
parse(e, n, r) {
|
|
1928
1933
|
const s = (a) => a - 1;
|
|
@@ -1930,7 +1935,7 @@ class ir extends m {
|
|
|
1930
1935
|
// 1, 2, ..., 12
|
|
1931
1936
|
case "L":
|
|
1932
1937
|
return T(
|
|
1933
|
-
|
|
1938
|
+
y(D.month, e),
|
|
1934
1939
|
s
|
|
1935
1940
|
);
|
|
1936
1941
|
// 01, 02, ..., 12
|
|
@@ -1985,16 +1990,16 @@ class ir extends m {
|
|
|
1985
1990
|
"T"
|
|
1986
1991
|
];
|
|
1987
1992
|
}
|
|
1988
|
-
function
|
|
1989
|
-
const r =
|
|
1990
|
-
return r.setDate(r.getDate() - s * 7),
|
|
1993
|
+
function lr(t, e, n) {
|
|
1994
|
+
const r = p(t, n?.in), s = lt(r, n) - e;
|
|
1995
|
+
return r.setDate(r.getDate() - s * 7), p(r, n?.in);
|
|
1991
1996
|
}
|
|
1992
|
-
class
|
|
1997
|
+
class fr extends h {
|
|
1993
1998
|
priority = 100;
|
|
1994
1999
|
parse(e, n, r) {
|
|
1995
2000
|
switch (n) {
|
|
1996
2001
|
case "w":
|
|
1997
|
-
return
|
|
2002
|
+
return y(D.week, e);
|
|
1998
2003
|
case "wo":
|
|
1999
2004
|
return r.ordinalNumber(e, { unit: "week" });
|
|
2000
2005
|
default:
|
|
@@ -2005,7 +2010,7 @@ class ur extends m {
|
|
|
2005
2010
|
return n >= 1 && n <= 53;
|
|
2006
2011
|
}
|
|
2007
2012
|
set(e, n, r, s) {
|
|
2008
|
-
return
|
|
2013
|
+
return I(lr(e, r, s), s);
|
|
2009
2014
|
}
|
|
2010
2015
|
incompatibleTokens = [
|
|
2011
2016
|
"y",
|
|
@@ -2023,16 +2028,16 @@ class ur extends m {
|
|
|
2023
2028
|
"T"
|
|
2024
2029
|
];
|
|
2025
2030
|
}
|
|
2026
|
-
function
|
|
2027
|
-
const r =
|
|
2031
|
+
function mr(t, e, n) {
|
|
2032
|
+
const r = p(t, n?.in), s = dt(r, n) - e;
|
|
2028
2033
|
return r.setDate(r.getDate() - s * 7), r;
|
|
2029
2034
|
}
|
|
2030
|
-
class
|
|
2035
|
+
class hr extends h {
|
|
2031
2036
|
priority = 100;
|
|
2032
2037
|
parse(e, n, r) {
|
|
2033
2038
|
switch (n) {
|
|
2034
2039
|
case "I":
|
|
2035
|
-
return
|
|
2040
|
+
return y(D.week, e);
|
|
2036
2041
|
case "Io":
|
|
2037
2042
|
return r.ordinalNumber(e, { unit: "week" });
|
|
2038
2043
|
default:
|
|
@@ -2043,7 +2048,7 @@ class lr extends m {
|
|
|
2043
2048
|
return n >= 1 && n <= 53;
|
|
2044
2049
|
}
|
|
2045
2050
|
set(e, n, r) {
|
|
2046
|
-
return L(
|
|
2051
|
+
return L(mr(e, r));
|
|
2047
2052
|
}
|
|
2048
2053
|
incompatibleTokens = [
|
|
2049
2054
|
"y",
|
|
@@ -2062,7 +2067,7 @@ class lr extends m {
|
|
|
2062
2067
|
"T"
|
|
2063
2068
|
];
|
|
2064
2069
|
}
|
|
2065
|
-
const
|
|
2070
|
+
const gr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], wr = [
|
|
2066
2071
|
31,
|
|
2067
2072
|
29,
|
|
2068
2073
|
31,
|
|
@@ -2076,13 +2081,13 @@ const fr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], mr = [
|
|
|
2076
2081
|
30,
|
|
2077
2082
|
31
|
|
2078
2083
|
];
|
|
2079
|
-
class
|
|
2084
|
+
class yr extends h {
|
|
2080
2085
|
priority = 90;
|
|
2081
2086
|
subPriority = 1;
|
|
2082
2087
|
parse(e, n, r) {
|
|
2083
2088
|
switch (n) {
|
|
2084
2089
|
case "d":
|
|
2085
|
-
return
|
|
2090
|
+
return y(D.date, e);
|
|
2086
2091
|
case "do":
|
|
2087
2092
|
return r.ordinalNumber(e, { unit: "date" });
|
|
2088
2093
|
default:
|
|
@@ -2090,8 +2095,8 @@ class hr extends m {
|
|
|
2090
2095
|
}
|
|
2091
2096
|
}
|
|
2092
2097
|
validate(e, n) {
|
|
2093
|
-
const r = e.getFullYear(), s =
|
|
2094
|
-
return s ? n >= 1 && n <=
|
|
2098
|
+
const r = e.getFullYear(), s = pt(r), a = e.getMonth();
|
|
2099
|
+
return s ? n >= 1 && n <= wr[a] : n >= 1 && n <= gr[a];
|
|
2095
2100
|
}
|
|
2096
2101
|
set(e, n, r) {
|
|
2097
2102
|
return e.setDate(r), e.setHours(0, 0, 0, 0), e;
|
|
@@ -2111,14 +2116,14 @@ class hr extends m {
|
|
|
2111
2116
|
"T"
|
|
2112
2117
|
];
|
|
2113
2118
|
}
|
|
2114
|
-
class
|
|
2119
|
+
class pr extends h {
|
|
2115
2120
|
priority = 90;
|
|
2116
2121
|
subpriority = 1;
|
|
2117
2122
|
parse(e, n, r) {
|
|
2118
2123
|
switch (n) {
|
|
2119
2124
|
case "D":
|
|
2120
2125
|
case "DD":
|
|
2121
|
-
return
|
|
2126
|
+
return y(D.dayOfYear, e);
|
|
2122
2127
|
case "Do":
|
|
2123
2128
|
return r.ordinalNumber(e, { unit: "date" });
|
|
2124
2129
|
default:
|
|
@@ -2127,7 +2132,7 @@ class wr extends m {
|
|
|
2127
2132
|
}
|
|
2128
2133
|
validate(e, n) {
|
|
2129
2134
|
const r = e.getFullYear();
|
|
2130
|
-
return
|
|
2135
|
+
return pt(r) ? n >= 1 && n <= 366 : n >= 1 && n <= 365;
|
|
2131
2136
|
}
|
|
2132
2137
|
set(e, n, r) {
|
|
2133
2138
|
return e.setMonth(0, r), e.setHours(0, 0, 0, 0), e;
|
|
@@ -2150,11 +2155,11 @@ class wr extends m {
|
|
|
2150
2155
|
"T"
|
|
2151
2156
|
];
|
|
2152
2157
|
}
|
|
2153
|
-
function
|
|
2154
|
-
const r =
|
|
2155
|
-
return
|
|
2158
|
+
function ge(t, e, n) {
|
|
2159
|
+
const r = $(), s = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, a = p(t, n?.in), o = a.getDay(), i = (e % 7 + 7) % 7, u = 7 - s, d = e < 0 || e > 6 ? e - (o + u) % 7 : (i + u) % 7 - (o + u) % 7;
|
|
2160
|
+
return it(a, d, n);
|
|
2156
2161
|
}
|
|
2157
|
-
class
|
|
2162
|
+
class br extends h {
|
|
2158
2163
|
priority = 90;
|
|
2159
2164
|
parse(e, n, r) {
|
|
2160
2165
|
switch (n) {
|
|
@@ -2186,16 +2191,16 @@ class gr extends m {
|
|
|
2186
2191
|
return n >= 0 && n <= 6;
|
|
2187
2192
|
}
|
|
2188
2193
|
set(e, n, r, s) {
|
|
2189
|
-
return e =
|
|
2194
|
+
return e = ge(e, r, s), e.setHours(0, 0, 0, 0), e;
|
|
2190
2195
|
}
|
|
2191
2196
|
incompatibleTokens = ["D", "i", "e", "c", "t", "T"];
|
|
2192
2197
|
}
|
|
2193
|
-
class
|
|
2198
|
+
class Dr extends h {
|
|
2194
2199
|
priority = 90;
|
|
2195
2200
|
parse(e, n, r, s) {
|
|
2196
2201
|
const a = (o) => {
|
|
2197
|
-
const
|
|
2198
|
-
return (o + s.weekStartsOn + 6) % 7 +
|
|
2202
|
+
const c = Math.floor((o - 1) / 7) * 7;
|
|
2203
|
+
return (o + s.weekStartsOn + 6) % 7 + c;
|
|
2199
2204
|
};
|
|
2200
2205
|
switch (n) {
|
|
2201
2206
|
// 3
|
|
@@ -2236,7 +2241,7 @@ class pr extends m {
|
|
|
2236
2241
|
return n >= 0 && n <= 6;
|
|
2237
2242
|
}
|
|
2238
2243
|
set(e, n, r, s) {
|
|
2239
|
-
return e =
|
|
2244
|
+
return e = ge(e, r, s), e.setHours(0, 0, 0, 0), e;
|
|
2240
2245
|
}
|
|
2241
2246
|
incompatibleTokens = [
|
|
2242
2247
|
"y",
|
|
@@ -2256,12 +2261,12 @@ class pr extends m {
|
|
|
2256
2261
|
"T"
|
|
2257
2262
|
];
|
|
2258
2263
|
}
|
|
2259
|
-
class
|
|
2264
|
+
class Tr extends h {
|
|
2260
2265
|
priority = 90;
|
|
2261
2266
|
parse(e, n, r, s) {
|
|
2262
2267
|
const a = (o) => {
|
|
2263
|
-
const
|
|
2264
|
-
return (o + s.weekStartsOn + 6) % 7 +
|
|
2268
|
+
const c = Math.floor((o - 1) / 7) * 7;
|
|
2269
|
+
return (o + s.weekStartsOn + 6) % 7 + c;
|
|
2265
2270
|
};
|
|
2266
2271
|
switch (n) {
|
|
2267
2272
|
// 3
|
|
@@ -2302,7 +2307,7 @@ class yr extends m {
|
|
|
2302
2307
|
return n >= 0 && n <= 6;
|
|
2303
2308
|
}
|
|
2304
2309
|
set(e, n, r, s) {
|
|
2305
|
-
return e =
|
|
2310
|
+
return e = ge(e, r, s), e.setHours(0, 0, 0, 0), e;
|
|
2306
2311
|
}
|
|
2307
2312
|
incompatibleTokens = [
|
|
2308
2313
|
"y",
|
|
@@ -2322,11 +2327,11 @@ class yr extends m {
|
|
|
2322
2327
|
"T"
|
|
2323
2328
|
];
|
|
2324
2329
|
}
|
|
2325
|
-
function
|
|
2326
|
-
const r =
|
|
2327
|
-
return
|
|
2330
|
+
function Er(t, e, n) {
|
|
2331
|
+
const r = p(t, n?.in), s = zn(r, n), a = e - s;
|
|
2332
|
+
return it(r, a, n);
|
|
2328
2333
|
}
|
|
2329
|
-
class
|
|
2334
|
+
class xr extends h {
|
|
2330
2335
|
priority = 90;
|
|
2331
2336
|
parse(e, n, r) {
|
|
2332
2337
|
const s = (a) => a === 0 ? 7 : a;
|
|
@@ -2397,7 +2402,7 @@ class Dr extends m {
|
|
|
2397
2402
|
return n >= 1 && n <= 7;
|
|
2398
2403
|
}
|
|
2399
2404
|
set(e, n, r) {
|
|
2400
|
-
return e =
|
|
2405
|
+
return e = Er(e, r), e.setHours(0, 0, 0, 0), e;
|
|
2401
2406
|
}
|
|
2402
2407
|
incompatibleTokens = [
|
|
2403
2408
|
"y",
|
|
@@ -2417,7 +2422,7 @@ class Dr extends m {
|
|
|
2417
2422
|
"T"
|
|
2418
2423
|
];
|
|
2419
2424
|
}
|
|
2420
|
-
class
|
|
2425
|
+
class Pr extends h {
|
|
2421
2426
|
priority = 80;
|
|
2422
2427
|
parse(e, n, r) {
|
|
2423
2428
|
switch (n) {
|
|
@@ -2450,11 +2455,11 @@ class Tr extends m {
|
|
|
2450
2455
|
}
|
|
2451
2456
|
}
|
|
2452
2457
|
set(e, n, r) {
|
|
2453
|
-
return e.setHours(
|
|
2458
|
+
return e.setHours(he(r), 0, 0, 0), e;
|
|
2454
2459
|
}
|
|
2455
2460
|
incompatibleTokens = ["b", "B", "H", "k", "t", "T"];
|
|
2456
2461
|
}
|
|
2457
|
-
class
|
|
2462
|
+
class vr extends h {
|
|
2458
2463
|
priority = 80;
|
|
2459
2464
|
parse(e, n, r) {
|
|
2460
2465
|
switch (n) {
|
|
@@ -2487,11 +2492,11 @@ class Er extends m {
|
|
|
2487
2492
|
}
|
|
2488
2493
|
}
|
|
2489
2494
|
set(e, n, r) {
|
|
2490
|
-
return e.setHours(
|
|
2495
|
+
return e.setHours(he(r), 0, 0, 0), e;
|
|
2491
2496
|
}
|
|
2492
2497
|
incompatibleTokens = ["a", "B", "H", "k", "t", "T"];
|
|
2493
2498
|
}
|
|
2494
|
-
class
|
|
2499
|
+
class Mr extends h {
|
|
2495
2500
|
priority = 80;
|
|
2496
2501
|
parse(e, n, r) {
|
|
2497
2502
|
switch (n) {
|
|
@@ -2524,16 +2529,16 @@ class xr extends m {
|
|
|
2524
2529
|
}
|
|
2525
2530
|
}
|
|
2526
2531
|
set(e, n, r) {
|
|
2527
|
-
return e.setHours(
|
|
2532
|
+
return e.setHours(he(r), 0, 0, 0), e;
|
|
2528
2533
|
}
|
|
2529
2534
|
incompatibleTokens = ["a", "b", "t", "T"];
|
|
2530
2535
|
}
|
|
2531
|
-
class
|
|
2536
|
+
class Or extends h {
|
|
2532
2537
|
priority = 70;
|
|
2533
2538
|
parse(e, n, r) {
|
|
2534
2539
|
switch (n) {
|
|
2535
2540
|
case "h":
|
|
2536
|
-
return
|
|
2541
|
+
return y(D.hour12h, e);
|
|
2537
2542
|
case "ho":
|
|
2538
2543
|
return r.ordinalNumber(e, { unit: "hour" });
|
|
2539
2544
|
default:
|
|
@@ -2549,12 +2554,12 @@ class Pr extends m {
|
|
|
2549
2554
|
}
|
|
2550
2555
|
incompatibleTokens = ["H", "K", "k", "t", "T"];
|
|
2551
2556
|
}
|
|
2552
|
-
class
|
|
2557
|
+
class Ar extends h {
|
|
2553
2558
|
priority = 70;
|
|
2554
2559
|
parse(e, n, r) {
|
|
2555
2560
|
switch (n) {
|
|
2556
2561
|
case "H":
|
|
2557
|
-
return
|
|
2562
|
+
return y(D.hour23h, e);
|
|
2558
2563
|
case "Ho":
|
|
2559
2564
|
return r.ordinalNumber(e, { unit: "hour" });
|
|
2560
2565
|
default:
|
|
@@ -2569,12 +2574,12 @@ class Mr extends m {
|
|
|
2569
2574
|
}
|
|
2570
2575
|
incompatibleTokens = ["a", "b", "h", "K", "k", "t", "T"];
|
|
2571
2576
|
}
|
|
2572
|
-
class
|
|
2577
|
+
class Nr extends h {
|
|
2573
2578
|
priority = 70;
|
|
2574
2579
|
parse(e, n, r) {
|
|
2575
2580
|
switch (n) {
|
|
2576
2581
|
case "K":
|
|
2577
|
-
return
|
|
2582
|
+
return y(D.hour11h, e);
|
|
2578
2583
|
case "Ko":
|
|
2579
2584
|
return r.ordinalNumber(e, { unit: "hour" });
|
|
2580
2585
|
default:
|
|
@@ -2589,12 +2594,12 @@ class vr extends m {
|
|
|
2589
2594
|
}
|
|
2590
2595
|
incompatibleTokens = ["h", "H", "k", "t", "T"];
|
|
2591
2596
|
}
|
|
2592
|
-
class
|
|
2597
|
+
class Rr extends h {
|
|
2593
2598
|
priority = 70;
|
|
2594
2599
|
parse(e, n, r) {
|
|
2595
2600
|
switch (n) {
|
|
2596
2601
|
case "k":
|
|
2597
|
-
return
|
|
2602
|
+
return y(D.hour24h, e);
|
|
2598
2603
|
case "ko":
|
|
2599
2604
|
return r.ordinalNumber(e, { unit: "hour" });
|
|
2600
2605
|
default:
|
|
@@ -2610,12 +2615,12 @@ class Or extends m {
|
|
|
2610
2615
|
}
|
|
2611
2616
|
incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"];
|
|
2612
2617
|
}
|
|
2613
|
-
class
|
|
2618
|
+
class kr extends h {
|
|
2614
2619
|
priority = 60;
|
|
2615
2620
|
parse(e, n, r) {
|
|
2616
2621
|
switch (n) {
|
|
2617
2622
|
case "m":
|
|
2618
|
-
return
|
|
2623
|
+
return y(D.minute, e);
|
|
2619
2624
|
case "mo":
|
|
2620
2625
|
return r.ordinalNumber(e, { unit: "minute" });
|
|
2621
2626
|
default:
|
|
@@ -2630,12 +2635,12 @@ class Ar extends m {
|
|
|
2630
2635
|
}
|
|
2631
2636
|
incompatibleTokens = ["t", "T"];
|
|
2632
2637
|
}
|
|
2633
|
-
class
|
|
2638
|
+
class _r extends h {
|
|
2634
2639
|
priority = 50;
|
|
2635
2640
|
parse(e, n, r) {
|
|
2636
2641
|
switch (n) {
|
|
2637
2642
|
case "s":
|
|
2638
|
-
return
|
|
2643
|
+
return y(D.second, e);
|
|
2639
2644
|
case "so":
|
|
2640
2645
|
return r.ordinalNumber(e, { unit: "second" });
|
|
2641
2646
|
default:
|
|
@@ -2650,7 +2655,7 @@ class Nr extends m {
|
|
|
2650
2655
|
}
|
|
2651
2656
|
incompatibleTokens = ["t", "T"];
|
|
2652
2657
|
}
|
|
2653
|
-
class
|
|
2658
|
+
class Ir extends h {
|
|
2654
2659
|
priority = 30;
|
|
2655
2660
|
parse(e, n) {
|
|
2656
2661
|
const r = (s) => Math.trunc(s * Math.pow(10, -n.length + 3));
|
|
@@ -2661,7 +2666,7 @@ class kr extends m {
|
|
|
2661
2666
|
}
|
|
2662
2667
|
incompatibleTokens = ["t", "T"];
|
|
2663
2668
|
}
|
|
2664
|
-
class
|
|
2669
|
+
class Yr extends h {
|
|
2665
2670
|
priority = 10;
|
|
2666
2671
|
parse(e, n) {
|
|
2667
2672
|
switch (n) {
|
|
@@ -2689,12 +2694,12 @@ class Rr extends m {
|
|
|
2689
2694
|
set(e, n, r) {
|
|
2690
2695
|
return n.timestampIsSet ? e : E(
|
|
2691
2696
|
e,
|
|
2692
|
-
e.getTime() -
|
|
2697
|
+
e.getTime() - K(e) - r
|
|
2693
2698
|
);
|
|
2694
2699
|
}
|
|
2695
2700
|
incompatibleTokens = ["t", "T", "x"];
|
|
2696
2701
|
}
|
|
2697
|
-
class
|
|
2702
|
+
class Cr extends h {
|
|
2698
2703
|
priority = 10;
|
|
2699
2704
|
parse(e, n) {
|
|
2700
2705
|
switch (n) {
|
|
@@ -2722,99 +2727,99 @@ class _r extends m {
|
|
|
2722
2727
|
set(e, n, r) {
|
|
2723
2728
|
return n.timestampIsSet ? e : E(
|
|
2724
2729
|
e,
|
|
2725
|
-
e.getTime() -
|
|
2730
|
+
e.getTime() - K(e) - r
|
|
2726
2731
|
);
|
|
2727
2732
|
}
|
|
2728
2733
|
incompatibleTokens = ["t", "T", "X"];
|
|
2729
2734
|
}
|
|
2730
|
-
class
|
|
2735
|
+
class Sr extends h {
|
|
2731
2736
|
priority = 40;
|
|
2732
2737
|
parse(e) {
|
|
2733
|
-
return
|
|
2738
|
+
return wt(e);
|
|
2734
2739
|
}
|
|
2735
2740
|
set(e, n, r) {
|
|
2736
2741
|
return [E(e, r * 1e3), { timestampIsSet: !0 }];
|
|
2737
2742
|
}
|
|
2738
2743
|
incompatibleTokens = "*";
|
|
2739
2744
|
}
|
|
2740
|
-
class
|
|
2745
|
+
class Lr extends h {
|
|
2741
2746
|
priority = 20;
|
|
2742
2747
|
parse(e) {
|
|
2743
|
-
return
|
|
2748
|
+
return wt(e);
|
|
2744
2749
|
}
|
|
2745
2750
|
set(e, n, r) {
|
|
2746
2751
|
return [E(e, r), { timestampIsSet: !0 }];
|
|
2747
2752
|
}
|
|
2748
2753
|
incompatibleTokens = "*";
|
|
2749
2754
|
}
|
|
2750
|
-
const
|
|
2751
|
-
G: new
|
|
2752
|
-
y: new
|
|
2753
|
-
Y: new
|
|
2754
|
-
R: new
|
|
2755
|
-
u: new
|
|
2756
|
-
Q: new
|
|
2757
|
-
q: new
|
|
2758
|
-
M: new
|
|
2759
|
-
L: new
|
|
2760
|
-
w: new
|
|
2761
|
-
I: new
|
|
2762
|
-
d: new
|
|
2763
|
-
D: new
|
|
2764
|
-
E: new
|
|
2765
|
-
e: new
|
|
2766
|
-
c: new
|
|
2767
|
-
i: new
|
|
2768
|
-
a: new
|
|
2769
|
-
b: new
|
|
2770
|
-
B: new
|
|
2771
|
-
h: new
|
|
2772
|
-
H: new
|
|
2773
|
-
K: new
|
|
2774
|
-
k: new
|
|
2775
|
-
m: new
|
|
2776
|
-
s: new
|
|
2777
|
-
S: new
|
|
2778
|
-
X: new
|
|
2779
|
-
x: new
|
|
2780
|
-
t: new
|
|
2781
|
-
T: new
|
|
2782
|
-
},
|
|
2783
|
-
function
|
|
2784
|
-
const s = () => E(n, NaN), a =
|
|
2755
|
+
const $r = {
|
|
2756
|
+
G: new nr(),
|
|
2757
|
+
y: new rr(),
|
|
2758
|
+
Y: new sr(),
|
|
2759
|
+
R: new ar(),
|
|
2760
|
+
u: new or(),
|
|
2761
|
+
Q: new ir(),
|
|
2762
|
+
q: new cr(),
|
|
2763
|
+
M: new ur(),
|
|
2764
|
+
L: new dr(),
|
|
2765
|
+
w: new fr(),
|
|
2766
|
+
I: new hr(),
|
|
2767
|
+
d: new yr(),
|
|
2768
|
+
D: new pr(),
|
|
2769
|
+
E: new br(),
|
|
2770
|
+
e: new Dr(),
|
|
2771
|
+
c: new Tr(),
|
|
2772
|
+
i: new xr(),
|
|
2773
|
+
a: new Pr(),
|
|
2774
|
+
b: new vr(),
|
|
2775
|
+
B: new Mr(),
|
|
2776
|
+
h: new Or(),
|
|
2777
|
+
H: new Ar(),
|
|
2778
|
+
K: new Nr(),
|
|
2779
|
+
k: new Rr(),
|
|
2780
|
+
m: new kr(),
|
|
2781
|
+
s: new _r(),
|
|
2782
|
+
S: new Ir(),
|
|
2783
|
+
X: new Yr(),
|
|
2784
|
+
x: new Cr(),
|
|
2785
|
+
t: new Sr(),
|
|
2786
|
+
T: new Lr()
|
|
2787
|
+
}, Wr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, qr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ur = /^'([^]*?)'?$/, Hr = /''/g, Fr = /\S/, Qr = /[a-zA-Z]/;
|
|
2788
|
+
function Br(t, e, n, r) {
|
|
2789
|
+
const s = () => E(n, NaN), a = jn(), o = a.locale ?? ut, c = a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, i = a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0;
|
|
2785
2790
|
if (!e)
|
|
2786
|
-
return t ? s() :
|
|
2791
|
+
return t ? s() : p(n, r?.in);
|
|
2787
2792
|
const u = {
|
|
2788
|
-
firstWeekContainsDate:
|
|
2789
|
-
weekStartsOn:
|
|
2793
|
+
firstWeekContainsDate: c,
|
|
2794
|
+
weekStartsOn: i,
|
|
2790
2795
|
locale: o
|
|
2791
|
-
}, d = [new
|
|
2796
|
+
}, d = [new tr(r?.in, n)], l = e.match(qr).map((f) => {
|
|
2792
2797
|
const w = f[0];
|
|
2793
|
-
if (w in
|
|
2794
|
-
const
|
|
2795
|
-
return
|
|
2798
|
+
if (w in re) {
|
|
2799
|
+
const v = re[w];
|
|
2800
|
+
return v(f, o.formatLong);
|
|
2796
2801
|
}
|
|
2797
2802
|
return f;
|
|
2798
|
-
}).join("").match(
|
|
2803
|
+
}).join("").match(Wr), m = [];
|
|
2799
2804
|
for (let f of l) {
|
|
2800
|
-
|
|
2801
|
-
const w = f[0],
|
|
2802
|
-
if (
|
|
2803
|
-
const { incompatibleTokens:
|
|
2804
|
-
if (Array.isArray(
|
|
2805
|
-
const
|
|
2806
|
-
(
|
|
2805
|
+
ht(f) && se(f, e, t), mt(f) && se(f, e, t);
|
|
2806
|
+
const w = f[0], v = $r[w];
|
|
2807
|
+
if (v) {
|
|
2808
|
+
const { incompatibleTokens: M } = v;
|
|
2809
|
+
if (Array.isArray(M)) {
|
|
2810
|
+
const q = m.find(
|
|
2811
|
+
(Q) => M.includes(Q.token) || Q.token === w
|
|
2807
2812
|
);
|
|
2808
|
-
if (
|
|
2813
|
+
if (q)
|
|
2809
2814
|
throw new RangeError(
|
|
2810
|
-
`The format string mustn't contain \`${
|
|
2815
|
+
`The format string mustn't contain \`${q.fullToken}\` and \`${f}\` at the same time`
|
|
2811
2816
|
);
|
|
2812
|
-
} else if (
|
|
2817
|
+
} else if (v.incompatibleTokens === "*" && m.length > 0)
|
|
2813
2818
|
throw new RangeError(
|
|
2814
2819
|
`The format string mustn't contain \`${f}\` and any other token at the same time`
|
|
2815
2820
|
);
|
|
2816
|
-
|
|
2817
|
-
const W =
|
|
2821
|
+
m.push({ token: w, fullToken: f });
|
|
2822
|
+
const W = v.run(
|
|
2818
2823
|
t,
|
|
2819
2824
|
f,
|
|
2820
2825
|
o.match,
|
|
@@ -2828,47 +2833,47 @@ function Fr(t, e, n, r) {
|
|
|
2828
2833
|
throw new RangeError(
|
|
2829
2834
|
"Format string contains an unescaped latin alphabet character `" + w + "`"
|
|
2830
2835
|
);
|
|
2831
|
-
if (f === "''" ? f = "'" : w === "'" && (f =
|
|
2836
|
+
if (f === "''" ? f = "'" : w === "'" && (f = Vr(f)), t.indexOf(f) === 0)
|
|
2832
2837
|
t = t.slice(f.length);
|
|
2833
2838
|
else
|
|
2834
2839
|
return s();
|
|
2835
2840
|
}
|
|
2836
2841
|
}
|
|
2837
|
-
if (t.length > 0 &&
|
|
2842
|
+
if (t.length > 0 && Fr.test(t))
|
|
2838
2843
|
return s();
|
|
2839
|
-
const x = d.map((f) => f.priority).sort((f, w) => w - f).filter((f, w,
|
|
2840
|
-
(f) => d.filter((w) => w.priority === f).sort((w,
|
|
2844
|
+
const x = d.map((f) => f.priority).sort((f, w) => w - f).filter((f, w, v) => v.indexOf(f) === w).map(
|
|
2845
|
+
(f) => d.filter((w) => w.priority === f).sort((w, v) => v.subPriority - w.subPriority)
|
|
2841
2846
|
).map((f) => f[0]);
|
|
2842
|
-
let P =
|
|
2847
|
+
let P = p(n, r?.in);
|
|
2843
2848
|
if (isNaN(+P)) return s();
|
|
2844
|
-
const
|
|
2849
|
+
const N = {};
|
|
2845
2850
|
for (const f of x) {
|
|
2846
2851
|
if (!f.validate(P, u))
|
|
2847
2852
|
return s();
|
|
2848
|
-
const w = f.set(P,
|
|
2849
|
-
Array.isArray(w) ? (P = w[0], Object.assign(
|
|
2853
|
+
const w = f.set(P, N, u);
|
|
2854
|
+
Array.isArray(w) ? (P = w[0], Object.assign(N, w[1])) : P = w;
|
|
2850
2855
|
}
|
|
2851
2856
|
return P;
|
|
2852
2857
|
}
|
|
2853
|
-
function
|
|
2854
|
-
return t.match(
|
|
2858
|
+
function Vr(t) {
|
|
2859
|
+
return t.match(Ur)[1].replace(Hr, "'");
|
|
2855
2860
|
}
|
|
2856
|
-
function
|
|
2857
|
-
const n = () => E(e?.in, NaN), s =
|
|
2861
|
+
function Gr(t, e) {
|
|
2862
|
+
const n = () => E(e?.in, NaN), s = Kr(t);
|
|
2858
2863
|
let a;
|
|
2859
2864
|
if (s.date) {
|
|
2860
|
-
const u =
|
|
2861
|
-
a =
|
|
2865
|
+
const u = Jr(s.date, 2);
|
|
2866
|
+
a = Zr(u.restDateString, u.year);
|
|
2862
2867
|
}
|
|
2863
2868
|
if (!a || isNaN(+a)) return n();
|
|
2864
2869
|
const o = +a;
|
|
2865
|
-
let
|
|
2866
|
-
if (s.time && (
|
|
2870
|
+
let c = 0, i;
|
|
2871
|
+
if (s.time && (c = es(s.time), isNaN(c)))
|
|
2867
2872
|
return n();
|
|
2868
2873
|
if (s.timezone) {
|
|
2869
|
-
if (
|
|
2874
|
+
if (i = ts(s.timezone), isNaN(i)) return n();
|
|
2870
2875
|
} else {
|
|
2871
|
-
const u = new Date(o +
|
|
2876
|
+
const u = new Date(o + c), d = p(0, e?.in);
|
|
2872
2877
|
return d.setFullYear(
|
|
2873
2878
|
u.getUTCFullYear(),
|
|
2874
2879
|
u.getUTCMonth(),
|
|
@@ -2880,28 +2885,28 @@ function Ur(t, e) {
|
|
|
2880
2885
|
u.getUTCMilliseconds()
|
|
2881
2886
|
), d;
|
|
2882
2887
|
}
|
|
2883
|
-
return
|
|
2888
|
+
return p(o + c + i, e?.in);
|
|
2884
2889
|
}
|
|
2885
|
-
const
|
|
2890
|
+
const B = {
|
|
2886
2891
|
dateTimeDelimiter: /[T ]/,
|
|
2887
2892
|
timeZoneDelimiter: /[Z ]/i,
|
|
2888
2893
|
timezone: /([Z+-].*)$/
|
|
2889
|
-
},
|
|
2890
|
-
function
|
|
2891
|
-
const e = {}, n = t.split(
|
|
2894
|
+
}, Xr = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, jr = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, zr = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
2895
|
+
function Kr(t) {
|
|
2896
|
+
const e = {}, n = t.split(B.dateTimeDelimiter);
|
|
2892
2897
|
let r;
|
|
2893
2898
|
if (n.length > 2)
|
|
2894
2899
|
return e;
|
|
2895
|
-
if (/:/.test(n[0]) ? r = n[0] : (e.date = n[0], r = n[1],
|
|
2900
|
+
if (/:/.test(n[0]) ? r = n[0] : (e.date = n[0], r = n[1], B.timeZoneDelimiter.test(e.date) && (e.date = t.split(B.timeZoneDelimiter)[0], r = t.substr(
|
|
2896
2901
|
e.date.length,
|
|
2897
2902
|
t.length
|
|
2898
2903
|
))), r) {
|
|
2899
|
-
const s =
|
|
2904
|
+
const s = B.timezone.exec(r);
|
|
2900
2905
|
s ? (e.time = r.replace(s[1], ""), e.timezone = s[1]) : e.time = r;
|
|
2901
2906
|
}
|
|
2902
2907
|
return e;
|
|
2903
2908
|
}
|
|
2904
|
-
function
|
|
2909
|
+
function Jr(t, e) {
|
|
2905
2910
|
const n = new RegExp(
|
|
2906
2911
|
"^(?:(\\d{4}|[+-]\\d{" + (4 + e) + "})|(\\d{2}|[+-]\\d{" + (2 + e) + "})$)"
|
|
2907
2912
|
), r = t.match(n);
|
|
@@ -2912,84 +2917,84 @@ function jr(t, e) {
|
|
|
2912
2917
|
restDateString: t.slice((r[1] || r[2]).length)
|
|
2913
2918
|
};
|
|
2914
2919
|
}
|
|
2915
|
-
function
|
|
2920
|
+
function Zr(t, e) {
|
|
2916
2921
|
if (e === null) return /* @__PURE__ */ new Date(NaN);
|
|
2917
|
-
const n = t.match(
|
|
2922
|
+
const n = t.match(Xr);
|
|
2918
2923
|
if (!n) return /* @__PURE__ */ new Date(NaN);
|
|
2919
|
-
const r = !!n[4], s = F(n[1]), a = F(n[2]) - 1, o = F(n[3]),
|
|
2924
|
+
const r = !!n[4], s = F(n[1]), a = F(n[2]) - 1, o = F(n[3]), c = F(n[4]), i = F(n[5]) - 1;
|
|
2920
2925
|
if (r)
|
|
2921
|
-
return
|
|
2926
|
+
return os(e, c, i) ? ns(e, c, i) : /* @__PURE__ */ new Date(NaN);
|
|
2922
2927
|
{
|
|
2923
2928
|
const u = /* @__PURE__ */ new Date(0);
|
|
2924
|
-
return !
|
|
2929
|
+
return !ss(e, a, o) || !as(e, s) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(e, a, Math.max(s, o)), u);
|
|
2925
2930
|
}
|
|
2926
2931
|
}
|
|
2927
2932
|
function F(t) {
|
|
2928
2933
|
return t ? parseInt(t) : 1;
|
|
2929
2934
|
}
|
|
2930
|
-
function
|
|
2931
|
-
const e = t.match(
|
|
2935
|
+
function es(t) {
|
|
2936
|
+
const e = t.match(jr);
|
|
2932
2937
|
if (!e) return NaN;
|
|
2933
|
-
const n =
|
|
2934
|
-
return
|
|
2938
|
+
const n = te(e[1]), r = te(e[2]), s = te(e[3]);
|
|
2939
|
+
return is(n, r, s) ? n * fe + r * le + s * 1e3 : NaN;
|
|
2935
2940
|
}
|
|
2936
|
-
function
|
|
2941
|
+
function te(t) {
|
|
2937
2942
|
return t && parseFloat(t.replace(",", ".")) || 0;
|
|
2938
2943
|
}
|
|
2939
|
-
function
|
|
2944
|
+
function ts(t) {
|
|
2940
2945
|
if (t === "Z") return 0;
|
|
2941
|
-
const e = t.match(
|
|
2946
|
+
const e = t.match(zr);
|
|
2942
2947
|
if (!e) return 0;
|
|
2943
2948
|
const n = e[1] === "+" ? -1 : 1, r = parseInt(e[2]), s = e[3] && parseInt(e[3]) || 0;
|
|
2944
|
-
return
|
|
2949
|
+
return cs(r, s) ? n * (r * fe + s * le) : NaN;
|
|
2945
2950
|
}
|
|
2946
|
-
function
|
|
2951
|
+
function ns(t, e, n) {
|
|
2947
2952
|
const r = /* @__PURE__ */ new Date(0);
|
|
2948
2953
|
r.setUTCFullYear(t, 0, 4);
|
|
2949
2954
|
const s = r.getUTCDay() || 7, a = (e - 1) * 7 + n + 1 - s;
|
|
2950
2955
|
return r.setUTCDate(r.getUTCDate() + a), r;
|
|
2951
2956
|
}
|
|
2952
|
-
const
|
|
2953
|
-
function
|
|
2957
|
+
const rs = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2958
|
+
function bt(t) {
|
|
2954
2959
|
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
2955
2960
|
}
|
|
2956
|
-
function
|
|
2957
|
-
return e >= 0 && e <= 11 && n >= 1 && n <= (
|
|
2961
|
+
function ss(t, e, n) {
|
|
2962
|
+
return e >= 0 && e <= 11 && n >= 1 && n <= (rs[e] || (bt(t) ? 29 : 28));
|
|
2958
2963
|
}
|
|
2959
|
-
function
|
|
2960
|
-
return e >= 1 && e <= (
|
|
2964
|
+
function as(t, e) {
|
|
2965
|
+
return e >= 1 && e <= (bt(t) ? 366 : 365);
|
|
2961
2966
|
}
|
|
2962
|
-
function
|
|
2967
|
+
function os(t, e, n) {
|
|
2963
2968
|
return e >= 1 && e <= 53 && n >= 0 && n <= 6;
|
|
2964
2969
|
}
|
|
2965
|
-
function
|
|
2970
|
+
function is(t, e, n) {
|
|
2966
2971
|
return t === 24 ? e === 0 && n === 0 : n >= 0 && n < 60 && e >= 0 && e < 60 && t >= 0 && t < 25;
|
|
2967
2972
|
}
|
|
2968
|
-
function
|
|
2973
|
+
function cs(t, e) {
|
|
2969
2974
|
return e >= 0 && e <= 59;
|
|
2970
2975
|
}
|
|
2971
2976
|
const V = (t) => {
|
|
2972
2977
|
if (!t.includes("T")) {
|
|
2973
|
-
for (const n of
|
|
2974
|
-
const r =
|
|
2975
|
-
if (
|
|
2978
|
+
for (const n of us) {
|
|
2979
|
+
const r = Br(t, n, /* @__PURE__ */ new Date());
|
|
2980
|
+
if (ne(r))
|
|
2976
2981
|
return r;
|
|
2977
2982
|
}
|
|
2978
2983
|
return null;
|
|
2979
2984
|
}
|
|
2980
|
-
const e =
|
|
2981
|
-
return
|
|
2982
|
-
},
|
|
2985
|
+
const e = Gr(t);
|
|
2986
|
+
return ne(e) ? e : null;
|
|
2987
|
+
}, us = ["yyyy-MM-dd", "MM-dd-yyyy"], ae = (t, e, n) => {
|
|
2983
2988
|
const r = {};
|
|
2984
|
-
return e?.contentType !== null && (r[
|
|
2985
|
-
},
|
|
2989
|
+
return e?.contentType !== null && (r[Vt] = e?.contentType || Bt), e?.jwt ? r.Authorization = `Bearer ${e.jwt}` : t && (r[X] = t), e?.chatReference && (r[Gt] = e.chatReference), { ...r, ...n };
|
|
2990
|
+
}, ds = (t) => {
|
|
2986
2991
|
const e = { ...t };
|
|
2987
|
-
return e[
|
|
2988
|
-
},
|
|
2992
|
+
return e[X] && (e[X] = e[X].substring(0, 8) + "...[REDACTED]"), e.Authorization && (e.Authorization = "Bearer [REDACTED]"), e[j] && (e[j] = e[j].substring(0, 8) + "...[REDACTED]"), e;
|
|
2993
|
+
}, Fe = async (t, e, n) => await fetch(t, {
|
|
2989
2994
|
method: n.method || "GET",
|
|
2990
2995
|
headers: e,
|
|
2991
2996
|
body: n.body ? JSON.stringify(n.body) : void 0
|
|
2992
|
-
}),
|
|
2997
|
+
}), ls = async (t, e, n) => {
|
|
2993
2998
|
const r = n?.body === void 0 ? void 0 : n?.isFormData ? n.body : JSON.stringify(n.body);
|
|
2994
2999
|
return await fetch(t, {
|
|
2995
3000
|
method: n.method,
|
|
@@ -2998,28 +3003,28 @@ const V = (t) => {
|
|
|
2998
3003
|
signal: n?.signal
|
|
2999
3004
|
});
|
|
3000
3005
|
};
|
|
3001
|
-
class
|
|
3006
|
+
class fs {
|
|
3002
3007
|
constructor() {
|
|
3003
3008
|
this.decoder = new TextDecoder();
|
|
3004
3009
|
}
|
|
3005
3010
|
async streamChat(e, n, r = {}, s) {
|
|
3006
|
-
const { onMessage: a, onError: o, onComplete:
|
|
3011
|
+
const { onMessage: a, onError: o, onComplete: c, signal: i } = r;
|
|
3007
3012
|
try {
|
|
3008
3013
|
const u = await this.initializeStreamRequest(
|
|
3009
3014
|
e,
|
|
3010
3015
|
n,
|
|
3011
|
-
|
|
3016
|
+
i,
|
|
3012
3017
|
s
|
|
3013
3018
|
);
|
|
3014
|
-
await this.processStreamData(u, a),
|
|
3019
|
+
await this.processStreamData(u, a), c?.();
|
|
3015
3020
|
} catch (u) {
|
|
3016
3021
|
this.handleStreamError(u, o);
|
|
3017
3022
|
}
|
|
3018
3023
|
}
|
|
3019
3024
|
async initializeStreamRequest(e, n, r, s) {
|
|
3020
|
-
const a =
|
|
3025
|
+
const a = ae(void 0, {
|
|
3021
3026
|
jwt: s
|
|
3022
|
-
}), o = await
|
|
3027
|
+
}), o = await ls(
|
|
3023
3028
|
e,
|
|
3024
3029
|
{
|
|
3025
3030
|
Accept: "text/event-stream",
|
|
@@ -3032,20 +3037,20 @@ class us {
|
|
|
3032
3037
|
}
|
|
3033
3038
|
);
|
|
3034
3039
|
if (!o.ok) {
|
|
3035
|
-
const
|
|
3036
|
-
let
|
|
3040
|
+
const c = await o.text();
|
|
3041
|
+
let i = {};
|
|
3037
3042
|
try {
|
|
3038
|
-
|
|
3043
|
+
i = JSON.parse(c);
|
|
3039
3044
|
} catch {
|
|
3040
|
-
|
|
3045
|
+
i.error = "Failed to parse error body";
|
|
3041
3046
|
}
|
|
3042
|
-
throw new
|
|
3047
|
+
throw new Se({
|
|
3043
3048
|
status: o.status,
|
|
3044
|
-
message:
|
|
3049
|
+
message: i.error ?? "No response body"
|
|
3045
3050
|
});
|
|
3046
3051
|
}
|
|
3047
3052
|
if (!o.body)
|
|
3048
|
-
throw new
|
|
3053
|
+
throw new Se({
|
|
3049
3054
|
message: "No response body",
|
|
3050
3055
|
status: o.status
|
|
3051
3056
|
});
|
|
@@ -3062,11 +3067,11 @@ class us {
|
|
|
3062
3067
|
}
|
|
3063
3068
|
const o = this.decoder.decode(a, { stream: !0 });
|
|
3064
3069
|
r += o;
|
|
3065
|
-
const
|
|
3070
|
+
const c = r.split(`
|
|
3066
3071
|
`);
|
|
3067
|
-
r =
|
|
3068
|
-
for (const
|
|
3069
|
-
this.parseSSEDataLine(
|
|
3072
|
+
r = c.pop() || "";
|
|
3073
|
+
for (const i of c)
|
|
3074
|
+
this.parseSSEDataLine(i, n);
|
|
3070
3075
|
}
|
|
3071
3076
|
} finally {
|
|
3072
3077
|
e.releaseLock();
|
|
@@ -3094,103 +3099,113 @@ class us {
|
|
|
3094
3099
|
}
|
|
3095
3100
|
}
|
|
3096
3101
|
}
|
|
3097
|
-
new
|
|
3098
|
-
class
|
|
3102
|
+
new fs();
|
|
3103
|
+
class Qa {
|
|
3099
3104
|
constructor(e) {
|
|
3100
3105
|
this.config = e, console.info("SdmxApiClient initialized", {
|
|
3101
3106
|
apiUrl: e.apiUrl || "NOT SET"
|
|
3102
3107
|
});
|
|
3103
3108
|
}
|
|
3104
|
-
async getRequest(e, n) {
|
|
3105
|
-
return this.request(
|
|
3109
|
+
async getRequest(e, n, r) {
|
|
3110
|
+
return this.request(
|
|
3111
|
+
e,
|
|
3112
|
+
{ ...n, method: "GET" },
|
|
3113
|
+
void 0,
|
|
3114
|
+
r
|
|
3115
|
+
);
|
|
3106
3116
|
}
|
|
3107
|
-
async postRequest(e, n, r) {
|
|
3108
|
-
return this.request(
|
|
3117
|
+
async postRequest(e, n, r, s) {
|
|
3118
|
+
return this.request(
|
|
3119
|
+
e,
|
|
3120
|
+
{ ...n, method: "POST" },
|
|
3121
|
+
r,
|
|
3122
|
+
s
|
|
3123
|
+
);
|
|
3109
3124
|
}
|
|
3110
|
-
async streamRequest(e, n, r) {
|
|
3111
|
-
const
|
|
3112
|
-
|
|
3113
|
-
jwt: this.config.jwt
|
|
3114
|
-
}),
|
|
3115
|
-
...n.headers
|
|
3116
|
-
};
|
|
3117
|
-
this.config.apiKey != null && (a[j] = this.config.apiKey);
|
|
3118
|
-
const o = new ReadableStream({
|
|
3119
|
-
async start(c) {
|
|
3125
|
+
async streamRequest(e, n, r, s) {
|
|
3126
|
+
const a = `${this.config.apiUrl}/${e}`, o = this.buildHeaders(s, n.headers), c = new ReadableStream({
|
|
3127
|
+
async start(u) {
|
|
3120
3128
|
try {
|
|
3121
|
-
const
|
|
3122
|
-
if (!
|
|
3123
|
-
const
|
|
3129
|
+
const d = await Fe(a, o, n);
|
|
3130
|
+
if (!d.ok) {
|
|
3131
|
+
const P = await d.text();
|
|
3124
3132
|
throw console.error(
|
|
3125
|
-
`Fetch failed! Status: ${
|
|
3126
|
-
), new Error(`Fetch failed with status ${
|
|
3133
|
+
`Fetch failed! Status: ${d.status}, Body: ${P}`
|
|
3134
|
+
), new Error(`Fetch failed with status ${d.status}`);
|
|
3127
3135
|
}
|
|
3128
|
-
const
|
|
3129
|
-
if (!
|
|
3130
|
-
const
|
|
3131
|
-
|
|
3132
|
-
const
|
|
3133
|
-
const { done:
|
|
3134
|
-
|
|
3136
|
+
const l = d.body?.getReader();
|
|
3137
|
+
if (!l) throw new Error("Failed to create stream reader");
|
|
3138
|
+
const m = new Uint8Array([239, 187, 191]);
|
|
3139
|
+
u.enqueue(m);
|
|
3140
|
+
const x = async () => {
|
|
3141
|
+
const { done: P, value: N } = await l.read();
|
|
3142
|
+
P ? u.close() : (u.enqueue(N), await x());
|
|
3135
3143
|
};
|
|
3136
|
-
|
|
3137
|
-
} catch (
|
|
3138
|
-
|
|
3144
|
+
x();
|
|
3145
|
+
} catch (d) {
|
|
3146
|
+
u.error(d);
|
|
3139
3147
|
}
|
|
3140
3148
|
}
|
|
3141
3149
|
}), i = new Headers({
|
|
3142
3150
|
"Content-Disposition": `attachment; filename=${encodeURIComponent(r)}`
|
|
3143
3151
|
});
|
|
3144
|
-
return new Response(
|
|
3145
|
-
}
|
|
3146
|
-
async request(e, n, r) {
|
|
3147
|
-
const
|
|
3148
|
-
|
|
3149
|
-
jwt: this.config.jwt
|
|
3150
|
-
}),
|
|
3151
|
-
...n.headers
|
|
3152
|
-
};
|
|
3153
|
-
this.config.apiKey != null && (o["Ocp-Apim-Subscription-Key"] = this.config.apiKey), this.addInfoRequestLog("API Request", a, n, o);
|
|
3152
|
+
return new Response(c, { headers: i });
|
|
3153
|
+
}
|
|
3154
|
+
async request(e, n, r, s) {
|
|
3155
|
+
const a = Date.now(), o = `${r || this.config.apiUrl}/${e}`, c = this.buildHeaders(s, n.headers);
|
|
3156
|
+
this.addInfoRequestLog("API Request", o, n, c);
|
|
3154
3157
|
try {
|
|
3155
|
-
const i = await
|
|
3156
|
-
let
|
|
3157
|
-
const
|
|
3158
|
+
const i = await Fe(o, c, n), u = Date.now() - a;
|
|
3159
|
+
let d;
|
|
3160
|
+
const l = await i.text();
|
|
3158
3161
|
try {
|
|
3159
|
-
|
|
3162
|
+
d = l ? JSON.parse(l) : {};
|
|
3160
3163
|
} catch {
|
|
3161
3164
|
if (this.addErrorRequestParsing(
|
|
3162
|
-
|
|
3165
|
+
o,
|
|
3163
3166
|
n,
|
|
3164
3167
|
i,
|
|
3165
|
-
|
|
3166
|
-
|
|
3168
|
+
u,
|
|
3169
|
+
l
|
|
3167
3170
|
), !i.ok)
|
|
3168
3171
|
throw new Error(
|
|
3169
|
-
`API request failed: ${i.status} ${i.statusText} - ${
|
|
3172
|
+
`API request failed: ${i.status} ${i.statusText} - ${l.substring(0, 100)}`
|
|
3170
3173
|
);
|
|
3171
|
-
|
|
3174
|
+
d = { data: l };
|
|
3172
3175
|
}
|
|
3173
3176
|
if (!i.ok) {
|
|
3174
|
-
this.addErrorRequestLog(
|
|
3175
|
-
const
|
|
3176
|
-
throw new Error(`API request failed: ${
|
|
3177
|
+
this.addErrorRequestLog(o, n, i, u, d);
|
|
3178
|
+
const m = Qt(d, i);
|
|
3179
|
+
throw new Error(`API request failed: ${m}`);
|
|
3177
3180
|
}
|
|
3178
|
-
return
|
|
3181
|
+
return d;
|
|
3179
3182
|
} catch (i) {
|
|
3180
|
-
const
|
|
3183
|
+
const u = Date.now() - a;
|
|
3181
3184
|
throw console.error("API Request Exception", {
|
|
3182
3185
|
method: n.method,
|
|
3183
|
-
url:
|
|
3184
|
-
duration: `${
|
|
3186
|
+
url: o,
|
|
3187
|
+
duration: `${u}ms`,
|
|
3185
3188
|
error: i instanceof Error ? i.message : String(i)
|
|
3186
3189
|
}), i;
|
|
3187
3190
|
}
|
|
3188
3191
|
}
|
|
3192
|
+
buildHeaders(e, n) {
|
|
3193
|
+
if (this.config.isDialProxyMode)
|
|
3194
|
+
return {
|
|
3195
|
+
...ae(this.config.dialApiKey, { jwt: e }),
|
|
3196
|
+
...n
|
|
3197
|
+
};
|
|
3198
|
+
const r = {
|
|
3199
|
+
...ae(void 0, { jwt: this.config.jwt }),
|
|
3200
|
+
...n
|
|
3201
|
+
};
|
|
3202
|
+
return this.config.apiKey != null && (r[j] = this.config.apiKey), r;
|
|
3203
|
+
}
|
|
3189
3204
|
addInfoRequestLog(e, n, r, s) {
|
|
3190
3205
|
const a = {
|
|
3191
3206
|
method: r.method || "GET",
|
|
3192
3207
|
url: n,
|
|
3193
|
-
headers:
|
|
3208
|
+
headers: ds(s)
|
|
3194
3209
|
};
|
|
3195
3210
|
r.body && (a.body = r.body), console.info(e, a);
|
|
3196
3211
|
}
|
|
@@ -3216,51 +3231,236 @@ class $a {
|
|
|
3216
3231
|
});
|
|
3217
3232
|
}
|
|
3218
3233
|
}
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3234
|
+
var we = /* @__PURE__ */ ((t) => (t.LAST_UPDATE_AT = "lastUpdatedAt", t.SERIES_COUNT = "series_count", t))(we || {});
|
|
3235
|
+
function Ba(t) {
|
|
3236
|
+
return t?.annotations?.find((e) => {
|
|
3237
|
+
if (e.id === we.LAST_UPDATE_AT)
|
|
3238
|
+
return e;
|
|
3239
|
+
})?.value;
|
|
3240
|
+
}
|
|
3241
|
+
const ye = (t, e) => t?.names && t?.names[e] || t?.name, Dt = (t, e, n) => {
|
|
3242
|
+
if (!(!t || e?.has(t?.id)) && (e?.set(t?.id, t), t?.parent)) {
|
|
3243
|
+
const r = n?.get(t?.parent);
|
|
3244
|
+
Dt(r, e, n);
|
|
3245
|
+
}
|
|
3246
|
+
}, ms = (t, e) => {
|
|
3247
|
+
const n = /* @__PURE__ */ new Map(), r = new Map(t?.map((s) => [s.id, s]));
|
|
3248
|
+
return e?.forEach((s) => {
|
|
3249
|
+
Dt(s, n, r);
|
|
3250
|
+
}), Array.from(n?.values());
|
|
3251
|
+
};
|
|
3252
|
+
var hs = /* @__PURE__ */ ((t) => (t.C = "c", t))(hs || {}), k = /* @__PURE__ */ ((t) => (t.EQUALS = "eq", t.NOT_EQUALS = "ne", t.LESS = "lt", t.LESS_OR_EQUAL = "le", t.GREATER = "gt", t.GREATER_OR_EQUAL = "ge", t.CONTAINS = "co", t.NOT_CONTAINS = "nc", t.STARTS = "sw", t.ENDS = "ew", t))(k || {}), gs = /* @__PURE__ */ ((t) => (t.BOOLEAN = "Boolean", t.DATE_TIME = "DateTime", t.DECIMAL = "Decimal", t.INTEGER = "Integer", t.OBSERVATION_TIME_PERIOD = "ObservationalTimePeriod", t.STRING = "String", t.TIME = "Time", t.TIME_RANGE = "TimeRange", t.URI = "URI", t))(gs || {}), ws = /* @__PURE__ */ ((t) => (t.ANNUAL = "A", t.QUARTERLY = "Q", t.MONTHLY = "M", t))(ws || {});
|
|
3253
|
+
const Va = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", ps = "time_period_start", bs = "time_period_end", Ga = (t) => {
|
|
3254
|
+
const e = t?.find(
|
|
3255
|
+
(a) => a.id === ps
|
|
3256
|
+
), n = t?.find(
|
|
3257
|
+
(a) => a.id === bs
|
|
3258
|
+
), r = n?.title ? new Date(n?.title) : null;
|
|
3259
|
+
return {
|
|
3260
|
+
startPeriod: e?.title ? new Date(e?.title) : null,
|
|
3261
|
+
endPeriod: r
|
|
3262
|
+
};
|
|
3263
|
+
}, Ds = (t, e) => t.id.localeCompare(e.id), Ts = (t, e) => t.memberValue.localeCompare(e.memberValue), Es = (t, e) => {
|
|
3264
|
+
const n = new Array(t.length), r = t.map((o, c) => [o, c]);
|
|
3265
|
+
r.sort(
|
|
3266
|
+
(o, c) => Ds(o[0], c[0])
|
|
3267
|
+
);
|
|
3268
|
+
const s = [...e];
|
|
3269
|
+
s.sort(Ts);
|
|
3270
|
+
let a = 0;
|
|
3271
|
+
for (const o of r) {
|
|
3272
|
+
const c = o[0];
|
|
3273
|
+
for (; a < s.length && s[a].memberValue.localeCompare(c.id) < 0; )
|
|
3274
|
+
a += 1;
|
|
3275
|
+
a < s.length && s[a].memberValue === c.id && (n[o[1]] = o[0]);
|
|
3276
|
+
}
|
|
3277
|
+
return n.filter((o) => o != null);
|
|
3278
|
+
}, xs = (t) => !!t?.some((e) => e.parent), Xa = (t, e, n, r, s = []) => {
|
|
3279
|
+
let a = t || [];
|
|
3280
|
+
if (Ps(n || [], e || "")) {
|
|
3281
|
+
const o = (n || [])[0].cubeRegions?.find(
|
|
3282
|
+
({ isIncluded: c }) => c
|
|
3283
|
+
);
|
|
3284
|
+
if (o) {
|
|
3285
|
+
const c = o.memberSelection?.find(
|
|
3286
|
+
({ componentId: i }) => i === e
|
|
3287
|
+
);
|
|
3288
|
+
c ? a = a.length === 0 ? (c.selectionValues || []).map(({ memberValue: i }) => ({
|
|
3289
|
+
id: i,
|
|
3290
|
+
name: i
|
|
3291
|
+
})) : Es(a, c.selectionValues) : a = [];
|
|
3292
|
+
}
|
|
3293
|
+
} else s.length !== 0 && (a = a.filter(({ id: o }) => s.includes(o)));
|
|
3294
|
+
return xs(t) && (a = ms(t, a)), a?.map((o) => ({
|
|
3295
|
+
...o,
|
|
3296
|
+
name: r ? ye(o, r) : o?.name
|
|
3297
|
+
}));
|
|
3298
|
+
}, Ps = (t, e) => t != null && t.length > 0 && e != null, vs = (t) => {
|
|
3299
|
+
const e = [];
|
|
3300
|
+
return t?.filters?.forEach((n) => {
|
|
3301
|
+
n.componentCode !== ys && e.push({
|
|
3302
|
+
componentCode: n.componentCode,
|
|
3303
|
+
operator: k.EQUALS,
|
|
3304
|
+
value: n.values.join(",")
|
|
3305
|
+
});
|
|
3306
|
+
}), e;
|
|
3307
|
+
}, ja = (t) => {
|
|
3308
|
+
const e = /* @__PURE__ */ new Map();
|
|
3309
|
+
return t?.forEach((n) => {
|
|
3310
|
+
e.set(n.urn, vs(n));
|
|
3311
|
+
}), e;
|
|
3312
|
+
}, Ms = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, Qe = (t) => {
|
|
3313
|
+
if (typeof t != "string")
|
|
3314
|
+
throw new TypeError("Invalid argument expected string");
|
|
3315
|
+
const e = t.match(Ms);
|
|
3316
|
+
if (!e)
|
|
3317
|
+
throw new Error(`Invalid argument not valid semver ('${t}' received)`);
|
|
3318
|
+
return e.shift(), e;
|
|
3319
|
+
}, Be = (t) => t === "*" || t === "x" || t === "X", Ve = (t) => {
|
|
3320
|
+
const e = parseInt(t, 10);
|
|
3321
|
+
return isNaN(e) ? t : e;
|
|
3322
|
+
}, Os = (t, e) => typeof t != typeof e ? [String(t), String(e)] : [t, e], As = (t, e) => {
|
|
3323
|
+
if (Be(t) || Be(e))
|
|
3324
|
+
return 0;
|
|
3325
|
+
const [n, r] = Os(Ve(t), Ve(e));
|
|
3326
|
+
return n > r ? 1 : n < r ? -1 : 0;
|
|
3327
|
+
}, Ge = (t, e) => {
|
|
3328
|
+
for (let n = 0; n < Math.max(t.length, e.length); n++) {
|
|
3329
|
+
const r = As(t[n] || "0", e[n] || "0");
|
|
3330
|
+
if (r !== 0)
|
|
3331
|
+
return r;
|
|
3332
|
+
}
|
|
3333
|
+
return 0;
|
|
3334
|
+
}, Ns = (t, e) => {
|
|
3335
|
+
const n = Qe(t), r = Qe(e), s = n.pop(), a = r.pop(), o = Ge(n, r);
|
|
3336
|
+
return o !== 0 ? o : s && a ? Ge(s.split("."), a.split(".")) : s || a ? s ? -1 : 1 : 0;
|
|
3337
|
+
}, Rs = (t, e, n) => {
|
|
3338
|
+
ks(n);
|
|
3339
|
+
const r = Ns(t, e);
|
|
3340
|
+
return Tt[n].includes(r);
|
|
3341
|
+
}, Tt = {
|
|
3342
|
+
">": [1],
|
|
3343
|
+
">=": [0, 1],
|
|
3344
|
+
"=": [0],
|
|
3345
|
+
"<=": [-1, 0],
|
|
3346
|
+
"<": [-1],
|
|
3347
|
+
"!=": [-1, 1]
|
|
3348
|
+
}, Xe = Object.keys(Tt), ks = (t) => {
|
|
3349
|
+
if (Xe.indexOf(t) === -1)
|
|
3350
|
+
throw new Error(`Invalid operator, expected one of ${Xe.join("|")}`);
|
|
3351
|
+
}, oe = "+", pe = (t, e) => {
|
|
3352
|
+
const { agency: n, id: r, version: s } = C(t), a = e.filter(
|
|
3353
|
+
(i) => i.agencyID === n && i.id === r && !i?.version?.includes(oe)
|
|
3354
|
+
);
|
|
3355
|
+
if (a.length === 1)
|
|
3356
|
+
return a[0];
|
|
3357
|
+
if (!s?.includes(oe))
|
|
3358
|
+
return a.find((i) => i.version === s);
|
|
3359
|
+
const o = a.map(
|
|
3360
|
+
(i) => i.version
|
|
3361
|
+
), c = _s(s, o);
|
|
3362
|
+
return a.find(
|
|
3363
|
+
(i) => i.version === c[0]
|
|
3364
|
+
);
|
|
3365
|
+
}, _s = (t, e) => {
|
|
3366
|
+
const n = Is(t, e);
|
|
3367
|
+
return n.length > 0 ? [n[0]] : [];
|
|
3368
|
+
}, Is = (t, e) => {
|
|
3369
|
+
const n = [];
|
|
3370
|
+
return e.forEach((r) => {
|
|
3371
|
+
Cs(t, r) && n.push(r);
|
|
3372
|
+
}), n;
|
|
3373
|
+
}, Ys = (t) => {
|
|
3374
|
+
const e = t.trim(), n = e.indexOf("+");
|
|
3375
|
+
if (n <= 0) return "";
|
|
3376
|
+
let r = n;
|
|
3377
|
+
for (; r > 0 && e[r - 1] >= "0" && e[r - 1] <= "9"; )
|
|
3378
|
+
r--;
|
|
3379
|
+
return r > 0 ? e.slice(0, r) : "";
|
|
3380
|
+
}, Cs = (t, e) => {
|
|
3381
|
+
const n = t.trim().replace(/\+/, ""), r = Ys(t);
|
|
3382
|
+
return e.startsWith(r) && Rs(e, n, ">=");
|
|
3383
|
+
}, be = (t, e) => {
|
|
3384
|
+
const { concept: n } = Ss(t, e);
|
|
3385
|
+
return n;
|
|
3386
|
+
}, Ss = (t, e) => {
|
|
3387
|
+
if (t == null)
|
|
3388
|
+
return {
|
|
3389
|
+
concept: void 0,
|
|
3390
|
+
scheme: void 0
|
|
3391
|
+
};
|
|
3392
|
+
const { childId: n, agency: r, id: s, version: a } = nt(t);
|
|
3393
|
+
if (a?.includes(oe)) {
|
|
3394
|
+
const o = pe(
|
|
3395
|
+
t,
|
|
3396
|
+
e
|
|
3397
|
+
);
|
|
3398
|
+
return {
|
|
3399
|
+
concept: je(o?.concepts || [], n),
|
|
3400
|
+
scheme: o
|
|
3401
|
+
};
|
|
3402
|
+
}
|
|
3403
|
+
for (const o of e)
|
|
3404
|
+
if (Ls(o, s, r, a))
|
|
3405
|
+
return {
|
|
3406
|
+
concept: je(o?.concepts || [], n),
|
|
3407
|
+
scheme: o
|
|
3408
|
+
};
|
|
3409
|
+
return {
|
|
3410
|
+
concept: void 0,
|
|
3411
|
+
scheme: void 0
|
|
3412
|
+
};
|
|
3413
|
+
}, je = (t, e) => t?.find((n) => n.id === e), Ls = (t, e, n, r) => t.id === e && t.agencyID === n && t.version === r, za = (t = [], e = [], n) => {
|
|
3414
|
+
const r = n?.conceptIdentity || "", s = be(r, e), a = z(
|
|
3415
|
+
n?.localRepresentation?.enumeration
|
|
3416
|
+
), o = z(
|
|
3417
|
+
s?.coreRepresentation?.enumeration
|
|
3418
|
+
), c = a || o;
|
|
3419
|
+
if (c != null)
|
|
3420
|
+
return pe(c, t);
|
|
3421
|
+
}, $s = (t, e) => {
|
|
3222
3422
|
const n = t?.data?.dataSets?.[0], s = t?.data?.structures?.[0]?.attributes?.dimensionGroup || [], a = n?.dimensionGroupAttributes, o = {};
|
|
3223
|
-
for (const
|
|
3224
|
-
const
|
|
3423
|
+
for (const c of s) {
|
|
3424
|
+
const i = c.relationship.dimensions, { codedSeriesKey: u, decodedSeriesKey: d } = Et(
|
|
3225
3425
|
t,
|
|
3226
3426
|
e,
|
|
3227
|
-
|
|
3427
|
+
i
|
|
3228
3428
|
);
|
|
3229
|
-
o[
|
|
3429
|
+
o[c.id] = {
|
|
3230
3430
|
values: a?.[u] || [],
|
|
3231
3431
|
decodedSeriesKey: d,
|
|
3232
3432
|
codedSeriesKey: u
|
|
3233
3433
|
};
|
|
3234
3434
|
}
|
|
3235
3435
|
return o;
|
|
3236
|
-
},
|
|
3436
|
+
}, Et = (t, e, n) => {
|
|
3237
3437
|
const r = t?.data?.structures?.[0], s = [
|
|
3238
3438
|
...r?.dimensions.series || [],
|
|
3239
3439
|
...r?.dimensions.observation || []
|
|
3240
3440
|
], a = new Array(s?.length), o = new Array(s?.length);
|
|
3241
|
-
return n?.forEach((
|
|
3242
|
-
const
|
|
3441
|
+
return n?.forEach((c) => {
|
|
3442
|
+
const i = s?.findIndex((l) => l.id === c) || 0, u = e[i], d = s[i].values.findIndex(
|
|
3243
3443
|
(l) => l.id === u || l.value === u
|
|
3244
3444
|
) || 0;
|
|
3245
|
-
a[
|
|
3445
|
+
a[i] = d >= 0 ? d : u, o[i] = u;
|
|
3246
3446
|
}), {
|
|
3247
3447
|
codedSeriesKey: a.join(":"),
|
|
3248
3448
|
decodedSeriesKey: o.join(":")
|
|
3249
3449
|
};
|
|
3250
|
-
},
|
|
3450
|
+
}, Ka = (t, e, n) => {
|
|
3251
3451
|
const r = t?.data?.dataSets?.[0], s = t?.data?.structures?.[0], a = (s?.attributes?.dimensionGroup || []).filter(
|
|
3252
3452
|
(l) => l.relationship.dimensions?.length === 1 && l.relationship.dimensions.includes(e || "")
|
|
3253
|
-
), o = r?.dimensionGroupAttributes,
|
|
3453
|
+
), o = r?.dimensionGroupAttributes, c = [
|
|
3254
3454
|
...s?.dimensions.series || [],
|
|
3255
3455
|
...s?.dimensions.observation || []
|
|
3256
|
-
],
|
|
3257
|
-
u[
|
|
3456
|
+
], i = c?.findIndex((l) => l.id === e), u = new Array(c?.length);
|
|
3457
|
+
u[i] = n || "";
|
|
3258
3458
|
const d = {};
|
|
3259
3459
|
for (const l of a) {
|
|
3260
|
-
const
|
|
3460
|
+
const m = l.relationship.dimensions, { codedSeriesKey: x, decodedSeriesKey: P } = Et(
|
|
3261
3461
|
t,
|
|
3262
3462
|
u,
|
|
3263
|
-
|
|
3463
|
+
m
|
|
3264
3464
|
);
|
|
3265
3465
|
d[l.id] = {
|
|
3266
3466
|
values: o?.[x] || [],
|
|
@@ -3269,193 +3469,329 @@ const ws = (t, e) => {
|
|
|
3269
3469
|
};
|
|
3270
3470
|
}
|
|
3271
3471
|
return d;
|
|
3272
|
-
},
|
|
3472
|
+
}, Ws = (t, e) => {
|
|
3273
3473
|
if (e == null)
|
|
3274
3474
|
return;
|
|
3275
3475
|
const n = t.values?.[e];
|
|
3276
3476
|
return n ?? (e instanceof Array ? { values: e } : { value: e.toString() });
|
|
3277
|
-
},
|
|
3278
|
-
const
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
parsedTimeSeriesValue: g,
|
|
3291
|
-
values: d,
|
|
3292
|
-
attributes: [],
|
|
3293
|
-
dataSetAttrs: []
|
|
3294
|
-
});
|
|
3295
|
-
continue;
|
|
3296
|
-
}
|
|
3297
|
-
d.push(
|
|
3298
|
-
...Es(x, n)
|
|
3477
|
+
}, Ja = (t, e, n, r) => {
|
|
3478
|
+
const s = e?.find(
|
|
3479
|
+
(a) => a?.id === t?.id
|
|
3480
|
+
)?.values;
|
|
3481
|
+
return n?.filter((a) => s?.some((o) => o.id === a.id))?.map((a) => ({
|
|
3482
|
+
...a,
|
|
3483
|
+
name: r ? ye(a, r) : a?.name
|
|
3484
|
+
})) || [];
|
|
3485
|
+
}, qs = (t, e) => {
|
|
3486
|
+
const n = e?.dataStructureComponents?.attributeList, r = t?.metadataStructureComponents?.metadataAttributeList;
|
|
3487
|
+
return n?.metadataAttributeUsages?.map((s) => {
|
|
3488
|
+
const a = r?.metadataAttributes?.find(
|
|
3489
|
+
(o) => o?.id === s?.metadataAttributeReference
|
|
3299
3490
|
);
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3491
|
+
return {
|
|
3492
|
+
...a,
|
|
3493
|
+
attributeRelationship: s.attributeRelationship,
|
|
3494
|
+
isMandatory: Number(a?.minOccurs) > 0
|
|
3495
|
+
};
|
|
3496
|
+
});
|
|
3497
|
+
}, Za = (t = [], e, n) => {
|
|
3498
|
+
const r = z(e?.conceptIdentity) || "", s = be(r, t);
|
|
3499
|
+
return n ? ye(s, n) : s?.name ?? s?.id ?? e?.id;
|
|
3500
|
+
};
|
|
3501
|
+
var Us = /* @__PURE__ */ ((t) => (t.CONDITIONAL = "Conditional", t.MANDATORY = "Mandatory", t))(Us || {}), De = /* @__PURE__ */ ((t) => (t.DIMENSION = "Dimension", t.MEASURE_DIMENSION = "MeasureDimension", t.TIME_DIMENSION = "TimeDimension", t))(De || {}), Hs = /* @__PURE__ */ ((t) => (t.UNBOUNDED = "unbounded", t))(Hs || {});
|
|
3502
|
+
function ze(t) {
|
|
3503
|
+
return t?.dataStructures?.[0]?.dataStructureComponents?.dimensionList;
|
|
3504
|
+
}
|
|
3505
|
+
function eo(t) {
|
|
3506
|
+
return t?.data?.structures?.[0]?.dimensions?.series || [];
|
|
3507
|
+
}
|
|
3508
|
+
function to(t) {
|
|
3509
|
+
return t?.data?.structures?.[0]?.dimensions?.observation?.[0].values.map((e) => e.value ? e.value : e.id).filter((e) => e != null) || [];
|
|
3510
|
+
}
|
|
3511
|
+
function no(t) {
|
|
3512
|
+
return t.find(
|
|
3513
|
+
(e) => e.type === De.TIME_DIMENSION
|
|
3514
|
+
);
|
|
3515
|
+
}
|
|
3516
|
+
const ro = (t) => {
|
|
3517
|
+
const e = /* @__PURE__ */ new Map(), n = t?.dataStructures?.[0], r = t?.metadataStructures?.[0], s = t?.conceptSchemes || [], a = t?.codelists || [];
|
|
3518
|
+
return t && [
|
|
3519
|
+
...ze(t)?.dimensions || [],
|
|
3520
|
+
...ze(t)?.timeDimensions || [],
|
|
3521
|
+
...qs(r, n),
|
|
3522
|
+
...n?.dataStructureComponents?.attributeList?.attributes || []
|
|
3523
|
+
].forEach(
|
|
3524
|
+
(c) => {
|
|
3525
|
+
const i = be(
|
|
3526
|
+
c?.conceptIdentity,
|
|
3527
|
+
s
|
|
3528
|
+
), u = c?.localRepresentation?.enumeration || i?.coreRepresentation?.enumeration, d = pe(
|
|
3529
|
+
u,
|
|
3530
|
+
a
|
|
3313
3531
|
);
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
}
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
values: d,
|
|
3324
|
-
attributes: Y,
|
|
3325
|
-
dataSetAttrs: f,
|
|
3326
|
-
dimensionGroupAttributes: M
|
|
3327
|
-
});
|
|
3328
|
-
}
|
|
3329
|
-
return c;
|
|
3330
|
-
}, ys = (t, e) => {
|
|
3331
|
-
const n = t.split(new RegExp("(?<!\\|):(?!\\||$)")), r = [];
|
|
3332
|
-
for (let s = 0; s < n.length; s++) {
|
|
3333
|
-
const a = e?.[s], o = Number(n[s]);
|
|
3334
|
-
if (o < 0 || a == null)
|
|
3335
|
-
continue;
|
|
3336
|
-
const i = a.values[o];
|
|
3337
|
-
if (i == null) {
|
|
3338
|
-
r.push(n[s].replace("|:", ":"));
|
|
3339
|
-
continue;
|
|
3532
|
+
c?.id && (u ? e.set(c?.id, {
|
|
3533
|
+
...d,
|
|
3534
|
+
name: i?.name,
|
|
3535
|
+
names: i?.names
|
|
3536
|
+
}) : e.set(c?.id, {
|
|
3537
|
+
id: c?.id,
|
|
3538
|
+
name: i?.name,
|
|
3539
|
+
names: i?.names
|
|
3540
|
+
}));
|
|
3340
3541
|
}
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3542
|
+
), e;
|
|
3543
|
+
}, so = (t) => t?.find(
|
|
3544
|
+
(e) => e.id === we.SERIES_COUNT
|
|
3545
|
+
)?.title || "", Te = 1440 * 60 * 1e3, Ee = 7 * Te;
|
|
3546
|
+
function xe(t) {
|
|
3547
|
+
const e = `${t}-01-01`, n = new Date(e);
|
|
3548
|
+
if (n.getDay() !== 4) {
|
|
3549
|
+
const s = 1 + (4 - n.getDay() + 7) % 7;
|
|
3550
|
+
n.setMonth(0, s);
|
|
3551
|
+
}
|
|
3552
|
+
return n;
|
|
3553
|
+
}
|
|
3554
|
+
function Fs(t) {
|
|
3555
|
+
const e = new Date(t), r = -((e.getDay() + 6) % 7) + 3;
|
|
3556
|
+
return e.setDate(e.getDate() + r), new Date(e.valueOf());
|
|
3557
|
+
}
|
|
3558
|
+
function Ke(t, e = "W") {
|
|
3559
|
+
const n = `${t}-12-31`, r = Z(new Date(n), e);
|
|
3560
|
+
if (r.weekYear === t)
|
|
3561
|
+
return r.weekNumber;
|
|
3562
|
+
const s = `${t}-12-24`;
|
|
3563
|
+
return Z(new Date(s), e).weekNumber;
|
|
3564
|
+
}
|
|
3565
|
+
function xt(t, e, n = "W") {
|
|
3566
|
+
return `${t}-${n}${e < 10 ? "0" + e : e}`;
|
|
3567
|
+
}
|
|
3568
|
+
function Z(t, e = "W") {
|
|
3569
|
+
const n = Fs(t), r = n.getFullYear(), s = xe(r), a = 1 + Math.ceil(
|
|
3570
|
+
(n.getTime() - s.getTime()) / Ee
|
|
3571
|
+
);
|
|
3572
|
+
return {
|
|
3573
|
+
code: xt(r, a, e),
|
|
3574
|
+
weekNumber: a,
|
|
3575
|
+
weekYear: r
|
|
3576
|
+
};
|
|
3577
|
+
}
|
|
3578
|
+
function Qs(t) {
|
|
3579
|
+
const [e, n] = t.split("-W"), s = xe(+e).getTime() + (+n - 1) * Ee - 3 * Te;
|
|
3580
|
+
return new Date(s);
|
|
3581
|
+
}
|
|
3582
|
+
function Bs(t) {
|
|
3583
|
+
const [e, n] = t.split("-W"), s = xe(+e).getTime() + (+n - 1) * Ee + 3 * Te;
|
|
3584
|
+
return new Date(s);
|
|
3585
|
+
}
|
|
3586
|
+
const Vs = "/api/download", Gs = 6e4, ao = async (t, e, n, r, s, a, o) => {
|
|
3587
|
+
const c = new URLSearchParams({
|
|
3588
|
+
urn: t,
|
|
3589
|
+
format: e,
|
|
3590
|
+
compress: "false",
|
|
3591
|
+
filename: a,
|
|
3592
|
+
filters: JSON.stringify(s),
|
|
3593
|
+
attribute: r,
|
|
3594
|
+
language: n,
|
|
3595
|
+
isMetadata: o ? "true" : "none"
|
|
3596
|
+
}).toString(), i = `${Vs}?${c}`, u = await fetch(i, {
|
|
3597
|
+
method: "GET",
|
|
3598
|
+
credentials: "same-origin"
|
|
3599
|
+
});
|
|
3600
|
+
if (!u.ok) {
|
|
3601
|
+
const x = await u.text();
|
|
3602
|
+
throw new Error(
|
|
3603
|
+
`Download request failed: ${u.status} ${u.statusText}${x ? ` - ${x}` : ""}`
|
|
3604
|
+
);
|
|
3605
|
+
}
|
|
3606
|
+
const d = await u.blob(), l = URL.createObjectURL(d), m = document.createElement("a");
|
|
3607
|
+
m.href = l, m.download = a, m.style.display = "none", document.body.appendChild(m), m.click(), document.body.removeChild(m), window.setTimeout(
|
|
3608
|
+
() => URL.revokeObjectURL(l),
|
|
3609
|
+
Gs
|
|
3610
|
+
);
|
|
3611
|
+
}, oo = (t, e) => {
|
|
3612
|
+
const n = [];
|
|
3613
|
+
for (const r of t) {
|
|
3614
|
+
if (r.type !== De.DIMENSION)
|
|
3615
|
+
continue;
|
|
3616
|
+
const s = e.find((a) => a.componentCode === r.id);
|
|
3617
|
+
s != null && s.values?.length > 0 ? n.push(s.values?.join(Ut)) : n.push("*");
|
|
3618
|
+
}
|
|
3619
|
+
return n.join(".");
|
|
3620
|
+
}, Xs = (t, e) => {
|
|
3621
|
+
if (!t || !t.startPeriod && !t.endPeriod)
|
|
3622
|
+
return null;
|
|
3623
|
+
const n = [], { startPeriod: r, endPeriod: s } = t;
|
|
3624
|
+
if (r && n.push(
|
|
3625
|
+
`${k.GREATER_OR_EQUAL}${Ie}${Je(r)}`
|
|
3626
|
+
), s && n.push(
|
|
3627
|
+
`${k.LESS_OR_EQUAL}${Ie}${Je(s)}`
|
|
3628
|
+
), n.length === 0)
|
|
3629
|
+
return null;
|
|
3630
|
+
const a = e;
|
|
3631
|
+
return n.map(
|
|
3632
|
+
(o) => `${encodeURIComponent(`c[${a}]`)}${qt}${encodeURIComponent(o)}`
|
|
3633
|
+
).join(at);
|
|
3634
|
+
}, Je = (t) => Gn(t, "yyyy-MM-dd"), io = (t, e) => {
|
|
3635
|
+
const n = js(t, e) || null;
|
|
3636
|
+
return n ? Xs(n, e?.id) : null;
|
|
3637
|
+
}, js = (t, e) => {
|
|
3638
|
+
const n = e.id, r = t?.filters?.find(
|
|
3639
|
+
(i) => i.componentCode === n
|
|
3640
|
+
);
|
|
3641
|
+
if (!r || !r.values)
|
|
3642
|
+
return null;
|
|
3643
|
+
const s = r.values?.filter((i) => !!i);
|
|
3644
|
+
if (!s.length)
|
|
3645
|
+
return null;
|
|
3646
|
+
const a = r.operator;
|
|
3647
|
+
if (a === k.LESS_OR_EQUAL || a === k.LESS)
|
|
3648
|
+
return { startPeriod: null, endPeriod: V(s[0]) };
|
|
3649
|
+
if (a === k.GREATER_OR_EQUAL || a === k.GREATER)
|
|
3650
|
+
return { startPeriod: V(s[0]), endPeriod: null };
|
|
3651
|
+
const o = V(s[0]), c = V(s[1]);
|
|
3652
|
+
return { startPeriod: o, endPeriod: c };
|
|
3653
|
+
}, zs = "Observation", co = (t) => {
|
|
3654
|
+
const e = t?.data?.dataSets, n = t?.data?.structures?.[0];
|
|
3655
|
+
if (!e || !n)
|
|
3656
|
+
return [];
|
|
3657
|
+
const r = n.attributes, s = n.dimensions, a = r?.dimensionGroup || [], o = e[0].series || e[0].observations, c = s.series?.length ? s.series : s.observation, i = [];
|
|
3658
|
+
for (const u in o) {
|
|
3659
|
+
const d = [], { name: l, parsedTimeSeriesValue: m } = Ks(
|
|
3660
|
+
u,
|
|
3661
|
+
c
|
|
3662
|
+
), x = o[u], P = x.attributes || [];
|
|
3663
|
+
if (Object.keys(x).length === 0) {
|
|
3664
|
+
i.push({
|
|
3665
|
+
name: l,
|
|
3666
|
+
parsedTimeSeriesValue: m,
|
|
3667
|
+
values: d,
|
|
3668
|
+
attributes: [],
|
|
3669
|
+
dataSetAttrs: []
|
|
3670
|
+
});
|
|
3671
|
+
continue;
|
|
3672
|
+
}
|
|
3673
|
+
d.push(
|
|
3674
|
+
...ta(x, n)
|
|
3675
|
+
);
|
|
3676
|
+
const N = ie(
|
|
3677
|
+
r?.series || [],
|
|
3678
|
+
(M) => P[M]
|
|
3679
|
+
), f = na(
|
|
3680
|
+
n.attributes?.dataSet || [],
|
|
3681
|
+
e[0].attributes?.filter((M) => M != null) || []
|
|
3682
|
+
), w = $s(
|
|
3683
|
+
t,
|
|
3684
|
+
m
|
|
3685
|
+
), v = a.map((M, W) => {
|
|
3686
|
+
const q = w[M.id], Q = Ws(
|
|
3687
|
+
M,
|
|
3688
|
+
q.values[W]
|
|
3689
|
+
);
|
|
3690
|
+
return {
|
|
3691
|
+
attribute: M,
|
|
3692
|
+
dimensionGroupValue: Q,
|
|
3693
|
+
dimensionGroupData: q
|
|
3694
|
+
};
|
|
3695
|
+
});
|
|
3696
|
+
i.push({
|
|
3697
|
+
name: l,
|
|
3698
|
+
parsedTimeSeriesValue: m,
|
|
3699
|
+
values: d,
|
|
3700
|
+
attributes: N,
|
|
3701
|
+
dataSetAttrs: f,
|
|
3702
|
+
dimensionGroupAttributes: v
|
|
3703
|
+
});
|
|
3704
|
+
}
|
|
3705
|
+
return i;
|
|
3706
|
+
}, Ks = (t, e) => {
|
|
3707
|
+
const n = t.split(new RegExp("(?<!\\|):(?!\\||$)")), r = [];
|
|
3708
|
+
for (let s = 0; s < n.length; s++) {
|
|
3709
|
+
const a = e?.[s], o = Number(n[s]);
|
|
3710
|
+
if (o < 0 || a == null)
|
|
3711
|
+
continue;
|
|
3712
|
+
const c = a.values[o];
|
|
3713
|
+
if (c == null) {
|
|
3714
|
+
r.push(n[s].replace("|:", ":"));
|
|
3715
|
+
continue;
|
|
3716
|
+
}
|
|
3717
|
+
r.push(c?.id || c?.value || "");
|
|
3718
|
+
}
|
|
3719
|
+
return {
|
|
3720
|
+
name: Zs(r),
|
|
3721
|
+
parsedTimeSeriesValue: r
|
|
3346
3722
|
};
|
|
3347
3723
|
}, ie = (t, e) => {
|
|
3348
3724
|
const n = [];
|
|
3349
3725
|
for (let r = 0; r < t.length; r++) {
|
|
3350
|
-
const s = t[r], a = e(r), o = a != null && s.values != null ?
|
|
3726
|
+
const s = t[r], a = e(r), o = a != null && s.values != null ? Js(a, s) : void 0;
|
|
3351
3727
|
n.push({
|
|
3352
3728
|
name: s.id,
|
|
3353
3729
|
value: o
|
|
3354
3730
|
});
|
|
3355
3731
|
}
|
|
3356
3732
|
return n;
|
|
3357
|
-
},
|
|
3733
|
+
}, Js = (t, e) => {
|
|
3358
3734
|
const n = e.values[t];
|
|
3359
3735
|
return n == null ? typeof t == "object" ? t : t.toString() : n?.id || n?.value || n?.ids || n?.values;
|
|
3360
|
-
},
|
|
3736
|
+
}, Zs = (t) => t.map((e) => e ? ea(e) : "").join("."), ea = (t) => t.replace(/\./g, "|.").replace(/:/g, "|:"), ta = (t, e) => {
|
|
3361
3737
|
const n = e.measures?.observation?.length;
|
|
3362
3738
|
if (t.observations == null)
|
|
3363
3739
|
return [
|
|
3364
3740
|
{
|
|
3365
|
-
values:
|
|
3741
|
+
values: Ze(t, e.measures),
|
|
3366
3742
|
obsAttributes: ie(
|
|
3367
3743
|
e.attributes?.observation || [],
|
|
3368
3744
|
(o) => t[o + n]
|
|
3369
3745
|
),
|
|
3370
|
-
dimensionAtObservation:
|
|
3746
|
+
dimensionAtObservation: zs
|
|
3371
3747
|
}
|
|
3372
3748
|
];
|
|
3373
3749
|
const r = t.observations, s = e.dimensions.observation?.[0], a = [];
|
|
3374
3750
|
for (const o in r) {
|
|
3375
|
-
const
|
|
3751
|
+
const c = s?.values[o];
|
|
3376
3752
|
a.push({
|
|
3377
|
-
dimensionAtObservation:
|
|
3378
|
-
values:
|
|
3753
|
+
dimensionAtObservation: c?.value || c?.id,
|
|
3754
|
+
values: Ze(
|
|
3379
3755
|
r[o],
|
|
3380
3756
|
e.measures
|
|
3381
3757
|
),
|
|
3382
3758
|
obsAttributes: ie(
|
|
3383
3759
|
e.attributes?.observation || [],
|
|
3384
|
-
(
|
|
3760
|
+
(i) => r[o][i + n]
|
|
3385
3761
|
)
|
|
3386
3762
|
});
|
|
3387
3763
|
}
|
|
3388
3764
|
return a;
|
|
3389
|
-
},
|
|
3765
|
+
}, Ze = (t, e) => e?.observation?.map((n, r) => ({ name: n.id, value: t[r] })) || [], na = (t, e) => t.reduce(
|
|
3390
3766
|
(n, r, s) => {
|
|
3391
3767
|
const a = e[s];
|
|
3392
|
-
return
|
|
3768
|
+
return ra(n, r, a, ""), n;
|
|
3393
3769
|
},
|
|
3394
3770
|
[]
|
|
3395
|
-
),
|
|
3771
|
+
), ra = (t, e, n, r) => {
|
|
3396
3772
|
const s = n != null ? e?.values?.length > 0 ? e.values[n]?.id || e.values[n]?.value : String(n) : r;
|
|
3397
3773
|
t.push({
|
|
3398
3774
|
name: e.id,
|
|
3399
3775
|
value: s || ""
|
|
3400
3776
|
});
|
|
3401
|
-
},
|
|
3402
|
-
function
|
|
3403
|
-
|
|
3404
|
-
if (n.getDay() !== 4) {
|
|
3405
|
-
const s = 1 + (4 - n.getDay() + 7) % 7;
|
|
3406
|
-
n.setMonth(0, s);
|
|
3407
|
-
}
|
|
3408
|
-
return n;
|
|
3409
|
-
}
|
|
3410
|
-
function Cs(t) {
|
|
3411
|
-
const e = new Date(t), r = -((e.getDay() + 6) % 7) + 3;
|
|
3412
|
-
return e.setDate(e.getDate() + r), new Date(e.valueOf());
|
|
3413
|
-
}
|
|
3414
|
-
function Fe(t, e = "W") {
|
|
3415
|
-
const n = `${t}-12-31`, r = Z(new Date(n), e);
|
|
3416
|
-
if (r.weekYear === t)
|
|
3417
|
-
return r.weekNumber;
|
|
3418
|
-
const s = `${t}-12-24`;
|
|
3419
|
-
return Z(new Date(s), e).weekNumber;
|
|
3420
|
-
}
|
|
3421
|
-
function pt(t, e, n = "W") {
|
|
3422
|
-
return `${t}-${n}${e < 10 ? "0" + e : e}`;
|
|
3423
|
-
}
|
|
3424
|
-
function Z(t, e = "W") {
|
|
3425
|
-
const n = Cs(t), r = n.getFullYear(), s = ve(r), a = 1 + Math.ceil(
|
|
3426
|
-
(n.getTime() - s.getTime()) / Me
|
|
3427
|
-
);
|
|
3428
|
-
return {
|
|
3429
|
-
code: pt(r, a, e),
|
|
3430
|
-
weekNumber: a,
|
|
3431
|
-
weekYear: r
|
|
3432
|
-
};
|
|
3777
|
+
}, sa = /^[0-9][0-9][0-9][0-9]-Q[1-4]$/, aa = /^[0-9][0-9][0-9][0-9]-W(0[1-9]|[1-4][0-9]|5[0-3])$/, oa = /^[0-9][0-9][0-9][0-9]-S[1-2]$/, ia = /^[0-9][0-9][0-9][0-9]$/, ca = /^[0-9][0-9][0-9][0-9]-(0[1-9]|1[0-2])-[0-9][0-9]$/, ua = /^[0-9][0-9][0-9][0-9]-M(0[1-9]|(1[0-2]))$/, Pe = (t) => ia.exec(t), ve = (t) => !!Pe(t), da = (t) => oa.exec(t), Me = (t) => !!da(t), Oe = (t) => ua.exec(t), Ae = (t) => !!Oe(t), Ne = (t) => sa.exec(t), Re = (t) => !!Ne(t), la = (t) => ca.exec(t), fa = (t) => !!la(t), ma = (t) => aa.exec(t), ke = (t) => !!ma(t);
|
|
3778
|
+
function Pt(t) {
|
|
3779
|
+
return ve(t) ? ha(t) : Me(t) ? wa(t) : Re(t) ? pa(t) : Ae(t) ? Da(t) : ke(t) ? Qs(t) : Ea(t);
|
|
3433
3780
|
}
|
|
3434
|
-
function
|
|
3435
|
-
|
|
3436
|
-
return new Date(s);
|
|
3437
|
-
}
|
|
3438
|
-
function Ss(t) {
|
|
3439
|
-
const [e, n] = t.split("-W"), s = ve(+e).getTime() + (+n - 1) * Me + 3 * Pe;
|
|
3440
|
-
return new Date(s);
|
|
3441
|
-
}
|
|
3442
|
-
function yt(t) {
|
|
3443
|
-
return pe(t) ? Ws(t) : ye(t) ? qs(t) : Ee(t) ? Fs(t) : De(t) ? Us(t) : xe(t) ? Ls(t) : Gs(t);
|
|
3444
|
-
}
|
|
3445
|
-
function bt(t) {
|
|
3446
|
-
return pe(t) ? $s(t) : ye(t) ? Qs(t) : Ee(t) ? Hs(t) : De(t) ? Bs(t) : xe(t) ? Ss(t) : Vs(t);
|
|
3781
|
+
function vt(t) {
|
|
3782
|
+
return ve(t) ? ga(t) : Me(t) ? ya(t) : Re(t) ? ba(t) : Ae(t) ? Ta(t) : ke(t) ? Bs(t) : xa(t);
|
|
3447
3783
|
}
|
|
3448
|
-
function
|
|
3449
|
-
const e =
|
|
3784
|
+
function ha(t) {
|
|
3785
|
+
const e = Pe(t);
|
|
3450
3786
|
if (e)
|
|
3451
3787
|
return new Date(Number(e[0]), 0, 1);
|
|
3452
3788
|
}
|
|
3453
|
-
function
|
|
3454
|
-
const e =
|
|
3789
|
+
function ga(t) {
|
|
3790
|
+
const e = Pe(t);
|
|
3455
3791
|
if (e)
|
|
3456
3792
|
return new Date(Number(e[0]) + 1, 0, 1);
|
|
3457
3793
|
}
|
|
3458
|
-
function
|
|
3794
|
+
function wa(t) {
|
|
3459
3795
|
const [e, n] = t.split("-S");
|
|
3460
3796
|
switch (+n) {
|
|
3461
3797
|
case 1:
|
|
@@ -3464,7 +3800,7 @@ function qs(t) {
|
|
|
3464
3800
|
return new Date(+e, 6, 1);
|
|
3465
3801
|
}
|
|
3466
3802
|
}
|
|
3467
|
-
function
|
|
3803
|
+
function ya(t) {
|
|
3468
3804
|
const [e, n] = t.split("-S");
|
|
3469
3805
|
switch (+n) {
|
|
3470
3806
|
case 1:
|
|
@@ -3473,8 +3809,8 @@ function Qs(t) {
|
|
|
3473
3809
|
return new Date(+e + 1, 0, 1);
|
|
3474
3810
|
}
|
|
3475
3811
|
}
|
|
3476
|
-
function
|
|
3477
|
-
const e =
|
|
3812
|
+
function pa(t) {
|
|
3813
|
+
const e = Ne(t);
|
|
3478
3814
|
if (!e)
|
|
3479
3815
|
return;
|
|
3480
3816
|
const [n, r] = e[0].split("-Q");
|
|
@@ -3489,8 +3825,8 @@ function Fs(t) {
|
|
|
3489
3825
|
return new Date(+n, 9, 1);
|
|
3490
3826
|
}
|
|
3491
3827
|
}
|
|
3492
|
-
function
|
|
3493
|
-
const e =
|
|
3828
|
+
function ba(t) {
|
|
3829
|
+
const e = Ne(t);
|
|
3494
3830
|
if (!e)
|
|
3495
3831
|
return;
|
|
3496
3832
|
const [n, r] = e[0].split("-Q");
|
|
@@ -3505,45 +3841,45 @@ function Hs(t) {
|
|
|
3505
3841
|
return new Date(+n + 1, 0, 1);
|
|
3506
3842
|
}
|
|
3507
3843
|
}
|
|
3508
|
-
function
|
|
3509
|
-
const e =
|
|
3844
|
+
function Da(t) {
|
|
3845
|
+
const e = Oe(t);
|
|
3510
3846
|
if (!e)
|
|
3511
3847
|
return;
|
|
3512
3848
|
const [n, r] = e[0].split("-M");
|
|
3513
3849
|
return new Date(+n, +r - 1, 1);
|
|
3514
3850
|
}
|
|
3515
|
-
function
|
|
3516
|
-
const e =
|
|
3851
|
+
function Ta(t) {
|
|
3852
|
+
const e = Oe(t);
|
|
3517
3853
|
if (!e)
|
|
3518
3854
|
return;
|
|
3519
3855
|
const [n, r] = e[0].split("-M");
|
|
3520
3856
|
return new Date(+n, +r, 1);
|
|
3521
3857
|
}
|
|
3522
|
-
const
|
|
3858
|
+
const Ea = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), xa = (t) => {
|
|
3523
3859
|
const e = /* @__PURE__ */ new Date(`${t}T23:59:00`);
|
|
3524
3860
|
return e.setMinutes(e.getMinutes() + 1), e;
|
|
3525
|
-
},
|
|
3526
|
-
const a = [], o = e && e > 3 ?
|
|
3527
|
-
for (let
|
|
3528
|
-
a.push(`${t}-${s}${
|
|
3861
|
+
}, Pa = 1, va = (t, e, n, r = !0, s = "Q") => {
|
|
3862
|
+
const a = [], o = e && e > 3 ? _a(e, r) : 1, c = n ? Math.floor((n - 1) / 3) : 4;
|
|
3863
|
+
for (let i = o; i <= c; i++)
|
|
3864
|
+
a.push(`${t}-${s}${i}`);
|
|
3529
3865
|
return a;
|
|
3530
|
-
},
|
|
3866
|
+
}, Ma = (t, e, n, r = "S") => {
|
|
3531
3867
|
const s = [];
|
|
3532
3868
|
return (e || 1) < 7 && (n || 12) > 6 && s.push(`${t}-${r}1`), n == null && s.push(`${t}-${r}2`), s;
|
|
3533
|
-
},
|
|
3869
|
+
}, uo = (t) => Math.ceil(t / 3), Mt = (t, e, n = "M") => `${t}-${n}${e.toString().padStart(2, "0")}`, Oa = (t, e, n = "M") => {
|
|
3534
3870
|
const r = [];
|
|
3535
3871
|
for (let s = e; s <= 12; s++)
|
|
3536
|
-
r.push(
|
|
3872
|
+
r.push(Mt(t, s, n));
|
|
3537
3873
|
return r;
|
|
3538
|
-
},
|
|
3874
|
+
}, Aa = (t, e, n, r = "M") => {
|
|
3539
3875
|
const s = [];
|
|
3540
3876
|
for (let a = e; a < n; a++)
|
|
3541
|
-
s.push(
|
|
3877
|
+
s.push(Mt(t, a, r));
|
|
3542
3878
|
return s;
|
|
3543
|
-
},
|
|
3879
|
+
}, Na = (t, e, n, r = "M") => {
|
|
3544
3880
|
const s = e || 1, a = n == null, o = n || 12;
|
|
3545
|
-
return a ?
|
|
3546
|
-
},
|
|
3881
|
+
return a ? Oa(t, s, r) : Aa(t, s, o, r);
|
|
3882
|
+
}, lo = (t, e, n = "M") => {
|
|
3547
3883
|
switch (e) {
|
|
3548
3884
|
case 0:
|
|
3549
3885
|
return [
|
|
@@ -3572,358 +3908,55 @@ const Gs = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), Vs = (t) => {
|
|
|
3572
3908
|
default:
|
|
3573
3909
|
return [];
|
|
3574
3910
|
}
|
|
3575
|
-
},
|
|
3576
|
-
const n =
|
|
3577
|
-
return Array.from({ length: o }, (
|
|
3578
|
-
},
|
|
3579
|
-
const n =
|
|
3911
|
+
}, Ra = (t, e) => {
|
|
3912
|
+
const n = _(e, !0), r = _(t), s = n.getFullYear(), a = r.getFullYear(), o = n.getTime() <= r.getTime() ? a + Pa - s : 0;
|
|
3913
|
+
return Array.from({ length: o }, (i, u) => s + u);
|
|
3914
|
+
}, _ = (t, e = !1) => {
|
|
3915
|
+
const n = ka(t, e);
|
|
3580
3916
|
return n ? (n.getTimezoneOffset() > 0 && n.setMinutes(n.getMinutes() + n.getTimezoneOffset()), n) : /* @__PURE__ */ new Date();
|
|
3581
|
-
},
|
|
3917
|
+
}, ka = (t, e = !1) => {
|
|
3582
3918
|
const n = Number(t);
|
|
3583
|
-
return t.toString().length !== 13 ? e ?
|
|
3584
|
-
},
|
|
3585
|
-
const n =
|
|
3919
|
+
return t.toString().length !== 13 ? e ? Pt(t) : vt(t) : isNaN(n) ? /* @__PURE__ */ new Date(`${t}T00:00:00.000Z`) : new Date(n);
|
|
3920
|
+
}, _a = (t, e) => e ? Math.floor((t + 1) / 3) : Math.ceil((t + 1) / 3), fo = (t, e) => {
|
|
3921
|
+
const n = tt(t) - tt(e);
|
|
3586
3922
|
if (n === 0 && t !== e) {
|
|
3587
|
-
const r =
|
|
3923
|
+
const r = et(t), s = et(e);
|
|
3588
3924
|
return r - s;
|
|
3589
3925
|
}
|
|
3590
3926
|
return n;
|
|
3591
|
-
},
|
|
3592
|
-
|
|
3593
|
-
function Ga(t) {
|
|
3594
|
-
return t?.annotations?.find((e) => {
|
|
3595
|
-
if (e.id === Oe.LAST_UPDATE_AT)
|
|
3596
|
-
return e;
|
|
3597
|
-
})?.value;
|
|
3598
|
-
}
|
|
3599
|
-
const Ae = (t, e) => t?.names && t?.names[e] || t?.name, Tt = (t, e, n) => {
|
|
3600
|
-
if (!(!t || e?.has(t?.id)) && (e?.set(t?.id, t), t?.parent)) {
|
|
3601
|
-
const r = n?.get(t?.parent);
|
|
3602
|
-
Tt(r, e, n);
|
|
3603
|
-
}
|
|
3604
|
-
}, oa = (t, e) => {
|
|
3605
|
-
const n = /* @__PURE__ */ new Map(), r = new Map(t?.map((s) => [s.id, s]));
|
|
3606
|
-
return e?.forEach((s) => {
|
|
3607
|
-
Tt(s, n, r);
|
|
3608
|
-
}), Array.from(n?.values());
|
|
3609
|
-
}, Va = (t) => {
|
|
3610
|
-
const e = t?.find(
|
|
3611
|
-
(a) => a.id === ls
|
|
3612
|
-
), n = t?.find(
|
|
3613
|
-
(a) => a.id === fs
|
|
3614
|
-
), r = n?.title ? new Date(n?.title) : null;
|
|
3927
|
+
}, et = (t) => ve(t) ? 6 : Me(t) ? 5 : Re(t) ? 4 : Ae(t) ? 3 : ke(t) ? 2 : fa(t) ? 1 : 0, tt = (t, e = !1) => (e ? Pt(t) : vt(t))?.getTime() || 0, Ot = (t, e, n) => {
|
|
3928
|
+
const r = _(e, !0), s = _(n), a = _(t, !0), o = _(t), c = r.getTime() > a.getTime() ? r : a, i = s.getTime() < o.getTime() ? s : o;
|
|
3615
3929
|
return {
|
|
3616
|
-
|
|
3617
|
-
|
|
3930
|
+
start: c,
|
|
3931
|
+
end: i
|
|
3618
3932
|
};
|
|
3619
|
-
},
|
|
3620
|
-
const
|
|
3621
|
-
r.sort(
|
|
3622
|
-
(o, i) => ia(o[0], i[0])
|
|
3623
|
-
);
|
|
3624
|
-
const s = [...e];
|
|
3625
|
-
s.sort(ca);
|
|
3626
|
-
let a = 0;
|
|
3627
|
-
for (const o of r) {
|
|
3628
|
-
const i = o[0];
|
|
3629
|
-
for (; a < s.length && s[a].memberValue.localeCompare(i.id) < 0; )
|
|
3630
|
-
a += 1;
|
|
3631
|
-
a < s.length && s[a].memberValue === i.id && (n[o[1]] = o[0]);
|
|
3632
|
-
}
|
|
3633
|
-
return n.filter((o) => o != null);
|
|
3634
|
-
}, da = (t) => !!t?.some((e) => e.parent), Xa = (t, e, n, r, s = []) => {
|
|
3635
|
-
let a = t || [];
|
|
3636
|
-
if (la(n || [], e || "")) {
|
|
3637
|
-
const o = (n || [])[0].cubeRegions?.find(
|
|
3638
|
-
({ isIncluded: i }) => i
|
|
3639
|
-
);
|
|
3640
|
-
if (o) {
|
|
3641
|
-
const i = o.memberSelection?.find(
|
|
3642
|
-
({ componentId: c }) => c === e
|
|
3643
|
-
);
|
|
3644
|
-
i ? a = a.length === 0 ? (i.selectionValues || []).map(({ memberValue: c }) => ({
|
|
3645
|
-
id: c,
|
|
3646
|
-
name: c
|
|
3647
|
-
})) : ua(a, i.selectionValues) : a = [];
|
|
3648
|
-
}
|
|
3649
|
-
} else s.length !== 0 && (a = a.filter(({ id: o }) => s.includes(o)));
|
|
3650
|
-
return da(t) && (a = oa(t, a)), a?.map((o) => ({
|
|
3651
|
-
...o,
|
|
3652
|
-
name: r ? Ae(o, r) : o?.name
|
|
3653
|
-
}));
|
|
3654
|
-
}, la = (t, e) => t != null && t.length > 0 && e != null, fa = (t) => {
|
|
3655
|
-
const e = [];
|
|
3656
|
-
return t?.filters?.forEach((n) => {
|
|
3657
|
-
n.componentCode !== ds && e.push({
|
|
3658
|
-
componentCode: n.componentCode,
|
|
3659
|
-
operator: R.EQUALS,
|
|
3660
|
-
value: n.values.join(",")
|
|
3661
|
-
});
|
|
3662
|
-
}), e;
|
|
3663
|
-
}, ja = (t) => {
|
|
3664
|
-
const e = /* @__PURE__ */ new Map();
|
|
3665
|
-
return t?.forEach((n) => {
|
|
3666
|
-
e.set(n.urn, fa(n));
|
|
3667
|
-
}), e;
|
|
3668
|
-
}, ma = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, Be = (t) => {
|
|
3669
|
-
if (typeof t != "string")
|
|
3670
|
-
throw new TypeError("Invalid argument expected string");
|
|
3671
|
-
const e = t.match(ma);
|
|
3672
|
-
if (!e)
|
|
3673
|
-
throw new Error(`Invalid argument not valid semver ('${t}' received)`);
|
|
3674
|
-
return e.shift(), e;
|
|
3675
|
-
}, Ge = (t) => t === "*" || t === "x" || t === "X", Ve = (t) => {
|
|
3676
|
-
const e = parseInt(t, 10);
|
|
3677
|
-
return isNaN(e) ? t : e;
|
|
3678
|
-
}, ha = (t, e) => typeof t != typeof e ? [String(t), String(e)] : [t, e], wa = (t, e) => {
|
|
3679
|
-
if (Ge(t) || Ge(e))
|
|
3680
|
-
return 0;
|
|
3681
|
-
const [n, r] = ha(Ve(t), Ve(e));
|
|
3682
|
-
return n > r ? 1 : n < r ? -1 : 0;
|
|
3683
|
-
}, Xe = (t, e) => {
|
|
3684
|
-
for (let n = 0; n < Math.max(t.length, e.length); n++) {
|
|
3685
|
-
const r = wa(t[n] || "0", e[n] || "0");
|
|
3686
|
-
if (r !== 0)
|
|
3687
|
-
return r;
|
|
3688
|
-
}
|
|
3689
|
-
return 0;
|
|
3690
|
-
}, ga = (t, e) => {
|
|
3691
|
-
const n = Be(t), r = Be(e), s = n.pop(), a = r.pop(), o = Xe(n, r);
|
|
3692
|
-
return o !== 0 ? o : s && a ? Xe(s.split("."), a.split(".")) : s || a ? s ? -1 : 1 : 0;
|
|
3693
|
-
}, pa = (t, e, n) => {
|
|
3694
|
-
ya(n);
|
|
3695
|
-
const r = ga(t, e);
|
|
3696
|
-
return Et[n].includes(r);
|
|
3697
|
-
}, Et = {
|
|
3698
|
-
">": [1],
|
|
3699
|
-
">=": [0, 1],
|
|
3700
|
-
"=": [0],
|
|
3701
|
-
"<=": [-1, 0],
|
|
3702
|
-
"<": [-1],
|
|
3703
|
-
"!=": [-1, 1]
|
|
3704
|
-
}, je = Object.keys(Et), ya = (t) => {
|
|
3705
|
-
if (je.indexOf(t) === -1)
|
|
3706
|
-
throw new Error(`Invalid operator, expected one of ${je.join("|")}`);
|
|
3707
|
-
}, ce = "+", Ne = (t, e) => {
|
|
3708
|
-
const { agency: n, id: r, version: s } = H(t), a = e.filter(
|
|
3709
|
-
(c) => c.agencyID === n && c.id === r && !c?.version?.includes(ce)
|
|
3710
|
-
);
|
|
3711
|
-
if (a.length === 1)
|
|
3712
|
-
return a[0];
|
|
3713
|
-
if (!s?.includes(ce))
|
|
3714
|
-
return a.find((c) => c.version === s);
|
|
3715
|
-
const o = a.map(
|
|
3716
|
-
(c) => c.version
|
|
3717
|
-
), i = ba(s, o);
|
|
3718
|
-
return a.find(
|
|
3719
|
-
(c) => c.version === i[0]
|
|
3720
|
-
);
|
|
3721
|
-
}, ba = (t, e) => {
|
|
3722
|
-
const n = Da(t, e);
|
|
3723
|
-
return n.length > 0 ? [n[0]] : [];
|
|
3724
|
-
}, Da = (t, e) => {
|
|
3725
|
-
const n = [];
|
|
3726
|
-
return e.forEach((r) => {
|
|
3727
|
-
Ea(t, r) && n.push(r);
|
|
3728
|
-
}), n;
|
|
3729
|
-
}, Ta = (t) => {
|
|
3730
|
-
const e = t.trim().replace(/\d+\+/, "*"), [n] = e.split("*");
|
|
3731
|
-
return new RegExp(`^${n}`);
|
|
3732
|
-
}, Ea = (t, e) => {
|
|
3733
|
-
const n = t.trim().replace(/\+/, "");
|
|
3734
|
-
return Ta(t).test(e) && pa(e, n, ">=");
|
|
3735
|
-
}, ke = (t, e) => {
|
|
3736
|
-
const { concept: n } = xa(t, e);
|
|
3737
|
-
return n;
|
|
3738
|
-
}, xa = (t, e) => {
|
|
3739
|
-
if (t == null)
|
|
3740
|
-
return {
|
|
3741
|
-
concept: void 0,
|
|
3742
|
-
scheme: void 0
|
|
3743
|
-
};
|
|
3744
|
-
const { childId: n, agency: r, id: s, version: a } = Pt(t);
|
|
3745
|
-
if (a?.includes(ce)) {
|
|
3746
|
-
const o = Ne(
|
|
3747
|
-
t,
|
|
3748
|
-
e
|
|
3749
|
-
);
|
|
3750
|
-
return {
|
|
3751
|
-
concept: Ke(o?.concepts || [], n),
|
|
3752
|
-
scheme: o
|
|
3753
|
-
};
|
|
3754
|
-
}
|
|
3755
|
-
for (const o of e)
|
|
3756
|
-
if (Pa(o, s, r, a))
|
|
3757
|
-
return {
|
|
3758
|
-
concept: Ke(o?.concepts || [], n),
|
|
3759
|
-
scheme: o
|
|
3760
|
-
};
|
|
3761
|
-
return {
|
|
3762
|
-
concept: void 0,
|
|
3763
|
-
scheme: void 0
|
|
3764
|
-
};
|
|
3765
|
-
}, Ke = (t, e) => t?.find((n) => n.id === e), Pa = (t, e, n, r) => t.id === e && t.agencyID === n && t.version === r, Ka = (t = [], e = [], n) => {
|
|
3766
|
-
const r = n?.conceptIdentity || "", s = ke(r, e), a = K(
|
|
3767
|
-
n?.localRepresentation?.enumeration
|
|
3768
|
-
), o = K(
|
|
3769
|
-
s?.coreRepresentation?.enumeration
|
|
3770
|
-
), i = a || o;
|
|
3771
|
-
if (i != null)
|
|
3772
|
-
return Ne(i, t);
|
|
3773
|
-
}, za = (t, e, n, r) => {
|
|
3774
|
-
const s = e?.find(
|
|
3775
|
-
(a) => a?.id === t?.id
|
|
3776
|
-
)?.values;
|
|
3777
|
-
return n?.filter((a) => s?.some((o) => o.id === a.id))?.map((a) => ({
|
|
3778
|
-
...a,
|
|
3779
|
-
name: r ? Ae(a, r) : a?.name
|
|
3780
|
-
})) || [];
|
|
3781
|
-
}, Ma = (t, e) => {
|
|
3782
|
-
const n = e?.dataStructureComponents?.attributeList, r = t?.metadataStructureComponents?.metadataAttributeList;
|
|
3783
|
-
return n?.metadataAttributeUsages?.map((s) => {
|
|
3784
|
-
const a = r?.metadataAttributes?.find(
|
|
3785
|
-
(o) => o?.id === s?.metadataAttributeReference
|
|
3786
|
-
);
|
|
3787
|
-
return {
|
|
3788
|
-
...a,
|
|
3789
|
-
attributeRelationship: s.attributeRelationship,
|
|
3790
|
-
isMandatory: Number(a?.minOccurs) > 0
|
|
3791
|
-
};
|
|
3792
|
-
});
|
|
3793
|
-
}, Ja = (t = [], e, n) => {
|
|
3794
|
-
const r = K(e?.conceptIdentity) || "", s = ke(r, t);
|
|
3795
|
-
return n ? Ae(s, n) : s?.name ?? s?.id ?? e?.id;
|
|
3796
|
-
};
|
|
3797
|
-
function ze(t) {
|
|
3798
|
-
return t?.dataStructures?.[0]?.dataStructureComponents?.dimensionList;
|
|
3799
|
-
}
|
|
3800
|
-
function Za(t) {
|
|
3801
|
-
return t?.data?.structures?.[0]?.dimensions?.series || [];
|
|
3802
|
-
}
|
|
3803
|
-
function eo(t) {
|
|
3804
|
-
return t?.data?.structures?.[0]?.dimensions?.observation?.[0].values.map((e) => e.value).filter((e) => e != null) || [];
|
|
3805
|
-
}
|
|
3806
|
-
function to(t) {
|
|
3807
|
-
return t.find(
|
|
3808
|
-
(e) => e.type === we.TIME_DIMENSION
|
|
3809
|
-
);
|
|
3810
|
-
}
|
|
3811
|
-
const no = (t) => {
|
|
3812
|
-
const e = /* @__PURE__ */ new Map(), n = t?.dataStructures?.[0], r = t?.metadataStructures?.[0], s = t?.conceptSchemes || [], a = t?.codelists || [];
|
|
3813
|
-
return t && [
|
|
3814
|
-
...ze(t)?.dimensions || [],
|
|
3815
|
-
...ze(t)?.timeDimensions || [],
|
|
3816
|
-
...Ma(r, n),
|
|
3817
|
-
...n?.dataStructureComponents?.attributeList?.attributes || []
|
|
3818
|
-
].forEach(
|
|
3819
|
-
(i) => {
|
|
3820
|
-
const c = ke(
|
|
3821
|
-
i?.conceptIdentity,
|
|
3822
|
-
s
|
|
3823
|
-
), u = i?.localRepresentation?.enumeration || c?.coreRepresentation?.enumeration, d = Ne(
|
|
3824
|
-
u,
|
|
3825
|
-
a
|
|
3826
|
-
);
|
|
3827
|
-
i?.id && (u ? e.set(i?.id, {
|
|
3828
|
-
...d,
|
|
3829
|
-
name: c?.name,
|
|
3830
|
-
names: c?.names
|
|
3831
|
-
}) : e.set(i?.id, {
|
|
3832
|
-
id: i?.id,
|
|
3833
|
-
name: c?.name,
|
|
3834
|
-
names: c?.names
|
|
3835
|
-
}));
|
|
3836
|
-
}
|
|
3837
|
-
), e;
|
|
3838
|
-
}, ro = (t) => t?.find(
|
|
3839
|
-
(e) => e.id === Oe.SERIES_COUNT
|
|
3840
|
-
)?.title || "", va = "/api/download", so = (t, e, n, r, s, a, o) => {
|
|
3841
|
-
const i = new URLSearchParams({
|
|
3842
|
-
urn: t,
|
|
3843
|
-
format: e,
|
|
3844
|
-
compress: "false",
|
|
3845
|
-
filename: a,
|
|
3846
|
-
filters: JSON.stringify(s),
|
|
3847
|
-
attribute: r,
|
|
3848
|
-
language: n,
|
|
3849
|
-
isMetadata: o ? "true" : "none"
|
|
3850
|
-
}).toString(), c = `${va}?${i}`;
|
|
3851
|
-
window.open(c, "_blank");
|
|
3852
|
-
}, ao = (t, e) => {
|
|
3853
|
-
const n = [];
|
|
3854
|
-
for (const r of t) {
|
|
3855
|
-
if (r.type !== we.DIMENSION)
|
|
3856
|
-
continue;
|
|
3857
|
-
const s = e.find((a) => a.componentCode === r.id);
|
|
3858
|
-
s != null && s.values?.length > 0 ? n.push(s.values?.join(Wt)) : n.push("*");
|
|
3859
|
-
}
|
|
3860
|
-
return n.join(".");
|
|
3861
|
-
}, Oa = (t, e) => {
|
|
3862
|
-
if (!t || !t.startPeriod && !t.endPeriod)
|
|
3863
|
-
return null;
|
|
3864
|
-
const n = [], { startPeriod: r, endPeriod: s } = t;
|
|
3865
|
-
if (r && n.push(
|
|
3866
|
-
`${R.GREATER_OR_EQUAL}${Re}${Je(r)}`
|
|
3867
|
-
), s && n.push(
|
|
3868
|
-
`${R.LESS_OR_EQUAL}${Re}${Je(s)}`
|
|
3869
|
-
), n.length === 0)
|
|
3870
|
-
return null;
|
|
3871
|
-
const a = e;
|
|
3872
|
-
return n.map(
|
|
3873
|
-
(o) => `${encodeURIComponent(`c[${a}]`)}${St}${encodeURIComponent(o)}`
|
|
3874
|
-
).join(tt);
|
|
3875
|
-
}, Je = (t) => Un(t, "yyyy-MM-dd"), oo = (t, e) => {
|
|
3876
|
-
const n = Aa(t, e) || null;
|
|
3877
|
-
return n ? Oa(n, e?.id) : null;
|
|
3878
|
-
}, Aa = (t, e) => {
|
|
3879
|
-
const n = e.id, r = t?.filters?.find(
|
|
3880
|
-
(c) => c.componentCode === n
|
|
3881
|
-
);
|
|
3882
|
-
if (!r || !r.values)
|
|
3883
|
-
return null;
|
|
3884
|
-
const s = r.values?.filter((c) => !!c);
|
|
3885
|
-
if (!s.length)
|
|
3886
|
-
return null;
|
|
3887
|
-
const a = r.operator;
|
|
3888
|
-
if (a === R.LESS_OR_EQUAL || a === R.LESS)
|
|
3889
|
-
return { startPeriod: null, endPeriod: V(s[0]) };
|
|
3890
|
-
if (a === R.GREATER_OR_EQUAL || a === R.GREATER)
|
|
3891
|
-
return { startPeriod: V(s[0]), endPeriod: null };
|
|
3892
|
-
const o = V(s[0]), i = V(s[1]);
|
|
3893
|
-
return { startPeriod: o, endPeriod: i };
|
|
3894
|
-
}, xt = (t, e, n) => {
|
|
3895
|
-
const r = k(e, !0), s = k(n), a = k(t, !0), o = k(t), i = r.getTime() > a.getTime() ? r : a, c = s.getTime() < o.getTime() ? s : o;
|
|
3896
|
-
return {
|
|
3897
|
-
start: i,
|
|
3898
|
-
end: c
|
|
3899
|
-
};
|
|
3900
|
-
}, Na = (t, e, n, r = "W") => {
|
|
3901
|
-
const s = +t, { start: a, end: o } = xt(t, e, n);
|
|
3933
|
+
}, Ia = (t, e, n, r = "W") => {
|
|
3934
|
+
const s = +t, { start: a, end: o } = Ot(t, e, n);
|
|
3902
3935
|
if (a.getTime() > o.getTime())
|
|
3903
3936
|
return [];
|
|
3904
|
-
const
|
|
3905
|
-
if (
|
|
3906
|
-
for (let
|
|
3907
|
-
l.push(
|
|
3937
|
+
const c = Z(a, r), i = c.weekYear === s ? c.weekNumber : c.weekYear < s ? 1 : Ke(s, r), u = Z(o, r), d = u.weekYear === s ? u.weekNumber : u.weekYear > s ? Ke(s, r) : 1, l = [];
|
|
3938
|
+
if (i < d)
|
|
3939
|
+
for (let m = i; m <= d; m++)
|
|
3940
|
+
l.push(xt(s, m, r));
|
|
3908
3941
|
return l;
|
|
3909
|
-
},
|
|
3942
|
+
}, Ya = (t) => {
|
|
3910
3943
|
const e = new Date(t);
|
|
3911
3944
|
return e.setMinutes(e.getMinutes() - e.getTimezoneOffset()), e.toISOString().slice(0, 10);
|
|
3912
|
-
},
|
|
3913
|
-
const { start: r, end: s } =
|
|
3945
|
+
}, Ca = (t, e, n) => {
|
|
3946
|
+
const { start: r, end: s } = Ot(t, e, n);
|
|
3914
3947
|
if (r.getTime() > s.getTime())
|
|
3915
3948
|
return [];
|
|
3916
3949
|
const a = [], o = new Date(
|
|
3917
3950
|
r.getFullYear(),
|
|
3918
3951
|
r.getMonth(),
|
|
3919
3952
|
r.getDate()
|
|
3920
|
-
),
|
|
3921
|
-
for (; o.getTime() <
|
|
3922
|
-
const
|
|
3923
|
-
a.push(
|
|
3953
|
+
), c = new Date(s.getFullYear(), s.getMonth(), s.getDate());
|
|
3954
|
+
for (; o.getTime() < c.getTime(); ) {
|
|
3955
|
+
const i = Ya(o);
|
|
3956
|
+
a.push(i), o.setDate(o.getDate() + 1);
|
|
3924
3957
|
}
|
|
3925
3958
|
return a;
|
|
3926
|
-
},
|
|
3959
|
+
}, Sa = (t) => ({
|
|
3927
3960
|
isDailyExist: !!t?.some(({ memberValue: e }) => e === "D"),
|
|
3928
3961
|
isWeeklyExist: !!t?.some(({ memberValue: e }) => e === "W"),
|
|
3929
3962
|
isMonthlyExist: !!t?.some(({ memberValue: e }) => e === "M"),
|
|
@@ -3932,15 +3965,15 @@ const no = (t) => {
|
|
|
3932
3965
|
isYearlyExist: !!t?.some(
|
|
3933
3966
|
({ memberValue: e }) => e === "A" || e === "Y"
|
|
3934
3967
|
)
|
|
3935
|
-
}),
|
|
3936
|
-
const s = r === 0 ?
|
|
3968
|
+
}), La = (t, e, n, r) => {
|
|
3969
|
+
const s = r === 0 ? _(e.toString(), !0)?.getMonth() + 1 : void 0, a = r === t.length - 1 ? _(n.toString())?.getMonth() + 1 || 1 : void 0;
|
|
3937
3970
|
return { startMonth: s, endMonth: a };
|
|
3938
|
-
},
|
|
3971
|
+
}, $a = ["FREQUENCY", "FREQ"], mo = (t, e) => {
|
|
3939
3972
|
const n = t?.[0]?.cubeRegions?.[0]?.memberSelection?.find(
|
|
3940
|
-
(
|
|
3941
|
-
)?.selectionValues, r =
|
|
3942
|
-
return o.forEach((
|
|
3943
|
-
const d = [], { startMonth: l, endMonth:
|
|
3973
|
+
(i) => $a.includes(i.componentId)
|
|
3974
|
+
)?.selectionValues, r = Sa(n || []), s = e?.startPeriod?.getTime() || 1, a = e?.endPeriod?.getTime() || 1, o = Ra(a, s), c = [];
|
|
3975
|
+
return o.forEach((i, u) => {
|
|
3976
|
+
const d = [], { startMonth: l, endMonth: m } = La(
|
|
3944
3977
|
o,
|
|
3945
3978
|
new Date(s),
|
|
3946
3979
|
new Date(a),
|
|
@@ -3948,142 +3981,249 @@ const no = (t) => {
|
|
|
3948
3981
|
), {
|
|
3949
3982
|
isDailyExist: x,
|
|
3950
3983
|
isWeeklyExist: P,
|
|
3951
|
-
isMonthlyExist:
|
|
3984
|
+
isMonthlyExist: N,
|
|
3952
3985
|
isQuarterlyExist: f,
|
|
3953
3986
|
isSemiAnnualExist: w,
|
|
3954
|
-
isYearlyExist:
|
|
3987
|
+
isYearlyExist: v
|
|
3955
3988
|
} = r;
|
|
3956
|
-
|
|
3957
|
-
...
|
|
3958
|
-
),
|
|
3959
|
-
...
|
|
3989
|
+
v && d.push(i.toString()), w && d.push(...Ma(i, l, m)), f && d.push(
|
|
3990
|
+
...va(i, l, m, !1)
|
|
3991
|
+
), N && d.push(...Na(i, l, m)), P && d.push(
|
|
3992
|
+
...Ia(i, s.toString(), a.toString())
|
|
3960
3993
|
), x && d.push(
|
|
3961
|
-
...
|
|
3962
|
-
),
|
|
3963
|
-
}),
|
|
3994
|
+
...Ca(i, s.toString(), a.toString())
|
|
3995
|
+
), c.push(...d);
|
|
3996
|
+
}), c;
|
|
3964
3997
|
};
|
|
3965
|
-
function
|
|
3998
|
+
function Wa(t) {
|
|
3966
3999
|
const { urn: e } = t.details;
|
|
3967
|
-
return
|
|
4000
|
+
return ue(e.resourceId, e.version, e.agencyId);
|
|
3968
4001
|
}
|
|
3969
|
-
function
|
|
4002
|
+
function ho(t) {
|
|
3970
4003
|
const e = {};
|
|
3971
4004
|
for (const n of t.datasets) {
|
|
3972
|
-
const r = n.dataset, s =
|
|
4005
|
+
const r = n.dataset, s = Wa(r);
|
|
3973
4006
|
e[s] = r.details.dimensions;
|
|
3974
4007
|
}
|
|
3975
4008
|
return e;
|
|
3976
4009
|
}
|
|
4010
|
+
function go(t) {
|
|
4011
|
+
return t?.codelists?.length ? t.codelists.map((e) => ({
|
|
4012
|
+
id: e.id,
|
|
4013
|
+
agencyID: e.agencyID ?? "",
|
|
4014
|
+
version: e.version ?? "",
|
|
4015
|
+
name: e.name,
|
|
4016
|
+
codes: e.codes?.map((n) => ({
|
|
4017
|
+
id: n.id,
|
|
4018
|
+
name: n.name,
|
|
4019
|
+
description: n.description
|
|
4020
|
+
}))
|
|
4021
|
+
})) : (t?.glossaries ?? []).map((e) => ({
|
|
4022
|
+
id: e.id,
|
|
4023
|
+
agencyID: e.agencyID ?? "",
|
|
4024
|
+
version: e.version ?? "",
|
|
4025
|
+
name: e.name,
|
|
4026
|
+
codes: e.terms?.map((n) => ({
|
|
4027
|
+
id: n.id,
|
|
4028
|
+
name: n.name,
|
|
4029
|
+
description: n.description
|
|
4030
|
+
}))
|
|
4031
|
+
}));
|
|
4032
|
+
}
|
|
4033
|
+
function qa(t, e) {
|
|
4034
|
+
const n = (r) => {
|
|
4035
|
+
const s = r.indexOf("(");
|
|
4036
|
+
if (s === -1) return r;
|
|
4037
|
+
const a = r.indexOf(")", s);
|
|
4038
|
+
return a === -1 ? r : r.slice(0, s + 1) + "*" + r.slice(a);
|
|
4039
|
+
};
|
|
4040
|
+
return n(t) === n(e);
|
|
4041
|
+
}
|
|
4042
|
+
function ce(t) {
|
|
4043
|
+
return ue(
|
|
4044
|
+
t.id,
|
|
4045
|
+
t.version ?? "",
|
|
4046
|
+
t.agencyID ?? ""
|
|
4047
|
+
);
|
|
4048
|
+
}
|
|
4049
|
+
function At(t, e, n) {
|
|
4050
|
+
e?.forEach((r) => {
|
|
4051
|
+
const { childId: s, agency: a, id: o, version: c } = nt(r.code), i = ue(o, c, a), u = n?.find(
|
|
4052
|
+
(l) => qa(i, ce(l))
|
|
4053
|
+
), d = u?.codes?.find((l) => l.id === s);
|
|
4054
|
+
if (d != null) {
|
|
4055
|
+
const l = r.code.replace(
|
|
4056
|
+
i,
|
|
4057
|
+
ce(u)
|
|
4058
|
+
);
|
|
4059
|
+
t.push({ ...d, code: l });
|
|
4060
|
+
}
|
|
4061
|
+
At(t, r.hierarchicalCodes, n);
|
|
4062
|
+
});
|
|
4063
|
+
}
|
|
4064
|
+
function wo(t, e) {
|
|
4065
|
+
const n = [];
|
|
4066
|
+
return At(n, t?.hierarchicalCodes, e), n;
|
|
4067
|
+
}
|
|
4068
|
+
function yo(t) {
|
|
4069
|
+
const e = {};
|
|
4070
|
+
return t?.forEach((n) => {
|
|
4071
|
+
e[ce(n)] = n.codes;
|
|
4072
|
+
}), e;
|
|
4073
|
+
}
|
|
4074
|
+
function po(t, e, n) {
|
|
4075
|
+
if (!n || n.length === 0 || !e)
|
|
4076
|
+
return t;
|
|
4077
|
+
const r = n[0].cubeRegions?.find(
|
|
4078
|
+
(o) => o.isIncluded
|
|
4079
|
+
);
|
|
4080
|
+
if (!r) return t;
|
|
4081
|
+
const s = r.memberSelection?.find(
|
|
4082
|
+
(o) => o.componentId === e
|
|
4083
|
+
);
|
|
4084
|
+
if (!s) return [];
|
|
4085
|
+
const a = new Set(s.selectionValues.map((o) => o.memberValue));
|
|
4086
|
+
return t.filter((o) => a.has(o.id));
|
|
4087
|
+
}
|
|
4088
|
+
class bo {
|
|
4089
|
+
constructor(e) {
|
|
4090
|
+
this.client = e;
|
|
4091
|
+
}
|
|
4092
|
+
async getAvailableHierarchies(e, n, r) {
|
|
4093
|
+
const { agency: s, id: a, version: o } = C(e), i = `${this.client.config.sdmxProxyUrl ? this.client.config.sdmxProxyUrl : this.client.config.apiUrl}/sdmx/3.0/structure/codelist`, u = r ? { [Ce]: r } : void 0;
|
|
4094
|
+
return this.client.request(
|
|
4095
|
+
`${s}/${a}/${o}?references=hierarchy&detail=allcompletestubs`,
|
|
4096
|
+
{ method: "GET", headers: u },
|
|
4097
|
+
i,
|
|
4098
|
+
n
|
|
4099
|
+
);
|
|
4100
|
+
}
|
|
4101
|
+
async getHierarchy(e, n, r) {
|
|
4102
|
+
const { agency: s, id: a, version: o } = C(e), i = `${this.client.config.sdmxProxyUrl ? this.client.config.sdmxProxyUrl : this.client.config.apiUrl}/sdmx/3.0/structure/hierarchy`, u = r ? { [Ce]: r } : void 0;
|
|
4103
|
+
return this.client.request(
|
|
4104
|
+
`${s}/${a}/${o}?references=descendants&detail=full`,
|
|
4105
|
+
{ method: "GET", headers: u },
|
|
4106
|
+
i,
|
|
4107
|
+
n
|
|
4108
|
+
);
|
|
4109
|
+
}
|
|
4110
|
+
}
|
|
3977
4111
|
export {
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4112
|
+
we as Annotations,
|
|
4113
|
+
Us as AssignmentStatus,
|
|
4114
|
+
Ua as AvailabilityApi,
|
|
4115
|
+
Wt as DATASET_DATA_URL,
|
|
4116
|
+
Fa as DatasetApi,
|
|
4117
|
+
De as DimensionType,
|
|
4118
|
+
St as DownloadType,
|
|
4119
|
+
Va as FREQUENCY_DIMENSION_ID,
|
|
4120
|
+
$a as FREQUENCY_DIM_ID,
|
|
4121
|
+
Ct as FileColumnsAttribute,
|
|
4122
|
+
Ht as GET_v3_FILTER_ALL,
|
|
4123
|
+
Ha as GET_v3_FILTER_AND,
|
|
4124
|
+
Ut as GET_v3_FILTER_OR,
|
|
4125
|
+
bo as HierarchyApi,
|
|
4126
|
+
zs as OBSERVATION_KEY,
|
|
4127
|
+
Hs as OccurrenceType,
|
|
4128
|
+
ws as Periods,
|
|
4129
|
+
gs as RepresentationTextType,
|
|
4130
|
+
hs as SDMX_DATA_QUERY_PARAMS,
|
|
4131
|
+
oe as SINGLE_WILDCARD_SYMBOL,
|
|
4132
|
+
Qa as SdmxApiClient,
|
|
4133
|
+
rt as SdmxAvailabilityMode,
|
|
4134
|
+
G as SdmxDataFormat,
|
|
4135
|
+
st as SdmxDetails,
|
|
4136
|
+
de as SdmxReferences,
|
|
4137
|
+
k as SeriesFilterOperator,
|
|
4138
|
+
ys as TIME_PERIOD,
|
|
4139
|
+
bs as TIME_PERIOD_END_ANNOTATION_KEY,
|
|
4140
|
+
ps as TIME_PERIOD_START_ANNOTATION_KEY,
|
|
4141
|
+
ho as buildDatasetDimensionsMetadataMap,
|
|
4142
|
+
ca as dailyPattern,
|
|
4143
|
+
ea as decodeDimensionId,
|
|
4144
|
+
za as findCodelistByDimension,
|
|
4145
|
+
Ye as generateDatasetDataRequest,
|
|
4146
|
+
ue as generateShortUrn,
|
|
4147
|
+
mo as getAdditionalColumns,
|
|
4148
|
+
Ga as getAnnotationPeriod,
|
|
4149
|
+
pe as getArtifactByUrnWithWildCard,
|
|
4150
|
+
Ka as getAttachedDimensionsSeriesByDimension,
|
|
4151
|
+
$s as getAttachedDimensionsSeriesByTsId,
|
|
4152
|
+
Et as getAttachedDimensionsSeriesKey,
|
|
4153
|
+
Ws as getAttributeValueFromDataQueryResponse,
|
|
4154
|
+
Ja as getAvailableCodes,
|
|
4020
4155
|
Xa as getAvailableCodesFromConstrains,
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4156
|
+
nt as getChildParsedUrn,
|
|
4157
|
+
yo as getCodeListsData,
|
|
4158
|
+
be as getConcept,
|
|
4159
|
+
je as getConceptByUrn,
|
|
4160
|
+
Ss as getConceptWithScheme,
|
|
4161
|
+
qs as getConvertedMetaAttributes,
|
|
4162
|
+
la as getDailyRegExp,
|
|
4163
|
+
Ca as getDaysColumns,
|
|
4164
|
+
Za as getDimensionTitle,
|
|
4029
4165
|
ze as getDimensions,
|
|
4030
|
-
|
|
4031
|
-
|
|
4166
|
+
ms as getFilteredItemsWithParents,
|
|
4167
|
+
vs as getFiltersDtoFromDataQuery,
|
|
4032
4168
|
ja as getFiltersDtoMapFromDataQuery,
|
|
4169
|
+
po as getHierarchyAvailableCodes,
|
|
4170
|
+
wo as getHierarchyCodes,
|
|
4033
4171
|
Z as getISOWeek,
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4172
|
+
z as getKeyFromUrn,
|
|
4173
|
+
Ba as getLastUpdatedTime,
|
|
4174
|
+
Ke as getLastWeekNumberOfYear,
|
|
4175
|
+
ye as getLocalizedName,
|
|
4176
|
+
Na as getMonthlyData,
|
|
4177
|
+
lo as getMonthlyDataByQuarter,
|
|
4178
|
+
Oe as getMonthlyRegExp,
|
|
4179
|
+
vt as getParsedEndPeriodDate,
|
|
4180
|
+
co as getParsedResponse,
|
|
4181
|
+
Pt as getParsedStartPeriodDate,
|
|
4182
|
+
_ as getPeriodDate,
|
|
4183
|
+
Sa as getPeriods,
|
|
4184
|
+
uo as getQuarterByMonth,
|
|
4185
|
+
Ne as getQuarterlyRegExp,
|
|
4186
|
+
va as getQuartersData,
|
|
4187
|
+
Xs as getQueryTimePeriodFilters,
|
|
4188
|
+
Lt as getRequestAcceptHeader,
|
|
4189
|
+
_s as getResolvedVersionBySingleWildcard,
|
|
4190
|
+
Ma as getSemiAnnualData,
|
|
4191
|
+
da as getSemiAnnuallyRegExp,
|
|
4054
4192
|
ie as getSeriesAttributes,
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4193
|
+
Ks as getSeriesName,
|
|
4194
|
+
ro as getStructureComponentsMap,
|
|
4195
|
+
eo as getStructureDimensions,
|
|
4196
|
+
no as getTimeDimension,
|
|
4197
|
+
to as getTimePeriods,
|
|
4198
|
+
io as getTimeQueryFilter,
|
|
4199
|
+
js as getTimeRangeFromAttachment,
|
|
4200
|
+
so as getTimeSeriesCount,
|
|
4201
|
+
oo as getTimeSeriesFilterKey,
|
|
4202
|
+
Zs as getTimeSeriesId,
|
|
4203
|
+
xt as getWeekCode,
|
|
4204
|
+
Bs as getWeeklyPeriodEndDate,
|
|
4205
|
+
Qs as getWeeklyPeriodStartDate,
|
|
4206
|
+
ma as getWeeklyRegExp,
|
|
4207
|
+
Ia as getWeeksColumns,
|
|
4208
|
+
Ys as getWildCardPrefix,
|
|
4209
|
+
Ot as getYearPeriod,
|
|
4210
|
+
Pe as getYearlyRegExp,
|
|
4211
|
+
Ra as getYears,
|
|
4212
|
+
fa as isDaily,
|
|
4213
|
+
Ae as isMonthly,
|
|
4214
|
+
Re as isQuarterly,
|
|
4215
|
+
Me as isSemiAnnually,
|
|
4216
|
+
ke as isWeekly,
|
|
4217
|
+
Cs as isWildCardVersionCorrect,
|
|
4218
|
+
ve as isYearly,
|
|
4219
|
+
ua as monthlyPattern,
|
|
4220
|
+
ao as openDownloadWindow,
|
|
4221
|
+
sa as quarterPattern,
|
|
4222
|
+
go as resolveCodelistsFromResponse,
|
|
4223
|
+
oa as semiAnnuallyPattern,
|
|
4224
|
+
fo as sortPeriods,
|
|
4225
|
+
C as splitUrn,
|
|
4226
|
+
qa as urnMatchesIgnoreVersion,
|
|
4227
|
+
aa as weeklyPattern,
|
|
4228
|
+
ia as yearlyPattern
|
|
4089
4229
|
};
|