@tracktor/shared-module 2.4.1 → 2.4.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/main.js +202 -182
- package/dist/main.umd.cjs +8 -8
- package/dist/utils/error/handleImportModuleError.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Ye, { createContext as gt, useMemo as fe, useContext as
|
|
2
|
-
var le = { exports: {} },
|
|
1
|
+
import Ye, { createContext as gt, useMemo as fe, useContext as D, useState as We, useRef as mt, useEffect as V, Suspense as ht, useCallback as te } from "react";
|
|
2
|
+
var le = { exports: {} }, B = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -11,17 +11,17 @@ var le = { exports: {} }, G = {};
|
|
|
11
11
|
*/
|
|
12
12
|
var Le;
|
|
13
13
|
function yt() {
|
|
14
|
-
if (Le) return
|
|
14
|
+
if (Le) return B;
|
|
15
15
|
Le = 1;
|
|
16
|
-
var t = Ye, n = Symbol.for("react.element"), o = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty,
|
|
16
|
+
var t = Ye, n = Symbol.for("react.element"), o = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
17
|
function l(d, c, g) {
|
|
18
18
|
var y, w = {}, p = null, u = null;
|
|
19
19
|
g !== void 0 && (p = "" + g), c.key !== void 0 && (p = "" + c.key), c.ref !== void 0 && (u = c.ref);
|
|
20
20
|
for (y in c) s.call(c, y) && !f.hasOwnProperty(y) && (w[y] = c[y]);
|
|
21
21
|
if (d && d.defaultProps) for (y in c = d.defaultProps, c) w[y] === void 0 && (w[y] = c[y]);
|
|
22
|
-
return { $$typeof: n, type: d, key: p, ref: u, props: w, _owner:
|
|
22
|
+
return { $$typeof: n, type: d, key: p, ref: u, props: w, _owner: a.current };
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return B.Fragment = o, B.jsx = l, B.jsxs = l, B;
|
|
25
25
|
}
|
|
26
26
|
var Q = {};
|
|
27
27
|
/**
|
|
@@ -36,26 +36,26 @@ var Q = {};
|
|
|
36
36
|
var Ne;
|
|
37
37
|
function Et() {
|
|
38
38
|
return Ne || (Ne = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
-
var t = Ye, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"),
|
|
40
|
-
function
|
|
39
|
+
var t = Ye, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), d = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), u = Symbol.for("react.offscreen"), S = Symbol.iterator, T = "@@iterator";
|
|
40
|
+
function j(e) {
|
|
41
41
|
if (e === null || typeof e != "object")
|
|
42
42
|
return null;
|
|
43
|
-
var r =
|
|
43
|
+
var r = S && e[S] || e[T];
|
|
44
44
|
return typeof r == "function" ? r : null;
|
|
45
45
|
}
|
|
46
46
|
var k = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
47
|
function _(e) {
|
|
48
48
|
{
|
|
49
|
-
for (var r = arguments.length,
|
|
50
|
-
|
|
51
|
-
L("error", e,
|
|
49
|
+
for (var r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), v = 1; v < r; v++)
|
|
50
|
+
i[v - 1] = arguments[v];
|
|
51
|
+
L("error", e, i);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function L(e, r,
|
|
54
|
+
function L(e, r, i) {
|
|
55
55
|
{
|
|
56
56
|
var v = k.ReactDebugCurrentFrame, E = v.getStackAddendum();
|
|
57
|
-
E !== "" && (r += "%s",
|
|
58
|
-
var R =
|
|
57
|
+
E !== "" && (r += "%s", i = i.concat([E]));
|
|
58
|
+
var R = i.map(function(h) {
|
|
59
59
|
return String(h);
|
|
60
60
|
});
|
|
61
61
|
R.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, R);
|
|
@@ -64,23 +64,23 @@ function Et() {
|
|
|
64
64
|
var N = !1, Y = !1, b = !1, de = !1, ve = !1, U;
|
|
65
65
|
U = Symbol.for("react.module.reference");
|
|
66
66
|
function ze(e) {
|
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e === s || e === f || ve || e ===
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === s || e === f || ve || e === a || e === g || e === y || de || e === u || N || Y || b || typeof e == "object" && e !== null && (e.$$typeof === p || e.$$typeof === w || e.$$typeof === l || e.$$typeof === d || e.$$typeof === c || // This needs to include all possible module reference object
|
|
68
68
|
// types supported by any Flight configuration anywhere since
|
|
69
69
|
// we don't know which Flight build this will end up being used
|
|
70
70
|
// with.
|
|
71
71
|
e.$$typeof === U || e.getModuleId !== void 0));
|
|
72
72
|
}
|
|
73
|
-
function Me(e, r,
|
|
73
|
+
function Me(e, r, i) {
|
|
74
74
|
var v = e.displayName;
|
|
75
75
|
if (v)
|
|
76
76
|
return v;
|
|
77
77
|
var E = r.displayName || r.name || "";
|
|
78
|
-
return E !== "" ?
|
|
78
|
+
return E !== "" ? i + "(" + E + ")" : i;
|
|
79
79
|
}
|
|
80
80
|
function ge(e) {
|
|
81
81
|
return e.displayName || "Context";
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function I(e) {
|
|
84
84
|
if (e == null)
|
|
85
85
|
return null;
|
|
86
86
|
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")
|
|
@@ -94,7 +94,7 @@ function Et() {
|
|
|
94
94
|
return "Portal";
|
|
95
95
|
case f:
|
|
96
96
|
return "Profiler";
|
|
97
|
-
case
|
|
97
|
+
case a:
|
|
98
98
|
return "StrictMode";
|
|
99
99
|
case g:
|
|
100
100
|
return "Suspense";
|
|
@@ -107,17 +107,17 @@ function Et() {
|
|
|
107
107
|
var r = e;
|
|
108
108
|
return ge(r) + ".Consumer";
|
|
109
109
|
case l:
|
|
110
|
-
var
|
|
111
|
-
return ge(
|
|
110
|
+
var i = e;
|
|
111
|
+
return ge(i._context) + ".Provider";
|
|
112
112
|
case c:
|
|
113
113
|
return Me(e, e.render, "ForwardRef");
|
|
114
114
|
case w:
|
|
115
115
|
var v = e.displayName || null;
|
|
116
|
-
return v !== null ? v :
|
|
116
|
+
return v !== null ? v : I(e.type) || "Memo";
|
|
117
117
|
case p: {
|
|
118
118
|
var E = e, R = E._payload, h = E._init;
|
|
119
119
|
try {
|
|
120
|
-
return
|
|
120
|
+
return I(h(R));
|
|
121
121
|
} catch {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
@@ -125,13 +125,13 @@ function Et() {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
var W = Object.assign,
|
|
128
|
+
var W = Object.assign, G = 0, me, he, ye, Ee, Re, pe, we;
|
|
129
129
|
function _e() {
|
|
130
130
|
}
|
|
131
131
|
_e.__reactDisabledLog = !0;
|
|
132
132
|
function Ve() {
|
|
133
133
|
{
|
|
134
|
-
if (
|
|
134
|
+
if (G === 0) {
|
|
135
135
|
me = console.log, he = console.info, ye = console.warn, Ee = console.error, Re = console.group, pe = console.groupCollapsed, we = console.groupEnd;
|
|
136
136
|
var e = {
|
|
137
137
|
configurable: !0,
|
|
@@ -149,12 +149,12 @@ function Et() {
|
|
|
149
149
|
groupEnd: e
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
G++;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
function Ue() {
|
|
156
156
|
{
|
|
157
|
-
if (
|
|
157
|
+
if (G--, G === 0) {
|
|
158
158
|
var e = {
|
|
159
159
|
configurable: !0,
|
|
160
160
|
enumerable: !0,
|
|
@@ -184,11 +184,11 @@ function Et() {
|
|
|
184
184
|
})
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
G < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
var re = k.ReactCurrentDispatcher, ne;
|
|
191
|
-
function J(e, r,
|
|
191
|
+
function J(e, r, i) {
|
|
192
192
|
{
|
|
193
193
|
if (ne === void 0)
|
|
194
194
|
try {
|
|
@@ -203,16 +203,16 @@ function Et() {
|
|
|
203
203
|
}
|
|
204
204
|
var oe = !1, K;
|
|
205
205
|
{
|
|
206
|
-
var
|
|
207
|
-
K = new
|
|
206
|
+
var Ge = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
K = new Ge();
|
|
208
208
|
}
|
|
209
209
|
function Ce(e, r) {
|
|
210
210
|
if (!e || oe)
|
|
211
211
|
return "";
|
|
212
212
|
{
|
|
213
|
-
var
|
|
214
|
-
if (
|
|
215
|
-
return
|
|
213
|
+
var i = K.get(e);
|
|
214
|
+
if (i !== void 0)
|
|
215
|
+
return i;
|
|
216
216
|
}
|
|
217
217
|
var v;
|
|
218
218
|
oe = !0;
|
|
@@ -255,14 +255,14 @@ function Et() {
|
|
|
255
255
|
} catch ($) {
|
|
256
256
|
if ($ && v && typeof $.stack == "string") {
|
|
257
257
|
for (var m = $.stack.split(`
|
|
258
|
-
`),
|
|
259
|
-
`), C = m.length - 1, P =
|
|
258
|
+
`), x = v.stack.split(`
|
|
259
|
+
`), C = m.length - 1, P = x.length - 1; C >= 1 && P >= 0 && m[C] !== x[P]; )
|
|
260
260
|
P--;
|
|
261
261
|
for (; C >= 1 && P >= 0; C--, P--)
|
|
262
|
-
if (m[C] !==
|
|
262
|
+
if (m[C] !== x[P]) {
|
|
263
263
|
if (C !== 1 || P !== 1)
|
|
264
264
|
do
|
|
265
|
-
if (C--, P--, P < 0 || m[C] !==
|
|
265
|
+
if (C--, P--, P < 0 || m[C] !== x[P]) {
|
|
266
266
|
var O = `
|
|
267
267
|
` + m[C].replace(" at new ", " at ");
|
|
268
268
|
return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && K.set(e, O), O;
|
|
@@ -277,18 +277,18 @@ function Et() {
|
|
|
277
277
|
var M = e ? e.displayName || e.name : "", Fe = M ? J(M) : "";
|
|
278
278
|
return typeof e == "function" && K.set(e, Fe), Fe;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function qe(e, r, i) {
|
|
281
281
|
return Ce(e, !1);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function Be(e) {
|
|
284
284
|
var r = e.prototype;
|
|
285
285
|
return !!(r && r.isReactComponent);
|
|
286
286
|
}
|
|
287
|
-
function X(e, r,
|
|
287
|
+
function X(e, r, i) {
|
|
288
288
|
if (e == null)
|
|
289
289
|
return "";
|
|
290
290
|
if (typeof e == "function")
|
|
291
|
-
return Ce(e,
|
|
291
|
+
return Ce(e, Be(e));
|
|
292
292
|
if (typeof e == "string")
|
|
293
293
|
return J(e);
|
|
294
294
|
switch (e) {
|
|
@@ -300,13 +300,13 @@ function Et() {
|
|
|
300
300
|
if (typeof e == "object")
|
|
301
301
|
switch (e.$$typeof) {
|
|
302
302
|
case c:
|
|
303
|
-
return
|
|
303
|
+
return qe(e.render);
|
|
304
304
|
case w:
|
|
305
|
-
return X(e.type, r,
|
|
305
|
+
return X(e.type, r, i);
|
|
306
306
|
case p: {
|
|
307
307
|
var v = e, E = v._payload, R = v._init;
|
|
308
308
|
try {
|
|
309
|
-
return X(R(E), r,
|
|
309
|
+
return X(R(E), r, i);
|
|
310
310
|
} catch {
|
|
311
311
|
}
|
|
312
312
|
}
|
|
@@ -316,12 +316,12 @@ function Et() {
|
|
|
316
316
|
var H = Object.prototype.hasOwnProperty, be = {}, Pe = k.ReactDebugCurrentFrame;
|
|
317
317
|
function Z(e) {
|
|
318
318
|
if (e) {
|
|
319
|
-
var r = e._owner,
|
|
320
|
-
Pe.setExtraStackFrame(
|
|
319
|
+
var r = e._owner, i = X(e.type, e._source, r ? r.type : null);
|
|
320
|
+
Pe.setExtraStackFrame(i);
|
|
321
321
|
} else
|
|
322
322
|
Pe.setExtraStackFrame(null);
|
|
323
323
|
}
|
|
324
|
-
function Qe(e, r,
|
|
324
|
+
function Qe(e, r, i, v, E) {
|
|
325
325
|
{
|
|
326
326
|
var R = Function.call.bind(H);
|
|
327
327
|
for (var h in e)
|
|
@@ -329,14 +329,14 @@ function Et() {
|
|
|
329
329
|
var m = void 0;
|
|
330
330
|
try {
|
|
331
331
|
if (typeof e[h] != "function") {
|
|
332
|
-
var
|
|
333
|
-
throw
|
|
332
|
+
var x = Error((v || "React class") + ": " + i + " type `" + h + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[h] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw x.name = "Invariant Violation", x;
|
|
334
334
|
}
|
|
335
|
-
m = e[h](r, h, v,
|
|
335
|
+
m = e[h](r, h, v, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
336
|
} catch (C) {
|
|
337
337
|
m = C;
|
|
338
338
|
}
|
|
339
|
-
m && !(m instanceof Error) && (Z(E), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", v || "React class",
|
|
339
|
+
m && !(m instanceof Error) && (Z(E), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", v || "React class", i, h, typeof m), Z(null)), m instanceof Error && !(m.message in be) && (be[m.message] = !0, Z(E), _("Failed %s type: %s", i, m.message), Z(null));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
@@ -346,30 +346,30 @@ function Et() {
|
|
|
346
346
|
}
|
|
347
347
|
function Ke(e) {
|
|
348
348
|
{
|
|
349
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag,
|
|
350
|
-
return
|
|
349
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, i = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
350
|
+
return i;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
function Xe(e) {
|
|
354
354
|
try {
|
|
355
|
-
return
|
|
355
|
+
return Se(e), !1;
|
|
356
356
|
} catch {
|
|
357
357
|
return !0;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function Se(e) {
|
|
361
361
|
return "" + e;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function je(e) {
|
|
364
364
|
if (Xe(e))
|
|
365
|
-
return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)),
|
|
365
|
+
return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), Se(e);
|
|
366
366
|
}
|
|
367
|
-
var
|
|
367
|
+
var q = k.ReactCurrentOwner, He = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
371
371
|
__source: !0
|
|
372
|
-
},
|
|
372
|
+
}, xe, Te, ie;
|
|
373
373
|
ie = {};
|
|
374
374
|
function Ze(e) {
|
|
375
375
|
if (H.call(e, "ref")) {
|
|
@@ -388,41 +388,41 @@ function Et() {
|
|
|
388
388
|
return e.key !== void 0;
|
|
389
389
|
}
|
|
390
390
|
function tt(e, r) {
|
|
391
|
-
if (typeof e.ref == "string" &&
|
|
392
|
-
var
|
|
393
|
-
ie[
|
|
391
|
+
if (typeof e.ref == "string" && q.current && r && q.current.stateNode !== r) {
|
|
392
|
+
var i = I(q.current.type);
|
|
393
|
+
ie[i] || (_('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', I(q.current.type), e.ref), ie[i] = !0);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
function rt(e, r) {
|
|
397
397
|
{
|
|
398
|
-
var
|
|
399
|
-
|
|
398
|
+
var i = function() {
|
|
399
|
+
xe || (xe = !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));
|
|
400
400
|
};
|
|
401
|
-
|
|
402
|
-
get:
|
|
401
|
+
i.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
402
|
+
get: i,
|
|
403
403
|
configurable: !0
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
function nt(e, r) {
|
|
408
408
|
{
|
|
409
|
-
var
|
|
409
|
+
var i = function() {
|
|
410
410
|
Te || (Te = !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));
|
|
411
411
|
};
|
|
412
|
-
|
|
413
|
-
get:
|
|
412
|
+
i.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
413
|
+
get: i,
|
|
414
414
|
configurable: !0
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
var ot = function(e, r,
|
|
418
|
+
var ot = function(e, r, i, v, E, R, h) {
|
|
419
419
|
var m = {
|
|
420
420
|
// This tag allows us to uniquely identify this as a React Element
|
|
421
421
|
$$typeof: n,
|
|
422
422
|
// Built-in properties that belong on the element
|
|
423
423
|
type: e,
|
|
424
424
|
key: r,
|
|
425
|
-
ref:
|
|
425
|
+
ref: i,
|
|
426
426
|
props: h,
|
|
427
427
|
// Record the component responsible for creating this element.
|
|
428
428
|
_owner: R
|
|
@@ -444,10 +444,10 @@ function Et() {
|
|
|
444
444
|
value: E
|
|
445
445
|
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
446
446
|
};
|
|
447
|
-
function at(e, r,
|
|
447
|
+
function at(e, r, i, v, E) {
|
|
448
448
|
{
|
|
449
|
-
var R, h = {}, m = null,
|
|
450
|
-
|
|
449
|
+
var R, h = {}, m = null, x = null;
|
|
450
|
+
i !== void 0 && (je(i), m = "" + i), et(r) && (je(r.key), m = "" + r.key), Ze(r) && (x = r.ref, tt(r, E));
|
|
451
451
|
for (R in r)
|
|
452
452
|
H.call(r, R) && !He.hasOwnProperty(R) && (h[R] = r[R]);
|
|
453
453
|
if (e && e.defaultProps) {
|
|
@@ -455,18 +455,18 @@ function Et() {
|
|
|
455
455
|
for (R in C)
|
|
456
456
|
h[R] === void 0 && (h[R] = C[R]);
|
|
457
457
|
}
|
|
458
|
-
if (m ||
|
|
458
|
+
if (m || x) {
|
|
459
459
|
var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
460
|
-
m && rt(h, P),
|
|
460
|
+
m && rt(h, P), x && nt(h, P);
|
|
461
461
|
}
|
|
462
|
-
return ot(e, m,
|
|
462
|
+
return ot(e, m, x, E, v, q.current, h);
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
465
|
var se = k.ReactCurrentOwner, Oe = k.ReactDebugCurrentFrame;
|
|
466
466
|
function z(e) {
|
|
467
467
|
if (e) {
|
|
468
|
-
var r = e._owner,
|
|
469
|
-
Oe.setExtraStackFrame(
|
|
468
|
+
var r = e._owner, i = X(e.type, e._source, r ? r.type : null);
|
|
469
|
+
Oe.setExtraStackFrame(i);
|
|
470
470
|
} else
|
|
471
471
|
Oe.setExtraStackFrame(null);
|
|
472
472
|
}
|
|
@@ -478,7 +478,7 @@ function Et() {
|
|
|
478
478
|
function Ae() {
|
|
479
479
|
{
|
|
480
480
|
if (se.current) {
|
|
481
|
-
var e =
|
|
481
|
+
var e = I(se.current.type);
|
|
482
482
|
if (e)
|
|
483
483
|
return `
|
|
484
484
|
|
|
@@ -495,43 +495,43 @@ Check the render method of \`` + e + "`.";
|
|
|
495
495
|
{
|
|
496
496
|
var r = Ae();
|
|
497
497
|
if (!r) {
|
|
498
|
-
var
|
|
499
|
-
|
|
498
|
+
var i = typeof e == "string" ? e : e.displayName || e.name;
|
|
499
|
+
i && (r = `
|
|
500
500
|
|
|
501
|
-
Check the top-level render call using <` +
|
|
501
|
+
Check the top-level render call using <` + i + ">.");
|
|
502
502
|
}
|
|
503
503
|
return r;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function De(e, r) {
|
|
507
507
|
{
|
|
508
508
|
if (!e._store || e._store.validated || e.key != null)
|
|
509
509
|
return;
|
|
510
510
|
e._store.validated = !0;
|
|
511
|
-
var
|
|
512
|
-
if (ke[
|
|
511
|
+
var i = st(r);
|
|
512
|
+
if (ke[i])
|
|
513
513
|
return;
|
|
514
|
-
ke[
|
|
514
|
+
ke[i] = !0;
|
|
515
515
|
var v = "";
|
|
516
|
-
e && e._owner && e._owner !== se.current && (v = " It was passed a child from " +
|
|
516
|
+
e && e._owner && e._owner !== se.current && (v = " It was passed a child from " + I(e._owner.type) + "."), z(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, v), z(null);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function Ie(e, r) {
|
|
520
520
|
{
|
|
521
521
|
if (typeof e != "object")
|
|
522
522
|
return;
|
|
523
523
|
if (ae(e))
|
|
524
|
-
for (var
|
|
525
|
-
var v = e[
|
|
526
|
-
ce(v) &&
|
|
524
|
+
for (var i = 0; i < e.length; i++) {
|
|
525
|
+
var v = e[i];
|
|
526
|
+
ce(v) && De(v, r);
|
|
527
527
|
}
|
|
528
528
|
else if (ce(e))
|
|
529
529
|
e._store && (e._store.validated = !0);
|
|
530
530
|
else if (e) {
|
|
531
|
-
var E =
|
|
531
|
+
var E = j(e);
|
|
532
532
|
if (typeof E == "function" && E !== e.entries)
|
|
533
533
|
for (var R = E.call(e), h; !(h = R.next()).done; )
|
|
534
|
-
ce(h.value) &&
|
|
534
|
+
ce(h.value) && De(h.value, r);
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
537
|
}
|
|
@@ -540,21 +540,21 @@ Check the top-level render call using <` + a + ">.");
|
|
|
540
540
|
var r = e.type;
|
|
541
541
|
if (r == null || typeof r == "string")
|
|
542
542
|
return;
|
|
543
|
-
var
|
|
543
|
+
var i;
|
|
544
544
|
if (typeof r == "function")
|
|
545
|
-
|
|
545
|
+
i = r.propTypes;
|
|
546
546
|
else if (typeof r == "object" && (r.$$typeof === c || // Note: Memo only checks outer props here.
|
|
547
547
|
// Inner props are checked in the reconciler.
|
|
548
548
|
r.$$typeof === w))
|
|
549
|
-
|
|
549
|
+
i = r.propTypes;
|
|
550
550
|
else
|
|
551
551
|
return;
|
|
552
|
-
if (
|
|
553
|
-
var v =
|
|
554
|
-
Qe(
|
|
552
|
+
if (i) {
|
|
553
|
+
var v = I(r);
|
|
554
|
+
Qe(i, e.props, "prop", v, e);
|
|
555
555
|
} else if (r.PropTypes !== void 0 && !ue) {
|
|
556
556
|
ue = !0;
|
|
557
|
-
var E =
|
|
557
|
+
var E = I(r);
|
|
558
558
|
_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", E || "Unknown");
|
|
559
559
|
}
|
|
560
560
|
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
@@ -562,8 +562,8 @@ Check the top-level render call using <` + a + ">.");
|
|
|
562
562
|
}
|
|
563
563
|
function ct(e) {
|
|
564
564
|
{
|
|
565
|
-
for (var r = Object.keys(e.props),
|
|
566
|
-
var v = r[
|
|
565
|
+
for (var r = Object.keys(e.props), i = 0; i < r.length; i++) {
|
|
566
|
+
var v = r[i];
|
|
567
567
|
if (v !== "children" && v !== "key") {
|
|
568
568
|
z(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), z(null);
|
|
569
569
|
break;
|
|
@@ -572,18 +572,18 @@ Check the top-level render call using <` + a + ">.");
|
|
|
572
572
|
e.ref !== null && (z(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), z(null));
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
-
function $e(e, r,
|
|
575
|
+
function $e(e, r, i, v, E, R) {
|
|
576
576
|
{
|
|
577
577
|
var h = ze(e);
|
|
578
578
|
if (!h) {
|
|
579
579
|
var m = "";
|
|
580
580
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (m += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
581
|
-
var
|
|
582
|
-
|
|
581
|
+
var x = it();
|
|
582
|
+
x ? m += x : m += Ae();
|
|
583
583
|
var C;
|
|
584
|
-
e === null ? C = "null" : ae(e) ? C = "array" : e !== void 0 && e.$$typeof === n ? (C = "<" + (
|
|
584
|
+
e === null ? C = "null" : ae(e) ? C = "array" : e !== void 0 && e.$$typeof === n ? (C = "<" + (I(e.type) || "Unknown") + " />", m = " Did you accidentally export a JSX literal instead of a component?") : C = 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", C, m);
|
|
585
585
|
}
|
|
586
|
-
var P = at(e, r,
|
|
586
|
+
var P = at(e, r, i, E, R);
|
|
587
587
|
if (P == null)
|
|
588
588
|
return P;
|
|
589
589
|
if (h) {
|
|
@@ -592,21 +592,21 @@ Check the top-level render call using <` + a + ">.");
|
|
|
592
592
|
if (v)
|
|
593
593
|
if (ae(O)) {
|
|
594
594
|
for (var M = 0; M < O.length; M++)
|
|
595
|
-
|
|
595
|
+
Ie(O[M], e);
|
|
596
596
|
Object.freeze && Object.freeze(O);
|
|
597
597
|
} else
|
|
598
598
|
_("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
599
599
|
else
|
|
600
|
-
|
|
600
|
+
Ie(O, e);
|
|
601
601
|
}
|
|
602
602
|
return e === s ? ct(P) : ut(P), P;
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
function lt(e, r,
|
|
606
|
-
return $e(e, r,
|
|
605
|
+
function lt(e, r, i) {
|
|
606
|
+
return $e(e, r, i, !0);
|
|
607
607
|
}
|
|
608
|
-
function ft(e, r,
|
|
609
|
-
return $e(e, r,
|
|
608
|
+
function ft(e, r, i) {
|
|
609
|
+
return $e(e, r, i, !1);
|
|
610
610
|
}
|
|
611
611
|
var dt = ft, vt = lt;
|
|
612
612
|
Q.Fragment = s, Q.jsx = dt, Q.jsxs = vt;
|
|
@@ -628,32 +628,32 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
628
628
|
isLogged: n,
|
|
629
629
|
loginPath: o = "/login",
|
|
630
630
|
localStorageKey: s = "user",
|
|
631
|
-
redirect401Path:
|
|
631
|
+
redirect401Path: a = "/login",
|
|
632
632
|
...f
|
|
633
633
|
}) => {
|
|
634
634
|
var _, L, N, Y;
|
|
635
|
-
const { libraries: l } =
|
|
635
|
+
const { libraries: l } = D(A), d = (f == null ? void 0 : f.reactRouter) || (l == null ? void 0 : l.reactRouter), c = (f == null ? void 0 : f.axios) || (l == null ? void 0 : l.axios);
|
|
636
636
|
if (!d)
|
|
637
637
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
638
|
-
const [g, y] = We(null), { useLocation: w, Navigate: p, Outlet: u } = d,
|
|
638
|
+
const [g, y] = We(null), { useLocation: w, Navigate: p, Outlet: u } = d, S = w(), T = mt(!1), j = typeof n == "function" ? n() : !!n, k = typeof j == "boolean" ? j : j == null ? void 0 : j.isLogged;
|
|
639
639
|
return V(() => {
|
|
640
640
|
T.current || (T.current = !0, c.interceptors.response.use(
|
|
641
641
|
(b) => b,
|
|
642
642
|
async (b) => {
|
|
643
643
|
var U;
|
|
644
|
-
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 && ((U = b == null ? void 0 : b.response) == null ? void 0 : U.status) === 401 && (c.defaults.headers.common.Authorization = null, localStorage.removeItem(s), y(
|
|
644
|
+
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 && ((U = b == null ? void 0 : b.response) == null ? void 0 : U.status) === 401 && (c.defaults.headers.common.Authorization = null, localStorage.removeItem(s), y(a)), Promise.reject(b);
|
|
645
645
|
}
|
|
646
646
|
));
|
|
647
|
-
}, [c.defaults.headers.common, c.interceptors.response, s,
|
|
648
|
-
},
|
|
649
|
-
const { libraries: o } =
|
|
647
|
+
}, [c.defaults.headers.common, c.interceptors.response, s, a]), k && !g ? /* @__PURE__ */ F.jsx(ht, { fallback: t, children: (L = (_ = S.state) == null ? void 0 : _.from) != null && L.state && ((Y = (N = S.state) == null ? void 0 : N.from) == null ? void 0 : Y.pathname) === o ? /* @__PURE__ */ F.jsx(p, { to: S.state.from.state.from.pathname + S.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ F.jsx(u, {}) }) : /* @__PURE__ */ F.jsx(p, { to: o + S.search, state: { from: S }, replace: !0 });
|
|
648
|
+
}, Dt = ({ data: t, ...n }) => {
|
|
649
|
+
const { libraries: o } = D(A), s = (n == null ? void 0 : n.reactRouter) || (o == null ? void 0 : o.reactRouter), a = (n == null ? void 0 : n.gtm) || (o == null ? void 0 : o.gtm);
|
|
650
650
|
if (!s)
|
|
651
651
|
throw new Error(
|
|
652
652
|
"React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView."
|
|
653
653
|
);
|
|
654
|
-
if (!
|
|
654
|
+
if (!a)
|
|
655
655
|
throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
|
|
656
|
-
const { useGoogleTagManager: f } =
|
|
656
|
+
const { useGoogleTagManager: f } = a, { useLocation: l, Outlet: d } = s, { pathname: c } = l(), { sendEvent: g } = f();
|
|
657
657
|
return V(() => {
|
|
658
658
|
g({
|
|
659
659
|
event: "pageView",
|
|
@@ -661,14 +661,14 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
661
661
|
...t
|
|
662
662
|
});
|
|
663
663
|
}, [t, c, g]), /* @__PURE__ */ F.jsx(d, {});
|
|
664
|
-
},
|
|
664
|
+
}, It = ({
|
|
665
665
|
tokenTypeKey: t = "tokenType",
|
|
666
666
|
userLocalStorageKey: n = "user",
|
|
667
667
|
tokenKey: o = "accessToken",
|
|
668
668
|
postContentType: s = "application/json",
|
|
669
|
-
...
|
|
669
|
+
...a
|
|
670
670
|
}) => {
|
|
671
|
-
const { apiURL: f =
|
|
671
|
+
const { apiURL: f = a.apiURL, libraries: l } = D(A), d = (a == null ? void 0 : a.axios) || (l == null ? void 0 : l.axios);
|
|
672
672
|
if (!d)
|
|
673
673
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
674
674
|
if (!(d != null && d.defaults))
|
|
@@ -676,8 +676,8 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
676
676
|
const c = localStorage.getItem(n), g = c ? JSON.parse(c) : null, y = g != null && g[t] ? g[t] : null, w = g != null && g[o] ? g[o] : null, p = c ? `${y} ${w}` : null;
|
|
677
677
|
return d.defaults.baseURL = f, d.defaults.headers.post["Content-Type"] = s, p && (d.defaults.headers.common.Authorization = p), null;
|
|
678
678
|
}, $t = ({ debug: t, resources: n, ...o }) => {
|
|
679
|
-
const { libraries: s } =
|
|
680
|
-
if (!
|
|
679
|
+
const { libraries: s } = D(A), a = (o == null ? void 0 : o.i18) || (s == null ? void 0 : s.i18), { i18next: f, initReactI18next: l, languageDetector: d } = a || {};
|
|
680
|
+
if (!a)
|
|
681
681
|
throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
682
682
|
return f != null && f.isInitialized || (f.use(d).use(l).init({
|
|
683
683
|
debug: t,
|
|
@@ -702,21 +702,21 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
702
702
|
integrations: n,
|
|
703
703
|
tracesSampleRate: o,
|
|
704
704
|
replaysSessionSampleRate: s,
|
|
705
|
-
replaysOnErrorSampleRate:
|
|
705
|
+
replaysOnErrorSampleRate: a,
|
|
706
706
|
tracePropagationTargets: f,
|
|
707
707
|
ignoreErrors: l,
|
|
708
708
|
debug: d,
|
|
709
709
|
environment: c,
|
|
710
710
|
...g
|
|
711
711
|
}) => {
|
|
712
|
-
const { libraries: y } =
|
|
712
|
+
const { libraries: y } = D(A), w = (g == null ? void 0 : g.sentry) || (y == null ? void 0 : y.sentry), p = (g == null ? void 0 : g.reactRouter) || (y == null ? void 0 : y.reactRouter);
|
|
713
713
|
if (!w)
|
|
714
714
|
throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
715
715
|
if (!p)
|
|
716
716
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
717
717
|
if (w.isInitialized())
|
|
718
718
|
return null;
|
|
719
|
-
const { createRoutesFromChildren: u, matchRoutes:
|
|
719
|
+
const { createRoutesFromChildren: u, matchRoutes: S, useLocation: T, useNavigationType: j } = p;
|
|
720
720
|
return (d || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && w.init({
|
|
721
721
|
debug: d,
|
|
722
722
|
dsn: t,
|
|
@@ -725,14 +725,14 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
725
725
|
integrations: [
|
|
726
726
|
w.reactRouterV6BrowserTracingIntegration({
|
|
727
727
|
createRoutesFromChildren: u,
|
|
728
|
-
matchRoutes:
|
|
728
|
+
matchRoutes: S,
|
|
729
729
|
useEffect: V,
|
|
730
730
|
useLocation: T,
|
|
731
|
-
useNavigationType:
|
|
731
|
+
useNavigationType: j
|
|
732
732
|
}),
|
|
733
733
|
...n || []
|
|
734
734
|
],
|
|
735
|
-
replaysOnErrorSampleRate:
|
|
735
|
+
replaysOnErrorSampleRate: a || 1,
|
|
736
736
|
replaysSessionSampleRate: s || 0.1,
|
|
737
737
|
tracePropagationTargets: f,
|
|
738
738
|
tracesSampleRate: o || 1
|
|
@@ -740,17 +740,17 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
740
740
|
}, Lt = ({ IMaskMixin: t, ...n }) => {
|
|
741
741
|
const o = fe(
|
|
742
742
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
743
|
-
() => t(({ TextField: s, ...
|
|
743
|
+
() => t(({ TextField: s, ...a }) => /* @__PURE__ */ F.jsx(s, { ...a })),
|
|
744
744
|
[t]
|
|
745
745
|
);
|
|
746
746
|
return /* @__PURE__ */ F.jsx(o, { ...n });
|
|
747
747
|
}, Nt = ({ accessToken: t, ...n }) => {
|
|
748
|
-
const { libraries: o } =
|
|
748
|
+
const { libraries: o } = D(A), s = (n == null ? void 0 : n.mapbox) || (o == null ? void 0 : o.mapbox);
|
|
749
749
|
if (!s)
|
|
750
750
|
throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
751
751
|
return t && (s.accessToken = t), null;
|
|
752
752
|
}, Yt = ({ language: t, ...n }) => {
|
|
753
|
-
const { libraries: o } =
|
|
753
|
+
const { libraries: o } = D(A), s = (n == null ? void 0 : n.dayjs) || (o == null ? void 0 : o.dayjs), a = (n == null ? void 0 : n.plugin) || (o == null ? void 0 : o.dayjsPlugin);
|
|
754
754
|
if (!s)
|
|
755
755
|
throw new Error(
|
|
756
756
|
"Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig."
|
|
@@ -759,11 +759,11 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
759
759
|
(async () => {
|
|
760
760
|
var d;
|
|
761
761
|
const l = t || ((d = navigator.language) == null ? void 0 : d.slice(0, 2)) || "en";
|
|
762
|
-
|
|
762
|
+
a && a.forEach((c) => {
|
|
763
763
|
c && s.extend(c);
|
|
764
764
|
}), await import("dayjs/locale/en"), await import("dayjs/locale/fr"), s.locale(l);
|
|
765
765
|
})().then();
|
|
766
|
-
}, [s,
|
|
766
|
+
}, [s, a, t]), null;
|
|
767
767
|
}, Rt = (t) => t && typeof t == "function", pt = (t) => t && typeof t == "function", Wt = ({
|
|
768
768
|
children: t,
|
|
769
769
|
defaultQueriesOptions: n,
|
|
@@ -771,7 +771,7 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
771
771
|
...s
|
|
772
772
|
}) => {
|
|
773
773
|
var c, g;
|
|
774
|
-
const { libraries:
|
|
774
|
+
const { libraries: a } = D(A), f = (s == null ? void 0 : s.QueryClient) || ((c = a == null ? void 0 : a.reactQuery) == null ? void 0 : c.QueryClient), l = (s == null ? void 0 : s.QueryClientProvider) || ((g = a == null ? void 0 : a.reactQuery) == null ? void 0 : g.QueryClientProvider);
|
|
775
775
|
if (!f)
|
|
776
776
|
throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
777
777
|
if (!l)
|
|
@@ -796,25 +796,25 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
796
796
|
return /* @__PURE__ */ F.jsx(l, { client: d, children: t });
|
|
797
797
|
}, zt = (t) => {
|
|
798
798
|
var g, y, w;
|
|
799
|
-
const { libraries: n } =
|
|
799
|
+
const { libraries: n } = D(A), o = (t == null ? void 0 : t.i18) || (n == null ? void 0 : n.i18), s = ((g = t == null ? void 0 : t.i18) == null ? void 0 : g.translateFunction) || ((y = n == null ? void 0 : n.i18) == null ? void 0 : y.translateFunction), a = ((w = o == null ? void 0 : o.i18next) == null ? void 0 : w.t) || s || ((p) => p), { unknownErrorTranslationKey: f = "error.unknownError" } = t || {}, l = a(f), d = te(
|
|
800
800
|
(p) => {
|
|
801
|
-
var
|
|
801
|
+
var S, T, j, k, _, L, N, Y, b;
|
|
802
802
|
const { response: u } = p || {};
|
|
803
|
-
return u != null && u.reason ? String(u.reason) : (
|
|
803
|
+
return u != null && u.reason ? String(u.reason) : (S = u == null ? void 0 : u.data) != null && S.reason ? String(u.data.reason) : (T = u == null ? void 0 : u.data) != null && T.message ? String(u.data.message) : (k = (j = u == null ? void 0 : u.data) == null ? void 0 : j.detail) != null && k.length && Array.isArray((_ = u == null ? void 0 : u.data) == null ? void 0 : _.detail) && ((N = (L = u == null ? void 0 : u.data) == null ? void 0 : L.detail[0]) != null && N.msg) && typeof ((b = (Y = u == null ? void 0 : u.data) == null ? void 0 : Y.detail[0]) == null ? void 0 : b.msg) == "string" ? String(u.data.detail[0].msg) : l;
|
|
804
804
|
},
|
|
805
805
|
[l]
|
|
806
806
|
);
|
|
807
807
|
return { getErrorCode: te((p) => {
|
|
808
|
-
var
|
|
808
|
+
var S, T, j;
|
|
809
809
|
const { response: u } = p || {};
|
|
810
|
-
return u != null && u.error_code ? String(u == null ? void 0 : u.error_code) : (
|
|
810
|
+
return u != null && u.error_code ? String(u == null ? void 0 : u.error_code) : (S = u == null ? void 0 : u.data) != null && S.error_code ? String((T = u == null ? void 0 : u.data) == null ? void 0 : T.error_code) : u != null && u.error_code ? String(u == null ? void 0 : u.error_code) : (j = u == null ? void 0 : u.data) != null && j.error_code ? String(u.data.error_code) : "unknown_error_code";
|
|
811
811
|
}, []), printError: d };
|
|
812
812
|
}, Mt = ({
|
|
813
813
|
data: t,
|
|
814
814
|
fetchNextPage: n,
|
|
815
815
|
isFetchingNextPage: o,
|
|
816
816
|
isInitialLoading: s,
|
|
817
|
-
isLoading:
|
|
817
|
+
isLoading: a,
|
|
818
818
|
enabled: f = !0
|
|
819
819
|
}) => {
|
|
820
820
|
const l = te(
|
|
@@ -828,15 +828,15 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
828
828
|
}, [t]);
|
|
829
829
|
return {
|
|
830
830
|
fetchNextPageOnRowsScrollEnd: l,
|
|
831
|
-
isLoading: o ||
|
|
831
|
+
isLoading: o || a,
|
|
832
832
|
loadingVariant: s ? "skeleton" : "linear",
|
|
833
833
|
rows: d
|
|
834
834
|
};
|
|
835
835
|
}, Vt = (t) => {
|
|
836
|
-
const { libraries: n } =
|
|
836
|
+
const { libraries: n } = D(A), o = (t == null ? void 0 : t.axios) || (n == null ? void 0 : n.axios), s = (t == null ? void 0 : t.localStorageKey) || "user";
|
|
837
837
|
if (!o)
|
|
838
838
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
|
|
839
|
-
const
|
|
839
|
+
const a = te(
|
|
840
840
|
({ tokenType: l, accessToken: d }) => {
|
|
841
841
|
o.defaults.headers.common.Authorization = `${l} ${d}`;
|
|
842
842
|
},
|
|
@@ -849,7 +849,7 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
849
849
|
if (c === s && d)
|
|
850
850
|
try {
|
|
851
851
|
const { accessToken: g, tokenType: y } = JSON.parse(d);
|
|
852
|
-
|
|
852
|
+
a({ accessToken: g, tokenType: y });
|
|
853
853
|
} catch (g) {
|
|
854
854
|
console.error("Failed to parse newValue from localStorage:", g);
|
|
855
855
|
}
|
|
@@ -857,9 +857,9 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
857
857
|
return window.addEventListener("storage", l), () => {
|
|
858
858
|
window.removeEventListener("storage", l);
|
|
859
859
|
};
|
|
860
|
-
}, [s,
|
|
860
|
+
}, [s, a]), {
|
|
861
861
|
clearAuthenticationToken: f,
|
|
862
|
-
setAuthenticationToken:
|
|
862
|
+
setAuthenticationToken: a
|
|
863
863
|
};
|
|
864
864
|
}, wt = ({ library: t, date: n, format: o = "ll" }) => t(n).format(o), _t = (t, n = "km") => {
|
|
865
865
|
const o = Number(t);
|
|
@@ -867,10 +867,10 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
867
867
|
}, Ct = (t) => t != null && t.startsWith("/") ? t != null && t.startsWith("/files") ? t : `/files${t}` : t != null && t.startsWith("files") ? `/${t}` : t != null && t.startsWith("files") ? `/${t}` : `/files/${t}`, bt = ({ path: t, size: n, apiURL: o }) => {
|
|
868
868
|
if (!t)
|
|
869
869
|
return "";
|
|
870
|
-
const s = Ct(t),
|
|
871
|
-
return typeof n == "number" && f ? `${
|
|
870
|
+
const s = Ct(t), a = `${o}${s}`, f = a.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
|
|
871
|
+
return typeof n == "number" && f ? `${a.replace("/files", `/thumbs/${n}`)}` : a;
|
|
872
872
|
}, Ut = (t) => {
|
|
873
|
-
const { apiURL: n, libraries: o } =
|
|
873
|
+
const { apiURL: n, libraries: o } = D(A), s = (t == null ? void 0 : t.dayjs) || (o == null ? void 0 : o.dayjs);
|
|
874
874
|
return {
|
|
875
875
|
dateAdapter: (l, d) => {
|
|
876
876
|
if (!s)
|
|
@@ -894,28 +894,28 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
894
894
|
});
|
|
895
895
|
}
|
|
896
896
|
};
|
|
897
|
-
}, ee = (t, n) => n === "short" ? t.split("-")[0] : t,
|
|
897
|
+
}, ee = (t, n) => n === "short" ? t.split("-")[0] : t, Gt = (t, n = "full") => {
|
|
898
898
|
const [o, s] = We(() => {
|
|
899
|
-
const
|
|
900
|
-
return t && "isInitialized" in t && t.isInitialized, ee(
|
|
899
|
+
const a = (t == null ? void 0 : t.language) || navigator.language;
|
|
900
|
+
return t && "isInitialized" in t && t.isInitialized, ee(a, n);
|
|
901
901
|
});
|
|
902
902
|
return V(() => {
|
|
903
903
|
var f;
|
|
904
904
|
t && "isInitialized" in t && t.isInitialized && t.language && s(ee(t.language, n));
|
|
905
|
-
const
|
|
905
|
+
const a = (l) => {
|
|
906
906
|
s(ee(l, n));
|
|
907
907
|
};
|
|
908
|
-
return (f = t == null ? void 0 : t.on) == null || f.call(t, "languageChanged",
|
|
908
|
+
return (f = t == null ? void 0 : t.on) == null || f.call(t, "languageChanged", a), () => {
|
|
909
909
|
var l;
|
|
910
|
-
(l = t == null ? void 0 : t.off) == null || l.call(t, "languageChanged",
|
|
910
|
+
(l = t == null ? void 0 : t.off) == null || l.call(t, "languageChanged", a);
|
|
911
911
|
};
|
|
912
912
|
}, [t, n]), o;
|
|
913
|
-
}, Pt = (t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase(),
|
|
914
|
-
const s = t.split("/").filter((
|
|
913
|
+
}, Pt = (t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase(), St = (t) => {
|
|
914
|
+
const s = t.split("/").filter((a) => a.length > 0).map((a) => a.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((c) => c.charAt(0).toUpperCase() + c.slice(1)).join("")).join("");
|
|
915
915
|
return s.charAt(0).toLowerCase() + s.slice(1);
|
|
916
|
-
},
|
|
917
|
-
const s =
|
|
918
|
-
return `${s}${
|
|
916
|
+
}, jt = (t) => (t.split("/").pop() || t).replace(/\.json$/, "").replace(/^openapi\./, ""), xt = (t, n, o) => {
|
|
917
|
+
const s = St(n), a = Pt(o);
|
|
918
|
+
return `${s}${a}`;
|
|
919
919
|
}, Tt = (t) => {
|
|
920
920
|
if (t)
|
|
921
921
|
return (t == null ? void 0 : t.reduce((n, o) => (n[o] = {
|
|
@@ -925,8 +925,8 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
925
925
|
useQuery: !0
|
|
926
926
|
}
|
|
927
927
|
}, n), {})) || {};
|
|
928
|
-
},
|
|
929
|
-
const { output:
|
|
928
|
+
}, qt = (t) => (Array.isArray(t) ? t : [t]).reduce((o, s) => {
|
|
929
|
+
const { output: a, operationsToGenerateInfiniteQueryHook: f, input: l = "./openapi.json" } = s || {}, d = jt(l);
|
|
930
930
|
return {
|
|
931
931
|
...o,
|
|
932
932
|
[d]: {
|
|
@@ -935,7 +935,7 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
935
935
|
},
|
|
936
936
|
input: l,
|
|
937
937
|
output: {
|
|
938
|
-
baseUrl:
|
|
938
|
+
baseUrl: a == null ? void 0 : a.baseUrl,
|
|
939
939
|
client: "react-query",
|
|
940
940
|
mode: "tags-split",
|
|
941
941
|
override: {
|
|
@@ -949,24 +949,44 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
949
949
|
name: "axiosCustomInstance",
|
|
950
950
|
path: `${__dirname}/axiosCustomInstance.ts`
|
|
951
951
|
},
|
|
952
|
-
operationName:
|
|
952
|
+
operationName: xt,
|
|
953
953
|
query: {
|
|
954
954
|
useQuery: !0
|
|
955
955
|
}
|
|
956
956
|
},
|
|
957
|
-
schemas: (
|
|
958
|
-
target: (
|
|
959
|
-
...
|
|
957
|
+
schemas: (a == null ? void 0 : a.schemas) || `src/api/${d}/model`,
|
|
958
|
+
target: (a == null ? void 0 : a.target) || `src/api/${d}/services/api.ts`,
|
|
959
|
+
...a
|
|
960
960
|
}
|
|
961
961
|
}
|
|
962
962
|
};
|
|
963
|
-
}, {}),
|
|
963
|
+
}, {}), Bt = (t) => {
|
|
964
964
|
const n = "moduleFetchError";
|
|
965
|
-
|
|
965
|
+
if ([
|
|
966
|
+
"Failed to fetch dynamically imported module",
|
|
967
|
+
"Importing a module script failed",
|
|
968
|
+
"ChunkLoadError",
|
|
969
|
+
"Loading chunk failed",
|
|
970
|
+
"Unable to preload CSS",
|
|
971
|
+
"Unable to preload"
|
|
972
|
+
].some((s) => t.message.toLowerCase().includes(s.toLowerCase()))) {
|
|
973
|
+
try {
|
|
974
|
+
if (!document.cookie.split(";").some((a) => a.trim().startsWith(`${n}=`))) {
|
|
975
|
+
const a = (/* @__PURE__ */ new Date()).getTime();
|
|
976
|
+
document.cookie = `${n}=${a}; max-age=60; path=/`, setTimeout(() => {
|
|
977
|
+
window.location.reload();
|
|
978
|
+
}, 100);
|
|
979
|
+
}
|
|
980
|
+
} catch (s) {
|
|
981
|
+
console.error("Error handling module import failure:", s);
|
|
982
|
+
}
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
throw t;
|
|
966
986
|
};
|
|
967
987
|
export {
|
|
968
|
-
|
|
969
|
-
|
|
988
|
+
Dt as GTMSendPageView,
|
|
989
|
+
It as InitializeAxiosConfig,
|
|
970
990
|
Yt as InitializeDaysJSConfig,
|
|
971
991
|
$t as InitializeI18nConfig,
|
|
972
992
|
Nt as InitializeMapBoxConfig,
|
|
@@ -978,11 +998,11 @@ export {
|
|
|
978
998
|
kt as RequireAuth,
|
|
979
999
|
wt as dateAdapter,
|
|
980
1000
|
_t as distanceAdapter,
|
|
981
|
-
|
|
982
|
-
|
|
1001
|
+
qt as getOrvalConfig,
|
|
1002
|
+
Bt as handleImportModuleError,
|
|
983
1003
|
Ut as useAdapter,
|
|
984
1004
|
Vt as useAuth,
|
|
985
|
-
|
|
1005
|
+
Gt as useCurrentLanguage,
|
|
986
1006
|
Mt as useInfiniteDataGrid,
|
|
987
1007
|
zt as useResponseError
|
|
988
1008
|
};
|
package/dist/main.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(p,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(p=typeof globalThis<"u"?globalThis:p||self,h(p["@tracktor/shared-module"]={},p.React))})(this,function(p,h){"use strict";var te={exports:{}},G={};/**
|
|
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 le;function Ye(){if(le)return
|
|
9
|
+
*/var le;function Ye(){if(le)return G;le=1;var t=h,n=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function l(d,u,g){var E,_={},C=null,c=null;g!==void 0&&(C=""+g),u.key!==void 0&&(C=""+u.key),u.ref!==void 0&&(c=u.ref);for(E in u)s.call(u,E)&&!f.hasOwnProperty(E)&&(_[E]=u[E]);if(d&&d.defaultProps)for(E in u=d.defaultProps,u)_[E]===void 0&&(_[E]=u[E]);return{$$typeof:n,type:d,key:C,ref:c,props:_,_owner:a.current}}return G.Fragment=o,G.jsx=l,G.jsxs=l,G}var B={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,12 +14,12 @@
|
|
|
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 fe;function
|
|
18
|
-
`+ne+e}}var oe=!1,Z;{var yt=typeof WeakMap=="function"?WeakMap:Map;Z=new yt}function Pe(e,r){if(!e||oe)return"";{var
|
|
17
|
+
*/var fe;function Me(){return fe||(fe=1,process.env.NODE_ENV!=="production"&&function(){var t=h,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),d=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),c=Symbol.for("react.offscreen"),T=Symbol.iterator,I="@@iterator";function x(e){if(e===null||typeof e!="object")return null;var r=T&&e[T]||e[I];return typeof r=="function"?r:null}var D=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,i=new Array(r>1?r-1:0),v=1;v<r;v++)i[v-1]=arguments[v];W("error",e,i)}}function W(e,r,i){{var v=D.ReactDebugCurrentFrame,R=v.getStackAddendum();R!==""&&(r+="%s",i=i.concat([R]));var w=i.map(function(y){return String(y)});w.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,w)}}var Y=!1,M=!1,S=!1,ge=!1,me=!1,Q;Q=Symbol.for("react.module.reference");function vt(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===f||me||e===a||e===g||e===E||ge||e===c||Y||M||S||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===_||e.$$typeof===l||e.$$typeof===d||e.$$typeof===u||e.$$typeof===Q||e.getModuleId!==void 0))}function gt(e,r,i){var v=e.displayName;if(v)return v;var R=r.displayName||r.name||"";return R!==""?i+"("+R+")":i}function he(e){return e.displayName||"Context"}function L(e){if(e==null)return null;if(typeof e.tag=="number"&&b("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 f:return"Profiler";case a:return"StrictMode";case g:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return he(r)+".Consumer";case l:var i=e;return he(i._context)+".Provider";case u:return gt(e,e.render,"ForwardRef");case _:var v=e.displayName||null;return v!==null?v:L(e.type)||"Memo";case C:{var R=e,w=R._payload,y=R._init;try{return L(y(w))}catch{return null}}}return null}var z=Object.assign,J=0,ye,Ee,Re,we,pe,Ce,_e;function be(){}be.__reactDisabledLog=!0;function mt(){{if(J===0){ye=console.log,Ee=console.info,Re=console.warn,we=console.error,pe=console.group,Ce=console.groupCollapsed,_e=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})}J++}}function ht(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},e,{value:ye}),info:z({},e,{value:Ee}),warn:z({},e,{value:Re}),error:z({},e,{value:we}),group:z({},e,{value:pe}),groupCollapsed:z({},e,{value:Ce}),groupEnd:z({},e,{value:_e})})}J<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=D.ReactCurrentDispatcher,ne;function H(e,r,i){{if(ne===void 0)try{throw Error()}catch(R){var v=R.stack.trim().match(/\n( *(at )?)/);ne=v&&v[1]||""}return`
|
|
18
|
+
`+ne+e}}var oe=!1,Z;{var yt=typeof WeakMap=="function"?WeakMap:Map;Z=new yt}function Pe(e,r){if(!e||oe)return"";{var i=Z.get(e);if(i!==void 0)return i}var v;oe=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var w;w=re.current,re.current=null,mt();try{if(r){var y=function(){throw Error()};if(Object.defineProperty(y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(y,[])}catch(N){v=N}Reflect.construct(e,[],y)}else{try{y.call()}catch(N){v=N}e.call(y.prototype)}}else{try{throw Error()}catch(N){v=N}e()}}catch(N){if(N&&v&&typeof N.stack=="string"){for(var m=N.stack.split(`
|
|
19
19
|
`),O=v.stack.split(`
|
|
20
|
-
`),P=m.length-1,
|
|
21
|
-
`+m[P].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&Z.set(e,k),k}while(P>=1&&
|
|
20
|
+
`),P=m.length-1,j=O.length-1;P>=1&&j>=0&&m[P]!==O[j];)j--;for(;P>=1&&j>=0;P--,j--)if(m[P]!==O[j]){if(P!==1||j!==1)do if(P--,j--,j<0||m[P]!==O[j]){var k=`
|
|
21
|
+
`+m[P].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&Z.set(e,k),k}while(P>=1&&j>=0);break}}}finally{oe=!1,re.current=w,ht(),Error.prepareStackTrace=R}var U=e?e.displayName||e.name:"",We=U?H(U):"";return typeof e=="function"&&Z.set(e,We),We}function Et(e,r,i){return Pe(e,!1)}function Rt(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function $(e,r,i){if(e==null)return"";if(typeof e=="function")return Pe(e,Rt(e));if(typeof e=="string")return H(e);switch(e){case g:return H("Suspense");case E:return H("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return Et(e.render);case _:return $(e.type,r,i);case C:{var v=e,R=v._payload,w=v._init;try{return $(w(R),r,i)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,Se={},je=D.ReactDebugCurrentFrame;function ee(e){if(e){var r=e._owner,i=$(e.type,e._source,r?r.type:null);je.setExtraStackFrame(i)}else je.setExtraStackFrame(null)}function wt(e,r,i,v,R){{var w=Function.call.bind(q);for(var y in e)if(w(e,y)){var m=void 0;try{if(typeof e[y]!="function"){var O=Error((v||"React class")+": "+i+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}m=e[y](r,y,v,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){m=P}m&&!(m instanceof Error)&&(ee(R),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).",v||"React class",i,y,typeof m),ee(null)),m instanceof Error&&!(m.message in Se)&&(Se[m.message]=!0,ee(R),b("Failed %s type: %s",i,m.message),ee(null))}}}var pt=Array.isArray;function ae(e){return pt(e)}function Ct(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,i=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function _t(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function xe(e){if(_t(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ct(e)),Te(e)}var K=D.ReactCurrentOwner,bt={key:!0,ref:!0,__self:!0,__source:!0},Oe,Ae,ie;ie={};function Pt(e){if(q.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function St(e){if(q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function jt(e,r){if(typeof e.ref=="string"&&K.current&&r&&K.current.stateNode!==r){var i=L(K.current.type);ie[i]||(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',L(K.current.type),e.ref),ie[i]=!0)}}function Tt(e,r){{var i=function(){Oe||(Oe=!0,b("%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))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}}function xt(e,r){{var i=function(){Ae||(Ae=!0,b("%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))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}}var Ot=function(e,r,i,v,R,w,y){var m={$$typeof:n,type:e,key:r,ref:i,props:y,_owner:w};return m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(m,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(m,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m};function At(e,r,i,v,R){{var w,y={},m=null,O=null;i!==void 0&&(xe(i),m=""+i),St(r)&&(xe(r.key),m=""+r.key),Pt(r)&&(O=r.ref,jt(r,R));for(w in r)q.call(r,w)&&!bt.hasOwnProperty(w)&&(y[w]=r[w]);if(e&&e.defaultProps){var P=e.defaultProps;for(w in P)y[w]===void 0&&(y[w]=P[w])}if(m||O){var j=typeof e=="function"?e.displayName||e.name||"Unknown":e;m&&Tt(y,j),O&&xt(y,j)}return Ot(e,m,O,R,v,K.current,y)}}var se=D.ReactCurrentOwner,Ie=D.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,i=$(e.type,e._source,r?r.type:null);Ie.setExtraStackFrame(i)}else Ie.setExtraStackFrame(null)}var ce;ce=!1;function ue(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function ke(){{if(se.current){var e=L(se.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function It(e){return""}var De={};function kt(e){{var r=ke();if(!r){var
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function It(e){return""}var De={};function kt(e){{var r=ke();if(!r){var i=typeof e=="string"?e:e.displayName||e.name;i&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+a+">.")}return r}}function Fe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=kt(r);if(De[a])return;De[a]=!0;var v="";e&&e._owner&&e._owner!==se.current&&(v=" It was passed a child from "+L(e._owner.type)+"."),V(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.',a,v),V(null)}}function Le(e,r){{if(typeof e!="object")return;if(ae(e))for(var a=0;a<e.length;a++){var v=e[a];ce(v)&&Fe(v,r)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var R=x(e);if(typeof R=="function"&&R!==e.entries)for(var w=R.call(e),y;!(y=w.next()).done;)ce(y.value)&&Fe(y.value,r)}}}function Dt(e){{var r=e.type;if(r==null||typeof r=="string")return;var a;if(typeof r=="function")a=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===_))a=r.propTypes;else return;if(a){var v=L(r);wt(a,e.props,"prop",v,e)}else if(r.PropTypes!==void 0&&!ue){ue=!0;var R=L(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ft(e){{for(var r=Object.keys(e.props),a=0;a<r.length;a++){var v=r[a];if(v!=="children"&&v!=="key"){V(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),V(null);break}}e.ref!==null&&(V(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function Ne(e,r,a,v,R,w){{var y=vt(e);if(!y){var m="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(m+=" 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 O=It();O?m+=O:m+=ke();var P;e===null?P="null":ae(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(L(e.type)||"Unknown")+" />",m=" Did you accidentally export a JSX literal instead of a component?"):P=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",P,m)}var S=At(e,r,a,R,w);if(S==null)return S;if(y){var k=r.children;if(k!==void 0)if(v)if(ae(k)){for(var U=0;U<k.length;U++)Le(k[U],e);Object.freeze&&Object.freeze(k)}else 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.");else Le(k,e)}return e===s?Ft(S):Dt(S),S}}function Lt(e,r,a){return Ne(e,r,a,!0)}function Nt(e,r,a){return Ne(e,r,a,!1)}var Wt=Nt,Yt=Lt;G.Fragment=s,G.jsx=Wt,G.jsxs=Yt}()),G}process.env.NODE_ENV==="production"?te.exports=Ye():te.exports=ze();var F=te.exports;const A=h.createContext({}),Me=({children:t,apiURL:n,libraries:o})=>{const s=h.useMemo(()=>({apiURL:n,libraries:o}),[n,o]);return F.jsx(A.Provider,{value:s,children:t})},Ve=({Fallback:t,isLogged:n,loginPath:o="/login",localStorageKey:s="user",redirect401Path:i="/login",...f})=>{var b,W,Y,z;const{libraries:l}=h.useContext(A),d=(f==null?void 0:f.reactRouter)||(l==null?void 0:l.reactRouter),c=(f==null?void 0:f.axios)||(l==null?void 0:l.axios);if(!d)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[g,E]=h.useState(null),{useLocation:_,Navigate:p,Outlet:u}=d,T=_(),I=h.useRef(!1),x=typeof n=="function"?n():!!n,D=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return h.useEffect(()=>{I.current||(I.current=!0,c.interceptors.response.use(j=>j,async j=>{var Q;return typeof j=="object"&&j&&"response"in j&&j.response&&typeof j.response=="object"&&"status"in j.response&&j.response&&typeof j.response=="object"&&"status"in j.response&&((Q=j==null?void 0:j.response)==null?void 0:Q.status)===401&&(c.defaults.headers.common.Authorization=null,localStorage.removeItem(s),E(i)),Promise.reject(j)}))},[c.defaults.headers.common,c.interceptors.response,s,i]),D&&!g?F.jsx(h.Suspense,{fallback:t,children:(W=(b=T.state)==null?void 0:b.from)!=null&&W.state&&((z=(Y=T.state)==null?void 0:Y.from)==null?void 0:z.pathname)===o?F.jsx(p,{to:T.state.from.state.from.pathname+T.state.from.state.from.search,replace:!0}):F.jsx(u,{})}):F.jsx(p,{to:o+T.search,state:{from:T},replace:!0})},Ue=({data:t,...n})=>{const{libraries:o}=h.useContext(A),s=(n==null?void 0:n.reactRouter)||(o==null?void 0:o.reactRouter),i=(n==null?void 0:n.gtm)||(o==null?void 0:o.gtm);if(!s)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!i)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:f}=i,{useLocation:l,Outlet:d}=s,{pathname:c}=l(),{sendEvent:g}=f();return h.useEffect(()=>{g({event:"pageView",pathname:c,...t})},[t,c,g]),F.jsx(d,{})},Be=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:o="accessToken",postContentType:s="application/json",...i})=>{const{apiURL:f=i.apiURL,libraries:l}=h.useContext(A),d=(i==null?void 0:i.axios)||(l==null?void 0:l.axios);if(!d)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(d!=null&&d.defaults))return null;const c=localStorage.getItem(n),g=c?JSON.parse(c):null,E=g!=null&&g[t]?g[t]:null,_=g!=null&&g[o]?g[o]:null,p=c?`${E} ${_}`:null;return d.defaults.baseURL=f,d.defaults.headers.post["Content-Type"]=s,p&&(d.defaults.headers.common.Authorization=p),null},Ge=({debug:t,resources:n,...o})=>{const{libraries:s}=h.useContext(A),i=(o==null?void 0:o.i18)||(s==null?void 0:s.i18),{i18next:f,initReactI18next:l,languageDetector:d}=i||{};if(!i)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return f!=null&&f.isInitialized||(f.use(d).use(l).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==f.resolvedLanguage&&f.resolvedLanguage&&document.documentElement.setAttribute("lang",f.resolvedLanguage)}),f.on("languageChanged",c=>{document.documentElement.setAttribute("lang",c)})),null},Qe=({dsn:t,integrations:n,tracesSampleRate:o,replaysSessionSampleRate:s,replaysOnErrorSampleRate:i,tracePropagationTargets:f,ignoreErrors:l,debug:d,environment:c,...g})=>{const{libraries:E}=h.useContext(A),_=(g==null?void 0:g.sentry)||(E==null?void 0:E.sentry),p=(g==null?void 0:g.reactRouter)||(E==null?void 0:E.reactRouter);if(!_)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!p)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(_.isInitialized())return null;const{createRoutesFromChildren:u,matchRoutes:T,useLocation:I,useNavigationType:x}=p;return(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:d,dsn:t,environment:c||"production",ignoreErrors:[...l||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:u,matchRoutes:T,useEffect:h.useEffect,useLocation:I,useNavigationType:x}),...n||[]],replaysOnErrorSampleRate:i||1,replaysSessionSampleRate:s||.1,tracePropagationTargets:f,tracesSampleRate:o||1}),null},Je=({IMaskMixin:t,...n})=>{const o=h.useMemo(()=>t(({TextField:s,...i})=>F.jsx(s,{...i})),[t]);return F.jsx(o,{...n})},Ke=({accessToken:t,...n})=>{const{libraries:o}=h.useContext(A),s=(n==null?void 0:n.mapbox)||(o==null?void 0:o.mapbox);if(!s)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return t&&(s.accessToken=t),null},Xe=({language:t,...n})=>{const{libraries:o}=h.useContext(A),s=(n==null?void 0:n.dayjs)||(o==null?void 0:o.dayjs),i=(n==null?void 0:n.plugin)||(o==null?void 0:o.dayjsPlugin);if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");return h.useEffect(()=>{(async()=>{var d;const l=t||((d=navigator.language)==null?void 0:d.slice(0,2))||"en";i&&i.forEach(c=>{c&&s.extend(c)}),await import("dayjs/locale/en"),await import("dayjs/locale/fr"),s.locale(l)})().then()},[s,i,t]),null},He=t=>t&&typeof t=="function",Ze=t=>t&&typeof t=="function",$e=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:o,...s})=>{var c,g;const{libraries:i}=h.useContext(A),f=(s==null?void 0:s.QueryClient)||((c=i==null?void 0:i.reactQuery)==null?void 0:c.QueryClient),l=(s==null?void 0:s.QueryClientProvider)||((g=i==null?void 0:i.reactQuery)==null?void 0:g.QueryClientProvider);if(!f)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!l)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!He(l))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!Ze(f))throw new Error("Provided QueryClient dependencies are not valid.");const d=new f({defaultOptions:{mutations:{...o},queries:{getNextPageParam:(E,_,p)=>E.length+(p||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(l,{client:d,children:t})},qe=t=>{var g,E,_;const{libraries:n}=h.useContext(A),o=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),s=((g=t==null?void 0:t.i18)==null?void 0:g.translateFunction)||((E=n==null?void 0:n.i18)==null?void 0:E.translateFunction),i=((_=o==null?void 0:o.i18next)==null?void 0:_.t)||s||(p=>p),{unknownErrorTranslationKey:f="error.unknownError"}=t||{},l=i(f),d=h.useCallback(p=>{var T,I,x,D,b,W,Y,z,j;const{response:u}=p||{};return u!=null&&u.reason?String(u.reason):(T=u==null?void 0:u.data)!=null&&T.reason?String(u.data.reason):(I=u==null?void 0:u.data)!=null&&I.message?String(u.data.message):(D=(x=u==null?void 0:u.data)==null?void 0:x.detail)!=null&&D.length&&Array.isArray((b=u==null?void 0:u.data)==null?void 0:b.detail)&&((Y=(W=u==null?void 0:u.data)==null?void 0:W.detail[0])!=null&&Y.msg)&&typeof((j=(z=u==null?void 0:u.data)==null?void 0:z.detail[0])==null?void 0:j.msg)=="string"?String(u.data.detail[0].msg):l},[l]);return{getErrorCode:h.useCallback(p=>{var T,I,x;const{response:u}=p||{};return u!=null&&u.error_code?String(u==null?void 0:u.error_code):(T=u==null?void 0:u.data)!=null&&T.error_code?String((I=u==null?void 0:u.data)==null?void 0:I.error_code):u!=null&&u.error_code?String(u==null?void 0:u.error_code):(x=u==null?void 0:u.data)!=null&&x.error_code?String(u.data.error_code):"unknown_error_code"},[]),printError:d}},et=({data:t,fetchNextPage:n,isFetchingNextPage:o,isInitialLoading:s,isLoading:i,enabled:f=!0})=>{const l=h.useCallback(async c=>{o||!f||await n({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[f,n,o]),d=h.useMemo(()=>{if(t)return t.pages.reduce((c,g)=>[...c,...g],[])},[t]);return{fetchNextPageOnRowsScrollEnd:l,isLoading:o||i,loadingVariant:s?"skeleton":"linear",rows:d}},tt=t=>{const{libraries:n}=h.useContext(A),o=(t==null?void 0:t.axios)||(n==null?void 0:n.axios),s=(t==null?void 0:t.localStorageKey)||"user";if(!o)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");const i=h.useCallback(({tokenType:l,accessToken:d})=>{o.defaults.headers.common.Authorization=`${l} ${d}`},[o.defaults.headers.common]),f=()=>{o.defaults.headers.common.Authorization=null};return h.useEffect(()=>{const l=({newValue:d,key:c})=>{if(c===s&&d)try{const{accessToken:g,tokenType:E}=JSON.parse(d);i({accessToken:g,tokenType:E})}catch(g){console.error("Failed to parse newValue from localStorage:",g)}};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}},[s,i]),{clearAuthenticationToken:f,setAuthenticationToken:i}},de=({library:t,date:n,format:o="ll"})=>t(n).format(o),ve=(t,n="km")=>{const o=Number(t);return Number.isNaN(o)?`0 ${n}`:`${o.toFixed(2)} ${n}`},rt=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,nt=({path:t,size:n,apiURL:o})=>{if(!t)return"";const s=rt(t),i=`${o}${s}`,f=i.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&f?`${i.replace("/files",`/thumbs/${n}`)}`:i},ot=t=>{const{apiURL:n,libraries:o}=h.useContext(A),s=(t==null?void 0:t.dayjs)||(o==null?void 0:o.dayjs);return{dateAdapter:(l,d)=>{if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return de({date:l,format:d,library:s})},distanceAdapter:ve,filePathAdapter:(l,d)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return nt({apiURL:n,path:l,size:d})}}},X=(t,n)=>n==="short"?t.split("-")[0]:t,at=(t,n="full")=>{const[o,s]=h.useState(()=>{const i=(t==null?void 0:t.language)||navigator.language;return t&&"isInitialized"in t&&t.isInitialized,X(i,n)});return h.useEffect(()=>{var f;t&&"isInitialized"in t&&t.isInitialized&&t.language&&s(X(t.language,n));const i=l=>{s(X(l,n))};return(f=t==null?void 0:t.on)==null||f.call(t,"languageChanged",i),()=>{var l;(l=t==null?void 0:t.off)==null||l.call(t,"languageChanged",i)}},[t,n]),o},it=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),st=t=>{const s=t.split("/").filter(i=>i.length>0).map(i=>i.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return s.charAt(0).toLowerCase()+s.slice(1)},ut=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),ct=(t,n,o)=>{const s=st(n),i=it(o);return`${s}${i}`},lt=t=>{if(t)return(t==null?void 0:t.reduce((n,o)=>(n[o]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},ft=t=>(Array.isArray(t)?t:[t]).reduce((o,s)=>{const{output:i,operationsToGenerateInfiniteQueryHook:f,input:l="./openapi.json"}=s||{},d=ut(l);return{...o,[d]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:l,output:{baseUrl:i==null?void 0:i.baseUrl,client:"react-query",mode:"tags-split",override:{...(f==null?void 0:f.length)&&{operations:lt(f)},header:c=>["Generated by orval 🍺",...c.title?[c.title]:[],...c.description?[c.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:ct,query:{useQuery:!0}},schemas:(i==null?void 0:i.schemas)||`src/api/${d}/model`,target:(i==null?void 0:i.target)||`src/api/${d}/services/api.ts`,...i}}}},{}),dt=t=>{const n="moduleFetchError";throw t.message.includes("Failed to fetch dynamically imported module")&&(document.cookie.split(";").some(s=>s.trim().startsWith(`${n}=`))||(document.cookie=`${n}=true; max-age=60; path=/`,window.location.reload())),t};C.GTMSendPageView=Ue,C.InitializeAxiosConfig=Be,C.InitializeDaysJSConfig=Xe,C.InitializeI18nConfig=Ge,C.InitializeMapBoxConfig=Ke,C.InitializeSentryConfig=Qe,C.InjectDependenciesContext=A,C.InjectDependenciesProvider=Me,C.MaskTextField=Je,C.QueryClientProviderWithConfig=$e,C.RequireAuth=Ve,C.dateAdapter=de,C.distanceAdapter=ve,C.getOrvalConfig=ft,C.handleImportModuleError=dt,C.useAdapter=ot,C.useAuth=tt,C.useCurrentLanguage=at,C.useInfiniteDataGrid=et,C.useResponseError=qe,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|
|
25
|
+
Check the top-level render call using <`+i+">.")}return r}}function Fe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=kt(r);if(De[i])return;De[i]=!0;var v="";e&&e._owner&&e._owner!==se.current&&(v=" It was passed a child from "+L(e._owner.type)+"."),V(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.',i,v),V(null)}}function Le(e,r){{if(typeof e!="object")return;if(ae(e))for(var i=0;i<e.length;i++){var v=e[i];ue(v)&&Fe(v,r)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var R=x(e);if(typeof R=="function"&&R!==e.entries)for(var w=R.call(e),y;!(y=w.next()).done;)ue(y.value)&&Fe(y.value,r)}}}function Dt(e){{var r=e.type;if(r==null||typeof r=="string")return;var i;if(typeof r=="function")i=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===_))i=r.propTypes;else return;if(i){var v=L(r);wt(i,e.props,"prop",v,e)}else if(r.PropTypes!==void 0&&!ce){ce=!0;var R=L(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ft(e){{for(var r=Object.keys(e.props),i=0;i<r.length;i++){var v=r[i];if(v!=="children"&&v!=="key"){V(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),V(null);break}}e.ref!==null&&(V(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function Ne(e,r,i,v,R,w){{var y=vt(e);if(!y){var m="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(m+=" 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 O=It();O?m+=O:m+=ke();var P;e===null?P="null":ae(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(L(e.type)||"Unknown")+" />",m=" Did you accidentally export a JSX literal instead of a component?"):P=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",P,m)}var j=At(e,r,i,R,w);if(j==null)return j;if(y){var k=r.children;if(k!==void 0)if(v)if(ae(k)){for(var U=0;U<k.length;U++)Le(k[U],e);Object.freeze&&Object.freeze(k)}else 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.");else Le(k,e)}return e===s?Ft(j):Dt(j),j}}function Lt(e,r,i){return Ne(e,r,i,!0)}function Nt(e,r,i){return Ne(e,r,i,!1)}var Wt=Nt,Yt=Lt;B.Fragment=s,B.jsx=Wt,B.jsxs=Yt}()),B}process.env.NODE_ENV==="production"?te.exports=Ye():te.exports=Me();var F=te.exports;const A=h.createContext({}),ze=({children:t,apiURL:n,libraries:o})=>{const s=h.useMemo(()=>({apiURL:n,libraries:o}),[n,o]);return F.jsx(A.Provider,{value:s,children:t})},Ve=({Fallback:t,isLogged:n,loginPath:o="/login",localStorageKey:s="user",redirect401Path:a="/login",...f})=>{var b,W,Y,M;const{libraries:l}=h.useContext(A),d=(f==null?void 0:f.reactRouter)||(l==null?void 0:l.reactRouter),u=(f==null?void 0:f.axios)||(l==null?void 0:l.axios);if(!d)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[g,E]=h.useState(null),{useLocation:_,Navigate:C,Outlet:c}=d,T=_(),I=h.useRef(!1),x=typeof n=="function"?n():!!n,D=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return h.useEffect(()=>{I.current||(I.current=!0,u.interceptors.response.use(S=>S,async S=>{var Q;return typeof S=="object"&&S&&"response"in S&&S.response&&typeof S.response=="object"&&"status"in S.response&&S.response&&typeof S.response=="object"&&"status"in S.response&&((Q=S==null?void 0:S.response)==null?void 0:Q.status)===401&&(u.defaults.headers.common.Authorization=null,localStorage.removeItem(s),E(a)),Promise.reject(S)}))},[u.defaults.headers.common,u.interceptors.response,s,a]),D&&!g?F.jsx(h.Suspense,{fallback:t,children:(W=(b=T.state)==null?void 0:b.from)!=null&&W.state&&((M=(Y=T.state)==null?void 0:Y.from)==null?void 0:M.pathname)===o?F.jsx(C,{to:T.state.from.state.from.pathname+T.state.from.state.from.search,replace:!0}):F.jsx(c,{})}):F.jsx(C,{to:o+T.search,state:{from:T},replace:!0})},Ue=({data:t,...n})=>{const{libraries:o}=h.useContext(A),s=(n==null?void 0:n.reactRouter)||(o==null?void 0:o.reactRouter),a=(n==null?void 0:n.gtm)||(o==null?void 0:o.gtm);if(!s)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!a)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:f}=a,{useLocation:l,Outlet:d}=s,{pathname:u}=l(),{sendEvent:g}=f();return h.useEffect(()=>{g({event:"pageView",pathname:u,...t})},[t,u,g]),F.jsx(d,{})},Ge=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:o="accessToken",postContentType:s="application/json",...a})=>{const{apiURL:f=a.apiURL,libraries:l}=h.useContext(A),d=(a==null?void 0:a.axios)||(l==null?void 0:l.axios);if(!d)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(d!=null&&d.defaults))return null;const u=localStorage.getItem(n),g=u?JSON.parse(u):null,E=g!=null&&g[t]?g[t]:null,_=g!=null&&g[o]?g[o]:null,C=u?`${E} ${_}`:null;return d.defaults.baseURL=f,d.defaults.headers.post["Content-Type"]=s,C&&(d.defaults.headers.common.Authorization=C),null},Be=({debug:t,resources:n,...o})=>{const{libraries:s}=h.useContext(A),a=(o==null?void 0:o.i18)||(s==null?void 0:s.i18),{i18next:f,initReactI18next:l,languageDetector:d}=a||{};if(!a)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return f!=null&&f.isInitialized||(f.use(d).use(l).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==f.resolvedLanguage&&f.resolvedLanguage&&document.documentElement.setAttribute("lang",f.resolvedLanguage)}),f.on("languageChanged",u=>{document.documentElement.setAttribute("lang",u)})),null},Qe=({dsn:t,integrations:n,tracesSampleRate:o,replaysSessionSampleRate:s,replaysOnErrorSampleRate:a,tracePropagationTargets:f,ignoreErrors:l,debug:d,environment:u,...g})=>{const{libraries:E}=h.useContext(A),_=(g==null?void 0:g.sentry)||(E==null?void 0:E.sentry),C=(g==null?void 0:g.reactRouter)||(E==null?void 0:E.reactRouter);if(!_)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!C)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(_.isInitialized())return null;const{createRoutesFromChildren:c,matchRoutes:T,useLocation:I,useNavigationType:x}=C;return(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:d,dsn:t,environment:u||"production",ignoreErrors:[...l||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:c,matchRoutes:T,useEffect:h.useEffect,useLocation:I,useNavigationType:x}),...n||[]],replaysOnErrorSampleRate:a||1,replaysSessionSampleRate:s||.1,tracePropagationTargets:f,tracesSampleRate:o||1}),null},Je=({IMaskMixin:t,...n})=>{const o=h.useMemo(()=>t(({TextField:s,...a})=>F.jsx(s,{...a})),[t]);return F.jsx(o,{...n})},Ke=({accessToken:t,...n})=>{const{libraries:o}=h.useContext(A),s=(n==null?void 0:n.mapbox)||(o==null?void 0:o.mapbox);if(!s)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return t&&(s.accessToken=t),null},Xe=({language:t,...n})=>{const{libraries:o}=h.useContext(A),s=(n==null?void 0:n.dayjs)||(o==null?void 0:o.dayjs),a=(n==null?void 0:n.plugin)||(o==null?void 0:o.dayjsPlugin);if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");return h.useEffect(()=>{(async()=>{var d;const l=t||((d=navigator.language)==null?void 0:d.slice(0,2))||"en";a&&a.forEach(u=>{u&&s.extend(u)}),await import("dayjs/locale/en"),await import("dayjs/locale/fr"),s.locale(l)})().then()},[s,a,t]),null},He=t=>t&&typeof t=="function",Ze=t=>t&&typeof t=="function",$e=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:o,...s})=>{var u,g;const{libraries:a}=h.useContext(A),f=(s==null?void 0:s.QueryClient)||((u=a==null?void 0:a.reactQuery)==null?void 0:u.QueryClient),l=(s==null?void 0:s.QueryClientProvider)||((g=a==null?void 0:a.reactQuery)==null?void 0:g.QueryClientProvider);if(!f)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!l)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!He(l))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!Ze(f))throw new Error("Provided QueryClient dependencies are not valid.");const d=new f({defaultOptions:{mutations:{...o},queries:{getNextPageParam:(E,_,C)=>E.length+(C||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(l,{client:d,children:t})},qe=t=>{var g,E,_;const{libraries:n}=h.useContext(A),o=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),s=((g=t==null?void 0:t.i18)==null?void 0:g.translateFunction)||((E=n==null?void 0:n.i18)==null?void 0:E.translateFunction),a=((_=o==null?void 0:o.i18next)==null?void 0:_.t)||s||(C=>C),{unknownErrorTranslationKey:f="error.unknownError"}=t||{},l=a(f),d=h.useCallback(C=>{var T,I,x,D,b,W,Y,M,S;const{response:c}=C||{};return c!=null&&c.reason?String(c.reason):(T=c==null?void 0:c.data)!=null&&T.reason?String(c.data.reason):(I=c==null?void 0:c.data)!=null&&I.message?String(c.data.message):(D=(x=c==null?void 0:c.data)==null?void 0:x.detail)!=null&&D.length&&Array.isArray((b=c==null?void 0:c.data)==null?void 0:b.detail)&&((Y=(W=c==null?void 0:c.data)==null?void 0:W.detail[0])!=null&&Y.msg)&&typeof((S=(M=c==null?void 0:c.data)==null?void 0:M.detail[0])==null?void 0:S.msg)=="string"?String(c.data.detail[0].msg):l},[l]);return{getErrorCode:h.useCallback(C=>{var T,I,x;const{response:c}=C||{};return c!=null&&c.error_code?String(c==null?void 0:c.error_code):(T=c==null?void 0:c.data)!=null&&T.error_code?String((I=c==null?void 0:c.data)==null?void 0:I.error_code):c!=null&&c.error_code?String(c==null?void 0:c.error_code):(x=c==null?void 0:c.data)!=null&&x.error_code?String(c.data.error_code):"unknown_error_code"},[]),printError:d}},et=({data:t,fetchNextPage:n,isFetchingNextPage:o,isInitialLoading:s,isLoading:a,enabled:f=!0})=>{const l=h.useCallback(async u=>{o||!f||await n({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[f,n,o]),d=h.useMemo(()=>{if(t)return t.pages.reduce((u,g)=>[...u,...g],[])},[t]);return{fetchNextPageOnRowsScrollEnd:l,isLoading:o||a,loadingVariant:s?"skeleton":"linear",rows:d}},tt=t=>{const{libraries:n}=h.useContext(A),o=(t==null?void 0:t.axios)||(n==null?void 0:n.axios),s=(t==null?void 0:t.localStorageKey)||"user";if(!o)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");const a=h.useCallback(({tokenType:l,accessToken:d})=>{o.defaults.headers.common.Authorization=`${l} ${d}`},[o.defaults.headers.common]),f=()=>{o.defaults.headers.common.Authorization=null};return h.useEffect(()=>{const l=({newValue:d,key:u})=>{if(u===s&&d)try{const{accessToken:g,tokenType:E}=JSON.parse(d);a({accessToken:g,tokenType:E})}catch(g){console.error("Failed to parse newValue from localStorage:",g)}};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}},[s,a]),{clearAuthenticationToken:f,setAuthenticationToken:a}},de=({library:t,date:n,format:o="ll"})=>t(n).format(o),ve=(t,n="km")=>{const o=Number(t);return Number.isNaN(o)?`0 ${n}`:`${o.toFixed(2)} ${n}`},rt=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,nt=({path:t,size:n,apiURL:o})=>{if(!t)return"";const s=rt(t),a=`${o}${s}`,f=a.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&f?`${a.replace("/files",`/thumbs/${n}`)}`:a},ot=t=>{const{apiURL:n,libraries:o}=h.useContext(A),s=(t==null?void 0:t.dayjs)||(o==null?void 0:o.dayjs);return{dateAdapter:(l,d)=>{if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return de({date:l,format:d,library:s})},distanceAdapter:ve,filePathAdapter:(l,d)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return nt({apiURL:n,path:l,size:d})}}},X=(t,n)=>n==="short"?t.split("-")[0]:t,at=(t,n="full")=>{const[o,s]=h.useState(()=>{const a=(t==null?void 0:t.language)||navigator.language;return t&&"isInitialized"in t&&t.isInitialized,X(a,n)});return h.useEffect(()=>{var f;t&&"isInitialized"in t&&t.isInitialized&&t.language&&s(X(t.language,n));const a=l=>{s(X(l,n))};return(f=t==null?void 0:t.on)==null||f.call(t,"languageChanged",a),()=>{var l;(l=t==null?void 0:t.off)==null||l.call(t,"languageChanged",a)}},[t,n]),o},it=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),st=t=>{const s=t.split("/").filter(a=>a.length>0).map(a=>a.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("")).join("");return s.charAt(0).toLowerCase()+s.slice(1)},ct=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),ut=(t,n,o)=>{const s=st(n),a=it(o);return`${s}${a}`},lt=t=>{if(t)return(t==null?void 0:t.reduce((n,o)=>(n[o]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},ft=t=>(Array.isArray(t)?t:[t]).reduce((o,s)=>{const{output:a,operationsToGenerateInfiniteQueryHook:f,input:l="./openapi.json"}=s||{},d=ct(l);return{...o,[d]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:l,output:{baseUrl:a==null?void 0:a.baseUrl,client:"react-query",mode:"tags-split",override:{...(f==null?void 0:f.length)&&{operations:lt(f)},header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:ut,query:{useQuery:!0}},schemas:(a==null?void 0:a.schemas)||`src/api/${d}/model`,target:(a==null?void 0:a.target)||`src/api/${d}/services/api.ts`,...a}}}},{}),dt=t=>{const n="moduleFetchError";if(["Failed to fetch dynamically imported module","Importing a module script failed","ChunkLoadError","Loading chunk failed","Unable to preload CSS","Unable to preload"].some(s=>t.message.toLowerCase().includes(s.toLowerCase()))){try{if(!document.cookie.split(";").some(a=>a.trim().startsWith(`${n}=`))){const a=new Date().getTime();document.cookie=`${n}=${a}; max-age=60; path=/`,setTimeout(()=>{window.location.reload()},100)}}catch(s){console.error("Error handling module import failure:",s)}return}throw t};p.GTMSendPageView=Ue,p.InitializeAxiosConfig=Ge,p.InitializeDaysJSConfig=Xe,p.InitializeI18nConfig=Be,p.InitializeMapBoxConfig=Ke,p.InitializeSentryConfig=Qe,p.InjectDependenciesContext=A,p.InjectDependenciesProvider=ze,p.MaskTextField=Je,p.QueryClientProviderWithConfig=$e,p.RequireAuth=Ve,p.dateAdapter=de,p.distanceAdapter=ve,p.getOrvalConfig=ft,p.handleImportModuleError=dt,p.useAdapter=ot,p.useAuth=tt,p.useCurrentLanguage=at,p.useInfiniteDataGrid=et,p.useResponseError=qe,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|