@compill/admin 1.0.34 → 1.0.35
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 +996 -1806
- package/index.esm.js +1018 -1828
- package/package.json +1 -1
- package/src/lib/page/PageQueryStateContainer.d.ts +11 -3
package/index.esm.js
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
import { jsx, jsxs, Fragment } from '@soperio/jsx-runtime';
|
2
2
|
import { Icon, Button, Container, Tile, Popover, Modal, Collapse, Checkbox, Badge } from '@valerya/ui';
|
3
3
|
import Link from 'next/link';
|
4
|
-
import React, { forwardRef, useEffect, useReducer, useState,
|
4
|
+
import React, { forwardRef, useEffect, useRef, useLayoutEffect, useReducer, useState, isValidElement, cloneElement, useCallback, useContext as useContext$2, createContext } from 'react';
|
5
5
|
import { INVALIDATE_API } from '@compill/admin-api';
|
6
|
+
import 'axios';
|
7
|
+
import 'react/jsx-runtime';
|
6
8
|
import { useQueryClient, useMutation, useQuery, useQueries as useQueries$1 } from '@tanstack/react-query';
|
7
9
|
import { useNavigate, useParams } from 'react-router-dom';
|
8
10
|
import { SubmitButton, FormProvider, TextArea, FormRenderer, mergeInitialFormValues, FieldLabel } from '@compill/form';
|
9
11
|
import { useFormikContext, Formik, Form } from 'formik';
|
10
|
-
import 'react/jsx-runtime';
|
11
12
|
import { FlexCenter, QueryLoadingState, RetryOnError, TabContainer, ModalLoadingOverlay } from '@compill/components';
|
12
|
-
import { createContext as createContext$1, runIfFn, isFunction } from '@soperio/react';
|
13
|
+
import { createContext as createContext$1, runIfFn as runIfFn$1, isFunction as isFunction$1 } from '@soperio/react';
|
13
14
|
import { FormEditor } from '@compill/form-extras';
|
14
15
|
import { PageSectionTitle as PageSectionTitle$1 } from '@compill/admin';
|
15
16
|
import { createPortal } from 'react-dom';
|
@@ -166,1836 +167,1022 @@ function IconButton(_a) {
|
|
166
167
|
}));
|
167
168
|
}
|
168
169
|
|
169
|
-
function
|
170
|
-
|
171
|
-
|
172
|
-
|
170
|
+
function useInvalidateQuery(queryKey, queryId) {
|
171
|
+
var queryClient = useQueryClient();
|
172
|
+
var key = queryId ? queryKey.concat([
|
173
|
+
"".concat(queryId)
|
174
|
+
]) : queryKey;
|
175
|
+
var invalidate = React.useCallback(function() {
|
176
|
+
return key ? queryClient.invalidateQueries(key) : null;
|
177
|
+
}, [
|
178
|
+
key,
|
179
|
+
queryClient
|
180
|
+
]);
|
181
|
+
return invalidate;
|
173
182
|
}
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
}
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
}
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
t.call(null, e[r], r, e);
|
203
|
-
else {
|
204
|
-
const s = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = s.length;
|
205
|
-
let a;
|
206
|
-
for (r = 0; r < i; r++)
|
207
|
-
a = s[r], t.call(null, e[a], a, e);
|
208
|
-
}
|
183
|
+
|
184
|
+
function _define_property$3(obj, key, value) {
|
185
|
+
if (key in obj) {
|
186
|
+
Object.defineProperty(obj, key, {
|
187
|
+
value: value,
|
188
|
+
enumerable: true,
|
189
|
+
configurable: true,
|
190
|
+
writable: true
|
191
|
+
});
|
192
|
+
} else {
|
193
|
+
obj[key] = value;
|
194
|
+
}
|
195
|
+
return obj;
|
196
|
+
}
|
197
|
+
function _object_spread$3(target) {
|
198
|
+
for(var i = 1; i < arguments.length; i++){
|
199
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
200
|
+
var ownKeys = Object.keys(source);
|
201
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
202
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
203
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
204
|
+
}));
|
205
|
+
}
|
206
|
+
ownKeys.forEach(function(key) {
|
207
|
+
_define_property$3(target, key, source[key]);
|
208
|
+
});
|
209
|
+
}
|
210
|
+
return target;
|
209
211
|
}
|
210
|
-
function
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
212
|
+
function useApiMutation(queryFn, queryKey, queryParam, queryOptions) {
|
213
|
+
var key = (queryKey !== null && queryKey !== void 0 ? queryKey : []).concat([
|
214
|
+
queryParam ? typeof queryParam == "number" ? "".concat(queryParam) : queryParam : undefined
|
215
|
+
]);
|
216
|
+
return useMutation(key, queryFn, queryOptions);
|
217
|
+
}
|
218
|
+
function useInvalidateMutation(queryFn, queryKey, queryId, queryOptions) {
|
219
|
+
var invalidateQuery = useInvalidateQuery(queryKey, queryId);
|
220
|
+
var key = queryId ? queryKey.concat("".concat(queryId)) : queryKey;
|
221
|
+
return useMutation(key, queryFn, _object_spread$3({
|
222
|
+
onSuccess: function() {
|
223
|
+
return invalidateQuery();
|
224
|
+
}
|
225
|
+
}, queryOptions));
|
218
226
|
}
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
arguments[r] && ae(arguments[r], n);
|
227
|
-
return t;
|
228
|
-
}
|
229
|
-
const an = (e, t, n, { allOwnKeys: r } = {}) => (ae(t, (o, s) => {
|
230
|
-
n && I$1(o) ? e[s] = lt(o, n) : e[s] = o;
|
231
|
-
}, { allOwnKeys: r }), e), cn = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), un = (e, t, n, r) => {
|
232
|
-
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
233
|
-
value: t.prototype
|
234
|
-
}), n && Object.assign(e.prototype, n);
|
235
|
-
}, ln = (e, t, n, r) => {
|
236
|
-
let o, s, i;
|
237
|
-
const a = {};
|
238
|
-
if (t = t || {}, e == null)
|
239
|
-
return t;
|
240
|
-
do {
|
241
|
-
for (o = Object.getOwnPropertyNames(e), s = o.length; s-- > 0; )
|
242
|
-
i = o[s], (!r || r(i, e, t)) && !a[i] && (t[i] = e[i], a[i] = !0);
|
243
|
-
e = n !== !1 && qe(e);
|
244
|
-
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
245
|
-
return t;
|
246
|
-
}, dn = (e, t, n) => {
|
247
|
-
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
248
|
-
const r = e.indexOf(t, n);
|
249
|
-
return r !== -1 && r === n;
|
250
|
-
}, fn = (e) => {
|
251
|
-
if (!e)
|
252
|
-
return null;
|
253
|
-
if (te(e))
|
254
|
-
return e;
|
255
|
-
let t = e.length;
|
256
|
-
if (!ft(t))
|
257
|
-
return null;
|
258
|
-
const n = new Array(t);
|
259
|
-
for (; t-- > 0; )
|
260
|
-
n[t] = e[t];
|
261
|
-
return n;
|
262
|
-
}, pn = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && qe(Uint8Array)), hn = (e, t) => {
|
263
|
-
const r = (e && e[Symbol.iterator]).call(e);
|
264
|
-
let o;
|
265
|
-
for (; (o = r.next()) && !o.done; ) {
|
266
|
-
const s = o.value;
|
267
|
-
t.call(e, s[0], s[1]);
|
268
|
-
}
|
269
|
-
}, mn = (e, t) => {
|
270
|
-
let n;
|
271
|
-
const r = [];
|
272
|
-
for (; (n = e.exec(t)) !== null; )
|
273
|
-
r.push(n);
|
274
|
-
return r;
|
275
|
-
}, yn = k$1("HTMLFormElement"), gn = (e) => e.toLowerCase().replace(
|
276
|
-
/[-_\s]([a-z\d])(\w*)/g,
|
277
|
-
function(n, r, o) {
|
278
|
-
return r.toUpperCase() + o;
|
279
|
-
}
|
280
|
-
), Ke = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), En = k$1("RegExp"), yt = (e, t) => {
|
281
|
-
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
282
|
-
ae(n, (o, s) => {
|
283
|
-
let i;
|
284
|
-
(i = t(o, s, e)) !== !1 && (r[s] = i || o);
|
285
|
-
}), Object.defineProperties(e, r);
|
286
|
-
}, bn = (e) => {
|
287
|
-
yt(e, (t, n) => {
|
288
|
-
if (I$1(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
289
|
-
return !1;
|
290
|
-
const r = e[n];
|
291
|
-
if (I$1(r)) {
|
292
|
-
if (t.enumerable = !1, "writable" in t) {
|
293
|
-
t.writable = !1;
|
294
|
-
return;
|
295
|
-
}
|
296
|
-
t.set || (t.set = () => {
|
297
|
-
throw Error("Can not rewrite read-only method '" + n + "'");
|
298
|
-
});
|
299
|
-
}
|
300
|
-
});
|
301
|
-
}, Tn = (e, t) => {
|
302
|
-
const n = {}, r = (o) => {
|
303
|
-
o.forEach((s) => {
|
304
|
-
n[s] = !0;
|
305
|
-
});
|
306
|
-
};
|
307
|
-
return te(e) ? r(e) : r(String(e).split(t)), n;
|
308
|
-
}, wn = () => {
|
309
|
-
}, Rn = (e, t) => (e = +e, Number.isFinite(e) ? e : t), Ce = "abcdefghijklmnopqrstuvwxyz", Qe = "0123456789", gt = {
|
310
|
-
DIGIT: Qe,
|
311
|
-
ALPHA: Ce,
|
312
|
-
ALPHA_DIGIT: Ce + Ce.toUpperCase() + Qe
|
313
|
-
}, On = (e = 16, t = gt.ALPHA_DIGIT) => {
|
314
|
-
let n = "";
|
315
|
-
const { length: r } = t;
|
316
|
-
for (; e--; )
|
317
|
-
n += t[Math.random() * r | 0];
|
318
|
-
return n;
|
319
|
-
};
|
320
|
-
function Sn(e) {
|
321
|
-
return !!(e && I$1(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
|
227
|
+
function useInvalidateParentMutation(queryFn, queryKey, queryOptions) {
|
228
|
+
var invalidateQuery = useInvalidateQuery(queryKey);
|
229
|
+
return useMutation(queryKey, queryFn, _object_spread$3({
|
230
|
+
onSuccess: function() {
|
231
|
+
return invalidateQuery();
|
232
|
+
}
|
233
|
+
}, queryOptions));
|
322
234
|
}
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
})
|
335
|
-
|
235
|
+
// useInvalidateMutation : invalidate the object e.g /xxx/id
|
236
|
+
// useInvalidateParentMutation : invalidate the parent object e.g /xxx
|
237
|
+
// useUpdateMutation : replace the data in cache to avoid refetching the server
|
238
|
+
|
239
|
+
function _define_property$2(obj, key, value) {
|
240
|
+
if (key in obj) {
|
241
|
+
Object.defineProperty(obj, key, {
|
242
|
+
value: value,
|
243
|
+
enumerable: true,
|
244
|
+
configurable: true,
|
245
|
+
writable: true
|
246
|
+
});
|
247
|
+
} else {
|
248
|
+
obj[key] = value;
|
336
249
|
}
|
337
|
-
return
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
isFile: Zt,
|
354
|
-
isBlob: en,
|
355
|
-
isRegExp: En,
|
356
|
-
isFunction: I$1,
|
357
|
-
isStream: nn,
|
358
|
-
isURLSearchParams: sn,
|
359
|
-
isTypedArray: pn,
|
360
|
-
isFileList: tn,
|
361
|
-
forEach: ae,
|
362
|
-
merge: Be,
|
363
|
-
extend: an,
|
364
|
-
trim: on,
|
365
|
-
stripBOM: cn,
|
366
|
-
inherits: un,
|
367
|
-
toFlatObject: ln,
|
368
|
-
kindOf: be,
|
369
|
-
kindOfTest: k$1,
|
370
|
-
endsWith: dn,
|
371
|
-
toArray: fn,
|
372
|
-
forEachEntry: hn,
|
373
|
-
matchAll: mn,
|
374
|
-
isHTMLForm: yn,
|
375
|
-
hasOwnProperty: Ke,
|
376
|
-
hasOwnProp: Ke,
|
377
|
-
// an alias to avoid ESLint no-prototype-builtins detection
|
378
|
-
reduceDescriptors: yt,
|
379
|
-
freezeMethods: bn,
|
380
|
-
toObjectSet: Tn,
|
381
|
-
toCamelCase: gn,
|
382
|
-
noop: wn,
|
383
|
-
toFiniteNumber: Rn,
|
384
|
-
findKey: pt,
|
385
|
-
global: ht,
|
386
|
-
isContextDefined: mt,
|
387
|
-
ALPHABET: gt,
|
388
|
-
generateString: On,
|
389
|
-
isSpecCompliantForm: Sn,
|
390
|
-
toJSONObject: An,
|
391
|
-
isAsyncFn: Cn,
|
392
|
-
isThenable: Nn
|
393
|
-
};
|
394
|
-
function b$1(e, t, n, r, o) {
|
395
|
-
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);
|
250
|
+
return obj;
|
251
|
+
}
|
252
|
+
function _object_spread$2(target) {
|
253
|
+
for(var i = 1; i < arguments.length; i++){
|
254
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
255
|
+
var ownKeys = Object.keys(source);
|
256
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
257
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
258
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
259
|
+
}));
|
260
|
+
}
|
261
|
+
ownKeys.forEach(function(key) {
|
262
|
+
_define_property$2(target, key, source[key]);
|
263
|
+
});
|
264
|
+
}
|
265
|
+
return target;
|
396
266
|
}
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
message: this.message,
|
402
|
-
name: this.name,
|
403
|
-
// Microsoft
|
404
|
-
description: this.description,
|
405
|
-
number: this.number,
|
406
|
-
// Mozilla
|
407
|
-
fileName: this.fileName,
|
408
|
-
lineNumber: this.lineNumber,
|
409
|
-
columnNumber: this.columnNumber,
|
410
|
-
stack: this.stack,
|
411
|
-
// Axios
|
412
|
-
config: c.toJSONObject(this.config),
|
413
|
-
code: this.code,
|
414
|
-
status: this.response && this.response.status ? this.response.status : null
|
267
|
+
function queryFnWrapper(queryFn, queryParam) {
|
268
|
+
return function(context) {
|
269
|
+
if (queryParam) return queryFn(queryParam);
|
270
|
+
return queryFn();
|
415
271
|
};
|
416
|
-
}
|
417
|
-
});
|
418
|
-
const Et = b$1.prototype, bt = {};
|
419
|
-
[
|
420
|
-
"ERR_BAD_OPTION_VALUE",
|
421
|
-
"ERR_BAD_OPTION",
|
422
|
-
"ECONNABORTED",
|
423
|
-
"ETIMEDOUT",
|
424
|
-
"ERR_NETWORK",
|
425
|
-
"ERR_FR_TOO_MANY_REDIRECTS",
|
426
|
-
"ERR_DEPRECATED",
|
427
|
-
"ERR_BAD_RESPONSE",
|
428
|
-
"ERR_BAD_REQUEST",
|
429
|
-
"ERR_CANCELED",
|
430
|
-
"ERR_NOT_SUPPORT",
|
431
|
-
"ERR_INVALID_URL"
|
432
|
-
// eslint-disable-next-line func-names
|
433
|
-
].forEach((e) => {
|
434
|
-
bt[e] = { value: e };
|
435
|
-
});
|
436
|
-
Object.defineProperties(b$1, bt);
|
437
|
-
Object.defineProperty(Et, "isAxiosError", { value: !0 });
|
438
|
-
b$1.from = (e, t, n, r, o, s) => {
|
439
|
-
const i = Object.create(Et);
|
440
|
-
return c.toFlatObject(e, i, function(h) {
|
441
|
-
return h !== Error.prototype;
|
442
|
-
}, (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;
|
443
|
-
};
|
444
|
-
const xn = null;
|
445
|
-
function De(e) {
|
446
|
-
return c.isPlainObject(e) || c.isArray(e);
|
447
272
|
}
|
448
|
-
function
|
449
|
-
|
273
|
+
function useApiQuery(queryKey, queryFn, queryParam, queryOptions) {
|
274
|
+
var key = queryParam ? queryKey.concat([
|
275
|
+
typeof queryParam == "number" ? "".concat(queryParam) : queryParam
|
276
|
+
]) : queryKey;
|
277
|
+
return useQuery(key, queryFnWrapper(queryFn, queryParam), _object_spread$2({
|
278
|
+
retry: 0,
|
279
|
+
networkMode: "always",
|
280
|
+
retryOnMount: false,
|
281
|
+
refetchOnMount: false,
|
282
|
+
refetchOnWindowFocus: false
|
283
|
+
}, queryOptions));
|
284
|
+
}
|
285
|
+
function useApiQueries(queries) {
|
286
|
+
var results = useQueries$1({
|
287
|
+
queries: queries.map(function(q) {
|
288
|
+
var key = q.queryParam ? q.queryKey.concat([
|
289
|
+
typeof q.queryParam == "number" ? "".concat(q.queryParam) : q.queryParam
|
290
|
+
]) : q.queryKey;
|
291
|
+
return _object_spread$2({
|
292
|
+
queryKey: key,
|
293
|
+
queryFn: queryFnWrapper(q.queryFn, q.queryParam),
|
294
|
+
retry: 0,
|
295
|
+
// networkMode: "always",
|
296
|
+
retryOnMount: false,
|
297
|
+
refetchOnMount: false,
|
298
|
+
refetchOnWindowFocus: false
|
299
|
+
}, q.queryOptions);
|
300
|
+
})
|
301
|
+
});
|
302
|
+
var isFetching = results.findIndex(function(r) {
|
303
|
+
return r.isFetching === true;
|
304
|
+
}) != -1;
|
305
|
+
var isError = results.findIndex(function(r) {
|
306
|
+
return r.isError === true;
|
307
|
+
}) != -1;
|
308
|
+
var data = results.map(function(r) {
|
309
|
+
return r.data;
|
310
|
+
});
|
311
|
+
return {
|
312
|
+
data: data,
|
313
|
+
isFetching: isFetching,
|
314
|
+
isError: isError
|
315
|
+
};
|
450
316
|
}
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
317
|
+
|
318
|
+
function r$1(e) {
|
319
|
+
var t, f, n = "";
|
320
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
321
|
+
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);
|
322
|
+
else for(t in e)e[t] && (n && (n += " "), n += t);
|
323
|
+
return n;
|
455
324
|
}
|
456
|
-
function
|
457
|
-
|
325
|
+
function clsx$1() {
|
326
|
+
for(var e, t, f = 0, n = ""; f < arguments.length;)(e = arguments[f++]) && (t = r$1(e)) && (n && (n += " "), n += t);
|
327
|
+
return n;
|
458
328
|
}
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
throw new b$1("Blob is not supported. Use a Buffer instead.");
|
482
|
-
return c.isArrayBuffer(l) || c.isTypedArray(l) ? h && typeof Blob == "function" ? new Blob([l]) : Buffer.from(l) : l;
|
483
|
-
}
|
484
|
-
function f(l, d, m) {
|
485
|
-
let g = l;
|
486
|
-
if (l && !m && typeof l == "object") {
|
487
|
-
if (c.endsWith(d, "{}"))
|
488
|
-
d = r ? d : d.slice(0, -2), l = JSON.stringify(l);
|
489
|
-
else if (c.isArray(l) && _n(l) || (c.isFileList(l) || c.endsWith(d, "[]")) && (g = c.toArray(l)))
|
490
|
-
return d = Tt(d), g.forEach(function(A, T) {
|
491
|
-
!(c.isUndefined(A) || A === null) && t.append(
|
492
|
-
// eslint-disable-next-line no-nested-ternary
|
493
|
-
i === !0 ? Xe([d], T, s) : i === null ? d : d + "[]",
|
494
|
-
p(A)
|
495
|
-
);
|
496
|
-
}), !1;
|
329
|
+
|
330
|
+
function _array_like_to_array$1(arr, len) {
|
331
|
+
if (len == null || len > arr.length) len = arr.length;
|
332
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
333
|
+
return arr2;
|
334
|
+
}
|
335
|
+
function _array_with_holes(arr) {
|
336
|
+
if (Array.isArray(arr)) return arr;
|
337
|
+
}
|
338
|
+
function _array_without_holes$1(arr) {
|
339
|
+
if (Array.isArray(arr)) return _array_like_to_array$1(arr);
|
340
|
+
}
|
341
|
+
function _define_property$1(obj, key, value) {
|
342
|
+
if (key in obj) {
|
343
|
+
Object.defineProperty(obj, key, {
|
344
|
+
value: value,
|
345
|
+
enumerable: true,
|
346
|
+
configurable: true,
|
347
|
+
writable: true
|
348
|
+
});
|
349
|
+
} else {
|
350
|
+
obj[key] = value;
|
497
351
|
}
|
498
|
-
return
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
352
|
+
return obj;
|
353
|
+
}
|
354
|
+
function _iterable_to_array$1(iter) {
|
355
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
356
|
+
}
|
357
|
+
function _iterable_to_array_limit(arr, i) {
|
358
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
359
|
+
if (_i == null) return;
|
360
|
+
var _arr = [];
|
361
|
+
var _n = true;
|
362
|
+
var _d = false;
|
363
|
+
var _s, _e;
|
364
|
+
try {
|
365
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
366
|
+
_arr.push(_s.value);
|
367
|
+
if (i && _arr.length === i) break;
|
368
|
+
}
|
369
|
+
} catch (err) {
|
370
|
+
_d = true;
|
371
|
+
_e = err;
|
372
|
+
} finally{
|
373
|
+
try {
|
374
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
375
|
+
} finally{
|
376
|
+
if (_d) throw _e;
|
377
|
+
}
|
518
378
|
}
|
519
|
-
|
520
|
-
if (!c.isObject(e))
|
521
|
-
throw new TypeError("data must be an object");
|
522
|
-
return y(e), t;
|
523
|
-
}
|
524
|
-
function Ge(e) {
|
525
|
-
const t = {
|
526
|
-
"!": "%21",
|
527
|
-
"'": "%27",
|
528
|
-
"(": "%28",
|
529
|
-
")": "%29",
|
530
|
-
"~": "%7E",
|
531
|
-
"%20": "+",
|
532
|
-
"%00": "\0"
|
533
|
-
};
|
534
|
-
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
|
535
|
-
return t[r];
|
536
|
-
});
|
379
|
+
return _arr;
|
537
380
|
}
|
538
|
-
function
|
539
|
-
|
381
|
+
function _non_iterable_rest() {
|
382
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
540
383
|
}
|
541
|
-
|
542
|
-
|
543
|
-
this._pairs.push([t, n]);
|
544
|
-
};
|
545
|
-
wt.toString = function(t) {
|
546
|
-
const n = t ? function(r) {
|
547
|
-
return t.call(this, r, Ge);
|
548
|
-
} : Ge;
|
549
|
-
return this._pairs.map(function(o) {
|
550
|
-
return n(o[0]) + "=" + n(o[1]);
|
551
|
-
}, "").join("&");
|
552
|
-
};
|
553
|
-
function vn(e) {
|
554
|
-
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
555
|
-
}
|
556
|
-
function Rt(e, t, n) {
|
557
|
-
if (!t)
|
558
|
-
return e;
|
559
|
-
const r = n && n.encode || vn, o = n && n.serialize;
|
560
|
-
let s;
|
561
|
-
if (o ? s = o(t, n) : s = c.isURLSearchParams(t) ? t.toString() : new He(t, n).toString(r), s) {
|
562
|
-
const i = e.indexOf("#");
|
563
|
-
i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
|
564
|
-
}
|
565
|
-
return e;
|
384
|
+
function _non_iterable_spread$1() {
|
385
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
566
386
|
}
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
use(t, n, r) {
|
580
|
-
return this.handlers.push({
|
581
|
-
fulfilled: t,
|
582
|
-
rejected: n,
|
583
|
-
synchronous: r ? r.synchronous : !1,
|
584
|
-
runWhen: r ? r.runWhen : null
|
585
|
-
}), this.handlers.length - 1;
|
586
|
-
}
|
587
|
-
/**
|
588
|
-
* Remove an interceptor from the stack
|
589
|
-
*
|
590
|
-
* @param {Number} id The ID that was returned by `use`
|
591
|
-
*
|
592
|
-
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
|
593
|
-
*/
|
594
|
-
eject(t) {
|
595
|
-
this.handlers[t] && (this.handlers[t] = null);
|
596
|
-
}
|
597
|
-
/**
|
598
|
-
* Clear all interceptors from the stack
|
599
|
-
*
|
600
|
-
* @returns {void}
|
601
|
-
*/
|
602
|
-
clear() {
|
603
|
-
this.handlers && (this.handlers = []);
|
604
|
-
}
|
605
|
-
/**
|
606
|
-
* Iterate over all the registered interceptors
|
607
|
-
*
|
608
|
-
* This method is particularly useful for skipping over any
|
609
|
-
* interceptors that may have become `null` calling `eject`.
|
610
|
-
*
|
611
|
-
* @param {Function} fn The function to call for each interceptor
|
612
|
-
*
|
613
|
-
* @returns {void}
|
614
|
-
*/
|
615
|
-
forEach(t) {
|
616
|
-
c.forEach(this.handlers, function(r) {
|
617
|
-
r !== null && t(r);
|
618
|
-
});
|
619
|
-
}
|
620
|
-
}
|
621
|
-
const Ot = {
|
622
|
-
silentJSONParsing: !0,
|
623
|
-
forcedJSONParsing: !0,
|
624
|
-
clarifyTimeoutError: !1
|
625
|
-
}, Ln = typeof URLSearchParams < "u" ? URLSearchParams : He, In = typeof FormData < "u" ? FormData : null, Fn = typeof Blob < "u" ? Blob : null, kn = {
|
626
|
-
isBrowser: !0,
|
627
|
-
classes: {
|
628
|
-
URLSearchParams: Ln,
|
629
|
-
FormData: In,
|
630
|
-
Blob: Fn
|
631
|
-
},
|
632
|
-
protocols: ["http", "https", "file", "blob", "url", "data"]
|
633
|
-
}, 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
|
634
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
635
|
-
__proto__: null,
|
636
|
-
hasBrowserEnv: St,
|
637
|
-
hasStandardBrowserEnv: Bn,
|
638
|
-
hasStandardBrowserWebWorkerEnv: Dn
|
639
|
-
}, Symbol.toStringTag, { value: "Module" })), F$1 = {
|
640
|
-
...Mn,
|
641
|
-
...kn
|
642
|
-
};
|
643
|
-
function Un(e, t) {
|
644
|
-
return Re(e, new F$1.classes.URLSearchParams(), Object.assign({
|
645
|
-
visitor: function(n, r, o, s) {
|
646
|
-
return F$1.isNode && c.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
387
|
+
function _object_spread$1(target) {
|
388
|
+
for(var i = 1; i < arguments.length; i++){
|
389
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
390
|
+
var ownKeys = Object.keys(source);
|
391
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
392
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
393
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
394
|
+
}));
|
395
|
+
}
|
396
|
+
ownKeys.forEach(function(key) {
|
397
|
+
_define_property$1(target, key, source[key]);
|
398
|
+
});
|
647
399
|
}
|
648
|
-
|
649
|
-
}
|
650
|
-
function $n(e) {
|
651
|
-
return c.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
652
|
-
}
|
653
|
-
function jn(e) {
|
654
|
-
const t = {}, n = Object.keys(e);
|
655
|
-
let r;
|
656
|
-
const o = n.length;
|
657
|
-
let s;
|
658
|
-
for (r = 0; r < o; r++)
|
659
|
-
s = n[r], t[s] = e[s];
|
660
|
-
return t;
|
661
|
-
}
|
662
|
-
function At(e) {
|
663
|
-
function t(n, r, o, s) {
|
664
|
-
let i = n[s++];
|
665
|
-
if (i === "__proto__")
|
666
|
-
return !0;
|
667
|
-
const a = Number.isFinite(+i), h = s >= n.length;
|
668
|
-
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);
|
669
|
-
}
|
670
|
-
if (c.isFormData(e) && c.isFunction(e.entries)) {
|
671
|
-
const n = {};
|
672
|
-
return c.forEachEntry(e, (r, o) => {
|
673
|
-
t($n(r), o, n, 0);
|
674
|
-
}), n;
|
675
|
-
}
|
676
|
-
return null;
|
400
|
+
return target;
|
677
401
|
}
|
678
|
-
function
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
402
|
+
function ownKeys(object, enumerableOnly) {
|
403
|
+
var keys = Object.keys(object);
|
404
|
+
if (Object.getOwnPropertySymbols) {
|
405
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
406
|
+
if (enumerableOnly) {
|
407
|
+
symbols = symbols.filter(function(sym) {
|
408
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
409
|
+
});
|
410
|
+
}
|
411
|
+
keys.push.apply(keys, symbols);
|
685
412
|
}
|
686
|
-
|
687
|
-
}
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
return t;
|
697
|
-
if (c.isArrayBufferView(t))
|
698
|
-
return t.buffer;
|
699
|
-
if (c.isURLSearchParams(t))
|
700
|
-
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
701
|
-
let a;
|
702
|
-
if (s) {
|
703
|
-
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
704
|
-
return Un(t, this.formSerializer).toString();
|
705
|
-
if ((a = c.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
706
|
-
const h = this.env && this.env.FormData;
|
707
|
-
return Re(
|
708
|
-
a ? { "files[]": t } : t,
|
709
|
-
h && new h(),
|
710
|
-
this.formSerializer
|
711
|
-
);
|
712
|
-
}
|
413
|
+
return keys;
|
414
|
+
}
|
415
|
+
function _object_spread_props(target, source) {
|
416
|
+
source = source != null ? source : {};
|
417
|
+
if (Object.getOwnPropertyDescriptors) {
|
418
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
419
|
+
} else {
|
420
|
+
ownKeys(Object(source)).forEach(function(key) {
|
421
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
422
|
+
});
|
713
423
|
}
|
714
|
-
return
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
424
|
+
return target;
|
425
|
+
}
|
426
|
+
function _object_without_properties(source, excluded) {
|
427
|
+
if (source == null) return {};
|
428
|
+
var target = _object_without_properties_loose(source, excluded);
|
429
|
+
var key, i;
|
430
|
+
if (Object.getOwnPropertySymbols) {
|
431
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
432
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
433
|
+
key = sourceSymbolKeys[i];
|
434
|
+
if (excluded.indexOf(key) >= 0) continue;
|
435
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
436
|
+
target[key] = source[key];
|
437
|
+
}
|
726
438
|
}
|
727
|
-
return
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
env: {
|
739
|
-
FormData: F$1.classes.FormData,
|
740
|
-
Blob: F$1.classes.Blob
|
741
|
-
},
|
742
|
-
validateStatus: function(t) {
|
743
|
-
return t >= 200 && t < 300;
|
744
|
-
},
|
745
|
-
headers: {
|
746
|
-
common: {
|
747
|
-
Accept: "application/json, text/plain, */*",
|
748
|
-
"Content-Type": void 0
|
439
|
+
return target;
|
440
|
+
}
|
441
|
+
function _object_without_properties_loose(source, excluded) {
|
442
|
+
if (source == null) return {};
|
443
|
+
var target = {};
|
444
|
+
var sourceKeys = Object.keys(source);
|
445
|
+
var key, i;
|
446
|
+
for(i = 0; i < sourceKeys.length; i++){
|
447
|
+
key = sourceKeys[i];
|
448
|
+
if (excluded.indexOf(key) >= 0) continue;
|
449
|
+
target[key] = source[key];
|
749
450
|
}
|
750
|
-
|
751
|
-
};
|
752
|
-
c.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
753
|
-
ze.headers[e] = {};
|
754
|
-
});
|
755
|
-
const Je = ze, Hn = c.toObjectSet([
|
756
|
-
"age",
|
757
|
-
"authorization",
|
758
|
-
"content-length",
|
759
|
-
"content-type",
|
760
|
-
"etag",
|
761
|
-
"expires",
|
762
|
-
"from",
|
763
|
-
"host",
|
764
|
-
"if-modified-since",
|
765
|
-
"if-unmodified-since",
|
766
|
-
"last-modified",
|
767
|
-
"location",
|
768
|
-
"max-forwards",
|
769
|
-
"proxy-authorization",
|
770
|
-
"referer",
|
771
|
-
"retry-after",
|
772
|
-
"user-agent"
|
773
|
-
]), zn = (e) => {
|
774
|
-
const t = {};
|
775
|
-
let n, r, o;
|
776
|
-
return e && e.split(`
|
777
|
-
`).forEach(function(i) {
|
778
|
-
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);
|
779
|
-
}), t;
|
780
|
-
}, Ze = Symbol("internals");
|
781
|
-
function ne(e) {
|
782
|
-
return e && String(e).trim().toLowerCase();
|
783
|
-
}
|
784
|
-
function pe(e) {
|
785
|
-
return e === !1 || e == null ? e : c.isArray(e) ? e.map(pe) : String(e);
|
786
|
-
}
|
787
|
-
function Jn(e) {
|
788
|
-
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
789
|
-
let r;
|
790
|
-
for (; r = n.exec(e); )
|
791
|
-
t[r[1]] = r[2];
|
792
|
-
return t;
|
793
|
-
}
|
794
|
-
const Wn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
795
|
-
function Ne(e, t, n, r, o) {
|
796
|
-
if (c.isFunction(r))
|
797
|
-
return r.call(this, t, n);
|
798
|
-
if (o && (t = n), !!c.isString(t)) {
|
799
|
-
if (c.isString(r))
|
800
|
-
return t.indexOf(r) !== -1;
|
801
|
-
if (c.isRegExp(r))
|
802
|
-
return r.test(t);
|
803
|
-
}
|
451
|
+
return target;
|
804
452
|
}
|
805
|
-
function
|
806
|
-
|
807
|
-
}
|
808
|
-
function
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
453
|
+
function _sliced_to_array(arr, i) {
|
454
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest();
|
455
|
+
}
|
456
|
+
function _to_consumable_array$1(arr) {
|
457
|
+
return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
|
458
|
+
}
|
459
|
+
function _unsupported_iterable_to_array$1(o, minLen) {
|
460
|
+
if (!o) return;
|
461
|
+
if (typeof o === "string") return _array_like_to_array$1(o, minLen);
|
462
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
463
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
464
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
465
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
|
466
|
+
}
|
467
|
+
var u$1 = function(t) {
|
468
|
+
return "number" == typeof t && !isNaN(t);
|
469
|
+
}, d$1 = function(t) {
|
470
|
+
return "string" == typeof t;
|
471
|
+
}, p$1 = function(t) {
|
472
|
+
return "function" == typeof t;
|
473
|
+
}, m$1 = function(t) {
|
474
|
+
return d$1(t) || p$1(t) ? t : null;
|
475
|
+
}, f$1 = function(t) {
|
476
|
+
return isValidElement(t) || d$1(t) || p$1(t) || u$1(t);
|
477
|
+
};
|
478
|
+
function g$1(t, e, n) {
|
479
|
+
void 0 === n && (n = 300);
|
480
|
+
var o = t.scrollHeight, s = t.style;
|
481
|
+
requestAnimationFrame(function() {
|
482
|
+
s.minHeight = "initial", s.height = o + "px", s.transition = "all ".concat(n, "ms"), requestAnimationFrame(function() {
|
483
|
+
s.height = "0", s.padding = "0", s.margin = "0", setTimeout(e, n);
|
484
|
+
});
|
816
485
|
});
|
817
|
-
});
|
818
486
|
}
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
if (!n)
|
841
|
-
return o;
|
842
|
-
if (n === !0)
|
843
|
-
return Jn(o);
|
844
|
-
if (c.isFunction(n))
|
845
|
-
return n.call(this, o, r);
|
846
|
-
if (c.isRegExp(n))
|
847
|
-
return n.exec(o);
|
848
|
-
throw new TypeError("parser must be boolean|regexp|function");
|
849
|
-
}
|
850
|
-
}
|
851
|
-
}
|
852
|
-
has(t, n) {
|
853
|
-
if (t = ne(t), t) {
|
854
|
-
const r = c.findKey(this, t);
|
855
|
-
return !!(r && this[r] !== void 0 && (!n || Ne(this, this[r], r, n)));
|
856
|
-
}
|
857
|
-
return !1;
|
858
|
-
}
|
859
|
-
delete(t, n) {
|
860
|
-
const r = this;
|
861
|
-
let o = !1;
|
862
|
-
function s(i) {
|
863
|
-
if (i = ne(i), i) {
|
864
|
-
const a = c.findKey(r, i);
|
865
|
-
a && (!n || Ne(r, r[a], a, n)) && (delete r[a], o = !0);
|
866
|
-
}
|
867
|
-
}
|
868
|
-
return c.isArray(t) ? t.forEach(s) : s(t), o;
|
869
|
-
}
|
870
|
-
clear(t) {
|
871
|
-
const n = Object.keys(this);
|
872
|
-
let r = n.length, o = !1;
|
873
|
-
for (; r--; ) {
|
874
|
-
const s = n[r];
|
875
|
-
(!t || Ne(this, this[s], s, t, !0)) && (delete this[s], o = !0);
|
876
|
-
}
|
877
|
-
return o;
|
878
|
-
}
|
879
|
-
normalize(t) {
|
880
|
-
const n = this, r = {};
|
881
|
-
return c.forEach(this, (o, s) => {
|
882
|
-
const i = c.findKey(r, s);
|
883
|
-
if (i) {
|
884
|
-
n[i] = pe(o), delete n[s];
|
885
|
-
return;
|
886
|
-
}
|
887
|
-
const a = t ? Vn(s) : String(s).trim();
|
888
|
-
a !== s && delete n[s], n[a] = pe(o), r[a] = !0;
|
889
|
-
}), this;
|
890
|
-
}
|
891
|
-
concat(...t) {
|
892
|
-
return this.constructor.concat(this, ...t);
|
893
|
-
}
|
894
|
-
toJSON(t) {
|
895
|
-
const n = /* @__PURE__ */ Object.create(null);
|
896
|
-
return c.forEach(this, (r, o) => {
|
897
|
-
r != null && r !== !1 && (n[o] = t && c.isArray(r) ? r.join(", ") : r);
|
898
|
-
}), n;
|
899
|
-
}
|
900
|
-
[Symbol.iterator]() {
|
901
|
-
return Object.entries(this.toJSON())[Symbol.iterator]();
|
902
|
-
}
|
903
|
-
toString() {
|
904
|
-
return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
|
905
|
-
`);
|
906
|
-
}
|
907
|
-
get [Symbol.toStringTag]() {
|
908
|
-
return "AxiosHeaders";
|
909
|
-
}
|
910
|
-
static from(t) {
|
911
|
-
return t instanceof this ? t : new this(t);
|
912
|
-
}
|
913
|
-
static concat(t, ...n) {
|
914
|
-
const r = new this(t);
|
915
|
-
return n.forEach((o) => r.set(o)), r;
|
916
|
-
}
|
917
|
-
static accessor(t) {
|
918
|
-
const r = (this[Ze] = this[Ze] = {
|
919
|
-
accessors: {}
|
920
|
-
}).accessors, o = this.prototype;
|
921
|
-
function s(i) {
|
922
|
-
const a = ne(i);
|
923
|
-
r[a] || (Kn(o, i), r[a] = !0);
|
924
|
-
}
|
925
|
-
return c.isArray(t) ? t.forEach(s) : s(t), this;
|
926
|
-
}
|
487
|
+
function h$1(e) {
|
488
|
+
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;
|
489
|
+
return function(e) {
|
490
|
+
var u = e.children, d = e.position, p = e.preventExitTransition, m = e.done, f = e.nodeRef, _$h = e.isIn;
|
491
|
+
var y = i ? "".concat(a, "--").concat(d) : a, v = i ? "".concat(r, "--").concat(d) : r, T = useRef(0);
|
492
|
+
return useLayoutEffect(function() {
|
493
|
+
var _t_classList;
|
494
|
+
var _$t = f.current, _$e = y.split(" "), _$n = function(o) {
|
495
|
+
var _t_classList;
|
496
|
+
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)));
|
497
|
+
};
|
498
|
+
(_t_classList = _$t.classList).add.apply(_t_classList, _to_consumable_array$1(_$e)), _$t.addEventListener("animationend", _$n), _$t.addEventListener("animationcancel", _$n);
|
499
|
+
}, []), useEffect(function() {
|
500
|
+
var _$t = f.current, _$e = function() {
|
501
|
+
_$t.removeEventListener("animationend", _$e), _$l ? g$1(_$t, m, c) : m();
|
502
|
+
};
|
503
|
+
_$h || (p ? _$e() : (T.current = 1, _$t.className += " ".concat(v), _$t.addEventListener("animationend", _$e)));
|
504
|
+
}, [
|
505
|
+
_$h
|
506
|
+
]), React.createElement(React.Fragment, null, u);
|
507
|
+
};
|
927
508
|
}
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
}
|
947
|
-
function Ct(e) {
|
948
|
-
return !!(e && e.__CANCEL__);
|
949
|
-
}
|
950
|
-
function ce(e, t, n) {
|
951
|
-
b$1.call(this, e ?? "canceled", b$1.ERR_CANCELED, t, n), this.name = "CanceledError";
|
952
|
-
}
|
953
|
-
c.inherits(ce, b$1, {
|
954
|
-
__CANCEL__: !0
|
955
|
-
});
|
956
|
-
function Qn(e, t, n) {
|
957
|
-
const r = n.config.validateStatus;
|
958
|
-
!n.status || !r || r(n.status) ? e(n) : t(new b$1(
|
959
|
-
"Request failed with status code " + n.status,
|
960
|
-
[b$1.ERR_BAD_REQUEST, b$1.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
|
961
|
-
n.config,
|
962
|
-
n.request,
|
963
|
-
n
|
964
|
-
));
|
965
|
-
}
|
966
|
-
const Xn = F$1.hasStandardBrowserEnv ? (
|
967
|
-
// Standard browser envs support document.cookie
|
968
|
-
{
|
969
|
-
write(e, t, n, r, o, s) {
|
970
|
-
const i = [e + "=" + encodeURIComponent(t)];
|
971
|
-
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("; ");
|
509
|
+
function y$1(t, e) {
|
510
|
+
return null != t ? {
|
511
|
+
content: t.content,
|
512
|
+
containerId: t.props.containerId,
|
513
|
+
id: t.props.toastId,
|
514
|
+
theme: t.props.theme,
|
515
|
+
type: t.props.type,
|
516
|
+
data: t.props.data || {},
|
517
|
+
isLoading: t.props.isLoading,
|
518
|
+
icon: t.props.icon,
|
519
|
+
status: e
|
520
|
+
} : {};
|
521
|
+
}
|
522
|
+
var v$1 = {
|
523
|
+
list: new Map,
|
524
|
+
emitQueue: new Map,
|
525
|
+
on: function on(t, e) {
|
526
|
+
return this.list.has(t) || this.list.set(t, []), this.list.get(t).push(e), this;
|
972
527
|
},
|
973
|
-
|
974
|
-
|
975
|
-
|
528
|
+
off: function off(t, e) {
|
529
|
+
if (e) {
|
530
|
+
var n = this.list.get(t).filter(function(t) {
|
531
|
+
return t !== e;
|
532
|
+
});
|
533
|
+
return this.list.set(t, n), this;
|
534
|
+
}
|
535
|
+
return this.list.delete(t), this;
|
536
|
+
},
|
537
|
+
cancelEmit: function cancelEmit(t) {
|
538
|
+
var e = this.emitQueue.get(t);
|
539
|
+
return e && (e.forEach(clearTimeout), this.emitQueue.delete(t)), this;
|
976
540
|
},
|
977
|
-
|
978
|
-
|
541
|
+
emit: function emit(t) {
|
542
|
+
var _this = this, _arguments = arguments;
|
543
|
+
this.list.has(t) && this.list.get(t).forEach(function(e) {
|
544
|
+
var n = setTimeout(function() {
|
545
|
+
e.apply(void 0, _to_consumable_array$1([].slice.call(_arguments, 1)));
|
546
|
+
}, 0);
|
547
|
+
_this.emitQueue.has(t) || _this.emitQueue.set(t, []), _this.emitQueue.get(t).push(n);
|
548
|
+
});
|
979
549
|
}
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
550
|
+
}, T$1 = function(e) {
|
551
|
+
var n = e.theme, o = e.type, s = _object_without_properties(e, [
|
552
|
+
"theme",
|
553
|
+
"type"
|
554
|
+
]);
|
555
|
+
return React.createElement("svg", _object_spread$1({
|
556
|
+
viewBox: "0 0 24 24",
|
557
|
+
width: "100%",
|
558
|
+
height: "100%",
|
559
|
+
fill: "colored" === n ? "currentColor" : "var(--toastify-icon-color-".concat(o, ")")
|
560
|
+
}, s));
|
561
|
+
}, E$1 = {
|
562
|
+
info: function info(e) {
|
563
|
+
return React.createElement(T$1, _object_spread$1({}, e), React.createElement("path", {
|
564
|
+
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"
|
565
|
+
}));
|
985
566
|
},
|
986
|
-
|
987
|
-
|
567
|
+
warning: function warning(e) {
|
568
|
+
return React.createElement(T$1, _object_spread$1({}, e), React.createElement("path", {
|
569
|
+
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"
|
570
|
+
}));
|
988
571
|
},
|
989
|
-
|
572
|
+
success: function success(e) {
|
573
|
+
return React.createElement(T$1, _object_spread$1({}, e), React.createElement("path", {
|
574
|
+
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"
|
575
|
+
}));
|
576
|
+
},
|
577
|
+
error: function error(e) {
|
578
|
+
return React.createElement(T$1, _object_spread$1({}, e), React.createElement("path", {
|
579
|
+
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"
|
580
|
+
}));
|
581
|
+
},
|
582
|
+
spinner: function spinner() {
|
583
|
+
return React.createElement("div", {
|
584
|
+
className: "Toastify__spinner"
|
585
|
+
});
|
990
586
|
}
|
991
|
-
|
992
|
-
)
|
993
|
-
|
994
|
-
|
995
|
-
}
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
host: n.host,
|
1014
|
-
search: n.search ? n.search.replace(/^\?/, "") : "",
|
1015
|
-
hash: n.hash ? n.hash.replace(/^#/, "") : "",
|
1016
|
-
hostname: n.hostname,
|
1017
|
-
port: n.port,
|
1018
|
-
pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname
|
1019
|
-
};
|
587
|
+
};
|
588
|
+
function C$1(t) {
|
589
|
+
var _r = _sliced_to_array(useReducer(function(t) {
|
590
|
+
return t + 1;
|
591
|
+
}, 0), 2), o = _r[1], _i = _sliced_to_array(useState([]), 2), _$l = _i[0], c = _i[1], g = useRef(null), _$h = useRef(new Map).current, T = function(t) {
|
592
|
+
return -1 !== _$l.indexOf(t);
|
593
|
+
}, C = useRef({
|
594
|
+
toastKey: 1,
|
595
|
+
displayedToast: 0,
|
596
|
+
count: 0,
|
597
|
+
queue: [],
|
598
|
+
props: t,
|
599
|
+
containerId: null,
|
600
|
+
isToastActive: T,
|
601
|
+
getToast: function(t) {
|
602
|
+
return _$h.get(t);
|
603
|
+
}
|
604
|
+
}).current;
|
605
|
+
function b(t) {
|
606
|
+
var e = t.containerId;
|
607
|
+
var _C_props = C.props, _$n = _C_props.limit;
|
608
|
+
!_$n || e && C.containerId !== e || (C.count -= C.queue.length, C.queue = []);
|
1020
609
|
}
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
)
|
1027
|
-
// Non standard browser envs (web workers, react-native) lack needed support.
|
1028
|
-
/* @__PURE__ */ function() {
|
1029
|
-
return function() {
|
1030
|
-
return !0;
|
1031
|
-
};
|
1032
|
-
}()
|
1033
|
-
);
|
1034
|
-
function er(e) {
|
1035
|
-
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
1036
|
-
return t && t[1] || "";
|
1037
|
-
}
|
1038
|
-
function tr(e, t) {
|
1039
|
-
e = e || 10;
|
1040
|
-
const n = new Array(e), r = new Array(e);
|
1041
|
-
let o = 0, s = 0, i;
|
1042
|
-
return t = t !== void 0 ? t : 1e3, function(h) {
|
1043
|
-
const p = Date.now(), f = r[s];
|
1044
|
-
i || (i = p), n[o] = h, r[o] = p;
|
1045
|
-
let u = s, E = 0;
|
1046
|
-
for (; u !== o; )
|
1047
|
-
E += n[u++], u = u % e;
|
1048
|
-
if (o = (o + 1) % e, o === s && (s = (s + 1) % e), p - i < t)
|
1049
|
-
return;
|
1050
|
-
const y = f && p - f;
|
1051
|
-
return y ? Math.round(E * 1e3 / y) : void 0;
|
1052
|
-
};
|
1053
|
-
}
|
1054
|
-
function et(e, t) {
|
1055
|
-
let n = 0;
|
1056
|
-
const r = tr(50, 250);
|
1057
|
-
return (o) => {
|
1058
|
-
const s = o.loaded, i = o.lengthComputable ? o.total : void 0, a = s - n, h = r(a), p = s <= i;
|
1059
|
-
n = s;
|
1060
|
-
const f = {
|
1061
|
-
loaded: s,
|
1062
|
-
total: i,
|
1063
|
-
progress: i ? s / i : void 0,
|
1064
|
-
bytes: a,
|
1065
|
-
rate: h || void 0,
|
1066
|
-
estimated: h && i && p ? (i - s) / h : void 0,
|
1067
|
-
event: o
|
1068
|
-
};
|
1069
|
-
f[t ? "download" : "upload"] = !0, e(f);
|
1070
|
-
};
|
1071
|
-
}
|
1072
|
-
const nr = typeof XMLHttpRequest < "u", rr = nr && function(e) {
|
1073
|
-
return new Promise(function(n, r) {
|
1074
|
-
let o = e.data;
|
1075
|
-
const s = M$1.from(e.headers).normalize();
|
1076
|
-
let { responseType: i, withXSRFToken: a } = e, h;
|
1077
|
-
function p() {
|
1078
|
-
e.cancelToken && e.cancelToken.unsubscribe(h), e.signal && e.signal.removeEventListener("abort", h);
|
610
|
+
function I(t) {
|
611
|
+
c(function(e) {
|
612
|
+
return null == t ? [] : e.filter(function(e) {
|
613
|
+
return e !== t;
|
614
|
+
});
|
615
|
+
});
|
1079
616
|
}
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
s.setContentType(!1);
|
1084
|
-
else if ((f = s.getContentType()) !== !1) {
|
1085
|
-
const [d, ...m] = f ? f.split(";").map((g) => g.trim()).filter(Boolean) : [];
|
1086
|
-
s.setContentType([d || "multipart/form-data", ...m].join("; "));
|
1087
|
-
}
|
617
|
+
function _() {
|
618
|
+
var _C_queue_shift = C.queue.shift(), _$t = _C_queue_shift.toastContent, e = _C_queue_shift.toastProps, _$n = _C_queue_shift.staleId;
|
619
|
+
O(_$t, e, _$n);
|
1088
620
|
}
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
621
|
+
function L(t, n) {
|
622
|
+
var _$s = n.delay, _$r = n.staleId, _$i = _object_without_properties(n, [
|
623
|
+
"delay",
|
624
|
+
"staleId"
|
625
|
+
]);
|
626
|
+
if (!f$1(t) || function(t) {
|
627
|
+
return !g.current || C.props.enableMultiContainer && t.containerId !== C.props.containerId || _$h.has(t.toastId) && null == t.updateId;
|
628
|
+
}(_$i)) return;
|
629
|
+
var _$l = _$i.toastId, c = _$i.updateId, T = _$i.data, b = C.props, _$L = function() {
|
630
|
+
return I(_$l);
|
631
|
+
}, N = null == c;
|
632
|
+
N && C.count++;
|
633
|
+
var M = _object_spread_props(_object_spread$1(_object_spread_props(_object_spread$1({}, b), {
|
634
|
+
style: b.toastStyle,
|
635
|
+
key: C.toastKey++
|
636
|
+
}), Object.fromEntries(Object.entries(_$i).filter(function(t) {
|
637
|
+
var _t = _sliced_to_array(t, 2); _t[0]; var _$n = _t[1];
|
638
|
+
return null != _$n;
|
639
|
+
}))), {
|
640
|
+
toastId: _$l,
|
641
|
+
updateId: c,
|
642
|
+
data: T,
|
643
|
+
closeToast: _$L,
|
644
|
+
isIn: !1,
|
645
|
+
className: m$1(_$i.className || b.toastClassName),
|
646
|
+
bodyClassName: m$1(_$i.bodyClassName || b.bodyClassName),
|
647
|
+
progressClassName: m$1(_$i.progressClassName || b.progressClassName),
|
648
|
+
autoClose: !_$i.isLoading && (R = _$i.autoClose, w = b.autoClose, !1 === R || u$1(R) && R > 0 ? R : w),
|
649
|
+
deleteToast: function deleteToast() {
|
650
|
+
var _$t = y$1(_$h.get(_$l), "removed");
|
651
|
+
_$h.delete(_$l), v$1.emit(4, _$t);
|
652
|
+
var _$e = C.queue.length;
|
653
|
+
if (C.count = null == _$l ? C.count - C.displayedToast : C.count - 1, C.count < 0 && (C.count = 0), _$e > 0) {
|
654
|
+
var _$t1 = null == _$l ? C.props.limit : 1;
|
655
|
+
if (1 === _$e || 1 === _$t1) C.displayedToast++, _();
|
656
|
+
else {
|
657
|
+
var _$n = _$t1 > _$e ? _$e : _$t1;
|
658
|
+
C.displayedToast = _$n;
|
659
|
+
for(var _$t2 = 0; _$t2 < _$n; _$t2++)_();
|
660
|
+
}
|
661
|
+
} else o();
|
662
|
+
}
|
663
|
+
});
|
664
|
+
var R, w;
|
665
|
+
M.iconOut = function(t) {
|
666
|
+
var _$n = t.theme, o = t.type, _$s = t.isLoading, _$r = t.icon, _$i = null;
|
667
|
+
var _$l = {
|
668
|
+
theme: _$n,
|
669
|
+
type: o
|
670
|
+
};
|
671
|
+
return !1 === _$r || (p$1(_$r) ? _$i = _$r(_$l) : isValidElement(_$r) ? _$i = cloneElement(_$r, _$l) : d$1(_$r) || u$1(_$r) ? _$i = _$r : _$s ? _$i = E$1.spinner() : function(t) {
|
672
|
+
return t in E$1;
|
673
|
+
}(o) && (_$i = E$1[o](_$l))), _$i;
|
674
|
+
}(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);
|
675
|
+
var x = t;
|
676
|
+
isValidElement(t) && !d$1(t.type) ? x = cloneElement(t, {
|
677
|
+
closeToast: _$L,
|
678
|
+
toastProps: M,
|
679
|
+
data: T
|
680
|
+
}) : p$1(t) && (x = t({
|
681
|
+
closeToast: _$L,
|
682
|
+
toastProps: M,
|
683
|
+
data: T
|
684
|
+
})), b.limit && b.limit > 0 && C.count > b.limit && N ? C.queue.push({
|
685
|
+
toastContent: x,
|
686
|
+
toastProps: M,
|
687
|
+
staleId: _$r
|
688
|
+
}) : u$1(_$s) ? setTimeout(function() {
|
689
|
+
O(x, M, _$r);
|
690
|
+
}, _$s) : O(x, M, _$r);
|
1093
691
|
}
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
};
|
1109
|
-
Qn(function(A) {
|
1110
|
-
n(A), p();
|
1111
|
-
}, function(A) {
|
1112
|
-
r(A), p();
|
1113
|
-
}, g), u = null;
|
692
|
+
function O(t, e, n) {
|
693
|
+
var o = e.toastId;
|
694
|
+
n && _$h.delete(n);
|
695
|
+
var _$s = {
|
696
|
+
content: t,
|
697
|
+
props: e
|
698
|
+
};
|
699
|
+
_$h.set(o, _$s), c(function(t) {
|
700
|
+
return _to_consumable_array$1(t).concat([
|
701
|
+
o
|
702
|
+
]).filter(function(t) {
|
703
|
+
return t !== n;
|
704
|
+
});
|
705
|
+
}), v$1.emit(4, y$1(_$s, null == _$s.props.updateId ? "added" : "updated"));
|
1114
706
|
}
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
},
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
707
|
+
return useEffect(function() {
|
708
|
+
return C.containerId = t.containerId, v$1.cancelEmit(3).on(0, L).on(1, function(t) {
|
709
|
+
return g.current && I(t);
|
710
|
+
}).on(5, b).emit(2, C), function() {
|
711
|
+
_$h.clear(), v$1.emit(3, C);
|
712
|
+
};
|
713
|
+
}, []), useEffect(function() {
|
714
|
+
C.props = t, C.isToastActive = T, C.displayedToast = _$l.length;
|
715
|
+
}), {
|
716
|
+
getToastToRender: function getToastToRender(e) {
|
717
|
+
var _$n = new Map, o = Array.from(_$h.values());
|
718
|
+
return t.newestOnTop && o.reverse(), o.forEach(function(t) {
|
719
|
+
var _t_props = t.props, e = _t_props.position;
|
720
|
+
_$n.has(e) || _$n.set(e, []), _$n.get(e).push(t);
|
721
|
+
}), Array.from(_$n, function(t) {
|
722
|
+
return e(t[0], t[1]);
|
723
|
+
});
|
724
|
+
},
|
725
|
+
containerRef: g,
|
726
|
+
isToastActive: T
|
727
|
+
};
|
728
|
+
}
|
729
|
+
function b$1(t) {
|
730
|
+
return t.targetTouches && t.targetTouches.length >= 1 ? t.targetTouches[0].clientX : t.clientX;
|
731
|
+
}
|
732
|
+
function I$1(t) {
|
733
|
+
return t.targetTouches && t.targetTouches.length >= 1 ? t.targetTouches[0].clientY : t.clientY;
|
734
|
+
}
|
735
|
+
function _$1(t) {
|
736
|
+
var _i = _sliced_to_array(useState(!1), 2), o = _i[0], a = _i[1], _i1 = _sliced_to_array(useState(!1), 2), r = _i1[0], _$l = _i1[1], c = useRef(null), u = useRef({
|
737
|
+
start: 0,
|
738
|
+
x: 0,
|
739
|
+
y: 0,
|
740
|
+
delta: 0,
|
741
|
+
removalDistance: 0,
|
742
|
+
canCloseOnClick: !0,
|
743
|
+
canDrag: !1,
|
744
|
+
boundingRect: null,
|
745
|
+
didMove: !1
|
746
|
+
}).current, d = useRef(t), m = t.autoClose, f = t.pauseOnHover, g = t.closeToast, _$h = t.onClick, y = t.closeOnClick;
|
747
|
+
function v(e) {
|
748
|
+
if (t.draggable) {
|
749
|
+
"touchstart" === e.nativeEvent.type && e.nativeEvent.preventDefault(), u.didMove = !1, document.addEventListener("mousemove", _), document.addEventListener("mouseup", L), document.addEventListener("touchmove", _), document.addEventListener("touchend", L);
|
750
|
+
var _$n = c.current;
|
751
|
+
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));
|
752
|
+
}
|
1133
753
|
}
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
const l = er(E);
|
1140
|
-
if (l && F$1.protocols.indexOf(l) === -1) {
|
1141
|
-
r(new b$1("Unsupported protocol " + l + ":", b$1.ERR_BAD_REQUEST, e));
|
1142
|
-
return;
|
754
|
+
function T(e) {
|
755
|
+
if (u.boundingRect) {
|
756
|
+
var _u_boundingRect = u.boundingRect, _$n = _u_boundingRect.top, o = _u_boundingRect.bottom, _$s = _u_boundingRect.left, a = _u_boundingRect.right;
|
757
|
+
"touchend" !== e.nativeEvent.type && t.pauseOnHover && u.x >= _$s && u.x <= a && u.y >= _$n && u.y <= o ? C() : E();
|
758
|
+
}
|
1143
759
|
}
|
1144
|
-
|
1145
|
-
|
1146
|
-
}, Me = {
|
1147
|
-
http: xn,
|
1148
|
-
xhr: rr
|
1149
|
-
};
|
1150
|
-
c.forEach(Me, (e, t) => {
|
1151
|
-
if (e) {
|
1152
|
-
try {
|
1153
|
-
Object.defineProperty(e, "name", { value: t });
|
1154
|
-
} catch {
|
760
|
+
function E() {
|
761
|
+
a(!0);
|
1155
762
|
}
|
1156
|
-
|
1157
|
-
|
1158
|
-
});
|
1159
|
-
const tt = (e) => `- ${e}`, sr = (e) => c.isFunction(e) || e === null || e === !1, xt = {
|
1160
|
-
getAdapter: (e) => {
|
1161
|
-
e = c.isArray(e) ? e : [e];
|
1162
|
-
const { length: t } = e;
|
1163
|
-
let n, r;
|
1164
|
-
const o = {};
|
1165
|
-
for (let s = 0; s < t; s++) {
|
1166
|
-
n = e[s];
|
1167
|
-
let i;
|
1168
|
-
if (r = n, !sr(n) && (r = Me[(i = String(n)).toLowerCase()], r === void 0))
|
1169
|
-
throw new b$1(`Unknown adapter '${i}'`);
|
1170
|
-
if (r)
|
1171
|
-
break;
|
1172
|
-
o[i || "#" + s] = r;
|
763
|
+
function C() {
|
764
|
+
a(!1);
|
1173
765
|
}
|
1174
|
-
|
1175
|
-
|
1176
|
-
(
|
1177
|
-
);
|
1178
|
-
let i = t ? s.length > 1 ? `since :
|
1179
|
-
` + s.map(tt).join(`
|
1180
|
-
`) : " " + tt(s[0]) : "as no adapter specified";
|
1181
|
-
throw new b$1(
|
1182
|
-
"There is no suitable adapter to dispatch the request " + i,
|
1183
|
-
"ERR_NOT_SUPPORT"
|
1184
|
-
);
|
766
|
+
function _(e) {
|
767
|
+
var _$n = c.current;
|
768
|
+
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)));
|
1185
769
|
}
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
}
|
1194
|
-
function nt(e) {
|
1195
|
-
return _e(e), e.headers = M$1.from(e.headers), e.data = xe.call(
|
1196
|
-
e,
|
1197
|
-
e.transformRequest
|
1198
|
-
), ["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) {
|
1199
|
-
return _e(e), r.data = xe.call(
|
1200
|
-
e,
|
1201
|
-
e.transformResponse,
|
1202
|
-
r
|
1203
|
-
), r.headers = M$1.from(r.headers), r;
|
1204
|
-
}, function(r) {
|
1205
|
-
return Ct(r) || (_e(e), r && r.response && (r.response.data = xe.call(
|
1206
|
-
e,
|
1207
|
-
e.transformResponse,
|
1208
|
-
r.response
|
1209
|
-
), r.response.headers = M$1.from(r.response.headers))), Promise.reject(r);
|
1210
|
-
});
|
1211
|
-
}
|
1212
|
-
const rt = (e) => e instanceof M$1 ? e.toJSON() : e;
|
1213
|
-
function ee(e, t) {
|
1214
|
-
t = t || {};
|
1215
|
-
const n = {};
|
1216
|
-
function r(p, f, u) {
|
1217
|
-
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;
|
1218
|
-
}
|
1219
|
-
function o(p, f, u) {
|
1220
|
-
if (c.isUndefined(f)) {
|
1221
|
-
if (!c.isUndefined(p))
|
1222
|
-
return r(void 0, p, u);
|
1223
|
-
} else
|
1224
|
-
return r(p, f, u);
|
1225
|
-
}
|
1226
|
-
function s(p, f) {
|
1227
|
-
if (!c.isUndefined(f))
|
1228
|
-
return r(void 0, f);
|
1229
|
-
}
|
1230
|
-
function i(p, f) {
|
1231
|
-
if (c.isUndefined(f)) {
|
1232
|
-
if (!c.isUndefined(p))
|
1233
|
-
return r(void 0, p);
|
1234
|
-
} else
|
1235
|
-
return r(void 0, f);
|
1236
|
-
}
|
1237
|
-
function a(p, f, u) {
|
1238
|
-
if (u in t)
|
1239
|
-
return r(p, f);
|
1240
|
-
if (u in e)
|
1241
|
-
return r(void 0, p);
|
1242
|
-
}
|
1243
|
-
const h = {
|
1244
|
-
url: s,
|
1245
|
-
method: s,
|
1246
|
-
data: s,
|
1247
|
-
baseURL: i,
|
1248
|
-
transformRequest: i,
|
1249
|
-
transformResponse: i,
|
1250
|
-
paramsSerializer: i,
|
1251
|
-
timeout: i,
|
1252
|
-
timeoutMessage: i,
|
1253
|
-
withCredentials: i,
|
1254
|
-
withXSRFToken: i,
|
1255
|
-
adapter: i,
|
1256
|
-
responseType: i,
|
1257
|
-
xsrfCookieName: i,
|
1258
|
-
xsrfHeaderName: i,
|
1259
|
-
onUploadProgress: i,
|
1260
|
-
onDownloadProgress: i,
|
1261
|
-
decompress: i,
|
1262
|
-
maxContentLength: i,
|
1263
|
-
maxBodyLength: i,
|
1264
|
-
beforeRedirect: i,
|
1265
|
-
transport: i,
|
1266
|
-
httpAgent: i,
|
1267
|
-
httpsAgent: i,
|
1268
|
-
cancelToken: i,
|
1269
|
-
socketPath: i,
|
1270
|
-
responseEncoding: i,
|
1271
|
-
validateStatus: a,
|
1272
|
-
headers: (p, f) => o(rt(p), rt(f), !0)
|
1273
|
-
};
|
1274
|
-
return c.forEach(Object.keys(Object.assign({}, e, t)), function(f) {
|
1275
|
-
const u = h[f] || o, E = u(e[f], t[f], f);
|
1276
|
-
c.isUndefined(E) && u !== a || (n[f] = E);
|
1277
|
-
}), n;
|
1278
|
-
}
|
1279
|
-
const _t = "1.6.7", We = {};
|
1280
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
1281
|
-
We[e] = function(r) {
|
1282
|
-
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
1283
|
-
};
|
1284
|
-
});
|
1285
|
-
const st = {};
|
1286
|
-
We.transitional = function(t, n, r) {
|
1287
|
-
function o(s, i) {
|
1288
|
-
return "[Axios v" + _t + "] Transitional option '" + s + "'" + i + (r ? ". " + r : "");
|
1289
|
-
}
|
1290
|
-
return (s, i, a) => {
|
1291
|
-
if (t === !1)
|
1292
|
-
throw new b$1(
|
1293
|
-
o(i, " has been removed" + (n ? " in " + n : "")),
|
1294
|
-
b$1.ERR_DEPRECATED
|
1295
|
-
);
|
1296
|
-
return n && !st[i] && (st[i] = !0, console.warn(
|
1297
|
-
o(
|
1298
|
-
i,
|
1299
|
-
" has been deprecated since v" + n + " and will be removed in the near future"
|
1300
|
-
)
|
1301
|
-
)), t ? t(s, i, a) : !0;
|
1302
|
-
};
|
1303
|
-
};
|
1304
|
-
function or(e, t, n) {
|
1305
|
-
if (typeof e != "object")
|
1306
|
-
throw new b$1("options must be an object", b$1.ERR_BAD_OPTION_VALUE);
|
1307
|
-
const r = Object.keys(e);
|
1308
|
-
let o = r.length;
|
1309
|
-
for (; o-- > 0; ) {
|
1310
|
-
const s = r[o], i = t[s];
|
1311
|
-
if (i) {
|
1312
|
-
const a = e[s], h = a === void 0 || i(a, s, e);
|
1313
|
-
if (h !== !0)
|
1314
|
-
throw new b$1("option " + s + " must be " + h, b$1.ERR_BAD_OPTION_VALUE);
|
1315
|
-
continue;
|
770
|
+
function L() {
|
771
|
+
document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", L), document.removeEventListener("touchmove", _), document.removeEventListener("touchend", L);
|
772
|
+
var e = c.current;
|
773
|
+
if (u.canDrag && u.didMove && e) {
|
774
|
+
if (u.canDrag = !1, Math.abs(u.delta) > u.removalDistance) return _$l(!0), void t.closeToast();
|
775
|
+
e.style.transition = "transform 0.2s, opacity 0.2s", e.style.transform = "translate".concat(t.draggableDirection, "(0)"), e.style.opacity = "1";
|
776
|
+
}
|
1316
777
|
}
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
778
|
+
useEffect(function() {
|
779
|
+
d.current = t;
|
780
|
+
}), useEffect(function() {
|
781
|
+
return c.current && c.current.addEventListener("d", E, {
|
782
|
+
once: !0
|
783
|
+
}), p$1(t.onOpen) && t.onOpen(isValidElement(t.children) && t.children.props), function() {
|
784
|
+
var _$t = d.current;
|
785
|
+
p$1(_$t.onClose) && _$t.onClose(isValidElement(_$t.children) && _$t.children.props);
|
786
|
+
};
|
787
|
+
}, []), useEffect(function() {
|
788
|
+
return t.pauseOnFocusLoss && (document.hasFocus() || C(), window.addEventListener("focus", E), window.addEventListener("blur", C)), function() {
|
789
|
+
t.pauseOnFocusLoss && (window.removeEventListener("focus", E), window.removeEventListener("blur", C));
|
790
|
+
};
|
791
|
+
}, [
|
792
|
+
t.pauseOnFocusLoss
|
793
|
+
]);
|
794
|
+
var O = {
|
795
|
+
onMouseDown: v,
|
796
|
+
onTouchStart: v,
|
797
|
+
onMouseUp: T,
|
798
|
+
onTouchEnd: T
|
1330
799
|
};
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
serialize: q$1.function
|
1366
|
-
}, !0)), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
1367
|
-
let i = s && c.merge(
|
1368
|
-
s.common,
|
1369
|
-
s[n.method]
|
1370
|
-
);
|
1371
|
-
s && c.forEach(
|
1372
|
-
["delete", "get", "head", "post", "put", "patch", "common"],
|
1373
|
-
(l) => {
|
1374
|
-
delete s[l];
|
1375
|
-
}
|
1376
|
-
), n.headers = M$1.concat(i, s);
|
1377
|
-
const a = [];
|
1378
|
-
let h = !0;
|
1379
|
-
this.interceptors.request.forEach(function(d) {
|
1380
|
-
typeof d.runWhen == "function" && d.runWhen(n) === !1 || (h = h && d.synchronous, a.unshift(d.fulfilled, d.rejected));
|
1381
|
-
});
|
1382
|
-
const p = [];
|
1383
|
-
this.interceptors.response.forEach(function(d) {
|
1384
|
-
p.push(d.fulfilled, d.rejected);
|
800
|
+
return m && f && (O.onMouseEnter = C, O.onMouseLeave = E), y && (O.onClick = function(t) {
|
801
|
+
_$h && _$h(t), u.canCloseOnClick && g();
|
802
|
+
}), {
|
803
|
+
playToast: E,
|
804
|
+
pauseToast: C,
|
805
|
+
isRunning: o,
|
806
|
+
preventExitTransition: r,
|
807
|
+
toastRef: c,
|
808
|
+
eventHandlers: O
|
809
|
+
};
|
810
|
+
}
|
811
|
+
function L$1(e) {
|
812
|
+
var n = e.closeToast, o = e.theme, tmp = e.ariaLabel, s = tmp === void 0 ? "close" : tmp;
|
813
|
+
return React.createElement("button", {
|
814
|
+
className: "Toastify__close-button Toastify__close-button--".concat(o),
|
815
|
+
type: "button",
|
816
|
+
onClick: function(t) {
|
817
|
+
t.stopPropagation(), n(t);
|
818
|
+
},
|
819
|
+
"aria-label": s
|
820
|
+
}, React.createElement("svg", {
|
821
|
+
"aria-hidden": "true",
|
822
|
+
viewBox: "0 0 14 16"
|
823
|
+
}, React.createElement("path", {
|
824
|
+
fillRule: "evenodd",
|
825
|
+
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"
|
826
|
+
})));
|
827
|
+
}
|
828
|
+
function O$1(e) {
|
829
|
+
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;
|
830
|
+
var _$h = r || u && 0 === d, y = _object_spread_props(_object_spread$1({}, _$l), {
|
831
|
+
animationDuration: "".concat(n, "ms"),
|
832
|
+
animationPlayState: o ? "running" : "paused",
|
833
|
+
opacity: _$h ? 0 : 1
|
1385
834
|
});
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
}
|
1404
|
-
try {
|
1405
|
-
f = nt.call(this, y);
|
1406
|
-
} catch (l) {
|
1407
|
-
return Promise.reject(l);
|
1408
|
-
}
|
1409
|
-
for (u = 0, E = p.length; u < E; )
|
1410
|
-
f = f.then(p[u++], p[u++]);
|
1411
|
-
return f;
|
1412
|
-
}
|
1413
|
-
getUri(t) {
|
1414
|
-
t = ee(this.defaults, t);
|
1415
|
-
const n = Nt(t.baseURL, t.url);
|
1416
|
-
return Rt(n, t.params, t.paramsSerializer);
|
1417
|
-
}
|
835
|
+
u && (y.transform = "scaleX(".concat(d, ")"));
|
836
|
+
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), {
|
837
|
+
"Toastify__progress-bar--rtl": m
|
838
|
+
}), T = p$1(i) ? i({
|
839
|
+
rtl: m,
|
840
|
+
type: a,
|
841
|
+
defaultClassName: v
|
842
|
+
}) : clsx$1(v, i);
|
843
|
+
return React.createElement("div", _define_property$1({
|
844
|
+
role: "progressbar",
|
845
|
+
"aria-hidden": _$h ? "true" : "false",
|
846
|
+
"aria-label": "notification timer",
|
847
|
+
className: T,
|
848
|
+
style: y
|
849
|
+
}, u && d >= 1 ? "onTransitionEnd" : "onAnimationEnd", u && d < 1 ? null : function() {
|
850
|
+
f && s();
|
851
|
+
}));
|
1418
852
|
}
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
853
|
+
var N$1 = function(n) {
|
854
|
+
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), {
|
855
|
+
"Toastify__toast--rtl": x
|
856
|
+
}, {
|
857
|
+
"Toastify__toast--close-on-click": A
|
858
|
+
}), H = p$1(T) ? T({
|
859
|
+
rtl: x,
|
860
|
+
position: v,
|
861
|
+
type: f,
|
862
|
+
defaultClassName: F
|
863
|
+
}) : clsx$1(F, T), S = !!w || !d, _$q = {
|
864
|
+
closeToast: _$h,
|
865
|
+
type: f,
|
866
|
+
theme: z
|
867
|
+
};
|
868
|
+
var _$Q = null;
|
869
|
+
return !1 === _$l || (_$Q = p$1(_$l) ? _$l(_$q) : isValidElement(_$l) ? cloneElement(_$l, _$q) : L$1(_$q)), React.createElement(y, {
|
870
|
+
isIn: P,
|
871
|
+
done: k,
|
872
|
+
position: v,
|
873
|
+
preventExitTransition: s,
|
874
|
+
nodeRef: r
|
875
|
+
}, React.createElement("div", _object_spread_props(_object_spread$1({
|
876
|
+
id: $,
|
877
|
+
onClick: m,
|
878
|
+
className: H
|
879
|
+
}, i), {
|
880
|
+
style: E,
|
881
|
+
ref: r
|
882
|
+
}), React.createElement("div", _object_spread_props(_object_spread$1({}, P && {
|
883
|
+
role: R
|
884
|
+
}), {
|
885
|
+
className: p$1(C) ? C({
|
886
|
+
type: f
|
887
|
+
}) : clsx$1("Toastify__toast-body", C),
|
888
|
+
style: b
|
889
|
+
}), null != D && React.createElement("div", {
|
890
|
+
className: clsx$1("Toastify__toast-icon", {
|
891
|
+
"Toastify--animate-icon Toastify__zoom-enter": !B
|
892
|
+
})
|
893
|
+
}, D), React.createElement("div", null, u)), _$Q, React.createElement(O$1, _object_spread_props(_object_spread$1({}, M && !S ? {
|
894
|
+
key: "pb-".concat(M)
|
895
|
+
} : {}), {
|
896
|
+
rtl: x,
|
897
|
+
theme: z,
|
898
|
+
delay: d,
|
899
|
+
isRunning: o,
|
900
|
+
isIn: P,
|
901
|
+
closeToast: _$h,
|
902
|
+
hide: g,
|
903
|
+
type: f,
|
904
|
+
style: N,
|
905
|
+
className: I,
|
906
|
+
controlledProgress: S,
|
907
|
+
progress: w || 0
|
908
|
+
}))));
|
909
|
+
}, M$1 = function M(t, e) {
|
910
|
+
return void 0 === e && (e = !1), {
|
911
|
+
enter: "Toastify--animate Toastify__".concat(t, "-enter"),
|
912
|
+
exit: "Toastify--animate Toastify__".concat(t, "-exit"),
|
913
|
+
appendPosition: e
|
914
|
+
};
|
915
|
+
}, 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 = forwardRef(function(e, n) {
|
916
|
+
var f = function f(t) {
|
917
|
+
var _$e = clsx$1("Toastify__toast-container", "Toastify__toast-container--".concat(t), {
|
918
|
+
"Toastify__toast-container--rtl": u
|
919
|
+
});
|
920
|
+
return p$1(i) ? i({
|
921
|
+
position: t,
|
922
|
+
rtl: u,
|
923
|
+
defaultClassName: _$e
|
924
|
+
}) : clsx$1(_$e, m$1(i));
|
925
|
+
};
|
926
|
+
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;
|
927
|
+
return useEffect(function() {
|
928
|
+
n && (n.current = a.current);
|
929
|
+
}, []), React.createElement("div", {
|
930
|
+
ref: a,
|
931
|
+
className: "Toastify",
|
932
|
+
id: d
|
933
|
+
}, o(function(e, n) {
|
934
|
+
var o = n.length ? _object_spread$1({}, _$l) : _object_spread_props(_object_spread$1({}, _$l), {
|
935
|
+
pointerEvents: "none"
|
936
|
+
});
|
937
|
+
return React.createElement("div", {
|
938
|
+
className: f(e),
|
939
|
+
style: o,
|
940
|
+
key: "container-".concat(e)
|
941
|
+
}, n.map(function(e, o) {
|
942
|
+
var _$s = e.content, a = e.props;
|
943
|
+
return React.createElement(N$1, _object_spread_props(_object_spread$1({}, a), {
|
944
|
+
isIn: r(a.toastId),
|
945
|
+
style: _object_spread_props(_object_spread$1({}, a.style), {
|
946
|
+
"--nth": o + 1,
|
947
|
+
"--len": n.length
|
948
|
+
}),
|
949
|
+
key: "toast-".concat(a.key)
|
950
|
+
}), _$s);
|
951
|
+
}));
|
1425
952
|
}));
|
1426
|
-
};
|
1427
953
|
});
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
954
|
+
k$1.displayName = "ToastContainer", k$1.defaultProps = {
|
955
|
+
position: "top-right",
|
956
|
+
transition: R$1,
|
957
|
+
autoClose: 5e3,
|
958
|
+
closeButton: L$1,
|
959
|
+
pauseOnHover: !0,
|
960
|
+
pauseOnFocusLoss: !0,
|
961
|
+
closeOnClick: !0,
|
962
|
+
draggable: !0,
|
963
|
+
draggablePercent: 80,
|
964
|
+
draggableDirection: "x",
|
965
|
+
role: "alert",
|
966
|
+
theme: "light"
|
967
|
+
};
|
968
|
+
var P$1, B$1 = new Map, D$1 = [], A$1 = 1;
|
969
|
+
function z$1() {
|
970
|
+
return "" + A$1++;
|
971
|
+
}
|
972
|
+
function F$1(t) {
|
973
|
+
return t && (d$1(t.toastId) || u$1(t.toastId)) ? t.toastId : z$1();
|
974
|
+
}
|
975
|
+
function H$1(t, e) {
|
976
|
+
return B$1.size > 0 ? v$1.emit(0, t, e) : D$1.push({
|
977
|
+
content: t,
|
978
|
+
options: e
|
979
|
+
}), e.toastId;
|
980
|
+
}
|
981
|
+
function S$1(t, e) {
|
982
|
+
return _object_spread_props(_object_spread$1({}, e), {
|
983
|
+
type: e && e.type || t,
|
984
|
+
toastId: F$1(e)
|
985
|
+
});
|
986
|
+
}
|
987
|
+
function q$1(t) {
|
988
|
+
return function(e, n) {
|
989
|
+
return H$1(e, S$1(t, n));
|
1439
990
|
};
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
991
|
+
}
|
992
|
+
function Q$1(t, e) {
|
993
|
+
return H$1(t, S$1("default", e));
|
994
|
+
}
|
995
|
+
Q$1.loading = function(t, e) {
|
996
|
+
return H$1(t, S$1("default", _object_spread$1({
|
997
|
+
isLoading: !0,
|
998
|
+
autoClose: !1,
|
999
|
+
closeOnClick: !1,
|
1000
|
+
closeButton: !1,
|
1001
|
+
draggable: !1
|
1002
|
+
}, e)));
|
1003
|
+
}, Q$1.promise = function(t, e, n) {
|
1004
|
+
var o, s = e.pending, a = e.error, r = e.success;
|
1005
|
+
s && (o = d$1(s) ? Q$1.loading(s, n) : Q$1.loading(s.render, _object_spread$1({}, n, s)));
|
1006
|
+
var i = {
|
1007
|
+
isLoading: null,
|
1008
|
+
autoClose: null,
|
1009
|
+
closeOnClick: null,
|
1010
|
+
closeButton: null,
|
1011
|
+
draggable: null
|
1012
|
+
}, _$l = function(t, e, s) {
|
1013
|
+
if (null == e) return void Q$1.dismiss(o);
|
1014
|
+
var a = _object_spread_props(_object_spread$1({
|
1015
|
+
type: t
|
1016
|
+
}, i, n), {
|
1017
|
+
data: s
|
1018
|
+
}), r = d$1(e) ? {
|
1019
|
+
render: e
|
1020
|
+
} : e;
|
1021
|
+
return o ? Q$1.update(o, _object_spread$1({}, a, r)) : Q$1(r.render, _object_spread$1({}, a, r)), s;
|
1022
|
+
}, c = p$1(t) ? t() : t;
|
1023
|
+
return c.then(function(t) {
|
1024
|
+
return _$l("success", r, t);
|
1025
|
+
}).catch(function(t) {
|
1026
|
+
return _$l("error", a, t);
|
1027
|
+
}), c;
|
1028
|
+
}, 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) {
|
1029
|
+
return H$1(t, S$1("default", _object_spread$1({
|
1030
|
+
theme: "dark"
|
1031
|
+
}, e)));
|
1032
|
+
}, Q$1.dismiss = function(t) {
|
1033
|
+
B$1.size > 0 ? v$1.emit(1, t) : D$1 = D$1.filter(function(e) {
|
1034
|
+
return null != t && e.options.toastId !== t;
|
1451
1035
|
});
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
}),
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1036
|
+
}, Q$1.clearWaitingQueue = function(t) {
|
1037
|
+
return void 0 === t && (t = {}), v$1.emit(5, t);
|
1038
|
+
}, Q$1.isActive = function(t) {
|
1039
|
+
var e = !1;
|
1040
|
+
return B$1.forEach(function(n) {
|
1041
|
+
n.isToastActive && n.isToastActive(t) && (e = !0);
|
1042
|
+
}), e;
|
1043
|
+
}, Q$1.update = function(t, e) {
|
1044
|
+
void 0 === e && (e = {}), setTimeout(function() {
|
1045
|
+
var n = function(t, e) {
|
1046
|
+
var n = e.containerId;
|
1047
|
+
var o = B$1.get(n || P$1);
|
1048
|
+
return o && o.getToast(t);
|
1049
|
+
}(t, e);
|
1050
|
+
if (n) {
|
1051
|
+
var o = n.props, s = n.content, a = _object_spread_props(_object_spread$1({
|
1052
|
+
delay: 100
|
1053
|
+
}, o, e), {
|
1054
|
+
toastId: e.toastId || t,
|
1055
|
+
updateId: z$1()
|
1056
|
+
});
|
1057
|
+
a.toastId !== t && (a.staleId = t);
|
1058
|
+
var r = a.render || s;
|
1059
|
+
delete a.render, H$1(r, a);
|
1060
|
+
}
|
1061
|
+
}, 0);
|
1062
|
+
}, Q$1.done = function(t) {
|
1063
|
+
Q$1.update(t, {
|
1064
|
+
progress: 1
|
1470
1065
|
});
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
*/
|
1475
|
-
throwIfRequested() {
|
1476
|
-
if (this.reason)
|
1477
|
-
throw this.reason;
|
1478
|
-
}
|
1479
|
-
/**
|
1480
|
-
* Subscribe to the cancel signal
|
1481
|
-
*/
|
1482
|
-
subscribe(t) {
|
1483
|
-
if (this.reason) {
|
1484
|
-
t(this.reason);
|
1485
|
-
return;
|
1486
|
-
}
|
1487
|
-
this._listeners ? this._listeners.push(t) : this._listeners = [t];
|
1488
|
-
}
|
1489
|
-
/**
|
1490
|
-
* Unsubscribe from the cancel signal
|
1491
|
-
*/
|
1492
|
-
unsubscribe(t) {
|
1493
|
-
if (!this._listeners)
|
1494
|
-
return;
|
1495
|
-
const n = this._listeners.indexOf(t);
|
1496
|
-
n !== -1 && this._listeners.splice(n, 1);
|
1497
|
-
}
|
1498
|
-
/**
|
1499
|
-
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
1500
|
-
* cancels the `CancelToken`.
|
1501
|
-
*/
|
1502
|
-
static source() {
|
1503
|
-
let t;
|
1504
|
-
return {
|
1505
|
-
token: new Ve(function(o) {
|
1506
|
-
t = o;
|
1507
|
-
}),
|
1508
|
-
cancel: t
|
1066
|
+
}, Q$1.onChange = function(t) {
|
1067
|
+
return v$1.on(4, t), function() {
|
1068
|
+
v$1.off(4, t);
|
1509
1069
|
};
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
}
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
NonAuthoritativeInformation: 203,
|
1530
|
-
NoContent: 204,
|
1531
|
-
ResetContent: 205,
|
1532
|
-
PartialContent: 206,
|
1533
|
-
MultiStatus: 207,
|
1534
|
-
AlreadyReported: 208,
|
1535
|
-
ImUsed: 226,
|
1536
|
-
MultipleChoices: 300,
|
1537
|
-
MovedPermanently: 301,
|
1538
|
-
Found: 302,
|
1539
|
-
SeeOther: 303,
|
1540
|
-
NotModified: 304,
|
1541
|
-
UseProxy: 305,
|
1542
|
-
Unused: 306,
|
1543
|
-
TemporaryRedirect: 307,
|
1544
|
-
PermanentRedirect: 308,
|
1545
|
-
BadRequest: 400,
|
1546
|
-
Unauthorized: 401,
|
1547
|
-
PaymentRequired: 402,
|
1548
|
-
Forbidden: 403,
|
1549
|
-
NotFound: 404,
|
1550
|
-
MethodNotAllowed: 405,
|
1551
|
-
NotAcceptable: 406,
|
1552
|
-
ProxyAuthenticationRequired: 407,
|
1553
|
-
RequestTimeout: 408,
|
1554
|
-
Conflict: 409,
|
1555
|
-
Gone: 410,
|
1556
|
-
LengthRequired: 411,
|
1557
|
-
PreconditionFailed: 412,
|
1558
|
-
PayloadTooLarge: 413,
|
1559
|
-
UriTooLong: 414,
|
1560
|
-
UnsupportedMediaType: 415,
|
1561
|
-
RangeNotSatisfiable: 416,
|
1562
|
-
ExpectationFailed: 417,
|
1563
|
-
ImATeapot: 418,
|
1564
|
-
MisdirectedRequest: 421,
|
1565
|
-
UnprocessableEntity: 422,
|
1566
|
-
Locked: 423,
|
1567
|
-
FailedDependency: 424,
|
1568
|
-
TooEarly: 425,
|
1569
|
-
UpgradeRequired: 426,
|
1570
|
-
PreconditionRequired: 428,
|
1571
|
-
TooManyRequests: 429,
|
1572
|
-
RequestHeaderFieldsTooLarge: 431,
|
1573
|
-
UnavailableForLegalReasons: 451,
|
1574
|
-
InternalServerError: 500,
|
1575
|
-
NotImplemented: 501,
|
1576
|
-
BadGateway: 502,
|
1577
|
-
ServiceUnavailable: 503,
|
1578
|
-
GatewayTimeout: 504,
|
1579
|
-
HttpVersionNotSupported: 505,
|
1580
|
-
VariantAlsoNegotiates: 506,
|
1581
|
-
InsufficientStorage: 507,
|
1582
|
-
LoopDetected: 508,
|
1583
|
-
NotExtended: 510,
|
1584
|
-
NetworkAuthenticationRequired: 511
|
1585
|
-
};
|
1586
|
-
Object.entries($e).forEach(([e, t]) => {
|
1587
|
-
$e[t] = e;
|
1070
|
+
}, Q$1.POSITION = {
|
1071
|
+
TOP_LEFT: "top-left",
|
1072
|
+
TOP_RIGHT: "top-right",
|
1073
|
+
TOP_CENTER: "top-center",
|
1074
|
+
BOTTOM_LEFT: "bottom-left",
|
1075
|
+
BOTTOM_RIGHT: "bottom-right",
|
1076
|
+
BOTTOM_CENTER: "bottom-center"
|
1077
|
+
}, Q$1.TYPE = {
|
1078
|
+
INFO: "info",
|
1079
|
+
SUCCESS: "success",
|
1080
|
+
WARNING: "warning",
|
1081
|
+
ERROR: "error",
|
1082
|
+
DEFAULT: "default"
|
1083
|
+
}, v$1.on(2, function(t) {
|
1084
|
+
P$1 = t.containerId || t, B$1.set(P$1, t), D$1.forEach(function(t) {
|
1085
|
+
v$1.emit(0, t.content, t.options);
|
1086
|
+
}), D$1 = [];
|
1087
|
+
}).on(3, function(t) {
|
1088
|
+
B$1.delete(t.containerId || t), 0 === B$1.size && v$1.off(0).off(1).off(5);
|
1588
1089
|
});
|
1589
|
-
|
1590
|
-
function
|
1591
|
-
|
1592
|
-
|
1593
|
-
return
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
C$1.spread = ar;
|
1609
|
-
C$1.isAxiosError = cr;
|
1610
|
-
C$1.mergeConfig = ee;
|
1611
|
-
C$1.AxiosHeaders = M$1;
|
1612
|
-
C$1.formToJSON = (e) => At(c.isHTMLForm(e) ? new FormData(e) : e);
|
1613
|
-
C$1.getAdapter = xt.getAdapter;
|
1614
|
-
C$1.HttpStatusCode = ur;
|
1615
|
-
C$1.default = C$1;
|
1616
|
-
function vt(e, t) {
|
1617
|
-
const n = useQueryClient(), r = t ? e.concat([`${t}`]) : e;
|
1618
|
-
return React.useCallback(() => r ? n.invalidateQueries(r) : null, [r, n]);
|
1619
|
-
}
|
1620
|
-
function Cr(e, t, n, r) {
|
1621
|
-
const o = (t ?? []).concat([n ? typeof n == "number" ? `${n}` : n : void 0]);
|
1622
|
-
return useMutation(o, e, r);
|
1623
|
-
}
|
1624
|
-
function Nr(e, t, n, r) {
|
1625
|
-
const o = vt(t, n), s = n ? t.concat(`${n}`) : t;
|
1626
|
-
return useMutation(s, e, { onSuccess: () => o(), ...r });
|
1627
|
-
}
|
1628
|
-
function xr(e, t, n) {
|
1629
|
-
const r = vt(t);
|
1630
|
-
return useMutation(t, e, { onSuccess: () => r(), ...n });
|
1631
|
-
}
|
1632
|
-
function Lt(e, t) {
|
1633
|
-
return function(n) {
|
1634
|
-
return t ? e(t) : e();
|
1635
|
-
};
|
1636
|
-
}
|
1637
|
-
function Pr(e, t, n, r) {
|
1638
|
-
const o = n ? e.concat([typeof n == "number" ? `${n}` : n]) : e;
|
1639
|
-
return useQuery(o, Lt(t, n), {
|
1640
|
-
retry: 0,
|
1641
|
-
networkMode: "always",
|
1642
|
-
retryOnMount: !1,
|
1643
|
-
refetchOnMount: !1,
|
1644
|
-
refetchOnWindowFocus: !1,
|
1645
|
-
...r
|
1646
|
-
});
|
1647
|
-
}
|
1648
|
-
function vr(e) {
|
1649
|
-
const t = useQueries$1(
|
1650
|
-
{
|
1651
|
-
queries: e.map((s) => ({
|
1652
|
-
queryKey: s.queryParam ? s.queryKey.concat([typeof s.queryParam == "number" ? `${s.queryParam}` : s.queryParam]) : s.queryKey,
|
1653
|
-
queryFn: Lt(s.queryFn, s.queryParam),
|
1654
|
-
retry: 0,
|
1655
|
-
// networkMode: "always",
|
1656
|
-
retryOnMount: !1,
|
1657
|
-
refetchOnMount: !1,
|
1658
|
-
refetchOnWindowFocus: !1,
|
1659
|
-
...s.queryOptions
|
1660
|
-
}))
|
1090
|
+
|
1091
|
+
function _array_like_to_array(arr, len) {
|
1092
|
+
if (len == null || len > arr.length) len = arr.length;
|
1093
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
1094
|
+
return arr2;
|
1095
|
+
}
|
1096
|
+
function _array_without_holes(arr) {
|
1097
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
1098
|
+
}
|
1099
|
+
function _define_property(obj, key, value) {
|
1100
|
+
if (key in obj) {
|
1101
|
+
Object.defineProperty(obj, key, {
|
1102
|
+
value: value,
|
1103
|
+
enumerable: true,
|
1104
|
+
configurable: true,
|
1105
|
+
writable: true
|
1106
|
+
});
|
1107
|
+
} else {
|
1108
|
+
obj[key] = value;
|
1661
1109
|
}
|
1662
|
-
|
1663
|
-
return { data: t.map((s) => s.data), isFetching: n, isError: r };
|
1664
|
-
}
|
1665
|
-
function It(e) {
|
1666
|
-
var t, n, r = "";
|
1667
|
-
if (typeof e == "string" || typeof e == "number")
|
1668
|
-
r += e;
|
1669
|
-
else if (typeof e == "object")
|
1670
|
-
if (Array.isArray(e))
|
1671
|
-
for (t = 0; t < e.length; t++)
|
1672
|
-
e[t] && (n = It(e[t])) && (r && (r += " "), r += n);
|
1673
|
-
else
|
1674
|
-
for (t in e)
|
1675
|
-
e[t] && (r && (r += " "), r += t);
|
1676
|
-
return r;
|
1677
|
-
}
|
1678
|
-
function H$1() {
|
1679
|
-
for (var e, t, n = 0, r = ""; n < arguments.length; )
|
1680
|
-
(e = arguments[n++]) && (t = It(e)) && (r && (r += " "), r += t);
|
1681
|
-
return r;
|
1682
|
-
}
|
1683
|
-
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) => isValidElement(e) || G(e) || x(e) || se(e);
|
1684
|
-
function lr(e, t, n) {
|
1685
|
-
n === void 0 && (n = 300);
|
1686
|
-
const { scrollHeight: r, style: o } = e;
|
1687
|
-
requestAnimationFrame(() => {
|
1688
|
-
o.minHeight = "initial", o.height = r + "px", o.transition = `all ${n}ms`, requestAnimationFrame(() => {
|
1689
|
-
o.height = "0", o.padding = "0", o.margin = "0", setTimeout(t, n);
|
1690
|
-
});
|
1691
|
-
});
|
1110
|
+
return obj;
|
1692
1111
|
}
|
1693
|
-
function
|
1694
|
-
|
1695
|
-
return function(i) {
|
1696
|
-
let { children: a, position: h, preventExitTransition: p, done: f, nodeRef: u, isIn: E } = i;
|
1697
|
-
const y = r ? `${t}--${h}` : t, l = r ? `${n}--${h}` : n, d = useRef(0);
|
1698
|
-
return useLayoutEffect(() => {
|
1699
|
-
const m = u.current, g = y.split(" "), w = (A) => {
|
1700
|
-
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));
|
1701
|
-
};
|
1702
|
-
m.classList.add(...g), m.addEventListener("animationend", w), m.addEventListener("animationcancel", w);
|
1703
|
-
}, []), useEffect(() => {
|
1704
|
-
const m = u.current, g = () => {
|
1705
|
-
m.removeEventListener("animationend", g), o ? lr(m, f, s) : f();
|
1706
|
-
};
|
1707
|
-
E || (p ? g() : (d.current = 1, m.className += ` ${l}`, m.addEventListener("animationend", g)));
|
1708
|
-
}, [E]), React.createElement(React.Fragment, null, a);
|
1709
|
-
};
|
1112
|
+
function _iterable_to_array(iter) {
|
1113
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
1710
1114
|
}
|
1711
|
-
function
|
1712
|
-
|
1115
|
+
function _non_iterable_spread() {
|
1116
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
1713
1117
|
}
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
}, cancelEmit(e) {
|
1723
|
-
const t = this.emitQueue.get(e);
|
1724
|
-
return t && (t.forEach(clearTimeout), this.emitQueue.delete(e)), this;
|
1725
|
-
}, emit(e) {
|
1726
|
-
this.list.has(e) && this.list.get(e).forEach((t) => {
|
1727
|
-
const n = setTimeout(() => {
|
1728
|
-
t(...[].slice.call(arguments, 1));
|
1729
|
-
}, 0);
|
1730
|
-
this.emitQueue.has(e) || this.emitQueue.set(e, []), this.emitQueue.get(e).push(n);
|
1731
|
-
});
|
1732
|
-
} }, le = (e) => {
|
1733
|
-
let { theme: t, type: n, ...r } = e;
|
1734
|
-
return React.createElement("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", fill: t === "colored" ? "currentColor" : `var(--toastify-icon-color-${n})`, ...r });
|
1735
|
-
}, ve = { info: function(e) {
|
1736
|
-
return React.createElement(le, { ...e }, React.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" }));
|
1737
|
-
}, warning: function(e) {
|
1738
|
-
return React.createElement(le, { ...e }, React.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" }));
|
1739
|
-
}, success: function(e) {
|
1740
|
-
return React.createElement(le, { ...e }, React.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" }));
|
1741
|
-
}, error: function(e) {
|
1742
|
-
return React.createElement(le, { ...e }, React.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" }));
|
1743
|
-
}, spinner: function() {
|
1744
|
-
return React.createElement("div", { className: "Toastify__spinner" });
|
1745
|
-
} };
|
1746
|
-
function dr(e) {
|
1747
|
-
const [, t] = useReducer((y) => y + 1, 0), [n, r] = useState([]), o = useRef(null), s = useRef(/* @__PURE__ */ new Map()).current, i = (y) => n.indexOf(y) !== -1, a = useRef({ toastKey: 1, displayedToast: 0, count: 0, queue: [], props: e, containerId: null, isToastActive: i, getToast: (y) => s.get(y) }).current;
|
1748
|
-
function h(y) {
|
1749
|
-
let { containerId: l } = y;
|
1750
|
-
const { limit: d } = a.props;
|
1751
|
-
!d || l && a.containerId !== l || (a.count -= a.queue.length, a.queue = []);
|
1752
|
-
}
|
1753
|
-
function p(y) {
|
1754
|
-
r((l) => y == null ? [] : l.filter((d) => d !== y));
|
1755
|
-
}
|
1756
|
-
function f() {
|
1757
|
-
const { toastContent: y, toastProps: l, staleId: d } = a.queue.shift();
|
1758
|
-
E(y, l, d);
|
1759
|
-
}
|
1760
|
-
function u(y, l) {
|
1761
|
-
let { delay: d, staleId: m, ...g } = l;
|
1762
|
-
if (!Pe(y) || function(v) {
|
1763
|
-
return !o.current || a.props.enableMultiContainer && v.containerId !== a.props.containerId || s.has(v.toastId) && v.updateId == null;
|
1764
|
-
}(g))
|
1765
|
-
return;
|
1766
|
-
const { toastId: w, updateId: A, data: T } = g, { props: O } = a, U = () => p(w), $ = A == null;
|
1767
|
-
$ && a.count++;
|
1768
|
-
const N = { ...O, style: O.toastStyle, key: a.toastKey++, ...Object.fromEntries(Object.entries(g).filter((v) => {
|
1769
|
-
let [B, _] = v;
|
1770
|
-
return _ != null;
|
1771
|
-
})), 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() {
|
1772
|
-
const v = ot(s.get(w), "removed");
|
1773
|
-
s.delete(w), L$1.emit(4, v);
|
1774
|
-
const B = a.queue.length;
|
1775
|
-
if (a.count = w == null ? a.count - a.displayedToast : a.count - 1, a.count < 0 && (a.count = 0), B > 0) {
|
1776
|
-
const _ = w == null ? a.props.limit : 1;
|
1777
|
-
if (B === 1 || _ === 1)
|
1778
|
-
a.displayedToast++, f();
|
1779
|
-
else {
|
1780
|
-
const W = _ > B ? B : _;
|
1781
|
-
a.displayedToast = W;
|
1782
|
-
for (let P = 0; P < W; P++)
|
1783
|
-
f();
|
1118
|
+
function _object_spread(target) {
|
1119
|
+
for(var i = 1; i < arguments.length; i++){
|
1120
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
1121
|
+
var ownKeys = Object.keys(source);
|
1122
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
1123
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
1124
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
1125
|
+
}));
|
1784
1126
|
}
|
1785
|
-
|
1786
|
-
|
1787
|
-
|
1788
|
-
var z, Y;
|
1789
|
-
N.iconOut = function(v) {
|
1790
|
-
let { theme: B, type: _, isLoading: W, icon: P } = v, D = null;
|
1791
|
-
const V = { theme: B, type: _ };
|
1792
|
-
return P === !1 || (x(P) ? D = P(V) : isValidElement(P) ? D = cloneElement(P, V) : G(P) || se(P) ? D = P : W ? D = ve.spinner() : ((ue) => ue in ve)(_) && (D = ve[_](V))), D;
|
1793
|
-
}(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);
|
1794
|
-
let J = y;
|
1795
|
-
isValidElement(y) && !G(y.type) ? J = 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(() => {
|
1796
|
-
E(J, N, m);
|
1797
|
-
}, d) : E(J, N, m);
|
1798
|
-
}
|
1799
|
-
function E(y, l, d) {
|
1800
|
-
const { toastId: m } = l;
|
1801
|
-
d && s.delete(d);
|
1802
|
-
const g = { content: y, props: l };
|
1803
|
-
s.set(m, g), r((w) => [...w, m].filter((A) => A !== d)), L$1.emit(4, ot(g, g.props.updateId == null ? "added" : "updated"));
|
1804
|
-
}
|
1805
|
-
return 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), () => {
|
1806
|
-
s.clear(), L$1.emit(3, a);
|
1807
|
-
}), []), useEffect(() => {
|
1808
|
-
a.props = e, a.isToastActive = i, a.displayedToast = n.length;
|
1809
|
-
}), { getToastToRender: function(y) {
|
1810
|
-
const l = /* @__PURE__ */ new Map(), d = Array.from(s.values());
|
1811
|
-
return e.newestOnTop && d.reverse(), d.forEach((m) => {
|
1812
|
-
const { position: g } = m.props;
|
1813
|
-
l.has(g) || l.set(g, []), l.get(g).push(m);
|
1814
|
-
}), Array.from(l, (m) => y(m[0], m[1]));
|
1815
|
-
}, containerRef: o, isToastActive: i };
|
1816
|
-
}
|
1817
|
-
function it(e) {
|
1818
|
-
return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientX : e.clientX;
|
1819
|
-
}
|
1820
|
-
function at(e) {
|
1821
|
-
return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientY : e.clientY;
|
1822
|
-
}
|
1823
|
-
function fr(e) {
|
1824
|
-
const [t, n] = useState(!1), [r, o] = useState(!1), s = useRef(null), i = useRef({ start: 0, x: 0, y: 0, delta: 0, removalDistance: 0, canCloseOnClick: !0, canDrag: !1, boundingRect: null, didMove: !1 }).current, a = useRef(e), { autoClose: h, pauseOnHover: p, closeToast: f, onClick: u, closeOnClick: E } = e;
|
1825
|
-
function y(T) {
|
1826
|
-
if (e.draggable) {
|
1827
|
-
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);
|
1828
|
-
const O = s.current;
|
1829
|
-
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));
|
1830
|
-
}
|
1831
|
-
}
|
1832
|
-
function l(T) {
|
1833
|
-
if (i.boundingRect) {
|
1834
|
-
const { top: O, bottom: U, left: $, right: N } = i.boundingRect;
|
1835
|
-
T.nativeEvent.type !== "touchend" && e.pauseOnHover && i.x >= $ && i.x <= N && i.y >= O && i.y <= U ? m() : d();
|
1836
|
-
}
|
1837
|
-
}
|
1838
|
-
function d() {
|
1839
|
-
n(!0);
|
1840
|
-
}
|
1841
|
-
function m() {
|
1842
|
-
n(!1);
|
1843
|
-
}
|
1844
|
-
function g(T) {
|
1845
|
-
const O = s.current;
|
1846
|
-
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)));
|
1847
|
-
}
|
1848
|
-
function w() {
|
1849
|
-
document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", w), document.removeEventListener("touchmove", g), document.removeEventListener("touchend", w);
|
1850
|
-
const T = s.current;
|
1851
|
-
if (i.canDrag && i.didMove && T) {
|
1852
|
-
if (i.canDrag = !1, Math.abs(i.delta) > i.removalDistance)
|
1853
|
-
return o(!0), void e.closeToast();
|
1854
|
-
T.style.transition = "transform 0.2s, opacity 0.2s", T.style.transform = `translate${e.draggableDirection}(0)`, T.style.opacity = "1";
|
1855
|
-
}
|
1856
|
-
}
|
1857
|
-
useEffect(() => {
|
1858
|
-
a.current = e;
|
1859
|
-
}), useEffect(() => (s.current && s.current.addEventListener("d", d, { once: !0 }), x(e.onOpen) && e.onOpen(isValidElement(e.children) && e.children.props), () => {
|
1860
|
-
const T = a.current;
|
1861
|
-
x(T.onClose) && T.onClose(isValidElement(T.children) && T.children.props);
|
1862
|
-
}), []), useEffect(() => (e.pauseOnFocusLoss && (document.hasFocus() || m(), window.addEventListener("focus", d), window.addEventListener("blur", m)), () => {
|
1863
|
-
e.pauseOnFocusLoss && (window.removeEventListener("focus", d), window.removeEventListener("blur", m));
|
1864
|
-
}), [e.pauseOnFocusLoss]);
|
1865
|
-
const A = { onMouseDown: y, onTouchStart: y, onMouseUp: l, onTouchEnd: l };
|
1866
|
-
return h && p && (A.onMouseEnter = m, A.onMouseLeave = d), E && (A.onClick = (T) => {
|
1867
|
-
u && u(T), i.canCloseOnClick && f();
|
1868
|
-
}), { playToast: d, pauseToast: m, isRunning: t, preventExitTransition: r, toastRef: s, eventHandlers: A };
|
1869
|
-
}
|
1870
|
-
function Ft(e) {
|
1871
|
-
let { closeToast: t, theme: n, ariaLabel: r = "close" } = e;
|
1872
|
-
return React.createElement("button", { className: `Toastify__close-button Toastify__close-button--${n}`, type: "button", onClick: (o) => {
|
1873
|
-
o.stopPropagation(), t(o);
|
1874
|
-
}, "aria-label": r }, React.createElement("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, React.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" })));
|
1875
|
-
}
|
1876
|
-
function pr(e) {
|
1877
|
-
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;
|
1878
|
-
const y = s || h && p === 0, l = { ...a, animationDuration: `${t}ms`, animationPlayState: n ? "running" : "paused", opacity: y ? 0 : 1 };
|
1879
|
-
h && (l.transform = `scaleX(${p})`);
|
1880
|
-
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);
|
1881
|
-
return React.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 : () => {
|
1882
|
-
u && r();
|
1883
|
-
} });
|
1884
|
-
}
|
1885
|
-
const hr = (e) => {
|
1886
|
-
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: _ };
|
1887
|
-
let ue = null;
|
1888
|
-
return s === !1 || (ue = x(s) ? s(V) : isValidElement(s) ? cloneElement(s, V) : Ft(V)), React.createElement(E, { isIn: Y, done: z, position: y, preventExitTransition: n, nodeRef: r }, React.createElement("div", { id: N, onClick: h, className: P, ...o, style: d, ref: r }, React.createElement("div", { ...Y && { role: O }, className: x(m) ? m({ type: p }) : H$1("Toastify__toast-body", m), style: g }, v != null && React.createElement("div", { className: H$1("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter": !J }) }, v), React.createElement("div", null, i)), ue, React.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 })));
|
1889
|
-
}, Ae = function(e, t) {
|
1890
|
-
return t === void 0 && (t = !1), { enter: `Toastify--animate Toastify__${e}-enter`, exit: `Toastify--animate Toastify__${e}-exit`, appendPosition: t };
|
1891
|
-
}, mr = Se(Ae("bounce", !0));
|
1892
|
-
Se(Ae("slide", !0));
|
1893
|
-
Se(Ae("zoom"));
|
1894
|
-
Se(Ae("flip"));
|
1895
|
-
const ct = forwardRef((e, t) => {
|
1896
|
-
const { getToastToRender: n, containerRef: r, isToastActive: o } = dr(e), { className: s, style: i, rtl: a, containerId: h } = e;
|
1897
|
-
function p(f) {
|
1898
|
-
const u = H$1("Toastify__toast-container", `Toastify__toast-container--${f}`, { "Toastify__toast-container--rtl": a });
|
1899
|
-
return x(s) ? s({ position: f, rtl: a, defaultClassName: u }) : H$1(u, me(s));
|
1900
|
-
}
|
1901
|
-
return useEffect(() => {
|
1902
|
-
t && (t.current = r.current);
|
1903
|
-
}, []), React.createElement("div", { ref: r, className: "Toastify", id: h }, n((f, u) => {
|
1904
|
-
const E = u.length ? { ...i } : { ...i, pointerEvents: "none" };
|
1905
|
-
return React.createElement("div", { className: p(f), style: E, key: `container-${f}` }, u.map((y, l) => {
|
1906
|
-
let { content: d, props: m } = y;
|
1907
|
-
return React.createElement(hr, { ...m, isIn: o(m.toastId), style: { ...m.style, "--nth": l + 1, "--len": u.length }, key: `toast-${m.key}` }, d);
|
1908
|
-
}));
|
1909
|
-
}));
|
1910
|
-
});
|
1911
|
-
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" };
|
1912
|
-
let Le, K = /* @__PURE__ */ new Map(), re = [], yr = 1;
|
1913
|
-
function kt() {
|
1914
|
-
return "" + yr++;
|
1915
|
-
}
|
1916
|
-
function gr(e) {
|
1917
|
-
return e && (G(e.toastId) || se(e.toastId)) ? e.toastId : kt();
|
1918
|
-
}
|
1919
|
-
function oe(e, t) {
|
1920
|
-
return K.size > 0 ? L$1.emit(0, e, t) : re.push({ content: e, options: t }), t.toastId;
|
1921
|
-
}
|
1922
|
-
function ge(e, t) {
|
1923
|
-
return { ...t, type: t && t.type || e, toastId: gr(t) };
|
1924
|
-
}
|
1925
|
-
function de(e) {
|
1926
|
-
return (t, n) => oe(t, ge(e, n));
|
1927
|
-
}
|
1928
|
-
function S$1(e, t) {
|
1929
|
-
return oe(e, ge("default", t));
|
1930
|
-
}
|
1931
|
-
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) {
|
1932
|
-
let r, { pending: o, error: s, success: i } = t;
|
1933
|
-
o && (r = G(o) ? S$1.loading(o, n) : S$1.loading(o.render, { ...n, ...o }));
|
1934
|
-
const a = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, h = (f, u, E) => {
|
1935
|
-
if (u == null)
|
1936
|
-
return void S$1.dismiss(r);
|
1937
|
-
const y = { type: f, ...a, ...n, data: E }, l = G(u) ? { render: u } : u;
|
1938
|
-
return r ? S$1.update(r, { ...y, ...l }) : S$1(l.render, { ...y, ...l }), E;
|
1939
|
-
}, p = x(e) ? e() : e;
|
1940
|
-
return p.then((f) => h("success", i, f)).catch((f) => h("error", s, f)), p;
|
1941
|
-
}, 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) => {
|
1942
|
-
K.size > 0 ? L$1.emit(1, e) : re = re.filter((t) => e != null && t.options.toastId !== e);
|
1943
|
-
}, S$1.clearWaitingQueue = function(e) {
|
1944
|
-
return e === void 0 && (e = {}), L$1.emit(5, e);
|
1945
|
-
}, S$1.isActive = (e) => {
|
1946
|
-
let t = !1;
|
1947
|
-
return K.forEach((n) => {
|
1948
|
-
n.isToastActive && n.isToastActive(e) && (t = !0);
|
1949
|
-
}), t;
|
1950
|
-
}, S$1.update = function(e, t) {
|
1951
|
-
t === void 0 && (t = {}), setTimeout(() => {
|
1952
|
-
const n = function(r, o) {
|
1953
|
-
let { containerId: s } = o;
|
1954
|
-
const i = K.get(s || Le);
|
1955
|
-
return i && i.getToast(r);
|
1956
|
-
}(e, t);
|
1957
|
-
if (n) {
|
1958
|
-
const { props: r, content: o } = n, s = { delay: 100, ...r, ...t, toastId: t.toastId || e, updateId: kt() };
|
1959
|
-
s.toastId !== e && (s.staleId = e);
|
1960
|
-
const i = s.render || o;
|
1961
|
-
delete s.render, oe(i, s);
|
1127
|
+
ownKeys.forEach(function(key) {
|
1128
|
+
_define_property(target, key, source[key]);
|
1129
|
+
});
|
1962
1130
|
}
|
1963
|
-
|
1964
|
-
}
|
1965
|
-
|
1966
|
-
|
1967
|
-
|
1968
|
-
|
1969
|
-
|
1970
|
-
|
1971
|
-
|
1972
|
-
|
1973
|
-
|
1974
|
-
|
1975
|
-
|
1976
|
-
|
1977
|
-
|
1978
|
-
|
1979
|
-
|
1980
|
-
|
1981
|
-
|
1982
|
-
|
1131
|
+
return target;
|
1132
|
+
}
|
1133
|
+
function _to_consumable_array(arr) {
|
1134
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
1135
|
+
}
|
1136
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
1137
|
+
if (!o) return;
|
1138
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
1139
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
1140
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
1141
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
1142
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
1143
|
+
}
|
1144
|
+
var defaultOptions = {
|
1145
|
+
showSuccessMsg: true,
|
1146
|
+
showErrorMsg: true,
|
1147
|
+
successMsg: undefined,
|
1148
|
+
errorMsg: undefined,
|
1149
|
+
onSuccess: undefined,
|
1150
|
+
onError: undefined,
|
1151
|
+
processInput: undefined
|
1983
1152
|
};
|
1984
|
-
function
|
1985
|
-
|
1986
|
-
|
1987
|
-
|
1988
|
-
|
1989
|
-
|
1990
|
-
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
|
1995
|
-
|
1996
|
-
|
1997
|
-
|
1998
|
-
|
1153
|
+
function useMutate(mutation, options) {
|
1154
|
+
var mergedOptions = _object_spread({}, defaultOptions, options !== null && options !== void 0 ? options : {});
|
1155
|
+
var mutate = React.useCallback(function(values) {
|
1156
|
+
mutation.reset();
|
1157
|
+
var _runIfFn;
|
1158
|
+
// Return the mutation so that Formik can update submitting state
|
1159
|
+
return mutation.mutateAsync((_runIfFn = runIfFn(mergedOptions.processInput, values)) !== null && _runIfFn !== void 0 ? _runIfFn : values).then(function(result) {
|
1160
|
+
var _mergedOptions_onSuccess;
|
1161
|
+
if (mergedOptions.showSuccessMsg && mergedOptions.successMsg) Q$1.success(runIfFn(mergedOptions.successMsg, result, values));
|
1162
|
+
(_mergedOptions_onSuccess = mergedOptions.onSuccess) === null || _mergedOptions_onSuccess === void 0 ? void 0 : _mergedOptions_onSuccess.call(mergedOptions, result);
|
1163
|
+
return result;
|
1164
|
+
}).catch(function(error) {
|
1165
|
+
var _mergedOptions_onError;
|
1166
|
+
if (mergedOptions.showErrorMsg) {
|
1167
|
+
var _runIfFn;
|
1168
|
+
Q$1.error((_runIfFn = runIfFn(mergedOptions.errorMsg, error, values)) !== null && _runIfFn !== void 0 ? _runIfFn : "Oops, something went wrong :(");
|
1169
|
+
}
|
1170
|
+
(_mergedOptions_onError = mergedOptions.onError) === null || _mergedOptions_onError === void 0 ? void 0 : _mergedOptions_onError.call(mergedOptions, error);
|
1171
|
+
});
|
1172
|
+
}, [
|
1173
|
+
mutation,
|
1174
|
+
options
|
1175
|
+
]);
|
1176
|
+
return mutate;
|
1177
|
+
}
|
1178
|
+
function isFunction(value) {
|
1179
|
+
return typeof value === "function";
|
1180
|
+
}
|
1181
|
+
function runIfFn(valueOrFn) {
|
1182
|
+
for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
1183
|
+
args[_key - 1] = arguments[_key];
|
1184
|
+
}
|
1185
|
+
return isFunction(valueOrFn) ? valueOrFn.apply(void 0, _to_consumable_array(args)) : valueOrFn;
|
1999
1186
|
}
|
2000
1187
|
|
2001
1188
|
function InvalidateButton(_a) {
|
@@ -2004,8 +1191,8 @@ function InvalidateButton(_a) {
|
|
2004
1191
|
} = _a,
|
2005
1192
|
props = __rest(_a, ["pathOrPermalink"]);
|
2006
1193
|
const api = INVALIDATE_API.new(pathOrPermalink);
|
2007
|
-
const mutation =
|
2008
|
-
const invalidate =
|
1194
|
+
const mutation = useApiMutation(api.invalidate, api.queryKey);
|
1195
|
+
const invalidate = useMutate(mutation, {
|
2009
1196
|
successMsg: "Page successfully invalidated"
|
2010
1197
|
});
|
2011
1198
|
return jsx(Button, Object.assign({
|
@@ -2060,7 +1247,7 @@ function PublishButton(_a) {
|
|
2060
1247
|
} = _a,
|
2061
1248
|
props = __rest(_a, ["status", "queryId", "api"]);
|
2062
1249
|
const isDraft = status == "draft";
|
2063
|
-
const mutation =
|
1250
|
+
const mutation = useInvalidateMutation(isDraft ? api.publish : api.unpublish, api.queryKey, queryId, {
|
2064
1251
|
networkMode: "always"
|
2065
1252
|
});
|
2066
1253
|
const publish = React.useCallback(() => {
|
@@ -2530,8 +1717,8 @@ function OrderCell({
|
|
2530
1717
|
postId,
|
2531
1718
|
order
|
2532
1719
|
}) {
|
2533
|
-
const mutationDown =
|
2534
|
-
const mutationUp =
|
1720
|
+
const mutationDown = useInvalidateMutation(api.moveDown, api.queryKey);
|
1721
|
+
const mutationUp = useInvalidateMutation(api.moveUp, api.queryKey);
|
2535
1722
|
const moveDown = React.useCallback(e => {
|
2536
1723
|
e.stopPropagation();
|
2537
1724
|
mutationDown.mutateAsync(postId).catch(error => {
|
@@ -2615,25 +1802,28 @@ function PageQueryStateContainerInner(_a) {
|
|
2615
1802
|
var {
|
2616
1803
|
queryId,
|
2617
1804
|
api,
|
1805
|
+
apiFn,
|
1806
|
+
loadingStyles,
|
1807
|
+
errorStyles,
|
2618
1808
|
children
|
2619
1809
|
} = _a,
|
2620
|
-
props = __rest(_a, ["queryId", "api", "children"]);
|
1810
|
+
props = __rest(_a, ["queryId", "api", "apiFn", "loadingStyles", "errorStyles", "children"]);
|
2621
1811
|
const {
|
2622
1812
|
data,
|
2623
1813
|
isLoading,
|
2624
1814
|
isError
|
2625
|
-
} =
|
2626
|
-
const invalidate =
|
2627
|
-
if (isLoading) return jsx(QueryLoadingState, {
|
1815
|
+
} = apiFn == "get" ? useApiQuery(api.queryKey, api.get, queryId) : useApiQuery(api.queryKey, api.getAll);
|
1816
|
+
const invalidate = useInvalidateQuery(api.queryKey, queryId);
|
1817
|
+
if (isLoading) return jsx(QueryLoadingState, Object.assign({
|
2628
1818
|
w: "full",
|
2629
1819
|
h: "100%"
|
2630
|
-
});
|
2631
|
-
if (isError) return jsx(RetryOnError, {
|
1820
|
+
}, loadingStyles));
|
1821
|
+
if (isError) return jsx(RetryOnError, Object.assign({
|
2632
1822
|
p: "0",
|
2633
1823
|
onClick: invalidate
|
2634
|
-
});
|
1824
|
+
}, errorStyles));
|
2635
1825
|
return jsx(PageContainer, Object.assign({}, props, {
|
2636
|
-
children: children(data)
|
1826
|
+
children: apiFn == "get" ? children(data) : children(data)
|
2637
1827
|
}));
|
2638
1828
|
}
|
2639
1829
|
const PageQueryStateContainer = /*#__PURE__*/React.forwardRef(PageQueryStateContainerInner);
|
@@ -2907,11 +2097,11 @@ function Internal({
|
|
2907
2097
|
editor,
|
2908
2098
|
type,
|
2909
2099
|
invalidateParentQueryKey
|
2910
|
-
} = runIfFn(screen, item);
|
2911
|
-
const mutation =
|
2100
|
+
} = runIfFn$1(screen, item);
|
2101
|
+
const mutation = useInvalidateParentMutation(api.update, invalidateParentQueryKey !== null && invalidateParentQueryKey !== void 0 ? invalidateParentQueryKey : api.queryKey, {
|
2912
2102
|
networkMode: "always"
|
2913
2103
|
});
|
2914
|
-
const save =
|
2104
|
+
const save = useMutate(mutation, {
|
2915
2105
|
processInput,
|
2916
2106
|
successMsg: item => `${item.title} updated.`,
|
2917
2107
|
errorMsg: (error, item) => `Error updating ${item.title}: ${error}`
|
@@ -2919,7 +2109,7 @@ function Internal({
|
|
2919
2109
|
let editorMaxW = undefined;
|
2920
2110
|
if (type == "post") editorMaxW = "calc(1280px - 30rem)";else if (type == "section") editorMaxW = "calc(1280px - 22rem)";
|
2921
2111
|
return jsxs(FormProvider, {
|
2922
|
-
initialValues: runIfFn(initialValues, item),
|
2112
|
+
initialValues: runIfFn$1(initialValues, item),
|
2923
2113
|
validationSchema: schema,
|
2924
2114
|
onSubmit: save,
|
2925
2115
|
enableReinitialize: true,
|
@@ -2976,11 +2166,11 @@ function Section({
|
|
2976
2166
|
return jsx(PageSidebarSection, {
|
2977
2167
|
title: section.title,
|
2978
2168
|
children: jsx(FormRenderer, {
|
2979
|
-
form: runIfFn(section.form, item)
|
2169
|
+
form: runIfFn$1(section.form, item)
|
2980
2170
|
})
|
2981
2171
|
});
|
2982
2172
|
}
|
2983
|
-
if (section.type === "custom") return runIfFn(section.component, item);
|
2173
|
+
if (section.type === "custom") return runIfFn$1(section.component, item);
|
2984
2174
|
return null;
|
2985
2175
|
}
|
2986
2176
|
|
@@ -2995,7 +2185,7 @@ function useApi(api, queryField) {
|
|
2995
2185
|
} = params;
|
2996
2186
|
return {
|
2997
2187
|
id,
|
2998
|
-
api: runIfFn(api, id)
|
2188
|
+
api: runIfFn$1(api, id)
|
2999
2189
|
};
|
3000
2190
|
}
|
3001
2191
|
function QueryWrapper(_a) {
|
@@ -3014,7 +2204,7 @@ function QueryWrapper(_a) {
|
|
3014
2204
|
} = useApi(api, queryField);
|
3015
2205
|
const {
|
3016
2206
|
data
|
3017
|
-
} =
|
2207
|
+
} = useApiQuery(mApi.queryKey, fn === "get" || fn === "getTransformed" ? mApi.get : mApi.getAll, isFunction$1(api) ? undefined : id);
|
3018
2208
|
const transformedData = React.useMemo(() => {
|
3019
2209
|
if (data && (fn === "getTransformed" || fn === "getAllTransformed")) {
|
3020
2210
|
if (!transformFn) console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${fn}`);
|
@@ -3048,7 +2238,7 @@ function TabbedView(_a) {
|
|
3048
2238
|
const {
|
3049
2239
|
breadcrumbs,
|
3050
2240
|
tabs
|
3051
|
-
} = runIfFn(screen, city);
|
2241
|
+
} = runIfFn$1(screen, city);
|
3052
2242
|
return jsxs(PageTabbedTopBarProvider, {
|
3053
2243
|
children: [jsx(PageTabbedTopBar, {
|
3054
2244
|
breadcrumbs: breadcrumbs,
|
@@ -3220,7 +2410,7 @@ function TableTopBar(_a) {
|
|
3220
2410
|
children
|
3221
2411
|
} = _a,
|
3222
2412
|
props = __rest(_a, ["title", "queryKey", "children"]);
|
3223
|
-
const invalidate =
|
2413
|
+
const invalidate = useInvalidateQuery(queryKey);
|
3224
2414
|
useHotkeys('ctrl+r', () => invalidate(), {
|
3225
2415
|
preventDefault: true
|
3226
2416
|
}, [invalidate]);
|
@@ -3308,13 +2498,13 @@ function ItemEditDialog$1(_a) {
|
|
3308
2498
|
isError,
|
3309
2499
|
error /*, error*/,
|
3310
2500
|
refetch
|
3311
|
-
} =
|
2501
|
+
} = useApiQuery(api.queryKey, api.get, queryId, Object.assign({
|
3312
2502
|
enabled: !( /*queryId == 0 || */queryId == "" || queryId == null || queryId == undefined),
|
3313
2503
|
onError: onFetchError
|
3314
2504
|
}, queryFetchOptions));
|
3315
2505
|
// const [activeTab, setActiveTab] = React.useState(form && Array.isArray(form) ? form[0].key : "");
|
3316
2506
|
// const [showTab, setShowTab] = React.useState(true);
|
3317
|
-
const mutation = invalidateQueriesOnSuccess ?
|
2507
|
+
const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(api.upsert, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, querySaveOptions) : useApiMutation(api.upsert, api.queryKey, queryId, querySaveOptions);
|
3318
2508
|
const retry = React.useCallback(() => refetch(), [refetch]);
|
3319
2509
|
const saveItem = React.useCallback((item, actions) => __awaiter(this, void 0, void 0, function* () {
|
3320
2510
|
// Clear mutation error if any
|
@@ -3388,7 +2578,7 @@ function ItemEditDialog$1(_a) {
|
|
3388
2578
|
children: jsxs(Form, {
|
3389
2579
|
children: [/*#__PURE__*/React.isValidElement(form) && form, Array.isArray(form) && jsx(FormRenderer, {
|
3390
2580
|
form: form
|
3391
|
-
}), isFunction(form) && jsx(FormRenderer, {
|
2581
|
+
}), isFunction$1(form) && jsx(FormRenderer, {
|
3392
2582
|
form: form(data !== null && data !== void 0 ? data : values)
|
3393
2583
|
})]
|
3394
2584
|
})
|
@@ -3427,7 +2617,7 @@ function QueryWrapperDialog({
|
|
3427
2617
|
const {
|
3428
2618
|
data,
|
3429
2619
|
isFetching
|
3430
|
-
} =
|
2620
|
+
} = useApiQuery(api.queryKey, fn === "get" || fn === "getTransformed" ? api.get : api.getAll, undefined, {
|
3431
2621
|
retryOnMount: false,
|
3432
2622
|
refetchOnMount: false,
|
3433
2623
|
refetchOnWindowFocus: false
|
@@ -3461,7 +2651,7 @@ function MultiQueryWrapperDialog({
|
|
3461
2651
|
data,
|
3462
2652
|
isFetching,
|
3463
2653
|
isError
|
3464
|
-
} =
|
2654
|
+
} = useApiQueries(queries.map(q => ({
|
3465
2655
|
queryKey: q.api.queryKey,
|
3466
2656
|
queryFn: q.fn == "get" ? q.api.get : q.api.getAll,
|
3467
2657
|
queryOptions: {
|
@@ -3528,8 +2718,8 @@ function ItemDeleteDialog(_a) {
|
|
3528
2718
|
onClose
|
3529
2719
|
} = _a,
|
3530
2720
|
props = __rest(_a, ["itemLabel", "queryId", "api", "invalidateQueriesOnSuccess", "invalidateQueryKey", "size", "show", "onClose"]);
|
3531
|
-
const mutation = invalidateQueriesOnSuccess ?
|
3532
|
-
const mutate =
|
2721
|
+
const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(api.delete, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey) : useApiMutation(api.upsert, api.queryKey);
|
2722
|
+
const mutate = useMutate(mutation, {
|
3533
2723
|
onSuccess: () => onClose === null || onClose === void 0 ? void 0 : onClose()
|
3534
2724
|
});
|
3535
2725
|
const handleDelete = React.useCallback(() => mutate(queryId), [mutate, queryId]);
|
@@ -3582,12 +2772,12 @@ function TableViewProvider({
|
|
3582
2772
|
switch (action.type) {
|
3583
2773
|
case "view":
|
3584
2774
|
{
|
3585
|
-
navigate(runIfFn(action.path, item));
|
2775
|
+
navigate(runIfFn$1(action.path, item));
|
3586
2776
|
break;
|
3587
2777
|
}
|
3588
2778
|
case "link":
|
3589
2779
|
{
|
3590
|
-
openLink(`${process.env["NEXT_PUBLIC_WEBSITE_URL"]}/${runIfFn(action.path, item)}`);
|
2780
|
+
openLink(`${process.env["NEXT_PUBLIC_WEBSITE_URL"]}/${runIfFn$1(action.path, item)}`);
|
3591
2781
|
break;
|
3592
2782
|
}
|
3593
2783
|
case "edit":
|
@@ -3615,7 +2805,7 @@ function TableViewProvider({
|
|
3615
2805
|
queryId: item.id,
|
3616
2806
|
invalidateQueryKey: queryKey
|
3617
2807
|
}, deleteItem, {
|
3618
|
-
itemLabel: runIfFn(deleteItem.itemLabel, item)
|
2808
|
+
itemLabel: runIfFn$1(deleteItem.itemLabel, item)
|
3619
2809
|
})));
|
3620
2810
|
// TODO
|
3621
2811
|
// const { initialValues, ...props } = editItem!!
|
@@ -3711,7 +2901,7 @@ function TableRowPublishPostButton$1(_a) {
|
|
3711
2901
|
} = _a,
|
3712
2902
|
props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
3713
2903
|
const isDraft = status == "draft";
|
3714
|
-
const mutation =
|
2904
|
+
const mutation = useInvalidateParentMutation(isDraft ? api.publish : api.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, {
|
3715
2905
|
networkMode: "always"
|
3716
2906
|
});
|
3717
2907
|
const publish = React.useCallback(event => {
|
@@ -3811,7 +3001,7 @@ function useTableProps(api, table, rowActions) {
|
|
3811
3001
|
} = table,
|
3812
3002
|
props = __rest(table, ["onRowClick", "columns"]);
|
3813
3003
|
const onRowClickHandler = React.useCallback(item => {
|
3814
|
-
if ((onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick.type) === "navigate") navigate(runIfFn(onRowClick.path, item));else if ((onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick.type) == "link") openLink(`${process.env["NEXT_PUBLIC_WEBSITE_URL"]}/${runIfFn(onRowClick.path, item)}`);
|
3004
|
+
if ((onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick.type) === "navigate") navigate(runIfFn$1(onRowClick.path, item));else if ((onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick.type) == "link") openLink(`${process.env["NEXT_PUBLIC_WEBSITE_URL"]}/${runIfFn$1(onRowClick.path, item)}`);
|
3815
3005
|
}, [navigate, onRowClick]);
|
3816
3006
|
const columns = React.useMemo(() => {
|
3817
3007
|
const columns = table.columns.concat([]);
|
@@ -4206,8 +3396,8 @@ function ActionButton({
|
|
4206
3396
|
errorMsg,
|
4207
3397
|
invalidateParent
|
4208
3398
|
}) {
|
4209
|
-
const mutation = invalidateParent ?
|
4210
|
-
const mutate =
|
3399
|
+
const mutation = invalidateParent ? useInvalidateParentMutation(queryFn, queryKey) : useApiMutation(queryFn, queryKey);
|
3400
|
+
const mutate = useMutate(mutation, {
|
4211
3401
|
successMsg,
|
4212
3402
|
errorMsg
|
4213
3403
|
});
|
@@ -4272,7 +3462,7 @@ function TableView(_a) {
|
|
4272
3462
|
} = _a,
|
4273
3463
|
props = __rest(_a, ["queryField", "title", "subtitle", "screen"]);
|
4274
3464
|
const id = useId(queryField);
|
4275
|
-
const _screen = runIfFn(screen, id);
|
3465
|
+
const _screen = runIfFn$1(screen, id);
|
4276
3466
|
return jsx(PageContainer, Object.assign({
|
4277
3467
|
p: "5"
|
4278
3468
|
}, props, {
|
@@ -4309,7 +3499,7 @@ function TT({
|
|
4309
3499
|
deleteItem,
|
4310
3500
|
breadcrumbs
|
4311
3501
|
} = screen;
|
4312
|
-
const tableApi = runIfFn(api, id !== null && id !== void 0 ? id : "");
|
3502
|
+
const tableApi = runIfFn$1(api, id !== null && id !== void 0 ? id : "");
|
4313
3503
|
return jsxs(Fragment, {
|
4314
3504
|
children: [breadcrumbs && jsx(PageTopBar, {
|
4315
3505
|
breadcrumbs: breadcrumbs
|
@@ -4385,7 +3575,7 @@ function TableWrapper({
|
|
4385
3575
|
textSize: "lg",
|
4386
3576
|
textColor: "#475569",
|
4387
3577
|
fontWeight: "600",
|
4388
|
-
children: isFunction(subtitle) ? subtitle(data) : subtitle
|
3578
|
+
children: isFunction$1(subtitle) ? subtitle(data) : subtitle
|
4389
3579
|
});
|
4390
3580
|
};
|
4391
3581
|
}, [subtitle]);
|
@@ -4406,8 +3596,8 @@ function useQueries(queries) {
|
|
4406
3596
|
data,
|
4407
3597
|
isFetching,
|
4408
3598
|
isError
|
4409
|
-
} =
|
4410
|
-
if (!q.queryField || !isFunction(q.api)) {
|
3599
|
+
} = useApiQueries(queries.map(q => {
|
3600
|
+
if (!q.queryField || !isFunction$1(q.api)) {
|
4411
3601
|
const _api = q.api;
|
4412
3602
|
return {
|
4413
3603
|
queryKey: _api.queryKey,
|
@@ -4416,11 +3606,11 @@ function useQueries(queries) {
|
|
4416
3606
|
};
|
4417
3607
|
}
|
4418
3608
|
const id = params[q.queryField];
|
4419
|
-
const api = runIfFn(q.api, id);
|
3609
|
+
const api = runIfFn$1(q.api, id);
|
4420
3610
|
return {
|
4421
3611
|
queryKey: api.queryKey,
|
4422
3612
|
queryFn: q.fn == "get" ? api.get : api.getAll,
|
4423
|
-
queryParam: q.fn == "getAll" ? q.params : isFunction(q.api) ? undefined : id
|
3613
|
+
queryParam: q.fn == "getAll" ? q.params : isFunction$1(q.api) ? undefined : id
|
4424
3614
|
};
|
4425
3615
|
}));
|
4426
3616
|
let transformedData = undefined;
|
@@ -4442,11 +3632,11 @@ function useInvalidate(queries) {
|
|
4442
3632
|
const invalidate = React.useCallback(() => {
|
4443
3633
|
const queryKeys = [];
|
4444
3634
|
queries.forEach(q => {
|
4445
|
-
if (!q.queryField || !isFunction(q.api)) {
|
3635
|
+
if (!q.queryField || !isFunction$1(q.api)) {
|
4446
3636
|
queryKeys.push(q.api.queryKey);
|
4447
3637
|
} else {
|
4448
3638
|
const id = params[q.queryField];
|
4449
|
-
const api = runIfFn(q.api, id);
|
3639
|
+
const api = runIfFn$1(q.api, id);
|
4450
3640
|
queryKeys.push(api.queryKey);
|
4451
3641
|
}
|
4452
3642
|
});
|
@@ -4539,18 +3729,18 @@ function AttachDialog(_a) {
|
|
4539
3729
|
isError: fetchError,
|
4540
3730
|
refetch,
|
4541
3731
|
error
|
4542
|
-
} =
|
3732
|
+
} = useApiQuery(queryKey, queryFetchFn);
|
4543
3733
|
const {
|
4544
3734
|
data,
|
4545
3735
|
isInitialLoading: fetchAllLoading,
|
4546
3736
|
isError: fetchAllError,
|
4547
3737
|
refetch: refetchAll,
|
4548
3738
|
error: errorAll
|
4549
|
-
} =
|
3739
|
+
} = useApiQuery(queryFetchAllKey, queryFetchAllFn);
|
4550
3740
|
const [selectedResources, setSelectedResources] = React.useState([]);
|
4551
3741
|
const isLoading = fetchLoading || fetchAllLoading;
|
4552
3742
|
const isError = fetchError || fetchAllError;
|
4553
|
-
const mutation =
|
3743
|
+
const mutation = useApiMutation(querySaveFn, queryKey, queryId);
|
4554
3744
|
const handleClick = React.useCallback(event => {
|
4555
3745
|
var _a;
|
4556
3746
|
const id = (_a = event === null || event === void 0 ? void 0 : event.currentTarget.dataset.id) !== null && _a !== void 0 ? _a : "";
|
@@ -4703,8 +3893,8 @@ function FormActionDialog(_a) {
|
|
4703
3893
|
formikProps
|
4704
3894
|
} = _a,
|
4705
3895
|
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"]);
|
4706
|
-
const mutation = invalidateQueriesOnSuccess ?
|
4707
|
-
const mutate =
|
3896
|
+
const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(queryFn, queryKey, queryOptions) : useApiMutation(queryFn, queryKey, queryId, queryOptions);
|
3897
|
+
const mutate = useMutate(mutation, {
|
4708
3898
|
onSuccess,
|
4709
3899
|
successMsg,
|
4710
3900
|
showSuccessMsg,
|
@@ -4798,13 +3988,13 @@ function ItemEditDialog(_a) {
|
|
4798
3988
|
isError,
|
4799
3989
|
error /*, error*/,
|
4800
3990
|
refetch
|
4801
|
-
} =
|
3991
|
+
} = useApiQuery(queryKey, queryFetchFn, queryId, Object.assign({
|
4802
3992
|
enabled: !( /*queryId == 0 || */queryId == "" || queryId == null || queryId == undefined),
|
4803
3993
|
onError: onFetchError
|
4804
3994
|
}, queryFetchOptions));
|
4805
3995
|
// const [activeTab, setActiveTab] = React.useState(form && Array.isArray(form) ? form[0].key : "");
|
4806
3996
|
// const [showTab, setShowTab] = React.useState(true);
|
4807
|
-
const mutation = invalidateQueriesOnSuccess ?
|
3997
|
+
const mutation = invalidateQueriesOnSuccess ? useInvalidateParentMutation(querySaveFn, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : queryKey, querySaveOptions) : useApiMutation(querySaveFn, queryKey, queryId, querySaveOptions);
|
4808
3998
|
const retry = React.useCallback(() => refetch(), [refetch]);
|
4809
3999
|
const saveItem = React.useCallback((item, actions) => {
|
4810
4000
|
// Clear mutation error if any
|
@@ -4875,7 +4065,7 @@ function ItemEditDialog(_a) {
|
|
4875
4065
|
children: jsxs(Form, {
|
4876
4066
|
children: [/*#__PURE__*/React.isValidElement(form) && form, Array.isArray(form) && jsx(FormRenderer, {
|
4877
4067
|
form: form
|
4878
|
-
}), isFunction(form) && jsx(FormRenderer, {
|
4068
|
+
}), isFunction$1(form) && jsx(FormRenderer, {
|
4879
4069
|
form: form(data !== null && data !== void 0 ? data : values)
|
4880
4070
|
})]
|
4881
4071
|
})
|
@@ -5105,7 +4295,7 @@ function TableRowPublishPostButton(_a) {
|
|
5105
4295
|
} = _a,
|
5106
4296
|
props = __rest(_a, ["id", "api", "status", "invalidateQueryKey"]);
|
5107
4297
|
const isDraft = status == "draft";
|
5108
|
-
const mutation =
|
4298
|
+
const mutation = useInvalidateParentMutation(isDraft ? api.publish : api.unpublish, invalidateQueryKey !== null && invalidateQueryKey !== void 0 ? invalidateQueryKey : api.queryKey, {
|
5109
4299
|
networkMode: "always"
|
5110
4300
|
});
|
5111
4301
|
const publish = React.useCallback(event => {
|