@tracktor/shared-module 2.5.2 → 2.6.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 CHANGED
@@ -1,4 +1,4 @@
1
1
  # [Versions](https://github.com/Tracktor/shared-module/releases)
2
2
 
3
- ## v2.5.2
4
- - **[fix]** - add `PreloadErrorHandler` handling event error disable sentry reporting
3
+ ## v2.6.1
4
+ - **[fix]** - sentry error handling
@@ -57,6 +57,11 @@ interface InitializeSentryConfigProps {
57
57
  * The current environment of your application (e.g. "production").
58
58
  */
59
59
  environment?: string;
60
+ /**
61
+ * The release identifier used when uploading respective source maps.
62
+ * Specify this value to allow Sentry to resolve the correct source maps when processing events.
63
+ */
64
+ release?: string;
60
65
  }
61
66
  /**
62
67
  * This component is used to initialize Sentry
@@ -72,5 +77,5 @@ interface InitializeSentryConfigProps {
72
77
  * @param environment
73
78
  * @constructor
74
79
  */
75
- declare const InitializeSentryConfig: ({ dsn, integrations, tracesSampleRate, replaysSessionSampleRate, replaysOnErrorSampleRate, tracePropagationTargets, ignoreErrors, debug, environment, ...props }: InitializeSentryConfigProps) => null;
80
+ declare const InitializeSentryConfig: ({ dsn, integrations, tracesSampleRate, replaysSessionSampleRate, replaysOnErrorSampleRate, tracePropagationTargets, ignoreErrors, debug, environment, release, ...props }: InitializeSentryConfigProps) => null;
76
81
  export default InitializeSentryConfig;
package/dist/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import Ne, { createContext as gr, useMemo as fe, useContext as I, useState as We, useRef as hr, useEffect as z, Suspense as yr, useCallback as re } from "react";
1
+ import Ne, { createContext as gr, useMemo as fe, useContext as D, useState as We, useRef as hr, useEffect as z, Suspense as mr, useCallback as re } from "react";
2
2
  var le = { exports: {} }, G = {};
