@epam/statgpt-sdmx-toolkit 0.2.0-rc.7 → 0.2.0-rc.8

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/index.mjs CHANGED
@@ -5,43 +5,38 @@ const I = (e) => {
5
5
  }
6
6
  }, p = (e) => {
7
7
  var r;
8
- if (e == null)
9
- return {};
10
- const t = I(e), n = {
8
+ const t = {
11
9
  agency: "",
12
10
  id: "",
13
11
  version: ""
14
- }, s = (o) => typeof o == "string" && /^[a-zA-Z0-9_.-]+$/.test(o);
15
- if (t) {
16
- if (t.includes(":")) {
17
- const o = t.split(":")[0], i = t.split(":")[1].split("(")[0];
18
- n.agency = s(o) ? o : "", n.id = s(i) ? i : "";
19
- }
20
- if (t.includes("(") && t.includes(")")) {
21
- const o = (r = t.split("(")[1]) == null ? void 0 : r.split(")")[0];
22
- n.version = s(o) ? o : "";
23
- }
12
+ };
13
+ if (e == null)
14
+ return t;
15
+ const n = I(e);
16
+ if (n && (n.includes(":") && (t.agency = n.split(":")[0], t.id = n.split(":")[1].split("(")[0]), n.includes("("))) {
17
+ const s = n.split("(");
18
+ t.version = (r = s[1]) == null ? void 0 : r.split(")")[0], t.id || (t.id = s[0]);
24
19
  }
25
- return n;
20
+ return t;
26
21
  }, Pe = (e) => {
27
- const [t, n] = e.split(")."), { agency: s, id: r, version: o } = p(t + ")");
28
- return { childId: n, agency: s, id: r, version: o };
22
+ const [t, n] = e.split(")."), { agency: r, id: s, version: o } = p(t + ")");
23
+ return { childId: n, agency: r, id: s, version: o };
29
24
  }, Sn = (e, t, n) => {
30
- const s = t === "" ? "" : `(${t})`;
31
- return `${n}:${e}${s}`;
25
+ const r = t === "" ? "" : `(${t})`;
26
+ return `${n}:${e}${r}`;
32
27
  };
33
- var k = /* @__PURE__ */ ((e) => (e.DESCENDANTS = "descendants", e.NONE = "none", e.ALL = "all", e))(k || {}), De = /* @__PURE__ */ ((e) => (e.EXACT = "exact", e.AVAILABLE = "available", e))(De || {});
28
+ var q = /* @__PURE__ */ ((e) => (e.DESCENDANTS = "descendants", e.NONE = "none", e.ALL = "all", e))(q || {}), De = /* @__PURE__ */ ((e) => (e.EXACT = "exact", e.AVAILABLE = "available", e))(De || {});
34
29
  const Oe = (e = "", t = "", n = "") => `sdmx/3.0/availability/dataflow/${e}/${t}/${n}`;
35
30
  class Tn {
36
31
  constructor(t) {
37
32
  this.client = t;
38
33
  }
39
34
  async getConstraints(t, n) {
40
- const { agency: s, id: r, version: o } = p(t), i = {
35
+ const { agency: r, id: s, version: o } = p(t), i = {
41
36
  filters: n || [],
42
37
  mode: De.AVAILABLE,
43
- references: k.NONE
44
- }, c = Oe(s, r, o);
38
+ references: q.NONE
39
+ }, c = Oe(r, s, o);
45
40
  return await this.client.postRequest(c, { body: i });
46
41
  }
47
42
  }
@@ -68,55 +63,55 @@ const Ue = (e, t) => {
68
63
  }
69
64
  }, m = (e, t) => `${e}; labels=${t}`;
70
65
  var ye = /* @__PURE__ */ ((e) => (e.REFERENCE_PARTIAL = "referencepartial", e.FULL = "full", e))(ye || {});
71
- const xe = "all", Ye = "sdmx/3.0/data/dataflow", Se = "&", se = ":", Ce = "=", We = "+", Rn = ",", ke = "*", re = (e, t, n) => {
72
- const { filterKey: s, timeFilter: r } = n, { agency: o, id: i, version: c } = p(e), a = [r || "", t].filter((l) => !!l).join(Se);
73
- return `${`${Ye}/${o}/${i}/${c}`}/${s || ke}?${a}`;
74
- }, qe = (e = "", t = "", n = "", s = k.DESCENDANTS) => `sdmx/3.0/structure/dataflow/${e}/${t}/${n}?references=${s}&detail=${ye.REFERENCE_PARTIAL}`;
66
+ const xe = "all", Ye = "sdmx/3.0/data/dataflow", Se = "&", re = ":", Ce = "=", We = "+", Rn = ",", qe = "*", se = (e, t, n) => {
67
+ const { filterKey: r, timeFilter: s } = n, { agency: o, id: i, version: c } = p(e), a = [s || "", t].filter((l) => !!l).join(Se);
68
+ return `${`${Ye}/${o}/${i}/${c}`}/${r || qe}?${a}`;
69
+ }, Me = (e = "", t = "", n = "", r = q.DESCENDANTS) => `sdmx/3.0/structure/dataflow/${e}/${t}/${n}?references=${r}&detail=${ye.REFERENCE_PARTIAL}`;
75
70
  class wn {
76
71
  constructor(t) {
77
72
  this.client = t;
78
73
  }
79
74
  async getDataSet(t, n) {
80
- const { agency: s, id: r, version: o } = p(t);
75
+ const { agency: r, id: s, version: o } = p(t);
81
76
  return await this.client.getRequest(
82
- qe(s, r, o, n)
77
+ Me(r, s, o, n)
83
78
  );
84
79
  }
85
80
  async getDatasetData(t, n) {
86
- const s = new URLSearchParams({
81
+ const r = new URLSearchParams({
87
82
  includeHistory: "false",
88
83
  limit: "1000",
89
84
  attributes: xe,
90
85
  dimensionAtObservation: "TIME_PERIOD"
91
86
  // TODO: use time dimensions
92
- }).toString(), r = re(t, s, n);
93
- return await this.client.getRequest(r);
87
+ }).toString(), s = se(t, r, n);
88
+ return await this.client.getRequest(s);
94
89
  }
95
- async downloadDataSet(t, n, s, r, o, i, c = !1) {
90
+ async downloadDataSet(t, n, r, s, o, i, c = !1) {
96
91
  const a = new URLSearchParams({
97
92
  format: n,
98
93
  compress: "false",
99
94
  attributes: c ? "all" : "none",
100
95
  limit: "1000"
101
- }).toString(), u = re(t, a, o);
96
+ }).toString(), u = se(t, a, o);
102
97
  return this.client.streamRequest(
103
98
  u,
104
99
  {
105
100
  method: "GET",
106
101
  headers: {
107
- Accept: Ue(n, r),
108
- "Accept-language": s
102
+ Accept: Ue(n, s),
103
+ "Accept-language": r
109
104
  }
110
105
  },
111
106
  i
112
107
  );
113
108
  }
114
109
  }
