@articles-media/articles-dev-box 1.0.17 → 1.0.22

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 (86) hide show
  1. package/README.md +6 -5
  2. package/dist/Ad-Ck5UdTq3.js +387 -0
  3. package/dist/Ad-DYtftKNV.cjs +1 -0
  4. package/dist/Ad.cjs +1 -1
  5. package/dist/Ad.js +2 -604
  6. package/dist/AdConfirmExitModal-CJ-HtcVC.js +56 -0
  7. package/dist/AdConfirmExitModal-CRCnzYQM.cjs +1 -0
  8. package/dist/AdDetailsModal-DRNRTL2W.js +108 -0
  9. package/dist/AdDetailsModal-g0n7LiV6.cjs +1 -0
  10. package/dist/ArticlesAd.cjs +1 -1
  11. package/dist/ArticlesAd.js +16 -15
  12. package/dist/Button-BlAdEbSd.js +30 -0
  13. package/dist/Button-CbpRj01E.cjs +1 -0
  14. package/dist/CreditsModal.cjs +1 -0
  15. package/dist/CreditsModal.js +56 -0
  16. package/dist/DarkModeHandler.cjs +1 -1
  17. package/dist/DarkModeHandler.js +17 -16
  18. package/dist/FriendsList.cjs +1 -1
  19. package/dist/FriendsList.js +77 -121
  20. package/dist/GameScoreboard-CBY3JsFa.js +165 -0
  21. package/dist/GameScoreboard-DdOCRxON.cjs +1 -0
  22. package/dist/GameScoreboard.cjs +1 -1
  23. package/dist/GameScoreboard.js +2 -190
  24. package/dist/GlobalBody.cjs +33 -1
  25. package/dist/GlobalBody.js +36 -7
  26. package/dist/GlobalHead.cjs +1 -1
  27. package/dist/GlobalHead.js +10 -12
  28. package/dist/Link-MFZblBb4.js +17 -0
  29. package/dist/Link-c7exNCJ3.cjs +1 -0
  30. package/dist/Modal-BX1s6CCU.js +1631 -0
  31. package/dist/Modal-DP9CeAVD.cjs +3 -0
  32. package/dist/ReturnToLauncherButton.cjs +1 -1
  33. package/dist/ReturnToLauncherButton.js +39 -54
  34. package/dist/SettingsModal--sWLmLGp.cjs +1 -0
  35. package/dist/SettingsModal-XI2dMI09.js +247 -0
  36. package/dist/SettingsModal.cjs +1 -1
  37. package/dist/SettingsModal.js +2 -658
  38. package/dist/StatusModal-D7WDDR9P.cjs +1 -0
  39. package/dist/StatusModal-elrPJvX1.js +70 -0
  40. package/dist/ViewUserModal-DDjWLpyM.js +3094 -0
  41. package/dist/ViewUserModal-DPVcjXNU.cjs +1 -0
  42. package/dist/ViewUserModal.cjs +1 -1
  43. package/dist/ViewUserModal.js +3 -3149
  44. package/dist/articles-dev-box.css +2 -1
  45. package/dist/chunk-350yNsax.cjs +1 -0
  46. package/dist/classnames-DP6dWde5.js +31 -0
  47. package/dist/classnames-pS64X3rL.cjs +1 -0
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.js +16 -28
  50. package/dist/jsx-runtime-VZk6y-ec.js +191 -0
  51. package/dist/jsx-runtime-hCcDh67y.cjs +6 -0
  52. package/dist/numberWithCommas-BSKBdR-e.js +18 -0
  53. package/dist/numberWithCommas-D9tgiUnq.cjs +1 -0
  54. package/dist/useAuthSiteStatus-1rHjYC4N.js +29 -0
  55. package/dist/useAuthSiteStatus-P5kHc_Bz.cjs +1 -0
  56. package/dist/useFullscreen.cjs +1 -0
  57. package/dist/useFullscreen.js +24 -0
  58. package/dist/useUserDetails.cjs +1 -1
  59. package/dist/useUserDetails.js +22 -32
  60. package/dist/useUserFriends.cjs +1 -1
  61. package/dist/useUserFriends.js +29 -51
  62. package/dist/useUserToken.cjs +1 -1
  63. package/dist/useUserToken.js +16 -21
  64. package/package.json +17 -10
  65. package/dist/AdConfirmExitModal-Bhz-lt9w.js +0 -72
  66. package/dist/AdConfirmExitModal-N3Lvhb4y.cjs +0 -1
  67. package/dist/AdDetailsModal-BMj8DjV0.cjs +0 -1
  68. package/dist/AdDetailsModal-DXvfmyKK.js +0 -83
  69. package/dist/Button-0ZK0NKiK.cjs +0 -1
  70. package/dist/Button-_Quon8UV.js +0 -54
  71. package/dist/ElementChildren-DN3RWY2E.js +0 -51
  72. package/dist/ElementChildren-eAwIENLl.cjs +0 -1
  73. package/dist/GlobalBody-BrrtfBBs.js +0 -123
  74. package/dist/GlobalBody-weON_TbJ.cjs +0 -33
  75. package/dist/Modal-Bdhkgkwr.cjs +0 -2
  76. package/dist/Modal-nux8R77F.js +0 -2087
  77. package/dist/StatusModal-B086BgSW.js +0 -71
  78. package/dist/StatusModal-CzPyqQQA.cjs +0 -1
  79. package/dist/index-BlP2-uOi.cjs +0 -1
  80. package/dist/index-C8MeSLnR.js +0 -2504
  81. package/dist/index-DWV8myok.cjs +0 -6
  82. package/dist/index-YnD2EP-S.js +0 -43
  83. package/dist/jsx-runtime-nZSsnGb7.cjs +0 -6
  84. package/dist/jsx-runtime-tc70JA_2.js +0 -264
  85. package/dist/numberWithCommas-CRgrb58X.cjs +0 -1
  86. package/dist/numberWithCommas-DnAkiOFL.js +0 -1256
