@tracktor/shared-module 0.2.0 → 0.2.1
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/CHANGELOG.md +2 -2
- package/dist/hooks/useResponseError/useResponseError.d.ts +1 -1
- package/dist/main.js +197 -197
- package/dist/main.umd.cjs +10 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -26,6 +26,6 @@ export interface useResponseErrorParams {
|
|
|
26
26
|
* This hook is used to print error messages from the API
|
|
27
27
|
*/
|
|
28
28
|
export declare const useResponseError: <T = ResponseError>(params?: useResponseErrorParams) => {
|
|
29
|
-
printError: (
|
|
29
|
+
printError: (error?: any) => string;
|
|
30
30
|
};
|
|
31
31
|
export default useResponseError;
|
package/dist/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import Pe, { createContext as lr, useMemo as cr, useContext as xe, Suspense as dr, useCallback as vr } from "react";
|
|
2
|
+
var ee = {}, pr = {
|
|
3
3
|
get exports() {
|
|
4
|
-
return
|
|
4
|
+
return ee;
|
|
5
5
|
},
|
|
6
6
|
set exports(d) {
|
|
7
|
-
|
|
7
|
+
ee = d;
|
|
8
8
|
}
|
|
9
9
|
}, $ = {};
|
|
10
10
|
/**
|
|
@@ -16,23 +16,23 @@ var Q = {}, gr = {
|
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
18
|
*/
|
|
19
|
-
var
|
|
20
|
-
function
|
|
21
|
-
if (
|
|
19
|
+
var Ce;
|
|
20
|
+
function gr() {
|
|
21
|
+
if (Ce)
|
|
22
22
|
return $;
|
|
23
|
-
|
|
24
|
-
var d =
|
|
25
|
-
function
|
|
23
|
+
Ce = 1;
|
|
24
|
+
var d = Pe, y = Symbol.for("react.element"), g = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, p = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, _ = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
25
|
+
function i(T, f, w) {
|
|
26
26
|
var v, h = {}, R = null, P = null;
|
|
27
|
-
w !== void 0 && (R = "" + w),
|
|
28
|
-
for (v in
|
|
29
|
-
b.call(
|
|
27
|
+
w !== void 0 && (R = "" + w), f.key !== void 0 && (R = "" + f.key), f.ref !== void 0 && (P = f.ref);
|
|
28
|
+
for (v in f)
|
|
29
|
+
b.call(f, v) && !_.hasOwnProperty(v) && (h[v] = f[v]);
|
|
30
30
|
if (T && T.defaultProps)
|
|
31
|
-
for (v in
|
|
32
|
-
h[v] === void 0 && (h[v] =
|
|
33
|
-
return { $$typeof:
|
|
31
|
+
for (v in f = T.defaultProps, f)
|
|
32
|
+
h[v] === void 0 && (h[v] = f[v]);
|
|
33
|
+
return { $$typeof: y, type: T, key: R, ref: P, props: h, _owner: p.current };
|
|
34
34
|
}
|
|
35
|
-
return $.Fragment = g, $.jsx =
|
|
35
|
+
return $.Fragment = g, $.jsx = i, $.jsxs = i, $;
|
|
36
36
|
}
|
|
37
37
|
var W = {};
|
|
38
38
|
/**
|
|
@@ -44,14 +44,14 @@ var W = {};
|
|
|
44
44
|
* This source code is licensed under the MIT license found in the
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
var
|
|
48
|
-
function
|
|
49
|
-
return
|
|
50
|
-
var d =
|
|
47
|
+
var Se;
|
|
48
|
+
function hr() {
|
|
49
|
+
return Se || (Se = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
+
var d = Pe, y = Symbol.for("react.element"), g = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), T = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), P = Symbol.for("react.offscreen"), D = Symbol.iterator, L = "@@iterator";
|
|
51
51
|
function je(e) {
|
|
52
52
|
if (e === null || typeof e != "object")
|
|
53
53
|
return null;
|
|
54
|
-
var r = D && e[D] || e[
|
|
54
|
+
var r = D && e[D] || e[L];
|
|
55
55
|
return typeof r == "function" ? r : null;
|
|
56
56
|
}
|
|
57
57
|
var j = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
@@ -66,20 +66,20 @@ function Er() {
|
|
|
66
66
|
{
|
|
67
67
|
var n = j.ReactDebugCurrentFrame, u = n.getStackAddendum();
|
|
68
68
|
u !== "" && (r += "%s", t = t.concat([u]));
|
|
69
|
-
var
|
|
70
|
-
return String(
|
|
69
|
+
var s = t.map(function(o) {
|
|
70
|
+
return String(o);
|
|
71
71
|
});
|
|
72
|
-
|
|
72
|
+
s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
var Ae = !1, De = !1, Fe = !1, Ie = !1, $e = !1,
|
|
76
|
-
|
|
75
|
+
var Ae = !1, De = !1, Fe = !1, Ie = !1, $e = !1, te;
|
|
76
|
+
te = Symbol.for("react.module.reference");
|
|
77
77
|
function We(e) {
|
|
78
|
-
return !!(typeof e == "string" || typeof e == "function" || e === b || e === _ || $e || e ===
|
|
78
|
+
return !!(typeof e == "string" || typeof e == "function" || e === b || e === _ || $e || e === p || e === w || e === v || Ie || e === P || Ae || De || Fe || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === h || e.$$typeof === i || e.$$typeof === T || e.$$typeof === f || // This needs to include all possible module reference object
|
|
79
79
|
// types supported by any Flight configuration anywhere since
|
|
80
80
|
// we don't know which Flight build this will end up being used
|
|
81
81
|
// with.
|
|
82
|
-
e.$$typeof ===
|
|
82
|
+
e.$$typeof === te || e.getModuleId !== void 0));
|
|
83
83
|
}
|
|
84
84
|
function Ye(e, r, t) {
|
|
85
85
|
var n = e.displayName;
|
|
@@ -88,7 +88,7 @@ function Er() {
|
|
|
88
88
|
var u = r.displayName || r.name || "";
|
|
89
89
|
return u !== "" ? t + "(" + u + ")" : t;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function ne(e) {
|
|
92
92
|
return e.displayName || "Context";
|
|
93
93
|
}
|
|
94
94
|
function C(e) {
|
|
@@ -105,7 +105,7 @@ function Er() {
|
|
|
105
105
|
return "Portal";
|
|
106
106
|
case _:
|
|
107
107
|
return "Profiler";
|
|
108
|
-
case
|
|
108
|
+
case p:
|
|
109
109
|
return "StrictMode";
|
|
110
110
|
case w:
|
|
111
111
|
return "Suspense";
|
|
@@ -116,19 +116,19 @@ function Er() {
|
|
|
116
116
|
switch (e.$$typeof) {
|
|
117
117
|
case T:
|
|
118
118
|
var r = e;
|
|
119
|
-
return
|
|
120
|
-
case
|
|
119
|
+
return ne(r) + ".Consumer";
|
|
120
|
+
case i:
|
|
121
121
|
var t = e;
|
|
122
|
-
return
|
|
123
|
-
case
|
|
122
|
+
return ne(t._context) + ".Provider";
|
|
123
|
+
case f:
|
|
124
124
|
return Ye(e, e.render, "ForwardRef");
|
|
125
125
|
case h:
|
|
126
126
|
var n = e.displayName || null;
|
|
127
127
|
return n !== null ? n : C(e.type) || "Memo";
|
|
128
128
|
case R: {
|
|
129
|
-
var u = e,
|
|
129
|
+
var u = e, s = u._payload, o = u._init;
|
|
130
130
|
try {
|
|
131
|
-
return C(
|
|
131
|
+
return C(o(s));
|
|
132
132
|
} catch {
|
|
133
133
|
return null;
|
|
134
134
|
}
|
|
@@ -136,14 +136,14 @@ function Er() {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
var x = Object.assign, F = 0,
|
|
139
|
+
var x = Object.assign, F = 0, ae, oe, ie, ue, se, fe, le;
|
|
140
140
|
function ce() {
|
|
141
141
|
}
|
|
142
142
|
ce.__reactDisabledLog = !0;
|
|
143
143
|
function Le() {
|
|
144
144
|
{
|
|
145
145
|
if (F === 0) {
|
|
146
|
-
|
|
146
|
+
ae = console.log, oe = console.info, ie = console.warn, ue = console.error, se = console.group, fe = console.groupCollapsed, le = console.groupEnd;
|
|
147
147
|
var e = {
|
|
148
148
|
configurable: !0,
|
|
149
149
|
enumerable: !0,
|
|
@@ -173,19 +173,19 @@ function Er() {
|
|
|
173
173
|
};
|
|
174
174
|
Object.defineProperties(console, {
|
|
175
175
|
log: x({}, e, {
|
|
176
|
-
value:
|
|
176
|
+
value: ae
|
|
177
177
|
}),
|
|
178
178
|
info: x({}, e, {
|
|
179
|
-
value:
|
|
179
|
+
value: oe
|
|
180
180
|
}),
|
|
181
181
|
warn: x({}, e, {
|
|
182
182
|
value: ie
|
|
183
183
|
}),
|
|
184
184
|
error: x({}, e, {
|
|
185
|
-
value:
|
|
185
|
+
value: ue
|
|
186
186
|
}),
|
|
187
187
|
group: x({}, e, {
|
|
188
|
-
value:
|
|
188
|
+
value: se
|
|
189
189
|
}),
|
|
190
190
|
groupCollapsed: x({}, e, {
|
|
191
191
|
value: fe
|
|
@@ -198,62 +198,62 @@ function Er() {
|
|
|
198
198
|
F < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
var
|
|
202
|
-
function
|
|
201
|
+
var J = j.ReactCurrentDispatcher, G;
|
|
202
|
+
function N(e, r, t) {
|
|
203
203
|
{
|
|
204
|
-
if (
|
|
204
|
+
if (G === void 0)
|
|
205
205
|
try {
|
|
206
206
|
throw Error();
|
|
207
207
|
} catch (u) {
|
|
208
208
|
var n = u.stack.trim().match(/\n( *(at )?)/);
|
|
209
|
-
|
|
209
|
+
G = n && n[1] || "";
|
|
210
210
|
}
|
|
211
211
|
return `
|
|
212
|
-
` +
|
|
212
|
+
` + G + e;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
var
|
|
215
|
+
var z = !1, M;
|
|
216
216
|
{
|
|
217
217
|
var Me = typeof WeakMap == "function" ? WeakMap : Map;
|
|
218
|
-
|
|
218
|
+
M = new Me();
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
if (!e ||
|
|
220
|
+
function de(e, r) {
|
|
221
|
+
if (!e || z)
|
|
222
222
|
return "";
|
|
223
223
|
{
|
|
224
|
-
var t =
|
|
224
|
+
var t = M.get(e);
|
|
225
225
|
if (t !== void 0)
|
|
226
226
|
return t;
|
|
227
227
|
}
|
|
228
228
|
var n;
|
|
229
|
-
|
|
229
|
+
z = !0;
|
|
230
230
|
var u = Error.prepareStackTrace;
|
|
231
231
|
Error.prepareStackTrace = void 0;
|
|
232
|
-
var
|
|
233
|
-
|
|
232
|
+
var s;
|
|
233
|
+
s = J.current, J.current = null, Le();
|
|
234
234
|
try {
|
|
235
235
|
if (r) {
|
|
236
|
-
var
|
|
236
|
+
var o = function() {
|
|
237
237
|
throw Error();
|
|
238
238
|
};
|
|
239
|
-
if (Object.defineProperty(
|
|
239
|
+
if (Object.defineProperty(o.prototype, "props", {
|
|
240
240
|
set: function() {
|
|
241
241
|
throw Error();
|
|
242
242
|
}
|
|
243
243
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
244
244
|
try {
|
|
245
|
-
Reflect.construct(
|
|
245
|
+
Reflect.construct(o, []);
|
|
246
246
|
} catch (S) {
|
|
247
247
|
n = S;
|
|
248
248
|
}
|
|
249
|
-
Reflect.construct(e, [],
|
|
249
|
+
Reflect.construct(e, [], o);
|
|
250
250
|
} else {
|
|
251
251
|
try {
|
|
252
|
-
|
|
252
|
+
o.call();
|
|
253
253
|
} catch (S) {
|
|
254
254
|
n = S;
|
|
255
255
|
}
|
|
256
|
-
e.call(
|
|
256
|
+
e.call(o.prototype);
|
|
257
257
|
}
|
|
258
258
|
} else {
|
|
259
259
|
try {
|
|
@@ -266,93 +266,93 @@ function Er() {
|
|
|
266
266
|
} catch (S) {
|
|
267
267
|
if (S && n && typeof S.stack == "string") {
|
|
268
268
|
for (var a = S.stack.split(`
|
|
269
|
-
`),
|
|
270
|
-
`),
|
|
271
|
-
|
|
272
|
-
for (;
|
|
273
|
-
if (a[
|
|
274
|
-
if (
|
|
269
|
+
`), m = n.stack.split(`
|
|
270
|
+
`), l = a.length - 1, c = m.length - 1; l >= 1 && c >= 0 && a[l] !== m[c]; )
|
|
271
|
+
c--;
|
|
272
|
+
for (; l >= 1 && c >= 0; l--, c--)
|
|
273
|
+
if (a[l] !== m[c]) {
|
|
274
|
+
if (l !== 1 || c !== 1)
|
|
275
275
|
do
|
|
276
|
-
if (
|
|
276
|
+
if (l--, c--, c < 0 || a[l] !== m[c]) {
|
|
277
277
|
var O = `
|
|
278
|
-
` + a[
|
|
279
|
-
return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" &&
|
|
278
|
+
` + a[l].replace(" at new ", " at ");
|
|
279
|
+
return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, O), O;
|
|
280
280
|
}
|
|
281
|
-
while (
|
|
281
|
+
while (l >= 1 && c >= 0);
|
|
282
282
|
break;
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
} finally {
|
|
286
|
-
|
|
286
|
+
z = !1, J.current = s, Ne(), Error.prepareStackTrace = u;
|
|
287
287
|
}
|
|
288
|
-
var A = e ? e.displayName || e.name : "",
|
|
289
|
-
return typeof e == "function" &&
|
|
288
|
+
var A = e ? e.displayName || e.name : "", Oe = A ? N(A) : "";
|
|
289
|
+
return typeof e == "function" && M.set(e, Oe), Oe;
|
|
290
290
|
}
|
|
291
291
|
function Ue(e, r, t) {
|
|
292
|
-
return
|
|
292
|
+
return de(e, !1);
|
|
293
293
|
}
|
|
294
294
|
function Ve(e) {
|
|
295
295
|
var r = e.prototype;
|
|
296
296
|
return !!(r && r.isReactComponent);
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function U(e, r, t) {
|
|
299
299
|
if (e == null)
|
|
300
300
|
return "";
|
|
301
301
|
if (typeof e == "function")
|
|
302
|
-
return
|
|
302
|
+
return de(e, Ve(e));
|
|
303
303
|
if (typeof e == "string")
|
|
304
|
-
return
|
|
304
|
+
return N(e);
|
|
305
305
|
switch (e) {
|
|
306
306
|
case w:
|
|
307
|
-
return
|
|
307
|
+
return N("Suspense");
|
|
308
308
|
case v:
|
|
309
|
-
return
|
|
309
|
+
return N("SuspenseList");
|
|
310
310
|
}
|
|
311
311
|
if (typeof e == "object")
|
|
312
312
|
switch (e.$$typeof) {
|
|
313
|
-
case
|
|
313
|
+
case f:
|
|
314
314
|
return Ue(e.render);
|
|
315
315
|
case h:
|
|
316
|
-
return
|
|
316
|
+
return U(e.type, r, t);
|
|
317
317
|
case R: {
|
|
318
|
-
var n = e, u = n._payload,
|
|
318
|
+
var n = e, u = n._payload, s = n._init;
|
|
319
319
|
try {
|
|
320
|
-
return
|
|
320
|
+
return U(s(u), r, t);
|
|
321
321
|
} catch {
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
return "";
|
|
326
326
|
}
|
|
327
|
-
var
|
|
328
|
-
function
|
|
327
|
+
var V = Object.prototype.hasOwnProperty, ve = {}, pe = j.ReactDebugCurrentFrame;
|
|
328
|
+
function q(e) {
|
|
329
329
|
if (e) {
|
|
330
|
-
var r = e._owner, t =
|
|
331
|
-
|
|
330
|
+
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
|
331
|
+
pe.setExtraStackFrame(t);
|
|
332
332
|
} else
|
|
333
|
-
|
|
333
|
+
pe.setExtraStackFrame(null);
|
|
334
334
|
}
|
|
335
335
|
function qe(e, r, t, n, u) {
|
|
336
336
|
{
|
|
337
|
-
var
|
|
338
|
-
for (var
|
|
339
|
-
if (
|
|
337
|
+
var s = Function.call.bind(V);
|
|
338
|
+
for (var o in e)
|
|
339
|
+
if (s(e, o)) {
|
|
340
340
|
var a = void 0;
|
|
341
341
|
try {
|
|
342
|
-
if (typeof e[
|
|
343
|
-
var
|
|
344
|
-
throw
|
|
342
|
+
if (typeof e[o] != "function") {
|
|
343
|
+
var m = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
344
|
+
throw m.name = "Invariant Violation", m;
|
|
345
345
|
}
|
|
346
|
-
a = e[
|
|
347
|
-
} catch (
|
|
348
|
-
a =
|
|
346
|
+
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
347
|
+
} catch (l) {
|
|
348
|
+
a = l;
|
|
349
349
|
}
|
|
350
|
-
a && !(a instanceof Error) && (
|
|
350
|
+
a && !(a instanceof Error) && (q(u), E("%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", t, o, typeof a), q(null)), a instanceof Error && !(a.message in ve) && (ve[a.message] = !0, q(u), E("Failed %s type: %s", t, a.message), q(null));
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
var Be = Array.isArray;
|
|
355
|
-
function
|
|
355
|
+
function K(e) {
|
|
356
356
|
return Be(e);
|
|
357
357
|
}
|
|
358
358
|
function Je(e) {
|
|
@@ -380,10 +380,10 @@ function Er() {
|
|
|
380
380
|
ref: !0,
|
|
381
381
|
__self: !0,
|
|
382
382
|
__source: !0
|
|
383
|
-
}, Ee,
|
|
384
|
-
|
|
383
|
+
}, Ee, me, H;
|
|
384
|
+
H = {};
|
|
385
385
|
function Ke(e) {
|
|
386
|
-
if (
|
|
386
|
+
if (V.call(e, "ref")) {
|
|
387
387
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
388
388
|
if (r && r.isReactWarning)
|
|
389
389
|
return !1;
|
|
@@ -391,7 +391,7 @@ function Er() {
|
|
|
391
391
|
return e.ref !== void 0;
|
|
392
392
|
}
|
|
393
393
|
function He(e) {
|
|
394
|
-
if (
|
|
394
|
+
if (V.call(e, "key")) {
|
|
395
395
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
396
396
|
if (r && r.isReactWarning)
|
|
397
397
|
return !1;
|
|
@@ -401,7 +401,7 @@ function Er() {
|
|
|
401
401
|
function Xe(e, r) {
|
|
402
402
|
if (typeof e.ref == "string" && I.current && r && I.current.stateNode !== r) {
|
|
403
403
|
var t = C(I.current.type);
|
|
404
|
-
|
|
404
|
+
H[t] || (E('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', C(I.current.type), e.ref), H[t] = !0);
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
function Ze(e, r) {
|
|
@@ -418,7 +418,7 @@ function Er() {
|
|
|
418
418
|
function Qe(e, r) {
|
|
419
419
|
{
|
|
420
420
|
var t = function() {
|
|
421
|
-
|
|
421
|
+
me || (me = !0, E("%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));
|
|
422
422
|
};
|
|
423
423
|
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
424
424
|
get: t,
|
|
@@ -426,17 +426,17 @@ function Er() {
|
|
|
426
426
|
});
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
var er = function(e, r, t, n, u,
|
|
429
|
+
var er = function(e, r, t, n, u, s, o) {
|
|
430
430
|
var a = {
|
|
431
431
|
// This tag allows us to uniquely identify this as a React Element
|
|
432
|
-
$$typeof:
|
|
432
|
+
$$typeof: y,
|
|
433
433
|
// Built-in properties that belong on the element
|
|
434
434
|
type: e,
|
|
435
435
|
key: r,
|
|
436
436
|
ref: t,
|
|
437
|
-
props:
|
|
437
|
+
props: o,
|
|
438
438
|
// Record the component responsible for creating this element.
|
|
439
|
-
_owner:
|
|
439
|
+
_owner: s
|
|
440
440
|
};
|
|
441
441
|
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
442
442
|
configurable: !1,
|
|
@@ -457,39 +457,39 @@ function Er() {
|
|
|
457
457
|
};
|
|
458
458
|
function rr(e, r, t, n, u) {
|
|
459
459
|
{
|
|
460
|
-
var
|
|
461
|
-
t !== void 0 && (he(t), a = "" + t), He(r) && (he(r.key), a = "" + r.key), Ke(r) && (
|
|
462
|
-
for (
|
|
463
|
-
|
|
460
|
+
var s, o = {}, a = null, m = null;
|
|
461
|
+
t !== void 0 && (he(t), a = "" + t), He(r) && (he(r.key), a = "" + r.key), Ke(r) && (m = r.ref, Xe(r, u));
|
|
462
|
+
for (s in r)
|
|
463
|
+
V.call(r, s) && !ze.hasOwnProperty(s) && (o[s] = r[s]);
|
|
464
464
|
if (e && e.defaultProps) {
|
|
465
|
-
var
|
|
466
|
-
for (
|
|
467
|
-
|
|
465
|
+
var l = e.defaultProps;
|
|
466
|
+
for (s in l)
|
|
467
|
+
o[s] === void 0 && (o[s] = l[s]);
|
|
468
468
|
}
|
|
469
|
-
if (a ||
|
|
470
|
-
var
|
|
471
|
-
a && Ze(
|
|
469
|
+
if (a || m) {
|
|
470
|
+
var c = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
471
|
+
a && Ze(o, c), m && Qe(o, c);
|
|
472
472
|
}
|
|
473
|
-
return er(e, a,
|
|
473
|
+
return er(e, a, m, u, n, I.current, o);
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
var
|
|
476
|
+
var X = j.ReactCurrentOwner, ye = j.ReactDebugCurrentFrame;
|
|
477
477
|
function k(e) {
|
|
478
478
|
if (e) {
|
|
479
|
-
var r = e._owner, t =
|
|
480
|
-
|
|
479
|
+
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
|
480
|
+
ye.setExtraStackFrame(t);
|
|
481
481
|
} else
|
|
482
|
-
|
|
482
|
+
ye.setExtraStackFrame(null);
|
|
483
483
|
}
|
|
484
|
-
var
|
|
485
|
-
|
|
486
|
-
function
|
|
487
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
484
|
+
var Z;
|
|
485
|
+
Z = !1;
|
|
486
|
+
function Q(e) {
|
|
487
|
+
return typeof e == "object" && e !== null && e.$$typeof === y;
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function be() {
|
|
490
490
|
{
|
|
491
|
-
if (
|
|
492
|
-
var e = C(
|
|
491
|
+
if (X.current) {
|
|
492
|
+
var e = C(X.current.type);
|
|
493
493
|
if (e)
|
|
494
494
|
return `
|
|
495
495
|
|
|
@@ -509,10 +509,10 @@ Check your code at ` + r + ":" + t + ".";
|
|
|
509
509
|
return "";
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
var
|
|
512
|
+
var Re = {};
|
|
513
513
|
function nr(e) {
|
|
514
514
|
{
|
|
515
|
-
var r =
|
|
515
|
+
var r = be();
|
|
516
516
|
if (!r) {
|
|
517
517
|
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
518
518
|
t && (r = `
|
|
@@ -522,35 +522,35 @@ Check the top-level render call using <` + t + ">.");
|
|
|
522
522
|
return r;
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function _e(e, r) {
|
|
526
526
|
{
|
|
527
527
|
if (!e._store || e._store.validated || e.key != null)
|
|
528
528
|
return;
|
|
529
529
|
e._store.validated = !0;
|
|
530
530
|
var t = nr(r);
|
|
531
|
-
if (
|
|
531
|
+
if (Re[t])
|
|
532
532
|
return;
|
|
533
|
-
|
|
533
|
+
Re[t] = !0;
|
|
534
534
|
var n = "";
|
|
535
|
-
e && e._owner && e._owner !==
|
|
535
|
+
e && e._owner && e._owner !== X.current && (n = " It was passed a child from " + C(e._owner.type) + "."), k(e), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), k(null);
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function Te(e, r) {
|
|
539
539
|
{
|
|
540
540
|
if (typeof e != "object")
|
|
541
541
|
return;
|
|
542
|
-
if (
|
|
542
|
+
if (K(e))
|
|
543
543
|
for (var t = 0; t < e.length; t++) {
|
|
544
544
|
var n = e[t];
|
|
545
|
-
|
|
545
|
+
Q(n) && _e(n, r);
|
|
546
546
|
}
|
|
547
|
-
else if (
|
|
547
|
+
else if (Q(e))
|
|
548
548
|
e._store && (e._store.validated = !0);
|
|
549
549
|
else if (e) {
|
|
550
550
|
var u = je(e);
|
|
551
551
|
if (typeof u == "function" && u !== e.entries)
|
|
552
|
-
for (var
|
|
553
|
-
|
|
552
|
+
for (var s = u.call(e), o; !(o = s.next()).done; )
|
|
553
|
+
Q(o.value) && _e(o.value, r);
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
}
|
|
@@ -562,7 +562,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
562
562
|
var t;
|
|
563
563
|
if (typeof r == "function")
|
|
564
564
|
t = r.propTypes;
|
|
565
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
|
565
|
+
else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
|
|
566
566
|
// Inner props are checked in the reconciler.
|
|
567
567
|
r.$$typeof === h))
|
|
568
568
|
t = r.propTypes;
|
|
@@ -571,15 +571,15 @@ Check the top-level render call using <` + t + ">.");
|
|
|
571
571
|
if (t) {
|
|
572
572
|
var n = C(r);
|
|
573
573
|
qe(t, e.props, "prop", n, e);
|
|
574
|
-
} else if (r.PropTypes !== void 0 && !
|
|
575
|
-
|
|
574
|
+
} else if (r.PropTypes !== void 0 && !Z) {
|
|
575
|
+
Z = !0;
|
|
576
576
|
var u = C(r);
|
|
577
577
|
E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
|
|
578
578
|
}
|
|
579
579
|
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function or(e) {
|
|
583
583
|
{
|
|
584
584
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
585
585
|
var n = r[t];
|
|
@@ -591,99 +591,99 @@ Check the top-level render call using <` + t + ">.");
|
|
|
591
591
|
e.ref !== null && (k(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function we(e, r, t, n, u, s) {
|
|
595
595
|
{
|
|
596
|
-
var
|
|
597
|
-
if (!
|
|
596
|
+
var o = We(e);
|
|
597
|
+
if (!o) {
|
|
598
598
|
var a = "";
|
|
599
599
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
600
|
-
var
|
|
601
|
-
|
|
602
|
-
var
|
|
603
|
-
e === null ?
|
|
600
|
+
var m = tr(u);
|
|
601
|
+
m ? a += m : a += be();
|
|
602
|
+
var l;
|
|
603
|
+
e === null ? l = "null" : K(e) ? l = "array" : e !== void 0 && e.$$typeof === y ? (l = "<" + (C(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
|
|
604
604
|
}
|
|
605
|
-
var
|
|
606
|
-
if (
|
|
607
|
-
return
|
|
608
|
-
if (
|
|
605
|
+
var c = rr(e, r, t, u, s);
|
|
606
|
+
if (c == null)
|
|
607
|
+
return c;
|
|
608
|
+
if (o) {
|
|
609
609
|
var O = r.children;
|
|
610
610
|
if (O !== void 0)
|
|
611
611
|
if (n)
|
|
612
|
-
if (
|
|
612
|
+
if (K(O)) {
|
|
613
613
|
for (var A = 0; A < O.length; A++)
|
|
614
|
-
|
|
614
|
+
Te(O[A], e);
|
|
615
615
|
Object.freeze && Object.freeze(O);
|
|
616
616
|
} else
|
|
617
617
|
E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
618
618
|
else
|
|
619
|
-
|
|
619
|
+
Te(O, e);
|
|
620
620
|
}
|
|
621
|
-
return e === b ?
|
|
621
|
+
return e === b ? or(c) : ar(c), c;
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
|
-
function
|
|
625
|
-
return
|
|
624
|
+
function ir(e, r, t) {
|
|
625
|
+
return we(e, r, t, !0);
|
|
626
626
|
}
|
|
627
627
|
function ur(e, r, t) {
|
|
628
|
-
return
|
|
628
|
+
return we(e, r, t, !1);
|
|
629
629
|
}
|
|
630
|
-
var
|
|
631
|
-
W.Fragment = b, W.jsx =
|
|
630
|
+
var sr = ur, fr = ir;
|
|
631
|
+
W.Fragment = b, W.jsx = sr, W.jsxs = fr;
|
|
632
632
|
}()), W;
|
|
633
633
|
}
|
|
634
634
|
(function(d) {
|
|
635
|
-
process.env.NODE_ENV === "production" ? d.exports =
|
|
636
|
-
})(
|
|
637
|
-
const Y =
|
|
635
|
+
process.env.NODE_ENV === "production" ? d.exports = gr() : d.exports = hr();
|
|
636
|
+
})(pr);
|
|
637
|
+
const Y = ee.jsx, re = lr({
|
|
638
638
|
children: void 0,
|
|
639
639
|
Navigate: void 0,
|
|
640
640
|
Outlet: void 0,
|
|
641
641
|
translate: void 0,
|
|
642
642
|
useAuth: void 0,
|
|
643
643
|
useLocation: void 0
|
|
644
|
-
}), mr = ({ children: d, translate:
|
|
645
|
-
const
|
|
644
|
+
}), mr = ({ children: d, translate: y, useAuth: g, Outlet: b, Navigate: p, useLocation: _ }) => {
|
|
645
|
+
const i = cr(
|
|
646
646
|
() => ({
|
|
647
|
-
Navigate:
|
|
647
|
+
Navigate: p,
|
|
648
648
|
Outlet: b,
|
|
649
|
-
translate:
|
|
649
|
+
translate: y,
|
|
650
650
|
useAuth: g,
|
|
651
651
|
useLocation: _
|
|
652
652
|
}),
|
|
653
|
-
[
|
|
653
|
+
[p, b, y, g, _]
|
|
654
654
|
);
|
|
655
|
-
return /* @__PURE__ */ Y(
|
|
656
|
-
},
|
|
655
|
+
return /* @__PURE__ */ Y(re.Provider, { value: i, children: d });
|
|
656
|
+
}, B = (d) => `RequireAuth require « ${d} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, yr = ({ Fallback: d, loginPath: y = "/login", ...g }) => {
|
|
657
657
|
var w, v, h, R;
|
|
658
658
|
const {
|
|
659
659
|
useLocation: b = g.useLocation,
|
|
660
|
-
useAuth:
|
|
660
|
+
useAuth: p = g.useAuth,
|
|
661
661
|
Outlet: _ = g.Outlet,
|
|
662
|
-
Navigate:
|
|
663
|
-
} =
|
|
664
|
-
if (
|
|
665
|
-
throw new Error(
|
|
662
|
+
Navigate: i = g.Navigate
|
|
663
|
+
} = xe(re);
|
|
664
|
+
if (p === void 0)
|
|
665
|
+
throw new Error(B("useAuth"));
|
|
666
666
|
if (b === void 0)
|
|
667
|
-
throw new Error(
|
|
667
|
+
throw new Error(B("useLocation"));
|
|
668
668
|
if (_ === void 0)
|
|
669
|
-
throw new Error(
|
|
670
|
-
if (
|
|
671
|
-
throw new Error(
|
|
672
|
-
const { isLogged: T } =
|
|
673
|
-
return T ? /* @__PURE__ */ Y(dr, { fallback: d, children: (v = (w =
|
|
669
|
+
throw new Error(B("Outlet"));
|
|
670
|
+
if (i === void 0)
|
|
671
|
+
throw new Error(B("Navigate"));
|
|
672
|
+
const { isLogged: T } = p(), f = b();
|
|
673
|
+
return T ? /* @__PURE__ */ Y(dr, { fallback: d, children: (v = (w = f.state) == null ? void 0 : w.from) != null && v.state && ((R = (h = f.state) == null ? void 0 : h.from) == null ? void 0 : R.pathname) === y ? /* @__PURE__ */ Y(i, { to: f.state.from.state.from.pathname + f.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ Y(_, {}) }) : /* @__PURE__ */ Y(i, { to: y, state: { from: f }, replace: !0 });
|
|
674
674
|
}, br = (d) => {
|
|
675
|
-
const { unknownErrorTranslationKey:
|
|
675
|
+
const { unknownErrorTranslationKey: y = "error.unknownError" } = d || {}, { translate: g = d == null ? void 0 : d.translate } = xe(re);
|
|
676
676
|
return { printError: vr(
|
|
677
|
-
(
|
|
678
|
-
var
|
|
679
|
-
const _ = g ? g(
|
|
680
|
-
return (
|
|
677
|
+
(p) => {
|
|
678
|
+
var T, f, w, v, h, R, P, D, L;
|
|
679
|
+
const _ = g ? g(y) : "Unknown error", { response: i } = p || {};
|
|
680
|
+
return p != null && p.reason ? String(p.reason) : (T = i == null ? void 0 : i.data) != null && T.reason ? String(i.data.reason) : (f = i == null ? void 0 : i.data) != null && f.message ? String(i.data.message) : (v = (w = i == null ? void 0 : i.data) == null ? void 0 : w.detail) != null && v.length && Array.isArray((h = i == null ? void 0 : i.data) == null ? void 0 : h.detail) && ((P = (R = i == null ? void 0 : i.data) == null ? void 0 : R.detail[0]) != null && P.msg) && typeof ((L = (D = i == null ? void 0 : i.data) == null ? void 0 : D.detail[0]) == null ? void 0 : L.msg) == "string" ? String(i.data.detail[0].msg) : _;
|
|
681
681
|
},
|
|
682
|
-
[g,
|
|
682
|
+
[g, y]
|
|
683
683
|
) };
|
|
684
684
|
};
|
|
685
685
|
export {
|
|
686
|
-
|
|
686
|
+
re as InjectDependenciesContext,
|
|
687
687
|
mr as InjectDependenciesProvider,
|
|
688
688
|
yr as RequireAuth,
|
|
689
689
|
br as useResponseError
|
package/dist/main.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(S,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],_):(S=typeof globalThis<"u"?globalThis:S||self,_(S["@tracktor/shared-module"]={},S.React))})(this,function(S,_){"use strict";var
|
|
1
|
+
(function(S,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],_):(S=typeof globalThis<"u"?globalThis:S||self,_(S["@tracktor/shared-module"]={},S.React))})(this,function(S,_){"use strict";var K={},xe={get exports(){return K},set exports(d){K=d}},I={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var ae;function ke(){if(ae)return I;ae=1;var d=_,y=Symbol.for("react.element"),g=Symbol.for("react.fragment"),b=Object.prototype.hasOwnProperty,p=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,T={key:!0,ref:!0,__self:!0,__source:!0};function i(w,f,O){var v,h={},R=null,x=null;O!==void 0&&(R=""+O),f.key!==void 0&&(R=""+f.key),f.ref!==void 0&&(x=f.ref);for(v in f)b.call(f,v)&&!T.hasOwnProperty(v)&&(h[v]=f[v]);if(w&&w.defaultProps)for(v in f=w.defaultProps,f)h[v]===void 0&&(h[v]=f[v]);return{$$typeof:y,type:w,key:R,ref:x,props:h,_owner:p.current}}return I.Fragment=g,I.jsx=i,I.jsxs=i,I}var W={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+a[
|
|
17
|
+
*/var oe;function De(){return oe||(oe=1,process.env.NODE_ENV!=="production"&&function(){var d=_,y=Symbol.for("react.element"),g=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),w=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),L=Symbol.iterator,$="@@iterator";function We(e){if(e===null||typeof e!="object")return null;var r=L&&e[L]||e[$];return typeof r=="function"?r:null}var D=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ye("error",e,t)}}function Ye(e,r,t){{var n=D.ReactDebugCurrentFrame,u=n.getStackAddendum();u!==""&&(r+="%s",t=t.concat([u]));var s=t.map(function(o){return String(o)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var Le=!1,Ne=!1,Me=!1,Ue=!1,Ve=!1,ie;ie=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===b||e===T||Ve||e===p||e===O||e===v||Ue||e===x||Le||Ne||Me||typeof e=="object"&&e!==null&&(e.$$typeof===R||e.$$typeof===h||e.$$typeof===i||e.$$typeof===w||e.$$typeof===f||e.$$typeof===ie||e.getModuleId!==void 0))}function Be(e,r,t){var n=e.displayName;if(n)return n;var u=r.displayName||r.name||"";return u!==""?t+"("+u+")":t}function ue(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case b:return"Fragment";case g:return"Portal";case T:return"Profiler";case p:return"StrictMode";case O:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w:var r=e;return ue(r)+".Consumer";case i:var t=e;return ue(t._context)+".Provider";case f:return Be(e,e.render,"ForwardRef");case h:var n=e.displayName||null;return n!==null?n:P(e.type)||"Memo";case R:{var u=e,s=u._payload,o=u._init;try{return P(o(s))}catch{return null}}}return null}var k=Object.assign,N=0,se,fe,ce,le,de,ve,pe;function ge(){}ge.__reactDisabledLog=!0;function Je(){{if(N===0){se=console.log,fe=console.info,ce=console.warn,le=console.error,de=console.group,ve=console.groupCollapsed,pe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ge,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}}function Ge(){{if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:se}),info:k({},e,{value:fe}),warn:k({},e,{value:ce}),error:k({},e,{value:le}),group:k({},e,{value:de}),groupCollapsed:k({},e,{value:ve}),groupEnd:k({},e,{value:pe})})}N<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var H=D.ReactCurrentDispatcher,X;function B(e,r,t){{if(X===void 0)try{throw Error()}catch(u){var n=u.stack.trim().match(/\n( *(at )?)/);X=n&&n[1]||""}return`
|
|
18
|
+
`+X+e}}var Z=!1,J;{var qe=typeof WeakMap=="function"?WeakMap:Map;J=new qe}function he(e,r){if(!e||Z)return"";{var t=J.get(e);if(t!==void 0)return t}var n;Z=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=H.current,H.current=null,Je();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(j){n=j}Reflect.construct(e,[],o)}else{try{o.call()}catch(j){n=j}e.call(o.prototype)}}else{try{throw Error()}catch(j){n=j}e()}}catch(j){if(j&&n&&typeof j.stack=="string"){for(var a=j.stack.split(`
|
|
19
|
+
`),m=n.stack.split(`
|
|
20
|
+
`),c=a.length-1,l=m.length-1;c>=1&&l>=0&&a[c]!==m[l];)l--;for(;c>=1&&l>=0;c--,l--)if(a[c]!==m[l]){if(c!==1||l!==1)do if(c--,l--,l<0||a[c]!==m[l]){var C=`
|
|
21
|
+
`+a[c].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),typeof e=="function"&&J.set(e,C),C}while(c>=1&&l>=0);break}}}finally{Z=!1,H.current=s,Ge(),Error.prepareStackTrace=u}var F=e?e.displayName||e.name:"",je=F?B(F):"";return typeof e=="function"&&J.set(e,je),je}function ze(e,r,t){return he(e,!1)}function Ke(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function G(e,r,t){if(e==null)return"";if(typeof e=="function")return he(e,Ke(e));if(typeof e=="string")return B(e);switch(e){case O:return B("Suspense");case v:return B("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return ze(e.render);case h:return G(e.type,r,t);case R:{var n=e,u=n._payload,s=n._init;try{return G(s(u),r,t)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,Ee={},me=D.ReactDebugCurrentFrame;function z(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);me.setExtraStackFrame(t)}else me.setExtraStackFrame(null)}function He(e,r,t,n,u){{var s=Function.call.bind(q);for(var o in e)if(s(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var m=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){a=c}a&&!(a instanceof Error)&&(z(u),E("%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",t,o,typeof a),z(null)),a instanceof Error&&!(a.message in Ee)&&(Ee[a.message]=!0,z(u),E("Failed %s type: %s",t,a.message),z(null))}}}var Xe=Array.isArray;function Q(e){return Xe(e)}function Ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Qe(e){try{return ye(e),!1}catch{return!0}}function ye(e){return""+e}function be(e){if(Qe(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ze(e)),ye(e)}var M=D.ReactCurrentOwner,er={key:!0,ref:!0,__self:!0,__source:!0},Re,_e,ee;ee={};function rr(e){if(q.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function tr(e){if(q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function nr(e,r){if(typeof e.ref=="string"&&M.current&&r&&M.current.stateNode!==r){var t=P(M.current.type);ee[t]||(E('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(M.current.type),e.ref),ee[t]=!0)}}function ar(e,r){{var t=function(){Re||(Re=!0,E("%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))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function or(e,r){{var t=function(){_e||(_e=!0,E("%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))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var ir=function(e,r,t,n,u,s,o){var a={$$typeof:y,type:e,key:r,ref:t,props:o,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ur(e,r,t,n,u){{var s,o={},a=null,m=null;t!==void 0&&(be(t),a=""+t),tr(r)&&(be(r.key),a=""+r.key),rr(r)&&(m=r.ref,nr(r,u));for(s in r)q.call(r,s)&&!er.hasOwnProperty(s)&&(o[s]=r[s]);if(e&&e.defaultProps){var c=e.defaultProps;for(s in c)o[s]===void 0&&(o[s]=c[s])}if(a||m){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ar(o,l),m&&or(o,l)}return ir(e,a,m,u,n,M.current,o)}}var re=D.ReactCurrentOwner,Te=D.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}var te;te=!1;function ne(e){return typeof e=="object"&&e!==null&&e.$$typeof===y}function we(){{if(re.current){var e=P(re.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function sr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+r+":"+t+"."}return""}}var
|
|
25
|
+
Check your code at `+r+":"+t+"."}return""}}var Oe={};function fr(e){{var r=we();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+t+">.")}return r}}function
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function Ce(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=fr(r);if(Oe[t])return;Oe[t]=!0;var n="";e&&e._owner&&e._owner!==re.current&&(n=" It was passed a child from "+P(e._owner.type)+"."),A(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),A(null)}}function Se(e,r){{if(typeof e!="object")return;if(Q(e))for(var t=0;t<e.length;t++){var n=e[t];ne(n)&&Ce(n,r)}else if(ne(e))e._store&&(e._store.validated=!0);else if(e){var u=We(e);if(typeof u=="function"&&u!==e.entries)for(var s=u.call(e),o;!(o=s.next()).done;)ne(o.value)&&Ce(o.value,r)}}}function cr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===h))t=r.propTypes;else return;if(t){var n=P(r);He(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!te){te=!0;var u=P(r);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function lr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}function Pe(e,r,t,n,u,s){{var o=$e(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 m=sr(u);m?a+=m:a+=we();var c;e===null?c="null":Q(e)?c="array":e!==void 0&&e.$$typeof===y?(c="<"+(P(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):c=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,a)}var l=ur(e,r,t,u,s);if(l==null)return l;if(o){var C=r.children;if(C!==void 0)if(n)if(Q(C)){for(var F=0;F<C.length;F++)Se(C[F],e);Object.freeze&&Object.freeze(C)}else E("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 Se(C,e)}return e===b?lr(l):cr(l),l}}function dr(e,r,t){return Pe(e,r,t,!0)}function vr(e,r,t){return Pe(e,r,t,!1)}var pr=vr,gr=dr;W.Fragment=b,W.jsx=pr,W.jsxs=gr}()),W}(function(d){process.env.NODE_ENV==="production"?d.exports=ke():d.exports=De()})(xe);const Y=K.jsx,U=_.createContext({children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ae=({children:d,translate:y,useAuth:g,Outlet:b,Navigate:p,useLocation:T})=>{const i=_.useMemo(()=>({Navigate:p,Outlet:b,translate:y,useAuth:g,useLocation:T}),[p,b,y,g,T]);return Y(U.Provider,{value:i,children:d})},V=d=>`RequireAuth require « ${d} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Fe=({Fallback:d,loginPath:y="/login",...g})=>{var O,v,h,R;const{useLocation:b=g.useLocation,useAuth:p=g.useAuth,Outlet:T=g.Outlet,Navigate:i=g.Navigate}=_.useContext(U);if(p===void 0)throw new Error(V("useAuth"));if(b===void 0)throw new Error(V("useLocation"));if(T===void 0)throw new Error(V("Outlet"));if(i===void 0)throw new Error(V("Navigate"));const{isLogged:w}=p(),f=b();return w?Y(_.Suspense,{fallback:d,children:(v=(O=f.state)==null?void 0:O.from)!=null&&v.state&&((R=(h=f.state)==null?void 0:h.from)==null?void 0:R.pathname)===y?Y(i,{to:f.state.from.state.from.pathname+f.state.from.state.from.search,replace:!0}):Y(T,{})}):Y(i,{to:y,state:{from:f},replace:!0})},Ie=d=>{const{unknownErrorTranslationKey:y="error.unknownError"}=d||{},{translate:g=d==null?void 0:d.translate}=_.useContext(U);return{printError:_.useCallback(p=>{var w,f,O,v,h,R,x,L,$;const T=g?g(y):"Unknown error",{response:i}=p||{};return p!=null&&p.reason?String(p.reason):(w=i==null?void 0:i.data)!=null&&w.reason?String(i.data.reason):(f=i==null?void 0:i.data)!=null&&f.message?String(i.data.message):(v=(O=i==null?void 0:i.data)==null?void 0:O.detail)!=null&&v.length&&Array.isArray((h=i==null?void 0:i.data)==null?void 0:h.detail)&&((x=(R=i==null?void 0:i.data)==null?void 0:R.detail[0])!=null&&x.msg)&&typeof(($=(L=i==null?void 0:i.data)==null?void 0:L.detail[0])==null?void 0:$.msg)=="string"?String(i.data.detail[0].msg):T},[g,y])}};S.InjectDependenciesContext=U,S.InjectDependenciesProvider=Ae,S.RequireAuth=Fe,S.useResponseError=Ie,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|