@tracktor/shared-module 2.23.0 → 2.25.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,6 +1,6 @@
1
1
  import oe from "axios";
2
- import he, { useMemo as Z, createContext as ge, useContext as k, useEffect as I, useState as M, Suspense as me, useCallback as x, useRef as se } from "react";
3
- const Qe = (e, t) => {
2
+ import me, { useMemo as ne, createContext as pe, useContext as C, useEffect as N, useState as F, Suspense as ye, useRef as se, useCallback as I } from "react";
3
+ const Je = (e, t) => {
4
4
  const n = oe.CancelToken.source(), s = oe({
5
5
  ...e,
6
6
  ...t,
@@ -9,8 +9,8 @@ const Qe = (e, t) => {
9
9
  return s.cancel = () => {
10
10
  n.cancel("Query was cancelled");
11
11
  }, s;
12
- }, ye = 3e4, ae = 1e3;
13
- class Ee {
12
+ }, ve = 3e4, ae = 1e3;
13
+ class we {
14
14
  url;
15
15
  getToken;
16
16
  onEvent;
@@ -93,7 +93,7 @@ class Ee {
93
93
  }
94
94
  scheduleReconnect() {
95
95
  this.clearReconnectTimer();
96
- const t = Math.min(this.reconnectBaseDelay * 2 ** this.reconnectAttempt, ye);
96
+ const t = Math.min(this.reconnectBaseDelay * 2 ** this.reconnectAttempt, ve);
97
97
  this.reconnectAttempt++, this.reconnectTimer = setTimeout(() => {
98
98
  this.connect();
99
99
  }, t);
@@ -102,10 +102,10 @@ class Ee {
102
102
  this.reconnectTimer !== null && (clearTimeout(this.reconnectTimer), this.reconnectTimer = null);
103
103
  }
104
104
  }
105
- var Q = { exports: {} }, D = {};
105
+ var X = { exports: {} }, z = {};
106
106
  var ie;
107
- function ve() {
108
- if (ie) return D;
107
+ function Ee() {
108
+ if (ie) return z;
109
109
  ie = 1;
110
110
  var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
111
111
  function n(s, o, a) {
@@ -123,50 +123,50 @@ function ve() {
123
123
  props: a
124
124
  };
125
125
  }
126
- return D.Fragment = t, D.jsx = n, D.jsxs = n, D;
126
+ return z.Fragment = t, z.jsx = n, z.jsxs = n, z;
127
127
  }
128
- var Y = {};
128
+ var W = {};
129
129
  var ce;
130
- function we() {
130
+ function Re() {
131
131
  return ce || (ce = 1, process.env.NODE_ENV !== "production" && (function() {
132
132
  function e(r) {
133
133
  if (r == null) return null;
134
134
  if (typeof r == "function")
135
- return r.$$typeof === q ? null : r.displayName || r.name || null;
135
+ return r.$$typeof === S ? null : r.displayName || r.name || null;
136
136
  if (typeof r == "string") return r;
137
137
  switch (r) {
138
138
  case j:
139
139
  return "Fragment";
140
140
  case d:
141
141
  return "Profiler";
142
- case m:
142
+ case g:
143
143
  return "StrictMode";
144
- case C:
144
+ case x:
145
145
  return "Suspense";
146
- case T:
146
+ case A:
147
147
  return "SuspenseList";
148
- case K:
148
+ case Y:
149
149
  return "Activity";
150
150
  }
151
151
  if (typeof r == "object")
152
152
  switch (typeof r.tag == "number" && console.error(
153
153
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
154
154
  ), r.$$typeof) {
155
- case S:
155
+ case w:
156
156
  return "Portal";
157
157
  case E:
158
158
  return r.displayName || "Context";
159
- case y:
160
- return (r._context.displayName || "Context") + ".Consumer";
161
159
  case b:
162
- var p = r.render;
163
- return r = r.displayName, r || (r = p.displayName || p.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
164
- case G:
165
- return p = r.displayName || null, p !== null ? p : e(r.type) || "Memo";
160
+ return (r._context.displayName || "Context") + ".Consumer";
161
+ case T:
162
+ var f = r.render;
163
+ return r = r.displayName, r || (r = f.displayName || f.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
166
164
  case L:
167
- p = r._payload, r = r._init;
165
+ return f = r.displayName || null, f !== null ? f : e(r.type) || "Memo";
166
+ case D:
167
+ f = r._payload, r = r._init;
168
168
  try {
169
- return e(r(p));
169
+ return e(r(f));
170
170
  } catch {
171
171
  }
172
172
  }
@@ -178,15 +178,15 @@ function we() {
178
178
  function n(r) {
179
179
  try {
180
180
  t(r);
181
- var p = !1;
181
+ var f = !1;
182
182
  } catch {
183
- p = !0;
183
+ f = !0;
184
184
  }
185
- if (p) {
186
- p = console;
187
- var w = p.error, R = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
188
- return w.call(
189
- p,
185
+ if (f) {
186
+ f = console;
187
+ var v = f.error, R = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
188
+ return v.call(
189
+ f,
190
190
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
191
191
  R
192
192
  ), t(r);
@@ -194,54 +194,54 @@ function we() {
194
194
  }
195
195
  function s(r) {
196
196
  if (r === j) return "<>";
197
- if (typeof r == "object" && r !== null && r.$$typeof === L)
197
+ if (typeof r == "object" && r !== null && r.$$typeof === D)
198
198
  return "<...>";
199
199
  try {
200
- var p = e(r);
201
- return p ? "<" + p + ">" : "<...>";
200
+ var f = e(r);
201
+ return f ? "<" + f + ">" : "<...>";
202
202
  } catch {
203
203
  return "<...>";
204
204
  }
205
205
  }
206
206
  function o() {
207
- var r = $.A;
207
+ var r = M.A;
208
208
  return r === null ? null : r.getOwner();
209
209
  }
210
210
  function a() {
211
211
  return Error("react-stack-top-frame");
212
212
  }
213
213
  function c(r) {
214
- if (z.call(r, "key")) {
215
- var p = Object.getOwnPropertyDescriptor(r, "key").get;
216
- if (p && p.isReactWarning) return !1;
214
+ if (Q.call(r, "key")) {
215
+ var f = Object.getOwnPropertyDescriptor(r, "key").get;
216
+ if (f && f.isReactWarning) return !1;
217
217
  }
218
218
  return r.key !== void 0;
219
219
  }
220
- function l(r, p) {
221
- function w() {
222
- W || (W = !0, console.error(
220
+ function l(r, f) {
221
+ function v() {
222
+ J || (J = !0, console.error(
223
223
  "%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)",
224
- p
224
+ f
225
225
  ));
226
226
  }
227
- w.isReactWarning = !0, Object.defineProperty(r, "key", {
228
- get: w,
227
+ v.isReactWarning = !0, Object.defineProperty(r, "key", {
228
+ get: v,
229
229
  configurable: !0
230
230
  });
231
231
  }
232
232
  function u() {
233
233
  var r = e(this.type);
234
- return ee[r] || (ee[r] = !0, console.error(
234
+ return G[r] || (G[r] = !0, console.error(
235
235
  "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."
236
236
  )), r = this.props.ref, r !== void 0 ? r : null;
237
237
  }
238
- function f(r, p, w, R, V, H) {
239
- var _ = w.ref;
238
+ function p(r, f, v, R, H, te) {
239
+ var _ = v.ref;
240
240
  return r = {
241
241
  $$typeof: P,
242
242
  type: r,
243
- key: p,
244
- props: w,
243
+ key: f,
244
+ props: v,
245
245
  _owner: R
246
246
  }, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(r, "ref", {
247
247
  enumerable: !1,
@@ -260,33 +260,33 @@ function we() {
260
260
  configurable: !1,
261
261
  enumerable: !1,
262
262
  writable: !0,
263
- value: V
263
+ value: H
264
264
  }), Object.defineProperty(r, "_debugTask", {
265
265
  configurable: !1,
266
266
  enumerable: !1,
267
267
  writable: !0,
268
- value: H
268
+ value: te
269
269
  }), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
270
270
  }
271
- function i(r, p, w, R, V, H) {
272
- var _ = p.children;
271
+ function i(r, f, v, R, H, te) {
272
+ var _ = f.children;
273
273
  if (_ !== void 0)
274
274
  if (R)
275
- if (B(_)) {
275
+ if (ee(_)) {
276
276
  for (R = 0; R < _.length; R++)
277
- g(_[R]);
277
+ h(_[R]);
278
278
  Object.freeze && Object.freeze(_);
279
279
  } else
280
280
  console.error(
281
281
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
282
282
  );
283
- else g(_);
284
- if (z.call(p, "key")) {
283
+ else h(_);
284
+ if (Q.call(f, "key")) {
285
285
  _ = e(r);
286
- var N = Object.keys(p).filter(function(pe) {
287
- return pe !== "key";
286
+ var $ = Object.keys(f).filter(function(ge) {
287
+ return ge !== "key";
288
288
  });
289
- R = 0 < N.length ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}", ne[_ + R] || (N = 0 < N.length ? "{" + N.join(": ..., ") + ": ...}" : "{}", console.error(
289
+ R = 0 < $.length ? "{key: someKey, " + $.join(": ..., ") + ": ...}" : "{key: someKey}", B[_ + R] || ($ = 0 < $.length ? "{" + $.join(": ..., ") + ": ...}" : "{}", console.error(
290
290
  `A props object containing a "key" prop is being spread into JSX:
291
291
  let props = %s;
292
292
  <%s {...props} />
@@ -295,82 +295,82 @@ React keys must be passed directly to JSX without using spread:
295
295
  <%s key={someKey} {...props} />`,
296
296
  R,
297
297
  _,
298
- N,
298
+ $,
299
299
  _
300
- ), ne[_ + R] = !0);
300
+ ), B[_ + R] = !0);
301
301
  }
302
- if (_ = null, w !== void 0 && (n(w), _ = "" + w), c(p) && (n(p.key), _ = "" + p.key), "key" in p) {
303
- w = {};
304
- for (var X in p)
305
- X !== "key" && (w[X] = p[X]);
306
- } else w = p;
302
+ if (_ = null, v !== void 0 && (n(v), _ = "" + v), c(f) && (n(f.key), _ = "" + f.key), "key" in f) {
303
+ v = {};
304
+ for (var re in f)
305
+ re !== "key" && (v[re] = f[re]);
306
+ } else v = f;
307
307
  return _ && l(
308
- w,
308
+ v,
309
309
  typeof r == "function" ? r.displayName || r.name || "Unknown" : r
310
- ), f(
310
+ ), p(
311
311
  r,
312
312
  _,
313
- w,
313
+ v,
314
314
  o(),
315
- V,
316
- H
315
+ H,
316
+ te
317
317
  );
318
318
  }
319
- function g(r) {
320
- h(r) ? r._store && (r._store.validated = 1) : typeof r == "object" && r !== null && r.$$typeof === L && (r._payload.status === "fulfilled" ? h(r._payload.value) && r._payload.value._store && (r._payload.value._store.validated = 1) : r._store && (r._store.validated = 1));
321
- }
322
319
  function h(r) {
320
+ m(r) ? r._store && (r._store.validated = 1) : typeof r == "object" && r !== null && r.$$typeof === D && (r._payload.status === "fulfilled" ? m(r._payload.value) && r._payload.value._store && (r._payload.value._store.validated = 1) : r._store && (r._store.validated = 1));
321
+ }
322
+ function m(r) {
323
323
  return typeof r == "object" && r !== null && r.$$typeof === P;
324
324
  }
325
- var v = he, P = /* @__PURE__ */ Symbol.for("react.transitional.element"), S = /* @__PURE__ */ Symbol.for("react.portal"), j = /* @__PURE__ */ Symbol.for("react.fragment"), m = /* @__PURE__ */ Symbol.for("react.strict_mode"), d = /* @__PURE__ */ Symbol.for("react.profiler"), y = /* @__PURE__ */ Symbol.for("react.consumer"), E = /* @__PURE__ */ Symbol.for("react.context"), b = /* @__PURE__ */ Symbol.for("react.forward_ref"), C = /* @__PURE__ */ Symbol.for("react.suspense"), T = /* @__PURE__ */ Symbol.for("react.suspense_list"), G = /* @__PURE__ */ Symbol.for("react.memo"), L = /* @__PURE__ */ Symbol.for("react.lazy"), K = /* @__PURE__ */ Symbol.for("react.activity"), q = /* @__PURE__ */ Symbol.for("react.client.reference"), $ = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, z = Object.prototype.hasOwnProperty, B = Array.isArray, F = console.createTask ? console.createTask : function() {
325
+ var y = me, P = /* @__PURE__ */ Symbol.for("react.transitional.element"), w = /* @__PURE__ */ Symbol.for("react.portal"), j = /* @__PURE__ */ Symbol.for("react.fragment"), g = /* @__PURE__ */ Symbol.for("react.strict_mode"), d = /* @__PURE__ */ Symbol.for("react.profiler"), b = /* @__PURE__ */ Symbol.for("react.consumer"), E = /* @__PURE__ */ Symbol.for("react.context"), T = /* @__PURE__ */ Symbol.for("react.forward_ref"), x = /* @__PURE__ */ Symbol.for("react.suspense"), A = /* @__PURE__ */ Symbol.for("react.suspense_list"), L = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), Y = /* @__PURE__ */ Symbol.for("react.activity"), S = /* @__PURE__ */ Symbol.for("react.client.reference"), M = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Q = Object.prototype.hasOwnProperty, ee = Array.isArray, U = console.createTask ? console.createTask : function() {
326
326
  return null;
327
327
  };
328
- v = {
328
+ y = {
329
329
  react_stack_bottom_frame: function(r) {
330
330
  return r();
331
331
  }
332
332
  };
333
- var W, ee = {}, te = v.react_stack_bottom_frame.bind(
334
- v,
333
+ var J, G = {}, K = y.react_stack_bottom_frame.bind(
334
+ y,
335
335
  a
336
- )(), re = F(s(a)), ne = {};
337
- Y.Fragment = j, Y.jsx = function(r, p, w) {
338
- var R = 1e4 > $.recentlyCreatedOwnerStacks++;
336
+ )(), q = U(s(a)), B = {};
337
+ W.Fragment = j, W.jsx = function(r, f, v) {
338
+ var R = 1e4 > M.recentlyCreatedOwnerStacks++;
339
339
  return i(
340
340
  r,
341
- p,
342
- w,
341
+ f,
342
+ v,
343
343
  !1,
344
- R ? Error("react-stack-top-frame") : te,
345
- R ? F(s(r)) : re
344
+ R ? Error("react-stack-top-frame") : K,
345
+ R ? U(s(r)) : q
346
346
  );
347
- }, Y.jsxs = function(r, p, w) {
348
- var R = 1e4 > $.recentlyCreatedOwnerStacks++;
347
+ }, W.jsxs = function(r, f, v) {
348
+ var R = 1e4 > M.recentlyCreatedOwnerStacks++;
349
349
  return i(
350
350
  r,
351
- p,
352
- w,
351
+ f,
352
+ v,
353
353
  !0,
354
- R ? Error("react-stack-top-frame") : te,
355
- R ? F(s(r)) : re
354
+ R ? Error("react-stack-top-frame") : K,
355
+ R ? U(s(r)) : q
356
356
  );
357
357
  };
358
- })()), Y;
358
+ })()), W;
359
359
  }
360
360
  var le;
361
- function Re() {
362
- return le || (le = 1, process.env.NODE_ENV === "production" ? Q.exports = ve() : Q.exports = we()), Q.exports;
361
+ function _e() {
362
+ return le || (le = 1, process.env.NODE_ENV === "production" ? X.exports = Ee() : X.exports = Re()), X.exports;
363
363
  }
364
- var O = Re();
365
- const Je = ({ IMaskMixin: e, ...t }) => {
366
- const n = Z(
364
+ var O = _e();
365
+ const Ge = ({ IMaskMixin: e, ...t }) => {
366
+ const n = ne(
367
367
  // eslint-disable-next-line react/jsx-props-no-spreading
368
368
  () => e(({ TextField: s, ...o }) => /* @__PURE__ */ O.jsx(s, { ...o })),
369
369
  [e]
370
370
  );
371
371
  return /* @__PURE__ */ O.jsx(n, { ...t });
372
- }, A = ge({}), Ge = ({ children: e, apiURL: t, libraries: n, localStorageKeys: s }) => {
373
- const o = Z(
372
+ }, k = pe({}), Ke = ({ children: e, apiURL: t, libraries: n, localStorageKeys: s }) => {
373
+ const o = ne(
374
374
  () => ({
375
375
  apiURL: t,
376
376
  libraries: n,
@@ -378,24 +378,24 @@ const Je = ({ IMaskMixin: e, ...t }) => {
378
378
  }),
379
379
  [t, n, s]
380
380
  );
381
- return /* @__PURE__ */ O.jsx(A.Provider, { value: o, children: e });
382
- }, Ke = ({ data: e, ...t }) => {
383
- const { libraries: n } = k(A), s = t?.reactRouter || n?.reactRouter, o = t?.gtm || n?.gtm;
381
+ return /* @__PURE__ */ O.jsx(k.Provider, { value: o, children: e });
382
+ }, qe = ({ data: e, ...t }) => {
383
+ const { libraries: n } = C(k), s = t?.reactRouter || n?.reactRouter, o = t?.gtm || n?.gtm;
384
384
  if (!s)
385
385
  throw new Error(
386
386
  "React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView."
387
387
  );
388
388
  if (!o)
389
389
  throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
390
- const { useGoogleTagManager: a } = o, { useLocation: c, Outlet: l } = s, { pathname: u } = c(), { sendEvent: f } = a();
391
- return I(() => {
392
- f({
390
+ const { useGoogleTagManager: a } = o, { useLocation: c, Outlet: l } = s, { pathname: u } = c(), { sendEvent: p } = a();
391
+ return N(() => {
392
+ p({
393
393
  event: "pageView",
394
394
  pathname: u,
395
395
  ...e
396
396
  });
397
- }, [e, u, f]), /* @__PURE__ */ O.jsx(l, {});
398
- }, U = (() => {
397
+ }, [e, u, p]), /* @__PURE__ */ O.jsx(l, {});
398
+ }, V = (() => {
399
399
  try {
400
400
  return typeof global == "object" && global !== null && ("HermesInternal" in global || // Hermes JS engine
401
401
  "__fbBatchedBridge" in global || // RN Bridge
@@ -403,29 +403,29 @@ const Je = ({ IMaskMixin: e, ...t }) => {
403
403
  } catch {
404
404
  return !1;
405
405
  }
406
- })(), _e = "user", qe = ({
406
+ })(), be = "user", Be = ({
407
407
  tokenTypeKey: e = "tokenType",
408
408
  tokenKey: t = "accessToken",
409
409
  postContentType: n = "application/json",
410
410
  ...s
411
411
  }) => {
412
- const { apiURL: o = s.apiURL, libraries: a, localStorageKeys: c } = k(A), l = s?.userLocalStorageKey || c?.user || _e, u = s?.axios || a?.axios;
412
+ const { apiURL: o = s.apiURL, libraries: a, localStorageKeys: c } = C(k), l = s?.userLocalStorageKey || c?.user || be, u = s?.axios || a?.axios;
413
413
  if (!u)
414
414
  throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
415
- if (!u?.defaults || U)
415
+ if (!u?.defaults || V)
416
416
  return null;
417
417
  if (typeof window < "u" && window.localStorage) {
418
- const f = localStorage.getItem(l), i = f ? JSON.parse(f) : null, g = i?.[e] ? i[e] : null, h = i?.[t] ? i[t] : null, v = f ? `${g} ${h}` : null;
419
- v && (u.defaults.headers.common.Authorization = v);
418
+ const p = localStorage.getItem(l), i = p ? JSON.parse(p) : null, h = i?.[e] ? i[e] : null, m = i?.[t] ? i[t] : null, y = p ? `${h} ${m}` : null;
419
+ y && (u.defaults.headers.common.Authorization = y);
420
420
  }
421
421
  return u.defaults.baseURL = o, u.defaults.headers.post["Content-Type"] = n, null;
422
- }, Be = ({ language: e, ...t }) => {
423
- const { libraries: n } = k(A), s = t?.dayjs || n?.dayjs, o = t?.plugin || n?.dayjsPlugin;
422
+ }, He = ({ language: e, ...t }) => {
423
+ const { libraries: n } = C(k), s = t?.dayjs || n?.dayjs, o = t?.plugin || n?.dayjsPlugin;
424
424
  if (!s)
425
425
  throw new Error(
426
426
  "Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig."
427
427
  );
428
- return I(() => {
428
+ return N(() => {
429
429
  (async () => {
430
430
  const c = e || navigator.language?.slice(0, 2) || "en";
431
431
  o && o.forEach((l) => {
@@ -433,9 +433,9 @@ const Je = ({ IMaskMixin: e, ...t }) => {
433
433
  }), await import("dayjs/locale/en"), await import("dayjs/locale/fr"), s.locale(c);
434
434
  })().then();
435
435
  }, [s, o, e]), null;
436
- }, He = ({ debug: e, resources: t, ...n }) => {
437
- const { libraries: s } = k(A), o = n?.i18 || s?.i18, { i18next: a, initReactI18next: c, languageDetector: l } = o || {};
438
- if (U)
436
+ }, Xe = ({ debug: e, resources: t, ...n }) => {
437
+ const { libraries: s } = C(k), o = n?.i18 || s?.i18, { i18next: a, initReactI18next: c, languageDetector: l } = o || {};
438
+ if (V)
439
439
  return null;
440
440
  if (!o)
441
441
  throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
@@ -457,7 +457,7 @@ const Je = ({ IMaskMixin: e, ...t }) => {
457
457
  }), a.on("languageChanged", (u) => {
458
458
  document.documentElement.setAttribute("lang", u);
459
459
  })), null;
460
- }, Xe = ({
460
+ }, Ze = ({
461
461
  dsn: e,
462
462
  integrations: t,
463
463
  tracesSampleRate: n,
@@ -467,18 +467,18 @@ const Je = ({ IMaskMixin: e, ...t }) => {
467
467
  ignoreErrors: c,
468
468
  debug: l,
469
469
  environment: u,
470
- release: f,
470
+ release: p,
471
471
  ...i
472
472
  }) => {
473
- const { libraries: g } = k(A), h = i?.sentry || g?.sentry, v = i?.reactRouter || g?.reactRouter;
474
- if (!h)
473
+ const { libraries: h } = C(k), m = i?.sentry || h?.sentry, y = i?.reactRouter || h?.reactRouter;
474
+ if (!m)
475
475
  throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
476
- if (!v)
476
+ if (!y)
477
477
  throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
478
- if (h.isInitialized())
478
+ if (m.isInitialized())
479
479
  return null;
480
- const { createRoutesFromChildren: P, matchRoutes: S, useLocation: j, useNavigationType: m } = v;
481
- return (l || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && h.init({
480
+ const { createRoutesFromChildren: P, matchRoutes: w, useLocation: j, useNavigationType: g } = y;
481
+ return (l || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && m.init({
482
482
  debug: l,
483
483
  dsn: e,
484
484
  environment: u || "production",
@@ -492,23 +492,23 @@ const Je = ({ IMaskMixin: e, ...t }) => {
492
492
  /vite:preloadError/
493
493
  ],
494
494
  integrations: [
495
- h.reactRouterV6BrowserTracingIntegration({
495
+ m.reactRouterV6BrowserTracingIntegration({
496
496
  createRoutesFromChildren: P,
497
- matchRoutes: S,
498
- useEffect: I,
497
+ matchRoutes: w,
498
+ useEffect: N,
499
499
  useLocation: j,
500
- useNavigationType: m
500
+ useNavigationType: g
501
501
  }),
502
502
  ...t || []
503
503
  ],
504
- release: f,
504
+ release: p,
505
505
  replaysOnErrorSampleRate: o || 1,
506
506
  replaysSessionSampleRate: s || 0.1,
507
507
  tracePropagationTargets: a,
508
508
  tracesSampleRate: n || 1
509
509
  }), null;
510
- }, Ze = () => (I(() => {
511
- if (U)
510
+ }, et = () => (N(() => {
511
+ if (V)
512
512
  return;
513
513
  const e = (t) => {
514
514
  try {
@@ -519,27 +519,27 @@ const Je = ({ IMaskMixin: e, ...t }) => {
519
519
  return window.addEventListener("vite:preloadError", e), () => {
520
520
  window.removeEventListener("vite:preloadError", e);
521
521
  };
522
- }, []), null), ue = /* @__PURE__ */ new WeakMap(), be = "user", et = ({ Fallback: e, isLogged: t, loginPath: n = "/login", redirect401Path: s = "/login", ...o }) => {
523
- const { libraries: a, localStorageKeys: c } = k(A), l = o?.reactRouter || a?.reactRouter, u = o?.axios || a?.axios, f = o?.localStorageKey || c?.user || be;
522
+ }, []), null), ue = /* @__PURE__ */ new WeakMap(), Te = "user", tt = ({ Fallback: e, isLogged: t, loginPath: n = "/login", redirect401Path: s = "/login", ...o }) => {
523
+ const { libraries: a, localStorageKeys: c } = C(k), l = o?.reactRouter || a?.reactRouter, u = o?.axios || a?.axios, p = o?.localStorageKey || c?.user || Te;
524
524
  if (!l)
525
525
  throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
526
- const [i, g] = M(null), { useLocation: h, Navigate: v, Outlet: P } = l, S = h(), j = typeof t == "function" ? t() : !!t, m = typeof j == "boolean" ? j : j?.isLogged;
527
- return I(() => {
526
+ const [i, h] = F(null), { useLocation: m, Navigate: y, Outlet: P } = l, w = m(), j = typeof t == "function" ? t() : !!t, g = typeof j == "boolean" ? j : j?.isLogged;
527
+ return N(() => {
528
528
  ue.has(u) || (ue.set(u, !0), u.interceptors.response.use(
529
529
  (d) => d,
530
- (d) => (typeof d == "object" && d && "response" in d && d.response && typeof d.response == "object" && "status" in d.response && d.response && typeof d.response == "object" && "status" in d.response && d?.response?.status === 401 && (typeof d == "object" && d && "config" in d && d.config && typeof d.config == "object" && "headers" in d.config && d.config.headers && typeof d.config.headers == "object" && "Authorization" in d.config.headers && d.config.headers.Authorization && (u.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(f)), g(s)), Promise.reject(d))
530
+ (d) => (typeof d == "object" && d && "response" in d && d.response && typeof d.response == "object" && "status" in d.response && d.response && typeof d.response == "object" && "status" in d.response && d?.response?.status === 401 && (typeof d == "object" && d && "config" in d && d.config && typeof d.config == "object" && "headers" in d.config && d.config.headers && typeof d.config.headers == "object" && "Authorization" in d.config.headers && d.config.headers.Authorization && (u.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(p)), h(s)), Promise.reject(d))
531
531
  ));
532
- }, [u, f, s]), m && !i ? /* @__PURE__ */ O.jsx(me, { fallback: e, children: S.state?.from?.state && S.state?.from?.pathname === n ? /* @__PURE__ */ O.jsx(v, { to: S.state.from.state.from.pathname + S.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ O.jsx(P, {}) }) : /* @__PURE__ */ O.jsx(v, { to: n + S.search, state: { from: S }, replace: !0 });
533
- }, Te = (e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase(), Se = (e) => {
532
+ }, [u, p, s]), g && !i ? /* @__PURE__ */ O.jsx(ye, { fallback: e, children: w.state?.from?.state && w.state?.from?.pathname === n ? /* @__PURE__ */ O.jsx(y, { to: w.state.from.state.from.pathname + w.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ O.jsx(P, {}) }) : /* @__PURE__ */ O.jsx(y, { to: n + w.search, state: { from: w }, replace: !0 });
533
+ }, Se = (e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase(), Ae = (e) => {
534
534
  const t = e.split(/[/\\]/).pop() || "";
535
535
  return t.substring(0, t.lastIndexOf("."));
536
- }, Ae = (e) => {
536
+ }, je = (e) => {
537
537
  const s = e.split("/").filter((o) => o.length > 0).map((o) => o.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((u) => u.charAt(0).toUpperCase() + u.slice(1)).join("")).join("");
538
538
  return s.charAt(0).toLowerCase() + s.slice(1);
539
- }, je = (e) => (e.split("/").pop() || e).replace(/\.json$/, "").replace(/^openapi\./, ""), Ce = (e, t, n, s) => {
540
- const o = Ae(t), a = Te(n), c = `${o}${a}`;
539
+ }, Ce = (e) => (e.split("/").pop() || e).replace(/\.json$/, "").replace(/^openapi\./, ""), ke = (e, t, n, s) => {
540
+ const o = je(t), a = Se(n), c = `${o}${a}`;
541
541
  return e && typeof e == "object" && "operationId" in e && s?.includes(String(e.operationId)) ? `${c}AsQuery` : c;
542
- }, ke = (e, t) => {
542
+ }, Pe = (e, t) => {
543
543
  const n = {};
544
544
  return e?.forEach((s) => {
545
545
  n[s] = {
@@ -556,8 +556,8 @@ const Je = ({ IMaskMixin: e, ...t }) => {
556
556
  }
557
557
  };
558
558
  }), Object.keys(n).length ? n : void 0;
559
- }, tt = (e) => (Array.isArray(e) ? e : [e]).reduce((n, s) => {
560
- const { output: o, useInfiniteIds: a, useQueryIds: c, input: l = "./openapi.json", customAxiosInstancePath: u, overrideApiName: f } = s || {}, i = f || je(l), g = u || "./node_modules/@tracktor/shared-module/dist/axiosCustomInstance.ts";
559
+ }, rt = (e) => (Array.isArray(e) ? e : [e]).reduce((n, s) => {
560
+ const { output: o, useInfiniteIds: a, useQueryIds: c, input: l = "./openapi.json", customAxiosInstancePath: u, overrideApiName: p } = s || {}, i = p || Ce(l), h = u || "./node_modules/@tracktor/shared-module/dist/axiosCustomInstance.ts";
561
561
  return {
562
562
  ...n,
563
563
  [i]: {
@@ -568,18 +568,18 @@ const Je = ({ IMaskMixin: e, ...t }) => {
568
568
  mode: "tags-split",
569
569
  override: {
570
570
  ...(a?.length || c?.length) && {
571
- operations: ke(a, c)
571
+ operations: Pe(a, c)
572
572
  },
573
- header: (h) => [
573
+ header: (m) => [
574
574
  "Generated by orval 🍺",
575
- ...h.title ? [h.title] : [],
576
- ...h.description ? [h.description] : []
575
+ ...m.title ? [m.title] : [],
576
+ ...m.description ? [m.description] : []
577
577
  ],
578
578
  mutator: {
579
- name: Se(g),
580
- path: g
579
+ name: Ae(h),
580
+ path: h
581
581
  },
582
- operationName: (h, v, P) => Ce(h, v, P, c),
582
+ operationName: (m, y, P) => ke(m, y, P, c),
583
583
  query: {
584
584
  useQuery: !0
585
585
  }
@@ -590,20 +590,113 @@ const Je = ({ IMaskMixin: e, ...t }) => {
590
590
  }
591
591
  }
592
592
  };
593
- }, {}), Pe = (e) => e && typeof e == "function", xe = (e) => e && typeof e == "function", rt = ({
593
+ }, {}), xe = "user", Oe = (e) => {
594
+ const t = e.startsWith("https") ? "wss" : "ws", n = e.replace(/^https?:\/\//, "");
595
+ return `${t}://${n}/v2/threads/ws`;
596
+ }, Ie = (e) => {
597
+ try {
598
+ const t = localStorage.getItem(e);
599
+ return t ? JSON.parse(t)?.accessToken ?? null : null;
600
+ } catch {
601
+ return null;
602
+ }
603
+ }, he = pe(null), nt = ({ children: e, ...t }) => {
604
+ const [n, s] = F(!1), [o, a] = F(!1), [c, l] = F(0), { apiURL: u, localStorageKeys: p } = C(k), { reconnect: i = !0, enabled: h = !0, url: m, token: y } = t, P = p?.user || xe, w = se(null), j = se(t);
605
+ j.current = t, N(() => {
606
+ if (!h || w.current?.connected)
607
+ return;
608
+ const A = m || (u ? Oe(u) : null);
609
+ if (!A)
610
+ return;
611
+ const L = () => y ?? Ie(P), D = (S) => {
612
+ const {
613
+ onError: M,
614
+ onReady: Q,
615
+ onNewMessage: ee,
616
+ onNewMessageNotification: U,
617
+ onPresence: J,
618
+ onJoinedThread: G,
619
+ onLeftThread: K,
620
+ onMarkedRead: q,
621
+ onThreadsList: B
622
+ } = j.current || {};
623
+ switch (S.type) {
624
+ case "ready":
625
+ a(!0), l(S.unreadCount ?? 0), Q?.(S);
626
+ break;
627
+ case "new_message":
628
+ ee?.(S);
629
+ break;
630
+ case "new_message_notification":
631
+ l((r) => r + 1), U?.(S);
632
+ break;
633
+ case "presence":
634
+ J?.(S);
635
+ break;
636
+ case "error":
637
+ M?.(S);
638
+ break;
639
+ case "joined_thread":
640
+ G?.(S);
641
+ break;
642
+ case "left_thread":
643
+ K?.(S);
644
+ break;
645
+ case "marked_read":
646
+ l((r) => Math.max(0, r - 1)), q?.(S);
647
+ break;
648
+ case "threads_list":
649
+ B?.(S);
650
+ break;
651
+ }
652
+ }, Y = new we({
653
+ getToken: L,
654
+ onConnectionChange: (S) => {
655
+ s(S), S || a(!1);
656
+ },
657
+ onEvent: D,
658
+ reconnect: i,
659
+ url: A
660
+ });
661
+ return w.current = Y, Y.connect(), () => {
662
+ Y.disconnect(), w.current = null;
663
+ };
664
+ }, [h, m, y, u, i, P]);
665
+ const g = I((A) => {
666
+ w.current?.joinThread(A);
667
+ }, []), d = I((A) => {
668
+ w.current?.leaveThread(A);
669
+ }, []), b = I((A, L) => {
670
+ w.current?.sendMessage(A, L);
671
+ }, []), E = I((A) => {
672
+ w.current?.markRead(A);
673
+ }, []), T = I((A, L) => {
674
+ w.current?.listThreads(A, L);
675
+ }, []), x = {
676
+ isConnected: n,
677
+ isReady: o,
678
+ joinThread: g,
679
+ leaveThread: d,
680
+ listThreads: T,
681
+ markRead: E,
682
+ sendMessage: b,
683
+ unreadCount: c
684
+ };
685
+ return /* @__PURE__ */ O.jsx(he.Provider, { value: x, children: e });
686
+ }, Ne = (e) => e && typeof e == "function", Le = (e) => e && typeof e == "function", ot = ({
594
687
  children: e,
595
688
  defaultQueriesOptions: t,
596
689
  defaultMutationsOptions: n,
597
690
  ...s
598
691
  }) => {
599
- const { libraries: o } = k(A), a = s?.QueryClient || o?.reactQuery?.QueryClient, c = s?.QueryClientProvider || o?.reactQuery?.QueryClientProvider;
692
+ const { libraries: o } = C(k), a = s?.QueryClient || o?.reactQuery?.QueryClient, c = s?.QueryClientProvider || o?.reactQuery?.QueryClientProvider;
600
693
  if (!a)
601
694
  throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
602
695
  if (!c)
603
696
  throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
604
- if (!Pe(c))
697
+ if (!Ne(c))
605
698
  throw new Error("Provided QueryClientProvider dependencies are not valid.");
606
- if (!xe(a))
699
+ if (!Le(a))
607
700
  throw new Error("Provided QueryClient dependencies are not valid.");
608
701
  const l = new a({
609
702
  defaultOptions: {
@@ -611,7 +704,7 @@ const Je = ({ IMaskMixin: e, ...t }) => {
611
704
  ...n
612
705
  },
613
706
  queries: {
614
- getNextPageParam: (u, f, i) => u.length + (i || 0),
707
+ getNextPageParam: (u, p, i) => u.length + (i || 0),
615
708
  refetchOnWindowFocus: !1,
616
709
  retry: 3,
617
710
  ...t
@@ -619,45 +712,45 @@ const Je = ({ IMaskMixin: e, ...t }) => {
619
712
  }
620
713
  });
621
714
  return /* @__PURE__ */ O.jsx(c, { client: l, children: e });
622
- }, Oe = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), Ie = (e, t) => {
715
+ }, $e = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), Fe = (e, t) => {
623
716
  const { fractionDigits: n = 0, metric: s = "km", spacingBetween: o = !0 } = t || {}, a = Number(e), c = o ? " " : "";
624
717
  return Number.isNaN(a) ? `0${c}${s}` : `${a.toFixed(n)}${c}${s}`;
625
- }, Ne = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((n) => n.length > 0 ? n.charAt(0).toUpperCase() + n.slice(1) : n).join(" "), Le = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, $e = ({ path: e, size: t, apiURL: n }) => {
718
+ }, De = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((n) => n.length > 0 ? n.charAt(0).toUpperCase() + n.slice(1) : n).join(" "), Ye = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, Me = ({ path: e, size: t, apiURL: n }) => {
626
719
  if (!e)
627
720
  return "";
628
- const s = Le(e), o = `${n}${s}`, a = o.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
721
+ const s = Ye(e), o = `${n}${s}`, a = o.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
629
722
  return typeof t == "number" && a ? `${o.replace("/files", `/thumbs/${t}`)}` : o;
630
- }, nt = (e) => {
631
- const { apiURL: t, libraries: n } = k(A), s = e?.dayjs || n?.dayjs;
723
+ }, st = (e) => {
724
+ const { apiURL: t, libraries: n } = C(k), s = e?.dayjs || n?.dayjs;
632
725
  return {
633
726
  dateAdapter: (c, l) => {
634
727
  if (!s)
635
728
  throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
636
- return Oe({
729
+ return $e({
637
730
  date: c,
638
731
  format: l,
639
732
  library: s
640
733
  });
641
734
  },
642
- distanceAdapter: Ie,
735
+ distanceAdapter: Fe,
643
736
  filePathAdapter: (c, l) => {
644
737
  if (!t)
645
738
  throw new Error(
646
739
  "API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter."
647
740
  );
648
- return typeof c == "string" && /^https?:\/\//.test(c) ? c : $e({
741
+ return typeof c == "string" && /^https?:\/\//.test(c) ? c : Me({
649
742
  apiURL: t,
650
743
  path: c,
651
744
  size: l
652
745
  });
653
746
  },
654
- worksiteNameAdapter: Ne
747
+ worksiteNameAdapter: De
655
748
  };
656
- }, ot = (e) => {
657
- const { libraries: t, localStorageKeys: n } = k(A), s = e?.axios || t?.axios, o = e?.localStorageKey || n?.user || "user";
749
+ }, at = (e) => {
750
+ const { libraries: t, localStorageKeys: n } = C(k), s = e?.axios || t?.axios, o = e?.localStorageKey || n?.user || "user";
658
751
  if (!s)
659
752
  throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
660
- const a = x(
753
+ const a = I(
661
754
  ({ tokenType: l, accessToken: u }) => {
662
755
  s.defaults.headers.common.Authorization = `${l} ${u}`;
663
756
  },
@@ -665,14 +758,14 @@ const Je = ({ IMaskMixin: e, ...t }) => {
665
758
  ), c = () => {
666
759
  s.defaults.headers.common.Authorization = null;
667
760
  };
668
- return I(() => {
669
- if (U)
761
+ return N(() => {
762
+ if (V)
670
763
  return;
671
- const l = ({ newValue: u, key: f }) => {
672
- if (f === o && u)
764
+ const l = ({ newValue: u, key: p }) => {
765
+ if (p === o && u)
673
766
  try {
674
- const { accessToken: i, tokenType: g } = JSON.parse(u);
675
- a({ accessToken: i, tokenType: g });
767
+ const { accessToken: i, tokenType: h } = JSON.parse(u);
768
+ a({ accessToken: i, tokenType: h });
676
769
  } catch (i) {
677
770
  console.error("Failed to parse newValue from localStorage:", i);
678
771
  }
@@ -684,113 +777,26 @@ const Je = ({ IMaskMixin: e, ...t }) => {
684
777
  clearAuthenticationToken: c,
685
778
  setAuthenticationToken: a
686
779
  };
687
- }, Fe = "user", De = (e) => {
688
- const t = e.startsWith("https") ? "wss" : "ws", n = e.replace(/^https?:\/\//, "");
689
- return `${t}://${n}/v2/threads/ws`;
690
- }, Ye = (e) => {
691
- try {
692
- const t = localStorage.getItem(e);
693
- return t ? JSON.parse(t)?.accessToken ?? null : null;
694
- } catch {
695
- return null;
696
- }
697
- }, st = (e) => {
698
- const [t, n] = M(!1), [s, o] = M(!1), { apiURL: a, localStorageKeys: c } = k(A), { reconnect: l = !0, enabled: u = !0, url: f, token: i } = e || {}, g = c?.user || Fe, h = se(null), v = se(e);
699
- v.current = e, I(() => {
700
- if (!u)
701
- return;
702
- const y = f || (a ? De(a) : null);
703
- if (!y)
704
- return;
705
- const E = () => i ?? Ye(g), b = (T) => {
706
- const {
707
- onError: G,
708
- onReady: L,
709
- onNewMessage: K,
710
- onNewMessageNotification: q,
711
- onPresence: $,
712
- onJoinedThread: z,
713
- onLeftThread: B,
714
- onMarkedRead: F,
715
- onThreadsList: W
716
- } = v.current || {};
717
- switch (T.type) {
718
- case "ready":
719
- o(!0), L?.(T);
720
- break;
721
- case "new_message":
722
- K?.(T);
723
- break;
724
- case "new_message_notification":
725
- q?.(T);
726
- break;
727
- case "presence":
728
- $?.(T);
729
- break;
730
- case "error":
731
- G?.(T);
732
- break;
733
- case "joined_thread":
734
- z?.(T);
735
- break;
736
- case "left_thread":
737
- B?.(T);
738
- break;
739
- case "marked_read":
740
- F?.(T);
741
- break;
742
- case "threads_list":
743
- W?.(T);
744
- break;
745
- }
746
- }, C = new Ee({
747
- getToken: E,
748
- onConnectionChange: (T) => {
749
- n(T), T || o(!1);
750
- },
751
- onEvent: b,
752
- reconnect: l,
753
- url: y
754
- });
755
- return h.current = C, C.connect(), () => {
756
- C.disconnect(), h.current = null;
757
- };
758
- }, [u, f, i, a, l, g]);
759
- const P = x((y) => {
760
- h.current?.joinThread(y);
761
- }, []), S = x((y) => {
762
- h.current?.leaveThread(y);
763
- }, []), j = x((y, E) => {
764
- h.current?.sendMessage(y, E);
765
- }, []), m = x((y) => {
766
- h.current?.markRead(y);
767
- }, []), d = x((y, E) => {
768
- h.current?.listThreads(y, E);
769
- }, []);
770
- return {
771
- isConnected: t,
772
- isReady: s,
773
- joinThread: P,
774
- leaveThread: S,
775
- listThreads: d,
776
- markRead: m,
777
- sendMessage: j
778
- };
779
- }, J = (e, t) => t === "short" ? e.split("-")[0] : e, at = (e, t = "full") => {
780
- const [n, s] = M(() => {
780
+ }, it = () => {
781
+ const e = C(he);
782
+ if (!e)
783
+ throw new Error("useChat must be used within ChatProvider");
784
+ return e;
785
+ }, Z = (e, t) => t === "short" ? e.split("-")[0] : e, ct = (e, t = "full") => {
786
+ const [n, s] = F(() => {
781
787
  const o = e?.language || navigator.language;
782
- return e && "isInitialized" in e && e.isInitialized, J(o, t);
788
+ return e && "isInitialized" in e && e.isInitialized, Z(o, t);
783
789
  });
784
- return I(() => {
785
- e && "isInitialized" in e && e.isInitialized && e.language && s(J(e.language, t));
790
+ return N(() => {
791
+ e && "isInitialized" in e && e.isInitialized && e.language && s(Z(e.language, t));
786
792
  const o = (a) => {
787
- s(J(a, t));
793
+ s(Z(a, t));
788
794
  };
789
795
  return e?.on?.("languageChanged", o), () => {
790
796
  e?.off?.("languageChanged", o);
791
797
  };
792
798
  }, [e, t]), n;
793
- }, Me = "tracktor.filter", Ue = {
799
+ }, Ue = "tracktor.filter", ze = {
794
800
  getFilter: () => {
795
801
  },
796
802
  getFilters: () => ({}),
@@ -804,7 +810,7 @@ const Je = ({ IMaskMixin: e, ...t }) => {
804
810
  } catch {
805
811
  return e;
806
812
  }
807
- }, fe = (e, t, n) => `${n}_${e}=>${t}`, ze = (e) => e.reduce((t, n) => {
813
+ }, fe = (e, t, n) => `${n}_${e}=>${t}`, We = (e) => e.reduce((t, n) => {
808
814
  const s = localStorage.getItem(n);
809
815
  if (s)
810
816
  try {
@@ -813,75 +819,75 @@ const Je = ({ IMaskMixin: e, ...t }) => {
813
819
  } catch {
814
820
  }
815
821
  return t;
816
- }, {}), it = (e) => {
817
- const { libraries: t, localStorageKeys: n } = k(A), s = e?.reactRouter || t?.reactRouter, { pathname: o } = s?.useLocation?.() ?? { pathname: "/" }, [a, c] = s?.useSearchParams?.() ?? [new URLSearchParams(), () => {
818
- }], [l, u] = M({}), f = n?.filter || Me, i = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, g = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
819
- if (U)
820
- return Ue;
822
+ }, {}), lt = (e) => {
823
+ const { libraries: t, localStorageKeys: n } = C(k), s = e?.reactRouter || t?.reactRouter, { pathname: o } = s?.useLocation?.() ?? { pathname: "/" }, [a, c] = s?.useSearchParams?.() ?? [new URLSearchParams(), () => {
824
+ }], [l, u] = F({}), p = n?.filter || Ue, i = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, h = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
825
+ if (V)
826
+ return ze;
821
827
  if (!s)
822
828
  throw new Error(
823
829
  "React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of reactRouter."
824
830
  );
825
- const h = () => Object.keys(localStorage).filter(
826
- (m) => m.startsWith(f) && m.endsWith(e?.pathname || o)
827
- ), v = (m, d, y = !0) => {
828
- const E = fe(m, e?.pathname || o, f);
831
+ const m = () => Object.keys(localStorage).filter(
832
+ (g) => g.startsWith(p) && g.endsWith(e?.pathname || o)
833
+ ), y = (g, d, b = !0) => {
834
+ const E = fe(g, e?.pathname || o, p);
829
835
  if (!d || Array.isArray(d) && !d.length) {
830
- i ? (a.delete(m), c(a)) : u((b) => {
831
- const C = { ...b };
832
- return delete C[m], C;
833
- }), g && localStorage.removeItem(E);
836
+ i ? (a.delete(g), c(a)) : u((T) => {
837
+ const x = { ...T };
838
+ return delete x[g], x;
839
+ }), h && localStorage.removeItem(E);
834
840
  return;
835
841
  }
836
- g && y && d && localStorage.setItem(E, JSON.stringify({ ...a, [m]: d })), i && d ? (a.set(m, JSON.stringify(d)), c(a)) : !i && d && u((b) => ({ ...b, [m]: d }));
842
+ h && b && d && localStorage.setItem(E, JSON.stringify({ ...a, [g]: d })), i && d ? (a.set(g, JSON.stringify(d)), c(a)) : !i && d && u((T) => ({ ...T, [g]: d }));
837
843
  };
838
844
  return {
839
- getFilter: (m, d) => {
845
+ getFilter: (g, d) => {
840
846
  if (i) {
841
- const y = a.get(m);
842
- if (y)
843
- return de(y);
847
+ const b = a.get(g);
848
+ if (b)
849
+ return de(b);
844
850
  } else {
845
- const y = l[m];
846
- if (y !== void 0)
847
- return y;
851
+ const b = l[g];
852
+ if (b !== void 0)
853
+ return b;
848
854
  }
849
- if (g) {
850
- const y = fe(m, e?.pathname || o, f), E = localStorage.getItem(y);
855
+ if (h) {
856
+ const b = fe(g, e?.pathname || o, p), E = localStorage.getItem(b);
851
857
  if (E)
852
858
  try {
853
- const b = JSON.parse(E)[m];
854
- return !i && b !== void 0 && u((C) => ({ ...C, [m]: b })), b;
859
+ const T = JSON.parse(E)[g];
860
+ return !i && T !== void 0 && u((x) => ({ ...x, [g]: T })), T;
855
861
  } catch {
856
862
  }
857
863
  }
858
864
  return d;
859
865
  },
860
866
  getFilters: () => {
861
- const m = g ? ze(h()) : {};
867
+ const g = h ? We(m()) : {};
862
868
  if (i) {
863
- const d = Array.from(a.entries()).reduce((y, [E, b]) => (y[E] = de(b), y), {});
869
+ const d = Array.from(a.entries()).reduce((b, [E, T]) => (b[E] = de(T), b), {});
864
870
  return {
865
- ...m,
871
+ ...g,
866
872
  ...d
867
873
  };
868
874
  }
869
875
  return {
870
- ...m,
876
+ ...g,
871
877
  ...l
872
878
  };
873
879
  },
874
- handleFilter: (m, d) => (y, E) => {
880
+ handleFilter: (g, d) => (b, E) => {
875
881
  if (E || Array.isArray(E) && E.length === 0) {
876
- const b = d || "value", C = typeof E == "object" && b in E ? E[b] : E;
877
- v(m, C);
882
+ const T = d || "value", x = typeof E == "object" && T in E ? E[T] : E;
883
+ y(g, x);
878
884
  return;
879
885
  }
880
- v(m, void 0);
886
+ y(g, void 0);
881
887
  },
882
- setFilter: v
888
+ setFilter: y
883
889
  };
884
- }, ct = ({
890
+ }, ut = ({
885
891
  data: e,
886
892
  fetchNextPage: t,
887
893
  isFetchingNextPage: n,
@@ -889,14 +895,14 @@ const Je = ({ IMaskMixin: e, ...t }) => {
889
895
  isLoading: o,
890
896
  enabled: a = !0
891
897
  }) => {
892
- const c = x(
898
+ const c = I(
893
899
  async (u) => {
894
900
  n || !a || await t({ pageParam: u?.pageParam || u.visibleRowsCount });
895
901
  },
896
902
  [a, t, n]
897
- ), l = Z(() => {
903
+ ), l = ne(() => {
898
904
  if (e)
899
- return e.pages.reduce((u, f) => [...u, ...f], []);
905
+ return e.pages.reduce((u, p) => [...u, ...p], []);
900
906
  }, [e]);
901
907
  return {
902
908
  fetchNextPageOnRowsScrollEnd: c,
@@ -904,11 +910,11 @@ const Je = ({ IMaskMixin: e, ...t }) => {
904
910
  loadingVariant: s ? "skeleton" : "linear-progress",
905
911
  rows: l
906
912
  };
907
- }, lt = (e) => {
908
- const { libraries: t } = k(A), n = e?.i18 || t?.i18, s = e?.i18?.translateFunction || t?.i18?.translateFunction, o = n?.i18next?.t || s || ((f) => f), { unknownErrorTranslationKey: a = "error.unknownError" } = e || {}, c = o(a), l = x(
909
- (f) => {
910
- if (f && typeof f == "object" && "response" in f) {
911
- const { response: i } = f || {};
913
+ }, dt = (e) => {
914
+ const { libraries: t } = C(k), n = e?.i18 || t?.i18, s = e?.i18?.translateFunction || t?.i18?.translateFunction, o = n?.i18next?.t || s || ((p) => p), { unknownErrorTranslationKey: a = "error.unknownError" } = e || {}, c = o(a), l = I(
915
+ (p) => {
916
+ if (p && typeof p == "object" && "response" in p) {
917
+ const { response: i } = p || {};
912
918
  if (i && typeof i == "object" && "reason" in i && i.reason)
913
919
  return String(i.reason);
914
920
  if (i && typeof i == "object" && "data" in i && i.data && typeof i.data == "object" && "reason" in i.data && i.data.reason)
@@ -916,46 +922,48 @@ const Je = ({ IMaskMixin: e, ...t }) => {
916
922
  if (i && typeof i == "object" && "data" in i && i.data && typeof i.data == "object" && "message" in i.data && i.data.message)
917
923
  return String(i.data.message);
918
924
  if (i && typeof i == "object" && "data" in i && i.data && typeof i.data == "object" && "detail" in i.data) {
919
- const { detail: g } = i.data;
920
- if (Array.isArray(g) && g.length > 0 && typeof g[0] == "object" && g[0] !== null && "msg" in g[0]) {
921
- const { msg: h } = g[0];
922
- if (typeof h == "string")
923
- return String(h);
925
+ const { detail: h } = i.data;
926
+ if (Array.isArray(h) && h.length > 0 && typeof h[0] == "object" && h[0] !== null && "msg" in h[0]) {
927
+ const { msg: m } = h[0];
928
+ if (typeof m == "string")
929
+ return String(m);
924
930
  }
925
931
  }
926
932
  }
927
- return f instanceof Error ? f.message : c;
933
+ return p instanceof Error ? p.message : c;
928
934
  },
929
935
  [c]
930
936
  );
931
- return { getErrorCode: x((f) => {
932
- const { response: i } = f || {};
937
+ return { getErrorCode: I((p) => {
938
+ const { response: i } = p || {};
933
939
  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";
934
940
  }, []), printError: l };
935
941
  };
936
942
  export {
937
- Ee as ChatClient,
938
- Ke as GTMSendPageView,
939
- qe as InitializeAxiosConfig,
940
- Be as InitializeDaysJSConfig,
941
- He as InitializeI18nConfig,
942
- Xe as InitializeSentryConfig,
943
- A as InjectDependenciesContext,
944
- Ge as InjectDependenciesProvider,
945
- Je as MaskTextField,
946
- Ze as PreloadErrorHandler,
947
- rt as QueryClientProviderWithConfig,
948
- et as RequireAuth,
949
- Qe as axiosCustomInstance,
950
- Oe as dateAdapter,
951
- Ie as distanceAdapter,
952
- tt as getOrvalConfig,
953
- nt as useAdapter,
954
- ot as useAuth,
955
- st as useChat,
956
- at as useCurrentLanguage,
957
- it as useFilters,
958
- ct as useInfiniteDataGrid,
959
- lt as useResponseError,
960
- Ne as worksiteNameAdapter
943
+ we as ChatClient,
944
+ he as ChatContext,
945
+ nt as ChatProvider,
946
+ qe as GTMSendPageView,
947
+ Be as InitializeAxiosConfig,
948
+ He as InitializeDaysJSConfig,
949
+ Xe as InitializeI18nConfig,
950
+ Ze as InitializeSentryConfig,
951
+ k as InjectDependenciesContext,
952
+ Ke as InjectDependenciesProvider,
953
+ Ge as MaskTextField,
954
+ et as PreloadErrorHandler,
955
+ ot as QueryClientProviderWithConfig,
956
+ tt as RequireAuth,
957
+ Je as axiosCustomInstance,
958
+ $e as dateAdapter,
959
+ Fe as distanceAdapter,
960
+ rt as getOrvalConfig,
961
+ st as useAdapter,
962
+ at as useAuth,
963
+ it as useChat,
964
+ ct as useCurrentLanguage,
965
+ lt as useFilters,
966
+ ut as useInfiniteDataGrid,
967
+ dt as useResponseError,
968
+ De as worksiteNameAdapter
961
969
  };