@tracktor/shared-module 2.1.6 → 2.1.7
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 +132 -128
- package/dist/main.umd.cjs +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Ne, { createContext as dt, useMemo as le, useContext as k, useState as vt, useRef as gt, useEffect as Z, Suspense as
|
|
1
|
+
import Ne, { createContext as dt, useMemo as le, useContext as k, useState as vt, useRef as gt, useEffect as Z, Suspense as mt, useCallback as ce } from "react";
|
|
2
2
|
var se = { exports: {} }, B = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -10,18 +10,18 @@ var se = { exports: {} }, B = {};
|
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
12
|
var Fe;
|
|
13
|
-
function
|
|
13
|
+
function yt() {
|
|
14
14
|
if (Fe) return B;
|
|
15
15
|
Fe = 1;
|
|
16
16
|
var t = Ne, n = Symbol.for("react.element"), i = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
-
function d
|
|
18
|
-
var E, w = {},
|
|
19
|
-
|
|
17
|
+
function v(d, s, y) {
|
|
18
|
+
var E, w = {}, R = null, u = null;
|
|
19
|
+
y !== void 0 && (R = "" + y), s.key !== void 0 && (R = "" + s.key), s.ref !== void 0 && (u = s.ref);
|
|
20
20
|
for (E in s) c.call(s, E) && !l.hasOwnProperty(E) && (w[E] = s[E]);
|
|
21
|
-
if (
|
|
22
|
-
return { $$typeof: n, type:
|
|
21
|
+
if (d && d.defaultProps) for (E in s = d.defaultProps, s) w[E] === void 0 && (w[E] = s[E]);
|
|
22
|
+
return { $$typeof: n, type: d, key: R, ref: u, props: w, _owner: a.current };
|
|
23
23
|
}
|
|
24
|
-
return B.Fragment = i, B.jsx =
|
|
24
|
+
return B.Fragment = i, B.jsx = v, B.jsxs = v, B;
|
|
25
25
|
}
|
|
26
26
|
var G = {};
|
|
27
27
|
/**
|
|
@@ -36,7 +36,7 @@ var G = {};
|
|
|
36
36
|
var Ye;
|
|
37
37
|
function ht() {
|
|
38
38
|
return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
-
var t = Ne, n = Symbol.for("react.element"), i = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"),
|
|
39
|
+
var t = Ne, n = Symbol.for("react.element"), i = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), v = Symbol.for("react.provider"), d = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), u = Symbol.for("react.offscreen"), j = Symbol.iterator, S = "@@iterator";
|
|
40
40
|
function x(e) {
|
|
41
41
|
if (e === null || typeof e != "object")
|
|
42
42
|
return null;
|
|
@@ -55,16 +55,16 @@ function ht() {
|
|
|
55
55
|
{
|
|
56
56
|
var f = D.ReactDebugCurrentFrame, h = f.getStackAddendum();
|
|
57
57
|
h !== "" && (r += "%s", o = o.concat([h]));
|
|
58
|
-
var
|
|
59
|
-
return String(
|
|
58
|
+
var p = o.map(function(m) {
|
|
59
|
+
return String(m);
|
|
60
60
|
});
|
|
61
|
-
|
|
61
|
+
p.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, p);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
var N = !1, W = !1, C = !1, fe = !1, de = !1, M;
|
|
65
65
|
M = Symbol.for("react.module.reference");
|
|
66
66
|
function We(e) {
|
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e === c || e === l || de || e === a || e ===
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === c || e === l || de || e === a || e === y || e === E || fe || e === u || N || W || C || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === w || e.$$typeof === v || e.$$typeof === d || e.$$typeof === s || // 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.
|
|
@@ -96,17 +96,17 @@ function ht() {
|
|
|
96
96
|
return "Profiler";
|
|
97
97
|
case a:
|
|
98
98
|
return "StrictMode";
|
|
99
|
-
case
|
|
99
|
+
case y:
|
|
100
100
|
return "Suspense";
|
|
101
101
|
case E:
|
|
102
102
|
return "SuspenseList";
|
|
103
103
|
}
|
|
104
104
|
if (typeof e == "object")
|
|
105
105
|
switch (e.$$typeof) {
|
|
106
|
-
case
|
|
106
|
+
case d:
|
|
107
107
|
var r = e;
|
|
108
108
|
return ve(r) + ".Consumer";
|
|
109
|
-
case
|
|
109
|
+
case v:
|
|
110
110
|
var o = e;
|
|
111
111
|
return ve(o._context) + ".Provider";
|
|
112
112
|
case s:
|
|
@@ -114,10 +114,10 @@ function ht() {
|
|
|
114
114
|
case w:
|
|
115
115
|
var f = e.displayName || null;
|
|
116
116
|
return f !== null ? f : I(e.type) || "Memo";
|
|
117
|
-
case
|
|
118
|
-
var h = e,
|
|
117
|
+
case R: {
|
|
118
|
+
var h = e, p = h._payload, m = h._init;
|
|
119
119
|
try {
|
|
120
|
-
return I(
|
|
120
|
+
return I(m(p));
|
|
121
121
|
} catch {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
@@ -125,14 +125,14 @@ function ht() {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
var L = Object.assign, U = 0, ge,
|
|
128
|
+
var L = Object.assign, U = 0, ge, me, ye, he, Ee, pe, Re;
|
|
129
129
|
function we() {
|
|
130
130
|
}
|
|
131
131
|
we.__reactDisabledLog = !0;
|
|
132
132
|
function Ve() {
|
|
133
133
|
{
|
|
134
134
|
if (U === 0) {
|
|
135
|
-
ge = console.log,
|
|
135
|
+
ge = console.log, me = console.info, ye = console.warn, he = console.error, Ee = console.group, pe = console.groupCollapsed, Re = console.groupEnd;
|
|
136
136
|
var e = {
|
|
137
137
|
configurable: !0,
|
|
138
138
|
enumerable: !0,
|
|
@@ -165,10 +165,10 @@ function ht() {
|
|
|
165
165
|
value: ge
|
|
166
166
|
}),
|
|
167
167
|
info: L({}, e, {
|
|
168
|
-
value:
|
|
168
|
+
value: me
|
|
169
169
|
}),
|
|
170
170
|
warn: L({}, e, {
|
|
171
|
-
value:
|
|
171
|
+
value: ye
|
|
172
172
|
}),
|
|
173
173
|
error: L({}, e, {
|
|
174
174
|
value: he
|
|
@@ -177,10 +177,10 @@ function ht() {
|
|
|
177
177
|
value: Ee
|
|
178
178
|
}),
|
|
179
179
|
groupCollapsed: L({}, e, {
|
|
180
|
-
value:
|
|
180
|
+
value: pe
|
|
181
181
|
}),
|
|
182
182
|
groupEnd: L({}, e, {
|
|
183
|
-
value:
|
|
183
|
+
value: Re
|
|
184
184
|
})
|
|
185
185
|
});
|
|
186
186
|
}
|
|
@@ -218,31 +218,31 @@ function ht() {
|
|
|
218
218
|
re = !0;
|
|
219
219
|
var h = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
|
-
var
|
|
222
|
-
|
|
221
|
+
var p;
|
|
222
|
+
p = ee.current, ee.current = null, Ve();
|
|
223
223
|
try {
|
|
224
224
|
if (r) {
|
|
225
|
-
var
|
|
225
|
+
var m = function() {
|
|
226
226
|
throw Error();
|
|
227
227
|
};
|
|
228
|
-
if (Object.defineProperty(
|
|
228
|
+
if (Object.defineProperty(m.prototype, "props", {
|
|
229
229
|
set: function() {
|
|
230
230
|
throw Error();
|
|
231
231
|
}
|
|
232
232
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
233
|
try {
|
|
234
|
-
Reflect.construct(
|
|
234
|
+
Reflect.construct(m, []);
|
|
235
235
|
} catch ($) {
|
|
236
236
|
f = $;
|
|
237
237
|
}
|
|
238
|
-
Reflect.construct(e, [],
|
|
238
|
+
Reflect.construct(e, [], m);
|
|
239
239
|
} else {
|
|
240
240
|
try {
|
|
241
|
-
|
|
241
|
+
m.call();
|
|
242
242
|
} catch ($) {
|
|
243
243
|
f = $;
|
|
244
244
|
}
|
|
245
|
-
e.call(
|
|
245
|
+
e.call(m.prototype);
|
|
246
246
|
}
|
|
247
247
|
} else {
|
|
248
248
|
try {
|
|
@@ -272,7 +272,7 @@ function ht() {
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
re = !1, ee.current =
|
|
275
|
+
re = !1, ee.current = p, ze(), Error.prepareStackTrace = h;
|
|
276
276
|
}
|
|
277
277
|
var z = e ? e.displayName || e.name : "", $e = z ? Q(z) : "";
|
|
278
278
|
return typeof e == "function" && J.set(e, $e), $e;
|
|
@@ -292,7 +292,7 @@ function ht() {
|
|
|
292
292
|
if (typeof e == "string")
|
|
293
293
|
return Q(e);
|
|
294
294
|
switch (e) {
|
|
295
|
-
case
|
|
295
|
+
case y:
|
|
296
296
|
return Q("Suspense");
|
|
297
297
|
case E:
|
|
298
298
|
return Q("SuspenseList");
|
|
@@ -303,10 +303,10 @@ function ht() {
|
|
|
303
303
|
return Ue(e.render);
|
|
304
304
|
case w:
|
|
305
305
|
return X(e.type, r, o);
|
|
306
|
-
case
|
|
307
|
-
var f = e, h = f._payload,
|
|
306
|
+
case R: {
|
|
307
|
+
var f = e, h = f._payload, p = f._init;
|
|
308
308
|
try {
|
|
309
|
-
return X(
|
|
309
|
+
return X(p(h), r, o);
|
|
310
310
|
} catch {
|
|
311
311
|
}
|
|
312
312
|
}
|
|
@@ -323,20 +323,20 @@ function ht() {
|
|
|
323
323
|
}
|
|
324
324
|
function Be(e, r, o, f, h) {
|
|
325
325
|
{
|
|
326
|
-
var
|
|
327
|
-
for (var
|
|
328
|
-
if (
|
|
326
|
+
var p = Function.call.bind(H);
|
|
327
|
+
for (var m in e)
|
|
328
|
+
if (p(e, m)) {
|
|
329
329
|
var g = void 0;
|
|
330
330
|
try {
|
|
331
|
-
if (typeof e[
|
|
332
|
-
var T = Error((f || "React class") + ": " + o + " type `" +
|
|
331
|
+
if (typeof e[m] != "function") {
|
|
332
|
+
var T = Error((f || "React class") + ": " + o + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
333
|
throw T.name = "Invariant Violation", T;
|
|
334
334
|
}
|
|
335
|
-
g = e[
|
|
335
|
+
g = e[m](r, m, f, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
336
|
} catch (b) {
|
|
337
337
|
g = b;
|
|
338
338
|
}
|
|
339
|
-
g && !(g instanceof Error) && (K(h), _("%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).", f || "React class", o,
|
|
339
|
+
g && !(g instanceof Error) && (K(h), _("%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).", f || "React class", o, m, typeof g), K(null)), g instanceof Error && !(g.message in be) && (be[g.message] = !0, K(h), _("Failed %s type: %s", o, g.message), K(null));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
@@ -415,7 +415,7 @@ function ht() {
|
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
var rt = function(e, r, o, f, h,
|
|
418
|
+
var rt = function(e, r, o, f, h, p, m) {
|
|
419
419
|
var g = {
|
|
420
420
|
// This tag allows us to uniquely identify this as a React Element
|
|
421
421
|
$$typeof: n,
|
|
@@ -423,9 +423,9 @@ function ht() {
|
|
|
423
423
|
type: e,
|
|
424
424
|
key: r,
|
|
425
425
|
ref: o,
|
|
426
|
-
props:
|
|
426
|
+
props: m,
|
|
427
427
|
// Record the component responsible for creating this element.
|
|
428
|
-
_owner:
|
|
428
|
+
_owner: p
|
|
429
429
|
};
|
|
430
430
|
return g._store = {}, Object.defineProperty(g._store, "validated", {
|
|
431
431
|
configurable: !1,
|
|
@@ -446,20 +446,20 @@ function ht() {
|
|
|
446
446
|
};
|
|
447
447
|
function nt(e, r, o, f, h) {
|
|
448
448
|
{
|
|
449
|
-
var
|
|
449
|
+
var p, m = {}, g = null, T = null;
|
|
450
450
|
o !== void 0 && (je(o), g = "" + o), Ke(r) && (je(r.key), g = "" + r.key), He(r) && (T = r.ref, Ze(r, h));
|
|
451
|
-
for (
|
|
452
|
-
H.call(r,
|
|
451
|
+
for (p in r)
|
|
452
|
+
H.call(r, p) && !Xe.hasOwnProperty(p) && (m[p] = r[p]);
|
|
453
453
|
if (e && e.defaultProps) {
|
|
454
454
|
var b = e.defaultProps;
|
|
455
|
-
for (
|
|
456
|
-
|
|
455
|
+
for (p in b)
|
|
456
|
+
m[p] === void 0 && (m[p] = b[p]);
|
|
457
457
|
}
|
|
458
458
|
if (g || T) {
|
|
459
459
|
var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
460
|
-
g && et(
|
|
460
|
+
g && et(m, P), T && tt(m, P);
|
|
461
461
|
}
|
|
462
|
-
return rt(e, g, T, h, f, q.current,
|
|
462
|
+
return rt(e, g, T, h, f, q.current, m);
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
465
|
var ie = D.ReactCurrentOwner, Se = D.ReactDebugCurrentFrame;
|
|
@@ -530,8 +530,8 @@ Check the top-level render call using <` + o + ">.");
|
|
|
530
530
|
else if (e) {
|
|
531
531
|
var h = x(e);
|
|
532
532
|
if (typeof h == "function" && h !== e.entries)
|
|
533
|
-
for (var
|
|
534
|
-
ue(
|
|
533
|
+
for (var p = h.call(e), m; !(m = p.next()).done; )
|
|
534
|
+
ue(m.value) && De(m.value, r);
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
537
|
}
|
|
@@ -572,10 +572,10 @@ Check the top-level render call using <` + o + ">.");
|
|
|
572
572
|
e.ref !== null && (V(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
-
function Ie(e, r, o, f, h,
|
|
575
|
+
function Ie(e, r, o, f, h, p) {
|
|
576
576
|
{
|
|
577
|
-
var
|
|
578
|
-
if (!
|
|
577
|
+
var m = We(e);
|
|
578
|
+
if (!m) {
|
|
579
579
|
var g = "";
|
|
580
580
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (g += " 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
581
|
var T = ot();
|
|
@@ -583,10 +583,10 @@ Check the top-level render call using <` + o + ">.");
|
|
|
583
583
|
var b;
|
|
584
584
|
e === null ? b = "null" : ne(e) ? b = "array" : e !== void 0 && e.$$typeof === n ? (b = "<" + (I(e.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : b = 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", b, g);
|
|
585
585
|
}
|
|
586
|
-
var P = nt(e, r, o, h,
|
|
586
|
+
var P = nt(e, r, o, h, p);
|
|
587
587
|
if (P == null)
|
|
588
588
|
return P;
|
|
589
|
-
if (
|
|
589
|
+
if (m) {
|
|
590
590
|
var O = r.children;
|
|
591
591
|
if (O !== void 0)
|
|
592
592
|
if (f)
|
|
@@ -612,7 +612,7 @@ Check the top-level render call using <` + o + ">.");
|
|
|
612
612
|
G.Fragment = c, G.jsx = lt, G.jsxs = ft;
|
|
613
613
|
}()), G;
|
|
614
614
|
}
|
|
615
|
-
process.env.NODE_ENV === "production" ? se.exports =
|
|
615
|
+
process.env.NODE_ENV === "production" ? se.exports = yt() : se.exports = ht();
|
|
616
616
|
var F = se.exports;
|
|
617
617
|
const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
618
618
|
const c = le(
|
|
@@ -632,10 +632,10 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
632
632
|
...l
|
|
633
633
|
}) => {
|
|
634
634
|
var _, Y, N, W;
|
|
635
|
-
const { libraries:
|
|
636
|
-
if (!
|
|
635
|
+
const { libraries: v } = k(A), d = (l == null ? void 0 : l.reactRouter) || (v == null ? void 0 : v.reactRouter), s = (l == null ? void 0 : l.axios) || (v == null ? void 0 : v.axios);
|
|
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 [
|
|
638
|
+
const [y, E] = vt(null), { useLocation: w, Navigate: R, Outlet: u } = d, j = w(), S = gt(!1), x = typeof n == "function" ? n() : !!n, D = typeof x == "boolean" ? x : x == null ? void 0 : x.isLogged;
|
|
639
639
|
return Z(() => {
|
|
640
640
|
S.current || (S.current = !0, s.interceptors.response.use(
|
|
641
641
|
(C) => C,
|
|
@@ -644,7 +644,7 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
644
644
|
return typeof C == "object" && C && "response" in C && C.response && typeof C.response == "object" && "status" in C.response && C.response && typeof C.response == "object" && "status" in C.response && ((M = C == null ? void 0 : C.response) == null ? void 0 : M.status) === 401 && (s.defaults.headers.common.Authorization = null, localStorage.removeItem(c), E(a)), Promise.reject(C);
|
|
645
645
|
}
|
|
646
646
|
));
|
|
647
|
-
}, [s.defaults.headers.common, s.interceptors.response, c, a]), D && !
|
|
647
|
+
}, [s.defaults.headers.common, s.interceptors.response, c, a]), D && !y ? /* @__PURE__ */ F.jsx(mt, { fallback: t, children: (Y = (_ = j.state) == null ? void 0 : _.from) != null && Y.state && ((W = (N = j.state) == null ? void 0 : N.from) == null ? void 0 : W.pathname) === i ? /* @__PURE__ */ F.jsx(R, { to: j.state.from.state.from.pathname + j.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ F.jsx(u, {}) }) : /* @__PURE__ */ F.jsx(R, { to: i, state: { from: j }, replace: !0 });
|
|
648
648
|
}, Dt = ({ ...t }) => {
|
|
649
649
|
const { libraries: n } = k(A), i = (t == null ? void 0 : t.reactRouter) || (n == null ? void 0 : n.reactRouter), c = (t == null ? void 0 : t.gtm) || (n == null ? void 0 : n.gtm);
|
|
650
650
|
if (!i)
|
|
@@ -653,10 +653,10 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
653
653
|
);
|
|
654
654
|
if (!c)
|
|
655
655
|
throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
|
|
656
|
-
const { useGoogleTagManager: a } = c, { useLocation: l, Outlet:
|
|
656
|
+
const { useGoogleTagManager: a } = c, { useLocation: l, Outlet: v } = i, { pathname: d } = l(), { sendEvent: s } = a();
|
|
657
657
|
return Z(() => {
|
|
658
|
-
s({ event: "pageView", pathname:
|
|
659
|
-
}, [
|
|
658
|
+
s({ event: "pageView", pathname: d });
|
|
659
|
+
}, [d, s]), /* @__PURE__ */ F.jsx(v, {});
|
|
660
660
|
}, kt = ({
|
|
661
661
|
tokenTypeKey: t = "tokenType",
|
|
662
662
|
userLocalStorageKey: n = "user",
|
|
@@ -664,18 +664,18 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
664
664
|
postContentType: c = "application/json",
|
|
665
665
|
...a
|
|
666
666
|
}) => {
|
|
667
|
-
const { apiURL: l = a.apiURL, libraries:
|
|
668
|
-
if (!
|
|
667
|
+
const { apiURL: l = a.apiURL, libraries: v } = k(A), d = (a == null ? void 0 : a.axios) || (v == null ? void 0 : v.axios);
|
|
668
|
+
if (!d)
|
|
669
669
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
670
|
-
if (!(
|
|
670
|
+
if (!(d != null && d.defaults))
|
|
671
671
|
return null;
|
|
672
|
-
const s = localStorage.getItem(n),
|
|
673
|
-
return
|
|
672
|
+
const s = localStorage.getItem(n), y = s ? JSON.parse(s) : null, E = y != null && y[t] ? y[t] : null, w = y != null && y[i] ? y[i] : null, R = s ? `${E} ${w}` : null;
|
|
673
|
+
return d.defaults.baseURL = l, d.defaults.headers.post["Content-Type"] = c, R && (d.defaults.headers.common.Authorization = R), null;
|
|
674
674
|
}, It = ({ debug: t, resources: n, ...i }) => {
|
|
675
|
-
const { libraries: c } = k(A), a = (i == null ? void 0 : i.i18) || (c == null ? void 0 : c.i18), { i18next: l, initReactI18next:
|
|
675
|
+
const { libraries: c } = k(A), a = (i == null ? void 0 : i.i18) || (c == null ? void 0 : c.i18), { i18next: l, initReactI18next: v, languageDetector: d } = a || {};
|
|
676
676
|
if (!a)
|
|
677
677
|
throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
678
|
-
return l != null && l.isInitialized || (l.use(
|
|
678
|
+
return l != null && l.isInitialized || (l.use(d).use(v).init({
|
|
679
679
|
debug: t,
|
|
680
680
|
fallbackLng: "en",
|
|
681
681
|
interpolation: {
|
|
@@ -700,24 +700,24 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
700
700
|
replaysSessionSampleRate: c,
|
|
701
701
|
replaysOnErrorSampleRate: a,
|
|
702
702
|
tracePropagationTargets: l,
|
|
703
|
-
ignoreErrors:
|
|
704
|
-
debug:
|
|
703
|
+
ignoreErrors: v,
|
|
704
|
+
debug: d,
|
|
705
705
|
environment: s,
|
|
706
|
-
...
|
|
706
|
+
...y
|
|
707
707
|
}) => {
|
|
708
|
-
const { libraries: E } = k(A), w = (
|
|
708
|
+
const { libraries: E } = k(A), w = (y == null ? void 0 : y.sentry) || (E == null ? void 0 : E.sentry), R = (y == null ? void 0 : y.reactRouter) || (E == null ? void 0 : E.reactRouter);
|
|
709
709
|
if (!w)
|
|
710
710
|
throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
711
|
-
if (!
|
|
711
|
+
if (!R)
|
|
712
712
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
713
713
|
if (w.isInitialized())
|
|
714
714
|
return null;
|
|
715
|
-
const { createRoutesFromChildren: u, matchRoutes: j, useLocation: S, useNavigationType: x } =
|
|
716
|
-
return (
|
|
717
|
-
debug:
|
|
715
|
+
const { createRoutesFromChildren: u, matchRoutes: j, useLocation: S, useNavigationType: x } = R;
|
|
716
|
+
return (d || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && w.init({
|
|
717
|
+
debug: d,
|
|
718
718
|
dsn: t,
|
|
719
719
|
environment: s || "production",
|
|
720
|
-
ignoreErrors: [...
|
|
720
|
+
ignoreErrors: [...v || [], /dynamically imported module/],
|
|
721
721
|
integrations: [
|
|
722
722
|
w.reactRouterV6BrowserTracingIntegration({
|
|
723
723
|
createRoutesFromChildren: u,
|
|
@@ -745,7 +745,10 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
745
745
|
if (!c)
|
|
746
746
|
throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
747
747
|
return t && (c.accessToken = t), null;
|
|
748
|
-
}
|
|
748
|
+
};
|
|
749
|
+
import("dayjs/locale/en");
|
|
750
|
+
import("dayjs/locale/fr");
|
|
751
|
+
const Nt = ({ language: t, ...n }) => {
|
|
749
752
|
const { libraries: i } = k(A), c = (n == null ? void 0 : n.dayjs) || (i == null ? void 0 : i.dayjs), a = (n == null ? void 0 : n.plugin) || (i == null ? void 0 : i.dayjsPlugin);
|
|
750
753
|
if (!c)
|
|
751
754
|
throw new Error(
|
|
@@ -754,56 +757,57 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
754
757
|
return Z(() => {
|
|
755
758
|
(async () => {
|
|
756
759
|
var d;
|
|
757
|
-
t || (d = navigator.language)
|
|
758
|
-
|
|
760
|
+
const v = t || ((d = navigator.language) == null ? void 0 : d.slice(0, 2)) || "en";
|
|
761
|
+
c.locale(v), a && a.forEach((s) => {
|
|
762
|
+
s && c.extend(s);
|
|
759
763
|
});
|
|
760
764
|
})().then();
|
|
761
765
|
}, [c, a, t]), null;
|
|
762
|
-
}, Et = (t) => t && typeof t == "function",
|
|
766
|
+
}, Et = (t) => t && typeof t == "function", pt = (t) => t && typeof t == "function", Wt = ({
|
|
763
767
|
children: t,
|
|
764
768
|
defaultQueriesOptions: n,
|
|
765
769
|
defaultMutationsOptions: i,
|
|
766
770
|
...c
|
|
767
771
|
}) => {
|
|
768
|
-
var s,
|
|
769
|
-
const { libraries: a } = k(A), l = (c == null ? void 0 : c.QueryClient) || ((s = a == null ? void 0 : a.reactQuery) == null ? void 0 : s.QueryClient),
|
|
772
|
+
var s, y;
|
|
773
|
+
const { libraries: a } = k(A), l = (c == null ? void 0 : c.QueryClient) || ((s = a == null ? void 0 : a.reactQuery) == null ? void 0 : s.QueryClient), v = (c == null ? void 0 : c.QueryClientProvider) || ((y = a == null ? void 0 : a.reactQuery) == null ? void 0 : y.QueryClientProvider);
|
|
770
774
|
if (!l)
|
|
771
775
|
throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
772
|
-
if (!
|
|
776
|
+
if (!v)
|
|
773
777
|
throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
774
|
-
if (!Et(
|
|
778
|
+
if (!Et(v))
|
|
775
779
|
throw new Error("Provided QueryClientProvider dependencies are not valid.");
|
|
776
|
-
if (!
|
|
780
|
+
if (!pt(l))
|
|
777
781
|
throw new Error("Provided QueryClient dependencies are not valid.");
|
|
778
|
-
const
|
|
782
|
+
const d = new l({
|
|
779
783
|
defaultOptions: {
|
|
780
784
|
mutations: {
|
|
781
785
|
...i
|
|
782
786
|
},
|
|
783
787
|
queries: {
|
|
784
|
-
getNextPageParam: (E, w,
|
|
788
|
+
getNextPageParam: (E, w, R) => E.length + (R || 0),
|
|
785
789
|
refetchOnWindowFocus: !1,
|
|
786
790
|
retry: 3,
|
|
787
791
|
...n
|
|
788
792
|
}
|
|
789
793
|
}
|
|
790
794
|
});
|
|
791
|
-
return /* @__PURE__ */ F.jsx(
|
|
795
|
+
return /* @__PURE__ */ F.jsx(v, { client: d, children: t });
|
|
792
796
|
}, Lt = (t) => {
|
|
793
|
-
var
|
|
794
|
-
const { libraries: n } = k(A), i = (t == null ? void 0 : t.i18) || (n == null ? void 0 : n.i18), c = ((
|
|
795
|
-
(
|
|
797
|
+
var y, E, w;
|
|
798
|
+
const { libraries: n } = k(A), i = (t == null ? void 0 : t.i18) || (n == null ? void 0 : n.i18), c = ((y = t == null ? void 0 : t.i18) == null ? void 0 : y.translateFunction) || ((E = n == null ? void 0 : n.i18) == null ? void 0 : E.translateFunction), a = ((w = i == null ? void 0 : i.i18next) == null ? void 0 : w.t) || c || ((R) => R), { unknownErrorTranslationKey: l = "error.unknownError" } = t || {}, v = a(l), d = ce(
|
|
799
|
+
(R) => {
|
|
796
800
|
var j, S, x, D, _, Y, N, W, C;
|
|
797
|
-
const { response: u } =
|
|
798
|
-
return u != null && u.reason ? String(u.reason) : (j = u == null ? void 0 : u.data) != null && j.reason ? String(u.data.reason) : (S = u == null ? void 0 : u.data) != null && S.message ? String(u.data.message) : (D = (x = u == null ? void 0 : u.data) == null ? void 0 : x.detail) != null && D.length && Array.isArray((_ = u == null ? void 0 : u.data) == null ? void 0 : _.detail) && ((N = (Y = u == null ? void 0 : u.data) == null ? void 0 : Y.detail[0]) != null && N.msg) && typeof ((C = (W = u == null ? void 0 : u.data) == null ? void 0 : W.detail[0]) == null ? void 0 : C.msg) == "string" ? String(u.data.detail[0].msg) :
|
|
801
|
+
const { response: u } = R || {};
|
|
802
|
+
return u != null && u.reason ? String(u.reason) : (j = u == null ? void 0 : u.data) != null && j.reason ? String(u.data.reason) : (S = u == null ? void 0 : u.data) != null && S.message ? String(u.data.message) : (D = (x = u == null ? void 0 : u.data) == null ? void 0 : x.detail) != null && D.length && Array.isArray((_ = u == null ? void 0 : u.data) == null ? void 0 : _.detail) && ((N = (Y = u == null ? void 0 : u.data) == null ? void 0 : Y.detail[0]) != null && N.msg) && typeof ((C = (W = u == null ? void 0 : u.data) == null ? void 0 : W.detail[0]) == null ? void 0 : C.msg) == "string" ? String(u.data.detail[0].msg) : v;
|
|
799
803
|
},
|
|
800
|
-
[
|
|
804
|
+
[v]
|
|
801
805
|
);
|
|
802
|
-
return { getErrorCode: ce((
|
|
806
|
+
return { getErrorCode: ce((R) => {
|
|
803
807
|
var j, S, x;
|
|
804
|
-
const { response: u } =
|
|
808
|
+
const { response: u } = R || {};
|
|
805
809
|
return 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((S = u == null ? void 0 : u.data) == null ? void 0 : S.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";
|
|
806
|
-
}, []), printError:
|
|
810
|
+
}, []), printError: d };
|
|
807
811
|
}, Vt = ({
|
|
808
812
|
data: t,
|
|
809
813
|
fetchNextPage: n,
|
|
@@ -812,20 +816,20 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
812
816
|
isLoading: a,
|
|
813
817
|
enabled: l = !0
|
|
814
818
|
}) => {
|
|
815
|
-
const
|
|
819
|
+
const v = ce(
|
|
816
820
|
async (s) => {
|
|
817
821
|
i || !l || await n({ pageParam: (s == null ? void 0 : s.pageParam) || s.visibleRowsCount });
|
|
818
822
|
},
|
|
819
823
|
[l, n, i]
|
|
820
|
-
),
|
|
824
|
+
), d = le(() => {
|
|
821
825
|
if (t)
|
|
822
|
-
return t.pages.reduce((s,
|
|
826
|
+
return t.pages.reduce((s, y) => [...s, ...y], []);
|
|
823
827
|
}, [t]);
|
|
824
828
|
return {
|
|
825
|
-
fetchNextPageOnRowsScrollEnd:
|
|
829
|
+
fetchNextPageOnRowsScrollEnd: v,
|
|
826
830
|
isLoading: i || a,
|
|
827
831
|
loadingVariant: c ? "skeleton" : "linear",
|
|
828
|
-
rows:
|
|
832
|
+
rows: d
|
|
829
833
|
};
|
|
830
834
|
}, zt = (t) => {
|
|
831
835
|
const { libraries: n } = k(A), i = (t == null ? void 0 : t.axios) || (n == null ? void 0 : n.axios);
|
|
@@ -835,11 +839,11 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
835
839
|
clearAuthenticationToken: () => {
|
|
836
840
|
i.defaults.headers.common.Authorization = null;
|
|
837
841
|
},
|
|
838
|
-
setAuthenticationToken: ({ tokenType: l, accessToken:
|
|
839
|
-
i.defaults.headers.common.Authorization = `${l} ${
|
|
842
|
+
setAuthenticationToken: ({ tokenType: l, accessToken: v }) => {
|
|
843
|
+
i.defaults.headers.common.Authorization = `${l} ${v}`;
|
|
840
844
|
}
|
|
841
845
|
};
|
|
842
|
-
},
|
|
846
|
+
}, Rt = ({ library: t, date: n, format: i = "ll" }) => t(n).format(i), wt = (t, n = "km") => {
|
|
843
847
|
const i = Number(t);
|
|
844
848
|
return Number.isNaN(i) ? `0 ${n}` : `${i.toFixed(2)} ${n}`;
|
|
845
849
|
}, _t = (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: i }) => {
|
|
@@ -850,25 +854,25 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
850
854
|
}, Mt = (t) => {
|
|
851
855
|
const { apiURL: n, libraries: i } = k(A), c = (t == null ? void 0 : t.dayjs) || (i == null ? void 0 : i.dayjs);
|
|
852
856
|
return {
|
|
853
|
-
dateAdapter: (
|
|
857
|
+
dateAdapter: (v, d) => {
|
|
854
858
|
if (!c)
|
|
855
859
|
throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
856
|
-
return
|
|
857
|
-
date:
|
|
858
|
-
format:
|
|
860
|
+
return Rt({
|
|
861
|
+
date: v,
|
|
862
|
+
format: d,
|
|
859
863
|
library: c
|
|
860
864
|
});
|
|
861
865
|
},
|
|
862
866
|
distanceAdapter: wt,
|
|
863
|
-
filePathAdapter: (
|
|
867
|
+
filePathAdapter: (v, d) => {
|
|
864
868
|
if (!n)
|
|
865
869
|
throw new Error(
|
|
866
870
|
"API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter."
|
|
867
871
|
);
|
|
868
872
|
return bt({
|
|
869
873
|
apiURL: n,
|
|
870
|
-
path:
|
|
871
|
-
size:
|
|
874
|
+
path: v,
|
|
875
|
+
size: d
|
|
872
876
|
});
|
|
873
877
|
}
|
|
874
878
|
};
|
|
@@ -888,14 +892,14 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
888
892
|
}
|
|
889
893
|
}, n), {})) || {};
|
|
890
894
|
}, Ut = (t) => (Array.isArray(t) ? t : [t]).reduce((i, c) => {
|
|
891
|
-
const { output: a, operationsToGenerateInfiniteQueryHook: l, input:
|
|
895
|
+
const { output: a, operationsToGenerateInfiniteQueryHook: l, input: v = "./openapi.json" } = c || {}, d = jt(v);
|
|
892
896
|
return {
|
|
893
897
|
...i,
|
|
894
|
-
[
|
|
898
|
+
[d]: {
|
|
895
899
|
hooks: {
|
|
896
900
|
afterAllFilesWrite: "prettier src/api/ --write"
|
|
897
901
|
},
|
|
898
|
-
input:
|
|
902
|
+
input: v,
|
|
899
903
|
output: {
|
|
900
904
|
baseUrl: a == null ? void 0 : a.baseUrl,
|
|
901
905
|
client: "react-query",
|
|
@@ -916,8 +920,8 @@ const A = dt({}), Ot = ({ children: t, apiURL: n, libraries: i }) => {
|
|
|
916
920
|
useQuery: !0
|
|
917
921
|
}
|
|
918
922
|
},
|
|
919
|
-
schemas: (a == null ? void 0 : a.schemas) || `src/api/${
|
|
920
|
-
target: (a == null ? void 0 : a.target) || `src/api/${
|
|
923
|
+
schemas: (a == null ? void 0 : a.schemas) || `src/api/${d}/model`,
|
|
924
|
+
target: (a == null ? void 0 : a.target) || `src/api/${d}/services/api.ts`,
|
|
921
925
|
...a
|
|
922
926
|
}
|
|
923
927
|
}
|
|
@@ -935,7 +939,7 @@ export {
|
|
|
935
939
|
Ft as MaskTextField,
|
|
936
940
|
Wt as QueryClientProviderWithConfig,
|
|
937
941
|
At as RequireAuth,
|
|
938
|
-
|
|
942
|
+
Rt as dateAdapter,
|
|
939
943
|
wt as distanceAdapter,
|
|
940
944
|
Ut as getOrvalConfig,
|
|
941
945
|
Mt as useAdapter,
|
package/dist/main.umd.cjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ue;function Ne(){if(ue)return B;ue=1;var t=h,n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function d
|
|
9
|
+
*/var ue;function Ne(){if(ue)return B;ue=1;var t=h,n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function v(d,u,m){var R,_={},C=null,c=null;m!==void 0&&(C=""+m),u.key!==void 0&&(C=""+u.key),u.ref!==void 0&&(c=u.ref);for(R in u)s.call(u,R)&&!l.hasOwnProperty(R)&&(_[R]=u[R]);if(d&&d.defaultProps)for(R in u=d.defaultProps,u)_[R]===void 0&&(_[R]=u[R]);return{$$typeof:n,type:d,key:C,ref:c,props:_,_owner:a.current}}return B.Fragment=i,B.jsx=v,B.jsxs=v,B}var G={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var le;function Le(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var t=h,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),
|
|
17
|
+
*/var le;function Le(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var t=h,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),d=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),c=Symbol.for("react.offscreen"),S=Symbol.iterator,I="@@iterator";function x(e){if(e===null||typeof e!="object")return null;var r=S&&e[S]||e[I];return typeof r=="function"?r:null}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,o=new Array(r>1?r-1:0),f=1;f<r;f++)o[f-1]=arguments[f];N("error",e,o)}}function N(e,r,o){{var f=k.ReactDebugCurrentFrame,E=f.getStackAddendum();E!==""&&(r+="%s",o=o.concat([E]));var p=o.map(function(y){return String(y)});p.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,p)}}var L=!1,M=!1,j=!1,ve=!1,ge=!1,Q;Q=Symbol.for("react.module.reference");function lt(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===l||ge||e===a||e===m||e===R||ve||e===c||L||M||j||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===_||e.$$typeof===v||e.$$typeof===d||e.$$typeof===u||e.$$typeof===Q||e.getModuleId!==void 0))}function ft(e,r,o){var f=e.displayName;if(f)return f;var E=r.displayName||r.name||"";return E!==""?o+"("+E+")":o}function ye(e){return e.displayName||"Context"}function Y(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 i:return"Portal";case l:return"Profiler";case a:return"StrictMode";case m:return"Suspense";case R:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return ye(r)+".Consumer";case v:var o=e;return ye(o._context)+".Provider";case u:return ft(e,e.render,"ForwardRef");case _:var f=e.displayName||null;return f!==null?f:Y(e.type)||"Memo";case C:{var E=e,p=E._payload,y=E._init;try{return Y(y(p))}catch{return null}}}return null}var z=Object.assign,J=0,me,he,Ee,Re,pe,we,Ce;function _e(){}_e.__reactDisabledLog=!0;function dt(){{if(J===0){me=console.log,he=console.info,Ee=console.warn,Re=console.error,pe=console.group,we=console.groupCollapsed,Ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:_e,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}J++}}function vt(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},e,{value:me}),info:z({},e,{value:he}),warn:z({},e,{value:Ee}),error:z({},e,{value:Re}),group:z({},e,{value:pe}),groupCollapsed:z({},e,{value:we}),groupEnd:z({},e,{value:Ce})})}J<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=k.ReactCurrentDispatcher,re;function H(e,r,o){{if(re===void 0)try{throw Error()}catch(E){var f=E.stack.trim().match(/\n( *(at )?)/);re=f&&f[1]||""}return`
|
|
18
18
|
`+re+e}}var ne=!1,K;{var gt=typeof WeakMap=="function"?WeakMap:Map;K=new gt}function be(e,r){if(!e||ne)return"";{var o=K.get(e);if(o!==void 0)return o}var f;ne=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=te.current,te.current=null,dt();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(W){f=W}Reflect.construct(e,[],y)}else{try{y.call()}catch(W){f=W}e.call(y.prototype)}}else{try{throw Error()}catch(W){f=W}e()}}catch(W){if(W&&f&&typeof W.stack=="string"){for(var g=W.stack.split(`
|
|
19
19
|
`),O=f.stack.split(`
|
|
20
20
|
`),P=g.length-1,T=O.length-1;P>=1&&T>=0&&g[P]!==O[T];)T--;for(;P>=1&&T>=0;P--,T--)if(g[P]!==O[T]){if(P!==1||T!==1)do if(P--,T--,T<0||g[P]!==O[T]){var D=`
|
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+e+"`."}return""}}function xt(e){return""}var De={};function Ot(e){{var r=Ie();if(!r){var o=typeof e=="string"?e:e.displayName||e.name;o&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+o+">.")}return r}}function ke(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=Ot(r);if(De[o])return;De[o]=!0;var f="";e&&e._owner&&e._owner!==ae.current&&(f=" It was passed a child from "+Y(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.',o,f),V(null)}}function Fe(e,r){{if(typeof e!="object")return;if(oe(e))for(var o=0;o<e.length;o++){var f=e[o];se(f)&&ke(f,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var E=x(e);if(typeof E=="function"&&E!==e.entries)for(var p=E.call(e),y;!(y=p.next()).done;)se(y.value)&&ke(y.value,r)}}}function At(e){{var r=e.type;if(r==null||typeof r=="string")return;var o;if(typeof r=="function")o=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===_))o=r.propTypes;else return;if(o){var f=Y(r);ht(o,e.props,"prop",f,e)}else if(r.PropTypes!==void 0&&!ce){ce=!0;var E=Y(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"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 It(e){{for(var r=Object.keys(e.props),o=0;o<r.length;o++){var f=r[o];if(f!=="children"&&f!=="key"){V(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),V(null);break}}e.ref!==null&&(V(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function Ye(e,r,o,f,E,p){{var y=lt(e);if(!y){var g="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(g+=" 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=xt();O?g+=O:g+=Ie();var P;e===null?P="null":oe(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(Y(e.type)||"Unknown")+" />",g=" 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,g)}var T=St(e,r,o,E,p);if(T==null)return T;if(y){var D=r.children;if(D!==void 0)if(f)if(oe(D)){for(var U=0;U<D.length;U++)Fe(D[U],e);Object.freeze&&Object.freeze(D)}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 Fe(D,e)}return e===s?It(T):At(T),T}}function Dt(e,r,o){return Ye(e,r,o,!0)}function kt(e,r,o){return Ye(e,r,o,!1)}var Ft=kt,Yt=Dt;G.Fragment=s,G.jsx=Ft,G.jsxs=Yt}()),G}process.env.NODE_ENV==="production"?ee.exports=Ne():ee.exports=Le();var F=ee.exports;const A=h.createContext({}),Me=({children:t,apiURL:n,libraries:i})=>{const s=h.useMemo(()=>({apiURL:n,libraries:i}),[n,i]);return F.jsx(A.Provider,{value:s,children:t})},ze=({Fallback:t,isLogged:n,loginPath:i="/login",localStorageKey:s="user",redirect401Path:a="/login",...l})=>{var b,N,L,M;const{libraries:d}=h.useContext(A),v=(l==null?void 0:l.reactRouter)||(d==null?void 0:d.reactRouter),u=(l==null?void 0:l.axios)||(d==null?void 0:d.axios);if(!v)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[m,R]=h.useState(null),{useLocation:_,Navigate:C,Outlet:c}=v,S=_(),I=h.useRef(!1),x=typeof n=="function"?n():!!n,k=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return h.useEffect(()=>{I.current||(I.current=!0,u.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&&(u.defaults.headers.common.Authorization=null,localStorage.removeItem(s),R(a)),Promise.reject(j)}))},[u.defaults.headers.common,u.interceptors.response,s,a]),k&&!m?F.jsx(h.Suspense,{fallback:t,children:(N=(b=S.state)==null?void 0:b.from)!=null&&N.state&&((M=(L=S.state)==null?void 0:L.from)==null?void 0:M.pathname)===i?F.jsx(C,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):F.jsx(c,{})}):F.jsx(C,{to:i,state:{from:S},replace:!0})},Ve=({...t})=>{const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),s=(t==null?void 0:t.gtm)||(n==null?void 0:n.gtm);if(!i)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!s)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:a}=s,{useLocation:l,Outlet:d}=i,{pathname:v}=l(),{sendEvent:u}=a();return h.useEffect(()=>{u({event:"pageView",pathname:v})},[v,u]),F.jsx(d,{})},Ue=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:i="accessToken",postContentType:s="application/json",...a})=>{const{apiURL:l=a.apiURL,libraries:d}=h.useContext(A),v=(a==null?void 0:a.axios)||(d==null?void 0:d.axios);if(!v)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(v!=null&&v.defaults))return null;const u=localStorage.getItem(n),m=u?JSON.parse(u):null,R=m!=null&&m[t]?m[t]:null,_=m!=null&&m[i]?m[i]:null,C=u?`${R} ${_}`:null;return v.defaults.baseURL=l,v.defaults.headers.post["Content-Type"]=s,C&&(v.defaults.headers.common.Authorization=C),null},Be=({debug:t,resources:n,...i})=>{const{libraries:s}=h.useContext(A),a=(i==null?void 0:i.i18)||(s==null?void 0:s.i18),{i18next:l,initReactI18next:d,languageDetector:v}=a||{};if(!a)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return l!=null&&l.isInitialized||(l.use(v).use(d).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==l.resolvedLanguage&&l.resolvedLanguage&&document.documentElement.setAttribute("lang",l.resolvedLanguage)}),l.on("languageChanged",u=>{document.documentElement.setAttribute("lang",u)})),null},Ge=({dsn:t,integrations:n,tracesSampleRate:i,replaysSessionSampleRate:s,replaysOnErrorSampleRate:a,tracePropagationTargets:l,ignoreErrors:d,debug:v,environment:u,...m})=>{const{libraries:R}=h.useContext(A),_=(m==null?void 0:m.sentry)||(R==null?void 0:R.sentry),C=(m==null?void 0:m.reactRouter)||(R==null?void 0:R.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:S,useLocation:I,useNavigationType:x}=C;return(v||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:v,dsn:t,environment:u||"production",ignoreErrors:[...d||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:c,matchRoutes:S,useEffect:h.useEffect,useLocation:I,useNavigationType:x}),...n||[]],replaysOnErrorSampleRate:a||1,replaysSessionSampleRate:s||.1,tracePropagationTargets:l,tracesSampleRate:i||1}),null},Qe=({IMaskMixin:t,...n})=>{const i=h.useMemo(()=>t(({TextField:s,...a})=>F.jsx(s,{...a})),[t]);return F.jsx(i,{...n})},Je=({accessToken:t,...n})=>{const{libraries:i}=h.useContext(A),s=(n==null?void 0:n.mapbox)||(i==null?void 0:i.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:i}=h.useContext(A),s=(n==null?void 0:n.dayjs)||(i==null?void 0:i.dayjs),a=(n==null?void 0:n.plugin)||(i==null?void 0:i.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;t||(d=navigator.language)!=null&&d.slice(0,2),a&&a.forEach(v=>{v&&s.extend(v)})})().then()},[s,a,t]),null},He=t=>t&&typeof t=="function",Ke=t=>t&&typeof t=="function",Ze=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:i,...s})=>{var u,m;const{libraries:a}=h.useContext(A),l=(s==null?void 0:s.QueryClient)||((u=a==null?void 0:a.reactQuery)==null?void 0:u.QueryClient),d=(s==null?void 0:s.QueryClientProvider)||((m=a==null?void 0:a.reactQuery)==null?void 0:m.QueryClientProvider);if(!l)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!d)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!He(d))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!Ke(l))throw new Error("Provided QueryClient dependencies are not valid.");const v=new l({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(R,_,C)=>R.length+(C||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(d,{client:v,children:t})},$e=t=>{var m,R,_;const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),s=((m=t==null?void 0:t.i18)==null?void 0:m.translateFunction)||((R=n==null?void 0:n.i18)==null?void 0:R.translateFunction),a=((_=i==null?void 0:i.i18next)==null?void 0:_.t)||s||(C=>C),{unknownErrorTranslationKey:l="error.unknownError"}=t||{},d=a(l),v=h.useCallback(C=>{var S,I,x,k,b,N,L,M,j;const{response:c}=C||{};return c!=null&&c.reason?String(c.reason):(S=c==null?void 0:c.data)!=null&&S.reason?String(c.data.reason):(I=c==null?void 0:c.data)!=null&&I.message?String(c.data.message):(k=(x=c==null?void 0:c.data)==null?void 0:x.detail)!=null&&k.length&&Array.isArray((b=c==null?void 0:c.data)==null?void 0:b.detail)&&((L=(N=c==null?void 0:c.data)==null?void 0:N.detail[0])!=null&&L.msg)&&typeof((j=(M=c==null?void 0:c.data)==null?void 0:M.detail[0])==null?void 0:j.msg)=="string"?String(c.data.detail[0].msg):d},[d]);return{getErrorCode:h.useCallback(C=>{var S,I,x;const{response:c}=C||{};return c!=null&&c.error_code?String(c==null?void 0:c.error_code):(S=c==null?void 0:c.data)!=null&&S.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:v}},qe=({data:t,fetchNextPage:n,isFetchingNextPage:i,isInitialLoading:s,isLoading:a,enabled:l=!0})=>{const d=h.useCallback(async u=>{i||!l||await n({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[l,n,i]),v=h.useMemo(()=>{if(t)return t.pages.reduce((u,m)=>[...u,...m],[])},[t]);return{fetchNextPageOnRowsScrollEnd:d,isLoading:i||a,loadingVariant:s?"skeleton":"linear",rows:v}},et=t=>{const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.axios)||(n==null?void 0:n.axios);if(!i)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");return{clearAuthenticationToken:()=>{i.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:l,accessToken:d})=>{i.defaults.headers.common.Authorization=`${l} ${d}`}}},fe=({library:t,date:n,format:i="ll"})=>t(n).format(i),de=(t,n="km")=>{const i=Number(t);return Number.isNaN(i)?`0 ${n}`:`${i.toFixed(2)} ${n}`},tt=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}`,rt=({path:t,size:n,apiURL:i})=>{if(!t)return"";const s=tt(t),a=`${i}${s}`,l=a.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&l?`${a.replace("/files",`/thumbs/${n}`)}`:a},nt=t=>{const{apiURL:n,libraries:i}=h.useContext(A),s=(t==null?void 0:t.dayjs)||(i==null?void 0:i.dayjs);return{dateAdapter:(d,v)=>{if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return fe({date:d,format:v,library:s})},distanceAdapter:de,filePathAdapter:(d,v)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return rt({apiURL:n,path:d,size:v})}}},ot=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),it=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)},at=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),ct=(t,n,i)=>{const s=it(n),a=ot(i);return`${s}${a}`},st=t=>{if(t)return(t==null?void 0:t.reduce((n,i)=>(n[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},ut=t=>(Array.isArray(t)?t:[t]).reduce((i,s)=>{const{output:a,operationsToGenerateInfiniteQueryHook:l,input:d="./openapi.json"}=s||{},v=at(d);return{...i,[v]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:d,output:{baseUrl:a==null?void 0:a.baseUrl,client:"react-query",mode:"tags-split",override:{...(l==null?void 0:l.length)&&{operations:st(l)},header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:ct,query:{useQuery:!0}},schemas:(a==null?void 0:a.schemas)||`src/api/${v}/model`,target:(a==null?void 0:a.target)||`src/api/${v}/services/api.ts`,...a}}}},{});w.GTMSendPageView=Ve,w.InitializeAxiosConfig=Ue,w.InitializeDaysJSConfig=Xe,w.InitializeI18nConfig=Be,w.InitializeMapBoxConfig=Je,w.InitializeSentryConfig=Ge,w.InjectDependenciesContext=A,w.InjectDependenciesProvider=Me,w.MaskTextField=Qe,w.QueryClientProviderWithConfig=Ze,w.RequireAuth=ze,w.dateAdapter=fe,w.distanceAdapter=de,w.getOrvalConfig=ut,w.useAdapter=nt,w.useAuth=et,w.useInfiniteDataGrid=qe,w.useResponseError=$e,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
|
25
|
+
Check the top-level render call using <`+o+">.")}return r}}function ke(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=Ot(r);if(De[o])return;De[o]=!0;var f="";e&&e._owner&&e._owner!==ae.current&&(f=" It was passed a child from "+Y(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.',o,f),V(null)}}function Fe(e,r){{if(typeof e!="object")return;if(oe(e))for(var o=0;o<e.length;o++){var f=e[o];se(f)&&ke(f,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var E=x(e);if(typeof E=="function"&&E!==e.entries)for(var p=E.call(e),y;!(y=p.next()).done;)se(y.value)&&ke(y.value,r)}}}function At(e){{var r=e.type;if(r==null||typeof r=="string")return;var o;if(typeof r=="function")o=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===_))o=r.propTypes;else return;if(o){var f=Y(r);ht(o,e.props,"prop",f,e)}else if(r.PropTypes!==void 0&&!ce){ce=!0;var E=Y(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"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 It(e){{for(var r=Object.keys(e.props),o=0;o<r.length;o++){var f=r[o];if(f!=="children"&&f!=="key"){V(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),V(null);break}}e.ref!==null&&(V(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function Ye(e,r,o,f,E,p){{var y=lt(e);if(!y){var g="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(g+=" 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=xt();O?g+=O:g+=Ie();var P;e===null?P="null":oe(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(Y(e.type)||"Unknown")+" />",g=" 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,g)}var T=St(e,r,o,E,p);if(T==null)return T;if(y){var D=r.children;if(D!==void 0)if(f)if(oe(D)){for(var U=0;U<D.length;U++)Fe(D[U],e);Object.freeze&&Object.freeze(D)}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 Fe(D,e)}return e===s?It(T):At(T),T}}function Dt(e,r,o){return Ye(e,r,o,!0)}function kt(e,r,o){return Ye(e,r,o,!1)}var Ft=kt,Yt=Dt;G.Fragment=s,G.jsx=Ft,G.jsxs=Yt}()),G}process.env.NODE_ENV==="production"?ee.exports=Ne():ee.exports=Le();var F=ee.exports;const A=h.createContext({}),Me=({children:t,apiURL:n,libraries:i})=>{const s=h.useMemo(()=>({apiURL:n,libraries:i}),[n,i]);return F.jsx(A.Provider,{value:s,children:t})},ze=({Fallback:t,isLogged:n,loginPath:i="/login",localStorageKey:s="user",redirect401Path:a="/login",...l})=>{var b,N,L,M;const{libraries:v}=h.useContext(A),d=(l==null?void 0:l.reactRouter)||(v==null?void 0:v.reactRouter),u=(l==null?void 0:l.axios)||(v==null?void 0:v.axios);if(!d)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[m,R]=h.useState(null),{useLocation:_,Navigate:C,Outlet:c}=d,S=_(),I=h.useRef(!1),x=typeof n=="function"?n():!!n,k=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return h.useEffect(()=>{I.current||(I.current=!0,u.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&&(u.defaults.headers.common.Authorization=null,localStorage.removeItem(s),R(a)),Promise.reject(j)}))},[u.defaults.headers.common,u.interceptors.response,s,a]),k&&!m?F.jsx(h.Suspense,{fallback:t,children:(N=(b=S.state)==null?void 0:b.from)!=null&&N.state&&((M=(L=S.state)==null?void 0:L.from)==null?void 0:M.pathname)===i?F.jsx(C,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):F.jsx(c,{})}):F.jsx(C,{to:i,state:{from:S},replace:!0})},Ve=({...t})=>{const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),s=(t==null?void 0:t.gtm)||(n==null?void 0:n.gtm);if(!i)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!s)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:a}=s,{useLocation:l,Outlet:v}=i,{pathname:d}=l(),{sendEvent:u}=a();return h.useEffect(()=>{u({event:"pageView",pathname:d})},[d,u]),F.jsx(v,{})},Ue=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:i="accessToken",postContentType:s="application/json",...a})=>{const{apiURL:l=a.apiURL,libraries:v}=h.useContext(A),d=(a==null?void 0:a.axios)||(v==null?void 0:v.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),m=u?JSON.parse(u):null,R=m!=null&&m[t]?m[t]:null,_=m!=null&&m[i]?m[i]:null,C=u?`${R} ${_}`:null;return d.defaults.baseURL=l,d.defaults.headers.post["Content-Type"]=s,C&&(d.defaults.headers.common.Authorization=C),null},Be=({debug:t,resources:n,...i})=>{const{libraries:s}=h.useContext(A),a=(i==null?void 0:i.i18)||(s==null?void 0:s.i18),{i18next:l,initReactI18next:v,languageDetector:d}=a||{};if(!a)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return l!=null&&l.isInitialized||(l.use(d).use(v).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==l.resolvedLanguage&&l.resolvedLanguage&&document.documentElement.setAttribute("lang",l.resolvedLanguage)}),l.on("languageChanged",u=>{document.documentElement.setAttribute("lang",u)})),null},Ge=({dsn:t,integrations:n,tracesSampleRate:i,replaysSessionSampleRate:s,replaysOnErrorSampleRate:a,tracePropagationTargets:l,ignoreErrors:v,debug:d,environment:u,...m})=>{const{libraries:R}=h.useContext(A),_=(m==null?void 0:m.sentry)||(R==null?void 0:R.sentry),C=(m==null?void 0:m.reactRouter)||(R==null?void 0:R.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:S,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:[...v||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:c,matchRoutes:S,useEffect:h.useEffect,useLocation:I,useNavigationType:x}),...n||[]],replaysOnErrorSampleRate:a||1,replaysSessionSampleRate:s||.1,tracePropagationTargets:l,tracesSampleRate:i||1}),null},Qe=({IMaskMixin:t,...n})=>{const i=h.useMemo(()=>t(({TextField:s,...a})=>F.jsx(s,{...a})),[t]);return F.jsx(i,{...n})},Je=({accessToken:t,...n})=>{const{libraries:i}=h.useContext(A),s=(n==null?void 0:n.mapbox)||(i==null?void 0:i.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};import("dayjs/locale/en"),import("dayjs/locale/fr");const Xe=({language:t,...n})=>{const{libraries:i}=h.useContext(A),s=(n==null?void 0:n.dayjs)||(i==null?void 0:i.dayjs),a=(n==null?void 0:n.plugin)||(i==null?void 0:i.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 v=t||((d=navigator.language)==null?void 0:d.slice(0,2))||"en";s.locale(v),a&&a.forEach(u=>{u&&s.extend(u)})})().then()},[s,a,t]),null},He=t=>t&&typeof t=="function",Ke=t=>t&&typeof t=="function",Ze=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:i,...s})=>{var u,m;const{libraries:a}=h.useContext(A),l=(s==null?void 0:s.QueryClient)||((u=a==null?void 0:a.reactQuery)==null?void 0:u.QueryClient),v=(s==null?void 0:s.QueryClientProvider)||((m=a==null?void 0:a.reactQuery)==null?void 0:m.QueryClientProvider);if(!l)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!v)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!He(v))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!Ke(l))throw new Error("Provided QueryClient dependencies are not valid.");const d=new l({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(R,_,C)=>R.length+(C||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(v,{client:d,children:t})},$e=t=>{var m,R,_;const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),s=((m=t==null?void 0:t.i18)==null?void 0:m.translateFunction)||((R=n==null?void 0:n.i18)==null?void 0:R.translateFunction),a=((_=i==null?void 0:i.i18next)==null?void 0:_.t)||s||(C=>C),{unknownErrorTranslationKey:l="error.unknownError"}=t||{},v=a(l),d=h.useCallback(C=>{var S,I,x,k,b,N,L,M,j;const{response:c}=C||{};return c!=null&&c.reason?String(c.reason):(S=c==null?void 0:c.data)!=null&&S.reason?String(c.data.reason):(I=c==null?void 0:c.data)!=null&&I.message?String(c.data.message):(k=(x=c==null?void 0:c.data)==null?void 0:x.detail)!=null&&k.length&&Array.isArray((b=c==null?void 0:c.data)==null?void 0:b.detail)&&((L=(N=c==null?void 0:c.data)==null?void 0:N.detail[0])!=null&&L.msg)&&typeof((j=(M=c==null?void 0:c.data)==null?void 0:M.detail[0])==null?void 0:j.msg)=="string"?String(c.data.detail[0].msg):v},[v]);return{getErrorCode:h.useCallback(C=>{var S,I,x;const{response:c}=C||{};return c!=null&&c.error_code?String(c==null?void 0:c.error_code):(S=c==null?void 0:c.data)!=null&&S.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}},qe=({data:t,fetchNextPage:n,isFetchingNextPage:i,isInitialLoading:s,isLoading:a,enabled:l=!0})=>{const v=h.useCallback(async u=>{i||!l||await n({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[l,n,i]),d=h.useMemo(()=>{if(t)return t.pages.reduce((u,m)=>[...u,...m],[])},[t]);return{fetchNextPageOnRowsScrollEnd:v,isLoading:i||a,loadingVariant:s?"skeleton":"linear",rows:d}},et=t=>{const{libraries:n}=h.useContext(A),i=(t==null?void 0:t.axios)||(n==null?void 0:n.axios);if(!i)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");return{clearAuthenticationToken:()=>{i.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:l,accessToken:v})=>{i.defaults.headers.common.Authorization=`${l} ${v}`}}},fe=({library:t,date:n,format:i="ll"})=>t(n).format(i),de=(t,n="km")=>{const i=Number(t);return Number.isNaN(i)?`0 ${n}`:`${i.toFixed(2)} ${n}`},tt=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}`,rt=({path:t,size:n,apiURL:i})=>{if(!t)return"";const s=tt(t),a=`${i}${s}`,l=a.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&l?`${a.replace("/files",`/thumbs/${n}`)}`:a},nt=t=>{const{apiURL:n,libraries:i}=h.useContext(A),s=(t==null?void 0:t.dayjs)||(i==null?void 0:i.dayjs);return{dateAdapter:(v,d)=>{if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return fe({date:v,format:d,library:s})},distanceAdapter:de,filePathAdapter:(v,d)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return rt({apiURL:n,path:v,size:d})}}},ot=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),it=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)},at=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),ct=(t,n,i)=>{const s=it(n),a=ot(i);return`${s}${a}`},st=t=>{if(t)return(t==null?void 0:t.reduce((n,i)=>(n[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},ut=t=>(Array.isArray(t)?t:[t]).reduce((i,s)=>{const{output:a,operationsToGenerateInfiniteQueryHook:l,input:v="./openapi.json"}=s||{},d=at(v);return{...i,[d]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:v,output:{baseUrl:a==null?void 0:a.baseUrl,client:"react-query",mode:"tags-split",override:{...(l==null?void 0:l.length)&&{operations:st(l)},header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:ct,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}}}},{});w.GTMSendPageView=Ve,w.InitializeAxiosConfig=Ue,w.InitializeDaysJSConfig=Xe,w.InitializeI18nConfig=Be,w.InitializeMapBoxConfig=Je,w.InitializeSentryConfig=Ge,w.InjectDependenciesContext=A,w.InjectDependenciesProvider=Me,w.MaskTextField=Qe,w.QueryClientProviderWithConfig=Ze,w.RequireAuth=ze,w.dateAdapter=fe,w.distanceAdapter=de,w.getOrvalConfig=ut,w.useAdapter=nt,w.useAuth=et,w.useInfiniteDataGrid=qe,w.useResponseError=$e,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|