@compill/admin 1.0.37 → 1.0.38
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 +230 -150
- package/index.esm.js +231 -150
- package/package.json +1 -1
- package/src/index.d.ts +0 -1
- package/src/lib/buttons/IconButton.d.ts +0 -5
package/index.esm.js
CHANGED
@@ -4,11 +4,12 @@ import Link from 'next/link';
|
|
4
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
6
|
import 'axios';
|
7
|
-
import 'react/jsx-runtime';
|
8
7
|
import { useQueryClient, useMutation, useQuery, useQueries as useQueries$1 } from '@tanstack/react-query';
|
9
8
|
import { useNavigate, useParams } from 'react-router-dom';
|
9
|
+
import { toast } from 'react-toastify';
|
10
10
|
import { SubmitButton, FormProvider, TextArea, FormRenderer, mergeInitialFormValues, FieldLabel } from '@compill/form';
|
11
11
|
import { useFormikContext, Formik, Form } from 'formik';
|
12
|
+
import 'react/jsx-runtime';
|
12
13
|
import { FlexCenter, QueryLoadingState, RetryOnError, TabContainer, ModalLoadingOverlay } from '@compill/components';
|
13
14
|
import { createContext as createContext$1, runIfFn as runIfFn$1, isFunction as isFunction$1 } from '@soperio/react';
|
14
15
|
import { FormEditor } from '@compill/form-extras';
|
@@ -150,22 +151,106 @@ function DialogButton(_a) {
|
|
150
151
|
});
|
151
152
|
}
|
152
153
|
|
153
|
-
function
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
154
|
+
/*! js-cookie v3.0.5 | MIT */ /* eslint-disable no-var */ function assign(target) {
|
155
|
+
for(var i = 1; i < arguments.length; i++){
|
156
|
+
var source = arguments[i];
|
157
|
+
for(var key in source){
|
158
|
+
target[key] = source[key];
|
159
|
+
}
|
160
|
+
}
|
161
|
+
return target;
|
162
|
+
}
|
163
|
+
/* eslint-enable no-var */ /* eslint-disable no-var */ var defaultConverter = {
|
164
|
+
read: function read(value) {
|
165
|
+
if (value[0] === '"') {
|
166
|
+
value = value.slice(1, -1);
|
167
|
+
}
|
168
|
+
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
169
|
+
},
|
170
|
+
write: function write(value) {
|
171
|
+
return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
|
172
|
+
}
|
173
|
+
};
|
174
|
+
/* eslint-enable no-var */ /* eslint-disable no-var */ function init(converter, defaultAttributes) {
|
175
|
+
function set(name, value, attributes) {
|
176
|
+
if (typeof document === "undefined") {
|
177
|
+
return;
|
178
|
+
}
|
179
|
+
attributes = assign({}, defaultAttributes, attributes);
|
180
|
+
if (typeof attributes.expires === "number") {
|
181
|
+
attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
182
|
+
}
|
183
|
+
if (attributes.expires) {
|
184
|
+
attributes.expires = attributes.expires.toUTCString();
|
185
|
+
}
|
186
|
+
name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
187
|
+
var stringifiedAttributes = "";
|
188
|
+
for(var attributeName in attributes){
|
189
|
+
if (!attributes[attributeName]) {
|
190
|
+
continue;
|
191
|
+
}
|
192
|
+
stringifiedAttributes += "; " + attributeName;
|
193
|
+
if (attributes[attributeName] === true) {
|
194
|
+
continue;
|
195
|
+
}
|
196
|
+
// Considers RFC 6265 section 5.2:
|
197
|
+
// ...
|
198
|
+
// 3. If the remaining unparsed-attributes contains a %x3B (";")
|
199
|
+
// character:
|
200
|
+
// Consume the characters of the unparsed-attributes up to,
|
201
|
+
// not including, the first %x3B (";") character.
|
202
|
+
// ...
|
203
|
+
stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
|
204
|
+
}
|
205
|
+
return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes;
|
206
|
+
}
|
207
|
+
function get(name) {
|
208
|
+
if (typeof document === "undefined" || arguments.length && !name) {
|
209
|
+
return;
|
210
|
+
}
|
211
|
+
// To prevent the for loop in the first place assign an empty array
|
212
|
+
// in case there are no cookies at all.
|
213
|
+
var cookies = document.cookie ? document.cookie.split("; ") : [];
|
214
|
+
var jar = {};
|
215
|
+
for(var i = 0; i < cookies.length; i++){
|
216
|
+
var parts = cookies[i].split("=");
|
217
|
+
var value = parts.slice(1).join("=");
|
218
|
+
try {
|
219
|
+
var found = decodeURIComponent(parts[0]);
|
220
|
+
jar[found] = converter.read(value, found);
|
221
|
+
if (name === found) {
|
222
|
+
break;
|
223
|
+
}
|
224
|
+
} catch (e) {}
|
225
|
+
}
|
226
|
+
return name ? jar[name] : jar;
|
227
|
+
}
|
228
|
+
return Object.create({
|
229
|
+
set: set,
|
230
|
+
get: get,
|
231
|
+
remove: function remove(name, attributes) {
|
232
|
+
set(name, "", assign({}, attributes, {
|
233
|
+
expires: -1
|
234
|
+
}));
|
235
|
+
},
|
236
|
+
withAttributes: function withAttributes(attributes) {
|
237
|
+
return init(this.converter, assign({}, this.attributes, attributes));
|
238
|
+
},
|
239
|
+
withConverter: function withConverter(converter) {
|
240
|
+
return init(assign({}, this.converter, converter), this.attributes);
|
241
|
+
}
|
242
|
+
}, {
|
243
|
+
attributes: {
|
244
|
+
value: Object.freeze(defaultAttributes)
|
245
|
+
},
|
246
|
+
converter: {
|
247
|
+
value: Object.freeze(converter)
|
248
|
+
}
|
249
|
+
});
|
168
250
|
}
|
251
|
+
init(defaultConverter, {
|
252
|
+
path: "/"
|
253
|
+
});
|
169
254
|
|
170
255
|
function useInvalidateQuery(queryKey, queryId) {
|
171
256
|
var queryClient = useQueryClient();
|
@@ -315,15 +400,15 @@ function useApiQueries(queries) {
|
|
315
400
|
};
|
316
401
|
}
|
317
402
|
|
318
|
-
function r
|
403
|
+
function r(e) {
|
319
404
|
var t, f, n = "";
|
320
405
|
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
|
406
|
+
else if ("object" == typeof e) if (Array.isArray(e)) for(t = 0; t < e.length; t++)e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
322
407
|
else for(t in e)e[t] && (n && (n += " "), n += t);
|
323
408
|
return n;
|
324
409
|
}
|
325
|
-
function clsx
|
326
|
-
for(var e, t, f = 0, n = ""; f < arguments.length;)(e = arguments[f++]) && (t = r
|
410
|
+
function clsx() {
|
411
|
+
for(var e, t, f = 0, n = ""; f < arguments.length;)(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
327
412
|
return n;
|
328
413
|
}
|
329
414
|
|
@@ -464,18 +549,18 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
464
549
|
if (n === "Map" || n === "Set") return Array.from(n);
|
465
550
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
|
466
551
|
}
|
467
|
-
var u
|
552
|
+
var u = function(t) {
|
468
553
|
return "number" == typeof t && !isNaN(t);
|
469
|
-
}, d
|
554
|
+
}, d = function(t) {
|
470
555
|
return "string" == typeof t;
|
471
|
-
}, p
|
556
|
+
}, p = function(t) {
|
472
557
|
return "function" == typeof t;
|
473
|
-
}, m
|
474
|
-
return d
|
475
|
-
}, f
|
476
|
-
return isValidElement(t) || d
|
558
|
+
}, m = function(t) {
|
559
|
+
return d(t) || p(t) ? t : null;
|
560
|
+
}, f = function(t) {
|
561
|
+
return isValidElement(t) || d(t) || p(t) || u(t);
|
477
562
|
};
|
478
|
-
function g
|
563
|
+
function g(t, e, n) {
|
479
564
|
void 0 === n && (n = 300);
|
480
565
|
var o = t.scrollHeight, s = t.style;
|
481
566
|
requestAnimationFrame(function() {
|
@@ -484,7 +569,7 @@ function g$1(t, e, n) {
|
|
484
569
|
});
|
485
570
|
});
|
486
571
|
}
|
487
|
-
function h
|
572
|
+
function h(e) {
|
488
573
|
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
574
|
return function(e) {
|
490
575
|
var u = e.children, d = e.position, p = e.preventExitTransition, m = e.done, f = e.nodeRef, _$h = e.isIn;
|
@@ -498,7 +583,7 @@ function h$1(e) {
|
|
498
583
|
(_t_classList = _$t.classList).add.apply(_t_classList, _to_consumable_array$1(_$e)), _$t.addEventListener("animationend", _$n), _$t.addEventListener("animationcancel", _$n);
|
499
584
|
}, []), useEffect(function() {
|
500
585
|
var _$t = f.current, _$e = function() {
|
501
|
-
_$t.removeEventListener("animationend", _$e), _$l ? g
|
586
|
+
_$t.removeEventListener("animationend", _$e), _$l ? g(_$t, m, c) : m();
|
502
587
|
};
|
503
588
|
_$h || (p ? _$e() : (T.current = 1, _$t.className += " ".concat(v), _$t.addEventListener("animationend", _$e)));
|
504
589
|
}, [
|
@@ -506,7 +591,7 @@ function h$1(e) {
|
|
506
591
|
]), React.createElement(React.Fragment, null, u);
|
507
592
|
};
|
508
593
|
}
|
509
|
-
function y
|
594
|
+
function y(t, e) {
|
510
595
|
return null != t ? {
|
511
596
|
content: t.content,
|
512
597
|
containerId: t.props.containerId,
|
@@ -519,7 +604,7 @@ function y$1(t, e) {
|
|
519
604
|
status: e
|
520
605
|
} : {};
|
521
606
|
}
|
522
|
-
var v
|
607
|
+
var v = {
|
523
608
|
list: new Map,
|
524
609
|
emitQueue: new Map,
|
525
610
|
on: function on(t, e) {
|
@@ -547,7 +632,7 @@ var v$1 = {
|
|
547
632
|
_this.emitQueue.has(t) || _this.emitQueue.set(t, []), _this.emitQueue.get(t).push(n);
|
548
633
|
});
|
549
634
|
}
|
550
|
-
}, T
|
635
|
+
}, T = function(e) {
|
551
636
|
var n = e.theme, o = e.type, s = _object_without_properties(e, [
|
552
637
|
"theme",
|
553
638
|
"type"
|
@@ -558,24 +643,24 @@ var v$1 = {
|
|
558
643
|
height: "100%",
|
559
644
|
fill: "colored" === n ? "currentColor" : "var(--toastify-icon-color-".concat(o, ")")
|
560
645
|
}, s));
|
561
|
-
}, E
|
646
|
+
}, E = {
|
562
647
|
info: function info(e) {
|
563
|
-
return React.createElement(T
|
648
|
+
return React.createElement(T, _object_spread$1({}, e), React.createElement("path", {
|
564
649
|
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
650
|
}));
|
566
651
|
},
|
567
652
|
warning: function warning(e) {
|
568
|
-
return React.createElement(T
|
653
|
+
return React.createElement(T, _object_spread$1({}, e), React.createElement("path", {
|
569
654
|
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
655
|
}));
|
571
656
|
},
|
572
657
|
success: function success(e) {
|
573
|
-
return React.createElement(T
|
658
|
+
return React.createElement(T, _object_spread$1({}, e), React.createElement("path", {
|
574
659
|
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
660
|
}));
|
576
661
|
},
|
577
662
|
error: function error(e) {
|
578
|
-
return React.createElement(T
|
663
|
+
return React.createElement(T, _object_spread$1({}, e), React.createElement("path", {
|
579
664
|
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
665
|
}));
|
581
666
|
},
|
@@ -585,7 +670,7 @@ var v$1 = {
|
|
585
670
|
});
|
586
671
|
}
|
587
672
|
};
|
588
|
-
function C
|
673
|
+
function C(t) {
|
589
674
|
var _r = _sliced_to_array(useReducer(function(t) {
|
590
675
|
return t + 1;
|
591
676
|
}, 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) {
|
@@ -623,7 +708,7 @@ function C$1(t) {
|
|
623
708
|
"delay",
|
624
709
|
"staleId"
|
625
710
|
]);
|
626
|
-
if (!f
|
711
|
+
if (!f(t) || function(t) {
|
627
712
|
return !g.current || C.props.enableMultiContainer && t.containerId !== C.props.containerId || _$h.has(t.toastId) && null == t.updateId;
|
628
713
|
}(_$i)) return;
|
629
714
|
var _$l = _$i.toastId, c = _$i.updateId, T = _$i.data, b = C.props, _$L = function() {
|
@@ -642,13 +727,13 @@ function C$1(t) {
|
|
642
727
|
data: T,
|
643
728
|
closeToast: _$L,
|
644
729
|
isIn: !1,
|
645
|
-
className: m
|
646
|
-
bodyClassName: m
|
647
|
-
progressClassName: m
|
648
|
-
autoClose: !_$i.isLoading && (R = _$i.autoClose, w = b.autoClose, !1 === R || u
|
730
|
+
className: m(_$i.className || b.toastClassName),
|
731
|
+
bodyClassName: m(_$i.bodyClassName || b.bodyClassName),
|
732
|
+
progressClassName: m(_$i.progressClassName || b.progressClassName),
|
733
|
+
autoClose: !_$i.isLoading && (R = _$i.autoClose, w = b.autoClose, !1 === R || u(R) && R > 0 ? R : w),
|
649
734
|
deleteToast: function deleteToast() {
|
650
|
-
var _$t = y
|
651
|
-
_$h.delete(_$l), v
|
735
|
+
var _$t = y(_$h.get(_$l), "removed");
|
736
|
+
_$h.delete(_$l), v.emit(4, _$t);
|
652
737
|
var _$e = C.queue.length;
|
653
738
|
if (C.count = null == _$l ? C.count - C.displayedToast : C.count - 1, C.count < 0 && (C.count = 0), _$e > 0) {
|
654
739
|
var _$t1 = null == _$l ? C.props.limit : 1;
|
@@ -668,16 +753,16 @@ function C$1(t) {
|
|
668
753
|
theme: _$n,
|
669
754
|
type: o
|
670
755
|
};
|
671
|
-
return !1 === _$r || (p
|
672
|
-
return t in E
|
673
|
-
}(o) && (_$i = E
|
674
|
-
}(M), p
|
756
|
+
return !1 === _$r || (p(_$r) ? _$i = _$r(_$l) : isValidElement(_$r) ? _$i = cloneElement(_$r, _$l) : d(_$r) || u(_$r) ? _$i = _$r : _$s ? _$i = E.spinner() : function(t) {
|
757
|
+
return t in E;
|
758
|
+
}(o) && (_$i = E[o](_$l))), _$i;
|
759
|
+
}(M), p(_$i.onOpen) && (M.onOpen = _$i.onOpen), p(_$i.onClose) && (M.onClose = _$i.onClose), M.closeButton = b.closeButton, !1 === _$i.closeButton || f(_$i.closeButton) ? M.closeButton = _$i.closeButton : !0 === _$i.closeButton && (M.closeButton = !f(b.closeButton) || b.closeButton);
|
675
760
|
var x = t;
|
676
|
-
isValidElement(t) && !d
|
761
|
+
isValidElement(t) && !d(t.type) ? x = cloneElement(t, {
|
677
762
|
closeToast: _$L,
|
678
763
|
toastProps: M,
|
679
764
|
data: T
|
680
|
-
}) : p
|
765
|
+
}) : p(t) && (x = t({
|
681
766
|
closeToast: _$L,
|
682
767
|
toastProps: M,
|
683
768
|
data: T
|
@@ -685,7 +770,7 @@ function C$1(t) {
|
|
685
770
|
toastContent: x,
|
686
771
|
toastProps: M,
|
687
772
|
staleId: _$r
|
688
|
-
}) : u
|
773
|
+
}) : u(_$s) ? setTimeout(function() {
|
689
774
|
O(x, M, _$r);
|
690
775
|
}, _$s) : O(x, M, _$r);
|
691
776
|
}
|
@@ -702,13 +787,13 @@ function C$1(t) {
|
|
702
787
|
]).filter(function(t) {
|
703
788
|
return t !== n;
|
704
789
|
});
|
705
|
-
}), v
|
790
|
+
}), v.emit(4, y(_$s, null == _$s.props.updateId ? "added" : "updated"));
|
706
791
|
}
|
707
792
|
return useEffect(function() {
|
708
|
-
return C.containerId = t.containerId, v
|
793
|
+
return C.containerId = t.containerId, v.cancelEmit(3).on(0, L).on(1, function(t) {
|
709
794
|
return g.current && I(t);
|
710
795
|
}).on(5, b).emit(2, C), function() {
|
711
|
-
_$h.clear(), v
|
796
|
+
_$h.clear(), v.emit(3, C);
|
712
797
|
};
|
713
798
|
}, []), useEffect(function() {
|
714
799
|
C.props = t, C.isToastActive = T, C.displayedToast = _$l.length;
|
@@ -726,13 +811,13 @@ function C$1(t) {
|
|
726
811
|
isToastActive: T
|
727
812
|
};
|
728
813
|
}
|
729
|
-
function b
|
814
|
+
function b(t) {
|
730
815
|
return t.targetTouches && t.targetTouches.length >= 1 ? t.targetTouches[0].clientX : t.clientX;
|
731
816
|
}
|
732
|
-
function I
|
817
|
+
function I(t) {
|
733
818
|
return t.targetTouches && t.targetTouches.length >= 1 ? t.targetTouches[0].clientY : t.clientY;
|
734
819
|
}
|
735
|
-
function _
|
820
|
+
function _(t) {
|
736
821
|
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
822
|
start: 0,
|
738
823
|
x: 0,
|
@@ -748,7 +833,7 @@ function _$1(t) {
|
|
748
833
|
if (t.draggable) {
|
749
834
|
"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
835
|
var _$n = c.current;
|
751
|
-
u.canCloseOnClick = !0, u.canDrag = !0, u.boundingRect = _$n.getBoundingClientRect(), _$n.style.transition = "", u.x = b
|
836
|
+
u.canCloseOnClick = !0, u.canDrag = !0, u.boundingRect = _$n.getBoundingClientRect(), _$n.style.transition = "", u.x = b(e.nativeEvent), u.y = I(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
837
|
}
|
753
838
|
}
|
754
839
|
function T(e) {
|
@@ -765,7 +850,7 @@ function _$1(t) {
|
|
765
850
|
}
|
766
851
|
function _(e) {
|
767
852
|
var _$n = c.current;
|
768
|
-
u.canDrag && _$n && (u.didMove = !0, o && C(), u.x = b
|
853
|
+
u.canDrag && _$n && (u.didMove = !0, o && C(), u.x = b(e), u.y = I(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)));
|
769
854
|
}
|
770
855
|
function L() {
|
771
856
|
document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", L), document.removeEventListener("touchmove", _), document.removeEventListener("touchend", L);
|
@@ -780,9 +865,9 @@ function _$1(t) {
|
|
780
865
|
}), useEffect(function() {
|
781
866
|
return c.current && c.current.addEventListener("d", E, {
|
782
867
|
once: !0
|
783
|
-
}), p
|
868
|
+
}), p(t.onOpen) && t.onOpen(isValidElement(t.children) && t.children.props), function() {
|
784
869
|
var _$t = d.current;
|
785
|
-
p
|
870
|
+
p(_$t.onClose) && _$t.onClose(isValidElement(_$t.children) && _$t.children.props);
|
786
871
|
};
|
787
872
|
}, []), useEffect(function() {
|
788
873
|
return t.pauseOnFocusLoss && (document.hasFocus() || C(), window.addEventListener("focus", E), window.addEventListener("blur", C)), function() {
|
@@ -808,7 +893,7 @@ function _$1(t) {
|
|
808
893
|
eventHandlers: O
|
809
894
|
};
|
810
895
|
}
|
811
|
-
function L
|
896
|
+
function L(e) {
|
812
897
|
var n = e.closeToast, o = e.theme, tmp = e.ariaLabel, s = tmp === void 0 ? "close" : tmp;
|
813
898
|
return React.createElement("button", {
|
814
899
|
className: "Toastify__close-button Toastify__close-button--".concat(o),
|
@@ -825,7 +910,7 @@ function L$1(e) {
|
|
825
910
|
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
911
|
})));
|
827
912
|
}
|
828
|
-
function O
|
913
|
+
function O(e) {
|
829
914
|
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
915
|
var _$h = r || u && 0 === d, y = _object_spread_props(_object_spread$1({}, _$l), {
|
831
916
|
animationDuration: "".concat(n, "ms"),
|
@@ -833,13 +918,13 @@ function O$1(e) {
|
|
833
918
|
opacity: _$h ? 0 : 1
|
834
919
|
});
|
835
920
|
u && (y.transform = "scaleX(".concat(d, ")"));
|
836
|
-
var v = clsx
|
921
|
+
var v = clsx("Toastify__progress-bar", u ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", "Toastify__progress-bar-theme--".concat(g), "Toastify__progress-bar--".concat(a), {
|
837
922
|
"Toastify__progress-bar--rtl": m
|
838
|
-
}), T = p
|
923
|
+
}), T = p(i) ? i({
|
839
924
|
rtl: m,
|
840
925
|
type: a,
|
841
926
|
defaultClassName: v
|
842
|
-
}) : clsx
|
927
|
+
}) : clsx(v, i);
|
843
928
|
return React.createElement("div", _define_property$1({
|
844
929
|
role: "progressbar",
|
845
930
|
"aria-hidden": _$h ? "true" : "false",
|
@@ -850,23 +935,23 @@ function O$1(e) {
|
|
850
935
|
f && s();
|
851
936
|
}));
|
852
937
|
}
|
853
|
-
var N
|
854
|
-
var _$_ = _
|
938
|
+
var N = function(n) {
|
939
|
+
var _$_ = _(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("Toastify__toast", "Toastify__toast-theme--".concat(z), "Toastify__toast--".concat(f), {
|
855
940
|
"Toastify__toast--rtl": x
|
856
941
|
}, {
|
857
942
|
"Toastify__toast--close-on-click": A
|
858
|
-
}), H = p
|
943
|
+
}), H = p(T) ? T({
|
859
944
|
rtl: x,
|
860
945
|
position: v,
|
861
946
|
type: f,
|
862
947
|
defaultClassName: F
|
863
|
-
}) : clsx
|
948
|
+
}) : clsx(F, T), S = !!w || !d, _$q = {
|
864
949
|
closeToast: _$h,
|
865
950
|
type: f,
|
866
951
|
theme: z
|
867
952
|
};
|
868
953
|
var _$Q = null;
|
869
|
-
return !1 === _$l || (_$Q = p
|
954
|
+
return !1 === _$l || (_$Q = p(_$l) ? _$l(_$q) : isValidElement(_$l) ? cloneElement(_$l, _$q) : L(_$q)), React.createElement(y, {
|
870
955
|
isIn: P,
|
871
956
|
done: k,
|
872
957
|
position: v,
|
@@ -882,15 +967,15 @@ var N$1 = function(n) {
|
|
882
967
|
}), React.createElement("div", _object_spread_props(_object_spread$1({}, P && {
|
883
968
|
role: R
|
884
969
|
}), {
|
885
|
-
className: p
|
970
|
+
className: p(C) ? C({
|
886
971
|
type: f
|
887
|
-
}) : clsx
|
972
|
+
}) : clsx("Toastify__toast-body", C),
|
888
973
|
style: b
|
889
974
|
}), null != D && React.createElement("div", {
|
890
|
-
className: clsx
|
975
|
+
className: clsx("Toastify__toast-icon", {
|
891
976
|
"Toastify--animate-icon Toastify__zoom-enter": !B
|
892
977
|
})
|
893
|
-
}, D), React.createElement("div", null, u)), _$Q, React.createElement(O
|
978
|
+
}, D), React.createElement("div", null, u)), _$Q, React.createElement(O, _object_spread_props(_object_spread$1({}, M && !S ? {
|
894
979
|
key: "pb-".concat(M)
|
895
980
|
} : {}), {
|
896
981
|
rtl: x,
|
@@ -906,24 +991,24 @@ var N$1 = function(n) {
|
|
906
991
|
controlledProgress: S,
|
907
992
|
progress: w || 0
|
908
993
|
}))));
|
909
|
-
}, M
|
994
|
+
}, M = function M(t, e) {
|
910
995
|
return void 0 === e && (e = !1), {
|
911
996
|
enter: "Toastify--animate Toastify__".concat(t, "-enter"),
|
912
997
|
exit: "Toastify--animate Toastify__".concat(t, "-exit"),
|
913
998
|
appendPosition: e
|
914
999
|
};
|
915
|
-
}, R
|
1000
|
+
}, R = h(M("bounce", !0)); h(M("slide", !0)); h(M("zoom")); h(M("flip")); var k = forwardRef(function(e, n) {
|
916
1001
|
var f = function f(t) {
|
917
|
-
var _$e = clsx
|
1002
|
+
var _$e = clsx("Toastify__toast-container", "Toastify__toast-container--".concat(t), {
|
918
1003
|
"Toastify__toast-container--rtl": u
|
919
1004
|
});
|
920
|
-
return p
|
1005
|
+
return p(i) ? i({
|
921
1006
|
position: t,
|
922
1007
|
rtl: u,
|
923
1008
|
defaultClassName: _$e
|
924
|
-
}) : clsx
|
1009
|
+
}) : clsx(_$e, m(i));
|
925
1010
|
};
|
926
|
-
var _C = C
|
1011
|
+
var _C = C(e), o = _C.getToastToRender, a = _C.containerRef, r = _C.isToastActive, i = e.className, _$l = e.style, u = e.rtl, d = e.containerId;
|
927
1012
|
return useEffect(function() {
|
928
1013
|
n && (n.current = a.current);
|
929
1014
|
}, []), React.createElement("div", {
|
@@ -940,7 +1025,7 @@ var N$1 = function(n) {
|
|
940
1025
|
key: "container-".concat(e)
|
941
1026
|
}, n.map(function(e, o) {
|
942
1027
|
var _$s = e.content, a = e.props;
|
943
|
-
return React.createElement(N
|
1028
|
+
return React.createElement(N, _object_spread_props(_object_spread$1({}, a), {
|
944
1029
|
isIn: r(a.toastId),
|
945
1030
|
style: _object_spread_props(_object_spread$1({}, a.style), {
|
946
1031
|
"--nth": o + 1,
|
@@ -951,11 +1036,11 @@ var N$1 = function(n) {
|
|
951
1036
|
}));
|
952
1037
|
}));
|
953
1038
|
});
|
954
|
-
k
|
1039
|
+
k.displayName = "ToastContainer", k.defaultProps = {
|
955
1040
|
position: "top-right",
|
956
|
-
transition: R
|
1041
|
+
transition: R,
|
957
1042
|
autoClose: 5e3,
|
958
|
-
closeButton: L
|
1043
|
+
closeButton: L,
|
959
1044
|
pauseOnHover: !0,
|
960
1045
|
pauseOnFocusLoss: !0,
|
961
1046
|
closeOnClick: !0,
|
@@ -965,44 +1050,44 @@ k$1.displayName = "ToastContainer", k$1.defaultProps = {
|
|
965
1050
|
role: "alert",
|
966
1051
|
theme: "light"
|
967
1052
|
};
|
968
|
-
var P
|
969
|
-
function z
|
970
|
-
return "" + A
|
1053
|
+
var P, B = new Map, D = [], A = 1;
|
1054
|
+
function z() {
|
1055
|
+
return "" + A++;
|
971
1056
|
}
|
972
|
-
function F
|
973
|
-
return t && (d
|
1057
|
+
function F(t) {
|
1058
|
+
return t && (d(t.toastId) || u(t.toastId)) ? t.toastId : z();
|
974
1059
|
}
|
975
|
-
function H
|
976
|
-
return B
|
1060
|
+
function H(t, e) {
|
1061
|
+
return B.size > 0 ? v.emit(0, t, e) : D.push({
|
977
1062
|
content: t,
|
978
1063
|
options: e
|
979
1064
|
}), e.toastId;
|
980
1065
|
}
|
981
|
-
function S
|
1066
|
+
function S(t, e) {
|
982
1067
|
return _object_spread_props(_object_spread$1({}, e), {
|
983
1068
|
type: e && e.type || t,
|
984
|
-
toastId: F
|
1069
|
+
toastId: F(e)
|
985
1070
|
});
|
986
1071
|
}
|
987
|
-
function q
|
1072
|
+
function q(t) {
|
988
1073
|
return function(e, n) {
|
989
|
-
return H
|
1074
|
+
return H(e, S(t, n));
|
990
1075
|
};
|
991
1076
|
}
|
992
|
-
function Q
|
993
|
-
return H
|
1077
|
+
function Q(t, e) {
|
1078
|
+
return H(t, S("default", e));
|
994
1079
|
}
|
995
|
-
Q
|
996
|
-
return H
|
1080
|
+
Q.loading = function(t, e) {
|
1081
|
+
return H(t, S("default", _object_spread$1({
|
997
1082
|
isLoading: !0,
|
998
1083
|
autoClose: !1,
|
999
1084
|
closeOnClick: !1,
|
1000
1085
|
closeButton: !1,
|
1001
1086
|
draggable: !1
|
1002
1087
|
}, e)));
|
1003
|
-
}, Q
|
1088
|
+
}, Q.promise = function(t, e, n) {
|
1004
1089
|
var o, s = e.pending, a = e.error, r = e.success;
|
1005
|
-
s && (o = d
|
1090
|
+
s && (o = d(s) ? Q.loading(s, n) : Q.loading(s.render, _object_spread$1({}, n, s)));
|
1006
1091
|
var i = {
|
1007
1092
|
isLoading: null,
|
1008
1093
|
autoClose: null,
|
@@ -1010,41 +1095,41 @@ Q$1.loading = function(t, e) {
|
|
1010
1095
|
closeButton: null,
|
1011
1096
|
draggable: null
|
1012
1097
|
}, _$l = function(t, e, s) {
|
1013
|
-
if (null == e) return void Q
|
1098
|
+
if (null == e) return void Q.dismiss(o);
|
1014
1099
|
var a = _object_spread_props(_object_spread$1({
|
1015
1100
|
type: t
|
1016
1101
|
}, i, n), {
|
1017
1102
|
data: s
|
1018
|
-
}), r = d
|
1103
|
+
}), r = d(e) ? {
|
1019
1104
|
render: e
|
1020
1105
|
} : e;
|
1021
|
-
return o ? Q
|
1022
|
-
}, c = p
|
1106
|
+
return o ? Q.update(o, _object_spread$1({}, a, r)) : Q(r.render, _object_spread$1({}, a, r)), s;
|
1107
|
+
}, c = p(t) ? t() : t;
|
1023
1108
|
return c.then(function(t) {
|
1024
1109
|
return _$l("success", r, t);
|
1025
1110
|
}).catch(function(t) {
|
1026
1111
|
return _$l("error", a, t);
|
1027
1112
|
}), c;
|
1028
|
-
}, Q
|
1029
|
-
return H
|
1113
|
+
}, Q.success = q("success"), Q.info = q("info"), Q.error = q("error"), Q.warning = q("warning"), Q.warn = Q.warning, Q.dark = function(t, e) {
|
1114
|
+
return H(t, S("default", _object_spread$1({
|
1030
1115
|
theme: "dark"
|
1031
1116
|
}, e)));
|
1032
|
-
}, Q
|
1033
|
-
B
|
1117
|
+
}, Q.dismiss = function(t) {
|
1118
|
+
B.size > 0 ? v.emit(1, t) : D = D.filter(function(e) {
|
1034
1119
|
return null != t && e.options.toastId !== t;
|
1035
1120
|
});
|
1036
|
-
}, Q
|
1037
|
-
return void 0 === t && (t = {}), v
|
1038
|
-
}, Q
|
1121
|
+
}, Q.clearWaitingQueue = function(t) {
|
1122
|
+
return void 0 === t && (t = {}), v.emit(5, t);
|
1123
|
+
}, Q.isActive = function(t) {
|
1039
1124
|
var e = !1;
|
1040
|
-
return B
|
1125
|
+
return B.forEach(function(n) {
|
1041
1126
|
n.isToastActive && n.isToastActive(t) && (e = !0);
|
1042
1127
|
}), e;
|
1043
|
-
}, Q
|
1128
|
+
}, Q.update = function(t, e) {
|
1044
1129
|
void 0 === e && (e = {}), setTimeout(function() {
|
1045
1130
|
var n = function(t, e) {
|
1046
1131
|
var n = e.containerId;
|
1047
|
-
var o = B
|
1132
|
+
var o = B.get(n || P);
|
1048
1133
|
return o && o.getToast(t);
|
1049
1134
|
}(t, e);
|
1050
1135
|
if (n) {
|
@@ -1052,40 +1137,40 @@ Q$1.loading = function(t, e) {
|
|
1052
1137
|
delay: 100
|
1053
1138
|
}, o, e), {
|
1054
1139
|
toastId: e.toastId || t,
|
1055
|
-
updateId: z
|
1140
|
+
updateId: z()
|
1056
1141
|
});
|
1057
1142
|
a.toastId !== t && (a.staleId = t);
|
1058
1143
|
var r = a.render || s;
|
1059
|
-
delete a.render, H
|
1144
|
+
delete a.render, H(r, a);
|
1060
1145
|
}
|
1061
1146
|
}, 0);
|
1062
|
-
}, Q
|
1063
|
-
Q
|
1147
|
+
}, Q.done = function(t) {
|
1148
|
+
Q.update(t, {
|
1064
1149
|
progress: 1
|
1065
1150
|
});
|
1066
|
-
}, Q
|
1067
|
-
return v
|
1068
|
-
v
|
1151
|
+
}, Q.onChange = function(t) {
|
1152
|
+
return v.on(4, t), function() {
|
1153
|
+
v.off(4, t);
|
1069
1154
|
};
|
1070
|
-
}, Q
|
1155
|
+
}, Q.POSITION = {
|
1071
1156
|
TOP_LEFT: "top-left",
|
1072
1157
|
TOP_RIGHT: "top-right",
|
1073
1158
|
TOP_CENTER: "top-center",
|
1074
1159
|
BOTTOM_LEFT: "bottom-left",
|
1075
1160
|
BOTTOM_RIGHT: "bottom-right",
|
1076
1161
|
BOTTOM_CENTER: "bottom-center"
|
1077
|
-
}, Q
|
1162
|
+
}, Q.TYPE = {
|
1078
1163
|
INFO: "info",
|
1079
1164
|
SUCCESS: "success",
|
1080
1165
|
WARNING: "warning",
|
1081
1166
|
ERROR: "error",
|
1082
1167
|
DEFAULT: "default"
|
1083
|
-
}, v
|
1084
|
-
P
|
1085
|
-
v
|
1086
|
-
}), D
|
1168
|
+
}, v.on(2, function(t) {
|
1169
|
+
P = t.containerId || t, B.set(P, t), D.forEach(function(t) {
|
1170
|
+
v.emit(0, t.content, t.options);
|
1171
|
+
}), D = [];
|
1087
1172
|
}).on(3, function(t) {
|
1088
|
-
B
|
1173
|
+
B.delete(t.containerId || t), 0 === B.size && v.off(0).off(1).off(5);
|
1089
1174
|
});
|
1090
1175
|
|
1091
1176
|
function _array_like_to_array(arr, len) {
|
@@ -1158,14 +1243,14 @@ function useMutate(mutation, options) {
|
|
1158
1243
|
// Return the mutation so that Formik can update submitting state
|
1159
1244
|
return mutation.mutateAsync((_runIfFn = runIfFn(mergedOptions.processInput, values)) !== null && _runIfFn !== void 0 ? _runIfFn : values).then(function(result) {
|
1160
1245
|
var _mergedOptions_onSuccess;
|
1161
|
-
if (mergedOptions.showSuccessMsg && mergedOptions.successMsg) Q
|
1246
|
+
if (mergedOptions.showSuccessMsg && mergedOptions.successMsg) Q.success(runIfFn(mergedOptions.successMsg, result, values));
|
1162
1247
|
(_mergedOptions_onSuccess = mergedOptions.onSuccess) === null || _mergedOptions_onSuccess === void 0 ? void 0 : _mergedOptions_onSuccess.call(mergedOptions, result);
|
1163
1248
|
return result;
|
1164
1249
|
}).catch(function(error) {
|
1165
1250
|
var _mergedOptions_onError;
|
1166
1251
|
if (mergedOptions.showErrorMsg) {
|
1167
1252
|
var _runIfFn;
|
1168
|
-
Q
|
1253
|
+
Q.error((_runIfFn = runIfFn(mergedOptions.errorMsg, error, values)) !== null && _runIfFn !== void 0 ? _runIfFn : "Oops, something went wrong :(");
|
1169
1254
|
}
|
1170
1255
|
(_mergedOptions_onError = mergedOptions.onError) === null || _mergedOptions_onError === void 0 ? void 0 : _mergedOptions_onError.call(mergedOptions, error);
|
1171
1256
|
});
|
@@ -1235,10 +1320,6 @@ function NavigateButton(_a) {
|
|
1235
1320
|
}));
|
1236
1321
|
}
|
1237
1322
|
|
1238
|
-
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
1239
|
-
|
1240
|
-
const u=t=>"number"==typeof t&&!isNaN(t),d=t=>"string"==typeof t,p=t=>"function"==typeof t,m=t=>d(t)||p(t)?t:null,f=t=>isValidElement(t)||d(t)||p(t)||u(t);function g(t,e,n){void 0===n&&(n=300);const{scrollHeight:o,style:s}=t;requestAnimationFrame(()=>{s.minHeight="initial",s.height=o+"px",s.transition=`all ${n}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(e,n);});});}function h(e){let{enter:a,exit:r,appendPosition:i=!1,collapse:l=!0,collapseDuration:c=300}=e;return function(e){let{children:u,position:d,preventExitTransition:p,done:m,nodeRef:f,isIn:h}=e;const y=i?`${a}--${d}`:a,v=i?`${r}--${d}`:r,T=useRef(0);return useLayoutEffect(()=>{const t=f.current,e=y.split(" "),n=o=>{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.remove(...e));};t.classList.add(...e),t.addEventListener("animationend",n),t.addEventListener("animationcancel",n);},[]),useEffect(()=>{const t=f.current,e=()=>{t.removeEventListener("animationend",e),l?g(t,m,c):m();};h||(p?e():(T.current=1,t.className+=` ${v}`,t.addEventListener("animationend",e)));},[h]),React.createElement(React.Fragment,null,u)}}function y(t,e){return null!=t?{content:t.content,containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,status:e}:{}}const v={list:new Map,emitQueue:new Map,on(t,e){return this.list.has(t)||this.list.set(t,[]),this.list.get(t).push(e),this},off(t,e){if(e){const n=this.list.get(t).filter(t=>t!==e);return this.list.set(t,n),this}return this.list.delete(t),this},cancelEmit(t){const e=this.emitQueue.get(t);return e&&(e.forEach(clearTimeout),this.emitQueue.delete(t)),this},emit(t){this.list.has(t)&&this.list.get(t).forEach(e=>{const n=setTimeout(()=>{e(...[].slice.call(arguments,1));},0);this.emitQueue.has(t)||this.emitQueue.set(t,[]),this.emitQueue.get(t).push(n);});}},T=e=>{let{theme:n,type:o,...s}=e;return React.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===n?"currentColor":`var(--toastify-icon-color-${o})`,...s})},E={info:function(e){return React.createElement(T,{...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"}))},warning:function(e){return React.createElement(T,{...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"}))},success:function(e){return React.createElement(T,{...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"}))},error:function(e){return React.createElement(T,{...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"}))},spinner:function(){return React.createElement("div",{className:"Toastify__spinner"})}};function C(t){const[,o]=useReducer(t=>t+1,0),[l,c]=useState([]),g=useRef(null),h=useRef(new Map).current,T=t=>-1!==l.indexOf(t),C=useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:t,containerId:null,isToastActive:T,getToast:t=>h.get(t)}).current;function b(t){let{containerId:e}=t;const{limit:n}=C.props;!n||e&&C.containerId!==e||(C.count-=C.queue.length,C.queue=[]);}function I(t){c(e=>null==t?[]:e.filter(e=>e!==t));}function _(){const{toastContent:t,toastProps:e,staleId:n}=C.queue.shift();O(t,e,n);}function L(t,n){let{delay:s,staleId:r,...i}=n;if(!f(t)||function(t){return !g.current||C.props.enableMultiContainer&&t.containerId!==C.props.containerId||h.has(t.toastId)&&null==t.updateId}(i))return;const{toastId:l,updateId:c,data:T}=i,{props:b}=C,L=()=>I(l),N=null==c;N&&C.count++;const M={...b,style:b.toastStyle,key:C.toastKey++,...Object.fromEntries(Object.entries(i).filter(t=>{let[e,n]=t;return null!=n})),toastId:l,updateId:c,data:T,closeToast:L,isIn:!1,className:m(i.className||b.toastClassName),bodyClassName:m(i.bodyClassName||b.bodyClassName),progressClassName:m(i.progressClassName||b.progressClassName),autoClose:!i.isLoading&&(R=i.autoClose,w=b.autoClose,!1===R||u(R)&&R>0?R:w),deleteToast(){const t=y(h.get(l),"removed");h.delete(l),v.emit(4,t);const e=C.queue.length;if(C.count=null==l?C.count-C.displayedToast:C.count-1,C.count<0&&(C.count=0),e>0){const t=null==l?C.props.limit:1;if(1===e||1===t)C.displayedToast++,_();else {const n=t>e?e:t;C.displayedToast=n;for(let t=0;t<n;t++)_();}}else o();}};var R,w;M.iconOut=function(t){let{theme:n,type:o,isLoading:s,icon:r}=t,i=null;const l={theme:n,type:o};return !1===r||(p(r)?i=r(l):isValidElement(r)?i=cloneElement(r,l):d(r)||u(r)?i=r:s?i=E.spinner():(t=>t in E)(o)&&(i=E[o](l))),i}(M),p(i.onOpen)&&(M.onOpen=i.onOpen),p(i.onClose)&&(M.onClose=i.onClose),M.closeButton=b.closeButton,!1===i.closeButton||f(i.closeButton)?M.closeButton=i.closeButton:!0===i.closeButton&&(M.closeButton=!f(b.closeButton)||b.closeButton);let x=t;isValidElement(t)&&!d(t.type)?x=cloneElement(t,{closeToast:L,toastProps:M,data:T}):p(t)&&(x=t({closeToast:L,toastProps:M,data:T})),b.limit&&b.limit>0&&C.count>b.limit&&N?C.queue.push({toastContent:x,toastProps:M,staleId:r}):u(s)?setTimeout(()=>{O(x,M,r);},s):O(x,M,r);}function O(t,e,n){const{toastId:o}=e;n&&h.delete(n);const s={content:t,props:e};h.set(o,s),c(t=>[...t,o].filter(t=>t!==n)),v.emit(4,y(s,null==s.props.updateId?"added":"updated"));}return useEffect(()=>(C.containerId=t.containerId,v.cancelEmit(3).on(0,L).on(1,t=>g.current&&I(t)).on(5,b).emit(2,C),()=>{h.clear(),v.emit(3,C);}),[]),useEffect(()=>{C.props=t,C.isToastActive=T,C.displayedToast=l.length;}),{getToastToRender:function(e){const n=new Map,o=Array.from(h.values());return t.newestOnTop&&o.reverse(),o.forEach(t=>{const{position:e}=t.props;n.has(e)||n.set(e,[]),n.get(e).push(t);}),Array.from(n,t=>e(t[0],t[1]))},containerRef:g,isToastActive:T}}function b(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientX:t.clientX}function I(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientY:t.clientY}function _(t){const[o,a]=useState(!1),[r,l]=useState(!1),c=useRef(null),u=useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,d=useRef(t),{autoClose:m,pauseOnHover:f,closeToast:g,onClick:h,closeOnClick:y}=t;function v(e){if(t.draggable){"touchstart"===e.nativeEvent.type&&e.nativeEvent.preventDefault(),u.didMove=!1,document.addEventListener("mousemove",_),document.addEventListener("mouseup",L),document.addEventListener("touchmove",_),document.addEventListener("touchend",L);const n=c.current;u.canCloseOnClick=!0,u.canDrag=!0,u.boundingRect=n.getBoundingClientRect(),n.style.transition="",u.x=b(e.nativeEvent),u.y=I(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));}}function T(e){if(u.boundingRect){const{top:n,bottom:o,left:s,right:a}=u.boundingRect;"touchend"!==e.nativeEvent.type&&t.pauseOnHover&&u.x>=s&&u.x<=a&&u.y>=n&&u.y<=o?C():E();}}function E(){a(!0);}function C(){a(!1);}function _(e){const n=c.current;u.canDrag&&n&&(u.didMove=!0,o&&C(),u.x=b(e),u.y=I(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${t.draggableDirection}(${u.delta}px)`,n.style.opacity=""+(1-Math.abs(u.delta/u.removalDistance)));}function L(){document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",L),document.removeEventListener("touchmove",_),document.removeEventListener("touchend",L);const e=c.current;if(u.canDrag&&u.didMove&&e){if(u.canDrag=!1,Math.abs(u.delta)>u.removalDistance)return l(!0),void t.closeToast();e.style.transition="transform 0.2s, opacity 0.2s",e.style.transform=`translate${t.draggableDirection}(0)`,e.style.opacity="1";}}useEffect(()=>{d.current=t;}),useEffect(()=>(c.current&&c.current.addEventListener("d",E,{once:!0}),p(t.onOpen)&&t.onOpen(isValidElement(t.children)&&t.children.props),()=>{const t=d.current;p(t.onClose)&&t.onClose(isValidElement(t.children)&&t.children.props);}),[]),useEffect(()=>(t.pauseOnFocusLoss&&(document.hasFocus()||C(),window.addEventListener("focus",E),window.addEventListener("blur",C)),()=>{t.pauseOnFocusLoss&&(window.removeEventListener("focus",E),window.removeEventListener("blur",C));}),[t.pauseOnFocusLoss]);const O={onMouseDown:v,onTouchStart:v,onMouseUp:T,onTouchEnd:T};return m&&f&&(O.onMouseEnter=C,O.onMouseLeave=E),y&&(O.onClick=t=>{h&&h(t),u.canCloseOnClick&&g();}),{playToast:E,pauseToast:C,isRunning:o,preventExitTransition:r,toastRef:c,eventHandlers:O}}function L(e){let{closeToast:n,theme:o,ariaLabel:s="close"}=e;return React.createElement("button",{className:`Toastify__close-button Toastify__close-button--${o}`,type:"button",onClick:t=>{t.stopPropagation(),n(t);},"aria-label":s},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"})))}function O(e){let{delay:n,isRunning:o,closeToast:s,type:a="default",hide:r,className:i,style:l,controlledProgress:u,progress:d,rtl:m,isIn:f,theme:g}=e;const h=r||u&&0===d,y={...l,animationDuration:`${n}ms`,animationPlayState:o?"running":"paused",opacity:h?0:1};u&&(y.transform=`scaleX(${d})`);const v=clsx("Toastify__progress-bar",u?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${a}`,{"Toastify__progress-bar--rtl":m}),T=p(i)?i({rtl:m,type:a,defaultClassName:v}):clsx(v,i);return React.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:T,style:y,[u&&d>=1?"onTransitionEnd":"onAnimationEnd"]:u&&d<1?null:()=>{f&&s();}})}const N=n=>{const{isRunning:o,preventExitTransition:s,toastRef:r,eventHandlers:i}=_(n),{closeButton:l,children:u,autoClose:d,onClick:m,type:f,hideProgressBar:g,closeToast:h,transition:y,position:v,className:T,style:E,bodyClassName:C,bodyStyle:b,progressClassName:I,progressStyle:N,updateId:M,role:R,progress:w,rtl:x,toastId:$,deleteToast:k,isIn:P,isLoading:B,iconOut:D,closeOnClick:A,theme:z}=n,F=clsx("Toastify__toast",`Toastify__toast-theme--${z}`,`Toastify__toast--${f}`,{"Toastify__toast--rtl":x},{"Toastify__toast--close-on-click":A}),H=p(T)?T({rtl:x,position:v,type:f,defaultClassName:F}):clsx(F,T),S=!!w||!d,q={closeToast:h,type:f,theme:z};let Q=null;return !1===l||(Q=p(l)?l(q):isValidElement(l)?cloneElement(l,q):L(q)),React.createElement(y,{isIn:P,done:k,position:v,preventExitTransition:s,nodeRef:r},React.createElement("div",{id:$,onClick:m,className:H,...i,style:E,ref:r},React.createElement("div",{...P&&{role:R},className:p(C)?C({type:f}):clsx("Toastify__toast-body",C),style:b},null!=D&&React.createElement("div",{className:clsx("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!B})},D),React.createElement("div",null,u)),Q,React.createElement(O,{...M&&!S?{key:`pb-${M}`}:{},rtl:x,theme:z,delay:d,isRunning:o,isIn:P,closeToast:h,hide:g,type:f,style:N,className:I,controlledProgress:S,progress:w||0})))},M=function(t,e){return void 0===e&&(e=!1),{enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}},R=h(M("bounce",!0));h(M("slide",!0));h(M("zoom"));h(M("flip"));const k=forwardRef((e,n)=>{const{getToastToRender:o,containerRef:a,isToastActive:r}=C(e),{className:i,style:l,rtl:u,containerId:d}=e;function f(t){const e=clsx("Toastify__toast-container",`Toastify__toast-container--${t}`,{"Toastify__toast-container--rtl":u});return p(i)?i({position:t,rtl:u,defaultClassName:e}):clsx(e,m(i))}return useEffect(()=>{n&&(n.current=a.current);},[]),React.createElement("div",{ref:a,className:"Toastify",id:d},o((e,n)=>{const o=n.length?{...l}:{...l,pointerEvents:"none"};return React.createElement("div",{className:f(e),style:o,key:`container-${e}`},n.map((e,o)=>{let{content:s,props:a}=e;return React.createElement(N,{...a,isIn:r(a.toastId),style:{...a.style,"--nth":o+1,"--len":n.length},key:`toast-${a.key}`},s)}))}))});k.displayName="ToastContainer",k.defaultProps={position:"top-right",transition:R,autoClose:5e3,closeButton:L,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let P,B=new Map,D=[],A=1;function z(){return ""+A++}function F(t){return t&&(d(t.toastId)||u(t.toastId))?t.toastId:z()}function H(t,e){return B.size>0?v.emit(0,t,e):D.push({content:t,options:e}),e.toastId}function S(t,e){return {...e,type:e&&e.type||t,toastId:F(e)}}function q(t){return (e,n)=>H(e,S(t,n))}function Q(t,e){return H(t,S("default",e))}Q.loading=(t,e)=>H(t,S("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),Q.promise=function(t,e,n){let o,{pending:s,error:a,success:r}=e;s&&(o=d(s)?Q.loading(s,n):Q.loading(s.render,{...n,...s}));const i={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(t,e,s)=>{if(null==e)return void Q.dismiss(o);const a={type:t,...i,...n,data:s},r=d(e)?{render:e}:e;return o?Q.update(o,{...a,...r}):Q(r.render,{...a,...r}),s},c=p(t)?t():t;return c.then(t=>l("success",r,t)).catch(t=>l("error",a,t)),c},Q.success=q("success"),Q.info=q("info"),Q.error=q("error"),Q.warning=q("warning"),Q.warn=Q.warning,Q.dark=(t,e)=>H(t,S("default",{theme:"dark",...e})),Q.dismiss=t=>{B.size>0?v.emit(1,t):D=D.filter(e=>null!=t&&e.options.toastId!==t);},Q.clearWaitingQueue=function(t){return void 0===t&&(t={}),v.emit(5,t)},Q.isActive=t=>{let e=!1;return B.forEach(n=>{n.isToastActive&&n.isToastActive(t)&&(e=!0);}),e},Q.update=function(t,e){void 0===e&&(e={}),setTimeout(()=>{const n=function(t,e){let{containerId:n}=e;const o=B.get(n||P);return o&&o.getToast(t)}(t,e);if(n){const{props:o,content:s}=n,a={delay:100,...o,...e,toastId:e.toastId||t,updateId:z()};a.toastId!==t&&(a.staleId=t);const r=a.render||s;delete a.render,H(r,a);}},0);},Q.done=t=>{Q.update(t,{progress:1});},Q.onChange=t=>(v.on(4,t),()=>{v.off(4,t);}),Q.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Q.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},v.on(2,t=>{P=t.containerId||t,B.set(P,t),D.forEach(t=>{v.emit(0,t.content,t.options);}),D=[];}).on(3,t=>{B.delete(t.containerId||t),0===B.size&&v.off(0).off(1).off(5);});
|
1241
|
-
|
1242
1323
|
function PublishButton(_a) {
|
1243
1324
|
var {
|
1244
1325
|
status,
|
@@ -1252,7 +1333,7 @@ function PublishButton(_a) {
|
|
1252
1333
|
});
|
1253
1334
|
const publish = React.useCallback(() => {
|
1254
1335
|
mutation.reset();
|
1255
|
-
mutation.mutateAsync(queryId).then(() =>
|
1336
|
+
mutation.mutateAsync(queryId).then(() => toast.success(isDraft ? "Published!" : "Unpublished!")).catch(error => toast.error(`Error: ${error}`));
|
1256
1337
|
}, [mutation, queryId]);
|
1257
1338
|
return jsxs(Button, Object.assign({
|
1258
1339
|
scheme: "secondary",
|
@@ -1722,13 +1803,13 @@ function OrderCell({
|
|
1722
1803
|
const moveDown = React.useCallback(e => {
|
1723
1804
|
e.stopPropagation();
|
1724
1805
|
mutationDown.mutateAsync(postId).catch(error => {
|
1725
|
-
|
1806
|
+
toast.error(`Error: ${error}`);
|
1726
1807
|
});
|
1727
1808
|
}, [mutationDown, postId]);
|
1728
1809
|
const moveUp = React.useCallback(e => {
|
1729
1810
|
e.stopPropagation();
|
1730
1811
|
mutationUp.mutateAsync(postId).catch(error => {
|
1731
|
-
|
1812
|
+
toast.error(`Error: ${error}`);
|
1732
1813
|
});
|
1733
1814
|
}, [mutationUp, postId]);
|
1734
1815
|
return jsxs(FlexCenter, {
|
@@ -2514,13 +2595,13 @@ function ItemEditDialog$1(_a) {
|
|
2514
2595
|
const formItem = formToQueryData ? formToQueryData(item) : Object.assign({}, item);
|
2515
2596
|
yield mutation.mutateAsync(formItem).then(response => {
|
2516
2597
|
var _a;
|
2517
|
-
if (onSuccess) onSuccess(formItem, response);else
|
2598
|
+
if (onSuccess) onSuccess(formItem, response);else toast.success(`${title ? title(formItem) : (_a = formItem.name) !== null && _a !== void 0 ? _a : formItem.title} ${queryId ? "saved" : "created"}`);
|
2518
2599
|
// closing delete modal
|
2519
2600
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
2520
2601
|
}).catch(error => {
|
2521
2602
|
var _a;
|
2522
2603
|
console.error("on error", error);
|
2523
|
-
if (onSaveError) onSaveError(item);else
|
2604
|
+
if (onSaveError) onSaveError(item);else toast.error(`Couldn't save ${title ? title(formItem) : (_a = formItem.name) !== null && _a !== void 0 ? _a : formItem.title}`);
|
2524
2605
|
actions.setSubmitting(false);
|
2525
2606
|
});
|
2526
2607
|
}), [mutation, formToQueryData, onSuccess, onSaveError, onClose]);
|
@@ -2910,7 +2991,7 @@ function TableRowPublishPostButton$1(_a) {
|
|
2910
2991
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
2911
2992
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
2912
2993
|
mutation.reset();
|
2913
|
-
mutation.mutateAsync(id).then(() =>
|
2994
|
+
mutation.mutateAsync(id).then(() => toast.success(isDraft ? "Published!" : "Unpublished!")).catch(error => toast.error(`Error: ${error}`));
|
2914
2995
|
}, [mutation, id]);
|
2915
2996
|
return jsx(Button, Object.assign({
|
2916
2997
|
w: "10",
|
@@ -3761,7 +3842,7 @@ function AttachDialog(_a) {
|
|
3761
3842
|
mutation.mutateAsync({
|
3762
3843
|
resources: selectedResources
|
3763
3844
|
}).then(response => {
|
3764
|
-
if (onSuccess) onSuccess(response);else
|
3845
|
+
if (onSuccess) onSuccess(response);else toast.success(`${itemLabel} saved`);
|
3765
3846
|
if (invalidateQueriesOnSuccess) queryClient.invalidateQueries({
|
3766
3847
|
queryKey: queryKey
|
3767
3848
|
});
|
@@ -3769,7 +3850,7 @@ function AttachDialog(_a) {
|
|
3769
3850
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
3770
3851
|
}).catch(error => {
|
3771
3852
|
console.error("on error", error);
|
3772
|
-
if (onSaveError) onSaveError();else
|
3853
|
+
if (onSaveError) onSaveError();else toast.error(`Error adding ${itemLabel}`);
|
3773
3854
|
});
|
3774
3855
|
}, [mutation, queryId, onSuccess, queryClient, onSaveError, onClose]);
|
3775
3856
|
const resources = React.useMemo(() => {
|
@@ -4004,13 +4085,13 @@ function ItemEditDialog(_a) {
|
|
4004
4085
|
const formItem = formToQueryData ? formToQueryData(item) : Object.assign({}, item);
|
4005
4086
|
mutation.mutateAsync(formItem).then(response => {
|
4006
4087
|
var _a;
|
4007
|
-
if (onSuccess) onSuccess(formItem, response);else
|
4088
|
+
if (onSuccess) onSuccess(formItem, response);else toast.success(`${title ? title(formItem) : (_a = formItem.name) !== null && _a !== void 0 ? _a : formItem.title} ${queryId ? "saved" : "created"}`);
|
4008
4089
|
// closing delete modal
|
4009
4090
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
4010
4091
|
}).catch(error => {
|
4011
4092
|
var _a;
|
4012
4093
|
console.error("on error", error);
|
4013
|
-
if (onSaveError) onSaveError(item);else
|
4094
|
+
if (onSaveError) onSaveError(item);else toast.error(`Couldn't save ${title ? title(formItem) : (_a = formItem.name) !== null && _a !== void 0 ? _a : formItem.title}`);
|
4014
4095
|
actions.setSubmitting(false);
|
4015
4096
|
});
|
4016
4097
|
}, [mutation, formToQueryData, onSuccess, onSaveError, onClose]);
|
@@ -4304,7 +4385,7 @@ function TableRowPublishPostButton(_a) {
|
|
4304
4385
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
4305
4386
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
4306
4387
|
mutation.reset();
|
4307
|
-
mutation.mutateAsync(id).then(() =>
|
4388
|
+
mutation.mutateAsync(id).then(() => toast.success(isDraft ? "Published!" : "Unpublished!")).catch(error => toast.error(`Error: ${error}`));
|
4308
4389
|
}, [mutation, id]);
|
4309
4390
|
return jsx(Button, Object.assign({
|
4310
4391
|
w: "10",
|
@@ -4320,4 +4401,4 @@ function TableRowPublishPostButton(_a) {
|
|
4320
4401
|
}));
|
4321
4402
|
}
|
4322
4403
|
|
4323
|
-
export { AttachDialog, Breadcrumbs, DialogButton, FormActionDialog,
|
4404
|
+
export { AttachDialog, Breadcrumbs, DialogButton, FormActionDialog, InvalidateButton, ItemEditDialog, NavigateButton, OrderCell, PageContainer, PageContentEditor, PageMain, PageQueryStateContainer, PageSectionTitle, PageSidebar, PageSidebarSection, PageStateContainer, PageSubSectionTitle, PageTabbedTopBar, PageTabbedTopBarProvider, PageTitle, PageTopBar, PageTopBarToolbar, PublishButton, ScreenRenderer, SectionTitle, StatusBadge, TableContainer, TableCreateButton, TableFilterButton, TableRowActionBar, TableRowDeleteButton, TableRowEditButton, TableRowNavigateButton, TableRowPublishPostButton, TableRowViewButton, TableTopBar, UpdateButton, ViewButton };
|