@tracktor/shared-module 0.15.11 → 0.17.0

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
- ## v0.15.11
4
- - **[fix]** : `SentryConfig` initialization
3
+ ## v0.17.0
4
+ - **[feat]** : add `printErrorCode` to hook `useResponseError`
@@ -38,6 +38,11 @@ interface SentryConfigProps<T> {
38
38
  * List of strings/regex controlling to which outgoing requests the SDK will attach tracing headers.
39
39
  */
40
40
  tracePropagationTargets?: (string | RegExp)[];
41
+ /**
42
+ * A pattern for error messages which should not be sent to Sentry.
43
+ * By default, all errors will be sent.
44
+ */
45
+ ignoreErrors?: Array<string | RegExp>;
41
46
  }) => void;
42
47
  BrowserTracing: any;
43
48
  /**
@@ -100,6 +105,11 @@ interface SentryConfigProps<T> {
100
105
  * Enable debug mode.
101
106
  */
102
107
  debug?: boolean;
108
+ /**
109
+ * A pattern for error messages which should not be sent to Sentry.
110
+ * By default, all errors will be sent.
111
+ */
112
+ ignoreErrors?: Array<string | RegExp>;
103
113
  }
104
114
  /**
105
115
  * This component is used to initialize Sentry
@@ -111,8 +121,9 @@ interface SentryConfigProps<T> {
111
121
  * @param replaysSessionSampleRate
112
122
  * @param replaysOnErrorSampleRate
113
123
  * @param tracePropagationTargets
124
+ * @param ignoreErrors
114
125
  * @param debug
115
126
  * @constructor
116
127
  */
117
- declare const SentryConfig: <T extends unknown>({ dsn, sentry, integrations, tracesSampleRate, routingInstrumentationDependencies, replaysSessionSampleRate, replaysOnErrorSampleRate, tracePropagationTargets, debug, }: SentryConfigProps<T>) => null;
128
+ declare const SentryConfig: <T extends unknown>({ dsn, sentry, integrations, tracesSampleRate, routingInstrumentationDependencies, replaysSessionSampleRate, replaysOnErrorSampleRate, tracePropagationTargets, ignoreErrors, debug, }: SentryConfigProps<T>) => null;
118
129
  export default SentryConfig;
