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