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