@tracktor/shared-module 1.0.8 → 1.0.10

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.
@@ -0,0 +1,944 @@
1
+ import Ie, { useState as Rr, useRef as _r, useEffect as X, Suspense as Cr, createContext as Tr, useMemo as ue, useContext as Ne, useCallback as ie } from "react";
2
+ import D from "axios";
3
+ import { useLocation as le, Navigate as Me, Outlet as We, createRoutesFromChildren as Sr, matchRoutes as wr, useNavigationType as Or } from "react-router-dom";
4
+ import { useGoogleTagManager as xr } from "@tracktor/react-google-tag-manager";
5
+ import I from "i18next";
6
+ import jr from "i18next-browser-languagedetector";
7
+ import { initReactI18next as Pr } from "react-i18next";
8
+ import * as oe from "@sentry/react";
9
+ import Ar from "mapbox-gl";
10
+ import U from "dayjs";
11
+ import { QueryClient as kr, QueryClientProvider as Dr } from "@tanstack/react-query";
12
+ var $r = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
13
+ function Mr(t) {
14
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
15
+ }
16
+ var se = { exports: {} }, V = {};
17
+ /**
18
+ * @license React
19
+ * react-jsx-runtime.development.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */
26
+ var Fe;
27
+ function Fr() {
28
+ return Fe || (Fe = 1, process.env.NODE_ENV !== "production" && function() {
29
+ var t = Ie, a = Symbol.for("react.element"), i = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), v = Symbol.for("react.provider"), c = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), $ = Symbol.iterator, x = "@@iterator";
30
+ function R(e) {
31
+ if (e === null || typeof e != "object")
32
+ return null;
33
+ var r = $ && e[$] || e[x];
34
+ return typeof r == "function" ? r : null;
35
+ }
36
+ var k = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
37
+ function _(e) {
38
+ {
39
+ for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), u = 1; u < r; u++)
40
+ o[u - 1] = arguments[u];
41
+ F("error", e, o);
42
+ }
43
+ }
44
+ function F(e, r, o) {
45
+ {
46
+ var u = k.ReactDebugCurrentFrame, p = u.getStackAddendum();
47
+ p !== "" && (r += "%s", o = o.concat([p]));
48
+ var m = o.map(function(d) {
49
+ return String(d);
50
+ });
51
+ m.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, m);
52
+ }
53
+ }
54
+ var ze = !1, Ue = !1, qe = !1, Be = !1, Ge = !1, fe;
55
+ fe = Symbol.for("react.module.reference");
56
+ function Je(e) {
57
+ return !!(typeof e == "string" || typeof e == "function" || e === s || e === g || Ge || e === n || e === y || e === h || Be || e === O || ze || Ue || qe || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === C || e.$$typeof === v || e.$$typeof === c || e.$$typeof === l || // This needs to include all possible module reference object
58
+ // types supported by any Flight configuration anywhere since
59
+ // we don't know which Flight build this will end up being used
60
+ // with.
61
+ e.$$typeof === fe || e.getModuleId !== void 0));
62
+ }
63
+ function He(e, r, o) {
64
+ var u = e.displayName;
65
+ if (u)
66
+ return u;
67
+ var p = r.displayName || r.name || "";
68
+ return p !== "" ? o + "(" + p + ")" : o;
69
+ }
70
+ function de(e) {
71
+ return e.displayName || "Context";
72
+ }
73
+ function j(e) {
74
+ if (e == null)
75
+ return null;
76
+ if (typeof e.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
77
+ return e.displayName || e.name || null;
78
+ if (typeof e == "string")
79
+ return e;
80
+ switch (e) {
81
+ case s:
82
+ return "Fragment";
83
+ case i:
84
+ return "Portal";
85
+ case g:
86
+ return "Profiler";
87
+ case n:
88
+ return "StrictMode";
89
+ case y:
90
+ return "Suspense";
91
+ case h:
92
+ return "SuspenseList";
93
+ }
94
+ if (typeof e == "object")
95
+ switch (e.$$typeof) {
96
+ case c:
97
+ var r = e;
98
+ return de(r) + ".Consumer";
99
+ case v:
100
+ var o = e;
101
+ return de(o._context) + ".Provider";
102
+ case l:
103
+ return He(e, e.render, "ForwardRef");
104
+ case C:
105
+ var u = e.displayName || null;
106
+ return u !== null ? u : j(e.type) || "Memo";
107
+ case T: {
108
+ var p = e, m = p._payload, d = p._init;
109
+ try {
110
+ return j(d(m));
111
+ } catch {
112
+ return null;
113
+ }
114
+ }
115
+ }
116
+ return null;
117
+ }
118
+ var M = Object.assign, N = 0, pe, ve, me, ge, he, ye, be;
119
+ function Ee() {
120
+ }
121
+ Ee.__reactDisabledLog = !0;
122
+ function Xe() {
123
+ {
124
+ if (N === 0) {
125
+ pe = console.log, ve = console.info, me = console.warn, ge = console.error, he = console.group, ye = console.groupCollapsed, be = console.groupEnd;
126
+ var e = {
127
+ configurable: !0,
128
+ enumerable: !0,
129
+ value: Ee,
130
+ writable: !0
131
+ };
132
+ Object.defineProperties(console, {
133
+ info: e,
134
+ log: e,
135
+ warn: e,
136
+ error: e,
137
+ group: e,
138
+ groupCollapsed: e,
139
+ groupEnd: e
140
+ });
141
+ }
142
+ N++;
143
+ }
144
+ }
145
+ function Ze() {
146
+ {
147
+ if (N--, N === 0) {
148
+ var e = {
149
+ configurable: !0,
150
+ enumerable: !0,
151
+ writable: !0
152
+ };
153
+ Object.defineProperties(console, {
154
+ log: M({}, e, {
155
+ value: pe
156
+ }),
157
+ info: M({}, e, {
158
+ value: ve
159
+ }),
160
+ warn: M({}, e, {
161
+ value: me
162
+ }),
163
+ error: M({}, e, {
164
+ value: ge
165
+ }),
166
+ group: M({}, e, {
167
+ value: he
168
+ }),
169
+ groupCollapsed: M({}, e, {
170
+ value: ye
171
+ }),
172
+ groupEnd: M({}, e, {
173
+ value: be
174
+ })
175
+ });
176
+ }
177
+ N < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
178
+ }
179
+ }
180
+ var Z = k.ReactCurrentDispatcher, K;
181
+ function q(e, r, o) {
182
+ {
183
+ if (K === void 0)
184
+ try {
185
+ throw Error();
186
+ } catch (p) {
187
+ var u = p.stack.trim().match(/\n( *(at )?)/);
188
+ K = u && u[1] || "";
189
+ }
190
+ return `
191
+ ` + K + e;
192
+ }
193
+ }
194
+ var Q = !1, B;
195
+ {
196
+ var Ke = typeof WeakMap == "function" ? WeakMap : Map;
197
+ B = new Ke();
198
+ }
199
+ function Re(e, r) {
200
+ if (!e || Q)
201
+ return "";
202
+ {
203
+ var o = B.get(e);
204
+ if (o !== void 0)
205
+ return o;
206
+ }
207
+ var u;
208
+ Q = !0;
209
+ var p = Error.prepareStackTrace;
210
+ Error.prepareStackTrace = void 0;
211
+ var m;
212
+ m = Z.current, Z.current = null, Xe();
213
+ try {
214
+ if (r) {
215
+ var d = function() {
216
+ throw Error();
217
+ };
218
+ if (Object.defineProperty(d.prototype, "props", {
219
+ set: function() {
220
+ throw Error();
221
+ }
222
+ }), typeof Reflect == "object" && Reflect.construct) {
223
+ try {
224
+ Reflect.construct(d, []);
225
+ } catch (P) {
226
+ u = P;
227
+ }
228
+ Reflect.construct(e, [], d);
229
+ } else {
230
+ try {
231
+ d.call();
232
+ } catch (P) {
233
+ u = P;
234
+ }
235
+ e.call(d.prototype);
236
+ }
237
+ } else {
238
+ try {
239
+ throw Error();
240
+ } catch (P) {
241
+ u = P;
242
+ }
243
+ e();
244
+ }
245
+ } catch (P) {
246
+ if (P && u && typeof P.stack == "string") {
247
+ for (var f = P.stack.split(`
248
+ `), S = u.stack.split(`
249
+ `), b = f.length - 1, E = S.length - 1; b >= 1 && E >= 0 && f[b] !== S[E]; )
250
+ E--;
251
+ for (; b >= 1 && E >= 0; b--, E--)
252
+ if (f[b] !== S[E]) {
253
+ if (b !== 1 || E !== 1)
254
+ do
255
+ if (b--, E--, E < 0 || f[b] !== S[E]) {
256
+ var w = `
257
+ ` + f[b].replace(" at new ", " at ");
258
+ return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && B.set(e, w), w;
259
+ }
260
+ while (b >= 1 && E >= 0);
261
+ break;
262
+ }
263
+ }
264
+ } finally {
265
+ Q = !1, Z.current = m, Ze(), Error.prepareStackTrace = p;
266
+ }
267
+ var Y = e ? e.displayName || e.name : "", $e = Y ? q(Y) : "";
268
+ return typeof e == "function" && B.set(e, $e), $e;
269
+ }
270
+ function Qe(e, r, o) {
271
+ return Re(e, !1);
272
+ }
273
+ function er(e) {
274
+ var r = e.prototype;
275
+ return !!(r && r.isReactComponent);
276
+ }
277
+ function G(e, r, o) {
278
+ if (e == null)
279
+ return "";
280
+ if (typeof e == "function")
281
+ return Re(e, er(e));
282
+ if (typeof e == "string")
283
+ return q(e);
284
+ switch (e) {
285
+ case y:
286
+ return q("Suspense");
287
+ case h:
288
+ return q("SuspenseList");
289
+ }
290
+ if (typeof e == "object")
291
+ switch (e.$$typeof) {
292
+ case l:
293
+ return Qe(e.render);
294
+ case C:
295
+ return G(e.type, r, o);
296
+ case T: {
297
+ var u = e, p = u._payload, m = u._init;
298
+ try {
299
+ return G(m(p), r, o);
300
+ } catch {
301
+ }
302
+ }
303
+ }
304
+ return "";
305
+ }
306
+ var J = Object.prototype.hasOwnProperty, _e = {}, Ce = k.ReactDebugCurrentFrame;
307
+ function H(e) {
308
+ if (e) {
309
+ var r = e._owner, o = G(e.type, e._source, r ? r.type : null);
310
+ Ce.setExtraStackFrame(o);
311
+ } else
312
+ Ce.setExtraStackFrame(null);
313
+ }
314
+ function rr(e, r, o, u, p) {
315
+ {
316
+ var m = Function.call.bind(J);
317
+ for (var d in e)
318
+ if (m(e, d)) {
319
+ var f = void 0;
320
+ try {
321
+ if (typeof e[d] != "function") {
322
+ var S = Error((u || "React class") + ": " + o + " type `" + d + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[d] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
323
+ throw S.name = "Invariant Violation", S;
324
+ }
325
+ f = e[d](r, d, u, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
326
+ } catch (b) {
327
+ f = b;
328
+ }
329
+ f && !(f instanceof Error) && (H(p), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", u || "React class", o, d, typeof f), H(null)), f instanceof Error && !(f.message in _e) && (_e[f.message] = !0, H(p), _("Failed %s type: %s", o, f.message), H(null));
330
+ }
331
+ }
332
+ }
333
+ var tr = Array.isArray;
334
+ function ee(e) {
335
+ return tr(e);
336
+ }
337
+ function nr(e) {
338
+ {
339
+ var r = typeof Symbol == "function" && Symbol.toStringTag, o = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
340
+ return o;
341
+ }
342
+ }
343
+ function ar(e) {
344
+ try {
345
+ return Te(e), !1;
346
+ } catch {
347
+ return !0;
348
+ }
349
+ }
350
+ function Te(e) {
351
+ return "" + e;
352
+ }
353
+ function Se(e) {
354
+ if (ar(e))
355
+ return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", nr(e)), Te(e);
356
+ }
357
+ var W = k.ReactCurrentOwner, or = {
358
+ key: !0,
359
+ ref: !0,
360
+ __self: !0,
361
+ __source: !0
362
+ }, we, Oe, re;
363
+ re = {};
364
+ function ir(e) {
365
+ if (J.call(e, "ref")) {
366
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
367
+ if (r && r.isReactWarning)
368
+ return !1;
369
+ }
370
+ return e.ref !== void 0;
371
+ }
372
+ function sr(e) {
373
+ if (J.call(e, "key")) {
374
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
375
+ if (r && r.isReactWarning)
376
+ return !1;
377
+ }
378
+ return e.key !== void 0;
379
+ }
380
+ function ur(e, r) {
381
+ if (typeof e.ref == "string" && W.current && r && W.current.stateNode !== r) {
382
+ var o = j(W.current.type);
383
+ re[o] || (_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', j(W.current.type), e.ref), re[o] = !0);
384
+ }
385
+ }
386
+ function lr(e, r) {
387
+ {
388
+ var o = function() {
389
+ we || (we = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
390
+ };
391
+ o.isReactWarning = !0, Object.defineProperty(e, "key", {
392
+ get: o,
393
+ configurable: !0
394
+ });
395
+ }
396
+ }
397
+ function cr(e, r) {
398
+ {
399
+ var o = function() {
400
+ Oe || (Oe = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
401
+ };
402
+ o.isReactWarning = !0, Object.defineProperty(e, "ref", {
403
+ get: o,
404
+ configurable: !0
405
+ });
406
+ }
407
+ }
408
+ var fr = function(e, r, o, u, p, m, d) {
409
+ var f = {
410
+ // This tag allows us to uniquely identify this as a React Element
411
+ $$typeof: a,
412
+ // Built-in properties that belong on the element
413
+ type: e,
414
+ key: r,
415
+ ref: o,
416
+ props: d,
417
+ // Record the component responsible for creating this element.
418
+ _owner: m
419
+ };
420
+ return f._store = {}, Object.defineProperty(f._store, "validated", {
421
+ configurable: !1,
422
+ enumerable: !1,
423
+ writable: !0,
424
+ value: !1
425
+ }), Object.defineProperty(f, "_self", {
426
+ configurable: !1,
427
+ enumerable: !1,
428
+ writable: !1,
429
+ value: u
430
+ }), Object.defineProperty(f, "_source", {
431
+ configurable: !1,
432
+ enumerable: !1,
433
+ writable: !1,
434
+ value: p
435
+ }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
436
+ };
437
+ function dr(e, r, o, u, p) {
438
+ {
439
+ var m, d = {}, f = null, S = null;
440
+ o !== void 0 && (Se(o), f = "" + o), sr(r) && (Se(r.key), f = "" + r.key), ir(r) && (S = r.ref, ur(r, p));
441
+ for (m in r)
442
+ J.call(r, m) && !or.hasOwnProperty(m) && (d[m] = r[m]);
443
+ if (e && e.defaultProps) {
444
+ var b = e.defaultProps;
445
+ for (m in b)
446
+ d[m] === void 0 && (d[m] = b[m]);
447
+ }
448
+ if (f || S) {
449
+ var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
450
+ f && lr(d, E), S && cr(d, E);
451
+ }
452
+ return fr(e, f, S, p, u, W.current, d);
453
+ }
454
+ }
455
+ var te = k.ReactCurrentOwner, xe = k.ReactDebugCurrentFrame;
456
+ function L(e) {
457
+ if (e) {
458
+ var r = e._owner, o = G(e.type, e._source, r ? r.type : null);
459
+ xe.setExtraStackFrame(o);
460
+ } else
461
+ xe.setExtraStackFrame(null);
462
+ }
463
+ var ne;
464
+ ne = !1;
465
+ function ae(e) {
466
+ return typeof e == "object" && e !== null && e.$$typeof === a;
467
+ }
468
+ function je() {
469
+ {
470
+ if (te.current) {
471
+ var e = j(te.current.type);
472
+ if (e)
473
+ return `
474
+
475
+ Check the render method of \`` + e + "`.";
476
+ }
477
+ return "";
478
+ }
479
+ }
480
+ function pr(e) {
481
+ {
482
+ if (e !== void 0) {
483
+ var r = e.fileName.replace(/^.*[\\\/]/, ""), o = e.lineNumber;
484
+ return `
485
+
486
+ Check your code at ` + r + ":" + o + ".";
487
+ }
488
+ return "";
489
+ }
490
+ }
491
+ var Pe = {};
492
+ function vr(e) {
493
+ {
494
+ var r = je();
495
+ if (!r) {
496
+ var o = typeof e == "string" ? e : e.displayName || e.name;
497
+ o && (r = `
498
+
499
+ Check the top-level render call using <` + o + ">.");
500
+ }
501
+ return r;
502
+ }
503
+ }
504
+ function Ae(e, r) {
505
+ {
506
+ if (!e._store || e._store.validated || e.key != null)
507
+ return;
508
+ e._store.validated = !0;
509
+ var o = vr(r);
510
+ if (Pe[o])
511
+ return;
512
+ Pe[o] = !0;
513
+ var u = "";
514
+ e && e._owner && e._owner !== te.current && (u = " It was passed a child from " + j(e._owner.type) + "."), L(e), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, u), L(null);
515
+ }
516
+ }
517
+ function ke(e, r) {
518
+ {
519
+ if (typeof e != "object")
520
+ return;
521
+ if (ee(e))
522
+ for (var o = 0; o < e.length; o++) {
523
+ var u = e[o];
524
+ ae(u) && Ae(u, r);
525
+ }
526
+ else if (ae(e))
527
+ e._store && (e._store.validated = !0);
528
+ else if (e) {
529
+ var p = R(e);
530
+ if (typeof p == "function" && p !== e.entries)
531
+ for (var m = p.call(e), d; !(d = m.next()).done; )
532
+ ae(d.value) && Ae(d.value, r);
533
+ }
534
+ }
535
+ }
536
+ function mr(e) {
537
+ {
538
+ var r = e.type;
539
+ if (r == null || typeof r == "string")
540
+ return;
541
+ var o;
542
+ if (typeof r == "function")
543
+ o = r.propTypes;
544
+ else if (typeof r == "object" && (r.$$typeof === l || // Note: Memo only checks outer props here.
545
+ // Inner props are checked in the reconciler.
546
+ r.$$typeof === C))
547
+ o = r.propTypes;
548
+ else
549
+ return;
550
+ if (o) {
551
+ var u = j(r);
552
+ rr(o, e.props, "prop", u, e);
553
+ } else if (r.PropTypes !== void 0 && !ne) {
554
+ ne = !0;
555
+ var p = j(r);
556
+ _("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
557
+ }
558
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
559
+ }
560
+ }
561
+ function gr(e) {
562
+ {
563
+ for (var r = Object.keys(e.props), o = 0; o < r.length; o++) {
564
+ var u = r[o];
565
+ if (u !== "children" && u !== "key") {
566
+ L(e), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), L(null);
567
+ break;
568
+ }
569
+ }
570
+ e.ref !== null && (L(e), _("Invalid attribute `ref` supplied to `React.Fragment`."), L(null));
571
+ }
572
+ }
573
+ function De(e, r, o, u, p, m) {
574
+ {
575
+ var d = Je(e);
576
+ if (!d) {
577
+ var f = "";
578
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (f += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
+ var S = pr(p);
580
+ S ? f += S : f += je();
581
+ var b;
582
+ e === null ? b = "null" : ee(e) ? b = "array" : e !== void 0 && e.$$typeof === a ? (b = "<" + (j(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, f);
583
+ }
584
+ var E = dr(e, r, o, p, m);
585
+ if (E == null)
586
+ return E;
587
+ if (d) {
588
+ var w = r.children;
589
+ if (w !== void 0)
590
+ if (u)
591
+ if (ee(w)) {
592
+ for (var Y = 0; Y < w.length; Y++)
593
+ ke(w[Y], e);
594
+ Object.freeze && Object.freeze(w);
595
+ } else
596
+ _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
+ else
598
+ ke(w, e);
599
+ }
600
+ return e === s ? gr(E) : mr(E), E;
601
+ }
602
+ }
603
+ function hr(e, r, o) {
604
+ return De(e, r, o, !0);
605
+ }
606
+ function yr(e, r, o) {
607
+ return De(e, r, o, !1);
608
+ }
609
+ var br = yr, Er = hr;
610
+ V.Fragment = s, V.jsx = br, V.jsxs = Er;
611
+ }()), V;
612
+ }
613
+ var z = {};
614
+ /**
615
+ * @license React
616
+ * react-jsx-runtime.production.min.js
617
+ *
618
+ * Copyright (c) Facebook, Inc. and its affiliates.
619
+ *
620
+ * This source code is licensed under the MIT license found in the
621
+ * LICENSE file in the root directory of this source tree.
622
+ */
623
+ var Le;
624
+ function Lr() {
625
+ if (Le)
626
+ return z;
627
+ Le = 1;
628
+ var t = Ie, a = Symbol.for("react.element"), i = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, n = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
629
+ function v(c, l, y) {
630
+ var h, C = {}, T = null, O = null;
631
+ y !== void 0 && (T = "" + y), l.key !== void 0 && (T = "" + l.key), l.ref !== void 0 && (O = l.ref);
632
+ for (h in l)
633
+ s.call(l, h) && !g.hasOwnProperty(h) && (C[h] = l[h]);
634
+ if (c && c.defaultProps)
635
+ for (h in l = c.defaultProps, l)
636
+ C[h] === void 0 && (C[h] = l[h]);
637
+ return { $$typeof: a, type: c, key: T, ref: O, props: C, _owner: n.current };
638
+ }
639
+ return z.Fragment = i, z.jsx = v, z.jsxs = v, z;
640
+ }
641
+ process.env.NODE_ENV === "production" ? se.exports = Lr() : se.exports = Fr();
642
+ var A = se.exports;
643
+ const nt = ({
644
+ Fallback: t,
645
+ loginPath: a = "/login",
646
+ localStorageKey: i = "user",
647
+ redirect401Path: s = "/login",
648
+ isLogged: n
649
+ }) => {
650
+ var C, T, O, $;
651
+ const [g, v] = Rr(null), c = le(), l = _r(!1), y = typeof n == "function" ? n() : !!n, h = typeof y == "boolean" ? y : y == null ? void 0 : y.isLogged;
652
+ return X(() => {
653
+ var x;
654
+ l.current || (l.current = !0, (x = D) == null || x.interceptors.response.use(
655
+ (R) => R,
656
+ async (R) => {
657
+ var F;
658
+ return typeof R == "object" && R && "response" in R && R.response && typeof R.response == "object" && "status" in R.response && R.response && typeof R.response == "object" && "status" in R.response && ((F = R == null ? void 0 : R.response) == null ? void 0 : F.status) === 401 && (D.defaults.headers.common.Authorization = null, localStorage.removeItem(i), v(s)), Promise.reject(R);
659
+ }
660
+ ));
661
+ }, [i, s]), h && !g ? /* @__PURE__ */ A.jsx(Cr, { fallback: t, children: (T = (C = c.state) == null ? void 0 : C.from) != null && T.state && (($ = (O = c.state) == null ? void 0 : O.from) == null ? void 0 : $.pathname) === a ? /* @__PURE__ */ A.jsx(Me, { to: c.state.from.state.from.pathname + c.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ A.jsx(We, {}) }) : /* @__PURE__ */ A.jsx(Me, { to: a, state: { from: c }, replace: !0 });
662
+ }, at = () => {
663
+ const { pathname: t } = le(), { sendEvent: a } = xr();
664
+ return X(() => {
665
+ a({ event: "pageView", pathname: t });
666
+ }, [t, a]), /* @__PURE__ */ A.jsx(We, {});
667
+ }, ce = Tr({
668
+ apiURL: void 0,
669
+ children: void 0
670
+ }), ot = ({ children: t, apiURL: a }) => {
671
+ const i = ue(
672
+ () => ({
673
+ apiURL: a
674
+ }),
675
+ [a]
676
+ );
677
+ return /* @__PURE__ */ A.jsx(ce.Provider, { value: i, children: t });
678
+ }, it = ({
679
+ tokenTypeKey: t = "tokenType",
680
+ userLocalStorageKey: a = "user",
681
+ tokenKey: i = "accessToken",
682
+ postContentType: s = "application/json",
683
+ ...n
684
+ }) => {
685
+ const { apiURL: g = n.apiURL } = Ne(ce);
686
+ if (!D.defaults)
687
+ return null;
688
+ const v = localStorage.getItem(a), c = v ? JSON.parse(v) : null, l = c != null && c[t] ? c[t] : null, y = c != null && c[i] ? c[i] : null, h = v ? `${l} ${y}` : null;
689
+ return D.defaults.baseURL = g, D.defaults.headers.post["Content-Type"] = s, h && (D.defaults.headers.common.Authorization = h), null;
690
+ }, st = ({ debug: t, resources: a }) => {
691
+ var i;
692
+ return (i = I) != null && i.isInitialized || (I.use(jr).use(Pr).init({
693
+ debug: t,
694
+ fallbackLng: "en",
695
+ interpolation: {
696
+ escapeValue: !1
697
+ },
698
+ load: "languageOnly",
699
+ react: {
700
+ bindI18n: !1,
701
+ useSuspense: !0
702
+ },
703
+ resources: a,
704
+ returnNull: !1
705
+ }).then(() => {
706
+ document.documentElement.lang !== I.resolvedLanguage && I.resolvedLanguage && document.documentElement.setAttribute("lang", I.resolvedLanguage);
707
+ }), I.on("languageChanged", (s) => {
708
+ document.documentElement.setAttribute("lang", s);
709
+ })), null;
710
+ }, ut = ({
711
+ dsn: t,
712
+ integrations: a,
713
+ tracesSampleRate: i,
714
+ replaysSessionSampleRate: s,
715
+ replaysOnErrorSampleRate: n,
716
+ tracePropagationTargets: g,
717
+ ignoreErrors: v,
718
+ debug: c,
719
+ environment: l
720
+ }) => (oe.isInitialized() || (c || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && oe.init({
721
+ debug: c,
722
+ dsn: t,
723
+ environment: l || "production",
724
+ ignoreErrors: [...v || [], /dynamically imported module/],
725
+ integrations: [
726
+ oe.reactRouterV6BrowserTracingIntegration({
727
+ createRoutesFromChildren: Sr,
728
+ matchRoutes: wr,
729
+ useEffect: X,
730
+ useLocation: le,
731
+ useNavigationType: Or
732
+ }),
733
+ ...a || []
734
+ ],
735
+ replaysOnErrorSampleRate: n || 1,
736
+ replaysSessionSampleRate: s || 0.1,
737
+ tracePropagationTargets: g,
738
+ tracesSampleRate: i || 1
739
+ }), null), lt = ({ IMaskMixin: t, ...a }) => {
740
+ const i = ue(
741
+ // eslint-disable-next-line react/jsx-props-no-spreading
742
+ () => t(({ TextField: s, ...n }) => /* @__PURE__ */ A.jsx(s, { ...n })),
743
+ [t]
744
+ );
745
+ return /* @__PURE__ */ A.jsx(i, { ...a });
746
+ }, ct = ({ accessToken: t }) => (t && (Ar.accessToken = t), null);
747
+ var Ve = { exports: {} };
748
+ (function(t, a) {
749
+ (function(i, s) {
750
+ t.exports = s();
751
+ })($r, function() {
752
+ var i = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" };
753
+ return function(s, n, g) {
754
+ var v = n.prototype, c = v.format;
755
+ g.en.formats = i, v.format = function(l) {
756
+ l === void 0 && (l = "YYYY-MM-DDTHH:mm:ssZ");
757
+ var y = this.$locale().formats, h = function(C, T) {
758
+ return C.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(O, $, x) {
759
+ var R = x && x.toUpperCase();
760
+ return $ || T[x] || i[x] || T[R].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(k, _, F) {
761
+ return _ || F.slice(1);
762
+ });
763
+ });
764
+ }(l, y === void 0 ? {} : y);
765
+ return c.call(this, h);
766
+ };
767
+ };
768
+ });
769
+ })(Ve);
770
+ var Yr = Ve.exports;
771
+ const Ir = /* @__PURE__ */ Mr(Yr);
772
+ U.extend(Ir);
773
+ const ft = ({ language: t }) => (X(() => {
774
+ var i;
775
+ const a = t || ((i = navigator.language) == null ? void 0 : i.slice(0, 2)) || "en";
776
+ if (a === "en") {
777
+ import("./en-E8ST0UOq.js").then((s) => s.e).then(() => {
778
+ U.locale(a);
779
+ });
780
+ return;
781
+ }
782
+ a === "fr" && import("./fr-Iii0rxc-.js").then((s) => s.f).then(() => {
783
+ U.locale(a);
784
+ }).catch(() => {
785
+ import("./en-E8ST0UOq.js").then((s) => s.e).then(() => {
786
+ U.locale("en");
787
+ });
788
+ });
789
+ }, [t]), null), dt = ({
790
+ children: t,
791
+ defaultQueriesOptions: a,
792
+ defaultMutationsOptions: i
793
+ }) => {
794
+ const s = new kr({
795
+ defaultOptions: {
796
+ mutations: {
797
+ ...i
798
+ },
799
+ queries: {
800
+ getNextPageParam: (n, g, v) => n.length + (v || 0),
801
+ refetchOnWindowFocus: !1,
802
+ retry: 3,
803
+ ...a
804
+ }
805
+ }
806
+ });
807
+ return /* @__PURE__ */ A.jsx(Dr, { client: s, children: t });
808
+ }, pt = () => {
809
+ const t = navigator.language === "fr" ? "Une erreur est survenue." : "An error occurred.", a = ie(
810
+ (s) => {
811
+ var g, v, c, l, y, h, C, T, O;
812
+ const { response: n } = s || {};
813
+ return n != null && n.reason ? String(n.reason) : (g = n == null ? void 0 : n.data) != null && g.reason ? String(n.data.reason) : (v = n == null ? void 0 : n.data) != null && v.message ? String(n.data.message) : (l = (c = n == null ? void 0 : n.data) == null ? void 0 : c.detail) != null && l.length && Array.isArray((y = n == null ? void 0 : n.data) == null ? void 0 : y.detail) && ((C = (h = n == null ? void 0 : n.data) == null ? void 0 : h.detail[0]) != null && C.msg) && typeof ((O = (T = n == null ? void 0 : n.data) == null ? void 0 : T.detail[0]) == null ? void 0 : O.msg) == "string" ? String(n.data.detail[0].msg) : t;
814
+ },
815
+ [t]
816
+ );
817
+ return { getErrorCode: ie((s) => {
818
+ var g, v, c;
819
+ const { response: n } = s || {};
820
+ return n != null && n.error_code ? String(n == null ? void 0 : n.error_code) : (g = n == null ? void 0 : n.data) != null && g.error_code ? String((v = n == null ? void 0 : n.data) == null ? void 0 : v.error_code) : n != null && n.error_code ? String(n == null ? void 0 : n.error_code) : (c = n == null ? void 0 : n.data) != null && c.error_code ? String(n.data.error_code) : "unknown_error_code";
821
+ }, []), printError: a };
822
+ }, vt = ({
823
+ data: t,
824
+ fetchNextPage: a,
825
+ isFetchingNextPage: i,
826
+ isInitialLoading: s,
827
+ isLoading: n,
828
+ enabled: g = !0
829
+ }) => {
830
+ const v = ie(
831
+ async (l) => {
832
+ i || !g || await a({ pageParam: (l == null ? void 0 : l.pageParam) || l.visibleRowsCount });
833
+ },
834
+ [g, a, i]
835
+ ), c = ue(() => {
836
+ if (t)
837
+ return t.pages.reduce((l, y) => [...l, ...y], []);
838
+ }, [t]);
839
+ return {
840
+ fetchNextPageOnRowsScrollEnd: v,
841
+ isLoading: i || n,
842
+ loadingVariant: s ? "skeleton" : "linear",
843
+ rows: c
844
+ };
845
+ }, mt = () => ({
846
+ clearAuthenticationToken: () => {
847
+ D.defaults.headers.common.Authorization = null;
848
+ },
849
+ setAuthenticationToken: ({ tokenType: i, accessToken: s }) => {
850
+ D.defaults.headers.common.Authorization = `${i} ${s}`;
851
+ }
852
+ }), Nr = (t, a = "ll") => U(t).format(a), Wr = (t, a = "km") => {
853
+ const i = Number(t);
854
+ return Number.isNaN(i) ? `0 ${a}` : `${i.toFixed(2)} ${a}`;
855
+ }, Vr = (t) => {
856
+ const a = t && typeof t == "object" && "pathname" in t && t.pathname ? t.pathname : t;
857
+ return typeof a == "string" ? a != null && a.startsWith("/") ? a != null && a.startsWith("/files") ? a : `/files${a}` : a != null && a.startsWith("files") ? `/${a}` : a != null && a.startsWith("files") ? `/${a}` : `/files/${a}` : a;
858
+ }, Ye = (t, a) => {
859
+ if (!t)
860
+ return "";
861
+ const i = Vr(t), s = typeof t == "object" && "pathname" in t ? `${t.origin}${i}` : t;
862
+ return typeof a == "number" ? `${s.replace("/files", `/thumbs/${a}`)}` : s;
863
+ }, gt = () => {
864
+ const { apiURL: t } = Ne(ce);
865
+ return {
866
+ dateAdapter: Nr,
867
+ distanceAdapter: Wr,
868
+ filePathAdapter: (i, s) => Ye(
869
+ t && typeof i == "string" ? {
870
+ origin: t,
871
+ pathname: i
872
+ } : i,
873
+ s
874
+ )
875
+ };
876
+ }, zr = (t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase(), Ur = (t) => {
877
+ const s = t.split("/").filter((n) => n.length > 0).map((n) => n.replace(/\${([^}]*)}/g, "$1").split(/[_-]/).map((l) => l.charAt(0).toUpperCase() + l.slice(1)).join("")).join("");
878
+ return s.charAt(0).toLowerCase() + s.slice(1);
879
+ }, qr = (t, a, i) => {
880
+ const s = Ur(a), n = zr(i);
881
+ return `${s}${n}`;
882
+ }, Br = (t) => {
883
+ if (t)
884
+ return (t == null ? void 0 : t.reduce((a, i) => (a[i] = {
885
+ query: {
886
+ useInfinite: !0,
887
+ useInfiniteQueryParam: "offset",
888
+ useQuery: !0
889
+ }
890
+ }, a), {})) || {};
891
+ }, ht = (t) => {
892
+ const { input: a = "./openapi.json", operationsToGenerateInfiniteQueryHook: i = void 0 } = t || {};
893
+ return {
894
+ api: {
895
+ hooks: {
896
+ afterAllFilesWrite: "prettier src/api/ --write"
897
+ },
898
+ input: a,
899
+ output: {
900
+ client: "react-query",
901
+ mode: "tags-split",
902
+ override: {
903
+ header: (s) => [
904
+ "Generated by orval 🍺",
905
+ ...s.title ? [s.title] : [],
906
+ ...s.description ? [s.description] : []
907
+ ],
908
+ mutator: {
909
+ name: "axiosCustomInstance",
910
+ path: `${__dirname}/config/orval/mutator/axiosCustomInstance.ts`
911
+ },
912
+ operationName: qr,
913
+ ...(i == null ? void 0 : i.length) && { operations: Br(i) },
914
+ query: {
915
+ useQuery: !0
916
+ }
917
+ },
918
+ schemas: "src/api/model",
919
+ target: "src/api/services/api.ts"
920
+ }
921
+ }
922
+ };
923
+ };
924
+ export {
925
+ at as G,
926
+ it as I,
927
+ lt as M,
928
+ dt as Q,
929
+ nt as R,
930
+ st as a,
931
+ ut as b,
932
+ $r as c,
933
+ ct as d,
934
+ ft as e,
935
+ ot as f,
936
+ vt as g,
937
+ mt as h,
938
+ gt as i,
939
+ ht as j,
940
+ Nr as k,
941
+ Wr as l,
942
+ ce as m,
943
+ pt as u
944
+ };