@localazy/strapi-plugin 1.1.3 → 1.3.0

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.
Files changed (33) hide show
  1. package/dist/_chunks/{FetchIdentity-C8-hFqEW.mjs → FetchIdentity-BJGoZPpM.mjs} +1 -1
  2. package/dist/_chunks/{FetchIdentity-Dl2vx6zB.js → FetchIdentity-CtBRO-Cn.js} +1 -1
  3. package/dist/_chunks/{LanguagesSelector-DsW3aJ7p.js → LanguagesSelector-CNaKrS-m.js} +2 -2
  4. package/dist/_chunks/{LanguagesSelector-vu-Lj7L6.mjs → LanguagesSelector-DJxgCwgM.mjs} +2 -2
  5. package/dist/_chunks/{LocalazyApp-BIll8u_G.js → LocalazyApp-B1qCCEPe.js} +7 -7
  6. package/dist/_chunks/{LocalazyApp-Dxygk1mM.mjs → LocalazyApp-CJRpsTKr.mjs} +7 -7
  7. package/dist/_chunks/{LocalazyContentTransferSetup-BhEjlIgE.js → LocalazyContentTransferSetup-CCxiLHdG.js} +3 -3
  8. package/dist/_chunks/{LocalazyContentTransferSetup-Cz88htly.mjs → LocalazyContentTransferSetup-CLAWn95U.mjs} +3 -3
  9. package/dist/_chunks/{LocalazyGlobalSettings-B3Z8f4G8.js → LocalazyGlobalSettings-BJ5qfFfK.js} +4 -4
  10. package/dist/_chunks/{LocalazyGlobalSettings-CgOADY93.mjs → LocalazyGlobalSettings-Z-4Ykc_J.mjs} +4 -4
  11. package/dist/_chunks/{LocalazyPanel-BjrSVZpI.mjs → LocalazyPanel-CL_mzzfD.mjs} +1 -1
  12. package/dist/_chunks/{LocalazyPanel-CQ8-K88T.js → LocalazyPanel-DE3TtHOQ.js} +1 -1
  13. package/dist/_chunks/{LocalazyStatusColumn-CA34yhSE.js → LocalazyStatusColumn-BMLcklG-.js} +1 -1
  14. package/dist/_chunks/{LocalazyStatusColumn-D0b2LCpg.mjs → LocalazyStatusColumn-R5n6q_cx.mjs} +1 -1
  15. package/dist/_chunks/{RequireLocalazyAuth-DpimzlRh.mjs → RequireLocalazyAuth-Dzsu6UNS.mjs} +2 -2
  16. package/dist/_chunks/{RequireLocalazyAuth-BPsrUlFm.js → RequireLocalazyAuth-WKKFdQlR.js} +2 -2
  17. package/dist/_chunks/{entry-exclusion-service-nJswJPwF.js → entry-exclusion-service-CggmAKxq.js} +1 -1
  18. package/dist/_chunks/{entry-exclusion-service-DNJZg3U2.mjs → entry-exclusion-service-DxqTlZFR.mjs} +1 -1
  19. package/dist/_chunks/{has-model-changed-BnL6D-eR.js → has-model-changed-BR53L6pA.js} +2 -2
  20. package/dist/_chunks/{has-model-changed-D6fjlIdc.mjs → has-model-changed-FMGVcFHU.mjs} +2 -2
  21. package/dist/_chunks/{index-BXPaiO0d.js → index-BmxGKspv.js} +7 -7
  22. package/dist/_chunks/{index-CPBTdynk.mjs → index-toauQlIK.mjs} +7 -7
  23. package/dist/_chunks/strapi-api-base-BflplVsH.mjs +23 -0
  24. package/dist/_chunks/strapi-api-base-CT9lknwW.js +22 -0
  25. package/dist/admin/index.js +1 -1
  26. package/dist/admin/index.mjs +1 -1
  27. package/dist/admin/src/modules/@common/api/strapi-api-base.d.ts +19 -4
  28. package/dist/admin/src/modules/@common/utils/sort-by-model-name.d.ts +1 -1
  29. package/dist/server/index.js +1 -2
  30. package/dist/server/index.mjs +1 -2
  31. package/package.json +1 -2
  32. package/dist/_chunks/strapi-api-base-DkjMgMHl.js +0 -2425
  33. package/dist/_chunks/strapi-api-base-GgrMbYak.mjs +0 -2426
