@opengis/bi 1.2.7 → 1.2.10

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