@tracktor/shared-module 0.16.0 → 0.17.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 +2 -2
- package/dist/hooks/useResponseError/useResponseError.d.ts +1 -0
- package/dist/main.js +235 -229
- package/dist/main.umd.cjs +7 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
# [Versions](https://github.com/Tracktor/shared-module/releases)
|
|
2
2
|
|
|
3
|
-
## v0.
|
|
4
|
-
- **[feat]** :
|
|
3
|
+
## v0.17.0
|
|
4
|
+
- **[feat]** : add `printErrorCode` to hook `useResponseError`
|
|
@@ -29,5 +29,6 @@ export interface useResponseErrorParams {
|
|
|
29
29
|
*/
|
|
30
30
|
export declare const useResponseError: <T = ResponseError>(params?: useResponseErrorParams) => {
|
|
31
31
|
printError: (error?: any) => string;
|
|
32
|
+
printErrorCode: (error?: any) => any;
|
|
32
33
|
};
|
|
33
34
|
export default useResponseError;
|
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Le, { createContext as vr, useMemo as se, useContext as ue, useState as pr, useRef as gr, useLayoutEffect as mr, Suspense as hr, useEffect as Er, useCallback as
|
|
2
|
-
var ie = { exports: {} },
|
|
1
|
+
import Le, { createContext as vr, useMemo as se, useContext as ue, useState as pr, useRef as gr, useLayoutEffect as mr, Suspense as hr, useEffect as Er, useCallback as Y } from "react";
|
|
2
|
+
var ie = { exports: {} }, M = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -12,22 +12,22 @@ var ie = { exports: {} }, W = {};
|
|
|
12
12
|
var $e;
|
|
13
13
|
function yr() {
|
|
14
14
|
if ($e)
|
|
15
|
-
return
|
|
15
|
+
return M;
|
|
16
16
|
$e = 1;
|
|
17
|
-
var n = Le,
|
|
18
|
-
function
|
|
17
|
+
var n = Le, i = Symbol.for("react.element"), s = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, l = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function m(a, c, y) {
|
|
19
19
|
var h, C = {}, O = null, T = null;
|
|
20
20
|
y !== void 0 && (O = "" + y), c.key !== void 0 && (O = "" + c.key), c.ref !== void 0 && (T = c.ref);
|
|
21
21
|
for (h in c)
|
|
22
|
-
|
|
23
|
-
if (
|
|
24
|
-
for (h in c =
|
|
22
|
+
u.call(c, h) && !v.hasOwnProperty(h) && (C[h] = c[h]);
|
|
23
|
+
if (a && a.defaultProps)
|
|
24
|
+
for (h in c = a.defaultProps, c)
|
|
25
25
|
C[h] === void 0 && (C[h] = c[h]);
|
|
26
|
-
return { $$typeof:
|
|
26
|
+
return { $$typeof: i, type: a, key: O, ref: T, props: C, _owner: l.current };
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return M.Fragment = s, M.jsx = m, M.jsxs = m, M;
|
|
29
29
|
}
|
|
30
|
-
var
|
|
30
|
+
var V = {};
|
|
31
31
|
/**
|
|
32
32
|
* @license React
|
|
33
33
|
* react-jsx-runtime.development.js
|
|
@@ -40,8 +40,8 @@ var M = {};
|
|
|
40
40
|
var Ie;
|
|
41
41
|
function Rr() {
|
|
42
42
|
return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var n = Le,
|
|
44
|
-
function
|
|
43
|
+
var n = Le, i = Symbol.for("react.element"), s = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), a = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), A = Symbol.iterator, D = "@@iterator";
|
|
44
|
+
function F(e) {
|
|
45
45
|
if (e === null || typeof e != "object")
|
|
46
46
|
return null;
|
|
47
47
|
var r = A && e[A] || e[D];
|
|
@@ -50,34 +50,34 @@ function Rr() {
|
|
|
50
50
|
var j = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
51
|
function b(e) {
|
|
52
52
|
{
|
|
53
|
-
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0),
|
|
54
|
-
t[
|
|
53
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++)
|
|
54
|
+
t[o - 1] = arguments[o];
|
|
55
55
|
_("error", e, t);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
function _(e, r, t) {
|
|
59
59
|
{
|
|
60
|
-
var
|
|
60
|
+
var o = j.ReactDebugCurrentFrame, p = o.getStackAddendum();
|
|
61
61
|
p !== "" && (r += "%s", t = t.concat([p]));
|
|
62
|
-
var
|
|
62
|
+
var g = t.map(function(d) {
|
|
63
63
|
return String(d);
|
|
64
64
|
});
|
|
65
|
-
|
|
65
|
+
g.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, g);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
var le = !1, ce = !1,
|
|
68
|
+
var le = !1, ce = !1, q = !1, Ne = !1, We = !1, fe;
|
|
69
69
|
fe = Symbol.for("react.module.reference");
|
|
70
70
|
function Me(e) {
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === u || e === v || We || e === l || e === y || e === h || Ne || e === T || le || ce || q || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === C || e.$$typeof === m || e.$$typeof === a || e.$$typeof === c || // This needs to include all possible module reference object
|
|
72
72
|
// types supported by any Flight configuration anywhere since
|
|
73
73
|
// we don't know which Flight build this will end up being used
|
|
74
74
|
// with.
|
|
75
75
|
e.$$typeof === fe || e.getModuleId !== void 0));
|
|
76
76
|
}
|
|
77
77
|
function Ve(e, r, t) {
|
|
78
|
-
var
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
78
|
+
var o = e.displayName;
|
|
79
|
+
if (o)
|
|
80
|
+
return o;
|
|
81
81
|
var p = r.displayName || r.name || "";
|
|
82
82
|
return p !== "" ? t + "(" + p + ")" : t;
|
|
83
83
|
}
|
|
@@ -92,13 +92,13 @@ function Rr() {
|
|
|
92
92
|
if (typeof e == "string")
|
|
93
93
|
return e;
|
|
94
94
|
switch (e) {
|
|
95
|
-
case
|
|
95
|
+
case u:
|
|
96
96
|
return "Fragment";
|
|
97
97
|
case s:
|
|
98
98
|
return "Portal";
|
|
99
99
|
case v:
|
|
100
100
|
return "Profiler";
|
|
101
|
-
case
|
|
101
|
+
case l:
|
|
102
102
|
return "StrictMode";
|
|
103
103
|
case y:
|
|
104
104
|
return "Suspense";
|
|
@@ -107,21 +107,21 @@ function Rr() {
|
|
|
107
107
|
}
|
|
108
108
|
if (typeof e == "object")
|
|
109
109
|
switch (e.$$typeof) {
|
|
110
|
-
case
|
|
110
|
+
case a:
|
|
111
111
|
var r = e;
|
|
112
112
|
return de(r) + ".Consumer";
|
|
113
|
-
case
|
|
113
|
+
case m:
|
|
114
114
|
var t = e;
|
|
115
115
|
return de(t._context) + ".Provider";
|
|
116
116
|
case c:
|
|
117
117
|
return Ve(e, e.render, "ForwardRef");
|
|
118
118
|
case C:
|
|
119
|
-
var
|
|
120
|
-
return
|
|
119
|
+
var o = e.displayName || null;
|
|
120
|
+
return o !== null ? o : P(e.type) || "Memo";
|
|
121
121
|
case O: {
|
|
122
|
-
var p = e,
|
|
122
|
+
var p = e, g = p._payload, d = p._init;
|
|
123
123
|
try {
|
|
124
|
-
return P(d(
|
|
124
|
+
return P(d(g));
|
|
125
125
|
} catch {
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
@@ -129,13 +129,13 @@ function Rr() {
|
|
|
129
129
|
}
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
132
|
-
var
|
|
132
|
+
var $ = Object.assign, N = 0, ve, pe, ge, me, he, Ee, ye;
|
|
133
133
|
function Re() {
|
|
134
134
|
}
|
|
135
135
|
Re.__reactDisabledLog = !0;
|
|
136
136
|
function Ye() {
|
|
137
137
|
{
|
|
138
|
-
if (
|
|
138
|
+
if (N === 0) {
|
|
139
139
|
ve = console.log, pe = console.info, ge = console.warn, me = console.error, he = console.group, Ee = console.groupCollapsed, ye = console.groupEnd;
|
|
140
140
|
var e = {
|
|
141
141
|
configurable: !0,
|
|
@@ -153,77 +153,77 @@ function Rr() {
|
|
|
153
153
|
groupEnd: e
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
N++;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
function qe() {
|
|
160
160
|
{
|
|
161
|
-
if (
|
|
161
|
+
if (N--, N === 0) {
|
|
162
162
|
var e = {
|
|
163
163
|
configurable: !0,
|
|
164
164
|
enumerable: !0,
|
|
165
165
|
writable: !0
|
|
166
166
|
};
|
|
167
167
|
Object.defineProperties(console, {
|
|
168
|
-
log:
|
|
168
|
+
log: $({}, e, {
|
|
169
169
|
value: ve
|
|
170
170
|
}),
|
|
171
|
-
info:
|
|
171
|
+
info: $({}, e, {
|
|
172
172
|
value: pe
|
|
173
173
|
}),
|
|
174
|
-
warn:
|
|
174
|
+
warn: $({}, e, {
|
|
175
175
|
value: ge
|
|
176
176
|
}),
|
|
177
|
-
error:
|
|
177
|
+
error: $({}, e, {
|
|
178
178
|
value: me
|
|
179
179
|
}),
|
|
180
|
-
group:
|
|
180
|
+
group: $({}, e, {
|
|
181
181
|
value: he
|
|
182
182
|
}),
|
|
183
|
-
groupCollapsed:
|
|
183
|
+
groupCollapsed: $({}, e, {
|
|
184
184
|
value: Ee
|
|
185
185
|
}),
|
|
186
|
-
groupEnd:
|
|
186
|
+
groupEnd: $({}, e, {
|
|
187
187
|
value: ye
|
|
188
188
|
})
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
N < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
var K = j.ReactCurrentDispatcher, Z;
|
|
195
|
-
function
|
|
195
|
+
function z(e, r, t) {
|
|
196
196
|
{
|
|
197
197
|
if (Z === void 0)
|
|
198
198
|
try {
|
|
199
199
|
throw Error();
|
|
200
200
|
} catch (p) {
|
|
201
|
-
var
|
|
202
|
-
Z =
|
|
201
|
+
var o = p.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
+
Z = o && o[1] || "";
|
|
203
203
|
}
|
|
204
204
|
return `
|
|
205
205
|
` + Z + e;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
var Q = !1,
|
|
208
|
+
var Q = !1, U;
|
|
209
209
|
{
|
|
210
210
|
var ze = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
-
|
|
211
|
+
U = new ze();
|
|
212
212
|
}
|
|
213
213
|
function be(e, r) {
|
|
214
214
|
if (!e || Q)
|
|
215
215
|
return "";
|
|
216
216
|
{
|
|
217
|
-
var t =
|
|
217
|
+
var t = U.get(e);
|
|
218
218
|
if (t !== void 0)
|
|
219
219
|
return t;
|
|
220
220
|
}
|
|
221
|
-
var
|
|
221
|
+
var o;
|
|
222
222
|
Q = !0;
|
|
223
223
|
var p = Error.prepareStackTrace;
|
|
224
224
|
Error.prepareStackTrace = void 0;
|
|
225
|
-
var
|
|
226
|
-
|
|
225
|
+
var g;
|
|
226
|
+
g = K.current, K.current = null, Ye();
|
|
227
227
|
try {
|
|
228
228
|
if (r) {
|
|
229
229
|
var d = function() {
|
|
@@ -237,14 +237,14 @@ function Rr() {
|
|
|
237
237
|
try {
|
|
238
238
|
Reflect.construct(d, []);
|
|
239
239
|
} catch (x) {
|
|
240
|
-
|
|
240
|
+
o = x;
|
|
241
241
|
}
|
|
242
242
|
Reflect.construct(e, [], d);
|
|
243
243
|
} else {
|
|
244
244
|
try {
|
|
245
245
|
d.call();
|
|
246
246
|
} catch (x) {
|
|
247
|
-
|
|
247
|
+
o = x;
|
|
248
248
|
}
|
|
249
249
|
e.call(d.prototype);
|
|
250
250
|
}
|
|
@@ -252,14 +252,14 @@ function Rr() {
|
|
|
252
252
|
try {
|
|
253
253
|
throw Error();
|
|
254
254
|
} catch (x) {
|
|
255
|
-
|
|
255
|
+
o = x;
|
|
256
256
|
}
|
|
257
257
|
e();
|
|
258
258
|
}
|
|
259
259
|
} catch (x) {
|
|
260
|
-
if (x &&
|
|
260
|
+
if (x && o && typeof x.stack == "string") {
|
|
261
261
|
for (var f = x.stack.split(`
|
|
262
|
-
`), w =
|
|
262
|
+
`), w = o.stack.split(`
|
|
263
263
|
`), E = f.length - 1, R = w.length - 1; E >= 1 && R >= 0 && f[E] !== w[R]; )
|
|
264
264
|
R--;
|
|
265
265
|
for (; E >= 1 && R >= 0; E--, R--)
|
|
@@ -269,17 +269,17 @@ function Rr() {
|
|
|
269
269
|
if (E--, R--, R < 0 || f[E] !== w[R]) {
|
|
270
270
|
var S = `
|
|
271
271
|
` + f[E].replace(" at new ", " at ");
|
|
272
|
-
return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" &&
|
|
272
|
+
return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, S), S;
|
|
273
273
|
}
|
|
274
274
|
while (E >= 1 && R >= 0);
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
} finally {
|
|
279
|
-
Q = !1, K.current =
|
|
279
|
+
Q = !1, K.current = g, qe(), Error.prepareStackTrace = p;
|
|
280
280
|
}
|
|
281
|
-
var
|
|
282
|
-
return typeof e == "function" &&
|
|
281
|
+
var L = e ? e.displayName || e.name : "", Fe = L ? z(L) : "";
|
|
282
|
+
return typeof e == "function" && U.set(e, Fe), Fe;
|
|
283
283
|
}
|
|
284
284
|
function Ue(e, r, t) {
|
|
285
285
|
return be(e, !1);
|
|
@@ -288,59 +288,59 @@ function Rr() {
|
|
|
288
288
|
var r = e.prototype;
|
|
289
289
|
return !!(r && r.isReactComponent);
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function B(e, r, t) {
|
|
292
292
|
if (e == null)
|
|
293
293
|
return "";
|
|
294
294
|
if (typeof e == "function")
|
|
295
295
|
return be(e, Be(e));
|
|
296
296
|
if (typeof e == "string")
|
|
297
|
-
return
|
|
297
|
+
return z(e);
|
|
298
298
|
switch (e) {
|
|
299
299
|
case y:
|
|
300
|
-
return
|
|
300
|
+
return z("Suspense");
|
|
301
301
|
case h:
|
|
302
|
-
return
|
|
302
|
+
return z("SuspenseList");
|
|
303
303
|
}
|
|
304
304
|
if (typeof e == "object")
|
|
305
305
|
switch (e.$$typeof) {
|
|
306
306
|
case c:
|
|
307
307
|
return Ue(e.render);
|
|
308
308
|
case C:
|
|
309
|
-
return
|
|
309
|
+
return B(e.type, r, t);
|
|
310
310
|
case O: {
|
|
311
|
-
var
|
|
311
|
+
var o = e, p = o._payload, g = o._init;
|
|
312
312
|
try {
|
|
313
|
-
return
|
|
313
|
+
return B(g(p), r, t);
|
|
314
314
|
} catch {
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
return "";
|
|
319
319
|
}
|
|
320
|
-
var
|
|
321
|
-
function
|
|
320
|
+
var G = Object.prototype.hasOwnProperty, _e = {}, we = j.ReactDebugCurrentFrame;
|
|
321
|
+
function J(e) {
|
|
322
322
|
if (e) {
|
|
323
|
-
var r = e._owner, t =
|
|
323
|
+
var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
|
|
324
324
|
we.setExtraStackFrame(t);
|
|
325
325
|
} else
|
|
326
326
|
we.setExtraStackFrame(null);
|
|
327
327
|
}
|
|
328
|
-
function Ge(e, r, t,
|
|
328
|
+
function Ge(e, r, t, o, p) {
|
|
329
329
|
{
|
|
330
|
-
var
|
|
330
|
+
var g = Function.call.bind(G);
|
|
331
331
|
for (var d in e)
|
|
332
|
-
if (
|
|
332
|
+
if (g(e, d)) {
|
|
333
333
|
var f = void 0;
|
|
334
334
|
try {
|
|
335
335
|
if (typeof e[d] != "function") {
|
|
336
|
-
var w = Error((
|
|
336
|
+
var w = Error((o || "React class") + ": " + t + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
337
|
throw w.name = "Invariant Violation", w;
|
|
338
338
|
}
|
|
339
|
-
f = e[d](r, d,
|
|
339
|
+
f = e[d](r, d, o, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
340
|
} catch (E) {
|
|
341
341
|
f = E;
|
|
342
342
|
}
|
|
343
|
-
f && !(f instanceof Error) && (
|
|
343
|
+
f && !(f instanceof Error) && (J(p), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", o || "React class", t, d, typeof f), J(null)), f instanceof Error && !(f.message in _e) && (_e[f.message] = !0, J(p), b("Failed %s type: %s", t, f.message), J(null));
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
@@ -368,7 +368,7 @@ function Rr() {
|
|
|
368
368
|
if (He(e))
|
|
369
369
|
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Xe(e)), Ce(e);
|
|
370
370
|
}
|
|
371
|
-
var
|
|
371
|
+
var W = j.ReactCurrentOwner, Ke = {
|
|
372
372
|
key: !0,
|
|
373
373
|
ref: !0,
|
|
374
374
|
__self: !0,
|
|
@@ -376,7 +376,7 @@ function Rr() {
|
|
|
376
376
|
}, Oe, Se, re;
|
|
377
377
|
re = {};
|
|
378
378
|
function Ze(e) {
|
|
379
|
-
if (
|
|
379
|
+
if (G.call(e, "ref")) {
|
|
380
380
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
381
381
|
if (r && r.isReactWarning)
|
|
382
382
|
return !1;
|
|
@@ -384,7 +384,7 @@ function Rr() {
|
|
|
384
384
|
return e.ref !== void 0;
|
|
385
385
|
}
|
|
386
386
|
function Qe(e) {
|
|
387
|
-
if (
|
|
387
|
+
if (G.call(e, "key")) {
|
|
388
388
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
389
389
|
if (r && r.isReactWarning)
|
|
390
390
|
return !1;
|
|
@@ -392,9 +392,9 @@ function Rr() {
|
|
|
392
392
|
return e.key !== void 0;
|
|
393
393
|
}
|
|
394
394
|
function er(e, r) {
|
|
395
|
-
if (typeof e.ref == "string" &&
|
|
396
|
-
var t = P(
|
|
397
|
-
re[t] || (b('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(
|
|
395
|
+
if (typeof e.ref == "string" && W.current && r && W.current.stateNode !== r) {
|
|
396
|
+
var t = P(W.current.type);
|
|
397
|
+
re[t] || (b('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(W.current.type), e.ref), re[t] = !0);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
function rr(e, r) {
|
|
@@ -419,17 +419,17 @@ function Rr() {
|
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
var nr = function(e, r, t,
|
|
422
|
+
var nr = function(e, r, t, o, p, g, d) {
|
|
423
423
|
var f = {
|
|
424
424
|
// This tag allows us to uniquely identify this as a React Element
|
|
425
|
-
$$typeof:
|
|
425
|
+
$$typeof: i,
|
|
426
426
|
// Built-in properties that belong on the element
|
|
427
427
|
type: e,
|
|
428
428
|
key: r,
|
|
429
429
|
ref: t,
|
|
430
430
|
props: d,
|
|
431
431
|
// Record the component responsible for creating this element.
|
|
432
|
-
_owner:
|
|
432
|
+
_owner: g
|
|
433
433
|
};
|
|
434
434
|
return f._store = {}, Object.defineProperty(f._store, "validated", {
|
|
435
435
|
configurable: !1,
|
|
@@ -440,7 +440,7 @@ function Rr() {
|
|
|
440
440
|
configurable: !1,
|
|
441
441
|
enumerable: !1,
|
|
442
442
|
writable: !1,
|
|
443
|
-
value:
|
|
443
|
+
value: o
|
|
444
444
|
}), Object.defineProperty(f, "_source", {
|
|
445
445
|
configurable: !1,
|
|
446
446
|
enumerable: !1,
|
|
@@ -448,28 +448,28 @@ function Rr() {
|
|
|
448
448
|
value: p
|
|
449
449
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
450
450
|
};
|
|
451
|
-
function ar(e, r, t,
|
|
451
|
+
function ar(e, r, t, o, p) {
|
|
452
452
|
{
|
|
453
|
-
var
|
|
453
|
+
var g, d = {}, f = null, w = null;
|
|
454
454
|
t !== void 0 && (Te(t), f = "" + t), Qe(r) && (Te(r.key), f = "" + r.key), Ze(r) && (w = r.ref, er(r, p));
|
|
455
|
-
for (
|
|
456
|
-
|
|
455
|
+
for (g in r)
|
|
456
|
+
G.call(r, g) && !Ke.hasOwnProperty(g) && (d[g] = r[g]);
|
|
457
457
|
if (e && e.defaultProps) {
|
|
458
458
|
var E = e.defaultProps;
|
|
459
|
-
for (
|
|
460
|
-
d[
|
|
459
|
+
for (g in E)
|
|
460
|
+
d[g] === void 0 && (d[g] = E[g]);
|
|
461
461
|
}
|
|
462
462
|
if (f || w) {
|
|
463
463
|
var R = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
464
464
|
f && rr(d, R), w && tr(d, R);
|
|
465
465
|
}
|
|
466
|
-
return nr(e, f, w, p,
|
|
466
|
+
return nr(e, f, w, p, o, W.current, d);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
var te = j.ReactCurrentOwner, je = j.ReactDebugCurrentFrame;
|
|
470
|
-
function
|
|
470
|
+
function I(e) {
|
|
471
471
|
if (e) {
|
|
472
|
-
var r = e._owner, t =
|
|
472
|
+
var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
|
|
473
473
|
je.setExtraStackFrame(t);
|
|
474
474
|
} else
|
|
475
475
|
je.setExtraStackFrame(null);
|
|
@@ -477,7 +477,7 @@ function Rr() {
|
|
|
477
477
|
var ne;
|
|
478
478
|
ne = !1;
|
|
479
479
|
function ae(e) {
|
|
480
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
480
|
+
return typeof e == "object" && e !== null && e.$$typeof === i;
|
|
481
481
|
}
|
|
482
482
|
function Pe() {
|
|
483
483
|
{
|
|
@@ -524,8 +524,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
524
524
|
if (xe[t])
|
|
525
525
|
return;
|
|
526
526
|
xe[t] = !0;
|
|
527
|
-
var
|
|
528
|
-
e && e._owner && e._owner !== te.current && (
|
|
527
|
+
var o = "";
|
|
528
|
+
e && e._owner && e._owner !== te.current && (o = " It was passed a child from " + P(e._owner.type) + "."), I(e), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, o), I(null);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
function Ae(e, r) {
|
|
@@ -534,15 +534,15 @@ Check the top-level render call using <` + t + ">.");
|
|
|
534
534
|
return;
|
|
535
535
|
if (ee(e))
|
|
536
536
|
for (var t = 0; t < e.length; t++) {
|
|
537
|
-
var
|
|
538
|
-
ae(
|
|
537
|
+
var o = e[t];
|
|
538
|
+
ae(o) && ke(o, r);
|
|
539
539
|
}
|
|
540
540
|
else if (ae(e))
|
|
541
541
|
e._store && (e._store.validated = !0);
|
|
542
542
|
else if (e) {
|
|
543
|
-
var p =
|
|
543
|
+
var p = F(e);
|
|
544
544
|
if (typeof p == "function" && p !== e.entries)
|
|
545
|
-
for (var
|
|
545
|
+
for (var g = p.call(e), d; !(d = g.next()).done; )
|
|
546
546
|
ae(d.value) && ke(d.value, r);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
@@ -562,8 +562,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
562
562
|
else
|
|
563
563
|
return;
|
|
564
564
|
if (t) {
|
|
565
|
-
var
|
|
566
|
-
Ge(t, e.props, "prop",
|
|
565
|
+
var o = P(r);
|
|
566
|
+
Ge(t, e.props, "prop", o, e);
|
|
567
567
|
} else if (r.PropTypes !== void 0 && !ne) {
|
|
568
568
|
ne = !0;
|
|
569
569
|
var p = P(r);
|
|
@@ -575,16 +575,16 @@ Check the top-level render call using <` + t + ">.");
|
|
|
575
575
|
function ur(e) {
|
|
576
576
|
{
|
|
577
577
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
578
|
-
var
|
|
579
|
-
if (
|
|
580
|
-
|
|
578
|
+
var o = r[t];
|
|
579
|
+
if (o !== "children" && o !== "key") {
|
|
580
|
+
I(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), I(null);
|
|
581
581
|
break;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
e.ref !== null && (
|
|
584
|
+
e.ref !== null && (I(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), I(null));
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
function De(e, r, t,
|
|
587
|
+
function De(e, r, t, o, p, g) {
|
|
588
588
|
{
|
|
589
589
|
var d = Me(e);
|
|
590
590
|
if (!d) {
|
|
@@ -593,25 +593,25 @@ Check the top-level render call using <` + t + ">.");
|
|
|
593
593
|
var w = or(p);
|
|
594
594
|
w ? f += w : f += Pe();
|
|
595
595
|
var E;
|
|
596
|
-
e === null ? E = "null" : ee(e) ? E = "array" : e !== void 0 && e.$$typeof ===
|
|
596
|
+
e === null ? E = "null" : ee(e) ? E = "array" : e !== void 0 && e.$$typeof === i ? (E = "<" + (P(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : E = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", E, f);
|
|
597
597
|
}
|
|
598
|
-
var R = ar(e, r, t, p,
|
|
598
|
+
var R = ar(e, r, t, p, g);
|
|
599
599
|
if (R == null)
|
|
600
600
|
return R;
|
|
601
601
|
if (d) {
|
|
602
602
|
var S = r.children;
|
|
603
603
|
if (S !== void 0)
|
|
604
|
-
if (
|
|
604
|
+
if (o)
|
|
605
605
|
if (ee(S)) {
|
|
606
|
-
for (var
|
|
607
|
-
Ae(S[
|
|
606
|
+
for (var L = 0; L < S.length; L++)
|
|
607
|
+
Ae(S[L], e);
|
|
608
608
|
Object.freeze && Object.freeze(S);
|
|
609
609
|
} else
|
|
610
610
|
b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
611
611
|
else
|
|
612
612
|
Ae(S, e);
|
|
613
613
|
}
|
|
614
|
-
return e ===
|
|
614
|
+
return e === u ? ur(R) : sr(R), R;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
function lr(e, r, t) {
|
|
@@ -621,8 +621,8 @@ Check the top-level render call using <` + t + ">.");
|
|
|
621
621
|
return De(e, r, t, !1);
|
|
622
622
|
}
|
|
623
623
|
var fr = cr, dr = lr;
|
|
624
|
-
|
|
625
|
-
}()),
|
|
624
|
+
V.Fragment = u, V.jsx = fr, V.jsxs = dr;
|
|
625
|
+
}()), V;
|
|
626
626
|
}
|
|
627
627
|
process.env.NODE_ENV === "production" ? ie.exports = yr() : ie.exports = Rr();
|
|
628
628
|
var k = ie.exports;
|
|
@@ -636,96 +636,96 @@ const H = vr({
|
|
|
636
636
|
useLocation: void 0
|
|
637
637
|
}), Or = ({
|
|
638
638
|
axios: n,
|
|
639
|
-
children:
|
|
639
|
+
children: i,
|
|
640
640
|
translate: s,
|
|
641
|
-
useAuth:
|
|
642
|
-
Outlet:
|
|
641
|
+
useAuth: u,
|
|
642
|
+
Outlet: l,
|
|
643
643
|
Navigate: v,
|
|
644
|
-
useLocation:
|
|
645
|
-
useGoogleTagManager:
|
|
644
|
+
useLocation: m,
|
|
645
|
+
useGoogleTagManager: a
|
|
646
646
|
}) => {
|
|
647
647
|
const c = se(
|
|
648
648
|
() => ({
|
|
649
649
|
axios: n,
|
|
650
650
|
Navigate: v,
|
|
651
|
-
Outlet:
|
|
651
|
+
Outlet: l,
|
|
652
652
|
translate: s,
|
|
653
|
-
useAuth:
|
|
654
|
-
useGoogleTagManager:
|
|
655
|
-
useLocation:
|
|
653
|
+
useAuth: u,
|
|
654
|
+
useGoogleTagManager: a,
|
|
655
|
+
useLocation: m
|
|
656
656
|
}),
|
|
657
|
-
[v,
|
|
657
|
+
[v, l, n, s, u, a, m]
|
|
658
658
|
);
|
|
659
|
-
return /* @__PURE__ */ k.jsx(H.Provider, { value: c, children:
|
|
660
|
-
},
|
|
659
|
+
return /* @__PURE__ */ k.jsx(H.Provider, { value: c, children: i });
|
|
660
|
+
}, X = (n) => `RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Sr = ({
|
|
661
661
|
Fallback: n,
|
|
662
|
-
loginPath:
|
|
662
|
+
loginPath: i = "/login",
|
|
663
663
|
localStorageKey: s = "user",
|
|
664
|
-
redirect401Path:
|
|
665
|
-
...
|
|
664
|
+
redirect401Path: u = "/login",
|
|
665
|
+
...l
|
|
666
666
|
}) => {
|
|
667
|
-
var D,
|
|
667
|
+
var D, F, j, b;
|
|
668
668
|
const {
|
|
669
|
-
axios: v =
|
|
670
|
-
useLocation:
|
|
671
|
-
useAuth:
|
|
672
|
-
Outlet: c =
|
|
673
|
-
Navigate: y =
|
|
669
|
+
axios: v = l.axios,
|
|
670
|
+
useLocation: m = l.useLocation,
|
|
671
|
+
useAuth: a = l.useAuth,
|
|
672
|
+
Outlet: c = l.Outlet,
|
|
673
|
+
Navigate: y = l.Navigate
|
|
674
674
|
} = ue(H);
|
|
675
|
-
if (
|
|
676
|
-
throw new Error(
|
|
677
|
-
if (
|
|
678
|
-
throw new Error(
|
|
675
|
+
if (a === void 0)
|
|
676
|
+
throw new Error(X("useAuth"));
|
|
677
|
+
if (m === void 0)
|
|
678
|
+
throw new Error(X("useLocation"));
|
|
679
679
|
if (c === void 0)
|
|
680
|
-
throw new Error(
|
|
680
|
+
throw new Error(X("Outlet"));
|
|
681
681
|
if (y === void 0)
|
|
682
|
-
throw new Error(
|
|
683
|
-
const [h, C] = pr(null), { isLogged: O } =
|
|
682
|
+
throw new Error(X("Navigate"));
|
|
683
|
+
const [h, C] = pr(null), { isLogged: O } = a(), T = m(), A = gr(!1);
|
|
684
684
|
return mr(() => {
|
|
685
685
|
A.current || (A.current = !0, v == null || v.interceptors.response.use(
|
|
686
686
|
(_) => _,
|
|
687
687
|
async (_) => {
|
|
688
|
-
var
|
|
689
|
-
return typeof _ == "object" && _ && "response" in _ && _.response && typeof _.response == "object" && "status" in _.response && _.response && typeof _.response == "object" && "status" in _.response && ((
|
|
688
|
+
var q;
|
|
689
|
+
return typeof _ == "object" && _ && "response" in _ && _.response && typeof _.response == "object" && "status" in _.response && _.response && typeof _.response == "object" && "status" in _.response && ((q = _ == null ? void 0 : _.response) == null ? void 0 : q.status) === 401 && (v.defaults.headers.common.Authorization = null, localStorage.removeItem(s), C(u)), Promise.reject(_);
|
|
690
690
|
}
|
|
691
691
|
));
|
|
692
|
-
}, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response, s,
|
|
692
|
+
}, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response, s, u]), O && !h ? /* @__PURE__ */ k.jsx(hr, { fallback: n, children: (F = (D = T.state) == null ? void 0 : D.from) != null && F.state && ((b = (j = T.state) == null ? void 0 : j.from) == null ? void 0 : b.pathname) === i ? /* @__PURE__ */ k.jsx(y, { to: T.state.from.state.from.pathname + T.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ k.jsx(c, {}) }) : /* @__PURE__ */ k.jsx(y, { to: i, state: { from: T }, replace: !0 });
|
|
693
693
|
}, oe = (n) => `GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, jr = ({ ...n }) => {
|
|
694
694
|
const {
|
|
695
|
-
useLocation:
|
|
695
|
+
useLocation: i = n.useLocation,
|
|
696
696
|
Outlet: s = n.Outlet,
|
|
697
|
-
useGoogleTagManager:
|
|
697
|
+
useGoogleTagManager: u = n.useGoogleTagManager
|
|
698
698
|
} = ue(H);
|
|
699
|
-
if (
|
|
699
|
+
if (i === void 0)
|
|
700
700
|
throw new Error(oe("useLocation"));
|
|
701
701
|
if (s === void 0)
|
|
702
702
|
throw new Error(oe("Outlet"));
|
|
703
|
-
if (
|
|
703
|
+
if (u === void 0)
|
|
704
704
|
throw new Error(oe("useGoogleTagManager"));
|
|
705
|
-
const { pathname:
|
|
705
|
+
const { pathname: l } = i(), { sendEvent: v } = u();
|
|
706
706
|
return Er(() => {
|
|
707
|
-
v({ event: "pageView", pathname:
|
|
708
|
-
}, [
|
|
707
|
+
v({ event: "pageView", pathname: l });
|
|
708
|
+
}, [l, v]), /* @__PURE__ */ k.jsx(s, {});
|
|
709
709
|
}, Pr = ({
|
|
710
710
|
axios: n,
|
|
711
|
-
baseURL:
|
|
711
|
+
baseURL: i,
|
|
712
712
|
tokenTypeKey: s = "tokenType",
|
|
713
|
-
userLocalStorageKey:
|
|
714
|
-
tokenKey:
|
|
713
|
+
userLocalStorageKey: u = "user",
|
|
714
|
+
tokenKey: l = "accessToken",
|
|
715
715
|
postContentType: v = "application/json"
|
|
716
716
|
}) => {
|
|
717
717
|
if (!n.defaults)
|
|
718
718
|
return null;
|
|
719
|
-
const
|
|
720
|
-
return n.defaults.baseURL =
|
|
719
|
+
const m = localStorage.getItem(u), a = m ? JSON.parse(m) : null, c = a != null && a[s] ? a[s] : null, y = a != null && a[l] ? a[l] : null, h = m ? `${c} ${y}` : null;
|
|
720
|
+
return n.defaults.baseURL = i, n.defaults.headers.post["Content-Type"] = v, h && (n.defaults.headers.common.Authorization = h), null;
|
|
721
721
|
}, xr = ({
|
|
722
722
|
i18n: n,
|
|
723
|
-
debug:
|
|
723
|
+
debug: i,
|
|
724
724
|
initReactI18next: s,
|
|
725
|
-
resources:
|
|
726
|
-
LanguageDetector:
|
|
727
|
-
}) => (n != null && n.isInitialized || (n.use(
|
|
728
|
-
debug:
|
|
725
|
+
resources: u,
|
|
726
|
+
LanguageDetector: l
|
|
727
|
+
}) => (n != null && n.isInitialized || (n.use(l).use(s).init({
|
|
728
|
+
debug: i,
|
|
729
729
|
fallbackLng: "en",
|
|
730
730
|
interpolation: {
|
|
731
731
|
escapeValue: !1
|
|
@@ -735,7 +735,7 @@ const H = vr({
|
|
|
735
735
|
bindI18n: !1,
|
|
736
736
|
useSuspense: !0
|
|
737
737
|
},
|
|
738
|
-
resources:
|
|
738
|
+
resources: u,
|
|
739
739
|
returnNull: !1
|
|
740
740
|
}).then(() => {
|
|
741
741
|
document.documentElement.lang !== n.resolvedLanguage && n.resolvedLanguage && document.documentElement.setAttribute("lang", n.resolvedLanguage);
|
|
@@ -743,135 +743,141 @@ const H = vr({
|
|
|
743
743
|
document.documentElement.setAttribute("lang", v);
|
|
744
744
|
})), null), kr = ({
|
|
745
745
|
dsn: n,
|
|
746
|
-
sentry:
|
|
746
|
+
sentry: i,
|
|
747
747
|
integrations: s,
|
|
748
|
-
tracesSampleRate:
|
|
749
|
-
routingInstrumentationDependencies:
|
|
748
|
+
tracesSampleRate: u,
|
|
749
|
+
routingInstrumentationDependencies: l,
|
|
750
750
|
replaysSessionSampleRate: v,
|
|
751
|
-
replaysOnErrorSampleRate:
|
|
752
|
-
tracePropagationTargets:
|
|
751
|
+
replaysOnErrorSampleRate: m,
|
|
752
|
+
tracePropagationTargets: a,
|
|
753
753
|
ignoreErrors: c,
|
|
754
754
|
debug: y
|
|
755
|
-
}) => (
|
|
755
|
+
}) => (i.isInitialized() || (y || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && i.init({
|
|
756
756
|
debug: y,
|
|
757
757
|
dsn: n,
|
|
758
758
|
ignoreErrors: c || [/Failed to fetch dynamically imported module/],
|
|
759
759
|
integrations: [
|
|
760
|
-
new
|
|
761
|
-
routingInstrumentation:
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
760
|
+
new i.BrowserTracing({
|
|
761
|
+
routingInstrumentation: i.reactRouterV6Instrumentation(
|
|
762
|
+
l.useEffect,
|
|
763
|
+
l.useLocation,
|
|
764
|
+
l.useNavigationType,
|
|
765
|
+
l.createRoutesFromChildren,
|
|
766
|
+
l.matchRoutes
|
|
767
767
|
)
|
|
768
768
|
}),
|
|
769
|
-
|
|
769
|
+
i.replayIntegration(),
|
|
770
770
|
...s || []
|
|
771
771
|
],
|
|
772
|
-
replaysOnErrorSampleRate:
|
|
772
|
+
replaysOnErrorSampleRate: m || 1,
|
|
773
773
|
replaysSessionSampleRate: v || 0.1,
|
|
774
|
-
tracePropagationTargets:
|
|
775
|
-
tracesSampleRate:
|
|
776
|
-
}), null), Ar = ({ IMaskMixin: n, ...
|
|
774
|
+
tracePropagationTargets: a,
|
|
775
|
+
tracesSampleRate: u || 1
|
|
776
|
+
}), null), Ar = ({ IMaskMixin: n, ...i }) => {
|
|
777
777
|
const s = se(
|
|
778
778
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
779
|
-
() => n(({ TextField:
|
|
779
|
+
() => n(({ TextField: u, ...l }) => /* @__PURE__ */ k.jsx(u, { ...l })),
|
|
780
780
|
[n]
|
|
781
781
|
);
|
|
782
|
-
return /* @__PURE__ */ k.jsx(s, { ...
|
|
783
|
-
}, Dr = ({ mapbox: n, accessToken:
|
|
782
|
+
return /* @__PURE__ */ k.jsx(s, { ...i });
|
|
783
|
+
}, Dr = ({ mapbox: n, accessToken: i }) => (n && i && (n.accessToken = i), null), Fr = ({
|
|
784
784
|
children: n,
|
|
785
|
-
defaultOptions:
|
|
785
|
+
defaultOptions: i,
|
|
786
786
|
QueryClient: s,
|
|
787
|
-
QueryClientProvider:
|
|
787
|
+
QueryClientProvider: u
|
|
788
788
|
}) => {
|
|
789
|
-
const
|
|
789
|
+
const l = new s({
|
|
790
790
|
defaultOptions: {
|
|
791
791
|
queries: {
|
|
792
792
|
refetchOnWindowFocus: !1,
|
|
793
793
|
retry: 3,
|
|
794
|
-
...
|
|
794
|
+
...i
|
|
795
795
|
}
|
|
796
796
|
}
|
|
797
797
|
});
|
|
798
|
-
return /* @__PURE__ */ k.jsx(
|
|
798
|
+
return /* @__PURE__ */ k.jsx(u, { client: l, children: n });
|
|
799
799
|
}, $r = (n) => {
|
|
800
|
-
const { unknownErrorTranslationKey:
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
800
|
+
const { unknownErrorTranslationKey: i = "error.unknownError" } = n || {}, { translate: s = n == null ? void 0 : n.translate } = ue(H), u = s ? s(i) : "Unknown error", l = Y(
|
|
801
|
+
(m) => {
|
|
802
|
+
var c, y, h, C, O, T, A, D, F;
|
|
803
|
+
const { response: a } = m || {};
|
|
804
|
+
return a != null && a.reason ? String(m.reason) : (c = a == null ? void 0 : a.data) != null && c.reason ? String(a.data.reason) : (y = a == null ? void 0 : a.data) != null && y.message ? String(a.data.message) : (C = (h = a == null ? void 0 : a.data) == null ? void 0 : h.detail) != null && C.length && Array.isArray((O = a == null ? void 0 : a.data) == null ? void 0 : O.detail) && ((A = (T = a == null ? void 0 : a.data) == null ? void 0 : T.detail[0]) != null && A.msg) && typeof ((F = (D = a == null ? void 0 : a.data) == null ? void 0 : D.detail[0]) == null ? void 0 : F.msg) == "string" ? String(a.data.detail[0].msg) : u;
|
|
805
|
+
},
|
|
806
|
+
[u]
|
|
807
|
+
), v = Y(
|
|
808
|
+
(m) => {
|
|
809
|
+
const { response: a } = m || {}, { error_code: c } = a || {};
|
|
810
|
+
return c && s ? s(c) : c || u;
|
|
806
811
|
},
|
|
807
|
-
[
|
|
808
|
-
)
|
|
812
|
+
[u, s]
|
|
813
|
+
);
|
|
814
|
+
return { printError: l, printErrorCode: v };
|
|
809
815
|
}, Ir = ({
|
|
810
816
|
data: n,
|
|
811
|
-
fetchNextPage:
|
|
817
|
+
fetchNextPage: i,
|
|
812
818
|
isFetchingNextPage: s,
|
|
813
|
-
isInitialLoading:
|
|
814
|
-
isLoading:
|
|
819
|
+
isInitialLoading: u,
|
|
820
|
+
isLoading: l,
|
|
815
821
|
enabled: v = !0
|
|
816
822
|
}) => {
|
|
817
|
-
const
|
|
823
|
+
const m = Y(
|
|
818
824
|
async (c) => {
|
|
819
|
-
s || !v || await
|
|
825
|
+
s || !v || await i({ pageParam: (c == null ? void 0 : c.pageParam) || c.visibleRowsCount });
|
|
820
826
|
},
|
|
821
|
-
[v,
|
|
822
|
-
),
|
|
827
|
+
[v, i, s]
|
|
828
|
+
), a = se(() => {
|
|
823
829
|
if (n)
|
|
824
830
|
return n.pages.reduce((c, y) => [...c, ...y], []);
|
|
825
831
|
}, [n]);
|
|
826
832
|
return {
|
|
827
|
-
fetchNextPageOnRowsScrollEnd:
|
|
828
|
-
isLoading: s ||
|
|
829
|
-
loadingVariant:
|
|
830
|
-
rows:
|
|
833
|
+
fetchNextPageOnRowsScrollEnd: m,
|
|
834
|
+
isLoading: s || l,
|
|
835
|
+
loadingVariant: u ? "skeleton" : "linear",
|
|
836
|
+
rows: a
|
|
831
837
|
};
|
|
832
838
|
}, Lr = (n) => {
|
|
833
|
-
const
|
|
834
|
-
({ tokenType:
|
|
835
|
-
n.defaults.headers.common.Authorization = `${
|
|
839
|
+
const i = Y(
|
|
840
|
+
({ tokenType: u, accessToken: l }) => {
|
|
841
|
+
n.defaults.headers.common.Authorization = `${u} ${l}`;
|
|
836
842
|
},
|
|
837
843
|
[n.defaults.headers.common]
|
|
838
844
|
);
|
|
839
845
|
return {
|
|
840
|
-
clearAuthenticationToken:
|
|
846
|
+
clearAuthenticationToken: Y(() => {
|
|
841
847
|
n.defaults.headers.common.Authorization = null;
|
|
842
848
|
}, [n.defaults.headers.common]),
|
|
843
|
-
setAuthenticationToken:
|
|
849
|
+
setAuthenticationToken: i
|
|
844
850
|
};
|
|
845
851
|
}, br = (n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase(), _r = (n) => {
|
|
846
|
-
const
|
|
847
|
-
return
|
|
848
|
-
}, wr = (n,
|
|
849
|
-
const
|
|
850
|
-
return `${
|
|
852
|
+
const u = n.split("/").filter((l) => l.length > 0).map((l) => l.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((c) => c.charAt(0).toUpperCase() + c.slice(1)).join("")).join("");
|
|
853
|
+
return u.charAt(0).toLowerCase() + u.slice(1);
|
|
854
|
+
}, wr = (n, i, s) => {
|
|
855
|
+
const u = _r(i), l = br(s);
|
|
856
|
+
return `${u}${l}`;
|
|
851
857
|
}, Cr = (n) => {
|
|
852
858
|
if (n)
|
|
853
|
-
return (n == null ? void 0 : n.reduce((
|
|
859
|
+
return (n == null ? void 0 : n.reduce((i, s) => (i[s] = {
|
|
854
860
|
query: {
|
|
855
861
|
useInfinite: !0,
|
|
856
862
|
useInfiniteQueryParam: "offset"
|
|
857
863
|
}
|
|
858
|
-
},
|
|
864
|
+
}, i), {})) || {};
|
|
859
865
|
}, Nr = (n) => {
|
|
860
|
-
const { input:
|
|
866
|
+
const { input: i = "./openapi.json", operationsToGenerateInfiniteQueryHook: s = void 0 } = n || {};
|
|
861
867
|
return {
|
|
862
868
|
api: {
|
|
863
869
|
hooks: {
|
|
864
870
|
afterAllFilesWrite: "prettier src/api/ --write"
|
|
865
871
|
},
|
|
866
|
-
input:
|
|
872
|
+
input: i,
|
|
867
873
|
output: {
|
|
868
874
|
client: "react-query",
|
|
869
875
|
mode: "tags-split",
|
|
870
876
|
override: {
|
|
871
|
-
header: (
|
|
877
|
+
header: (u) => [
|
|
872
878
|
"Generated by orval 🍺",
|
|
873
|
-
...
|
|
874
|
-
...
|
|
879
|
+
...u.title ? [u.title] : [],
|
|
880
|
+
...u.description ? [u.description] : []
|
|
875
881
|
],
|
|
876
882
|
mutator: {
|
|
877
883
|
name: "axiosCustomInstance",
|
package/dist/main.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(R,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(R=typeof globalThis<"u"?globalThis:R||self,h(R["@tracktor/shared-module"]={},R.React))})(this,function(R,h){"use strict";var $={exports:{}},
|
|
1
|
+
(function(R,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(R=typeof globalThis<"u"?globalThis:R||self,h(R["@tracktor/shared-module"]={},R.React))})(this,function(R,h){"use strict";var $={exports:{}},V={};/**
|
|
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 ue;function Le(){if(ue)return
|
|
9
|
+
*/var ue;function Le(){if(ue)return V;ue=1;var n=h,i=Symbol.for("react.element"),s=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function m(a,c,b){var E,O={},j=null,S=null;b!==void 0&&(j=""+b),c.key!==void 0&&(j=""+c.key),c.ref!==void 0&&(S=c.ref);for(E in c)u.call(c,E)&&!v.hasOwnProperty(E)&&(O[E]=c[E]);if(a&&a.defaultProps)for(E in c=a.defaultProps,c)O[E]===void 0&&(O[E]=c[E]);return{$$typeof:i,type:a,key:j,ref:S,props:O,_owner:l.current}}return V.Fragment=s,V.jsx=m,V.jsxs=m,V}var Y={};/**
|
|
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 le;function Me(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var n=h,
|
|
18
|
-
`+re+e}}var te=!1,H;{var sr=typeof WeakMap=="function"?WeakMap:Map;H=new sr}function _e(e,r){if(!e||te)return"";{var t=H.get(e);if(t!==void 0)return t}var
|
|
19
|
-
`),T=
|
|
17
|
+
*/var le;function Me(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var n=h,i=Symbol.for("react.element"),s=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),F=Symbol.iterator,I="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[I];return typeof r=="function"?r:null}var A=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];w("error",e,t)}}function w(e,r,t){{var o=A.ReactDebugCurrentFrame,p=o.getStackAddendum();p!==""&&(r+="%s",t=t.concat([p]));var g=t.map(function(d){return String(d)});g.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,g)}}var ce=!1,fe=!1,J=!1,rr=!1,tr=!1,de;de=Symbol.for("react.module.reference");function nr(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===v||tr||e===l||e===b||e===E||rr||e===S||ce||fe||J||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===O||e.$$typeof===m||e.$$typeof===a||e.$$typeof===c||e.$$typeof===de||e.getModuleId!==void 0))}function ar(e,r,t){var o=e.displayName;if(o)return o;var p=r.displayName||r.name||"";return p!==""?t+"("+p+")":t}function ve(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&C("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 u:return"Fragment";case s:return"Portal";case v:return"Profiler";case l:return"StrictMode";case b:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case a:var r=e;return ve(r)+".Consumer";case m:var t=e;return ve(t._context)+".Provider";case c:return ar(e,e.render,"ForwardRef");case O:var o=e.displayName||null;return o!==null?o:x(e.type)||"Memo";case j:{var p=e,g=p._payload,d=p._init;try{return x(d(g))}catch{return null}}}return null}var M=Object.assign,U=0,pe,ge,me,he,Ee,ye,Re;function be(){}be.__reactDisabledLog=!0;function or(){{if(U===0){pe=console.log,ge=console.info,me=console.warn,he=console.error,Ee=console.group,ye=console.groupCollapsed,Re=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})}U++}}function ir(){{if(U--,U===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:pe}),info:M({},e,{value:ge}),warn:M({},e,{value:me}),error:M({},e,{value:he}),group:M({},e,{value:Ee}),groupCollapsed:M({},e,{value:ye}),groupEnd:M({},e,{value:Re})})}U<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=A.ReactCurrentDispatcher,re;function X(e,r,t){{if(re===void 0)try{throw Error()}catch(p){var o=p.stack.trim().match(/\n( *(at )?)/);re=o&&o[1]||""}return`
|
|
18
|
+
`+re+e}}var te=!1,H;{var sr=typeof WeakMap=="function"?WeakMap:Map;H=new sr}function _e(e,r){if(!e||te)return"";{var t=H.get(e);if(t!==void 0)return t}var o;te=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=ee.current,ee.current=null,or();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(D){o=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){o=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){o=D}e()}}catch(D){if(D&&o&&typeof D.stack=="string"){for(var f=D.stack.split(`
|
|
19
|
+
`),T=o.stack.split(`
|
|
20
20
|
`),y=f.length-1,_=T.length-1;y>=1&&_>=0&&f[y]!==T[_];)_--;for(;y>=1&&_>=0;y--,_--)if(f[y]!==T[_]){if(y!==1||_!==1)do if(y--,_--,_<0||f[y]!==T[_]){var P=`
|
|
21
|
-
`+f[y].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,P),P}while(y>=1&&_>=0);break}}}finally{te=!1,ee.current=
|
|
21
|
+
`+f[y].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,P),P}while(y>=1&&_>=0);break}}}finally{te=!1,ee.current=g,ir(),Error.prepareStackTrace=p}var W=e?e.displayName||e.name:"",Ie=W?X(W):"";return typeof e=="function"&&H.set(e,Ie),Ie}function ur(e,r,t){return _e(e,!1)}function lr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,t){if(e==null)return"";if(typeof e=="function")return _e(e,lr(e));if(typeof e=="string")return X(e);switch(e){case b:return X("Suspense");case E:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return ur(e.render);case O:return K(e.type,r,t);case j:{var o=e,p=o._payload,g=o._init;try{return K(g(p),r,t)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,Ce={},we=A.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}function cr(e,r,t,o,p){{var g=Function.call.bind(Z);for(var d in e)if(g(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((o||"React class")+": "+t+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}f=e[d](r,d,o,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(y){f=y}f&&!(f instanceof Error)&&(q(p),C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",t,d,typeof f),q(null)),f instanceof Error&&!(f.message in Ce)&&(Ce[f.message]=!0,q(p),C("Failed %s type: %s",t,f.message),q(null))}}}var fr=Array.isArray;function ne(e){return fr(e)}function dr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function vr(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function Oe(e){if(vr(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dr(e)),Te(e)}var B=A.ReactCurrentOwner,pr={key:!0,ref:!0,__self:!0,__source:!0},Se,je,ae;ae={};function gr(e){if(Z.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function mr(e){if(Z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function hr(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var t=x(B.current.type);ae[t]||(C('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(B.current.type),e.ref),ae[t]=!0)}}function Er(e,r){{var t=function(){Se||(Se=!0,C("%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 yr(e,r){{var t=function(){je||(je=!0,C("%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 Rr=function(e,r,t,o,p,g,d){var f={$$typeof:i,type:e,key:r,ref:t,props:d,_owner:g};return f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(f,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function br(e,r,t,o,p){{var g,d={},f=null,T=null;t!==void 0&&(Oe(t),f=""+t),mr(r)&&(Oe(r.key),f=""+r.key),gr(r)&&(T=r.ref,hr(r,p));for(g in r)Z.call(r,g)&&!pr.hasOwnProperty(g)&&(d[g]=r[g]);if(e&&e.defaultProps){var y=e.defaultProps;for(g in y)d[g]===void 0&&(d[g]=y[g])}if(f||T){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Er(d,_),T&&yr(d,_)}return Rr(e,f,T,p,o,B.current,d)}}var oe=A.ReactCurrentOwner,Pe=A.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var ie;ie=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===i}function ke(){{if(oe.current){var e=x(oe.current.type);if(e)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+e+"`."}return""}}function _r(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
24
|
|
|
25
25
|
Check your code at `+r+":"+t+"."}return""}}var Ae={};function Cr(e){{var r=ke();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 xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Cr(r);if(Ae[t])return;Ae[t]=!0;var i="";e&&e._owner&&e._owner!==oe.current&&(i=" It was passed a child from "+x(e._owner.type)+"."),M(e),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,i),M(null)}}function De(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var i=e[t];se(i)&&xe(i,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var p=G(e);if(typeof p=="function"&&p!==e.entries)for(var m=p.call(e),d;!(d=m.next()).done;)se(d.value)&&xe(d.value,r)}}}function wr(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===c||r.$$typeof===O))t=r.propTypes;else return;if(t){var i=x(r);cr(t,e.props,"prop",i,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var p=x(r);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var i=r[t];if(i!=="children"&&i!=="key"){M(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),M(null);break}}e.ref!==null&&(M(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function Fe(e,r,t,i,p,m){{var d=nr(e);if(!d){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" 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 T=_r(p);T?f+=T:f+=ke();var y;e===null?y="null":ne(e)?y="array":e!==void 0&&e.$$typeof===o?(y="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):y=typeof e,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",y,f)}var _=br(e,r,t,p,m);if(_==null)return _;if(d){var P=r.children;if(P!==void 0)if(i)if(ne(P)){for(var N=0;N<P.length;N++)De(P[N],e);Object.freeze&&Object.freeze(P)}else C("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(P,e)}return e===l?Tr(_):wr(_),_}}function Or(e,r,t){return Fe(e,r,t,!0)}function Sr(e,r,t){return Fe(e,r,t,!1)}var jr=Sr,Pr=Or;V.Fragment=l,V.jsx=jr,V.jsxs=Pr}()),V}process.env.NODE_ENV==="production"?$.exports=Le():$.exports=Me();var k=$.exports;const Y=h.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ne=({axios:n,children:o,translate:s,useAuth:l,Outlet:a,Navigate:v,useLocation:u,useGoogleTagManager:g})=>{const c=h.useMemo(()=>({axios:n,Navigate:v,Outlet:a,translate:s,useAuth:l,useGoogleTagManager:g,useLocation:u}),[v,a,n,s,l,g,u]);return k.jsx(Y.Provider,{value:c,children:o})},B=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:o="/login",localStorageKey:s="user",redirect401Path:l="/login",...a})=>{var I,G,A,C;const{axios:v=a.axios,useLocation:u=a.useLocation,useAuth:g=a.useAuth,Outlet:c=a.Outlet,Navigate:b=a.Navigate}=h.useContext(Y);if(g===void 0)throw new Error(B("useAuth"));if(u===void 0)throw new Error(B("useLocation"));if(c===void 0)throw new Error(B("Outlet"));if(b===void 0)throw new Error(B("Navigate"));const[E,O]=h.useState(null),{isLogged:j}=g(),S=u(),F=h.useRef(!1);return h.useLayoutEffect(()=>{F.current||(F.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var J;return typeof w=="object"&&w&&"response"in w&&w.response&&typeof w.response=="object"&&"status"in w.response&&w.response&&typeof w.response=="object"&&"status"in w.response&&((J=w==null?void 0:w.response)==null?void 0:J.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(s),O(l)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,s,l]),j&&!E?k.jsx(h.Suspense,{fallback:n,children:(G=(I=S.state)==null?void 0:I.from)!=null&&G.state&&((C=(A=S.state)==null?void 0:A.from)==null?void 0:C.pathname)===o?k.jsx(b,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(c,{})}):k.jsx(b,{to:o,state:{from:S},replace:!0})},Q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ve=({...n})=>{const{useLocation:o=n.useLocation,Outlet:s=n.Outlet,useGoogleTagManager:l=n.useGoogleTagManager}=h.useContext(Y);if(o===void 0)throw new Error(Q("useLocation"));if(s===void 0)throw new Error(Q("Outlet"));if(l===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:a}=o(),{sendEvent:v}=l();return h.useEffect(()=>{v({event:"pageView",pathname:a})},[a,v]),k.jsx(s,{})},Ye=({axios:n,baseURL:o,tokenTypeKey:s="tokenType",userLocalStorageKey:l="user",tokenKey:a="accessToken",postContentType:v="application/json"})=>{if(!n.defaults)return null;const u=localStorage.getItem(l),g=u?JSON.parse(u):null,c=g!=null&&g[s]?g[s]:null,b=g!=null&&g[a]?g[a]:null,E=u?`${c} ${b}`:null;return n.defaults.baseURL=o,n.defaults.headers.post["Content-Type"]=v,E&&(n.defaults.headers.common.Authorization=E),null},ze=({i18n:n,debug:o,initReactI18next:s,resources:l,LanguageDetector:a})=>(n!=null&&n.isInitialized||(n.use(a).use(s).init({debug:o,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:l,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ue=({dsn:n,sentry:o,integrations:s,tracesSampleRate:l,routingInstrumentationDependencies:a,replaysSessionSampleRate:v,replaysOnErrorSampleRate:u,tracePropagationTargets:g,ignoreErrors:c,debug:b})=>(o.isInitialized()||(b||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&o.init({debug:b,dsn:n,ignoreErrors:c||[/Failed to fetch dynamically imported module/],integrations:[new o.BrowserTracing({routingInstrumentation:o.reactRouterV6Instrumentation(a.useEffect,a.useLocation,a.useNavigationType,a.createRoutesFromChildren,a.matchRoutes)}),o.replayIntegration(),...s||[]],replaysOnErrorSampleRate:u||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:g,tracesSampleRate:l||1}),null),Be=({IMaskMixin:n,...o})=>{const s=h.useMemo(()=>n(({TextField:l,...a})=>k.jsx(l,{...a})),[n]);return k.jsx(s,{...o})},Ge=({mapbox:n,accessToken:o})=>(n&&o&&(n.accessToken=o),null),Je=({children:n,defaultOptions:o,QueryClient:s,QueryClientProvider:l})=>{const a=new s({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...o}}});return k.jsx(l,{client:a,children:n})},Xe=n=>{const{unknownErrorTranslationKey:o="error.unknownError"}=n||{},{translate:s=n==null?void 0:n.translate}=h.useContext(Y);return{printError:h.useCallback(a=>{var g,c,b,E,O,j,S,F,I;const v=s?s(o):"Unknown error",{response:u}=a||{};return a!=null&&a.reason?String(a.reason):(g=u==null?void 0:u.data)!=null&&g.reason?String(u.data.reason):(c=u==null?void 0:u.data)!=null&&c.message?String(u.data.message):(E=(b=u==null?void 0:u.data)==null?void 0:b.detail)!=null&&E.length&&Array.isArray((O=u==null?void 0:u.data)==null?void 0:O.detail)&&((S=(j=u==null?void 0:u.data)==null?void 0:j.detail[0])!=null&&S.msg)&&typeof((I=(F=u==null?void 0:u.data)==null?void 0:F.detail[0])==null?void 0:I.msg)=="string"?String(u.data.detail[0].msg):v},[s,o])}},He=({data:n,fetchNextPage:o,isFetchingNextPage:s,isInitialLoading:l,isLoading:a,enabled:v=!0})=>{const u=h.useCallback(async c=>{s||!v||await o({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[v,o,s]),g=h.useMemo(()=>{if(n)return n.pages.reduce((c,b)=>[...c,...b],[])},[n]);return{fetchNextPageOnRowsScrollEnd:u,isLoading:s||a,loadingVariant:l?"skeleton":"linear",rows:g}},Ke=n=>{const o=h.useCallback(({tokenType:l,accessToken:a})=>{n.defaults.headers.common.Authorization=`${l} ${a}`},[n.defaults.headers.common]);return{clearAuthenticationToken:h.useCallback(()=>{n.defaults.headers.common.Authorization=null},[n.defaults.headers.common]),setAuthenticationToken:o}},qe=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),Ze=n=>{const l=n.split("/").filter(a=>a.length>0).map(a=>a.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return l.charAt(0).toLowerCase()+l.slice(1)},$e=(n,o,s)=>{const l=Ze(o),a=qe(s);return`${l}${a}`},Qe=n=>{if(n)return(n==null?void 0:n.reduce((o,s)=>(o[s]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},o),{}))||{}},er=n=>{const{input:o="./openapi.json",operationsToGenerateInfiniteQueryHook:s=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:o,output:{client:"react-query",mode:"tags-split",override:{header:l=>["Generated by orval 🍺",...l.title?[l.title]:[],...l.description?[l.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:$e,...(s==null?void 0:s.length)&&{operations:Qe(s)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};R.AxiosConfig=Ye,R.GTMSendPageView=Ve,R.I18nConfig=ze,R.InjectDependenciesContext=Y,R.InjectDependenciesProvider=Ne,R.MapBoxConfig=Ge,R.MaskTextField=Be,R.QueryClientConfigProvider=Je,R.RequireAuth=We,R.SentryConfig=Ue,R.getOrvalConfig=er,R.useAuth=Ke,R.useInfiniteDataGrid=He,R.useResponseError=Xe,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Cr(r);if(Ae[t])return;Ae[t]=!0;var o="";e&&e._owner&&e._owner!==oe.current&&(o=" It was passed a child from "+x(e._owner.type)+"."),N(e),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,o),N(null)}}function De(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var o=e[t];se(o)&&xe(o,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var p=L(e);if(typeof p=="function"&&p!==e.entries)for(var g=p.call(e),d;!(d=g.next()).done;)se(d.value)&&xe(d.value,r)}}}function wr(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===c||r.$$typeof===O))t=r.propTypes;else return;if(t){var o=x(r);cr(t,e.props,"prop",o,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var p=x(r);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var o=r[t];if(o!=="children"&&o!=="key"){N(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),N(null);break}}e.ref!==null&&(N(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),N(null))}}function Fe(e,r,t,o,p,g){{var d=nr(e);if(!d){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" 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 T=_r(p);T?f+=T:f+=ke();var y;e===null?y="null":ne(e)?y="array":e!==void 0&&e.$$typeof===i?(y="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):y=typeof e,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",y,f)}var _=br(e,r,t,p,g);if(_==null)return _;if(d){var P=r.children;if(P!==void 0)if(o)if(ne(P)){for(var W=0;W<P.length;W++)De(P[W],e);Object.freeze&&Object.freeze(P)}else C("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(P,e)}return e===u?Tr(_):wr(_),_}}function Or(e,r,t){return Fe(e,r,t,!0)}function Sr(e,r,t){return Fe(e,r,t,!1)}var jr=Sr,Pr=Or;Y.Fragment=u,Y.jsx=jr,Y.jsxs=Pr}()),Y}process.env.NODE_ENV==="production"?$.exports=Le():$.exports=Me();var k=$.exports;const z=h.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ne=({axios:n,children:i,translate:s,useAuth:u,Outlet:l,Navigate:v,useLocation:m,useGoogleTagManager:a})=>{const c=h.useMemo(()=>({axios:n,Navigate:v,Outlet:l,translate:s,useAuth:u,useGoogleTagManager:a,useLocation:m}),[v,l,n,s,u,a,m]);return k.jsx(z.Provider,{value:c,children:i})},G=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:i="/login",localStorageKey:s="user",redirect401Path:u="/login",...l})=>{var I,L,A,C;const{axios:v=l.axios,useLocation:m=l.useLocation,useAuth:a=l.useAuth,Outlet:c=l.Outlet,Navigate:b=l.Navigate}=h.useContext(z);if(a===void 0)throw new Error(G("useAuth"));if(m===void 0)throw new Error(G("useLocation"));if(c===void 0)throw new Error(G("Outlet"));if(b===void 0)throw new Error(G("Navigate"));const[E,O]=h.useState(null),{isLogged:j}=a(),S=m(),F=h.useRef(!1);return h.useLayoutEffect(()=>{F.current||(F.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var J;return typeof w=="object"&&w&&"response"in w&&w.response&&typeof w.response=="object"&&"status"in w.response&&w.response&&typeof w.response=="object"&&"status"in w.response&&((J=w==null?void 0:w.response)==null?void 0:J.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(s),O(u)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,s,u]),j&&!E?k.jsx(h.Suspense,{fallback:n,children:(L=(I=S.state)==null?void 0:I.from)!=null&&L.state&&((C=(A=S.state)==null?void 0:A.from)==null?void 0:C.pathname)===i?k.jsx(b,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(c,{})}):k.jsx(b,{to:i,state:{from:S},replace:!0})},Q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ve=({...n})=>{const{useLocation:i=n.useLocation,Outlet:s=n.Outlet,useGoogleTagManager:u=n.useGoogleTagManager}=h.useContext(z);if(i===void 0)throw new Error(Q("useLocation"));if(s===void 0)throw new Error(Q("Outlet"));if(u===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:l}=i(),{sendEvent:v}=u();return h.useEffect(()=>{v({event:"pageView",pathname:l})},[l,v]),k.jsx(s,{})},Ye=({axios:n,baseURL:i,tokenTypeKey:s="tokenType",userLocalStorageKey:u="user",tokenKey:l="accessToken",postContentType:v="application/json"})=>{if(!n.defaults)return null;const m=localStorage.getItem(u),a=m?JSON.parse(m):null,c=a!=null&&a[s]?a[s]:null,b=a!=null&&a[l]?a[l]:null,E=m?`${c} ${b}`:null;return n.defaults.baseURL=i,n.defaults.headers.post["Content-Type"]=v,E&&(n.defaults.headers.common.Authorization=E),null},ze=({i18n:n,debug:i,initReactI18next:s,resources:u,LanguageDetector:l})=>(n!=null&&n.isInitialized||(n.use(l).use(s).init({debug:i,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:u,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ue=({dsn:n,sentry:i,integrations:s,tracesSampleRate:u,routingInstrumentationDependencies:l,replaysSessionSampleRate:v,replaysOnErrorSampleRate:m,tracePropagationTargets:a,ignoreErrors:c,debug:b})=>(i.isInitialized()||(b||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&i.init({debug:b,dsn:n,ignoreErrors:c||[/Failed to fetch dynamically imported module/],integrations:[new i.BrowserTracing({routingInstrumentation:i.reactRouterV6Instrumentation(l.useEffect,l.useLocation,l.useNavigationType,l.createRoutesFromChildren,l.matchRoutes)}),i.replayIntegration(),...s||[]],replaysOnErrorSampleRate:m||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:a,tracesSampleRate:u||1}),null),Be=({IMaskMixin:n,...i})=>{const s=h.useMemo(()=>n(({TextField:u,...l})=>k.jsx(u,{...l})),[n]);return k.jsx(s,{...i})},Ge=({mapbox:n,accessToken:i})=>(n&&i&&(n.accessToken=i),null),Je=({children:n,defaultOptions:i,QueryClient:s,QueryClientProvider:u})=>{const l=new s({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...i}}});return k.jsx(u,{client:l,children:n})},Xe=n=>{const{unknownErrorTranslationKey:i="error.unknownError"}=n||{},{translate:s=n==null?void 0:n.translate}=h.useContext(z),u=s?s(i):"Unknown error",l=h.useCallback(m=>{var c,b,E,O,j,S,F,I,L;const{response:a}=m||{};return a!=null&&a.reason?String(m.reason):(c=a==null?void 0:a.data)!=null&&c.reason?String(a.data.reason):(b=a==null?void 0:a.data)!=null&&b.message?String(a.data.message):(O=(E=a==null?void 0:a.data)==null?void 0:E.detail)!=null&&O.length&&Array.isArray((j=a==null?void 0:a.data)==null?void 0:j.detail)&&((F=(S=a==null?void 0:a.data)==null?void 0:S.detail[0])!=null&&F.msg)&&typeof((L=(I=a==null?void 0:a.data)==null?void 0:I.detail[0])==null?void 0:L.msg)=="string"?String(a.data.detail[0].msg):u},[u]),v=h.useCallback(m=>{const{response:a}=m||{},{error_code:c}=a||{};return c&&s?s(c):c||u},[u,s]);return{printError:l,printErrorCode:v}},He=({data:n,fetchNextPage:i,isFetchingNextPage:s,isInitialLoading:u,isLoading:l,enabled:v=!0})=>{const m=h.useCallback(async c=>{s||!v||await i({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[v,i,s]),a=h.useMemo(()=>{if(n)return n.pages.reduce((c,b)=>[...c,...b],[])},[n]);return{fetchNextPageOnRowsScrollEnd:m,isLoading:s||l,loadingVariant:u?"skeleton":"linear",rows:a}},Ke=n=>{const i=h.useCallback(({tokenType:u,accessToken:l})=>{n.defaults.headers.common.Authorization=`${u} ${l}`},[n.defaults.headers.common]);return{clearAuthenticationToken:h.useCallback(()=>{n.defaults.headers.common.Authorization=null},[n.defaults.headers.common]),setAuthenticationToken:i}},Ze=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),qe=n=>{const u=n.split("/").filter(l=>l.length>0).map(l=>l.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return u.charAt(0).toLowerCase()+u.slice(1)},$e=(n,i,s)=>{const u=qe(i),l=Ze(s);return`${u}${l}`},Qe=n=>{if(n)return(n==null?void 0:n.reduce((i,s)=>(i[s]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},i),{}))||{}},er=n=>{const{input:i="./openapi.json",operationsToGenerateInfiniteQueryHook:s=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:i,output:{client:"react-query",mode:"tags-split",override:{header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:$e,...(s==null?void 0:s.length)&&{operations:Qe(s)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};R.AxiosConfig=Ye,R.GTMSendPageView=Ve,R.I18nConfig=ze,R.InjectDependenciesContext=z,R.InjectDependenciesProvider=Ne,R.MapBoxConfig=Ge,R.MaskTextField=Be,R.QueryClientConfigProvider=Je,R.RequireAuth=We,R.SentryConfig=Ue,R.getOrvalConfig=er,R.useAuth=Ke,R.useInfiniteDataGrid=He,R.useResponseError=Xe,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|