kdpa-components 1.35.2 → 1.35.3
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/dist/Accordion/index.d.ts +3 -0
- package/dist/Accordion/index.d.ts.map +1 -0
- package/dist/Accordion/index.js +481 -0
- package/dist/AdvancedList/index.d.ts +2 -0
- package/dist/AdvancedList/index.d.ts.map +1 -0
- package/dist/AdvancedList/index.js +16751 -0
- package/dist/Alert/index.d.ts +5 -0
- package/dist/Alert/index.d.ts.map +1 -0
- package/dist/Alert/index.js +407 -0
- package/dist/ArrowDropDown-76613637.js +35 -0
- package/dist/Autocomplete-45ae6737.js +1670 -0
- package/dist/Avatar/index.d.ts +3 -0
- package/dist/Avatar/index.d.ts.map +1 -0
- package/dist/Avatar/index.js +210 -0
- package/dist/Badge/index.d.ts +6 -0
- package/dist/Badge/index.d.ts.map +1 -0
- package/dist/Badge/index.js +69 -0
- package/dist/Badge-26e8a2aa.js +392 -0
- package/dist/Box-a827334a.js +58 -0
- package/dist/Button-b93e890d.js +355 -0
- package/dist/ButtonBase-0f9f324d.js +655 -0
- package/dist/Buttons/index.d.ts +9 -0
- package/dist/Buttons/index.d.ts.map +1 -0
- package/dist/Buttons/index.js +83 -0
- package/dist/CSSTransition-d0281d1f.js +215 -0
- package/dist/Cards/index.d.ts +3 -0
- package/dist/Cards/index.d.ts.map +1 -0
- package/dist/Cards/index.js +144 -0
- package/dist/CheckBox/index.d.ts +3 -0
- package/dist/CheckBox/index.d.ts.map +1 -0
- package/dist/CheckBox/index.js +32 -0
- package/dist/Checkbox-2cb33932.js +199 -0
- package/dist/Chip/index.d.ts +3 -0
- package/dist/Chip/index.d.ts.map +1 -0
- package/dist/Chip/index.js +61 -0
- package/dist/Chip-7b1a25ce.js +444 -0
- package/dist/CircularProgress-2c55d9ef.js +217 -0
- package/dist/Close-ef7a3b6b.js +9 -0
- package/dist/CodeEditor/index.d.ts +2 -0
- package/dist/CodeEditor/index.d.ts.map +1 -0
- package/dist/CodeEditor/index.js +559 -0
- package/dist/Collapse/index.d.ts +3 -0
- package/dist/Collapse/index.d.ts.map +1 -0
- package/dist/Collapse/index.js +23 -0
- package/dist/Collapse-4b8b3146.js +299 -0
- package/dist/CopyToClipboard/index.d.ts +3 -0
- package/dist/CopyToClipboard/index.d.ts.map +1 -0
- package/dist/CopyToClipboard/index.js +591 -0
- package/dist/Dialog-25ebaee6.js +356 -0
- package/dist/Divider/index.d.ts +4 -0
- package/dist/Divider/index.d.ts.map +1 -0
- package/dist/Divider/index.js +31 -0
- package/dist/Divider-cadf67a7.js +231 -0
- package/dist/DropZone/index.d.ts +2 -0
- package/dist/DropZone/index.d.ts.map +1 -0
- package/dist/DropZone/index.js +1348 -0
- package/dist/Fade-aabbd0cb.js +163 -0
- package/dist/FormControl/index.d.ts +5 -0
- package/dist/FormControl/index.d.ts.map +1 -0
- package/dist/FormControl/index.js +24 -0
- package/dist/FormControl-e7294bde.js +232 -0
- package/dist/FormControlLabel-276f1b1e.js +214 -0
- package/dist/FullScreenDialog/index.d.ts +3 -0
- package/dist/FullScreenDialog/index.d.ts.map +1 -0
- package/dist/FullScreenDialog/index.js +42 -0
- package/dist/Grid/index.d.ts +3 -0
- package/dist/Grid/index.d.ts.map +1 -0
- package/dist/Grid/index.js +17 -0
- package/dist/Grid-c1f5fe6b.js +486 -0
- package/dist/Grow-151a20f6.js +193 -0
- package/dist/HTMLElementType-ff213f3c.js +9 -0
- package/dist/IconButton-fdbca6d2.js +184 -0
- package/dist/Input/index.d.ts +7 -0
- package/dist/Input/index.d.ts.map +1 -0
- package/dist/Input/index.js +88 -0
- package/dist/InputAdornment-3334ace2.js +155 -0
- package/dist/KdpaAutoComplete-40e0949e.js +8 -0
- package/dist/KdpaCollapse-d9e37824.js +11 -0
- package/dist/KdpaFormControl-2d7c1db8.js +6 -0
- package/dist/KdpaIconButton-514e0d96.js +23 -0
- package/dist/KdpaMenuItem-085f686f.js +36 -0
- package/dist/KdpaSecondaryButton-14992523.js +25 -0
- package/dist/KeyboardArrowRight-14dbe7d6.js +12 -0
- package/dist/LazyDrop/index.d.ts +3 -0
- package/dist/LazyDrop/index.d.ts.map +1 -0
- package/dist/LazyDrop/index.js +839 -0
- package/dist/ListContext-de5072f9.js +7 -0
- package/dist/ListItem-2b5c2e20.js +426 -0
- package/dist/ListItemText-fcd66149.js +150 -0
- package/dist/Loading/KdpaProgress/index.d.ts +3 -0
- package/dist/Loading/KdpaProgress/index.d.ts.map +1 -0
- package/dist/Loading/KdpaProgress/index.js +56 -0
- package/dist/Loading/index.d.ts +6 -0
- package/dist/Loading/index.d.ts.map +1 -0
- package/dist/Loading/index.js +348 -0
- package/dist/MenuItem-cc037c5b.js +240 -0
- package/dist/Modal/index.d.ts +2 -0
- package/dist/Modal/index.d.ts.map +1 -0
- package/dist/Modal/index.js +751 -0
- package/dist/Modal-5f23fcfd.js +984 -0
- package/dist/PaginationGrid/index.d.ts +3 -0
- package/dist/PaginationGrid/index.d.ts.map +1 -0
- package/dist/PaginationGrid/index.js +60 -0
- package/dist/Paper-aaec61a3.js +163 -0
- package/dist/Pickers/index.d.ts +7 -0
- package/dist/Pickers/index.d.ts.map +1 -0
- package/dist/Pickers/index.js +14408 -0
- package/dist/Popper-490e6477.js +490 -0
- package/dist/Portal-b4f8657f.js +77 -0
- package/dist/Radio/index.d.ts +5 -0
- package/dist/Radio/index.d.ts.map +1 -0
- package/dist/Radio/index.js +431 -0
- package/dist/Segment/index.d.ts +3 -0
- package/dist/Segment/index.d.ts.map +1 -0
- package/dist/Segment/index.js +84 -0
- package/dist/Selects/index.d.ts +7 -0
- package/dist/Selects/index.d.ts.map +1 -0
- package/dist/Selects/index.js +66 -0
- package/dist/SimpleList/index.d.ts +2 -0
- package/dist/SimpleList/index.d.ts.map +1 -0
- package/dist/SimpleList/index.js +1913 -0
- package/dist/Skeleton-263b2beb.js +213 -0
- package/dist/Slide-3bc7a346.js +227 -0
- package/dist/Slider/index.d.ts +3 -0
- package/dist/Slider/index.d.ts.map +1 -0
- package/dist/Slider/index.js +1322 -0
- package/dist/SweetAlerts/index.d.ts +6 -0
- package/dist/SweetAlerts/index.d.ts.map +1 -0
- package/dist/SweetAlerts/index.js +1540 -0
- package/dist/Switch/index.d.ts +3 -0
- package/dist/Switch/index.d.ts.map +1 -0
- package/dist/Switch/index.js +39 -0
- package/dist/Switch-ef584fc0.js +302 -0
- package/dist/SwitchBase-c367ca3c.js +231 -0
- package/dist/Tabs/index.d.ts +5 -0
- package/dist/Tabs/index.d.ts.map +1 -0
- package/dist/Tabs/index.js +63 -0
- package/dist/Tabs-9775b0bb.js +1084 -0
- package/dist/TextField-b8c731e8.js +4439 -0
- package/dist/ThemeProvider/index.d.ts +4 -0
- package/dist/ThemeProvider/index.d.ts.map +1 -0
- package/dist/ThemeProvider/index.js +294 -0
- package/dist/Tooltip-4b1baf1b.js +584 -0
- package/dist/Tooltips/index.d.ts +3 -0
- package/dist/Tooltips/index.d.ts.map +1 -0
- package/dist/Tooltips/index.js +46 -0
- package/dist/TransitionGroup-196acb6a.js +185 -0
- package/dist/TransitionGroupContext-7435e195.js +10 -0
- package/dist/Transitions/index.d.ts +11 -0
- package/dist/Transitions/index.d.ts.map +1 -0
- package/dist/Transitions/index.js +34 -0
- package/dist/Tree/index.d.ts +3 -0
- package/dist/Tree/index.d.ts.map +1 -0
- package/dist/Tree/index.js +1447 -0
- package/dist/TreeSelect/index.d.ts +3 -0
- package/dist/TreeSelect/index.d.ts.map +1 -0
- package/dist/TreeSelect/index.js +6888 -0
- package/dist/Typography/index.d.ts +3 -0
- package/dist/Typography/index.d.ts.map +1 -0
- package/dist/Typography/index.js +14 -0
- package/dist/Typography-dfa51fea.js +176 -0
- package/dist/Uploader/index.d.ts +3 -0
- package/dist/Uploader/index.d.ts.map +1 -0
- package/dist/Uploader/index.js +81 -0
- package/dist/Zoom-b84bdc2b.js +163 -0
- package/dist/_commonjsHelpers-92157f1b.js +36 -0
- package/dist/assertThisInitialized-05701a63.js +8 -0
- package/dist/chainPropTypes-004bf492.js +8 -0
- package/dist/createChainedFunction-68e2a88d.js +9 -0
- package/dist/createSvgIcon-b80a8a41.js +182 -0
- package/dist/dividerClasses-99758da7.js +10 -0
- package/dist/elementAcceptingRef-803dfd80.js +26 -0
- package/dist/elementTypeAcceptingRef-6c34f16b.js +23 -0
- package/dist/emotion-is-prop-valid.esm-b7f48706.js +191 -0
- package/dist/emotion-memoize.esm-021d0d4e.js +9 -0
- package/dist/emotion-react.browser.esm-d563ed65.js +255 -0
- package/dist/exactProp-3aaa3ecc.js +13 -0
- package/dist/extendSxProp-f7714a31.js +30 -0
- package/dist/extends-393586f3.js +22 -0
- package/dist/formControlState-9148c46f.js +10 -0
- package/dist/hoist-non-react-statics.cjs-ce2f2873.js +236 -0
- package/dist/iconBase-800b43ff.js +63 -0
- package/dist/identifier-9dfe30d8.js +3320 -0
- package/dist/index-116f732f.js +749 -0
- package/dist/index-7e2d793d.js +12011 -0
- package/dist/index-fa965a10.js +43 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm-b78383d3.js +35 -0
- package/dist/isMuiElement-b88a921a.js +7 -0
- package/dist/jsx-runtime-944c88e2.js +631 -0
- package/dist/kdpaSelect-4ed993c7.js +1 -0
- package/dist/listItemTextClasses-d6839c02.js +10 -0
- package/dist/ownerDocument-5430cd5b.js +6 -0
- package/dist/ownerWindow-e6cc3097.js +20 -0
- package/dist/popper-78c6b162.js +1006 -0
- package/dist/refType-af1a9f54.js +5 -0
- package/dist/setPrototypeOf-98a00546.js +8 -0
- package/dist/style.css +1 -0
- package/dist/toPropertyKey-e295cd73.js +27 -0
- package/dist/types/designerKit/components/GridPanel/PanelWrapper.d.ts +1 -1
- package/dist/types/designerKit/components/GridPanel/PanelWrapper.d.ts.map +1 -1
- package/dist/types/designerKit/components/Uploader/KdAdvanceFileUploader/DroppedFiles.d.ts.map +1 -1
- package/dist/types/designerKit/components/Uploader/KdFileUploader/UploadedItems.d.ts.map +1 -1
- package/dist/types/designerKit/utils/typographyHelper.d.ts +1 -2
- package/dist/types/designerKit/utils/typographyHelper.d.ts.map +1 -1
- package/dist/unsupportedProp-3dbf01f6.js +9 -0
- package/dist/useControlled-cc2d41cb.js +31 -0
- package/dist/useEventCallback-fe4fd69c.js +16 -0
- package/dist/useForkRef-0781dda0.js +15 -0
- package/dist/useFormControl-af690c26.js +11 -0
- package/dist/useId-e7dff7be.js +19 -0
- package/dist/useIsFocusVisible-4693b580.js +68 -0
- package/dist/usePreviousProps-c1ae4548.js +10 -0
- package/dist/useSlotProps-f238319f.js +74 -0
- package/dist/useTheme-014a54ad.js +10 -0
- package/dist/useThemeProps-7d04a175.js +513 -0
- package/dist/utils-129661c6.js +370 -0
- package/package.json +1 -1
- package/dist/types/designerKit/components/Alert/Temp.d.ts +0 -3
- package/dist/types/designerKit/components/Alert/Temp.d.ts.map +0 -1
- package/dist/types/designerKit/components/Form/KdFormField/KdpaFormField.d.ts +0 -12
- package/dist/types/designerKit/components/Form/KdFormField/KdpaFormField.d.ts.map +0 -1
- package/dist/types/designerKit/components/Tree/useKdTreeHelper.d.ts +0 -5
- package/dist/types/designerKit/components/Tree/useKdTreeHelper.d.ts.map +0 -1
- package/dist/types/designerKit/components/Uploader/KdAdvanceFileUploader/DroppingFiles.d.ts +0 -9
- package/dist/types/designerKit/components/Uploader/KdAdvanceFileUploader/DroppingFiles.d.ts.map +0 -1
- package/dist/types/designerKit/components/Uploader/KdUseFileUpload/KdUseFileUpload.d.ts +0 -53
- package/dist/types/designerKit/components/Uploader/KdUseFileUpload/KdUseFileUpload.d.ts.map +0 -1
- package/dist/types/designerKit/utils/fileUtils.d.ts +0 -19
- package/dist/types/designerKit/utils/fileUtils.d.ts.map +0 -1
- package/dist/types/designerKit/utils/useTreeHelper.d.ts +0 -17
- package/dist/types/designerKit/utils/useTreeHelper.d.ts.map +0 -1
|
@@ -0,0 +1,591 @@
|
|
|
1
|
+
import { j as M } from "../jsx-runtime-944c88e2.js";
|
|
2
|
+
import v, { forwardRef as Pe, useEffect as F, useReducer as Re, useState as ee, useRef as H, isValidElement as Q, cloneElement as ce, useLayoutEffect as Ne } from "react";
|
|
3
|
+
import { c as S } from "../useThemeProps-7d04a175.js";
|
|
4
|
+
import { M as Le } from "../index.esm-b78383d3.js";
|
|
5
|
+
import { KdpaTooltip as De } from "../Tooltips/index.js";
|
|
6
|
+
import { K as ke } from "../KdpaSecondaryButton-14992523.js";
|
|
7
|
+
import { I as Me } from "../IconButton-fdbca6d2.js";
|
|
8
|
+
import "../identifier-9dfe30d8.js";
|
|
9
|
+
import "../emotion-memoize.esm-021d0d4e.js";
|
|
10
|
+
import "../extends-393586f3.js";
|
|
11
|
+
import "../_commonjsHelpers-92157f1b.js";
|
|
12
|
+
import "../emotion-is-prop-valid.esm-b7f48706.js";
|
|
13
|
+
import "../iconBase-800b43ff.js";
|
|
14
|
+
import "../Tooltip-4b1baf1b.js";
|
|
15
|
+
import "../useTheme-014a54ad.js";
|
|
16
|
+
import "../Popper-490e6477.js";
|
|
17
|
+
import "../Portal-b4f8657f.js";
|
|
18
|
+
import "react-dom";
|
|
19
|
+
import "../useForkRef-0781dda0.js";
|
|
20
|
+
import "../useEventCallback-fe4fd69c.js";
|
|
21
|
+
import "../HTMLElementType-ff213f3c.js";
|
|
22
|
+
import "../exactProp-3aaa3ecc.js";
|
|
23
|
+
import "../ownerDocument-5430cd5b.js";
|
|
24
|
+
import "../chainPropTypes-004bf492.js";
|
|
25
|
+
import "../refType-af1a9f54.js";
|
|
26
|
+
import "../popper-78c6b162.js";
|
|
27
|
+
import "../useSlotProps-f238319f.js";
|
|
28
|
+
import "../useControlled-cc2d41cb.js";
|
|
29
|
+
import "../useId-e7dff7be.js";
|
|
30
|
+
import "../useIsFocusVisible-4693b580.js";
|
|
31
|
+
import "../Grow-151a20f6.js";
|
|
32
|
+
import "../utils-129661c6.js";
|
|
33
|
+
import "../TransitionGroupContext-7435e195.js";
|
|
34
|
+
import "../setPrototypeOf-98a00546.js";
|
|
35
|
+
import "../elementAcceptingRef-803dfd80.js";
|
|
36
|
+
import "../Zoom-b84bdc2b.js";
|
|
37
|
+
import "../Button-b93e890d.js";
|
|
38
|
+
import "../ButtonBase-0f9f324d.js";
|
|
39
|
+
import "../emotion-react.browser.esm-d563ed65.js";
|
|
40
|
+
import "../hoist-non-react-statics.cjs-ce2f2873.js";
|
|
41
|
+
import "../TransitionGroup-196acb6a.js";
|
|
42
|
+
import "../assertThisInitialized-05701a63.js";
|
|
43
|
+
import "../elementTypeAcceptingRef-6c34f16b.js";
|
|
44
|
+
const W = (e) => typeof e == "number" && !isNaN(e), q = (e) => typeof e == "string", w = (e) => typeof e == "function", Z = (e) => q(e) || w(e) ? e : null, ie = (e) => Q(e) || q(e) || w(e) || W(e);
|
|
45
|
+
function Se(e, t, n) {
|
|
46
|
+
n === void 0 && (n = 300);
|
|
47
|
+
const { scrollHeight: o, style: a } = e;
|
|
48
|
+
requestAnimationFrame(() => {
|
|
49
|
+
a.minHeight = "initial", a.height = o + "px", a.transition = `all ${n}ms`, requestAnimationFrame(() => {
|
|
50
|
+
a.height = "0", a.padding = "0", a.margin = "0", setTimeout(t, n);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function oe(e) {
|
|
55
|
+
let { enter: t, exit: n, appendPosition: o = !1, collapse: a = !0, collapseDuration: s = 300 } = e;
|
|
56
|
+
return function(r) {
|
|
57
|
+
let { children: i, position: y, preventExitTransition: g, done: u, nodeRef: f, isIn: E } = r;
|
|
58
|
+
const l = o ? `${t}--${y}` : t, d = o ? `${n}--${y}` : n, m = H(0);
|
|
59
|
+
return Ne(() => {
|
|
60
|
+
const c = f.current, p = l.split(" "), C = (_) => {
|
|
61
|
+
_.target === f.current && (c.dispatchEvent(new Event("d")), c.removeEventListener("animationend", C), c.removeEventListener("animationcancel", C), m.current === 0 && _.type !== "animationcancel" && c.classList.remove(...p));
|
|
62
|
+
};
|
|
63
|
+
c.classList.add(...p), c.addEventListener("animationend", C), c.addEventListener("animationcancel", C);
|
|
64
|
+
}, []), F(() => {
|
|
65
|
+
const c = f.current, p = () => {
|
|
66
|
+
c.removeEventListener("animationend", p), a ? Se(c, u, s) : u();
|
|
67
|
+
};
|
|
68
|
+
E || (g ? p() : (m.current = 1, c.className += ` ${d}`, c.addEventListener("animationend", p)));
|
|
69
|
+
}, [E]), v.createElement(v.Fragment, null, i);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function me(e, t) {
|
|
73
|
+
return { content: e.content, containerId: e.props.containerId, id: e.props.toastId, theme: e.props.theme, type: e.props.type, data: e.props.data || {}, isLoading: e.props.isLoading, icon: e.props.icon, status: t };
|
|
74
|
+
}
|
|
75
|
+
const R = { list: /* @__PURE__ */ new Map(), emitQueue: /* @__PURE__ */ new Map(), on(e, t) {
|
|
76
|
+
return this.list.has(e) || this.list.set(e, []), this.list.get(e).push(t), this;
|
|
77
|
+
}, off(e, t) {
|
|
78
|
+
if (t) {
|
|
79
|
+
const n = this.list.get(e).filter((o) => o !== t);
|
|
80
|
+
return this.list.set(e, n), this;
|
|
81
|
+
}
|
|
82
|
+
return this.list.delete(e), this;
|
|
83
|
+
}, cancelEmit(e) {
|
|
84
|
+
const t = this.emitQueue.get(e);
|
|
85
|
+
return t && (t.forEach(clearTimeout), this.emitQueue.delete(e)), this;
|
|
86
|
+
}, emit(e) {
|
|
87
|
+
this.list.has(e) && this.list.get(e).forEach((t) => {
|
|
88
|
+
const n = setTimeout(() => {
|
|
89
|
+
t(...[].slice.call(arguments, 1));
|
|
90
|
+
}, 0);
|
|
91
|
+
this.emitQueue.has(e) || this.emitQueue.set(e, []), this.emitQueue.get(e).push(n);
|
|
92
|
+
});
|
|
93
|
+
} }, Y = (e) => {
|
|
94
|
+
let { theme: t, type: n, ...o } = e;
|
|
95
|
+
return v.createElement("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", fill: t === "colored" ? "currentColor" : `var(--toastify-icon-color-${n})`, ...o });
|
|
96
|
+
}, se = { info: function(e) {
|
|
97
|
+
return v.createElement(Y, { ...e }, v.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" }));
|
|
98
|
+
}, warning: function(e) {
|
|
99
|
+
return v.createElement(Y, { ...e }, v.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" }));
|
|
100
|
+
}, success: function(e) {
|
|
101
|
+
return v.createElement(Y, { ...e }, v.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" }));
|
|
102
|
+
}, error: function(e) {
|
|
103
|
+
return v.createElement(Y, { ...e }, v.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" }));
|
|
104
|
+
}, spinner: function() {
|
|
105
|
+
return v.createElement("div", { className: "Toastify__spinner" });
|
|
106
|
+
} };
|
|
107
|
+
function je(e) {
|
|
108
|
+
const [, t] = Re((l) => l + 1, 0), [n, o] = ee([]), a = H(null), s = H(/* @__PURE__ */ new Map()).current, r = (l) => n.indexOf(l) !== -1, i = H({ toastKey: 1, displayedToast: 0, count: 0, queue: [], props: e, containerId: null, isToastActive: r, getToast: (l) => s.get(l) }).current;
|
|
109
|
+
function y(l) {
|
|
110
|
+
let { containerId: d } = l;
|
|
111
|
+
const { limit: m } = i.props;
|
|
112
|
+
!m || d && i.containerId !== d || (i.count -= i.queue.length, i.queue = []);
|
|
113
|
+
}
|
|
114
|
+
function g(l) {
|
|
115
|
+
o((d) => l == null ? [] : d.filter((m) => m !== l));
|
|
116
|
+
}
|
|
117
|
+
function u() {
|
|
118
|
+
const { toastContent: l, toastProps: d, staleId: m } = i.queue.shift();
|
|
119
|
+
E(l, d, m);
|
|
120
|
+
}
|
|
121
|
+
function f(l, d) {
|
|
122
|
+
let { delay: m, staleId: c, ...p } = d;
|
|
123
|
+
if (!ie(l) || function(P) {
|
|
124
|
+
return !a.current || i.props.enableMultiContainer && P.containerId !== i.props.containerId || s.has(P.toastId) && P.updateId == null;
|
|
125
|
+
}(p))
|
|
126
|
+
return;
|
|
127
|
+
const { toastId: C, updateId: _, data: h } = p, { props: b } = i, D = () => g(C), k = _ == null;
|
|
128
|
+
k && i.count++;
|
|
129
|
+
const O = { ...b, style: b.toastStyle, key: i.toastKey++, ...Object.fromEntries(Object.entries(p).filter((P) => {
|
|
130
|
+
let [N, I] = P;
|
|
131
|
+
return I != null;
|
|
132
|
+
})), toastId: C, updateId: _, data: h, closeToast: D, isIn: !1, className: Z(p.className || b.toastClassName), bodyClassName: Z(p.bodyClassName || b.bodyClassName), progressClassName: Z(p.progressClassName || b.progressClassName), autoClose: !p.isLoading && (j = p.autoClose, U = b.autoClose, j === !1 || W(j) && j > 0 ? j : U), deleteToast() {
|
|
133
|
+
const P = me(s.get(C), "removed");
|
|
134
|
+
s.delete(C), R.emit(4, P);
|
|
135
|
+
const N = i.queue.length;
|
|
136
|
+
if (i.count = C == null ? i.count - i.displayedToast : i.count - 1, i.count < 0 && (i.count = 0), N > 0) {
|
|
137
|
+
const I = C == null ? i.props.limit : 1;
|
|
138
|
+
if (N === 1 || I === 1)
|
|
139
|
+
i.displayedToast++, u();
|
|
140
|
+
else {
|
|
141
|
+
const A = I > N ? N : I;
|
|
142
|
+
i.displayedToast = A;
|
|
143
|
+
for (let x = 0; x < A; x++)
|
|
144
|
+
u();
|
|
145
|
+
}
|
|
146
|
+
} else
|
|
147
|
+
t();
|
|
148
|
+
} };
|
|
149
|
+
var j, U;
|
|
150
|
+
O.iconOut = function(P) {
|
|
151
|
+
let { theme: N, type: I, isLoading: A, icon: x } = P, L = null;
|
|
152
|
+
const $ = { theme: N, type: I };
|
|
153
|
+
return x === !1 || (w(x) ? L = x($) : Q(x) ? L = ce(x, $) : q(x) || W(x) ? L = x : A ? L = se.spinner() : ((G) => G in se)(I) && (L = se[I]($))), L;
|
|
154
|
+
}(O), w(p.onOpen) && (O.onOpen = p.onOpen), w(p.onClose) && (O.onClose = p.onClose), O.closeButton = b.closeButton, p.closeButton === !1 || ie(p.closeButton) ? O.closeButton = p.closeButton : p.closeButton === !0 && (O.closeButton = !ie(b.closeButton) || b.closeButton);
|
|
155
|
+
let B = l;
|
|
156
|
+
Q(l) && !q(l.type) ? B = ce(l, { closeToast: D, toastProps: O, data: h }) : w(l) && (B = l({ closeToast: D, toastProps: O, data: h })), b.limit && b.limit > 0 && i.count > b.limit && k ? i.queue.push({ toastContent: B, toastProps: O, staleId: c }) : W(m) ? setTimeout(() => {
|
|
157
|
+
E(B, O, c);
|
|
158
|
+
}, m) : E(B, O, c);
|
|
159
|
+
}
|
|
160
|
+
function E(l, d, m) {
|
|
161
|
+
const { toastId: c } = d;
|
|
162
|
+
m && s.delete(m);
|
|
163
|
+
const p = { content: l, props: d };
|
|
164
|
+
s.set(c, p), o((C) => [...C, c].filter((_) => _ !== m)), R.emit(4, me(p, p.props.updateId == null ? "added" : "updated"));
|
|
165
|
+
}
|
|
166
|
+
return F(() => (i.containerId = e.containerId, R.cancelEmit(3).on(0, f).on(1, (l) => a.current && g(l)).on(5, y).emit(2, i), () => {
|
|
167
|
+
s.clear(), R.emit(3, i);
|
|
168
|
+
}), []), F(() => {
|
|
169
|
+
i.props = e, i.isToastActive = r, i.displayedToast = n.length;
|
|
170
|
+
}), { getToastToRender: function(l) {
|
|
171
|
+
const d = /* @__PURE__ */ new Map(), m = Array.from(s.values());
|
|
172
|
+
return e.newestOnTop && m.reverse(), m.forEach((c) => {
|
|
173
|
+
const { position: p } = c.props;
|
|
174
|
+
d.has(p) || d.set(p, []), d.get(p).push(c);
|
|
175
|
+
}), Array.from(d, (c) => l(c[0], c[1]));
|
|
176
|
+
}, containerRef: a, isToastActive: r };
|
|
177
|
+
}
|
|
178
|
+
function ye(e) {
|
|
179
|
+
return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientX : e.clientX;
|
|
180
|
+
}
|
|
181
|
+
function ge(e) {
|
|
182
|
+
return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientY : e.clientY;
|
|
183
|
+
}
|
|
184
|
+
function Be(e) {
|
|
185
|
+
const [t, n] = ee(!1), [o, a] = ee(!1), s = H(null), r = H({ start: 0, x: 0, y: 0, delta: 0, removalDistance: 0, canCloseOnClick: !0, canDrag: !1, boundingRect: null, didMove: !1 }).current, i = H(e), { autoClose: y, pauseOnHover: g, closeToast: u, onClick: f, closeOnClick: E } = e;
|
|
186
|
+
function l(h) {
|
|
187
|
+
if (e.draggable) {
|
|
188
|
+
h.nativeEvent.type === "touchstart" && h.nativeEvent.preventDefault(), r.didMove = !1, document.addEventListener("mousemove", p), document.addEventListener("mouseup", C), document.addEventListener("touchmove", p), document.addEventListener("touchend", C);
|
|
189
|
+
const b = s.current;
|
|
190
|
+
r.canCloseOnClick = !0, r.canDrag = !0, r.boundingRect = b.getBoundingClientRect(), b.style.transition = "", r.x = ye(h.nativeEvent), r.y = ge(h.nativeEvent), e.draggableDirection === "x" ? (r.start = r.x, r.removalDistance = b.offsetWidth * (e.draggablePercent / 100)) : (r.start = r.y, r.removalDistance = b.offsetHeight * (e.draggablePercent === 80 ? 1.5 * e.draggablePercent : e.draggablePercent / 100));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function d(h) {
|
|
194
|
+
if (r.boundingRect) {
|
|
195
|
+
const { top: b, bottom: D, left: k, right: O } = r.boundingRect;
|
|
196
|
+
h.nativeEvent.type !== "touchend" && e.pauseOnHover && r.x >= k && r.x <= O && r.y >= b && r.y <= D ? c() : m();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
function m() {
|
|
200
|
+
n(!0);
|
|
201
|
+
}
|
|
202
|
+
function c() {
|
|
203
|
+
n(!1);
|
|
204
|
+
}
|
|
205
|
+
function p(h) {
|
|
206
|
+
const b = s.current;
|
|
207
|
+
r.canDrag && b && (r.didMove = !0, t && c(), r.x = ye(h), r.y = ge(h), r.delta = e.draggableDirection === "x" ? r.x - r.start : r.y - r.start, r.start !== r.x && (r.canCloseOnClick = !1), b.style.transform = `translate${e.draggableDirection}(${r.delta}px)`, b.style.opacity = "" + (1 - Math.abs(r.delta / r.removalDistance)));
|
|
208
|
+
}
|
|
209
|
+
function C() {
|
|
210
|
+
document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", C), document.removeEventListener("touchmove", p), document.removeEventListener("touchend", C);
|
|
211
|
+
const h = s.current;
|
|
212
|
+
if (r.canDrag && r.didMove && h) {
|
|
213
|
+
if (r.canDrag = !1, Math.abs(r.delta) > r.removalDistance)
|
|
214
|
+
return a(!0), void e.closeToast();
|
|
215
|
+
h.style.transition = "transform 0.2s, opacity 0.2s", h.style.transform = `translate${e.draggableDirection}(0)`, h.style.opacity = "1";
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
F(() => {
|
|
219
|
+
i.current = e;
|
|
220
|
+
}), F(() => (s.current && s.current.addEventListener("d", m, { once: !0 }), w(e.onOpen) && e.onOpen(Q(e.children) && e.children.props), () => {
|
|
221
|
+
const h = i.current;
|
|
222
|
+
w(h.onClose) && h.onClose(Q(h.children) && h.children.props);
|
|
223
|
+
}), []), F(() => (e.pauseOnFocusLoss && (document.hasFocus() || c(), window.addEventListener("focus", m), window.addEventListener("blur", c)), () => {
|
|
224
|
+
e.pauseOnFocusLoss && (window.removeEventListener("focus", m), window.removeEventListener("blur", c));
|
|
225
|
+
}), [e.pauseOnFocusLoss]);
|
|
226
|
+
const _ = { onMouseDown: l, onTouchStart: l, onMouseUp: d, onTouchEnd: d };
|
|
227
|
+
return y && g && (_.onMouseEnter = c, _.onMouseLeave = m), E && (_.onClick = (h) => {
|
|
228
|
+
f && f(h), r.canCloseOnClick && u();
|
|
229
|
+
}), { playToast: m, pauseToast: c, isRunning: t, preventExitTransition: o, toastRef: s, eventHandlers: _ };
|
|
230
|
+
}
|
|
231
|
+
function Oe(e) {
|
|
232
|
+
let { closeToast: t, theme: n, ariaLabel: o = "close" } = e;
|
|
233
|
+
return v.createElement("button", { className: `Toastify__close-button Toastify__close-button--${n}`, type: "button", onClick: (a) => {
|
|
234
|
+
a.stopPropagation(), t(a);
|
|
235
|
+
}, "aria-label": o }, v.createElement("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, v.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" })));
|
|
236
|
+
}
|
|
237
|
+
function Ae(e) {
|
|
238
|
+
let { delay: t, isRunning: n, closeToast: o, type: a = "default", hide: s, className: r, style: i, controlledProgress: y, progress: g, rtl: u, isIn: f, theme: E } = e;
|
|
239
|
+
const l = s || y && g === 0, d = { ...i, animationDuration: `${t}ms`, animationPlayState: n ? "running" : "paused", opacity: l ? 0 : 1 };
|
|
240
|
+
y && (d.transform = `scaleX(${g})`);
|
|
241
|
+
const m = S("Toastify__progress-bar", y ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", `Toastify__progress-bar-theme--${E}`, `Toastify__progress-bar--${a}`, { "Toastify__progress-bar--rtl": u }), c = w(r) ? r({ rtl: u, type: a, defaultClassName: m }) : S(m, r);
|
|
242
|
+
return v.createElement("div", { role: "progressbar", "aria-hidden": l ? "true" : "false", "aria-label": "notification timer", className: c, style: d, [y && g >= 1 ? "onTransitionEnd" : "onAnimationEnd"]: y && g < 1 ? null : () => {
|
|
243
|
+
f && o();
|
|
244
|
+
} });
|
|
245
|
+
}
|
|
246
|
+
const $e = (e) => {
|
|
247
|
+
const { isRunning: t, preventExitTransition: n, toastRef: o, eventHandlers: a } = Be(e), { closeButton: s, children: r, autoClose: i, onClick: y, type: g, hideProgressBar: u, closeToast: f, transition: E, position: l, className: d, style: m, bodyClassName: c, bodyStyle: p, progressClassName: C, progressStyle: _, updateId: h, role: b, progress: D, rtl: k, toastId: O, deleteToast: j, isIn: U, isLoading: B, iconOut: P, closeOnClick: N, theme: I } = e, A = S("Toastify__toast", `Toastify__toast-theme--${I}`, `Toastify__toast--${g}`, { "Toastify__toast--rtl": k }, { "Toastify__toast--close-on-click": N }), x = w(d) ? d({ rtl: k, position: l, type: g, defaultClassName: A }) : S(A, d), L = !!D || !i, $ = { closeToast: f, type: g, theme: I };
|
|
248
|
+
let G = null;
|
|
249
|
+
return s === !1 || (G = w(s) ? s($) : Q(s) ? ce(s, $) : Oe($)), v.createElement(E, { isIn: U, done: j, position: l, preventExitTransition: n, nodeRef: o }, v.createElement("div", { id: O, onClick: y, className: x, ...a, style: m, ref: o }, v.createElement("div", { ...U && { role: b }, className: w(c) ? c({ type: g }) : S("Toastify__toast-body", c), style: p }, P != null && v.createElement("div", { className: S("Toastify__toast-icon", { "Toastify--animate-icon Toastify__zoom-enter": !B }) }, P), v.createElement("div", null, r)), G, v.createElement(Ae, { ...h && !L ? { key: `pb-${h}` } : {}, rtl: k, theme: I, delay: i, isRunning: t, isIn: U, closeToast: f, hide: u, type: g, style: _, className: C, controlledProgress: L, progress: D || 0 })));
|
|
250
|
+
}, re = function(e, t) {
|
|
251
|
+
return t === void 0 && (t = !1), { enter: `Toastify--animate Toastify__${e}-enter`, exit: `Toastify--animate Toastify__${e}-exit`, appendPosition: t };
|
|
252
|
+
}, ze = oe(re("bounce", !0));
|
|
253
|
+
oe(re("slide", !0));
|
|
254
|
+
oe(re("zoom"));
|
|
255
|
+
const Fe = oe(re("flip")), he = Pe((e, t) => {
|
|
256
|
+
const { getToastToRender: n, containerRef: o, isToastActive: a } = je(e), { className: s, style: r, rtl: i, containerId: y } = e;
|
|
257
|
+
function g(u) {
|
|
258
|
+
const f = S("Toastify__toast-container", `Toastify__toast-container--${u}`, { "Toastify__toast-container--rtl": i });
|
|
259
|
+
return w(s) ? s({ position: u, rtl: i, defaultClassName: f }) : S(f, Z(s));
|
|
260
|
+
}
|
|
261
|
+
return F(() => {
|
|
262
|
+
t && (t.current = o.current);
|
|
263
|
+
}, []), v.createElement("div", { ref: o, className: "Toastify", id: y }, n((u, f) => {
|
|
264
|
+
const E = f.length ? { ...r } : { ...r, pointerEvents: "none" };
|
|
265
|
+
return v.createElement("div", { className: g(u), style: E, key: `container-${u}` }, f.map((l, d) => {
|
|
266
|
+
let { content: m, props: c } = l;
|
|
267
|
+
return v.createElement($e, { ...c, isIn: a(c.toastId), style: { ...c.style, "--nth": d + 1, "--len": f.length }, key: `toast-${c.key}` }, m);
|
|
268
|
+
}));
|
|
269
|
+
}));
|
|
270
|
+
});
|
|
271
|
+
he.displayName = "ToastContainer", he.defaultProps = { position: "top-right", transition: ze, autoClose: 5e3, closeButton: Oe, pauseOnHover: !0, pauseOnFocusLoss: !0, closeOnClick: !0, draggable: !0, draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light" };
|
|
272
|
+
let le, z = /* @__PURE__ */ new Map(), K = [], He = 1;
|
|
273
|
+
function _e() {
|
|
274
|
+
return "" + He++;
|
|
275
|
+
}
|
|
276
|
+
function qe(e) {
|
|
277
|
+
return e && (q(e.toastId) || W(e.toastId)) ? e.toastId : _e();
|
|
278
|
+
}
|
|
279
|
+
function X(e, t) {
|
|
280
|
+
return z.size > 0 ? R.emit(0, e, t) : K.push({ content: e, options: t }), t.toastId;
|
|
281
|
+
}
|
|
282
|
+
function te(e, t) {
|
|
283
|
+
return { ...t, type: t && t.type || e, toastId: qe(t) };
|
|
284
|
+
}
|
|
285
|
+
function V(e) {
|
|
286
|
+
return (t, n) => X(t, te(e, n));
|
|
287
|
+
}
|
|
288
|
+
function T(e, t) {
|
|
289
|
+
return X(e, te("default", t));
|
|
290
|
+
}
|
|
291
|
+
T.loading = (e, t) => X(e, te("default", { isLoading: !0, autoClose: !1, closeOnClick: !1, closeButton: !1, draggable: !1, ...t })), T.promise = function(e, t, n) {
|
|
292
|
+
let o, { pending: a, error: s, success: r } = t;
|
|
293
|
+
a && (o = q(a) ? T.loading(a, n) : T.loading(a.render, { ...n, ...a }));
|
|
294
|
+
const i = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, y = (u, f, E) => {
|
|
295
|
+
if (f == null)
|
|
296
|
+
return void T.dismiss(o);
|
|
297
|
+
const l = { type: u, ...i, ...n, data: E }, d = q(f) ? { render: f } : f;
|
|
298
|
+
return o ? T.update(o, { ...l, ...d }) : T(d.render, { ...l, ...d }), E;
|
|
299
|
+
}, g = w(e) ? e() : e;
|
|
300
|
+
return g.then((u) => y("success", r, u)).catch((u) => y("error", s, u)), g;
|
|
301
|
+
}, T.success = V("success"), T.info = V("info"), T.error = V("error"), T.warning = V("warning"), T.warn = T.warning, T.dark = (e, t) => X(e, te("default", { theme: "dark", ...t })), T.dismiss = (e) => {
|
|
302
|
+
z.size > 0 ? R.emit(1, e) : K = K.filter((t) => e != null && t.options.toastId !== e);
|
|
303
|
+
}, T.clearWaitingQueue = function(e) {
|
|
304
|
+
return e === void 0 && (e = {}), R.emit(5, e);
|
|
305
|
+
}, T.isActive = (e) => {
|
|
306
|
+
let t = !1;
|
|
307
|
+
return z.forEach((n) => {
|
|
308
|
+
n.isToastActive && n.isToastActive(e) && (t = !0);
|
|
309
|
+
}), t;
|
|
310
|
+
}, T.update = function(e, t) {
|
|
311
|
+
t === void 0 && (t = {}), setTimeout(() => {
|
|
312
|
+
const n = function(o, a) {
|
|
313
|
+
let { containerId: s } = a;
|
|
314
|
+
const r = z.get(s || le);
|
|
315
|
+
return r && r.getToast(o);
|
|
316
|
+
}(e, t);
|
|
317
|
+
if (n) {
|
|
318
|
+
const { props: o, content: a } = n, s = { delay: 100, ...o, ...t, toastId: t.toastId || e, updateId: _e() };
|
|
319
|
+
s.toastId !== e && (s.staleId = e);
|
|
320
|
+
const r = s.render || a;
|
|
321
|
+
delete s.render, X(r, s);
|
|
322
|
+
}
|
|
323
|
+
}, 0);
|
|
324
|
+
}, T.done = (e) => {
|
|
325
|
+
T.update(e, { progress: 1 });
|
|
326
|
+
}, T.onChange = (e) => (R.on(4, e), () => {
|
|
327
|
+
R.off(4, e);
|
|
328
|
+
}), T.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" }, T.TYPE = { INFO: "info", SUCCESS: "success", WARNING: "warning", ERROR: "error", DEFAULT: "default" }, R.on(2, (e) => {
|
|
329
|
+
le = e.containerId || e, z.set(le, e), K.forEach((t) => {
|
|
330
|
+
R.emit(0, t.content, t.options);
|
|
331
|
+
}), K = [];
|
|
332
|
+
}).on(3, (e) => {
|
|
333
|
+
z.delete(e.containerId || e), z.size === 0 && R.off(0).off(1).off(5);
|
|
334
|
+
});
|
|
335
|
+
var ae = {}, Ue = function() {
|
|
336
|
+
var e = document.getSelection();
|
|
337
|
+
if (!e.rangeCount)
|
|
338
|
+
return function() {
|
|
339
|
+
};
|
|
340
|
+
for (var t = document.activeElement, n = [], o = 0; o < e.rangeCount; o++)
|
|
341
|
+
n.push(e.getRangeAt(o));
|
|
342
|
+
switch (t.tagName.toUpperCase()) {
|
|
343
|
+
case "INPUT":
|
|
344
|
+
case "TEXTAREA":
|
|
345
|
+
t.blur();
|
|
346
|
+
break;
|
|
347
|
+
default:
|
|
348
|
+
t = null;
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
return e.removeAllRanges(), function() {
|
|
352
|
+
e.type === "Caret" && e.removeAllRanges(), e.rangeCount || n.forEach(function(a) {
|
|
353
|
+
e.addRange(a);
|
|
354
|
+
}), t && t.focus();
|
|
355
|
+
};
|
|
356
|
+
}, Qe = Ue, ve = {
|
|
357
|
+
"text/plain": "Text",
|
|
358
|
+
"text/html": "Url",
|
|
359
|
+
default: "Text"
|
|
360
|
+
}, Ke = "Copy to clipboard: #{key}, Enter";
|
|
361
|
+
function We(e) {
|
|
362
|
+
var t = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
|
|
363
|
+
return e.replace(/#{\s*key\s*}/g, t);
|
|
364
|
+
}
|
|
365
|
+
function Xe(e, t) {
|
|
366
|
+
var n, o, a, s, r, i, y = !1;
|
|
367
|
+
t || (t = {}), n = t.debug || !1;
|
|
368
|
+
try {
|
|
369
|
+
a = Qe(), s = document.createRange(), r = document.getSelection(), i = document.createElement("span"), i.textContent = e, i.ariaHidden = "true", i.style.all = "unset", i.style.position = "fixed", i.style.top = 0, i.style.clip = "rect(0, 0, 0, 0)", i.style.whiteSpace = "pre", i.style.webkitUserSelect = "text", i.style.MozUserSelect = "text", i.style.msUserSelect = "text", i.style.userSelect = "text", i.addEventListener("copy", function(u) {
|
|
370
|
+
if (u.stopPropagation(), t.format)
|
|
371
|
+
if (u.preventDefault(), typeof u.clipboardData > "u") {
|
|
372
|
+
n && console.warn("unable to use e.clipboardData"), n && console.warn("trying IE specific stuff"), window.clipboardData.clearData();
|
|
373
|
+
var f = ve[t.format] || ve.default;
|
|
374
|
+
window.clipboardData.setData(f, e);
|
|
375
|
+
} else
|
|
376
|
+
u.clipboardData.clearData(), u.clipboardData.setData(t.format, e);
|
|
377
|
+
t.onCopy && (u.preventDefault(), t.onCopy(u.clipboardData));
|
|
378
|
+
}), document.body.appendChild(i), s.selectNodeContents(i), r.addRange(s);
|
|
379
|
+
var g = document.execCommand("copy");
|
|
380
|
+
if (!g)
|
|
381
|
+
throw new Error("copy command was unsuccessful");
|
|
382
|
+
y = !0;
|
|
383
|
+
} catch (u) {
|
|
384
|
+
n && console.error("unable to copy using execCommand: ", u), n && console.warn("trying IE specific stuff");
|
|
385
|
+
try {
|
|
386
|
+
window.clipboardData.setData(t.format || "text", e), t.onCopy && t.onCopy(window.clipboardData), y = !0;
|
|
387
|
+
} catch (f) {
|
|
388
|
+
n && console.error("unable to copy using clipboardData: ", f), n && console.error("falling back to prompt"), o = We("message" in t ? t.message : Ke), window.prompt(o, e);
|
|
389
|
+
}
|
|
390
|
+
} finally {
|
|
391
|
+
r && (typeof r.removeRange == "function" ? r.removeRange(s) : r.removeAllRanges()), i && document.body.removeChild(i), a();
|
|
392
|
+
}
|
|
393
|
+
return y;
|
|
394
|
+
}
|
|
395
|
+
var Ge = Xe;
|
|
396
|
+
function ue(e) {
|
|
397
|
+
return ue = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
398
|
+
return typeof t;
|
|
399
|
+
} : function(t) {
|
|
400
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
401
|
+
}, ue(e);
|
|
402
|
+
}
|
|
403
|
+
Object.defineProperty(ae, "__esModule", {
|
|
404
|
+
value: !0
|
|
405
|
+
});
|
|
406
|
+
ae.CopyToClipboard = void 0;
|
|
407
|
+
var J = we(v), Ye = we(Ge), Ve = ["text", "onCopy", "options", "children"];
|
|
408
|
+
function we(e) {
|
|
409
|
+
return e && e.__esModule ? e : { default: e };
|
|
410
|
+
}
|
|
411
|
+
function be(e, t) {
|
|
412
|
+
var n = Object.keys(e);
|
|
413
|
+
if (Object.getOwnPropertySymbols) {
|
|
414
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
415
|
+
t && (o = o.filter(function(a) {
|
|
416
|
+
return Object.getOwnPropertyDescriptor(e, a).enumerable;
|
|
417
|
+
})), n.push.apply(n, o);
|
|
418
|
+
}
|
|
419
|
+
return n;
|
|
420
|
+
}
|
|
421
|
+
function Te(e) {
|
|
422
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
423
|
+
var n = arguments[t] != null ? arguments[t] : {};
|
|
424
|
+
t % 2 ? be(Object(n), !0).forEach(function(o) {
|
|
425
|
+
fe(e, o, n[o]);
|
|
426
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : be(Object(n)).forEach(function(o) {
|
|
427
|
+
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(n, o));
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
return e;
|
|
431
|
+
}
|
|
432
|
+
function Je(e, t) {
|
|
433
|
+
if (e == null)
|
|
434
|
+
return {};
|
|
435
|
+
var n = Ze(e, t), o, a;
|
|
436
|
+
if (Object.getOwnPropertySymbols) {
|
|
437
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
438
|
+
for (a = 0; a < s.length; a++)
|
|
439
|
+
o = s[a], !(t.indexOf(o) >= 0) && Object.prototype.propertyIsEnumerable.call(e, o) && (n[o] = e[o]);
|
|
440
|
+
}
|
|
441
|
+
return n;
|
|
442
|
+
}
|
|
443
|
+
function Ze(e, t) {
|
|
444
|
+
if (e == null)
|
|
445
|
+
return {};
|
|
446
|
+
var n = {}, o = Object.keys(e), a, s;
|
|
447
|
+
for (s = 0; s < o.length; s++)
|
|
448
|
+
a = o[s], !(t.indexOf(a) >= 0) && (n[a] = e[a]);
|
|
449
|
+
return n;
|
|
450
|
+
}
|
|
451
|
+
function et(e, t) {
|
|
452
|
+
if (!(e instanceof t))
|
|
453
|
+
throw new TypeError("Cannot call a class as a function");
|
|
454
|
+
}
|
|
455
|
+
function Ce(e, t) {
|
|
456
|
+
for (var n = 0; n < t.length; n++) {
|
|
457
|
+
var o = t[n];
|
|
458
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, o.key, o);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
function tt(e, t, n) {
|
|
462
|
+
return t && Ce(e.prototype, t), n && Ce(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
463
|
+
}
|
|
464
|
+
function nt(e, t) {
|
|
465
|
+
if (typeof t != "function" && t !== null)
|
|
466
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
467
|
+
e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && pe(e, t);
|
|
468
|
+
}
|
|
469
|
+
function pe(e, t) {
|
|
470
|
+
return pe = Object.setPrototypeOf || function(o, a) {
|
|
471
|
+
return o.__proto__ = a, o;
|
|
472
|
+
}, pe(e, t);
|
|
473
|
+
}
|
|
474
|
+
function ot(e) {
|
|
475
|
+
var t = at();
|
|
476
|
+
return function() {
|
|
477
|
+
var o = ne(e), a;
|
|
478
|
+
if (t) {
|
|
479
|
+
var s = ne(this).constructor;
|
|
480
|
+
a = Reflect.construct(o, arguments, s);
|
|
481
|
+
} else
|
|
482
|
+
a = o.apply(this, arguments);
|
|
483
|
+
return rt(this, a);
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
function rt(e, t) {
|
|
487
|
+
if (t && (ue(t) === "object" || typeof t == "function"))
|
|
488
|
+
return t;
|
|
489
|
+
if (t !== void 0)
|
|
490
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
491
|
+
return Ie(e);
|
|
492
|
+
}
|
|
493
|
+
function Ie(e) {
|
|
494
|
+
if (e === void 0)
|
|
495
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
496
|
+
return e;
|
|
497
|
+
}
|
|
498
|
+
function at() {
|
|
499
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
500
|
+
return !1;
|
|
501
|
+
if (typeof Proxy == "function")
|
|
502
|
+
return !0;
|
|
503
|
+
try {
|
|
504
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
505
|
+
})), !0;
|
|
506
|
+
} catch {
|
|
507
|
+
return !1;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
function ne(e) {
|
|
511
|
+
return ne = Object.setPrototypeOf ? Object.getPrototypeOf : function(n) {
|
|
512
|
+
return n.__proto__ || Object.getPrototypeOf(n);
|
|
513
|
+
}, ne(e);
|
|
514
|
+
}
|
|
515
|
+
function fe(e, t, n) {
|
|
516
|
+
return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
|
|
517
|
+
}
|
|
518
|
+
var xe = /* @__PURE__ */ function(e) {
|
|
519
|
+
nt(n, e);
|
|
520
|
+
var t = ot(n);
|
|
521
|
+
function n() {
|
|
522
|
+
var o;
|
|
523
|
+
et(this, n);
|
|
524
|
+
for (var a = arguments.length, s = new Array(a), r = 0; r < a; r++)
|
|
525
|
+
s[r] = arguments[r];
|
|
526
|
+
return o = t.call.apply(t, [this].concat(s)), fe(Ie(o), "onClick", function(i) {
|
|
527
|
+
var y = o.props, g = y.text, u = y.onCopy, f = y.children, E = y.options, l = J.default.Children.only(f), d = (0, Ye.default)(g, E);
|
|
528
|
+
u && u(g, d), l && l.props && typeof l.props.onClick == "function" && l.props.onClick(i);
|
|
529
|
+
}), o;
|
|
530
|
+
}
|
|
531
|
+
return tt(n, [{
|
|
532
|
+
key: "render",
|
|
533
|
+
value: function() {
|
|
534
|
+
var a = this.props;
|
|
535
|
+
a.text, a.onCopy, a.options;
|
|
536
|
+
var s = a.children, r = Je(a, Ve), i = J.default.Children.only(s);
|
|
537
|
+
return /* @__PURE__ */ J.default.cloneElement(i, Te(Te({}, r), {}, {
|
|
538
|
+
onClick: this.onClick
|
|
539
|
+
}));
|
|
540
|
+
}
|
|
541
|
+
}]), n;
|
|
542
|
+
}(J.default.PureComponent);
|
|
543
|
+
ae.CopyToClipboard = xe;
|
|
544
|
+
fe(xe, "defaultProps", {
|
|
545
|
+
onCopy: void 0,
|
|
546
|
+
options: void 0
|
|
547
|
+
});
|
|
548
|
+
var it = ae, de = it.CopyToClipboard;
|
|
549
|
+
de.CopyToClipboard = de;
|
|
550
|
+
var Ee = de;
|
|
551
|
+
function st({
|
|
552
|
+
type: e,
|
|
553
|
+
text: t,
|
|
554
|
+
tooltip: n,
|
|
555
|
+
message: o
|
|
556
|
+
}) {
|
|
557
|
+
const [a, s] = ee({
|
|
558
|
+
text: "کپی",
|
|
559
|
+
disabled: !1
|
|
560
|
+
}), r = (u = "اطلاع", f = {}) => {
|
|
561
|
+
T.info(u, {
|
|
562
|
+
position: T.POSITION.BOTTOM_CENTER,
|
|
563
|
+
transition: Fe,
|
|
564
|
+
style: { fontFamily: "inherit" },
|
|
565
|
+
...f
|
|
566
|
+
});
|
|
567
|
+
}, i = () => {
|
|
568
|
+
e === "BUTTON" ? (s({ text: "کپی شد!", disabled: !0 }), setTimeout(() => s({ text: "کپی", disabled: !1 }), 2e3)) : e === "ICON" && r(o);
|
|
569
|
+
}, y = {
|
|
570
|
+
ICON: /* @__PURE__ */ M.jsx(
|
|
571
|
+
De,
|
|
572
|
+
{
|
|
573
|
+
title: n,
|
|
574
|
+
placement: "bottom",
|
|
575
|
+
style: { maxWidth: "max-content" },
|
|
576
|
+
children: /* @__PURE__ */ M.jsx("span", { children: /* @__PURE__ */ M.jsx(Ee.CopyToClipboard, { onCopy: i, text: t, children: /* @__PURE__ */ M.jsx(Me, { children: /* @__PURE__ */ M.jsx(Le, { className: "cursor-pointer", size: 20 }) }) }) })
|
|
577
|
+
}
|
|
578
|
+
),
|
|
579
|
+
BUTTON: /* @__PURE__ */ M.jsx(Ee.CopyToClipboard, { onCopy: i, text: t, children: /* @__PURE__ */ M.jsx(ke, { disabled: a.disabled, children: a.text }) })
|
|
580
|
+
};
|
|
581
|
+
return y[e] ?? y.ICON;
|
|
582
|
+
}
|
|
583
|
+
const Vt = ({
|
|
584
|
+
text: e,
|
|
585
|
+
tooltip: t = "کپی",
|
|
586
|
+
type: n = "ICON",
|
|
587
|
+
message: o = "کپی شد"
|
|
588
|
+
}) => /* @__PURE__ */ M.jsx(st, { type: n, text: e, tooltip: t, message: o });
|
|
589
|
+
export {
|
|
590
|
+
Vt as KdpaCopyToClipboard
|
|
591
|
+
};
|