@noxickon/onyx 0.1.0 → 1.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.
Files changed (68) hide show
  1. package/dist/animations.css +264 -0
  2. package/dist/chunks/hooks-DiKvsNs-.js +48 -0
  3. package/dist/chunks/hooks-bJFfbTks.js +8624 -0
  4. package/dist/chunks/query-BhvXa-m6.js +10 -0
  5. package/dist/chunks/query-iDn3qBGF.js +14 -0
  6. package/dist/chunks/ui-ChsTPgui.js +41 -0
  7. package/dist/chunks/ui-DxsSYHCv.js +20634 -0
  8. package/dist/chunks/useAuth-BFgXzu6Q.js +12 -0
  9. package/dist/chunks/useAuth-DxoDe3YA.js +1 -0
  10. package/dist/contexts/contexts.cjs.js +5 -0
  11. package/dist/contexts/contexts.es.js +156 -0
  12. package/dist/contexts.d.ts +117 -0
  13. package/dist/hooks/hooks.cjs.js +1 -6
  14. package/dist/hooks/hooks.es.js +11 -1916
  15. package/dist/hooks.d.ts +79 -21
  16. package/dist/index.d.ts +1782 -268
  17. package/dist/layouts/layouts.cjs.js +1 -0
  18. package/dist/layouts/layouts.es.js +688 -0
  19. package/dist/layouts.d.ts +430 -0
  20. package/dist/onyx.cjs.js +1 -1
  21. package/dist/onyx.es.js +53 -1395
  22. package/dist/pages/pages.cjs.js +2 -2
  23. package/dist/pages/pages.es.js +71 -69
  24. package/dist/pages.d.ts +4 -4
  25. package/dist/routes/routes.cjs.js +1 -0
  26. package/dist/routes/routes.es.js +31 -0
  27. package/dist/routes.d.ts +28 -0
  28. package/dist/shared.css +77 -48
  29. package/dist/ui.css +1 -0
  30. package/dist/utils/utils.cjs.js +1 -1
  31. package/dist/utils/utils.es.js +20 -6
  32. package/dist/utils.d.ts +109 -5
  33. package/package.json +39 -28
  34. package/dist/chunks/AuthContext-CaZKJMxQ.js +0 -2149
  35. package/dist/chunks/AuthContext-uU1aP9gj.js +0 -31
  36. package/dist/chunks/Button-D-v4l8ZE.js +0 -20
  37. package/dist/chunks/Button-bARrxYyo.js +0 -11053
  38. package/dist/chunks/Input-CLi1H63d.js +0 -1
  39. package/dist/chunks/Input-dfvmdIHi.js +0 -138
  40. package/dist/chunks/_commonjsHelpers-C6fGbg64.js +0 -6
  41. package/dist/chunks/_commonjsHelpers-DwGv2jUC.js +0 -1
  42. package/dist/chunks/constants-B1_n9ezb.js +0 -1
  43. package/dist/chunks/constants-CDXq37n6.js +0 -4
  44. package/dist/chunks/errorHelper-DbQKxxQA.js +0 -1
  45. package/dist/chunks/errorHelper-qN6iGI6f.js +0 -18
  46. package/dist/chunks/formatTimestamp-CMxOnPo1.js +0 -12
  47. package/dist/chunks/formatTimestamp-TTsNcy7u.js +0 -1
  48. package/dist/chunks/index-CPwC_oqh.js +0 -561
  49. package/dist/chunks/index-DY808_YF.js +0 -2
  50. package/dist/chunks/isObject-BDHKUJKN.js +0 -1
  51. package/dist/chunks/isObject-vmP43YLW.js +0 -6
  52. package/dist/chunks/jsx-runtime--oOP9f8K.js +0 -284
  53. package/dist/chunks/jsx-runtime-CITbqOLs.js +0 -22
  54. package/dist/chunks/tslib.es6-ci7D5hcx.js +0 -44
  55. package/dist/chunks/tslib.es6-nRfFZWHa.js +0 -1
  56. package/dist/chunks/useAuth-BsWbsZD5.js +0 -1
  57. package/dist/chunks/useAuth-CkaMowHd.js +0 -11
  58. package/dist/chunks/useForm-BuzPPZZE.js +0 -3070
  59. package/dist/chunks/useForm-F8doF8lW.js +0 -18
  60. package/dist/chunks/useQuery-Dh3SZN5S.js +0 -1482
  61. package/dist/chunks/useQuery-y4De9xeL.js +0 -2
  62. package/dist/context/context.cjs.js +0 -1
  63. package/dist/context/context.es.js +0 -39
  64. package/dist/context.d.ts +0 -47
  65. package/dist/index.css +0 -1
  66. package/dist/layout/layout.cjs.js +0 -1
  67. package/dist/layout/layout.es.js +0 -265
  68. package/dist/layout.d.ts +0 -90
