@tracktor/shared-module 2.20.0 → 2.20.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/dist/main.js +352 -352
- package/dist/main.umd.cjs +2 -2
- package/package.json +4 -2
package/dist/main.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import Z from "axios";
|
|
2
|
-
import fe, { useMemo as G, createContext as pe, useContext as P, useEffect as j, useState as W,
|
|
3
|
-
const
|
|
4
|
-
const
|
|
2
|
+
import fe, { useMemo as G, createContext as pe, useContext as P, useEffect as j, useState as W, Suspense as ge, useRef as me, useCallback as O } from "react";
|
|
3
|
+
const We = (e, r) => {
|
|
4
|
+
const a = Z.CancelToken.source(), o = Z({
|
|
5
5
|
...e,
|
|
6
6
|
...r,
|
|
7
|
-
cancelToken:
|
|
7
|
+
cancelToken: a.token
|
|
8
8
|
}).then(({ data: n }) => n);
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
},
|
|
9
|
+
return o.cancel = () => {
|
|
10
|
+
a.cancel("Query was cancelled");
|
|
11
|
+
}, o;
|
|
12
12
|
};
|
|
13
13
|
var D = { exports: {} }, L = {};
|
|
14
14
|
var ee;
|
|
15
|
-
function
|
|
15
|
+
function he() {
|
|
16
16
|
if (ee) return L;
|
|
17
17
|
ee = 1;
|
|
18
18
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), r = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
19
|
-
function o
|
|
19
|
+
function a(o, n, s) {
|
|
20
20
|
var c = null;
|
|
21
|
-
if (
|
|
22
|
-
|
|
21
|
+
if (s !== void 0 && (c = "" + s), n.key !== void 0 && (c = "" + n.key), "key" in n) {
|
|
22
|
+
s = {};
|
|
23
23
|
for (var u in n)
|
|
24
|
-
u !== "key" && (
|
|
25
|
-
} else
|
|
26
|
-
return n =
|
|
24
|
+
u !== "key" && (s[u] = n[u]);
|
|
25
|
+
} else s = n;
|
|
26
|
+
return n = s.ref, {
|
|
27
27
|
$$typeof: e,
|
|
28
|
-
type:
|
|
28
|
+
type: o,
|
|
29
29
|
key: c,
|
|
30
30
|
ref: n !== void 0 ? n : null,
|
|
31
|
-
props:
|
|
31
|
+
props: s
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
return L.Fragment = r, L.jsx =
|
|
34
|
+
return L.Fragment = r, L.jsx = a, L.jsxs = a, L;
|
|
35
35
|
}
|
|
36
36
|
var N = {};
|
|
37
37
|
var te;
|
|
@@ -43,15 +43,15 @@ function ye() {
|
|
|
43
43
|
return t.$$typeof === le ? null : t.displayName || t.name || null;
|
|
44
44
|
if (typeof t == "string") return t;
|
|
45
45
|
switch (t) {
|
|
46
|
-
case
|
|
46
|
+
case T:
|
|
47
47
|
return "Fragment";
|
|
48
|
-
case
|
|
48
|
+
case d:
|
|
49
49
|
return "Profiler";
|
|
50
|
-
case
|
|
50
|
+
case h:
|
|
51
51
|
return "StrictMode";
|
|
52
52
|
case I:
|
|
53
53
|
return "Suspense";
|
|
54
|
-
case
|
|
54
|
+
case ie:
|
|
55
55
|
return "SuspenseList";
|
|
56
56
|
case ce:
|
|
57
57
|
return "Activity";
|
|
@@ -62,19 +62,19 @@ function ye() {
|
|
|
62
62
|
), t.$$typeof) {
|
|
63
63
|
case A:
|
|
64
64
|
return "Portal";
|
|
65
|
-
case
|
|
65
|
+
case R:
|
|
66
66
|
return t.displayName || "Context";
|
|
67
|
-
case m:
|
|
68
|
-
return (t._context.displayName || "Context") + ".Consumer";
|
|
69
67
|
case b:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return
|
|
68
|
+
return (t._context.displayName || "Context") + ".Consumer";
|
|
69
|
+
case _:
|
|
70
|
+
var p = t.render;
|
|
71
|
+
return t = t.displayName, t || (t = p.displayName || p.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
72
|
+
case se:
|
|
73
|
+
return p = t.displayName || null, p !== null ? p : e(t.type) || "Memo";
|
|
74
74
|
case z:
|
|
75
|
-
|
|
75
|
+
p = t._payload, t = t._init;
|
|
76
76
|
try {
|
|
77
|
-
return e(t(
|
|
77
|
+
return e(t(p));
|
|
78
78
|
} catch {
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -83,30 +83,30 @@ function ye() {
|
|
|
83
83
|
function r(t) {
|
|
84
84
|
return "" + t;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function a(t) {
|
|
87
87
|
try {
|
|
88
88
|
r(t);
|
|
89
|
-
var
|
|
89
|
+
var p = !1;
|
|
90
90
|
} catch {
|
|
91
|
-
|
|
91
|
+
p = !0;
|
|
92
92
|
}
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
var
|
|
96
|
-
return
|
|
97
|
-
|
|
93
|
+
if (p) {
|
|
94
|
+
p = console;
|
|
95
|
+
var y = p.error, w = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
96
|
+
return y.call(
|
|
97
|
+
p,
|
|
98
98
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
99
99
|
w
|
|
100
100
|
), r(t);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
if (t ===
|
|
103
|
+
function o(t) {
|
|
104
|
+
if (t === T) return "<>";
|
|
105
105
|
if (typeof t == "object" && t !== null && t.$$typeof === z)
|
|
106
106
|
return "<...>";
|
|
107
107
|
try {
|
|
108
|
-
var
|
|
109
|
-
return
|
|
108
|
+
var p = e(t);
|
|
109
|
+
return p ? "<" + p + ">" : "<...>";
|
|
110
110
|
} catch {
|
|
111
111
|
return "<...>";
|
|
112
112
|
}
|
|
@@ -115,43 +115,43 @@ function ye() {
|
|
|
115
115
|
var t = U.A;
|
|
116
116
|
return t === null ? null : t.getOwner();
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function s() {
|
|
119
119
|
return Error("react-stack-top-frame");
|
|
120
120
|
}
|
|
121
121
|
function c(t) {
|
|
122
122
|
if (J.call(t, "key")) {
|
|
123
|
-
var
|
|
124
|
-
if (
|
|
123
|
+
var p = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
124
|
+
if (p && p.isReactWarning) return !1;
|
|
125
125
|
}
|
|
126
126
|
return t.key !== void 0;
|
|
127
127
|
}
|
|
128
|
-
function u(t,
|
|
129
|
-
function
|
|
130
|
-
|
|
128
|
+
function u(t, p) {
|
|
129
|
+
function y() {
|
|
130
|
+
q || (q = !0, console.error(
|
|
131
131
|
"%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://react.dev/link/special-props)",
|
|
132
|
-
|
|
132
|
+
p
|
|
133
133
|
));
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
get:
|
|
135
|
+
y.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
136
|
+
get: y,
|
|
137
137
|
configurable: !0
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
function l() {
|
|
141
141
|
var t = e(this.type);
|
|
142
|
-
return
|
|
142
|
+
return K[t] || (K[t] = !0, console.error(
|
|
143
143
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
144
144
|
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
var
|
|
146
|
+
function f(t, p, y, w, $, V) {
|
|
147
|
+
var E = y.ref;
|
|
148
148
|
return t = {
|
|
149
|
-
$$typeof:
|
|
149
|
+
$$typeof: k,
|
|
150
150
|
type: t,
|
|
151
|
-
key:
|
|
152
|
-
props:
|
|
151
|
+
key: p,
|
|
152
|
+
props: y,
|
|
153
153
|
_owner: w
|
|
154
|
-
}, (
|
|
154
|
+
}, (E !== void 0 ? E : null) !== null ? Object.defineProperty(t, "ref", {
|
|
155
155
|
enumerable: !1,
|
|
156
156
|
get: l
|
|
157
157
|
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
@@ -176,25 +176,25 @@ function ye() {
|
|
|
176
176
|
value: V
|
|
177
177
|
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
var
|
|
181
|
-
if (
|
|
179
|
+
function i(t, p, y, w, $, V) {
|
|
180
|
+
var E = p.children;
|
|
181
|
+
if (E !== void 0)
|
|
182
182
|
if (w)
|
|
183
|
-
if (ue(
|
|
184
|
-
for (w = 0; w <
|
|
185
|
-
|
|
186
|
-
Object.freeze && Object.freeze(
|
|
183
|
+
if (ue(E)) {
|
|
184
|
+
for (w = 0; w < E.length; w++)
|
|
185
|
+
m(E[w]);
|
|
186
|
+
Object.freeze && Object.freeze(E);
|
|
187
187
|
} else
|
|
188
188
|
console.error(
|
|
189
189
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
190
190
|
);
|
|
191
|
-
else
|
|
192
|
-
if (J.call(
|
|
193
|
-
|
|
194
|
-
var x = Object.keys(
|
|
191
|
+
else m(E);
|
|
192
|
+
if (J.call(p, "key")) {
|
|
193
|
+
E = e(t);
|
|
194
|
+
var x = Object.keys(p).filter(function(de) {
|
|
195
195
|
return de !== "key";
|
|
196
196
|
});
|
|
197
|
-
w = 0 < x.length ? "{key: someKey, " + x.join(": ..., ") + ": ...}" : "{key: someKey}", X[
|
|
197
|
+
w = 0 < x.length ? "{key: someKey, " + x.join(": ..., ") + ": ...}" : "{key: someKey}", X[E + w] || (x = 0 < x.length ? "{" + x.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
198
198
|
`A props object containing a "key" prop is being spread into JSX:
|
|
199
199
|
let props = %s;
|
|
200
200
|
<%s {...props} />
|
|
@@ -202,35 +202,35 @@ React keys must be passed directly to JSX without using spread:
|
|
|
202
202
|
let props = %s;
|
|
203
203
|
<%s key={someKey} {...props} />`,
|
|
204
204
|
w,
|
|
205
|
-
|
|
205
|
+
E,
|
|
206
206
|
x,
|
|
207
|
-
|
|
208
|
-
), X[
|
|
207
|
+
E
|
|
208
|
+
), X[E + w] = !0);
|
|
209
209
|
}
|
|
210
|
-
if (
|
|
211
|
-
|
|
212
|
-
for (var M in
|
|
213
|
-
M !== "key" && (
|
|
214
|
-
} else
|
|
215
|
-
return
|
|
216
|
-
|
|
210
|
+
if (E = null, y !== void 0 && (a(y), E = "" + y), c(p) && (a(p.key), E = "" + p.key), "key" in p) {
|
|
211
|
+
y = {};
|
|
212
|
+
for (var M in p)
|
|
213
|
+
M !== "key" && (y[M] = p[M]);
|
|
214
|
+
} else y = p;
|
|
215
|
+
return E && u(
|
|
216
|
+
y,
|
|
217
217
|
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
218
|
-
),
|
|
218
|
+
), f(
|
|
219
219
|
t,
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
E,
|
|
221
|
+
y,
|
|
222
222
|
n(),
|
|
223
223
|
$,
|
|
224
224
|
V
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
|
-
function
|
|
228
|
-
|
|
227
|
+
function m(t) {
|
|
228
|
+
g(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === z && (t._payload.status === "fulfilled" ? g(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
return typeof t == "object" && t !== null && t.$$typeof ===
|
|
230
|
+
function g(t) {
|
|
231
|
+
return typeof t == "object" && t !== null && t.$$typeof === k;
|
|
232
232
|
}
|
|
233
|
-
var v = fe,
|
|
233
|
+
var v = fe, k = /* @__PURE__ */ Symbol.for("react.transitional.element"), A = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), h = /* @__PURE__ */ Symbol.for("react.strict_mode"), d = /* @__PURE__ */ Symbol.for("react.profiler"), b = /* @__PURE__ */ Symbol.for("react.consumer"), R = /* @__PURE__ */ Symbol.for("react.context"), _ = /* @__PURE__ */ Symbol.for("react.forward_ref"), I = /* @__PURE__ */ Symbol.for("react.suspense"), ie = /* @__PURE__ */ Symbol.for("react.suspense_list"), se = /* @__PURE__ */ Symbol.for("react.memo"), z = /* @__PURE__ */ Symbol.for("react.lazy"), ce = /* @__PURE__ */ Symbol.for("react.activity"), le = /* @__PURE__ */ Symbol.for("react.client.reference"), U = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = Object.prototype.hasOwnProperty, ue = Array.isArray, Q = console.createTask ? console.createTask : function() {
|
|
234
234
|
return null;
|
|
235
235
|
};
|
|
236
236
|
v = {
|
|
@@ -238,71 +238,71 @@ React keys must be passed directly to JSX without using spread:
|
|
|
238
238
|
return t();
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
|
-
var
|
|
241
|
+
var q, K = {}, H = v.react_stack_bottom_frame.bind(
|
|
242
242
|
v,
|
|
243
|
-
|
|
244
|
-
)(),
|
|
245
|
-
N.Fragment =
|
|
243
|
+
s
|
|
244
|
+
)(), B = Q(o(s)), X = {};
|
|
245
|
+
N.Fragment = T, N.jsx = function(t, p, y) {
|
|
246
246
|
var w = 1e4 > U.recentlyCreatedOwnerStacks++;
|
|
247
|
-
return
|
|
247
|
+
return i(
|
|
248
248
|
t,
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
p,
|
|
250
|
+
y,
|
|
251
251
|
!1,
|
|
252
|
-
w ? Error("react-stack-top-frame") :
|
|
253
|
-
w ? Q(
|
|
252
|
+
w ? Error("react-stack-top-frame") : H,
|
|
253
|
+
w ? Q(o(t)) : B
|
|
254
254
|
);
|
|
255
|
-
}, N.jsxs = function(t,
|
|
255
|
+
}, N.jsxs = function(t, p, y) {
|
|
256
256
|
var w = 1e4 > U.recentlyCreatedOwnerStacks++;
|
|
257
|
-
return
|
|
257
|
+
return i(
|
|
258
258
|
t,
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
p,
|
|
260
|
+
y,
|
|
261
261
|
!0,
|
|
262
|
-
w ? Error("react-stack-top-frame") :
|
|
263
|
-
w ? Q(
|
|
262
|
+
w ? Error("react-stack-top-frame") : H,
|
|
263
|
+
w ? Q(o(t)) : B
|
|
264
264
|
);
|
|
265
265
|
};
|
|
266
266
|
})()), N;
|
|
267
267
|
}
|
|
268
268
|
var re;
|
|
269
|
-
function
|
|
270
|
-
return re || (re = 1, process.env.NODE_ENV === "production" ? D.exports =
|
|
269
|
+
function ve() {
|
|
270
|
+
return re || (re = 1, process.env.NODE_ENV === "production" ? D.exports = he() : D.exports = ye()), D.exports;
|
|
271
271
|
}
|
|
272
|
-
var C =
|
|
273
|
-
const
|
|
274
|
-
const
|
|
272
|
+
var C = ve();
|
|
273
|
+
const ze = ({ IMaskMixin: e, ...r }) => {
|
|
274
|
+
const a = G(
|
|
275
275
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
276
|
-
() => e(({ TextField:
|
|
276
|
+
() => e(({ TextField: o, ...n }) => /* @__PURE__ */ C.jsx(o, { ...n })),
|
|
277
277
|
[e]
|
|
278
278
|
);
|
|
279
|
-
return /* @__PURE__ */ C.jsx(
|
|
280
|
-
}, S = pe({}),
|
|
279
|
+
return /* @__PURE__ */ C.jsx(a, { ...r });
|
|
280
|
+
}, S = pe({}), Ue = ({ children: e, apiURL: r, libraries: a, localStorageKeys: o }) => {
|
|
281
281
|
const n = G(
|
|
282
282
|
() => ({
|
|
283
283
|
apiURL: r,
|
|
284
|
-
libraries:
|
|
285
|
-
localStorageKeys:
|
|
284
|
+
libraries: a,
|
|
285
|
+
localStorageKeys: o
|
|
286
286
|
}),
|
|
287
|
-
[r,
|
|
287
|
+
[r, a, o]
|
|
288
288
|
);
|
|
289
289
|
return /* @__PURE__ */ C.jsx(S.Provider, { value: n, children: e });
|
|
290
|
-
},
|
|
291
|
-
const { libraries:
|
|
292
|
-
if (!
|
|
290
|
+
}, Qe = ({ data: e, ...r }) => {
|
|
291
|
+
const { libraries: a } = P(S), o = r?.reactRouter || a?.reactRouter, n = r?.gtm || a?.gtm;
|
|
292
|
+
if (!o)
|
|
293
293
|
throw new Error(
|
|
294
294
|
"React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView."
|
|
295
295
|
);
|
|
296
296
|
if (!n)
|
|
297
297
|
throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
|
|
298
|
-
const { useGoogleTagManager:
|
|
298
|
+
const { useGoogleTagManager: s } = n, { useLocation: c, Outlet: u } = o, { pathname: l } = c(), { sendEvent: f } = s();
|
|
299
299
|
return j(() => {
|
|
300
|
-
|
|
300
|
+
f({
|
|
301
301
|
event: "pageView",
|
|
302
302
|
pathname: l,
|
|
303
303
|
...e
|
|
304
304
|
});
|
|
305
|
-
}, [e, l,
|
|
305
|
+
}, [e, l, f]), /* @__PURE__ */ C.jsx(u, {});
|
|
306
306
|
}, F = (() => {
|
|
307
307
|
try {
|
|
308
308
|
return typeof global == "object" && global !== null && ("HermesInternal" in global || // Hermes JS engine
|
|
@@ -311,25 +311,25 @@ const We = ({ IMaskMixin: e, ...r }) => {
|
|
|
311
311
|
} catch {
|
|
312
312
|
return !1;
|
|
313
313
|
}
|
|
314
|
-
})(),
|
|
314
|
+
})(), we = "user", Ve = ({
|
|
315
315
|
tokenTypeKey: e = "tokenType",
|
|
316
316
|
tokenKey: r = "accessToken",
|
|
317
|
-
postContentType:
|
|
318
|
-
...
|
|
317
|
+
postContentType: a = "application/json",
|
|
318
|
+
...o
|
|
319
319
|
}) => {
|
|
320
|
-
const { apiURL: n =
|
|
320
|
+
const { apiURL: n = o.apiURL, libraries: s, localStorageKeys: c } = P(S), u = o?.userLocalStorageKey || c?.user || we, l = o?.axios || s?.axios;
|
|
321
321
|
if (!l)
|
|
322
322
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
323
323
|
if (!l?.defaults || F)
|
|
324
324
|
return null;
|
|
325
325
|
if (typeof window < "u" && window.localStorage) {
|
|
326
|
-
const
|
|
326
|
+
const f = localStorage.getItem(u), i = f ? JSON.parse(f) : null, m = i?.[e] ? i[e] : null, g = i?.[r] ? i[r] : null, v = f ? `${m} ${g}` : null;
|
|
327
327
|
v && (l.defaults.headers.common.Authorization = v);
|
|
328
328
|
}
|
|
329
|
-
return l.defaults.baseURL = n, l.defaults.headers.post["Content-Type"] =
|
|
330
|
-
},
|
|
331
|
-
const { libraries:
|
|
332
|
-
if (!
|
|
329
|
+
return l.defaults.baseURL = n, l.defaults.headers.post["Content-Type"] = a, null;
|
|
330
|
+
}, Me = ({ language: e, ...r }) => {
|
|
331
|
+
const { libraries: a } = P(S), o = r?.dayjs || a?.dayjs, n = r?.plugin || a?.dayjsPlugin;
|
|
332
|
+
if (!o)
|
|
333
333
|
throw new Error(
|
|
334
334
|
"Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig."
|
|
335
335
|
);
|
|
@@ -337,17 +337,17 @@ const We = ({ IMaskMixin: e, ...r }) => {
|
|
|
337
337
|
(async () => {
|
|
338
338
|
const c = e || navigator.language?.slice(0, 2) || "en";
|
|
339
339
|
n && n.forEach((u) => {
|
|
340
|
-
u &&
|
|
341
|
-
}), await import("dayjs/locale/en"), await import("dayjs/locale/fr"),
|
|
340
|
+
u && o.extend(u);
|
|
341
|
+
}), await import("dayjs/locale/en"), await import("dayjs/locale/fr"), o.locale(c);
|
|
342
342
|
})().then();
|
|
343
|
-
}, [
|
|
344
|
-
},
|
|
345
|
-
const { libraries:
|
|
343
|
+
}, [o, n, e]), null;
|
|
344
|
+
}, Ge = ({ debug: e, resources: r, ...a }) => {
|
|
345
|
+
const { libraries: o } = P(S), n = a?.i18 || o?.i18, { i18next: s, initReactI18next: c, languageDetector: u } = n || {};
|
|
346
346
|
if (F)
|
|
347
347
|
return null;
|
|
348
348
|
if (!n)
|
|
349
349
|
throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
350
|
-
return
|
|
350
|
+
return s?.isInitialized || (s.use(u).use(c).init({
|
|
351
351
|
debug: e,
|
|
352
352
|
fallbackLng: "en",
|
|
353
353
|
interpolation: {
|
|
@@ -361,32 +361,32 @@ const We = ({ IMaskMixin: e, ...r }) => {
|
|
|
361
361
|
resources: r,
|
|
362
362
|
returnNull: !1
|
|
363
363
|
}).then(() => {
|
|
364
|
-
document.documentElement.lang !==
|
|
365
|
-
}),
|
|
364
|
+
document.documentElement.lang !== s.resolvedLanguage && s.resolvedLanguage && document.documentElement.setAttribute("lang", s.resolvedLanguage);
|
|
365
|
+
}), s.on("languageChanged", (l) => {
|
|
366
366
|
document.documentElement.setAttribute("lang", l);
|
|
367
367
|
})), null;
|
|
368
|
-
},
|
|
368
|
+
}, Je = ({
|
|
369
369
|
dsn: e,
|
|
370
370
|
integrations: r,
|
|
371
|
-
tracesSampleRate:
|
|
372
|
-
replaysSessionSampleRate:
|
|
371
|
+
tracesSampleRate: a,
|
|
372
|
+
replaysSessionSampleRate: o,
|
|
373
373
|
replaysOnErrorSampleRate: n,
|
|
374
|
-
tracePropagationTargets:
|
|
374
|
+
tracePropagationTargets: s,
|
|
375
375
|
ignoreErrors: c,
|
|
376
376
|
debug: u,
|
|
377
377
|
environment: l,
|
|
378
|
-
release:
|
|
379
|
-
...
|
|
378
|
+
release: f,
|
|
379
|
+
...i
|
|
380
380
|
}) => {
|
|
381
|
-
const { libraries:
|
|
382
|
-
if (!
|
|
381
|
+
const { libraries: m } = P(S), g = i?.sentry || m?.sentry, v = i?.reactRouter || m?.reactRouter;
|
|
382
|
+
if (!g)
|
|
383
383
|
throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
384
384
|
if (!v)
|
|
385
385
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
386
|
-
if (
|
|
386
|
+
if (g.isInitialized())
|
|
387
387
|
return null;
|
|
388
|
-
const { createRoutesFromChildren:
|
|
389
|
-
return (u || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") &&
|
|
388
|
+
const { createRoutesFromChildren: k, matchRoutes: A, useLocation: T, useNavigationType: h } = v;
|
|
389
|
+
return (u || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && g.init({
|
|
390
390
|
debug: u,
|
|
391
391
|
dsn: e,
|
|
392
392
|
environment: l || "production",
|
|
@@ -400,22 +400,22 @@ const We = ({ IMaskMixin: e, ...r }) => {
|
|
|
400
400
|
/vite:preloadError/
|
|
401
401
|
],
|
|
402
402
|
integrations: [
|
|
403
|
-
|
|
404
|
-
createRoutesFromChildren:
|
|
403
|
+
g.reactRouterV6BrowserTracingIntegration({
|
|
404
|
+
createRoutesFromChildren: k,
|
|
405
405
|
matchRoutes: A,
|
|
406
406
|
useEffect: j,
|
|
407
|
-
useLocation:
|
|
408
|
-
useNavigationType:
|
|
407
|
+
useLocation: T,
|
|
408
|
+
useNavigationType: h
|
|
409
409
|
}),
|
|
410
410
|
...r || []
|
|
411
411
|
],
|
|
412
|
-
release:
|
|
412
|
+
release: f,
|
|
413
413
|
replaysOnErrorSampleRate: n || 1,
|
|
414
|
-
replaysSessionSampleRate:
|
|
415
|
-
tracePropagationTargets:
|
|
416
|
-
tracesSampleRate:
|
|
414
|
+
replaysSessionSampleRate: o || 0.1,
|
|
415
|
+
tracePropagationTargets: s,
|
|
416
|
+
tracesSampleRate: a || 1
|
|
417
417
|
}), null;
|
|
418
|
-
},
|
|
418
|
+
}, qe = () => (j(() => {
|
|
419
419
|
if (F)
|
|
420
420
|
return;
|
|
421
421
|
const e = (r) => {
|
|
@@ -427,18 +427,18 @@ const We = ({ IMaskMixin: e, ...r }) => {
|
|
|
427
427
|
return window.addEventListener("vite:preloadError", e), () => {
|
|
428
428
|
window.removeEventListener("vite:preloadError", e);
|
|
429
429
|
};
|
|
430
|
-
}, []), null), Ee = "user", Ke = ({ Fallback: e, isLogged: r, loginPath:
|
|
431
|
-
const { libraries:
|
|
430
|
+
}, []), null), ne = /* @__PURE__ */ new WeakMap(), Ee = "user", Ke = ({ Fallback: e, isLogged: r, loginPath: a = "/login", redirect401Path: o = "/login", ...n }) => {
|
|
431
|
+
const { libraries: s, localStorageKeys: c } = P(S), u = n?.reactRouter || s?.reactRouter, l = n?.axios || s?.axios, f = n?.localStorageKey || c?.user || Ee;
|
|
432
432
|
if (!u)
|
|
433
433
|
throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
434
|
-
const [
|
|
434
|
+
const [i, m] = W(null), { useLocation: g, Navigate: v, Outlet: k } = u, A = g(), T = typeof r == "function" ? r() : !!r, h = typeof T == "boolean" ? T : T?.isLogged;
|
|
435
435
|
return j(() => {
|
|
436
|
-
|
|
437
|
-
(
|
|
438
|
-
|
|
436
|
+
ne.has(l) || (ne.set(l, !0), l.interceptors.response.use(
|
|
437
|
+
(d) => d,
|
|
438
|
+
(d) => (typeof d == "object" && d && "response" in d && d.response && typeof d.response == "object" && "status" in d.response && d.response && typeof d.response == "object" && "status" in d.response && d?.response?.status === 401 && (typeof d == "object" && d && "config" in d && d.config && typeof d.config == "object" && "headers" in d.config && d.config.headers && typeof d.config.headers == "object" && "Authorization" in d.config.headers && d.config.headers.Authorization && (l.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(f)), m(o)), Promise.reject(d))
|
|
439
439
|
));
|
|
440
|
-
}, [l
|
|
441
|
-
},
|
|
440
|
+
}, [l, f, o]), h && !i ? /* @__PURE__ */ C.jsx(ge, { fallback: e, children: A.state?.from?.state && A.state?.from?.pathname === a ? /* @__PURE__ */ C.jsx(v, { to: A.state.from.state.from.pathname + A.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ C.jsx(k, {}) }) : /* @__PURE__ */ C.jsx(v, { to: a + A.search, state: { from: A }, replace: !0 });
|
|
441
|
+
}, Re = async () => {
|
|
442
442
|
if ("caches" in window)
|
|
443
443
|
try {
|
|
444
444
|
const e = await caches.keys();
|
|
@@ -446,12 +446,12 @@ const We = ({ IMaskMixin: e, ...r }) => {
|
|
|
446
446
|
} catch (e) {
|
|
447
447
|
console.error("Failed to clear caches:", e);
|
|
448
448
|
}
|
|
449
|
-
},
|
|
450
|
-
const
|
|
451
|
-
|
|
452
|
-
}, [
|
|
449
|
+
}, He = ({ autoUpdate: e, renderDialog: r, clearCachesOnReload: a }) => {
|
|
450
|
+
const o = me(null), [n, s] = W(!1), c = O(() => {
|
|
451
|
+
o.current && o.current.postMessage({ type: "SKIP_WAITING" }), a && localStorage.setItem("tracktor_clear_caches", "1"), window.location.reload();
|
|
452
|
+
}, [a]);
|
|
453
453
|
j(() => {
|
|
454
|
-
localStorage.getItem("tracktor_clear_caches") === "1" && (localStorage.removeItem("tracktor_clear_caches"),
|
|
454
|
+
localStorage.getItem("tracktor_clear_caches") === "1" && (localStorage.removeItem("tracktor_clear_caches"), Re().catch(console.error));
|
|
455
455
|
}, []);
|
|
456
456
|
const u = O(() => {
|
|
457
457
|
window.confirm("A new version is available. The app will reload now.") && c();
|
|
@@ -459,107 +459,107 @@ const We = ({ IMaskMixin: e, ...r }) => {
|
|
|
459
459
|
return j(() => {
|
|
460
460
|
if (!("serviceWorker" in navigator))
|
|
461
461
|
return;
|
|
462
|
-
let l,
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
},
|
|
466
|
-
const
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
},
|
|
462
|
+
let l, f;
|
|
463
|
+
const i = (g) => {
|
|
464
|
+
g && navigator.serviceWorker.controller && (o.current = g, s(!0));
|
|
465
|
+
}, m = () => {
|
|
466
|
+
const g = l?.installing;
|
|
467
|
+
g && (f = () => {
|
|
468
|
+
g.state === "installed" && i(g);
|
|
469
|
+
}, g.addEventListener("statechange", f));
|
|
470
470
|
};
|
|
471
471
|
return (async () => {
|
|
472
|
-
l = await navigator.serviceWorker.getRegistration(), l && (
|
|
472
|
+
l = await navigator.serviceWorker.getRegistration(), l && (i(l.waiting), l.addEventListener("updatefound", m));
|
|
473
473
|
})().catch(console.error), () => {
|
|
474
|
-
l?.removeEventListener("updatefound",
|
|
474
|
+
l?.removeEventListener("updatefound", m), f && l?.installing && l.installing.removeEventListener("statechange", f);
|
|
475
475
|
};
|
|
476
476
|
}, []), j(() => {
|
|
477
477
|
n && e && c();
|
|
478
478
|
}, [e, n, c]), j(() => {
|
|
479
479
|
n && !e && !r && u();
|
|
480
480
|
}, [r, u, n, e]), n && !e && r ? r(c) : null;
|
|
481
|
-
},
|
|
481
|
+
}, be = (e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase(), _e = (e) => {
|
|
482
482
|
const r = e.split(/[/\\]/).pop() || "";
|
|
483
483
|
return r.substring(0, r.lastIndexOf("."));
|
|
484
|
-
},
|
|
485
|
-
const
|
|
486
|
-
return
|
|
487
|
-
},
|
|
488
|
-
const n =
|
|
489
|
-
return e && typeof e == "object" && "operationId" in e &&
|
|
490
|
-
},
|
|
491
|
-
const
|
|
492
|
-
return e?.forEach((
|
|
493
|
-
o
|
|
484
|
+
}, Se = (e) => {
|
|
485
|
+
const o = e.split("/").filter((n) => n.length > 0).map((n) => n.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((l) => l.charAt(0).toUpperCase() + l.slice(1)).join("")).join("");
|
|
486
|
+
return o.charAt(0).toLowerCase() + o.slice(1);
|
|
487
|
+
}, Ae = (e) => (e.split("/").pop() || e).replace(/\.json$/, "").replace(/^openapi\./, ""), je = (e, r, a, o) => {
|
|
488
|
+
const n = Se(r), s = be(a), c = `${n}${s}`;
|
|
489
|
+
return e && typeof e == "object" && "operationId" in e && o?.includes(String(e.operationId)) ? `${c}AsQuery` : c;
|
|
490
|
+
}, Pe = (e, r) => {
|
|
491
|
+
const a = {};
|
|
492
|
+
return e?.forEach((o) => {
|
|
493
|
+
a[o] = {
|
|
494
494
|
query: {
|
|
495
495
|
useInfinite: !0,
|
|
496
496
|
useInfiniteQueryParam: "offset",
|
|
497
497
|
useQuery: !0
|
|
498
498
|
}
|
|
499
499
|
};
|
|
500
|
-
}), r?.filter((
|
|
501
|
-
o
|
|
500
|
+
}), r?.filter((o) => !a[o]).forEach((o) => {
|
|
501
|
+
a[o] = {
|
|
502
502
|
query: {
|
|
503
503
|
useQuery: !0
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
|
-
}), Object.keys(
|
|
507
|
-
}, Be = (e) => (Array.isArray(e) ? e : [e]).reduce((
|
|
508
|
-
const { output: n, useInfiniteIds:
|
|
506
|
+
}), Object.keys(a).length ? a : void 0;
|
|
507
|
+
}, Be = (e) => (Array.isArray(e) ? e : [e]).reduce((a, o) => {
|
|
508
|
+
const { output: n, useInfiniteIds: s, useQueryIds: c, input: u = "./openapi.json", customAxiosInstancePath: l, overrideApiName: f } = o || {}, i = f || Ae(u), m = l || "./node_modules/@tracktor/shared-module/dist/axiosCustomInstance.ts";
|
|
509
509
|
return {
|
|
510
|
-
...
|
|
511
|
-
[
|
|
510
|
+
...a,
|
|
511
|
+
[i]: {
|
|
512
512
|
input: u,
|
|
513
513
|
output: {
|
|
514
514
|
baseUrl: n?.baseUrl,
|
|
515
515
|
client: "react-query",
|
|
516
516
|
mode: "tags-split",
|
|
517
517
|
override: {
|
|
518
|
-
...(
|
|
519
|
-
operations:
|
|
518
|
+
...(s?.length || c?.length) && {
|
|
519
|
+
operations: Pe(s, c)
|
|
520
520
|
},
|
|
521
|
-
header: (
|
|
521
|
+
header: (g) => [
|
|
522
522
|
"Generated by orval 🍺",
|
|
523
|
-
...
|
|
524
|
-
...
|
|
523
|
+
...g.title ? [g.title] : [],
|
|
524
|
+
...g.description ? [g.description] : []
|
|
525
525
|
],
|
|
526
526
|
mutator: {
|
|
527
|
-
name: _e(
|
|
528
|
-
path:
|
|
527
|
+
name: _e(m),
|
|
528
|
+
path: m
|
|
529
529
|
},
|
|
530
|
-
operationName: (
|
|
530
|
+
operationName: (g, v, k) => je(g, v, k, c),
|
|
531
531
|
query: {
|
|
532
532
|
useQuery: !0
|
|
533
533
|
}
|
|
534
534
|
},
|
|
535
|
-
schemas: n?.schemas || `src/api/${
|
|
536
|
-
target: n?.target || `src/api/${
|
|
535
|
+
schemas: n?.schemas || `src/api/${i}/model`,
|
|
536
|
+
target: n?.target || `src/api/${i}/services/api.ts`,
|
|
537
537
|
...n
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
540
|
};
|
|
541
|
-
}, {}),
|
|
541
|
+
}, {}), Te = (e) => e && typeof e == "function", ke = (e) => e && typeof e == "function", Xe = ({
|
|
542
542
|
children: e,
|
|
543
543
|
defaultQueriesOptions: r,
|
|
544
|
-
defaultMutationsOptions:
|
|
545
|
-
...
|
|
544
|
+
defaultMutationsOptions: a,
|
|
545
|
+
...o
|
|
546
546
|
}) => {
|
|
547
|
-
const { libraries: n } = P(S),
|
|
548
|
-
if (!
|
|
547
|
+
const { libraries: n } = P(S), s = o?.QueryClient || n?.reactQuery?.QueryClient, c = o?.QueryClientProvider || n?.reactQuery?.QueryClientProvider;
|
|
548
|
+
if (!s)
|
|
549
549
|
throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
550
550
|
if (!c)
|
|
551
551
|
throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
552
|
-
if (!
|
|
552
|
+
if (!Te(c))
|
|
553
553
|
throw new Error("Provided QueryClientProvider dependencies are not valid.");
|
|
554
|
-
if (!
|
|
554
|
+
if (!ke(s))
|
|
555
555
|
throw new Error("Provided QueryClient dependencies are not valid.");
|
|
556
|
-
const u = new
|
|
556
|
+
const u = new s({
|
|
557
557
|
defaultOptions: {
|
|
558
558
|
mutations: {
|
|
559
|
-
...
|
|
559
|
+
...a
|
|
560
560
|
},
|
|
561
561
|
queries: {
|
|
562
|
-
getNextPageParam: (l,
|
|
562
|
+
getNextPageParam: (l, f, i) => l.length + (i || 0),
|
|
563
563
|
refetchOnWindowFocus: !1,
|
|
564
564
|
retry: 3,
|
|
565
565
|
...r
|
|
@@ -567,86 +567,86 @@ const We = ({ IMaskMixin: e, ...r }) => {
|
|
|
567
567
|
}
|
|
568
568
|
});
|
|
569
569
|
return /* @__PURE__ */ C.jsx(c, { client: u, children: e });
|
|
570
|
-
},
|
|
571
|
-
const { fractionDigits:
|
|
572
|
-
return Number.isNaN(
|
|
573
|
-
},
|
|
570
|
+
}, Ce = ({ library: e, date: r, format: a = "ll" }) => e(r).format(a), Ie = (e, r) => {
|
|
571
|
+
const { fractionDigits: a = 0, metric: o = "km", spacingBetween: n = !0 } = r || {}, s = Number(e), c = n ? " " : "";
|
|
572
|
+
return Number.isNaN(s) ? `0${c}${o}` : `${s.toFixed(a)}${c}${o}`;
|
|
573
|
+
}, xe = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((a) => a.length > 0 ? a.charAt(0).toUpperCase() + a.slice(1) : a).join(" "), Oe = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, Le = ({ path: e, size: r, apiURL: a }) => {
|
|
574
574
|
if (!e)
|
|
575
575
|
return "";
|
|
576
|
-
const
|
|
577
|
-
return typeof r == "number" &&
|
|
578
|
-
},
|
|
579
|
-
const { apiURL: r, libraries:
|
|
576
|
+
const o = Oe(e), n = `${a}${o}`, s = n.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
|
|
577
|
+
return typeof r == "number" && s ? `${n.replace("/files", `/thumbs/${r}`)}` : n;
|
|
578
|
+
}, Ze = (e) => {
|
|
579
|
+
const { apiURL: r, libraries: a } = P(S), o = e?.dayjs || a?.dayjs;
|
|
580
580
|
return {
|
|
581
581
|
dateAdapter: (c, u) => {
|
|
582
|
-
if (!
|
|
582
|
+
if (!o)
|
|
583
583
|
throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
584
|
-
return
|
|
584
|
+
return Ce({
|
|
585
585
|
date: c,
|
|
586
586
|
format: u,
|
|
587
|
-
library:
|
|
587
|
+
library: o
|
|
588
588
|
});
|
|
589
589
|
},
|
|
590
|
-
distanceAdapter:
|
|
590
|
+
distanceAdapter: Ie,
|
|
591
591
|
filePathAdapter: (c, u) => {
|
|
592
592
|
if (!r)
|
|
593
593
|
throw new Error(
|
|
594
594
|
"API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter."
|
|
595
595
|
);
|
|
596
|
-
return typeof c == "string" && /^https?:\/\//.test(c) ? c :
|
|
596
|
+
return typeof c == "string" && /^https?:\/\//.test(c) ? c : Le({
|
|
597
597
|
apiURL: r,
|
|
598
598
|
path: c,
|
|
599
599
|
size: u
|
|
600
600
|
});
|
|
601
601
|
},
|
|
602
|
-
worksiteNameAdapter:
|
|
602
|
+
worksiteNameAdapter: xe
|
|
603
603
|
};
|
|
604
|
-
},
|
|
605
|
-
const { libraries: r } = P(S), o = e?.axios || r?.axios,
|
|
604
|
+
}, et = (e) => {
|
|
605
|
+
const { libraries: r, localStorageKeys: a } = P(S), o = e?.axios || r?.axios, n = e?.localStorageKey || a?.user || "user";
|
|
606
606
|
if (!o)
|
|
607
607
|
throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
|
|
608
|
-
const
|
|
609
|
-
({ tokenType:
|
|
610
|
-
o.defaults.headers.common.Authorization = `${
|
|
608
|
+
const s = O(
|
|
609
|
+
({ tokenType: u, accessToken: l }) => {
|
|
610
|
+
o.defaults.headers.common.Authorization = `${u} ${l}`;
|
|
611
611
|
},
|
|
612
612
|
[o.defaults.headers.common]
|
|
613
|
-
),
|
|
613
|
+
), c = () => {
|
|
614
614
|
o.defaults.headers.common.Authorization = null;
|
|
615
615
|
};
|
|
616
616
|
return j(() => {
|
|
617
617
|
if (F)
|
|
618
618
|
return;
|
|
619
|
-
const
|
|
620
|
-
if (
|
|
619
|
+
const u = ({ newValue: l, key: f }) => {
|
|
620
|
+
if (f === n && l)
|
|
621
621
|
try {
|
|
622
|
-
const { accessToken:
|
|
623
|
-
|
|
624
|
-
} catch (
|
|
625
|
-
console.error("Failed to parse newValue from localStorage:",
|
|
622
|
+
const { accessToken: i, tokenType: m } = JSON.parse(l);
|
|
623
|
+
s({ accessToken: i, tokenType: m });
|
|
624
|
+
} catch (i) {
|
|
625
|
+
console.error("Failed to parse newValue from localStorage:", i);
|
|
626
626
|
}
|
|
627
627
|
};
|
|
628
|
-
return window.addEventListener("storage",
|
|
629
|
-
window.removeEventListener("storage",
|
|
628
|
+
return window.addEventListener("storage", u), () => {
|
|
629
|
+
window.removeEventListener("storage", u);
|
|
630
630
|
};
|
|
631
|
-
}, [
|
|
632
|
-
clearAuthenticationToken:
|
|
633
|
-
setAuthenticationToken:
|
|
631
|
+
}, [n, s]), {
|
|
632
|
+
clearAuthenticationToken: c,
|
|
633
|
+
setAuthenticationToken: s
|
|
634
634
|
};
|
|
635
|
-
}, Y = (e, r) => r === "short" ? e.split("-")[0] : e,
|
|
636
|
-
const [
|
|
635
|
+
}, Y = (e, r) => r === "short" ? e.split("-")[0] : e, tt = (e, r = "full") => {
|
|
636
|
+
const [a, o] = W(() => {
|
|
637
637
|
const n = e?.language || navigator.language;
|
|
638
638
|
return e && "isInitialized" in e && e.isInitialized, Y(n, r);
|
|
639
639
|
});
|
|
640
640
|
return j(() => {
|
|
641
|
-
e && "isInitialized" in e && e.isInitialized && e.language &&
|
|
642
|
-
const n = (
|
|
643
|
-
|
|
641
|
+
e && "isInitialized" in e && e.isInitialized && e.language && o(Y(e.language, r));
|
|
642
|
+
const n = (s) => {
|
|
643
|
+
o(Y(s, r));
|
|
644
644
|
};
|
|
645
645
|
return e?.on?.("languageChanged", n), () => {
|
|
646
646
|
e?.off?.("languageChanged", n);
|
|
647
647
|
};
|
|
648
|
-
}, [e, r]),
|
|
649
|
-
},
|
|
648
|
+
}, [e, r]), a;
|
|
649
|
+
}, Ne = "tracktor.filter", Fe = {
|
|
650
650
|
getFilter: () => {
|
|
651
651
|
},
|
|
652
652
|
getFilters: () => ({}),
|
|
@@ -654,163 +654,163 @@ const We = ({ IMaskMixin: e, ...r }) => {
|
|
|
654
654
|
},
|
|
655
655
|
setFilter: () => {
|
|
656
656
|
}
|
|
657
|
-
},
|
|
657
|
+
}, oe = (e) => {
|
|
658
658
|
try {
|
|
659
659
|
return JSON.parse(e);
|
|
660
660
|
} catch {
|
|
661
661
|
return e;
|
|
662
662
|
}
|
|
663
|
-
},
|
|
664
|
-
const
|
|
665
|
-
if (
|
|
663
|
+
}, ae = (e, r, a) => `${a}_${e}=>${r}`, $e = (e) => e.reduce((r, a) => {
|
|
664
|
+
const o = localStorage.getItem(a);
|
|
665
|
+
if (o)
|
|
666
666
|
try {
|
|
667
|
-
const n = JSON.parse(
|
|
668
|
-
|
|
667
|
+
const n = JSON.parse(o), s = Object.keys(n)?.[0];
|
|
668
|
+
s && (r[s] = Object.values(n)?.[0]);
|
|
669
669
|
} catch {
|
|
670
670
|
}
|
|
671
671
|
return r;
|
|
672
|
-
}, {}),
|
|
673
|
-
const { libraries: r, localStorageKeys:
|
|
674
|
-
}], [u, l] = W({}),
|
|
672
|
+
}, {}), rt = (e) => {
|
|
673
|
+
const { libraries: r, localStorageKeys: a } = P(S), o = e?.reactRouter || r?.reactRouter, { pathname: n } = o?.useLocation?.() ?? { pathname: "/" }, [s, c] = o?.useSearchParams?.() ?? [new URLSearchParams(), () => {
|
|
674
|
+
}], [u, l] = W({}), f = a?.filter || Ne, i = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, m = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
|
|
675
675
|
if (F)
|
|
676
|
-
return
|
|
677
|
-
if (!
|
|
676
|
+
return Fe;
|
|
677
|
+
if (!o)
|
|
678
678
|
throw new Error(
|
|
679
679
|
"React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of reactRouter."
|
|
680
680
|
);
|
|
681
|
-
const
|
|
682
|
-
(
|
|
683
|
-
), v = (
|
|
684
|
-
const
|
|
685
|
-
if (!
|
|
686
|
-
|
|
687
|
-
const I = { ...
|
|
688
|
-
return delete I[
|
|
689
|
-
}),
|
|
681
|
+
const g = () => Object.keys(localStorage).filter(
|
|
682
|
+
(h) => h.startsWith(f) && h.endsWith(e?.pathname || n)
|
|
683
|
+
), v = (h, d, b = !0) => {
|
|
684
|
+
const R = ae(h, e?.pathname || n, f);
|
|
685
|
+
if (!d || Array.isArray(d) && !d.length) {
|
|
686
|
+
i ? (s.delete(h), c(s)) : l((_) => {
|
|
687
|
+
const I = { ..._ };
|
|
688
|
+
return delete I[h], I;
|
|
689
|
+
}), m && localStorage.removeItem(R);
|
|
690
690
|
return;
|
|
691
691
|
}
|
|
692
|
-
|
|
692
|
+
m && b && d && localStorage.setItem(R, JSON.stringify({ ...s, [h]: d })), i && d ? (s.set(h, JSON.stringify(d)), c(s)) : !i && d && l((_) => ({ ..._, [h]: d }));
|
|
693
693
|
};
|
|
694
694
|
return {
|
|
695
|
-
getFilter: (
|
|
696
|
-
if (
|
|
697
|
-
const
|
|
698
|
-
if (
|
|
699
|
-
return
|
|
695
|
+
getFilter: (h, d) => {
|
|
696
|
+
if (i) {
|
|
697
|
+
const b = s.get(h);
|
|
698
|
+
if (b)
|
|
699
|
+
return oe(b);
|
|
700
700
|
} else {
|
|
701
|
-
const
|
|
702
|
-
if (
|
|
703
|
-
return
|
|
701
|
+
const b = u[h];
|
|
702
|
+
if (b !== void 0)
|
|
703
|
+
return b;
|
|
704
704
|
}
|
|
705
|
-
if (
|
|
706
|
-
const
|
|
707
|
-
if (
|
|
705
|
+
if (m) {
|
|
706
|
+
const b = ae(h, e?.pathname || n, f), R = localStorage.getItem(b);
|
|
707
|
+
if (R)
|
|
708
708
|
try {
|
|
709
|
-
const
|
|
710
|
-
return !
|
|
709
|
+
const _ = JSON.parse(R)[h];
|
|
710
|
+
return !i && _ !== void 0 && l((I) => ({ ...I, [h]: _ })), _;
|
|
711
711
|
} catch {
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
|
-
return
|
|
714
|
+
return d;
|
|
715
715
|
},
|
|
716
716
|
getFilters: () => {
|
|
717
|
-
const
|
|
718
|
-
if (
|
|
719
|
-
const
|
|
717
|
+
const h = m ? $e(g()) : {};
|
|
718
|
+
if (i) {
|
|
719
|
+
const d = Array.from(s.entries()).reduce((b, [R, _]) => (b[R] = oe(_), b), {});
|
|
720
720
|
return {
|
|
721
|
-
...
|
|
722
|
-
...
|
|
721
|
+
...h,
|
|
722
|
+
...d
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
725
|
return {
|
|
726
|
-
...
|
|
726
|
+
...h,
|
|
727
727
|
...u
|
|
728
728
|
};
|
|
729
729
|
},
|
|
730
|
-
handleFilter: (
|
|
731
|
-
if (
|
|
732
|
-
const
|
|
733
|
-
v(
|
|
730
|
+
handleFilter: (h, d) => (b, R) => {
|
|
731
|
+
if (R || Array.isArray(R) && R.length === 0) {
|
|
732
|
+
const _ = d || "value", I = typeof R == "object" && _ in R ? R[_] : R;
|
|
733
|
+
v(h, I);
|
|
734
734
|
return;
|
|
735
735
|
}
|
|
736
|
-
v(
|
|
736
|
+
v(h, void 0);
|
|
737
737
|
},
|
|
738
738
|
setFilter: v
|
|
739
739
|
};
|
|
740
|
-
},
|
|
740
|
+
}, nt = ({
|
|
741
741
|
data: e,
|
|
742
742
|
fetchNextPage: r,
|
|
743
|
-
isFetchingNextPage:
|
|
744
|
-
isInitialLoading:
|
|
743
|
+
isFetchingNextPage: a,
|
|
744
|
+
isInitialLoading: o,
|
|
745
745
|
isLoading: n,
|
|
746
|
-
enabled:
|
|
746
|
+
enabled: s = !0
|
|
747
747
|
}) => {
|
|
748
748
|
const c = O(
|
|
749
749
|
async (l) => {
|
|
750
|
-
|
|
750
|
+
a || !s || await r({ pageParam: l?.pageParam || l.visibleRowsCount });
|
|
751
751
|
},
|
|
752
|
-
[
|
|
752
|
+
[s, r, a]
|
|
753
753
|
), u = G(() => {
|
|
754
754
|
if (e)
|
|
755
|
-
return e.pages.reduce((l,
|
|
755
|
+
return e.pages.reduce((l, f) => [...l, ...f], []);
|
|
756
756
|
}, [e]);
|
|
757
757
|
return {
|
|
758
758
|
fetchNextPageOnRowsScrollEnd: c,
|
|
759
|
-
isLoading:
|
|
760
|
-
loadingVariant:
|
|
759
|
+
isLoading: a || n,
|
|
760
|
+
loadingVariant: o ? "skeleton" : "linear-progress",
|
|
761
761
|
rows: u
|
|
762
762
|
};
|
|
763
|
-
},
|
|
764
|
-
const { libraries: r } = P(S),
|
|
765
|
-
(
|
|
766
|
-
if (
|
|
767
|
-
const { response:
|
|
768
|
-
if (
|
|
769
|
-
return String(
|
|
770
|
-
if (
|
|
771
|
-
return String(
|
|
772
|
-
if (
|
|
773
|
-
return String(
|
|
774
|
-
if (
|
|
775
|
-
const { detail:
|
|
776
|
-
if (Array.isArray(
|
|
777
|
-
const { msg:
|
|
778
|
-
if (typeof
|
|
779
|
-
return String(
|
|
763
|
+
}, ot = (e) => {
|
|
764
|
+
const { libraries: r } = P(S), a = e?.i18 || r?.i18, o = e?.i18?.translateFunction || r?.i18?.translateFunction, n = a?.i18next?.t || o || ((f) => f), { unknownErrorTranslationKey: s = "error.unknownError" } = e || {}, c = n(s), u = O(
|
|
765
|
+
(f) => {
|
|
766
|
+
if (f && typeof f == "object" && "response" in f) {
|
|
767
|
+
const { response: i } = f || {};
|
|
768
|
+
if (i && typeof i == "object" && "reason" in i && i.reason)
|
|
769
|
+
return String(i.reason);
|
|
770
|
+
if (i && typeof i == "object" && "data" in i && i.data && typeof i.data == "object" && "reason" in i.data && i.data.reason)
|
|
771
|
+
return String(i.data.reason);
|
|
772
|
+
if (i && typeof i == "object" && "data" in i && i.data && typeof i.data == "object" && "message" in i.data && i.data.message)
|
|
773
|
+
return String(i.data.message);
|
|
774
|
+
if (i && typeof i == "object" && "data" in i && i.data && typeof i.data == "object" && "detail" in i.data) {
|
|
775
|
+
const { detail: m } = i.data;
|
|
776
|
+
if (Array.isArray(m) && m.length > 0 && typeof m[0] == "object" && m[0] !== null && "msg" in m[0]) {
|
|
777
|
+
const { msg: g } = m[0];
|
|
778
|
+
if (typeof g == "string")
|
|
779
|
+
return String(g);
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
782
|
}
|
|
783
|
-
return
|
|
783
|
+
return f instanceof Error ? f.message : c;
|
|
784
784
|
},
|
|
785
785
|
[c]
|
|
786
786
|
);
|
|
787
|
-
return { getErrorCode: O((
|
|
788
|
-
const { response:
|
|
789
|
-
return
|
|
787
|
+
return { getErrorCode: O((f) => {
|
|
788
|
+
const { response: i } = f || {};
|
|
789
|
+
return i?.error_code ? String(i?.error_code) : i?.data?.error_code ? String(i?.data?.error_code) : i?.error_code ? String(i?.error_code) : i?.data?.error_code ? String(i.data.error_code) : "unknown_error_code";
|
|
790
790
|
}, []), printError: u };
|
|
791
791
|
};
|
|
792
792
|
export {
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
793
|
+
Qe as GTMSendPageView,
|
|
794
|
+
Ve as InitializeAxiosConfig,
|
|
795
|
+
Me as InitializeDaysJSConfig,
|
|
796
|
+
Ge as InitializeI18nConfig,
|
|
797
|
+
Je as InitializeSentryConfig,
|
|
798
798
|
S as InjectDependenciesContext,
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
799
|
+
Ue as InjectDependenciesProvider,
|
|
800
|
+
ze as MaskTextField,
|
|
801
|
+
qe as PreloadErrorHandler,
|
|
802
|
+
Xe as QueryClientProviderWithConfig,
|
|
803
803
|
Ke as RequireAuth,
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
804
|
+
He as UpdateNotifier,
|
|
805
|
+
We as axiosCustomInstance,
|
|
806
|
+
Ce as dateAdapter,
|
|
807
|
+
Ie as distanceAdapter,
|
|
808
808
|
Be as getOrvalConfig,
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
809
|
+
Ze as useAdapter,
|
|
810
|
+
et as useAuth,
|
|
811
|
+
tt as useCurrentLanguage,
|
|
812
|
+
rt as useFilters,
|
|
813
|
+
nt as useInfiniteDataGrid,
|
|
814
|
+
ot as useResponseError,
|
|
815
|
+
xe as worksiteNameAdapter
|
|
816
816
|
};
|