@quidgest/chatbot 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/dist/components/ChatBot.vue.d.ts +57 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4246 -0
- package/dist/index.mjs +4244 -0
- package/dist/style.css +1046 -0
- package/dist/types/message.type.d.ts +6 -0
- package/dist/types/texts.type.d.ts +3 -0
- package/package.json +50 -0
- package/src/assets/chatbot.png +0 -0
- package/src/assets/styles/styles.scss +116 -0
- package/src/components/ChatBot.vue +365 -0
- package/src/index.ts +4 -0
- package/src/shims-vue.d.ts +1 -0
- package/src/types/message.type.ts +6 -0
- package/src/types/texts.type.ts +3 -0
- package/src/vite-env.d.ts +1 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4246 @@
|
|
|
1
|
+
(function(global2, factory) {
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory(require("vue")) : typeof define === "function" && define.amd ? define(["vue"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.ChatBotFrontend = factory(global2.vue));
|
|
3
|
+
})(this, function(vue) {
|
|
4
|
+
"use strict";
|
|
5
|
+
function bind(fn, thisArg) {
|
|
6
|
+
return function wrap() {
|
|
7
|
+
return fn.apply(thisArg, arguments);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
const { toString } = Object.prototype;
|
|
11
|
+
const { getPrototypeOf } = Object;
|
|
12
|
+
const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
13
|
+
const str = toString.call(thing);
|
|
14
|
+
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
15
|
+
})(/* @__PURE__ */ Object.create(null));
|
|
16
|
+
const kindOfTest = (type) => {
|
|
17
|
+
type = type.toLowerCase();
|
|
18
|
+
return (thing) => kindOf(thing) === type;
|
|
19
|
+
};
|
|
20
|
+
const typeOfTest = (type) => (thing) => typeof thing === type;
|
|
21
|
+
const { isArray } = Array;
|
|
22
|
+
const isUndefined = typeOfTest("undefined");
|
|
23
|
+
function isBuffer(val) {
|
|
24
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
25
|
+
}
|
|
26
|
+
const isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
27
|
+
function isArrayBufferView(val) {
|
|
28
|
+
let result;
|
|
29
|
+
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
30
|
+
result = ArrayBuffer.isView(val);
|
|
31
|
+
} else {
|
|
32
|
+
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
const isString = typeOfTest("string");
|
|
37
|
+
const isFunction = typeOfTest("function");
|
|
38
|
+
const isNumber = typeOfTest("number");
|
|
39
|
+
const isObject = (thing) => thing !== null && typeof thing === "object";
|
|
40
|
+
const isBoolean = (thing) => thing === true || thing === false;
|
|
41
|
+
const isPlainObject = (val) => {
|
|
42
|
+
if (kindOf(val) !== "object") {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
const prototype2 = getPrototypeOf(val);
|
|
46
|
+
return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
|
|
47
|
+
};
|
|
48
|
+
const isDate = kindOfTest("Date");
|
|
49
|
+
const isFile = kindOfTest("File");
|
|
50
|
+
const isBlob = kindOfTest("Blob");
|
|
51
|
+
const isFileList = kindOfTest("FileList");
|
|
52
|
+
const isStream = (val) => isObject(val) && isFunction(val.pipe);
|
|
53
|
+
const isFormData = (thing) => {
|
|
54
|
+
let kind;
|
|
55
|
+
return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
|
|
56
|
+
kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
|
|
57
|
+
};
|
|
58
|
+
const isURLSearchParams = kindOfTest("URLSearchParams");
|
|
59
|
+
const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
60
|
+
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
61
|
+
if (obj === null || typeof obj === "undefined") {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
let i;
|
|
65
|
+
let l;
|
|
66
|
+
if (typeof obj !== "object") {
|
|
67
|
+
obj = [obj];
|
|
68
|
+
}
|
|
69
|
+
if (isArray(obj)) {
|
|
70
|
+
for (i = 0, l = obj.length; i < l; i++) {
|
|
71
|
+
fn.call(null, obj[i], i, obj);
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
75
|
+
const len = keys.length;
|
|
76
|
+
let key;
|
|
77
|
+
for (i = 0; i < len; i++) {
|
|
78
|
+
key = keys[i];
|
|
79
|
+
fn.call(null, obj[key], key, obj);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function findKey(obj, key) {
|
|
84
|
+
key = key.toLowerCase();
|
|
85
|
+
const keys = Object.keys(obj);
|
|
86
|
+
let i = keys.length;
|
|
87
|
+
let _key;
|
|
88
|
+
while (i-- > 0) {
|
|
89
|
+
_key = keys[i];
|
|
90
|
+
if (key === _key.toLowerCase()) {
|
|
91
|
+
return _key;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
const _global = (() => {
|
|
97
|
+
if (typeof globalThis !== "undefined")
|
|
98
|
+
return globalThis;
|
|
99
|
+
return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
|
|
100
|
+
})();
|
|
101
|
+
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
102
|
+
function merge() {
|
|
103
|
+
const { caseless } = isContextDefined(this) && this || {};
|
|
104
|
+
const result = {};
|
|
105
|
+
const assignValue = (val, key) => {
|
|
106
|
+
const targetKey = caseless && findKey(result, key) || key;
|
|
107
|
+
if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
|
|
108
|
+
result[targetKey] = merge(result[targetKey], val);
|
|
109
|
+
} else if (isPlainObject(val)) {
|
|
110
|
+
result[targetKey] = merge({}, val);
|
|
111
|
+
} else if (isArray(val)) {
|
|
112
|
+
result[targetKey] = val.slice();
|
|
113
|
+
} else {
|
|
114
|
+
result[targetKey] = val;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
for (let i = 0, l = arguments.length; i < l; i++) {
|
|
118
|
+
arguments[i] && forEach(arguments[i], assignValue);
|
|
119
|
+
}
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
123
|
+
forEach(b, (val, key) => {
|
|
124
|
+
if (thisArg && isFunction(val)) {
|
|
125
|
+
a[key] = bind(val, thisArg);
|
|
126
|
+
} else {
|
|
127
|
+
a[key] = val;
|
|
128
|
+
}
|
|
129
|
+
}, { allOwnKeys });
|
|
130
|
+
return a;
|
|
131
|
+
};
|
|
132
|
+
const stripBOM = (content) => {
|
|
133
|
+
if (content.charCodeAt(0) === 65279) {
|
|
134
|
+
content = content.slice(1);
|
|
135
|
+
}
|
|
136
|
+
return content;
|
|
137
|
+
};
|
|
138
|
+
const inherits = (constructor, superConstructor, props, descriptors2) => {
|
|
139
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
|
|
140
|
+
constructor.prototype.constructor = constructor;
|
|
141
|
+
Object.defineProperty(constructor, "super", {
|
|
142
|
+
value: superConstructor.prototype
|
|
143
|
+
});
|
|
144
|
+
props && Object.assign(constructor.prototype, props);
|
|
145
|
+
};
|
|
146
|
+
const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
|
|
147
|
+
let props;
|
|
148
|
+
let i;
|
|
149
|
+
let prop;
|
|
150
|
+
const merged = {};
|
|
151
|
+
destObj = destObj || {};
|
|
152
|
+
if (sourceObj == null)
|
|
153
|
+
return destObj;
|
|
154
|
+
do {
|
|
155
|
+
props = Object.getOwnPropertyNames(sourceObj);
|
|
156
|
+
i = props.length;
|
|
157
|
+
while (i-- > 0) {
|
|
158
|
+
prop = props[i];
|
|
159
|
+
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
160
|
+
destObj[prop] = sourceObj[prop];
|
|
161
|
+
merged[prop] = true;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
sourceObj = filter !== false && getPrototypeOf(sourceObj);
|
|
165
|
+
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
166
|
+
return destObj;
|
|
167
|
+
};
|
|
168
|
+
const endsWith = (str, searchString, position) => {
|
|
169
|
+
str = String(str);
|
|
170
|
+
if (position === void 0 || position > str.length) {
|
|
171
|
+
position = str.length;
|
|
172
|
+
}
|
|
173
|
+
position -= searchString.length;
|
|
174
|
+
const lastIndex = str.indexOf(searchString, position);
|
|
175
|
+
return lastIndex !== -1 && lastIndex === position;
|
|
176
|
+
};
|
|
177
|
+
const toArray = (thing) => {
|
|
178
|
+
if (!thing)
|
|
179
|
+
return null;
|
|
180
|
+
if (isArray(thing))
|
|
181
|
+
return thing;
|
|
182
|
+
let i = thing.length;
|
|
183
|
+
if (!isNumber(i))
|
|
184
|
+
return null;
|
|
185
|
+
const arr = new Array(i);
|
|
186
|
+
while (i-- > 0) {
|
|
187
|
+
arr[i] = thing[i];
|
|
188
|
+
}
|
|
189
|
+
return arr;
|
|
190
|
+
};
|
|
191
|
+
const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
|
|
192
|
+
return (thing) => {
|
|
193
|
+
return TypedArray && thing instanceof TypedArray;
|
|
194
|
+
};
|
|
195
|
+
})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
|
|
196
|
+
const forEachEntry = (obj, fn) => {
|
|
197
|
+
const generator = obj && obj[Symbol.iterator];
|
|
198
|
+
const iterator = generator.call(obj);
|
|
199
|
+
let result;
|
|
200
|
+
while ((result = iterator.next()) && !result.done) {
|
|
201
|
+
const pair = result.value;
|
|
202
|
+
fn.call(obj, pair[0], pair[1]);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const matchAll = (regExp, str) => {
|
|
206
|
+
let matches;
|
|
207
|
+
const arr = [];
|
|
208
|
+
while ((matches = regExp.exec(str)) !== null) {
|
|
209
|
+
arr.push(matches);
|
|
210
|
+
}
|
|
211
|
+
return arr;
|
|
212
|
+
};
|
|
213
|
+
const isHTMLForm = kindOfTest("HTMLFormElement");
|
|
214
|
+
const toCamelCase = (str) => {
|
|
215
|
+
return str.toLowerCase().replace(
|
|
216
|
+
/[-_\s]([a-z\d])(\w*)/g,
|
|
217
|
+
function replacer(m, p1, p2) {
|
|
218
|
+
return p1.toUpperCase() + p2;
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
};
|
|
222
|
+
const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
223
|
+
const isRegExp = kindOfTest("RegExp");
|
|
224
|
+
const reduceDescriptors = (obj, reducer) => {
|
|
225
|
+
const descriptors2 = Object.getOwnPropertyDescriptors(obj);
|
|
226
|
+
const reducedDescriptors = {};
|
|
227
|
+
forEach(descriptors2, (descriptor, name) => {
|
|
228
|
+
let ret;
|
|
229
|
+
if ((ret = reducer(descriptor, name, obj)) !== false) {
|
|
230
|
+
reducedDescriptors[name] = ret || descriptor;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
Object.defineProperties(obj, reducedDescriptors);
|
|
234
|
+
};
|
|
235
|
+
const freezeMethods = (obj) => {
|
|
236
|
+
reduceDescriptors(obj, (descriptor, name) => {
|
|
237
|
+
if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
const value = obj[name];
|
|
241
|
+
if (!isFunction(value))
|
|
242
|
+
return;
|
|
243
|
+
descriptor.enumerable = false;
|
|
244
|
+
if ("writable" in descriptor) {
|
|
245
|
+
descriptor.writable = false;
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (!descriptor.set) {
|
|
249
|
+
descriptor.set = () => {
|
|
250
|
+
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
};
|
|
255
|
+
const toObjectSet = (arrayOrString, delimiter) => {
|
|
256
|
+
const obj = {};
|
|
257
|
+
const define2 = (arr) => {
|
|
258
|
+
arr.forEach((value) => {
|
|
259
|
+
obj[value] = true;
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
isArray(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter));
|
|
263
|
+
return obj;
|
|
264
|
+
};
|
|
265
|
+
const noop = () => {
|
|
266
|
+
};
|
|
267
|
+
const toFiniteNumber = (value, defaultValue) => {
|
|
268
|
+
value = +value;
|
|
269
|
+
return Number.isFinite(value) ? value : defaultValue;
|
|
270
|
+
};
|
|
271
|
+
const ALPHA = "abcdefghijklmnopqrstuvwxyz";
|
|
272
|
+
const DIGIT = "0123456789";
|
|
273
|
+
const ALPHABET = {
|
|
274
|
+
DIGIT,
|
|
275
|
+
ALPHA,
|
|
276
|
+
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
277
|
+
};
|
|
278
|
+
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
279
|
+
let str = "";
|
|
280
|
+
const { length } = alphabet;
|
|
281
|
+
while (size--) {
|
|
282
|
+
str += alphabet[Math.random() * length | 0];
|
|
283
|
+
}
|
|
284
|
+
return str;
|
|
285
|
+
};
|
|
286
|
+
function isSpecCompliantForm(thing) {
|
|
287
|
+
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
|
|
288
|
+
}
|
|
289
|
+
const toJSONObject = (obj) => {
|
|
290
|
+
const stack = new Array(10);
|
|
291
|
+
const visit = (source, i) => {
|
|
292
|
+
if (isObject(source)) {
|
|
293
|
+
if (stack.indexOf(source) >= 0) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
if (!("toJSON" in source)) {
|
|
297
|
+
stack[i] = source;
|
|
298
|
+
const target = isArray(source) ? [] : {};
|
|
299
|
+
forEach(source, (value, key) => {
|
|
300
|
+
const reducedValue = visit(value, i + 1);
|
|
301
|
+
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
302
|
+
});
|
|
303
|
+
stack[i] = void 0;
|
|
304
|
+
return target;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return source;
|
|
308
|
+
};
|
|
309
|
+
return visit(obj, 0);
|
|
310
|
+
};
|
|
311
|
+
const isAsyncFn = kindOfTest("AsyncFunction");
|
|
312
|
+
const isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
313
|
+
const utils$1 = {
|
|
314
|
+
isArray,
|
|
315
|
+
isArrayBuffer,
|
|
316
|
+
isBuffer,
|
|
317
|
+
isFormData,
|
|
318
|
+
isArrayBufferView,
|
|
319
|
+
isString,
|
|
320
|
+
isNumber,
|
|
321
|
+
isBoolean,
|
|
322
|
+
isObject,
|
|
323
|
+
isPlainObject,
|
|
324
|
+
isUndefined,
|
|
325
|
+
isDate,
|
|
326
|
+
isFile,
|
|
327
|
+
isBlob,
|
|
328
|
+
isRegExp,
|
|
329
|
+
isFunction,
|
|
330
|
+
isStream,
|
|
331
|
+
isURLSearchParams,
|
|
332
|
+
isTypedArray,
|
|
333
|
+
isFileList,
|
|
334
|
+
forEach,
|
|
335
|
+
merge,
|
|
336
|
+
extend,
|
|
337
|
+
trim,
|
|
338
|
+
stripBOM,
|
|
339
|
+
inherits,
|
|
340
|
+
toFlatObject,
|
|
341
|
+
kindOf,
|
|
342
|
+
kindOfTest,
|
|
343
|
+
endsWith,
|
|
344
|
+
toArray,
|
|
345
|
+
forEachEntry,
|
|
346
|
+
matchAll,
|
|
347
|
+
isHTMLForm,
|
|
348
|
+
hasOwnProperty,
|
|
349
|
+
hasOwnProp: hasOwnProperty,
|
|
350
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
351
|
+
reduceDescriptors,
|
|
352
|
+
freezeMethods,
|
|
353
|
+
toObjectSet,
|
|
354
|
+
toCamelCase,
|
|
355
|
+
noop,
|
|
356
|
+
toFiniteNumber,
|
|
357
|
+
findKey,
|
|
358
|
+
global: _global,
|
|
359
|
+
isContextDefined,
|
|
360
|
+
ALPHABET,
|
|
361
|
+
generateString,
|
|
362
|
+
isSpecCompliantForm,
|
|
363
|
+
toJSONObject,
|
|
364
|
+
isAsyncFn,
|
|
365
|
+
isThenable
|
|
366
|
+
};
|
|
367
|
+
function AxiosError(message, code, config, request, response) {
|
|
368
|
+
Error.call(this);
|
|
369
|
+
if (Error.captureStackTrace) {
|
|
370
|
+
Error.captureStackTrace(this, this.constructor);
|
|
371
|
+
} else {
|
|
372
|
+
this.stack = new Error().stack;
|
|
373
|
+
}
|
|
374
|
+
this.message = message;
|
|
375
|
+
this.name = "AxiosError";
|
|
376
|
+
code && (this.code = code);
|
|
377
|
+
config && (this.config = config);
|
|
378
|
+
request && (this.request = request);
|
|
379
|
+
response && (this.response = response);
|
|
380
|
+
}
|
|
381
|
+
utils$1.inherits(AxiosError, Error, {
|
|
382
|
+
toJSON: function toJSON() {
|
|
383
|
+
return {
|
|
384
|
+
// Standard
|
|
385
|
+
message: this.message,
|
|
386
|
+
name: this.name,
|
|
387
|
+
// Microsoft
|
|
388
|
+
description: this.description,
|
|
389
|
+
number: this.number,
|
|
390
|
+
// Mozilla
|
|
391
|
+
fileName: this.fileName,
|
|
392
|
+
lineNumber: this.lineNumber,
|
|
393
|
+
columnNumber: this.columnNumber,
|
|
394
|
+
stack: this.stack,
|
|
395
|
+
// Axios
|
|
396
|
+
config: utils$1.toJSONObject(this.config),
|
|
397
|
+
code: this.code,
|
|
398
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
const prototype$1 = AxiosError.prototype;
|
|
403
|
+
const descriptors = {};
|
|
404
|
+
[
|
|
405
|
+
"ERR_BAD_OPTION_VALUE",
|
|
406
|
+
"ERR_BAD_OPTION",
|
|
407
|
+
"ECONNABORTED",
|
|
408
|
+
"ETIMEDOUT",
|
|
409
|
+
"ERR_NETWORK",
|
|
410
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
411
|
+
"ERR_DEPRECATED",
|
|
412
|
+
"ERR_BAD_RESPONSE",
|
|
413
|
+
"ERR_BAD_REQUEST",
|
|
414
|
+
"ERR_CANCELED",
|
|
415
|
+
"ERR_NOT_SUPPORT",
|
|
416
|
+
"ERR_INVALID_URL"
|
|
417
|
+
// eslint-disable-next-line func-names
|
|
418
|
+
].forEach((code) => {
|
|
419
|
+
descriptors[code] = { value: code };
|
|
420
|
+
});
|
|
421
|
+
Object.defineProperties(AxiosError, descriptors);
|
|
422
|
+
Object.defineProperty(prototype$1, "isAxiosError", { value: true });
|
|
423
|
+
AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
424
|
+
const axiosError = Object.create(prototype$1);
|
|
425
|
+
utils$1.toFlatObject(error, axiosError, function filter(obj) {
|
|
426
|
+
return obj !== Error.prototype;
|
|
427
|
+
}, (prop) => {
|
|
428
|
+
return prop !== "isAxiosError";
|
|
429
|
+
});
|
|
430
|
+
AxiosError.call(axiosError, error.message, code, config, request, response);
|
|
431
|
+
axiosError.cause = error;
|
|
432
|
+
axiosError.name = error.name;
|
|
433
|
+
customProps && Object.assign(axiosError, customProps);
|
|
434
|
+
return axiosError;
|
|
435
|
+
};
|
|
436
|
+
const httpAdapter = null;
|
|
437
|
+
function isVisitable(thing) {
|
|
438
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
439
|
+
}
|
|
440
|
+
function removeBrackets(key) {
|
|
441
|
+
return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
442
|
+
}
|
|
443
|
+
function renderKey(path, key, dots) {
|
|
444
|
+
if (!path)
|
|
445
|
+
return key;
|
|
446
|
+
return path.concat(key).map(function each(token, i) {
|
|
447
|
+
token = removeBrackets(token);
|
|
448
|
+
return !dots && i ? "[" + token + "]" : token;
|
|
449
|
+
}).join(dots ? "." : "");
|
|
450
|
+
}
|
|
451
|
+
function isFlatArray(arr) {
|
|
452
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
|
453
|
+
}
|
|
454
|
+
const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
|
455
|
+
return /^is[A-Z]/.test(prop);
|
|
456
|
+
});
|
|
457
|
+
function toFormData(obj, formData, options) {
|
|
458
|
+
if (!utils$1.isObject(obj)) {
|
|
459
|
+
throw new TypeError("target must be an object");
|
|
460
|
+
}
|
|
461
|
+
formData = formData || new FormData();
|
|
462
|
+
options = utils$1.toFlatObject(options, {
|
|
463
|
+
metaTokens: true,
|
|
464
|
+
dots: false,
|
|
465
|
+
indexes: false
|
|
466
|
+
}, false, function defined(option, source) {
|
|
467
|
+
return !utils$1.isUndefined(source[option]);
|
|
468
|
+
});
|
|
469
|
+
const metaTokens = options.metaTokens;
|
|
470
|
+
const visitor = options.visitor || defaultVisitor;
|
|
471
|
+
const dots = options.dots;
|
|
472
|
+
const indexes = options.indexes;
|
|
473
|
+
const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
|
|
474
|
+
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
475
|
+
if (!utils$1.isFunction(visitor)) {
|
|
476
|
+
throw new TypeError("visitor must be a function");
|
|
477
|
+
}
|
|
478
|
+
function convertValue(value) {
|
|
479
|
+
if (value === null)
|
|
480
|
+
return "";
|
|
481
|
+
if (utils$1.isDate(value)) {
|
|
482
|
+
return value.toISOString();
|
|
483
|
+
}
|
|
484
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
|
485
|
+
throw new AxiosError("Blob is not supported. Use a Buffer instead.");
|
|
486
|
+
}
|
|
487
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
488
|
+
return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
489
|
+
}
|
|
490
|
+
return value;
|
|
491
|
+
}
|
|
492
|
+
function defaultVisitor(value, key, path) {
|
|
493
|
+
let arr = value;
|
|
494
|
+
if (value && !path && typeof value === "object") {
|
|
495
|
+
if (utils$1.endsWith(key, "{}")) {
|
|
496
|
+
key = metaTokens ? key : key.slice(0, -2);
|
|
497
|
+
value = JSON.stringify(value);
|
|
498
|
+
} else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
|
|
499
|
+
key = removeBrackets(key);
|
|
500
|
+
arr.forEach(function each(el, index) {
|
|
501
|
+
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
|
502
|
+
// eslint-disable-next-line no-nested-ternary
|
|
503
|
+
indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
|
|
504
|
+
convertValue(el)
|
|
505
|
+
);
|
|
506
|
+
});
|
|
507
|
+
return false;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
if (isVisitable(value)) {
|
|
511
|
+
return true;
|
|
512
|
+
}
|
|
513
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
514
|
+
return false;
|
|
515
|
+
}
|
|
516
|
+
const stack = [];
|
|
517
|
+
const exposedHelpers = Object.assign(predicates, {
|
|
518
|
+
defaultVisitor,
|
|
519
|
+
convertValue,
|
|
520
|
+
isVisitable
|
|
521
|
+
});
|
|
522
|
+
function build(value, path) {
|
|
523
|
+
if (utils$1.isUndefined(value))
|
|
524
|
+
return;
|
|
525
|
+
if (stack.indexOf(value) !== -1) {
|
|
526
|
+
throw Error("Circular reference detected in " + path.join("."));
|
|
527
|
+
}
|
|
528
|
+
stack.push(value);
|
|
529
|
+
utils$1.forEach(value, function each(el, key) {
|
|
530
|
+
const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
|
|
531
|
+
formData,
|
|
532
|
+
el,
|
|
533
|
+
utils$1.isString(key) ? key.trim() : key,
|
|
534
|
+
path,
|
|
535
|
+
exposedHelpers
|
|
536
|
+
);
|
|
537
|
+
if (result === true) {
|
|
538
|
+
build(el, path ? path.concat(key) : [key]);
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
stack.pop();
|
|
542
|
+
}
|
|
543
|
+
if (!utils$1.isObject(obj)) {
|
|
544
|
+
throw new TypeError("data must be an object");
|
|
545
|
+
}
|
|
546
|
+
build(obj);
|
|
547
|
+
return formData;
|
|
548
|
+
}
|
|
549
|
+
function encode$1(str) {
|
|
550
|
+
const charMap = {
|
|
551
|
+
"!": "%21",
|
|
552
|
+
"'": "%27",
|
|
553
|
+
"(": "%28",
|
|
554
|
+
")": "%29",
|
|
555
|
+
"~": "%7E",
|
|
556
|
+
"%20": "+",
|
|
557
|
+
"%00": "\0"
|
|
558
|
+
};
|
|
559
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
560
|
+
return charMap[match];
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
function AxiosURLSearchParams(params, options) {
|
|
564
|
+
this._pairs = [];
|
|
565
|
+
params && toFormData(params, this, options);
|
|
566
|
+
}
|
|
567
|
+
const prototype = AxiosURLSearchParams.prototype;
|
|
568
|
+
prototype.append = function append(name, value) {
|
|
569
|
+
this._pairs.push([name, value]);
|
|
570
|
+
};
|
|
571
|
+
prototype.toString = function toString2(encoder) {
|
|
572
|
+
const _encode = encoder ? function(value) {
|
|
573
|
+
return encoder.call(this, value, encode$1);
|
|
574
|
+
} : encode$1;
|
|
575
|
+
return this._pairs.map(function each(pair) {
|
|
576
|
+
return _encode(pair[0]) + "=" + _encode(pair[1]);
|
|
577
|
+
}, "").join("&");
|
|
578
|
+
};
|
|
579
|
+
function encode(val) {
|
|
580
|
+
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
581
|
+
}
|
|
582
|
+
function buildURL(url, params, options) {
|
|
583
|
+
if (!params) {
|
|
584
|
+
return url;
|
|
585
|
+
}
|
|
586
|
+
const _encode = options && options.encode || encode;
|
|
587
|
+
const serializeFn = options && options.serialize;
|
|
588
|
+
let serializedParams;
|
|
589
|
+
if (serializeFn) {
|
|
590
|
+
serializedParams = serializeFn(params, options);
|
|
591
|
+
} else {
|
|
592
|
+
serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
|
|
593
|
+
}
|
|
594
|
+
if (serializedParams) {
|
|
595
|
+
const hashmarkIndex = url.indexOf("#");
|
|
596
|
+
if (hashmarkIndex !== -1) {
|
|
597
|
+
url = url.slice(0, hashmarkIndex);
|
|
598
|
+
}
|
|
599
|
+
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
600
|
+
}
|
|
601
|
+
return url;
|
|
602
|
+
}
|
|
603
|
+
class InterceptorManager {
|
|
604
|
+
constructor() {
|
|
605
|
+
this.handlers = [];
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Add a new interceptor to the stack
|
|
609
|
+
*
|
|
610
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
611
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
612
|
+
*
|
|
613
|
+
* @return {Number} An ID used to remove interceptor later
|
|
614
|
+
*/
|
|
615
|
+
use(fulfilled, rejected, options) {
|
|
616
|
+
this.handlers.push({
|
|
617
|
+
fulfilled,
|
|
618
|
+
rejected,
|
|
619
|
+
synchronous: options ? options.synchronous : false,
|
|
620
|
+
runWhen: options ? options.runWhen : null
|
|
621
|
+
});
|
|
622
|
+
return this.handlers.length - 1;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Remove an interceptor from the stack
|
|
626
|
+
*
|
|
627
|
+
* @param {Number} id The ID that was returned by `use`
|
|
628
|
+
*
|
|
629
|
+
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
|
|
630
|
+
*/
|
|
631
|
+
eject(id) {
|
|
632
|
+
if (this.handlers[id]) {
|
|
633
|
+
this.handlers[id] = null;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Clear all interceptors from the stack
|
|
638
|
+
*
|
|
639
|
+
* @returns {void}
|
|
640
|
+
*/
|
|
641
|
+
clear() {
|
|
642
|
+
if (this.handlers) {
|
|
643
|
+
this.handlers = [];
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Iterate over all the registered interceptors
|
|
648
|
+
*
|
|
649
|
+
* This method is particularly useful for skipping over any
|
|
650
|
+
* interceptors that may have become `null` calling `eject`.
|
|
651
|
+
*
|
|
652
|
+
* @param {Function} fn The function to call for each interceptor
|
|
653
|
+
*
|
|
654
|
+
* @returns {void}
|
|
655
|
+
*/
|
|
656
|
+
forEach(fn) {
|
|
657
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
|
658
|
+
if (h !== null) {
|
|
659
|
+
fn(h);
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
const transitionalDefaults = {
|
|
665
|
+
silentJSONParsing: true,
|
|
666
|
+
forcedJSONParsing: true,
|
|
667
|
+
clarifyTimeoutError: false
|
|
668
|
+
};
|
|
669
|
+
const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
|
|
670
|
+
const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
|
|
671
|
+
const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
|
|
672
|
+
const platform$1 = {
|
|
673
|
+
isBrowser: true,
|
|
674
|
+
classes: {
|
|
675
|
+
URLSearchParams: URLSearchParams$1,
|
|
676
|
+
FormData: FormData$1,
|
|
677
|
+
Blob: Blob$1
|
|
678
|
+
},
|
|
679
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
680
|
+
};
|
|
681
|
+
const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
|
|
682
|
+
const hasStandardBrowserEnv = ((product) => {
|
|
683
|
+
return hasBrowserEnv && ["ReactNative", "NativeScript", "NS"].indexOf(product) < 0;
|
|
684
|
+
})(typeof navigator !== "undefined" && navigator.product);
|
|
685
|
+
const hasStandardBrowserWebWorkerEnv = (() => {
|
|
686
|
+
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
687
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
688
|
+
})();
|
|
689
|
+
const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
690
|
+
__proto__: null,
|
|
691
|
+
hasBrowserEnv,
|
|
692
|
+
hasStandardBrowserEnv,
|
|
693
|
+
hasStandardBrowserWebWorkerEnv
|
|
694
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
695
|
+
const platform = {
|
|
696
|
+
...utils,
|
|
697
|
+
...platform$1
|
|
698
|
+
};
|
|
699
|
+
function toURLEncodedForm(data, options) {
|
|
700
|
+
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
|
701
|
+
visitor: function(value, key, path, helpers) {
|
|
702
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
703
|
+
this.append(key, value.toString("base64"));
|
|
704
|
+
return false;
|
|
705
|
+
}
|
|
706
|
+
return helpers.defaultVisitor.apply(this, arguments);
|
|
707
|
+
}
|
|
708
|
+
}, options));
|
|
709
|
+
}
|
|
710
|
+
function parsePropPath(name) {
|
|
711
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
712
|
+
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
function arrayToObject(arr) {
|
|
716
|
+
const obj = {};
|
|
717
|
+
const keys = Object.keys(arr);
|
|
718
|
+
let i;
|
|
719
|
+
const len = keys.length;
|
|
720
|
+
let key;
|
|
721
|
+
for (i = 0; i < len; i++) {
|
|
722
|
+
key = keys[i];
|
|
723
|
+
obj[key] = arr[key];
|
|
724
|
+
}
|
|
725
|
+
return obj;
|
|
726
|
+
}
|
|
727
|
+
function formDataToJSON(formData) {
|
|
728
|
+
function buildPath(path, value, target, index) {
|
|
729
|
+
let name = path[index++];
|
|
730
|
+
if (name === "__proto__")
|
|
731
|
+
return true;
|
|
732
|
+
const isNumericKey = Number.isFinite(+name);
|
|
733
|
+
const isLast = index >= path.length;
|
|
734
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
|
735
|
+
if (isLast) {
|
|
736
|
+
if (utils$1.hasOwnProp(target, name)) {
|
|
737
|
+
target[name] = [target[name], value];
|
|
738
|
+
} else {
|
|
739
|
+
target[name] = value;
|
|
740
|
+
}
|
|
741
|
+
return !isNumericKey;
|
|
742
|
+
}
|
|
743
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
|
744
|
+
target[name] = [];
|
|
745
|
+
}
|
|
746
|
+
const result = buildPath(path, value, target[name], index);
|
|
747
|
+
if (result && utils$1.isArray(target[name])) {
|
|
748
|
+
target[name] = arrayToObject(target[name]);
|
|
749
|
+
}
|
|
750
|
+
return !isNumericKey;
|
|
751
|
+
}
|
|
752
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
|
753
|
+
const obj = {};
|
|
754
|
+
utils$1.forEachEntry(formData, (name, value) => {
|
|
755
|
+
buildPath(parsePropPath(name), value, obj, 0);
|
|
756
|
+
});
|
|
757
|
+
return obj;
|
|
758
|
+
}
|
|
759
|
+
return null;
|
|
760
|
+
}
|
|
761
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
762
|
+
if (utils$1.isString(rawValue)) {
|
|
763
|
+
try {
|
|
764
|
+
(parser || JSON.parse)(rawValue);
|
|
765
|
+
return utils$1.trim(rawValue);
|
|
766
|
+
} catch (e) {
|
|
767
|
+
if (e.name !== "SyntaxError") {
|
|
768
|
+
throw e;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
773
|
+
}
|
|
774
|
+
const defaults = {
|
|
775
|
+
transitional: transitionalDefaults,
|
|
776
|
+
adapter: ["xhr", "http"],
|
|
777
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
778
|
+
const contentType = headers.getContentType() || "";
|
|
779
|
+
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
780
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
781
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
782
|
+
data = new FormData(data);
|
|
783
|
+
}
|
|
784
|
+
const isFormData2 = utils$1.isFormData(data);
|
|
785
|
+
if (isFormData2) {
|
|
786
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
787
|
+
}
|
|
788
|
+
if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data)) {
|
|
789
|
+
return data;
|
|
790
|
+
}
|
|
791
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
792
|
+
return data.buffer;
|
|
793
|
+
}
|
|
794
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
795
|
+
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
796
|
+
return data.toString();
|
|
797
|
+
}
|
|
798
|
+
let isFileList2;
|
|
799
|
+
if (isObjectPayload) {
|
|
800
|
+
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
801
|
+
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
802
|
+
}
|
|
803
|
+
if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
804
|
+
const _FormData = this.env && this.env.FormData;
|
|
805
|
+
return toFormData(
|
|
806
|
+
isFileList2 ? { "files[]": data } : data,
|
|
807
|
+
_FormData && new _FormData(),
|
|
808
|
+
this.formSerializer
|
|
809
|
+
);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
813
|
+
headers.setContentType("application/json", false);
|
|
814
|
+
return stringifySafely(data);
|
|
815
|
+
}
|
|
816
|
+
return data;
|
|
817
|
+
}],
|
|
818
|
+
transformResponse: [function transformResponse(data) {
|
|
819
|
+
const transitional = this.transitional || defaults.transitional;
|
|
820
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
821
|
+
const JSONRequested = this.responseType === "json";
|
|
822
|
+
if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
823
|
+
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
824
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
825
|
+
try {
|
|
826
|
+
return JSON.parse(data);
|
|
827
|
+
} catch (e) {
|
|
828
|
+
if (strictJSONParsing) {
|
|
829
|
+
if (e.name === "SyntaxError") {
|
|
830
|
+
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
|
|
831
|
+
}
|
|
832
|
+
throw e;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
return data;
|
|
837
|
+
}],
|
|
838
|
+
/**
|
|
839
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
840
|
+
* timeout is not created.
|
|
841
|
+
*/
|
|
842
|
+
timeout: 0,
|
|
843
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
844
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
845
|
+
maxContentLength: -1,
|
|
846
|
+
maxBodyLength: -1,
|
|
847
|
+
env: {
|
|
848
|
+
FormData: platform.classes.FormData,
|
|
849
|
+
Blob: platform.classes.Blob
|
|
850
|
+
},
|
|
851
|
+
validateStatus: function validateStatus(status) {
|
|
852
|
+
return status >= 200 && status < 300;
|
|
853
|
+
},
|
|
854
|
+
headers: {
|
|
855
|
+
common: {
|
|
856
|
+
"Accept": "application/json, text/plain, */*",
|
|
857
|
+
"Content-Type": void 0
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
|
|
862
|
+
defaults.headers[method] = {};
|
|
863
|
+
});
|
|
864
|
+
const defaults$1 = defaults;
|
|
865
|
+
const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
866
|
+
"age",
|
|
867
|
+
"authorization",
|
|
868
|
+
"content-length",
|
|
869
|
+
"content-type",
|
|
870
|
+
"etag",
|
|
871
|
+
"expires",
|
|
872
|
+
"from",
|
|
873
|
+
"host",
|
|
874
|
+
"if-modified-since",
|
|
875
|
+
"if-unmodified-since",
|
|
876
|
+
"last-modified",
|
|
877
|
+
"location",
|
|
878
|
+
"max-forwards",
|
|
879
|
+
"proxy-authorization",
|
|
880
|
+
"referer",
|
|
881
|
+
"retry-after",
|
|
882
|
+
"user-agent"
|
|
883
|
+
]);
|
|
884
|
+
const parseHeaders = (rawHeaders) => {
|
|
885
|
+
const parsed = {};
|
|
886
|
+
let key;
|
|
887
|
+
let val;
|
|
888
|
+
let i;
|
|
889
|
+
rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
|
|
890
|
+
i = line.indexOf(":");
|
|
891
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
892
|
+
val = line.substring(i + 1).trim();
|
|
893
|
+
if (!key || parsed[key] && ignoreDuplicateOf[key]) {
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
if (key === "set-cookie") {
|
|
897
|
+
if (parsed[key]) {
|
|
898
|
+
parsed[key].push(val);
|
|
899
|
+
} else {
|
|
900
|
+
parsed[key] = [val];
|
|
901
|
+
}
|
|
902
|
+
} else {
|
|
903
|
+
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
904
|
+
}
|
|
905
|
+
});
|
|
906
|
+
return parsed;
|
|
907
|
+
};
|
|
908
|
+
const $internals = Symbol("internals");
|
|
909
|
+
function normalizeHeader(header) {
|
|
910
|
+
return header && String(header).trim().toLowerCase();
|
|
911
|
+
}
|
|
912
|
+
function normalizeValue(value) {
|
|
913
|
+
if (value === false || value == null) {
|
|
914
|
+
return value;
|
|
915
|
+
}
|
|
916
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
917
|
+
}
|
|
918
|
+
function parseTokens(str) {
|
|
919
|
+
const tokens = /* @__PURE__ */ Object.create(null);
|
|
920
|
+
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
921
|
+
let match;
|
|
922
|
+
while (match = tokensRE.exec(str)) {
|
|
923
|
+
tokens[match[1]] = match[2];
|
|
924
|
+
}
|
|
925
|
+
return tokens;
|
|
926
|
+
}
|
|
927
|
+
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
928
|
+
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
929
|
+
if (utils$1.isFunction(filter)) {
|
|
930
|
+
return filter.call(this, value, header);
|
|
931
|
+
}
|
|
932
|
+
if (isHeaderNameFilter) {
|
|
933
|
+
value = header;
|
|
934
|
+
}
|
|
935
|
+
if (!utils$1.isString(value))
|
|
936
|
+
return;
|
|
937
|
+
if (utils$1.isString(filter)) {
|
|
938
|
+
return value.indexOf(filter) !== -1;
|
|
939
|
+
}
|
|
940
|
+
if (utils$1.isRegExp(filter)) {
|
|
941
|
+
return filter.test(value);
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
function formatHeader(header) {
|
|
945
|
+
return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
946
|
+
return char.toUpperCase() + str;
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
function buildAccessors(obj, header) {
|
|
950
|
+
const accessorName = utils$1.toCamelCase(" " + header);
|
|
951
|
+
["get", "set", "has"].forEach((methodName) => {
|
|
952
|
+
Object.defineProperty(obj, methodName + accessorName, {
|
|
953
|
+
value: function(arg1, arg2, arg3) {
|
|
954
|
+
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
955
|
+
},
|
|
956
|
+
configurable: true
|
|
957
|
+
});
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
class AxiosHeaders {
|
|
961
|
+
constructor(headers) {
|
|
962
|
+
headers && this.set(headers);
|
|
963
|
+
}
|
|
964
|
+
set(header, valueOrRewrite, rewrite) {
|
|
965
|
+
const self2 = this;
|
|
966
|
+
function setHeader(_value, _header, _rewrite) {
|
|
967
|
+
const lHeader = normalizeHeader(_header);
|
|
968
|
+
if (!lHeader) {
|
|
969
|
+
throw new Error("header name must be a non-empty string");
|
|
970
|
+
}
|
|
971
|
+
const key = utils$1.findKey(self2, lHeader);
|
|
972
|
+
if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
|
|
973
|
+
self2[key || _header] = normalizeValue(_value);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
977
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
978
|
+
setHeaders(header, valueOrRewrite);
|
|
979
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
980
|
+
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
981
|
+
} else {
|
|
982
|
+
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
983
|
+
}
|
|
984
|
+
return this;
|
|
985
|
+
}
|
|
986
|
+
get(header, parser) {
|
|
987
|
+
header = normalizeHeader(header);
|
|
988
|
+
if (header) {
|
|
989
|
+
const key = utils$1.findKey(this, header);
|
|
990
|
+
if (key) {
|
|
991
|
+
const value = this[key];
|
|
992
|
+
if (!parser) {
|
|
993
|
+
return value;
|
|
994
|
+
}
|
|
995
|
+
if (parser === true) {
|
|
996
|
+
return parseTokens(value);
|
|
997
|
+
}
|
|
998
|
+
if (utils$1.isFunction(parser)) {
|
|
999
|
+
return parser.call(this, value, key);
|
|
1000
|
+
}
|
|
1001
|
+
if (utils$1.isRegExp(parser)) {
|
|
1002
|
+
return parser.exec(value);
|
|
1003
|
+
}
|
|
1004
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
has(header, matcher) {
|
|
1009
|
+
header = normalizeHeader(header);
|
|
1010
|
+
if (header) {
|
|
1011
|
+
const key = utils$1.findKey(this, header);
|
|
1012
|
+
return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
1013
|
+
}
|
|
1014
|
+
return false;
|
|
1015
|
+
}
|
|
1016
|
+
delete(header, matcher) {
|
|
1017
|
+
const self2 = this;
|
|
1018
|
+
let deleted = false;
|
|
1019
|
+
function deleteHeader(_header) {
|
|
1020
|
+
_header = normalizeHeader(_header);
|
|
1021
|
+
if (_header) {
|
|
1022
|
+
const key = utils$1.findKey(self2, _header);
|
|
1023
|
+
if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
|
|
1024
|
+
delete self2[key];
|
|
1025
|
+
deleted = true;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
if (utils$1.isArray(header)) {
|
|
1030
|
+
header.forEach(deleteHeader);
|
|
1031
|
+
} else {
|
|
1032
|
+
deleteHeader(header);
|
|
1033
|
+
}
|
|
1034
|
+
return deleted;
|
|
1035
|
+
}
|
|
1036
|
+
clear(matcher) {
|
|
1037
|
+
const keys = Object.keys(this);
|
|
1038
|
+
let i = keys.length;
|
|
1039
|
+
let deleted = false;
|
|
1040
|
+
while (i--) {
|
|
1041
|
+
const key = keys[i];
|
|
1042
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
1043
|
+
delete this[key];
|
|
1044
|
+
deleted = true;
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
return deleted;
|
|
1048
|
+
}
|
|
1049
|
+
normalize(format) {
|
|
1050
|
+
const self2 = this;
|
|
1051
|
+
const headers = {};
|
|
1052
|
+
utils$1.forEach(this, (value, header) => {
|
|
1053
|
+
const key = utils$1.findKey(headers, header);
|
|
1054
|
+
if (key) {
|
|
1055
|
+
self2[key] = normalizeValue(value);
|
|
1056
|
+
delete self2[header];
|
|
1057
|
+
return;
|
|
1058
|
+
}
|
|
1059
|
+
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
1060
|
+
if (normalized !== header) {
|
|
1061
|
+
delete self2[header];
|
|
1062
|
+
}
|
|
1063
|
+
self2[normalized] = normalizeValue(value);
|
|
1064
|
+
headers[normalized] = true;
|
|
1065
|
+
});
|
|
1066
|
+
return this;
|
|
1067
|
+
}
|
|
1068
|
+
concat(...targets) {
|
|
1069
|
+
return this.constructor.concat(this, ...targets);
|
|
1070
|
+
}
|
|
1071
|
+
toJSON(asStrings) {
|
|
1072
|
+
const obj = /* @__PURE__ */ Object.create(null);
|
|
1073
|
+
utils$1.forEach(this, (value, header) => {
|
|
1074
|
+
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
|
|
1075
|
+
});
|
|
1076
|
+
return obj;
|
|
1077
|
+
}
|
|
1078
|
+
[Symbol.iterator]() {
|
|
1079
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
1080
|
+
}
|
|
1081
|
+
toString() {
|
|
1082
|
+
return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
|
|
1083
|
+
}
|
|
1084
|
+
get [Symbol.toStringTag]() {
|
|
1085
|
+
return "AxiosHeaders";
|
|
1086
|
+
}
|
|
1087
|
+
static from(thing) {
|
|
1088
|
+
return thing instanceof this ? thing : new this(thing);
|
|
1089
|
+
}
|
|
1090
|
+
static concat(first, ...targets) {
|
|
1091
|
+
const computed = new this(first);
|
|
1092
|
+
targets.forEach((target) => computed.set(target));
|
|
1093
|
+
return computed;
|
|
1094
|
+
}
|
|
1095
|
+
static accessor(header) {
|
|
1096
|
+
const internals = this[$internals] = this[$internals] = {
|
|
1097
|
+
accessors: {}
|
|
1098
|
+
};
|
|
1099
|
+
const accessors = internals.accessors;
|
|
1100
|
+
const prototype2 = this.prototype;
|
|
1101
|
+
function defineAccessor(_header) {
|
|
1102
|
+
const lHeader = normalizeHeader(_header);
|
|
1103
|
+
if (!accessors[lHeader]) {
|
|
1104
|
+
buildAccessors(prototype2, _header);
|
|
1105
|
+
accessors[lHeader] = true;
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
1109
|
+
return this;
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
1113
|
+
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
1114
|
+
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
1115
|
+
return {
|
|
1116
|
+
get: () => value,
|
|
1117
|
+
set(headerValue) {
|
|
1118
|
+
this[mapped] = headerValue;
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
});
|
|
1122
|
+
utils$1.freezeMethods(AxiosHeaders);
|
|
1123
|
+
const AxiosHeaders$1 = AxiosHeaders;
|
|
1124
|
+
function transformData(fns, response) {
|
|
1125
|
+
const config = this || defaults$1;
|
|
1126
|
+
const context = response || config;
|
|
1127
|
+
const headers = AxiosHeaders$1.from(context.headers);
|
|
1128
|
+
let data = context.data;
|
|
1129
|
+
utils$1.forEach(fns, function transform(fn) {
|
|
1130
|
+
data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
|
|
1131
|
+
});
|
|
1132
|
+
headers.normalize();
|
|
1133
|
+
return data;
|
|
1134
|
+
}
|
|
1135
|
+
function isCancel(value) {
|
|
1136
|
+
return !!(value && value.__CANCEL__);
|
|
1137
|
+
}
|
|
1138
|
+
function CanceledError(message, config, request) {
|
|
1139
|
+
AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config, request);
|
|
1140
|
+
this.name = "CanceledError";
|
|
1141
|
+
}
|
|
1142
|
+
utils$1.inherits(CanceledError, AxiosError, {
|
|
1143
|
+
__CANCEL__: true
|
|
1144
|
+
});
|
|
1145
|
+
function settle(resolve, reject, response) {
|
|
1146
|
+
const validateStatus = response.config.validateStatus;
|
|
1147
|
+
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
1148
|
+
resolve(response);
|
|
1149
|
+
} else {
|
|
1150
|
+
reject(new AxiosError(
|
|
1151
|
+
"Request failed with status code " + response.status,
|
|
1152
|
+
[AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
1153
|
+
response.config,
|
|
1154
|
+
response.request,
|
|
1155
|
+
response
|
|
1156
|
+
));
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
const cookies = platform.hasStandardBrowserEnv ? (
|
|
1160
|
+
// Standard browser envs support document.cookie
|
|
1161
|
+
{
|
|
1162
|
+
write(name, value, expires, path, domain, secure) {
|
|
1163
|
+
const cookie = [name + "=" + encodeURIComponent(value)];
|
|
1164
|
+
utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
|
|
1165
|
+
utils$1.isString(path) && cookie.push("path=" + path);
|
|
1166
|
+
utils$1.isString(domain) && cookie.push("domain=" + domain);
|
|
1167
|
+
secure === true && cookie.push("secure");
|
|
1168
|
+
document.cookie = cookie.join("; ");
|
|
1169
|
+
},
|
|
1170
|
+
read(name) {
|
|
1171
|
+
const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
1172
|
+
return match ? decodeURIComponent(match[3]) : null;
|
|
1173
|
+
},
|
|
1174
|
+
remove(name) {
|
|
1175
|
+
this.write(name, "", Date.now() - 864e5);
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
) : (
|
|
1179
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
1180
|
+
{
|
|
1181
|
+
write() {
|
|
1182
|
+
},
|
|
1183
|
+
read() {
|
|
1184
|
+
return null;
|
|
1185
|
+
},
|
|
1186
|
+
remove() {
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
);
|
|
1190
|
+
function isAbsoluteURL(url) {
|
|
1191
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
1192
|
+
}
|
|
1193
|
+
function combineURLs(baseURL, relativeURL) {
|
|
1194
|
+
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
1195
|
+
}
|
|
1196
|
+
function buildFullPath(baseURL, requestedURL) {
|
|
1197
|
+
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
1198
|
+
return combineURLs(baseURL, requestedURL);
|
|
1199
|
+
}
|
|
1200
|
+
return requestedURL;
|
|
1201
|
+
}
|
|
1202
|
+
const isURLSameOrigin = platform.hasStandardBrowserEnv ? (
|
|
1203
|
+
// Standard browser envs have full support of the APIs needed to test
|
|
1204
|
+
// whether the request URL is of the same origin as current location.
|
|
1205
|
+
function standardBrowserEnv() {
|
|
1206
|
+
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
1207
|
+
const urlParsingNode = document.createElement("a");
|
|
1208
|
+
let originURL;
|
|
1209
|
+
function resolveURL(url) {
|
|
1210
|
+
let href = url;
|
|
1211
|
+
if (msie) {
|
|
1212
|
+
urlParsingNode.setAttribute("href", href);
|
|
1213
|
+
href = urlParsingNode.href;
|
|
1214
|
+
}
|
|
1215
|
+
urlParsingNode.setAttribute("href", href);
|
|
1216
|
+
return {
|
|
1217
|
+
href: urlParsingNode.href,
|
|
1218
|
+
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
|
|
1219
|
+
host: urlParsingNode.host,
|
|
1220
|
+
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
1221
|
+
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
1222
|
+
hostname: urlParsingNode.hostname,
|
|
1223
|
+
port: urlParsingNode.port,
|
|
1224
|
+
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
1225
|
+
};
|
|
1226
|
+
}
|
|
1227
|
+
originURL = resolveURL(window.location.href);
|
|
1228
|
+
return function isURLSameOrigin2(requestURL) {
|
|
1229
|
+
const parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
1230
|
+
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
1231
|
+
};
|
|
1232
|
+
}()
|
|
1233
|
+
) : (
|
|
1234
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
1235
|
+
/* @__PURE__ */ function nonStandardBrowserEnv() {
|
|
1236
|
+
return function isURLSameOrigin2() {
|
|
1237
|
+
return true;
|
|
1238
|
+
};
|
|
1239
|
+
}()
|
|
1240
|
+
);
|
|
1241
|
+
function parseProtocol(url) {
|
|
1242
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
1243
|
+
return match && match[1] || "";
|
|
1244
|
+
}
|
|
1245
|
+
function speedometer(samplesCount, min) {
|
|
1246
|
+
samplesCount = samplesCount || 10;
|
|
1247
|
+
const bytes = new Array(samplesCount);
|
|
1248
|
+
const timestamps = new Array(samplesCount);
|
|
1249
|
+
let head = 0;
|
|
1250
|
+
let tail = 0;
|
|
1251
|
+
let firstSampleTS;
|
|
1252
|
+
min = min !== void 0 ? min : 1e3;
|
|
1253
|
+
return function push(chunkLength) {
|
|
1254
|
+
const now = Date.now();
|
|
1255
|
+
const startedAt = timestamps[tail];
|
|
1256
|
+
if (!firstSampleTS) {
|
|
1257
|
+
firstSampleTS = now;
|
|
1258
|
+
}
|
|
1259
|
+
bytes[head] = chunkLength;
|
|
1260
|
+
timestamps[head] = now;
|
|
1261
|
+
let i = tail;
|
|
1262
|
+
let bytesCount = 0;
|
|
1263
|
+
while (i !== head) {
|
|
1264
|
+
bytesCount += bytes[i++];
|
|
1265
|
+
i = i % samplesCount;
|
|
1266
|
+
}
|
|
1267
|
+
head = (head + 1) % samplesCount;
|
|
1268
|
+
if (head === tail) {
|
|
1269
|
+
tail = (tail + 1) % samplesCount;
|
|
1270
|
+
}
|
|
1271
|
+
if (now - firstSampleTS < min) {
|
|
1272
|
+
return;
|
|
1273
|
+
}
|
|
1274
|
+
const passed = startedAt && now - startedAt;
|
|
1275
|
+
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
1276
|
+
};
|
|
1277
|
+
}
|
|
1278
|
+
function progressEventReducer(listener, isDownloadStream) {
|
|
1279
|
+
let bytesNotified = 0;
|
|
1280
|
+
const _speedometer = speedometer(50, 250);
|
|
1281
|
+
return (e) => {
|
|
1282
|
+
const loaded = e.loaded;
|
|
1283
|
+
const total = e.lengthComputable ? e.total : void 0;
|
|
1284
|
+
const progressBytes = loaded - bytesNotified;
|
|
1285
|
+
const rate = _speedometer(progressBytes);
|
|
1286
|
+
const inRange = loaded <= total;
|
|
1287
|
+
bytesNotified = loaded;
|
|
1288
|
+
const data = {
|
|
1289
|
+
loaded,
|
|
1290
|
+
total,
|
|
1291
|
+
progress: total ? loaded / total : void 0,
|
|
1292
|
+
bytes: progressBytes,
|
|
1293
|
+
rate: rate ? rate : void 0,
|
|
1294
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
1295
|
+
event: e
|
|
1296
|
+
};
|
|
1297
|
+
data[isDownloadStream ? "download" : "upload"] = true;
|
|
1298
|
+
listener(data);
|
|
1299
|
+
};
|
|
1300
|
+
}
|
|
1301
|
+
const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
1302
|
+
const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
1303
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
1304
|
+
let requestData = config.data;
|
|
1305
|
+
const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
|
|
1306
|
+
let { responseType, withXSRFToken } = config;
|
|
1307
|
+
let onCanceled;
|
|
1308
|
+
function done() {
|
|
1309
|
+
if (config.cancelToken) {
|
|
1310
|
+
config.cancelToken.unsubscribe(onCanceled);
|
|
1311
|
+
}
|
|
1312
|
+
if (config.signal) {
|
|
1313
|
+
config.signal.removeEventListener("abort", onCanceled);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
let contentType;
|
|
1317
|
+
if (utils$1.isFormData(requestData)) {
|
|
1318
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
1319
|
+
requestHeaders.setContentType(false);
|
|
1320
|
+
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
|
1321
|
+
const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
|
|
1322
|
+
requestHeaders.setContentType([type || "multipart/form-data", ...tokens].join("; "));
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
let request = new XMLHttpRequest();
|
|
1326
|
+
if (config.auth) {
|
|
1327
|
+
const username = config.auth.username || "";
|
|
1328
|
+
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
|
|
1329
|
+
requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
|
|
1330
|
+
}
|
|
1331
|
+
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
1332
|
+
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
1333
|
+
request.timeout = config.timeout;
|
|
1334
|
+
function onloadend() {
|
|
1335
|
+
if (!request) {
|
|
1336
|
+
return;
|
|
1337
|
+
}
|
|
1338
|
+
const responseHeaders = AxiosHeaders$1.from(
|
|
1339
|
+
"getAllResponseHeaders" in request && request.getAllResponseHeaders()
|
|
1340
|
+
);
|
|
1341
|
+
const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
|
|
1342
|
+
const response = {
|
|
1343
|
+
data: responseData,
|
|
1344
|
+
status: request.status,
|
|
1345
|
+
statusText: request.statusText,
|
|
1346
|
+
headers: responseHeaders,
|
|
1347
|
+
config,
|
|
1348
|
+
request
|
|
1349
|
+
};
|
|
1350
|
+
settle(function _resolve(value) {
|
|
1351
|
+
resolve(value);
|
|
1352
|
+
done();
|
|
1353
|
+
}, function _reject(err) {
|
|
1354
|
+
reject(err);
|
|
1355
|
+
done();
|
|
1356
|
+
}, response);
|
|
1357
|
+
request = null;
|
|
1358
|
+
}
|
|
1359
|
+
if ("onloadend" in request) {
|
|
1360
|
+
request.onloadend = onloadend;
|
|
1361
|
+
} else {
|
|
1362
|
+
request.onreadystatechange = function handleLoad() {
|
|
1363
|
+
if (!request || request.readyState !== 4) {
|
|
1364
|
+
return;
|
|
1365
|
+
}
|
|
1366
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
|
|
1367
|
+
return;
|
|
1368
|
+
}
|
|
1369
|
+
setTimeout(onloadend);
|
|
1370
|
+
};
|
|
1371
|
+
}
|
|
1372
|
+
request.onabort = function handleAbort() {
|
|
1373
|
+
if (!request) {
|
|
1374
|
+
return;
|
|
1375
|
+
}
|
|
1376
|
+
reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request));
|
|
1377
|
+
request = null;
|
|
1378
|
+
};
|
|
1379
|
+
request.onerror = function handleError() {
|
|
1380
|
+
reject(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request));
|
|
1381
|
+
request = null;
|
|
1382
|
+
};
|
|
1383
|
+
request.ontimeout = function handleTimeout() {
|
|
1384
|
+
let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
|
|
1385
|
+
const transitional = config.transitional || transitionalDefaults;
|
|
1386
|
+
if (config.timeoutErrorMessage) {
|
|
1387
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
1388
|
+
}
|
|
1389
|
+
reject(new AxiosError(
|
|
1390
|
+
timeoutErrorMessage,
|
|
1391
|
+
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
|
|
1392
|
+
config,
|
|
1393
|
+
request
|
|
1394
|
+
));
|
|
1395
|
+
request = null;
|
|
1396
|
+
};
|
|
1397
|
+
if (platform.hasStandardBrowserEnv) {
|
|
1398
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
|
1399
|
+
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(fullPath)) {
|
|
1400
|
+
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
|
1401
|
+
if (xsrfValue) {
|
|
1402
|
+
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
requestData === void 0 && requestHeaders.setContentType(null);
|
|
1407
|
+
if ("setRequestHeader" in request) {
|
|
1408
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
1409
|
+
request.setRequestHeader(key, val);
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
if (!utils$1.isUndefined(config.withCredentials)) {
|
|
1413
|
+
request.withCredentials = !!config.withCredentials;
|
|
1414
|
+
}
|
|
1415
|
+
if (responseType && responseType !== "json") {
|
|
1416
|
+
request.responseType = config.responseType;
|
|
1417
|
+
}
|
|
1418
|
+
if (typeof config.onDownloadProgress === "function") {
|
|
1419
|
+
request.addEventListener("progress", progressEventReducer(config.onDownloadProgress, true));
|
|
1420
|
+
}
|
|
1421
|
+
if (typeof config.onUploadProgress === "function" && request.upload) {
|
|
1422
|
+
request.upload.addEventListener("progress", progressEventReducer(config.onUploadProgress));
|
|
1423
|
+
}
|
|
1424
|
+
if (config.cancelToken || config.signal) {
|
|
1425
|
+
onCanceled = (cancel) => {
|
|
1426
|
+
if (!request) {
|
|
1427
|
+
return;
|
|
1428
|
+
}
|
|
1429
|
+
reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
|
|
1430
|
+
request.abort();
|
|
1431
|
+
request = null;
|
|
1432
|
+
};
|
|
1433
|
+
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
1434
|
+
if (config.signal) {
|
|
1435
|
+
config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
const protocol = parseProtocol(fullPath);
|
|
1439
|
+
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
1440
|
+
reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config));
|
|
1441
|
+
return;
|
|
1442
|
+
}
|
|
1443
|
+
request.send(requestData || null);
|
|
1444
|
+
});
|
|
1445
|
+
};
|
|
1446
|
+
const knownAdapters = {
|
|
1447
|
+
http: httpAdapter,
|
|
1448
|
+
xhr: xhrAdapter
|
|
1449
|
+
};
|
|
1450
|
+
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
1451
|
+
if (fn) {
|
|
1452
|
+
try {
|
|
1453
|
+
Object.defineProperty(fn, "name", { value });
|
|
1454
|
+
} catch (e) {
|
|
1455
|
+
}
|
|
1456
|
+
Object.defineProperty(fn, "adapterName", { value });
|
|
1457
|
+
}
|
|
1458
|
+
});
|
|
1459
|
+
const renderReason = (reason) => `- ${reason}`;
|
|
1460
|
+
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
1461
|
+
const adapters = {
|
|
1462
|
+
getAdapter: (adapters2) => {
|
|
1463
|
+
adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
|
|
1464
|
+
const { length } = adapters2;
|
|
1465
|
+
let nameOrAdapter;
|
|
1466
|
+
let adapter;
|
|
1467
|
+
const rejectedReasons = {};
|
|
1468
|
+
for (let i = 0; i < length; i++) {
|
|
1469
|
+
nameOrAdapter = adapters2[i];
|
|
1470
|
+
let id;
|
|
1471
|
+
adapter = nameOrAdapter;
|
|
1472
|
+
if (!isResolvedHandle(nameOrAdapter)) {
|
|
1473
|
+
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
1474
|
+
if (adapter === void 0) {
|
|
1475
|
+
throw new AxiosError(`Unknown adapter '${id}'`);
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
if (adapter) {
|
|
1479
|
+
break;
|
|
1480
|
+
}
|
|
1481
|
+
rejectedReasons[id || "#" + i] = adapter;
|
|
1482
|
+
}
|
|
1483
|
+
if (!adapter) {
|
|
1484
|
+
const reasons = Object.entries(rejectedReasons).map(
|
|
1485
|
+
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
|
|
1486
|
+
);
|
|
1487
|
+
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
1488
|
+
throw new AxiosError(
|
|
1489
|
+
`There is no suitable adapter to dispatch the request ` + s,
|
|
1490
|
+
"ERR_NOT_SUPPORT"
|
|
1491
|
+
);
|
|
1492
|
+
}
|
|
1493
|
+
return adapter;
|
|
1494
|
+
},
|
|
1495
|
+
adapters: knownAdapters
|
|
1496
|
+
};
|
|
1497
|
+
function throwIfCancellationRequested(config) {
|
|
1498
|
+
if (config.cancelToken) {
|
|
1499
|
+
config.cancelToken.throwIfRequested();
|
|
1500
|
+
}
|
|
1501
|
+
if (config.signal && config.signal.aborted) {
|
|
1502
|
+
throw new CanceledError(null, config);
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
function dispatchRequest(config) {
|
|
1506
|
+
throwIfCancellationRequested(config);
|
|
1507
|
+
config.headers = AxiosHeaders$1.from(config.headers);
|
|
1508
|
+
config.data = transformData.call(
|
|
1509
|
+
config,
|
|
1510
|
+
config.transformRequest
|
|
1511
|
+
);
|
|
1512
|
+
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
1513
|
+
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
1514
|
+
}
|
|
1515
|
+
const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter);
|
|
1516
|
+
return adapter(config).then(function onAdapterResolution(response) {
|
|
1517
|
+
throwIfCancellationRequested(config);
|
|
1518
|
+
response.data = transformData.call(
|
|
1519
|
+
config,
|
|
1520
|
+
config.transformResponse,
|
|
1521
|
+
response
|
|
1522
|
+
);
|
|
1523
|
+
response.headers = AxiosHeaders$1.from(response.headers);
|
|
1524
|
+
return response;
|
|
1525
|
+
}, function onAdapterRejection(reason) {
|
|
1526
|
+
if (!isCancel(reason)) {
|
|
1527
|
+
throwIfCancellationRequested(config);
|
|
1528
|
+
if (reason && reason.response) {
|
|
1529
|
+
reason.response.data = transformData.call(
|
|
1530
|
+
config,
|
|
1531
|
+
config.transformResponse,
|
|
1532
|
+
reason.response
|
|
1533
|
+
);
|
|
1534
|
+
reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
return Promise.reject(reason);
|
|
1538
|
+
});
|
|
1539
|
+
}
|
|
1540
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? thing.toJSON() : thing;
|
|
1541
|
+
function mergeConfig(config1, config2) {
|
|
1542
|
+
config2 = config2 || {};
|
|
1543
|
+
const config = {};
|
|
1544
|
+
function getMergedValue(target, source, caseless) {
|
|
1545
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
1546
|
+
return utils$1.merge.call({ caseless }, target, source);
|
|
1547
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
1548
|
+
return utils$1.merge({}, source);
|
|
1549
|
+
} else if (utils$1.isArray(source)) {
|
|
1550
|
+
return source.slice();
|
|
1551
|
+
}
|
|
1552
|
+
return source;
|
|
1553
|
+
}
|
|
1554
|
+
function mergeDeepProperties(a, b, caseless) {
|
|
1555
|
+
if (!utils$1.isUndefined(b)) {
|
|
1556
|
+
return getMergedValue(a, b, caseless);
|
|
1557
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
1558
|
+
return getMergedValue(void 0, a, caseless);
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
function valueFromConfig2(a, b) {
|
|
1562
|
+
if (!utils$1.isUndefined(b)) {
|
|
1563
|
+
return getMergedValue(void 0, b);
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
function defaultToConfig2(a, b) {
|
|
1567
|
+
if (!utils$1.isUndefined(b)) {
|
|
1568
|
+
return getMergedValue(void 0, b);
|
|
1569
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
1570
|
+
return getMergedValue(void 0, a);
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
function mergeDirectKeys(a, b, prop) {
|
|
1574
|
+
if (prop in config2) {
|
|
1575
|
+
return getMergedValue(a, b);
|
|
1576
|
+
} else if (prop in config1) {
|
|
1577
|
+
return getMergedValue(void 0, a);
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
const mergeMap = {
|
|
1581
|
+
url: valueFromConfig2,
|
|
1582
|
+
method: valueFromConfig2,
|
|
1583
|
+
data: valueFromConfig2,
|
|
1584
|
+
baseURL: defaultToConfig2,
|
|
1585
|
+
transformRequest: defaultToConfig2,
|
|
1586
|
+
transformResponse: defaultToConfig2,
|
|
1587
|
+
paramsSerializer: defaultToConfig2,
|
|
1588
|
+
timeout: defaultToConfig2,
|
|
1589
|
+
timeoutMessage: defaultToConfig2,
|
|
1590
|
+
withCredentials: defaultToConfig2,
|
|
1591
|
+
withXSRFToken: defaultToConfig2,
|
|
1592
|
+
adapter: defaultToConfig2,
|
|
1593
|
+
responseType: defaultToConfig2,
|
|
1594
|
+
xsrfCookieName: defaultToConfig2,
|
|
1595
|
+
xsrfHeaderName: defaultToConfig2,
|
|
1596
|
+
onUploadProgress: defaultToConfig2,
|
|
1597
|
+
onDownloadProgress: defaultToConfig2,
|
|
1598
|
+
decompress: defaultToConfig2,
|
|
1599
|
+
maxContentLength: defaultToConfig2,
|
|
1600
|
+
maxBodyLength: defaultToConfig2,
|
|
1601
|
+
beforeRedirect: defaultToConfig2,
|
|
1602
|
+
transport: defaultToConfig2,
|
|
1603
|
+
httpAgent: defaultToConfig2,
|
|
1604
|
+
httpsAgent: defaultToConfig2,
|
|
1605
|
+
cancelToken: defaultToConfig2,
|
|
1606
|
+
socketPath: defaultToConfig2,
|
|
1607
|
+
responseEncoding: defaultToConfig2,
|
|
1608
|
+
validateStatus: mergeDirectKeys,
|
|
1609
|
+
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
1610
|
+
};
|
|
1611
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
1612
|
+
const merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
1613
|
+
const configValue = merge2(config1[prop], config2[prop], prop);
|
|
1614
|
+
utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
1615
|
+
});
|
|
1616
|
+
return config;
|
|
1617
|
+
}
|
|
1618
|
+
const VERSION = "1.6.7";
|
|
1619
|
+
const validators$1 = {};
|
|
1620
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
1621
|
+
validators$1[type] = function validator2(thing) {
|
|
1622
|
+
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
1623
|
+
};
|
|
1624
|
+
});
|
|
1625
|
+
const deprecatedWarnings = {};
|
|
1626
|
+
validators$1.transitional = function transitional(validator2, version, message) {
|
|
1627
|
+
function formatMessage(opt, desc) {
|
|
1628
|
+
return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
1629
|
+
}
|
|
1630
|
+
return (value, opt, opts) => {
|
|
1631
|
+
if (validator2 === false) {
|
|
1632
|
+
throw new AxiosError(
|
|
1633
|
+
formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
|
|
1634
|
+
AxiosError.ERR_DEPRECATED
|
|
1635
|
+
);
|
|
1636
|
+
}
|
|
1637
|
+
if (version && !deprecatedWarnings[opt]) {
|
|
1638
|
+
deprecatedWarnings[opt] = true;
|
|
1639
|
+
console.warn(
|
|
1640
|
+
formatMessage(
|
|
1641
|
+
opt,
|
|
1642
|
+
" has been deprecated since v" + version + " and will be removed in the near future"
|
|
1643
|
+
)
|
|
1644
|
+
);
|
|
1645
|
+
}
|
|
1646
|
+
return validator2 ? validator2(value, opt, opts) : true;
|
|
1647
|
+
};
|
|
1648
|
+
};
|
|
1649
|
+
function assertOptions(options, schema, allowUnknown) {
|
|
1650
|
+
if (typeof options !== "object") {
|
|
1651
|
+
throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE);
|
|
1652
|
+
}
|
|
1653
|
+
const keys = Object.keys(options);
|
|
1654
|
+
let i = keys.length;
|
|
1655
|
+
while (i-- > 0) {
|
|
1656
|
+
const opt = keys[i];
|
|
1657
|
+
const validator2 = schema[opt];
|
|
1658
|
+
if (validator2) {
|
|
1659
|
+
const value = options[opt];
|
|
1660
|
+
const result = value === void 0 || validator2(value, opt, options);
|
|
1661
|
+
if (result !== true) {
|
|
1662
|
+
throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE);
|
|
1663
|
+
}
|
|
1664
|
+
continue;
|
|
1665
|
+
}
|
|
1666
|
+
if (allowUnknown !== true) {
|
|
1667
|
+
throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION);
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
const validator = {
|
|
1672
|
+
assertOptions,
|
|
1673
|
+
validators: validators$1
|
|
1674
|
+
};
|
|
1675
|
+
const validators = validator.validators;
|
|
1676
|
+
class Axios {
|
|
1677
|
+
constructor(instanceConfig) {
|
|
1678
|
+
this.defaults = instanceConfig;
|
|
1679
|
+
this.interceptors = {
|
|
1680
|
+
request: new InterceptorManager(),
|
|
1681
|
+
response: new InterceptorManager()
|
|
1682
|
+
};
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* Dispatch a request
|
|
1686
|
+
*
|
|
1687
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
1688
|
+
* @param {?Object} config
|
|
1689
|
+
*
|
|
1690
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
1691
|
+
*/
|
|
1692
|
+
async request(configOrUrl, config) {
|
|
1693
|
+
try {
|
|
1694
|
+
return await this._request(configOrUrl, config);
|
|
1695
|
+
} catch (err) {
|
|
1696
|
+
if (err instanceof Error) {
|
|
1697
|
+
let dummy;
|
|
1698
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
|
|
1699
|
+
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
|
|
1700
|
+
if (!err.stack) {
|
|
1701
|
+
err.stack = stack;
|
|
1702
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
|
|
1703
|
+
err.stack += "\n" + stack;
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
throw err;
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
_request(configOrUrl, config) {
|
|
1710
|
+
if (typeof configOrUrl === "string") {
|
|
1711
|
+
config = config || {};
|
|
1712
|
+
config.url = configOrUrl;
|
|
1713
|
+
} else {
|
|
1714
|
+
config = configOrUrl || {};
|
|
1715
|
+
}
|
|
1716
|
+
config = mergeConfig(this.defaults, config);
|
|
1717
|
+
const { transitional, paramsSerializer, headers } = config;
|
|
1718
|
+
if (transitional !== void 0) {
|
|
1719
|
+
validator.assertOptions(transitional, {
|
|
1720
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
1721
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
1722
|
+
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
1723
|
+
}, false);
|
|
1724
|
+
}
|
|
1725
|
+
if (paramsSerializer != null) {
|
|
1726
|
+
if (utils$1.isFunction(paramsSerializer)) {
|
|
1727
|
+
config.paramsSerializer = {
|
|
1728
|
+
serialize: paramsSerializer
|
|
1729
|
+
};
|
|
1730
|
+
} else {
|
|
1731
|
+
validator.assertOptions(paramsSerializer, {
|
|
1732
|
+
encode: validators.function,
|
|
1733
|
+
serialize: validators.function
|
|
1734
|
+
}, true);
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
1738
|
+
let contextHeaders = headers && utils$1.merge(
|
|
1739
|
+
headers.common,
|
|
1740
|
+
headers[config.method]
|
|
1741
|
+
);
|
|
1742
|
+
headers && utils$1.forEach(
|
|
1743
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1744
|
+
(method) => {
|
|
1745
|
+
delete headers[method];
|
|
1746
|
+
}
|
|
1747
|
+
);
|
|
1748
|
+
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
|
1749
|
+
const requestInterceptorChain = [];
|
|
1750
|
+
let synchronousRequestInterceptors = true;
|
|
1751
|
+
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
1752
|
+
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
1753
|
+
return;
|
|
1754
|
+
}
|
|
1755
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
1756
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
1757
|
+
});
|
|
1758
|
+
const responseInterceptorChain = [];
|
|
1759
|
+
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
1760
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
1761
|
+
});
|
|
1762
|
+
let promise;
|
|
1763
|
+
let i = 0;
|
|
1764
|
+
let len;
|
|
1765
|
+
if (!synchronousRequestInterceptors) {
|
|
1766
|
+
const chain = [dispatchRequest.bind(this), void 0];
|
|
1767
|
+
chain.unshift.apply(chain, requestInterceptorChain);
|
|
1768
|
+
chain.push.apply(chain, responseInterceptorChain);
|
|
1769
|
+
len = chain.length;
|
|
1770
|
+
promise = Promise.resolve(config);
|
|
1771
|
+
while (i < len) {
|
|
1772
|
+
promise = promise.then(chain[i++], chain[i++]);
|
|
1773
|
+
}
|
|
1774
|
+
return promise;
|
|
1775
|
+
}
|
|
1776
|
+
len = requestInterceptorChain.length;
|
|
1777
|
+
let newConfig = config;
|
|
1778
|
+
i = 0;
|
|
1779
|
+
while (i < len) {
|
|
1780
|
+
const onFulfilled = requestInterceptorChain[i++];
|
|
1781
|
+
const onRejected = requestInterceptorChain[i++];
|
|
1782
|
+
try {
|
|
1783
|
+
newConfig = onFulfilled(newConfig);
|
|
1784
|
+
} catch (error) {
|
|
1785
|
+
onRejected.call(this, error);
|
|
1786
|
+
break;
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
try {
|
|
1790
|
+
promise = dispatchRequest.call(this, newConfig);
|
|
1791
|
+
} catch (error) {
|
|
1792
|
+
return Promise.reject(error);
|
|
1793
|
+
}
|
|
1794
|
+
i = 0;
|
|
1795
|
+
len = responseInterceptorChain.length;
|
|
1796
|
+
while (i < len) {
|
|
1797
|
+
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
|
|
1798
|
+
}
|
|
1799
|
+
return promise;
|
|
1800
|
+
}
|
|
1801
|
+
getUri(config) {
|
|
1802
|
+
config = mergeConfig(this.defaults, config);
|
|
1803
|
+
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
1804
|
+
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
|
|
1808
|
+
Axios.prototype[method] = function(url, config) {
|
|
1809
|
+
return this.request(mergeConfig(config || {}, {
|
|
1810
|
+
method,
|
|
1811
|
+
url,
|
|
1812
|
+
data: (config || {}).data
|
|
1813
|
+
}));
|
|
1814
|
+
};
|
|
1815
|
+
});
|
|
1816
|
+
utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
1817
|
+
function generateHTTPMethod(isForm) {
|
|
1818
|
+
return function httpMethod(url, data, config) {
|
|
1819
|
+
return this.request(mergeConfig(config || {}, {
|
|
1820
|
+
method,
|
|
1821
|
+
headers: isForm ? {
|
|
1822
|
+
"Content-Type": "multipart/form-data"
|
|
1823
|
+
} : {},
|
|
1824
|
+
url,
|
|
1825
|
+
data
|
|
1826
|
+
}));
|
|
1827
|
+
};
|
|
1828
|
+
}
|
|
1829
|
+
Axios.prototype[method] = generateHTTPMethod();
|
|
1830
|
+
Axios.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
1831
|
+
});
|
|
1832
|
+
const Axios$1 = Axios;
|
|
1833
|
+
class CancelToken {
|
|
1834
|
+
constructor(executor) {
|
|
1835
|
+
if (typeof executor !== "function") {
|
|
1836
|
+
throw new TypeError("executor must be a function.");
|
|
1837
|
+
}
|
|
1838
|
+
let resolvePromise;
|
|
1839
|
+
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
1840
|
+
resolvePromise = resolve;
|
|
1841
|
+
});
|
|
1842
|
+
const token = this;
|
|
1843
|
+
this.promise.then((cancel) => {
|
|
1844
|
+
if (!token._listeners)
|
|
1845
|
+
return;
|
|
1846
|
+
let i = token._listeners.length;
|
|
1847
|
+
while (i-- > 0) {
|
|
1848
|
+
token._listeners[i](cancel);
|
|
1849
|
+
}
|
|
1850
|
+
token._listeners = null;
|
|
1851
|
+
});
|
|
1852
|
+
this.promise.then = (onfulfilled) => {
|
|
1853
|
+
let _resolve;
|
|
1854
|
+
const promise = new Promise((resolve) => {
|
|
1855
|
+
token.subscribe(resolve);
|
|
1856
|
+
_resolve = resolve;
|
|
1857
|
+
}).then(onfulfilled);
|
|
1858
|
+
promise.cancel = function reject() {
|
|
1859
|
+
token.unsubscribe(_resolve);
|
|
1860
|
+
};
|
|
1861
|
+
return promise;
|
|
1862
|
+
};
|
|
1863
|
+
executor(function cancel(message, config, request) {
|
|
1864
|
+
if (token.reason) {
|
|
1865
|
+
return;
|
|
1866
|
+
}
|
|
1867
|
+
token.reason = new CanceledError(message, config, request);
|
|
1868
|
+
resolvePromise(token.reason);
|
|
1869
|
+
});
|
|
1870
|
+
}
|
|
1871
|
+
/**
|
|
1872
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
1873
|
+
*/
|
|
1874
|
+
throwIfRequested() {
|
|
1875
|
+
if (this.reason) {
|
|
1876
|
+
throw this.reason;
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* Subscribe to the cancel signal
|
|
1881
|
+
*/
|
|
1882
|
+
subscribe(listener) {
|
|
1883
|
+
if (this.reason) {
|
|
1884
|
+
listener(this.reason);
|
|
1885
|
+
return;
|
|
1886
|
+
}
|
|
1887
|
+
if (this._listeners) {
|
|
1888
|
+
this._listeners.push(listener);
|
|
1889
|
+
} else {
|
|
1890
|
+
this._listeners = [listener];
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
/**
|
|
1894
|
+
* Unsubscribe from the cancel signal
|
|
1895
|
+
*/
|
|
1896
|
+
unsubscribe(listener) {
|
|
1897
|
+
if (!this._listeners) {
|
|
1898
|
+
return;
|
|
1899
|
+
}
|
|
1900
|
+
const index = this._listeners.indexOf(listener);
|
|
1901
|
+
if (index !== -1) {
|
|
1902
|
+
this._listeners.splice(index, 1);
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
/**
|
|
1906
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
1907
|
+
* cancels the `CancelToken`.
|
|
1908
|
+
*/
|
|
1909
|
+
static source() {
|
|
1910
|
+
let cancel;
|
|
1911
|
+
const token = new CancelToken(function executor(c) {
|
|
1912
|
+
cancel = c;
|
|
1913
|
+
});
|
|
1914
|
+
return {
|
|
1915
|
+
token,
|
|
1916
|
+
cancel
|
|
1917
|
+
};
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
const CancelToken$1 = CancelToken;
|
|
1921
|
+
function spread(callback) {
|
|
1922
|
+
return function wrap(arr) {
|
|
1923
|
+
return callback.apply(null, arr);
|
|
1924
|
+
};
|
|
1925
|
+
}
|
|
1926
|
+
function isAxiosError(payload) {
|
|
1927
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
|
1928
|
+
}
|
|
1929
|
+
const HttpStatusCode = {
|
|
1930
|
+
Continue: 100,
|
|
1931
|
+
SwitchingProtocols: 101,
|
|
1932
|
+
Processing: 102,
|
|
1933
|
+
EarlyHints: 103,
|
|
1934
|
+
Ok: 200,
|
|
1935
|
+
Created: 201,
|
|
1936
|
+
Accepted: 202,
|
|
1937
|
+
NonAuthoritativeInformation: 203,
|
|
1938
|
+
NoContent: 204,
|
|
1939
|
+
ResetContent: 205,
|
|
1940
|
+
PartialContent: 206,
|
|
1941
|
+
MultiStatus: 207,
|
|
1942
|
+
AlreadyReported: 208,
|
|
1943
|
+
ImUsed: 226,
|
|
1944
|
+
MultipleChoices: 300,
|
|
1945
|
+
MovedPermanently: 301,
|
|
1946
|
+
Found: 302,
|
|
1947
|
+
SeeOther: 303,
|
|
1948
|
+
NotModified: 304,
|
|
1949
|
+
UseProxy: 305,
|
|
1950
|
+
Unused: 306,
|
|
1951
|
+
TemporaryRedirect: 307,
|
|
1952
|
+
PermanentRedirect: 308,
|
|
1953
|
+
BadRequest: 400,
|
|
1954
|
+
Unauthorized: 401,
|
|
1955
|
+
PaymentRequired: 402,
|
|
1956
|
+
Forbidden: 403,
|
|
1957
|
+
NotFound: 404,
|
|
1958
|
+
MethodNotAllowed: 405,
|
|
1959
|
+
NotAcceptable: 406,
|
|
1960
|
+
ProxyAuthenticationRequired: 407,
|
|
1961
|
+
RequestTimeout: 408,
|
|
1962
|
+
Conflict: 409,
|
|
1963
|
+
Gone: 410,
|
|
1964
|
+
LengthRequired: 411,
|
|
1965
|
+
PreconditionFailed: 412,
|
|
1966
|
+
PayloadTooLarge: 413,
|
|
1967
|
+
UriTooLong: 414,
|
|
1968
|
+
UnsupportedMediaType: 415,
|
|
1969
|
+
RangeNotSatisfiable: 416,
|
|
1970
|
+
ExpectationFailed: 417,
|
|
1971
|
+
ImATeapot: 418,
|
|
1972
|
+
MisdirectedRequest: 421,
|
|
1973
|
+
UnprocessableEntity: 422,
|
|
1974
|
+
Locked: 423,
|
|
1975
|
+
FailedDependency: 424,
|
|
1976
|
+
TooEarly: 425,
|
|
1977
|
+
UpgradeRequired: 426,
|
|
1978
|
+
PreconditionRequired: 428,
|
|
1979
|
+
TooManyRequests: 429,
|
|
1980
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
1981
|
+
UnavailableForLegalReasons: 451,
|
|
1982
|
+
InternalServerError: 500,
|
|
1983
|
+
NotImplemented: 501,
|
|
1984
|
+
BadGateway: 502,
|
|
1985
|
+
ServiceUnavailable: 503,
|
|
1986
|
+
GatewayTimeout: 504,
|
|
1987
|
+
HttpVersionNotSupported: 505,
|
|
1988
|
+
VariantAlsoNegotiates: 506,
|
|
1989
|
+
InsufficientStorage: 507,
|
|
1990
|
+
LoopDetected: 508,
|
|
1991
|
+
NotExtended: 510,
|
|
1992
|
+
NetworkAuthenticationRequired: 511
|
|
1993
|
+
};
|
|
1994
|
+
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
1995
|
+
HttpStatusCode[value] = key;
|
|
1996
|
+
});
|
|
1997
|
+
const HttpStatusCode$1 = HttpStatusCode;
|
|
1998
|
+
function createInstance(defaultConfig) {
|
|
1999
|
+
const context = new Axios$1(defaultConfig);
|
|
2000
|
+
const instance = bind(Axios$1.prototype.request, context);
|
|
2001
|
+
utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
|
|
2002
|
+
utils$1.extend(instance, context, null, { allOwnKeys: true });
|
|
2003
|
+
instance.create = function create(instanceConfig) {
|
|
2004
|
+
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
2005
|
+
};
|
|
2006
|
+
return instance;
|
|
2007
|
+
}
|
|
2008
|
+
const axios = createInstance(defaults$1);
|
|
2009
|
+
axios.Axios = Axios$1;
|
|
2010
|
+
axios.CanceledError = CanceledError;
|
|
2011
|
+
axios.CancelToken = CancelToken$1;
|
|
2012
|
+
axios.isCancel = isCancel;
|
|
2013
|
+
axios.VERSION = VERSION;
|
|
2014
|
+
axios.toFormData = toFormData;
|
|
2015
|
+
axios.AxiosError = AxiosError;
|
|
2016
|
+
axios.Cancel = axios.CanceledError;
|
|
2017
|
+
axios.all = function all(promises) {
|
|
2018
|
+
return Promise.all(promises);
|
|
2019
|
+
};
|
|
2020
|
+
axios.spread = spread;
|
|
2021
|
+
axios.isAxiosError = isAxiosError;
|
|
2022
|
+
axios.mergeConfig = mergeConfig;
|
|
2023
|
+
axios.AxiosHeaders = AxiosHeaders$1;
|
|
2024
|
+
axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
2025
|
+
axios.getAdapter = adapters.getAdapter;
|
|
2026
|
+
axios.HttpStatusCode = HttpStatusCode$1;
|
|
2027
|
+
axios.default = axios;
|
|
2028
|
+
function ye(t) {
|
|
2029
|
+
return t == null ? true : typeof t == "string" || Array.isArray(t) ? t.length === 0 : typeof t == "object" ? Object.keys(t).length === 0 : false;
|
|
2030
|
+
}
|
|
2031
|
+
function Be(t) {
|
|
2032
|
+
return t !== null && typeof t == "object" && !Array.isArray(t);
|
|
2033
|
+
}
|
|
2034
|
+
function ke(t = {}, o = {}) {
|
|
2035
|
+
const e = {};
|
|
2036
|
+
for (const n in t)
|
|
2037
|
+
e[n] = t[n];
|
|
2038
|
+
for (const n in o) {
|
|
2039
|
+
const l = t[n], s = o[n];
|
|
2040
|
+
if (Be(l) && Be(s)) {
|
|
2041
|
+
e[n] = ke(
|
|
2042
|
+
l,
|
|
2043
|
+
s
|
|
2044
|
+
);
|
|
2045
|
+
continue;
|
|
2046
|
+
}
|
|
2047
|
+
e[n] = s;
|
|
2048
|
+
}
|
|
2049
|
+
return e;
|
|
2050
|
+
}
|
|
2051
|
+
const we = "q-defaults";
|
|
2052
|
+
function Ye() {
|
|
2053
|
+
var s, r;
|
|
2054
|
+
const t = vue.getCurrentInstance();
|
|
2055
|
+
if (!t)
|
|
2056
|
+
throw new Error("[Quidgest UI] useDefaults must be called from inside a setup function");
|
|
2057
|
+
const o = t.type.name ?? t.type.__name;
|
|
2058
|
+
if (!o)
|
|
2059
|
+
throw new Error("[Quidgest UI] Could not determine component name");
|
|
2060
|
+
const e = Oe(), n = (s = e.value) == null ? void 0 : s.Global, l = (r = e.value) == null ? void 0 : r[o];
|
|
2061
|
+
return vue.computed(() => ke(n, l));
|
|
2062
|
+
}
|
|
2063
|
+
function Me(t) {
|
|
2064
|
+
if (ye(t))
|
|
2065
|
+
return;
|
|
2066
|
+
const o = Oe(), e = vue.ref(t), n = vue.computed(() => ye(e.value) ? o.value : ke(o.value, e.value));
|
|
2067
|
+
vue.provide(we, n);
|
|
2068
|
+
}
|
|
2069
|
+
function Oe() {
|
|
2070
|
+
const t = vue.inject(we, void 0);
|
|
2071
|
+
if (!t)
|
|
2072
|
+
throw new Error("[Quidgest UI] Could not find defaults instance");
|
|
2073
|
+
return t;
|
|
2074
|
+
}
|
|
2075
|
+
function Fe(t) {
|
|
2076
|
+
return t.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([0-9])([A-Za-z])/g, "$1-$2").replace(/([A-Za-z])([0-9])/g, "$1-$2").toLowerCase();
|
|
2077
|
+
}
|
|
2078
|
+
const at = /* @__PURE__ */ vue.createElementVNode("svg", { viewBox: "25 25 50 50" }, [
|
|
2079
|
+
/* @__PURE__ */ vue.createElementVNode("circle", {
|
|
2080
|
+
class: "path",
|
|
2081
|
+
cx: "50",
|
|
2082
|
+
cy: "50",
|
|
2083
|
+
r: "20",
|
|
2084
|
+
fill: "none",
|
|
2085
|
+
stroke: "currentColor",
|
|
2086
|
+
"stroke-width": "5",
|
|
2087
|
+
"stroke-miterlimit": "10"
|
|
2088
|
+
})
|
|
2089
|
+
], -1), st = [
|
|
2090
|
+
at
|
|
2091
|
+
], it = /* @__PURE__ */ vue.defineComponent({
|
|
2092
|
+
__name: "QSpinnerLoader",
|
|
2093
|
+
props: {
|
|
2094
|
+
size: { default: 48 },
|
|
2095
|
+
class: { default: void 0 }
|
|
2096
|
+
},
|
|
2097
|
+
setup(t) {
|
|
2098
|
+
const o = t, e = vue.computed(() => ({
|
|
2099
|
+
"font-size": o.size !== 48 ? `${o.size}px` : void 0
|
|
2100
|
+
}));
|
|
2101
|
+
return (n, l) => (vue.openBlock(), vue.createElementBlock("div", {
|
|
2102
|
+
class: vue.normalizeClass(["q-spinner-loader", o.class]),
|
|
2103
|
+
style: vue.normalizeStyle(e.value)
|
|
2104
|
+
}, st, 6));
|
|
2105
|
+
}
|
|
2106
|
+
});
|
|
2107
|
+
function rt(t, o) {
|
|
2108
|
+
var n;
|
|
2109
|
+
const e = Fe(o);
|
|
2110
|
+
return e ? typeof ((n = t.props) == null ? void 0 : n[e]) < "u" : false;
|
|
2111
|
+
}
|
|
2112
|
+
function S(t) {
|
|
2113
|
+
const o = t.setup;
|
|
2114
|
+
return o && (t.setup = (e, n) => {
|
|
2115
|
+
const l = Ye();
|
|
2116
|
+
if (ye(l.value))
|
|
2117
|
+
return o(e, n);
|
|
2118
|
+
const s = vue.getCurrentInstance();
|
|
2119
|
+
if (s === null)
|
|
2120
|
+
return o(e, n);
|
|
2121
|
+
const r = new Proxy(e, {
|
|
2122
|
+
get(i, f) {
|
|
2123
|
+
var y;
|
|
2124
|
+
const L = Reflect.get(i, f), _ = (y = l.value) == null ? void 0 : y[f];
|
|
2125
|
+
return typeof f == "string" && !rt(s.vnode, f) ? _ ?? L : L;
|
|
2126
|
+
}
|
|
2127
|
+
});
|
|
2128
|
+
return o(r, n);
|
|
2129
|
+
}), t;
|
|
2130
|
+
}
|
|
2131
|
+
const $e = S(it), dt = ["disabled"], ut = {
|
|
2132
|
+
key: 0,
|
|
2133
|
+
class: "q-btn__spinner"
|
|
2134
|
+
}, ct = { class: "q-btn__content" }, ft = /* @__PURE__ */ vue.defineComponent({
|
|
2135
|
+
__name: "QButton",
|
|
2136
|
+
props: {
|
|
2137
|
+
active: { type: Boolean },
|
|
2138
|
+
bStyle: { default: "secondary" },
|
|
2139
|
+
label: { default: "" },
|
|
2140
|
+
disabled: { type: Boolean },
|
|
2141
|
+
iconOnRight: { type: Boolean },
|
|
2142
|
+
borderless: { type: Boolean },
|
|
2143
|
+
elevated: { type: Boolean },
|
|
2144
|
+
block: { type: Boolean },
|
|
2145
|
+
loading: { type: Boolean },
|
|
2146
|
+
size: { default: "regular" },
|
|
2147
|
+
class: { default: void 0 }
|
|
2148
|
+
},
|
|
2149
|
+
emits: ["click"],
|
|
2150
|
+
setup(t, { emit: o }) {
|
|
2151
|
+
const e = t, n = o, l = vue.computed(() => e.disabled || e.loading);
|
|
2152
|
+
function s(i) {
|
|
2153
|
+
l.value || n("click", i);
|
|
2154
|
+
}
|
|
2155
|
+
const r = vue.computed(() => {
|
|
2156
|
+
const i = e.size !== "regular" ? `q-btn--${e.size}` : void 0;
|
|
2157
|
+
return [
|
|
2158
|
+
"q-btn",
|
|
2159
|
+
`q-btn--${e.bStyle}`,
|
|
2160
|
+
i,
|
|
2161
|
+
{
|
|
2162
|
+
"q-btn--active": e.active,
|
|
2163
|
+
"q-btn--borderless": e.borderless,
|
|
2164
|
+
"q-btn--elevated": e.elevated,
|
|
2165
|
+
"q-btn--block": e.block,
|
|
2166
|
+
"q-btn--loading": e.loading
|
|
2167
|
+
},
|
|
2168
|
+
e.class
|
|
2169
|
+
];
|
|
2170
|
+
});
|
|
2171
|
+
return (i, f) => (vue.openBlock(), vue.createElementBlock("button", {
|
|
2172
|
+
type: "button",
|
|
2173
|
+
class: vue.normalizeClass(r.value),
|
|
2174
|
+
disabled: l.value,
|
|
2175
|
+
onClick: vue.withModifiers(s, ["stop", "prevent"])
|
|
2176
|
+
}, [
|
|
2177
|
+
i.loading ? (vue.openBlock(), vue.createElementBlock("div", ut, [
|
|
2178
|
+
vue.createVNode(vue.unref($e), { size: 20 })
|
|
2179
|
+
])) : vue.createCommentVNode("", true),
|
|
2180
|
+
vue.createElementVNode("span", ct, [
|
|
2181
|
+
i.iconOnRight ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
2182
|
+
vue.createTextVNode(vue.toDisplayString(e.label), 1)
|
|
2183
|
+
], 64)) : vue.createCommentVNode("", true),
|
|
2184
|
+
vue.renderSlot(i.$slots, "default"),
|
|
2185
|
+
i.iconOnRight ? vue.createCommentVNode("", true) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
2186
|
+
vue.createTextVNode(vue.toDisplayString(e.label), 1)
|
|
2187
|
+
], 64))
|
|
2188
|
+
])
|
|
2189
|
+
], 10, dt));
|
|
2190
|
+
}
|
|
2191
|
+
}), fe = S(ft), pt = /* @__PURE__ */ vue.defineComponent({
|
|
2192
|
+
__name: "QButtonGroup",
|
|
2193
|
+
props: {
|
|
2194
|
+
disabled: { type: Boolean },
|
|
2195
|
+
borderless: { type: Boolean },
|
|
2196
|
+
elevated: { type: Boolean },
|
|
2197
|
+
class: { default: void 0 }
|
|
2198
|
+
},
|
|
2199
|
+
setup(t) {
|
|
2200
|
+
const o = t;
|
|
2201
|
+
return Me({
|
|
2202
|
+
QButton: {
|
|
2203
|
+
bStyle: "secondary",
|
|
2204
|
+
disabled: vue.toRef(o, "disabled"),
|
|
2205
|
+
borderless: vue.toRef(o, "borderless"),
|
|
2206
|
+
elevated: false
|
|
2207
|
+
}
|
|
2208
|
+
}), (e, n) => (vue.openBlock(), vue.createElementBlock("div", {
|
|
2209
|
+
class: vue.normalizeClass([
|
|
2210
|
+
"q-btn-group",
|
|
2211
|
+
{
|
|
2212
|
+
"q-btn-group--elevated": o.elevated
|
|
2213
|
+
},
|
|
2214
|
+
o.class
|
|
2215
|
+
])
|
|
2216
|
+
}, [
|
|
2217
|
+
vue.renderSlot(e.$slots, "default")
|
|
2218
|
+
], 2));
|
|
2219
|
+
}
|
|
2220
|
+
}), mt = S(pt), vt = /* @__PURE__ */ vue.defineComponent({
|
|
2221
|
+
__name: "QButtonToggle",
|
|
2222
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
2223
|
+
options: {},
|
|
2224
|
+
disabled: { type: Boolean },
|
|
2225
|
+
borderless: { type: Boolean },
|
|
2226
|
+
elevated: { type: Boolean },
|
|
2227
|
+
required: { type: Boolean },
|
|
2228
|
+
class: {}
|
|
2229
|
+
}, {
|
|
2230
|
+
modelValue: {},
|
|
2231
|
+
modelModifiers: {}
|
|
2232
|
+
}),
|
|
2233
|
+
emits: ["update:modelValue"],
|
|
2234
|
+
setup(t) {
|
|
2235
|
+
const o = t, e = vue.useModel(t, "modelValue");
|
|
2236
|
+
function n(l) {
|
|
2237
|
+
e.value === l.key && !o.required ? e.value = void 0 : e.value = l.key;
|
|
2238
|
+
}
|
|
2239
|
+
return (l, s) => (vue.openBlock(), vue.createBlock(vue.unref(mt), {
|
|
2240
|
+
"b-style": "secondary",
|
|
2241
|
+
class: vue.normalizeClass(o.class),
|
|
2242
|
+
disabled: o.disabled,
|
|
2243
|
+
borderless: o.borderless,
|
|
2244
|
+
elevated: o.elevated
|
|
2245
|
+
}, {
|
|
2246
|
+
default: vue.withCtx(() => [
|
|
2247
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(o.options, (r) => (vue.openBlock(), vue.createBlock(vue.unref(fe), {
|
|
2248
|
+
key: r.key,
|
|
2249
|
+
title: r.title,
|
|
2250
|
+
label: r.label,
|
|
2251
|
+
active: e.value === r.key,
|
|
2252
|
+
onClick: () => n(r)
|
|
2253
|
+
}, {
|
|
2254
|
+
default: vue.withCtx(() => [
|
|
2255
|
+
vue.renderSlot(l.$slots, r.key)
|
|
2256
|
+
]),
|
|
2257
|
+
_: 2
|
|
2258
|
+
}, 1032, ["title", "label", "active", "onClick"]))), 128))
|
|
2259
|
+
]),
|
|
2260
|
+
_: 3
|
|
2261
|
+
}, 8, ["class", "disabled", "borderless", "elevated"]));
|
|
2262
|
+
}
|
|
2263
|
+
});
|
|
2264
|
+
S(vt);
|
|
2265
|
+
const ht = /* @__PURE__ */ vue.defineComponent({
|
|
2266
|
+
__name: "QIcon",
|
|
2267
|
+
props: {
|
|
2268
|
+
icon: {},
|
|
2269
|
+
type: { default: "svg" },
|
|
2270
|
+
size: { default: void 0 },
|
|
2271
|
+
class: { default: void 0 }
|
|
2272
|
+
},
|
|
2273
|
+
setup(t) {
|
|
2274
|
+
const o = t, e = vue.computed(() => {
|
|
2275
|
+
switch (o.type) {
|
|
2276
|
+
case "svg":
|
|
2277
|
+
return It;
|
|
2278
|
+
case "font":
|
|
2279
|
+
return qt;
|
|
2280
|
+
case "img":
|
|
2281
|
+
return Lt;
|
|
2282
|
+
default:
|
|
2283
|
+
return;
|
|
2284
|
+
}
|
|
2285
|
+
});
|
|
2286
|
+
return (n, l) => (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(e.value), {
|
|
2287
|
+
class: vue.normalizeClass(o.class),
|
|
2288
|
+
icon: o.icon,
|
|
2289
|
+
size: o.size
|
|
2290
|
+
}, null, 8, ["class", "icon", "size"]));
|
|
2291
|
+
}
|
|
2292
|
+
}), bt = /* @__PURE__ */ vue.defineComponent({
|
|
2293
|
+
__name: "QIconFont",
|
|
2294
|
+
props: {
|
|
2295
|
+
icon: {},
|
|
2296
|
+
library: { default: "" },
|
|
2297
|
+
variant: { default: "" },
|
|
2298
|
+
size: { default: void 0 },
|
|
2299
|
+
class: { default: void 0 }
|
|
2300
|
+
},
|
|
2301
|
+
setup(t) {
|
|
2302
|
+
const o = t, e = vue.computed(() => o.variant ? `${o.library}-${o.variant}` : o.library), n = vue.computed(() => o.library && o.icon ? `${o.library}-${o.icon}` : o.icon), l = vue.computed(() => ({
|
|
2303
|
+
"font-size": o.size !== void 0 ? `${o.size}px` : void 0
|
|
2304
|
+
}));
|
|
2305
|
+
return (s, r) => (vue.openBlock(), vue.createElementBlock("i", {
|
|
2306
|
+
class: vue.normalizeClass(["q-icon", "q-icon__font", e.value, n.value, o.class]),
|
|
2307
|
+
style: vue.normalizeStyle(l.value)
|
|
2308
|
+
}, null, 6));
|
|
2309
|
+
}
|
|
2310
|
+
}), yt = ["src"], gt = /* @__PURE__ */ vue.defineComponent({
|
|
2311
|
+
__name: "QIconImg",
|
|
2312
|
+
props: {
|
|
2313
|
+
icon: {},
|
|
2314
|
+
size: {},
|
|
2315
|
+
class: {}
|
|
2316
|
+
},
|
|
2317
|
+
setup(t) {
|
|
2318
|
+
const o = t, e = vue.computed(() => ({
|
|
2319
|
+
"font-size": o.size !== void 0 ? `${o.size}px` : void 0
|
|
2320
|
+
}));
|
|
2321
|
+
return (n, l) => (vue.openBlock(), vue.createElementBlock("img", {
|
|
2322
|
+
src: o.icon,
|
|
2323
|
+
class: vue.normalizeClass(["q-icon", "q-icon__img", o.class]),
|
|
2324
|
+
style: vue.normalizeStyle(e.value)
|
|
2325
|
+
}, null, 14, yt));
|
|
2326
|
+
}
|
|
2327
|
+
}), re = {}, _t = vue.defineComponent({
|
|
2328
|
+
name: "InlineSvg",
|
|
2329
|
+
emits: {
|
|
2330
|
+
loaded: (t) => typeof t == "object",
|
|
2331
|
+
unloaded: () => true,
|
|
2332
|
+
error: (t) => typeof t == "object"
|
|
2333
|
+
},
|
|
2334
|
+
inheritAttrs: false,
|
|
2335
|
+
render() {
|
|
2336
|
+
if (!this.svgElSource)
|
|
2337
|
+
return null;
|
|
2338
|
+
const t = this.getSvgContent(this.svgElSource);
|
|
2339
|
+
if (!t)
|
|
2340
|
+
return vue.h("div", this.$attrs);
|
|
2341
|
+
const o = {};
|
|
2342
|
+
return this.copySvgAttrs(o, this.svgElSource), this.copySvgAttrs(o, t), this.copyComponentAttrs(o, this.$attrs), o.innerHTML = t.innerHTML, vue.h("svg", o);
|
|
2343
|
+
},
|
|
2344
|
+
props: {
|
|
2345
|
+
/**
|
|
2346
|
+
* The source URL of the SVG bundle.
|
|
2347
|
+
*/
|
|
2348
|
+
src: {
|
|
2349
|
+
type: String,
|
|
2350
|
+
required: true
|
|
2351
|
+
},
|
|
2352
|
+
/**
|
|
2353
|
+
* The ID of the SVG symbol to be rendered.
|
|
2354
|
+
*/
|
|
2355
|
+
symbol: {
|
|
2356
|
+
type: String,
|
|
2357
|
+
default: ""
|
|
2358
|
+
},
|
|
2359
|
+
/**
|
|
2360
|
+
* The title to be associated with the SVG.
|
|
2361
|
+
*/
|
|
2362
|
+
title: {
|
|
2363
|
+
type: String,
|
|
2364
|
+
default: ""
|
|
2365
|
+
},
|
|
2366
|
+
/**
|
|
2367
|
+
* A function to transform the source SVG element before rendering.
|
|
2368
|
+
* If not provided, no transformation will be applied.
|
|
2369
|
+
*/
|
|
2370
|
+
transformSource: {
|
|
2371
|
+
type: Function,
|
|
2372
|
+
default: void 0
|
|
2373
|
+
},
|
|
2374
|
+
/**
|
|
2375
|
+
* Determines whether to keep the existing SVG content visible during the loading of a new SVG.
|
|
2376
|
+
* Set to `false` to hide content during loading.
|
|
2377
|
+
*/
|
|
2378
|
+
keepDuringLoading: {
|
|
2379
|
+
type: Boolean,
|
|
2380
|
+
default: true
|
|
2381
|
+
}
|
|
2382
|
+
},
|
|
2383
|
+
data() {
|
|
2384
|
+
return {
|
|
2385
|
+
/** @type SVGElement */
|
|
2386
|
+
svgElSource: null
|
|
2387
|
+
};
|
|
2388
|
+
},
|
|
2389
|
+
async mounted() {
|
|
2390
|
+
await this.getSource(this.src);
|
|
2391
|
+
},
|
|
2392
|
+
methods: {
|
|
2393
|
+
copySvgAttrs(t, o) {
|
|
2394
|
+
const e = o.attributes;
|
|
2395
|
+
if (e)
|
|
2396
|
+
for (const n of e)
|
|
2397
|
+
t[n.name] = n.value;
|
|
2398
|
+
},
|
|
2399
|
+
copyComponentAttrs(t, o) {
|
|
2400
|
+
for (const [e, n] of Object.entries(o))
|
|
2401
|
+
n !== false && n !== null && n !== void 0 && (t[e] = n);
|
|
2402
|
+
},
|
|
2403
|
+
getSvgContent(t) {
|
|
2404
|
+
return this.symbol && (t = t.getElementById(this.symbol), !t) ? null : (this.transformSource && (t = t.cloneNode(true), t = this.transformSource(t)), this.title && (this.transformSource || (t = t.cloneNode(true)), kt(t, this.title)), t);
|
|
2405
|
+
},
|
|
2406
|
+
/**
|
|
2407
|
+
* Get svgElSource
|
|
2408
|
+
* @param {string} src
|
|
2409
|
+
*/
|
|
2410
|
+
async getSource(t) {
|
|
2411
|
+
try {
|
|
2412
|
+
re[t] || (re[t] = wt(this.download(t))), this.svgElSource && re[t].getIsPending() && !this.keepDuringLoading && (this.svgElSource = null, this.$emit("unloaded"));
|
|
2413
|
+
const o = await re[t];
|
|
2414
|
+
this.svgElSource = o, await this.$nextTick(), this.$emit("loaded", this.$el);
|
|
2415
|
+
} catch (o) {
|
|
2416
|
+
this.svgElSource && (this.svgElSource = null, this.$emit("unloaded")), delete re[t], this.$emit("error", o);
|
|
2417
|
+
}
|
|
2418
|
+
},
|
|
2419
|
+
/**
|
|
2420
|
+
* Get the contents of the SVG
|
|
2421
|
+
* @param {string} url
|
|
2422
|
+
* @returns {PromiseWithState<Element>}
|
|
2423
|
+
*/
|
|
2424
|
+
async download(t) {
|
|
2425
|
+
const o = await fetch(t);
|
|
2426
|
+
if (!o.ok)
|
|
2427
|
+
throw new Error("Error loading SVG");
|
|
2428
|
+
const e = await o.text(), s = new DOMParser().parseFromString(e, "text/xml").getElementsByTagName("svg")[0];
|
|
2429
|
+
if (!s)
|
|
2430
|
+
throw new Error("Loaded file is not a valid SVG");
|
|
2431
|
+
return s;
|
|
2432
|
+
}
|
|
2433
|
+
},
|
|
2434
|
+
watch: {
|
|
2435
|
+
src(t) {
|
|
2436
|
+
this.getSource(t);
|
|
2437
|
+
}
|
|
2438
|
+
},
|
|
2439
|
+
expose: []
|
|
2440
|
+
});
|
|
2441
|
+
function kt(t, o) {
|
|
2442
|
+
const e = t.getElementsByTagName("title");
|
|
2443
|
+
if (e.length)
|
|
2444
|
+
e[0].textContent = o;
|
|
2445
|
+
else {
|
|
2446
|
+
const n = document.createElementNS("http://www.w3.org/2000/svg", "title");
|
|
2447
|
+
n.textContent = o, t.insertBefore(n, t.firstChild);
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
function wt(t) {
|
|
2451
|
+
if (t.getIsPending)
|
|
2452
|
+
return t;
|
|
2453
|
+
let o = true;
|
|
2454
|
+
const e = t.then(
|
|
2455
|
+
(n) => (o = false, n),
|
|
2456
|
+
(n) => {
|
|
2457
|
+
throw o = false, n;
|
|
2458
|
+
}
|
|
2459
|
+
);
|
|
2460
|
+
return e.getIsPending = () => o, e;
|
|
2461
|
+
}
|
|
2462
|
+
const $t = /* @__PURE__ */ vue.defineComponent({
|
|
2463
|
+
__name: "QIconSvg",
|
|
2464
|
+
props: {
|
|
2465
|
+
icon: {},
|
|
2466
|
+
bundle: { default: "" },
|
|
2467
|
+
size: { default: void 0 },
|
|
2468
|
+
class: { default: void 0 }
|
|
2469
|
+
},
|
|
2470
|
+
emits: ["loaded", "unloaded"],
|
|
2471
|
+
setup(t, { emit: o }) {
|
|
2472
|
+
const e = t, n = o, l = vue.computed(() => ({
|
|
2473
|
+
"font-size": e.size !== void 0 ? `${e.size}px` : void 0
|
|
2474
|
+
}));
|
|
2475
|
+
function s(i) {
|
|
2476
|
+
n("loaded", i);
|
|
2477
|
+
}
|
|
2478
|
+
function r() {
|
|
2479
|
+
n("unloaded");
|
|
2480
|
+
}
|
|
2481
|
+
return (i, f) => (vue.openBlock(), vue.createBlock(vue.unref(_t), {
|
|
2482
|
+
class: vue.normalizeClass(["q-icon", "q-icon__svg", e.class]),
|
|
2483
|
+
src: e.bundle,
|
|
2484
|
+
symbol: e.icon,
|
|
2485
|
+
style: vue.normalizeStyle(l.value),
|
|
2486
|
+
onLoaded: s,
|
|
2487
|
+
onUnloaded: r
|
|
2488
|
+
}, null, 8, ["class", "src", "symbol", "style"]));
|
|
2489
|
+
}
|
|
2490
|
+
}), ee = S(ht), qt = S(bt), Lt = S(gt), It = S($t), xt = /* @__PURE__ */ vue.defineComponent({
|
|
2491
|
+
__name: "QList",
|
|
2492
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
2493
|
+
highlighted: { type: [String, Number, Boolean, Symbol], default: void 0 },
|
|
2494
|
+
items: {},
|
|
2495
|
+
groups: { default: () => [] },
|
|
2496
|
+
itemValue: { default: "key" },
|
|
2497
|
+
itemLabel: { default: "label" },
|
|
2498
|
+
disabled: { type: Boolean },
|
|
2499
|
+
class: { default: void 0 }
|
|
2500
|
+
}, {
|
|
2501
|
+
modelValue: {
|
|
2502
|
+
type: [String, Number, Boolean, Symbol]
|
|
2503
|
+
},
|
|
2504
|
+
modelModifiers: {}
|
|
2505
|
+
}),
|
|
2506
|
+
emits: ["update:modelValue"],
|
|
2507
|
+
setup(t, { expose: o }) {
|
|
2508
|
+
const e = t, n = vue.useModel(t, "modelValue"), l = vue.ref(false), s = vue.computed(() => r.value.length > 1 ? "div" : "ul"), r = vue.computed(() => e.groups.length ? e.groups.filter(
|
|
2509
|
+
(c) => e.items.some((b) => b.group === c.id)
|
|
2510
|
+
) : [{ id: "", title: "" }]), i = vue.ref(null);
|
|
2511
|
+
function f(c) {
|
|
2512
|
+
n.value = c;
|
|
2513
|
+
}
|
|
2514
|
+
function L() {
|
|
2515
|
+
l.value = true;
|
|
2516
|
+
}
|
|
2517
|
+
function _() {
|
|
2518
|
+
l.value = false;
|
|
2519
|
+
}
|
|
2520
|
+
function y(c) {
|
|
2521
|
+
var d;
|
|
2522
|
+
if ((d = i.value) != null && d.contains(c.relatedTarget))
|
|
2523
|
+
return;
|
|
2524
|
+
let b;
|
|
2525
|
+
n.value ? b = e.items.findIndex(($) => $[e.itemValue] === n.value) : b = j();
|
|
2526
|
+
const q = l.value;
|
|
2527
|
+
C(b, q);
|
|
2528
|
+
}
|
|
2529
|
+
function U(c) {
|
|
2530
|
+
switch (["ArrowDown", "ArrowUp", "Home", "End"].includes(c.key) && c.preventDefault(), c.key) {
|
|
2531
|
+
case "ArrowDown":
|
|
2532
|
+
z("next");
|
|
2533
|
+
break;
|
|
2534
|
+
case "ArrowUp":
|
|
2535
|
+
z("prev");
|
|
2536
|
+
break;
|
|
2537
|
+
case "Home":
|
|
2538
|
+
z("first");
|
|
2539
|
+
break;
|
|
2540
|
+
case "End":
|
|
2541
|
+
z("last");
|
|
2542
|
+
break;
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
function z(c) {
|
|
2546
|
+
switch (c) {
|
|
2547
|
+
case "next":
|
|
2548
|
+
case "prev":
|
|
2549
|
+
C(X(c));
|
|
2550
|
+
break;
|
|
2551
|
+
case "first":
|
|
2552
|
+
C(j());
|
|
2553
|
+
break;
|
|
2554
|
+
case "last":
|
|
2555
|
+
C(A());
|
|
2556
|
+
break;
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
function C(c, b = false) {
|
|
2560
|
+
var d;
|
|
2561
|
+
(d = V()[c]) == null || d.focus({ preventScroll: b });
|
|
2562
|
+
}
|
|
2563
|
+
function V() {
|
|
2564
|
+
var b;
|
|
2565
|
+
const c = (b = i.value) == null ? void 0 : b.querySelectorAll("li");
|
|
2566
|
+
return c ? Array.from(c) : [];
|
|
2567
|
+
}
|
|
2568
|
+
function W(c) {
|
|
2569
|
+
return V()[c];
|
|
2570
|
+
}
|
|
2571
|
+
function le() {
|
|
2572
|
+
return V().indexOf(document.activeElement);
|
|
2573
|
+
}
|
|
2574
|
+
function j() {
|
|
2575
|
+
const c = V(), b = c.find((q) => P(q));
|
|
2576
|
+
return b ? c.indexOf(b) : -1;
|
|
2577
|
+
}
|
|
2578
|
+
function A() {
|
|
2579
|
+
const c = V(), b = [...c].reverse().find((q) => P(q));
|
|
2580
|
+
return b ? c.indexOf(b) : -1;
|
|
2581
|
+
}
|
|
2582
|
+
function Q(c, b, q) {
|
|
2583
|
+
return b === "prev" && c === 0 || b === "next" && c === q.length - 1;
|
|
2584
|
+
}
|
|
2585
|
+
function X(c) {
|
|
2586
|
+
const b = le();
|
|
2587
|
+
return N(b, c);
|
|
2588
|
+
}
|
|
2589
|
+
function N(c, b) {
|
|
2590
|
+
const q = V();
|
|
2591
|
+
if (Q(c, b, q))
|
|
2592
|
+
return c;
|
|
2593
|
+
let d = c + (b === "next" ? 1 : -1);
|
|
2594
|
+
for (; !P(q[d]); ) {
|
|
2595
|
+
if (Q(d, b, q))
|
|
2596
|
+
return c;
|
|
2597
|
+
d += b === "next" ? 1 : -1;
|
|
2598
|
+
}
|
|
2599
|
+
return d;
|
|
2600
|
+
}
|
|
2601
|
+
function P(c) {
|
|
2602
|
+
return c.tabIndex === -2;
|
|
2603
|
+
}
|
|
2604
|
+
function ae(c) {
|
|
2605
|
+
return c ? e.items.filter((b) => b.group === c) : e.items;
|
|
2606
|
+
}
|
|
2607
|
+
return o({
|
|
2608
|
+
focusItem: C,
|
|
2609
|
+
getItem: W,
|
|
2610
|
+
getAdjacentItemIndex: N,
|
|
2611
|
+
getFirstFocusableItemIndex: j,
|
|
2612
|
+
getLastFocusableItemIndex: A
|
|
2613
|
+
}), (c, b) => (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(s.value), {
|
|
2614
|
+
ref_key: "listRef",
|
|
2615
|
+
ref: i,
|
|
2616
|
+
class: vue.normalizeClass(["q-list", { "q-list--disabled": e.disabled }, e.class]),
|
|
2617
|
+
role: "listbox",
|
|
2618
|
+
tabindex: e.disabled ? -1 : 0,
|
|
2619
|
+
onFocus: y,
|
|
2620
|
+
onMousedown: L,
|
|
2621
|
+
onMouseup: _,
|
|
2622
|
+
onKeydown: U
|
|
2623
|
+
}, {
|
|
2624
|
+
default: vue.withCtx(() => [
|
|
2625
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(r.value, (q) => (vue.openBlock(), vue.createBlock(vue.unref(Qt), {
|
|
2626
|
+
key: q.id,
|
|
2627
|
+
title: r.value.length === 1 ? void 0 : q.title,
|
|
2628
|
+
disabled: q.disabled
|
|
2629
|
+
}, {
|
|
2630
|
+
default: vue.withCtx(() => [
|
|
2631
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(ae(q.id), (d) => (vue.openBlock(), vue.createBlock(vue.unref(At), {
|
|
2632
|
+
key: d[e.itemValue],
|
|
2633
|
+
value: d[e.itemValue],
|
|
2634
|
+
label: d[e.itemLabel],
|
|
2635
|
+
icon: d.icon,
|
|
2636
|
+
disabled: e.disabled || d.disabled,
|
|
2637
|
+
highlighted: e.highlighted === d[e.itemValue],
|
|
2638
|
+
selected: n.value === d[e.itemValue],
|
|
2639
|
+
onSelect: f
|
|
2640
|
+
}, {
|
|
2641
|
+
default: vue.withCtx(() => [
|
|
2642
|
+
vue.renderSlot(c.$slots, "item", { item: d })
|
|
2643
|
+
]),
|
|
2644
|
+
_: 2
|
|
2645
|
+
}, 1032, ["value", "label", "icon", "disabled", "highlighted", "selected"]))), 128))
|
|
2646
|
+
]),
|
|
2647
|
+
_: 2
|
|
2648
|
+
}, 1032, ["title", "disabled"]))), 128))
|
|
2649
|
+
]),
|
|
2650
|
+
_: 3
|
|
2651
|
+
}, 40, ["class", "tabindex"]));
|
|
2652
|
+
}
|
|
2653
|
+
});
|
|
2654
|
+
let Bt = 0;
|
|
2655
|
+
function me(t) {
|
|
2656
|
+
return t || `uid-${++Bt}`;
|
|
2657
|
+
}
|
|
2658
|
+
const St = ["id", "data-key", "tabindex", "aria-label", "aria-selected"], Vt = { class: "q-list-item__check-container" }, Et = {
|
|
2659
|
+
check: {
|
|
2660
|
+
icon: "check"
|
|
2661
|
+
}
|
|
2662
|
+
}, Tt = /* @__PURE__ */ vue.defineComponent({
|
|
2663
|
+
__name: "QListItem",
|
|
2664
|
+
props: {
|
|
2665
|
+
value: { type: [String, Number, Boolean, Symbol] },
|
|
2666
|
+
label: {},
|
|
2667
|
+
icon: { default: void 0 },
|
|
2668
|
+
selected: { type: Boolean },
|
|
2669
|
+
highlighted: { type: Boolean },
|
|
2670
|
+
icons: { default: () => Et },
|
|
2671
|
+
disabled: { type: Boolean }
|
|
2672
|
+
},
|
|
2673
|
+
emits: ["select"],
|
|
2674
|
+
setup(t, { emit: o }) {
|
|
2675
|
+
const e = t, n = o, l = me();
|
|
2676
|
+
function s() {
|
|
2677
|
+
e.disabled || n("select", e.value);
|
|
2678
|
+
}
|
|
2679
|
+
function r(i) {
|
|
2680
|
+
i.key === "Tab" && s(), (i.key === "Enter" || i.key === " ") && (i.preventDefault(), i.stopPropagation(), s());
|
|
2681
|
+
}
|
|
2682
|
+
return (i, f) => (vue.openBlock(), vue.createElementBlock("li", {
|
|
2683
|
+
id: vue.unref(l),
|
|
2684
|
+
"data-key": e.value,
|
|
2685
|
+
role: "option",
|
|
2686
|
+
tabindex: e.disabled ? void 0 : -2,
|
|
2687
|
+
class: vue.normalizeClass([
|
|
2688
|
+
"q-list-item",
|
|
2689
|
+
{
|
|
2690
|
+
"q-list-item--disabled": e.disabled,
|
|
2691
|
+
"q-list-item--selected": e.selected,
|
|
2692
|
+
"q-list-item--highlighted": e.highlighted
|
|
2693
|
+
}
|
|
2694
|
+
]),
|
|
2695
|
+
"aria-label": e.label,
|
|
2696
|
+
"aria-selected": e.disabled ? void 0 : e.selected,
|
|
2697
|
+
onKeydown: r,
|
|
2698
|
+
onClick: vue.withModifiers(s, ["stop", "prevent"])
|
|
2699
|
+
}, [
|
|
2700
|
+
vue.renderSlot(i.$slots, "default", {}, () => [
|
|
2701
|
+
e.icon ? (vue.openBlock(), vue.createBlock(vue.unref(ee), vue.normalizeProps(vue.mergeProps({ key: 0 }, e.icon)), null, 16)) : vue.createCommentVNode("", true),
|
|
2702
|
+
vue.createTextVNode(" " + vue.toDisplayString(e.label), 1)
|
|
2703
|
+
]),
|
|
2704
|
+
vue.createElementVNode("div", Vt, [
|
|
2705
|
+
e.selected ? (vue.openBlock(), vue.createBlock(vue.unref(ee), vue.mergeProps({ key: 0 }, e.icons.check, { class: "q-list-item__check" }), null, 16)) : vue.createCommentVNode("", true)
|
|
2706
|
+
])
|
|
2707
|
+
], 42, St));
|
|
2708
|
+
}
|
|
2709
|
+
}), Dt = ["aria-labelledby"], zt = ["id"], Ct = /* @__PURE__ */ vue.defineComponent({
|
|
2710
|
+
__name: "QListItemGroup",
|
|
2711
|
+
props: {
|
|
2712
|
+
title: { default: "" },
|
|
2713
|
+
disabled: { type: Boolean }
|
|
2714
|
+
},
|
|
2715
|
+
setup(t) {
|
|
2716
|
+
const o = t, e = me();
|
|
2717
|
+
return (n, l) => (vue.openBlock(), vue.createElementBlock("ul", {
|
|
2718
|
+
class: "q-list-item-group",
|
|
2719
|
+
role: "group",
|
|
2720
|
+
"aria-labelledby": o.title ? vue.unref(e) : void 0
|
|
2721
|
+
}, [
|
|
2722
|
+
o.title ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
2723
|
+
key: 0,
|
|
2724
|
+
id: vue.unref(e),
|
|
2725
|
+
class: "q-list-item-group__title",
|
|
2726
|
+
role: "presentation"
|
|
2727
|
+
}, vue.toDisplayString(o.title), 9, zt)) : vue.createCommentVNode("", true),
|
|
2728
|
+
vue.renderSlot(n.$slots, "default")
|
|
2729
|
+
], 8, Dt));
|
|
2730
|
+
}
|
|
2731
|
+
}), Re = S(xt), At = S(Tt), Qt = S(Ct);
|
|
2732
|
+
function Mt(t, o, e = "right", n) {
|
|
2733
|
+
const l = t.getBoundingClientRect(), s = l.x + window.scrollX, r = l.y + window.scrollY, i = o == null ? void 0 : o.getBoundingClientRect(), f = (i == null ? void 0 : i.width) ?? 0, L = (i == null ? void 0 : i.height) ?? 0;
|
|
2734
|
+
let _ = e;
|
|
2735
|
+
i && ge(l, i, _) !== 0 && (_ = Ot(l, i, _));
|
|
2736
|
+
const y = { x: 0, y: 0, placement: _ };
|
|
2737
|
+
switch (_) {
|
|
2738
|
+
case "top":
|
|
2739
|
+
n === "anchor" ? y.x = s : y.x = s + (l.width - f) / 2, y.y = r - L;
|
|
2740
|
+
break;
|
|
2741
|
+
case "bottom":
|
|
2742
|
+
n === "anchor" ? y.x = s : y.x = s + (l.width - f) / 2, y.y = r + l.height;
|
|
2743
|
+
break;
|
|
2744
|
+
case "left":
|
|
2745
|
+
y.x = s - f, y.y = r + l.height / 2 - L / 2;
|
|
2746
|
+
break;
|
|
2747
|
+
case "right":
|
|
2748
|
+
y.x = s + l.width, y.y = r + l.height / 2 - L / 2;
|
|
2749
|
+
break;
|
|
2750
|
+
}
|
|
2751
|
+
return y.x = Math.max(0, y.x), y.y = Math.max(0, y.y), n === "anchor" && l.width >= f && (y.width = l.width), y;
|
|
2752
|
+
}
|
|
2753
|
+
function ge(t, o, e) {
|
|
2754
|
+
let n = 0, l = 0;
|
|
2755
|
+
switch (e) {
|
|
2756
|
+
case "top":
|
|
2757
|
+
n = Te(t, o), l = t.top - o.height;
|
|
2758
|
+
break;
|
|
2759
|
+
case "bottom":
|
|
2760
|
+
n = Te(t, o), l = window.innerHeight - t.top - t.height - o.height;
|
|
2761
|
+
break;
|
|
2762
|
+
case "left":
|
|
2763
|
+
n = t.left - o.width, l = Ee(t, o);
|
|
2764
|
+
break;
|
|
2765
|
+
case "right":
|
|
2766
|
+
n = window.innerWidth - t.left - t.width - o.width, l = Ee(t, o);
|
|
2767
|
+
break;
|
|
2768
|
+
}
|
|
2769
|
+
return Math.min(0, Math.min(n, l));
|
|
2770
|
+
}
|
|
2771
|
+
function Ee(t, o) {
|
|
2772
|
+
return Math.min(
|
|
2773
|
+
window.innerHeight - t.top - t.height / 2 - o.height / 2,
|
|
2774
|
+
t.top + t.height / 2 - o.height / 2
|
|
2775
|
+
);
|
|
2776
|
+
}
|
|
2777
|
+
function Te(t, o) {
|
|
2778
|
+
return Math.min(
|
|
2779
|
+
window.innerWidth - t.left - t.width / 2 - o.width / 2,
|
|
2780
|
+
t.left + t.width / 2 - o.width / 2
|
|
2781
|
+
);
|
|
2782
|
+
}
|
|
2783
|
+
function Ot(t, o, e) {
|
|
2784
|
+
const n = {
|
|
2785
|
+
top: ["bottom", "left", "right"],
|
|
2786
|
+
bottom: ["top", "left", "right"],
|
|
2787
|
+
left: ["right", "top", "bottom"],
|
|
2788
|
+
right: ["left", "top", "bottom"]
|
|
2789
|
+
};
|
|
2790
|
+
let l = e, s = ge(t, o, e);
|
|
2791
|
+
for (const r of n[e]) {
|
|
2792
|
+
const i = ge(t, o, r);
|
|
2793
|
+
i > s && (s = i, l = r);
|
|
2794
|
+
}
|
|
2795
|
+
return l;
|
|
2796
|
+
}
|
|
2797
|
+
function Ft(t) {
|
|
2798
|
+
return typeof t == "string" ? document.querySelector(t) : t;
|
|
2799
|
+
}
|
|
2800
|
+
const Rt = ["role"], Ut = {
|
|
2801
|
+
key: 0,
|
|
2802
|
+
role: "presentation",
|
|
2803
|
+
class: "q-overlay__arrow"
|
|
2804
|
+
}, Nt = /* @__PURE__ */ vue.defineComponent({
|
|
2805
|
+
inheritAttrs: false,
|
|
2806
|
+
__name: "QOverlay",
|
|
2807
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
2808
|
+
anchor: { default: void 0 },
|
|
2809
|
+
appearance: { default: "regular" },
|
|
2810
|
+
arrow: { type: Boolean },
|
|
2811
|
+
attach: { default: "body" },
|
|
2812
|
+
backdropBlur: { type: Boolean },
|
|
2813
|
+
delay: { default: 500 },
|
|
2814
|
+
scrollLock: { type: Boolean },
|
|
2815
|
+
offset: { default: 8 },
|
|
2816
|
+
persistent: { type: Boolean },
|
|
2817
|
+
placement: { default: "right" },
|
|
2818
|
+
spy: { type: Boolean },
|
|
2819
|
+
transition: { default: "fade" },
|
|
2820
|
+
trigger: { default: "click" },
|
|
2821
|
+
width: { default: "auto" },
|
|
2822
|
+
class: { default: void 0 }
|
|
2823
|
+
}, {
|
|
2824
|
+
modelValue: { type: Boolean },
|
|
2825
|
+
modelModifiers: {}
|
|
2826
|
+
}),
|
|
2827
|
+
emits: /* @__PURE__ */ vue.mergeModels(["enter", "leave"], ["update:modelValue"]),
|
|
2828
|
+
setup(t, { emit: o }) {
|
|
2829
|
+
const e = t, n = o, l = vue.useModel(t, "modelValue"), s = vue.computed(() => [
|
|
2830
|
+
"q-overlay",
|
|
2831
|
+
`q-overlay--${i.placement}`,
|
|
2832
|
+
{
|
|
2833
|
+
"q-overlay--independent": e.anchor === void 0,
|
|
2834
|
+
"q-overlay--inverted": e.appearance === "inverted"
|
|
2835
|
+
},
|
|
2836
|
+
e.class
|
|
2837
|
+
]), r = vue.computed(
|
|
2838
|
+
() => (l.value || i.animating) && (e.anchor === void 0 || e.trigger === "click")
|
|
2839
|
+
), i = vue.reactive({
|
|
2840
|
+
animating: false,
|
|
2841
|
+
top: 0,
|
|
2842
|
+
left: 0,
|
|
2843
|
+
width: 0,
|
|
2844
|
+
placement: e.placement
|
|
2845
|
+
});
|
|
2846
|
+
vue.watch(l, () => i.animating = true);
|
|
2847
|
+
const f = vue.computed(() => {
|
|
2848
|
+
if (e.anchor === void 0)
|
|
2849
|
+
return;
|
|
2850
|
+
const p = ["top", "bottom"].includes(i.placement) ? i.width : void 0;
|
|
2851
|
+
return {
|
|
2852
|
+
top: `${i.top}px`,
|
|
2853
|
+
left: `${i.left}px`,
|
|
2854
|
+
width: p !== void 0 ? `${p}px` : void 0
|
|
2855
|
+
};
|
|
2856
|
+
}), L = vue.ref(null);
|
|
2857
|
+
function _() {
|
|
2858
|
+
const p = A();
|
|
2859
|
+
if (!p)
|
|
2860
|
+
return;
|
|
2861
|
+
const M = Mt(p, L.value, e.placement, e.width);
|
|
2862
|
+
let R = 0, oe = 0;
|
|
2863
|
+
switch (M.placement) {
|
|
2864
|
+
case "top":
|
|
2865
|
+
oe = -(e.offset || 0);
|
|
2866
|
+
break;
|
|
2867
|
+
case "bottom":
|
|
2868
|
+
oe = e.offset || 0;
|
|
2869
|
+
break;
|
|
2870
|
+
case "left":
|
|
2871
|
+
R = -(e.offset || 0);
|
|
2872
|
+
break;
|
|
2873
|
+
case "right":
|
|
2874
|
+
R = e.offset || 0;
|
|
2875
|
+
break;
|
|
2876
|
+
}
|
|
2877
|
+
i.left = M.x + R, i.top = M.y + oe, i.width = M.width, i.placement = M.placement;
|
|
2878
|
+
}
|
|
2879
|
+
vue.watch([l, () => e.placement], _);
|
|
2880
|
+
let y;
|
|
2881
|
+
function U() {
|
|
2882
|
+
C(0);
|
|
2883
|
+
}
|
|
2884
|
+
function z() {
|
|
2885
|
+
C(e.delay);
|
|
2886
|
+
}
|
|
2887
|
+
function C(p) {
|
|
2888
|
+
y || (y = window.setTimeout(() => {
|
|
2889
|
+
l.value = true;
|
|
2890
|
+
}, p));
|
|
2891
|
+
}
|
|
2892
|
+
function V() {
|
|
2893
|
+
clearTimeout(y), y = void 0, l.value = false, vue.nextTick(() => {
|
|
2894
|
+
if (e.anchor && e.trigger === "click") {
|
|
2895
|
+
const p = A();
|
|
2896
|
+
p == null || p.focus();
|
|
2897
|
+
}
|
|
2898
|
+
});
|
|
2899
|
+
}
|
|
2900
|
+
let W;
|
|
2901
|
+
function le() {
|
|
2902
|
+
n("enter");
|
|
2903
|
+
}
|
|
2904
|
+
function j() {
|
|
2905
|
+
window.clearTimeout(W), W = window.setTimeout(() => i.animating = false, 200), n("leave");
|
|
2906
|
+
}
|
|
2907
|
+
function A() {
|
|
2908
|
+
return e.anchor ? Ft(e.anchor) : null;
|
|
2909
|
+
}
|
|
2910
|
+
let Q;
|
|
2911
|
+
function X() {
|
|
2912
|
+
vue.nextTick(() => {
|
|
2913
|
+
const p = A();
|
|
2914
|
+
if (p)
|
|
2915
|
+
switch (Q = new MutationObserver(_), Q.observe(p, {
|
|
2916
|
+
attributes: false,
|
|
2917
|
+
childList: true,
|
|
2918
|
+
characterData: true,
|
|
2919
|
+
subtree: true
|
|
2920
|
+
}), e.trigger) {
|
|
2921
|
+
case "click":
|
|
2922
|
+
p.addEventListener("click", U);
|
|
2923
|
+
break;
|
|
2924
|
+
case "hover":
|
|
2925
|
+
p.addEventListener("mouseenter", z), p.addEventListener("mouseleave", V), p.addEventListener("focusin", U), p.addEventListener("focusout", V);
|
|
2926
|
+
break;
|
|
2927
|
+
}
|
|
2928
|
+
});
|
|
2929
|
+
}
|
|
2930
|
+
function N() {
|
|
2931
|
+
const p = A();
|
|
2932
|
+
if (p)
|
|
2933
|
+
switch (Q == null || Q.disconnect(), e.trigger) {
|
|
2934
|
+
case "click":
|
|
2935
|
+
p.removeEventListener("click", U);
|
|
2936
|
+
break;
|
|
2937
|
+
case "hover":
|
|
2938
|
+
p.removeEventListener("mouseenter", z), p.removeEventListener("mouseleave", V), p.removeEventListener("focusin", U), p.removeEventListener("focusout", V);
|
|
2939
|
+
break;
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
function P() {
|
|
2943
|
+
vue.nextTick(() => {
|
|
2944
|
+
window.addEventListener("resize", _), e.scrollLock || window.addEventListener("scroll", _), _();
|
|
2945
|
+
});
|
|
2946
|
+
}
|
|
2947
|
+
function ae() {
|
|
2948
|
+
window.removeEventListener("resize", _), e.scrollLock || window.removeEventListener("scroll", _);
|
|
2949
|
+
}
|
|
2950
|
+
let c;
|
|
2951
|
+
function b() {
|
|
2952
|
+
A() ? (_(), c = window.setTimeout(b, 100)) : V();
|
|
2953
|
+
}
|
|
2954
|
+
function q() {
|
|
2955
|
+
P(), e.spy && b(), e.scrollLock && document.body.classList.add("no-scroll"), vue.nextTick(() => {
|
|
2956
|
+
var p;
|
|
2957
|
+
(e.anchor === void 0 || e.trigger === "click") && ((p = L.value) == null || p.focus());
|
|
2958
|
+
});
|
|
2959
|
+
}
|
|
2960
|
+
function d() {
|
|
2961
|
+
ae(), e.spy && (clearTimeout(c), c = void 0), e.scrollLock && document.body.classList.remove("no-scroll");
|
|
2962
|
+
}
|
|
2963
|
+
function $() {
|
|
2964
|
+
e.persistent || V();
|
|
2965
|
+
}
|
|
2966
|
+
return vue.onBeforeUnmount(() => {
|
|
2967
|
+
N(), d();
|
|
2968
|
+
}), vue.onMounted(() => {
|
|
2969
|
+
vue.nextTick(() => {
|
|
2970
|
+
X(), _();
|
|
2971
|
+
});
|
|
2972
|
+
}), vue.watch(
|
|
2973
|
+
l,
|
|
2974
|
+
(p) => {
|
|
2975
|
+
p ? q() : d();
|
|
2976
|
+
},
|
|
2977
|
+
{ immediate: true }
|
|
2978
|
+
), (p, M) => (vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
2979
|
+
disabled: !l.value && !i.animating || !e.attach,
|
|
2980
|
+
to: e.attach
|
|
2981
|
+
}, [
|
|
2982
|
+
r.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2983
|
+
key: 0,
|
|
2984
|
+
class: vue.normalizeClass([
|
|
2985
|
+
"q-overlay__underlay",
|
|
2986
|
+
{ "q-overlay__underlay--blur": e.backdropBlur }
|
|
2987
|
+
])
|
|
2988
|
+
}, null, 2)) : vue.createCommentVNode("", true),
|
|
2989
|
+
vue.createVNode(vue.Transition, {
|
|
2990
|
+
name: e.transition,
|
|
2991
|
+
appear: "",
|
|
2992
|
+
onEnter: le,
|
|
2993
|
+
onLeave: j
|
|
2994
|
+
}, {
|
|
2995
|
+
default: vue.withCtx(() => [
|
|
2996
|
+
l.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2997
|
+
key: 0,
|
|
2998
|
+
class: vue.normalizeClass(s.value),
|
|
2999
|
+
style: vue.normalizeStyle(f.value)
|
|
3000
|
+
}, [
|
|
3001
|
+
vue.createElementVNode("div", vue.mergeProps({
|
|
3002
|
+
class: "q-overlay__content",
|
|
3003
|
+
ref_key: "overlayRef",
|
|
3004
|
+
ref: L,
|
|
3005
|
+
tabindex: "-1",
|
|
3006
|
+
role: r.value ? "dialog" : void 0
|
|
3007
|
+
}, p.$attrs, {
|
|
3008
|
+
onKeydown: vue.withKeys($, ["escape"]),
|
|
3009
|
+
onBlur: $
|
|
3010
|
+
}), [
|
|
3011
|
+
e.arrow ? (vue.openBlock(), vue.createElementBlock("div", Ut)) : vue.createCommentVNode("", true),
|
|
3012
|
+
vue.renderSlot(p.$slots, "default")
|
|
3013
|
+
], 16, Rt)
|
|
3014
|
+
], 6)) : vue.createCommentVNode("", true)
|
|
3015
|
+
]),
|
|
3016
|
+
_: 3
|
|
3017
|
+
}, 8, ["name"])
|
|
3018
|
+
], 8, ["disabled", "to"]));
|
|
3019
|
+
}
|
|
3020
|
+
}), ve = S(Nt), Ht = ["id"], Kt = {
|
|
3021
|
+
key: 0,
|
|
3022
|
+
class: "q-field__label"
|
|
3023
|
+
}, Gt = ["for"], Wt = {
|
|
3024
|
+
key: 0,
|
|
3025
|
+
class: "q-field__prepend"
|
|
3026
|
+
}, jt = {
|
|
3027
|
+
key: 1,
|
|
3028
|
+
class: "q-field__append"
|
|
3029
|
+
}, Xt = {
|
|
3030
|
+
key: 1,
|
|
3031
|
+
class: "q-field__extras"
|
|
3032
|
+
}, Yt = /* @__PURE__ */ vue.defineComponent({
|
|
3033
|
+
inheritAttrs: false,
|
|
3034
|
+
__name: "QField",
|
|
3035
|
+
props: {
|
|
3036
|
+
id: { default: void 0 },
|
|
3037
|
+
label: { default: "" },
|
|
3038
|
+
for: { default: void 0 },
|
|
3039
|
+
size: { default: "medium" },
|
|
3040
|
+
readonly: { type: Boolean },
|
|
3041
|
+
disabled: { type: Boolean },
|
|
3042
|
+
required: { type: Boolean },
|
|
3043
|
+
class: { default: void 0 }
|
|
3044
|
+
},
|
|
3045
|
+
setup(t, { expose: o }) {
|
|
3046
|
+
const e = t, n = me(e.id), l = vue.ref(null), s = vue.computed(() => e.required && !e.readonly && !e.disabled);
|
|
3047
|
+
return o({
|
|
3048
|
+
fieldRef: l
|
|
3049
|
+
}), (r, i) => (vue.openBlock(), vue.createElementBlock("div", {
|
|
3050
|
+
id: vue.unref(n),
|
|
3051
|
+
class: vue.normalizeClass([
|
|
3052
|
+
"q-field",
|
|
3053
|
+
`q-field--${e.size}`,
|
|
3054
|
+
{
|
|
3055
|
+
"q-field--readonly": e.readonly,
|
|
3056
|
+
"q-field--disabled": e.disabled,
|
|
3057
|
+
"q-field--required": s.value
|
|
3058
|
+
},
|
|
3059
|
+
e.class
|
|
3060
|
+
])
|
|
3061
|
+
}, [
|
|
3062
|
+
e.label ? (vue.openBlock(), vue.createElementBlock("div", Kt, [
|
|
3063
|
+
vue.renderSlot(r.$slots, "label.prepend"),
|
|
3064
|
+
vue.createElementVNode("label", {
|
|
3065
|
+
for: e.for
|
|
3066
|
+
}, vue.toDisplayString(e.label), 9, Gt),
|
|
3067
|
+
vue.renderSlot(r.$slots, "label.append")
|
|
3068
|
+
])) : vue.createCommentVNode("", true),
|
|
3069
|
+
vue.renderSlot(r.$slots, "control", {}, () => [
|
|
3070
|
+
vue.createElementVNode("div", vue.mergeProps({
|
|
3071
|
+
class: "q-field__control",
|
|
3072
|
+
ref_key: "fieldRef",
|
|
3073
|
+
ref: l
|
|
3074
|
+
}, r.$attrs), [
|
|
3075
|
+
r.$slots.prepend ? (vue.openBlock(), vue.createElementBlock("div", Wt, [
|
|
3076
|
+
vue.renderSlot(r.$slots, "prepend")
|
|
3077
|
+
])) : vue.createCommentVNode("", true),
|
|
3078
|
+
vue.renderSlot(r.$slots, "default"),
|
|
3079
|
+
r.$slots.append ? (vue.openBlock(), vue.createElementBlock("div", jt, [
|
|
3080
|
+
vue.renderSlot(r.$slots, "append")
|
|
3081
|
+
])) : vue.createCommentVNode("", true)
|
|
3082
|
+
], 16)
|
|
3083
|
+
]),
|
|
3084
|
+
r.$slots.extras ? (vue.openBlock(), vue.createElementBlock("div", Xt, [
|
|
3085
|
+
vue.renderSlot(r.$slots, "extras")
|
|
3086
|
+
])) : vue.createCommentVNode("", true)
|
|
3087
|
+
], 10, Ht));
|
|
3088
|
+
}
|
|
3089
|
+
}), qe = S(Yt), Zt = ["id", "type", "role", "required", "placeholder", "readonly", "disabled", "maxlength"], Jt = /* @__PURE__ */ vue.defineComponent({
|
|
3090
|
+
inheritAttrs: false,
|
|
3091
|
+
__name: "QTextField",
|
|
3092
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
3093
|
+
id: { default: void 0 },
|
|
3094
|
+
placeholder: { default: "" },
|
|
3095
|
+
label: { default: "" },
|
|
3096
|
+
size: { default: void 0 },
|
|
3097
|
+
maxLength: { default: void 0 },
|
|
3098
|
+
readonly: { type: Boolean },
|
|
3099
|
+
disabled: { type: Boolean },
|
|
3100
|
+
required: { type: Boolean },
|
|
3101
|
+
role: { default: void 0 },
|
|
3102
|
+
type: { default: "text" },
|
|
3103
|
+
class: { default: void 0 }
|
|
3104
|
+
}, {
|
|
3105
|
+
modelValue: {},
|
|
3106
|
+
modelModifiers: {}
|
|
3107
|
+
}),
|
|
3108
|
+
emits: ["update:modelValue"],
|
|
3109
|
+
setup(t, { expose: o }) {
|
|
3110
|
+
const e = t, n = vue.useModel(t, "modelValue"), l = me(e.id), s = vue.ref(null), r = vue.ref(null), i = vue.computed(
|
|
3111
|
+
() => e.readonly || e.disabled ? "" : e.placeholder
|
|
3112
|
+
);
|
|
3113
|
+
return o({
|
|
3114
|
+
fieldRef: vue.computed(() => {
|
|
3115
|
+
var f;
|
|
3116
|
+
return (f = s.value) == null ? void 0 : f.fieldRef;
|
|
3117
|
+
}),
|
|
3118
|
+
inputRef: r
|
|
3119
|
+
}), (f, L) => (vue.openBlock(), vue.createBlock(vue.unref(qe), {
|
|
3120
|
+
ref_key: "fieldRef",
|
|
3121
|
+
ref: s,
|
|
3122
|
+
class: vue.normalizeClass(["q-text-field", e.class]),
|
|
3123
|
+
for: vue.unref(l),
|
|
3124
|
+
label: e.label,
|
|
3125
|
+
size: e.size,
|
|
3126
|
+
readonly: e.readonly,
|
|
3127
|
+
disabled: e.disabled,
|
|
3128
|
+
required: e.required
|
|
3129
|
+
}, vue.createSlots({
|
|
3130
|
+
"label.prepend": vue.withCtx(() => [
|
|
3131
|
+
vue.renderSlot(f.$slots, "label.prepend")
|
|
3132
|
+
]),
|
|
3133
|
+
"label.append": vue.withCtx(() => [
|
|
3134
|
+
vue.renderSlot(f.$slots, "label.append")
|
|
3135
|
+
]),
|
|
3136
|
+
default: vue.withCtx(() => [
|
|
3137
|
+
vue.withDirectives(vue.createElementVNode("input", vue.mergeProps({
|
|
3138
|
+
"onUpdate:modelValue": L[0] || (L[0] = (_) => n.value = _),
|
|
3139
|
+
ref_key: "inputRef",
|
|
3140
|
+
ref: r,
|
|
3141
|
+
id: vue.unref(l),
|
|
3142
|
+
class: "q-text-field__input",
|
|
3143
|
+
type: e.type,
|
|
3144
|
+
role: e.role,
|
|
3145
|
+
required: e.required,
|
|
3146
|
+
placeholder: i.value,
|
|
3147
|
+
readonly: e.readonly,
|
|
3148
|
+
disabled: e.disabled,
|
|
3149
|
+
maxlength: e.maxLength
|
|
3150
|
+
}, f.$attrs), null, 16, Zt), [
|
|
3151
|
+
[vue.vModelDynamic, n.value]
|
|
3152
|
+
])
|
|
3153
|
+
]),
|
|
3154
|
+
_: 2
|
|
3155
|
+
}, [
|
|
3156
|
+
f.$slots.prepend ? {
|
|
3157
|
+
name: "prepend",
|
|
3158
|
+
fn: vue.withCtx(() => [
|
|
3159
|
+
vue.renderSlot(f.$slots, "prepend")
|
|
3160
|
+
]),
|
|
3161
|
+
key: "0"
|
|
3162
|
+
} : void 0,
|
|
3163
|
+
f.$slots.append ? {
|
|
3164
|
+
name: "append",
|
|
3165
|
+
fn: vue.withCtx(() => [
|
|
3166
|
+
vue.renderSlot(f.$slots, "append")
|
|
3167
|
+
]),
|
|
3168
|
+
key: "1"
|
|
3169
|
+
} : void 0,
|
|
3170
|
+
f.$slots.extras ? {
|
|
3171
|
+
name: "extras",
|
|
3172
|
+
fn: vue.withCtx(() => [
|
|
3173
|
+
vue.renderSlot(f.$slots, "extras")
|
|
3174
|
+
]),
|
|
3175
|
+
key: "2"
|
|
3176
|
+
} : void 0
|
|
3177
|
+
]), 1032, ["class", "for", "label", "size", "readonly", "disabled", "required"]));
|
|
3178
|
+
}
|
|
3179
|
+
}), Pt = S(Jt), eo = ["data-key"], to = {
|
|
3180
|
+
key: 0,
|
|
3181
|
+
class: "q-select__loader"
|
|
3182
|
+
}, oo = {
|
|
3183
|
+
key: 2,
|
|
3184
|
+
class: "q-select__loader"
|
|
3185
|
+
}, no = {
|
|
3186
|
+
noData: "No data available"
|
|
3187
|
+
}, lo = {
|
|
3188
|
+
chevron: {
|
|
3189
|
+
icon: "chevron-down"
|
|
3190
|
+
},
|
|
3191
|
+
clear: {
|
|
3192
|
+
icon: "close"
|
|
3193
|
+
}
|
|
3194
|
+
}, ao = /* @__PURE__ */ vue.defineComponent({
|
|
3195
|
+
__name: "QCombobox",
|
|
3196
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
3197
|
+
id: { default: void 0 },
|
|
3198
|
+
placeholder: { default: "" },
|
|
3199
|
+
selectionMode: { default: "automatic" },
|
|
3200
|
+
filterMode: { default: "builtin" },
|
|
3201
|
+
label: { default: "" },
|
|
3202
|
+
clearable: { type: Boolean },
|
|
3203
|
+
readonly: { type: Boolean },
|
|
3204
|
+
disabled: { type: Boolean },
|
|
3205
|
+
required: { type: Boolean },
|
|
3206
|
+
loading: { type: Boolean },
|
|
3207
|
+
items: {},
|
|
3208
|
+
groups: { default: () => [] },
|
|
3209
|
+
itemValue: { default: "key" },
|
|
3210
|
+
itemLabel: { default: "label" },
|
|
3211
|
+
emptyValue: { type: [String, Number, Boolean, Symbol], default: void 0 },
|
|
3212
|
+
size: { default: void 0 },
|
|
3213
|
+
texts: { default: () => no },
|
|
3214
|
+
icons: { default: () => lo },
|
|
3215
|
+
class: { default: void 0 }
|
|
3216
|
+
}, {
|
|
3217
|
+
modelValue: {
|
|
3218
|
+
type: [String, Number, Boolean, Symbol]
|
|
3219
|
+
},
|
|
3220
|
+
modelModifiers: {},
|
|
3221
|
+
open: { type: Boolean },
|
|
3222
|
+
openModifiers: {},
|
|
3223
|
+
search: { default: "" },
|
|
3224
|
+
searchModifiers: {}
|
|
3225
|
+
}),
|
|
3226
|
+
emits: /* @__PURE__ */ vue.mergeModels(["before-show", "before-hide", "show", "hide"], ["update:modelValue", "update:open", "update:search"]),
|
|
3227
|
+
setup(t, { expose: o, emit: e }) {
|
|
3228
|
+
const n = t, l = e, s = vue.useModel(t, "modelValue"), r = vue.useModel(t, "open"), i = vue.useModel(t, "search"), f = vue.ref(void 0), L = vue.ref(null), _ = vue.ref(null), y = vue.ref(null);
|
|
3229
|
+
vue.onMounted(Q);
|
|
3230
|
+
const U = vue.computed(() => n.clearable && !n.readonly && !n.disabled), z = vue.computed(() => {
|
|
3231
|
+
var a;
|
|
3232
|
+
return n.filterMode === "manual" || !j.value ? n.items : (a = n.items) == null ? void 0 : a.filter(
|
|
3233
|
+
(g) => g[n.itemLabel].toLowerCase().startsWith(i.value.toLowerCase())
|
|
3234
|
+
);
|
|
3235
|
+
}), C = vue.computed(() => {
|
|
3236
|
+
var a;
|
|
3237
|
+
return (a = n.items) == null ? void 0 : a.find((g) => g[n.itemValue] === s.value);
|
|
3238
|
+
}), V = vue.computed(() => C.value === void 0), W = vue.computed(() => {
|
|
3239
|
+
const a = f.value;
|
|
3240
|
+
if (a !== void 0 && z.value[a])
|
|
3241
|
+
return z.value[a];
|
|
3242
|
+
}), le = vue.computed(() => {
|
|
3243
|
+
var g;
|
|
3244
|
+
if (f.value === void 0)
|
|
3245
|
+
return;
|
|
3246
|
+
const a = (g = _.value) == null ? void 0 : g.getItem(f.value);
|
|
3247
|
+
return a == null ? void 0 : a.id;
|
|
3248
|
+
}), j = vue.computed(() => {
|
|
3249
|
+
var a;
|
|
3250
|
+
return i.value.length > 0 && i.value !== ((a = C.value) == null ? void 0 : a[n.itemLabel]);
|
|
3251
|
+
});
|
|
3252
|
+
function A(a) {
|
|
3253
|
+
s.value = a, N();
|
|
3254
|
+
}
|
|
3255
|
+
function Q() {
|
|
3256
|
+
var g;
|
|
3257
|
+
const a = ((g = C.value) == null ? void 0 : g[n.itemLabel]) || "";
|
|
3258
|
+
i.value !== a && (i.value = a);
|
|
3259
|
+
}
|
|
3260
|
+
function X() {
|
|
3261
|
+
r.value || n.readonly || n.disabled || (l("before-show"), r.value = true, M());
|
|
3262
|
+
}
|
|
3263
|
+
function N() {
|
|
3264
|
+
r.value && (l("before-hide"), r.value = false, f.value = void 0);
|
|
3265
|
+
}
|
|
3266
|
+
function P() {
|
|
3267
|
+
r.value ? N() : c();
|
|
3268
|
+
}
|
|
3269
|
+
function ae() {
|
|
3270
|
+
U.value && (s.value = n.emptyValue, f.value = void 0, M());
|
|
3271
|
+
}
|
|
3272
|
+
function c() {
|
|
3273
|
+
if (X(), C.value !== void 0) {
|
|
3274
|
+
const a = z.value.indexOf(C.value);
|
|
3275
|
+
a !== -1 && vue.nextTick(() => Le(a));
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
function b(a) {
|
|
3279
|
+
var g, B;
|
|
3280
|
+
if (!(!a.key || n.readonly || n.disabled))
|
|
3281
|
+
if (["ArrowDown", "ArrowUp", "Home", "End"].includes(a.key) && (a.preventDefault(), a.stopPropagation()), a.key === "Escape")
|
|
3282
|
+
Q(), r.value && N();
|
|
3283
|
+
else if (["ArrowDown", "ArrowUp"].includes(a.key))
|
|
3284
|
+
r.value ? vue.nextTick(() => {
|
|
3285
|
+
if (f.value === void 0)
|
|
3286
|
+
q();
|
|
3287
|
+
else {
|
|
3288
|
+
const O = a.key === "ArrowDown" ? "next" : "prev";
|
|
3289
|
+
$(f.value, O);
|
|
3290
|
+
}
|
|
3291
|
+
}) : (X(), vue.nextTick(() => {
|
|
3292
|
+
a.key === "ArrowDown" ? q() : d();
|
|
3293
|
+
}));
|
|
3294
|
+
else if (a.key === "Enter") {
|
|
3295
|
+
if (W.value === void 0)
|
|
3296
|
+
return;
|
|
3297
|
+
A(W.value[n.itemValue]);
|
|
3298
|
+
} else
|
|
3299
|
+
a.key === "Home" ? f.value = (g = _.value) == null ? void 0 : g.getFirstFocusableItemIndex() : a.key === "End" ? f.value = (B = _.value) == null ? void 0 : B.getLastFocusableItemIndex() : (/^[a-z]$/i.test(a.key) || a.key === "Backspace") && X();
|
|
3300
|
+
}
|
|
3301
|
+
function q() {
|
|
3302
|
+
var a, g;
|
|
3303
|
+
if (V.value)
|
|
3304
|
+
f.value = (g = _.value) == null ? void 0 : g.getFirstFocusableItemIndex();
|
|
3305
|
+
else {
|
|
3306
|
+
const B = z.value.findIndex(
|
|
3307
|
+
(O) => O[n.itemValue] === s.value
|
|
3308
|
+
);
|
|
3309
|
+
B === -1 ? f.value = (a = _.value) == null ? void 0 : a.getFirstFocusableItemIndex() : f.value = B;
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
function d() {
|
|
3313
|
+
var a;
|
|
3314
|
+
f.value = (a = _.value) == null ? void 0 : a.getLastFocusableItemIndex();
|
|
3315
|
+
}
|
|
3316
|
+
function $(a, g) {
|
|
3317
|
+
var B;
|
|
3318
|
+
f.value = (B = _.value) == null ? void 0 : B.getAdjacentItemIndex(a, g);
|
|
3319
|
+
}
|
|
3320
|
+
function p(a) {
|
|
3321
|
+
var g, B, O;
|
|
3322
|
+
!((g = y.value) != null && g.contains(a.relatedTarget)) && !((O = (B = L.value) == null ? void 0 : B.fieldRef) != null && O.contains(a.relatedTarget)) ? (N(), U.value && !i.value && (s.value = n.emptyValue), Q()) : (a.preventDefault(), a.stopPropagation());
|
|
3323
|
+
}
|
|
3324
|
+
function M() {
|
|
3325
|
+
var a, g;
|
|
3326
|
+
(g = (a = L.value) == null ? void 0 : a.inputRef) == null || g.focus();
|
|
3327
|
+
}
|
|
3328
|
+
function R() {
|
|
3329
|
+
M();
|
|
3330
|
+
}
|
|
3331
|
+
function oe() {
|
|
3332
|
+
l("show");
|
|
3333
|
+
}
|
|
3334
|
+
function Ue() {
|
|
3335
|
+
l("hide");
|
|
3336
|
+
}
|
|
3337
|
+
function Le(a) {
|
|
3338
|
+
var B;
|
|
3339
|
+
const g = (B = _.value) == null ? void 0 : B.getItem(a);
|
|
3340
|
+
_.value && (_.value.$el.scrollTop = g == null ? void 0 : g.offsetTop);
|
|
3341
|
+
}
|
|
3342
|
+
return vue.watch(s, Q), vue.watch(
|
|
3343
|
+
() => n.items,
|
|
3344
|
+
(a, g) => {
|
|
3345
|
+
if (!V.value) {
|
|
3346
|
+
const B = g.find((O) => O[n.itemValue] === s.value);
|
|
3347
|
+
i.value === (B == null ? void 0 : B[n.itemLabel]) && Q();
|
|
3348
|
+
}
|
|
3349
|
+
},
|
|
3350
|
+
{ deep: true }
|
|
3351
|
+
), vue.watch(f, (a) => {
|
|
3352
|
+
a !== void 0 && Le(a);
|
|
3353
|
+
}), vue.watch(i, (a) => {
|
|
3354
|
+
a && r.value && n.selectionMode === "automatic" && vue.nextTick(q);
|
|
3355
|
+
}), vue.watch(
|
|
3356
|
+
() => n.loading,
|
|
3357
|
+
(a) => {
|
|
3358
|
+
!a && r.value && vue.nextTick(q);
|
|
3359
|
+
}
|
|
3360
|
+
), o({
|
|
3361
|
+
triggerEl: L
|
|
3362
|
+
}), (a, g) => {
|
|
3363
|
+
var B;
|
|
3364
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
3365
|
+
vue.createVNode(vue.unref(Pt), {
|
|
3366
|
+
modelValue: i.value,
|
|
3367
|
+
"onUpdate:modelValue": g[0] || (g[0] = (O) => i.value = O),
|
|
3368
|
+
id: n.id,
|
|
3369
|
+
label: n.label,
|
|
3370
|
+
required: n.required,
|
|
3371
|
+
ref_key: "triggerEl",
|
|
3372
|
+
ref: L,
|
|
3373
|
+
role: "combobox",
|
|
3374
|
+
placeholder: n.placeholder,
|
|
3375
|
+
class: vue.normalizeClass([
|
|
3376
|
+
"q-combobox",
|
|
3377
|
+
{
|
|
3378
|
+
"q-combobox--readonly": n.readonly,
|
|
3379
|
+
"q-combobox--disabled": n.disabled,
|
|
3380
|
+
"q-combobox--expanded": r.value
|
|
3381
|
+
},
|
|
3382
|
+
n.class
|
|
3383
|
+
]),
|
|
3384
|
+
readonly: n.readonly,
|
|
3385
|
+
disabled: n.disabled,
|
|
3386
|
+
"data-loading": n.loading,
|
|
3387
|
+
autocomplete: "off",
|
|
3388
|
+
"aria-expanded": r.value,
|
|
3389
|
+
"aria-haspopup": "listbox",
|
|
3390
|
+
"aria-autocomplete": "list",
|
|
3391
|
+
"aria-activedescendant": le.value,
|
|
3392
|
+
size: n.size,
|
|
3393
|
+
onClick: c,
|
|
3394
|
+
onFocusout: p,
|
|
3395
|
+
onKeydown: vue.withModifiers(b, ["stop"])
|
|
3396
|
+
}, vue.createSlots({
|
|
3397
|
+
"label.prepend": vue.withCtx(() => [
|
|
3398
|
+
vue.renderSlot(a.$slots, "label.prepend")
|
|
3399
|
+
]),
|
|
3400
|
+
"label.append": vue.withCtx(() => [
|
|
3401
|
+
vue.renderSlot(a.$slots, "label.append")
|
|
3402
|
+
]),
|
|
3403
|
+
append: vue.withCtx(() => [
|
|
3404
|
+
vue.renderSlot(a.$slots, "append"),
|
|
3405
|
+
U.value && i.value ? (vue.openBlock(), vue.createBlock(vue.unref(fe), {
|
|
3406
|
+
key: 0,
|
|
3407
|
+
class: "q-combobox__clear",
|
|
3408
|
+
"b-style": "plain",
|
|
3409
|
+
borderless: "",
|
|
3410
|
+
tabindex: "-1",
|
|
3411
|
+
onClick: ae
|
|
3412
|
+
}, {
|
|
3413
|
+
default: vue.withCtx(() => [
|
|
3414
|
+
vue.createVNode(vue.unref(ee), vue.normalizeProps(vue.guardReactiveProps(n.icons.clear)), null, 16)
|
|
3415
|
+
]),
|
|
3416
|
+
_: 1
|
|
3417
|
+
})) : vue.createCommentVNode("", true),
|
|
3418
|
+
n.readonly ? vue.createCommentVNode("", true) : (vue.openBlock(), vue.createBlock(vue.unref(fe), {
|
|
3419
|
+
key: 1,
|
|
3420
|
+
class: "q-combobox__chevron",
|
|
3421
|
+
"b-style": "plain",
|
|
3422
|
+
borderless: "",
|
|
3423
|
+
tabindex: "-1",
|
|
3424
|
+
disabled: n.disabled,
|
|
3425
|
+
onClick: P
|
|
3426
|
+
}, {
|
|
3427
|
+
default: vue.withCtx(() => [
|
|
3428
|
+
vue.createVNode(vue.unref(ee), vue.normalizeProps(vue.guardReactiveProps(n.icons.chevron)), null, 16)
|
|
3429
|
+
]),
|
|
3430
|
+
_: 1
|
|
3431
|
+
}, 8, ["disabled"]))
|
|
3432
|
+
]),
|
|
3433
|
+
_: 2
|
|
3434
|
+
}, [
|
|
3435
|
+
a.$slots.prepend ? {
|
|
3436
|
+
name: "prepend",
|
|
3437
|
+
fn: vue.withCtx(() => [
|
|
3438
|
+
vue.renderSlot(a.$slots, "prepend")
|
|
3439
|
+
]),
|
|
3440
|
+
key: "0"
|
|
3441
|
+
} : void 0,
|
|
3442
|
+
a.$slots.extras ? {
|
|
3443
|
+
name: "extras",
|
|
3444
|
+
fn: vue.withCtx(() => [
|
|
3445
|
+
vue.renderSlot(a.$slots, "extras")
|
|
3446
|
+
]),
|
|
3447
|
+
key: "1"
|
|
3448
|
+
} : void 0
|
|
3449
|
+
]), 1032, ["modelValue", "id", "label", "required", "placeholder", "class", "readonly", "disabled", "data-loading", "aria-expanded", "aria-activedescendant", "size"]),
|
|
3450
|
+
vue.createVNode(vue.unref(ve), {
|
|
3451
|
+
modelValue: r.value,
|
|
3452
|
+
"onUpdate:modelValue": g[2] || (g[2] = (O) => r.value = O),
|
|
3453
|
+
spy: "",
|
|
3454
|
+
trigger: "manual",
|
|
3455
|
+
placement: "bottom",
|
|
3456
|
+
width: "anchor",
|
|
3457
|
+
offset: 4,
|
|
3458
|
+
anchor: (B = L.value) == null ? void 0 : B.$el,
|
|
3459
|
+
onEnter: oe,
|
|
3460
|
+
onLeave: Ue
|
|
3461
|
+
}, {
|
|
3462
|
+
default: vue.withCtx(() => {
|
|
3463
|
+
var O;
|
|
3464
|
+
return [
|
|
3465
|
+
vue.createElementVNode("div", {
|
|
3466
|
+
ref_key: "contentRef",
|
|
3467
|
+
ref: y,
|
|
3468
|
+
"data-testid": "combobox-dropdown",
|
|
3469
|
+
"data-key": n.id,
|
|
3470
|
+
class: "q-select__body",
|
|
3471
|
+
onFocusout: p
|
|
3472
|
+
}, [
|
|
3473
|
+
vue.renderSlot(a.$slots, "body.prepend"),
|
|
3474
|
+
n.loading ? (vue.openBlock(), vue.createElementBlock("div", to, [
|
|
3475
|
+
vue.createVNode(vue.unref($e), { size: 24 })
|
|
3476
|
+
])) : z.value.length ? (vue.openBlock(), vue.createBlock(vue.unref(Re), {
|
|
3477
|
+
key: 1,
|
|
3478
|
+
ref_key: "listRef",
|
|
3479
|
+
ref: _,
|
|
3480
|
+
class: "q-select__items",
|
|
3481
|
+
modelValue: s.value,
|
|
3482
|
+
"onUpdate:modelValue": [
|
|
3483
|
+
g[1] || (g[1] = (he) => s.value = he),
|
|
3484
|
+
A
|
|
3485
|
+
],
|
|
3486
|
+
highlighted: (O = W.value) == null ? void 0 : O[n.itemValue],
|
|
3487
|
+
items: z.value,
|
|
3488
|
+
groups: a.groups,
|
|
3489
|
+
"item-label": n.itemLabel,
|
|
3490
|
+
"item-value": n.itemValue,
|
|
3491
|
+
onMouseup: R
|
|
3492
|
+
}, {
|
|
3493
|
+
item: vue.withCtx(({ item: he }) => [
|
|
3494
|
+
vue.renderSlot(a.$slots, "item", { item: he })
|
|
3495
|
+
]),
|
|
3496
|
+
_: 3
|
|
3497
|
+
}, 8, ["modelValue", "highlighted", "items", "groups", "item-label", "item-value"])) : (vue.openBlock(), vue.createElementBlock("div", oo, vue.toDisplayString(a.texts.noData), 1)),
|
|
3498
|
+
vue.renderSlot(a.$slots, "body.append")
|
|
3499
|
+
], 40, eo)
|
|
3500
|
+
];
|
|
3501
|
+
}),
|
|
3502
|
+
_: 3
|
|
3503
|
+
}, 8, ["modelValue", "anchor"])
|
|
3504
|
+
], 64);
|
|
3505
|
+
};
|
|
3506
|
+
}
|
|
3507
|
+
});
|
|
3508
|
+
S(ao);
|
|
3509
|
+
const so = {
|
|
3510
|
+
key: 0,
|
|
3511
|
+
class: "q-input-group__prepend"
|
|
3512
|
+
}, io = { key: 0 }, ro = {
|
|
3513
|
+
key: 1,
|
|
3514
|
+
class: "q-input-group__append"
|
|
3515
|
+
}, uo = { key: 0 }, co = /* @__PURE__ */ vue.defineComponent({
|
|
3516
|
+
__name: "QInputGroup",
|
|
3517
|
+
props: {
|
|
3518
|
+
id: { default: void 0 },
|
|
3519
|
+
label: { default: "" },
|
|
3520
|
+
required: { type: Boolean },
|
|
3521
|
+
prependIcon: { default: void 0 },
|
|
3522
|
+
appendIcon: { default: void 0 },
|
|
3523
|
+
size: { default: "large" },
|
|
3524
|
+
class: { default: void 0 }
|
|
3525
|
+
},
|
|
3526
|
+
setup(t) {
|
|
3527
|
+
const o = t;
|
|
3528
|
+
return Me({
|
|
3529
|
+
QField: {
|
|
3530
|
+
size: "block"
|
|
3531
|
+
}
|
|
3532
|
+
}), (e, n) => (vue.openBlock(), vue.createBlock(vue.unref(qe), {
|
|
3533
|
+
id: o.id,
|
|
3534
|
+
class: vue.normalizeClass(["q-input-group", o.class]),
|
|
3535
|
+
label: o.label,
|
|
3536
|
+
required: o.required,
|
|
3537
|
+
size: o.size
|
|
3538
|
+
}, {
|
|
3539
|
+
default: vue.withCtx(() => [
|
|
3540
|
+
e.$slots.prepend || o.prependIcon ? (vue.openBlock(), vue.createElementBlock("div", so, [
|
|
3541
|
+
o.prependIcon ? (vue.openBlock(), vue.createElementBlock("span", io, [
|
|
3542
|
+
vue.createVNode(vue.unref(ee), vue.normalizeProps(vue.guardReactiveProps(o.prependIcon)), null, 16)
|
|
3543
|
+
])) : vue.createCommentVNode("", true),
|
|
3544
|
+
vue.renderSlot(e.$slots, "prepend")
|
|
3545
|
+
])) : vue.createCommentVNode("", true),
|
|
3546
|
+
vue.renderSlot(e.$slots, "default"),
|
|
3547
|
+
e.$slots.append || o.appendIcon ? (vue.openBlock(), vue.createElementBlock("div", ro, [
|
|
3548
|
+
o.appendIcon ? (vue.openBlock(), vue.createElementBlock("span", uo, [
|
|
3549
|
+
vue.createVNode(vue.unref(ee), vue.normalizeProps(vue.guardReactiveProps(o.appendIcon)), null, 16)
|
|
3550
|
+
])) : vue.createCommentVNode("", true),
|
|
3551
|
+
vue.renderSlot(e.$slots, "append")
|
|
3552
|
+
])) : vue.createCommentVNode("", true)
|
|
3553
|
+
]),
|
|
3554
|
+
_: 3
|
|
3555
|
+
}, 8, ["id", "class", "label", "required", "size"]));
|
|
3556
|
+
}
|
|
3557
|
+
}), zo = S(co), fo = /* @__PURE__ */ vue.defineComponent({
|
|
3558
|
+
__name: "QLineLoader",
|
|
3559
|
+
props: {
|
|
3560
|
+
class: { default: void 0 }
|
|
3561
|
+
},
|
|
3562
|
+
setup(t) {
|
|
3563
|
+
const o = t;
|
|
3564
|
+
return (e, n) => (vue.openBlock(), vue.createElementBlock("div", {
|
|
3565
|
+
class: vue.normalizeClass(["q-line-loader", o.class])
|
|
3566
|
+
}, null, 2));
|
|
3567
|
+
}
|
|
3568
|
+
});
|
|
3569
|
+
S(fo);
|
|
3570
|
+
const po = {
|
|
3571
|
+
key: 0,
|
|
3572
|
+
class: "q-popover__header"
|
|
3573
|
+
}, mo = {
|
|
3574
|
+
key: 1,
|
|
3575
|
+
class: "q-popover__body"
|
|
3576
|
+
}, vo = ["innerHTML"], ho = { key: 1 }, bo = /* @__PURE__ */ vue.defineComponent({
|
|
3577
|
+
inheritAttrs: false,
|
|
3578
|
+
__name: "QPopover",
|
|
3579
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
3580
|
+
anchor: {},
|
|
3581
|
+
arrow: { type: Boolean, default: true },
|
|
3582
|
+
attach: { default: "body" },
|
|
3583
|
+
disabled: { type: Boolean },
|
|
3584
|
+
html: { type: Boolean, default: true },
|
|
3585
|
+
placement: { default: "right" },
|
|
3586
|
+
text: {},
|
|
3587
|
+
title: {}
|
|
3588
|
+
}, {
|
|
3589
|
+
modelValue: { type: Boolean },
|
|
3590
|
+
modelModifiers: {}
|
|
3591
|
+
}),
|
|
3592
|
+
emits: ["update:modelValue"],
|
|
3593
|
+
setup(t) {
|
|
3594
|
+
const o = t, e = vue.useModel(t, "modelValue");
|
|
3595
|
+
return (n, l) => (vue.openBlock(), vue.createBlock(vue.unref(ve), {
|
|
3596
|
+
"model-value": e.value,
|
|
3597
|
+
class: "q-popover",
|
|
3598
|
+
trigger: "click",
|
|
3599
|
+
anchor: o.anchor,
|
|
3600
|
+
arrow: o.arrow,
|
|
3601
|
+
attach: o.attach,
|
|
3602
|
+
disabled: o.disabled,
|
|
3603
|
+
placement: o.placement
|
|
3604
|
+
}, {
|
|
3605
|
+
default: vue.withCtx(() => [
|
|
3606
|
+
o.title || n.$slots.header ? (vue.openBlock(), vue.createElementBlock("h3", po, [
|
|
3607
|
+
vue.createTextVNode(vue.toDisplayString(o.title) + " ", 1),
|
|
3608
|
+
vue.renderSlot(n.$slots, "header")
|
|
3609
|
+
])) : vue.createCommentVNode("", true),
|
|
3610
|
+
o.text || n.$slots.body ? (vue.openBlock(), vue.createElementBlock("div", mo, [
|
|
3611
|
+
o.html ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
3612
|
+
key: 0,
|
|
3613
|
+
innerHTML: o.text
|
|
3614
|
+
}, null, 8, vo)) : (vue.openBlock(), vue.createElementBlock("span", ho, vue.toDisplayString(o.text), 1)),
|
|
3615
|
+
vue.renderSlot(n.$slots, "body")
|
|
3616
|
+
])) : vue.createCommentVNode("", true)
|
|
3617
|
+
]),
|
|
3618
|
+
_: 3
|
|
3619
|
+
}, 8, ["model-value", "anchor", "arrow", "attach", "disabled", "placement"]));
|
|
3620
|
+
}
|
|
3621
|
+
});
|
|
3622
|
+
S(bo);
|
|
3623
|
+
const yo = {
|
|
3624
|
+
key: 0,
|
|
3625
|
+
class: "q-select__value"
|
|
3626
|
+
}, go = {
|
|
3627
|
+
key: 1,
|
|
3628
|
+
class: "q-select__placeholder"
|
|
3629
|
+
}, _o = ["data-key"], ko = {
|
|
3630
|
+
key: 0,
|
|
3631
|
+
class: "q-select__loader"
|
|
3632
|
+
}, wo = {
|
|
3633
|
+
placeholder: "Choose..."
|
|
3634
|
+
}, $o = {
|
|
3635
|
+
chevron: {
|
|
3636
|
+
icon: "chevron-down"
|
|
3637
|
+
},
|
|
3638
|
+
clear: {
|
|
3639
|
+
icon: "close"
|
|
3640
|
+
}
|
|
3641
|
+
}, qo = /* @__PURE__ */ vue.defineComponent({
|
|
3642
|
+
__name: "QSelect",
|
|
3643
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
3644
|
+
id: { default: void 0 },
|
|
3645
|
+
label: { default: "" },
|
|
3646
|
+
clearable: { type: Boolean },
|
|
3647
|
+
readonly: { type: Boolean },
|
|
3648
|
+
disabled: { type: Boolean },
|
|
3649
|
+
required: { type: Boolean },
|
|
3650
|
+
loading: { type: Boolean },
|
|
3651
|
+
icons: { default: () => $o },
|
|
3652
|
+
items: {},
|
|
3653
|
+
groups: { default: () => [] },
|
|
3654
|
+
itemValue: { default: "key" },
|
|
3655
|
+
itemLabel: { default: "label" },
|
|
3656
|
+
emptyValue: { type: [String, Number, Boolean, Symbol], default: void 0 },
|
|
3657
|
+
size: { default: void 0 },
|
|
3658
|
+
texts: { default: () => wo },
|
|
3659
|
+
class: { default: "" }
|
|
3660
|
+
}, {
|
|
3661
|
+
modelValue: {
|
|
3662
|
+
type: [String, Number, Boolean, Symbol]
|
|
3663
|
+
},
|
|
3664
|
+
modelModifiers: {}
|
|
3665
|
+
}),
|
|
3666
|
+
emits: /* @__PURE__ */ vue.mergeModels(["before-show", "before-hide", "show", "hide"], ["update:modelValue"]),
|
|
3667
|
+
setup(t, { emit: o }) {
|
|
3668
|
+
const e = t, n = o, l = vue.useModel(t, "modelValue"), s = vue.ref(false), r = vue.ref(""), i = vue.ref(null), f = vue.ref(null), L = vue.ref(null), _ = vue.computed(() => y.value === void 0), y = vue.computed(
|
|
3669
|
+
() => {
|
|
3670
|
+
var d;
|
|
3671
|
+
return (d = e.items) == null ? void 0 : d.find(($) => $[e.itemValue] === l.value);
|
|
3672
|
+
}
|
|
3673
|
+
), U = vue.computed(
|
|
3674
|
+
() => y.value ? y.value[e.itemLabel] : ""
|
|
3675
|
+
), z = vue.computed(
|
|
3676
|
+
() => e.clearable && !e.readonly && !e.disabled && !e.loading
|
|
3677
|
+
);
|
|
3678
|
+
function C(d) {
|
|
3679
|
+
l.value = d, A();
|
|
3680
|
+
}
|
|
3681
|
+
function V() {
|
|
3682
|
+
z.value && C(e.emptyValue);
|
|
3683
|
+
}
|
|
3684
|
+
function W() {
|
|
3685
|
+
e.readonly || e.disabled || (s.value ? A() : j());
|
|
3686
|
+
}
|
|
3687
|
+
function le(d) {
|
|
3688
|
+
var $, p, M;
|
|
3689
|
+
!(($ = L.value) != null && $.contains(d.relatedTarget)) && !((M = (p = i.value) == null ? void 0 : p.fieldRef) != null && M.contains(d.relatedTarget)) && A();
|
|
3690
|
+
}
|
|
3691
|
+
function j() {
|
|
3692
|
+
s.value || (n("before-show"), s.value = true);
|
|
3693
|
+
}
|
|
3694
|
+
function A() {
|
|
3695
|
+
s.value && (n("before-hide"), s.value = false);
|
|
3696
|
+
}
|
|
3697
|
+
function Q() {
|
|
3698
|
+
s.value ? A() : j();
|
|
3699
|
+
}
|
|
3700
|
+
let X;
|
|
3701
|
+
function N(d) {
|
|
3702
|
+
if (!(!d.key || e.readonly || e.disabled)) {
|
|
3703
|
+
if (window.clearTimeout(X), ["Enter", " ", "ArrowDown", "ArrowUp", "Home", "End"].includes(d.key) && (d.preventDefault(), d.stopPropagation()), ["Enter", " "].includes(d.key) && (s.value = true), ["Escape", "Tab"].includes(d.key) && (s.value ? s.value = false : z.value && d.key === "Escape" && V()), d.key === "Delete" && e.clearable && V(), /^[a-z]$/i.test(d.key)) {
|
|
3704
|
+
r.value += d.key.toLowerCase();
|
|
3705
|
+
for (let $ = 0; $ < e.items.length; $++)
|
|
3706
|
+
if (e.items[$][e.itemLabel].toLowerCase().startsWith(r.value)) {
|
|
3707
|
+
q($);
|
|
3708
|
+
break;
|
|
3709
|
+
}
|
|
3710
|
+
}
|
|
3711
|
+
X = window.setTimeout(function() {
|
|
3712
|
+
r.value = "";
|
|
3713
|
+
}, 500);
|
|
3714
|
+
}
|
|
3715
|
+
}
|
|
3716
|
+
function P() {
|
|
3717
|
+
var d;
|
|
3718
|
+
e.loading ? (d = L.value) == null || d.focus() : b(), n("show");
|
|
3719
|
+
}
|
|
3720
|
+
function ae() {
|
|
3721
|
+
c(), n("hide");
|
|
3722
|
+
}
|
|
3723
|
+
function c() {
|
|
3724
|
+
var d, $;
|
|
3725
|
+
($ = (d = i.value) == null ? void 0 : d.fieldRef) == null || $.focus();
|
|
3726
|
+
}
|
|
3727
|
+
function b() {
|
|
3728
|
+
var d;
|
|
3729
|
+
(d = f.value) == null || d.$el.focus();
|
|
3730
|
+
}
|
|
3731
|
+
function q(d) {
|
|
3732
|
+
var $;
|
|
3733
|
+
($ = f.value) == null || $.focusItem(d);
|
|
3734
|
+
}
|
|
3735
|
+
return vue.watch(
|
|
3736
|
+
() => e.loading,
|
|
3737
|
+
(d) => {
|
|
3738
|
+
!d && s.value && vue.nextTick(b);
|
|
3739
|
+
}
|
|
3740
|
+
), (d, $) => {
|
|
3741
|
+
var p, M;
|
|
3742
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
3743
|
+
vue.createVNode(vue.unref(qe), {
|
|
3744
|
+
id: e.id,
|
|
3745
|
+
label: e.label,
|
|
3746
|
+
required: e.required,
|
|
3747
|
+
ref_key: "triggerEl",
|
|
3748
|
+
ref: i,
|
|
3749
|
+
role: "combobox",
|
|
3750
|
+
tabindex: e.disabled ? -1 : 0,
|
|
3751
|
+
class: vue.normalizeClass([
|
|
3752
|
+
"q-select",
|
|
3753
|
+
{
|
|
3754
|
+
"q-select--readonly": e.readonly,
|
|
3755
|
+
"q-select--disabled": e.disabled,
|
|
3756
|
+
"q-select--expanded": s.value
|
|
3757
|
+
},
|
|
3758
|
+
e.class
|
|
3759
|
+
]),
|
|
3760
|
+
readonly: e.readonly,
|
|
3761
|
+
disabled: e.disabled,
|
|
3762
|
+
"data-loading": e.loading,
|
|
3763
|
+
"aria-expanded": s.value,
|
|
3764
|
+
"aria-haspopup": "listbox",
|
|
3765
|
+
size: e.size,
|
|
3766
|
+
onClick: W,
|
|
3767
|
+
onKeydown: vue.withModifiers(N, ["stop"])
|
|
3768
|
+
}, vue.createSlots({
|
|
3769
|
+
append: vue.withCtx(() => [
|
|
3770
|
+
vue.renderSlot(d.$slots, "append"),
|
|
3771
|
+
z.value && l.value ? (vue.openBlock(), vue.createBlock(vue.unref(fe), {
|
|
3772
|
+
key: 0,
|
|
3773
|
+
class: "q-select__clear",
|
|
3774
|
+
"b-style": "plain",
|
|
3775
|
+
borderless: "",
|
|
3776
|
+
tabindex: "-1",
|
|
3777
|
+
onClick: V
|
|
3778
|
+
}, {
|
|
3779
|
+
default: vue.withCtx(() => [
|
|
3780
|
+
vue.createVNode(vue.unref(ee), vue.normalizeProps(vue.guardReactiveProps(e.icons.clear)), null, 16)
|
|
3781
|
+
]),
|
|
3782
|
+
_: 1
|
|
3783
|
+
})) : vue.createCommentVNode("", true),
|
|
3784
|
+
e.readonly ? vue.createCommentVNode("", true) : (vue.openBlock(), vue.createBlock(vue.unref(fe), {
|
|
3785
|
+
key: 1,
|
|
3786
|
+
class: "q-select__chevron",
|
|
3787
|
+
"b-style": "plain",
|
|
3788
|
+
borderless: "",
|
|
3789
|
+
tabindex: "-1",
|
|
3790
|
+
disabled: e.disabled,
|
|
3791
|
+
onClick: Q
|
|
3792
|
+
}, {
|
|
3793
|
+
default: vue.withCtx(() => [
|
|
3794
|
+
vue.createVNode(vue.unref(ee), vue.normalizeProps(vue.guardReactiveProps(e.icons.chevron)), null, 16)
|
|
3795
|
+
]),
|
|
3796
|
+
_: 1
|
|
3797
|
+
}, 8, ["disabled"]))
|
|
3798
|
+
]),
|
|
3799
|
+
default: vue.withCtx(() => [
|
|
3800
|
+
_.value ? (vue.openBlock(), vue.createElementBlock("span", go, [
|
|
3801
|
+
!e.readonly && !e.disabled ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
3802
|
+
vue.createTextVNode(vue.toDisplayString(d.texts.placeholder), 1)
|
|
3803
|
+
], 64)) : vue.createCommentVNode("", true)
|
|
3804
|
+
])) : (vue.openBlock(), vue.createElementBlock("span", yo, vue.toDisplayString(U.value), 1))
|
|
3805
|
+
]),
|
|
3806
|
+
_: 2
|
|
3807
|
+
}, [
|
|
3808
|
+
(p = y.value) != null && p.icon || d.$slots.prepend ? {
|
|
3809
|
+
name: "prepend",
|
|
3810
|
+
fn: vue.withCtx(() => {
|
|
3811
|
+
var R, oe;
|
|
3812
|
+
return [
|
|
3813
|
+
vue.renderSlot(d.$slots, "prepend"),
|
|
3814
|
+
(R = y.value) != null && R.icon ? (vue.openBlock(), vue.createBlock(vue.unref(ee), vue.normalizeProps(vue.mergeProps({ key: 0 }, (oe = y.value) == null ? void 0 : oe.icon)), null, 16)) : vue.createCommentVNode("", true)
|
|
3815
|
+
];
|
|
3816
|
+
}),
|
|
3817
|
+
key: "0"
|
|
3818
|
+
} : void 0,
|
|
3819
|
+
d.$slots.extras ? {
|
|
3820
|
+
name: "extras",
|
|
3821
|
+
fn: vue.withCtx(() => [
|
|
3822
|
+
vue.renderSlot(d.$slots, "extras")
|
|
3823
|
+
]),
|
|
3824
|
+
key: "1"
|
|
3825
|
+
} : void 0
|
|
3826
|
+
]), 1032, ["id", "label", "required", "tabindex", "class", "readonly", "disabled", "data-loading", "aria-expanded", "size"]),
|
|
3827
|
+
vue.createVNode(vue.unref(ve), {
|
|
3828
|
+
modelValue: s.value,
|
|
3829
|
+
"onUpdate:modelValue": $[1] || ($[1] = (R) => s.value = R),
|
|
3830
|
+
spy: "",
|
|
3831
|
+
trigger: "manual",
|
|
3832
|
+
placement: "bottom",
|
|
3833
|
+
width: "anchor",
|
|
3834
|
+
"scroll-lock": "",
|
|
3835
|
+
anchor: (M = i.value) == null ? void 0 : M.$el,
|
|
3836
|
+
offset: 2,
|
|
3837
|
+
onEnter: P,
|
|
3838
|
+
onLeave: ae
|
|
3839
|
+
}, {
|
|
3840
|
+
default: vue.withCtx(() => [
|
|
3841
|
+
vue.createElementVNode("div", {
|
|
3842
|
+
ref_key: "contentRef",
|
|
3843
|
+
ref: L,
|
|
3844
|
+
"data-testid": "combobox-dropdown",
|
|
3845
|
+
"data-key": e.id,
|
|
3846
|
+
class: "q-select__body",
|
|
3847
|
+
tabindex: "-1",
|
|
3848
|
+
onFocusout: le,
|
|
3849
|
+
onKeydown: vue.withModifiers(N, ["stop"])
|
|
3850
|
+
}, [
|
|
3851
|
+
vue.renderSlot(d.$slots, "body.prepend"),
|
|
3852
|
+
e.loading ? (vue.openBlock(), vue.createElementBlock("div", ko, [
|
|
3853
|
+
vue.createVNode(vue.unref($e), { size: 24 })
|
|
3854
|
+
])) : (vue.openBlock(), vue.createBlock(vue.unref(Re), {
|
|
3855
|
+
key: 1,
|
|
3856
|
+
ref_key: "listRef",
|
|
3857
|
+
ref: f,
|
|
3858
|
+
class: "q-select__items",
|
|
3859
|
+
modelValue: l.value,
|
|
3860
|
+
"onUpdate:modelValue": [
|
|
3861
|
+
$[0] || ($[0] = (R) => l.value = R),
|
|
3862
|
+
C
|
|
3863
|
+
],
|
|
3864
|
+
items: e.items,
|
|
3865
|
+
groups: d.groups,
|
|
3866
|
+
"item-label": e.itemLabel,
|
|
3867
|
+
"item-value": e.itemValue
|
|
3868
|
+
}, {
|
|
3869
|
+
item: vue.withCtx(({ item: R }) => [
|
|
3870
|
+
vue.renderSlot(d.$slots, "item", { item: R })
|
|
3871
|
+
]),
|
|
3872
|
+
_: 3
|
|
3873
|
+
}, 8, ["modelValue", "items", "groups", "item-label", "item-value"])),
|
|
3874
|
+
vue.renderSlot(d.$slots, "body.append")
|
|
3875
|
+
], 40, _o)
|
|
3876
|
+
]),
|
|
3877
|
+
_: 3
|
|
3878
|
+
}, 8, ["modelValue", "anchor"])
|
|
3879
|
+
], 64);
|
|
3880
|
+
};
|
|
3881
|
+
}
|
|
3882
|
+
});
|
|
3883
|
+
S(qo);
|
|
3884
|
+
const Lo = /* @__PURE__ */ vue.defineComponent({
|
|
3885
|
+
__name: "QThemeProvider",
|
|
3886
|
+
props: {
|
|
3887
|
+
theme: {}
|
|
3888
|
+
},
|
|
3889
|
+
setup(t) {
|
|
3890
|
+
const o = t;
|
|
3891
|
+
return (e, n) => (vue.openBlock(), vue.createElementBlock("div", {
|
|
3892
|
+
class: vue.normalizeClass(["q-theme-provider", `q-theme--${o.theme}`])
|
|
3893
|
+
}, [
|
|
3894
|
+
vue.renderSlot(e.$slots, "default")
|
|
3895
|
+
], 2));
|
|
3896
|
+
}
|
|
3897
|
+
});
|
|
3898
|
+
S(Lo);
|
|
3899
|
+
const Io = ["innerHTML"], xo = { key: 1 }, Bo = /* @__PURE__ */ vue.defineComponent({
|
|
3900
|
+
__name: "QTooltip",
|
|
3901
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
3902
|
+
id: { default: void 0 },
|
|
3903
|
+
anchor: {},
|
|
3904
|
+
appearance: { default: "inverted" },
|
|
3905
|
+
arrow: { type: Boolean, default: true },
|
|
3906
|
+
attach: { default: "body" },
|
|
3907
|
+
delay: { default: 500 },
|
|
3908
|
+
disabled: { type: Boolean },
|
|
3909
|
+
html: { type: Boolean, default: true },
|
|
3910
|
+
placement: { default: "right" },
|
|
3911
|
+
text: {},
|
|
3912
|
+
trigger: { default: "hover" },
|
|
3913
|
+
class: { default: void 0 }
|
|
3914
|
+
}, {
|
|
3915
|
+
modelValue: { type: Boolean },
|
|
3916
|
+
modelModifiers: {}
|
|
3917
|
+
}),
|
|
3918
|
+
emits: ["update:modelValue"],
|
|
3919
|
+
setup(t) {
|
|
3920
|
+
const o = t, e = vue.useModel(t, "modelValue"), n = me(o.id);
|
|
3921
|
+
return (l, s) => (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
3922
|
+
vue.renderSlot(l.$slots, "anchor", {
|
|
3923
|
+
props: { "aria-describedby": vue.unref(n) }
|
|
3924
|
+
}),
|
|
3925
|
+
vue.createVNode(vue.unref(ve), {
|
|
3926
|
+
"model-value": e.value,
|
|
3927
|
+
anchor: o.anchor,
|
|
3928
|
+
role: "tooltip",
|
|
3929
|
+
id: vue.unref(n),
|
|
3930
|
+
appearance: o.appearance,
|
|
3931
|
+
arrow: o.arrow,
|
|
3932
|
+
attach: o.attach,
|
|
3933
|
+
class: vue.normalizeClass(["q-tooltip", o.class]),
|
|
3934
|
+
delay: o.delay,
|
|
3935
|
+
disabled: o.disabled,
|
|
3936
|
+
placement: o.placement,
|
|
3937
|
+
trigger: o.trigger
|
|
3938
|
+
}, {
|
|
3939
|
+
default: vue.withCtx(() => [
|
|
3940
|
+
o.html ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
3941
|
+
key: 0,
|
|
3942
|
+
innerHTML: o.text
|
|
3943
|
+
}, null, 8, Io)) : (vue.openBlock(), vue.createElementBlock("span", xo, vue.toDisplayString(o.text), 1))
|
|
3944
|
+
]),
|
|
3945
|
+
_: 1
|
|
3946
|
+
}, 8, ["model-value", "anchor", "id", "appearance", "arrow", "attach", "class", "delay", "disabled", "placement", "trigger"])
|
|
3947
|
+
], 64));
|
|
3948
|
+
}
|
|
3949
|
+
});
|
|
3950
|
+
S(Bo);
|
|
3951
|
+
const ChatBotIcon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFIGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDUgNzkuMTYzNDk5LCAyMDE4LzA4LzEzLTE2OjQwOjIyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjAtMDUtMjFUMTg6MTk6NDErMDE6MDAiIHhtcDpNZXRhZGF0YURhdGU9IjIwMjAtMDUtMjFUMTg6MTk6NDErMDE6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIwLTA1LTIxVDE4OjE5OjQxKzAxOjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo4NmI5YWQxZC0yOTk4LTQ2ZjYtYjliYS01NTBlNzgwOGQ5MWUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODZiOWFkMWQtMjk5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";
|
|
3952
|
+
const _hoisted_1 = { class: "q-chatbot" };
|
|
3953
|
+
const _hoisted_2 = { class: "c-sidebar__subtitle" };
|
|
3954
|
+
const _hoisted_3 = ["src"];
|
|
3955
|
+
const _hoisted_4 = { class: "q-chatbot__message" };
|
|
3956
|
+
const _hoisted_5 = {
|
|
3957
|
+
key: 0,
|
|
3958
|
+
class: "q-chatbot__message-loading"
|
|
3959
|
+
};
|
|
3960
|
+
const _hoisted_6 = /* @__PURE__ */ vue.createElementVNode("div", null, null, -1);
|
|
3961
|
+
const _hoisted_7 = /* @__PURE__ */ vue.createElementVNode("div", null, null, -1);
|
|
3962
|
+
const _hoisted_8 = /* @__PURE__ */ vue.createElementVNode("div", null, null, -1);
|
|
3963
|
+
const _hoisted_9 = [
|
|
3964
|
+
_hoisted_6,
|
|
3965
|
+
_hoisted_7,
|
|
3966
|
+
_hoisted_8
|
|
3967
|
+
];
|
|
3968
|
+
const _hoisted_10 = {
|
|
3969
|
+
key: 0,
|
|
3970
|
+
class: "q-chatbot__sender"
|
|
3971
|
+
};
|
|
3972
|
+
const _hoisted_11 = {
|
|
3973
|
+
key: 1,
|
|
3974
|
+
class: "q-chatbot__timestamp"
|
|
3975
|
+
};
|
|
3976
|
+
const _hoisted_12 = ["innerHTML"];
|
|
3977
|
+
const _hoisted_13 = {
|
|
3978
|
+
key: 3,
|
|
3979
|
+
class: "q-chatbot__text"
|
|
3980
|
+
};
|
|
3981
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
3982
|
+
...{ name: "ChatBot" },
|
|
3983
|
+
__name: "ChatBot",
|
|
3984
|
+
props: {
|
|
3985
|
+
apiEndpoint: { default: "http://localhost:3000" },
|
|
3986
|
+
texts: { default: () => ({
|
|
3987
|
+
chatbotTitle: "ChatBot",
|
|
3988
|
+
qButtonTitle: "Send message",
|
|
3989
|
+
placeholderMessage: "Type your message here...",
|
|
3990
|
+
initialMessage: "Howdy! I am GenioBot 👋, Quidgest's personal AI assistant! How can I help you?",
|
|
3991
|
+
loginError: "Uh oh, I could not authenticate with the Quidgest API endpoint 😓",
|
|
3992
|
+
botIsSick: "*cough cough* GenioBot is not feeling alright 🥴️🤒, looks like something failed!"
|
|
3993
|
+
}) },
|
|
3994
|
+
username: {}
|
|
3995
|
+
},
|
|
3996
|
+
setup(__props) {
|
|
3997
|
+
let messages = vue.ref([]);
|
|
3998
|
+
let msgHistoryStack = [];
|
|
3999
|
+
let nextMessageId = 1;
|
|
4000
|
+
let userPrompt = vue.ref("");
|
|
4001
|
+
let isChatDisabled = false;
|
|
4002
|
+
let isLoading = false;
|
|
4003
|
+
const messagesContainer = vue.ref(null);
|
|
4004
|
+
const promptInput = vue.ref(null);
|
|
4005
|
+
const props = __props;
|
|
4006
|
+
vue.onMounted(() => {
|
|
4007
|
+
initChat();
|
|
4008
|
+
vue.nextTick(scrollChatToBottom);
|
|
4009
|
+
});
|
|
4010
|
+
const getParsedEndpoint = vue.computed(() => {
|
|
4011
|
+
try {
|
|
4012
|
+
let url = new URL(props.apiEndpoint).href;
|
|
4013
|
+
if (url.charAt(url.length - 1) == "/") {
|
|
4014
|
+
url = url.slice(0, -1);
|
|
4015
|
+
}
|
|
4016
|
+
return url;
|
|
4017
|
+
} catch (ex) {
|
|
4018
|
+
addChatMessage(props.texts.botIsSick);
|
|
4019
|
+
isChatDisabled = true;
|
|
4020
|
+
throw Error("Could not parse Endpoint URL:\n" + ex);
|
|
4021
|
+
}
|
|
4022
|
+
});
|
|
4023
|
+
const sortedMessages = vue.computed(() => {
|
|
4024
|
+
return messages.value.toSorted((a, b) => {
|
|
4025
|
+
const diff = new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime();
|
|
4026
|
+
return diff !== 0 ? diff : a.sender === "user" ? -1 : 1;
|
|
4027
|
+
});
|
|
4028
|
+
});
|
|
4029
|
+
const userMessages = vue.computed(() => {
|
|
4030
|
+
return messages.value.filter((m) => m.sender === "user");
|
|
4031
|
+
});
|
|
4032
|
+
function initChat() {
|
|
4033
|
+
axios.post(getParsedEndpoint.value + "/auth/login", {
|
|
4034
|
+
username: props.username,
|
|
4035
|
+
password: "test"
|
|
4036
|
+
}).then((response) => {
|
|
4037
|
+
if (response.status != 200 || !response.data.success) {
|
|
4038
|
+
isChatDisabled = true;
|
|
4039
|
+
addChatMessage(props.texts.loginError);
|
|
4040
|
+
return console.log(
|
|
4041
|
+
`Unsuccessful login, endpoint gave status ${response.status}`
|
|
4042
|
+
);
|
|
4043
|
+
}
|
|
4044
|
+
sendInitialMessage();
|
|
4045
|
+
}).catch((error) => {
|
|
4046
|
+
if (error) {
|
|
4047
|
+
isChatDisabled = true;
|
|
4048
|
+
addChatMessage(props.texts.loginError);
|
|
4049
|
+
console.log(
|
|
4050
|
+
"The following error ocurred while trying to login: \n" + error
|
|
4051
|
+
);
|
|
4052
|
+
}
|
|
4053
|
+
});
|
|
4054
|
+
}
|
|
4055
|
+
function addChatMessage(message, sender = "bot") {
|
|
4056
|
+
messages.value.push({
|
|
4057
|
+
id: nextMessageId++,
|
|
4058
|
+
text: message,
|
|
4059
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
4060
|
+
sender
|
|
4061
|
+
});
|
|
4062
|
+
}
|
|
4063
|
+
function getLastMessage() {
|
|
4064
|
+
return messages.value.find(
|
|
4065
|
+
(m) => m.id === nextMessageId - 1
|
|
4066
|
+
);
|
|
4067
|
+
}
|
|
4068
|
+
function sendInitialMessage() {
|
|
4069
|
+
addChatMessage(props.texts.initialMessage);
|
|
4070
|
+
}
|
|
4071
|
+
function resetChat() {
|
|
4072
|
+
messages.value = [];
|
|
4073
|
+
msgHistoryStack = [];
|
|
4074
|
+
userPrompt.value = "";
|
|
4075
|
+
isLoading = false;
|
|
4076
|
+
isChatDisabled = false;
|
|
4077
|
+
sendInitialMessage();
|
|
4078
|
+
}
|
|
4079
|
+
function scrollChatToBottom() {
|
|
4080
|
+
if (messagesContainer.value == null)
|
|
4081
|
+
return;
|
|
4082
|
+
const element = messagesContainer.value;
|
|
4083
|
+
setTimeout(
|
|
4084
|
+
() => element.scrollIntoView(false),
|
|
4085
|
+
100
|
|
4086
|
+
);
|
|
4087
|
+
}
|
|
4088
|
+
function handleKey(event) {
|
|
4089
|
+
if (promptInput.value == null)
|
|
4090
|
+
return;
|
|
4091
|
+
if (event.key == "ArrowUp") {
|
|
4092
|
+
if (userMessages.value.length == 0)
|
|
4093
|
+
return;
|
|
4094
|
+
let lastMsgObj = userMessages.value[userMessages.value.length - 1 - msgHistoryStack.length];
|
|
4095
|
+
if (!lastMsgObj)
|
|
4096
|
+
return;
|
|
4097
|
+
msgHistoryStack.push(userPrompt.value);
|
|
4098
|
+
userPrompt.value = lastMsgObj.text;
|
|
4099
|
+
vue.nextTick(
|
|
4100
|
+
() => setCursorPosition(
|
|
4101
|
+
promptInput.value,
|
|
4102
|
+
lastMsgObj.text.length
|
|
4103
|
+
)
|
|
4104
|
+
);
|
|
4105
|
+
} else if (event.key == "ArrowDown") {
|
|
4106
|
+
let previousHistoryText = msgHistoryStack.pop();
|
|
4107
|
+
if (!previousHistoryText) {
|
|
4108
|
+
userPrompt.value = "";
|
|
4109
|
+
return;
|
|
4110
|
+
}
|
|
4111
|
+
userPrompt.value = previousHistoryText;
|
|
4112
|
+
}
|
|
4113
|
+
}
|
|
4114
|
+
function sendMessage() {
|
|
4115
|
+
if (userPrompt.value.trim().length == 0 || isLoading || isChatDisabled)
|
|
4116
|
+
return;
|
|
4117
|
+
addChatMessage(userPrompt.value, "user");
|
|
4118
|
+
scrollChatToBottom();
|
|
4119
|
+
setChatPrompt(userPrompt.value);
|
|
4120
|
+
userPrompt.value = "";
|
|
4121
|
+
}
|
|
4122
|
+
function setChatPrompt(prompt) {
|
|
4123
|
+
addChatMessage("");
|
|
4124
|
+
let msg = getLastMessage();
|
|
4125
|
+
let params = {
|
|
4126
|
+
message: prompt,
|
|
4127
|
+
project: "GenIO",
|
|
4128
|
+
user: props.username
|
|
4129
|
+
};
|
|
4130
|
+
isLoading = true;
|
|
4131
|
+
axios({
|
|
4132
|
+
url: getParsedEndpoint.value + "/prompt/message",
|
|
4133
|
+
method: "POST",
|
|
4134
|
+
data: params,
|
|
4135
|
+
onDownloadProgress: (progressEvent) => {
|
|
4136
|
+
var _a, _b;
|
|
4137
|
+
const chunk = (_a = progressEvent.event) == null ? void 0 : _a.currentTarget.response;
|
|
4138
|
+
const status = (_b = progressEvent.event) == null ? void 0 : _b.currentTarget.status;
|
|
4139
|
+
if (status != 200)
|
|
4140
|
+
return;
|
|
4141
|
+
if (msg)
|
|
4142
|
+
msg.text = chunk;
|
|
4143
|
+
}
|
|
4144
|
+
}).then(({ data }) => {
|
|
4145
|
+
if (msg)
|
|
4146
|
+
msg.text = data;
|
|
4147
|
+
}).catch((error) => {
|
|
4148
|
+
addChatMessage(props.texts.botIsSick);
|
|
4149
|
+
isChatDisabled = true;
|
|
4150
|
+
console.log(error);
|
|
4151
|
+
}).finally(() => {
|
|
4152
|
+
isLoading = false;
|
|
4153
|
+
});
|
|
4154
|
+
}
|
|
4155
|
+
function getSenderName(sender) {
|
|
4156
|
+
return sender === "bot" ? "GenioBot" : "You";
|
|
4157
|
+
}
|
|
4158
|
+
function getConvertedTime(date) {
|
|
4159
|
+
return date.toLocaleString();
|
|
4160
|
+
}
|
|
4161
|
+
function setCursorPosition(elem, pos) {
|
|
4162
|
+
elem.focus();
|
|
4163
|
+
elem.setSelectionRange(pos, pos);
|
|
4164
|
+
}
|
|
4165
|
+
vue.watch(() => props.apiEndpoint, () => {
|
|
4166
|
+
resetChat();
|
|
4167
|
+
});
|
|
4168
|
+
return (_ctx, _cache) => {
|
|
4169
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
4170
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
4171
|
+
vue.createElementVNode("span", null, vue.toDisplayString(props.texts.chatbotTitle), 1)
|
|
4172
|
+
]),
|
|
4173
|
+
vue.createElementVNode("div", {
|
|
4174
|
+
class: "q-chatbot__content",
|
|
4175
|
+
ref_key: "messagesContainer",
|
|
4176
|
+
ref: messagesContainer
|
|
4177
|
+
}, [
|
|
4178
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(sortedMessages.value, (message) => {
|
|
4179
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
4180
|
+
key: message.id,
|
|
4181
|
+
class: vue.normalizeClass([
|
|
4182
|
+
"q-chatbot__message-wrapper",
|
|
4183
|
+
{
|
|
4184
|
+
"q-chatbot__message-wrapper_right": message.sender == "user"
|
|
4185
|
+
}
|
|
4186
|
+
])
|
|
4187
|
+
}, [
|
|
4188
|
+
message.sender == "bot" ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
4189
|
+
key: 0,
|
|
4190
|
+
src: vue.unref(ChatBotIcon),
|
|
4191
|
+
alt: "",
|
|
4192
|
+
class: "q-chatbot__profile"
|
|
4193
|
+
}, null, 8, _hoisted_3)) : vue.createCommentVNode("", true),
|
|
4194
|
+
vue.createElementVNode("div", _hoisted_4, [
|
|
4195
|
+
vue.unref(isLoading) && !message.text ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, _hoisted_9)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
4196
|
+
message.text && message.sender == "bot" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, vue.toDisplayString(getSenderName(message.sender) + " " + getConvertedTime(message.timestamp)), 1)) : vue.createCommentVNode("", true),
|
|
4197
|
+
message.text && message.sender == "user" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, vue.toDisplayString(getConvertedTime(message.timestamp)), 1)) : vue.createCommentVNode("", true),
|
|
4198
|
+
message.sender == "bot" ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
4199
|
+
key: 2,
|
|
4200
|
+
class: "q-chatbot__text",
|
|
4201
|
+
innerHTML: message.text
|
|
4202
|
+
}, null, 8, _hoisted_12)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, vue.toDisplayString(message.text), 1))
|
|
4203
|
+
], 64))
|
|
4204
|
+
])
|
|
4205
|
+
], 2);
|
|
4206
|
+
}), 128))
|
|
4207
|
+
], 512),
|
|
4208
|
+
vue.createVNode(vue.unref(zo), {
|
|
4209
|
+
size: "block",
|
|
4210
|
+
disabled: vue.unref(isChatDisabled)
|
|
4211
|
+
}, {
|
|
4212
|
+
append: vue.withCtx(() => [
|
|
4213
|
+
vue.createVNode(vue.unref(fe), {
|
|
4214
|
+
title: props.texts.qButtonTitle,
|
|
4215
|
+
"b-style": "primary",
|
|
4216
|
+
class: "q-chatbot__send",
|
|
4217
|
+
disabled: vue.unref(isChatDisabled),
|
|
4218
|
+
onClick: sendMessage
|
|
4219
|
+
}, {
|
|
4220
|
+
default: vue.withCtx(() => [
|
|
4221
|
+
vue.createVNode(vue.unref(ee), { icon: "send" })
|
|
4222
|
+
]),
|
|
4223
|
+
_: 1
|
|
4224
|
+
}, 8, ["title", "disabled"])
|
|
4225
|
+
]),
|
|
4226
|
+
default: vue.withCtx(() => [
|
|
4227
|
+
vue.createVNode(vue.unref(Pt), {
|
|
4228
|
+
ref_key: "promptInput",
|
|
4229
|
+
ref: promptInput,
|
|
4230
|
+
modelValue: vue.unref(userPrompt),
|
|
4231
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(userPrompt) ? userPrompt.value = $event : userPrompt = $event),
|
|
4232
|
+
class: "q-chatbot__input",
|
|
4233
|
+
placeholder: props.texts.placeholderMessage,
|
|
4234
|
+
disabled: vue.unref(isChatDisabled),
|
|
4235
|
+
onKeyup: vue.withKeys(sendMessage, ["enter"]),
|
|
4236
|
+
onKeydown: handleKey
|
|
4237
|
+
}, null, 8, ["modelValue", "placeholder", "disabled"])
|
|
4238
|
+
]),
|
|
4239
|
+
_: 1
|
|
4240
|
+
}, 8, ["disabled"])
|
|
4241
|
+
]);
|
|
4242
|
+
};
|
|
4243
|
+
}
|
|
4244
|
+
});
|
|
4245
|
+
return _sfc_main;
|
|
4246
|
+
});
|