@compill/admin 1.0.34 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -7,11 +7,12 @@ var ui = require('@valerya/ui');
7
7
  var Link = require('next/link');
8
8
  var React = require('react');
9
9
  var adminApi = require('@compill/admin-api');
10
+ require('axios');
11
+ require('react/jsx-runtime');
10
12
  var reactQuery = require('@tanstack/react-query');
11
13
  var reactRouterDom = require('react-router-dom');
12
14
  var form = require('@compill/form');
13
15
  var formik = require('formik');
14
- require('react/jsx-runtime');
15
16
  var components = require('@compill/components');
16
17
  var react = require('@soperio/react');
17
18
  var formExtras = require('@compill/form-extras');
@@ -175,1836 +176,1022 @@ function IconButton(_a) {
175
176
  }));
176
177
  }
177
178
 
178
- function lt(e, t) {
179
- return function() {
180
- return e.apply(t, arguments);
181
- };
179
+ function useInvalidateQuery(queryKey, queryId) {
180
+ var queryClient = reactQuery.useQueryClient();
181
+ var key = queryId ? queryKey.concat([
182
+ "".concat(queryId)
183
+ ]) : queryKey;
184
+ var invalidate = React__default["default"].useCallback(function() {
185
+ return key ? queryClient.invalidateQueries(key) : null;
186
+ }, [
187
+ key,
188
+ queryClient
189
+ ]);
190
+ return invalidate;
182
191
  }
183
- const { toString: Vt } = Object.prototype, { getPrototypeOf: qe } = Object, be = /* @__PURE__ */ ((e) => (t) => {
184
- const n = Vt.call(t);
185
- return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
186
- })(/* @__PURE__ */ Object.create(null)), k$1 = (e) => (e = e.toLowerCase(), (t) => be(t) === e), Te = (e) => (t) => typeof t === e, { isArray: te } = Array, ie = Te("undefined");
187
- function Kt(e) {
188
- return e !== null && !ie(e) && e.constructor !== null && !ie(e.constructor) && I$1(e.constructor.isBuffer) && e.constructor.isBuffer(e);
189
- }
190
- const dt = k$1("ArrayBuffer");
191
- function Qt(e) {
192
- let t;
193
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && dt(e.buffer), t;
194
- }
195
- const Xt = Te("string"), I$1 = Te("function"), ft = Te("number"), we = (e) => e !== null && typeof e == "object", Gt = (e) => e === !0 || e === !1, fe = (e) => {
196
- if (be(e) !== "object")
197
- return !1;
198
- const t = qe(e);
199
- return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
200
- }, Yt = k$1("Date"), Zt = k$1("File"), en = k$1("Blob"), tn = k$1("FileList"), nn = (e) => we(e) && I$1(e.pipe), rn = (e) => {
201
- let t;
202
- return e && (typeof FormData == "function" && e instanceof FormData || I$1(e.append) && ((t = be(e)) === "formdata" || // detect form-data instance
203
- t === "object" && I$1(e.toString) && e.toString() === "[object FormData]"));
204
- }, sn = k$1("URLSearchParams"), on = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
205
- function ae(e, t, { allOwnKeys: n = !1 } = {}) {
206
- if (e === null || typeof e > "u")
207
- return;
208
- let r, o;
209
- if (typeof e != "object" && (e = [e]), te(e))
210
- for (r = 0, o = e.length; r < o; r++)
211
- t.call(null, e[r], r, e);
212
- else {
213
- const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = s.length;
214
- let a;
215
- for (r = 0; r < i; r++)
216
- a = s[r], t.call(null, e[a], a, e);
217
- }
192
+
193
+ function _define_property$3(obj, key, value) {
194
+ if (key in obj) {
195
+ Object.defineProperty(obj, key, {
196
+ value: value,
197
+ enumerable: true,
198
+ configurable: true,
199
+ writable: true
200
+ });
201
+ } else {
202
+ obj[key] = value;
203
+ }
204
+ return obj;
205
+ }
206
+ function _object_spread$3(target) {
207
+ for(var i = 1; i < arguments.length; i++){
208
+ var source = arguments[i] != null ? arguments[i] : {};
209
+ var ownKeys = Object.keys(source);
210
+ if (typeof Object.getOwnPropertySymbols === "function") {
211
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
212
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
213
+ }));
214
+ }
215
+ ownKeys.forEach(function(key) {
216
+ _define_property$3(target, key, source[key]);
217
+ });
218
+ }
219
+ return target;
218
220
  }
