@cagatayfdn/flora-components 0.0.136 → 0.0.138

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/package.json +1 -1
  2. package/dist/Accordion.css +0 -1
  3. package/dist/ActionButton.css +0 -1
  4. package/dist/AlertCard.css +0 -1
  5. package/dist/Autocomplete.css +0 -1
  6. package/dist/Button.css +0 -1
  7. package/dist/Card.css +0 -1
  8. package/dist/Checkbox.css +0 -1
  9. package/dist/Config.css +0 -1
  10. package/dist/Confirm.css +0 -1
  11. package/dist/ContentHeader.css +0 -1
  12. package/dist/Datepicker.css +0 -1
  13. package/dist/Divider.css +0 -1
  14. package/dist/DropdownList.css +0 -1
  15. package/dist/ErrorLogModal.css +0 -1
  16. package/dist/FileUpload.css +0 -1
  17. package/dist/FileUpload.module-BxCEtOHx.js +0 -32
  18. package/dist/Heading.css +0 -1
  19. package/dist/IconBox.css +0 -1
  20. package/dist/InfoBoxList.css +0 -1
  21. package/dist/InfoBoxList.module-BHkAHgos.js +0 -8
  22. package/dist/InfoDate.css +0 -1
  23. package/dist/InfoText.css +0 -1
  24. package/dist/Input.css +0 -1
  25. package/dist/Label.css +0 -1
  26. package/dist/Legends.css +0 -1
  27. package/dist/Loading.css +0 -1
  28. package/dist/MenuItem-Df6Zsa7E.js +0 -53
  29. package/dist/MenuItem.css +0 -1
  30. package/dist/Modal.css +0 -1
  31. package/dist/NoResult.css +0 -1
  32. package/dist/PageWrap.css +0 -1
  33. package/dist/Pager.css +0 -1
  34. package/dist/Panel.css +0 -1
  35. package/dist/Radio.css +0 -1
  36. package/dist/ResultError.css +0 -1
  37. package/dist/ScrollContainer.css +0 -1
  38. package/dist/Select-BE_y91ZN.js +0 -1831
  39. package/dist/Select.css +0 -1
  40. package/dist/Select.module-ByPQ6qr4.js +0 -21
  41. package/dist/StatusTag.css +0 -1
  42. package/dist/StatusTypography.css +0 -1
  43. package/dist/Stepper.css +0 -1
  44. package/dist/Switch.css +0 -1
  45. package/dist/Tab.css +0 -1
  46. package/dist/Table.css +0 -1
  47. package/dist/Table.module-DUqpZOLt.js +0 -29
  48. package/dist/Textarea.css +0 -1
  49. package/dist/Tooltip.css +0 -1
  50. package/dist/Trans-B4ILpbwK.js +0 -343
  51. package/dist/TypographyText.css +0 -1
  52. package/dist/ValidationError.css +0 -1
  53. package/dist/_commonjsHelpers-CT_km90n.js +0 -30
  54. package/dist/_isArray-CBUZFxFA.js +0 -6
  55. package/dist/_isString-BUpNGP_8.js +0 -6
  56. package/dist/_reduce-DsUCMz4O.js +0 -148
  57. package/dist/assets/icons/icons.js +0 -70
  58. package/dist/assets/images/500_error_2x.gif +0 -0
  59. package/dist/assets/images/oms.png +0 -0
  60. package/dist/components/Accordion/Accordion.js +0 -60
  61. package/dist/components/ActionButton/ActionButton.js +0 -54
  62. package/dist/components/AlertCard/AlertCard.js +0 -29
  63. package/dist/components/AuthUserCan/Permission.js +0 -18
  64. package/dist/components/AuthUserCan/index.js +0 -23
  65. package/dist/components/Autocomplete/Autocomplete.js +0 -87
  66. package/dist/components/Button/Button.js +0 -87
  67. package/dist/components/Card/Card.js +0 -21
  68. package/dist/components/Charts/Bar.js +0 -18
  69. package/dist/components/Charts/Legends.js +0 -21
  70. package/dist/components/Charts/Line.js +0 -18
  71. package/dist/components/Charts/Pie.js +0 -43
  72. package/dist/components/Charts/index.js +0 -31
  73. package/dist/components/Charts/types.js +0 -1
  74. package/dist/components/Charts/utils.js +0 -12
  75. package/dist/components/Checkbox/Checkbox.js +0 -68
  76. package/dist/components/Config/Config.js +0 -32
  77. package/dist/components/Confirm/Confirm.js +0 -60
  78. package/dist/components/ContentHeader/ContentHeader.js +0 -75
  79. package/dist/components/ContentLoader/ContentLoader.js +0 -16
  80. package/dist/components/Countdown/Countdown.js +0 -20
  81. package/dist/components/Datepicker/Datepicker.js +0 -1478
  82. package/dist/components/Divider/Divider.js +0 -27
  83. package/dist/components/Drawer/Provider.js +0 -24
  84. package/dist/components/Drawer/index.js +0 -55
  85. package/dist/components/Dropdown/DropdownList.js +0 -90
  86. package/dist/components/ErrorLogModal/ErrorLogModal.js +0 -69
  87. package/dist/components/FileUpload/FileUpload.js +0 -237
  88. package/dist/components/FileUpload/ImagePreview.js +0 -19
  89. package/dist/components/FileUpload/LengthCard.js +0 -6
  90. package/dist/components/FileUpload/PreviewModal.js +0 -53
  91. package/dist/components/Grid/Column.js +0 -29
  92. package/dist/components/Grid/Row.js +0 -6
  93. package/dist/components/Heading/Heading.js +0 -22
  94. package/dist/components/Icon/index.js +0 -24
  95. package/dist/components/IconBox/IconBox.js +0 -13
  96. package/dist/components/InfiniteScroll/InfiniteScroll.js +0 -41
  97. package/dist/components/InfoBoxList/InfoBoxList.js +0 -30
  98. package/dist/components/InfoBoxList/helper.js +0 -83
  99. package/dist/components/InfoDate/InfoDate.js +0 -19
  100. package/dist/components/InfoText/InfoText.js +0 -13
  101. package/dist/components/Input/Input.js +0 -140
  102. package/dist/components/Label/Label.js +0 -22
  103. package/dist/components/Loading/Loading.js +0 -62
  104. package/dist/components/Modal/Modal.js +0 -74
  105. package/dist/components/NavigatorCard/index.js +0 -59
  106. package/dist/components/NoResult/NoResult.js +0 -12
  107. package/dist/components/Notification/Notification.js +0 -26
  108. package/dist/components/PageWrapper/PageWrap.js +0 -46
  109. package/dist/components/Pager/Pager.js +0 -103
  110. package/dist/components/Panel/Panel.js +0 -71
  111. package/dist/components/PermaLink/PermaLink.js +0 -387
  112. package/dist/components/Radio/Radio.js +0 -96
  113. package/dist/components/ResultError/ResultError.js +0 -20
  114. package/dist/components/ScrollContainer/ScrollContainer.js +0 -23
  115. package/dist/components/Select/NoData.js +0 -10
  116. package/dist/components/Select/OptionItem.js +0 -19
  117. package/dist/components/Select/Select.js +0 -13
  118. package/dist/components/Sidebar/MenuItem.js +0 -9
  119. package/dist/components/Sidebar/index.js +0 -137
  120. package/dist/components/StatusTag/StatusTag.js +0 -24
  121. package/dist/components/StatusTypography/StatusTypography.js +0 -51
  122. package/dist/components/Stepper/Stepper.js +0 -75
  123. package/dist/components/Switch/Switch.js +0 -84
  124. package/dist/components/Tab/Tab.js +0 -28
  125. package/dist/components/Table/Table.js +0 -271
  126. package/dist/components/Table/TableHeader.js +0 -137
  127. package/dist/components/Table/TableSort.js +0 -25
  128. package/dist/components/Textarea/Textarea.js +0 -95
  129. package/dist/components/Tooltip/Tooltip.js +0 -1548
  130. package/dist/components/TypographyText/TypographyText.js +0 -91
  131. package/dist/components/ValidationError/ValidationError.js +0 -7
  132. package/dist/components/index.js +0 -133
  133. package/dist/defineProperty-DeKy1XT0.js +0 -37
  134. package/dist/enums/appearance.js +0 -14
  135. package/dist/enums/applicationTypeSlug.js +0 -4
  136. package/dist/enums/index.js +0 -29
  137. package/dist/enums/isActiveColor.js +0 -4
  138. package/dist/enums/size.js +0 -4
  139. package/dist/enums/status.js +0 -11
  140. package/dist/equals-PL9KqVQf.js +0 -119
  141. package/dist/flatpickr-CRz1AV0e.js +0 -59
  142. package/dist/hooks/index.js +0 -15
  143. package/dist/hooks/useAauth.js +0 -40
  144. package/dist/hooks/useDisclosure.js +0 -14
  145. package/dist/hooks/useDrawer.js +0 -9
  146. package/dist/hooks/useMediaQuery.js +0 -21
  147. package/dist/hooks/useNiceModal.js +0 -13
  148. package/dist/i18nInstance-CiCZbaCK.js +0 -55
  149. package/dist/includes-8YTFrx85.js +0 -46
  150. package/dist/index-9ZLCCecr.js +0 -364
  151. package/dist/index-BHf7G3IG.js +0 -35
  152. package/dist/index-BJU1K2Aw.js +0 -8003
  153. package/dist/index-CB61CB0b.js +0 -669
  154. package/dist/index-H7XbDVmH.js +0 -320
  155. package/dist/index-JNaMEwgt.js +0 -1413
  156. package/dist/index.css +0 -1
  157. package/dist/index.d.mts +0 -1463
  158. package/dist/index.d.ts +0 -1463
  159. package/dist/index.js +0 -200
  160. package/dist/index2.css +0 -1
  161. package/dist/jsx-runtime-BcAkpsdy.js +0 -631
  162. package/dist/keys-B0bo5Q7o.js +0 -67
  163. package/dist/locales/en/index.js +0 -613
  164. package/dist/locales/i18n.js +0 -1417
  165. package/dist/locales/index.js +0 -5
  166. package/dist/locales/tr/index.js +0 -613
  167. package/dist/main.css +0 -1
  168. package/dist/main.js +0 -56
  169. package/dist/prodivers.css +0 -6
  170. package/dist/prodivers.js +0 -13
  171. package/dist/react-content-loader.es-CswLCxkm.js +0 -90
  172. package/dist/react-toastify.esm-BUWNP7Nm.js +0 -808
  173. package/dist/types/common/date.js +0 -1
  174. package/dist/types/common/events.js +0 -1
  175. package/dist/types/common/forms.js +0 -1
  176. package/dist/types/common/option.js +0 -1
  177. package/dist/types/index.js +0 -1
  178. package/dist/useTranslation-CnCPcxVj.js +0 -142
  179. package/dist/utils/date.js +0 -413
  180. package/dist/utils/flatpickr.js +0 -4
  181. package/dist/utils/helper.js +0 -55
  182. package/dist/utils/index.js +0 -24
  183. package/dist/utils/language.js +0 -46
  184. package/dist/utils/validation.js +0 -27
  185. package/dist/utils/yup.js +0 -2921
