wcz-test 4.5.4 → 4.5.6

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/index.cjs DELETED
@@ -1,4379 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
- var __export = (target, all) => {
12
- for (var name in all)
13
- __defProp(target, name, { get: all[name], enumerable: true });
14
- };
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
- mod
30
- ));
31
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
-
33
- // node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
34
- var require_react_is_production_min = __commonJS({
35
- "node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js"(exports2) {
36
- "use strict";
37
- var b = "function" === typeof Symbol && Symbol.for;
38
- var c = b ? Symbol.for("react.element") : 60103;
39
- var d = b ? Symbol.for("react.portal") : 60106;
40
- var e = b ? Symbol.for("react.fragment") : 60107;
41
- var f = b ? Symbol.for("react.strict_mode") : 60108;
42
- var g = b ? Symbol.for("react.profiler") : 60114;
43
- var h = b ? Symbol.for("react.provider") : 60109;
44
- var k = b ? Symbol.for("react.context") : 60110;
45
- var l = b ? Symbol.for("react.async_mode") : 60111;
46
- var m = b ? Symbol.for("react.concurrent_mode") : 60111;
47
- var n = b ? Symbol.for("react.forward_ref") : 60112;
48
- var p = b ? Symbol.for("react.suspense") : 60113;
49
- var q = b ? Symbol.for("react.suspense_list") : 60120;
50
- var r = b ? Symbol.for("react.memo") : 60115;
51
- var t2 = b ? Symbol.for("react.lazy") : 60116;
52
- var v = b ? Symbol.for("react.block") : 60121;
53
- var w = b ? Symbol.for("react.fundamental") : 60117;
54
- var x = b ? Symbol.for("react.responder") : 60118;
55
- var y = b ? Symbol.for("react.scope") : 60119;
56
- function z2(a) {
57
- if ("object" === typeof a && null !== a) {
58
- var u = a.$$typeof;
59
- switch (u) {
60
- case c:
61
- switch (a = a.type, a) {
62
- case l:
63
- case m:
64
- case e:
65
- case g:
66
- case f:
67
- case p:
68
- return a;
69
- default:
70
- switch (a = a && a.$$typeof, a) {
71
- case k:
72
- case n:
73
- case t2:
74
- case r:
75
- case h:
76
- return a;
77
- default:
78
- return u;
79
- }
80
- }
81
- case d:
82
- return u;
83
- }
84
- }
85
- }
86
- function A(a) {
87
- return z2(a) === m;
88
- }
89
- exports2.AsyncMode = l;
90
- exports2.ConcurrentMode = m;
91
- exports2.ContextConsumer = k;
92
- exports2.ContextProvider = h;
93
- exports2.Element = c;
94
- exports2.ForwardRef = n;
95
- exports2.Fragment = e;
96
- exports2.Lazy = t2;
97
- exports2.Memo = r;
98
- exports2.Portal = d;
99
- exports2.Profiler = g;
100
- exports2.StrictMode = f;
101
- exports2.Suspense = p;
102
- exports2.isAsyncMode = function(a) {
103
- return A(a) || z2(a) === l;
104
- };
105
- exports2.isConcurrentMode = A;
106
- exports2.isContextConsumer = function(a) {
107
- return z2(a) === k;
108
- };
109
- exports2.isContextProvider = function(a) {
110
- return z2(a) === h;
111
- };
112
- exports2.isElement = function(a) {
113
- return "object" === typeof a && null !== a && a.$$typeof === c;
114
- };
115
- exports2.isForwardRef = function(a) {
116
- return z2(a) === n;
117
- };
118
- exports2.isFragment = function(a) {
119
- return z2(a) === e;
120
- };
121
- exports2.isLazy = function(a) {
122
- return z2(a) === t2;
123
- };
124
- exports2.isMemo = function(a) {
125
- return z2(a) === r;
126
- };
127
- exports2.isPortal = function(a) {
128
- return z2(a) === d;
129
- };
130
- exports2.isProfiler = function(a) {
131
- return z2(a) === g;
132
- };
133
- exports2.isStrictMode = function(a) {
134
- return z2(a) === f;
135
- };
136
- exports2.isSuspense = function(a) {
137
- return z2(a) === p;
138
- };
139
- exports2.isValidElementType = function(a) {
140
- return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t2 || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
141
- };
142
- exports2.typeOf = z2;
143
- }
144
- });
145
-
146
- // node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
147
- var require_react_is_development = __commonJS({
148
- "node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports2) {
149
- "use strict";
150
- if (process.env.NODE_ENV !== "production") {
151
- (function() {
152
- "use strict";
153
- var hasSymbol = typeof Symbol === "function" && Symbol.for;
154
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
155
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
156
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
157
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
158
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
159
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
160
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
161
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
162
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
163
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
164
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
165
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
166
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
167
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
168
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
169
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
170
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
171
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
172
- function isValidElementType(type) {
173
- return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
174
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
175
- }
176
- function typeOf(object) {
177
- if (typeof object === "object" && object !== null) {
178
- var $$typeof = object.$$typeof;
179
- switch ($$typeof) {
180
- case REACT_ELEMENT_TYPE:
181
- var type = object.type;
182
- switch (type) {
183
- case REACT_ASYNC_MODE_TYPE:
184
- case REACT_CONCURRENT_MODE_TYPE:
185
- case REACT_FRAGMENT_TYPE:
186
- case REACT_PROFILER_TYPE:
187
- case REACT_STRICT_MODE_TYPE:
188
- case REACT_SUSPENSE_TYPE:
189
- return type;
190
- default:
191
- var $$typeofType = type && type.$$typeof;
192
- switch ($$typeofType) {
193
- case REACT_CONTEXT_TYPE:
194
- case REACT_FORWARD_REF_TYPE:
195
- case REACT_LAZY_TYPE:
196
- case REACT_MEMO_TYPE:
197
- case REACT_PROVIDER_TYPE:
198
- return $$typeofType;
199
- default:
200
- return $$typeof;
201
- }
202
- }
203
- case REACT_PORTAL_TYPE:
204
- return $$typeof;
205
- }
206
- }
207
- return void 0;
208
- }
209
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
210
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
211
- var ContextConsumer = REACT_CONTEXT_TYPE;
212
- var ContextProvider = REACT_PROVIDER_TYPE;
213
- var Element = REACT_ELEMENT_TYPE;
214
- var ForwardRef = REACT_FORWARD_REF_TYPE;
215
- var Fragment7 = REACT_FRAGMENT_TYPE;
216
- var Lazy = REACT_LAZY_TYPE;
217
- var Memo = REACT_MEMO_TYPE;
218
- var Portal = REACT_PORTAL_TYPE;
219
- var Profiler = REACT_PROFILER_TYPE;
220
- var StrictMode = REACT_STRICT_MODE_TYPE;
221
- var Suspense = REACT_SUSPENSE_TYPE;
222
- var hasWarnedAboutDeprecatedIsAsyncMode = false;
223
- function isAsyncMode(object) {
224
- {
225
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
226
- hasWarnedAboutDeprecatedIsAsyncMode = true;
227
- console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
228
- }
229
- }
230
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
231
- }
232
- function isConcurrentMode(object) {
233
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
234
- }
235
- function isContextConsumer(object) {
236
- return typeOf(object) === REACT_CONTEXT_TYPE;
237
- }
238
- function isContextProvider(object) {
239
- return typeOf(object) === REACT_PROVIDER_TYPE;
240
- }
241
- function isElement(object) {
242
- return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
243
- }
244
- function isForwardRef(object) {
245
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
246
- }
247
- function isFragment(object) {
248
- return typeOf(object) === REACT_FRAGMENT_TYPE;
249
- }
250
- function isLazy(object) {
251
- return typeOf(object) === REACT_LAZY_TYPE;
252
- }
253
- function isMemo(object) {
254
- return typeOf(object) === REACT_MEMO_TYPE;
255
- }
256
- function isPortal(object) {
257
- return typeOf(object) === REACT_PORTAL_TYPE;
258
- }
259
- function isProfiler(object) {
260
- return typeOf(object) === REACT_PROFILER_TYPE;
261
- }
262
- function isStrictMode(object) {
263
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
264
- }
265
- function isSuspense(object) {
266
- return typeOf(object) === REACT_SUSPENSE_TYPE;
267
- }
268
- exports2.AsyncMode = AsyncMode;
269
- exports2.ConcurrentMode = ConcurrentMode;
270
- exports2.ContextConsumer = ContextConsumer;
271
- exports2.ContextProvider = ContextProvider;
272
- exports2.Element = Element;
273
- exports2.ForwardRef = ForwardRef;
274
- exports2.Fragment = Fragment7;
275
- exports2.Lazy = Lazy;
276
- exports2.Memo = Memo;
277
- exports2.Portal = Portal;
278
- exports2.Profiler = Profiler;
279
- exports2.StrictMode = StrictMode;
280
- exports2.Suspense = Suspense;
281
- exports2.isAsyncMode = isAsyncMode;
282
- exports2.isConcurrentMode = isConcurrentMode;
283
- exports2.isContextConsumer = isContextConsumer;
284
- exports2.isContextProvider = isContextProvider;
285
- exports2.isElement = isElement;
286
- exports2.isForwardRef = isForwardRef;
287
- exports2.isFragment = isFragment;
288
- exports2.isLazy = isLazy;
289
- exports2.isMemo = isMemo;
290
- exports2.isPortal = isPortal;
291
- exports2.isProfiler = isProfiler;
292
- exports2.isStrictMode = isStrictMode;
293
- exports2.isSuspense = isSuspense;
294
- exports2.isValidElementType = isValidElementType;
295
- exports2.typeOf = typeOf;
296
- })();
297
- }
298
- }
299
- });
300
-
301
- // node_modules/prop-types/node_modules/react-is/index.js
302
- var require_react_is = __commonJS({
303
- "node_modules/prop-types/node_modules/react-is/index.js"(exports2, module2) {
304
- "use strict";
305
- if (process.env.NODE_ENV === "production") {
306
- module2.exports = require_react_is_production_min();
307
- } else {
308
- module2.exports = require_react_is_development();
309
- }
310
- }
311
- });
312
-
313
- // node_modules/object-assign/index.js
314
- var require_object_assign = __commonJS({
315
- "node_modules/object-assign/index.js"(exports2, module2) {
316
- "use strict";
317
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
318
- var hasOwnProperty = Object.prototype.hasOwnProperty;
319
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
320
- function toObject(val) {
321
- if (val === null || val === void 0) {
322
- throw new TypeError("Object.assign cannot be called with null or undefined");
323
- }
324
- return Object(val);
325
- }
326
- function shouldUseNative() {
327
- try {
328
- if (!Object.assign) {
329
- return false;
330
- }
331
- var test1 = new String("abc");
332
- test1[5] = "de";
333
- if (Object.getOwnPropertyNames(test1)[0] === "5") {
334
- return false;
335
- }
336
- var test2 = {};
337
- for (var i = 0; i < 10; i++) {
338
- test2["_" + String.fromCharCode(i)] = i;
339
- }
340
- var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
341
- return test2[n];
342
- });
343
- if (order2.join("") !== "0123456789") {
344
- return false;
345
- }
346
- var test3 = {};
347
- "abcdefghijklmnopqrst".split("").forEach(function(letter) {
348
- test3[letter] = letter;
349
- });
350
- if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
351
- return false;
352
- }
353
- return true;
354
- } catch (err) {
355
- return false;
356
- }
357
- }
358
- module2.exports = shouldUseNative() ? Object.assign : function(target, source) {
359
- var from;
360
- var to = toObject(target);
361
- var symbols;
362
- for (var s = 1; s < arguments.length; s++) {
363
- from = Object(arguments[s]);
364
- for (var key in from) {
365
- if (hasOwnProperty.call(from, key)) {
366
- to[key] = from[key];
367
- }
368
- }
369
- if (getOwnPropertySymbols) {
370
- symbols = getOwnPropertySymbols(from);
371
- for (var i = 0; i < symbols.length; i++) {
372
- if (propIsEnumerable.call(from, symbols[i])) {
373
- to[symbols[i]] = from[symbols[i]];
374
- }
375
- }
376
- }
377
- }
378
- return to;
379
- };
380
- }
381
- });
382
-
383
- // node_modules/prop-types/lib/ReactPropTypesSecret.js
384
- var require_ReactPropTypesSecret = __commonJS({
385
- "node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports2, module2) {
386
- "use strict";
387
- var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
388
- module2.exports = ReactPropTypesSecret;
389
- }
390
- });
391
-
392
- // node_modules/prop-types/lib/has.js
393
- var require_has = __commonJS({
394
- "node_modules/prop-types/lib/has.js"(exports2, module2) {
395
- "use strict";
396
- module2.exports = Function.call.bind(Object.prototype.hasOwnProperty);
397
- }
398
- });
399
-
400
- // node_modules/prop-types/checkPropTypes.js
401
- var require_checkPropTypes = __commonJS({
402
- "node_modules/prop-types/checkPropTypes.js"(exports2, module2) {
403
- "use strict";
404
- var printWarning = function() {
405
- };
406
- if (process.env.NODE_ENV !== "production") {
407
- ReactPropTypesSecret = require_ReactPropTypesSecret();
408
- loggedTypeFailures = {};
409
- has = require_has();
410
- printWarning = function(text) {
411
- var message = "Warning: " + text;
412
- if (typeof console !== "undefined") {
413
- console.error(message);
414
- }
415
- try {
416
- throw new Error(message);
417
- } catch (x) {
418
- }
419
- };
420
- }
421
- var ReactPropTypesSecret;
422
- var loggedTypeFailures;
423
- var has;
424
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
425
- if (process.env.NODE_ENV !== "production") {
426
- for (var typeSpecName in typeSpecs) {
427
- if (has(typeSpecs, typeSpecName)) {
428
- var error;
429
- try {
430
- if (typeof typeSpecs[typeSpecName] !== "function") {
431
- var err = Error(
432
- (componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
433
- );
434
- err.name = "Invariant Violation";
435
- throw err;
436
- }
437
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
438
- } catch (ex) {
439
- error = ex;
440
- }
441
- if (error && !(error instanceof Error)) {
442
- printWarning(
443
- (componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
444
- );
445
- }
446
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
447
- loggedTypeFailures[error.message] = true;
448
- var stack = getStack ? getStack() : "";
449
- printWarning(
450
- "Failed " + location + " type: " + error.message + (stack != null ? stack : "")
451
- );
452
- }
453
- }
454
- }
455
- }
456
- }
457
- checkPropTypes.resetWarningCache = function() {
458
- if (process.env.NODE_ENV !== "production") {
459
- loggedTypeFailures = {};
460
- }
461
- };
462
- module2.exports = checkPropTypes;
463
- }
464
- });
465
-
466
- // node_modules/prop-types/factoryWithTypeCheckers.js
467
- var require_factoryWithTypeCheckers = __commonJS({
468
- "node_modules/prop-types/factoryWithTypeCheckers.js"(exports2, module2) {
469
- "use strict";
470
- var ReactIs = require_react_is();
471
- var assign = require_object_assign();
472
- var ReactPropTypesSecret = require_ReactPropTypesSecret();
473
- var has = require_has();
474
- var checkPropTypes = require_checkPropTypes();
475
- var printWarning = function() {
476
- };
477
- if (process.env.NODE_ENV !== "production") {
478
- printWarning = function(text) {
479
- var message = "Warning: " + text;
480
- if (typeof console !== "undefined") {
481
- console.error(message);
482
- }
483
- try {
484
- throw new Error(message);
485
- } catch (x) {
486
- }
487
- };
488
- }
489
- function emptyFunctionThatReturnsNull() {
490
- return null;
491
- }
492
- module2.exports = function(isValidElement, throwOnDirectAccess) {
493
- var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
494
- var FAUX_ITERATOR_SYMBOL = "@@iterator";
495
- function getIteratorFn(maybeIterable) {
496
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
497
- if (typeof iteratorFn === "function") {
498
- return iteratorFn;
499
- }
500
- }
501
- var ANONYMOUS = "<<anonymous>>";
502
- var ReactPropTypes = {
503
- array: createPrimitiveTypeChecker("array"),
504
- bigint: createPrimitiveTypeChecker("bigint"),
505
- bool: createPrimitiveTypeChecker("boolean"),
506
- func: createPrimitiveTypeChecker("function"),
507
- number: createPrimitiveTypeChecker("number"),
508
- object: createPrimitiveTypeChecker("object"),
509
- string: createPrimitiveTypeChecker("string"),
510
- symbol: createPrimitiveTypeChecker("symbol"),
511
- any: createAnyTypeChecker(),
512
- arrayOf: createArrayOfTypeChecker,
513
- element: createElementTypeChecker(),
514
- elementType: createElementTypeTypeChecker(),
515
- instanceOf: createInstanceTypeChecker,
516
- node: createNodeChecker(),
517
- objectOf: createObjectOfTypeChecker,
518
- oneOf: createEnumTypeChecker,
519
- oneOfType: createUnionTypeChecker,
520
- shape: createShapeTypeChecker,
521
- exact: createStrictShapeTypeChecker
522
- };
523
- function is(x, y) {
524
- if (x === y) {
525
- return x !== 0 || 1 / x === 1 / y;
526
- } else {
527
- return x !== x && y !== y;
528
- }
529
- }
530
- function PropTypeError(message, data) {
531
- this.message = message;
532
- this.data = data && typeof data === "object" ? data : {};
533
- this.stack = "";
534
- }
535
- PropTypeError.prototype = Error.prototype;
536
- function createChainableTypeChecker(validate) {
537
- if (process.env.NODE_ENV !== "production") {
538
- var manualPropTypeCallCache = {};
539
- var manualPropTypeWarningCount = 0;
540
- }
541
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
542
- componentName = componentName || ANONYMOUS;
543
- propFullName = propFullName || propName;
544
- if (secret !== ReactPropTypesSecret) {
545
- if (throwOnDirectAccess) {
546
- var err = new Error(
547
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
548
- );
549
- err.name = "Invariant Violation";
550
- throw err;
551
- } else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
552
- var cacheKey = componentName + ":" + propName;
553
- if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
554
- manualPropTypeWarningCount < 3) {
555
- printWarning(
556
- "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
557
- );
558
- manualPropTypeCallCache[cacheKey] = true;
559
- manualPropTypeWarningCount++;
560
- }
561
- }
562
- }
563
- if (props[propName] == null) {
564
- if (isRequired) {
565
- if (props[propName] === null) {
566
- return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
567
- }
568
- return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
569
- }
570
- return null;
571
- } else {
572
- return validate(props, propName, componentName, location, propFullName);
573
- }
574
- }
575
- var chainedCheckType = checkType.bind(null, false);
576
- chainedCheckType.isRequired = checkType.bind(null, true);
577
- return chainedCheckType;
578
- }
579
- function createPrimitiveTypeChecker(expectedType) {
580
- function validate(props, propName, componentName, location, propFullName, secret) {
581
- var propValue = props[propName];
582
- var propType = getPropType(propValue);
583
- if (propType !== expectedType) {
584
- var preciseType = getPreciseType(propValue);
585
- return new PropTypeError(
586
- "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
587
- { expectedType }
588
- );
589
- }
590
- return null;
591
- }
592
- return createChainableTypeChecker(validate);
593
- }
594
- function createAnyTypeChecker() {
595
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
596
- }
597
- function createArrayOfTypeChecker(typeChecker) {
598
- function validate(props, propName, componentName, location, propFullName) {
599
- if (typeof typeChecker !== "function") {
600
- return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
601
- }
602
- var propValue = props[propName];
603
- if (!Array.isArray(propValue)) {
604
- var propType = getPropType(propValue);
605
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
606
- }
607
- for (var i = 0; i < propValue.length; i++) {
608
- var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
609
- if (error instanceof Error) {
610
- return error;
611
- }
612
- }
613
- return null;
614
- }
615
- return createChainableTypeChecker(validate);
616
- }
617
- function createElementTypeChecker() {
618
- function validate(props, propName, componentName, location, propFullName) {
619
- var propValue = props[propName];
620
- if (!isValidElement(propValue)) {
621
- var propType = getPropType(propValue);
622
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
623
- }
624
- return null;
625
- }
626
- return createChainableTypeChecker(validate);
627
- }
628
- function createElementTypeTypeChecker() {
629
- function validate(props, propName, componentName, location, propFullName) {
630
- var propValue = props[propName];
631
- if (!ReactIs.isValidElementType(propValue)) {
632
- var propType = getPropType(propValue);
633
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
634
- }
635
- return null;
636
- }
637
- return createChainableTypeChecker(validate);
638
- }
639
- function createInstanceTypeChecker(expectedClass) {
640
- function validate(props, propName, componentName, location, propFullName) {
641
- if (!(props[propName] instanceof expectedClass)) {
642
- var expectedClassName = expectedClass.name || ANONYMOUS;
643
- var actualClassName = getClassName(props[propName]);
644
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
645
- }
646
- return null;
647
- }
648
- return createChainableTypeChecker(validate);
649
- }
650
- function createEnumTypeChecker(expectedValues) {
651
- if (!Array.isArray(expectedValues)) {
652
- if (process.env.NODE_ENV !== "production") {
653
- if (arguments.length > 1) {
654
- printWarning(
655
- "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
656
- );
657
- } else {
658
- printWarning("Invalid argument supplied to oneOf, expected an array.");
659
- }
660
- }
661
- return emptyFunctionThatReturnsNull;
662
- }
663
- function validate(props, propName, componentName, location, propFullName) {
664
- var propValue = props[propName];
665
- for (var i = 0; i < expectedValues.length; i++) {
666
- if (is(propValue, expectedValues[i])) {
667
- return null;
668
- }
669
- }
670
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
671
- var type = getPreciseType(value);
672
- if (type === "symbol") {
673
- return String(value);
674
- }
675
- return value;
676
- });
677
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
678
- }
679
- return createChainableTypeChecker(validate);
680
- }
681
- function createObjectOfTypeChecker(typeChecker) {
682
- function validate(props, propName, componentName, location, propFullName) {
683
- if (typeof typeChecker !== "function") {
684
- return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
685
- }
686
- var propValue = props[propName];
687
- var propType = getPropType(propValue);
688
- if (propType !== "object") {
689
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
690
- }
691
- for (var key in propValue) {
692
- if (has(propValue, key)) {
693
- var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
694
- if (error instanceof Error) {
695
- return error;
696
- }
697
- }
698
- }
699
- return null;
700
- }
701
- return createChainableTypeChecker(validate);
702
- }
703
- function createUnionTypeChecker(arrayOfTypeCheckers) {
704
- if (!Array.isArray(arrayOfTypeCheckers)) {
705
- process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
706
- return emptyFunctionThatReturnsNull;
707
- }
708
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
709
- var checker = arrayOfTypeCheckers[i];
710
- if (typeof checker !== "function") {
711
- printWarning(
712
- "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
713
- );
714
- return emptyFunctionThatReturnsNull;
715
- }
716
- }
717
- function validate(props, propName, componentName, location, propFullName) {
718
- var expectedTypes = [];
719
- for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
720
- var checker2 = arrayOfTypeCheckers[i2];
721
- var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
722
- if (checkerResult == null) {
723
- return null;
724
- }
725
- if (checkerResult.data && has(checkerResult.data, "expectedType")) {
726
- expectedTypes.push(checkerResult.data.expectedType);
727
- }
728
- }
729
- var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
730
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
731
- }
732
- return createChainableTypeChecker(validate);
733
- }
734
- function createNodeChecker() {
735
- function validate(props, propName, componentName, location, propFullName) {
736
- if (!isNode(props[propName])) {
737
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
738
- }
739
- return null;
740
- }
741
- return createChainableTypeChecker(validate);
742
- }
743
- function invalidValidatorError(componentName, location, propFullName, key, type) {
744
- return new PropTypeError(
745
- (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
746
- );
747
- }
748
- function createShapeTypeChecker(shapeTypes) {
749
- function validate(props, propName, componentName, location, propFullName) {
750
- var propValue = props[propName];
751
- var propType = getPropType(propValue);
752
- if (propType !== "object") {
753
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
754
- }
755
- for (var key in shapeTypes) {
756
- var checker = shapeTypes[key];
757
- if (typeof checker !== "function") {
758
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
759
- }
760
- var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
761
- if (error) {
762
- return error;
763
- }
764
- }
765
- return null;
766
- }
767
- return createChainableTypeChecker(validate);
768
- }
769
- function createStrictShapeTypeChecker(shapeTypes) {
770
- function validate(props, propName, componentName, location, propFullName) {
771
- var propValue = props[propName];
772
- var propType = getPropType(propValue);
773
- if (propType !== "object") {
774
- return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
775
- }
776
- var allKeys = assign({}, props[propName], shapeTypes);
777
- for (var key in allKeys) {
778
- var checker = shapeTypes[key];
779
- if (has(shapeTypes, key) && typeof checker !== "function") {
780
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
781
- }
782
- if (!checker) {
783
- return new PropTypeError(
784
- "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
785
- );
786
- }
787
- var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
788
- if (error) {
789
- return error;
790
- }
791
- }
792
- return null;
793
- }
794
- return createChainableTypeChecker(validate);
795
- }
796
- function isNode(propValue) {
797
- switch (typeof propValue) {
798
- case "number":
799
- case "string":
800
- case "undefined":
801
- return true;
802
- case "boolean":
803
- return !propValue;
804
- case "object":
805
- if (Array.isArray(propValue)) {
806
- return propValue.every(isNode);
807
- }
808
- if (propValue === null || isValidElement(propValue)) {
809
- return true;
810
- }
811
- var iteratorFn = getIteratorFn(propValue);
812
- if (iteratorFn) {
813
- var iterator = iteratorFn.call(propValue);
814
- var step;
815
- if (iteratorFn !== propValue.entries) {
816
- while (!(step = iterator.next()).done) {
817
- if (!isNode(step.value)) {
818
- return false;
819
- }
820
- }
821
- } else {
822
- while (!(step = iterator.next()).done) {
823
- var entry = step.value;
824
- if (entry) {
825
- if (!isNode(entry[1])) {
826
- return false;
827
- }
828
- }
829
- }
830
- }
831
- } else {
832
- return false;
833
- }
834
- return true;
835
- default:
836
- return false;
837
- }
838
- }
839
- function isSymbol(propType, propValue) {
840
- if (propType === "symbol") {
841
- return true;
842
- }
843
- if (!propValue) {
844
- return false;
845
- }
846
- if (propValue["@@toStringTag"] === "Symbol") {
847
- return true;
848
- }
849
- if (typeof Symbol === "function" && propValue instanceof Symbol) {
850
- return true;
851
- }
852
- return false;
853
- }
854
- function getPropType(propValue) {
855
- var propType = typeof propValue;
856
- if (Array.isArray(propValue)) {
857
- return "array";
858
- }
859
- if (propValue instanceof RegExp) {
860
- return "object";
861
- }
862
- if (isSymbol(propType, propValue)) {
863
- return "symbol";
864
- }
865
- return propType;
866
- }
867
- function getPreciseType(propValue) {
868
- if (typeof propValue === "undefined" || propValue === null) {
869
- return "" + propValue;
870
- }
871
- var propType = getPropType(propValue);
872
- if (propType === "object") {
873
- if (propValue instanceof Date) {
874
- return "date";
875
- } else if (propValue instanceof RegExp) {
876
- return "regexp";
877
- }
878
- }
879
- return propType;
880
- }
881
- function getPostfixForTypeWarning(value) {
882
- var type = getPreciseType(value);
883
- switch (type) {
884
- case "array":
885
- case "object":
886
- return "an " + type;
887
- case "boolean":
888
- case "date":
889
- case "regexp":
890
- return "a " + type;
891
- default:
892
- return type;
893
- }
894
- }
895
- function getClassName(propValue) {
896
- if (!propValue.constructor || !propValue.constructor.name) {
897
- return ANONYMOUS;
898
- }
899
- return propValue.constructor.name;
900
- }
901
- ReactPropTypes.checkPropTypes = checkPropTypes;
902
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
903
- ReactPropTypes.PropTypes = ReactPropTypes;
904
- return ReactPropTypes;
905
- };
906
- }
907
- });
908
-
909
- // node_modules/prop-types/factoryWithThrowingShims.js
910
- var require_factoryWithThrowingShims = __commonJS({
911
- "node_modules/prop-types/factoryWithThrowingShims.js"(exports2, module2) {
912
- "use strict";
913
- var ReactPropTypesSecret = require_ReactPropTypesSecret();
914
- function emptyFunction() {
915
- }
916
- function emptyFunctionWithReset() {
917
- }
918
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
919
- module2.exports = function() {
920
- function shim(props, propName, componentName, location, propFullName, secret) {
921
- if (secret === ReactPropTypesSecret) {
922
- return;
923
- }
924
- var err = new Error(
925
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
926
- );
927
- err.name = "Invariant Violation";
928
- throw err;
929
- }
930
- ;
931
- shim.isRequired = shim;
932
- function getShim() {
933
- return shim;
934
- }
935
- ;
936
- var ReactPropTypes = {
937
- array: shim,
938
- bigint: shim,
939
- bool: shim,
940
- func: shim,
941
- number: shim,
942
- object: shim,
943
- string: shim,
944
- symbol: shim,
945
- any: shim,
946
- arrayOf: getShim,
947
- element: shim,
948
- elementType: shim,
949
- instanceOf: getShim,
950
- node: shim,
951
- objectOf: getShim,
952
- oneOf: getShim,
953
- oneOfType: getShim,
954
- shape: getShim,
955
- exact: getShim,
956
- checkPropTypes: emptyFunctionWithReset,
957
- resetWarningCache: emptyFunction
958
- };
959
- ReactPropTypes.PropTypes = ReactPropTypes;
960
- return ReactPropTypes;
961
- };
962
- }
963
- });
964
-
965
- // node_modules/prop-types/index.js
966
- var require_prop_types = __commonJS({
967
- "node_modules/prop-types/index.js"(exports2, module2) {
968
- "use strict";
969
- if (process.env.NODE_ENV !== "production") {
970
- ReactIs = require_react_is();
971
- throwOnDirectAccess = true;
972
- module2.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
973
- } else {
974
- module2.exports = require_factoryWithThrowingShims()();
975
- }
976
- var ReactIs;
977
- var throwOnDirectAccess;
978
- }
979
- });
980
-
981
- // src/index.ts
982
- var index_exports = {};
983
- __export(index_exports, {
984
- ChipInputCell: () => ChipInputCell,
985
- Dropzone: () => Dropzone,
986
- EditableColumnHeader: () => EditableColumnHeader,
987
- FileViewer: () => FileViewer,
988
- LayoutProvider: () => LayoutProvider,
989
- PageHeader: () => PageHeader,
990
- Platform: () => Platform,
991
- RouterButton: () => RouterButton,
992
- RouterError: () => RouterError,
993
- RouterGridActionsCellItem: () => RouterGridActionsCellItem,
994
- RouterIconButton: () => RouterIconButton,
995
- RouterLink: () => RouterLink,
996
- RouterListItemButton: () => RouterListItemButton,
997
- RouterNotFound: () => RouterNotFound,
998
- RouterTab: () => RouterTab,
999
- TableContainer: () => TableContainer,
1000
- TypographyWithIcon: () => TypographyWithIcon,
1001
- rootRouteHead: () => rootRouteHead,
1002
- setSSRLanguage: () => setSSRLanguage,
1003
- t: () => import_i18next3.t,
1004
- useDeleteFile: () => useDeleteFile,
1005
- useDeleteFiles: () => useDeleteFiles,
1006
- useDialogs: () => useDialogs,
1007
- useDownloadFile: () => useDownloadFile,
1008
- useFieldContext: () => useFieldContext,
1009
- useFormContext: () => useFormContext,
1010
- useGetFile: () => useGetFile,
1011
- useGetFileMetas: () => useGetFileMetas,
1012
- useGetFileThumbnail: () => useGetFileThumbnail,
1013
- useLayoutForm: () => useLayoutForm,
1014
- useLocalStorageState: () => import_use_local_storage_state2.default,
1015
- useOpenFile: () => useOpenFile,
1016
- useTranslation: () => import_react_i18next9.useTranslation,
1017
- useUpdateFileMeta: () => useUpdateFileMeta,
1018
- useUploadFile: () => useUploadFile,
1019
- uuidv7: () => import_uuidv72.uuidv7,
1020
- wczApiClient: () => wczApiClient,
1021
- withLayoutForm: () => withLayoutForm
1022
- });
1023
- module.exports = __toCommonJS(index_exports);
1024
-
1025
- // src/components/core/TypographyWithIcon.tsx
1026
- var import_material = require("@mui/material");
1027
- var import_jsx_runtime = require("react/jsx-runtime");
1028
- var stackSxProps = [
1029
- "margin",
1030
- "marginTop",
1031
- "marginRight",
1032
- "marginBottom",
1033
- "marginLeft",
1034
- "m",
1035
- "mt",
1036
- "mr",
1037
- "mb",
1038
- "ml",
1039
- "mx",
1040
- "my",
1041
- "padding",
1042
- "paddingTop",
1043
- "paddingRight",
1044
- "paddingBottom",
1045
- "paddingLeft",
1046
- "p",
1047
- "pt",
1048
- "pr",
1049
- "pb",
1050
- "pl",
1051
- "px",
1052
- "py",
1053
- "flexGrow",
1054
- "flexShrink",
1055
- "flexBasis",
1056
- "flexDirection",
1057
- "alignItems",
1058
- "justifyContent",
1059
- "position",
1060
- "zIndex",
1061
- "top",
1062
- "right",
1063
- "bottom",
1064
- "left",
1065
- "gridGap",
1066
- "gridColumnGap",
1067
- "gridRowGap",
1068
- "gridColumn",
1069
- "gridRow",
1070
- "gridAutoFlow",
1071
- "gap",
1072
- "columnGap",
1073
- "rowGap"
1074
- ];
1075
- var TypographyWithIcon = ({ startIcon, endIcon, children, sx, gutterBottom, ...props }) => {
1076
- const sxCopy = { ...sx };
1077
- const stackStyles = {};
1078
- for (const current of stackSxProps) {
1079
- if (sxCopy[current]) {
1080
- stackStyles[current] = sxCopy[current];
1081
- delete sxCopy[current];
1082
- }
1083
- }
1084
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Stack, { direction: "row", alignItems: "center", gap: 1, sx: stackStyles, mb: gutterBottom ? 0.7 : void 0, children: [
1085
- startIcon,
1086
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { ...props, sx: sxCopy, children }),
1087
- endIcon
1088
- ] });
1089
- };
1090
-
1091
- // src/components/core/PageHeader.tsx
1092
- var import_material2 = require("@mui/material");
1093
- var import_jsx_runtime2 = require("react/jsx-runtime");
1094
- var PageHeader = ({ title, action, sx }) => {
1095
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.CardHeader, { title: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Typography, { variant: "h4", fontWeight: 600, children: title }), action, sx: { px: 0, ...sx } });
1096
- };
1097
-
1098
- // src/components/core/TableContainer.tsx
1099
- var import_material3 = require("@mui/material");
1100
- var import_react = require("react");
1101
- var import_jsx_runtime3 = require("react/jsx-runtime");
1102
- var TableContainer = ({ children, sx, ...props }) => {
1103
- const reference = (0, import_react.useRef)(null);
1104
- const [height, setHeight] = (0, import_react.useState)();
1105
- (0, import_react.useEffect)(() => {
1106
- const element = reference.current;
1107
- if (!element) return;
1108
- const recompute = () => {
1109
- if (!reference.current) return;
1110
- const top = Math.ceil(reference.current.getBoundingClientRect().top);
1111
- const avail = Math.max(0, window.innerHeight - top);
1112
- setHeight(avail);
1113
- };
1114
- recompute();
1115
- window.addEventListener("resize", recompute);
1116
- const ro = new ResizeObserver(recompute);
1117
- ro.observe(document.documentElement);
1118
- ro.observe(document.body);
1119
- ro.observe(element);
1120
- return () => {
1121
- window.removeEventListener("resize", recompute);
1122
- ro.disconnect();
1123
- };
1124
- }, []);
1125
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1126
- import_material3.Box,
1127
- {
1128
- ref: reference,
1129
- sx: {
1130
- display: "flex",
1131
- flexDirection: "column",
1132
- minHeight: 0,
1133
- width: "100%",
1134
- ...sx
1135
- },
1136
- height,
1137
- ...props,
1138
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Box, { sx: (theme) => ({
1139
- flex: 1,
1140
- minHeight: 0,
1141
- height: "100%",
1142
- "& .MuiDataGrid-cell--editing": {
1143
- "& .MuiInputBase-root": {
1144
- height: "100%"
1145
- }
1146
- },
1147
- "& .MuiDataGrid-columnHeaderTitle": {
1148
- fontWeight: 600
1149
- },
1150
- "& .Mui-error": {
1151
- backgroundColor: theme.palette.error.main,
1152
- color: theme.palette.error.contrastText
1153
- },
1154
- "& .MuiDataGrid-booleanCell[data-value='true']": {
1155
- color: `${theme.palette.success.main} !important`
1156
- },
1157
- "& .MuiDataGrid-booleanCell[data-value='false']": {
1158
- color: `${theme.palette.error.main} !important`
1159
- }
1160
- }), children })
1161
- }
1162
- );
1163
- };
1164
-
1165
- // src/components/file/Dropzone.tsx
1166
- var import_CloudUpload = __toESM(require("@mui/icons-material/CloudUpload"), 1);
1167
- var import_material4 = require("@mui/material");
1168
- var import_react_dropzone = require("react-dropzone");
1169
- var import_react_i18next = require("react-i18next");
1170
- var import_jsx_runtime4 = require("react/jsx-runtime");
1171
- var baseStyle = {
1172
- flex: 1,
1173
- display: "flex",
1174
- flexDirection: "column",
1175
- alignItems: "center",
1176
- padding: "20px",
1177
- borderWidth: 2,
1178
- borderRadius: 2,
1179
- borderStyle: "dashed",
1180
- outline: "none",
1181
- transition: "border .24s ease-in-out",
1182
- cursor: "pointer"
1183
- };
1184
- var Dropzone = ({ sx, ...props }) => {
1185
- const { getRootProps, getInputProps, isFocused, isDragAccept, isDragReject } = (0, import_react_dropzone.useDropzone)(props);
1186
- const { t: t2 } = (0, import_react_i18next.useTranslation)();
1187
- const theme = (0, import_material4.useTheme)();
1188
- const style = {
1189
- ...baseStyle,
1190
- ...isFocused ? { borderColor: theme.palette.primary.main } : {},
1191
- ...isDragAccept ? { borderColor: theme.palette.success.main } : {},
1192
- ...isDragReject ? { borderColor: theme.palette.error.main } : {}
1193
- };
1194
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_material4.Paper, { variant: "outlined", ...getRootProps({ style }), sx, children: [
1195
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("input", { ...getInputProps(), style: { display: "none" } }),
1196
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_CloudUpload.default, {}),
1197
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.Typography, { children: t2("Layout.File.DragSomeFilesHereOrClickToSelectThem") })
1198
- ] });
1199
- };
1200
-
1201
- // src/components/file/FileViewer.tsx
1202
- var import_react9 = require("react");
1203
-
1204
- // src/components/file/fileViewer/FileViewerGrid.tsx
1205
- var import_MoreVert = __toESM(require("@mui/icons-material/MoreVert"), 1);
1206
- var import_material8 = require("@mui/material");
1207
- var import_colors = require("@mui/material/colors");
1208
- var import_react6 = require("react");
1209
-
1210
- // src/components/file/fileViewer/common/ActionsMenu.tsx
1211
- var import_Delete = __toESM(require("@mui/icons-material/Delete"), 1);
1212
- var import_FileDownload = __toESM(require("@mui/icons-material/FileDownload"), 1);
1213
- var import_material7 = require("@mui/material");
1214
- var import_react_i18next3 = require("react-i18next");
1215
-
1216
- // src/contexts/FileContext.ts
1217
- var import_react2 = require("react");
1218
- var FileContext = (0, import_react2.createContext)(null);
1219
- var useFile = () => {
1220
- const context = (0, import_react2.useContext)(FileContext);
1221
- if (!context) {
1222
- throw new Error("FileViewer components must be used within FileViewer");
1223
- }
1224
- return context;
1225
- };
1226
-
1227
- // src/hooks/DialogsHooks.tsx
1228
- var import_material5 = require("@mui/material");
1229
- var import_react4 = require("react");
1230
- var import_react_i18next2 = require("react-i18next");
1231
-
1232
- // src/contexts/DialogsContext.ts
1233
- var import_react3 = require("react");
1234
- var DialogsContext = (0, import_react3.createContext)({});
1235
-
1236
- // src/hooks/DialogsHooks.tsx
1237
- var import_jsx_runtime5 = require("react/jsx-runtime");
1238
- function AlertDialog({ open, payload, onClose }) {
1239
- const { t: t2 } = (0, import_react_i18next2.useTranslation)();
1240
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material5.Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(), children: [
1241
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.DialogTitle, { children: payload.title ?? t2("Layout.Dialog.Alert") }),
1242
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.DialogContent, { children: payload.message }),
1243
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.DialogActions, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.Button, { disabled: !open, onClick: () => onClose(), children: t2("Layout.Dialog.Confirm") }) })
1244
- ] });
1245
- }
1246
- function ConfirmDialog({ open, payload, onClose }) {
1247
- const { t: t2 } = (0, import_react_i18next2.useTranslation)();
1248
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material5.Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(false), children: [
1249
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.DialogTitle, { children: payload.title ?? t2("Layout.Dialog.Confirm") }),
1250
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.DialogContent, { children: payload.message }),
1251
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material5.DialogActions, { children: [
1252
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.Button, { autoFocus: true, disabled: !open, onClick: () => onClose(false), children: payload.cancelText ?? t2("Layout.Dialog.Cancel") }),
1253
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.Button, { disabled: !open, onClick: () => onClose(true), children: t2("Layout.Dialog.Confirm") })
1254
- ] })
1255
- ] });
1256
- }
1257
- function useDialogs() {
1258
- const { open, close } = (0, import_react4.useContext)(DialogsContext);
1259
- const alert = (0, import_material5.useEventCallback)(
1260
- (message, { ...options } = {}) => open(AlertDialog, { ...options, message })
1261
- );
1262
- const confirm = (0, import_material5.useEventCallback)(
1263
- (message, { ...options } = {}) => open(ConfirmDialog, { ...options, message })
1264
- );
1265
- return (0, import_react4.useMemo)(() => ({ alert, confirm, open, close }), [alert, close, confirm, open]);
1266
- }
1267
-
1268
- // src/hooks/FileHooks.ts
1269
- var import_react_query = require("@tanstack/react-query");
1270
- var import_file_saver = __toESM(require("file-saver"), 1);
1271
- var import_react5 = require("react");
1272
- var import_tus_js_client = require("tus-js-client");
1273
- var import_uuidv7 = require("uuidv7");
1274
-
1275
- // src/components/core/AppTitle.tsx
1276
- var import_material6 = require("@mui/material");
1277
- var import_react_router = require("@tanstack/react-router");
1278
- var import_jsx_runtime6 = require("react/jsx-runtime");
1279
- var import_meta = {};
1280
- var AppTitle = () => {
1281
- const title = useAppTitle();
1282
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material6.Stack, { direction: "row", alignItems: "center", spacing: 2, flexGrow: 1, children: [
1283
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { src: "/favicon-32x32.png", alt: "app-logo", loading: "lazy" }),
1284
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material6.Typography, { variant: "h6", children: title }),
1285
- import_meta.env.DEV && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material6.Chip, { size: "small", label: "TEST", color: "info" })
1286
- ] });
1287
- };
1288
- var useAppTitle = () => {
1289
- const rootRouterState = (0, import_react_router.useRouterState)({ select: (s) => s.matches[0] });
1290
- return rootRouterState.meta?.find((meta) => meta?.title)?.title;
1291
- };
1292
-
1293
- // src/utils/ClientUtils.ts
1294
- var import_axios = __toESM(require("axios"), 1);
1295
- var Platform = class {
1296
- static get isAndroid() {
1297
- return /android/i.test(this.userAgent);
1298
- }
1299
- static get isIOS() {
1300
- return /iPad|iPhone|iPod/.test(this.userAgent);
1301
- }
1302
- static get isWindows() {
1303
- return /windows/i.test(this.userAgent);
1304
- }
1305
- static get isMacOS() {
1306
- return /Macintosh|MacIntel|MacPPC|Mac68K/.test(this.userAgent);
1307
- }
1308
- static get userAgent() {
1309
- return typeof navigator === "undefined" ? "" : navigator.userAgent;
1310
- }
1311
- };
1312
- var rootRouteHead = ({ title }) => () => ({
1313
- meta: [
1314
- { charSet: "utf-8" },
1315
- { name: "viewport", content: "width=device-width, initial-scale=1" },
1316
- { title },
1317
- { name: "og:type", content: "website" },
1318
- { name: "og:title", content: title },
1319
- { name: "og:image", content: "/favicon-32x32.png" }
1320
- ],
1321
- links: [
1322
- { rel: "apple-touch-icon", sizes: "180x180", href: "/apple-touch-icon.png" },
1323
- { rel: "icon", type: "image/png", sizes: "32x32", href: "/favicon-32x32.png" },
1324
- { rel: "icon", type: "image/png", sizes: "16x16", href: "/favicon-16x16.png" },
1325
- { rel: "manifest", href: "/site.webmanifest" },
1326
- { rel: "icon", href: "/favicon.ico" }
1327
- ]
1328
- });
1329
- var wczApiClient = import_axios.default.create();
1330
-
1331
- // src/hooks/FileHooks.ts
1332
- var import_meta2 = {};
1333
- var BASE_URL = import_meta2.env.VITE_FILE_API_BASE_URL;
1334
- var QUERY_KEY = "Files";
1335
- var HOUR = 1e3 * 60 * 60;
1336
- var useGetFileMetas = (subId, options) => {
1337
- const appTitle = useAppTitle();
1338
- return (0, import_react_query.useQuery)({
1339
- ...options,
1340
- queryKey: [QUERY_KEY, "meta", subId, appTitle],
1341
- queryFn: ({ signal }) => wczApiClient.request({
1342
- url: `${BASE_URL}/v1/meta?appName=${appTitle}&subId=${subId}`,
1343
- method: "GET",
1344
- signal
1345
- }),
1346
- staleTime: HOUR,
1347
- gcTime: HOUR,
1348
- refetchOnWindowFocus: false
1349
- });
1350
- };
1351
- var useGetFileThumbnail = (meta, options) => {
1352
- const appTitle = useAppTitle();
1353
- return (0, import_react_query.useQuery)({
1354
- ...options,
1355
- queryKey: [QUERY_KEY, "thumbnail", meta?.id, appTitle],
1356
- queryFn: ({ signal }) => wczApiClient.request({
1357
- url: `${BASE_URL}/v1/thumbnail?appName=${appTitle}&id=${meta?.id}`,
1358
- method: "GET",
1359
- signal,
1360
- responseType: "blob"
1361
- }),
1362
- select: (data) => URL.createObjectURL(data),
1363
- staleTime: HOUR,
1364
- gcTime: HOUR,
1365
- refetchOnWindowFocus: false,
1366
- enabled: !!meta?.id && options?.enabled
1367
- });
1368
- };
1369
- var useGetFile = (meta, options) => {
1370
- const appTitle = useAppTitle();
1371
- return (0, import_react_query.useQuery)({
1372
- ...options,
1373
- queryKey: [QUERY_KEY, meta?.id, appTitle],
1374
- queryFn: ({ signal }) => wczApiClient.request({
1375
- url: `${BASE_URL}/v1?appName=${appTitle}&id=${meta?.id}`,
1376
- method: "GET",
1377
- signal,
1378
- responseType: "blob"
1379
- }),
1380
- select: (data) => URL.createObjectURL(data),
1381
- staleTime: HOUR,
1382
- gcTime: HOUR,
1383
- refetchOnWindowFocus: false,
1384
- enabled: !!meta?.id && options?.enabled
1385
- });
1386
- };
1387
- var useDownloadFile = (options) => {
1388
- const appTitle = useAppTitle();
1389
- return (0, import_react_query.useMutation)({
1390
- ...options,
1391
- mutationFn: (meta) => wczApiClient.request({
1392
- url: `${BASE_URL}/v1/download?appName=${appTitle}&id=${meta.id}`,
1393
- method: "GET",
1394
- responseType: "blob"
1395
- }),
1396
- onSuccess: (data, variables) => (0, import_file_saver.default)(data, `${variables.fileName}.${variables.fileExtension}`)
1397
- });
1398
- };
1399
- var useOpenFile = (options) => {
1400
- const appTitle = useAppTitle();
1401
- return (0, import_react_query.useMutation)({
1402
- ...options,
1403
- mutationFn: (meta) => wczApiClient.request({
1404
- url: `${BASE_URL}/v1?appName=${appTitle}&id=${meta.id}`,
1405
- method: "GET",
1406
- responseType: "blob"
1407
- }),
1408
- onSuccess: (data) => {
1409
- window.open(URL.createObjectURL(data));
1410
- }
1411
- });
1412
- };
1413
- var useUpdateFileMeta = (options) => {
1414
- const appTitle = useAppTitle();
1415
- const queryClient = (0, import_react_query.useQueryClient)();
1416
- return (0, import_react_query.useMutation)({
1417
- ...options,
1418
- mutationFn: (meta) => wczApiClient.request({
1419
- url: `${BASE_URL}/v1/meta?appName=${appTitle}&id=${meta.id}`,
1420
- method: "PUT",
1421
- data: meta
1422
- }),
1423
- onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, "meta"], exact: false })
1424
- });
1425
- };
1426
- var useDeleteFile = (options) => {
1427
- const appTitle = useAppTitle();
1428
- const queryClient = (0, import_react_query.useQueryClient)();
1429
- return (0, import_react_query.useMutation)({
1430
- ...options,
1431
- mutationFn: (meta) => wczApiClient.request({
1432
- url: `${BASE_URL}/v1?appName=${appTitle}&id=${meta.id}`,
1433
- method: "DELETE"
1434
- }),
1435
- onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, "meta"], exact: false })
1436
- });
1437
- };
1438
- var useDeleteFiles = (options) => {
1439
- const appTitle = useAppTitle();
1440
- const queryClient = (0, import_react_query.useQueryClient)();
1441
- return (0, import_react_query.useMutation)({
1442
- ...options,
1443
- mutationFn: (subId) => wczApiClient.request({
1444
- url: `${BASE_URL}/v1?appName=${appTitle}&subId=${subId}`,
1445
- method: "DELETE"
1446
- }),
1447
- onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, "meta"], exact: false })
1448
- });
1449
- };
1450
- var useUploadFile = ({ subId, onSuccess, onError }) => {
1451
- const appTitle = useAppTitle();
1452
- const [progress, setProgress] = (0, import_react5.useState)(0);
1453
- const queryClient = (0, import_react_query.useQueryClient)();
1454
- const mutate = async (file) => {
1455
- if (!subId) throw new Error("subId is required for file upload");
1456
- if (!appTitle) throw new Error("appTitle is required for file upload");
1457
- const metadata = {
1458
- id: (0, import_uuidv7.uuidv7)(),
1459
- appName: appTitle,
1460
- subId,
1461
- fileName: file.name
1462
- };
1463
- const upload = new import_tus_js_client.Upload(file, {
1464
- endpoint: `${BASE_URL}/v1/upload`,
1465
- chunkSize: 1048576,
1466
- // 1 MB
1467
- metadata: {
1468
- id: metadata.id,
1469
- appName: metadata.appName,
1470
- subId: metadata.subId,
1471
- fileName: metadata.fileName,
1472
- fileExtension: file.type
1473
- },
1474
- // headers: { "Authorization": `Bearer ${await getToken()}` }, //TODO: implement token retrieval
1475
- onError: (error) => {
1476
- setProgress(0);
1477
- onError?.(error);
1478
- },
1479
- onProgress: (bytesUploaded, bytesTotal) => {
1480
- setProgress(bytesUploaded / bytesTotal * 100);
1481
- },
1482
- onSuccess: () => {
1483
- setProgress(0);
1484
- queryClient.invalidateQueries({ queryKey: [QUERY_KEY, "meta", subId, appTitle], exact: false });
1485
- onSuccess?.(metadata);
1486
- }
1487
- });
1488
- const previousUploads = await upload.findPreviousUploads();
1489
- if (previousUploads.length > 0) {
1490
- upload.resumeFromPreviousUpload(previousUploads[0]);
1491
- }
1492
- upload.start();
1493
- };
1494
- return { mutate, progress };
1495
- };
1496
-
1497
- // src/components/file/fileViewer/common/ActionsMenu.tsx
1498
- var import_jsx_runtime7 = require("react/jsx-runtime");
1499
- var ActionsMenu = ({ meta, menu, setMenu }) => {
1500
- const { t: t2 } = (0, import_react_i18next3.useTranslation)();
1501
- const { fileMetas, onDelete, actions } = useFile();
1502
- const { confirm } = useDialogs();
1503
- const handleMenuClose = () => {
1504
- setMenu(null);
1505
- };
1506
- const { mutate: download, isPending: isDownloading } = useDownloadFile();
1507
- const { mutate: deleteFile, isPending: isDeleting } = useDeleteFile();
1508
- const handleOnDownload = () => {
1509
- handleMenuClose();
1510
- download(meta);
1511
- };
1512
- const handleOnDelete = async () => {
1513
- if (!await confirm(t2("Layout.File.AreYouSureYouWantToDelete", { fileName: meta.fileName })))
1514
- return;
1515
- deleteFile(meta);
1516
- handleMenuClose();
1517
- if (onDelete) {
1518
- const remainingFileMetas = fileMetas.filter((m) => m.id !== meta.id);
1519
- onDelete({ remainingFileMetas, deletedFileMeta: meta });
1520
- }
1521
- };
1522
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1523
- import_material7.Menu,
1524
- {
1525
- open: menu !== null,
1526
- onClose: handleMenuClose,
1527
- anchorReference: "anchorPosition",
1528
- variant: "menu",
1529
- anchorPosition: menu === null ? void 0 : { top: menu.mouseY, left: menu.mouseX },
1530
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material7.List, { disablePadding: true, children: [
1531
- actions?.download !== false && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material7.ListItemButton, { onClick: handleOnDownload, disabled: isDownloading, children: [
1532
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material7.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_FileDownload.default, {}) }),
1533
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material7.ListItemText, { children: t2("Layout.File.Download") })
1534
- ] }),
1535
- actions?.delete !== false && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material7.ListItemButton, { onClick: handleOnDelete, disabled: isDeleting, children: [
1536
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material7.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Delete.default, {}) }),
1537
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material7.ListItemText, { children: t2("Layout.File.Delete") })
1538
- ] })
1539
- ] })
1540
- }
1541
- );
1542
- };
1543
-
1544
- // src/components/file/fileViewer/FileViewerGrid.tsx
1545
- var import_jsx_runtime8 = require("react/jsx-runtime");
1546
- var IMAGE_SIZE = 150;
1547
- var FileViewerGrid = ({ sx, size, itemBar }) => {
1548
- const { fileMetas } = useFile();
1549
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material8.Stack, { direction: "row", spacing: 1, sx: { overflow: "auto", ...sx }, children: fileMetas.map((fileMeta) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1550
- GridFileViewerItem,
1551
- {
1552
- meta: fileMeta,
1553
- size,
1554
- itemBar
1555
- },
1556
- fileMeta.id
1557
- )) });
1558
- };
1559
- var GridFileViewerItem = ({ meta, size, itemBar }) => {
1560
- const { setImageId, actions } = useFile();
1561
- const [showItemBar, setShowItemBar] = (0, import_react6.useState)(itemBar === "always");
1562
- const [menu, setMenu] = (0, import_react6.useState)(null);
1563
- (0, import_react6.useEffect)(() => {
1564
- setShowItemBar(itemBar === "always");
1565
- }, [itemBar]);
1566
- const { data: source } = useGetFileThumbnail(meta);
1567
- const handleOnMouseEnter = () => setShowItemBar(true);
1568
- const handleOnMouseLeave = () => itemBar !== "always" && setShowItemBar(false);
1569
- const openMenu = (event) => {
1570
- setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY } : null);
1571
- setTimeout(() => setShowItemBar(true));
1572
- };
1573
- const { mutate: openFile } = useOpenFile();
1574
- const { mutate: download } = useDownloadFile();
1575
- const onClick = () => {
1576
- switch (meta.mediaType) {
1577
- case "image": {
1578
- return setImageId(meta.id);
1579
- }
1580
- case "application": {
1581
- return openFile(meta);
1582
- }
1583
- case "video": {
1584
- return openFile(meta);
1585
- }
1586
- default: {
1587
- return download(meta);
1588
- }
1589
- }
1590
- };
1591
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react6.Fragment, { children: [
1592
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material8.ImageListItem, { sx: { width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }, onMouseEnter: handleOnMouseEnter, onMouseLeave: handleOnMouseLeave, children: [
1593
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1594
- import_material8.Box,
1595
- {
1596
- component: "img",
1597
- src: source,
1598
- loading: "lazy",
1599
- alt: "thumbnail-" + meta.id,
1600
- onClick,
1601
- sx: { cursor: "pointer", objectFit: "contain", width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }
1602
- }
1603
- ),
1604
- itemBar !== "hidden" && showItemBar && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1605
- import_material8.ImageListItemBar,
1606
- {
1607
- title: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material8.Tooltip, { title: meta.fileName, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material8.Box, { children: meta.fileName }) }),
1608
- actionIcon: (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material8.IconButton, { sx: { color: import_colors.grey[100] }, onClick: openMenu, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_MoreVert.default, {}) })
1609
- }
1610
- )
1611
- ] }),
1612
- (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ActionsMenu, { meta, menu, setMenu })
1613
- ] });
1614
- };
1615
-
1616
- // src/components/file/fileViewer/FileViewerList.tsx
1617
- var import_AttachFile = __toESM(require("@mui/icons-material/AttachFile"), 1);
1618
- var import_Image = __toESM(require("@mui/icons-material/Image"), 1);
1619
- var import_MoreVert2 = __toESM(require("@mui/icons-material/MoreVert"), 1);
1620
- var import_SmartDisplay = __toESM(require("@mui/icons-material/SmartDisplay"), 1);
1621
- var import_material9 = require("@mui/material");
1622
- var import_react7 = require("react");
1623
- var import_jsx_runtime9 = require("react/jsx-runtime");
1624
- var FileViewerList = ({ sx }) => {
1625
- const { fileMetas } = useFile();
1626
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material9.List, { dense: true, sx, children: fileMetas.map(
1627
- (fileMeta) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1628
- ListFileViewerItem,
1629
- {
1630
- meta: fileMeta
1631
- },
1632
- fileMeta.id
1633
- )
1634
- ) });
1635
- };
1636
- var ListFileViewerItem = ({ meta }) => {
1637
- const { setImageId, actions } = useFile();
1638
- const [menu, setMenu] = (0, import_react7.useState)(null);
1639
- const openMenu = (event) => {
1640
- event.stopPropagation();
1641
- setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY } : null);
1642
- };
1643
- const { mutate: openFile } = useOpenFile();
1644
- const { mutate: download } = useDownloadFile();
1645
- const onClick = () => {
1646
- switch (meta.mediaType) {
1647
- case "image": {
1648
- return setImageId(meta.id);
1649
- }
1650
- case "application": {
1651
- return openFile(meta);
1652
- }
1653
- case "video": {
1654
- return openFile(meta);
1655
- }
1656
- default: {
1657
- return download(meta);
1658
- }
1659
- }
1660
- };
1661
- const icon = () => {
1662
- switch (meta.mediaType) {
1663
- case "image": {
1664
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_Image.default, {});
1665
- }
1666
- case "video": {
1667
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_SmartDisplay.default, {});
1668
- }
1669
- default: {
1670
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_AttachFile.default, {});
1671
- }
1672
- }
1673
- };
1674
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react7.Fragment, { children: [
1675
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material9.ListItemButton, { onClick, children: [
1676
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material9.ListItemIcon, { children: icon() }),
1677
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material9.ListItemText, { primary: `${meta.fileName}.${meta.fileExtension}` }),
1678
- (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material9.IconButton, { edge: "end", onClick: openMenu, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_MoreVert2.default, {}) })
1679
- ] }, meta.id),
1680
- (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ActionsMenu, { meta, menu, setMenu })
1681
- ] });
1682
- };
1683
-
1684
- // src/components/file/fileViewer/ImageViewer.tsx
1685
- var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
1686
- var import_material10 = require("@mui/material");
1687
- var import_react8 = require("react");
1688
- var import_jsx_runtime10 = require("react/jsx-runtime");
1689
- var ImageViewer = ({ metaId }) => {
1690
- const { fileMetas, setImageId } = useFile();
1691
- const meta = fileMetas.find((m) => m.id === metaId);
1692
- const { data: source } = useGetFile(meta);
1693
- (0, import_react8.useEffect)(() => {
1694
- if (metaId)
1695
- globalThis.addEventListener("keydown", handleOnKeydown);
1696
- return () => {
1697
- globalThis.removeEventListener("keydown", handleOnKeydown);
1698
- };
1699
- }, [metaId]);
1700
- const handleOnKeydown = (event) => {
1701
- const images = fileMetas.filter((m) => m.mediaType === "image");
1702
- const imageIndex = images.findIndex((m) => m.id === metaId);
1703
- switch (event.key) {
1704
- case "ArrowLeft": {
1705
- return handleOnArrowLeft(images, imageIndex);
1706
- }
1707
- case "ArrowRight": {
1708
- return handleOnArrowRight(images, imageIndex);
1709
- }
1710
- case "Backspace":
1711
- case "Escape": {
1712
- event.preventDefault();
1713
- return onClose();
1714
- }
1715
- }
1716
- };
1717
- const handleOnArrowLeft = (images, index) => {
1718
- if (index > 0) {
1719
- const previousFile = images[index - 1];
1720
- setImageId(previousFile.id);
1721
- }
1722
- };
1723
- const handleOnArrowRight = (images, index) => {
1724
- if (index < images.length - 1) {
1725
- const nextFile = images[index + 1];
1726
- setImageId(nextFile.id);
1727
- }
1728
- };
1729
- const onClose = () => setImageId("");
1730
- if (!metaId) return null;
1731
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_material10.Dialog, { open: true, onClose, maxWidth: "xl", children: [
1732
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material10.Box, { component: "img", src: source, alt: metaId, sx: { maxWidth: "100vw", maxHeight: { xs: "calc(100vh - 56px)", sm: "calc(100vh - 64px)" } } }),
1733
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material10.Fab, { size: "medium", onClick: onClose, sx: { position: "fixed", top: 8, right: 8 }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_Close.default, {}) })
1734
- ] });
1735
- };
1736
-
1737
- // src/components/file/FileViewer.tsx
1738
- var import_jsx_runtime11 = require("react/jsx-runtime");
1739
- var FileViewer = ({ subId, onDelete, actions, children }) => {
1740
- const { data: fileMetas = [] } = useGetFileMetas(subId, { enabled: !!subId });
1741
- const [imageId, setImageId] = (0, import_react9.useState)("");
1742
- const components = { Grid: FileViewerGrid, List: FileViewerList };
1743
- if (fileMetas.length === 0) return null;
1744
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(FileContext.Provider, { value: { fileMetas, onDelete, actions, setImageId }, children: [
1745
- children(components),
1746
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ImageViewer, { metaId: imageId })
1747
- ] });
1748
- };
1749
-
1750
- // src/components/data-grid/ChipInputCell.tsx
1751
- var import_material11 = require("@mui/material");
1752
- var import_jsx_runtime12 = require("react/jsx-runtime");
1753
- var isArray = (value) => Array.isArray(value);
1754
- var ChipInputCell = ({ params, slotProps, getLabel }) => {
1755
- if (!params.value) return null;
1756
- const getLabelValue = (value) => {
1757
- if (getLabel) return getLabel(value);
1758
- return value;
1759
- };
1760
- if (isArray(params.value))
1761
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material11.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { overflowX: "auto", height: "100%", width: params.colDef.computedWidth }, children: params.value.map(
1762
- (value, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material11.Chip, { label: getLabelValue(value), ...slotProps }, `${index + 1}-chip-input-cell`)
1763
- ) });
1764
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material11.Chip, { label: getLabelValue(params.value), ...slotProps });
1765
- };
1766
-
1767
- // src/components/data-grid/EditableColumnHeader.tsx
1768
- var import_Edit = __toESM(require("@mui/icons-material/Edit"), 1);
1769
- var import_jsx_runtime13 = require("react/jsx-runtime");
1770
- var EditableColumnHeader = ({ colDef }) => {
1771
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TypographyWithIcon, { endIcon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_Edit.default, { color: "disabled", fontSize: "small" }), variant: "body2", className: "MuiDataGrid-columnHeaderTitle", children: colDef.headerName });
1772
- };
1773
-
1774
- // src/components/router/RouterButton.tsx
1775
- var import_material12 = require("@mui/material");
1776
- var import_react_router2 = require("@tanstack/react-router");
1777
- var import_react10 = __toESM(require("react"), 1);
1778
- var import_jsx_runtime14 = require("react/jsx-runtime");
1779
- var Component = import_react10.default.forwardRef(function ButtonComponent(props, reference) {
1780
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material12.Button, { ref: reference, component: "a", ...props });
1781
- });
1782
- var CreatedComponent = (0, import_react_router2.createLink)(Component);
1783
- var RouterButton = (props) => {
1784
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CreatedComponent, { ...props });
1785
- };
1786
-
1787
- // src/components/router/RouterGridActionsCellItem.tsx
1788
- var import_x_data_grid_premium = require("@mui/x-data-grid-premium");
1789
- var import_react_router3 = require("@tanstack/react-router");
1790
- var import_react11 = __toESM(require("react"), 1);
1791
- var import_jsx_runtime15 = require("react/jsx-runtime");
1792
- var Component2 = import_react11.default.forwardRef(
1793
- function GridActionsCellItemComponent(props, reference) {
1794
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_x_data_grid_premium.GridActionsCellItem, { ref: reference, component: "a", ...props });
1795
- }
1796
- );
1797
- var CreatedComponent2 = (0, import_react_router3.createLink)(Component2);
1798
- var RouterGridActionsCellItem = (props) => {
1799
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CreatedComponent2, { ...props });
1800
- };
1801
-
1802
- // src/components/router/RouterIconButton.tsx
1803
- var import_material13 = require("@mui/material");
1804
- var import_react_router4 = require("@tanstack/react-router");
1805
- var import_react12 = __toESM(require("react"), 1);
1806
- var import_jsx_runtime16 = require("react/jsx-runtime");
1807
- var Component3 = import_react12.default.forwardRef(function IconButtonComponent(props, reference) {
1808
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_material13.IconButton, { ref: reference, component: "a", ...props });
1809
- });
1810
- var CreatedComponent3 = (0, import_react_router4.createLink)(Component3);
1811
- var RouterIconButton = (props) => {
1812
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CreatedComponent3, { ...props });
1813
- };
1814
-
1815
- // src/components/router/RouterLink.tsx
1816
- var import_material14 = require("@mui/material");
1817
- var import_react_router5 = require("@tanstack/react-router");
1818
- var import_react13 = __toESM(require("react"), 1);
1819
- var import_jsx_runtime17 = require("react/jsx-runtime");
1820
- var Component4 = import_react13.default.forwardRef(function LinkComponent(props, reference) {
1821
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_material14.Link, { ref: reference, ...props });
1822
- });
1823
- var CreatedComponent4 = (0, import_react_router5.createLink)(Component4);
1824
- var RouterLink = (props) => {
1825
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CreatedComponent4, { ...props });
1826
- };
1827
-
1828
- // src/components/router/RouterTab.tsx
1829
- var import_material15 = require("@mui/material");
1830
- var import_react_router6 = require("@tanstack/react-router");
1831
- var import_react14 = __toESM(require("react"), 1);
1832
- var import_jsx_runtime18 = require("react/jsx-runtime");
1833
- var Component5 = import_react14.default.forwardRef(function TabComponent(props, reference) {
1834
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_material15.Tab, { ref: reference, component: "a", ...props });
1835
- });
1836
- var CreatedComponent5 = (0, import_react_router6.createLink)(Component5);
1837
- var RouterTab = (props) => {
1838
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CreatedComponent5, { ...props });
1839
- };
1840
-
1841
- // src/components/router/RouterListItemButton.tsx
1842
- var import_material16 = require("@mui/material");
1843
- var import_react_router7 = require("@tanstack/react-router");
1844
- var import_react15 = __toESM(require("react"), 1);
1845
- var import_jsx_runtime19 = require("react/jsx-runtime");
1846
- var Component6 = import_react15.default.forwardRef(function ButtonComponent2(props, reference) {
1847
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_material16.ListItemButton, { ref: reference, component: "a", ...props });
1848
- });
1849
- var CreatedComponent6 = (0, import_react_router7.createLink)(Component6);
1850
- var RouterListItemButton = (props) => {
1851
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CreatedComponent6, { ...props });
1852
- };
1853
-
1854
- // src/components/router/RouterNotFound.tsx
1855
- var import_material17 = require("@mui/material");
1856
- var import_react_i18next4 = require("react-i18next");
1857
- var import_jsx_runtime20 = require("react/jsx-runtime");
1858
- function RouterNotFound() {
1859
- const { t: t2 } = (0, import_react_i18next4.useTranslation)();
1860
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material17.Box, { height: "100vh", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", px: 2, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material17.Box, { display: "flex", alignItems: "center", mb: 4, children: [
1861
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material17.Typography, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: "404" }),
1862
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material17.Divider, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
1863
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material17.Typography, { variant: "h5", component: "span", children: t2("Layout.ThisPageCouldNotBeFound") })
1864
- ] }) });
1865
- }
1866
-
1867
- // src/components/router/RouterError.tsx
1868
- var import_material18 = require("@mui/material");
1869
- var import_jsx_runtime21 = require("react/jsx-runtime");
1870
- var RouterError = ({ error }) => {
1871
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material18.Box, { height: "100vh", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", px: 2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material18.Box, { display: "flex", alignItems: "center", mb: 4, children: [
1872
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material18.Typography, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: error.name || "500" }),
1873
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material18.Divider, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
1874
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material18.Typography, { variant: "h5", component: "span", children: error.message })
1875
- ] }) });
1876
- };
1877
-
1878
- // node_modules/@babel/runtime/helpers/esm/extends.js
1879
- function _extends() {
1880
- return _extends = Object.assign ? Object.assign.bind() : function(n) {
1881
- for (var e = 1; e < arguments.length; e++) {
1882
- var t2 = arguments[e];
1883
- for (var r in t2) ({}).hasOwnProperty.call(t2, r) && (n[r] = t2[r]);
1884
- }
1885
- return n;
1886
- }, _extends.apply(null, arguments);
1887
- }
1888
-
1889
- // node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
1890
- function _objectWithoutPropertiesLoose(r, e) {
1891
- if (null == r) return {};
1892
- var t2 = {};
1893
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
1894
- if (-1 !== e.indexOf(n)) continue;
1895
- t2[n] = r[n];
1896
- }
1897
- return t2;
1898
- }
1899
-
1900
- // node_modules/@mui/x-date-pickers/esm/locales/utils/getPickersLocalization.js
1901
- var getPickersLocalization = (pickersTranslations) => {
1902
- return {
1903
- components: {
1904
- MuiLocalizationProvider: {
1905
- defaultProps: {
1906
- localeText: _extends({}, pickersTranslations)
1907
- }
1908
- }
1909
- }
1910
- };
1911
- };
1912
-
1913
- // node_modules/@mui/x-date-pickers/esm/locales/enUS.js
1914
- var enUSPickers = {
1915
- // Calendar navigation
1916
- previousMonth: "Previous month",
1917
- nextMonth: "Next month",
1918
- // View navigation
1919
- openPreviousView: "Open previous view",
1920
- openNextView: "Open next view",
1921
- calendarViewSwitchingButtonAriaLabel: (view) => view === "year" ? "year view is open, switch to calendar view" : "calendar view is open, switch to year view",
1922
- // DateRange labels
1923
- start: "Start",
1924
- end: "End",
1925
- startDate: "Start date",
1926
- startTime: "Start time",
1927
- endDate: "End date",
1928
- endTime: "End time",
1929
- // Action bar
1930
- cancelButtonLabel: "Cancel",
1931
- clearButtonLabel: "Clear",
1932
- okButtonLabel: "OK",
1933
- todayButtonLabel: "Today",
1934
- nextStepButtonLabel: "Next",
1935
- // Toolbar titles
1936
- datePickerToolbarTitle: "Select date",
1937
- dateTimePickerToolbarTitle: "Select date & time",
1938
- timePickerToolbarTitle: "Select time",
1939
- dateRangePickerToolbarTitle: "Select date range",
1940
- timeRangePickerToolbarTitle: "Select time range",
1941
- // Clock labels
1942
- clockLabelText: (view, formattedTime) => `Select ${view}. ${!formattedTime ? "No time selected" : `Selected time is ${formattedTime}`}`,
1943
- hoursClockNumberText: (hours) => `${hours} hours`,
1944
- minutesClockNumberText: (minutes) => `${minutes} minutes`,
1945
- secondsClockNumberText: (seconds) => `${seconds} seconds`,
1946
- // Digital clock labels
1947
- selectViewText: (view) => `Select ${view}`,
1948
- // Calendar labels
1949
- calendarWeekNumberHeaderLabel: "Week number",
1950
- calendarWeekNumberHeaderText: "#",
1951
- calendarWeekNumberAriaLabelText: (weekNumber) => `Week ${weekNumber}`,
1952
- calendarWeekNumberText: (weekNumber) => `${weekNumber}`,
1953
- // Open Picker labels
1954
- openDatePickerDialogue: (formattedDate) => formattedDate ? `Choose date, selected date is ${formattedDate}` : "Choose date",
1955
- openTimePickerDialogue: (formattedTime) => formattedTime ? `Choose time, selected time is ${formattedTime}` : "Choose time",
1956
- openRangePickerDialogue: (formattedRange) => formattedRange ? `Choose range, selected range is ${formattedRange}` : "Choose range",
1957
- fieldClearLabel: "Clear",
1958
- // Table labels
1959
- timeTableLabel: "pick time",
1960
- dateTableLabel: "pick date",
1961
- // Field section placeholders
1962
- fieldYearPlaceholder: (params) => "Y".repeat(params.digitAmount),
1963
- fieldMonthPlaceholder: (params) => params.contentType === "letter" ? "MMMM" : "MM",
1964
- fieldDayPlaceholder: () => "DD",
1965
- fieldWeekDayPlaceholder: (params) => params.contentType === "letter" ? "EEEE" : "EE",
1966
- fieldHoursPlaceholder: () => "hh",
1967
- fieldMinutesPlaceholder: () => "mm",
1968
- fieldSecondsPlaceholder: () => "ss",
1969
- fieldMeridiemPlaceholder: () => "aa",
1970
- // View names
1971
- year: "Year",
1972
- month: "Month",
1973
- day: "Day",
1974
- weekDay: "Week day",
1975
- hours: "Hours",
1976
- minutes: "Minutes",
1977
- seconds: "Seconds",
1978
- meridiem: "Meridiem",
1979
- // Common
1980
- empty: "Empty"
1981
- };
1982
- var enUS = getPickersLocalization(enUSPickers);
1983
-
1984
- // node_modules/@mui/x-date-pickers/esm/LocalizationProvider/LocalizationProvider.js
1985
- var React9 = __toESM(require("react"), 1);
1986
- var import_prop_types = __toESM(require_prop_types(), 1);
1987
- var import_styles = require("@mui/material/styles");
1988
- var import_jsx_runtime22 = require("react/jsx-runtime");
1989
- var _excluded = ["localeText"];
1990
- var PickerAdapterContext = /* @__PURE__ */ React9.createContext(null);
1991
- if (process.env.NODE_ENV !== "production") PickerAdapterContext.displayName = "PickerAdapterContext";
1992
- var LocalizationProvider = function LocalizationProvider2(inProps) {
1993
- const {
1994
- localeText: inLocaleText
1995
- } = inProps, otherInProps = _objectWithoutPropertiesLoose(inProps, _excluded);
1996
- const {
1997
- adapter: parentAdapter,
1998
- localeText: parentLocaleText
1999
- } = React9.useContext(PickerAdapterContext) ?? {
2000
- utils: void 0,
2001
- adapter: void 0,
2002
- localeText: void 0
2003
- };
2004
- const props = (0, import_styles.useThemeProps)({
2005
- // We don't want to pass the `localeText` prop to the theme, that way it will always return the theme value,
2006
- // We will then merge this theme value with our value manually
2007
- props: otherInProps,
2008
- name: "MuiLocalizationProvider"
2009
- });
2010
- const {
2011
- children,
2012
- dateAdapter: DateAdapter,
2013
- dateFormats,
2014
- dateLibInstance,
2015
- adapterLocale,
2016
- localeText: themeLocaleText
2017
- } = props;
2018
- const localeText = React9.useMemo(() => _extends({}, themeLocaleText, parentLocaleText, inLocaleText), [themeLocaleText, parentLocaleText, inLocaleText]);
2019
- const adapter = React9.useMemo(() => {
2020
- if (!DateAdapter) {
2021
- if (parentAdapter) {
2022
- return parentAdapter;
2023
- }
2024
- return null;
2025
- }
2026
- const dateAdapter = new DateAdapter({
2027
- locale: adapterLocale,
2028
- formats: dateFormats,
2029
- instance: dateLibInstance
2030
- });
2031
- if (!dateAdapter.isMUIAdapter) {
2032
- throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`", "For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`", "More information on the installation documentation: https://mui.com/x/react-date-pickers/quickstart/#installation"].join(`
2033
- `));
2034
- }
2035
- return dateAdapter;
2036
- }, [DateAdapter, adapterLocale, dateFormats, dateLibInstance, parentAdapter]);
2037
- const defaultDates = React9.useMemo(() => {
2038
- if (!adapter) {
2039
- return null;
2040
- }
2041
- return {
2042
- minDate: adapter.date("1900-01-01T00:00:00.000"),
2043
- maxDate: adapter.date("2099-12-31T00:00:00.000")
2044
- };
2045
- }, [adapter]);
2046
- const contextValue = React9.useMemo(() => {
2047
- return {
2048
- utils: adapter,
2049
- adapter,
2050
- defaultDates,
2051
- localeText
2052
- };
2053
- }, [defaultDates, adapter, localeText]);
2054
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PickerAdapterContext.Provider, {
2055
- value: contextValue,
2056
- children
2057
- });
2058
- };
2059
- if (process.env.NODE_ENV !== "production") LocalizationProvider.displayName = "LocalizationProvider";
2060
- process.env.NODE_ENV !== "production" ? LocalizationProvider.propTypes = {
2061
- // ----------------------------- Warning --------------------------------
2062
- // | These PropTypes are generated from the TypeScript type definitions |
2063
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
2064
- // ----------------------------------------------------------------------
2065
- /**
2066
- * Locale for the date library you are using
2067
- */
2068
- adapterLocale: import_prop_types.default.any,
2069
- children: import_prop_types.default.node,
2070
- /**
2071
- * Date library adapter class function.
2072
- * @see See the localization provider {@link https://mui.com/x/react-date-pickers/quickstart/#integrate-provider-and-adapter date adapter setup section} for more details.
2073
- */
2074
- dateAdapter: import_prop_types.default.func,
2075
- /**
2076
- * Formats that are used for any child pickers
2077
- */
2078
- dateFormats: import_prop_types.default.shape({
2079
- dayOfMonth: import_prop_types.default.string,
2080
- dayOfMonthFull: import_prop_types.default.string,
2081
- fullDate: import_prop_types.default.string,
2082
- fullTime12h: import_prop_types.default.string,
2083
- fullTime24h: import_prop_types.default.string,
2084
- hours12h: import_prop_types.default.string,
2085
- hours24h: import_prop_types.default.string,
2086
- keyboardDate: import_prop_types.default.string,
2087
- keyboardDateTime12h: import_prop_types.default.string,
2088
- keyboardDateTime24h: import_prop_types.default.string,
2089
- meridiem: import_prop_types.default.string,
2090
- minutes: import_prop_types.default.string,
2091
- month: import_prop_types.default.string,
2092
- monthShort: import_prop_types.default.string,
2093
- normalDate: import_prop_types.default.string,
2094
- normalDateWithWeekday: import_prop_types.default.string,
2095
- seconds: import_prop_types.default.string,
2096
- shortDate: import_prop_types.default.string,
2097
- weekday: import_prop_types.default.string,
2098
- weekdayShort: import_prop_types.default.string,
2099
- year: import_prop_types.default.string
2100
- }),
2101
- /**
2102
- * Date library instance you are using, if it has some global overrides
2103
- * ```jsx
2104
- * dateLibInstance={momentTimeZone}
2105
- * ```
2106
- */
2107
- dateLibInstance: import_prop_types.default.any,
2108
- /**
2109
- * Locale for components texts
2110
- */
2111
- localeText: import_prop_types.default.object
2112
- } : void 0;
2113
-
2114
- // node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
2115
- var React11 = __toESM(require("react"), 1);
2116
-
2117
- // node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js
2118
- var React10 = __toESM(require("react"), 1);
2119
- var useEnhancedEffect = typeof window !== "undefined" ? React10.useLayoutEffect : React10.useEffect;
2120
- var useEnhancedEffect_default = useEnhancedEffect;
2121
-
2122
- // node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
2123
- function useEventCallback2(fn) {
2124
- const ref = React11.useRef(fn);
2125
- useEnhancedEffect_default(() => {
2126
- ref.current = fn;
2127
- });
2128
- return React11.useRef((...args) => (
2129
- // @ts-expect-error hide `this`
2130
- (0, ref.current)(...args)
2131
- )).current;
2132
- }
2133
- var useEventCallback_default = useEventCallback2;
2134
-
2135
- // node_modules/@mui/x-internals/esm/warning/warning.js
2136
- var warnedOnceCache = /* @__PURE__ */ new Set();
2137
- function warnOnce(message, gravity = "warning") {
2138
- if (process.env.NODE_ENV === "production") {
2139
- return;
2140
- }
2141
- const cleanMessage = Array.isArray(message) ? message.join("\n") : message;
2142
- if (!warnedOnceCache.has(cleanMessage)) {
2143
- warnedOnceCache.add(cleanMessage);
2144
- if (gravity === "error") {
2145
- console.error(cleanMessage);
2146
- } else {
2147
- console.warn(cleanMessage);
2148
- }
2149
- }
2150
- }
2151
-
2152
- // node_modules/@mui/x-date-pickers/esm/AdapterDayjs/AdapterDayjs.js
2153
- var import_dayjs = __toESM(require("dayjs"), 1);
2154
- var import_weekOfYear = __toESM(require("dayjs/plugin/weekOfYear.js"), 1);
2155
- var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.js"), 1);
2156
- var import_localizedFormat = __toESM(require("dayjs/plugin/localizedFormat.js"), 1);
2157
- var import_isBetween = __toESM(require("dayjs/plugin/isBetween.js"), 1);
2158
- var import_advancedFormat = __toESM(require("dayjs/plugin/advancedFormat.js"), 1);
2159
- import_dayjs.default.extend(import_localizedFormat.default);
2160
- import_dayjs.default.extend(import_weekOfYear.default);
2161
- import_dayjs.default.extend(import_isBetween.default);
2162
- import_dayjs.default.extend(import_advancedFormat.default);
2163
- var formatTokenMap = {
2164
- // Year
2165
- YY: "year",
2166
- YYYY: {
2167
- sectionType: "year",
2168
- contentType: "digit",
2169
- maxLength: 4
2170
- },
2171
- // Month
2172
- M: {
2173
- sectionType: "month",
2174
- contentType: "digit",
2175
- maxLength: 2
2176
- },
2177
- MM: "month",
2178
- MMM: {
2179
- sectionType: "month",
2180
- contentType: "letter"
2181
- },
2182
- MMMM: {
2183
- sectionType: "month",
2184
- contentType: "letter"
2185
- },
2186
- // Day of the month
2187
- D: {
2188
- sectionType: "day",
2189
- contentType: "digit",
2190
- maxLength: 2
2191
- },
2192
- DD: "day",
2193
- Do: {
2194
- sectionType: "day",
2195
- contentType: "digit-with-letter"
2196
- },
2197
- // Day of the week
2198
- d: {
2199
- sectionType: "weekDay",
2200
- contentType: "digit",
2201
- maxLength: 2
2202
- },
2203
- dd: {
2204
- sectionType: "weekDay",
2205
- contentType: "letter"
2206
- },
2207
- ddd: {
2208
- sectionType: "weekDay",
2209
- contentType: "letter"
2210
- },
2211
- dddd: {
2212
- sectionType: "weekDay",
2213
- contentType: "letter"
2214
- },
2215
- // Meridiem
2216
- A: "meridiem",
2217
- a: "meridiem",
2218
- // Hours
2219
- H: {
2220
- sectionType: "hours",
2221
- contentType: "digit",
2222
- maxLength: 2
2223
- },
2224
- HH: "hours",
2225
- h: {
2226
- sectionType: "hours",
2227
- contentType: "digit",
2228
- maxLength: 2
2229
- },
2230
- hh: "hours",
2231
- // Minutes
2232
- m: {
2233
- sectionType: "minutes",
2234
- contentType: "digit",
2235
- maxLength: 2
2236
- },
2237
- mm: "minutes",
2238
- // Seconds
2239
- s: {
2240
- sectionType: "seconds",
2241
- contentType: "digit",
2242
- maxLength: 2
2243
- },
2244
- ss: "seconds"
2245
- };
2246
- var defaultFormats = {
2247
- year: "YYYY",
2248
- month: "MMMM",
2249
- monthShort: "MMM",
2250
- dayOfMonth: "D",
2251
- dayOfMonthFull: "Do",
2252
- weekday: "dddd",
2253
- weekdayShort: "dd",
2254
- hours24h: "HH",
2255
- hours12h: "hh",
2256
- meridiem: "A",
2257
- minutes: "mm",
2258
- seconds: "ss",
2259
- fullDate: "ll",
2260
- keyboardDate: "L",
2261
- shortDate: "MMM D",
2262
- normalDate: "D MMMM",
2263
- normalDateWithWeekday: "ddd, MMM D",
2264
- fullTime12h: "hh:mm A",
2265
- fullTime24h: "HH:mm",
2266
- keyboardDateTime12h: "L hh:mm A",
2267
- keyboardDateTime24h: "L HH:mm"
2268
- };
2269
- var MISSING_UTC_PLUGIN = ["Missing UTC plugin", "To be able to use UTC or timezones, you have to enable the `utc` plugin", "Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join("\n");
2270
- var MISSING_TIMEZONE_PLUGIN = ["Missing timezone plugin", "To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin", "Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join("\n");
2271
- var AdapterDayjs = class {
2272
- isMUIAdapter = true;
2273
- isTimezoneCompatible = true;
2274
- lib = "dayjs";
2275
- escapedCharacters = {
2276
- start: "[",
2277
- end: "]"
2278
- };
2279
- formatTokenMap = /* @__PURE__ */ (() => formatTokenMap)();
2280
- constructor({
2281
- locale,
2282
- formats
2283
- } = {}) {
2284
- this.locale = locale;
2285
- this.formats = _extends({}, defaultFormats, formats);
2286
- import_dayjs.default.extend(import_customParseFormat.default);
2287
- }
2288
- setLocaleToValue = (value) => {
2289
- const expectedLocale = this.getCurrentLocaleCode();
2290
- if (expectedLocale === value.locale()) {
2291
- return value;
2292
- }
2293
- return value.locale(expectedLocale);
2294
- };
2295
- hasUTCPlugin = () => typeof import_dayjs.default.utc !== "undefined";
2296
- hasTimezonePlugin = () => typeof import_dayjs.default.tz !== "undefined";
2297
- isSame = (value, comparing, comparisonTemplate) => {
2298
- const comparingInValueTimezone = this.setTimezone(comparing, this.getTimezone(value));
2299
- return value.format(comparisonTemplate) === comparingInValueTimezone.format(comparisonTemplate);
2300
- };
2301
- /**
2302
- * Replaces "default" by undefined and "system" by the system timezone before passing it to `dayjs`.
2303
- */
2304
- cleanTimezone = (timezone) => {
2305
- switch (timezone) {
2306
- case "default": {
2307
- return void 0;
2308
- }
2309
- case "system": {
2310
- return import_dayjs.default.tz.guess();
2311
- }
2312
- default: {
2313
- return timezone;
2314
- }
2315
- }
2316
- };
2317
- createSystemDate = (value) => {
2318
- let date;
2319
- if (this.hasUTCPlugin() && this.hasTimezonePlugin()) {
2320
- const timezone = import_dayjs.default.tz.guess();
2321
- if (timezone === "UTC") {
2322
- date = (0, import_dayjs.default)(value);
2323
- } else {
2324
- date = import_dayjs.default.tz(value, timezone);
2325
- }
2326
- } else {
2327
- date = (0, import_dayjs.default)(value);
2328
- }
2329
- return this.setLocaleToValue(date);
2330
- };
2331
- createUTCDate = (value) => {
2332
- if (!this.hasUTCPlugin()) {
2333
- throw new Error(MISSING_UTC_PLUGIN);
2334
- }
2335
- return this.setLocaleToValue(import_dayjs.default.utc(value));
2336
- };
2337
- createTZDate = (value, timezone) => {
2338
- if (!this.hasUTCPlugin()) {
2339
- throw new Error(MISSING_UTC_PLUGIN);
2340
- }
2341
- if (!this.hasTimezonePlugin()) {
2342
- throw new Error(MISSING_TIMEZONE_PLUGIN);
2343
- }
2344
- const keepLocalTime = value !== void 0 && !value.endsWith("Z");
2345
- return this.setLocaleToValue((0, import_dayjs.default)(value).tz(this.cleanTimezone(timezone), keepLocalTime));
2346
- };
2347
- getLocaleFormats = () => {
2348
- const locales = import_dayjs.default.Ls;
2349
- const locale = this.locale || "en";
2350
- let localeObject = locales[locale];
2351
- if (localeObject === void 0) {
2352
- if (process.env.NODE_ENV !== "production") {
2353
- warnOnce(["MUI X: Your locale has not been found.", "Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale.", "Or you forget to import the locale from 'dayjs/locale/{localeUsed}'", "fallback on English locale."]);
2354
- }
2355
- localeObject = locales.en;
2356
- }
2357
- return localeObject.formats;
2358
- };
2359
- /**
2360
- * If the new day does not have the same offset as the old one (when switching to summer day time for example),
2361
- * Then dayjs will not automatically adjust the offset (moment does).
2362
- * We have to parse again the value to make sure the `fixOffset` method is applied.
2363
- * See https://github.com/iamkun/dayjs/blob/b3624de619d6e734cd0ffdbbd3502185041c1b60/src/plugin/timezone/index.js#L72
2364
- */
2365
- adjustOffset = (value) => {
2366
- if (!this.hasTimezonePlugin()) {
2367
- return value;
2368
- }
2369
- const timezone = this.getTimezone(value);
2370
- if (timezone !== "UTC") {
2371
- const fixedValue = value.tz(this.cleanTimezone(timezone), true);
2372
- if (fixedValue.$offset === (value.$offset ?? 0)) {
2373
- return value;
2374
- }
2375
- value.$offset = fixedValue.$offset;
2376
- }
2377
- return value;
2378
- };
2379
- date = (value, timezone = "default") => {
2380
- if (value === null) {
2381
- return null;
2382
- }
2383
- if (timezone === "UTC") {
2384
- return this.createUTCDate(value);
2385
- }
2386
- if (timezone === "system" || timezone === "default" && !this.hasTimezonePlugin()) {
2387
- return this.createSystemDate(value);
2388
- }
2389
- return this.createTZDate(value, timezone);
2390
- };
2391
- getInvalidDate = () => (0, import_dayjs.default)(/* @__PURE__ */ new Date("Invalid date"));
2392
- getTimezone = (value) => {
2393
- if (this.hasTimezonePlugin()) {
2394
- const zone = value.$x?.$timezone;
2395
- if (zone) {
2396
- return zone;
2397
- }
2398
- }
2399
- if (this.hasUTCPlugin() && value.isUTC()) {
2400
- return "UTC";
2401
- }
2402
- return "system";
2403
- };
2404
- setTimezone = (value, timezone) => {
2405
- if (this.getTimezone(value) === timezone) {
2406
- return value;
2407
- }
2408
- if (timezone === "UTC") {
2409
- if (!this.hasUTCPlugin()) {
2410
- throw new Error(MISSING_UTC_PLUGIN);
2411
- }
2412
- return value.utc();
2413
- }
2414
- if (timezone === "system") {
2415
- return value.local();
2416
- }
2417
- if (!this.hasTimezonePlugin()) {
2418
- if (timezone === "default") {
2419
- return value;
2420
- }
2421
- throw new Error(MISSING_TIMEZONE_PLUGIN);
2422
- }
2423
- return this.setLocaleToValue(import_dayjs.default.tz(value, this.cleanTimezone(timezone)));
2424
- };
2425
- toJsDate = (value) => {
2426
- return value.toDate();
2427
- };
2428
- parse = (value, format) => {
2429
- if (value === "") {
2430
- return null;
2431
- }
2432
- return (0, import_dayjs.default)(value, format, this.locale, true);
2433
- };
2434
- getCurrentLocaleCode = () => {
2435
- return this.locale || "en";
2436
- };
2437
- is12HourCycleInCurrentLocale = () => {
2438
- return /A|a/.test(this.getLocaleFormats().LT || "");
2439
- };
2440
- expandFormat = (format) => {
2441
- const localeFormats = this.getLocaleFormats();
2442
- const t2 = (formatBis) => formatBis.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (_, a, b) => a || b.slice(1));
2443
- return format.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (_, a, b) => {
2444
- const B = b && b.toUpperCase();
2445
- return a || localeFormats[b] || t2(localeFormats[B]);
2446
- });
2447
- };
2448
- isValid = (value) => {
2449
- if (value == null) {
2450
- return false;
2451
- }
2452
- return value.isValid();
2453
- };
2454
- format = (value, formatKey) => {
2455
- return this.formatByString(value, this.formats[formatKey]);
2456
- };
2457
- formatByString = (value, formatString) => {
2458
- return this.setLocaleToValue(value).format(formatString);
2459
- };
2460
- formatNumber = (numberToFormat) => {
2461
- return numberToFormat;
2462
- };
2463
- isEqual = (value, comparing) => {
2464
- if (value === null && comparing === null) {
2465
- return true;
2466
- }
2467
- if (value === null || comparing === null) {
2468
- return false;
2469
- }
2470
- return value.toDate().getTime() === comparing.toDate().getTime();
2471
- };
2472
- isSameYear = (value, comparing) => {
2473
- return this.isSame(value, comparing, "YYYY");
2474
- };
2475
- isSameMonth = (value, comparing) => {
2476
- return this.isSame(value, comparing, "YYYY-MM");
2477
- };
2478
- isSameDay = (value, comparing) => {
2479
- return this.isSame(value, comparing, "YYYY-MM-DD");
2480
- };
2481
- isSameHour = (value, comparing) => {
2482
- return value.isSame(comparing, "hour");
2483
- };
2484
- isAfter = (value, comparing) => {
2485
- return value > comparing;
2486
- };
2487
- isAfterYear = (value, comparing) => {
2488
- if (!this.hasUTCPlugin()) {
2489
- return value.isAfter(comparing, "year");
2490
- }
2491
- return !this.isSameYear(value, comparing) && value.utc() > comparing.utc();
2492
- };
2493
- isAfterDay = (value, comparing) => {
2494
- if (!this.hasUTCPlugin()) {
2495
- return value.isAfter(comparing, "day");
2496
- }
2497
- return !this.isSameDay(value, comparing) && value.utc() > comparing.utc();
2498
- };
2499
- isBefore = (value, comparing) => {
2500
- return value < comparing;
2501
- };
2502
- isBeforeYear = (value, comparing) => {
2503
- if (!this.hasUTCPlugin()) {
2504
- return value.isBefore(comparing, "year");
2505
- }
2506
- return !this.isSameYear(value, comparing) && value.utc() < comparing.utc();
2507
- };
2508
- isBeforeDay = (value, comparing) => {
2509
- if (!this.hasUTCPlugin()) {
2510
- return value.isBefore(comparing, "day");
2511
- }
2512
- return !this.isSameDay(value, comparing) && value.utc() < comparing.utc();
2513
- };
2514
- isWithinRange = (value, [start, end]) => {
2515
- return value >= start && value <= end;
2516
- };
2517
- startOfYear = (value) => {
2518
- return this.adjustOffset(value.startOf("year"));
2519
- };
2520
- startOfMonth = (value) => {
2521
- return this.adjustOffset(value.startOf("month"));
2522
- };
2523
- startOfWeek = (value) => {
2524
- return this.adjustOffset(this.setLocaleToValue(value).startOf("week"));
2525
- };
2526
- startOfDay = (value) => {
2527
- return this.adjustOffset(value.startOf("day"));
2528
- };
2529
- endOfYear = (value) => {
2530
- return this.adjustOffset(value.endOf("year"));
2531
- };
2532
- endOfMonth = (value) => {
2533
- return this.adjustOffset(value.endOf("month"));
2534
- };
2535
- endOfWeek = (value) => {
2536
- return this.adjustOffset(this.setLocaleToValue(value).endOf("week"));
2537
- };
2538
- endOfDay = (value) => {
2539
- return this.adjustOffset(value.endOf("day"));
2540
- };
2541
- addYears = (value, amount) => {
2542
- return this.adjustOffset(value.add(amount, "year"));
2543
- };
2544
- addMonths = (value, amount) => {
2545
- return this.adjustOffset(value.add(amount, "month"));
2546
- };
2547
- addWeeks = (value, amount) => {
2548
- return this.adjustOffset(value.add(amount, "week"));
2549
- };
2550
- addDays = (value, amount) => {
2551
- return this.adjustOffset(value.add(amount, "day"));
2552
- };
2553
- addHours = (value, amount) => {
2554
- return this.adjustOffset(value.add(amount, "hour"));
2555
- };
2556
- addMinutes = (value, amount) => {
2557
- return this.adjustOffset(value.add(amount, "minute"));
2558
- };
2559
- addSeconds = (value, amount) => {
2560
- return this.adjustOffset(value.add(amount, "second"));
2561
- };
2562
- getYear = (value) => {
2563
- return value.year();
2564
- };
2565
- getMonth = (value) => {
2566
- return value.month();
2567
- };
2568
- getDate = (value) => {
2569
- return value.date();
2570
- };
2571
- getHours = (value) => {
2572
- return value.hour();
2573
- };
2574
- getMinutes = (value) => {
2575
- return value.minute();
2576
- };
2577
- getSeconds = (value) => {
2578
- return value.second();
2579
- };
2580
- getMilliseconds = (value) => {
2581
- return value.millisecond();
2582
- };
2583
- setYear = (value, year) => {
2584
- return this.adjustOffset(value.set("year", year));
2585
- };
2586
- setMonth = (value, month) => {
2587
- return this.adjustOffset(value.set("month", month));
2588
- };
2589
- setDate = (value, date) => {
2590
- return this.adjustOffset(value.set("date", date));
2591
- };
2592
- setHours = (value, hours) => {
2593
- return this.adjustOffset(value.set("hour", hours));
2594
- };
2595
- setMinutes = (value, minutes) => {
2596
- return this.adjustOffset(value.set("minute", minutes));
2597
- };
2598
- setSeconds = (value, seconds) => {
2599
- return this.adjustOffset(value.set("second", seconds));
2600
- };
2601
- setMilliseconds = (value, milliseconds) => {
2602
- return this.adjustOffset(value.set("millisecond", milliseconds));
2603
- };
2604
- getDaysInMonth = (value) => {
2605
- return value.daysInMonth();
2606
- };
2607
- getWeekArray = (value) => {
2608
- const start = this.startOfWeek(this.startOfMonth(value));
2609
- const end = this.endOfWeek(this.endOfMonth(value));
2610
- let count = 0;
2611
- let current = start;
2612
- const nestedWeeks = [];
2613
- while (current < end) {
2614
- const weekNumber = Math.floor(count / 7);
2615
- nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];
2616
- nestedWeeks[weekNumber].push(current);
2617
- current = this.addDays(current, 1);
2618
- count += 1;
2619
- }
2620
- return nestedWeeks;
2621
- };
2622
- getWeekNumber = (value) => {
2623
- return value.week();
2624
- };
2625
- getDayOfWeek(value) {
2626
- return value.day() + 1;
2627
- }
2628
- getYearRange = ([start, end]) => {
2629
- const startDate = this.startOfYear(start);
2630
- const endDate = this.endOfYear(end);
2631
- const years = [];
2632
- let current = startDate;
2633
- while (this.isBefore(current, endDate)) {
2634
- years.push(current);
2635
- current = this.addYears(current, 1);
2636
- }
2637
- return years;
2638
- };
2639
- };
2640
-
2641
- // src/providers/LayoutProvider.tsx
2642
- var import_react21 = require("react");
2643
- var import_react_i18next8 = require("react-i18next");
2644
- var z = __toESM(require("zod"), 1);
2645
- var import_locales3 = require("zod/locales");
2646
-
2647
- // src/providers/DialogsProvider.tsx
2648
- var import_react16 = require("react");
2649
- var import_jsx_runtime23 = require("react/jsx-runtime");
2650
- function DialogsProvider({ children, unmountAfter = 1e3 }) {
2651
- const [stack, setStack] = (0, import_react16.useState)([]);
2652
- const keyPrefix = (0, import_react16.useId)();
2653
- const nextId = (0, import_react16.useRef)(0);
2654
- const dialogMetadata = (0, import_react16.useRef)(/* @__PURE__ */ new WeakMap());
2655
- const requestDialog = useEventCallback_default(function open(Component7, payload, options = {}) {
2656
- const { onClose = async () => {
2657
- } } = options;
2658
- let resolve;
2659
- const promise = new Promise((resolveImpl) => {
2660
- resolve = resolveImpl;
2661
- });
2662
- const key = `${keyPrefix}-${nextId.current}`;
2663
- nextId.current += 1;
2664
- const newEntry = {
2665
- key,
2666
- open: true,
2667
- promise,
2668
- Component: Component7,
2669
- payload,
2670
- onClose,
2671
- resolve
2672
- };
2673
- dialogMetadata.current.set(promise, newEntry);
2674
- setStack((previousStack) => [...previousStack, newEntry]);
2675
- return promise;
2676
- });
2677
- const removeDialogFromStack = (0, import_react16.useCallback)((dialog) => {
2678
- setStack((previousStack) => previousStack.filter((entry) => entry.promise !== dialog));
2679
- dialogMetadata.current.delete(dialog);
2680
- }, []);
2681
- const closeDialogUi = useEventCallback_default(function closeDialogUi2(dialog) {
2682
- setStack(
2683
- (previousStack) => previousStack.map((entry) => entry.promise === dialog ? { ...entry, open: false } : entry)
2684
- );
2685
- setTimeout(() => removeDialogFromStack(dialog), unmountAfter);
2686
- });
2687
- const closeDialog = useEventCallback_default(async function closeDialog2(dialog, result) {
2688
- const entryToClose = dialogMetadata.current.get(dialog);
2689
- if (!entryToClose) {
2690
- throw new Error("Dialog not found in stack");
2691
- }
2692
- try {
2693
- await entryToClose.onClose(result);
2694
- } finally {
2695
- entryToClose.resolve(result);
2696
- closeDialogUi(dialog);
2697
- }
2698
- return dialog;
2699
- });
2700
- const contextValue = (0, import_react16.useMemo)(() => ({ open: requestDialog, close: closeDialog }), [requestDialog, closeDialog]);
2701
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(DialogsContext.Provider, { value: contextValue, children: [
2702
- children,
2703
- stack.map(({ key, open, Component: Component7, payload, promise }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2704
- Component7,
2705
- {
2706
- payload,
2707
- open,
2708
- onClose: async (result) => {
2709
- await closeDialog(promise, result);
2710
- }
2711
- },
2712
- key
2713
- ))
2714
- ] });
2715
- }
2716
-
2717
- // src/utils/i18n.ts
2718
- var import_react_start = require("@tanstack/react-start");
2719
- var import_server = require("@tanstack/react-start/server");
2720
- var import_i18next = __toESM(require("i18next"), 1);
2721
- var import_i18next_browser_languagedetector = __toESM(require("i18next-browser-languagedetector"), 1);
2722
- var import_i18next_http_backend = __toESM(require("i18next-http-backend"), 1);
2723
- var import_react_i18next5 = require("react-i18next");
2724
- var import_i18next2 = __toESM(require("i18next"), 1);
2725
- var i18nCookieName = "i18nextLng";
2726
- import_i18next.default.use(import_i18next_http_backend.default).use(import_i18next_browser_languagedetector.default).use(import_react_i18next5.initReactI18next).init({
2727
- fallbackLng: "en",
2728
- detection: {
2729
- order: ["cookie"],
2730
- lookupCookie: i18nCookieName,
2731
- caches: ["cookie"],
2732
- cookieMinutes: 60 * 24 * 365
2733
- },
2734
- interpolation: { escapeValue: false }
2735
- });
2736
- var setSSRLanguage = (0, import_react_start.createIsomorphicFn)().server(async () => {
2737
- const language = (0, import_server.getCookie)(i18nCookieName);
2738
- await import_i18next.default.changeLanguage(language || "en");
2739
- });
2740
-
2741
- // src/contexts/LayoutContext.ts
2742
- var import_react17 = require("react");
2743
- var LayoutContext = (0, import_react17.createContext)(null);
2744
-
2745
- // src/components/core/Layout.tsx
2746
- var import_Menu = __toESM(require("@mui/icons-material/Menu"), 1);
2747
- var import_MenuOpen = __toESM(require("@mui/icons-material/MenuOpen"), 1);
2748
- var import_material23 = require("@mui/material");
2749
- var import_styles4 = require("@mui/material/styles");
2750
- var import_react_query2 = require("@tanstack/react-query");
2751
- var import_use_local_storage_state = __toESM(require("use-local-storage-state"), 1);
2752
-
2753
- // src/components/core/navigation/NavigationRail.tsx
2754
- var import_material20 = require("@mui/material");
2755
- var import_Box2 = __toESM(require("@mui/material/Box"), 1);
2756
- var import_Drawer = __toESM(require("@mui/material/Drawer"), 1);
2757
- var import_styles3 = require("@mui/material/styles");
2758
- var import_react_router8 = require("@tanstack/react-router");
2759
-
2760
- // src/components/core/navigation/NavigationList.tsx
2761
- var import_Divider = __toESM(require("@mui/material/Divider"), 1);
2762
- var import_List = __toESM(require("@mui/material/List"), 1);
2763
- var import_ListSubheader = __toESM(require("@mui/material/ListSubheader"), 1);
2764
- var import_react19 = require("react");
2765
-
2766
- // src/components/core/navigation/NavigationListItem.tsx
2767
- var import_ExpandMore = __toESM(require("@mui/icons-material/ExpandMore"), 1);
2768
- var import_Avatar = __toESM(require("@mui/material/Avatar"), 1);
2769
- var import_Box = __toESM(require("@mui/material/Box"), 1);
2770
- var import_Popper = __toESM(require("@mui/material/Popper"), 1);
2771
- var import_ListItem = __toESM(require("@mui/material/ListItem"), 1);
2772
- var import_ListItemButton = __toESM(require("@mui/material/ListItemButton"), 1);
2773
- var import_ListItemIcon = __toESM(require("@mui/material/ListItemIcon"), 1);
2774
- var import_ListItemText = __toESM(require("@mui/material/ListItemText"), 1);
2775
- var import_Paper = __toESM(require("@mui/material/Paper"), 1);
2776
- var import_styles2 = require("@mui/material/styles");
2777
- var import_Typography = __toESM(require("@mui/material/Typography"), 1);
2778
- var import_react18 = require("react");
2779
- var import_material19 = require("@mui/material");
2780
- var import_jsx_runtime24 = require("react/jsx-runtime");
2781
- var ICON_SIZE = 34;
2782
- var StyledNavButton = (0, import_styles2.styled)(import_ListItemButton.default)(({ theme }) => ({
2783
- borderRadius: 8,
2784
- "&.Mui-selected": {
2785
- "& .MuiListItemIcon-root, & .MuiTypography-root, & .MuiSvgIcon-root": {
2786
- color: (theme.vars ?? theme).palette.primary.dark
2787
- },
2788
- "& .MuiAvatar-root": {
2789
- backgroundColor: (theme.vars ?? theme).palette.primary.dark
2790
- },
2791
- "& .MuiTouchRipple-child": {
2792
- backgroundColor: (theme.vars ?? theme).palette.primary.dark
2793
- }
2794
- },
2795
- "& .MuiSvgIcon-root": {
2796
- color: (theme.vars ?? theme).palette.action.active
2797
- },
2798
- "& .MuiAvatar-root": {
2799
- backgroundColor: (theme.vars ?? theme).palette.action.active
2800
- }
2801
- }));
2802
- var StyledRouterButton = (0, import_styles2.styled)(RouterListItemButton)(({ theme }) => ({
2803
- borderRadius: 8,
2804
- "&.Mui-selected": {
2805
- "& .MuiListItemIcon-root, & .MuiTypography-root, & .MuiSvgIcon-root": {
2806
- color: (theme.vars ?? theme).palette.primary.dark
2807
- },
2808
- "& .MuiAvatar-root": {
2809
- backgroundColor: (theme.vars ?? theme).palette.primary.dark
2810
- },
2811
- "& .MuiTouchRipple-child": {
2812
- backgroundColor: (theme.vars ?? theme).palette.primary.dark
2813
- }
2814
- },
2815
- "& .MuiSvgIcon-root": {
2816
- color: (theme.vars ?? theme).palette.action.active
2817
- },
2818
- "& .MuiAvatar-root": {
2819
- backgroundColor: (theme.vars ?? theme).palette.action.active
2820
- }
2821
- }));
2822
- var IconOrAvatar = ({ item, collapsed }) => {
2823
- if (item.icon || collapsed) {
2824
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_Box.default, { sx: collapsed ? { position: "absolute", left: "50%", top: "calc(50% - 6px)", transform: "translate(-50%, -50%)" } : {}, children: [
2825
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_ListItemIcon.default, { sx: { display: "flex", alignItems: "center", justifyContent: "center", minWidth: ICON_SIZE }, children: [
2826
- item.icon ?? null,
2827
- !item.icon && collapsed ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_Avatar.default, { sx: { width: ICON_SIZE - 7, height: ICON_SIZE - 7, fontSize: 12 }, children: item.title }) : null
2828
- ] }),
2829
- collapsed ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2830
- import_Typography.default,
2831
- {
2832
- variant: "caption",
2833
- sx: {
2834
- position: "absolute",
2835
- bottom: -18,
2836
- left: "50%",
2837
- transform: "translateX(-50%)",
2838
- fontSize: 10,
2839
- fontWeight: 500,
2840
- textAlign: "center",
2841
- whiteSpace: "nowrap",
2842
- overflow: "hidden",
2843
- textOverflow: "ellipsis",
2844
- maxWidth: MINI_WIDTH - 28
2845
- },
2846
- children: item.title
2847
- }
2848
- ) : null
2849
- ] });
2850
- }
2851
- return null;
2852
- };
2853
- var MiniPopover = ({ open, anchorEl, children }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2854
- import_Popper.default,
2855
- {
2856
- open,
2857
- anchorEl,
2858
- placement: "right-start",
2859
- modifiers: [
2860
- { name: "offset", options: { offset: [6, 0] } },
2861
- { name: "preventOverflow", options: { padding: 8 } },
2862
- { name: "flip", options: { fallbackPlacements: ["right-end", "left-start"] } }
2863
- ],
2864
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2865
- import_Paper.default,
2866
- {
2867
- sx: {
2868
- pt: 0.5,
2869
- pb: 0.5,
2870
- maxHeight: "min(calc(100vh - 100px), 560px)",
2871
- overflowY: "auto",
2872
- overscrollBehavior: "contain"
2873
- },
2874
- children
2875
- }
2876
- )
2877
- }
2878
- );
2879
- var NavigationListItem = ({ item, isOpen, selected, disabled, collapsed, isSidebarFullyExpanded = true, isSidebarFullyCollapsed, onClick, renderNested }) => {
2880
- const [hoveredPopoverItem, setHoveredPopoverItem] = (0, import_react18.useState)(null);
2881
- const [anchorElement, setAnchorElement] = (0, import_react18.useState)(null);
2882
- const chevronSx = (0, import_react18.useMemo)(() => {
2883
- if (collapsed && isSidebarFullyCollapsed && item.children) {
2884
- return {
2885
- fontSize: 18,
2886
- position: "absolute",
2887
- top: "41.5%",
2888
- right: "2px",
2889
- transform: "translateY(-50%) rotate(-90deg)"
2890
- };
2891
- }
2892
- if (!collapsed && isSidebarFullyExpanded && item.children) {
2893
- return {
2894
- ml: 0.5,
2895
- transform: `rotate(${isOpen ? 0 : -90}deg)`
2896
- };
2897
- }
2898
- return { display: "none" };
2899
- }, [collapsed, isSidebarFullyExpanded, isSidebarFullyCollapsed, isOpen, item.children]);
2900
- const shouldJustExpand = item.children && !collapsed;
2901
- const buttonProps = {
2902
- selected,
2903
- disabled,
2904
- sx: { px: 1.4, height: collapsed ? 60 : 48 }
2905
- };
2906
- const buttonContent = /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
2907
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconOrAvatar, { item, collapsed }),
2908
- !collapsed && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2909
- import_ListItemText.default,
2910
- {
2911
- primary: item.title,
2912
- slotProps: { primary: { noWrap: true, title: item.title } },
2913
- sx: { ml: 1.2, flex: 1, minWidth: 0, "& .MuiTypography-root": { whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }
2914
- }
2915
- ),
2916
- item.children ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_ExpandMore.default, { sx: chevronSx }) : null
2917
- ] });
2918
- const listItem = /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2919
- import_ListItem.default,
2920
- {
2921
- ...item.children && collapsed ? {
2922
- onMouseEnter: (event) => {
2923
- setAnchorElement(event.currentTarget);
2924
- setHoveredPopoverItem(item.title);
2925
- },
2926
- onMouseLeave: () => {
2927
- setHoveredPopoverItem(null);
2928
- }
2929
- } : {},
2930
- sx: { py: 0, px: 1, overflowX: "hidden" },
2931
- children: [
2932
- shouldJustExpand ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(StyledNavButton, { ...buttonProps, onClick: () => onClick?.(item), children: buttonContent }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2933
- StyledRouterButton,
2934
- {
2935
- ...buttonProps,
2936
- to: item.to,
2937
- href: item.href,
2938
- params: item.params,
2939
- search: item.search,
2940
- children: buttonContent
2941
- }
2942
- ),
2943
- item.children && collapsed ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(MiniPopover, { open: item.title === hoveredPopoverItem, anchorEl: anchorElement, children: renderNested?.(item.children) }) : null
2944
- ]
2945
- }
2946
- );
2947
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react18.Fragment, { children: [
2948
- listItem,
2949
- item.children && !collapsed ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: renderNested?.(item.children) }) : null
2950
- ] }, item.to);
2951
- };
2952
-
2953
- // src/components/core/navigation/NavigationList.tsx
2954
- var import_jsx_runtime25 = require("react/jsx-runtime");
2955
- var isPageItem = (item) => !("kind" in item);
2956
- var isDivider = (item) => "kind" in item && item.kind === "divider";
2957
- var isHeader = (item) => "kind" in item && item.kind === "header";
2958
- var NavigationList = ({ subNavigation, depth = 0, collapsed, isPopover, isSidebarFullyExpanded = true, isSidebarFullyCollapsed, expandedWidth, renderItem, activePath, onNavigate }) => {
2959
- const [openKeys, setOpenKeys] = (0, import_react19.useState)([]);
2960
- (0, import_react19.useEffect)(() => {
2961
- if (collapsed) setOpenKeys([]);
2962
- }, [collapsed]);
2963
- const toggleKey = (key) => setOpenKeys((previous) => previous.includes(key) ? previous.filter((k) => k !== key) : [...previous, key]);
2964
- const renderNested = (children) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2965
- NavigationList,
2966
- {
2967
- subNavigation: children,
2968
- depth: depth + 1,
2969
- isPopover: collapsed,
2970
- expandedWidth,
2971
- activePath,
2972
- onNavigate
2973
- }
2974
- );
2975
- const filteredNavigation = subNavigation.filter((nav) => !nav.hidden);
2976
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2977
- import_List.default,
2978
- {
2979
- sx: {
2980
- padding: 0,
2981
- mt: isPopover && depth === 1 ? 0.5 : 0,
2982
- mb: depth === 0 && !isPopover ? 4 : 0.5,
2983
- pl: (isPopover ? 1 : 2) * (isPopover ? depth - 1 : depth),
2984
- minWidth: isPopover && depth === 1 ? EXPANDED_WIDTH : "auto",
2985
- width: collapsed ? MINI_WIDTH : "auto"
2986
- },
2987
- children: filteredNavigation.map((navItem, index) => {
2988
- if (isHeader(navItem)) {
2989
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2990
- import_ListSubheader.default,
2991
- {
2992
- sx: {
2993
- fontSize: 12,
2994
- fontWeight: "700",
2995
- height: collapsed ? 0 : 40,
2996
- px: 2,
2997
- minWidth: expandedWidth,
2998
- overflow: "hidden",
2999
- textOverflow: "ellipsis",
3000
- whiteSpace: "nowrap",
3001
- zIndex: 2,
3002
- bgcolor: "transparent",
3003
- position: "static"
3004
- },
3005
- children: navItem.title
3006
- },
3007
- `subheader-${depth}-${index}`
3008
- );
3009
- }
3010
- if (isDivider(navItem)) {
3011
- const nextItem = filteredNavigation[index + 1];
3012
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_Divider.default, { sx: { mx: 1, mt: 1, mb: isHeader(nextItem) && !collapsed ? 0 : 1 } }) }, `divider-${depth}-${index}`);
3013
- }
3014
- if (!isPageItem(navItem)) return null;
3015
- const key = `item-${depth}-${index}`;
3016
- const uniqueItemKey = `${depth}-${index}-${navItem.title}`;
3017
- if (renderItem) return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react19.Fragment, { children: renderItem(navItem, { collapsed: !!collapsed }) }, key);
3018
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3019
- NavigationListItem,
3020
- {
3021
- item: navItem,
3022
- isOpen: openKeys.includes(uniqueItemKey),
3023
- selected: activePath === navItem.to,
3024
- collapsed,
3025
- isSidebarFullyExpanded,
3026
- isSidebarFullyCollapsed,
3027
- onClick: navItem.children && !collapsed ? () => toggleKey(uniqueItemKey) : void 0,
3028
- renderNested
3029
- },
3030
- key
3031
- );
3032
- })
3033
- }
3034
- );
3035
- };
3036
-
3037
- // src/components/core/navigation/NavigationRail.tsx
3038
- var import_jsx_runtime26 = require("react/jsx-runtime");
3039
- var MINI_WIDTH = 84;
3040
- var EXPANDED_WIDTH = 320;
3041
- var TOOLBAR_HEIGHT = 65;
3042
- var NavigationRail = ({ navigation, expanded, setExpanded }) => {
3043
- const navigate = (0, import_react_router8.useNavigate)();
3044
- const routerState = (0, import_react_router8.useRouterState)();
3045
- const theme = (0, import_styles3.useTheme)();
3046
- const showPermanent = (0, import_material20.useMediaQuery)(theme.breakpoints.up("sm"));
3047
- const drawerContent = (collapsed) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3048
- import_Box2.default,
3049
- {
3050
- component: "nav",
3051
- sx: {
3052
- height: "100%",
3053
- display: "flex",
3054
- flexDirection: "column",
3055
- justifyContent: "space-between",
3056
- overflow: "auto",
3057
- scrollbarGutter: collapsed ? "stable" : "auto",
3058
- overflowX: "hidden",
3059
- pt: navigation[0] && isHeader(navigation[0]) && !collapsed ? 0 : 2
3060
- },
3061
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3062
- NavigationList,
3063
- {
3064
- subNavigation: navigation,
3065
- collapsed,
3066
- isSidebarFullyExpanded: expanded,
3067
- isSidebarFullyCollapsed: !expanded,
3068
- expandedWidth: EXPANDED_WIDTH,
3069
- activePath: routerState.location.pathname,
3070
- onNavigate: navigate
3071
- }
3072
- )
3073
- }
3074
- );
3075
- if (showPermanent)
3076
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3077
- import_Drawer.default,
3078
- {
3079
- variant: "permanent",
3080
- sx: {
3081
- width: expanded ? EXPANDED_WIDTH : MINI_WIDTH,
3082
- ["& .MuiDrawer-paper"]: {
3083
- position: "absolute",
3084
- top: `${TOOLBAR_HEIGHT}px`,
3085
- height: `calc(100% - ${TOOLBAR_HEIGHT}px)`,
3086
- width: expanded ? EXPANDED_WIDTH : MINI_WIDTH
3087
- }
3088
- },
3089
- children: drawerContent(!expanded)
3090
- }
3091
- );
3092
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_Drawer.default, { open: expanded, onClose: () => setExpanded(false), children: drawerContent(!expanded) });
3093
- };
3094
-
3095
- // src/components/core/ToolbarAccount.tsx
3096
- var import_AccountCircle = __toESM(require("@mui/icons-material/AccountCircle"), 1);
3097
- var import_ArrowBack = __toESM(require("@mui/icons-material/ArrowBack"), 1);
3098
- var import_Brightness4 = __toESM(require("@mui/icons-material/Brightness4"), 1);
3099
- var import_ChevronRight = __toESM(require("@mui/icons-material/ChevronRight"), 1);
3100
- var import_DarkMode = __toESM(require("@mui/icons-material/DarkMode"), 1);
3101
- var import_LightMode = __toESM(require("@mui/icons-material/LightMode"), 1);
3102
- var import_Login = __toESM(require("@mui/icons-material/Login"), 1);
3103
- var import_Logout = __toESM(require("@mui/icons-material/Logout"), 1);
3104
- var import_SettingsBrightness = __toESM(require("@mui/icons-material/SettingsBrightness"), 1);
3105
- var import_Translate = __toESM(require("@mui/icons-material/Translate"), 1);
3106
- var import_material21 = require("@mui/material");
3107
- var import_react20 = require("react");
3108
- var import_react_i18next6 = require("react-i18next");
3109
-
3110
- // src/auth-test/keycloak.ts
3111
- var import_react_router9 = require("@tanstack/react-router");
3112
- var import_keycloak_js = __toESM(require("keycloak-js"), 1);
3113
- var import_meta3 = {};
3114
- var keycloakConfig = {
3115
- url: import_meta3.env.VITE_KEYCLOAK_URL,
3116
- realm: import_meta3.env.VITE_KEYCLOAK_REALM,
3117
- clientId: import_meta3.env.VITE_KEYCLOAK_CLIENT_ID,
3118
- idpHint: import_meta3.env.VITE_KEYCLOAK_IDP_HINT,
3119
- confidentialClientId: import_meta3.env.VITE_KEYCLOAK_CONFIDENTIAL_CLIENT_ID,
3120
- confidentialClientSecret: import_meta3.env.VITE_KEYCLOAK_CONFIDENTIAL_CLIENT_SECRET
3121
- };
3122
- function useKeycloak() {
3123
- const routerContext = (0, import_react_router9.useRouter)();
3124
- const keycloak = routerContext.options.context.keycloak;
3125
- return keycloak;
3126
- }
3127
-
3128
- // src/components/core/ToolbarAccount.tsx
3129
- var import_jsx_runtime27 = require("react/jsx-runtime");
3130
- var ToolbarAccount = () => {
3131
- const [anchorElement, setAnchorElement] = (0, import_react20.useState)();
3132
- const [tab, setTab] = (0, import_react20.useState)("settings");
3133
- const open = Boolean(anchorElement);
3134
- const { t: t2, i18n: i18n2 } = (0, import_react_i18next6.useTranslation)();
3135
- const { mode, setMode } = (0, import_material21.useColorScheme)();
3136
- const changeLanguage = (newLanguage) => () => {
3137
- i18n2.changeLanguage(newLanguage).finally(() => closeMenu());
3138
- };
3139
- const changeMode = (newMode) => () => {
3140
- setMode(newMode);
3141
- closeMenu();
3142
- };
3143
- const keycloak = useKeycloak();
3144
- const user = keycloak.user;
3145
- const getModeText = () => {
3146
- switch (mode) {
3147
- case "light": {
3148
- return t2("Layout.Light");
3149
- }
3150
- case "dark": {
3151
- return t2("Layout.Dark");
3152
- }
3153
- default: {
3154
- return t2("Layout.System");
3155
- }
3156
- }
3157
- };
3158
- const usernameInitials = () => {
3159
- if (!user?.name) return "";
3160
- const splittedName = user.name.split(" ");
3161
- return `${splittedName[0][0]}${splittedName.length > 1 ? splittedName[1][0] : ""}`;
3162
- };
3163
- const openMenu = (event) => setAnchorElement(event.currentTarget);
3164
- const closeMenu = () => {
3165
- setAnchorElement(void 0);
3166
- setTimeout(() => setTab("settings"), 300);
3167
- };
3168
- const changeTab = (newTab) => () => setTab(newTab);
3169
- const settings = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material21.List, { component: "nav", subheader: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListSubheader, { sx: { backgroundColor: "transparent" }, children: t2("Layout.Settings") }), children: [
3170
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material21.ListItemButton, { onClick: changeTab("theme"), sx: { py: 0.3 }, children: [
3171
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_Brightness4.default, {}) }),
3172
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemText, { primary: t2("Layout.Appearance"), secondary: getModeText() }),
3173
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ChevronRight.default, {})
3174
- ] }),
3175
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material21.ListItemButton, { onClick: changeTab("language"), sx: { py: 0.3 }, children: [
3176
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_Translate.default, {}) }),
3177
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemText, { primary: t2("Layout.Language"), secondary: i18n2.resolvedLanguage === "en" ? "English" : "\u010Ce\u0161tina" }),
3178
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ChevronRight.default, {})
3179
- ] })
3180
- ] });
3181
- const theme = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material21.List, { subheader: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material21.ListSubheader, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
3182
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.IconButton, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ArrowBack.default, { fontSize: "small" }) }),
3183
- " ",
3184
- t2("Layout.Appearance")
3185
- ] }), children: [
3186
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material21.ListItemButton, { onClick: changeMode("light"), disabled: mode === "light", children: [
3187
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_LightMode.default, {}) }),
3188
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemText, { primary: t2("Layout.Light") })
3189
- ] }),
3190
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material21.ListItemButton, { onClick: changeMode("dark"), disabled: mode === "dark", children: [
3191
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_DarkMode.default, {}) }),
3192
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemText, { primary: t2("Layout.Dark") })
3193
- ] }),
3194
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material21.ListItemButton, { onClick: changeMode("system"), disabled: mode === "system", children: [
3195
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_SettingsBrightness.default, {}) }),
3196
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemText, { primary: t2("Layout.System") })
3197
- ] })
3198
- ] });
3199
- const language = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material21.List, { subheader: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material21.ListSubheader, { onClick: changeTab("settings"), sx: { backgroundColor: "transparent", display: "flex", alignItems: "center", px: 1, cursor: "pointer" }, children: [
3200
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.IconButton, { size: "small", sx: { mr: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ArrowBack.default, { fontSize: "small" }) }),
3201
- " ",
3202
- t2("Layout.Language")
3203
- ] }), children: [
3204
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemButton, { onClick: changeLanguage("en"), disabled: i18n2.resolvedLanguage === "en", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemText, { primary: "English" }) }),
3205
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemButton, { onClick: changeLanguage("cs"), disabled: i18n2.resolvedLanguage === "cs", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemText, { primary: "\u010Ce\u0161tina" }) })
3206
- ] });
3207
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react20.Fragment, { children: [
3208
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.IconButton, { size: "small", edge: "end", onClick: openMenu, children: user?.name ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.Avatar, { sx: { width: { xs: 32, sm: 40 }, height: { xs: 32, sm: 40 }, bgcolor: "primary.main" }, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.Typography, { variant: "subtitle2", sx: { fontWeight: "bold", lineHeight: 0 }, children: usernameInitials() }) }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_AccountCircle.default, { fontSize: "large" }) }),
3209
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.Menu, { anchorEl: anchorElement, open, onClose: closeMenu, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material21.Box, { sx: { width: 240 }, children: [
3210
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.List, { children: user?.name ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react20.Fragment, { children: [
3211
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItem, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemText, { primary: user.name, secondary: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { children: [
3212
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: user.employeeId }),
3213
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("br", {}),
3214
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: user.department })
3215
- ] }) }) }),
3216
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material21.ListItemButton, { onClick: () => keycloak.logout(), children: [
3217
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_Logout.default, { color: "error" }) }),
3218
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemText, { primary: t2("Layout.Logout") })
3219
- ] })
3220
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material21.ListItemButton, { onClick: () => keycloak.login(), children: [
3221
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_Login.default, { color: "success" }) }),
3222
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material21.ListItemText, { primary: t2("Layout.LogIn") })
3223
- ] }) }),
3224
- tab === "settings" && settings,
3225
- tab === "theme" && theme,
3226
- tab === "language" && language
3227
- ] }) })
3228
- ] });
3229
- };
3230
-
3231
- // src/hooks/ThemeHook.ts
3232
- var import_material22 = require("@mui/material");
3233
- var import_colors2 = require("@mui/material/colors");
3234
- var import_locale = require("@mui/material/locale");
3235
-
3236
- // node_modules/@mui/x-data-grid/esm/utils/getGridLocalization.js
3237
- var getGridLocalization = (gridTranslations) => ({
3238
- components: {
3239
- MuiDataGrid: {
3240
- defaultProps: {
3241
- localeText: gridTranslations
3242
- }
3243
- }
3244
- }
3245
- });
3246
-
3247
- // node_modules/@mui/x-data-grid/esm/locales/csCZ.js
3248
- var csCZGrid = {
3249
- // Root
3250
- noRowsLabel: "\u017D\xE1dn\xE9 z\xE1znamy",
3251
- noResultsOverlayLabel: "Nena\u0161ly se \u017Eadn\xE9 v\xFDsledky.",
3252
- noColumnsOverlayLabel: "\u017D\xE1dn\xE9 sloupce",
3253
- noColumnsOverlayManageColumns: "Spravovat sloupce",
3254
- // emptyPivotOverlayLabel: 'Add fields to rows, columns, and values to create a pivot table',
3255
- // Density selector toolbar button text
3256
- toolbarDensity: "Zobrazen\xED",
3257
- toolbarDensityLabel: "Zobrazen\xED",
3258
- toolbarDensityCompact: "Kompaktn\xED",
3259
- toolbarDensityStandard: "Standartn\xED",
3260
- toolbarDensityComfortable: "Komfortn\xED",
3261
- // Columns selector toolbar button text
3262
- toolbarColumns: "Sloupce",
3263
- toolbarColumnsLabel: "Vybrat sloupec",
3264
- // Filters toolbar button text
3265
- toolbarFilters: "Filtry",
3266
- toolbarFiltersLabel: "Zobrazit filtry",
3267
- toolbarFiltersTooltipHide: "Skr\xFDt filtry",
3268
- toolbarFiltersTooltipShow: "Zobrazit filtry",
3269
- toolbarFiltersTooltipActive: (count) => {
3270
- let pluralForm = "aktivn\xEDch filtr\u016F";
3271
- if (count > 1 && count < 5) {
3272
- pluralForm = "aktivn\xED filtry";
3273
- } else if (count === 1) {
3274
- pluralForm = "aktivn\xED filtr";
3275
- }
3276
- return `${count} ${pluralForm}`;
3277
- },
3278
- // Quick filter toolbar field
3279
- toolbarQuickFilterPlaceholder: "Hledat\u2026",
3280
- toolbarQuickFilterLabel: "Hledat",
3281
- toolbarQuickFilterDeleteIconLabel: "Vymazat",
3282
- // Export selector toolbar button text
3283
- toolbarExport: "Export",
3284
- toolbarExportLabel: "Export",
3285
- toolbarExportCSV: "St\xE1hnout jako CSV",
3286
- toolbarExportPrint: "Vytisknout",
3287
- toolbarExportExcel: "St\xE1hnout jako Excel",
3288
- // Toolbar pivot button
3289
- // toolbarPivot: 'Pivot',
3290
- // Toolbar AI Assistant button
3291
- // toolbarAssistant: 'AI Assistant',
3292
- // Columns management text
3293
- columnsManagementSearchTitle: "Hledat sloupce",
3294
- columnsManagementNoColumns: "\u017D\xE1dn\xE9 sloupce",
3295
- columnsManagementShowHideAllText: "Zobrazit/skr\xFDt v\u0161e",
3296
- columnsManagementReset: "Resetovat",
3297
- columnsManagementDeleteIconLabel: "Vy\u010Distit",
3298
- // Filter panel text
3299
- filterPanelAddFilter: "P\u0159idat filtr",
3300
- filterPanelRemoveAll: "Odstranit v\u0161e",
3301
- filterPanelDeleteIconLabel: "Odstranit",
3302
- filterPanelLogicOperator: "Logick\xFD oper\xE1tor",
3303
- filterPanelOperator: "Oper\xE1tory",
3304
- filterPanelOperatorAnd: "A",
3305
- filterPanelOperatorOr: "Nebo",
3306
- filterPanelColumns: "Sloupce",
3307
- filterPanelInputLabel: "Hodnota",
3308
- filterPanelInputPlaceholder: "Hodnota filtru",
3309
- // Filter operators text
3310
- filterOperatorContains: "obsahuje",
3311
- filterOperatorDoesNotContain: "neobsahuje",
3312
- filterOperatorEquals: "rovn\xE1 se",
3313
- filterOperatorDoesNotEqual: "nerovn\xE1 se",
3314
- filterOperatorStartsWith: "za\u010D\xEDn\xE1 na",
3315
- filterOperatorEndsWith: "kon\u010D\xED na",
3316
- filterOperatorIs: "je",
3317
- filterOperatorNot: "nen\xED",
3318
- filterOperatorAfter: "je po",
3319
- filterOperatorOnOrAfter: "je po v\u010Detn\u011B",
3320
- filterOperatorBefore: "je p\u0159ed",
3321
- filterOperatorOnOrBefore: "je p\u0159ed v\u010Detn\u011B",
3322
- filterOperatorIsEmpty: "je pr\xE1zdn\xFD",
3323
- filterOperatorIsNotEmpty: "nen\xED pr\xE1zdn\xFD",
3324
- filterOperatorIsAnyOf: "je jeden z",
3325
- "filterOperator=": "=",
3326
- "filterOperator!=": "!=",
3327
- "filterOperator>": ">",
3328
- "filterOperator>=": ">=",
3329
- "filterOperator<": "<",
3330
- "filterOperator<=": "<=",
3331
- // Header filter operators text
3332
- headerFilterOperatorContains: "Obsahuje",
3333
- headerFilterOperatorDoesNotContain: "Neobsahuje",
3334
- headerFilterOperatorEquals: "Rovn\xE1 se",
3335
- headerFilterOperatorDoesNotEqual: "Nerovn\xE1 se",
3336
- headerFilterOperatorStartsWith: "Za\u010D\xEDn\xE1 na",
3337
- headerFilterOperatorEndsWith: "Kon\u010D\xED na",
3338
- headerFilterOperatorIs: "Je",
3339
- headerFilterOperatorNot: "Nen\xED",
3340
- headerFilterOperatorAfter: "Je po",
3341
- headerFilterOperatorOnOrAfter: "Je po v\u010Detn\u011B",
3342
- headerFilterOperatorBefore: "Je p\u0159ed",
3343
- headerFilterOperatorOnOrBefore: "Je p\u0159ed v\u010Detn\u011B",
3344
- headerFilterOperatorIsEmpty: "Je pr\xE1zdn\xFD",
3345
- headerFilterOperatorIsNotEmpty: "Nen\xED pr\xE1zdn\xFD",
3346
- headerFilterOperatorIsAnyOf: "Je jeden z",
3347
- "headerFilterOperator=": "Rovn\xE1 se",
3348
- "headerFilterOperator!=": "Nerovn\xE1 se",
3349
- "headerFilterOperator>": "V\u011Bt\u0161\xED ne\u017E",
3350
- "headerFilterOperator>=": "V\u011Bt\u0161\xED ne\u017E nebo rovno",
3351
- "headerFilterOperator<": "Men\u0161\xED ne\u017E",
3352
- "headerFilterOperator<=": "Men\u0161\xED ne\u017E nebo rovno",
3353
- headerFilterClear: "Zru\u0161it filtr",
3354
- // Filter values text
3355
- filterValueAny: "jak\xFDkoliv",
3356
- filterValueTrue: "ano",
3357
- filterValueFalse: "ne",
3358
- // Column menu text
3359
- columnMenuLabel: "Menu",
3360
- columnMenuAriaLabel: (columnName) => `Mo\u017Enosti sloupce ${columnName}`,
3361
- columnMenuShowColumns: "Zobrazit sloupce",
3362
- columnMenuManageColumns: "Spravovat sloupce",
3363
- columnMenuFilter: "Filtr",
3364
- columnMenuHideColumn: "Skr\xFDt",
3365
- columnMenuUnsort: "Zru\u0161it filtry",
3366
- columnMenuSortAsc: "Se\u0159adit vzestupn\u011B",
3367
- columnMenuSortDesc: "Se\u0159adit sestupn\u011B",
3368
- // columnMenuManagePivot: 'Manage pivot',
3369
- // Column header text
3370
- columnHeaderFiltersTooltipActive: (count) => {
3371
- let pluralForm = "aktivn\xEDch filtr\u016F";
3372
- if (count > 1 && count < 5) {
3373
- pluralForm = "aktivn\xED filtry";
3374
- } else if (count === 1) {
3375
- pluralForm = "aktivn\xED filtr";
3376
- }
3377
- return `${count} ${pluralForm}`;
3378
- },
3379
- columnHeaderFiltersLabel: "Zobrazit filtry",
3380
- columnHeaderSortIconLabel: "Filtrovat",
3381
- // Rows selected footer text
3382
- footerRowSelected: (count) => {
3383
- let pluralForm = "vybran\xFDch z\xE1znam\u016F";
3384
- if (count > 1 && count < 5) {
3385
- pluralForm = "vybran\xE9 z\xE1znamy";
3386
- } else if (count === 1) {
3387
- pluralForm = "vybran\xFD z\xE1znam";
3388
- }
3389
- return `${count} ${pluralForm}`;
3390
- },
3391
- // Total row amount footer text
3392
- footerTotalRows: "Celkem \u0159\xE1dk\u016F:",
3393
- // Total visible row amount footer text
3394
- footerTotalVisibleRows: (visibleCount, totalCount) => {
3395
- const str = totalCount.toString();
3396
- const firstDigit = str[0];
3397
- const op = ["4", "6", "7"].includes(firstDigit) || firstDigit === "1" && str.length % 3 === 0 ? "ze" : "z";
3398
- return `${visibleCount.toLocaleString()} ${op} ${totalCount.toLocaleString()}`;
3399
- },
3400
- // Checkbox selection text
3401
- checkboxSelectionHeaderName: "V\xFDb\u011Br \u0159\xE1dku",
3402
- checkboxSelectionSelectAllRows: "Ozna\u010Dit v\u0161echny \u0159\xE1dky",
3403
- checkboxSelectionUnselectAllRows: "Odzna\u010Dit v\u0161echny \u0159\xE1dky",
3404
- checkboxSelectionSelectRow: "Ozna\u010Dit \u0159\xE1dek",
3405
- checkboxSelectionUnselectRow: "Odzna\u010Dit \u0159\xE1dek",
3406
- // Boolean cell text
3407
- booleanCellTrueLabel: "ano",
3408
- booleanCellFalseLabel: "ne",
3409
- // Actions cell more text
3410
- actionsCellMore: "v\xEDce",
3411
- // Column pinning text
3412
- pinToLeft: "P\u0159ipnout vlevo",
3413
- pinToRight: "P\u0159ipnout vpravo",
3414
- unpin: "Odepnout",
3415
- // Tree Data
3416
- treeDataGroupingHeaderName: "Skupina",
3417
- treeDataExpand: "zobrazit potomky",
3418
- treeDataCollapse: "skr\xFDt potomky",
3419
- // Grouping columns
3420
- groupingColumnHeaderName: "Skupina",
3421
- groupColumn: (name) => `Seskupit podle ${name}`,
3422
- unGroupColumn: (name) => `P\u0159estat seskupovat podle ${name}`,
3423
- // Master/detail
3424
- detailPanelToggle: "P\u0159epnout detail panelu",
3425
- expandDetailPanel: "Rozbalit",
3426
- collapseDetailPanel: "Sbalit",
3427
- // Pagination
3428
- paginationRowsPerPage: "\u0158\xE1dk\u016F na str\xE1nce:",
3429
- paginationDisplayedRows: ({
3430
- from,
3431
- to,
3432
- count,
3433
- estimated
3434
- }) => {
3435
- if (!estimated) {
3436
- return `${from}\u2013${to} z ${count !== -1 ? count : `v\xEDce ne\u017E ${to}`}`;
3437
- }
3438
- const estimatedLabel = estimated && estimated > to ? `p\u0159ibli\u017En\u011B ${estimated}` : `v\xEDce ne\u017E ${to}`;
3439
- return `${from}\u2013${to} z ${count !== -1 ? count : estimatedLabel}`;
3440
- },
3441
- paginationItemAriaLabel: (type) => {
3442
- if (type === "first") {
3443
- return "J\xEDt na prvn\xED str\xE1nku";
3444
- }
3445
- if (type === "last") {
3446
- return "J\xEDt na posledn\xED str\xE1nku";
3447
- }
3448
- if (type === "next") {
3449
- return "J\xEDt na dal\u0161\xED str\xE1nku";
3450
- }
3451
- return "J\xEDt na p\u0159edchoz\xED str\xE1nku";
3452
- },
3453
- // Row reordering text
3454
- rowReorderingHeaderName: "P\u0159euspo\u0159\xE1d\xE1v\xE1n\xED \u0159\xE1dk\u016F",
3455
- // Aggregation
3456
- aggregationMenuItemHeader: "Seskupov\xE1n\xED",
3457
- aggregationFunctionLabelSum: "sou\u010Det",
3458
- aggregationFunctionLabelAvg: "pr\u016Fm\u011Br",
3459
- aggregationFunctionLabelMin: "min",
3460
- aggregationFunctionLabelMax: "max",
3461
- aggregationFunctionLabelSize: "po\u010Det",
3462
- // Pivot panel
3463
- // pivotToggleLabel: 'Pivot',
3464
- // pivotRows: 'Rows',
3465
- // pivotColumns: 'Columns',
3466
- // pivotValues: 'Values',
3467
- // pivotCloseButton: 'Close pivot settings',
3468
- // pivotSearchButton: 'Search fields',
3469
- // pivotSearchControlPlaceholder: 'Search fields',
3470
- // pivotSearchControlLabel: 'Search fields',
3471
- // pivotSearchControlClear: 'Clear search',
3472
- // pivotNoFields: 'No fields',
3473
- // pivotMenuMoveUp: 'Move up',
3474
- // pivotMenuMoveDown: 'Move down',
3475
- // pivotMenuMoveToTop: 'Move to top',
3476
- // pivotMenuMoveToBottom: 'Move to bottom',
3477
- // pivotMenuRows: 'Rows',
3478
- // pivotMenuColumns: 'Columns',
3479
- // pivotMenuValues: 'Values',
3480
- // pivotMenuOptions: 'Field options',
3481
- // pivotMenuAddToRows: 'Add to Rows',
3482
- // pivotMenuAddToColumns: 'Add to Columns',
3483
- // pivotMenuAddToValues: 'Add to Values',
3484
- // pivotMenuRemove: 'Remove',
3485
- // pivotDragToRows: 'Drag here to create rows',
3486
- // pivotDragToColumns: 'Drag here to create columns',
3487
- // pivotDragToValues: 'Drag here to create values',
3488
- // pivotYearColumnHeaderName: '(Year)',
3489
- // pivotQuarterColumnHeaderName: '(Quarter)',
3490
- // AI Assistant panel
3491
- // aiAssistantPanelTitle: 'AI Assistant',
3492
- // aiAssistantPanelClose: 'Close AI Assistant',
3493
- // aiAssistantPanelNewConversation: 'New conversation',
3494
- // aiAssistantPanelConversationHistory: 'Conversation history',
3495
- // aiAssistantPanelEmptyConversation: 'No prompt history',
3496
- // aiAssistantSuggestions: 'Suggestions',
3497
- // Prompt field
3498
- promptFieldLabel: "Vstup po\u017Eadavku",
3499
- promptFieldPlaceholder: "Napi\u0161te po\u017Eadavek\u2026",
3500
- promptFieldPlaceholderWithRecording: "Napi\u0161te nebo nahrajte po\u017Eadavek\u2026",
3501
- promptFieldPlaceholderListening: "Naslouch\xE1m po\u017Eadavku\u2026",
3502
- // promptFieldSpeechRecognitionNotSupported: 'Speech recognition is not supported in this browser',
3503
- promptFieldSend: "Odeslat",
3504
- promptFieldRecord: "Nahr\xE1t",
3505
- promptFieldStopRecording: "Zastavit nahr\xE1v\xE1n\xED"
3506
- // Prompt
3507
- // promptRerun: 'Run again',
3508
- // promptProcessing: 'Processing…',
3509
- // promptAppliedChanges: 'Applied changes',
3510
- // Prompt changes
3511
- // promptChangeGroupDescription: (column: string) => `Group by ${column}`,
3512
- // promptChangeAggregationLabel: (column: string, aggregation: string) => `${column} (${aggregation})`,
3513
- // promptChangeAggregationDescription: (column: string, aggregation: string) => `Aggregate ${column} (${aggregation})`,
3514
- // promptChangeFilterLabel: (column: string, operator: string, value: string) => {
3515
- // if (operator === 'is any of') {
3516
- // return `${column} is any of: ${value}`;
3517
- // }
3518
- // return `${column} ${operator} ${value}`;
3519
- // },
3520
- // promptChangeFilterDescription: (column: string, operator: string, value: string) => {
3521
- // if (operator === 'is any of') {
3522
- // return `Filter where ${column} is any of: ${value}`;
3523
- // }
3524
- // return `Filter where ${column} ${operator} ${value}`;
3525
- // },
3526
- // promptChangeSortDescription: (column: string, direction: string) => `Sort by ${column} (${direction})`,
3527
- // promptChangePivotEnableLabel: 'Pivot',
3528
- // promptChangePivotEnableDescription: 'Enable pivot',
3529
- // promptChangePivotColumnsLabel: (count: number) => `Columns (${count})`,
3530
- // promptChangePivotColumnsDescription: (column: string, direction: string) => `${column}${direction ? ` (${direction})` : ''}`,
3531
- // promptChangePivotRowsLabel: (count: number) => `Rows (${count})`,
3532
- // promptChangePivotValuesLabel: (count: number) => `Values (${count})`,
3533
- // promptChangePivotValuesDescription: (column: string, aggregation: string) => `${column} (${aggregation})`,
3534
- };
3535
- var csCZ = getGridLocalization(csCZGrid);
3536
-
3537
- // node_modules/@mui/x-data-grid/esm/constants/localeTextConstants.js
3538
- var GRID_DEFAULT_LOCALE_TEXT = {
3539
- // Root
3540
- noRowsLabel: "No rows",
3541
- noResultsOverlayLabel: "No results found.",
3542
- noColumnsOverlayLabel: "No columns",
3543
- noColumnsOverlayManageColumns: "Manage columns",
3544
- emptyPivotOverlayLabel: "Add fields to rows, columns, and values to create a pivot table",
3545
- // Density selector toolbar button text
3546
- toolbarDensity: "Density",
3547
- toolbarDensityLabel: "Density",
3548
- toolbarDensityCompact: "Compact",
3549
- toolbarDensityStandard: "Standard",
3550
- toolbarDensityComfortable: "Comfortable",
3551
- // Columns selector toolbar button text
3552
- toolbarColumns: "Columns",
3553
- toolbarColumnsLabel: "Select columns",
3554
- // Filters toolbar button text
3555
- toolbarFilters: "Filters",
3556
- toolbarFiltersLabel: "Show filters",
3557
- toolbarFiltersTooltipHide: "Hide filters",
3558
- toolbarFiltersTooltipShow: "Show filters",
3559
- toolbarFiltersTooltipActive: (count) => count !== 1 ? `${count} active filters` : `${count} active filter`,
3560
- // Quick filter toolbar field
3561
- toolbarQuickFilterPlaceholder: "Search\u2026",
3562
- toolbarQuickFilterLabel: "Search",
3563
- toolbarQuickFilterDeleteIconLabel: "Clear",
3564
- // Export selector toolbar button text
3565
- toolbarExport: "Export",
3566
- toolbarExportLabel: "Export",
3567
- toolbarExportCSV: "Download as CSV",
3568
- toolbarExportPrint: "Print",
3569
- toolbarExportExcel: "Download as Excel",
3570
- // Toolbar pivot button
3571
- toolbarPivot: "Pivot",
3572
- // Toolbar AI Assistant button
3573
- toolbarAssistant: "AI Assistant",
3574
- // Columns management text
3575
- columnsManagementSearchTitle: "Search",
3576
- columnsManagementNoColumns: "No columns",
3577
- columnsManagementShowHideAllText: "Show/Hide All",
3578
- columnsManagementReset: "Reset",
3579
- columnsManagementDeleteIconLabel: "Clear",
3580
- // Filter panel text
3581
- filterPanelAddFilter: "Add filter",
3582
- filterPanelRemoveAll: "Remove all",
3583
- filterPanelDeleteIconLabel: "Delete",
3584
- filterPanelLogicOperator: "Logic operator",
3585
- filterPanelOperator: "Operator",
3586
- filterPanelOperatorAnd: "And",
3587
- filterPanelOperatorOr: "Or",
3588
- filterPanelColumns: "Columns",
3589
- filterPanelInputLabel: "Value",
3590
- filterPanelInputPlaceholder: "Filter value",
3591
- // Filter operators text
3592
- filterOperatorContains: "contains",
3593
- filterOperatorDoesNotContain: "does not contain",
3594
- filterOperatorEquals: "equals",
3595
- filterOperatorDoesNotEqual: "does not equal",
3596
- filterOperatorStartsWith: "starts with",
3597
- filterOperatorEndsWith: "ends with",
3598
- filterOperatorIs: "is",
3599
- filterOperatorNot: "is not",
3600
- filterOperatorAfter: "is after",
3601
- filterOperatorOnOrAfter: "is on or after",
3602
- filterOperatorBefore: "is before",
3603
- filterOperatorOnOrBefore: "is on or before",
3604
- filterOperatorIsEmpty: "is empty",
3605
- filterOperatorIsNotEmpty: "is not empty",
3606
- filterOperatorIsAnyOf: "is any of",
3607
- "filterOperator=": "=",
3608
- "filterOperator!=": "!=",
3609
- "filterOperator>": ">",
3610
- "filterOperator>=": ">=",
3611
- "filterOperator<": "<",
3612
- "filterOperator<=": "<=",
3613
- // Header filter operators text
3614
- headerFilterOperatorContains: "Contains",
3615
- headerFilterOperatorDoesNotContain: "Does not contain",
3616
- headerFilterOperatorEquals: "Equals",
3617
- headerFilterOperatorDoesNotEqual: "Does not equal",
3618
- headerFilterOperatorStartsWith: "Starts with",
3619
- headerFilterOperatorEndsWith: "Ends with",
3620
- headerFilterOperatorIs: "Is",
3621
- headerFilterOperatorNot: "Is not",
3622
- headerFilterOperatorAfter: "Is after",
3623
- headerFilterOperatorOnOrAfter: "Is on or after",
3624
- headerFilterOperatorBefore: "Is before",
3625
- headerFilterOperatorOnOrBefore: "Is on or before",
3626
- headerFilterOperatorIsEmpty: "Is empty",
3627
- headerFilterOperatorIsNotEmpty: "Is not empty",
3628
- headerFilterOperatorIsAnyOf: "Is any of",
3629
- "headerFilterOperator=": "Equals",
3630
- "headerFilterOperator!=": "Not equals",
3631
- "headerFilterOperator>": "Greater than",
3632
- "headerFilterOperator>=": "Greater than or equal to",
3633
- "headerFilterOperator<": "Less than",
3634
- "headerFilterOperator<=": "Less than or equal to",
3635
- headerFilterClear: "Clear filter",
3636
- // Filter values text
3637
- filterValueAny: "any",
3638
- filterValueTrue: "true",
3639
- filterValueFalse: "false",
3640
- // Column menu text
3641
- columnMenuLabel: "Menu",
3642
- columnMenuAriaLabel: (columnName) => `${columnName} column menu`,
3643
- columnMenuShowColumns: "Show columns",
3644
- columnMenuManageColumns: "Manage columns",
3645
- columnMenuFilter: "Filter",
3646
- columnMenuHideColumn: "Hide column",
3647
- columnMenuUnsort: "Unsort",
3648
- columnMenuSortAsc: "Sort by ASC",
3649
- columnMenuSortDesc: "Sort by DESC",
3650
- columnMenuManagePivot: "Manage pivot",
3651
- // Column header text
3652
- columnHeaderFiltersTooltipActive: (count) => count !== 1 ? `${count} active filters` : `${count} active filter`,
3653
- columnHeaderFiltersLabel: "Show filters",
3654
- columnHeaderSortIconLabel: "Sort",
3655
- // Rows selected footer text
3656
- footerRowSelected: (count) => count !== 1 ? `${count.toLocaleString()} rows selected` : `${count.toLocaleString()} row selected`,
3657
- // Total row amount footer text
3658
- footerTotalRows: "Total Rows:",
3659
- // Total visible row amount footer text
3660
- footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} of ${totalCount.toLocaleString()}`,
3661
- // Checkbox selection text
3662
- checkboxSelectionHeaderName: "Checkbox selection",
3663
- checkboxSelectionSelectAllRows: "Select all rows",
3664
- checkboxSelectionUnselectAllRows: "Unselect all rows",
3665
- checkboxSelectionSelectRow: "Select row",
3666
- checkboxSelectionUnselectRow: "Unselect row",
3667
- // Boolean cell text
3668
- booleanCellTrueLabel: "yes",
3669
- booleanCellFalseLabel: "no",
3670
- // Actions cell more text
3671
- actionsCellMore: "more",
3672
- // Column pinning text
3673
- pinToLeft: "Pin to left",
3674
- pinToRight: "Pin to right",
3675
- unpin: "Unpin",
3676
- // Tree Data
3677
- treeDataGroupingHeaderName: "Group",
3678
- treeDataExpand: "see children",
3679
- treeDataCollapse: "hide children",
3680
- // Grouping columns
3681
- groupingColumnHeaderName: "Group",
3682
- groupColumn: (name) => `Group by ${name}`,
3683
- unGroupColumn: (name) => `Stop grouping by ${name}`,
3684
- // Master/detail
3685
- detailPanelToggle: "Detail panel toggle",
3686
- expandDetailPanel: "Expand",
3687
- collapseDetailPanel: "Collapse",
3688
- // Pagination
3689
- paginationRowsPerPage: "Rows per page:",
3690
- paginationDisplayedRows: ({
3691
- from,
3692
- to,
3693
- count,
3694
- estimated
3695
- }) => {
3696
- if (!estimated) {
3697
- return `${from}\u2013${to} of ${count !== -1 ? count : `more than ${to}`}`;
3698
- }
3699
- const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
3700
- return `${from}\u2013${to} of ${count !== -1 ? count : estimatedLabel}`;
3701
- },
3702
- paginationItemAriaLabel: (type) => {
3703
- if (type === "first") {
3704
- return "Go to first page";
3705
- }
3706
- if (type === "last") {
3707
- return "Go to last page";
3708
- }
3709
- if (type === "next") {
3710
- return "Go to next page";
3711
- }
3712
- return "Go to previous page";
3713
- },
3714
- // Row reordering text
3715
- rowReorderingHeaderName: "Row reordering",
3716
- // Aggregation
3717
- aggregationMenuItemHeader: "Aggregation",
3718
- aggregationFunctionLabelSum: "sum",
3719
- aggregationFunctionLabelAvg: "avg",
3720
- aggregationFunctionLabelMin: "min",
3721
- aggregationFunctionLabelMax: "max",
3722
- aggregationFunctionLabelSize: "size",
3723
- // Pivot panel
3724
- pivotToggleLabel: "Pivot",
3725
- pivotRows: "Rows",
3726
- pivotColumns: "Columns",
3727
- pivotValues: "Values",
3728
- pivotCloseButton: "Close pivot settings",
3729
- pivotSearchButton: "Search fields",
3730
- pivotSearchControlPlaceholder: "Search fields",
3731
- pivotSearchControlLabel: "Search fields",
3732
- pivotSearchControlClear: "Clear search",
3733
- pivotNoFields: "No fields",
3734
- pivotMenuMoveUp: "Move up",
3735
- pivotMenuMoveDown: "Move down",
3736
- pivotMenuMoveToTop: "Move to top",
3737
- pivotMenuMoveToBottom: "Move to bottom",
3738
- pivotMenuRows: "Rows",
3739
- pivotMenuColumns: "Columns",
3740
- pivotMenuValues: "Values",
3741
- pivotMenuOptions: "Field options",
3742
- pivotMenuAddToRows: "Add to Rows",
3743
- pivotMenuAddToColumns: "Add to Columns",
3744
- pivotMenuAddToValues: "Add to Values",
3745
- pivotMenuRemove: "Remove",
3746
- pivotDragToRows: "Drag here to create rows",
3747
- pivotDragToColumns: "Drag here to create columns",
3748
- pivotDragToValues: "Drag here to create values",
3749
- pivotYearColumnHeaderName: "(Year)",
3750
- pivotQuarterColumnHeaderName: "(Quarter)",
3751
- // AI Assistant panel
3752
- aiAssistantPanelTitle: "AI Assistant",
3753
- aiAssistantPanelClose: "Close AI Assistant",
3754
- aiAssistantPanelNewConversation: "New conversation",
3755
- aiAssistantPanelConversationHistory: "Conversation history",
3756
- aiAssistantPanelEmptyConversation: "No prompt history",
3757
- aiAssistantSuggestions: "Suggestions",
3758
- // Prompt field
3759
- promptFieldLabel: "Prompt",
3760
- promptFieldPlaceholder: "Type a prompt\u2026",
3761
- promptFieldPlaceholderWithRecording: "Type or record a prompt\u2026",
3762
- promptFieldPlaceholderListening: "Listening for prompt\u2026",
3763
- promptFieldSpeechRecognitionNotSupported: "Speech recognition is not supported in this browser",
3764
- promptFieldSend: "Send",
3765
- promptFieldRecord: "Record",
3766
- promptFieldStopRecording: "Stop recording",
3767
- // Prompt
3768
- promptRerun: "Run again",
3769
- promptProcessing: "Processing\u2026",
3770
- promptAppliedChanges: "Applied changes",
3771
- // Prompt changes
3772
- promptChangeGroupDescription: (column) => `Group by ${column}`,
3773
- promptChangeAggregationLabel: (column, aggregation) => `${column} (${aggregation})`,
3774
- promptChangeAggregationDescription: (column, aggregation) => `Aggregate ${column} (${aggregation})`,
3775
- promptChangeFilterLabel: (column, operator, value) => {
3776
- if (operator === "is any of") {
3777
- return `${column} is any of: ${value}`;
3778
- }
3779
- return `${column} ${operator} ${value}`;
3780
- },
3781
- promptChangeFilterDescription: (column, operator, value) => {
3782
- if (operator === "is any of") {
3783
- return `Filter where ${column} is any of: ${value}`;
3784
- }
3785
- return `Filter where ${column} ${operator} ${value}`;
3786
- },
3787
- promptChangeSortDescription: (column, direction) => `Sort by ${column} (${direction})`,
3788
- promptChangePivotEnableLabel: "Pivot",
3789
- promptChangePivotEnableDescription: "Enable pivot",
3790
- promptChangePivotColumnsLabel: (count) => `Columns (${count})`,
3791
- promptChangePivotColumnsDescription: (column, direction) => `${column}${direction ? ` (${direction})` : ""}`,
3792
- promptChangePivotRowsLabel: (count) => `Rows (${count})`,
3793
- promptChangePivotValuesLabel: (count) => `Values (${count})`,
3794
- promptChangePivotValuesDescription: (column, aggregation) => `${column} (${aggregation})`
3795
- };
3796
-
3797
- // node_modules/@mui/x-data-grid/esm/locales/enUS.js
3798
- var enUS2 = getGridLocalization(GRID_DEFAULT_LOCALE_TEXT);
3799
-
3800
- // node_modules/@mui/x-date-pickers/esm/locales/csCZ.js
3801
- var timeViews = {
3802
- hours: "Hodiny",
3803
- minutes: "Minuty",
3804
- seconds: "Sekundy",
3805
- meridiem: "Odpoledne"
3806
- };
3807
- var csCZPickers = {
3808
- // Calendar navigation
3809
- previousMonth: "P\u0159edchoz\xED m\u011Bs\xEDc",
3810
- nextMonth: "Dal\u0161\xED m\u011Bs\xEDc",
3811
- // View navigation
3812
- openPreviousView: "Otev\u0159\xEDt p\u0159edchoz\xED zobrazen\xED",
3813
- openNextView: "Otev\u0159\xEDt dal\u0161\xED zobrazen\xED",
3814
- calendarViewSwitchingButtonAriaLabel: (view) => view === "year" ? "ro\u010Dn\xED zobrazen\xED otev\u0159eno, p\u0159epn\u011Bte do zobrazen\xED kalend\xE1\u0159e" : "zobrazen\xED kalend\xE1\u0159e otev\u0159eno, p\u0159epn\u011Bte do zobrazen\xED roku",
3815
- // DateRange labels
3816
- start: "Za\u010D\xE1tek",
3817
- end: "Konec",
3818
- startDate: "Datum za\u010D\xE1tku",
3819
- startTime: "\u010Cas za\u010D\xE1tku",
3820
- endDate: "Datum konce",
3821
- endTime: "\u010Cas konce",
3822
- // Action bar
3823
- cancelButtonLabel: "Zru\u0161it",
3824
- clearButtonLabel: "Vymazat",
3825
- okButtonLabel: "Potvrdit",
3826
- todayButtonLabel: "Dnes",
3827
- nextStepButtonLabel: "Dal\u0161\xED",
3828
- // Toolbar titles
3829
- datePickerToolbarTitle: "Vyberte datum",
3830
- dateTimePickerToolbarTitle: "Vyberte datum a \u010Das",
3831
- timePickerToolbarTitle: "Vyberte \u010Das",
3832
- dateRangePickerToolbarTitle: "Vyberte rozmez\xED dat",
3833
- // timeRangePickerToolbarTitle: 'Select time range',
3834
- // Clock labels
3835
- clockLabelText: (view, formattedTime) => `${timeViews[view] ?? view} vybr\xE1ny. ${!formattedTime ? "Nen\xED vybr\xE1n \u010Das" : `Vybran\xFD \u010Das je ${formattedTime}`}`,
3836
- hoursClockNumberText: (hours) => `${hours} hodin`,
3837
- minutesClockNumberText: (minutes) => `${minutes} minut`,
3838
- secondsClockNumberText: (seconds) => `${seconds} sekund`,
3839
- // Digital clock labels
3840
- selectViewText: (view) => `Vyberte ${timeViews[view]}`,
3841
- // Calendar labels
3842
- calendarWeekNumberHeaderLabel: "T\xFDden v roce",
3843
- calendarWeekNumberHeaderText: "#",
3844
- calendarWeekNumberAriaLabelText: (weekNumber) => `${weekNumber} t\xFDden v roce`,
3845
- calendarWeekNumberText: (weekNumber) => `${weekNumber}`,
3846
- // Open Picker labels
3847
- openDatePickerDialogue: (formattedDate) => formattedDate ? `Vyberte datum, vybran\xE9 datum je ${formattedDate}` : "Vyberte datum",
3848
- openTimePickerDialogue: (formattedTime) => formattedTime ? `Vyberte \u010Das, vybran\xFD \u010Das je ${formattedTime}` : "Vyberte \u010Das",
3849
- // openRangePickerDialogue: formattedRange => formattedRange ? `Choose range, selected range is ${formattedRange}` : 'Choose range',
3850
- fieldClearLabel: "Vymazat",
3851
- // Table labels
3852
- timeTableLabel: "vyberte \u010Das",
3853
- dateTableLabel: "vyberte datum",
3854
- // Field section placeholders
3855
- fieldYearPlaceholder: (params) => "Y".repeat(params.digitAmount),
3856
- fieldMonthPlaceholder: (params) => params.contentType === "letter" ? "MMMM" : "MM",
3857
- fieldDayPlaceholder: () => "DD",
3858
- fieldWeekDayPlaceholder: (params) => params.contentType === "letter" ? "EEEE" : "EE",
3859
- fieldHoursPlaceholder: () => "hh",
3860
- fieldMinutesPlaceholder: () => "mm",
3861
- fieldSecondsPlaceholder: () => "ss",
3862
- fieldMeridiemPlaceholder: () => "aa",
3863
- // View names
3864
- year: "Rok",
3865
- month: "M\u011Bs\xEDc",
3866
- day: "Den",
3867
- weekDay: "Pracovn\xED den",
3868
- hours: "Hodiny",
3869
- minutes: "Minuty",
3870
- seconds: "Sekundy",
3871
- meridiem: "Odpoledne",
3872
- // Common
3873
- empty: "Pr\xE1zdn\xFD"
3874
- };
3875
- var csCZ2 = getPickersLocalization(csCZPickers);
3876
-
3877
- // src/hooks/ThemeHook.ts
3878
- var import_react_i18next7 = require("react-i18next");
3879
- var WISTRON_PRIMARY_COLOR = "#00506E";
3880
- var WISTRON_SECONDARY_COLOR = "#64DC00";
3881
- var useGetTheme = (theme) => {
3882
- const { i18n: i18n2 } = (0, import_react_i18next7.useTranslation)();
3883
- return (0, import_material22.createTheme)(
3884
- {
3885
- cssVariables: {
3886
- colorSchemeSelector: "data-mui-color-scheme"
3887
- },
3888
- colorSchemes: {
3889
- light: {
3890
- palette: {
3891
- primary: { main: WISTRON_PRIMARY_COLOR },
3892
- secondary: { main: WISTRON_SECONDARY_COLOR }
3893
- }
3894
- },
3895
- dark: {
3896
- palette: {
3897
- primary: { main: (0, import_material22.lighten)(WISTRON_PRIMARY_COLOR, 0.5) },
3898
- secondary: { main: (0, import_material22.darken)(WISTRON_SECONDARY_COLOR, 0.5) }
3899
- }
3900
- },
3901
- ...theme?.colorSchemes
3902
- },
3903
- components: {
3904
- MuiCssBaseline: {
3905
- styleOverrides: ({ palette }) => {
3906
- return {
3907
- body: {
3908
- "&::-webkit-scrollbar, & *::-webkit-scrollbar": {
3909
- width: "0.7em",
3910
- height: "0.7em"
3911
- },
3912
- "&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track": {
3913
- backgroundColor: palette.mode === "dark" ? import_colors2.grey[900] : import_colors2.grey[200],
3914
- borderRadius: "5px"
3915
- },
3916
- "&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb": {
3917
- backgroundColor: palette.mode === "dark" ? import_colors2.grey[800] : import_colors2.grey[400],
3918
- borderRadius: "10px"
3919
- },
3920
- "&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover": {
3921
- backgroundColor: palette.mode === "dark" ? import_colors2.grey[700] : import_colors2.grey[500]
3922
- },
3923
- "&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner": {
3924
- backgroundColor: "transparent"
3925
- }
3926
- }
3927
- };
3928
- }
3929
- },
3930
- ...theme?.components
3931
- }
3932
- },
3933
- i18n2.resolvedLanguage === "cs" ? csCZ : enUS2,
3934
- i18n2.resolvedLanguage === "cs" ? csCZ2 : enUS,
3935
- i18n2.resolvedLanguage === "cs" ? import_locale.csCZ : import_locale.enUS
3936
- );
3937
- };
3938
-
3939
- // src/components/core/Layout.tsx
3940
- var import_jsx_runtime28 = require("react/jsx-runtime");
3941
- var DrawerHeader = (0, import_styles4.styled)("div")(({ theme }) => ({
3942
- display: "flex",
3943
- alignItems: "center",
3944
- justifyContent: "flex-end",
3945
- padding: theme.spacing(0, 1),
3946
- ...theme.mixins.toolbar
3947
- }));
3948
- var Layout = (props) => {
3949
- const theme = useGetTheme(props.theme);
3950
- const [navigationOpen, setNavigationOpen] = (0, import_use_local_storage_state.default)("navigationOpen", { defaultServerValue: false });
3951
- const isFetching = !!(0, import_react_query2.useIsFetching)();
3952
- const isMutating = !!(0, import_react_query2.useIsMutating)();
3953
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_styles4.ThemeProvider, { theme, children: [
3954
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_material23.InitColorSchemeScript, {}),
3955
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_material23.CssBaseline, {}),
3956
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_material23.Box, { sx: { display: "flex", height: "100dvh", maxHeight: "100dvh", overflow: "hidden", width: "100%" }, children: [
3957
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3958
- import_material23.AppBar,
3959
- {
3960
- color: "transparent",
3961
- position: "fixed",
3962
- sx: {
3963
- borderBottom: "1px solid",
3964
- borderColor: theme.vars?.palette.divider,
3965
- boxShadow: "none"
3966
- },
3967
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_material23.Toolbar, { children: [
3968
- props.navigation && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3969
- import_material23.IconButton,
3970
- {
3971
- onClick: () => setNavigationOpen((previous) => !previous),
3972
- sx: { marginRight: 2 },
3973
- children: navigationOpen ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_MenuOpen.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_Menu.default, {})
3974
- }
3975
- ),
3976
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(AppTitle, {}),
3977
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ToolbarAccount, {})
3978
- ] })
3979
- }
3980
- ),
3981
- props.navigation && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(NavigationRail, { navigation: props.navigation, expanded: navigationOpen ?? false, setExpanded: setNavigationOpen }),
3982
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_material23.Box, { component: "main", sx: { flexGrow: 1, display: "flex", flexDirection: "column", minWidth: 0, height: "100%", overflow: "hidden" }, children: [
3983
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DrawerHeader, {}),
3984
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_material23.Box, { sx: { flex: 1, overflow: "auto", position: "relative" }, children: props.children })
3985
- ] })
3986
- ] }),
3987
- (isFetching || isMutating) && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_material23.LinearProgress, { sx: { position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 } })
3988
- ] });
3989
- };
3990
-
3991
- // src/providers/LayoutProvider.tsx
3992
- var import_jsx_runtime29 = require("react/jsx-runtime");
3993
- var LayoutProvider = (props) => {
3994
- const [user, setUser] = (0, import_react21.useState)({ employeeId: "", name: "Unknown", department: "", company: "", category: "" });
3995
- const { t: t2 } = (0, import_react_i18next8.useTranslation)();
3996
- const navigation = props.getNavigation?.({ user, t: t2 });
3997
- (0, import_react21.useEffect)(() => {
3998
- z.config(import_i18next2.default.resolvedLanguage === "cs" ? (0, import_locales3.cs)() : (0, import_locales3.en)());
3999
- }, []);
4000
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: import_i18next2.default.resolvedLanguage, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(LayoutContext.Provider, { value: { user: { get: user, set: setUser } }, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Layout, { navigation, theme: props.theme, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogsProvider, { children: props.children }) }) }) });
4001
- };
4002
-
4003
- // src/index.ts
4004
- var import_uuidv72 = require("uuidv7");
4005
-
4006
- // src/hooks/FormHooks.ts
4007
- var import_react_form = require("@tanstack/react-form");
4008
-
4009
- // src/components/form/FormAutocomplete.tsx
4010
- var import_material24 = require("@mui/material");
4011
-
4012
- // src/utils/FormUtils.ts
4013
- var getFieldStatus = (field) => {
4014
- const { meta } = field.state;
4015
- const isTouched = meta.isTouched;
4016
- const hasError = !!meta.errors.length;
4017
- const helperText = meta.errors[0]?.message;
4018
- return { isTouched, hasError, helperText };
4019
- };
4020
-
4021
- // src/components/form/FormAutocomplete.tsx
4022
- var import_jsx_runtime30 = require("react/jsx-runtime");
4023
- var FormAutocomplete = ({ textFieldProps, ...autocompleteProps }) => {
4024
- const field = useFieldContext();
4025
- const { isTouched, hasError, helperText } = getFieldStatus(field);
4026
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4027
- import_material24.Autocomplete,
4028
- {
4029
- value: field.state.value,
4030
- onChange: (_, value) => !autocompleteProps.freeSolo && field.handleChange(value),
4031
- onInputChange: (_, value, reason) => reason !== "reset" && autocompleteProps.freeSolo && field.handleChange(value),
4032
- onBlur: field.handleBlur,
4033
- "aria-label": field.name,
4034
- ...autocompleteProps,
4035
- renderInput: (parameters) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4036
- import_material24.TextField,
4037
- {
4038
- ...parameters,
4039
- name: field.name,
4040
- error: isTouched && hasError,
4041
- helperText: isTouched && helperText,
4042
- ...textFieldProps
4043
- }
4044
- )
4045
- }
4046
- );
4047
- };
4048
-
4049
- // src/components/form/FormCheckbox.tsx
4050
- var import_material25 = require("@mui/material");
4051
- var import_jsx_runtime31 = require("react/jsx-runtime");
4052
- var FormCheckbox = (props) => {
4053
- const field = useFieldContext();
4054
- const { isTouched, hasError, helperText } = getFieldStatus(field);
4055
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material25.FormControl, { component: "fieldset", children: [
4056
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4057
- import_material25.FormControlLabel,
4058
- {
4059
- control: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4060
- import_material25.Checkbox,
4061
- {
4062
- name: field.name,
4063
- checked: Boolean(field.state.value),
4064
- onChange: (event) => field.handleChange(event.target.checked),
4065
- onBlur: field.handleBlur,
4066
- "aria-label": field.name,
4067
- ...props
4068
- }
4069
- ),
4070
- label: props.label ?? ""
4071
- }
4072
- ),
4073
- isTouched && hasError && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.FormHelperText, { error: hasError, children: helperText })
4074
- ] });
4075
- };
4076
-
4077
- // src/components/form/FormDatePicker.tsx
4078
- var import_x_date_pickers_pro = require("@mui/x-date-pickers-pro");
4079
- var import_dayjs2 = __toESM(require("dayjs"), 1);
4080
- var import_jsx_runtime32 = require("react/jsx-runtime");
4081
- var FormDatePicker = (props) => {
4082
- const field = useFieldContext();
4083
- const { isTouched, hasError, helperText } = getFieldStatus(field);
4084
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4085
- import_x_date_pickers_pro.DatePicker,
4086
- {
4087
- name: field.name,
4088
- value: field.state.value ? (0, import_dayjs2.default)(field.state.value) : null,
4089
- onChange: (value) => field.handleChange(value ? value.format() : null),
4090
- slotProps: {
4091
- textField: {
4092
- onBlur: field.handleBlur,
4093
- error: isTouched && hasError,
4094
- helperText: isTouched && helperText,
4095
- ...props.textFieldProps
4096
- },
4097
- ...props.slotProps
4098
- },
4099
- "aria-label": field.name,
4100
- ...props
4101
- }
4102
- );
4103
- };
4104
-
4105
- // src/components/form/FormDateTimePicker.tsx
4106
- var import_x_date_pickers_pro2 = require("@mui/x-date-pickers-pro");
4107
- var import_dayjs3 = __toESM(require("dayjs"), 1);
4108
- var import_jsx_runtime33 = require("react/jsx-runtime");
4109
- var FormDateTimePicker = (props) => {
4110
- const field = useFieldContext();
4111
- const { isTouched, hasError, helperText } = getFieldStatus(field);
4112
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4113
- import_x_date_pickers_pro2.DateTimePicker,
4114
- {
4115
- name: field.name,
4116
- value: field.state.value ? (0, import_dayjs3.default)(field.state.value) : null,
4117
- onChange: (value) => field.handleChange(value ? value.format() : null),
4118
- slotProps: {
4119
- textField: {
4120
- onBlur: field.handleBlur,
4121
- error: isTouched && hasError,
4122
- helperText: isTouched && helperText,
4123
- ...props.textFieldProps
4124
- },
4125
- ...props.slotProps
4126
- },
4127
- "aria-label": field.name,
4128
- ...props
4129
- }
4130
- );
4131
- };
4132
-
4133
- // src/components/form/FormNumberField.tsx
4134
- var import_material26 = require("@mui/material");
4135
- var import_react_number_format = require("react-number-format");
4136
- var import_jsx_runtime34 = require("react/jsx-runtime");
4137
- var FormNumberField = ({ options, ...props }) => {
4138
- const field = useFieldContext();
4139
- const { isTouched, hasError, helperText } = getFieldStatus(field);
4140
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
4141
- import_react_number_format.NumericFormat,
4142
- {
4143
- customInput: import_material26.TextField,
4144
- name: field.name,
4145
- value: field.state.value ?? "",
4146
- onValueChange: ({ floatValue }) => field.handleChange(floatValue),
4147
- onBlur: field.handleBlur,
4148
- error: isTouched && hasError,
4149
- helperText: isTouched && helperText,
4150
- "aria-label": field.name,
4151
- ...props,
4152
- ...options
4153
- }
4154
- );
4155
- };
4156
-
4157
- // src/components/form/FormRadioGroup.tsx
4158
- var import_material27 = require("@mui/material");
4159
- var import_jsx_runtime35 = require("react/jsx-runtime");
4160
- var FormRadioGroup = ({ label, options, ...props }) => {
4161
- const field = useFieldContext();
4162
- const { isTouched, hasError, helperText } = getFieldStatus(field);
4163
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_material27.FormControl, { component: "fieldset", children: [
4164
- label && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material27.FormLabel, { component: "legend", children: label }),
4165
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4166
- import_material27.RadioGroup,
4167
- {
4168
- name: field.name,
4169
- value: field.state.value ?? "",
4170
- onChange: (event) => field.handleChange(event.target.value),
4171
- onBlur: field.handleBlur,
4172
- "aria-label": field.name,
4173
- ...props,
4174
- children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4175
- import_material27.FormControlLabel,
4176
- {
4177
- value: option.value,
4178
- control: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material27.Radio, {}),
4179
- label: option.label
4180
- },
4181
- option.value
4182
- ))
4183
- }
4184
- ),
4185
- isTouched && hasError && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material27.FormHelperText, { error: hasError, children: helperText })
4186
- ] });
4187
- };
4188
-
4189
- // src/components/form/FormSlider.tsx
4190
- var import_material28 = require("@mui/material");
4191
- var import_jsx_runtime36 = require("react/jsx-runtime");
4192
- var FormSlider = ({ label, ...props }) => {
4193
- const field = useFieldContext();
4194
- const { isTouched, hasError, helperText } = getFieldStatus(field);
4195
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_material28.FormControl, { component: "fieldset", children: [
4196
- label && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material28.FormLabel, { children: label }),
4197
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
4198
- import_material28.Slider,
4199
- {
4200
- name: field.name,
4201
- value: field.state.value ?? 0,
4202
- onChange: (_, value) => field.handleChange(Array.isArray(value) ? value[0] : value),
4203
- onBlur: field.handleBlur,
4204
- "aria-label": field.name,
4205
- ...props
4206
- }
4207
- ),
4208
- isTouched && hasError && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material28.FormHelperText, { error: hasError, children: helperText })
4209
- ] });
4210
- };
4211
-
4212
- // src/components/form/FormSubmitButton.tsx
4213
- var import_material29 = require("@mui/material");
4214
- var import_jsx_runtime37 = require("react/jsx-runtime");
4215
- var FormSubmitButton = (props) => {
4216
- const form = useFormContext();
4217
- const handleClick = (event) => {
4218
- event.preventDefault();
4219
- event.stopPropagation();
4220
- form.handleSubmit();
4221
- };
4222
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(form.Subscribe, { selector: (state) => [state.canSubmit, state.isSubmitting], children: ([canSubmit, isSubmitting]) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
4223
- import_material29.Button,
4224
- {
4225
- loading: isSubmitting,
4226
- disabled: !canSubmit,
4227
- onClick: handleClick,
4228
- type: "submit",
4229
- "aria-label": "submit",
4230
- ...props
4231
- }
4232
- ) });
4233
- };
4234
-
4235
- // src/components/form/FormSwitch.tsx
4236
- var import_material30 = require("@mui/material");
4237
- var import_jsx_runtime38 = require("react/jsx-runtime");
4238
- var FormSwitch = (props) => {
4239
- const field = useFieldContext();
4240
- const { isTouched, hasError, helperText } = getFieldStatus(field);
4241
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_material30.FormControl, { component: "fieldset", children: [
4242
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4243
- import_material30.FormControlLabel,
4244
- {
4245
- control: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
4246
- import_material30.Switch,
4247
- {
4248
- name: field.name,
4249
- checked: Boolean(field.state.value),
4250
- onChange: (event) => field.handleChange(event.target.checked),
4251
- onBlur: field.handleBlur,
4252
- "aria-label": field.name,
4253
- ...props
4254
- }
4255
- ),
4256
- label: props.label ?? ""
4257
- }
4258
- ),
4259
- isTouched && hasError && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material30.FormHelperText, { error: hasError, children: helperText })
4260
- ] });
4261
- };
4262
-
4263
- // src/components/form/FormTextField.tsx
4264
- var import_material31 = require("@mui/material");
4265
- var import_jsx_runtime39 = require("react/jsx-runtime");
4266
- var FormTextField = (props) => {
4267
- const field = useFieldContext();
4268
- const { isTouched, hasError, helperText } = getFieldStatus(field);
4269
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
4270
- import_material31.TextField,
4271
- {
4272
- name: field.name,
4273
- value: field.state.value ?? "",
4274
- onChange: (event) => field.handleChange(event.target.value),
4275
- onBlur: field.handleBlur,
4276
- error: isTouched && hasError,
4277
- helperText: isTouched && helperText,
4278
- "aria-label": field.name,
4279
- ...props
4280
- }
4281
- );
4282
- };
4283
-
4284
- // src/hooks/FormHooks.ts
4285
- var { fieldContext, useFieldContext, formContext, useFormContext } = (0, import_react_form.createFormHookContexts)();
4286
- var { useAppForm: useLayoutForm, withForm: withLayoutForm } = (0, import_react_form.createFormHook)({
4287
- fieldComponents: {
4288
- TextField: FormTextField,
4289
- NumberField: FormNumberField,
4290
- Autocomplete: FormAutocomplete,
4291
- Checkbox: FormCheckbox,
4292
- Switch: FormSwitch,
4293
- RadioGroup: FormRadioGroup,
4294
- Slider: FormSlider,
4295
- DatePicker: FormDatePicker,
4296
- DateTimePicker: FormDateTimePicker
4297
- },
4298
- formComponents: {
4299
- SubmitButton: FormSubmitButton
4300
- },
4301
- fieldContext,
4302
- formContext
4303
- });
4304
-
4305
- // src/index.ts
4306
- var import_use_local_storage_state2 = __toESM(require("use-local-storage-state"), 1);
4307
- var import_react_i18next9 = require("react-i18next");
4308
- var import_i18next3 = require("i18next");
4309
- // Annotate the CommonJS export names for ESM import in node:
4310
- 0 && (module.exports = {
4311
- ChipInputCell,
4312
- Dropzone,
4313
- EditableColumnHeader,
4314
- FileViewer,
4315
- LayoutProvider,
4316
- PageHeader,
4317
- Platform,
4318
- RouterButton,
4319
- RouterError,
4320
- RouterGridActionsCellItem,
4321
- RouterIconButton,
4322
- RouterLink,
4323
- RouterListItemButton,
4324
- RouterNotFound,
4325
- RouterTab,
4326
- TableContainer,
4327
- TypographyWithIcon,
4328
- rootRouteHead,
4329
- setSSRLanguage,
4330
- t,
4331
- useDeleteFile,
4332
- useDeleteFiles,
4333
- useDialogs,
4334
- useDownloadFile,
4335
- useFieldContext,
4336
- useFormContext,
4337
- useGetFile,
4338
- useGetFileMetas,
4339
- useGetFileThumbnail,
4340
- useLayoutForm,
4341
- useLocalStorageState,
4342
- useOpenFile,
4343
- useTranslation,
4344
- useUpdateFileMeta,
4345
- useUploadFile,
4346
- uuidv7,
4347
- wczApiClient,
4348
- withLayoutForm
4349
- });
4350
- /*! Bundled license information:
4351
-
4352
- react-is/cjs/react-is.production.min.js:
4353
- (** @license React v16.13.1
4354
- * react-is.production.min.js
4355
- *
4356
- * Copyright (c) Facebook, Inc. and its affiliates.
4357
- *
4358
- * This source code is licensed under the MIT license found in the
4359
- * LICENSE file in the root directory of this source tree.
4360
- *)
4361
-
4362
- react-is/cjs/react-is.development.js:
4363
- (** @license React v16.13.1
4364
- * react-is.development.js
4365
- *
4366
- * Copyright (c) Facebook, Inc. and its affiliates.
4367
- *
4368
- * This source code is licensed under the MIT license found in the
4369
- * LICENSE file in the root directory of this source tree.
4370
- *)
4371
-
4372
- object-assign/index.js:
4373
- (*
4374
- object-assign
4375
- (c) Sindre Sorhus
4376
- @license MIT
4377
- *)
4378
- */
4379
- //# sourceMappingURL=index.cjs.map