219
- function pt(e, t) {
220
- t = t.toLowerCase();
221
- const n = Object.keys(e);
222
- let r = n.length, o;
223
- for (; r-- > 0; )
224
- if (o = n[r], t === o.toLowerCase())
225
- return o;
226
- return null;
221
+ function useApiMutation(queryFn, queryKey, queryParam, queryOptions) {
222
+ var key = (queryKey !== null && queryKey !== void 0 ? queryKey : []).concat([
223
+ queryParam ? typeof queryParam == "number" ? "".concat(queryParam) : queryParam : undefined
224
+ ]);
225
+ return reactQuery.useMutation(key, queryFn, queryOptions);
226
+ }
227
+ function useInvalidateMutation(queryFn, queryKey, queryId, queryOptions) {
228
+ var invalidateQuery = useInvalidateQuery(queryKey, queryId);
229
+ var key = queryId ? queryKey.concat("".concat(queryId)) : queryKey;
230
+ return reactQuery.useMutation(key, queryFn, _object_spread$3({
231
+ onSuccess: function() {
232
+ return invalidateQuery();
233
+ }
234
+ }, queryOptions));
227
235
  }
228
- const ht = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, mt = (e) => !ie(e) && e !== ht;
229
- function Be() {
230
- const { caseless: e } = mt(this) && this || {}, t = {}, n = (r, o) => {
231
- const s = e && pt(t, o) || o;
232
- fe(t[s]) && fe(r) ? t[s] = Be(t[s], r) : fe(r) ? t[s] = Be({}, r) : te(r) ? t[s] = r.slice() : t[s] = r;
233
- };
234
- for (let r = 0, o = arguments.length; r < o; r++)
235
- arguments[r] && ae(arguments[r], n);
236
- return t;
237
- }
238
- const an = (e, t, n, { allOwnKeys: r } = {}) => (ae(t, (o, s) => {
239
- n && I$1(o) ? e[s] = lt(o, n) : e[s] = o;
240
- }, { allOwnKeys: r }), e), cn = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), un = (e, t, n, r) => {
241
- e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
242
- value: t.prototype
243
- }), n && Object.assign(e.prototype, n);
244
- }, ln = (e, t, n, r) => {
245
- let o, s, i;
246
- const a = {};
247
- if (t = t || {}, e == null)
248
- return t;
249
- do {
250
- for (o = Object.getOwnPropertyNames(e), s = o.length; s-- > 0; )
251
- i = o[s], (!r || r(i, e, t)) && !a[i] && (t[i] = e[i], a[i] = !0);
252
- e = n !== !1 && qe(e);
253
- } while (e && (!n || n(e, t)) && e !== Object.prototype);
254
- return t;
255
- }, dn = (e, t, n) => {
256
- e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
257
- const r = e.indexOf(t, n);
258
- return r !== -1 && r === n;
259
- }, fn = (e) => {
260
- if (!e)
261
- return null;
262
- if (te(e))
263
- return e;
264
- let t = e.length;
265
- if (!ft(t))
266
- return null;
267
- const n = new Array(t);
268
- for (; t-- > 0; )
269
- n[t] = e[t];
270
- return n;
271
- }, pn = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && qe(Uint8Array)), hn = (e, t) => {
272
- const r = (e && e[Symbol.iterator]).call(e);
273
- let o;
274
- for (; (o = r.next()) && !o.done; ) {
275
- const s = o.value;
276
- t.call(e, s[0], s[1]);
277
- }
278
- }, mn = (e, t) => {
279
- let n;
280
- const r = [];
281
- for (; (n = e.exec(t)) !== null; )
282
- r.push(n);
283
- return r;
284
- }, yn = k$1("HTMLFormElement"), gn = (e) => e.toLowerCase().replace(
285
- /[-_\s]([a-z\d])(\w*)/g,
286
- function(n, r, o) {
287
- return r.toUpperCase() + o;
288
- }
289
- ), Ke = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), En = k$1("RegExp"), yt = (e, t) => {
290
- const n = Object.getOwnPropertyDescriptors(e), r = {};
291
- ae(n, (o, s) => {
292
- let i;
293
- (i = t(o, s, e)) !== !1 && (r[s] = i || o);
294
- }), Object.defineProperties(e, r);
295
- }, bn = (e) => {
296
- yt(e, (t, n) => {
297
- if (I$1(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
298
- return !1;
299
- const r = e[n];
300
- if (I$1(r)) {
301
- if (t.enumerable = !1, "writable" in t) {
302
- t.writable = !1;
303
- return;
304
- }
305
- t.set || (t.set = () => {
306
- throw Error("Can not rewrite read-only method '" + n + "'");
307
- });
308
- }
309
- });
310
- }, Tn = (e, t) => {
311
- const n = {}, r = (o) => {
312
- o.forEach((s) => {
313
- n[s] = !0;
314
- });
315
- };
316
- return te(e) ? r(e) : r(String(e).split(t)), n;
317
- }, wn = () => {
318
- }, Rn = (e, t) => (e = +e, Number.isFinite(e) ? e : t), Ce = "abcdefghijklmnopqrstuvwxyz", Qe = "0123456789", gt = {
319
- DIGIT: Qe,
320
- ALPHA: Ce,
321
- ALPHA_DIGIT: Ce + Ce.toUpperCase() + Qe
322
- }, On = (e = 16, t = gt.ALPHA_DIGIT) => {
323
- let n = "";
324
- const { length: r } = t;
325
- for (; e--; )
326
- n += t[Math.random() * r | 0];
327
- return n;
328
- };
329
- function Sn(e) {
330
- return !!(e && I$1(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
236
+ function useInvalidateParentMutation(queryFn, queryKey, queryOptions) {
237
+ var invalidateQuery = useInvalidateQuery(queryKey);
238
+ return reactQuery.useMutation(queryKey, queryFn, _object_spread$3({
239
+ onSuccess: function() {
240
+ return invalidateQuery();
241
+ }
242
+ }, queryOptions));
331
243
  }
332
- const An = (e) => {
333
- const t = new Array(10), n = (r, o) => {
334
- if (we(r)) {
335
- if (t.indexOf(r) >= 0)
336
- return;
337
- if (!("toJSON" in r)) {
338
- t[o] = r;
339
- const s = te(r) ? [] : {};
340
- return ae(r, (i, a) => {
341
- const h = n(i, o + 1);
342
- !ie(h) && (s[a] = h);
343
- }), t[o] = void 0, s;
344
- }
244
+ // useInvalidateMutation : invalidate the object e.g /xxx/id
245
+ // useInvalidateParentMutation : invalidate the parent object e.g /xxx
246
+ // useUpdateMutation : replace the data in cache to avoid refetching the server
247
+
248
+ function _define_property$2(obj, key, value) {
249
+ if (key in obj) {
250
+ Object.defineProperty(obj, key, {
251
+ value: value,
252
+ enumerable: true,
253
+ configurable: true,
254
+ writable: true
255
+ });
256
+ } else {
257
+ obj[key] = value;
345
258
  }
346
- return r;
347
- };
348
- return n(e, 0);
349
- }, Cn = k$1("AsyncFunction"), Nn = (e) => e && (we(e) || I$1(e)) && I$1(e.then) && I$1(e.catch), c = {
350
- isArray: te,
351
- isArrayBuffer: dt,
352
- isBuffer: Kt,
353
- isFormData: rn,
354
- isArrayBufferView: Qt,
355
- isString: Xt,
356
- isNumber: ft,
357
- isBoolean: Gt,
358
- isObject: we,
359
- isPlainObject: fe,
360
- isUndefined: ie,
361
- isDate: Yt,
362
- isFile: Zt,
363
- isBlob: en,
364
- isRegExp: En,
365
- isFunction: I$1,
366
- isStream: nn,
367
- isURLSearchParams: sn,
368
- isTypedArray: pn,
369
- isFileList: tn,
370
- forEach: ae,
371
- merge: Be,
372
- extend: an,
373
- trim: on,
374
- stripBOM: cn,
375
- inherits: un,
376
- toFlatObject: ln,
377
- kindOf: be,
378
- kindOfTest: k$1,
379
- endsWith: dn,
380
- toArray: fn,
381
- forEachEntry: hn,
382
- matchAll: mn,
383
- isHTMLForm: yn,
384
- hasOwnProperty: Ke,
385
- hasOwnProp: Ke,
386
- // an alias to avoid ESLint no-prototype-builtins detection
387
- reduceDescriptors: yt,
388
- freezeMethods: bn,
389
- toObjectSet: Tn,
390
- toCamelCase: gn,
391
- noop: wn,
392
- toFiniteNumber: Rn,
393
- findKey: pt,
394
- global: ht,
395
- isContextDefined: mt,
396
- ALPHABET: gt,
397
- generateString: On,
398
- isSpecCompliantForm: Sn,
399
- toJSONObject: An,
400
- isAsyncFn: Cn,
401
- isThenable: Nn
402
- };
403
- function b$1(e, t, n, r, o) {
404
- 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), o && (this.response = o);
259
+ return obj;
260
+ }
261
+ function _object_spread$2(target) {
262
+ for(var i = 1; i < arguments.length; i++){
263
+ var source = arguments[i] != null ? arguments[i] : {};
264
+ var ownKeys = Object.keys(source);
265
+ if (typeof Object.getOwnPropertySymbols === "function") {
266
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
267
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
268
+ }));
269
+ }
270
+ ownKeys.forEach(function(key) {
271
+ _define_property$2(target, key, source[key]);
272
+ });
273
+ }
274
+ return target;
405
275
  }
406
- c.inherits(b$1, Error, {
407
- toJSON: function() {
408
- return {
409
- // Standard
410
- message: this.message,
411
- name: this.name,
412
- // Microsoft
413
- description: this.description,
414
- number: this.number,
415
- // Mozilla
416
- fileName: this.fileName,
417
- lineNumber: this.lineNumber,
418
- columnNumber: this.columnNumber,
419
- stack: this.stack,
420
- // Axios
421
- config: c.toJSONObject(this.config),
422
- code: this.code,
423
- status: this.response && this.response.status ? this.response.status : null
276
+ function queryFnWrapper(queryFn, queryParam) {
277
+ return function(context) {
278
+ if (queryParam) return queryFn(queryParam);
279
+ return queryFn();
424
280
  };
425
- }
426
- });
427
- const Et = b$1.prototype, bt = {};
428
- [
429
- "ERR_BAD_OPTION_VALUE",
430
- "ERR_BAD_OPTION",
431
- "ECONNABORTED",
432
- "ETIMEDOUT",
433
- "ERR_NETWORK",
434
- "ERR_FR_TOO_MANY_REDIRECTS",
435
- "ERR_DEPRECATED",
436
- "ERR_BAD_RESPONSE",
437
- "ERR_BAD_REQUEST",
438
- "ERR_CANCELED",
439
- "ERR_NOT_SUPPORT",
440
- "ERR_INVALID_URL"
441
- // eslint-disable-next-line func-names
442
- ].forEach((e) => {
443
- bt[e] = { value: e };
444
- });
445
- Object.defineProperties(b$1, bt);
446
- Object.defineProperty(Et, "isAxiosError", { value: !0 });
447
- b$1.from = (e, t, n, r, o, s) => {
448
- const i = Object.create(Et);
449
- return c.toFlatObject(e, i, function(h) {
450
- return h !== Error.prototype;
451
- }, (a) => a !== "isAxiosError"), b$1.call(i, e.message, t, n, r, o), i.cause = e, i.name = e.name, s && Object.assign(i, s), i;
452
- };
453
- const xn = null;
454
- function De(e) {
455
- return c.isPlainObject(e) || c.isArray(e);
456
281
  }
457
- function Tt(e) {
458
- return c.endsWith(e, "[]") ? e.slice(0, -2) : e;
282
+ function useApiQuery(queryKey, queryFn, queryParam, queryOptions) {
283
+ var key = queryParam ? queryKey.concat([
284
+ typeof queryParam == "number" ? "".concat(queryParam) : queryParam
285
+ ]) : queryKey;
286
+ return reactQuery.useQuery(key, queryFnWrapper(queryFn, queryParam), _object_spread$2({
287
+ retry: 0,
288
+ networkMode: "always",
289
+ retryOnMount: false,
290
+ refetchOnMount: false,
291
+ refetchOnWindowFocus: false
292
+ }, queryOptions));
293
+ }
294
+ function useApiQueries(queries) {
295
+ var results = reactQuery.useQueries({
296
+ queries: queries.map(function(q) {
297
+ var key = q.queryParam ? q.queryKey.concat([
298
+ typeof q.queryParam == "number" ? "".concat(q.queryParam) : q.queryParam
299
+ ]) : q.queryKey;
300
+ return _object_spread$2({
301
+ queryKey: key,
302
+ queryFn: queryFnWrapper(q.queryFn, q.queryParam),
303
+ retry: 0,
304
+ // networkMode: "always",
305
+ retryOnMount: false,
306
+ refetchOnMount: false,
307
+ refetchOnWindowFocus: false
308
+ }, q.queryOptions);
309
+ })
310
+ });
311
+ var isFetching = results.findIndex(function(r) {
312
+ return r.isFetching === true;
313
+ }) != -1;
314
+ var isError = results.findIndex(function(r) {
315
+ return r.isError === true;
316
+ }) != -1;
317
+ var data = results.map(function(r) {
318
+ return r.data;
319
+ });
320
+ return {
321
+ data: data,
322
+ isFetching: isFetching,
323
+ isError: isError
324
+ };
459
325
  }
460
- function Xe(e, t, n) {
461
- return e ? e.concat(t).map(function(o, s) {
462
- return o = Tt(o), !n && s ? "[" + o + "]" : o;
463
- }).join(n ? "." : "") : t;
326
+
327
+ function r$1(e) {
328
+ var t, f, n = "";
329
+ if ("string" == typeof e || "number" == typeof e) n += e;
330
+ else if ("object" == typeof e) if (Array.isArray(e)) for(t = 0; t < e.length; t++)e[t] && (f = r$1(e[t])) && (n && (n += " "), n += f);
331
+ else for(t in e)e[t] && (n && (n += " "), n += t);
332
+ return n;
464
333
  }
465
- function _n(e) {
466
- return c.isArray(e) && !e.some(De);
334
+ function clsx$1() {
335
+ for(var e, t, f = 0, n = ""; f < arguments.length;)(e = arguments[f++]) && (t = r$1(e)) && (n && (n += " "), n += t);
336
+ return n;
467
337
  }
468
- const Pn = c.toFlatObject(c, {}, null, function(t) {
469
- return /^is[A-Z]/.test(t);
470
- });
471
- function Re(e, t, n) {
472
- if (!c.isObject(e))
473
- throw new TypeError("target must be an object");
474
- t = t || new FormData(), n = c.toFlatObject(n, {
475
- metaTokens: !0,
476
- dots: !1,
477
- indexes: !1
478
- }, !1, function(d, m) {
479
- return !c.isUndefined(m[d]);
480
- });
481
- const r = n.metaTokens, o = n.visitor || f, s = n.dots, i = n.indexes, h = (n.Blob || typeof Blob < "u" && Blob) && c.isSpecCompliantForm(t);
482
- if (!c.isFunction(o))
483
- throw new TypeError("visitor must be a function");
484
- function p(l) {
485
- if (l === null)
486
- return "";
487
- if (c.isDate(l))
488
- return l.toISOString();
489
- if (!h && c.isBlob(l))
490
- throw new b$1("Blob is not supported. Use a Buffer instead.");
491
- return c.isArrayBuffer(l) || c.isTypedArray(l) ? h && typeof Blob == "function" ? new Blob([l]) : Buffer.from(l) : l;
492
- }
493
- function f(l, d, m) {
494
- let g = l;
495
- if (l && !m && typeof l == "object") {
496
- if (c.endsWith(d, "{}"))
497
- d = r ? d : d.slice(0, -2), l = JSON.stringify(l);
498
- else if (c.isArray(l) && _n(l) || (c.isFileList(l) || c.endsWith(d, "[]")) && (g = c.toArray(l)))
499
- return d = Tt(d), g.forEach(function(A, T) {
500
- !(c.isUndefined(A) || A === null) && t.append(
501
- // eslint-disable-next-line no-nested-ternary
502
- i === !0 ? Xe([d], T, s) : i === null ? d : d + "[]",
503
- p(A)
504
- );
505
- }), !1;
338
+
339
+ function _array_like_to_array$1(arr, len) {
340
+ if (len == null || len > arr.length) len = arr.length;
341
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
342
+ return arr2;
343
+ }
344
+ function _array_with_holes(arr) {
345
+ if (Array.isArray(arr)) return arr;
346
+ }
347
+ function _array_without_holes$1(arr) {
348
+ if (Array.isArray(arr)) return _array_like_to_array$1(arr);
349
+ }
350
+ function _define_property$1(obj, key, value) {
351
+ if (key in obj) {
352
+ Object.defineProperty(obj, key, {
353
+ value: value,
354
+ enumerable: true,
355
+ configurable: true,
356
+ writable: true
357
+ });
358
+ } else {
359
+ obj[key] = value;
506
360
  }
507
- return De(l) ? !0 : (t.append(Xe(m, d, s), p(l)), !1);
508
- }
509
- const u = [], E = Object.assign(Pn, {
510
- defaultVisitor: f,
511
- convertValue: p,
512
- isVisitable: De
513
- });
514
- function y(l, d) {
515
- if (!c.isUndefined(l)) {
516
- if (u.indexOf(l) !== -1)
517
- throw Error("Circular reference detected in " + d.join("."));
518
- u.push(l), c.forEach(l, function(g, w) {
519
- (!(c.isUndefined(g) || g === null) && o.call(
520
- t,
521
- g,
522
- c.isString(w) ? w.trim() : w,
523
- d,
524
- E
525
- )) === !0 && y(g, d ? d.concat(w) : [w]);
526
- }), u.pop();
361
+ return obj;
362
+ }
363
+ function _iterable_to_array$1(iter) {
364
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
365
+ }
366
+ function _iterable_to_array_limit(arr, i) {
367
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
368
+ if (_i == null) return;
369
+ var _arr = [];
370
+ var _n = true;
371
+ var _d = false;
372
+ var _s, _e;
373
+ try {
374
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
375
+ _arr.push(_s.value);
376
+ if (i && _arr.length === i) break;
377
+ }
378
+ } catch (err) {
379
+ _d = true;
380
+ _e = err;
381
+ } finally{
382
+ try {
383
+ if (!_n && _i["return"] != null) _i["return"]();
384
+ } finally{
385
+ if (_d) throw _e;
386
+ }
527
387
  }
528
- }
529
- if (!c.isObject(e))
530
- throw new TypeError("data must be an object");
531
- return y(e), t;
532
- }
533
- function Ge(e) {
534
- const t = {
535
- "!": "%21",
536
- "'": "%27",
537
- "(": "%28",
538
- ")": "%29",
539
- "~": "%7E",
540
- "%20": "+",
541
- "%00": "\0"
542
- };
543
- return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
544
- return t[r];
545
- });
388
+ return _arr;
546
389
  }
547
- function He(e, t) {
548
- this._pairs = [], e && Re(e, this, t);
390
+ function _non_iterable_rest() {
391
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
549
392
  }
550
- const wt = He.prototype;
551
- wt.append = function(t, n) {
552
- this._pairs.push([t, n]);
553
- };
554
- wt.toString = function(t) {
555
- const n = t ? function(r) {
556
- return t.call(this, r, Ge);
557
- } : Ge;
558
- return this._pairs.map(function(o) {
559
- return n(o[0]) + "=" + n(o[1]);
560
- }, "").join("&");
561
- };
562
- function vn(e) {
563
- return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
564
- }
565
- function Rt(e, t, n) {
566
- if (!t)
567
- return e;
568
- const r = n && n.encode || vn, o = n && n.serialize;
569
- let s;
570
- if (o ? s = o(t, n) : s = c.isURLSearchParams(t) ? t.toString() : new He(t, n).toString(r), s) {
571
- const i = e.indexOf("#");
572
- i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
573
- }
574
- return e;
393
+ function _non_iterable_spread$1() {
394
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
575
395
  }
576
- class Ye {
577
- constructor() {
578
- this.handlers = [];
579
- }
580
- /**
581
- * Add a new interceptor to the stack
582
- *
583
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
584
- * @param {Function} rejected The function to handle `reject` for a `Promise`
585
- *
586
- * @return {Number} An ID used to remove interceptor later
587
- */
588
- use(t, n, r) {
589
- return this.handlers.push({
590
- fulfilled: t,
591
- rejected: n,
592
- synchronous: r ? r.synchronous : !1,
593
- runWhen: r ? r.runWhen : null
594
- }), this.handlers.length - 1;
595
- }
596
- /**
597
- * Remove an interceptor from the stack
598
- *
599
- * @param {Number} id The ID that was returned by `use`
600
- *
601
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
602
- */
603
- eject(t) {
604
- this.handlers[t] && (this.handlers[t] = null);
605
- }
606
- /**
607
- * Clear all interceptors from the stack
608
- *
609
- * @returns {void}
610
- */
611
- clear() {
612
- this.handlers && (this.handlers = []);
613
- }
614
- /**
615
- * Iterate over all the registered interceptors
616
- *
617
- * This method is particularly useful for skipping over any
618
- * interceptors that may have become `null` calling `eject`.
619
- *
620
- * @param {Function} fn The function to call for each interceptor
621
- *
622
- * @returns {void}
623
- */
624
- forEach(t) {
625
- c.forEach(this.handlers, function(r) {
626
- r !== null && t(r);
627
- });
628
- }
629
- }
630
- const Ot = {
631
- silentJSONParsing: !0,
632
- forcedJSONParsing: !0,
633
- clarifyTimeoutError: !1
634
- }, Ln = typeof URLSearchParams < "u" ? URLSearchParams : He, In = typeof FormData < "u" ? FormData : null, Fn = typeof Blob < "u" ? Blob : null, kn = {
635
- isBrowser: !0,
636
- classes: {
637
- URLSearchParams: Ln,
638
- FormData: In,
639
- Blob: Fn
640
- },
641
- protocols: ["http", "https", "file", "blob", "url", "data"]
642
- }, St = typeof window < "u" && typeof document < "u", Bn = ((e) => St && ["ReactNative", "NativeScript", "NS"].indexOf(e) < 0)(typeof navigator < "u" && navigator.product), Dn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
643
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
644
- __proto__: null,
645
- hasBrowserEnv: St,
646
- hasStandardBrowserEnv: Bn,
647
- hasStandardBrowserWebWorkerEnv: Dn
648
- }, Symbol.toStringTag, { value: "Module" })), F$1 = {
649
- ...Mn,
650
- ...kn
651
- };
652
- function Un(e, t) {
653
- return Re(e, new F$1.classes.URLSearchParams(), Object.assign({
654
- visitor: function(n, r, o, s) {
655
- return F$1.isNode && c.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
396
+ function _object_spread$1(target) {
397
+ for(var i = 1; i < arguments.length; i++){
398
+ var source = arguments[i] != null ? arguments[i] : {};
399
+ var ownKeys = Object.keys(source);
400
+ if (typeof Object.getOwnPropertySymbols === "function") {
401
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
402
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
403
+ }));
404
+ }
405
+ ownKeys.forEach(function(key) {
406
+ _define_property$1(target, key, source[key]);
407
+ });
656
408
  }
657
- }, t));
658
- }
659
- function $n(e) {
660
- return c.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
661
- }
662
- function jn(e) {
663
- const t = {}, n = Object.keys(e);
664
- let r;
665
- const o = n.length;
666
- let s;
667
- for (r = 0; r < o; r++)
668
- s = n[r], t[s] = e[s];
669
- return t;
670
- }
671
- function At(e) {
672
- function t(n, r, o, s) {
673
- let i = n[s++];
674
- if (i === "__proto__")
675
- return !0;
676
- const a = Number.isFinite(+i), h = s >= n.length;
677
- return i = !i && c.isArray(o) ? o.length : i, h ? (c.hasOwnProp(o, i) ? o[i] = [o[i], r] : o[i] = r, !a) : ((!o[i] || !c.isObject(o[i])) && (o[i] = []), t(n, r, o[i], s) && c.isArray(o[i]) && (o[i] = jn(o[i])), !a);
678
- }
679
- if (c.isFormData(e) && c.isFunction(e.entries)) {
680
- const n = {};
681
- return c.forEachEntry(e, (r, o) => {
682
- t($n(r), o, n, 0);
683
- }), n;
684
- }
685
- return null;
409
+ return target;
686
410
  }
687
- function qn(e, t, n) {
688
- if (c.isString(e))
689
- try {
690
- return (t || JSON.parse)(e), c.trim(e);
691
- } catch (r) {
692
- if (r.name !== "SyntaxError")
693
- throw r;
411
+ function ownKeys(object, enumerableOnly) {
412
+ var keys = Object.keys(object);
413
+ if (Object.getOwnPropertySymbols) {
414
+ var symbols = Object.getOwnPropertySymbols(object);
415
+ if (enumerableOnly) {
416
+ symbols = symbols.filter(function(sym) {
417
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
418
+ });
419
+ }
420
+ keys.push.apply(keys, symbols);
694
421
  }
695
- return (n || JSON.stringify)(e);
696
- }
697
- const ze = {
698
- transitional: Ot,
699
- adapter: ["xhr", "http"],
700
- transformRequest: [function(t, n) {
701
- const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = c.isObject(t);
702
- if (s && c.isHTMLForm(t) && (t = new FormData(t)), c.isFormData(t))
703
- return o ? JSON.stringify(At(t)) : t;
704
- if (c.isArrayBuffer(t) || c.isBuffer(t) || c.isStream(t) || c.isFile(t) || c.isBlob(t))
705
- return t;
706
- if (c.isArrayBufferView(t))
707
- return t.buffer;
708
- if (c.isURLSearchParams(t))
709
- return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
710
- let a;
711
- if (s) {
712
- if (r.indexOf("application/x-www-form-urlencoded") > -1)
713
- return Un(t, this.formSerializer).toString();
714
- if ((a = c.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
715
- const h = this.env && this.env.FormData;
716
- return Re(
717
- a ? { "files[]": t } : t,
718
- h && new h(),
719
- this.formSerializer
720
- );
721
- }
422
+ return keys;
423
+ }
424
+ function _object_spread_props(target, source) {
425
+ source = source != null ? source : {};
426
+ if (Object.getOwnPropertyDescriptors) {
427
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
428
+ } else {
429
+ ownKeys(Object(source)).forEach(function(key) {
430
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
431
+ });
722
432
  }
723
- return s || o ? (n.setContentType("application/json", !1), qn(t)) : t;
724
- }],
725
- transformResponse: [function(t) {
726
- const n = this.transitional || ze.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
727
- if (t && c.isString(t) && (r && !this.responseType || o)) {
728
- const i = !(n && n.silentJSONParsing) && o;
729
- try {
730
- return JSON.parse(t);
731
- } catch (a) {
732
- if (i)
733
- throw a.name === "SyntaxError" ? b$1.from(a, b$1.ERR_BAD_RESPONSE, this, null, this.response) : a;
734
- }
433
+ return target;
434
+ }
435
+ function _object_without_properties(source, excluded) {
436
+ if (source == null) return {};
437
+ var target = _object_without_properties_loose(source, excluded);
438
+ var key, i;
439
+ if (Object.getOwnPropertySymbols) {
440
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
441
+ for(i = 0; i < sourceSymbolKeys.length; i++){
442
+ key = sourceSymbolKeys[i];
443
+ if (excluded.indexOf(key) >= 0) continue;
444
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
445
+ target[key] = source[key];
446
+ }
735
447
  }
736
- return t;
737
- }],
738
- /**
739
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
740
- * timeout is not created.
741
- */
742
- timeout: 0,
743
- xsrfCookieName: "XSRF-TOKEN",
744
- xsrfHeaderName: "X-XSRF-TOKEN",
745
- maxContentLength: -1,
746
- maxBodyLength: -1,
747
- env: {
748
- FormData: F$1.classes.FormData,
749
- Blob: F$1.classes.Blob
750
- },
751
- validateStatus: function(t) {
752
- return t >= 200 && t < 300;
753
- },
754
- headers: {
755
- common: {
756
- Accept: "application/json, text/plain, */*",
757
- "Content-Type": void 0
448
+ return target;
449
+ }
450
+ function _object_without_properties_loose(source, excluded) {
451
+ if (source == null) return {};
452
+ var target = {};
453
+ var sourceKeys = Object.keys(source);
454
+ var key, i;
455
+ for(i = 0; i < sourceKeys.length; i++){
456
+ key = sourceKeys[i];
457
+ if (excluded.indexOf(key) >= 0) continue;
458
+ target[key] = source[key];
758
459
  }
759
- }
760
- };
761
- c.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
762
- ze.headers[e] = {};
763
- });
764
- const Je = ze, Hn = c.toObjectSet([
765
- "age",
766
- "authorization",
767
- "content-length",
768
- "content-type",
769
- "etag",
770
- "expires",
771
- "from",
772
- "host",
773
- "if-modified-since",
774
- "if-unmodified-since",
775
- "last-modified",
776
- "location",
777
- "max-forwards",
778
- "proxy-authorization",
779
- "referer",
780
- "retry-after",
781
- "user-agent"
782
- ]), zn = (e) => {
783
- const t = {};
784
- let n, r, o;
785
- return e && e.split(`
786
- `).forEach(function(i) {
787
- o = i.indexOf(":"), n = i.substring(0, o).trim().toLowerCase(), r = i.substring(o + 1).trim(), !(!n || t[n] && Hn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
788
- }), t;
789
- }, Ze = Symbol("internals");
790
- function ne(e) {
791
- return e && String(e).trim().toLowerCase();
792
- }
793
- function pe(e) {
794
- return e === !1 || e == null ? e : c.isArray(e) ? e.map(pe) : String(e);
795
- }
796
- function Jn(e) {
797
- const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
798
- let r;
799
- for (; r = n.exec(e); )
800
- t[r[1]] = r[2];
801
- return t;
802
- }
803
- const Wn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
804
- function Ne(e, t, n, r, o) {
805
- if (c.isFunction(r))
806
- return r.call(this, t, n);
807
- if (o && (t = n), !!c.isString(t)) {
808
- if (c.isString(r))
809
- return t.indexOf(r) !== -1;
810
- if (c.isRegExp(r))
811
- return r.test(t);
812
- }
460
+ return target;
813
461
  }
814
- function Vn(e) {
815
- return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
816
- }
817
- function Kn(e, t) {
818
- const n = c.toCamelCase(" " + t);
819
- ["get", "set", "has"].forEach((r) => {
820
- Object.defineProperty(e, r + n, {
821
- value: function(o, s, i) {
822
- return this[r].call(this, t, o, s, i);
823
- },
824
- configurable: !0
462
+ function _sliced_to_array(arr, i) {
463
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest();
464
+ }
465
+ function _to_consumable_array$1(arr) {
466
+ return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
467
+ }
468
+ function _unsupported_iterable_to_array$1(o, minLen) {
469
+ if (!o) return;
470
+ if (typeof o === "string") return _array_like_to_array$1(o, minLen);
471
+ var n = Object.prototype.toString.call(o).slice(8, -1);
472
+ if (n === "Object" && o.constructor) n = o.constructor.name;
473
+ if (n === "Map" || n === "Set") return Array.from(n);
474
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
475
+ }
476
+ var u$1 = function(t) {
477
+ return "number" == typeof t && !isNaN(t);
478
+ }, d$1 = function(t) {
479
+ return "string" == typeof t;
480
+ }, p$1 = function(t) {
481
+ return "function" == typeof t;
482
+ }, m$1 = function(t) {
483
+ return d$1(t) || p$1(t) ? t : null;
484
+ }, f$1 = function(t) {
485
+ return React.isValidElement(t) || d$1(t) || p$1(t) || u$1(t);
486
+ };
487
+ function g$1(t, e, n) {
488
+ void 0 === n && (n = 300);
489
+ var o = t.scrollHeight, s = t.style;
490
+ requestAnimationFrame(function() {
491
+ s.minHeight = "initial", s.height = o + "px", s.transition = "all ".concat(n, "ms"), requestAnimationFrame(function() {
492
+ s.height = "0", s.padding = "0", s.margin = "0", setTimeout(e, n);
493
+ });
825
494
  });
826
- });
827
495
  }
828
- class Oe {
829
- constructor(t) {
830
- t && this.set(t);
831
- }
832
- set(t, n, r) {
833
- const o = this;
834
- function s(a, h, p) {
835
- const f = ne(h);
836
- if (!f)
837
- throw new Error("header name must be a non-empty string");
838
- const u = c.findKey(o, f);
839
- (!u || o[u] === void 0 || p === !0 || p === void 0 && o[u] !== !1) && (o[u || h] = pe(a));
840
- }
841
- const i = (a, h) => c.forEach(a, (p, f) => s(p, f, h));
842
- return c.isPlainObject(t) || t instanceof this.constructor ? i(t, n) : c.isString(t) && (t = t.trim()) && !Wn(t) ? i(zn(t), n) : t != null && s(n, t, r), this;
843
- }
844
- get(t, n) {
845
- if (t = ne(t), t) {
846
- const r = c.findKey(this, t);
847
- if (r) {
848
- const o = this[r];
849
- if (!n)
850
- return o;
851
- if (n === !0)
852
- return Jn(o);
853
- if (c.isFunction(n))
854
- return n.call(this, o, r);
855
- if (c.isRegExp(n))
856
- return n.exec(o);
857
- throw new TypeError("parser must be boolean|regexp|function");
858
- }
859
- }
860
- }
861
- has(t, n) {
862
- if (t = ne(t), t) {
863
- const r = c.findKey(this, t);
864
- return !!(r && this[r] !== void 0 && (!n || Ne(this, this[r], r, n)));
865
- }
866
- return !1;
867
- }
868
- delete(t, n) {
869
- const r = this;
870
- let o = !1;
871
- function s(i) {
872
- if (i = ne(i), i) {
873
- const a = c.findKey(r, i);
874
- a && (!n || Ne(r, r[a], a, n)) && (delete r[a], o = !0);
875
- }
876
- }
877
- return c.isArray(t) ? t.forEach(s) : s(t), o;
878
- }
879
- clear(t) {
880
- const n = Object.keys(this);
881
- let r = n.length, o = !1;
882
- for (; r--; ) {
883
- const s = n[r];
884
- (!t || Ne(this, this[s], s, t, !0)) && (delete this[s], o = !0);
885
- }
886
- return o;
887
- }
888
- normalize(t) {
889
- const n = this, r = {};
890
- return c.forEach(this, (o, s) => {
891
- const i = c.findKey(r, s);
892
- if (i) {
893
- n[i] = pe(o), delete n[s];
894
- return;
895
- }
896
- const a = t ? Vn(s) : String(s).trim();
897
- a !== s && delete n[s], n[a] = pe(o), r[a] = !0;
898
- }), this;
899
- }
900
- concat(...t) {
901
- return this.constructor.concat(this, ...t);
902
- }
903
- toJSON(t) {
904
- const n = /* @__PURE__ */ Object.create(null);
905
- return c.forEach(this, (r, o) => {
906
- r != null && r !== !1 && (n[o] = t && c.isArray(r) ? r.join(", ") : r);
907
- }), n;
908
- }
909
- [Symbol.iterator]() {
910
- return Object.entries(this.toJSON())[Symbol.iterator]();
911
- }
912
- toString() {
913
- return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
914
- `);
915
- }
916
- get [Symbol.toStringTag]() {
917
- return "AxiosHeaders";
918
- }
919
- static from(t) {
920
- return t instanceof this ? t : new this(t);
921
- }
922
- static concat(t, ...n) {
923
- const r = new this(t);
924
- return n.forEach((o) => r.set(o)), r;
925
- }
926
- static accessor(t) {
927
- const r = (this[Ze] = this[Ze] = {
928
- accessors: {}
929
- }).accessors, o = this.prototype;
930
- function s(i) {
931
- const a = ne(i);
932
- r[a] || (Kn(o, i), r[a] = !0);
933
- }
934
- return c.isArray(t) ? t.forEach(s) : s(t), this;
935
- }
496
+ function h$1(e) {
497
+ var a = e.enter, r = e.exit, tmp = e.appendPosition, i = tmp === void 0 ? !1 : tmp, tmp1 = e.collapse, _$l = tmp1 === void 0 ? !0 : tmp1, tmp2 = e.collapseDuration, c = tmp2 === void 0 ? 300 : tmp2;
498
+ return function(e) {
499
+ var u = e.children, d = e.position, p = e.preventExitTransition, m = e.done, f = e.nodeRef, _$h = e.isIn;
500
+ var y = i ? "".concat(a, "--").concat(d) : a, v = i ? "".concat(r, "--").concat(d) : r, T = React.useRef(0);
501
+ return React.useLayoutEffect(function() {
502
+ var _t_classList;
503
+ var _$t = f.current, _$e = y.split(" "), _$n = function(o) {
504
+ var _t_classList;
505
+ o.target === f.current && (_$t.dispatchEvent(new Event("d")), _$t.removeEventListener("animationend", _$n), _$t.removeEventListener("animationcancel", _$n), 0 === T.current && "animationcancel" !== o.type && (_t_classList = _$t.classList).remove.apply(_t_classList, _to_consumable_array$1(_$e)));
506
+ };
507
+ (_t_classList = _$t.classList).add.apply(_t_classList, _to_consumable_array$1(_$e)), _$t.addEventListener("animationend", _$n), _$t.addEventListener("animationcancel", _$n);
508
+ }, []), React.useEffect(function() {
509
+ var _$t = f.current, _$e = function() {
510
+ _$t.removeEventListener("animationend", _$e), _$l ? g$1(_$t, m, c) : m();
511
+ };
512
+ _$h || (p ? _$e() : (T.current = 1, _$t.className += " ".concat(v), _$t.addEventListener("animationend", _$e)));
513
+ }, [
514
+ _$h
515
+ ]), React__default["default"].createElement(React__default["default"].Fragment, null, u);
516
+ };
936
517
  }
937
- Oe.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
938
- c.reduceDescriptors(Oe.prototype, ({ value: e }, t) => {
939
- let n = t[0].toUpperCase() + t.slice(1);
940
- return {
941
- get: () => e,
942
- set(r) {
943
- this[n] = r;
944
- }
945
- };
946
- });
947
- c.freezeMethods(Oe);
948
- const M$1 = Oe;
949
- function xe(e, t) {
950
- const n = this || Je, r = t || n, o = M$1.from(r.headers);
951
- let s = r.data;
952
- return c.forEach(e, function(a) {
953
- s = a.call(n, s, o.normalize(), t ? t.status : void 0);
954
- }), o.normalize(), s;
955
- }
956
- function Ct(e) {
957
- return !!(e && e.__CANCEL__);
958
- }
959
- function ce(e, t, n) {
960
- b$1.call(this, e ?? "canceled", b$1.ERR_CANCELED, t, n), this.name = "CanceledError";
961
- }
962
- c.inherits(ce, b$1, {
963
- __CANCEL__: !0
964
- });
965
- function Qn(e, t, n) {
966
- const r = n.config.validateStatus;
967
- !n.status || !r || r(n.status) ? e(n) : t(new b$1(
968
- "Request failed with status code " + n.status,
969
- [b$1.ERR_BAD_REQUEST, b$1.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
970
- n.config,
971
- n.request,
972
- n
973
- ));
974
- }
975
- const Xn = F$1.hasStandardBrowserEnv ? (
976
- // Standard browser envs support document.cookie
977
- {
978
- write(e, t, n, r, o, s) {
979
- const i = [e + "=" + encodeURIComponent(t)];
980
- c.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), c.isString(r) && i.push("path=" + r), c.isString(o) && i.push("domain=" + o), s === !0 && i.push("secure"), document.cookie = i.join("; ");
518
+ function y$1(t, e) {
519
+ return null != t ? {
520
+ content: t.content,
521
+ containerId: t.props.containerId,
522
+ id: t.props.toastId,
523
+ theme: t.props.theme,
524
+ type: t.props.type,
525
+ data: t.props.data || {},
526
+ isLoading: t.props.isLoading,
527
+ icon: t.props.icon,
528
+ status: e
529
+ } : {};
530
+ }
531
+ var v$1 = {
532
+ list: new Map,
533
+ emitQueue: new Map,
534
+ on: function on(t, e) {
535
+ return this.list.has(t) || this.list.set(t, []), this.list.get(t).push(e), this;
981
536
  },
982
- read(e) {
983
- const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
984
- return t ? decodeURIComponent(t[3]) : null;
537
+ off: function off(t, e) {
538
+ if (e) {
539
+ var n = this.list.get(t).filter(function(t) {
540
+ return t !== e;
541
+ });
542
+ return this.list.set(t, n), this;
543
+ }
544
+ return this.list.delete(t), this;
545
+ },
546
+ cancelEmit: function cancelEmit(t) {
547
+ var e = this.emitQueue.get(t);
548
+ return e && (e.forEach(clearTimeout), this.emitQueue.delete(t)), this;
985
549
  },
986
- remove(e) {
987
- this.write(e, "", Date.now() - 864e5);
550
+ emit: function emit(t) {
551
+ var _this = this, _arguments = arguments;
552
+ this.list.has(t) && this.list.get(t).forEach(function(e) {
553
+ var n = setTimeout(function() {
554
+ e.apply(void 0, _to_consumable_array$1([].slice.call(_arguments, 1)));
555
+ }, 0);
556
+ _this.emitQueue.has(t) || _this.emitQueue.set(t, []), _this.emitQueue.get(t).push(n);
557
+ });
988
558
  }
989
- }
990
- ) : (
991
- // Non-standard browser env (web workers, react-native) lack needed support.
992
- {
993
- write() {
559
+ }, T$1 = function(e) {
560
+ var n = e.theme, o = e.type, s = _object_without_properties(e, [
561
+ "theme",
562
+ "type"
563
+ ]);
564
+ return React__default["default"].createElement("svg", _object_spread$1({
565
+ viewBox: "0 0 24 24",
566
+ width: "100%",
567
+ height: "100%",
568
+ fill: "colored" === n ? "currentColor" : "var(--toastify-icon-color-".concat(o, ")")
569
+ }, s));
570
+ }, E$1 = {
571
+ info: function info(e) {
572
+ return React__default["default"].createElement(T$1, _object_spread$1({}, e), React__default["default"].createElement("path", {
573
+ d: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"
574
+ }));
994
575
  },
995
- read() {
996
- return null;
576
+ warning: function warning(e) {
577
+ return React__default["default"].createElement(T$1, _object_spread$1({}, e), React__default["default"].createElement("path", {
578
+ d: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"
579
+ }));
997
580
  },
998
- remove() {
581
+ success: function success(e) {
582
+ return React__default["default"].createElement(T$1, _object_spread$1({}, e), React__default["default"].createElement("path", {
583
+ d: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"
584
+ }));
585
+ },
586
+ error: function error(e) {
587
+ return React__default["default"].createElement(T$1, _object_spread$1({}, e), React__default["default"].createElement("path", {
588
+ d: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"
589
+ }));
590
+ },
591
+ spinner: function spinner() {
592
+ return React__default["default"].createElement("div", {
593
+ className: "Toastify__spinner"
594
+ });
999
595
  }
1000
- }
1001
- );
1002
- function Gn(e) {
1003
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1004
- }
1005
- function Yn(e, t) {
1006
- return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1007
- }
1008
- function Nt(e, t) {
1009
- return e && !Gn(t) ? Yn(e, t) : t;
1010
- }
1011
- const Zn = F$1.hasStandardBrowserEnv ? (
1012
- // Standard browser envs have full support of the APIs needed to test
1013
- // whether the request URL is of the same origin as current location.
1014
- function() {
1015
- const t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");
1016
- let r;
1017
- function o(s) {
1018
- let i = s;
1019
- return t && (n.setAttribute("href", i), i = n.href), n.setAttribute("href", i), {
1020
- href: n.href,
1021
- protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
1022
- host: n.host,
1023
- search: n.search ? n.search.replace(/^\?/, "") : "",
1024
- hash: n.hash ? n.hash.replace(/^#/, "") : "",
1025
- hostname: n.hostname,
1026
- port: n.port,
1027
- pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname
1028
- };
596
+ };
597
+ function C$1(t) {
598
+ var _r = _sliced_to_array(React.useReducer(function(t) {
599
+ return t + 1;
600
+ }, 0), 2), o = _r[1], _i = _sliced_to_array(React.useState([]), 2), _$l = _i[0], c = _i[1], g = React.useRef(null), _$h = React.useRef(new Map).current, T = function(t) {
601
+ return -1 !== _$l.indexOf(t);
602
+ }, C = React.useRef({
603
+ toastKey: 1,
604
+ displayedToast: 0,
605
+ count: 0,
606
+ queue: [],
607
+ props: t,
608
+ containerId: null,
609
+ isToastActive: T,
610
+ getToast: function(t) {
611
+ return _$h.get(t);
612
+ }
613
+ }).current;
614
+ function b(t) {
615
+ var e = t.containerId;
616
+ var _C_props = C.props, _$n = _C_props.limit;
617
+ !_$n || e && C.containerId !== e || (C.count -= C.queue.length, C.queue = []);
1029
618
  }
1030
- return r = o(window.location.href), function(i) {
1031
- const a = c.isString(i) ? o(i) : i;
1032
- return a.protocol === r.protocol && a.host === r.host;
1033
- };
1034
- }()
1035
- ) : (
1036
- // Non standard browser envs (web workers, react-native) lack needed support.
1037
- /* @__PURE__ */ function() {
1038
- return function() {
1039
- return !0;
1040
- };
1041
- }()
1042
- );
1043
- function er(e) {
1044
- const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
1045
- return t && t[1] || "";
1046
- }
1047
- function tr(e, t) {
1048
- e = e || 10;
1049
- const n = new Array(e), r = new Array(e);
1050
- let o = 0, s = 0, i;
1051
- return t = t !== void 0 ? t : 1e3, function(h) {
1052
- const p = Date.now(), f = r[s];
1053
- i || (i = p), n[o] = h, r[o] = p;
1054
- let u = s, E = 0;
1055
- for (; u !== o; )
1056
- E += n[u++], u = u % e;
1057
- if (o = (o + 1) % e, o === s && (s = (s + 1) % e), p - i < t)
1058
- return;
1059
- const y = f && p - f;
1060
- return y ? Math.round(E * 1e3 / y) : void 0;
1061
- };
1062
- }
1063
- function et(e, t) {
1064
- let n = 0;
1065
- const r = tr(50, 250);
1066
- return (o) => {
1067
- const s = o.loaded, i = o.lengthComputable ? o.total : void 0, a = s - n, h = r(a), p = s <= i;
1068
- n = s;
1069
- const f = {
1070
- loaded: s,
1071
- total: i,
1072
- progress: i ? s / i : void 0,
1073
- bytes: a,
1074
- rate: h || void 0,
1075
- estimated: h && i && p ? (i - s) / h : void 0,
1076
- event: o
1077
- };
1078
- f[t ? "download" : "upload"] = !0, e(f);
1079
- };
1080
- }
1081
- const nr = typeof XMLHttpRequest < "u", rr = nr && function(e) {
1082
- return new Promise(function(n, r) {
1083
- let o = e.data;
1084
- const s = M$1.from(e.headers).normalize();
1085
- let { responseType: i, withXSRFToken: a } = e, h;
1086
- function p() {
1087
- e.cancelToken && e.cancelToken.unsubscribe(h), e.signal && e.signal.removeEventListener("abort", h);
619
+ function I(t) {
620
+ c(function(e) {
621
+ return null == t ? [] : e.filter(function(e) {
622
+ return e !== t;
623
+ });
624
+ });
1088
625
  }
1089
- let f;
1090
- if (c.isFormData(o)) {
1091
- if (F$1.hasStandardBrowserEnv || F$1.hasStandardBrowserWebWorkerEnv)
1092
- s.setContentType(!1);
1093
- else if ((f = s.getContentType()) !== !1) {
1094
- const [d, ...m] = f ? f.split(";").map((g) => g.trim()).filter(Boolean) : [];
1095
- s.setContentType([d || "multipart/form-data", ...m].join("; "));
1096
- }
626
+ function _() {
627
+ var _C_queue_shift = C.queue.shift(), _$t = _C_queue_shift.toastContent, e = _C_queue_shift.toastProps, _$n = _C_queue_shift.staleId;
628
+ O(_$t, e, _$n);
1097
629
  }
1098
- let u = new XMLHttpRequest();
1099
- if (e.auth) {
1100
- const d = e.auth.username || "", m = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
1101
- s.set("Authorization", "Basic " + btoa(d + ":" + m));
630
+ function L(t, n) {
631
+ var _$s = n.delay, _$r = n.staleId, _$i = _object_without_properties(n, [
632
+ "delay",
633
+ "staleId"
634
+ ]);
635
+ if (!f$1(t) || function(t) {
636
+ return !g.current || C.props.enableMultiContainer && t.containerId !== C.props.containerId || _$h.has(t.toastId) && null == t.updateId;
637
+ }(_$i)) return;
638
+ var _$l = _$i.toastId, c = _$i.updateId, T = _$i.data, b = C.props, _$L = function() {
639
+ return I(_$l);
640
+ }, N = null == c;
641
+ N && C.count++;
642
+ var M = _object_spread_props(_object_spread$1(_object_spread_props(_object_spread$1({}, b), {
643
+ style: b.toastStyle,
644
+ key: C.toastKey++
645
+ }), Object.fromEntries(Object.entries(_$i).filter(function(t) {
646
+ var _t = _sliced_to_array(t, 2); _t[0]; var _$n = _t[1];
647
+ return null != _$n;
648
+ }))), {
649
+ toastId: _$l,
650
+ updateId: c,
651
+ data: T,
652
+ closeToast: _$L,
653
+ isIn: !1,
654
+ className: m$1(_$i.className || b.toastClassName),
655
+ bodyClassName: m$1(_$i.bodyClassName || b.bodyClassName),
656
+ progressClassName: m$1(_$i.progressClassName || b.progressClassName),
657
+ autoClose: !_$i.isLoading && (R = _$i.autoClose, w = b.autoClose, !1 === R || u$1(R) && R > 0 ? R : w),
658
+ deleteToast: function deleteToast() {
659
+ var _$t = y$1(_$h.get(_$l), "removed");
660
+ _$h.delete(_$l), v$1.emit(4, _$t);
661
+ var _$e = C.queue.length;
662
+ if (C.count = null == _$l ? C.count - C.displayedToast : C.count - 1, C.count < 0 && (C.count = 0), _$e > 0) {
663
+ var _$t1 = null == _$l ? C.props.limit : 1;
664
+ if (1 === _$e || 1 === _$t1) C.displayedToast++, _();
665
+ else {
666
+ var _$n = _$t1 > _$e ? _$e : _$t1;
667
+ C.displayedToast = _$n;
668
+ for(var _$t2 = 0; _$t2 < _$n; _$t2++)_();
669
+ }
670
+ } else o();
671
+ }
672
+ });
673
+ var R, w;
674
+ M.iconOut = function(t) {
675
+ var _$n = t.theme, o = t.type, _$s = t.isLoading, _$r = t.icon, _$i = null;
676
+ var _$l = {
677
+ theme: _$n,
678
+ type: o
679
+ };
680
+ return !1 === _$r || (p$1(_$r) ? _$i = _$r(_$l) : React.isValidElement(_$r) ? _$i = React.cloneElement(_$r, _$l) : d$1(_$r) || u$1(_$r) ? _$i = _$r : _$s ? _$i = E$1.spinner() : function(t) {
681
+ return t in E$1;
682
+ }(o) && (_$i = E$1[o](_$l))), _$i;
683
+ }(M), p$1(_$i.onOpen) && (M.onOpen = _$i.onOpen), p$1(_$i.onClose) && (M.onClose = _$i.onClose), M.closeButton = b.closeButton, !1 === _$i.closeButton || f$1(_$i.closeButton) ? M.closeButton = _$i.closeButton : !0 === _$i.closeButton && (M.closeButton = !f$1(b.closeButton) || b.closeButton);
684
+ var x = t;
685
+ React.isValidElement(t) && !d$1(t.type) ? x = React.cloneElement(t, {
686
+ closeToast: _$L,
687
+ toastProps: M,
688
+ data: T
689
+ }) : p$1(t) && (x = t({
690
+ closeToast: _$L,
691
+ toastProps: M,
692
+ data: T
693
+ })), b.limit && b.limit > 0 && C.count > b.limit && N ? C.queue.push({
694
+ toastContent: x,
695
+ toastProps: M,
696
+ staleId: _$r
697
+ }) : u$1(_$s) ? setTimeout(function() {
698
+ O(x, M, _$r);
699
+ }, _$s) : O(x, M, _$r);
1102
700
  }
1103
- const E = Nt(e.baseURL, e.url);
1104
- u.open(e.method.toUpperCase(), Rt(E, e.params, e.paramsSerializer), !0), u.timeout = e.timeout;
1105
- function y() {
1106
- if (!u)
1107
- return;
1108
- const d = M$1.from(
1109
- "getAllResponseHeaders" in u && u.getAllResponseHeaders()
1110
- ), g = {
1111
- data: !i || i === "text" || i === "json" ? u.responseText : u.response,
1112
- status: u.status,
1113
- statusText: u.statusText,
1114
- headers: d,
1115
- config: e,
1116
- request: u
1117
- };
1118
- Qn(function(A) {
1119
- n(A), p();
1120
- }, function(A) {
1121
- r(A), p();
1122
- }, g), u = null;
701
+ function O(t, e, n) {
702
+ var o = e.toastId;
703
+ n && _$h.delete(n);
704
+ var _$s = {
705
+ content: t,
706
+ props: e
707
+ };
708
+ _$h.set(o, _$s), c(function(t) {
709
+ return _to_consumable_array$1(t).concat([
710
+ o
711
+ ]).filter(function(t) {
712
+ return t !== n;
713
+ });
714
+ }), v$1.emit(4, y$1(_$s, null == _$s.props.updateId ? "added" : "updated"));
1123
715
  }
1124
- if ("onloadend" in u ? u.onloadend = y : u.onreadystatechange = function() {
1125
- !u || u.readyState !== 4 || u.status === 0 && !(u.responseURL && u.responseURL.indexOf("file:") === 0) || setTimeout(y);
1126
- }, u.onabort = function() {
1127
- u && (r(new b$1("Request aborted", b$1.ECONNABORTED, e, u)), u = null);
1128
- }, u.onerror = function() {
1129
- r(new b$1("Network Error", b$1.ERR_NETWORK, e, u)), u = null;
1130
- }, u.ontimeout = function() {
1131
- let m = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded";
1132
- const g = e.transitional || Ot;
1133
- e.timeoutErrorMessage && (m = e.timeoutErrorMessage), r(new b$1(
1134
- m,
1135
- g.clarifyTimeoutError ? b$1.ETIMEDOUT : b$1.ECONNABORTED,
1136
- e,
1137
- u
1138
- )), u = null;
1139
- }, F$1.hasStandardBrowserEnv && (a && c.isFunction(a) && (a = a(e)), a || a !== !1 && Zn(E))) {
1140
- const d = e.xsrfHeaderName && e.xsrfCookieName && Xn.read(e.xsrfCookieName);
1141
- d && s.set(e.xsrfHeaderName, d);
716
+ return React.useEffect(function() {
717
+ return C.containerId = t.containerId, v$1.cancelEmit(3).on(0, L).on(1, function(t) {
718
+ return g.current && I(t);
719
+ }).on(5, b).emit(2, C), function() {
720
+ _$h.clear(), v$1.emit(3, C);
721
+ };
722
+ }, []), React.useEffect(function() {
723
+ C.props = t, C.isToastActive = T, C.displayedToast = _$l.length;
724
+ }), {
725
+ getToastToRender: function getToastToRender(e) {
726
+ var _$n = new Map, o = Array.from(_$h.values());
727
+ return t.newestOnTop && o.reverse(), o.forEach(function(t) {
728
+ var _t_props = t.props, e = _t_props.position;
729
+ _$n.has(e) || _$n.set(e, []), _$n.get(e).push(t);
730
+ }), Array.from(_$n, function(t) {
731
+ return e(t[0], t[1]);
732
+ });
733
+ },
734
+ containerRef: g,
735
+ isToastActive: T
736
+ };
737
+ }
738
+ function b$1(t) {
739
+ return t.targetTouches && t.targetTouches.length >= 1 ? t.targetTouches[0].clientX : t.clientX;
740
+ }
741
+ function I$1(t) {
742
+ return t.targetTouches && t.targetTouches.length >= 1 ? t.targetTouches[0].clientY : t.clientY;
743
+ }
744
+ function _$1(t) {
745
+ var _i = _sliced_to_array(React.useState(!1), 2), o = _i[0], a = _i[1], _i1 = _sliced_to_array(React.useState(!1), 2), r = _i1[0], _$l = _i1[1], c = React.useRef(null), u = React.useRef({
746
+ start: 0,
747
+ x: 0,
748
+ y: 0,
749
+ delta: 0,
750
+ removalDistance: 0,
751
+ canCloseOnClick: !0,
752
+ canDrag: !1,
753
+ boundingRect: null,
754
+ didMove: !1
755
+ }).current, d = React.useRef(t), m = t.autoClose, f = t.pauseOnHover, g = t.closeToast, _$h = t.onClick, y = t.closeOnClick;
756
+ function v(e) {
757
+ if (t.draggable) {
758
+ "touchstart" === e.nativeEvent.type && e.nativeEvent.preventDefault(), u.didMove = !1, document.addEventListener("mousemove", _), document.addEventListener("mouseup", L), document.addEventListener("touchmove", _), document.addEventListener("touchend", L);
759
+ var _$n = c.current;
760
+ u.canCloseOnClick = !0, u.canDrag = !0, u.boundingRect = _$n.getBoundingClientRect(), _$n.style.transition = "", u.x = b$1(e.nativeEvent), u.y = I$1(e.nativeEvent), "x" === t.draggableDirection ? (u.start = u.x, u.removalDistance = _$n.offsetWidth * (t.draggablePercent / 100)) : (u.start = u.y, u.removalDistance = _$n.offsetHeight * (80 === t.draggablePercent ? 1.5 * t.draggablePercent : t.draggablePercent / 100));
761
+ }
1142
762
  }
1143
- o === void 0 && s.setContentType(null), "setRequestHeader" in u && c.forEach(s.toJSON(), function(m, g) {
1144
- u.setRequestHeader(g, m);
1145
- }), c.isUndefined(e.withCredentials) || (u.withCredentials = !!e.withCredentials), i && i !== "json" && (u.responseType = e.responseType), typeof e.onDownloadProgress == "function" && u.addEventListener("progress", et(e.onDownloadProgress, !0)), typeof e.onUploadProgress == "function" && u.upload && u.upload.addEventListener("progress", et(e.onUploadProgress)), (e.cancelToken || e.signal) && (h = (d) => {
1146
- u && (r(!d || d.type ? new ce(null, e, u) : d), u.abort(), u = null);
1147
- }, e.cancelToken && e.cancelToken.subscribe(h), e.signal && (e.signal.aborted ? h() : e.signal.addEventListener("abort", h)));
1148
- const l = er(E);
1149
- if (l && F$1.protocols.indexOf(l) === -1) {
1150
- r(new b$1("Unsupported protocol " + l + ":", b$1.ERR_BAD_REQUEST, e));
1151
- return;
763
+ function T(e) {
764
+ if (u.boundingRect) {
765
+ var _u_boundingRect = u.boundingRect, _$n = _u_boundingRect.top, o = _u_boundingRect.bottom, _$s = _u_boundingRect.left, a = _u_boundingRect.right;
766
+ "touchend" !== e.nativeEvent.type && t.pauseOnHover && u.x >= _$s && u.x <= a && u.y >= _$n && u.y <= o ? C() : E();
767
+ }
1152
768
  }
1153
- u.send(o || null);
1154
- });
1155
- }, Me = {
1156
- http: xn,
1157
- xhr: rr
1158
- };
1159
- c.forEach(Me, (e, t) => {
1160
- if (e) {
1161
- try {
1162
- Object.defineProperty(e, "name", { value: t });
1163
- } catch {
769
+ function E() {
770
+ a(!0);
1164
771
  }
1165
- Object.defineProperty(e, "adapterName", { value: t });
1166
- }
1167
- });
1168
- const tt = (e) => `- ${e}`, sr = (e) => c.isFunction(e) || e === null || e === !1, xt = {
1169
- getAdapter: (e) => {
1170
- e = c.isArray(e) ? e : [e];
1171
- const { length: t } = e;
1172
- let n, r;
1173
- const o = {};
1174
- for (let s = 0; s < t; s++) {
1175
- n = e[s];
1176
- let i;
1177
- if (r = n, !sr(n) && (r = Me[(i = String(n)).toLowerCase()], r === void 0))
1178
- throw new b$1(`Unknown adapter '${i}'`);
1179
- if (r)
1180
- break;
1181
- o[i || "#" + s] = r;
772
+ function C() {
773
+ a(!1);
1182
774
  }
1183
- if (!r) {
1184
- const s = Object.entries(o).map(
1185
- ([a, h]) => `adapter ${a} ` + (h === !1 ? "is not supported by the environment" : "is not available in the build")
1186
- );
1187
- let i = t ? s.length > 1 ? `since :
1188
- ` + s.map(tt).join(`
1189
- `) : " " + tt(s[0]) : "as no adapter specified";
1190
- throw new b$1(
1191
- "There is no suitable adapter to dispatch the request " + i,
1192
- "ERR_NOT_SUPPORT"
1193
- );
775
+ function _(e) {
776
+ var _$n = c.current;
777
+ u.canDrag && _$n && (u.didMove = !0, o && C(), u.x = b$1(e), u.y = I$1(e), u.delta = "x" === t.draggableDirection ? u.x - u.start : u.y - u.start, u.start !== u.x && (u.canCloseOnClick = !1), _$n.style.transform = "translate".concat(t.draggableDirection, "(").concat(u.delta, "px)"), _$n.style.opacity = "" + (1 - Math.abs(u.delta / u.removalDistance)));
1194
778
  }
1195
- return r;
1196
- },
1197
- adapters: Me
1198
- };
1199
- function _e(e) {
1200
- if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1201
- throw new ce(null, e);
1202
- }
1203
- function nt(e) {
1204
- return _e(e), e.headers = M$1.from(e.headers), e.data = xe.call(
1205
- e,
1206
- e.transformRequest
1207
- ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), xt.getAdapter(e.adapter || Je.adapter)(e).then(function(r) {
1208
- return _e(e), r.data = xe.call(
1209
- e,
1210
- e.transformResponse,
1211
- r
1212
- ), r.headers = M$1.from(r.headers), r;
1213
- }, function(r) {
1214
- return Ct(r) || (_e(e), r && r.response && (r.response.data = xe.call(
1215
- e,
1216
- e.transformResponse,
1217
- r.response
1218
- ), r.response.headers = M$1.from(r.response.headers))), Promise.reject(r);
1219
- });
1220
- }
1221
- const rt = (e) => e instanceof M$1 ? e.toJSON() : e;
1222
- function ee(e, t) {
1223
- t = t || {};
1224
- const n = {};
1225
- function r(p, f, u) {
1226
- return c.isPlainObject(p) && c.isPlainObject(f) ? c.merge.call({ caseless: u }, p, f) : c.isPlainObject(f) ? c.merge({}, f) : c.isArray(f) ? f.slice() : f;
1227
- }
1228
- function o(p, f, u) {
1229
- if (c.isUndefined(f)) {
1230
- if (!c.isUndefined(p))
1231
- return r(void 0, p, u);
1232
- } else
1233
- return r(p, f, u);
1234
- }
1235
- function s(p, f) {
1236
- if (!c.isUndefined(f))
1237
- return r(void 0, f);
1238
- }
1239
- function i(p, f) {
1240
- if (c.isUndefined(f)) {
1241
- if (!c.isUndefined(p))
1242
- return r(void 0, p);
1243
- } else
1244
- return r(void 0, f);
1245
- }
1246
- function a(p, f, u) {
1247
- if (u in t)
1248
- return r(p, f);
1249
- if (u in e)
1250
- return r(void 0, p);
1251
- }
1252
- const h = {
1253
- url: s,
1254
- method: s,
1255
- data: s,
1256
- baseURL: i,
1257
- transformRequest: i,
1258
- transformResponse: i,
1259
- paramsSerializer: i,
1260
- timeout: i,
1261
- timeoutMessage: i,
1262
- withCredentials: i,
1263
- withXSRFToken: i,
1264
- adapter: i,
1265
- responseType: i,
1266
- xsrfCookieName: i,
1267
- xsrfHeaderName: i,
1268
- onUploadProgress: i,
1269
- onDownloadProgress: i,
1270
- decompress: i,
1271
- maxContentLength: i,
1272
- maxBodyLength: i,
1273
- beforeRedirect: i,
1274
- transport: i,
1275
- httpAgent: i,
1276
- httpsAgent: i,
1277
- cancelToken: i,
1278
- socketPath: i,
1279
- responseEncoding: i,
1280
- validateStatus: a,
1281
- headers: (p, f) => o(rt(p), rt(f), !0)
1282
- };
1283
- return c.forEach(Object.keys(Object.assign({}, e, t)), function(f) {
1284
- const u = h[f] || o, E = u(e[f], t[f], f);
1285
- c.isUndefined(E) && u !== a || (n[f] = E);
1286
- }), n;
1287
- }
1288
- const _t = "1.6.7", We = {};
1289
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
1290
- We[e] = function(r) {
1291
- return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
1292
- };
1293
- });
1294
- const st = {};
1295
- We.transitional = function(t, n, r) {
1296
- function o(s, i) {
1297
- return "[Axios v" + _t + "] Transitional option '" + s + "'" + i + (r ? ". " + r : "");
1298
- }
1299
- return (s, i, a) => {
1300
- if (t === !1)
1301
- throw new b$1(
1302
- o(i, " has been removed" + (n ? " in " + n : "")),
1303
- b$1.ERR_DEPRECATED
1304
- );
1305
- return n && !st[i] && (st[i] = !0, console.warn(
1306
- o(
1307
- i,
1308
- " has been deprecated since v" + n + " and will be removed in the near future"
1309
- )
1310
- )), t ? t(s, i, a) : !0;
1311
- };
1312
- };
1313
- function or(e, t, n) {
1314
- if (typeof e != "object")
1315
- throw new b$1("options must be an object", b$1.ERR_BAD_OPTION_VALUE);
1316
- const r = Object.keys(e);
1317
- let o = r.length;
1318
- for (; o-- > 0; ) {
1319
- const s = r[o], i = t[s];
1320
- if (i) {
1321
- const a = e[s], h = a === void 0 || i(a, s, e);
1322
- if (h !== !0)
1323
- throw new b$1("option " + s + " must be " + h, b$1.ERR_BAD_OPTION_VALUE);
1324
- continue;
779
+ function L() {
780
+ document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", L), document.removeEventListener("touchmove", _), document.removeEventListener("touchend", L);
781
+ var e = c.current;
782
+ if (u.canDrag && u.didMove && e) {
783
+ if (u.canDrag = !1, Math.abs(u.delta) > u.removalDistance) return _$l(!0), void t.closeToast();
784
+ e.style.transition = "transform 0.2s, opacity 0.2s", e.style.transform = "translate".concat(t.draggableDirection, "(0)"), e.style.opacity = "1";
785
+ }
1325
786
  }
1326
- if (n !== !0)
1327
- throw new b$1("Unknown option " + s, b$1.ERR_BAD_OPTION);
1328
- }
1329
- }
1330
- const Ue = {
1331
- assertOptions: or,
1332
- validators: We
1333
- }, q$1 = Ue.validators;
1334
- class ye {
1335
- constructor(t) {
1336
- this.defaults = t, this.interceptors = {
1337
- request: new Ye(),
1338
- response: new Ye()
787
+ React.useEffect(function() {
788
+ d.current = t;
789
+ }), React.useEffect(function() {
790
+ return c.current && c.current.addEventListener("d", E, {
791
+ once: !0
792
+ }), p$1(t.onOpen) && t.onOpen(React.isValidElement(t.children) && t.children.props), function() {
793
+ var _$t = d.current;
794
+ p$1(_$t.onClose) && _$t.onClose(React.isValidElement(_$t.children) && _$t.children.props);
795
+ };
796
+ }, []), React.useEffect(function() {
797
+ return t.pauseOnFocusLoss && (document.hasFocus() || C(), window.addEventListener("focus", E), window.addEventListener("blur", C)), function() {
798
+ t.pauseOnFocusLoss && (window.removeEventListener("focus", E), window.removeEventListener("blur", C));
799
+ };
800
+ }, [
801
+ t.pauseOnFocusLoss
802
+ ]);
803
+ var O = {
804
+ onMouseDown: v,
805
+ onTouchStart: v,
806
+ onMouseUp: T,
807
+ onTouchEnd: T
1339
808
  };
1340
- }
1341
- /**
1342
- * Dispatch a request
1343
- *
1344
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
1345
- * @param {?Object} config
1346
- *
1347
- * @returns {Promise} The Promise to be fulfilled
1348
- */
1349
- async request(t, n) {
1350
- try {
1351
- return await this._request(t, n);
1352
- } catch (r) {
1353
- if (r instanceof Error) {
1354
- let o;
1355
- Error.captureStackTrace ? Error.captureStackTrace(o = {}) : o = new Error();
1356
- const s = o.stack ? o.stack.replace(/^.+\n/, "") : "";
1357
- r.stack ? s && !String(r.stack).endsWith(s.replace(/^.+\n.+\n/, "")) && (r.stack += `
1358
- ` + s) : r.stack = s;
1359
- }
1360
- throw r;
1361
- }
1362
- }
1363
- _request(t, n) {
1364
- typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = ee(this.defaults, n);
1365
- const { transitional: r, paramsSerializer: o, headers: s } = n;
1366
- r !== void 0 && Ue.assertOptions(r, {
1367
- silentJSONParsing: q$1.transitional(q$1.boolean),
1368
- forcedJSONParsing: q$1.transitional(q$1.boolean),
1369
- clarifyTimeoutError: q$1.transitional(q$1.boolean)
1370
- }, !1), o != null && (c.isFunction(o) ? n.paramsSerializer = {
1371
- serialize: o
1372
- } : Ue.assertOptions(o, {
1373
- encode: q$1.function,
1374
- serialize: q$1.function
1375
- }, !0)), n.method = (n.method || this.defaults.method || "get").toLowerCase();
1376
- let i = s && c.merge(
1377
- s.common,
1378
- s[n.method]
1379
- );
1380
- s && c.forEach(
1381
- ["delete", "get", "head", "post", "put", "patch", "common"],
1382
- (l) => {
1383
- delete s[l];
1384
- }
1385
- ), n.headers = M$1.concat(i, s);
1386
- const a = [];
1387
- let h = !0;
1388
- this.interceptors.request.forEach(function(d) {
1389
- typeof d.runWhen == "function" && d.runWhen(n) === !1 || (h = h && d.synchronous, a.unshift(d.fulfilled, d.rejected));
1390
- });
1391
- const p = [];
1392
- this.interceptors.response.forEach(function(d) {
1393
- p.push(d.fulfilled, d.rejected);
809
+ return m && f && (O.onMouseEnter = C, O.onMouseLeave = E), y && (O.onClick = function(t) {
810
+ _$h && _$h(t), u.canCloseOnClick && g();
811
+ }), {
812
+ playToast: E,
813
+ pauseToast: C,
814
+ isRunning: o,
815
+ preventExitTransition: r,
816
+ toastRef: c,
817
+ eventHandlers: O
818
+ };
819
+ }
820
+ function L$1(e) {
821
+ var n = e.closeToast, o = e.theme, tmp = e.ariaLabel, s = tmp === void 0 ? "close" : tmp;
822
+ return React__default["default"].createElement("button", {
823
+ className: "Toastify__close-button Toastify__close-button--".concat(o),
824
+ type: "button",
825
+ onClick: function(t) {
826
+ t.stopPropagation(), n(t);
827
+ },
828
+ "aria-label": s
829
+ }, React__default["default"].createElement("svg", {
830
+ "aria-hidden": "true",
831
+ viewBox: "0 0 14 16"
832
+ }, React__default["default"].createElement("path", {
833
+ fillRule: "evenodd",
834
+ d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"
835
+ })));
836
+ }
837
+ function O$1(e) {
838
+ var n = e.delay, o = e.isRunning, s = e.closeToast, tmp = e.type, a = tmp === void 0 ? "default" : tmp, r = e.hide, i = e.className, _$l = e.style, u = e.controlledProgress, d = e.progress, m = e.rtl, f = e.isIn, g = e.theme;
839
+ var _$h = r || u && 0 === d, y = _object_spread_props(_object_spread$1({}, _$l), {
840
+ animationDuration: "".concat(n, "ms"),
841
+ animationPlayState: o ? "running" : "paused",
842
+ opacity: _$h ? 0 : 1
1394
843
  });
1395
- let f, u = 0, E;
1396
- if (!h) {
1397
- const l = [nt.bind(this), void 0];
1398
- for (l.unshift.apply(l, a), l.push.apply(l, p), E = l.length, f = Promise.resolve(n); u < E; )
1399
- f = f.then(l[u++], l[u++]);
1400
- return f;
1401
- }
1402
- E = a.length;
1403
- let y = n;
1404
- for (u = 0; u < E; ) {
1405
- const l = a[u++], d = a[u++];
1406
- try {
1407
- y = l(y);
1408
- } catch (m) {
1409
- d.call(this, m);
1410
- break;
1411
- }
1412
- }
1413
- try {
1414
- f = nt.call(this, y);
1415
- } catch (l) {
1416
- return Promise.reject(l);
1417
- }
1418
- for (u = 0, E = p.length; u < E; )
1419
- f = f.then(p[u++], p[u++]);
1420
- return f;
1421
- }
1422
- getUri(t) {
1423
- t = ee(this.defaults, t);
1424
- const n = Nt(t.baseURL, t.url);
1425
- return Rt(n, t.params, t.paramsSerializer);
1426
- }
844
+ u && (y.transform = "scaleX(".concat(d, ")"));
845
+ var v = clsx$1("Toastify__progress-bar", u ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", "Toastify__progress-bar-theme--".concat(g), "Toastify__progress-bar--".concat(a), {
846
+ "Toastify__progress-bar--rtl": m
847
+ }), T = p$1(i) ? i({
848
+ rtl: m,
849
+ type: a,
850
+ defaultClassName: v
851
+ }) : clsx$1(v, i);
852
+ return React__default["default"].createElement("div", _define_property$1({
853
+ role: "progressbar",
854
+ "aria-hidden": _$h ? "true" : "false",
855
+ "aria-label": "notification timer",
856
+ className: T,
857
+ style: y
858
+ }, u && d >= 1 ? "onTransitionEnd" : "onAnimationEnd", u && d < 1 ? null : function() {
859
+ f && s();
860
+ }));
1427
861
  }
1428
- c.forEach(["delete", "get", "head", "options"], function(t) {
1429
- ye.prototype[t] = function(n, r) {
1430
- return this.request(ee(r || {}, {
1431
- method: t,
1432
- url: n,
1433
- data: (r || {}).data
862
+ var N$1 = function(n) {
863
+ var _$_ = _$1(n), o = _$_.isRunning, s = _$_.preventExitTransition, r = _$_.toastRef, i = _$_.eventHandlers, _$l = n.closeButton, u = n.children, d = n.autoClose, m = n.onClick, f = n.type, g = n.hideProgressBar, _$h = n.closeToast, y = n.transition, v = n.position, T = n.className, E = n.style, C = n.bodyClassName, b = n.bodyStyle, I = n.progressClassName, N = n.progressStyle, M = n.updateId, R = n.role, w = n.progress, x = n.rtl, $ = n.toastId, k = n.deleteToast, P = n.isIn, B = n.isLoading, D = n.iconOut, A = n.closeOnClick, z = n.theme, F = clsx$1("Toastify__toast", "Toastify__toast-theme--".concat(z), "Toastify__toast--".concat(f), {
864
+ "Toastify__toast--rtl": x
865
+ }, {
866
+ "Toastify__toast--close-on-click": A
867
+ }), H = p$1(T) ? T({
868
+ rtl: x,
869
+ position: v,
870
+ type: f,
871
+ defaultClassName: F
872
+ }) : clsx$1(F, T), S = !!w || !d, _$q = {
873
+ closeToast: _$h,
874
+ type: f,
875
+ theme: z
876
+ };
877
+ var _$Q = null;
878
+ return !1 === _$l || (_$Q = p$1(_$l) ? _$l(_$q) : React.isValidElement(_$l) ? React.cloneElement(_$l, _$q) : L$1(_$q)), React__default["default"].createElement(y, {
879
+ isIn: P,
880
+ done: k,
881
+ position: v,
882
+ preventExitTransition: s,
883
+ nodeRef: r
884
+ }, React__default["default"].createElement("div", _object_spread_props(_object_spread$1({
885
+ id: $,
886
+ onClick: m,
887
+ className: H
888
+ }, i), {
889
+ style: E,
890
+ ref: r
891
+ }), React__default["default"].createElement("div", _object_spread_props(_object_spread$1({}, P && {
892
+ role: R
893
+ }), {
894
+ className: p$1(C) ? C({
895
+ type: f
896
+ }) : clsx$1("Toastify__toast-body", C),
897
+ style: b
898
+ }), null != D && React__default["default"].createElement("div", {
899
+ className: clsx$1("Toastify__toast-icon", {
900
+ "Toastify--animate-icon Toastify__zoom-enter": !B
901
+ })
902
+ }, D), React__default["default"].createElement("div", null, u)), _$Q, React__default["default"].createElement(O$1, _object_spread_props(_object_spread$1({}, M && !S ? {
903
+ key: "pb-".concat(M)
904
+ } : {}), {
905
+ rtl: x,
906
+ theme: z,
907
+ delay: d,
908
+ isRunning: o,
909
+ isIn: P,
910
+ closeToast: _$h,
911
+ hide: g,
912
+ type: f,
913
+ style: N,
914
+ className: I,
915
+ controlledProgress: S,
916
+ progress: w || 0
917
+ }))));
918
+ }, M$1 = function M(t, e) {
919
+ return void 0 === e && (e = !1), {
920
+ enter: "Toastify--animate Toastify__".concat(t, "-enter"),
921
+ exit: "Toastify--animate Toastify__".concat(t, "-exit"),
922
+ appendPosition: e
923
+ };
924
+ }, R$1 = h$1(M$1("bounce", !0)); h$1(M$1("slide", !0)); h$1(M$1("zoom")); h$1(M$1("flip")); var k$1 = React.forwardRef(function(e, n) {
925
+ var f = function f(t) {
926
+ var _$e = clsx$1("Toastify__toast-container", "Toastify__toast-container--".concat(t), {
927
+ "Toastify__toast-container--rtl": u
928
+ });
929
+ return p$1(i) ? i({
930
+ position: t,
931
+ rtl: u,
932
+ defaultClassName: _$e
933
+ }) : clsx$1(_$e, m$1(i));
934
+ };
935
+ var _C = C$1(e), o = _C.getToastToRender, a = _C.containerRef, r = _C.isToastActive, i = e.className, _$l = e.style, u = e.rtl, d = e.containerId;
936
+ return React.useEffect(function() {
937
+ n && (n.current = a.current);
938
+ }, []), React__default["default"].createElement("div", {
939
+ ref: a,
940
+ className: "Toastify",
941
+ id: d
942
+ }, o(function(e, n) {
943
+ var o = n.length ? _object_spread$1({}, _$l) : _object_spread_props(_object_spread$1({}, _$l), {
944
+ pointerEvents: "none"
945
+ });
946
+ return React__default["default"].createElement("div", {
947
+ className: f(e),
948
+ style: o,
949
+ key: "container-".concat(e)
950
+ }, n.map(function(e, o) {
951
+ var _$s = e.content, a = e.props;
952
+ return React__default["default"].createElement(N$1, _object_spread_props(_object_spread$1({}, a), {
953
+ isIn: r(a.toastId),
954
+ style: _object_spread_props(_object_spread$1({}, a.style), {
955
+ "--nth": o + 1,
956
+ "--len": n.length
957
+ }),
958
+ key: "toast-".concat(a.key)
959
+ }), _$s);
960
+ }));
1434
961
  }));
1435
- };
1436
962
  });
1437
- c.forEach(["post", "put", "patch"], function(t) {
1438
- function n(r) {
1439
- return function(s, i, a) {
1440
- return this.request(ee(a || {}, {
1441
- method: t,
1442
- headers: r ? {
1443
- "Content-Type": "multipart/form-data"
1444
- } : {},
1445
- url: s,
1446
- data: i
1447
- }));
963
+ k$1.displayName = "ToastContainer", k$1.defaultProps = {
964
+ position: "top-right",
965
+ transition: R$1,
966
+ autoClose: 5e3,
967
+ closeButton: L$1,
968
+ pauseOnHover: !0,
969
+ pauseOnFocusLoss: !0,
970
+ closeOnClick: !0,
971
+ draggable: !0,
972
+ draggablePercent: 80,
973
+ draggableDirection: "x",
974
+ role: "alert",
975
+ theme: "light"
976
+ };
977
+ var P$1, B$1 = new Map, D$1 = [], A$1 = 1;
978
+ function z$1() {
979
+ return "" + A$1++;
980
+ }
981
+ function F$1(t) {
982
+ return t && (d$1(t.toastId) || u$1(t.toastId)) ? t.toastId : z$1();
983
+ }
984
+ function H$1(t, e) {
985
+ return B$1.size > 0 ? v$1.emit(0, t, e) : D$1.push({
986
+ content: t,
987
+ options: e
988
+ }), e.toastId;
989
+ }
990
+ function S$1(t, e) {
991
+ return _object_spread_props(_object_spread$1({}, e), {
992
+ type: e && e.type || t,
993
+ toastId: F$1(e)
994
+ });
995
+ }
996
+ function q$1(t) {
997
+ return function(e, n) {
998
+ return H$1(e, S$1(t, n));
1448
999
  };
1449
- }
1450
- ye.prototype[t] = n(), ye.prototype[t + "Form"] = n(!0);
1451
- });
1452
- const he = ye;
1453
- class Ve {
1454
- constructor(t) {
1455
- if (typeof t != "function")
1456
- throw new TypeError("executor must be a function.");
1457
- let n;
1458
- this.promise = new Promise(function(s) {
1459
- n = s;
1000
+ }
1001
+ function Q$1(t, e) {
1002
+ return H$1(t, S$1("default", e));
1003
+ }
1004
+ Q$1.loading = function(t, e) {
1005
+ return H$1(t, S$1("default", _object_spread$1({
1006
+ isLoading: !0,
1007
+ autoClose: !1,
1008
+ closeOnClick: !1,
1009
+ closeButton: !1,
1010
+ draggable: !1
1011
+ }, e)));
1012
+ }, Q$1.promise = function(t, e, n) {
1013
+ var o, s = e.pending, a = e.error, r = e.success;
1014
+ s && (o = d$1(s) ? Q$1.loading(s, n) : Q$1.loading(s.render, _object_spread$1({}, n, s)));
1015
+ var i = {
1016
+ isLoading: null,
1017
+ autoClose: null,
1018
+ closeOnClick: null,
1019
+ closeButton: null,
1020
+ draggable: null
1021
+ }, _$l = function(t, e, s) {
1022
+ if (null == e) return void Q$1.dismiss(o);
1023
+ var a = _object_spread_props(_object_spread$1({
1024
+ type: t
1025
+ }, i, n), {
1026
+ data: s
1027
+ }), r = d$1(e) ? {
1028
+ render: e
1029
+ } : e;
1030
+ return o ? Q$1.update(o, _object_spread$1({}, a, r)) : Q$1(r.render, _object_spread$1({}, a, r)), s;
1031
+ }, c = p$1(t) ? t() : t;
1032
+ return c.then(function(t) {
1033
+ return _$l("success", r, t);
1034
+ }).catch(function(t) {
1035
+ return _$l("error", a, t);
1036
+ }), c;
1037
+ }, Q$1.success = q$1("success"), Q$1.info = q$1("info"), Q$1.error = q$1("error"), Q$1.warning = q$1("warning"), Q$1.warn = Q$1.warning, Q$1.dark = function(t, e) {
1038
+ return H$1(t, S$1("default", _object_spread$1({
1039
+ theme: "dark"
1040
+ }, e)));
1041
+ }, Q$1.dismiss = function(t) {
1042
+ B$1.size > 0 ? v$1.emit(1, t) : D$1 = D$1.filter(function(e) {
1043
+ return null != t && e.options.toastId !== t;
1460
1044
  });
1461
- const r = this;
1462
- this.promise.then((o) => {
1463
- if (!r._listeners)
1464
- return;
1465
- let s = r._listeners.length;
1466
- for (; s-- > 0; )
1467
- r._listeners[s](o);
1468
- r._listeners = null;
1469
- }), this.promise.then = (o) => {
1470
- let s;
1471
- const i = new Promise((a) => {
1472
- r.subscribe(a), s = a;
1473
- }).then(o);
1474
- return i.cancel = function() {
1475
- r.unsubscribe(s);
1476
- }, i;
1477
- }, t(function(s, i, a) {
1478
- r.reason || (r.reason = new ce(s, i, a), n(r.reason));
1045
+ }, Q$1.clearWaitingQueue = function(t) {
1046
+ return void 0 === t && (t = {}), v$1.emit(5, t);
1047
+ }, Q$1.isActive = function(t) {
1048
+ var e = !1;
1049
+ return B$1.forEach(function(n) {
1050
+ n.isToastActive && n.isToastActive(t) && (e = !0);
1051
+ }), e;
1052
+ }, Q$1.update = function(t, e) {
1053
+ void 0 === e && (e = {}), setTimeout(function() {
1054
+ var n = function(t, e) {
1055
+ var n = e.containerId;
1056
+ var o = B$1.get(n || P$1);
1057
+ return o && o.getToast(t);
1058
+ }(t, e);
1059
+ if (n) {
1060
+ var o = n.props, s = n.content, a = _object_spread_props(_object_spread$1({
1061
+ delay: 100
1062
+ }, o, e), {
1063
+ toastId: e.toastId || t,
1064
+ updateId: z$1()
1065
+ });
1066
+ a.toastId !== t && (a.staleId = t);
1067
+ var r = a.render || s;
1068
+ delete a.render, H$1(r, a);
1069
+ }
1070
+ }, 0);
1071
+ }, Q$1.done = function(t) {
1072
+ Q$1.update(t, {
1073
+ progress: 1
1479
1074
  });
1480
- }
1481
- /**
1482
- * Throws a `CanceledError` if cancellation has been requested.
1483
- */
1484
- throwIfRequested() {
1485
- if (this.reason)
1486
- throw this.reason;
1487
- }
1488
- /**
1489
- * Subscribe to the cancel signal
1490
- */
1491
- subscribe(t) {
1492
- if (this.reason) {
1493
- t(this.reason);
1494
- return;
1495
- }
1496
- this._listeners ? this._listeners.push(t) : this._listeners = [t];
1497
- }
1498
- /**
1499
- * Unsubscribe from the cancel signal
1500
- */
1501
- unsubscribe(t) {
1502
- if (!this._listeners)
1503
- return;
1504
- const n = this._listeners.indexOf(t);
1505
- n !== -1 && this._listeners.splice(n, 1);
1506
- }
1507
- /**
1508
- * Returns an object that contains a new `CancelToken` and a function that, when called,
1509
- * cancels the `CancelToken`.
1510
- */
1511
- static source() {
1512
- let t;
1513
- return {
1514
- token: new Ve(function(o) {
1515
- t = o;
1516
- }),
1517
- cancel: t
1075
+ }, Q$1.onChange = function(t) {
1076
+ return v$1.on(4, t), function() {
1077
+ v$1.off(4, t);
1518
1078
  };
1519
- }
1520
- }
1521
- const ir = Ve;
1522
- function ar(e) {
1523
- return function(n) {
1524
- return e.apply(null, n);
1525
- };
1526
- }
1527
- function cr(e) {
1528
- return c.isObject(e) && e.isAxiosError === !0;
1529
- }
1530
- const $e = {
1531
- Continue: 100,
1532
- SwitchingProtocols: 101,
1533
- Processing: 102,
1534
- EarlyHints: 103,
1535
- Ok: 200,
1536
- Created: 201,
1537
- Accepted: 202,
1538
- NonAuthoritativeInformation: 203,
1539
- NoContent: 204,
1540
- ResetContent: 205,
1541
- PartialContent: 206,
1542
- MultiStatus: 207,
1543
- AlreadyReported: 208,
1544
- ImUsed: 226,
1545
- MultipleChoices: 300,
1546
- MovedPermanently: 301,
1547
- Found: 302,
1548
- SeeOther: 303,
1549
- NotModified: 304,
1550
- UseProxy: 305,
1551
- Unused: 306,
1552
- TemporaryRedirect: 307,
1553
- PermanentRedirect: 308,
1554
- BadRequest: 400,
1555
- Unauthorized: 401,
1556
- PaymentRequired: 402,
1557
- Forbidden: 403,
1558
- NotFound: 404,
1559
- MethodNotAllowed: 405,
1560
- NotAcceptable: 406,
1561
- ProxyAuthenticationRequired: 407,
1562
- RequestTimeout: 408,
1563
- Conflict: 409,
1564
- Gone: 410,
1565
- LengthRequired: 411,
1566
- PreconditionFailed: 412,
1567
- PayloadTooLarge: 413,
1568
- UriTooLong: 414,
1569
- UnsupportedMediaType: 415,
1570
- RangeNotSatisfiable: 416,
1571
- ExpectationFailed: 417,
1572
- ImATeapot: 418,
1573
- MisdirectedRequest: 421,
1574
- UnprocessableEntity: 422,
1575
- Locked: 423,
1576
- FailedDependency: 424,
1577
- TooEarly: 425,
1578
- UpgradeRequired: 426,
1579
- PreconditionRequired: 428,
1580
- TooManyRequests: 429,
1581
- RequestHeaderFieldsTooLarge: 431,
1582
- UnavailableForLegalReasons: 451,
1583
- InternalServerError: 500,
1584
- NotImplemented: 501,
1585
- BadGateway: 502,
1586
- ServiceUnavailable: 503,
1587
- GatewayTimeout: 504,
1588
- HttpVersionNotSupported: 505,
1589
- VariantAlsoNegotiates: 506,
1590
- InsufficientStorage: 507,
1591
- LoopDetected: 508,
1592
- NotExtended: 510,
1593
- NetworkAuthenticationRequired: 511
1594
- };
1595
- Object.entries($e).forEach(([e, t]) => {
1596
- $e[t] = e;
1079
+ }, Q$1.POSITION = {
1080
+ TOP_LEFT: "top-left",
1081
+ TOP_RIGHT: "top-right",
1082
+ TOP_CENTER: "top-center",
1083
+ BOTTOM_LEFT: "bottom-left",
1084
+ BOTTOM_RIGHT: "bottom-right",
1085
+ BOTTOM_CENTER: "bottom-center"
1086
+ }, Q$1.TYPE = {
1087
+ INFO: "info",
1088
+ SUCCESS: "success",
1089
+ WARNING: "warning",
1090
+ ERROR: "error",
1091
+ DEFAULT: "default"
1092
+ }, v$1.on(2, function(t) {
1093
+ P$1 = t.containerId || t, B$1.set(P$1, t), D$1.forEach(function(t) {
1094
+ v$1.emit(0, t.content, t.options);
1095
+ }), D$1 = [];
1096
+ }).on(3, function(t) {
1097
+ B$1.delete(t.containerId || t), 0 === B$1.size && v$1.off(0).off(1).off(5);
1597
1098
  });
1598
- const ur = $e;
1599
- function Pt(e) {
1600
- const t = new he(e), n = lt(he.prototype.request, t);
1601
- return c.extend(n, he.prototype, t, { allOwnKeys: !0 }), c.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
1602
- return Pt(ee(e, o));
1603
- }, n;
1604
- }
1605
- const C$1 = Pt(Je);
1606
- C$1.Axios = he;
1607
- C$1.CanceledError = ce;
1608
- C$1.CancelToken = ir;
1609
- C$1.isCancel = Ct;
1610
- C$1.VERSION = _t;
1611
- C$1.toFormData = Re;
1612
- C$1.AxiosError = b$1;
1613
- C$1.Cancel = C$1.CanceledError;
1614
- C$1.all = function(t) {
1615
- return Promise.all(t);
1616
- };
1617
- C$1.spread = ar;
1618
- C$1.isAxiosError = cr;
1619
- C$1.mergeConfig = ee;
1620
- C$1.AxiosHeaders = M$1;
1621
- C$1.formToJSON = (e) => At(c.isHTMLForm(e) ? new FormData(e) : e);
1622
- C$1.getAdapter = xt.getAdapter;
1623
- C$1.HttpStatusCode = ur;
1624
- C$1.default = C$1;
1625
- function vt(e, t) {
1626
- const n = reactQuery.useQueryClient(), r = t ? e.concat([`${t}`]) : e;
1627
- return React__default["default"].useCallback(() => r ? n.invalidateQueries(r) : null, [r, n]);
1628
- }
1629
- function Cr(e, t, n, r) {
1630
- const o = (t ?? []).concat([n ? typeof n == "number" ? `${n}` : n : void 0]);
1631
- return reactQuery.useMutation(o, e, r);
1632
- }
1633
- function Nr(e, t, n, r) {
1634
- const o = vt(t, n), s = n ? t.concat(`${n}`) : t;
1635
- return reactQuery.useMutation(s, e, { onSuccess: () => o(), ...r });
1636
- }
1637
- function xr(e, t, n) {
1638
- const r = vt(t);
1639
- return reactQuery.useMutation(t, e, { onSuccess: () => r(), ...n });
1640
- }
1641
- function Lt(e, t) {
1642
- return function(n) {
1643
- return t ? e(t) : e();
1644
- };
1645
- }
1646
- function Pr(e, t, n, r) {
1647
- const o = n ? e.concat([typeof n == "number" ? `${n}` : n]) : e;
1648
- return reactQuery.useQuery(o, Lt(t, n), {
1649
- retry: 0,
1650
- networkMode: "always",
1651
- retryOnMount: !1,
1652
- refetchOnMount: !1,
1653
- refetchOnWindowFocus: !1,
1654
- ...r
1655
- });
1656
- }
1657
- function vr(e) {
1658
- const t = reactQuery.useQueries(
1659
- {
1660
- queries: e.map((s) => ({
1661
- queryKey: s.queryParam ? s.queryKey.concat([typeof s.queryParam == "number" ? `${s.queryParam}` : s.queryParam]) : s.queryKey,
1662
- queryFn: Lt(s.queryFn, s.queryParam),
1663
- retry: 0,
1664
- // networkMode: "always",
1665
- retryOnMount: !1,
1666
- refetchOnMount: !1,
1667
- refetchOnWindowFocus: !1,
1668
- ...s.queryOptions
1669
- }))
1099
+
1100
+ function _array_like_to_array(arr, len) {
1101
+ if (len == null || len > arr.length) len = arr.length;
1102
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1103
+ return arr2;
1104
+ }
1105
+ function _array_without_holes(arr) {
1106
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
1107
+ }
1108
+ function _define_property(obj, key, value) {
1109
+ if (key in obj) {
1110
+ Object.defineProperty(obj, key, {
1111
+ value: value,
1112
+ enumerable: true,
1113
+ configurable: true,
1114
+ writable: true
1115
+ });
1116
+ } else {
1117
+ obj[key] = value;
1670
1118
  }
1671
- ), n = t.findIndex((s) => s.isFetching === !0) != -1, r = t.findIndex((s) => s.isError === !0) != -1;
1672
- return { data: t.map((s) => s.data), isFetching: n, isError: r };
1673
- }
1674
- function It(e) {
1675
- var t, n, r = "";
1676
- if (typeof e == "string" || typeof e == "number")
1677
- r += e;
1678
- else if (typeof e == "object")
1679
- if (Array.isArray(e))
1680
- for (t = 0; t < e.length; t++)
1681
- e[t] && (n = It(e[t])) && (r && (r += " "), r += n);
1682
- else
1683
- for (t in e)
1684
- e[t] && (r && (r += " "), r += t);
1685
- return r;
1686
- }
1687
- function H$1() {
1688
- for (var e, t, n = 0, r = ""; n < arguments.length; )
1689
- (e = arguments[n++]) && (t = It(e)) && (r && (r += " "), r += t);
1690
- return r;
1691
- }
1692
- const se = (e) => typeof e == "number" && !isNaN(e), G = (e) => typeof e == "string", x = (e) => typeof e == "function", me = (e) => G(e) || x(e) ? e : null, Pe = (e) => React.isValidElement(e) || G(e) || x(e) || se(e);
1693
- function lr(e, t, n) {
1694
- n === void 0 && (n = 300);
1695
- const { scrollHeight: r, style: o } = e;
1696
- requestAnimationFrame(() => {
1697
- o.minHeight = "initial", o.height = r + "px", o.transition = `all ${n}ms`, requestAnimationFrame(() => {
1698
- o.height = "0", o.padding = "0", o.margin = "0", setTimeout(t, n);
1699
- });
1700
- });
1119
+ return obj;
1701
1120
  }
1702
- function Se(e) {
1703
- let { enter: t, exit: n, appendPosition: r = !1, collapse: o = !0, collapseDuration: s = 300 } = e;
1704
- return function(i) {
1705
- let { children: a, position: h, preventExitTransition: p, done: f, nodeRef: u, isIn: E } = i;
1706
- const y = r ? `${t}--${h}` : t, l = r ? `${n}--${h}` : n, d = React.useRef(0);
1707
- return React.useLayoutEffect(() => {
1708
- const m = u.current, g = y.split(" "), w = (A) => {
1709
- A.target === u.current && (m.dispatchEvent(new Event("d")), m.removeEventListener("animationend", w), m.removeEventListener("animationcancel", w), d.current === 0 && A.type !== "animationcancel" && m.classList.remove(...g));
1710
- };
1711
- m.classList.add(...g), m.addEventListener("animationend", w), m.addEventListener("animationcancel", w);
1712
- }, []), React.useEffect(() => {
1713
- const m = u.current, g = () => {
1714
- m.removeEventListener("animationend", g), o ? lr(m, f, s) : f();
1715
- };
1716
- E || (p ? g() : (d.current = 1, m.className += ` ${l}`, m.addEventListener("animationend", g)));
1717
- }, [E]), React__default["default"].createElement(React__default["default"].Fragment, null, a);
1718
- };
1121
+ function _iterable_to_array(iter) {
1122
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1719
1123
  }
1720
- function ot(e, t) {
1721
- return e != null ? { content: e.content, containerId: e.props.containerId, id: e.props.toastId, theme: e.props.theme, type: e.props.type, data: e.props.data || {}, isLoading: e.props.isLoading, icon: e.props.icon, status: t } : {};
1124
+ function _non_iterable_spread() {
1125
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1722
1126
  }
1723
- const L$1 = { list: /* @__PURE__ */ new Map(), emitQueue: /* @__PURE__ */ new Map(), on(e, t) {
1724
- return this.list.has(e) || this.list.set(e, []), this.list.get(e).push(t), this;
1725
- }, off(e, t) {
1726
- if (t) {
1727
- const n = this.list.get(e).filter((r) => r !== t);
1728
- return this.list.set(e, n), this;
1729
- }
1730
- return this.list.delete(e), this;
1731
- }, cancelEmit(e) {
1732
- const t = this.emitQueue.get(e);
1733
- return t && (t.forEach(clearTimeout), this.emitQueue.delete(e)), this;
1734
- }, emit(e) {
1735
- this.list.has(e) && this.list.get(e).forEach((t) => {
1736
- const n = setTimeout(() => {
1737
- t(...[].slice.call(arguments, 1));
1738
- }, 0);
1739
- this.emitQueue.has(e) || this.emitQueue.set(e, []), this.emitQueue.get(e).push(n);
1740
- });
1741
- } }, le = (e) => {
1742
- let { theme: t, type: n, ...r } = e;
1743
- return React__default["default"].createElement("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", fill: t === "colored" ? "currentColor" : `var(--toastify-icon-color-${n})`, ...r });
1744
- }, ve = { info: function(e) {
1745
- return React__default["default"].createElement(le, { ...e }, React__default["default"].createElement("path", { d: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z" }));
1746
- }, warning: function(e) {
1747
- return React__default["default"].createElement(le, { ...e }, React__default["default"].createElement("path", { d: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z" }));
1748
- }, success: function(e) {
1749
- return React__default["default"].createElement(le, { ...e }, React__default["default"].createElement("path", { d: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z" }));
1750
- }, error: function(e) {
1751
- return React__default["default"].createElement(le, { ...e }, React__default["default"].createElement("path", { d: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z" }));
1752
- }, spinner: function() {
1753
- return React__default["default"].createElement("div", { className: "Toastify__spinner" });
1754
- } };
1755
- function dr(e) {
1756
- const [, t] = React.useReducer((y) => y + 1, 0), [n, r] = React.useState([]), o = React.useRef(null), s = React.useRef(/* @__PURE__ */ new Map()).current, i = (y) => n.indexOf(y) !== -1, a = React.useRef({ toastKey: 1, displayedToast: 0, count: 0, queue: [], props: e, containerId: null, isToastActive: i, getToast: (y) => s.get(y) }).current;
1757
- function h(y) {
1758
- let { containerId: l } = y;
1759
- const { limit: d } = a.props;
1760
- !d || l && a.containerId !== l || (a.count -= a.queue.length, a.queue = []);
1761
- }
1762
- function p(y) {
1763
- r((l) => y == null ? [] : l.filter((d) => d !== y));
1764
- }
1765
- function f() {
1766
- const { toastContent: y, toastProps: l, staleId: d } = a.queue.shift();
1767
- E(y, l, d);
1768
- }
1769
- function u(y, l) {
1770
- let { delay: d, staleId: m, ...g } = l;
1771
- if (!Pe(y) || function(v) {
1772
- return !o.current || a.props.enableMultiContainer && v.containerId !== a.props.containerId || s.has(v.toastId) && v.updateId == null;
1773
- }(g))
1774
- return;
1775
- const { toastId: w, updateId: A, data: T } = g, { props: O } = a, U = () => p(w), $ = A == null;
1776
- $ && a.count++;
1777
- const N = { ...O, style: O.toastStyle, key: a.toastKey++, ...Object.fromEntries(Object.entries(g).filter((v) => {
1778
- let [B, _] = v;
1779
- return _ != null;
1780
- })), toastId: w, updateId: A, data: T, closeToast: U, isIn: !1, className: me(g.className || O.toastClassName), bodyClassName: me(g.bodyClassName || O.bodyClassName), progressClassName: me(g.progressClassName || O.progressClassName), autoClose: !g.isLoading && (z = g.autoClose, Y = O.autoClose, z === !1 || se(z) && z > 0 ? z : Y), deleteToast() {
1781
- const v = ot(s.get(w), "removed");
1782
- s.delete(w), L$1.emit(4, v);
1783
- const B = a.queue.length;
1784
- if (a.count = w == null ? a.count - a.displayedToast : a.count - 1, a.count < 0 && (a.count = 0), B > 0) {
1785
- const _ = w == null ? a.props.limit : 1;
1786
- if (B === 1 || _ === 1)
1787
- a.displayedToast++, f();
1788
- else {
1789
- const W = _ > B ? B : _;
1790
- a.displayedToast = W;
1791
- for (let P = 0; P < W; P++)
1792
- f();
1127
+ function _object_spread(target) {
1128
+ for(var i = 1; i < arguments.length; i++){
1129
+ var source = arguments[i] != null ? arguments[i] : {};
1130
+ var ownKeys = Object.keys(source);
1131
+ if (typeof Object.getOwnPropertySymbols === "function") {
1132
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1133
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1134
+ }));
1793
1135
  }
1794
- } else
1795
- t();
1796
- } };
1797
- var z, Y;
1798
- N.iconOut = function(v) {
1799
- let { theme: B, type: _, isLoading: W, icon: P } = v, D = null;
1800
- const V = { theme: B, type: _ };
1801
- return P === !1 || (x(P) ? D = P(V) : React.isValidElement(P) ? D = React.cloneElement(P, V) : G(P) || se(P) ? D = P : W ? D = ve.spinner() : ((ue) => ue in ve)(_) && (D = ve[_](V))), D;
1802
- }(N), x(g.onOpen) && (N.onOpen = g.onOpen), x(g.onClose) && (N.onClose = g.onClose), N.closeButton = O.closeButton, g.closeButton === !1 || Pe(g.closeButton) ? N.closeButton = g.closeButton : g.closeButton === !0 && (N.closeButton = !Pe(O.closeButton) || O.closeButton);
1803
- let J = y;
1804
- React.isValidElement(y) && !G(y.type) ? J = React.cloneElement(y, { closeToast: U, toastProps: N, data: T }) : x(y) && (J = y({ closeToast: U, toastProps: N, data: T })), O.limit && O.limit > 0 && a.count > O.limit && $ ? a.queue.push({ toastContent: J, toastProps: N, staleId: m }) : se(d) ? setTimeout(() => {
1805
- E(J, N, m);
1806
- }, d) : E(J, N, m);
1807
- }
1808
- function E(y, l, d) {
1809
- const { toastId: m } = l;
1810
- d && s.delete(d);
1811
- const g = { content: y, props: l };
1812
- s.set(m, g), r((w) => [...w, m].filter((A) => A !== d)), L$1.emit(4, ot(g, g.props.updateId == null ? "added" : "updated"));
1813
- }
1814
- return React.useEffect(() => (a.containerId = e.containerId, L$1.cancelEmit(3).on(0, u).on(1, (y) => o.current && p(y)).on(5, h).emit(2, a), () => {
1815
- s.clear(), L$1.emit(3, a);
1816
- }), []), React.useEffect(() => {
1817
- a.props = e, a.isToastActive = i, a.displayedToast = n.length;
1818
- }), { getToastToRender: function(y) {
1819
- const l = /* @__PURE__ */ new Map(), d = Array.from(s.values());
1820
- return e.newestOnTop && d.reverse(), d.forEach((m) => {
1821
- const { position: g } = m.props;
1822
- l.has(g) || l.set(g, []), l.get(g).push(m);
1823
- }), Array.from(l, (m) => y(m[0], m[1]));
1824
- }, containerRef: o, isToastActive: i };
1825
- }
1826
- function it(e) {
1827
- return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientX : e.clientX;
1828
- }
1829
- function at(e) {
1830
- return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientY : e.clientY;
1831
- }
1832
- function fr(e) {
1833
- const [t, n] = React.useState(!1), [r, o] = React.useState(!1), s = React.useRef(null), i = React.useRef({ start: 0, x: 0, y: 0, delta: 0, removalDistance: 0, canCloseOnClick: !0, canDrag: !1, boundingRect: null, didMove: !1 }).current, a = React.useRef(e), { autoClose: h, pauseOnHover: p, closeToast: f, onClick: u, closeOnClick: E } = e;
1834
- function y(T) {
1835
- if (e.draggable) {
1836
- T.nativeEvent.type === "touchstart" && T.nativeEvent.preventDefault(), i.didMove = !1, document.addEventListener("mousemove", g), document.addEventListener("mouseup", w), document.addEventListener("touchmove", g), document.addEventListener("touchend", w);
1837
- const O = s.current;
1838
- i.canCloseOnClick = !0, i.canDrag = !0, i.boundingRect = O.getBoundingClientRect(), O.style.transition = "", i.x = it(T.nativeEvent), i.y = at(T.nativeEvent), e.draggableDirection === "x" ? (i.start = i.x, i.removalDistance = O.offsetWidth * (e.draggablePercent / 100)) : (i.start = i.y, i.removalDistance = O.offsetHeight * (e.draggablePercent === 80 ? 1.5 * e.draggablePercent : e.draggablePercent / 100));
1839
- }
1840
- }
1841
- function l(T) {
1842
- if (i.boundingRect) {
1843
- const { top: O, bottom: U, left: $, right: N } = i.boundingRect;
1844
- T.nativeEvent.type !== "touchend" && e.pauseOnHover && i.x >= $ && i.x <= N && i.y >= O && i.y <= U ? m() : d();
1845
- }
1846
- }
1847
- function d() {
1848
- n(!0);
1849
- }
1850
- function m() {
1851
- n(!1);
1852
- }
1853
- function g(T) {
1854
- const O = s.current;
1855
- i.canDrag && O && (i.didMove = !0, t && m(), i.x = it(T), i.y = at(T), i.delta = e.draggableDirection === "x" ? i.x - i.start : i.y - i.start, i.start !== i.x && (i.canCloseOnClick = !1), O.style.transform = `translate${e.draggableDirection}(${i.delta}px)`, O.style.opacity = "" + (1 - Math.abs(i.delta / i.removalDistance)));
1856
- }
1857
- function w() {
1858
- document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", w), document.removeEventListener("touchmove", g), document.removeEventListener("touchend", w);
1859
- const T = s.current;
1860
- if (i.canDrag && i.didMove && T) {
1861
- if (i.canDrag = !1, Math.abs(i.delta) > i.removalDistance)
1862
- return o(!0), void e.closeToast();
1863
- T.style.transition = "transform 0.2s, opacity 0.2s", T.style.transform = `translate${e.draggableDirection}(0)`, T.style.opacity = "1";
1864
- }
1865
- }
1866
- React.useEffect(() => {
1867
- a.current = e;
1868
- }), React.useEffect(() => (s.current && s.current.addEventListener("d", d, { once: !0 }), x(e.onOpen) && e.onOpen(React.isValidElement(e.children) && e.children.props), () => {
1869
- const T = a.current;
1870
- x(T.onClose) && T.onClose(React.isValidElement(T.children) && T.children.props);
1871
- }), []), React.useEffect(() => (e.pauseOnFocusLoss && (document.hasFocus() || m(), window.addEventListener("focus", d), window.addEventListener("blur", m)), () => {
1872
- e.pauseOnFocusLoss && (window.removeEventListener("focus", d), window.removeEventListener("blur", m));
1873
- }), [e.pauseOnFocusLoss]);
1874
- const A = { onMouseDown: y, onTouchStart: y, onMouseUp: l, onTouchEnd: l };
1875
- return h && p && (A.onMouseEnter = m, A.onMouseLeave = d), E && (A.onClick = (T) => {
1876
- u && u(T), i.canCloseOnClick && f();
1877
- }), { playToast: d, pauseToast: m, isRunning: t, preventExitTransition: r, toastRef: s, eventHandlers: A };
1878
- }
1879
- function Ft(e) {
1880
- let { closeToast: t, theme: n, ariaLabel: r = "close" } = e;
1881
- return React__default["default"].createElement("button", { className: `Toastify__close-button Toastify__close-button--${n}`, type: "button", onClick: (o) => {
1882
- o.stopPropagation(), t(o);
1883
- }, "aria-label": r }, React__default["default"].createElement("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, React__default["default"].createElement("path", { fillRule: "evenodd", d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z" })));
1884
- }
1885
- function pr(e) {
1886
- let { delay: t, isRunning: n, closeToast: r, type: o = "default", hide: s, className: i, style: a, controlledProgress: h, progress: p, rtl: f, isIn: u, theme: E } = e;
1887
- const y = s || h && p === 0, l = { ...a, animationDuration: `${t}ms`, animationPlayState: n ? "running" : "paused", opacity: y ? 0 : 1 };
1888
- h && (l.transform = `scaleX(${p})`);
1889
- const d = H$1("Toastify__progress-bar", h ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", `Toastify__progress-bar-theme--${E}`, `Toastify__progress-bar--${o}`, { "Toastify__progress-bar--rtl": f }), m = x(i) ? i({ rtl: f, type: o, defaultClassName: d }) : H$1(d, i);
1890
- return React__default["default"].createElement("div", { role: "progressbar", "aria-hidden": y ? "true" : "false", "aria-label": "notification timer", className: m, style: l, [h && p >= 1 ? "onTransitionEnd" : "onAnimationEnd"]: h && p < 1 ? null : () => {
1891
- u && r();
1892
- } });
1893
- }
1894
- const hr = (e) => {
1895
- const { isRunning: t, preventExitTransition: n, toastRef: r, eventHandlers: o } = fr(e), { closeButton: s, children: i, autoClose: a, onClick: h, type: p, hideProgressBar: f, closeToast: u, transition: E, position: y, className: l, style: d, bodyClassName: m, bodyStyle: g, progressClassName: w, progressStyle: A, updateId: T, role: O, progress: U, rtl: $, toastId: N, deleteToast: z, isIn: Y, isLoading: J, iconOut: v, closeOnClick: B, theme: _ } = e, W = H$1("Toastify__toast", `Toastify__toast-theme--${_}`, `Toastify__toast--${p}`, { "Toastify__toast--rtl": $ }, { "Toastify__toast--close-on-click": B }), P = x(l) ? l({ rtl: $, position: y, type: p, defaultClassName: W }) : H$1(W, l), D = !!U || !a, V = { closeToast: u, type: p, theme: _ };
1896
- let ue = null;
1897
- return s === !1 || (ue = x(s) ? s(V) : React.isValidElement(s) ? React.cloneElement(s, V) : Ft(V)), React__default["default"].createElement(E, { isIn: Y, done: z, position: y, preventExitTransition: n, nodeRef: r }, React__default["default"].createElement("div", { id: N, onClick: h, className: P, ...o, style: d, ref: r }, React__default["default"].createElement("div", { ...Y && { role: O }, className: x(m) ? m({ type: p }) : H$1("Toastify__toast-body", m), style: g }, v != null && React__default["default"].createElement("div", { className: H$1("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter": !J }) }, v), React__default["default"].createElement("div", null, i)), ue, React__default["default"].createElement(pr, { ...T && !D ? { key: `pb-${T}` } : {}, rtl: $, theme: _, delay: a, isRunning: t, isIn: Y, closeToast: u, hide: f, type: p, style: A, className: w, controlledProgress: D, progress: U || 0 })));
1898
- }, Ae = function(e, t) {
1899
- return t === void 0 && (t = !1), { enter: `Toastify--animate Toastify__${e}-enter`, exit: `Toastify--animate Toastify__${e}-exit`, appendPosition: t };
1900
- }, mr = Se(Ae("bounce", !0));
1901
- Se(Ae("slide", !0));
1902
- Se(Ae("zoom"));
1903
- Se(Ae("flip"));
1904
- const ct = React.forwardRef((e, t) => {
1905
- const { getToastToRender: n, containerRef: r, isToastActive: o } = dr(e), { className: s, style: i, rtl: a, containerId: h } = e;
1906
- function p(f) {
1907
- const u = H$1("Toastify__toast-container", `Toastify__toast-container--${f}`, { "Toastify__toast-container--rtl": a });
1908
- return x(s) ? s({ position: f, rtl: a, defaultClassName: u }) : H$1(u, me(s));
1909
- }
1910
- return React.useEffect(() => {
1911
- t && (t.current = r.current);
1912
- }, []), React__default["default"].createElement("div", { ref: r, className: "Toastify", id: h }, n((f, u) => {
1913
- const E = u.length ? { ...i } : { ...i, pointerEvents: "none" };
1914
- return React__default["default"].createElement("div", { className: p(f), style: E, key: `container-${f}` }, u.map((y, l) => {
1915
- let { content: d, props: m } = y;
1916
- return React__default["default"].createElement(hr, { ...m, isIn: o(m.toastId), style: { ...m.style, "--nth": l + 1, "--len": u.length }, key: `toast-${m.key}` }, d);
1917
- }));
1918
- }));
1919
- });
1920
- ct.displayName = "ToastContainer", ct.defaultProps = { position: "top-right", transition: mr, autoClose: 5e3, closeButton: Ft, pauseOnHover: !0, pauseOnFocusLoss: !0, closeOnClick: !0, draggable: !0, draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light" };
1921
- let Le, K = /* @__PURE__ */ new Map(), re = [], yr = 1;
1922
- function kt() {
1923
- return "" + yr++;
1924
- }
1925
- function gr(e) {
1926
- return e && (G(e.toastId) || se(e.toastId)) ? e.toastId : kt();
1927
- }
1928
- function oe(e, t) {
1929
- return K.size > 0 ? L$1.emit(0, e, t) : re.push({ content: e, options: t }), t.toastId;
1930
- }
1931
- function ge(e, t) {
1932
- return { ...t, type: t && t.type || e, toastId: gr(t) };
1933
- }
1934
- function de(e) {
1935
- return (t, n) => oe(t, ge(e, n));
1936
- }
1937
- function S$1(e, t) {
1938
- return oe(e, ge("default", t));
1939
- }
1940
- S$1.loading = (e, t) => oe(e, ge("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...t })), S$1.promise = function(e, t, n) {
1941
- let r, { pending: o, error: s, success: i } = t;
1942
- o && (r = G(o) ? S$1.loading(o, n) : S$1.loading(o.render, { ...n, ...o }));
1943
- const a = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, h = (f, u, E) => {
1944
- if (u == null)
1945
- return void S$1.dismiss(r);
1946
- const y = { type: f, ...a, ...n, data: E }, l = G(u) ? { render: u } : u;
1947
- return r ? S$1.update(r, { ...y, ...l }) : S$1(l.render, { ...y, ...l }), E;
1948
- }, p = x(e) ? e() : e;
1949
- return p.then((f) => h("success", i, f)).catch((f) => h("error", s, f)), p;
1950
- }, S$1.success = de("success"), S$1.info = de("info"), S$1.error = de("error"), S$1.warning = de("warning"), S$1.warn = S$1.warning, S$1.dark = (e, t) => oe(e, ge("default", { theme: "dark", ...t })), S$1.dismiss = (e) => {
1951
- K.size > 0 ? L$1.emit(1, e) : re = re.filter((t) => e != null && t.options.toastId !== e);
1952
- }, S$1.clearWaitingQueue = function(e) {
1953
- return e === void 0 && (e = {}), L$1.emit(5, e);
1954
- }, S$1.isActive = (e) => {
1955
- let t = !1;
1956
- return K.forEach((n) => {
1957
- n.isToastActive && n.isToastActive(e) && (t = !0);
1958
- }), t;
1959
- }, S$1.update = function(e, t) {
1960
- t === void 0 && (t = {}), setTimeout(() => {
1961
- const n = function(r, o) {
1962
- let { containerId: s } = o;
1963
- const i = K.get(s || Le);
1964
- return i && i.getToast(r);
1965
- }(e, t);
1966
- if (n) {
1967
- const { props: r, content: o } = n, s = { delay: 100, ...r, ...t, toastId: t.toastId || e, updateId: kt() };
1968
- s.toastId !== e && (s.staleId = e);
1969
- const i = s.render || o;
1970
- delete s.render, oe(i, s);
1136
+ ownKeys.forEach(function(key) {
1137
+ _define_property(target, key, source[key]);
1138
+ });
1971
1139
  }
1972
- }, 0);
1973
- }, S$1.done = (e) => {
1974
- S$1.update(e, { progress: 1 });
1975
- }, S$1.onChange = (e) => (L$1.on(4, e), () => {
1976
- L$1.off(4, e);
1977
- }), S$1.POSITION = { TOP_LEFT: "top-left", TOP_RIGHT: "top-right", TOP_CENTER: "top-center", BOTTOM_LEFT: "bottom-left", BOTTOM_RIGHT: "bottom-right", BOTTOM_CENTER: "bottom-center" }, S$1.TYPE = { INFO: "info", SUCCESS: "success", WARNING: "warning", ERROR: "error", DEFAULT: "default" }, L$1.on(2, (e) => {
1978
- Le = e.containerId || e, K.set(Le, e), re.forEach((t) => {
1979
- L$1.emit(0, t.content, t.options);
1980
- }), re = [];
1981
- }).on(3, (e) => {
1982
- K.delete(e.containerId || e), K.size === 0 && L$1.off(0).off(1).off(5);
1983
- });
1984
- const Er = {
1985
- showSuccessMsg: !0,
1986
- showErrorMsg: !0,
1987
- successMsg: void 0,
1988
- errorMsg: void 0,
1989
- onSuccess: void 0,
1990
- onError: void 0,
1991
- processInput: void 0
1140
+ return target;
1141
+ }
1142
+ function _to_consumable_array(arr) {
1143
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
1144
+ }
1145
+ function _unsupported_iterable_to_array(o, minLen) {
1146
+ if (!o) return;
1147
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
1148
+ var n = Object.prototype.toString.call(o).slice(8, -1);
1149
+ if (n === "Object" && o.constructor) n = o.constructor.name;
1150
+ if (n === "Map" || n === "Set") return Array.from(n);
1151
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
1152
+ }
1153
+ var defaultOptions = {
1154
+ showSuccessMsg: true,
1155
+ showErrorMsg: true,
1156
+ successMsg: undefined,
1157
+ errorMsg: undefined,
1158
+ onSuccess: undefined,
1159
+ onError: undefined,
1160
+ processInput: undefined
1992
1161
  };
1993
- function Lr(e, t) {
1994
- const n = { ...Er, ...t ?? {} };
1995
- return React__default["default"].useCallback((o) => (e.reset(), e.mutateAsync(Ie(n.processInput, o) ?? o).then((s) => {
1996
- var i;
1997
- return n.showSuccessMsg && n.successMsg && S$1.success(Ie(n.successMsg, s, o)), (i = n.onSuccess) == null || i.call(n, s), s;
1998
- }).catch((s) => {
1999
- var i;
2000
- n.showErrorMsg && S$1.error(Ie(n.errorMsg, s, o) ?? "Oops, something went wrong :("), (i = n.onError) == null || i.call(n, s);
2001
- })), [e, t]);
2002
- }
2003
- function br(e) {
2004
- return typeof e == "function";
2005
- }
2006
- function Ie(e, ...t) {
2007
- return br(e) ? e(...t) : e;
1162
+ function useMutate(mutation, options) {
1163
+ var mergedOptions = _object_spread({}, defaultOptions, options !== null && options !== void 0 ? options : {});
1164
+ var mutate = React__default["default"].useCallback(function(values) {
1165
+ mutation.reset();
1166
+ var _runIfFn;
1167
+ // Return the mutation so that Formik can update submitting state
1168
+ return mutation.mutateAsync((_runIfFn = runIfFn(mergedOptions.processInput, values)) !== null && _runIfFn !== void 0 ? _runIfFn : values).then(function(result) {
1169
+ var _mergedOptions_onSuccess;
1170
+ if (mergedOptions.showSuccessMsg && mergedOptions.successMsg) Q$1.success(runIfFn(mergedOptions.successMsg, result, values));
1171
+ (_mergedOptions_onSuccess = mergedOptions.onSuccess) === null || _mergedOptions_onSuccess === void 0 ? void 0 : _mergedOptions_onSuccess.call(mergedOptions, result);
1172
+ return result;
1173
+ }).catch(function(error) {
1174
+ var _mergedOptions_onError;
1175
+ if (mergedOptions.showErrorMsg) {
1176
+ var _runIfFn;
1177
+ Q$1.error((_runIfFn = runIfFn(mergedOptions.errorMsg, error, values)) !== null && _runIfFn !== void 0 ? _runIfFn : "Oops, something went wrong :(");
1178
+ }
1179
+ (_mergedOptions_onError = mergedOptions.onError) === null || _mergedOptions_onError === void 0 ? void 0 : _mergedOptions_onError.call(mergedOptions, error);
1180
+ });
1181
+ }, [
1182
+ mutation,
1183
+ options
1184
+ ]);
1185
+ return mutate;
1186
+ }
1187
+ function isFunction(value) {
1188
+ return typeof value === "function";
1189
+ }
1190
+ function runIfFn(valueOrFn) {
1191
+ for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
1192
+ args[_key - 1] = arguments[_key];
1193
+ }
1194
+ return isFunction(valueOrFn) ? valueOrFn.apply(void 0, _to_consumable_array(args)) : valueOrFn;
2008
1195
  }
2009
1196
 
2010
1197
  function InvalidateButton(_a) {
@@ -2013,8 +1200,8 @@ function InvalidateButton(_a) {
2013
1200
  } = _a,
2014
1201
  props = __rest(_a, ["pathOrPermalink"]);
2015
1202
  const api = adminApi.INVALIDATE_API.new(pathOrPermalink);
2016
- const mutation = Cr(api.invalidate, api.queryKey);
2017
- const invalidate = Lr(mutation, {
1203
+ const mutation = useApiMutation(api.invalidate, api.queryKey);
1204
+ const invalidate = useMutate(mutation, {
2018
1205
  successMsg: "Page successfully invalidated"
2019
1206
  });
2020
1207
  return jsxRuntime.jsx(ui.Button, Object.assign({
@@ -2069,7 +1256,7 @@ function PublishButton(_a) {
2069
1256
  } = _a,
2070
1257
  props = __rest(_a, ["status", "queryId", "api"]);
2071
1258
  const isDraft = status == "draft";
2072
- const mutation = Nr(isDraft ? api.publish : api.unpublish, api.queryKey, queryId, {
1259
+ const mutation = useInvalidateMutation(isDraft ? api.publish : api.unpublish, api.queryKey, queryId, {
2073
1260
  networkMode: "always"
2074
1261
  });
2075
1262
  const publish = React__default["default"].useCallback(() => {
@@ -2539,8 +1726,8 @@ function OrderCell({
2539
1726
  postId,
2540
1727
  order
2541
1728
  }) {
2542
- const mutationDown = Nr(api.moveDown, api.queryKey);
2543
- const mutationUp = Nr(api.moveUp, api.queryKey);
1729
+ const mutationDown = useInvalidateMutation(api.moveDown, api.queryKey);
1730
+ const mutationUp = useInvalidateMutation(api.moveUp, api.queryKey);
2544
1731
  const moveDown = React__default["default"].useCallback(e => {
2545
1732
  e.stopPropagation();
2546
1733
  mutationDown.mutateAsync(postId).catch(error => {
@@ -2624,25 +1811,28 @@ function PageQueryStateContainerInner(_a) {
2624
1811
  var {
2625
1812
  queryId,
2626
1813
  api,
1814
+ apiFn,
1815
+ loadingStyles,
1816
+ errorStyles,
2627
1817
  children
2628
1818
  } = _a,
2629
- props = __rest(_a, ["queryId", "api", "children"]);
1819
+ props = __rest(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
2630
1820
  const {
2631
1821
  data,
2632
1822
  isLoading,
2633
1823
  isError
2634
- } = Pr(api.queryKey, api.get, queryId);
2635
- const invalidate = vt(api.queryKey, queryId);
2636
- if (isLoading) return jsxRuntime.jsx(components.QueryLoadingState, {
1824
+ } = apiFn == "get" ? useApiQuery(api.queryKey, api.get, queryId) : useApiQuery(api.queryKey, api.getAll);
1825
+ const invalidate = useInvalidateQuery(api.queryKey, queryId);
1826
+ if (isLoading) return jsxRuntime.jsx(components.QueryLoadingState, Object.assign({
2637
1827
  w: "full",
2638
1828
  h: "100%"
2639
- });
2640
- if (isError) return jsxRuntime.jsx(components.RetryOnError, {
1829
+ }, loadingStyles));
1830
+ if (isError) return jsxRuntime.jsx(components.RetryOnError, Object.assign({
2641
1831
  p: "0",
2642
1832
  onClick: invalidate
2643
- });
1833
+ }, errorStyles));
2644
1834
  return jsxRuntime.jsx(PageContainer, Object.assign({}, props, {
2645
- children: children(data)
1835
+ children: apiFn == "get" ? children(data) : children(data)
2646
1836
  }));
2647
1837
  }
2648
1838
  const PageQueryStateContainer = /*#__PURE__*/React__default["default"].forwardRef(PageQueryStateContainerInner);
@@ -2883,6 +2073,7 @@ function DetailsView(_a) {
2883
2073
  const ref = React__default["default"].useRef(null);
2884
2074
  return jsxRuntime.jsx(PageQueryStateContainer, Object.assign({
2885
2075
  api: api,
2076
+ apiFn: "get",
2886
2077
  queryId: id,
2887
2078
  ref: ref,
2888
2079
  p: "5"
@@ -2917,10 +2108,10 @@ function Internal({
2917
2108
  type,
2918
2109
  invalidateParentQueryKey
2919
2110
  } = react.runIfFn(screen, item);
2920
- const mutation = xr(api.update, invalidateParentQueryKey !== null && invalidateParentQueryKey !== void 0 ? invalidateParentQueryKey : api.queryKey, {
2111
+ const mutation = useInvalidateParentMutation(api.update, invalidateParentQueryKey !== null && invalidateParentQueryKey !== void 0 ? invalidateParentQueryKey : api.queryKey, {
2921
2112
  networkMode: "always"
2922
2113
  });
2923
- const save = Lr(mutation, {
2114
+ const save = useMutate(mutation, {
2924
2115
  processInput,
2925
2116
  successMsg: item => `${item.title} updated.`,
2926
2117
  errorMsg: (error, item) => `Error updating ${item.title}: ${error}`
@@ -3023,7 +2214,7 @@ function QueryWrapper(_a) {
3023
2214
  } = useApi(api, queryField);
3024
2215
  const {
3025
2216
  data
3026
- } = Pr(mApi.queryKey, fn === "get" || fn === "getTransformed" ? mApi.get : mApi.getAll, react.isFunction(api) ? undefined : id);
2217
+ } = useApiQuery(mApi.queryKey, fn === "get" || fn === "getTransformed" ? mApi.get : mApi.getAll, react.isFunction(api) ? undefined : id);
3027
2218
  const transformedData = React__default["default"].useMemo(() => {
3028
2219
  if (data && (fn === "getTransformed" || fn === "getAllTransformed")) {
3029
2220
  if (!transformFn) console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${fn}`);
@@ -3229,7 +2420,7 @@ function TableTopBar(_a) {
3229
2420
  children
3230
2421
  } = _a,
3231
2422
  props = __rest(_a, ["title", "queryKey", "children"]);
3232
- const invalidate = vt(queryKey);
2423
+ const invalidate = useInvalidateQuery(queryKey);
3233
2424
  useHotkeys('ctrl+r', () => invalidate(), {
3234
2425
  preventDefault: true
3235
2426
  }, [invalidate]);
@@ -3317,13 +2508,13 @@ function ItemEditDialog$1(_a) {
3317
2508
  isError,
3318
2509
  error /*, error*/,
3319
2510
  refetch
3320
- } = Pr(api.queryKey, api.get, queryId, Object.assign({
2511
+ } = useApiQuery(api.queryKey, api.get, queryId, Object.assign({
3321
2512
  enabled: !( /*queryId == 0 || */queryId == "" || queryId == null || queryId == undefined),
3322
2513
  onError: onFetchError
3323
2514
  }, queryFetchOptions));
3324
2515
  // const [activeTab, setActiveTab] = React.useState(form && Array.isArray(form) ? form[0].key : "");
3325
2516
  // const [showTab, setShowTab] = React.useState(true);
3326
- const mutation = invalidateQueriesOnSuccess ? xr(api.upsert, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, querySaveOptions) : Cr(api.upsert, api.queryKey, queryId, querySaveOptions);
2517
+ const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(api.upsert, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, querySaveOptions) : useApiMutation(api.upsert, api.queryKey, queryId, querySaveOptions);
3327
2518
  const retry = React__default["default"].useCallback(() => refetch(), [refetch]);
3328
2519
  const saveItem = React__default["default"].useCallback((item, actions) => __awaiter(this, void 0, void 0, function* () {
3329
2520
  // Clear mutation error if any
@@ -3436,7 +2627,7 @@ function QueryWrapperDialog({
3436
2627
  const {
3437
2628
  data,
3438
2629
  isFetching
3439
- } = Pr(api.queryKey, fn === "get" || fn === "getTransformed" ? api.get : api.getAll, undefined, {
2630
+ } = useApiQuery(api.queryKey, fn === "get" || fn === "getTransformed" ? api.get : api.getAll, undefined, {
3440
2631
  retryOnMount: false,
3441
2632
  refetchOnMount: false,
3442
2633
  refetchOnWindowFocus: false
@@ -3470,7 +2661,7 @@ function MultiQueryWrapperDialog({
3470
2661
  data,
3471
2662
  isFetching,
3472
2663
  isError
3473
- } = vr(queries.map(q => ({
2664
+ } = useApiQueries(queries.map(q => ({
3474
2665
  queryKey: q.api.queryKey,
3475
2666
  queryFn: q.fn == "get" ? q.api.get : q.api.getAll,
3476
2667
  queryOptions: {
@@ -3537,8 +2728,8 @@ function ItemDeleteDialog(_a) {
3537
2728
  onClose
3538
2729
  } = _a,
3539
2730
  props = __rest(_a, ["itemLabel", "queryId", "api", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "show", "onClose"]);
3540
- const mutation = invalidateQueriesOnSuccess ? xr(api.delete, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey) : Cr(api.upsert, api.queryKey);
3541
- const mutate = Lr(mutation, {
2731
+ const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(api.delete, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey) : useApiMutation(api.upsert, api.queryKey);
2732
+ const mutate = useMutate(mutation, {
3542
2733
  onSuccess: () => onClose === null || onClose === void 0 ? void 0 : onClose()
3543
2734
  });
3544
2735
  const handleDelete = React__default["default"].useCallback(() => mutate(queryId), [mutate, queryId]);
@@ -3720,7 +2911,7 @@ function TableRowPublishPostButton$1(_a) {
3720
2911
  } = _a,
3721
2912
  props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
3722
2913
  const isDraft = status == "draft";
3723
- const mutation = xr(isDraft ? api.publish : api.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, {
2914
+ const mutation = useInvalidateParentMutation(isDraft ? api.publish : api.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, {
3724
2915
  networkMode: "always"
3725
2916
  });
3726
2917
  const publish = React__default["default"].useCallback(event => {
@@ -4215,8 +3406,8 @@ function ActionButton({
4215
3406
  errorMsg,
4216
3407
  invalidateParent
4217
3408
  }) {
4218
- const mutation = invalidateParent ? xr(queryFn, queryKey) : Cr(queryFn, queryKey);
4219
- const mutate = Lr(mutation, {
3409
+ const mutation = invalidateParent ? useInvalidateParentMutation(queryFn, queryKey) : useApiMutation(queryFn, queryKey);
3410
+ const mutate = useMutate(mutation, {
4220
3411
  successMsg,
4221
3412
  errorMsg
4222
3413
  });
@@ -4415,7 +3606,7 @@ function useQueries(queries) {
4415
3606
  data,
4416
3607
  isFetching,
4417
3608
  isError
4418
- } = vr(queries.map(q => {
3609
+ } = useApiQueries(queries.map(q => {
4419
3610
  if (!q.queryField || !react.isFunction(q.api)) {
4420
3611
  const _api = q.api;
4421
3612
  return {
@@ -4548,18 +3739,18 @@ function AttachDialog(_a) {
4548
3739
  isError: fetchError,
4549
3740
  refetch,
4550
3741
  error
4551
- } = Pr(queryKey, queryFetchFn);
3742
+ } = useApiQuery(queryKey, queryFetchFn);
4552
3743
  const {
4553
3744
  data,
4554
3745
  isInitialLoading: fetchAllLoading,
4555
3746
  isError: fetchAllError,
4556
3747
  refetch: refetchAll,
4557
3748
  error: errorAll
4558
- } = Pr(queryFetchAllKey, queryFetchAllFn);
3749
+ } = useApiQuery(queryFetchAllKey, queryFetchAllFn);
4559
3750
  const [selectedResources, setSelectedResources] = React__default["default"].useState([]);
4560
3751
  const isLoading = fetchLoading || fetchAllLoading;
4561
3752
  const isError = fetchError || fetchAllError;
4562
- const mutation = Cr(querySaveFn, queryKey, queryId);
3753
+ const mutation = useApiMutation(querySaveFn, queryKey, queryId);
4563
3754
  const handleClick = React__default["default"].useCallback(event => {
4564
3755
  var _a;
4565
3756
  const id = (_a = event === null || event === void 0 ? void 0 : event.currentTarget.dataset.id) !== null && _a !== void 0 ? _a : "";
@@ -4712,8 +3903,8 @@ function FormActionDialog(_a) {
4712
3903
  formikProps
4713
3904
  } = _a,
4714
3905
  props = __rest(_a, ["initialValues", "itemLabel", "queryId", "queryKey", "queryFn", "queryOptions", "onSuccess", "successMsg", "showSuccessMsg", "onError", "errorMsg", "showErrorMsg", "processInput", "invalidateQueriesOnSuccess", "cancelLabel", "saveLabel", "size", "title", "form", "show", "onClose", "formikProps"]);
4715
- const mutation = invalidateQueriesOnSuccess ? xr(queryFn, queryKey, queryOptions) : Cr(queryFn, queryKey, queryId, queryOptions);
4716
- const mutate = Lr(mutation, {
3906
+ const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(queryFn, queryKey, queryOptions) : useApiMutation(queryFn, queryKey, queryId, queryOptions);
3907
+ const mutate = useMutate(mutation, {
4717
3908
  onSuccess,
4718
3909
  successMsg,
4719
3910
  showSuccessMsg,
@@ -4807,13 +3998,13 @@ function ItemEditDialog(_a) {
4807
3998
  isError,
4808
3999
  error /*, error*/,
4809
4000
  refetch
4810
- } = Pr(queryKey, queryFetchFn, queryId, Object.assign({
4001
+ } = useApiQuery(queryKey, queryFetchFn, queryId, Object.assign({
4811
4002
  enabled: !( /*queryId == 0 || */queryId == "" || queryId == null || queryId == undefined),
4812
4003
  onError: onFetchError
4813
4004
  }, queryFetchOptions));
4814
4005
  // const [activeTab, setActiveTab] = React.useState(form && Array.isArray(form) ? form[0].key : "");
4815
4006
  // const [showTab, setShowTab] = React.useState(true);
4816
- const mutation = invalidateQueriesOnSuccess ? xr(querySaveFn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : queryKey, querySaveOptions) : Cr(querySaveFn, queryKey, queryId, querySaveOptions);
4007
+ const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(querySaveFn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : queryKey, querySaveOptions) : useApiMutation(querySaveFn, queryKey, queryId, querySaveOptions);
4817
4008
  const retry = React__default["default"].useCallback(() => refetch(), [refetch]);
4818
4009
  const saveItem = React__default["default"].useCallback((item, actions) => {
4819
4010
  // Clear mutation error if any
@@ -5114,7 +4305,7 @@ function TableRowPublishPostButton(_a) {
5114
4305
  } = _a,
5115
4306
  props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
5116
4307
  const isDraft = status == "draft";
5117
- const mutation = xr(isDraft ? api.publish : api.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, {
4308
+ const mutation = useInvalidateParentMutation(isDraft ? api.publish : api.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, {
5118
4309
  networkMode: "always"
5119
4310
  });
5120
4311
  const publish = React__default["default"].useCallback(event => {