3
3
  /**
4
4
  * @license React
@@ -10,16 +10,16 @@ var le = { exports: {} }, G = {};
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
  var Le;
13
- function mr() {
13
+ function yr() {
14
14
  if (Le) return G;
15
15
  Le = 1;
16
16
  var r = Ne, n = Symbol.for("react.element"), o = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, i = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
17
- function l(d, c, g) {
18
- var m, p = {}, R = null, s = null;
19
- g !== void 0 && (R = "" + g), c.key !== void 0 && (R = "" + c.key), c.ref !== void 0 && (s = c.ref);
20
- for (m in c) u.call(c, m) && !f.hasOwnProperty(m) && (p[m] = c[m]);
21
- if (d && d.defaultProps) for (m in c = d.defaultProps, c) p[m] === void 0 && (p[m] = c[m]);
22
- return { $$typeof: n, type: d, key: R, ref: s, props: p, _owner: i.current };
17
+ function l(d, c, h) {
18
+ var y, R = {}, w = null, s = null;
19
+ h !== void 0 && (w = "" + h), c.key !== void 0 && (w = "" + c.key), c.ref !== void 0 && (s = c.ref);
20
+ for (y in c) u.call(c, y) && !f.hasOwnProperty(y) && (R[y] = c[y]);
21
+ if (d && d.defaultProps) for (y in c = d.defaultProps, c) R[y] === void 0 && (R[y] = c[y]);
22
+ return { $$typeof: n, type: d, key: w, ref: s, props: R, _owner: i.current };
23
23
  }
24
24
  return G.Fragment = o, G.jsx = l, G.jsxs = l, G;
25
25
  }
@@ -36,14 +36,14 @@ var Q = {};
36
36
  var Ye;
37
37
  function Er() {
38
38
  return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
39
- var r = Ne, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), u = 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"), m = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), s = Symbol.for("react.offscreen"), j = Symbol.iterator, T = "@@iterator";
39
+ var r = Ne, n = Symbol.for("react.element"), o = Symbol.for("react.portal"), u = 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"), h = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), s = Symbol.for("react.offscreen"), j = Symbol.iterator, O = "@@iterator";
40
40
  function S(e) {
41
41
  if (e === null || typeof e != "object")
42
42
  return null;
43
- var t = j && e[j] || e[T];
43
+ var t = j && e[j] || e[O];
44
44
  return typeof t == "function" ? t : null;
45
45
  }
46
- var D = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
46
+ var T = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
47
47
  function _(e) {
48
48
  {
49
49
  for (var t = arguments.length, a = new Array(t > 1 ? t - 1 : 0), v = 1; v < t; v++)
@@ -53,18 +53,18 @@ function Er() {
53
53
  }
54
54
  function L(e, t, a) {
55
55
  {
56
- var v = D.ReactDebugCurrentFrame, E = v.getStackAddendum();
56
+ var v = T.ReactDebugCurrentFrame, E = v.getStackAddendum();
57
57
  E !== "" && (t += "%s", a = a.concat([E]));
58
- var w = a.map(function(y) {
59
- return String(y);
58
+ var p = a.map(function(m) {
59
+ return String(m);
60
60
  });
61
- w.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, w);
61
+ p.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, p);
62
62
  }
63
63
  }
64
64
  var Y = !1, N = !1, b = !1, de = !1, ve = !1, U;
65
65
  U = Symbol.for("react.module.reference");
66
66
  function ze(e) {
67
- return !!(typeof e == "string" || typeof e == "function" || e === u || e === f || ve || e === i || e === g || e === m || de || e === s || Y || N || b || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === p || e.$$typeof === l || e.$$typeof === d || e.$$typeof === c || // This needs to include all possible module reference object
67
+ return !!(typeof e == "string" || typeof e == "function" || e === u || e === f || ve || e === i || e === h || e === y || de || e === s || Y || N || b || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === R || 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.
@@ -96,9 +96,9 @@ function Er() {
96
96
  return "Profiler";
97
97
  case i:
98
98
  return "StrictMode";
99
- case g:
99
+ case h:
100
100
  return "Suspense";
101
- case m:
101
+ case y:
102
102
  return "SuspenseList";
103
103
  }
104
104
  if (typeof e == "object")
@@ -111,13 +111,13 @@ function Er() {
111
111
  return ge(a._context) + ".Provider";
112
112
  case c:
113
113
  return Ve(e, e.render, "ForwardRef");
114
- case p:
114
+ case R:
115
115
  var v = e.displayName || null;
116
116
  return v !== null ? v : k(e.type) || "Memo";
117
- case R: {
118
- var E = e, w = E._payload, y = E._init;
117
+ case w: {
118
+ var E = e, p = E._payload, m = E._init;
119
119
  try {
120
- return k(y(w));
120
+ return k(m(p));
121
121
  } catch {
122
122
  return null;
123
123
  }
@@ -125,14 +125,14 @@ function Er() {
125
125
  }
126
126
  return null;
127
127
  }
128
- var W = Object.assign, q = 0, he, ye, me, Ee, we, Re, pe;
128
+ var W = Object.assign, q = 0, he, me, ye, Ee, pe, we, Re;
129
129
  function _e() {
130
130
  }
131
131
  _e.__reactDisabledLog = !0;
132
132
  function Me() {
133
133
  {
134
134
  if (q === 0) {
135
- he = console.log, ye = console.info, me = console.warn, Ee = console.error, we = console.group, Re = console.groupCollapsed, pe = console.groupEnd;
135
+ he = console.log, me = console.info, ye = console.warn, Ee = console.error, pe = console.group, we = console.groupCollapsed, Re = console.groupEnd;
136
136
  var e = {
137
137
  configurable: !0,
138
138
  enumerable: !0,
@@ -165,29 +165,29 @@ function Er() {
165
165
  value: he
166
166
  }),
167
167
  info: W({}, e, {
168
- value: ye
168
+ value: me
169
169
  }),
170
170
  warn: W({}, e, {
171
- value: me
171
+ value: ye
172
172
  }),
173
173
  error: W({}, e, {
174
174
  value: Ee
175
175
  }),
176
176
  group: W({}, e, {
177
- value: we
177
+ value: pe
178
178
  }),
179
179
  groupCollapsed: W({}, e, {
180
- value: Re
180
+ value: we
181
181
  }),
182
182
  groupEnd: W({}, e, {
183
- value: pe
183
+ value: Re
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 te = D.ReactCurrentDispatcher, ne;
190
+ var te = T.ReactCurrentDispatcher, ne;
191
191
  function J(e, t, a) {
192
192
  {
193
193
  if (ne === void 0)
@@ -218,31 +218,31 @@ function Er() {
218
218
  oe = !0;
219
219
  var E = Error.prepareStackTrace;
220
220
  Error.prepareStackTrace = void 0;
221
- var w;
222
- w = te.current, te.current = null, Me();
221
+ var p;
222
+ p = te.current, te.current = null, Me();
223
223
  try {
224
224
  if (t) {
225
- var y = function() {
225
+ var m = function() {
226
226
  throw Error();
227
227
  };
228
- if (Object.defineProperty(y.prototype, "props", {
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(y, []);
234
+ Reflect.construct(m, []);
235
235
  } catch ($) {
236
236
  v = $;
237
237
  }
238
- Reflect.construct(e, [], y);
238
+ Reflect.construct(e, [], m);
239
239
  } else {
240
240
  try {
241
- y.call();
241
+ m.call();
242
242
  } catch ($) {
243
243
  v = $;
244
244
  }
245
- e.call(y.prototype);
245
+ e.call(m.prototype);
246
246
  }
247
247
  } else {
248
248
  try {
@@ -254,25 +254,25 @@ function Er() {
254
254
  }
255
255
  } catch ($) {
256
256
  if ($ && v && typeof $.stack == "string") {
257
- for (var h = $.stack.split(`
257
+ for (var g = $.stack.split(`
258
258
  `), x = v.stack.split(`
259
- `), C = h.length - 1, P = x.length - 1; C >= 1 && P >= 0 && h[C] !== x[P]; )
259
+ `), C = g.length - 1, P = x.length - 1; C >= 1 && P >= 0 && g[C] !== x[P]; )
260
260
  P--;
261
261
  for (; C >= 1 && P >= 0; C--, P--)
262
- if (h[C] !== x[P]) {
262
+ if (g[C] !== x[P]) {
263
263
  if (C !== 1 || P !== 1)
264
264
  do
265
- if (C--, P--, P < 0 || h[C] !== x[P]) {
266
- var O = `
267
- ` + h[C].replace(" at new ", " at ");
268
- return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && K.set(e, O), O;
265
+ if (C--, P--, P < 0 || g[C] !== x[P]) {
266
+ var A = `
267
+ ` + g[C].replace(" at new ", " at ");
268
+ return e.displayName && A.includes("<anonymous>") && (A = A.replace("<anonymous>", e.displayName)), typeof e == "function" && K.set(e, A), A;
269
269
  }
270
270
  while (C >= 1 && P >= 0);
271
271
  break;
272
272
  }
273
273
  }
274
274
  } finally {
275
- oe = !1, te.current = w, Ue(), Error.prepareStackTrace = E;
275
+ oe = !1, te.current = p, Ue(), Error.prepareStackTrace = E;
276
276
  }
277
277
  var M = e ? e.displayName || e.name : "", Fe = M ? J(M) : "";
278
278
  return typeof e == "function" && K.set(e, Fe), Fe;
@@ -292,28 +292,28 @@ function Er() {
292
292
  if (typeof e == "string")
293
293
  return J(e);
294
294
  switch (e) {
295
- case g:
295
+ case h:
296
296
  return J("Suspense");
297
- case m:
297
+ case y:
298
298
  return J("SuspenseList");
299
299
  }
300
300
  if (typeof e == "object")
301
301
  switch (e.$$typeof) {
302
302
  case c:
303
303
  return Be(e.render);
304
- case p:
304
+ case R:
305
305
  return H(e.type, t, a);
306
- case R: {
307
- var v = e, E = v._payload, w = v._init;
306
+ case w: {
307
+ var v = e, E = v._payload, p = v._init;
308
308
  try {
309
- return H(w(E), t, a);
309
+ return H(p(E), t, a);
310
310
  } catch {
311
311
  }
312
312
  }
313
313
  }
314
314
  return "";
315
315
  }
316
- var X = Object.prototype.hasOwnProperty, be = {}, Pe = D.ReactDebugCurrentFrame;
316
+ var X = Object.prototype.hasOwnProperty, be = {}, Pe = T.ReactDebugCurrentFrame;
317
317
  function Z(e) {
318
318
  if (e) {
319
319
  var t = e._owner, a = H(e.type, e._source, t ? t.type : null);
@@ -323,20 +323,20 @@ function Er() {
323
323
  }
324
324
  function Qe(e, t, a, v, E) {
325
325
  {
326
- var w = Function.call.bind(X);
327
- for (var y in e)
328
- if (w(e, y)) {
329
- var h = void 0;
326
+ var p = Function.call.bind(X);
327
+ for (var m in e)
328
+ if (p(e, m)) {
329
+ var g = void 0;
330
330
  try {
331
- if (typeof e[y] != "function") {
332
- var x = 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`.");
331
+ if (typeof e[m] != "function") {
332
+ var x = Error((v || "React class") + ": " + a + " 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 x.name = "Invariant Violation", x;
334
334
  }
335
- h = e[y](t, y, v, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
335
+ g = e[m](t, m, v, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
336
336
  } catch (C) {
337
- h = C;
337
+ g = C;
338
338
  }
339
- h && !(h 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, y, typeof h), Z(null)), h instanceof Error && !(h.message in be) && (be[h.message] = !0, Z(E), _("Failed %s type: %s", a, h.message), Z(null));
339
+ g && !(g 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, m, typeof g), Z(null)), g instanceof Error && !(g.message in be) && (be[g.message] = !0, Z(E), _("Failed %s type: %s", a, g.message), Z(null));
340
340
  }
341
341
  }
342
342
  }
@@ -364,7 +364,7 @@ function Er() {
364
364
  if (He(e))
365
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
- var B = D.ReactCurrentOwner, Xe = {
367
+ var B = T.ReactCurrentOwner, Xe = {
368
368
  key: !0,
369
369
  ref: !0,
370
370
  __self: !0,
@@ -415,54 +415,54 @@ function Er() {
415
415
  });
416
416
  }
417
417
  }
418
- var or = function(e, t, a, v, E, w, y) {
419
- var h = {
418
+ var or = function(e, t, a, v, E, p, m) {
419
+ var g = {
420
420
  // This tag allows us to uniquely identify this as a React Element
421
421
  $$typeof: n,
422
422
  // Built-in properties that belong on the element
423
423
  type: e,
424
424
  key: t,
425
425
  ref: a,
426
- props: y,
426
+ props: m,
427
427
  // Record the component responsible for creating this element.
428
- _owner: w
428
+ _owner: p
429
429
  };
430
- return h._store = {}, Object.defineProperty(h._store, "validated", {
430
+ return g._store = {}, Object.defineProperty(g._store, "validated", {
431
431
  configurable: !1,
432
432
  enumerable: !1,
433
433
  writable: !0,
434
434
  value: !1
435
- }), Object.defineProperty(h, "_self", {
435
+ }), Object.defineProperty(g, "_self", {
436
436
  configurable: !1,
437
437
  enumerable: !1,
438
438
  writable: !1,
439
439
  value: v
440
- }), Object.defineProperty(h, "_source", {
440
+ }), Object.defineProperty(g, "_source", {
441
441
  configurable: !1,
442
442
  enumerable: !1,
443
443
  writable: !1,
444
444
  value: E
445
- }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
445
+ }), Object.freeze && (Object.freeze(g.props), Object.freeze(g)), g;
446
446
  };
447
447
  function ar(e, t, a, v, E) {
448
448
  {
449
- var w, y = {}, h = null, x = null;
450
- a !== void 0 && (Se(a), h = "" + a), er(t) && (Se(t.key), h = "" + t.key), Ze(t) && (x = t.ref, rr(t, E));
451
- for (w in t)
452
- X.call(t, w) && !Xe.hasOwnProperty(w) && (y[w] = t[w]);
449
+ var p, m = {}, g = null, x = null;
450
+ a !== void 0 && (Se(a), g = "" + a), er(t) && (Se(t.key), g = "" + t.key), Ze(t) && (x = t.ref, rr(t, E));
451
+ for (p in t)
452
+ X.call(t, p) && !Xe.hasOwnProperty(p) && (m[p] = t[p]);
453
453
  if (e && e.defaultProps) {
454
454
  var C = e.defaultProps;
455
- for (w in C)
456
- y[w] === void 0 && (y[w] = C[w]);
455
+ for (p in C)
456
+ m[p] === void 0 && (m[p] = C[p]);
457
457
  }
458
- if (h || x) {
458
+ if (g || x) {
459
459
  var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
460
- h && tr(y, P), x && nr(y, P);
460
+ g && tr(m, P), x && nr(m, P);
461
461
  }
462
- return or(e, h, x, E, v, B.current, y);
462
+ return or(e, g, x, E, v, B.current, m);
463
463
  }
464
464
  }
465
- var ue = D.ReactCurrentOwner, Oe = D.ReactDebugCurrentFrame;
465
+ var ue = T.ReactCurrentOwner, Oe = T.ReactDebugCurrentFrame;
466
466
  function V(e) {
467
467
  if (e) {
468
468
  var t = e._owner, a = H(e.type, e._source, t ? t.type : null);
@@ -490,7 +490,7 @@ Check the render method of \`` + e + "`.";
490
490
  function ir(e) {
491
491
  return "";
492
492
  }
493
- var De = {};
493
+ var Ie = {};
494
494
  function ur(e) {
495
495
  {
496
496
  var t = Ae();
@@ -503,15 +503,15 @@ Check the top-level render call using <` + a + ">.");
503
503
  return t;
504
504
  }
505
505
  }
506
- function Ie(e, t) {
506
+ function De(e, t) {
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 = ur(t);
512
- if (De[a])
512
+ if (Ie[a])
513
513
  return;
514
- De[a] = !0;
514
+ Ie[a] = !0;
515
515
  var v = "";
516
516
  e && e._owner && e._owner !== ue.current && (v = " It was passed a child from " + k(e._owner.type) + "."), V(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), V(null);
517
517
  }
@@ -523,15 +523,15 @@ Check the top-level render call using <` + a + ">.");
523
523
  if (ae(e))
524
524
  for (var a = 0; a < e.length; a++) {
525
525
  var v = e[a];
526
- ce(v) && Ie(v, t);
526
+ ce(v) && De(v, t);
527
527
  }
528
528
  else if (ce(e))
529
529
  e._store && (e._store.validated = !0);
530
530
  else if (e) {
531
531
  var E = S(e);
532
532
  if (typeof E == "function" && E !== e.entries)
533
- for (var w = E.call(e), y; !(y = w.next()).done; )
534
- ce(y.value) && Ie(y.value, t);
533
+ for (var p = E.call(e), m; !(m = p.next()).done; )
534
+ ce(m.value) && De(m.value, t);
535
535
  }
536
536
  }
537
537
  }
@@ -545,7 +545,7 @@ Check the top-level render call using <` + a + ">.");
545
545
  a = t.propTypes;
546
546
  else if (typeof t == "object" && (t.$$typeof === c || // Note: Memo only checks outer props here.
547
547
  // Inner props are checked in the reconciler.
548
- t.$$typeof === p))
548
+ t.$$typeof === R))
549
549
  a = t.propTypes;
550
550
  else
551
551
  return;
@@ -572,32 +572,32 @@ Check the top-level render call using <` + a + ">.");
572
572
  e.ref !== null && (V(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
573
573
  }
574
574
  }
575
- function $e(e, t, a, v, E, w) {
575
+ function $e(e, t, a, v, E, p) {
576
576
  {
577
- var y = ze(e);
578
- if (!y) {
579
- var h = "";
580
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (h += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
577
+ var m = ze(e);
578
+ if (!m) {
579
+ var g = "";
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 x = ir();
582
- x ? h += x : h += Ae();
582
+ x ? g += x : g += Ae();
583
583
  var C;
584
- e === null ? C = "null" : ae(e) ? C = "array" : e !== void 0 && e.$$typeof === n ? (C = "<" + (k(e.type) || "Unknown") + " />", h = " 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, h);
584
+ e === null ? C = "null" : ae(e) ? C = "array" : e !== void 0 && e.$$typeof === n ? (C = "<" + (k(e.type) || "Unknown") + " />", g = " 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, g);
585
585
  }
586
- var P = ar(e, t, a, E, w);
586
+ var P = ar(e, t, a, E, p);
587
587
  if (P == null)
588
588
  return P;
589
- if (y) {
590
- var O = t.children;
591
- if (O !== void 0)
589
+ if (m) {
590
+ var A = t.children;
591
+ if (A !== void 0)
592
592
  if (v)
593
- if (ae(O)) {
594
- for (var M = 0; M < O.length; M++)
595
- ke(O[M], e);
596
- Object.freeze && Object.freeze(O);
593
+ if (ae(A)) {
594
+ for (var M = 0; M < A.length; M++)
595
+ ke(A[M], e);
596
+ Object.freeze && Object.freeze(A);
597
597
  } else
598
598
  _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
599
599
  else
600
- ke(O, e);
600
+ ke(A, e);
601
601
  }
602
602
  return e === u ? cr(P) : sr(P), P;
603
603
  }
@@ -612,9 +612,9 @@ Check the top-level render call using <` + a + ">.");
612
612
  Q.Fragment = u, Q.jsx = dr, Q.jsxs = vr;
613
613
  }()), Q;
614
614
  }
615
- process.env.NODE_ENV === "production" ? le.exports = mr() : le.exports = Er();
615
+ process.env.NODE_ENV === "production" ? le.exports = yr() : le.exports = Er();
616
616
  var F = le.exports;
617
- const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
617
+ const I = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
618
618
  const u = fe(
619
619
  () => ({
620
620
  apiURL: n,
@@ -622,8 +622,8 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
622
622
  }),
623
623
  [n, o]
624
624
  );
625
- return /* @__PURE__ */ F.jsx(A.Provider, { value: u, children: r });
626
- }, Dr = ({
625
+ return /* @__PURE__ */ F.jsx(I.Provider, { value: u, children: r });
626
+ }, Ir = ({
627
627
  Fallback: r,
628
628
  isLogged: n,
629
629
  loginPath: o = "/login",
@@ -632,35 +632,35 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
632
632
  ...f
633
633
  }) => {
634
634
  var _, L, Y, N;
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);
635
+ const { libraries: l } = D(I), 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, m] = We(null), { useLocation: p, Navigate: R, Outlet: s } = d, j = p(), T = hr(!1), S = typeof n == "function" ? n() : !!n, D = typeof S == "boolean" ? S : S == null ? void 0 : S.isLogged;
638
+ const [h, y] = We(null), { useLocation: R, Navigate: w, Outlet: s } = d, j = R(), O = hr(!1), S = typeof n == "function" ? n() : !!n, T = typeof S == "boolean" ? S : S == null ? void 0 : S.isLogged;
639
639
  return z(() => {
640
- T.current || (T.current = !0, c.interceptors.response.use(
640
+ O.current || (O.current = !0, c.interceptors.response.use(
641
641
  (b) => b,
642
642
  async (b) => {
643
643
  var U;
644
- return typeof b == "object" && b && "response" in b && b.response && typeof b.response == "object" && "status" in b.response && b.response && typeof b.response == "object" && "status" in b.response && ((U = b == null ? void 0 : b.response) == null ? void 0 : U.status) === 401 && (c.defaults.headers.common.Authorization = null, localStorage.removeItem(u), m(i)), Promise.reject(b);
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(u), y(i)), Promise.reject(b);
645
645
  }
646
646
  ));
647
- }, [c.defaults.headers.common, c.interceptors.response, u, i]), D && !g ? /* @__PURE__ */ F.jsx(yr, { fallback: r, children: (L = (_ = j.state) == null ? void 0 : _.from) != null && L.state && ((N = (Y = j.state) == null ? void 0 : Y.from) == null ? void 0 : N.pathname) === o ? /* @__PURE__ */ F.jsx(R, { to: j.state.from.state.from.pathname + j.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ F.jsx(s, {}) }) : /* @__PURE__ */ F.jsx(R, { to: o + j.search, state: { from: j }, replace: !0 });
648
- }, Ir = ({ data: r, ...n }) => {
649
- const { libraries: o } = I(A), u = (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);
647
+ }, [c.defaults.headers.common, c.interceptors.response, u, i]), T && !h ? /* @__PURE__ */ F.jsx(mr, { fallback: r, children: (L = (_ = j.state) == null ? void 0 : _.from) != null && L.state && ((N = (Y = j.state) == null ? void 0 : Y.from) == null ? void 0 : N.pathname) === o ? /* @__PURE__ */ F.jsx(w, { to: j.state.from.state.from.pathname + j.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ F.jsx(s, {}) }) : /* @__PURE__ */ F.jsx(w, { to: o + j.search, state: { from: j }, replace: !0 });
648
+ }, Dr = ({ data: r, ...n }) => {
649
+ const { libraries: o } = D(I), u = (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 (!u)
651
651
  throw new Error(
652
652
  "React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView."
653
653
  );
654
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
- const { useGoogleTagManager: f } = i, { useLocation: l, Outlet: d } = u, { pathname: c } = l(), { sendEvent: g } = f();
656
+ const { useGoogleTagManager: f } = i, { useLocation: l, Outlet: d } = u, { pathname: c } = l(), { sendEvent: h } = f();
657
657
  return z(() => {
658
- g({
658
+ h({
659
659
  event: "pageView",
660
660
  pathname: c,
661
661
  ...r
662
662
  });
663
- }, [r, c, g]), /* @__PURE__ */ F.jsx(d, {});
663
+ }, [r, c, h]), /* @__PURE__ */ F.jsx(d, {});
664
664
  }, kr = ({
665
665
  tokenTypeKey: r = "tokenType",
666
666
  userLocalStorageKey: n = "user",
@@ -668,15 +668,15 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
668
668
  postContentType: u = "application/json",
669
669
  ...i
670
670
  }) => {
671
- const { apiURL: f = i.apiURL, libraries: l } = I(A), d = (i == null ? void 0 : i.axios) || (l == null ? void 0 : l.axios);
671
+ const { apiURL: f = i.apiURL, libraries: l } = D(I), 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, m = g != null && g[r] ? g[r] : null, p = g != null && g[o] ? g[o] : null, R = c ? `${m} ${p}` : null;
677
- return d.defaults.baseURL = f, d.defaults.headers.post["Content-Type"] = u, R && (d.defaults.headers.common.Authorization = R), null;
676
+ const c = localStorage.getItem(n), h = c ? JSON.parse(c) : null, y = h != null && h[r] ? h[r] : null, R = h != null && h[o] ? h[o] : null, w = c ? `${y} ${R}` : null;
677
+ return d.defaults.baseURL = f, d.defaults.headers.post["Content-Type"] = u, w && (d.defaults.headers.common.Authorization = w), null;
678
678
  }, $r = ({ debug: r, resources: n, ...o }) => {
679
- const { libraries: u } = I(A), i = (o == null ? void 0 : o.i18) || (u == null ? void 0 : u.i18), { i18next: f, initReactI18next: l, languageDetector: d } = i || {};
679
+ const { libraries: u } = D(I), i = (o == null ? void 0 : o.i18) || (u == null ? void 0 : u.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({
@@ -707,31 +707,41 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
707
707
  ignoreErrors: l,
708
708
  debug: d,
709
709
  environment: c,
710
- ...g
710
+ release: h,
711
+ ...y
711
712
  }) => {
712
- const { libraries: m } = I(A), p = (g == null ? void 0 : g.sentry) || (m == null ? void 0 : m.sentry), R = (g == null ? void 0 : g.reactRouter) || (m == null ? void 0 : m.reactRouter);
713
- if (!p)
713
+ const { libraries: R } = D(I), w = (y == null ? void 0 : y.sentry) || (R == null ? void 0 : R.sentry), s = (y == null ? void 0 : y.reactRouter) || (R == null ? void 0 : R.reactRouter);
714
+ if (!w)
714
715
  throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
715
- if (!R)
716
+ if (!s)
716
717
  throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
717
- if (p.isInitialized())
718
+ if (w.isInitialized())
718
719
  return null;
719
- const { createRoutesFromChildren: s, matchRoutes: j, useLocation: T, useNavigationType: S } = R;
720
- return (d || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && p.init({
720
+ const { createRoutesFromChildren: j, matchRoutes: O, useLocation: S, useNavigationType: T } = s;
721
+ return (d || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && w.init({
721
722
  debug: d,
722
723
  dsn: r,
723
724
  environment: c || "production",
724
- ignoreErrors: l,
725
+ ignoreErrors: [
726
+ ...l || [],
727
+ /dynamically imported module/,
728
+ /Cannot read properties of undefined \(reading 'default'\)/,
729
+ /Loading chunk \d+ failed/,
730
+ /ChunkLoadError/,
731
+ /Failed to fetch dynamically imported module/,
732
+ /vite:preloadError/
733
+ ],
725
734
  integrations: [
726
- p.reactRouterV6BrowserTracingIntegration({
727
- createRoutesFromChildren: s,
728
- matchRoutes: j,
735
+ w.reactRouterV6BrowserTracingIntegration({
736
+ createRoutesFromChildren: j,
737
+ matchRoutes: O,
729
738
  useEffect: z,
730
- useLocation: T,
731
- useNavigationType: S
739
+ useLocation: S,
740
+ useNavigationType: T
732
741
  }),
733
742
  ...n || []
734
743
  ],
744
+ release: h,
735
745
  replaysOnErrorSampleRate: i || 1,
736
746
  replaysSessionSampleRate: u || 0.1,
737
747
  tracePropagationTargets: f,
@@ -745,12 +755,12 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
745
755
  );
746
756
  return /* @__PURE__ */ F.jsx(o, { ...n });
747
757
  }, Yr = ({ accessToken: r, ...n }) => {
748
- const { libraries: o } = I(A), u = (n == null ? void 0 : n.mapbox) || (o == null ? void 0 : o.mapbox);
758
+ const { libraries: o } = D(I), u = (n == null ? void 0 : n.mapbox) || (o == null ? void 0 : o.mapbox);
749
759
  if (!u)
750
760
  throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
751
761
  return r && (u.accessToken = r), null;
752
762
  }, Nr = ({ language: r, ...n }) => {
753
- const { libraries: o } = I(A), u = (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);
763
+ const { libraries: o } = D(I), u = (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
764
  if (!u)
755
765
  throw new Error(
756
766
  "Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig."
@@ -767,28 +777,28 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
767
777
  }, Wr = () => (z(() => {
768
778
  const r = (n) => {
769
779
  try {
770
- n.preventDefault(), n.stopPropagation(), window.location.reload();
780
+ n.preventDefault(), n.stopPropagation(), n.stopImmediatePropagation(), window.location.reload();
771
781
  } catch {
772
782
  }
773
783
  };
774
784
  return window.addEventListener("vite:preloadError", r), () => {
775
785
  window.removeEventListener("vite:preloadError", r);
776
786
  };
777
- }, []), null), wr = (r) => r && typeof r == "function", Rr = (r) => r && typeof r == "function", zr = ({
787
+ }, []), null), pr = (r) => r && typeof r == "function", wr = (r) => r && typeof r == "function", zr = ({
778
788
  children: r,
779
789
  defaultQueriesOptions: n,
780
790
  defaultMutationsOptions: o,
781
791
  ...u
782
792
  }) => {
783
- var c, g;
784
- const { libraries: i } = I(A), f = (u == null ? void 0 : u.QueryClient) || ((c = i == null ? void 0 : i.reactQuery) == null ? void 0 : c.QueryClient), l = (u == null ? void 0 : u.QueryClientProvider) || ((g = i == null ? void 0 : i.reactQuery) == null ? void 0 : g.QueryClientProvider);
793
+ var c, h;
794
+ const { libraries: i } = D(I), f = (u == null ? void 0 : u.QueryClient) || ((c = i == null ? void 0 : i.reactQuery) == null ? void 0 : c.QueryClient), l = (u == null ? void 0 : u.QueryClientProvider) || ((h = i == null ? void 0 : i.reactQuery) == null ? void 0 : h.QueryClientProvider);
785
795
  if (!f)
786
796
  throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
787
797
  if (!l)
788
798
  throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
789
- if (!wr(l))
799
+ if (!pr(l))
790
800
  throw new Error("Provided QueryClientProvider dependencies are not valid.");
791
- if (!Rr(f))
801
+ if (!wr(f))
792
802
  throw new Error("Provided QueryClient dependencies are not valid.");
793
803
  const d = new f({
794
804
  defaultOptions: {
@@ -796,7 +806,7 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
796
806
  ...o
797
807
  },
798
808
  queries: {
799
- getNextPageParam: (m, p, R) => m.length + (R || 0),
809
+ getNextPageParam: (y, R, w) => y.length + (w || 0),
800
810
  refetchOnWindowFocus: !1,
801
811
  retry: 3,
802
812
  ...n
@@ -805,19 +815,19 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
805
815
  });
806
816
  return /* @__PURE__ */ F.jsx(l, { client: d, children: r });
807
817
  }, Vr = (r) => {
808
- var g, m, p;
809
- const { libraries: n } = I(A), o = (r == null ? void 0 : r.i18) || (n == null ? void 0 : n.i18), u = ((g = r == null ? void 0 : r.i18) == null ? void 0 : g.translateFunction) || ((m = n == null ? void 0 : n.i18) == null ? void 0 : m.translateFunction), i = ((p = o == null ? void 0 : o.i18next) == null ? void 0 : p.t) || u || ((R) => R), { unknownErrorTranslationKey: f = "error.unknownError" } = r || {}, l = i(f), d = re(
810
- (R) => {
811
- var j, T, S, D, _, L, Y, N, b;
812
- const { response: s } = R || {};
813
- return s != null && s.reason ? String(s.reason) : (j = s == null ? void 0 : s.data) != null && j.reason ? String(s.data.reason) : (T = s == null ? void 0 : s.data) != null && T.message ? String(s.data.message) : (D = (S = s == null ? void 0 : s.data) == null ? void 0 : S.detail) != null && D.length && Array.isArray((_ = s == null ? void 0 : s.data) == null ? void 0 : _.detail) && ((Y = (L = s == null ? void 0 : s.data) == null ? void 0 : L.detail[0]) != null && Y.msg) && typeof ((b = (N = s == null ? void 0 : s.data) == null ? void 0 : N.detail[0]) == null ? void 0 : b.msg) == "string" ? String(s.data.detail[0].msg) : l;
818
+ var h, y, R;
819
+ const { libraries: n } = D(I), o = (r == null ? void 0 : r.i18) || (n == null ? void 0 : n.i18), u = ((h = r == null ? void 0 : r.i18) == null ? void 0 : h.translateFunction) || ((y = n == null ? void 0 : n.i18) == null ? void 0 : y.translateFunction), i = ((R = o == null ? void 0 : o.i18next) == null ? void 0 : R.t) || u || ((w) => w), { unknownErrorTranslationKey: f = "error.unknownError" } = r || {}, l = i(f), d = re(
820
+ (w) => {
821
+ var j, O, S, T, _, L, Y, N, b;
822
+ const { response: s } = w || {};
823
+ return s != null && s.reason ? String(s.reason) : (j = s == null ? void 0 : s.data) != null && j.reason ? String(s.data.reason) : (O = s == null ? void 0 : s.data) != null && O.message ? String(s.data.message) : (T = (S = s == null ? void 0 : s.data) == null ? void 0 : S.detail) != null && T.length && Array.isArray((_ = s == null ? void 0 : s.data) == null ? void 0 : _.detail) && ((Y = (L = s == null ? void 0 : s.data) == null ? void 0 : L.detail[0]) != null && Y.msg) && typeof ((b = (N = s == null ? void 0 : s.data) == null ? void 0 : N.detail[0]) == null ? void 0 : b.msg) == "string" ? String(s.data.detail[0].msg) : l;
814
824
  },
815
825
  [l]
816
826
  );
817
- return { getErrorCode: re((R) => {
818
- var j, T, S;
819
- const { response: s } = R || {};
820
- return s != null && s.error_code ? String(s == null ? void 0 : s.error_code) : (j = s == null ? void 0 : s.data) != null && j.error_code ? String((T = s == null ? void 0 : s.data) == null ? void 0 : T.error_code) : s != null && s.error_code ? String(s == null ? void 0 : s.error_code) : (S = s == null ? void 0 : s.data) != null && S.error_code ? String(s.data.error_code) : "unknown_error_code";
827
+ return { getErrorCode: re((w) => {
828
+ var j, O, S;
829
+ const { response: s } = w || {};
830
+ return s != null && s.error_code ? String(s == null ? void 0 : s.error_code) : (j = s == null ? void 0 : s.data) != null && j.error_code ? String((O = s == null ? void 0 : s.data) == null ? void 0 : O.error_code) : s != null && s.error_code ? String(s == null ? void 0 : s.error_code) : (S = s == null ? void 0 : s.data) != null && S.error_code ? String(s.data.error_code) : "unknown_error_code";
821
831
  }, []), printError: d };
822
832
  }, Mr = ({
823
833
  data: r,
@@ -834,7 +844,7 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
834
844
  [f, n, o]
835
845
  ), d = fe(() => {
836
846
  if (r)
837
- return r.pages.reduce((c, g) => [...c, ...g], []);
847
+ return r.pages.reduce((c, h) => [...c, ...h], []);
838
848
  }, [r]);
839
849
  return {
840
850
  fetchNextPageOnRowsScrollEnd: l,
@@ -843,7 +853,7 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
843
853
  rows: d
844
854
  };
845
855
  }, Ur = (r) => {
846
- const { libraries: n } = I(A), o = (r == null ? void 0 : r.axios) || (n == null ? void 0 : n.axios), u = (r == null ? void 0 : r.localStorageKey) || "user";
856
+ const { libraries: n } = D(I), o = (r == null ? void 0 : r.axios) || (n == null ? void 0 : n.axios), u = (r == null ? void 0 : r.localStorageKey) || "user";
847
857
  if (!o)
848
858
  throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
849
859
  const i = re(
@@ -858,10 +868,10 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
858
868
  const l = ({ newValue: d, key: c }) => {
859
869
  if (c === u && d)
860
870
  try {
861
- const { accessToken: g, tokenType: m } = JSON.parse(d);
862
- i({ accessToken: g, tokenType: m });
863
- } catch (g) {
864
- console.error("Failed to parse newValue from localStorage:", g);
871
+ const { accessToken: h, tokenType: y } = JSON.parse(d);
872
+ i({ accessToken: h, tokenType: y });
873
+ } catch (h) {
874
+ console.error("Failed to parse newValue from localStorage:", h);
865
875
  }
866
876
  };
867
877
  return window.addEventListener("storage", l), () => {
@@ -871,7 +881,7 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
871
881
  clearAuthenticationToken: f,
872
882
  setAuthenticationToken: i
873
883
  };
874
- }, pr = ({ library: r, date: n, format: o = "ll" }) => r(n).format(o), _r = (r, n = "km") => {
884
+ }, Rr = ({ library: r, date: n, format: o = "ll" }) => r(n).format(o), _r = (r, n = "km") => {
875
885
  const o = Number(r);
876
886
  return Number.isNaN(o) ? `0 ${n}` : `${o.toFixed(2)} ${n}`;
877
887
  }, Cr = (r) => r != null && r.startsWith("/") ? r != null && r.startsWith("/files") ? r : `/files${r}` : r != null && r.startsWith("files") ? `/${r}` : r != null && r.startsWith("files") ? `/${r}` : `/files/${r}`, br = ({ path: r, size: n, apiURL: o }) => {
@@ -880,12 +890,12 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
880
890
  const u = Cr(r), i = `${o}${u}`, f = i.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
881
891
  return typeof n == "number" && f ? `${i.replace("/files", `/thumbs/${n}`)}` : i;
882
892
  }, qr = (r) => {
883
- const { apiURL: n, libraries: o } = I(A), u = (r == null ? void 0 : r.dayjs) || (o == null ? void 0 : o.dayjs);
893
+ const { apiURL: n, libraries: o } = D(I), u = (r == null ? void 0 : r.dayjs) || (o == null ? void 0 : o.dayjs);
884
894
  return {
885
895
  dateAdapter: (l, d) => {
886
896
  if (!u)
887
897
  throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
888
- return pr({
898
+ return Rr({
889
899
  date: l,
890
900
  format: d,
891
901
  library: u
@@ -972,19 +982,19 @@ const A = gr({}), Ar = ({ children: r, apiURL: n, libraries: o }) => {
972
982
  };
973
983
  }, {});
974
984
  export {
975
- Ir as GTMSendPageView,
985
+ Dr as GTMSendPageView,
976
986
  kr as InitializeAxiosConfig,
977
987
  Nr as InitializeDaysJSConfig,
978
988
  $r as InitializeI18nConfig,
979
989
  Yr as InitializeMapBoxConfig,
980
990
  Fr as InitializeSentryConfig,
981
- A as InjectDependenciesContext,
991
+ I as InjectDependenciesContext,
982
992
  Ar as InjectDependenciesProvider,
983
993
  Lr as MaskTextField,
984
994
  Wr as PreloadErrorHandler,
985
995
  zr as QueryClientProviderWithConfig,
986
- Dr as RequireAuth,
987
- pr as dateAdapter,
996
+ Ir as RequireAuth,
997
+ Rr as dateAdapter,
988
998
  _r as distanceAdapter,
989
999
  Gr as getOrvalConfig,
990
1000
  qr as useAdapter,
package/dist/main.umd.cjs CHANGED
@@ -1,4 +1,4 @@
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={};/**
1
+ (function(p,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],g):(p=typeof globalThis<"u"?globalThis:p||self,g(p["@tracktor/shared-module"]={},p.React))})(this,function(p,g){"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 le;function We(){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={};/**
9
+ */var le;function We(){if(le)return B;le=1;var t=g,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,y){var E,_={},C=null,u=null;y!==void 0&&(C=""+y),c.key!==void 0&&(C=""+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:C,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 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 k=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];N("error",e,a)}}function N(e,r,a){{var v=k.ReactDebugCurrentFrame,R=v.getStackAddendum();R!==""&&(r+="%s",a=a.concat([R]));var w=a.map(function(m){return String(m)});w.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,w)}}var W=!1,z=!1,j=!1,ge=!1,he=!1,Q;Q=Symbol.for("react.module.reference");function vt(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===f||he||e===i||e===g||e===E||ge||e===u||W||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 ye(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 ye(r)+".Consumer";case l:var a=e;return ye(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,m=R._init;try{return L(m(w))}catch{return null}}}return null}var M=Object.assign,J=0,me,Ee,Re,we,Ce,pe,_e;function be(){}be.__reactDisabledLog=!0;function ht(){{if(J===0){me=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 yt(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:me}),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=k.ReactCurrentDispatcher,ne;function X(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 mt=typeof WeakMap=="function"?WeakMap:Map;Z=new mt}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,ht();try{if(r){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(Y){v=Y}Reflect.construct(e,[],m)}else{try{m.call()}catch(Y){v=Y}e.call(m.prototype)}}else{try{throw Error()}catch(Y){v=Y}e()}}catch(Y){if(Y&&v&&typeof Y.stack=="string"){for(var y=Y.stack.split(`
17
+ */var fe;function ze(){return fe||(fe=1,process.env.NODE_ENV!=="production"&&function(){var t=g,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"),y=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),u=Symbol.for("react.offscreen"),T=Symbol.iterator,k="@@iterator";function x(e){if(e===null||typeof e!="object")return null;var r=T&&e[T]||e[k];return typeof r=="function"?r:null}var I=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];N("error",e,a)}}function N(e,r,a){{var v=I.ReactDebugCurrentFrame,R=v.getStackAddendum();R!==""&&(r+="%s",a=a.concat([R]));var w=a.map(function(m){return String(m)});w.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,w)}}var W=!1,z=!1,j=!1,ge=!1,he=!1,Q;Q=Symbol.for("react.module.reference");function vt(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===f||he||e===i||e===y||e===E||ge||e===u||W||z||j||typeof e=="object"&&e!==null&&(e.$$typeof===C||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 ye(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 y:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return ye(r)+".Consumer";case l:var a=e;return ye(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 C:{var R=e,w=R._payload,m=R._init;try{return L(m(w))}catch{return null}}}return null}var M=Object.assign,J=0,me,Ee,Re,we,pe,Ce,_e;function be(){}be.__reactDisabledLog=!0;function ht(){{if(J===0){me=console.log,Ee=console.info,Re=console.warn,we=console.error,pe=console.group,Ce=console.groupCollapsed,_e=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}J++}}function yt(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:me}),info:M({},e,{value:Ee}),warn:M({},e,{value:Re}),error:M({},e,{value:we}),group:M({},e,{value:pe}),groupCollapsed:M({},e,{value:Ce}),groupEnd:M({},e,{value:_e})})}J<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=I.ReactCurrentDispatcher,ne;function X(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 mt=typeof WeakMap=="function"?WeakMap:Map;Z=new mt}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,ht();try{if(r){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(Y){v=Y}Reflect.construct(e,[],m)}else{try{m.call()}catch(Y){v=Y}e.call(m.prototype)}}else{try{throw Error()}catch(Y){v=Y}e()}}catch(Y){if(Y&&v&&typeof Y.stack=="string"){for(var h=Y.stack.split(`
19
19
  `),O=v.stack.split(`
20
- `),P=y.length-1,S=O.length-1;P>=1&&S>=0&&y[P]!==O[S];)S--;for(;P>=1&&S>=0;P--,S--)if(y[P]!==O[S]){if(P!==1||S!==1)do if(P--,S--,S<0||y[P]!==O[S]){var D=`
21
- `+y[P].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),typeof e=="function"&&Z.set(e,D),D}while(P>=1&&S>=0);break}}}finally{oe=!1,re.current=w,yt(),Error.prepareStackTrace=R}var U=e?e.displayName||e.name:"",Ne=U?X(U):"";return typeof e=="function"&&Z.set(e,Ne),Ne}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 X(e);switch(e){case g:return X("Suspense");case E:return X("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=k.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 m in e)if(w(e,m)){var y=void 0;try{if(typeof e[m]!="function"){var O=Error((v||"React class")+": "+a+" 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`.");throw O.name="Invariant Violation",O}y=e[m](r,m,v,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){y=P}y&&!(y 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,m,typeof y),ee(null)),y instanceof Error&&!(y.message in je)&&(je[y.message]=!0,ee(R),b("Failed %s type: %s",a,y.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 H=k.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"&&H.current&&r&&H.current.stateNode!==r){var a=L(H.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(H.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,m){var y={$$typeof:n,type:e,key:r,ref:a,props:m,_owner:w};return y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(y,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(y,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y};function At(e,r,a,v,R){{var w,m={},y=null,O=null;a!==void 0&&(xe(a),y=""+a),jt(r)&&(xe(r.key),y=""+r.key),Pt(r)&&(O=r.ref,St(r,R));for(w in r)q.call(r,w)&&!bt.hasOwnProperty(w)&&(m[w]=r[w]);if(e&&e.defaultProps){var P=e.defaultProps;for(w in P)m[w]===void 0&&(m[w]=P[w])}if(y||O){var S=typeof e=="function"?e.displayName||e.name||"Unknown":e;y&&Tt(m,S),O&&xt(m,S)}return Ot(e,y,O,R,v,H.current,m)}}var se=k.ReactCurrentOwner,Ie=k.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 De(){{if(se.current){var e=L(se.current.type);if(e)return`
20
+ `),P=h.length-1,S=O.length-1;P>=1&&S>=0&&h[P]!==O[S];)S--;for(;P>=1&&S>=0;P--,S--)if(h[P]!==O[S]){if(P!==1||S!==1)do if(P--,S--,S<0||h[P]!==O[S]){var D=`
21
+ `+h[P].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),typeof e=="function"&&Z.set(e,D),D}while(P>=1&&S>=0);break}}}finally{oe=!1,re.current=w,yt(),Error.prepareStackTrace=R}var U=e?e.displayName||e.name:"",Ne=U?X(U):"";return typeof e=="function"&&Z.set(e,Ne),Ne}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 X(e);switch(e){case y:return X("Suspense");case E:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return Et(e.render);case _:return $(e.type,r,a);case C:{var v=e,R=v._payload,w=v._init;try{return $(w(R),r,a)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,je={},Se=I.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 m in e)if(w(e,m)){var h=void 0;try{if(typeof e[m]!="function"){var O=Error((v||"React class")+": "+a+" 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`.");throw O.name="Invariant Violation",O}h=e[m](r,m,v,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){h=P}h&&!(h 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,m,typeof h),ee(null)),h instanceof Error&&!(h.message in je)&&(je[h.message]=!0,ee(R),b("Failed %s type: %s",a,h.message),ee(null))}}}var pt=Array.isArray;function ae(e){return pt(e)}function Ct(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.",Ct(e)),Te(e)}var H=I.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"&&H.current&&r&&H.current.stateNode!==r){var a=L(H.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(H.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,m){var h={$$typeof:n,type:e,key:r,ref:a,props:m,_owner:w};return h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(h,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(h,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h};function At(e,r,a,v,R){{var w,m={},h=null,O=null;a!==void 0&&(xe(a),h=""+a),jt(r)&&(xe(r.key),h=""+r.key),Pt(r)&&(O=r.ref,St(r,R));for(w in r)q.call(r,w)&&!bt.hasOwnProperty(w)&&(m[w]=r[w]);if(e&&e.defaultProps){var P=e.defaultProps;for(w in P)m[w]===void 0&&(m[w]=P[w])}if(h||O){var S=typeof e=="function"?e.displayName||e.name||"Unknown":e;h&&Tt(m,S),O&&xt(m,S)}return Ot(e,h,O,R,v,H.current,m)}}var se=I.ReactCurrentOwner,Ie=I.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 It(e){return""}var ke={};function Dt(e){{var r=De();if(!r){var a=typeof e=="string"?e:e.displayName||e.name;a&&(r=`
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=Dt(r);if(ke[a])return;ke[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),m;!(m=w.next()).done;)ce(m.value)&&Fe(m.value,r)}}}function kt(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 Ye(e,r,a,v,R,w){{var m=vt(e);if(!m){var y="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(y+=" 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?y+=O:y+=De();var P;e===null?P="null":ae(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(L(e.type)||"Unknown")+" />",y=" 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,y)}var S=At(e,r,a,R,w);if(S==null)return S;if(m){var D=r.children;if(D!==void 0)if(v)if(ae(D)){for(var U=0;U<D.length;U++)Le(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 Le(D,e)}return e===s?Ft(S):kt(S),S}}function Lt(e,r,a){return Ye(e,r,a,!0)}function Yt(e,r,a){return Ye(e,r,a,!1)}var Nt=Yt,Wt=Lt;G.Fragment=s,G.jsx=Nt,G.jsxs=Wt}()),G}process.env.NODE_ENV==="production"?te.exports=We():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,N,W,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,k=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]),k&&!g?F.jsx(h.Suspense,{fallback:t,children:(N=(b=T.state)==null?void 0:b.from)!=null&&N.state&&((z=(W=T.state)==null?void 0:W.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,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})},He=({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},Ke=({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},Xe=()=>(h.useEffect(()=>{const t=n=>{try{n.preventDefault(),n.stopPropagation(),window.location.reload()}catch{}};return window.addEventListener("vite:preloadError",t),()=>{window.removeEventListener("vite:preloadError",t)}},[]),null),Ze=t=>t&&typeof t=="function",$e=t=>t&&typeof t=="function",qe=({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(!Ze(l))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!$e(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})},et=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,k,b,N,W,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):(k=(x=u==null?void 0:u.data)==null?void 0:x.detail)!=null&&k.length&&Array.isArray((b=u==null?void 0:u.data)==null?void 0:b.detail)&&((W=(N=u==null?void 0:u.data)==null?void 0:N.detail[0])!=null&&W.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}},tt=({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}},rt=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}`},nt=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}`,ot=({path:t,size:n,apiURL:o})=>{if(!t)return"";const s=nt(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},at=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 ot({apiURL:n,path:l,size:d})}}},K=(t,n)=>n==="short"?t.split("-")[0]:t,it=(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,K(i,n)});return h.useEffect(()=>{var f;t&&"isInitialized"in t&&t.isInitialized&&t.language&&s(K(t.language,n));const i=l=>{s(K(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},st=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),ut=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)},ct=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),lt=(t,n,o)=>{const s=ut(n),i=st(o);return`${s}${i}`},ft=t=>{if(t)return(t==null?void 0:t.reduce((n,o)=>(n[o]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},dt=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:ft(f)},header:c=>["Generated by orval 🍺",...c.title?[c.title]:[],...c.description?[c.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:lt,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}}}},{});C.GTMSendPageView=Ue,C.InitializeAxiosConfig=Be,C.InitializeDaysJSConfig=Ke,C.InitializeI18nConfig=Ge,C.InitializeMapBoxConfig=He,C.InitializeSentryConfig=Qe,C.InjectDependenciesContext=A,C.InjectDependenciesProvider=Me,C.MaskTextField=Je,C.PreloadErrorHandler=Xe,C.QueryClientProviderWithConfig=qe,C.RequireAuth=Ve,C.dateAdapter=de,C.distanceAdapter=ve,C.getOrvalConfig=dt,C.useAdapter=at,C.useAuth=rt,C.useCurrentLanguage=it,C.useInfiniteDataGrid=tt,C.useResponseError=et,Object.defineProperty(C,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),m;!(m=w.next()).done;)ce(m.value)&&Fe(m.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 Ye(e,r,a,v,R,w){{var m=vt(e);if(!m){var h="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(h+=" 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?h+=O:h+=ke();var P;e===null?P="null":ae(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(L(e.type)||"Unknown")+" />",h=" 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,h)}var S=At(e,r,a,R,w);if(S==null)return S;if(m){var D=r.children;if(D!==void 0)if(v)if(ae(D)){for(var U=0;U<D.length;U++)Le(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 Le(D,e)}return e===s?Ft(S):Dt(S),S}}function Lt(e,r,a){return Ye(e,r,a,!0)}function Yt(e,r,a){return Ye(e,r,a,!1)}var Nt=Yt,Wt=Lt;G.Fragment=s,G.jsx=Nt,G.jsxs=Wt}()),G}process.env.NODE_ENV==="production"?te.exports=We():te.exports=ze();var F=te.exports;const A=g.createContext({}),Me=({children:t,apiURL:n,libraries:o})=>{const s=g.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,N,W,z;const{libraries:l}=g.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[y,E]=g.useState(null),{useLocation:_,Navigate:C,Outlet:u}=d,T=_(),k=g.useRef(!1),x=typeof n=="function"?n():!!n,I=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return g.useEffect(()=>{k.current||(k.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]),I&&!y?F.jsx(g.Suspense,{fallback:t,children:(N=(b=T.state)==null?void 0:b.from)!=null&&N.state&&((z=(W=T.state)==null?void 0:W.from)==null?void 0:z.pathname)===o?F.jsx(C,{to:T.state.from.state.from.pathname+T.state.from.state.from.search,replace:!0}):F.jsx(u,{})}):F.jsx(C,{to:o+T.search,state:{from:T},replace:!0})},Ue=({data:t,...n})=>{const{libraries:o}=g.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:y}=f();return g.useEffect(()=>{y({event:"pageView",pathname:c,...t})},[t,c,y]),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}=g.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),y=c?JSON.parse(c):null,E=y!=null&&y[t]?y[t]:null,_=y!=null&&y[o]?y[o]:null,C=c?`${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}=g.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,release:y,...E})=>{const{libraries:_}=g.useContext(A),C=(E==null?void 0:E.sentry)||(_==null?void 0:_.sentry),u=(E==null?void 0:E.reactRouter)||(_==null?void 0:_.reactRouter);if(!C)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!u)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(C.isInitialized())return null;const{createRoutesFromChildren:T,matchRoutes:k,useLocation:x,useNavigationType:I}=u;return(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&C.init({debug:d,dsn:t,environment:c||"production",ignoreErrors:[...l||[],/dynamically imported module/,/Cannot read properties of undefined \(reading 'default'\)/,/Loading chunk \d+ failed/,/ChunkLoadError/,/Failed to fetch dynamically imported module/,/vite:preloadError/],integrations:[C.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:T,matchRoutes:k,useEffect:g.useEffect,useLocation:x,useNavigationType:I}),...n||[]],release:y,replaysOnErrorSampleRate:i||1,replaysSessionSampleRate:s||.1,tracePropagationTargets:f,tracesSampleRate:o||1}),null},Je=({IMaskMixin:t,...n})=>{const o=g.useMemo(()=>t(({TextField:s,...i})=>F.jsx(s,{...i})),[t]);return F.jsx(o,{...n})},He=({accessToken:t,...n})=>{const{libraries:o}=g.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},Ke=({language:t,...n})=>{const{libraries:o}=g.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 g.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},Xe=()=>(g.useEffect(()=>{const t=n=>{try{n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),window.location.reload()}catch{}};return window.addEventListener("vite:preloadError",t),()=>{window.removeEventListener("vite:preloadError",t)}},[]),null),Ze=t=>t&&typeof t=="function",$e=t=>t&&typeof t=="function",qe=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:o,...s})=>{var c,y;const{libraries:i}=g.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)||((y=i==null?void 0:i.reactQuery)==null?void 0:y.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(!Ze(l))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!$e(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})},et=t=>{var y,E,_;const{libraries:n}=g.useContext(A),o=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),s=((y=t==null?void 0:t.i18)==null?void 0:y.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=g.useCallback(C=>{var T,k,x,I,b,N,W,z,j;const{response:u}=C||{};return u!=null&&u.reason?String(u.reason):(T=u==null?void 0:u.data)!=null&&T.reason?String(u.data.reason):(k=u==null?void 0:u.data)!=null&&k.message?String(u.data.message):(I=(x=u==null?void 0:u.data)==null?void 0:x.detail)!=null&&I.length&&Array.isArray((b=u==null?void 0:u.data)==null?void 0:b.detail)&&((W=(N=u==null?void 0:u.data)==null?void 0:N.detail[0])!=null&&W.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:g.useCallback(C=>{var T,k,x;const{response:u}=C||{};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((k=u==null?void 0:u.data)==null?void 0:k.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}},tt=({data:t,fetchNextPage:n,isFetchingNextPage:o,isInitialLoading:s,isLoading:i,enabled:f=!0})=>{const l=g.useCallback(async c=>{o||!f||await n({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[f,n,o]),d=g.useMemo(()=>{if(t)return t.pages.reduce((c,y)=>[...c,...y],[])},[t]);return{fetchNextPageOnRowsScrollEnd:l,isLoading:o||i,loadingVariant:s?"skeleton":"linear",rows:d}},rt=t=>{const{libraries:n}=g.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=g.useCallback(({tokenType:l,accessToken:d})=>{o.defaults.headers.common.Authorization=`${l} ${d}`},[o.defaults.headers.common]),f=()=>{o.defaults.headers.common.Authorization=null};return g.useEffect(()=>{const l=({newValue:d,key:c})=>{if(c===s&&d)try{const{accessToken:y,tokenType:E}=JSON.parse(d);i({accessToken:y,tokenType:E})}catch(y){console.error("Failed to parse newValue from localStorage:",y)}};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}`},nt=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}`,ot=({path:t,size:n,apiURL:o})=>{if(!t)return"";const s=nt(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},at=t=>{const{apiURL:n,libraries:o}=g.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 ot({apiURL:n,path:l,size:d})}}},K=(t,n)=>n==="short"?t.split("-")[0]:t,it=(t,n="full")=>{const[o,s]=g.useState(()=>{const i=(t==null?void 0:t.language)||navigator.language;return t&&"isInitialized"in t&&t.isInitialized,K(i,n)});return g.useEffect(()=>{var f;t&&"isInitialized"in t&&t.isInitialized&&t.language&&s(K(t.language,n));const i=l=>{s(K(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},st=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),ut=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)},ct=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),lt=(t,n,o)=>{const s=ut(n),i=st(o);return`${s}${i}`},ft=t=>{if(t)return(t==null?void 0:t.reduce((n,o)=>(n[o]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},dt=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:ft(f)},header:c=>["Generated by orval 🍺",...c.title?[c.title]:[],...c.description?[c.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:lt,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}}}},{});p.GTMSendPageView=Ue,p.InitializeAxiosConfig=Be,p.InitializeDaysJSConfig=Ke,p.InitializeI18nConfig=Ge,p.InitializeMapBoxConfig=He,p.InitializeSentryConfig=Qe,p.InjectDependenciesContext=A,p.InjectDependenciesProvider=Me,p.MaskTextField=Je,p.PreloadErrorHandler=Xe,p.QueryClientProviderWithConfig=qe,p.RequireAuth=Ve,p.dateAdapter=de,p.distanceAdapter=ve,p.getOrvalConfig=dt,p.useAdapter=at,p.useAuth=rt,p.useCurrentLanguage=it,p.useInfiniteDataGrid=tt,p.useResponseError=et,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "2.5.2",
3
+ "version": "2.6.1",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",