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