@@ -1,2426 +0,0 @@
1
- import { P as PLUGIN_ID } from "./index-CPBTdynk.mjs";
2
- function bind(fn, thisArg) {
3
- return function wrap() {
4
- return fn.apply(thisArg, arguments);
5
- };
6
- }
7
- const { toString } = Object.prototype;
8
- const { getPrototypeOf } = Object;
9
- const kindOf = /* @__PURE__ */ ((cache) => (thing) => {
10
- const str = toString.call(thing);
11
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
12
- })(/* @__PURE__ */ Object.create(null));
13
- const kindOfTest = (type) => {
14
- type = type.toLowerCase();
15
- return (thing) => kindOf(thing) === type;
16
- };
17
- const typeOfTest = (type) => (thing) => typeof thing === type;
18
- const { isArray } = Array;
19
- const isUndefined = typeOfTest("undefined");
20
- function isBuffer(val) {
21
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
22
- }
23
- const isArrayBuffer = kindOfTest("ArrayBuffer");
24
- function isArrayBufferView(val) {
25
- let result;
26
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
27
- result = ArrayBuffer.isView(val);
28
- } else {
29
- result = val && val.buffer && isArrayBuffer(val.buffer);
30
- }
31
- return result;
32
- }
33
- const isString = typeOfTest("string");
34
- const isFunction = typeOfTest("function");
35
- const isNumber = typeOfTest("number");
36
- const isObject = (thing) => thing !== null && typeof thing === "object";
37
- const isBoolean = (thing) => thing === true || thing === false;
38
- const isPlainObject = (val) => {
39
- if (kindOf(val) !== "object") {
40
- return false;
41
- }
42
- const prototype2 = getPrototypeOf(val);
43
- return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
44
- };
45
- const isDate = kindOfTest("Date");
46
- const isFile = kindOfTest("File");
47
- const isBlob = kindOfTest("Blob");
48
- const isFileList = kindOfTest("FileList");
49
- const isStream = (val) => isObject(val) && isFunction(val.pipe);
50
- const isFormData = (thing) => {
51
- let kind;
52
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
53
- kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
54
- };
55
- const isURLSearchParams = kindOfTest("URLSearchParams");
56
- const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
57
- const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
58
- function forEach(obj, fn, { allOwnKeys = false } = {}) {
59
- if (obj === null || typeof obj === "undefined") {
60
- return;
61
- }
62
- let i;
63
- let l;
64
- if (typeof obj !== "object") {
65
- obj = [obj];
66
- }
67
- if (isArray(obj)) {
68
- for (i = 0, l = obj.length; i < l; i++) {
69
- fn.call(null, obj[i], i, obj);
70
- }
71
- } else {
72
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
73
- const len = keys.length;
74
- let key;
75
- for (i = 0; i < len; i++) {
76
- key = keys[i];
77
- fn.call(null, obj[key], key, obj);
78
- }
79
- }
80
- }
81
- function findKey(obj, key) {
82
- key = key.toLowerCase();
83
- const keys = Object.keys(obj);
84
- let i = keys.length;
85
- let _key;
86
- while (i-- > 0) {
87
- _key = keys[i];
88
- if (key === _key.toLowerCase()) {
89
- return _key;
90
- }
91
- }
92
- return null;
93
- }
94
- const _global = (() => {
95
- if (typeof globalThis !== "undefined") return globalThis;
96
- return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
97
- })();
98
- const isContextDefined = (context) => !isUndefined(context) && context !== _global;
99
- function merge() {
100
- const { caseless } = isContextDefined(this) && this || {};
101
- const result = {};
102
- const assignValue = (val, key) => {
103
- const targetKey = caseless && findKey(result, key) || key;
104
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
105
- result[targetKey] = merge(result[targetKey], val);
106
- } else if (isPlainObject(val)) {
107
- result[targetKey] = merge({}, val);
108
- } else if (isArray(val)) {
109
- result[targetKey] = val.slice();
110
- } else {
111
- result[targetKey] = val;
112
- }
113
- };
114
- for (let i = 0, l = arguments.length; i < l; i++) {
115
- arguments[i] && forEach(arguments[i], assignValue);
116
- }
117
- return result;
118
- }
119
- const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
120
- forEach(b, (val, key) => {
121
- if (thisArg && isFunction(val)) {
122
- a[key] = bind(val, thisArg);
123
- } else {
124
- a[key] = val;
125
- }
126
- }, { allOwnKeys });
127
- return a;
128
- };
129
- const stripBOM = (content) => {
130
- if (content.charCodeAt(0) === 65279) {
131
- content = content.slice(1);
132
- }
133
- return content;
134
- };
135
- const inherits = (constructor, superConstructor, props, descriptors2) => {
136
- constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
137
- constructor.prototype.constructor = constructor;
138
- Object.defineProperty(constructor, "super", {
139
- value: superConstructor.prototype
140
- });
141
- props && Object.assign(constructor.prototype, props);
142
- };
143
- const toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
144
- let props;
145
- let i;
146
- let prop;
147
- const merged = {};
148
- destObj = destObj || {};
149
- if (sourceObj == null) return destObj;
150
- do {
151
- props = Object.getOwnPropertyNames(sourceObj);
152
- i = props.length;
153
- while (i-- > 0) {
154
- prop = props[i];
155
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
156
- destObj[prop] = sourceObj[prop];
157
- merged[prop] = true;
158
- }
159
- }
160
- sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
161
- } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
162
- return destObj;
163
- };
164
- const endsWith = (str, searchString, position) => {
165
- str = String(str);
166
- if (position === void 0 || position > str.length) {
167
- position = str.length;
168
- }
169
- position -= searchString.length;
170
- const lastIndex = str.indexOf(searchString, position);
171
- return lastIndex !== -1 && lastIndex === position;
172
- };
173
- const toArray = (thing) => {
174
- if (!thing) return null;
175
- if (isArray(thing)) return thing;
176
- let i = thing.length;
177
- if (!isNumber(i)) return null;
178
- const arr = new Array(i);
179
- while (i-- > 0) {
180
- arr[i] = thing[i];
181
- }
182
- return arr;
183
- };
184
- const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
185
- return (thing) => {
186
- return TypedArray && thing instanceof TypedArray;
187
- };
188
- })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
189
- const forEachEntry = (obj, fn) => {
190
- const generator = obj && obj[Symbol.iterator];
191
- const iterator = generator.call(obj);
192
- let result;
193
- while ((result = iterator.next()) && !result.done) {
194
- const pair = result.value;
195
- fn.call(obj, pair[0], pair[1]);
196
- }
197
- };
198
- const matchAll = (regExp, str) => {
199
- let matches;
200
- const arr = [];
201
- while ((matches = regExp.exec(str)) !== null) {
202
- arr.push(matches);
203
- }
204
- return arr;
205
- };
206
- const isHTMLForm = kindOfTest("HTMLFormElement");
207
- const toCamelCase = (str) => {
208
- return str.toLowerCase().replace(
209
- /[-_\s]([a-z\d])(\w*)/g,
210
- function replacer(m, p1, p2) {
211
- return p1.toUpperCase() + p2;
212
- }
213
- );
214
- };
215
- const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
216
- const isRegExp = kindOfTest("RegExp");
217
- const reduceDescriptors = (obj, reducer) => {
218
- const descriptors2 = Object.getOwnPropertyDescriptors(obj);
219
- const reducedDescriptors = {};
220
- forEach(descriptors2, (descriptor, name) => {
221
- let ret;
222
- if ((ret = reducer(descriptor, name, obj)) !== false) {
223
- reducedDescriptors[name] = ret || descriptor;
224
- }
225
- });
226
- Object.defineProperties(obj, reducedDescriptors);
227
- };
228
- const freezeMethods = (obj) => {
229
- reduceDescriptors(obj, (descriptor, name) => {
230
- if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
231
- return false;
232
- }
233
- const value = obj[name];
234
- if (!isFunction(value)) return;
235
- descriptor.enumerable = false;
236
- if ("writable" in descriptor) {
237
- descriptor.writable = false;
238
- return;
239
- }
240
- if (!descriptor.set) {
241
- descriptor.set = () => {
242
- throw Error("Can not rewrite read-only method '" + name + "'");
243
- };
244
- }
245
- });
246
- };
247
- const toObjectSet = (arrayOrString, delimiter) => {
248
- const obj = {};
249
- const define = (arr) => {
250
- arr.forEach((value) => {
251
- obj[value] = true;
252
- });
253
- };
254
- isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
255
- return obj;
256
- };
257
- const noop = () => {
258
- };
259
- const toFiniteNumber = (value, defaultValue) => {
260
- return value != null && Number.isFinite(value = +value) ? value : defaultValue;
261
- };
262
- const ALPHA = "abcdefghijklmnopqrstuvwxyz";
263
- const DIGIT = "0123456789";
264
- const ALPHABET = {
265
- DIGIT,
266
- ALPHA,
267
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
268
- };
269
- const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
270
- let str = "";
271
- const { length } = alphabet;
272
- while (size--) {
273
- str += alphabet[Math.random() * length | 0];
274
- }
275
- return str;
276
- };
277
- function isSpecCompliantForm(thing) {
278
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
279
- }
280
- const toJSONObject = (obj) => {
281
- const stack = new Array(10);
282
- const visit = (source, i) => {
283
- if (isObject(source)) {
284
- if (stack.indexOf(source) >= 0) {
285
- return;
286
- }
287
- if (!("toJSON" in source)) {
288
- stack[i] = source;
289
- const target = isArray(source) ? [] : {};
290
- forEach(source, (value, key) => {
291
- const reducedValue = visit(value, i + 1);
292
- !isUndefined(reducedValue) && (target[key] = reducedValue);
293
- });
294
- stack[i] = void 0;
295
- return target;
296
- }
297
- }
298
- return source;
299
- };
300
- return visit(obj, 0);
301
- };
302
- const isAsyncFn = kindOfTest("AsyncFunction");
303
- const isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
304
- const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
305
- if (setImmediateSupported) {
306
- return setImmediate;
307
- }
308
- return postMessageSupported ? ((token, callbacks) => {
309
- _global.addEventListener("message", ({ source, data }) => {
310
- if (source === _global && data === token) {
311
- callbacks.length && callbacks.shift()();
312
- }
313
- }, false);
314
- return (cb) => {
315
- callbacks.push(cb);
316
- _global.postMessage(token, "*");
317
- };
318
- })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
319
- })(
320
- typeof setImmediate === "function",
321
- isFunction(_global.postMessage)
322
- );
323
- const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
324
- const utils$1 = {
325
- isArray,
326
- isArrayBuffer,
327
- isBuffer,
328
- isFormData,
329
- isArrayBufferView,
330
- isString,
331
- isNumber,
332
- isBoolean,
333
- isObject,
334
- isPlainObject,
335
- isReadableStream,
336
- isRequest,
337
- isResponse,
338
- isHeaders,
339
- isUndefined,
340
- isDate,
341
- isFile,
342
- isBlob,
343
- isRegExp,
344
- isFunction,
345
- isStream,
346
- isURLSearchParams,
347
- isTypedArray,
348
- isFileList,
349
- forEach,
350
- merge,
351
- extend,
352
- trim,
353
- stripBOM,
354
- inherits,
355
- toFlatObject,
356
- kindOf,
357
- kindOfTest,
358
- endsWith,
359
- toArray,
360
- forEachEntry,
361
- matchAll,
362
- isHTMLForm,
363
- hasOwnProperty,
364
- hasOwnProp: hasOwnProperty,
365
- // an alias to avoid ESLint no-prototype-builtins detection
366
- reduceDescriptors,
367
- freezeMethods,
368
- toObjectSet,
369
- toCamelCase,
370
- noop,
371
- toFiniteNumber,
372
- findKey,
373
- global: _global,
374
- isContextDefined,
375
- ALPHABET,
376
- generateString,
377
- isSpecCompliantForm,
378
- toJSONObject,
379
- isAsyncFn,
380
- isThenable,
381
- setImmediate: _setImmediate,
382
- asap
383
- };
384
- function AxiosError$1(message, code, config, request, response) {
385
- Error.call(this);
386
- if (Error.captureStackTrace) {
387
- Error.captureStackTrace(this, this.constructor);
388
- } else {
389
- this.stack = new Error().stack;
390
- }
391
- this.message = message;
392
- this.name = "AxiosError";
393
- code && (this.code = code);
394
- config && (this.config = config);
395
- request && (this.request = request);
396
- if (response) {
397
- this.response = response;
398
- this.status = response.status ? response.status : null;
399
- }
400
- }
401
- utils$1.inherits(AxiosError$1, Error, {
402
- toJSON: function toJSON() {
403
- return {
404
- // Standard
405
- message: this.message,
406
- name: this.name,
407
- // Microsoft
408
- description: this.description,
409
- number: this.number,
410
- // Mozilla
411
- fileName: this.fileName,
412
- lineNumber: this.lineNumber,
413
- columnNumber: this.columnNumber,
414
- stack: this.stack,
415
- // Axios
416
- config: utils$1.toJSONObject(this.config),
417
- code: this.code,
418
- status: this.status
419
- };
420
- }
421
- });
422
- const prototype$1 = AxiosError$1.prototype;
423
- const descriptors = {};
424
- [
425
- "ERR_BAD_OPTION_VALUE",
426
- "ERR_BAD_OPTION",
427
- "ECONNABORTED",
428
- "ETIMEDOUT",
429
- "ERR_NETWORK",
430
- "ERR_FR_TOO_MANY_REDIRECTS",
431
- "ERR_DEPRECATED",
432
- "ERR_BAD_RESPONSE",
433
- "ERR_BAD_REQUEST",
434
- "ERR_CANCELED",
435
- "ERR_NOT_SUPPORT",
436
- "ERR_INVALID_URL"
437
- // eslint-disable-next-line func-names
438
- ].forEach((code) => {
439
- descriptors[code] = { value: code };
440
- });
441
- Object.defineProperties(AxiosError$1, descriptors);
442
- Object.defineProperty(prototype$1, "isAxiosError", { value: true });
443
- AxiosError$1.from = (error, code, config, request, response, customProps) => {
444
- const axiosError = Object.create(prototype$1);
445
- utils$1.toFlatObject(error, axiosError, function filter2(obj) {
446
- return obj !== Error.prototype;
447
- }, (prop) => {
448
- return prop !== "isAxiosError";
449
- });
450
- AxiosError$1.call(axiosError, error.message, code, config, request, response);
451
- axiosError.cause = error;
452
- axiosError.name = error.name;
453
- customProps && Object.assign(axiosError, customProps);
454
- return axiosError;
455
- };
456
- const httpAdapter = null;
457
- function isVisitable(thing) {
458
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
459
- }
460
- function removeBrackets(key) {
461
- return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
462
- }
463
- function renderKey(path, key, dots) {
464
- if (!path) return key;
465
- return path.concat(key).map(function each(token, i) {
466
- token = removeBrackets(token);
467
- return !dots && i ? "[" + token + "]" : token;
468
- }).join(dots ? "." : "");
469
- }
470
- function isFlatArray(arr) {
471
- return utils$1.isArray(arr) && !arr.some(isVisitable);
472
- }
473
- const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
474
- return /^is[A-Z]/.test(prop);
475
- });
476
- function toFormData$1(obj, formData, options) {
477
- if (!utils$1.isObject(obj)) {
478
- throw new TypeError("target must be an object");
479
- }
480
- formData = formData || new FormData();
481
- options = utils$1.toFlatObject(options, {
482
- metaTokens: true,
483
- dots: false,
484
- indexes: false
485
- }, false, function defined(option, source) {
486
- return !utils$1.isUndefined(source[option]);
487
- });
488
- const metaTokens = options.metaTokens;
489
- const visitor = options.visitor || defaultVisitor;
490
- const dots = options.dots;
491
- const indexes = options.indexes;
492
- const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
493
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
494
- if (!utils$1.isFunction(visitor)) {
495
- throw new TypeError("visitor must be a function");
496
- }
497
- function convertValue(value) {
498
- if (value === null) return "";
499
- if (utils$1.isDate(value)) {
500
- return value.toISOString();
501
- }
502
- if (!useBlob && utils$1.isBlob(value)) {
503
- throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
504
- }
505
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
506
- return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
507
- }
508
- return value;
509
- }
510
- function defaultVisitor(value, key, path) {
511
- let arr = value;
512
- if (value && !path && typeof value === "object") {
513
- if (utils$1.endsWith(key, "{}")) {
514
- key = metaTokens ? key : key.slice(0, -2);
515
- value = JSON.stringify(value);
516
- } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
517
- key = removeBrackets(key);
518
- arr.forEach(function each(el, index) {
519
- !(utils$1.isUndefined(el) || el === null) && formData.append(
520
- // eslint-disable-next-line no-nested-ternary
521
- indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
522
- convertValue(el)
523
- );
524
- });
525
- return false;
526
- }
527
- }
528
- if (isVisitable(value)) {
529
- return true;
530
- }
531
- formData.append(renderKey(path, key, dots), convertValue(value));
532
- return false;
533
- }
534
- const stack = [];
535
- const exposedHelpers = Object.assign(predicates, {
536
- defaultVisitor,
537
- convertValue,
538
- isVisitable
539
- });
540
- function build(value, path) {
541
- if (utils$1.isUndefined(value)) return;
542
- if (stack.indexOf(value) !== -1) {
543
- throw Error("Circular reference detected in " + path.join("."));
544
- }
545
- stack.push(value);
546
- utils$1.forEach(value, function each(el, key) {
547
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
548
- formData,
549
- el,
550
- utils$1.isString(key) ? key.trim() : key,
551
- path,
552
- exposedHelpers
553
- );
554
- if (result === true) {
555
- build(el, path ? path.concat(key) : [key]);
556
- }
557
- });
558
- stack.pop();
559
- }
560
- if (!utils$1.isObject(obj)) {
561
- throw new TypeError("data must be an object");
562
- }
563
- build(obj);
564
- return formData;
565
- }
566
- function encode$1(str) {
567
- const charMap = {
568
- "!": "%21",
569
- "'": "%27",
570
- "(": "%28",
571
- ")": "%29",
572
- "~": "%7E",
573
- "%20": "+",
574
- "%00": "\0"
575
- };
576
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
577
- return charMap[match];
578
- });
579
- }
580
- function AxiosURLSearchParams(params, options) {
581
- this._pairs = [];
582
- params && toFormData$1(params, this, options);
583
- }
584
- const prototype = AxiosURLSearchParams.prototype;
585
- prototype.append = function append(name, value) {
586
- this._pairs.push([name, value]);
587
- };
588
- prototype.toString = function toString2(encoder) {
589
- const _encode = encoder ? function(value) {
590
- return encoder.call(this, value, encode$1);
591
- } : encode$1;
592
- return this._pairs.map(function each(pair) {
593
- return _encode(pair[0]) + "=" + _encode(pair[1]);
594
- }, "").join("&");
595
- };
596
- function encode(val) {
597
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
598
- }
599
- function buildURL(url, params, options) {
600
- if (!params) {
601
- return url;
602
- }
603
- const _encode = options && options.encode || encode;
604
- if (utils$1.isFunction(options)) {
605
- options = {
606
- serialize: options
607
- };
608
- }
609
- const serializeFn = options && options.serialize;
610
- let serializedParams;
611
- if (serializeFn) {
612
- serializedParams = serializeFn(params, options);
613
- } else {
614
- serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
615
- }
616
- if (serializedParams) {
617
- const hashmarkIndex = url.indexOf("#");
618
- if (hashmarkIndex !== -1) {
619
- url = url.slice(0, hashmarkIndex);
620
- }
621
- url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
622
- }
623
- return url;
624
- }
625
- class InterceptorManager {
626
- constructor() {
627
- this.handlers = [];
628
- }
629
- /**
630
- * Add a new interceptor to the stack
631
- *
632
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
633
- * @param {Function} rejected The function to handle `reject` for a `Promise`
634
- *
635
- * @return {Number} An ID used to remove interceptor later
636
- */
637
- use(fulfilled, rejected, options) {
638
- this.handlers.push({
639
- fulfilled,
640
- rejected,
641
- synchronous: options ? options.synchronous : false,
642
- runWhen: options ? options.runWhen : null
643
- });
644
- return this.handlers.length - 1;
645
- }
646
- /**
647
- * Remove an interceptor from the stack
648
- *
649
- * @param {Number} id The ID that was returned by `use`
650
- *
651
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
652
- */
653
- eject(id) {
654
- if (this.handlers[id]) {
655
- this.handlers[id] = null;
656
- }
657
- }
658
- /**
659
- * Clear all interceptors from the stack
660
- *
661
- * @returns {void}
662
- */
663
- clear() {
664
- if (this.handlers) {
665
- this.handlers = [];
666
- }
667
- }
668
- /**
669
- * Iterate over all the registered interceptors
670
- *
671
- * This method is particularly useful for skipping over any
672
- * interceptors that may have become `null` calling `eject`.
673
- *
674
- * @param {Function} fn The function to call for each interceptor
675
- *
676
- * @returns {void}
677
- */
678
- forEach(fn) {
679
- utils$1.forEach(this.handlers, function forEachHandler(h) {
680
- if (h !== null) {
681
- fn(h);
682
- }
683
- });
684
- }
685
- }
686
- const transitionalDefaults = {
687
- silentJSONParsing: true,
688
- forcedJSONParsing: true,
689
- clarifyTimeoutError: false
690
- };
691
- const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
692
- const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
693
- const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
694
- const platform$1 = {
695
- isBrowser: true,
696
- classes: {
697
- URLSearchParams: URLSearchParams$1,
698
- FormData: FormData$1,
699
- Blob: Blob$1
700
- },
701
- protocols: ["http", "https", "file", "blob", "url", "data"]
702
- };
703
- const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
704
- const _navigator = typeof navigator === "object" && navigator || void 0;
705
- const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
706
- const hasStandardBrowserWebWorkerEnv = (() => {
707
- return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
708
- self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
709
- })();
710
- const origin = hasBrowserEnv && window.location.href || "http://localhost";
711
- const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
712
- __proto__: null,
713
- hasBrowserEnv,
714
- hasStandardBrowserEnv,
715
- hasStandardBrowserWebWorkerEnv,
716
- navigator: _navigator,
717
- origin
718
- }, Symbol.toStringTag, { value: "Module" }));
719
- const platform = {
720
- ...utils,
721
- ...platform$1
722
- };
723
- function toURLEncodedForm(data, options) {
724
- return toFormData$1(data, new platform.classes.URLSearchParams(), Object.assign({
725
- visitor: function(value, key, path, helpers) {
726
- if (platform.isNode && utils$1.isBuffer(value)) {
727
- this.append(key, value.toString("base64"));
728
- return false;
729
- }
730
- return helpers.defaultVisitor.apply(this, arguments);
731
- }
732
- }, options));
733
- }
734
- function parsePropPath(name) {
735
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
736
- return match[0] === "[]" ? "" : match[1] || match[0];
737
- });
738
- }
739
- function arrayToObject(arr) {
740
- const obj = {};
741
- const keys = Object.keys(arr);
742
- let i;
743
- const len = keys.length;
744
- let key;
745
- for (i = 0; i < len; i++) {
746
- key = keys[i];
747
- obj[key] = arr[key];
748
- }
749
- return obj;
750
- }
751
- function formDataToJSON(formData) {
752
- function buildPath(path, value, target, index) {
753
- let name = path[index++];
754
- if (name === "__proto__") return true;
755
- const isNumericKey = Number.isFinite(+name);
756
- const isLast = index >= path.length;
757
- name = !name && utils$1.isArray(target) ? target.length : name;
758
- if (isLast) {
759
- if (utils$1.hasOwnProp(target, name)) {
760
- target[name] = [target[name], value];
761
- } else {
762
- target[name] = value;
763
- }
764
- return !isNumericKey;
765
- }
766
- if (!target[name] || !utils$1.isObject(target[name])) {
767
- target[name] = [];
768
- }
769
- const result = buildPath(path, value, target[name], index);
770
- if (result && utils$1.isArray(target[name])) {
771
- target[name] = arrayToObject(target[name]);
772
- }
773
- return !isNumericKey;
774
- }
775
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
776
- const obj = {};
777
- utils$1.forEachEntry(formData, (name, value) => {
778
- buildPath(parsePropPath(name), value, obj, 0);
779
- });
780
- return obj;
781
- }
782
- return null;
783
- }
784
- function stringifySafely(rawValue, parser, encoder) {
785
- if (utils$1.isString(rawValue)) {
786
- try {
787
- (parser || JSON.parse)(rawValue);
788
- return utils$1.trim(rawValue);
789
- } catch (e) {
790
- if (e.name !== "SyntaxError") {
791
- throw e;
792
- }
793
- }
794
- }
795
- return (encoder || JSON.stringify)(rawValue);
796
- }
797
- const defaults = {
798
- transitional: transitionalDefaults,
799
- adapter: ["xhr", "http", "fetch"],
800
- transformRequest: [function transformRequest(data, headers) {
801
- const contentType = headers.getContentType() || "";
802
- const hasJSONContentType = contentType.indexOf("application/json") > -1;
803
- const isObjectPayload = utils$1.isObject(data);
804
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
805
- data = new FormData(data);
806
- }
807
- const isFormData2 = utils$1.isFormData(data);
808
- if (isFormData2) {
809
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
810
- }
811
- if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
812
- return data;
813
- }
814
- if (utils$1.isArrayBufferView(data)) {
815
- return data.buffer;
816
- }
817
- if (utils$1.isURLSearchParams(data)) {
818
- headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
819
- return data.toString();
820
- }
821
- let isFileList2;
822
- if (isObjectPayload) {
823
- if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
824
- return toURLEncodedForm(data, this.formSerializer).toString();
825
- }
826
- if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
827
- const _FormData = this.env && this.env.FormData;
828
- return toFormData$1(
829
- isFileList2 ? { "files[]": data } : data,
830
- _FormData && new _FormData(),
831
- this.formSerializer
832
- );
833
- }
834
- }
835
- if (isObjectPayload || hasJSONContentType) {
836
- headers.setContentType("application/json", false);
837
- return stringifySafely(data);
838
- }
839
- return data;
840
- }],
841
- transformResponse: [function transformResponse(data) {
842
- const transitional2 = this.transitional || defaults.transitional;
843
- const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
844
- const JSONRequested = this.responseType === "json";
845
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
846
- return data;
847
- }
848
- if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
849
- const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
850
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
851
- try {
852
- return JSON.parse(data);
853
- } catch (e) {
854
- if (strictJSONParsing) {
855
- if (e.name === "SyntaxError") {
856
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
857
- }
858
- throw e;
859
- }
860
- }
861
- }
862
- return data;
863
- }],
864
- /**
865
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
866
- * timeout is not created.
867
- */
868
- timeout: 0,
869
- xsrfCookieName: "XSRF-TOKEN",
870
- xsrfHeaderName: "X-XSRF-TOKEN",
871
- maxContentLength: -1,
872
- maxBodyLength: -1,
873
- env: {
874
- FormData: platform.classes.FormData,
875
- Blob: platform.classes.Blob
876
- },
877
- validateStatus: function validateStatus(status) {
878
- return status >= 200 && status < 300;
879
- },
880
- headers: {
881
- common: {
882
- "Accept": "application/json, text/plain, */*",
883
- "Content-Type": void 0
884
- }
885
- }
886
- };
887
- utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
888
- defaults.headers[method] = {};
889
- });
890
- const ignoreDuplicateOf = utils$1.toObjectSet([
891
- "age",
892
- "authorization",
893
- "content-length",
894
- "content-type",
895
- "etag",
896
- "expires",
897
- "from",
898
- "host",
899
- "if-modified-since",
900
- "if-unmodified-since",
901
- "last-modified",
902
- "location",
903
- "max-forwards",
904
- "proxy-authorization",
905
- "referer",
906
- "retry-after",
907
- "user-agent"
908
- ]);
909
- const parseHeaders = (rawHeaders) => {
910
- const parsed = {};
911
- let key;
912
- let val;
913
- let i;
914
- rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
915
- i = line.indexOf(":");
916
- key = line.substring(0, i).trim().toLowerCase();
917
- val = line.substring(i + 1).trim();
918
- if (!key || parsed[key] && ignoreDuplicateOf[key]) {
919
- return;
920
- }
921
- if (key === "set-cookie") {
922
- if (parsed[key]) {
923
- parsed[key].push(val);
924
- } else {
925
- parsed[key] = [val];
926
- }
927
- } else {
928
- parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
929
- }
930
- });
931
- return parsed;
932
- };
933
- const $internals = Symbol("internals");
934
- function normalizeHeader(header) {
935
- return header && String(header).trim().toLowerCase();
936
- }
937
- function normalizeValue(value) {
938
- if (value === false || value == null) {
939
- return value;
940
- }
941
- return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
942
- }
943
- function parseTokens(str) {
944
- const tokens = /* @__PURE__ */ Object.create(null);
945
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
946
- let match;
947
- while (match = tokensRE.exec(str)) {
948
- tokens[match[1]] = match[2];
949
- }
950
- return tokens;
951
- }
952
- const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
953
- function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
954
- if (utils$1.isFunction(filter2)) {
955
- return filter2.call(this, value, header);
956
- }
957
- if (isHeaderNameFilter) {
958
- value = header;
959
- }
960
- if (!utils$1.isString(value)) return;
961
- if (utils$1.isString(filter2)) {
962
- return value.indexOf(filter2) !== -1;
963
- }
964
- if (utils$1.isRegExp(filter2)) {
965
- return filter2.test(value);
966
- }
967
- }
968
- function formatHeader(header) {
969
- return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
970
- return char.toUpperCase() + str;
971
- });
972
- }
973
- function buildAccessors(obj, header) {
974
- const accessorName = utils$1.toCamelCase(" " + header);
975
- ["get", "set", "has"].forEach((methodName) => {
976
- Object.defineProperty(obj, methodName + accessorName, {
977
- value: function(arg1, arg2, arg3) {
978
- return this[methodName].call(this, header, arg1, arg2, arg3);
979
- },
980
- configurable: true
981
- });
982
- });
983
- }
984
- let AxiosHeaders$1 = class AxiosHeaders {
985
- constructor(headers) {
986
- headers && this.set(headers);
987
- }
988
- set(header, valueOrRewrite, rewrite) {
989
- const self2 = this;
990
- function setHeader(_value, _header, _rewrite) {
991
- const lHeader = normalizeHeader(_header);
992
- if (!lHeader) {
993
- throw new Error("header name must be a non-empty string");
994
- }
995
- const key = utils$1.findKey(self2, lHeader);
996
- if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
997
- self2[key || _header] = normalizeValue(_value);
998
- }
999
- }
1000
- const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1001
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
1002
- setHeaders(header, valueOrRewrite);
1003
- } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1004
- setHeaders(parseHeaders(header), valueOrRewrite);
1005
- } else if (utils$1.isHeaders(header)) {
1006
- for (const [key, value] of header.entries()) {
1007
- setHeader(value, key, rewrite);
1008
- }
1009
- } else {
1010
- header != null && setHeader(valueOrRewrite, header, rewrite);
1011
- }
1012
- return this;
1013
- }
1014
- get(header, parser) {
1015
- header = normalizeHeader(header);
1016
- if (header) {
1017
- const key = utils$1.findKey(this, header);
1018
- if (key) {
1019
- const value = this[key];
1020
- if (!parser) {
1021
- return value;
1022
- }
1023
- if (parser === true) {
1024
- return parseTokens(value);
1025
- }
1026
- if (utils$1.isFunction(parser)) {
1027
- return parser.call(this, value, key);
1028
- }
1029
- if (utils$1.isRegExp(parser)) {
1030
- return parser.exec(value);
1031
- }
1032
- throw new TypeError("parser must be boolean|regexp|function");
1033
- }
1034
- }
1035
- }
1036
- has(header, matcher) {
1037
- header = normalizeHeader(header);
1038
- if (header) {
1039
- const key = utils$1.findKey(this, header);
1040
- return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1041
- }
1042
- return false;
1043
- }
1044
- delete(header, matcher) {
1045
- const self2 = this;
1046
- let deleted = false;
1047
- function deleteHeader(_header) {
1048
- _header = normalizeHeader(_header);
1049
- if (_header) {
1050
- const key = utils$1.findKey(self2, _header);
1051
- if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
1052
- delete self2[key];
1053
- deleted = true;
1054
- }
1055
- }
1056
- }
1057
- if (utils$1.isArray(header)) {
1058
- header.forEach(deleteHeader);
1059
- } else {
1060
- deleteHeader(header);
1061
- }
1062
- return deleted;
1063
- }
1064
- clear(matcher) {
1065
- const keys = Object.keys(this);
1066
- let i = keys.length;
1067
- let deleted = false;
1068
- while (i--) {
1069
- const key = keys[i];
1070
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1071
- delete this[key];
1072
- deleted = true;
1073
- }
1074
- }
1075
- return deleted;
1076
- }
1077
- normalize(format) {
1078
- const self2 = this;
1079
- const headers = {};
1080
- utils$1.forEach(this, (value, header) => {
1081
- const key = utils$1.findKey(headers, header);
1082
- if (key) {
1083
- self2[key] = normalizeValue(value);
1084
- delete self2[header];
1085
- return;
1086
- }
1087
- const normalized = format ? formatHeader(header) : String(header).trim();
1088
- if (normalized !== header) {
1089
- delete self2[header];
1090
- }
1091
- self2[normalized] = normalizeValue(value);
1092
- headers[normalized] = true;
1093
- });
1094
- return this;
1095
- }
1096
- concat(...targets) {
1097
- return this.constructor.concat(this, ...targets);
1098
- }
1099
- toJSON(asStrings) {
1100
- const obj = /* @__PURE__ */ Object.create(null);
1101
- utils$1.forEach(this, (value, header) => {
1102
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
1103
- });
1104
- return obj;
1105
- }
1106
- [Symbol.iterator]() {
1107
- return Object.entries(this.toJSON())[Symbol.iterator]();
1108
- }
1109
- toString() {
1110
- return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
1111
- }
1112
- get [Symbol.toStringTag]() {
1113
- return "AxiosHeaders";
1114
- }
1115
- static from(thing) {
1116
- return thing instanceof this ? thing : new this(thing);
1117
- }
1118
- static concat(first, ...targets) {
1119
- const computed = new this(first);
1120
- targets.forEach((target) => computed.set(target));
1121
- return computed;
1122
- }
1123
- static accessor(header) {
1124
- const internals = this[$internals] = this[$internals] = {
1125
- accessors: {}
1126
- };
1127
- const accessors = internals.accessors;
1128
- const prototype2 = this.prototype;
1129
- function defineAccessor(_header) {
1130
- const lHeader = normalizeHeader(_header);
1131
- if (!accessors[lHeader]) {
1132
- buildAccessors(prototype2, _header);
1133
- accessors[lHeader] = true;
1134
- }
1135
- }
1136
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1137
- return this;
1138
- }
1139
- };
1140
- AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1141
- utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
1142
- let mapped = key[0].toUpperCase() + key.slice(1);
1143
- return {
1144
- get: () => value,
1145
- set(headerValue) {
1146
- this[mapped] = headerValue;
1147
- }
1148
- };
1149
- });
1150
- utils$1.freezeMethods(AxiosHeaders$1);
1151
- function transformData(fns, response) {
1152
- const config = this || defaults;
1153
- const context = response || config;
1154
- const headers = AxiosHeaders$1.from(context.headers);
1155
- let data = context.data;
1156
- utils$1.forEach(fns, function transform(fn) {
1157
- data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
1158
- });
1159
- headers.normalize();
1160
- return data;
1161
- }
1162
- function isCancel$1(value) {
1163
- return !!(value && value.__CANCEL__);
1164
- }
1165
- function CanceledError$1(message, config, request) {
1166
- AxiosError$1.call(this, message == null ? "canceled" : message, AxiosError$1.ERR_CANCELED, config, request);
1167
- this.name = "CanceledError";
1168
- }
1169
- utils$1.inherits(CanceledError$1, AxiosError$1, {
1170
- __CANCEL__: true
1171
- });
1172
- function settle(resolve, reject, response) {
1173
- const validateStatus2 = response.config.validateStatus;
1174
- if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
1175
- resolve(response);
1176
- } else {
1177
- reject(new AxiosError$1(
1178
- "Request failed with status code " + response.status,
1179
- [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
1180
- response.config,
1181
- response.request,
1182
- response
1183
- ));
1184
- }
1185
- }
1186
- function parseProtocol(url) {
1187
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
1188
- return match && match[1] || "";
1189
- }
1190
- function speedometer(samplesCount, min) {
1191
- samplesCount = samplesCount || 10;
1192
- const bytes = new Array(samplesCount);
1193
- const timestamps = new Array(samplesCount);
1194
- let head = 0;
1195
- let tail = 0;
1196
- let firstSampleTS;
1197
- min = min !== void 0 ? min : 1e3;
1198
- return function push(chunkLength) {
1199
- const now = Date.now();
1200
- const startedAt = timestamps[tail];
1201
- if (!firstSampleTS) {
1202
- firstSampleTS = now;
1203
- }
1204
- bytes[head] = chunkLength;
1205
- timestamps[head] = now;
1206
- let i = tail;
1207
- let bytesCount = 0;
1208
- while (i !== head) {
1209
- bytesCount += bytes[i++];
1210
- i = i % samplesCount;
1211
- }
1212
- head = (head + 1) % samplesCount;
1213
- if (head === tail) {
1214
- tail = (tail + 1) % samplesCount;
1215
- }
1216
- if (now - firstSampleTS < min) {
1217
- return;
1218
- }
1219
- const passed = startedAt && now - startedAt;
1220
- return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
1221
- };
1222
- }
1223
- function throttle(fn, freq) {
1224
- let timestamp = 0;
1225
- let threshold = 1e3 / freq;
1226
- let lastArgs;
1227
- let timer;
1228
- const invoke = (args, now = Date.now()) => {
1229
- timestamp = now;
1230
- lastArgs = null;
1231
- if (timer) {
1232
- clearTimeout(timer);
1233
- timer = null;
1234
- }
1235
- fn.apply(null, args);
1236
- };
1237
- const throttled = (...args) => {
1238
- const now = Date.now();
1239
- const passed = now - timestamp;
1240
- if (passed >= threshold) {
1241
- invoke(args, now);
1242
- } else {
1243
- lastArgs = args;
1244
- if (!timer) {
1245
- timer = setTimeout(() => {
1246
- timer = null;
1247
- invoke(lastArgs);
1248
- }, threshold - passed);
1249
- }
1250
- }
1251
- };
1252
- const flush = () => lastArgs && invoke(lastArgs);
1253
- return [throttled, flush];
1254
- }
1255
- const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
1256
- let bytesNotified = 0;
1257
- const _speedometer = speedometer(50, 250);
1258
- return throttle((e) => {
1259
- const loaded = e.loaded;
1260
- const total = e.lengthComputable ? e.total : void 0;
1261
- const progressBytes = loaded - bytesNotified;
1262
- const rate = _speedometer(progressBytes);
1263
- const inRange = loaded <= total;
1264
- bytesNotified = loaded;
1265
- const data = {
1266
- loaded,
1267
- total,
1268
- progress: total ? loaded / total : void 0,
1269
- bytes: progressBytes,
1270
- rate: rate ? rate : void 0,
1271
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
1272
- event: e,
1273
- lengthComputable: total != null,
1274
- [isDownloadStream ? "download" : "upload"]: true
1275
- };
1276
- listener(data);
1277
- }, freq);
1278
- };
1279
- const progressEventDecorator = (total, throttled) => {
1280
- const lengthComputable = total != null;
1281
- return [(loaded) => throttled[0]({
1282
- lengthComputable,
1283
- total,
1284
- loaded
1285
- }), throttled[1]];
1286
- };
1287
- const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
1288
- const isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
1289
- url = new URL(url, platform.origin);
1290
- return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
1291
- })(
1292
- new URL(platform.origin),
1293
- platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
1294
- ) : () => true;
1295
- const cookies = platform.hasStandardBrowserEnv ? (
1296
- // Standard browser envs support document.cookie
1297
- {
1298
- write(name, value, expires, path, domain, secure) {
1299
- const cookie = [name + "=" + encodeURIComponent(value)];
1300
- utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
1301
- utils$1.isString(path) && cookie.push("path=" + path);
1302
- utils$1.isString(domain) && cookie.push("domain=" + domain);
1303
- secure === true && cookie.push("secure");
1304
- document.cookie = cookie.join("; ");
1305
- },
1306
- read(name) {
1307
- const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
1308
- return match ? decodeURIComponent(match[3]) : null;
1309
- },
1310
- remove(name) {
1311
- this.write(name, "", Date.now() - 864e5);
1312
- }
1313
- }
1314
- ) : (
1315
- // Non-standard browser env (web workers, react-native) lack needed support.
1316
- {
1317
- write() {
1318
- },
1319
- read() {
1320
- return null;
1321
- },
1322
- remove() {
1323
- }
1324
- }
1325
- );
1326
- function isAbsoluteURL(url) {
1327
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
1328
- }
1329
- function combineURLs(baseURL, relativeURL) {
1330
- return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
1331
- }
1332
- function buildFullPath(baseURL, requestedURL) {
1333
- if (baseURL && !isAbsoluteURL(requestedURL)) {
1334
- return combineURLs(baseURL, requestedURL);
1335
- }
1336
- return requestedURL;
1337
- }
1338
- const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
1339
- function mergeConfig$1(config1, config2) {
1340
- config2 = config2 || {};
1341
- const config = {};
1342
- function getMergedValue(target, source, prop, caseless) {
1343
- if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
1344
- return utils$1.merge.call({ caseless }, target, source);
1345
- } else if (utils$1.isPlainObject(source)) {
1346
- return utils$1.merge({}, source);
1347
- } else if (utils$1.isArray(source)) {
1348
- return source.slice();
1349
- }
1350
- return source;
1351
- }
1352
- function mergeDeepProperties(a, b, prop, caseless) {
1353
- if (!utils$1.isUndefined(b)) {
1354
- return getMergedValue(a, b, prop, caseless);
1355
- } else if (!utils$1.isUndefined(a)) {
1356
- return getMergedValue(void 0, a, prop, caseless);
1357
- }
1358
- }
1359
- function valueFromConfig2(a, b) {
1360
- if (!utils$1.isUndefined(b)) {
1361
- return getMergedValue(void 0, b);
1362
- }
1363
- }
1364
- function defaultToConfig2(a, b) {
1365
- if (!utils$1.isUndefined(b)) {
1366
- return getMergedValue(void 0, b);
1367
- } else if (!utils$1.isUndefined(a)) {
1368
- return getMergedValue(void 0, a);
1369
- }
1370
- }
1371
- function mergeDirectKeys(a, b, prop) {
1372
- if (prop in config2) {
1373
- return getMergedValue(a, b);
1374
- } else if (prop in config1) {
1375
- return getMergedValue(void 0, a);
1376
- }
1377
- }
1378
- const mergeMap = {
1379
- url: valueFromConfig2,
1380
- method: valueFromConfig2,
1381
- data: valueFromConfig2,
1382
- baseURL: defaultToConfig2,
1383
- transformRequest: defaultToConfig2,
1384
- transformResponse: defaultToConfig2,
1385
- paramsSerializer: defaultToConfig2,
1386
- timeout: defaultToConfig2,
1387
- timeoutMessage: defaultToConfig2,
1388
- withCredentials: defaultToConfig2,
1389
- withXSRFToken: defaultToConfig2,
1390
- adapter: defaultToConfig2,
1391
- responseType: defaultToConfig2,
1392
- xsrfCookieName: defaultToConfig2,
1393
- xsrfHeaderName: defaultToConfig2,
1394
- onUploadProgress: defaultToConfig2,
1395
- onDownloadProgress: defaultToConfig2,
1396
- decompress: defaultToConfig2,
1397
- maxContentLength: defaultToConfig2,
1398
- maxBodyLength: defaultToConfig2,
1399
- beforeRedirect: defaultToConfig2,
1400
- transport: defaultToConfig2,
1401
- httpAgent: defaultToConfig2,
1402
- httpsAgent: defaultToConfig2,
1403
- cancelToken: defaultToConfig2,
1404
- socketPath: defaultToConfig2,
1405
- responseEncoding: defaultToConfig2,
1406
- validateStatus: mergeDirectKeys,
1407
- headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
1408
- };
1409
- utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
1410
- const merge2 = mergeMap[prop] || mergeDeepProperties;
1411
- const configValue = merge2(config1[prop], config2[prop], prop);
1412
- utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
1413
- });
1414
- return config;
1415
- }
1416
- const resolveConfig = (config) => {
1417
- const newConfig = mergeConfig$1({}, config);
1418
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
1419
- newConfig.headers = headers = AxiosHeaders$1.from(headers);
1420
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
1421
- if (auth) {
1422
- headers.set(
1423
- "Authorization",
1424
- "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
1425
- );
1426
- }
1427
- let contentType;
1428
- if (utils$1.isFormData(data)) {
1429
- if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
1430
- headers.setContentType(void 0);
1431
- } else if ((contentType = headers.getContentType()) !== false) {
1432
- const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
1433
- headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
1434
- }
1435
- }
1436
- if (platform.hasStandardBrowserEnv) {
1437
- withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
1438
- if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
1439
- const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
1440
- if (xsrfValue) {
1441
- headers.set(xsrfHeaderName, xsrfValue);
1442
- }
1443
- }
1444
- }
1445
- return newConfig;
1446
- };
1447
- const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
1448
- const xhrAdapter = isXHRAdapterSupported && function(config) {
1449
- return new Promise(function dispatchXhrRequest(resolve, reject) {
1450
- const _config = resolveConfig(config);
1451
- let requestData = _config.data;
1452
- const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
1453
- let { responseType, onUploadProgress, onDownloadProgress } = _config;
1454
- let onCanceled;
1455
- let uploadThrottled, downloadThrottled;
1456
- let flushUpload, flushDownload;
1457
- function done() {
1458
- flushUpload && flushUpload();
1459
- flushDownload && flushDownload();
1460
- _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
1461
- _config.signal && _config.signal.removeEventListener("abort", onCanceled);
1462
- }
1463
- let request = new XMLHttpRequest();
1464
- request.open(_config.method.toUpperCase(), _config.url, true);
1465
- request.timeout = _config.timeout;
1466
- function onloadend() {
1467
- if (!request) {
1468
- return;
1469
- }
1470
- const responseHeaders = AxiosHeaders$1.from(
1471
- "getAllResponseHeaders" in request && request.getAllResponseHeaders()
1472
- );
1473
- const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
1474
- const response = {
1475
- data: responseData,
1476
- status: request.status,
1477
- statusText: request.statusText,
1478
- headers: responseHeaders,
1479
- config,
1480
- request
1481
- };
1482
- settle(function _resolve(value) {
1483
- resolve(value);
1484
- done();
1485
- }, function _reject(err) {
1486
- reject(err);
1487
- done();
1488
- }, response);
1489
- request = null;
1490
- }
1491
- if ("onloadend" in request) {
1492
- request.onloadend = onloadend;
1493
- } else {
1494
- request.onreadystatechange = function handleLoad() {
1495
- if (!request || request.readyState !== 4) {
1496
- return;
1497
- }
1498
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
1499
- return;
1500
- }
1501
- setTimeout(onloadend);
1502
- };
1503
- }
1504
- request.onabort = function handleAbort() {
1505
- if (!request) {
1506
- return;
1507
- }
1508
- reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
1509
- request = null;
1510
- };
1511
- request.onerror = function handleError() {
1512
- reject(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request));
1513
- request = null;
1514
- };
1515
- request.ontimeout = function handleTimeout() {
1516
- let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
1517
- const transitional2 = _config.transitional || transitionalDefaults;
1518
- if (_config.timeoutErrorMessage) {
1519
- timeoutErrorMessage = _config.timeoutErrorMessage;
1520
- }
1521
- reject(new AxiosError$1(
1522
- timeoutErrorMessage,
1523
- transitional2.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
1524
- config,
1525
- request
1526
- ));
1527
- request = null;
1528
- };
1529
- requestData === void 0 && requestHeaders.setContentType(null);
1530
- if ("setRequestHeader" in request) {
1531
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
1532
- request.setRequestHeader(key, val);
1533
- });
1534
- }
1535
- if (!utils$1.isUndefined(_config.withCredentials)) {
1536
- request.withCredentials = !!_config.withCredentials;
1537
- }
1538
- if (responseType && responseType !== "json") {
1539
- request.responseType = _config.responseType;
1540
- }
1541
- if (onDownloadProgress) {
1542
- [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
1543
- request.addEventListener("progress", downloadThrottled);
1544
- }
1545
- if (onUploadProgress && request.upload) {
1546
- [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
1547
- request.upload.addEventListener("progress", uploadThrottled);
1548
- request.upload.addEventListener("loadend", flushUpload);
1549
- }
1550
- if (_config.cancelToken || _config.signal) {
1551
- onCanceled = (cancel) => {
1552
- if (!request) {
1553
- return;
1554
- }
1555
- reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
1556
- request.abort();
1557
- request = null;
1558
- };
1559
- _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
1560
- if (_config.signal) {
1561
- _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
1562
- }
1563
- }
1564
- const protocol = parseProtocol(_config.url);
1565
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
1566
- reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config));
1567
- return;
1568
- }
1569
- request.send(requestData || null);
1570
- });
1571
- };
1572
- const composeSignals = (signals, timeout) => {
1573
- const { length } = signals = signals ? signals.filter(Boolean) : [];
1574
- if (timeout || length) {
1575
- let controller = new AbortController();
1576
- let aborted;
1577
- const onabort = function(reason) {
1578
- if (!aborted) {
1579
- aborted = true;
1580
- unsubscribe();
1581
- const err = reason instanceof Error ? reason : this.reason;
1582
- controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
1583
- }
1584
- };
1585
- let timer = timeout && setTimeout(() => {
1586
- timer = null;
1587
- onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
1588
- }, timeout);
1589
- const unsubscribe = () => {
1590
- if (signals) {
1591
- timer && clearTimeout(timer);
1592
- timer = null;
1593
- signals.forEach((signal2) => {
1594
- signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
1595
- });
1596
- signals = null;
1597
- }
1598
- };
1599
- signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
1600
- const { signal } = controller;
1601
- signal.unsubscribe = () => utils$1.asap(unsubscribe);
1602
- return signal;
1603
- }
1604
- };
1605
- const streamChunk = function* (chunk, chunkSize) {
1606
- let len = chunk.byteLength;
1607
- if (len < chunkSize) {
1608
- yield chunk;
1609
- return;
1610
- }
1611
- let pos = 0;
1612
- let end;
1613
- while (pos < len) {
1614
- end = pos + chunkSize;
1615
- yield chunk.slice(pos, end);
1616
- pos = end;
1617
- }
1618
- };
1619
- const readBytes = async function* (iterable, chunkSize) {
1620
- for await (const chunk of readStream(iterable)) {
1621
- yield* streamChunk(chunk, chunkSize);
1622
- }
1623
- };
1624
- const readStream = async function* (stream) {
1625
- if (stream[Symbol.asyncIterator]) {
1626
- yield* stream;
1627
- return;
1628
- }
1629
- const reader = stream.getReader();
1630
- try {
1631
- for (; ; ) {
1632
- const { done, value } = await reader.read();
1633
- if (done) {
1634
- break;
1635
- }
1636
- yield value;
1637
- }
1638
- } finally {
1639
- await reader.cancel();
1640
- }
1641
- };
1642
- const trackStream = (stream, chunkSize, onProgress, onFinish) => {
1643
- const iterator = readBytes(stream, chunkSize);
1644
- let bytes = 0;
1645
- let done;
1646
- let _onFinish = (e) => {
1647
- if (!done) {
1648
- done = true;
1649
- onFinish && onFinish(e);
1650
- }
1651
- };
1652
- return new ReadableStream({
1653
- async pull(controller) {
1654
- try {
1655
- const { done: done2, value } = await iterator.next();
1656
- if (done2) {
1657
- _onFinish();
1658
- controller.close();
1659
- return;
1660
- }
1661
- let len = value.byteLength;
1662
- if (onProgress) {
1663
- let loadedBytes = bytes += len;
1664
- onProgress(loadedBytes);
1665
- }
1666
- controller.enqueue(new Uint8Array(value));
1667
- } catch (err) {
1668
- _onFinish(err);
1669
- throw err;
1670
- }
1671
- },
1672
- cancel(reason) {
1673
- _onFinish(reason);
1674
- return iterator.return();
1675
- }
1676
- }, {
1677
- highWaterMark: 2
1678
- });
1679
- };
1680
- const isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
1681
- const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
1682
- const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
1683
- const test = (fn, ...args) => {
1684
- try {
1685
- return !!fn(...args);
1686
- } catch (e) {
1687
- return false;
1688
- }
1689
- };
1690
- const supportsRequestStream = isReadableStreamSupported && test(() => {
1691
- let duplexAccessed = false;
1692
- const hasContentType = new Request(platform.origin, {
1693
- body: new ReadableStream(),
1694
- method: "POST",
1695
- get duplex() {
1696
- duplexAccessed = true;
1697
- return "half";
1698
- }
1699
- }).headers.has("Content-Type");
1700
- return duplexAccessed && !hasContentType;
1701
- });
1702
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
1703
- const supportsResponseStream = isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
1704
- const resolvers = {
1705
- stream: supportsResponseStream && ((res) => res.body)
1706
- };
1707
- isFetchSupported && ((res) => {
1708
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
1709
- !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
1710
- throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
1711
- });
1712
- });
1713
- })(new Response());
1714
- const getBodyLength = async (body) => {
1715
- if (body == null) {
1716
- return 0;
1717
- }
1718
- if (utils$1.isBlob(body)) {
1719
- return body.size;
1720
- }
1721
- if (utils$1.isSpecCompliantForm(body)) {
1722
- const _request = new Request(platform.origin, {
1723
- method: "POST",
1724
- body
1725
- });
1726
- return (await _request.arrayBuffer()).byteLength;
1727
- }
1728
- if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
1729
- return body.byteLength;
1730
- }
1731
- if (utils$1.isURLSearchParams(body)) {
1732
- body = body + "";
1733
- }
1734
- if (utils$1.isString(body)) {
1735
- return (await encodeText(body)).byteLength;
1736
- }
1737
- };
1738
- const resolveBodyLength = async (headers, body) => {
1739
- const length = utils$1.toFiniteNumber(headers.getContentLength());
1740
- return length == null ? getBodyLength(body) : length;
1741
- };
1742
- const fetchAdapter = isFetchSupported && (async (config) => {
1743
- let {
1744
- url,
1745
- method,
1746
- data,
1747
- signal,
1748
- cancelToken,
1749
- timeout,
1750
- onDownloadProgress,
1751
- onUploadProgress,
1752
- responseType,
1753
- headers,
1754
- withCredentials = "same-origin",
1755
- fetchOptions
1756
- } = resolveConfig(config);
1757
- responseType = responseType ? (responseType + "").toLowerCase() : "text";
1758
- let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
1759
- let request;
1760
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
1761
- composedSignal.unsubscribe();
1762
- });
1763
- let requestContentLength;
1764
- try {
1765
- if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
1766
- let _request = new Request(url, {
1767
- method: "POST",
1768
- body: data,
1769
- duplex: "half"
1770
- });
1771
- let contentTypeHeader;
1772
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
1773
- headers.setContentType(contentTypeHeader);
1774
- }
1775
- if (_request.body) {
1776
- const [onProgress, flush] = progressEventDecorator(
1777
- requestContentLength,
1778
- progressEventReducer(asyncDecorator(onUploadProgress))
1779
- );
1780
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
1781
- }
1782
- }
1783
- if (!utils$1.isString(withCredentials)) {
1784
- withCredentials = withCredentials ? "include" : "omit";
1785
- }
1786
- const isCredentialsSupported = "credentials" in Request.prototype;
1787
- request = new Request(url, {
1788
- ...fetchOptions,
1789
- signal: composedSignal,
1790
- method: method.toUpperCase(),
1791
- headers: headers.normalize().toJSON(),
1792
- body: data,
1793
- duplex: "half",
1794
- credentials: isCredentialsSupported ? withCredentials : void 0
1795
- });
1796
- let response = await fetch(request);
1797
- const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
1798
- if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
1799
- const options = {};
1800
- ["status", "statusText", "headers"].forEach((prop) => {
1801
- options[prop] = response[prop];
1802
- });
1803
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
1804
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
1805
- responseContentLength,
1806
- progressEventReducer(asyncDecorator(onDownloadProgress), true)
1807
- ) || [];
1808
- response = new Response(
1809
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
1810
- flush && flush();
1811
- unsubscribe && unsubscribe();
1812
- }),
1813
- options
1814
- );
1815
- }
1816
- responseType = responseType || "text";
1817
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
1818
- !isStreamResponse && unsubscribe && unsubscribe();
1819
- return await new Promise((resolve, reject) => {
1820
- settle(resolve, reject, {
1821
- data: responseData,
1822
- headers: AxiosHeaders$1.from(response.headers),
1823
- status: response.status,
1824
- statusText: response.statusText,
1825
- config,
1826
- request
1827
- });
1828
- });
1829
- } catch (err) {
1830
- unsubscribe && unsubscribe();
1831
- if (err && err.name === "TypeError" && /fetch/i.test(err.message)) {
1832
- throw Object.assign(
1833
- new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request),
1834
- {
1835
- cause: err.cause || err
1836
- }
1837
- );
1838
- }
1839
- throw AxiosError$1.from(err, err && err.code, config, request);
1840
- }
1841
- });
1842
- const knownAdapters = {
1843
- http: httpAdapter,
1844
- xhr: xhrAdapter,
1845
- fetch: fetchAdapter
1846
- };
1847
- utils$1.forEach(knownAdapters, (fn, value) => {
1848
- if (fn) {
1849
- try {
1850
- Object.defineProperty(fn, "name", { value });
1851
- } catch (e) {
1852
- }
1853
- Object.defineProperty(fn, "adapterName", { value });
1854
- }
1855
- });
1856
- const renderReason = (reason) => `- ${reason}`;
1857
- const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
1858
- const adapters = {
1859
- getAdapter: (adapters2) => {
1860
- adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
1861
- const { length } = adapters2;
1862
- let nameOrAdapter;
1863
- let adapter;
1864
- const rejectedReasons = {};
1865
- for (let i = 0; i < length; i++) {
1866
- nameOrAdapter = adapters2[i];
1867
- let id;
1868
- adapter = nameOrAdapter;
1869
- if (!isResolvedHandle(nameOrAdapter)) {
1870
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
1871
- if (adapter === void 0) {
1872
- throw new AxiosError$1(`Unknown adapter '${id}'`);
1873
- }
1874
- }
1875
- if (adapter) {
1876
- break;
1877
- }
1878
- rejectedReasons[id || "#" + i] = adapter;
1879
- }
1880
- if (!adapter) {
1881
- const reasons = Object.entries(rejectedReasons).map(
1882
- ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
1883
- );
1884
- let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
1885
- throw new AxiosError$1(
1886
- `There is no suitable adapter to dispatch the request ` + s,
1887
- "ERR_NOT_SUPPORT"
1888
- );
1889
- }
1890
- return adapter;
1891
- },
1892
- adapters: knownAdapters
1893
- };
1894
- function throwIfCancellationRequested(config) {
1895
- if (config.cancelToken) {
1896
- config.cancelToken.throwIfRequested();
1897
- }
1898
- if (config.signal && config.signal.aborted) {
1899
- throw new CanceledError$1(null, config);
1900
- }
1901
- }
1902
- function dispatchRequest(config) {
1903
- throwIfCancellationRequested(config);
1904
- config.headers = AxiosHeaders$1.from(config.headers);
1905
- config.data = transformData.call(
1906
- config,
1907
- config.transformRequest
1908
- );
1909
- if (["post", "put", "patch"].indexOf(config.method) !== -1) {
1910
- config.headers.setContentType("application/x-www-form-urlencoded", false);
1911
- }
1912
- const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
1913
- return adapter(config).then(function onAdapterResolution(response) {
1914
- throwIfCancellationRequested(config);
1915
- response.data = transformData.call(
1916
- config,
1917
- config.transformResponse,
1918
- response
1919
- );
1920
- response.headers = AxiosHeaders$1.from(response.headers);
1921
- return response;
1922
- }, function onAdapterRejection(reason) {
1923
- if (!isCancel$1(reason)) {
1924
- throwIfCancellationRequested(config);
1925
- if (reason && reason.response) {
1926
- reason.response.data = transformData.call(
1927
- config,
1928
- config.transformResponse,
1929
- reason.response
1930
- );
1931
- reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
1932
- }
1933
- }
1934
- return Promise.reject(reason);
1935
- });
1936
- }
1937
- const VERSION$1 = "1.7.9";
1938
- const validators$1 = {};
1939
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
1940
- validators$1[type] = function validator2(thing) {
1941
- return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
1942
- };
1943
- });
1944
- const deprecatedWarnings = {};
1945
- validators$1.transitional = function transitional(validator2, version, message) {
1946
- function formatMessage(opt, desc) {
1947
- return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
1948
- }
1949
- return (value, opt, opts) => {
1950
- if (validator2 === false) {
1951
- throw new AxiosError$1(
1952
- formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
1953
- AxiosError$1.ERR_DEPRECATED
1954
- );
1955
- }
1956
- if (version && !deprecatedWarnings[opt]) {
1957
- deprecatedWarnings[opt] = true;
1958
- console.warn(
1959
- formatMessage(
1960
- opt,
1961
- " has been deprecated since v" + version + " and will be removed in the near future"
1962
- )
1963
- );
1964
- }
1965
- return validator2 ? validator2(value, opt, opts) : true;
1966
- };
1967
- };
1968
- validators$1.spelling = function spelling(correctSpelling) {
1969
- return (value, opt) => {
1970
- console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
1971
- return true;
1972
- };
1973
- };
1974
- function assertOptions(options, schema, allowUnknown) {
1975
- if (typeof options !== "object") {
1976
- throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
1977
- }
1978
- const keys = Object.keys(options);
1979
- let i = keys.length;
1980
- while (i-- > 0) {
1981
- const opt = keys[i];
1982
- const validator2 = schema[opt];
1983
- if (validator2) {
1984
- const value = options[opt];
1985
- const result = value === void 0 || validator2(value, opt, options);
1986
- if (result !== true) {
1987
- throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
1988
- }
1989
- continue;
1990
- }
1991
- if (allowUnknown !== true) {
1992
- throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION);
1993
- }
1994
- }
1995
- }
1996
- const validator = {
1997
- assertOptions,
1998
- validators: validators$1
1999
- };
2000
- const validators = validator.validators;
2001
- let Axios$1 = class Axios {
2002
- constructor(instanceConfig) {
2003
- this.defaults = instanceConfig;
2004
- this.interceptors = {
2005
- request: new InterceptorManager(),
2006
- response: new InterceptorManager()
2007
- };
2008
- }
2009
- /**
2010
- * Dispatch a request
2011
- *
2012
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2013
- * @param {?Object} config
2014
- *
2015
- * @returns {Promise} The Promise to be fulfilled
2016
- */
2017
- async request(configOrUrl, config) {
2018
- try {
2019
- return await this._request(configOrUrl, config);
2020
- } catch (err) {
2021
- if (err instanceof Error) {
2022
- let dummy = {};
2023
- Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
2024
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
2025
- try {
2026
- if (!err.stack) {
2027
- err.stack = stack;
2028
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
2029
- err.stack += "\n" + stack;
2030
- }
2031
- } catch (e) {
2032
- }
2033
- }
2034
- throw err;
2035
- }
2036
- }
2037
- _request(configOrUrl, config) {
2038
- if (typeof configOrUrl === "string") {
2039
- config = config || {};
2040
- config.url = configOrUrl;
2041
- } else {
2042
- config = configOrUrl || {};
2043
- }
2044
- config = mergeConfig$1(this.defaults, config);
2045
- const { transitional: transitional2, paramsSerializer, headers } = config;
2046
- if (transitional2 !== void 0) {
2047
- validator.assertOptions(transitional2, {
2048
- silentJSONParsing: validators.transitional(validators.boolean),
2049
- forcedJSONParsing: validators.transitional(validators.boolean),
2050
- clarifyTimeoutError: validators.transitional(validators.boolean)
2051
- }, false);
2052
- }
2053
- if (paramsSerializer != null) {
2054
- if (utils$1.isFunction(paramsSerializer)) {
2055
- config.paramsSerializer = {
2056
- serialize: paramsSerializer
2057
- };
2058
- } else {
2059
- validator.assertOptions(paramsSerializer, {
2060
- encode: validators.function,
2061
- serialize: validators.function
2062
- }, true);
2063
- }
2064
- }
2065
- validator.assertOptions(config, {
2066
- baseUrl: validators.spelling("baseURL"),
2067
- withXsrfToken: validators.spelling("withXSRFToken")
2068
- }, true);
2069
- config.method = (config.method || this.defaults.method || "get").toLowerCase();
2070
- let contextHeaders = headers && utils$1.merge(
2071
- headers.common,
2072
- headers[config.method]
2073
- );
2074
- headers && utils$1.forEach(
2075
- ["delete", "get", "head", "post", "put", "patch", "common"],
2076
- (method) => {
2077
- delete headers[method];
2078
- }
2079
- );
2080
- config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
2081
- const requestInterceptorChain = [];
2082
- let synchronousRequestInterceptors = true;
2083
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
2084
- if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
2085
- return;
2086
- }
2087
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
2088
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
2089
- });
2090
- const responseInterceptorChain = [];
2091
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
2092
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
2093
- });
2094
- let promise;
2095
- let i = 0;
2096
- let len;
2097
- if (!synchronousRequestInterceptors) {
2098
- const chain = [dispatchRequest.bind(this), void 0];
2099
- chain.unshift.apply(chain, requestInterceptorChain);
2100
- chain.push.apply(chain, responseInterceptorChain);
2101
- len = chain.length;
2102
- promise = Promise.resolve(config);
2103
- while (i < len) {
2104
- promise = promise.then(chain[i++], chain[i++]);
2105
- }
2106
- return promise;
2107
- }
2108
- len = requestInterceptorChain.length;
2109
- let newConfig = config;
2110
- i = 0;
2111
- while (i < len) {
2112
- const onFulfilled = requestInterceptorChain[i++];
2113
- const onRejected = requestInterceptorChain[i++];
2114
- try {
2115
- newConfig = onFulfilled(newConfig);
2116
- } catch (error) {
2117
- onRejected.call(this, error);
2118
- break;
2119
- }
2120
- }
2121
- try {
2122
- promise = dispatchRequest.call(this, newConfig);
2123
- } catch (error) {
2124
- return Promise.reject(error);
2125
- }
2126
- i = 0;
2127
- len = responseInterceptorChain.length;
2128
- while (i < len) {
2129
- promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
2130
- }
2131
- return promise;
2132
- }
2133
- getUri(config) {
2134
- config = mergeConfig$1(this.defaults, config);
2135
- const fullPath = buildFullPath(config.baseURL, config.url);
2136
- return buildURL(fullPath, config.params, config.paramsSerializer);
2137
- }
2138
- };
2139
- utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
2140
- Axios$1.prototype[method] = function(url, config) {
2141
- return this.request(mergeConfig$1(config || {}, {
2142
- method,
2143
- url,
2144
- data: (config || {}).data
2145
- }));
2146
- };
2147
- });
2148
- utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
2149
- function generateHTTPMethod(isForm) {
2150
- return function httpMethod(url, data, config) {
2151
- return this.request(mergeConfig$1(config || {}, {
2152
- method,
2153
- headers: isForm ? {
2154
- "Content-Type": "multipart/form-data"
2155
- } : {},
2156
- url,
2157
- data
2158
- }));
2159
- };
2160
- }
2161
- Axios$1.prototype[method] = generateHTTPMethod();
2162
- Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
2163
- });
2164
- let CancelToken$1 = class CancelToken {
2165
- constructor(executor) {
2166
- if (typeof executor !== "function") {
2167
- throw new TypeError("executor must be a function.");
2168
- }
2169
- let resolvePromise;
2170
- this.promise = new Promise(function promiseExecutor(resolve) {
2171
- resolvePromise = resolve;
2172
- });
2173
- const token = this;
2174
- this.promise.then((cancel) => {
2175
- if (!token._listeners) return;
2176
- let i = token._listeners.length;
2177
- while (i-- > 0) {
2178
- token._listeners[i](cancel);
2179
- }
2180
- token._listeners = null;
2181
- });
2182
- this.promise.then = (onfulfilled) => {
2183
- let _resolve;
2184
- const promise = new Promise((resolve) => {
2185
- token.subscribe(resolve);
2186
- _resolve = resolve;
2187
- }).then(onfulfilled);
2188
- promise.cancel = function reject() {
2189
- token.unsubscribe(_resolve);
2190
- };
2191
- return promise;
2192
- };
2193
- executor(function cancel(message, config, request) {
2194
- if (token.reason) {
2195
- return;
2196
- }
2197
- token.reason = new CanceledError$1(message, config, request);
2198
- resolvePromise(token.reason);
2199
- });
2200
- }
2201
- /**
2202
- * Throws a `CanceledError` if cancellation has been requested.
2203
- */
2204
- throwIfRequested() {
2205
- if (this.reason) {
2206
- throw this.reason;
2207
- }
2208
- }
2209
- /**
2210
- * Subscribe to the cancel signal
2211
- */
2212
- subscribe(listener) {
2213
- if (this.reason) {
2214
- listener(this.reason);
2215
- return;
2216
- }
2217
- if (this._listeners) {
2218
- this._listeners.push(listener);
2219
- } else {
2220
- this._listeners = [listener];
2221
- }
2222
- }
2223
- /**
2224
- * Unsubscribe from the cancel signal
2225
- */
2226
- unsubscribe(listener) {
2227
- if (!this._listeners) {
2228
- return;
2229
- }
2230
- const index = this._listeners.indexOf(listener);
2231
- if (index !== -1) {
2232
- this._listeners.splice(index, 1);
2233
- }
2234
- }
2235
- toAbortSignal() {
2236
- const controller = new AbortController();
2237
- const abort = (err) => {
2238
- controller.abort(err);
2239
- };
2240
- this.subscribe(abort);
2241
- controller.signal.unsubscribe = () => this.unsubscribe(abort);
2242
- return controller.signal;
2243
- }
2244
- /**
2245
- * Returns an object that contains a new `CancelToken` and a function that, when called,
2246
- * cancels the `CancelToken`.
2247
- */
2248
- static source() {
2249
- let cancel;
2250
- const token = new CancelToken(function executor(c) {
2251
- cancel = c;
2252
- });
2253
- return {
2254
- token,
2255
- cancel
2256
- };
2257
- }
2258
- };
2259
- function spread$1(callback) {
2260
- return function wrap(arr) {
2261
- return callback.apply(null, arr);
2262
- };
2263
- }
2264
- function isAxiosError$1(payload) {
2265
- return utils$1.isObject(payload) && payload.isAxiosError === true;
2266
- }
2267
- const HttpStatusCode$1 = {
2268
- Continue: 100,
2269
- SwitchingProtocols: 101,
2270
- Processing: 102,
2271
- EarlyHints: 103,
2272
- Ok: 200,
2273
- Created: 201,
2274
- Accepted: 202,
2275
- NonAuthoritativeInformation: 203,
2276
- NoContent: 204,
2277
- ResetContent: 205,
2278
- PartialContent: 206,
2279
- MultiStatus: 207,
2280
- AlreadyReported: 208,
2281
- ImUsed: 226,
2282
- MultipleChoices: 300,
2283
- MovedPermanently: 301,
2284
- Found: 302,
2285
- SeeOther: 303,
2286
- NotModified: 304,
2287
- UseProxy: 305,
2288
- Unused: 306,
2289
- TemporaryRedirect: 307,
2290
- PermanentRedirect: 308,
2291
- BadRequest: 400,
2292
- Unauthorized: 401,
2293
- PaymentRequired: 402,
2294
- Forbidden: 403,
2295
- NotFound: 404,
2296
- MethodNotAllowed: 405,
2297
- NotAcceptable: 406,
2298
- ProxyAuthenticationRequired: 407,
2299
- RequestTimeout: 408,
2300
- Conflict: 409,
2301
- Gone: 410,
2302
- LengthRequired: 411,
2303
- PreconditionFailed: 412,
2304
- PayloadTooLarge: 413,
2305
- UriTooLong: 414,
2306
- UnsupportedMediaType: 415,
2307
- RangeNotSatisfiable: 416,
2308
- ExpectationFailed: 417,
2309
- ImATeapot: 418,
2310
- MisdirectedRequest: 421,
2311
- UnprocessableEntity: 422,
2312
- Locked: 423,
2313
- FailedDependency: 424,
2314
- TooEarly: 425,
2315
- UpgradeRequired: 426,
2316
- PreconditionRequired: 428,
2317
- TooManyRequests: 429,
2318
- RequestHeaderFieldsTooLarge: 431,
2319
- UnavailableForLegalReasons: 451,
2320
- InternalServerError: 500,
2321
- NotImplemented: 501,
2322
- BadGateway: 502,
2323
- ServiceUnavailable: 503,
2324
- GatewayTimeout: 504,
2325
- HttpVersionNotSupported: 505,
2326
- VariantAlsoNegotiates: 506,
2327
- InsufficientStorage: 507,
2328
- LoopDetected: 508,
2329
- NotExtended: 510,
2330
- NetworkAuthenticationRequired: 511
2331
- };
2332
- Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
2333
- HttpStatusCode$1[value] = key;
2334
- });
2335
- function createInstance(defaultConfig) {
2336
- const context = new Axios$1(defaultConfig);
2337
- const instance = bind(Axios$1.prototype.request, context);
2338
- utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
2339
- utils$1.extend(instance, context, null, { allOwnKeys: true });
2340
- instance.create = function create(instanceConfig) {
2341
- return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
2342
- };
2343
- return instance;
2344
- }
2345
- const axios = createInstance(defaults);
2346
- axios.Axios = Axios$1;
2347
- axios.CanceledError = CanceledError$1;
2348
- axios.CancelToken = CancelToken$1;
2349
- axios.isCancel = isCancel$1;
2350
- axios.VERSION = VERSION$1;
2351
- axios.toFormData = toFormData$1;
2352
- axios.AxiosError = AxiosError$1;
2353
- axios.Cancel = axios.CanceledError;
2354
- axios.all = function all(promises) {
2355
- return Promise.all(promises);
2356
- };
2357
- axios.spread = spread$1;
2358
- axios.isAxiosError = isAxiosError$1;
2359
- axios.mergeConfig = mergeConfig$1;
2360
- axios.AxiosHeaders = AxiosHeaders$1;
2361
- axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
2362
- axios.getAdapter = adapters.getAdapter;
2363
- axios.HttpStatusCode = HttpStatusCode$1;
2364
- axios.default = axios;
2365
- const {
2366
- Axios: Axios2,
2367
- AxiosError,
2368
- CanceledError,
2369
- isCancel,
2370
- CancelToken: CancelToken2,
2371
- VERSION,
2372
- all: all2,
2373
- Cancel,
2374
- isAxiosError,
2375
- spread,
2376
- toFormData,
2377
- AxiosHeaders: AxiosHeaders2,
2378
- HttpStatusCode,
2379
- formToJSON,
2380
- getAdapter,
2381
- mergeConfig
2382
- } = axios;
2383
- const BASE_PLUGIN_PATH = `/${PLUGIN_ID}`;
2384
- const JWT_TOKEN_NAME = "jwtToken";
2385
- const getToken = () => {
2386
- const jwtTokenCookie = document.cookie.split("; ").find((row) => row.startsWith(`${JWT_TOKEN_NAME}=`));
2387
- const jwtToken = jwtTokenCookie ? jwtTokenCookie.split("=")[1] : "";
2388
- const raw = jwtToken || localStorage.getItem(JWT_TOKEN_NAME) || sessionStorage.getItem(JWT_TOKEN_NAME) || "";
2389
- return raw.replace(/^["']|["']$/g, "");
2390
- };
2391
- const createStrapiApiAxiosInstance = (baseUrl = null) => {
2392
- if (baseUrl === null) {
2393
- baseUrl = `${BASE_PLUGIN_PATH}`;
2394
- }
2395
- const instance = axios.create();
2396
- instance.interceptors.request.use(
2397
- async (config) => {
2398
- const backendURL = (window.strapi?.backendURL || "").replace(/\/$/, "");
2399
- config.baseURL = `${backendURL}${baseUrl}`;
2400
- config.headers.set({
2401
- Accept: "application/json",
2402
- "Content-Type": "application/json",
2403
- // Add this header to identify the request as initiated by the plugin
2404
- "X-Localazy-Initiated-By": "strapi-plugin-localazy"
2405
- });
2406
- const token = getToken();
2407
- if (token) {
2408
- config.headers.set("Authorization", `Bearer ${token}`);
2409
- }
2410
- return config;
2411
- },
2412
- (error) => {
2413
- return Promise.reject(error);
2414
- }
2415
- );
2416
- instance.interceptors.response.use(
2417
- (response) => response,
2418
- (error) => {
2419
- throw error;
2420
- }
2421
- );
2422
- return instance;
2423
- };
2424
- export {
2425
- createStrapiApiAxiosInstance as c
2426
- };