@tracktor/shared-module 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/dist/config/orval/orval.d.ts +5 -1
- package/dist/main.js +77 -73
- package/dist/main.umd.cjs +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -43,7 +43,11 @@ export declare const getOrvalConfig: (config?: CustomOrvalConfig) => {
|
|
|
43
43
|
readonly useQuery: true;
|
|
44
44
|
};
|
|
45
45
|
readonly operations?: Record<string, {}> | undefined;
|
|
46
|
-
readonly header:
|
|
46
|
+
readonly header: (info: {
|
|
47
|
+
title: string;
|
|
48
|
+
description: string;
|
|
49
|
+
version: string;
|
|
50
|
+
}) => string[];
|
|
47
51
|
readonly mutator: {
|
|
48
52
|
readonly name: "axiosCustomInstance";
|
|
49
53
|
readonly path: `${string}/config/orval/mutator/axiosCustomInstance.ts`;
|
package/dist/main.js
CHANGED
|
@@ -14,15 +14,15 @@ function Er() {
|
|
|
14
14
|
if ($e)
|
|
15
15
|
return W;
|
|
16
16
|
$e = 1;
|
|
17
|
-
var n = Le, a = Symbol.for("react.element"), u = Symbol.for("react.fragment"),
|
|
18
|
-
function s(h,
|
|
17
|
+
var n = Le, a = Symbol.for("react.element"), u = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, i = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function s(h, f, R) {
|
|
19
19
|
var E, w = {}, T = null, C = null;
|
|
20
|
-
R !== void 0 && (T = "" + R),
|
|
21
|
-
for (E in
|
|
22
|
-
|
|
20
|
+
R !== void 0 && (T = "" + R), f.key !== void 0 && (T = "" + f.key), f.ref !== void 0 && (C = f.ref);
|
|
21
|
+
for (E in f)
|
|
22
|
+
l.call(f, E) && !g.hasOwnProperty(E) && (w[E] = f[E]);
|
|
23
23
|
if (h && h.defaultProps)
|
|
24
|
-
for (E in
|
|
25
|
-
w[E] === void 0 && (w[E] =
|
|
24
|
+
for (E in f = h.defaultProps, f)
|
|
25
|
+
w[E] === void 0 && (w[E] = f[E]);
|
|
26
26
|
return { $$typeof: a, type: h, key: T, ref: C, props: w, _owner: i.current };
|
|
27
27
|
}
|
|
28
28
|
return W.Fragment = u, W.jsx = s, W.jsxs = s, W;
|
|
@@ -40,7 +40,7 @@ var M = {};
|
|
|
40
40
|
var Ie;
|
|
41
41
|
function br() {
|
|
42
42
|
return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var n = Le, a = Symbol.for("react.element"), u = Symbol.for("react.portal"),
|
|
43
|
+
var n = Le, a = Symbol.for("react.element"), u = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), h = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), A = Symbol.iterator, k = "@@iterator";
|
|
44
44
|
function N(e) {
|
|
45
45
|
if (e === null || typeof e != "object")
|
|
46
46
|
return null;
|
|
@@ -68,7 +68,7 @@ function br() {
|
|
|
68
68
|
var ce = !1, Y = !1, We = !1, Me = !1, Ne = !1, fe;
|
|
69
69
|
fe = Symbol.for("react.module.reference");
|
|
70
70
|
function Ye(e) {
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === l || e === g || Ne || e === i || e === R || e === E || Me || e === C || ce || Y || We || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === w || e.$$typeof === s || e.$$typeof === h || e.$$typeof === f || // This needs to include all possible module reference object
|
|
72
72
|
// types supported by any Flight configuration anywhere since
|
|
73
73
|
// we don't know which Flight build this will end up being used
|
|
74
74
|
// with.
|
|
@@ -92,7 +92,7 @@ function br() {
|
|
|
92
92
|
if (typeof e == "string")
|
|
93
93
|
return e;
|
|
94
94
|
switch (e) {
|
|
95
|
-
case
|
|
95
|
+
case l:
|
|
96
96
|
return "Fragment";
|
|
97
97
|
case u:
|
|
98
98
|
return "Portal";
|
|
@@ -113,7 +113,7 @@ function br() {
|
|
|
113
113
|
case s:
|
|
114
114
|
var t = e;
|
|
115
115
|
return de(t._context) + ".Provider";
|
|
116
|
-
case
|
|
116
|
+
case f:
|
|
117
117
|
return Ve(e, e.render, "ForwardRef");
|
|
118
118
|
case w:
|
|
119
119
|
var o = e.displayName || null;
|
|
@@ -258,17 +258,17 @@ function br() {
|
|
|
258
258
|
}
|
|
259
259
|
} catch (P) {
|
|
260
260
|
if (P && o && typeof P.stack == "string") {
|
|
261
|
-
for (var
|
|
261
|
+
for (var c = P.stack.split(`
|
|
262
262
|
`), _ = o.stack.split(`
|
|
263
|
-
`), b =
|
|
263
|
+
`), b = c.length - 1, y = _.length - 1; b >= 1 && y >= 0 && c[b] !== _[y]; )
|
|
264
264
|
y--;
|
|
265
265
|
for (; b >= 1 && y >= 0; b--, y--)
|
|
266
|
-
if (
|
|
266
|
+
if (c[b] !== _[y]) {
|
|
267
267
|
if (b !== 1 || y !== 1)
|
|
268
268
|
do
|
|
269
|
-
if (b--, y--, y < 0 ||
|
|
269
|
+
if (b--, y--, y < 0 || c[b] !== _[y]) {
|
|
270
270
|
var O = `
|
|
271
|
-
` +
|
|
271
|
+
` + c[b].replace(" at new ", " at ");
|
|
272
272
|
return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && q.set(e, O), O;
|
|
273
273
|
}
|
|
274
274
|
while (b >= 1 && y >= 0);
|
|
@@ -303,7 +303,7 @@ function br() {
|
|
|
303
303
|
}
|
|
304
304
|
if (typeof e == "object")
|
|
305
305
|
switch (e.$$typeof) {
|
|
306
|
-
case
|
|
306
|
+
case f:
|
|
307
307
|
return Be(e.render);
|
|
308
308
|
case w:
|
|
309
309
|
return z(e.type, r, t);
|
|
@@ -330,17 +330,17 @@ function br() {
|
|
|
330
330
|
var m = Function.call.bind(U);
|
|
331
331
|
for (var d in e)
|
|
332
332
|
if (m(e, d)) {
|
|
333
|
-
var
|
|
333
|
+
var c = void 0;
|
|
334
334
|
try {
|
|
335
335
|
if (typeof e[d] != "function") {
|
|
336
336
|
var _ = Error((o || "React class") + ": " + t + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
337
|
throw _.name = "Invariant Violation", _;
|
|
338
338
|
}
|
|
339
|
-
|
|
339
|
+
c = e[d](r, d, o, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
340
|
} catch (b) {
|
|
341
|
-
|
|
341
|
+
c = b;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
c && !(c instanceof Error) && (B(p), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", o || "React class", t, d, typeof c), B(null)), c instanceof Error && !(c.message in _e) && (_e[c.message] = !0, B(p), v("Failed %s type: %s", t, c.message), B(null));
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
@@ -420,7 +420,7 @@ function br() {
|
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
var ar = function(e, r, t, o, p, m, d) {
|
|
423
|
-
var
|
|
423
|
+
var c = {
|
|
424
424
|
// This tag allows us to uniquely identify this as a React Element
|
|
425
425
|
$$typeof: a,
|
|
426
426
|
// Built-in properties that belong on the element
|
|
@@ -431,27 +431,27 @@ function br() {
|
|
|
431
431
|
// Record the component responsible for creating this element.
|
|
432
432
|
_owner: m
|
|
433
433
|
};
|
|
434
|
-
return
|
|
434
|
+
return c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
435
435
|
configurable: !1,
|
|
436
436
|
enumerable: !1,
|
|
437
437
|
writable: !0,
|
|
438
438
|
value: !1
|
|
439
|
-
}), Object.defineProperty(
|
|
439
|
+
}), Object.defineProperty(c, "_self", {
|
|
440
440
|
configurable: !1,
|
|
441
441
|
enumerable: !1,
|
|
442
442
|
writable: !1,
|
|
443
443
|
value: o
|
|
444
|
-
}), Object.defineProperty(
|
|
444
|
+
}), Object.defineProperty(c, "_source", {
|
|
445
445
|
configurable: !1,
|
|
446
446
|
enumerable: !1,
|
|
447
447
|
writable: !1,
|
|
448
448
|
value: p
|
|
449
|
-
}), Object.freeze && (Object.freeze(
|
|
449
|
+
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
450
450
|
};
|
|
451
451
|
function or(e, r, t, o, p) {
|
|
452
452
|
{
|
|
453
|
-
var m, d = {},
|
|
454
|
-
t !== void 0 && (Te(t),
|
|
453
|
+
var m, d = {}, c = null, _ = null;
|
|
454
|
+
t !== void 0 && (Te(t), c = "" + t), er(r) && (Te(r.key), c = "" + r.key), Qe(r) && (_ = r.ref, rr(r, p));
|
|
455
455
|
for (m in r)
|
|
456
456
|
U.call(r, m) && !Ke.hasOwnProperty(m) && (d[m] = r[m]);
|
|
457
457
|
if (e && e.defaultProps) {
|
|
@@ -459,11 +459,11 @@ function br() {
|
|
|
459
459
|
for (m in b)
|
|
460
460
|
d[m] === void 0 && (d[m] = b[m]);
|
|
461
461
|
}
|
|
462
|
-
if (
|
|
462
|
+
if (c || _) {
|
|
463
463
|
var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
464
|
-
|
|
464
|
+
c && tr(d, y), _ && nr(d, y);
|
|
465
465
|
}
|
|
466
|
-
return ar(e,
|
|
466
|
+
return ar(e, c, _, p, o, L.current, d);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
var te = S.ReactCurrentOwner, je = S.ReactDebugCurrentFrame;
|
|
@@ -555,7 +555,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
555
555
|
var t;
|
|
556
556
|
if (typeof r == "function")
|
|
557
557
|
t = r.propTypes;
|
|
558
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
|
558
|
+
else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
|
|
559
559
|
// Inner props are checked in the reconciler.
|
|
560
560
|
r.$$typeof === w))
|
|
561
561
|
t = r.propTypes;
|
|
@@ -588,12 +588,12 @@ Check the top-level render call using <` + t + ">.");
|
|
|
588
588
|
{
|
|
589
589
|
var d = Ye(e);
|
|
590
590
|
if (!d) {
|
|
591
|
-
var
|
|
592
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
591
|
+
var c = "";
|
|
592
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (c += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
593
593
|
var _ = ir(p);
|
|
594
|
-
_ ?
|
|
594
|
+
_ ? c += _ : c += Pe();
|
|
595
595
|
var b;
|
|
596
|
-
e === null ? b = "null" : ee(e) ? b = "array" : e !== void 0 && e.$$typeof === a ? (b = "<" + (j(e.type) || "Unknown") + " />",
|
|
596
|
+
e === null ? b = "null" : ee(e) ? b = "array" : e !== void 0 && e.$$typeof === a ? (b = "<" + (j(e.type) || "Unknown") + " />", c = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, c);
|
|
597
597
|
}
|
|
598
598
|
var y = or(e, r, t, p, m);
|
|
599
599
|
if (y == null)
|
|
@@ -611,7 +611,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
611
611
|
else
|
|
612
612
|
ke(O, e);
|
|
613
613
|
}
|
|
614
|
-
return e ===
|
|
614
|
+
return e === l ? lr(y) : sr(y), y;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
function cr(e, r, t) {
|
|
@@ -621,7 +621,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
621
621
|
return De(e, r, t, !1);
|
|
622
622
|
}
|
|
623
623
|
var dr = fr, vr = cr;
|
|
624
|
-
M.Fragment =
|
|
624
|
+
M.Fragment = l, M.jsx = dr, M.jsxs = vr;
|
|
625
625
|
}()), M;
|
|
626
626
|
}
|
|
627
627
|
process.env.NODE_ENV === "production" ? ie.exports = Er() : ie.exports = br();
|
|
@@ -638,30 +638,30 @@ const H = pr({
|
|
|
638
638
|
axios: n,
|
|
639
639
|
children: a,
|
|
640
640
|
translate: u,
|
|
641
|
-
useAuth:
|
|
641
|
+
useAuth: l,
|
|
642
642
|
Outlet: i,
|
|
643
643
|
Navigate: g,
|
|
644
644
|
useLocation: s,
|
|
645
645
|
useGoogleTagManager: h
|
|
646
646
|
}) => {
|
|
647
|
-
const
|
|
647
|
+
const f = ue(
|
|
648
648
|
() => ({
|
|
649
649
|
axios: n,
|
|
650
650
|
Navigate: g,
|
|
651
651
|
Outlet: i,
|
|
652
652
|
translate: u,
|
|
653
|
-
useAuth:
|
|
653
|
+
useAuth: l,
|
|
654
654
|
useGoogleTagManager: h,
|
|
655
655
|
useLocation: s
|
|
656
656
|
}),
|
|
657
|
-
[g, i, n, u,
|
|
657
|
+
[g, i, n, u, l, h, s]
|
|
658
658
|
);
|
|
659
|
-
return /* @__PURE__ */ x.jsx(H.Provider, { value:
|
|
659
|
+
return /* @__PURE__ */ x.jsx(H.Provider, { value: f, children: a });
|
|
660
660
|
}, G = (n) => `RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Or = ({
|
|
661
661
|
Fallback: n,
|
|
662
662
|
loginPath: a = "/login",
|
|
663
663
|
localStorageKey: u = "user",
|
|
664
|
-
redirect401Path:
|
|
664
|
+
redirect401Path: l = "/login",
|
|
665
665
|
...i
|
|
666
666
|
}) => {
|
|
667
667
|
var A, k, N, S;
|
|
@@ -669,14 +669,14 @@ const H = pr({
|
|
|
669
669
|
axios: g = i.axios,
|
|
670
670
|
useLocation: s = i.useLocation,
|
|
671
671
|
useAuth: h = i.useAuth,
|
|
672
|
-
Outlet:
|
|
672
|
+
Outlet: f = i.Outlet,
|
|
673
673
|
Navigate: R = i.Navigate
|
|
674
674
|
} = se(H);
|
|
675
675
|
if (h === void 0)
|
|
676
676
|
throw new Error(G("useAuth"));
|
|
677
677
|
if (s === void 0)
|
|
678
678
|
throw new Error(G("useLocation"));
|
|
679
|
-
if (
|
|
679
|
+
if (f === void 0)
|
|
680
680
|
throw new Error(G("Outlet"));
|
|
681
681
|
if (R === void 0)
|
|
682
682
|
throw new Error(G("Navigate"));
|
|
@@ -686,23 +686,23 @@ const H = pr({
|
|
|
686
686
|
(v) => v,
|
|
687
687
|
async (v) => {
|
|
688
688
|
var Y;
|
|
689
|
-
return typeof v == "object" && v && "response" in v && v.response && typeof v.response == "object" && "status" in v.response && v.response && typeof v.response == "object" && "status" in v.response && ((Y = v == null ? void 0 : v.response) == null ? void 0 : Y.status) === 401 && (g.defaults.headers.common.Authorization = null, localStorage.removeItem(u), w(
|
|
689
|
+
return typeof v == "object" && v && "response" in v && v.response && typeof v.response == "object" && "status" in v.response && v.response && typeof v.response == "object" && "status" in v.response && ((Y = v == null ? void 0 : v.response) == null ? void 0 : Y.status) === 401 && (g.defaults.headers.common.Authorization = null, localStorage.removeItem(u), w(l)), Promise.reject(v);
|
|
690
690
|
}
|
|
691
691
|
);
|
|
692
|
-
}, [g == null ? void 0 : g.defaults, g == null ? void 0 : g.interceptors.response, u,
|
|
692
|
+
}, [g == null ? void 0 : g.defaults, g == null ? void 0 : g.interceptors.response, u, l]), T && !E ? /* @__PURE__ */ x.jsx(hr, { fallback: n, children: (k = (A = C.state) == null ? void 0 : A.from) != null && k.state && ((S = (N = C.state) == null ? void 0 : N.from) == null ? void 0 : S.pathname) === a ? /* @__PURE__ */ x.jsx(R, { to: C.state.from.state.from.pathname + C.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ x.jsx(f, {}) }) : /* @__PURE__ */ x.jsx(R, { to: a, state: { from: C }, replace: !0 });
|
|
693
693
|
}, oe = (n) => `GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`, Sr = ({ ...n }) => {
|
|
694
694
|
const {
|
|
695
695
|
useLocation: a = n.useLocation,
|
|
696
696
|
Outlet: u = n.Outlet,
|
|
697
|
-
useGoogleTagManager:
|
|
697
|
+
useGoogleTagManager: l = n.useGoogleTagManager
|
|
698
698
|
} = se(H);
|
|
699
699
|
if (a === void 0)
|
|
700
700
|
throw new Error(oe("useLocation"));
|
|
701
701
|
if (u === void 0)
|
|
702
702
|
throw new Error(oe("Outlet"));
|
|
703
|
-
if (
|
|
703
|
+
if (l === void 0)
|
|
704
704
|
throw new Error(oe("useGoogleTagManager"));
|
|
705
|
-
const { pathname: i } = a(), { sendEvent: g } =
|
|
705
|
+
const { pathname: i } = a(), { sendEvent: g } = l();
|
|
706
706
|
return mr(() => {
|
|
707
707
|
g({ event: "pageView", pathname: i });
|
|
708
708
|
}, [i, g]), /* @__PURE__ */ x.jsx(u, {});
|
|
@@ -710,20 +710,20 @@ const H = pr({
|
|
|
710
710
|
axios: n,
|
|
711
711
|
baseURL: a,
|
|
712
712
|
tokenTypeKey: u = "tokenType",
|
|
713
|
-
userLocalStorageKey:
|
|
713
|
+
userLocalStorageKey: l = "user",
|
|
714
714
|
tokenKey: i = "accessToken",
|
|
715
715
|
postContentType: g = "application/json"
|
|
716
716
|
}) => (X(() => {
|
|
717
717
|
if (!n.defaults)
|
|
718
718
|
return;
|
|
719
|
-
const s = localStorage.getItem(
|
|
719
|
+
const s = localStorage.getItem(l), h = s ? JSON.parse(s) : null, f = h != null && h[u] ? h[u] : null, R = h != null && h[i] ? h[i] : null, E = s ? `${f} ${R}` : null;
|
|
720
720
|
n.defaults.baseURL = a, n.defaults.headers.post["Content-Type"] = g, E && (n.defaults.headers.common.Authorization = E);
|
|
721
|
-
}, [n.defaults, a, g, i, u,
|
|
721
|
+
}, [n.defaults, a, g, i, u, l]), null), Pr = ({
|
|
722
722
|
i18n: n,
|
|
723
723
|
initReactI18next: a,
|
|
724
724
|
resources: u,
|
|
725
|
-
LanguageDetector:
|
|
726
|
-
}) => (n.use(
|
|
725
|
+
LanguageDetector: l
|
|
726
|
+
}) => (n.use(l).use(a).init({
|
|
727
727
|
debug: !1,
|
|
728
728
|
fallbackLng: "en",
|
|
729
729
|
interpolation: {
|
|
@@ -748,7 +748,7 @@ const H = pr({
|
|
|
748
748
|
}, [n, a]), null), Ar = ({ IMaskMixin: n, ...a }) => {
|
|
749
749
|
const u = ue(
|
|
750
750
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
751
|
-
() => n(({ TextField:
|
|
751
|
+
() => n(({ TextField: l, ...i }) => /* @__PURE__ */ x.jsx(l, { ...i })),
|
|
752
752
|
[n]
|
|
753
753
|
);
|
|
754
754
|
return /* @__PURE__ */ x.jsx(u, { ...a });
|
|
@@ -758,7 +758,7 @@ const H = pr({
|
|
|
758
758
|
children: n,
|
|
759
759
|
defaultOptions: a,
|
|
760
760
|
QueryClient: u,
|
|
761
|
-
QueryClientProvider:
|
|
761
|
+
QueryClientProvider: l
|
|
762
762
|
}) => {
|
|
763
763
|
const i = new u({
|
|
764
764
|
defaultOptions: {
|
|
@@ -769,14 +769,14 @@ const H = pr({
|
|
|
769
769
|
}
|
|
770
770
|
}
|
|
771
771
|
});
|
|
772
|
-
return /* @__PURE__ */ x.jsx(
|
|
772
|
+
return /* @__PURE__ */ x.jsx(l, { client: i, children: n });
|
|
773
773
|
}, Fr = (n) => {
|
|
774
774
|
const { unknownErrorTranslationKey: a = "error.unknownError" } = n || {}, { translate: u = n == null ? void 0 : n.translate } = se(H);
|
|
775
775
|
return { printError: J(
|
|
776
776
|
(i) => {
|
|
777
|
-
var h,
|
|
777
|
+
var h, f, R, E, w, T, C, A, k;
|
|
778
778
|
const g = u ? u(a) : "Unknown error", { response: s } = i || {};
|
|
779
|
-
return i != null && i.reason ? String(i.reason) : (h = s == null ? void 0 : s.data) != null && h.reason ? String(s.data.reason) : (
|
|
779
|
+
return i != null && i.reason ? String(i.reason) : (h = s == null ? void 0 : s.data) != null && h.reason ? String(s.data.reason) : (f = s == null ? void 0 : s.data) != null && f.message ? String(s.data.message) : (E = (R = s == null ? void 0 : s.data) == null ? void 0 : R.detail) != null && E.length && Array.isArray((w = s == null ? void 0 : s.data) == null ? void 0 : w.detail) && ((C = (T = s == null ? void 0 : s.data) == null ? void 0 : T.detail[0]) != null && C.msg) && typeof ((k = (A = s == null ? void 0 : s.data) == null ? void 0 : A.detail[0]) == null ? void 0 : k.msg) == "string" ? String(s.data.detail[0].msg) : g;
|
|
780
780
|
},
|
|
781
781
|
[u, a]
|
|
782
782
|
) };
|
|
@@ -784,29 +784,29 @@ const H = pr({
|
|
|
784
784
|
data: n,
|
|
785
785
|
fetchNextPage: a,
|
|
786
786
|
isFetchingNextPage: u,
|
|
787
|
-
isInitialLoading:
|
|
787
|
+
isInitialLoading: l,
|
|
788
788
|
isLoading: i,
|
|
789
789
|
enabled: g = !0
|
|
790
790
|
}) => {
|
|
791
791
|
const s = J(
|
|
792
|
-
async (
|
|
793
|
-
u || !g || await a({ pageParam: (
|
|
792
|
+
async (f) => {
|
|
793
|
+
u || !g || await a({ pageParam: (f == null ? void 0 : f.pageParam) || f.visibleRowsCount });
|
|
794
794
|
},
|
|
795
795
|
[g, a, u]
|
|
796
796
|
), h = ue(() => {
|
|
797
797
|
if (n)
|
|
798
|
-
return n.pages.reduce((
|
|
798
|
+
return n.pages.reduce((f, R) => [...f, ...R], []);
|
|
799
799
|
}, [n]);
|
|
800
800
|
return {
|
|
801
801
|
fetchNextPageOnRowsScrollEnd: s,
|
|
802
802
|
isLoading: u || i,
|
|
803
|
-
loadingVariant:
|
|
803
|
+
loadingVariant: l ? "skeleton" : "linear",
|
|
804
804
|
rows: h
|
|
805
805
|
};
|
|
806
806
|
}, Ir = (n) => {
|
|
807
807
|
const a = J(
|
|
808
|
-
({ tokenType:
|
|
809
|
-
n.defaults.headers.common.Authorization = `${
|
|
808
|
+
({ tokenType: l, accessToken: i }) => {
|
|
809
|
+
n.defaults.headers.common.Authorization = `${l} ${i}`;
|
|
810
810
|
},
|
|
811
811
|
[n.defaults.headers.common]
|
|
812
812
|
);
|
|
@@ -817,11 +817,11 @@ const H = pr({
|
|
|
817
817
|
setAuthenticationToken: a
|
|
818
818
|
};
|
|
819
819
|
}, yr = (n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase(), Rr = (n) => {
|
|
820
|
-
const
|
|
821
|
-
return
|
|
820
|
+
const l = n.split("/").filter((i) => i.length > 0).map((i) => i.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((f) => f.charAt(0).toUpperCase() + f.slice(1)).join("")).join("");
|
|
821
|
+
return l.charAt(0).toLowerCase() + l.slice(1);
|
|
822
822
|
}, _r = (n, a, u) => {
|
|
823
|
-
const
|
|
824
|
-
return `${
|
|
823
|
+
const l = Rr(a), i = yr(u);
|
|
824
|
+
return `${l}${i}`;
|
|
825
825
|
}, wr = (n) => {
|
|
826
826
|
if (n)
|
|
827
827
|
return (n == null ? void 0 : n.reduce((a, u) => (a[u] = {
|
|
@@ -842,7 +842,11 @@ const H = pr({
|
|
|
842
842
|
client: "react-query",
|
|
843
843
|
mode: "tags-split",
|
|
844
844
|
override: {
|
|
845
|
-
header:
|
|
845
|
+
header: (l) => [
|
|
846
|
+
"Generated by orval 🍺",
|
|
847
|
+
...l.title ? [l.title] : [],
|
|
848
|
+
...l.description ? [l.description] : []
|
|
849
|
+
],
|
|
846
850
|
mutator: {
|
|
847
851
|
name: "axiosCustomInstance",
|
|
848
852
|
path: `${__dirname}/config/orval/mutator/axiosCustomInstance.ts`
|
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 Ie(){if(ue)return W;ue=1;var n=E,a=Symbol.for("react.element"),u=Symbol.for("react.fragment"),
|
|
9
|
+
*/var ue;function Ie(){if(ue)return W;ue=1;var n=E,a=Symbol.for("react.element"),u=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,g={key:!0,ref:!0,__self:!0,__source:!0};function s(h,f,C){var y,T={},S=null,O=null;C!==void 0&&(S=""+C),f.key!==void 0&&(S=""+f.key),f.ref!==void 0&&(O=f.ref);for(y in f)c.call(f,y)&&!g.hasOwnProperty(y)&&(T[y]=f[y]);if(h&&h.defaultProps)for(y in f=h.defaultProps,f)T[y]===void 0&&(T[y]=f[y]);return{$$typeof:a,type:h,key:S,ref:O,props:T,_owner:i.current}}return W.Fragment=u,W.jsx=s,W.jsxs=s,W}var N={};/**
|
|
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 Le(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var n=E,a=Symbol.for("react.element"),u=Symbol.for("react.portal"),
|
|
18
|
-
`+ee+e}}var te=!1,X;{var ut=typeof WeakMap=="function"?WeakMap:Map;X=new ut}function Re(e,t){if(!e||te)return"";{var r=X.get(e);if(r!==void 0)return r}var o;te=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var m;m=$.current,$.current=null,ot();try{if(t){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(x){o=x}Reflect.construct(e,[],d)}else{try{d.call()}catch(x){o=x}e.call(d.prototype)}}else{try{throw Error()}catch(x){o=x}e()}}catch(x){if(x&&o&&typeof x.stack=="string"){for(var
|
|
17
|
+
*/var se;function Le(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var n=E,a=Symbol.for("react.element"),u=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),h=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),D=Symbol.iterator,F="@@iterator";function U(e){if(e===null||typeof e!="object")return null;var t=D&&e[D]||e[F];return typeof t=="function"?t:null}var k=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(e){{for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];ce("error",e,r)}}function ce(e,t,r){{var o=k.ReactDebugCurrentFrame,p=o.getStackAddendum();p!==""&&(t+="%s",r=r.concat([p]));var m=r.map(function(d){return String(d)});m.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,m)}}var le=!1,G=!1,et=!1,tt=!1,rt=!1,fe;fe=Symbol.for("react.module.reference");function nt(e){return!!(typeof e=="string"||typeof e=="function"||e===c||e===g||rt||e===i||e===C||e===y||tt||e===O||le||G||et||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===T||e.$$typeof===s||e.$$typeof===h||e.$$typeof===f||e.$$typeof===fe||e.getModuleId!==void 0))}function at(e,t,r){var o=e.displayName;if(o)return o;var p=t.displayName||t.name||"";return p!==""?r+"("+p+")":r}function de(e){return e.displayName||"Context"}function A(e){if(e==null)return null;if(typeof e.tag=="number"&&v("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 c:return"Fragment";case u:return"Portal";case g:return"Profiler";case i:return"StrictMode";case C:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case h:var t=e;return de(t)+".Consumer";case s:var r=e;return de(r._context)+".Provider";case f:return at(e,e.render,"ForwardRef");case T:var o=e.displayName||null;return o!==null?o:A(e.type)||"Memo";case S:{var p=e,m=p._payload,d=p._init;try{return A(d(m))}catch{return null}}}return null}var I=Object.assign,V=0,ve,pe,ge,he,me,Ee,ye;function be(){}be.__reactDisabledLog=!0;function ot(){{if(V===0){ve=console.log,pe=console.info,ge=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 it(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:ve}),info:I({},e,{value:pe}),warn:I({},e,{value:ge}),error:I({},e,{value:he}),group:I({},e,{value:me}),groupCollapsed:I({},e,{value:Ee}),groupEnd:I({},e,{value:ye})})}V<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $=k.ReactCurrentDispatcher,ee;function J(e,t,r){{if(ee===void 0)try{throw Error()}catch(p){var o=p.stack.trim().match(/\n( *(at )?)/);ee=o&&o[1]||""}return`
|
|
18
|
+
`+ee+e}}var te=!1,X;{var ut=typeof WeakMap=="function"?WeakMap:Map;X=new ut}function Re(e,t){if(!e||te)return"";{var r=X.get(e);if(r!==void 0)return r}var o;te=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var m;m=$.current,$.current=null,ot();try{if(t){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(x){o=x}Reflect.construct(e,[],d)}else{try{d.call()}catch(x){o=x}e.call(d.prototype)}}else{try{throw Error()}catch(x){o=x}e()}}catch(x){if(x&&o&&typeof x.stack=="string"){for(var l=x.stack.split(`
|
|
19
19
|
`),w=o.stack.split(`
|
|
20
|
-
`),b=
|
|
21
|
-
`+
|
|
20
|
+
`),b=l.length-1,_=w.length-1;b>=1&&_>=0&&l[b]!==w[_];)_--;for(;b>=1&&_>=0;b--,_--)if(l[b]!==w[_]){if(b!==1||_!==1)do if(b--,_--,_<0||l[b]!==w[_]){var j=`
|
|
21
|
+
`+l[b].replace(" at new "," at ");return e.displayName&&j.includes("<anonymous>")&&(j=j.replace("<anonymous>",e.displayName)),typeof e=="function"&&X.set(e,j),j}while(b>=1&&_>=0);break}}}finally{te=!1,$.current=m,it(),Error.prepareStackTrace=p}var M=e?e.displayName||e.name:"",Fe=M?J(M):"";return typeof e=="function"&&X.set(e,Fe),Fe}function st(e,t,r){return Re(e,!1)}function ct(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function H(e,t,r){if(e==null)return"";if(typeof e=="function")return Re(e,ct(e));if(typeof e=="string")return J(e);switch(e){case C:return J("Suspense");case y:return J("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return st(e.render);case T:return H(e.type,t,r);case S:{var o=e,p=o._payload,m=o._init;try{return H(m(p),t,r)}catch{}}}return""}var Z=Object.prototype.hasOwnProperty,_e={},Ce=k.ReactDebugCurrentFrame;function q(e){if(e){var t=e._owner,r=H(e.type,e._source,t?t.type:null);Ce.setExtraStackFrame(r)}else Ce.setExtraStackFrame(null)}function lt(e,t,r,o,p){{var m=Function.call.bind(Z);for(var d in e)if(m(e,d)){var l=void 0;try{if(typeof e[d]!="function"){var w=Error((o||"React class")+": "+r+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}l=e[d](t,d,o,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(b){l=b}l&&!(l instanceof Error)&&(q(p),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",r,d,typeof l),q(null)),l instanceof Error&&!(l.message in _e)&&(_e[l.message]=!0,q(p),v("Failed %s type: %s",r,l.message),q(null))}}}var ft=Array.isArray;function re(e){return ft(e)}function dt(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function vt(e){try{return we(e),!1}catch{return!0}}function we(e){return""+e}function Te(e){if(vt(e))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dt(e)),we(e)}var z=k.ReactCurrentOwner,pt={key:!0,ref:!0,__self:!0,__source:!0},Oe,Se,ne;ne={};function gt(e){if(Z.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function ht(e){if(Z.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function mt(e,t){if(typeof e.ref=="string"&&z.current&&t&&z.current.stateNode!==t){var r=A(z.current.type);ne[r]||(v('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(z.current.type),e.ref),ne[r]=!0)}}function Et(e,t){{var r=function(){Oe||(Oe=!0,v("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}}function yt(e,t){{var r=function(){Se||(Se=!0,v("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}}var bt=function(e,t,r,o,p,m,d){var l={$$typeof:a,type:e,key:t,ref:r,props:d,_owner:m};return l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function Rt(e,t,r,o,p){{var m,d={},l=null,w=null;r!==void 0&&(Te(r),l=""+r),ht(t)&&(Te(t.key),l=""+t.key),gt(t)&&(w=t.ref,mt(t,p));for(m in t)Z.call(t,m)&&!pt.hasOwnProperty(m)&&(d[m]=t[m]);if(e&&e.defaultProps){var b=e.defaultProps;for(m in b)d[m]===void 0&&(d[m]=b[m])}if(l||w){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;l&&Et(d,_),w&&yt(d,_)}return bt(e,l,w,p,o,z.current,d)}}var ae=k.ReactCurrentOwner,je=k.ReactDebugCurrentFrame;function L(e){if(e){var t=e._owner,r=H(e.type,e._source,t?t.type:null);je.setExtraStackFrame(r)}else je.setExtraStackFrame(null)}var oe;oe=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===a}function Pe(){{if(ae.current){var e=A(ae.current.type);if(e)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+e+"`."}return""}}function _t(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),r=e.lineNumber;return`
|
|
24
24
|
|
|
25
25
|
Check your code at `+t+":"+r+"."}return""}}var ke={};function Ct(e){{var t=Pe();if(!t){var r=typeof e=="string"?e:e.displayName||e.name;r&&(t=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+r+">.")}return t}}function Ae(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=Ct(t);if(ke[r])return;ke[r]=!0;var o="";e&&e._owner&&e._owner!==ae.current&&(o=" It was passed a child from "+A(e._owner.type)+"."),L(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,o),L(null)}}function xe(e,t){{if(typeof e!="object")return;if(re(e))for(var r=0;r<e.length;r++){var o=e[r];ie(o)&&Ae(o,t)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var p=U(e);if(typeof p=="function"&&p!==e.entries)for(var m=p.call(e),d;!(d=m.next()).done;)ie(d.value)&&Ae(d.value,t)}}}function wt(e){{var t=e.type;if(t==null||typeof t=="string")return;var r;if(typeof t=="function")r=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===
|
|
27
|
+
Check the top-level render call using <`+r+">.")}return t}}function Ae(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=Ct(t);if(ke[r])return;ke[r]=!0;var o="";e&&e._owner&&e._owner!==ae.current&&(o=" It was passed a child from "+A(e._owner.type)+"."),L(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,o),L(null)}}function xe(e,t){{if(typeof e!="object")return;if(re(e))for(var r=0;r<e.length;r++){var o=e[r];ie(o)&&Ae(o,t)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var p=U(e);if(typeof p=="function"&&p!==e.entries)for(var m=p.call(e),d;!(d=m.next()).done;)ie(d.value)&&Ae(d.value,t)}}}function wt(e){{var t=e.type;if(t==null||typeof t=="string")return;var r;if(typeof t=="function")r=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===f||t.$$typeof===T))r=t.propTypes;else return;if(r){var o=A(t);lt(r,e.props,"prop",o,e)}else if(t.PropTypes!==void 0&&!oe){oe=!0;var p=A(t);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tt(e){{for(var t=Object.keys(e.props),r=0;r<t.length;r++){var o=t[r];if(o!=="children"&&o!=="key"){L(e),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),L(null);break}}e.ref!==null&&(L(e),v("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}function De(e,t,r,o,p,m){{var d=nt(e);if(!d){var l="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(l+=" 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 w=_t(p);w?l+=w:l+=Pe();var b;e===null?b="null":re(e)?b="array":e!==void 0&&e.$$typeof===a?(b="<"+(A(e.type)||"Unknown")+" />",l=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,l)}var _=Rt(e,t,r,p,m);if(_==null)return _;if(d){var j=t.children;if(j!==void 0)if(o)if(re(j)){for(var M=0;M<j.length;M++)xe(j[M],e);Object.freeze&&Object.freeze(j)}else v("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(j,e)}return e===c?Tt(_):wt(_),_}}function Ot(e,t,r){return De(e,t,r,!0)}function St(e,t,r){return De(e,t,r,!1)}var jt=St,Pt=Ot;N.Fragment=c,N.jsx=jt,N.jsxs=Pt}()),N}process.env.NODE_ENV==="production"?K.exports=Ie():K.exports=Le();var P=K.exports;const Y=E.createContext({axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),Me=({axios:n,children:a,translate:u,useAuth:c,Outlet:i,Navigate:g,useLocation:s,useGoogleTagManager:h})=>{const f=E.useMemo(()=>({axios:n,Navigate:g,Outlet:i,translate:u,useAuth:c,useGoogleTagManager:h,useLocation:s}),[g,i,n,u,c,h,s]);return P.jsx(Y.Provider,{value:f,children:a})},B=n=>`RequireAuth require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,We=({Fallback:n,loginPath:a="/login",localStorageKey:u="user",redirect401Path:c="/login",...i})=>{var D,F,U,k;const{axios:g=i.axios,useLocation:s=i.useLocation,useAuth:h=i.useAuth,Outlet:f=i.Outlet,Navigate:C=i.Navigate}=E.useContext(Y);if(h===void 0)throw new Error(B("useAuth"));if(s===void 0)throw new Error(B("useLocation"));if(f===void 0)throw new Error(B("Outlet"));if(C===void 0)throw new Error(B("Navigate"));const[y,T]=E.useState(null),{isLogged:S}=h(),O=s();return E.useLayoutEffect(()=>{g==null||g.interceptors.response.use(v=>v,async v=>{var G;return typeof v=="object"&&v&&"response"in v&&v.response&&typeof v.response=="object"&&"status"in v.response&&v.response&&typeof v.response=="object"&&"status"in v.response&&((G=v==null?void 0:v.response)==null?void 0:G.status)===401&&(g.defaults.headers.common.Authorization=null,localStorage.removeItem(u),T(c)),Promise.reject(v)})},[g==null?void 0:g.defaults,g==null?void 0:g.interceptors.response,u,c]),S&&!y?P.jsx(E.Suspense,{fallback:n,children:(F=(D=O.state)==null?void 0:D.from)!=null&&F.state&&((k=(U=O.state)==null?void 0:U.from)==null?void 0:k.pathname)===a?P.jsx(C,{to:O.state.from.state.from.pathname+O.state.from.state.from.search,replace:!0}):P.jsx(f,{})}):P.jsx(C,{to:a,state:{from:O},replace:!0})},Q=n=>`GTMSendPageView require « ${n} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ne=({...n})=>{const{useLocation:a=n.useLocation,Outlet:u=n.Outlet,useGoogleTagManager:c=n.useGoogleTagManager}=E.useContext(Y);if(a===void 0)throw new Error(Q("useLocation"));if(u===void 0)throw new Error(Q("Outlet"));if(c===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:i}=a(),{sendEvent:g}=c();return E.useEffect(()=>{g({event:"pageView",pathname:i})},[i,g]),P.jsx(u,{})},Ye=({axios:n,baseURL:a,tokenTypeKey:u="tokenType",userLocalStorageKey:c="user",tokenKey:i="accessToken",postContentType:g="application/json"})=>(E.useLayoutEffect(()=>{if(!n.defaults)return;const s=localStorage.getItem(c),h=s?JSON.parse(s):null,f=h!=null&&h[u]?h[u]:null,C=h!=null&&h[i]?h[i]:null,y=s?`${f} ${C}`:null;n.defaults.baseURL=a,n.defaults.headers.post["Content-Type"]=g,y&&(n.defaults.headers.common.Authorization=y)},[n.defaults,a,g,i,u,c]),null),Ve=({i18n:n,initReactI18next:a,resources:u,LanguageDetector:c})=>(n.use(c).use(a).init({debug:!1,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{useSuspense:!0},resources:u,returnNull:!1}).then(()=>{document.documentElement.lang!==n.resolvedLanguage&&n.resolvedLanguage&&document.documentElement.setAttribute("lang",n.resolvedLanguage)}),n.on("languageChanged",i=>{document.documentElement.setAttribute("lang",i)}),null),ze=({dsn:n,sentry:a})=>(E.useLayoutEffect(()=>{process.env.NODE_ENV==="production"&&a.init({dsn:n,integrations:[new a.BrowserTracing],tracesSampleRate:1})},[n,a]),null),Be=({IMaskMixin:n,...a})=>{const u=E.useMemo(()=>n(({TextField:c,...i})=>P.jsx(c,{...i})),[n]);return P.jsx(u,{...a})},Ue=({mapbox:n,accessToken:a})=>(E.useLayoutEffect(()=>{n&&a&&(n.accessToken=a)},[a,n]),null),Ge=({children:n,defaultOptions:a,QueryClient:u,QueryClientProvider:c})=>{const i=new u({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...a}}});return P.jsx(c,{client:i,children:n})},Je=n=>{const{unknownErrorTranslationKey:a="error.unknownError"}=n||{},{translate:u=n==null?void 0:n.translate}=E.useContext(Y);return{printError:E.useCallback(i=>{var h,f,C,y,T,S,O,D,F;const g=u?u(a):"Unknown error",{response:s}=i||{};return i!=null&&i.reason?String(i.reason):(h=s==null?void 0:s.data)!=null&&h.reason?String(s.data.reason):(f=s==null?void 0:s.data)!=null&&f.message?String(s.data.message):(y=(C=s==null?void 0:s.data)==null?void 0:C.detail)!=null&&y.length&&Array.isArray((T=s==null?void 0:s.data)==null?void 0:T.detail)&&((O=(S=s==null?void 0:s.data)==null?void 0:S.detail[0])!=null&&O.msg)&&typeof((F=(D=s==null?void 0:s.data)==null?void 0:D.detail[0])==null?void 0:F.msg)=="string"?String(s.data.detail[0].msg):g},[u,a])}},Xe=({data:n,fetchNextPage:a,isFetchingNextPage:u,isInitialLoading:c,isLoading:i,enabled:g=!0})=>{const s=E.useCallback(async f=>{u||!g||await a({pageParam:(f==null?void 0:f.pageParam)||f.visibleRowsCount})},[g,a,u]),h=E.useMemo(()=>{if(n)return n.pages.reduce((f,C)=>[...f,...C],[])},[n]);return{fetchNextPageOnRowsScrollEnd:s,isLoading:u||i,loadingVariant:c?"skeleton":"linear",rows:h}},He=n=>{const a=E.useCallback(({tokenType:c,accessToken:i})=>{n.defaults.headers.common.Authorization=`${c} ${i}`},[n.defaults.headers.common]);return{clearAuthenticationToken:E.useCallback(()=>{n.defaults.headers.common.Authorization=null},[n.defaults.headers.common]),setAuthenticationToken:a}},Ze=n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase(),qe=n=>{const c=n.split("/").filter(i=>i.length>0).map(i=>i.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")).join("");return c.charAt(0).toLowerCase()+c.slice(1)},Ke=(n,a,u)=>{const c=qe(a),i=Ze(u);return`${c}${i}`},Qe=n=>{if(n)return(n==null?void 0:n.reduce((a,u)=>(a[u]={query:{useInfinite:!0,useInfiniteQueryParam:"offset"}},a),{}))||{}},$e=n=>{const{input:a="./openapi.json",operationsToGenerateInfiniteQueryHook:u=void 0}=n||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:a,output:{client:"react-query",mode:"tags-split",override:{header:c=>["Generated by orval 🍺",...c.title?[c.title]:[],...c.description?[c.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:Ke,...(u==null?void 0:u.length)&&{operations:Qe(u)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};R.AxiosConfig=Ye,R.GTMSendPageView=Ne,R.I18nConfig=Ve,R.InjectDependenciesContext=Y,R.InjectDependenciesProvider=Me,R.MapBoxConfig=Ue,R.MaskTextField=Be,R.QueryClientConfigProvider=Ge,R.RequireAuth=We,R.SentryConfig=ze,R.getOrvalConfig=$e,R.useAuth=He,R.useInfiniteDataGrid=Xe,R.useResponseError=Je,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|