@@ -1,808 +0,0 @@
1
- import S, { createElement as B, useRef as J, useLayoutEffect as Be, useEffect as z, useReducer as ye, isValidElement as Y, cloneElement as ue, useState as Te } from "react";
2
- import { render as _e } from "react-dom";
3
- function Ce(e) {
4
- var t, n, o = "";
5
- if (typeof e == "string" || typeof e == "number")
6
- o += e;
7
- else if (typeof e == "object")
8
- if (Array.isArray(e))
9
- for (t = 0; t < e.length; t++)
10
- e[t] && (n = Ce(e[t])) && (o && (o += " "), o += n);
11
- else
12
- for (t in e)
13
- e[t] && (o && (o += " "), o += t);
14
- return o;
15
- }
16
- function H() {
17
- for (var e, t, n = 0, o = ""; n < arguments.length; )
18
- (e = arguments[n++]) && (t = Ce(e)) && (o && (o += " "), o += t);
19
- return o;
20
- }
21
- function _() {
22
- return _ = Object.assign || function(e) {
23
- for (var t = 1; t < arguments.length; t++) {
24
- var n = arguments[t];
25
- for (var o in n)
26
- Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o]);
27
- }
28
- return e;
29
- }, _.apply(this, arguments);
30
- }
31
- function Ee(e, t) {
32
- if (e == null)
33
- return {};
34
- var n = {}, o = Object.keys(e), s, u;
35
- for (u = 0; u < o.length; u++)
36
- s = o[u], !(t.indexOf(s) >= 0) && (n[s] = e[s]);
37
- return n;
38
- }
39
- function Z(e) {
40
- return typeof e == "number" && !isNaN(e);
41
- }
42
- function $(e) {
43
- return typeof e == "boolean";
44
- }
45
- function U(e) {
46
- return typeof e == "string";
47
- }
48
- function D(e) {
49
- return typeof e == "function";
50
- }
51
- function te(e) {
52
- return U(e) || D(e) ? e : null;
53
- }
54
- function ce(e) {
55
- return e === 0 || e;
56
- }
57
- function Se(e, t) {
58
- return e === !1 || Z(e) && e > 0 ? e : t;
59
- }
60
- var Ie = !!(typeof window < "u" && window.document && window.document.createElement);
61
- function le(e) {
62
- return Y(e) || U(e) || D(e) || Z(e);
63
- }
64
- var Oe = {
65
- TOP_LEFT: "top-left",
66
- TOP_RIGHT: "top-right",
67
- TOP_CENTER: "top-center",
68
- BOTTOM_LEFT: "bottom-left",
69
- BOTTOM_RIGHT: "bottom-right",
70
- BOTTOM_CENTER: "bottom-center"
71
- }, A = {
72
- INFO: "info",
73
- SUCCESS: "success",
74
- WARNING: "warning",
75
- ERROR: "error",
76
- DEFAULT: "default"
77
- };
78
- function we(e, t, n) {
79
- n === void 0 && (n = 300);
80
- var o = e.scrollHeight, s = e.style;
81
- requestAnimationFrame(function() {
82
- s.minHeight = "initial", s.height = o + "px", s.transition = "all " + n + "ms", requestAnimationFrame(function() {
83
- s.height = "0", s.padding = "0", s.margin = "0", setTimeout(t, n);
84
- });
85
- });
86
- }
87
- function ke(e) {
88
- var t = e.enter, n = e.exit, o = e.appendPosition, s = o === void 0 ? !1 : o, u = e.collapse, g = u === void 0 ? !0 : u, v = e.collapseDuration, r = v === void 0 ? 300 : v;
89
- return function(l) {
90
- var b = l.children, C = l.position, T = l.preventExitTransition, P = l.done, E = l.nodeRef, N = l.isIn, R = s ? t + "--" + C : t, L = s ? n + "--" + C : n, F = J(), i = J(
91
- 0
92
- /* Enter */
93
- );
94
- Be(function() {
95
- c();
96
- }, []), z(function() {
97
- N || (T ? I() : y());
98
- }, [N]);
99
- function c() {
100
- var a = E.current;
101
- F.current = a.className, a.className += " " + R, a.addEventListener("animationend", m);
102
- }
103
- function m(a) {
104
- if (a.target === E.current) {
105
- var f = E.current;
106
- f.removeEventListener("animationend", m), i.current === 0 && (f.className = F.current);
107
- }
108
- }
109
- function y() {
110
- i.current = 1;
111
- var a = E.current;
112
- a.className += " " + L, a.addEventListener("animationend", I);
113
- }
114
- function I() {
115
- var a = E.current;
116
- a.removeEventListener("animationend", I), g ? we(a, P, r) : P();
117
- }
118
- return S.createElement(S.Fragment, null, b);
119
- };
120
- }
121
- var w = {
122
- list: /* @__PURE__ */ new Map(),
123
- emitQueue: /* @__PURE__ */ new Map(),
124
- on: function(t, n) {
125
- return this.list.has(t) || this.list.set(t, []), this.list.get(t).push(n), this;
126
- },
127
- off: function(t, n) {
128
- if (n) {
129
- var o = this.list.get(t).filter(function(s) {
130
- return s !== n;
131
- });
132
- return this.list.set(t, o), this;
133
- }
134
- return this.list.delete(t), this;
135
- },
136
- cancelEmit: function(t) {
137
- var n = this.emitQueue.get(t);
138
- return n && (n.forEach(clearTimeout), this.emitQueue.delete(t)), this;
139
- },
140
- /**
141
- * Enqueue the event at the end of the call stack
142
- * Doing so let the user call toast as follow:
143
- * toast('1')
144
- * toast('2')
145
- * toast('3')
146
- * Without setTimemout the code above will not work
147
- */
148
- emit: function(t) {
149
- for (var n = this, o = arguments.length, s = new Array(o > 1 ? o - 1 : 0), u = 1; u < o; u++)
150
- s[u - 1] = arguments[u];
151
- this.list.has(t) && this.list.get(t).forEach(function(g) {
152
- var v = setTimeout(function() {
153
- g.apply(void 0, s);
154
- }, 0);
155
- n.emitQueue.has(t) || n.emitQueue.set(t, []), n.emitQueue.get(t).push(v);
156
- });
157
- }
158
- };
159
- function q(e, t) {
160
- t === void 0 && (t = !1);
161
- var n = J(e);
162
- return z(function() {
163
- t && (n.current = e);
164
- }), n.current;
165
- }
166
- function Ae(e, t) {
167
- switch (t.type) {
168
- case 0:
169
- return [].concat(e, [t.toastId]).filter(function(n) {
170
- return n !== t.staleId;
171
- });
172
- case 1:
173
- return ce(t.toastId) ? e.filter(function(n) {
174
- return n !== t.toastId;
175
- }) : [];
176
- }
177
- }
178
- var Fe = ["delay", "staleId"];
179
- function Me(e) {
180
- var t = ye(function(i) {
181
- return i + 1;
182
- }, 0), n = t[1], o = ye(Ae, []), s = o[0], u = o[1], g = J(null), v = q(0), r = q([]), h = q({}), l = q({
183
- toastKey: 1,
184
- displayedToast: 0,
185
- props: e,
186
- containerId: null,
187
- isToastActive: b,
188
- getToast: function(c) {
189
- return h[c] || null;
190
- }
191
- });
192
- z(function() {
193
- return l.containerId = e.containerId, w.cancelEmit(
194
- 3
195
- /* WillUnmount */
196
- ).on(
197
- 0,
198
- N
199
- ).on(
200
- 1,
201
- function(i) {
202
- return g.current && T(i);
203
- }
204
- ).on(
205
- 5,
206
- C
207
- ).emit(
208
- 2,
209
- l
210
- ), function() {
211
- return w.emit(
212
- 3,
213
- l
214
- );
215
- };
216
- }, []), z(function() {
217
- l.isToastActive = b, l.displayedToast = s.length, w.emit(
218
- 4,
219
- s.length,
220
- e.containerId
221
- );
222
- }, [s]), z(function() {
223
- l.props = e;
224
- });
225
- function b(i) {
226
- return s.indexOf(i) !== -1;
227
- }
228
- function C(i) {
229
- var c = i.containerId, m = l.props.limit;
230
- m && (!c || l.containerId === c) && (v -= r.length, r = []);
231
- }
232
- function T(i) {
233
- u({
234
- type: 1,
235
- toastId: i
236
- });
237
- }
238
- function P() {
239
- var i = r.shift(), c = i.toastContent, m = i.toastProps, y = i.staleId;
240
- R(c, m, y);
241
- }
242
- function E(i) {
243
- var c = i.containerId, m = i.toastId, y = i.updateId;
244
- return !!(!g.current || l.props.enableMultiContainer && c !== l.props.containerId || h[m] && y == null);
245
- }
246
- function N(i, c) {
247
- var m, y = c.delay, I = c.staleId, a = Ee(c, Fe);
248
- if (!(!le(i) || E(a))) {
249
- var f = a.toastId, x = a.updateId, W = a.data, d = l.props, k = function() {
250
- return T(f);
251
- }, K = a.updateId == null;
252
- K && v++;
253
- var O = {
254
- toastId: f,
255
- updateId: x,
256
- isLoading: a.isLoading,
257
- theme: a.theme || d.theme,
258
- icon: (m = a.icon) != null ? m : d.icon,
259
- isIn: !1,
260
- key: a.key || l.toastKey++,
261
- type: a.type,
262
- closeToast: k,
263
- closeButton: a.closeButton,
264
- rtl: d.rtl,
265
- position: a.position || d.position,
266
- transition: a.transition || d.transition,
267
- className: te(a.className || d.toastClassName),
268
- bodyClassName: te(a.bodyClassName || d.bodyClassName),
269
- style: a.style || d.toastStyle,
270
- bodyStyle: a.bodyStyle || d.bodyStyle,
271
- onClick: a.onClick || d.onClick,
272
- pauseOnHover: $(a.pauseOnHover) ? a.pauseOnHover : d.pauseOnHover,
273
- pauseOnFocusLoss: $(a.pauseOnFocusLoss) ? a.pauseOnFocusLoss : d.pauseOnFocusLoss,
274
- draggable: $(a.draggable) ? a.draggable : d.draggable,
275
- draggablePercent: Z(a.draggablePercent) ? a.draggablePercent : d.draggablePercent,
276
- draggableDirection: a.draggableDirection || d.draggableDirection,
277
- closeOnClick: $(a.closeOnClick) ? a.closeOnClick : d.closeOnClick,
278
- progressClassName: te(a.progressClassName || d.progressClassName),
279
- progressStyle: a.progressStyle || d.progressStyle,
280
- autoClose: a.isLoading ? !1 : Se(a.autoClose, d.autoClose),
281
- hideProgressBar: $(a.hideProgressBar) ? a.hideProgressBar : d.hideProgressBar,
282
- progress: a.progress,
283
- role: U(a.role) ? a.role : d.role,
284
- deleteToast: function() {
285
- L(f);
286
- }
287
- };
288
- D(a.onOpen) && (O.onOpen = a.onOpen), D(a.onClose) && (O.onClose = a.onClose), O.draggableDirection === "y" && O.draggablePercent === 80 && (O.draggablePercent *= 1.5);
289
- var M = d.closeButton;
290
- a.closeButton === !1 || le(a.closeButton) ? M = a.closeButton : a.closeButton === !0 && (M = le(d.closeButton) ? d.closeButton : !0), O.closeButton = M;
291
- var j = i;
292
- Y(i) && !U(i.type) ? j = ue(i, {
293
- closeToast: k,
294
- toastProps: O,
295
- data: W
296
- }) : D(i) && (j = i({
297
- closeToast: k,
298
- toastProps: O,
299
- data: W
300
- })), d.limit && d.limit > 0 && v > d.limit && K ? r.push({
301
- toastContent: j,
302
- toastProps: O,
303
- staleId: I
304
- }) : Z(y) && y > 0 ? setTimeout(function() {
305
- R(j, O, I);
306
- }, y) : R(j, O, I);
307
- }
308
- }
309
- function R(i, c, m) {
310
- var y = c.toastId;
311
- m && delete h[m], h[y] = {
312
- content: i,
313
- props: c
314
- }, u({
315
- type: 0,
316
- toastId: y,
317
- staleId: m
318
- });
319
- }
320
- function L(i) {
321
- delete h[i];
322
- var c = r.length;
323
- if (v = ce(i) ? v - 1 : v - l.displayedToast, v < 0 && (v = 0), c > 0) {
324
- var m = ce(i) ? 1 : l.props.limit;
325
- if (c === 1 || m === 1)
326
- l.displayedToast++, P();
327
- else {
328
- var y = m > c ? c : m;
329
- l.displayedToast = y;
330
- for (var I = 0; I < y; I++)
331
- P();
332
- }
333
- } else
334
- n();
335
- }
336
- function F(i) {
337
- for (var c = {}, m = e.newestOnTop ? Object.keys(h).reverse() : Object.keys(h), y = 0; y < m.length; y++) {
338
- var I = h[m[y]], a = I.props.position;
339
- c[a] || (c[a] = []), c[a].push(I);
340
- }
341
- return Object.keys(c).map(function(f) {
342
- return i(f, c[f]);
343
- });
344
- }
345
- return {
346
- getToastToRender: F,
347
- collection: h,
348
- containerRef: g,
349
- isToastActive: b
350
- };
351
- }
352
- function he(e) {
353
- return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientX : e.clientX;
354
- }
355
- function pe(e) {
356
- return e.targetTouches && e.targetTouches.length >= 1 ? e.targetTouches[0].clientY : e.clientY;
357
- }
358
- function je(e) {
359
- var t = Te(!0), n = t[0], o = t[1], s = Te(!1), u = s[0], g = s[1], v = J(null), r = q({
360
- start: 0,
361
- x: 0,
362
- y: 0,
363
- delta: 0,
364
- removalDistance: 0,
365
- canCloseOnClick: !0,
366
- canDrag: !1,
367
- boundingRect: null
368
- }), h = q(e, !0), l = e.autoClose, b = e.pauseOnHover, C = e.closeToast, T = e.onClick, P = e.closeOnClick;
369
- z(function() {
370
- return D(e.onOpen) && e.onOpen(Y(e.children) && e.children.props), function() {
371
- D(h.onClose) && h.onClose(Y(h.children) && h.children.props);
372
- };
373
- }, []), z(function() {
374
- return e.draggable && c(), function() {
375
- e.draggable && m();
376
- };
377
- }, [e.draggable]), z(function() {
378
- return e.pauseOnFocusLoss && F(), function() {
379
- e.pauseOnFocusLoss && i();
380
- };
381
- }, [e.pauseOnFocusLoss]);
382
- function E(f) {
383
- if (e.draggable) {
384
- var x = v.current;
385
- r.canCloseOnClick = !0, r.canDrag = !0, r.boundingRect = x.getBoundingClientRect(), x.style.transition = "", r.x = he(f.nativeEvent), r.y = pe(f.nativeEvent), e.draggableDirection === "x" ? (r.start = r.x, r.removalDistance = x.offsetWidth * (e.draggablePercent / 100)) : (r.start = r.y, r.removalDistance = x.offsetHeight * (e.draggablePercent / 100));
386
- }
387
- }
388
- function N() {
389
- if (r.boundingRect) {
390
- var f = r.boundingRect, x = f.top, W = f.bottom, d = f.left, k = f.right;
391
- e.pauseOnHover && r.x >= d && r.x <= k && r.y >= x && r.y <= W ? L() : R();
392
- }
393
- }
394
- function R() {
395
- o(!0);
396
- }
397
- function L() {
398
- o(!1);
399
- }
400
- function F() {
401
- document.hasFocus() || L(), window.addEventListener("focus", R), window.addEventListener("blur", L);
402
- }
403
- function i() {
404
- window.removeEventListener("focus", R), window.removeEventListener("blur", L);
405
- }
406
- function c() {
407
- document.addEventListener("mousemove", y), document.addEventListener("mouseup", I), document.addEventListener("touchmove", y), document.addEventListener("touchend", I);
408
- }
409
- function m() {
410
- document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", I), document.removeEventListener("touchmove", y), document.removeEventListener("touchend", I);
411
- }
412
- function y(f) {
413
- if (r.canDrag) {
414
- f.preventDefault();
415
- var x = v.current;
416
- n && L(), r.x = he(f), r.y = pe(f), e.draggableDirection === "x" ? r.delta = r.x - r.start : r.delta = r.y - r.start, r.start !== r.x && (r.canCloseOnClick = !1), x.style.transform = "translate" + e.draggableDirection + "(" + r.delta + "px)", x.style.opacity = "" + (1 - Math.abs(r.delta / r.removalDistance));
417
- }
418
- }
419
- function I() {
420
- var f = v.current;
421
- if (r.canDrag) {
422
- if (r.canDrag = !1, Math.abs(r.delta) > r.removalDistance) {
423
- g(!0), e.closeToast();
424
- return;
425
- }
426
- f.style.transition = "transform 0.2s, opacity 0.2s", f.style.transform = "translate" + e.draggableDirection + "(0)", f.style.opacity = "1";
427
- }
428
- }
429
- var a = {
430
- onMouseDown: E,
431
- onTouchStart: E,
432
- onMouseUp: N,
433
- onTouchEnd: N
434
- };
435
- return l && b && (a.onMouseEnter = L, a.onMouseLeave = R), P && (a.onClick = function(f) {
436
- T && T(f), r.canCloseOnClick && C();
437
- }), {
438
- playToast: R,
439
- pauseToast: L,
440
- isRunning: n,
441
- preventExitTransition: u,
442
- toastRef: v,
443
- eventHandlers: a
444
- };
445
- }
446
- function Ne(e) {
447
- var t = e.closeToast, n = e.theme, o = e.ariaLabel, s = o === void 0 ? "close" : o;
448
- return B("button", {
449
- className: "Toastify__close-button Toastify__close-button--" + n,
450
- type: "button",
451
- onClick: function(g) {
452
- g.stopPropagation(), t(g);
453
- },
454
- "aria-label": s
455
- }, B("svg", {
456
- "aria-hidden": "true",
457
- viewBox: "0 0 14 16"
458
- }, B("path", {
459
- fillRule: "evenodd",
460
- 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"
461
- })));
462
- }
463
- function Pe(e) {
464
- var t, n, o = e.delay, s = e.isRunning, u = e.closeToast, g = e.type, v = e.hide, r = e.className, h = e.style, l = e.controlledProgress, b = e.progress, C = e.rtl, T = e.isIn, P = e.theme, E = _({}, h, {
465
- animationDuration: o + "ms",
466
- animationPlayState: s ? "running" : "paused",
467
- opacity: v ? 0 : 1
468
- });
469
- l && (E.transform = "scaleX(" + b + ")");
470
- var N = H("Toastify__progress-bar", l ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", "Toastify__progress-bar-theme--" + P, "Toastify__progress-bar--" + g, (t = {}, t["Toastify__progress-bar--rtl"] = C, t)), R = D(r) ? r({
471
- rtl: C,
472
- type: g,
473
- defaultClassName: N
474
- }) : H(N, r), L = (n = {}, n[l && b >= 1 ? "onTransitionEnd" : "onAnimationEnd"] = l && b < 1 ? null : function() {
475
- T && u();
476
- }, n);
477
- return B("div", Object.assign({
478
- role: "progressbar",
479
- "aria-hidden": v ? "true" : "false",
480
- "aria-label": "notification timer",
481
- className: R,
482
- style: E
483
- }, L));
484
- }
485
- Pe.defaultProps = {
486
- type: A.DEFAULT,
487
- hide: !1
488
- };
489
- var He = ["theme", "type"], ne = function(t) {
490
- var n = t.theme, o = t.type, s = Ee(t, He);
491
- return S.createElement("svg", Object.assign({
492
- viewBox: "0 0 24 24",
493
- width: "100%",
494
- height: "100%",
495
- fill: n === "colored" ? "currentColor" : "var(--toastify-icon-color-" + o + ")"
496
- }, s));
497
- };
498
- function ze(e) {
499
- return S.createElement(ne, Object.assign({}, e), S.createElement("path", {
500
- 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"
501
- }));
502
- }
503
- function Ue(e) {
504
- return S.createElement(ne, Object.assign({}, e), S.createElement("path", {
505
- 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"
506
- }));
507
- }
508
- function Qe(e) {
509
- return S.createElement(ne, Object.assign({}, e), S.createElement("path", {
510
- 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"
511
- }));
512
- }
513
- function We(e) {
514
- return S.createElement(ne, Object.assign({}, e), S.createElement("path", {
515
- 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"
516
- }));
517
- }
518
- function qe() {
519
- return S.createElement("div", {
520
- className: "Toastify__spinner"
521
- });
522
- }
523
- var be = {
524
- info: Ue,
525
- warning: ze,
526
- success: Qe,
527
- error: We,
528
- spinner: qe
529
- }, Ge = function(t) {
530
- var n, o, s = je(t), u = s.isRunning, g = s.preventExitTransition, v = s.toastRef, r = s.eventHandlers, h = t.closeButton, l = t.children, b = t.autoClose, C = t.onClick, T = t.type, P = t.hideProgressBar, E = t.closeToast, N = t.transition, R = t.position, L = t.className, F = t.style, i = t.bodyClassName, c = t.bodyStyle, m = t.progressClassName, y = t.progressStyle, I = t.updateId, a = t.role, f = t.progress, x = t.rtl, W = t.toastId, d = t.deleteToast, k = t.isIn, K = t.isLoading, O = t.icon, M = t.theme, j = H("Toastify__toast", "Toastify__toast-theme--" + M, "Toastify__toast--" + T, (n = {}, n["Toastify__toast--rtl"] = x, n)), re = D(L) ? L({
531
- rtl: x,
532
- position: R,
533
- type: T,
534
- defaultClassName: j
535
- }) : H(j, L), se = !!f, ge = be[T], ie = {
536
- theme: M,
537
- type: T
538
- }, Q = ge && ge(ie);
539
- O === !1 ? Q = void 0 : D(O) ? Q = O(ie) : Y(O) ? Q = ue(O, ie) : U(O) ? Q = O : K && (Q = be.spinner());
540
- function xe(X) {
541
- if (X) {
542
- var me = {
543
- closeToast: E,
544
- type: T,
545
- theme: M
546
- };
547
- if (D(X))
548
- return X(me);
549
- if (Y(X))
550
- return ue(X, me);
551
- }
552
- }
553
- return B(N, {
554
- isIn: k,
555
- done: d,
556
- position: R,
557
- preventExitTransition: g,
558
- nodeRef: v
559
- }, B("div", Object.assign({
560
- id: W,
561
- onClick: C,
562
- className: re
563
- }, r, {
564
- style: F,
565
- ref: v
566
- }), B("div", Object.assign({}, k && {
567
- role: a
568
- }, {
569
- className: D(i) ? i({
570
- type: T
571
- }) : H("Toastify__toast-body", i),
572
- style: c
573
- }), Q && B("div", {
574
- className: H("Toastify__toast-icon", (o = {}, o["Toastify--animate-icon Toastify__zoom-enter"] = !K, o))
575
- }, Q), B("div", null, l)), xe(h), (b || se) && B(Pe, Object.assign({}, I && !se ? {
576
- key: "pb-" + I
577
- } : {}, {
578
- rtl: x,
579
- theme: M,
580
- delay: b,
581
- isRunning: u,
582
- isIn: k,
583
- closeToast: E,
584
- hide: P,
585
- type: T,
586
- style: y,
587
- className: m,
588
- controlledProgress: se,
589
- progress: f
590
- }))));
591
- }, Ye = /* @__PURE__ */ ke({
592
- enter: "Toastify--animate Toastify__bounce-enter",
593
- exit: "Toastify--animate Toastify__bounce-exit",
594
- appendPosition: !0
595
- }), Le = function(t) {
596
- var n = Me(t), o = n.getToastToRender, s = n.containerRef, u = n.isToastActive, g = t.className, v = t.style, r = t.rtl, h = t.containerId;
597
- function l(b) {
598
- var C, T = H("Toastify__toast-container", "Toastify__toast-container--" + b, (C = {}, C["Toastify__toast-container--rtl"] = r, C));
599
- return D(g) ? g({
600
- position: b,
601
- rtl: r,
602
- defaultClassName: T
603
- }) : H(T, te(g));
604
- }
605
- return B("div", {
606
- ref: s,
607
- className: "Toastify",
608
- id: h
609
- }, o(function(b, C) {
610
- var T = C.length === 0 ? _({}, v, {
611
- pointerEvents: "none"
612
- }) : _({}, v);
613
- return B("div", {
614
- className: l(b),
615
- style: T,
616
- key: "container-" + b
617
- }, C.map(function(P) {
618
- var E = P.content, N = P.props;
619
- return B(Ge, Object.assign({}, N, {
620
- isIn: u(N.toastId),
621
- key: "toast-" + N.key,
622
- closeButton: N.closeButton === !0 ? Ne : N.closeButton
623
- }), E);
624
- }));
625
- }));
626
- };
627
- Le.defaultProps = {
628
- position: Oe.TOP_RIGHT,
629
- transition: Ye,
630
- rtl: !1,
631
- autoClose: 5e3,
632
- hideProgressBar: !1,
633
- closeButton: Ne,
634
- pauseOnHover: !0,
635
- pauseOnFocusLoss: !0,
636
- closeOnClick: !0,
637
- newestOnTop: !1,
638
- draggable: !0,
639
- draggablePercent: 80,
640
- draggableDirection: "x",
641
- role: "alert",
642
- theme: "light"
643
- };
644
- var G = /* @__PURE__ */ new Map(), de, V, Re, fe = [], ve = !1;
645
- function Ke() {
646
- return G.size > 0;
647
- }
648
- function Xe(e, t) {
649
- var n = t.containerId, o = G.get(n || de);
650
- return o ? o.getToast(e) : null;
651
- }
652
- function De() {
653
- return Math.random().toString(36).substr(2, 9);
654
- }
655
- function $e(e) {
656
- return e && (U(e.toastId) || Z(e.toastId)) ? e.toastId : De();
657
- }
658
- function ee(e, t) {
659
- return Ke() ? w.emit(
660
- 0,
661
- e,
662
- t
663
- ) : (fe.push({
664
- content: e,
665
- options: t
666
- }), ve && Ie && (ve = !1, V = document.createElement("div"), document.body.appendChild(V), _e(B(Le, Object.assign({}, Re)), V))), t.toastId;
667
- }
668
- function ae(e, t) {
669
- return _({}, t, {
670
- type: t && t.type || e,
671
- toastId: $e(t)
672
- });
673
- }
674
- var oe = function(t) {
675
- return function(n, o) {
676
- return ee(n, ae(t, o));
677
- };
678
- }, p = function(t, n) {
679
- return ee(t, ae(A.DEFAULT, n));
680
- };
681
- p.loading = function(e, t) {
682
- return ee(e, ae(A.DEFAULT, _({
683
- isLoading: !0,
684
- autoClose: !1,
685
- closeOnClick: !1,
686
- closeButton: !1,
687
- draggable: !1
688
- }, t)));
689
- };
690
- function Ve(e, t, n) {
691
- var o = t.pending, s = t.error, u = t.success, g;
692
- o && (g = U(o) ? p.loading(o, n) : p.loading(o.render, _({}, n, o)));
693
- var v = {
694
- isLoading: null,
695
- autoClose: null,
696
- closeOnClick: null,
697
- closeButton: null,
698
- draggable: null
699
- }, r = function(b, C, T) {
700
- var P = _({
701
- type: b
702
- }, v, n, {
703
- data: T
704
- }), E = U(C) ? {
705
- render: C
706
- } : C;
707
- return g ? p.update(g, _({}, P, E)) : p(E.render, _({}, P, E)), T;
708
- }, h = D(e) ? e() : e;
709
- return h.then(function(l) {
710
- return u && r("success", u, l);
711
- }).catch(function(l) {
712
- return s && r("error", s, l);
713
- }), h;
714
- }
715
- p.promise = Ve;
716
- p.success = /* @__PURE__ */ oe(A.SUCCESS);
717
- p.info = /* @__PURE__ */ oe(A.INFO);
718
- p.error = /* @__PURE__ */ oe(A.ERROR);
719
- p.warning = /* @__PURE__ */ oe(A.WARNING);
720
- p.warn = p.warning;
721
- p.dark = function(e, t) {
722
- return ee(e, ae(A.DEFAULT, _({
723
- theme: "dark"
724
- }, t)));
725
- };
726
- p.dismiss = function(e) {
727
- return w.emit(
728
- 1,
729
- e
730
- );
731
- };
732
- p.clearWaitingQueue = function(e) {
733
- return e === void 0 && (e = {}), w.emit(
734
- 5,
735
- e
736
- );
737
- };
738
- p.isActive = function(e) {
739
- var t = !1;
740
- return G.forEach(function(n) {
741
- n.isToastActive && n.isToastActive(e) && (t = !0);
742
- }), t;
743
- };
744
- p.update = function(e, t) {
745
- t === void 0 && (t = {}), setTimeout(function() {
746
- var n = Xe(e, t);
747
- if (n) {
748
- var o = n.props, s = n.content, u = _({}, o, t, {
749
- toastId: t.toastId || e,
750
- updateId: De()
751
- });
752
- u.toastId !== e && (u.staleId = e);
753
- var g = u.render || s;
754
- delete u.render, ee(g, u);
755
- }
756
- }, 0);
757
- };
758
- p.done = function(e) {
759
- p.update(e, {
760
- progress: 1
761
- });
762
- };
763
- p.onChange = function(e) {
764
- return D(e) && w.on(
765
- 4,
766
- e
767
- ), function() {
768
- D(e) && w.off(
769
- 4,
770
- e
771
- );
772
- };
773
- };
774
- p.configure = function(e) {
775
- e === void 0 && (e = {}), ve = !0, Re = e;
776
- };
777
- p.POSITION = Oe;
778
- p.TYPE = A;
779
- w.on(
780
- 2,
781
- function(e) {
782
- de = e.containerId || e, G.set(de, e), fe.forEach(function(t) {
783
- w.emit(
784
- 0,
785
- t.content,
786
- t.options
787
- );
788
- }), fe = [];
789
- }
790
- ).on(
791
- 3,
792
- function(e) {
793
- G.delete(e.containerId || e), G.size === 0 && w.off(
794
- 0
795
- /* Show */
796
- ).off(
797
- 1
798
- /* Clear */
799
- ).off(
800
- 5
801
- /* ClearWaitingQueue */
802
- ), Ie && V && document.body.removeChild(V);
803
- }
804
- );
805
- export {
806
- Le as T,
807
- p as t
808
- };