@tracktor/shared-module 0.3.0 → 0.4.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/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,52 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
|
|
3
3
|
export interface RequireAuthProps {
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
4
7
|
loginPath?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Fallback component for Suspense
|
|
10
|
+
*/
|
|
5
11
|
Fallback?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Outlet dependency for RequireAuth component
|
|
14
|
+
*/
|
|
6
15
|
Outlet?: InjectDependenciesContextProps["Outlet"];
|
|
16
|
+
/**
|
|
17
|
+
* Navigate dependency for RequireAuth component
|
|
18
|
+
*/
|
|
7
19
|
Navigate?: InjectDependenciesContextProps["Navigate"];
|
|
20
|
+
/**
|
|
21
|
+
* useLocation dependency for RequireAuth component
|
|
22
|
+
*/
|
|
8
23
|
useLocation?: InjectDependenciesContextProps["useLocation"];
|
|
24
|
+
/**
|
|
25
|
+
* useAuth dependency for RequireAuth component
|
|
26
|
+
*/
|
|
9
27
|
useAuth?: InjectDependenciesContextProps["useAuth"];
|
|
28
|
+
/**
|
|
29
|
+
* Axios instance dependency is used for intercepting 401 responses
|
|
30
|
+
*/
|
|
31
|
+
axios?: InjectDependenciesContextProps["axios"];
|
|
32
|
+
/**
|
|
33
|
+
* Local storage key for user data
|
|
34
|
+
*/
|
|
35
|
+
localStorageKey?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Redirect path for 401 responses
|
|
38
|
+
*/
|
|
39
|
+
redirect401Path?: string;
|
|
10
40
|
}
|
|
11
41
|
/**
|
|
12
42
|
* RequireAuth component for protected routing
|
|
43
|
+
* @param axios
|
|
13
44
|
* @param Fallback
|
|
14
45
|
* @param loginPath
|
|
46
|
+
* @param localStorageKey
|
|
47
|
+
* @param redirect401Path
|
|
15
48
|
* @param props
|
|
16
49
|
* @constructor
|
|
17
50
|
*/
|
|
18
|
-
declare const RequireAuth: ({ Fallback, loginPath, ...props }: RequireAuthProps) => JSX.Element;
|
|
51
|
+
declare const RequireAuth: ({ Fallback, loginPath, localStorageKey, redirect401Path, ...props }: RequireAuthProps) => JSX.Element;
|
|
19
52
|
export default RequireAuth;
|
|
@@ -4,6 +4,10 @@ export interface InjectDependenciesContextProps {
|
|
|
4
4
|
* Children
|
|
5
5
|
*/
|
|
6
6
|
children?: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Axios instance dependency
|
|
9
|
+
*/
|
|
10
|
+
axios?: any;
|
|
7
11
|
/**
|
|
8
12
|
* Translate function dependency for useResponseError hook
|
|
9
13
|
* @param str
|
|
@@ -47,5 +51,5 @@ export interface InjectDependenciesContextProps {
|
|
|
47
51
|
};
|
|
48
52
|
}
|
|
49
53
|
export declare const InjectDependenciesContext: import("react").Context<InjectDependenciesContextProps>;
|
|
50
|
-
declare const InjectDependenciesProvider: ({ children, translate, useAuth, Outlet, Navigate, useLocation, useGoogleTagManager, }: InjectDependenciesContextProps) => JSX.Element;
|
|
54
|
+
declare const InjectDependenciesProvider: ({ axios, children, translate, useAuth, Outlet, Navigate, useLocation, useGoogleTagManager, }: InjectDependenciesContextProps) => JSX.Element;
|
|
51
55
|
export default InjectDependenciesProvider;
|
package/dist/main.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import Fe, { createContext as lr, useMemo as dr, useContext as oe, useState as vr, useLayoutEffect as pr, Suspense as gr, useEffect as hr, useCallback as Er } from "react";
|
|
2
|
+
var ae = {}, mr = {
|
|
3
3
|
get exports() {
|
|
4
|
-
return
|
|
4
|
+
return ae;
|
|
5
5
|
},
|
|
6
6
|
set exports(f) {
|
|
7
|
-
|
|
7
|
+
ae = f;
|
|
8
8
|
}
|
|
9
|
-
},
|
|
9
|
+
}, Y = {};
|
|
10
10
|
/**
|
|
11
11
|
* @license React
|
|
12
12
|
* react-jsx-runtime.production.min.js
|
|
@@ -16,25 +16,25 @@ var te = {}, hr = {
|
|
|
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 (
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
var f =
|
|
25
|
-
function
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
for (
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
for (
|
|
32
|
-
|
|
33
|
-
return { $$typeof:
|
|
19
|
+
var Ae;
|
|
20
|
+
function yr() {
|
|
21
|
+
if (Ae)
|
|
22
|
+
return Y;
|
|
23
|
+
Ae = 1;
|
|
24
|
+
var f = Fe, E = Symbol.for("react.element"), m = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, v = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
25
|
+
function i(b, d, w) {
|
|
26
|
+
var h, _ = {}, O = null, T = null;
|
|
27
|
+
w !== void 0 && (O = "" + w), d.key !== void 0 && (O = "" + d.key), d.ref !== void 0 && (T = d.ref);
|
|
28
|
+
for (h in d)
|
|
29
|
+
y.call(d, h) && !l.hasOwnProperty(h) && (_[h] = d[h]);
|
|
30
|
+
if (b && b.defaultProps)
|
|
31
|
+
for (h in d = b.defaultProps, d)
|
|
32
|
+
_[h] === void 0 && (_[h] = d[h]);
|
|
33
|
+
return { $$typeof: E, type: b, key: O, ref: T, props: _, _owner: v.current };
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return Y.Fragment = m, Y.jsx = i, Y.jsxs = i, Y;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var W = {};
|
|
38
38
|
/**
|
|
39
39
|
* @license React
|
|
40
40
|
* react-jsx-runtime.development.js
|
|
@@ -44,91 +44,91 @@ var Y = {};
|
|
|
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 f =
|
|
51
|
-
function
|
|
47
|
+
var De;
|
|
48
|
+
function br() {
|
|
49
|
+
return De || (De = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
+
var f = Fe, E = Symbol.for("react.element"), m = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), b = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), x = Symbol.iterator, k = "@@iterator";
|
|
51
|
+
function M(e) {
|
|
52
52
|
if (e === null || typeof e != "object")
|
|
53
53
|
return null;
|
|
54
|
-
var r =
|
|
54
|
+
var r = x && e[x] || e[k];
|
|
55
55
|
return typeof r == "function" ? r : null;
|
|
56
56
|
}
|
|
57
|
-
var
|
|
58
|
-
function
|
|
57
|
+
var C = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
58
|
+
function u(e) {
|
|
59
59
|
{
|
|
60
60
|
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
61
61
|
t[n - 1] = arguments[n];
|
|
62
|
-
|
|
62
|
+
ie("error", e, t);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function ie(e, r, t) {
|
|
66
66
|
{
|
|
67
|
-
var n =
|
|
68
|
-
|
|
69
|
-
var
|
|
70
|
-
return String(
|
|
67
|
+
var n = C.ReactDebugCurrentFrame, s = n.getStackAddendum();
|
|
68
|
+
s !== "" && (r += "%s", t = t.concat([s]));
|
|
69
|
+
var c = t.map(function(o) {
|
|
70
|
+
return String(o);
|
|
71
71
|
});
|
|
72
|
-
|
|
72
|
+
c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
var
|
|
76
|
-
|
|
75
|
+
var ue = !1, N = !1, Ie = !1, $e = !1, Le = !1, se;
|
|
76
|
+
se = Symbol.for("react.module.reference");
|
|
77
77
|
function Ye(e) {
|
|
78
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
78
|
+
return !!(typeof e == "string" || typeof e == "function" || e === y || e === l || Le || e === v || e === w || e === h || $e || e === T || ue || N || Ie || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === _ || e.$$typeof === i || e.$$typeof === b || e.$$typeof === d || // 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 === se || e.getModuleId !== void 0));
|
|
83
83
|
}
|
|
84
84
|
function We(e, r, t) {
|
|
85
85
|
var n = e.displayName;
|
|
86
86
|
if (n)
|
|
87
87
|
return n;
|
|
88
|
-
var
|
|
89
|
-
return
|
|
88
|
+
var s = r.displayName || r.name || "";
|
|
89
|
+
return s !== "" ? t + "(" + s + ")" : t;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function ce(e) {
|
|
92
92
|
return e.displayName || "Context";
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function P(e) {
|
|
95
95
|
if (e == null)
|
|
96
96
|
return null;
|
|
97
|
-
if (typeof e.tag == "number" &&
|
|
97
|
+
if (typeof e.tag == "number" && u("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
98
98
|
return e.displayName || e.name || null;
|
|
99
99
|
if (typeof e == "string")
|
|
100
100
|
return e;
|
|
101
101
|
switch (e) {
|
|
102
|
-
case
|
|
102
|
+
case y:
|
|
103
103
|
return "Fragment";
|
|
104
|
-
case g:
|
|
105
|
-
return "Portal";
|
|
106
104
|
case m:
|
|
105
|
+
return "Portal";
|
|
106
|
+
case l:
|
|
107
107
|
return "Profiler";
|
|
108
108
|
case v:
|
|
109
109
|
return "StrictMode";
|
|
110
|
-
case
|
|
110
|
+
case w:
|
|
111
111
|
return "Suspense";
|
|
112
|
-
case
|
|
112
|
+
case h:
|
|
113
113
|
return "SuspenseList";
|
|
114
114
|
}
|
|
115
115
|
if (typeof e == "object")
|
|
116
116
|
switch (e.$$typeof) {
|
|
117
|
-
case
|
|
117
|
+
case b:
|
|
118
118
|
var r = e;
|
|
119
|
-
return
|
|
120
|
-
case
|
|
119
|
+
return ce(r) + ".Consumer";
|
|
120
|
+
case i:
|
|
121
121
|
var t = e;
|
|
122
|
-
return
|
|
123
|
-
case
|
|
122
|
+
return ce(t._context) + ".Provider";
|
|
123
|
+
case d:
|
|
124
124
|
return We(e, e.render, "ForwardRef");
|
|
125
|
-
case
|
|
125
|
+
case _:
|
|
126
126
|
var n = e.displayName || null;
|
|
127
|
-
return n !== null ? n :
|
|
128
|
-
case
|
|
129
|
-
var
|
|
127
|
+
return n !== null ? n : P(e.type) || "Memo";
|
|
128
|
+
case O: {
|
|
129
|
+
var s = e, c = s._payload, o = s._init;
|
|
130
130
|
try {
|
|
131
|
-
return
|
|
131
|
+
return P(o(c));
|
|
132
132
|
} catch {
|
|
133
133
|
return null;
|
|
134
134
|
}
|
|
@@ -136,18 +136,18 @@ function mr() {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
var
|
|
140
|
-
function
|
|
139
|
+
var A = Object.assign, $ = 0, fe, le, de, ve, pe, ge, he;
|
|
140
|
+
function Ee() {
|
|
141
141
|
}
|
|
142
|
-
|
|
142
|
+
Ee.__reactDisabledLog = !0;
|
|
143
143
|
function Me() {
|
|
144
144
|
{
|
|
145
|
-
if (
|
|
146
|
-
|
|
145
|
+
if ($ === 0) {
|
|
146
|
+
fe = console.log, le = console.info, de = console.warn, ve = console.error, pe = console.group, ge = console.groupCollapsed, he = console.groupEnd;
|
|
147
147
|
var e = {
|
|
148
148
|
configurable: !0,
|
|
149
149
|
enumerable: !0,
|
|
150
|
-
value:
|
|
150
|
+
value: Ee,
|
|
151
151
|
writable: !0
|
|
152
152
|
};
|
|
153
153
|
Object.defineProperties(console, {
|
|
@@ -160,199 +160,199 @@ function mr() {
|
|
|
160
160
|
groupEnd: e
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
|
|
163
|
+
$++;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
function Ne() {
|
|
167
167
|
{
|
|
168
|
-
if (
|
|
168
|
+
if ($--, $ === 0) {
|
|
169
169
|
var e = {
|
|
170
170
|
configurable: !0,
|
|
171
171
|
enumerable: !0,
|
|
172
172
|
writable: !0
|
|
173
173
|
};
|
|
174
174
|
Object.defineProperties(console, {
|
|
175
|
-
log:
|
|
176
|
-
value:
|
|
175
|
+
log: A({}, e, {
|
|
176
|
+
value: fe
|
|
177
177
|
}),
|
|
178
|
-
info:
|
|
179
|
-
value:
|
|
178
|
+
info: A({}, e, {
|
|
179
|
+
value: le
|
|
180
180
|
}),
|
|
181
|
-
warn:
|
|
182
|
-
value:
|
|
181
|
+
warn: A({}, e, {
|
|
182
|
+
value: de
|
|
183
183
|
}),
|
|
184
|
-
error:
|
|
185
|
-
value:
|
|
184
|
+
error: A({}, e, {
|
|
185
|
+
value: ve
|
|
186
186
|
}),
|
|
187
|
-
group:
|
|
188
|
-
value:
|
|
187
|
+
group: A({}, e, {
|
|
188
|
+
value: pe
|
|
189
189
|
}),
|
|
190
|
-
groupCollapsed:
|
|
191
|
-
value:
|
|
190
|
+
groupCollapsed: A({}, e, {
|
|
191
|
+
value: ge
|
|
192
192
|
}),
|
|
193
|
-
groupEnd:
|
|
194
|
-
value:
|
|
193
|
+
groupEnd: A({}, e, {
|
|
194
|
+
value: he
|
|
195
195
|
})
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
|
-
|
|
198
|
+
$ < 0 && u("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
var
|
|
202
|
-
function
|
|
201
|
+
var K = C.ReactCurrentDispatcher, H;
|
|
202
|
+
function V(e, r, t) {
|
|
203
203
|
{
|
|
204
|
-
if (
|
|
204
|
+
if (H === void 0)
|
|
205
205
|
try {
|
|
206
206
|
throw Error();
|
|
207
|
-
} catch (
|
|
208
|
-
var n =
|
|
209
|
-
|
|
207
|
+
} catch (s) {
|
|
208
|
+
var n = s.stack.trim().match(/\n( *(at )?)/);
|
|
209
|
+
H = n && n[1] || "";
|
|
210
210
|
}
|
|
211
211
|
return `
|
|
212
|
-
` +
|
|
212
|
+
` + H + e;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
var
|
|
215
|
+
var X = !1, U;
|
|
216
216
|
{
|
|
217
217
|
var Ve = typeof WeakMap == "function" ? WeakMap : Map;
|
|
218
|
-
|
|
218
|
+
U = new Ve();
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
if (!e ||
|
|
220
|
+
function me(e, r) {
|
|
221
|
+
if (!e || X)
|
|
222
222
|
return "";
|
|
223
223
|
{
|
|
224
|
-
var t =
|
|
224
|
+
var t = U.get(e);
|
|
225
225
|
if (t !== void 0)
|
|
226
226
|
return t;
|
|
227
227
|
}
|
|
228
228
|
var n;
|
|
229
|
-
|
|
230
|
-
var
|
|
229
|
+
X = !0;
|
|
230
|
+
var s = Error.prepareStackTrace;
|
|
231
231
|
Error.prepareStackTrace = void 0;
|
|
232
|
-
var
|
|
233
|
-
|
|
232
|
+
var c;
|
|
233
|
+
c = K.current, K.current = null, Me();
|
|
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(
|
|
246
|
-
} catch (
|
|
247
|
-
n =
|
|
245
|
+
Reflect.construct(o, []);
|
|
246
|
+
} catch (j) {
|
|
247
|
+
n = j;
|
|
248
248
|
}
|
|
249
|
-
Reflect.construct(e, [],
|
|
249
|
+
Reflect.construct(e, [], o);
|
|
250
250
|
} else {
|
|
251
251
|
try {
|
|
252
|
-
|
|
253
|
-
} catch (
|
|
254
|
-
n =
|
|
252
|
+
o.call();
|
|
253
|
+
} catch (j) {
|
|
254
|
+
n = j;
|
|
255
255
|
}
|
|
256
|
-
e.call(
|
|
256
|
+
e.call(o.prototype);
|
|
257
257
|
}
|
|
258
258
|
} else {
|
|
259
259
|
try {
|
|
260
260
|
throw Error();
|
|
261
|
-
} catch (
|
|
262
|
-
n =
|
|
261
|
+
} catch (j) {
|
|
262
|
+
n = j;
|
|
263
263
|
}
|
|
264
264
|
e();
|
|
265
265
|
}
|
|
266
|
-
} catch (
|
|
267
|
-
if (
|
|
268
|
-
for (var a =
|
|
266
|
+
} catch (j) {
|
|
267
|
+
if (j && n && typeof j.stack == "string") {
|
|
268
|
+
for (var a = j.stack.split(`
|
|
269
269
|
`), R = n.stack.split(`
|
|
270
|
-
`),
|
|
271
|
-
|
|
272
|
-
for (;
|
|
273
|
-
if (a[
|
|
274
|
-
if (
|
|
270
|
+
`), p = a.length - 1, g = R.length - 1; p >= 1 && g >= 0 && a[p] !== R[g]; )
|
|
271
|
+
g--;
|
|
272
|
+
for (; p >= 1 && g >= 0; p--, g--)
|
|
273
|
+
if (a[p] !== R[g]) {
|
|
274
|
+
if (p !== 1 || g !== 1)
|
|
275
275
|
do
|
|
276
|
-
if (
|
|
277
|
-
var
|
|
278
|
-
` + a[
|
|
279
|
-
return e.displayName &&
|
|
276
|
+
if (p--, g--, g < 0 || a[p] !== R[g]) {
|
|
277
|
+
var S = `
|
|
278
|
+
` + a[p].replace(" at new ", " at ");
|
|
279
|
+
return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, S), S;
|
|
280
280
|
}
|
|
281
|
-
while (
|
|
281
|
+
while (p >= 1 && g >= 0);
|
|
282
282
|
break;
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
} finally {
|
|
286
|
-
|
|
286
|
+
X = !1, K.current = c, Ne(), Error.prepareStackTrace = s;
|
|
287
287
|
}
|
|
288
|
-
var
|
|
289
|
-
return typeof e == "function" &&
|
|
288
|
+
var F = e ? e.displayName || e.name : "", ke = F ? V(F) : "";
|
|
289
|
+
return typeof e == "function" && U.set(e, ke), ke;
|
|
290
290
|
}
|
|
291
291
|
function Ue(e, r, t) {
|
|
292
|
-
return
|
|
292
|
+
return me(e, !1);
|
|
293
293
|
}
|
|
294
294
|
function qe(e) {
|
|
295
295
|
var r = e.prototype;
|
|
296
296
|
return !!(r && r.isReactComponent);
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function q(e, r, t) {
|
|
299
299
|
if (e == null)
|
|
300
300
|
return "";
|
|
301
301
|
if (typeof e == "function")
|
|
302
|
-
return
|
|
302
|
+
return me(e, qe(e));
|
|
303
303
|
if (typeof e == "string")
|
|
304
|
-
return
|
|
304
|
+
return V(e);
|
|
305
305
|
switch (e) {
|
|
306
|
-
case
|
|
307
|
-
return
|
|
308
|
-
case
|
|
309
|
-
return
|
|
306
|
+
case w:
|
|
307
|
+
return V("Suspense");
|
|
308
|
+
case h:
|
|
309
|
+
return V("SuspenseList");
|
|
310
310
|
}
|
|
311
311
|
if (typeof e == "object")
|
|
312
312
|
switch (e.$$typeof) {
|
|
313
|
-
case
|
|
313
|
+
case d:
|
|
314
314
|
return Ue(e.render);
|
|
315
|
-
case
|
|
316
|
-
return
|
|
317
|
-
case
|
|
318
|
-
var n = e,
|
|
315
|
+
case _:
|
|
316
|
+
return q(e.type, r, t);
|
|
317
|
+
case O: {
|
|
318
|
+
var n = e, s = n._payload, c = n._init;
|
|
319
319
|
try {
|
|
320
|
-
return
|
|
320
|
+
return q(c(s), r, t);
|
|
321
321
|
} catch {
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
return "";
|
|
326
326
|
}
|
|
327
|
-
var
|
|
328
|
-
function
|
|
327
|
+
var G = Object.prototype.hasOwnProperty, ye = {}, be = C.ReactDebugCurrentFrame;
|
|
328
|
+
function B(e) {
|
|
329
329
|
if (e) {
|
|
330
|
-
var r = e._owner, t =
|
|
331
|
-
|
|
330
|
+
var r = e._owner, t = q(e.type, e._source, r ? r.type : null);
|
|
331
|
+
be.setExtraStackFrame(t);
|
|
332
332
|
} else
|
|
333
|
-
|
|
333
|
+
be.setExtraStackFrame(null);
|
|
334
334
|
}
|
|
335
|
-
function Ge(e, r, t, n,
|
|
335
|
+
function Ge(e, r, t, n, s) {
|
|
336
336
|
{
|
|
337
|
-
var
|
|
338
|
-
for (var
|
|
339
|
-
if (
|
|
337
|
+
var c = Function.call.bind(G);
|
|
338
|
+
for (var o in e)
|
|
339
|
+
if (c(e, o)) {
|
|
340
340
|
var a = void 0;
|
|
341
341
|
try {
|
|
342
|
-
if (typeof e[
|
|
343
|
-
var R = Error((n || "React class") + ": " + t + " type `" +
|
|
342
|
+
if (typeof e[o] != "function") {
|
|
343
|
+
var R = 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
344
|
throw R.name = "Invariant Violation", R;
|
|
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 (p) {
|
|
348
|
+
a = p;
|
|
349
349
|
}
|
|
350
|
-
a && !(a instanceof Error) && (
|
|
350
|
+
a && !(a instanceof Error) && (B(s), u("%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), B(null)), a instanceof Error && !(a.message in ye) && (ye[a.message] = !0, B(s), u("Failed %s type: %s", t, a.message), B(null));
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
var Be = Array.isArray;
|
|
355
|
-
function
|
|
355
|
+
function Z(e) {
|
|
356
356
|
return Be(e);
|
|
357
357
|
}
|
|
358
358
|
function Je(e) {
|
|
@@ -363,27 +363,27 @@ function mr() {
|
|
|
363
363
|
}
|
|
364
364
|
function ze(e) {
|
|
365
365
|
try {
|
|
366
|
-
return
|
|
366
|
+
return Re(e), !1;
|
|
367
367
|
} catch {
|
|
368
368
|
return !0;
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function Re(e) {
|
|
372
372
|
return "" + e;
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function _e(e) {
|
|
375
375
|
if (ze(e))
|
|
376
|
-
return
|
|
376
|
+
return u("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), Re(e);
|
|
377
377
|
}
|
|
378
|
-
var
|
|
378
|
+
var L = C.ReactCurrentOwner, Ke = {
|
|
379
379
|
key: !0,
|
|
380
380
|
ref: !0,
|
|
381
381
|
__self: !0,
|
|
382
382
|
__source: !0
|
|
383
|
-
},
|
|
384
|
-
|
|
383
|
+
}, we, Te, Q;
|
|
384
|
+
Q = {};
|
|
385
385
|
function He(e) {
|
|
386
|
-
if (
|
|
386
|
+
if (G.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 mr() {
|
|
|
391
391
|
return e.ref !== void 0;
|
|
392
392
|
}
|
|
393
393
|
function Xe(e) {
|
|
394
|
-
if (
|
|
394
|
+
if (G.call(e, "key")) {
|
|
395
395
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
396
396
|
if (r && r.isReactWarning)
|
|
397
397
|
return !1;
|
|
@@ -399,15 +399,15 @@ function mr() {
|
|
|
399
399
|
return e.key !== void 0;
|
|
400
400
|
}
|
|
401
401
|
function Ze(e, r) {
|
|
402
|
-
if (typeof e.ref == "string" &&
|
|
403
|
-
var t =
|
|
404
|
-
|
|
402
|
+
if (typeof e.ref == "string" && L.current && r && L.current.stateNode !== r) {
|
|
403
|
+
var t = P(L.current.type);
|
|
404
|
+
Q[t] || (u('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(L.current.type), e.ref), Q[t] = !0);
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
function Qe(e, r) {
|
|
408
408
|
{
|
|
409
409
|
var t = function() {
|
|
410
|
-
|
|
410
|
+
we || (we = !0, u("%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));
|
|
411
411
|
};
|
|
412
412
|
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
413
413
|
get: t,
|
|
@@ -418,7 +418,7 @@ function mr() {
|
|
|
418
418
|
function er(e, r) {
|
|
419
419
|
{
|
|
420
420
|
var t = function() {
|
|
421
|
-
|
|
421
|
+
Te || (Te = !0, u("%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 mr() {
|
|
|
426
426
|
});
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
var rr = function(e, r, t, n,
|
|
429
|
+
var rr = function(e, r, t, n, s, c, o) {
|
|
430
430
|
var a = {
|
|
431
431
|
// This tag allows us to uniquely identify this as a React Element
|
|
432
|
-
$$typeof:
|
|
432
|
+
$$typeof: E,
|
|
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: c
|
|
440
440
|
};
|
|
441
441
|
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
442
442
|
configurable: !1,
|
|
@@ -452,44 +452,44 @@ function mr() {
|
|
|
452
452
|
configurable: !1,
|
|
453
453
|
enumerable: !1,
|
|
454
454
|
writable: !1,
|
|
455
|
-
value:
|
|
455
|
+
value: s
|
|
456
456
|
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
457
457
|
};
|
|
458
|
-
function tr(e, r, t, n,
|
|
458
|
+
function tr(e, r, t, n, s) {
|
|
459
459
|
{
|
|
460
|
-
var
|
|
461
|
-
t !== void 0 && (
|
|
462
|
-
for (
|
|
463
|
-
|
|
460
|
+
var c, o = {}, a = null, R = null;
|
|
461
|
+
t !== void 0 && (_e(t), a = "" + t), Xe(r) && (_e(r.key), a = "" + r.key), He(r) && (R = r.ref, Ze(r, s));
|
|
462
|
+
for (c in r)
|
|
463
|
+
G.call(r, c) && !Ke.hasOwnProperty(c) && (o[c] = r[c]);
|
|
464
464
|
if (e && e.defaultProps) {
|
|
465
|
-
var
|
|
466
|
-
for (
|
|
467
|
-
|
|
465
|
+
var p = e.defaultProps;
|
|
466
|
+
for (c in p)
|
|
467
|
+
o[c] === void 0 && (o[c] = p[c]);
|
|
468
468
|
}
|
|
469
469
|
if (a || R) {
|
|
470
|
-
var
|
|
471
|
-
a && Qe(
|
|
470
|
+
var g = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
471
|
+
a && Qe(o, g), R && er(o, g);
|
|
472
472
|
}
|
|
473
|
-
return rr(e, a, R,
|
|
473
|
+
return rr(e, a, R, s, n, L.current, o);
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
var
|
|
477
|
-
function
|
|
476
|
+
var ee = C.ReactCurrentOwner, Oe = C.ReactDebugCurrentFrame;
|
|
477
|
+
function D(e) {
|
|
478
478
|
if (e) {
|
|
479
|
-
var r = e._owner, t =
|
|
480
|
-
|
|
479
|
+
var r = e._owner, t = q(e.type, e._source, r ? r.type : null);
|
|
480
|
+
Oe.setExtraStackFrame(t);
|
|
481
481
|
} else
|
|
482
|
-
|
|
482
|
+
Oe.setExtraStackFrame(null);
|
|
483
483
|
}
|
|
484
|
-
var
|
|
485
|
-
|
|
486
|
-
function
|
|
487
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
484
|
+
var re;
|
|
485
|
+
re = !1;
|
|
486
|
+
function te(e) {
|
|
487
|
+
return typeof e == "object" && e !== null && e.$$typeof === E;
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function Se() {
|
|
490
490
|
{
|
|
491
|
-
if (
|
|
492
|
-
var e =
|
|
491
|
+
if (ee.current) {
|
|
492
|
+
var e = P(ee.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 Ce = {};
|
|
513
513
|
function ar(e) {
|
|
514
514
|
{
|
|
515
|
-
var r =
|
|
515
|
+
var r = Se();
|
|
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 Pe(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 = ar(r);
|
|
531
|
-
if (
|
|
531
|
+
if (Ce[t])
|
|
532
532
|
return;
|
|
533
|
-
|
|
533
|
+
Ce[t] = !0;
|
|
534
534
|
var n = "";
|
|
535
|
-
e && e._owner && e._owner !==
|
|
535
|
+
e && e._owner && e._owner !== ee.current && (n = " It was passed a child from " + P(e._owner.type) + "."), D(e), u('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), D(null);
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function je(e, r) {
|
|
539
539
|
{
|
|
540
540
|
if (typeof e != "object")
|
|
541
541
|
return;
|
|
542
|
-
if (
|
|
542
|
+
if (Z(e))
|
|
543
543
|
for (var t = 0; t < e.length; t++) {
|
|
544
544
|
var n = e[t];
|
|
545
|
-
|
|
545
|
+
te(n) && Pe(n, r);
|
|
546
546
|
}
|
|
547
|
-
else if (
|
|
547
|
+
else if (te(e))
|
|
548
548
|
e._store && (e._store.validated = !0);
|
|
549
549
|
else if (e) {
|
|
550
|
-
var
|
|
551
|
-
if (typeof
|
|
552
|
-
for (var
|
|
553
|
-
|
|
550
|
+
var s = M(e);
|
|
551
|
+
if (typeof s == "function" && s !== e.entries)
|
|
552
|
+
for (var c = s.call(e), o; !(o = c.next()).done; )
|
|
553
|
+
te(o.value) && Pe(o.value, r);
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
}
|
|
@@ -562,21 +562,21 @@ 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 === d || // Note: Memo only checks outer props here.
|
|
566
566
|
// Inner props are checked in the reconciler.
|
|
567
|
-
r.$$typeof ===
|
|
567
|
+
r.$$typeof === _))
|
|
568
568
|
t = r.propTypes;
|
|
569
569
|
else
|
|
570
570
|
return;
|
|
571
571
|
if (t) {
|
|
572
|
-
var n =
|
|
572
|
+
var n = P(r);
|
|
573
573
|
Ge(t, e.props, "prop", n, e);
|
|
574
|
-
} else if (r.PropTypes !== void 0 && !
|
|
575
|
-
|
|
576
|
-
var
|
|
577
|
-
|
|
574
|
+
} else if (r.PropTypes !== void 0 && !re) {
|
|
575
|
+
re = !0;
|
|
576
|
+
var s = P(r);
|
|
577
|
+
u("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
|
|
578
578
|
}
|
|
579
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
579
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && u("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
582
|
function ir(e) {
|
|
@@ -584,133 +584,151 @@ Check the top-level render call using <` + t + ">.");
|
|
|
584
584
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
585
585
|
var n = r[t];
|
|
586
586
|
if (n !== "children" && n !== "key") {
|
|
587
|
-
|
|
587
|
+
D(e), u("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
|
|
588
588
|
break;
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
|
-
e.ref !== null && (
|
|
591
|
+
e.ref !== null && (D(e), u("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function xe(e, r, t, n, s, c) {
|
|
595
595
|
{
|
|
596
|
-
var
|
|
597
|
-
if (!
|
|
596
|
+
var o = Ye(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 R = nr(
|
|
601
|
-
R ? a += R : a +=
|
|
602
|
-
var
|
|
603
|
-
e === null ?
|
|
600
|
+
var R = nr(s);
|
|
601
|
+
R ? a += R : a += Se();
|
|
602
|
+
var p;
|
|
603
|
+
e === null ? p = "null" : Z(e) ? p = "array" : e !== void 0 && e.$$typeof === E ? (p = "<" + (P(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : p = typeof e, u("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", p, a);
|
|
604
604
|
}
|
|
605
|
-
var
|
|
606
|
-
if (
|
|
607
|
-
return
|
|
608
|
-
if (
|
|
609
|
-
var
|
|
610
|
-
if (
|
|
605
|
+
var g = tr(e, r, t, s, c);
|
|
606
|
+
if (g == null)
|
|
607
|
+
return g;
|
|
608
|
+
if (o) {
|
|
609
|
+
var S = r.children;
|
|
610
|
+
if (S !== void 0)
|
|
611
611
|
if (n)
|
|
612
|
-
if (
|
|
613
|
-
for (var
|
|
614
|
-
|
|
615
|
-
Object.freeze && Object.freeze(
|
|
612
|
+
if (Z(S)) {
|
|
613
|
+
for (var F = 0; F < S.length; F++)
|
|
614
|
+
je(S[F], e);
|
|
615
|
+
Object.freeze && Object.freeze(S);
|
|
616
616
|
} else
|
|
617
|
-
|
|
617
|
+
u("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
|
+
je(S, e);
|
|
620
620
|
}
|
|
621
|
-
return e ===
|
|
621
|
+
return e === y ? ir(g) : or(g), g;
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
624
|
function ur(e, r, t) {
|
|
625
|
-
return
|
|
625
|
+
return xe(e, r, t, !0);
|
|
626
626
|
}
|
|
627
627
|
function sr(e, r, t) {
|
|
628
|
-
return
|
|
628
|
+
return xe(e, r, t, !1);
|
|
629
629
|
}
|
|
630
|
-
var
|
|
631
|
-
|
|
632
|
-
}()),
|
|
630
|
+
var cr = sr, fr = ur;
|
|
631
|
+
W.Fragment = y, W.jsx = cr, W.jsxs = fr;
|
|
632
|
+
}()), W;
|
|
633
633
|
}
|
|
634
634
|
(function(f) {
|
|
635
|
-
process.env.NODE_ENV === "production" ? f.exports =
|
|
636
|
-
})(
|
|
637
|
-
const
|
|
635
|
+
process.env.NODE_ENV === "production" ? f.exports = yr() : f.exports = br();
|
|
636
|
+
})(mr);
|
|
637
|
+
const I = ae.jsx, z = lr({
|
|
638
|
+
axios: void 0,
|
|
638
639
|
children: void 0,
|
|
639
640
|
Navigate: void 0,
|
|
640
641
|
Outlet: void 0,
|
|
641
642
|
translate: void 0,
|
|
642
643
|
useAuth: void 0,
|
|
643
644
|
useLocation: void 0
|
|
644
|
-
}),
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
645
|
+
}), _r = ({
|
|
646
|
+
axios: f,
|
|
647
|
+
children: E,
|
|
648
|
+
translate: m,
|
|
649
|
+
useAuth: y,
|
|
650
|
+
Outlet: v,
|
|
651
|
+
Navigate: l,
|
|
652
|
+
useLocation: i,
|
|
653
|
+
useGoogleTagManager: b
|
|
652
654
|
}) => {
|
|
653
|
-
const
|
|
655
|
+
const d = dr(
|
|
654
656
|
() => ({
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
657
|
+
axios: f,
|
|
658
|
+
Navigate: l,
|
|
659
|
+
Outlet: v,
|
|
660
|
+
translate: m,
|
|
661
|
+
useAuth: y,
|
|
662
|
+
useGoogleTagManager: b,
|
|
663
|
+
useLocation: i
|
|
661
664
|
}),
|
|
662
|
-
[v,
|
|
665
|
+
[l, v, f, m, y, b, i]
|
|
663
666
|
);
|
|
664
|
-
return /* @__PURE__ */
|
|
665
|
-
},
|
|
666
|
-
|
|
667
|
+
return /* @__PURE__ */ I(z.Provider, { value: d, children: E });
|
|
668
|
+
}, J = (f) => `RequireAuth require « ${f} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, wr = ({
|
|
669
|
+
Fallback: f,
|
|
670
|
+
loginPath: E = "/login",
|
|
671
|
+
localStorageKey: m = "user",
|
|
672
|
+
redirect401Path: y = "/login",
|
|
673
|
+
...v
|
|
674
|
+
}) => {
|
|
675
|
+
var x, k, M, C;
|
|
667
676
|
const {
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
677
|
+
axios: l = v.axios,
|
|
678
|
+
useLocation: i = v.useLocation,
|
|
679
|
+
useAuth: b = v.useAuth,
|
|
680
|
+
Outlet: d = v.Outlet,
|
|
681
|
+
Navigate: w = v.Navigate
|
|
682
|
+
} = oe(z);
|
|
683
|
+
if (b === void 0)
|
|
684
|
+
throw new Error(J("useAuth"));
|
|
685
|
+
if (i === void 0)
|
|
686
|
+
throw new Error(J("useLocation"));
|
|
687
|
+
if (d === void 0)
|
|
688
|
+
throw new Error(J("Outlet"));
|
|
689
|
+
if (w === void 0)
|
|
690
|
+
throw new Error(J("Navigate"));
|
|
691
|
+
const [h, _] = vr(null), { isLogged: O } = b(), T = i();
|
|
692
|
+
return pr(() => {
|
|
693
|
+
l == null || l.interceptors.response.use(
|
|
694
|
+
(u) => u,
|
|
695
|
+
async (u) => {
|
|
696
|
+
var N;
|
|
697
|
+
return typeof u == "object" && u && "response" in u && u.response && typeof u.response == "object" && "status" in u.response && u.response && typeof u.response == "object" && "status" in u.response && ((N = u == null ? void 0 : u.response) == null ? void 0 : N.status) === 401 && (l.defaults.headers.common.Authorization = null, localStorage.removeItem(m), _(y)), Promise.reject(u);
|
|
698
|
+
}
|
|
699
|
+
);
|
|
700
|
+
}, [l == null ? void 0 : l.defaults, l == null ? void 0 : l.interceptors.response, m, y]), O && !h ? /* @__PURE__ */ I(gr, { fallback: f, children: (k = (x = T.state) == null ? void 0 : x.from) != null && k.state && ((C = (M = T.state) == null ? void 0 : M.from) == null ? void 0 : C.pathname) === E ? /* @__PURE__ */ I(w, { to: T.state.from.state.from.pathname + T.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ I(d, {}) }) : /* @__PURE__ */ I(w, { to: E, state: { from: T }, replace: !0 });
|
|
701
|
+
}, ne = (f) => `GTMSendPageView require « ${f} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Tr = ({ ...f }) => {
|
|
684
702
|
const {
|
|
685
|
-
useLocation:
|
|
686
|
-
Outlet:
|
|
687
|
-
useGoogleTagManager:
|
|
688
|
-
} =
|
|
689
|
-
if (h === void 0)
|
|
690
|
-
throw new Error(re("useLocation"));
|
|
691
|
-
if (g === void 0)
|
|
692
|
-
throw new Error(re("Outlet"));
|
|
703
|
+
useLocation: E = f.useLocation,
|
|
704
|
+
Outlet: m = f.Outlet,
|
|
705
|
+
useGoogleTagManager: y = f.useGoogleTagManager
|
|
706
|
+
} = oe(z);
|
|
693
707
|
if (E === void 0)
|
|
694
|
-
throw new Error(
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
},
|
|
700
|
-
|
|
701
|
-
|
|
708
|
+
throw new Error(ne("useLocation"));
|
|
709
|
+
if (m === void 0)
|
|
710
|
+
throw new Error(ne("Outlet"));
|
|
711
|
+
if (y === void 0)
|
|
712
|
+
throw new Error(ne("useGoogleTagManager"));
|
|
713
|
+
const { pathname: v } = E(), { sendEvent: l } = y();
|
|
714
|
+
return hr(() => {
|
|
715
|
+
l({ event: "pageView", pathname: v });
|
|
716
|
+
}, [v, l]), /* @__PURE__ */ I(m, {});
|
|
717
|
+
}, Or = (f) => {
|
|
718
|
+
const { unknownErrorTranslationKey: E = "error.unknownError" } = f || {}, { translate: m = f == null ? void 0 : f.translate } = oe(z);
|
|
719
|
+
return { printError: Er(
|
|
702
720
|
(v) => {
|
|
703
|
-
var
|
|
704
|
-
const
|
|
705
|
-
return v != null && v.reason ? String(v.reason) : (
|
|
721
|
+
var b, d, w, h, _, O, T, x, k;
|
|
722
|
+
const l = m ? m(E) : "Unknown error", { response: i } = v || {};
|
|
723
|
+
return v != null && v.reason ? String(v.reason) : (b = i == null ? void 0 : i.data) != null && b.reason ? String(i.data.reason) : (d = i == null ? void 0 : i.data) != null && d.message ? String(i.data.message) : (h = (w = i == null ? void 0 : i.data) == null ? void 0 : w.detail) != null && h.length && Array.isArray((_ = i == null ? void 0 : i.data) == null ? void 0 : _.detail) && ((T = (O = i == null ? void 0 : i.data) == null ? void 0 : O.detail[0]) != null && T.msg) && typeof ((k = (x = i == null ? void 0 : i.data) == null ? void 0 : x.detail[0]) == null ? void 0 : k.msg) == "string" ? String(i.data.detail[0].msg) : l;
|
|
706
724
|
},
|
|
707
|
-
[
|
|
725
|
+
[m, E]
|
|
708
726
|
) };
|
|
709
727
|
};
|
|
710
728
|
export {
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
729
|
+
Tr as GTMSendPageView,
|
|
730
|
+
z as InjectDependenciesContext,
|
|
731
|
+
_r as InjectDependenciesProvider,
|
|
732
|
+
wr as RequireAuth,
|
|
733
|
+
Or as useResponseError
|
|
716
734
|
};
|
package/dist/main.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(P,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(P=typeof globalThis<"u"?globalThis:P||self,E(P["@tracktor/shared-module"]={},P.React))})(this,function(P,E){"use strict";var q={},Ie={get exports(){return q},set exports(f){q=f}},Y={};/**
|
|
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 ue;function Le(){if(ue)return Y;ue=1;var f=E,m=Symbol.for("react.element"),y=Symbol.for("react.fragment"),b=Object.prototype.hasOwnProperty,v=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function i(R,d,w){var h,T={},S=null,O=null;w!==void 0&&(S=""+w),d.key!==void 0&&(S=""+d.key),d.ref!==void 0&&(O=d.ref);for(h in d)b.call(d,h)&&!l.hasOwnProperty(h)&&(T[h]=d[h]);if(R&&R.defaultProps)for(h in d=R.defaultProps,d)T[h]===void 0&&(T[h]=d[h]);return{$$typeof:m,type:R,key:S,ref:O,props:T,_owner:v.current}}return Y.Fragment=y,Y.jsx=i,Y.jsxs=i,Y}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 se;function Me(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var f=E,m=Symbol.for("react.element"),y=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),R=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),D=Symbol.iterator,A="@@iterator";function B(e){if(e===null||typeof e!="object")return null;var r=D&&e[D]||e[A];return typeof r=="function"?r:null}var j=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function u(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ce("error",e,t)}}function ce(e,r,t){{var n=j.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var c=t.map(function(o){return String(o)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var fe=!1,J=!1,Ue=!1,Ge=!1,Be=!1,le;le=Symbol.for("react.module.reference");function Je(e){return!!(typeof e=="string"||typeof e=="function"||e===b||e===l||Be||e===v||e===w||e===h||Ge||e===O||fe||J||Ue||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===T||e.$$typeof===i||e.$$typeof===R||e.$$typeof===d||e.$$typeof===le||e.getModuleId!==void 0))}function ze(e,r,t){var n=e.displayName;if(n)return n;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function de(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&u("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 y:return"Portal";case l:return"Profiler";case v:return"StrictMode";case w:return"Suspense";case h:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case R:var r=e;return de(r)+".Consumer";case i:var t=e;return de(t._context)+".Provider";case d:return ze(e,e.render,"ForwardRef");case T:var n=e.displayName||null;return n!==null?n:x(e.type)||"Memo";case S:{var s=e,c=s._payload,o=s._init;try{return x(o(c))}catch{return null}}}return null}var F=Object.assign,V=0,ve,pe,ge,he,Ee,me,ye;function be(){}be.__reactDisabledLog=!0;function Ke(){{if(V===0){ve=console.log,pe=console.info,ge=console.warn,he=console.error,Ee=console.group,me=console.groupCollapsed,ye=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}V++}}function $e(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:ve}),info:F({},e,{value:pe}),warn:F({},e,{value:ge}),error:F({},e,{value:he}),group:F({},e,{value:Ee}),groupCollapsed:F({},e,{value:me}),groupEnd:F({},e,{value:ye})})}V<0&&u("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Q=j.ReactCurrentDispatcher,ee;function z(e,r,t){{if(ee===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);ee=n&&n[1]||""}return`
|
|
18
|
+
`+ee+e}}var re=!1,K;{var He=typeof WeakMap=="function"?WeakMap:Map;K=new He}function Re(e,r){if(!e||re)return"";{var t=K.get(e);if(t!==void 0)return t}var n;re=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=Q.current,Q.current=null,Ke();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(k){n=k}Reflect.construct(e,[],o)}else{try{o.call()}catch(k){n=k}e.call(o.prototype)}}else{try{throw Error()}catch(k){n=k}e()}}catch(k){if(k&&n&&typeof k.stack=="string"){for(var a=k.stack.split(`
|
|
19
|
+
`),_=n.stack.split(`
|
|
20
|
+
`),p=a.length-1,g=_.length-1;p>=1&&g>=0&&a[p]!==_[g];)g--;for(;p>=1&&g>=0;p--,g--)if(a[p]!==_[g]){if(p!==1||g!==1)do if(p--,g--,g<0||a[p]!==_[g]){var C=`
|
|
21
|
+
`+a[p].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,C),C}while(p>=1&&g>=0);break}}}finally{re=!1,Q.current=c,$e(),Error.prepareStackTrace=s}var M=e?e.displayName||e.name:"",Fe=M?z(M):"";return typeof e=="function"&&K.set(e,Fe),Fe}function Xe(e,r,t){return Re(e,!1)}function qe(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function $(e,r,t){if(e==null)return"";if(typeof e=="function")return Re(e,qe(e));if(typeof e=="string")return z(e);switch(e){case w:return z("Suspense");case h:return z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Xe(e.render);case T:return $(e.type,r,t);case S:{var n=e,s=n._payload,c=n._init;try{return $(c(s),r,t)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,_e={},Te=j.ReactDebugCurrentFrame;function X(e){if(e){var r=e._owner,t=$(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}function Ze(e,r,t,n,s){{var c=Function.call.bind(H);for(var o in e)if(c(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var _=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 _.name="Invariant Violation",_}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(p){a=p}a&&!(a instanceof Error)&&(X(s),u("%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),X(null)),a instanceof Error&&!(a.message in _e)&&(_e[a.message]=!0,X(s),u("Failed %s type: %s",t,a.message),X(null))}}}var Qe=Array.isArray;function te(e){return Qe(e)}function er(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function rr(e){try{return we(e),!1}catch{return!0}}function we(e){return""+e}function Oe(e){if(rr(e))return u("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",er(e)),we(e)}var U=j.ReactCurrentOwner,tr={key:!0,ref:!0,__self:!0,__source:!0},Se,Ce,ne;ne={};function nr(e){if(H.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ar(e){if(H.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function or(e,r){if(typeof e.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var t=x(U.current.type);ne[t]||(u('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',x(U.current.type),e.ref),ne[t]=!0)}}function ir(e,r){{var t=function(){Se||(Se=!0,u("%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 ur(e,r){{var t=function(){Ce||(Ce=!0,u("%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 sr=function(e,r,t,n,s,c,o){var a={$$typeof:m,type:e,key:r,ref:t,props:o,_owner:c};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:s}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function cr(e,r,t,n,s){{var c,o={},a=null,_=null;t!==void 0&&(Oe(t),a=""+t),ar(r)&&(Oe(r.key),a=""+r.key),nr(r)&&(_=r.ref,or(r,s));for(c in r)H.call(r,c)&&!tr.hasOwnProperty(c)&&(o[c]=r[c]);if(e&&e.defaultProps){var p=e.defaultProps;for(c in p)o[c]===void 0&&(o[c]=p[c])}if(a||_){var g=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ir(o,g),_&&ur(o,g)}return sr(e,a,_,s,n,U.current,o)}}var ae=j.ReactCurrentOwner,Pe=j.ReactDebugCurrentFrame;function L(e){if(e){var r=e._owner,t=$(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var oe;oe=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===m}function je(){{if(ae.current){var e=x(ae.current.type);if(e)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+e+"`."}return""}}function fr(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 xe={};function lr(e){{var r=je();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 ke(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=lr(r);if(xe[t])return;xe[t]=!0;var n="";e&&e._owner&&e._owner!==ae.current&&(n=" It was passed a child from "+x(e._owner.type)+"."),L(e),u('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),L(null)}}function De(e,r){{if(typeof e!="object")return;if(te(e))for(var t=0;t<e.length;t++){var n=e[t];ie(n)&&ke(n,r)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var s=B(e);if(typeof s=="function"&&s!==e.entries)for(var c=s.call(e),o;!(o=c.next()).done;)ie(o.value)&&ke(o.value,r)}}}function dr(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===d||r.$$typeof===T))t=r.propTypes;else return;if(t){var n=x(r);Ze(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!oe){oe=!0;var s=x(r);u("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&u("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){L(e),u("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),L(null);break}}e.ref!==null&&(L(e),u("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}function Ae(e,r,t,n,s,c){{var o=Je(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 _=fr(s);_?a+=_:a+=je();var p;e===null?p="null":te(e)?p="array":e!==void 0&&e.$$typeof===m?(p="<"+(x(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):p=typeof e,u("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",p,a)}var g=cr(e,r,t,s,c);if(g==null)return g;if(o){var C=r.children;if(C!==void 0)if(n)if(te(C)){for(var M=0;M<C.length;M++)De(C[M],e);Object.freeze&&Object.freeze(C)}else u("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 De(C,e)}return e===b?vr(g):dr(g),g}}function pr(e,r,t){return Ae(e,r,t,!0)}function gr(e,r,t){return Ae(e,r,t,!1)}var hr=gr,Er=pr;W.Fragment=b,W.jsx=hr,W.jsxs=Er}()),W}(function(f){process.env.NODE_ENV==="production"?f.exports=Le():f.exports=Me()})(Ie);const I=q.jsx,N=E.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ye=({axios:f,children:m,translate:y,useAuth:b,Outlet:v,Navigate:l,useLocation:i,useGoogleTagManager:R})=>{const d=E.useMemo(()=>({axios:f,Navigate:l,Outlet:v,translate:y,useAuth:b,useGoogleTagManager:R,useLocation:i}),[l,v,f,y,b,R,i]);return I(N.Provider,{value:d,children:m})},G=f=>`RequireAuth require « ${f} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:f,loginPath:m="/login",localStorageKey:y="user",redirect401Path:b="/login",...v})=>{var D,A,B,j;const{axios:l=v.axios,useLocation:i=v.useLocation,useAuth:R=v.useAuth,Outlet:d=v.Outlet,Navigate:w=v.Navigate}=E.useContext(N);if(R===void 0)throw new Error(G("useAuth"));if(i===void 0)throw new Error(G("useLocation"));if(d===void 0)throw new Error(G("Outlet"));if(w===void 0)throw new Error(G("Navigate"));const[h,T]=E.useState(null),{isLogged:S}=R(),O=i();return E.useLayoutEffect(()=>{l==null||l.interceptors.response.use(u=>u,async u=>{var J;return typeof u=="object"&&u&&"response"in u&&u.response&&typeof u.response=="object"&&"status"in u.response&&u.response&&typeof u.response=="object"&&"status"in u.response&&((J=u==null?void 0:u.response)==null?void 0:J.status)===401&&(l.defaults.headers.common.Authorization=null,localStorage.removeItem(y),T(b)),Promise.reject(u)})},[l==null?void 0:l.defaults,l==null?void 0:l.interceptors.response,y,b]),S&&!h?I(E.Suspense,{fallback:f,children:(A=(D=O.state)==null?void 0:D.from)!=null&&A.state&&((j=(B=O.state)==null?void 0:B.from)==null?void 0:j.pathname)===m?I(w,{to:O.state.from.state.from.pathname+O.state.from.state.from.search,replace:!0}):I(d,{})}):I(w,{to:m,state:{from:O},replace:!0})},Z=f=>`GTMSendPageView require « ${f} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ne=({...f})=>{const{useLocation:m=f.useLocation,Outlet:y=f.Outlet,useGoogleTagManager:b=f.useGoogleTagManager}=E.useContext(N);if(m===void 0)throw new Error(Z("useLocation"));if(y===void 0)throw new Error(Z("Outlet"));if(b===void 0)throw new Error(Z("useGoogleTagManager"));const{pathname:v}=m(),{sendEvent:l}=b();return E.useEffect(()=>{l({event:"pageView",pathname:v})},[v,l]),I(y,{})},Ve=f=>{const{unknownErrorTranslationKey:m="error.unknownError"}=f||{},{translate:y=f==null?void 0:f.translate}=E.useContext(N);return{printError:E.useCallback(v=>{var R,d,w,h,T,S,O,D,A;const l=y?y(m):"Unknown error",{response:i}=v||{};return v!=null&&v.reason?String(v.reason):(R=i==null?void 0:i.data)!=null&&R.reason?String(i.data.reason):(d=i==null?void 0:i.data)!=null&&d.message?String(i.data.message):(h=(w=i==null?void 0:i.data)==null?void 0:w.detail)!=null&&h.length&&Array.isArray((T=i==null?void 0:i.data)==null?void 0:T.detail)&&((O=(S=i==null?void 0:i.data)==null?void 0:S.detail[0])!=null&&O.msg)&&typeof((A=(D=i==null?void 0:i.data)==null?void 0:D.detail[0])==null?void 0:A.msg)=="string"?String(i.data.detail[0].msg):l},[y,m])}};P.GTMSendPageView=Ne,P.InjectDependenciesContext=N,P.InjectDependenciesProvider=Ye,P.RequireAuth=We,P.useResponseError=Ve,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
|