@opengis/bi 1.2.1 → 1.2.2

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,3493 +0,0 @@
1
- import { openBlock as y, createElementBlock as _, createElementVNode as m, Fragment as F, renderList as L, normalizeClass as J, normalizeStyle as Ee, toDisplayString as E, createCommentVNode as T, ref as he, computed as Pe, onUnmounted as kt, createTextVNode as Ye, defineAsyncComponent as O, defineComponent as Et, mergeModels as Le, useModel as Ct, withDirectives as Rt, vModelCheckbox as Ot, resolveComponent as U, createBlock as I, createVNode as Ce, resolveDynamicComponent as Tt, createStaticVNode as et, withCtx as $t } from "vue";
2
- function j(e, t) {
3
- return e != null && e.value ? isNaN(e == null ? void 0 : e.value) ? e == null ? void 0 : e.value : new Intl.NumberFormat("en", t || {
4
- notation: "compact"
5
- }).format(e == null ? void 0 : e.value) : isNaN(e) ? e : new Intl.NumberFormat("en", t || {
6
- notation: "compact"
7
- }).format(e);
8
- }
9
- function Re(e) {
10
- if (!(e != null && e.includes("T")))
11
- return e;
12
- const [t, r, s] = e.split("T")[0].split("-");
13
- return `${s}.${r}.${t}`;
14
- }
15
- function Bo(e) {
16
- return Intl.NumberFormat("en").format(e);
17
- }
18
- function tt(e, t) {
19
- return function() {
20
- return e.apply(t, arguments);
21
- };
22
- }
23
- const { toString: Nt } = Object.prototype, { getPrototypeOf: Oe } = Object, le = /* @__PURE__ */ ((e) => (t) => {
24
- const r = Nt.call(t);
25
- return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
26
- })(/* @__PURE__ */ Object.create(null)), B = (e) => (e = e.toLowerCase(), (t) => le(t) === e), ce = (e) => (t) => typeof t === e, { isArray: G } = Array, Z = ce("undefined");
27
- function Ft(e) {
28
- return e !== null && !Z(e) && e.constructor !== null && !Z(e.constructor) && A(e.constructor.isBuffer) && e.constructor.isBuffer(e);
29
- }
30
- const rt = B("ArrayBuffer");
31
- function At(e) {
32
- let t;
33
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && rt(e.buffer), t;
34
- }
35
- const Pt = ce("string"), A = ce("function"), st = ce("number"), ue = (e) => e !== null && typeof e == "object", Lt = (e) => e === !0 || e === !1, se = (e) => {
36
- if (le(e) !== "object")
37
- return !1;
38
- const t = Oe(e);
39
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
40
- }, Bt = B("Date"), Ut = B("File"), jt = B("Blob"), It = B("FileList"), Vt = (e) => ue(e) && A(e.pipe), zt = (e) => {
41
- let t;
42
- return e && (typeof FormData == "function" && e instanceof FormData || A(e.append) && ((t = le(e)) === "formdata" || // detect form-data instance
43
- t === "object" && A(e.toString) && e.toString() === "[object FormData]"));
44
- }, Mt = B("URLSearchParams"), [qt, Ht, Wt, Jt] = ["ReadableStream", "Request", "Response", "Headers"].map(B), Kt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
45
- function ee(e, t, { allOwnKeys: r = !1 } = {}) {
46
- if (e === null || typeof e > "u")
47
- return;
48
- let s, n;
49
- if (typeof e != "object" && (e = [e]), G(e))
50
- for (s = 0, n = e.length; s < n; s++)
51
- t.call(null, e[s], s, e);
52
- else {
53
- const o = r ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
54
- let a;
55
- for (s = 0; s < i; s++)
56
- a = o[s], t.call(null, e[a], a, e);
57
- }
58
- }
59
- function nt(e, t) {
60
- t = t.toLowerCase();
61
- const r = Object.keys(e);
62
- let s = r.length, n;
63
- for (; s-- > 0; )
64
- if (n = r[s], t === n.toLowerCase())
65
- return n;
66
- return null;
67
- }
68
- const H = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, ot = (e) => !Z(e) && e !== H;
69
- function ye() {
70
- const { caseless: e } = ot(this) && this || {}, t = {}, r = (s, n) => {
71
- const o = e && nt(t, n) || n;
72
- se(t[o]) && se(s) ? t[o] = ye(t[o], s) : se(s) ? t[o] = ye({}, s) : G(s) ? t[o] = s.slice() : t[o] = s;
73
- };
74
- for (let s = 0, n = arguments.length; s < n; s++)
75
- arguments[s] && ee(arguments[s], r);
76
- return t;
77
- }
78
- const Gt = (e, t, r, { allOwnKeys: s } = {}) => (ee(t, (n, o) => {
79
- r && A(n) ? e[o] = tt(n, r) : e[o] = n;
80
- }, { allOwnKeys: s }), e), Xt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Qt = (e, t, r, s) => {
81
- e.prototype = Object.create(t.prototype, s), e.prototype.constructor = e, Object.defineProperty(e, "super", {
82
- value: t.prototype
83
- }), r && Object.assign(e.prototype, r);
84
- }, Zt = (e, t, r, s) => {
85
- let n, o, i;
86
- const a = {};
87
- if (t = t || {}, e == null) return t;
88
- do {
89
- for (n = Object.getOwnPropertyNames(e), o = n.length; o-- > 0; )
90
- i = n[o], (!s || s(i, e, t)) && !a[i] && (t[i] = e[i], a[i] = !0);
91
- e = r !== !1 && Oe(e);
92
- } while (e && (!r || r(e, t)) && e !== Object.prototype);
93
- return t;
94
- }, Yt = (e, t, r) => {
95
- e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
96
- const s = e.indexOf(t, r);
97
- return s !== -1 && s === r;
98
- }, er = (e) => {
99
- if (!e) return null;
100
- if (G(e)) return e;
101
- let t = e.length;
102
- if (!st(t)) return null;
103
- const r = new Array(t);
104
- for (; t-- > 0; )
105
- r[t] = e[t];
106
- return r;
107
- }, tr = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Oe(Uint8Array)), rr = (e, t) => {
108
- const s = (e && e[Symbol.iterator]).call(e);
109
- let n;
110
- for (; (n = s.next()) && !n.done; ) {
111
- const o = n.value;
112
- t.call(e, o[0], o[1]);
113
- }
114
- }, sr = (e, t) => {
115
- let r;
116
- const s = [];
117
- for (; (r = e.exec(t)) !== null; )
118
- s.push(r);
119
- return s;
120
- }, nr = B("HTMLFormElement"), or = (e) => e.toLowerCase().replace(
121
- /[-_\s]([a-z\d])(\w*)/g,
122
- function(r, s, n) {
123
- return s.toUpperCase() + n;
124
- }
125
- ), Be = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), ir = B("RegExp"), it = (e, t) => {
126
- const r = Object.getOwnPropertyDescriptors(e), s = {};
127
- ee(r, (n, o) => {
128
- let i;
129
- (i = t(n, o, e)) !== !1 && (s[o] = i || n);
130
- }), Object.defineProperties(e, s);
131
- }, ar = (e) => {
132
- it(e, (t, r) => {
133
- if (A(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
134
- return !1;
135
- const s = e[r];
136
- if (A(s)) {
137
- if (t.enumerable = !1, "writable" in t) {
138
- t.writable = !1;
139
- return;
140
- }
141
- t.set || (t.set = () => {
142
- throw Error("Can not rewrite read-only method '" + r + "'");
143
- });
144
- }
145
- });
146
- }, lr = (e, t) => {
147
- const r = {}, s = (n) => {
148
- n.forEach((o) => {
149
- r[o] = !0;
150
- });
151
- };
152
- return G(e) ? s(e) : s(String(e).split(t)), r;
153
- }, cr = () => {
154
- }, ur = (e, t) => e != null && Number.isFinite(e = +e) ? e : t, pe = "abcdefghijklmnopqrstuvwxyz", Ue = "0123456789", at = {
155
- DIGIT: Ue,
156
- ALPHA: pe,
157
- ALPHA_DIGIT: pe + pe.toUpperCase() + Ue
158
- }, dr = (e = 16, t = at.ALPHA_DIGIT) => {
159
- let r = "";
160
- const { length: s } = t;
161
- for (; e--; )
162
- r += t[Math.random() * s | 0];
163
- return r;
164
- };
165
- function fr(e) {
166
- return !!(e && A(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
167
- }
168
- const hr = (e) => {
169
- const t = new Array(10), r = (s, n) => {
170
- if (ue(s)) {
171
- if (t.indexOf(s) >= 0)
172
- return;
173
- if (!("toJSON" in s)) {
174
- t[n] = s;
175
- const o = G(s) ? [] : {};
176
- return ee(s, (i, a) => {
177
- const f = r(i, n + 1);
178
- !Z(f) && (o[a] = f);
179
- }), t[n] = void 0, o;
180
- }
181
- }
182
- return s;
183
- };
184
- return r(e, 0);
185
- }, pr = B("AsyncFunction"), mr = (e) => e && (ue(e) || A(e)) && A(e.then) && A(e.catch), lt = ((e, t) => e ? setImmediate : t ? ((r, s) => (H.addEventListener("message", ({ source: n, data: o }) => {
186
- n === H && o === r && s.length && s.shift()();
187
- }, !1), (n) => {
188
- s.push(n), H.postMessage(r, "*");
189
- }))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
190
- typeof setImmediate == "function",
191
- A(H.postMessage)
192
- ), gr = typeof queueMicrotask < "u" ? queueMicrotask.bind(H) : typeof process < "u" && process.nextTick || lt, l = {
193
- isArray: G,
194
- isArrayBuffer: rt,
195
- isBuffer: Ft,
196
- isFormData: zt,
197
- isArrayBufferView: At,
198
- isString: Pt,
199
- isNumber: st,
200
- isBoolean: Lt,
201
- isObject: ue,
202
- isPlainObject: se,
203
- isReadableStream: qt,
204
- isRequest: Ht,
205
- isResponse: Wt,
206
- isHeaders: Jt,
207
- isUndefined: Z,
208
- isDate: Bt,
209
- isFile: Ut,
210
- isBlob: jt,
211
- isRegExp: ir,
212
- isFunction: A,
213
- isStream: Vt,
214
- isURLSearchParams: Mt,
215
- isTypedArray: tr,
216
- isFileList: It,
217
- forEach: ee,
218
- merge: ye,
219
- extend: Gt,
220
- trim: Kt,
221
- stripBOM: Xt,
222
- inherits: Qt,
223
- toFlatObject: Zt,
224
- kindOf: le,
225
- kindOfTest: B,
226
- endsWith: Yt,
227
- toArray: er,
228
- forEachEntry: rr,
229
- matchAll: sr,
230
- isHTMLForm: nr,
231
- hasOwnProperty: Be,
232
- hasOwnProp: Be,
233
- // an alias to avoid ESLint no-prototype-builtins detection
234
- reduceDescriptors: it,
235
- freezeMethods: ar,
236
- toObjectSet: lr,
237
- toCamelCase: or,
238
- noop: cr,
239
- toFiniteNumber: ur,
240
- findKey: nt,
241
- global: H,
242
- isContextDefined: ot,
243
- ALPHABET: at,
244
- generateString: dr,
245
- isSpecCompliantForm: fr,
246
- toJSONObject: hr,
247
- isAsyncFn: pr,
248
- isThenable: mr,
249
- setImmediate: lt,
250
- asap: gr
251
- };
252
- function D(e, t, r, s, n) {
253
- Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), r && (this.config = r), s && (this.request = s), n && (this.response = n, this.status = n.status ? n.status : null);
254
- }
255
- l.inherits(D, Error, {
256
- toJSON: function() {
257
- return {
258
- // Standard
259
- message: this.message,
260
- name: this.name,
261
- // Microsoft
262
- description: this.description,
263
- number: this.number,
264
- // Mozilla
265
- fileName: this.fileName,
266
- lineNumber: this.lineNumber,
267
- columnNumber: this.columnNumber,
268
- stack: this.stack,
269
- // Axios
270
- config: l.toJSONObject(this.config),
271
- code: this.code,
272
- status: this.status
273
- };
274
- }
275
- });
276
- const ct = D.prototype, ut = {};
277
- [
278
- "ERR_BAD_OPTION_VALUE",
279
- "ERR_BAD_OPTION",
280
- "ECONNABORTED",
281
- "ETIMEDOUT",
282
- "ERR_NETWORK",
283
- "ERR_FR_TOO_MANY_REDIRECTS",
284
- "ERR_DEPRECATED",
285
- "ERR_BAD_RESPONSE",
286
- "ERR_BAD_REQUEST",
287
- "ERR_CANCELED",
288
- "ERR_NOT_SUPPORT",
289
- "ERR_INVALID_URL"
290
- // eslint-disable-next-line func-names
291
- ].forEach((e) => {
292
- ut[e] = { value: e };
293
- });
294
- Object.defineProperties(D, ut);
295
- Object.defineProperty(ct, "isAxiosError", { value: !0 });
296
- D.from = (e, t, r, s, n, o) => {
297
- const i = Object.create(ct);
298
- return l.toFlatObject(e, i, function(f) {
299
- return f !== Error.prototype;
300
- }, (a) => a !== "isAxiosError"), D.call(i, e.message, t, r, s, n), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
301
- };
302
- const br = null;
303
- function xe(e) {
304
- return l.isPlainObject(e) || l.isArray(e);
305
- }
306
- function dt(e) {
307
- return l.endsWith(e, "[]") ? e.slice(0, -2) : e;
308
- }
309
- function je(e, t, r) {
310
- return e ? e.concat(t).map(function(n, o) {
311
- return n = dt(n), !r && o ? "[" + n + "]" : n;
312
- }).join(r ? "." : "") : t;
313
- }
314
- function wr(e) {
315
- return l.isArray(e) && !e.some(xe);
316
- }
317
- const yr = l.toFlatObject(l, {}, null, function(t) {
318
- return /^is[A-Z]/.test(t);
319
- });
320
- function de(e, t, r) {
321
- if (!l.isObject(e))
322
- throw new TypeError("target must be an object");
323
- t = t || new FormData(), r = l.toFlatObject(r, {
324
- metaTokens: !0,
325
- dots: !1,
326
- indexes: !1
327
- }, !1, function(p, b) {
328
- return !l.isUndefined(b[p]);
329
- });
330
- const s = r.metaTokens, n = r.visitor || u, o = r.dots, i = r.indexes, f = (r.Blob || typeof Blob < "u" && Blob) && l.isSpecCompliantForm(t);
331
- if (!l.isFunction(n))
332
- throw new TypeError("visitor must be a function");
333
- function c(d) {
334
- if (d === null) return "";
335
- if (l.isDate(d))
336
- return d.toISOString();
337
- if (!f && l.isBlob(d))
338
- throw new D("Blob is not supported. Use a Buffer instead.");
339
- return l.isArrayBuffer(d) || l.isTypedArray(d) ? f && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
340
- }
341
- function u(d, p, b) {
342
- let v = d;
343
- if (d && !b && typeof d == "object") {
344
- if (l.endsWith(p, "{}"))
345
- p = s ? p : p.slice(0, -2), d = JSON.stringify(d);
346
- else if (l.isArray(d) && wr(d) || (l.isFileList(d) || l.endsWith(p, "[]")) && (v = l.toArray(d)))
347
- return p = dt(p), v.forEach(function(w, P) {
348
- !(l.isUndefined(w) || w === null) && t.append(
349
- // eslint-disable-next-line no-nested-ternary
350
- i === !0 ? je([p], P, o) : i === null ? p : p + "[]",
351
- c(w)
352
- );
353
- }), !1;
354
- }
355
- return xe(d) ? !0 : (t.append(je(b, p, o), c(d)), !1);
356
- }
357
- const h = [], x = Object.assign(yr, {
358
- defaultVisitor: u,
359
- convertValue: c,
360
- isVisitable: xe
361
- });
362
- function g(d, p) {
363
- if (!l.isUndefined(d)) {
364
- if (h.indexOf(d) !== -1)
365
- throw Error("Circular reference detected in " + p.join("."));
366
- h.push(d), l.forEach(d, function(v, S) {
367
- (!(l.isUndefined(v) || v === null) && n.call(
368
- t,
369
- v,
370
- l.isString(S) ? S.trim() : S,
371
- p,
372
- x
373
- )) === !0 && g(v, p ? p.concat(S) : [S]);
374
- }), h.pop();
375
- }
376
- }
377
- if (!l.isObject(e))
378
- throw new TypeError("data must be an object");
379
- return g(e), t;
380
- }
381
- function Ie(e) {
382
- const t = {
383
- "!": "%21",
384
- "'": "%27",
385
- "(": "%28",
386
- ")": "%29",
387
- "~": "%7E",
388
- "%20": "+",
389
- "%00": "\0"
390
- };
391
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(s) {
392
- return t[s];
393
- });
394
- }
395
- function Te(e, t) {
396
- this._pairs = [], e && de(e, this, t);
397
- }
398
- const ft = Te.prototype;
399
- ft.append = function(t, r) {
400
- this._pairs.push([t, r]);
401
- };
402
- ft.toString = function(t) {
403
- const r = t ? function(s) {
404
- return t.call(this, s, Ie);
405
- } : Ie;
406
- return this._pairs.map(function(n) {
407
- return r(n[0]) + "=" + r(n[1]);
408
- }, "").join("&");
409
- };
410
- function xr(e) {
411
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
412
- }
413
- function ht(e, t, r) {
414
- if (!t)
415
- return e;
416
- const s = r && r.encode || xr, n = r && r.serialize;
417
- let o;
418
- if (n ? o = n(t, r) : o = l.isURLSearchParams(t) ? t.toString() : new Te(t, r).toString(s), o) {
419
- const i = e.indexOf("#");
420
- i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
421
- }
422
- return e;
423
- }
424
- class Ve {
425
- constructor() {
426
- this.handlers = [];
427
- }
428
- /**
429
- * Add a new interceptor to the stack
430
- *
431
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
432
- * @param {Function} rejected The function to handle `reject` for a `Promise`
433
- *
434
- * @return {Number} An ID used to remove interceptor later
435
- */
436
- use(t, r, s) {
437
- return this.handlers.push({
438
- fulfilled: t,
439
- rejected: r,
440
- synchronous: s ? s.synchronous : !1,
441
- runWhen: s ? s.runWhen : null
442
- }), this.handlers.length - 1;
443
- }
444
- /**
445
- * Remove an interceptor from the stack
446
- *
447
- * @param {Number} id The ID that was returned by `use`
448
- *
449
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
450
- */
451
- eject(t) {
452
- this.handlers[t] && (this.handlers[t] = null);
453
- }
454
- /**
455
- * Clear all interceptors from the stack
456
- *
457
- * @returns {void}
458
- */
459
- clear() {
460
- this.handlers && (this.handlers = []);
461
- }
462
- /**
463
- * Iterate over all the registered interceptors
464
- *
465
- * This method is particularly useful for skipping over any
466
- * interceptors that may have become `null` calling `eject`.
467
- *
468
- * @param {Function} fn The function to call for each interceptor
469
- *
470
- * @returns {void}
471
- */
472
- forEach(t) {
473
- l.forEach(this.handlers, function(s) {
474
- s !== null && t(s);
475
- });
476
- }
477
- }
478
- const pt = {
479
- silentJSONParsing: !0,
480
- forcedJSONParsing: !0,
481
- clarifyTimeoutError: !1
482
- }, _r = typeof URLSearchParams < "u" ? URLSearchParams : Te, Dr = typeof FormData < "u" ? FormData : null, Sr = typeof Blob < "u" ? Blob : null, vr = {
483
- isBrowser: !0,
484
- classes: {
485
- URLSearchParams: _r,
486
- FormData: Dr,
487
- Blob: Sr
488
- },
489
- protocols: ["http", "https", "file", "blob", "url", "data"]
490
- }, $e = typeof window < "u" && typeof document < "u", _e = typeof navigator == "object" && navigator || void 0, kr = $e && (!_e || ["ReactNative", "NativeScript", "NS"].indexOf(_e.product) < 0), Er = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
491
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Cr = $e && window.location.href || "http://localhost", Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
492
- __proto__: null,
493
- hasBrowserEnv: $e,
494
- hasStandardBrowserEnv: kr,
495
- hasStandardBrowserWebWorkerEnv: Er,
496
- navigator: _e,
497
- origin: Cr
498
- }, Symbol.toStringTag, { value: "Module" })), $ = {
499
- ...Rr,
500
- ...vr
501
- };
502
- function Or(e, t) {
503
- return de(e, new $.classes.URLSearchParams(), Object.assign({
504
- visitor: function(r, s, n, o) {
505
- return $.isNode && l.isBuffer(r) ? (this.append(s, r.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
506
- }
507
- }, t));
508
- }
509
- function Tr(e) {
510
- return l.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
511
- }
512
- function $r(e) {
513
- const t = {}, r = Object.keys(e);
514
- let s;
515
- const n = r.length;
516
- let o;
517
- for (s = 0; s < n; s++)
518
- o = r[s], t[o] = e[o];
519
- return t;
520
- }
521
- function mt(e) {
522
- function t(r, s, n, o) {
523
- let i = r[o++];
524
- if (i === "__proto__") return !0;
525
- const a = Number.isFinite(+i), f = o >= r.length;
526
- return i = !i && l.isArray(n) ? n.length : i, f ? (l.hasOwnProp(n, i) ? n[i] = [n[i], s] : n[i] = s, !a) : ((!n[i] || !l.isObject(n[i])) && (n[i] = []), t(r, s, n[i], o) && l.isArray(n[i]) && (n[i] = $r(n[i])), !a);
527
- }
528
- if (l.isFormData(e) && l.isFunction(e.entries)) {
529
- const r = {};
530
- return l.forEachEntry(e, (s, n) => {
531
- t(Tr(s), n, r, 0);
532
- }), r;
533
- }
534
- return null;
535
- }
536
- function Nr(e, t, r) {
537
- if (l.isString(e))
538
- try {
539
- return (t || JSON.parse)(e), l.trim(e);
540
- } catch (s) {
541
- if (s.name !== "SyntaxError")
542
- throw s;
543
- }
544
- return (0, JSON.stringify)(e);
545
- }
546
- const te = {
547
- transitional: pt,
548
- adapter: ["xhr", "http", "fetch"],
549
- transformRequest: [function(t, r) {
550
- const s = r.getContentType() || "", n = s.indexOf("application/json") > -1, o = l.isObject(t);
551
- if (o && l.isHTMLForm(t) && (t = new FormData(t)), l.isFormData(t))
552
- return n ? JSON.stringify(mt(t)) : t;
553
- if (l.isArrayBuffer(t) || l.isBuffer(t) || l.isStream(t) || l.isFile(t) || l.isBlob(t) || l.isReadableStream(t))
554
- return t;
555
- if (l.isArrayBufferView(t))
556
- return t.buffer;
557
- if (l.isURLSearchParams(t))
558
- return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
559
- let a;
560
- if (o) {
561
- if (s.indexOf("application/x-www-form-urlencoded") > -1)
562
- return Or(t, this.formSerializer).toString();
563
- if ((a = l.isFileList(t)) || s.indexOf("multipart/form-data") > -1) {
564
- const f = this.env && this.env.FormData;
565
- return de(
566
- a ? { "files[]": t } : t,
567
- f && new f(),
568
- this.formSerializer
569
- );
570
- }
571
- }
572
- return o || n ? (r.setContentType("application/json", !1), Nr(t)) : t;
573
- }],
574
- transformResponse: [function(t) {
575
- const r = this.transitional || te.transitional, s = r && r.forcedJSONParsing, n = this.responseType === "json";
576
- if (l.isResponse(t) || l.isReadableStream(t))
577
- return t;
578
- if (t && l.isString(t) && (s && !this.responseType || n)) {
579
- const i = !(r && r.silentJSONParsing) && n;
580
- try {
581
- return JSON.parse(t);
582
- } catch (a) {
583
- if (i)
584
- throw a.name === "SyntaxError" ? D.from(a, D.ERR_BAD_RESPONSE, this, null, this.response) : a;
585
- }
586
- }
587
- return t;
588
- }],
589
- /**
590
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
591
- * timeout is not created.
592
- */
593
- timeout: 0,
594
- xsrfCookieName: "XSRF-TOKEN",
595
- xsrfHeaderName: "X-XSRF-TOKEN",
596
- maxContentLength: -1,
597
- maxBodyLength: -1,
598
- env: {
599
- FormData: $.classes.FormData,
600
- Blob: $.classes.Blob
601
- },
602
- validateStatus: function(t) {
603
- return t >= 200 && t < 300;
604
- },
605
- headers: {
606
- common: {
607
- Accept: "application/json, text/plain, */*",
608
- "Content-Type": void 0
609
- }
610
- }
611
- };
612
- l.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
613
- te.headers[e] = {};
614
- });
615
- const Fr = l.toObjectSet([
616
- "age",
617
- "authorization",
618
- "content-length",
619
- "content-type",
620
- "etag",
621
- "expires",
622
- "from",
623
- "host",
624
- "if-modified-since",
625
- "if-unmodified-since",
626
- "last-modified",
627
- "location",
628
- "max-forwards",
629
- "proxy-authorization",
630
- "referer",
631
- "retry-after",
632
- "user-agent"
633
- ]), Ar = (e) => {
634
- const t = {};
635
- let r, s, n;
636
- return e && e.split(`
637
- `).forEach(function(i) {
638
- n = i.indexOf(":"), r = i.substring(0, n).trim().toLowerCase(), s = i.substring(n + 1).trim(), !(!r || t[r] && Fr[r]) && (r === "set-cookie" ? t[r] ? t[r].push(s) : t[r] = [s] : t[r] = t[r] ? t[r] + ", " + s : s);
639
- }), t;
640
- }, ze = Symbol("internals");
641
- function Q(e) {
642
- return e && String(e).trim().toLowerCase();
643
- }
644
- function ne(e) {
645
- return e === !1 || e == null ? e : l.isArray(e) ? e.map(ne) : String(e);
646
- }
647
- function Pr(e) {
648
- const t = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
649
- let s;
650
- for (; s = r.exec(e); )
651
- t[s[1]] = s[2];
652
- return t;
653
- }
654
- const Lr = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
655
- function me(e, t, r, s, n) {
656
- if (l.isFunction(s))
657
- return s.call(this, t, r);
658
- if (n && (t = r), !!l.isString(t)) {
659
- if (l.isString(s))
660
- return t.indexOf(s) !== -1;
661
- if (l.isRegExp(s))
662
- return s.test(t);
663
- }
664
- }
665
- function Br(e) {
666
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, r, s) => r.toUpperCase() + s);
667
- }
668
- function Ur(e, t) {
669
- const r = l.toCamelCase(" " + t);
670
- ["get", "set", "has"].forEach((s) => {
671
- Object.defineProperty(e, s + r, {
672
- value: function(n, o, i) {
673
- return this[s].call(this, t, n, o, i);
674
- },
675
- configurable: !0
676
- });
677
- });
678
- }
679
- class N {
680
- constructor(t) {
681
- t && this.set(t);
682
- }
683
- set(t, r, s) {
684
- const n = this;
685
- function o(a, f, c) {
686
- const u = Q(f);
687
- if (!u)
688
- throw new Error("header name must be a non-empty string");
689
- const h = l.findKey(n, u);
690
- (!h || n[h] === void 0 || c === !0 || c === void 0 && n[h] !== !1) && (n[h || f] = ne(a));
691
- }
692
- const i = (a, f) => l.forEach(a, (c, u) => o(c, u, f));
693
- if (l.isPlainObject(t) || t instanceof this.constructor)
694
- i(t, r);
695
- else if (l.isString(t) && (t = t.trim()) && !Lr(t))
696
- i(Ar(t), r);
697
- else if (l.isHeaders(t))
698
- for (const [a, f] of t.entries())
699
- o(f, a, s);
700
- else
701
- t != null && o(r, t, s);
702
- return this;
703
- }
704
- get(t, r) {
705
- if (t = Q(t), t) {
706
- const s = l.findKey(this, t);
707
- if (s) {
708
- const n = this[s];
709
- if (!r)
710
- return n;
711
- if (r === !0)
712
- return Pr(n);
713
- if (l.isFunction(r))
714
- return r.call(this, n, s);
715
- if (l.isRegExp(r))
716
- return r.exec(n);
717
- throw new TypeError("parser must be boolean|regexp|function");
718
- }
719
- }
720
- }
721
- has(t, r) {
722
- if (t = Q(t), t) {
723
- const s = l.findKey(this, t);
724
- return !!(s && this[s] !== void 0 && (!r || me(this, this[s], s, r)));
725
- }
726
- return !1;
727
- }
728
- delete(t, r) {
729
- const s = this;
730
- let n = !1;
731
- function o(i) {
732
- if (i = Q(i), i) {
733
- const a = l.findKey(s, i);
734
- a && (!r || me(s, s[a], a, r)) && (delete s[a], n = !0);
735
- }
736
- }
737
- return l.isArray(t) ? t.forEach(o) : o(t), n;
738
- }
739
- clear(t) {
740
- const r = Object.keys(this);
741
- let s = r.length, n = !1;
742
- for (; s--; ) {
743
- const o = r[s];
744
- (!t || me(this, this[o], o, t, !0)) && (delete this[o], n = !0);
745
- }
746
- return n;
747
- }
748
- normalize(t) {
749
- const r = this, s = {};
750
- return l.forEach(this, (n, o) => {
751
- const i = l.findKey(s, o);
752
- if (i) {
753
- r[i] = ne(n), delete r[o];
754
- return;
755
- }
756
- const a = t ? Br(o) : String(o).trim();
757
- a !== o && delete r[o], r[a] = ne(n), s[a] = !0;
758
- }), this;
759
- }
760
- concat(...t) {
761
- return this.constructor.concat(this, ...t);
762
- }
763
- toJSON(t) {
764
- const r = /* @__PURE__ */ Object.create(null);
765
- return l.forEach(this, (s, n) => {
766
- s != null && s !== !1 && (r[n] = t && l.isArray(s) ? s.join(", ") : s);
767
- }), r;
768
- }
769
- [Symbol.iterator]() {
770
- return Object.entries(this.toJSON())[Symbol.iterator]();
771
- }
772
- toString() {
773
- return Object.entries(this.toJSON()).map(([t, r]) => t + ": " + r).join(`
774
- `);
775
- }
776
- get [Symbol.toStringTag]() {
777
- return "AxiosHeaders";
778
- }
779
- static from(t) {
780
- return t instanceof this ? t : new this(t);
781
- }
782
- static concat(t, ...r) {
783
- const s = new this(t);
784
- return r.forEach((n) => s.set(n)), s;
785
- }
786
- static accessor(t) {
787
- const s = (this[ze] = this[ze] = {
788
- accessors: {}
789
- }).accessors, n = this.prototype;
790
- function o(i) {
791
- const a = Q(i);
792
- s[a] || (Ur(n, i), s[a] = !0);
793
- }
794
- return l.isArray(t) ? t.forEach(o) : o(t), this;
795
- }
796
- }
797
- N.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
798
- l.reduceDescriptors(N.prototype, ({ value: e }, t) => {
799
- let r = t[0].toUpperCase() + t.slice(1);
800
- return {
801
- get: () => e,
802
- set(s) {
803
- this[r] = s;
804
- }
805
- };
806
- });
807
- l.freezeMethods(N);
808
- function ge(e, t) {
809
- const r = this || te, s = t || r, n = N.from(s.headers);
810
- let o = s.data;
811
- return l.forEach(e, function(a) {
812
- o = a.call(r, o, n.normalize(), t ? t.status : void 0);
813
- }), n.normalize(), o;
814
- }
815
- function gt(e) {
816
- return !!(e && e.__CANCEL__);
817
- }
818
- function X(e, t, r) {
819
- D.call(this, e ?? "canceled", D.ERR_CANCELED, t, r), this.name = "CanceledError";
820
- }
821
- l.inherits(X, D, {
822
- __CANCEL__: !0
823
- });
824
- function bt(e, t, r) {
825
- const s = r.config.validateStatus;
826
- !r.status || !s || s(r.status) ? e(r) : t(new D(
827
- "Request failed with status code " + r.status,
828
- [D.ERR_BAD_REQUEST, D.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
829
- r.config,
830
- r.request,
831
- r
832
- ));
833
- }
834
- function jr(e) {
835
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
836
- return t && t[1] || "";
837
- }
838
- function Ir(e, t) {
839
- e = e || 10;
840
- const r = new Array(e), s = new Array(e);
841
- let n = 0, o = 0, i;
842
- return t = t !== void 0 ? t : 1e3, function(f) {
843
- const c = Date.now(), u = s[o];
844
- i || (i = c), r[n] = f, s[n] = c;
845
- let h = o, x = 0;
846
- for (; h !== n; )
847
- x += r[h++], h = h % e;
848
- if (n = (n + 1) % e, n === o && (o = (o + 1) % e), c - i < t)
849
- return;
850
- const g = u && c - u;
851
- return g ? Math.round(x * 1e3 / g) : void 0;
852
- };
853
- }
854
- function Vr(e, t) {
855
- let r = 0, s = 1e3 / t, n, o;
856
- const i = (c, u = Date.now()) => {
857
- r = u, n = null, o && (clearTimeout(o), o = null), e.apply(null, c);
858
- };
859
- return [(...c) => {
860
- const u = Date.now(), h = u - r;
861
- h >= s ? i(c, u) : (n = c, o || (o = setTimeout(() => {
862
- o = null, i(n);
863
- }, s - h)));
864
- }, () => n && i(n)];
865
- }
866
- const oe = (e, t, r = 3) => {
867
- let s = 0;
868
- const n = Ir(50, 250);
869
- return Vr((o) => {
870
- const i = o.loaded, a = o.lengthComputable ? o.total : void 0, f = i - s, c = n(f), u = i <= a;
871
- s = i;
872
- const h = {
873
- loaded: i,
874
- total: a,
875
- progress: a ? i / a : void 0,
876
- bytes: f,
877
- rate: c || void 0,
878
- estimated: c && a && u ? (a - i) / c : void 0,
879
- event: o,
880
- lengthComputable: a != null,
881
- [t ? "download" : "upload"]: !0
882
- };
883
- e(h);
884
- }, r);
885
- }, Me = (e, t) => {
886
- const r = e != null;
887
- return [(s) => t[0]({
888
- lengthComputable: r,
889
- total: e,
890
- loaded: s
891
- }), t[1]];
892
- }, qe = (e) => (...t) => l.asap(() => e(...t)), zr = $.hasStandardBrowserEnv ? (
893
- // Standard browser envs have full support of the APIs needed to test
894
- // whether the request URL is of the same origin as current location.
895
- function() {
896
- const t = $.navigator && /(msie|trident)/i.test($.navigator.userAgent), r = document.createElement("a");
897
- let s;
898
- function n(o) {
899
- let i = o;
900
- return t && (r.setAttribute("href", i), i = r.href), r.setAttribute("href", i), {
901
- href: r.href,
902
- protocol: r.protocol ? r.protocol.replace(/:$/, "") : "",
903
- host: r.host,
904
- search: r.search ? r.search.replace(/^\?/, "") : "",
905
- hash: r.hash ? r.hash.replace(/^#/, "") : "",
906
- hostname: r.hostname,
907
- port: r.port,
908
- pathname: r.pathname.charAt(0) === "/" ? r.pathname : "/" + r.pathname
909
- };
910
- }
911
- return s = n(window.location.href), function(i) {
912
- const a = l.isString(i) ? n(i) : i;
913
- return a.protocol === s.protocol && a.host === s.host;
914
- };
915
- }()
916
- ) : (
917
- // Non standard browser envs (web workers, react-native) lack needed support.
918
- /* @__PURE__ */ function() {
919
- return function() {
920
- return !0;
921
- };
922
- }()
923
- ), Mr = $.hasStandardBrowserEnv ? (
924
- // Standard browser envs support document.cookie
925
- {
926
- write(e, t, r, s, n, o) {
927
- const i = [e + "=" + encodeURIComponent(t)];
928
- l.isNumber(r) && i.push("expires=" + new Date(r).toGMTString()), l.isString(s) && i.push("path=" + s), l.isString(n) && i.push("domain=" + n), o === !0 && i.push("secure"), document.cookie = i.join("; ");
929
- },
930
- read(e) {
931
- const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
932
- return t ? decodeURIComponent(t[3]) : null;
933
- },
934
- remove(e) {
935
- this.write(e, "", Date.now() - 864e5);
936
- }
937
- }
938
- ) : (
939
- // Non-standard browser env (web workers, react-native) lack needed support.
940
- {
941
- write() {
942
- },
943
- read() {
944
- return null;
945
- },
946
- remove() {
947
- }
948
- }
949
- );
950
- function qr(e) {
951
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
952
- }
953
- function Hr(e, t) {
954
- return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
955
- }
956
- function wt(e, t) {
957
- return e && !qr(t) ? Hr(e, t) : t;
958
- }
959
- const He = (e) => e instanceof N ? { ...e } : e;
960
- function K(e, t) {
961
- t = t || {};
962
- const r = {};
963
- function s(c, u, h) {
964
- return l.isPlainObject(c) && l.isPlainObject(u) ? l.merge.call({ caseless: h }, c, u) : l.isPlainObject(u) ? l.merge({}, u) : l.isArray(u) ? u.slice() : u;
965
- }
966
- function n(c, u, h) {
967
- if (l.isUndefined(u)) {
968
- if (!l.isUndefined(c))
969
- return s(void 0, c, h);
970
- } else return s(c, u, h);
971
- }
972
- function o(c, u) {
973
- if (!l.isUndefined(u))
974
- return s(void 0, u);
975
- }
976
- function i(c, u) {
977
- if (l.isUndefined(u)) {
978
- if (!l.isUndefined(c))
979
- return s(void 0, c);
980
- } else return s(void 0, u);
981
- }
982
- function a(c, u, h) {
983
- if (h in t)
984
- return s(c, u);
985
- if (h in e)
986
- return s(void 0, c);
987
- }
988
- const f = {
989
- url: o,
990
- method: o,
991
- data: o,
992
- baseURL: i,
993
- transformRequest: i,
994
- transformResponse: i,
995
- paramsSerializer: i,
996
- timeout: i,
997
- timeoutMessage: i,
998
- withCredentials: i,
999
- withXSRFToken: i,
1000
- adapter: i,
1001
- responseType: i,
1002
- xsrfCookieName: i,
1003
- xsrfHeaderName: i,
1004
- onUploadProgress: i,
1005
- onDownloadProgress: i,
1006
- decompress: i,
1007
- maxContentLength: i,
1008
- maxBodyLength: i,
1009
- beforeRedirect: i,
1010
- transport: i,
1011
- httpAgent: i,
1012
- httpsAgent: i,
1013
- cancelToken: i,
1014
- socketPath: i,
1015
- responseEncoding: i,
1016
- validateStatus: a,
1017
- headers: (c, u) => n(He(c), He(u), !0)
1018
- };
1019
- return l.forEach(Object.keys(Object.assign({}, e, t)), function(u) {
1020
- const h = f[u] || n, x = h(e[u], t[u], u);
1021
- l.isUndefined(x) && h !== a || (r[u] = x);
1022
- }), r;
1023
- }
1024
- const yt = (e) => {
1025
- const t = K({}, e);
1026
- let { data: r, withXSRFToken: s, xsrfHeaderName: n, xsrfCookieName: o, headers: i, auth: a } = t;
1027
- t.headers = i = N.from(i), t.url = ht(wt(t.baseURL, t.url), e.params, e.paramsSerializer), a && i.set(
1028
- "Authorization",
1029
- "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1030
- );
1031
- let f;
1032
- if (l.isFormData(r)) {
1033
- if ($.hasStandardBrowserEnv || $.hasStandardBrowserWebWorkerEnv)
1034
- i.setContentType(void 0);
1035
- else if ((f = i.getContentType()) !== !1) {
1036
- const [c, ...u] = f ? f.split(";").map((h) => h.trim()).filter(Boolean) : [];
1037
- i.setContentType([c || "multipart/form-data", ...u].join("; "));
1038
- }
1039
- }
1040
- if ($.hasStandardBrowserEnv && (s && l.isFunction(s) && (s = s(t)), s || s !== !1 && zr(t.url))) {
1041
- const c = n && o && Mr.read(o);
1042
- c && i.set(n, c);
1043
- }
1044
- return t;
1045
- }, Wr = typeof XMLHttpRequest < "u", Jr = Wr && function(e) {
1046
- return new Promise(function(r, s) {
1047
- const n = yt(e);
1048
- let o = n.data;
1049
- const i = N.from(n.headers).normalize();
1050
- let { responseType: a, onUploadProgress: f, onDownloadProgress: c } = n, u, h, x, g, d;
1051
- function p() {
1052
- g && g(), d && d(), n.cancelToken && n.cancelToken.unsubscribe(u), n.signal && n.signal.removeEventListener("abort", u);
1053
- }
1054
- let b = new XMLHttpRequest();
1055
- b.open(n.method.toUpperCase(), n.url, !0), b.timeout = n.timeout;
1056
- function v() {
1057
- if (!b)
1058
- return;
1059
- const w = N.from(
1060
- "getAllResponseHeaders" in b && b.getAllResponseHeaders()
1061
- ), C = {
1062
- data: !a || a === "text" || a === "json" ? b.responseText : b.response,
1063
- status: b.status,
1064
- statusText: b.statusText,
1065
- headers: w,
1066
- config: e,
1067
- request: b
1068
- };
1069
- bt(function(q) {
1070
- r(q), p();
1071
- }, function(q) {
1072
- s(q), p();
1073
- }, C), b = null;
1074
- }
1075
- "onloadend" in b ? b.onloadend = v : b.onreadystatechange = function() {
1076
- !b || b.readyState !== 4 || b.status === 0 && !(b.responseURL && b.responseURL.indexOf("file:") === 0) || setTimeout(v);
1077
- }, b.onabort = function() {
1078
- b && (s(new D("Request aborted", D.ECONNABORTED, e, b)), b = null);
1079
- }, b.onerror = function() {
1080
- s(new D("Network Error", D.ERR_NETWORK, e, b)), b = null;
1081
- }, b.ontimeout = function() {
1082
- let P = n.timeout ? "timeout of " + n.timeout + "ms exceeded" : "timeout exceeded";
1083
- const C = n.transitional || pt;
1084
- n.timeoutErrorMessage && (P = n.timeoutErrorMessage), s(new D(
1085
- P,
1086
- C.clarifyTimeoutError ? D.ETIMEDOUT : D.ECONNABORTED,
1087
- e,
1088
- b
1089
- )), b = null;
1090
- }, o === void 0 && i.setContentType(null), "setRequestHeader" in b && l.forEach(i.toJSON(), function(P, C) {
1091
- b.setRequestHeader(C, P);
1092
- }), l.isUndefined(n.withCredentials) || (b.withCredentials = !!n.withCredentials), a && a !== "json" && (b.responseType = n.responseType), c && ([x, d] = oe(c, !0), b.addEventListener("progress", x)), f && b.upload && ([h, g] = oe(f), b.upload.addEventListener("progress", h), b.upload.addEventListener("loadend", g)), (n.cancelToken || n.signal) && (u = (w) => {
1093
- b && (s(!w || w.type ? new X(null, e, b) : w), b.abort(), b = null);
1094
- }, n.cancelToken && n.cancelToken.subscribe(u), n.signal && (n.signal.aborted ? u() : n.signal.addEventListener("abort", u)));
1095
- const S = jr(n.url);
1096
- if (S && $.protocols.indexOf(S) === -1) {
1097
- s(new D("Unsupported protocol " + S + ":", D.ERR_BAD_REQUEST, e));
1098
- return;
1099
- }
1100
- b.send(o || null);
1101
- });
1102
- }, Kr = (e, t) => {
1103
- const { length: r } = e = e ? e.filter(Boolean) : [];
1104
- if (t || r) {
1105
- let s = new AbortController(), n;
1106
- const o = function(c) {
1107
- if (!n) {
1108
- n = !0, a();
1109
- const u = c instanceof Error ? c : this.reason;
1110
- s.abort(u instanceof D ? u : new X(u instanceof Error ? u.message : u));
1111
- }
1112
- };
1113
- let i = t && setTimeout(() => {
1114
- i = null, o(new D(`timeout ${t} of ms exceeded`, D.ETIMEDOUT));
1115
- }, t);
1116
- const a = () => {
1117
- e && (i && clearTimeout(i), i = null, e.forEach((c) => {
1118
- c.unsubscribe ? c.unsubscribe(o) : c.removeEventListener("abort", o);
1119
- }), e = null);
1120
- };
1121
- e.forEach((c) => c.addEventListener("abort", o));
1122
- const { signal: f } = s;
1123
- return f.unsubscribe = () => l.asap(a), f;
1124
- }
1125
- }, Gr = function* (e, t) {
1126
- let r = e.byteLength;
1127
- if (r < t) {
1128
- yield e;
1129
- return;
1130
- }
1131
- let s = 0, n;
1132
- for (; s < r; )
1133
- n = s + t, yield e.slice(s, n), s = n;
1134
- }, Xr = async function* (e, t) {
1135
- for await (const r of Qr(e))
1136
- yield* Gr(r, t);
1137
- }, Qr = async function* (e) {
1138
- if (e[Symbol.asyncIterator]) {
1139
- yield* e;
1140
- return;
1141
- }
1142
- const t = e.getReader();
1143
- try {
1144
- for (; ; ) {
1145
- const { done: r, value: s } = await t.read();
1146
- if (r)
1147
- break;
1148
- yield s;
1149
- }
1150
- } finally {
1151
- await t.cancel();
1152
- }
1153
- }, We = (e, t, r, s) => {
1154
- const n = Xr(e, t);
1155
- let o = 0, i, a = (f) => {
1156
- i || (i = !0, s && s(f));
1157
- };
1158
- return new ReadableStream({
1159
- async pull(f) {
1160
- try {
1161
- const { done: c, value: u } = await n.next();
1162
- if (c) {
1163
- a(), f.close();
1164
- return;
1165
- }
1166
- let h = u.byteLength;
1167
- if (r) {
1168
- let x = o += h;
1169
- r(x);
1170
- }
1171
- f.enqueue(new Uint8Array(u));
1172
- } catch (c) {
1173
- throw a(c), c;
1174
- }
1175
- },
1176
- cancel(f) {
1177
- return a(f), n.return();
1178
- }
1179
- }, {
1180
- highWaterMark: 2
1181
- });
1182
- }, fe = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", xt = fe && typeof ReadableStream == "function", Zr = fe && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), _t = (e, ...t) => {
1183
- try {
1184
- return !!e(...t);
1185
- } catch {
1186
- return !1;
1187
- }
1188
- }, Yr = xt && _t(() => {
1189
- let e = !1;
1190
- const t = new Request($.origin, {
1191
- body: new ReadableStream(),
1192
- method: "POST",
1193
- get duplex() {
1194
- return e = !0, "half";
1195
- }
1196
- }).headers.has("Content-Type");
1197
- return e && !t;
1198
- }), Je = 64 * 1024, De = xt && _t(() => l.isReadableStream(new Response("").body)), ie = {
1199
- stream: De && ((e) => e.body)
1200
- };
1201
- fe && ((e) => {
1202
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
1203
- !ie[t] && (ie[t] = l.isFunction(e[t]) ? (r) => r[t]() : (r, s) => {
1204
- throw new D(`Response type '${t}' is not supported`, D.ERR_NOT_SUPPORT, s);
1205
- });
1206
- });
1207
- })(new Response());
1208
- const es = async (e) => {
1209
- if (e == null)
1210
- return 0;
1211
- if (l.isBlob(e))
1212
- return e.size;
1213
- if (l.isSpecCompliantForm(e))
1214
- return (await new Request($.origin, {
1215
- method: "POST",
1216
- body: e
1217
- }).arrayBuffer()).byteLength;
1218
- if (l.isArrayBufferView(e) || l.isArrayBuffer(e))
1219
- return e.byteLength;
1220
- if (l.isURLSearchParams(e) && (e = e + ""), l.isString(e))
1221
- return (await Zr(e)).byteLength;
1222
- }, ts = async (e, t) => {
1223
- const r = l.toFiniteNumber(e.getContentLength());
1224
- return r ?? es(t);
1225
- }, rs = fe && (async (e) => {
1226
- let {
1227
- url: t,
1228
- method: r,
1229
- data: s,
1230
- signal: n,
1231
- cancelToken: o,
1232
- timeout: i,
1233
- onDownloadProgress: a,
1234
- onUploadProgress: f,
1235
- responseType: c,
1236
- headers: u,
1237
- withCredentials: h = "same-origin",
1238
- fetchOptions: x
1239
- } = yt(e);
1240
- c = c ? (c + "").toLowerCase() : "text";
1241
- let g = Kr([n, o && o.toAbortSignal()], i), d;
1242
- const p = g && g.unsubscribe && (() => {
1243
- g.unsubscribe();
1244
- });
1245
- let b;
1246
- try {
1247
- if (f && Yr && r !== "get" && r !== "head" && (b = await ts(u, s)) !== 0) {
1248
- let C = new Request(t, {
1249
- method: "POST",
1250
- body: s,
1251
- duplex: "half"
1252
- }), V;
1253
- if (l.isFormData(s) && (V = C.headers.get("content-type")) && u.setContentType(V), C.body) {
1254
- const [q, re] = Me(
1255
- b,
1256
- oe(qe(f))
1257
- );
1258
- s = We(C.body, Je, q, re);
1259
- }
1260
- }
1261
- l.isString(h) || (h = h ? "include" : "omit");
1262
- const v = "credentials" in Request.prototype;
1263
- d = new Request(t, {
1264
- ...x,
1265
- signal: g,
1266
- method: r.toUpperCase(),
1267
- headers: u.normalize().toJSON(),
1268
- body: s,
1269
- duplex: "half",
1270
- credentials: v ? h : void 0
1271
- });
1272
- let S = await fetch(d);
1273
- const w = De && (c === "stream" || c === "response");
1274
- if (De && (a || w && p)) {
1275
- const C = {};
1276
- ["status", "statusText", "headers"].forEach((Ae) => {
1277
- C[Ae] = S[Ae];
1278
- });
1279
- const V = l.toFiniteNumber(S.headers.get("content-length")), [q, re] = a && Me(
1280
- V,
1281
- oe(qe(a), !0)
1282
- ) || [];
1283
- S = new Response(
1284
- We(S.body, Je, q, () => {
1285
- re && re(), p && p();
1286
- }),
1287
- C
1288
- );
1289
- }
1290
- c = c || "text";
1291
- let P = await ie[l.findKey(ie, c) || "text"](S, e);
1292
- return !w && p && p(), await new Promise((C, V) => {
1293
- bt(C, V, {
1294
- data: P,
1295
- headers: N.from(S.headers),
1296
- status: S.status,
1297
- statusText: S.statusText,
1298
- config: e,
1299
- request: d
1300
- });
1301
- });
1302
- } catch (v) {
1303
- throw p && p(), v && v.name === "TypeError" && /fetch/i.test(v.message) ? Object.assign(
1304
- new D("Network Error", D.ERR_NETWORK, e, d),
1305
- {
1306
- cause: v.cause || v
1307
- }
1308
- ) : D.from(v, v && v.code, e, d);
1309
- }
1310
- }), Se = {
1311
- http: br,
1312
- xhr: Jr,
1313
- fetch: rs
1314
- };
1315
- l.forEach(Se, (e, t) => {
1316
- if (e) {
1317
- try {
1318
- Object.defineProperty(e, "name", { value: t });
1319
- } catch {
1320
- }
1321
- Object.defineProperty(e, "adapterName", { value: t });
1322
- }
1323
- });
1324
- const Ke = (e) => `- ${e}`, ss = (e) => l.isFunction(e) || e === null || e === !1, Dt = {
1325
- getAdapter: (e) => {
1326
- e = l.isArray(e) ? e : [e];
1327
- const { length: t } = e;
1328
- let r, s;
1329
- const n = {};
1330
- for (let o = 0; o < t; o++) {
1331
- r = e[o];
1332
- let i;
1333
- if (s = r, !ss(r) && (s = Se[(i = String(r)).toLowerCase()], s === void 0))
1334
- throw new D(`Unknown adapter '${i}'`);
1335
- if (s)
1336
- break;
1337
- n[i || "#" + o] = s;
1338
- }
1339
- if (!s) {
1340
- const o = Object.entries(n).map(
1341
- ([a, f]) => `adapter ${a} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
1342
- );
1343
- let i = t ? o.length > 1 ? `since :
1344
- ` + o.map(Ke).join(`
1345
- `) : " " + Ke(o[0]) : "as no adapter specified";
1346
- throw new D(
1347
- "There is no suitable adapter to dispatch the request " + i,
1348
- "ERR_NOT_SUPPORT"
1349
- );
1350
- }
1351
- return s;
1352
- },
1353
- adapters: Se
1354
- };
1355
- function be(e) {
1356
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1357
- throw new X(null, e);
1358
- }
1359
- function Ge(e) {
1360
- return be(e), e.headers = N.from(e.headers), e.data = ge.call(
1361
- e,
1362
- e.transformRequest
1363
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Dt.getAdapter(e.adapter || te.adapter)(e).then(function(s) {
1364
- return be(e), s.data = ge.call(
1365
- e,
1366
- e.transformResponse,
1367
- s
1368
- ), s.headers = N.from(s.headers), s;
1369
- }, function(s) {
1370
- return gt(s) || (be(e), s && s.response && (s.response.data = ge.call(
1371
- e,
1372
- e.transformResponse,
1373
- s.response
1374
- ), s.response.headers = N.from(s.response.headers))), Promise.reject(s);
1375
- });
1376
- }
1377
- const St = "1.7.7", Ne = {};
1378
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1379
- Ne[e] = function(s) {
1380
- return typeof s === e || "a" + (t < 1 ? "n " : " ") + e;
1381
- };
1382
- });
1383
- const Xe = {};
1384
- Ne.transitional = function(t, r, s) {
1385
- function n(o, i) {
1386
- return "[Axios v" + St + "] Transitional option '" + o + "'" + i + (s ? ". " + s : "");
1387
- }
1388
- return (o, i, a) => {
1389
- if (t === !1)
1390
- throw new D(
1391
- n(i, " has been removed" + (r ? " in " + r : "")),
1392
- D.ERR_DEPRECATED
1393
- );
1394
- return r && !Xe[i] && (Xe[i] = !0, console.warn(
1395
- n(
1396
- i,
1397
- " has been deprecated since v" + r + " and will be removed in the near future"
1398
- )
1399
- )), t ? t(o, i, a) : !0;
1400
- };
1401
- };
1402
- function ns(e, t, r) {
1403
- if (typeof e != "object")
1404
- throw new D("options must be an object", D.ERR_BAD_OPTION_VALUE);
1405
- const s = Object.keys(e);
1406
- let n = s.length;
1407
- for (; n-- > 0; ) {
1408
- const o = s[n], i = t[o];
1409
- if (i) {
1410
- const a = e[o], f = a === void 0 || i(a, o, e);
1411
- if (f !== !0)
1412
- throw new D("option " + o + " must be " + f, D.ERR_BAD_OPTION_VALUE);
1413
- continue;
1414
- }
1415
- if (r !== !0)
1416
- throw new D("Unknown option " + o, D.ERR_BAD_OPTION);
1417
- }
1418
- }
1419
- const ve = {
1420
- assertOptions: ns,
1421
- validators: Ne
1422
- }, z = ve.validators;
1423
- class W {
1424
- constructor(t) {
1425
- this.defaults = t, this.interceptors = {
1426
- request: new Ve(),
1427
- response: new Ve()
1428
- };
1429
- }
1430
- /**
1431
- * Dispatch a request
1432
- *
1433
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1434
- * @param {?Object} config
1435
- *
1436
- * @returns {Promise} The Promise to be fulfilled
1437
- */
1438
- async request(t, r) {
1439
- try {
1440
- return await this._request(t, r);
1441
- } catch (s) {
1442
- if (s instanceof Error) {
1443
- let n;
1444
- Error.captureStackTrace ? Error.captureStackTrace(n = {}) : n = new Error();
1445
- const o = n.stack ? n.stack.replace(/^.+\n/, "") : "";
1446
- try {
1447
- s.stack ? o && !String(s.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (s.stack += `
1448
- ` + o) : s.stack = o;
1449
- } catch {
1450
- }
1451
- }
1452
- throw s;
1453
- }
1454
- }
1455
- _request(t, r) {
1456
- typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r = K(this.defaults, r);
1457
- const { transitional: s, paramsSerializer: n, headers: o } = r;
1458
- s !== void 0 && ve.assertOptions(s, {
1459
- silentJSONParsing: z.transitional(z.boolean),
1460
- forcedJSONParsing: z.transitional(z.boolean),
1461
- clarifyTimeoutError: z.transitional(z.boolean)
1462
- }, !1), n != null && (l.isFunction(n) ? r.paramsSerializer = {
1463
- serialize: n
1464
- } : ve.assertOptions(n, {
1465
- encode: z.function,
1466
- serialize: z.function
1467
- }, !0)), r.method = (r.method || this.defaults.method || "get").toLowerCase();
1468
- let i = o && l.merge(
1469
- o.common,
1470
- o[r.method]
1471
- );
1472
- o && l.forEach(
1473
- ["delete", "get", "head", "post", "put", "patch", "common"],
1474
- (d) => {
1475
- delete o[d];
1476
- }
1477
- ), r.headers = N.concat(i, o);
1478
- const a = [];
1479
- let f = !0;
1480
- this.interceptors.request.forEach(function(p) {
1481
- typeof p.runWhen == "function" && p.runWhen(r) === !1 || (f = f && p.synchronous, a.unshift(p.fulfilled, p.rejected));
1482
- });
1483
- const c = [];
1484
- this.interceptors.response.forEach(function(p) {
1485
- c.push(p.fulfilled, p.rejected);
1486
- });
1487
- let u, h = 0, x;
1488
- if (!f) {
1489
- const d = [Ge.bind(this), void 0];
1490
- for (d.unshift.apply(d, a), d.push.apply(d, c), x = d.length, u = Promise.resolve(r); h < x; )
1491
- u = u.then(d[h++], d[h++]);
1492
- return u;
1493
- }
1494
- x = a.length;
1495
- let g = r;
1496
- for (h = 0; h < x; ) {
1497
- const d = a[h++], p = a[h++];
1498
- try {
1499
- g = d(g);
1500
- } catch (b) {
1501
- p.call(this, b);
1502
- break;
1503
- }
1504
- }
1505
- try {
1506
- u = Ge.call(this, g);
1507
- } catch (d) {
1508
- return Promise.reject(d);
1509
- }
1510
- for (h = 0, x = c.length; h < x; )
1511
- u = u.then(c[h++], c[h++]);
1512
- return u;
1513
- }
1514
- getUri(t) {
1515
- t = K(this.defaults, t);
1516
- const r = wt(t.baseURL, t.url);
1517
- return ht(r, t.params, t.paramsSerializer);
1518
- }
1519
- }
1520
- l.forEach(["delete", "get", "head", "options"], function(t) {
1521
- W.prototype[t] = function(r, s) {
1522
- return this.request(K(s || {}, {
1523
- method: t,
1524
- url: r,
1525
- data: (s || {}).data
1526
- }));
1527
- };
1528
- });
1529
- l.forEach(["post", "put", "patch"], function(t) {
1530
- function r(s) {
1531
- return function(o, i, a) {
1532
- return this.request(K(a || {}, {
1533
- method: t,
1534
- headers: s ? {
1535
- "Content-Type": "multipart/form-data"
1536
- } : {},
1537
- url: o,
1538
- data: i
1539
- }));
1540
- };
1541
- }
1542
- W.prototype[t] = r(), W.prototype[t + "Form"] = r(!0);
1543
- });
1544
- class Fe {
1545
- constructor(t) {
1546
- if (typeof t != "function")
1547
- throw new TypeError("executor must be a function.");
1548
- let r;
1549
- this.promise = new Promise(function(o) {
1550
- r = o;
1551
- });
1552
- const s = this;
1553
- this.promise.then((n) => {
1554
- if (!s._listeners) return;
1555
- let o = s._listeners.length;
1556
- for (; o-- > 0; )
1557
- s._listeners[o](n);
1558
- s._listeners = null;
1559
- }), this.promise.then = (n) => {
1560
- let o;
1561
- const i = new Promise((a) => {
1562
- s.subscribe(a), o = a;
1563
- }).then(n);
1564
- return i.cancel = function() {
1565
- s.unsubscribe(o);
1566
- }, i;
1567
- }, t(function(o, i, a) {
1568
- s.reason || (s.reason = new X(o, i, a), r(s.reason));
1569
- });
1570
- }
1571
- /**
1572
- * Throws a `CanceledError` if cancellation has been requested.
1573
- */
1574
- throwIfRequested() {
1575
- if (this.reason)
1576
- throw this.reason;
1577
- }
1578
- /**
1579
- * Subscribe to the cancel signal
1580
- */
1581
- subscribe(t) {
1582
- if (this.reason) {
1583
- t(this.reason);
1584
- return;
1585
- }
1586
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
1587
- }
1588
- /**
1589
- * Unsubscribe from the cancel signal
1590
- */
1591
- unsubscribe(t) {
1592
- if (!this._listeners)
1593
- return;
1594
- const r = this._listeners.indexOf(t);
1595
- r !== -1 && this._listeners.splice(r, 1);
1596
- }
1597
- toAbortSignal() {
1598
- const t = new AbortController(), r = (s) => {
1599
- t.abort(s);
1600
- };
1601
- return this.subscribe(r), t.signal.unsubscribe = () => this.unsubscribe(r), t.signal;
1602
- }
1603
- /**
1604
- * Returns an object that contains a new `CancelToken` and a function that, when called,
1605
- * cancels the `CancelToken`.
1606
- */
1607
- static source() {
1608
- let t;
1609
- return {
1610
- token: new Fe(function(n) {
1611
- t = n;
1612
- }),
1613
- cancel: t
1614
- };
1615
- }
1616
- }
1617
- function os(e) {
1618
- return function(r) {
1619
- return e.apply(null, r);
1620
- };
1621
- }
1622
- function is(e) {
1623
- return l.isObject(e) && e.isAxiosError === !0;
1624
- }
1625
- const ke = {
1626
- Continue: 100,
1627
- SwitchingProtocols: 101,
1628
- Processing: 102,
1629
- EarlyHints: 103,
1630
- Ok: 200,
1631
- Created: 201,
1632
- Accepted: 202,
1633
- NonAuthoritativeInformation: 203,
1634
- NoContent: 204,
1635
- ResetContent: 205,
1636
- PartialContent: 206,
1637
- MultiStatus: 207,
1638
- AlreadyReported: 208,
1639
- ImUsed: 226,
1640
- MultipleChoices: 300,
1641
- MovedPermanently: 301,
1642
- Found: 302,
1643
- SeeOther: 303,
1644
- NotModified: 304,
1645
- UseProxy: 305,
1646
- Unused: 306,
1647
- TemporaryRedirect: 307,
1648
- PermanentRedirect: 308,
1649
- BadRequest: 400,
1650
- Unauthorized: 401,
1651
- PaymentRequired: 402,
1652
- Forbidden: 403,
1653
- NotFound: 404,
1654
- MethodNotAllowed: 405,
1655
- NotAcceptable: 406,
1656
- ProxyAuthenticationRequired: 407,
1657
- RequestTimeout: 408,
1658
- Conflict: 409,
1659
- Gone: 410,
1660
- LengthRequired: 411,
1661
- PreconditionFailed: 412,
1662
- PayloadTooLarge: 413,
1663
- UriTooLong: 414,
1664
- UnsupportedMediaType: 415,
1665
- RangeNotSatisfiable: 416,
1666
- ExpectationFailed: 417,
1667
- ImATeapot: 418,
1668
- MisdirectedRequest: 421,
1669
- UnprocessableEntity: 422,
1670
- Locked: 423,
1671
- FailedDependency: 424,
1672
- TooEarly: 425,
1673
- UpgradeRequired: 426,
1674
- PreconditionRequired: 428,
1675
- TooManyRequests: 429,
1676
- RequestHeaderFieldsTooLarge: 431,
1677
- UnavailableForLegalReasons: 451,
1678
- InternalServerError: 500,
1679
- NotImplemented: 501,
1680
- BadGateway: 502,
1681
- ServiceUnavailable: 503,
1682
- GatewayTimeout: 504,
1683
- HttpVersionNotSupported: 505,
1684
- VariantAlsoNegotiates: 506,
1685
- InsufficientStorage: 507,
1686
- LoopDetected: 508,
1687
- NotExtended: 510,
1688
- NetworkAuthenticationRequired: 511
1689
- };
1690
- Object.entries(ke).forEach(([e, t]) => {
1691
- ke[t] = e;
1692
- });
1693
- function vt(e) {
1694
- const t = new W(e), r = tt(W.prototype.request, t);
1695
- return l.extend(r, W.prototype, t, { allOwnKeys: !0 }), l.extend(r, t, null, { allOwnKeys: !0 }), r.create = function(n) {
1696
- return vt(K(e, n));
1697
- }, r;
1698
- }
1699
- const k = vt(te);
1700
- k.Axios = W;
1701
- k.CanceledError = X;
1702
- k.CancelToken = Fe;
1703
- k.isCancel = gt;
1704
- k.VERSION = St;
1705
- k.toFormData = de;
1706
- k.AxiosError = D;
1707
- k.Cancel = k.CanceledError;
1708
- k.all = function(t) {
1709
- return Promise.all(t);
1710
- };
1711
- k.spread = os;
1712
- k.isAxiosError = is;
1713
- k.mergeConfig = K;
1714
- k.AxiosHeaders = N;
1715
- k.formToJSON = (e) => mt(l.isHTMLForm(e) ? new FormData(e) : e);
1716
- k.getAdapter = Dt.getAdapter;
1717
- k.HttpStatusCode = ke;
1718
- k.default = k;
1719
- class as {
1720
- static getTooltipOptions(t = !0) {
1721
- return {
1722
- show: t,
1723
- axisPointer: {
1724
- type: "cross",
1725
- label: {
1726
- backgroundColor: "#6a7985"
1727
- }
1728
- }
1729
- };
1730
- }
1731
- }
1732
- class ae {
1733
- static getLabelOptions(t = {}) {
1734
- return {
1735
- show: (t == null ? void 0 : t.show_label) || (t == null ? void 0 : t.show) || !1,
1736
- fontSize: "10",
1737
- position: (t == null ? void 0 : t.position) || "inside",
1738
- formatter: (t == null ? void 0 : t.formatter) || "{d}%",
1739
- ...t
1740
- };
1741
- }
1742
- static getLegendOpions(t = {}) {
1743
- return {
1744
- ...t,
1745
- position: (t == null ? void 0 : t.position) || "bottom"
1746
- };
1747
- }
1748
- }
1749
- const ls = {
1750
- show_label: !1,
1751
- show_legend: !1,
1752
- label: null,
1753
- legend: { position: null },
1754
- colors: null,
1755
- color: null,
1756
- title: null
1757
- };
1758
- function cs() {
1759
- const e = "0123456789ABCDEF";
1760
- let t = "#";
1761
- for (let r = 0; r < 6; r += 1)
1762
- t += e[Math.floor(Math.random() * 16)];
1763
- return t;
1764
- }
1765
- function Y(e = ls) {
1766
- var r;
1767
- const t = {
1768
- label: {
1769
- show: e == null ? void 0 : e.show_label,
1770
- formatter: (e == null ? void 0 : e.formatter) || ((s) => j(s)),
1771
- ...(e == null ? void 0 : e.label) || {}
1772
- },
1773
- legend: {
1774
- ...(e == null ? void 0 : e.legend) || {},
1775
- [((r = e == null ? void 0 : e.legend) == null ? void 0 : r.position) || "bottom"]: "0",
1776
- show: (e == null ? void 0 : e.show_legend) || !1
1777
- },
1778
- barWidth: "70%",
1779
- grid: {
1780
- borderColor: "#e5e7eb"
1781
- },
1782
- title: { ...(e == null ? void 0 : e.title) || {} }
1783
- };
1784
- return (e != null && e.colors || e != null && e.color) && (t.color = (e == null ? void 0 : e.colors) || (e == null ? void 0 : e.color) || null), t;
1785
- }
1786
- function Qe(e) {
1787
- return {
1788
- color: "#9ca3af",
1789
- fontSize: 10,
1790
- fontFamily: "Inter, ui-sans-serif, system-ui",
1791
- fontWeight: 400,
1792
- label: e == null ? void 0 : e.label,
1793
- show: !0,
1794
- formatter: (e == null ? void 0 : e.formatter) || ((r) => j(r)),
1795
- margin: (e == null ? void 0 : e.margin) || 7,
1796
- interval: (e == null ? void 0 : e.interval) || "auto",
1797
- rotate: (e == null ? void 0 : e.rotate) || 0
1798
- };
1799
- }
1800
- const Ze = [
1801
- "#d3c7e6",
1802
- "#bedae3",
1803
- "#f8e9cb",
1804
- "#ff8c8c",
1805
- "#c5d8be",
1806
- "#ffc6c6",
1807
- "#ffc39a",
1808
- "#fff7c5",
1809
- "#d8ffc0",
1810
- "#d4f7ff"
1811
- ], M = {
1812
- props: [
1813
- "source",
1814
- "style",
1815
- "widget",
1816
- "dashboard",
1817
- "title",
1818
- "currentWidget",
1819
- "widgetData",
1820
- "prefix"
1821
- ],
1822
- data() {
1823
- return {
1824
- sourceData: null,
1825
- styleData: null,
1826
- widgetName: "",
1827
- dimensions: [],
1828
- dashboardName: "",
1829
- titleCharts: "",
1830
- widgetInstance: null
1831
- };
1832
- },
1833
- mounted() {
1834
- window.addEventListener("resize", this.handleResize), window.addEventListener(`update-data-${this.widget}`, this.checkCustomEvent), window.addEventListener(`update-style-${this.widget}`, this.checkCustomStyleEvent);
1835
- },
1836
- unmounted() {
1837
- window.removeEventListener(`update-data-${this.widget}`, this.checkCustomEvent), window.removeEventListener(`update-style-${this.widget}`, this.checkCustomStyleEvent);
1838
- },
1839
- watch: {
1840
- sourceData: {
1841
- async handler() {
1842
- setTimeout(() => {
1843
- this == null || this.onChangedData();
1844
- }, 0);
1845
- }
1846
- }
1847
- },
1848
- methods: {
1849
- checkCustomStyleEvent(e) {
1850
- this.changeOptionsByName(e.chartId, e.options);
1851
- },
1852
- checkCustomEvent({ filterUrl: e }) {
1853
- this.getDataFromURL(e);
1854
- },
1855
- handleResize() {
1856
- this.widgetInstance && this.widgetInstance.resize();
1857
- },
1858
- async getDataFromURL(e) {
1859
- var t, r, s, n;
1860
- try {
1861
- const o = await k.get(e);
1862
- this.sourceData = ((t = o.data) == null ? void 0 : t.source) || [], this.$emit("update:widgetData", o.data), this.dimensions = Object.keys(((r = this.sourceData) == null ? void 0 : r[0]) || {}), this.titleCharts = this.style ? this.style : ((s = o.data) == null ? void 0 : s.title) || "", this.styleData = ((n = o.data) == null ? void 0 : n.style) || {};
1863
- } catch (o) {
1864
- const i = { message: "Дані не знайдено", title: "Помилка!", type: "error", status: 400, id: this.widgetName };
1865
- (o == null ? void 0 : o.status) == "404" && (i.status = 404, i.message = "Дані не знайдено"), (o == null ? void 0 : o.status) == "400" && (i.message = "Перевірте налаштування або зверніться до адміністратора"), (o == null ? void 0 : o.status) == "500" && (i.message = "Сталася помилка сервера"), this.$emit("update:widgetData", i);
1866
- }
1867
- },
1868
- getValues() {
1869
- return this.sourceData.map((e) => {
1870
- var t;
1871
- return parseFloat(e[(t = this.columns) == null ? void 0 : t[1]]);
1872
- });
1873
- },
1874
- formatDate(e) {
1875
- const t = new Date(e);
1876
- if (isNaN(t)) return e;
1877
- const r = String(t.getDate()).padStart(2, "0"), n = [
1878
- "січня",
1879
- "лютого",
1880
- "березня",
1881
- "квітня",
1882
- "травня",
1883
- "червня",
1884
- "липня",
1885
- "серпня",
1886
- "вересня",
1887
- "жовтня",
1888
- "листопада",
1889
- "грудня"
1890
- ][t.getMonth()], o = t.getFullYear();
1891
- return `${r} ${n} ${o}`;
1892
- },
1893
- async getData() {
1894
- var e;
1895
- try {
1896
- if (this.source)
1897
- this.sourceData = [...this.source], this.styleData = this.style, this.titleCharts = this.title, this.dimensions = Object.keys(((e = this.sourceData) == null ? void 0 : e[0]) || {});
1898
- else {
1899
- this.widgetName = this.widget, this.dashboardName = this.dashboard;
1900
- const t = this.dashboardName ? `${this.prefix || ""}/bi-data?dashboard=${this.dashboardName}&widget=${this.widgetName}` : `${this.prefix || ""}/bi-data?&widget=${this.widgetName}`;
1901
- await this.getDataFromURL(t);
1902
- }
1903
- } catch (t) {
1904
- console.error(t);
1905
- }
1906
- },
1907
- async initChart(e, t, r) {
1908
- var s, n, o, i, a, f, c;
1909
- this.widgetInstance && this.widgetInstance.clear();
1910
- try {
1911
- const u = this.$refs.chart, h = echarts == null ? void 0 : echarts.init(u), x = {
1912
- tooltip: {
1913
- trigger: "axis",
1914
- axisPointer: { type: "shadow" },
1915
- backgroundColor: "transparent",
1916
- shadowColor: "transparent",
1917
- padding: [0, 0, 0, 0],
1918
- borderWidth: 0,
1919
- formatter: (g) => {
1920
- var v;
1921
- const d = (v = g[0]) == null ? void 0 : v.axisValue;
1922
- let b = `
1923
- <div style="background-color: rgba(255, 255, 255, 0.7)" class="border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700 min-w-28">
1924
- <div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 rounded-t-lg dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200 px-2 py-1">
1925
- ${d ? this.formatDate(d) : "N/A"}
1926
- </div>
1927
- `;
1928
- return g.forEach((S) => {
1929
- b += `
1930
- <div class="flex justify-between items-center text-xs px-2 py-0.5 text-gray-500 dark:text-neutral-400">
1931
- <span class="flex items-center">
1932
- <span class="w-2.5 h-2.5 me-1.5 rounded-sm" style="background-color: ${S.color};"></span>
1933
- <span class="font-medium mr-[6px]">${(S == null ? void 0 : S.seriesName) === "metric" ? "Значення" : S == null ? void 0 : S.seriesName}</span>
1934
- </span>
1935
- <span>${this.getMetricValue(S == null ? void 0 : S.data)}</span>
1936
- </div>
1937
- `;
1938
- }), b += "</div>", b;
1939
- }
1940
- },
1941
- xAxis: {
1942
- data: t != null && t.length ? t : null,
1943
- type: t ? "category" : "value",
1944
- name: ((n = (s = this.styleData) == null ? void 0 : s.x_axis) == null ? void 0 : n.name) || "",
1945
- axisLabel: {
1946
- ...Qe((o = this.styleData) == null ? void 0 : o.x_axis),
1947
- formatter: (g) => {
1948
- var p, b;
1949
- const d = this.formatDate(g);
1950
- return ((b = (p = this.styleData) == null ? void 0 : p.x_axis) == null ? void 0 : b.overflow) === "ellipsis" && d.length > 10 ? `${d.slice(0, 10)}...` : d;
1951
- }
1952
- }
1953
- },
1954
- yAxis: {
1955
- data: r != null && r.length ? r : null,
1956
- type: r ? "category" : "value",
1957
- name: ((a = (i = this.styleData) == null ? void 0 : i.y_axis) == null ? void 0 : a.name) || "",
1958
- axisLabel: Qe((f = this.styleData) == null ? void 0 : f.y_axis)
1959
- },
1960
- series: e != null && e.length ? e : null,
1961
- ...Y(this.styleData),
1962
- grid: {
1963
- bottom: "0%",
1964
- right: "0%",
1965
- left: "0%",
1966
- top: "20px",
1967
- containLabel: !0,
1968
- ...((c = this.styleData) == null ? void 0 : c.grid) || {}
1969
- }
1970
- };
1971
- await h.setOption(x), h.resize(), this.widgetInstance = h, this.$emit("update:currentWidget", h);
1972
- } catch (u) {
1973
- console.error(u);
1974
- }
1975
- },
1976
- async setSeriesOption(e, t) {
1977
- const r = e.getOption(), { series: s = [] } = r, n = s.map((o) => ({
1978
- ...o,
1979
- ...t
1980
- }));
1981
- e.setOption({
1982
- ...r,
1983
- series: n
1984
- });
1985
- },
1986
- async changeOptionsByName(e, t) {
1987
- const r = document.getElementById(e);
1988
- if (!r) return null;
1989
- const s = echarts.getInstanceByDom(r);
1990
- if (!s) return null;
1991
- const n = s.getOption();
1992
- t.seriesOptions && this.setSeriesOption(s, t.seriesOptions), s.setOption({
1993
- ...n,
1994
- ...t.options,
1995
- tooltip: {
1996
- ...as.getTooltipOptions(t.options.tooltip.show)
1997
- }
1998
- });
1999
- },
2000
- async changeData(e) {
2001
- var t;
2002
- try {
2003
- let r = this.dashboard ? `${this.prefix || ""}/bi-data?dashboard=${this.dashboard}&widget=${this.widget}` : `${this.prefix || ""}/bi-data?&widget=${this.widget}`;
2004
- (t = e == null ? void 0 : e.granularity) != null && t.length && (r += `&granularity=${e.granularity}`), e != null && e.metrics && (r += `&metrics=${e.metrics}`), this.getDataFromURL(r);
2005
- } catch (r) {
2006
- console.error(r);
2007
- }
2008
- },
2009
- async setFilter(e) {
2010
- const t = `${this.prefix || ""}/bi-data?dashboard=${this.dashboardName}&widget=${this.widgetName}${e || ""}`;
2011
- await this.getDataFromURL(t);
2012
- },
2013
- async changeStyle(e, t) {
2014
- this.styleData[e] = t, this.onChangedData();
2015
- },
2016
- getMetricValue(e) {
2017
- var s;
2018
- const t = (e == null ? void 0 : e.metric) || e;
2019
- return parseFloat(t) ? (s = j(t, { notation: "standard" })) == null ? void 0 : s.replaceAll(
2020
- ",",
2021
- " "
2022
- ) : t;
2023
- }
2024
- }
2025
- }, us = {
2026
- name: "VsBar",
2027
- mixins: [M],
2028
- data() {
2029
- return {
2030
- resizeObserver: null
2031
- };
2032
- },
2033
- computed: {
2034
- uniqueID() {
2035
- return this.widget;
2036
- }
2037
- },
2038
- async mounted() {
2039
- var t;
2040
- this.getData(), this.onChangedData();
2041
- const e = (t = this.$refs) == null ? void 0 : t.chart;
2042
- e && (this.resizeObserver = new ResizeObserver(() => {
2043
- var r;
2044
- this.widgetInstance && ((r = this.widgetInstance) == null || r.resize());
2045
- }), this.resizeObserver.observe(e));
2046
- },
2047
- unmounted() {
2048
- this.resizeObserver.disconnect();
2049
- },
2050
- methods: {
2051
- async onChangedData() {
2052
- try {
2053
- if (this.sourceData) {
2054
- await this.$nextTick();
2055
- const { series: e, xs: t, ys: r } = this.prepareData();
2056
- e && (this == null || this.initChart(e, t, r));
2057
- }
2058
- } catch (e) {
2059
- console.error(e);
2060
- }
2061
- },
2062
- prepareData() {
2063
- var e, t, r, s, n, o;
2064
- try {
2065
- if (!((e = this.sourceData) != null && e.length))
2066
- return { series: [], xs: [], ys: void 0 };
2067
- const i = Array.from(
2068
- new Set(
2069
- this.sourceData.filter((x) => x[this.dimensions[0]]).map((x) => x[this.dimensions[0]])
2070
- )
2071
- );
2072
- let a;
2073
- this.dimensions[0].includes("date") ? a = i.map((x) => Re(x)) : a = [...i];
2074
- let f, c;
2075
- ((t = this.styleData) == null ? void 0 : t.horizontal) === !0 ? c = [...a] : f = [...a];
2076
- const u = this.sourceData.filter(
2077
- (x) => parseFloat(x[this.dimensions[1]]) && x[this.dimensions[0]]
2078
- ).map((x) => parseFloat(x[this.dimensions[1]]));
2079
- let h;
2080
- return ((r = this.styleData) == null ? void 0 : r.stack) !== !1 ? h = this.prepareStackData() : ((s = this.styleData) == null ? void 0 : s.negative_waterfall) === !0 ? h = this.prepareNegativeWaterfall() : ((n = this.styleData) == null ? void 0 : n.waterfall) === !0 ? h = this.prepareWaterfallData(u) : ((o = this.styleData) == null ? void 0 : o.accumulative) === !0 ? h = this.prepareAccumulative(u) : h = this.dimensions.slice(1).map((g, d) => ({
2081
- name: g,
2082
- type: "bar",
2083
- stack: `a${d}`,
2084
- data: this.sourceData.filter((p) => parseFloat(p[g]) && g).map((p) => parseFloat(p[g]))
2085
- })), { series: h, xs: f, ys: c };
2086
- } catch (i) {
2087
- return console.error(i), { series: [], xs: [], ys: [] };
2088
- }
2089
- },
2090
- prepareWaterfallData(e) {
2091
- let t = e.reduce((o, i) => o + i, 0);
2092
- const r = [t, ...e], s = r.map((o, i) => {
2093
- if (i === 0) return 0;
2094
- const a = t - o;
2095
- return t -= o, a >= 0 ? a : 0;
2096
- });
2097
- return [
2098
- {
2099
- type: "bar",
2100
- stack: "Total",
2101
- itemStyle: {
2102
- borderColor: "transparent",
2103
- color: "transparent"
2104
- },
2105
- data: s,
2106
- tooltip: {
2107
- show: !1
2108
- }
2109
- },
2110
- {
2111
- name: this.title ? this.title : this.dimensions[0],
2112
- type: "bar",
2113
- stack: "Total",
2114
- data: r
2115
- }
2116
- ];
2117
- },
2118
- prepareStackData() {
2119
- return this.dimensions.slice(1).map((r) => ({
2120
- name: r,
2121
- type: "bar",
2122
- stack: "a",
2123
- data: this.sourceData.filter((s) => parseFloat(s[r]) && r).map((s) => parseFloat(s[r]))
2124
- }));
2125
- },
2126
- prepareNegativeWaterfall() {
2127
- const e = this.sourceData.map(
2128
- (o) => Number.isNaN(o[this.dimensions[1]]) ? 0 : Number(o[this.dimensions[1]])
2129
- ), t = this.sourceData.map(
2130
- (o) => Number.isNaN(o[this.dimensions[2]]) ? 0 : Number(o[this.dimensions[2]])
2131
- );
2132
- let r = 0;
2133
- const s = e.map((o, i) => {
2134
- const a = r;
2135
- return r += Number.isNaN(o) ? 0 : o, i === 0 && (r -= Number.isNaN(t[i]) ? 0 : t[i]), r -= Number.isNaN(t[i + 1]) ? 0 : t[i + 1], a >= 0 ? a : 0;
2136
- });
2137
- return [
2138
- {
2139
- type: "bar",
2140
- stack: "a",
2141
- itemStyle: {
2142
- borderColor: "transparent",
2143
- color: "transparent"
2144
- },
2145
- data: s,
2146
- tooltip: {
2147
- show: !1
2148
- }
2149
- },
2150
- {
2151
- name: this.dimensions[1],
2152
- type: "bar",
2153
- stack: "a",
2154
- data: e
2155
- },
2156
- {
2157
- name: this.dimensions[2],
2158
- type: "bar",
2159
- stack: "a",
2160
- data: t
2161
- }
2162
- ];
2163
- },
2164
- prepareAccumulative(e) {
2165
- let t = 0;
2166
- const r = e.map((n) => (t += n, t));
2167
- return [
2168
- {
2169
- name: this.titleCharts,
2170
- type: "bar",
2171
- stack: "Total",
2172
- data: r
2173
- }
2174
- ];
2175
- }
2176
- }
2177
- }, R = (e, t) => {
2178
- const r = e.__vccOpts || e;
2179
- for (const [s, n] of t)
2180
- r[s] = n;
2181
- return r;
2182
- }, ds = ["id"];
2183
- function fs(e, t, r, s, n, o) {
2184
- return y(), _("div", {
2185
- id: o.uniqueID,
2186
- ref: "chart",
2187
- class: "h-full w-full min-h-[200px]"
2188
- }, null, 8, ds);
2189
- }
2190
- const hs = /* @__PURE__ */ R(us, [["render", fs]]), ps = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2191
- __proto__: null,
2192
- default: hs
2193
- }, Symbol.toStringTag, { value: "Module" })), ms = {
2194
- name: "VsPie",
2195
- props: ["currentWidget"],
2196
- mixins: [M],
2197
- data() {
2198
- return {
2199
- chartInstance: null,
2200
- // Unused variable – оставлен для потенциального будущего использования
2201
- resizeObserver: null
2202
- };
2203
- },
2204
- computed: {
2205
- // Генерируем уникальный ID на основе свойства widget из миксина
2206
- uniqueID() {
2207
- return this.widget;
2208
- }
2209
- },
2210
- async mounted() {
2211
- var r;
2212
- await this.$nextTick(), await this.getData();
2213
- const { series: e } = this.prepareData() || {};
2214
- e && this.initChart(e);
2215
- const t = (r = this.$refs) == null ? void 0 : r.chart;
2216
- t && (this.resizeObserver = new ResizeObserver(() => {
2217
- this.chartInstance && this.chartInstance.resize();
2218
- }), this.resizeObserver.observe(t));
2219
- },
2220
- beforeUnmount() {
2221
- var e;
2222
- (e = this.resizeObserver) == null || e.disconnect();
2223
- },
2224
- methods: {
2225
- // Не используется, оставлен для потенциального будущего применения
2226
- onChangedData() {
2227
- try {
2228
- if (this.sourceData) {
2229
- const { series: e, xs: t, ys: r } = this.prepareData();
2230
- e && this.initChart(e, t, r);
2231
- }
2232
- } catch (e) {
2233
- console.error(e);
2234
- }
2235
- },
2236
- buildTooltipForDonut(e, t) {
2237
- const { name: r, value: s, percent: n } = e;
2238
- return `
2239
- <div style="background-color:${t[0]}; font-size:12px; font-family:Helvetica, Arial, sans-serif; color:#ffff; padding:5px; border-radius:5px;">
2240
- ${r == null ? void 0 : r.replace("null", "Не визначено")}: ${j(s)} (${n}%)
2241
- </div>`;
2242
- },
2243
- prepareData() {
2244
- var e, t, r, s, n, o;
2245
- try {
2246
- if (this.styleData = this.styleData || {}, !((e = this.sourceData) != null && e.length))
2247
- return console.warn("No source data available"), null;
2248
- const i = Array.from(
2249
- new Set(
2250
- (this.sourceData || []).map((d) => d[this.dimensions[0]])
2251
- )
2252
- ), a = Array.from(
2253
- new Set(
2254
- (this.sourceData || []).map((d) => d[this.dimensions[1]])
2255
- )
2256
- ), f = parseInt(
2257
- (this.sourceData || []).reduce(
2258
- (d, p) => d + parseFloat((p == null ? void 0 : p.metric) || 0),
2259
- 0
2260
- ),
2261
- 10
2262
- ), c = i.map((d, p) => {
2263
- const b = (a[p] / f * 100).toFixed(2);
2264
- return {
2265
- name: `${d} (${b}%)`,
2266
- value: a[p]
2267
- };
2268
- }), u = ((t = this.styleData) == null ? void 0 : t.innerRadius) || "80%", h = ((r = this.styleData) == null ? void 0 : r.outerRadius) || "100%", x = [u, h];
2269
- return this.styleData.legend = ae.getLegendOpions({
2270
- borderRadius: 10,
2271
- height: "100%",
2272
- padding: 10,
2273
- bottom: "0",
2274
- type: "scroll",
2275
- itemWidth: 14,
2276
- itemHeight: 14,
2277
- formatter: (d) => {
2278
- var p;
2279
- return (p = d == null ? void 0 : d.replace("null", "Не визначено")) == null ? void 0 : p.replace("NaN", "0.00");
2280
- },
2281
- ...((s = this.styleData) == null ? void 0 : s.legend) || {}
2282
- }), this.styleData.label = ae.getLabelOptions(
2283
- (n = this.styleData) == null ? void 0 : n.label
2284
- ), this.styleData.show_legend = ((o = this.styleData) == null ? void 0 : o.show_legend) ?? !0, { series: [
2285
- {
2286
- name: this.titleCharts ? this.titleCharts : this.dimensions[0],
2287
- type: "pie",
2288
- radius: x,
2289
- center: ["50%", "60%"],
2290
- height: "75%",
2291
- ...Y(this.styleData),
2292
- data: c
2293
- }
2294
- ] };
2295
- } catch (i) {
2296
- return console.error("Error in prepareData:", i), null;
2297
- }
2298
- },
2299
- async initChart(e) {
2300
- try {
2301
- if (!e) {
2302
- console.warn("No series data available for chart initialization");
2303
- return;
2304
- }
2305
- const t = this.$refs.chart;
2306
- if (!t) {
2307
- console.warn("Chart DOM element not found");
2308
- return;
2309
- }
2310
- this.chartInstance = echarts.init(t);
2311
- const r = parseInt(
2312
- (this.sourceData || []).reduce(
2313
- (n, o) => n + parseFloat((o == null ? void 0 : o.metric) || 0),
2314
- 0
2315
- ),
2316
- 10
2317
- ), s = {
2318
- tooltip: {
2319
- trigger: "item",
2320
- formatter: (n) => this.buildTooltipForDonut(n, [n.color]),
2321
- borderWidth: 0,
2322
- appendToBody: !0,
2323
- borderColor: "transparent",
2324
- textStyle: { color: "#000" },
2325
- padding: [15, 15],
2326
- shadowColor: "transparent",
2327
- backgroundColor: "transparent"
2328
- },
2329
- series: e,
2330
- ...Y(this.styleData || {}),
2331
- title: {
2332
- text: j(r),
2333
- left: "center",
2334
- top: "41%",
2335
- textStyle: {
2336
- color: "black",
2337
- fontWeight: 400,
2338
- fontSize: "22px"
2339
- }
2340
- }
2341
- };
2342
- this.chartInstance.setOption(s), this.$emit("update:currentWidget", this.chartInstance), this.chartInstance.resize(), window.addEventListener("resize", () => {
2343
- var n;
2344
- (n = this.chartInstance) == null || n.resize();
2345
- });
2346
- } catch (t) {
2347
- console.error("Error in initChart:", t);
2348
- }
2349
- }
2350
- }
2351
- }, gs = ["id"];
2352
- function bs(e, t, r, s, n, o) {
2353
- return y(), _("div", {
2354
- id: o.uniqueID,
2355
- ref: "chart",
2356
- class: "h-full min-h-[200px] flex items-center"
2357
- }, null, 8, gs);
2358
- }
2359
- const ws = /* @__PURE__ */ R(ms, [["render", bs]]), ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2360
- __proto__: null,
2361
- default: ws
2362
- }, Symbol.toStringTag, { value: "Module" })), xs = {
2363
- name: "VsPie",
2364
- props: ["currentWidget"],
2365
- mixins: [M],
2366
- data() {
2367
- return {
2368
- chartInstance: null,
2369
- // Unused переменная, оставлена для возможного будущего использования
2370
- resizeObserver: null
2371
- };
2372
- },
2373
- computed: {
2374
- // Используем computed для генерации уникального ID на основе виджета
2375
- uniqueID() {
2376
- return this.widget;
2377
- }
2378
- },
2379
- async mounted() {
2380
- var r;
2381
- await this.$nextTick(), await this.getData();
2382
- const { series: e } = this.prepareData() || {};
2383
- e && this.initChart(e);
2384
- const t = (r = this.$refs) == null ? void 0 : r.chart;
2385
- t && (this.resizeObserver = new ResizeObserver(() => {
2386
- this.chartInstance && this.chartInstance.resize();
2387
- }), this.resizeObserver.observe(t));
2388
- },
2389
- unmounted() {
2390
- var e;
2391
- (e = this.resizeObserver) == null || e.disconnect();
2392
- },
2393
- methods: {
2394
- // Метод не вызывается в компоненте, но оставлен для возможного будущего использования
2395
- onChangedData() {
2396
- try {
2397
- if (this.sourceData) {
2398
- const { series: e, xs: t, ys: r } = this.prepareData();
2399
- e && this.initChart(e, t, r);
2400
- }
2401
- } catch (e) {
2402
- console.error(e);
2403
- }
2404
- },
2405
- buildTooltipForDonut(e, t) {
2406
- const { name: r, value: s, percent: n } = e;
2407
- return `
2408
- <div style="background-color:${t[0]}; font-size:12px; font-family:Helvetica, Arial, sans-serif; color:#ffff; padding:5px; border-radius:5px;">
2409
- ${r == null ? void 0 : r.replace("null", "Не визначено")}: ${j(s)} (${n}%)
2410
- </div>`;
2411
- },
2412
- prepareData() {
2413
- var e, t, r, s, n;
2414
- try {
2415
- this.styleData = this.styleData || {};
2416
- const o = Array.from(
2417
- new Set(
2418
- (this.sourceData || []).map((g) => g[this.dimensions[0]])
2419
- )
2420
- ), i = Array.from(
2421
- new Set(
2422
- (this.sourceData || []).map((g) => g[this.dimensions[1]])
2423
- )
2424
- ), a = parseInt(
2425
- (this.sourceData || []).reduce(
2426
- (g, d) => g + parseFloat(d == null ? void 0 : d.metric),
2427
- 0
2428
- ),
2429
- 10
2430
- ), f = o.map((g, d) => {
2431
- const p = (i[d] / a * 100).toFixed(2);
2432
- return {
2433
- name: `${g} (${p}%)`,
2434
- value: i[d]
2435
- };
2436
- }), c = ((e = this.styleData) == null ? void 0 : e.innerRadius) || "0%", u = ((t = this.styleData) == null ? void 0 : t.outerRadius) || "100%", h = [c, u];
2437
- return this.styleData.legend = ae.getLegendOpions({
2438
- borderRadius: 10,
2439
- height: "100%",
2440
- padding: 10,
2441
- type: "scroll",
2442
- itemWidth: 14,
2443
- itemHeight: 14,
2444
- formatter: (g) => g == null ? void 0 : g.replace("null", "Не визначено"),
2445
- textStyle: { fontSize: "14px" },
2446
- ...((r = this.styleData) == null ? void 0 : r.legend) || {}
2447
- }), this.styleData.label = ae.getLabelOptions(
2448
- (s = this.styleData) == null ? void 0 : s.label
2449
- ), this.styleData.show_legend = ((n = this.styleData) == null ? void 0 : n.show_legend) ?? !0, { series: [
2450
- {
2451
- name: this.titleCharts ? this.titleCharts : this.dimensions[0],
2452
- type: "pie",
2453
- radius: h,
2454
- center: ["50%", "60%"],
2455
- height: "75%",
2456
- ...Y(this.styleData),
2457
- data: f
2458
- }
2459
- ] };
2460
- } catch (o) {
2461
- return console.error("Error in prepareData:", o), null;
2462
- }
2463
- },
2464
- async initChart(e) {
2465
- try {
2466
- if (!e) {
2467
- console.warn("No series data available for chart initialization");
2468
- return;
2469
- }
2470
- const t = this.$refs.chart;
2471
- if (!t) {
2472
- console.warn("Chart DOM element not found");
2473
- return;
2474
- }
2475
- this.chartInstance = echarts.init(t);
2476
- const r = {
2477
- tooltip: {
2478
- trigger: "item",
2479
- formatter: (s) => this.buildTooltipForDonut(s, [s.color]),
2480
- borderWidth: 0,
2481
- appendToBody: !0,
2482
- borderColor: "transparent",
2483
- textStyle: { color: "#000" },
2484
- padding: [15, 15],
2485
- shadowColor: "transparent",
2486
- backgroundColor: "transparent"
2487
- },
2488
- series: e,
2489
- ...Y(this.styleData || {})
2490
- };
2491
- this.chartInstance.setOption(r), this.$emit("update:currentWidget", this.chartInstance), this.chartInstance.resize(), window.addEventListener("resize", () => {
2492
- var s;
2493
- (s = this.chartInstance) == null || s.resize();
2494
- });
2495
- } catch (t) {
2496
- console.error("Error in initChart:", t);
2497
- }
2498
- }
2499
- }
2500
- }, _s = ["id"];
2501
- function Ds(e, t, r, s, n, o) {
2502
- return y(), _("div", {
2503
- id: o.uniqueID,
2504
- ref: "chart",
2505
- class: "h-full min-h-[200px] flex items-center"
2506
- }, null, 8, _s);
2507
- }
2508
- const Ss = /* @__PURE__ */ R(xs, [["render", Ds]]), vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2509
- __proto__: null,
2510
- default: Ss
2511
- }, Symbol.toStringTag, { value: "Module" })), ks = {
2512
- name: "VsLine",
2513
- mixins: [M],
2514
- data() {
2515
- return {
2516
- chartInstance: null,
2517
- uniqueID: null
2518
- };
2519
- },
2520
- async mounted() {
2521
- this.uniqueID = this.widget, await this.$nextTick(), await this.getData();
2522
- const { series: e, xs: t } = this.prepareData();
2523
- e && this.initChart(e, t);
2524
- },
2525
- methods: {
2526
- onChangedData() {
2527
- try {
2528
- if (this.sourceData) {
2529
- const { series: e, xs: t, ys: r } = this.prepareData();
2530
- e && (this == null || this.initChart(e, t, r));
2531
- }
2532
- } catch (e) {
2533
- console.error(e);
2534
- }
2535
- },
2536
- prepareData() {
2537
- var e, t;
2538
- try {
2539
- const r = Array.from(
2540
- new Set(this.sourceData.map((i) => i[this.dimensions[0]]))
2541
- );
2542
- let s;
2543
- this.dimensions[0].includes("date") ? s = r.map((i) => Re(i)) : s = [...r];
2544
- const n = this.sourceData.map(
2545
- (i) => parseFloat(i[this.dimensions[1]])
2546
- );
2547
- let o;
2548
- return (e = this.styleData) != null && e.stack ? o = this.dimensions.slice(1).map((a) => ({
2549
- name: a,
2550
- type: "line",
2551
- stack: "a",
2552
- areaStyle: this.styleData.area ? {} : null,
2553
- data: this.sourceData.filter((f) => parseFloat(f[a])).map((f) => parseFloat(f[a]))
2554
- })) : o = [
2555
- {
2556
- name: this.title,
2557
- type: "line",
2558
- areaStyle: (t = this.styleData) != null && t.area ? {} : null,
2559
- data: n,
2560
- stack: "a"
2561
- }
2562
- ], { series: o, xs: s };
2563
- } catch (r) {
2564
- return console.error(r), null;
2565
- }
2566
- }
2567
- }
2568
- }, Es = ["id"];
2569
- function Cs(e, t, r, s, n, o) {
2570
- return y(), _("div", {
2571
- id: n.uniqueID,
2572
- ref: "chart",
2573
- style: { height: "400px" }
2574
- }, null, 8, Es);
2575
- }
2576
- const Rs = /* @__PURE__ */ R(ks, [["render", Cs]]), Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2577
- __proto__: null,
2578
- default: Rs
2579
- }, Symbol.toStringTag, { value: "Module" })), Ts = {
2580
- name: "VsStat",
2581
- mixins: [M],
2582
- data() {
2583
- return {
2584
- restDimensions: [],
2585
- sumValue: 0,
2586
- columns: null,
2587
- showTooltip: -1
2588
- };
2589
- },
2590
- async mounted() {
2591
- await this.getData(), this.prepareData();
2592
- },
2593
- methods: {
2594
- onChangedData() {
2595
- try {
2596
- this.sourceData && this.prepareData();
2597
- } catch {
2598
- }
2599
- },
2600
- prepareData() {
2601
- this.columns = Object.keys(this.sourceData[0]);
2602
- const e = this.getValues();
2603
- this.sumValue = e.reduce((t, r) => t + r, 0), this.sourceData.forEach((t, r) => {
2604
- t.color = r < Ze.length - 1 ? Ze[r] : cs();
2605
- });
2606
- },
2607
- formattedValue(e) {
2608
- const t = parseFloat(e);
2609
- return j(t);
2610
- }
2611
- }
2612
- }, $s = { class: "flex flex-col w-full h-full pt-[16px] rounded-xl" }, Ns = { class: "flex flex-col justify-between w-full h-full" }, Fs = { class: "w-full h-full pb-6 space-y-4" }, As = { class: "flex w-full h-3 rounded-full gap-x-1 min-h-3 custom-x-scrollbar" }, Ps = ["onMouseover"], Ls = {
2613
- key: 0,
2614
- class: "absolute top-[-1] left-1/2 transform -translate-x-1/2 -translate-y-full bg-black text-white rounded px-2 py-1"
2615
- }, Bs = { class: "h-[calc(100%-20px)] w-full custom-scrollbar" }, Us = { class: "grid items-center justify-between grid-cols-2 py-2 gap-x-4" }, js = { class: "flex items-center" }, Is = { class: "text-sm text-gray-800" }, Vs = { class: "text-end" }, zs = { class: "text-sm text-gray-500" };
2616
- function Ms(e, t, r, s, n, o) {
2617
- return y(), _("div", $s, [
2618
- m("div", Ns, [
2619
- m("div", Fs, [
2620
- m("div", As, [
2621
- (y(!0), _(F, null, L(e.sourceData, (i, a) => {
2622
- var f, c, u, h;
2623
- return y(), _("div", {
2624
- class: J(["flex flex-col min-w-[5px] justify-center min-h-2.5 h-2.5 text-xs text-white text-center whitespace-nowrap", `bg-[${i.color}]`]),
2625
- style: Ee({
2626
- width: `${parseFloat(i == null ? void 0 : i[(f = n.columns) == null ? void 0 : f[1]]) / n.sumValue * 100}%`
2627
- }),
2628
- role: "progressbar",
2629
- "aria-valuenow": "42",
2630
- "aria-valuemin": "0",
2631
- "aria-valuemax": "100",
2632
- onMouseover: (x) => n.showTooltip = a,
2633
- onMouseleave: t[0] || (t[0] = (x) => n.showTooltip = -1)
2634
- }, [
2635
- n.showTooltip > -1 ? (y(), _("div", Ls, E(e.sourceData[n.showTooltip][n.columns[0]]) + " " + E((parseFloat((h = (c = e.sourceData) == null ? void 0 : c[n.showTooltip]) == null ? void 0 : h[(u = n.columns) == null ? void 0 : u[1]]) / n.sumValue * 100).toFixed(2)) + "% ", 1)) : T("", !0)
2636
- ], 46, Ps);
2637
- }), 256))
2638
- ]),
2639
- m("ul", Bs, [
2640
- (y(!0), _(F, null, L(e.sourceData, (i) => {
2641
- var a, f;
2642
- return y(), _("li", Us, [
2643
- m("div", js, [
2644
- m("span", {
2645
- class: J(["shrink-0 size-2.5 inline-block rounded-sm me-2.5 min-w-[10px] w-[10px] h-[10px] min-h-[10px]", `bg-[${i.color}]`])
2646
- }, null, 2),
2647
- m("span", Is, E((i == null ? void 0 : i[(a = n.columns) == null ? void 0 : a[0]]) || "Не визначено"), 1)
2648
- ]),
2649
- m("div", Vs, [
2650
- m("span", zs, E(o.formattedValue(i == null ? void 0 : i[(f = n.columns) == null ? void 0 : f[1]]) || "-"), 1)
2651
- ])
2652
- ]);
2653
- }), 256))
2654
- ])
2655
- ])
2656
- ])
2657
- ]);
2658
- }
2659
- const qs = /* @__PURE__ */ R(Ts, [["render", Ms]]), Hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2660
- __proto__: null,
2661
- default: qs
2662
- }, Symbol.toStringTag, { value: "Module" })), Ws = {
2663
- name: "VsProgressBar",
2664
- mixins: [M],
2665
- data() {
2666
- return {
2667
- restDimensions: [],
2668
- maxValue: 0,
2669
- columns: null
2670
- };
2671
- },
2672
- async mounted() {
2673
- await this.getData(), this.prepareData();
2674
- },
2675
- methods: {
2676
- onChangedData() {
2677
- try {
2678
- this.sourceData && this.prepareData();
2679
- } catch {
2680
- }
2681
- },
2682
- prepareData() {
2683
- var t;
2684
- this.columns = Object.keys((t = this.sourceData) == null ? void 0 : t[0]) || null;
2685
- const e = this.getValues();
2686
- this.maxValue = Math.max(...e);
2687
- },
2688
- formattedValue(e) {
2689
- return j(e);
2690
- }
2691
- }
2692
- }, Js = {
2693
- key: 0,
2694
- class: "flex flex-col h-full pt-[16px] rounded-xl"
2695
- }, Ks = { class: "h-full pt-0 pb-6 space-y-4" }, Gs = { class: "h-full space-y-4 custom-scrollbar" }, Xs = { class: "flex items-center justify-between mr-2 gap-x-2" }, Qs = { class: "grid items-center w-full grid-cols-2 gap-x-2" }, Zs = { class: "text-sm text-gray-800" }, Ys = {
2696
- class: "flex justify-end",
2697
- role: "progressbar",
2698
- "aria-valuenow": "100",
2699
- "aria-valuemin": "0",
2700
- "aria-valuemax": "100"
2701
- }, en = { class: "min-w-[60px] text-end" }, tn = { class: "text-sm text-gray-500" };
2702
- function rn(e, t, r, s, n, o) {
2703
- return n.columns ? (y(), _("div", Js, [
2704
- m("div", Ks, [
2705
- m("ul", Gs, [
2706
- (y(!0), _(F, null, L(e.sourceData, (i, a) => (y(), _("li", Xs, [
2707
- m("div", Qs, [
2708
- m("span", Zs, E(i[n.columns[0]]), 1),
2709
- m("div", Ys, [
2710
- m("div", {
2711
- class: "h-1.5 flex flex-col justify-center overflow-hidden bg-indigo-500 rounded-full text-xs text-white text-center whitespace-nowrap",
2712
- style: Ee({
2713
- width: `${parseFloat(i[n.columns[1]]) / n.maxValue * 100}%`
2714
- })
2715
- }, null, 4)
2716
- ])
2717
- ]),
2718
- m("div", en, [
2719
- m("span", tn, E(o.formattedValue(i[n.columns[1]])), 1)
2720
- ])
2721
- ]))), 256))
2722
- ])
2723
- ])
2724
- ])) : T("", !0);
2725
- }
2726
- const sn = /* @__PURE__ */ R(Ws, [["render", rn]]), nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2727
- __proto__: null,
2728
- default: sn
2729
- }, Symbol.toStringTag, { value: "Module" })), on = {
2730
- name: "VsListbar",
2731
- mixins: [M],
2732
- props: ["source"],
2733
- data() {
2734
- return {
2735
- restDimensions: [],
2736
- maxValue: 0,
2737
- columns: null
2738
- };
2739
- },
2740
- async mounted() {
2741
- await this.getData(), this.prepareData();
2742
- },
2743
- methods: {
2744
- onChangedData() {
2745
- try {
2746
- this.sourceData && this.prepareData();
2747
- } catch (e) {
2748
- console.error(e);
2749
- }
2750
- },
2751
- prepareData() {
2752
- var t, r, s;
2753
- this.columns = Object.keys(((t = this.sourceData) == null ? void 0 : t[0]) || {});
2754
- const e = (r = this.sourceData) == null ? void 0 : r.map((n) => {
2755
- var o;
2756
- return n == null ? void 0 : n[(o = this.columns) == null ? void 0 : o[1]];
2757
- });
2758
- this.maxValue = Math.max(...e || []), this.restDimensions = (s = this.columns) == null ? void 0 : s.filter((n, o) => o !== 0);
2759
- },
2760
- formattedValue(e) {
2761
- return j(e);
2762
- },
2763
- getWidth(e) {
2764
- return `${e / this.maxValue * 100}%`;
2765
- }
2766
- }
2767
- }, an = { class: "h-full pt-[20px] list-bar" }, ln = { class: "space-y-2 custom-scrollbar h-full h-[calc(100%-20px)]" }, cn = { class: "relative w-full truncate" }, un = { class: "relative z-[1] text-sm block py-1 px-2 w-full text-sm truncate text-gray-800" }, dn = { class: "text-[14px] text-gray-500" };
2768
- function fn(e, t, r, s, n, o) {
2769
- return y(), _("div", an, [
2770
- m("ul", ln, [
2771
- (y(!0), _(F, null, L(e.sourceData, (i, a) => {
2772
- var f, c, u;
2773
- return y(), _("li", {
2774
- key: a,
2775
- class: "flex items-center justify-between w-full gap-x-2"
2776
- }, [
2777
- m("div", cn, [
2778
- m("span", un, E((i == null ? void 0 : i[(f = n.columns) == null ? void 0 : f[0]]) || "Без категорії"), 1),
2779
- m("div", {
2780
- class: J(["absolute inset-y-0 h-full rounded start-0", i != null && i[(c = n.columns) == null ? void 0 : c[0]] ? "bg-indigo-100" : "bg-gray-100"]),
2781
- style: Ee({ width: o.getWidth(i == null ? void 0 : i[(u = n.columns) == null ? void 0 : u[1]]) })
2782
- }, null, 6)
2783
- ]),
2784
- (y(!0), _(F, null, L(n.restDimensions, (h, x) => (y(), _("div", {
2785
- key: x,
2786
- class: "w-20 mr-2 text-end"
2787
- }, [
2788
- m("span", dn, E(o.formattedValue(i == null ? void 0 : i[h])), 1)
2789
- ]))), 128))
2790
- ]);
2791
- }), 128))
2792
- ])
2793
- ]);
2794
- }
2795
- const hn = /* @__PURE__ */ R(on, [["render", fn]]), pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2796
- __proto__: null,
2797
- default: hn
2798
- }, Symbol.toStringTag, { value: "Module" })), we = {
2799
- week: "Тиждень",
2800
- month: "Місяць",
2801
- quarter: "Квартал",
2802
- year: "Рік"
2803
- }, mn = ["onClick"], gn = { class: "flex items-center justify-between w-full" }, bn = { key: 0 }, wn = {
2804
- __name: "vs-bi-dropdown",
2805
- props: {
2806
- title: String,
2807
- options: [Array, String],
2808
- value: { type: String }
2809
- },
2810
- emits: ["selected"],
2811
- setup(e, { emit: t }) {
2812
- const r = e, s = t, n = he(!1), o = he(r.value || null), i = he(null), a = Pe(() => typeof r.options == "string" ? r.options.split(",").map((g, d) => ({ id: d, text: g.trim() })) : r.options), f = Pe(() => {
2813
- const g = a.value.find(
2814
- (d) => (d.id || d) === o.value
2815
- );
2816
- return g ? g.text || g : r.title;
2817
- }), c = (g) => {
2818
- o.value = g.id || g, n.value = !1, s("selected", (g == null ? void 0 : g.id) || g), document.removeEventListener("click", u);
2819
- }, u = (g) => {
2820
- i.value && !i.value.contains(g.target) && (n.value = !1, document.removeEventListener("click", u));
2821
- }, h = () => {
2822
- n.value = !n.value, n.value ? setTimeout(() => {
2823
- document.addEventListener("click", u);
2824
- }, 200) : document.removeEventListener("click", u);
2825
- }, x = (g) => (we == null ? void 0 : we[g]) || g;
2826
- return kt(() => {
2827
- document.removeEventListener("click", u);
2828
- }), (g, d) => (y(), _(F, null, [
2829
- m("button", {
2830
- type: "button",
2831
- "aria-expanded": "true",
2832
- class: "hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative group pr-2 -ms-2 py-1.5 pl-2.5 inline-flex shrink-0 justify-center items-center gap-x-1.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 before:absolute before:inset-0 before:z-[1] dark:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:bg-neutral-700",
2833
- onClick: h
2834
- }, [
2835
- Ye(E(x(f.value)) + " ", 1),
2836
- d[0] || (d[0] = m("svg", {
2837
- class: "shrink-0 size-3.5 text-gray-600 dark:text-neutral-400",
2838
- xmlns: "http://www.w3.org/2000/svg",
2839
- width: "16",
2840
- height: "16",
2841
- viewBox: "0 0 24 24",
2842
- fill: "none",
2843
- stroke: "currentColor",
2844
- "stroke-width": "2",
2845
- "stroke-linecap": "round",
2846
- "stroke-linejoin": "round"
2847
- }, [
2848
- m("path", { d: "m6 9 6 6 6-6" })
2849
- ], -1))
2850
- ]),
2851
- n.value ? (y(), _("div", {
2852
- key: 0,
2853
- ref_key: "biDropdown",
2854
- ref: i,
2855
- "data-hs-select-dropdown": "",
2856
- class: "absolute mt-2 z-50 w-48 p-1 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-950 opened",
2857
- role: "listbox",
2858
- tabindex: "-1",
2859
- "aria-orientation": "vertical",
2860
- style: { "margin-top": "10px" }
2861
- }, [
2862
- (y(!0), _(F, null, L(a.value, (p) => (y(), _("div", {
2863
- key: p.id || p,
2864
- class: "cursor-pointer selected hs-selected:bg-gray-100 dark:hs-selected:bg-neutral-800 py-1.5 px-2 w-full text-[13px] text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",
2865
- onClick: (b) => c(p)
2866
- }, [
2867
- m("div", gn, [
2868
- m("span", null, E(x(p.text || p)), 1),
2869
- o.value === (p.id || p) ? (y(), _("span", bn, d[1] || (d[1] = [
2870
- m("svg", {
2871
- class: "shrink-0 h-3.5 w-3.5 text-gray-800 dark:text-neutral-200",
2872
- xmlns: "http:.w3.org/2000/svg",
2873
- width: "24",
2874
- height: "24",
2875
- viewBox: "0 0 24 24",
2876
- fill: "none",
2877
- stroke: "currentColor",
2878
- "stroke-width": "2",
2879
- "stroke-linecap": "round",
2880
- "stroke-linejoin": "round"
2881
- }, [
2882
- m("polyline", { points: "20 6 9 17 4 12" })
2883
- ], -1)
2884
- ]))) : T("", !0)
2885
- ])
2886
- ], 8, mn))), 128))
2887
- ], 512)) : T("", !0)
2888
- ], 64));
2889
- }
2890
- }, yn = {
2891
- "bi-bar": O(() => Promise.resolve().then(() => ps)),
2892
- "bi-number": O(() => import("./vs-number-B2V_BPer.js")),
2893
- "bi-text": O(() => import("./vs-text-DkLKRC7F.js")),
2894
- "bi-listbar": O(() => Promise.resolve().then(() => pn)),
2895
- "bi-pie": O(() => Promise.resolve().then(() => vs)),
2896
- "bi-donut": O(() => Promise.resolve().then(() => ys)),
2897
- "bi-line": O(() => Promise.resolve().then(() => Os)),
2898
- "bi-stat": O(() => Promise.resolve().then(() => Hs)),
2899
- "bi-pivot": O(() => Promise.resolve().then(() => Po)),
2900
- "bi-progress": O(() => Promise.resolve().then(() => nn)),
2901
- "bi-funnel": O(() => import("./vs-funnel-bar-C8m-602x.js")),
2902
- "bi-map": O(() => import("./vs-map-PLlJqaaW.js")),
2903
- "bi-cluster": O(() => import("./vs-map-cluster-9tV6eiDA.js")),
2904
- "bi-table": O(() => import("./vs-table-WGE9jyDq.js"))
2905
- }, xn = { class: "flex items-center space-x-2" }, _n = /* @__PURE__ */ Et({
2906
- __name: "vs-bi-switch",
2907
- props: /* @__PURE__ */ Le({
2908
- leftLabel: {},
2909
- rightLabel: {},
2910
- modelValue: { type: Boolean }
2911
- }, {
2912
- modelValue: {
2913
- default: () => !1,
2914
- type: Boolean
2915
- },
2916
- modelModifiers: {}
2917
- }),
2918
- emits: /* @__PURE__ */ Le(["update:is-enabled"], ["update:modelValue"]),
2919
- setup(e, { emit: t }) {
2920
- const r = t, s = Ct(e, "modelValue"), n = () => {
2921
- r("update:is-enabled", s);
2922
- };
2923
- return (o, i) => (y(), _("div", xn, [
2924
- o.leftLabel ? (y(), _("div", {
2925
- key: 0,
2926
- class: J(["transition-colors", { "text-blue-500": !s.value }])
2927
- }, E(o.leftLabel), 3)) : T("", !0),
2928
- Rt(m("input", {
2929
- "onUpdate:modelValue": i[0] || (i[0] = (a) => s.value = a),
2930
- type: "checkbox",
2931
- class: "relative w-11 h-6 p-px bg-gray-100 border-transparent text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 disabled:opacity-50 disabled:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-600 before:inline-block before:size-5 before:bg-white checked:before:bg-blue-200 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:h-5 before:w-5 before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 dark:before:bg-neutral-400 dark:checked:before:bg-blue-200",
2932
- onChange: n
2933
- }, null, 544), [
2934
- [Ot, s.value]
2935
- ]),
2936
- o.rightLabel ? (y(), _("div", {
2937
- key: 1,
2938
- class: J(["transition-colors", { "text-blue-500": s.value }])
2939
- }, E(o.rightLabel), 3)) : T("", !0)
2940
- ]));
2941
- }
2942
- }), Dn = {}, Sn = { class: "flex items-center justify-center h-full" };
2943
- function vn(e, t) {
2944
- return y(), _("div", Sn, t[0] || (t[0] = [
2945
- m("div", { class: "text-center text-gray-500" }, [
2946
- m("h2", { class: "text-2xl font-bold" }, "No data available")
2947
- ], -1)
2948
- ]));
2949
- }
2950
- const kn = /* @__PURE__ */ R(Dn, [["render", vn]]), En = {}, Cn = {
2951
- xmlns: "http://www.w3.org/2000/svg",
2952
- viewBox: "0 0 24 24",
2953
- fill: "none",
2954
- stroke: "currentColor",
2955
- "stroke-width": "2",
2956
- "stroke-linecap": "round",
2957
- "stroke-linejoin": "round",
2958
- class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
2959
- };
2960
- function Rn(e, t, r, s, n, o) {
2961
- return y(), _("svg", Cn, t[0] || (t[0] = [
2962
- m("path", {
2963
- stroke: "none",
2964
- d: "M0 0h24v24H0z",
2965
- fill: "none"
2966
- }, null, -1),
2967
- m("path", { d: "M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2" }, null, -1),
2968
- m("path", { d: "M7 11l5 5l5 -5" }, null, -1),
2969
- m("path", { d: "M12 4l0 12" }, null, -1)
2970
- ]));
2971
- }
2972
- const On = /* @__PURE__ */ R(En, [["render", Rn]]), Tn = {
2973
- components: {
2974
- VsBiDropdown: wn,
2975
- VsBiSwitch: _n,
2976
- VsNoDataChart: kn,
2977
- IconDownload: On,
2978
- ...yn
2979
- },
2980
- props: {
2981
- dashboard: { type: String },
2982
- prefix: { type: String, default: "" },
2983
- widget: { type: String },
2984
- filterURl: { type: String },
2985
- dashboardWidgets: { type: Object },
2986
- selectedWidget: { type: String }
2987
- },
2988
- data() {
2989
- return {
2990
- checked: [],
2991
- selected: [],
2992
- currentWidget: null,
2993
- widgetData: []
2994
- };
2995
- },
2996
- computed: {
2997
- computedTitle() {
2998
- var t, r;
2999
- const e = (t = this.dashboardWidgets) == null ? void 0 : t.find(
3000
- (s) => s.name === this.widget
3001
- );
3002
- return ((r = e == null ? void 0 : e.data) == null ? void 0 : r.title) || (e == null ? void 0 : e.title) || "";
3003
- },
3004
- computedType() {
3005
- var t;
3006
- const e = (t = this.dashboardWidgets) == null ? void 0 : t.find(
3007
- (r) => r.name === this.widget
3008
- );
3009
- return (e == null ? void 0 : e.type) || "text";
3010
- },
3011
- controls() {
3012
- var t;
3013
- return Object.keys(((t = this.widgetData) == null ? void 0 : t.controls) || {}).map(
3014
- (r) => {
3015
- var s, n, o;
3016
- return {
3017
- name: r,
3018
- options: typeof ((s = this.widgetData) == null ? void 0 : s.controls) == "boolean" ? !1 : (o = (n = this.widgetData) == null ? void 0 : n.controls) == null ? void 0 : o[r]
3019
- };
3020
- }
3021
- );
3022
- }
3023
- },
3024
- mounted() {
3025
- this.prefix && (k.defaults.baseURL = this.prefix);
3026
- },
3027
- watch: {
3028
- filterURl(e) {
3029
- var t, r;
3030
- (r = (t = this.$refs) == null ? void 0 : t.chart) == null || r.setFilter(e);
3031
- },
3032
- selectedWidget(e, t) {
3033
- var r;
3034
- e !== t && e === ((r = this.widgetData) == null ? void 0 : r.id) && this.$emit("update:current-widget-data", this.widgetData);
3035
- },
3036
- widgetData(e, t) {
3037
- if ((e == null ? void 0 : e.id) === (t == null ? void 0 : t.id)) return;
3038
- const s = new URLSearchParams(window.top.location.search).get("widget");
3039
- s && s === (e == null ? void 0 : e.id) && this.$emit("update:current-widget-data", e);
3040
- }
3041
- },
3042
- methods: {
3043
- changeStyleHandler(e, t) {
3044
- var r;
3045
- (r = this.$refs.chart) == null || r.changeStyle(e, t);
3046
- },
3047
- selectedOptionHandler(e, t) {
3048
- let r = !0;
3049
- this.selected.forEach((s) => {
3050
- s.name === t && (s.option = e, r = !1);
3051
- }), r && this.selected.push({ name: t, option: e }), this.makeUpUrl();
3052
- },
3053
- makeUpUrl() {
3054
- var t;
3055
- let e = `/bi-data?dashboard=${this.dashboard}&widget=${this.widget}`;
3056
- this.selected.forEach((r, s) => {
3057
- e += `&${r.name}=${r.option}`;
3058
- }), (t = this.$refs.chart) == null || t.getDataFromURL(e);
3059
- },
3060
- exportChart() {
3061
- if (this.currentWidget) {
3062
- const e = this.currentWidget.getDataURL({
3063
- type: "png",
3064
- pixelRatio: 2,
3065
- backgroundColor: "#ffffff"
3066
- }), t = document.createElement("a");
3067
- t.href = e, t.download = "chart.png", document.body.appendChild(t), t.click(), document.body.removeChild(t);
3068
- }
3069
- }
3070
- }
3071
- }, $n = {
3072
- key: 0,
3073
- class: "text-[16px] flex max-w-full items-center min-h-0 flex justify-between max-h-[50px] h-fit shrink-0"
3074
- }, Nn = { class: "flex items-center justify-between w-full" }, Fn = { class: "grid" }, An = { class: "text-gray-800 max-h-[30px] inline-block text-nowrap font-semibold" }, Pn = { class: "flex flex-col justify-end" }, Ln = {
3075
- key: 0,
3076
- class: "flex items-center justify-end w-full gap-2"
3077
- }, Bn = { class: "w-full h-full" };
3078
- function Un(e, t, r, s, n, o) {
3079
- var u, h, x, g, d, p, b, v, S;
3080
- const i = U("VsBiDropdown"), a = U("VsBiSwitch"), f = U("IconDownload"), c = U("VsNoDataChart");
3081
- return y(), _("div", {
3082
- ref: "widget",
3083
- class: J(["box-border relative h-full p-4 bg-white border border-gray-200 select-auto rounded-xl", [
3084
- (h = (u = n.widgetData) == null ? void 0 : u.style) != null && h.height ? `max-h-[${(g = (x = n.widgetData) == null ? void 0 : x.style) == null ? void 0 : g.height}px] h-[${(p = (d = n.widgetData) == null ? void 0 : d.style) == null ? void 0 : p.height}px]` : "max-h-[460px]"
3085
- ]])
3086
- }, [
3087
- ["text", "cluster", "map"].includes(o.computedType) ? T("", !0) : (y(), _("div", $n, [
3088
- m("div", Nn, [
3089
- m("div", Fn, [
3090
- m("span", An, E(o.computedTitle), 1)
3091
- ]),
3092
- m("div", Pn, [
3093
- (b = o.controls) != null && b.length ? (y(), _("span", Ln, [
3094
- (y(!0), _(F, null, L((v = o.controls) == null ? void 0 : v.filter(
3095
- (w) => (w == null ? void 0 : w.options) && (w == null ? void 0 : w.name) !== "export"
3096
- ), (w) => {
3097
- var P;
3098
- return y(), _("div", null, [
3099
- Array.isArray(w == null ? void 0 : w.options) ? (y(), I(i, {
3100
- key: 0,
3101
- title: w == null ? void 0 : w.name,
3102
- options: w == null ? void 0 : w.options,
3103
- value: (P = n.widgetData) == null ? void 0 : P.data[w == null ? void 0 : w.name],
3104
- onSelected: (C) => o.selectedOptionHandler(C, w == null ? void 0 : w.name)
3105
- }, null, 8, ["title", "options", "value", "onSelected"])) : typeof w.options == "boolean" ? (y(), I(a, {
3106
- key: 1,
3107
- "left-label": w == null ? void 0 : w.name,
3108
- "is-enabled": w == null ? void 0 : w.options,
3109
- "onUpdate:isEnabled": (C) => o.changeStyleHandler(w == null ? void 0 : w.name, C)
3110
- }, null, 8, ["left-label", "is-enabled", "onUpdate:isEnabled"])) : T("", !0)
3111
- ]);
3112
- }), 256)),
3113
- (S = o.controls) != null && S.some((w) => (w == null ? void 0 : w.name) === "export") ? (y(), _("button", {
3114
- key: 0,
3115
- onClick: t[0] || (t[0] = (...w) => o.exportChart && o.exportChart(...w)),
3116
- class: "h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center"
3117
- }, [
3118
- Ce(f, {
3119
- height: "16",
3120
- width: "16",
3121
- class: "text-gray-800"
3122
- })
3123
- ])) : T("", !0)
3124
- ])) : T("", !0)
3125
- ])
3126
- ])
3127
- ])),
3128
- m("div", Bn, [
3129
- n.widgetData ? (y(), I(Tt("bi-" + o.computedType), {
3130
- key: 0,
3131
- currentWidget: n.currentWidget,
3132
- "onUpdate:currentWidget": t[1] || (t[1] = (w) => n.currentWidget = w),
3133
- widgetData: n.widgetData,
3134
- "onUpdate:widgetData": t[2] || (t[2] = (w) => n.widgetData = w),
3135
- ref: "chart",
3136
- dashboard: r.dashboard,
3137
- title: o.computedTitle,
3138
- widget: r.widget
3139
- }, null, 40, ["currentWidget", "widgetData", "dashboard", "title", "widget"])) : (y(), I(c, {
3140
- key: 1,
3141
- class: "w-full h-full"
3142
- }))
3143
- ])
3144
- ], 2);
3145
- }
3146
- const jn = /* @__PURE__ */ R(Tn, [["render", Un]]), In = {
3147
- props: {
3148
- title: { type: String, default: () => "Дані для відображення відсутні" },
3149
- text: {
3150
- type: String,
3151
- default: () => "Змініть параметри пошуку або спробуйте пізніше"
3152
- }
3153
- }
3154
- }, Vn = { class: "w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit" }, zn = { class: "p-5 min-h-[500px] flex flex-col justify-center items-center text-center" }, Mn = { class: "max-w-sm mx-auto mt-6" }, qn = { class: "font-medium text-gray-800 dark:text-neutral-200" }, Hn = { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" };
3155
- function Wn(e, t, r, s, n, o) {
3156
- return y(), _("div", Vn, [
3157
- m("div", null, [
3158
- m("div", zn, [
3159
- t[0] || (t[0] = et('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>', 1)),
3160
- m("div", Mn, [
3161
- m("p", qn, E(r.title), 1),
3162
- m("p", Hn, E(r.text), 1)
3163
- ])
3164
- ])
3165
- ])
3166
- ]);
3167
- }
3168
- const Jn = /* @__PURE__ */ R(In, [["render", Wn]]), Kn = {}, Gn = {
3169
- class: "flex-shrink-0 size-3.5",
3170
- xmlns: "http://www.w3.org/2000/svg",
3171
- width: "22",
3172
- height: "22",
3173
- viewBox: "0 0 24 24",
3174
- fill: "none",
3175
- stroke: "currentColor",
3176
- "stroke-width": "2",
3177
- "stroke-linecap": "round",
3178
- "stroke-linejoin": "round"
3179
- };
3180
- function Xn(e, t) {
3181
- return y(), _("svg", Gn, t[0] || (t[0] = [
3182
- et('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>', 9)
3183
- ]));
3184
- }
3185
- const Qn = /* @__PURE__ */ R(Kn, [["render", Xn]]), Zn = {}, Yn = {
3186
- xmlns: "http://www.w3.org/2000/svg",
3187
- viewBox: "0 0 24 24",
3188
- fill: "none",
3189
- stroke: "currentColor",
3190
- "stroke-width": "1",
3191
- "stroke-linecap": "round",
3192
- "stroke-linejoin": "round",
3193
- class: "icon icon-tabler icons-tabler-outline icon-tabler-refresh"
3194
- };
3195
- function eo(e, t) {
3196
- return y(), _("svg", Yn, t[0] || (t[0] = [
3197
- m("path", {
3198
- stroke: "none",
3199
- d: "M0 0h24v24H0z",
3200
- fill: "none"
3201
- }, null, -1),
3202
- m("path", { d: "M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4" }, null, -1),
3203
- m("path", { d: "M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4" }, null, -1)
3204
- ]));
3205
- }
3206
- const to = /* @__PURE__ */ R(Zn, [["render", eo]]), ro = {
3207
- components: { filterIcon: Qn, refreshIcon: to },
3208
- props: ["filterScheme"],
3209
- emits: ["filters:changed"],
3210
- data() {
3211
- return {
3212
- rows: [],
3213
- isFilterVisible: !1,
3214
- rowList: [],
3215
- activeFilters: "",
3216
- filters: {}
3217
- };
3218
- },
3219
- async mounted() {
3220
- const t = await (await new URLSearchParams(window.top.location.search)).get("filter");
3221
- this.filters.url = t || "";
3222
- },
3223
- computed: {
3224
- activeFiltersCount() {
3225
- var e, t;
3226
- return (e = this.filters) != null && e.url ? ((t = this.filters) == null ? void 0 : t.url.split("=").length) - 1 : 0;
3227
- }
3228
- },
3229
- methods: {
3230
- toggleFilterShown() {
3231
- this.isFilterVisible = !this.isFilterVisible;
3232
- },
3233
- handleFilterChange(e) {
3234
- var t, r;
3235
- this.filters = e, this.activeFilters = (r = (t = this.$refs) == null ? void 0 : t.filter) == null ? void 0 : r.activeFilters, this.$emit("filters:changed", this.filters);
3236
- },
3237
- resetFilters() {
3238
- this.$refs.filter && this.$refs.filter.clearAll(), this.isFilterVisible = !1, this.$emit("filters:changed", ""), this.activeFilters = null;
3239
- },
3240
- closeFilter({ target: e }) {
3241
- this.isFilterVisible && e.classList.contains("filter-container") && (this.isFilterVisible = !1);
3242
- }
3243
- }
3244
- }, so = { class: "flex items-center" }, no = {
3245
- key: 0,
3246
- class: "font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"
3247
- };
3248
- function oo(e, t, r, s, n, o) {
3249
- const i = U("filterIcon"), a = U("VsFilterList");
3250
- return y(), _("div", so, [
3251
- r.filterScheme ? (y(), I(a, {
3252
- key: 0,
3253
- ref: "filter",
3254
- scheme: r.filterScheme,
3255
- closeFilterBtn: !0,
3256
- onFilterClose: t[1] || (t[1] = (f) => n.isFilterVisible = !1),
3257
- layout: "default",
3258
- "apply-vue-router": "",
3259
- history: "",
3260
- view: "plain",
3261
- token: e.table,
3262
- name: "filter",
3263
- footer: !0,
3264
- background: !0,
3265
- onFilterChange: o.handleFilterChange
3266
- }, {
3267
- button: $t(() => [
3268
- m("button", {
3269
- type: "button",
3270
- class: "py-2 px-2.5 ml-3 h-[38px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",
3271
- onClick: t[0] || (t[0] = (...f) => o.toggleFilterShown && o.toggleFilterShown(...f))
3272
- }, [
3273
- Ce(i),
3274
- t[2] || (t[2] = Ye(" Фільтри ")),
3275
- o.activeFiltersCount >= 1 ? (y(), _("span", no, E(o.activeFiltersCount), 1)) : T("", !0)
3276
- ])
3277
- ]),
3278
- _: 1
3279
- }, 8, ["scheme", "token", "onFilterChange"])) : T("", !0)
3280
- ]);
3281
- }
3282
- const io = /* @__PURE__ */ R(ro, [["render", oo]]), ao = {
3283
- props: ["dashboardData", "filters"],
3284
- components: { VsFilterHeader: io }
3285
- }, lo = { class: "bg-white px-5 flex gap-4 h-[90px] border border-gray-200 mt-2 rounded-xl mb-2 pt-[3px] justify-between items-center" }, co = { class: "grow" }, uo = { class: "text-lg font-semibold text-stone-800 dark:text-neutral-200" }, fo = {
3286
- type: "button",
3287
- class: "inline-flex items-center text-sm gap-x-2 text-stone-800 hover:text-stone-500 focus:outline-none focus:text-stone-500 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400",
3288
- "data-clipboard-target": "#hs-erc",
3289
- "data-clipboard-action": "copy",
3290
- "data-clipboard-success-text": "Copied"
3291
- };
3292
- function ho(e, t, r, s, n, o) {
3293
- var a, f;
3294
- const i = U("VsFilterHeader");
3295
- return y(), _("div", lo, [
3296
- m("div", co, [
3297
- m("h1", uo, E((a = r.dashboardData) == null ? void 0 : a.title), 1),
3298
- m("button", fo, E((f = r.dashboardData) == null ? void 0 : f.description), 1)
3299
- ]),
3300
- Ce(i, {
3301
- filterScheme: r.filters,
3302
- "onFilters:changed": t[0] || (t[0] = (c) => e.$emit("filters:changed", c))
3303
- }, null, 8, ["filterScheme"])
3304
- ]);
3305
- }
3306
- const po = /* @__PURE__ */ R(ao, [["render", ho]]), mo = {
3307
- components: { VsWidget: jn, VsNewNodata: Jn, VsHeader: po },
3308
- props: ["id", "prefix"],
3309
- data() {
3310
- return {
3311
- widgets: [],
3312
- panels: [],
3313
- error: !1,
3314
- selectedPanel: "",
3315
- filterURl: null,
3316
- dashboardData: null
3317
- };
3318
- },
3319
- async mounted() {
3320
- k.defaults.baseURL = this.prefix || "/api", await this.fetchData();
3321
- },
3322
- methods: {
3323
- async fetchData() {
3324
- if (this.id)
3325
- try {
3326
- const { data: e } = await k.get(`/bi-dashboard/${this.id}`);
3327
- this.dashboardData = e;
3328
- } catch (e) {
3329
- console.error(e);
3330
- }
3331
- },
3332
- columnClass(e) {
3333
- const t = e != null && e.col ? e == null ? void 0 : e.col : 12;
3334
- return {
3335
- 1: "md:w-1/12 sm:w-full",
3336
- 2: "md:w-1/6 sm:w-full",
3337
- 3: "md:w-1/4 sm:w-full",
3338
- 4: "md:w-1/3 sm:w-full",
3339
- 6: "md:w-1/2 sm:w-full",
3340
- 8: "md:w-2/3 sm:w-full",
3341
- 10: "md:w-5/6 sm:w-full",
3342
- 12: "w-full"
3343
- }[t] || "w-full";
3344
- },
3345
- async filterHandler(e) {
3346
- var r;
3347
- this.filterURl = "";
3348
- let t = "&filter=";
3349
- (r = e == null ? void 0 : e.url) != null && r.length && (e.url.split("|").forEach((n) => {
3350
- const o = n.split("=");
3351
- t += `${o[0]}=${o[1]}`;
3352
- }), this.filterURl += t);
3353
- }
3354
- }
3355
- }, go = { class: "w-full pb-8 overflow-y-auto" }, bo = { class: "grid flex-grow w-full grid-cols-12 gap-4 h-fit" };
3356
- function wo(e, t, r, s, n, o) {
3357
- var c, u, h;
3358
- const i = U("VsHeader"), a = U("VsNewNodata"), f = U("VsWidget");
3359
- return y(), _("div", go, [
3360
- m("div", null, [
3361
- (c = n.dashboardData) != null && c.filters ? (y(), I(i, {
3362
- key: 0,
3363
- filters: (u = n.dashboardData) == null ? void 0 : u.filters,
3364
- dashboardData: n.dashboardData,
3365
- "onFilters:changed": t[0] || (t[0] = (x) => o.filterHandler(x))
3366
- }, null, 8, ["filters", "dashboardData"])) : T("", !0)
3367
- ]),
3368
- m("div", bo, [
3369
- n.error || !n.dashboardData ? (y(), I(a, {
3370
- key: 0,
3371
- class: "col-span-12"
3372
- })) : T("", !0),
3373
- (y(!0), _(F, null, L(((h = n.dashboardData) == null ? void 0 : h.panels) || [], (x, g) => {
3374
- var d;
3375
- return y(), _("div", {
3376
- key: g,
3377
- class: J([`col-span-${x.col || 12}`, "flex flex-col gap-[10px]"])
3378
- }, [
3379
- (d = x.widgets) != null && d.length ? (y(!0), _(F, { key: 0 }, L(x.widgets, (p) => (y(), I(f, {
3380
- key: p,
3381
- dashboard: r.id,
3382
- widget: p,
3383
- "dashboard-widgets": n.dashboardData.widgets,
3384
- "filter-u-rl": n.filterURl
3385
- }, null, 8, ["dashboard", "widget", "dashboard-widgets", "filter-u-rl"]))), 128)) : (y(), I(f, {
3386
- key: 1,
3387
- class: "flex flex-col",
3388
- dashboard: r.id,
3389
- widget: x.widget,
3390
- "dashboard-widgets": n.dashboardData.widgets,
3391
- "filter-u-rl": n.filterURl
3392
- }, null, 8, ["dashboard", "widget", "dashboard-widgets", "filter-u-rl"]))
3393
- ], 2);
3394
- }), 128))
3395
- ])
3396
- ]);
3397
- }
3398
- const Uo = /* @__PURE__ */ R(mo, [["render", wo]]), yo = {
3399
- name: "VsPivotTable",
3400
- mixins: [M],
3401
- data() {
3402
- return {
3403
- values: null,
3404
- xs: null,
3405
- products: null
3406
- };
3407
- },
3408
- async mounted() {
3409
- await this.getData(), this.prepareData();
3410
- },
3411
- methods: {
3412
- onChangedData() {
3413
- try {
3414
- this.sourceData && this.prepareData();
3415
- } catch {
3416
- }
3417
- },
3418
- prepareData() {
3419
- try {
3420
- const e = Array.from(
3421
- new Set(this.sourceData.map((t) => t[this.dimensions[0]]))
3422
- );
3423
- this.dimensions[0].includes("date") ? this.xs = e.map((t) => Re(t)) : this.xs = [...e], this.products = this.dimensions.filter((t, r) => r != 0), this.values = this.products.map((t, r) => ({
3424
- name: t,
3425
- data: this.sourceData.filter((s) => parseFloat(s[t])).map((s) => j(parseFloat(s[t])))
3426
- }));
3427
- } catch (e) {
3428
- console.error(e);
3429
- }
3430
- }
3431
- }
3432
- }, xo = { class: "flex flex-col h-full p-5 space-y-4 rounded-xl custom-scrollbar" }, _o = { class: "overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 custom-scrollbar" }, Do = { class: "inline-block min-w-full align-middle" }, So = { class: "min-w-full divide-y divide-gray-200" }, vo = { class: "space-x-2" }, ko = {
3433
- scope: "col",
3434
- class: "xl:min-w-[120px] min-w-48"
3435
- }, Eo = { class: "py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500" }, Co = { class: "divide-y divide-gray-200 text-[12px]" }, Ro = { class: "py-3 size-px whitespace-nowrap" }, Oo = { class: "flex items-center gap-x-3" }, To = { class: "font-medium text-gray-800" }, $o = { class: "py-3 size-px whitespace-nowrap" }, No = { class: "text-gray-600" };
3436
- function Fo(e, t, r, s, n, o) {
3437
- return y(), _("div", xo, [
3438
- m("div", _o, [
3439
- m("div", Do, [
3440
- m("table", So, [
3441
- m("thead", null, [
3442
- m("tr", vo, [
3443
- t[0] || (t[0] = m("th", {
3444
- scope: "col",
3445
- class: "min-w-[200px]"
3446
- }, [
3447
- m("div", { class: "py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500" })
3448
- ], -1)),
3449
- (y(!0), _(F, null, L(n.xs, (i) => (y(), _("th", ko, [
3450
- m("div", Eo, E(i), 1)
3451
- ]))), 256))
3452
- ])
3453
- ]),
3454
- (y(!0), _(F, null, L(n.values, (i) => (y(), _("tbody", Co, [
3455
- m("tr", null, [
3456
- m("td", Ro, [
3457
- m("div", Oo, [
3458
- m("span", To, E(i.name), 1)
3459
- ])
3460
- ]),
3461
- (y(!0), _(F, null, L(n.xs, (a, f) => (y(), _("td", $o, [
3462
- m("span", No, E(i.data[f]), 1)
3463
- ]))), 256))
3464
- ])
3465
- ]))), 256))
3466
- ])
3467
- ])
3468
- ])
3469
- ]);
3470
- }
3471
- const Ao = /* @__PURE__ */ R(yo, [["render", Fo]]), Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3472
- __proto__: null,
3473
- default: Ao
3474
- }, Symbol.toStringTag, { value: "Module" }));
3475
- export {
3476
- hs as V,
3477
- R as _,
3478
- Re as a,
3479
- j as b,
3480
- M as c,
3481
- Y as d,
3482
- k as e,
3483
- Bo as f,
3484
- Ss as g,
3485
- Rs as h,
3486
- qs as i,
3487
- sn as j,
3488
- hn as k,
3489
- Ao as l,
3490
- Uo as m,
3491
- jn as n,
3492
- ws as v
3493
- };