@getsoren/shared-module 2.65.0 → 2.67.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/README.md
CHANGED
|
@@ -211,9 +211,10 @@ input: "./openapi.json"
|
|
|
211
211
|
| resolveOrvalInput | Standalone schema target resolution (local file → local → upstream) |
|
|
212
212
|
|
|
213
213
|
## Utils function
|
|
214
|
-
| Module | Description
|
|
215
|
-
|
|
216
|
-
| articleNameAdapter | Split an article's name from its mention of the driver, for a tag to say it
|
|
217
|
-
| dateAdapter | Adapt given date
|
|
218
|
-
| distanceAdapter | Adapt given distance
|
|
219
|
-
|
|
|
214
|
+
| Module | Description |
|
|
215
|
+
|---------------------|----------------------------------------------------------------------------------------|
|
|
216
|
+
| articleNameAdapter | Split an article's name from its mention of the driver, for a tag to say it |
|
|
217
|
+
| dateAdapter | Adapt given date |
|
|
218
|
+
| distanceAdapter | Adapt given distance |
|
|
219
|
+
| operator | A machine rented with its driver: its article, its line by the hour, its hours per day |
|
|
220
|
+
| worksiteNameAdapter | Adapt worksite name |
|
package/dist/main.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export { default as worksiteNameAdapter } from './utils/adapter/worksiteNameAdap
|
|
|
55
55
|
export * from './utils/getCurrentLanguage/getCurrentLanguage';
|
|
56
56
|
export { default as getCurrentLanguage } from './utils/getCurrentLanguage/getCurrentLanguage';
|
|
57
57
|
export { default as lazyWithRetry } from './utils/lazyWithRetry';
|
|
58
|
+
export * from './utils/operator/operator';
|
|
58
59
|
export * from './utils/pageDuration/pageDuration';
|
|
59
60
|
export { default as shouldRetryQuery } from './utils/shouldRetryQuery/shouldRetryQuery';
|
|
60
61
|
export * from './utils/token/token';
|
package/dist/main.js
CHANGED
|
@@ -129,17 +129,17 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
129
129
|
value: i,
|
|
130
130
|
children: e
|
|
131
131
|
});
|
|
132
|
-
}, x = 900 * 1e3, S = 60 * 1e3, C = 600 * 1e3, w = "auto-reload-on-new-version-timestamp",
|
|
132
|
+
}, x = 900 * 1e3, S = 60 * 1e3, C = 600 * 1e3, w = "auto-reload-on-new-version-timestamp", T = /<meta[^>]*name="version"[^>]*content="([^"]*)"/, E = (e) => {
|
|
133
133
|
try {
|
|
134
134
|
return sessionStorage.getItem(e);
|
|
135
135
|
} catch {
|
|
136
136
|
return null;
|
|
137
137
|
}
|
|
138
|
-
},
|
|
138
|
+
}, D = (e, t) => {
|
|
139
139
|
try {
|
|
140
140
|
sessionStorage.setItem(e, t);
|
|
141
141
|
} catch {}
|
|
142
|
-
},
|
|
142
|
+
}, O = ({ version: e, checkInterval: t = x, children: n, ...r }) => {
|
|
143
143
|
let { libraries: i } = a(y), s = r?.reactRouter || i?.reactRouter, c = l(!1), u = l(0);
|
|
144
144
|
if (!s) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of AutoReloadOnNewVersion.");
|
|
145
145
|
let { useLocation: f, Outlet: p } = s, { pathname: m } = f(), h = l(m);
|
|
@@ -151,7 +151,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
151
151
|
try {
|
|
152
152
|
let t = await fetch("/index.html", { cache: "no-store" });
|
|
153
153
|
if (!t.ok) return;
|
|
154
|
-
let n = (await t.text()).match(
|
|
154
|
+
let n = (await t.text()).match(T)?.[1];
|
|
155
155
|
n && n !== "%VERSION%" && n !== e && (c.current = !0);
|
|
156
156
|
} catch {}
|
|
157
157
|
}
|
|
@@ -164,10 +164,10 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
164
164
|
}, [e, t]), o(() => {
|
|
165
165
|
if (m === h.current || (h.current = m, !c.current)) return;
|
|
166
166
|
c.current = !1;
|
|
167
|
-
let e = Number(
|
|
168
|
-
Date.now() - e < C || (
|
|
167
|
+
let e = Number(E(w) || "0");
|
|
168
|
+
Date.now() - e < C || (D(w, String(Date.now())), window.location.reload());
|
|
169
169
|
}, [m]), n ?? /* @__PURE__ */ d(p, {});
|
|
170
|
-
},
|
|
170
|
+
}, k = ({ data: e, ...t }) => {
|
|
171
171
|
let { libraries: n } = a(y), r = t?.reactRouter || n?.reactRouter, i = t?.gtm || n?.gtm;
|
|
172
172
|
if (!r) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
|
|
173
173
|
if (!i) throw Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");
|
|
@@ -183,7 +183,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
183
183
|
u,
|
|
184
184
|
f
|
|
185
185
|
]), /* @__PURE__ */ d(l, {});
|
|
186
|
-
},
|
|
186
|
+
}, A = "[data-amp-track-feature]", j = [
|
|
187
187
|
"a",
|
|
188
188
|
"button",
|
|
189
189
|
"input",
|
|
@@ -195,18 +195,18 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
195
195
|
"[contenteditable=\"true\" i]",
|
|
196
196
|
"[data-amp-default-track]",
|
|
197
197
|
".amp-default-track"
|
|
198
|
-
],
|
|
198
|
+
], ee = { defaultMaskLevel: "medium" }, te = (e, t) => {
|
|
199
199
|
if (e === !1) return !1;
|
|
200
200
|
let n = e === !0 ? {} : e;
|
|
201
201
|
return {
|
|
202
|
-
cssSelectorAllowlist: [...t,
|
|
202
|
+
cssSelectorAllowlist: [...t, A],
|
|
203
203
|
...n
|
|
204
204
|
};
|
|
205
|
-
},
|
|
205
|
+
}, ne = (e, t) => !t || e === !1 ? !1 : {
|
|
206
206
|
deadClicks: !0,
|
|
207
207
|
rageClicks: !0,
|
|
208
208
|
...e === !0 ? {} : e
|
|
209
|
-
},
|
|
209
|
+
}, M = ({ apiKey: e, appVersion: t, sessionReplaySampleRate: n, serverZone: r, elementInteractions: i = !0, frustrationInteractions: c = !0, platform: d = "desktop", sessionReplayPrivacy: f = ee, userId: p, ...m }) => {
|
|
210
210
|
let [h, g] = u(!!p), { libraries: _ } = a(y), v = m.amplitude || _?.amplitude, b = l({
|
|
211
211
|
elementInteractions: i,
|
|
212
212
|
frustrationInteractions: c,
|
|
@@ -221,12 +221,12 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
221
221
|
}), o(() => {
|
|
222
222
|
let i = v?.analytics, a = v?.sessionReplayPlugin;
|
|
223
223
|
if (!(e && i && h)) return;
|
|
224
|
-
let { elementInteractions: o, frustrationInteractions: s, sessionReplayPrivacy: c } = b.current, l = x.current, u = !l, f = "platform-enrichment", p =
|
|
224
|
+
let { elementInteractions: o, frustrationInteractions: s, sessionReplayPrivacy: c } = b.current, l = x.current, u = !l, f = "platform-enrichment", p = te(o, i.Types?.DEFAULT_CSS_SELECTOR_ALLOWLIST ?? j);
|
|
225
225
|
return i.init(e, l, {
|
|
226
226
|
appVersion: t,
|
|
227
227
|
autocapture: {
|
|
228
228
|
elementInteractions: p,
|
|
229
|
-
frustrationInteractions:
|
|
229
|
+
frustrationInteractions: ne(s, p !== !1),
|
|
230
230
|
pageViews: { trackHistoryChanges: "pathOnly" }
|
|
231
231
|
},
|
|
232
232
|
optOut: u,
|
|
@@ -270,22 +270,22 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
270
270
|
h,
|
|
271
271
|
p
|
|
272
272
|
]), null;
|
|
273
|
-
},
|
|
273
|
+
}, N = (() => {
|
|
274
274
|
try {
|
|
275
275
|
return typeof global == "object" && global !== null && ("HermesInternal" in global || "__fbBatchedBridge" in global || "__metro" in global) || typeof window > "u" && typeof global < "u" ? !0 : typeof navigator < "u" && navigator.userAgent ? /react.native|ReactNative/i.test(navigator.userAgent) : !1;
|
|
276
276
|
} catch {
|
|
277
277
|
return !1;
|
|
278
278
|
}
|
|
279
|
-
})(),
|
|
280
|
-
let { apiURL: i = r.apiURL, libraries: o, localStorageKeys: s } = a(y), c = r?.userLocalStorageKey || s?.user ||
|
|
279
|
+
})(), P = "user", F = ({ tokenTypeKey: e = "tokenType", tokenKey: t = "accessToken", postContentType: n = "application/json", ...r }) => {
|
|
280
|
+
let { apiURL: i = r.apiURL, libraries: o, localStorageKeys: s } = a(y), c = r?.userLocalStorageKey || s?.user || P, l = r?.axios || o?.axios;
|
|
281
281
|
if (!l) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
282
|
-
if (!l?.defaults ||
|
|
282
|
+
if (!l?.defaults || N) return null;
|
|
283
283
|
if (typeof window < "u" && window.localStorage) {
|
|
284
284
|
let n = localStorage.getItem(c), r = n ? JSON.parse(n) : null, i = r?.[e] ? r[e] : null, a = r?.[t] ? r[t] : null, o = n ? `${i} ${a}` : null;
|
|
285
285
|
o && (l.defaults.headers.common.Authorization = o);
|
|
286
286
|
}
|
|
287
287
|
return l.defaults.baseURL = i, l.defaults.headers.post["Content-Type"] = n, null;
|
|
288
|
-
},
|
|
288
|
+
}, re = [
|
|
289
289
|
"ar",
|
|
290
290
|
"de",
|
|
291
291
|
"en",
|
|
@@ -293,15 +293,15 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
293
293
|
"fr",
|
|
294
294
|
"it",
|
|
295
295
|
"pt"
|
|
296
|
-
],
|
|
296
|
+
], ie = (e) => re.includes(e), ae = ({ language: e, ...t }) => {
|
|
297
297
|
let { libraries: n } = a(y), r = t?.dayjs || n?.dayjs, i = t?.plugin || n?.dayjsPlugin;
|
|
298
298
|
if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");
|
|
299
299
|
r.extend(t.localizedFormat), i && i.forEach((e) => {
|
|
300
300
|
e && r.extend(e);
|
|
301
301
|
});
|
|
302
|
-
let o = e || navigator.language?.slice(0, 2) || "en", s =
|
|
302
|
+
let o = e || navigator.language?.slice(0, 2) || "en", s = ie(o) ? o : "en";
|
|
303
303
|
return r.locale() !== s && r.locale(s), null;
|
|
304
|
-
},
|
|
304
|
+
}, I = "hubspot-messages-iframe-container", L = "hs-show", R = "data-hs-hidden", oe = ({ hubId: e }) => (o(() => {
|
|
305
305
|
if (!e) return;
|
|
306
306
|
let t = document.createElement("script");
|
|
307
307
|
return t.id = "hs-script-loader", t.src = `//js-eu1.hs-scripts.com/${e}.js`, t.async = !0, t.defer = !0, document.body.appendChild(t), () => {
|
|
@@ -310,14 +310,14 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
310
310
|
}, [e]), o(() => {
|
|
311
311
|
let e = document.createElement("style");
|
|
312
312
|
return e.textContent = `
|
|
313
|
-
html[${
|
|
314
|
-
html[${
|
|
315
|
-
`, document.head.appendChild(e), document.documentElement.setAttribute(
|
|
316
|
-
e.remove(), document.documentElement.removeAttribute(
|
|
313
|
+
html[${R}] div#${I} { display: none !important; }
|
|
314
|
+
html[${R}] div#${I}.${L} { display: initial !important; }
|
|
315
|
+
`, document.head.appendChild(e), document.documentElement.setAttribute(R, ""), () => {
|
|
316
|
+
e.remove(), document.documentElement.removeAttribute(R);
|
|
317
317
|
};
|
|
318
|
-
}, []), null),
|
|
318
|
+
}, []), null), se = ({ debug: e, resources: t, ...n }) => {
|
|
319
319
|
let { libraries: r } = a(y), i = n?.i18 || r?.i18, { i18next: o, initReactI18next: s, languageDetector: c } = i || {};
|
|
320
|
-
if (
|
|
320
|
+
if (N) return null;
|
|
321
321
|
if (!(i && o && c && s)) throw Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
322
322
|
return o.isInitialized ? null : (o.use(c).use(s).init({
|
|
323
323
|
debug: e,
|
|
@@ -335,12 +335,12 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
335
335
|
}), o.on("languageChanged", (e) => {
|
|
336
336
|
document.documentElement.setAttribute("lang", e);
|
|
337
337
|
}), null);
|
|
338
|
-
},
|
|
338
|
+
}, ce = { replay: "keep" }, le = (e) => e.tags?.replay === ce.replay, z = [/^https:\/\/(api|events)\.mapbox\.com\//], B = (e, t) => t.some((t) => typeof t == "string" ? e.includes(t) : t.test(e)), ue = ({ dsn: e, integrations: t, tracesSampleRate: n, tracePropagationTargets: r, ignoreErrors: i, ignoreRequestUrls: s, debug: c, environment: l, release: u, replaysSessionSampleRate: d = 0, replaysOnErrorSampleRate: f = 1, replayBeforeErrorSampling: p = le, ...m }) => {
|
|
339
339
|
let { libraries: h } = a(y), g = m?.sentry || h?.sentry, _ = m?.reactRouter || h?.reactRouter;
|
|
340
340
|
if (!g) throw Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
341
341
|
if (!_) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
342
342
|
if (g.isInitialized()) return null;
|
|
343
|
-
let { createRoutesFromChildren: v, matchRoutes: b, useLocation: x, useNavigationType: S } = _, C = d > 0 || f > 0, w = [...s || [], ...
|
|
343
|
+
let { createRoutesFromChildren: v, matchRoutes: b, useLocation: x, useNavigationType: S } = _, C = d > 0 || f > 0, w = [...s || [], ...z];
|
|
344
344
|
return (c || process.env.NODE_ENV === "prod" || process.env.NODE_ENV === "production") && g.init({
|
|
345
345
|
debug: c,
|
|
346
346
|
dsn: e,
|
|
@@ -358,7 +358,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
358
358
|
g.reactRouterV6BrowserTracingIntegration({
|
|
359
359
|
createRoutesFromChildren: v,
|
|
360
360
|
matchRoutes: b,
|
|
361
|
-
shouldCreateSpanForRequest: (e) => !
|
|
361
|
+
shouldCreateSpanForRequest: (e) => !B(e, w),
|
|
362
362
|
useEffect: o,
|
|
363
363
|
useLocation: x,
|
|
364
364
|
useNavigationType: S
|
|
@@ -372,12 +372,12 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
372
372
|
tracePropagationTargets: r,
|
|
373
373
|
tracesSampleRate: n ?? 1
|
|
374
374
|
}), null;
|
|
375
|
-
},
|
|
376
|
-
let { libraries: c, localStorageKeys: l } = a(y), f = s?.reactRouter || c?.reactRouter, p = s?.axios || c?.axios, m = s?.localStorageKey || l?.user ||
|
|
375
|
+
}, V = /* @__PURE__ */ new WeakMap(), de = "user", fe = ({ Fallback: e, isLogged: n, loginPath: r = "/login", redirect401Path: i = "/login", ...s }) => {
|
|
376
|
+
let { libraries: c, localStorageKeys: l } = a(y), f = s?.reactRouter || c?.reactRouter, p = s?.axios || c?.axios, m = s?.localStorageKey || l?.user || de;
|
|
377
377
|
if (!f) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
378
378
|
let [h, g] = u(null), { useLocation: _, Navigate: v, Outlet: b } = f, x = _(), S = typeof n == "function" ? n() : !!n, C = typeof S == "boolean" ? S : S?.isLogged;
|
|
379
379
|
return o(() => {
|
|
380
|
-
p && (
|
|
380
|
+
p && (V.has(p) || (V.set(p, !0), p.interceptors.response.use((e) => e, (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 && (typeof e == "object" && e && "config" in e && e.config && typeof e.config == "object" && "headers" in e.config && e.config.headers && typeof e.config.headers == "object" && "Authorization" in e.config.headers && e.config.headers.Authorization && (p.defaults.headers.common.Authorization = null, typeof window < "u" && window.localStorage && localStorage.removeItem(m)), g(i)), Promise.reject(e)))));
|
|
381
381
|
}, [
|
|
382
382
|
p,
|
|
383
383
|
m,
|
|
@@ -393,34 +393,34 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
393
393
|
state: { from: x },
|
|
394
394
|
replace: !0
|
|
395
395
|
});
|
|
396
|
-
},
|
|
396
|
+
}, H = /* @__PURE__ */ new Set(), pe = () => (o(() => {
|
|
397
397
|
let e = Symbol();
|
|
398
|
-
return
|
|
399
|
-
|
|
398
|
+
return H.add(e), document.documentElement.removeAttribute(R), () => {
|
|
399
|
+
H.delete(e), H.size === 0 && document.documentElement.setAttribute(R, "");
|
|
400
400
|
};
|
|
401
|
-
}, []), null),
|
|
401
|
+
}, []), null), me = "user", he = {
|
|
402
402
|
client: "/v2/threads/ws",
|
|
403
403
|
supplier: "/v1/threads/ws"
|
|
404
|
-
},
|
|
404
|
+
}, ge = (e, t) => `${e.startsWith("https") ? "wss" : "ws"}://${e.replace(/^https?:\/\//, "")}${t}`, _e = (e) => {
|
|
405
405
|
try {
|
|
406
406
|
let t = localStorage.getItem(e);
|
|
407
407
|
return t ? JSON.parse(t)?.accessToken ?? null : null;
|
|
408
408
|
} catch {
|
|
409
409
|
return null;
|
|
410
410
|
}
|
|
411
|
-
},
|
|
412
|
-
let [g, v] = u(!1), [b, x] = u(!1), [S, C] = u(0), [w,
|
|
411
|
+
}, U = n(null), ve = ({ children: e, token: t, url: n, wsPath: r, maxReconnectAttempts: s, reconnectBaseDelay: c, maxMessageBodyLength: f = 1e4, reconnect: p = !0, enabled: m = !0, context: h = "client" }) => {
|
|
412
|
+
let [g, v] = u(!1), [b, x] = u(!1), [S, C] = u(0), [w, T] = u(m), E = m && w, { apiURL: D, localStorageKeys: O } = a(y), k = O?.user || me, A = l(null), j = l(/* @__PURE__ */ new Set());
|
|
413
413
|
o(() => {
|
|
414
|
-
if (!
|
|
415
|
-
let e = r ??
|
|
414
|
+
if (!E) return;
|
|
415
|
+
let e = r ?? he[h], i = n || (D ? ge(D, e) : null);
|
|
416
416
|
if (!i) return;
|
|
417
|
-
let a = () => t ??
|
|
417
|
+
let a = () => t ?? _e(k), o = (e) => {
|
|
418
418
|
switch (e.type) {
|
|
419
419
|
case "ready":
|
|
420
420
|
x(!0), C(e.unreadCount ?? 0);
|
|
421
421
|
break;
|
|
422
422
|
}
|
|
423
|
-
for (let t of
|
|
423
|
+
for (let t of j.current) t(e);
|
|
424
424
|
}, l = setTimeout(() => {
|
|
425
425
|
let e = new _({
|
|
426
426
|
getToken: a,
|
|
@@ -434,80 +434,80 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
434
434
|
reconnectBaseDelay: c,
|
|
435
435
|
url: i
|
|
436
436
|
});
|
|
437
|
-
|
|
437
|
+
A.current = e, e.connect();
|
|
438
438
|
}, 0);
|
|
439
439
|
return () => {
|
|
440
|
-
clearTimeout(l),
|
|
440
|
+
clearTimeout(l), A.current?.disconnect(), A.current = null;
|
|
441
441
|
};
|
|
442
442
|
}, [
|
|
443
|
-
|
|
443
|
+
E,
|
|
444
444
|
n,
|
|
445
445
|
r,
|
|
446
446
|
h,
|
|
447
447
|
t,
|
|
448
448
|
p,
|
|
449
|
-
|
|
450
|
-
|
|
449
|
+
D,
|
|
450
|
+
k,
|
|
451
451
|
f,
|
|
452
452
|
s,
|
|
453
453
|
c
|
|
454
454
|
]);
|
|
455
|
-
let
|
|
456
|
-
|
|
457
|
-
}, []),
|
|
458
|
-
|
|
459
|
-
}, []),
|
|
460
|
-
|
|
461
|
-
}, []),
|
|
462
|
-
|
|
463
|
-
}, []),
|
|
464
|
-
|
|
465
|
-
}, []),
|
|
455
|
+
let ee = i((e) => {
|
|
456
|
+
A.current?.joinThread(e);
|
|
457
|
+
}, []), te = i((e) => {
|
|
458
|
+
A.current?.leaveThread(e);
|
|
459
|
+
}, []), ne = i((e, t) => {
|
|
460
|
+
A.current?.sendMessage(e, t);
|
|
461
|
+
}, []), M = i((e) => {
|
|
462
|
+
A.current?.markRead(e);
|
|
463
|
+
}, []), N = i((e, t) => {
|
|
464
|
+
A.current?.listThreads(e, t);
|
|
465
|
+
}, []), P = i((e = 1) => {
|
|
466
466
|
C((t) => t + e);
|
|
467
|
-
}, []),
|
|
467
|
+
}, []), F = {
|
|
468
468
|
decrementUnreadCount: i((e = 1) => {
|
|
469
469
|
C((t) => Math.max(0, t - e));
|
|
470
470
|
}, []),
|
|
471
471
|
disconnect: i(() => {
|
|
472
|
-
|
|
472
|
+
A.current?.disconnect(), A.current = null;
|
|
473
473
|
}, []),
|
|
474
|
-
incrementUnreadCount:
|
|
474
|
+
incrementUnreadCount: P,
|
|
475
475
|
isConnected: g,
|
|
476
476
|
isReady: b,
|
|
477
|
-
joinThread:
|
|
478
|
-
leaveThread:
|
|
479
|
-
listThreads:
|
|
480
|
-
markRead:
|
|
481
|
-
sendMessage:
|
|
477
|
+
joinThread: ee,
|
|
478
|
+
leaveThread: te,
|
|
479
|
+
listThreads: N,
|
|
480
|
+
markRead: M,
|
|
481
|
+
sendMessage: ne,
|
|
482
482
|
setEnabled: i((e) => {
|
|
483
|
-
|
|
483
|
+
T(e);
|
|
484
484
|
}, []),
|
|
485
|
-
subscribe: i((e) => (
|
|
486
|
-
|
|
485
|
+
subscribe: i((e) => (j.current.add(e), () => {
|
|
486
|
+
j.current.delete(e);
|
|
487
487
|
}), []),
|
|
488
488
|
unreadCount: S
|
|
489
489
|
};
|
|
490
|
-
return /* @__PURE__ */ d(
|
|
491
|
-
value:
|
|
490
|
+
return /* @__PURE__ */ d(U.Provider, {
|
|
491
|
+
value: F,
|
|
492
492
|
children: e
|
|
493
493
|
});
|
|
494
|
-
},
|
|
494
|
+
}, ye = 3, be = new Set([
|
|
495
495
|
400,
|
|
496
496
|
401,
|
|
497
497
|
403,
|
|
498
498
|
404
|
|
499
|
-
]),
|
|
500
|
-
let n =
|
|
501
|
-
return e <
|
|
502
|
-
},
|
|
499
|
+
]), xe = (e) => e?.response?.status, W = (e, t) => {
|
|
500
|
+
let n = xe(t);
|
|
501
|
+
return e < ye && !(n !== void 0 && be.has(n));
|
|
502
|
+
}, Se = (e, t, n) => (Array.isArray(e) ? e.length : 0) + (typeof n == "number" ? n : 0), Ce = ({ children: e, defaultQueriesOptions: t, defaultMutationsOptions: n, ...r }) => {
|
|
503
503
|
let { libraries: i } = a(y), o = r.QueryClient || i?.reactQuery?.QueryClient, s = r.QueryClientProvider || i?.reactQuery?.QueryClientProvider;
|
|
504
504
|
if (!o) throw Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
505
505
|
if (!s) throw Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
506
506
|
let [c] = u(() => new o({ defaultOptions: {
|
|
507
507
|
mutations: n,
|
|
508
508
|
queries: {
|
|
509
|
-
getNextPageParam:
|
|
510
|
-
retry:
|
|
509
|
+
getNextPageParam: Se,
|
|
510
|
+
retry: W,
|
|
511
511
|
...t
|
|
512
512
|
}
|
|
513
513
|
} }));
|
|
@@ -515,17 +515,17 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
515
515
|
client: c,
|
|
516
516
|
children: e
|
|
517
517
|
});
|
|
518
|
-
},
|
|
518
|
+
}, G = ({ library: e, date: t, format: n = "ll" }) => e(t).format(n), K = (e, t) => {
|
|
519
519
|
let { fractionDigits: n = 0, metric: r = "km", spacingBetween: i = !0 } = t || {}, a = Number(e), o = i ? " " : "";
|
|
520
520
|
return Number.isNaN(a) ? `0${o}${r}` : `${a.toFixed(n)}${o}${r}`;
|
|
521
|
-
},
|
|
521
|
+
}, q = (e) => !e || typeof e != "string" ? "" : e.replace(/_/g, " ").toLowerCase().split(" ").map((e) => e.length > 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" "), we = (e) => e?.startsWith("/") ? e?.startsWith("/files") ? e : `/files${e}` : e?.startsWith("files") ? `/${e}` : `/files/${e}`, Te = ({ path: e, size: t, apiURL: n }) => {
|
|
522
522
|
if (!e) return "";
|
|
523
|
-
let r = `${n}${
|
|
523
|
+
let r = `${n}${we(e)}`, i = r.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/) !== null;
|
|
524
524
|
return typeof t == "number" && i ? `${r.replace("/files", `/thumbs/${t}`)}` : r;
|
|
525
|
-
},
|
|
525
|
+
}, Ee = (e) => {
|
|
526
526
|
let { apiURL: t, libraries: n } = a(y), r = e?.dayjs || n?.dayjs, o = i((e, n) => {
|
|
527
527
|
if (!t) throw Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");
|
|
528
|
-
return typeof e == "string" && /^https?:\/\//.test(e) ? e :
|
|
528
|
+
return typeof e == "string" && /^https?:\/\//.test(e) ? e : Te({
|
|
529
529
|
apiURL: t,
|
|
530
530
|
path: e,
|
|
531
531
|
size: n
|
|
@@ -534,17 +534,17 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
534
534
|
return {
|
|
535
535
|
dateAdapter: i((e, t) => {
|
|
536
536
|
if (!r) throw Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");
|
|
537
|
-
return
|
|
537
|
+
return G({
|
|
538
538
|
date: e,
|
|
539
539
|
format: t,
|
|
540
540
|
library: r
|
|
541
541
|
});
|
|
542
542
|
}, [r]),
|
|
543
|
-
distanceAdapter:
|
|
543
|
+
distanceAdapter: K,
|
|
544
544
|
filePathAdapter: o,
|
|
545
|
-
worksiteNameAdapter:
|
|
545
|
+
worksiteNameAdapter: q
|
|
546
546
|
};
|
|
547
|
-
},
|
|
547
|
+
}, De = () => {
|
|
548
548
|
let { libraries: e } = a(y), t = e?.amplitude?.analytics, n = i((e, n) => {
|
|
549
549
|
if (!t || (t.setUserId(e), !n)) return;
|
|
550
550
|
let r = new t.Identify();
|
|
@@ -568,7 +568,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
568
568
|
setGroup: r,
|
|
569
569
|
track: o
|
|
570
570
|
};
|
|
571
|
-
},
|
|
571
|
+
}, Oe = (e) => {
|
|
572
572
|
let { libraries: t, localStorageKeys: n } = a(y), r = e?.axios || t?.axios, s = e?.localStorageKey || n?.user || "user";
|
|
573
573
|
if (!r) throw Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");
|
|
574
574
|
let c = i(({ tokenType: e, accessToken: t }) => {
|
|
@@ -577,7 +577,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
577
577
|
r.defaults.headers.common.Authorization = null;
|
|
578
578
|
}, [r.defaults.headers.common]);
|
|
579
579
|
return o(() => {
|
|
580
|
-
if (
|
|
580
|
+
if (N) return;
|
|
581
581
|
let e = ({ newValue: e, key: t }) => {
|
|
582
582
|
if (t === s) try {
|
|
583
583
|
let { accessToken: t, tokenType: n } = JSON.parse(e ?? "null") ?? {};
|
|
@@ -604,9 +604,9 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
604
604
|
clearAuthenticationToken: l,
|
|
605
605
|
setAuthenticationToken: c
|
|
606
606
|
};
|
|
607
|
-
},
|
|
607
|
+
}, ke = "New message", Ae = (e, t) => {
|
|
608
608
|
if (!("Notification" in window) || typeof Notification != "function" || Notification.permission !== "granted" || !document.hidden) return;
|
|
609
|
-
let n = new Notification(t.title ??
|
|
609
|
+
let n = new Notification(t.title ?? ke, {
|
|
610
610
|
badge: t?.badge,
|
|
611
611
|
body: t?.body || e.bodyPreview,
|
|
612
612
|
data: t?.data,
|
|
@@ -621,8 +621,8 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
621
621
|
let { onClick: r } = t;
|
|
622
622
|
n.onclick = () => r(e);
|
|
623
623
|
}
|
|
624
|
-
},
|
|
625
|
-
let t = a(
|
|
624
|
+
}, je = (e) => {
|
|
625
|
+
let t = a(U);
|
|
626
626
|
if (!t) throw Error("useChat must be used within ChatProvider");
|
|
627
627
|
let { subscribe: n, setEnabled: r, ...i } = t, s = l(e);
|
|
628
628
|
return s.current = e, o(() => {
|
|
@@ -639,7 +639,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
639
639
|
r?.(e);
|
|
640
640
|
break;
|
|
641
641
|
case "new_message_notification":
|
|
642
|
-
i?.(e), t && t.enabled !== !1 &&
|
|
642
|
+
i?.(e), t && t.enabled !== !1 && Ae(e, t);
|
|
643
643
|
break;
|
|
644
644
|
case "presence":
|
|
645
645
|
a?.(e);
|
|
@@ -664,44 +664,44 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
664
664
|
break;
|
|
665
665
|
}
|
|
666
666
|
}), [n]), i;
|
|
667
|
-
},
|
|
667
|
+
}, J = (e, t = "full") => {
|
|
668
668
|
let n = e || navigator.language;
|
|
669
669
|
return t === "short" ? n.split("-")[0] : n;
|
|
670
|
-
},
|
|
671
|
-
let [n, r] = u(() =>
|
|
670
|
+
}, Me = (e, t = "full") => {
|
|
671
|
+
let [n, r] = u(() => J(e?.language, t));
|
|
672
672
|
return o(() => {
|
|
673
|
-
e && "isInitialized" in e && e.isInitialized && e.language && r(
|
|
673
|
+
e && "isInitialized" in e && e.isInitialized && e.language && r(J(e.language, t));
|
|
674
674
|
let n = (e) => {
|
|
675
|
-
r(
|
|
675
|
+
r(J(e, t));
|
|
676
676
|
};
|
|
677
677
|
return e?.on?.("languageChanged", n), () => {
|
|
678
678
|
e?.off?.("languageChanged", n);
|
|
679
679
|
};
|
|
680
680
|
}, [e, t]), n;
|
|
681
|
-
},
|
|
681
|
+
}, Ne = "tracktor.filter", Pe = {
|
|
682
682
|
getFilter: () => void 0,
|
|
683
683
|
getFilters: () => ({}),
|
|
684
684
|
handleFilter: () => () => {},
|
|
685
685
|
setFilter: () => {}
|
|
686
|
-
},
|
|
686
|
+
}, Fe = (e) => {
|
|
687
687
|
try {
|
|
688
688
|
return JSON.parse(e);
|
|
689
689
|
} catch {
|
|
690
690
|
return e;
|
|
691
691
|
}
|
|
692
|
-
},
|
|
692
|
+
}, Ie = (e, t, n) => `${n}_${e}=>${t}`, Le = (e) => e.reduce((e, t) => {
|
|
693
693
|
let n = localStorage.getItem(t);
|
|
694
694
|
if (n) try {
|
|
695
695
|
let t = JSON.parse(n), r = Object.keys(t)?.[0];
|
|
696
696
|
r && (e[r] = Object.values(t)?.[0]);
|
|
697
697
|
} catch {}
|
|
698
698
|
return e;
|
|
699
|
-
}, {}),
|
|
700
|
-
let { libraries: t, localStorageKeys: n } = a(y), r = e?.reactRouter || t?.reactRouter, { pathname: i } = r?.useLocation?.() ?? { pathname: "/" }, [o, s] = r?.useSearchParams?.() ?? [new URLSearchParams(), () => {}], [c, l] = u({}), d = n?.filter ||
|
|
701
|
-
if (
|
|
699
|
+
}, {}), Re = (e) => {
|
|
700
|
+
let { libraries: t, localStorageKeys: n } = a(y), r = e?.reactRouter || t?.reactRouter, { pathname: i } = r?.useLocation?.() ?? { pathname: "/" }, [o, s] = r?.useSearchParams?.() ?? [new URLSearchParams(), () => {}], [c, l] = u({}), d = n?.filter || Ne, f = e?.syncWithUrl === void 0 ? !0 : e?.syncWithUrl, p = e?.persistToLocalStorage === void 0 ? !0 : e?.persistToLocalStorage;
|
|
701
|
+
if (N) return Pe;
|
|
702
702
|
if (!r) throw Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of reactRouter.");
|
|
703
703
|
let m = () => Object.keys(localStorage).filter((t) => t.startsWith(d) && t.endsWith(e?.pathname || i)), h = (t, n, r = !0) => {
|
|
704
|
-
let a =
|
|
704
|
+
let a = Ie(t, e?.pathname || i, d);
|
|
705
705
|
if (!n || Array.isArray(n) && !n.length) {
|
|
706
706
|
f ? (o.delete(t), s(o)) : l((e) => {
|
|
707
707
|
let n = { ...e };
|
|
@@ -721,13 +721,13 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
721
721
|
getFilter: (t, n) => {
|
|
722
722
|
if (f) {
|
|
723
723
|
let e = o.get(t);
|
|
724
|
-
if (e) return
|
|
724
|
+
if (e) return Fe(e);
|
|
725
725
|
} else {
|
|
726
726
|
let e = c[t];
|
|
727
727
|
if (e !== void 0) return e;
|
|
728
728
|
}
|
|
729
729
|
if (p) {
|
|
730
|
-
let n =
|
|
730
|
+
let n = Ie(t, e?.pathname || i, d), r = localStorage.getItem(n);
|
|
731
731
|
if (r) try {
|
|
732
732
|
let e = JSON.parse(r)[t];
|
|
733
733
|
return !f && e !== void 0 && l((n) => ({
|
|
@@ -739,9 +739,9 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
739
739
|
return n;
|
|
740
740
|
},
|
|
741
741
|
getFilters: () => {
|
|
742
|
-
let e = p ?
|
|
742
|
+
let e = p ? Le(m()) : {};
|
|
743
743
|
if (f) {
|
|
744
|
-
let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] =
|
|
744
|
+
let t = Array.from(o.entries()).reduce((e, [t, n]) => (e[t] = Fe(n), e), {});
|
|
745
745
|
return {
|
|
746
746
|
...e,
|
|
747
747
|
...t
|
|
@@ -762,7 +762,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
762
762
|
},
|
|
763
763
|
setFilter: h
|
|
764
764
|
};
|
|
765
|
-
},
|
|
765
|
+
}, ze = () => document.getElementById(I), Be = () => {
|
|
766
766
|
let [e, t] = u(() => !!window.HubSpotConversations);
|
|
767
767
|
return o(() => {
|
|
768
768
|
if (window.HubSpotConversations) {
|
|
@@ -772,16 +772,16 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
772
772
|
window.hsConversationsOnReady = [() => t(!0)];
|
|
773
773
|
}, []), o(() => {
|
|
774
774
|
e && window.HubSpotConversations?.on("widgetClosed", () => {
|
|
775
|
-
|
|
775
|
+
ze()?.classList.remove(L);
|
|
776
776
|
});
|
|
777
777
|
}, [e]), {
|
|
778
778
|
isAvailable: e,
|
|
779
779
|
toggle: i(() => {
|
|
780
|
-
let e = window.HubSpotConversations, t =
|
|
781
|
-
e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(
|
|
780
|
+
let e = window.HubSpotConversations, t = ze();
|
|
781
|
+
e && t && (t.classList.contains("hs-show") ? (e.widget.close(), t.classList.remove(L)) : (t.classList.add(L), e.widget.open()));
|
|
782
782
|
}, [])
|
|
783
783
|
};
|
|
784
|
-
},
|
|
784
|
+
}, Ve = ({ data: e, fetchNextPage: t, isFetchingNextPage: n, isInitialLoading: r, isLoading: a, enabled: o = !0 }) => {
|
|
785
785
|
let s = i(async (e) => {
|
|
786
786
|
n || !o || await t({ pageParam: e?.pageParam || e.visibleRowsCount });
|
|
787
787
|
}, [
|
|
@@ -797,7 +797,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
797
797
|
loadingVariant: r ? "skeleton" : "linear-progress",
|
|
798
798
|
rows: l
|
|
799
799
|
};
|
|
800
|
-
},
|
|
800
|
+
}, He = (e) => {
|
|
801
801
|
let { libraries: t } = a(y), n = e?.i18 || t?.i18, r = e?.i18?.translateFunction || t?.i18?.translateFunction, o = n?.i18next?.t || r || ((e) => e), { unknownErrorTranslationKey: s = "error.unknownError" } = e || {}, c = o(s), l = i((e) => {
|
|
802
802
|
if (e && typeof e == "object" && "response" in e) {
|
|
803
803
|
let { response: t } = e || {};
|
|
@@ -821,7 +821,10 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
821
821
|
}, []),
|
|
822
822
|
printError: l
|
|
823
823
|
};
|
|
824
|
-
},
|
|
824
|
+
}, Ue = String.raw`(?:chauffeur|conducteur|op[ée]rateur|machiniste|driver|operator)`, We = String.raw`(?:(?:avec|with|incl(?:\.|uding|us)?|y\s+compris)\s+|\+\s*)(?:(?:un|une|le|la|son|sa|an?|the|its)\s+)?`, Ge = String.raw`(?:\s+(?:inclus|compris|included))?`, Ke = String.raw`(?:(?:(?:à\s+la|par|per|by\s+the|tarif)\s+)?(jours?|journ[ée]es?|journalier|days?)|(?:(?:à\s+l['’]\s*|(?:par|per|by\s+the|tarif)\s+))?(heures?|horaire|hours?))`, qe = String.raw`(?:\s*[-–—,/·:]?\s*${Ke}|\s*\(\s*${Ke}\s*\))?`, Je = String.raw`(?:(?:location|rental|rented)\s+)?(?:${We}${Ue}${Ge}|${Ue}\s+(?:inclus|compris|included))${qe}`, Ye = new RegExp(String.raw`\s*[[(]\s*${Je}\s*[\])]`, "giu"), Xe = new RegExp(String.raw`(?:^|[\s,;:/|–—-])\s*${Je}\s*$`, "iu"), Ze = /[\s,;:/|–—-]+$/u, Qe = ([e]) => {
|
|
825
|
+
let t = e.replace(/^[\s,;:/|–—-]+/u, "").trim(), n = (/^[[(]/u.test(t) ? t.slice(1, -1) : t).trim().replace(/\s+/g, " ");
|
|
826
|
+
return n.charAt(0).toLocaleUpperCase() + n.slice(1);
|
|
827
|
+
}, $e = (e) => e[1] || e[3] ? "days" : e[2] || e[4] ? "hours" : void 0, et = (e, { readDriver: t = !0 } = {}) => {
|
|
825
828
|
if (typeof e != "string") return {
|
|
826
829
|
label: "",
|
|
827
830
|
withDriver: !1
|
|
@@ -830,55 +833,57 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
830
833
|
label: e.trim(),
|
|
831
834
|
withDriver: !1
|
|
832
835
|
};
|
|
833
|
-
let n = e.normalize("NFC"), r = [...n.matchAll(
|
|
836
|
+
let n = e.normalize("NFC"), r = [...n.matchAll(Ye)], i = n.replace(Ye, ""), a = i.match(Xe), o = a ? i.slice(0, a.index) : i;
|
|
834
837
|
if (o === n) return {
|
|
835
838
|
label: e.trim(),
|
|
836
839
|
withDriver: !1
|
|
837
840
|
};
|
|
838
|
-
let s = o.replace(
|
|
839
|
-
return s ?
|
|
840
|
-
|
|
841
|
+
let s = o.replace(Ze, "").replace(/\s{2,}/g, " ").trim(), c = [...r, ...a ? [a] : []], l = c.map($e).find(Boolean), u = Qe(c[0]);
|
|
842
|
+
return s ? l ? {
|
|
843
|
+
driverMention: u,
|
|
844
|
+
driverUnit: l,
|
|
841
845
|
label: s,
|
|
842
846
|
withDriver: !0
|
|
843
847
|
} : {
|
|
848
|
+
driverMention: u,
|
|
844
849
|
label: s,
|
|
845
850
|
withDriver: !0
|
|
846
851
|
} : {
|
|
847
852
|
label: e.trim(),
|
|
848
853
|
withDriver: !1
|
|
849
854
|
};
|
|
850
|
-
},
|
|
851
|
-
if (!
|
|
855
|
+
}, tt = "chunk-reload-timestamp", Y = "chunk-reload", nt = 1e4, X = 2, rt = !1;
|
|
856
|
+
if (!N && typeof window < "u") {
|
|
852
857
|
try {
|
|
853
858
|
let e = new URL(window.location.href);
|
|
854
|
-
e.searchParams.has(
|
|
859
|
+
e.searchParams.has(Y) && (rt = !0, e.searchParams.delete(Y), window.history.replaceState(null, "", e.toString()));
|
|
855
860
|
} catch {}
|
|
856
861
|
window.addEventListener("vite:preloadError", (e) => {
|
|
857
862
|
e.preventDefault();
|
|
858
863
|
});
|
|
859
864
|
}
|
|
860
|
-
var
|
|
865
|
+
var it = (e) => {
|
|
861
866
|
if (!(e instanceof Error)) return !1;
|
|
862
867
|
let t = e.message.toLowerCase();
|
|
863
868
|
return t.includes("dynamically imported module") || t.includes("importing a module script failed") || t.includes("loading chunk") || t.includes("loading css chunk") || t.includes("unable to preload css") || t.includes("failed to fetch") || t.includes("error loading dynamically imported module") || t.includes("load failed") || t.includes("without a valid default export") || e.name === "ChunkLoadError";
|
|
864
|
-
},
|
|
869
|
+
}, at = /import\s*\(\s*(['"])((\w+:(\/?\/?))?[^\s,]+)\1/, ot = (e) => e.toString().match(at)?.[2] ?? null, st = (e) => {
|
|
865
870
|
try {
|
|
866
871
|
return sessionStorage.getItem(e);
|
|
867
872
|
} catch {
|
|
868
873
|
return null;
|
|
869
874
|
}
|
|
870
|
-
},
|
|
875
|
+
}, ct = (e, t) => {
|
|
871
876
|
try {
|
|
872
877
|
sessionStorage.setItem(e, t);
|
|
873
878
|
} catch {}
|
|
874
|
-
},
|
|
875
|
-
for (let t = 0; t <
|
|
876
|
-
return await
|
|
879
|
+
}, lt = (e) => Function("url", "return import(url)")(e), ut = async (e) => {
|
|
880
|
+
for (let t = 0; t < X; t++) try {
|
|
881
|
+
return await lt(`${e}?t=${Date.now()}`);
|
|
877
882
|
} catch {
|
|
878
|
-
t <
|
|
883
|
+
t < X - 1 && await new Promise((e) => setTimeout(e, 500 * 2 ** t));
|
|
879
884
|
}
|
|
880
|
-
throw Error(`Failed to import ${e} after ${
|
|
881
|
-
},
|
|
885
|
+
throw Error(`Failed to import ${e} after ${X} retries`);
|
|
886
|
+
}, dt = async () => {
|
|
882
887
|
try {
|
|
883
888
|
if (typeof navigator < "u" && "serviceWorker" in navigator) {
|
|
884
889
|
let e = await navigator.serviceWorker.getRegistrations();
|
|
@@ -889,28 +894,34 @@ var tt = (e) => {
|
|
|
889
894
|
await Promise.all(e.map((e) => caches.delete(e)));
|
|
890
895
|
}
|
|
891
896
|
} catch {}
|
|
892
|
-
},
|
|
893
|
-
await
|
|
897
|
+
}, ft = async () => {
|
|
898
|
+
await dt();
|
|
894
899
|
let e = new URL(window.location.href);
|
|
895
|
-
e.searchParams.set(
|
|
896
|
-
},
|
|
900
|
+
e.searchParams.set(Y, String(Date.now())), window.location.replace(e.toString());
|
|
901
|
+
}, pt = (e) => e != null && e.default !== void 0, mt = (e) => r(async () => {
|
|
897
902
|
let t;
|
|
898
903
|
try {
|
|
899
904
|
let n = await e();
|
|
900
|
-
if (
|
|
905
|
+
if (pt(n)) return n;
|
|
901
906
|
t = /* @__PURE__ */ Error("Module resolved without a valid default export");
|
|
902
907
|
} catch (e) {
|
|
903
908
|
t = e;
|
|
904
909
|
}
|
|
905
|
-
if (
|
|
906
|
-
let n =
|
|
910
|
+
if (N || !it(t)) throw t;
|
|
911
|
+
let n = ot(e);
|
|
907
912
|
if (n) try {
|
|
908
|
-
let e = await
|
|
909
|
-
if (
|
|
913
|
+
let e = await ut(n);
|
|
914
|
+
if (pt(e)) return e;
|
|
910
915
|
} catch {}
|
|
911
|
-
let r = Number(
|
|
912
|
-
return Date.now() - r <
|
|
913
|
-
}),
|
|
916
|
+
let r = Number(st(tt) || "0");
|
|
917
|
+
return Date.now() - r < nt || rt || (ct(tt, String(Date.now())), await ft()), { default: () => null };
|
|
918
|
+
}), ht = "machine+operator", gt = "HOURS", _t = 8, vt = 24, yt = (e) => e?.withOperator ?? e?.type === ht, Z = (e = []) => e.find((e) => Q(e) || yt(e.article)), Q = ({ qtyUnit: e }) => e === gt, bt = ({ qtyUnit: e, quantity: t }) => Q({ qtyUnit: e }) ? 1 : t || 1, xt = (e) => {
|
|
919
|
+
let t = Z(e?.items);
|
|
920
|
+
return t && Q(t) && t.quantity ? t.quantity : void 0;
|
|
921
|
+
}, St = (e) => {
|
|
922
|
+
let t = Z(e?.items);
|
|
923
|
+
return !!t && Q(t) && t.unitPrice == null;
|
|
924
|
+
}, Ct = "Page Left", wt = 1800 * 1e3, Tt = 1e3, Et = (e, t = !0) => {
|
|
914
925
|
let n = 0, r = t ? e : null, i = !1, a = (e) => {
|
|
915
926
|
r !== null && (n += Math.max(0, e - r), r = null);
|
|
916
927
|
};
|
|
@@ -921,39 +932,39 @@ var tt = (e) => {
|
|
|
921
932
|
resume: (e) => {
|
|
922
933
|
!i && r === null && (r = e);
|
|
923
934
|
},
|
|
924
|
-
stop: (e) => (i ||= (a(e), !0), Math.min(
|
|
935
|
+
stop: (e) => (i ||= (a(e), !0), Math.min(wt, Math.round(n)))
|
|
925
936
|
};
|
|
926
|
-
},
|
|
937
|
+
}, Dt = (e, t) => t < 1e3 ? null : {
|
|
927
938
|
duration_ms: Math.round(t),
|
|
928
939
|
page_path: e
|
|
929
|
-
},
|
|
940
|
+
}, Ot = (e) => {
|
|
930
941
|
if (typeof e != "object" || !e) return !1;
|
|
931
942
|
let { exp: t, sub: n, entity_id: r, scope: i } = e;
|
|
932
943
|
return typeof t == "number" && typeof n == "string" && typeof r == "number" && Array.isArray(i) && i.every((e) => typeof e == "string");
|
|
933
|
-
},
|
|
944
|
+
}, kt = (e) => {
|
|
934
945
|
let t = e.replace(/-/g, "+").replace(/_/g, "/"), n = t + "=".repeat((4 - t.length % 4) % 4);
|
|
935
946
|
return decodeURIComponent(Array.from(atob(n), (e) => `%${e.charCodeAt(0).toString(16).padStart(2, "0")}`).join(""));
|
|
936
|
-
},
|
|
947
|
+
}, At = (e) => {
|
|
937
948
|
let t = e?.split(".")[1];
|
|
938
949
|
if (!t) return null;
|
|
939
950
|
try {
|
|
940
|
-
let e = JSON.parse(
|
|
941
|
-
return
|
|
951
|
+
let e = JSON.parse(kt(t));
|
|
952
|
+
return Ot(e) ? e : null;
|
|
942
953
|
} catch {
|
|
943
954
|
return null;
|
|
944
955
|
}
|
|
945
|
-
}, $ = (e) => btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""),
|
|
956
|
+
}, $ = (e) => btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""), jt = async (e, t) => {
|
|
946
957
|
let n = new TextEncoder(), r = await crypto.subtle.importKey("raw", n.encode(e), {
|
|
947
958
|
hash: "SHA-256",
|
|
948
959
|
name: "HMAC"
|
|
949
960
|
}, !1, ["sign"]), i = await crypto.subtle.sign("HMAC", r, n.encode(t));
|
|
950
961
|
return $(String.fromCharCode(...new Uint8Array(i)));
|
|
951
|
-
},
|
|
962
|
+
}, Mt = async (e, t) => {
|
|
952
963
|
let n = `${$(JSON.stringify({
|
|
953
964
|
alg: "HS256",
|
|
954
965
|
typ: "JWT"
|
|
955
966
|
}))}.${$(JSON.stringify(e))}`;
|
|
956
|
-
return `${n}.${await
|
|
967
|
+
return `${n}.${await jt(t, n)}`;
|
|
957
968
|
};
|
|
958
969
|
//#endregion
|
|
959
|
-
export {
|
|
970
|
+
export { A as AMPLITUDE_FEATURE_SELECTOR, O as AutoReloadOnNewVersion, _ as ChatClient, U as ChatContext, ve as ChatProvider, _t as DEFAULT_OPERATOR_HOURS_PER_DAY, k as GTMSendPageView, M as InitializeAmplitude, F as InitializeAxiosConfig, ae as InitializeDaysJSConfig, oe as InitializeHubSpot, se as InitializeI18nConfig, ue as InitializeSentryConfig, y as InjectDependenciesContext, b as InjectDependenciesProvider, vt as MAX_OPERATOR_HOURS_PER_DAY, v as MaskTextField, wt as PAGE_DURATION_CAP_MS, Tt as PAGE_DURATION_MIN_MS, Ct as PAGE_LEFT_EVENT, Ce as QueryProvider, fe as RequireAuth, z as SENTRY_IGNORED_REQUEST_URLS, ce as SENTRY_KEEP_REPLAY, re as SUPPORTED_LANGUAGE, pe as ShowHubSpotBubble, et as articleNameAdapter, Et as createVisibleStopwatch, G as dateAdapter, At as decodeToken, K as distanceAdapter, Mt as encodeToken, Z as findOperatorItem, J as getCurrentLanguage, xt as getOperatorHoursPerDay, e as getOrvalConfig, bt as getUnitCount, Q as isHourlyLine, yt as isOperatorArticle, St as isOperatorRateMissing, le as isReplayKeptForError, mt as lazyWithRetry, B as matchesRequestUrl, Dt as pageLeftProperties, W as shouldRetryQuery, Ee as useAdapter, De as useAmplitude, Oe as useAuth, je as useChat, Me as useCurrentLanguage, Re as useFilters, Be as useHubSpot, Ve as useInfiniteDataGrid, He as useResponseError, q as worksiteNameAdapter };
|
|
@@ -15,6 +15,11 @@ export interface ArticleName {
|
|
|
15
15
|
* differ by it alone ("[Avec opérateur Jours]", "[Avec opérateur Heures]"): the tag says it.
|
|
16
16
|
*/
|
|
17
17
|
driverUnit?: DriverUnit;
|
|
18
|
+
/**
|
|
19
|
+
* The mention as the name writes it, without its brackets nor the separator before it ("Avec opérateur Jours"), its
|
|
20
|
+
* first letter capitalised: what a tag shows in its place.
|
|
21
|
+
*/
|
|
22
|
+
driverMention?: string;
|
|
18
23
|
}
|
|
19
24
|
export type DriverUnit = "days" | "hours";
|
|
20
25
|
export interface ArticleNameOptions {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Driver's hours per day when none is asked: the day a contract's day price stands for
|
|
3
|
+
*/
|
|
4
|
+
export declare const DEFAULT_OPERATOR_HOURS_PER_DAY = 8;
|
|
5
|
+
/**
|
|
6
|
+
* A whole day, the most a driver's day counts: past 12 hours the machine runs in shifts, its drivers taking turns
|
|
7
|
+
*/
|
|
8
|
+
export declare const MAX_OPERATOR_HOURS_PER_DAY = 24;
|
|
9
|
+
/**
|
|
10
|
+
* What tells an article rented with its driver
|
|
11
|
+
*/
|
|
12
|
+
export interface OperatorArticle {
|
|
13
|
+
type?: string | null;
|
|
14
|
+
withOperator?: boolean | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* What tells a line ordered by the hour
|
|
18
|
+
*/
|
|
19
|
+
export interface OperatorLine {
|
|
20
|
+
article?: OperatorArticle | null;
|
|
21
|
+
qtyUnit?: string | null;
|
|
22
|
+
quantity?: number | null;
|
|
23
|
+
/**
|
|
24
|
+
* On a line ordered by the hour, the hourly rate
|
|
25
|
+
*/
|
|
26
|
+
unitPrice?: number | null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Whether an article is rented with its driver: the catalog says so, or the article's type where the catalog says nothing
|
|
30
|
+
*/
|
|
31
|
+
export declare const isOperatorArticle: (article?: OperatorArticle | null) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The line of an order rented with its driver, the one its hour sheets are about: the line ordered by the hour (a
|
|
34
|
+
* machine asked with its driver is, whatever its article), or one whose article comes with its driver, ordered by the day
|
|
35
|
+
* before the hourly lines
|
|
36
|
+
*/
|
|
37
|
+
export declare const findOperatorItem: <Item extends Pick<OperatorLine, "article" | "qtyUnit">>(items?: Item[]) => Item | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Whether a line is ordered by the hour: its quantity is then the driver's hours per day, not a number of machines
|
|
40
|
+
*/
|
|
41
|
+
export declare const isHourlyLine: ({ qtyUnit }: Pick<OperatorLine, "qtyUnit">) => boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The number of machines a line orders: its quantity, but for a line ordered by the hour, which is a single machine
|
|
44
|
+
*/
|
|
45
|
+
export declare const getUnitCount: ({ qtyUnit, quantity }: Pick<OperatorLine, "qtyUnit" | "quantity">) => number;
|
|
46
|
+
/**
|
|
47
|
+
* Driver's hours per day of an order: the quantity of its driver's line once ordered by the hour, none before
|
|
48
|
+
*/
|
|
49
|
+
export declare const getOperatorHoursPerDay: (order?: {
|
|
50
|
+
items?: OperatorLine[];
|
|
51
|
+
} | null) => number | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the driver's line of an order, ordered by the hour, still lacks its hourly rate: the API takes none of its
|
|
54
|
+
* hour sheets until it has one
|
|
55
|
+
*/
|
|
56
|
+
export declare const isOperatorRateMissing: (order?: {
|
|
57
|
+
items?: OperatorLine[];
|
|
58
|
+
} | null) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|