@tracktor/shared-module 2.4.0 → 2.4.1
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 +173 -169
- package/dist/main.umd.cjs +8 -8
- 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
|
|
2
|
-
var
|
|
1
|
+
import Ye, { createContext as gt, useMemo as fe, useContext as I, useState as We, useRef as mt, useEffect as V, Suspense as ht, useCallback as te } from "react";
|
|
2
|
+
var le = { exports: {} }, G = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -9,17 +9,17 @@ var ce = { exports: {} }, G = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
12
|
+
var Le;
|
|
13
13
|
function yt() {
|
|
14
|
-
if (
|
|
15
|
-
|
|
14
|
+
if (Le) return G;
|
|
15
|
+
Le = 1;
|
|
16
16
|
var t = Ye, n = Symbol.for("react.element"), o = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, i = 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
|
-
var y, w = {},
|
|
19
|
-
g !== void 0 && (
|
|
18
|
+
var y, w = {}, p = null, u = null;
|
|
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:
|
|
22
|
+
return { $$typeof: n, type: d, key: p, ref: u, props: w, _owner: i.current };
|
|
23
23
|
}
|
|
24
24
|
return G.Fragment = o, G.jsx = l, G.jsxs = l, G;
|
|
25
25
|
}
|
|
@@ -33,10 +33,10 @@ var Q = {};
|
|
|
33
33
|
* This source code is licensed under the MIT license found in the
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
|
-
var
|
|
36
|
+
var Ne;
|
|
37
37
|
function Et() {
|
|
38
|
-
return
|
|
39
|
-
var t = Ye, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), i = 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"),
|
|
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"), i = 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"), j = Symbol.iterator, T = "@@iterator";
|
|
40
40
|
function x(e) {
|
|
41
41
|
if (e === null || typeof e != "object")
|
|
42
42
|
return null;
|
|
@@ -55,32 +55,32 @@ function Et() {
|
|
|
55
55
|
{
|
|
56
56
|
var v = k.ReactDebugCurrentFrame, E = v.getStackAddendum();
|
|
57
57
|
E !== "" && (r += "%s", a = a.concat([E]));
|
|
58
|
-
var
|
|
58
|
+
var R = a.map(function(h) {
|
|
59
59
|
return String(h);
|
|
60
60
|
});
|
|
61
|
-
|
|
61
|
+
R.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, R);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
var N = !1, Y = !1, b = !1,
|
|
64
|
+
var N = !1, Y = !1, b = !1, de = !1, ve = !1, U;
|
|
65
65
|
U = Symbol.for("react.module.reference");
|
|
66
|
-
function
|
|
67
|
-
return !!(typeof e == "string" || typeof e == "function" || e === s || e === f ||
|
|
66
|
+
function ze(e) {
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === s || e === f || ve || e === i || 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
|
|
73
|
+
function Me(e, r, a) {
|
|
74
74
|
var v = e.displayName;
|
|
75
75
|
if (v)
|
|
76
76
|
return v;
|
|
77
77
|
var E = r.displayName || r.name || "";
|
|
78
78
|
return E !== "" ? a + "(" + E + ")" : a;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function ge(e) {
|
|
81
81
|
return e.displayName || "Context";
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function D(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")
|
|
@@ -105,19 +105,19 @@ function Et() {
|
|
|
105
105
|
switch (e.$$typeof) {
|
|
106
106
|
case d:
|
|
107
107
|
var r = e;
|
|
108
|
-
return
|
|
108
|
+
return ge(r) + ".Consumer";
|
|
109
109
|
case l:
|
|
110
110
|
var a = e;
|
|
111
|
-
return
|
|
111
|
+
return ge(a._context) + ".Provider";
|
|
112
112
|
case c:
|
|
113
|
-
return
|
|
113
|
+
return Me(e, e.render, "ForwardRef");
|
|
114
114
|
case w:
|
|
115
115
|
var v = e.displayName || null;
|
|
116
|
-
return v !== null ? v :
|
|
117
|
-
case
|
|
118
|
-
var E = e,
|
|
116
|
+
return v !== null ? v : D(e.type) || "Memo";
|
|
117
|
+
case p: {
|
|
118
|
+
var E = e, R = E._payload, h = E._init;
|
|
119
119
|
try {
|
|
120
|
-
return
|
|
120
|
+
return D(h(R));
|
|
121
121
|
} catch {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
@@ -125,18 +125,18 @@ function Et() {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
var W = Object.assign, q = 0,
|
|
129
|
-
function
|
|
128
|
+
var W = Object.assign, q = 0, me, he, ye, Ee, Re, pe, we;
|
|
129
|
+
function _e() {
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
function
|
|
131
|
+
_e.__reactDisabledLog = !0;
|
|
132
|
+
function Ve() {
|
|
133
133
|
{
|
|
134
134
|
if (q === 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,
|
|
138
138
|
enumerable: !0,
|
|
139
|
-
value:
|
|
139
|
+
value: _e,
|
|
140
140
|
writable: !0
|
|
141
141
|
};
|
|
142
142
|
Object.defineProperties(console, {
|
|
@@ -162,52 +162,52 @@ function Et() {
|
|
|
162
162
|
};
|
|
163
163
|
Object.defineProperties(console, {
|
|
164
164
|
log: W({}, e, {
|
|
165
|
-
value:
|
|
165
|
+
value: me
|
|
166
166
|
}),
|
|
167
167
|
info: W({}, e, {
|
|
168
|
-
value:
|
|
168
|
+
value: he
|
|
169
169
|
}),
|
|
170
170
|
warn: W({}, e, {
|
|
171
|
-
value:
|
|
171
|
+
value: ye
|
|
172
172
|
}),
|
|
173
173
|
error: W({}, e, {
|
|
174
|
-
value:
|
|
174
|
+
value: Ee
|
|
175
175
|
}),
|
|
176
176
|
group: W({}, e, {
|
|
177
|
-
value:
|
|
177
|
+
value: Re
|
|
178
178
|
}),
|
|
179
179
|
groupCollapsed: W({}, e, {
|
|
180
180
|
value: pe
|
|
181
181
|
}),
|
|
182
182
|
groupEnd: W({}, e, {
|
|
183
|
-
value:
|
|
183
|
+
value: we
|
|
184
184
|
})
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
q < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
var
|
|
190
|
+
var re = k.ReactCurrentDispatcher, ne;
|
|
191
191
|
function J(e, r, a) {
|
|
192
192
|
{
|
|
193
|
-
if (
|
|
193
|
+
if (ne === void 0)
|
|
194
194
|
try {
|
|
195
195
|
throw Error();
|
|
196
196
|
} catch (E) {
|
|
197
197
|
var v = E.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
-
|
|
198
|
+
ne = v && v[1] || "";
|
|
199
199
|
}
|
|
200
200
|
return `
|
|
201
|
-
` +
|
|
201
|
+
` + ne + e;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
var
|
|
204
|
+
var oe = !1, K;
|
|
205
205
|
{
|
|
206
206
|
var qe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
207
|
K = new qe();
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
if (!e ||
|
|
209
|
+
function Ce(e, r) {
|
|
210
|
+
if (!e || oe)
|
|
211
211
|
return "";
|
|
212
212
|
{
|
|
213
213
|
var a = K.get(e);
|
|
@@ -215,11 +215,11 @@ function Et() {
|
|
|
215
215
|
return a;
|
|
216
216
|
}
|
|
217
217
|
var v;
|
|
218
|
-
|
|
218
|
+
oe = !0;
|
|
219
219
|
var E = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
|
-
var
|
|
222
|
-
|
|
221
|
+
var R;
|
|
222
|
+
R = re.current, re.current = null, Ve();
|
|
223
223
|
try {
|
|
224
224
|
if (r) {
|
|
225
225
|
var h = function() {
|
|
@@ -272,13 +272,13 @@ function Et() {
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
|
|
275
|
+
oe = !1, re.current = R, Ue(), Error.prepareStackTrace = E;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
278
|
-
return typeof e == "function" && K.set(e,
|
|
277
|
+
var M = e ? e.displayName || e.name : "", Fe = M ? J(M) : "";
|
|
278
|
+
return typeof e == "function" && K.set(e, Fe), Fe;
|
|
279
279
|
}
|
|
280
280
|
function Be(e, r, a) {
|
|
281
|
-
return
|
|
281
|
+
return Ce(e, !1);
|
|
282
282
|
}
|
|
283
283
|
function Ge(e) {
|
|
284
284
|
var r = e.prototype;
|
|
@@ -288,7 +288,7 @@ function Et() {
|
|
|
288
288
|
if (e == null)
|
|
289
289
|
return "";
|
|
290
290
|
if (typeof e == "function")
|
|
291
|
-
return
|
|
291
|
+
return Ce(e, Ge(e));
|
|
292
292
|
if (typeof e == "string")
|
|
293
293
|
return J(e);
|
|
294
294
|
switch (e) {
|
|
@@ -303,29 +303,29 @@ function Et() {
|
|
|
303
303
|
return Be(e.render);
|
|
304
304
|
case w:
|
|
305
305
|
return X(e.type, r, a);
|
|
306
|
-
case
|
|
307
|
-
var v = e, E = v._payload,
|
|
306
|
+
case p: {
|
|
307
|
+
var v = e, E = v._payload, R = v._init;
|
|
308
308
|
try {
|
|
309
|
-
return X(
|
|
309
|
+
return X(R(E), r, a);
|
|
310
310
|
} catch {
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
return "";
|
|
315
315
|
}
|
|
316
|
-
var H = Object.prototype.hasOwnProperty,
|
|
316
|
+
var H = Object.prototype.hasOwnProperty, be = {}, Pe = k.ReactDebugCurrentFrame;
|
|
317
317
|
function Z(e) {
|
|
318
318
|
if (e) {
|
|
319
319
|
var r = e._owner, a = X(e.type, e._source, r ? r.type : null);
|
|
320
|
-
|
|
320
|
+
Pe.setExtraStackFrame(a);
|
|
321
321
|
} else
|
|
322
|
-
|
|
322
|
+
Pe.setExtraStackFrame(null);
|
|
323
323
|
}
|
|
324
324
|
function Qe(e, r, a, v, E) {
|
|
325
325
|
{
|
|
326
|
-
var
|
|
326
|
+
var R = Function.call.bind(H);
|
|
327
327
|
for (var h in e)
|
|
328
|
-
if (
|
|
328
|
+
if (R(e, h)) {
|
|
329
329
|
var m = void 0;
|
|
330
330
|
try {
|
|
331
331
|
if (typeof e[h] != "function") {
|
|
@@ -336,12 +336,12 @@ function Et() {
|
|
|
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", a, h, typeof m), Z(null)), m instanceof Error && !(m.message in
|
|
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", a, h, typeof m), Z(null)), m instanceof Error && !(m.message in be) && (be[m.message] = !0, Z(E), _("Failed %s type: %s", a, m.message), Z(null));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
var Je = Array.isArray;
|
|
344
|
-
function
|
|
344
|
+
function ae(e) {
|
|
345
345
|
return Je(e);
|
|
346
346
|
}
|
|
347
347
|
function Ke(e) {
|
|
@@ -352,25 +352,25 @@ function Et() {
|
|
|
352
352
|
}
|
|
353
353
|
function Xe(e) {
|
|
354
354
|
try {
|
|
355
|
-
return
|
|
355
|
+
return je(e), !1;
|
|
356
356
|
} catch {
|
|
357
357
|
return !0;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function je(e) {
|
|
361
361
|
return "" + e;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function xe(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)), je(e);
|
|
366
366
|
}
|
|
367
367
|
var B = k.ReactCurrentOwner, He = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
371
371
|
__source: !0
|
|
372
|
-
},
|
|
373
|
-
|
|
372
|
+
}, Se, Te, ie;
|
|
373
|
+
ie = {};
|
|
374
374
|
function Ze(e) {
|
|
375
375
|
if (H.call(e, "ref")) {
|
|
376
376
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
@@ -389,14 +389,14 @@ function Et() {
|
|
|
389
389
|
}
|
|
390
390
|
function tt(e, r) {
|
|
391
391
|
if (typeof e.ref == "string" && B.current && r && B.current.stateNode !== r) {
|
|
392
|
-
var a =
|
|
393
|
-
|
|
392
|
+
var a = D(B.current.type);
|
|
393
|
+
ie[a] || (_('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', D(B.current.type), e.ref), ie[a] = !0);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
function rt(e, r) {
|
|
397
397
|
{
|
|
398
398
|
var a = function() {
|
|
399
|
-
|
|
399
|
+
Se || (Se = !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
401
|
a.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
402
402
|
get: a,
|
|
@@ -407,7 +407,7 @@ function Et() {
|
|
|
407
407
|
function nt(e, r) {
|
|
408
408
|
{
|
|
409
409
|
var a = 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
412
|
a.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
413
413
|
get: a,
|
|
@@ -415,7 +415,7 @@ function Et() {
|
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
var ot = function(e, r, a, v, E,
|
|
418
|
+
var ot = function(e, r, a, 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,
|
|
@@ -425,7 +425,7 @@ function Et() {
|
|
|
425
425
|
ref: a,
|
|
426
426
|
props: h,
|
|
427
427
|
// Record the component responsible for creating this element.
|
|
428
|
-
_owner:
|
|
428
|
+
_owner: R
|
|
429
429
|
};
|
|
430
430
|
return m._store = {}, Object.defineProperty(m._store, "validated", {
|
|
431
431
|
configurable: !1,
|
|
@@ -446,14 +446,14 @@ function Et() {
|
|
|
446
446
|
};
|
|
447
447
|
function at(e, r, a, v, E) {
|
|
448
448
|
{
|
|
449
|
-
var
|
|
450
|
-
a !== void 0 && (
|
|
451
|
-
for (
|
|
452
|
-
H.call(r,
|
|
449
|
+
var R, h = {}, m = null, S = null;
|
|
450
|
+
a !== void 0 && (xe(a), m = "" + a), et(r) && (xe(r.key), m = "" + r.key), Ze(r) && (S = r.ref, tt(r, E));
|
|
451
|
+
for (R in r)
|
|
452
|
+
H.call(r, R) && !He.hasOwnProperty(R) && (h[R] = r[R]);
|
|
453
453
|
if (e && e.defaultProps) {
|
|
454
454
|
var C = e.defaultProps;
|
|
455
|
-
for (
|
|
456
|
-
h[
|
|
455
|
+
for (R in C)
|
|
456
|
+
h[R] === void 0 && (h[R] = C[R]);
|
|
457
457
|
}
|
|
458
458
|
if (m || S) {
|
|
459
459
|
var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
@@ -462,23 +462,23 @@ function Et() {
|
|
|
462
462
|
return ot(e, m, S, E, v, B.current, h);
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
|
-
var
|
|
466
|
-
function
|
|
465
|
+
var se = k.ReactCurrentOwner, Oe = k.ReactDebugCurrentFrame;
|
|
466
|
+
function z(e) {
|
|
467
467
|
if (e) {
|
|
468
468
|
var r = e._owner, a = X(e.type, e._source, r ? r.type : null);
|
|
469
|
-
|
|
469
|
+
Oe.setExtraStackFrame(a);
|
|
470
470
|
} else
|
|
471
|
-
|
|
471
|
+
Oe.setExtraStackFrame(null);
|
|
472
472
|
}
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
function
|
|
473
|
+
var ue;
|
|
474
|
+
ue = !1;
|
|
475
|
+
function ce(e) {
|
|
476
476
|
return typeof e == "object" && e !== null && e.$$typeof === n;
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function Ae() {
|
|
479
479
|
{
|
|
480
|
-
if (
|
|
481
|
-
var e =
|
|
480
|
+
if (se.current) {
|
|
481
|
+
var e = D(se.current.type);
|
|
482
482
|
if (e)
|
|
483
483
|
return `
|
|
484
484
|
|
|
@@ -490,10 +490,10 @@ Check the render method of \`` + e + "`.";
|
|
|
490
490
|
function it(e) {
|
|
491
491
|
return "";
|
|
492
492
|
}
|
|
493
|
-
var
|
|
493
|
+
var ke = {};
|
|
494
494
|
function st(e) {
|
|
495
495
|
{
|
|
496
|
-
var r =
|
|
496
|
+
var r = Ae();
|
|
497
497
|
if (!r) {
|
|
498
498
|
var a = typeof e == "string" ? e : e.displayName || e.name;
|
|
499
499
|
a && (r = `
|
|
@@ -503,35 +503,35 @@ Check the top-level render call using <` + a + ">.");
|
|
|
503
503
|
return r;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function Ie(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
511
|
var a = st(r);
|
|
512
|
-
if (
|
|
512
|
+
if (ke[a])
|
|
513
513
|
return;
|
|
514
|
-
|
|
514
|
+
ke[a] = !0;
|
|
515
515
|
var v = "";
|
|
516
|
-
e && e._owner && e._owner !==
|
|
516
|
+
e && e._owner && e._owner !== se.current && (v = " It was passed a child from " + D(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.', a, v), z(null);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
function De(e, r) {
|
|
520
520
|
{
|
|
521
521
|
if (typeof e != "object")
|
|
522
522
|
return;
|
|
523
|
-
if (
|
|
523
|
+
if (ae(e))
|
|
524
524
|
for (var a = 0; a < e.length; a++) {
|
|
525
525
|
var v = e[a];
|
|
526
|
-
|
|
526
|
+
ce(v) && Ie(v, r);
|
|
527
527
|
}
|
|
528
|
-
else if (
|
|
528
|
+
else if (ce(e))
|
|
529
529
|
e._store && (e._store.validated = !0);
|
|
530
530
|
else if (e) {
|
|
531
531
|
var E = x(e);
|
|
532
532
|
if (typeof E == "function" && E !== e.entries)
|
|
533
|
-
for (var
|
|
534
|
-
|
|
533
|
+
for (var R = E.call(e), h; !(h = R.next()).done; )
|
|
534
|
+
ce(h.value) && Ie(h.value, r);
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
537
|
}
|
|
@@ -550,11 +550,11 @@ Check the top-level render call using <` + a + ">.");
|
|
|
550
550
|
else
|
|
551
551
|
return;
|
|
552
552
|
if (a) {
|
|
553
|
-
var v =
|
|
553
|
+
var v = D(r);
|
|
554
554
|
Qe(a, e.props, "prop", v, e);
|
|
555
|
-
} else if (r.PropTypes !== void 0 && !
|
|
556
|
-
|
|
557
|
-
var E =
|
|
555
|
+
} else if (r.PropTypes !== void 0 && !ue) {
|
|
556
|
+
ue = !0;
|
|
557
|
+
var E = D(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.");
|
|
@@ -565,34 +565,34 @@ Check the top-level render call using <` + a + ">.");
|
|
|
565
565
|
for (var r = Object.keys(e.props), a = 0; a < r.length; a++) {
|
|
566
566
|
var v = r[a];
|
|
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;
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
e.ref !== null && (
|
|
572
|
+
e.ref !== null && (z(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), z(null));
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function $e(e, r, a, v, E, R) {
|
|
576
576
|
{
|
|
577
|
-
var h =
|
|
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
581
|
var S = it();
|
|
582
|
-
S ? m += S : m +=
|
|
582
|
+
S ? m += S : m += Ae();
|
|
583
583
|
var C;
|
|
584
|
-
e === null ? C = "null" :
|
|
584
|
+
e === null ? C = "null" : ae(e) ? C = "array" : e !== void 0 && e.$$typeof === n ? (C = "<" + (D(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, a, E,
|
|
586
|
+
var P = at(e, r, a, E, R);
|
|
587
587
|
if (P == null)
|
|
588
588
|
return P;
|
|
589
589
|
if (h) {
|
|
590
590
|
var O = r.children;
|
|
591
591
|
if (O !== void 0)
|
|
592
592
|
if (v)
|
|
593
|
-
if (
|
|
594
|
-
for (var
|
|
595
|
-
De(O[
|
|
593
|
+
if (ae(O)) {
|
|
594
|
+
for (var M = 0; M < O.length; M++)
|
|
595
|
+
De(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.");
|
|
@@ -603,19 +603,19 @@ Check the top-level render call using <` + a + ">.");
|
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
function lt(e, r, a) {
|
|
606
|
-
return
|
|
606
|
+
return $e(e, r, a, !0);
|
|
607
607
|
}
|
|
608
608
|
function ft(e, r, a) {
|
|
609
|
-
return
|
|
609
|
+
return $e(e, r, a, !1);
|
|
610
610
|
}
|
|
611
611
|
var dt = ft, vt = lt;
|
|
612
612
|
Q.Fragment = s, Q.jsx = dt, Q.jsxs = vt;
|
|
613
613
|
}()), Q;
|
|
614
614
|
}
|
|
615
|
-
process.env.NODE_ENV === "production" ?
|
|
616
|
-
var F =
|
|
615
|
+
process.env.NODE_ENV === "production" ? le.exports = yt() : le.exports = Et();
|
|
616
|
+
var F = le.exports;
|
|
617
617
|
const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
618
|
-
const s =
|
|
618
|
+
const s = fe(
|
|
619
619
|
() => ({
|
|
620
620
|
apiURL: n,
|
|
621
621
|
libraries: o
|
|
@@ -632,11 +632,11 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
632
632
|
...f
|
|
633
633
|
}) => {
|
|
634
634
|
var _, L, N, Y;
|
|
635
|
-
const { libraries: l } =
|
|
635
|
+
const { libraries: l } = I(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:
|
|
639
|
-
return
|
|
638
|
+
const [g, y] = We(null), { useLocation: w, Navigate: p, Outlet: u } = d, j = w(), T = mt(!1), x = typeof n == "function" ? n() : !!n, k = typeof x == "boolean" ? x : x == null ? void 0 : x.isLogged;
|
|
639
|
+
return V(() => {
|
|
640
640
|
T.current || (T.current = !0, c.interceptors.response.use(
|
|
641
641
|
(b) => b,
|
|
642
642
|
async (b) => {
|
|
@@ -644,9 +644,9 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
644
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(i)), Promise.reject(b);
|
|
645
645
|
}
|
|
646
646
|
));
|
|
647
|
-
}, [c.defaults.headers.common, c.interceptors.response, s, i]), k && !g ? /* @__PURE__ */ F.jsx(ht, { fallback: t, children: (L = (_ = j.state) == null ? void 0 : _.from) != null && L.state && ((Y = (N = j.state) == null ? void 0 : N.from) == null ? void 0 : Y.pathname) === o ? /* @__PURE__ */ F.jsx(
|
|
648
|
-
},
|
|
649
|
-
const { libraries: o } =
|
|
647
|
+
}, [c.defaults.headers.common, c.interceptors.response, s, i]), k && !g ? /* @__PURE__ */ F.jsx(ht, { fallback: t, children: (L = (_ = j.state) == null ? void 0 : _.from) != null && L.state && ((Y = (N = j.state) == null ? void 0 : N.from) == null ? void 0 : Y.pathname) === o ? /* @__PURE__ */ F.jsx(p, { to: j.state.from.state.from.pathname + j.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ F.jsx(u, {}) }) : /* @__PURE__ */ F.jsx(p, { to: o + j.search, state: { from: j }, replace: !0 });
|
|
648
|
+
}, It = ({ data: t, ...n }) => {
|
|
649
|
+
const { libraries: o } = I(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);
|
|
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."
|
|
@@ -654,29 +654,29 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
654
654
|
if (!i)
|
|
655
655
|
throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
|
|
656
656
|
const { useGoogleTagManager: f } = i, { useLocation: l, Outlet: d } = s, { pathname: c } = l(), { sendEvent: g } = f();
|
|
657
|
-
return
|
|
657
|
+
return V(() => {
|
|
658
658
|
g({
|
|
659
659
|
event: "pageView",
|
|
660
660
|
pathname: c,
|
|
661
661
|
...t
|
|
662
662
|
});
|
|
663
663
|
}, [t, c, g]), /* @__PURE__ */ F.jsx(d, {});
|
|
664
|
-
},
|
|
664
|
+
}, Dt = ({
|
|
665
665
|
tokenTypeKey: t = "tokenType",
|
|
666
666
|
userLocalStorageKey: n = "user",
|
|
667
667
|
tokenKey: o = "accessToken",
|
|
668
668
|
postContentType: s = "application/json",
|
|
669
669
|
...i
|
|
670
670
|
}) => {
|
|
671
|
-
const { apiURL: f = i.apiURL, libraries: l } =
|
|
671
|
+
const { apiURL: f = i.apiURL, libraries: l } = I(A), d = (i == null ? void 0 : i.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))
|
|
675
675
|
return null;
|
|
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,
|
|
677
|
-
return d.defaults.baseURL = f, d.defaults.headers.post["Content-Type"] = s,
|
|
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
|
+
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 } =
|
|
679
|
+
const { libraries: s } = I(A), i = (o == null ? void 0 : o.i18) || (s == null ? void 0 : s.i18), { i18next: f, initReactI18next: l, languageDetector: d } = i || {};
|
|
680
680
|
if (!i)
|
|
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({
|
|
@@ -709,14 +709,14 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
709
709
|
environment: c,
|
|
710
710
|
...g
|
|
711
711
|
}) => {
|
|
712
|
-
const { libraries: y } =
|
|
712
|
+
const { libraries: y } = I(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
|
-
if (!
|
|
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: j, useLocation: T, useNavigationType: x } =
|
|
719
|
+
const { createRoutesFromChildren: u, matchRoutes: j, useLocation: T, useNavigationType: x } = 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,
|
|
@@ -726,7 +726,7 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
726
726
|
w.reactRouterV6BrowserTracingIntegration({
|
|
727
727
|
createRoutesFromChildren: u,
|
|
728
728
|
matchRoutes: j,
|
|
729
|
-
useEffect:
|
|
729
|
+
useEffect: V,
|
|
730
730
|
useLocation: T,
|
|
731
731
|
useNavigationType: x
|
|
732
732
|
}),
|
|
@@ -738,24 +738,24 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
738
738
|
tracesSampleRate: o || 1
|
|
739
739
|
}), null;
|
|
740
740
|
}, Lt = ({ IMaskMixin: t, ...n }) => {
|
|
741
|
-
const o =
|
|
741
|
+
const o = fe(
|
|
742
742
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
743
743
|
() => t(({ TextField: s, ...i }) => /* @__PURE__ */ F.jsx(s, { ...i })),
|
|
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 } = I(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 } = I(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);
|
|
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."
|
|
757
757
|
);
|
|
758
|
-
return
|
|
758
|
+
return V(() => {
|
|
759
759
|
(async () => {
|
|
760
760
|
var d;
|
|
761
761
|
const l = t || ((d = navigator.language) == null ? void 0 : d.slice(0, 2)) || "en";
|
|
@@ -764,21 +764,21 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
764
764
|
}), await import("dayjs/locale/en"), await import("dayjs/locale/fr"), s.locale(l);
|
|
765
765
|
})().then();
|
|
766
766
|
}, [s, i, 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,
|
|
770
770
|
defaultMutationsOptions: o,
|
|
771
771
|
...s
|
|
772
772
|
}) => {
|
|
773
773
|
var c, g;
|
|
774
|
-
const { libraries: i } =
|
|
774
|
+
const { libraries: i } = I(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);
|
|
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)
|
|
778
778
|
throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
779
|
-
if (!
|
|
779
|
+
if (!Rt(l))
|
|
780
780
|
throw new Error("Provided QueryClientProvider dependencies are not valid.");
|
|
781
|
-
if (!
|
|
781
|
+
if (!pt(f))
|
|
782
782
|
throw new Error("Provided QueryClient dependencies are not valid.");
|
|
783
783
|
const d = new f({
|
|
784
784
|
defaultOptions: {
|
|
@@ -786,7 +786,7 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
786
786
|
...o
|
|
787
787
|
},
|
|
788
788
|
queries: {
|
|
789
|
-
getNextPageParam: (y, w,
|
|
789
|
+
getNextPageParam: (y, w, p) => y.length + (p || 0),
|
|
790
790
|
refetchOnWindowFocus: !1,
|
|
791
791
|
retry: 3,
|
|
792
792
|
...n
|
|
@@ -794,22 +794,22 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
794
794
|
}
|
|
795
795
|
});
|
|
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 } =
|
|
800
|
-
(
|
|
799
|
+
const { libraries: n } = I(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), i = ((w = o == null ? void 0 : o.i18next) == null ? void 0 : w.t) || s || ((p) => p), { unknownErrorTranslationKey: f = "error.unknownError" } = t || {}, l = i(f), d = te(
|
|
800
|
+
(p) => {
|
|
801
801
|
var j, T, x, k, _, L, N, Y, b;
|
|
802
|
-
const { response: u } =
|
|
802
|
+
const { response: u } = p || {};
|
|
803
803
|
return u != null && u.reason ? String(u.reason) : (j = u == null ? void 0 : u.data) != null && j.reason ? String(u.data.reason) : (T = u == null ? void 0 : u.data) != null && T.message ? String(u.data.message) : (k = (x = u == null ? void 0 : u.data) == null ? void 0 : x.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
|
-
return { getErrorCode:
|
|
807
|
+
return { getErrorCode: te((p) => {
|
|
808
808
|
var j, T, x;
|
|
809
|
-
const { response: u } =
|
|
809
|
+
const { response: u } = p || {};
|
|
810
810
|
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((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) : (x = u == null ? void 0 : u.data) != null && x.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,
|
|
@@ -817,12 +817,12 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
817
817
|
isLoading: i,
|
|
818
818
|
enabled: f = !0
|
|
819
819
|
}) => {
|
|
820
|
-
const l =
|
|
820
|
+
const l = te(
|
|
821
821
|
async (c) => {
|
|
822
822
|
o || !f || await n({ pageParam: (c == null ? void 0 : c.pageParam) || c.visibleRowsCount });
|
|
823
823
|
},
|
|
824
824
|
[f, n, o]
|
|
825
|
-
), d =
|
|
825
|
+
), d = fe(() => {
|
|
826
826
|
if (t)
|
|
827
827
|
return t.pages.reduce((c, g) => [...c, ...g], []);
|
|
828
828
|
}, [t]);
|
|
@@ -832,11 +832,11 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
832
832
|
loadingVariant: s ? "skeleton" : "linear",
|
|
833
833
|
rows: d
|
|
834
834
|
};
|
|
835
|
-
},
|
|
836
|
-
const { libraries: n } =
|
|
835
|
+
}, Vt = (t) => {
|
|
836
|
+
const { libraries: n } = I(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 i =
|
|
839
|
+
const i = te(
|
|
840
840
|
({ tokenType: l, accessToken: d }) => {
|
|
841
841
|
o.defaults.headers.common.Authorization = `${l} ${d}`;
|
|
842
842
|
},
|
|
@@ -844,7 +844,7 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
844
844
|
), f = () => {
|
|
845
845
|
o.defaults.headers.common.Authorization = null;
|
|
846
846
|
};
|
|
847
|
-
return
|
|
847
|
+
return V(() => {
|
|
848
848
|
const l = ({ newValue: d, key: c }) => {
|
|
849
849
|
if (c === s && d)
|
|
850
850
|
try {
|
|
@@ -870,7 +870,7 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
870
870
|
const s = Ct(t), i = `${o}${s}`, f = i.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
|
|
871
871
|
return typeof n == "number" && f ? `${i.replace("/files", `/thumbs/${n}`)}` : i;
|
|
872
872
|
}, Ut = (t) => {
|
|
873
|
-
const { apiURL: n, libraries: o } =
|
|
873
|
+
const { apiURL: n, libraries: o } = I(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,12 +894,16 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
894
894
|
});
|
|
895
895
|
}
|
|
896
896
|
};
|
|
897
|
-
},
|
|
898
|
-
const [o, s] = We(() =>
|
|
899
|
-
|
|
897
|
+
}, ee = (t, n) => n === "short" ? t.split("-")[0] : t, qt = (t, n = "full") => {
|
|
898
|
+
const [o, s] = We(() => {
|
|
899
|
+
const i = (t == null ? void 0 : t.language) || navigator.language;
|
|
900
|
+
return t && "isInitialized" in t && t.isInitialized, ee(i, n);
|
|
901
|
+
});
|
|
902
|
+
return V(() => {
|
|
900
903
|
var f;
|
|
904
|
+
t && "isInitialized" in t && t.isInitialized && t.language && s(ee(t.language, n));
|
|
901
905
|
const i = (l) => {
|
|
902
|
-
s(
|
|
906
|
+
s(ee(l, n));
|
|
903
907
|
};
|
|
904
908
|
return (f = t == null ? void 0 : t.on) == null || f.call(t, "languageChanged", i), () => {
|
|
905
909
|
var l;
|
|
@@ -961,8 +965,8 @@ const A = gt({}), At = ({ children: t, apiURL: n, libraries: o }) => {
|
|
|
961
965
|
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;
|
|
962
966
|
};
|
|
963
967
|
export {
|
|
964
|
-
|
|
965
|
-
|
|
968
|
+
It as GTMSendPageView,
|
|
969
|
+
Dt as InitializeAxiosConfig,
|
|
966
970
|
Yt as InitializeDaysJSConfig,
|
|
967
971
|
$t as InitializeI18nConfig,
|
|
968
972
|
Nt as InitializeMapBoxConfig,
|
|
@@ -977,8 +981,8 @@ export {
|
|
|
977
981
|
Bt as getOrvalConfig,
|
|
978
982
|
Gt as handleImportModuleError,
|
|
979
983
|
Ut as useAdapter,
|
|
980
|
-
|
|
984
|
+
Vt as useAuth,
|
|
981
985
|
qt as useCurrentLanguage,
|
|
982
|
-
|
|
983
|
-
|
|
986
|
+
Mt as useInfiniteDataGrid,
|
|
987
|
+
zt as useResponseError
|
|
984
988
|
};
|
package/dist/main.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(C,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(C=typeof globalThis<"u"?globalThis:C||self,h(C["@tracktor/shared-module"]={},C.React))})(this,function(C,h){"use strict";var te={exports:{}},B={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var le;function Ye(){if(le)return B;le=1;var t=h,n=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function l(d,c,g){var E,_={},p=null,u=null;g!==void 0&&(p=""+g),c.key!==void 0&&(p=""+c.key),c.ref!==void 0&&(u=c.ref);for(E in c)s.call(c,E)&&!f.hasOwnProperty(E)&&(_[E]=c[E]);if(d&&d.defaultProps)for(E in c=d.defaultProps,c)_[E]===void 0&&(_[E]=c[E]);return{$$typeof:n,type:d,key:p,ref:u,props:_,_owner:i.current}}return B.Fragment=o,B.jsx=l,B.jsxs=l,B}var G={};/**
|
|
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
|
|
18
|
-
`+
|
|
17
|
+
*/var fe;function ze(){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"),i=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"),E=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),u=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,a=new Array(r>1?r-1:0),v=1;v<r;v++)a[v-1]=arguments[v];W("error",e,a)}}function W(e,r,a){{var v=D.ReactDebugCurrentFrame,R=v.getStackAddendum();R!==""&&(r+="%s",a=a.concat([R]));var w=a.map(function(y){return String(y)});w.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,w)}}var Y=!1,z=!1,j=!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===i||e===g||e===E||ge||e===u||Y||z||j||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===_||e.$$typeof===l||e.$$typeof===d||e.$$typeof===c||e.$$typeof===Q||e.getModuleId!==void 0))}function gt(e,r,a){var v=e.displayName;if(v)return v;var R=r.displayName||r.name||"";return R!==""?a+"("+R+")":a}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 i: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 a=e;return he(a._context)+".Provider";case c:return gt(e,e.render,"ForwardRef");case _:var v=e.displayName||null;return v!==null?v:L(e.type)||"Memo";case p:{var R=e,w=R._payload,y=R._init;try{return L(y(w))}catch{return null}}}return null}var M=Object.assign,J=0,ye,Ee,Re,we,Ce,pe,_e;function be(){}be.__reactDisabledLog=!0;function mt(){{if(J===0){ye=console.log,Ee=console.info,Re=console.warn,we=console.error,Ce=console.group,pe=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:M({},e,{value:ye}),info:M({},e,{value:Ee}),warn:M({},e,{value:Re}),error:M({},e,{value:we}),group:M({},e,{value:Ce}),groupCollapsed:M({},e,{value:pe}),groupEnd:M({},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,a){{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 a=Z.get(e);if(a!==void 0)return a}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,S=O.length-1;P>=1&&S>=0&&m[P]!==O[S];)S--;for(;P>=1&&S>=0;P--,S--)if(m[P]!==O[S]){if(P!==1||S!==1)do if(P--,S--,S<0||m[P]!==O[S]){var
|
|
21
|
-
`+m[P].replace(" at new "," at ");return e.displayName&&
|
|
20
|
+
`),P=m.length-1,S=O.length-1;P>=1&&S>=0&&m[P]!==O[S];)S--;for(;P>=1&&S>=0;P--,S--)if(m[P]!==O[S]){if(P!==1||S!==1)do if(P--,S--,S<0||m[P]!==O[S]){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&&S>=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,a){return Pe(e,!1)}function Rt(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function $(e,r,a){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 c:return Et(e.render);case _:return $(e.type,r,a);case p:{var v=e,R=v._payload,w=v._init;try{return $(w(R),r,a)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,je={},Se=D.ReactDebugCurrentFrame;function ee(e){if(e){var r=e._owner,a=$(e.type,e._source,r?r.type:null);Se.setExtraStackFrame(a)}else Se.setExtraStackFrame(null)}function wt(e,r,a,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")+": "+a+" 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,a,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",a,y,typeof m),ee(null)),m instanceof Error&&!(m.message in je)&&(je[m.message]=!0,ee(R),b("Failed %s type: %s",a,m.message),ee(null))}}}var Ct=Array.isArray;function ae(e){return Ct(e)}function pt(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,a=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}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.",pt(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 jt(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 St(e,r){if(typeof e.ref=="string"&&K.current&&r&&K.current.stateNode!==r){var a=L(K.current.type);ie[a]||(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[a]=!0)}}function Tt(e,r){{var a=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))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function xt(e,r){{var a=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))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var Ot=function(e,r,a,v,R,w,y){var m={$$typeof:n,type:e,key:r,ref:a,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,a,v,R){{var w,y={},m=null,O=null;a!==void 0&&(xe(a),m=""+a),jt(r)&&(xe(r.key),m=""+r.key),Pt(r)&&(O=r.ref,St(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 S=typeof e=="function"?e.displayName||e.name||"Unknown":e;m&&Tt(y,S),O&&xt(y,S)}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,a=$(e.type,e._source,r?r.type:null);Ie.setExtraStackFrame(a)}else Ie.setExtraStackFrame(null)}var ue;ue=!1;function ce(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
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function It(e){return""}var De={};function kt(e){{var r=ke();if(!r){var a=typeof e=="string"?e:e.displayName||e.name;a&&(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=It(r);if(De[a])return;De[a]=!0;var v="";e&&e._owner&&e._owner!==ie.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(oe(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===u||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&&!se){se=!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=kt();O?m+=O:m+=Ie();var P;e===null?P="null":oe(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 I=r.children;if(I!==void 0)if(v)if(oe(I)){for(var U=0;U<I.length;U++)Le(I[U],e);Object.freeze&&Object.freeze(I)}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(I,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"?ee.exports=Ye():ee.exports=Me();var F=ee.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:i="/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=_(),k=h.useRef(!1),x=typeof n=="function"?n():!!n,D=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return h.useEffect(()=>{k.current||(k.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),E(i)),Promise.reject(j)}))},[u.defaults.headers.common,u.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&&((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),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:u}=l(),{sendEvent:g}=f();return h.useEffect(()=>{g({event:"pageView",pathname:u,...t})},[t,u,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 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},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",u=>{document.documentElement.setAttribute("lang",u)})),null},Qe=({dsn:t,integrations:n,tracesSampleRate:o,replaysSessionSampleRate:s,replaysOnErrorSampleRate:i,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:k,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:k,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(u=>{u&&s.extend(u)}),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 u,g;const{libraries:i}=h.useContext(A),f=(s==null?void 0:s.QueryClient)||((u=i==null?void 0:i.reactQuery)==null?void 0:u.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,_,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),i=((_=o==null?void 0:o.i18next)==null?void 0:_.t)||s||(C=>C),{unknownErrorTranslationKey:f="error.unknownError"}=t||{},l=i(f),d=h.useCallback(C=>{var T,k,x,D,b,W,Y,M,j;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):(k=c==null?void 0:c.data)!=null&&k.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((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):l},[l]);return{getErrorCode:h.useCallback(C=>{var T,k,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((k=c==null?void 0:c.data)==null?void 0:k.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:i,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||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:u})=>{if(u===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}},fe=({library:t,date:n,format:o="ll"})=>t(n).format(o),de=(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 fe({date:l,format:d,library:s})},distanceAdapter:de,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})}}},ve=(t,n)=>n==="short"?t.split("-")[0]:t,at=(t,n="full")=>{const[o,s]=h.useState(()=>ve((t==null?void 0:t.language)||navigator.language,n));return h.useEffect(()=>{var f;const i=l=>{s(ve(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(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),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=ct(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: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:(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};p.GTMSendPageView=Ue,p.InitializeAxiosConfig=Be,p.InitializeDaysJSConfig=Xe,p.InitializeI18nConfig=Ge,p.InitializeMapBoxConfig=Ke,p.InitializeSentryConfig=Qe,p.InjectDependenciesContext=A,p.InjectDependenciesProvider=ze,p.MaskTextField=Je,p.QueryClientProviderWithConfig=$e,p.RequireAuth=Ve,p.dateAdapter=fe,p.distanceAdapter=de,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"})});
|
|
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"})});
|