@edinelsonslima/toast-notification 0.1.47 → 0.2.0
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.es.d.ts +10 -0
- package/index.es.js +1 -801
- package/package.json +3 -3
package/index.es.d.ts
CHANGED
|
@@ -79,3 +79,13 @@ export declare namespace toast {
|
|
|
79
79
|
export declare function ToastContainer({ classNames, defaultDuration, position, }: IToastContainerProps): JSX_2.Element;
|
|
80
80
|
|
|
81
81
|
export { }
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
declare namespace toast {
|
|
85
|
+
var error: (data: import("../@types").IReactNode | import("../@types").IToastWithoutType) => void;
|
|
86
|
+
var success: (data: import("../@types").IReactNode | import("../@types").IToastWithoutType) => void;
|
|
87
|
+
var warn: (data: import("../@types").IReactNode | import("../@types").IToastWithoutType) => void;
|
|
88
|
+
var info: (data: import("../@types").IReactNode | import("../@types").IToastWithoutType) => void;
|
|
89
|
+
var ghost: (data: import("../@types").IReactNode | import("../@types").IToastWithoutType) => void;
|
|
90
|
+
}
|
|
91
|
+
|
package/index.es.js
CHANGED
|
@@ -1,801 +1 @@
|
|
|
1
|
-
var hr = Object.defineProperty;
|
|
2
|
-
var br = (n, a, c) => a in n ? hr(n, a, { enumerable: !0, configurable: !0, writable: !0, value: c }) : n[a] = c;
|
|
3
|
-
var Ie = (n, a, c) => (br(n, typeof a != "symbol" ? a + "" : a, c), c);
|
|
4
|
-
import $e, { isValidElement as We, useState as Me, useCallback as Le, useEffect as Ue } from "react";
|
|
5
|
-
class yr {
|
|
6
|
-
constructor() {
|
|
7
|
-
Ie(this, "listeners", /* @__PURE__ */ new Map([]));
|
|
8
|
-
}
|
|
9
|
-
on(a, c) {
|
|
10
|
-
var d;
|
|
11
|
-
this.listeners.has(a) || this.listeners.set(a, []), (d = this.listeners.get(a)) == null || d.push(c);
|
|
12
|
-
}
|
|
13
|
-
emit(a, c) {
|
|
14
|
-
var d;
|
|
15
|
-
this.listeners.has(a) && ((d = this.listeners.get(a)) == null || d.forEach((y) => y(c)));
|
|
16
|
-
}
|
|
17
|
-
removeListener(a, c) {
|
|
18
|
-
const d = this.listeners.get(a);
|
|
19
|
-
if (!d)
|
|
20
|
-
return;
|
|
21
|
-
const y = d.filter(
|
|
22
|
-
(l) => l !== c
|
|
23
|
-
);
|
|
24
|
-
this.listeners.set(a, y);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function G(n) {
|
|
28
|
-
return function(a) {
|
|
29
|
-
if (We(a))
|
|
30
|
-
return I({ content: a, type: n });
|
|
31
|
-
const { content: c, duration: d } = a;
|
|
32
|
-
return I({ content: c, duration: d, type: n });
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function Er(n) {
|
|
36
|
-
if (n)
|
|
37
|
-
return We(n) || typeof n != "object" || Array.isArray(n) ? n : JSON.stringify(n);
|
|
38
|
-
}
|
|
39
|
-
const ie = new yr();
|
|
40
|
-
function I({ duration: n, content: a, type: c }) {
|
|
41
|
-
a = Er(a), ie.emit("add-toast", { content: a, duration: n, type: c });
|
|
42
|
-
}
|
|
43
|
-
I.error = G("error");
|
|
44
|
-
I.success = G("success");
|
|
45
|
-
I.warn = G("warn");
|
|
46
|
-
I.info = G("info");
|
|
47
|
-
I.ghost = G("ghost");
|
|
48
|
-
var se = { exports: {} }, Y = {};
|
|
49
|
-
/**
|
|
50
|
-
* @license React
|
|
51
|
-
* react-jsx-runtime.development.js
|
|
52
|
-
*
|
|
53
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the MIT license found in the
|
|
56
|
-
* LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/
|
|
58
|
-
var De;
|
|
59
|
-
function Rr() {
|
|
60
|
-
return De || (De = 1, process.env.NODE_ENV !== "production" && function() {
|
|
61
|
-
var n = $e, a = Symbol.for("react.element"), c = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), S = Symbol.for("react.provider"), j = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), w = Symbol.iterator, D = "@@iterator";
|
|
62
|
-
function F(e) {
|
|
63
|
-
if (e === null || typeof e != "object")
|
|
64
|
-
return null;
|
|
65
|
-
var r = w && e[w] || e[D];
|
|
66
|
-
return typeof r == "function" ? r : null;
|
|
67
|
-
}
|
|
68
|
-
var R = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
69
|
-
function h(e) {
|
|
70
|
-
{
|
|
71
|
-
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++)
|
|
72
|
-
t[o - 1] = arguments[o];
|
|
73
|
-
$("error", e, t);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function $(e, r, t) {
|
|
77
|
-
{
|
|
78
|
-
var o = R.ReactDebugCurrentFrame, u = o.getStackAddendum();
|
|
79
|
-
u !== "" && (r += "%s", t = t.concat([u]));
|
|
80
|
-
var f = t.map(function(s) {
|
|
81
|
-
return String(s);
|
|
82
|
-
});
|
|
83
|
-
f.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, f);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
var Z = !1, Ye = !1, Ve = !1, Ge = !1, Be = !1, fe;
|
|
87
|
-
fe = Symbol.for("react.module.reference");
|
|
88
|
-
function qe(e) {
|
|
89
|
-
return !!(typeof e == "string" || typeof e == "function" || e === d || e === l || Be || e === y || e === O || e === g || Ge || e === C || Z || Ye || Ve || typeof e == "object" && e !== null && (e.$$typeof === p || e.$$typeof === E || e.$$typeof === S || e.$$typeof === j || e.$$typeof === m || // This needs to include all possible module reference object
|
|
90
|
-
// types supported by any Flight configuration anywhere since
|
|
91
|
-
// we don't know which Flight build this will end up being used
|
|
92
|
-
// with.
|
|
93
|
-
e.$$typeof === fe || e.getModuleId !== void 0));
|
|
94
|
-
}
|
|
95
|
-
function Je(e, r, t) {
|
|
96
|
-
var o = e.displayName;
|
|
97
|
-
if (o)
|
|
98
|
-
return o;
|
|
99
|
-
var u = r.displayName || r.name || "";
|
|
100
|
-
return u !== "" ? t + "(" + u + ")" : t;
|
|
101
|
-
}
|
|
102
|
-
function ce(e) {
|
|
103
|
-
return e.displayName || "Context";
|
|
104
|
-
}
|
|
105
|
-
function P(e) {
|
|
106
|
-
if (e == null)
|
|
107
|
-
return null;
|
|
108
|
-
if (typeof e.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
109
|
-
return e.displayName || e.name || null;
|
|
110
|
-
if (typeof e == "string")
|
|
111
|
-
return e;
|
|
112
|
-
switch (e) {
|
|
113
|
-
case d:
|
|
114
|
-
return "Fragment";
|
|
115
|
-
case c:
|
|
116
|
-
return "Portal";
|
|
117
|
-
case l:
|
|
118
|
-
return "Profiler";
|
|
119
|
-
case y:
|
|
120
|
-
return "StrictMode";
|
|
121
|
-
case O:
|
|
122
|
-
return "Suspense";
|
|
123
|
-
case g:
|
|
124
|
-
return "SuspenseList";
|
|
125
|
-
}
|
|
126
|
-
if (typeof e == "object")
|
|
127
|
-
switch (e.$$typeof) {
|
|
128
|
-
case j:
|
|
129
|
-
var r = e;
|
|
130
|
-
return ce(r) + ".Consumer";
|
|
131
|
-
case S:
|
|
132
|
-
var t = e;
|
|
133
|
-
return ce(t._context) + ".Provider";
|
|
134
|
-
case m:
|
|
135
|
-
return Je(e, e.render, "ForwardRef");
|
|
136
|
-
case E:
|
|
137
|
-
var o = e.displayName || null;
|
|
138
|
-
return o !== null ? o : P(e.type) || "Memo";
|
|
139
|
-
case p: {
|
|
140
|
-
var u = e, f = u._payload, s = u._init;
|
|
141
|
-
try {
|
|
142
|
-
return P(s(f));
|
|
143
|
-
} catch {
|
|
144
|
-
return null;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
var k = Object.assign, L = 0, le, de, me, ve, _e, ge, pe;
|
|
151
|
-
function he() {
|
|
152
|
-
}
|
|
153
|
-
he.__reactDisabledLog = !0;
|
|
154
|
-
function ze() {
|
|
155
|
-
{
|
|
156
|
-
if (L === 0) {
|
|
157
|
-
le = console.log, de = console.info, me = console.warn, ve = console.error, _e = console.group, ge = console.groupCollapsed, pe = console.groupEnd;
|
|
158
|
-
var e = {
|
|
159
|
-
configurable: !0,
|
|
160
|
-
enumerable: !0,
|
|
161
|
-
value: he,
|
|
162
|
-
writable: !0
|
|
163
|
-
};
|
|
164
|
-
Object.defineProperties(console, {
|
|
165
|
-
info: e,
|
|
166
|
-
log: e,
|
|
167
|
-
warn: e,
|
|
168
|
-
error: e,
|
|
169
|
-
group: e,
|
|
170
|
-
groupCollapsed: e,
|
|
171
|
-
groupEnd: e
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
L++;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
function Ke() {
|
|
178
|
-
{
|
|
179
|
-
if (L--, L === 0) {
|
|
180
|
-
var e = {
|
|
181
|
-
configurable: !0,
|
|
182
|
-
enumerable: !0,
|
|
183
|
-
writable: !0
|
|
184
|
-
};
|
|
185
|
-
Object.defineProperties(console, {
|
|
186
|
-
log: k({}, e, {
|
|
187
|
-
value: le
|
|
188
|
-
}),
|
|
189
|
-
info: k({}, e, {
|
|
190
|
-
value: de
|
|
191
|
-
}),
|
|
192
|
-
warn: k({}, e, {
|
|
193
|
-
value: me
|
|
194
|
-
}),
|
|
195
|
-
error: k({}, e, {
|
|
196
|
-
value: ve
|
|
197
|
-
}),
|
|
198
|
-
group: k({}, e, {
|
|
199
|
-
value: _e
|
|
200
|
-
}),
|
|
201
|
-
groupCollapsed: k({}, e, {
|
|
202
|
-
value: ge
|
|
203
|
-
}),
|
|
204
|
-
groupEnd: k({}, e, {
|
|
205
|
-
value: pe
|
|
206
|
-
})
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
L < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
var Q = R.ReactCurrentDispatcher, N;
|
|
213
|
-
function B(e, r, t) {
|
|
214
|
-
{
|
|
215
|
-
if (N === void 0)
|
|
216
|
-
try {
|
|
217
|
-
throw Error();
|
|
218
|
-
} catch (u) {
|
|
219
|
-
var o = u.stack.trim().match(/\n( *(at )?)/);
|
|
220
|
-
N = o && o[1] || "";
|
|
221
|
-
}
|
|
222
|
-
return `
|
|
223
|
-
` + N + e;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
var ee = !1, q;
|
|
227
|
-
{
|
|
228
|
-
var He = typeof WeakMap == "function" ? WeakMap : Map;
|
|
229
|
-
q = new He();
|
|
230
|
-
}
|
|
231
|
-
function be(e, r) {
|
|
232
|
-
if (!e || ee)
|
|
233
|
-
return "";
|
|
234
|
-
{
|
|
235
|
-
var t = q.get(e);
|
|
236
|
-
if (t !== void 0)
|
|
237
|
-
return t;
|
|
238
|
-
}
|
|
239
|
-
var o;
|
|
240
|
-
ee = !0;
|
|
241
|
-
var u = Error.prepareStackTrace;
|
|
242
|
-
Error.prepareStackTrace = void 0;
|
|
243
|
-
var f;
|
|
244
|
-
f = Q.current, Q.current = null, ze();
|
|
245
|
-
try {
|
|
246
|
-
if (r) {
|
|
247
|
-
var s = function() {
|
|
248
|
-
throw Error();
|
|
249
|
-
};
|
|
250
|
-
if (Object.defineProperty(s.prototype, "props", {
|
|
251
|
-
set: function() {
|
|
252
|
-
throw Error();
|
|
253
|
-
}
|
|
254
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
255
|
-
try {
|
|
256
|
-
Reflect.construct(s, []);
|
|
257
|
-
} catch (x) {
|
|
258
|
-
o = x;
|
|
259
|
-
}
|
|
260
|
-
Reflect.construct(e, [], s);
|
|
261
|
-
} else {
|
|
262
|
-
try {
|
|
263
|
-
s.call();
|
|
264
|
-
} catch (x) {
|
|
265
|
-
o = x;
|
|
266
|
-
}
|
|
267
|
-
e.call(s.prototype);
|
|
268
|
-
}
|
|
269
|
-
} else {
|
|
270
|
-
try {
|
|
271
|
-
throw Error();
|
|
272
|
-
} catch (x) {
|
|
273
|
-
o = x;
|
|
274
|
-
}
|
|
275
|
-
e();
|
|
276
|
-
}
|
|
277
|
-
} catch (x) {
|
|
278
|
-
if (x && o && typeof x.stack == "string") {
|
|
279
|
-
for (var i = x.stack.split(`
|
|
280
|
-
`), b = o.stack.split(`
|
|
281
|
-
`), v = i.length - 1, _ = b.length - 1; v >= 1 && _ >= 0 && i[v] !== b[_]; )
|
|
282
|
-
_--;
|
|
283
|
-
for (; v >= 1 && _ >= 0; v--, _--)
|
|
284
|
-
if (i[v] !== b[_]) {
|
|
285
|
-
if (v !== 1 || _ !== 1)
|
|
286
|
-
do
|
|
287
|
-
if (v--, _--, _ < 0 || i[v] !== b[_]) {
|
|
288
|
-
var T = `
|
|
289
|
-
` + i[v].replace(" at new ", " at ");
|
|
290
|
-
return e.displayName && T.includes("<anonymous>") && (T = T.replace("<anonymous>", e.displayName)), typeof e == "function" && q.set(e, T), T;
|
|
291
|
-
}
|
|
292
|
-
while (v >= 1 && _ >= 0);
|
|
293
|
-
break;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
} finally {
|
|
297
|
-
ee = !1, Q.current = f, Ke(), Error.prepareStackTrace = u;
|
|
298
|
-
}
|
|
299
|
-
var M = e ? e.displayName || e.name : "", Ae = M ? B(M) : "";
|
|
300
|
-
return typeof e == "function" && q.set(e, Ae), Ae;
|
|
301
|
-
}
|
|
302
|
-
function Xe(e, r, t) {
|
|
303
|
-
return be(e, !1);
|
|
304
|
-
}
|
|
305
|
-
function Ze(e) {
|
|
306
|
-
var r = e.prototype;
|
|
307
|
-
return !!(r && r.isReactComponent);
|
|
308
|
-
}
|
|
309
|
-
function J(e, r, t) {
|
|
310
|
-
if (e == null)
|
|
311
|
-
return "";
|
|
312
|
-
if (typeof e == "function")
|
|
313
|
-
return be(e, Ze(e));
|
|
314
|
-
if (typeof e == "string")
|
|
315
|
-
return B(e);
|
|
316
|
-
switch (e) {
|
|
317
|
-
case O:
|
|
318
|
-
return B("Suspense");
|
|
319
|
-
case g:
|
|
320
|
-
return B("SuspenseList");
|
|
321
|
-
}
|
|
322
|
-
if (typeof e == "object")
|
|
323
|
-
switch (e.$$typeof) {
|
|
324
|
-
case m:
|
|
325
|
-
return Xe(e.render);
|
|
326
|
-
case E:
|
|
327
|
-
return J(e.type, r, t);
|
|
328
|
-
case p: {
|
|
329
|
-
var o = e, u = o._payload, f = o._init;
|
|
330
|
-
try {
|
|
331
|
-
return J(f(u), r, t);
|
|
332
|
-
} catch {
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
return "";
|
|
337
|
-
}
|
|
338
|
-
var z = Object.prototype.hasOwnProperty, ye = {}, Ee = R.ReactDebugCurrentFrame;
|
|
339
|
-
function K(e) {
|
|
340
|
-
if (e) {
|
|
341
|
-
var r = e._owner, t = J(e.type, e._source, r ? r.type : null);
|
|
342
|
-
Ee.setExtraStackFrame(t);
|
|
343
|
-
} else
|
|
344
|
-
Ee.setExtraStackFrame(null);
|
|
345
|
-
}
|
|
346
|
-
function Qe(e, r, t, o, u) {
|
|
347
|
-
{
|
|
348
|
-
var f = Function.call.bind(z);
|
|
349
|
-
for (var s in e)
|
|
350
|
-
if (f(e, s)) {
|
|
351
|
-
var i = void 0;
|
|
352
|
-
try {
|
|
353
|
-
if (typeof e[s] != "function") {
|
|
354
|
-
var b = Error((o || "React class") + ": " + t + " type `" + s + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[s] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
355
|
-
throw b.name = "Invariant Violation", b;
|
|
356
|
-
}
|
|
357
|
-
i = e[s](r, s, o, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
358
|
-
} catch (v) {
|
|
359
|
-
i = v;
|
|
360
|
-
}
|
|
361
|
-
i && !(i instanceof Error) && (K(u), h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", o || "React class", t, s, typeof i), K(null)), i instanceof Error && !(i.message in ye) && (ye[i.message] = !0, K(u), h("Failed %s type: %s", t, i.message), K(null));
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
var Ne = Array.isArray;
|
|
366
|
-
function re(e) {
|
|
367
|
-
return Ne(e);
|
|
368
|
-
}
|
|
369
|
-
function er(e) {
|
|
370
|
-
{
|
|
371
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
372
|
-
return t;
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
function rr(e) {
|
|
376
|
-
try {
|
|
377
|
-
return Re(e), !1;
|
|
378
|
-
} catch {
|
|
379
|
-
return !0;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
function Re(e) {
|
|
383
|
-
return "" + e;
|
|
384
|
-
}
|
|
385
|
-
function je(e) {
|
|
386
|
-
if (rr(e))
|
|
387
|
-
return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), Re(e);
|
|
388
|
-
}
|
|
389
|
-
var U = R.ReactCurrentOwner, tr = {
|
|
390
|
-
key: !0,
|
|
391
|
-
ref: !0,
|
|
392
|
-
__self: !0,
|
|
393
|
-
__source: !0
|
|
394
|
-
}, Ce, Te, te;
|
|
395
|
-
te = {};
|
|
396
|
-
function nr(e) {
|
|
397
|
-
if (z.call(e, "ref")) {
|
|
398
|
-
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
399
|
-
if (r && r.isReactWarning)
|
|
400
|
-
return !1;
|
|
401
|
-
}
|
|
402
|
-
return e.ref !== void 0;
|
|
403
|
-
}
|
|
404
|
-
function or(e) {
|
|
405
|
-
if (z.call(e, "key")) {
|
|
406
|
-
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
407
|
-
if (r && r.isReactWarning)
|
|
408
|
-
return !1;
|
|
409
|
-
}
|
|
410
|
-
return e.key !== void 0;
|
|
411
|
-
}
|
|
412
|
-
function ar(e, r) {
|
|
413
|
-
if (typeof e.ref == "string" && U.current && r && U.current.stateNode !== r) {
|
|
414
|
-
var t = P(U.current.type);
|
|
415
|
-
te[t] || (h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', P(U.current.type), e.ref), te[t] = !0);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
function ir(e, r) {
|
|
419
|
-
{
|
|
420
|
-
var t = function() {
|
|
421
|
-
Ce || (Ce = !0, h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
422
|
-
};
|
|
423
|
-
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
424
|
-
get: t,
|
|
425
|
-
configurable: !0
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
function sr(e, r) {
|
|
430
|
-
{
|
|
431
|
-
var t = function() {
|
|
432
|
-
Te || (Te = !0, h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
433
|
-
};
|
|
434
|
-
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
435
|
-
get: t,
|
|
436
|
-
configurable: !0
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
var ur = function(e, r, t, o, u, f, s) {
|
|
441
|
-
var i = {
|
|
442
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
443
|
-
$$typeof: a,
|
|
444
|
-
// Built-in properties that belong on the element
|
|
445
|
-
type: e,
|
|
446
|
-
key: r,
|
|
447
|
-
ref: t,
|
|
448
|
-
props: s,
|
|
449
|
-
// Record the component responsible for creating this element.
|
|
450
|
-
_owner: f
|
|
451
|
-
};
|
|
452
|
-
return i._store = {}, Object.defineProperty(i._store, "validated", {
|
|
453
|
-
configurable: !1,
|
|
454
|
-
enumerable: !1,
|
|
455
|
-
writable: !0,
|
|
456
|
-
value: !1
|
|
457
|
-
}), Object.defineProperty(i, "_self", {
|
|
458
|
-
configurable: !1,
|
|
459
|
-
enumerable: !1,
|
|
460
|
-
writable: !1,
|
|
461
|
-
value: o
|
|
462
|
-
}), Object.defineProperty(i, "_source", {
|
|
463
|
-
configurable: !1,
|
|
464
|
-
enumerable: !1,
|
|
465
|
-
writable: !1,
|
|
466
|
-
value: u
|
|
467
|
-
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
|
|
468
|
-
};
|
|
469
|
-
function fr(e, r, t, o, u) {
|
|
470
|
-
{
|
|
471
|
-
var f, s = {}, i = null, b = null;
|
|
472
|
-
t !== void 0 && (je(t), i = "" + t), or(r) && (je(r.key), i = "" + r.key), nr(r) && (b = r.ref, ar(r, u));
|
|
473
|
-
for (f in r)
|
|
474
|
-
z.call(r, f) && !tr.hasOwnProperty(f) && (s[f] = r[f]);
|
|
475
|
-
if (e && e.defaultProps) {
|
|
476
|
-
var v = e.defaultProps;
|
|
477
|
-
for (f in v)
|
|
478
|
-
s[f] === void 0 && (s[f] = v[f]);
|
|
479
|
-
}
|
|
480
|
-
if (i || b) {
|
|
481
|
-
var _ = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
482
|
-
i && ir(s, _), b && sr(s, _);
|
|
483
|
-
}
|
|
484
|
-
return ur(e, i, b, u, o, U.current, s);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
var ne = R.ReactCurrentOwner, Se = R.ReactDebugCurrentFrame;
|
|
488
|
-
function W(e) {
|
|
489
|
-
if (e) {
|
|
490
|
-
var r = e._owner, t = J(e.type, e._source, r ? r.type : null);
|
|
491
|
-
Se.setExtraStackFrame(t);
|
|
492
|
-
} else
|
|
493
|
-
Se.setExtraStackFrame(null);
|
|
494
|
-
}
|
|
495
|
-
var oe;
|
|
496
|
-
oe = !1;
|
|
497
|
-
function ae(e) {
|
|
498
|
-
return typeof e == "object" && e !== null && e.$$typeof === a;
|
|
499
|
-
}
|
|
500
|
-
function Oe() {
|
|
501
|
-
{
|
|
502
|
-
if (ne.current) {
|
|
503
|
-
var e = P(ne.current.type);
|
|
504
|
-
if (e)
|
|
505
|
-
return `
|
|
506
|
-
|
|
507
|
-
Check the render method of \`` + e + "`.";
|
|
508
|
-
}
|
|
509
|
-
return "";
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
function cr(e) {
|
|
513
|
-
{
|
|
514
|
-
if (e !== void 0) {
|
|
515
|
-
var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
|
|
516
|
-
return `
|
|
517
|
-
|
|
518
|
-
Check your code at ` + r + ":" + t + ".";
|
|
519
|
-
}
|
|
520
|
-
return "";
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
var we = {};
|
|
524
|
-
function lr(e) {
|
|
525
|
-
{
|
|
526
|
-
var r = Oe();
|
|
527
|
-
if (!r) {
|
|
528
|
-
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
529
|
-
t && (r = `
|
|
530
|
-
|
|
531
|
-
Check the top-level render call using <` + t + ">.");
|
|
532
|
-
}
|
|
533
|
-
return r;
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
function Pe(e, r) {
|
|
537
|
-
{
|
|
538
|
-
if (!e._store || e._store.validated || e.key != null)
|
|
539
|
-
return;
|
|
540
|
-
e._store.validated = !0;
|
|
541
|
-
var t = lr(r);
|
|
542
|
-
if (we[t])
|
|
543
|
-
return;
|
|
544
|
-
we[t] = !0;
|
|
545
|
-
var o = "";
|
|
546
|
-
e && e._owner && e._owner !== ne.current && (o = " It was passed a child from " + P(e._owner.type) + "."), W(e), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, o), W(null);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
function xe(e, r) {
|
|
550
|
-
{
|
|
551
|
-
if (typeof e != "object")
|
|
552
|
-
return;
|
|
553
|
-
if (re(e))
|
|
554
|
-
for (var t = 0; t < e.length; t++) {
|
|
555
|
-
var o = e[t];
|
|
556
|
-
ae(o) && Pe(o, r);
|
|
557
|
-
}
|
|
558
|
-
else if (ae(e))
|
|
559
|
-
e._store && (e._store.validated = !0);
|
|
560
|
-
else if (e) {
|
|
561
|
-
var u = F(e);
|
|
562
|
-
if (typeof u == "function" && u !== e.entries)
|
|
563
|
-
for (var f = u.call(e), s; !(s = f.next()).done; )
|
|
564
|
-
ae(s.value) && Pe(s.value, r);
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
function dr(e) {
|
|
569
|
-
{
|
|
570
|
-
var r = e.type;
|
|
571
|
-
if (r == null || typeof r == "string")
|
|
572
|
-
return;
|
|
573
|
-
var t;
|
|
574
|
-
if (typeof r == "function")
|
|
575
|
-
t = r.propTypes;
|
|
576
|
-
else if (typeof r == "object" && (r.$$typeof === m || // Note: Memo only checks outer props here.
|
|
577
|
-
// Inner props are checked in the reconciler.
|
|
578
|
-
r.$$typeof === E))
|
|
579
|
-
t = r.propTypes;
|
|
580
|
-
else
|
|
581
|
-
return;
|
|
582
|
-
if (t) {
|
|
583
|
-
var o = P(r);
|
|
584
|
-
Qe(t, e.props, "prop", o, e);
|
|
585
|
-
} else if (r.PropTypes !== void 0 && !oe) {
|
|
586
|
-
oe = !0;
|
|
587
|
-
var u = P(r);
|
|
588
|
-
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
|
|
589
|
-
}
|
|
590
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
function mr(e) {
|
|
594
|
-
{
|
|
595
|
-
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
596
|
-
var o = r[t];
|
|
597
|
-
if (o !== "children" && o !== "key") {
|
|
598
|
-
W(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), W(null);
|
|
599
|
-
break;
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
e.ref !== null && (W(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
function ke(e, r, t, o, u, f) {
|
|
606
|
-
{
|
|
607
|
-
var s = qe(e);
|
|
608
|
-
if (!s) {
|
|
609
|
-
var i = "";
|
|
610
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
611
|
-
var b = cr(u);
|
|
612
|
-
b ? i += b : i += Oe();
|
|
613
|
-
var v;
|
|
614
|
-
e === null ? v = "null" : re(e) ? v = "array" : e !== void 0 && e.$$typeof === a ? (v = "<" + (P(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : v = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", v, i);
|
|
615
|
-
}
|
|
616
|
-
var _ = fr(e, r, t, u, f);
|
|
617
|
-
if (_ == null)
|
|
618
|
-
return _;
|
|
619
|
-
if (s) {
|
|
620
|
-
var T = r.children;
|
|
621
|
-
if (T !== void 0)
|
|
622
|
-
if (o)
|
|
623
|
-
if (re(T)) {
|
|
624
|
-
for (var M = 0; M < T.length; M++)
|
|
625
|
-
xe(T[M], e);
|
|
626
|
-
Object.freeze && Object.freeze(T);
|
|
627
|
-
} else
|
|
628
|
-
h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
629
|
-
else
|
|
630
|
-
xe(T, e);
|
|
631
|
-
}
|
|
632
|
-
return e === d ? mr(_) : dr(_), _;
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
function vr(e, r, t) {
|
|
636
|
-
return ke(e, r, t, !0);
|
|
637
|
-
}
|
|
638
|
-
function _r(e, r, t) {
|
|
639
|
-
return ke(e, r, t, !1);
|
|
640
|
-
}
|
|
641
|
-
var gr = _r, pr = vr;
|
|
642
|
-
Y.Fragment = d, Y.jsx = gr, Y.jsxs = pr;
|
|
643
|
-
}()), Y;
|
|
644
|
-
}
|
|
645
|
-
var V = {};
|
|
646
|
-
/**
|
|
647
|
-
* @license React
|
|
648
|
-
* react-jsx-runtime.production.min.js
|
|
649
|
-
*
|
|
650
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
651
|
-
*
|
|
652
|
-
* This source code is licensed under the MIT license found in the
|
|
653
|
-
* LICENSE file in the root directory of this source tree.
|
|
654
|
-
*/
|
|
655
|
-
var Fe;
|
|
656
|
-
function jr() {
|
|
657
|
-
if (Fe)
|
|
658
|
-
return V;
|
|
659
|
-
Fe = 1;
|
|
660
|
-
var n = $e, a = Symbol.for("react.element"), c = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, y = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
661
|
-
function S(j, m, O) {
|
|
662
|
-
var g, E = {}, p = null, C = null;
|
|
663
|
-
O !== void 0 && (p = "" + O), m.key !== void 0 && (p = "" + m.key), m.ref !== void 0 && (C = m.ref);
|
|
664
|
-
for (g in m)
|
|
665
|
-
d.call(m, g) && !l.hasOwnProperty(g) && (E[g] = m[g]);
|
|
666
|
-
if (j && j.defaultProps)
|
|
667
|
-
for (g in m = j.defaultProps, m)
|
|
668
|
-
E[g] === void 0 && (E[g] = m[g]);
|
|
669
|
-
return { $$typeof: a, type: j, key: p, ref: C, props: E, _owner: y.current };
|
|
670
|
-
}
|
|
671
|
-
return V.Fragment = c, V.jsx = S, V.jsxs = S, V;
|
|
672
|
-
}
|
|
673
|
-
process.env.NODE_ENV === "production" ? se.exports = jr() : se.exports = Rr();
|
|
674
|
-
var ue = se.exports;
|
|
675
|
-
function H(n) {
|
|
676
|
-
if (!(!n || typeof n != "object"))
|
|
677
|
-
return n;
|
|
678
|
-
}
|
|
679
|
-
function X(n) {
|
|
680
|
-
return !n || typeof n != "string" ? "" : n;
|
|
681
|
-
}
|
|
682
|
-
const Cr = "_screenRightIn_1ojrm_1", Tr = "_screenCenterIn_1ojrm_1", Sr = "_screenLeftIn_1ojrm_1", Or = "_success_1ojrm_114", wr = "_info_1ojrm_118", Pr = "_warn_1ojrm_123", xr = "_error_1ojrm_127", kr = "_ghost_1ojrm_132", Ar = "_screenOut_1ojrm_1", A = {
|
|
683
|
-
"toast-container": "_toast-container_1ojrm_1",
|
|
684
|
-
"animation-message-right-top": "_animation-message-right-top_1ojrm_9",
|
|
685
|
-
"animation-message-right-center": "_animation-message-right-center_1ojrm_10",
|
|
686
|
-
"animation-message-right-bottom": "_animation-message-right-bottom_1ojrm_11",
|
|
687
|
-
screenRightIn: Cr,
|
|
688
|
-
"right-top": "_right-top_1ojrm_15",
|
|
689
|
-
"right-center": "_right-center_1ojrm_16",
|
|
690
|
-
"right-bottom": "_right-bottom_1ojrm_17",
|
|
691
|
-
"animation-message-center-top": "_animation-message-center-top_1ojrm_37",
|
|
692
|
-
"animation-message-center-bottom": "_animation-message-center-bottom_1ojrm_38",
|
|
693
|
-
"animation-message-center-center": "_animation-message-center-center_1ojrm_39",
|
|
694
|
-
screenCenterIn: Tr,
|
|
695
|
-
"center-top": "_center-top_1ojrm_43",
|
|
696
|
-
"center-center": "_center-center_1ojrm_44",
|
|
697
|
-
"center-bottom": "_center-bottom_1ojrm_45",
|
|
698
|
-
"animation-message-left-top": "_animation-message-left-top_1ojrm_64",
|
|
699
|
-
"animation-message-left-center": "_animation-message-left-center_1ojrm_65",
|
|
700
|
-
"animation-message-left-bottom": "_animation-message-left-bottom_1ojrm_66",
|
|
701
|
-
screenLeftIn: Sr,
|
|
702
|
-
"left-top": "_left-top_1ojrm_70",
|
|
703
|
-
"left-center": "_left-center_1ojrm_71",
|
|
704
|
-
"left-bottom": "_left-bottom_1ojrm_72",
|
|
705
|
-
"toast-message": "_toast-message_1ojrm_90",
|
|
706
|
-
success: Or,
|
|
707
|
-
info: wr,
|
|
708
|
-
warn: Pr,
|
|
709
|
-
error: xr,
|
|
710
|
-
ghost: kr,
|
|
711
|
-
"animation-unmount": "_animation-unmount_1ojrm_136",
|
|
712
|
-
screenOut: Ar
|
|
713
|
-
};
|
|
714
|
-
function Ir({
|
|
715
|
-
message: { duration: n = 1e3 * 7, id: a, content: c, type: d },
|
|
716
|
-
onRemoveMessage: y,
|
|
717
|
-
classNames: l
|
|
718
|
-
}) {
|
|
719
|
-
var D, F;
|
|
720
|
-
const S = (D = l == null ? void 0 : l.toastMessages) == null ? void 0 : D["*"], j = (F = l == null ? void 0 : l.toastMessages) == null ? void 0 : F[d], [m, O] = Me(void 0);
|
|
721
|
-
function g() {
|
|
722
|
-
return m ? A[m] ? A[m] : m : "";
|
|
723
|
-
}
|
|
724
|
-
function E(R) {
|
|
725
|
-
var $;
|
|
726
|
-
const h = g();
|
|
727
|
-
($ = R.currentTarget.classList) != null && $.contains(h) && y(a);
|
|
728
|
-
}
|
|
729
|
-
function p() {
|
|
730
|
-
const R = X(S), h = X(j), $ = g(), Z = A[`animation-message-${l == null ? void 0 : l.toastPosition}`];
|
|
731
|
-
return `${A["toast-message"]} ${A[d]} ${Z} ${$} ${h} ${R}`.trim();
|
|
732
|
-
}
|
|
733
|
-
function C() {
|
|
734
|
-
return { ...H(S), ...H(j) };
|
|
735
|
-
}
|
|
736
|
-
const w = Le(() => {
|
|
737
|
-
O((l == null ? void 0 : l.animationUnmount) || "animation-unmount");
|
|
738
|
-
}, [l == null ? void 0 : l.animationUnmount]);
|
|
739
|
-
return Ue(() => {
|
|
740
|
-
const R = setTimeout(() => w(), n);
|
|
741
|
-
return () => clearTimeout(R);
|
|
742
|
-
}, [y, a, n, w]), /* @__PURE__ */ ue.jsx(
|
|
743
|
-
"span",
|
|
744
|
-
{
|
|
745
|
-
tabIndex: 0,
|
|
746
|
-
onAnimationEnd: E,
|
|
747
|
-
onClick: w,
|
|
748
|
-
style: C(),
|
|
749
|
-
className: p(),
|
|
750
|
-
children: c
|
|
751
|
-
}
|
|
752
|
-
);
|
|
753
|
-
}
|
|
754
|
-
function $r({
|
|
755
|
-
classNames: n,
|
|
756
|
-
defaultDuration: a,
|
|
757
|
-
position: c = "right-top"
|
|
758
|
-
}) {
|
|
759
|
-
var g, E;
|
|
760
|
-
const d = (g = n == null ? void 0 : n.toastContainer) == null ? void 0 : g["*"], y = (E = n == null ? void 0 : n.toastContainer) == null ? void 0 : E[c], [l, S] = Me([]);
|
|
761
|
-
function j() {
|
|
762
|
-
const p = X(d), C = X(y);
|
|
763
|
-
return `${A["toast-container"]} ${A[c]} ${C} ${p}`.trim();
|
|
764
|
-
}
|
|
765
|
-
function m() {
|
|
766
|
-
return { ...H(d), ...H(y) };
|
|
767
|
-
}
|
|
768
|
-
const O = Le((p) => {
|
|
769
|
-
S(
|
|
770
|
-
(C) => C.filter((w) => w.id !== p)
|
|
771
|
-
);
|
|
772
|
-
}, []);
|
|
773
|
-
return Ue(() => {
|
|
774
|
-
function p(C) {
|
|
775
|
-
const { content: w, type: D, duration: F = a } = C;
|
|
776
|
-
S((R) => [
|
|
777
|
-
...R,
|
|
778
|
-
{ id: crypto.randomUUID(), content: w, duration: F, type: D }
|
|
779
|
-
]);
|
|
780
|
-
}
|
|
781
|
-
return ie.on("add-toast", p), () => {
|
|
782
|
-
ie.removeListener("add-toast", p);
|
|
783
|
-
};
|
|
784
|
-
}, [a]), /* @__PURE__ */ ue.jsx("div", { style: m(), className: j(), children: l.map((p) => /* @__PURE__ */ ue.jsx(
|
|
785
|
-
Ir,
|
|
786
|
-
{
|
|
787
|
-
message: p,
|
|
788
|
-
onRemoveMessage: O,
|
|
789
|
-
classNames: {
|
|
790
|
-
toastPosition: c,
|
|
791
|
-
toastMessages: n == null ? void 0 : n.toastMessages,
|
|
792
|
-
animationUnmount: n == null ? void 0 : n.animationUnmount
|
|
793
|
-
}
|
|
794
|
-
},
|
|
795
|
-
p.id
|
|
796
|
-
)) });
|
|
797
|
-
}
|
|
798
|
-
export {
|
|
799
|
-
$r as ToastContainer,
|
|
800
|
-
I as toast
|
|
801
|
-
};
|
|
1
|
+
var hr=Object.defineProperty,br=(e,t,r)=>t in e?hr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ie=(e,t,r)=>(br(e,"symbol"!=typeof t?t+"":t,r),r);import $e,{isValidElement as We,useState as Me,useCallback as Le,useEffect as Ue}from"react";class yr{constructor(){Ie(this,"listeners",new Map([]))}on(e,t){var r;this.listeners.has(e)||this.listeners.set(e,[]),null==(r=this.listeners.get(e))||r.push(t)}emit(e,t){var r;this.listeners.has(e)&&(null==(r=this.listeners.get(e))||r.forEach((e=>e(t))))}removeListener(e,t){const r=this.listeners.get(e);if(!r)return;const n=r.filter((e=>e!==t));this.listeners.set(e,n)}}function G(e){return function(t){if(We(t))return I({content:t,type:e});const{content:r,duration:n}=t;return I({content:r,duration:n,type:e})}}function Er(e){if(e)return We(e)||"object"!=typeof e||Array.isArray(e)?e:JSON.stringify(e)}const ie=new yr;function I({duration:e,content:t,type:r}){t=Er(t),ie.emit("add-toast",{content:t,duration:e,type:r})}I.error=G("error"),I.success=G("success"),I.warn=G("warn"),I.info=G("info"),I.ghost=G("ghost");var De,se={exports:{}},Y={};function Rr(){if(De)return Y;De=1;var e=$e,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function i(e,r,i){var s,c={},u=null,l=null;for(s in void 0!==i&&(u=""+i),void 0!==r.key&&(u=""+r.key),void 0!==r.ref&&(l=r.ref),r)n.call(r,s)&&!a.hasOwnProperty(s)&&(c[s]=r[s]);if(e&&e.defaultProps)for(s in r=e.defaultProps)void 0===c[s]&&(c[s]=r[s]);return{$$typeof:t,type:e,key:u,ref:l,props:c,_owner:o.current}}return Y.Fragment=r,Y.jsx=i,Y.jsxs=i,Y}var Fe,V={};function jr(){return Fe||(Fe=1,"production"!==process.env.NODE_ENV&&function(){var e=$e,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),y=Symbol.iterator,d="@@iterator";var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];!function(e,t,r){var n=_.ReactDebugCurrentFrame,o=n.getStackAddendum();""!==o&&(t+="%s",r=r.concat([o]));var a=r.map((function(e){return String(e)}));a.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,a)}("error",e,r)}var v,h=!1,b=!1,j=!1,w=!1,k=!1;function O(e){return e.displayName||"Context"}function S(e){if(null==e)return null;if("number"==typeof e.tag&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case n:return"Fragment";case r:return"Portal";case a:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case l:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return O(e)+".Consumer";case i:return O(e._context)+".Provider";case c:return function(e,t,r){var n=e.displayName;if(n)return n;var o=t.displayName||t.name||"";return""!==o?r+"("+o+")":r}(e,e.render,"ForwardRef");case f:var t=e.displayName||null;return null!==t?t:S(e.type)||"Memo";case p:var m=e,y=m._payload,d=m._init;try{return S(d(y))}catch{return null}}return null}v=Symbol.for("react.module.reference");var R,E,$,I,P,T,x,C=Object.assign,N=0;function D(){}D.__reactDisabledLog=!0;var F,A=_.ReactCurrentDispatcher;function L(e,t,r){if(void 0===F)try{throw Error()}catch(e){var n=e.stack.trim().match(/\n( *(at )?)/);F=n&&n[1]||""}return"\n"+F+e}var U,M=!1,W="function"==typeof WeakMap?WeakMap:Map;function Y(e,t){if(!e||M)return"";var r,n=U.get(e);if(void 0!==n)return n;M=!0;var o,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,o=A.current,A.current=null,function(){if(0===N){R=console.log,E=console.info,$=console.warn,I=console.error,P=console.group,T=console.groupCollapsed,x=console.groupEnd;var e={configurable:!0,enumerable:!0,value:D,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}();try{if(t){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(i,[])}catch(e){r=e}Reflect.construct(e,[],i)}else{try{i.call()}catch(e){r=e}e.call(i.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var s=t.stack.split("\n"),c=r.stack.split("\n"),u=s.length-1,l=c.length-1;u>=1&&l>=0&&s[u]!==c[l];)l--;for(;u>=1&&l>=0;u--,l--)if(s[u]!==c[l]){if(1!==u||1!==l)do{if(u--,--l<0||s[u]!==c[l]){var f="\n"+s[u].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),"function"==typeof e&&U.set(e,f),f}}while(u>=1&&l>=0);break}}}finally{M=!1,A.current=o,function(){if(0==--N){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:C({},e,{value:R}),info:C({},e,{value:E}),warn:C({},e,{value:$}),error:C({},e,{value:I}),group:C({},e,{value:P}),groupCollapsed:C({},e,{value:T}),groupEnd:C({},e,{value:x})})}N<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var p=e?e.displayName||e.name:"",m=p?L(p):"";return"function"==typeof e&&U.set(e,m),m}function z(e,t,r){if(null==e)return"";if("function"==typeof e)return Y(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return L(e);switch(e){case u:return L("Suspense");case l:return L("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case c:return function(e,t,r){return Y(e,!1)}(e.render);case f:return z(e.type,t,r);case p:var n=e,o=n._payload,a=n._init;try{return z(a(o),t,r)}catch{}}return""}U=new W;var G=Object.prototype.hasOwnProperty,H={},X=_.ReactDebugCurrentFrame;function B(e){if(e){var t=e._owner,r=z(e.type,e._source,t?t.type:null);X.setExtraStackFrame(r)}else X.setExtraStackFrame(null)}var q=Array.isArray;function J(e){return q(e)}function K(e){return""+e}function Q(e){if(function(e){try{return K(e),!1}catch{return!0}}(e))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),K(e)}var Z,ee,te,re=_.ReactCurrentOwner,ne={key:!0,ref:!0,__self:!0,__source:!0};te={};var oe=function(e,r,n,o,a,i,s){var c={$$typeof:t,type:e,key:r,ref:n,props:s,_owner:i,_store:{}};return Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function ae(e,t,r,n,o){var a,i={},s=null,c=null;for(a in void 0!==r&&(Q(r),s=""+r),function(e){if(G.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(Q(t.key),s=""+t.key),function(e){if(G.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(c=t.ref,function(e,t){if("string"==typeof e.ref&&re.current&&t&&re.current.stateNode!==t){var r=S(re.current.type);te[r]||(g('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',S(re.current.type),e.ref),te[r]=!0)}}(t,o)),t)G.call(t,a)&&!ne.hasOwnProperty(a)&&(i[a]=t[a]);if(e&&e.defaultProps){var u=e.defaultProps;for(a in u)void 0===i[a]&&(i[a]=u[a])}if(s||c){var l="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var r=function(){Z||(Z=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}(i,l),c&&function(e,t){var r=function(){ee||(ee=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}(i,l)}return oe(e,s,c,o,n,re.current,i)}var ie,se=_.ReactCurrentOwner,ce=_.ReactDebugCurrentFrame;function ue(e){if(e){var t=e._owner,r=z(e.type,e._source,t?t.type:null);ce.setExtraStackFrame(r)}else ce.setExtraStackFrame(null)}function le(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}function fe(){if(se.current){var e=S(se.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}ie=!1;var pe={};function me(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var r=function(e){var t=fe();if(!t){var r="string"==typeof e?e:e.displayName||e.name;r&&(t="\n\nCheck the top-level render call using <"+r+">.")}return t}(t);if(!pe[r]){pe[r]=!0;var n="";e&&e._owner&&e._owner!==se.current&&(n=" It was passed a child from "+S(e._owner.type)+"."),ue(e),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,n),ue(null)}}}function ye(e,t){if("object"==typeof e)if(J(e))for(var r=0;r<e.length;r++){var n=e[r];le(n)&&me(n,t)}else if(le(e))e._store&&(e._store.validated=!0);else if(e){var o=function(e){if(null===e||"object"!=typeof e)return null;var t=y&&e[y]||e[d];return"function"==typeof t?t:null}(e);if("function"==typeof o&&o!==e.entries)for(var a,i=o.call(e);!(a=i.next()).done;)le(a.value)&&me(a.value,t)}}function de(e){var t,r=e.type;if(null!=r&&"string"!=typeof r){if("function"==typeof r)t=r.propTypes;else{if("object"!=typeof r||r.$$typeof!==c&&r.$$typeof!==f)return;t=r.propTypes}if(t){var n=S(r);!function(e,t,r,n,o){var a=Function.call.bind(G);for(var i in e)if(a(e,i)){var s=void 0;try{if("function"!=typeof e[i]){var c=Error((n||"React class")+": "+r+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name="Invariant Violation",c}s=e[i](t,i,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){s=e}s&&!(s instanceof Error)&&(B(o),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",r,i,typeof s),B(null)),s instanceof Error&&!(s.message in H)&&(H[s.message]=!0,B(o),g("Failed %s type: %s",r,s.message),B(null))}}(t,e.props,"prop",n,e)}else if(void 0!==r.PropTypes&&!ie){ie=!0,g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S(r)||"Unknown")}"function"==typeof r.getDefaultProps&&!r.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _e(e,r,y,d,_,O){var R=function(e){return!!("string"==typeof e||"function"==typeof e||e===n||e===a||k||e===o||e===u||e===l||w||e===m||h||b||j||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===f||e.$$typeof===i||e.$$typeof===s||e.$$typeof===c||e.$$typeof===v||void 0!==e.getModuleId))}(e);if(!R){var E="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(E+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var $,I=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(_);E+=I||fe(),null===e?$="null":J(e)?$="array":void 0!==e&&e.$$typeof===t?($="<"+(S(e.type)||"Unknown")+" />",E=" Did you accidentally export a JSX literal instead of a component?"):$=typeof e,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",$,E)}var P=ae(e,r,y,_,O);if(null==P)return P;if(R){var T=r.children;if(void 0!==T)if(d)if(J(T)){for(var x=0;x<T.length;x++)ye(T[x],e);Object.freeze&&Object.freeze(T)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ye(T,e)}return e===n?function(e){for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){ue(e),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),ue(null);break}}null!==e.ref&&(ue(e),g("Invalid attribute `ref` supplied to `React.Fragment`."),ue(null))}(P):de(P),P}var ge=function(e,t,r){return _e(e,t,r,!1)},ve=function(e,t,r){return _e(e,t,r,!0)};V.Fragment=n,V.jsx=ge,V.jsxs=ve}()),V}"production"===process.env.NODE_ENV?se.exports=Rr():se.exports=jr();var ue=se.exports;function H(e){if(e&&"object"==typeof e)return e}function X(e){return e&&"string"==typeof e?e:""}const Cr="_screenRightIn_1ojrm_1",Tr="_screenCenterIn_1ojrm_1",Sr="_screenLeftIn_1ojrm_1",Or="_success_1ojrm_114",wr="_info_1ojrm_118",Pr="_warn_1ojrm_123",xr="_error_1ojrm_127",kr="_ghost_1ojrm_132",Ar="_screenOut_1ojrm_1",A={"toast-container":"_toast-container_1ojrm_1","animation-message-right-top":"_animation-message-right-top_1ojrm_9","animation-message-right-center":"_animation-message-right-center_1ojrm_10","animation-message-right-bottom":"_animation-message-right-bottom_1ojrm_11",screenRightIn:Cr,"right-top":"_right-top_1ojrm_15","right-center":"_right-center_1ojrm_16","right-bottom":"_right-bottom_1ojrm_17","animation-message-center-top":"_animation-message-center-top_1ojrm_37","animation-message-center-bottom":"_animation-message-center-bottom_1ojrm_38","animation-message-center-center":"_animation-message-center-center_1ojrm_39",screenCenterIn:Tr,"center-top":"_center-top_1ojrm_43","center-center":"_center-center_1ojrm_44","center-bottom":"_center-bottom_1ojrm_45","animation-message-left-top":"_animation-message-left-top_1ojrm_64","animation-message-left-center":"_animation-message-left-center_1ojrm_65","animation-message-left-bottom":"_animation-message-left-bottom_1ojrm_66",screenLeftIn:Sr,"left-top":"_left-top_1ojrm_70","left-center":"_left-center_1ojrm_71","left-bottom":"_left-bottom_1ojrm_72","toast-message":"_toast-message_1ojrm_90",success:Or,info:wr,warn:Pr,error:xr,ghost:kr,"animation-unmount":"_animation-unmount_1ojrm_136",screenOut:Ar};function Ir({message:{duration:e=7e3,id:t,content:r,type:n},onRemoveMessage:o,classNames:a}){var i,s;const c=null==(i=null==a?void 0:a.toastMessages)?void 0:i["*"],u=null==(s=null==a?void 0:a.toastMessages)?void 0:s[n],[l,f]=Me(void 0);function p(){return l?A[l]?A[l]:l:""}const m=Le((()=>{f((null==a?void 0:a.animationUnmount)||"animation-unmount")}),[null==a?void 0:a.animationUnmount]);return Ue((()=>{const t=setTimeout((()=>m()),e);return()=>clearTimeout(t)}),[o,t,e,m]),ue.jsx("span",{tabIndex:0,onAnimationEnd:function(e){var r;const n=p();null!=(r=e.currentTarget.classList)&&r.contains(n)&&o(t)},onClick:m,style:{...H(c),...H(u)},className:function(){const e=X(c),t=X(u),r=p(),o=A[`animation-message-${null==a?void 0:a.toastPosition}`];return`${A["toast-message"]} ${A[n]} ${o} ${r} ${t} ${e}`.trim()}(),children:r})}function $r({classNames:e,defaultDuration:t,position:r="right-top"}){var n,o;const a=null==(n=null==e?void 0:e.toastContainer)?void 0:n["*"],i=null==(o=null==e?void 0:e.toastContainer)?void 0:o[r],[s,c]=Me([]);const u=Le((e=>{c((t=>t.filter((t=>t.id!==e))))}),[]);return Ue((()=>{function e(e){const{content:r,type:n,duration:o=t}=e;c((e=>[...e,{id:crypto.randomUUID(),content:r,duration:o,type:n}]))}return ie.on("add-toast",e),()=>{ie.removeListener("add-toast",e)}}),[t]),ue.jsx("div",{style:{...H(a),...H(i)},className:function(){const e=X(a),t=X(i);return`${A["toast-container"]} ${A[r]} ${t} ${e}`.trim()}(),children:s.map((t=>ue.jsx(Ir,{message:t,onRemoveMessage:u,classNames:{toastPosition:r,toastMessages:null==e?void 0:e.toastMessages,animationUnmount:null==e?void 0:e.animationUnmount}},t.id)))})}export{$r as ToastContainer,I as toast};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edinelsonslima/toast-notification",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"author": "@edinelsonslima",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"main": "index.es.js",
|
|
16
16
|
"module": "index.es.js",
|
|
17
17
|
"browser": "index.es.js",
|
|
18
|
-
"types": "index.d.ts",
|
|
18
|
+
"types": "index.es.d.ts",
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
|
-
"types": "./index.d.ts",
|
|
21
|
+
"types": "./index.es.d.ts",
|
|
22
22
|
"import": "./index.es.js",
|
|
23
23
|
"require": "./index.es.js",
|
|
24
24
|
"browser": "./index.es.js"
|