@tracktor/shared-module 0.17.0 → 0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/dist/hooks/useResponseError/useResponseError.d.ts +1 -1
- package/dist/main.js +268 -267
- package/dist/main.umd.cjs +10 -10
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -29,6 +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) =>
|
|
32
|
+
printErrorCode: (error?: any) => string;
|
|
33
33
|
};
|
|
34
34
|
export default useResponseError;
|
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Le, { createContext as vr, useMemo as
|
|
1
|
+
import Le, { createContext as vr, useMemo as ue, useContext as se, useState as pr, useRef as gr, useLayoutEffect as mr, Suspense as hr, useEffect as Er, useCallback as Y } from "react";
|
|
2
2
|
var ie = { exports: {} }, M = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -14,18 +14,18 @@ function yr() {
|
|
|
14
14
|
if ($e)
|
|
15
15
|
return M;
|
|
16
16
|
$e = 1;
|
|
17
|
-
var
|
|
18
|
-
function m(
|
|
17
|
+
var a = Le, u = Symbol.for("react.element"), o = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, l = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function m(t, c, E) {
|
|
19
19
|
var h, C = {}, O = null, T = null;
|
|
20
|
-
|
|
20
|
+
E !== void 0 && (O = "" + E), 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
|
+
s.call(c, h) && !v.hasOwnProperty(h) && (C[h] = c[h]);
|
|
23
|
+
if (t && t.defaultProps)
|
|
24
|
+
for (h in c = t.defaultProps, c)
|
|
25
25
|
C[h] === void 0 && (C[h] = c[h]);
|
|
26
|
-
return { $$typeof:
|
|
26
|
+
return { $$typeof: u, type: t, key: O, ref: T, props: C, _owner: l.current };
|
|
27
27
|
}
|
|
28
|
-
return M.Fragment =
|
|
28
|
+
return M.Fragment = o, M.jsx = m, M.jsxs = m, M;
|
|
29
29
|
}
|
|
30
30
|
var V = {};
|
|
31
31
|
/**
|
|
@@ -40,26 +40,26 @@ var V = {};
|
|
|
40
40
|
var Ie;
|
|
41
41
|
function Rr() {
|
|
42
42
|
return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var
|
|
43
|
+
var a = Le, u = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), t = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), E = 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
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];
|
|
48
48
|
return typeof r == "function" ? r : null;
|
|
49
49
|
}
|
|
50
|
-
var j =
|
|
51
|
-
function
|
|
50
|
+
var j = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
+
function _(e) {
|
|
52
52
|
{
|
|
53
|
-
for (var r = arguments.length,
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++)
|
|
54
|
+
n[i - 1] = arguments[i];
|
|
55
|
+
b("error", e, n);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function b(e, r, n) {
|
|
59
59
|
{
|
|
60
|
-
var
|
|
61
|
-
p !== "" && (r += "%s",
|
|
62
|
-
var g =
|
|
60
|
+
var i = j.ReactDebugCurrentFrame, p = i.getStackAddendum();
|
|
61
|
+
p !== "" && (r += "%s", n = n.concat([p]));
|
|
62
|
+
var g = n.map(function(d) {
|
|
63
63
|
return String(d);
|
|
64
64
|
});
|
|
65
65
|
g.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, g);
|
|
@@ -68,18 +68,18 @@ function Rr() {
|
|
|
68
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 === s || e === v || We || e === l || e === E || e === h || Ne || e === T || le || ce || q || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === C || e.$$typeof === m || e.$$typeof === t || 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
|
-
function Ve(e, r,
|
|
78
|
-
var
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
77
|
+
function Ve(e, r, n) {
|
|
78
|
+
var i = e.displayName;
|
|
79
|
+
if (i)
|
|
80
|
+
return i;
|
|
81
81
|
var p = r.displayName || r.name || "";
|
|
82
|
-
return p !== "" ?
|
|
82
|
+
return p !== "" ? n + "(" + p + ")" : n;
|
|
83
83
|
}
|
|
84
84
|
function de(e) {
|
|
85
85
|
return e.displayName || "Context";
|
|
@@ -87,37 +87,37 @@ function Rr() {
|
|
|
87
87
|
function P(e) {
|
|
88
88
|
if (e == null)
|
|
89
89
|
return null;
|
|
90
|
-
if (typeof e.tag == "number" &&
|
|
90
|
+
if (typeof e.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
91
|
return e.displayName || e.name || null;
|
|
92
92
|
if (typeof e == "string")
|
|
93
93
|
return e;
|
|
94
94
|
switch (e) {
|
|
95
|
-
case u:
|
|
96
|
-
return "Fragment";
|
|
97
95
|
case s:
|
|
96
|
+
return "Fragment";
|
|
97
|
+
case o:
|
|
98
98
|
return "Portal";
|
|
99
99
|
case v:
|
|
100
100
|
return "Profiler";
|
|
101
101
|
case l:
|
|
102
102
|
return "StrictMode";
|
|
103
|
-
case
|
|
103
|
+
case E:
|
|
104
104
|
return "Suspense";
|
|
105
105
|
case h:
|
|
106
106
|
return "SuspenseList";
|
|
107
107
|
}
|
|
108
108
|
if (typeof e == "object")
|
|
109
109
|
switch (e.$$typeof) {
|
|
110
|
-
case
|
|
110
|
+
case t:
|
|
111
111
|
var r = e;
|
|
112
112
|
return de(r) + ".Consumer";
|
|
113
113
|
case m:
|
|
114
|
-
var
|
|
115
|
-
return de(
|
|
114
|
+
var n = e;
|
|
115
|
+
return de(n._context) + ".Provider";
|
|
116
116
|
case c:
|
|
117
117
|
return Ve(e, e.render, "ForwardRef");
|
|
118
118
|
case C:
|
|
119
|
-
var
|
|
120
|
-
return
|
|
119
|
+
var i = e.displayName || null;
|
|
120
|
+
return i !== null ? i : P(e.type) || "Memo";
|
|
121
121
|
case O: {
|
|
122
122
|
var p = e, g = p._payload, d = p._init;
|
|
123
123
|
try {
|
|
@@ -188,18 +188,18 @@ function Rr() {
|
|
|
188
188
|
})
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
N < 0 &&
|
|
191
|
+
N < 0 && _("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 z(e, r,
|
|
195
|
+
function z(e, r, n) {
|
|
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 i = p.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
+
Z = i && i[1] || "";
|
|
203
203
|
}
|
|
204
204
|
return `
|
|
205
205
|
` + Z + e;
|
|
@@ -210,15 +210,15 @@ function Rr() {
|
|
|
210
210
|
var ze = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
211
|
U = new ze();
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function _e(e, r) {
|
|
214
214
|
if (!e || Q)
|
|
215
215
|
return "";
|
|
216
216
|
{
|
|
217
|
-
var
|
|
218
|
-
if (
|
|
219
|
-
return
|
|
217
|
+
var n = U.get(e);
|
|
218
|
+
if (n !== void 0)
|
|
219
|
+
return n;
|
|
220
220
|
}
|
|
221
|
-
var
|
|
221
|
+
var i;
|
|
222
222
|
Q = !0;
|
|
223
223
|
var p = Error.prepareStackTrace;
|
|
224
224
|
Error.prepareStackTrace = void 0;
|
|
@@ -237,14 +237,14 @@ function Rr() {
|
|
|
237
237
|
try {
|
|
238
238
|
Reflect.construct(d, []);
|
|
239
239
|
} catch (x) {
|
|
240
|
-
|
|
240
|
+
i = 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
|
+
i = x;
|
|
248
248
|
}
|
|
249
249
|
e.call(d.prototype);
|
|
250
250
|
}
|
|
@@ -252,26 +252,26 @@ function Rr() {
|
|
|
252
252
|
try {
|
|
253
253
|
throw Error();
|
|
254
254
|
} catch (x) {
|
|
255
|
-
|
|
255
|
+
i = x;
|
|
256
256
|
}
|
|
257
257
|
e();
|
|
258
258
|
}
|
|
259
259
|
} catch (x) {
|
|
260
|
-
if (x &&
|
|
260
|
+
if (x && i && typeof x.stack == "string") {
|
|
261
261
|
for (var f = x.stack.split(`
|
|
262
|
-
`), w =
|
|
263
|
-
`),
|
|
262
|
+
`), w = i.stack.split(`
|
|
263
|
+
`), y = f.length - 1, R = w.length - 1; y >= 1 && R >= 0 && f[y] !== w[R]; )
|
|
264
264
|
R--;
|
|
265
|
-
for (;
|
|
266
|
-
if (f[
|
|
267
|
-
if (
|
|
265
|
+
for (; y >= 1 && R >= 0; y--, R--)
|
|
266
|
+
if (f[y] !== w[R]) {
|
|
267
|
+
if (y !== 1 || R !== 1)
|
|
268
268
|
do
|
|
269
|
-
if (
|
|
269
|
+
if (y--, R--, R < 0 || f[y] !== w[R]) {
|
|
270
270
|
var S = `
|
|
271
|
-
` + f[
|
|
271
|
+
` + f[y].replace(" at new ", " at ");
|
|
272
272
|
return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, S), S;
|
|
273
273
|
}
|
|
274
|
-
while (
|
|
274
|
+
while (y >= 1 && R >= 0);
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
@@ -281,22 +281,22 @@ function Rr() {
|
|
|
281
281
|
var L = e ? e.displayName || e.name : "", Fe = L ? z(L) : "";
|
|
282
282
|
return typeof e == "function" && U.set(e, Fe), Fe;
|
|
283
283
|
}
|
|
284
|
-
function Ue(e, r,
|
|
285
|
-
return
|
|
284
|
+
function Ue(e, r, n) {
|
|
285
|
+
return _e(e, !1);
|
|
286
286
|
}
|
|
287
287
|
function Be(e) {
|
|
288
288
|
var r = e.prototype;
|
|
289
289
|
return !!(r && r.isReactComponent);
|
|
290
290
|
}
|
|
291
|
-
function B(e, r,
|
|
291
|
+
function B(e, r, n) {
|
|
292
292
|
if (e == null)
|
|
293
293
|
return "";
|
|
294
294
|
if (typeof e == "function")
|
|
295
|
-
return
|
|
295
|
+
return _e(e, Be(e));
|
|
296
296
|
if (typeof e == "string")
|
|
297
297
|
return z(e);
|
|
298
298
|
switch (e) {
|
|
299
|
-
case
|
|
299
|
+
case E:
|
|
300
300
|
return z("Suspense");
|
|
301
301
|
case h:
|
|
302
302
|
return z("SuspenseList");
|
|
@@ -306,26 +306,26 @@ function Rr() {
|
|
|
306
306
|
case c:
|
|
307
307
|
return Ue(e.render);
|
|
308
308
|
case C:
|
|
309
|
-
return B(e.type, r,
|
|
309
|
+
return B(e.type, r, n);
|
|
310
310
|
case O: {
|
|
311
|
-
var
|
|
311
|
+
var i = e, p = i._payload, g = i._init;
|
|
312
312
|
try {
|
|
313
|
-
return B(g(p), r,
|
|
313
|
+
return B(g(p), r, n);
|
|
314
314
|
} catch {
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
return "";
|
|
319
319
|
}
|
|
320
|
-
var G = Object.prototype.hasOwnProperty,
|
|
320
|
+
var G = Object.prototype.hasOwnProperty, be = {}, we = j.ReactDebugCurrentFrame;
|
|
321
321
|
function J(e) {
|
|
322
322
|
if (e) {
|
|
323
|
-
var r = e._owner,
|
|
324
|
-
we.setExtraStackFrame(
|
|
323
|
+
var r = e._owner, n = B(e.type, e._source, r ? r.type : null);
|
|
324
|
+
we.setExtraStackFrame(n);
|
|
325
325
|
} else
|
|
326
326
|
we.setExtraStackFrame(null);
|
|
327
327
|
}
|
|
328
|
-
function Ge(e, r,
|
|
328
|
+
function Ge(e, r, n, i, p) {
|
|
329
329
|
{
|
|
330
330
|
var g = Function.call.bind(G);
|
|
331
331
|
for (var d in e)
|
|
@@ -333,14 +333,14 @@ function Rr() {
|
|
|
333
333
|
var f = void 0;
|
|
334
334
|
try {
|
|
335
335
|
if (typeof e[d] != "function") {
|
|
336
|
-
var w = Error((
|
|
336
|
+
var w = Error((i || "React class") + ": " + n + " 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,
|
|
340
|
-
} catch (
|
|
341
|
-
f =
|
|
339
|
+
f = e[d](r, d, i, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
+
} catch (y) {
|
|
341
|
+
f = y;
|
|
342
342
|
}
|
|
343
|
-
f && !(f instanceof Error) && (J(p),
|
|
343
|
+
f && !(f instanceof Error) && (J(p), _("%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).", i || "React class", n, d, typeof f), J(null)), f instanceof Error && !(f.message in be) && (be[f.message] = !0, J(p), _("Failed %s type: %s", n, f.message), J(null));
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
@@ -350,8 +350,8 @@ function Rr() {
|
|
|
350
350
|
}
|
|
351
351
|
function Xe(e) {
|
|
352
352
|
{
|
|
353
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag,
|
|
354
|
-
return
|
|
353
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
354
|
+
return n;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
function He(e) {
|
|
@@ -366,7 +366,7 @@ function Rr() {
|
|
|
366
366
|
}
|
|
367
367
|
function Te(e) {
|
|
368
368
|
if (He(e))
|
|
369
|
-
return
|
|
369
|
+
return _("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
371
|
var W = j.ReactCurrentOwner, Ke = {
|
|
372
372
|
key: !0,
|
|
@@ -393,40 +393,40 @@ function Rr() {
|
|
|
393
393
|
}
|
|
394
394
|
function er(e, r) {
|
|
395
395
|
if (typeof e.ref == "string" && W.current && r && W.current.stateNode !== r) {
|
|
396
|
-
var
|
|
397
|
-
re[
|
|
396
|
+
var n = P(W.current.type);
|
|
397
|
+
re[n] || (_('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[n] = !0);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
function rr(e, r) {
|
|
401
401
|
{
|
|
402
|
-
var
|
|
403
|
-
Oe || (Oe = !0,
|
|
402
|
+
var n = function() {
|
|
403
|
+
Oe || (Oe = !0, _("%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));
|
|
404
404
|
};
|
|
405
|
-
|
|
406
|
-
get:
|
|
405
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
406
|
+
get: n,
|
|
407
407
|
configurable: !0
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
function tr(e, r) {
|
|
412
412
|
{
|
|
413
|
-
var
|
|
414
|
-
Se || (Se = !0,
|
|
413
|
+
var n = function() {
|
|
414
|
+
Se || (Se = !0, _("%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));
|
|
415
415
|
};
|
|
416
|
-
|
|
417
|
-
get:
|
|
416
|
+
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
417
|
+
get: n,
|
|
418
418
|
configurable: !0
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
var nr = function(e, r,
|
|
422
|
+
var nr = function(e, r, n, i, 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: u,
|
|
426
426
|
// Built-in properties that belong on the element
|
|
427
427
|
type: e,
|
|
428
428
|
key: r,
|
|
429
|
-
ref:
|
|
429
|
+
ref: n,
|
|
430
430
|
props: d,
|
|
431
431
|
// Record the component responsible for creating this element.
|
|
432
432
|
_owner: g
|
|
@@ -440,7 +440,7 @@ function Rr() {
|
|
|
440
440
|
configurable: !1,
|
|
441
441
|
enumerable: !1,
|
|
442
442
|
writable: !1,
|
|
443
|
-
value:
|
|
443
|
+
value: i
|
|
444
444
|
}), Object.defineProperty(f, "_source", {
|
|
445
445
|
configurable: !1,
|
|
446
446
|
enumerable: !1,
|
|
@@ -448,36 +448,36 @@ 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,
|
|
451
|
+
function ar(e, r, n, i, p) {
|
|
452
452
|
{
|
|
453
453
|
var g, d = {}, f = null, w = null;
|
|
454
|
-
|
|
454
|
+
n !== void 0 && (Te(n), f = "" + n), Qe(r) && (Te(r.key), f = "" + r.key), Ze(r) && (w = r.ref, er(r, p));
|
|
455
455
|
for (g in r)
|
|
456
456
|
G.call(r, g) && !Ke.hasOwnProperty(g) && (d[g] = r[g]);
|
|
457
457
|
if (e && e.defaultProps) {
|
|
458
|
-
var
|
|
459
|
-
for (g in
|
|
460
|
-
d[g] === void 0 && (d[g] =
|
|
458
|
+
var y = e.defaultProps;
|
|
459
|
+
for (g in y)
|
|
460
|
+
d[g] === void 0 && (d[g] = y[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, i, W.current, d);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
var te = j.ReactCurrentOwner, je = j.ReactDebugCurrentFrame;
|
|
470
470
|
function I(e) {
|
|
471
471
|
if (e) {
|
|
472
|
-
var r = e._owner,
|
|
473
|
-
je.setExtraStackFrame(
|
|
472
|
+
var r = e._owner, n = B(e.type, e._source, r ? r.type : null);
|
|
473
|
+
je.setExtraStackFrame(n);
|
|
474
474
|
} else
|
|
475
475
|
je.setExtraStackFrame(null);
|
|
476
476
|
}
|
|
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 === u;
|
|
481
481
|
}
|
|
482
482
|
function Pe() {
|
|
483
483
|
{
|
|
@@ -494,10 +494,10 @@ Check the render method of \`` + e + "`.";
|
|
|
494
494
|
function or(e) {
|
|
495
495
|
{
|
|
496
496
|
if (e !== void 0) {
|
|
497
|
-
var r = e.fileName.replace(/^.*[\\\/]/, ""),
|
|
497
|
+
var r = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
|
|
498
498
|
return `
|
|
499
499
|
|
|
500
|
-
Check your code at ` + r + ":" +
|
|
500
|
+
Check your code at ` + r + ":" + n + ".";
|
|
501
501
|
}
|
|
502
502
|
return "";
|
|
503
503
|
}
|
|
@@ -507,10 +507,10 @@ Check your code at ` + r + ":" + t + ".";
|
|
|
507
507
|
{
|
|
508
508
|
var r = Pe();
|
|
509
509
|
if (!r) {
|
|
510
|
-
var
|
|
511
|
-
|
|
510
|
+
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
511
|
+
n && (r = `
|
|
512
512
|
|
|
513
|
-
Check the top-level render call using <` +
|
|
513
|
+
Check the top-level render call using <` + n + ">.");
|
|
514
514
|
}
|
|
515
515
|
return r;
|
|
516
516
|
}
|
|
@@ -520,12 +520,12 @@ Check the top-level render call using <` + t + ">.");
|
|
|
520
520
|
if (!e._store || e._store.validated || e.key != null)
|
|
521
521
|
return;
|
|
522
522
|
e._store.validated = !0;
|
|
523
|
-
var
|
|
524
|
-
if (xe[
|
|
523
|
+
var n = ir(r);
|
|
524
|
+
if (xe[n])
|
|
525
525
|
return;
|
|
526
|
-
xe[
|
|
527
|
-
var
|
|
528
|
-
e && e._owner && e._owner !== te.current && (
|
|
526
|
+
xe[n] = !0;
|
|
527
|
+
var i = "";
|
|
528
|
+
e && e._owner && e._owner !== te.current && (i = " It was passed a child from " + P(e._owner.type) + "."), I(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, i), I(null);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
function Ae(e, r) {
|
|
@@ -533,9 +533,9 @@ Check the top-level render call using <` + t + ">.");
|
|
|
533
533
|
if (typeof e != "object")
|
|
534
534
|
return;
|
|
535
535
|
if (ee(e))
|
|
536
|
-
for (var
|
|
537
|
-
var
|
|
538
|
-
ae(
|
|
536
|
+
for (var n = 0; n < e.length; n++) {
|
|
537
|
+
var i = e[n];
|
|
538
|
+
ae(i) && ke(i, r);
|
|
539
539
|
}
|
|
540
540
|
else if (ae(e))
|
|
541
541
|
e._store && (e._store.validated = !0);
|
|
@@ -547,44 +547,44 @@ Check the top-level render call using <` + t + ">.");
|
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function ur(e) {
|
|
551
551
|
{
|
|
552
552
|
var r = e.type;
|
|
553
553
|
if (r == null || typeof r == "string")
|
|
554
554
|
return;
|
|
555
|
-
var
|
|
555
|
+
var n;
|
|
556
556
|
if (typeof r == "function")
|
|
557
|
-
|
|
557
|
+
n = r.propTypes;
|
|
558
558
|
else if (typeof r == "object" && (r.$$typeof === c || // Note: Memo only checks outer props here.
|
|
559
559
|
// Inner props are checked in the reconciler.
|
|
560
560
|
r.$$typeof === C))
|
|
561
|
-
|
|
561
|
+
n = r.propTypes;
|
|
562
562
|
else
|
|
563
563
|
return;
|
|
564
|
-
if (
|
|
565
|
-
var
|
|
566
|
-
Ge(
|
|
564
|
+
if (n) {
|
|
565
|
+
var i = P(r);
|
|
566
|
+
Ge(n, e.props, "prop", i, e);
|
|
567
567
|
} else if (r.PropTypes !== void 0 && !ne) {
|
|
568
568
|
ne = !0;
|
|
569
569
|
var p = P(r);
|
|
570
|
-
|
|
570
|
+
_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
|
|
571
571
|
}
|
|
572
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
572
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function sr(e) {
|
|
576
576
|
{
|
|
577
|
-
for (var r = Object.keys(e.props),
|
|
578
|
-
var
|
|
579
|
-
if (
|
|
580
|
-
I(e),
|
|
577
|
+
for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
|
|
578
|
+
var i = r[n];
|
|
579
|
+
if (i !== "children" && i !== "key") {
|
|
580
|
+
I(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", i), I(null);
|
|
581
581
|
break;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
e.ref !== null && (I(e),
|
|
584
|
+
e.ref !== null && (I(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), I(null));
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
function De(e, r,
|
|
587
|
+
function De(e, r, n, i, p, g) {
|
|
588
588
|
{
|
|
589
589
|
var d = Me(e);
|
|
590
590
|
if (!d) {
|
|
@@ -592,36 +592,36 @@ Check the top-level render call using <` + t + ">.");
|
|
|
592
592
|
(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.");
|
|
593
593
|
var w = or(p);
|
|
594
594
|
w ? f += w : f += Pe();
|
|
595
|
-
var
|
|
596
|
-
e === null ?
|
|
595
|
+
var y;
|
|
596
|
+
e === null ? y = "null" : ee(e) ? y = "array" : e !== void 0 && e.$$typeof === u ? (y = "<" + (P(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, _("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);
|
|
597
597
|
}
|
|
598
|
-
var R = ar(e, r,
|
|
598
|
+
var R = ar(e, r, n, 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 (i)
|
|
605
605
|
if (ee(S)) {
|
|
606
606
|
for (var L = 0; L < S.length; L++)
|
|
607
607
|
Ae(S[L], e);
|
|
608
608
|
Object.freeze && Object.freeze(S);
|
|
609
609
|
} else
|
|
610
|
-
|
|
610
|
+
_("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 === s ? sr(R) : ur(R), R;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
function lr(e, r,
|
|
618
|
-
return De(e, r,
|
|
617
|
+
function lr(e, r, n) {
|
|
618
|
+
return De(e, r, n, !0);
|
|
619
619
|
}
|
|
620
|
-
function cr(e, r,
|
|
621
|
-
return De(e, r,
|
|
620
|
+
function cr(e, r, n) {
|
|
621
|
+
return De(e, r, n, !1);
|
|
622
622
|
}
|
|
623
623
|
var fr = cr, dr = lr;
|
|
624
|
-
V.Fragment =
|
|
624
|
+
V.Fragment = s, V.jsx = fr, V.jsxs = dr;
|
|
625
625
|
}()), V;
|
|
626
626
|
}
|
|
627
627
|
process.env.NODE_ENV === "production" ? ie.exports = yr() : ie.exports = Rr();
|
|
@@ -635,97 +635,97 @@ const H = vr({
|
|
|
635
635
|
useAuth: void 0,
|
|
636
636
|
useLocation: void 0
|
|
637
637
|
}), Or = ({
|
|
638
|
-
axios:
|
|
639
|
-
children:
|
|
640
|
-
translate:
|
|
641
|
-
useAuth:
|
|
638
|
+
axios: a,
|
|
639
|
+
children: u,
|
|
640
|
+
translate: o,
|
|
641
|
+
useAuth: s,
|
|
642
642
|
Outlet: l,
|
|
643
643
|
Navigate: v,
|
|
644
644
|
useLocation: m,
|
|
645
|
-
useGoogleTagManager:
|
|
645
|
+
useGoogleTagManager: t
|
|
646
646
|
}) => {
|
|
647
|
-
const c =
|
|
647
|
+
const c = ue(
|
|
648
648
|
() => ({
|
|
649
|
-
axios:
|
|
649
|
+
axios: a,
|
|
650
650
|
Navigate: v,
|
|
651
651
|
Outlet: l,
|
|
652
|
-
translate:
|
|
653
|
-
useAuth:
|
|
654
|
-
useGoogleTagManager:
|
|
652
|
+
translate: o,
|
|
653
|
+
useAuth: s,
|
|
654
|
+
useGoogleTagManager: t,
|
|
655
655
|
useLocation: m
|
|
656
656
|
}),
|
|
657
|
-
[v, l,
|
|
657
|
+
[v, l, a, o, s, t, m]
|
|
658
658
|
);
|
|
659
|
-
return /* @__PURE__ */ k.jsx(H.Provider, { value: c, children:
|
|
660
|
-
}, X = (
|
|
661
|
-
Fallback:
|
|
662
|
-
loginPath:
|
|
663
|
-
localStorageKey:
|
|
664
|
-
redirect401Path:
|
|
659
|
+
return /* @__PURE__ */ k.jsx(H.Provider, { value: c, children: u });
|
|
660
|
+
}, X = (a) => `RequireAuth require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Sr = ({
|
|
661
|
+
Fallback: a,
|
|
662
|
+
loginPath: u = "/login",
|
|
663
|
+
localStorageKey: o = "user",
|
|
664
|
+
redirect401Path: s = "/login",
|
|
665
665
|
...l
|
|
666
666
|
}) => {
|
|
667
|
-
var D, F, j,
|
|
667
|
+
var D, F, j, _;
|
|
668
668
|
const {
|
|
669
669
|
axios: v = l.axios,
|
|
670
670
|
useLocation: m = l.useLocation,
|
|
671
|
-
useAuth:
|
|
671
|
+
useAuth: t = l.useAuth,
|
|
672
672
|
Outlet: c = l.Outlet,
|
|
673
|
-
Navigate:
|
|
674
|
-
} =
|
|
675
|
-
if (
|
|
673
|
+
Navigate: E = l.Navigate
|
|
674
|
+
} = se(H);
|
|
675
|
+
if (t === void 0)
|
|
676
676
|
throw new Error(X("useAuth"));
|
|
677
677
|
if (m === void 0)
|
|
678
678
|
throw new Error(X("useLocation"));
|
|
679
679
|
if (c === void 0)
|
|
680
680
|
throw new Error(X("Outlet"));
|
|
681
|
-
if (
|
|
681
|
+
if (E === void 0)
|
|
682
682
|
throw new Error(X("Navigate"));
|
|
683
|
-
const [h, C] = pr(null), { isLogged: O } =
|
|
683
|
+
const [h, C] = pr(null), { isLogged: O } = t(), T = m(), A = gr(!1);
|
|
684
684
|
return mr(() => {
|
|
685
685
|
A.current || (A.current = !0, v == null || v.interceptors.response.use(
|
|
686
|
-
(
|
|
687
|
-
async (
|
|
686
|
+
(b) => b,
|
|
687
|
+
async (b) => {
|
|
688
688
|
var q;
|
|
689
|
-
return typeof
|
|
689
|
+
return typeof b == "object" && b && "response" in b && b.response && typeof b.response == "object" && "status" in b.response && b.response && typeof b.response == "object" && "status" in b.response && ((q = b == null ? void 0 : b.response) == null ? void 0 : q.status) === 401 && (v.defaults.headers.common.Authorization = null, localStorage.removeItem(o), C(s)), Promise.reject(b);
|
|
690
690
|
}
|
|
691
691
|
));
|
|
692
|
-
}, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response,
|
|
693
|
-
}, oe = (
|
|
692
|
+
}, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response, o, s]), O && !h ? /* @__PURE__ */ k.jsx(hr, { fallback: a, children: (F = (D = T.state) == null ? void 0 : D.from) != null && F.state && ((_ = (j = T.state) == null ? void 0 : j.from) == null ? void 0 : _.pathname) === u ? /* @__PURE__ */ k.jsx(E, { to: T.state.from.state.from.pathname + T.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ k.jsx(c, {}) }) : /* @__PURE__ */ k.jsx(E, { to: u, state: { from: T }, replace: !0 });
|
|
693
|
+
}, oe = (a) => `GTMSendPageView require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, jr = ({ ...a }) => {
|
|
694
694
|
const {
|
|
695
|
-
useLocation:
|
|
696
|
-
Outlet:
|
|
697
|
-
useGoogleTagManager:
|
|
698
|
-
} =
|
|
699
|
-
if (
|
|
695
|
+
useLocation: u = a.useLocation,
|
|
696
|
+
Outlet: o = a.Outlet,
|
|
697
|
+
useGoogleTagManager: s = a.useGoogleTagManager
|
|
698
|
+
} = se(H);
|
|
699
|
+
if (u === void 0)
|
|
700
700
|
throw new Error(oe("useLocation"));
|
|
701
|
-
if (
|
|
701
|
+
if (o === void 0)
|
|
702
702
|
throw new Error(oe("Outlet"));
|
|
703
|
-
if (
|
|
703
|
+
if (s === void 0)
|
|
704
704
|
throw new Error(oe("useGoogleTagManager"));
|
|
705
|
-
const { pathname: l } =
|
|
705
|
+
const { pathname: l } = u(), { sendEvent: v } = s();
|
|
706
706
|
return Er(() => {
|
|
707
707
|
v({ event: "pageView", pathname: l });
|
|
708
|
-
}, [l, v]), /* @__PURE__ */ k.jsx(
|
|
708
|
+
}, [l, v]), /* @__PURE__ */ k.jsx(o, {});
|
|
709
709
|
}, Pr = ({
|
|
710
|
-
axios:
|
|
711
|
-
baseURL:
|
|
712
|
-
tokenTypeKey:
|
|
713
|
-
userLocalStorageKey:
|
|
710
|
+
axios: a,
|
|
711
|
+
baseURL: u,
|
|
712
|
+
tokenTypeKey: o = "tokenType",
|
|
713
|
+
userLocalStorageKey: s = "user",
|
|
714
714
|
tokenKey: l = "accessToken",
|
|
715
715
|
postContentType: v = "application/json"
|
|
716
716
|
}) => {
|
|
717
|
-
if (!
|
|
717
|
+
if (!a.defaults)
|
|
718
718
|
return null;
|
|
719
|
-
const m = localStorage.getItem(
|
|
720
|
-
return
|
|
719
|
+
const m = localStorage.getItem(s), t = m ? JSON.parse(m) : null, c = t != null && t[o] ? t[o] : null, E = t != null && t[l] ? t[l] : null, h = m ? `${c} ${E}` : null;
|
|
720
|
+
return a.defaults.baseURL = u, a.defaults.headers.post["Content-Type"] = v, h && (a.defaults.headers.common.Authorization = h), null;
|
|
721
721
|
}, xr = ({
|
|
722
|
-
i18n:
|
|
723
|
-
debug:
|
|
724
|
-
initReactI18next:
|
|
725
|
-
resources:
|
|
722
|
+
i18n: a,
|
|
723
|
+
debug: u,
|
|
724
|
+
initReactI18next: o,
|
|
725
|
+
resources: s,
|
|
726
726
|
LanguageDetector: l
|
|
727
|
-
}) => (
|
|
728
|
-
debug:
|
|
727
|
+
}) => (a != null && a.isInitialized || (a.use(l).use(o).init({
|
|
728
|
+
debug: u,
|
|
729
729
|
fallbackLng: "en",
|
|
730
730
|
interpolation: {
|
|
731
731
|
escapeValue: !1
|
|
@@ -735,30 +735,30 @@ const H = vr({
|
|
|
735
735
|
bindI18n: !1,
|
|
736
736
|
useSuspense: !0
|
|
737
737
|
},
|
|
738
|
-
resources:
|
|
738
|
+
resources: s,
|
|
739
739
|
returnNull: !1
|
|
740
740
|
}).then(() => {
|
|
741
|
-
document.documentElement.lang !==
|
|
742
|
-
}),
|
|
741
|
+
document.documentElement.lang !== a.resolvedLanguage && a.resolvedLanguage && document.documentElement.setAttribute("lang", a.resolvedLanguage);
|
|
742
|
+
}), a.on("languageChanged", (v) => {
|
|
743
743
|
document.documentElement.setAttribute("lang", v);
|
|
744
744
|
})), null), kr = ({
|
|
745
|
-
dsn:
|
|
746
|
-
sentry:
|
|
747
|
-
integrations:
|
|
748
|
-
tracesSampleRate:
|
|
745
|
+
dsn: a,
|
|
746
|
+
sentry: u,
|
|
747
|
+
integrations: o,
|
|
748
|
+
tracesSampleRate: s,
|
|
749
749
|
routingInstrumentationDependencies: l,
|
|
750
750
|
replaysSessionSampleRate: v,
|
|
751
751
|
replaysOnErrorSampleRate: m,
|
|
752
|
-
tracePropagationTargets:
|
|
752
|
+
tracePropagationTargets: t,
|
|
753
753
|
ignoreErrors: c,
|
|
754
|
-
debug:
|
|
755
|
-
}) => (
|
|
756
|
-
debug:
|
|
757
|
-
dsn:
|
|
754
|
+
debug: E
|
|
755
|
+
}) => (u.isInitialized() || (E || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && u.init({
|
|
756
|
+
debug: E,
|
|
757
|
+
dsn: a,
|
|
758
758
|
ignoreErrors: c || [/Failed to fetch dynamically imported module/],
|
|
759
759
|
integrations: [
|
|
760
|
-
new
|
|
761
|
-
routingInstrumentation:
|
|
760
|
+
new u.BrowserTracing({
|
|
761
|
+
routingInstrumentation: u.reactRouterV6Instrumentation(
|
|
762
762
|
l.useEffect,
|
|
763
763
|
l.useLocation,
|
|
764
764
|
l.useNavigationType,
|
|
@@ -766,125 +766,126 @@ const H = vr({
|
|
|
766
766
|
l.matchRoutes
|
|
767
767
|
)
|
|
768
768
|
}),
|
|
769
|
-
|
|
770
|
-
...
|
|
769
|
+
u.replayIntegration(),
|
|
770
|
+
...o || []
|
|
771
771
|
],
|
|
772
772
|
replaysOnErrorSampleRate: m || 1,
|
|
773
773
|
replaysSessionSampleRate: v || 0.1,
|
|
774
|
-
tracePropagationTargets:
|
|
775
|
-
tracesSampleRate:
|
|
776
|
-
}), null), Ar = ({ IMaskMixin:
|
|
777
|
-
const
|
|
774
|
+
tracePropagationTargets: t,
|
|
775
|
+
tracesSampleRate: s || 1
|
|
776
|
+
}), null), Ar = ({ IMaskMixin: a, ...u }) => {
|
|
777
|
+
const o = ue(
|
|
778
778
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
779
|
-
() =>
|
|
780
|
-
[
|
|
779
|
+
() => a(({ TextField: s, ...l }) => /* @__PURE__ */ k.jsx(s, { ...l })),
|
|
780
|
+
[a]
|
|
781
781
|
);
|
|
782
|
-
return /* @__PURE__ */ k.jsx(
|
|
783
|
-
}, Dr = ({ mapbox:
|
|
784
|
-
children:
|
|
785
|
-
defaultOptions:
|
|
786
|
-
QueryClient:
|
|
787
|
-
QueryClientProvider:
|
|
782
|
+
return /* @__PURE__ */ k.jsx(o, { ...u });
|
|
783
|
+
}, Dr = ({ mapbox: a, accessToken: u }) => (a && u && (a.accessToken = u), null), Fr = ({
|
|
784
|
+
children: a,
|
|
785
|
+
defaultOptions: u,
|
|
786
|
+
QueryClient: o,
|
|
787
|
+
QueryClientProvider: s
|
|
788
788
|
}) => {
|
|
789
|
-
const l = new
|
|
789
|
+
const l = new o({
|
|
790
790
|
defaultOptions: {
|
|
791
791
|
queries: {
|
|
792
792
|
refetchOnWindowFocus: !1,
|
|
793
793
|
retry: 3,
|
|
794
|
-
...
|
|
794
|
+
...u
|
|
795
795
|
}
|
|
796
796
|
}
|
|
797
797
|
});
|
|
798
|
-
return /* @__PURE__ */ k.jsx(
|
|
799
|
-
}, $r = (
|
|
800
|
-
const { unknownErrorTranslationKey:
|
|
798
|
+
return /* @__PURE__ */ k.jsx(s, { client: l, children: a });
|
|
799
|
+
}, $r = (a) => {
|
|
800
|
+
const { unknownErrorTranslationKey: u = "error.unknownError" } = a || {}, { translate: o = a == null ? void 0 : a.translate } = se(H), s = o ? o(u) : "Unknown error", l = Y(
|
|
801
801
|
(m) => {
|
|
802
|
-
var c,
|
|
803
|
-
const { response:
|
|
804
|
-
return
|
|
802
|
+
var c, E, h, C, O, T, A, D, F;
|
|
803
|
+
const { response: t } = m || {};
|
|
804
|
+
return t != null && t.reason ? String(t.reason) : (c = t == null ? void 0 : t.data) != null && c.reason ? String(t.data.reason) : (E = t == null ? void 0 : t.data) != null && E.message ? String(t.data.message) : (C = (h = t == null ? void 0 : t.data) == null ? void 0 : h.detail) != null && C.length && Array.isArray((O = t == null ? void 0 : t.data) == null ? void 0 : O.detail) && ((A = (T = t == null ? void 0 : t.data) == null ? void 0 : T.detail[0]) != null && A.msg) && typeof ((F = (D = t == null ? void 0 : t.data) == null ? void 0 : D.detail[0]) == null ? void 0 : F.msg) == "string" ? String(t.data.detail[0].msg) : s;
|
|
805
805
|
},
|
|
806
|
-
[
|
|
806
|
+
[s]
|
|
807
807
|
), v = Y(
|
|
808
808
|
(m) => {
|
|
809
|
-
|
|
810
|
-
|
|
809
|
+
var c, E, h;
|
|
810
|
+
const { response: t } = m || {};
|
|
811
|
+
return o && (t != null && t.error_code) ? o(t == null ? void 0 : t.error_code) : o && ((c = t == null ? void 0 : t.data) != null && c.error_code) ? o((E = t == null ? void 0 : t.data) == null ? void 0 : E.error_code) : t != null && t.error_code ? String(t == null ? void 0 : t.error_code) : (h = t == null ? void 0 : t.data) != null && h.error_code ? String(t.data.error_code) : s;
|
|
811
812
|
},
|
|
812
|
-
[
|
|
813
|
+
[s, o]
|
|
813
814
|
);
|
|
814
815
|
return { printError: l, printErrorCode: v };
|
|
815
816
|
}, Ir = ({
|
|
816
|
-
data:
|
|
817
|
-
fetchNextPage:
|
|
818
|
-
isFetchingNextPage:
|
|
819
|
-
isInitialLoading:
|
|
817
|
+
data: a,
|
|
818
|
+
fetchNextPage: u,
|
|
819
|
+
isFetchingNextPage: o,
|
|
820
|
+
isInitialLoading: s,
|
|
820
821
|
isLoading: l,
|
|
821
822
|
enabled: v = !0
|
|
822
823
|
}) => {
|
|
823
824
|
const m = Y(
|
|
824
825
|
async (c) => {
|
|
825
|
-
|
|
826
|
+
o || !v || await u({ pageParam: (c == null ? void 0 : c.pageParam) || c.visibleRowsCount });
|
|
826
827
|
},
|
|
827
|
-
[v,
|
|
828
|
-
),
|
|
829
|
-
if (
|
|
830
|
-
return
|
|
831
|
-
}, [
|
|
828
|
+
[v, u, o]
|
|
829
|
+
), t = ue(() => {
|
|
830
|
+
if (a)
|
|
831
|
+
return a.pages.reduce((c, E) => [...c, ...E], []);
|
|
832
|
+
}, [a]);
|
|
832
833
|
return {
|
|
833
834
|
fetchNextPageOnRowsScrollEnd: m,
|
|
834
|
-
isLoading:
|
|
835
|
-
loadingVariant:
|
|
836
|
-
rows:
|
|
835
|
+
isLoading: o || l,
|
|
836
|
+
loadingVariant: s ? "skeleton" : "linear",
|
|
837
|
+
rows: t
|
|
837
838
|
};
|
|
838
|
-
}, Lr = (
|
|
839
|
-
const
|
|
840
|
-
({ tokenType:
|
|
841
|
-
|
|
839
|
+
}, Lr = (a) => {
|
|
840
|
+
const u = Y(
|
|
841
|
+
({ tokenType: s, accessToken: l }) => {
|
|
842
|
+
a.defaults.headers.common.Authorization = `${s} ${l}`;
|
|
842
843
|
},
|
|
843
|
-
[
|
|
844
|
+
[a.defaults.headers.common]
|
|
844
845
|
);
|
|
845
846
|
return {
|
|
846
847
|
clearAuthenticationToken: Y(() => {
|
|
847
|
-
|
|
848
|
-
}, [
|
|
849
|
-
setAuthenticationToken:
|
|
848
|
+
a.defaults.headers.common.Authorization = null;
|
|
849
|
+
}, [a.defaults.headers.common]),
|
|
850
|
+
setAuthenticationToken: u
|
|
850
851
|
};
|
|
851
|
-
},
|
|
852
|
-
const
|
|
853
|
-
return
|
|
854
|
-
}, wr = (
|
|
855
|
-
const
|
|
856
|
-
return `${
|
|
857
|
-
}, Cr = (
|
|
858
|
-
if (
|
|
859
|
-
return (
|
|
852
|
+
}, _r = (a) => a.charAt(0).toUpperCase() + a.slice(1).toLowerCase(), br = (a) => {
|
|
853
|
+
const s = a.split("/").filter((l) => l.length > 0).map((l) => l.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((c) => c.charAt(0).toUpperCase() + c.slice(1)).join("")).join("");
|
|
854
|
+
return s.charAt(0).toLowerCase() + s.slice(1);
|
|
855
|
+
}, wr = (a, u, o) => {
|
|
856
|
+
const s = br(u), l = _r(o);
|
|
857
|
+
return `${s}${l}`;
|
|
858
|
+
}, Cr = (a) => {
|
|
859
|
+
if (a)
|
|
860
|
+
return (a == null ? void 0 : a.reduce((u, o) => (u[o] = {
|
|
860
861
|
query: {
|
|
861
862
|
useInfinite: !0,
|
|
862
863
|
useInfiniteQueryParam: "offset"
|
|
863
864
|
}
|
|
864
|
-
},
|
|
865
|
-
}, Nr = (
|
|
866
|
-
const { input:
|
|
865
|
+
}, u), {})) || {};
|
|
866
|
+
}, Nr = (a) => {
|
|
867
|
+
const { input: u = "./openapi.json", operationsToGenerateInfiniteQueryHook: o = void 0 } = a || {};
|
|
867
868
|
return {
|
|
868
869
|
api: {
|
|
869
870
|
hooks: {
|
|
870
871
|
afterAllFilesWrite: "prettier src/api/ --write"
|
|
871
872
|
},
|
|
872
|
-
input:
|
|
873
|
+
input: u,
|
|
873
874
|
output: {
|
|
874
875
|
client: "react-query",
|
|
875
876
|
mode: "tags-split",
|
|
876
877
|
override: {
|
|
877
|
-
header: (
|
|
878
|
+
header: (s) => [
|
|
878
879
|
"Generated by orval 🍺",
|
|
879
|
-
...
|
|
880
|
-
...
|
|
880
|
+
...s.title ? [s.title] : [],
|
|
881
|
+
...s.description ? [s.description] : []
|
|
881
882
|
],
|
|
882
883
|
mutator: {
|
|
883
884
|
name: "axiosCustomInstance",
|
|
884
885
|
path: `${__dirname}/config/orval/mutator/axiosCustomInstance.ts`
|
|
885
886
|
},
|
|
886
887
|
operationName: wr,
|
|
887
|
-
...(
|
|
888
|
+
...(o == null ? void 0 : o.length) && { operations: Cr(o) },
|
|
888
889
|
query: {
|
|
889
890
|
useQuery: !0
|
|
890
891
|
}
|
package/dist/main.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(b,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],E):(b=typeof globalThis<"u"?globalThis:b||self,E(b["@tracktor/shared-module"]={},b.React))})(this,function(b,E){"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
|
|
9
|
+
*/var se;function Le(){if(se)return V;se=1;var a=E,u=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,c=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function m(t,l,y){var h,O={},j=null,S=null;y!==void 0&&(j=""+y),l.key!==void 0&&(j=""+l.key),l.ref!==void 0&&(S=l.ref);for(h in l)s.call(l,h)&&!v.hasOwnProperty(h)&&(O[h]=l[h]);if(t&&t.defaultProps)for(h in l=t.defaultProps,l)O[h]===void 0&&(O[h]=l[h]);return{$$typeof:u,type:t,key:j,ref:S,props:O,_owner:c.current}}return V.Fragment=o,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
|
|
18
|
-
`+re+e}}var te=!1,H;{var
|
|
19
|
-
`),T=
|
|
20
|
-
`),
|
|
21
|
-
`+f[
|
|
17
|
+
*/var ce;function Me(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){var a=E,u=Symbol.for("react.element"),o=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),t=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),h=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=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];w("error",e,n)}}function w(e,r,n){{var i=A.ReactDebugCurrentFrame,g=i.getStackAddendum();g!==""&&(r+="%s",n=n.concat([g]));var p=n.map(function(d){return String(d)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var le=!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===s||e===v||tr||e===c||e===y||e===h||rr||e===S||le||fe||J||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===O||e.$$typeof===m||e.$$typeof===t||e.$$typeof===l||e.$$typeof===de||e.getModuleId!==void 0))}function ar(e,r,n){var i=e.displayName;if(i)return i;var g=r.displayName||r.name||"";return g!==""?n+"("+g+")":n}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 s:return"Fragment";case o:return"Portal";case v:return"Profiler";case c:return"StrictMode";case y:return"Suspense";case h:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case t:var r=e;return ve(r)+".Consumer";case m:var n=e;return ve(n._context)+".Provider";case l:return ar(e,e.render,"ForwardRef");case O:var i=e.displayName||null;return i!==null?i:x(e.type)||"Memo";case j:{var g=e,p=g._payload,d=g._init;try{return x(d(p))}catch{return null}}}return null}var M=Object.assign,U=0,ge,pe,me,he,Ee,ye,Re;function be(){}be.__reactDisabledLog=!0;function or(){{if(U===0){ge=console.log,pe=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:ge}),info:M({},e,{value:pe}),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,n){{if(re===void 0)try{throw Error()}catch(g){var i=g.stack.trim().match(/\n( *(at )?)/);re=i&&i[1]||""}return`
|
|
18
|
+
`+re+e}}var te=!1,H;{var ur=typeof WeakMap=="function"?WeakMap:Map;H=new ur}function _e(e,r){if(!e||te)return"";{var n=H.get(e);if(n!==void 0)return n}var i;te=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=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){i=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){i=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){i=D}e()}}catch(D){if(D&&i&&typeof D.stack=="string"){for(var f=D.stack.split(`
|
|
19
|
+
`),T=i.stack.split(`
|
|
20
|
+
`),R=f.length-1,_=T.length-1;R>=1&&_>=0&&f[R]!==T[_];)_--;for(;R>=1&&_>=0;R--,_--)if(f[R]!==T[_]){if(R!==1||_!==1)do if(R--,_--,_<0||f[R]!==T[_]){var P=`
|
|
21
|
+
`+f[R].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(R>=1&&_>=0);break}}}finally{te=!1,ee.current=p,ir(),Error.prepareStackTrace=g}var W=e?e.displayName||e.name:"",Ie=W?X(W):"";return typeof e=="function"&&H.set(e,Ie),Ie}function sr(e,r,n){return _e(e,!1)}function cr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,n){if(e==null)return"";if(typeof e=="function")return _e(e,cr(e));if(typeof e=="string")return X(e);switch(e){case y:return X("Suspense");case h:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return sr(e.render);case O:return K(e.type,r,n);case j:{var i=e,g=i._payload,p=i._init;try{return K(p(g),r,n)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,Ce={},we=A.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,n=K(e.type,e._source,r?r.type:null);we.setExtraStackFrame(n)}else we.setExtraStackFrame(null)}function lr(e,r,n,i,g){{var p=Function.call.bind(Z);for(var d in e)if(p(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((i||"React class")+": "+n+" 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,i,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){f=R}f&&!(f instanceof Error)&&(q(g),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).",i||"React class",n,d,typeof f),q(null)),f instanceof Error&&!(f.message in Ce)&&(Ce[f.message]=!0,q(g),C("Failed %s type: %s",n,f.message),q(null))}}}var fr=Array.isArray;function ne(e){return fr(e)}function dr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}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,gr={key:!0,ref:!0,__self:!0,__source:!0},Se,je,ae;ae={};function pr(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 n=x(B.current.type);ae[n]||(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[n]=!0)}}function Er(e,r){{var n=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))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function yr(e,r){{var n=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))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var Rr=function(e,r,n,i,g,p,d){var f={$$typeof:u,type:e,key:r,ref:n,props:d,_owner:p};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:i}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:g}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function br(e,r,n,i,g){{var p,d={},f=null,T=null;n!==void 0&&(Oe(n),f=""+n),mr(r)&&(Oe(r.key),f=""+r.key),pr(r)&&(T=r.ref,hr(r,g));for(p in r)Z.call(r,p)&&!gr.hasOwnProperty(p)&&(d[p]=r[p]);if(e&&e.defaultProps){var R=e.defaultProps;for(p in R)d[p]===void 0&&(d[p]=R[p])}if(f||T){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Er(d,_),T&&yr(d,_)}return Rr(e,f,T,g,i,B.current,d)}}var oe=A.ReactCurrentOwner,Pe=A.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,n=K(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(n)}else Pe.setExtraStackFrame(null)}var ie;ie=!1;function ue(e){return typeof e=="object"&&e!==null&&e.$$typeof===u}function ke(){{if(oe.current){var e=x(oe.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function _r(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function _r(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),n=e.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+r+":"+
|
|
25
|
+
Check your code at `+r+":"+n+"."}return""}}var Ae={};function Cr(e){{var r=ke();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(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 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"})});
|
|
27
|
+
Check the top-level render call using <`+n+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=Cr(r);if(Ae[n])return;Ae[n]=!0;var i="";e&&e._owner&&e._owner!==oe.current&&(i=" 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.',n,i),N(null)}}function De(e,r){{if(typeof e!="object")return;if(ne(e))for(var n=0;n<e.length;n++){var i=e[n];ue(i)&&xe(i,r)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var g=L(e);if(typeof g=="function"&&g!==e.entries)for(var p=g.call(e),d;!(d=p.next()).done;)ue(d.value)&&xe(d.value,r)}}}function wr(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===O))n=r.propTypes;else return;if(n){var i=x(r);lr(n,e.props,"prop",i,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var g=x(r);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",g||"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),n=0;n<r.length;n++){var i=r[n];if(i!=="children"&&i!=="key"){N(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),N(null);break}}e.ref!==null&&(N(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),N(null))}}function Fe(e,r,n,i,g,p){{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(g);T?f+=T:f+=ke();var R;e===null?R="null":ne(e)?R="array":e!==void 0&&e.$$typeof===u?(R="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):R=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",R,f)}var _=br(e,r,n,g,p);if(_==null)return _;if(d){var P=r.children;if(P!==void 0)if(i)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===s?Tr(_):wr(_),_}}function Or(e,r,n){return Fe(e,r,n,!0)}function Sr(e,r,n){return Fe(e,r,n,!1)}var jr=Sr,Pr=Or;Y.Fragment=s,Y.jsx=jr,Y.jsxs=Pr}()),Y}process.env.NODE_ENV==="production"?$.exports=Le():$.exports=Me();var k=$.exports;const z=E.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ne=({axios:a,children:u,translate:o,useAuth:s,Outlet:c,Navigate:v,useLocation:m,useGoogleTagManager:t})=>{const l=E.useMemo(()=>({axios:a,Navigate:v,Outlet:c,translate:o,useAuth:s,useGoogleTagManager:t,useLocation:m}),[v,c,a,o,s,t,m]);return k.jsx(z.Provider,{value:l,children:u})},G=a=>`RequireAuth require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:a,loginPath:u="/login",localStorageKey:o="user",redirect401Path:s="/login",...c})=>{var I,L,A,C;const{axios:v=c.axios,useLocation:m=c.useLocation,useAuth:t=c.useAuth,Outlet:l=c.Outlet,Navigate:y=c.Navigate}=E.useContext(z);if(t===void 0)throw new Error(G("useAuth"));if(m===void 0)throw new Error(G("useLocation"));if(l===void 0)throw new Error(G("Outlet"));if(y===void 0)throw new Error(G("Navigate"));const[h,O]=E.useState(null),{isLogged:j}=t(),S=m(),F=E.useRef(!1);return E.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(o),O(s)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,o,s]),j&&!h?k.jsx(E.Suspense,{fallback:a,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)===u?k.jsx(y,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(l,{})}):k.jsx(y,{to:u,state:{from:S},replace:!0})},Q=a=>`GTMSendPageView require « ${a} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ve=({...a})=>{const{useLocation:u=a.useLocation,Outlet:o=a.Outlet,useGoogleTagManager:s=a.useGoogleTagManager}=E.useContext(z);if(u===void 0)throw new Error(Q("useLocation"));if(o===void 0)throw new Error(Q("Outlet"));if(s===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:c}=u(),{sendEvent:v}=s();return E.useEffect(()=>{v({event:"pageView",pathname:c})},[c,v]),k.jsx(o,{})},Ye=({axios:a,baseURL:u,tokenTypeKey:o="tokenType",userLocalStorageKey:s="user",tokenKey:c="accessToken",postContentType:v="application/json"})=>{if(!a.defaults)return null;const m=localStorage.getItem(s),t=m?JSON.parse(m):null,l=t!=null&&t[o]?t[o]:null,y=t!=null&&t[c]?t[c]:null,h=m?`${l} ${y}`:null;return a.defaults.baseURL=u,a.defaults.headers.post["Content-Type"]=v,h&&(a.defaults.headers.common.Authorization=h),null},ze=({i18n:a,debug:u,initReactI18next:o,resources:s,LanguageDetector:c})=>(a!=null&&a.isInitialized||(a.use(c).use(o).init({debug:u,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:s,returnNull:!1}).then(()=>{document.documentElement.lang!==a.resolvedLanguage&&a.resolvedLanguage&&document.documentElement.setAttribute("lang",a.resolvedLanguage)}),a.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ue=({dsn:a,sentry:u,integrations:o,tracesSampleRate:s,routingInstrumentationDependencies:c,replaysSessionSampleRate:v,replaysOnErrorSampleRate:m,tracePropagationTargets:t,ignoreErrors:l,debug:y})=>(u.isInitialized()||(y||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&u.init({debug:y,dsn:a,ignoreErrors:l||[/Failed to fetch dynamically imported module/],integrations:[new u.BrowserTracing({routingInstrumentation:u.reactRouterV6Instrumentation(c.useEffect,c.useLocation,c.useNavigationType,c.createRoutesFromChildren,c.matchRoutes)}),u.replayIntegration(),...o||[]],replaysOnErrorSampleRate:m||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:t,tracesSampleRate:s||1}),null),Be=({IMaskMixin:a,...u})=>{const o=E.useMemo(()=>a(({TextField:s,...c})=>k.jsx(s,{...c})),[a]);return k.jsx(o,{...u})},Ge=({mapbox:a,accessToken:u})=>(a&&u&&(a.accessToken=u),null),Je=({children:a,defaultOptions:u,QueryClient:o,QueryClientProvider:s})=>{const c=new o({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...u}}});return k.jsx(s,{client:c,children:a})},Xe=a=>{const{unknownErrorTranslationKey:u="error.unknownError"}=a||{},{translate:o=a==null?void 0:a.translate}=E.useContext(z),s=o?o(u):"Unknown error",c=E.useCallback(m=>{var l,y,h,O,j,S,F,I,L;const{response:t}=m||{};return t!=null&&t.reason?String(t.reason):(l=t==null?void 0:t.data)!=null&&l.reason?String(t.data.reason):(y=t==null?void 0:t.data)!=null&&y.message?String(t.data.message):(O=(h=t==null?void 0:t.data)==null?void 0:h.detail)!=null&&O.length&&Array.isArray((j=t==null?void 0:t.data)==null?void 0:j.detail)&&((F=(S=t==null?void 0:t.data)==null?void 0:S.detail[0])!=null&&F.msg)&&typeof((L=(I=t==null?void 0:t.data)==null?void 0:I.detail[0])==null?void 0:L.msg)=="string"?String(t.data.detail[0].msg):s},[s]),v=E.useCallback(m=>{var l,y,h;const{response:t}=m||{};return o&&(t!=null&&t.error_code)?o(t==null?void 0:t.error_code):o&&((l=t==null?void 0:t.data)!=null&&l.error_code)?o((y=t==null?void 0:t.data)==null?void 0:y.error_code):t!=null&&t.error_code?String(t==null?void 0:t.error_code):(h=t==null?void 0:t.data)!=null&&h.error_code?String(t.data.error_code):s},[s,o]);return{printError:c,printErrorCode:v}},He=({data:a,fetchNextPage:u,isFetchingNextPage:o,isInitialLoading:s,isLoading:c,enabled:v=!0})=>{const m=E.useCallback(async l=>{o||!v||await u({pageParam:(l==null?void 0:l.pageParam)||l.visibleRowsCount})},[v,u,o]),t=E.useMemo(()=>{if(a)return a.pages.reduce((l,y)=>[...l,...y],[])},[a]);return{fetchNextPageOnRowsScrollEnd:m,isLoading:o||c,loadingVariant:s?"skeleton":"linear",rows:t}},Ke=a=>{const u=E.useCallback(({tokenType:s,accessToken:c})=>{a.defaults.headers.common.Authorization=`${s} ${c}`},[a.defaults.headers.common]);return{clearAuthenticationToken:E.useCallback(()=>{a.defaults.headers.common.Authorization=null},[a.defaults.headers.common]),setAuthenticationToken:u}},Ze=a=>a.charAt(0).toUpperCase()+a.slice(1).toLowerCase(),qe=a=>{const s=a.split("/").filter(c=>c.length>0).map(c=>c.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")).join("");return s.charAt(0).toLowerCase()+s.slice(1)},$e=(a,u,o)=>{const s=qe(u),c=Ze(o);return`${s}${c}`},Qe=a=>{if(a)return(a==null?void 0:a.reduce((u,o)=>(u[o]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},u),{}))||{}},er=a=>{const{input:u="./openapi.json",operationsToGenerateInfiniteQueryHook:o=void 0}=a||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:u,output:{client:"react-query",mode:"tags-split",override:{header:s=>["Generated by orval 🍺",...s.title?[s.title]:[],...s.description?[s.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:$e,...(o==null?void 0:o.length)&&{operations:Qe(o)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};b.AxiosConfig=Ye,b.GTMSendPageView=Ve,b.I18nConfig=ze,b.InjectDependenciesContext=z,b.InjectDependenciesProvider=Ne,b.MapBoxConfig=Ge,b.MaskTextField=Be,b.QueryClientConfigProvider=Je,b.RequireAuth=We,b.SentryConfig=Ue,b.getOrvalConfig=er,b.useAuth=Ke,b.useInfiniteDataGrid=He,b.useResponseError=Xe,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tracktor/shared-module",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"types": "./dist/main.d.ts",
|
|
7
7
|
"main": "./dist/main.umd.cjs",
|
|
8
8
|
"module": "./dist/main.js",
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": ">=20 <
|
|
10
|
+
"node": ">=20 <22"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"dist"
|