@tracktor/shared-module 0.7.1 → 0.7.2

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.7.1
4
- - **[fix]** : Add `MapBoxConfig` component export
3
+ ## v0.7.2
4
+ - **[fix]** : Improve `MapBoxConfig` component
package/dist/main.js CHANGED
@@ -21,16 +21,16 @@ function yr() {
21
21
  if (De)
22
22
  return M;
23
23
  De = 1;
24
- var n = Ie, l = Symbol.for("react.element"), g = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, c = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
24
+ var n = Ie, u = Symbol.for("react.element"), g = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, c = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
25
25
  function i(y, p, T) {
26
26
  var b, _ = {}, O = null, w = null;
27
27
  T !== void 0 && (O = "" + T), p.key !== void 0 && (O = "" + p.key), p.ref !== void 0 && (w = p.ref);
28
28
  for (b in p)
29
- h.call(p, b) && !u.hasOwnProperty(b) && (_[b] = p[b]);
29
+ h.call(p, b) && !s.hasOwnProperty(b) && (_[b] = p[b]);
30
30
  if (y && y.defaultProps)
31
31
  for (b in p = y.defaultProps, p)
32
32
  _[b] === void 0 && (_[b] = p[b]);
33
- return { $$typeof: l, type: y, key: O, ref: w, props: _, _owner: c.current };
33
+ return { $$typeof: u, type: y, key: O, ref: w, props: _, _owner: c.current };
34
34
  }
35
35
  return M.Fragment = g, M.jsx = i, M.jsxs = i, M;
36
36
  }
@@ -47,7 +47,7 @@ var N = {};
47
47
  var Fe;
