@opengis/bi 1.2.6 → 1.2.7

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