@epam/statgpt-sdmx-toolkit 0.4.0 → 0.4.1
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/sdmx-api-client.d.ts +1 -1
- package/index.cjs +2 -2
- package/index.mjs +626 -614
- package/package.json +3 -3
- package/utils/get-file-headers.d.ts +1 -0
package/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ const z = (t) => {
|
|
|
3
3
|
const e = t.split("=");
|
|
4
4
|
return e.length === 1 ? t : e[1];
|
|
5
5
|
}
|
|
6
|
-
},
|
|
6
|
+
}, S = (t) => {
|
|
7
7
|
if (t == null)
|
|
8
8
|
return {};
|
|
9
9
|
const e = z(t), n = {
|
|
@@ -13,7 +13,7 @@ const z = (t) => {
|
|
|
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
15
|
}, nt = (t) => {
|
|
16
|
-
const [e, n] = t.split(")."), { agency: r, id: s, version: a } =
|
|
16
|
+
const [e, n] = t.split(")."), { agency: r, id: s, version: a } = S(e + ")");
|
|
17
17
|
return { childId: n, agency: r, id: s, version: a };
|
|
18
18
|
}, ue = (t, e, n) => {
|
|
19
19
|
const r = e === "" ? "" : `(${e})`;
|
|
@@ -57,12 +57,12 @@ function It(t) {
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
const Yt = (t = "", e = "", n = "") => `sdmx/3.0/availability/dataflow/${t}/${e}/${n}`;
|
|
60
|
-
class
|
|
60
|
+
class Ha {
|
|
61
61
|
constructor(e) {
|
|
62
62
|
this.client = e;
|
|
63
63
|
}
|
|
64
64
|
async getConstraints(e, n, r) {
|
|
65
|
-
const { agency: s, id: a, version: o } =
|
|
65
|
+
const { agency: s, id: a, version: o } = S(e), c = {
|
|
66
66
|
filters: n || [],
|
|
67
67
|
mode: rt.AVAILABLE,
|
|
68
68
|
references: de.NONE
|
|
@@ -84,17 +84,17 @@ class Ua {
|
|
|
84
84
|
);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
var
|
|
87
|
+
var C = /* @__PURE__ */ ((t) => (t.CSV = "csv", t.JSON = "json", t.XML = "xml", t))(C || {}), 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
88
|
const Lt = (t, e) => {
|
|
89
89
|
switch (t) {
|
|
90
|
-
case
|
|
90
|
+
case C.CSV:
|
|
91
91
|
return _e(
|
|
92
92
|
"application/vnd.sdmx.data+csv;version=2.0.0",
|
|
93
93
|
e
|
|
94
94
|
);
|
|
95
|
-
case
|
|
95
|
+
case C.XML:
|
|
96
96
|
return "application/vnd.sdmx.data+xml;version=3.0.0";
|
|
97
|
-
case
|
|
97
|
+
case C.JSON:
|
|
98
98
|
return "application/vnd.sdmx.data+json;version=2.1";
|
|
99
99
|
default:
|
|
100
100
|
return _e(
|
|
@@ -102,20 +102,31 @@ const Lt = (t, e) => {
|
|
|
102
102
|
e
|
|
103
103
|
);
|
|
104
104
|
}
|
|
105
|
+
}, $t = (t) => {
|
|
106
|
+
switch (t) {
|
|
107
|
+
case C.CSV:
|
|
108
|
+
return "text/csv; charset=utf-8";
|
|
109
|
+
case C.XML:
|
|
110
|
+
return "application/xml; charset=utf-8";
|
|
111
|
+
case C.JSON:
|
|
112
|
+
return "application/json; charset=utf-8";
|
|
113
|
+
default:
|
|
114
|
+
return "text/csv; charset=utf-8";
|
|
115
|
+
}
|
|
105
116
|
}, _e = (t, e) => `${t}; labels=${e}`;
|
|
106
117
|
var st = /* @__PURE__ */ ((t) => (t.REFERENCE_PARTIAL = "referencepartial", t.FULL = "full", t))(st || {});
|
|
107
|
-
const
|
|
108
|
-
const { filterKey: r, timeFilter: s } = n, { agency: a, id: o, version: c } =
|
|
109
|
-
return `${`${
|
|
110
|
-
},
|
|
111
|
-
class
|
|
118
|
+
const Wt = "all", qt = "sdmx/3.0/data/dataflow", Ut = "&", Ie = ":", Ht = "=", at = "+", Fa = ",", Ft = "*", Ye = (t, e, n) => {
|
|
119
|
+
const { filterKey: r, timeFilter: s } = n, { agency: a, id: o, version: c } = S(t), i = [s || "", e].filter((d) => !!d).join(Ut);
|
|
120
|
+
return `${`${qt}/${a}/${o}/${c}`}/${r || Ft}?${i}`;
|
|
121
|
+
}, Qt = (t = "", e = "", n = "", r = de.DESCENDANTS) => `sdmx/3.0/structure/dataflow/${t}/${e}/${n}?references=${r}&detail=${st.REFERENCE_PARTIAL}`;
|
|
122
|
+
class Qa {
|
|
112
123
|
constructor(e) {
|
|
113
124
|
this.client = e;
|
|
114
125
|
}
|
|
115
126
|
async getDataSet(e, n, r) {
|
|
116
|
-
const { agency: s, id: a, version: o } =
|
|
127
|
+
const { agency: s, id: a, version: o } = S(e);
|
|
117
128
|
return await this.client.getRequest(
|
|
118
|
-
|
|
129
|
+
Qt(s, a, o, n),
|
|
119
130
|
void 0,
|
|
120
131
|
r
|
|
121
132
|
);
|
|
@@ -124,7 +135,7 @@ class Fa {
|
|
|
124
135
|
const s = new URLSearchParams({
|
|
125
136
|
includeHistory: "false",
|
|
126
137
|
limit: "1000",
|
|
127
|
-
attributes:
|
|
138
|
+
attributes: Wt,
|
|
128
139
|
dimensionAtObservation: "TIME_PERIOD"
|
|
129
140
|
// TODO: use time dimensions
|
|
130
141
|
}).toString(), a = Ye(e, s, n);
|
|
@@ -150,48 +161,49 @@ class Fa {
|
|
|
150
161
|
}
|
|
151
162
|
},
|
|
152
163
|
o,
|
|
153
|
-
i
|
|
164
|
+
i,
|
|
165
|
+
$t(n)
|
|
154
166
|
);
|
|
155
167
|
}
|
|
156
168
|
}
|
|
157
|
-
const
|
|
169
|
+
const Bt = (t, e) => t.error || t.message || `${e.status} ${e.statusText}`, Vt = "application/json", Gt = "Content-Type", X = "Api-Key", Xt = "X-CONVERSATION-ID", j = "Ocp-Apim-Subscription-Key", Ce = "X-Source-Artefact-Urn";
|
|
158
170
|
class Se extends Error {
|
|
159
171
|
constructor(e) {
|
|
160
172
|
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;
|
|
161
173
|
}
|
|
162
174
|
}
|
|
163
|
-
const ot = 6048e5,
|
|
175
|
+
const ot = 6048e5, jt = 864e5, le = 6e4, fe = 36e5, zt = 1e3, Le = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
164
176
|
function E(t, e) {
|
|
165
177
|
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);
|
|
166
178
|
}
|
|
167
|
-
function
|
|
179
|
+
function y(t, e) {
|
|
168
180
|
return E(e || t, t);
|
|
169
181
|
}
|
|
170
182
|
function it(t, e, n) {
|
|
171
|
-
const r =
|
|
183
|
+
const r = y(t, n?.in);
|
|
172
184
|
return isNaN(e) ? E(n?.in || t, NaN) : (e && r.setDate(r.getDate() + e), r);
|
|
173
185
|
}
|
|
174
|
-
let
|
|
175
|
-
function
|
|
176
|
-
return
|
|
186
|
+
let Kt = {};
|
|
187
|
+
function W() {
|
|
188
|
+
return Kt;
|
|
177
189
|
}
|
|
178
190
|
function I(t, e) {
|
|
179
|
-
const n =
|
|
191
|
+
const n = W(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, s = y(t, e?.in), a = s.getDay(), o = (a < r ? 7 : 0) + a - r;
|
|
180
192
|
return s.setDate(s.getDate() - o), s.setHours(0, 0, 0, 0), s;
|
|
181
193
|
}
|
|
182
|
-
function
|
|
194
|
+
function $(t, e) {
|
|
183
195
|
return I(t, { ...e, weekStartsOn: 1 });
|
|
184
196
|
}
|
|
185
197
|
function ct(t, e) {
|
|
186
|
-
const n =
|
|
198
|
+
const n = y(t, e?.in), r = n.getFullYear(), s = E(n, 0);
|
|
187
199
|
s.setFullYear(r + 1, 0, 4), s.setHours(0, 0, 0, 0);
|
|
188
|
-
const a =
|
|
200
|
+
const a = $(s), o = E(n, 0);
|
|
189
201
|
o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0);
|
|
190
|
-
const c =
|
|
202
|
+
const c = $(o);
|
|
191
203
|
return n.getTime() >= a.getTime() ? r + 1 : n.getTime() >= c.getTime() ? r : r - 1;
|
|
192
204
|
}
|
|
193
205
|
function K(t) {
|
|
194
|
-
const e =
|
|
206
|
+
const e = y(t), n = new Date(
|
|
195
207
|
Date.UTC(
|
|
196
208
|
e.getFullYear(),
|
|
197
209
|
e.getMonth(),
|
|
@@ -204,7 +216,7 @@ function K(t) {
|
|
|
204
216
|
);
|
|
205
217
|
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
206
218
|
}
|
|
207
|
-
function
|
|
219
|
+
function Jt(t, ...e) {
|
|
208
220
|
const n = E.bind(
|
|
209
221
|
null,
|
|
210
222
|
e.find((r) => typeof r == "object")
|
|
@@ -212,32 +224,32 @@ function Kt(t, ...e) {
|
|
|
212
224
|
return e.map(n);
|
|
213
225
|
}
|
|
214
226
|
function $e(t, e) {
|
|
215
|
-
const n =
|
|
227
|
+
const n = y(t, e?.in);
|
|
216
228
|
return n.setHours(0, 0, 0, 0), n;
|
|
217
229
|
}
|
|
218
|
-
function
|
|
219
|
-
const [r, s] =
|
|
230
|
+
function Zt(t, e, n) {
|
|
231
|
+
const [r, s] = Jt(
|
|
220
232
|
n?.in,
|
|
221
233
|
t,
|
|
222
234
|
e
|
|
223
235
|
), a = $e(r), o = $e(s), c = +a - K(a), i = +o - K(o);
|
|
224
|
-
return Math.round((c - i) /
|
|
236
|
+
return Math.round((c - i) / jt);
|
|
225
237
|
}
|
|
226
|
-
function
|
|
238
|
+
function en(t, e) {
|
|
227
239
|
const n = ct(t, e), r = E(t, 0);
|
|
228
|
-
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0),
|
|
240
|
+
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), $(r);
|
|
229
241
|
}
|
|
230
|
-
function
|
|
242
|
+
function tn(t) {
|
|
231
243
|
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
232
244
|
}
|
|
233
245
|
function ne(t) {
|
|
234
|
-
return !(!
|
|
246
|
+
return !(!tn(t) && typeof t != "number" || isNaN(+y(t)));
|
|
235
247
|
}
|
|
236
|
-
function
|
|
237
|
-
const n =
|
|
248
|
+
function nn(t, e) {
|
|
249
|
+
const n = y(t, e?.in);
|
|
238
250
|
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
239
251
|
}
|
|
240
|
-
const
|
|
252
|
+
const rn = {
|
|
241
253
|
lessThanXSeconds: {
|
|
242
254
|
one: "less than a second",
|
|
243
255
|
other: "less than {{count}} seconds"
|
|
@@ -299,9 +311,9 @@ const nn = {
|
|
|
299
311
|
one: "almost 1 year",
|
|
300
312
|
other: "almost {{count}} years"
|
|
301
313
|
}
|
|
302
|
-
},
|
|
314
|
+
}, sn = (t, e, n) => {
|
|
303
315
|
let r;
|
|
304
|
-
const s =
|
|
316
|
+
const s = rn[t];
|
|
305
317
|
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;
|
|
306
318
|
};
|
|
307
319
|
function ee(t) {
|
|
@@ -310,43 +322,43 @@ function ee(t) {
|
|
|
310
322
|
return t.formats[n] || t.formats[t.defaultWidth];
|
|
311
323
|
};
|
|
312
324
|
}
|
|
313
|
-
const
|
|
325
|
+
const an = {
|
|
314
326
|
full: "EEEE, MMMM do, y",
|
|
315
327
|
long: "MMMM do, y",
|
|
316
328
|
medium: "MMM d, y",
|
|
317
329
|
short: "MM/dd/yyyy"
|
|
318
|
-
},
|
|
330
|
+
}, on = {
|
|
319
331
|
full: "h:mm:ss a zzzz",
|
|
320
332
|
long: "h:mm:ss a z",
|
|
321
333
|
medium: "h:mm:ss a",
|
|
322
334
|
short: "h:mm a"
|
|
323
|
-
},
|
|
335
|
+
}, cn = {
|
|
324
336
|
full: "{{date}} 'at' {{time}}",
|
|
325
337
|
long: "{{date}} 'at' {{time}}",
|
|
326
338
|
medium: "{{date}}, {{time}}",
|
|
327
339
|
short: "{{date}}, {{time}}"
|
|
328
|
-
},
|
|
340
|
+
}, un = {
|
|
329
341
|
date: ee({
|
|
330
|
-
formats:
|
|
342
|
+
formats: an,
|
|
331
343
|
defaultWidth: "full"
|
|
332
344
|
}),
|
|
333
345
|
time: ee({
|
|
334
|
-
formats:
|
|
346
|
+
formats: on,
|
|
335
347
|
defaultWidth: "full"
|
|
336
348
|
}),
|
|
337
349
|
dateTime: ee({
|
|
338
|
-
formats:
|
|
350
|
+
formats: cn,
|
|
339
351
|
defaultWidth: "full"
|
|
340
352
|
})
|
|
341
|
-
},
|
|
353
|
+
}, dn = {
|
|
342
354
|
lastWeek: "'last' eeee 'at' p",
|
|
343
355
|
yesterday: "'yesterday at' p",
|
|
344
356
|
today: "'today at' p",
|
|
345
357
|
tomorrow: "'tomorrow at' p",
|
|
346
358
|
nextWeek: "eeee 'at' p",
|
|
347
359
|
other: "P"
|
|
348
|
-
},
|
|
349
|
-
function
|
|
360
|
+
}, ln = (t, e, n, r) => dn[t];
|
|
361
|
+
function H(t) {
|
|
350
362
|
return (e, n) => {
|
|
351
363
|
const r = n?.context ? String(n.context) : "standalone";
|
|
352
364
|
let s;
|
|
@@ -361,15 +373,15 @@ function U(t) {
|
|
|
361
373
|
return s[a];
|
|
362
374
|
};
|
|
363
375
|
}
|
|
364
|
-
const
|
|
376
|
+
const fn = {
|
|
365
377
|
narrow: ["B", "A"],
|
|
366
378
|
abbreviated: ["BC", "AD"],
|
|
367
379
|
wide: ["Before Christ", "Anno Domini"]
|
|
368
|
-
},
|
|
380
|
+
}, mn = {
|
|
369
381
|
narrow: ["1", "2", "3", "4"],
|
|
370
382
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
371
383
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
372
|
-
},
|
|
384
|
+
}, hn = {
|
|
373
385
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
374
386
|
abbreviated: [
|
|
375
387
|
"Jan",
|
|
@@ -399,7 +411,7 @@ const ln = {
|
|
|
399
411
|
"November",
|
|
400
412
|
"December"
|
|
401
413
|
]
|
|
402
|
-
},
|
|
414
|
+
}, gn = {
|
|
403
415
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
404
416
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
405
417
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -412,7 +424,7 @@ const ln = {
|
|
|
412
424
|
"Friday",
|
|
413
425
|
"Saturday"
|
|
414
426
|
]
|
|
415
|
-
},
|
|
427
|
+
}, wn = {
|
|
416
428
|
narrow: {
|
|
417
429
|
am: "a",
|
|
418
430
|
pm: "p",
|
|
@@ -443,7 +455,7 @@ const ln = {
|
|
|
443
455
|
evening: "evening",
|
|
444
456
|
night: "night"
|
|
445
457
|
}
|
|
446
|
-
},
|
|
458
|
+
}, pn = {
|
|
447
459
|
narrow: {
|
|
448
460
|
am: "a",
|
|
449
461
|
pm: "p",
|
|
@@ -486,40 +498,40 @@ const ln = {
|
|
|
486
498
|
return n + "rd";
|
|
487
499
|
}
|
|
488
500
|
return n + "th";
|
|
489
|
-
},
|
|
501
|
+
}, bn = {
|
|
490
502
|
ordinalNumber: yn,
|
|
491
|
-
era:
|
|
492
|
-
values:
|
|
503
|
+
era: H({
|
|
504
|
+
values: fn,
|
|
493
505
|
defaultWidth: "wide"
|
|
494
506
|
}),
|
|
495
|
-
quarter:
|
|
496
|
-
values:
|
|
507
|
+
quarter: H({
|
|
508
|
+
values: mn,
|
|
497
509
|
defaultWidth: "wide",
|
|
498
510
|
argumentCallback: (t) => t - 1
|
|
499
511
|
}),
|
|
500
|
-
month:
|
|
501
|
-
values: mn,
|
|
502
|
-
defaultWidth: "wide"
|
|
503
|
-
}),
|
|
504
|
-
day: U({
|
|
512
|
+
month: H({
|
|
505
513
|
values: hn,
|
|
506
514
|
defaultWidth: "wide"
|
|
507
515
|
}),
|
|
508
|
-
|
|
516
|
+
day: H({
|
|
509
517
|
values: gn,
|
|
518
|
+
defaultWidth: "wide"
|
|
519
|
+
}),
|
|
520
|
+
dayPeriod: H({
|
|
521
|
+
values: wn,
|
|
510
522
|
defaultWidth: "wide",
|
|
511
|
-
formattingValues:
|
|
523
|
+
formattingValues: pn,
|
|
512
524
|
defaultFormattingWidth: "wide"
|
|
513
525
|
})
|
|
514
526
|
};
|
|
515
|
-
function
|
|
527
|
+
function F(t) {
|
|
516
528
|
return (e, n = {}) => {
|
|
517
529
|
const r = n.width, s = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], a = e.match(s);
|
|
518
530
|
if (!a)
|
|
519
531
|
return null;
|
|
520
|
-
const o = a[0], c = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], i = Array.isArray(c) ?
|
|
532
|
+
const o = a[0], c = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], i = Array.isArray(c) ? Tn(c, (l) => l.test(o)) : (
|
|
521
533
|
// [TODO] -- I challenge you to fix the type
|
|
522
|
-
|
|
534
|
+
Dn(c, (l) => l.test(o))
|
|
523
535
|
);
|
|
524
536
|
let u;
|
|
525
537
|
u = t.valueCallback ? t.valueCallback(i) : i, u = n.valueCallback ? (
|
|
@@ -530,17 +542,17 @@ function H(t) {
|
|
|
530
542
|
return { value: u, rest: d };
|
|
531
543
|
};
|
|
532
544
|
}
|
|
533
|
-
function
|
|
545
|
+
function Dn(t, e) {
|
|
534
546
|
for (const n in t)
|
|
535
547
|
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
536
548
|
return n;
|
|
537
549
|
}
|
|
538
|
-
function
|
|
550
|
+
function Tn(t, e) {
|
|
539
551
|
for (let n = 0; n < t.length; n++)
|
|
540
552
|
if (e(t[n]))
|
|
541
553
|
return n;
|
|
542
554
|
}
|
|
543
|
-
function
|
|
555
|
+
function En(t) {
|
|
544
556
|
return (e, n = {}) => {
|
|
545
557
|
const r = e.match(t.matchPattern);
|
|
546
558
|
if (!r) return null;
|
|
@@ -552,23 +564,23 @@ function Tn(t) {
|
|
|
552
564
|
return { value: o, rest: c };
|
|
553
565
|
};
|
|
554
566
|
}
|
|
555
|
-
const
|
|
567
|
+
const xn = /^(\d+)(th|st|nd|rd)?/i, Pn = /\d+/i, vn = {
|
|
556
568
|
narrow: /^(b|a)/i,
|
|
557
569
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
558
570
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
559
|
-
}, vn = {
|
|
560
|
-
any: [/^b/i, /^(a|c)/i]
|
|
561
571
|
}, Mn = {
|
|
572
|
+
any: [/^b/i, /^(a|c)/i]
|
|
573
|
+
}, On = {
|
|
562
574
|
narrow: /^[1234]/i,
|
|
563
575
|
abbreviated: /^q[1234]/i,
|
|
564
576
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
565
|
-
}, On = {
|
|
566
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
567
577
|
}, An = {
|
|
578
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
579
|
+
}, Nn = {
|
|
568
580
|
narrow: /^[jfmasond]/i,
|
|
569
581
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
570
582
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
571
|
-
},
|
|
583
|
+
}, Rn = {
|
|
572
584
|
narrow: [
|
|
573
585
|
/^j/i,
|
|
574
586
|
/^f/i,
|
|
@@ -597,18 +609,18 @@ const En = /^(\d+)(th|st|nd|rd)?/i, xn = /\d+/i, Pn = {
|
|
|
597
609
|
/^n/i,
|
|
598
610
|
/^d/i
|
|
599
611
|
]
|
|
600
|
-
},
|
|
612
|
+
}, kn = {
|
|
601
613
|
narrow: /^[smtwf]/i,
|
|
602
614
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
603
615
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
604
616
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
605
|
-
},
|
|
617
|
+
}, _n = {
|
|
606
618
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
607
619
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
608
|
-
},
|
|
620
|
+
}, In = {
|
|
609
621
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
610
622
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
611
|
-
},
|
|
623
|
+
}, Yn = {
|
|
612
624
|
any: {
|
|
613
625
|
am: /^a/i,
|
|
614
626
|
pm: /^p/i,
|
|
@@ -619,77 +631,77 @@ const En = /^(\d+)(th|st|nd|rd)?/i, xn = /\d+/i, Pn = {
|
|
|
619
631
|
evening: /evening/i,
|
|
620
632
|
night: /night/i
|
|
621
633
|
}
|
|
622
|
-
},
|
|
623
|
-
ordinalNumber:
|
|
624
|
-
matchPattern:
|
|
625
|
-
parsePattern:
|
|
634
|
+
}, Cn = {
|
|
635
|
+
ordinalNumber: En({
|
|
636
|
+
matchPattern: xn,
|
|
637
|
+
parsePattern: Pn,
|
|
626
638
|
valueCallback: (t) => parseInt(t, 10)
|
|
627
639
|
}),
|
|
628
|
-
era:
|
|
629
|
-
matchPatterns:
|
|
640
|
+
era: F({
|
|
641
|
+
matchPatterns: vn,
|
|
630
642
|
defaultMatchWidth: "wide",
|
|
631
|
-
parsePatterns:
|
|
643
|
+
parsePatterns: Mn,
|
|
632
644
|
defaultParseWidth: "any"
|
|
633
645
|
}),
|
|
634
|
-
quarter:
|
|
635
|
-
matchPatterns:
|
|
646
|
+
quarter: F({
|
|
647
|
+
matchPatterns: On,
|
|
636
648
|
defaultMatchWidth: "wide",
|
|
637
|
-
parsePatterns:
|
|
649
|
+
parsePatterns: An,
|
|
638
650
|
defaultParseWidth: "any",
|
|
639
651
|
valueCallback: (t) => t + 1
|
|
640
652
|
}),
|
|
641
|
-
month:
|
|
642
|
-
matchPatterns:
|
|
653
|
+
month: F({
|
|
654
|
+
matchPatterns: Nn,
|
|
643
655
|
defaultMatchWidth: "wide",
|
|
644
|
-
parsePatterns:
|
|
656
|
+
parsePatterns: Rn,
|
|
645
657
|
defaultParseWidth: "any"
|
|
646
658
|
}),
|
|
647
|
-
day:
|
|
648
|
-
matchPatterns:
|
|
659
|
+
day: F({
|
|
660
|
+
matchPatterns: kn,
|
|
649
661
|
defaultMatchWidth: "wide",
|
|
650
|
-
parsePatterns:
|
|
662
|
+
parsePatterns: _n,
|
|
651
663
|
defaultParseWidth: "any"
|
|
652
664
|
}),
|
|
653
|
-
dayPeriod:
|
|
654
|
-
matchPatterns:
|
|
665
|
+
dayPeriod: F({
|
|
666
|
+
matchPatterns: In,
|
|
655
667
|
defaultMatchWidth: "any",
|
|
656
|
-
parsePatterns:
|
|
668
|
+
parsePatterns: Yn,
|
|
657
669
|
defaultParseWidth: "any"
|
|
658
670
|
})
|
|
659
671
|
}, ut = {
|
|
660
672
|
code: "en-US",
|
|
661
|
-
formatDistance:
|
|
662
|
-
formatLong:
|
|
663
|
-
formatRelative:
|
|
664
|
-
localize:
|
|
665
|
-
match:
|
|
673
|
+
formatDistance: sn,
|
|
674
|
+
formatLong: un,
|
|
675
|
+
formatRelative: ln,
|
|
676
|
+
localize: bn,
|
|
677
|
+
match: Cn,
|
|
666
678
|
options: {
|
|
667
679
|
weekStartsOn: 0,
|
|
668
680
|
firstWeekContainsDate: 1
|
|
669
681
|
}
|
|
670
682
|
};
|
|
671
|
-
function
|
|
672
|
-
const n =
|
|
673
|
-
return
|
|
683
|
+
function Sn(t, e) {
|
|
684
|
+
const n = y(t, e?.in);
|
|
685
|
+
return Zt(n, nn(n)) + 1;
|
|
674
686
|
}
|
|
675
687
|
function dt(t, e) {
|
|
676
|
-
const n =
|
|
688
|
+
const n = y(t, e?.in), r = +$(n) - +en(n);
|
|
677
689
|
return Math.round(r / ot) + 1;
|
|
678
690
|
}
|
|
679
691
|
function me(t, e) {
|
|
680
|
-
const n =
|
|
692
|
+
const n = y(t, e?.in), r = n.getFullYear(), s = W(), a = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? s.firstWeekContainsDate ?? s.locale?.options?.firstWeekContainsDate ?? 1, o = E(e?.in || t, 0);
|
|
681
693
|
o.setFullYear(r + 1, 0, a), o.setHours(0, 0, 0, 0);
|
|
682
694
|
const c = I(o, e), i = E(e?.in || t, 0);
|
|
683
695
|
i.setFullYear(r, 0, a), i.setHours(0, 0, 0, 0);
|
|
684
696
|
const u = I(i, e);
|
|
685
697
|
return +n >= +c ? r + 1 : +n >= +u ? r : r - 1;
|
|
686
698
|
}
|
|
687
|
-
function
|
|
688
|
-
const n =
|
|
699
|
+
function Ln(t, e) {
|
|
700
|
+
const n = W(), 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
701
|
return a.setFullYear(s, 0, r), a.setHours(0, 0, 0, 0), I(a, e);
|
|
690
702
|
}
|
|
691
703
|
function lt(t, e) {
|
|
692
|
-
const n =
|
|
704
|
+
const n = y(t, e?.in), r = +I(n, e) - +Ln(n, e);
|
|
693
705
|
return Math.round(r / ot) + 1;
|
|
694
706
|
}
|
|
695
707
|
function g(t, e) {
|
|
@@ -749,7 +761,7 @@ const R = {
|
|
|
749
761
|
);
|
|
750
762
|
return g(s, e.length);
|
|
751
763
|
}
|
|
752
|
-
},
|
|
764
|
+
}, L = {
|
|
753
765
|
midnight: "midnight",
|
|
754
766
|
noon: "noon",
|
|
755
767
|
morning: "morning",
|
|
@@ -943,7 +955,7 @@ const R = {
|
|
|
943
955
|
},
|
|
944
956
|
// Day of year
|
|
945
957
|
D: function(t, e, n) {
|
|
946
|
-
const r =
|
|
958
|
+
const r = Sn(t);
|
|
947
959
|
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : g(r, e.length);
|
|
948
960
|
},
|
|
949
961
|
// Day of week
|
|
@@ -1120,7 +1132,7 @@ const R = {
|
|
|
1120
1132
|
b: function(t, e, n) {
|
|
1121
1133
|
const r = t.getHours();
|
|
1122
1134
|
let s;
|
|
1123
|
-
switch (r === 12 ? s =
|
|
1135
|
+
switch (r === 12 ? s = L.noon : r === 0 ? s = L.midnight : s = r / 12 >= 1 ? "pm" : "am", e) {
|
|
1124
1136
|
case "b":
|
|
1125
1137
|
case "bb":
|
|
1126
1138
|
return n.dayPeriod(s, {
|
|
@@ -1148,7 +1160,7 @@ const R = {
|
|
|
1148
1160
|
B: function(t, e, n) {
|
|
1149
1161
|
const r = t.getHours();
|
|
1150
1162
|
let s;
|
|
1151
|
-
switch (r >= 17 ? s =
|
|
1163
|
+
switch (r >= 17 ? s = L.evening : r >= 12 ? s = L.afternoon : r >= 4 ? s = L.morning : s = L.night, e) {
|
|
1152
1164
|
case "B":
|
|
1153
1165
|
case "BB":
|
|
1154
1166
|
case "BBB":
|
|
@@ -1309,7 +1321,7 @@ const He = (t, e) => {
|
|
|
1309
1321
|
default:
|
|
1310
1322
|
return e.time({ width: "full" });
|
|
1311
1323
|
}
|
|
1312
|
-
},
|
|
1324
|
+
}, $n = (t, e) => {
|
|
1313
1325
|
const n = t.match(/(P+)(p+)?/) || [], r = n[1], s = n[2];
|
|
1314
1326
|
if (!s)
|
|
1315
1327
|
return He(t, e);
|
|
@@ -1331,43 +1343,43 @@ const He = (t, e) => {
|
|
|
1331
1343
|
return a.replace("{{date}}", He(r, e)).replace("{{time}}", ft(s, e));
|
|
1332
1344
|
}, re = {
|
|
1333
1345
|
p: ft,
|
|
1334
|
-
P:
|
|
1335
|
-
},
|
|
1346
|
+
P: $n
|
|
1347
|
+
}, Wn = /^D+$/, qn = /^Y+$/, Un = ["D", "DD", "YY", "YYYY"];
|
|
1336
1348
|
function mt(t) {
|
|
1337
|
-
return
|
|
1349
|
+
return Wn.test(t);
|
|
1338
1350
|
}
|
|
1339
1351
|
function ht(t) {
|
|
1340
|
-
return
|
|
1352
|
+
return qn.test(t);
|
|
1341
1353
|
}
|
|
1342
1354
|
function se(t, e, n) {
|
|
1343
|
-
const r =
|
|
1344
|
-
if (console.warn(r),
|
|
1355
|
+
const r = Hn(t, e, n);
|
|
1356
|
+
if (console.warn(r), Un.includes(t)) throw new RangeError(r);
|
|
1345
1357
|
}
|
|
1346
|
-
function
|
|
1358
|
+
function Hn(t, e, n) {
|
|
1347
1359
|
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
1348
1360
|
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`;
|
|
1349
1361
|
}
|
|
1350
|
-
const
|
|
1351
|
-
function
|
|
1352
|
-
const r =
|
|
1362
|
+
const Fn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Qn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Bn = /^'([^]*?)'?$/, Vn = /''/g, Gn = /[a-zA-Z]/;
|
|
1363
|
+
function Xn(t, e, n) {
|
|
1364
|
+
const r = W(), s = r.locale ?? ut, a = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, c = y(t, n?.in);
|
|
1353
1365
|
if (!ne(c))
|
|
1354
1366
|
throw new RangeError("Invalid time value");
|
|
1355
|
-
let i = e.match(
|
|
1367
|
+
let i = e.match(Qn).map((d) => {
|
|
1356
1368
|
const l = d[0];
|
|
1357
1369
|
if (l === "p" || l === "P") {
|
|
1358
1370
|
const m = re[l];
|
|
1359
1371
|
return m(d, s.formatLong);
|
|
1360
1372
|
}
|
|
1361
1373
|
return d;
|
|
1362
|
-
}).join("").match(
|
|
1374
|
+
}).join("").match(Fn).map((d) => {
|
|
1363
1375
|
if (d === "''")
|
|
1364
1376
|
return { isToken: !1, value: "'" };
|
|
1365
1377
|
const l = d[0];
|
|
1366
1378
|
if (l === "'")
|
|
1367
|
-
return { isToken: !1, value:
|
|
1379
|
+
return { isToken: !1, value: jn(d) };
|
|
1368
1380
|
if (We[l])
|
|
1369
1381
|
return { isToken: !0, value: d };
|
|
1370
|
-
if (l.match(
|
|
1382
|
+
if (l.match(Gn))
|
|
1371
1383
|
throw new RangeError(
|
|
1372
1384
|
"Format string contains an unescaped latin alphabet character `" + l + "`"
|
|
1373
1385
|
);
|
|
@@ -1387,19 +1399,19 @@ function Gn(t, e, n) {
|
|
|
1387
1399
|
return m(c, l, s.localize, u);
|
|
1388
1400
|
}).join("");
|
|
1389
1401
|
}
|
|
1390
|
-
function
|
|
1391
|
-
const e = t.match(
|
|
1392
|
-
return e ? e[1].replace(
|
|
1402
|
+
function jn(t) {
|
|
1403
|
+
const e = t.match(Bn);
|
|
1404
|
+
return e ? e[1].replace(Vn, "'") : t;
|
|
1393
1405
|
}
|
|
1394
|
-
function
|
|
1395
|
-
return Object.assign({},
|
|
1406
|
+
function zn() {
|
|
1407
|
+
return Object.assign({}, W());
|
|
1396
1408
|
}
|
|
1397
|
-
function
|
|
1398
|
-
const n =
|
|
1409
|
+
function Kn(t, e) {
|
|
1410
|
+
const n = y(t, e?.in).getDay();
|
|
1399
1411
|
return n === 0 ? 7 : n;
|
|
1400
1412
|
}
|
|
1401
|
-
function
|
|
1402
|
-
const n =
|
|
1413
|
+
function Jn(t, e) {
|
|
1414
|
+
const n = Zn(e) ? new e(0) : E(e, 0);
|
|
1403
1415
|
return n.setFullYear(t.getFullYear(), t.getMonth(), t.getDate()), n.setHours(
|
|
1404
1416
|
t.getHours(),
|
|
1405
1417
|
t.getMinutes(),
|
|
@@ -1407,17 +1419,17 @@ function Kn(t, e) {
|
|
|
1407
1419
|
t.getMilliseconds()
|
|
1408
1420
|
), n;
|
|
1409
1421
|
}
|
|
1410
|
-
function
|
|
1422
|
+
function Zn(t) {
|
|
1411
1423
|
return typeof t == "function" && t.prototype?.constructor === t;
|
|
1412
1424
|
}
|
|
1413
|
-
const
|
|
1425
|
+
const er = 10;
|
|
1414
1426
|
class gt {
|
|
1415
1427
|
subPriority = 0;
|
|
1416
1428
|
validate(e, n) {
|
|
1417
1429
|
return !0;
|
|
1418
1430
|
}
|
|
1419
1431
|
}
|
|
1420
|
-
class
|
|
1432
|
+
class tr extends gt {
|
|
1421
1433
|
constructor(e, n, r, s, a) {
|
|
1422
1434
|
super(), this.value = e, this.validateValue = n, this.setValue = r, this.priority = s, a && (this.subPriority = a);
|
|
1423
1435
|
}
|
|
@@ -1428,21 +1440,21 @@ class er extends gt {
|
|
|
1428
1440
|
return this.setValue(e, n, this.value, r);
|
|
1429
1441
|
}
|
|
1430
1442
|
}
|
|
1431
|
-
class
|
|
1432
|
-
priority =
|
|
1443
|
+
class nr extends gt {
|
|
1444
|
+
priority = er;
|
|
1433
1445
|
subPriority = -1;
|
|
1434
1446
|
constructor(e, n) {
|
|
1435
1447
|
super(), this.context = e || ((r) => E(n, r));
|
|
1436
1448
|
}
|
|
1437
1449
|
set(e, n) {
|
|
1438
|
-
return n.timestampIsSet ? e : E(e,
|
|
1450
|
+
return n.timestampIsSet ? e : E(e, Jn(e, this.context));
|
|
1439
1451
|
}
|
|
1440
1452
|
}
|
|
1441
1453
|
class h {
|
|
1442
1454
|
run(e, n, r, s) {
|
|
1443
1455
|
const a = this.parse(e, n, r, s);
|
|
1444
1456
|
return a ? {
|
|
1445
|
-
setter: new
|
|
1457
|
+
setter: new tr(
|
|
1446
1458
|
a.value,
|
|
1447
1459
|
this.validate,
|
|
1448
1460
|
this.set,
|
|
@@ -1456,7 +1468,7 @@ class h {
|
|
|
1456
1468
|
return !0;
|
|
1457
1469
|
}
|
|
1458
1470
|
}
|
|
1459
|
-
class
|
|
1471
|
+
class rr extends h {
|
|
1460
1472
|
priority = 140;
|
|
1461
1473
|
parse(e, n, r) {
|
|
1462
1474
|
switch (n) {
|
|
@@ -1515,7 +1527,7 @@ const D = {
|
|
|
1515
1527
|
// 0 to 999, -0 to -999
|
|
1516
1528
|
fourDigitsSigned: /^-?\d{1,4}/
|
|
1517
1529
|
// 0 to 9999, -0 to -9999
|
|
1518
|
-
},
|
|
1530
|
+
}, A = {
|
|
1519
1531
|
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
1520
1532
|
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
1521
1533
|
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
@@ -1528,14 +1540,14 @@ function T(t, e) {
|
|
|
1528
1540
|
rest: t.rest
|
|
1529
1541
|
};
|
|
1530
1542
|
}
|
|
1531
|
-
function
|
|
1543
|
+
function p(t, e) {
|
|
1532
1544
|
const n = e.match(t);
|
|
1533
1545
|
return n ? {
|
|
1534
1546
|
value: parseInt(n[0], 10),
|
|
1535
1547
|
rest: e.slice(n[0].length)
|
|
1536
1548
|
} : null;
|
|
1537
1549
|
}
|
|
1538
|
-
function
|
|
1550
|
+
function N(t, e) {
|
|
1539
1551
|
const n = e.match(t);
|
|
1540
1552
|
if (!n)
|
|
1541
1553
|
return null;
|
|
@@ -1546,39 +1558,39 @@ function A(t, e) {
|
|
|
1546
1558
|
};
|
|
1547
1559
|
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;
|
|
1548
1560
|
return {
|
|
1549
|
-
value: r * (s * fe + a * le + o *
|
|
1561
|
+
value: r * (s * fe + a * le + o * zt),
|
|
1550
1562
|
rest: e.slice(n[0].length)
|
|
1551
1563
|
};
|
|
1552
1564
|
}
|
|
1553
1565
|
function wt(t) {
|
|
1554
|
-
return
|
|
1566
|
+
return p(D.anyDigitsSigned, t);
|
|
1555
1567
|
}
|
|
1556
1568
|
function b(t, e) {
|
|
1557
1569
|
switch (t) {
|
|
1558
1570
|
case 1:
|
|
1559
|
-
return
|
|
1571
|
+
return p(D.singleDigit, e);
|
|
1560
1572
|
case 2:
|
|
1561
|
-
return
|
|
1573
|
+
return p(D.twoDigits, e);
|
|
1562
1574
|
case 3:
|
|
1563
|
-
return
|
|
1575
|
+
return p(D.threeDigits, e);
|
|
1564
1576
|
case 4:
|
|
1565
|
-
return
|
|
1577
|
+
return p(D.fourDigits, e);
|
|
1566
1578
|
default:
|
|
1567
|
-
return
|
|
1579
|
+
return p(new RegExp("^\\d{1," + t + "}"), e);
|
|
1568
1580
|
}
|
|
1569
1581
|
}
|
|
1570
1582
|
function J(t, e) {
|
|
1571
1583
|
switch (t) {
|
|
1572
1584
|
case 1:
|
|
1573
|
-
return
|
|
1585
|
+
return p(D.singleDigitSigned, e);
|
|
1574
1586
|
case 2:
|
|
1575
|
-
return
|
|
1587
|
+
return p(D.twoDigitsSigned, e);
|
|
1576
1588
|
case 3:
|
|
1577
|
-
return
|
|
1589
|
+
return p(D.threeDigitsSigned, e);
|
|
1578
1590
|
case 4:
|
|
1579
|
-
return
|
|
1591
|
+
return p(D.fourDigitsSigned, e);
|
|
1580
1592
|
default:
|
|
1581
|
-
return
|
|
1593
|
+
return p(new RegExp("^-?\\d{1," + t + "}"), e);
|
|
1582
1594
|
}
|
|
1583
1595
|
}
|
|
1584
1596
|
function he(t) {
|
|
@@ -1595,7 +1607,7 @@ function he(t) {
|
|
|
1595
1607
|
return 0;
|
|
1596
1608
|
}
|
|
1597
1609
|
}
|
|
1598
|
-
function
|
|
1610
|
+
function pt(t, e) {
|
|
1599
1611
|
const n = e > 0, r = n ? e : 1 - e;
|
|
1600
1612
|
let s;
|
|
1601
1613
|
if (r <= 50)
|
|
@@ -1606,10 +1618,10 @@ function yt(t, e) {
|
|
|
1606
1618
|
}
|
|
1607
1619
|
return n ? s : 1 - s;
|
|
1608
1620
|
}
|
|
1609
|
-
function
|
|
1621
|
+
function yt(t) {
|
|
1610
1622
|
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
1611
1623
|
}
|
|
1612
|
-
class
|
|
1624
|
+
class sr extends h {
|
|
1613
1625
|
priority = 130;
|
|
1614
1626
|
incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
|
|
1615
1627
|
parse(e, n, r) {
|
|
@@ -1637,7 +1649,7 @@ class rr extends h {
|
|
|
1637
1649
|
set(e, n, r) {
|
|
1638
1650
|
const s = e.getFullYear();
|
|
1639
1651
|
if (r.isTwoDigitYear) {
|
|
1640
|
-
const o =
|
|
1652
|
+
const o = pt(
|
|
1641
1653
|
r.year,
|
|
1642
1654
|
s
|
|
1643
1655
|
);
|
|
@@ -1647,7 +1659,7 @@ class rr extends h {
|
|
|
1647
1659
|
return e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1648
1660
|
}
|
|
1649
1661
|
}
|
|
1650
|
-
class
|
|
1662
|
+
class ar extends h {
|
|
1651
1663
|
priority = 130;
|
|
1652
1664
|
parse(e, n, r) {
|
|
1653
1665
|
const s = (a) => ({
|
|
@@ -1674,7 +1686,7 @@ class sr extends h {
|
|
|
1674
1686
|
set(e, n, r, s) {
|
|
1675
1687
|
const a = me(e, s);
|
|
1676
1688
|
if (r.isTwoDigitYear) {
|
|
1677
|
-
const c =
|
|
1689
|
+
const c = pt(
|
|
1678
1690
|
r.year,
|
|
1679
1691
|
a
|
|
1680
1692
|
);
|
|
@@ -1703,14 +1715,14 @@ class sr extends h {
|
|
|
1703
1715
|
"T"
|
|
1704
1716
|
];
|
|
1705
1717
|
}
|
|
1706
|
-
class
|
|
1718
|
+
class or extends h {
|
|
1707
1719
|
priority = 130;
|
|
1708
1720
|
parse(e, n) {
|
|
1709
1721
|
return J(n === "R" ? 4 : n.length, e);
|
|
1710
1722
|
}
|
|
1711
1723
|
set(e, n, r) {
|
|
1712
1724
|
const s = E(e, 0);
|
|
1713
|
-
return s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0),
|
|
1725
|
+
return s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0), $(s);
|
|
1714
1726
|
}
|
|
1715
1727
|
incompatibleTokens = [
|
|
1716
1728
|
"G",
|
|
@@ -1730,7 +1742,7 @@ class ar extends h {
|
|
|
1730
1742
|
"T"
|
|
1731
1743
|
];
|
|
1732
1744
|
}
|
|
1733
|
-
class
|
|
1745
|
+
class ir extends h {
|
|
1734
1746
|
priority = 130;
|
|
1735
1747
|
parse(e, n) {
|
|
1736
1748
|
return J(n === "u" ? 4 : n.length, e);
|
|
@@ -1740,7 +1752,7 @@ class or extends h {
|
|
|
1740
1752
|
}
|
|
1741
1753
|
incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
|
|
1742
1754
|
}
|
|
1743
|
-
class
|
|
1755
|
+
class cr extends h {
|
|
1744
1756
|
priority = 120;
|
|
1745
1757
|
parse(e, n, r) {
|
|
1746
1758
|
switch (n) {
|
|
@@ -1802,7 +1814,7 @@ class ir extends h {
|
|
|
1802
1814
|
"T"
|
|
1803
1815
|
];
|
|
1804
1816
|
}
|
|
1805
|
-
class
|
|
1817
|
+
class ur extends h {
|
|
1806
1818
|
priority = 120;
|
|
1807
1819
|
parse(e, n, r) {
|
|
1808
1820
|
switch (n) {
|
|
@@ -1864,7 +1876,7 @@ class cr extends h {
|
|
|
1864
1876
|
"T"
|
|
1865
1877
|
];
|
|
1866
1878
|
}
|
|
1867
|
-
class
|
|
1879
|
+
class dr extends h {
|
|
1868
1880
|
incompatibleTokens = [
|
|
1869
1881
|
"Y",
|
|
1870
1882
|
"R",
|
|
@@ -1887,7 +1899,7 @@ class ur extends h {
|
|
|
1887
1899
|
// 1, 2, ..., 12
|
|
1888
1900
|
case "M":
|
|
1889
1901
|
return T(
|
|
1890
|
-
|
|
1902
|
+
p(D.month, e),
|
|
1891
1903
|
s
|
|
1892
1904
|
);
|
|
1893
1905
|
// 01, 02, ..., 12
|
|
@@ -1927,7 +1939,7 @@ class ur extends h {
|
|
|
1927
1939
|
return e.setMonth(r, 1), e.setHours(0, 0, 0, 0), e;
|
|
1928
1940
|
}
|
|
1929
1941
|
}
|
|
1930
|
-
class
|
|
1942
|
+
class lr extends h {
|
|
1931
1943
|
priority = 110;
|
|
1932
1944
|
parse(e, n, r) {
|
|
1933
1945
|
const s = (a) => a - 1;
|
|
@@ -1935,7 +1947,7 @@ class dr extends h {
|
|
|
1935
1947
|
// 1, 2, ..., 12
|
|
1936
1948
|
case "L":
|
|
1937
1949
|
return T(
|
|
1938
|
-
|
|
1950
|
+
p(D.month, e),
|
|
1939
1951
|
s
|
|
1940
1952
|
);
|
|
1941
1953
|
// 01, 02, ..., 12
|
|
@@ -1990,16 +2002,16 @@ class dr extends h {
|
|
|
1990
2002
|
"T"
|
|
1991
2003
|
];
|
|
1992
2004
|
}
|
|
1993
|
-
function
|
|
1994
|
-
const r =
|
|
1995
|
-
return r.setDate(r.getDate() - s * 7),
|
|
2005
|
+
function fr(t, e, n) {
|
|
2006
|
+
const r = y(t, n?.in), s = lt(r, n) - e;
|
|
2007
|
+
return r.setDate(r.getDate() - s * 7), y(r, n?.in);
|
|
1996
2008
|
}
|
|
1997
|
-
class
|
|
2009
|
+
class mr extends h {
|
|
1998
2010
|
priority = 100;
|
|
1999
2011
|
parse(e, n, r) {
|
|
2000
2012
|
switch (n) {
|
|
2001
2013
|
case "w":
|
|
2002
|
-
return
|
|
2014
|
+
return p(D.week, e);
|
|
2003
2015
|
case "wo":
|
|
2004
2016
|
return r.ordinalNumber(e, { unit: "week" });
|
|
2005
2017
|
default:
|
|
@@ -2010,7 +2022,7 @@ class fr extends h {
|
|
|
2010
2022
|
return n >= 1 && n <= 53;
|
|
2011
2023
|
}
|
|
2012
2024
|
set(e, n, r, s) {
|
|
2013
|
-
return I(
|
|
2025
|
+
return I(fr(e, r, s), s);
|
|
2014
2026
|
}
|
|
2015
2027
|
incompatibleTokens = [
|
|
2016
2028
|
"y",
|
|
@@ -2028,16 +2040,16 @@ class fr extends h {
|
|
|
2028
2040
|
"T"
|
|
2029
2041
|
];
|
|
2030
2042
|
}
|
|
2031
|
-
function
|
|
2032
|
-
const r =
|
|
2043
|
+
function hr(t, e, n) {
|
|
2044
|
+
const r = y(t, n?.in), s = dt(r, n) - e;
|
|
2033
2045
|
return r.setDate(r.getDate() - s * 7), r;
|
|
2034
2046
|
}
|
|
2035
|
-
class
|
|
2047
|
+
class gr extends h {
|
|
2036
2048
|
priority = 100;
|
|
2037
2049
|
parse(e, n, r) {
|
|
2038
2050
|
switch (n) {
|
|
2039
2051
|
case "I":
|
|
2040
|
-
return
|
|
2052
|
+
return p(D.week, e);
|
|
2041
2053
|
case "Io":
|
|
2042
2054
|
return r.ordinalNumber(e, { unit: "week" });
|
|
2043
2055
|
default:
|
|
@@ -2048,7 +2060,7 @@ class hr extends h {
|
|
|
2048
2060
|
return n >= 1 && n <= 53;
|
|
2049
2061
|
}
|
|
2050
2062
|
set(e, n, r) {
|
|
2051
|
-
return
|
|
2063
|
+
return $(hr(e, r));
|
|
2052
2064
|
}
|
|
2053
2065
|
incompatibleTokens = [
|
|
2054
2066
|
"y",
|
|
@@ -2067,7 +2079,7 @@ class hr extends h {
|
|
|
2067
2079
|
"T"
|
|
2068
2080
|
];
|
|
2069
2081
|
}
|
|
2070
|
-
const
|
|
2082
|
+
const wr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], pr = [
|
|
2071
2083
|
31,
|
|
2072
2084
|
29,
|
|
2073
2085
|
31,
|
|
@@ -2087,7 +2099,7 @@ class yr extends h {
|
|
|
2087
2099
|
parse(e, n, r) {
|
|
2088
2100
|
switch (n) {
|
|
2089
2101
|
case "d":
|
|
2090
|
-
return
|
|
2102
|
+
return p(D.date, e);
|
|
2091
2103
|
case "do":
|
|
2092
2104
|
return r.ordinalNumber(e, { unit: "date" });
|
|
2093
2105
|
default:
|
|
@@ -2095,8 +2107,8 @@ class yr extends h {
|
|
|
2095
2107
|
}
|
|
2096
2108
|
}
|
|
2097
2109
|
validate(e, n) {
|
|
2098
|
-
const r = e.getFullYear(), s =
|
|
2099
|
-
return s ? n >= 1 && n <=
|
|
2110
|
+
const r = e.getFullYear(), s = yt(r), a = e.getMonth();
|
|
2111
|
+
return s ? n >= 1 && n <= pr[a] : n >= 1 && n <= wr[a];
|
|
2100
2112
|
}
|
|
2101
2113
|
set(e, n, r) {
|
|
2102
2114
|
return e.setDate(r), e.setHours(0, 0, 0, 0), e;
|
|
@@ -2116,14 +2128,14 @@ class yr extends h {
|
|
|
2116
2128
|
"T"
|
|
2117
2129
|
];
|
|
2118
2130
|
}
|
|
2119
|
-
class
|
|
2131
|
+
class br extends h {
|
|
2120
2132
|
priority = 90;
|
|
2121
2133
|
subpriority = 1;
|
|
2122
2134
|
parse(e, n, r) {
|
|
2123
2135
|
switch (n) {
|
|
2124
2136
|
case "D":
|
|
2125
2137
|
case "DD":
|
|
2126
|
-
return
|
|
2138
|
+
return p(D.dayOfYear, e);
|
|
2127
2139
|
case "Do":
|
|
2128
2140
|
return r.ordinalNumber(e, { unit: "date" });
|
|
2129
2141
|
default:
|
|
@@ -2132,7 +2144,7 @@ class pr extends h {
|
|
|
2132
2144
|
}
|
|
2133
2145
|
validate(e, n) {
|
|
2134
2146
|
const r = e.getFullYear();
|
|
2135
|
-
return
|
|
2147
|
+
return yt(r) ? n >= 1 && n <= 366 : n >= 1 && n <= 365;
|
|
2136
2148
|
}
|
|
2137
2149
|
set(e, n, r) {
|
|
2138
2150
|
return e.setMonth(0, r), e.setHours(0, 0, 0, 0), e;
|
|
@@ -2156,10 +2168,10 @@ class pr extends h {
|
|
|
2156
2168
|
];
|
|
2157
2169
|
}
|
|
2158
2170
|
function ge(t, e, n) {
|
|
2159
|
-
const r =
|
|
2171
|
+
const r = W(), s = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, a = y(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
2172
|
return it(a, d, n);
|
|
2161
2173
|
}
|
|
2162
|
-
class
|
|
2174
|
+
class Dr extends h {
|
|
2163
2175
|
priority = 90;
|
|
2164
2176
|
parse(e, n, r) {
|
|
2165
2177
|
switch (n) {
|
|
@@ -2195,7 +2207,7 @@ class br extends h {
|
|
|
2195
2207
|
}
|
|
2196
2208
|
incompatibleTokens = ["D", "i", "e", "c", "t", "T"];
|
|
2197
2209
|
}
|
|
2198
|
-
class
|
|
2210
|
+
class Tr extends h {
|
|
2199
2211
|
priority = 90;
|
|
2200
2212
|
parse(e, n, r, s) {
|
|
2201
2213
|
const a = (o) => {
|
|
@@ -2261,7 +2273,7 @@ class Dr extends h {
|
|
|
2261
2273
|
"T"
|
|
2262
2274
|
];
|
|
2263
2275
|
}
|
|
2264
|
-
class
|
|
2276
|
+
class Er extends h {
|
|
2265
2277
|
priority = 90;
|
|
2266
2278
|
parse(e, n, r, s) {
|
|
2267
2279
|
const a = (o) => {
|
|
@@ -2327,11 +2339,11 @@ class Tr extends h {
|
|
|
2327
2339
|
"T"
|
|
2328
2340
|
];
|
|
2329
2341
|
}
|
|
2330
|
-
function
|
|
2331
|
-
const r =
|
|
2342
|
+
function xr(t, e, n) {
|
|
2343
|
+
const r = y(t, n?.in), s = Kn(r, n), a = e - s;
|
|
2332
2344
|
return it(r, a, n);
|
|
2333
2345
|
}
|
|
2334
|
-
class
|
|
2346
|
+
class Pr extends h {
|
|
2335
2347
|
priority = 90;
|
|
2336
2348
|
parse(e, n, r) {
|
|
2337
2349
|
const s = (a) => a === 0 ? 7 : a;
|
|
@@ -2402,7 +2414,7 @@ class xr extends h {
|
|
|
2402
2414
|
return n >= 1 && n <= 7;
|
|
2403
2415
|
}
|
|
2404
2416
|
set(e, n, r) {
|
|
2405
|
-
return e =
|
|
2417
|
+
return e = xr(e, r), e.setHours(0, 0, 0, 0), e;
|
|
2406
2418
|
}
|
|
2407
2419
|
incompatibleTokens = [
|
|
2408
2420
|
"y",
|
|
@@ -2422,7 +2434,7 @@ class xr extends h {
|
|
|
2422
2434
|
"T"
|
|
2423
2435
|
];
|
|
2424
2436
|
}
|
|
2425
|
-
class
|
|
2437
|
+
class vr extends h {
|
|
2426
2438
|
priority = 80;
|
|
2427
2439
|
parse(e, n, r) {
|
|
2428
2440
|
switch (n) {
|
|
@@ -2459,7 +2471,7 @@ class Pr extends h {
|
|
|
2459
2471
|
}
|
|
2460
2472
|
incompatibleTokens = ["b", "B", "H", "k", "t", "T"];
|
|
2461
2473
|
}
|
|
2462
|
-
class
|
|
2474
|
+
class Mr extends h {
|
|
2463
2475
|
priority = 80;
|
|
2464
2476
|
parse(e, n, r) {
|
|
2465
2477
|
switch (n) {
|
|
@@ -2496,7 +2508,7 @@ class vr extends h {
|
|
|
2496
2508
|
}
|
|
2497
2509
|
incompatibleTokens = ["a", "B", "H", "k", "t", "T"];
|
|
2498
2510
|
}
|
|
2499
|
-
class
|
|
2511
|
+
class Or extends h {
|
|
2500
2512
|
priority = 80;
|
|
2501
2513
|
parse(e, n, r) {
|
|
2502
2514
|
switch (n) {
|
|
@@ -2533,12 +2545,12 @@ class Mr extends h {
|
|
|
2533
2545
|
}
|
|
2534
2546
|
incompatibleTokens = ["a", "b", "t", "T"];
|
|
2535
2547
|
}
|
|
2536
|
-
class
|
|
2548
|
+
class Ar extends h {
|
|
2537
2549
|
priority = 70;
|
|
2538
2550
|
parse(e, n, r) {
|
|
2539
2551
|
switch (n) {
|
|
2540
2552
|
case "h":
|
|
2541
|
-
return
|
|
2553
|
+
return p(D.hour12h, e);
|
|
2542
2554
|
case "ho":
|
|
2543
2555
|
return r.ordinalNumber(e, { unit: "hour" });
|
|
2544
2556
|
default:
|
|
@@ -2554,12 +2566,12 @@ class Or extends h {
|
|
|
2554
2566
|
}
|
|
2555
2567
|
incompatibleTokens = ["H", "K", "k", "t", "T"];
|
|
2556
2568
|
}
|
|
2557
|
-
class
|
|
2569
|
+
class Nr extends h {
|
|
2558
2570
|
priority = 70;
|
|
2559
2571
|
parse(e, n, r) {
|
|
2560
2572
|
switch (n) {
|
|
2561
2573
|
case "H":
|
|
2562
|
-
return
|
|
2574
|
+
return p(D.hour23h, e);
|
|
2563
2575
|
case "Ho":
|
|
2564
2576
|
return r.ordinalNumber(e, { unit: "hour" });
|
|
2565
2577
|
default:
|
|
@@ -2574,12 +2586,12 @@ class Ar extends h {
|
|
|
2574
2586
|
}
|
|
2575
2587
|
incompatibleTokens = ["a", "b", "h", "K", "k", "t", "T"];
|
|
2576
2588
|
}
|
|
2577
|
-
class
|
|
2589
|
+
class Rr extends h {
|
|
2578
2590
|
priority = 70;
|
|
2579
2591
|
parse(e, n, r) {
|
|
2580
2592
|
switch (n) {
|
|
2581
2593
|
case "K":
|
|
2582
|
-
return
|
|
2594
|
+
return p(D.hour11h, e);
|
|
2583
2595
|
case "Ko":
|
|
2584
2596
|
return r.ordinalNumber(e, { unit: "hour" });
|
|
2585
2597
|
default:
|
|
@@ -2594,12 +2606,12 @@ class Nr extends h {
|
|
|
2594
2606
|
}
|
|
2595
2607
|
incompatibleTokens = ["h", "H", "k", "t", "T"];
|
|
2596
2608
|
}
|
|
2597
|
-
class
|
|
2609
|
+
class kr extends h {
|
|
2598
2610
|
priority = 70;
|
|
2599
2611
|
parse(e, n, r) {
|
|
2600
2612
|
switch (n) {
|
|
2601
2613
|
case "k":
|
|
2602
|
-
return
|
|
2614
|
+
return p(D.hour24h, e);
|
|
2603
2615
|
case "ko":
|
|
2604
2616
|
return r.ordinalNumber(e, { unit: "hour" });
|
|
2605
2617
|
default:
|
|
@@ -2615,12 +2627,12 @@ class Rr extends h {
|
|
|
2615
2627
|
}
|
|
2616
2628
|
incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"];
|
|
2617
2629
|
}
|
|
2618
|
-
class
|
|
2630
|
+
class _r extends h {
|
|
2619
2631
|
priority = 60;
|
|
2620
2632
|
parse(e, n, r) {
|
|
2621
2633
|
switch (n) {
|
|
2622
2634
|
case "m":
|
|
2623
|
-
return
|
|
2635
|
+
return p(D.minute, e);
|
|
2624
2636
|
case "mo":
|
|
2625
2637
|
return r.ordinalNumber(e, { unit: "minute" });
|
|
2626
2638
|
default:
|
|
@@ -2635,12 +2647,12 @@ class kr extends h {
|
|
|
2635
2647
|
}
|
|
2636
2648
|
incompatibleTokens = ["t", "T"];
|
|
2637
2649
|
}
|
|
2638
|
-
class
|
|
2650
|
+
class Ir extends h {
|
|
2639
2651
|
priority = 50;
|
|
2640
2652
|
parse(e, n, r) {
|
|
2641
2653
|
switch (n) {
|
|
2642
2654
|
case "s":
|
|
2643
|
-
return
|
|
2655
|
+
return p(D.second, e);
|
|
2644
2656
|
case "so":
|
|
2645
2657
|
return r.ordinalNumber(e, { unit: "second" });
|
|
2646
2658
|
default:
|
|
@@ -2655,7 +2667,7 @@ class _r extends h {
|
|
|
2655
2667
|
}
|
|
2656
2668
|
incompatibleTokens = ["t", "T"];
|
|
2657
2669
|
}
|
|
2658
|
-
class
|
|
2670
|
+
class Yr extends h {
|
|
2659
2671
|
priority = 30;
|
|
2660
2672
|
parse(e, n) {
|
|
2661
2673
|
const r = (s) => Math.trunc(s * Math.pow(10, -n.length + 3));
|
|
@@ -2666,29 +2678,29 @@ class Ir extends h {
|
|
|
2666
2678
|
}
|
|
2667
2679
|
incompatibleTokens = ["t", "T"];
|
|
2668
2680
|
}
|
|
2669
|
-
class
|
|
2681
|
+
class Cr extends h {
|
|
2670
2682
|
priority = 10;
|
|
2671
2683
|
parse(e, n) {
|
|
2672
2684
|
switch (n) {
|
|
2673
2685
|
case "X":
|
|
2674
|
-
return
|
|
2675
|
-
|
|
2686
|
+
return N(
|
|
2687
|
+
A.basicOptionalMinutes,
|
|
2676
2688
|
e
|
|
2677
2689
|
);
|
|
2678
2690
|
case "XX":
|
|
2679
|
-
return A
|
|
2691
|
+
return N(A.basic, e);
|
|
2680
2692
|
case "XXXX":
|
|
2681
|
-
return
|
|
2682
|
-
|
|
2693
|
+
return N(
|
|
2694
|
+
A.basicOptionalSeconds,
|
|
2683
2695
|
e
|
|
2684
2696
|
);
|
|
2685
2697
|
case "XXXXX":
|
|
2686
|
-
return
|
|
2687
|
-
|
|
2698
|
+
return N(
|
|
2699
|
+
A.extendedOptionalSeconds,
|
|
2688
2700
|
e
|
|
2689
2701
|
);
|
|
2690
2702
|
default:
|
|
2691
|
-
return A
|
|
2703
|
+
return N(A.extended, e);
|
|
2692
2704
|
}
|
|
2693
2705
|
}
|
|
2694
2706
|
set(e, n, r) {
|
|
@@ -2699,29 +2711,29 @@ class Yr extends h {
|
|
|
2699
2711
|
}
|
|
2700
2712
|
incompatibleTokens = ["t", "T", "x"];
|
|
2701
2713
|
}
|
|
2702
|
-
class
|
|
2714
|
+
class Sr extends h {
|
|
2703
2715
|
priority = 10;
|
|
2704
2716
|
parse(e, n) {
|
|
2705
2717
|
switch (n) {
|
|
2706
2718
|
case "x":
|
|
2707
|
-
return
|
|
2708
|
-
|
|
2719
|
+
return N(
|
|
2720
|
+
A.basicOptionalMinutes,
|
|
2709
2721
|
e
|
|
2710
2722
|
);
|
|
2711
2723
|
case "xx":
|
|
2712
|
-
return A
|
|
2724
|
+
return N(A.basic, e);
|
|
2713
2725
|
case "xxxx":
|
|
2714
|
-
return
|
|
2715
|
-
|
|
2726
|
+
return N(
|
|
2727
|
+
A.basicOptionalSeconds,
|
|
2716
2728
|
e
|
|
2717
2729
|
);
|
|
2718
2730
|
case "xxxxx":
|
|
2719
|
-
return
|
|
2720
|
-
|
|
2731
|
+
return N(
|
|
2732
|
+
A.extendedOptionalSeconds,
|
|
2721
2733
|
e
|
|
2722
2734
|
);
|
|
2723
2735
|
default:
|
|
2724
|
-
return A
|
|
2736
|
+
return N(A.extended, e);
|
|
2725
2737
|
}
|
|
2726
2738
|
}
|
|
2727
2739
|
set(e, n, r) {
|
|
@@ -2732,7 +2744,7 @@ class Cr extends h {
|
|
|
2732
2744
|
}
|
|
2733
2745
|
incompatibleTokens = ["t", "T", "X"];
|
|
2734
2746
|
}
|
|
2735
|
-
class
|
|
2747
|
+
class Lr extends h {
|
|
2736
2748
|
priority = 40;
|
|
2737
2749
|
parse(e) {
|
|
2738
2750
|
return wt(e);
|
|
@@ -2742,7 +2754,7 @@ class Sr extends h {
|
|
|
2742
2754
|
}
|
|
2743
2755
|
incompatibleTokens = "*";
|
|
2744
2756
|
}
|
|
2745
|
-
class
|
|
2757
|
+
class $r extends h {
|
|
2746
2758
|
priority = 20;
|
|
2747
2759
|
parse(e) {
|
|
2748
2760
|
return wt(e);
|
|
@@ -2752,128 +2764,128 @@ class Lr extends h {
|
|
|
2752
2764
|
}
|
|
2753
2765
|
incompatibleTokens = "*";
|
|
2754
2766
|
}
|
|
2755
|
-
const
|
|
2756
|
-
G: new
|
|
2757
|
-
y: new
|
|
2758
|
-
Y: new
|
|
2759
|
-
R: new
|
|
2760
|
-
u: new
|
|
2761
|
-
Q: new
|
|
2762
|
-
q: new
|
|
2763
|
-
M: new
|
|
2764
|
-
L: new
|
|
2765
|
-
w: new
|
|
2766
|
-
I: new
|
|
2767
|
+
const Wr = {
|
|
2768
|
+
G: new rr(),
|
|
2769
|
+
y: new sr(),
|
|
2770
|
+
Y: new ar(),
|
|
2771
|
+
R: new or(),
|
|
2772
|
+
u: new ir(),
|
|
2773
|
+
Q: new cr(),
|
|
2774
|
+
q: new ur(),
|
|
2775
|
+
M: new dr(),
|
|
2776
|
+
L: new lr(),
|
|
2777
|
+
w: new mr(),
|
|
2778
|
+
I: new gr(),
|
|
2767
2779
|
d: new yr(),
|
|
2768
|
-
D: new
|
|
2769
|
-
E: new
|
|
2770
|
-
e: new
|
|
2771
|
-
c: new
|
|
2772
|
-
i: new
|
|
2773
|
-
a: new
|
|
2774
|
-
b: new
|
|
2775
|
-
B: new
|
|
2776
|
-
h: new
|
|
2777
|
-
H: new
|
|
2778
|
-
K: new
|
|
2779
|
-
k: new
|
|
2780
|
-
m: new
|
|
2781
|
-
s: new
|
|
2782
|
-
S: new
|
|
2783
|
-
X: new
|
|
2784
|
-
x: new
|
|
2785
|
-
t: new
|
|
2786
|
-
T: new
|
|
2787
|
-
},
|
|
2788
|
-
function
|
|
2789
|
-
const s = () => E(n, NaN), a =
|
|
2780
|
+
D: new br(),
|
|
2781
|
+
E: new Dr(),
|
|
2782
|
+
e: new Tr(),
|
|
2783
|
+
c: new Er(),
|
|
2784
|
+
i: new Pr(),
|
|
2785
|
+
a: new vr(),
|
|
2786
|
+
b: new Mr(),
|
|
2787
|
+
B: new Or(),
|
|
2788
|
+
h: new Ar(),
|
|
2789
|
+
H: new Nr(),
|
|
2790
|
+
K: new Rr(),
|
|
2791
|
+
k: new kr(),
|
|
2792
|
+
m: new _r(),
|
|
2793
|
+
s: new Ir(),
|
|
2794
|
+
S: new Yr(),
|
|
2795
|
+
X: new Cr(),
|
|
2796
|
+
x: new Sr(),
|
|
2797
|
+
t: new Lr(),
|
|
2798
|
+
T: new $r()
|
|
2799
|
+
}, qr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ur = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Hr = /^'([^]*?)'?$/, Fr = /''/g, Qr = /\S/, Br = /[a-zA-Z]/;
|
|
2800
|
+
function Vr(t, e, n, r) {
|
|
2801
|
+
const s = () => E(n, NaN), a = zn(), o = a.locale ?? ut, c = a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, i = a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0;
|
|
2790
2802
|
if (!e)
|
|
2791
|
-
return t ? s() :
|
|
2803
|
+
return t ? s() : y(n, r?.in);
|
|
2792
2804
|
const u = {
|
|
2793
2805
|
firstWeekContainsDate: c,
|
|
2794
2806
|
weekStartsOn: i,
|
|
2795
2807
|
locale: o
|
|
2796
|
-
}, d = [new
|
|
2808
|
+
}, d = [new nr(r?.in, n)], l = e.match(Ur).map((f) => {
|
|
2797
2809
|
const w = f[0];
|
|
2798
2810
|
if (w in re) {
|
|
2799
2811
|
const v = re[w];
|
|
2800
2812
|
return v(f, o.formatLong);
|
|
2801
2813
|
}
|
|
2802
2814
|
return f;
|
|
2803
|
-
}).join("").match(
|
|
2815
|
+
}).join("").match(qr), m = [];
|
|
2804
2816
|
for (let f of l) {
|
|
2805
2817
|
ht(f) && se(f, e, t), mt(f) && se(f, e, t);
|
|
2806
|
-
const w = f[0], v =
|
|
2818
|
+
const w = f[0], v = Wr[w];
|
|
2807
2819
|
if (v) {
|
|
2808
|
-
const { incompatibleTokens:
|
|
2809
|
-
if (Array.isArray(
|
|
2810
|
-
const
|
|
2811
|
-
(
|
|
2820
|
+
const { incompatibleTokens: O } = v;
|
|
2821
|
+
if (Array.isArray(O)) {
|
|
2822
|
+
const U = m.find(
|
|
2823
|
+
(B) => O.includes(B.token) || B.token === w
|
|
2812
2824
|
);
|
|
2813
|
-
if (
|
|
2825
|
+
if (U)
|
|
2814
2826
|
throw new RangeError(
|
|
2815
|
-
`The format string mustn't contain \`${
|
|
2827
|
+
`The format string mustn't contain \`${U.fullToken}\` and \`${f}\` at the same time`
|
|
2816
2828
|
);
|
|
2817
2829
|
} else if (v.incompatibleTokens === "*" && m.length > 0)
|
|
2818
2830
|
throw new RangeError(
|
|
2819
2831
|
`The format string mustn't contain \`${f}\` and any other token at the same time`
|
|
2820
2832
|
);
|
|
2821
2833
|
m.push({ token: w, fullToken: f });
|
|
2822
|
-
const
|
|
2834
|
+
const q = v.run(
|
|
2823
2835
|
t,
|
|
2824
2836
|
f,
|
|
2825
2837
|
o.match,
|
|
2826
2838
|
u
|
|
2827
2839
|
);
|
|
2828
|
-
if (!
|
|
2840
|
+
if (!q)
|
|
2829
2841
|
return s();
|
|
2830
|
-
d.push(
|
|
2842
|
+
d.push(q.setter), t = q.rest;
|
|
2831
2843
|
} else {
|
|
2832
|
-
if (w.match(
|
|
2844
|
+
if (w.match(Br))
|
|
2833
2845
|
throw new RangeError(
|
|
2834
2846
|
"Format string contains an unescaped latin alphabet character `" + w + "`"
|
|
2835
2847
|
);
|
|
2836
|
-
if (f === "''" ? f = "'" : w === "'" && (f =
|
|
2848
|
+
if (f === "''" ? f = "'" : w === "'" && (f = Gr(f)), t.indexOf(f) === 0)
|
|
2837
2849
|
t = t.slice(f.length);
|
|
2838
2850
|
else
|
|
2839
2851
|
return s();
|
|
2840
2852
|
}
|
|
2841
2853
|
}
|
|
2842
|
-
if (t.length > 0 &&
|
|
2854
|
+
if (t.length > 0 && Qr.test(t))
|
|
2843
2855
|
return s();
|
|
2844
2856
|
const x = d.map((f) => f.priority).sort((f, w) => w - f).filter((f, w, v) => v.indexOf(f) === w).map(
|
|
2845
2857
|
(f) => d.filter((w) => w.priority === f).sort((w, v) => v.subPriority - w.subPriority)
|
|
2846
2858
|
).map((f) => f[0]);
|
|
2847
|
-
let P =
|
|
2859
|
+
let P = y(n, r?.in);
|
|
2848
2860
|
if (isNaN(+P)) return s();
|
|
2849
|
-
const
|
|
2861
|
+
const M = {};
|
|
2850
2862
|
for (const f of x) {
|
|
2851
2863
|
if (!f.validate(P, u))
|
|
2852
2864
|
return s();
|
|
2853
|
-
const w = f.set(P,
|
|
2854
|
-
Array.isArray(w) ? (P = w[0], Object.assign(
|
|
2865
|
+
const w = f.set(P, M, u);
|
|
2866
|
+
Array.isArray(w) ? (P = w[0], Object.assign(M, w[1])) : P = w;
|
|
2855
2867
|
}
|
|
2856
2868
|
return P;
|
|
2857
2869
|
}
|
|
2858
|
-
function
|
|
2859
|
-
return t.match(
|
|
2870
|
+
function Gr(t) {
|
|
2871
|
+
return t.match(Hr)[1].replace(Fr, "'");
|
|
2860
2872
|
}
|
|
2861
|
-
function
|
|
2862
|
-
const n = () => E(e?.in, NaN), s =
|
|
2873
|
+
function Xr(t, e) {
|
|
2874
|
+
const n = () => E(e?.in, NaN), s = Jr(t);
|
|
2863
2875
|
let a;
|
|
2864
2876
|
if (s.date) {
|
|
2865
|
-
const u =
|
|
2866
|
-
a =
|
|
2877
|
+
const u = Zr(s.date, 2);
|
|
2878
|
+
a = es(u.restDateString, u.year);
|
|
2867
2879
|
}
|
|
2868
2880
|
if (!a || isNaN(+a)) return n();
|
|
2869
2881
|
const o = +a;
|
|
2870
2882
|
let c = 0, i;
|
|
2871
|
-
if (s.time && (c =
|
|
2883
|
+
if (s.time && (c = ts(s.time), isNaN(c)))
|
|
2872
2884
|
return n();
|
|
2873
2885
|
if (s.timezone) {
|
|
2874
|
-
if (i =
|
|
2886
|
+
if (i = ns(s.timezone), isNaN(i)) return n();
|
|
2875
2887
|
} else {
|
|
2876
|
-
const u = new Date(o + c), d =
|
|
2888
|
+
const u = new Date(o + c), d = y(0, e?.in);
|
|
2877
2889
|
return d.setFullYear(
|
|
2878
2890
|
u.getUTCFullYear(),
|
|
2879
2891
|
u.getUTCMonth(),
|
|
@@ -2885,28 +2897,28 @@ function Gr(t, e) {
|
|
|
2885
2897
|
u.getUTCMilliseconds()
|
|
2886
2898
|
), d;
|
|
2887
2899
|
}
|
|
2888
|
-
return
|
|
2900
|
+
return y(o + c + i, e?.in);
|
|
2889
2901
|
}
|
|
2890
|
-
const
|
|
2902
|
+
const V = {
|
|
2891
2903
|
dateTimeDelimiter: /[T ]/,
|
|
2892
2904
|
timeZoneDelimiter: /[Z ]/i,
|
|
2893
2905
|
timezone: /([Z+-].*)$/
|
|
2894
|
-
},
|
|
2895
|
-
function
|
|
2896
|
-
const e = {}, n = t.split(
|
|
2906
|
+
}, jr = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, zr = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, Kr = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
2907
|
+
function Jr(t) {
|
|
2908
|
+
const e = {}, n = t.split(V.dateTimeDelimiter);
|
|
2897
2909
|
let r;
|
|
2898
2910
|
if (n.length > 2)
|
|
2899
2911
|
return e;
|
|
2900
|
-
if (/:/.test(n[0]) ? r = n[0] : (e.date = n[0], r = n[1],
|
|
2912
|
+
if (/:/.test(n[0]) ? r = n[0] : (e.date = n[0], r = n[1], V.timeZoneDelimiter.test(e.date) && (e.date = t.split(V.timeZoneDelimiter)[0], r = t.substr(
|
|
2901
2913
|
e.date.length,
|
|
2902
2914
|
t.length
|
|
2903
2915
|
))), r) {
|
|
2904
|
-
const s =
|
|
2916
|
+
const s = V.timezone.exec(r);
|
|
2905
2917
|
s ? (e.time = r.replace(s[1], ""), e.timezone = s[1]) : e.time = r;
|
|
2906
2918
|
}
|
|
2907
2919
|
return e;
|
|
2908
2920
|
}
|
|
2909
|
-
function
|
|
2921
|
+
function Zr(t, e) {
|
|
2910
2922
|
const n = new RegExp(
|
|
2911
2923
|
"^(?:(\\d{4}|[+-]\\d{" + (4 + e) + "})|(\\d{2}|[+-]\\d{" + (2 + e) + "})$)"
|
|
2912
2924
|
), r = t.match(n);
|
|
@@ -2917,84 +2929,84 @@ function Jr(t, e) {
|
|
|
2917
2929
|
restDateString: t.slice((r[1] || r[2]).length)
|
|
2918
2930
|
};
|
|
2919
2931
|
}
|
|
2920
|
-
function
|
|
2932
|
+
function es(t, e) {
|
|
2921
2933
|
if (e === null) return /* @__PURE__ */ new Date(NaN);
|
|
2922
|
-
const n = t.match(
|
|
2934
|
+
const n = t.match(jr);
|
|
2923
2935
|
if (!n) return /* @__PURE__ */ new Date(NaN);
|
|
2924
|
-
const r = !!n[4], s =
|
|
2936
|
+
const r = !!n[4], s = Q(n[1]), a = Q(n[2]) - 1, o = Q(n[3]), c = Q(n[4]), i = Q(n[5]) - 1;
|
|
2925
2937
|
if (r)
|
|
2926
|
-
return
|
|
2938
|
+
return is(e, c, i) ? rs(e, c, i) : /* @__PURE__ */ new Date(NaN);
|
|
2927
2939
|
{
|
|
2928
2940
|
const u = /* @__PURE__ */ new Date(0);
|
|
2929
|
-
return !
|
|
2941
|
+
return !as(e, a, o) || !os(e, s) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(e, a, Math.max(s, o)), u);
|
|
2930
2942
|
}
|
|
2931
2943
|
}
|
|
2932
|
-
function
|
|
2944
|
+
function Q(t) {
|
|
2933
2945
|
return t ? parseInt(t) : 1;
|
|
2934
2946
|
}
|
|
2935
|
-
function
|
|
2936
|
-
const e = t.match(
|
|
2947
|
+
function ts(t) {
|
|
2948
|
+
const e = t.match(zr);
|
|
2937
2949
|
if (!e) return NaN;
|
|
2938
2950
|
const n = te(e[1]), r = te(e[2]), s = te(e[3]);
|
|
2939
|
-
return
|
|
2951
|
+
return cs(n, r, s) ? n * fe + r * le + s * 1e3 : NaN;
|
|
2940
2952
|
}
|
|
2941
2953
|
function te(t) {
|
|
2942
2954
|
return t && parseFloat(t.replace(",", ".")) || 0;
|
|
2943
2955
|
}
|
|
2944
|
-
function
|
|
2956
|
+
function ns(t) {
|
|
2945
2957
|
if (t === "Z") return 0;
|
|
2946
|
-
const e = t.match(
|
|
2958
|
+
const e = t.match(Kr);
|
|
2947
2959
|
if (!e) return 0;
|
|
2948
2960
|
const n = e[1] === "+" ? -1 : 1, r = parseInt(e[2]), s = e[3] && parseInt(e[3]) || 0;
|
|
2949
|
-
return
|
|
2961
|
+
return us(r, s) ? n * (r * fe + s * le) : NaN;
|
|
2950
2962
|
}
|
|
2951
|
-
function
|
|
2963
|
+
function rs(t, e, n) {
|
|
2952
2964
|
const r = /* @__PURE__ */ new Date(0);
|
|
2953
2965
|
r.setUTCFullYear(t, 0, 4);
|
|
2954
2966
|
const s = r.getUTCDay() || 7, a = (e - 1) * 7 + n + 1 - s;
|
|
2955
2967
|
return r.setUTCDate(r.getUTCDate() + a), r;
|
|
2956
2968
|
}
|
|
2957
|
-
const
|
|
2969
|
+
const ss = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2958
2970
|
function bt(t) {
|
|
2959
2971
|
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
2960
2972
|
}
|
|
2961
|
-
function
|
|
2962
|
-
return e >= 0 && e <= 11 && n >= 1 && n <= (
|
|
2973
|
+
function as(t, e, n) {
|
|
2974
|
+
return e >= 0 && e <= 11 && n >= 1 && n <= (ss[e] || (bt(t) ? 29 : 28));
|
|
2963
2975
|
}
|
|
2964
|
-
function
|
|
2976
|
+
function os(t, e) {
|
|
2965
2977
|
return e >= 1 && e <= (bt(t) ? 366 : 365);
|
|
2966
2978
|
}
|
|
2967
|
-
function
|
|
2979
|
+
function is(t, e, n) {
|
|
2968
2980
|
return e >= 1 && e <= 53 && n >= 0 && n <= 6;
|
|
2969
2981
|
}
|
|
2970
|
-
function
|
|
2982
|
+
function cs(t, e, n) {
|
|
2971
2983
|
return t === 24 ? e === 0 && n === 0 : n >= 0 && n < 60 && e >= 0 && e < 60 && t >= 0 && t < 25;
|
|
2972
2984
|
}
|
|
2973
|
-
function
|
|
2985
|
+
function us(t, e) {
|
|
2974
2986
|
return e >= 0 && e <= 59;
|
|
2975
2987
|
}
|
|
2976
|
-
const
|
|
2988
|
+
const G = (t) => {
|
|
2977
2989
|
if (!t.includes("T")) {
|
|
2978
|
-
for (const n of
|
|
2979
|
-
const r =
|
|
2990
|
+
for (const n of ds) {
|
|
2991
|
+
const r = Vr(t, n, /* @__PURE__ */ new Date());
|
|
2980
2992
|
if (ne(r))
|
|
2981
2993
|
return r;
|
|
2982
2994
|
}
|
|
2983
2995
|
return null;
|
|
2984
2996
|
}
|
|
2985
|
-
const e =
|
|
2997
|
+
const e = Xr(t);
|
|
2986
2998
|
return ne(e) ? e : null;
|
|
2987
|
-
},
|
|
2999
|
+
}, ds = ["yyyy-MM-dd", "MM-dd-yyyy"], ae = (t, e, n) => {
|
|
2988
3000
|
const r = {};
|
|
2989
|
-
return e?.contentType !== null && (r[
|
|
2990
|
-
},
|
|
3001
|
+
return e?.contentType !== null && (r[Gt] = e?.contentType || Vt), e?.jwt ? r.Authorization = `Bearer ${e.jwt}` : t && (r[X] = t), e?.chatReference && (r[Xt] = e.chatReference), { ...r, ...n };
|
|
3002
|
+
}, ls = (t) => {
|
|
2991
3003
|
const e = { ...t };
|
|
2992
3004
|
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
3005
|
}, Fe = async (t, e, n) => await fetch(t, {
|
|
2994
3006
|
method: n.method || "GET",
|
|
2995
3007
|
headers: e,
|
|
2996
3008
|
body: n.body ? JSON.stringify(n.body) : void 0
|
|
2997
|
-
}),
|
|
3009
|
+
}), fs = async (t, e, n) => {
|
|
2998
3010
|
const r = n?.body === void 0 ? void 0 : n?.isFormData ? n.body : JSON.stringify(n.body);
|
|
2999
3011
|
return await fetch(t, {
|
|
3000
3012
|
method: n.method,
|
|
@@ -3003,7 +3015,7 @@ const V = (t) => {
|
|
|
3003
3015
|
signal: n?.signal
|
|
3004
3016
|
});
|
|
3005
3017
|
};
|
|
3006
|
-
class
|
|
3018
|
+
class ms {
|
|
3007
3019
|
constructor() {
|
|
3008
3020
|
this.decoder = new TextDecoder();
|
|
3009
3021
|
}
|
|
@@ -3024,7 +3036,7 @@ class fs {
|
|
|
3024
3036
|
async initializeStreamRequest(e, n, r, s) {
|
|
3025
3037
|
const a = ae(void 0, {
|
|
3026
3038
|
jwt: s
|
|
3027
|
-
}), o = await
|
|
3039
|
+
}), o = await fs(
|
|
3028
3040
|
e,
|
|
3029
3041
|
{
|
|
3030
3042
|
Accept: "text/event-stream",
|
|
@@ -3099,8 +3111,8 @@ class fs {
|
|
|
3099
3111
|
}
|
|
3100
3112
|
}
|
|
3101
3113
|
}
|
|
3102
|
-
new
|
|
3103
|
-
class
|
|
3114
|
+
new ms();
|
|
3115
|
+
class Ba {
|
|
3104
3116
|
constructor(e) {
|
|
3105
3117
|
this.config = e, console.info("SdmxApiClient initialized", {
|
|
3106
3118
|
apiUrl: e.apiUrl || "NOT SET"
|
|
@@ -3122,34 +3134,35 @@ class Qa {
|
|
|
3122
3134
|
s
|
|
3123
3135
|
);
|
|
3124
3136
|
}
|
|
3125
|
-
async streamRequest(e, n, r, s) {
|
|
3126
|
-
const
|
|
3127
|
-
async start(
|
|
3137
|
+
async streamRequest(e, n, r, s, a) {
|
|
3138
|
+
const o = `${this.config.apiUrl}/${e}`, c = this.buildHeaders(s, n.headers), i = new ReadableStream({
|
|
3139
|
+
async start(d) {
|
|
3128
3140
|
try {
|
|
3129
|
-
const
|
|
3130
|
-
if (!
|
|
3131
|
-
const
|
|
3141
|
+
const l = await Fe(o, c, n);
|
|
3142
|
+
if (!l.ok) {
|
|
3143
|
+
const M = await l.text();
|
|
3132
3144
|
throw console.error(
|
|
3133
|
-
`Fetch failed! Status: ${
|
|
3134
|
-
), new Error(`Fetch failed with status ${
|
|
3145
|
+
`Fetch failed! Status: ${l.status}, Body: ${M}`
|
|
3146
|
+
), new Error(`Fetch failed with status ${l.status}`);
|
|
3135
3147
|
}
|
|
3136
|
-
const
|
|
3137
|
-
if (!
|
|
3138
|
-
const
|
|
3139
|
-
|
|
3140
|
-
const
|
|
3141
|
-
const { done:
|
|
3142
|
-
|
|
3148
|
+
const m = l.body?.getReader();
|
|
3149
|
+
if (!m) throw new Error("Failed to create stream reader");
|
|
3150
|
+
const x = new Uint8Array([239, 187, 191]);
|
|
3151
|
+
d.enqueue(x);
|
|
3152
|
+
const P = async () => {
|
|
3153
|
+
const { done: M, value: f } = await m.read();
|
|
3154
|
+
M ? d.close() : (d.enqueue(f), await P());
|
|
3143
3155
|
};
|
|
3144
|
-
|
|
3145
|
-
} catch (
|
|
3146
|
-
|
|
3156
|
+
P();
|
|
3157
|
+
} catch (l) {
|
|
3158
|
+
d.error(l);
|
|
3147
3159
|
}
|
|
3148
3160
|
}
|
|
3149
|
-
}),
|
|
3150
|
-
"Content-Disposition": `attachment; filename=${encodeURIComponent(r)}
|
|
3161
|
+
}), u = new Headers({
|
|
3162
|
+
"Content-Disposition": `attachment; filename=${encodeURIComponent(r)}`,
|
|
3163
|
+
...a ? { "Content-Type": a } : {}
|
|
3151
3164
|
});
|
|
3152
|
-
return new Response(
|
|
3165
|
+
return new Response(i, { headers: u });
|
|
3153
3166
|
}
|
|
3154
3167
|
async request(e, n, r, s) {
|
|
3155
3168
|
const a = Date.now(), o = `${r || this.config.apiUrl}/${e}`, c = this.buildHeaders(s, n.headers);
|
|
@@ -3175,7 +3188,7 @@ class Qa {
|
|
|
3175
3188
|
}
|
|
3176
3189
|
if (!i.ok) {
|
|
3177
3190
|
this.addErrorRequestLog(o, n, i, u, d);
|
|
3178
|
-
const m =
|
|
3191
|
+
const m = Bt(d, i);
|
|
3179
3192
|
throw new Error(`API request failed: ${m}`);
|
|
3180
3193
|
}
|
|
3181
3194
|
return d;
|
|
@@ -3205,7 +3218,7 @@ class Qa {
|
|
|
3205
3218
|
const a = {
|
|
3206
3219
|
method: r.method || "GET",
|
|
3207
3220
|
url: n,
|
|
3208
|
-
headers:
|
|
3221
|
+
headers: ls(s)
|
|
3209
3222
|
};
|
|
3210
3223
|
r.body && (a.body = r.body), console.info(e, a);
|
|
3211
3224
|
}
|
|
@@ -3232,41 +3245,41 @@ class Qa {
|
|
|
3232
3245
|
}
|
|
3233
3246
|
}
|
|
3234
3247
|
var we = /* @__PURE__ */ ((t) => (t.LAST_UPDATE_AT = "lastUpdatedAt", t.SERIES_COUNT = "series_count", t))(we || {});
|
|
3235
|
-
function
|
|
3248
|
+
function Va(t) {
|
|
3236
3249
|
return t?.annotations?.find((e) => {
|
|
3237
3250
|
if (e.id === we.LAST_UPDATE_AT)
|
|
3238
3251
|
return e;
|
|
3239
3252
|
})?.value;
|
|
3240
3253
|
}
|
|
3241
|
-
const
|
|
3254
|
+
const pe = (t, e) => t?.names && t?.names[e] || t?.name, Dt = (t, e, n) => {
|
|
3242
3255
|
if (!(!t || e?.has(t?.id)) && (e?.set(t?.id, t), t?.parent)) {
|
|
3243
3256
|
const r = n?.get(t?.parent);
|
|
3244
3257
|
Dt(r, e, n);
|
|
3245
3258
|
}
|
|
3246
|
-
},
|
|
3259
|
+
}, hs = (t, e) => {
|
|
3247
3260
|
const n = /* @__PURE__ */ new Map(), r = new Map(t?.map((s) => [s.id, s]));
|
|
3248
3261
|
return e?.forEach((s) => {
|
|
3249
3262
|
Dt(s, n, r);
|
|
3250
3263
|
}), Array.from(n?.values());
|
|
3251
3264
|
};
|
|
3252
|
-
var
|
|
3253
|
-
const
|
|
3265
|
+
var gs = /* @__PURE__ */ ((t) => (t.C = "c", t))(gs || {}), 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 || {}), ws = /* @__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))(ws || {}), ps = /* @__PURE__ */ ((t) => (t.ANNUAL = "A", t.QUARTERLY = "Q", t.MONTHLY = "M", t))(ps || {});
|
|
3266
|
+
const Ga = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", bs = "time_period_start", Ds = "time_period_end", Xa = (t) => {
|
|
3254
3267
|
const e = t?.find(
|
|
3255
|
-
(a) => a.id === ps
|
|
3256
|
-
), n = t?.find(
|
|
3257
3268
|
(a) => a.id === bs
|
|
3269
|
+
), n = t?.find(
|
|
3270
|
+
(a) => a.id === Ds
|
|
3258
3271
|
), r = n?.title ? new Date(n?.title) : null;
|
|
3259
3272
|
return {
|
|
3260
3273
|
startPeriod: e?.title ? new Date(e?.title) : null,
|
|
3261
3274
|
endPeriod: r
|
|
3262
3275
|
};
|
|
3263
|
-
},
|
|
3276
|
+
}, Ts = (t, e) => t.id.localeCompare(e.id), Es = (t, e) => t.memberValue.localeCompare(e.memberValue), xs = (t, e) => {
|
|
3264
3277
|
const n = new Array(t.length), r = t.map((o, c) => [o, c]);
|
|
3265
3278
|
r.sort(
|
|
3266
|
-
(o, c) =>
|
|
3279
|
+
(o, c) => Ts(o[0], c[0])
|
|
3267
3280
|
);
|
|
3268
3281
|
const s = [...e];
|
|
3269
|
-
s.sort(
|
|
3282
|
+
s.sort(Es);
|
|
3270
3283
|
let a = 0;
|
|
3271
3284
|
for (const o of r) {
|
|
3272
3285
|
const c = o[0];
|
|
@@ -3275,9 +3288,9 @@ const Va = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", ps = "time_period_start",
|
|
|
3275
3288
|
a < s.length && s[a].memberValue === c.id && (n[o[1]] = o[0]);
|
|
3276
3289
|
}
|
|
3277
3290
|
return n.filter((o) => o != null);
|
|
3278
|
-
},
|
|
3291
|
+
}, Ps = (t) => !!t?.some((e) => e.parent), ja = (t, e, n, r, s = []) => {
|
|
3279
3292
|
let a = t || [];
|
|
3280
|
-
if (
|
|
3293
|
+
if (vs(n || [], e || "")) {
|
|
3281
3294
|
const o = (n || [])[0].cubeRegions?.find(
|
|
3282
3295
|
({ isIncluded: c }) => c
|
|
3283
3296
|
);
|
|
@@ -3288,14 +3301,14 @@ const Va = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", ps = "time_period_start",
|
|
|
3288
3301
|
c ? a = a.length === 0 ? (c.selectionValues || []).map(({ memberValue: i }) => ({
|
|
3289
3302
|
id: i,
|
|
3290
3303
|
name: i
|
|
3291
|
-
})) :
|
|
3304
|
+
})) : xs(a, c.selectionValues) : a = [];
|
|
3292
3305
|
}
|
|
3293
3306
|
} else s.length !== 0 && (a = a.filter(({ id: o }) => s.includes(o)));
|
|
3294
|
-
return
|
|
3307
|
+
return Ps(t) && (a = hs(t, a)), a?.map((o) => ({
|
|
3295
3308
|
...o,
|
|
3296
|
-
name: r ?
|
|
3309
|
+
name: r ? pe(o, r) : o?.name
|
|
3297
3310
|
}));
|
|
3298
|
-
},
|
|
3311
|
+
}, vs = (t, e) => t != null && t.length > 0 && e != null, Ms = (t) => {
|
|
3299
3312
|
const e = [];
|
|
3300
3313
|
return t?.filters?.forEach((n) => {
|
|
3301
3314
|
n.componentCode !== ys && e.push({
|
|
@@ -3304,39 +3317,39 @@ const Va = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", ps = "time_period_start",
|
|
|
3304
3317
|
value: n.values.join(",")
|
|
3305
3318
|
});
|
|
3306
3319
|
}), e;
|
|
3307
|
-
},
|
|
3320
|
+
}, za = (t) => {
|
|
3308
3321
|
const e = /* @__PURE__ */ new Map();
|
|
3309
3322
|
return t?.forEach((n) => {
|
|
3310
|
-
e.set(n.urn,
|
|
3323
|
+
e.set(n.urn, Ms(n));
|
|
3311
3324
|
}), e;
|
|
3312
|
-
},
|
|
3325
|
+
}, Os = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, Qe = (t) => {
|
|
3313
3326
|
if (typeof t != "string")
|
|
3314
3327
|
throw new TypeError("Invalid argument expected string");
|
|
3315
|
-
const e = t.match(
|
|
3328
|
+
const e = t.match(Os);
|
|
3316
3329
|
if (!e)
|
|
3317
3330
|
throw new Error(`Invalid argument not valid semver ('${t}' received)`);
|
|
3318
3331
|
return e.shift(), e;
|
|
3319
3332
|
}, Be = (t) => t === "*" || t === "x" || t === "X", Ve = (t) => {
|
|
3320
3333
|
const e = parseInt(t, 10);
|
|
3321
3334
|
return isNaN(e) ? t : e;
|
|
3322
|
-
},
|
|
3335
|
+
}, As = (t, e) => typeof t != typeof e ? [String(t), String(e)] : [t, e], Ns = (t, e) => {
|
|
3323
3336
|
if (Be(t) || Be(e))
|
|
3324
3337
|
return 0;
|
|
3325
|
-
const [n, r] =
|
|
3338
|
+
const [n, r] = As(Ve(t), Ve(e));
|
|
3326
3339
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
3327
3340
|
}, Ge = (t, e) => {
|
|
3328
3341
|
for (let n = 0; n < Math.max(t.length, e.length); n++) {
|
|
3329
|
-
const r =
|
|
3342
|
+
const r = Ns(t[n] || "0", e[n] || "0");
|
|
3330
3343
|
if (r !== 0)
|
|
3331
3344
|
return r;
|
|
3332
3345
|
}
|
|
3333
3346
|
return 0;
|
|
3334
|
-
},
|
|
3347
|
+
}, Rs = (t, e) => {
|
|
3335
3348
|
const n = Qe(t), r = Qe(e), s = n.pop(), a = r.pop(), o = Ge(n, r);
|
|
3336
3349
|
return o !== 0 ? o : s && a ? Ge(s.split("."), a.split(".")) : s || a ? s ? -1 : 1 : 0;
|
|
3337
|
-
},
|
|
3338
|
-
|
|
3339
|
-
const r =
|
|
3350
|
+
}, ks = (t, e, n) => {
|
|
3351
|
+
_s(n);
|
|
3352
|
+
const r = Rs(t, e);
|
|
3340
3353
|
return Tt[n].includes(r);
|
|
3341
3354
|
}, Tt = {
|
|
3342
3355
|
">": [1],
|
|
@@ -3345,11 +3358,11 @@ const Va = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", ps = "time_period_start",
|
|
|
3345
3358
|
"<=": [-1, 0],
|
|
3346
3359
|
"<": [-1],
|
|
3347
3360
|
"!=": [-1, 1]
|
|
3348
|
-
}, Xe = Object.keys(Tt),
|
|
3361
|
+
}, Xe = Object.keys(Tt), _s = (t) => {
|
|
3349
3362
|
if (Xe.indexOf(t) === -1)
|
|
3350
3363
|
throw new Error(`Invalid operator, expected one of ${Xe.join("|")}`);
|
|
3351
|
-
}, oe = "+",
|
|
3352
|
-
const { agency: n, id: r, version: s } =
|
|
3364
|
+
}, oe = "+", ye = (t, e) => {
|
|
3365
|
+
const { agency: n, id: r, version: s } = S(t), a = e.filter(
|
|
3353
3366
|
(i) => i.agencyID === n && i.id === r && !i?.version?.includes(oe)
|
|
3354
3367
|
);
|
|
3355
3368
|
if (a.length === 1)
|
|
@@ -3358,32 +3371,32 @@ const Va = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", ps = "time_period_start",
|
|
|
3358
3371
|
return a.find((i) => i.version === s);
|
|
3359
3372
|
const o = a.map(
|
|
3360
3373
|
(i) => i.version
|
|
3361
|
-
), c =
|
|
3374
|
+
), c = Is(s, o);
|
|
3362
3375
|
return a.find(
|
|
3363
3376
|
(i) => i.version === c[0]
|
|
3364
3377
|
);
|
|
3365
|
-
}, _s = (t, e) => {
|
|
3366
|
-
const n = Is(t, e);
|
|
3367
|
-
return n.length > 0 ? [n[0]] : [];
|
|
3368
3378
|
}, Is = (t, e) => {
|
|
3379
|
+
const n = Ys(t, e);
|
|
3380
|
+
return n.length > 0 ? [n[0]] : [];
|
|
3381
|
+
}, Ys = (t, e) => {
|
|
3369
3382
|
const n = [];
|
|
3370
3383
|
return e.forEach((r) => {
|
|
3371
|
-
|
|
3384
|
+
Ss(t, r) && n.push(r);
|
|
3372
3385
|
}), n;
|
|
3373
|
-
},
|
|
3386
|
+
}, Cs = (t) => {
|
|
3374
3387
|
const e = t.trim(), n = e.indexOf("+");
|
|
3375
3388
|
if (n <= 0) return "";
|
|
3376
3389
|
let r = n;
|
|
3377
3390
|
for (; r > 0 && e[r - 1] >= "0" && e[r - 1] <= "9"; )
|
|
3378
3391
|
r--;
|
|
3379
3392
|
return r > 0 ? e.slice(0, r) : "";
|
|
3380
|
-
},
|
|
3381
|
-
const n = t.trim().replace(/\+/, ""), r =
|
|
3382
|
-
return e.startsWith(r) &&
|
|
3393
|
+
}, Ss = (t, e) => {
|
|
3394
|
+
const n = t.trim().replace(/\+/, ""), r = Cs(t);
|
|
3395
|
+
return e.startsWith(r) && ks(e, n, ">=");
|
|
3383
3396
|
}, be = (t, e) => {
|
|
3384
|
-
const { concept: n } =
|
|
3397
|
+
const { concept: n } = Ls(t, e);
|
|
3385
3398
|
return n;
|
|
3386
|
-
},
|
|
3399
|
+
}, Ls = (t, e) => {
|
|
3387
3400
|
if (t == null)
|
|
3388
3401
|
return {
|
|
3389
3402
|
concept: void 0,
|
|
@@ -3391,7 +3404,7 @@ const Va = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", ps = "time_period_start",
|
|
|
3391
3404
|
};
|
|
3392
3405
|
const { childId: n, agency: r, id: s, version: a } = nt(t);
|
|
3393
3406
|
if (a?.includes(oe)) {
|
|
3394
|
-
const o =
|
|
3407
|
+
const o = ye(
|
|
3395
3408
|
t,
|
|
3396
3409
|
e
|
|
3397
3410
|
);
|
|
@@ -3401,7 +3414,7 @@ const Va = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", ps = "time_period_start",
|
|
|
3401
3414
|
};
|
|
3402
3415
|
}
|
|
3403
3416
|
for (const o of e)
|
|
3404
|
-
if (
|
|
3417
|
+
if ($s(o, s, r, a))
|
|
3405
3418
|
return {
|
|
3406
3419
|
concept: je(o?.concepts || [], n),
|
|
3407
3420
|
scheme: o
|
|
@@ -3410,15 +3423,15 @@ const Va = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", ps = "time_period_start",
|
|
|
3410
3423
|
concept: void 0,
|
|
3411
3424
|
scheme: void 0
|
|
3412
3425
|
};
|
|
3413
|
-
}, je = (t, e) => t?.find((n) => n.id === e),
|
|
3426
|
+
}, je = (t, e) => t?.find((n) => n.id === e), $s = (t, e, n, r) => t.id === e && t.agencyID === n && t.version === r, Ka = (t = [], e = [], n) => {
|
|
3414
3427
|
const r = n?.conceptIdentity || "", s = be(r, e), a = z(
|
|
3415
3428
|
n?.localRepresentation?.enumeration
|
|
3416
3429
|
), o = z(
|
|
3417
3430
|
s?.coreRepresentation?.enumeration
|
|
3418
3431
|
), c = a || o;
|
|
3419
3432
|
if (c != null)
|
|
3420
|
-
return
|
|
3421
|
-
},
|
|
3433
|
+
return ye(c, t);
|
|
3434
|
+
}, Ws = (t, e) => {
|
|
3422
3435
|
const n = t?.data?.dataSets?.[0], s = t?.data?.structures?.[0]?.attributes?.dimensionGroup || [], a = n?.dimensionGroupAttributes, o = {};
|
|
3423
3436
|
for (const c of s) {
|
|
3424
3437
|
const i = c.relationship.dimensions, { codedSeriesKey: u, decodedSeriesKey: d } = Et(
|
|
@@ -3447,7 +3460,7 @@ const Va = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", ps = "time_period_start",
|
|
|
3447
3460
|
codedSeriesKey: a.join(":"),
|
|
3448
3461
|
decodedSeriesKey: o.join(":")
|
|
3449
3462
|
};
|
|
3450
|
-
},
|
|
3463
|
+
}, Ja = (t, e, n) => {
|
|
3451
3464
|
const r = t?.data?.dataSets?.[0], s = t?.data?.structures?.[0], a = (s?.attributes?.dimensionGroup || []).filter(
|
|
3452
3465
|
(l) => l.relationship.dimensions?.length === 1 && l.relationship.dimensions.includes(e || "")
|
|
3453
3466
|
), o = r?.dimensionGroupAttributes, c = [
|
|
@@ -3469,20 +3482,20 @@ const Va = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", ps = "time_period_start",
|
|
|
3469
3482
|
};
|
|
3470
3483
|
}
|
|
3471
3484
|
return d;
|
|
3472
|
-
},
|
|
3485
|
+
}, qs = (t, e) => {
|
|
3473
3486
|
if (e == null)
|
|
3474
3487
|
return;
|
|
3475
3488
|
const n = t.values?.[e];
|
|
3476
3489
|
return n ?? (e instanceof Array ? { values: e } : { value: e.toString() });
|
|
3477
|
-
},
|
|
3490
|
+
}, Za = (t, e, n, r) => {
|
|
3478
3491
|
const s = e?.find(
|
|
3479
3492
|
(a) => a?.id === t?.id
|
|
3480
3493
|
)?.values;
|
|
3481
3494
|
return n?.filter((a) => s?.some((o) => o.id === a.id))?.map((a) => ({
|
|
3482
3495
|
...a,
|
|
3483
|
-
name: r ?
|
|
3496
|
+
name: r ? pe(a, r) : a?.name
|
|
3484
3497
|
})) || [];
|
|
3485
|
-
},
|
|
3498
|
+
}, Us = (t, e) => {
|
|
3486
3499
|
const n = e?.dataStructureComponents?.attributeList, r = t?.metadataStructureComponents?.metadataAttributeList;
|
|
3487
3500
|
return n?.metadataAttributeUsages?.map((s) => {
|
|
3488
3501
|
const a = r?.metadataAttributes?.find(
|
|
@@ -3494,38 +3507,38 @@ const Va = ["FREQ", "FREQUENCY"], ys = "TIME_PERIOD", ps = "time_period_start",
|
|
|
3494
3507
|
isMandatory: Number(a?.minOccurs) > 0
|
|
3495
3508
|
};
|
|
3496
3509
|
});
|
|
3497
|
-
},
|
|
3510
|
+
}, eo = (t = [], e, n) => {
|
|
3498
3511
|
const r = z(e?.conceptIdentity) || "", s = be(r, t);
|
|
3499
|
-
return n ?
|
|
3512
|
+
return n ? pe(s, n) : s?.name ?? s?.id ?? e?.id;
|
|
3500
3513
|
};
|
|
3501
|
-
var
|
|
3514
|
+
var Hs = /* @__PURE__ */ ((t) => (t.CONDITIONAL = "Conditional", t.MANDATORY = "Mandatory", t))(Hs || {}), De = /* @__PURE__ */ ((t) => (t.DIMENSION = "Dimension", t.MEASURE_DIMENSION = "MeasureDimension", t.TIME_DIMENSION = "TimeDimension", t))(De || {}), Fs = /* @__PURE__ */ ((t) => (t.UNBOUNDED = "unbounded", t))(Fs || {});
|
|
3502
3515
|
function ze(t) {
|
|
3503
3516
|
return t?.dataStructures?.[0]?.dataStructureComponents?.dimensionList;
|
|
3504
3517
|
}
|
|
3505
|
-
function
|
|
3518
|
+
function to(t) {
|
|
3506
3519
|
return t?.data?.structures?.[0]?.dimensions?.series || [];
|
|
3507
3520
|
}
|
|
3508
|
-
function
|
|
3521
|
+
function no(t) {
|
|
3509
3522
|
return t?.data?.structures?.[0]?.dimensions?.observation?.[0].values.map((e) => e.value ? e.value : e.id).filter((e) => e != null) || [];
|
|
3510
3523
|
}
|
|
3511
|
-
function
|
|
3524
|
+
function ro(t) {
|
|
3512
3525
|
return t.find(
|
|
3513
3526
|
(e) => e.type === De.TIME_DIMENSION
|
|
3514
3527
|
);
|
|
3515
3528
|
}
|
|
3516
|
-
const
|
|
3529
|
+
const so = (t) => {
|
|
3517
3530
|
const e = /* @__PURE__ */ new Map(), n = t?.dataStructures?.[0], r = t?.metadataStructures?.[0], s = t?.conceptSchemes || [], a = t?.codelists || [];
|
|
3518
3531
|
return t && [
|
|
3519
3532
|
...ze(t)?.dimensions || [],
|
|
3520
3533
|
...ze(t)?.timeDimensions || [],
|
|
3521
|
-
...
|
|
3534
|
+
...Us(r, n),
|
|
3522
3535
|
...n?.dataStructureComponents?.attributeList?.attributes || []
|
|
3523
3536
|
].forEach(
|
|
3524
3537
|
(c) => {
|
|
3525
3538
|
const i = be(
|
|
3526
3539
|
c?.conceptIdentity,
|
|
3527
3540
|
s
|
|
3528
|
-
), u = c?.localRepresentation?.enumeration || i?.coreRepresentation?.enumeration, d =
|
|
3541
|
+
), u = c?.localRepresentation?.enumeration || i?.coreRepresentation?.enumeration, d = ye(
|
|
3529
3542
|
u,
|
|
3530
3543
|
a
|
|
3531
3544
|
);
|
|
@@ -3540,7 +3553,7 @@ const ro = (t) => {
|
|
|
3540
3553
|
}));
|
|
3541
3554
|
}
|
|
3542
3555
|
), e;
|
|
3543
|
-
},
|
|
3556
|
+
}, ao = (t) => t?.find(
|
|
3544
3557
|
(e) => e.id === we.SERIES_COUNT
|
|
3545
3558
|
)?.title || "", Te = 1440 * 60 * 1e3, Ee = 7 * Te;
|
|
3546
3559
|
function xe(t) {
|
|
@@ -3551,7 +3564,7 @@ function xe(t) {
|
|
|
3551
3564
|
}
|
|
3552
3565
|
return n;
|
|
3553
3566
|
}
|
|
3554
|
-
function
|
|
3567
|
+
function Qs(t) {
|
|
3555
3568
|
const e = new Date(t), r = -((e.getDay() + 6) % 7) + 3;
|
|
3556
3569
|
return e.setDate(e.getDate() + r), new Date(e.valueOf());
|
|
3557
3570
|
}
|
|
@@ -3566,7 +3579,7 @@ function xt(t, e, n = "W") {
|
|
|
3566
3579
|
return `${t}-${n}${e < 10 ? "0" + e : e}`;
|
|
3567
3580
|
}
|
|
3568
3581
|
function Z(t, e = "W") {
|
|
3569
|
-
const n =
|
|
3582
|
+
const n = Qs(t), r = n.getFullYear(), s = xe(r), a = 1 + Math.ceil(
|
|
3570
3583
|
(n.getTime() - s.getTime()) / Ee
|
|
3571
3584
|
);
|
|
3572
3585
|
return {
|
|
@@ -3575,15 +3588,15 @@ function Z(t, e = "W") {
|
|
|
3575
3588
|
weekYear: r
|
|
3576
3589
|
};
|
|
3577
3590
|
}
|
|
3578
|
-
function
|
|
3591
|
+
function Bs(t) {
|
|
3579
3592
|
const [e, n] = t.split("-W"), s = xe(+e).getTime() + (+n - 1) * Ee - 3 * Te;
|
|
3580
3593
|
return new Date(s);
|
|
3581
3594
|
}
|
|
3582
|
-
function
|
|
3595
|
+
function Vs(t) {
|
|
3583
3596
|
const [e, n] = t.split("-W"), s = xe(+e).getTime() + (+n - 1) * Ee + 3 * Te;
|
|
3584
3597
|
return new Date(s);
|
|
3585
3598
|
}
|
|
3586
|
-
const
|
|
3599
|
+
const Gs = "/api/download", Xs = 6e4, oo = async (t, e, n, r, s, a, o) => {
|
|
3587
3600
|
const c = new URLSearchParams({
|
|
3588
3601
|
urn: t,
|
|
3589
3602
|
format: e,
|
|
@@ -3593,7 +3606,7 @@ const Vs = "/api/download", Gs = 6e4, ao = async (t, e, n, r, s, a, o) => {
|
|
|
3593
3606
|
attribute: r,
|
|
3594
3607
|
language: n,
|
|
3595
3608
|
isMetadata: o ? "true" : "none"
|
|
3596
|
-
}).toString(), i = `${
|
|
3609
|
+
}).toString(), i = `${Gs}?${c}`, u = await fetch(i, {
|
|
3597
3610
|
method: "GET",
|
|
3598
3611
|
credentials: "same-origin"
|
|
3599
3612
|
});
|
|
@@ -3606,18 +3619,18 @@ const Vs = "/api/download", Gs = 6e4, ao = async (t, e, n, r, s, a, o) => {
|
|
|
3606
3619
|
const d = await u.blob(), l = URL.createObjectURL(d), m = document.createElement("a");
|
|
3607
3620
|
m.href = l, m.download = a, m.style.display = "none", document.body.appendChild(m), m.click(), document.body.removeChild(m), window.setTimeout(
|
|
3608
3621
|
() => URL.revokeObjectURL(l),
|
|
3609
|
-
|
|
3622
|
+
Xs
|
|
3610
3623
|
);
|
|
3611
|
-
},
|
|
3624
|
+
}, io = (t, e) => {
|
|
3612
3625
|
const n = [];
|
|
3613
3626
|
for (const r of t) {
|
|
3614
3627
|
if (r.type !== De.DIMENSION)
|
|
3615
3628
|
continue;
|
|
3616
3629
|
const s = e.find((a) => a.componentCode === r.id);
|
|
3617
|
-
s != null && s.values?.length > 0 ? n.push(s.values?.join(
|
|
3630
|
+
s != null && s.values?.length > 0 ? n.push(s.values?.join(at)) : n.push("*");
|
|
3618
3631
|
}
|
|
3619
3632
|
return n.join(".");
|
|
3620
|
-
},
|
|
3633
|
+
}, js = (t, e) => {
|
|
3621
3634
|
if (!t || !t.startPeriod && !t.endPeriod)
|
|
3622
3635
|
return null;
|
|
3623
3636
|
const n = [], { startPeriod: r, endPeriod: s } = t;
|
|
@@ -3627,14 +3640,12 @@ const Vs = "/api/download", Gs = 6e4, ao = async (t, e, n, r, s, a, o) => {
|
|
|
3627
3640
|
`${k.LESS_OR_EQUAL}${Ie}${Je(s)}`
|
|
3628
3641
|
), n.length === 0)
|
|
3629
3642
|
return null;
|
|
3630
|
-
const a = e;
|
|
3631
|
-
return
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
return n ? Xs(n, e?.id) : null;
|
|
3637
|
-
}, js = (t, e) => {
|
|
3643
|
+
const a = e, o = n.join(at);
|
|
3644
|
+
return `${encodeURIComponent(`c[${a}]`)}${Ht}${encodeURIComponent(o)}`;
|
|
3645
|
+
}, Je = (t) => Xn(t, "yyyy-MM-dd"), co = (t, e) => {
|
|
3646
|
+
const n = zs(t, e) || null;
|
|
3647
|
+
return n ? js(n, e?.id) : null;
|
|
3648
|
+
}, zs = (t, e) => {
|
|
3638
3649
|
const n = e.id, r = t?.filters?.find(
|
|
3639
3650
|
(i) => i.componentCode === n
|
|
3640
3651
|
);
|
|
@@ -3645,18 +3656,18 @@ const Vs = "/api/download", Gs = 6e4, ao = async (t, e, n, r, s, a, o) => {
|
|
|
3645
3656
|
return null;
|
|
3646
3657
|
const a = r.operator;
|
|
3647
3658
|
if (a === k.LESS_OR_EQUAL || a === k.LESS)
|
|
3648
|
-
return { startPeriod: null, endPeriod:
|
|
3659
|
+
return { startPeriod: null, endPeriod: G(s[0]) };
|
|
3649
3660
|
if (a === k.GREATER_OR_EQUAL || a === k.GREATER)
|
|
3650
|
-
return { startPeriod:
|
|
3651
|
-
const o =
|
|
3661
|
+
return { startPeriod: G(s[0]), endPeriod: null };
|
|
3662
|
+
const o = G(s[0]), c = G(s[1]);
|
|
3652
3663
|
return { startPeriod: o, endPeriod: c };
|
|
3653
|
-
},
|
|
3664
|
+
}, Ks = "Observation", uo = (t) => {
|
|
3654
3665
|
const e = t?.data?.dataSets, n = t?.data?.structures?.[0];
|
|
3655
3666
|
if (!e || !n)
|
|
3656
3667
|
return [];
|
|
3657
3668
|
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
3669
|
for (const u in o) {
|
|
3659
|
-
const d = [], { name: l, parsedTimeSeriesValue: m } =
|
|
3670
|
+
const d = [], { name: l, parsedTimeSeriesValue: m } = Js(
|
|
3660
3671
|
u,
|
|
3661
3672
|
c
|
|
3662
3673
|
), x = o[u], P = x.attributes || [];
|
|
@@ -3671,39 +3682,39 @@ const Vs = "/api/download", Gs = 6e4, ao = async (t, e, n, r, s, a, o) => {
|
|
|
3671
3682
|
continue;
|
|
3672
3683
|
}
|
|
3673
3684
|
d.push(
|
|
3674
|
-
...
|
|
3685
|
+
...na(x, n)
|
|
3675
3686
|
);
|
|
3676
|
-
const
|
|
3687
|
+
const M = ie(
|
|
3677
3688
|
r?.series || [],
|
|
3678
|
-
(
|
|
3679
|
-
), f =
|
|
3689
|
+
(O) => P[O]
|
|
3690
|
+
), f = ra(
|
|
3680
3691
|
n.attributes?.dataSet || [],
|
|
3681
|
-
e[0].attributes?.filter((
|
|
3682
|
-
), w =
|
|
3692
|
+
e[0].attributes?.filter((O) => O != null) || []
|
|
3693
|
+
), w = Ws(
|
|
3683
3694
|
t,
|
|
3684
3695
|
m
|
|
3685
|
-
), v = a.map((
|
|
3686
|
-
const
|
|
3687
|
-
|
|
3688
|
-
|
|
3696
|
+
), v = a.map((O, q) => {
|
|
3697
|
+
const U = w[O.id], B = qs(
|
|
3698
|
+
O,
|
|
3699
|
+
U.values[q]
|
|
3689
3700
|
);
|
|
3690
3701
|
return {
|
|
3691
|
-
attribute:
|
|
3692
|
-
dimensionGroupValue:
|
|
3693
|
-
dimensionGroupData:
|
|
3702
|
+
attribute: O,
|
|
3703
|
+
dimensionGroupValue: B,
|
|
3704
|
+
dimensionGroupData: U
|
|
3694
3705
|
};
|
|
3695
3706
|
});
|
|
3696
3707
|
i.push({
|
|
3697
3708
|
name: l,
|
|
3698
3709
|
parsedTimeSeriesValue: m,
|
|
3699
3710
|
values: d,
|
|
3700
|
-
attributes:
|
|
3711
|
+
attributes: M,
|
|
3701
3712
|
dataSetAttrs: f,
|
|
3702
3713
|
dimensionGroupAttributes: v
|
|
3703
3714
|
});
|
|
3704
3715
|
}
|
|
3705
3716
|
return i;
|
|
3706
|
-
},
|
|
3717
|
+
}, Js = (t, e) => {
|
|
3707
3718
|
const n = t.split(new RegExp("(?<!\\|):(?!\\||$)")), r = [];
|
|
3708
3719
|
for (let s = 0; s < n.length; s++) {
|
|
3709
3720
|
const a = e?.[s], o = Number(n[s]);
|
|
@@ -3717,23 +3728,23 @@ const Vs = "/api/download", Gs = 6e4, ao = async (t, e, n, r, s, a, o) => {
|
|
|
3717
3728
|
r.push(c?.id || c?.value || "");
|
|
3718
3729
|
}
|
|
3719
3730
|
return {
|
|
3720
|
-
name:
|
|
3731
|
+
name: ea(r),
|
|
3721
3732
|
parsedTimeSeriesValue: r
|
|
3722
3733
|
};
|
|
3723
3734
|
}, ie = (t, e) => {
|
|
3724
3735
|
const n = [];
|
|
3725
3736
|
for (let r = 0; r < t.length; r++) {
|
|
3726
|
-
const s = t[r], a = e(r), o = a != null && s.values != null ?
|
|
3737
|
+
const s = t[r], a = e(r), o = a != null && s.values != null ? Zs(a, s) : void 0;
|
|
3727
3738
|
n.push({
|
|
3728
3739
|
name: s.id,
|
|
3729
3740
|
value: o
|
|
3730
3741
|
});
|
|
3731
3742
|
}
|
|
3732
3743
|
return n;
|
|
3733
|
-
},
|
|
3744
|
+
}, Zs = (t, e) => {
|
|
3734
3745
|
const n = e.values[t];
|
|
3735
3746
|
return n == null ? typeof t == "object" ? t : t.toString() : n?.id || n?.value || n?.ids || n?.values;
|
|
3736
|
-
},
|
|
3747
|
+
}, ea = (t) => t.map((e) => e ? ta(e) : "").join("."), ta = (t) => t.replace(/\./g, "|.").replace(/:/g, "|:"), na = (t, e) => {
|
|
3737
3748
|
const n = e.measures?.observation?.length;
|
|
3738
3749
|
if (t.observations == null)
|
|
3739
3750
|
return [
|
|
@@ -3743,7 +3754,7 @@ const Vs = "/api/download", Gs = 6e4, ao = async (t, e, n, r, s, a, o) => {
|
|
|
3743
3754
|
e.attributes?.observation || [],
|
|
3744
3755
|
(o) => t[o + n]
|
|
3745
3756
|
),
|
|
3746
|
-
dimensionAtObservation:
|
|
3757
|
+
dimensionAtObservation: Ks
|
|
3747
3758
|
}
|
|
3748
3759
|
];
|
|
3749
3760
|
const r = t.observations, s = e.dimensions.observation?.[0], a = [];
|
|
@@ -3762,36 +3773,36 @@ const Vs = "/api/download", Gs = 6e4, ao = async (t, e, n, r, s, a, o) => {
|
|
|
3762
3773
|
});
|
|
3763
3774
|
}
|
|
3764
3775
|
return a;
|
|
3765
|
-
}, Ze = (t, e) => e?.observation?.map((n, r) => ({ name: n.id, value: t[r] })) || [],
|
|
3776
|
+
}, Ze = (t, e) => e?.observation?.map((n, r) => ({ name: n.id, value: t[r] })) || [], ra = (t, e) => t.reduce(
|
|
3766
3777
|
(n, r, s) => {
|
|
3767
3778
|
const a = e[s];
|
|
3768
|
-
return
|
|
3779
|
+
return sa(n, r, a, ""), n;
|
|
3769
3780
|
},
|
|
3770
3781
|
[]
|
|
3771
|
-
),
|
|
3782
|
+
), sa = (t, e, n, r) => {
|
|
3772
3783
|
const s = n != null ? e?.values?.length > 0 ? e.values[n]?.id || e.values[n]?.value : String(n) : r;
|
|
3773
3784
|
t.push({
|
|
3774
3785
|
name: e.id,
|
|
3775
3786
|
value: s || ""
|
|
3776
3787
|
});
|
|
3777
|
-
},
|
|
3788
|
+
}, aa = /^[0-9][0-9][0-9][0-9]-Q[1-4]$/, oa = /^[0-9][0-9][0-9][0-9]-W(0[1-9]|[1-4][0-9]|5[0-3])$/, ia = /^[0-9][0-9][0-9][0-9]-S[1-2]$/, ca = /^[0-9][0-9][0-9][0-9]$/, ua = /^[0-9][0-9][0-9][0-9]-(0[1-9]|1[0-2])-[0-9][0-9]$/, da = /^[0-9][0-9][0-9][0-9]-M(0[1-9]|(1[0-2]))$/, Pe = (t) => ca.exec(t), ve = (t) => !!Pe(t), la = (t) => ia.exec(t), Me = (t) => !!la(t), Oe = (t) => da.exec(t), Ae = (t) => !!Oe(t), Ne = (t) => aa.exec(t), Re = (t) => !!Ne(t), fa = (t) => ua.exec(t), ma = (t) => !!fa(t), ha = (t) => oa.exec(t), ke = (t) => !!ha(t);
|
|
3778
3789
|
function Pt(t) {
|
|
3779
|
-
return ve(t) ?
|
|
3790
|
+
return ve(t) ? ga(t) : Me(t) ? pa(t) : Re(t) ? ba(t) : Ae(t) ? Ta(t) : ke(t) ? Bs(t) : xa(t);
|
|
3780
3791
|
}
|
|
3781
3792
|
function vt(t) {
|
|
3782
|
-
return ve(t) ?
|
|
3793
|
+
return ve(t) ? wa(t) : Me(t) ? ya(t) : Re(t) ? Da(t) : Ae(t) ? Ea(t) : ke(t) ? Vs(t) : Pa(t);
|
|
3783
3794
|
}
|
|
3784
|
-
function
|
|
3795
|
+
function ga(t) {
|
|
3785
3796
|
const e = Pe(t);
|
|
3786
3797
|
if (e)
|
|
3787
3798
|
return new Date(Number(e[0]), 0, 1);
|
|
3788
3799
|
}
|
|
3789
|
-
function
|
|
3800
|
+
function wa(t) {
|
|
3790
3801
|
const e = Pe(t);
|
|
3791
3802
|
if (e)
|
|
3792
3803
|
return new Date(Number(e[0]) + 1, 0, 1);
|
|
3793
3804
|
}
|
|
3794
|
-
function
|
|
3805
|
+
function pa(t) {
|
|
3795
3806
|
const [e, n] = t.split("-S");
|
|
3796
3807
|
switch (+n) {
|
|
3797
3808
|
case 1:
|
|
@@ -3809,7 +3820,7 @@ function ya(t) {
|
|
|
3809
3820
|
return new Date(+e + 1, 0, 1);
|
|
3810
3821
|
}
|
|
3811
3822
|
}
|
|
3812
|
-
function
|
|
3823
|
+
function ba(t) {
|
|
3813
3824
|
const e = Ne(t);
|
|
3814
3825
|
if (!e)
|
|
3815
3826
|
return;
|
|
@@ -3825,7 +3836,7 @@ function pa(t) {
|
|
|
3825
3836
|
return new Date(+n, 9, 1);
|
|
3826
3837
|
}
|
|
3827
3838
|
}
|
|
3828
|
-
function
|
|
3839
|
+
function Da(t) {
|
|
3829
3840
|
const e = Ne(t);
|
|
3830
3841
|
if (!e)
|
|
3831
3842
|
return;
|
|
@@ -3841,45 +3852,45 @@ function ba(t) {
|
|
|
3841
3852
|
return new Date(+n + 1, 0, 1);
|
|
3842
3853
|
}
|
|
3843
3854
|
}
|
|
3844
|
-
function
|
|
3855
|
+
function Ta(t) {
|
|
3845
3856
|
const e = Oe(t);
|
|
3846
3857
|
if (!e)
|
|
3847
3858
|
return;
|
|
3848
3859
|
const [n, r] = e[0].split("-M");
|
|
3849
3860
|
return new Date(+n, +r - 1, 1);
|
|
3850
3861
|
}
|
|
3851
|
-
function
|
|
3862
|
+
function Ea(t) {
|
|
3852
3863
|
const e = Oe(t);
|
|
3853
3864
|
if (!e)
|
|
3854
3865
|
return;
|
|
3855
3866
|
const [n, r] = e[0].split("-M");
|
|
3856
3867
|
return new Date(+n, +r, 1);
|
|
3857
3868
|
}
|
|
3858
|
-
const
|
|
3869
|
+
const xa = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), Pa = (t) => {
|
|
3859
3870
|
const e = /* @__PURE__ */ new Date(`${t}T23:59:00`);
|
|
3860
3871
|
return e.setMinutes(e.getMinutes() + 1), e;
|
|
3861
|
-
},
|
|
3862
|
-
const a = [], o = e && e > 3 ?
|
|
3872
|
+
}, va = 1, Ma = (t, e, n, r = !0, s = "Q") => {
|
|
3873
|
+
const a = [], o = e && e > 3 ? Ia(e, r) : 1, c = n ? Math.floor((n - 1) / 3) : 4;
|
|
3863
3874
|
for (let i = o; i <= c; i++)
|
|
3864
3875
|
a.push(`${t}-${s}${i}`);
|
|
3865
3876
|
return a;
|
|
3866
|
-
},
|
|
3877
|
+
}, Oa = (t, e, n, r = "S") => {
|
|
3867
3878
|
const s = [];
|
|
3868
3879
|
return (e || 1) < 7 && (n || 12) > 6 && s.push(`${t}-${r}1`), n == null && s.push(`${t}-${r}2`), s;
|
|
3869
|
-
},
|
|
3880
|
+
}, lo = (t) => Math.ceil(t / 3), Mt = (t, e, n = "M") => `${t}-${n}${e.toString().padStart(2, "0")}`, Aa = (t, e, n = "M") => {
|
|
3870
3881
|
const r = [];
|
|
3871
3882
|
for (let s = e; s <= 12; s++)
|
|
3872
3883
|
r.push(Mt(t, s, n));
|
|
3873
3884
|
return r;
|
|
3874
|
-
},
|
|
3885
|
+
}, Na = (t, e, n, r = "M") => {
|
|
3875
3886
|
const s = [];
|
|
3876
3887
|
for (let a = e; a < n; a++)
|
|
3877
3888
|
s.push(Mt(t, a, r));
|
|
3878
3889
|
return s;
|
|
3879
|
-
},
|
|
3890
|
+
}, Ra = (t, e, n, r = "M") => {
|
|
3880
3891
|
const s = e || 1, a = n == null, o = n || 12;
|
|
3881
|
-
return a ?
|
|
3882
|
-
},
|
|
3892
|
+
return a ? Aa(t, s, r) : Na(t, s, o, r);
|
|
3893
|
+
}, fo = (t, e, n = "M") => {
|
|
3883
3894
|
switch (e) {
|
|
3884
3895
|
case 0:
|
|
3885
3896
|
return [
|
|
@@ -3908,29 +3919,29 @@ const Ea = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), xa = (t) => {
|
|
|
3908
3919
|
default:
|
|
3909
3920
|
return [];
|
|
3910
3921
|
}
|
|
3911
|
-
},
|
|
3912
|
-
const n = _(e, !0), r = _(t), s = n.getFullYear(), a = r.getFullYear(), o = n.getTime() <= r.getTime() ? a +
|
|
3922
|
+
}, ka = (t, e) => {
|
|
3923
|
+
const n = _(e, !0), r = _(t), s = n.getFullYear(), a = r.getFullYear(), o = n.getTime() <= r.getTime() ? a + va - s : 0;
|
|
3913
3924
|
return Array.from({ length: o }, (i, u) => s + u);
|
|
3914
3925
|
}, _ = (t, e = !1) => {
|
|
3915
|
-
const n =
|
|
3926
|
+
const n = _a(t, e);
|
|
3916
3927
|
return n ? (n.getTimezoneOffset() > 0 && n.setMinutes(n.getMinutes() + n.getTimezoneOffset()), n) : /* @__PURE__ */ new Date();
|
|
3917
|
-
},
|
|
3928
|
+
}, _a = (t, e = !1) => {
|
|
3918
3929
|
const n = Number(t);
|
|
3919
3930
|
return t.toString().length !== 13 ? e ? Pt(t) : vt(t) : isNaN(n) ? /* @__PURE__ */ new Date(`${t}T00:00:00.000Z`) : new Date(n);
|
|
3920
|
-
},
|
|
3931
|
+
}, Ia = (t, e) => e ? Math.floor((t + 1) / 3) : Math.ceil((t + 1) / 3), mo = (t, e) => {
|
|
3921
3932
|
const n = tt(t) - tt(e);
|
|
3922
3933
|
if (n === 0 && t !== e) {
|
|
3923
3934
|
const r = et(t), s = et(e);
|
|
3924
3935
|
return r - s;
|
|
3925
3936
|
}
|
|
3926
3937
|
return n;
|
|
3927
|
-
}, et = (t) => ve(t) ? 6 : Me(t) ? 5 : Re(t) ? 4 : Ae(t) ? 3 : ke(t) ? 2 :
|
|
3938
|
+
}, et = (t) => ve(t) ? 6 : Me(t) ? 5 : Re(t) ? 4 : Ae(t) ? 3 : ke(t) ? 2 : ma(t) ? 1 : 0, tt = (t, e = !1) => (e ? Pt(t) : vt(t))?.getTime() || 0, Ot = (t, e, n) => {
|
|
3928
3939
|
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;
|
|
3929
3940
|
return {
|
|
3930
3941
|
start: c,
|
|
3931
3942
|
end: i
|
|
3932
3943
|
};
|
|
3933
|
-
},
|
|
3944
|
+
}, Ya = (t, e, n, r = "W") => {
|
|
3934
3945
|
const s = +t, { start: a, end: o } = Ot(t, e, n);
|
|
3935
3946
|
if (a.getTime() > o.getTime())
|
|
3936
3947
|
return [];
|
|
@@ -3939,10 +3950,10 @@ const Ea = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), xa = (t) => {
|
|
|
3939
3950
|
for (let m = i; m <= d; m++)
|
|
3940
3951
|
l.push(xt(s, m, r));
|
|
3941
3952
|
return l;
|
|
3942
|
-
},
|
|
3953
|
+
}, Ca = (t) => {
|
|
3943
3954
|
const e = new Date(t);
|
|
3944
3955
|
return e.setMinutes(e.getMinutes() - e.getTimezoneOffset()), e.toISOString().slice(0, 10);
|
|
3945
|
-
},
|
|
3956
|
+
}, Sa = (t, e, n) => {
|
|
3946
3957
|
const { start: r, end: s } = Ot(t, e, n);
|
|
3947
3958
|
if (r.getTime() > s.getTime())
|
|
3948
3959
|
return [];
|
|
@@ -3952,11 +3963,11 @@ const Ea = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), xa = (t) => {
|
|
|
3952
3963
|
r.getDate()
|
|
3953
3964
|
), c = new Date(s.getFullYear(), s.getMonth(), s.getDate());
|
|
3954
3965
|
for (; o.getTime() < c.getTime(); ) {
|
|
3955
|
-
const i =
|
|
3966
|
+
const i = Ca(o);
|
|
3956
3967
|
a.push(i), o.setDate(o.getDate() + 1);
|
|
3957
3968
|
}
|
|
3958
3969
|
return a;
|
|
3959
|
-
},
|
|
3970
|
+
}, La = (t) => ({
|
|
3960
3971
|
isDailyExist: !!t?.some(({ memberValue: e }) => e === "D"),
|
|
3961
3972
|
isWeeklyExist: !!t?.some(({ memberValue: e }) => e === "W"),
|
|
3962
3973
|
isMonthlyExist: !!t?.some(({ memberValue: e }) => e === "M"),
|
|
@@ -3965,15 +3976,15 @@ const Ea = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), xa = (t) => {
|
|
|
3965
3976
|
isYearlyExist: !!t?.some(
|
|
3966
3977
|
({ memberValue: e }) => e === "A" || e === "Y"
|
|
3967
3978
|
)
|
|
3968
|
-
}),
|
|
3979
|
+
}), $a = (t, e, n, r) => {
|
|
3969
3980
|
const s = r === 0 ? _(e.toString(), !0)?.getMonth() + 1 : void 0, a = r === t.length - 1 ? _(n.toString())?.getMonth() + 1 || 1 : void 0;
|
|
3970
3981
|
return { startMonth: s, endMonth: a };
|
|
3971
|
-
},
|
|
3982
|
+
}, Wa = ["FREQUENCY", "FREQ"], ho = (t, e) => {
|
|
3972
3983
|
const n = t?.[0]?.cubeRegions?.[0]?.memberSelection?.find(
|
|
3973
|
-
(i) =>
|
|
3974
|
-
)?.selectionValues, r =
|
|
3984
|
+
(i) => Wa.includes(i.componentId)
|
|
3985
|
+
)?.selectionValues, r = La(n || []), s = e?.startPeriod?.getTime() || 1, a = e?.endPeriod?.getTime() || 1, o = ka(a, s), c = [];
|
|
3975
3986
|
return o.forEach((i, u) => {
|
|
3976
|
-
const d = [], { startMonth: l, endMonth: m } =
|
|
3987
|
+
const d = [], { startMonth: l, endMonth: m } = $a(
|
|
3977
3988
|
o,
|
|
3978
3989
|
new Date(s),
|
|
3979
3990
|
new Date(a),
|
|
@@ -3981,33 +3992,33 @@ const Ea = (t) => /* @__PURE__ */ new Date(`${t}T00:00:00`), xa = (t) => {
|
|
|
3981
3992
|
), {
|
|
3982
3993
|
isDailyExist: x,
|
|
3983
3994
|
isWeeklyExist: P,
|
|
3984
|
-
isMonthlyExist:
|
|
3995
|
+
isMonthlyExist: M,
|
|
3985
3996
|
isQuarterlyExist: f,
|
|
3986
3997
|
isSemiAnnualExist: w,
|
|
3987
3998
|
isYearlyExist: v
|
|
3988
3999
|
} = r;
|
|
3989
|
-
v && d.push(i.toString()), w && d.push(...
|
|
3990
|
-
...
|
|
3991
|
-
),
|
|
3992
|
-
...
|
|
4000
|
+
v && d.push(i.toString()), w && d.push(...Oa(i, l, m)), f && d.push(
|
|
4001
|
+
...Ma(i, l, m, !1)
|
|
4002
|
+
), M && d.push(...Ra(i, l, m)), P && d.push(
|
|
4003
|
+
...Ya(i, s.toString(), a.toString())
|
|
3993
4004
|
), x && d.push(
|
|
3994
|
-
...
|
|
4005
|
+
...Sa(i, s.toString(), a.toString())
|
|
3995
4006
|
), c.push(...d);
|
|
3996
4007
|
}), c;
|
|
3997
4008
|
};
|
|
3998
|
-
function
|
|
4009
|
+
function qa(t) {
|
|
3999
4010
|
const { urn: e } = t.details;
|
|
4000
4011
|
return ue(e.resourceId, e.version, e.agencyId);
|
|
4001
4012
|
}
|
|
4002
|
-
function
|
|
4013
|
+
function go(t) {
|
|
4003
4014
|
const e = {};
|
|
4004
4015
|
for (const n of t.datasets) {
|
|
4005
|
-
const r = n.dataset, s =
|
|
4016
|
+
const r = n.dataset, s = qa(r);
|
|
4006
4017
|
e[s] = r.details.dimensions;
|
|
4007
4018
|
}
|
|
4008
4019
|
return e;
|
|
4009
4020
|
}
|
|
4010
|
-
function
|
|
4021
|
+
function wo(t) {
|
|
4011
4022
|
return t?.codelists?.length ? t.codelists.map((e) => ({
|
|
4012
4023
|
id: e.id,
|
|
4013
4024
|
agencyID: e.agencyID ?? "",
|
|
@@ -4030,7 +4041,7 @@ function go(t) {
|
|
|
4030
4041
|
}))
|
|
4031
4042
|
}));
|
|
4032
4043
|
}
|
|
4033
|
-
function
|
|
4044
|
+
function Ua(t, e) {
|
|
4034
4045
|
const n = (r) => {
|
|
4035
4046
|
const s = r.indexOf("(");
|
|
4036
4047
|
if (s === -1) return r;
|
|
@@ -4049,7 +4060,7 @@ function ce(t) {
|
|
|
4049
4060
|
function At(t, e, n) {
|
|
4050
4061
|
e?.forEach((r) => {
|
|
4051
4062
|
const { childId: s, agency: a, id: o, version: c } = nt(r.code), i = ue(o, c, a), u = n?.find(
|
|
4052
|
-
(l) =>
|
|
4063
|
+
(l) => Ua(i, ce(l))
|
|
4053
4064
|
), d = u?.codes?.find((l) => l.id === s);
|
|
4054
4065
|
if (d != null) {
|
|
4055
4066
|
const l = r.code.replace(
|
|
@@ -4061,7 +4072,7 @@ function At(t, e, n) {
|
|
|
4061
4072
|
At(t, r.hierarchicalCodes, n);
|
|
4062
4073
|
});
|
|
4063
4074
|
}
|
|
4064
|
-
function
|
|
4075
|
+
function po(t, e) {
|
|
4065
4076
|
const n = [];
|
|
4066
4077
|
return At(n, t?.hierarchicalCodes, e), n;
|
|
4067
4078
|
}
|
|
@@ -4071,7 +4082,7 @@ function yo(t) {
|
|
|
4071
4082
|
e[ce(n)] = n.codes;
|
|
4072
4083
|
}), e;
|
|
4073
4084
|
}
|
|
4074
|
-
function
|
|
4085
|
+
function bo(t, e, n) {
|
|
4075
4086
|
if (!n || n.length === 0 || !e)
|
|
4076
4087
|
return t;
|
|
4077
4088
|
const r = n[0].cubeRegions?.find(
|
|
@@ -4085,12 +4096,12 @@ function po(t, e, n) {
|
|
|
4085
4096
|
const a = new Set(s.selectionValues.map((o) => o.memberValue));
|
|
4086
4097
|
return t.filter((o) => a.has(o.id));
|
|
4087
4098
|
}
|
|
4088
|
-
class
|
|
4099
|
+
class Do {
|
|
4089
4100
|
constructor(e) {
|
|
4090
4101
|
this.client = e;
|
|
4091
4102
|
}
|
|
4092
4103
|
async getAvailableHierarchies(e, n, r) {
|
|
4093
|
-
const { agency: s, id: a, version: o } =
|
|
4104
|
+
const { agency: s, id: a, version: o } = S(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
4105
|
return this.client.request(
|
|
4095
4106
|
`${s}/${a}/${o}?references=hierarchy&detail=allcompletestubs`,
|
|
4096
4107
|
{ method: "GET", headers: u },
|
|
@@ -4099,7 +4110,7 @@ class bo {
|
|
|
4099
4110
|
);
|
|
4100
4111
|
}
|
|
4101
4112
|
async getHierarchy(e, n, r) {
|
|
4102
|
-
const { agency: s, id: a, version: o } =
|
|
4113
|
+
const { agency: s, id: a, version: o } = S(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
4114
|
return this.client.request(
|
|
4104
4115
|
`${s}/${a}/${o}?references=descendants&detail=full`,
|
|
4105
4116
|
{ method: "GET", headers: u },
|
|
@@ -4110,120 +4121,121 @@ class bo {
|
|
|
4110
4121
|
}
|
|
4111
4122
|
export {
|
|
4112
4123
|
we as Annotations,
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4124
|
+
Hs as AssignmentStatus,
|
|
4125
|
+
Ha as AvailabilityApi,
|
|
4126
|
+
qt as DATASET_DATA_URL,
|
|
4127
|
+
Qa as DatasetApi,
|
|
4117
4128
|
De as DimensionType,
|
|
4118
4129
|
St as DownloadType,
|
|
4119
|
-
|
|
4120
|
-
|
|
4130
|
+
Ga as FREQUENCY_DIMENSION_ID,
|
|
4131
|
+
Wa as FREQUENCY_DIM_ID,
|
|
4121
4132
|
Ct as FileColumnsAttribute,
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4133
|
+
Ft as GET_v3_FILTER_ALL,
|
|
4134
|
+
Fa as GET_v3_FILTER_AND,
|
|
4135
|
+
at as GET_v3_FILTER_OR,
|
|
4136
|
+
Do as HierarchyApi,
|
|
4137
|
+
Ks as OBSERVATION_KEY,
|
|
4138
|
+
Fs as OccurrenceType,
|
|
4139
|
+
ps as Periods,
|
|
4140
|
+
ws as RepresentationTextType,
|
|
4141
|
+
gs as SDMX_DATA_QUERY_PARAMS,
|
|
4131
4142
|
oe as SINGLE_WILDCARD_SYMBOL,
|
|
4132
|
-
|
|
4143
|
+
Ba as SdmxApiClient,
|
|
4133
4144
|
rt as SdmxAvailabilityMode,
|
|
4134
|
-
|
|
4145
|
+
C as SdmxDataFormat,
|
|
4135
4146
|
st as SdmxDetails,
|
|
4136
4147
|
de as SdmxReferences,
|
|
4137
4148
|
k as SeriesFilterOperator,
|
|
4138
4149
|
ys as TIME_PERIOD,
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4150
|
+
Ds as TIME_PERIOD_END_ANNOTATION_KEY,
|
|
4151
|
+
bs as TIME_PERIOD_START_ANNOTATION_KEY,
|
|
4152
|
+
go as buildDatasetDimensionsMetadataMap,
|
|
4153
|
+
ua as dailyPattern,
|
|
4154
|
+
ta as decodeDimensionId,
|
|
4155
|
+
Ka as findCodelistByDimension,
|
|
4145
4156
|
Ye as generateDatasetDataRequest,
|
|
4146
4157
|
ue as generateShortUrn,
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4158
|
+
ho as getAdditionalColumns,
|
|
4159
|
+
Xa as getAnnotationPeriod,
|
|
4160
|
+
ye as getArtifactByUrnWithWildCard,
|
|
4161
|
+
Ja as getAttachedDimensionsSeriesByDimension,
|
|
4162
|
+
Ws as getAttachedDimensionsSeriesByTsId,
|
|
4152
4163
|
Et as getAttachedDimensionsSeriesKey,
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4164
|
+
qs as getAttributeValueFromDataQueryResponse,
|
|
4165
|
+
Za as getAvailableCodes,
|
|
4166
|
+
ja as getAvailableCodesFromConstrains,
|
|
4156
4167
|
nt as getChildParsedUrn,
|
|
4157
4168
|
yo as getCodeListsData,
|
|
4158
4169
|
be as getConcept,
|
|
4159
4170
|
je as getConceptByUrn,
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4171
|
+
Ls as getConceptWithScheme,
|
|
4172
|
+
Us as getConvertedMetaAttributes,
|
|
4173
|
+
fa as getDailyRegExp,
|
|
4174
|
+
Sa as getDaysColumns,
|
|
4175
|
+
eo as getDimensionTitle,
|
|
4165
4176
|
ze as getDimensions,
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4177
|
+
hs as getFilteredItemsWithParents,
|
|
4178
|
+
Ms as getFiltersDtoFromDataQuery,
|
|
4179
|
+
za as getFiltersDtoMapFromDataQuery,
|
|
4180
|
+
bo as getHierarchyAvailableCodes,
|
|
4181
|
+
po as getHierarchyCodes,
|
|
4171
4182
|
Z as getISOWeek,
|
|
4172
4183
|
z as getKeyFromUrn,
|
|
4173
|
-
|
|
4184
|
+
Va as getLastUpdatedTime,
|
|
4174
4185
|
Ke as getLastWeekNumberOfYear,
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4186
|
+
pe as getLocalizedName,
|
|
4187
|
+
Ra as getMonthlyData,
|
|
4188
|
+
fo as getMonthlyDataByQuarter,
|
|
4178
4189
|
Oe as getMonthlyRegExp,
|
|
4179
4190
|
vt as getParsedEndPeriodDate,
|
|
4180
|
-
|
|
4191
|
+
uo as getParsedResponse,
|
|
4181
4192
|
Pt as getParsedStartPeriodDate,
|
|
4182
4193
|
_ as getPeriodDate,
|
|
4183
|
-
|
|
4184
|
-
|
|
4194
|
+
La as getPeriods,
|
|
4195
|
+
lo as getQuarterByMonth,
|
|
4185
4196
|
Ne as getQuarterlyRegExp,
|
|
4186
|
-
|
|
4187
|
-
|
|
4197
|
+
Ma as getQuartersData,
|
|
4198
|
+
js as getQueryTimePeriodFilters,
|
|
4188
4199
|
Lt as getRequestAcceptHeader,
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4200
|
+
Is as getResolvedVersionBySingleWildcard,
|
|
4201
|
+
$t as getResponseContentType,
|
|
4202
|
+
Oa as getSemiAnnualData,
|
|
4203
|
+
la as getSemiAnnuallyRegExp,
|
|
4192
4204
|
ie as getSeriesAttributes,
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4205
|
+
Js as getSeriesName,
|
|
4206
|
+
so as getStructureComponentsMap,
|
|
4207
|
+
to as getStructureDimensions,
|
|
4208
|
+
ro as getTimeDimension,
|
|
4209
|
+
no as getTimePeriods,
|
|
4210
|
+
co as getTimeQueryFilter,
|
|
4211
|
+
zs as getTimeRangeFromAttachment,
|
|
4212
|
+
ao as getTimeSeriesCount,
|
|
4213
|
+
io as getTimeSeriesFilterKey,
|
|
4214
|
+
ea as getTimeSeriesId,
|
|
4203
4215
|
xt as getWeekCode,
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4216
|
+
Vs as getWeeklyPeriodEndDate,
|
|
4217
|
+
Bs as getWeeklyPeriodStartDate,
|
|
4218
|
+
ha as getWeeklyRegExp,
|
|
4219
|
+
Ya as getWeeksColumns,
|
|
4220
|
+
Cs as getWildCardPrefix,
|
|
4209
4221
|
Ot as getYearPeriod,
|
|
4210
4222
|
Pe as getYearlyRegExp,
|
|
4211
|
-
|
|
4212
|
-
|
|
4223
|
+
ka as getYears,
|
|
4224
|
+
ma as isDaily,
|
|
4213
4225
|
Ae as isMonthly,
|
|
4214
4226
|
Re as isQuarterly,
|
|
4215
4227
|
Me as isSemiAnnually,
|
|
4216
4228
|
ke as isWeekly,
|
|
4217
|
-
|
|
4229
|
+
Ss as isWildCardVersionCorrect,
|
|
4218
4230
|
ve as isYearly,
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4231
|
+
da as monthlyPattern,
|
|
4232
|
+
oo as openDownloadWindow,
|
|
4233
|
+
aa as quarterPattern,
|
|
4234
|
+
wo as resolveCodelistsFromResponse,
|
|
4235
|
+
ia as semiAnnuallyPattern,
|
|
4236
|
+
mo as sortPeriods,
|
|
4237
|
+
S as splitUrn,
|
|
4238
|
+
Ua as urnMatchesIgnoreVersion,
|
|
4239
|
+
oa as weeklyPattern,
|
|
4240
|
+
ca as yearlyPattern
|
|
4229
4241
|
};
|