48
48
  function br() {
49
49
  return Fe || (Fe = 1, process.env.NODE_ENV !== "production" && function() {
50
- var n = Ie, l = Symbol.for("react.element"), g = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), y = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), x = Symbol.iterator, A = "@@iterator";
50
+ var n = Ie, u = Symbol.for("react.element"), g = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), y = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), x = Symbol.iterator, A = "@@iterator";
51
51
  function W(e) {
52
52
  if (e === null || typeof e != "object")
53
53
  return null;
@@ -66,8 +66,8 @@ function br() {
66
66
  {
67
67
  var a = S.ReactDebugCurrentFrame, d = a.getStackAddendum();
68
68
  d !== "" && (r += "%s", t = t.concat([d]));
69
- var v = t.map(function(s) {
70
- return String(s);
69
+ var v = t.map(function(l) {
70
+ return String(l);
71
71
  });
72
72
  v.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, v);
73
73
  }
@@ -75,7 +75,7 @@ function br() {
75
75
  var se = !1, Y = !1, $e = !1, Me = !1, Ne = !1, le;
76
76
  le = Symbol.for("react.module.reference");
77
77
  function We(e) {
78
- return !!(typeof e == "string" || typeof e == "function" || e === h || e === u || Ne || e === c || e === T || e === b || Me || e === w || se || Y || $e || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === _ || e.$$typeof === i || e.$$typeof === y || e.$$typeof === p || // This needs to include all possible module reference object
78
+ return !!(typeof e == "string" || typeof e == "function" || e === h || e === s || Ne || e === c || e === T || e === b || Me || e === w || se || Y || $e || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === _ || e.$$typeof === i || e.$$typeof === y || e.$$typeof === p || // 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.
@@ -103,7 +103,7 @@ function br() {
103
103
  return "Fragment";
104
104
  case g:
105
105
  return "Portal";
106
- case u:
106
+ case s:
107
107
  return "Profiler";
108
108
  case c:
109
109
  return "StrictMode";
@@ -126,9 +126,9 @@ function br() {
126
126
  var a = e.displayName || null;
127
127
  return a !== null ? a : P(e.type) || "Memo";
128
128
  case O: {
129
- var d = e, v = d._payload, s = d._init;
129
+ var d = e, v = d._payload, l = d._init;
130
130
  try {
131
- return P(s(v));
131
+ return P(l(v));
132
132
  } catch {
133
133
  return null;
134
134
  }
@@ -233,27 +233,27 @@ function br() {
233
233
  v = K.current, K.current = null, Ve();
234
234
  try {
235
235
  if (r) {
236
- var s = function() {
236
+ var l = function() {
237
237
  throw Error();
238
238
  };
239
- if (Object.defineProperty(s.prototype, "props", {
239
+ if (Object.defineProperty(l.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(s, []);
245
+ Reflect.construct(l, []);
246
246
  } catch (j) {
247
247
  a = j;
248
248
  }
249
- Reflect.construct(e, [], s);
249
+ Reflect.construct(e, [], l);
250
250
  } else {
251
251
  try {
252
- s.call();
252
+ l.call();
253
253
  } catch (j) {
254
254
  a = j;
255
255
  }
256
- e.call(s.prototype);
256
+ e.call(l.prototype);
257
257
  }
258
258
  } else {
259
259
  try {
@@ -335,19 +335,19 @@ function br() {
335
335
  function ze(e, r, t, a, d) {
336
336
  {
337
337
  var v = Function.call.bind(B);
338
- for (var s in e)
339
- if (v(e, s)) {
338
+ for (var l in e)
339
+ if (v(e, l)) {
340
340
  var o = void 0;
341
341
  try {
342
- if (typeof e[s] != "function") {
343
- var R = Error((a || "React class") + ": " + t + " type `" + s + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[s] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
342
+ if (typeof e[l] != "function") {
343
+ var R = Error((a || "React class") + ": " + t + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
344
  throw R.name = "Invariant Violation", R;
345
345
  }
346
- o = e[s](r, s, a, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
346
+ o = e[l](r, l, a, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
347
  } catch (m) {
348
348
  o = m;
349
349
  }
350
- o && !(o instanceof Error) && (G(d), f("%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).", a || "React class", t, s, typeof o), G(null)), o instanceof Error && !(o.message in be) && (be[o.message] = !0, G(d), f("Failed %s type: %s", t, o.message), G(null));
350
+ o && !(o instanceof Error) && (G(d), f("%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).", a || "React class", t, l, typeof o), G(null)), o instanceof Error && !(o.message in be) && (be[o.message] = !0, G(d), f("Failed %s type: %s", t, o.message), G(null));
351
351
  }
352
352
  }
353
353
  }
@@ -426,15 +426,15 @@ function br() {
426
426
  });
427
427
  }
428
428
  }
429
- var nr = function(e, r, t, a, d, v, s) {
429
+ var nr = function(e, r, t, a, d, v, l) {
430
430
  var o = {
431
431
  // This tag allows us to uniquely identify this as a React Element
432
- $$typeof: l,
432
+ $$typeof: u,
433
433
  // Built-in properties that belong on the element
434
434
  type: e,
435
435
  key: r,
436
436
  ref: t,
437
- props: s,
437
+ props: l,
438
438
  // Record the component responsible for creating this element.
439
439
  _owner: v
440
440
  };
@@ -457,20 +457,20 @@ function br() {
457
457
  };
458
458
  function ar(e, r, t, a, d) {
459
459
  {
460
- var v, s = {}, o = null, R = null;
460
+ var v, l = {}, o = null, R = null;
461
461
  t !== void 0 && (Te(t), o = "" + t), Ze(r) && (Te(r.key), o = "" + r.key), Qe(r) && (R = r.ref, er(r, d));
462
462
  for (v in r)
463
- B.call(r, v) && !Xe.hasOwnProperty(v) && (s[v] = r[v]);
463
+ B.call(r, v) && !Xe.hasOwnProperty(v) && (l[v] = r[v]);
464
464
  if (e && e.defaultProps) {
465
465
  var m = e.defaultProps;
466
466
  for (v in m)
467
- s[v] === void 0 && (s[v] = m[v]);
467
+ l[v] === void 0 && (l[v] = m[v]);
468
468
  }
469
469
  if (o || R) {
470
470
  var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
471
- o && rr(s, E), R && tr(s, E);
471
+ o && rr(l, E), R && tr(l, E);
472
472
  }
473
- return nr(e, o, R, d, a, $.current, s);
473
+ return nr(e, o, R, d, a, $.current, l);
474
474
  }
475
475
  }
476
476
  var re = S.ReactCurrentOwner, Ce = S.ReactDebugCurrentFrame;
@@ -484,7 +484,7 @@ function br() {
484
484
  var te;
485
485
  te = !1;
486
486
  function ne(e) {
487
- return typeof e == "object" && e !== null && e.$$typeof === l;
487
+ return typeof e == "object" && e !== null && e.$$typeof === u;
488
488
  }
489
489
  function Se() {
490
490
  {
@@ -549,8 +549,8 @@ Check the top-level render call using <` + t + ">.");
549
549
  else if (e) {
550
550
  var d = W(e);
551
551
  if (typeof d == "function" && d !== e.entries)
552
- for (var v = d.call(e), s; !(s = v.next()).done; )
553
- ne(s.value) && je(s.value, r);
552
+ for (var v = d.call(e), l; !(l = v.next()).done; )
553
+ ne(l.value) && je(l.value, r);
554
554
  }
555
555
  }
556
556
  }
@@ -593,19 +593,19 @@ Check the top-level render call using <` + t + ">.");
593
593
  }
594
594
  function xe(e, r, t, a, d, v) {
595
595
  {
596
- var s = We(e);
597
- if (!s) {
596
+ var l = We(e);
597
+ if (!l) {
598
598
  var o = "";
599
599
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " 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
600
  var R = or(d);
601
601
  R ? o += R : o += Se();
602
602
  var m;
603
- e === null ? m = "null" : Z(e) ? m = "array" : e !== void 0 && e.$$typeof === l ? (m = "<" + (P(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : m = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", m, o);
603
+ e === null ? m = "null" : Z(e) ? m = "array" : e !== void 0 && e.$$typeof === u ? (m = "<" + (P(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : m = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", m, o);
604
604
  }
605
605
  var E = ar(e, r, t, d, v);
606
606
  if (E == null)
607
607
  return E;
608
- if (s) {
608
+ if (l) {
609
609
  var C = r.children;
610
610
  if (C !== void 0)
611
611
  if (a)
@@ -644,37 +644,37 @@ const k = oe.jsx, H = vr({
644
644
  useLocation: void 0
645
645
  }), _r = ({
646
646
  axios: n,
647
- children: l,
647
+ children: u,
648
648
  translate: g,
649
649
  useAuth: h,
650
650
  Outlet: c,
651
- Navigate: u,
651
+ Navigate: s,
652
652
  useLocation: i,
653
653
  useGoogleTagManager: y
654
654
  }) => {
655
655
  const p = Le(
656
656
  () => ({
657
657
  axios: n,
658
- Navigate: u,
658
+ Navigate: s,
659
659
  Outlet: c,
660
660
  translate: g,
661
661
  useAuth: h,
662
662
  useGoogleTagManager: y,
663
663
  useLocation: i
664
664
  }),
665
- [u, c, n, g, h, y, i]
665
+ [s, c, n, g, h, y, i]
666
666
  );
667
- return /* @__PURE__ */ k(H.Provider, { value: p, children: l });
667
+ return /* @__PURE__ */ k(H.Provider, { value: p, children: u });
668
668
  }, z = (n) => `RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Tr = ({
669
669
  Fallback: n,
670
- loginPath: l = "/login",
670
+ loginPath: u = "/login",
671
671
  localStorageKey: g = "user",
672
672
  redirect401Path: h = "/login",
673
673
  ...c
674
674
  }) => {
675
675
  var x, A, W, S;
676
676
  const {
677
- axios: u = c.axios,
677
+ axios: s = c.axios,
678
678
  useLocation: i = c.useLocation,
679
679
  useAuth: y = c.useAuth,
680
680
  Outlet: p = c.Outlet,
@@ -690,54 +690,54 @@ const k = oe.jsx, H = vr({
690
690
  throw new Error(z("Navigate"));
691
691
  const [b, _] = pr(null), { isLogged: O } = y(), w = i();
692
692
  return J(() => {
693
- u == null || u.interceptors.response.use(
693
+ s == null || s.interceptors.response.use(
694
694
  (f) => f,
695
695
  async (f) => {
696
696
  var Y;
697
- return typeof f == "object" && f && "response" in f && f.response && typeof f.response == "object" && "status" in f.response && f.response && typeof f.response == "object" && "status" in f.response && ((Y = f == null ? void 0 : f.response) == null ? void 0 : Y.status) === 401 && (u.defaults.headers.common.Authorization = null, localStorage.removeItem(g), _(h)), Promise.reject(f);
697
+ return typeof f == "object" && f && "response" in f && f.response && typeof f.response == "object" && "status" in f.response && f.response && typeof f.response == "object" && "status" in f.response && ((Y = f == null ? void 0 : f.response) == null ? void 0 : Y.status) === 401 && (s.defaults.headers.common.Authorization = null, localStorage.removeItem(g), _(h)), Promise.reject(f);
698
698
  }
699
699
  );
700
- }, [u == null ? void 0 : u.defaults, u == null ? void 0 : u.interceptors.response, g, h]), O && !b ? /* @__PURE__ */ k(gr, { fallback: n, children: (A = (x = w.state) == null ? void 0 : x.from) != null && A.state && ((S = (W = w.state) == null ? void 0 : W.from) == null ? void 0 : S.pathname) === l ? /* @__PURE__ */ k(T, { to: w.state.from.state.from.pathname + w.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ k(p, {}) }) : /* @__PURE__ */ k(T, { to: l, state: { from: w }, replace: !0 });
700
+ }, [s == null ? void 0 : s.defaults, s == null ? void 0 : s.interceptors.response, g, h]), O && !b ? /* @__PURE__ */ k(gr, { fallback: n, children: (A = (x = w.state) == null ? void 0 : x.from) != null && A.state && ((S = (W = w.state) == null ? void 0 : W.from) == null ? void 0 : S.pathname) === u ? /* @__PURE__ */ k(T, { to: w.state.from.state.from.pathname + w.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ k(p, {}) }) : /* @__PURE__ */ k(T, { to: u, state: { from: w }, replace: !0 });
701
701
  }, ae = (n) => `GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, wr = ({ ...n }) => {
702
702
  const {
703
- useLocation: l = n.useLocation,
703
+ useLocation: u = n.useLocation,
704
704
  Outlet: g = n.Outlet,
705
705
  useGoogleTagManager: h = n.useGoogleTagManager
706
706
  } = ie(H);
707
- if (l === void 0)
707
+ if (u === void 0)
708
708
  throw new Error(ae("useLocation"));
709
709
  if (g === void 0)
710
710
  throw new Error(ae("Outlet"));
711
711
  if (h === void 0)
712
712
  throw new Error(ae("useGoogleTagManager"));
713
- const { pathname: c } = l(), { sendEvent: u } = h();
713
+ const { pathname: c } = u(), { sendEvent: s } = h();
714
714
  return hr(() => {
715
- u({ event: "pageView", pathname: c });
716
- }, [c, u]), /* @__PURE__ */ k(g, {});
715
+ s({ event: "pageView", pathname: c });
716
+ }, [c, s]), /* @__PURE__ */ k(g, {});
717
717
  }, Or = ({
718
718
  axios: n,
719
- baseURL: l,
719
+ baseURL: u,
720
720
  userLocalStorageKey: g = "user",
721
721
  postContentType: h = "application/json"
722
722
  }) => (J(() => {
723
723
  if (!n.defaults)
724
724
  return;
725
- const c = localStorage.getItem(g), u = c ? JSON.parse(c) : null, i = u && typeof u == "object" && "tokenType" in u && u.tokenType ? u.tokenType : null, y = u && typeof u == "object" && "accessToken" in u && u.accessToken ? u.accessToken : null, p = c ? `${i} ${y}` : null;
726
- n.defaults.baseURL = l, n.defaults.headers.post["Content-Type"] = h, p && (n.defaults.headers.common.Authorization = p);
725
+ const c = localStorage.getItem(g), s = c ? JSON.parse(c) : null, i = s && typeof s == "object" && "tokenType" in s && s.tokenType ? s.tokenType : null, y = s && typeof s == "object" && "accessToken" in s && s.accessToken ? s.accessToken : null, p = c ? `${i} ${y}` : null;
726
+ n.defaults.baseURL = u, n.defaults.headers.post["Content-Type"] = h, p && (n.defaults.headers.common.Authorization = p);
727
727
  }, [
728
728
  n.defaults,
729
729
  n.defaults.baseURL,
730
730
  n.defaults.headers.common,
731
731
  n.defaults.headers.post,
732
- l,
732
+ u,
733
733
  h,
734
734
  g
735
735
  ]), null), Cr = ({
736
736
  i18n: n,
737
- initReactI18next: l,
737
+ initReactI18next: u,
738
738
  resources: g,
739
739
  LanguageDetector: h
740
- }) => (n.use(h).use(l).init({
740
+ }) => (n.use(h).use(u).init({
741
741
  debug: !1,
742
742
  fallbackLng: "en",
743
743
  interpolation: {
@@ -753,24 +753,24 @@ const k = oe.jsx, H = vr({
753
753
  document.documentElement.lang !== n.resolvedLanguage && n.resolvedLanguage && document.documentElement.setAttribute("lang", n.resolvedLanguage);
754
754
  }), n.on("languageChanged", (c) => {
755
755
  document.documentElement.setAttribute("lang", c);
756
- }), null), Sr = ({ dsn: n, sentry: l }) => (J(() => {
757
- l && process.env.NODE_ENV !== "development" && l.init({
756
+ }), null), Sr = ({ dsn: n, sentry: u }) => (J(() => {
757
+ u && process.env.NODE_ENV !== "development" && u.init({
758
758
  dsn: n,
759
- integrations: [new l.BrowserTracing()],
759
+ integrations: [new u.BrowserTracing()],
760
760
  tracesSampleRate: 1
761
761
  });
762
- }, [n, l]), null), Pr = ({ IMaskMixin: n, ...l }) => {
762
+ }, [n, u]), null), Pr = ({ IMaskMixin: n, ...u }) => {
763
763
  const g = Le(
764
764
  // eslint-disable-next-line react/jsx-props-no-spreading
765
765
  () => n(({ TextField: h, ...c }) => /* @__PURE__ */ k(h, { ...c })),
766
766
  [n]
767
767
  );
768
- return /* @__PURE__ */ k(g, { ...l });
769
- }, jr = ({ mapbox: n, accessToken: l }) => (J(() => {
770
- n && (n.accessToken = l || "");
771
- }, [l, n]), null), kr = ({
768
+ return /* @__PURE__ */ k(g, { ...u });
769
+ }, jr = ({ mapbox: n, accessToken: u }) => (J(() => {
770
+ n && u && (n.accessToken = u);
771
+ }, [u, n]), null), kr = ({
772
772
  children: n,
773
- defaultOptions: l,
773
+ defaultOptions: u,
774
774
  QueryClient: g,
775
775
  QueryClientProvider: h
776
776
  }) => {
@@ -779,20 +779,20 @@ const k = oe.jsx, H = vr({
779
779
  queries: {
780
780
  refetchOnWindowFocus: !1,
781
781
  retry: 3,
782
- ...l
782
+ ...u
783
783
  }
784
784
  }
785
785
  });
786
786
  return /* @__PURE__ */ k(h, { client: c, children: n });
787
787
  }, xr = (n) => {
788
- const { unknownErrorTranslationKey: l = "error.unknownError" } = n || {}, { translate: g = n == null ? void 0 : n.translate } = ie(H);
788
+ const { unknownErrorTranslationKey: u = "error.unknownError" } = n || {}, { translate: g = n == null ? void 0 : n.translate } = ie(H);
789
789
  return { printError: mr(
790
790
  (c) => {
791
791
  var y, p, T, b, _, O, w, x, A;
792
- const u = g ? g(l) : "Unknown error", { response: i } = c || {};
793
- return c != null && c.reason ? String(c.reason) : (y = i == null ? void 0 : i.data) != null && y.reason ? String(i.data.reason) : (p = i == null ? void 0 : i.data) != null && p.message ? String(i.data.message) : (b = (T = i == null ? void 0 : i.data) == null ? void 0 : T.detail) != null && b.length && Array.isArray((_ = i == null ? void 0 : i.data) == null ? void 0 : _.detail) && ((w = (O = i == null ? void 0 : i.data) == null ? void 0 : O.detail[0]) != null && w.msg) && typeof ((A = (x = i == null ? void 0 : i.data) == null ? void 0 : x.detail[0]) == null ? void 0 : A.msg) == "string" ? String(i.data.detail[0].msg) : u;
792
+ const s = g ? g(u) : "Unknown error", { response: i } = c || {};
793
+ return c != null && c.reason ? String(c.reason) : (y = i == null ? void 0 : i.data) != null && y.reason ? String(i.data.reason) : (p = i == null ? void 0 : i.data) != null && p.message ? String(i.data.message) : (b = (T = i == null ? void 0 : i.data) == null ? void 0 : T.detail) != null && b.length && Array.isArray((_ = i == null ? void 0 : i.data) == null ? void 0 : _.detail) && ((w = (O = i == null ? void 0 : i.data) == null ? void 0 : O.detail[0]) != null && w.msg) && typeof ((A = (x = i == null ? void 0 : i.data) == null ? void 0 : x.detail[0]) == null ? void 0 : A.msg) == "string" ? String(i.data.detail[0].msg) : s;
794
794
  },
795
- [g, l]
795
+ [g, u]
796
796
  ) };
797
797
  };
798
798
  export {
package/dist/main.umd.cjs CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var ue;function Le(){if(ue)return N;ue=1;var n=E,c=Symbol.for("react.element"),p=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function i(b,g,C){var R,w={},S=null,O=null;C!==void 0&&(S=""+C),g.key!==void 0&&(S=""+g.key),g.ref!==void 0&&(O=g.ref);for(R in g)h.call(g,R)&&!u.hasOwnProperty(R)&&(w[R]=g[R]);if(b&&b.defaultProps)for(R in g=b.defaultProps,g)w[R]===void 0&&(w[R]=g[R]);return{$$typeof:c,type:b,key:S,ref:O,props:w,_owner:l.current}}return N.Fragment=p,N.jsx=i,N.jsxs=i,N}var W={};/**
9
+ */var ue;function Le(){if(ue)return N;ue=1;var n=E,u=Symbol.for("react.element"),p=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(b,g,C){var R,w={},S=null,O=null;C!==void 0&&(S=""+C),g.key!==void 0&&(S=""+g.key),g.ref!==void 0&&(O=g.ref);for(R in g)h.call(g,R)&&!s.hasOwnProperty(R)&&(w[R]=g[R]);if(b&&b.defaultProps)for(R in g=b.defaultProps,g)w[R]===void 0&&(w[R]=g[R]);return{$$typeof:u,type:b,key:S,ref:O,props:w,_owner:c.current}}return N.Fragment=p,N.jsx=i,N.jsxs=i,N}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 se;function Me(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var n=E,c=Symbol.for("react.element"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),b=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),D=Symbol.iterator,F="@@iterator";function G(e){if(e===null||typeof e!="object")return null;var r=D&&e[D]||e[F];return typeof r=="function"?r:null}var k=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];ce("error",e,t)}}function ce(e,r,t){{var a=k.ReactDebugCurrentFrame,d=a.getStackAddendum();d!==""&&(r+="%s",t=t.concat([d]));var v=t.map(function(s){return String(s)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var le=!1,z=!1,Ke=!1,Xe=!1,Qe=!1,fe;fe=Symbol.for("react.module.reference");function Ze(e){return!!(typeof e=="string"||typeof e=="function"||e===h||e===u||Qe||e===l||e===C||e===R||Xe||e===O||le||z||Ke||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===w||e.$$typeof===i||e.$$typeof===b||e.$$typeof===g||e.$$typeof===fe||e.getModuleId!==void 0))}function qe(e,r,t){var a=e.displayName;if(a)return a;var d=r.displayName||r.name||"";return d!==""?t+"("+d+")":t}function de(e){return e.displayName||"Context"}function A(e){if(e==null)return null;if(typeof e.tag=="number"&&f("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 h:return"Fragment";case p:return"Portal";case u:return"Profiler";case l:return"StrictMode";case C:return"Suspense";case R:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var r=e;return de(r)+".Consumer";case i:var t=e;return de(t._context)+".Provider";case g:return qe(e,e.render,"ForwardRef");case w:var a=e.displayName||null;return a!==null?a:A(e.type)||"Memo";case S:{var d=e,v=d._payload,s=d._init;try{return A(s(v))}catch{return null}}}return null}var I=Object.assign,V=0,ve,ge,pe,he,me,Ee,ye;function be(){}be.__reactDisabledLog=!0;function $e(){{if(V===0){ve=console.log,ge=console.info,pe=console.warn,he=console.error,me=console.group,Ee=console.groupCollapsed,ye=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})}V++}}function er(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:ve}),info:I({},e,{value:ge}),warn:I({},e,{value:pe}),error:I({},e,{value:he}),group:I({},e,{value:me}),groupCollapsed:I({},e,{value:Ee}),groupEnd:I({},e,{value:ye})})}V<0&&f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $=k.ReactCurrentDispatcher,ee;function J(e,r,t){{if(ee===void 0)try{throw Error()}catch(d){var a=d.stack.trim().match(/\n( *(at )?)/);ee=a&&a[1]||""}return`
18
- `+ee+e}}var re=!1,H;{var rr=typeof WeakMap=="function"?WeakMap:Map;H=new rr}function Re(e,r){if(!e||re)return"";{var t=H.get(e);if(t!==void 0)return t}var a;re=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=$.current,$.current=null,$e();try{if(r){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(x){a=x}Reflect.construct(e,[],s)}else{try{s.call()}catch(x){a=x}e.call(s.prototype)}}else{try{throw Error()}catch(x){a=x}e()}}catch(x){if(x&&a&&typeof x.stack=="string"){for(var o=x.stack.split(`
17
+ */var se;function Me(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var n=E,u=Symbol.for("react.element"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),b=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),D=Symbol.iterator,F="@@iterator";function G(e){if(e===null||typeof e!="object")return null;var r=D&&e[D]||e[F];return typeof r=="function"?r:null}var k=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];le("error",e,t)}}function le(e,r,t){{var a=k.ReactDebugCurrentFrame,d=a.getStackAddendum();d!==""&&(r+="%s",t=t.concat([d]));var v=t.map(function(l){return String(l)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var ce=!1,z=!1,Ke=!1,Xe=!1,Qe=!1,fe;fe=Symbol.for("react.module.reference");function Ze(e){return!!(typeof e=="string"||typeof e=="function"||e===h||e===s||Qe||e===c||e===C||e===R||Xe||e===O||ce||z||Ke||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===w||e.$$typeof===i||e.$$typeof===b||e.$$typeof===g||e.$$typeof===fe||e.getModuleId!==void 0))}function qe(e,r,t){var a=e.displayName;if(a)return a;var d=r.displayName||r.name||"";return d!==""?t+"("+d+")":t}function de(e){return e.displayName||"Context"}function A(e){if(e==null)return null;if(typeof e.tag=="number"&&f("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 h:return"Fragment";case p:return"Portal";case s:return"Profiler";case c:return"StrictMode";case C:return"Suspense";case R:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var r=e;return de(r)+".Consumer";case i:var t=e;return de(t._context)+".Provider";case g:return qe(e,e.render,"ForwardRef");case w:var a=e.displayName||null;return a!==null?a:A(e.type)||"Memo";case S:{var d=e,v=d._payload,l=d._init;try{return A(l(v))}catch{return null}}}return null}var I=Object.assign,V=0,ve,ge,pe,he,me,Ee,ye;function be(){}be.__reactDisabledLog=!0;function $e(){{if(V===0){ve=console.log,ge=console.info,pe=console.warn,he=console.error,me=console.group,Ee=console.groupCollapsed,ye=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})}V++}}function er(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:ve}),info:I({},e,{value:ge}),warn:I({},e,{value:pe}),error:I({},e,{value:he}),group:I({},e,{value:me}),groupCollapsed:I({},e,{value:Ee}),groupEnd:I({},e,{value:ye})})}V<0&&f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $=k.ReactCurrentDispatcher,ee;function J(e,r,t){{if(ee===void 0)try{throw Error()}catch(d){var a=d.stack.trim().match(/\n( *(at )?)/);ee=a&&a[1]||""}return`
18
+ `+ee+e}}var re=!1,H;{var rr=typeof WeakMap=="function"?WeakMap:Map;H=new rr}function Re(e,r){if(!e||re)return"";{var t=H.get(e);if(t!==void 0)return t}var a;re=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=$.current,$.current=null,$e();try{if(r){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(x){a=x}Reflect.construct(e,[],l)}else{try{l.call()}catch(x){a=x}e.call(l.prototype)}}else{try{throw Error()}catch(x){a=x}e()}}catch(x){if(x&&a&&typeof x.stack=="string"){for(var o=x.stack.split(`
19
19
  `),T=a.stack.split(`
20
20
  `),m=o.length-1,y=T.length-1;m>=1&&y>=0&&o[m]!==T[y];)y--;for(;m>=1&&y>=0;m--,y--)if(o[m]!==T[y]){if(m!==1||y!==1)do if(m--,y--,y<0||o[m]!==T[y]){var P=`
21
- `+o[m].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(m>=1&&y>=0);break}}}finally{re=!1,$.current=v,er(),Error.prepareStackTrace=d}var M=e?e.displayName||e.name:"",Fe=M?J(M):"";return typeof e=="function"&&H.set(e,Fe),Fe}function tr(e,r,t){return Re(e,!1)}function nr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,t){if(e==null)return"";if(typeof e=="function")return Re(e,nr(e));if(typeof e=="string")return J(e);switch(e){case C:return J("Suspense");case R:return J("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case g:return tr(e.render);case w:return K(e.type,r,t);case S:{var a=e,d=a._payload,v=a._init;try{return K(v(d),r,t)}catch{}}}return""}var X=Object.prototype.hasOwnProperty,_e={},Te=k.ReactDebugCurrentFrame;function Q(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}function ar(e,r,t,a,d){{var v=Function.call.bind(X);for(var s in e)if(v(e,s)){var o=void 0;try{if(typeof e[s]!="function"){var T=Error((a||"React class")+": "+t+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}o=e[s](r,s,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(m){o=m}o&&!(o instanceof Error)&&(Q(d),f("%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).",a||"React class",t,s,typeof o),Q(null)),o instanceof Error&&!(o.message in _e)&&(_e[o.message]=!0,Q(d),f("Failed %s type: %s",t,o.message),Q(null))}}}var or=Array.isArray;function te(e){return or(e)}function ir(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function ur(e){try{return we(e),!1}catch{return!0}}function we(e){return""+e}function Ce(e){if(ur(e))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ir(e)),we(e)}var U=k.ReactCurrentOwner,sr={key:!0,ref:!0,__self:!0,__source:!0},Oe,Se,ne;ne={};function cr(e){if(X.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function lr(e){if(X.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function fr(e,r){if(typeof e.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var t=A(U.current.type);ne[t]||(f('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',A(U.current.type),e.ref),ne[t]=!0)}}function dr(e,r){{var t=function(){Oe||(Oe=!0,f("%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 vr(e,r){{var t=function(){Se||(Se=!0,f("%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 gr=function(e,r,t,a,d,v,s){var o={$$typeof:c,type:e,key:r,ref:t,props:s,_owner:v};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function pr(e,r,t,a,d){{var v,s={},o=null,T=null;t!==void 0&&(Ce(t),o=""+t),lr(r)&&(Ce(r.key),o=""+r.key),cr(r)&&(T=r.ref,fr(r,d));for(v in r)X.call(r,v)&&!sr.hasOwnProperty(v)&&(s[v]=r[v]);if(e&&e.defaultProps){var m=e.defaultProps;for(v in m)s[v]===void 0&&(s[v]=m[v])}if(o||T){var y=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&dr(s,y),T&&vr(s,y)}return gr(e,o,T,d,a,U.current,s)}}var ae=k.ReactCurrentOwner,Pe=k.ReactDebugCurrentFrame;function L(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 oe;oe=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===c}function je(){{if(ae.current){var e=A(ae.current.type);if(e)return`
21
+ `+o[m].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(m>=1&&y>=0);break}}}finally{re=!1,$.current=v,er(),Error.prepareStackTrace=d}var M=e?e.displayName||e.name:"",Fe=M?J(M):"";return typeof e=="function"&&H.set(e,Fe),Fe}function tr(e,r,t){return Re(e,!1)}function nr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,t){if(e==null)return"";if(typeof e=="function")return Re(e,nr(e));if(typeof e=="string")return J(e);switch(e){case C:return J("Suspense");case R:return J("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case g:return tr(e.render);case w:return K(e.type,r,t);case S:{var a=e,d=a._payload,v=a._init;try{return K(v(d),r,t)}catch{}}}return""}var X=Object.prototype.hasOwnProperty,_e={},Te=k.ReactDebugCurrentFrame;function Q(e){if(e){var r=e._owner,t=K(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}function ar(e,r,t,a,d){{var v=Function.call.bind(X);for(var l in e)if(v(e,l)){var o=void 0;try{if(typeof e[l]!="function"){var T=Error((a||"React class")+": "+t+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}o=e[l](r,l,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(m){o=m}o&&!(o instanceof Error)&&(Q(d),f("%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).",a||"React class",t,l,typeof o),Q(null)),o instanceof Error&&!(o.message in _e)&&(_e[o.message]=!0,Q(d),f("Failed %s type: %s",t,o.message),Q(null))}}}var or=Array.isArray;function te(e){return or(e)}function ir(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function ur(e){try{return we(e),!1}catch{return!0}}function we(e){return""+e}function Ce(e){if(ur(e))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ir(e)),we(e)}var U=k.ReactCurrentOwner,sr={key:!0,ref:!0,__self:!0,__source:!0},Oe,Se,ne;ne={};function lr(e){if(X.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function cr(e){if(X.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function fr(e,r){if(typeof e.ref=="string"&&U.current&&r&&U.current.stateNode!==r){var t=A(U.current.type);ne[t]||(f('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',A(U.current.type),e.ref),ne[t]=!0)}}function dr(e,r){{var t=function(){Oe||(Oe=!0,f("%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 vr(e,r){{var t=function(){Se||(Se=!0,f("%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 gr=function(e,r,t,a,d,v,l){var o={$$typeof:u,type:e,key:r,ref:t,props:l,_owner:v};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function pr(e,r,t,a,d){{var v,l={},o=null,T=null;t!==void 0&&(Ce(t),o=""+t),cr(r)&&(Ce(r.key),o=""+r.key),lr(r)&&(T=r.ref,fr(r,d));for(v in r)X.call(r,v)&&!sr.hasOwnProperty(v)&&(l[v]=r[v]);if(e&&e.defaultProps){var m=e.defaultProps;for(v in m)l[v]===void 0&&(l[v]=m[v])}if(o||T){var y=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&dr(l,y),T&&vr(l,y)}return gr(e,o,T,d,a,U.current,l)}}var ae=k.ReactCurrentOwner,Pe=k.ReactDebugCurrentFrame;function L(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 oe;oe=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===u}function je(){{if(ae.current){var e=A(ae.current.type);if(e)return`
22
22
 
23
23
  Check the render method of \``+e+"`."}return""}}function hr(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 ke={};function mr(e){{var r=je();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 Ae(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=mr(r);if(ke[t])return;ke[t]=!0;var a="";e&&e._owner&&e._owner!==ae.current&&(a=" It was passed a child from "+A(e._owner.type)+"."),L(e),f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),L(null)}}function xe(e,r){{if(typeof e!="object")return;if(te(e))for(var t=0;t<e.length;t++){var a=e[t];ie(a)&&Ae(a,r)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var d=G(e);if(typeof d=="function"&&d!==e.entries)for(var v=d.call(e),s;!(s=v.next()).done;)ie(s.value)&&Ae(s.value,r)}}}function Er(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===g||r.$$typeof===w))t=r.propTypes;else return;if(t){var a=A(r);ar(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!oe){oe=!0;var d=A(r);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function yr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){L(e),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),L(null);break}}e.ref!==null&&(L(e),f("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}function De(e,r,t,a,d,v){{var s=Ze(e);if(!s){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" 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=hr(d);T?o+=T:o+=je();var m;e===null?m="null":te(e)?m="array":e!==void 0&&e.$$typeof===c?(m="<"+(A(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):m=typeof e,f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m,o)}var y=pr(e,r,t,d,v);if(y==null)return y;if(s){var P=r.children;if(P!==void 0)if(a)if(te(P)){for(var M=0;M<P.length;M++)xe(P[M],e);Object.freeze&&Object.freeze(P)}else f("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 xe(P,e)}return e===h?yr(y):Er(y),y}}function br(e,r,t){return De(e,r,t,!0)}function Rr(e,r,t){return De(e,r,t,!1)}var _r=Rr,Tr=br;W.Fragment=h,W.jsx=_r,W.jsxs=Tr}()),W}(function(n){process.env.NODE_ENV==="production"?n.exports=Le():n.exports=Me()})(Ie);const j=Z.jsx,Y=E.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:c,translate:p,useAuth:h,Outlet:l,Navigate:u,useLocation:i,useGoogleTagManager:b})=>{const g=E.useMemo(()=>({axios:n,Navigate:u,Outlet:l,translate:p,useAuth:h,useGoogleTagManager:b,useLocation:i}),[u,l,n,p,h,b,i]);return j(Y.Provider,{value:g,children:c})},B=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:c="/login",localStorageKey:p="user",redirect401Path:h="/login",...l})=>{var D,F,G,k;const{axios:u=l.axios,useLocation:i=l.useLocation,useAuth:b=l.useAuth,Outlet:g=l.Outlet,Navigate:C=l.Navigate}=E.useContext(Y);if(b===void 0)throw new Error(B("useAuth"));if(i===void 0)throw new Error(B("useLocation"));if(g===void 0)throw new Error(B("Outlet"));if(C===void 0)throw new Error(B("Navigate"));const[R,w]=E.useState(null),{isLogged:S}=b(),O=i();return E.useLayoutEffect(()=>{u==null||u.interceptors.response.use(f=>f,async f=>{var z;return typeof f=="object"&&f&&"response"in f&&f.response&&typeof f.response=="object"&&"status"in f.response&&f.response&&typeof f.response=="object"&&"status"in f.response&&((z=f==null?void 0:f.response)==null?void 0:z.status)===401&&(u.defaults.headers.common.Authorization=null,localStorage.removeItem(p),w(h)),Promise.reject(f)})},[u==null?void 0:u.defaults,u==null?void 0:u.interceptors.response,p,h]),S&&!R?j(E.Suspense,{fallback:n,children:(F=(D=O.state)==null?void 0:D.from)!=null&&F.state&&((k=(G=O.state)==null?void 0:G.from)==null?void 0:k.pathname)===c?j(C,{to:O.state.from.state.from.pathname+O.state.from.state.from.search,replace:!0}):j(g,{})}):j(C,{to:c,state:{from:O},replace:!0})},q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ye=({...n})=>{const{useLocation:c=n.useLocation,Outlet:p=n.Outlet,useGoogleTagManager:h=n.useGoogleTagManager}=E.useContext(Y);if(c===void 0)throw new Error(q("useLocation"));if(p===void 0)throw new Error(q("Outlet"));if(h===void 0)throw new Error(q("useGoogleTagManager"));const{pathname:l}=c(),{sendEvent:u}=h();return E.useEffect(()=>{u({event:"pageView",pathname:l})},[l,u]),j(p,{})},Ve=({axios:n,baseURL:c,userLocalStorageKey:p="user",postContentType:h="application/json"})=>(E.useLayoutEffect(()=>{if(!n.defaults)return;const l=localStorage.getItem(p),u=l?JSON.parse(l):null,i=u&&typeof u=="object"&&"tokenType"in u&&u.tokenType?u.tokenType:null,b=u&&typeof u=="object"&&"accessToken"in u&&u.accessToken?u.accessToken:null,g=l?`${i} ${b}`:null;n.defaults.baseURL=c,n.defaults.headers.post["Content-Type"]=h,g&&(n.defaults.headers.common.Authorization=g)},[n.defaults,n.defaults.baseURL,n.defaults.headers.common,n.defaults.headers.post,c,h,p]),null),Ue=({i18n:n,initReactI18next:c,resources:p,LanguageDetector:h})=>(n.use(h).use(c).init({debug:!1,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{useSuspense:!0},resources:p,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",l=>{document.documentElement.setAttribute("lang",l)}),null),Be=({dsn:n,sentry:c})=>(E.useLayoutEffect(()=>{c&&process.env.NODE_ENV!=="development"&&c.init({dsn:n,integrations:[new c.BrowserTracing],tracesSampleRate:1})},[n,c]),null),Ge=({IMaskMixin:n,...c})=>{const p=E.useMemo(()=>n(({TextField:h,...l})=>j(h,{...l})),[n]);return j(p,{...c})},ze=({mapbox:n,accessToken:c})=>(E.useLayoutEffect(()=>{n&&(n.accessToken=c||"")},[c,n]),null),Je=({children:n,defaultOptions:c,QueryClient:p,QueryClientProvider:h})=>{const l=new p({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...c}}});return j(h,{client:l,children:n})},He=n=>{const{unknownErrorTranslationKey:c="error.unknownError"}=n||{},{translate:p=n==null?void 0:n.translate}=E.useContext(Y);return{printError:E.useCallback(l=>{var b,g,C,R,w,S,O,D,F;const u=p?p(c):"Unknown error",{response:i}=l||{};return l!=null&&l.reason?String(l.reason):(b=i==null?void 0:i.data)!=null&&b.reason?String(i.data.reason):(g=i==null?void 0:i.data)!=null&&g.message?String(i.data.message):(R=(C=i==null?void 0:i.data)==null?void 0:C.detail)!=null&&R.length&&Array.isArray((w=i==null?void 0:i.data)==null?void 0:w.detail)&&((O=(S=i==null?void 0:i.data)==null?void 0:S.detail[0])!=null&&O.msg)&&typeof((F=(D=i==null?void 0:i.data)==null?void 0:D.detail[0])==null?void 0:F.msg)=="string"?String(i.data.detail[0].msg):u},[p,c])}};_.AxiosConfig=Ve,_.GTMSendPageView=Ye,_.I18nConfig=Ue,_.InjectDependenciesContext=Y,_.InjectDependenciesProvider=Ne,_.MapBoxConfig=ze,_.MaskTextField=Ge,_.QueryClientConfigProvider=Je,_.RequireAuth=We,_.SentryConfig=Be,_.useResponseError=He,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
27
+ Check the top-level render call using <`+t+">.")}return r}}function Ae(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=mr(r);if(ke[t])return;ke[t]=!0;var a="";e&&e._owner&&e._owner!==ae.current&&(a=" It was passed a child from "+A(e._owner.type)+"."),L(e),f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),L(null)}}function xe(e,r){{if(typeof e!="object")return;if(te(e))for(var t=0;t<e.length;t++){var a=e[t];ie(a)&&Ae(a,r)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var d=G(e);if(typeof d=="function"&&d!==e.entries)for(var v=d.call(e),l;!(l=v.next()).done;)ie(l.value)&&Ae(l.value,r)}}}function Er(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===g||r.$$typeof===w))t=r.propTypes;else return;if(t){var a=A(r);ar(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!oe){oe=!0;var d=A(r);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function yr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){L(e),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),L(null);break}}e.ref!==null&&(L(e),f("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}function De(e,r,t,a,d,v){{var l=Ze(e);if(!l){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" 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=hr(d);T?o+=T:o+=je();var m;e===null?m="null":te(e)?m="array":e!==void 0&&e.$$typeof===u?(m="<"+(A(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):m=typeof e,f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m,o)}var y=pr(e,r,t,d,v);if(y==null)return y;if(l){var P=r.children;if(P!==void 0)if(a)if(te(P)){for(var M=0;M<P.length;M++)xe(P[M],e);Object.freeze&&Object.freeze(P)}else f("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 xe(P,e)}return e===h?yr(y):Er(y),y}}function br(e,r,t){return De(e,r,t,!0)}function Rr(e,r,t){return De(e,r,t,!1)}var _r=Rr,Tr=br;W.Fragment=h,W.jsx=_r,W.jsxs=Tr}()),W}(function(n){process.env.NODE_ENV==="production"?n.exports=Le():n.exports=Me()})(Ie);const j=Z.jsx,Y=E.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:u,translate:p,useAuth:h,Outlet:c,Navigate:s,useLocation:i,useGoogleTagManager:b})=>{const g=E.useMemo(()=>({axios:n,Navigate:s,Outlet:c,translate:p,useAuth:h,useGoogleTagManager:b,useLocation:i}),[s,c,n,p,h,b,i]);return j(Y.Provider,{value:g,children:u})},B=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:u="/login",localStorageKey:p="user",redirect401Path:h="/login",...c})=>{var D,F,G,k;const{axios:s=c.axios,useLocation:i=c.useLocation,useAuth:b=c.useAuth,Outlet:g=c.Outlet,Navigate:C=c.Navigate}=E.useContext(Y);if(b===void 0)throw new Error(B("useAuth"));if(i===void 0)throw new Error(B("useLocation"));if(g===void 0)throw new Error(B("Outlet"));if(C===void 0)throw new Error(B("Navigate"));const[R,w]=E.useState(null),{isLogged:S}=b(),O=i();return E.useLayoutEffect(()=>{s==null||s.interceptors.response.use(f=>f,async f=>{var z;return typeof f=="object"&&f&&"response"in f&&f.response&&typeof f.response=="object"&&"status"in f.response&&f.response&&typeof f.response=="object"&&"status"in f.response&&((z=f==null?void 0:f.response)==null?void 0:z.status)===401&&(s.defaults.headers.common.Authorization=null,localStorage.removeItem(p),w(h)),Promise.reject(f)})},[s==null?void 0:s.defaults,s==null?void 0:s.interceptors.response,p,h]),S&&!R?j(E.Suspense,{fallback:n,children:(F=(D=O.state)==null?void 0:D.from)!=null&&F.state&&((k=(G=O.state)==null?void 0:G.from)==null?void 0:k.pathname)===u?j(C,{to:O.state.from.state.from.pathname+O.state.from.state.from.search,replace:!0}):j(g,{})}):j(C,{to:u,state:{from:O},replace:!0})},q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ye=({...n})=>{const{useLocation:u=n.useLocation,Outlet:p=n.Outlet,useGoogleTagManager:h=n.useGoogleTagManager}=E.useContext(Y);if(u===void 0)throw new Error(q("useLocation"));if(p===void 0)throw new Error(q("Outlet"));if(h===void 0)throw new Error(q("useGoogleTagManager"));const{pathname:c}=u(),{sendEvent:s}=h();return E.useEffect(()=>{s({event:"pageView",pathname:c})},[c,s]),j(p,{})},Ve=({axios:n,baseURL:u,userLocalStorageKey:p="user",postContentType:h="application/json"})=>(E.useLayoutEffect(()=>{if(!n.defaults)return;const c=localStorage.getItem(p),s=c?JSON.parse(c):null,i=s&&typeof s=="object"&&"tokenType"in s&&s.tokenType?s.tokenType:null,b=s&&typeof s=="object"&&"accessToken"in s&&s.accessToken?s.accessToken:null,g=c?`${i} ${b}`:null;n.defaults.baseURL=u,n.defaults.headers.post["Content-Type"]=h,g&&(n.defaults.headers.common.Authorization=g)},[n.defaults,n.defaults.baseURL,n.defaults.headers.common,n.defaults.headers.post,u,h,p]),null),Ue=({i18n:n,initReactI18next:u,resources:p,LanguageDetector:h})=>(n.use(h).use(u).init({debug:!1,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{useSuspense:!0},resources:p,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",c=>{document.documentElement.setAttribute("lang",c)}),null),Be=({dsn:n,sentry:u})=>(E.useLayoutEffect(()=>{u&&process.env.NODE_ENV!=="development"&&u.init({dsn:n,integrations:[new u.BrowserTracing],tracesSampleRate:1})},[n,u]),null),Ge=({IMaskMixin:n,...u})=>{const p=E.useMemo(()=>n(({TextField:h,...c})=>j(h,{...c})),[n]);return j(p,{...u})},ze=({mapbox:n,accessToken:u})=>(E.useLayoutEffect(()=>{n&&u&&(n.accessToken=u)},[u,n]),null),Je=({children:n,defaultOptions:u,QueryClient:p,QueryClientProvider:h})=>{const c=new p({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...u}}});return j(h,{client:c,children:n})},He=n=>{const{unknownErrorTranslationKey:u="error.unknownError"}=n||{},{translate:p=n==null?void 0:n.translate}=E.useContext(Y);return{printError:E.useCallback(c=>{var b,g,C,R,w,S,O,D,F;const s=p?p(u):"Unknown error",{response:i}=c||{};return c!=null&&c.reason?String(c.reason):(b=i==null?void 0:i.data)!=null&&b.reason?String(i.data.reason):(g=i==null?void 0:i.data)!=null&&g.message?String(i.data.message):(R=(C=i==null?void 0:i.data)==null?void 0:C.detail)!=null&&R.length&&Array.isArray((w=i==null?void 0:i.data)==null?void 0:w.detail)&&((O=(S=i==null?void 0:i.data)==null?void 0:S.detail[0])!=null&&O.msg)&&typeof((F=(D=i==null?void 0:i.data)==null?void 0:D.detail[0])==null?void 0:F.msg)=="string"?String(i.data.detail[0].msg):s},[p,u])}};_.AxiosConfig=Ve,_.GTMSendPageView=Ye,_.I18nConfig=Ue,_.InjectDependenciesContext=Y,_.InjectDependenciesProvider=Ne,_.MapBoxConfig=ze,_.MaskTextField=Ge,_.QueryClientConfigProvider=Je,_.RequireAuth=We,_.SentryConfig=Be,_.useResponseError=He,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",