wcz-test 6.14.0 → 6.20.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/ApprovalStatus-C9HPyMiS.js.map +1 -1
- package/dist/DialogsHooks-Bi8dZoyu.js +338 -0
- package/dist/DialogsHooks-Bi8dZoyu.js.map +1 -0
- package/dist/FileHooks-hWKTwLCr.js +195 -0
- package/dist/FileHooks-hWKTwLCr.js.map +1 -0
- package/dist/FileMeta-G1oT3mYK.js.map +1 -1
- package/dist/{RouterListItemButton-Cx7rXEfm.js → RouterListItemButton-CHS7rofI.js} +4 -4
- package/dist/RouterListItemButton-CHS7rofI.js.map +1 -0
- package/dist/auth-client-B6cIXYDV.js +1417 -0
- package/dist/auth-client-B6cIXYDV.js.map +1 -0
- package/dist/client.d.ts +61 -49
- package/dist/client.js +7 -3
- package/dist/client.js.map +1 -1
- package/dist/components.js +68 -3405
- package/dist/components.js.map +1 -1
- package/dist/env-CoxTjaDr.js.map +1 -1
- package/dist/error-BhAKg8LX-X0sdNXNa.js +195 -0
- package/dist/error-BhAKg8LX-X0sdNXNa.js.map +1 -0
- package/dist/hooks.d.ts +6 -2
- package/dist/hooks.js +35 -1040
- package/dist/hooks.js.map +1 -1
- package/dist/index.js +90 -504
- package/dist/index.js.map +1 -1
- package/dist/manifest.webmanifest +18 -18
- package/dist/models.d.ts +10 -10
- package/dist/models.js +4 -4
- package/dist/models.js.map +1 -1
- package/dist/queries.d.ts +6 -6
- package/dist/queries.js +2 -2
- package/dist/queries.js.map +1 -1
- package/dist/server-mxQ3s5dx-CC81W42s.js +644 -0
- package/dist/server-mxQ3s5dx-CC81W42s.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +8659 -5
- package/dist/server.js.map +1 -1
- package/dist/{utils-JYv9O0GI.js → utils-DKyKGba7.js} +2 -1
- package/dist/utils-DKyKGba7.js.map +1 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.js +9 -0
- package/dist/utils.js.map +1 -0
- package/dist/vite.js +3 -0
- package/dist/vite.js.map +1 -1
- package/package.json +120 -116
- package/dist/DialogsHooks-BlUsVlfv.js +0 -39
- package/dist/DialogsHooks-BlUsVlfv.js.map +0 -1
- package/dist/FileHooks-41k6-RtZ.js +0 -3262
- package/dist/FileHooks-41k6-RtZ.js.map +0 -1
- package/dist/RouterListItemButton-Cx7rXEfm.js.map +0 -1
- package/dist/auth-client-o9U0_qmf.js +0 -79
- package/dist/auth-client-o9U0_qmf.js.map +0 -1
- package/dist/utils-JYv9O0GI.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { j as jsxRuntimeExports, D as DialogsContext, u as useDialogs } from "./DialogsHooks-Bi8dZoyu.js";
|
|
2
2
|
import { Stack, Typography, Collapse, useMediaQuery, useColorScheme, List as List$1, ListItemButton as ListItemButton$1, ListItemIcon as ListItemIcon$1, ListItemText as ListItemText$1, ListSubheader as ListSubheader$1, IconButton, Avatar as Avatar$1, Menu, Box as Box$1, ListItem as ListItem$1, InitColorSchemeScript, CssBaseline, AppBar, Toolbar, LinearProgress, ThemeProvider } from "@mui/material";
|
|
3
3
|
import { LocalizationProvider } from "@mui/x-date-pickers";
|
|
4
4
|
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
|
|
@@ -6,13 +6,13 @@ import { createIsomorphicFn, createServerFn } from "@tanstack/react-start";
|
|
|
6
6
|
import { getCookie } from "@tanstack/react-start/server";
|
|
7
7
|
import dayjs from "dayjs";
|
|
8
8
|
import i18n from "i18next";
|
|
9
|
-
import
|
|
9
|
+
import LanguageDetector from "i18next-browser-languagedetector";
|
|
10
|
+
import { useState, useId, useRef, Fragment, useEffect, useEffectEvent } from "react";
|
|
10
11
|
import { useTranslation, initReactI18next } from "react-i18next";
|
|
11
12
|
import { resources } from "virtual:wcz-layout";
|
|
12
13
|
import z__default from "zod";
|
|
13
14
|
import useEventCallback from "@mui/utils/useEventCallback";
|
|
14
|
-
import {
|
|
15
|
-
import { a as authClient, u as useGetTheme } from "./auth-client-o9U0_qmf.js";
|
|
15
|
+
import { a as authClient, u as useGetTheme } from "./auth-client-B6cIXYDV.js";
|
|
16
16
|
import Menu$1 from "@mui/icons-material/Menu";
|
|
17
17
|
import MenuOpen from "@mui/icons-material/MenuOpen";
|
|
18
18
|
import { styled, useTheme } from "@mui/material/styles";
|
|
@@ -33,7 +33,7 @@ import ListItemText from "@mui/material/ListItemText";
|
|
|
33
33
|
import Paper from "@mui/material/Paper";
|
|
34
34
|
import Popper from "@mui/material/Popper";
|
|
35
35
|
import Typography$1 from "@mui/material/Typography";
|
|
36
|
-
import { R as RouterListItemButton } from "./RouterListItemButton-
|
|
36
|
+
import { R as RouterListItemButton } from "./RouterListItemButton-CHS7rofI.js";
|
|
37
37
|
import "@mui/icons-material/AccountCircle";
|
|
38
38
|
import ArrowBack from "@mui/icons-material/ArrowBack";
|
|
39
39
|
import Brightness4 from "@mui/icons-material/Brightness4";
|
|
@@ -45,421 +45,7 @@ import Logout from "@mui/icons-material/Logout";
|
|
|
45
45
|
import SettingsBrightness from "@mui/icons-material/SettingsBrightness";
|
|
46
46
|
import Translate from "@mui/icons-material/Translate";
|
|
47
47
|
import Done from "@mui/icons-material/Done";
|
|
48
|
-
import { r } from "./utils-
|
|
49
|
-
const {
|
|
50
|
-
slice,
|
|
51
|
-
forEach
|
|
52
|
-
} = [];
|
|
53
|
-
function defaults(obj) {
|
|
54
|
-
forEach.call(slice.call(arguments, 1), (source) => {
|
|
55
|
-
if (source) {
|
|
56
|
-
for (const prop in source) {
|
|
57
|
-
if (obj[prop] === void 0) obj[prop] = source[prop];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
return obj;
|
|
62
|
-
}
|
|
63
|
-
function hasXSS(input) {
|
|
64
|
-
if (typeof input !== "string") return false;
|
|
65
|
-
const xssPatterns = [/<\s*script.*?>/i, /<\s*\/\s*script\s*>/i, /<\s*img.*?on\w+\s*=/i, /<\s*\w+\s*on\w+\s*=.*?>/i, /javascript\s*:/i, /vbscript\s*:/i, /expression\s*\(/i, /eval\s*\(/i, /alert\s*\(/i, /document\.cookie/i, /document\.write\s*\(/i, /window\.location/i, /innerHTML/i];
|
|
66
|
-
return xssPatterns.some((pattern) => pattern.test(input));
|
|
67
|
-
}
|
|
68
|
-
const fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
69
|
-
const serializeCookie = function(name, val) {
|
|
70
|
-
let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
71
|
-
path: "/"
|
|
72
|
-
};
|
|
73
|
-
const opt = options;
|
|
74
|
-
const value = encodeURIComponent(val);
|
|
75
|
-
let str = `${name}=${value}`;
|
|
76
|
-
if (opt.maxAge > 0) {
|
|
77
|
-
const maxAge = opt.maxAge - 0;
|
|
78
|
-
if (Number.isNaN(maxAge)) throw new Error("maxAge should be a Number");
|
|
79
|
-
str += `; Max-Age=${Math.floor(maxAge)}`;
|
|
80
|
-
}
|
|
81
|
-
if (opt.domain) {
|
|
82
|
-
if (!fieldContentRegExp.test(opt.domain)) {
|
|
83
|
-
throw new TypeError("option domain is invalid");
|
|
84
|
-
}
|
|
85
|
-
str += `; Domain=${opt.domain}`;
|
|
86
|
-
}
|
|
87
|
-
if (opt.path) {
|
|
88
|
-
if (!fieldContentRegExp.test(opt.path)) {
|
|
89
|
-
throw new TypeError("option path is invalid");
|
|
90
|
-
}
|
|
91
|
-
str += `; Path=${opt.path}`;
|
|
92
|
-
}
|
|
93
|
-
if (opt.expires) {
|
|
94
|
-
if (typeof opt.expires.toUTCString !== "function") {
|
|
95
|
-
throw new TypeError("option expires is invalid");
|
|
96
|
-
}
|
|
97
|
-
str += `; Expires=${opt.expires.toUTCString()}`;
|
|
98
|
-
}
|
|
99
|
-
if (opt.httpOnly) str += "; HttpOnly";
|
|
100
|
-
if (opt.secure) str += "; Secure";
|
|
101
|
-
if (opt.sameSite) {
|
|
102
|
-
const sameSite = typeof opt.sameSite === "string" ? opt.sameSite.toLowerCase() : opt.sameSite;
|
|
103
|
-
switch (sameSite) {
|
|
104
|
-
case true:
|
|
105
|
-
str += "; SameSite=Strict";
|
|
106
|
-
break;
|
|
107
|
-
case "lax":
|
|
108
|
-
str += "; SameSite=Lax";
|
|
109
|
-
break;
|
|
110
|
-
case "strict":
|
|
111
|
-
str += "; SameSite=Strict";
|
|
112
|
-
break;
|
|
113
|
-
case "none":
|
|
114
|
-
str += "; SameSite=None";
|
|
115
|
-
break;
|
|
116
|
-
default:
|
|
117
|
-
throw new TypeError("option sameSite is invalid");
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
if (opt.partitioned) str += "; Partitioned";
|
|
121
|
-
return str;
|
|
122
|
-
};
|
|
123
|
-
const cookie = {
|
|
124
|
-
create(name, value, minutes, domain) {
|
|
125
|
-
let cookieOptions = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
126
|
-
path: "/",
|
|
127
|
-
sameSite: "strict"
|
|
128
|
-
};
|
|
129
|
-
if (minutes) {
|
|
130
|
-
cookieOptions.expires = /* @__PURE__ */ new Date();
|
|
131
|
-
cookieOptions.expires.setTime(cookieOptions.expires.getTime() + minutes * 60 * 1e3);
|
|
132
|
-
}
|
|
133
|
-
if (domain) cookieOptions.domain = domain;
|
|
134
|
-
document.cookie = serializeCookie(name, value, cookieOptions);
|
|
135
|
-
},
|
|
136
|
-
read(name) {
|
|
137
|
-
const nameEQ = `${name}=`;
|
|
138
|
-
const ca = document.cookie.split(";");
|
|
139
|
-
for (let i = 0; i < ca.length; i++) {
|
|
140
|
-
let c = ca[i];
|
|
141
|
-
while (c.charAt(0) === " ") c = c.substring(1, c.length);
|
|
142
|
-
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
143
|
-
}
|
|
144
|
-
return null;
|
|
145
|
-
},
|
|
146
|
-
remove(name, domain) {
|
|
147
|
-
this.create(name, "", -1, domain);
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
var cookie$1 = {
|
|
151
|
-
name: "cookie",
|
|
152
|
-
// Deconstruct the options object and extract the lookupCookie property
|
|
153
|
-
lookup(_ref) {
|
|
154
|
-
let {
|
|
155
|
-
lookupCookie
|
|
156
|
-
} = _ref;
|
|
157
|
-
if (lookupCookie && typeof document !== "undefined") {
|
|
158
|
-
return cookie.read(lookupCookie) || void 0;
|
|
159
|
-
}
|
|
160
|
-
return void 0;
|
|
161
|
-
},
|
|
162
|
-
// Deconstruct the options object and extract the lookupCookie, cookieMinutes, cookieDomain, and cookieOptions properties
|
|
163
|
-
cacheUserLanguage(lng, _ref2) {
|
|
164
|
-
let {
|
|
165
|
-
lookupCookie,
|
|
166
|
-
cookieMinutes,
|
|
167
|
-
cookieDomain,
|
|
168
|
-
cookieOptions
|
|
169
|
-
} = _ref2;
|
|
170
|
-
if (lookupCookie && typeof document !== "undefined") {
|
|
171
|
-
cookie.create(lookupCookie, lng, cookieMinutes, cookieDomain, cookieOptions);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
var querystring = {
|
|
176
|
-
name: "querystring",
|
|
177
|
-
// Deconstruct the options object and extract the lookupQuerystring property
|
|
178
|
-
lookup(_ref) {
|
|
179
|
-
let {
|
|
180
|
-
lookupQuerystring
|
|
181
|
-
} = _ref;
|
|
182
|
-
let found;
|
|
183
|
-
if (typeof window !== "undefined") {
|
|
184
|
-
let {
|
|
185
|
-
search
|
|
186
|
-
} = window.location;
|
|
187
|
-
if (!window.location.search && window.location.hash?.indexOf("?") > -1) {
|
|
188
|
-
search = window.location.hash.substring(window.location.hash.indexOf("?"));
|
|
189
|
-
}
|
|
190
|
-
const query = search.substring(1);
|
|
191
|
-
const params = query.split("&");
|
|
192
|
-
for (let i = 0; i < params.length; i++) {
|
|
193
|
-
const pos = params[i].indexOf("=");
|
|
194
|
-
if (pos > 0) {
|
|
195
|
-
const key = params[i].substring(0, pos);
|
|
196
|
-
if (key === lookupQuerystring) {
|
|
197
|
-
found = params[i].substring(pos + 1);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
return found;
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
var hash = {
|
|
206
|
-
name: "hash",
|
|
207
|
-
// Deconstruct the options object and extract the lookupHash property and the lookupFromHashIndex property
|
|
208
|
-
lookup(_ref) {
|
|
209
|
-
let {
|
|
210
|
-
lookupHash,
|
|
211
|
-
lookupFromHashIndex
|
|
212
|
-
} = _ref;
|
|
213
|
-
let found;
|
|
214
|
-
if (typeof window !== "undefined") {
|
|
215
|
-
const {
|
|
216
|
-
hash: hash2
|
|
217
|
-
} = window.location;
|
|
218
|
-
if (hash2 && hash2.length > 2) {
|
|
219
|
-
const query = hash2.substring(1);
|
|
220
|
-
if (lookupHash) {
|
|
221
|
-
const params = query.split("&");
|
|
222
|
-
for (let i = 0; i < params.length; i++) {
|
|
223
|
-
const pos = params[i].indexOf("=");
|
|
224
|
-
if (pos > 0) {
|
|
225
|
-
const key = params[i].substring(0, pos);
|
|
226
|
-
if (key === lookupHash) {
|
|
227
|
-
found = params[i].substring(pos + 1);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
if (found) return found;
|
|
233
|
-
if (!found && lookupFromHashIndex > -1) {
|
|
234
|
-
const language = hash2.match(/\/([a-zA-Z-]*)/g);
|
|
235
|
-
if (!Array.isArray(language)) return void 0;
|
|
236
|
-
const index = typeof lookupFromHashIndex === "number" ? lookupFromHashIndex : 0;
|
|
237
|
-
return language[index]?.replace("/", "");
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
return found;
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
let hasLocalStorageSupport = null;
|
|
245
|
-
const localStorageAvailable = () => {
|
|
246
|
-
if (hasLocalStorageSupport !== null) return hasLocalStorageSupport;
|
|
247
|
-
try {
|
|
248
|
-
hasLocalStorageSupport = typeof window !== "undefined" && window.localStorage !== null;
|
|
249
|
-
if (!hasLocalStorageSupport) {
|
|
250
|
-
return false;
|
|
251
|
-
}
|
|
252
|
-
const testKey = "i18next.translate.boo";
|
|
253
|
-
window.localStorage.setItem(testKey, "foo");
|
|
254
|
-
window.localStorage.removeItem(testKey);
|
|
255
|
-
} catch (e) {
|
|
256
|
-
hasLocalStorageSupport = false;
|
|
257
|
-
}
|
|
258
|
-
return hasLocalStorageSupport;
|
|
259
|
-
};
|
|
260
|
-
var localStorage = {
|
|
261
|
-
name: "localStorage",
|
|
262
|
-
// Deconstruct the options object and extract the lookupLocalStorage property
|
|
263
|
-
lookup(_ref) {
|
|
264
|
-
let {
|
|
265
|
-
lookupLocalStorage
|
|
266
|
-
} = _ref;
|
|
267
|
-
if (lookupLocalStorage && localStorageAvailable()) {
|
|
268
|
-
return window.localStorage.getItem(lookupLocalStorage) || void 0;
|
|
269
|
-
}
|
|
270
|
-
return void 0;
|
|
271
|
-
},
|
|
272
|
-
// Deconstruct the options object and extract the lookupLocalStorage property
|
|
273
|
-
cacheUserLanguage(lng, _ref2) {
|
|
274
|
-
let {
|
|
275
|
-
lookupLocalStorage
|
|
276
|
-
} = _ref2;
|
|
277
|
-
if (lookupLocalStorage && localStorageAvailable()) {
|
|
278
|
-
window.localStorage.setItem(lookupLocalStorage, lng);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
let hasSessionStorageSupport = null;
|
|
283
|
-
const sessionStorageAvailable = () => {
|
|
284
|
-
if (hasSessionStorageSupport !== null) return hasSessionStorageSupport;
|
|
285
|
-
try {
|
|
286
|
-
hasSessionStorageSupport = typeof window !== "undefined" && window.sessionStorage !== null;
|
|
287
|
-
if (!hasSessionStorageSupport) {
|
|
288
|
-
return false;
|
|
289
|
-
}
|
|
290
|
-
const testKey = "i18next.translate.boo";
|
|
291
|
-
window.sessionStorage.setItem(testKey, "foo");
|
|
292
|
-
window.sessionStorage.removeItem(testKey);
|
|
293
|
-
} catch (e) {
|
|
294
|
-
hasSessionStorageSupport = false;
|
|
295
|
-
}
|
|
296
|
-
return hasSessionStorageSupport;
|
|
297
|
-
};
|
|
298
|
-
var sessionStorage = {
|
|
299
|
-
name: "sessionStorage",
|
|
300
|
-
lookup(_ref) {
|
|
301
|
-
let {
|
|
302
|
-
lookupSessionStorage
|
|
303
|
-
} = _ref;
|
|
304
|
-
if (lookupSessionStorage && sessionStorageAvailable()) {
|
|
305
|
-
return window.sessionStorage.getItem(lookupSessionStorage) || void 0;
|
|
306
|
-
}
|
|
307
|
-
return void 0;
|
|
308
|
-
},
|
|
309
|
-
cacheUserLanguage(lng, _ref2) {
|
|
310
|
-
let {
|
|
311
|
-
lookupSessionStorage
|
|
312
|
-
} = _ref2;
|
|
313
|
-
if (lookupSessionStorage && sessionStorageAvailable()) {
|
|
314
|
-
window.sessionStorage.setItem(lookupSessionStorage, lng);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
var navigator$1 = {
|
|
319
|
-
name: "navigator",
|
|
320
|
-
lookup(options) {
|
|
321
|
-
const found = [];
|
|
322
|
-
if (typeof navigator !== "undefined") {
|
|
323
|
-
const {
|
|
324
|
-
languages,
|
|
325
|
-
userLanguage,
|
|
326
|
-
language
|
|
327
|
-
} = navigator;
|
|
328
|
-
if (languages) {
|
|
329
|
-
for (let i = 0; i < languages.length; i++) {
|
|
330
|
-
found.push(languages[i]);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
if (userLanguage) {
|
|
334
|
-
found.push(userLanguage);
|
|
335
|
-
}
|
|
336
|
-
if (language) {
|
|
337
|
-
found.push(language);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
return found.length > 0 ? found : void 0;
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
var htmlTag = {
|
|
344
|
-
name: "htmlTag",
|
|
345
|
-
// Deconstruct the options object and extract the htmlTag property
|
|
346
|
-
lookup(_ref) {
|
|
347
|
-
let {
|
|
348
|
-
htmlTag: htmlTag2
|
|
349
|
-
} = _ref;
|
|
350
|
-
let found;
|
|
351
|
-
const internalHtmlTag = htmlTag2 || (typeof document !== "undefined" ? document.documentElement : null);
|
|
352
|
-
if (internalHtmlTag && typeof internalHtmlTag.getAttribute === "function") {
|
|
353
|
-
found = internalHtmlTag.getAttribute("lang");
|
|
354
|
-
}
|
|
355
|
-
return found;
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
var path = {
|
|
359
|
-
name: "path",
|
|
360
|
-
// Deconstruct the options object and extract the lookupFromPathIndex property
|
|
361
|
-
lookup(_ref) {
|
|
362
|
-
let {
|
|
363
|
-
lookupFromPathIndex
|
|
364
|
-
} = _ref;
|
|
365
|
-
if (typeof window === "undefined") return void 0;
|
|
366
|
-
const language = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
|
|
367
|
-
if (!Array.isArray(language)) return void 0;
|
|
368
|
-
const index = typeof lookupFromPathIndex === "number" ? lookupFromPathIndex : 0;
|
|
369
|
-
return language[index]?.replace("/", "");
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
var subdomain = {
|
|
373
|
-
name: "subdomain",
|
|
374
|
-
lookup(_ref) {
|
|
375
|
-
let {
|
|
376
|
-
lookupFromSubdomainIndex
|
|
377
|
-
} = _ref;
|
|
378
|
-
const internalLookupFromSubdomainIndex = typeof lookupFromSubdomainIndex === "number" ? lookupFromSubdomainIndex + 1 : 1;
|
|
379
|
-
const language = typeof window !== "undefined" && window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
|
|
380
|
-
if (!language) return void 0;
|
|
381
|
-
return language[internalLookupFromSubdomainIndex];
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
let canCookies = false;
|
|
385
|
-
try {
|
|
386
|
-
document.cookie;
|
|
387
|
-
canCookies = true;
|
|
388
|
-
} catch (e) {
|
|
389
|
-
}
|
|
390
|
-
const order = ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"];
|
|
391
|
-
if (!canCookies) order.splice(1, 1);
|
|
392
|
-
const getDefaults = () => ({
|
|
393
|
-
order,
|
|
394
|
-
lookupQuerystring: "lng",
|
|
395
|
-
lookupCookie: "i18next",
|
|
396
|
-
lookupLocalStorage: "i18nextLng",
|
|
397
|
-
lookupSessionStorage: "i18nextLng",
|
|
398
|
-
// cache user language
|
|
399
|
-
caches: ["localStorage"],
|
|
400
|
-
excludeCacheFor: ["cimode"],
|
|
401
|
-
// cookieMinutes: 10,
|
|
402
|
-
// cookieDomain: 'myDomain'
|
|
403
|
-
convertDetectedLanguage: (l) => l
|
|
404
|
-
});
|
|
405
|
-
class Browser {
|
|
406
|
-
constructor(services) {
|
|
407
|
-
let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
408
|
-
this.type = "languageDetector";
|
|
409
|
-
this.detectors = {};
|
|
410
|
-
this.init(services, options);
|
|
411
|
-
}
|
|
412
|
-
init() {
|
|
413
|
-
let services = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
414
|
-
languageUtils: {}
|
|
415
|
-
};
|
|
416
|
-
let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
417
|
-
let i18nOptions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
418
|
-
this.services = services;
|
|
419
|
-
this.options = defaults(options, this.options || {}, getDefaults());
|
|
420
|
-
if (typeof this.options.convertDetectedLanguage === "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1) {
|
|
421
|
-
this.options.convertDetectedLanguage = (l) => l.replace("-", "_");
|
|
422
|
-
}
|
|
423
|
-
if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;
|
|
424
|
-
this.i18nOptions = i18nOptions;
|
|
425
|
-
this.addDetector(cookie$1);
|
|
426
|
-
this.addDetector(querystring);
|
|
427
|
-
this.addDetector(localStorage);
|
|
428
|
-
this.addDetector(sessionStorage);
|
|
429
|
-
this.addDetector(navigator$1);
|
|
430
|
-
this.addDetector(htmlTag);
|
|
431
|
-
this.addDetector(path);
|
|
432
|
-
this.addDetector(subdomain);
|
|
433
|
-
this.addDetector(hash);
|
|
434
|
-
}
|
|
435
|
-
addDetector(detector) {
|
|
436
|
-
this.detectors[detector.name] = detector;
|
|
437
|
-
return this;
|
|
438
|
-
}
|
|
439
|
-
detect() {
|
|
440
|
-
let detectionOrder = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.order;
|
|
441
|
-
let detected = [];
|
|
442
|
-
detectionOrder.forEach((detectorName) => {
|
|
443
|
-
if (this.detectors[detectorName]) {
|
|
444
|
-
let lookup = this.detectors[detectorName].lookup(this.options);
|
|
445
|
-
if (lookup && typeof lookup === "string") lookup = [lookup];
|
|
446
|
-
if (lookup) detected = detected.concat(lookup);
|
|
447
|
-
}
|
|
448
|
-
});
|
|
449
|
-
detected = detected.filter((d) => d !== void 0 && d !== null && !hasXSS(d)).map((d) => this.options.convertDetectedLanguage(d));
|
|
450
|
-
if (this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes) return detected;
|
|
451
|
-
return detected.length > 0 ? detected[0] : null;
|
|
452
|
-
}
|
|
453
|
-
cacheUserLanguage(lng) {
|
|
454
|
-
let caches = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.caches;
|
|
455
|
-
if (!caches) return;
|
|
456
|
-
if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > -1) return;
|
|
457
|
-
caches.forEach((cacheName) => {
|
|
458
|
-
if (this.detectors[cacheName]) this.detectors[cacheName].cacheUserLanguage(lng, this.options);
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
Browser.type = "languageDetector";
|
|
48
|
+
import { r } from "./utils-DKyKGba7.js";
|
|
463
49
|
function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
464
50
|
const [stack, setStack] = useState([]);
|
|
465
51
|
const keyPrefix = useId();
|
|
@@ -510,9 +96,9 @@ function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
|
510
96
|
}
|
|
511
97
|
return dialog;
|
|
512
98
|
});
|
|
513
|
-
return /* @__PURE__ */ jsxs(DialogsContext.Provider, { value: { open: requestDialog, close: closeDialog }, children: [
|
|
99
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogsContext.Provider, { value: { open: requestDialog, close: closeDialog }, children: [
|
|
514
100
|
children,
|
|
515
|
-
stack.map(({ key, open, Component, payload, promise }) => /* @__PURE__ */ jsx(
|
|
101
|
+
stack.map(({ key, open, Component, payload, promise }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
516
102
|
Component,
|
|
517
103
|
{
|
|
518
104
|
payload,
|
|
@@ -526,9 +112,9 @@ function DialogsProvider({ children, unmountAfter = 1e3 }) {
|
|
|
526
112
|
] });
|
|
527
113
|
}
|
|
528
114
|
const AppTitle = () => {
|
|
529
|
-
return /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", spacing: 2, flexGrow: 1, children: [
|
|
530
|
-
/* @__PURE__ */ jsx("img", { src: "/favicon-32x32.png", alt: "app-logo", loading: "lazy" }),
|
|
531
|
-
/* @__PURE__ */ jsx(Typography, { variant: "h6", children: clientEnv.VITE_APP_TITLE }),
|
|
115
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Stack, { direction: "row", alignItems: "center", spacing: 2, flexGrow: 1, children: [
|
|
116
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: "/favicon-32x32.png", alt: "app-logo", loading: "lazy" }),
|
|
117
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "h6", children: clientEnv.VITE_APP_TITLE }),
|
|
532
118
|
false
|
|
533
119
|
] });
|
|
534
120
|
};
|
|
@@ -575,12 +161,12 @@ const StyledRouterButton = styled(RouterListItemButton)(({ theme }) => ({
|
|
|
575
161
|
}));
|
|
576
162
|
const IconOrAvatar = ({ item, collapsed }) => {
|
|
577
163
|
if (item.icon || collapsed) {
|
|
578
|
-
return /* @__PURE__ */ jsxs(Box, { sx: collapsed ? { position: "absolute", left: "50%", top: "calc(50% - 6px)", transform: "translate(-50%, -50%)" } : {}, children: [
|
|
579
|
-
/* @__PURE__ */ jsxs(ListItemIcon, { sx: { display: "flex", alignItems: "center", justifyContent: "center", minWidth: ICON_SIZE }, children: [
|
|
164
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: collapsed ? { position: "absolute", left: "50%", top: "calc(50% - 6px)", transform: "translate(-50%, -50%)" } : {}, children: [
|
|
165
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(ListItemIcon, { sx: { display: "flex", alignItems: "center", justifyContent: "center", minWidth: ICON_SIZE }, children: [
|
|
580
166
|
item.icon ?? null,
|
|
581
|
-
!item.icon && collapsed ? /* @__PURE__ */ jsx(Avatar, { sx: { width: ICON_SIZE - 7, height: ICON_SIZE - 7, fontSize: 12 }, children: item.title }) : null
|
|
167
|
+
!item.icon && collapsed ? /* @__PURE__ */ jsxRuntimeExports.jsx(Avatar, { sx: { width: ICON_SIZE - 7, height: ICON_SIZE - 7, fontSize: 12 }, children: item.title }) : null
|
|
582
168
|
] }),
|
|
583
|
-
collapsed ? /* @__PURE__ */ jsx(
|
|
169
|
+
collapsed ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
584
170
|
Typography$1,
|
|
585
171
|
{
|
|
586
172
|
variant: "caption",
|
|
@@ -604,7 +190,7 @@ const IconOrAvatar = ({ item, collapsed }) => {
|
|
|
604
190
|
}
|
|
605
191
|
return null;
|
|
606
192
|
};
|
|
607
|
-
const MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ jsx(
|
|
193
|
+
const MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
608
194
|
Popper,
|
|
609
195
|
{
|
|
610
196
|
open,
|
|
@@ -615,7 +201,7 @@ const MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ jsx(
|
|
|
615
201
|
{ name: "preventOverflow", options: { padding: 8 } },
|
|
616
202
|
{ name: "flip", options: { fallbackPlacements: ["right-end", "left-start"] } }
|
|
617
203
|
],
|
|
618
|
-
children: /* @__PURE__ */ jsx(
|
|
204
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
619
205
|
Paper,
|
|
620
206
|
{
|
|
621
207
|
sx: {
|
|
@@ -657,9 +243,9 @@ const NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSid
|
|
|
657
243
|
disabled,
|
|
658
244
|
sx: { px: 1.4, height: collapsed ? 60 : 48 }
|
|
659
245
|
};
|
|
660
|
-
const buttonContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
661
|
-
/* @__PURE__ */ jsx(IconOrAvatar, { item, collapsed }),
|
|
662
|
-
!collapsed && /* @__PURE__ */ jsx(
|
|
246
|
+
const buttonContent = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
247
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IconOrAvatar, { item, collapsed }),
|
|
248
|
+
!collapsed && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
663
249
|
ListItemText,
|
|
664
250
|
{
|
|
665
251
|
primary: item.title,
|
|
@@ -667,9 +253,9 @@ const NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSid
|
|
|
667
253
|
sx: { ml: 1.2, flex: 1, minWidth: 0, "& .MuiTypography-root": { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }
|
|
668
254
|
}
|
|
669
255
|
),
|
|
670
|
-
item.children ? /* @__PURE__ */ jsx(ExpandMoreIcon, { sx: chevronSx }) : null
|
|
256
|
+
item.children ? /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandMoreIcon, { sx: chevronSx }) : null
|
|
671
257
|
] });
|
|
672
|
-
const listItem = /* @__PURE__ */ jsxs(
|
|
258
|
+
const listItem = /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
673
259
|
ListItem,
|
|
674
260
|
{
|
|
675
261
|
...item.children && collapsed ? {
|
|
@@ -683,7 +269,7 @@ const NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSid
|
|
|
683
269
|
} : {},
|
|
684
270
|
sx: { py: 0, px: 1, overflowX: "hidden" },
|
|
685
271
|
children: [
|
|
686
|
-
shouldJustExpand ? /* @__PURE__ */ jsx(StyledNavButton, { ...buttonProps, onClick: () => onClick?.(item), children: buttonContent }) : /* @__PURE__ */ jsx(
|
|
272
|
+
shouldJustExpand ? /* @__PURE__ */ jsxRuntimeExports.jsx(StyledNavButton, { ...buttonProps, onClick: () => onClick?.(item), children: buttonContent }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
687
273
|
StyledRouterButton,
|
|
688
274
|
{
|
|
689
275
|
...buttonProps,
|
|
@@ -695,13 +281,13 @@ const NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSid
|
|
|
695
281
|
children: buttonContent
|
|
696
282
|
}
|
|
697
283
|
),
|
|
698
|
-
item.children && collapsed ? /* @__PURE__ */ jsx(MiniPopover, { open: item.title === hoveredPopoverItem, anchorEl: anchorElement, children: renderNested?.(item.children) }) : null
|
|
284
|
+
item.children && collapsed ? /* @__PURE__ */ jsxRuntimeExports.jsx(MiniPopover, { open: item.title === hoveredPopoverItem, anchorEl: anchorElement, children: renderNested?.(item.children) }) : null
|
|
699
285
|
]
|
|
700
286
|
}
|
|
701
287
|
);
|
|
702
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
288
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Fragment, { children: [
|
|
703
289
|
listItem,
|
|
704
|
-
item.children && !collapsed ? /* @__PURE__ */ jsx(Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: renderNested?.(item.children) }) : null
|
|
290
|
+
item.children && !collapsed ? /* @__PURE__ */ jsxRuntimeExports.jsx(Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: renderNested?.(item.children) }) : null
|
|
705
291
|
] }, item.to);
|
|
706
292
|
};
|
|
707
293
|
const isPageItem = (item) => !("kind" in item);
|
|
@@ -713,7 +299,7 @@ const NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSide
|
|
|
713
299
|
if (collapsed) setOpenKeys([]);
|
|
714
300
|
}, [collapsed]);
|
|
715
301
|
const toggleKey = (key) => setOpenKeys((previous) => previous.includes(key) ? previous.filter((k) => k !== key) : [...previous, key]);
|
|
716
|
-
const renderNested = (children) => /* @__PURE__ */ jsx(
|
|
302
|
+
const renderNested = (children) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
717
303
|
NavigationList,
|
|
718
304
|
{
|
|
719
305
|
subNavigation: children,
|
|
@@ -726,7 +312,7 @@ const NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSide
|
|
|
726
312
|
}
|
|
727
313
|
);
|
|
728
314
|
const filteredNavigation = subNavigation.filter((nav) => !nav.hidden);
|
|
729
|
-
return /* @__PURE__ */ jsx(
|
|
315
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
730
316
|
List,
|
|
731
317
|
{
|
|
732
318
|
sx: {
|
|
@@ -739,7 +325,7 @@ const NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSide
|
|
|
739
325
|
},
|
|
740
326
|
children: filteredNavigation.map((navItem, index) => {
|
|
741
327
|
if (isHeader(navItem)) {
|
|
742
|
-
return /* @__PURE__ */ jsx(
|
|
328
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
743
329
|
ListSubheader,
|
|
744
330
|
{
|
|
745
331
|
sx: {
|
|
@@ -762,13 +348,13 @@ const NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSide
|
|
|
762
348
|
}
|
|
763
349
|
if (isDivider(navItem)) {
|
|
764
350
|
const nextItem = filteredNavigation[index + 1];
|
|
765
|
-
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Divider, { sx: { mx: 1, mt: 1, mb: isHeader(nextItem) && !collapsed ? 0 : 1 } }) }, `divider-${depth}-${index}`);
|
|
351
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { sx: { mx: 1, mt: 1, mb: isHeader(nextItem) && !collapsed ? 0 : 1 } }) }, `divider-${depth}-${index}`);
|
|
766
352
|
}
|
|
767
353
|
if (!isPageItem(navItem)) return null;
|
|
768
354
|
const key = `item-${depth}-${index}`;
|
|
769
355
|
const uniqueItemKey = `${depth}-${index}-${navItem.title}`;
|
|
770
|
-
if (renderItem) return /* @__PURE__ */ jsx(Fragment
|
|
771
|
-
return /* @__PURE__ */ jsx(
|
|
356
|
+
if (renderItem) return /* @__PURE__ */ jsxRuntimeExports.jsx(Fragment, { children: renderItem(navItem, { collapsed: !!collapsed }) }, key);
|
|
357
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
772
358
|
NavigationListItem,
|
|
773
359
|
{
|
|
774
360
|
item: navItem,
|
|
@@ -795,7 +381,7 @@ const NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
795
381
|
const routerState = useRouterState();
|
|
796
382
|
const theme = useTheme();
|
|
797
383
|
const showPermanent = useMediaQuery(theme.breakpoints.up("sm"));
|
|
798
|
-
const drawerContent = (collapsed) => /* @__PURE__ */ jsx(
|
|
384
|
+
const drawerContent = (collapsed) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
799
385
|
Box,
|
|
800
386
|
{
|
|
801
387
|
component: "nav",
|
|
@@ -809,7 +395,7 @@ const NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
809
395
|
overflowX: "hidden",
|
|
810
396
|
pt: navigation[0] && isHeader(navigation[0]) && !collapsed ? 0 : 2
|
|
811
397
|
},
|
|
812
|
-
children: /* @__PURE__ */ jsx(
|
|
398
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
813
399
|
NavigationList,
|
|
814
400
|
{
|
|
815
401
|
subNavigation: navigation,
|
|
@@ -825,7 +411,7 @@ const NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
825
411
|
}
|
|
826
412
|
);
|
|
827
413
|
if (showPermanent)
|
|
828
|
-
return /* @__PURE__ */ jsx(
|
|
414
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
829
415
|
Drawer,
|
|
830
416
|
{
|
|
831
417
|
variant: "permanent",
|
|
@@ -843,7 +429,7 @@ const NavigationRail = ({ navigation, expanded, setExpanded }) => {
|
|
|
843
429
|
children: drawerContent(!expanded)
|
|
844
430
|
}
|
|
845
431
|
);
|
|
846
|
-
return /* @__PURE__ */ jsx(Drawer, { open: expanded, onClose: () => setExpanded(false), children: drawerContent(!expanded) });
|
|
432
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Drawer, { open: expanded, onClose: () => setExpanded(false), children: drawerContent(!expanded) });
|
|
847
433
|
};
|
|
848
434
|
const capitalize = (value) => value && value.charAt(0).toUpperCase() + value.slice(1);
|
|
849
435
|
const ToolbarAccount = () => {
|
|
@@ -876,23 +462,23 @@ const ToolbarAccount = () => {
|
|
|
876
462
|
setTimeout(() => setTab("settings"), 300);
|
|
877
463
|
};
|
|
878
464
|
const changeTab = (newTab) => () => setTab(newTab);
|
|
879
|
-
const settings = /* @__PURE__ */ jsxs(List$1, { component: "nav", subheader: /* @__PURE__ */ jsx(ListSubheader$1, { sx: { backgroundColor: "transparent" }, children: t("Layout.Settings") }), children: [
|
|
880
|
-
/* @__PURE__ */ jsxs(ListItemButton$1, { onClick: changeTab("theme"), sx: { py: 0.3 }, children: [
|
|
881
|
-
/* @__PURE__ */ jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsx(Brightness4, {}) }),
|
|
882
|
-
/* @__PURE__ */ jsx(ListItemText$1, { primary: t("Layout.Appearance"), secondary: colorModes.find((m) => m.mode === mode)?.label }),
|
|
883
|
-
/* @__PURE__ */ jsx(ChevronRight, {})
|
|
465
|
+
const settings = /* @__PURE__ */ jsxRuntimeExports.jsxs(List$1, { component: "nav", subheader: /* @__PURE__ */ jsxRuntimeExports.jsx(ListSubheader$1, { sx: { backgroundColor: "transparent" }, children: t("Layout.Settings") }), children: [
|
|
466
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(ListItemButton$1, { onClick: changeTab("theme"), sx: { py: 0.3 }, children: [
|
|
467
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Brightness4, {}) }),
|
|
468
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemText$1, { primary: t("Layout.Appearance"), secondary: colorModes.find((m) => m.mode === mode)?.label }),
|
|
469
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, {})
|
|
884
470
|
] }),
|
|
885
|
-
/* @__PURE__ */ jsxs(ListItemButton$1, { onClick: changeTab("language"), sx: { py: 0.3 }, children: [
|
|
886
|
-
/* @__PURE__ */ jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsx(Translate, {}) }),
|
|
887
|
-
/* @__PURE__ */ jsx(ListItemText$1, { primary: t("Layout.Language"), secondary: capitalize(languageDisplayNames.of(i18n2.language)) }),
|
|
888
|
-
/* @__PURE__ */ jsx(ChevronRight, {})
|
|
471
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(ListItemButton$1, { onClick: changeTab("language"), sx: { py: 0.3 }, children: [
|
|
472
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Translate, {}) }),
|
|
473
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemText$1, { primary: t("Layout.Language"), secondary: capitalize(languageDisplayNames.of(i18n2.language)) }),
|
|
474
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, {})
|
|
889
475
|
] })
|
|
890
476
|
] });
|
|
891
|
-
const theme = /* @__PURE__ */ jsx(List$1, { subheader: /* @__PURE__ */ jsxs(ListSubheader$1, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
892
|
-
/* @__PURE__ */ jsx(IconButton, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx(ArrowBack, { fontSize: "small" }) }),
|
|
477
|
+
const theme = /* @__PURE__ */ jsxRuntimeExports.jsx(List$1, { subheader: /* @__PURE__ */ jsxRuntimeExports.jsxs(ListSubheader$1, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
478
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IconButton, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowBack, { fontSize: "small" }) }),
|
|
893
479
|
" ",
|
|
894
480
|
t("Layout.Appearance")
|
|
895
|
-
] }), children: colorModes.map(({ mode: modeValue, icon: Icon, label }) => /* @__PURE__ */ jsxs(
|
|
481
|
+
] }), children: colorModes.map(({ mode: modeValue, icon: Icon, label }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
896
482
|
ListItemButton$1,
|
|
897
483
|
{
|
|
898
484
|
onClick: () => {
|
|
@@ -901,40 +487,40 @@ const ToolbarAccount = () => {
|
|
|
901
487
|
},
|
|
902
488
|
selected: mode === modeValue,
|
|
903
489
|
children: [
|
|
904
|
-
/* @__PURE__ */ jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsx(Icon, {}) }),
|
|
905
|
-
/* @__PURE__ */ jsx(ListItemText$1, { primary: label })
|
|
490
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, {}) }),
|
|
491
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemText$1, { primary: label })
|
|
906
492
|
]
|
|
907
493
|
},
|
|
908
494
|
modeValue
|
|
909
495
|
)) });
|
|
910
|
-
const language = /* @__PURE__ */ jsx(List$1, { subheader: /* @__PURE__ */ jsxs(ListSubheader$1, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
911
|
-
/* @__PURE__ */ jsx(IconButton, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsx(ArrowBack, { fontSize: "small" }) }),
|
|
496
|
+
const language = /* @__PURE__ */ jsxRuntimeExports.jsx(List$1, { subheader: /* @__PURE__ */ jsxRuntimeExports.jsxs(ListSubheader$1, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
|
|
497
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IconButton, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowBack, { fontSize: "small" }) }),
|
|
912
498
|
" ",
|
|
913
499
|
t("Layout.Language")
|
|
914
500
|
] }), children: supportedLanguages.map(
|
|
915
|
-
(languageCode) => /* @__PURE__ */ jsxs(
|
|
501
|
+
(languageCode) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
916
502
|
ListItemButton$1,
|
|
917
503
|
{
|
|
918
504
|
onClick: () => i18n2.changeLanguage(languageCode).finally(() => closeMenu()),
|
|
919
505
|
selected: i18n2.resolvedLanguage === languageCode,
|
|
920
506
|
children: [
|
|
921
|
-
/* @__PURE__ */ jsx(ListItemIcon$1, { children: i18n2.resolvedLanguage === languageCode && /* @__PURE__ */ jsx(Done, {}) }),
|
|
922
|
-
/* @__PURE__ */ jsx(ListItemText$1, { primary: capitalize(languageDisplayNames.of(languageCode)) })
|
|
507
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemIcon$1, { children: i18n2.resolvedLanguage === languageCode && /* @__PURE__ */ jsxRuntimeExports.jsx(Done, {}) }),
|
|
508
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemText$1, { primary: capitalize(languageDisplayNames.of(languageCode)) })
|
|
923
509
|
]
|
|
924
510
|
},
|
|
925
511
|
languageCode
|
|
926
512
|
)
|
|
927
513
|
) });
|
|
928
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
929
|
-
/* @__PURE__ */ jsx(IconButton, { size: "small", edge: "end", onClick: openMenu, children: /* @__PURE__ */ jsx(Avatar$1, { sx: { width: { xs: 32, sm: 40 }, height: { xs: 32, sm: 40 }, bgcolor: "primary.main" }, children: /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", sx: { fontWeight: "bold", lineHeight: 0 }, children: usernameInitials() }) }) }),
|
|
930
|
-
/* @__PURE__ */ jsx(Menu, { anchorEl: anchorElement, open, onClose: closeMenu, children: /* @__PURE__ */ jsxs(Box$1, { sx: { width: 240 }, children: [
|
|
931
|
-
/* @__PURE__ */ jsx(List$1, { children: session ? /* @__PURE__ */ jsxs(Fragment
|
|
932
|
-
/* @__PURE__ */ jsx(ListItem$1, { children: /* @__PURE__ */ jsx(ListItemText$1, { primary: user.name, secondary: /* @__PURE__ */ jsxs("span", { children: [
|
|
933
|
-
/* @__PURE__ */ jsx("span", { children: user.employeeId }),
|
|
934
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
935
|
-
/* @__PURE__ */ jsx("span", { children: user.department })
|
|
514
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Fragment, { children: [
|
|
515
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IconButton, { size: "small", edge: "end", onClick: openMenu, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Avatar$1, { sx: { width: { xs: 32, sm: 40 }, height: { xs: 32, sm: 40 }, bgcolor: "primary.main" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "subtitle2", sx: { fontWeight: "bold", lineHeight: 0 }, children: usernameInitials() }) }) }),
|
|
516
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Menu, { anchorEl: anchorElement, open, onClose: closeMenu, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box$1, { sx: { width: 240 }, children: [
|
|
517
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(List$1, { children: session ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Fragment, { children: [
|
|
518
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItem$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ListItemText$1, { primary: user.name, secondary: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
519
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: user.employeeId }),
|
|
520
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
|
|
521
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: user.department })
|
|
936
522
|
] }) }) }),
|
|
937
|
-
/* @__PURE__ */ jsxs(
|
|
523
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
938
524
|
ListItemButton$1,
|
|
939
525
|
{
|
|
940
526
|
onClick: () => authClient.signOut({}, {
|
|
@@ -942,12 +528,12 @@ const ToolbarAccount = () => {
|
|
|
942
528
|
onError: ({ error }) => alert(error.message)
|
|
943
529
|
}),
|
|
944
530
|
children: [
|
|
945
|
-
/* @__PURE__ */ jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsx(Logout, { color: "error" }) }),
|
|
946
|
-
/* @__PURE__ */ jsx(ListItemText$1, { primary: t("Layout.Logout") })
|
|
531
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Logout, { color: "error" }) }),
|
|
532
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemText$1, { primary: t("Layout.Logout") })
|
|
947
533
|
]
|
|
948
534
|
}
|
|
949
535
|
)
|
|
950
|
-
] }) : /* @__PURE__ */ jsxs(
|
|
536
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
951
537
|
ListItemButton$1,
|
|
952
538
|
{
|
|
953
539
|
onClick: () => authClient.signIn.social({ provider: "microsoft" }, {
|
|
@@ -955,8 +541,8 @@ const ToolbarAccount = () => {
|
|
|
955
541
|
onError: ({ error }) => alert(error.message)
|
|
956
542
|
}),
|
|
957
543
|
children: [
|
|
958
|
-
/* @__PURE__ */ jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsx(Login, { color: "success" }) }),
|
|
959
|
-
/* @__PURE__ */ jsx(ListItemText$1, { primary: t("Layout.LogIn") })
|
|
544
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemIcon$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Login, { color: "success" }) }),
|
|
545
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListItemText$1, { primary: t("Layout.LogIn") })
|
|
960
546
|
]
|
|
961
547
|
}
|
|
962
548
|
) }),
|
|
@@ -968,11 +554,11 @@ const ToolbarAccount = () => {
|
|
|
968
554
|
};
|
|
969
555
|
const YEAR_IN_SECONDS = 60 * 60 * 24 * 365;
|
|
970
556
|
const getNavigationOpenStatus = createIsomorphicFn().server(() => {
|
|
971
|
-
const
|
|
972
|
-
return
|
|
557
|
+
const cookie = getCookie("navigationOpen");
|
|
558
|
+
return cookie === "true";
|
|
973
559
|
}).client(() => {
|
|
974
|
-
const
|
|
975
|
-
return
|
|
560
|
+
const cookie = document.cookie.split("; ").find((row) => row.startsWith("navigationOpen="));
|
|
561
|
+
return cookie ? cookie.split("=")[1] === "true" : false;
|
|
976
562
|
});
|
|
977
563
|
const DrawerHeader = styled("div")(({ theme }) => ({
|
|
978
564
|
display: "flex",
|
|
@@ -985,11 +571,11 @@ const Layout = (props) => {
|
|
|
985
571
|
const [navigationOpen, setNavigationOpen] = useState(getNavigationOpenStatus);
|
|
986
572
|
const isFetching = !!useIsFetching();
|
|
987
573
|
const isMutating = !!useIsMutating();
|
|
988
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
989
|
-
/* @__PURE__ */ jsx(InitColorSchemeScript, {}),
|
|
990
|
-
/* @__PURE__ */ jsx(CssBaseline, {}),
|
|
991
|
-
/* @__PURE__ */ jsxs(Box$1, { sx: { display: "flex", height: "100dvh", maxHeight: "100dvh", overflow: "hidden", width: "100%" }, children: [
|
|
992
|
-
/* @__PURE__ */ jsx(
|
|
574
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Fragment, { children: [
|
|
575
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(InitColorSchemeScript, {}),
|
|
576
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CssBaseline, {}),
|
|
577
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Box$1, { sx: { display: "flex", height: "100dvh", maxHeight: "100dvh", overflow: "hidden", width: "100%" }, children: [
|
|
578
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
993
579
|
AppBar,
|
|
994
580
|
{
|
|
995
581
|
color: "transparent",
|
|
@@ -999,8 +585,8 @@ const Layout = (props) => {
|
|
|
999
585
|
borderColor: theme.vars?.palette.divider,
|
|
1000
586
|
boxShadow: "none"
|
|
1001
587
|
}),
|
|
1002
|
-
children: /* @__PURE__ */ jsxs(Toolbar, { children: [
|
|
1003
|
-
props.navigation && /* @__PURE__ */ jsx(
|
|
588
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Toolbar, { children: [
|
|
589
|
+
props.navigation && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1004
590
|
IconButton,
|
|
1005
591
|
{
|
|
1006
592
|
onClick: () => {
|
|
@@ -1011,15 +597,15 @@ const Layout = (props) => {
|
|
|
1011
597
|
});
|
|
1012
598
|
},
|
|
1013
599
|
sx: { marginRight: 2 },
|
|
1014
|
-
children: navigationOpen ? /* @__PURE__ */ jsx(MenuOpen, {}) : /* @__PURE__ */ jsx(Menu$1, {})
|
|
600
|
+
children: navigationOpen ? /* @__PURE__ */ jsxRuntimeExports.jsx(MenuOpen, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(Menu$1, {})
|
|
1015
601
|
}
|
|
1016
602
|
),
|
|
1017
|
-
/* @__PURE__ */ jsx(AppTitle, {}),
|
|
1018
|
-
/* @__PURE__ */ jsx(ToolbarAccount, {})
|
|
603
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AppTitle, {}),
|
|
604
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ToolbarAccount, {})
|
|
1019
605
|
] })
|
|
1020
606
|
}
|
|
1021
607
|
),
|
|
1022
|
-
props.navigation && /* @__PURE__ */ jsx(
|
|
608
|
+
props.navigation && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1023
609
|
NavigationRail,
|
|
1024
610
|
{
|
|
1025
611
|
navigation: props.navigation,
|
|
@@ -1030,16 +616,16 @@ const Layout = (props) => {
|
|
|
1030
616
|
}
|
|
1031
617
|
}
|
|
1032
618
|
),
|
|
1033
|
-
/* @__PURE__ */ jsxs(Box$1, { component: "main", sx: { flexGrow: 1, display: "flex", flexDirection: "column", minWidth: 0, height: "100%", overflow: "hidden" }, children: [
|
|
1034
|
-
/* @__PURE__ */ jsx(DrawerHeader, {}),
|
|
1035
|
-
/* @__PURE__ */ jsx(Box$1, { sx: { flex: 1, overflow: "auto", position: "relative" }, children: props.children })
|
|
619
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Box$1, { component: "main", sx: { flexGrow: 1, display: "flex", flexDirection: "column", minWidth: 0, height: "100%", overflow: "hidden" }, children: [
|
|
620
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(DrawerHeader, {}),
|
|
621
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Box$1, { sx: { flex: 1, overflow: "auto", position: "relative" }, children: props.children })
|
|
1036
622
|
] })
|
|
1037
623
|
] }),
|
|
1038
|
-
(isFetching || isMutating) && /* @__PURE__ */ jsx(LinearProgress, { sx: { position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 } })
|
|
624
|
+
(isFetching || isMutating) && /* @__PURE__ */ jsxRuntimeExports.jsx(LinearProgress, { sx: { position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 } })
|
|
1039
625
|
] });
|
|
1040
626
|
};
|
|
1041
627
|
const YEAR_IN_MINUTES = 60 * 24 * 365;
|
|
1042
|
-
i18n.use(
|
|
628
|
+
i18n.use(LanguageDetector).use(initReactI18next).init({
|
|
1043
629
|
resources,
|
|
1044
630
|
fallbackLng: "en",
|
|
1045
631
|
supportedLngs: Object.keys(resources),
|
|
@@ -1062,7 +648,7 @@ const LayoutProvider = ({ navigation, theme, children }) => {
|
|
|
1062
648
|
i18n.off("languageChanged", languageChangedHandler);
|
|
1063
649
|
};
|
|
1064
650
|
}, []);
|
|
1065
|
-
return /* @__PURE__ */ jsx(ThemeProvider, { theme: createdTheme, children: /* @__PURE__ */ jsx(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: i18n.language, children: /* @__PURE__ */ jsx(DialogsProvider, { children: /* @__PURE__ */ jsx(Layout, { navigation, children }) }) }, i18n.language) });
|
|
651
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { theme: createdTheme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: i18n.language, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DialogsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Layout, { navigation, children }) }) }, i18n.language) });
|
|
1066
652
|
};
|
|
1067
653
|
const setSSRLanguage = createServerFn().handler(async () => {
|
|
1068
654
|
const language = getCookie(i18n.services.languageDetector.options.lookupCookie) || "en";
|