@@ -29,5 +29,6 @@ export interface useResponseErrorParams {
29
29
  */
30
30
  export declare const useResponseError: <T = ResponseError>(params?: useResponseErrorParams) => {
31
31
  printError: (error?: any) => string;
32
+ printErrorCode: (error?: any) => any;
32
33
  };
33
34
  export default useResponseError;
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
- import Le, { createContext as vr, useMemo as se, useContext as ue, useState as pr, useRef as gr, useLayoutEffect as mr, Suspense as hr, useEffect as Er, useCallback as X } from "react";
2
- var ie = { exports: {} }, W = {};
1
+ import Le, { createContext as vr, useMemo as se, useContext as ue, useState as pr, useRef as gr, useLayoutEffect as mr, Suspense as hr, useEffect as Er, useCallback as Y } from "react";
2
+ var ie = { exports: {} }, M = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.min.js
@@ -12,22 +12,22 @@ var ie = { exports: {} }, W = {};
12
12
  var $e;
13
13
  function yr() {
14
14
  if ($e)
15
- return W;
15
+ return M;
16
16
  $e = 1;
17
- var n = Le, o = Symbol.for("react.element"), s = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, a = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function u(g, c, b) {
17
+ var n = Le, i = Symbol.for("react.element"), s = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, l = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function m(a, c, y) {
19
19
  var h, C = {}, O = null, T = null;
20
- b !== void 0 && (O = "" + b), c.key !== void 0 && (O = "" + c.key), c.ref !== void 0 && (T = c.ref);
20
+ y !== void 0 && (O = "" + y), c.key !== void 0 && (O = "" + c.key), c.ref !== void 0 && (T = c.ref);
21
21
  for (h in c)
22
- l.call(c, h) && !v.hasOwnProperty(h) && (C[h] = c[h]);
23
- if (g && g.defaultProps)
24
- for (h in c = g.defaultProps, c)
22
+ u.call(c, h) && !v.hasOwnProperty(h) && (C[h] = c[h]);
23
+ if (a && a.defaultProps)
24
+ for (h in c = a.defaultProps, c)
25
25
  C[h] === void 0 && (C[h] = c[h]);
26
- return { $$typeof: o, type: g, key: O, ref: T, props: C, _owner: a.current };
26
+ return { $$typeof: i, type: a, key: O, ref: T, props: C, _owner: l.current };
27
27
  }
28
- return W.Fragment = s, W.jsx = u, W.jsxs = u, W;
28
+ return M.Fragment = s, M.jsx = m, M.jsxs = m, M;
29
29
  }
30
- var M = {};
30
+ var V = {};
31
31
  /**
32
32
  * @license React
33
33
  * react-jsx-runtime.development.js
@@ -40,44 +40,44 @@ var M = {};
40
40
  var Ie;
41
41
  function Rr() {
42
42
  return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
43
- var n = Le, o = Symbol.for("react.element"), s = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), g = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), A = Symbol.iterator, D = "@@iterator";
44
- function V(e) {
43
+ var n = Le, i = Symbol.for("react.element"), s = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), a = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), A = Symbol.iterator, D = "@@iterator";
44
+ function F(e) {
45
45
  if (e === null || typeof e != "object")
46
46
  return null;
47
47
  var r = A && e[A] || e[D];
48
48
  return typeof r == "function" ? r : null;
49
49
  }
50
50
  var j = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
- function R(e) {
51
+ function b(e) {
52
52
  {
53
- for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++)
54
- t[i - 1] = arguments[i];
53
+ for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++)
54
+ t[o - 1] = arguments[o];
55
55
  _("error", e, t);
56
56
  }
57
57
  }
58
58
  function _(e, r, t) {
59
59
  {
60
- var i = j.ReactDebugCurrentFrame, p = i.getStackAddendum();
60
+ var o = j.ReactDebugCurrentFrame, p = o.getStackAddendum();
61
61
  p !== "" && (r += "%s", t = t.concat([p]));
62
- var m = t.map(function(d) {
62
+ var g = t.map(function(d) {
63
63
  return String(d);
64
64
  });
65
- m.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, m);
65
+ g.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, g);
66
66
  }
67
67
  }
68
- var le = !1, ce = !1, Y = !1, Ne = !1, We = !1, fe;
68
+ var le = !1, ce = !1, q = !1, Ne = !1, We = !1, fe;
69
69
  fe = Symbol.for("react.module.reference");
70
70
  function Me(e) {
71
- return !!(typeof e == "string" || typeof e == "function" || e === l || e === v || We || e === a || e === b || e === h || Ne || e === T || le || ce || Y || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === C || e.$$typeof === u || e.$$typeof === g || e.$$typeof === c || // This needs to include all possible module reference object
71
+ return !!(typeof e == "string" || typeof e == "function" || e === u || e === v || We || e === l || e === y || e === h || Ne || e === T || le || ce || q || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === C || e.$$typeof === m || e.$$typeof === a || e.$$typeof === c || // This needs to include all possible module reference object
72
72
  // types supported by any Flight configuration anywhere since
73
73
  // we don't know which Flight build this will end up being used
74
74
  // with.
75
75
  e.$$typeof === fe || e.getModuleId !== void 0));
76
76
  }
77
77
  function Ve(e, r, t) {
78
- var i = e.displayName;
79
- if (i)
80
- return i;
78
+ var o = e.displayName;
79
+ if (o)
80
+ return o;
81
81
  var p = r.displayName || r.name || "";
82
82
  return p !== "" ? t + "(" + p + ")" : t;
83
83
  }
@@ -87,41 +87,41 @@ function Rr() {
87
87
  function P(e) {
88
88
  if (e == null)
89
89
  return null;
90
- if (typeof e.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
90
+ 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")
91
91
  return e.displayName || e.name || null;
92
92
  if (typeof e == "string")
93
93
  return e;
94
94
  switch (e) {
95
- case l:
95
+ case u:
96
96
  return "Fragment";
97
97
  case s:
98
98
  return "Portal";
99
99
  case v:
100
100
  return "Profiler";
101
- case a:
101
+ case l:
102
102
  return "StrictMode";
103
- case b:
103
+ case y:
104
104
  return "Suspense";
105
105
  case h:
106
106
  return "SuspenseList";
107
107
  }
108
108
  if (typeof e == "object")
109
109
  switch (e.$$typeof) {
110
- case g:
110
+ case a:
111
111
  var r = e;
112
112
  return de(r) + ".Consumer";
113
- case u:
113
+ case m:
114
114
  var t = e;
115
115
  return de(t._context) + ".Provider";
116
116
  case c:
117
117
  return Ve(e, e.render, "ForwardRef");
118
118
  case C:
119
- var i = e.displayName || null;
120
- return i !== null ? i : P(e.type) || "Memo";
119
+ var o = e.displayName || null;
120
+ return o !== null ? o : P(e.type) || "Memo";
121
121
  case O: {
122
- var p = e, m = p._payload, d = p._init;
122
+ var p = e, g = p._payload, d = p._init;
123
123
  try {
124
- return P(d(m));
124
+ return P(d(g));
125
125
  } catch {
126
126
  return null;
127
127
  }
@@ -129,13 +129,13 @@ function Rr() {
129
129
  }
130
130
  return null;
131
131
  }
132
- var F = Object.assign, L = 0, ve, pe, ge, me, he, Ee, ye;
132
+ var $ = Object.assign, N = 0, ve, pe, ge, me, he, Ee, ye;
133
133
  function Re() {
134
134
  }
135
135
  Re.__reactDisabledLog = !0;
136
136
  function Ye() {
137
137
  {
138
- if (L === 0) {
138
+ if (N === 0) {
139
139
  ve = console.log, pe = console.info, ge = console.warn, me = console.error, he = console.group, Ee = console.groupCollapsed, ye = console.groupEnd;
140
140
  var e = {
141
141
  configurable: !0,
@@ -153,77 +153,77 @@ function Rr() {
153
153
  groupEnd: e
154
154
  });
155
155
  }
156
- L++;
156
+ N++;
157
157
  }
158
158
  }
159
159
  function qe() {
160
160
  {
161
- if (L--, L === 0) {
161
+ if (N--, N === 0) {
162
162
  var e = {
163
163
  configurable: !0,
164
164
  enumerable: !0,
165
165
  writable: !0
166
166
  };
167
167
  Object.defineProperties(console, {
168
- log: F({}, e, {
168
+ log: $({}, e, {
169
169
  value: ve
170
170
  }),
171
- info: F({}, e, {
171
+ info: $({}, e, {
172
172
  value: pe
173
173
  }),
174
- warn: F({}, e, {
174
+ warn: $({}, e, {
175
175
  value: ge
176
176
  }),
177
- error: F({}, e, {
177
+ error: $({}, e, {
178
178
  value: me
179
179
  }),
180
- group: F({}, e, {
180
+ group: $({}, e, {
181
181
  value: he
182
182
  }),
183
- groupCollapsed: F({}, e, {
183
+ groupCollapsed: $({}, e, {
184
184
  value: Ee
185
185
  }),
186
- groupEnd: F({}, e, {
186
+ groupEnd: $({}, e, {
187
187
  value: ye
188
188
  })
189
189
  });
190
190
  }
191
- L < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
191
+ N < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
192
  }
193
193
  }
194
194
  var K = j.ReactCurrentDispatcher, Z;
195
- function q(e, r, t) {
195
+ function z(e, r, t) {
196
196
  {
197
197
  if (Z === void 0)
198
198
  try {
199
199
  throw Error();
200
200
  } catch (p) {
201
- var i = p.stack.trim().match(/\n( *(at )?)/);
202
- Z = i && i[1] || "";
201
+ var o = p.stack.trim().match(/\n( *(at )?)/);
202
+ Z = o && o[1] || "";
203
203
  }
204
204
  return `
205
205
  ` + Z + e;
206
206
  }
207
207
  }
208
- var Q = !1, z;
208
+ var Q = !1, U;
209
209
  {
210
210
  var ze = typeof WeakMap == "function" ? WeakMap : Map;
211
- z = new ze();
211
+ U = new ze();
212
212
  }
213
213
  function be(e, r) {
214
214
  if (!e || Q)
215
215
  return "";
216
216
  {
217
- var t = z.get(e);
217
+ var t = U.get(e);
218
218
  if (t !== void 0)
219
219
  return t;
220
220
  }
221
- var i;
221
+ var o;
222
222
  Q = !0;
223
223
  var p = Error.prepareStackTrace;
224
224
  Error.prepareStackTrace = void 0;
225
- var m;
226
- m = K.current, K.current = null, Ye();
225
+ var g;
226
+ g = K.current, K.current = null, Ye();
227
227
  try {
228
228
  if (r) {
229
229
  var d = function() {
@@ -237,14 +237,14 @@ function Rr() {
237
237
  try {
238
238
  Reflect.construct(d, []);
239
239
  } catch (x) {
240
- i = x;
240
+ o = x;
241
241
  }
242
242
  Reflect.construct(e, [], d);
243
243
  } else {
244
244
  try {
245
245
  d.call();
246
246
  } catch (x) {
247
- i = x;
247
+ o = x;
248
248
  }
249
249
  e.call(d.prototype);
250
250
  }
@@ -252,34 +252,34 @@ function Rr() {
252
252
  try {
253
253
  throw Error();
254
254
  } catch (x) {
255
- i = x;
255
+ o = x;
256
256
  }
257
257
  e();
258
258
  }
259
259
  } catch (x) {
260
- if (x && i && typeof x.stack == "string") {
260
+ if (x && o && typeof x.stack == "string") {
261
261
  for (var f = x.stack.split(`
262
- `), w = i.stack.split(`
263
- `), E = f.length - 1, y = w.length - 1; E >= 1 && y >= 0 && f[E] !== w[y]; )
264
- y--;
265
- for (; E >= 1 && y >= 0; E--, y--)
266
- if (f[E] !== w[y]) {
267
- if (E !== 1 || y !== 1)
262
+ `), w = o.stack.split(`
263
+ `), E = f.length - 1, R = w.length - 1; E >= 1 && R >= 0 && f[E] !== w[R]; )
264
+ R--;
265
+ for (; E >= 1 && R >= 0; E--, R--)
266
+ if (f[E] !== w[R]) {
267
+ if (E !== 1 || R !== 1)
268
268
  do
269
- if (E--, y--, y < 0 || f[E] !== w[y]) {
269
+ if (E--, R--, R < 0 || f[E] !== w[R]) {
270
270
  var S = `
271
271
  ` + f[E].replace(" at new ", " at ");
272
- return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && z.set(e, S), S;
272
+ return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, S), S;
273
273
  }
274
- while (E >= 1 && y >= 0);
274
+ while (E >= 1 && R >= 0);
275
275
  break;
276
276
  }
277
277
  }
278
278
  } finally {
279
- Q = !1, K.current = m, qe(), Error.prepareStackTrace = p;
279
+ Q = !1, K.current = g, qe(), Error.prepareStackTrace = p;
280
280
  }
281
- var I = e ? e.displayName || e.name : "", Fe = I ? q(I) : "";
282
- return typeof e == "function" && z.set(e, Fe), Fe;
281
+ var L = e ? e.displayName || e.name : "", Fe = L ? z(L) : "";
282
+ return typeof e == "function" && U.set(e, Fe), Fe;
283
283
  }
284
284
  function Ue(e, r, t) {
285
285
  return be(e, !1);
@@ -288,59 +288,59 @@ function Rr() {
288
288
  var r = e.prototype;
289
289
  return !!(r && r.isReactComponent);
290
290
  }
291
- function U(e, r, t) {
291
+ function B(e, r, t) {
292
292
  if (e == null)
293
293
  return "";
294
294
  if (typeof e == "function")
295
295
  return be(e, Be(e));
296
296
  if (typeof e == "string")
297
- return q(e);
297
+ return z(e);
298
298
  switch (e) {
299
- case b:
300
- return q("Suspense");
299
+ case y:
300
+ return z("Suspense");
301
301
  case h:
302
- return q("SuspenseList");
302
+ return z("SuspenseList");
303
303
  }
304
304
  if (typeof e == "object")
305
305
  switch (e.$$typeof) {
306
306
  case c:
307
307
  return Ue(e.render);
308
308
  case C:
309
- return U(e.type, r, t);
309
+ return B(e.type, r, t);
310
310
  case O: {
311
- var i = e, p = i._payload, m = i._init;
311
+ var o = e, p = o._payload, g = o._init;
312
312
  try {
313
- return U(m(p), r, t);
313
+ return B(g(p), r, t);
314
314
  } catch {
315
315
  }
316
316
  }
317
317
  }
318
318
  return "";
319
319
  }
320
- var B = Object.prototype.hasOwnProperty, _e = {}, we = j.ReactDebugCurrentFrame;
321
- function G(e) {
320
+ var G = Object.prototype.hasOwnProperty, _e = {}, we = j.ReactDebugCurrentFrame;
321
+ function J(e) {
322
322
  if (e) {
323
- var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
323
+ var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
324
324
  we.setExtraStackFrame(t);
325
325
  } else
326
326
  we.setExtraStackFrame(null);
327
327
  }
328
- function Ge(e, r, t, i, p) {
328
+ function Ge(e, r, t, o, p) {
329
329
  {
330
- var m = Function.call.bind(B);
330
+ var g = Function.call.bind(G);
331
331
  for (var d in e)
332
- if (m(e, d)) {
332
+ if (g(e, d)) {
333
333
  var f = void 0;
334
334
  try {
335
335
  if (typeof e[d] != "function") {
336
- var w = Error((i || "React class") + ": " + t + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
336
+ var w = Error((o || "React class") + ": " + t + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
337
  throw w.name = "Invariant Violation", w;
338
338
  }
339
- f = e[d](r, d, i, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
339
+ f = e[d](r, d, o, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
340
  } catch (E) {
341
341
  f = E;
342
342
  }
343
- f && !(f instanceof Error) && (G(p), R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", i || "React class", t, d, typeof f), G(null)), f instanceof Error && !(f.message in _e) && (_e[f.message] = !0, G(p), R("Failed %s type: %s", t, f.message), G(null));
343
+ f && !(f instanceof Error) && (J(p), 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).", o || "React class", t, d, typeof f), J(null)), f instanceof Error && !(f.message in _e) && (_e[f.message] = !0, J(p), b("Failed %s type: %s", t, f.message), J(null));
344
344
  }
345
345
  }
346
346
  }
@@ -366,9 +366,9 @@ function Rr() {
366
366
  }
367
367
  function Te(e) {
368
368
  if (He(e))
369
- return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Xe(e)), Ce(e);
369
+ return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Xe(e)), Ce(e);
370
370
  }
371
- var N = j.ReactCurrentOwner, Ke = {
371
+ var W = j.ReactCurrentOwner, Ke = {
372
372
  key: !0,
373
373
  ref: !0,
374
374
  __self: !0,
@@ -376,7 +376,7 @@ function Rr() {
376
376
  }, Oe, Se, re;
377
377
  re = {};
378
378
  function Ze(e) {
379
- if (B.call(e, "ref")) {
379
+ if (G.call(e, "ref")) {
380
380
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
381
381
  if (r && r.isReactWarning)
382
382
  return !1;
@@ -384,7 +384,7 @@ function Rr() {
384
384
  return e.ref !== void 0;
385
385
  }
386
386
  function Qe(e) {
387
- if (B.call(e, "key")) {
387
+ if (G.call(e, "key")) {
388
388
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
389
389
  if (r && r.isReactWarning)
390
390
  return !1;
@@ -392,15 +392,15 @@ function Rr() {
392
392
  return e.key !== void 0;
393
393
  }
394
394
  function er(e, r) {
395
- if (typeof e.ref == "string" && N.current && r && N.current.stateNode !== r) {
396
- var t = P(N.current.type);
397
- re[t] || (R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', P(N.current.type), e.ref), re[t] = !0);
395
+ if (typeof e.ref == "string" && W.current && r && W.current.stateNode !== r) {
396
+ var t = P(W.current.type);
397
+ re[t] || (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', P(W.current.type), e.ref), re[t] = !0);
398
398
  }
399
399
  }
400
400
  function rr(e, r) {
401
401
  {
402
402
  var t = function() {
403
- Oe || (Oe = !0, R("%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));
403
+ 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));
404
404
  };
405
405
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
406
406
  get: t,
@@ -411,7 +411,7 @@ function Rr() {
411
411
  function tr(e, r) {
412
412
  {
413
413
  var t = function() {
414
- Se || (Se = !0, R("%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));
414
+ Se || (Se = !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));
415
415
  };
416
416
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
417
417
  get: t,
@@ -419,17 +419,17 @@ function Rr() {
419
419
  });
420
420
  }
421
421
  }
422
- var nr = function(e, r, t, i, p, m, d) {
422
+ var nr = function(e, r, t, o, p, g, d) {
423
423
  var f = {
424
424
  // This tag allows us to uniquely identify this as a React Element
425
- $$typeof: o,
425
+ $$typeof: i,
426
426
  // Built-in properties that belong on the element
427
427
  type: e,
428
428
  key: r,
429
429
  ref: t,
430
430
  props: d,
431
431
  // Record the component responsible for creating this element.
432
- _owner: m
432
+ _owner: g
433
433
  };
434
434
  return f._store = {}, Object.defineProperty(f._store, "validated", {
435
435
  configurable: !1,
@@ -440,7 +440,7 @@ function Rr() {
440
440
  configurable: !1,
441
441
  enumerable: !1,
442
442
  writable: !1,
443
- value: i
443
+ value: o
444
444
  }), Object.defineProperty(f, "_source", {
445
445
  configurable: !1,
446
446
  enumerable: !1,
@@ -448,28 +448,28 @@ function Rr() {
448
448
  value: p
449
449
  }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
450
450
  };
451
- function ar(e, r, t, i, p) {
451
+ function ar(e, r, t, o, p) {
452
452
  {
453
- var m, d = {}, f = null, w = null;
453
+ var g, d = {}, f = null, w = null;
454
454
  t !== void 0 && (Te(t), f = "" + t), Qe(r) && (Te(r.key), f = "" + r.key), Ze(r) && (w = r.ref, er(r, p));
455
- for (m in r)
456
- B.call(r, m) && !Ke.hasOwnProperty(m) && (d[m] = r[m]);
455
+ for (g in r)
456
+ G.call(r, g) && !Ke.hasOwnProperty(g) && (d[g] = r[g]);
457
457
  if (e && e.defaultProps) {
458
458
  var E = e.defaultProps;
459
- for (m in E)
460
- d[m] === void 0 && (d[m] = E[m]);
459
+ for (g in E)
460
+ d[g] === void 0 && (d[g] = E[g]);
461
461
  }
462
462
  if (f || w) {
463
- var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
- f && rr(d, y), w && tr(d, y);
463
+ var R = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
+ f && rr(d, R), w && tr(d, R);
465
465
  }
466
- return nr(e, f, w, p, i, N.current, d);
466
+ return nr(e, f, w, p, o, W.current, d);
467
467
  }
468
468
  }
469
469
  var te = j.ReactCurrentOwner, je = j.ReactDebugCurrentFrame;
470
- function $(e) {
470
+ function I(e) {
471
471
  if (e) {
472
- var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
472
+ var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
473
473
  je.setExtraStackFrame(t);
474
474
  } else
475
475
  je.setExtraStackFrame(null);
@@ -477,7 +477,7 @@ function Rr() {
477
477
  var ne;
478
478
  ne = !1;
479
479
  function ae(e) {
480
- return typeof e == "object" && e !== null && e.$$typeof === o;
480
+ return typeof e == "object" && e !== null && e.$$typeof === i;
481
481
  }
482
482
  function Pe() {
483
483
  {
@@ -524,8 +524,8 @@ Check the top-level render call using <` + t + ">.");
524
524
  if (xe[t])
525
525
  return;
526
526
  xe[t] = !0;
527
- var i = "";
528
- e && e._owner && e._owner !== te.current && (i = " It was passed a child from " + P(e._owner.type) + "."), $(e), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, i), $(null);
527
+ var o = "";
528
+ e && e._owner && e._owner !== te.current && (o = " It was passed a child from " + P(e._owner.type) + "."), I(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.', t, o), I(null);
529
529
  }
530
530
  }
531
531
  function Ae(e, r) {
@@ -534,15 +534,15 @@ Check the top-level render call using <` + t + ">.");
534
534
  return;
535
535
  if (ee(e))
536
536
  for (var t = 0; t < e.length; t++) {
537
- var i = e[t];
538
- ae(i) && ke(i, r);
537
+ var o = e[t];
538
+ ae(o) && ke(o, r);
539
539
  }
540
540
  else if (ae(e))
541
541
  e._store && (e._store.validated = !0);
542
542
  else if (e) {
543
- var p = V(e);
543
+ var p = F(e);
544
544
  if (typeof p == "function" && p !== e.entries)
545
- for (var m = p.call(e), d; !(d = m.next()).done; )
545
+ for (var g = p.call(e), d; !(d = g.next()).done; )
546
546
  ae(d.value) && ke(d.value, r);
547
547
  }
548
548
  }
@@ -562,29 +562,29 @@ Check the top-level render call using <` + t + ">.");
562
562
  else
563
563
  return;
564
564
  if (t) {
565
- var i = P(r);
566
- Ge(t, e.props, "prop", i, e);
565
+ var o = P(r);
566
+ Ge(t, e.props, "prop", o, e);
567
567
  } else if (r.PropTypes !== void 0 && !ne) {
568
568
  ne = !0;
569
569
  var p = P(r);
570
- R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
570
+ b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
571
571
  }
572
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
572
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
573
573
  }
574
574
  }
575
575
  function ur(e) {
576
576
  {
577
577
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
578
- var i = r[t];
579
- if (i !== "children" && i !== "key") {
580
- $(e), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", i), $(null);
578
+ var o = r[t];
579
+ if (o !== "children" && o !== "key") {
580
+ I(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), I(null);
581
581
  break;
582
582
  }
583
583
  }
584
- e.ref !== null && ($(e), R("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
584
+ e.ref !== null && (I(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), I(null));
585
585
  }
586
586
  }
587
- function De(e, r, t, i, p, m) {
587
+ function De(e, r, t, o, p, g) {
588
588
  {
589
589
  var d = Me(e);
590
590
  if (!d) {
@@ -593,25 +593,25 @@ Check the top-level render call using <` + t + ">.");
593
593
  var w = or(p);
594
594
  w ? f += w : f += Pe();
595
595
  var E;
596
- e === null ? E = "null" : ee(e) ? E = "array" : e !== void 0 && e.$$typeof === o ? (E = "<" + (P(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : E = typeof e, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", E, f);
596
+ e === null ? E = "null" : ee(e) ? E = "array" : e !== void 0 && e.$$typeof === i ? (E = "<" + (P(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : E = 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", E, f);
597
597
  }
598
- var y = ar(e, r, t, p, m);
599
- if (y == null)
600
- return y;
598
+ var R = ar(e, r, t, p, g);
599
+ if (R == null)
600
+ return R;
601
601
  if (d) {
602
602
  var S = r.children;
603
603
  if (S !== void 0)
604
- if (i)
604
+ if (o)
605
605
  if (ee(S)) {
606
- for (var I = 0; I < S.length; I++)
607
- Ae(S[I], e);
606
+ for (var L = 0; L < S.length; L++)
607
+ Ae(S[L], e);
608
608
  Object.freeze && Object.freeze(S);
609
609
  } else
610
- R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
610
+ 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.");
611
611
  else
612
612
  Ae(S, e);
613
613
  }
614
- return e === l ? ur(y) : sr(y), y;
614
+ return e === u ? ur(R) : sr(R), R;
615
615
  }
616
616
  }
617
617
  function lr(e, r, t) {
@@ -621,8 +621,8 @@ Check the top-level render call using <` + t + ">.");
621
621
  return De(e, r, t, !1);
622
622
  }
623
623
  var fr = cr, dr = lr;
624
- M.Fragment = l, M.jsx = fr, M.jsxs = dr;
625
- }()), M;
624
+ V.Fragment = u, V.jsx = fr, V.jsxs = dr;
625
+ }()), V;
626
626
  }
627
627
  process.env.NODE_ENV === "production" ? ie.exports = yr() : ie.exports = Rr();
628
628
  var k = ie.exports;
@@ -636,96 +636,96 @@ const H = vr({
636
636
  useLocation: void 0
637
637
  }), Or = ({
638
638
  axios: n,
639
- children: o,
639
+ children: i,
640
640
  translate: s,
641
- useAuth: l,
642
- Outlet: a,
641
+ useAuth: u,
642
+ Outlet: l,
643
643
  Navigate: v,
644
- useLocation: u,
645
- useGoogleTagManager: g
644
+ useLocation: m,
645
+ useGoogleTagManager: a
646
646
  }) => {
647
647
  const c = se(
648
648
  () => ({
649
649
  axios: n,
650
650
  Navigate: v,
651
- Outlet: a,
651
+ Outlet: l,
652
652
  translate: s,
653
- useAuth: l,
654
- useGoogleTagManager: g,
655
- useLocation: u
653
+ useAuth: u,
654
+ useGoogleTagManager: a,
655
+ useLocation: m
656
656
  }),
657
- [v, a, n, s, l, g, u]
657
+ [v, l, n, s, u, a, m]
658
658
  );
659
- return /* @__PURE__ */ k.jsx(H.Provider, { value: c, children: o });
660
- }, J = (n) => `RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Sr = ({
659
+ return /* @__PURE__ */ k.jsx(H.Provider, { value: c, children: i });
660
+ }, X = (n) => `RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Sr = ({
661
661
  Fallback: n,
662
- loginPath: o = "/login",
662
+ loginPath: i = "/login",
663
663
  localStorageKey: s = "user",
664
- redirect401Path: l = "/login",
665
- ...a
664
+ redirect401Path: u = "/login",
665
+ ...l
666
666
  }) => {
667
- var D, V, j, R;
667
+ var D, F, j, b;
668
668
  const {
669
- axios: v = a.axios,
670
- useLocation: u = a.useLocation,
671
- useAuth: g = a.useAuth,
672
- Outlet: c = a.Outlet,
673
- Navigate: b = a.Navigate
669
+ axios: v = l.axios,
670
+ useLocation: m = l.useLocation,
671
+ useAuth: a = l.useAuth,
672
+ Outlet: c = l.Outlet,
673
+ Navigate: y = l.Navigate
674
674
  } = ue(H);
675
- if (g === void 0)
676
- throw new Error(J("useAuth"));
677
- if (u === void 0)
678
- throw new Error(J("useLocation"));
675
+ if (a === void 0)
676
+ throw new Error(X("useAuth"));
677
+ if (m === void 0)
678
+ throw new Error(X("useLocation"));
679
679
  if (c === void 0)
680
- throw new Error(J("Outlet"));
681
- if (b === void 0)
682
- throw new Error(J("Navigate"));
683
- const [h, C] = pr(null), { isLogged: O } = g(), T = u(), A = gr(!1);
680
+ throw new Error(X("Outlet"));
681
+ if (y === void 0)
682
+ throw new Error(X("Navigate"));
683
+ const [h, C] = pr(null), { isLogged: O } = a(), T = m(), A = gr(!1);
684
684
  return mr(() => {
685
685
  A.current || (A.current = !0, v == null || v.interceptors.response.use(
686
686
  (_) => _,
687
687
  async (_) => {
688
- var Y;
689
- return typeof _ == "object" && _ && "response" in _ && _.response && typeof _.response == "object" && "status" in _.response && _.response && typeof _.response == "object" && "status" in _.response && ((Y = _ == null ? void 0 : _.response) == null ? void 0 : Y.status) === 401 && (v.defaults.headers.common.Authorization = null, localStorage.removeItem(s), C(l)), Promise.reject(_);
688
+ var q;
689
+ return typeof _ == "object" && _ && "response" in _ && _.response && typeof _.response == "object" && "status" in _.response && _.response && typeof _.response == "object" && "status" in _.response && ((q = _ == null ? void 0 : _.response) == null ? void 0 : q.status) === 401 && (v.defaults.headers.common.Authorization = null, localStorage.removeItem(s), C(u)), Promise.reject(_);
690
690
  }
691
691
  ));
692
- }, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response, s, l]), O && !h ? /* @__PURE__ */ k.jsx(hr, { fallback: n, children: (V = (D = T.state) == null ? void 0 : D.from) != null && V.state && ((R = (j = T.state) == null ? void 0 : j.from) == null ? void 0 : R.pathname) === o ? /* @__PURE__ */ k.jsx(b, { to: T.state.from.state.from.pathname + T.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ k.jsx(c, {}) }) : /* @__PURE__ */ k.jsx(b, { to: o, state: { from: T }, replace: !0 });
692
+ }, [v == null ? void 0 : v.defaults.headers.common, v == null ? void 0 : v.interceptors.response, s, u]), O && !h ? /* @__PURE__ */ k.jsx(hr, { fallback: n, children: (F = (D = T.state) == null ? void 0 : D.from) != null && F.state && ((b = (j = T.state) == null ? void 0 : j.from) == null ? void 0 : b.pathname) === i ? /* @__PURE__ */ k.jsx(y, { to: T.state.from.state.from.pathname + T.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ k.jsx(c, {}) }) : /* @__PURE__ */ k.jsx(y, { to: i, state: { from: T }, replace: !0 });
693
693
  }, oe = (n) => `GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, jr = ({ ...n }) => {
694
694
  const {
695
- useLocation: o = n.useLocation,
695
+ useLocation: i = n.useLocation,
696
696
  Outlet: s = n.Outlet,
697
- useGoogleTagManager: l = n.useGoogleTagManager
697
+ useGoogleTagManager: u = n.useGoogleTagManager
698
698
  } = ue(H);
699
- if (o === void 0)
699
+ if (i === void 0)
700
700
  throw new Error(oe("useLocation"));
701
701
  if (s === void 0)
702
702
  throw new Error(oe("Outlet"));
703
- if (l === void 0)
703
+ if (u === void 0)
704
704
  throw new Error(oe("useGoogleTagManager"));
705
- const { pathname: a } = o(), { sendEvent: v } = l();
705
+ const { pathname: l } = i(), { sendEvent: v } = u();
706
706
  return Er(() => {
707
- v({ event: "pageView", pathname: a });
708
- }, [a, v]), /* @__PURE__ */ k.jsx(s, {});
707
+ v({ event: "pageView", pathname: l });
708
+ }, [l, v]), /* @__PURE__ */ k.jsx(s, {});
709
709
  }, Pr = ({
710
710
  axios: n,
711
- baseURL: o,
711
+ baseURL: i,
712
712
  tokenTypeKey: s = "tokenType",
713
- userLocalStorageKey: l = "user",
714
- tokenKey: a = "accessToken",
713
+ userLocalStorageKey: u = "user",
714
+ tokenKey: l = "accessToken",
715
715
  postContentType: v = "application/json"
716
716
  }) => {
717
717
  if (!n.defaults)
718
718
  return null;
719
- const u = localStorage.getItem(l), g = u ? JSON.parse(u) : null, c = g != null && g[s] ? g[s] : null, b = g != null && g[a] ? g[a] : null, h = u ? `${c} ${b}` : null;
720
- return n.defaults.baseURL = o, n.defaults.headers.post["Content-Type"] = v, h && (n.defaults.headers.common.Authorization = h), null;
719
+ const m = localStorage.getItem(u), a = m ? JSON.parse(m) : null, c = a != null && a[s] ? a[s] : null, y = a != null && a[l] ? a[l] : null, h = m ? `${c} ${y}` : null;
720
+ return n.defaults.baseURL = i, n.defaults.headers.post["Content-Type"] = v, h && (n.defaults.headers.common.Authorization = h), null;
721
721
  }, xr = ({
722
722
  i18n: n,
723
- debug: o,
723
+ debug: i,
724
724
  initReactI18next: s,
725
- resources: l,
726
- LanguageDetector: a
727
- }) => (n != null && n.isInitialized || (n.use(a).use(s).init({
728
- debug: o,
725
+ resources: u,
726
+ LanguageDetector: l
727
+ }) => (n != null && n.isInitialized || (n.use(l).use(s).init({
728
+ debug: i,
729
729
  fallbackLng: "en",
730
730
  interpolation: {
731
731
  escapeValue: !1
@@ -735,7 +735,7 @@ const H = vr({
735
735
  bindI18n: !1,
736
736
  useSuspense: !0
737
737
  },
738
- resources: l,
738
+ resources: u,
739
739
  returnNull: !1
740
740
  }).then(() => {
741
741
  document.documentElement.lang !== n.resolvedLanguage && n.resolvedLanguage && document.documentElement.setAttribute("lang", n.resolvedLanguage);
@@ -743,133 +743,141 @@ const H = vr({
743
743
  document.documentElement.setAttribute("lang", v);
744
744
  })), null), kr = ({
745
745
  dsn: n,
746
- sentry: o,
746
+ sentry: i,
747
747
  integrations: s,
748
- tracesSampleRate: l,
749
- routingInstrumentationDependencies: a,
748
+ tracesSampleRate: u,
749
+ routingInstrumentationDependencies: l,
750
750
  replaysSessionSampleRate: v,
751
- replaysOnErrorSampleRate: u,
752
- tracePropagationTargets: g,
753
- debug: c
754
- }) => (o.isInitialized() || (c || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && o.init({
755
- debug: c,
751
+ replaysOnErrorSampleRate: m,
752
+ tracePropagationTargets: a,
753
+ ignoreErrors: c,
754
+ debug: y
755
+ }) => (i.isInitialized() || (y || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && i.init({
756
+ debug: y,
756
757
  dsn: n,
758
+ ignoreErrors: c || [/Failed to fetch dynamically imported module/],
757
759
  integrations: [
758
- new o.BrowserTracing({
759
- routingInstrumentation: o.reactRouterV6Instrumentation(
760
- a.useEffect,
761
- a.useLocation,
762
- a.useNavigationType,
763
- a.createRoutesFromChildren,
764
- a.matchRoutes
760
+ new i.BrowserTracing({
761
+ routingInstrumentation: i.reactRouterV6Instrumentation(
762
+ l.useEffect,
763
+ l.useLocation,
764
+ l.useNavigationType,
765
+ l.createRoutesFromChildren,
766
+ l.matchRoutes
765
767
  )
766
768
  }),
767
- o.replayIntegration(),
769
+ i.replayIntegration(),
768
770
  ...s || []
769
771
  ],
770
- replaysOnErrorSampleRate: u || 1,
772
+ replaysOnErrorSampleRate: m || 1,
771
773
  replaysSessionSampleRate: v || 0.1,
772
- tracePropagationTargets: g,
773
- tracesSampleRate: l || 1
774
- }), null), Ar = ({ IMaskMixin: n, ...o }) => {
774
+ tracePropagationTargets: a,
775
+ tracesSampleRate: u || 1
776
+ }), null), Ar = ({ IMaskMixin: n, ...i }) => {
775
777
  const s = se(
776
778
  // eslint-disable-next-line react/jsx-props-no-spreading
777
- () => n(({ TextField: l, ...a }) => /* @__PURE__ */ k.jsx(l, { ...a })),
779
+ () => n(({ TextField: u, ...l }) => /* @__PURE__ */ k.jsx(u, { ...l })),
778
780
  [n]
779
781
  );
780
- return /* @__PURE__ */ k.jsx(s, { ...o });
781
- }, Dr = ({ mapbox: n, accessToken: o }) => (n && o && (n.accessToken = o), null), Fr = ({
782
+ return /* @__PURE__ */ k.jsx(s, { ...i });
783
+ }, Dr = ({ mapbox: n, accessToken: i }) => (n && i && (n.accessToken = i), null), Fr = ({
782
784
  children: n,
783
- defaultOptions: o,
785
+ defaultOptions: i,
784
786
  QueryClient: s,
785
- QueryClientProvider: l
787
+ QueryClientProvider: u
786
788
  }) => {
787
- const a = new s({
789
+ const l = new s({
788
790
  defaultOptions: {
789
791
  queries: {
790
792
  refetchOnWindowFocus: !1,
791
793
  retry: 3,
792
- ...o
794
+ ...i
793
795
  }
794
796
  }
795
797
  });
796
- return /* @__PURE__ */ k.jsx(l, { client: a, children: n });
798
+ return /* @__PURE__ */ k.jsx(u, { client: l, children: n });
797
799
  }, $r = (n) => {
798
- const { unknownErrorTranslationKey: o = "error.unknownError" } = n || {}, { translate: s = n == null ? void 0 : n.translate } = ue(H);
799
- return { printError: X(
800
- (a) => {
801
- var g, c, b, h, C, O, T, A, D;
802
- const v = s ? s(o) : "Unknown error", { response: u } = a || {};
803
- return a != null && a.reason ? String(a.reason) : (g = u == null ? void 0 : u.data) != null && g.reason ? String(u.data.reason) : (c = u == null ? void 0 : u.data) != null && c.message ? String(u.data.message) : (h = (b = u == null ? void 0 : u.data) == null ? void 0 : b.detail) != null && h.length && Array.isArray((C = u == null ? void 0 : u.data) == null ? void 0 : C.detail) && ((T = (O = u == null ? void 0 : u.data) == null ? void 0 : O.detail[0]) != null && T.msg) && typeof ((D = (A = u == null ? void 0 : u.data) == null ? void 0 : A.detail[0]) == null ? void 0 : D.msg) == "string" ? String(u.data.detail[0].msg) : v;
800
+ const { unknownErrorTranslationKey: i = "error.unknownError" } = n || {}, { translate: s = n == null ? void 0 : n.translate } = ue(H), u = s ? s(i) : "Unknown error", l = Y(
801
+ (m) => {
802
+ var c, y, h, C, O, T, A, D, F;
803
+ const { response: a } = m || {};
804
+ return a != null && a.reason ? String(m.reason) : (c = a == null ? void 0 : a.data) != null && c.reason ? String(a.data.reason) : (y = a == null ? void 0 : a.data) != null && y.message ? String(a.data.message) : (C = (h = a == null ? void 0 : a.data) == null ? void 0 : h.detail) != null && C.length && Array.isArray((O = a == null ? void 0 : a.data) == null ? void 0 : O.detail) && ((A = (T = a == null ? void 0 : a.data) == null ? void 0 : T.detail[0]) != null && A.msg) && typeof ((F = (D = a == null ? void 0 : a.data) == null ? void 0 : D.detail[0]) == null ? void 0 : F.msg) == "string" ? String(a.data.detail[0].msg) : u;
805
+ },
806
+ [u]
807
+ ), v = Y(
808
+ (m) => {
809
+ const { response: a } = m || {}, { error_code: c } = a || {};
810
+ return c && s ? s(c) : c || u;
804
811
  },
805
- [s, o]
806
- ) };
812
+ [u, s]
813
+ );
814
+ return { printError: l, printErrorCode: v };
807
815
  }, Ir = ({
808
816
  data: n,
809
- fetchNextPage: o,
817
+ fetchNextPage: i,
810
818
  isFetchingNextPage: s,
811
- isInitialLoading: l,
812
- isLoading: a,
819
+ isInitialLoading: u,
820
+ isLoading: l,
813
821
  enabled: v = !0
814
822
  }) => {
815
- const u = X(
823
+ const m = Y(
816
824
  async (c) => {
817
- s || !v || await o({ pageParam: (c == null ? void 0 : c.pageParam) || c.visibleRowsCount });
825
+ s || !v || await i({ pageParam: (c == null ? void 0 : c.pageParam) || c.visibleRowsCount });
818
826
  },
819
- [v, o, s]
820
- ), g = se(() => {
827
+ [v, i, s]
828
+ ), a = se(() => {
821
829
  if (n)
822
- return n.pages.reduce((c, b) => [...c, ...b], []);
830
+ return n.pages.reduce((c, y) => [...c, ...y], []);
823
831
  }, [n]);
824
832
  return {
825
- fetchNextPageOnRowsScrollEnd: u,
826
- isLoading: s || a,
827
- loadingVariant: l ? "skeleton" : "linear",
828
- rows: g
833
+ fetchNextPageOnRowsScrollEnd: m,
834
+ isLoading: s || l,
835
+ loadingVariant: u ? "skeleton" : "linear",
836
+ rows: a
829
837
  };
830
838
  }, Lr = (n) => {
831
- const o = X(
832
- ({ tokenType: l, accessToken: a }) => {
833
- n.defaults.headers.common.Authorization = `${l} ${a}`;
839
+ const i = Y(
840
+ ({ tokenType: u, accessToken: l }) => {
841
+ n.defaults.headers.common.Authorization = `${u} ${l}`;
834
842
  },
835
843
  [n.defaults.headers.common]
836
844
  );
837
845
  return {
838
- clearAuthenticationToken: X(() => {
846
+ clearAuthenticationToken: Y(() => {
839
847
  n.defaults.headers.common.Authorization = null;
840
848
  }, [n.defaults.headers.common]),
841
- setAuthenticationToken: o
849
+ setAuthenticationToken: i
842
850
  };
843
851
  }, br = (n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase(), _r = (n) => {
844
- const l = n.split("/").filter((a) => a.length > 0).map((a) => a.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((c) => c.charAt(0).toUpperCase() + c.slice(1)).join("")).join("");
845
- return l.charAt(0).toLowerCase() + l.slice(1);
846
- }, wr = (n, o, s) => {
847
- const l = _r(o), a = br(s);
848
- return `${l}${a}`;
852
+ const u = n.split("/").filter((l) => l.length > 0).map((l) => l.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((c) => c.charAt(0).toUpperCase() + c.slice(1)).join("")).join("");
853
+ return u.charAt(0).toLowerCase() + u.slice(1);
854
+ }, wr = (n, i, s) => {
855
+ const u = _r(i), l = br(s);
856
+ return `${u}${l}`;
849
857
  }, Cr = (n) => {
850
858
  if (n)
851
- return (n == null ? void 0 : n.reduce((o, s) => (o[s] = {
859
+ return (n == null ? void 0 : n.reduce((i, s) => (i[s] = {
852
860
  query: {
853
861
  useInfinite: !0,
854
862
  useInfiniteQueryParam: "offset"
855
863
  }
856
- }, o), {})) || {};
864
+ }, i), {})) || {};
857
865
  }, Nr = (n) => {
858
- const { input: o = "./openapi.json", operationsToGenerateInfiniteQueryHook: s = void 0 } = n || {};
866
+ const { input: i = "./openapi.json", operationsToGenerateInfiniteQueryHook: s = void 0 } = n || {};
859
867
  return {
860
868
  api: {
861
869
  hooks: {
862
870
  afterAllFilesWrite: "prettier src/api/ --write"
863
871
  },
864
- input: o,
872
+ input: i,
865
873
  output: {
866
874
  client: "react-query",
867
875
  mode: "tags-split",
868
876
  override: {
869
- header: (l) => [
877
+ header: (u) => [
870
878
  "Generated by orval 🍺",
871
- ...l.title ? [l.title] : [],
872
- ...l.description ? [l.description] : []
879
+ ...u.title ? [u.title] : [],
880
+ ...u.description ? [u.description] : []
873
881
  ],
874
882
  mutator: {
875
883
  name: "axiosCustomInstance",
package/dist/main.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(R,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],m):(R=typeof globalThis<"u"?globalThis:R||self,m(R["@tracktor/shared-module"]={},R.React))})(this,function(R,m){"use strict";var $={exports:{}},W={};/**
1
+ (function(R,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(R=typeof globalThis<"u"?globalThis:R||self,h(R["@tracktor/shared-module"]={},R.React))})(this,function(R,h){"use strict";var $={exports:{}},V={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var ue;function Le(){if(ue)return W;ue=1;var n=m,o=Symbol.for("react.element"),s=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function u(g,c,C){var E,O={},j=null,S=null;C!==void 0&&(j=""+C),c.key!==void 0&&(j=""+c.key),c.ref!==void 0&&(S=c.ref);for(E in c)l.call(c,E)&&!v.hasOwnProperty(E)&&(O[E]=c[E]);if(g&&g.defaultProps)for(E in c=g.defaultProps,c)O[E]===void 0&&(O[E]=c[E]);return{$$typeof:o,type:g,key:j,ref:S,props:O,_owner:a.current}}return W.Fragment=s,W.jsx=u,W.jsxs=u,W}var V={};/**
9
+ */var ue;function Le(){if(ue)return V;ue=1;var n=h,i=Symbol.for("react.element"),s=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function m(a,c,b){var E,O={},j=null,S=null;b!==void 0&&(j=""+b),c.key!==void 0&&(j=""+c.key),c.ref!==void 0&&(S=c.ref);for(E in c)u.call(c,E)&&!v.hasOwnProperty(E)&&(O[E]=c[E]);if(a&&a.defaultProps)for(E in c=a.defaultProps,c)O[E]===void 0&&(O[E]=c[E]);return{$$typeof:i,type:a,key:j,ref:S,props:O,_owner:l.current}}return V.Fragment=s,V.jsx=m,V.jsxs=m,V}var Y={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,14 +14,14 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var le;function Me(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var n=m,o=Symbol.for("react.element"),s=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),g=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),F=Symbol.iterator,I="@@iterator";function G(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[I];return typeof r=="function"?r:null}var A=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),i=1;i<r;i++)t[i-1]=arguments[i];w("error",e,t)}}function w(e,r,t){{var i=A.ReactDebugCurrentFrame,p=i.getStackAddendum();p!==""&&(r+="%s",t=t.concat([p]));var h=t.map(function(d){return String(d)});h.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,h)}}var ce=!1,fe=!1,J=!1,rr=!1,tr=!1,de;de=Symbol.for("react.module.reference");function nr(e){return!!(typeof e=="string"||typeof e=="function"||e===l||e===v||tr||e===a||e===C||e===E||rr||e===S||ce||fe||J||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===O||e.$$typeof===u||e.$$typeof===g||e.$$typeof===c||e.$$typeof===de||e.getModuleId!==void 0))}function ar(e,r,t){var i=e.displayName;if(i)return i;var p=r.displayName||r.name||"";return p!==""?t+"("+p+")":t}function ve(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case l:return"Fragment";case s:return"Portal";case v:return"Profiler";case a:return"StrictMode";case C:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case g:var r=e;return ve(r)+".Consumer";case u:var t=e;return ve(t._context)+".Provider";case c:return ar(e,e.render,"ForwardRef");case O:var i=e.displayName||null;return i!==null?i:x(e.type)||"Memo";case j:{var p=e,h=p._payload,d=p._init;try{return x(d(h))}catch{return null}}}return null}var L=Object.assign,z=0,pe,ge,he,me,Ee,ye,Re;function be(){}be.__reactDisabledLog=!0;function or(){{if(z===0){pe=console.log,ge=console.info,he=console.warn,me=console.error,Ee=console.group,ye=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}}function ir(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:L({},e,{value:pe}),info:L({},e,{value:ge}),warn:L({},e,{value:he}),error:L({},e,{value:me}),group:L({},e,{value:Ee}),groupCollapsed:L({},e,{value:ye}),groupEnd:L({},e,{value:Re})})}z<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=A.ReactCurrentDispatcher,re;function X(e,r,t){{if(re===void 0)try{throw Error()}catch(p){var i=p.stack.trim().match(/\n( *(at )?)/);re=i&&i[1]||""}return`
18
- `+re+e}}var te=!1,H;{var sr=typeof WeakMap=="function"?WeakMap:Map;H=new sr}function _e(e,r){if(!e||te)return"";{var t=H.get(e);if(t!==void 0)return t}var i;te=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var h;h=ee.current,ee.current=null,or();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(D){i=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){i=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){i=D}e()}}catch(D){if(D&&i&&typeof D.stack=="string"){for(var f=D.stack.split(`
19
- `),T=i.stack.split(`
20
- `),y=f.length-1,b=T.length-1;y>=1&&b>=0&&f[y]!==T[b];)b--;for(;y>=1&&b>=0;y--,b--)if(f[y]!==T[b]){if(y!==1||b!==1)do if(y--,b--,b<0||f[y]!==T[b]){var P=`
21
- `+f[y].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,P),P}while(y>=1&&b>=0);break}}}finally{te=!1,ee.current=h,ir(),Error.prepareStackTrace=p}var N=e?e.displayName||e.name:"",Ie=N?X(N):"";return typeof e=="function"&&H.set(e,Ie),Ie}function ur(e,r,t){return _e(e,!1)}function lr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,t){if(e==null)return"";if(typeof e=="function")return _e(e,lr(e));if(typeof e=="string")return X(e);switch(e){case C:return X("Suspense");case E:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return ur(e.render);case O:return K(e.type,r,t);case j:{var i=e,p=i._payload,h=i._init;try{return K(h(p),r,t)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,Ce={},we=A.ReactDebugCurrentFrame;function Z(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}function cr(e,r,t,i,p){{var h=Function.call.bind(q);for(var d in e)if(h(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((i||"React class")+": "+t+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}f=e[d](r,d,i,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(y){f=y}f&&!(f instanceof Error)&&(Z(p),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",i||"React class",t,d,typeof f),Z(null)),f instanceof Error&&!(f.message in Ce)&&(Ce[f.message]=!0,Z(p),_("Failed %s type: %s",t,f.message),Z(null))}}}var fr=Array.isArray;function ne(e){return fr(e)}function dr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function vr(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function Oe(e){if(vr(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dr(e)),Te(e)}var U=A.ReactCurrentOwner,pr={key:!0,ref:!0,__self:!0,__source:!0},Se,je,ae;ae={};function gr(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 hr(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 mr(e,r){if(typeof e.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var t=x(U.current.type);ae[t]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',x(U.current.type),e.ref),ae[t]=!0)}}function Er(e,r){{var t=function(){Se||(Se=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function yr(e,r){{var t=function(){je||(je=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Rr=function(e,r,t,i,p,h,d){var f={$$typeof:o,type:e,key:r,ref:t,props:d,_owner:h};return f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(f,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function br(e,r,t,i,p){{var h,d={},f=null,T=null;t!==void 0&&(Oe(t),f=""+t),hr(r)&&(Oe(r.key),f=""+r.key),gr(r)&&(T=r.ref,mr(r,p));for(h in r)q.call(r,h)&&!pr.hasOwnProperty(h)&&(d[h]=r[h]);if(e&&e.defaultProps){var y=e.defaultProps;for(h in y)d[h]===void 0&&(d[h]=y[h])}if(f||T){var b=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Er(d,b),T&&yr(d,b)}return Rr(e,f,T,p,i,U.current,d)}}var oe=A.ReactCurrentOwner,Pe=A.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var ie;ie=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function ke(){{if(oe.current){var e=x(oe.current.type);if(e)return`
17
+ */var le;function Me(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var n=h,i=Symbol.for("react.element"),s=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),F=Symbol.iterator,I="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[I];return typeof r=="function"?r:null}var A=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];w("error",e,t)}}function w(e,r,t){{var o=A.ReactDebugCurrentFrame,p=o.getStackAddendum();p!==""&&(r+="%s",t=t.concat([p]));var g=t.map(function(d){return String(d)});g.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,g)}}var ce=!1,fe=!1,J=!1,rr=!1,tr=!1,de;de=Symbol.for("react.module.reference");function nr(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===v||tr||e===l||e===b||e===E||rr||e===S||ce||fe||J||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===O||e.$$typeof===m||e.$$typeof===a||e.$$typeof===c||e.$$typeof===de||e.getModuleId!==void 0))}function ar(e,r,t){var o=e.displayName;if(o)return o;var p=r.displayName||r.name||"";return p!==""?t+"("+p+")":t}function ve(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case u:return"Fragment";case s:return"Portal";case v:return"Profiler";case l:return"StrictMode";case b:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case a:var r=e;return ve(r)+".Consumer";case m:var t=e;return ve(t._context)+".Provider";case c:return ar(e,e.render,"ForwardRef");case O:var o=e.displayName||null;return o!==null?o:x(e.type)||"Memo";case j:{var p=e,g=p._payload,d=p._init;try{return x(d(g))}catch{return null}}}return null}var M=Object.assign,U=0,pe,ge,me,he,Ee,ye,Re;function be(){}be.__reactDisabledLog=!0;function or(){{if(U===0){pe=console.log,ge=console.info,me=console.warn,he=console.error,Ee=console.group,ye=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}U++}}function ir(){{if(U--,U===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:pe}),info:M({},e,{value:ge}),warn:M({},e,{value:me}),error:M({},e,{value:he}),group:M({},e,{value:Ee}),groupCollapsed:M({},e,{value:ye}),groupEnd:M({},e,{value:Re})})}U<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=A.ReactCurrentDispatcher,re;function X(e,r,t){{if(re===void 0)try{throw Error()}catch(p){var o=p.stack.trim().match(/\n( *(at )?)/);re=o&&o[1]||""}return`
18
+ `+re+e}}var te=!1,H;{var sr=typeof WeakMap=="function"?WeakMap:Map;H=new sr}function _e(e,r){if(!e||te)return"";{var t=H.get(e);if(t!==void 0)return t}var o;te=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=ee.current,ee.current=null,or();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(D){o=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){o=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){o=D}e()}}catch(D){if(D&&o&&typeof D.stack=="string"){for(var f=D.stack.split(`
19
+ `),T=o.stack.split(`
20
+ `),y=f.length-1,_=T.length-1;y>=1&&_>=0&&f[y]!==T[_];)_--;for(;y>=1&&_>=0;y--,_--)if(f[y]!==T[_]){if(y!==1||_!==1)do if(y--,_--,_<0||f[y]!==T[_]){var P=`
21
+ `+f[y].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&H.set(e,P),P}while(y>=1&&_>=0);break}}}finally{te=!1,ee.current=g,ir(),Error.prepareStackTrace=p}var W=e?e.displayName||e.name:"",Ie=W?X(W):"";return typeof e=="function"&&H.set(e,Ie),Ie}function ur(e,r,t){return _e(e,!1)}function lr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,t){if(e==null)return"";if(typeof e=="function")return _e(e,lr(e));if(typeof e=="string")return X(e);switch(e){case b:return X("Suspense");case E:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return ur(e.render);case O:return K(e.type,r,t);case j:{var o=e,p=o._payload,g=o._init;try{return K(g(p),r,t)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,Ce={},we=A.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}function cr(e,r,t,o,p){{var g=Function.call.bind(Z);for(var d in e)if(g(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((o||"React class")+": "+t+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}f=e[d](r,d,o,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(y){f=y}f&&!(f instanceof Error)&&(q(p),C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",t,d,typeof f),q(null)),f instanceof Error&&!(f.message in Ce)&&(Ce[f.message]=!0,q(p),C("Failed %s type: %s",t,f.message),q(null))}}}var fr=Array.isArray;function ne(e){return fr(e)}function dr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function vr(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function Oe(e){if(vr(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dr(e)),Te(e)}var B=A.ReactCurrentOwner,pr={key:!0,ref:!0,__self:!0,__source:!0},Se,je,ae;ae={};function gr(e){if(Z.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function mr(e){if(Z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function hr(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var t=x(B.current.type);ae[t]||(C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',x(B.current.type),e.ref),ae[t]=!0)}}function Er(e,r){{var t=function(){Se||(Se=!0,C("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function yr(e,r){{var t=function(){je||(je=!0,C("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Rr=function(e,r,t,o,p,g,d){var f={$$typeof:i,type:e,key:r,ref:t,props:d,_owner:g};return f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(f,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function br(e,r,t,o,p){{var g,d={},f=null,T=null;t!==void 0&&(Oe(t),f=""+t),mr(r)&&(Oe(r.key),f=""+r.key),gr(r)&&(T=r.ref,hr(r,p));for(g in r)Z.call(r,g)&&!pr.hasOwnProperty(g)&&(d[g]=r[g]);if(e&&e.defaultProps){var y=e.defaultProps;for(g in y)d[g]===void 0&&(d[g]=y[g])}if(f||T){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Er(d,_),T&&yr(d,_)}return Rr(e,f,T,p,o,B.current,d)}}var oe=A.ReactCurrentOwner,Pe=A.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var ie;ie=!1;function se(e){return typeof e=="object"&&e!==null&&e.$$typeof===i}function ke(){{if(oe.current){var e=x(oe.current.type);if(e)return`
22
22
 
23
23
  Check the render method of \``+e+"`."}return""}}function _r(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
24
 
25
25
  Check your code at `+r+":"+t+"."}return""}}var Ae={};function Cr(e){{var r=ke();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
26
26
 
27
- Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Cr(r);if(Ae[t])return;Ae[t]=!0;var i="";e&&e._owner&&e._owner!==oe.current&&(i=" It was passed a child from "+x(e._owner.type)+"."),M(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,i),M(null)}}function De(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var i=e[t];se(i)&&xe(i,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var p=G(e);if(typeof p=="function"&&p!==e.entries)for(var h=p.call(e),d;!(d=h.next()).done;)se(d.value)&&xe(d.value,r)}}}function wr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===O))t=r.propTypes;else return;if(t){var i=x(r);cr(t,e.props,"prop",i,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var p=x(r);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var i=r[t];if(i!=="children"&&i!=="key"){M(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),M(null);break}}e.ref!==null&&(M(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function Fe(e,r,t,i,p,h){{var d=nr(e);if(!d){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var T=_r(p);T?f+=T:f+=ke();var y;e===null?y="null":ne(e)?y="array":e!==void 0&&e.$$typeof===o?(y="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):y=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",y,f)}var b=br(e,r,t,p,h);if(b==null)return b;if(d){var P=r.children;if(P!==void 0)if(i)if(ne(P)){for(var N=0;N<P.length;N++)De(P[N],e);Object.freeze&&Object.freeze(P)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else De(P,e)}return e===l?Tr(b):wr(b),b}}function Or(e,r,t){return Fe(e,r,t,!0)}function Sr(e,r,t){return Fe(e,r,t,!1)}var jr=Sr,Pr=Or;V.Fragment=l,V.jsx=jr,V.jsxs=Pr}()),V}process.env.NODE_ENV==="production"?$.exports=Le():$.exports=Me();var k=$.exports;const Y=m.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ne=({axios:n,children:o,translate:s,useAuth:l,Outlet:a,Navigate:v,useLocation:u,useGoogleTagManager:g})=>{const c=m.useMemo(()=>({axios:n,Navigate:v,Outlet:a,translate:s,useAuth:l,useGoogleTagManager:g,useLocation:u}),[v,a,n,s,l,g,u]);return k.jsx(Y.Provider,{value:c,children:o})},B=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:o="/login",localStorageKey:s="user",redirect401Path:l="/login",...a})=>{var I,G,A,_;const{axios:v=a.axios,useLocation:u=a.useLocation,useAuth:g=a.useAuth,Outlet:c=a.Outlet,Navigate:C=a.Navigate}=m.useContext(Y);if(g===void 0)throw new Error(B("useAuth"));if(u===void 0)throw new Error(B("useLocation"));if(c===void 0)throw new Error(B("Outlet"));if(C===void 0)throw new Error(B("Navigate"));const[E,O]=m.useState(null),{isLogged:j}=g(),S=u(),F=m.useRef(!1);return m.useLayoutEffect(()=>{F.current||(F.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var J;return typeof w=="object"&&w&&"response"in w&&w.response&&typeof w.response=="object"&&"status"in w.response&&w.response&&typeof w.response=="object"&&"status"in w.response&&((J=w==null?void 0:w.response)==null?void 0:J.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(s),O(l)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,s,l]),j&&!E?k.jsx(m.Suspense,{fallback:n,children:(G=(I=S.state)==null?void 0:I.from)!=null&&G.state&&((_=(A=S.state)==null?void 0:A.from)==null?void 0:_.pathname)===o?k.jsx(C,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(c,{})}):k.jsx(C,{to:o,state:{from:S},replace:!0})},Q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ve=({...n})=>{const{useLocation:o=n.useLocation,Outlet:s=n.Outlet,useGoogleTagManager:l=n.useGoogleTagManager}=m.useContext(Y);if(o===void 0)throw new Error(Q("useLocation"));if(s===void 0)throw new Error(Q("Outlet"));if(l===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:a}=o(),{sendEvent:v}=l();return m.useEffect(()=>{v({event:"pageView",pathname:a})},[a,v]),k.jsx(s,{})},Ye=({axios:n,baseURL:o,tokenTypeKey:s="tokenType",userLocalStorageKey:l="user",tokenKey:a="accessToken",postContentType:v="application/json"})=>{if(!n.defaults)return null;const u=localStorage.getItem(l),g=u?JSON.parse(u):null,c=g!=null&&g[s]?g[s]:null,C=g!=null&&g[a]?g[a]:null,E=u?`${c} ${C}`:null;return n.defaults.baseURL=o,n.defaults.headers.post["Content-Type"]=v,E&&(n.defaults.headers.common.Authorization=E),null},ze=({i18n:n,debug:o,initReactI18next:s,resources:l,LanguageDetector:a})=>(n!=null&&n.isInitialized||(n.use(a).use(s).init({debug:o,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:l,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ue=({dsn:n,sentry:o,integrations:s,tracesSampleRate:l,routingInstrumentationDependencies:a,replaysSessionSampleRate:v,replaysOnErrorSampleRate:u,tracePropagationTargets:g,debug:c})=>(o.isInitialized()||(c||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&o.init({debug:c,dsn:n,integrations:[new o.BrowserTracing({routingInstrumentation:o.reactRouterV6Instrumentation(a.useEffect,a.useLocation,a.useNavigationType,a.createRoutesFromChildren,a.matchRoutes)}),o.replayIntegration(),...s||[]],replaysOnErrorSampleRate:u||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:g,tracesSampleRate:l||1}),null),Be=({IMaskMixin:n,...o})=>{const s=m.useMemo(()=>n(({TextField:l,...a})=>k.jsx(l,{...a})),[n]);return k.jsx(s,{...o})},Ge=({mapbox:n,accessToken:o})=>(n&&o&&(n.accessToken=o),null),Je=({children:n,defaultOptions:o,QueryClient:s,QueryClientProvider:l})=>{const a=new s({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...o}}});return k.jsx(l,{client:a,children:n})},Xe=n=>{const{unknownErrorTranslationKey:o="error.unknownError"}=n||{},{translate:s=n==null?void 0:n.translate}=m.useContext(Y);return{printError:m.useCallback(a=>{var g,c,C,E,O,j,S,F,I;const v=s?s(o):"Unknown error",{response:u}=a||{};return a!=null&&a.reason?String(a.reason):(g=u==null?void 0:u.data)!=null&&g.reason?String(u.data.reason):(c=u==null?void 0:u.data)!=null&&c.message?String(u.data.message):(E=(C=u==null?void 0:u.data)==null?void 0:C.detail)!=null&&E.length&&Array.isArray((O=u==null?void 0:u.data)==null?void 0:O.detail)&&((S=(j=u==null?void 0:u.data)==null?void 0:j.detail[0])!=null&&S.msg)&&typeof((I=(F=u==null?void 0:u.data)==null?void 0:F.detail[0])==null?void 0:I.msg)=="string"?String(u.data.detail[0].msg):v},[s,o])}},He=({data:n,fetchNextPage:o,isFetchingNextPage:s,isInitialLoading:l,isLoading:a,enabled:v=!0})=>{const u=m.useCallback(async c=>{s||!v||await o({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[v,o,s]),g=m.useMemo(()=>{if(n)return n.pages.reduce((c,C)=>[...c,...C],[])},[n]);return{fetchNextPageOnRowsScrollEnd:u,isLoading:s||a,loadingVariant:l?"skeleton":"linear",rows:g}},Ke=n=>{const o=m.useCallback(({tokenType:l,accessToken:a})=>{n.defaults.headers.common.Authorization=`${l} ${a}`},[n.defaults.headers.common]);return{clearAuthenticationToken:m.useCallback(()=>{n.defaults.headers.common.Authorization=null},[n.defaults.headers.common]),setAuthenticationToken:o}},qe=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),Ze=n=>{const l=n.split("/").filter(a=>a.length>0).map(a=>a.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return l.charAt(0).toLowerCase()+l.slice(1)},$e=(n,o,s)=>{const l=Ze(o),a=qe(s);return`${l}${a}`},Qe=n=>{if(n)return(n==null?void 0:n.reduce((o,s)=>(o[s]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},o),{}))||{}},er=n=>{const{input:o="./openapi.json",operationsToGenerateInfiniteQueryHook:s=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:o,output:{client:"react-query",mode:"tags-split",override:{header:l=>["Generated by orval 🍺",...l.title?[l.title]:[],...l.description?[l.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:$e,...(s==null?void 0:s.length)&&{operations:Qe(s)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};R.AxiosConfig=Ye,R.GTMSendPageView=Ve,R.I18nConfig=ze,R.InjectDependenciesContext=Y,R.InjectDependenciesProvider=Ne,R.MapBoxConfig=Ge,R.MaskTextField=Be,R.QueryClientConfigProvider=Je,R.RequireAuth=We,R.SentryConfig=Ue,R.getOrvalConfig=er,R.useAuth=Ke,R.useInfiniteDataGrid=He,R.useResponseError=Xe,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
27
+ Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Cr(r);if(Ae[t])return;Ae[t]=!0;var o="";e&&e._owner&&e._owner!==oe.current&&(o=" It was passed a child from "+x(e._owner.type)+"."),N(e),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,o),N(null)}}function De(e,r){{if(typeof e!="object")return;if(ne(e))for(var t=0;t<e.length;t++){var o=e[t];se(o)&&xe(o,r)}else if(se(e))e._store&&(e._store.validated=!0);else if(e){var p=L(e);if(typeof p=="function"&&p!==e.entries)for(var g=p.call(e),d;!(d=g.next()).done;)se(d.value)&&xe(d.value,r)}}}function wr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===O))t=r.propTypes;else return;if(t){var o=x(r);cr(t,e.props,"prop",o,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var p=x(r);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var o=r[t];if(o!=="children"&&o!=="key"){N(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),N(null);break}}e.ref!==null&&(N(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),N(null))}}function Fe(e,r,t,o,p,g){{var d=nr(e);if(!d){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var T=_r(p);T?f+=T:f+=ke();var y;e===null?y="null":ne(e)?y="array":e!==void 0&&e.$$typeof===i?(y="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):y=typeof e,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",y,f)}var _=br(e,r,t,p,g);if(_==null)return _;if(d){var P=r.children;if(P!==void 0)if(o)if(ne(P)){for(var W=0;W<P.length;W++)De(P[W],e);Object.freeze&&Object.freeze(P)}else C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else De(P,e)}return e===u?Tr(_):wr(_),_}}function Or(e,r,t){return Fe(e,r,t,!0)}function Sr(e,r,t){return Fe(e,r,t,!1)}var jr=Sr,Pr=Or;Y.Fragment=u,Y.jsx=jr,Y.jsxs=Pr}()),Y}process.env.NODE_ENV==="production"?$.exports=Le():$.exports=Me();var k=$.exports;const z=h.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ne=({axios:n,children:i,translate:s,useAuth:u,Outlet:l,Navigate:v,useLocation:m,useGoogleTagManager:a})=>{const c=h.useMemo(()=>({axios:n,Navigate:v,Outlet:l,translate:s,useAuth:u,useGoogleTagManager:a,useLocation:m}),[v,l,n,s,u,a,m]);return k.jsx(z.Provider,{value:c,children:i})},G=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:i="/login",localStorageKey:s="user",redirect401Path:u="/login",...l})=>{var I,L,A,C;const{axios:v=l.axios,useLocation:m=l.useLocation,useAuth:a=l.useAuth,Outlet:c=l.Outlet,Navigate:b=l.Navigate}=h.useContext(z);if(a===void 0)throw new Error(G("useAuth"));if(m===void 0)throw new Error(G("useLocation"));if(c===void 0)throw new Error(G("Outlet"));if(b===void 0)throw new Error(G("Navigate"));const[E,O]=h.useState(null),{isLogged:j}=a(),S=m(),F=h.useRef(!1);return h.useLayoutEffect(()=>{F.current||(F.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var J;return typeof w=="object"&&w&&"response"in w&&w.response&&typeof w.response=="object"&&"status"in w.response&&w.response&&typeof w.response=="object"&&"status"in w.response&&((J=w==null?void 0:w.response)==null?void 0:J.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(s),O(u)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,s,u]),j&&!E?k.jsx(h.Suspense,{fallback:n,children:(L=(I=S.state)==null?void 0:I.from)!=null&&L.state&&((C=(A=S.state)==null?void 0:A.from)==null?void 0:C.pathname)===i?k.jsx(b,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(c,{})}):k.jsx(b,{to:i,state:{from:S},replace:!0})},Q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ve=({...n})=>{const{useLocation:i=n.useLocation,Outlet:s=n.Outlet,useGoogleTagManager:u=n.useGoogleTagManager}=h.useContext(z);if(i===void 0)throw new Error(Q("useLocation"));if(s===void 0)throw new Error(Q("Outlet"));if(u===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:l}=i(),{sendEvent:v}=u();return h.useEffect(()=>{v({event:"pageView",pathname:l})},[l,v]),k.jsx(s,{})},Ye=({axios:n,baseURL:i,tokenTypeKey:s="tokenType",userLocalStorageKey:u="user",tokenKey:l="accessToken",postContentType:v="application/json"})=>{if(!n.defaults)return null;const m=localStorage.getItem(u),a=m?JSON.parse(m):null,c=a!=null&&a[s]?a[s]:null,b=a!=null&&a[l]?a[l]:null,E=m?`${c} ${b}`:null;return n.defaults.baseURL=i,n.defaults.headers.post["Content-Type"]=v,E&&(n.defaults.headers.common.Authorization=E),null},ze=({i18n:n,debug:i,initReactI18next:s,resources:u,LanguageDetector:l})=>(n!=null&&n.isInitialized||(n.use(l).use(s).init({debug:i,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:u,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Ue=({dsn:n,sentry:i,integrations:s,tracesSampleRate:u,routingInstrumentationDependencies:l,replaysSessionSampleRate:v,replaysOnErrorSampleRate:m,tracePropagationTargets:a,ignoreErrors:c,debug:b})=>(i.isInitialized()||(b||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&i.init({debug:b,dsn:n,ignoreErrors:c||[/Failed to fetch dynamically imported module/],integrations:[new i.BrowserTracing({routingInstrumentation:i.reactRouterV6Instrumentation(l.useEffect,l.useLocation,l.useNavigationType,l.createRoutesFromChildren,l.matchRoutes)}),i.replayIntegration(),...s||[]],replaysOnErrorSampleRate:m||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:a,tracesSampleRate:u||1}),null),Be=({IMaskMixin:n,...i})=>{const s=h.useMemo(()=>n(({TextField:u,...l})=>k.jsx(u,{...l})),[n]);return k.jsx(s,{...i})},Ge=({mapbox:n,accessToken:i})=>(n&&i&&(n.accessToken=i),null),Je=({children:n,defaultOptions:i,QueryClient:s,QueryClientProvider:u})=>{const l=new s({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...i}}});return k.jsx(u,{client:l,children:n})},Xe=n=>{const{unknownErrorTranslationKey:i="error.unknownError"}=n||{},{translate:s=n==null?void 0:n.translate}=h.useContext(z),u=s?s(i):"Unknown error",l=h.useCallback(m=>{var c,b,E,O,j,S,F,I,L;const{response:a}=m||{};return a!=null&&a.reason?String(m.reason):(c=a==null?void 0:a.data)!=null&&c.reason?String(a.data.reason):(b=a==null?void 0:a.data)!=null&&b.message?String(a.data.message):(O=(E=a==null?void 0:a.data)==null?void 0:E.detail)!=null&&O.length&&Array.isArray((j=a==null?void 0:a.data)==null?void 0:j.detail)&&((F=(S=a==null?void 0:a.data)==null?void 0:S.detail[0])!=null&&F.msg)&&typeof((L=(I=a==null?void 0:a.data)==null?void 0:I.detail[0])==null?void 0:L.msg)=="string"?String(a.data.detail[0].msg):u},[u]),v=h.useCallback(m=>{const{response:a}=m||{},{error_code:c}=a||{};return c&&s?s(c):c||u},[u,s]);return{printError:l,printErrorCode:v}},He=({data:n,fetchNextPage:i,isFetchingNextPage:s,isInitialLoading:u,isLoading:l,enabled:v=!0})=>{const m=h.useCallback(async c=>{s||!v||await i({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[v,i,s]),a=h.useMemo(()=>{if(n)return n.pages.reduce((c,b)=>[...c,...b],[])},[n]);return{fetchNextPageOnRowsScrollEnd:m,isLoading:s||l,loadingVariant:u?"skeleton":"linear",rows:a}},Ke=n=>{const i=h.useCallback(({tokenType:u,accessToken:l})=>{n.defaults.headers.common.Authorization=`${u} ${l}`},[n.defaults.headers.common]);return{clearAuthenticationToken:h.useCallback(()=>{n.defaults.headers.common.Authorization=null},[n.defaults.headers.common]),setAuthenticationToken:i}},Ze=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),qe=n=>{const u=n.split("/").filter(l=>l.length>0).map(l=>l.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return u.charAt(0).toLowerCase()+u.slice(1)},$e=(n,i,s)=>{const u=qe(i),l=Ze(s);return`${u}${l}`},Qe=n=>{if(n)return(n==null?void 0:n.reduce((i,s)=>(i[s]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},i),{}))||{}},er=n=>{const{input:i="./openapi.json",operationsToGenerateInfiniteQueryHook:s=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:i,output:{client:"react-query",mode:"tags-split",override:{header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:$e,...(s==null?void 0:s.length)&&{operations:Qe(s)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};R.AxiosConfig=Ye,R.GTMSendPageView=Ve,R.I18nConfig=ze,R.InjectDependenciesContext=z,R.InjectDependenciesProvider=Ne,R.MapBoxConfig=Ge,R.MaskTextField=Be,R.QueryClientConfigProvider=Je,R.RequireAuth=We,R.SentryConfig=Ue,R.getOrvalConfig=er,R.useAuth=Ke,R.useInfiniteDataGrid=He,R.useResponseError=Xe,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "0.15.11",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",