@@ -1,1918 +1,13 @@
1
- import { a as ut, b as De, i as lt } from "../chunks/useForm-BuzPPZZE.js";
2
- import { h as Ar, u as xr } from "../chunks/useForm-BuzPPZZE.js";
3
- import { useState as ft, useRef as dt, useCallback as Z } from "react";
4
- import { _ } from "../chunks/tslib.es6-ci7D5hcx.js";
5
- import { h as D, m as ge } from "../chunks/index-CPwC_oqh.js";
6
- import { a as pt, g as ht, c as mt, b as yt, t as Re } from "../chunks/useQuery-Dh3SZN5S.js";
7
- var bt = [
8
- "refetch",
9
- "reobserve",
10
- "fetchMore",
11
- "updateQuery",
12
- "startPolling",
13
- "stopPolling",
14
- "subscribeToMore"
15
- ];
16
- function wt(e, t) {
17
- var n, r = D.useRef(void 0), s = D.useRef(void 0), o = D.useRef(void 0), i = ge(t, r.current || {}), c = (n = i?.query) !== null && n !== void 0 ? n : e;
18
- s.current = t, o.current = c;
19
- var f = _(_({}, i), { skip: !r.current }), u = pt(c, f), l = u.obsQueryFields, d = u.result, w = u.client, g = u.resultData, p = u.observable, m = u.onQueryExecuted, h = p.options.initialFetchPolicy || ht(f.defaultOptions, w.defaultOptions), R = D.useReducer(function(x) {
20
- return x + 1;
21
- }, 0)[1], E = D.useMemo(function() {
22
- for (var x = {}, N = function(Ee) {
23
- var ct = l[Ee];
24
- x[Ee] = function() {
25
- return r.current || (r.current = /* @__PURE__ */ Object.create(null), R()), ct.apply(this, arguments);
26
- };
27
- }, M = 0, K = bt; M < K.length; M++) {
28
- var at = K[M];
29
- N(at);
30
- }
31
- return x;
32
- }, [R, l]), b = !!r.current, T = D.useMemo(function() {
33
- return _(_(_({}, d), E), { called: b });
34
- }, [d, E, b]), S = D.useCallback(function(x) {
35
- r.current = x ? _(_({}, x), { fetchPolicy: x.fetchPolicy || h }) : {
36
- fetchPolicy: h
37
- };
38
- var N = ge(s.current, _({ query: o.current }, r.current)), M = Et(g, p, w, c, _(_({}, N), { skip: !1 }), m).then(function(K) {
39
- return Object.assign(K, E);
40
- });
41
- return M.catch(function() {
42
- }), M;
43
- }, [
44
- w,
45
- c,
46
- E,
47
- h,
48
- p,
49
- g,
50
- m
51
- ]), A = D.useRef(S);
52
- ut(function() {
53
- A.current = S;
54
- });
55
- var k = D.useCallback(function() {
56
- for (var x = [], N = 0; N < arguments.length; N++)
57
- x[N] = arguments[N];
58
- return A.current.apply(A, x);
59
- }, []);
60
- return [k, T];
61
- }
62
- function Et(e, t, n, r, s, o) {
63
- var i = s.query || r, c = mt(n, i, s, !1)(t), f = t.reobserveAsConcast(yt(t, n, s, c));
64
- return o(c), new Promise(function(u) {
65
- var l;
66
- f.subscribe({
67
- next: function(d) {
68
- l = d;
69
- },
70
- error: function() {
71
- u(Re(t.getCurrentResult(), e.previousData, t, n));
72
- },
73
- complete: function() {
74
- u(Re(t.maskResult(l), e.previousData, t, n));
75
- }
76
- });
77
- });
78
- }
79
- const nr = (e, t) => {
80
- const n = (r) => e(r);
81
- return Object.defineProperty(n, "message", { value: t }), n;
82
- };
83
- function Be(e, t) {
84
- return function() {
85
- return e.apply(t, arguments);
86
- };
87
- }
88
- const { toString: gt } = Object.prototype, { getPrototypeOf: ye } = Object, { iterator: te, toStringTag: je } = Symbol, ne = /* @__PURE__ */ ((e) => (t) => {
89
- const n = gt.call(t);
90
- return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
91
- })(/* @__PURE__ */ Object.create(null)), U = (e) => (e = e.toLowerCase(), (t) => ne(t) === e), re = (e) => (t) => typeof t === e, { isArray: I } = Array, z = re("undefined");
92
- function $(e) {
93
- return e !== null && !z(e) && e.constructor !== null && !z(e.constructor) && P(e.constructor.isBuffer) && e.constructor.isBuffer(e);
94
- }
95
- const qe = U("ArrayBuffer");
96
- function Rt(e) {
97
- let t;
98
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && qe(e.buffer), t;
99
- }
100
- const St = re("string"), P = re("function"), Me = re("number"), J = (e) => e !== null && typeof e == "object", Ot = (e) => e === !0 || e === !1, Q = (e) => {
101
- if (ne(e) !== "object")
102
- return !1;
103
- const t = ye(e);
104
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(je in e) && !(te in e);
105
- }, Tt = (e) => {
106
- if (!J(e) || $(e))
107
- return !1;
108
- try {
109
- return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
110
- } catch {
111
- return !1;
112
- }
113
- }, At = U("Date"), xt = U("File"), Ct = U("Blob"), Pt = U("FileList"), Ft = (e) => J(e) && P(e.pipe), Nt = (e) => {
114
- let t;
115
- return e && (typeof FormData == "function" && e instanceof FormData || P(e.append) && ((t = ne(e)) === "formdata" || // detect form-data instance
116
- t === "object" && P(e.toString) && e.toString() === "[object FormData]"));
117
- }, Ut = U("URLSearchParams"), [_t, Lt, kt, Dt] = ["ReadableStream", "Request", "Response", "Headers"].map(U), Bt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
118
- function V(e, t, { allOwnKeys: n = !1 } = {}) {
119
- if (e === null || typeof e > "u")
120
- return;
121
- let r, s;
122
- if (typeof e != "object" && (e = [e]), I(e))
123
- for (r = 0, s = e.length; r < s; r++)
124
- t.call(null, e[r], r, e);
125
- else {
126
- if ($(e))
127
- return;
128
- const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
129
- let c;
130
- for (r = 0; r < i; r++)
131
- c = o[r], t.call(null, e[c], c, e);
132
- }
133
- }
134
- function Ie(e, t) {
135
- if ($(e))
136
- return null;
137
- t = t.toLowerCase();
138
- const n = Object.keys(e);
139
- let r = n.length, s;
140
- for (; r-- > 0; )
141
- if (s = n[r], t === s.toLowerCase())
142
- return s;
143
- return null;
144
- }
145
- const B = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, ve = (e) => !z(e) && e !== B;
146
- function le() {
147
- const { caseless: e } = ve(this) && this || {}, t = {}, n = (r, s) => {
148
- const o = e && Ie(t, s) || s;
149
- Q(t[o]) && Q(r) ? t[o] = le(t[o], r) : Q(r) ? t[o] = le({}, r) : I(r) ? t[o] = r.slice() : t[o] = r;
150
- };
151
- for (let r = 0, s = arguments.length; r < s; r++)
152
- arguments[r] && V(arguments[r], n);
153
- return t;
154
- }
155
- const jt = (e, t, n, { allOwnKeys: r } = {}) => (V(t, (s, o) => {
156
- n && P(s) ? e[o] = Be(s, n) : e[o] = s;
157
- }, { allOwnKeys: r }), e), qt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Mt = (e, t, n, r) => {
158
- e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
159
- value: t.prototype
160
- }), n && Object.assign(e.prototype, n);
161
- }, It = (e, t, n, r) => {
162
- let s, o, i;
163
- const c = {};
164
- if (t = t || {}, e == null) return t;
165
- do {
166
- for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
167
- i = s[o], (!r || r(i, e, t)) && !c[i] && (t[i] = e[i], c[i] = !0);
168
- e = n !== !1 && ye(e);
169
- } while (e && (!n || n(e, t)) && e !== Object.prototype);
170
- return t;
171
- }, vt = (e, t, n) => {
172
- e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
173
- const r = e.indexOf(t, n);
174
- return r !== -1 && r === n;
175
- }, Ht = (e) => {
176
- if (!e) return null;
177
- if (I(e)) return e;
178
- let t = e.length;
179
- if (!Me(t)) return null;
180
- const n = new Array(t);
181
- for (; t-- > 0; )
182
- n[t] = e[t];
183
- return n;
184
- }, zt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && ye(Uint8Array)), $t = (e, t) => {
185
- const r = (e && e[te]).call(e);
186
- let s;
187
- for (; (s = r.next()) && !s.done; ) {
188
- const o = s.value;
189
- t.call(e, o[0], o[1]);
190
- }
191
- }, Jt = (e, t) => {
192
- let n;
193
- const r = [];
194
- for (; (n = e.exec(t)) !== null; )
195
- r.push(n);
196
- return r;
197
- }, Vt = U("HTMLFormElement"), Wt = (e) => e.toLowerCase().replace(
198
- /[-_\s]([a-z\d])(\w*)/g,
199
- function(n, r, s) {
200
- return r.toUpperCase() + s;
201
- }
202
- ), Se = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Kt = U("RegExp"), He = (e, t) => {
203
- const n = Object.getOwnPropertyDescriptors(e), r = {};
204
- V(n, (s, o) => {
205
- let i;
206
- (i = t(s, o, e)) !== !1 && (r[o] = i || s);
207
- }), Object.defineProperties(e, r);
208
- }, Qt = (e) => {
209
- He(e, (t, n) => {
210
- if (P(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
211
- return !1;
212
- const r = e[n];
213
- if (P(r)) {
214
- if (t.enumerable = !1, "writable" in t) {
215
- t.writable = !1;
216
- return;
217
- }
218
- t.set || (t.set = () => {
219
- throw Error("Can not rewrite read-only method '" + n + "'");
220
- });
221
- }
222
- });
223
- }, Xt = (e, t) => {
224
- const n = {}, r = (s) => {
225
- s.forEach((o) => {
226
- n[o] = !0;
227
- });
228
- };
229
- return I(e) ? r(e) : r(String(e).split(t)), n;
230
- }, Gt = () => {
231
- }, Zt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
232
- function Yt(e) {
233
- return !!(e && P(e.append) && e[je] === "FormData" && e[te]);
234
- }
235
- const en = (e) => {
236
- const t = new Array(10), n = (r, s) => {
237
- if (J(r)) {
238
- if (t.indexOf(r) >= 0)
239
- return;
240
- if ($(r))
241
- return r;
242
- if (!("toJSON" in r)) {
243
- t[s] = r;
244
- const o = I(r) ? [] : {};
245
- return V(r, (i, c) => {
246
- const f = n(i, s + 1);
247
- !z(f) && (o[c] = f);
248
- }), t[s] = void 0, o;
249
- }
250
- }
251
- return r;
252
- };
253
- return n(e, 0);
254
- }, tn = U("AsyncFunction"), nn = (e) => e && (J(e) || P(e)) && P(e.then) && P(e.catch), ze = ((e, t) => e ? setImmediate : t ? ((n, r) => (B.addEventListener("message", ({ source: s, data: o }) => {
255
- s === B && o === n && r.length && r.shift()();
256
- }, !1), (s) => {
257
- r.push(s), B.postMessage(n, "*");
258
- }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
259
- typeof setImmediate == "function",
260
- P(B.postMessage)
261
- ), rn = typeof queueMicrotask < "u" ? queueMicrotask.bind(B) : typeof process < "u" && process.nextTick || ze, sn = (e) => e != null && P(e[te]), a = {
262
- isArray: I,
263
- isArrayBuffer: qe,
264
- isBuffer: $,
265
- isFormData: Nt,
266
- isArrayBufferView: Rt,
267
- isString: St,
268
- isNumber: Me,
269
- isBoolean: Ot,
270
- isObject: J,
271
- isPlainObject: Q,
272
- isEmptyObject: Tt,
273
- isReadableStream: _t,
274
- isRequest: Lt,
275
- isResponse: kt,
276
- isHeaders: Dt,
277
- isUndefined: z,
278
- isDate: At,
279
- isFile: xt,
280
- isBlob: Ct,
281
- isRegExp: Kt,
282
- isFunction: P,
283
- isStream: Ft,
284
- isURLSearchParams: Ut,
285
- isTypedArray: zt,
286
- isFileList: Pt,
287
- forEach: V,
288
- merge: le,
289
- extend: jt,
290
- trim: Bt,
291
- stripBOM: qt,
292
- inherits: Mt,
293
- toFlatObject: It,
294
- kindOf: ne,
295
- kindOfTest: U,
296
- endsWith: vt,
297
- toArray: Ht,
298
- forEachEntry: $t,
299
- matchAll: Jt,
300
- isHTMLForm: Vt,
301
- hasOwnProperty: Se,
302
- hasOwnProp: Se,
303
- // an alias to avoid ESLint no-prototype-builtins detection
304
- reduceDescriptors: He,
305
- freezeMethods: Qt,
306
- toObjectSet: Xt,
307
- toCamelCase: Wt,
308
- noop: Gt,
309
- toFiniteNumber: Zt,
310
- findKey: Ie,
311
- global: B,
312
- isContextDefined: ve,
313
- isSpecCompliantForm: Yt,
314
- toJSONObject: en,
315
- isAsyncFn: tn,
316
- isThenable: nn,
317
- setImmediate: ze,
318
- asap: rn,
319
- isIterable: sn
320
- };
321
- function y(e, t, n, r, s) {
322
- Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), s && (this.response = s, this.status = s.status ? s.status : null);
323
- }
324
- a.inherits(y, Error, {
325
- toJSON: function() {
326
- return {
327
- // Standard
328
- message: this.message,
329
- name: this.name,
330
- // Microsoft
331
- description: this.description,
332
- number: this.number,
333
- // Mozilla
334
- fileName: this.fileName,
335
- lineNumber: this.lineNumber,
336
- columnNumber: this.columnNumber,
337
- stack: this.stack,
338
- // Axios
339
- config: a.toJSONObject(this.config),
340
- code: this.code,
341
- status: this.status
342
- };
343
- }
344
- });
345
- const $e = y.prototype, Je = {};
346
- [
347
- "ERR_BAD_OPTION_VALUE",
348
- "ERR_BAD_OPTION",
349
- "ECONNABORTED",
350
- "ETIMEDOUT",
351
- "ERR_NETWORK",
352
- "ERR_FR_TOO_MANY_REDIRECTS",
353
- "ERR_DEPRECATED",
354
- "ERR_BAD_RESPONSE",
355
- "ERR_BAD_REQUEST",
356
- "ERR_CANCELED",
357
- "ERR_NOT_SUPPORT",
358
- "ERR_INVALID_URL"
359
- // eslint-disable-next-line func-names
360
- ].forEach((e) => {
361
- Je[e] = { value: e };
362
- });
363
- Object.defineProperties(y, Je);
364
- Object.defineProperty($e, "isAxiosError", { value: !0 });
365
- y.from = (e, t, n, r, s, o) => {
366
- const i = Object.create($e);
367
- return a.toFlatObject(e, i, function(f) {
368
- return f !== Error.prototype;
369
- }, (c) => c !== "isAxiosError"), y.call(i, e.message, t, n, r, s), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
370
- };
371
- const on = null;
372
- function fe(e) {
373
- return a.isPlainObject(e) || a.isArray(e);
374
- }
375
- function Ve(e) {
376
- return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
377
- }
378
- function Oe(e, t, n) {
379
- return e ? e.concat(t).map(function(s, o) {
380
- return s = Ve(s), !n && o ? "[" + s + "]" : s;
381
- }).join(n ? "." : "") : t;
382
- }
383
- function an(e) {
384
- return a.isArray(e) && !e.some(fe);
385
- }
386
- const cn = a.toFlatObject(a, {}, null, function(t) {
387
- return /^is[A-Z]/.test(t);
388
- });
389
- function se(e, t, n) {
390
- if (!a.isObject(e))
391
- throw new TypeError("target must be an object");
392
- t = t || new FormData(), n = a.toFlatObject(n, {
393
- metaTokens: !0,
394
- dots: !1,
395
- indexes: !1
396
- }, !1, function(m, h) {
397
- return !a.isUndefined(h[m]);
398
- });
399
- const r = n.metaTokens, s = n.visitor || l, o = n.dots, i = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
400
- if (!a.isFunction(s))
401
- throw new TypeError("visitor must be a function");
402
- function u(p) {
403
- if (p === null) return "";
404
- if (a.isDate(p))
405
- return p.toISOString();
406
- if (a.isBoolean(p))
407
- return p.toString();
408
- if (!f && a.isBlob(p))
409
- throw new y("Blob is not supported. Use a Buffer instead.");
410
- return a.isArrayBuffer(p) || a.isTypedArray(p) ? f && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
411
- }
412
- function l(p, m, h) {
413
- let R = p;
414
- if (p && !h && typeof p == "object") {
415
- if (a.endsWith(m, "{}"))
416
- m = r ? m : m.slice(0, -2), p = JSON.stringify(p);
417
- else if (a.isArray(p) && an(p) || (a.isFileList(p) || a.endsWith(m, "[]")) && (R = a.toArray(p)))
418
- return m = Ve(m), R.forEach(function(b, T) {
419
- !(a.isUndefined(b) || b === null) && t.append(
420
- // eslint-disable-next-line no-nested-ternary
421
- i === !0 ? Oe([m], T, o) : i === null ? m : m + "[]",
422
- u(b)
423
- );
424
- }), !1;
425
- }
426
- return fe(p) ? !0 : (t.append(Oe(h, m, o), u(p)), !1);
427
- }
428
- const d = [], w = Object.assign(cn, {
429
- defaultVisitor: l,
430
- convertValue: u,
431
- isVisitable: fe
432
- });
433
- function g(p, m) {
434
- if (!a.isUndefined(p)) {
435
- if (d.indexOf(p) !== -1)
436
- throw Error("Circular reference detected in " + m.join("."));
437
- d.push(p), a.forEach(p, function(R, E) {
438
- (!(a.isUndefined(R) || R === null) && s.call(
439
- t,
440
- R,
441
- a.isString(E) ? E.trim() : E,
442
- m,
443
- w
444
- )) === !0 && g(R, m ? m.concat(E) : [E]);
445
- }), d.pop();
446
- }
447
- }
448
- if (!a.isObject(e))
449
- throw new TypeError("data must be an object");
450
- return g(e), t;
451
- }
452
- function Te(e) {
453
- const t = {
454
- "!": "%21",
455
- "'": "%27",
456
- "(": "%28",
457
- ")": "%29",
458
- "~": "%7E",
459
- "%20": "+",
460
- "%00": "\0"
461
- };
462
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
463
- return t[r];
464
- });
465
- }
466
- function be(e, t) {
467
- this._pairs = [], e && se(e, this, t);
468
- }
469
- const We = be.prototype;
470
- We.append = function(t, n) {
471
- this._pairs.push([t, n]);
472
- };
473
- We.toString = function(t) {
474
- const n = t ? function(r) {
475
- return t.call(this, r, Te);
476
- } : Te;
477
- return this._pairs.map(function(s) {
478
- return n(s[0]) + "=" + n(s[1]);
479
- }, "").join("&");
480
- };
481
- function un(e) {
482
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
483
- }
484
- function Ke(e, t, n) {
485
- if (!t)
486
- return e;
487
- const r = n && n.encode || un;
488
- a.isFunction(n) && (n = {
489
- serialize: n
490
- });
491
- const s = n && n.serialize;
492
- let o;
493
- if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new be(t, n).toString(r), o) {
494
- const i = e.indexOf("#");
495
- i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
496
- }
497
- return e;
498
- }
499
- class Ae {
500
- constructor() {
501
- this.handlers = [];
502
- }
503
- /**
504
- * Add a new interceptor to the stack
505
- *
506
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
507
- * @param {Function} rejected The function to handle `reject` for a `Promise`
508
- *
509
- * @return {Number} An ID used to remove interceptor later
510
- */
511
- use(t, n, r) {
512
- return this.handlers.push({
513
- fulfilled: t,
514
- rejected: n,
515
- synchronous: r ? r.synchronous : !1,
516
- runWhen: r ? r.runWhen : null
517
- }), this.handlers.length - 1;
518
- }
519
- /**
520
- * Remove an interceptor from the stack
521
- *
522
- * @param {Number} id The ID that was returned by `use`
523
- *
524
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
525
- */
526
- eject(t) {
527
- this.handlers[t] && (this.handlers[t] = null);
528
- }
529
- /**
530
- * Clear all interceptors from the stack
531
- *
532
- * @returns {void}
533
- */
534
- clear() {
535
- this.handlers && (this.handlers = []);
536
- }
537
- /**
538
- * Iterate over all the registered interceptors
539
- *
540
- * This method is particularly useful for skipping over any
541
- * interceptors that may have become `null` calling `eject`.
542
- *
543
- * @param {Function} fn The function to call for each interceptor
544
- *
545
- * @returns {void}
546
- */
547
- forEach(t) {
548
- a.forEach(this.handlers, function(r) {
549
- r !== null && t(r);
550
- });
551
- }
552
- }
553
- const Qe = {
554
- silentJSONParsing: !0,
555
- forcedJSONParsing: !0,
556
- clarifyTimeoutError: !1
557
- }, ln = typeof URLSearchParams < "u" ? URLSearchParams : be, fn = typeof FormData < "u" ? FormData : null, dn = typeof Blob < "u" ? Blob : null, pn = {
558
- isBrowser: !0,
559
- classes: {
560
- URLSearchParams: ln,
561
- FormData: fn,
562
- Blob: dn
563
- },
564
- protocols: ["http", "https", "file", "blob", "url", "data"]
565
- }, we = typeof window < "u" && typeof document < "u", de = typeof navigator == "object" && navigator || void 0, hn = we && (!de || ["ReactNative", "NativeScript", "NS"].indexOf(de.product) < 0), mn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
566
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", yn = we && window.location.href || "http://localhost", bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
567
- __proto__: null,
568
- hasBrowserEnv: we,
569
- hasStandardBrowserEnv: hn,
570
- hasStandardBrowserWebWorkerEnv: mn,
571
- navigator: de,
572
- origin: yn
573
- }, Symbol.toStringTag, { value: "Module" })), C = {
574
- ...bn,
575
- ...pn
576
- };
577
- function wn(e, t) {
578
- return se(e, new C.classes.URLSearchParams(), {
579
- visitor: function(n, r, s, o) {
580
- return C.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
581
- },
582
- ...t
583
- });
584
- }
585
- function En(e) {
586
- return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
587
- }
588
- function gn(e) {
589
- const t = {}, n = Object.keys(e);
590
- let r;
591
- const s = n.length;
592
- let o;
593
- for (r = 0; r < s; r++)
594
- o = n[r], t[o] = e[o];
595
- return t;
596
- }
597
- function Xe(e) {
598
- function t(n, r, s, o) {
599
- let i = n[o++];
600
- if (i === "__proto__") return !0;
601
- const c = Number.isFinite(+i), f = o >= n.length;
602
- return i = !i && a.isArray(s) ? s.length : i, f ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = gn(s[i])), !c);
603
- }
604
- if (a.isFormData(e) && a.isFunction(e.entries)) {
605
- const n = {};
606
- return a.forEachEntry(e, (r, s) => {
607
- t(En(r), s, n, 0);
608
- }), n;
609
- }
610
- return null;
611
- }
612
- function Rn(e, t, n) {
613
- if (a.isString(e))
614
- try {
615
- return (t || JSON.parse)(e), a.trim(e);
616
- } catch (r) {
617
- if (r.name !== "SyntaxError")
618
- throw r;
619
- }
620
- return (n || JSON.stringify)(e);
621
- }
622
- const W = {
623
- transitional: Qe,
624
- adapter: ["xhr", "http", "fetch"],
625
- transformRequest: [function(t, n) {
626
- const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = a.isObject(t);
627
- if (o && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
628
- return s ? JSON.stringify(Xe(t)) : t;
629
- if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
630
- return t;
631
- if (a.isArrayBufferView(t))
632
- return t.buffer;
633
- if (a.isURLSearchParams(t))
634
- return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
635
- let c;
636
- if (o) {
637
- if (r.indexOf("application/x-www-form-urlencoded") > -1)
638
- return wn(t, this.formSerializer).toString();
639
- if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
640
- const f = this.env && this.env.FormData;
641
- return se(
642
- c ? { "files[]": t } : t,
643
- f && new f(),
644
- this.formSerializer
645
- );
646
- }
647
- }
648
- return o || s ? (n.setContentType("application/json", !1), Rn(t)) : t;
649
- }],
650
- transformResponse: [function(t) {
651
- const n = this.transitional || W.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
652
- if (a.isResponse(t) || a.isReadableStream(t))
653
- return t;
654
- if (t && a.isString(t) && (r && !this.responseType || s)) {
655
- const i = !(n && n.silentJSONParsing) && s;
656
- try {
657
- return JSON.parse(t);
658
- } catch (c) {
659
- if (i)
660
- throw c.name === "SyntaxError" ? y.from(c, y.ERR_BAD_RESPONSE, this, null, this.response) : c;
661
- }
662
- }
663
- return t;
664
- }],
665
- /**
666
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
667
- * timeout is not created.
668
- */
669
- timeout: 0,
670
- xsrfCookieName: "XSRF-TOKEN",
671
- xsrfHeaderName: "X-XSRF-TOKEN",
672
- maxContentLength: -1,
673
- maxBodyLength: -1,
674
- env: {
675
- FormData: C.classes.FormData,
676
- Blob: C.classes.Blob
677
- },
678
- validateStatus: function(t) {
679
- return t >= 200 && t < 300;
680
- },
681
- headers: {
682
- common: {
683
- Accept: "application/json, text/plain, */*",
684
- "Content-Type": void 0
685
- }
686
- }
687
- };
688
- a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
689
- W.headers[e] = {};
690
- });
691
- const Sn = a.toObjectSet([
692
- "age",
693
- "authorization",
694
- "content-length",
695
- "content-type",
696
- "etag",
697
- "expires",
698
- "from",
699
- "host",
700
- "if-modified-since",
701
- "if-unmodified-since",
702
- "last-modified",
703
- "location",
704
- "max-forwards",
705
- "proxy-authorization",
706
- "referer",
707
- "retry-after",
708
- "user-agent"
709
- ]), On = (e) => {
710
- const t = {};
711
- let n, r, s;
712
- return e && e.split(`
713
- `).forEach(function(i) {
714
- s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && Sn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
715
- }), t;
716
- }, xe = Symbol("internals");
717
- function H(e) {
718
- return e && String(e).trim().toLowerCase();
719
- }
720
- function X(e) {
721
- return e === !1 || e == null ? e : a.isArray(e) ? e.map(X) : String(e);
722
- }
723
- function Tn(e) {
724
- const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
725
- let r;
726
- for (; r = n.exec(e); )
727
- t[r[1]] = r[2];
728
- return t;
729
- }
730
- const An = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
731
- function ae(e, t, n, r, s) {
732
- if (a.isFunction(r))
733
- return r.call(this, t, n);
734
- if (s && (t = n), !!a.isString(t)) {
735
- if (a.isString(r))
736
- return t.indexOf(r) !== -1;
737
- if (a.isRegExp(r))
738
- return r.test(t);
739
- }
740
- }
741
- function xn(e) {
742
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
743
- }
744
- function Cn(e, t) {
745
- const n = a.toCamelCase(" " + t);
746
- ["get", "set", "has"].forEach((r) => {
747
- Object.defineProperty(e, r + n, {
748
- value: function(s, o, i) {
749
- return this[r].call(this, t, s, o, i);
750
- },
751
- configurable: !0
752
- });
753
- });
754
- }
755
- let F = class {
756
- constructor(t) {
757
- t && this.set(t);
758
- }
759
- set(t, n, r) {
760
- const s = this;
761
- function o(c, f, u) {
762
- const l = H(f);
763
- if (!l)
764
- throw new Error("header name must be a non-empty string");
765
- const d = a.findKey(s, l);
766
- (!d || s[d] === void 0 || u === !0 || u === void 0 && s[d] !== !1) && (s[d || f] = X(c));
767
- }
768
- const i = (c, f) => a.forEach(c, (u, l) => o(u, l, f));
769
- if (a.isPlainObject(t) || t instanceof this.constructor)
770
- i(t, n);
771
- else if (a.isString(t) && (t = t.trim()) && !An(t))
772
- i(On(t), n);
773
- else if (a.isObject(t) && a.isIterable(t)) {
774
- let c = {}, f, u;
775
- for (const l of t) {
776
- if (!a.isArray(l))
777
- throw TypeError("Object iterator must return a key-value pair");
778
- c[u = l[0]] = (f = c[u]) ? a.isArray(f) ? [...f, l[1]] : [f, l[1]] : l[1];
779
- }
780
- i(c, n);
781
- } else
782
- t != null && o(n, t, r);
783
- return this;
784
- }
785
- get(t, n) {
786
- if (t = H(t), t) {
787
- const r = a.findKey(this, t);
788
- if (r) {
789
- const s = this[r];
790
- if (!n)
791
- return s;
792
- if (n === !0)
793
- return Tn(s);
794
- if (a.isFunction(n))
795
- return n.call(this, s, r);
796
- if (a.isRegExp(n))
797
- return n.exec(s);
798
- throw new TypeError("parser must be boolean|regexp|function");
799
- }
800
- }
801
- }
802
- has(t, n) {
803
- if (t = H(t), t) {
804
- const r = a.findKey(this, t);
805
- return !!(r && this[r] !== void 0 && (!n || ae(this, this[r], r, n)));
806
- }
807
- return !1;
808
- }
809
- delete(t, n) {
810
- const r = this;
811
- let s = !1;
812
- function o(i) {
813
- if (i = H(i), i) {
814
- const c = a.findKey(r, i);
815
- c && (!n || ae(r, r[c], c, n)) && (delete r[c], s = !0);
816
- }
817
- }
818
- return a.isArray(t) ? t.forEach(o) : o(t), s;
819
- }
820
- clear(t) {
821
- const n = Object.keys(this);
822
- let r = n.length, s = !1;
823
- for (; r--; ) {
824
- const o = n[r];
825
- (!t || ae(this, this[o], o, t, !0)) && (delete this[o], s = !0);
826
- }
827
- return s;
828
- }
829
- normalize(t) {
830
- const n = this, r = {};
831
- return a.forEach(this, (s, o) => {
832
- const i = a.findKey(r, o);
833
- if (i) {
834
- n[i] = X(s), delete n[o];
835
- return;
836
- }
837
- const c = t ? xn(o) : String(o).trim();
838
- c !== o && delete n[o], n[c] = X(s), r[c] = !0;
839
- }), this;
840
- }
841
- concat(...t) {
842
- return this.constructor.concat(this, ...t);
843
- }
844
- toJSON(t) {
845
- const n = /* @__PURE__ */ Object.create(null);
846
- return a.forEach(this, (r, s) => {
847
- r != null && r !== !1 && (n[s] = t && a.isArray(r) ? r.join(", ") : r);
848
- }), n;
849
- }
850
- [Symbol.iterator]() {
851
- return Object.entries(this.toJSON())[Symbol.iterator]();
852
- }
853
- toString() {
854
- return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
855
- `);
856
- }
857
- getSetCookie() {
858
- return this.get("set-cookie") || [];
859
- }
860
- get [Symbol.toStringTag]() {
861
- return "AxiosHeaders";
862
- }
863
- static from(t) {
864
- return t instanceof this ? t : new this(t);
865
- }
866
- static concat(t, ...n) {
867
- const r = new this(t);
868
- return n.forEach((s) => r.set(s)), r;
869
- }
870
- static accessor(t) {
871
- const r = (this[xe] = this[xe] = {
872
- accessors: {}
873
- }).accessors, s = this.prototype;
874
- function o(i) {
875
- const c = H(i);
876
- r[c] || (Cn(s, i), r[c] = !0);
877
- }
878
- return a.isArray(t) ? t.forEach(o) : o(t), this;
879
- }
880
- };
881
- F.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
882
- a.reduceDescriptors(F.prototype, ({ value: e }, t) => {
883
- let n = t[0].toUpperCase() + t.slice(1);
884
- return {
885
- get: () => e,
886
- set(r) {
887
- this[n] = r;
888
- }
889
- };
890
- });
891
- a.freezeMethods(F);
892
- function ce(e, t) {
893
- const n = this || W, r = t || n, s = F.from(r.headers);
894
- let o = r.data;
895
- return a.forEach(e, function(c) {
896
- o = c.call(n, o, s.normalize(), t ? t.status : void 0);
897
- }), s.normalize(), o;
898
- }
899
- function Ge(e) {
900
- return !!(e && e.__CANCEL__);
901
- }
902
- function v(e, t, n) {
903
- y.call(this, e ?? "canceled", y.ERR_CANCELED, t, n), this.name = "CanceledError";
904
- }
905
- a.inherits(v, y, {
906
- __CANCEL__: !0
907
- });
908
- function Ze(e, t, n) {
909
- const r = n.config.validateStatus;
910
- !n.status || !r || r(n.status) ? e(n) : t(new y(
911
- "Request failed with status code " + n.status,
912
- [y.ERR_BAD_REQUEST, y.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
913
- n.config,
914
- n.request,
915
- n
916
- ));
917
- }
918
- function Pn(e) {
919
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
920
- return t && t[1] || "";
921
- }
922
- function Fn(e, t) {
923
- e = e || 10;
924
- const n = new Array(e), r = new Array(e);
925
- let s = 0, o = 0, i;
926
- return t = t !== void 0 ? t : 1e3, function(f) {
927
- const u = Date.now(), l = r[o];
928
- i || (i = u), n[s] = f, r[s] = u;
929
- let d = o, w = 0;
930
- for (; d !== s; )
931
- w += n[d++], d = d % e;
932
- if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
933
- return;
934
- const g = l && u - l;
935
- return g ? Math.round(w * 1e3 / g) : void 0;
936
- };
937
- }
938
- function Nn(e, t) {
939
- let n = 0, r = 1e3 / t, s, o;
940
- const i = (u, l = Date.now()) => {
941
- n = l, s = null, o && (clearTimeout(o), o = null), e(...u);
942
- };
943
- return [(...u) => {
944
- const l = Date.now(), d = l - n;
945
- d >= r ? i(u, l) : (s = u, o || (o = setTimeout(() => {
946
- o = null, i(s);
947
- }, r - d)));
948
- }, () => s && i(s)];
949
- }
950
- const Y = (e, t, n = 3) => {
951
- let r = 0;
952
- const s = Fn(50, 250);
953
- return Nn((o) => {
954
- const i = o.loaded, c = o.lengthComputable ? o.total : void 0, f = i - r, u = s(f), l = i <= c;
955
- r = i;
956
- const d = {
957
- loaded: i,
958
- total: c,
959
- progress: c ? i / c : void 0,
960
- bytes: f,
961
- rate: u || void 0,
962
- estimated: u && c && l ? (c - i) / u : void 0,
963
- event: o,
964
- lengthComputable: c != null,
965
- [t ? "download" : "upload"]: !0
966
- };
967
- e(d);
968
- }, n);
969
- }, Ce = (e, t) => {
970
- const n = e != null;
971
- return [(r) => t[0]({
972
- lengthComputable: n,
973
- total: e,
974
- loaded: r
975
- }), t[1]];
976
- }, Pe = (e) => (...t) => a.asap(() => e(...t)), Un = C.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, C.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
977
- new URL(C.origin),
978
- C.navigator && /(msie|trident)/i.test(C.navigator.userAgent)
979
- ) : () => !0, _n = C.hasStandardBrowserEnv ? (
980
- // Standard browser envs support document.cookie
981
- {
982
- write(e, t, n, r, s, o) {
983
- const i = [e + "=" + encodeURIComponent(t)];
984
- a.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), a.isString(r) && i.push("path=" + r), a.isString(s) && i.push("domain=" + s), o === !0 && i.push("secure"), document.cookie = i.join("; ");
985
- },
986
- read(e) {
987
- const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
988
- return t ? decodeURIComponent(t[3]) : null;
989
- },
990
- remove(e) {
991
- this.write(e, "", Date.now() - 864e5);
992
- }
993
- }
994
- ) : (
995
- // Non-standard browser env (web workers, react-native) lack needed support.
996
- {
997
- write() {
998
- },
999
- read() {
1000
- return null;
1001
- },
1002
- remove() {
1003
- }
1004
- }
1005
- );
1006
- function Ln(e) {
1007
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1008
- }
1009
- function kn(e, t) {
1010
- return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1011
- }
1012
- function Ye(e, t, n) {
1013
- let r = !Ln(t);
1014
- return e && (r || n == !1) ? kn(e, t) : t;
1015
- }
1016
- const Fe = (e) => e instanceof F ? { ...e } : e;
1017
- function q(e, t) {
1018
- t = t || {};
1019
- const n = {};
1020
- function r(u, l, d, w) {
1021
- return a.isPlainObject(u) && a.isPlainObject(l) ? a.merge.call({ caseless: w }, u, l) : a.isPlainObject(l) ? a.merge({}, l) : a.isArray(l) ? l.slice() : l;
1022
- }
1023
- function s(u, l, d, w) {
1024
- if (a.isUndefined(l)) {
1025
- if (!a.isUndefined(u))
1026
- return r(void 0, u, d, w);
1027
- } else return r(u, l, d, w);
1028
- }
1029
- function o(u, l) {
1030
- if (!a.isUndefined(l))
1031
- return r(void 0, l);
1032
- }
1033
- function i(u, l) {
1034
- if (a.isUndefined(l)) {
1035
- if (!a.isUndefined(u))
1036
- return r(void 0, u);
1037
- } else return r(void 0, l);
1038
- }
1039
- function c(u, l, d) {
1040
- if (d in t)
1041
- return r(u, l);
1042
- if (d in e)
1043
- return r(void 0, u);
1044
- }
1045
- const f = {
1046
- url: o,
1047
- method: o,
1048
- data: o,
1049
- baseURL: i,
1050
- transformRequest: i,
1051
- transformResponse: i,
1052
- paramsSerializer: i,
1053
- timeout: i,
1054
- timeoutMessage: i,
1055
- withCredentials: i,
1056
- withXSRFToken: i,
1057
- adapter: i,
1058
- responseType: i,
1059
- xsrfCookieName: i,
1060
- xsrfHeaderName: i,
1061
- onUploadProgress: i,
1062
- onDownloadProgress: i,
1063
- decompress: i,
1064
- maxContentLength: i,
1065
- maxBodyLength: i,
1066
- beforeRedirect: i,
1067
- transport: i,
1068
- httpAgent: i,
1069
- httpsAgent: i,
1070
- cancelToken: i,
1071
- socketPath: i,
1072
- responseEncoding: i,
1073
- validateStatus: c,
1074
- headers: (u, l, d) => s(Fe(u), Fe(l), d, !0)
1075
- };
1076
- return a.forEach(Object.keys({ ...e, ...t }), function(l) {
1077
- const d = f[l] || s, w = d(e[l], t[l], l);
1078
- a.isUndefined(w) && d !== c || (n[l] = w);
1079
- }), n;
1080
- }
1081
- const et = (e) => {
1082
- const t = q({}, e);
1083
- let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
1084
- t.headers = i = F.from(i), t.url = Ke(Ye(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && i.set(
1085
- "Authorization",
1086
- "Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
1087
- );
1088
- let f;
1089
- if (a.isFormData(n)) {
1090
- if (C.hasStandardBrowserEnv || C.hasStandardBrowserWebWorkerEnv)
1091
- i.setContentType(void 0);
1092
- else if ((f = i.getContentType()) !== !1) {
1093
- const [u, ...l] = f ? f.split(";").map((d) => d.trim()).filter(Boolean) : [];
1094
- i.setContentType([u || "multipart/form-data", ...l].join("; "));
1095
- }
1096
- }
1097
- if (C.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && Un(t.url))) {
1098
- const u = s && o && _n.read(o);
1099
- u && i.set(s, u);
1100
- }
1101
- return t;
1102
- }, Dn = typeof XMLHttpRequest < "u", Bn = Dn && function(e) {
1103
- return new Promise(function(n, r) {
1104
- const s = et(e);
1105
- let o = s.data;
1106
- const i = F.from(s.headers).normalize();
1107
- let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, d, w, g, p;
1108
- function m() {
1109
- g && g(), p && p(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
1110
- }
1111
- let h = new XMLHttpRequest();
1112
- h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
1113
- function R() {
1114
- if (!h)
1115
- return;
1116
- const b = F.from(
1117
- "getAllResponseHeaders" in h && h.getAllResponseHeaders()
1118
- ), S = {
1119
- data: !c || c === "text" || c === "json" ? h.responseText : h.response,
1120
- status: h.status,
1121
- statusText: h.statusText,
1122
- headers: b,
1123
- config: e,
1124
- request: h
1125
- };
1126
- Ze(function(k) {
1127
- n(k), m();
1128
- }, function(k) {
1129
- r(k), m();
1130
- }, S), h = null;
1131
- }
1132
- "onloadend" in h ? h.onloadend = R : h.onreadystatechange = function() {
1133
- !h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(R);
1134
- }, h.onabort = function() {
1135
- h && (r(new y("Request aborted", y.ECONNABORTED, e, h)), h = null);
1136
- }, h.onerror = function() {
1137
- r(new y("Network Error", y.ERR_NETWORK, e, h)), h = null;
1138
- }, h.ontimeout = function() {
1139
- let T = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1140
- const S = s.transitional || Qe;
1141
- s.timeoutErrorMessage && (T = s.timeoutErrorMessage), r(new y(
1142
- T,
1143
- S.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
1144
- e,
1145
- h
1146
- )), h = null;
1147
- }, o === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(i.toJSON(), function(T, S) {
1148
- h.setRequestHeader(S, T);
1149
- }), a.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), c && c !== "json" && (h.responseType = s.responseType), u && ([w, p] = Y(u, !0), h.addEventListener("progress", w)), f && h.upload && ([d, g] = Y(f), h.upload.addEventListener("progress", d), h.upload.addEventListener("loadend", g)), (s.cancelToken || s.signal) && (l = (b) => {
1150
- h && (r(!b || b.type ? new v(null, e, h) : b), h.abort(), h = null);
1151
- }, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
1152
- const E = Pn(s.url);
1153
- if (E && C.protocols.indexOf(E) === -1) {
1154
- r(new y("Unsupported protocol " + E + ":", y.ERR_BAD_REQUEST, e));
1155
- return;
1156
- }
1157
- h.send(o || null);
1158
- });
1159
- }, jn = (e, t) => {
1160
- const { length: n } = e = e ? e.filter(Boolean) : [];
1161
- if (t || n) {
1162
- let r = new AbortController(), s;
1163
- const o = function(u) {
1164
- if (!s) {
1165
- s = !0, c();
1166
- const l = u instanceof Error ? u : this.reason;
1167
- r.abort(l instanceof y ? l : new v(l instanceof Error ? l.message : l));
1168
- }
1169
- };
1170
- let i = t && setTimeout(() => {
1171
- i = null, o(new y(`timeout ${t} of ms exceeded`, y.ETIMEDOUT));
1172
- }, t);
1173
- const c = () => {
1174
- e && (i && clearTimeout(i), i = null, e.forEach((u) => {
1175
- u.unsubscribe ? u.unsubscribe(o) : u.removeEventListener("abort", o);
1176
- }), e = null);
1177
- };
1178
- e.forEach((u) => u.addEventListener("abort", o));
1179
- const { signal: f } = r;
1180
- return f.unsubscribe = () => a.asap(c), f;
1181
- }
1182
- }, qn = function* (e, t) {
1183
- let n = e.byteLength;
1184
- if (n < t) {
1185
- yield e;
1186
- return;
1187
- }
1188
- let r = 0, s;
1189
- for (; r < n; )
1190
- s = r + t, yield e.slice(r, s), r = s;
1191
- }, Mn = async function* (e, t) {
1192
- for await (const n of In(e))
1193
- yield* qn(n, t);
1194
- }, In = async function* (e) {
1195
- if (e[Symbol.asyncIterator]) {
1196
- yield* e;
1197
- return;
1198
- }
1199
- const t = e.getReader();
1200
- try {
1201
- for (; ; ) {
1202
- const { done: n, value: r } = await t.read();
1203
- if (n)
1204
- break;
1205
- yield r;
1206
- }
1207
- } finally {
1208
- await t.cancel();
1209
- }
1210
- }, Ne = (e, t, n, r) => {
1211
- const s = Mn(e, t);
1212
- let o = 0, i, c = (f) => {
1213
- i || (i = !0, r && r(f));
1214
- };
1215
- return new ReadableStream({
1216
- async pull(f) {
1217
- try {
1218
- const { done: u, value: l } = await s.next();
1219
- if (u) {
1220
- c(), f.close();
1221
- return;
1222
- }
1223
- let d = l.byteLength;
1224
- if (n) {
1225
- let w = o += d;
1226
- n(w);
1227
- }
1228
- f.enqueue(new Uint8Array(l));
1229
- } catch (u) {
1230
- throw c(u), u;
1231
- }
1232
- },
1233
- cancel(f) {
1234
- return c(f), s.return();
1235
- }
1236
- }, {
1237
- highWaterMark: 2
1238
- });
1239
- }, oe = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", tt = oe && typeof ReadableStream == "function", vn = oe && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), nt = (e, ...t) => {
1240
- try {
1241
- return !!e(...t);
1242
- } catch {
1243
- return !1;
1244
- }
1245
- }, Hn = tt && nt(() => {
1246
- let e = !1;
1247
- const t = new Request(C.origin, {
1248
- body: new ReadableStream(),
1249
- method: "POST",
1250
- get duplex() {
1251
- return e = !0, "half";
1252
- }
1253
- }).headers.has("Content-Type");
1254
- return e && !t;
1255
- }), Ue = 64 * 1024, pe = tt && nt(() => a.isReadableStream(new Response("").body)), ee = {
1256
- stream: pe && ((e) => e.body)
1257
- };
1258
- oe && ((e) => {
1259
- ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
1260
- !ee[t] && (ee[t] = a.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
1261
- throw new y(`Response type '${t}' is not supported`, y.ERR_NOT_SUPPORT, r);
1262
- });
1263
- });
1264
- })(new Response());
1265
- const zn = async (e) => {
1266
- if (e == null)
1267
- return 0;
1268
- if (a.isBlob(e))
1269
- return e.size;
1270
- if (a.isSpecCompliantForm(e))
1271
- return (await new Request(C.origin, {
1272
- method: "POST",
1273
- body: e
1274
- }).arrayBuffer()).byteLength;
1275
- if (a.isArrayBufferView(e) || a.isArrayBuffer(e))
1276
- return e.byteLength;
1277
- if (a.isURLSearchParams(e) && (e = e + ""), a.isString(e))
1278
- return (await vn(e)).byteLength;
1279
- }, $n = async (e, t) => {
1280
- const n = a.toFiniteNumber(e.getContentLength());
1281
- return n ?? zn(t);
1282
- }, Jn = oe && (async (e) => {
1283
- let {
1284
- url: t,
1285
- method: n,
1286
- data: r,
1287
- signal: s,
1288
- cancelToken: o,
1289
- timeout: i,
1290
- onDownloadProgress: c,
1291
- onUploadProgress: f,
1292
- responseType: u,
1293
- headers: l,
1294
- withCredentials: d = "same-origin",
1295
- fetchOptions: w
1296
- } = et(e);
1297
- u = u ? (u + "").toLowerCase() : "text";
1298
- let g = jn([s, o && o.toAbortSignal()], i), p;
1299
- const m = g && g.unsubscribe && (() => {
1300
- g.unsubscribe();
1301
- });
1302
- let h;
1303
- try {
1304
- if (f && Hn && n !== "get" && n !== "head" && (h = await $n(l, r)) !== 0) {
1305
- let S = new Request(t, {
1306
- method: "POST",
1307
- body: r,
1308
- duplex: "half"
1309
- }), A;
1310
- if (a.isFormData(r) && (A = S.headers.get("content-type")) && l.setContentType(A), S.body) {
1311
- const [k, x] = Ce(
1312
- h,
1313
- Y(Pe(f))
1314
- );
1315
- r = Ne(S.body, Ue, k, x);
1316
- }
1317
- }
1318
- a.isString(d) || (d = d ? "include" : "omit");
1319
- const R = "credentials" in Request.prototype;
1320
- p = new Request(t, {
1321
- ...w,
1322
- signal: g,
1323
- method: n.toUpperCase(),
1324
- headers: l.normalize().toJSON(),
1325
- body: r,
1326
- duplex: "half",
1327
- credentials: R ? d : void 0
1328
- });
1329
- let E = await fetch(p, w);
1330
- const b = pe && (u === "stream" || u === "response");
1331
- if (pe && (c || b && m)) {
1332
- const S = {};
1333
- ["status", "statusText", "headers"].forEach((N) => {
1334
- S[N] = E[N];
1335
- });
1336
- const A = a.toFiniteNumber(E.headers.get("content-length")), [k, x] = c && Ce(
1337
- A,
1338
- Y(Pe(c), !0)
1339
- ) || [];
1340
- E = new Response(
1341
- Ne(E.body, Ue, k, () => {
1342
- x && x(), m && m();
1343
- }),
1344
- S
1345
- );
1346
- }
1347
- u = u || "text";
1348
- let T = await ee[a.findKey(ee, u) || "text"](E, e);
1349
- return !b && m && m(), await new Promise((S, A) => {
1350
- Ze(S, A, {
1351
- data: T,
1352
- headers: F.from(E.headers),
1353
- status: E.status,
1354
- statusText: E.statusText,
1355
- config: e,
1356
- request: p
1357
- });
1358
- });
1359
- } catch (R) {
1360
- throw m && m(), R && R.name === "TypeError" && /Load failed|fetch/i.test(R.message) ? Object.assign(
1361
- new y("Network Error", y.ERR_NETWORK, e, p),
1362
- {
1363
- cause: R.cause || R
1364
- }
1365
- ) : y.from(R, R && R.code, e, p);
1366
- }
1367
- }), he = {
1368
- http: on,
1369
- xhr: Bn,
1370
- fetch: Jn
1371
- };
1372
- a.forEach(he, (e, t) => {
1373
- if (e) {
1374
- try {
1375
- Object.defineProperty(e, "name", { value: t });
1376
- } catch {
1377
- }
1378
- Object.defineProperty(e, "adapterName", { value: t });
1379
- }
1380
- });
1381
- const _e = (e) => `- ${e}`, Vn = (e) => a.isFunction(e) || e === null || e === !1, rt = {
1382
- getAdapter: (e) => {
1383
- e = a.isArray(e) ? e : [e];
1384
- const { length: t } = e;
1385
- let n, r;
1386
- const s = {};
1387
- for (let o = 0; o < t; o++) {
1388
- n = e[o];
1389
- let i;
1390
- if (r = n, !Vn(n) && (r = he[(i = String(n)).toLowerCase()], r === void 0))
1391
- throw new y(`Unknown adapter '${i}'`);
1392
- if (r)
1393
- break;
1394
- s[i || "#" + o] = r;
1395
- }
1396
- if (!r) {
1397
- const o = Object.entries(s).map(
1398
- ([c, f]) => `adapter ${c} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
1399
- );
1400
- let i = t ? o.length > 1 ? `since :
1401
- ` + o.map(_e).join(`
1402
- `) : " " + _e(o[0]) : "as no adapter specified";
1403
- throw new y(
1404
- "There is no suitable adapter to dispatch the request " + i,
1405
- "ERR_NOT_SUPPORT"
1406
- );
1407
- }
1408
- return r;
1409
- },
1410
- adapters: he
1411
- };
1412
- function ue(e) {
1413
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1414
- throw new v(null, e);
1415
- }
1416
- function Le(e) {
1417
- return ue(e), e.headers = F.from(e.headers), e.data = ce.call(
1418
- e,
1419
- e.transformRequest
1420
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), rt.getAdapter(e.adapter || W.adapter)(e).then(function(r) {
1421
- return ue(e), r.data = ce.call(
1422
- e,
1423
- e.transformResponse,
1424
- r
1425
- ), r.headers = F.from(r.headers), r;
1426
- }, function(r) {
1427
- return Ge(r) || (ue(e), r && r.response && (r.response.data = ce.call(
1428
- e,
1429
- e.transformResponse,
1430
- r.response
1431
- ), r.response.headers = F.from(r.response.headers))), Promise.reject(r);
1432
- });
1433
- }
1434
- const st = "1.11.0", ie = {};
1435
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1436
- ie[e] = function(r) {
1437
- return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1438
- };
1439
- });
1440
- const ke = {};
1441
- ie.transitional = function(t, n, r) {
1442
- function s(o, i) {
1443
- return "[Axios v" + st + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
1444
- }
1445
- return (o, i, c) => {
1446
- if (t === !1)
1447
- throw new y(
1448
- s(i, " has been removed" + (n ? " in " + n : "")),
1449
- y.ERR_DEPRECATED
1450
- );
1451
- return n && !ke[i] && (ke[i] = !0, console.warn(
1452
- s(
1453
- i,
1454
- " has been deprecated since v" + n + " and will be removed in the near future"
1455
- )
1456
- )), t ? t(o, i, c) : !0;
1457
- };
1458
- };
1459
- ie.spelling = function(t) {
1460
- return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
1461
- };
1462
- function Wn(e, t, n) {
1463
- if (typeof e != "object")
1464
- throw new y("options must be an object", y.ERR_BAD_OPTION_VALUE);
1465
- const r = Object.keys(e);
1466
- let s = r.length;
1467
- for (; s-- > 0; ) {
1468
- const o = r[s], i = t[o];
1469
- if (i) {
1470
- const c = e[o], f = c === void 0 || i(c, o, e);
1471
- if (f !== !0)
1472
- throw new y("option " + o + " must be " + f, y.ERR_BAD_OPTION_VALUE);
1473
- continue;
1474
- }
1475
- if (n !== !0)
1476
- throw new y("Unknown option " + o, y.ERR_BAD_OPTION);
1477
- }
1478
- }
1479
- const G = {
1480
- assertOptions: Wn,
1481
- validators: ie
1482
- }, L = G.validators;
1483
- let j = class {
1484
- constructor(t) {
1485
- this.defaults = t || {}, this.interceptors = {
1486
- request: new Ae(),
1487
- response: new Ae()
1488
- };
1489
- }
1490
- /**
1491
- * Dispatch a request
1492
- *
1493
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1494
- * @param {?Object} config
1495
- *
1496
- * @returns {Promise} The Promise to be fulfilled
1497
- */
1498
- async request(t, n) {
1499
- try {
1500
- return await this._request(t, n);
1501
- } catch (r) {
1502
- if (r instanceof Error) {
1503
- let s = {};
1504
- Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
1505
- const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
1506
- try {
1507
- r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
1508
- ` + o) : r.stack = o;
1509
- } catch {
1510
- }
1511
- }
1512
- throw r;
1513
- }
1514
- }
1515
- _request(t, n) {
1516
- typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = q(this.defaults, n);
1517
- const { transitional: r, paramsSerializer: s, headers: o } = n;
1518
- r !== void 0 && G.assertOptions(r, {
1519
- silentJSONParsing: L.transitional(L.boolean),
1520
- forcedJSONParsing: L.transitional(L.boolean),
1521
- clarifyTimeoutError: L.transitional(L.boolean)
1522
- }, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
1523
- serialize: s
1524
- } : G.assertOptions(s, {
1525
- encode: L.function,
1526
- serialize: L.function
1527
- }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), G.assertOptions(n, {
1528
- baseUrl: L.spelling("baseURL"),
1529
- withXsrfToken: L.spelling("withXSRFToken")
1530
- }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1531
- let i = o && a.merge(
1532
- o.common,
1533
- o[n.method]
1534
- );
1535
- o && a.forEach(
1536
- ["delete", "get", "head", "post", "put", "patch", "common"],
1537
- (p) => {
1538
- delete o[p];
1539
- }
1540
- ), n.headers = F.concat(i, o);
1541
- const c = [];
1542
- let f = !0;
1543
- this.interceptors.request.forEach(function(m) {
1544
- typeof m.runWhen == "function" && m.runWhen(n) === !1 || (f = f && m.synchronous, c.unshift(m.fulfilled, m.rejected));
1545
- });
1546
- const u = [];
1547
- this.interceptors.response.forEach(function(m) {
1548
- u.push(m.fulfilled, m.rejected);
1549
- });
1550
- let l, d = 0, w;
1551
- if (!f) {
1552
- const p = [Le.bind(this), void 0];
1553
- for (p.unshift(...c), p.push(...u), w = p.length, l = Promise.resolve(n); d < w; )
1554
- l = l.then(p[d++], p[d++]);
1555
- return l;
1556
- }
1557
- w = c.length;
1558
- let g = n;
1559
- for (d = 0; d < w; ) {
1560
- const p = c[d++], m = c[d++];
1561
- try {
1562
- g = p(g);
1563
- } catch (h) {
1564
- m.call(this, h);
1565
- break;
1566
- }
1567
- }
1568
- try {
1569
- l = Le.call(this, g);
1570
- } catch (p) {
1571
- return Promise.reject(p);
1572
- }
1573
- for (d = 0, w = u.length; d < w; )
1574
- l = l.then(u[d++], u[d++]);
1575
- return l;
1576
- }
1577
- getUri(t) {
1578
- t = q(this.defaults, t);
1579
- const n = Ye(t.baseURL, t.url, t.allowAbsoluteUrls);
1580
- return Ke(n, t.params, t.paramsSerializer);
1581
- }
1582
- };
1583
- a.forEach(["delete", "get", "head", "options"], function(t) {
1584
- j.prototype[t] = function(n, r) {
1585
- return this.request(q(r || {}, {
1586
- method: t,
1587
- url: n,
1588
- data: (r || {}).data
1589
- }));
1590
- };
1591
- });
1592
- a.forEach(["post", "put", "patch"], function(t) {
1593
- function n(r) {
1594
- return function(o, i, c) {
1595
- return this.request(q(c || {}, {
1596
- method: t,
1597
- headers: r ? {
1598
- "Content-Type": "multipart/form-data"
1599
- } : {},
1600
- url: o,
1601
- data: i
1602
- }));
1603
- };
1604
- }
1605
- j.prototype[t] = n(), j.prototype[t + "Form"] = n(!0);
1606
- });
1607
- let Kn = class ot {
1608
- constructor(t) {
1609
- if (typeof t != "function")
1610
- throw new TypeError("executor must be a function.");
1611
- let n;
1612
- this.promise = new Promise(function(o) {
1613
- n = o;
1614
- });
1615
- const r = this;
1616
- this.promise.then((s) => {
1617
- if (!r._listeners) return;
1618
- let o = r._listeners.length;
1619
- for (; o-- > 0; )
1620
- r._listeners[o](s);
1621
- r._listeners = null;
1622
- }), this.promise.then = (s) => {
1623
- let o;
1624
- const i = new Promise((c) => {
1625
- r.subscribe(c), o = c;
1626
- }).then(s);
1627
- return i.cancel = function() {
1628
- r.unsubscribe(o);
1629
- }, i;
1630
- }, t(function(o, i, c) {
1631
- r.reason || (r.reason = new v(o, i, c), n(r.reason));
1632
- });
1633
- }
1634
- /**
1635
- * Throws a `CanceledError` if cancellation has been requested.
1636
- */
1637
- throwIfRequested() {
1638
- if (this.reason)
1639
- throw this.reason;
1640
- }
1641
- /**
1642
- * Subscribe to the cancel signal
1643
- */
1644
- subscribe(t) {
1645
- if (this.reason) {
1646
- t(this.reason);
1647
- return;
1648
- }
1649
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
1650
- }
1651
- /**
1652
- * Unsubscribe from the cancel signal
1653
- */
1654
- unsubscribe(t) {
1655
- if (!this._listeners)
1656
- return;
1657
- const n = this._listeners.indexOf(t);
1658
- n !== -1 && this._listeners.splice(n, 1);
1659
- }
1660
- toAbortSignal() {
1661
- const t = new AbortController(), n = (r) => {
1662
- t.abort(r);
1663
- };
1664
- return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
1665
- }
1666
- /**
1667
- * Returns an object that contains a new `CancelToken` and a function that, when called,
1668
- * cancels the `CancelToken`.
1669
- */
1670
- static source() {
1671
- let t;
1672
- return {
1673
- token: new ot(function(s) {
1674
- t = s;
1675
- }),
1676
- cancel: t
1677
- };
1678
- }
1679
- };
1680
- function Qn(e) {
1681
- return function(n) {
1682
- return e.apply(null, n);
1683
- };
1684
- }
1685
- function Xn(e) {
1686
- return a.isObject(e) && e.isAxiosError === !0;
1687
- }
1688
- const me = {
1689
- Continue: 100,
1690
- SwitchingProtocols: 101,
1691
- Processing: 102,
1692
- EarlyHints: 103,
1693
- Ok: 200,
1694
- Created: 201,
1695
- Accepted: 202,
1696
- NonAuthoritativeInformation: 203,
1697
- NoContent: 204,
1698
- ResetContent: 205,
1699
- PartialContent: 206,
1700
- MultiStatus: 207,
1701
- AlreadyReported: 208,
1702
- ImUsed: 226,
1703
- MultipleChoices: 300,
1704
- MovedPermanently: 301,
1705
- Found: 302,
1706
- SeeOther: 303,
1707
- NotModified: 304,
1708
- UseProxy: 305,
1709
- Unused: 306,
1710
- TemporaryRedirect: 307,
1711
- PermanentRedirect: 308,
1712
- BadRequest: 400,
1713
- Unauthorized: 401,
1714
- PaymentRequired: 402,
1715
- Forbidden: 403,
1716
- NotFound: 404,
1717
- MethodNotAllowed: 405,
1718
- NotAcceptable: 406,
1719
- ProxyAuthenticationRequired: 407,
1720
- RequestTimeout: 408,
1721
- Conflict: 409,
1722
- Gone: 410,
1723
- LengthRequired: 411,
1724
- PreconditionFailed: 412,
1725
- PayloadTooLarge: 413,
1726
- UriTooLong: 414,
1727
- UnsupportedMediaType: 415,
1728
- RangeNotSatisfiable: 416,
1729
- ExpectationFailed: 417,
1730
- ImATeapot: 418,
1731
- MisdirectedRequest: 421,
1732
- UnprocessableEntity: 422,
1733
- Locked: 423,
1734
- FailedDependency: 424,
1735
- TooEarly: 425,
1736
- UpgradeRequired: 426,
1737
- PreconditionRequired: 428,
1738
- TooManyRequests: 429,
1739
- RequestHeaderFieldsTooLarge: 431,
1740
- UnavailableForLegalReasons: 451,
1741
- InternalServerError: 500,
1742
- NotImplemented: 501,
1743
- BadGateway: 502,
1744
- ServiceUnavailable: 503,
1745
- GatewayTimeout: 504,
1746
- HttpVersionNotSupported: 505,
1747
- VariantAlsoNegotiates: 506,
1748
- InsufficientStorage: 507,
1749
- LoopDetected: 508,
1750
- NotExtended: 510,
1751
- NetworkAuthenticationRequired: 511
1752
- };
1753
- Object.entries(me).forEach(([e, t]) => {
1754
- me[t] = e;
1755
- });
1756
- function it(e) {
1757
- const t = new j(e), n = Be(j.prototype.request, t);
1758
- return a.extend(n, j.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
1759
- return it(q(e, s));
1760
- }, n;
1761
- }
1762
- const O = it(W);
1763
- O.Axios = j;
1764
- O.CanceledError = v;
1765
- O.CancelToken = Kn;
1766
- O.isCancel = Ge;
1767
- O.VERSION = st;
1768
- O.toFormData = se;
1769
- O.AxiosError = y;
1770
- O.Cancel = O.CanceledError;
1771
- O.all = function(t) {
1772
- return Promise.all(t);
1773
- };
1774
- O.spread = Qn;
1775
- O.isAxiosError = Xn;
1776
- O.mergeConfig = q;
1777
- O.AxiosHeaders = F;
1778
- O.formToJSON = (e) => Xe(a.isHTMLForm(e) ? new FormData(e) : e);
1779
- O.getAdapter = rt.getAdapter;
1780
- O.HttpStatusCode = me;
1781
- O.default = O;
1782
- const {
1783
- Axios: or,
1784
- AxiosError: ir,
1785
- CanceledError: ar,
1786
- isCancel: cr,
1787
- CancelToken: ur,
1788
- VERSION: lr,
1789
- all: fr,
1790
- Cancel: dr,
1791
- isAxiosError: pr,
1792
- spread: hr,
1793
- toFormData: mr,
1794
- AxiosHeaders: yr,
1795
- HttpStatusCode: br,
1796
- formToJSON: wr,
1797
- getAdapter: Er,
1798
- mergeConfig: gr
1799
- } = O, Rr = ({
1800
- endpoint: e,
1801
- headers: t = {},
1802
- initialData: n,
1803
- validationRules: r
1804
- }) => {
1805
- const s = De({ initialData: n, validationRules: r }), [o, i] = ft(!1), c = dt(null), f = Z(
1806
- (l = {}) => {
1807
- const {
1808
- onBefore: d = () => {
1809
- },
1810
- onCancel: w = () => {
1811
- },
1812
- onError: g = () => {
1813
- },
1814
- onFinish: p = () => {
1815
- },
1816
- onSuccess: m = () => {
1817
- },
1818
- onUpload: h = () => {
1819
- },
1820
- skipValidation: R = !1
1821
- } = l;
1822
- if (!R && !s.validate())
1823
- return;
1824
- const E = new FormData();
1825
- Object.entries(s.data).forEach(([b, T]) => {
1826
- Array.isArray(T) ? T.forEach((S) => {
1827
- S instanceof File ? E.append(b, S) : E.append(b, String(S));
1828
- }) : T instanceof File ? E.append(b, T) : E.append(b, String(T));
1829
- }), d?.(), i(!0), c.current = new AbortController(), O.post(e, E, {
1830
- headers: {
1831
- "Content-Type": "multipart/form-data",
1832
- ...t
1833
- },
1834
- signal: c.current.signal,
1835
- onUploadProgress: (b) => {
1836
- h?.(b);
1837
- }
1838
- }).then((b) => {
1839
- m?.(b);
1840
- }).catch((b) => {
1841
- O.isCancel(b) ? w?.(b) : g?.(b);
1842
- }).finally(() => {
1843
- p?.(), i(!1), c.current = null;
1844
- });
1845
- },
1846
- [e, t, s]
1847
- ), u = Z(() => {
1848
- c.current && c.current.abort("Upload cancelled by user");
1849
- }, []);
1850
- return {
1851
- ...s,
1852
- upload: f,
1853
- isUploading: o,
1854
- cancel: u
1855
- };
1856
- }, Sr = ({
1857
- headers: e = {},
1858
- initialData: t,
1859
- options: n = {},
1860
- query: r,
1861
- validationRules: s
1862
- }) => {
1863
- const { data: o, setData: i, validate: c, ...f } = De({
1864
- initialData: t,
1865
- validationRules: s
1866
- }), [u, { data: l, error: d, loading: w, refetch: g }] = wt(r, {
1867
- fetchPolicy: "network-only",
1868
- errorPolicy: "all",
1869
- notifyOnNetworkStatusChange: !0,
1870
- ...n
1871
- }), p = Z(
1872
- (h = {}) => {
1873
- const {
1874
- onBefore: R = () => {
1875
- },
1876
- onError: E = () => {
1877
- },
1878
- onFinish: b = () => {
1879
- },
1880
- onSuccess: T = () => {
1881
- },
1882
- skipValidation: S = !1
1883
- } = h;
1884
- !S && !c() || (R?.(), u({
1885
- variables: { filters: o },
1886
- ...!lt(e) && { context: { headers: e } }
1887
- }).then((A) => {
1888
- T?.(A);
1889
- }).catch((A) => {
1890
- E?.(A);
1891
- }).finally(() => {
1892
- b?.();
1893
- }));
1894
- },
1895
- [o, u, e, c]
1896
- ), m = Z(() => {
1897
- g && g({ filters: o });
1898
- }, [g, o]);
1899
- return {
1900
- ...f,
1901
- validate: c,
1902
- filter: o,
1903
- setFilter: i,
1904
- isLoading: w,
1905
- query: p,
1906
- refetch: m,
1907
- data: l,
1908
- error: d
1909
- };
1910
- };
1
+ import { y as a, f as o, A as l, B as t, g as u, l as r, x as F, h as d, j as i, z as f } from "../chunks/hooks-bJFfbTks.js";
1911
2
  export {
1912
- Ar as handleRules,
1913
- Rr as useFileUpload,
1914
- Sr as useFilter,
1915
- xr as useForm,
1916
- De as useFormState,
1917
- nr as validator
3
+ a as handleRules,
4
+ o as useControllableState,
5
+ l as useFileUpload,
6
+ t as useFilter,
7
+ u as useFocus,
8
+ r as useForm,
9
+ F as useFormState,
10
+ d as useKeyboard,
11
+ i as useOverflowDetection,
12
+ f as validator
1918
13
  };