115
- const Me = (e, t) => e.error || e.message || `${t.status} ${t.statusText}`, Qe = "application/json", Be = "Content-Type", x = "Api-Key", Ve = "X-CONVERSATION-ID", N = "Ocp-Apim-Subscription-Key", v = (e) => isNaN(Date.parse(e)) ? null : new Date(e), Y = (e, t, n) => {
116
- const s = {
110
+ const ke = (e, t) => e.error || e.message || `${t.status} ${t.statusText}`, Qe = "application/json", Be = "Content-Type", x = "Api-Key", Ve = "X-CONVERSATION-ID", N = "Ocp-Apim-Subscription-Key", v = (e) => isNaN(Date.parse(e)) ? null : new Date(e), Y = (e, t, n) => {
111
+ const r = {
117
112
  [Be]: (t == null ? void 0 : t.contentType) || Qe
118
113
  };
119
- return t != null && t.jwt && (s.Authorization = `Bearer ${t.jwt}`), t != null && t.chatReference && (s[Ve] = t.chatReference), { ...s, ...n };
114
+ return t != null && t.jwt && (r.Authorization = `Bearer ${t.jwt}`), t != null && t.chatReference && (r[Ve] = t.chatReference), { ...r, ...n };
120
115
  }, Fe = (e) => {
121
116
  const t = { ...e };
122
117
  return t[x] && (t[x] = t[x].substring(0, 8) + "...[REDACTED]"), t.Authorization && (t.Authorization = "Bearer [REDACTED]"), t[N] && (t[N] = t[N].substring(0, 8) + "...[REDACTED]"), t;
@@ -124,34 +119,34 @@ const Me = (e, t) => e.error || e.message || `${t.status} ${t.statusText}`, Qe =
124
119
  method: n.method || "GET",
125
120
  headers: t,
126
121
  body: n.body ? JSON.stringify(n.body) : void 0
127
- }), Ge = async (e, t, n) => await fetch(e, {
122
+ }), Ke = async (e, t, n) => await fetch(e, {
128
123
  method: n.method,
129
124
  headers: t,
130
125
  body: n != null && n.isFormData && typeof (n == null ? void 0 : n.body) == "string" ? n.body : JSON.stringify(n.body),
131
126
  signal: n == null ? void 0 : n.signal
132
127
  });
133
- class Ke {
128
+ class Ge {
134
129
  constructor() {
135
130
  this.decoder = new TextDecoder();
136
131
  }
137
- async streamChat(t, n, s = {}, r) {
138
- const { onMessage: o, onError: i, onComplete: c, signal: a } = s;
132
+ async streamChat(t, n, r = {}, s) {
133
+ const { onMessage: o, onError: i, onComplete: c, signal: a } = r;
139
134
  try {
140
135
  const u = await this.initializeStreamRequest(
141
136
  t,
142
137
  n,
143
138
  a,
144
- r
139
+ s
145
140
  );
146
141
  await this.processStreamData(u, o), c == null || c();
147
142
  } catch (u) {
148
143
  this.handleStreamError(u, i);
149
144
  }
150
145
  }
151
- async initializeStreamRequest(t, n, s, r) {
146
+ async initializeStreamRequest(t, n, r, s) {
152
147
  const o = Y(void 0, {
153
- jwt: r
154
- }), i = await Ge(
148
+ jwt: s
149
+ }), i = await Ke(
155
150
  t,
156
151
  {
157
152
  Accept: "text/event-stream",
@@ -160,7 +155,7 @@ class Ke {
160
155
  {
161
156
  method: "POST",
162
157
  body: n,
163
- signal: s
158
+ signal: r
164
159
  }
165
160
  );
166
161
  if (!i.ok) {
@@ -174,19 +169,19 @@ class Ke {
174
169
  return i.body.getReader();
175
170
  }
176
171
  async processStreamData(t, n) {
177
- let s = "";
172
+ let r = "";
178
173
  try {
179
174
  for (; ; ) {
180
- const { done: r, value: o } = await t.read();
181
- if (r) {
182
- s.trim() && this.parseSSEDataLine(s, n);
175
+ const { done: s, value: o } = await t.read();
176
+ if (s) {
177
+ r.trim() && this.parseSSEDataLine(r, n);
183
178
  break;
184
179
  }
185
180
  const i = this.decoder.decode(o, { stream: !0 });
186
- s += i;
187
- const c = s.split(`
181
+ r += i;
182
+ const c = r.split(`
188
183
  `);
189
- s = c.pop() || "";
184
+ r = c.pop() || "";
190
185
  for (const a of c)
191
186
  this.parseSSEDataLine(a, n);
192
187
  }
@@ -195,27 +190,27 @@ class Ke {
195
190
  }
196
191
  }
197
192
  handleStreamError(t, n) {
198
- const s = t instanceof Error ? t : new Error(String(t));
199
- throw n == null || n(s), s;
193
+ const r = t instanceof Error ? t : new Error(String(t));
194
+ throw n == null || n(r), r;
200
195
  }
201
196
  parseSSEDataLine(t, n) {
202
- const s = t.trim();
203
- if (!(!s || s.startsWith(":")) && s.startsWith("data: ")) {
204
- const r = s.slice(6);
205
- if (r === "[DONE]") {
197
+ const r = t.trim();
198
+ if (!(!r || r.startsWith(":")) && r.startsWith("data: ")) {
199
+ const s = r.slice(6);
200
+ if (s === "[DONE]") {
206
201
  console.info("SSE: Stream completed");
207
202
  return;
208
203
  }
209
204
  try {
210
- const o = JSON.parse(r);
205
+ const o = JSON.parse(s);
211
206
  n == null || n(o);
212
207
  } catch (o) {
213
- console.error(`Failed to parse SSE data: ${r} ${o}`);
208
+ console.error(`Failed to parse SSE data: ${s} ${o}`);
214
209
  }
215
210
  }
216
211
  }
217
212
  }
218
- new Ke();
213
+ new Ge();
219
214
  class pn {
220
215
  constructor(t) {
221
216
  this.config = t, console.info("SdmxApiClient initialized", {
@@ -228,8 +223,8 @@ class pn {
228
223
  async postRequest(t, n) {
229
224
  return this.request(t, { ...n, method: "POST" });
230
225
  }
231
- async streamRequest(t, n, s) {
232
- const r = `${this.config.apiUrl}/${t}`, o = {
226
+ async streamRequest(t, n, r) {
227
+ const s = `${this.config.apiUrl}/${t}`, o = {
233
228
  ...Y(void 0, {
234
229
  jwt: this.config.jwt
235
230
  }),
@@ -240,7 +235,7 @@ class pn {
240
235
  async start(a) {
241
236
  var u;
242
237
  try {
243
- const l = await oe(r, o, n);
238
+ const l = await oe(s, o, n);
244
239
  if (!l.ok) {
245
240
  const g = await l.text();
246
241
  throw console.error(
@@ -261,27 +256,27 @@ class pn {
261
256
  }
262
257
  }
263
258
  }), c = new Headers({
264
- "Content-Disposition": `attachment; filename=${encodeURIComponent(s)}`
259
+ "Content-Disposition": `attachment; filename=${encodeURIComponent(r)}`
265
260
  });
266
261
  return new Response(i, { headers: c });
267
262
  }
268
263
  async request(t, n) {
269
- const s = Date.now(), r = t.includes("availability") && this.config.constrainsApiUrl ? `${this.config.constrainsApiUrl}/${t}` : `${this.config.apiUrl}/${t}`, o = {
264
+ const r = Date.now(), s = t.includes("availability") && this.config.constrainsApiUrl ? `${this.config.constrainsApiUrl}/${t}` : `${this.config.apiUrl}/${t}`, o = {
270
265
  ...Y(void 0, {
271
266
  jwt: this.config.jwt
272
267
  }),
273
268
  ...n.headers
274
269
  };
275
- this.config.apiKey != null && (o["Ocp-Apim-Subscription-Key"] = this.config.apiKey), this.addInfoRequestLog("API Request", r, n, o);
270
+ this.config.apiKey != null && (o["Ocp-Apim-Subscription-Key"] = this.config.apiKey), this.addInfoRequestLog("API Request", s, n, o);
276
271
  try {
277
- const i = await oe(r, o, n), c = Date.now() - s;
272
+ const i = await oe(s, o, n), c = Date.now() - r;
278
273
  let a;
279
274
  const u = await i.text();
280
275
  try {
281
276
  a = u ? JSON.parse(u) : {};
282
277
  } catch {
283
278
  if (this.addErrorRequestParsing(
284
- r,
279
+ s,
285
280
  n,
286
281
  i,
287
282
  c,
@@ -293,57 +288,57 @@ class pn {
293
288
  a = { data: u };
294
289
  }
295
290
  if (!i.ok) {
296
- this.addErrorRequestLog(r, n, i, c, a);
297
- const l = Me(a, i);
291
+ this.addErrorRequestLog(s, n, i, c, a);
292
+ const l = ke(a, i);
298
293
  throw new Error(`API request failed: ${l}`);
299
294
  }
300
295
  return a;
301
296
  } catch (i) {
302
- const c = Date.now() - s;
297
+ const c = Date.now() - r;
303
298
  throw console.error("API Request Exception", {
304
299
  method: n.method,
305
- url: r,
300
+ url: s,
306
301
  duration: `${c}ms`,
307
302
  error: i instanceof Error ? i.message : String(i)
308
303
  }), i;
309
304
  }
310
305
  }
311
- addInfoRequestLog(t, n, s, r) {
306
+ addInfoRequestLog(t, n, r, s) {
312
307
  const o = {
313
- method: s.method || "GET",
308
+ method: r.method || "GET",
314
309
  url: n,
315
- headers: Fe(r)
310
+ headers: Fe(s)
316
311
  };
317
- s.body && (o.body = s.body), console.info(t, o);
312
+ r.body && (o.body = r.body), console.info(t, o);
318
313
  }
319
- addErrorRequestLog(t, n, s, r, o) {
314
+ addErrorRequestLog(t, n, r, s, o) {
320
315
  console.error("API Request Failed", {
321
316
  method: n.method,
322
317
  url: t,
323
- status: s.status,
324
- statusText: s.statusText,
325
- duration: `${r}ms`,
318
+ status: r.status,
319
+ statusText: r.statusText,
320
+ duration: `${s}ms`,
326
321
  response: o
327
322
  });
328
323
  }
329
- addErrorRequestParsing(t, n, s, r, o) {
324
+ addErrorRequestParsing(t, n, r, s, o) {
330
325
  console.error("API Response Parse Error", {
331
326
  method: n.method,
332
327
  url: t,
333
- status: s.status,
334
- statusText: s.statusText,
335
- duration: `${r}ms`,
328
+ status: r.status,
329
+ statusText: r.statusText,
330
+ duration: `${s}ms`,
336
331
  responseText: o.substring(0, 200),
337
332
  error: "Response is not valid JSON"
338
333
  });
339
334
  }
340
335
  }
341
336
  const mn = ["FREQ", "FREQUENCY"];
342
- var je = /* @__PURE__ */ ((e) => (e.CONDITIONAL = "Conditional", e.MANDATORY = "Mandatory", e))(je || {}), q = /* @__PURE__ */ ((e) => (e.DIMENSION = "Dimension", e.MEASURE_DIMENSION = "MeasureDimension", e.TIME_DIMENSION = "TimeDimension", e))(q || {}), ze = /* @__PURE__ */ ((e) => (e.UNBOUNDED = "unbounded", e))(ze || {});
337
+ var je = /* @__PURE__ */ ((e) => (e.CONDITIONAL = "Conditional", e.MANDATORY = "Mandatory", e))(je || {}), M = /* @__PURE__ */ ((e) => (e.DIMENSION = "Dimension", e.MEASURE_DIMENSION = "MeasureDimension", e.TIME_DIMENSION = "TimeDimension", e))(M || {}), ze = /* @__PURE__ */ ((e) => (e.UNBOUNDED = "unbounded", e))(ze || {});
343
338
  const He = (e, t) => {
344
339
  var c, a, u, l, f;
345
- const n = (a = (c = e == null ? void 0 : e.data) == null ? void 0 : c.dataSets) == null ? void 0 : a[0], s = (l = (u = e == null ? void 0 : e.data) == null ? void 0 : u.structures) == null ? void 0 : l[0], r = ((f = s == null ? void 0 : s.attributes) == null ? void 0 : f.dimensionGroup) || [], o = n == null ? void 0 : n.dimensionGroupAttributes, i = {};
346
- for (const E of r) {
340
+ const n = (a = (c = e == null ? void 0 : e.data) == null ? void 0 : c.dataSets) == null ? void 0 : a[0], r = (l = (u = e == null ? void 0 : e.data) == null ? void 0 : u.structures) == null ? void 0 : l[0], s = ((f = r == null ? void 0 : r.attributes) == null ? void 0 : f.dimensionGroup) || [], o = n == null ? void 0 : n.dimensionGroupAttributes, i = {};
341
+ for (const E of s) {
347
342
  const d = E.relationship.dimensions, { codedSeriesKey: g, decodedSeriesKey: h } = Te(
348
343
  e,
349
344
  t,
@@ -358,12 +353,12 @@ const He = (e, t) => {
358
353
  return i;
359
354
  }, Te = (e, t, n) => {
360
355
  var c, a;
361
- const s = (a = (c = e == null ? void 0 : e.data) == null ? void 0 : c.structures) == null ? void 0 : a[0], r = [
362
- ...(s == null ? void 0 : s.dimensions.series) || [],
363
- ...(s == null ? void 0 : s.dimensions.observation) || []
364
- ], o = new Array(r == null ? void 0 : r.length), i = new Array(r == null ? void 0 : r.length);
356
+ const r = (a = (c = e == null ? void 0 : e.data) == null ? void 0 : c.structures) == null ? void 0 : a[0], s = [
357
+ ...(r == null ? void 0 : r.dimensions.series) || [],
358
+ ...(r == null ? void 0 : r.dimensions.observation) || []
359
+ ], o = new Array(s == null ? void 0 : s.length), i = new Array(s == null ? void 0 : s.length);
365
360
  return n == null || n.forEach((u) => {
366
- const l = (r == null ? void 0 : r.findIndex((d) => d.id === u)) || 0, f = t[l], E = r[l].values.findIndex(
361
+ const l = (s == null ? void 0 : s.findIndex((d) => d.id === u)) || 0, f = t[l], E = s[l].values.findIndex(
367
362
  (d) => d.id === f || d.value === f
368
363
  ) || 0;
369
364
  o[l] = E >= 0 ? E : f, i[l] = f;
@@ -373,14 +368,14 @@ const He = (e, t) => {
373
368
  };
374
369
  }, vn = (e, t, n) => {
375
370
  var f, E, d, g, h;
376
- const s = (E = (f = e == null ? void 0 : e.data) == null ? void 0 : f.dataSets) == null ? void 0 : E[0], r = (g = (d = e == null ? void 0 : e.data) == null ? void 0 : d.structures) == null ? void 0 : g[0], o = (((h = r == null ? void 0 : r.attributes) == null ? void 0 : h.dimensionGroup) || []).filter(
371
+ const r = (E = (f = e == null ? void 0 : e.data) == null ? void 0 : f.dataSets) == null ? void 0 : E[0], s = (g = (d = e == null ? void 0 : e.data) == null ? void 0 : d.structures) == null ? void 0 : g[0], o = (((h = s == null ? void 0 : s.attributes) == null ? void 0 : h.dimensionGroup) || []).filter(
377
372
  (D) => {
378
373
  var A;
379
374
  return ((A = D.relationship.dimensions) == null ? void 0 : A.length) === 1 && D.relationship.dimensions.includes(t || "");
380
375
  }
381
- ), i = s == null ? void 0 : s.dimensionGroupAttributes, c = [
382
- ...(r == null ? void 0 : r.dimensions.series) || [],
383
- ...(r == null ? void 0 : r.dimensions.observation) || []
376
+ ), i = r == null ? void 0 : r.dimensionGroupAttributes, c = [
377
+ ...(s == null ? void 0 : s.dimensions.series) || [],
378
+ ...(s == null ? void 0 : s.dimensions.observation) || []
384
379
  ], a = c == null ? void 0 : c.findIndex((D) => D.id === t), u = new Array(c == null ? void 0 : c.length);
385
380
  u[a] = n || "";
386
381
  const l = {};
@@ -398,17 +393,17 @@ const He = (e, t) => {
398
393
  }
399
394
  return l;
400
395
  }, Je = (e, t) => {
401
- var s;
396
+ var r;
402
397
  if (t == null)
403
398
  return;
404
- const n = (s = e.values) == null ? void 0 : s[t];
399
+ const n = (r = e.values) == null ? void 0 : r[t];
405
400
  return n ?? (t instanceof Array ? { values: t } : { value: t.toString() });
406
401
  }, Xe = "Observation", $n = (e) => {
407
402
  var u, l, f, E, d, g;
408
403
  const t = (u = e == null ? void 0 : e.data) == null ? void 0 : u.dataSets, n = (f = (l = e == null ? void 0 : e.data) == null ? void 0 : l.structures) == null ? void 0 : f[0];
409
404
  if (!t || !n)
410
405
  return [];
411
- const s = n.attributes, r = n.dimensions, o = (s == null ? void 0 : s.dimensionGroup) || [], i = t[0].series || t[0].observations, c = (E = r.series) != null && E.length ? r.series : r.observation, a = [];
406
+ const r = n.attributes, s = n.dimensions, o = (r == null ? void 0 : r.dimensionGroup) || [], i = t[0].series || t[0].observations, c = (E = s.series) != null && E.length ? s.series : s.observation, a = [];
412
407
  for (const h in i) {
413
408
  const D = [], { name: A, parsedTimeSeriesValue: y } = Ze(
414
409
  h,
@@ -425,12 +420,12 @@ const He = (e, t) => {
425
420
  continue;
426
421
  }
427
422
  D.push(
428
- ...st(S, n)
423
+ ...rt(S, n)
429
424
  );
430
425
  const O = C(
431
- (s == null ? void 0 : s.series) || [],
426
+ (r == null ? void 0 : r.series) || [],
432
427
  (T) => P[T]
433
- ), L = rt(
428
+ ), L = st(
434
429
  ((d = n.attributes) == null ? void 0 : d.dataSet) || [],
435
430
  ((g = t[0].attributes) == null ? void 0 : g.filter((T) => T != null)) || []
436
431
  ), b = He(
@@ -458,28 +453,28 @@ const He = (e, t) => {
458
453
  }
459
454
  return a;
460
455
  }, Ze = (e, t) => {
461
- const n = e.split(new RegExp("(?<!\\|):(?!\\||$)")), s = [];
462
- for (let r = 0; r < n.length; r++) {
463
- const o = t == null ? void 0 : t[r], i = Number(n[r]);
456
+ const n = e.split(new RegExp("(?<!\\|):(?!\\||$)")), r = [];
457
+ for (let s = 0; s < n.length; s++) {
458
+ const o = t == null ? void 0 : t[s], i = Number(n[s]);
464
459
  if (i < 0 || o == null)
465
460
  continue;
466
461
  const c = o.values[i];
467
462
  if (c == null) {
468
- s.push(n[r].replace("|:", ":"));
463
+ r.push(n[s].replace("|:", ":"));
469
464
  continue;
470
465
  }
471
- s.push((c == null ? void 0 : c.id) || (c == null ? void 0 : c.value) || "");
466
+ r.push((c == null ? void 0 : c.id) || (c == null ? void 0 : c.value) || "");
472
467
  }
473
468
  return {
474
- name: tt(s),
475
- parsedTimeSeriesValue: s
469
+ name: tt(r),
470
+ parsedTimeSeriesValue: r
476
471
  };
477
472
  }, C = (e, t) => {
478
473
  const n = [];
479
- for (let s = 0; s < e.length; s++) {
480
- const r = e[s], o = t(s), i = o != null && r.values != null ? et(o, r) : void 0;
474
+ for (let r = 0; r < e.length; r++) {
475
+ const s = e[r], o = t(r), i = o != null && s.values != null ? et(o, s) : void 0;
481
476
  n.push({
482
- name: r.id,
477
+ name: s.id,
483
478
  value: i
484
479
  });
485
480
  }
@@ -487,7 +482,7 @@ const He = (e, t) => {
487
482
  }, et = (e, t) => {
488
483
  const n = t.values[e];
489
484
  return n == null ? typeof e == "object" ? e : e.toString() : (n == null ? void 0 : n.id) || (n == null ? void 0 : n.value) || (n == null ? void 0 : n.ids) || (n == null ? void 0 : n.values);
490
- }, tt = (e) => e.map((t) => t ? nt(t) : "").join("."), nt = (e) => e.replace(/\./g, "|.").replace(/:/g, "|:"), st = (e, t) => {
485
+ }, tt = (e) => e.map((t) => t ? nt(t) : "").join("."), nt = (e) => e.replace(/\./g, "|.").replace(/:/g, "|:"), rt = (e, t) => {
491
486
  var i, c, a, u, l;
492
487
  const n = (c = (i = t.measures) == null ? void 0 : i.observation) == null ? void 0 : c.length;
493
488
  if (e.observations == null)
@@ -501,92 +496,92 @@ const He = (e, t) => {
501
496
  dimensionAtObservation: Xe
502
497
  }
503
498
  ];
504
- const s = e.observations, r = (u = t.dimensions.observation) == null ? void 0 : u[0], o = [];
505
- for (const f in s) {
506
- const E = r == null ? void 0 : r.values[f];
499
+ const r = e.observations, s = (u = t.dimensions.observation) == null ? void 0 : u[0], o = [];
500
+ for (const f in r) {
501
+ const E = s == null ? void 0 : s.values[f];
507
502
  o.push({
508
503
  dimensionAtObservation: (E == null ? void 0 : E.value) || (E == null ? void 0 : E.id),
509
504
  values: ie(
510
- s[f],
505
+ r[f],
511
506
  t.measures
512
507
  ),
513
508
  obsAttributes: C(
514
509
  ((l = t.attributes) == null ? void 0 : l.observation) || [],
515
- (d) => s[f][d + n]
510
+ (d) => r[f][d + n]
516
511
  )
517
512
  });
518
513
  }
519
514
  return o;
520
515
  }, ie = (e, t) => {
521
516
  var n;
522
- return ((n = t == null ? void 0 : t.observation) == null ? void 0 : n.map((s, r) => ({ name: s.id, value: e[r] }))) || [];
523
- }, rt = (e, t) => e.reduce(
524
- (n, s, r) => {
525
- const o = t[r];
526
- return ot(n, s, o, ""), n;
517
+ return ((n = t == null ? void 0 : t.observation) == null ? void 0 : n.map((r, s) => ({ name: r.id, value: e[s] }))) || [];
518
+ }, st = (e, t) => e.reduce(
519
+ (n, r, s) => {
520
+ const o = t[s];
521
+ return ot(n, r, o, ""), n;
527
522
  },
528
523
  []
529
- ), ot = (e, t, n, s) => {
524
+ ), ot = (e, t, n, r) => {
530
525
  var o, i, c;
531
- const r = n != null ? ((o = t == null ? void 0 : t.values) == null ? void 0 : o.length) > 0 ? ((i = t.values[n]) == null ? void 0 : i.id) || ((c = t.values[n]) == null ? void 0 : c.value) : String(n) : s;
526
+ const s = n != null ? ((o = t == null ? void 0 : t.values) == null ? void 0 : o.length) > 0 ? ((i = t.values[n]) == null ? void 0 : i.id) || ((c = t.values[n]) == null ? void 0 : c.value) : String(n) : r;
532
527
  e.push({
533
528
  name: t.id,
534
- value: r || ""
529
+ value: s || ""
535
530
  });
536
- }, it = /^[0-9][0-9][0-9][0-9]-Q[1-4]$/, ct = /^[0-9][0-9][0-9][0-9]-W[0-9][0-9]?$/, at = /^[0-9][0-9][0-9][0-9]-S[1-2]$/, ut = /^[0-9][0-9][0-9][0-9]$/, lt = /^[0-9][0-9][0-9][0-9]-(0[1-9]|1[0-2])-[0-9][0-9]$/, dt = /^[0-9][0-9][0-9][0-9]-M(0[1-9]|(1[0-2]))$/, M = (e) => ut.exec(e), Q = (e) => !!M(e), ft = (e) => at.exec(e), B = (e) => !!ft(e), V = (e) => dt.exec(e), F = (e) => !!V(e), G = (e) => it.exec(e), K = (e) => !!G(e), gt = (e) => lt.exec(e), Et = (e) => !!gt(e), ht = (e) => ct.exec(e), j = (e) => !!ht(e), z = 1440 * 60 * 1e3, H = 7 * z;
531
+ }, it = /^[0-9][0-9][0-9][0-9]-Q[1-4]$/, ct = /^[0-9][0-9][0-9][0-9]-W[0-9][0-9]?$/, at = /^[0-9][0-9][0-9][0-9]-S[1-2]$/, ut = /^[0-9][0-9][0-9][0-9]$/, lt = /^[0-9][0-9][0-9][0-9]-(0[1-9]|1[0-2])-[0-9][0-9]$/, dt = /^[0-9][0-9][0-9][0-9]-M(0[1-9]|(1[0-2]))$/, k = (e) => ut.exec(e), Q = (e) => !!k(e), ft = (e) => at.exec(e), B = (e) => !!ft(e), V = (e) => dt.exec(e), F = (e) => !!V(e), K = (e) => it.exec(e), G = (e) => !!K(e), gt = (e) => lt.exec(e), Et = (e) => !!gt(e), ht = (e) => ct.exec(e), j = (e) => !!ht(e), z = 1440 * 60 * 1e3, H = 7 * z;
537
532
  function J(e) {
538
533
  const t = `${e}-01-01`, n = new Date(t);
539
534
  if (n.getDay() !== 4) {
540
- const r = 1 + (4 - n.getDay() + 7) % 7;
541
- n.setMonth(0, r);
535
+ const s = 1 + (4 - n.getDay() + 7) % 7;
536
+ n.setMonth(0, s);
542
537
  }
543
538
  return n;
544
539
  }
545
540
  function At(e) {
546
- const t = new Date(e), s = -((t.getDay() + 6) % 7) + 3;
547
- return t.setDate(t.getDate() + s), new Date(t.valueOf());
541
+ const t = new Date(e), r = -((t.getDay() + 6) % 7) + 3;
542
+ return t.setDate(t.getDate() + r), new Date(t.valueOf());
548
543
  }
549
544
  function ce(e, t = "W") {
550
- const n = `${e}-12-31`, s = _(new Date(n), t);
551
- if (s.weekYear === e)
552
- return s.weekNumber;
553
- const r = `${e}-12-24`;
554
- return _(new Date(r), t).weekNumber;
545
+ const n = `${e}-12-31`, r = _(new Date(n), t);
546
+ if (r.weekYear === e)
547
+ return r.weekNumber;
548
+ const s = `${e}-12-24`;
549
+ return _(new Date(s), t).weekNumber;
555
550
  }
556
551
  function Re(e, t, n = "W") {
557
552
  return `${e}-${n}${t < 10 ? "0" + t : t}`;
558
553
  }
559
554
  function _(e, t = "W") {
560
- const n = At(e), s = n.getFullYear(), r = J(s), o = 1 + Math.ceil(
561
- (n.getTime() - r.getTime()) / H
555
+ const n = At(e), r = n.getFullYear(), s = J(r), o = 1 + Math.ceil(
556
+ (n.getTime() - s.getTime()) / H
562
557
  );
563
558
  return {
564
- code: Re(s, o, t),
559
+ code: Re(r, o, t),
565
560
  weekNumber: o,
566
- weekYear: s
561
+ weekYear: r
567
562
  };
568
563
  }
569
564
  function Dt(e) {
570
- const [t, n] = e.split("-W"), r = J(+t).getTime() + (+n - 1) * H - 3 * z;
571
- return new Date(r);
565
+ const [t, n] = e.split("-W"), s = J(+t).getTime() + (+n - 1) * H - 3 * z;
566
+ return new Date(s);
572
567
  }
573
568
  function yt(e) {
574
- const [t, n] = e.split("-W"), r = J(+t).getTime() + (+n - 1) * H + 3 * z;
575
- return new Date(r);
569
+ const [t, n] = e.split("-W"), s = J(+t).getTime() + (+n - 1) * H + 3 * z;
570
+ return new Date(s);
576
571
  }
577
572
  function we(e) {
578
- return Q(e) ? St(e) : B(e) ? Rt(e) : K(e) ? pt(e) : F(e) ? vt(e) : j(e) ? Dt(e) : Nt(e);
573
+ return Q(e) ? St(e) : B(e) ? Rt(e) : G(e) ? pt(e) : F(e) ? vt(e) : j(e) ? Dt(e) : Nt(e);
579
574
  }
580
575
  function pe(e) {
581
- return Q(e) ? Tt(e) : B(e) ? wt(e) : K(e) ? mt(e) : F(e) ? $t(e) : j(e) ? yt(e) : It(e);
576
+ return Q(e) ? Tt(e) : B(e) ? wt(e) : G(e) ? mt(e) : F(e) ? $t(e) : j(e) ? yt(e) : It(e);
582
577
  }
583
578
  function St(e) {
584
- const t = M(e);
579
+ const t = k(e);
585
580
  if (t)
586
581
  return new Date(Number(t[0]), 0, 1);
587
582
  }
588
583
  function Tt(e) {
589
- const t = M(e);
584
+ const t = k(e);
590
585
  if (t)
591
586
  return new Date(Number(t[0]) + 1, 0, 1);
592
587
  }
@@ -609,11 +604,11 @@ function wt(e) {
609
604
  }
610
605
  }
611
606
  function pt(e) {
612
- const t = G(e);
607
+ const t = K(e);
613
608
  if (!t)
614
609
  return;
615
- const [n, s] = t[0].split("-Q");
616
- switch (+s) {
610
+ const [n, r] = t[0].split("-Q");
611
+ switch (+r) {
617
612
  case 1:
618
613
  return new Date(+n, 0, 1);
619
614
  case 2:
@@ -625,11 +620,11 @@ function pt(e) {
625
620
  }
626
621
  }
627
622
  function mt(e) {
628
- const t = G(e);
623
+ const t = K(e);
629
624
  if (!t)
630
625
  return;
631
- const [n, s] = t[0].split("-Q");
632
- switch (+s) {
626
+ const [n, r] = t[0].split("-Q");
627
+ switch (+r) {
633
628
  case 1:
634
629
  return new Date(+n, 3, 1);
635
630
  case 2:
@@ -644,40 +639,40 @@ function vt(e) {
644
639
  const t = V(e);
645
640
  if (!t)
646
641
  return;
647
- const [n, s] = t[0].split("-M");
648
- return new Date(+n, +s - 1, 1);
642
+ const [n, r] = t[0].split("-M");
643
+ return new Date(+n, +r - 1, 1);
649
644
  }
650
645
  function $t(e) {
651
646
  const t = V(e);
652
647
  if (!t)
653
648
  return;
654
- const [n, s] = t[0].split("-M");
655
- return new Date(+n, +s, 1);
649
+ const [n, r] = t[0].split("-M");
650
+ return new Date(+n, +r, 1);
656
651
  }
657
652
  const Nt = (e) => /* @__PURE__ */ new Date(`${e}T00:00:00`), It = (e) => {
658
653
  const t = /* @__PURE__ */ new Date(`${e}T23:59:00`);
659
654
  return t.setMinutes(t.getMinutes() + 1), t;
660
- }, _t = 1, Pt = (e, t, n, s = !0, r = "Q") => {
661
- const o = [], i = t && t > 3 ? Ct(t, s) : 1, c = n ? Math.floor((n - 1) / 3) : 4;
655
+ }, _t = 1, Pt = (e, t, n, r = !0, s = "Q") => {
656
+ const o = [], i = t && t > 3 ? Ct(t, r) : 1, c = n ? Math.floor((n - 1) / 3) : 4;
662
657
  for (let a = i; a <= c; a++)
663
- o.push(`${e}-${r}${a}`);
658
+ o.push(`${e}-${s}${a}`);
664
659
  return o;
665
- }, Ot = (e, t, n, s = "S") => {
666
- const r = [];
667
- return (t || 1) < 7 && (n || 12) > 6 && r.push(`${e}-${s}1`), n == null && r.push(`${e}-${s}2`), r;
668
- }, Nn = (e) => Math.ceil(e / 3), me = (e, t, n = "M") => `${e}-${n}${t.toString().padStart(2, "0")}`, Lt = (e, t, n = "M") => {
660
+ }, Ot = (e, t, n, r = "S") => {
669
661
  const s = [];
670
- for (let r = t; r <= 12; r++)
671
- s.push(me(e, r, n));
672
- return s;
673
- }, bt = (e, t, n, s = "M") => {
662
+ return (t || 1) < 7 && (n || 12) > 6 && s.push(`${e}-${r}1`), n == null && s.push(`${e}-${r}2`), s;
663
+ }, Nn = (e) => Math.ceil(e / 3), me = (e, t, n = "M") => `${e}-${n}${t.toString().padStart(2, "0")}`, Lt = (e, t, n = "M") => {
674
664
  const r = [];
675
- for (let o = t; o < n; o++)
676
- r.push(me(e, o, s));
665
+ for (let s = t; s <= 12; s++)
666
+ r.push(me(e, s, n));
677
667
  return r;
678
- }, Ut = (e, t, n, s = "M") => {
679
- const r = t || 1, o = n == null, i = n || 12;
680
- return o ? Lt(e, r, s) : bt(e, r, i, s);
668
+ }, bt = (e, t, n, r = "M") => {
669
+ const s = [];
670
+ for (let o = t; o < n; o++)
671
+ s.push(me(e, o, r));
672
+ return s;
673
+ }, Ut = (e, t, n, r = "M") => {
674
+ const s = t || 1, o = n == null, i = n || 12;
675
+ return o ? Lt(e, s, r) : bt(e, s, i, r);
681
676
  }, In = (e, t, n = "M") => {
682
677
  switch (t) {
683
678
  case 0:
@@ -708,8 +703,8 @@ const Nt = (e) => /* @__PURE__ */ new Date(`${e}T00:00:00`), It = (e) => {
708
703
  return [];
709
704
  }
710
705
  }, xt = (e, t) => {
711
- const n = R(t, !0), s = R(e), r = n.getFullYear(), o = s.getFullYear(), i = n.getTime() <= s.getTime() ? o + _t - r : 0;
712
- return Array.from({ length: i }, (a, u) => r + u);
706
+ const n = R(t, !0), r = R(e), s = n.getFullYear(), o = r.getFullYear(), i = n.getTime() <= r.getTime() ? o + _t - s : 0;
707
+ return Array.from({ length: i }, (a, u) => s + u);
713
708
  }, R = (e, t = !1) => {
714
709
  const n = Yt(e, t);
715
710
  return n ? (n.getTimezoneOffset() > 0 && n.setMinutes(n.getMinutes() + n.getTimezoneOffset()), n) : /* @__PURE__ */ new Date();
@@ -719,58 +714,58 @@ const Nt = (e) => /* @__PURE__ */ new Date(`${e}T00:00:00`), It = (e) => {
719
714
  }, Ct = (e, t) => t ? Math.floor((e + 1) / 3) : Math.ceil((e + 1) / 3), _n = (e, t) => {
720
715
  const n = ue(e) - ue(t);
721
716
  if (n === 0 && e !== t) {
722
- const s = ae(e), r = ae(t);
723
- return s - r;
717
+ const r = ae(e), s = ae(t);
718
+ return r - s;
724
719
  }
725
720
  return n;
726
- }, ae = (e) => Q(e) ? 6 : B(e) ? 5 : K(e) ? 4 : F(e) ? 3 : j(e) ? 2 : Et(e) ? 1 : 0, ue = (e, t = !1) => {
721
+ }, ae = (e) => Q(e) ? 6 : B(e) ? 5 : G(e) ? 4 : F(e) ? 3 : j(e) ? 2 : Et(e) ? 1 : 0, ue = (e, t = !1) => {
727
722
  const n = t ? we(e) : pe(e);
728
723
  return (n == null ? void 0 : n.getTime()) || 0;
729
724
  };
730
- var X = /* @__PURE__ */ ((e) => (e.LAST_UPDATE_AT = "lastUpdatedAt", e.SERIES_COUNT = "series_count", e))(X || {}), Wt = /* @__PURE__ */ ((e) => (e.C = "c", e))(Wt || {}), w = /* @__PURE__ */ ((e) => (e.EQUALS = "eq", e.NOT_EQUALS = "ne", e.LESS = "lt", e.LESS_OR_EQUAL = "le", e.GREATER = "gt", e.GREATER_OR_EQUAL = "ge", e.CONTAINS = "co", e.NOT_CONTAINS = "nc", e.STARTS = "sw", e.ENDS = "ew", e))(w || {}), kt = /* @__PURE__ */ ((e) => (e.BOOLEAN = "Boolean", e.DATE_TIME = "DateTime", e.DECIMAL = "Decimal", e.INTEGER = "Integer", e.OBSERVATION_TIME_PERIOD = "ObservationalTimePeriod", e.STRING = "String", e.TIME = "Time", e.TIME_RANGE = "TimeRange", e.URI = "URI", e))(kt || {}), qt = /* @__PURE__ */ ((e) => (e.ANNUAL = "A", e.QUARTERLY = "Q", e.MONTHLY = "M", e))(qt || {});
725
+ var X = /* @__PURE__ */ ((e) => (e.LAST_UPDATE_AT = "lastUpdatedAt", e.SERIES_COUNT = "series_count", e))(X || {}), Wt = /* @__PURE__ */ ((e) => (e.C = "c", e))(Wt || {}), w = /* @__PURE__ */ ((e) => (e.EQUALS = "eq", e.NOT_EQUALS = "ne", e.LESS = "lt", e.LESS_OR_EQUAL = "le", e.GREATER = "gt", e.GREATER_OR_EQUAL = "ge", e.CONTAINS = "co", e.NOT_CONTAINS = "nc", e.STARTS = "sw", e.ENDS = "ew", e))(w || {}), qt = /* @__PURE__ */ ((e) => (e.BOOLEAN = "Boolean", e.DATE_TIME = "DateTime", e.DECIMAL = "Decimal", e.INTEGER = "Integer", e.OBSERVATION_TIME_PERIOD = "ObservationalTimePeriod", e.STRING = "String", e.TIME = "Time", e.TIME_RANGE = "TimeRange", e.URI = "URI", e))(qt || {}), Mt = /* @__PURE__ */ ((e) => (e.ANNUAL = "A", e.QUARTERLY = "Q", e.MONTHLY = "M", e))(Mt || {});
731
726
  function Pn(e) {
732
727
  var t, n;
733
- return (n = (t = e == null ? void 0 : e.annotations) == null ? void 0 : t.find((s) => {
734
- if (s.id === X.LAST_UPDATE_AT)
735
- return s;
728
+ return (n = (t = e == null ? void 0 : e.annotations) == null ? void 0 : t.find((r) => {
729
+ if (r.id === X.LAST_UPDATE_AT)
730
+ return r;
736
731
  })) == null ? void 0 : n.value;
737
732
  }
738
733
  const Z = (e, t) => (e == null ? void 0 : e.names) && (e == null ? void 0 : e.names[t]) || (e == null ? void 0 : e.name), ve = (e, t, n) => {
739
734
  if (!(!e || t != null && t.has(e == null ? void 0 : e.id)) && (t == null || t.set(e == null ? void 0 : e.id, e), e != null && e.parent)) {
740
- const s = n == null ? void 0 : n.get(e == null ? void 0 : e.parent);
741
- ve(s, t, n);
735
+ const r = n == null ? void 0 : n.get(e == null ? void 0 : e.parent);
736
+ ve(r, t, n);
742
737
  }
743
- }, Mt = (e, t) => {
744
- const n = /* @__PURE__ */ new Map(), s = new Map(e == null ? void 0 : e.map((r) => [r.id, r]));
745
- return t == null || t.forEach((r) => {
746
- ve(r, n, s);
738
+ }, kt = (e, t) => {
739
+ const n = /* @__PURE__ */ new Map(), r = new Map(e == null ? void 0 : e.map((s) => [s.id, s]));
740
+ return t == null || t.forEach((s) => {
741
+ ve(s, n, r);
747
742
  }), Array.from(n == null ? void 0 : n.values());
748
743
  }, Qt = "time_period_end", Bt = "time_period_start", Vt = "TIME_PERIOD", On = (e) => {
749
744
  const t = e == null ? void 0 : e.find(
750
745
  (o) => o.id === Bt
751
746
  ), n = e == null ? void 0 : e.find(
752
747
  (o) => o.id === Qt
753
- ), s = n != null && n.title ? new Date(n == null ? void 0 : n.title) : null;
748
+ ), r = n != null && n.title ? new Date(n == null ? void 0 : n.title) : null;
754
749
  return {
755
750
  startPeriod: t != null && t.title ? new Date(t == null ? void 0 : t.title) : null,
756
- endPeriod: s
751
+ endPeriod: r
757
752
  };
758
- }, Ft = (e, t) => e.id.localeCompare(t.id), Gt = (e, t) => e.memberValue.localeCompare(t.memberValue), Kt = (e, t) => {
759
- const n = new Array(e.length), s = e.map((i, c) => [i, c]);
760
- s.sort(
753
+ }, Ft = (e, t) => e.id.localeCompare(t.id), Kt = (e, t) => e.memberValue.localeCompare(t.memberValue), Gt = (e, t) => {
754
+ const n = new Array(e.length), r = e.map((i, c) => [i, c]);
755
+ r.sort(
761
756
  (i, c) => Ft(i[0], c[0])
762
757
  );
763
- const r = [...t];
764
- r.sort(Gt);
758
+ const s = [...t];
759
+ s.sort(Kt);
765
760
  let o = 0;
766
- for (const i of s) {
761
+ for (const i of r) {
767
762
  const c = i[0];
768
- for (; o < r.length && r[o].memberValue.localeCompare(c.id) < 0; )
763
+ for (; o < s.length && s[o].memberValue.localeCompare(c.id) < 0; )
769
764
  o += 1;
770
- o < r.length && r[o].memberValue === c.id && (n[i[1]] = i[0]);
765
+ o < s.length && s[o].memberValue === c.id && (n[i[1]] = i[0]);
771
766
  }
772
767
  return n.filter((i) => i != null);
773
- }, jt = (e) => !!(e != null && e.some((t) => t.parent)), Ln = (e, t, n, s, r = []) => {
768
+ }, jt = (e) => !!(e != null && e.some((t) => t.parent)), Ln = (e, t, n, r, s = []) => {
774
769
  var i, c;
775
770
  let o = e || [];
776
771
  if (zt(n || [], t || "")) {
@@ -784,21 +779,21 @@ const Z = (e, t) => (e == null ? void 0 : e.names) && (e == null ? void 0 : e.na
784
779
  u ? o = o.length === 0 ? (u.selectionValues || []).map(({ memberValue: l }) => ({
785
780
  id: l,
786
781
  name: l
787
- })) : Kt(o, u.selectionValues) : o = [];
782
+ })) : Gt(o, u.selectionValues) : o = [];
788
783
  }
789
- } else r.length !== 0 && (o = o.filter(({ id: a }) => r.includes(a)));
790
- return jt(e) && (o = Mt(e, o)), o == null ? void 0 : o.map((a) => ({
784
+ } else s.length !== 0 && (o = o.filter(({ id: a }) => s.includes(a)));
785
+ return jt(e) && (o = kt(e, o)), o == null ? void 0 : o.map((a) => ({
791
786
  ...a,
792
- name: s ? Z(a, s) : a == null ? void 0 : a.name
787
+ name: r ? Z(a, r) : a == null ? void 0 : a.name
793
788
  }));
794
789
  }, zt = (e, t) => e != null && e.length > 0 && t != null, bn = (e) => {
795
790
  var n;
796
791
  const t = [];
797
- return (n = e == null ? void 0 : e.filters) == null || n.forEach((s) => {
798
- s.componentCode !== Vt && t.push({
799
- componentCode: s.componentCode,
792
+ return (n = e == null ? void 0 : e.filters) == null || n.forEach((r) => {
793
+ r.componentCode !== Vt && t.push({
794
+ componentCode: r.componentCode,
800
795
  operator: w.EQUALS,
801
- value: s.values.join(",")
796
+ value: r.values.join(",")
802
797
  });
803
798
  }), t;
804
799
  }, Ht = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, le = (e) => {
@@ -814,22 +809,22 @@ const Z = (e, t) => (e == null ? void 0 : e.names) && (e == null ? void 0 : e.na
814
809
  }, Jt = (e, t) => typeof e != typeof t ? [String(e), String(t)] : [e, t], Xt = (e, t) => {
815
810
  if (de(e) || de(t))
816
811
  return 0;
817
- const [n, s] = Jt(fe(e), fe(t));
818
- return n > s ? 1 : n < s ? -1 : 0;
812
+ const [n, r] = Jt(fe(e), fe(t));
813
+ return n > r ? 1 : n < r ? -1 : 0;
819
814
  }, ge = (e, t) => {
820
815
  for (let n = 0; n < Math.max(e.length, t.length); n++) {
821
- const s = Xt(e[n] || "0", t[n] || "0");
822
- if (s !== 0)
823
- return s;
816
+ const r = Xt(e[n] || "0", t[n] || "0");
817
+ if (r !== 0)
818
+ return r;
824
819
  }
825
820
  return 0;
826
821
  }, Zt = (e, t) => {
827
- const n = le(e), s = le(t), r = n.pop(), o = s.pop(), i = ge(n, s);
828
- return i !== 0 ? i : r && o ? ge(r.split("."), o.split(".")) : r || o ? r ? -1 : 1 : 0;
822
+ const n = le(e), r = le(t), s = n.pop(), o = r.pop(), i = ge(n, r);
823
+ return i !== 0 ? i : s && o ? ge(s.split("."), o.split(".")) : s || o ? s ? -1 : 1 : 0;
829
824
  }, en = (e, t, n) => {
830
825
  tn(n);
831
- const s = Zt(e, t);
832
- return $e[n].includes(s);
826
+ const r = Zt(e, t);
827
+ return $e[n].includes(r);
833
828
  }, $e = {
834
829
  ">": [1],
835
830
  ">=": [0, 1],
@@ -841,36 +836,36 @@ const Z = (e, t) => (e == null ? void 0 : e.names) && (e == null ? void 0 : e.na
841
836
  if (Ee.indexOf(e) === -1)
842
837
  throw new Error(`Invalid operator, expected one of ${Ee.join("|")}`);
843
838
  }, W = "+", ee = (e, t) => {
844
- const { agency: n, id: s, version: r } = p(e), o = t.filter(
839
+ const { agency: n, id: r, version: s } = p(e), o = t.filter(
845
840
  (a) => {
846
841
  var u;
847
- return a.agencyID === n && a.id === s && !((u = a == null ? void 0 : a.version) != null && u.includes(W));
842
+ return a.agencyID === n && a.id === r && !((u = a == null ? void 0 : a.version) != null && u.includes(W));
848
843
  }
849
844
  );
850
845
  if (o.length === 1)
851
846
  return o[0];
852
- if (!(r != null && r.includes(W)))
853
- return o.find((a) => a.version === r);
847
+ if (!(s != null && s.includes(W)))
848
+ return o.find((a) => a.version === s);
854
849
  const i = o.map(
855
850
  (a) => a.version
856
- ), c = nn(r, i);
851
+ ), c = nn(s, i);
857
852
  return o.find(
858
853
  (a) => a.version === c[0]
859
854
  );
860
855
  }, nn = (e, t) => {
861
- const n = sn(e, t);
856
+ const n = rn(e, t);
862
857
  return n.length > 0 ? [n[0]] : [];
863
- }, sn = (e, t) => {
858
+ }, rn = (e, t) => {
864
859
  const n = [];
865
- return t.forEach((s) => {
866
- on(e, s) && n.push(s);
860
+ return t.forEach((r) => {
861
+ on(e, r) && n.push(r);
867
862
  }), n;
868
- }, rn = (e) => {
863
+ }, sn = (e) => {
869
864
  const t = e.trim().replace(/\d+\+/, "*"), [n] = t.split("*");
870
865
  return new RegExp(`^${n}`);
871
866
  }, on = (e, t) => {
872
867
  const n = e.trim().replace(/\+/, "");
873
- return rn(e).test(t) && en(t, n, ">=");
868
+ return sn(e).test(t) && en(t, n, ">=");
874
869
  }, te = (e, t) => {
875
870
  const { concept: n } = cn(e, t);
876
871
  return n;
@@ -880,7 +875,7 @@ const Z = (e, t) => (e == null ? void 0 : e.names) && (e == null ? void 0 : e.na
880
875
  concept: void 0,
881
876
  scheme: void 0
882
877
  };
883
- const { childId: n, agency: s, id: r, version: o } = Pe(e);
878
+ const { childId: n, agency: r, id: s, version: o } = Pe(e);
884
879
  if (o != null && o.includes(W)) {
885
880
  const i = ee(
886
881
  e,
@@ -892,7 +887,7 @@ const Z = (e, t) => (e == null ? void 0 : e.names) && (e == null ? void 0 : e.na
892
887
  };
893
888
  }
894
889
  for (const i of t)
895
- if (an(i, r, s, o))
890
+ if (an(i, s, r, o))
896
891
  return {
897
892
  concept: he((i == null ? void 0 : i.concepts) || [], n),
898
893
  scheme: i
@@ -901,30 +896,30 @@ const Z = (e, t) => (e == null ? void 0 : e.names) && (e == null ? void 0 : e.na
901
896
  concept: void 0,
902
897
  scheme: void 0
903
898
  };
904
- }, he = (e, t) => e == null ? void 0 : e.find((n) => n.id === t), an = (e, t, n, s) => e.id === t && e.agencyID === n && e.version === s, Un = (e = [], t = [], n) => {
899
+ }, he = (e, t) => e == null ? void 0 : e.find((n) => n.id === t), an = (e, t, n, r) => e.id === t && e.agencyID === n && e.version === r, Un = (e = [], t = [], n) => {
905
900
  var a, u;
906
- const s = (n == null ? void 0 : n.conceptIdentity) || "", r = te(s, t), o = I(
901
+ const r = (n == null ? void 0 : n.conceptIdentity) || "", s = te(r, t), o = I(
907
902
  (a = n == null ? void 0 : n.localRepresentation) == null ? void 0 : a.enumeration
908
903
  ), i = I(
909
- (u = r == null ? void 0 : r.coreRepresentation) == null ? void 0 : u.enumeration
904
+ (u = s == null ? void 0 : s.coreRepresentation) == null ? void 0 : u.enumeration
910
905
  ), c = o || i;
911
906
  if (c != null)
912
907
  return ee(c, e);
913
- }, xn = (e, t, n, s) => {
908
+ }, xn = (e, t, n, r) => {
914
909
  var o, i;
915
- const r = (o = t == null ? void 0 : t.find(
910
+ const s = (o = t == null ? void 0 : t.find(
916
911
  (c) => (c == null ? void 0 : c.id) === (e == null ? void 0 : e.id)
917
912
  )) == null ? void 0 : o.values;
918
- return ((i = n == null ? void 0 : n.filter((c) => r == null ? void 0 : r.some((a) => a.id === c.id))) == null ? void 0 : i.map((c) => ({
913
+ return ((i = n == null ? void 0 : n.filter((c) => s == null ? void 0 : s.some((a) => a.id === c.id))) == null ? void 0 : i.map((c) => ({
919
914
  ...c,
920
- name: s ? Z(c, s) : c == null ? void 0 : c.name
915
+ name: r ? Z(c, r) : c == null ? void 0 : c.name
921
916
  }))) || [];
922
917
  }, un = (e, t) => {
923
- var r, o, i;
924
- const n = (r = t == null ? void 0 : t.dataStructureComponents) == null ? void 0 : r.attributeList, s = (o = e == null ? void 0 : e.metadataStructureComponents) == null ? void 0 : o.metadataAttributeList;
918
+ var s, o, i;
919
+ const n = (s = t == null ? void 0 : t.dataStructureComponents) == null ? void 0 : s.attributeList, r = (o = e == null ? void 0 : e.metadataStructureComponents) == null ? void 0 : o.metadataAttributeList;
925
920
  return (i = n == null ? void 0 : n.metadataAttributeUsages) == null ? void 0 : i.map((c) => {
926
921
  var u;
927
- const a = (u = s == null ? void 0 : s.metadataAttributes) == null ? void 0 : u.find(
922
+ const a = (u = r == null ? void 0 : r.metadataAttributes) == null ? void 0 : u.find(
928
923
  (l) => (l == null ? void 0 : l.id) === (c == null ? void 0 : c.metadataAttributeReference)
929
924
  );
930
925
  return {
@@ -934,40 +929,40 @@ const Z = (e, t) => (e == null ? void 0 : e.names) && (e == null ? void 0 : e.na
934
929
  };
935
930
  });
936
931
  }, Yn = (e = [], t, n) => {
937
- const s = I(t == null ? void 0 : t.conceptIdentity) || "", r = te(s, e);
938
- return n ? Z(r, n) : (r == null ? void 0 : r.name) ?? (r == null ? void 0 : r.id) ?? (t == null ? void 0 : t.id);
932
+ const r = I(t == null ? void 0 : t.conceptIdentity) || "", s = te(r, e);
933
+ return n ? Z(s, n) : (s == null ? void 0 : s.name) ?? (s == null ? void 0 : s.id) ?? (t == null ? void 0 : t.id);
939
934
  };
940
935
  function Ae(e) {
941
- var t, n, s;
942
- return (s = (n = (t = e == null ? void 0 : e.dataStructures) == null ? void 0 : t[0]) == null ? void 0 : n.dataStructureComponents) == null ? void 0 : s.dimensionList;
936
+ var t, n, r;
937
+ return (r = (n = (t = e == null ? void 0 : e.dataStructures) == null ? void 0 : t[0]) == null ? void 0 : n.dataStructureComponents) == null ? void 0 : r.dimensionList;
943
938
  }
944
939
  function Cn(e) {
945
- var t, n, s, r;
946
- return ((r = (s = (n = (t = e == null ? void 0 : e.data) == null ? void 0 : t.structures) == null ? void 0 : n[0]) == null ? void 0 : s.dimensions) == null ? void 0 : r.series) || [];
940
+ var t, n, r, s;
941
+ return ((s = (r = (n = (t = e == null ? void 0 : e.data) == null ? void 0 : t.structures) == null ? void 0 : n[0]) == null ? void 0 : r.dimensions) == null ? void 0 : s.series) || [];
947
942
  }
948
943
  function Wn(e) {
949
- var t, n, s, r, o;
950
- return ((o = (r = (s = (n = (t = e == null ? void 0 : e.data) == null ? void 0 : t.structures) == null ? void 0 : n[0]) == null ? void 0 : s.dimensions) == null ? void 0 : r.observation) == null ? void 0 : o[0].values.map((i) => i.value).filter((i) => i != null)) || [];
944
+ var t, n, r, s, o;
945
+ return ((o = (s = (r = (n = (t = e == null ? void 0 : e.data) == null ? void 0 : t.structures) == null ? void 0 : n[0]) == null ? void 0 : r.dimensions) == null ? void 0 : s.observation) == null ? void 0 : o[0].values.map((i) => i.value).filter((i) => i != null)) || [];
951
946
  }
952
- function kn(e) {
947
+ function qn(e) {
953
948
  return e.find(
954
- (t) => t.type === q.TIME_DIMENSION
949
+ (t) => t.type === M.TIME_DIMENSION
955
950
  );
956
951
  }
957
- const qn = (e) => {
952
+ const Mn = (e) => {
958
953
  var i, c, a, u, l, f;
959
- const t = /* @__PURE__ */ new Map(), n = (i = e == null ? void 0 : e.dataStructures) == null ? void 0 : i[0], s = (c = e == null ? void 0 : e.metadataStructures) == null ? void 0 : c[0], r = (e == null ? void 0 : e.conceptSchemes) || [], o = (e == null ? void 0 : e.codelists) || [];
954
+ const t = /* @__PURE__ */ new Map(), n = (i = e == null ? void 0 : e.dataStructures) == null ? void 0 : i[0], r = (c = e == null ? void 0 : e.metadataStructures) == null ? void 0 : c[0], s = (e == null ? void 0 : e.conceptSchemes) || [], o = (e == null ? void 0 : e.codelists) || [];
960
955
  return e && [
961
956
  ...((a = Ae(e)) == null ? void 0 : a.dimensions) || [],
962
957
  ...((u = Ae(e)) == null ? void 0 : u.timeDimensions) || [],
963
- ...un(s, n),
958
+ ...un(r, n),
964
959
  ...((f = (l = n == null ? void 0 : n.dataStructureComponents) == null ? void 0 : l.attributeList) == null ? void 0 : f.attributes) || []
965
960
  ].forEach(
966
961
  (d) => {
967
962
  var A, y;
968
963
  const g = te(
969
964
  d == null ? void 0 : d.conceptIdentity,
970
- r
965
+ s
971
966
  ), h = ((A = d == null ? void 0 : d.localRepresentation) == null ? void 0 : A.enumeration) || ((y = g == null ? void 0 : g.coreRepresentation) == null ? void 0 : y.enumeration), D = ee(
972
967
  h,
973
968
  o
@@ -983,41 +978,41 @@ const qn = (e) => {
983
978
  }));
984
979
  }
985
980
  ), t;
986
- }, Mn = (e) => {
981
+ }, kn = (e) => {
987
982
  var t;
988
983
  return ((t = e == null ? void 0 : e.find(
989
984
  (n) => n.id === X.SERIES_COUNT
990
985
  )) == null ? void 0 : t.title) || "";
991
- }, ln = "/api/download", Qn = (e, t, n, s, r, o, i) => {
986
+ }, ln = "/api/download", Qn = (e, t, n, r, s, o, i) => {
992
987
  const c = new URLSearchParams({
993
988
  urn: e,
994
989
  format: t,
995
990
  compress: "false",
996
991
  filename: o,
997
- filters: JSON.stringify(r),
998
- attribute: s,
992
+ filters: JSON.stringify(s),
993
+ attribute: r,
999
994
  language: n,
1000
995
  isMetadata: i ? "true" : "none"
1001
996
  }).toString(), a = `${ln}?${c}`;
1002
997
  window.open(a, "_blank");
1003
998
  }, Bn = (e, t) => {
1004
- var s, r;
999
+ var r, s;
1005
1000
  const n = [];
1006
1001
  for (const o of e) {
1007
- if (o.type !== q.DIMENSION)
1002
+ if (o.type !== M.DIMENSION)
1008
1003
  continue;
1009
1004
  const i = t.find((c) => c.componentCode === o.id);
1010
- i != null && ((s = i.values) == null ? void 0 : s.length) > 0 ? n.push((r = i.values) == null ? void 0 : r.join(We)) : n.push("*");
1005
+ i != null && ((r = i.values) == null ? void 0 : r.length) > 0 ? n.push((s = i.values) == null ? void 0 : s.join(We)) : n.push("*");
1011
1006
  }
1012
1007
  return n.join(".");
1013
1008
  }, dn = (e, t) => {
1014
1009
  if (!e || !e.startPeriod && !e.endPeriod)
1015
1010
  return null;
1016
- const n = [], { startPeriod: s, endPeriod: r } = e;
1017
- if (s && n.push(
1018
- `${w.GREATER_OR_EQUAL}${se}${s.toISOString().split("T")[0]}`
1019
- ), r && n.push(
1020
- `${w.LESS_OR_EQUAL}${se}${r.toISOString().split("T")[0]}`
1011
+ const n = [], { startPeriod: r, endPeriod: s } = e;
1012
+ if (r && n.push(
1013
+ `${w.GREATER_OR_EQUAL}${re}${r.toISOString().split("T")[0]}`
1014
+ ), s && n.push(
1015
+ `${w.LESS_OR_EQUAL}${re}${s.toISOString().split("T")[0]}`
1021
1016
  ), n.length === 0)
1022
1017
  return null;
1023
1018
  const o = t;
@@ -1029,48 +1024,48 @@ const qn = (e) => {
1029
1024
  return n ? dn(n, t == null ? void 0 : t.id) : null;
1030
1025
  }, fn = (e, t) => {
1031
1026
  var a, u;
1032
- const n = t.id, s = (a = e == null ? void 0 : e.filters) == null ? void 0 : a.find(
1027
+ const n = t.id, r = (a = e == null ? void 0 : e.filters) == null ? void 0 : a.find(
1033
1028
  (l) => l.componentCode === n
1034
1029
  );
1035
- if (!s || !s.values)
1030
+ if (!r || !r.values)
1036
1031
  return null;
1037
- const r = (u = s.values) == null ? void 0 : u.filter((l) => !!l);
1038
- if (!r.length)
1032
+ const s = (u = r.values) == null ? void 0 : u.filter((l) => !!l);
1033
+ if (!s.length)
1039
1034
  return null;
1040
- const o = s.operator;
1035
+ const o = r.operator;
1041
1036
  if (o === w.LESS_OR_EQUAL || o === w.LESS)
1042
- return { startPeriod: null, endPeriod: v(r[0]) };
1037
+ return { startPeriod: null, endPeriod: v(s[0]) };
1043
1038
  if (o === w.GREATER_OR_EQUAL || o === w.GREATER)
1044
- return { startPeriod: v(r[0]), endPeriod: null };
1045
- const i = v(r[0]), c = v(r[1]);
1039
+ return { startPeriod: v(s[0]), endPeriod: null };
1040
+ const i = v(s[0]), c = v(s[1]);
1046
1041
  return { startPeriod: i, endPeriod: c };
1047
1042
  }, Ne = (e, t, n) => {
1048
- const s = R(t, !0), r = R(n), o = R(e, !0), i = R(e), c = s.getTime() > o.getTime() ? s : o, a = r.getTime() < i.getTime() ? r : i;
1043
+ const r = R(t, !0), s = R(n), o = R(e, !0), i = R(e), c = r.getTime() > o.getTime() ? r : o, a = s.getTime() < i.getTime() ? s : i;
1049
1044
  return {
1050
1045
  start: c,
1051
1046
  end: a
1052
1047
  };
1053
- }, gn = (e, t, n, s = "W") => {
1054
- const r = +e, { start: o, end: i } = Ne(e, t, n);
1048
+ }, gn = (e, t, n, r = "W") => {
1049
+ const s = +e, { start: o, end: i } = Ne(e, t, n);
1055
1050
  if (o.getTime() > i.getTime())
1056
1051
  return [];
1057
- const c = _(o, s), a = c.weekYear === r ? c.weekNumber : c.weekYear < r ? 1 : ce(r, s), u = _(i, s), l = u.weekYear === r ? u.weekNumber : u.weekYear > r ? ce(r, s) : 1, f = [];
1052
+ const c = _(o, r), a = c.weekYear === s ? c.weekNumber : c.weekYear < s ? 1 : ce(s, r), u = _(i, r), l = u.weekYear === s ? u.weekNumber : u.weekYear > s ? ce(s, r) : 1, f = [];
1058
1053
  if (a < l)
1059
1054
  for (let E = a; E <= l; E++)
1060
- f.push(Re(r, E, s));
1055
+ f.push(Re(s, E, r));
1061
1056
  return f;
1062
1057
  }, En = (e) => {
1063
1058
  const t = new Date(e);
1064
1059
  return t.setMinutes(t.getMinutes() - t.getTimezoneOffset()), t.toISOString().slice(0, 10);
1065
1060
  }, hn = (e, t, n) => {
1066
- const { start: s, end: r } = Ne(e, t, n);
1067
- if (s.getTime() > r.getTime())
1061
+ const { start: r, end: s } = Ne(e, t, n);
1062
+ if (r.getTime() > s.getTime())
1068
1063
  return [];
1069
1064
  const o = [], i = new Date(
1070
- s.getFullYear(),
1071
- s.getMonth(),
1072
- s.getDate()
1073
- ), c = new Date(r.getFullYear(), r.getMonth(), r.getDate());
1065
+ r.getFullYear(),
1066
+ r.getMonth(),
1067
+ r.getDate()
1068
+ ), c = new Date(s.getFullYear(), s.getMonth(), s.getDate());
1074
1069
  for (; i.getTime() < c.getTime(); ) {
1075
1070
  const a = En(i);
1076
1071
  o.push(a), i.setDate(i.getDate() + 1);
@@ -1085,19 +1080,19 @@ const qn = (e) => {
1085
1080
  isYearlyExist: !!(e != null && e.some(
1086
1081
  ({ memberValue: t }) => t === "A" || t === "Y"
1087
1082
  ))
1088
- }), Dn = (e, t, n, s) => {
1083
+ }), Dn = (e, t, n, r) => {
1089
1084
  var i, c;
1090
- const r = s === 0 ? ((i = R(t.toString(), !0)) == null ? void 0 : i.getMonth()) + 1 : void 0, o = s === e.length - 1 ? ((c = R(n.toString())) == null ? void 0 : c.getMonth()) + 1 || 1 : void 0;
1091
- return { startMonth: r, endMonth: o };
1085
+ const s = r === 0 ? ((i = R(t.toString(), !0)) == null ? void 0 : i.getMonth()) + 1 : void 0, o = r === e.length - 1 ? ((c = R(n.toString())) == null ? void 0 : c.getMonth()) + 1 || 1 : void 0;
1086
+ return { startMonth: s, endMonth: o };
1092
1087
  }, yn = ["FREQUENCY", "FREQ"], Fn = (e, t) => {
1093
1088
  var a, u, l, f, E, d, g;
1094
1089
  const n = (E = (f = (l = (u = (a = e == null ? void 0 : e[0]) == null ? void 0 : a.cubeRegions) == null ? void 0 : u[0]) == null ? void 0 : l.memberSelection) == null ? void 0 : f.find(
1095
1090
  (h) => yn.includes(h.componentId)
1096
- )) == null ? void 0 : E.selectionValues, s = An(n || []), r = ((d = t == null ? void 0 : t.startPeriod) == null ? void 0 : d.getTime()) || 1, o = ((g = t == null ? void 0 : t.endPeriod) == null ? void 0 : g.getTime()) || 1, i = xt(o, r), c = [];
1091
+ )) == null ? void 0 : E.selectionValues, r = An(n || []), s = ((d = t == null ? void 0 : t.startPeriod) == null ? void 0 : d.getTime()) || 1, o = ((g = t == null ? void 0 : t.endPeriod) == null ? void 0 : g.getTime()) || 1, i = xt(o, s), c = [];
1097
1092
  return i.forEach((h, D) => {
1098
1093
  const A = [], { startMonth: y, endMonth: S } = Dn(
1099
1094
  i,
1100
- new Date(r),
1095
+ new Date(s),
1101
1096
  new Date(o),
1102
1097
  D
1103
1098
  ), {
@@ -1107,13 +1102,13 @@ const qn = (e) => {
1107
1102
  isQuarterlyExist: b,
1108
1103
  isSemiAnnualExist: U,
1109
1104
  isYearlyExist: T
1110
- } = s;
1105
+ } = r;
1111
1106
  T && A.push(h.toString()), U && A.push(...Ot(h, y, S)), b && A.push(
1112
1107
  ...Pt(h, y, S, !1)
1113
1108
  ), L && A.push(...Ut(h, y, S)), O && A.push(
1114
- ...gn(h, r.toString(), o.toString())
1109
+ ...gn(h, s.toString(), o.toString())
1115
1110
  ), P && A.push(
1116
- ...hn(h, r.toString(), o.toString())
1111
+ ...hn(h, s.toString(), o.toString())
1117
1112
  ), c.push(...A);
1118
1113
  }), c;
1119
1114
  };
@@ -1123,25 +1118,25 @@ export {
1123
1118
  Tn as AvailabilityApi,
1124
1119
  Ye as DATASET_DATA_URL,
1125
1120
  wn as DatasetApi,
1126
- q as DimensionType,
1121
+ M as DimensionType,
1127
1122
  be as DownloadType,
1128
1123
  mn as FREQUENCY_DIMENSION_ID,
1129
1124
  yn as FREQUENCY_DIM_ID,
1130
1125
  Le as FileColumnsAttribute,
1131
- ke as GET_v3_FILTER_ALL,
1126
+ qe as GET_v3_FILTER_ALL,
1132
1127
  Rn as GET_v3_FILTER_AND,
1133
1128
  We as GET_v3_FILTER_OR,
1134
1129
  Xe as OBSERVATION_KEY,
1135
1130
  ze as OccurrenceType,
1136
- qt as Periods,
1137
- kt as RepresentationTextType,
1131
+ Mt as Periods,
1132
+ qt as RepresentationTextType,
1138
1133
  Wt as SDMX_DATA_QUERY_PARAMS,
1139
1134
  W as SINGLE_WILDCARD_SYMBOL,
1140
1135
  pn as SdmxApiClient,
1141
1136
  De as SdmxAvailabilityMode,
1142
1137
  $ as SdmxDataFormat,
1143
1138
  ye as SdmxDetails,
1144
- k as SdmxReferences,
1139
+ q as SdmxReferences,
1145
1140
  w as SeriesFilterOperator,
1146
1141
  Vt as TIME_PERIOD,
1147
1142
  Qt as TIME_PERIOD_END,
@@ -1149,7 +1144,7 @@ export {
1149
1144
  lt as dailyPattern,
1150
1145
  nt as decodeDimensionId,
1151
1146
  Un as findCodelistByDimension,
1152
- re as generateDatasetDataRequest,
1147
+ se as generateDatasetDataRequest,
1153
1148
  Sn as generateShortUrn,
1154
1149
  Fn as getAdditionalColumns,
1155
1150
  On as getAnnotationPeriod,
@@ -1169,7 +1164,7 @@ export {
1169
1164
  hn as getDaysColumns,
1170
1165
  Yn as getDimensionTitle,
1171
1166
  Ae as getDimensions,
1172
- Mt as getFilteredItemsWithParents,
1167
+ kt as getFilteredItemsWithParents,
1173
1168
  bn as getFiltersDtoFromDataQuery,
1174
1169
  _ as getISOWeek,
1175
1170
  I as getKeyFromUrn,
@@ -1185,7 +1180,7 @@ export {
1185
1180
  R as getPeriodDate,
1186
1181
  An as getPeriods,
1187
1182
  Nn as getQuarterByMonth,
1188
- G as getQuarterlyRegExp,
1183
+ K as getQuarterlyRegExp,
1189
1184
  Pt as getQuartersData,
1190
1185
  dn as getQueryTimePeriodFilters,
1191
1186
  Ue as getRequestAcceptHeader,
@@ -1194,13 +1189,13 @@ export {
1194
1189
  ft as getSemiAnnuallyRegExp,
1195
1190
  C as getSeriesAttributes,
1196
1191
  Ze as getSeriesName,
1197
- qn as getStructureComponentsMap,
1192
+ Mn as getStructureComponentsMap,
1198
1193
  Cn as getStructureDimensions,
1199
- kn as getTimeDimension,
1194
+ qn as getTimeDimension,
1200
1195
  Wn as getTimePeriods,
1201
1196
  Vn as getTimeQueryFilter,
1202
1197
  fn as getTimeRangeFromAttachment,
1203
- Mn as getTimeSeriesCount,
1198
+ kn as getTimeSeriesCount,
1204
1199
  Bn as getTimeSeriesFilterKey,
1205
1200
  tt as getTimeSeriesId,
1206
1201
  Re as getWeekCode,
@@ -1208,13 +1203,13 @@ export {
1208
1203
  Dt as getWeeklyPeriodStartDate,
1209
1204
  ht as getWeeklyRegExp,
1210
1205
  gn as getWeeksColumns,
1211
- rn as getWildCardRegexp,
1206
+ sn as getWildCardRegexp,
1212
1207
  Ne as getYearPeriod,
1213
- M as getYearlyRegExp,
1208
+ k as getYearlyRegExp,
1214
1209
  xt as getYears,
1215
1210
  Et as isDaily,
1216
1211
  F as isMonthly,
1217
- K as isQuarterly,
1212
+ G as isQuarterly,
1218
1213
  B as isSemiAnnually,
1219
1214
  j as isWeekly,
1220
1215
  on as isWildCardVersionCorrect,