@@ -1,2504 +0,0 @@
1
- import ge, { createContext as kn, useEffect as Mn, useLayoutEffect as Hn, useContext as Vn, useMemo as rn, useRef as le, useCallback as ze, useDebugValue as $n } from "react";
2
- function sn(e, t) {
3
- return function() {
4
- return e.apply(t, arguments);
5
- };
6
- }
7
- const { toString: Wn } = Object.prototype, { getPrototypeOf: yt } = Object, { iterator: qe, toStringTag: on } = Symbol, ke = /* @__PURE__ */ ((e) => (t) => {
8
- const n = Wn.call(t);
9
- return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
10
- })(/* @__PURE__ */ Object.create(null)), X = (e) => (e = e.toLowerCase(), (t) => ke(t) === e), Me = (e) => (t) => typeof t === e, { isArray: we } = Array, ye = Me("undefined");
11
- function Oe(e) {
12
- return e !== null && !ye(e) && e.constructor !== null && !ye(e.constructor) && q(e.constructor.isBuffer) && e.constructor.isBuffer(e);
13
- }
14
- const an = X("ArrayBuffer");
15
- function zn(e) {
16
- let t;
17
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && an(e.buffer), t;
18
- }
19
- const Jn = Me("string"), q = Me("function"), cn = Me("number"), Te = (e) => e !== null && typeof e == "object", Kn = (e) => e === !0 || e === !1, Ue = (e) => {
20
- if (ke(e) !== "object")
21
- return !1;
22
- const t = yt(e);
23
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(on in e) && !(qe in e);
24
- }, Gn = (e) => {
25
- if (!Te(e) || Oe(e))
26
- return !1;
27
- try {
28
- return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
29
- } catch {
30
- return !1;
31
- }
32
- }, Xn = X("Date"), Yn = X("File"), Qn = (e) => !!(e && typeof e.uri < "u"), Zn = (e) => e && typeof e.getParts < "u", er = X("Blob"), tr = X("FileList"), nr = (e) => Te(e) && q(e.pipe);
33
- function rr() {
34
- return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
35
- }
36
- const Nt = rr(), Lt = typeof Nt.FormData < "u" ? Nt.FormData : void 0, sr = (e) => {
37
- let t;
38
- return e && (Lt && e instanceof Lt || q(e.append) && ((t = ke(e)) === "formdata" || // detect form-data instance
39
- t === "object" && q(e.toString) && e.toString() === "[object FormData]"));
40
- }, or = X("URLSearchParams"), [ir, ar, cr, ur] = [
41
- "ReadableStream",
42
- "Request",
43
- "Response",
44
- "Headers"
45
- ].map(X), lr = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
46
- function _e(e, t, { allOwnKeys: n = !1 } = {}) {
47
- if (e === null || typeof e > "u")
48
- return;
49
- let r, s;
50
- if (typeof e != "object" && (e = [e]), we(e))
51
- for (r = 0, s = e.length; r < s; r++)
52
- t.call(null, e[r], r, e);
53
- else {
54
- if (Oe(e))
55
- return;
56
- const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), o = i.length;
57
- let a;
58
- for (r = 0; r < o; r++)
59
- a = i[r], t.call(null, e[a], a, e);
60
- }
61
- }
62
- function un(e, t) {
63
- if (Oe(e))
64
- return null;
65
- t = t.toLowerCase();
66
- const n = Object.keys(e);
67
- let r = n.length, s;
68
- for (; r-- > 0; )
69
- if (s = n[r], t === s.toLowerCase())
70
- return s;
71
- return null;
72
- }
73
- const fe = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, ln = (e) => !ye(e) && e !== fe;
74
- function ot() {
75
- const { caseless: e, skipUndefined: t } = ln(this) && this || {}, n = {}, r = (s, i) => {
76
- if (i === "__proto__" || i === "constructor" || i === "prototype")
77
- return;
78
- const o = e && un(n, i) || i;
79
- Ue(n[o]) && Ue(s) ? n[o] = ot(n[o], s) : Ue(s) ? n[o] = ot({}, s) : we(s) ? n[o] = s.slice() : (!t || !ye(s)) && (n[o] = s);
80
- };
81
- for (let s = 0, i = arguments.length; s < i; s++)
82
- arguments[s] && _e(arguments[s], r);
83
- return n;
84
- }
85
- const fr = (e, t, n, { allOwnKeys: r } = {}) => (_e(
86
- t,
87
- (s, i) => {
88
- n && q(s) ? Object.defineProperty(e, i, {
89
- value: sn(s, n),
90
- writable: !0,
91
- enumerable: !0,
92
- configurable: !0
93
- }) : Object.defineProperty(e, i, {
94
- value: s,
95
- writable: !0,
96
- enumerable: !0,
97
- configurable: !0
98
- });
99
- },
100
- { allOwnKeys: r }
101
- ), e), dr = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), pr = (e, t, n, r) => {
102
- e.prototype = Object.create(t.prototype, r), Object.defineProperty(e.prototype, "constructor", {
103
- value: e,
104
- writable: !0,
105
- enumerable: !1,
106
- configurable: !0
107
- }), Object.defineProperty(e, "super", {
108
- value: t.prototype
109
- }), n && Object.assign(e.prototype, n);
110
- }, hr = (e, t, n, r) => {
111
- let s, i, o;
112
- const a = {};
113
- if (t = t || {}, e == null) return t;
114
- do {
115
- for (s = Object.getOwnPropertyNames(e), i = s.length; i-- > 0; )
116
- o = s[i], (!r || r(o, e, t)) && !a[o] && (t[o] = e[o], a[o] = !0);
117
- e = n !== !1 && yt(e);
118
- } while (e && (!n || n(e, t)) && e !== Object.prototype);
119
- return t;
120
- }, mr = (e, t, n) => {
121
- e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
122
- const r = e.indexOf(t, n);
123
- return r !== -1 && r === n;
124
- }, Er = (e) => {
125
- if (!e) return null;
126
- if (we(e)) return e;
127
- let t = e.length;
128
- if (!cn(t)) return null;
129
- const n = new Array(t);
130
- for (; t-- > 0; )
131
- n[t] = e[t];
132
- return n;
133
- }, yr = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && yt(Uint8Array)), wr = (e, t) => {
134
- const r = (e && e[qe]).call(e);
135
- let s;
136
- for (; (s = r.next()) && !s.done; ) {
137
- const i = s.value;
138
- t.call(e, i[0], i[1]);
139
- }
140
- }, Rr = (e, t) => {
141
- let n;
142
- const r = [];
143
- for (; (n = e.exec(t)) !== null; )
144
- r.push(n);
145
- return r;
146
- }, Sr = X("HTMLFormElement"), br = (e) => e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(n, r, s) {
147
- return r.toUpperCase() + s;
148
- }), Pt = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), gr = X("RegExp"), fn = (e, t) => {
149
- const n = Object.getOwnPropertyDescriptors(e), r = {};
150
- _e(n, (s, i) => {
151
- let o;
152
- (o = t(s, i, e)) !== !1 && (r[i] = o || s);
153
- }), Object.defineProperties(e, r);
154
- }, Or = (e) => {
155
- fn(e, (t, n) => {
156
- if (q(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
157
- return !1;
158
- const r = e[n];
159
- if (q(r)) {
160
- if (t.enumerable = !1, "writable" in t) {
161
- t.writable = !1;
162
- return;
163
- }
164
- t.set || (t.set = () => {
165
- throw Error("Can not rewrite read-only method '" + n + "'");
166
- });
167
- }
168
- });
169
- }, Tr = (e, t) => {
170
- const n = {}, r = (s) => {
171
- s.forEach((i) => {
172
- n[i] = !0;
173
- });
174
- };
175
- return we(e) ? r(e) : r(String(e).split(t)), n;
176
- }, _r = () => {
177
- }, Ar = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
178
- function Cr(e) {
179
- return !!(e && q(e.append) && e[on] === "FormData" && e[qe]);
180
- }
181
- const xr = (e) => {
182
- const t = new Array(10), n = (r, s) => {
183
- if (Te(r)) {
184
- if (t.indexOf(r) >= 0)
185
- return;
186
- if (Oe(r))
187
- return r;
188
- if (!("toJSON" in r)) {
189
- t[s] = r;
190
- const i = we(r) ? [] : {};
191
- return _e(r, (o, a) => {
192
- const d = n(o, s + 1);
193
- !ye(d) && (i[a] = d);
194
- }), t[s] = void 0, i;
195
- }
196
- }
197
- return r;
198
- };
199
- return n(e, 0);
200
- }, Dr = X("AsyncFunction"), Nr = (e) => e && (Te(e) || q(e)) && q(e.then) && q(e.catch), dn = ((e, t) => e ? setImmediate : t ? ((n, r) => (fe.addEventListener(
201
- "message",
202
- ({ source: s, data: i }) => {
203
- s === fe && i === n && r.length && r.shift()();
204
- },
205
- !1
206
- ), (s) => {
207
- r.push(s), fe.postMessage(n, "*");
208
- }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(typeof setImmediate == "function", q(fe.postMessage)), Lr = typeof queueMicrotask < "u" ? queueMicrotask.bind(fe) : typeof process < "u" && process.nextTick || dn, Pr = (e) => e != null && q(e[qe]), c = {
209
- isArray: we,
210
- isArrayBuffer: an,
211
- isBuffer: Oe,
212
- isFormData: sr,
213
- isArrayBufferView: zn,
214
- isString: Jn,
215
- isNumber: cn,
216
- isBoolean: Kn,
217
- isObject: Te,
218
- isPlainObject: Ue,
219
- isEmptyObject: Gn,
220
- isReadableStream: ir,
221
- isRequest: ar,
222
- isResponse: cr,
223
- isHeaders: ur,
224
- isUndefined: ye,
225
- isDate: Xn,
226
- isFile: Yn,
227
- isReactNativeBlob: Qn,
228
- isReactNative: Zn,
229
- isBlob: er,
230
- isRegExp: gr,
231
- isFunction: q,
232
- isStream: nr,
233
- isURLSearchParams: or,
234
- isTypedArray: yr,
235
- isFileList: tr,
236
- forEach: _e,
237
- merge: ot,
238
- extend: fr,
239
- trim: lr,
240
- stripBOM: dr,
241
- inherits: pr,
242
- toFlatObject: hr,
243
- kindOf: ke,
244
- kindOfTest: X,
245
- endsWith: mr,
246
- toArray: Er,
247
- forEachEntry: wr,
248
- matchAll: Rr,
249
- isHTMLForm: Sr,
250
- hasOwnProperty: Pt,
251
- hasOwnProp: Pt,
252
- // an alias to avoid ESLint no-prototype-builtins detection
253
- reduceDescriptors: fn,
254
- freezeMethods: Or,
255
- toObjectSet: Tr,
256
- toCamelCase: br,
257
- noop: _r,
258
- toFiniteNumber: Ar,
259
- findKey: un,
260
- global: fe,
261
- isContextDefined: ln,
262
- isSpecCompliantForm: Cr,
263
- toJSONObject: xr,
264
- isAsyncFn: Dr,
265
- isThenable: Nr,
266
- setImmediate: dn,
267
- asap: Lr,
268
- isIterable: Pr
269
- };
270
- let R = class pn extends Error {
271
- static from(t, n, r, s, i, o) {
272
- const a = new pn(t.message, n || t.code, r, s, i);
273
- return a.cause = t, a.name = t.name, t.status != null && a.status == null && (a.status = t.status), o && Object.assign(a, o), a;
274
- }
275
- /**
276
- * Create an Error with the specified message, config, error code, request and response.
277
- *
278
- * @param {string} message The error message.
279
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
280
- * @param {Object} [config] The config.
281
- * @param {Object} [request] The request.
282
- * @param {Object} [response] The response.
283
- *
284
- * @returns {Error} The created error.
285
- */
286
- constructor(t, n, r, s, i) {
287
- super(t), Object.defineProperty(this, "message", {
288
- value: t,
289
- enumerable: !0,
290
- writable: !0,
291
- configurable: !0
292
- }), this.name = "AxiosError", this.isAxiosError = !0, n && (this.code = n), r && (this.config = r), s && (this.request = s), i && (this.response = i, this.status = i.status);
293
- }
294
- toJSON() {
295
- return {
296
- // Standard
297
- message: this.message,
298
- name: this.name,
299
- // Microsoft
300
- description: this.description,
301
- number: this.number,
302
- // Mozilla
303
- fileName: this.fileName,
304
- lineNumber: this.lineNumber,
305
- columnNumber: this.columnNumber,
306
- stack: this.stack,
307
- // Axios
308
- config: c.toJSONObject(this.config),
309
- code: this.code,
310
- status: this.status
311
- };
312
- }
313
- };
314
- R.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
315
- R.ERR_BAD_OPTION = "ERR_BAD_OPTION";
316
- R.ECONNABORTED = "ECONNABORTED";
317
- R.ETIMEDOUT = "ETIMEDOUT";
318
- R.ERR_NETWORK = "ERR_NETWORK";
319
- R.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
320
- R.ERR_DEPRECATED = "ERR_DEPRECATED";
321
- R.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
322
- R.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
323
- R.ERR_CANCELED = "ERR_CANCELED";
324
- R.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
325
- R.ERR_INVALID_URL = "ERR_INVALID_URL";
326
- const Fr = null;
327
- function it(e) {
328
- return c.isPlainObject(e) || c.isArray(e);
329
- }
330
- function hn(e) {
331
- return c.endsWith(e, "[]") ? e.slice(0, -2) : e;
332
- }
333
- function Je(e, t, n) {
334
- return e ? e.concat(t).map(function(s, i) {
335
- return s = hn(s), !n && i ? "[" + s + "]" : s;
336
- }).join(n ? "." : "") : t;
337
- }
338
- function vr(e) {
339
- return c.isArray(e) && !e.some(it);
340
- }
341
- const Ur = c.toFlatObject(c, {}, null, function(t) {
342
- return /^is[A-Z]/.test(t);
343
- });
344
- function He(e, t, n) {
345
- if (!c.isObject(e))
346
- throw new TypeError("target must be an object");
347
- t = t || new FormData(), n = c.toFlatObject(
348
- n,
349
- {
350
- metaTokens: !0,
351
- dots: !1,
352
- indexes: !1
353
- },
354
- !1,
355
- function(m, h) {
356
- return !c.isUndefined(h[m]);
357
- }
358
- );
359
- const r = n.metaTokens, s = n.visitor || l, i = n.dots, o = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && c.isSpecCompliantForm(t);
360
- if (!c.isFunction(s))
361
- throw new TypeError("visitor must be a function");
362
- function f(u) {
363
- if (u === null) return "";
364
- if (c.isDate(u))
365
- return u.toISOString();
366
- if (c.isBoolean(u))
367
- return u.toString();
368
- if (!d && c.isBlob(u))
369
- throw new R("Blob is not supported. Use a Buffer instead.");
370
- return c.isArrayBuffer(u) || c.isTypedArray(u) ? d && typeof Blob == "function" ? new Blob([u]) : Buffer.from(u) : u;
371
- }
372
- function l(u, m, h) {
373
- let S = u;
374
- if (c.isReactNative(t) && c.isReactNativeBlob(u))
375
- return t.append(Je(h, m, i), f(u)), !1;
376
- if (u && !h && typeof u == "object") {
377
- if (c.endsWith(m, "{}"))
378
- m = r ? m : m.slice(0, -2), u = JSON.stringify(u);
379
- else if (c.isArray(u) && vr(u) || (c.isFileList(u) || c.endsWith(m, "[]")) && (S = c.toArray(u)))
380
- return m = hn(m), S.forEach(function(_, x) {
381
- !(c.isUndefined(_) || _ === null) && t.append(
382
- // eslint-disable-next-line no-nested-ternary
383
- o === !0 ? Je([m], x, i) : o === null ? m : m + "[]",
384
- f(_)
385
- );
386
- }), !1;
387
- }
388
- return it(u) ? !0 : (t.append(Je(h, m, i), f(u)), !1);
389
- }
390
- const p = [], E = Object.assign(Ur, {
391
- defaultVisitor: l,
392
- convertValue: f,
393
- isVisitable: it
394
- });
395
- function y(u, m) {
396
- if (!c.isUndefined(u)) {
397
- if (p.indexOf(u) !== -1)
398
- throw Error("Circular reference detected in " + m.join("."));
399
- p.push(u), c.forEach(u, function(S, w) {
400
- (!(c.isUndefined(S) || S === null) && s.call(t, S, c.isString(w) ? w.trim() : w, m, E)) === !0 && y(S, m ? m.concat(w) : [w]);
401
- }), p.pop();
402
- }
403
- }
404
- if (!c.isObject(e))
405
- throw new TypeError("data must be an object");
406
- return y(e), t;
407
- }
408
- function Ft(e) {
409
- const t = {
410
- "!": "%21",
411
- "'": "%27",
412
- "(": "%28",
413
- ")": "%29",
414
- "~": "%7E",
415
- "%20": "+",
416
- "%00": "\0"
417
- };
418
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
419
- return t[r];
420
- });
421
- }
422
- function wt(e, t) {
423
- this._pairs = [], e && He(e, this, t);
424
- }
425
- const mn = wt.prototype;
426
- mn.append = function(t, n) {
427
- this._pairs.push([t, n]);
428
- };
429
- mn.toString = function(t) {
430
- const n = t ? function(r) {
431
- return t.call(this, r, Ft);
432
- } : Ft;
433
- return this._pairs.map(function(s) {
434
- return n(s[0]) + "=" + n(s[1]);
435
- }, "").join("&");
436
- };
437
- function Ir(e) {
438
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
439
- }
440
- function En(e, t, n) {
441
- if (!t)
442
- return e;
443
- const r = n && n.encode || Ir, s = c.isFunction(n) ? {
444
- serialize: n
445
- } : n, i = s && s.serialize;
446
- let o;
447
- if (i ? o = i(t, s) : o = c.isURLSearchParams(t) ? t.toString() : new wt(t, s).toString(r), o) {
448
- const a = e.indexOf("#");
449
- a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
450
- }
451
- return e;
452
- }
453
- class vt {
454
- constructor() {
455
- this.handlers = [];
456
- }
457
- /**
458
- * Add a new interceptor to the stack
459
- *
460
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
461
- * @param {Function} rejected The function to handle `reject` for a `Promise`
462
- * @param {Object} options The options for the interceptor, synchronous and runWhen
463
- *
464
- * @return {Number} An ID used to remove interceptor later
465
- */
466
- use(t, n, r) {
467
- return this.handlers.push({
468
- fulfilled: t,
469
- rejected: n,
470
- synchronous: r ? r.synchronous : !1,
471
- runWhen: r ? r.runWhen : null
472
- }), this.handlers.length - 1;
473
- }
474
- /**
475
- * Remove an interceptor from the stack
476
- *
477
- * @param {Number} id The ID that was returned by `use`
478
- *
479
- * @returns {void}
480
- */
481
- eject(t) {
482
- this.handlers[t] && (this.handlers[t] = null);
483
- }
484
- /**
485
- * Clear all interceptors from the stack
486
- *
487
- * @returns {void}
488
- */
489
- clear() {
490
- this.handlers && (this.handlers = []);
491
- }
492
- /**
493
- * Iterate over all the registered interceptors
494
- *
495
- * This method is particularly useful for skipping over any
496
- * interceptors that may have become `null` calling `eject`.
497
- *
498
- * @param {Function} fn The function to call for each interceptor
499
- *
500
- * @returns {void}
501
- */
502
- forEach(t) {
503
- c.forEach(this.handlers, function(r) {
504
- r !== null && t(r);
505
- });
506
- }
507
- }
508
- const Rt = {
509
- silentJSONParsing: !0,
510
- forcedJSONParsing: !0,
511
- clarifyTimeoutError: !1,
512
- legacyInterceptorReqResOrdering: !0
513
- }, Br = typeof URLSearchParams < "u" ? URLSearchParams : wt, jr = typeof FormData < "u" ? FormData : null, qr = typeof Blob < "u" ? Blob : null, kr = {
514
- isBrowser: !0,
515
- classes: {
516
- URLSearchParams: Br,
517
- FormData: jr,
518
- Blob: qr
519
- },
520
- protocols: ["http", "https", "file", "blob", "url", "data"]
521
- }, St = typeof window < "u" && typeof document < "u", at = typeof navigator == "object" && navigator || void 0, Mr = St && (!at || ["ReactNative", "NativeScript", "NS"].indexOf(at.product) < 0), Hr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
522
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Vr = St && window.location.href || "http://localhost", $r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
523
- __proto__: null,
524
- hasBrowserEnv: St,
525
- hasStandardBrowserEnv: Mr,
526
- hasStandardBrowserWebWorkerEnv: Hr,
527
- navigator: at,
528
- origin: Vr
529
- }, Symbol.toStringTag, { value: "Module" })), B = {
530
- ...$r,
531
- ...kr
532
- };
533
- function Wr(e, t) {
534
- return He(e, new B.classes.URLSearchParams(), {
535
- visitor: function(n, r, s, i) {
536
- return B.isNode && c.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
537
- },
538
- ...t
539
- });
540
- }
541
- function zr(e) {
542
- return c.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
543
- }
544
- function Jr(e) {
545
- const t = {}, n = Object.keys(e);
546
- let r;
547
- const s = n.length;
548
- let i;
549
- for (r = 0; r < s; r++)
550
- i = n[r], t[i] = e[i];
551
- return t;
552
- }
553
- function yn(e) {
554
- function t(n, r, s, i) {
555
- let o = n[i++];
556
- if (o === "__proto__") return !0;
557
- const a = Number.isFinite(+o), d = i >= n.length;
558
- return o = !o && c.isArray(s) ? s.length : o, d ? (c.hasOwnProp(s, o) ? s[o] = [s[o], r] : s[o] = r, !a) : ((!s[o] || !c.isObject(s[o])) && (s[o] = []), t(n, r, s[o], i) && c.isArray(s[o]) && (s[o] = Jr(s[o])), !a);
559
- }
560
- if (c.isFormData(e) && c.isFunction(e.entries)) {
561
- const n = {};
562
- return c.forEachEntry(e, (r, s) => {
563
- t(zr(r), s, n, 0);
564
- }), n;
565
- }
566
- return null;
567
- }
568
- function Kr(e, t, n) {
569
- if (c.isString(e))
570
- try {
571
- return (t || JSON.parse)(e), c.trim(e);
572
- } catch (r) {
573
- if (r.name !== "SyntaxError")
574
- throw r;
575
- }
576
- return (n || JSON.stringify)(e);
577
- }
578
- const Ae = {
579
- transitional: Rt,
580
- adapter: ["xhr", "http", "fetch"],
581
- transformRequest: [
582
- function(t, n) {
583
- const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, i = c.isObject(t);
584
- if (i && c.isHTMLForm(t) && (t = new FormData(t)), c.isFormData(t))
585
- return s ? JSON.stringify(yn(t)) : t;
586
- if (c.isArrayBuffer(t) || c.isBuffer(t) || c.isStream(t) || c.isFile(t) || c.isBlob(t) || c.isReadableStream(t))
587
- return t;
588
- if (c.isArrayBufferView(t))
589
- return t.buffer;
590
- if (c.isURLSearchParams(t))
591
- return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
592
- let a;
593
- if (i) {
594
- if (r.indexOf("application/x-www-form-urlencoded") > -1)
595
- return Wr(t, this.formSerializer).toString();
596
- if ((a = c.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
597
- const d = this.env && this.env.FormData;
598
- return He(
599
- a ? { "files[]": t } : t,
600
- d && new d(),
601
- this.formSerializer
602
- );
603
- }
604
- }
605
- return i || s ? (n.setContentType("application/json", !1), Kr(t)) : t;
606
- }
607
- ],
608
- transformResponse: [
609
- function(t) {
610
- const n = this.transitional || Ae.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
611
- if (c.isResponse(t) || c.isReadableStream(t))
612
- return t;
613
- if (t && c.isString(t) && (r && !this.responseType || s)) {
614
- const o = !(n && n.silentJSONParsing) && s;
615
- try {
616
- return JSON.parse(t, this.parseReviver);
617
- } catch (a) {
618
- if (o)
619
- throw a.name === "SyntaxError" ? R.from(a, R.ERR_BAD_RESPONSE, this, null, this.response) : a;
620
- }
621
- }
622
- return t;
623
- }
624
- ],
625
- /**
626
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
627
- * timeout is not created.
628
- */
629
- timeout: 0,
630
- xsrfCookieName: "XSRF-TOKEN",
631
- xsrfHeaderName: "X-XSRF-TOKEN",
632
- maxContentLength: -1,
633
- maxBodyLength: -1,
634
- env: {
635
- FormData: B.classes.FormData,
636
- Blob: B.classes.Blob
637
- },
638
- validateStatus: function(t) {
639
- return t >= 200 && t < 300;
640
- },
641
- headers: {
642
- common: {
643
- Accept: "application/json, text/plain, */*",
644
- "Content-Type": void 0
645
- }
646
- }
647
- };
648
- c.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
649
- Ae.headers[e] = {};
650
- });
651
- const Gr = c.toObjectSet([
652
- "age",
653
- "authorization",
654
- "content-length",
655
- "content-type",
656
- "etag",
657
- "expires",
658
- "from",
659
- "host",
660
- "if-modified-since",
661
- "if-unmodified-since",
662
- "last-modified",
663
- "location",
664
- "max-forwards",
665
- "proxy-authorization",
666
- "referer",
667
- "retry-after",
668
- "user-agent"
669
- ]), Xr = (e) => {
670
- const t = {};
671
- let n, r, s;
672
- return e && e.split(`
673
- `).forEach(function(o) {
674
- s = o.indexOf(":"), n = o.substring(0, s).trim().toLowerCase(), r = o.substring(s + 1).trim(), !(!n || t[n] && Gr[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
675
- }), t;
676
- }, Ut = /* @__PURE__ */ Symbol("internals");
677
- function be(e) {
678
- return e && String(e).trim().toLowerCase();
679
- }
680
- function Ie(e) {
681
- return e === !1 || e == null ? e : c.isArray(e) ? e.map(Ie) : String(e).replace(/[\r\n]+$/, "");
682
- }
683
- function Yr(e) {
684
- const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
685
- let r;
686
- for (; r = n.exec(e); )
687
- t[r[1]] = r[2];
688
- return t;
689
- }
690
- const Qr = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
691
- function Ke(e, t, n, r, s) {
692
- if (c.isFunction(r))
693
- return r.call(this, t, n);
694
- if (s && (t = n), !!c.isString(t)) {
695
- if (c.isString(r))
696
- return t.indexOf(r) !== -1;
697
- if (c.isRegExp(r))
698
- return r.test(t);
699
- }
700
- }
701
- function Zr(e) {
702
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
703
- }
704
- function es(e, t) {
705
- const n = c.toCamelCase(" " + t);
706
- ["get", "set", "has"].forEach((r) => {
707
- Object.defineProperty(e, r + n, {
708
- value: function(s, i, o) {
709
- return this[r].call(this, t, s, i, o);
710
- },
711
- configurable: !0
712
- });
713
- });
714
- }
715
- let k = class {
716
- constructor(t) {
717
- t && this.set(t);
718
- }
719
- set(t, n, r) {
720
- const s = this;
721
- function i(a, d, f) {
722
- const l = be(d);
723
- if (!l)
724
- throw new Error("header name must be a non-empty string");
725
- const p = c.findKey(s, l);
726
- (!p || s[p] === void 0 || f === !0 || f === void 0 && s[p] !== !1) && (s[p || d] = Ie(a));
727
- }
728
- const o = (a, d) => c.forEach(a, (f, l) => i(f, l, d));
729
- if (c.isPlainObject(t) || t instanceof this.constructor)
730
- o(t, n);
731
- else if (c.isString(t) && (t = t.trim()) && !Qr(t))
732
- o(Xr(t), n);
733
- else if (c.isObject(t) && c.isIterable(t)) {
734
- let a = {}, d, f;
735
- for (const l of t) {
736
- if (!c.isArray(l))
737
- throw TypeError("Object iterator must return a key-value pair");
738
- a[f = l[0]] = (d = a[f]) ? c.isArray(d) ? [...d, l[1]] : [d, l[1]] : l[1];
739
- }
740
- o(a, n);
741
- } else
742
- t != null && i(n, t, r);
743
- return this;
744
- }
745
- get(t, n) {
746
- if (t = be(t), t) {
747
- const r = c.findKey(this, t);
748
- if (r) {
749
- const s = this[r];
750
- if (!n)
751
- return s;
752
- if (n === !0)
753
- return Yr(s);
754
- if (c.isFunction(n))
755
- return n.call(this, s, r);
756
- if (c.isRegExp(n))
757
- return n.exec(s);
758
- throw new TypeError("parser must be boolean|regexp|function");
759
- }
760
- }
761
- }
762
- has(t, n) {
763
- if (t = be(t), t) {
764
- const r = c.findKey(this, t);
765
- return !!(r && this[r] !== void 0 && (!n || Ke(this, this[r], r, n)));
766
- }
767
- return !1;
768
- }
769
- delete(t, n) {
770
- const r = this;
771
- let s = !1;
772
- function i(o) {
773
- if (o = be(o), o) {
774
- const a = c.findKey(r, o);
775
- a && (!n || Ke(r, r[a], a, n)) && (delete r[a], s = !0);
776
- }
777
- }
778
- return c.isArray(t) ? t.forEach(i) : i(t), s;
779
- }
780
- clear(t) {
781
- const n = Object.keys(this);
782
- let r = n.length, s = !1;
783
- for (; r--; ) {
784
- const i = n[r];
785
- (!t || Ke(this, this[i], i, t, !0)) && (delete this[i], s = !0);
786
- }
787
- return s;
788
- }
789
- normalize(t) {
790
- const n = this, r = {};
791
- return c.forEach(this, (s, i) => {
792
- const o = c.findKey(r, i);
793
- if (o) {
794
- n[o] = Ie(s), delete n[i];
795
- return;
796
- }
797
- const a = t ? Zr(i) : String(i).trim();
798
- a !== i && delete n[i], n[a] = Ie(s), r[a] = !0;
799
- }), this;
800
- }
801
- concat(...t) {
802
- return this.constructor.concat(this, ...t);
803
- }
804
- toJSON(t) {
805
- const n = /* @__PURE__ */ Object.create(null);
806
- return c.forEach(this, (r, s) => {
807
- r != null && r !== !1 && (n[s] = t && c.isArray(r) ? r.join(", ") : r);
808
- }), n;
809
- }
810
- [Symbol.iterator]() {
811
- return Object.entries(this.toJSON())[Symbol.iterator]();
812
- }
813
- toString() {
814
- return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
815
- `);
816
- }
817
- getSetCookie() {
818
- return this.get("set-cookie") || [];
819
- }
820
- get [Symbol.toStringTag]() {
821
- return "AxiosHeaders";
822
- }
823
- static from(t) {
824
- return t instanceof this ? t : new this(t);
825
- }
826
- static concat(t, ...n) {
827
- const r = new this(t);
828
- return n.forEach((s) => r.set(s)), r;
829
- }
830
- static accessor(t) {
831
- const r = (this[Ut] = this[Ut] = {
832
- accessors: {}
833
- }).accessors, s = this.prototype;
834
- function i(o) {
835
- const a = be(o);
836
- r[a] || (es(s, o), r[a] = !0);
837
- }
838
- return c.isArray(t) ? t.forEach(i) : i(t), this;
839
- }
840
- };
841
- k.accessor([
842
- "Content-Type",
843
- "Content-Length",
844
- "Accept",
845
- "Accept-Encoding",
846
- "User-Agent",
847
- "Authorization"
848
- ]);
849
- c.reduceDescriptors(k.prototype, ({ value: e }, t) => {
850
- let n = t[0].toUpperCase() + t.slice(1);
851
- return {
852
- get: () => e,
853
- set(r) {
854
- this[n] = r;
855
- }
856
- };
857
- });
858
- c.freezeMethods(k);
859
- function Ge(e, t) {
860
- const n = this || Ae, r = t || n, s = k.from(r.headers);
861
- let i = r.data;
862
- return c.forEach(e, function(a) {
863
- i = a.call(n, i, s.normalize(), t ? t.status : void 0);
864
- }), s.normalize(), i;
865
- }
866
- function wn(e) {
867
- return !!(e && e.__CANCEL__);
868
- }
869
- let Ce = class extends R {
870
- /**
871
- * A `CanceledError` is an object that is thrown when an operation is canceled.
872
- *
873
- * @param {string=} message The message.
874
- * @param {Object=} config The config.
875
- * @param {Object=} request The request.
876
- *
877
- * @returns {CanceledError} The created error.
878
- */
879
- constructor(t, n, r) {
880
- super(t ?? "canceled", R.ERR_CANCELED, n, r), this.name = "CanceledError", this.__CANCEL__ = !0;
881
- }
882
- };
883
- function Rn(e, t, n) {
884
- const r = n.config.validateStatus;
885
- !n.status || !r || r(n.status) ? e(n) : t(
886
- new R(
887
- "Request failed with status code " + n.status,
888
- [R.ERR_BAD_REQUEST, R.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
889
- n.config,
890
- n.request,
891
- n
892
- )
893
- );
894
- }
895
- function ts(e) {
896
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
897
- return t && t[1] || "";
898
- }
899
- function ns(e, t) {
900
- e = e || 10;
901
- const n = new Array(e), r = new Array(e);
902
- let s = 0, i = 0, o;
903
- return t = t !== void 0 ? t : 1e3, function(d) {
904
- const f = Date.now(), l = r[i];
905
- o || (o = f), n[s] = d, r[s] = f;
906
- let p = i, E = 0;
907
- for (; p !== s; )
908
- E += n[p++], p = p % e;
909
- if (s = (s + 1) % e, s === i && (i = (i + 1) % e), f - o < t)
910
- return;
911
- const y = l && f - l;
912
- return y ? Math.round(E * 1e3 / y) : void 0;
913
- };
914
- }
915
- function rs(e, t) {
916
- let n = 0, r = 1e3 / t, s, i;
917
- const o = (f, l = Date.now()) => {
918
- n = l, s = null, i && (clearTimeout(i), i = null), e(...f);
919
- };
920
- return [(...f) => {
921
- const l = Date.now(), p = l - n;
922
- p >= r ? o(f, l) : (s = f, i || (i = setTimeout(() => {
923
- i = null, o(s);
924
- }, r - p)));
925
- }, () => s && o(s)];
926
- }
927
- const je = (e, t, n = 3) => {
928
- let r = 0;
929
- const s = ns(50, 250);
930
- return rs((i) => {
931
- const o = i.loaded, a = i.lengthComputable ? i.total : void 0, d = o - r, f = s(d), l = o <= a;
932
- r = o;
933
- const p = {
934
- loaded: o,
935
- total: a,
936
- progress: a ? o / a : void 0,
937
- bytes: d,
938
- rate: f || void 0,
939
- estimated: f && a && l ? (a - o) / f : void 0,
940
- event: i,
941
- lengthComputable: a != null,
942
- [t ? "download" : "upload"]: !0
943
- };
944
- e(p);
945
- }, n);
946
- }, It = (e, t) => {
947
- const n = e != null;
948
- return [
949
- (r) => t[0]({
950
- lengthComputable: n,
951
- total: e,
952
- loaded: r
953
- }),
954
- t[1]
955
- ];
956
- }, Bt = (e) => (...t) => c.asap(() => e(...t)), ss = B.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, B.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
957
- new URL(B.origin),
958
- B.navigator && /(msie|trident)/i.test(B.navigator.userAgent)
959
- ) : () => !0, os = B.hasStandardBrowserEnv ? (
960
- // Standard browser envs support document.cookie
961
- {
962
- write(e, t, n, r, s, i, o) {
963
- if (typeof document > "u") return;
964
- const a = [`${e}=${encodeURIComponent(t)}`];
965
- c.isNumber(n) && a.push(`expires=${new Date(n).toUTCString()}`), c.isString(r) && a.push(`path=${r}`), c.isString(s) && a.push(`domain=${s}`), i === !0 && a.push("secure"), c.isString(o) && a.push(`SameSite=${o}`), document.cookie = a.join("; ");
966
- },
967
- read(e) {
968
- if (typeof document > "u") return null;
969
- const t = document.cookie.match(new RegExp("(?:^|; )" + e + "=([^;]*)"));
970
- return t ? decodeURIComponent(t[1]) : null;
971
- },
972
- remove(e) {
973
- this.write(e, "", Date.now() - 864e5, "/");
974
- }
975
- }
976
- ) : (
977
- // Non-standard browser env (web workers, react-native) lack needed support.
978
- {
979
- write() {
980
- },
981
- read() {
982
- return null;
983
- },
984
- remove() {
985
- }
986
- }
987
- );
988
- function is(e) {
989
- return typeof e != "string" ? !1 : /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
990
- }
991
- function as(e, t) {
992
- return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
993
- }
994
- function Sn(e, t, n) {
995
- let r = !is(t);
996
- return e && (r || n == !1) ? as(e, t) : t;
997
- }
998
- const jt = (e) => e instanceof k ? { ...e } : e;
999
- function pe(e, t) {
1000
- t = t || {};
1001
- const n = {};
1002
- function r(f, l, p, E) {
1003
- return c.isPlainObject(f) && c.isPlainObject(l) ? c.merge.call({ caseless: E }, f, l) : c.isPlainObject(l) ? c.merge({}, l) : c.isArray(l) ? l.slice() : l;
1004
- }
1005
- function s(f, l, p, E) {
1006
- if (c.isUndefined(l)) {
1007
- if (!c.isUndefined(f))
1008
- return r(void 0, f, p, E);
1009
- } else return r(f, l, p, E);
1010
- }
1011
- function i(f, l) {
1012
- if (!c.isUndefined(l))
1013
- return r(void 0, l);
1014
- }
1015
- function o(f, l) {
1016
- if (c.isUndefined(l)) {
1017
- if (!c.isUndefined(f))
1018
- return r(void 0, f);
1019
- } else return r(void 0, l);
1020
- }
1021
- function a(f, l, p) {
1022
- if (p in t)
1023
- return r(f, l);
1024
- if (p in e)
1025
- return r(void 0, f);
1026
- }
1027
- const d = {
1028
- url: i,
1029
- method: i,
1030
- data: i,
1031
- baseURL: o,
1032
- transformRequest: o,
1033
- transformResponse: o,
1034
- paramsSerializer: o,
1035
- timeout: o,
1036
- timeoutMessage: o,
1037
- withCredentials: o,
1038
- withXSRFToken: o,
1039
- adapter: o,
1040
- responseType: o,
1041
- xsrfCookieName: o,
1042
- xsrfHeaderName: o,
1043
- onUploadProgress: o,
1044
- onDownloadProgress: o,
1045
- decompress: o,
1046
- maxContentLength: o,
1047
- maxBodyLength: o,
1048
- beforeRedirect: o,
1049
- transport: o,
1050
- httpAgent: o,
1051
- httpsAgent: o,
1052
- cancelToken: o,
1053
- socketPath: o,
1054
- responseEncoding: o,
1055
- validateStatus: a,
1056
- headers: (f, l, p) => s(jt(f), jt(l), p, !0)
1057
- };
1058
- return c.forEach(Object.keys({ ...e, ...t }), function(l) {
1059
- if (l === "__proto__" || l === "constructor" || l === "prototype") return;
1060
- const p = c.hasOwnProp(d, l) ? d[l] : s, E = p(e[l], t[l], l);
1061
- c.isUndefined(E) && p !== a || (n[l] = E);
1062
- }), n;
1063
- }
1064
- const bn = (e) => {
1065
- const t = pe({}, e);
1066
- let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: i, headers: o, auth: a } = t;
1067
- if (t.headers = o = k.from(o), t.url = En(
1068
- Sn(t.baseURL, t.url, t.allowAbsoluteUrls),
1069
- e.params,
1070
- e.paramsSerializer
1071
- ), a && o.set(
1072
- "Authorization",
1073
- "Basic " + btoa(
1074
- (a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : "")
1075
- )
1076
- ), c.isFormData(n)) {
1077
- if (B.hasStandardBrowserEnv || B.hasStandardBrowserWebWorkerEnv)
1078
- o.setContentType(void 0);
1079
- else if (c.isFunction(n.getHeaders)) {
1080
- const d = n.getHeaders(), f = ["content-type", "content-length"];
1081
- Object.entries(d).forEach(([l, p]) => {
1082
- f.includes(l.toLowerCase()) && o.set(l, p);
1083
- });
1084
- }
1085
- }
1086
- if (B.hasStandardBrowserEnv && (r && c.isFunction(r) && (r = r(t)), r || r !== !1 && ss(t.url))) {
1087
- const d = s && i && os.read(i);
1088
- d && o.set(s, d);
1089
- }
1090
- return t;
1091
- }, cs = typeof XMLHttpRequest < "u", us = cs && function(e) {
1092
- return new Promise(function(n, r) {
1093
- const s = bn(e);
1094
- let i = s.data;
1095
- const o = k.from(s.headers).normalize();
1096
- let { responseType: a, onUploadProgress: d, onDownloadProgress: f } = s, l, p, E, y, u;
1097
- function m() {
1098
- y && y(), u && u(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
1099
- }
1100
- let h = new XMLHttpRequest();
1101
- h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
1102
- function S() {
1103
- if (!h)
1104
- return;
1105
- const _ = k.from(
1106
- "getAllResponseHeaders" in h && h.getAllResponseHeaders()
1107
- ), g = {
1108
- data: !a || a === "text" || a === "json" ? h.responseText : h.response,
1109
- status: h.status,
1110
- statusText: h.statusText,
1111
- headers: _,
1112
- config: e,
1113
- request: h
1114
- };
1115
- Rn(
1116
- function(A) {
1117
- n(A), m();
1118
- },
1119
- function(A) {
1120
- r(A), m();
1121
- },
1122
- g
1123
- ), h = null;
1124
- }
1125
- "onloadend" in h ? h.onloadend = S : h.onreadystatechange = function() {
1126
- !h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(S);
1127
- }, h.onabort = function() {
1128
- h && (r(new R("Request aborted", R.ECONNABORTED, e, h)), h = null);
1129
- }, h.onerror = function(x) {
1130
- const g = x && x.message ? x.message : "Network Error", v = new R(g, R.ERR_NETWORK, e, h);
1131
- v.event = x || null, r(v), h = null;
1132
- }, h.ontimeout = function() {
1133
- let x = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
1134
- const g = s.transitional || Rt;
1135
- s.timeoutErrorMessage && (x = s.timeoutErrorMessage), r(
1136
- new R(
1137
- x,
1138
- g.clarifyTimeoutError ? R.ETIMEDOUT : R.ECONNABORTED,
1139
- e,
1140
- h
1141
- )
1142
- ), h = null;
1143
- }, i === void 0 && o.setContentType(null), "setRequestHeader" in h && c.forEach(o.toJSON(), function(x, g) {
1144
- h.setRequestHeader(g, x);
1145
- }), c.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), a && a !== "json" && (h.responseType = s.responseType), f && ([E, u] = je(f, !0), h.addEventListener("progress", E)), d && h.upload && ([p, y] = je(d), h.upload.addEventListener("progress", p), h.upload.addEventListener("loadend", y)), (s.cancelToken || s.signal) && (l = (_) => {
1146
- h && (r(!_ || _.type ? new Ce(null, e, h) : _), h.abort(), h = null);
1147
- }, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
1148
- const w = ts(s.url);
1149
- if (w && B.protocols.indexOf(w) === -1) {
1150
- r(
1151
- new R(
1152
- "Unsupported protocol " + w + ":",
1153
- R.ERR_BAD_REQUEST,
1154
- e
1155
- )
1156
- );
1157
- return;
1158
- }
1159
- h.send(i || null);
1160
- });
1161
- }, ls = (e, t) => {
1162
- const { length: n } = e = e ? e.filter(Boolean) : [];
1163
- if (t || n) {
1164
- let r = new AbortController(), s;
1165
- const i = function(f) {
1166
- if (!s) {
1167
- s = !0, a();
1168
- const l = f instanceof Error ? f : this.reason;
1169
- r.abort(
1170
- l instanceof R ? l : new Ce(l instanceof Error ? l.message : l)
1171
- );
1172
- }
1173
- };
1174
- let o = t && setTimeout(() => {
1175
- o = null, i(new R(`timeout of ${t}ms exceeded`, R.ETIMEDOUT));
1176
- }, t);
1177
- const a = () => {
1178
- e && (o && clearTimeout(o), o = null, e.forEach((f) => {
1179
- f.unsubscribe ? f.unsubscribe(i) : f.removeEventListener("abort", i);
1180
- }), e = null);
1181
- };
1182
- e.forEach((f) => f.addEventListener("abort", i));
1183
- const { signal: d } = r;
1184
- return d.unsubscribe = () => c.asap(a), d;
1185
- }
1186
- }, fs = function* (e, t) {
1187
- let n = e.byteLength;
1188
- if (n < t) {
1189
- yield e;
1190
- return;
1191
- }
1192
- let r = 0, s;
1193
- for (; r < n; )
1194
- s = r + t, yield e.slice(r, s), r = s;
1195
- }, ds = async function* (e, t) {
1196
- for await (const n of ps(e))
1197
- yield* fs(n, t);
1198
- }, ps = async function* (e) {
1199
- if (e[Symbol.asyncIterator]) {
1200
- yield* e;
1201
- return;
1202
- }
1203
- const t = e.getReader();
1204
- try {
1205
- for (; ; ) {
1206
- const { done: n, value: r } = await t.read();
1207
- if (n)
1208
- break;
1209
- yield r;
1210
- }
1211
- } finally {
1212
- await t.cancel();
1213
- }
1214
- }, qt = (e, t, n, r) => {
1215
- const s = ds(e, t);
1216
- let i = 0, o, a = (d) => {
1217
- o || (o = !0, r && r(d));
1218
- };
1219
- return new ReadableStream(
1220
- {
1221
- async pull(d) {
1222
- try {
1223
- const { done: f, value: l } = await s.next();
1224
- if (f) {
1225
- a(), d.close();
1226
- return;
1227
- }
1228
- let p = l.byteLength;
1229
- if (n) {
1230
- let E = i += p;
1231
- n(E);
1232
- }
1233
- d.enqueue(new Uint8Array(l));
1234
- } catch (f) {
1235
- throw a(f), f;
1236
- }
1237
- },
1238
- cancel(d) {
1239
- return a(d), s.return();
1240
- }
1241
- },
1242
- {
1243
- highWaterMark: 2
1244
- }
1245
- );
1246
- }, kt = 64 * 1024, { isFunction: Le } = c, hs = (({ Request: e, Response: t }) => ({
1247
- Request: e,
1248
- Response: t
1249
- }))(c.global), { ReadableStream: Mt, TextEncoder: Ht } = c.global, Vt = (e, ...t) => {
1250
- try {
1251
- return !!e(...t);
1252
- } catch {
1253
- return !1;
1254
- }
1255
- }, ms = (e) => {
1256
- e = c.merge.call(
1257
- {
1258
- skipUndefined: !0
1259
- },
1260
- hs,
1261
- e
1262
- );
1263
- const { fetch: t, Request: n, Response: r } = e, s = t ? Le(t) : typeof fetch == "function", i = Le(n), o = Le(r);
1264
- if (!s)
1265
- return !1;
1266
- const a = s && Le(Mt), d = s && (typeof Ht == "function" ? /* @__PURE__ */ ((u) => (m) => u.encode(m))(new Ht()) : async (u) => new Uint8Array(await new n(u).arrayBuffer())), f = i && a && Vt(() => {
1267
- let u = !1;
1268
- const m = new Mt(), h = new n(B.origin, {
1269
- body: m,
1270
- method: "POST",
1271
- get duplex() {
1272
- return u = !0, "half";
1273
- }
1274
- }).headers.has("Content-Type");
1275
- return m.cancel(), u && !h;
1276
- }), l = o && a && Vt(() => c.isReadableStream(new r("").body)), p = {
1277
- stream: l && ((u) => u.body)
1278
- };
1279
- s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((u) => {
1280
- !p[u] && (p[u] = (m, h) => {
1281
- let S = m && m[u];
1282
- if (S)
1283
- return S.call(m);
1284
- throw new R(
1285
- `Response type '${u}' is not supported`,
1286
- R.ERR_NOT_SUPPORT,
1287
- h
1288
- );
1289
- });
1290
- });
1291
- const E = async (u) => {
1292
- if (u == null)
1293
- return 0;
1294
- if (c.isBlob(u))
1295
- return u.size;
1296
- if (c.isSpecCompliantForm(u))
1297
- return (await new n(B.origin, {
1298
- method: "POST",
1299
- body: u
1300
- }).arrayBuffer()).byteLength;
1301
- if (c.isArrayBufferView(u) || c.isArrayBuffer(u))
1302
- return u.byteLength;
1303
- if (c.isURLSearchParams(u) && (u = u + ""), c.isString(u))
1304
- return (await d(u)).byteLength;
1305
- }, y = async (u, m) => {
1306
- const h = c.toFiniteNumber(u.getContentLength());
1307
- return h ?? E(m);
1308
- };
1309
- return async (u) => {
1310
- let {
1311
- url: m,
1312
- method: h,
1313
- data: S,
1314
- signal: w,
1315
- cancelToken: _,
1316
- timeout: x,
1317
- onDownloadProgress: g,
1318
- onUploadProgress: v,
1319
- responseType: A,
1320
- headers: Y,
1321
- withCredentials: O = "same-origin",
1322
- fetchOptions: ee
1323
- } = bn(u), M = t || fetch;
1324
- A = A ? (A + "").toLowerCase() : "text";
1325
- let z = ls(
1326
- [w, _ && _.toAbortSignal()],
1327
- x
1328
- ), H = null;
1329
- const P = z && z.unsubscribe && (() => {
1330
- z.unsubscribe();
1331
- });
1332
- let te;
1333
- try {
1334
- if (v && f && h !== "get" && h !== "head" && (te = await y(Y, S)) !== 0) {
1335
- let Q = new n(m, {
1336
- method: "POST",
1337
- body: S,
1338
- duplex: "half"
1339
- }), V;
1340
- if (c.isFormData(S) && (V = Q.headers.get("content-type")) && Y.setContentType(V), Q.body) {
1341
- const [K, re] = It(
1342
- te,
1343
- je(Bt(v))
1344
- );
1345
- S = qt(Q.body, kt, K, re);
1346
- }
1347
- }
1348
- c.isString(O) || (O = O ? "include" : "omit");
1349
- const F = i && "credentials" in n.prototype, Re = {
1350
- ...ee,
1351
- signal: z,
1352
- method: h.toUpperCase(),
1353
- headers: Y.normalize().toJSON(),
1354
- body: S,
1355
- duplex: "half",
1356
- credentials: F ? O : void 0
1357
- };
1358
- H = i && new n(m, Re);
1359
- let J = await (i ? M(H, ee) : M(m, Re));
1360
- const ne = l && (A === "stream" || A === "response");
1361
- if (l && (g || ne && P)) {
1362
- const Q = {};
1363
- ["status", "statusText", "headers"].forEach((he) => {
1364
- Q[he] = J[he];
1365
- });
1366
- const V = c.toFiniteNumber(J.headers.get("content-length")), [K, re] = g && It(
1367
- V,
1368
- je(Bt(g), !0)
1369
- ) || [];
1370
- J = new r(
1371
- qt(J.body, kt, K, () => {
1372
- re && re(), P && P();
1373
- }),
1374
- Q
1375
- );
1376
- }
1377
- A = A || "text";
1378
- let De = await p[c.findKey(p, A) || "text"](
1379
- J,
1380
- u
1381
- );
1382
- return !ne && P && P(), await new Promise((Q, V) => {
1383
- Rn(Q, V, {
1384
- data: De,
1385
- headers: k.from(J.headers),
1386
- status: J.status,
1387
- statusText: J.statusText,
1388
- config: u,
1389
- request: H
1390
- });
1391
- });
1392
- } catch (F) {
1393
- throw P && P(), F && F.name === "TypeError" && /Load failed|fetch/i.test(F.message) ? Object.assign(
1394
- new R(
1395
- "Network Error",
1396
- R.ERR_NETWORK,
1397
- u,
1398
- H,
1399
- F && F.response
1400
- ),
1401
- {
1402
- cause: F.cause || F
1403
- }
1404
- ) : R.from(F, F && F.code, u, H, F && F.response);
1405
- }
1406
- };
1407
- }, Es = /* @__PURE__ */ new Map(), gn = (e) => {
1408
- let t = e && e.env || {};
1409
- const { fetch: n, Request: r, Response: s } = t, i = [r, s, n];
1410
- let o = i.length, a = o, d, f, l = Es;
1411
- for (; a--; )
1412
- d = i[a], f = l.get(d), f === void 0 && l.set(d, f = a ? /* @__PURE__ */ new Map() : ms(t)), l = f;
1413
- return f;
1414
- };
1415
- gn();
1416
- const bt = {
1417
- http: Fr,
1418
- xhr: us,
1419
- fetch: {
1420
- get: gn
1421
- }
1422
- };
1423
- c.forEach(bt, (e, t) => {
1424
- if (e) {
1425
- try {
1426
- Object.defineProperty(e, "name", { value: t });
1427
- } catch {
1428
- }
1429
- Object.defineProperty(e, "adapterName", { value: t });
1430
- }
1431
- });
1432
- const $t = (e) => `- ${e}`, ys = (e) => c.isFunction(e) || e === null || e === !1;
1433
- function ws(e, t) {
1434
- e = c.isArray(e) ? e : [e];
1435
- const { length: n } = e;
1436
- let r, s;
1437
- const i = {};
1438
- for (let o = 0; o < n; o++) {
1439
- r = e[o];
1440
- let a;
1441
- if (s = r, !ys(r) && (s = bt[(a = String(r)).toLowerCase()], s === void 0))
1442
- throw new R(`Unknown adapter '${a}'`);
1443
- if (s && (c.isFunction(s) || (s = s.get(t))))
1444
- break;
1445
- i[a || "#" + o] = s;
1446
- }
1447
- if (!s) {
1448
- const o = Object.entries(i).map(
1449
- ([d, f]) => `adapter ${d} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
1450
- );
1451
- let a = n ? o.length > 1 ? `since :
1452
- ` + o.map($t).join(`
1453
- `) : " " + $t(o[0]) : "as no adapter specified";
1454
- throw new R(
1455
- "There is no suitable adapter to dispatch the request " + a,
1456
- "ERR_NOT_SUPPORT"
1457
- );
1458
- }
1459
- return s;
1460
- }
1461
- const On = {
1462
- /**
1463
- * Resolve an adapter from a list of adapter names or functions.
1464
- * @type {Function}
1465
- */
1466
- getAdapter: ws,
1467
- /**
1468
- * Exposes all known adapters
1469
- * @type {Object<string, Function|Object>}
1470
- */
1471
- adapters: bt
1472
- };
1473
- function Xe(e) {
1474
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1475
- throw new Ce(null, e);
1476
- }
1477
- function Wt(e) {
1478
- return Xe(e), e.headers = k.from(e.headers), e.data = Ge.call(e, e.transformRequest), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), On.getAdapter(e.adapter || Ae.adapter, e)(e).then(
1479
- function(r) {
1480
- return Xe(e), r.data = Ge.call(e, e.transformResponse, r), r.headers = k.from(r.headers), r;
1481
- },
1482
- function(r) {
1483
- return wn(r) || (Xe(e), r && r.response && (r.response.data = Ge.call(
1484
- e,
1485
- e.transformResponse,
1486
- r.response
1487
- ), r.response.headers = k.from(r.response.headers))), Promise.reject(r);
1488
- }
1489
- );
1490
- }
1491
- const Tn = "1.14.0", Ve = {};
1492
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1493
- Ve[e] = function(r) {
1494
- return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1495
- };
1496
- });
1497
- const zt = {};
1498
- Ve.transitional = function(t, n, r) {
1499
- function s(i, o) {
1500
- return "[Axios v" + Tn + "] Transitional option '" + i + "'" + o + (r ? ". " + r : "");
1501
- }
1502
- return (i, o, a) => {
1503
- if (t === !1)
1504
- throw new R(
1505
- s(o, " has been removed" + (n ? " in " + n : "")),
1506
- R.ERR_DEPRECATED
1507
- );
1508
- return n && !zt[o] && (zt[o] = !0, console.warn(
1509
- s(
1510
- o,
1511
- " has been deprecated since v" + n + " and will be removed in the near future"
1512
- )
1513
- )), t ? t(i, o, a) : !0;
1514
- };
1515
- };
1516
- Ve.spelling = function(t) {
1517
- return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
1518
- };
1519
- function Rs(e, t, n) {
1520
- if (typeof e != "object")
1521
- throw new R("options must be an object", R.ERR_BAD_OPTION_VALUE);
1522
- const r = Object.keys(e);
1523
- let s = r.length;
1524
- for (; s-- > 0; ) {
1525
- const i = r[s], o = t[i];
1526
- if (o) {
1527
- const a = e[i], d = a === void 0 || o(a, i, e);
1528
- if (d !== !0)
1529
- throw new R(
1530
- "option " + i + " must be " + d,
1531
- R.ERR_BAD_OPTION_VALUE
1532
- );
1533
- continue;
1534
- }
1535
- if (n !== !0)
1536
- throw new R("Unknown option " + i, R.ERR_BAD_OPTION);
1537
- }
1538
- }
1539
- const Be = {
1540
- assertOptions: Rs,
1541
- validators: Ve
1542
- }, W = Be.validators;
1543
- let de = class {
1544
- constructor(t) {
1545
- this.defaults = t || {}, this.interceptors = {
1546
- request: new vt(),
1547
- response: new vt()
1548
- };
1549
- }
1550
- /**
1551
- * Dispatch a request
1552
- *
1553
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1554
- * @param {?Object} config
1555
- *
1556
- * @returns {Promise} The Promise to be fulfilled
1557
- */
1558
- async request(t, n) {
1559
- try {
1560
- return await this._request(t, n);
1561
- } catch (r) {
1562
- if (r instanceof Error) {
1563
- let s = {};
1564
- Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
1565
- const i = s.stack ? s.stack.replace(/^.+\n/, "") : "";
1566
- try {
1567
- r.stack ? i && !String(r.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (r.stack += `
1568
- ` + i) : r.stack = i;
1569
- } catch {
1570
- }
1571
- }
1572
- throw r;
1573
- }
1574
- }
1575
- _request(t, n) {
1576
- typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = pe(this.defaults, n);
1577
- const { transitional: r, paramsSerializer: s, headers: i } = n;
1578
- r !== void 0 && Be.assertOptions(
1579
- r,
1580
- {
1581
- silentJSONParsing: W.transitional(W.boolean),
1582
- forcedJSONParsing: W.transitional(W.boolean),
1583
- clarifyTimeoutError: W.transitional(W.boolean),
1584
- legacyInterceptorReqResOrdering: W.transitional(W.boolean)
1585
- },
1586
- !1
1587
- ), s != null && (c.isFunction(s) ? n.paramsSerializer = {
1588
- serialize: s
1589
- } : Be.assertOptions(
1590
- s,
1591
- {
1592
- encode: W.function,
1593
- serialize: W.function
1594
- },
1595
- !0
1596
- )), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Be.assertOptions(
1597
- n,
1598
- {
1599
- baseUrl: W.spelling("baseURL"),
1600
- withXsrfToken: W.spelling("withXSRFToken")
1601
- },
1602
- !0
1603
- ), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1604
- let o = i && c.merge(i.common, i[n.method]);
1605
- i && c.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (u) => {
1606
- delete i[u];
1607
- }), n.headers = k.concat(o, i);
1608
- const a = [];
1609
- let d = !0;
1610
- this.interceptors.request.forEach(function(m) {
1611
- if (typeof m.runWhen == "function" && m.runWhen(n) === !1)
1612
- return;
1613
- d = d && m.synchronous;
1614
- const h = n.transitional || Rt;
1615
- h && h.legacyInterceptorReqResOrdering ? a.unshift(m.fulfilled, m.rejected) : a.push(m.fulfilled, m.rejected);
1616
- });
1617
- const f = [];
1618
- this.interceptors.response.forEach(function(m) {
1619
- f.push(m.fulfilled, m.rejected);
1620
- });
1621
- let l, p = 0, E;
1622
- if (!d) {
1623
- const u = [Wt.bind(this), void 0];
1624
- for (u.unshift(...a), u.push(...f), E = u.length, l = Promise.resolve(n); p < E; )
1625
- l = l.then(u[p++], u[p++]);
1626
- return l;
1627
- }
1628
- E = a.length;
1629
- let y = n;
1630
- for (; p < E; ) {
1631
- const u = a[p++], m = a[p++];
1632
- try {
1633
- y = u(y);
1634
- } catch (h) {
1635
- m.call(this, h);
1636
- break;
1637
- }
1638
- }
1639
- try {
1640
- l = Wt.call(this, y);
1641
- } catch (u) {
1642
- return Promise.reject(u);
1643
- }
1644
- for (p = 0, E = f.length; p < E; )
1645
- l = l.then(f[p++], f[p++]);
1646
- return l;
1647
- }
1648
- getUri(t) {
1649
- t = pe(this.defaults, t);
1650
- const n = Sn(t.baseURL, t.url, t.allowAbsoluteUrls);
1651
- return En(n, t.params, t.paramsSerializer);
1652
- }
1653
- };
1654
- c.forEach(["delete", "get", "head", "options"], function(t) {
1655
- de.prototype[t] = function(n, r) {
1656
- return this.request(
1657
- pe(r || {}, {
1658
- method: t,
1659
- url: n,
1660
- data: (r || {}).data
1661
- })
1662
- );
1663
- };
1664
- });
1665
- c.forEach(["post", "put", "patch"], function(t) {
1666
- function n(r) {
1667
- return function(i, o, a) {
1668
- return this.request(
1669
- pe(a || {}, {
1670
- method: t,
1671
- headers: r ? {
1672
- "Content-Type": "multipart/form-data"
1673
- } : {},
1674
- url: i,
1675
- data: o
1676
- })
1677
- );
1678
- };
1679
- }
1680
- de.prototype[t] = n(), de.prototype[t + "Form"] = n(!0);
1681
- });
1682
- let Ss = class _n {
1683
- constructor(t) {
1684
- if (typeof t != "function")
1685
- throw new TypeError("executor must be a function.");
1686
- let n;
1687
- this.promise = new Promise(function(i) {
1688
- n = i;
1689
- });
1690
- const r = this;
1691
- this.promise.then((s) => {
1692
- if (!r._listeners) return;
1693
- let i = r._listeners.length;
1694
- for (; i-- > 0; )
1695
- r._listeners[i](s);
1696
- r._listeners = null;
1697
- }), this.promise.then = (s) => {
1698
- let i;
1699
- const o = new Promise((a) => {
1700
- r.subscribe(a), i = a;
1701
- }).then(s);
1702
- return o.cancel = function() {
1703
- r.unsubscribe(i);
1704
- }, o;
1705
- }, t(function(i, o, a) {
1706
- r.reason || (r.reason = new Ce(i, o, a), n(r.reason));
1707
- });
1708
- }
1709
- /**
1710
- * Throws a `CanceledError` if cancellation has been requested.
1711
- */
1712
- throwIfRequested() {
1713
- if (this.reason)
1714
- throw this.reason;
1715
- }
1716
- /**
1717
- * Subscribe to the cancel signal
1718
- */
1719
- subscribe(t) {
1720
- if (this.reason) {
1721
- t(this.reason);
1722
- return;
1723
- }
1724
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
1725
- }
1726
- /**
1727
- * Unsubscribe from the cancel signal
1728
- */
1729
- unsubscribe(t) {
1730
- if (!this._listeners)
1731
- return;
1732
- const n = this._listeners.indexOf(t);
1733
- n !== -1 && this._listeners.splice(n, 1);
1734
- }
1735
- toAbortSignal() {
1736
- const t = new AbortController(), n = (r) => {
1737
- t.abort(r);
1738
- };
1739
- return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
1740
- }
1741
- /**
1742
- * Returns an object that contains a new `CancelToken` and a function that, when called,
1743
- * cancels the `CancelToken`.
1744
- */
1745
- static source() {
1746
- let t;
1747
- return {
1748
- token: new _n(function(s) {
1749
- t = s;
1750
- }),
1751
- cancel: t
1752
- };
1753
- }
1754
- };
1755
- function bs(e) {
1756
- return function(n) {
1757
- return e.apply(null, n);
1758
- };
1759
- }
1760
- function gs(e) {
1761
- return c.isObject(e) && e.isAxiosError === !0;
1762
- }
1763
- const ct = {
1764
- Continue: 100,
1765
- SwitchingProtocols: 101,
1766
- Processing: 102,
1767
- EarlyHints: 103,
1768
- Ok: 200,
1769
- Created: 201,
1770
- Accepted: 202,
1771
- NonAuthoritativeInformation: 203,
1772
- NoContent: 204,
1773
- ResetContent: 205,
1774
- PartialContent: 206,
1775
- MultiStatus: 207,
1776
- AlreadyReported: 208,
1777
- ImUsed: 226,
1778
- MultipleChoices: 300,
1779
- MovedPermanently: 301,
1780
- Found: 302,
1781
- SeeOther: 303,
1782
- NotModified: 304,
1783
- UseProxy: 305,
1784
- Unused: 306,
1785
- TemporaryRedirect: 307,
1786
- PermanentRedirect: 308,
1787
- BadRequest: 400,
1788
- Unauthorized: 401,
1789
- PaymentRequired: 402,
1790
- Forbidden: 403,
1791
- NotFound: 404,
1792
- MethodNotAllowed: 405,
1793
- NotAcceptable: 406,
1794
- ProxyAuthenticationRequired: 407,
1795
- RequestTimeout: 408,
1796
- Conflict: 409,
1797
- Gone: 410,
1798
- LengthRequired: 411,
1799
- PreconditionFailed: 412,
1800
- PayloadTooLarge: 413,
1801
- UriTooLong: 414,
1802
- UnsupportedMediaType: 415,
1803
- RangeNotSatisfiable: 416,
1804
- ExpectationFailed: 417,
1805
- ImATeapot: 418,
1806
- MisdirectedRequest: 421,
1807
- UnprocessableEntity: 422,
1808
- Locked: 423,
1809
- FailedDependency: 424,
1810
- TooEarly: 425,
1811
- UpgradeRequired: 426,
1812
- PreconditionRequired: 428,
1813
- TooManyRequests: 429,
1814
- RequestHeaderFieldsTooLarge: 431,
1815
- UnavailableForLegalReasons: 451,
1816
- InternalServerError: 500,
1817
- NotImplemented: 501,
1818
- BadGateway: 502,
1819
- ServiceUnavailable: 503,
1820
- GatewayTimeout: 504,
1821
- HttpVersionNotSupported: 505,
1822
- VariantAlsoNegotiates: 506,
1823
- InsufficientStorage: 507,
1824
- LoopDetected: 508,
1825
- NotExtended: 510,
1826
- NetworkAuthenticationRequired: 511,
1827
- WebServerIsDown: 521,
1828
- ConnectionTimedOut: 522,
1829
- OriginIsUnreachable: 523,
1830
- TimeoutOccurred: 524,
1831
- SslHandshakeFailed: 525,
1832
- InvalidSslCertificate: 526
1833
- };
1834
- Object.entries(ct).forEach(([e, t]) => {
1835
- ct[t] = e;
1836
- });
1837
- function An(e) {
1838
- const t = new de(e), n = sn(de.prototype.request, t);
1839
- return c.extend(n, de.prototype, t, { allOwnKeys: !0 }), c.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
1840
- return An(pe(e, s));
1841
- }, n;
1842
- }
1843
- const L = An(Ae);
1844
- L.Axios = de;
1845
- L.CanceledError = Ce;
1846
- L.CancelToken = Ss;
1847
- L.isCancel = wn;
1848
- L.VERSION = Tn;
1849
- L.toFormData = He;
1850
- L.AxiosError = R;
1851
- L.Cancel = L.CanceledError;
1852
- L.all = function(t) {
1853
- return Promise.all(t);
1854
- };
1855
- L.spread = bs;
1856
- L.isAxiosError = gs;
1857
- L.mergeConfig = pe;
1858
- L.AxiosHeaders = k;
1859
- L.formToJSON = (e) => yn(c.isHTMLForm(e) ? new FormData(e) : e);
1860
- L.getAdapter = On.getAdapter;
1861
- L.HttpStatusCode = ct;
1862
- L.default = L;
1863
- const {
1864
- Axios: oo,
1865
- AxiosError: io,
1866
- CanceledError: ao,
1867
- isCancel: co,
1868
- CancelToken: uo,
1869
- VERSION: lo,
1870
- all: fo,
1871
- Cancel: po,
1872
- isAxiosError: ho,
1873
- spread: mo,
1874
- toFormData: Eo,
1875
- AxiosHeaders: yo,
1876
- HttpStatusCode: wo,
1877
- formToJSON: Ro,
1878
- getAdapter: So,
1879
- mergeConfig: bo
1880
- } = L;
1881
- var Pe = { exports: {} }, Ye = {};
1882
- var Jt;
1883
- function Os() {
1884
- if (Jt) return Ye;
1885
- Jt = 1;
1886
- var e = ge;
1887
- function t(p, E) {
1888
- return p === E && (p !== 0 || 1 / p === 1 / E) || p !== p && E !== E;
1889
- }
1890
- var n = typeof Object.is == "function" ? Object.is : t, r = e.useState, s = e.useEffect, i = e.useLayoutEffect, o = e.useDebugValue;
1891
- function a(p, E) {
1892
- var y = E(), u = r({ inst: { value: y, getSnapshot: E } }), m = u[0].inst, h = u[1];
1893
- return i(
1894
- function() {
1895
- m.value = y, m.getSnapshot = E, d(m) && h({ inst: m });
1896
- },
1897
- [p, y, E]
1898
- ), s(
1899
- function() {
1900
- return d(m) && h({ inst: m }), p(function() {
1901
- d(m) && h({ inst: m });
1902
- });
1903
- },
1904
- [p]
1905
- ), o(y), y;
1906
- }
1907
- function d(p) {
1908
- var E = p.getSnapshot;
1909
- p = p.value;
1910
- try {
1911
- var y = E();
1912
- return !n(p, y);
1913
- } catch {
1914
- return !0;
1915
- }
1916
- }
1917
- function f(p, E) {
1918
- return E();
1919
- }
1920
- var l = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? f : a;
1921
- return Ye.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : l, Ye;
1922
- }
1923
- var Qe = {};
1924
- var Kt;
1925
- function Ts() {
1926
- return Kt || (Kt = 1, process.env.NODE_ENV !== "production" && (function() {
1927
- function e(y, u) {
1928
- return y === u && (y !== 0 || 1 / y === 1 / u) || y !== y && u !== u;
1929
- }
1930
- function t(y, u) {
1931
- l || s.startTransition === void 0 || (l = !0, console.error(
1932
- "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
1933
- ));
1934
- var m = u();
1935
- if (!p) {
1936
- var h = u();
1937
- i(m, h) || (console.error(
1938
- "The result of getSnapshot should be cached to avoid an infinite loop"
1939
- ), p = !0);
1940
- }
1941
- h = o({
1942
- inst: { value: m, getSnapshot: u }
1943
- });
1944
- var S = h[0].inst, w = h[1];
1945
- return d(
1946
- function() {
1947
- S.value = m, S.getSnapshot = u, n(S) && w({ inst: S });
1948
- },
1949
- [y, m, u]
1950
- ), a(
1951
- function() {
1952
- return n(S) && w({ inst: S }), y(function() {
1953
- n(S) && w({ inst: S });
1954
- });
1955
- },
1956
- [y]
1957
- ), f(m), m;
1958
- }
1959
- function n(y) {
1960
- var u = y.getSnapshot;
1961
- y = y.value;
1962
- try {
1963
- var m = u();
1964
- return !i(y, m);
1965
- } catch {
1966
- return !0;
1967
- }
1968
- }
1969
- function r(y, u) {
1970
- return u();
1971
- }
1972
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1973
- var s = ge, i = typeof Object.is == "function" ? Object.is : e, o = s.useState, a = s.useEffect, d = s.useLayoutEffect, f = s.useDebugValue, l = !1, p = !1, E = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : t;
1974
- Qe.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : E, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1975
- })()), Qe;
1976
- }
1977
- var Gt;
1978
- function _s() {
1979
- return Gt || (Gt = 1, process.env.NODE_ENV === "production" ? Pe.exports = Os() : Pe.exports = Ts()), Pe.exports;
1980
- }
1981
- var Xt = _s();
1982
- const Cn = 0, xn = 1, Dn = 2, Yt = 3;
1983
- var Qt = Object.prototype.hasOwnProperty;
1984
- function ut(e, t) {
1985
- var n, r;
1986
- if (e === t) return !0;
1987
- if (e && t && (n = e.constructor) === t.constructor) {
1988
- if (n === Date) return e.getTime() === t.getTime();
1989
- if (n === RegExp) return e.toString() === t.toString();
1990
- if (n === Array) {
1991
- if ((r = e.length) === t.length)
1992
- for (; r-- && ut(e[r], t[r]); ) ;
1993
- return r === -1;
1994
- }
1995
- if (!n || typeof e == "object") {
1996
- r = 0;
1997
- for (n in e)
1998
- if (Qt.call(e, n) && ++r && !Qt.call(t, n) || !(n in t) || !ut(e[n], t[n])) return !1;
1999
- return Object.keys(t).length === r;
2000
- }
2001
- }
2002
- return e !== e && t !== t;
2003
- }
2004
- const ie = /* @__PURE__ */ new WeakMap(), ae = () => {
2005
- }, I = (
2006
- /*#__NOINLINE__*/
2007
- ae()
2008
- ), lt = Object, b = (e) => e === I, Z = (e) => typeof e == "function", ce = (e, t) => ({
2009
- ...e,
2010
- ...t
2011
- }), Nn = (e) => Z(e.then), Ze = {}, Fe = {}, gt = "undefined", xe = typeof window != gt, ft = typeof document != gt, As = xe && "Deno" in window, Cs = () => xe && typeof window.requestAnimationFrame != gt, Ln = (e, t) => {
2012
- const n = ie.get(e);
2013
- return [
2014
- // Getter
2015
- () => !b(t) && e.get(t) || Ze,
2016
- // Setter
2017
- (r) => {
2018
- if (!b(t)) {
2019
- const s = e.get(t);
2020
- t in Fe || (Fe[t] = s), n[5](t, ce(s, r), s || Ze);
2021
- }
2022
- },
2023
- // Subscriber
2024
- n[6],
2025
- // Get server cache snapshot
2026
- () => !b(t) && t in Fe ? Fe[t] : !b(t) && e.get(t) || Ze
2027
- ];
2028
- };
2029
- let dt = !0;
2030
- const xs = () => dt, [pt, ht] = xe && window.addEventListener ? [
2031
- window.addEventListener.bind(window),
2032
- window.removeEventListener.bind(window)
2033
- ] : [
2034
- ae,
2035
- ae
2036
- ], Ds = () => {
2037
- const e = ft && document.visibilityState;
2038
- return b(e) || e !== "hidden";
2039
- }, Ns = (e) => (ft && document.addEventListener("visibilitychange", e), pt("focus", e), () => {
2040
- ft && document.removeEventListener("visibilitychange", e), ht("focus", e);
2041
- }), Ls = (e) => {
2042
- const t = () => {
2043
- dt = !0, e();
2044
- }, n = () => {
2045
- dt = !1;
2046
- };
2047
- return pt("online", t), pt("offline", n), () => {
2048
- ht("online", t), ht("offline", n);
2049
- };
2050
- }, Ps = {
2051
- isOnline: xs,
2052
- isVisible: Ds
2053
- }, Fs = {
2054
- initFocus: Ns,
2055
- initReconnect: Ls
2056
- }, Zt = !ge.useId, Ee = !xe || As, vs = (e) => Cs() ? window.requestAnimationFrame(e) : setTimeout(e, 1), et = Ee ? Mn : Hn, tt = typeof navigator < "u" && navigator.connection, en = !Ee && tt && ([
2057
- "slow-2g",
2058
- "2g"
2059
- ].includes(tt.effectiveType) || tt.saveData), ve = /* @__PURE__ */ new WeakMap(), Us = (e) => lt.prototype.toString.call(e), nt = (e, t) => e === `[object ${t}]`;
2060
- let Is = 0;
2061
- const mt = (e) => {
2062
- const t = typeof e, n = Us(e), r = nt(n, "Date"), s = nt(n, "RegExp"), i = nt(n, "Object");
2063
- let o, a;
2064
- if (lt(e) === e && !r && !s) {
2065
- if (o = ve.get(e), o) return o;
2066
- if (o = ++Is + "~", ve.set(e, o), Array.isArray(e)) {
2067
- for (o = "@", a = 0; a < e.length; a++)
2068
- o += mt(e[a]) + ",";
2069
- ve.set(e, o);
2070
- }
2071
- if (i) {
2072
- o = "#";
2073
- const d = lt.keys(e).sort();
2074
- for (; !b(a = d.pop()); )
2075
- b(e[a]) || (o += a + ":" + mt(e[a]) + ",");
2076
- ve.set(e, o);
2077
- }
2078
- } else
2079
- o = r ? e.toJSON() : t == "symbol" ? e.toString() : t == "string" ? JSON.stringify(e) : "" + e;
2080
- return o;
2081
- }, Ot = (e) => {
2082
- if (Z(e))
2083
- try {
2084
- e = e();
2085
- } catch {
2086
- e = "";
2087
- }
2088
- const t = e;
2089
- return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ? mt(e) : "", [
2090
- e,
2091
- t
2092
- ];
2093
- };
2094
- let Bs = 0;
2095
- const Et = () => ++Bs;
2096
- async function Pn(...e) {
2097
- const [t, n, r, s] = e, i = ce({
2098
- populateCache: !0,
2099
- throwOnError: !0
2100
- }, typeof s == "boolean" ? {
2101
- revalidate: s
2102
- } : s || {});
2103
- let o = i.populateCache;
2104
- const a = i.rollbackOnError;
2105
- let d = i.optimisticData;
2106
- const f = (E) => typeof a == "function" ? a(E) : a !== !1, l = i.throwOnError;
2107
- if (Z(n)) {
2108
- const E = n, y = [], u = t.keys();
2109
- for (const m of u)
2110
- // Skip the special useSWRInfinite and useSWRSubscription keys.
2111
- !/^\$(inf|sub)\$/.test(m) && E(t.get(m)._k) && y.push(m);
2112
- return Promise.all(y.map(p));
2113
- }
2114
- return p(n);
2115
- async function p(E) {
2116
- const [y] = Ot(E);
2117
- if (!y) return;
2118
- const [u, m] = Ln(t, y), [h, S, w, _] = ie.get(t), x = () => {
2119
- const P = h[y];
2120
- return (Z(i.revalidate) ? i.revalidate(u().data, E) : i.revalidate !== !1) && (delete w[y], delete _[y], P && P[0]) ? P[0](Dn).then(() => u().data) : u().data;
2121
- };
2122
- if (e.length < 3)
2123
- return x();
2124
- let g = r, v, A = !1;
2125
- const Y = Et();
2126
- S[y] = [
2127
- Y,
2128
- 0
2129
- ];
2130
- const O = !b(d), ee = u(), M = ee.data, z = ee._c, H = b(z) ? M : z;
2131
- if (O && (d = Z(d) ? d(H, M) : d, m({
2132
- data: d,
2133
- _c: H
2134
- })), Z(g))
2135
- try {
2136
- g = g(H);
2137
- } catch (P) {
2138
- v = P, A = !0;
2139
- }
2140
- if (g && Nn(g))
2141
- if (g = await g.catch((P) => {
2142
- v = P, A = !0;
2143
- }), Y !== S[y][0]) {
2144
- if (A) throw v;
2145
- return g;
2146
- } else A && O && f(v) && (o = !0, m({
2147
- data: H,
2148
- _c: I
2149
- }));
2150
- if (o && !A)
2151
- if (Z(o)) {
2152
- const P = o(g, H);
2153
- m({
2154
- data: P,
2155
- error: I,
2156
- _c: I
2157
- });
2158
- } else
2159
- m({
2160
- data: g,
2161
- error: I,
2162
- _c: I
2163
- });
2164
- if (S[y][1] = Et(), Promise.resolve(x()).then(() => {
2165
- m({
2166
- _c: I
2167
- });
2168
- }), A) {
2169
- if (l) throw v;
2170
- return;
2171
- }
2172
- return g;
2173
- }
2174
- }
2175
- const tn = (e, t) => {
2176
- for (const n in e)
2177
- e[n][0] && e[n][0](t);
2178
- }, js = (e, t) => {
2179
- if (!ie.has(e)) {
2180
- const n = ce(Fs, t), r = /* @__PURE__ */ Object.create(null), s = Pn.bind(I, e);
2181
- let i = ae;
2182
- const o = /* @__PURE__ */ Object.create(null), a = (l, p) => {
2183
- const E = o[l] || [];
2184
- return o[l] = E, E.push(p), () => E.splice(E.indexOf(p), 1);
2185
- }, d = (l, p, E) => {
2186
- e.set(l, p);
2187
- const y = o[l];
2188
- if (y)
2189
- for (const u of y)
2190
- u(p, E);
2191
- }, f = () => {
2192
- if (!ie.has(e) && (ie.set(e, [
2193
- r,
2194
- /* @__PURE__ */ Object.create(null),
2195
- /* @__PURE__ */ Object.create(null),
2196
- /* @__PURE__ */ Object.create(null),
2197
- s,
2198
- d,
2199
- a
2200
- ]), !Ee)) {
2201
- const l = n.initFocus(setTimeout.bind(I, tn.bind(I, r, Cn))), p = n.initReconnect(setTimeout.bind(I, tn.bind(I, r, xn)));
2202
- i = () => {
2203
- l && l(), p && p(), ie.delete(e);
2204
- };
2205
- }
2206
- };
2207
- return f(), [
2208
- e,
2209
- s,
2210
- f,
2211
- i
2212
- ];
2213
- }
2214
- return [
2215
- e,
2216
- ie.get(e)[4]
2217
- ];
2218
- }, qs = (e, t, n, r, s) => {
2219
- const i = n.errorRetryCount, o = s.retryCount, a = ~~((Math.random() + 0.5) * (1 << (o < 8 ? o : 8))) * n.errorRetryInterval;
2220
- !b(i) && o > i || setTimeout(r, a, s);
2221
- }, ks = ut, [Fn, Ms] = js(/* @__PURE__ */ new Map()), Hs = ce(
2222
- {
2223
- // events
2224
- onLoadingSlow: ae,
2225
- onSuccess: ae,
2226
- onError: ae,
2227
- onErrorRetry: qs,
2228
- onDiscarded: ae,
2229
- // switches
2230
- revalidateOnFocus: !0,
2231
- revalidateOnReconnect: !0,
2232
- revalidateIfStale: !0,
2233
- shouldRetryOnError: !0,
2234
- // timeouts
2235
- errorRetryInterval: en ? 1e4 : 5e3,
2236
- focusThrottleInterval: 5 * 1e3,
2237
- dedupingInterval: 2 * 1e3,
2238
- loadingTimeout: en ? 5e3 : 3e3,
2239
- // providers
2240
- compare: ks,
2241
- isPaused: () => !1,
2242
- cache: Fn,
2243
- mutate: Ms,
2244
- fallback: {}
2245
- },
2246
- // use web preset by default
2247
- Ps
2248
- ), Vs = (e, t) => {
2249
- const n = ce(e, t);
2250
- if (t) {
2251
- const { use: r, fallback: s } = e, { use: i, fallback: o } = t;
2252
- r && i && (n.use = r.concat(i)), s && o && (n.fallback = ce(s, o));
2253
- }
2254
- return n;
2255
- }, $s = kn({}), Ws = "$inf$", vn = xe && window.__SWR_DEVTOOLS_USE__, zs = vn ? window.__SWR_DEVTOOLS_USE__ : [], Js = () => {
2256
- vn && (window.__SWR_DEVTOOLS_REACT__ = ge);
2257
- }, Un = (e) => Z(e[1]) ? [
2258
- e[0],
2259
- e[1],
2260
- e[2] || {}
2261
- ] : [
2262
- e[0],
2263
- null,
2264
- (e[1] === null ? e[2] : e[1]) || {}
2265
- ], Ks = () => {
2266
- const e = Vn($s);
2267
- return rn(() => ce(Hs, e), [
2268
- e
2269
- ]);
2270
- }, Gs = (e) => (t, n, r) => e(t, n && ((...i) => {
2271
- const [o] = Ot(t), [, , , a] = ie.get(Fn);
2272
- if (o.startsWith(Ws))
2273
- return n(...i);
2274
- const d = a[o];
2275
- return b(d) ? n(...i) : (delete a[o], d);
2276
- }), r), Xs = zs.concat(Gs), Ys = (e) => function(...n) {
2277
- const r = Ks(), [s, i, o] = Un(n), a = Vs(r, o);
2278
- let d = e;
2279
- const { use: f } = a, l = (f || []).concat(Xs);
2280
- for (let p = l.length; p--; )
2281
- d = l[p](d);
2282
- return d(s, i || a.fetcher || null, a);
2283
- }, Qs = (e, t, n) => {
2284
- const r = t[e] || (t[e] = []);
2285
- return r.push(n), () => {
2286
- const s = r.indexOf(n);
2287
- s >= 0 && (r[s] = r[r.length - 1], r.pop());
2288
- };
2289
- }, go = (e, t) => (...n) => {
2290
- const [r, s, i] = Un(n), o = (i.use || []).concat(t);
2291
- return e(r, s, {
2292
- ...i,
2293
- use: o
2294
- });
2295
- };
2296
- Js();
2297
- const rt = ge.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
2298
- // and emitting an error.
2299
- // We assume that this is only for the `use(thenable)` case, not `use(context)`.
2300
- // https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45
2301
- ((e) => {
2302
- switch (e.status) {
2303
- case "pending":
2304
- throw e;
2305
- case "fulfilled":
2306
- return e.value;
2307
- case "rejected":
2308
- throw e.reason;
2309
- default:
2310
- throw e.status = "pending", e.then((t) => {
2311
- e.status = "fulfilled", e.value = t;
2312
- }, (t) => {
2313
- e.status = "rejected", e.reason = t;
2314
- }), e;
2315
- }
2316
- }), st = {
2317
- dedupe: !0
2318
- }, nn = Promise.resolve(I), Zs = (e, t, n) => {
2319
- const { cache: r, compare: s, suspense: i, fallbackData: o, revalidateOnMount: a, revalidateIfStale: d, refreshInterval: f, refreshWhenHidden: l, refreshWhenOffline: p, keepPreviousData: E, strictServerPrefetchWarning: y } = n, [u, m, h, S] = ie.get(r), [w, _] = Ot(e), x = le(!1), g = le(!1), v = le(w), A = le(t), Y = le(n), O = () => Y.current, ee = () => O().isVisible() && O().isOnline(), [M, z, H, P] = Ln(r, w), te = le({}).current, F = b(o) ? b(n.fallback) ? I : n.fallback[w] : o, Re = (T, C) => {
2320
- for (const N in te) {
2321
- const D = N;
2322
- if (D === "data") {
2323
- if (!s(T[D], C[D]) && (!b(T[D]) || !s(Ne, C[D])))
2324
- return !1;
2325
- } else if (C[D] !== T[D])
2326
- return !1;
2327
- }
2328
- return !0;
2329
- }, J = rn(() => {
2330
- const T = !w || !t ? !1 : b(a) ? O().isPaused() || i ? !1 : d !== !1 : a, C = (j) => {
2331
- const se = ce(j);
2332
- return delete se._k, T ? {
2333
- isValidating: !0,
2334
- isLoading: !0,
2335
- ...se
2336
- } : se;
2337
- }, N = M(), D = P(), G = C(N), me = N === D ? G : C(D);
2338
- let U = G;
2339
- return [
2340
- () => {
2341
- const j = C(M());
2342
- return Re(j, U) ? (U.data = j.data, U.isLoading = j.isLoading, U.isValidating = j.isValidating, U.error = j.error, U) : (U = j, j);
2343
- },
2344
- () => me
2345
- ];
2346
- }, [
2347
- r,
2348
- w
2349
- ]), ne = Xt.useSyncExternalStore(ze(
2350
- (T) => H(w, (C, N) => {
2351
- Re(N, C) || T();
2352
- }),
2353
- // eslint-disable-next-line react-hooks/exhaustive-deps
2354
- [
2355
- r,
2356
- w
2357
- ]
2358
- ), J[0], J[1]), De = !x.current, Q = u[w] && u[w].length > 0, V = ne.data, K = b(V) ? F && Nn(F) ? rt(F) : F : V, re = ne.error, he = le(K), Ne = E ? b(V) ? b(he.current) ? K : he.current : V : K, ue = w && b(K), In = !Ee && // eslint-disable-next-line react-hooks/rules-of-hooks
2359
- Xt.useSyncExternalStore(() => ae, () => !1, () => !0);
2360
- y && In && !i && ue && console.warn(`Missing pre-initiated data for serialized key "${w}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);
2361
- const Tt = Q && !b(re) ? !1 : De && !b(a) ? a : O().isPaused() ? !1 : i ? b(K) ? !1 : d : b(K) || d, _t = !!(w && t && De && Tt), Bn = b(ne.isValidating) ? _t : ne.isValidating, jn = b(ne.isLoading) ? _t : ne.isLoading, Se = ze(
2362
- async (T) => {
2363
- const C = A.current;
2364
- if (!w || !C || g.current || O().isPaused())
2365
- return !1;
2366
- let N, D, G = !0;
2367
- const me = T || {}, U = !h[w] || !me.dedupe, j = () => Zt ? !g.current && w === v.current && x.current : w === v.current, se = {
2368
- isValidating: !1,
2369
- isLoading: !1
2370
- }, Ct = () => {
2371
- z(se);
2372
- }, xt = () => {
2373
- const $ = h[w];
2374
- $ && $[1] === D && delete h[w];
2375
- }, Dt = {
2376
- isValidating: !0
2377
- };
2378
- b(M().data) && (Dt.isLoading = !0);
2379
- try {
2380
- if (U && (z(Dt), n.loadingTimeout && b(M().data) && setTimeout(() => {
2381
- G && j() && O().onLoadingSlow(w, n);
2382
- }, n.loadingTimeout), h[w] = [
2383
- C(_),
2384
- Et()
2385
- ]), [N, D] = h[w], N = await N, U && setTimeout(xt, n.dedupingInterval), !h[w] || h[w][1] !== D)
2386
- return U && j() && O().onDiscarded(w), !1;
2387
- se.error = I;
2388
- const $ = m[w];
2389
- if (!b($) && // case 1
2390
- (D <= $[0] || // case 2
2391
- D <= $[1] || // case 3
2392
- $[1] === 0))
2393
- return Ct(), U && j() && O().onDiscarded(w), !1;
2394
- const oe = M().data;
2395
- se.data = s(oe, N) ? oe : N, U && j() && O().onSuccess(N, w, n);
2396
- } catch ($) {
2397
- xt();
2398
- const oe = O(), { shouldRetryOnError: $e } = oe;
2399
- oe.isPaused() || (se.error = $, U && j() && (oe.onError($, w, oe), ($e === !0 || Z($e) && $e($)) && (!O().revalidateOnFocus || !O().revalidateOnReconnect || ee()) && oe.onErrorRetry($, w, oe, (qn) => {
2400
- const We = u[w];
2401
- We && We[0] && We[0](Yt, qn);
2402
- }, {
2403
- retryCount: (me.retryCount || 0) + 1,
2404
- dedupe: !0
2405
- })));
2406
- }
2407
- return G = !1, Ct(), !0;
2408
- },
2409
- // `setState` is immutable, and `eventsCallback`, `fnArg`, and
2410
- // `keyValidating` are depending on `key`, so we can exclude them from
2411
- // the deps array.
2412
- //
2413
- // FIXME:
2414
- // `fn` and `config` might be changed during the lifecycle,
2415
- // but they might be changed every render like this.
2416
- // `useSWR('key', () => fetch('/api/'), { suspense: true })`
2417
- // So we omit the values from the deps array
2418
- // even though it might cause unexpected behaviors.
2419
- // eslint-disable-next-line react-hooks/exhaustive-deps
2420
- [
2421
- w,
2422
- r
2423
- ]
2424
- ), At = ze(
2425
- // Use callback to make sure `keyRef.current` returns latest result every time
2426
- (...T) => Pn(r, v.current, ...T),
2427
- // eslint-disable-next-line react-hooks/exhaustive-deps
2428
- []
2429
- );
2430
- if (et(() => {
2431
- A.current = t, Y.current = n, b(V) || (he.current = V);
2432
- }), et(() => {
2433
- if (!w) return;
2434
- const T = Se.bind(I, st);
2435
- let C = 0;
2436
- O().revalidateOnFocus && (C = Date.now() + O().focusThrottleInterval);
2437
- const D = Qs(w, u, (G, me = {}) => {
2438
- if (G == Cn) {
2439
- const U = Date.now();
2440
- O().revalidateOnFocus && U > C && ee() && (C = U + O().focusThrottleInterval, T());
2441
- } else if (G == xn)
2442
- O().revalidateOnReconnect && ee() && T();
2443
- else {
2444
- if (G == Dn)
2445
- return Se();
2446
- if (G == Yt)
2447
- return Se(me);
2448
- }
2449
- });
2450
- return g.current = !1, v.current = w, x.current = !0, z({
2451
- _k: _
2452
- }), Tt && (h[w] || (b(K) || Ee ? T() : vs(T))), () => {
2453
- g.current = !0, D();
2454
- };
2455
- }, [
2456
- w
2457
- ]), et(() => {
2458
- let T;
2459
- function C() {
2460
- const D = Z(f) ? f(M().data) : f;
2461
- D && T !== -1 && (T = setTimeout(N, D));
2462
- }
2463
- function N() {
2464
- !M().error && (l || O().isVisible()) && (p || O().isOnline()) ? Se(st).then(C) : C();
2465
- }
2466
- return C(), () => {
2467
- T && (clearTimeout(T), T = -1);
2468
- };
2469
- }, [
2470
- f,
2471
- l,
2472
- p,
2473
- w
2474
- ]), $n(Ne), i) {
2475
- if (!Zt && Ee && ue)
2476
- throw new Error("Fallback data is required when using Suspense in SSR.");
2477
- ue && (A.current = t, Y.current = n, g.current = !1);
2478
- const T = S[w], C = !b(T) && ue ? At(T) : nn;
2479
- if (rt(C), !b(re) && ue)
2480
- throw re;
2481
- const N = ue ? Se(st) : nn;
2482
- !b(Ne) && ue && (N.status = "fulfilled", N.value = !0), rt(N);
2483
- }
2484
- return {
2485
- mutate: At,
2486
- get data() {
2487
- return te.data = !0, Ne;
2488
- },
2489
- get error() {
2490
- return te.error = !0, re;
2491
- },
2492
- get isValidating() {
2493
- return te.isValidating = !0, Bn;
2494
- },
2495
- get isLoading() {
2496
- return te.isLoading = !0, jn;
2497
- }
2498
- };
2499
- }, Oo = Ys(Zs);
2500
- export {
2501
- L as a,
2502
- Oo as u,
2503
- go as w
2504
- };