@datapos/datapos-shared 0.3.335 → 0.3.336

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.
@@ -1,96 +1,97 @@
1
+ import { convertODataTypeIdToUsageTypeId as Ge, extractExtensionFromPath as Ve, extractNameFromPath as He, formatNumberAsDecimalNumber as We, formatNumberAsDuration as $e, formatNumberAsSize as Xe, formatNumberAsStorageSize as Be, formatNumberAsWholeNumber as Je, lookupMimeTypeForExtension as Ke } from "./datapos-shared.es2.js";
1
2
  let j;
2
3
  // @__NO_SIDE_EFFECTS__
3
- function H(e) {
4
+ function G(t) {
4
5
  return {
5
- lang: e?.lang ?? j?.lang,
6
- message: e?.message,
7
- abortEarly: e?.abortEarly ?? j?.abortEarly,
8
- abortPipeEarly: e?.abortPipeEarly ?? j?.abortPipeEarly
6
+ lang: t?.lang ?? j?.lang,
7
+ message: t?.message,
8
+ abortEarly: t?.abortEarly ?? j?.abortEarly,
9
+ abortPipeEarly: t?.abortPipeEarly ?? j?.abortPipeEarly
9
10
  };
10
11
  }
11
- let K;
12
+ let V;
12
13
  // @__NO_SIDE_EFFECTS__
13
- function W(e) {
14
- return K?.get(e);
14
+ function H(t) {
15
+ return V?.get(t);
15
16
  }
16
- let X;
17
+ let W;
17
18
  // @__NO_SIDE_EFFECTS__
18
- function J(e) {
19
- return X?.get(e);
19
+ function $(t) {
20
+ return W?.get(t);
20
21
  }
21
- let q;
22
+ let X;
22
23
  // @__NO_SIDE_EFFECTS__
23
- function Q(e, r) {
24
- return q?.get(e)?.get(r);
24
+ function B(t, n) {
25
+ return X?.get(t)?.get(n);
25
26
  }
26
27
  // @__NO_SIDE_EFFECTS__
27
- function U(e) {
28
- const r = typeof e;
29
- return r === "string" ? `"${e}"` : r === "number" || r === "bigint" || r === "boolean" ? `${e}` : r === "object" || r === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : r;
30
- }
31
- function g(e, r, t, n, s) {
32
- const o = s && "input" in s ? s.input : t.value, i = s?.expected ?? e.expects ?? null, u = s?.received ?? /* @__PURE__ */ U(o), a = {
33
- kind: e.kind,
34
- type: e.type,
28
+ function T(t) {
29
+ const n = typeof t;
30
+ return n === "string" ? `"${t}"` : n === "number" || n === "bigint" || n === "boolean" ? `${t}` : n === "object" || n === "function" ? (t && Object.getPrototypeOf(t)?.constructor?.name) ?? "null" : n;
31
+ }
32
+ function y(t, n, e, r, s) {
33
+ const o = s && "input" in s ? s.input : e.value, i = s?.expected ?? t.expects ?? null, u = s?.received ?? /* @__PURE__ */ T(o), a = {
34
+ kind: t.kind,
35
+ type: t.type,
35
36
  input: o,
36
37
  expected: i,
37
38
  received: u,
38
- message: `Invalid ${r}: ${i ? `Expected ${i} but r` : "R"}eceived ${u}`,
39
- requirement: e.requirement,
39
+ message: `Invalid ${n}: ${i ? `Expected ${i} but r` : "R"}eceived ${u}`,
40
+ requirement: t.requirement,
40
41
  path: s?.path,
41
42
  issues: s?.issues,
42
- lang: n.lang,
43
- abortEarly: n.abortEarly,
44
- abortPipeEarly: n.abortPipeEarly
45
- }, p = e.kind === "schema", d = s?.message ?? e.message ?? /* @__PURE__ */ Q(e.reference, a.lang) ?? (p ? /* @__PURE__ */ J(a.lang) : null) ?? n.message ?? /* @__PURE__ */ W(a.lang);
46
- d !== void 0 && (a.message = typeof d == "function" ? d(a) : d), p && (t.typed = !1), t.issues ? t.issues.push(a) : t.issues = [a];
43
+ lang: r.lang,
44
+ abortEarly: r.abortEarly,
45
+ abortPipeEarly: r.abortPipeEarly
46
+ }, p = t.kind === "schema", d = s?.message ?? t.message ?? /* @__PURE__ */ B(t.reference, a.lang) ?? (p ? /* @__PURE__ */ $(a.lang) : null) ?? r.message ?? /* @__PURE__ */ H(a.lang);
47
+ d !== void 0 && (a.message = typeof d == "function" ? d(a) : d), p && (e.typed = !1), e.issues ? e.issues.push(a) : e.issues = [a];
47
48
  }
48
49
  // @__NO_SIDE_EFFECTS__
49
- function h(e) {
50
+ function g(t) {
50
51
  return {
51
52
  version: 1,
52
53
  vendor: "valibot",
53
- validate(r) {
54
- return e["~run"]({ value: r }, /* @__PURE__ */ H());
54
+ validate(n) {
55
+ return t["~run"]({ value: n }, /* @__PURE__ */ G());
55
56
  }
56
57
  };
57
58
  }
58
59
  // @__NO_SIDE_EFFECTS__
59
- function Y(e, r) {
60
- return Object.hasOwn(e, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
60
+ function J(t, n) {
61
+ return Object.hasOwn(t, n) && n !== "__proto__" && n !== "prototype" && n !== "constructor";
61
62
  }
62
63
  // @__NO_SIDE_EFFECTS__
63
- function Z(e, r) {
64
- const t = [...new Set(e)];
65
- return t.length > 1 ? `(${t.join(` ${r} `)})` : t[0] ?? "never";
64
+ function K(t, n) {
65
+ const e = [...new Set(t)];
66
+ return e.length > 1 ? `(${e.join(` ${n} `)})` : e[0] ?? "never";
66
67
  }
67
68
  // @__NO_SIDE_EFFECTS__
68
- function ee(e, r, t) {
69
- return typeof e.fallback == "function" ? e.fallback(r, t) : e.fallback;
69
+ function q(t, n, e) {
70
+ return typeof t.fallback == "function" ? t.fallback(n, e) : t.fallback;
70
71
  }
71
72
  // @__NO_SIDE_EFFECTS__
72
- function A(e, r, t) {
73
- return typeof e.default == "function" ? e.default(r, t) : e.default;
73
+ function w(t, n, e) {
74
+ return typeof t.default == "function" ? t.default(n, e) : t.default;
74
75
  }
75
76
  // @__NO_SIDE_EFFECTS__
76
- function x(e, r) {
77
+ function E(t, n) {
77
78
  return {
78
79
  kind: "schema",
79
80
  type: "array",
80
- reference: x,
81
+ reference: E,
81
82
  expects: "Array",
82
83
  async: !1,
83
- item: e,
84
- message: r,
84
+ item: t,
85
+ message: n,
85
86
  get "~standard"() {
86
- return /* @__PURE__ */ h(this);
87
+ return /* @__PURE__ */ g(this);
87
88
  },
88
- "~run"(t, n) {
89
- const s = t.value;
89
+ "~run"(e, r) {
90
+ const s = e.value;
90
91
  if (Array.isArray(s)) {
91
- t.typed = !0, t.value = [];
92
+ e.typed = !0, e.value = [];
92
93
  for (let o = 0; o < s.length; o++) {
93
- const i = s[o], u = this.item["~run"]({ value: i }, n);
94
+ const i = s[o], u = this.item["~run"]({ value: i }, r);
94
95
  if (u.issues) {
95
96
  const a = {
96
97
  type: "array",
@@ -100,110 +101,110 @@ function x(e, r) {
100
101
  value: i
101
102
  };
102
103
  for (const p of u.issues)
103
- p.path ? p.path.unshift(a) : p.path = [a], t.issues?.push(p);
104
- if (t.issues || (t.issues = u.issues), n.abortEarly) {
105
- t.typed = !1;
104
+ p.path ? p.path.unshift(a) : p.path = [a], e.issues?.push(p);
105
+ if (e.issues || (e.issues = u.issues), r.abortEarly) {
106
+ e.typed = !1;
106
107
  break;
107
108
  }
108
109
  }
109
- u.typed || (t.typed = !1), t.value.push(u.value);
110
+ u.typed || (e.typed = !1), e.value.push(u.value);
110
111
  }
111
- } else g(this, "type", t, n);
112
- return t;
112
+ } else y(this, "type", e, r);
113
+ return e;
113
114
  }
114
115
  };
115
116
  }
116
117
  // @__NO_SIDE_EFFECTS__
117
- function B(e) {
118
+ function _(t) {
118
119
  return {
119
120
  kind: "schema",
120
121
  type: "boolean",
121
- reference: B,
122
+ reference: _,
122
123
  expects: "boolean",
123
124
  async: !1,
124
- message: e,
125
+ message: t,
125
126
  get "~standard"() {
126
- return /* @__PURE__ */ h(this);
127
+ return /* @__PURE__ */ g(this);
127
128
  },
128
- "~run"(r, t) {
129
- return typeof r.value == "boolean" ? r.typed = !0 : g(this, "type", r, t), r;
129
+ "~run"(n, e) {
130
+ return typeof n.value == "boolean" ? n.typed = !0 : y(this, "type", n, e), n;
130
131
  }
131
132
  };
132
133
  }
133
134
  // @__NO_SIDE_EFFECTS__
134
- function D(e, r) {
135
+ function k(t, n) {
135
136
  return {
136
137
  kind: "schema",
137
138
  type: "literal",
138
- reference: D,
139
- expects: /* @__PURE__ */ U(e),
139
+ reference: k,
140
+ expects: /* @__PURE__ */ T(t),
140
141
  async: !1,
141
- literal: e,
142
- message: r,
142
+ literal: t,
143
+ message: n,
143
144
  get "~standard"() {
144
- return /* @__PURE__ */ h(this);
145
+ return /* @__PURE__ */ g(this);
145
146
  },
146
- "~run"(t, n) {
147
- return t.value === this.literal ? t.typed = !0 : g(this, "type", t, n), t;
147
+ "~run"(e, r) {
148
+ return e.value === this.literal ? e.typed = !0 : y(this, "type", e, r), e;
148
149
  }
149
150
  };
150
151
  }
151
152
  // @__NO_SIDE_EFFECTS__
152
- function y(e, r) {
153
+ function m(t, n) {
153
154
  return {
154
155
  kind: "schema",
155
156
  type: "nullable",
156
- reference: y,
157
- expects: `(${e.expects} | null)`,
157
+ reference: m,
158
+ expects: `(${t.expects} | null)`,
158
159
  async: !1,
159
- wrapped: e,
160
- default: r,
160
+ wrapped: t,
161
+ default: n,
161
162
  get "~standard"() {
162
- return /* @__PURE__ */ h(this);
163
+ return /* @__PURE__ */ g(this);
163
164
  },
164
- "~run"(t, n) {
165
- return t.value === null && (this.default !== void 0 && (t.value = /* @__PURE__ */ A(this, t, n)), t.value === null) ? (t.typed = !0, t) : this.wrapped["~run"](t, n);
165
+ "~run"(e, r) {
166
+ return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ w(this, e, r)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, r);
166
167
  }
167
168
  };
168
169
  }
169
170
  // @__NO_SIDE_EFFECTS__
170
- function k(e) {
171
+ function x(t) {
171
172
  return {
172
173
  kind: "schema",
173
174
  type: "number",
174
- reference: k,
175
+ reference: x,
175
176
  expects: "number",
176
177
  async: !1,
177
- message: e,
178
+ message: t,
178
179
  get "~standard"() {
179
- return /* @__PURE__ */ h(this);
180
+ return /* @__PURE__ */ g(this);
180
181
  },
181
- "~run"(r, t) {
182
- return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : g(this, "type", r, t), r;
182
+ "~run"(n, e) {
183
+ return typeof n.value == "number" && !isNaN(n.value) ? n.typed = !0 : y(this, "type", n, e), n;
183
184
  }
184
185
  };
185
186
  }
186
187
  // @__NO_SIDE_EFFECTS__
187
- function b(e, r) {
188
+ function b(t, n) {
188
189
  return {
189
190
  kind: "schema",
190
191
  type: "object",
191
192
  reference: b,
192
193
  expects: "Object",
193
194
  async: !1,
194
- entries: e,
195
- message: r,
195
+ entries: t,
196
+ message: n,
196
197
  get "~standard"() {
197
- return /* @__PURE__ */ h(this);
198
+ return /* @__PURE__ */ g(this);
198
199
  },
199
- "~run"(t, n) {
200
- const s = t.value;
200
+ "~run"(e, r) {
201
+ const s = e.value;
201
202
  if (s && typeof s == "object") {
202
- t.typed = !0, t.value = {};
203
+ e.typed = !0, e.value = {};
203
204
  for (const o in this.entries) {
204
205
  const i = this.entries[o];
205
206
  if (o in s || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && i.default !== void 0) {
206
- const u = o in s ? s[o] : /* @__PURE__ */ A(i), a = i["~run"]({ value: u }, n);
207
+ const u = o in s ? s[o] : /* @__PURE__ */ w(i), a = i["~run"]({ value: u }, r);
207
208
  if (a.issues) {
208
209
  const p = {
209
210
  type: "object",
@@ -213,15 +214,15 @@ function b(e, r) {
213
214
  value: u
214
215
  };
215
216
  for (const d of a.issues)
216
- d.path ? d.path.unshift(p) : d.path = [p], t.issues?.push(d);
217
- if (t.issues || (t.issues = a.issues), n.abortEarly) {
218
- t.typed = !1;
217
+ d.path ? d.path.unshift(p) : d.path = [p], e.issues?.push(d);
218
+ if (e.issues || (e.issues = a.issues), r.abortEarly) {
219
+ e.typed = !1;
219
220
  break;
220
221
  }
221
222
  }
222
- a.typed || (t.typed = !1), t.value[o] = a.value;
223
- } else if (i.fallback !== void 0) t.value[o] = /* @__PURE__ */ ee(i);
224
- else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (g(this, "key", t, n, {
223
+ a.typed || (e.typed = !1), e.value[o] = a.value;
224
+ } else if (i.fallback !== void 0) e.value[o] = /* @__PURE__ */ q(i);
225
+ else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (y(this, "key", e, r, {
225
226
  input: void 0,
226
227
  expected: `"${o}"`,
227
228
  path: [{
@@ -231,51 +232,51 @@ function b(e, r) {
231
232
  key: o,
232
233
  value: s[o]
233
234
  }]
234
- }), n.abortEarly))
235
+ }), r.abortEarly))
235
236
  break;
236
237
  }
237
- } else g(this, "type", t, n);
238
- return t;
238
+ } else y(this, "type", e, r);
239
+ return e;
239
240
  }
240
241
  };
241
242
  }
242
243
  // @__NO_SIDE_EFFECTS__
243
- function f(e, r) {
244
+ function f(t, n) {
244
245
  return {
245
246
  kind: "schema",
246
247
  type: "optional",
247
248
  reference: f,
248
- expects: `(${e.expects} | undefined)`,
249
+ expects: `(${t.expects} | undefined)`,
249
250
  async: !1,
250
- wrapped: e,
251
- default: r,
251
+ wrapped: t,
252
+ default: n,
252
253
  get "~standard"() {
253
- return /* @__PURE__ */ h(this);
254
+ return /* @__PURE__ */ g(this);
254
255
  },
255
- "~run"(t, n) {
256
- return t.value === void 0 && (this.default !== void 0 && (t.value = /* @__PURE__ */ A(this, t, n)), t.value === void 0) ? (t.typed = !0, t) : this.wrapped["~run"](t, n);
256
+ "~run"(e, r) {
257
+ return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ w(this, e, r)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, r);
257
258
  }
258
259
  };
259
260
  }
260
261
  // @__NO_SIDE_EFFECTS__
261
- function R(e, r, t) {
262
+ function A(t, n, e) {
262
263
  return {
263
264
  kind: "schema",
264
265
  type: "record",
265
- reference: R,
266
+ reference: A,
266
267
  expects: "Object",
267
268
  async: !1,
268
- key: e,
269
- value: r,
270
- message: t,
269
+ key: t,
270
+ value: n,
271
+ message: e,
271
272
  get "~standard"() {
272
- return /* @__PURE__ */ h(this);
273
+ return /* @__PURE__ */ g(this);
273
274
  },
274
- "~run"(n, s) {
275
- const o = n.value;
275
+ "~run"(r, s) {
276
+ const o = r.value;
276
277
  if (o && typeof o == "object") {
277
- n.typed = !0, n.value = {};
278
- for (const i in o) if (/* @__PURE__ */ Y(o, i)) {
278
+ r.typed = !0, r.value = {};
279
+ for (const i in o) if (/* @__PURE__ */ J(o, i)) {
279
280
  const u = o[i], a = this.key["~run"]({ value: i }, s);
280
281
  if (a.issues) {
281
282
  const d = {
@@ -286,9 +287,9 @@ function R(e, r, t) {
286
287
  value: u
287
288
  };
288
289
  for (const S of a.issues)
289
- S.path = [d], n.issues?.push(S);
290
- if (n.issues || (n.issues = a.issues), s.abortEarly) {
291
- n.typed = !1;
290
+ S.path = [d], r.issues?.push(S);
291
+ if (r.issues || (r.issues = a.issues), s.abortEarly) {
292
+ r.typed = !1;
292
293
  break;
293
294
  }
294
295
  }
@@ -302,59 +303,59 @@ function R(e, r, t) {
302
303
  value: u
303
304
  };
304
305
  for (const S of p.issues)
305
- S.path ? S.path.unshift(d) : S.path = [d], n.issues?.push(S);
306
- if (n.issues || (n.issues = p.issues), s.abortEarly) {
307
- n.typed = !1;
306
+ S.path ? S.path.unshift(d) : S.path = [d], r.issues?.push(S);
307
+ if (r.issues || (r.issues = p.issues), s.abortEarly) {
308
+ r.typed = !1;
308
309
  break;
309
310
  }
310
311
  }
311
- (!a.typed || !p.typed) && (n.typed = !1), a.typed && (n.value[a.value] = p.value);
312
+ (!a.typed || !p.typed) && (r.typed = !1), a.typed && (r.value[a.value] = p.value);
312
313
  }
313
- } else g(this, "type", n, s);
314
- return n;
314
+ } else y(this, "type", r, s);
315
+ return r;
315
316
  }
316
317
  };
317
318
  }
318
319
  // @__NO_SIDE_EFFECTS__
319
- function l(e) {
320
+ function l(t) {
320
321
  return {
321
322
  kind: "schema",
322
323
  type: "string",
323
324
  reference: l,
324
325
  expects: "string",
325
326
  async: !1,
326
- message: e,
327
+ message: t,
327
328
  get "~standard"() {
328
- return /* @__PURE__ */ h(this);
329
+ return /* @__PURE__ */ g(this);
329
330
  },
330
- "~run"(r, t) {
331
- return typeof r.value == "string" ? r.typed = !0 : g(this, "type", r, t), r;
331
+ "~run"(n, e) {
332
+ return typeof n.value == "string" ? n.typed = !0 : y(this, "type", n, e), n;
332
333
  }
333
334
  };
334
335
  }
335
336
  // @__NO_SIDE_EFFECTS__
336
- function _(e) {
337
- let r;
338
- if (e) for (const t of e) r ? r.push(...t.issues) : r = t.issues;
339
- return r;
337
+ function P(t) {
338
+ let n;
339
+ if (t) for (const e of t) n ? n.push(...e.issues) : n = e.issues;
340
+ return n;
340
341
  }
341
342
  // @__NO_SIDE_EFFECTS__
342
- function G(e, r) {
343
+ function F(t, n) {
343
344
  return {
344
345
  kind: "schema",
345
346
  type: "union",
346
- reference: G,
347
- expects: /* @__PURE__ */ Z(e.map((t) => t.expects), "|"),
347
+ reference: F,
348
+ expects: /* @__PURE__ */ K(t.map((e) => e.expects), "|"),
348
349
  async: !1,
349
- options: e,
350
- message: r,
350
+ options: t,
351
+ message: n,
351
352
  get "~standard"() {
352
- return /* @__PURE__ */ h(this);
353
+ return /* @__PURE__ */ g(this);
353
354
  },
354
- "~run"(t, n) {
355
+ "~run"(e, r) {
355
356
  let s, o, i;
356
357
  for (const u of this.options) {
357
- const a = u["~run"]({ value: t.value }, n);
358
+ const a = u["~run"]({ value: e.value }, r);
358
359
  if (a.typed) if (a.issues) o ? o.push(a) : o = [a];
359
360
  else {
360
361
  s = a;
@@ -365,26 +366,26 @@ function G(e, r) {
365
366
  if (s) return s;
366
367
  if (o) {
367
368
  if (o.length === 1) return o[0];
368
- g(this, "type", t, n, { issues: /* @__PURE__ */ _(o) }), t.typed = !0;
369
+ y(this, "type", e, r, { issues: /* @__PURE__ */ P(o) }), e.typed = !0;
369
370
  } else {
370
371
  if (i?.length === 1) return i[0];
371
- g(this, "type", t, n, { issues: /* @__PURE__ */ _(i) });
372
+ y(this, "type", e, r, { issues: /* @__PURE__ */ P(i) });
372
373
  }
373
- return t;
374
+ return e;
374
375
  }
375
376
  };
376
377
  }
377
- const v = (e) => /* @__PURE__ */ G(e.map((r) => /* @__PURE__ */ D(r))), te = /* @__PURE__ */ b({
378
+ const h = (t) => /* @__PURE__ */ F(t.map((n) => /* @__PURE__ */ k(n))), Q = /* @__PURE__ */ b({
378
379
  "en-au": /* @__PURE__ */ l(),
379
380
  "en-gb": /* @__PURE__ */ l(),
380
381
  "en-us": /* @__PURE__ */ l(),
381
382
  "es-es": /* @__PURE__ */ l()
382
- }), C = /* @__PURE__ */ b({
383
+ }), M = /* @__PURE__ */ b({
383
384
  "en-au": /* @__PURE__ */ f(/* @__PURE__ */ l()),
384
385
  "en-gb": /* @__PURE__ */ f(/* @__PURE__ */ l()),
385
386
  "en-us": /* @__PURE__ */ f(/* @__PURE__ */ l()),
386
387
  "es-es": /* @__PURE__ */ f(/* @__PURE__ */ l())
387
- }), re = v(["amber", "green", "red", "other"]), ne = v([
388
+ }), Y = h(["amber", "green", "red", "other"]), Z = h([
388
389
  "alpha",
389
390
  "beta",
390
391
  "generalAvailability",
@@ -394,7 +395,7 @@ const v = (e) => /* @__PURE__ */ G(e.map((r) => /* @__PURE__ */ D(r))), te = /*
394
395
  "releaseCandidate",
395
396
  "unavailable",
396
397
  "underReview"
397
- ]), se = v([
398
+ ]), ee = h([
398
399
  "app",
399
400
  "connector",
400
401
  "connectorConnection",
@@ -419,61 +420,61 @@ const v = (e) => /* @__PURE__ */ G(e.map((r) => /* @__PURE__ */ D(r))), te = /*
419
420
  "presenterPresentation",
420
421
  "tool"
421
422
  ]);
422
- v(["app", "engine", "connector", "context", "presenter", "tool"]);
423
- const oe = /* @__PURE__ */ b({
423
+ h(["app", "engine", "connector", "context", "presenter", "tool"]);
424
+ const te = /* @__PURE__ */ b({
424
425
  id: /* @__PURE__ */ l(),
425
- color: re,
426
+ color: Y,
426
427
  label: /* @__PURE__ */ l()
427
- }), T = {
428
+ }), R = {
428
429
  id: /* @__PURE__ */ l(),
429
- label: C,
430
- description: C,
431
- firstCreatedAt: /* @__PURE__ */ f(/* @__PURE__ */ k()),
432
- icon: /* @__PURE__ */ y(/* @__PURE__ */ l()),
433
- iconDark: /* @__PURE__ */ y(/* @__PURE__ */ l()),
434
- lastUpdatedAt: /* @__PURE__ */ y(/* @__PURE__ */ k()),
435
- status: /* @__PURE__ */ y(oe),
436
- statusId: ne
437
- }, Se = /* @__PURE__ */ b({
438
- ...T,
439
- typeId: se
440
- }), $ = {
441
- ...T,
430
+ label: M,
431
+ description: M,
432
+ firstCreatedAt: /* @__PURE__ */ f(/* @__PURE__ */ x()),
433
+ icon: /* @__PURE__ */ m(/* @__PURE__ */ l()),
434
+ iconDark: /* @__PURE__ */ m(/* @__PURE__ */ l()),
435
+ lastUpdatedAt: /* @__PURE__ */ m(/* @__PURE__ */ x()),
436
+ status: /* @__PURE__ */ m(te),
437
+ statusId: Z
438
+ }, he = /* @__PURE__ */ b({
439
+ ...R,
440
+ typeId: ee
441
+ }), N = {
442
+ ...R,
442
443
  version: /* @__PURE__ */ l()
443
- }, P = /* @__PURE__ */ b({
444
+ }, U = /* @__PURE__ */ b({
444
445
  id: /* @__PURE__ */ l(),
445
- label: C,
446
- description: C,
447
- icon: /* @__PURE__ */ y(/* @__PURE__ */ l()),
448
- iconDark: /* @__PURE__ */ y(/* @__PURE__ */ l()),
449
- order: /* @__PURE__ */ k(),
446
+ label: M,
447
+ description: M,
448
+ icon: /* @__PURE__ */ m(/* @__PURE__ */ l()),
449
+ iconDark: /* @__PURE__ */ m(/* @__PURE__ */ l()),
450
+ order: /* @__PURE__ */ x(),
450
451
  path: /* @__PURE__ */ l()
451
- }), E = (e) => {
452
- const r = Object.entries(e).filter((t) => typeof t[1] == "string");
453
- return new Map(r);
454
- }, ie = (e, r, t = I) => {
455
- const n = e.get(r);
456
- if (n !== void 0) return n;
457
- if (t !== r)
458
- return e.get(t);
459
- }, ae = [
460
- { id: "alpha", color: "red", labels: E({ "en-gb": "alpha" }) },
461
- { id: "beta", color: "amber", labels: E({ "en-gb": "beta" }) },
462
- { id: "generalAvailability", color: "green", labels: E({ "en-gb": "" }) },
463
- { id: "notApplicable", color: "green", labels: E({ "en-gb": "not-applicable" }) },
464
- { id: "preAlpha", color: "red", labels: E({ "en-gb": "pre-alpha" }) },
465
- { id: "proposed", color: "other", labels: E({ "en-gb": "proposed" }) },
466
- { id: "releaseCandidate", color: "green", labels: E({ "en-gb": "release-candidate" }) },
467
- { id: "unavailable", color: "other", labels: E({ "en-gb": "unavailable" }) },
468
- { id: "underReview", color: "other", labels: E({ "en-gb": "under-review" }) }
469
- ], ke = (e, r = I) => {
470
- const t = ae.find((n) => n.id === e);
471
- if (t) {
472
- const n = ie(t.labels, r);
473
- return { id: t.id, color: t.color, label: n ?? t.id };
452
+ }), v = (t) => {
453
+ const n = Object.entries(t).filter((e) => typeof e[1] == "string");
454
+ return new Map(n);
455
+ }, ne = (t, n, e = O) => {
456
+ const r = t.get(n);
457
+ if (r !== void 0) return r;
458
+ if (e !== n)
459
+ return t.get(e);
460
+ }, re = [
461
+ { id: "alpha", color: "red", labels: v({ "en-gb": "alpha" }) },
462
+ { id: "beta", color: "amber", labels: v({ "en-gb": "beta" }) },
463
+ { id: "generalAvailability", color: "green", labels: v({ "en-gb": "" }) },
464
+ { id: "notApplicable", color: "green", labels: v({ "en-gb": "not-applicable" }) },
465
+ { id: "preAlpha", color: "red", labels: v({ "en-gb": "pre-alpha" }) },
466
+ { id: "proposed", color: "other", labels: v({ "en-gb": "proposed" }) },
467
+ { id: "releaseCandidate", color: "green", labels: v({ "en-gb": "release-candidate" }) },
468
+ { id: "unavailable", color: "other", labels: v({ "en-gb": "unavailable" }) },
469
+ { id: "underReview", color: "other", labels: v({ "en-gb": "under-review" }) }
470
+ ], ve = (t, n = O) => {
471
+ const e = re.find((r) => r.id === t);
472
+ if (e) {
473
+ const r = ne(e.labels, n);
474
+ return { id: e.id, color: e.color, label: r ?? e.id };
474
475
  }
475
- return { id: e, color: "other", label: e };
476
- }, le = v(["apiKey", "disabled", "oAuth2", "none"]), ce = v(["application", "curatedDataset", "database", "fileStore"]), ue = v([
476
+ return { id: t, color: "other", label: t };
477
+ }, se = h(["apiKey", "disabled", "oAuth2", "none"]), oe = h(["application", "curatedDataset", "database", "fileStore"]), ie = h([
477
478
  "abortOperation",
478
479
  "authenticateConnection",
479
480
  "createObject",
@@ -488,258 +489,155 @@ const oe = /* @__PURE__ */ b({
488
489
  "retrieveChunks",
489
490
  "retrieveRecords",
490
491
  "upsertRecords"
491
- ]), pe = v(["bidirectional", "destination", "source", "unknown"]), de = /* @__PURE__ */ b({
492
- authMethodId: le,
493
- activeConnectionCount: /* @__PURE__ */ f(/* @__PURE__ */ k()),
494
- canDescribe: /* @__PURE__ */ f(/* @__PURE__ */ B()),
492
+ ]), ae = h(["bidirectional", "destination", "source", "unknown"]), le = /* @__PURE__ */ b({
493
+ authMethodId: se,
494
+ activeConnectionCount: /* @__PURE__ */ f(/* @__PURE__ */ x()),
495
+ canDescribe: /* @__PURE__ */ f(/* @__PURE__ */ _()),
495
496
  id: /* @__PURE__ */ f(/* @__PURE__ */ l()),
496
- label: /* @__PURE__ */ f(te),
497
- maxConnectionCount: /* @__PURE__ */ f(/* @__PURE__ */ k()),
498
- params: /* @__PURE__ */ f(/* @__PURE__ */ x(/* @__PURE__ */ R(/* @__PURE__ */ l(), /* @__PURE__ */ l())))
499
- }), De = /* @__PURE__ */ b({
500
- ...$,
501
- typeId: /* @__PURE__ */ D("connector"),
502
- category: /* @__PURE__ */ y(/* @__PURE__ */ b({ id: /* @__PURE__ */ l(), label: /* @__PURE__ */ l() })),
503
- categoryId: ce,
504
- implementations: /* @__PURE__ */ R(/* @__PURE__ */ l(), de),
505
- operations: /* @__PURE__ */ x(ue),
506
- usageId: pe,
507
- vendorAccountURL: /* @__PURE__ */ y(/* @__PURE__ */ l()),
508
- vendorDocumentationURL: /* @__PURE__ */ y(/* @__PURE__ */ l()),
509
- vendorHomeURL: /* @__PURE__ */ y(/* @__PURE__ */ l())
510
- }), we = ["createObject", "dropObject", "removeRecords", "upsertRecords"], Ie = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"], O = (e) => {
511
- const r = Object.entries(e).filter((t) => typeof t[1] == "string");
512
- return new Map(r);
497
+ label: /* @__PURE__ */ f(Q),
498
+ maxConnectionCount: /* @__PURE__ */ f(/* @__PURE__ */ x()),
499
+ params: /* @__PURE__ */ f(/* @__PURE__ */ E(/* @__PURE__ */ A(/* @__PURE__ */ l(), /* @__PURE__ */ l())))
500
+ }), Ee = /* @__PURE__ */ b({
501
+ ...N,
502
+ typeId: /* @__PURE__ */ k("connector"),
503
+ category: /* @__PURE__ */ m(/* @__PURE__ */ b({ id: /* @__PURE__ */ l(), label: /* @__PURE__ */ l() })),
504
+ categoryId: oe,
505
+ implementations: /* @__PURE__ */ A(/* @__PURE__ */ l(), le),
506
+ operations: /* @__PURE__ */ E(ie),
507
+ usageId: ae,
508
+ vendorAccountURL: /* @__PURE__ */ m(/* @__PURE__ */ l()),
509
+ vendorDocumentationURL: /* @__PURE__ */ m(/* @__PURE__ */ l()),
510
+ vendorHomeURL: /* @__PURE__ */ m(/* @__PURE__ */ l())
511
+ }), Se = ["createObject", "dropObject", "removeRecords", "upsertRecords"], xe = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"], D = (t) => {
512
+ const n = Object.entries(t).filter((e) => typeof e[1] == "string");
513
+ return new Map(n);
513
514
  };
514
- O({ "en-gb": "Application" }), O({ "en-gb": "Curated Dataset" }), O({ "en-gb": "Database" }), O({ "en-gb": "File Store" });
515
- const fe = v(["list"]), me = /* @__PURE__ */ b({
516
- ...T,
517
- typeId: /* @__PURE__ */ D("contextModelGroup"),
518
- modelRefs: /* @__PURE__ */ x(P),
519
- order: /* @__PURE__ */ k()
520
- }), Oe = /* @__PURE__ */ b({
521
- ...$,
522
- typeId: /* @__PURE__ */ D("context"),
523
- models: /* @__PURE__ */ x(me),
524
- operations: /* @__PURE__ */ x(fe)
515
+ D({ "en-gb": "Application" }), D({ "en-gb": "Curated Dataset" }), D({ "en-gb": "Database" }), D({ "en-gb": "File Store" });
516
+ const ce = h(["list"]), ue = /* @__PURE__ */ b({
517
+ ...R,
518
+ typeId: /* @__PURE__ */ k("contextModelGroup"),
519
+ modelRefs: /* @__PURE__ */ E(U),
520
+ order: /* @__PURE__ */ x()
521
+ }), ke = /* @__PURE__ */ b({
522
+ ...N,
523
+ typeId: /* @__PURE__ */ k("context"),
524
+ models: /* @__PURE__ */ E(ue),
525
+ operations: /* @__PURE__ */ E(ce)
525
526
  });
526
- class F extends Error {
527
+ class I extends Error {
527
528
  locator;
528
- constructor(r, t, n) {
529
- super(r, n), this.name = "DataPosError", this.locator = t;
529
+ constructor(n, e, r) {
530
+ super(n, r), this.name = "DataPosError", this.locator = e;
530
531
  }
531
532
  }
532
- class w extends F {
533
- constructor(r, t, n) {
534
- super(r, t, n), this.name = "ApplicationError";
533
+ class C extends I {
534
+ constructor(n, e, r) {
535
+ super(n, e, r), this.name = "ApplicationError";
535
536
  }
536
537
  }
537
- class Ce extends w {
538
- constructor(r, t, n) {
539
- super(r, t, n), this.name = "APIError";
538
+ class Ce extends C {
539
+ constructor(n, e, r) {
540
+ super(n, e, r), this.name = "APIError";
540
541
  }
541
542
  }
542
- class Me extends w {
543
- constructor(r, t, n) {
544
- super(r, t, n), this.name = "EngineError";
543
+ class Oe extends C {
544
+ constructor(n, e, r) {
545
+ super(n, e, r), this.name = "EngineError";
545
546
  }
546
547
  }
547
- class z extends w {
548
+ class z extends C {
548
549
  body;
549
- constructor(r, t, n, s) {
550
- super(r, t, s), this.name = "FetchError", this.body = n;
550
+ constructor(n, e, r, s) {
551
+ super(n, e, s), this.name = "FetchError", this.body = r;
551
552
  }
552
553
  }
553
- class be extends w {
554
+ class pe extends C {
554
555
  componentName;
555
556
  info;
556
- constructor(r, t, n, s, o) {
557
- super(r, t, o), this.name = "VueHandledError", this.info = n, this.componentName = s;
557
+ constructor(n, e, r, s, o) {
558
+ super(n, e, o), this.name = "VueHandledError", this.info = r, this.componentName = s;
558
559
  }
559
560
  }
560
- class Ne extends w {
561
- constructor(r, t, n) {
562
- super(r, t, n), this.name = "WindowHandledRuntimeError";
561
+ class De extends C {
562
+ constructor(n, e, r) {
563
+ super(n, e, r), this.name = "WindowHandledRuntimeError";
563
564
  }
564
565
  }
565
- class je extends w {
566
- constructor(r, t, n) {
567
- super(r, t, n), this.name = "WindowHandledPromiseRejectionError";
566
+ class Me extends C {
567
+ constructor(n, e, r) {
568
+ super(n, e, r), this.name = "WindowHandledPromiseRejectionError";
568
569
  }
569
570
  }
570
- class Ae extends F {
571
- constructor(r, t, n) {
572
- super(r, t, n), this.name = "OperationalError";
571
+ class je extends I {
572
+ constructor(n, e, r) {
573
+ super(n, e, r), this.name = "OperationalError";
573
574
  }
574
575
  }
575
- async function Re(e, r, t) {
576
- const n = ` - ${e.statusText}`, s = `${r} Response status '${e.status}${e.statusText ? n : ""}' received.`, o = await e.text();
577
- return new z(s, t, o);
576
+ async function we(t, n, e) {
577
+ const r = ` - ${t.statusText}`, s = `${n} Response status '${t.status}${t.statusText ? r : ""}' received.`, o = await t.text();
578
+ return new z(s, e, o);
578
579
  }
579
- function Te(e) {
580
- return e.map((r) => r.message).join(" ");
580
+ function Ae(t) {
581
+ return t.map((n) => n.message).join(" ");
581
582
  }
582
- function $e(e) {
583
- if (e instanceof Error) return e;
584
- if (typeof e == "string") return new Error(e);
585
- if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint") return new Error(String(e));
586
- if (typeof e == "symbol") return new Error(e.description ?? "Unknown error");
587
- if (e && typeof e == "object")
583
+ function Re(t) {
584
+ if (t instanceof Error) return t;
585
+ if (typeof t == "string") return new Error(t);
586
+ if (typeof t == "number" || typeof t == "boolean" || typeof t == "bigint") return new Error(String(t));
587
+ if (typeof t == "symbol") return new Error(t.description ?? "Unknown error");
588
+ if (t && typeof t == "object")
588
589
  try {
589
- return new Error(JSON.stringify(e));
590
+ return new Error(JSON.stringify(t));
590
591
  } catch {
591
592
  return new Error("Unknown error");
592
593
  }
593
594
  return new Error("Unknown error");
594
595
  }
595
- function Fe(e) {
596
- const r = /* @__PURE__ */ new Set(), t = [];
597
- let n = e;
598
- for (; n && !r.has(n); ) {
599
- r.add(n);
596
+ function Ne(t) {
597
+ const n = /* @__PURE__ */ new Set(), e = [];
598
+ let r = t;
599
+ for (; r && !n.has(r); ) {
600
+ n.add(r);
600
601
  let s;
601
- if (n instanceof z)
602
- s = { body: n.body, locator: n.locator, message: n.message, name: n.name, stack: n.stack }, n = n.cause;
603
- else if (n instanceof be)
604
- s = { componentName: n.componentName, info: n.info, locator: n.locator, message: n.message, name: n.name, stack: n.stack }, n = n.cause;
605
- else if (n instanceof F)
606
- s = { locator: n.locator, message: n.message, name: n.name, stack: n.stack }, n = n.cause;
607
- else if (n instanceof Error) {
608
- const o = n;
609
- s = { locator: "", message: o.message, name: o.name, stack: o.stack }, n = o.cause;
602
+ if (r instanceof z)
603
+ s = { body: r.body, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
604
+ else if (r instanceof pe)
605
+ s = { componentName: r.componentName, info: r.info, locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
606
+ else if (r instanceof I)
607
+ s = { locator: r.locator, message: r.message, name: r.name, stack: r.stack }, r = r.cause;
608
+ else if (r instanceof Error) {
609
+ const o = r;
610
+ s = { locator: "", message: o.message, name: o.name, stack: o.stack }, r = o.cause;
610
611
  } else
611
- s = { locator: "", message: String(n), name: "Error" }, n = void 0;
612
- /(?:\.{3}|[.!?])$/.test(s.message) || (s.message += "."), t.push(s);
612
+ s = { locator: "", message: String(r), name: "Error" }, r = void 0;
613
+ /(?:\.{3}|[.!?])$/.test(s.message) || (s.message += "."), e.push(s);
613
614
  }
614
- return t;
615
+ return e;
615
616
  }
616
- const ye = v(["list", "render", "setColorMode"]), Le = /* @__PURE__ */ b({
617
- ...$,
618
- typeId: /* @__PURE__ */ D("presenter"),
619
- presentations: /* @__PURE__ */ x(P),
620
- operations: /* @__PURE__ */ x(ye)
617
+ const de = h(["list", "render", "setColorMode"]), Ie = /* @__PURE__ */ b({
618
+ ...N,
619
+ typeId: /* @__PURE__ */ k("presenter"),
620
+ presentations: /* @__PURE__ */ E(U),
621
+ operations: /* @__PURE__ */ E(de)
621
622
  });
622
- function _e() {
623
- return { render: ge };
624
- }
625
- function ge(e, r, t) {
626
- t.textContent = "Cytoscape.js diagram goes here...";
627
- }
628
- function Ue() {
629
- return { render: he };
630
- }
631
- function he(e, r) {
632
- console.log(1111, e), console.log(2222, r), console.log(3333, r.childNodes), console.log(4444, r.children);
633
- }
634
- const V = "en-US", M = /* @__PURE__ */ new Map();
635
- function Be(e) {
636
- switch (e) {
637
- case "Edm.Binary":
638
- return "unknown";
639
- // Binary...
640
- case "Edm.Boolean":
641
- return "boolean";
642
- case "Edm.Byte":
643
- return "wholeNumber";
644
- case "Edm.DateTime":
645
- return "moment";
646
- // DateTime...
647
- case "Edm.DateTimeOffset":
648
- return "moment";
649
- // DateTimeOffset...
650
- case "Edm.Decimal":
651
- return "decimalNumber";
652
- case "Edm.Double":
653
- return "decimalNumber";
654
- case "Edm.Guid":
655
- return "string";
656
- case "Edm.Int16":
657
- return "wholeNumber";
658
- case "Edm.Int32":
659
- return "wholeNumber";
660
- case "Edm.Int64":
661
- return "wholeNumber";
662
- case "Edm.SByte":
663
- return "wholeNumber";
664
- case "Edm.Single":
665
- return "decimalNumber";
666
- case "Edm.String":
667
- return "string";
668
- case "Edm.Time":
669
- return "momentTime";
670
- // Time...
671
- default:
672
- return "unknown";
673
- }
623
+ function Le() {
624
+ return { render: fe };
674
625
  }
675
- function Ge(e) {
676
- if (e) {
677
- const r = e.lastIndexOf("/"), t = e.lastIndexOf(".", r === -1 ? e.length : r);
678
- return t === -1 ? e : e.slice(0, Math.max(0, t));
679
- }
626
+ function fe(t, n, e) {
627
+ e.textContent = "Cytoscape.js diagram goes here...";
680
628
  }
681
- function Pe(e) {
682
- if (e) {
683
- const r = e.lastIndexOf(".");
684
- if (r !== -1) return e.slice(Math.max(0, r + 1));
685
- }
629
+ function Pe() {
630
+ return { render: be };
686
631
  }
687
- function m(e, r = 2, t = r, n = V) {
688
- if (e == null) return "";
689
- const s = `${n}decimal${r}.${t}`;
690
- let o = M.get(s);
691
- return o || (o = new Intl.NumberFormat(n, {
692
- localeMatcher: "best fit",
693
- maximumFractionDigits: r,
694
- minimumFractionDigits: t,
695
- minimumIntegerDigits: 1,
696
- style: "decimal",
697
- useGrouping: !0
698
- }), M.set(s, o)), o.format(e);
699
- }
700
- function ze(e) {
701
- return e == null ? "" : e < 1e3 ? N(e) : e < 1e6 ? `${m(e / 1e3, 2, 0)}K` : e < 1e9 ? `${m(e / 1e6, 2, 0)}M` : e < 1e12 ? `${m(e / 1e9, 2, 0)}B` : `${m(e / 1e12, 2, 0)}T`;
702
- }
703
- function Ve(e) {
704
- return e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${N(e)} bytes` : e < 1048576 ? `${m(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${m(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${m(e / 1073741824, 2, 0)} GB` : `${m(e / 1099511627776, 2, 0)} TB`;
705
- }
706
- function He(e) {
707
- return e == null ? "" : e < 1e3 ? `${N(e)} ms` : e === 1e3 ? `${N(e)} sec` : e < 6e4 ? `${m(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${m(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${m(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${m(e / 864e5, 2, 0)} days`;
708
- }
709
- function N(e, r = V) {
710
- if (e == null) return "";
711
- const t = `${r}decimal0.0`;
712
- let n = M.get(t);
713
- return n || (n = new Intl.NumberFormat(r, {
714
- localeMatcher: "best fit",
715
- maximumFractionDigits: 0,
716
- minimumFractionDigits: 0,
717
- minimumIntegerDigits: 1,
718
- style: "decimal",
719
- useGrouping: !0
720
- }), M.set(t, n)), n.format(e);
721
- }
722
- function Ke(e) {
723
- switch (e) {
724
- case "csv":
725
- return "text/csv";
726
- case "tab":
727
- case "tsv":
728
- return "text/tab-separated-values";
729
- case "xls":
730
- return "application/vnd.ms-excel";
731
- case "xlsx":
732
- return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
733
- default:
734
- return "application/octet-stream";
735
- }
632
+ function be(t, n) {
633
+ console.log(1111, t), console.log(2222, n), console.log(3333, n.childNodes), console.log(4444, n.children);
736
634
  }
737
- const c = (e) => new Map(Object.entries(e)), L = (e, r, t = I) => {
738
- const n = e.get(r);
739
- if (n !== void 0) return n;
740
- if (t !== r)
741
- return e.get(t);
742
- }, ve = [
635
+ const c = (t) => new Map(Object.entries(t)), L = (t, n, e = O) => {
636
+ const r = t.get(n);
637
+ if (r !== void 0) return r;
638
+ if (e !== n)
639
+ return t.get(e);
640
+ }, me = [
743
641
  { id: "dtv", labels: c({ "en-gb": "Delimited Text" }) },
744
642
  { id: "e/e", labels: c({ "en-gb": "Entity/Event" }) },
745
643
  { id: "jsonArray", labels: c({ "en-gb": "JSON Array" }) },
@@ -747,27 +645,27 @@ const c = (e) => new Map(Object.entries(e)), L = (e, r, t = I) => {
747
645
  { id: "xls", labels: c({ "en-gb": "XLS" }) },
748
646
  { id: "xlsx", labels: c({ "en-gb": "XLSX" }) },
749
647
  { id: "xml", labels: c({ "en-gb": "XML" }) }
750
- ], We = (e = I) => {
751
- const r = [];
752
- for (const t of ve) {
753
- const n = L(t.labels, e);
754
- r.push({ id: t.id, label: n ?? t.id });
648
+ ], Te = (t = O) => {
649
+ const n = [];
650
+ for (const e of me) {
651
+ const r = L(e.labels, t);
652
+ n.push({ id: e.id, label: r ?? e.id });
755
653
  }
756
- return r;
757
- }, Ee = [
654
+ return n;
655
+ }, ye = [
758
656
  { id: `
759
657
  `, labels: c({ "en-gb": "Newline" }) },
760
658
  { id: "\r", labels: c({ "en-gb": "Carriage Return" }) },
761
659
  { id: `\r
762
660
  `, labels: c({ "en-gb": "Carriage Return/Newline" }) }
763
- ], Xe = (e = I) => {
764
- const r = [];
765
- for (const t of Ee) {
766
- const n = L(t.labels, e);
767
- r.push({ id: t.id, label: n ?? t.id });
661
+ ], _e = (t = O) => {
662
+ const n = [];
663
+ for (const e of ye) {
664
+ const r = L(e.labels, t);
665
+ n.push({ id: e.id, label: r ?? e.id });
768
666
  }
769
- return r;
770
- }, xe = [
667
+ return n;
668
+ }, ge = [
771
669
  { id: ":", labels: c({ "en-gb": "Colon" }) },
772
670
  { id: ",", labels: c({ "en-gb": "Comma" }) },
773
671
  { id: "!", labels: c({ "en-gb": "Exclamation Mark" }) },
@@ -779,47 +677,47 @@ const c = (e) => new Map(Object.entries(e)), L = (e, r, t = I) => {
779
677
  { id: "_", labels: c({ "en-gb": "Underscore" }) },
780
678
  { id: "0x1F", labels: c({ "en-gb": "Unit Separator" }) },
781
679
  { id: "|", labels: c({ "en-gb": "Vertical Bar" }) }
782
- ], Je = (e = I) => {
783
- const r = [];
784
- for (const t of xe) {
785
- const n = L(t.labels, e);
786
- r.push({ id: t.id, label: n ?? t.id });
680
+ ], Fe = (t = O) => {
681
+ const n = [];
682
+ for (const e of ge) {
683
+ const r = L(e.labels, t);
684
+ n.push({ id: e.id, label: r ?? e.id });
787
685
  }
788
- return r;
789
- }, I = "en-gb";
686
+ return n;
687
+ }, O = "en-gb";
790
688
  export {
791
689
  Ce as APIError,
792
- w as ApplicationError,
793
- we as CONNECTOR_DESTINATION_OPERATIONS,
794
- Ie as CONNECTOR_SOURCE_OPERATIONS,
795
- I as DEFAULT_LOCALE_CODE,
796
- Me as EngineError,
690
+ C as ApplicationError,
691
+ Se as CONNECTOR_DESTINATION_OPERATIONS,
692
+ xe as CONNECTOR_SOURCE_OPERATIONS,
693
+ O as DEFAULT_LOCALE_CODE,
694
+ Oe as EngineError,
797
695
  z as FetchError,
798
- Ae as OperationalError,
799
- be as VueError,
800
- je as WindowPromiseRejectionError,
801
- Ne as WindowRuntimeError,
802
- Re as buildFetchError,
803
- Se as componentConfigSchema,
804
- Te as concatenateSerialisedErrorMessages,
805
- De as connectorConfigSchema,
806
- Oe as contextConfigSchema,
807
- Be as convertODataTypeIdToUsageTypeId,
808
- Pe as extractExtensionFromPath,
809
- Ge as extractNameFromPath,
810
- m as formatNumberAsDecimalNumber,
811
- He as formatNumberAsDuration,
812
- ze as formatNumberAsSize,
813
- Ve as formatNumberAsStorageSize,
814
- N as formatNumberAsWholeNumber,
815
- ke as getComponentStatus,
816
- We as getDataFormats,
817
- Xe as getRecordDelimiters,
818
- Je as getValueDelimiters,
696
+ je as OperationalError,
697
+ pe as VueError,
698
+ Me as WindowPromiseRejectionError,
699
+ De as WindowRuntimeError,
700
+ we as buildFetchError,
701
+ he as componentConfigSchema,
702
+ Ae as concatenateSerialisedErrorMessages,
703
+ Ee as connectorConfigSchema,
704
+ ke as contextConfigSchema,
705
+ Ge as convertODataTypeIdToUsageTypeId,
706
+ Ve as extractExtensionFromPath,
707
+ He as extractNameFromPath,
708
+ We as formatNumberAsDecimalNumber,
709
+ $e as formatNumberAsDuration,
710
+ Xe as formatNumberAsSize,
711
+ Be as formatNumberAsStorageSize,
712
+ Je as formatNumberAsWholeNumber,
713
+ ve as getComponentStatus,
714
+ Te as getDataFormats,
715
+ _e as getRecordDelimiters,
716
+ Fe as getValueDelimiters,
819
717
  Ke as lookupMimeTypeForExtension,
820
- $e as normalizeToError,
821
- Le as presenterConfigSchema,
822
- Fe as serialiseError,
823
- _e as useCytoscapeJS,
824
- Ue as useDataTable
718
+ Re as normalizeToError,
719
+ Ie as presenterConfigSchema,
720
+ Ne as serialiseError,
721
+ Le as useCytoscapeJS,
722
+ Pe as useDataTable
825
723
  };
@@ -0,0 +1,114 @@
1
+ const c = "en-US", s = /* @__PURE__ */ new Map();
2
+ function f(e) {
3
+ switch (e) {
4
+ case "Edm.Binary":
5
+ return "unknown";
6
+ // Binary...
7
+ case "Edm.Boolean":
8
+ return "boolean";
9
+ case "Edm.Byte":
10
+ return "wholeNumber";
11
+ case "Edm.DateTime":
12
+ return "moment";
13
+ // DateTime...
14
+ case "Edm.DateTimeOffset":
15
+ return "moment";
16
+ // DateTimeOffset...
17
+ case "Edm.Decimal":
18
+ return "decimalNumber";
19
+ case "Edm.Double":
20
+ return "decimalNumber";
21
+ case "Edm.Guid":
22
+ return "string";
23
+ case "Edm.Int16":
24
+ return "wholeNumber";
25
+ case "Edm.Int32":
26
+ return "wholeNumber";
27
+ case "Edm.Int64":
28
+ return "wholeNumber";
29
+ case "Edm.SByte":
30
+ return "wholeNumber";
31
+ case "Edm.Single":
32
+ return "decimalNumber";
33
+ case "Edm.String":
34
+ return "string";
35
+ case "Edm.Time":
36
+ return "momentTime";
37
+ // Time...
38
+ default:
39
+ return "unknown";
40
+ }
41
+ }
42
+ function l(e) {
43
+ if (e) {
44
+ const t = e.lastIndexOf("/"), n = e.lastIndexOf(".", t === -1 ? e.length : t);
45
+ return n === -1 ? e : e.slice(0, Math.max(0, n));
46
+ }
47
+ }
48
+ function m(e) {
49
+ if (e) {
50
+ const t = e.lastIndexOf(".");
51
+ if (t !== -1) return e.slice(Math.max(0, t + 1));
52
+ }
53
+ }
54
+ function r(e, t = 2, n = t, i = c) {
55
+ if (e == null) return "";
56
+ const u = `${i}decimal${t}.${n}`;
57
+ let a = s.get(u);
58
+ return a || (a = new Intl.NumberFormat(i, {
59
+ localeMatcher: "best fit",
60
+ maximumFractionDigits: t,
61
+ minimumFractionDigits: n,
62
+ minimumIntegerDigits: 1,
63
+ style: "decimal",
64
+ useGrouping: !0
65
+ }), s.set(u, a)), a.format(e);
66
+ }
67
+ function d(e) {
68
+ return e == null ? "" : e < 1e3 ? o(e) : e < 1e6 ? `${r(e / 1e3, 2, 0)}K` : e < 1e9 ? `${r(e / 1e6, 2, 0)}M` : e < 1e12 ? `${r(e / 1e9, 2, 0)}B` : `${r(e / 1e12, 2, 0)}T`;
69
+ }
70
+ function x(e) {
71
+ return e == null ? "" : e === 1 ? "1 byte" : e < 1024 ? `${o(e)} bytes` : e < 1048576 ? `${r(e / 1024, 2, 0)} KB` : e < 1073741824 ? `${r(e / 1048576, 2, 0)} MB` : e < 1099511627776 ? `${r(e / 1073741824, 2, 0)} GB` : `${r(e / 1099511627776, 2, 0)} TB`;
72
+ }
73
+ function p(e) {
74
+ return e == null ? "" : e < 1e3 ? `${o(e)} ms` : e === 1e3 ? `${o(e)} sec` : e < 6e4 ? `${r(e / 1e3, 2, 0)} secs` : e === 6e4 ? "1 min" : e < 36e5 ? `${r(e / 6e4, 2, 0)} mins` : e === 36e5 ? "1 hr" : e < 864e5 ? `${r(e / 36e5, 2, 0)} hrs` : e === 864e5 ? "1 day" : `${r(e / 864e5, 2, 0)} days`;
75
+ }
76
+ function o(e, t = c) {
77
+ if (e == null) return "";
78
+ const n = `${t}decimal0.0`;
79
+ let i = s.get(n);
80
+ return i || (i = new Intl.NumberFormat(t, {
81
+ localeMatcher: "best fit",
82
+ maximumFractionDigits: 0,
83
+ minimumFractionDigits: 0,
84
+ minimumIntegerDigits: 1,
85
+ style: "decimal",
86
+ useGrouping: !0
87
+ }), s.set(n, i)), i.format(e);
88
+ }
89
+ function E(e) {
90
+ switch (e) {
91
+ case "csv":
92
+ return "text/csv";
93
+ case "tab":
94
+ case "tsv":
95
+ return "text/tab-separated-values";
96
+ case "xls":
97
+ return "application/vnd.ms-excel";
98
+ case "xlsx":
99
+ return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
100
+ default:
101
+ return "application/octet-stream";
102
+ }
103
+ }
104
+ export {
105
+ f as convertODataTypeIdToUsageTypeId,
106
+ m as extractExtensionFromPath,
107
+ l as extractNameFromPath,
108
+ r as formatNumberAsDecimalNumber,
109
+ p as formatNumberAsDuration,
110
+ d as formatNumberAsSize,
111
+ x as formatNumberAsStorageSize,
112
+ o as formatNumberAsWholeNumber,
113
+ E as lookupMimeTypeForExtension
114
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.335",
3
+ "version": "0.3.336",
4
4
  "description": "A library containing common constants, types and utilities used across all Data Positioning projects.",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Terrell <terrell.jm@gmail.com>",
@@ -20,6 +20,10 @@
20
20
  ".": {
21
21
  "import": "./dist/datapos-shared.es.js",
22
22
  "types": "./dist/types/src/index.d.ts"
23
+ },
24
+ "./utilities": {
25
+ "import": "./dist/utilities.js",
26
+ "types": "./dist/types/utilities.d.ts"
23
27
  }
24
28
  },
25
29
  "sideEffects": false,