@tracktor/shared-module 0.2.0 → 0.2.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/react-google-tag-manager/releases)
2
2
 
3
- ## v0.2.0
4
- - **[refactor]** : export module structure
3
+ ## v0.2.1
4
+ - **[fix]** : `printError` inside `useResponseError`
@@ -26,6 +26,6 @@ export interface useResponseErrorParams {
26
26
  * This hook is used to print error messages from the API
27
27
  */
28
28
  export declare const useResponseError: <T = ResponseError>(params?: useResponseErrorParams) => {
29
- printError: (response?: any) => string;
29
+ printError: (error?: any) => string;
30
30
  };
31
31
  export default useResponseError;
package/dist/main.js CHANGED
@@ -1,10 +1,10 @@
1
- import Se, { createContext as cr, useMemo as sr, useContext as Pe, Suspense as dr, useCallback as vr } from "react";
2
- var Q = {}, gr = {
1
+ import Pe, { createContext as lr, useMemo as cr, useContext as xe, Suspense as dr, useCallback as vr } from "react";
2
+ var ee = {}, pr = {
3
3
  get exports() {
4
- return Q;
4
+ return ee;
5
5
  },
6
6
  set exports(d) {
7
- Q = d;
7
+ ee = d;
8
8
  }
9
9
  }, $ = {};
10
10
  /**
@@ -16,23 +16,23 @@ var Q = {}, gr = {
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
18
  */
19
- var Oe;
20
- function hr() {
21
- if (Oe)
19
+ var Ce;
20
+ function gr() {
21
+ if (Ce)
22
22
  return $;
23
- Oe = 1;
24
- var d = Se, m = Symbol.for("react.element"), g = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, o = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, _ = { key: !0, ref: !0, __self: !0, __source: !0 };
25
- function y(T, l, w) {
23
+ Ce = 1;
24
+ var d = Pe, y = Symbol.for("react.element"), g = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, p = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, _ = { key: !0, ref: !0, __self: !0, __source: !0 };
25
+ function i(T, f, w) {
26
26
  var v, h = {}, R = null, P = null;
27
- w !== void 0 && (R = "" + w), l.key !== void 0 && (R = "" + l.key), l.ref !== void 0 && (P = l.ref);
28
- for (v in l)
29
- b.call(l, v) && !_.hasOwnProperty(v) && (h[v] = l[v]);
27
+ w !== void 0 && (R = "" + w), f.key !== void 0 && (R = "" + f.key), f.ref !== void 0 && (P = f.ref);
28
+ for (v in f)
29
+ b.call(f, v) && !_.hasOwnProperty(v) && (h[v] = f[v]);
30
30
  if (T && T.defaultProps)
31
- for (v in l = T.defaultProps, l)
32
- h[v] === void 0 && (h[v] = l[v]);
33
- return { $$typeof: m, type: T, key: R, ref: P, props: h, _owner: o.current };
31
+ for (v in f = T.defaultProps, f)
32
+ h[v] === void 0 && (h[v] = f[v]);
33
+ return { $$typeof: y, type: T, key: R, ref: P, props: h, _owner: p.current };
34
34
  }
35
- return $.Fragment = g, $.jsx = y, $.jsxs = y, $;
35
+ return $.Fragment = g, $.jsx = i, $.jsxs = i, $;
36
36
  }
37
37
  var W = {};
38
38
  /**
@@ -44,14 +44,14 @@ var W = {};
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
46
  */
47
- var Ce;
48
- function Er() {
49
- return Ce || (Ce = 1, process.env.NODE_ENV !== "production" && function() {
50
- var d = Se, m = Symbol.for("react.element"), g = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), y = Symbol.for("react.provider"), T = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), P = Symbol.for("react.offscreen"), D = Symbol.iterator, xe = "@@iterator";
47
+ var Se;
48
+ function hr() {
49
+ return Se || (Se = 1, process.env.NODE_ENV !== "production" && function() {
50
+ var d = Pe, y = Symbol.for("react.element"), g = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), T = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), P = Symbol.for("react.offscreen"), D = Symbol.iterator, L = "@@iterator";
51
51
  function je(e) {
52
52
  if (e === null || typeof e != "object")
53
53
  return null;
54
- var r = D && e[D] || e[xe];
54
+ var r = D && e[D] || e[L];
55
55
  return typeof r == "function" ? r : null;
56
56
  }
57
57
  var j = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
@@ -66,20 +66,20 @@ function Er() {
66
66
  {
67
67
  var n = j.ReactDebugCurrentFrame, u = n.getStackAddendum();
68
68
  u !== "" && (r += "%s", t = t.concat([u]));
69
- var f = t.map(function(i) {
70
- return String(i);
69
+ var s = t.map(function(o) {
70
+ return String(o);
71
71
  });
72
- f.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, f);
72
+ s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
73
73
  }
74
74
  }
75
- var Ae = !1, De = !1, Fe = !1, Ie = !1, $e = !1, re;
76
- re = Symbol.for("react.module.reference");
75
+ var Ae = !1, De = !1, Fe = !1, Ie = !1, $e = !1, te;
76
+ te = Symbol.for("react.module.reference");
77
77
  function We(e) {
78
- return !!(typeof e == "string" || typeof e == "function" || e === b || e === _ || $e || e === o || e === w || e === v || Ie || e === P || Ae || De || Fe || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === h || e.$$typeof === y || e.$$typeof === T || e.$$typeof === l || // This needs to include all possible module reference object
78
+ return !!(typeof e == "string" || typeof e == "function" || e === b || e === _ || $e || e === p || e === w || e === v || Ie || e === P || Ae || De || Fe || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === h || e.$$typeof === i || e.$$typeof === T || e.$$typeof === f || // This needs to include all possible module reference object
79
79
  // types supported by any Flight configuration anywhere since
80
80
  // we don't know which Flight build this will end up being used
81
81
  // with.
82
- e.$$typeof === re || e.getModuleId !== void 0));
82
+ e.$$typeof === te || e.getModuleId !== void 0));
83
83
  }
84
84
  function Ye(e, r, t) {
85
85
  var n = e.displayName;
@@ -88,7 +88,7 @@ function Er() {
88
88
  var u = r.displayName || r.name || "";
89
89
  return u !== "" ? t + "(" + u + ")" : t;
90
90
  }
91
- function te(e) {
91
+ function ne(e) {
92
92
  return e.displayName || "Context";
93
93
  }
94
94
  function C(e) {
@@ -105,7 +105,7 @@ function Er() {
105
105
  return "Portal";
106
106
  case _:
107
107
  return "Profiler";
108
- case o:
108
+ case p:
109
109
  return "StrictMode";
110
110
  case w:
111
111
  return "Suspense";
@@ -116,19 +116,19 @@ function Er() {
116
116
  switch (e.$$typeof) {
117
117
  case T:
118
118
  var r = e;
119
- return te(r) + ".Consumer";
120
- case y:
119
+ return ne(r) + ".Consumer";
120
+ case i:
121
121
  var t = e;
122
- return te(t._context) + ".Provider";
123
- case l:
122
+ return ne(t._context) + ".Provider";
123
+ case f:
124
124
  return Ye(e, e.render, "ForwardRef");
125
125
  case h:
126
126
  var n = e.displayName || null;
127
127
  return n !== null ? n : C(e.type) || "Memo";
128
128
  case R: {
129
- var u = e, f = u._payload, i = u._init;
129
+ var u = e, s = u._payload, o = u._init;
130
130
  try {
131
- return C(i(f));
131
+ return C(o(s));
132
132
  } catch {
133
133
  return null;
134
134
  }
@@ -136,14 +136,14 @@ function Er() {
136
136
  }
137
137
  return null;
138
138
  }
139
- var x = Object.assign, F = 0, ne, ae, ie, oe, ue, fe, le;
139
+ var x = Object.assign, F = 0, ae, oe, ie, ue, se, fe, le;
140
140
  function ce() {
141
141
  }
142
142
  ce.__reactDisabledLog = !0;
143
143
  function Le() {
144
144
  {
145
145
  if (F === 0) {
146
- ne = console.log, ae = console.info, ie = console.warn, oe = console.error, ue = console.group, fe = console.groupCollapsed, le = console.groupEnd;
146
+ ae = console.log, oe = console.info, ie = console.warn, ue = console.error, se = console.group, fe = console.groupCollapsed, le = console.groupEnd;
147
147
  var e = {
148
148
  configurable: !0,
149
149
  enumerable: !0,
@@ -173,19 +173,19 @@ function Er() {
173
173
  };
174
174
  Object.defineProperties(console, {
175
175
  log: x({}, e, {
176
- value: ne
176
+ value: ae
177
177
  }),
178
178
  info: x({}, e, {
179
- value: ae
179
+ value: oe
180
180
  }),
181
181
  warn: x({}, e, {
182
182
  value: ie
183
183
  }),
184
184
  error: x({}, e, {
185
- value: oe
185
+ value: ue
186
186
  }),
187
187
  group: x({}, e, {
188
- value: ue
188
+ value: se
189
189
  }),
190
190
  groupCollapsed: x({}, e, {
191
191
  value: fe
@@ -198,62 +198,62 @@ function Er() {
198
198
  F < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
199
199
  }
200
200
  }
201
- var B = j.ReactCurrentDispatcher, J;
202
- function L(e, r, t) {
201
+ var J = j.ReactCurrentDispatcher, G;
202
+ function N(e, r, t) {
203
203
  {
204
- if (J === void 0)
204
+ if (G === void 0)
205
205
  try {
206
206
  throw Error();
207
207
  } catch (u) {
208
208
  var n = u.stack.trim().match(/\n( *(at )?)/);
209
- J = n && n[1] || "";
209
+ G = n && n[1] || "";
210
210
  }
211
211
  return `
212
- ` + J + e;
212
+ ` + G + e;
213
213
  }
214
214
  }
215
- var G = !1, N;
215
+ var z = !1, M;
216
216
  {
217
217
  var Me = typeof WeakMap == "function" ? WeakMap : Map;
218
- N = new Me();
218
+ M = new Me();
219
219
  }
220
- function se(e, r) {
221
- if (!e || G)
220
+ function de(e, r) {
221
+ if (!e || z)
222
222
  return "";
223
223
  {
224
- var t = N.get(e);
224
+ var t = M.get(e);
225
225
  if (t !== void 0)
226
226
  return t;
227
227
  }
228
228
  var n;
229
- G = !0;
229
+ z = !0;
230
230
  var u = Error.prepareStackTrace;
231
231
  Error.prepareStackTrace = void 0;
232
- var f;
233
- f = B.current, B.current = null, Le();
232
+ var s;
233
+ s = J.current, J.current = null, Le();
234
234
  try {
235
235
  if (r) {
236
- var i = function() {
236
+ var o = function() {
237
237
  throw Error();
238
238
  };
239
- if (Object.defineProperty(i.prototype, "props", {
239
+ if (Object.defineProperty(o.prototype, "props", {
240
240
  set: function() {
241
241
  throw Error();
242
242
  }
243
243
  }), typeof Reflect == "object" && Reflect.construct) {
244
244
  try {
245
- Reflect.construct(i, []);
245
+ Reflect.construct(o, []);
246
246
  } catch (S) {
247
247
  n = S;
248
248
  }
249
- Reflect.construct(e, [], i);
249
+ Reflect.construct(e, [], o);
250
250
  } else {
251
251
  try {
252
- i.call();
252
+ o.call();
253
253
  } catch (S) {
254
254
  n = S;
255
255
  }
256
- e.call(i.prototype);
256
+ e.call(o.prototype);
257
257
  }
258
258
  } else {
259
259
  try {
@@ -266,93 +266,93 @@ function Er() {
266
266
  } catch (S) {
267
267
  if (S && n && typeof S.stack == "string") {
268
268
  for (var a = S.stack.split(`
269
- `), p = n.stack.split(`
270
- `), c = a.length - 1, s = p.length - 1; c >= 1 && s >= 0 && a[c] !== p[s]; )
271
- s--;
272
- for (; c >= 1 && s >= 0; c--, s--)
273
- if (a[c] !== p[s]) {
274
- if (c !== 1 || s !== 1)
269
+ `), m = n.stack.split(`
270
+ `), l = a.length - 1, c = m.length - 1; l >= 1 && c >= 0 && a[l] !== m[c]; )
271
+ c--;
272
+ for (; l >= 1 && c >= 0; l--, c--)
273
+ if (a[l] !== m[c]) {
274
+ if (l !== 1 || c !== 1)
275
275
  do
276
- if (c--, s--, s < 0 || a[c] !== p[s]) {
276
+ if (l--, c--, c < 0 || a[l] !== m[c]) {
277
277
  var O = `
278
- ` + a[c].replace(" at new ", " at ");
279
- return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && N.set(e, O), O;
278
+ ` + a[l].replace(" at new ", " at ");
279
+ return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, O), O;
280
280
  }
281
- while (c >= 1 && s >= 0);
281
+ while (l >= 1 && c >= 0);
282
282
  break;
283
283
  }
284
284
  }
285
285
  } finally {
286
- G = !1, B.current = f, Ne(), Error.prepareStackTrace = u;
286
+ z = !1, J.current = s, Ne(), Error.prepareStackTrace = u;
287
287
  }
288
- var A = e ? e.displayName || e.name : "", we = A ? L(A) : "";
289
- return typeof e == "function" && N.set(e, we), we;
288
+ var A = e ? e.displayName || e.name : "", Oe = A ? N(A) : "";
289
+ return typeof e == "function" && M.set(e, Oe), Oe;
290
290
  }
291
291
  function Ue(e, r, t) {
292
- return se(e, !1);
292
+ return de(e, !1);
293
293
  }
294
294
  function Ve(e) {
295
295
  var r = e.prototype;
296
296
  return !!(r && r.isReactComponent);
297
297
  }
298
- function M(e, r, t) {
298
+ function U(e, r, t) {
299
299
  if (e == null)
300
300
  return "";
301
301
  if (typeof e == "function")
302
- return se(e, Ve(e));
302
+ return de(e, Ve(e));
303
303
  if (typeof e == "string")
304
- return L(e);
304
+ return N(e);
305
305
  switch (e) {
306
306
  case w:
307
- return L("Suspense");
307
+ return N("Suspense");
308
308
  case v:
309
- return L("SuspenseList");
309
+ return N("SuspenseList");
310
310
  }
311
311
  if (typeof e == "object")
312
312
  switch (e.$$typeof) {
313
- case l:
313
+ case f:
314
314
  return Ue(e.render);
315
315
  case h:
316
- return M(e.type, r, t);
316
+ return U(e.type, r, t);
317
317
  case R: {
318
- var n = e, u = n._payload, f = n._init;
318
+ var n = e, u = n._payload, s = n._init;
319
319
  try {
320
- return M(f(u), r, t);
320
+ return U(s(u), r, t);
321
321
  } catch {
322
322
  }
323
323
  }
324
324
  }
325
325
  return "";
326
326
  }
327
- var U = Object.prototype.hasOwnProperty, de = {}, ve = j.ReactDebugCurrentFrame;
328
- function V(e) {
327
+ var V = Object.prototype.hasOwnProperty, ve = {}, pe = j.ReactDebugCurrentFrame;
328
+ function q(e) {
329
329
  if (e) {
330
- var r = e._owner, t = M(e.type, e._source, r ? r.type : null);
331
- ve.setExtraStackFrame(t);
330
+ var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
331
+ pe.setExtraStackFrame(t);
332
332
  } else
333
- ve.setExtraStackFrame(null);
333
+ pe.setExtraStackFrame(null);
334
334
  }
335
335
  function qe(e, r, t, n, u) {
336
336
  {
337
- var f = Function.call.bind(U);
338
- for (var i in e)
339
- if (f(e, i)) {
337
+ var s = Function.call.bind(V);
338
+ for (var o in e)
339
+ if (s(e, o)) {
340
340
  var a = void 0;
341
341
  try {
342
- if (typeof e[i] != "function") {
343
- var p = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
- throw p.name = "Invariant Violation", p;
342
+ if (typeof e[o] != "function") {
343
+ var m = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
+ throw m.name = "Invariant Violation", m;
345
345
  }
346
- a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
- } catch (c) {
348
- a = c;
346
+ a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
+ } catch (l) {
348
+ a = l;
349
349
  }
350
- a && !(a instanceof Error) && (V(u), 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).", n || "React class", t, i, typeof a), V(null)), a instanceof Error && !(a.message in de) && (de[a.message] = !0, V(u), E("Failed %s type: %s", t, a.message), V(null));
350
+ a && !(a instanceof Error) && (q(u), 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).", n || "React class", t, o, typeof a), q(null)), a instanceof Error && !(a.message in ve) && (ve[a.message] = !0, q(u), E("Failed %s type: %s", t, a.message), q(null));
351
351
  }
352
352
  }
353
353
  }
354
354
  var Be = Array.isArray;
355
- function z(e) {
355
+ function K(e) {
356
356
  return Be(e);
357
357
  }
358
358
  function Je(e) {
@@ -380,10 +380,10 @@ function Er() {
380
380
  ref: !0,
381
381
  __self: !0,
382
382
  __source: !0
383
- }, Ee, pe, K;
384
- K = {};
383
+ }, Ee, me, H;
384
+ H = {};
385
385
  function Ke(e) {
386
- if (U.call(e, "ref")) {
386
+ if (V.call(e, "ref")) {
387
387
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
388
388
  if (r && r.isReactWarning)
389
389
  return !1;
@@ -391,7 +391,7 @@ function Er() {
391
391
  return e.ref !== void 0;
392
392
  }
393
393
  function He(e) {
394
- if (U.call(e, "key")) {
394
+ if (V.call(e, "key")) {
395
395
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
396
396
  if (r && r.isReactWarning)
397
397
  return !1;
@@ -401,7 +401,7 @@ function Er() {
401
401
  function Xe(e, r) {
402
402
  if (typeof e.ref == "string" && I.current && r && I.current.stateNode !== r) {
403
403
  var t = C(I.current.type);
404
- K[t] || (E('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', C(I.current.type), e.ref), K[t] = !0);
404
+ H[t] || (E('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', C(I.current.type), e.ref), H[t] = !0);
405
405
  }
406
406
  }
407
407
  function Ze(e, r) {
@@ -418,7 +418,7 @@ function Er() {
418
418
  function Qe(e, r) {
419
419
  {
420
420
  var t = function() {
421
- pe || (pe = !0, E("%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));
421
+ me || (me = !0, E("%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));
422
422
  };
423
423
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
424
424
  get: t,
@@ -426,17 +426,17 @@ function Er() {
426
426
  });
427
427
  }
428
428
  }
429
- var er = function(e, r, t, n, u, f, i) {
429
+ var er = function(e, r, t, n, u, s, o) {
430
430
  var a = {
431
431
  // This tag allows us to uniquely identify this as a React Element
432
- $$typeof: m,
432
+ $$typeof: y,
433
433
  // Built-in properties that belong on the element
434
434
  type: e,
435
435
  key: r,
436
436
  ref: t,
437
- props: i,
437
+ props: o,
438
438
  // Record the component responsible for creating this element.
439
- _owner: f
439
+ _owner: s
440
440
  };
441
441
  return a._store = {}, Object.defineProperty(a._store, "validated", {
442
442
  configurable: !1,
@@ -457,39 +457,39 @@ function Er() {
457
457
  };
458
458
  function rr(e, r, t, n, u) {
459
459
  {
460
- var f, i = {}, a = null, p = null;
461
- t !== void 0 && (he(t), a = "" + t), He(r) && (he(r.key), a = "" + r.key), Ke(r) && (p = r.ref, Xe(r, u));
462
- for (f in r)
463
- U.call(r, f) && !ze.hasOwnProperty(f) && (i[f] = r[f]);
460
+ var s, o = {}, a = null, m = null;
461
+ t !== void 0 && (he(t), a = "" + t), He(r) && (he(r.key), a = "" + r.key), Ke(r) && (m = r.ref, Xe(r, u));
462
+ for (s in r)
463
+ V.call(r, s) && !ze.hasOwnProperty(s) && (o[s] = r[s]);
464
464
  if (e && e.defaultProps) {
465
- var c = e.defaultProps;
466
- for (f in c)
467
- i[f] === void 0 && (i[f] = c[f]);
465
+ var l = e.defaultProps;
466
+ for (s in l)
467
+ o[s] === void 0 && (o[s] = l[s]);
468
468
  }
469
- if (a || p) {
470
- var s = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
471
- a && Ze(i, s), p && Qe(i, s);
469
+ if (a || m) {
470
+ var c = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
471
+ a && Ze(o, c), m && Qe(o, c);
472
472
  }
473
- return er(e, a, p, u, n, I.current, i);
473
+ return er(e, a, m, u, n, I.current, o);
474
474
  }
475
475
  }
476
- var H = j.ReactCurrentOwner, me = j.ReactDebugCurrentFrame;
476
+ var X = j.ReactCurrentOwner, ye = j.ReactDebugCurrentFrame;
477
477
  function k(e) {
478
478
  if (e) {
479
- var r = e._owner, t = M(e.type, e._source, r ? r.type : null);
480
- me.setExtraStackFrame(t);
479
+ var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
480
+ ye.setExtraStackFrame(t);
481
481
  } else
482
- me.setExtraStackFrame(null);
482
+ ye.setExtraStackFrame(null);
483
483
  }
484
- var X;
485
- X = !1;
486
- function Z(e) {
487
- return typeof e == "object" && e !== null && e.$$typeof === m;
484
+ var Z;
485
+ Z = !1;
486
+ function Q(e) {
487
+ return typeof e == "object" && e !== null && e.$$typeof === y;
488
488
  }
489
- function ye() {
489
+ function be() {
490
490
  {
491
- if (H.current) {
492
- var e = C(H.current.type);
491
+ if (X.current) {
492
+ var e = C(X.current.type);
493
493
  if (e)
494
494
  return `
495
495
 
@@ -509,10 +509,10 @@ Check your code at ` + r + ":" + t + ".";
509
509
  return "";
510
510
  }
511
511
  }
512
- var be = {};
512
+ var Re = {};
513
513
  function nr(e) {
514
514
  {
515
- var r = ye();
515
+ var r = be();
516
516
  if (!r) {
517
517
  var t = typeof e == "string" ? e : e.displayName || e.name;
518
518
  t && (r = `
@@ -522,35 +522,35 @@ Check the top-level render call using <` + t + ">.");
522
522
  return r;
523
523
  }
524
524
  }
525
- function Re(e, r) {
525
+ function _e(e, r) {
526
526
  {
527
527
  if (!e._store || e._store.validated || e.key != null)
528
528
  return;
529
529
  e._store.validated = !0;
530
530
  var t = nr(r);
531
- if (be[t])
531
+ if (Re[t])
532
532
  return;
533
- be[t] = !0;
533
+ Re[t] = !0;
534
534
  var n = "";
535
- e && e._owner && e._owner !== H.current && (n = " It was passed a child from " + C(e._owner.type) + "."), k(e), 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, n), k(null);
535
+ e && e._owner && e._owner !== X.current && (n = " It was passed a child from " + C(e._owner.type) + "."), k(e), 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, n), k(null);
536
536
  }
537
537
  }
538
- function _e(e, r) {
538
+ function Te(e, r) {
539
539
  {
540
540
  if (typeof e != "object")
541
541
  return;
542
- if (z(e))
542
+ if (K(e))
543
543
  for (var t = 0; t < e.length; t++) {
544
544
  var n = e[t];
545
- Z(n) && Re(n, r);
545
+ Q(n) && _e(n, r);
546
546
  }
547
- else if (Z(e))
547
+ else if (Q(e))
548
548
  e._store && (e._store.validated = !0);
549
549
  else if (e) {
550
550
  var u = je(e);
551
551
  if (typeof u == "function" && u !== e.entries)
552
- for (var f = u.call(e), i; !(i = f.next()).done; )
553
- Z(i.value) && Re(i.value, r);
552
+ for (var s = u.call(e), o; !(o = s.next()).done; )
553
+ Q(o.value) && _e(o.value, r);
554
554
  }
555
555
  }
556
556
  }
@@ -562,7 +562,7 @@ Check the top-level render call using <` + t + ">.");
562
562
  var t;
563
563
  if (typeof r == "function")
564
564
  t = r.propTypes;
565
- else if (typeof r == "object" && (r.$$typeof === l || // Note: Memo only checks outer props here.
565
+ else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
566
566
  // Inner props are checked in the reconciler.
567
567
  r.$$typeof === h))
568
568
  t = r.propTypes;
@@ -571,15 +571,15 @@ Check the top-level render call using <` + t + ">.");
571
571
  if (t) {
572
572
  var n = C(r);
573
573
  qe(t, e.props, "prop", n, e);
574
- } else if (r.PropTypes !== void 0 && !X) {
575
- X = !0;
574
+ } else if (r.PropTypes !== void 0 && !Z) {
575
+ Z = !0;
576
576
  var u = C(r);
577
577
  E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
578
578
  }
579
579
  typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
580
580
  }
581
581
  }
582
- function ir(e) {
582
+ function or(e) {
583
583
  {
584
584
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
585
585
  var n = r[t];
@@ -591,99 +591,99 @@ Check the top-level render call using <` + t + ">.");
591
591
  e.ref !== null && (k(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
592
592
  }
593
593
  }
594
- function Te(e, r, t, n, u, f) {
594
+ function we(e, r, t, n, u, s) {
595
595
  {
596
- var i = We(e);
597
- if (!i) {
596
+ var o = We(e);
597
+ if (!o) {
598
598
  var a = "";
599
599
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
600
- var p = tr(u);
601
- p ? a += p : a += ye();
602
- var c;
603
- e === null ? c = "null" : z(e) ? c = "array" : e !== void 0 && e.$$typeof === m ? (c = "<" + (C(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : c = typeof e, 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, a);
600
+ var m = tr(u);
601
+ m ? a += m : a += be();
602
+ var l;
603
+ e === null ? l = "null" : K(e) ? l = "array" : e !== void 0 && e.$$typeof === y ? (l = "<" + (C(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
604
604
  }
605
- var s = rr(e, r, t, u, f);
606
- if (s == null)
607
- return s;
608
- if (i) {
605
+ var c = rr(e, r, t, u, s);
606
+ if (c == null)
607
+ return c;
608
+ if (o) {
609
609
  var O = r.children;
610
610
  if (O !== void 0)
611
611
  if (n)
612
- if (z(O)) {
612
+ if (K(O)) {
613
613
  for (var A = 0; A < O.length; A++)
614
- _e(O[A], e);
614
+ Te(O[A], e);
615
615
  Object.freeze && Object.freeze(O);
616
616
  } else
617
617
  E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
618
618
  else
619
- _e(O, e);
619
+ Te(O, e);
620
620
  }
621
- return e === b ? ir(s) : ar(s), s;
621
+ return e === b ? or(c) : ar(c), c;
622
622
  }
623
623
  }
624
- function or(e, r, t) {
625
- return Te(e, r, t, !0);
624
+ function ir(e, r, t) {
625
+ return we(e, r, t, !0);
626
626
  }
627
627
  function ur(e, r, t) {
628
- return Te(e, r, t, !1);
628
+ return we(e, r, t, !1);
629
629
  }
630
- var fr = ur, lr = or;
631
- W.Fragment = b, W.jsx = fr, W.jsxs = lr;
630
+ var sr = ur, fr = ir;
631
+ W.Fragment = b, W.jsx = sr, W.jsxs = fr;
632
632
  }()), W;
633
633
  }
634
634
  (function(d) {
635
- process.env.NODE_ENV === "production" ? d.exports = hr() : d.exports = Er();
636
- })(gr);
637
- const Y = Q.jsx, ee = cr({
635
+ process.env.NODE_ENV === "production" ? d.exports = gr() : d.exports = hr();
636
+ })(pr);
637
+ const Y = ee.jsx, re = lr({
638
638
  children: void 0,
639
639
  Navigate: void 0,
640
640
  Outlet: void 0,
641
641
  translate: void 0,
642
642
  useAuth: void 0,
643
643
  useLocation: void 0
644
- }), mr = ({ children: d, translate: m, useAuth: g, Outlet: b, Navigate: o, useLocation: _ }) => {
645
- const y = sr(
644
+ }), mr = ({ children: d, translate: y, useAuth: g, Outlet: b, Navigate: p, useLocation: _ }) => {
645
+ const i = cr(
646
646
  () => ({
647
- Navigate: o,
647
+ Navigate: p,
648
648
  Outlet: b,
649
- translate: m,
649
+ translate: y,
650
650
  useAuth: g,
651
651
  useLocation: _
652
652
  }),
653
- [o, b, m, g, _]
653
+ [p, b, y, g, _]
654
654
  );
655
- return /* @__PURE__ */ Y(ee.Provider, { value: y, children: d });
656
- }, q = (d) => `RequireAuth require « ${d} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, yr = ({ Fallback: d, loginPath: m = "/login", ...g }) => {
655
+ return /* @__PURE__ */ Y(re.Provider, { value: i, children: d });
656
+ }, B = (d) => `RequireAuth require « ${d} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, yr = ({ Fallback: d, loginPath: y = "/login", ...g }) => {
657
657
  var w, v, h, R;
658
658
  const {
659
659
  useLocation: b = g.useLocation,
660
- useAuth: o = g.useAuth,
660
+ useAuth: p = g.useAuth,
661
661
  Outlet: _ = g.Outlet,
662
- Navigate: y = g.Navigate
663
- } = Pe(ee);
664
- if (o === void 0)
665
- throw new Error(q("useAuth"));
662
+ Navigate: i = g.Navigate
663
+ } = xe(re);
664
+ if (p === void 0)
665
+ throw new Error(B("useAuth"));
666
666
  if (b === void 0)
667
- throw new Error(q("useLocation"));
667
+ throw new Error(B("useLocation"));
668
668
  if (_ === void 0)
669
- throw new Error(q("Outlet"));
670
- if (y === void 0)
671
- throw new Error(q("Navigate"));
672
- const { isLogged: T } = o(), l = b();
673
- return T ? /* @__PURE__ */ Y(dr, { fallback: d, children: (v = (w = l.state) == null ? void 0 : w.from) != null && v.state && ((R = (h = l.state) == null ? void 0 : h.from) == null ? void 0 : R.pathname) === m ? /* @__PURE__ */ Y(y, { to: l.state.from.state.from.pathname + l.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ Y(_, {}) }) : /* @__PURE__ */ Y(y, { to: m, state: { from: l }, replace: !0 });
669
+ throw new Error(B("Outlet"));
670
+ if (i === void 0)
671
+ throw new Error(B("Navigate"));
672
+ const { isLogged: T } = p(), f = b();
673
+ return T ? /* @__PURE__ */ Y(dr, { fallback: d, children: (v = (w = f.state) == null ? void 0 : w.from) != null && v.state && ((R = (h = f.state) == null ? void 0 : h.from) == null ? void 0 : R.pathname) === y ? /* @__PURE__ */ Y(i, { to: f.state.from.state.from.pathname + f.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ Y(_, {}) }) : /* @__PURE__ */ Y(i, { to: y, state: { from: f }, replace: !0 });
674
674
  }, br = (d) => {
675
- const { unknownErrorTranslationKey: m = "error.unknownError" } = d || {}, { translate: g = d == null ? void 0 : d.translate } = Pe(ee);
675
+ const { unknownErrorTranslationKey: y = "error.unknownError" } = d || {}, { translate: g = d == null ? void 0 : d.translate } = xe(re);
676
676
  return { printError: vr(
677
- (o) => {
678
- var y, T, l, w, v, h, R, P, D;
679
- const _ = g ? g(m) : "Unknown error";
680
- return (y = o == null ? void 0 : o.data) != null && y.reason ? String(o.data.reason) : (T = o == null ? void 0 : o.data) != null && T.message ? String(o.data.message) : (w = (l = o == null ? void 0 : o.data) == null ? void 0 : l.detail) != null && w.length && Array.isArray((v = o == null ? void 0 : o.data) == null ? void 0 : v.detail) && ((R = (h = o == null ? void 0 : o.data) == null ? void 0 : h.detail[0]) != null && R.msg) && typeof ((D = (P = o == null ? void 0 : o.data) == null ? void 0 : P.detail[0]) == null ? void 0 : D.msg) == "string" ? String(o.data.detail[0].msg) : _;
677
+ (p) => {
678
+ var T, f, w, v, h, R, P, D, L;
679
+ const _ = g ? g(y) : "Unknown error", { response: i } = p || {};
680
+ return p != null && p.reason ? String(p.reason) : (T = i == null ? void 0 : i.data) != null && T.reason ? String(i.data.reason) : (f = i == null ? void 0 : i.data) != null && f.message ? String(i.data.message) : (v = (w = i == null ? void 0 : i.data) == null ? void 0 : w.detail) != null && v.length && Array.isArray((h = i == null ? void 0 : i.data) == null ? void 0 : h.detail) && ((P = (R = i == null ? void 0 : i.data) == null ? void 0 : R.detail[0]) != null && P.msg) && typeof ((L = (D = i == null ? void 0 : i.data) == null ? void 0 : D.detail[0]) == null ? void 0 : L.msg) == "string" ? String(i.data.detail[0].msg) : _;
681
681
  },
682
- [g, m]
682
+ [g, y]
683
683
  ) };
684
684
  };
685
685
  export {
686
- ee as InjectDependenciesContext,
686
+ re as InjectDependenciesContext,
687
687
  mr as InjectDependenciesProvider,
688
688
  yr as RequireAuth,
689
689
  br as useResponseError
package/dist/main.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(S,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],_):(S=typeof globalThis<"u"?globalThis:S||self,_(S["@tracktor/shared-module"]={},S.React))})(this,function(S,_){"use strict";var z={},je={get exports(){return z},set exports(d){z=d}},I={};/**
1
+ (function(S,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],_):(S=typeof globalThis<"u"?globalThis:S||self,_(S["@tracktor/shared-module"]={},S.React))})(this,function(S,_){"use strict";var K={},xe={get exports(){return K},set exports(d){K=d}},I={};/**
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 ne;function xe(){if(ne)return I;ne=1;var d=_,m=Symbol.for("react.element"),g=Symbol.for("react.fragment"),b=Object.prototype.hasOwnProperty,o=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,T={key:!0,ref:!0,__self:!0,__source:!0};function y(w,c,O){var v,h={},R=null,x=null;O!==void 0&&(R=""+O),c.key!==void 0&&(R=""+c.key),c.ref!==void 0&&(x=c.ref);for(v in c)b.call(c,v)&&!T.hasOwnProperty(v)&&(h[v]=c[v]);if(w&&w.defaultProps)for(v in c=w.defaultProps,c)h[v]===void 0&&(h[v]=c[v]);return{$$typeof:m,type:w,key:R,ref:x,props:h,_owner:o.current}}return I.Fragment=g,I.jsx=y,I.jsxs=y,I}var W={};/**
9
+ */var ae;function ke(){if(ae)return I;ae=1;var d=_,y=Symbol.for("react.element"),g=Symbol.for("react.fragment"),b=Object.prototype.hasOwnProperty,p=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,T={key:!0,ref:!0,__self:!0,__source:!0};function i(w,f,O){var v,h={},R=null,x=null;O!==void 0&&(R=""+O),f.key!==void 0&&(R=""+f.key),f.ref!==void 0&&(x=f.ref);for(v in f)b.call(f,v)&&!T.hasOwnProperty(v)&&(h[v]=f[v]);if(w&&w.defaultProps)for(v in f=w.defaultProps,f)h[v]===void 0&&(h[v]=f[v]);return{$$typeof:y,type:w,key:R,ref:x,props:h,_owner:p.current}}return I.Fragment=g,I.jsx=i,I.jsxs=i,I}var W={};/**
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 ae;function ke(){return ae||(ae=1,process.env.NODE_ENV!=="production"&&function(){var d=_,m=Symbol.for("react.element"),g=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),w=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),L=Symbol.iterator,Ie="@@iterator";function We(e){if(e===null||typeof e!="object")return null;var r=L&&e[L]||e[Ie];return typeof r=="function"?r:null}var D=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ye("error",e,t)}}function Ye(e,r,t){{var n=D.ReactDebugCurrentFrame,u=n.getStackAddendum();u!==""&&(r+="%s",t=t.concat([u]));var f=t.map(function(i){return String(i)});f.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,f)}}var Le=!1,Ne=!1,Me=!1,Ue=!1,Ve=!1,ie;ie=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===b||e===T||Ve||e===o||e===O||e===v||Ue||e===x||Le||Ne||Me||typeof e=="object"&&e!==null&&(e.$$typeof===R||e.$$typeof===h||e.$$typeof===y||e.$$typeof===w||e.$$typeof===c||e.$$typeof===ie||e.getModuleId!==void 0))}function Be(e,r,t){var n=e.displayName;if(n)return n;var u=r.displayName||r.name||"";return u!==""?t+"("+u+")":t}function oe(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&p("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 b:return"Fragment";case g:return"Portal";case T:return"Profiler";case o:return"StrictMode";case O:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w:var r=e;return oe(r)+".Consumer";case y:var t=e;return oe(t._context)+".Provider";case c:return Be(e,e.render,"ForwardRef");case h:var n=e.displayName||null;return n!==null?n:P(e.type)||"Memo";case R:{var u=e,f=u._payload,i=u._init;try{return P(i(f))}catch{return null}}}return null}var k=Object.assign,N=0,ue,fe,ce,le,se,de,ve;function ge(){}ge.__reactDisabledLog=!0;function Je(){{if(N===0){ue=console.log,fe=console.info,ce=console.warn,le=console.error,se=console.group,de=console.groupCollapsed,ve=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ge,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}}function Ge(){{if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:ue}),info:k({},e,{value:fe}),warn:k({},e,{value:ce}),error:k({},e,{value:le}),group:k({},e,{value:se}),groupCollapsed:k({},e,{value:de}),groupEnd:k({},e,{value:ve})})}N<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=D.ReactCurrentDispatcher,H;function $(e,r,t){{if(H===void 0)try{throw Error()}catch(u){var n=u.stack.trim().match(/\n( *(at )?)/);H=n&&n[1]||""}return`
18
- `+H+e}}var X=!1,B;{var qe=typeof WeakMap=="function"?WeakMap:Map;B=new qe}function he(e,r){if(!e||X)return"";{var t=B.get(e);if(t!==void 0)return t}var n;X=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=K.current,K.current=null,Je();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(j){n=j}Reflect.construct(e,[],i)}else{try{i.call()}catch(j){n=j}e.call(i.prototype)}}else{try{throw Error()}catch(j){n=j}e()}}catch(j){if(j&&n&&typeof j.stack=="string"){for(var a=j.stack.split(`
19
- `),E=n.stack.split(`
20
- `),l=a.length-1,s=E.length-1;l>=1&&s>=0&&a[l]!==E[s];)s--;for(;l>=1&&s>=0;l--,s--)if(a[l]!==E[s]){if(l!==1||s!==1)do if(l--,s--,s<0||a[l]!==E[s]){var C=`
21
- `+a[l].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),typeof e=="function"&&B.set(e,C),C}while(l>=1&&s>=0);break}}}finally{X=!1,K.current=f,Ge(),Error.prepareStackTrace=u}var F=e?e.displayName||e.name:"",Pe=F?$(F):"";return typeof e=="function"&&B.set(e,Pe),Pe}function ze(e,r,t){return he(e,!1)}function Ke(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function J(e,r,t){if(e==null)return"";if(typeof e=="function")return he(e,Ke(e));if(typeof e=="string")return $(e);switch(e){case O:return $("Suspense");case v:return $("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return ze(e.render);case h:return J(e.type,r,t);case R:{var n=e,u=n._payload,f=n._init;try{return J(f(u),r,t)}catch{}}}return""}var G=Object.prototype.hasOwnProperty,pe={},Ee=D.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}function He(e,r,t,n,u){{var f=Function.call.bind(G);for(var i in e)if(f(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var E=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw E.name="Invariant Violation",E}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(q(u),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).",n||"React class",t,i,typeof a),q(null)),a instanceof Error&&!(a.message in pe)&&(pe[a.message]=!0,q(u),p("Failed %s type: %s",t,a.message),q(null))}}}var Xe=Array.isArray;function Z(e){return Xe(e)}function Ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Qe(e){try{return me(e),!1}catch{return!0}}function me(e){return""+e}function ye(e){if(Qe(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ze(e)),me(e)}var M=D.ReactCurrentOwner,er={key:!0,ref:!0,__self:!0,__source:!0},be,Re,Q;Q={};function rr(e){if(G.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function tr(e){if(G.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function nr(e,r){if(typeof e.ref=="string"&&M.current&&r&&M.current.stateNode!==r){var t=P(M.current.type);Q[t]||(p('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(M.current.type),e.ref),Q[t]=!0)}}function ar(e,r){{var t=function(){be||(be=!0,p("%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 ir(e,r){{var t=function(){Re||(Re=!0,p("%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 or=function(e,r,t,n,u,f,i){var a={$$typeof:m,type:e,key:r,ref:t,props:i,_owner:f};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ur(e,r,t,n,u){{var f,i={},a=null,E=null;t!==void 0&&(ye(t),a=""+t),tr(r)&&(ye(r.key),a=""+r.key),rr(r)&&(E=r.ref,nr(r,u));for(f in r)G.call(r,f)&&!er.hasOwnProperty(f)&&(i[f]=r[f]);if(e&&e.defaultProps){var l=e.defaultProps;for(f in l)i[f]===void 0&&(i[f]=l[f])}if(a||E){var s=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ar(i,s),E&&ir(i,s)}return or(e,a,E,u,n,M.current,i)}}var ee=D.ReactCurrentOwner,_e=D.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=J(e.type,e._source,r?r.type:null);_e.setExtraStackFrame(t)}else _e.setExtraStackFrame(null)}var re;re=!1;function te(e){return typeof e=="object"&&e!==null&&e.$$typeof===m}function Te(){{if(ee.current){var e=P(ee.current.type);if(e)return`
17
+ */var oe;function De(){return oe||(oe=1,process.env.NODE_ENV!=="production"&&function(){var d=_,y=Symbol.for("react.element"),g=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),w=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),L=Symbol.iterator,$="@@iterator";function We(e){if(e===null||typeof e!="object")return null;var r=L&&e[L]||e[$];return typeof r=="function"?r:null}var D=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ye("error",e,t)}}function Ye(e,r,t){{var n=D.ReactDebugCurrentFrame,u=n.getStackAddendum();u!==""&&(r+="%s",t=t.concat([u]));var s=t.map(function(o){return String(o)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var Le=!1,Ne=!1,Me=!1,Ue=!1,Ve=!1,ie;ie=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===b||e===T||Ve||e===p||e===O||e===v||Ue||e===x||Le||Ne||Me||typeof e=="object"&&e!==null&&(e.$$typeof===R||e.$$typeof===h||e.$$typeof===i||e.$$typeof===w||e.$$typeof===f||e.$$typeof===ie||e.getModuleId!==void 0))}function Be(e,r,t){var n=e.displayName;if(n)return n;var u=r.displayName||r.name||"";return u!==""?t+"("+u+")":t}function ue(e){return e.displayName||"Context"}function P(e){if(e==null)return null;if(typeof e.tag=="number"&&E("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 b:return"Fragment";case g:return"Portal";case T:return"Profiler";case p:return"StrictMode";case O:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w:var r=e;return ue(r)+".Consumer";case i:var t=e;return ue(t._context)+".Provider";case f:return Be(e,e.render,"ForwardRef");case h:var n=e.displayName||null;return n!==null?n:P(e.type)||"Memo";case R:{var u=e,s=u._payload,o=u._init;try{return P(o(s))}catch{return null}}}return null}var k=Object.assign,N=0,se,fe,ce,le,de,ve,pe;function ge(){}ge.__reactDisabledLog=!0;function Je(){{if(N===0){se=console.log,fe=console.info,ce=console.warn,le=console.error,de=console.group,ve=console.groupCollapsed,pe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ge,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}}function Ge(){{if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:se}),info:k({},e,{value:fe}),warn:k({},e,{value:ce}),error:k({},e,{value:le}),group:k({},e,{value:de}),groupCollapsed:k({},e,{value:ve}),groupEnd:k({},e,{value:pe})})}N<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var H=D.ReactCurrentDispatcher,X;function B(e,r,t){{if(X===void 0)try{throw Error()}catch(u){var n=u.stack.trim().match(/\n( *(at )?)/);X=n&&n[1]||""}return`
18
+ `+X+e}}var Z=!1,J;{var qe=typeof WeakMap=="function"?WeakMap:Map;J=new qe}function he(e,r){if(!e||Z)return"";{var t=J.get(e);if(t!==void 0)return t}var n;Z=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=H.current,H.current=null,Je();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(j){n=j}Reflect.construct(e,[],o)}else{try{o.call()}catch(j){n=j}e.call(o.prototype)}}else{try{throw Error()}catch(j){n=j}e()}}catch(j){if(j&&n&&typeof j.stack=="string"){for(var a=j.stack.split(`
19
+ `),m=n.stack.split(`
20
+ `),c=a.length-1,l=m.length-1;c>=1&&l>=0&&a[c]!==m[l];)l--;for(;c>=1&&l>=0;c--,l--)if(a[c]!==m[l]){if(c!==1||l!==1)do if(c--,l--,l<0||a[c]!==m[l]){var C=`
21
+ `+a[c].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),typeof e=="function"&&J.set(e,C),C}while(c>=1&&l>=0);break}}}finally{Z=!1,H.current=s,Ge(),Error.prepareStackTrace=u}var F=e?e.displayName||e.name:"",je=F?B(F):"";return typeof e=="function"&&J.set(e,je),je}function ze(e,r,t){return he(e,!1)}function Ke(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function G(e,r,t){if(e==null)return"";if(typeof e=="function")return he(e,Ke(e));if(typeof e=="string")return B(e);switch(e){case O:return B("Suspense");case v:return B("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return ze(e.render);case h:return G(e.type,r,t);case R:{var n=e,u=n._payload,s=n._init;try{return G(s(u),r,t)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,Ee={},me=D.ReactDebugCurrentFrame;function z(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);me.setExtraStackFrame(t)}else me.setExtraStackFrame(null)}function He(e,r,t,n,u){{var s=Function.call.bind(q);for(var o in e)if(s(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var m=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){a=c}a&&!(a instanceof Error)&&(z(u),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).",n||"React class",t,o,typeof a),z(null)),a instanceof Error&&!(a.message in Ee)&&(Ee[a.message]=!0,z(u),E("Failed %s type: %s",t,a.message),z(null))}}}var Xe=Array.isArray;function Q(e){return Xe(e)}function Ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Qe(e){try{return ye(e),!1}catch{return!0}}function ye(e){return""+e}function be(e){if(Qe(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ze(e)),ye(e)}var M=D.ReactCurrentOwner,er={key:!0,ref:!0,__self:!0,__source:!0},Re,_e,ee;ee={};function rr(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 tr(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 nr(e,r){if(typeof e.ref=="string"&&M.current&&r&&M.current.stateNode!==r){var t=P(M.current.type);ee[t]||(E('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(M.current.type),e.ref),ee[t]=!0)}}function ar(e,r){{var t=function(){Re||(Re=!0,E("%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 or(e,r){{var t=function(){_e||(_e=!0,E("%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 ir=function(e,r,t,n,u,s,o){var a={$$typeof:y,type:e,key:r,ref:t,props:o,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function ur(e,r,t,n,u){{var s,o={},a=null,m=null;t!==void 0&&(be(t),a=""+t),tr(r)&&(be(r.key),a=""+r.key),rr(r)&&(m=r.ref,nr(r,u));for(s in r)q.call(r,s)&&!er.hasOwnProperty(s)&&(o[s]=r[s]);if(e&&e.defaultProps){var c=e.defaultProps;for(s in c)o[s]===void 0&&(o[s]=c[s])}if(a||m){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ar(o,l),m&&or(o,l)}return ir(e,a,m,u,n,M.current,o)}}var re=D.ReactCurrentOwner,Te=D.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}var te;te=!1;function ne(e){return typeof e=="object"&&e!==null&&e.$$typeof===y}function we(){{if(re.current){var e=P(re.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function fr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
23
+ Check the render method of \``+e+"`."}return""}}function sr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
24
24
 
25
- Check your code at `+r+":"+t+"."}return""}}var we={};function cr(e){{var r=Te();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
25
+ Check your code at `+r+":"+t+"."}return""}}var Oe={};function fr(e){{var r=we();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 Oe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=cr(r);if(we[t])return;we[t]=!0;var n="";e&&e._owner&&e._owner!==ee.current&&(n=" It was passed a child from "+P(e._owner.type)+"."),A(e),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),A(null)}}function Ce(e,r){{if(typeof e!="object")return;if(Z(e))for(var t=0;t<e.length;t++){var n=e[t];te(n)&&Oe(n,r)}else if(te(e))e._store&&(e._store.validated=!0);else if(e){var u=We(e);if(typeof u=="function"&&u!==e.entries)for(var f=u.call(e),i;!(i=f.next()).done;)te(i.value)&&Oe(i.value,r)}}}function lr(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===h))t=r.propTypes;else return;if(t){var n=P(r);He(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!re){re=!0;var u=P(r);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),p("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}function Se(e,r,t,n,u,f){{var i=$e(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 E=fr(u);E?a+=E:a+=Te();var l;e===null?l="null":Z(e)?l="array":e!==void 0&&e.$$typeof===m?(l="<"+(P(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var s=ur(e,r,t,u,f);if(s==null)return s;if(i){var C=r.children;if(C!==void 0)if(n)if(Z(C)){for(var F=0;F<C.length;F++)Ce(C[F],e);Object.freeze&&Object.freeze(C)}else p("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 Ce(C,e)}return e===b?sr(s):lr(s),s}}function dr(e,r,t){return Se(e,r,t,!0)}function vr(e,r,t){return Se(e,r,t,!1)}var gr=vr,hr=dr;W.Fragment=b,W.jsx=gr,W.jsxs=hr}()),W}(function(d){process.env.NODE_ENV==="production"?d.exports=xe():d.exports=ke()})(je);const Y=z.jsx,U=_.createContext({children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),De=({children:d,translate:m,useAuth:g,Outlet:b,Navigate:o,useLocation:T})=>{const y=_.useMemo(()=>({Navigate:o,Outlet:b,translate:m,useAuth:g,useLocation:T}),[o,b,m,g,T]);return Y(U.Provider,{value:y,children:d})},V=d=>`RequireAuth require « ${d} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ae=({Fallback:d,loginPath:m="/login",...g})=>{var O,v,h,R;const{useLocation:b=g.useLocation,useAuth:o=g.useAuth,Outlet:T=g.Outlet,Navigate:y=g.Navigate}=_.useContext(U);if(o===void 0)throw new Error(V("useAuth"));if(b===void 0)throw new Error(V("useLocation"));if(T===void 0)throw new Error(V("Outlet"));if(y===void 0)throw new Error(V("Navigate"));const{isLogged:w}=o(),c=b();return w?Y(_.Suspense,{fallback:d,children:(v=(O=c.state)==null?void 0:O.from)!=null&&v.state&&((R=(h=c.state)==null?void 0:h.from)==null?void 0:R.pathname)===m?Y(y,{to:c.state.from.state.from.pathname+c.state.from.state.from.search,replace:!0}):Y(T,{})}):Y(y,{to:m,state:{from:c},replace:!0})},Fe=d=>{const{unknownErrorTranslationKey:m="error.unknownError"}=d||{},{translate:g=d==null?void 0:d.translate}=_.useContext(U);return{printError:_.useCallback(o=>{var y,w,c,O,v,h,R,x,L;const T=g?g(m):"Unknown error";return(y=o==null?void 0:o.data)!=null&&y.reason?String(o.data.reason):(w=o==null?void 0:o.data)!=null&&w.message?String(o.data.message):(O=(c=o==null?void 0:o.data)==null?void 0:c.detail)!=null&&O.length&&Array.isArray((v=o==null?void 0:o.data)==null?void 0:v.detail)&&((R=(h=o==null?void 0:o.data)==null?void 0:h.detail[0])!=null&&R.msg)&&typeof((L=(x=o==null?void 0:o.data)==null?void 0:x.detail[0])==null?void 0:L.msg)=="string"?String(o.data.detail[0].msg):T},[g,m])}};S.InjectDependenciesContext=U,S.InjectDependenciesProvider=De,S.RequireAuth=Ae,S.useResponseError=Fe,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
27
+ Check the top-level render call using <`+t+">.")}return r}}function Ce(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=fr(r);if(Oe[t])return;Oe[t]=!0;var n="";e&&e._owner&&e._owner!==re.current&&(n=" It was passed a child from "+P(e._owner.type)+"."),A(e),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,n),A(null)}}function Se(e,r){{if(typeof e!="object")return;if(Q(e))for(var t=0;t<e.length;t++){var n=e[t];ne(n)&&Ce(n,r)}else if(ne(e))e._store&&(e._store.validated=!0);else if(e){var u=We(e);if(typeof u=="function"&&u!==e.entries)for(var s=u.call(e),o;!(o=s.next()).done;)ne(o.value)&&Ce(o.value,r)}}}function cr(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===f||r.$$typeof===h))t=r.propTypes;else return;if(t){var n=P(r);He(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!te){te=!0;var u=P(r);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function lr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}function Pe(e,r,t,n,u,s){{var o=$e(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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 m=sr(u);m?a+=m:a+=we();var c;e===null?c="null":Q(e)?c="array":e!==void 0&&e.$$typeof===y?(c="<"+(P(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):c=typeof e,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,a)}var l=ur(e,r,t,u,s);if(l==null)return l;if(o){var C=r.children;if(C!==void 0)if(n)if(Q(C)){for(var F=0;F<C.length;F++)Se(C[F],e);Object.freeze&&Object.freeze(C)}else E("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 Se(C,e)}return e===b?lr(l):cr(l),l}}function dr(e,r,t){return Pe(e,r,t,!0)}function vr(e,r,t){return Pe(e,r,t,!1)}var pr=vr,gr=dr;W.Fragment=b,W.jsx=pr,W.jsxs=gr}()),W}(function(d){process.env.NODE_ENV==="production"?d.exports=ke():d.exports=De()})(xe);const Y=K.jsx,U=_.createContext({children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Ae=({children:d,translate:y,useAuth:g,Outlet:b,Navigate:p,useLocation:T})=>{const i=_.useMemo(()=>({Navigate:p,Outlet:b,translate:y,useAuth:g,useLocation:T}),[p,b,y,g,T]);return Y(U.Provider,{value:i,children:d})},V=d=>`RequireAuth require « ${d} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Fe=({Fallback:d,loginPath:y="/login",...g})=>{var O,v,h,R;const{useLocation:b=g.useLocation,useAuth:p=g.useAuth,Outlet:T=g.Outlet,Navigate:i=g.Navigate}=_.useContext(U);if(p===void 0)throw new Error(V("useAuth"));if(b===void 0)throw new Error(V("useLocation"));if(T===void 0)throw new Error(V("Outlet"));if(i===void 0)throw new Error(V("Navigate"));const{isLogged:w}=p(),f=b();return w?Y(_.Suspense,{fallback:d,children:(v=(O=f.state)==null?void 0:O.from)!=null&&v.state&&((R=(h=f.state)==null?void 0:h.from)==null?void 0:R.pathname)===y?Y(i,{to:f.state.from.state.from.pathname+f.state.from.state.from.search,replace:!0}):Y(T,{})}):Y(i,{to:y,state:{from:f},replace:!0})},Ie=d=>{const{unknownErrorTranslationKey:y="error.unknownError"}=d||{},{translate:g=d==null?void 0:d.translate}=_.useContext(U);return{printError:_.useCallback(p=>{var w,f,O,v,h,R,x,L,$;const T=g?g(y):"Unknown error",{response:i}=p||{};return p!=null&&p.reason?String(p.reason):(w=i==null?void 0:i.data)!=null&&w.reason?String(i.data.reason):(f=i==null?void 0:i.data)!=null&&f.message?String(i.data.message):(v=(O=i==null?void 0:i.data)==null?void 0:O.detail)!=null&&v.length&&Array.isArray((h=i==null?void 0:i.data)==null?void 0:h.detail)&&((x=(R=i==null?void 0:i.data)==null?void 0:R.detail[0])!=null&&x.msg)&&typeof(($=(L=i==null?void 0:i.data)==null?void 0:L.detail[0])==null?void 0:$.msg)=="string"?String(i.data.detail[0].msg):T},[g,y])}};S.InjectDependenciesContext=U,S.InjectDependenciesProvider=Ae,S.RequireAuth=Fe,S.useResponseError=Ie,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",