@serhii.olishevskyi/docs 1.2.28 → 1.2.29

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.mjs CHANGED
@@ -19,6 +19,8 @@ import {
19
19
  UserRoleChipComponent,
20
20
  UserSettingsProvider,
21
21
  UserStatusChipComponent,
22
+ __commonJS,
23
+ __toESM,
22
24
  defaultUserSettings,
23
25
  fetchCompanySessions,
24
26
  fetchUserSessions,
@@ -43,7 +45,989 @@ import {
43
45
  useTranslationEdit,
44
46
  useTranslationNamespace,
45
47
  useUserSettings
46
- } from "./chunk-VFNVP7VE.mjs";
48
+ } from "./chunk-GAPN2BVY.mjs";
49
+
50
+ // node_modules/@babel/runtime/helpers/extends.js
51
+ var require_extends = __commonJS({
52
+ "node_modules/@babel/runtime/helpers/extends.js"(exports, module) {
53
+ "use strict";
54
+ function _extends11() {
55
+ return module.exports = _extends11 = Object.assign ? Object.assign.bind() : function(n) {
56
+ for (var e = 1; e < arguments.length; e++) {
57
+ var t = arguments[e];
58
+ for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]);
59
+ }
60
+ return n;
61
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends11.apply(null, arguments);
62
+ }
63
+ module.exports = _extends11, module.exports.__esModule = true, module.exports["default"] = module.exports;
64
+ }
65
+ });
66
+
67
+ // node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js
68
+ var require_objectWithoutPropertiesLoose = __commonJS({
69
+ "node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"(exports, module) {
70
+ "use strict";
71
+ function _objectWithoutPropertiesLoose6(r2, e) {
72
+ if (null == r2) return {};
73
+ var t = {};
74
+ for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) {
75
+ if (-1 !== e.indexOf(n)) continue;
76
+ t[n] = r2[n];
77
+ }
78
+ return t;
79
+ }
80
+ module.exports = _objectWithoutPropertiesLoose6, module.exports.__esModule = true, module.exports["default"] = module.exports;
81
+ }
82
+ });
83
+
84
+ // node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
85
+ var require_react_is_production_min = __commonJS({
86
+ "node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
87
+ "use strict";
88
+ var b = "function" === typeof Symbol && Symbol.for;
89
+ var c = b ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
90
+ var d = b ? /* @__PURE__ */ Symbol.for("react.portal") : 60106;
91
+ var e = b ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107;
92
+ var f = b ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108;
93
+ var g = b ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114;
94
+ var h = b ? /* @__PURE__ */ Symbol.for("react.provider") : 60109;
95
+ var k = b ? /* @__PURE__ */ Symbol.for("react.context") : 60110;
96
+ var l = b ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111;
97
+ var m = b ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111;
98
+ var n = b ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112;
99
+ var p = b ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113;
100
+ var q = b ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120;
101
+ var r2 = b ? /* @__PURE__ */ Symbol.for("react.memo") : 60115;
102
+ var t = b ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116;
103
+ var v = b ? /* @__PURE__ */ Symbol.for("react.block") : 60121;
104
+ var w = b ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117;
105
+ var x = b ? /* @__PURE__ */ Symbol.for("react.responder") : 60118;
106
+ var y = b ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
107
+ function z(a) {
108
+ if ("object" === typeof a && null !== a) {
109
+ var u = a.$$typeof;
110
+ switch (u) {
111
+ case c:
112
+ switch (a = a.type, a) {
113
+ case l:
114
+ case m:
115
+ case e:
116
+ case g:
117
+ case f:
118
+ case p:
119
+ return a;
120
+ default:
121
+ switch (a = a && a.$$typeof, a) {
122
+ case k:
123
+ case n:
124
+ case t:
125
+ case r2:
126
+ case h:
127
+ return a;
128
+ default:
129
+ return u;
130
+ }
131
+ }
132
+ case d:
133
+ return u;
134
+ }
135
+ }
136
+ }
137
+ function A(a) {
138
+ return z(a) === m;
139
+ }
140
+ exports.AsyncMode = l;
141
+ exports.ConcurrentMode = m;
142
+ exports.ContextConsumer = k;
143
+ exports.ContextProvider = h;
144
+ exports.Element = c;
145
+ exports.ForwardRef = n;
146
+ exports.Fragment = e;
147
+ exports.Lazy = t;
148
+ exports.Memo = r2;
149
+ exports.Portal = d;
150
+ exports.Profiler = g;
151
+ exports.StrictMode = f;
152
+ exports.Suspense = p;
153
+ exports.isAsyncMode = function(a) {
154
+ return A(a) || z(a) === l;
155
+ };
156
+ exports.isConcurrentMode = A;
157
+ exports.isContextConsumer = function(a) {
158
+ return z(a) === k;
159
+ };
160
+ exports.isContextProvider = function(a) {
161
+ return z(a) === h;
162
+ };
163
+ exports.isElement = function(a) {
164
+ return "object" === typeof a && null !== a && a.$$typeof === c;
165
+ };
166
+ exports.isForwardRef = function(a) {
167
+ return z(a) === n;
168
+ };
169
+ exports.isFragment = function(a) {
170
+ return z(a) === e;
171
+ };
172
+ exports.isLazy = function(a) {
173
+ return z(a) === t;
174
+ };
175
+ exports.isMemo = function(a) {
176
+ return z(a) === r2;
177
+ };
178
+ exports.isPortal = function(a) {
179
+ return z(a) === d;
180
+ };
181
+ exports.isProfiler = function(a) {
182
+ return z(a) === g;
183
+ };
184
+ exports.isStrictMode = function(a) {
185
+ return z(a) === f;
186
+ };
187
+ exports.isSuspense = function(a) {
188
+ return z(a) === p;
189
+ };
190
+ exports.isValidElementType = function(a) {
191
+ 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 === t || a.$$typeof === r2 || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
192
+ };
193
+ exports.typeOf = z;
194
+ }
195
+ });
196
+
197
+ // node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
198
+ var require_react_is_development = __commonJS({
199
+ "node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports) {
200
+ "use strict";
201
+ if (process.env.NODE_ENV !== "production") {
202
+ (function() {
203
+ "use strict";
204
+ var hasSymbol = typeof Symbol === "function" && Symbol.for;
205
+ var REACT_ELEMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
206
+ var REACT_PORTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.portal") : 60106;
207
+ var REACT_FRAGMENT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107;
208
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108;
209
+ var REACT_PROFILER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114;
210
+ var REACT_PROVIDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.provider") : 60109;
211
+ var REACT_CONTEXT_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.context") : 60110;
212
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111;
213
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111;
214
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112;
215
+ var REACT_SUSPENSE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113;
216
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120;
217
+ var REACT_MEMO_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.memo") : 60115;
218
+ var REACT_LAZY_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116;
219
+ var REACT_BLOCK_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.block") : 60121;
220
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117;
221
+ var REACT_RESPONDER_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.responder") : 60118;
222
+ var REACT_SCOPE_TYPE = hasSymbol ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
223
+ function isValidElementType(type) {
224
+ return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
225
+ 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);
226
+ }
227
+ function typeOf(object) {
228
+ if (typeof object === "object" && object !== null) {
229
+ var $$typeof = object.$$typeof;
230
+ switch ($$typeof) {
231
+ case REACT_ELEMENT_TYPE:
232
+ var type = object.type;
233
+ switch (type) {
234
+ case REACT_ASYNC_MODE_TYPE:
235
+ case REACT_CONCURRENT_MODE_TYPE:
236
+ case REACT_FRAGMENT_TYPE:
237
+ case REACT_PROFILER_TYPE:
238
+ case REACT_STRICT_MODE_TYPE:
239
+ case REACT_SUSPENSE_TYPE:
240
+ return type;
241
+ default:
242
+ var $$typeofType = type && type.$$typeof;
243
+ switch ($$typeofType) {
244
+ case REACT_CONTEXT_TYPE:
245
+ case REACT_FORWARD_REF_TYPE:
246
+ case REACT_LAZY_TYPE:
247
+ case REACT_MEMO_TYPE:
248
+ case REACT_PROVIDER_TYPE:
249
+ return $$typeofType;
250
+ default:
251
+ return $$typeof;
252
+ }
253
+ }
254
+ case REACT_PORTAL_TYPE:
255
+ return $$typeof;
256
+ }
257
+ }
258
+ return void 0;
259
+ }
260
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
261
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
262
+ var ContextConsumer = REACT_CONTEXT_TYPE;
263
+ var ContextProvider = REACT_PROVIDER_TYPE;
264
+ var Element = REACT_ELEMENT_TYPE;
265
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
266
+ var Fragment20 = REACT_FRAGMENT_TYPE;
267
+ var Lazy = REACT_LAZY_TYPE;
268
+ var Memo = REACT_MEMO_TYPE;
269
+ var Portal = REACT_PORTAL_TYPE;
270
+ var Profiler = REACT_PROFILER_TYPE;
271
+ var StrictMode = REACT_STRICT_MODE_TYPE;
272
+ var Suspense2 = REACT_SUSPENSE_TYPE;
273
+ var hasWarnedAboutDeprecatedIsAsyncMode = false;
274
+ function isAsyncMode(object) {
275
+ {
276
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
277
+ hasWarnedAboutDeprecatedIsAsyncMode = true;
278
+ 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.");
279
+ }
280
+ }
281
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
282
+ }
283
+ function isConcurrentMode(object) {
284
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
285
+ }
286
+ function isContextConsumer(object) {
287
+ return typeOf(object) === REACT_CONTEXT_TYPE;
288
+ }
289
+ function isContextProvider(object) {
290
+ return typeOf(object) === REACT_PROVIDER_TYPE;
291
+ }
292
+ function isElement(object) {
293
+ return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
294
+ }
295
+ function isForwardRef(object) {
296
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
297
+ }
298
+ function isFragment(object) {
299
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
300
+ }
301
+ function isLazy(object) {
302
+ return typeOf(object) === REACT_LAZY_TYPE;
303
+ }
304
+ function isMemo(object) {
305
+ return typeOf(object) === REACT_MEMO_TYPE;
306
+ }
307
+ function isPortal(object) {
308
+ return typeOf(object) === REACT_PORTAL_TYPE;
309
+ }
310
+ function isProfiler(object) {
311
+ return typeOf(object) === REACT_PROFILER_TYPE;
312
+ }
313
+ function isStrictMode(object) {
314
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
315
+ }
316
+ function isSuspense(object) {
317
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
318
+ }
319
+ exports.AsyncMode = AsyncMode;
320
+ exports.ConcurrentMode = ConcurrentMode;
321
+ exports.ContextConsumer = ContextConsumer;
322
+ exports.ContextProvider = ContextProvider;
323
+ exports.Element = Element;
324
+ exports.ForwardRef = ForwardRef;
325
+ exports.Fragment = Fragment20;
326
+ exports.Lazy = Lazy;
327
+ exports.Memo = Memo;
328
+ exports.Portal = Portal;
329
+ exports.Profiler = Profiler;
330
+ exports.StrictMode = StrictMode;
331
+ exports.Suspense = Suspense2;
332
+ exports.isAsyncMode = isAsyncMode;
333
+ exports.isConcurrentMode = isConcurrentMode;
334
+ exports.isContextConsumer = isContextConsumer;
335
+ exports.isContextProvider = isContextProvider;
336
+ exports.isElement = isElement;
337
+ exports.isForwardRef = isForwardRef;
338
+ exports.isFragment = isFragment;
339
+ exports.isLazy = isLazy;
340
+ exports.isMemo = isMemo;
341
+ exports.isPortal = isPortal;
342
+ exports.isProfiler = isProfiler;
343
+ exports.isStrictMode = isStrictMode;
344
+ exports.isSuspense = isSuspense;
345
+ exports.isValidElementType = isValidElementType;
346
+ exports.typeOf = typeOf;
347
+ })();
348
+ }
349
+ }
350
+ });
351
+
352
+ // node_modules/prop-types/node_modules/react-is/index.js
353
+ var require_react_is = __commonJS({
354
+ "node_modules/prop-types/node_modules/react-is/index.js"(exports, module) {
355
+ "use strict";
356
+ if (process.env.NODE_ENV === "production") {
357
+ module.exports = require_react_is_production_min();
358
+ } else {
359
+ module.exports = require_react_is_development();
360
+ }
361
+ }
362
+ });
363
+
364
+ // node_modules/object-assign/index.js
365
+ var require_object_assign = __commonJS({
366
+ "node_modules/object-assign/index.js"(exports, module) {
367
+ "use strict";
368
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
369
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
370
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
371
+ function toObject(val) {
372
+ if (val === null || val === void 0) {
373
+ throw new TypeError("Object.assign cannot be called with null or undefined");
374
+ }
375
+ return Object(val);
376
+ }
377
+ function shouldUseNative() {
378
+ try {
379
+ if (!Object.assign) {
380
+ return false;
381
+ }
382
+ var test1 = new String("abc");
383
+ test1[5] = "de";
384
+ if (Object.getOwnPropertyNames(test1)[0] === "5") {
385
+ return false;
386
+ }
387
+ var test2 = {};
388
+ for (var i = 0; i < 10; i++) {
389
+ test2["_" + String.fromCharCode(i)] = i;
390
+ }
391
+ var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
392
+ return test2[n];
393
+ });
394
+ if (order2.join("") !== "0123456789") {
395
+ return false;
396
+ }
397
+ var test3 = {};
398
+ "abcdefghijklmnopqrst".split("").forEach(function(letter) {
399
+ test3[letter] = letter;
400
+ });
401
+ if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
402
+ return false;
403
+ }
404
+ return true;
405
+ } catch (err) {
406
+ return false;
407
+ }
408
+ }
409
+ module.exports = shouldUseNative() ? Object.assign : function(target, source) {
410
+ var from;
411
+ var to = toObject(target);
412
+ var symbols;
413
+ for (var s = 1; s < arguments.length; s++) {
414
+ from = Object(arguments[s]);
415
+ for (var key in from) {
416
+ if (hasOwnProperty.call(from, key)) {
417
+ to[key] = from[key];
418
+ }
419
+ }
420
+ if (getOwnPropertySymbols) {
421
+ symbols = getOwnPropertySymbols(from);
422
+ for (var i = 0; i < symbols.length; i++) {
423
+ if (propIsEnumerable.call(from, symbols[i])) {
424
+ to[symbols[i]] = from[symbols[i]];
425
+ }
426
+ }
427
+ }
428
+ }
429
+ return to;
430
+ };
431
+ }
432
+ });
433
+
434
+ // node_modules/prop-types/lib/ReactPropTypesSecret.js
435
+ var require_ReactPropTypesSecret = __commonJS({
436
+ "node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
437
+ "use strict";
438
+ var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
439
+ module.exports = ReactPropTypesSecret;
440
+ }
441
+ });
442
+
443
+ // node_modules/prop-types/lib/has.js
444
+ var require_has = __commonJS({
445
+ "node_modules/prop-types/lib/has.js"(exports, module) {
446
+ "use strict";
447
+ module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
448
+ }
449
+ });
450
+
451
+ // node_modules/prop-types/checkPropTypes.js
452
+ var require_checkPropTypes = __commonJS({
453
+ "node_modules/prop-types/checkPropTypes.js"(exports, module) {
454
+ "use strict";
455
+ var printWarning = function() {
456
+ };
457
+ if (process.env.NODE_ENV !== "production") {
458
+ ReactPropTypesSecret = require_ReactPropTypesSecret();
459
+ loggedTypeFailures = {};
460
+ has = require_has();
461
+ printWarning = function(text) {
462
+ var message = "Warning: " + text;
463
+ if (typeof console !== "undefined") {
464
+ console.error(message);
465
+ }
466
+ try {
467
+ throw new Error(message);
468
+ } catch (x) {
469
+ }
470
+ };
471
+ }
472
+ var ReactPropTypesSecret;
473
+ var loggedTypeFailures;
474
+ var has;
475
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
476
+ if (process.env.NODE_ENV !== "production") {
477
+ for (var typeSpecName in typeSpecs) {
478
+ if (has(typeSpecs, typeSpecName)) {
479
+ var error;
480
+ try {
481
+ if (typeof typeSpecs[typeSpecName] !== "function") {
482
+ var err = Error(
483
+ (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`."
484
+ );
485
+ err.name = "Invariant Violation";
486
+ throw err;
487
+ }
488
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
489
+ } catch (ex) {
490
+ error = ex;
491
+ }
492
+ if (error && !(error instanceof Error)) {
493
+ printWarning(
494
+ (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)."
495
+ );
496
+ }
497
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
498
+ loggedTypeFailures[error.message] = true;
499
+ var stack = getStack ? getStack() : "";
500
+ printWarning(
501
+ "Failed " + location + " type: " + error.message + (stack != null ? stack : "")
502
+ );
503
+ }
504
+ }
505
+ }
506
+ }
507
+ }
508
+ checkPropTypes.resetWarningCache = function() {
509
+ if (process.env.NODE_ENV !== "production") {
510
+ loggedTypeFailures = {};
511
+ }
512
+ };
513
+ module.exports = checkPropTypes;
514
+ }
515
+ });
516
+
517
+ // node_modules/prop-types/factoryWithTypeCheckers.js
518
+ var require_factoryWithTypeCheckers = __commonJS({
519
+ "node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) {
520
+ "use strict";
521
+ var ReactIs = require_react_is();
522
+ var assign = require_object_assign();
523
+ var ReactPropTypesSecret = require_ReactPropTypesSecret();
524
+ var has = require_has();
525
+ var checkPropTypes = require_checkPropTypes();
526
+ var printWarning = function() {
527
+ };
528
+ if (process.env.NODE_ENV !== "production") {
529
+ printWarning = function(text) {
530
+ var message = "Warning: " + text;
531
+ if (typeof console !== "undefined") {
532
+ console.error(message);
533
+ }
534
+ try {
535
+ throw new Error(message);
536
+ } catch (x) {
537
+ }
538
+ };
539
+ }
540
+ function emptyFunctionThatReturnsNull() {
541
+ return null;
542
+ }
543
+ module.exports = function(isValidElement2, throwOnDirectAccess) {
544
+ var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
545
+ var FAUX_ITERATOR_SYMBOL = "@@iterator";
546
+ function getIteratorFn(maybeIterable) {
547
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
548
+ if (typeof iteratorFn === "function") {
549
+ return iteratorFn;
550
+ }
551
+ }
552
+ var ANONYMOUS = "<<anonymous>>";
553
+ var ReactPropTypes = {
554
+ array: createPrimitiveTypeChecker("array"),
555
+ bigint: createPrimitiveTypeChecker("bigint"),
556
+ bool: createPrimitiveTypeChecker("boolean"),
557
+ func: createPrimitiveTypeChecker("function"),
558
+ number: createPrimitiveTypeChecker("number"),
559
+ object: createPrimitiveTypeChecker("object"),
560
+ string: createPrimitiveTypeChecker("string"),
561
+ symbol: createPrimitiveTypeChecker("symbol"),
562
+ any: createAnyTypeChecker(),
563
+ arrayOf: createArrayOfTypeChecker,
564
+ element: createElementTypeChecker(),
565
+ elementType: createElementTypeTypeChecker(),
566
+ instanceOf: createInstanceTypeChecker,
567
+ node: createNodeChecker(),
568
+ objectOf: createObjectOfTypeChecker,
569
+ oneOf: createEnumTypeChecker,
570
+ oneOfType: createUnionTypeChecker,
571
+ shape: createShapeTypeChecker,
572
+ exact: createStrictShapeTypeChecker
573
+ };
574
+ function is2(x, y) {
575
+ if (x === y) {
576
+ return x !== 0 || 1 / x === 1 / y;
577
+ } else {
578
+ return x !== x && y !== y;
579
+ }
580
+ }
581
+ function PropTypeError(message, data) {
582
+ this.message = message;
583
+ this.data = data && typeof data === "object" ? data : {};
584
+ this.stack = "";
585
+ }
586
+ PropTypeError.prototype = Error.prototype;
587
+ function createChainableTypeChecker(validate) {
588
+ if (process.env.NODE_ENV !== "production") {
589
+ var manualPropTypeCallCache = {};
590
+ var manualPropTypeWarningCount = 0;
591
+ }
592
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
593
+ componentName = componentName || ANONYMOUS;
594
+ propFullName = propFullName || propName;
595
+ if (secret !== ReactPropTypesSecret) {
596
+ if (throwOnDirectAccess) {
597
+ var err = new Error(
598
+ "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"
599
+ );
600
+ err.name = "Invariant Violation";
601
+ throw err;
602
+ } else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
603
+ var cacheKey = componentName + ":" + propName;
604
+ if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
605
+ manualPropTypeWarningCount < 3) {
606
+ printWarning(
607
+ "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."
608
+ );
609
+ manualPropTypeCallCache[cacheKey] = true;
610
+ manualPropTypeWarningCount++;
611
+ }
612
+ }
613
+ }
614
+ if (props[propName] == null) {
615
+ if (isRequired) {
616
+ if (props[propName] === null) {
617
+ return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
618
+ }
619
+ return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
620
+ }
621
+ return null;
622
+ } else {
623
+ return validate(props, propName, componentName, location, propFullName);
624
+ }
625
+ }
626
+ var chainedCheckType = checkType.bind(null, false);
627
+ chainedCheckType.isRequired = checkType.bind(null, true);
628
+ return chainedCheckType;
629
+ }
630
+ function createPrimitiveTypeChecker(expectedType) {
631
+ function validate(props, propName, componentName, location, propFullName, secret) {
632
+ var propValue = props[propName];
633
+ var propType = getPropType(propValue);
634
+ if (propType !== expectedType) {
635
+ var preciseType = getPreciseType(propValue);
636
+ return new PropTypeError(
637
+ "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
638
+ { expectedType }
639
+ );
640
+ }
641
+ return null;
642
+ }
643
+ return createChainableTypeChecker(validate);
644
+ }
645
+ function createAnyTypeChecker() {
646
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
647
+ }
648
+ function createArrayOfTypeChecker(typeChecker) {
649
+ function validate(props, propName, componentName, location, propFullName) {
650
+ if (typeof typeChecker !== "function") {
651
+ return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
652
+ }
653
+ var propValue = props[propName];
654
+ if (!Array.isArray(propValue)) {
655
+ var propType = getPropType(propValue);
656
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
657
+ }
658
+ for (var i = 0; i < propValue.length; i++) {
659
+ var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
660
+ if (error instanceof Error) {
661
+ return error;
662
+ }
663
+ }
664
+ return null;
665
+ }
666
+ return createChainableTypeChecker(validate);
667
+ }
668
+ function createElementTypeChecker() {
669
+ function validate(props, propName, componentName, location, propFullName) {
670
+ var propValue = props[propName];
671
+ if (!isValidElement2(propValue)) {
672
+ var propType = getPropType(propValue);
673
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
674
+ }
675
+ return null;
676
+ }
677
+ return createChainableTypeChecker(validate);
678
+ }
679
+ function createElementTypeTypeChecker() {
680
+ function validate(props, propName, componentName, location, propFullName) {
681
+ var propValue = props[propName];
682
+ if (!ReactIs.isValidElementType(propValue)) {
683
+ var propType = getPropType(propValue);
684
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
685
+ }
686
+ return null;
687
+ }
688
+ return createChainableTypeChecker(validate);
689
+ }
690
+ function createInstanceTypeChecker(expectedClass) {
691
+ function validate(props, propName, componentName, location, propFullName) {
692
+ if (!(props[propName] instanceof expectedClass)) {
693
+ var expectedClassName = expectedClass.name || ANONYMOUS;
694
+ var actualClassName = getClassName(props[propName]);
695
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
696
+ }
697
+ return null;
698
+ }
699
+ return createChainableTypeChecker(validate);
700
+ }
701
+ function createEnumTypeChecker(expectedValues) {
702
+ if (!Array.isArray(expectedValues)) {
703
+ if (process.env.NODE_ENV !== "production") {
704
+ if (arguments.length > 1) {
705
+ printWarning(
706
+ "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])."
707
+ );
708
+ } else {
709
+ printWarning("Invalid argument supplied to oneOf, expected an array.");
710
+ }
711
+ }
712
+ return emptyFunctionThatReturnsNull;
713
+ }
714
+ function validate(props, propName, componentName, location, propFullName) {
715
+ var propValue = props[propName];
716
+ for (var i = 0; i < expectedValues.length; i++) {
717
+ if (is2(propValue, expectedValues[i])) {
718
+ return null;
719
+ }
720
+ }
721
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
722
+ var type = getPreciseType(value);
723
+ if (type === "symbol") {
724
+ return String(value);
725
+ }
726
+ return value;
727
+ });
728
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
729
+ }
730
+ return createChainableTypeChecker(validate);
731
+ }
732
+ function createObjectOfTypeChecker(typeChecker) {
733
+ function validate(props, propName, componentName, location, propFullName) {
734
+ if (typeof typeChecker !== "function") {
735
+ return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
736
+ }
737
+ var propValue = props[propName];
738
+ var propType = getPropType(propValue);
739
+ if (propType !== "object") {
740
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
741
+ }
742
+ for (var key in propValue) {
743
+ if (has(propValue, key)) {
744
+ var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
745
+ if (error instanceof Error) {
746
+ return error;
747
+ }
748
+ }
749
+ }
750
+ return null;
751
+ }
752
+ return createChainableTypeChecker(validate);
753
+ }
754
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
755
+ if (!Array.isArray(arrayOfTypeCheckers)) {
756
+ process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
757
+ return emptyFunctionThatReturnsNull;
758
+ }
759
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
760
+ var checker = arrayOfTypeCheckers[i];
761
+ if (typeof checker !== "function") {
762
+ printWarning(
763
+ "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
764
+ );
765
+ return emptyFunctionThatReturnsNull;
766
+ }
767
+ }
768
+ function validate(props, propName, componentName, location, propFullName) {
769
+ var expectedTypes = [];
770
+ for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
771
+ var checker2 = arrayOfTypeCheckers[i2];
772
+ var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
773
+ if (checkerResult == null) {
774
+ return null;
775
+ }
776
+ if (checkerResult.data && has(checkerResult.data, "expectedType")) {
777
+ expectedTypes.push(checkerResult.data.expectedType);
778
+ }
779
+ }
780
+ var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
781
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
782
+ }
783
+ return createChainableTypeChecker(validate);
784
+ }
785
+ function createNodeChecker() {
786
+ function validate(props, propName, componentName, location, propFullName) {
787
+ if (!isNode(props[propName])) {
788
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
789
+ }
790
+ return null;
791
+ }
792
+ return createChainableTypeChecker(validate);
793
+ }
794
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
795
+ return new PropTypeError(
796
+ (componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
797
+ );
798
+ }
799
+ function createShapeTypeChecker(shapeTypes) {
800
+ function validate(props, propName, componentName, location, propFullName) {
801
+ var propValue = props[propName];
802
+ var propType = getPropType(propValue);
803
+ if (propType !== "object") {
804
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
805
+ }
806
+ for (var key in shapeTypes) {
807
+ var checker = shapeTypes[key];
808
+ if (typeof checker !== "function") {
809
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
810
+ }
811
+ var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
812
+ if (error) {
813
+ return error;
814
+ }
815
+ }
816
+ return null;
817
+ }
818
+ return createChainableTypeChecker(validate);
819
+ }
820
+ function createStrictShapeTypeChecker(shapeTypes) {
821
+ function validate(props, propName, componentName, location, propFullName) {
822
+ var propValue = props[propName];
823
+ var propType = getPropType(propValue);
824
+ if (propType !== "object") {
825
+ return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
826
+ }
827
+ var allKeys = assign({}, props[propName], shapeTypes);
828
+ for (var key in allKeys) {
829
+ var checker = shapeTypes[key];
830
+ if (has(shapeTypes, key) && typeof checker !== "function") {
831
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
832
+ }
833
+ if (!checker) {
834
+ return new PropTypeError(
835
+ "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
836
+ );
837
+ }
838
+ var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
839
+ if (error) {
840
+ return error;
841
+ }
842
+ }
843
+ return null;
844
+ }
845
+ return createChainableTypeChecker(validate);
846
+ }
847
+ function isNode(propValue) {
848
+ switch (typeof propValue) {
849
+ case "number":
850
+ case "string":
851
+ case "undefined":
852
+ return true;
853
+ case "boolean":
854
+ return !propValue;
855
+ case "object":
856
+ if (Array.isArray(propValue)) {
857
+ return propValue.every(isNode);
858
+ }
859
+ if (propValue === null || isValidElement2(propValue)) {
860
+ return true;
861
+ }
862
+ var iteratorFn = getIteratorFn(propValue);
863
+ if (iteratorFn) {
864
+ var iterator = iteratorFn.call(propValue);
865
+ var step;
866
+ if (iteratorFn !== propValue.entries) {
867
+ while (!(step = iterator.next()).done) {
868
+ if (!isNode(step.value)) {
869
+ return false;
870
+ }
871
+ }
872
+ } else {
873
+ while (!(step = iterator.next()).done) {
874
+ var entry = step.value;
875
+ if (entry) {
876
+ if (!isNode(entry[1])) {
877
+ return false;
878
+ }
879
+ }
880
+ }
881
+ }
882
+ } else {
883
+ return false;
884
+ }
885
+ return true;
886
+ default:
887
+ return false;
888
+ }
889
+ }
890
+ function isSymbol(propType, propValue) {
891
+ if (propType === "symbol") {
892
+ return true;
893
+ }
894
+ if (!propValue) {
895
+ return false;
896
+ }
897
+ if (propValue["@@toStringTag"] === "Symbol") {
898
+ return true;
899
+ }
900
+ if (typeof Symbol === "function" && propValue instanceof Symbol) {
901
+ return true;
902
+ }
903
+ return false;
904
+ }
905
+ function getPropType(propValue) {
906
+ var propType = typeof propValue;
907
+ if (Array.isArray(propValue)) {
908
+ return "array";
909
+ }
910
+ if (propValue instanceof RegExp) {
911
+ return "object";
912
+ }
913
+ if (isSymbol(propType, propValue)) {
914
+ return "symbol";
915
+ }
916
+ return propType;
917
+ }
918
+ function getPreciseType(propValue) {
919
+ if (typeof propValue === "undefined" || propValue === null) {
920
+ return "" + propValue;
921
+ }
922
+ var propType = getPropType(propValue);
923
+ if (propType === "object") {
924
+ if (propValue instanceof Date) {
925
+ return "date";
926
+ } else if (propValue instanceof RegExp) {
927
+ return "regexp";
928
+ }
929
+ }
930
+ return propType;
931
+ }
932
+ function getPostfixForTypeWarning(value) {
933
+ var type = getPreciseType(value);
934
+ switch (type) {
935
+ case "array":
936
+ case "object":
937
+ return "an " + type;
938
+ case "boolean":
939
+ case "date":
940
+ case "regexp":
941
+ return "a " + type;
942
+ default:
943
+ return type;
944
+ }
945
+ }
946
+ function getClassName(propValue) {
947
+ if (!propValue.constructor || !propValue.constructor.name) {
948
+ return ANONYMOUS;
949
+ }
950
+ return propValue.constructor.name;
951
+ }
952
+ ReactPropTypes.checkPropTypes = checkPropTypes;
953
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
954
+ ReactPropTypes.PropTypes = ReactPropTypes;
955
+ return ReactPropTypes;
956
+ };
957
+ }
958
+ });
959
+
960
+ // node_modules/prop-types/factoryWithThrowingShims.js
961
+ var require_factoryWithThrowingShims = __commonJS({
962
+ "node_modules/prop-types/factoryWithThrowingShims.js"(exports, module) {
963
+ "use strict";
964
+ var ReactPropTypesSecret = require_ReactPropTypesSecret();
965
+ function emptyFunction() {
966
+ }
967
+ function emptyFunctionWithReset() {
968
+ }
969
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
970
+ module.exports = function() {
971
+ function shim(props, propName, componentName, location, propFullName, secret) {
972
+ if (secret === ReactPropTypesSecret) {
973
+ return;
974
+ }
975
+ var err = new Error(
976
+ "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"
977
+ );
978
+ err.name = "Invariant Violation";
979
+ throw err;
980
+ }
981
+ ;
982
+ shim.isRequired = shim;
983
+ function getShim() {
984
+ return shim;
985
+ }
986
+ ;
987
+ var ReactPropTypes = {
988
+ array: shim,
989
+ bigint: shim,
990
+ bool: shim,
991
+ func: shim,
992
+ number: shim,
993
+ object: shim,
994
+ string: shim,
995
+ symbol: shim,
996
+ any: shim,
997
+ arrayOf: getShim,
998
+ element: shim,
999
+ elementType: shim,
1000
+ instanceOf: getShim,
1001
+ node: shim,
1002
+ objectOf: getShim,
1003
+ oneOf: getShim,
1004
+ oneOfType: getShim,
1005
+ shape: getShim,
1006
+ exact: getShim,
1007
+ checkPropTypes: emptyFunctionWithReset,
1008
+ resetWarningCache: emptyFunction
1009
+ };
1010
+ ReactPropTypes.PropTypes = ReactPropTypes;
1011
+ return ReactPropTypes;
1012
+ };
1013
+ }
1014
+ });
1015
+
1016
+ // node_modules/prop-types/index.js
1017
+ var require_prop_types = __commonJS({
1018
+ "node_modules/prop-types/index.js"(exports, module) {
1019
+ "use strict";
1020
+ if (process.env.NODE_ENV !== "production") {
1021
+ ReactIs = require_react_is();
1022
+ throwOnDirectAccess = true;
1023
+ module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
1024
+ } else {
1025
+ module.exports = require_factoryWithThrowingShims()();
1026
+ }
1027
+ var ReactIs;
1028
+ var throwOnDirectAccess;
1029
+ }
1030
+ });
47
1031
 
48
1032
  // src/UI/components/inputs/TextFieldComponent.tsx
49
1033
  import { useState } from "react";
@@ -1985,7 +2969,7 @@ var RefreshButtonComponent = ({
1985
2969
  import { useState as useState9, useEffect as useEffect5, lazy, Suspense } from "react";
1986
2970
  import { Avatar, Tooltip as Tooltip5, Typography as Typography3 } from "@mui/material";
1987
2971
  import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
1988
- var LazyUserPopover = lazy(() => import("./UserPopoverComponent-VFSZ5ZO2.mjs"));
2972
+ var LazyUserPopover = lazy(() => import("./UserPopoverComponent-VYJOTERW.mjs"));
1989
2973
  var getInitials = (name) => {
1990
2974
  if (!name) return "?";
1991
2975
  const parts = name.trim().split(" ");
@@ -2847,6 +3831,46 @@ var PageComponent = ({
2847
3831
  import React13 from "react";
2848
3832
  import { Grid as Grid2, Paper } from "@mui/material";
2849
3833
  import { jsx as jsx18 } from "react/jsx-runtime";
3834
+ var widthToGridColumns = (width) => {
3835
+ switch (width) {
3836
+ case "25%":
3837
+ return 3;
3838
+ case "33%":
3839
+ return 4;
3840
+ case "50%":
3841
+ return 6;
3842
+ case "66%":
3843
+ return 8;
3844
+ case "75%":
3845
+ return 9;
3846
+ case "100%":
3847
+ default:
3848
+ return 12;
3849
+ }
3850
+ };
3851
+ var createGridSize = (desktopWidth, mobileWidth = "100%") => {
3852
+ return {
3853
+ xs: widthToGridColumns(mobileWidth),
3854
+ md: widthToGridColumns(desktopWidth)
3855
+ };
3856
+ };
3857
+ var FilterSection = ({
3858
+ width = "100%",
3859
+ mobileWidth = "100%",
3860
+ itemWidth = "50%",
3861
+ itemMobileWidth = "100%",
3862
+ children
3863
+ }) => {
3864
+ const sectionGridSize = createGridSize(width, mobileWidth);
3865
+ const itemGridSize = createGridSize(itemWidth, itemMobileWidth);
3866
+ return /* @__PURE__ */ jsx18(Grid2, { size: sectionGridSize, children: /* @__PURE__ */ jsx18(Grid2, { container: true, spacing: 2, sx: { alignItems: "center" }, children: React13.Children.map(children, (child) => {
3867
+ if (!child) return null;
3868
+ return (
3869
+ /* Автоматическая обертка каждого дочернего элемента в Grid size */
3870
+ /* @__PURE__ */ jsx18(Grid2, { size: itemGridSize, children: child })
3871
+ );
3872
+ }) }) });
3873
+ };
2850
3874
  var FilterContainerComponent = ({
2851
3875
  sections,
2852
3876
  children,
@@ -3427,29 +4451,2762 @@ var TablePaginationComponent = ({
3427
4451
  );
3428
4452
  };
3429
4453
 
3430
- // src/services/index.ts
3431
- var Services = {
3432
- SessionService: {
3433
- fetchCompanySessions,
3434
- trackUserSession,
3435
- trackUserSessionByRoute,
3436
- fetchUserSessions,
3437
- isCurrentSessionValid,
3438
- groupSessionsByUser,
3439
- getUserLastSeenAt,
3440
- getUsersLastSeenMap
3441
- }
3442
- };
3443
-
4454
+ // src/UI/components/tables/TableComponent.tsx
4455
+ import React42, { useState as useState22, useEffect as useEffect14, useCallback as useCallback11, useMemo as useMemo9, useImperativeHandle, forwardRef as forwardRef4, useRef as useRef9, isValidElement, memo } from "react";
4456
+ import {
4457
+ DataGridPremium,
4458
+ GridOverlay,
4459
+ useGridApiRef
4460
+ } from "@mui/x-data-grid-premium";
4461
+ import {
4462
+ Box as Box16,
4463
+ IconButton as IconButton13,
4464
+ Menu as Menu4,
4465
+ MenuItem as MenuItem8,
4466
+ ListItemIcon as ListItemIcon5,
4467
+ ListItemText as ListItemText6,
4468
+ Stack as Stack4,
4469
+ Paper as Paper3,
4470
+ Typography as Typography15,
4471
+ Divider as Divider9,
4472
+ Collapse as Collapse2
4473
+ } from "@mui/material";
4474
+ import SortByAlphaIcon from "@mui/icons-material/SortByAlpha";
4475
+ import MoreVertIcon2 from "@mui/icons-material/MoreVert";
4476
+ import RefreshIcon2 from "@mui/icons-material/Refresh";
4477
+ import FilterListIcon from "@mui/icons-material/FilterList";
4478
+
4479
+ // src/UI/components/tables/TableCustomPagination.tsx
4480
+ import { gridRowCountSelector, gridPaginationModelSelector, useGridApiContext, useGridRootProps, useGridSelector } from "@mui/x-data-grid-premium";
4481
+ import { Box as Box13 } from "@mui/material";
4482
+ import { jsx as jsx23 } from "react/jsx-runtime";
4483
+ var TableCustomPagination = ({}) => {
4484
+ const apiRef = useGridApiContext();
4485
+ const rootProps = useGridRootProps();
4486
+ const totalRowCount = useGridSelector(apiRef, gridRowCountSelector);
4487
+ const paginationModel = useGridSelector(apiRef, gridPaginationModelSelector);
4488
+ return /* @__PURE__ */ jsx23(Box13, { sx: { display: "flex", justifyContent: "flex-end", p: 1 }, children: /* @__PURE__ */ jsx23(
4489
+ TablePaginationComponent,
4490
+ {
4491
+ count: totalRowCount,
4492
+ rowsPerPage: paginationModel.pageSize,
4493
+ rowsPerPageOptions: rootProps.pageSizeOptions,
4494
+ page: paginationModel.page,
4495
+ onPageChange: (_, newPage) => {
4496
+ apiRef.current.setPage(newPage);
4497
+ },
4498
+ onRowsPerPageChange: (event) => {
4499
+ const newPageSize = parseInt(event.target.value, 10);
4500
+ apiRef.current.setPageSize(newPageSize);
4501
+ }
4502
+ }
4503
+ ) });
4504
+ };
4505
+
4506
+ // src/UI/components/tables/TableCustomColumnMenu.tsx
4507
+ import { FormatAlignCenter, FormatAlignLeft, FormatAlignRight, Restore } from "@mui/icons-material";
4508
+ import { Divider as Divider5, ListItemIcon as ListItemIcon3, ListItemText as ListItemText4, MenuItem as MenuItem5, ToggleButton, ToggleButtonGroup, Typography as Typography12 } from "@mui/material";
4509
+
4510
+ // node_modules/clsx/dist/clsx.mjs
4511
+ function r(e) {
4512
+ var t, f, n = "";
4513
+ if ("string" == typeof e || "number" == typeof e) n += e;
4514
+ else if ("object" == typeof e) if (Array.isArray(e)) {
4515
+ var o = e.length;
4516
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
4517
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
4518
+ return n;
4519
+ }
4520
+ function clsx() {
4521
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
4522
+ return n;
4523
+ }
4524
+ var clsx_default = clsx;
4525
+
4526
+ // node_modules/@mui/utils/useForkRef/useForkRef.mjs
4527
+ import * as React16 from "react";
4528
+ function useForkRef(...refs) {
4529
+ const cleanupRef = React16.useRef(void 0);
4530
+ const refEffect = React16.useCallback((instance) => {
4531
+ const cleanups = refs.map((ref) => {
4532
+ if (ref == null) {
4533
+ return null;
4534
+ }
4535
+ if (typeof ref === "function") {
4536
+ const refCallback = ref;
4537
+ const refCleanup = refCallback(instance);
4538
+ return typeof refCleanup === "function" ? refCleanup : () => {
4539
+ refCallback(null);
4540
+ };
4541
+ }
4542
+ ref.current = instance;
4543
+ return () => {
4544
+ ref.current = null;
4545
+ };
4546
+ });
4547
+ return () => {
4548
+ cleanups.forEach((refCleanup) => refCleanup?.());
4549
+ };
4550
+ }, refs);
4551
+ return React16.useMemo(() => {
4552
+ if (refs.every((ref) => ref == null)) {
4553
+ return null;
4554
+ }
4555
+ return (value) => {
4556
+ if (cleanupRef.current) {
4557
+ cleanupRef.current();
4558
+ cleanupRef.current = void 0;
4559
+ }
4560
+ if (value != null) {
4561
+ cleanupRef.current = refEffect(value);
4562
+ }
4563
+ };
4564
+ }, refs);
4565
+ }
4566
+
4567
+ // node_modules/@mui/utils/useEnhancedEffect/useEnhancedEffect.mjs
4568
+ import * as React17 from "react";
4569
+ var useEnhancedEffect = typeof window !== "undefined" ? React17.useLayoutEffect : React17.useEffect;
4570
+ var useEnhancedEffect_default = useEnhancedEffect;
4571
+
4572
+ // node_modules/@mui/x-internals/forwardRef/forwardRef.mjs
4573
+ import * as React19 from "react";
4574
+
4575
+ // node_modules/@base-ui/utils/reactVersion.mjs
4576
+ import * as React18 from "react";
4577
+ var majorVersion = parseInt(React18.version, 10);
4578
+ function isReactVersionAtLeast(reactVersionToCheck) {
4579
+ return majorVersion >= reactVersionToCheck;
4580
+ }
4581
+
4582
+ // node_modules/@mui/x-internals/forwardRef/forwardRef.mjs
4583
+ var forwardRef3 = (render) => {
4584
+ if (isReactVersionAtLeast(19)) {
4585
+ const Component = (props) => render(props, props.ref ?? null);
4586
+ Component.displayName = render.displayName ?? render.name;
4587
+ return Component;
4588
+ }
4589
+ return /* @__PURE__ */ React19.forwardRef(render);
4590
+ };
4591
+ if (process.env.NODE_ENV !== "production") forwardRef3.displayName = "forwardRef";
4592
+
4593
+ // node_modules/@mui/utils/useId/useId.mjs
4594
+ import * as React20 from "react";
4595
+ var globalId = 0;
4596
+ function useGlobalId(idOverride) {
4597
+ const [defaultId, setDefaultId] = React20.useState(idOverride);
4598
+ const id = idOverride || defaultId;
4599
+ React20.useEffect(() => {
4600
+ if (defaultId == null) {
4601
+ globalId += 1;
4602
+ setDefaultId(`mui-${globalId}`);
4603
+ }
4604
+ }, [defaultId]);
4605
+ return id;
4606
+ }
4607
+ var safeReact = {
4608
+ ...React20
4609
+ };
4610
+ var maybeReactUseId = safeReact.useId;
4611
+ function useId(idOverride) {
4612
+ if (maybeReactUseId !== void 0) {
4613
+ const reactId = maybeReactUseId();
4614
+ return idOverride ?? reactId;
4615
+ }
4616
+ return useGlobalId(idOverride);
4617
+ }
4618
+
4619
+ // node_modules/@base-ui/utils/formatErrorMessage.mjs
4620
+ function createFormatErrorMessage(baseUrl, prefix) {
4621
+ return function formatErrorMessage2(code, ...args) {
4622
+ const url = new URL(baseUrl);
4623
+ url.searchParams.set("code", code.toString());
4624
+ args.forEach((arg) => url.searchParams.append("args[]", arg));
4625
+ return `${prefix} error #${code}; visit ${url} for the full message.`;
4626
+ };
4627
+ }
4628
+ var formatErrorMessage = createFormatErrorMessage("https://base-ui.com/production-error", "Base UI");
4629
+ var formatErrorMessage_default = formatErrorMessage;
4630
+
4631
+ // node_modules/@mui/x-internals/formatErrorMessage/index.mjs
4632
+ var formatErrorMessage_default2 = createFormatErrorMessage("https://mui.com/x/production-error", "MUI X");
4633
+
4634
+ // node_modules/@mui/x-data-grid/hooks/utils/useGridRootProps.mjs
4635
+ import * as React22 from "react";
4636
+
4637
+ // node_modules/@mui/x-data-grid/context/GridRootPropsContext.mjs
4638
+ import * as React21 from "react";
4639
+ var GridRootPropsContext = /* @__PURE__ */ React21.createContext(void 0);
4640
+ if (process.env.NODE_ENV !== "production") GridRootPropsContext.displayName = "GridRootPropsContext";
4641
+
4642
+ // node_modules/@mui/x-data-grid/hooks/utils/useGridRootProps.mjs
4643
+ var useGridRootProps2 = () => {
4644
+ const contextValue = React22.useContext(GridRootPropsContext);
4645
+ if (!contextValue) {
4646
+ throw new Error(process.env.NODE_ENV !== "production" ? "MUI X Data Grid: useGridRootProps should only be used inside a Data Grid component. The component must be a child of DataGrid, DataGridPro, or DataGridPremium. Ensure your component is properly nested within a Data Grid." : formatErrorMessage_default2(70));
4647
+ }
4648
+ return contextValue;
4649
+ };
4650
+
4651
+ // node_modules/@mui/x-data-grid/hooks/utils/useGridApiContext.mjs
4652
+ import * as React24 from "react";
4653
+
4654
+ // node_modules/@mui/x-data-grid/components/GridApiContext.mjs
4655
+ import * as React23 from "react";
4656
+ var GridApiContext = /* @__PURE__ */ React23.createContext(void 0);
4657
+ if (process.env.NODE_ENV !== "production") GridApiContext.displayName = "GridApiContext";
4658
+
4659
+ // node_modules/@mui/x-data-grid/hooks/utils/useGridApiContext.mjs
4660
+ function useGridApiContext2() {
4661
+ const apiRef = React24.useContext(GridApiContext);
4662
+ if (apiRef === void 0) {
4663
+ throw new Error(process.env.NODE_ENV !== "production" ? "MUI X Data Grid: Could not find the Data Grid context. This happens when a component is rendered outside of a DataGrid, DataGridPro, or DataGridPremium parent component. Ensure your component is a child of a Data Grid component. This can also happen if you are bundling multiple versions of the Data Grid." : formatErrorMessage_default2(67));
4664
+ }
4665
+ return apiRef;
4666
+ }
4667
+
4668
+ // node_modules/@mui/utils/ClassNameGenerator/ClassNameGenerator.mjs
4669
+ var defaultGenerator = (componentName) => componentName;
4670
+ var createClassNameGenerator = () => {
4671
+ let generate = defaultGenerator;
4672
+ return {
4673
+ configure(generator) {
4674
+ generate = generator;
4675
+ },
4676
+ generate(componentName) {
4677
+ return generate(componentName);
4678
+ },
4679
+ reset() {
4680
+ generate = defaultGenerator;
4681
+ }
4682
+ };
4683
+ };
4684
+ var ClassNameGenerator = createClassNameGenerator();
4685
+ var ClassNameGenerator_default = ClassNameGenerator;
4686
+
4687
+ // node_modules/@mui/utils/generateUtilityClass/generateUtilityClass.mjs
4688
+ var globalStateClasses = {
4689
+ active: "active",
4690
+ checked: "checked",
4691
+ completed: "completed",
4692
+ disabled: "disabled",
4693
+ error: "error",
4694
+ expanded: "expanded",
4695
+ focused: "focused",
4696
+ focusVisible: "focusVisible",
4697
+ open: "open",
4698
+ readOnly: "readOnly",
4699
+ required: "required",
4700
+ selected: "selected"
4701
+ };
4702
+ function generateUtilityClass(componentName, slot, globalStatePrefix = "Mui") {
4703
+ const globalStateClass = globalStateClasses[slot];
4704
+ return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator_default.generate(componentName)}-${slot}`;
4705
+ }
4706
+
4707
+ // node_modules/@mui/utils/generateUtilityClasses/generateUtilityClasses.mjs
4708
+ function generateUtilityClasses(componentName, slots, globalStatePrefix = "Mui") {
4709
+ const result = {};
4710
+ slots.forEach((slot) => {
4711
+ result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
4712
+ });
4713
+ return result;
4714
+ }
4715
+
4716
+ // node_modules/@mui/x-data-grid/constants/gridClasses.mjs
4717
+ var gridClassesOverrides = {
4718
+ root: ["autoHeight", "autosizing", "root--densityStandard", "root--densityComfortable", "root--densityCompact", "root--disableUserSelection", "root--noToolbar", "withVerticalBorder"],
4719
+ children: [
4720
+ "actionsCell",
4721
+ "booleanCell",
4722
+ "cell",
4723
+ "cell--editable",
4724
+ "cell--editing",
4725
+ "cell--flex",
4726
+ "cell--pinnedLeft",
4727
+ "cell--pinnedRight",
4728
+ "cell--rangeBottom",
4729
+ "cell--rangeLeft",
4730
+ "cell--rangeRight",
4731
+ "cell--rangeTop",
4732
+ "cell--withFillHandle",
4733
+ "cell--fillPreview",
4734
+ "cell--fillPreviewTop",
4735
+ "cell--fillPreviewBottom",
4736
+ "cell--fillPreviewLeft",
4737
+ "cell--fillPreviewRight",
4738
+ "cell--selectionMode",
4739
+ "cell--textCenter",
4740
+ "cell--textLeft",
4741
+ "cell--textRight",
4742
+ "cell--withLeftBorder",
4743
+ "cell--withRightBorder",
4744
+ "cellCheckbox",
4745
+ "cellEmpty",
4746
+ "cellOffsetLeft",
4747
+ "cellSkeleton",
4748
+ "checkboxInput",
4749
+ "columnHeader",
4750
+ "columnHeader--alignCenter",
4751
+ "columnHeader--alignLeft",
4752
+ "columnHeader--alignRight",
4753
+ "columnHeader--dragging",
4754
+ "columnHeader--emptyGroup",
4755
+ "columnHeader--filledGroup",
4756
+ "columnHeader--filtered",
4757
+ "columnHeader--last",
4758
+ "columnHeader--moving",
4759
+ "columnHeader--numeric",
4760
+ "columnHeader--pinnedLeft",
4761
+ "columnHeader--pinnedRight",
4762
+ "columnHeader--siblingFocused",
4763
+ "columnHeader--sortable",
4764
+ "columnHeader--sorted",
4765
+ "columnHeader--withLeftBorder",
4766
+ "columnHeader--withRightBorder",
4767
+ "columnHeaderCheckbox",
4768
+ "columnHeaderDraggableContainer",
4769
+ "columnHeaderTitleContainer",
4770
+ "columnHeaderTitleContainerContent",
4771
+ "columnSeparator",
4772
+ "columnSeparator--resizable",
4773
+ "columnSeparator--resizing",
4774
+ "columnSeparator--sideLeft",
4775
+ "columnSeparator--sideRight",
4776
+ "container--bottom",
4777
+ "container--top",
4778
+ "detailPanelToggleCell",
4779
+ "detailPanelToggleCell--expanded",
4780
+ "editBooleanCell",
4781
+ "filterIcon",
4782
+ "filler--borderBottom",
4783
+ "filler--pinnedLeft",
4784
+ "filler--pinnedRight",
4785
+ "groupingCriteriaCell",
4786
+ "groupingCriteriaCellLoadingContainer",
4787
+ "groupingCriteriaCellToggle",
4788
+ "headerFilterRow",
4789
+ "iconSeparator",
4790
+ "menuIcon",
4791
+ "menuIconButton",
4792
+ "menuList",
4793
+ "menuOpen",
4794
+ "overlayWrapperInner",
4795
+ "pinnedRows",
4796
+ "pinnedRows--bottom",
4797
+ "pinnedRows--top",
4798
+ "row",
4799
+ "row--borderBottom",
4800
+ "row--detailPanelExpanded",
4801
+ // TODO v9: Rename to `cell--dragging`
4802
+ "row--dragging",
4803
+ "row--dynamicHeight",
4804
+ "row--editable",
4805
+ "row--editing",
4806
+ "row--firstVisible",
4807
+ "row--lastVisible",
4808
+ "rowReorderCell",
4809
+ "rowReorderCell--draggable",
4810
+ "rowReorderCellContainer",
4811
+ "rowReorderCellPlaceholder",
4812
+ "rowSkeleton",
4813
+ "scrollbar",
4814
+ "scrollbar--horizontal",
4815
+ "scrollbar--vertical",
4816
+ "scrollbarFiller",
4817
+ "scrollbarFiller--pinnedRight",
4818
+ "sortIcon",
4819
+ "treeDataGroupingCell",
4820
+ "treeDataGroupingCellLoadingContainer",
4821
+ "treeDataGroupingCellToggle",
4822
+ "withBorderColor",
4823
+ "row--beingDragged"
4824
+ ]
4825
+ };
4826
+ var gridClasses = generateUtilityClasses("MuiDataGrid", [...gridClassesOverrides.root, ...gridClassesOverrides.children, "aiAssistantPanel", "aiAssistantPanelHeader", "aiAssistantPanelTitleContainer", "aiAssistantPanelTitle", "aiAssistantPanelBody", "aiAssistantPanelEmptyText", "aiAssistantPanelFooter", "aiAssistantPanelConversation", "aiAssistantPanelConversationList", "aiAssistantPanelConversationTitle", "aiAssistantPanelSuggestions", "aiAssistantPanelSuggestionsList", "aiAssistantPanelSuggestionsItem", "aiAssistantPanelSuggestionsLabel", "aggregationColumnHeader", "aggregationColumnHeader--alignLeft", "aggregationColumnHeader--alignCenter", "aggregationColumnHeader--alignRight", "aggregationColumnHeaderLabel", "aggregationRowOverlayWrapper", "formulaColumnHeaderLetter", "formulaRowNumberCell", "formulaBar", "mainContent", "withSidePanel", "collapsible", "collapsibleTrigger", "collapsibleIcon", "collapsiblePanel", "columnHeader--filter", "columnHeaderFilterInput", "columnHeaderFilterOperatorLabel", "columnHeaderTitle", "columnHeaders", "columnsManagement", "columnsManagementRow", "columnsManagementHeader", "columnsManagementSearchInput", "columnsManagementFooter", "columnsManagementScrollArea", "columnsManagementEmptyText", "contentFiller", "detailPanel", "footerCell", "panel", "panelHeader", "panelWrapper", "panelContent", "panelFooter", "paper", "editInputCell", "longTextCell", "longTextCellContent", "longTextCellExpandButton", "longTextCellCollapseButton", "longTextCellPopup", "longTextCellPopperContent", "editLongTextCell", "editLongTextCellValue", "editLongTextCellPopup", "editLongTextCellPopperContent", "editLongTextCellTextarea", "multiSelectCell", "multiSelectCellChip", "multiSelectCellChip--hidden", "multiSelectCellOverflow", "multiSelectCellPopup", "multiSelectCellPopperContent", "editMultiSelectCell", "editMultiSelectCellChip", "editMultiSelectCellChip--hidden", "editMultiSelectCellOverflow", "editMultiSelectCellPopup", "editMultiSelectCellPopperContent", "filler", "filterForm", "filterFormDeleteIcon", "filterFormLogicOperatorInput", "filterFormColumnInput", "filterFormOperatorInput", "filterFormValueInput", "filler--horizontal", "footerContainer", "iconButtonContainer", "main", "main--hasPinnedRight", "main--hiddenContent", "menu", "overlay", "overlayWrapper", "root", "virtualizer--layoutControlled", "rowCount", "rowReorderIcon", "scrollArea--left", "scrollArea--right", "scrollArea--up", "scrollArea--down", "scrollArea", "scrollShadow", "scrollShadow--vertical", "scrollShadow--horizontal", "selectedRowCount", "sortButton", "shadowScrollArea", "sidebar", "sidebarHeader", "toolbarContainer", "toolbar", "toolbarLabel", "toolbarDivider", "toolbarFilterList", "toolbarQuickFilter", "toolbarQuickFilterTrigger", "toolbarQuickFilterControl", "virtualScroller", "virtualScroller--hasScrollX", "virtualScrollerContent", "virtualScrollerContent--overflowed", "virtualScrollerRenderZone", "pivotPanelAvailableFields", "pivotPanelField", "pivotPanelField--sorted", "pivotPanelFieldActionContainer", "pivotPanelFieldCheckbox", "pivotPanelFieldDragIcon", "pivotPanelFieldList", "pivotPanelFieldName", "pivotPanelHeader", "pivotPanelPlaceholder", "pivotPanelScrollArea", "pivotPanelSearchContainer", "pivotPanelSection", "pivotPanelSectionTitle", "pivotPanelSections", "pivotPanelSwitch", "pivotPanelSwitchLabel", "prompt", "promptContent", "promptText", "promptFeedback", "promptChangeList", "promptChangesToggle", "promptChangesToggleIcon", "promptIcon", "promptIconContainer", "promptError", "promptAction", "resizablePanelHandle", "resizablePanelHandle--horizontal", "resizablePanelHandle--vertical"]);
4827
+
4828
+ // node_modules/@mui/x-data-grid/hooks/utils/useGridSelector.mjs
4829
+ import * as React26 from "react";
4830
+
4831
+ // node_modules/@base-ui/utils/fastObjectShallowCompare.mjs
4832
+ var is = Object.is;
4833
+ function fastObjectShallowCompare(a, b) {
4834
+ if (a === b) {
4835
+ return true;
4836
+ }
4837
+ if (!(a instanceof Object) || !(b instanceof Object)) {
4838
+ return false;
4839
+ }
4840
+ let aLength = 0;
4841
+ let bLength = 0;
4842
+ for (const key in a) {
4843
+ aLength += 1;
4844
+ if (!is(a[key], b[key])) {
4845
+ return false;
4846
+ }
4847
+ if (!(key in b)) {
4848
+ return false;
4849
+ }
4850
+ }
4851
+ for (const _ in b) {
4852
+ bLength += 1;
4853
+ }
4854
+ return aLength === bLength;
4855
+ }
4856
+
4857
+ // node_modules/@base-ui/utils/createLogOnce.mjs
4858
+ var loggedMessages;
4859
+ if (process.env.NODE_ENV !== "production") {
4860
+ loggedMessages = /* @__PURE__ */ new Set();
4861
+ }
4862
+ function createLogOnce(severity, prefix) {
4863
+ return function logOnce(...messages) {
4864
+ if (process.env.NODE_ENV !== "production") {
4865
+ const message = messages.join(" ");
4866
+ const output = prefix ? `${prefix}: ${message}` : message;
4867
+ const key = `${severity}:${output}`;
4868
+ if (!loggedMessages.has(key)) {
4869
+ loggedMessages.add(key);
4870
+ if (severity === "warn") {
4871
+ console.warn(output);
4872
+ } else {
4873
+ console.error(output);
4874
+ }
4875
+ }
4876
+ }
4877
+ };
4878
+ }
4879
+
4880
+ // node_modules/@mui/x-internals/warning/index.mjs
4881
+ var warnOnce = createLogOnce("warn");
4882
+ var errorOnce = createLogOnce("error");
4883
+
4884
+ // node_modules/@mui/utils/useLazyRef/useLazyRef.mjs
4885
+ import * as React25 from "react";
4886
+ var UNINITIALIZED = {};
4887
+ function useLazyRef(init, initArg) {
4888
+ const ref = React25.useRef(UNINITIALIZED);
4889
+ if (ref.current === UNINITIALIZED) {
4890
+ ref.current = init(initArg);
4891
+ }
4892
+ return ref;
4893
+ }
4894
+
4895
+ // node_modules/@mui/x-data-grid/hooks/utils/useGridSelector.mjs
4896
+ var defaultCompare = Object.is;
4897
+ var objectShallowCompare = fastObjectShallowCompare;
4898
+ var arrayShallowCompare = (a, b) => {
4899
+ if (a === b) {
4900
+ return true;
4901
+ }
4902
+ return a.length === b.length && a.every((v, i) => v === b[i]);
4903
+ };
4904
+ var argsEqual = (prev, curr) => {
4905
+ let fn = Object.is;
4906
+ if (curr instanceof Array) {
4907
+ fn = arrayShallowCompare;
4908
+ } else if (curr instanceof Object) {
4909
+ fn = objectShallowCompare;
4910
+ }
4911
+ return fn(prev, curr);
4912
+ };
4913
+ var createRefs = () => ({
4914
+ state: null,
4915
+ equals: null,
4916
+ selector: null,
4917
+ args: void 0,
4918
+ storeState: null
4919
+ });
4920
+ var EMPTY = [];
4921
+ function useGridSelector2(apiRef, selector, args = void 0, equals = defaultCompare) {
4922
+ if (process.env.NODE_ENV !== "production" && !apiRef.current.state) {
4923
+ warnOnce(["MUI X: `useGridSelector` has been called before the initialization of the state.", "This hook can only be used inside the context of the grid."].join("\n"));
4924
+ }
4925
+ const refs = useLazyRef(createRefs);
4926
+ const didInit = refs.current.selector !== null;
4927
+ const [state, setState] = React26.useState(
4928
+ // We don't use an initialization function to avoid allocations
4929
+ didInit ? null : selector(apiRef, args)
4930
+ );
4931
+ refs.current.state = state;
4932
+ if (!didInit) {
4933
+ refs.current.storeState = apiRef.current.store.state;
4934
+ }
4935
+ refs.current.equals = equals;
4936
+ refs.current.selector = selector;
4937
+ const prevArgs = refs.current.args;
4938
+ refs.current.args = args;
4939
+ if (didInit && !argsEqual(prevArgs, args)) {
4940
+ const newState = refs.current.selector(apiRef, refs.current.args);
4941
+ if (!refs.current.equals(refs.current.state, newState)) {
4942
+ refs.current.state = newState;
4943
+ setState(newState);
4944
+ }
4945
+ refs.current.storeState = apiRef.current.store.state;
4946
+ }
4947
+ const updateState = React26.useCallback(
4948
+ () => {
4949
+ const storeState = apiRef.current.store.state;
4950
+ if (refs.current.storeState !== storeState) {
4951
+ const newState = refs.current.selector(apiRef, refs.current.args);
4952
+ refs.current.storeState = storeState;
4953
+ if (!refs.current.equals(refs.current.state, newState)) {
4954
+ refs.current.state = newState;
4955
+ setState(newState);
4956
+ }
4957
+ }
4958
+ },
4959
+ // eslint-disable-next-line react-hooks/exhaustive-deps, react-hooks/use-memo
4960
+ EMPTY
4961
+ );
4962
+ useEnhancedEffect_default(() => {
4963
+ updateState();
4964
+ return apiRef.current.store.subscribe(updateState);
4965
+ }, EMPTY);
4966
+ return state;
4967
+ }
4968
+
4969
+ // node_modules/@mui/x-data-grid/hooks/utils/useGridPrivateApiContext.mjs
4970
+ import * as React27 from "react";
4971
+ var GridPrivateApiContext = /* @__PURE__ */ React27.createContext(void 0);
4972
+ if (process.env.NODE_ENV !== "production") GridPrivateApiContext.displayName = "GridPrivateApiContext";
4973
+ function useGridPrivateApiContext() {
4974
+ const privateApiRef = React27.useContext(GridPrivateApiContext);
4975
+ if (privateApiRef === void 0) {
4976
+ throw new Error(process.env.NODE_ENV !== "production" ? "MUI X Data Grid: Could not find the Data Grid private context. This happens when a component is rendered outside of a DataGrid, DataGridPro, or DataGridPremium parent component. Ensure your component is a child of a Data Grid component. This can also happen if you are bundling multiple versions of the Data Grid." : formatErrorMessage_default2(69));
4977
+ }
4978
+ return privateApiRef;
4979
+ }
4980
+
4981
+ // node_modules/@base-ui/utils/store/createSelector.mjs
4982
+ var createSelector = (a, b, c, d, e, f, g, h, ...other) => {
4983
+ if (other.length > 0) {
4984
+ throw new Error(process.env.NODE_ENV !== "production" ? "Unsupported number of selectors" : formatErrorMessage_default(1));
4985
+ }
4986
+ let selector;
4987
+ if (a && b && c && d && e && f && g && h) {
4988
+ selector = (state, a1, a2, a3) => {
4989
+ const va = a(state, a1, a2, a3);
4990
+ const vb = b(state, a1, a2, a3);
4991
+ const vc = c(state, a1, a2, a3);
4992
+ const vd = d(state, a1, a2, a3);
4993
+ const ve = e(state, a1, a2, a3);
4994
+ const vf = f(state, a1, a2, a3);
4995
+ const vg = g(state, a1, a2, a3);
4996
+ return h(va, vb, vc, vd, ve, vf, vg, a1, a2, a3);
4997
+ };
4998
+ } else if (a && b && c && d && e && f && g) {
4999
+ selector = (state, a1, a2, a3) => {
5000
+ const va = a(state, a1, a2, a3);
5001
+ const vb = b(state, a1, a2, a3);
5002
+ const vc = c(state, a1, a2, a3);
5003
+ const vd = d(state, a1, a2, a3);
5004
+ const ve = e(state, a1, a2, a3);
5005
+ const vf = f(state, a1, a2, a3);
5006
+ return g(va, vb, vc, vd, ve, vf, a1, a2, a3);
5007
+ };
5008
+ } else if (a && b && c && d && e && f) {
5009
+ selector = (state, a1, a2, a3) => {
5010
+ const va = a(state, a1, a2, a3);
5011
+ const vb = b(state, a1, a2, a3);
5012
+ const vc = c(state, a1, a2, a3);
5013
+ const vd = d(state, a1, a2, a3);
5014
+ const ve = e(state, a1, a2, a3);
5015
+ return f(va, vb, vc, vd, ve, a1, a2, a3);
5016
+ };
5017
+ } else if (a && b && c && d && e) {
5018
+ selector = (state, a1, a2, a3) => {
5019
+ const va = a(state, a1, a2, a3);
5020
+ const vb = b(state, a1, a2, a3);
5021
+ const vc = c(state, a1, a2, a3);
5022
+ const vd = d(state, a1, a2, a3);
5023
+ return e(va, vb, vc, vd, a1, a2, a3);
5024
+ };
5025
+ } else if (a && b && c && d) {
5026
+ selector = (state, a1, a2, a3) => {
5027
+ const va = a(state, a1, a2, a3);
5028
+ const vb = b(state, a1, a2, a3);
5029
+ const vc = c(state, a1, a2, a3);
5030
+ return d(va, vb, vc, a1, a2, a3);
5031
+ };
5032
+ } else if (a && b && c) {
5033
+ selector = (state, a1, a2, a3) => {
5034
+ const va = a(state, a1, a2, a3);
5035
+ const vb = b(state, a1, a2, a3);
5036
+ return c(va, vb, a1, a2, a3);
5037
+ };
5038
+ } else if (a && b) {
5039
+ selector = (state, a1, a2, a3) => {
5040
+ const va = a(state, a1, a2, a3);
5041
+ return b(va, a1, a2, a3);
5042
+ };
5043
+ } else if (a) {
5044
+ selector = a;
5045
+ } else {
5046
+ throw (
5047
+ /* minify-error-disabled */
5048
+ new Error("Missing arguments")
5049
+ );
5050
+ }
5051
+ return selector;
5052
+ };
5053
+
5054
+ // node_modules/reselect/dist/reselect.mjs
5055
+ var CACHE_SIZE_CHECK_THRESHOLD = 1e3;
5056
+ var runCacheSizeCheck = (cacheSize, funcName) => {
5057
+ let stack = void 0;
5058
+ try {
5059
+ throw new Error();
5060
+ } catch (e) {
5061
+ ;
5062
+ ({ stack } = e);
5063
+ }
5064
+ console.warn(
5065
+ `A function memoized with weakMapMemoize${funcName ? ` (\`${funcName}\`)` : ""} has seen over ${cacheSize} distinct values for the same primitive argument position.
5066
+ Results keyed by primitive arguments are held strongly and are only released by \`clearCache()\`, so this cache will keep growing for as long as the function keeps seeing new values.
5067
+ If it is called with ever-changing primitives (ids, offsets, timestamps), pass the \`maxSize\` option to bound the cache, switch to \`lruMemoize\`, or call \`.clearCache()\` at a suitable point.
5068
+ See https://reselect.js.org/api/development-only-checks#cachesizecheck for details.`,
5069
+ { stack }
5070
+ );
5071
+ };
5072
+ var globalDevModeChecks = {
5073
+ inputStabilityCheck: "once",
5074
+ identityFunctionCheck: "once",
5075
+ cacheSizeCheck: "once"
5076
+ };
5077
+ var StrongRef = class {
5078
+ constructor(value) {
5079
+ this.value = value;
5080
+ }
5081
+ deref() {
5082
+ return this.value;
5083
+ }
5084
+ };
5085
+ var getWeakRef = () => typeof WeakRef === "undefined" ? StrongRef : WeakRef;
5086
+ var Ref = /* @__PURE__ */ getWeakRef();
5087
+ var UNTERMINATED = 0;
5088
+ var TERMINATED = 1;
5089
+ function createCacheNode() {
5090
+ return {
5091
+ s: UNTERMINATED,
5092
+ v: void 0,
5093
+ o: null,
5094
+ p: null
5095
+ };
5096
+ }
5097
+ function maybeDeref(r2) {
5098
+ if (r2 instanceof Ref) {
5099
+ return r2.deref();
5100
+ }
5101
+ return r2;
5102
+ }
5103
+ function weakMapMemoize(func, options = {}) {
5104
+ let fnNode = createCacheNode();
5105
+ const { resultEqualityCheck, maxSize } = options;
5106
+ const useGenerations = maxSize !== void 0;
5107
+ if (useGenerations && (!Number.isInteger(maxSize) || maxSize < 1)) {
5108
+ throw new TypeError(
5109
+ `maxSize must be a positive integer, received: ${maxSize}`
5110
+ );
5111
+ }
5112
+ let prevNode = null;
5113
+ let insertionCount = 0;
5114
+ let lastResult;
5115
+ let resultsCount = 0;
5116
+ let hasWarnedAboutCacheSize = false;
5117
+ function maybeFlipGenerations() {
5118
+ if (insertionCount >= maxSize) {
5119
+ prevNode = fnNode;
5120
+ fnNode = createCacheNode();
5121
+ insertionCount = 0;
5122
+ }
5123
+ }
5124
+ function memoized() {
5125
+ let cacheNode = fnNode;
5126
+ const { length } = arguments;
5127
+ for (let i = 0, l = length; i < l; i++) {
5128
+ const arg = arguments[i];
5129
+ if (typeof arg === "function" || typeof arg === "object" && arg !== null) {
5130
+ let objectCache = cacheNode.o;
5131
+ if (objectCache === null) {
5132
+ cacheNode.o = objectCache = /* @__PURE__ */ new WeakMap();
5133
+ }
5134
+ const objectNode = objectCache.get(arg);
5135
+ if (objectNode === void 0) {
5136
+ cacheNode = createCacheNode();
5137
+ objectCache.set(arg, cacheNode);
5138
+ } else {
5139
+ cacheNode = objectNode;
5140
+ }
5141
+ } else {
5142
+ let primitiveCache = cacheNode.p;
5143
+ if (primitiveCache === null) {
5144
+ cacheNode.p = primitiveCache = /* @__PURE__ */ new Map();
5145
+ }
5146
+ const primitiveNode = primitiveCache.get(arg);
5147
+ if (primitiveNode === void 0) {
5148
+ cacheNode = createCacheNode();
5149
+ primitiveCache.set(arg, cacheNode);
5150
+ insertionCount++;
5151
+ if (process.env.NODE_ENV !== "production") {
5152
+ if (primitiveCache.size > CACHE_SIZE_CHECK_THRESHOLD) {
5153
+ const { cacheSizeCheck } = globalDevModeChecks;
5154
+ if (cacheSizeCheck === "always" || cacheSizeCheck === "once" && !hasWarnedAboutCacheSize) {
5155
+ hasWarnedAboutCacheSize = true;
5156
+ runCacheSizeCheck(primitiveCache.size, func.name);
5157
+ }
5158
+ }
5159
+ }
5160
+ } else {
5161
+ cacheNode = primitiveNode;
5162
+ }
5163
+ }
5164
+ }
5165
+ if (cacheNode.s === TERMINATED) {
5166
+ return cacheNode.v;
5167
+ }
5168
+ if (prevNode !== null) {
5169
+ let prevCacheNode = prevNode;
5170
+ for (let i = 0, l = length; i < l; i++) {
5171
+ const arg = arguments[i];
5172
+ let next;
5173
+ if (typeof arg === "function" || typeof arg === "object" && arg !== null) {
5174
+ const prevObjectCache = prevCacheNode.o;
5175
+ next = prevObjectCache !== null ? prevObjectCache.get(arg) : void 0;
5176
+ } else {
5177
+ const prevPrimitiveCache = prevCacheNode.p;
5178
+ next = prevPrimitiveCache !== null ? prevPrimitiveCache.get(arg) : void 0;
5179
+ }
5180
+ if (next === void 0) {
5181
+ prevCacheNode = null;
5182
+ break;
5183
+ }
5184
+ prevCacheNode = next;
5185
+ }
5186
+ if (prevCacheNode !== null && prevCacheNode.s === TERMINATED) {
5187
+ const promotedNode = cacheNode;
5188
+ promotedNode.s = TERMINATED;
5189
+ promotedNode.v = prevCacheNode.v;
5190
+ maybeFlipGenerations();
5191
+ return prevCacheNode.v;
5192
+ }
5193
+ }
5194
+ const terminatedNode = cacheNode;
5195
+ let result = func.apply(null, arguments);
5196
+ resultsCount++;
5197
+ if (resultEqualityCheck) {
5198
+ const lastResultValue = maybeDeref(lastResult);
5199
+ if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) {
5200
+ result = lastResultValue;
5201
+ resultsCount !== 0 && resultsCount--;
5202
+ }
5203
+ const needsWeakRef = typeof result === "object" && result !== null || typeof result === "function";
5204
+ lastResult = needsWeakRef ? /* @__PURE__ */ new Ref(result) : result;
5205
+ }
5206
+ terminatedNode.s = TERMINATED;
5207
+ terminatedNode.v = result;
5208
+ if (useGenerations) {
5209
+ maybeFlipGenerations();
5210
+ }
5211
+ return result;
5212
+ }
5213
+ memoized.clearCache = () => {
5214
+ fnNode = createCacheNode();
5215
+ prevNode = null;
5216
+ insertionCount = 0;
5217
+ memoized.resetResultsCount();
5218
+ if (process.env.NODE_ENV !== "production") {
5219
+ hasWarnedAboutCacheSize = false;
5220
+ }
5221
+ };
5222
+ memoized.resultsCount = () => resultsCount;
5223
+ memoized.resetResultsCount = () => {
5224
+ resultsCount = 0;
5225
+ };
5226
+ return memoized;
5227
+ }
5228
+ var runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => {
5229
+ if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) {
5230
+ let isInputSameAsOutput = false;
5231
+ try {
5232
+ const emptyObject = {};
5233
+ if (resultFunc(emptyObject) === emptyObject) isInputSameAsOutput = true;
5234
+ } catch {
5235
+ }
5236
+ if (isInputSameAsOutput) {
5237
+ let stack = void 0;
5238
+ try {
5239
+ throw new Error();
5240
+ } catch (e) {
5241
+ ;
5242
+ ({ stack } = e);
5243
+ }
5244
+ console.warn(
5245
+ "The result function returned its own inputs without modification. e.g\n`createSelector([state => state.todos], todos => todos)`\nThis could lead to inefficient memoization and unnecessary re-renders.\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.",
5246
+ { stack }
5247
+ );
5248
+ }
5249
+ }
5250
+ };
5251
+ var withoutResultEqualityCheck = (option) => {
5252
+ if (option === null || typeof option !== "object" || !("resultEqualityCheck" in option)) {
5253
+ return option;
5254
+ }
5255
+ const optionCopy = { ...option };
5256
+ delete optionCopy.resultEqualityCheck;
5257
+ return optionCopy;
5258
+ };
5259
+ var runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => {
5260
+ const { memoize, memoizeOptions } = options;
5261
+ const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject;
5262
+ const probeMemoizeOptions = [];
5263
+ const { length } = memoizeOptions;
5264
+ for (let i = 0; i < length; i++) {
5265
+ probeMemoizeOptions.push(withoutResultEqualityCheck(memoizeOptions[i]));
5266
+ }
5267
+ const createAnEmptyObject = memoize(() => ({}), ...probeMemoizeOptions);
5268
+ const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy);
5269
+ if (!areInputSelectorResultsEqual) {
5270
+ let stack = void 0;
5271
+ try {
5272
+ throw new Error();
5273
+ } catch (e) {
5274
+ ;
5275
+ ({ stack } = e);
5276
+ }
5277
+ console.warn(
5278
+ "An input selector returned a different result when passed same arguments.\nThis means your output selector will likely run more frequently than intended.\nAvoid returning a new reference inside your input selector, e.g.\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`",
5279
+ {
5280
+ arguments: inputSelectorArgs,
5281
+ firstInputs: inputSelectorResults,
5282
+ secondInputs: inputSelectorResultsCopy,
5283
+ stack
5284
+ }
5285
+ );
5286
+ }
5287
+ };
5288
+ var NOT_FOUND = /* @__PURE__ */ Symbol("NOT_FOUND");
5289
+ function assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) {
5290
+ if (typeof func !== "function") {
5291
+ throw new TypeError(errorMessage);
5292
+ }
5293
+ }
5294
+ function assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) {
5295
+ if (!array.every((item) => typeof item === "function")) {
5296
+ const itemTypes = array.map(
5297
+ (item) => typeof item === "function" ? `function ${item.name || "unnamed"}()` : typeof item
5298
+ ).join(", ");
5299
+ throw new TypeError(`${errorMessage}[${itemTypes}]`);
5300
+ }
5301
+ }
5302
+ var ensureIsArray = (item) => {
5303
+ return Array.isArray(item) ? item : [item];
5304
+ };
5305
+ function getDependencies(createSelectorArgs) {
5306
+ const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs;
5307
+ assertIsArrayOfFunctions(
5308
+ dependencies,
5309
+ `createSelector expects all input-selectors to be functions, but received the following types: `
5310
+ );
5311
+ return dependencies;
5312
+ }
5313
+ function collectInputSelectorResults(dependencies, inputSelectorArgs) {
5314
+ const inputSelectorResults = [];
5315
+ const { length } = dependencies;
5316
+ for (let i = 0; i < length; i++) {
5317
+ inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs));
5318
+ }
5319
+ return inputSelectorResults;
5320
+ }
5321
+ function createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) {
5322
+ const createSelectorCreatorOptions = typeof memoizeOrOptions === "function" ? {
5323
+ memoize: memoizeOrOptions,
5324
+ memoizeOptions: memoizeOptionsFromArgs
5325
+ } : memoizeOrOptions;
5326
+ const createSelector22 = (...createSelectorArgs) => {
5327
+ let recomputations = 0;
5328
+ let dependencyRecomputations = 0;
5329
+ let lastResult;
5330
+ let directlyPassedOptions = {};
5331
+ let resultFunc = createSelectorArgs.pop();
5332
+ if (typeof resultFunc === "object") {
5333
+ directlyPassedOptions = resultFunc;
5334
+ resultFunc = createSelectorArgs.pop();
5335
+ }
5336
+ assertIsFunction(
5337
+ resultFunc,
5338
+ `createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]`
5339
+ );
5340
+ const combinedOptions = {
5341
+ ...createSelectorCreatorOptions,
5342
+ ...directlyPassedOptions
5343
+ };
5344
+ const {
5345
+ memoize,
5346
+ memoizeOptions = [],
5347
+ argsMemoize = weakMapMemoize,
5348
+ argsMemoizeOptions = []
5349
+ } = combinedOptions;
5350
+ const finalMemoizeOptions = ensureIsArray(memoizeOptions);
5351
+ const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions);
5352
+ const dependencies = getDependencies(createSelectorArgs);
5353
+ const memoizedResultFunc = memoize(function recomputationWrapper() {
5354
+ recomputations++;
5355
+ return resultFunc.apply(
5356
+ null,
5357
+ arguments
5358
+ );
5359
+ }, ...finalMemoizeOptions);
5360
+ let firstRun = true;
5361
+ const selector = argsMemoize(function dependenciesChecker() {
5362
+ dependencyRecomputations++;
5363
+ const { length } = dependencies;
5364
+ const inputSelectorResults = new Array(length);
5365
+ for (let i = 0; i < length; i++) {
5366
+ inputSelectorResults[i] = dependencies[i].apply(null, arguments);
5367
+ }
5368
+ lastResult = memoizedResultFunc.apply(null, inputSelectorResults);
5369
+ if (process.env.NODE_ENV !== "production") {
5370
+ const { devModeChecks } = combinedOptions;
5371
+ const identityFunctionCheck = devModeChecks !== void 0 && Object.prototype.hasOwnProperty.call(
5372
+ devModeChecks,
5373
+ "identityFunctionCheck"
5374
+ ) ? devModeChecks.identityFunctionCheck : globalDevModeChecks.identityFunctionCheck;
5375
+ const inputStabilityCheck = devModeChecks !== void 0 && Object.prototype.hasOwnProperty.call(
5376
+ devModeChecks,
5377
+ "inputStabilityCheck"
5378
+ ) ? devModeChecks.inputStabilityCheck : globalDevModeChecks.inputStabilityCheck;
5379
+ if (identityFunctionCheck === "always" || identityFunctionCheck === "once" && firstRun) {
5380
+ runIdentityFunctionCheck(
5381
+ resultFunc,
5382
+ inputSelectorResults,
5383
+ lastResult
5384
+ );
5385
+ }
5386
+ if (inputStabilityCheck === "always" || inputStabilityCheck === "once" && firstRun) {
5387
+ const inputSelectorResultsCopy = collectInputSelectorResults(
5388
+ dependencies,
5389
+ arguments
5390
+ );
5391
+ runInputStabilityCheck(
5392
+ { inputSelectorResults, inputSelectorResultsCopy },
5393
+ { memoize, memoizeOptions: finalMemoizeOptions },
5394
+ arguments
5395
+ );
5396
+ }
5397
+ if (firstRun) firstRun = false;
5398
+ }
5399
+ return lastResult;
5400
+ }, ...finalArgsMemoizeOptions);
5401
+ return Object.assign(selector, {
5402
+ resultFunc,
5403
+ memoizedResultFunc,
5404
+ dependencies,
5405
+ dependencyRecomputations: () => dependencyRecomputations,
5406
+ resetDependencyRecomputations: () => {
5407
+ dependencyRecomputations = 0;
5408
+ },
5409
+ lastResult: () => lastResult,
5410
+ recomputations: () => recomputations,
5411
+ resetRecomputations: () => {
5412
+ recomputations = 0;
5413
+ },
5414
+ memoize,
5415
+ argsMemoize
5416
+ });
5417
+ };
5418
+ Object.assign(createSelector22, {
5419
+ withTypes: () => createSelector22
5420
+ });
5421
+ return createSelector22;
5422
+ }
5423
+ function createSingletonCache(equals) {
5424
+ let entry;
5425
+ return {
5426
+ get(key) {
5427
+ if (entry && equals(entry.key, key)) {
5428
+ return entry.value;
5429
+ }
5430
+ return NOT_FOUND;
5431
+ },
5432
+ put(key, value) {
5433
+ entry = { key, value };
5434
+ },
5435
+ findMatchingEntry(value, resultEqualityCheck) {
5436
+ const current = entry;
5437
+ return current !== void 0 && resultEqualityCheck(current.value, value) ? current : void 0;
5438
+ },
5439
+ clear() {
5440
+ entry = void 0;
5441
+ }
5442
+ };
5443
+ }
5444
+ function createLruCache(maxSize, equals) {
5445
+ let entries = [];
5446
+ function get(key) {
5447
+ const cacheIndex = entries.findIndex((entry) => equals(entry.key, key));
5448
+ if (cacheIndex > -1) {
5449
+ const entry = entries[cacheIndex];
5450
+ if (cacheIndex > 0) {
5451
+ entries.splice(cacheIndex, 1);
5452
+ entries.unshift(entry);
5453
+ }
5454
+ return entry.value;
5455
+ }
5456
+ return NOT_FOUND;
5457
+ }
5458
+ function put(key, value) {
5459
+ entries.unshift({ key, value });
5460
+ if (entries.length > maxSize) {
5461
+ entries.pop();
5462
+ }
5463
+ }
5464
+ function findMatchingEntry(value, resultEqualityCheck) {
5465
+ const currentEntries = entries;
5466
+ const { length } = currentEntries;
5467
+ for (let i = 0; i < length; i++) {
5468
+ const entry = currentEntries[i];
5469
+ if (resultEqualityCheck(entry.value, value)) {
5470
+ return entry;
5471
+ }
5472
+ }
5473
+ return void 0;
5474
+ }
5475
+ function clear() {
5476
+ entries = [];
5477
+ }
5478
+ return { get, put, findMatchingEntry, clear };
5479
+ }
5480
+ var referenceEqualityCheck = (a, b) => a === b;
5481
+ function createCacheKeyComparator(equalityCheck) {
5482
+ return function areArgumentsShallowlyEqual(prev, next) {
5483
+ if (prev === null || next === null || prev.length !== next.length) {
5484
+ return false;
5485
+ }
5486
+ const { length } = prev;
5487
+ for (let i = 0; i < length; i++) {
5488
+ if (!equalityCheck(prev[i], next[i])) {
5489
+ return false;
5490
+ }
5491
+ }
5492
+ return true;
5493
+ };
5494
+ }
5495
+ function lruMemoize(func, equalityCheckOrOptions) {
5496
+ const providedOptions = typeof equalityCheckOrOptions === "object" ? equalityCheckOrOptions : { equalityCheck: equalityCheckOrOptions };
5497
+ const {
5498
+ equalityCheck = referenceEqualityCheck,
5499
+ maxSize = 1,
5500
+ resultEqualityCheck
5501
+ } = providedOptions;
5502
+ const comparator = createCacheKeyComparator(equalityCheck);
5503
+ let resultsCount = 0;
5504
+ const cache = maxSize <= 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);
5505
+ function memoized() {
5506
+ let value = cache.get(arguments);
5507
+ if (value === NOT_FOUND) {
5508
+ value = func.apply(null, arguments);
5509
+ resultsCount++;
5510
+ if (resultEqualityCheck) {
5511
+ const matchingEntry = cache.findMatchingEntry(
5512
+ value,
5513
+ resultEqualityCheck
5514
+ );
5515
+ if (matchingEntry) {
5516
+ value = matchingEntry.value;
5517
+ resultsCount !== 0 && resultsCount--;
5518
+ }
5519
+ }
5520
+ cache.put(arguments, value);
5521
+ }
5522
+ return value;
5523
+ }
5524
+ memoized.clearCache = () => {
5525
+ cache.clear();
5526
+ memoized.resetResultsCount();
5527
+ };
5528
+ memoized.resultsCount = () => resultsCount;
5529
+ memoized.resetResultsCount = () => {
5530
+ resultsCount = 0;
5531
+ };
5532
+ return memoized;
5533
+ }
5534
+
5535
+ // node_modules/@base-ui/utils/store/createSelectorMemoized.mjs
5536
+ var MEMOIZE_OPTIONS = {
5537
+ maxSize: 1,
5538
+ equalityCheck: Object.is
5539
+ };
5540
+ var reselectCreateSelector = createSelectorCreator({
5541
+ memoize: lruMemoize,
5542
+ memoizeOptions: MEMOIZE_OPTIONS
5543
+ });
5544
+ var createSelectorMemoizedWithOptions = (options) => {
5545
+ const memoizeOptions = options?.memoizeOptions;
5546
+ let resolvedOptions = options;
5547
+ if (options !== void 0) {
5548
+ if (options.memoize !== void 0) {
5549
+ if (memoizeOptions === void 0) {
5550
+ resolvedOptions = {
5551
+ ...options,
5552
+ memoizeOptions: void 0
5553
+ };
5554
+ }
5555
+ } else if (typeof memoizeOptions === "object" && memoizeOptions !== null && !Array.isArray(memoizeOptions)) {
5556
+ resolvedOptions = {
5557
+ ...options,
5558
+ memoizeOptions: {
5559
+ ...MEMOIZE_OPTIONS,
5560
+ ...memoizeOptions
5561
+ }
5562
+ };
5563
+ }
5564
+ }
5565
+ return (...inputs) => {
5566
+ const cache = /* @__PURE__ */ new WeakMap();
5567
+ let nextCacheId = 1;
5568
+ const combiner = inputs[inputs.length - 1];
5569
+ const selectors = inputs.length === 1 ? [(x) => x, combiner] : inputs;
5570
+ const nSelectors = selectors.length - 1;
5571
+ const argsLength = combiner.length === 0 ? 0 : combiner.length - nSelectors;
5572
+ if (argsLength < 0 || argsLength > 3) {
5573
+ throw new Error(process.env.NODE_ENV !== "production" ? "Unsupported number of arguments" : formatErrorMessage_default(2));
5574
+ }
5575
+ const selector = (state, a1, a2, a3) => {
5576
+ let cacheKey = state.__cacheKey__;
5577
+ if (!cacheKey) {
5578
+ cacheKey = {
5579
+ id: nextCacheId
5580
+ };
5581
+ state.__cacheKey__ = cacheKey;
5582
+ nextCacheId += 1;
5583
+ }
5584
+ let fn = cache.get(cacheKey);
5585
+ if (!fn) {
5586
+ let reselectArgs = selectors;
5587
+ const selectorArgs = [void 0, void 0, void 0];
5588
+ switch (argsLength) {
5589
+ case 0:
5590
+ break;
5591
+ case 1: {
5592
+ reselectArgs = [...selectors.slice(0, -1), () => selectorArgs[0], combiner];
5593
+ break;
5594
+ }
5595
+ case 2: {
5596
+ reselectArgs = [...selectors.slice(0, -1), () => selectorArgs[0], () => selectorArgs[1], combiner];
5597
+ break;
5598
+ }
5599
+ default: {
5600
+ reselectArgs = [...selectors.slice(0, -1), () => selectorArgs[0], () => selectorArgs[1], () => selectorArgs[2], combiner];
5601
+ break;
5602
+ }
5603
+ }
5604
+ if (resolvedOptions) {
5605
+ reselectArgs = [...reselectArgs, resolvedOptions];
5606
+ }
5607
+ fn = reselectCreateSelector(...reselectArgs);
5608
+ fn.selectorArgs = selectorArgs;
5609
+ cache.set(cacheKey, fn);
5610
+ }
5611
+ switch (argsLength) {
5612
+ case 3:
5613
+ fn.selectorArgs[2] = a3;
5614
+ case 2:
5615
+ fn.selectorArgs[1] = a2;
5616
+ case 1:
5617
+ fn.selectorArgs[0] = a1;
5618
+ case 0:
5619
+ default:
5620
+ }
5621
+ switch (argsLength) {
5622
+ case 0:
5623
+ return fn(state);
5624
+ case 1:
5625
+ return fn(state, a1);
5626
+ case 2:
5627
+ return fn(state, a1, a2);
5628
+ default:
5629
+ return fn(state, a1, a2, a3);
5630
+ }
5631
+ };
5632
+ return selector;
5633
+ };
5634
+ };
5635
+ var createSelectorMemoized = createSelectorMemoizedWithOptions();
5636
+
5637
+ // node_modules/@mui/x-data-grid/utils/createSelector.mjs
5638
+ var createSelector2 = (...args) => {
5639
+ const baseSelector = createSelector(...args);
5640
+ const selector = (apiRef, a1, a2, a3) => baseSelector(unwrapIfNeeded(apiRef), a1, a2, a3);
5641
+ return selector;
5642
+ };
5643
+ var createSelectorMemoized2 = (...args) => {
5644
+ const baseSelector = createSelectorMemoized(...args);
5645
+ const selector = (apiRef, a1, a2, a3) => baseSelector(unwrapIfNeeded(apiRef), a1, a2, a3);
5646
+ return selector;
5647
+ };
5648
+ var createRootSelector = (fn) => (apiRef, args) => fn(unwrapIfNeeded(apiRef), args);
5649
+ function unwrapIfNeeded(refOrState) {
5650
+ if ("current" in refOrState) {
5651
+ return refOrState.current.state;
5652
+ }
5653
+ return refOrState;
5654
+ }
5655
+
5656
+ // node_modules/@mui/x-data-grid/hooks/features/rows/gridRowsSelector.mjs
5657
+ var gridRowsStateSelector = createRootSelector((state) => state.rows);
5658
+ var gridRowCountSelector2 = createSelector2(gridRowsStateSelector, (rows) => rows.totalRowCount);
5659
+ var gridRowsLoadingSelector = createSelector2(gridRowsStateSelector, (rows) => rows.loading);
5660
+ var gridTopLevelRowCountSelector = createSelector2(gridRowsStateSelector, (rows) => rows.totalTopLevelRowCount);
5661
+ var gridRowsLookupSelector = createSelector2(gridRowsStateSelector, (rows) => rows.dataRowIdToModelLookup);
5662
+ var gridRowSelector = createSelector2(gridRowsLookupSelector, (rows, id) => rows[id]);
5663
+ var gridRowTreeSelector = createSelector2(gridRowsStateSelector, (rows) => rows.tree);
5664
+ var gridRowNodeSelector = createSelector2(gridRowTreeSelector, (rowTree, rowId) => rowTree[rowId]);
5665
+ var gridRowGroupsToFetchSelector = createSelector2(gridRowsStateSelector, (rows) => rows.groupsToFetch);
5666
+ var gridRowGroupingNameSelector = createSelector2(gridRowsStateSelector, (rows) => rows.groupingName);
5667
+ var gridRowTreeDepthsSelector = createSelector2(gridRowsStateSelector, (rows) => rows.treeDepths);
5668
+ var gridRowMaximumTreeDepthSelector = createSelectorMemoized2(gridRowsStateSelector, (rows) => {
5669
+ const entries = Object.entries(rows.treeDepths);
5670
+ if (entries.length === 0) {
5671
+ return 1;
5672
+ }
5673
+ return (entries.filter(([, nodeCount]) => nodeCount > 0).map(([depth]) => Number(depth)).sort((a, b) => b - a)[0] ?? 0) + 1;
5674
+ });
5675
+ var gridDataRowIdsSelector = createSelector2(gridRowsStateSelector, (rows) => rows.dataRowIds);
5676
+ var gridDataRowsSelector = createSelectorMemoized2(gridDataRowIdsSelector, gridRowsLookupSelector, (dataRowIds, rowsLookup) => dataRowIds.reduce((acc, id) => {
5677
+ if (!rowsLookup[id]) {
5678
+ return acc;
5679
+ }
5680
+ acc.push(rowsLookup[id]);
5681
+ return acc;
5682
+ }, []));
5683
+ var gridAdditionalRowGroupsSelector = createSelector2(gridRowsStateSelector, (rows) => rows?.additionalRowGroups);
5684
+ var gridPinnedRowsSelector = createSelectorMemoized2(gridAdditionalRowGroupsSelector, (additionalRowGroups) => {
5685
+ const rawPinnedRows = additionalRowGroups?.pinnedRows;
5686
+ return {
5687
+ bottom: rawPinnedRows?.bottom?.map((rowEntry) => ({
5688
+ id: rowEntry.id,
5689
+ model: rowEntry.model ?? {}
5690
+ })) ?? [],
5691
+ top: rawPinnedRows?.top?.map((rowEntry) => ({
5692
+ id: rowEntry.id,
5693
+ model: rowEntry.model ?? {}
5694
+ })) ?? []
5695
+ };
5696
+ });
5697
+ var gridPinnedRowsCountSelector = createSelector2(gridPinnedRowsSelector, (pinnedRows) => {
5698
+ return (pinnedRows?.top?.length || 0) + (pinnedRows?.bottom?.length || 0);
5699
+ });
5700
+
5701
+ // node_modules/@mui/x-data-grid/hooks/features/rows/gridRowsUtils.mjs
5702
+ var import_extends = __toESM(require_extends(), 1);
5703
+ var GRID_ID_AUTOGENERATED = /* @__PURE__ */ Symbol("mui.id_autogenerated");
5704
+ var isAutogeneratedRowNode = (rowNode) => rowNode.type === "skeletonRow" || rowNode.type === "footer" || rowNode.type === "group" && rowNode.isAutoGenerated || rowNode.type === "pinnedRow" && rowNode.isAutoGenerated;
5705
+ var rowHeightWarning = [`MUI X: The \`rowHeight\` prop should be a number greater than 0.`, `The default value will be used instead.`].join("\n");
5706
+
5707
+ // node_modules/@mui/x-data-grid/utils/assert.mjs
5708
+ function NotRendered(_props) {
5709
+ throw new Error(process.env.NODE_ENV !== "production" ? "MUI X: Failed assertion: should not be rendered" : formatErrorMessage_default2(57));
5710
+ }
5711
+
5712
+ // node_modules/@mui/x-data-grid/hooks/features/columns/gridColumnsInterfaces.mjs
5713
+ var EMPTY_PINNED_COLUMN_FIELDS = {
5714
+ left: [],
5715
+ right: []
5716
+ };
5717
+
5718
+ // node_modules/@mui/x-data-grid/hooks/features/listView/gridListViewSelectors.mjs
5719
+ var gridListViewSelector = createRootSelector((state) => state.props.listView ?? false);
5720
+ var gridListColumnSelector = createRootSelector((state) => state.listViewColumn);
5721
+
5722
+ // node_modules/@mui/x-data-grid/hooks/features/columns/gridColumnsSelector.mjs
5723
+ var gridColumnsStateSelector = createRootSelector((state) => state.columns);
5724
+ var gridColumnFieldsSelector = createSelector2(gridColumnsStateSelector, (columnsState) => columnsState.orderedFields);
5725
+ var gridColumnLookupSelector = createSelector2(gridColumnsStateSelector, (columnsState) => columnsState.lookup);
5726
+ var gridColumnDefinitionsSelector = createSelectorMemoized2(gridColumnFieldsSelector, gridColumnLookupSelector, (allFields, lookup) => allFields.map((field) => lookup[field]));
5727
+ var gridColumnVisibilityModelSelector = createSelector2(gridColumnsStateSelector, (columnsState) => columnsState.columnVisibilityModel);
5728
+ var gridInitialColumnVisibilityModelSelector = createSelector2(gridColumnsStateSelector, (columnsState) => columnsState.initialColumnVisibilityModel);
5729
+ var gridVisibleColumnDefinitionsSelector = createSelectorMemoized2(gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector, gridListViewSelector, gridListColumnSelector, (columns, columnVisibilityModel, listView, listColumn) => listView && listColumn ? [listColumn] : columns.filter((column) => columnVisibilityModel[column.field] !== false));
5730
+ var gridVisibleColumnFieldsSelector = createSelectorMemoized2(gridVisibleColumnDefinitionsSelector, (visibleColumns) => visibleColumns.map((column) => column.field));
5731
+ var gridPinnedColumnsSelector = createRootSelector((state) => state.pinnedColumns);
5732
+ var gridExistingPinnedColumnSelector = createSelectorMemoized2(gridPinnedColumnsSelector, gridColumnFieldsSelector, (model, orderedFields) => filterMissingColumns(model, orderedFields));
5733
+ var gridVisiblePinnedColumnDefinitionsSelector = createSelectorMemoized2(gridColumnsStateSelector, gridPinnedColumnsSelector, gridVisibleColumnFieldsSelector, gridListViewSelector, (columnsState, model, visibleColumnFields, listView) => {
5734
+ if (listView) {
5735
+ return EMPTY_PINNED_COLUMN_FIELDS;
5736
+ }
5737
+ const visiblePinnedFields = filterMissingColumns(model, visibleColumnFields);
5738
+ const visiblePinnedColumns = {
5739
+ left: visiblePinnedFields.left.map((field) => columnsState.lookup[field]),
5740
+ right: visiblePinnedFields.right.map((field) => columnsState.lookup[field])
5741
+ };
5742
+ return visiblePinnedColumns;
5743
+ });
5744
+ function filterMissingColumns(pinnedColumns, columns) {
5745
+ if (!Array.isArray(pinnedColumns.left) && !Array.isArray(pinnedColumns.right)) {
5746
+ return EMPTY_PINNED_COLUMN_FIELDS;
5747
+ }
5748
+ if (pinnedColumns.left?.length === 0 && pinnedColumns.right?.length === 0) {
5749
+ return EMPTY_PINNED_COLUMN_FIELDS;
5750
+ }
5751
+ const filter = (newPinnedColumns, remainingColumns) => {
5752
+ if (!Array.isArray(newPinnedColumns)) {
5753
+ return [];
5754
+ }
5755
+ return newPinnedColumns.filter((field) => remainingColumns.includes(field));
5756
+ };
5757
+ const leftPinnedColumns = filter(pinnedColumns.left, columns);
5758
+ const columnsWithoutLeftPinnedColumns = columns.filter((field) => !leftPinnedColumns.includes(field));
5759
+ const rightPinnedColumns = filter(pinnedColumns.right, columnsWithoutLeftPinnedColumns);
5760
+ return {
5761
+ left: leftPinnedColumns,
5762
+ right: rightPinnedColumns
5763
+ };
5764
+ }
5765
+ var gridColumnPositionsSelector = createSelectorMemoized2(gridVisibleColumnDefinitionsSelector, (visibleColumns) => {
5766
+ const positions = [];
5767
+ let currentPosition = 0;
5768
+ for (let i = 0; i < visibleColumns.length; i += 1) {
5769
+ positions.push(currentPosition);
5770
+ currentPosition += visibleColumns[i].computedWidth;
5771
+ }
5772
+ return positions;
5773
+ });
5774
+ var gridFilterableColumnDefinitionsSelector = createSelectorMemoized2(gridColumnDefinitionsSelector, (columns) => columns.filter((col) => col.filterable));
5775
+ var gridFilterableColumnLookupSelector = createSelectorMemoized2(gridColumnDefinitionsSelector, (columns) => columns.reduce((acc, col) => {
5776
+ if (col.filterable) {
5777
+ acc[col.field] = col;
5778
+ }
5779
+ return acc;
5780
+ }, {}));
5781
+ var gridHasColSpanSelector = createSelectorMemoized2(gridColumnDefinitionsSelector, (columns) => columns.some((column) => column.colSpan !== void 0));
5782
+
5783
+ // node_modules/@mui/x-data-grid/utils/keyboardUtils.mjs
5784
+ var isHideMenuKey = (key) => key === "Tab" || key === "Escape";
5785
+
5786
+ // node_modules/@mui/x-data-grid/hooks/features/sorting/gridSortingSelector.mjs
5787
+ var gridSortingStateSelector = createRootSelector((state) => state.sorting);
5788
+ var gridSortedRowIdsSelector = createSelector2(gridSortingStateSelector, (sortingState) => sortingState.sortedRows);
5789
+ var gridSortedRowEntriesSelector = createSelectorMemoized2(gridSortedRowIdsSelector, gridRowsLookupSelector, gridRowTreeSelector, (sortedIds, idRowsLookup, rowTree) => sortedIds.reduce((acc, id) => {
5790
+ const model = idRowsLookup[id];
5791
+ if (model) {
5792
+ acc.push({
5793
+ id,
5794
+ model
5795
+ });
5796
+ } else {
5797
+ const rowNode = rowTree[id];
5798
+ if (rowNode && isAutogeneratedRowNode(rowNode)) {
5799
+ acc.push({
5800
+ id,
5801
+ model: {
5802
+ [GRID_ID_AUTOGENERATED]: id
5803
+ }
5804
+ });
5805
+ }
5806
+ }
5807
+ return acc;
5808
+ }, []));
5809
+ var gridSortModelSelector = createSelector2(gridSortingStateSelector, (sorting) => sorting.sortModel);
5810
+ var gridSortColumnLookupSelector = createSelectorMemoized2(gridSortModelSelector, (sortModel) => {
5811
+ const result = sortModel.reduce((res, sortItem, index) => {
5812
+ res[sortItem.field] = {
5813
+ sortDirection: sortItem.sort,
5814
+ sortIndex: sortModel.length > 1 ? index + 1 : void 0
5815
+ };
5816
+ return res;
5817
+ }, {});
5818
+ return result;
5819
+ });
5820
+ var gridSortedRowIndexLookupSelector = createSelectorMemoized2(gridSortedRowIdsSelector, (sortedIds) => {
5821
+ return sortedIds.reduce((acc, id, index) => {
5822
+ acc[id] = index;
5823
+ return acc;
5824
+ }, /* @__PURE__ */ Object.create(null));
5825
+ });
5826
+
5827
+ // node_modules/@mui/x-data-grid/hooks/features/preferencesPanel/gridPreferencePanelSelector.mjs
5828
+ var gridPreferencePanelStateSelector = createRootSelector((state) => state.preferencePanel);
5829
+ var gridPreferencePanelSelectorWithLabel = createSelector2(gridPreferencePanelStateSelector, (panel, labelId) => {
5830
+ if (panel.open && panel.labelId === labelId) {
5831
+ return true;
5832
+ }
5833
+ return false;
5834
+ });
5835
+
5836
+ // node_modules/@mui/x-data-grid/hooks/features/preferencesPanel/gridPreferencePanelsValue.mjs
5837
+ var GridPreferencePanelsValue = /* @__PURE__ */ (function(GridPreferencePanelsValue2) {
5838
+ GridPreferencePanelsValue2["filters"] = "filters";
5839
+ GridPreferencePanelsValue2["columns"] = "columns";
5840
+ GridPreferencePanelsValue2["aiAssistant"] = "aiAssistant";
5841
+ return GridPreferencePanelsValue2;
5842
+ })(GridPreferencePanelsValue || {});
5843
+
5844
+ // node_modules/@mui/x-data-grid/components/panel/GridPanelContext.mjs
5845
+ var import_extends2 = __toESM(require_extends(), 1);
5846
+ import * as React28 from "react";
5847
+ import { jsx as _jsx } from "react/jsx-runtime";
5848
+ var GridPanelContext = /* @__PURE__ */ React28.createContext(void 0);
5849
+ if (process.env.NODE_ENV !== "production") GridPanelContext.displayName = "GridPanelContext";
5850
+ function useGridPanelContext() {
5851
+ const context = React28.useContext(GridPanelContext);
5852
+ if (context === void 0) {
5853
+ throw new Error(process.env.NODE_ENV !== "production" ? "MUI X: Missing context." : formatErrorMessage_default2(61));
5854
+ }
5855
+ return context;
5856
+ }
5857
+
5858
+ // node_modules/@mui/x-internals/useComponentRenderer/useComponentRenderer.mjs
5859
+ var import_extends3 = __toESM(require_extends(), 1);
5860
+ import * as React29 from "react";
5861
+ function useComponentRenderer(defaultElement, render, props, state = {}) {
5862
+ if (typeof render === "function") {
5863
+ return render(props, state);
5864
+ }
5865
+ if (render) {
5866
+ if (render.props.className) {
5867
+ props.className = mergeClassNames(render.props.className, props.className);
5868
+ }
5869
+ if (render.props.style || props.style) {
5870
+ props.style = (0, import_extends3.default)({}, props.style, render.props.style);
5871
+ }
5872
+ return /* @__PURE__ */ React29.cloneElement(render, props);
5873
+ }
5874
+ return /* @__PURE__ */ React29.createElement(defaultElement, props);
5875
+ }
5876
+ function mergeClassNames(className, otherClassName) {
5877
+ if (!className || !otherClassName) {
5878
+ return className || otherClassName;
5879
+ }
5880
+ return `${className} ${otherClassName}`;
5881
+ }
5882
+
5883
+ // node_modules/@mui/x-internals/ToolbarContext/ToolbarContext.mjs
5884
+ import * as React30 from "react";
5885
+ import { jsx as _jsx2 } from "react/jsx-runtime";
5886
+ var ToolbarContext = /* @__PURE__ */ React30.createContext(void 0);
5887
+ if (process.env.NODE_ENV !== "production") ToolbarContext.displayName = "ToolbarContext";
5888
+ function useToolbarContext() {
5889
+ const context = React30.useContext(ToolbarContext);
5890
+ if (context === void 0) {
5891
+ throw new Error(process.env.NODE_ENV !== "production" ? "MUI X: Missing context. Toolbar subcomponents must be placed within a <Toolbar /> component." : formatErrorMessage_default2(63));
5892
+ }
5893
+ return context;
5894
+ }
5895
+
5896
+ // node_modules/@mui/x-internals/ToolbarContext/useRegisterToolbarButton.mjs
5897
+ import * as React31 from "react";
5898
+ function useRegisterToolbarButton(props, ref) {
5899
+ const {
5900
+ onKeyDown,
5901
+ onFocus,
5902
+ onBlur,
5903
+ disabled,
5904
+ "aria-disabled": ariaDisabled
5905
+ } = props;
5906
+ const id = useId();
5907
+ const {
5908
+ focusableItemId,
5909
+ registerItem,
5910
+ unregisterItem,
5911
+ onItemKeyDown,
5912
+ onItemFocus,
5913
+ onItemBlur,
5914
+ onItemDisabled
5915
+ } = useToolbarContext();
5916
+ const handleKeyDown = (event) => {
5917
+ onItemKeyDown(event);
5918
+ onKeyDown?.(event);
5919
+ };
5920
+ const handleFocus = (event) => {
5921
+ onItemFocus(id);
5922
+ onFocus?.(event);
5923
+ };
5924
+ const handleBlur = (event) => {
5925
+ onItemBlur(id, event);
5926
+ onBlur?.(event);
5927
+ };
5928
+ React31.useEffect(() => {
5929
+ registerItem(id, ref);
5930
+ return () => unregisterItem(id);
5931
+ }, [id, ref, registerItem, unregisterItem]);
5932
+ const previousDisabled = React31.useRef(disabled);
5933
+ React31.useEffect(() => {
5934
+ if (previousDisabled.current !== disabled && disabled === true) {
5935
+ onItemDisabled(id);
5936
+ }
5937
+ previousDisabled.current = disabled;
5938
+ }, [disabled, id, onItemDisabled]);
5939
+ const previousAriaDisabled = React31.useRef(ariaDisabled);
5940
+ React31.useEffect(() => {
5941
+ if (previousAriaDisabled.current !== ariaDisabled && ariaDisabled === true) {
5942
+ onItemDisabled(id);
5943
+ }
5944
+ previousAriaDisabled.current = ariaDisabled;
5945
+ }, [ariaDisabled, id, onItemDisabled]);
5946
+ return {
5947
+ tabIndex: focusableItemId === id ? 0 : -1,
5948
+ disabled,
5949
+ "aria-disabled": ariaDisabled,
5950
+ onKeyDown: handleKeyDown,
5951
+ onFocus: handleFocus,
5952
+ onBlur: handleBlur
5953
+ };
5954
+ }
5955
+
5956
+ // node_modules/@mui/x-data-grid/components/toolbarV8/ToolbarButton.mjs
5957
+ var import_extends4 = __toESM(require_extends(), 1);
5958
+ var import_objectWithoutPropertiesLoose = __toESM(require_objectWithoutPropertiesLoose(), 1);
5959
+ var import_prop_types = __toESM(require_prop_types(), 1);
5960
+ import * as React32 from "react";
5961
+ import { jsx as _jsx3 } from "react/jsx-runtime";
5962
+ var _excluded = ["render", "onKeyDown", "onFocus", "onBlur", "disabled", "aria-disabled"];
5963
+ var _excluded2 = ["tabIndex"];
5964
+ var ToolbarButton = forwardRef3(function ToolbarButton2(props, ref) {
5965
+ const {
5966
+ render
5967
+ } = props, other = (0, import_objectWithoutPropertiesLoose.default)(props, _excluded);
5968
+ const rootProps = useGridRootProps2();
5969
+ const buttonRef = React32.useRef(null);
5970
+ const handleRef = useForkRef(buttonRef, ref);
5971
+ const _useRegisterToolbarBu = useRegisterToolbarButton(props, buttonRef), {
5972
+ tabIndex
5973
+ } = _useRegisterToolbarBu, toolbarButtonProps = (0, import_objectWithoutPropertiesLoose.default)(_useRegisterToolbarBu, _excluded2);
5974
+ const element = useComponentRenderer(rootProps.slots.baseIconButton, render, (0, import_extends4.default)({}, rootProps.slotProps?.baseIconButton, {
5975
+ tabIndex
5976
+ }, other, toolbarButtonProps, {
5977
+ ref: handleRef
5978
+ }));
5979
+ return /* @__PURE__ */ _jsx3(React32.Fragment, {
5980
+ children: element
5981
+ });
5982
+ });
5983
+ if (process.env.NODE_ENV !== "production") ToolbarButton.displayName = "ToolbarButton";
5984
+ process.env.NODE_ENV !== "production" ? ToolbarButton.propTypes = {
5985
+ // ----------------------------- Warning --------------------------------
5986
+ // | These PropTypes are generated from the TypeScript type definitions |
5987
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
5988
+ // ----------------------------------------------------------------------
5989
+ className: import_prop_types.default.string,
5990
+ color: import_prop_types.default.oneOf(["default", "inherit", "primary"]),
5991
+ /**
5992
+ * The component used for the root node. Either a string to use an HTML element or a component.
5993
+ */
5994
+ component: import_prop_types.default.elementType,
5995
+ disabled: import_prop_types.default.bool,
5996
+ edge: import_prop_types.default.oneOf(["end", "start", false]),
5997
+ /**
5998
+ * The URL to link to. If set, and `component` is not set, the component renders as an anchor tag.
5999
+ */
6000
+ href: import_prop_types.default.string,
6001
+ id: import_prop_types.default.string,
6002
+ label: import_prop_types.default.string,
6003
+ /**
6004
+ * The relationship of the linked URL.
6005
+ * Set it to `noopener noreferrer` when `target` is set to `_blank` to avoid a security issue.
6006
+ */
6007
+ rel: import_prop_types.default.string,
6008
+ /**
6009
+ * A function to customize rendering of the component.
6010
+ */
6011
+ render: import_prop_types.default.oneOfType([import_prop_types.default.element, import_prop_types.default.func]),
6012
+ role: import_prop_types.default.string,
6013
+ size: import_prop_types.default.oneOf(["large", "medium", "small"]),
6014
+ style: import_prop_types.default.object,
6015
+ tabIndex: import_prop_types.default.number,
6016
+ /**
6017
+ * Where to display the linked URL, as the name for a browsing context.
6018
+ */
6019
+ target: import_prop_types.default.string,
6020
+ title: import_prop_types.default.string,
6021
+ touchRippleRef: import_prop_types.default.any
6022
+ } : void 0;
6023
+
6024
+ // node_modules/@mui/x-data-grid/hooks/features/columnMenu/getColumnMenuItemKeys.mjs
6025
+ var import_extends5 = __toESM(require_extends(), 1);
6026
+ function getColumnMenuItemKeys(params) {
6027
+ const {
6028
+ apiRef,
6029
+ colDef,
6030
+ defaultSlots,
6031
+ defaultSlotProps,
6032
+ slots = {},
6033
+ slotProps = {}
6034
+ } = params;
6035
+ const processedComponents = (0, import_extends5.default)({}, defaultSlots, slots);
6036
+ let processedSlotProps = defaultSlotProps;
6037
+ if (slotProps && Object.keys(slotProps).length > 0) {
6038
+ const mergedProps = (0, import_extends5.default)({}, slotProps);
6039
+ Object.entries(defaultSlotProps).forEach(([key, currentSlotProps]) => {
6040
+ mergedProps[key] = (0, import_extends5.default)({}, currentSlotProps, slotProps[key] || {});
6041
+ });
6042
+ processedSlotProps = mergedProps;
6043
+ }
6044
+ const defaultItems = apiRef.current.unstable_applyPipeProcessors("columnMenu", [], colDef);
6045
+ const defaultComponentKeys = Object.keys(defaultSlots);
6046
+ const userItems = Object.keys(slots).filter((key) => !defaultComponentKeys.includes(key));
6047
+ const uniqueItems = Array.from(/* @__PURE__ */ new Set([...defaultItems, ...userItems]));
6048
+ const cleansedItems = uniqueItems.filter((key) => processedComponents[key] != null);
6049
+ return cleansedItems.sort((a, b) => {
6050
+ const leftItemProps = processedSlotProps[a];
6051
+ const rightItemProps = processedSlotProps[b];
6052
+ const leftDisplayOrder = Number.isFinite(leftItemProps?.displayOrder) ? leftItemProps.displayOrder : 100;
6053
+ const rightDisplayOrder = Number.isFinite(rightItemProps?.displayOrder) ? rightItemProps.displayOrder : 100;
6054
+ return leftDisplayOrder - rightDisplayOrder;
6055
+ });
6056
+ }
6057
+
6058
+ // node_modules/@mui/x-data-grid/components/menu/columnMenu/GridColumnMenuContainer.mjs
6059
+ var import_extends6 = __toESM(require_extends(), 1);
6060
+ var import_objectWithoutPropertiesLoose2 = __toESM(require_objectWithoutPropertiesLoose(), 1);
6061
+ var import_prop_types2 = __toESM(require_prop_types(), 1);
6062
+ import * as React33 from "react";
6063
+ import { styled as styled3 } from "@mui/material/styles";
6064
+ import { jsx as _jsx4 } from "react/jsx-runtime";
6065
+ var _excluded3 = ["hideMenu", "colDef", "id", "labelledby", "className", "children", "open"];
6066
+ var StyledMenuList = styled3(NotRendered, {
6067
+ slot: "internal"
6068
+ })(() => ({
6069
+ minWidth: 248
6070
+ }));
6071
+ function handleMenuScrollCapture(event) {
6072
+ if (!event.currentTarget.contains(event.target)) {
6073
+ return;
6074
+ }
6075
+ event.stopPropagation();
6076
+ }
6077
+ var GridColumnMenuContainer = forwardRef3(function GridColumnMenuContainer2(props, ref) {
6078
+ const {
6079
+ hideMenu,
6080
+ id,
6081
+ labelledby,
6082
+ className,
6083
+ children,
6084
+ open
6085
+ } = props, other = (0, import_objectWithoutPropertiesLoose2.default)(props, _excluded3);
6086
+ const rootProps = useGridRootProps2();
6087
+ const handleListKeyDown = React33.useCallback((event) => {
6088
+ if (event.key === "Tab") {
6089
+ event.preventDefault();
6090
+ }
6091
+ if (isHideMenuKey(event.key)) {
6092
+ hideMenu(event);
6093
+ }
6094
+ }, [hideMenu]);
6095
+ return /* @__PURE__ */ _jsx4(StyledMenuList, (0, import_extends6.default)({
6096
+ as: rootProps.slots.baseMenuList,
6097
+ id,
6098
+ className: clsx_default(gridClasses.menuList, className),
6099
+ "aria-labelledby": labelledby,
6100
+ onKeyDown: handleListKeyDown,
6101
+ onWheel: handleMenuScrollCapture,
6102
+ onTouchMove: handleMenuScrollCapture,
6103
+ autoFocus: open
6104
+ }, other, {
6105
+ ref,
6106
+ children
6107
+ }));
6108
+ });
6109
+ if (process.env.NODE_ENV !== "production") GridColumnMenuContainer.displayName = "GridColumnMenuContainer";
6110
+ process.env.NODE_ENV !== "production" ? GridColumnMenuContainer.propTypes = {
6111
+ // ----------------------------- Warning --------------------------------
6112
+ // | These PropTypes are generated from the TypeScript type definitions |
6113
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
6114
+ // ----------------------------------------------------------------------
6115
+ colDef: import_prop_types2.default.object.isRequired,
6116
+ hideMenu: import_prop_types2.default.func.isRequired,
6117
+ id: import_prop_types2.default.string,
6118
+ labelledby: import_prop_types2.default.string,
6119
+ open: import_prop_types2.default.bool.isRequired
6120
+ } : void 0;
6121
+
6122
+ // node_modules/@mui/x-data-grid/components/menu/columnMenu/GridColumnMenu.mjs
6123
+ var import_extends9 = __toESM(require_extends(), 1);
6124
+ var import_objectWithoutPropertiesLoose4 = __toESM(require_objectWithoutPropertiesLoose(), 1);
6125
+ var import_prop_types8 = __toESM(require_prop_types(), 1);
6126
+
6127
+ // node_modules/@mui/x-data-grid/hooks/features/columnMenu/useGridColumnMenuSlots.mjs
6128
+ var import_objectWithoutPropertiesLoose3 = __toESM(require_objectWithoutPropertiesLoose(), 1);
6129
+ var import_extends7 = __toESM(require_extends(), 1);
6130
+ import * as React34 from "react";
6131
+ var _excluded4 = ["displayOrder"];
6132
+ var useGridColumnMenuSlots = (props) => {
6133
+ const apiRef = useGridPrivateApiContext();
6134
+ const rootProps = useGridRootProps2();
6135
+ const {
6136
+ defaultSlots,
6137
+ defaultSlotProps,
6138
+ slots = {},
6139
+ slotProps = {},
6140
+ hideMenu,
6141
+ colDef,
6142
+ addDividers = true
6143
+ } = props;
6144
+ const processedComponents = React34.useMemo(() => (0, import_extends7.default)({}, defaultSlots, slots), [defaultSlots, slots]);
6145
+ const processedSlotProps = React34.useMemo(() => {
6146
+ if (!slotProps || Object.keys(slotProps).length === 0) {
6147
+ return defaultSlotProps;
6148
+ }
6149
+ const mergedProps = (0, import_extends7.default)({}, slotProps);
6150
+ Object.entries(defaultSlotProps).forEach(([key, currentSlotProps]) => {
6151
+ mergedProps[key] = (0, import_extends7.default)({}, currentSlotProps, slotProps[key] || {});
6152
+ });
6153
+ return mergedProps;
6154
+ }, [defaultSlotProps, slotProps]);
6155
+ return React34.useMemo(() => {
6156
+ const sortedKeys = getColumnMenuItemKeys({
6157
+ apiRef,
6158
+ colDef,
6159
+ defaultSlots,
6160
+ defaultSlotProps,
6161
+ slots,
6162
+ slotProps
6163
+ });
6164
+ return sortedKeys.reduce((acc, key, index) => {
6165
+ let itemProps = {
6166
+ colDef,
6167
+ onClick: hideMenu
6168
+ };
6169
+ const processedComponentProps = processedSlotProps[key];
6170
+ if (processedComponentProps) {
6171
+ const customProps = (0, import_objectWithoutPropertiesLoose3.default)(processedComponentProps, _excluded4);
6172
+ itemProps = (0, import_extends7.default)({}, itemProps, customProps);
6173
+ }
6174
+ return addDividers && index !== sortedKeys.length - 1 ? [...acc, [processedComponents[key], itemProps], [rootProps.slots.baseDivider, {}]] : [...acc, [processedComponents[key], itemProps]];
6175
+ }, []);
6176
+ }, [addDividers, apiRef, colDef, defaultSlotProps, defaultSlots, hideMenu, processedComponents, processedSlotProps, slotProps, slots, rootProps.slots.baseDivider]);
6177
+ };
6178
+
6179
+ // node_modules/@mui/x-data-grid/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.mjs
6180
+ var import_extends8 = __toESM(require_extends(), 1);
6181
+ var import_prop_types5 = __toESM(require_prop_types(), 1);
6182
+ import * as React37 from "react";
6183
+
6184
+ // node_modules/@mui/x-data-grid/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.mjs
6185
+ var import_prop_types3 = __toESM(require_prop_types(), 1);
6186
+ import * as React35 from "react";
6187
+ import { jsx as _jsx5 } from "react/jsx-runtime";
6188
+ function GridColumnMenuHideItem(props) {
6189
+ const {
6190
+ colDef,
6191
+ onClick
6192
+ } = props;
6193
+ const apiRef = useGridApiContext2();
6194
+ const rootProps = useGridRootProps2();
6195
+ const visibleColumns = gridVisibleColumnDefinitionsSelector(apiRef);
6196
+ const columnsWithMenu = visibleColumns.filter((col) => col.disableColumnMenu !== true);
6197
+ const disabled = columnsWithMenu.length === 1;
6198
+ const toggleColumn = React35.useCallback((event) => {
6199
+ if (disabled) {
6200
+ return;
6201
+ }
6202
+ apiRef.current.setColumnVisibility(colDef.field, false);
6203
+ onClick(event);
6204
+ }, [apiRef, colDef.field, onClick, disabled]);
6205
+ if (rootProps.disableColumnSelector) {
6206
+ return null;
6207
+ }
6208
+ if (colDef.hideable === false) {
6209
+ return null;
6210
+ }
6211
+ return /* @__PURE__ */ _jsx5(rootProps.slots.baseMenuItem, {
6212
+ onClick: toggleColumn,
6213
+ disabled,
6214
+ iconStart: /* @__PURE__ */ _jsx5(rootProps.slots.columnMenuHideIcon, {
6215
+ fontSize: "small"
6216
+ }),
6217
+ children: apiRef.current.getLocaleText("columnMenuHideColumn")
6218
+ });
6219
+ }
6220
+ process.env.NODE_ENV !== "production" ? GridColumnMenuHideItem.propTypes = {
6221
+ // ----------------------------- Warning --------------------------------
6222
+ // | These PropTypes are generated from the TypeScript type definitions |
6223
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
6224
+ // ----------------------------------------------------------------------
6225
+ colDef: import_prop_types3.default.object.isRequired,
6226
+ onClick: import_prop_types3.default.func.isRequired
6227
+ } : void 0;
6228
+
6229
+ // node_modules/@mui/x-data-grid/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.mjs
6230
+ var import_prop_types4 = __toESM(require_prop_types(), 1);
6231
+ import * as React36 from "react";
6232
+ import { jsx as _jsx6 } from "react/jsx-runtime";
6233
+ function GridColumnMenuManageItem(props) {
6234
+ const {
6235
+ onClick
6236
+ } = props;
6237
+ const apiRef = useGridApiContext2();
6238
+ const rootProps = useGridRootProps2();
6239
+ const showColumns = React36.useCallback((event) => {
6240
+ onClick(event);
6241
+ apiRef.current.showPreferences(GridPreferencePanelsValue.columns);
6242
+ }, [apiRef, onClick]);
6243
+ if (rootProps.disableColumnSelector) {
6244
+ return null;
6245
+ }
6246
+ return /* @__PURE__ */ _jsx6(rootProps.slots.baseMenuItem, {
6247
+ onClick: showColumns,
6248
+ iconStart: /* @__PURE__ */ _jsx6(rootProps.slots.columnMenuManageColumnsIcon, {
6249
+ fontSize: "small"
6250
+ }),
6251
+ children: apiRef.current.getLocaleText("columnMenuManageColumns")
6252
+ });
6253
+ }
6254
+ process.env.NODE_ENV !== "production" ? GridColumnMenuManageItem.propTypes = {
6255
+ // ----------------------------- Warning --------------------------------
6256
+ // | These PropTypes are generated from the TypeScript type definitions |
6257
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
6258
+ // ----------------------------------------------------------------------
6259
+ colDef: import_prop_types4.default.object.isRequired,
6260
+ onClick: import_prop_types4.default.func.isRequired
6261
+ } : void 0;
6262
+
6263
+ // node_modules/@mui/x-data-grid/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.mjs
6264
+ import { jsx as _jsx7, jsxs as _jsxs } from "react/jsx-runtime";
6265
+ function GridColumnMenuColumnsItem(props) {
6266
+ return /* @__PURE__ */ _jsxs(React37.Fragment, {
6267
+ children: [/* @__PURE__ */ _jsx7(GridColumnMenuHideItem, (0, import_extends8.default)({}, props)), /* @__PURE__ */ _jsx7(GridColumnMenuManageItem, (0, import_extends8.default)({}, props))]
6268
+ });
6269
+ }
6270
+ process.env.NODE_ENV !== "production" ? GridColumnMenuColumnsItem.propTypes = {
6271
+ // ----------------------------- Warning --------------------------------
6272
+ // | These PropTypes are generated from the TypeScript type definitions |
6273
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
6274
+ // ----------------------------------------------------------------------
6275
+ colDef: import_prop_types5.default.object.isRequired,
6276
+ onClick: import_prop_types5.default.func.isRequired
6277
+ } : void 0;
6278
+
6279
+ // node_modules/@mui/x-data-grid/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.mjs
6280
+ var import_prop_types6 = __toESM(require_prop_types(), 1);
6281
+ import * as React38 from "react";
6282
+ import { jsx as _jsx8 } from "react/jsx-runtime";
6283
+ function GridColumnMenuFilterItem(props) {
6284
+ const {
6285
+ colDef,
6286
+ onClick
6287
+ } = props;
6288
+ const apiRef = useGridApiContext2();
6289
+ const rootProps = useGridRootProps2();
6290
+ const showFilter = React38.useCallback((event) => {
6291
+ onClick(event);
6292
+ apiRef.current.showFilterPanel(colDef.field);
6293
+ }, [apiRef, colDef.field, onClick]);
6294
+ if (rootProps.disableColumnFilter || !colDef.filterable) {
6295
+ return null;
6296
+ }
6297
+ return /* @__PURE__ */ _jsx8(rootProps.slots.baseMenuItem, {
6298
+ onClick: showFilter,
6299
+ iconStart: /* @__PURE__ */ _jsx8(rootProps.slots.columnMenuFilterIcon, {
6300
+ fontSize: "small"
6301
+ }),
6302
+ children: apiRef.current.getLocaleText("columnMenuFilter")
6303
+ });
6304
+ }
6305
+ process.env.NODE_ENV !== "production" ? GridColumnMenuFilterItem.propTypes = {
6306
+ // ----------------------------- Warning --------------------------------
6307
+ // | These PropTypes are generated from the TypeScript type definitions |
6308
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
6309
+ // ----------------------------------------------------------------------
6310
+ colDef: import_prop_types6.default.object.isRequired,
6311
+ onClick: import_prop_types6.default.func.isRequired
6312
+ } : void 0;
6313
+
6314
+ // node_modules/@mui/x-data-grid/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.mjs
6315
+ var import_prop_types7 = __toESM(require_prop_types(), 1);
6316
+ import * as React39 from "react";
6317
+ import { jsx as _jsx9, jsxs as _jsxs2 } from "react/jsx-runtime";
6318
+ function GridColumnMenuSortItem(props) {
6319
+ const {
6320
+ colDef,
6321
+ onClick
6322
+ } = props;
6323
+ const apiRef = useGridApiContext2();
6324
+ const sortModel = useGridSelector2(apiRef, gridSortModelSelector);
6325
+ const rootProps = useGridRootProps2();
6326
+ const sortDirection = React39.useMemo(() => {
6327
+ if (!colDef) {
6328
+ return null;
6329
+ }
6330
+ const sortItem = sortModel.find((item) => item.field === colDef.field);
6331
+ return sortItem?.sort;
6332
+ }, [colDef, sortModel]);
6333
+ const sortingOrder = colDef.sortingOrder ?? rootProps.sortingOrder;
6334
+ const onSortMenuItemClick = React39.useCallback((event) => {
6335
+ onClick(event);
6336
+ const direction = event.currentTarget.getAttribute("data-value") || null;
6337
+ const allowMultipleSorting = rootProps.multipleColumnsSortingMode === "always";
6338
+ apiRef.current.sortColumn(colDef.field, direction === sortDirection ? null : direction, allowMultipleSorting);
6339
+ }, [apiRef, colDef, onClick, sortDirection, rootProps.multipleColumnsSortingMode]);
6340
+ if (rootProps.disableColumnSorting || !colDef || !colDef.sortable || !sortingOrder.some((item) => !!item)) {
6341
+ return null;
6342
+ }
6343
+ const getLabel = (key) => {
6344
+ const label = apiRef.current.getLocaleText(key);
6345
+ return typeof label === "function" ? label(colDef) : label;
6346
+ };
6347
+ return /* @__PURE__ */ _jsxs2(React39.Fragment, {
6348
+ children: [sortingOrder.includes("asc") && sortDirection !== "asc" ? /* @__PURE__ */ _jsx9(rootProps.slots.baseMenuItem, {
6349
+ onClick: onSortMenuItemClick,
6350
+ "data-value": "asc",
6351
+ iconStart: /* @__PURE__ */ _jsx9(rootProps.slots.columnMenuSortAscendingIcon, {
6352
+ fontSize: "small"
6353
+ }),
6354
+ children: getLabel("columnMenuSortAsc")
6355
+ }) : null, sortingOrder.includes("desc") && sortDirection !== "desc" ? /* @__PURE__ */ _jsx9(rootProps.slots.baseMenuItem, {
6356
+ onClick: onSortMenuItemClick,
6357
+ "data-value": "desc",
6358
+ iconStart: /* @__PURE__ */ _jsx9(rootProps.slots.columnMenuSortDescendingIcon, {
6359
+ fontSize: "small"
6360
+ }),
6361
+ children: getLabel("columnMenuSortDesc")
6362
+ }) : null, sortingOrder.includes(null) && sortDirection != null ? /* @__PURE__ */ _jsx9(rootProps.slots.baseMenuItem, {
6363
+ onClick: onSortMenuItemClick,
6364
+ iconStart: rootProps.slots.columnMenuUnsortIcon ? /* @__PURE__ */ _jsx9(rootProps.slots.columnMenuUnsortIcon, {
6365
+ fontSize: "small"
6366
+ }) : /* @__PURE__ */ _jsx9("span", {}),
6367
+ children: apiRef.current.getLocaleText("columnMenuUnsort")
6368
+ }) : null]
6369
+ });
6370
+ }
6371
+ process.env.NODE_ENV !== "production" ? GridColumnMenuSortItem.propTypes = {
6372
+ // ----------------------------- Warning --------------------------------
6373
+ // | These PropTypes are generated from the TypeScript type definitions |
6374
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
6375
+ // ----------------------------------------------------------------------
6376
+ colDef: import_prop_types7.default.object.isRequired,
6377
+ onClick: import_prop_types7.default.func.isRequired
6378
+ } : void 0;
6379
+
6380
+ // node_modules/@mui/x-data-grid/components/menu/columnMenu/GridColumnMenu.mjs
6381
+ import { jsx as _jsx10 } from "react/jsx-runtime";
6382
+ var _excluded5 = ["defaultSlots", "defaultSlotProps", "slots", "slotProps"];
6383
+ var GRID_COLUMN_MENU_SLOTS = {
6384
+ columnMenuSortItem: GridColumnMenuSortItem,
6385
+ columnMenuFilterItem: GridColumnMenuFilterItem,
6386
+ columnMenuColumnsItem: GridColumnMenuColumnsItem
6387
+ };
6388
+ var GRID_COLUMN_MENU_SLOT_PROPS = {
6389
+ columnMenuSortItem: {
6390
+ displayOrder: 10
6391
+ },
6392
+ columnMenuFilterItem: {
6393
+ displayOrder: 20
6394
+ },
6395
+ columnMenuColumnsItem: {
6396
+ displayOrder: 30
6397
+ }
6398
+ };
6399
+ var GridGenericColumnMenu = forwardRef3(function GridGenericColumnMenu2(props, ref) {
6400
+ const {
6401
+ defaultSlots,
6402
+ defaultSlotProps,
6403
+ slots,
6404
+ slotProps
6405
+ } = props, other = (0, import_objectWithoutPropertiesLoose4.default)(props, _excluded5);
6406
+ const orderedSlots = useGridColumnMenuSlots((0, import_extends9.default)({}, other, {
6407
+ defaultSlots,
6408
+ defaultSlotProps,
6409
+ slots,
6410
+ slotProps
6411
+ }));
6412
+ return /* @__PURE__ */ _jsx10(GridColumnMenuContainer, (0, import_extends9.default)({}, other, {
6413
+ ref,
6414
+ children: orderedSlots.map(([Component, otherProps], index) => /* @__PURE__ */ _jsx10(Component, (0, import_extends9.default)({}, otherProps), index))
6415
+ }));
6416
+ });
6417
+ if (process.env.NODE_ENV !== "production") GridGenericColumnMenu.displayName = "GridGenericColumnMenu";
6418
+ process.env.NODE_ENV !== "production" ? GridGenericColumnMenu.propTypes = {
6419
+ // ----------------------------- Warning --------------------------------
6420
+ // | These PropTypes are generated from the TypeScript type definitions |
6421
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
6422
+ // ----------------------------------------------------------------------
6423
+ colDef: import_prop_types8.default.object.isRequired,
6424
+ /**
6425
+ * Initial `slotProps` - it is internal, to be overrriden by Pro or Premium packages
6426
+ * @ignore - do not document.
6427
+ */
6428
+ defaultSlotProps: import_prop_types8.default.object.isRequired,
6429
+ /**
6430
+ * Initial `slots` - it is internal, to be overrriden by Pro or Premium packages
6431
+ * @ignore - do not document.
6432
+ */
6433
+ defaultSlots: import_prop_types8.default.object.isRequired,
6434
+ hideMenu: import_prop_types8.default.func.isRequired,
6435
+ id: import_prop_types8.default.string,
6436
+ labelledby: import_prop_types8.default.string,
6437
+ open: import_prop_types8.default.bool.isRequired,
6438
+ /**
6439
+ * Could be used to pass new props or override props specific to a column menu component
6440
+ * e.g. `displayOrder`
6441
+ */
6442
+ slotProps: import_prop_types8.default.object,
6443
+ /**
6444
+ * `slots` could be used to add new and (or) override default column menu items
6445
+ * If you register a nee component you must pass it's `displayOrder` in `slotProps`
6446
+ * or it will be placed in the end of the list
6447
+ */
6448
+ slots: import_prop_types8.default.object
6449
+ } : void 0;
6450
+ var GridColumnMenu = forwardRef3(function GridColumnMenu2(props, ref) {
6451
+ return /* @__PURE__ */ _jsx10(GridGenericColumnMenu, (0, import_extends9.default)({}, props, {
6452
+ ref,
6453
+ defaultSlots: GRID_COLUMN_MENU_SLOTS,
6454
+ defaultSlotProps: GRID_COLUMN_MENU_SLOT_PROPS
6455
+ }));
6456
+ });
6457
+ if (process.env.NODE_ENV !== "production") GridColumnMenu.displayName = "GridColumnMenu";
6458
+ GridColumnMenu.defaultSlots = GRID_COLUMN_MENU_SLOTS;
6459
+ GridColumnMenu.defaultSlotProps = GRID_COLUMN_MENU_SLOT_PROPS;
6460
+ process.env.NODE_ENV !== "production" ? GridColumnMenu.propTypes = {
6461
+ // ----------------------------- Warning --------------------------------
6462
+ // | These PropTypes are generated from the TypeScript type definitions |
6463
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
6464
+ // ----------------------------------------------------------------------
6465
+ colDef: import_prop_types8.default.object.isRequired,
6466
+ hideMenu: import_prop_types8.default.func.isRequired,
6467
+ id: import_prop_types8.default.string,
6468
+ labelledby: import_prop_types8.default.string,
6469
+ open: import_prop_types8.default.bool.isRequired,
6470
+ /**
6471
+ * Could be used to pass new props or override props specific to a column menu component
6472
+ * e.g. `displayOrder`
6473
+ */
6474
+ slotProps: import_prop_types8.default.object,
6475
+ /**
6476
+ * `slots` could be used to add new and (or) override default column menu items
6477
+ * If you register a nee component you must pass it's `displayOrder` in `slotProps`
6478
+ * or it will be placed in the end of the list
6479
+ */
6480
+ slots: import_prop_types8.default.object
6481
+ } : void 0;
6482
+
6483
+ // node_modules/@mui/x-data-grid/components/columnsPanel/ColumnsPanelTrigger.mjs
6484
+ var import_extends10 = __toESM(require_extends(), 1);
6485
+ var import_objectWithoutPropertiesLoose5 = __toESM(require_objectWithoutPropertiesLoose(), 1);
6486
+ var import_prop_types9 = __toESM(require_prop_types(), 1);
6487
+ import * as React40 from "react";
6488
+ import { jsx as _jsx11 } from "react/jsx-runtime";
6489
+ var _excluded6 = ["render", "className", "onClick", "onPointerUp"];
6490
+ var ColumnsPanelTrigger = forwardRef3(function ColumnsPanelTrigger2(props, ref) {
6491
+ const {
6492
+ render,
6493
+ className,
6494
+ onClick,
6495
+ onPointerUp
6496
+ } = props, other = (0, import_objectWithoutPropertiesLoose5.default)(props, _excluded6);
6497
+ const rootProps = useGridRootProps2();
6498
+ const buttonId = useId();
6499
+ const panelId = useId();
6500
+ const apiRef = useGridApiContext2();
6501
+ const panelState = useGridSelector2(apiRef, gridPreferencePanelStateSelector);
6502
+ const open = panelState.open && panelState.openedPanelValue === GridPreferencePanelsValue.columns;
6503
+ const state = {
6504
+ open
6505
+ };
6506
+ const resolvedClassName = typeof className === "function" ? className(state) : className;
6507
+ const {
6508
+ triggers
6509
+ } = useGridPanelContext();
6510
+ const handleRef = useForkRef(ref, triggers.columnsPanel.setRef);
6511
+ const handleClick = (event) => {
6512
+ if (open) {
6513
+ apiRef.current.hidePreferences();
6514
+ } else {
6515
+ apiRef.current.showPreferences(GridPreferencePanelsValue.columns, panelId, buttonId);
6516
+ }
6517
+ onClick?.(event);
6518
+ };
6519
+ const handlePointerUp = (event) => {
6520
+ if (open) {
6521
+ event.stopPropagation();
6522
+ }
6523
+ onPointerUp?.(event);
6524
+ };
6525
+ const element = useComponentRenderer(rootProps.slots.baseButton, render, (0, import_extends10.default)({}, rootProps.slotProps?.baseButton, {
6526
+ id: buttonId,
6527
+ "aria-haspopup": "true",
6528
+ "aria-expanded": open ? "true" : void 0,
6529
+ "aria-controls": open ? panelId : void 0,
6530
+ className: resolvedClassName
6531
+ }, other, {
6532
+ onPointerUp: handlePointerUp,
6533
+ onClick: handleClick,
6534
+ ref: handleRef
6535
+ }), state);
6536
+ return /* @__PURE__ */ _jsx11(React40.Fragment, {
6537
+ children: element
6538
+ });
6539
+ });
6540
+ if (process.env.NODE_ENV !== "production") ColumnsPanelTrigger.displayName = "ColumnsPanelTrigger";
6541
+ process.env.NODE_ENV !== "production" ? ColumnsPanelTrigger.propTypes = {
6542
+ // ----------------------------- Warning --------------------------------
6543
+ // | These PropTypes are generated from the TypeScript type definitions |
6544
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
6545
+ // ----------------------------------------------------------------------
6546
+ /**
6547
+ * Override or extend the styles applied to the component.
6548
+ */
6549
+ className: import_prop_types9.default.oneOfType([import_prop_types9.default.func, import_prop_types9.default.string]),
6550
+ disabled: import_prop_types9.default.bool,
6551
+ id: import_prop_types9.default.string,
6552
+ /**
6553
+ * A function to customize rendering of the component.
6554
+ */
6555
+ render: import_prop_types9.default.oneOfType([import_prop_types9.default.element, import_prop_types9.default.func]),
6556
+ role: import_prop_types9.default.string,
6557
+ size: import_prop_types9.default.oneOf(["large", "medium", "small"]),
6558
+ startIcon: import_prop_types9.default.node,
6559
+ style: import_prop_types9.default.object,
6560
+ tabIndex: import_prop_types9.default.number,
6561
+ title: import_prop_types9.default.string,
6562
+ touchRippleRef: import_prop_types9.default.any
6563
+ } : void 0;
6564
+
6565
+ // src/UI/components/tables/TableCustomColumnMenu.tsx
6566
+ import { Fragment as Fragment16, jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
6567
+ var CustomButtonGroupItem = (columnProps, handleSetColumnAlign) => {
6568
+ const { hideMenu, colDef } = columnProps;
6569
+ const handleAlignmentChange = (event, value) => {
6570
+ if (event) handleSetColumnAlign(colDef.field, value);
6571
+ hideMenu();
6572
+ };
6573
+ return /* @__PURE__ */ jsxs16(MenuItem5, { disableRipple: true, style: { pointerEvents: "auto", display: "block" }, onClick: (e) => e.stopPropagation(), children: [
6574
+ /* @__PURE__ */ jsxs16(Typography12, { variant: "body2", component: "div", sx: { mb: 1 }, children: [
6575
+ /* @__PURE__ */ jsx24(TranslateText, { children: "Column align" }),
6576
+ ":"
6577
+ ] }),
6578
+ /* @__PURE__ */ jsxs16(
6579
+ ToggleButtonGroup,
6580
+ {
6581
+ value: colDef.align,
6582
+ exclusive: true,
6583
+ onChange: handleAlignmentChange,
6584
+ "aria-label": "text alignment",
6585
+ size: "small",
6586
+ children: [
6587
+ /* @__PURE__ */ jsxs16(ToggleButton, { value: "left", size: "small", "aria-label": "left aligned", color: "primary", children: [
6588
+ /* @__PURE__ */ jsx24(FormatAlignLeft, { fontSize: "small", style: { marginRight: "8px" } }),
6589
+ /* @__PURE__ */ jsx24(TranslateText, { children: "Left" })
6590
+ ] }),
6591
+ /* @__PURE__ */ jsxs16(ToggleButton, { value: "center", "aria-label": "centered", color: "primary", children: [
6592
+ /* @__PURE__ */ jsx24(FormatAlignCenter, { fontSize: "small", style: { marginRight: "8px" } }),
6593
+ /* @__PURE__ */ jsx24(TranslateText, { children: "Center" })
6594
+ ] }),
6595
+ /* @__PURE__ */ jsxs16(ToggleButton, { value: "right", "aria-label": "right aligned", color: "primary", children: [
6596
+ /* @__PURE__ */ jsx24(FormatAlignRight, { fontSize: "small", style: { marginRight: "8px" } }),
6597
+ /* @__PURE__ */ jsx24(TranslateText, { children: "Right" })
6598
+ ] })
6599
+ ]
6600
+ }
6601
+ )
6602
+ ] });
6603
+ };
6604
+ var CustomResetSettingsItem = (columnProps, handleResetToDefaultSettings) => {
6605
+ const { hideMenu } = columnProps;
6606
+ return /* @__PURE__ */ jsxs16(Fragment16, { children: [
6607
+ /* @__PURE__ */ jsx24(Divider5, {}),
6608
+ /* @__PURE__ */ jsxs16(
6609
+ MenuItem5,
6610
+ {
6611
+ onClick: () => {
6612
+ hideMenu();
6613
+ handleResetToDefaultSettings();
6614
+ },
6615
+ children: [
6616
+ /* @__PURE__ */ jsx24(ListItemIcon3, { children: /* @__PURE__ */ jsx24(Restore, { fontSize: "small" }) }),
6617
+ /* @__PURE__ */ jsx24(ListItemText4, { children: /* @__PURE__ */ jsx24(TranslateText, { children: "Set default view settings" }) })
6618
+ ]
6619
+ }
6620
+ )
6621
+ ] });
6622
+ };
6623
+ var TableCustomColumnMenu = (props, handleSetColumnAlign, handleResetToDefaultSettings) => {
6624
+ return /* @__PURE__ */ jsx24(
6625
+ GridColumnMenu,
6626
+ {
6627
+ ...props,
6628
+ slots: {
6629
+ columnMenuButtonGroup: (columnProps) => CustomButtonGroupItem(columnProps, handleSetColumnAlign),
6630
+ // 👈 Регистрируем пункт сброса в слотах
6631
+ customResetSettings: (columnProps) => CustomResetSettingsItem(columnProps, handleResetToDefaultSettings)
6632
+ },
6633
+ slotProps: {
6634
+ columnMenuButtonGroup: {
6635
+ displayOrder: 15,
6636
+ hideMenu: props.hideMenu,
6637
+ colDef: props.colDef
6638
+ },
6639
+ // 👈 Указываем порядковый номер отобажения внизу меню
6640
+ customResetSettings: {
6641
+ displayOrder: 200,
6642
+ hideMenu: props.hideMenu
6643
+ }
6644
+ }
6645
+ }
6646
+ );
6647
+ };
6648
+
6649
+ // src/UI/components/tables/TableCustomToolbar.tsx
6650
+ import { Toolbar } from "@mui/x-data-grid-premium";
6651
+
6652
+ // src/UI/components/tables/TableCustomToolbarOverlays.tsx
6653
+ import { Check, Close, Deselect, FileDownload, Save, SelectAll, Settings as Settings2, Sort, SortByAlpha, SwapVert, Tune, ViewColumn } from "@mui/icons-material";
6654
+ import { Box as Box14, Button as Button8, Dialog, DialogActions, DialogContent, DialogTitle, Divider as Divider6, FormControl as FormControl2, IconButton as IconButton11, InputLabel as InputLabel2, ListItemIcon as ListItemIcon4, ListItemText as ListItemText5, Menu as Menu3, MenuItem as MenuItem6, Select as Select3, Stack as Stack2, Tooltip as Tooltip9, Typography as Typography13, useMediaQuery as useMediaQuery2, useTheme as useTheme3 } from "@mui/material";
6655
+ import { ExportExcel } from "@mui/x-data-grid-premium";
6656
+ import { useEffect as useEffect12, useMemo as useMemo8, useRef as useRef7, useState as useState20 } from "react";
6657
+ import { Fragment as Fragment17, jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
6658
+ var ToolbarRefreshButton = ({ apiRef, isLoading, handleRefreshTable }) => {
6659
+ const renderIcon = () => /* @__PURE__ */ jsx25(AnimatedRefreshIcon, { fontSize: "small", isSpinning: isLoading });
6660
+ return /* @__PURE__ */ jsx25(TranslatableTooltipComponent, { title: "Refresh", children: /* @__PURE__ */ jsx25(
6661
+ ToolbarButton,
6662
+ {
6663
+ id: "refresh-table-trigger",
6664
+ disabled: isLoading,
6665
+ onClick: () => {
6666
+ handleRefreshTable();
6667
+ apiRef.current?.setRowSelectionModel({
6668
+ type: "include",
6669
+ ids: /* @__PURE__ */ new Set()
6670
+ });
6671
+ },
6672
+ children: renderIcon()
6673
+ }
6674
+ ) });
6675
+ };
6676
+ var ToolbarSelectAllButton = ({ rows, handleSelectAll }) => {
6677
+ return /* @__PURE__ */ jsx25(TranslatableTooltipComponent, { title: "Select all rows", children: /* @__PURE__ */ jsx25(ToolbarButton, { id: "select-all-rows", onClick: () => handleSelectAll(), disabled: !rows.length, children: /* @__PURE__ */ jsx25(SelectAll, { fontSize: "small" }) }) });
6678
+ };
6679
+ var ToolbarClearSelectionButton = ({ rows, handleClearSelection }) => {
6680
+ return /* @__PURE__ */ jsx25(TranslatableTooltipComponent, { title: "Clear selection", children: /* @__PURE__ */ jsx25(ToolbarButton, { id: "deselect-all-rows", onClick: () => handleClearSelection(), disabled: !rows.length, children: /* @__PURE__ */ jsx25(Deselect, { fontSize: "small" }) }) });
6681
+ };
6682
+ var ToolbarManageColumnsButton = () => {
6683
+ return /* @__PURE__ */ jsx25(TranslatableTooltipComponent, { title: "Manage columns", children: /* @__PURE__ */ jsx25(ColumnsPanelTrigger, { render: /* @__PURE__ */ jsx25(ToolbarButton, {}), children: /* @__PURE__ */ jsx25(ViewColumn, { fontSize: "small" }) }) });
6684
+ };
6685
+ var ToolbarSaveSettingsButton = ({ tableSettingsChanged, handleSaveTableSettings }) => {
6686
+ return /* @__PURE__ */ jsx25(Tooltip9, { title: "Save table settings" + (!tableSettingsChanged ? ": saved" : ""), children: /* @__PURE__ */ jsx25("span", { children: /* @__PURE__ */ jsx25(
6687
+ ToolbarButton,
6688
+ {
6689
+ id: "save-table-settings",
6690
+ disabled: !tableSettingsChanged,
6691
+ color: tableSettingsChanged ? "primary" : "inherit",
6692
+ onClick: () => handleSaveTableSettings(),
6693
+ children: /* @__PURE__ */ jsx25(Save, { fontSize: "small" })
6694
+ }
6695
+ ) }) });
6696
+ };
6697
+ var ToolbarExportEntireTableButton = ({ excelOptions }) => {
6698
+ const [exportMenuOpen, setExportMenuOpen] = useState20(false);
6699
+ const exportMenuTriggerRef = useRef7(null);
6700
+ return /* @__PURE__ */ jsxs17(Fragment17, { children: [
6701
+ /* @__PURE__ */ jsx25(TranslatableTooltipComponent, { title: "Export", children: /* @__PURE__ */ jsx25(
6702
+ ToolbarButton,
6703
+ {
6704
+ ref: exportMenuTriggerRef,
6705
+ id: "export-menu-trigger",
6706
+ "aria-controls": "export-menu",
6707
+ "aria-haspopup": "true",
6708
+ "aria-expanded": exportMenuOpen ? "true" : void 0,
6709
+ onClick: () => setExportMenuOpen(true),
6710
+ children: /* @__PURE__ */ jsx25(FileDownload, { fontSize: "small" })
6711
+ }
6712
+ ) }),
6713
+ /* @__PURE__ */ jsx25(
6714
+ Menu3,
6715
+ {
6716
+ id: "export-menu",
6717
+ anchorEl: exportMenuTriggerRef.current,
6718
+ open: exportMenuOpen,
6719
+ onClose: () => setExportMenuOpen(false),
6720
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
6721
+ transformOrigin: { vertical: "top", horizontal: "right" },
6722
+ children: /* @__PURE__ */ jsx25(
6723
+ ExportExcel,
6724
+ {
6725
+ render: /* @__PURE__ */ jsx25(MenuItem6, {}),
6726
+ options: {
6727
+ fileName: excelOptions?.fileName || "excel-export",
6728
+ allColumns: excelOptions?.allColumns,
6729
+ includeHeaders: excelOptions?.includeHeaders
6730
+ },
6731
+ children: /* @__PURE__ */ jsx25(TranslateText, { children: "Export to Excel" })
6732
+ }
6733
+ )
6734
+ }
6735
+ )
6736
+ ] });
6737
+ };
6738
+ var DENSITY_OPTIONS = [
6739
+ { label: "Compact density", value: "compact" },
6740
+ { label: "Standard density", value: "standard" },
6741
+ { label: "Comfortable density", value: "comfortable" }
6742
+ ];
6743
+ var ToolbarTableSettingsButton = ({
6744
+ tableSettingsChanged,
6745
+ handleSetTableDensitySettings
6746
+ }) => {
6747
+ const theme = useTheme3();
6748
+ const isMobile = useMediaQuery2(theme.breakpoints.down("sm"));
6749
+ const [settingsMenuOpen, setSettingsMenuOpen] = useState20(false);
6750
+ const settingsMenuTriggerRef = useRef7(null);
6751
+ return /* @__PURE__ */ jsxs17(Fragment17, { children: [
6752
+ /* @__PURE__ */ jsx25(Tooltip9, { title: "Settings", children: /* @__PURE__ */ jsx25(
6753
+ ToolbarButton,
6754
+ {
6755
+ ref: settingsMenuTriggerRef,
6756
+ id: "settings-menu-trigger",
6757
+ "aria-controls": "settings-menu",
6758
+ "aria-haspopup": "true",
6759
+ "aria-expanded": settingsMenuOpen ? "true" : void 0,
6760
+ onClick: () => setSettingsMenuOpen(true),
6761
+ children: /* @__PURE__ */ jsx25(Settings2, { fontSize: "small", sx: { ml: "auto" } })
6762
+ }
6763
+ ) }),
6764
+ /* @__PURE__ */ jsx25(Tooltip9, { title: "Settings", children: /* @__PURE__ */ jsxs17(
6765
+ Menu3,
6766
+ {
6767
+ id: "settings-menu",
6768
+ anchorEl: settingsMenuTriggerRef.current,
6769
+ open: settingsMenuOpen,
6770
+ onClose: () => setSettingsMenuOpen(false),
6771
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
6772
+ transformOrigin: { vertical: "top", horizontal: "right" },
6773
+ slotProps: {
6774
+ list: {
6775
+ "aria-labelledby": "settings-menu-trigger"
6776
+ }
6777
+ },
6778
+ children: [
6779
+ DENSITY_OPTIONS.map((option) => /* @__PURE__ */ jsx25(MenuItem6, { onClick: () => handleSetTableDensitySettings(option.value), children: /* @__PURE__ */ jsx25(ListItemText5, { children: option.label }) }, option.value)),
6780
+ !isMobile && /* @__PURE__ */ jsx25(Divider6, {}),
6781
+ !isMobile && /* @__PURE__ */ jsx25(MenuItem6, { children: /* @__PURE__ */ jsx25(ListItemText5, { children: "Show column borders" }) }),
6782
+ !isMobile && /* @__PURE__ */ jsx25(MenuItem6, { children: /* @__PURE__ */ jsx25(ListItemText5, { children: "Show cell borders" }) }),
6783
+ /* @__PURE__ */ jsx25(Divider6, {}),
6784
+ /* @__PURE__ */ jsxs17(
6785
+ MenuItem6,
6786
+ {
6787
+ children: [
6788
+ /* @__PURE__ */ jsx25(ListItemIcon4, { children: /* @__PURE__ */ jsx25(Tune, { fontSize: "small" }) }),
6789
+ /* @__PURE__ */ jsx25(ListItemText5, { children: "Apply default settings" })
6790
+ ]
6791
+ }
6792
+ ),
6793
+ /* @__PURE__ */ jsxs17(
6794
+ MenuItem6,
6795
+ {
6796
+ disabled: !tableSettingsChanged,
6797
+ color: tableSettingsChanged ? "primary" : "inherit",
6798
+ children: [
6799
+ /* @__PURE__ */ jsx25(ListItemIcon4, { children: /* @__PURE__ */ jsx25(Save, { fontSize: "small", color: tableSettingsChanged ? "primary" : "inherit" }) }),
6800
+ /* @__PURE__ */ jsx25(ListItemText5, { children: "Save settings" })
6801
+ ]
6802
+ }
6803
+ )
6804
+ ]
6805
+ }
6806
+ ) })
6807
+ ] });
6808
+ };
6809
+ var ToolbarTableSortDialog = ({
6810
+ open,
6811
+ onClose,
6812
+ columns,
6813
+ defaultSortModel,
6814
+ sortModel,
6815
+ onSortModelChange
6816
+ }) => {
6817
+ const { displayState } = useAppTheme();
6818
+ const [selectedField, setSelectedField] = useState20("");
6819
+ const [selectedOrder, setSelectedOrder] = useState20("asc");
6820
+ const sortableColumns = useMemo8(() => {
6821
+ return columns.filter((col) => col.sortable !== false && col.field !== "__actions__");
6822
+ }, [columns]);
6823
+ useEffect12(() => {
6824
+ if (!open) return;
6825
+ const activeSort = sortModel && sortModel.length > 0 ? sortModel[0] : defaultSortModel && defaultSortModel.length > 0 ? defaultSortModel[0] : null;
6826
+ const activeField = activeSort?.field || "";
6827
+ const isFieldAvailable = sortableColumns.some((col) => col.field === activeField);
6828
+ if (activeField && isFieldAvailable) {
6829
+ setSelectedField(activeField);
6830
+ setSelectedOrder(activeSort?.sort || "asc");
6831
+ } else {
6832
+ setSelectedField("");
6833
+ setSelectedOrder("asc");
6834
+ }
6835
+ }, [open, sortModel, defaultSortModel, sortableColumns]);
6836
+ const handleApply = () => {
6837
+ if (selectedField) {
6838
+ onSortModelChange([{ field: selectedField, sort: selectedOrder }]);
6839
+ } else {
6840
+ onSortModelChange([]);
6841
+ }
6842
+ onClose();
6843
+ };
6844
+ const handleReset = () => {
6845
+ if (defaultSortModel && defaultSortModel.length > 0) {
6846
+ onSortModelChange([{ field: defaultSortModel[0].field, sort: defaultSortModel[0].sort }]);
6847
+ } else {
6848
+ onSortModelChange([]);
6849
+ }
6850
+ onClose();
6851
+ };
6852
+ return /* @__PURE__ */ jsxs17(Dialog, { open, onClose, fullWidth: true, maxWidth: "xs", children: [
6853
+ /* @__PURE__ */ jsxs17(DialogTitle, { sx: { m: 0, p: 2, display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
6854
+ /* @__PURE__ */ jsxs17(Stack2, { direction: "row", spacing: 1, sx: { alignItems: "center" }, children: [
6855
+ /* @__PURE__ */ jsx25(Sort, { color: "primary" }),
6856
+ displayState.isMobile ? /* @__PURE__ */ jsx25(Typography13, { variant: "h6", children: /* @__PURE__ */ jsx25(TranslateText, { children: "Sorting" }) }) : /* @__PURE__ */ jsx25(Typography13, { variant: "h6", children: /* @__PURE__ */ jsx25(TranslateText, { children: "Sort Settings" }) })
6857
+ ] }),
6858
+ /* @__PURE__ */ jsx25(IconButton11, { onClick: onClose, size: "small", children: /* @__PURE__ */ jsx25(Close, {}) })
6859
+ ] }),
6860
+ /* @__PURE__ */ jsx25(Divider6, {}),
6861
+ /* @__PURE__ */ jsx25(DialogContent, { sx: { py: 3 }, children: /* @__PURE__ */ jsxs17(Stack2, { spacing: 3, children: [
6862
+ /* @__PURE__ */ jsxs17(
6863
+ FormControl2,
6864
+ {
6865
+ fullWidth: true,
6866
+ variant: "outlined",
6867
+ children: [
6868
+ /* @__PURE__ */ jsx25(InputLabel2, { id: "sort-field-label", children: /* @__PURE__ */ jsx25(TranslateText, { children: "Sort Column" }) }),
6869
+ /* @__PURE__ */ jsxs17(
6870
+ Select3,
6871
+ {
6872
+ labelId: "sort-field-label",
6873
+ value: selectedField,
6874
+ label: /* @__PURE__ */ jsx25(TranslateText, { children: "Sort Column" }),
6875
+ onChange: (e) => setSelectedField(e.target.value),
6876
+ startAdornment: /* @__PURE__ */ jsx25(Box14, { sx: { mr: 1, display: "flex" }, children: /* @__PURE__ */ jsx25(SwapVert, { fontSize: "small", color: "action" }) }),
6877
+ slotProps: {},
6878
+ children: [
6879
+ /* @__PURE__ */ jsx25(MenuItem6, { value: "", children: /* @__PURE__ */ jsx25("em", { children: /* @__PURE__ */ jsx25(TranslateText, { children: "None" }) }) }),
6880
+ sortableColumns.map((col) => /* @__PURE__ */ jsx25(MenuItem6, { value: col.field, children: typeof col.headerName === "string" ? col.headerName : col.field }, col.field))
6881
+ ]
6882
+ }
6883
+ )
6884
+ ]
6885
+ }
6886
+ ),
6887
+ /* @__PURE__ */ jsxs17(FormControl2, { fullWidth: true, variant: "outlined", disabled: !selectedField, children: [
6888
+ /* @__PURE__ */ jsx25(InputLabel2, { id: "sort-order-label", children: /* @__PURE__ */ jsx25(TranslateText, { children: "Sort Order" }) }),
6889
+ /* @__PURE__ */ jsxs17(
6890
+ Select3,
6891
+ {
6892
+ labelId: "sort-order-label",
6893
+ value: selectedOrder || "asc",
6894
+ label: /* @__PURE__ */ jsx25(TranslateText, { children: "Sort Order" }),
6895
+ onChange: (e) => setSelectedOrder(e.target.value),
6896
+ children: [
6897
+ /* @__PURE__ */ jsxs17(MenuItem6, { value: "asc", children: [
6898
+ /* @__PURE__ */ jsx25(TranslateText, { children: "Ascending" }),
6899
+ " (A-Z, 0-9)"
6900
+ ] }),
6901
+ /* @__PURE__ */ jsxs17(MenuItem6, { value: "desc", children: [
6902
+ /* @__PURE__ */ jsx25(TranslateText, { children: "Descending" }),
6903
+ " (Z-A, 9-0)"
6904
+ ] })
6905
+ ]
6906
+ }
6907
+ )
6908
+ ] })
6909
+ ] }) }),
6910
+ displayState.isMobile && /* @__PURE__ */ jsx25(DialogActions, { sx: { p: 2 }, children: /* @__PURE__ */ jsx25(Button8, { onClick: handleReset, color: "inherit", children: /* @__PURE__ */ jsx25(TranslateText, { children: "Reset" }) }) }),
6911
+ /* @__PURE__ */ jsxs17(DialogActions, { sx: { p: 2 }, children: [
6912
+ !displayState.isMobile && /* @__PURE__ */ jsx25(Button8, { onClick: handleReset, color: "inherit", children: /* @__PURE__ */ jsx25(TranslateText, { children: "Reset" }) }),
6913
+ /* @__PURE__ */ jsx25(Box14, { sx: { flexGrow: 1 } }),
6914
+ /* @__PURE__ */ jsx25(Button8, { onClick: onClose, color: "inherit", variant: "text", children: /* @__PURE__ */ jsx25(TranslateText, { children: "Cancel" }) }),
6915
+ /* @__PURE__ */ jsx25(Button8, { onClick: handleApply, variant: "contained", startIcon: /* @__PURE__ */ jsx25(Check, {}), disableElevation: true, size: "small", children: /* @__PURE__ */ jsx25(TranslateText, { children: "Apply" }) })
6916
+ ] })
6917
+ ] });
6918
+ };
6919
+ var ToolbarTableSortDialogButton = ({
6920
+ columns,
6921
+ defaultSortModel,
6922
+ sortModel,
6923
+ onSortModelChange
6924
+ }) => {
6925
+ const sortMenuTriggerRef = useRef7(null);
6926
+ const [isDialogOpen, setIsDialogOpen] = useState20(false);
6927
+ return /* @__PURE__ */ jsxs17(Fragment17, { children: [
6928
+ /* @__PURE__ */ jsx25(TranslatableTooltipComponent, { title: "Sorting", children: /* @__PURE__ */ jsx25(
6929
+ ToolbarButton,
6930
+ {
6931
+ ref: sortMenuTriggerRef,
6932
+ id: "table-sort-dialog",
6933
+ onClick: (event) => {
6934
+ event.currentTarget.blur();
6935
+ setIsDialogOpen(true);
6936
+ },
6937
+ children: /* @__PURE__ */ jsx25(SortByAlpha, { fontSize: "small", sx: { ml: "auto" } })
6938
+ }
6939
+ ) }),
6940
+ /* @__PURE__ */ jsx25(
6941
+ ToolbarTableSortDialog,
6942
+ {
6943
+ open: isDialogOpen,
6944
+ onClose: () => setIsDialogOpen(false),
6945
+ columns,
6946
+ defaultSortModel,
6947
+ sortModel,
6948
+ onSortModelChange: (newModel) => onSortModelChange(newModel)
6949
+ }
6950
+ )
6951
+ ] });
6952
+ };
6953
+ var TableCoreComponentOverlays = {
6954
+ RefreshButton: ToolbarRefreshButton,
6955
+ SelectAllButton: ToolbarSelectAllButton,
6956
+ ClearSelectionButton: ToolbarClearSelectionButton,
6957
+ ManageColumnsButton: ToolbarManageColumnsButton,
6958
+ SaveSettingsButton: ToolbarSaveSettingsButton,
6959
+ ExportEntireTableButton: ToolbarExportEntireTableButton,
6960
+ TableSettingsButton: ToolbarTableSettingsButton,
6961
+ SortDialogButton: ToolbarTableSortDialogButton,
6962
+ SortDialog: ToolbarTableSortDialog
6963
+ };
6964
+
6965
+ // src/UI/components/tables/TableCustomToolbar.tsx
6966
+ import { Divider as Divider7 } from "@mui/material";
6967
+ import { Fragment as Fragment18, jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
6968
+ var TableCustomToolbar = (props) => {
6969
+ const {
6970
+ apiRef,
6971
+ options,
6972
+ excelOptions,
6973
+ columns,
6974
+ columnVisibilityModel,
6975
+ defaultSortModel,
6976
+ sortModel,
6977
+ setSortModel,
6978
+ handleRefresh,
6979
+ isLoading,
6980
+ handleSelectAll,
6981
+ handleClearSelection,
6982
+ rows
6983
+ } = props;
6984
+ const { displayState } = useAppTheme();
6985
+ return /* @__PURE__ */ jsx26(Fragment18, { children: /* @__PURE__ */ jsxs18(Toolbar, { children: [
6986
+ !options?.hideRefreshButton && /* @__PURE__ */ jsx26(TableCoreComponentOverlays.RefreshButton, { apiRef, isLoading, handleRefreshTable: handleRefresh }),
6987
+ (!options?.disableSelecting && !options?.hideSelectAllButton || !options?.disableSelecting && !options?.hideClearSelectionButton || !options?.disableSelecting && (!options?.hideSelectAllButton || !options?.hideClearSelectionButton)) && /* @__PURE__ */ jsx26(Divider7, { orientation: "vertical", variant: "middle", flexItem: true, sx: { mx: 0.5 } }),
6988
+ !options?.disableSelecting && !options?.hideSelectAllButton && /* @__PURE__ */ jsx26(TableCoreComponentOverlays.SelectAllButton, { rows, handleSelectAll }),
6989
+ !options?.disableSelecting && !options?.hideClearSelectionButton && /* @__PURE__ */ jsx26(TableCoreComponentOverlays.ClearSelectionButton, { rows, handleClearSelection }),
6990
+ !options?.disableSelecting && (!options?.hideSelectAllButton || !options?.hideClearSelectionButton) && /* @__PURE__ */ jsx26(Divider7, { orientation: "vertical", variant: "middle", flexItem: true, sx: { mx: 0.5 } }),
6991
+ !options?.disableSorting && !options?.hideSortDialog && /* @__PURE__ */ jsx26(
6992
+ TableCoreComponentOverlays.SortDialogButton,
6993
+ {
6994
+ columns,
6995
+ columnVisibilityModel,
6996
+ defaultSortModel,
6997
+ sortModel,
6998
+ onSortModelChange: (newModel) => {
6999
+ setSortModel(newModel);
7000
+ apiRef.current?.setSortModel(newModel);
7001
+ }
7002
+ }
7003
+ ),
7004
+ (!displayState.isMobile && !options?.disableManageColumns && !options?.hideManageColumnsButton || !options?.disableExcelExport && !options?.hideExcelExportButton) && /* @__PURE__ */ jsx26(Divider7, { orientation: "vertical", variant: "middle", flexItem: true, sx: { mx: 0.5 } }),
7005
+ !displayState.isMobile && !options?.disableManageColumns && !options?.hideManageColumnsButton && /* @__PURE__ */ jsx26(TableCoreComponentOverlays.ManageColumnsButton, {}),
7006
+ !options?.disableExcelExport && !options?.hideExcelExportButton && /* @__PURE__ */ jsx26(TableCoreComponentOverlays.ExportEntireTableButton, { excelOptions })
7007
+ ] }) });
7008
+ };
7009
+
7010
+ // src/UI/components/tables/TableComponent.tsx
7011
+ import { useTranslation as useTranslation4 } from "react-i18next";
7012
+
7013
+ // src/UI/components/tables/TableBatchActionBar.tsx
7014
+ import {
7015
+ Paper as Paper2,
7016
+ Stack as Stack3,
7017
+ Typography as Typography14,
7018
+ Button as Button9,
7019
+ IconButton as IconButton12,
7020
+ Divider as Divider8,
7021
+ Slide,
7022
+ Box as Box15,
7023
+ Chip,
7024
+ useTheme as useTheme4
7025
+ } from "@mui/material";
7026
+ import CloseIcon2 from "@mui/icons-material/Close";
7027
+ import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircle";
7028
+ import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
7029
+ function TableBatchActionBar({
7030
+ selectedRows,
7031
+ selectedIds,
7032
+ onClearSelection,
7033
+ renderBatchActions
7034
+ }) {
7035
+ const theme = useTheme4();
7036
+ const selectedCount = selectedRows.length;
7037
+ const open = selectedCount > 0;
7038
+ return /* @__PURE__ */ jsx27(Slide, { direction: "up", in: open, mountOnEnter: true, unmountOnExit: true, children: /* @__PURE__ */ jsx27(
7039
+ Paper2,
7040
+ {
7041
+ elevation: 8,
7042
+ sx: {
7043
+ position: "fixed",
7044
+ bottom: 24,
7045
+ left: "50%",
7046
+ transform: "translateX(-50%) !important",
7047
+ zIndex: theme.zIndex.drawer + 1,
7048
+ px: 2.5,
7049
+ py: 1.5,
7050
+ borderRadius: 1,
7051
+ backgroundColor: theme.palette.mode === "dark" ? "grey.900" : "grey.900",
7052
+ color: "common.white",
7053
+ boxShadow: "0px 8px 24px rgba(0, 0, 0, 0.25)"
7054
+ },
7055
+ children: /* @__PURE__ */ jsxs19(Stack3, { direction: "row", sx: { alignItems: "center" }, spacing: 2, children: [
7056
+ /* @__PURE__ */ jsxs19(Stack3, { direction: "row", sx: { alignItems: "center" }, spacing: 1, children: [
7057
+ /* @__PURE__ */ jsx27(
7058
+ Chip,
7059
+ {
7060
+ icon: /* @__PURE__ */ jsx27(CheckCircleOutlineIcon, { style: { color: "#fff" } }),
7061
+ label: selectedCount,
7062
+ color: "primary",
7063
+ size: "small",
7064
+ sx: { fontWeight: "bold" }
7065
+ }
7066
+ ),
7067
+ /* @__PURE__ */ jsx27(Typography14, { variant: "body2", sx: { fontWeight: 500, whiteSpace: "nowrap" }, children: /* @__PURE__ */ jsx27(TranslateText, { children: "Selected items" }) })
7068
+ ] }),
7069
+ /* @__PURE__ */ jsx27(Divider8, { orientation: "vertical", flexItem: true, sx: { borderColor: "rgba(255,255,255,0.2)" } }),
7070
+ /* @__PURE__ */ jsx27(Box15, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: renderBatchActions ? renderBatchActions(selectedIds, selectedRows) : null }),
7071
+ /* @__PURE__ */ jsx27(Divider8, { orientation: "vertical", flexItem: true, sx: { borderColor: "rgba(255,255,255,0.2)" } }),
7072
+ /* @__PURE__ */ jsx27(
7073
+ Button9,
7074
+ {
7075
+ size: "small",
7076
+ color: "inherit",
7077
+ onClick: onClearSelection,
7078
+ sx: {
7079
+ color: "grey.300",
7080
+ textTransform: "none",
7081
+ "&:hover": { color: "common.white" }
7082
+ },
7083
+ children: /* @__PURE__ */ jsx27(TranslateText, { children: "Reset" })
7084
+ }
7085
+ ),
7086
+ /* @__PURE__ */ jsx27(IconButton12, { size: "small", onClick: onClearSelection, sx: { color: "grey.400" }, children: /* @__PURE__ */ jsx27(CloseIcon2, { fontSize: "small" }) })
7087
+ ] })
7088
+ }
7089
+ ) });
7090
+ }
7091
+
7092
+ // src/UI/components/tables/TableFilterContainer.tsx
7093
+ import React41 from "react";
7094
+ import { FormControl as FormControl3, InputLabel as InputLabel3, Select as Select4, MenuItem as MenuItem7 } from "@mui/material";
7095
+ import SearchIcon from "@mui/icons-material/Search";
7096
+ import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
7097
+ var TableFilterContainer = ({
7098
+ namespace,
7099
+ filters
7100
+ }) => {
7101
+ if (!filters || filters.length === 0) return null;
7102
+ return /* @__PURE__ */ jsx28(FilterContainerComponent, { sx: { mb: 2 }, children: filters.map((section, sIndex) => /* @__PURE__ */ jsx28(
7103
+ FilterSection,
7104
+ {
7105
+ width: section.width ?? "100%",
7106
+ itemWidth: section.itemWidth ?? "100%",
7107
+ children: section.items.map((item) => {
7108
+ if (item.type === "search") {
7109
+ return /* @__PURE__ */ jsx28(
7110
+ SearchComponent,
7111
+ {
7112
+ fullWidth: true,
7113
+ size: "small",
7114
+ placeholderKey: item.placeholderKey || "Search",
7115
+ value: item.value,
7116
+ onChange: (e) => item.onChange(e.target.value),
7117
+ onClear: () => item.onChange(""),
7118
+ slotProps: {
7119
+ input: {
7120
+ startAdornment: /* @__PURE__ */ jsx28(SearchIcon, { color: "action", sx: { mr: 1 } })
7121
+ }
7122
+ }
7123
+ },
7124
+ item.id
7125
+ );
7126
+ }
7127
+ if (item.type === "select") {
7128
+ return /* @__PURE__ */ jsxs20(FormControl3, { fullWidth: true, size: "small", children: [
7129
+ item.label && /* @__PURE__ */ jsx28(InputLabel3, { children: item.label }),
7130
+ /* @__PURE__ */ jsx28(
7131
+ Select4,
7132
+ {
7133
+ value: item.value,
7134
+ label: item.label,
7135
+ onChange: (e) => item.onChange(e.target.value),
7136
+ children: item.options?.map((opt, oIndex) => /* @__PURE__ */ jsx28(MenuItem7, { value: opt.value, children: typeof opt.label === "string" ? /* @__PURE__ */ jsx28(TranslateText, { children: opt.label }) : opt.label }, oIndex))
7137
+ }
7138
+ )
7139
+ ] }, item.id);
7140
+ }
7141
+ if (item.type === "custom" && item.renderCustom) {
7142
+ return /* @__PURE__ */ jsx28(React41.Fragment, { children: item.renderCustom() }, item.id);
7143
+ }
7144
+ return null;
7145
+ })
7146
+ },
7147
+ sIndex
7148
+ )) });
7149
+ };
7150
+
7151
+ // src/UI/components/tables/tableSettings.utils.ts
7152
+ function mergeTableSettings(saved, currentColumns, defaultSortModel = []) {
7153
+ const currentFields = new Set(currentColumns.map((c) => c.field));
7154
+ const visibility = {};
7155
+ currentColumns.forEach((col) => {
7156
+ if (saved?.columnVisibility && col.field in saved.columnVisibility) {
7157
+ visibility[col.field] = saved.columnVisibility[col.field];
7158
+ } else {
7159
+ visibility[col.field] = !col.defaultHidden;
7160
+ }
7161
+ });
7162
+ let sortModel = defaultSortModel;
7163
+ if (saved?.sortModel && saved.sortModel.length > 0) {
7164
+ const validSort = saved.sortModel.filter((s) => {
7165
+ const col = currentColumns.find((c) => c.field === s.field);
7166
+ return col && col.sortable !== false;
7167
+ });
7168
+ if (validSort.length > 0) {
7169
+ sortModel = validSort;
7170
+ }
7171
+ }
7172
+ const alignments = {};
7173
+ if (saved?.columnAlignments) {
7174
+ Object.keys(saved.columnAlignments).forEach((field) => {
7175
+ if (currentFields.has(field)) {
7176
+ alignments[field] = saved.columnAlignments[field];
7177
+ }
7178
+ });
7179
+ }
7180
+ let columnOrder = [];
7181
+ if (saved?.columnOrder && Array.isArray(saved.columnOrder)) {
7182
+ columnOrder = saved.columnOrder.filter((field) => currentFields.has(field));
7183
+ currentColumns.forEach((col) => {
7184
+ if (!columnOrder.includes(col.field)) {
7185
+ columnOrder.push(col.field);
7186
+ }
7187
+ });
7188
+ }
7189
+ const widths = {};
7190
+ if (saved?.columnWidths) {
7191
+ Object.keys(saved.columnWidths).forEach((field) => {
7192
+ if (currentFields.has(field) && typeof saved.columnWidths[field] === "number") {
7193
+ widths[field] = saved.columnWidths[field];
7194
+ }
7195
+ });
7196
+ }
7197
+ const pageSize = typeof saved?.pageSize === "number" ? saved.pageSize : void 0;
7198
+ return { visibility, sortModel, alignments, columnOrder, columnWidths: widths, pageSize };
7199
+ }
7200
+
3444
7201
  // src/hooks/useUserStatus.ts
3445
- import { useEffect as useEffect8, useRef as useRef2, useState as useState16 } from "react";
7202
+ import { useEffect as useEffect13, useRef as useRef8, useState as useState21 } from "react";
3446
7203
  var ONLINE_THRESHOLD_MINUTES = 2;
3447
7204
  var AWAY_THRESHOLD_MINUTES = 15;
3448
7205
  var useUserStatus = (userId, initialLastSeenAt, currentAuthUserId) => {
3449
7206
  const supabase = useSupabase();
3450
- const [status, setStatus] = useState16("offline");
3451
- const [lastSeen, setLastSeen] = useState16(initialLastSeenAt ?? null);
3452
- const lastSeenRef = useRef2(initialLastSeenAt ?? null);
7207
+ const [status, setStatus] = useState21("offline");
7208
+ const [lastSeen, setLastSeen] = useState21(initialLastSeenAt ?? null);
7209
+ const lastSeenRef = useRef8(initialLastSeenAt ?? null);
3453
7210
  lastSeenRef.current = lastSeen;
3454
7211
  const calculateStatus = (isOnline, lastSeenIso) => {
3455
7212
  if (isOnline) return "online";
@@ -3465,7 +7222,7 @@ var useUserStatus = (userId, initialLastSeenAt, currentAuthUserId) => {
3465
7222
  }
3466
7223
  return "offline";
3467
7224
  };
3468
- useEffect8(() => {
7225
+ useEffect13(() => {
3469
7226
  if (!userId) return;
3470
7227
  let isMounted = true;
3471
7228
  const isSelf = currentAuthUserId && userId === currentAuthUserId;
@@ -3536,6 +7293,841 @@ var Hooks = {
3536
7293
  useUserStatus
3537
7294
  };
3538
7295
 
7296
+ // src/UI/components/tables/TableComponent.tsx
7297
+ import { Fragment as Fragment19, jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
7298
+ function ActionsCell({
7299
+ row,
7300
+ rowActions
7301
+ }) {
7302
+ const [anchorEl, setAnchorEl] = useState22(null);
7303
+ const open = Boolean(anchorEl);
7304
+ const items = typeof rowActions === "function" ? rowActions(row) : rowActions || [];
7305
+ if (!items.length) return null;
7306
+ return /* @__PURE__ */ jsxs21(Fragment19, { children: [
7307
+ /* @__PURE__ */ jsx29(
7308
+ IconButton13,
7309
+ {
7310
+ size: "small",
7311
+ onClick: (e) => {
7312
+ e.stopPropagation();
7313
+ setAnchorEl(e.currentTarget);
7314
+ },
7315
+ children: /* @__PURE__ */ jsx29(MoreVertIcon2, { fontSize: "small" })
7316
+ }
7317
+ ),
7318
+ /* @__PURE__ */ jsx29(
7319
+ Menu4,
7320
+ {
7321
+ anchorEl,
7322
+ open,
7323
+ onClose: () => setAnchorEl(null),
7324
+ onClick: (e) => e.stopPropagation(),
7325
+ children: items.filter((f) => !f.hidden).map((item, index) => /* @__PURE__ */ jsxs21(React42.Fragment, { children: [
7326
+ /* @__PURE__ */ jsxs21(
7327
+ MenuItem8,
7328
+ {
7329
+ disabled: item.disabled,
7330
+ onClick: () => {
7331
+ setAnchorEl(null);
7332
+ item.onClick(row);
7333
+ },
7334
+ children: [
7335
+ item.icon && /* @__PURE__ */ jsx29(ListItemIcon5, { children: item.icon }),
7336
+ /* @__PURE__ */ jsx29(ListItemText6, { color: item.color, children: item.label })
7337
+ ]
7338
+ }
7339
+ ),
7340
+ item.divider && /* @__PURE__ */ jsx29(Divider9, { sx: { my: 0.5 } })
7341
+ ] }, index))
7342
+ }
7343
+ )
7344
+ ] });
7345
+ }
7346
+ var CustomNoRowsOverlay = memo(({ namespace, noRowsText, ...props }) => /* @__PURE__ */ jsx29(GridOverlay, { ...props, children: /* @__PURE__ */ jsx29(Box16, { sx: { textAlign: "center" }, children: /* @__PURE__ */ jsx29(Typography15, { variant: "body2", sx: { mt: 1 }, children: /* @__PURE__ */ jsx29(TranslateText, { children: noRowsText || "No rows" }) }) }) }));
7347
+ function TableComponentInner(props, ref) {
7348
+ const {
7349
+ id,
7350
+ schemaVersion = 1,
7351
+ namespace,
7352
+ filters,
7353
+ options,
7354
+ columns,
7355
+ fetchData,
7356
+ getRowId,
7357
+ initialPageSize = 10,
7358
+ pageSizeOptions = [5, 10, 25, 50],
7359
+ defaultSortModel = [],
7360
+ rowActions,
7361
+ renderBatchActions,
7362
+ renderMobileCard,
7363
+ onRefresh,
7364
+ height,
7365
+ // = 550,
7366
+ rowHeight = 65,
7367
+ dialogs,
7368
+ onLoadingChange,
7369
+ onAllSelected,
7370
+ onSelectingChange,
7371
+ disableSaveSettings
7372
+ } = props;
7373
+ const supabase = useSupabase();
7374
+ const isInitialRender = useRef9(true);
7375
+ const storageKey = `dictionary_table_${id}`;
7376
+ const apiRef = useGridApiRef();
7377
+ const timerRef = useRef9(null);
7378
+ const LONG_PRESS_THRESHOLD = 500;
7379
+ const { displayState } = useAppTheme();
7380
+ const { t } = useTranslation4([namespace]);
7381
+ const [isSettingsLoaded, setIsSettingsLoaded] = useState22(() => disableSaveSettings);
7382
+ const [rows, setRows] = useState22([]);
7383
+ const [totalRows, setTotalRows] = useState22(0);
7384
+ const [loading, setLoading] = useState22(false);
7385
+ const [showMobileFilters, setShowMobileFilters] = useState22(false);
7386
+ const [columnWidths, setColumnWidths] = useState22(() => {
7387
+ if (disableSaveSettings) return {};
7388
+ try {
7389
+ const local = localStorage.getItem(storageKey);
7390
+ if (local) {
7391
+ const parsed = JSON.parse(local);
7392
+ return mergeTableSettings(parsed, columns, defaultSortModel).columnWidths || {};
7393
+ }
7394
+ } catch (e) {
7395
+ }
7396
+ return {};
7397
+ });
7398
+ const [columnOrder, setColumnOrder] = useState22(() => {
7399
+ if (disableSaveSettings) return [];
7400
+ try {
7401
+ const local = localStorage.getItem(storageKey);
7402
+ if (local) {
7403
+ const parsed = JSON.parse(local);
7404
+ return mergeTableSettings(parsed, columns, defaultSortModel).columnOrder || [];
7405
+ }
7406
+ } catch (e) {
7407
+ }
7408
+ return [];
7409
+ });
7410
+ const handleSetColumnAlign = useCallback11((field, align) => {
7411
+ setColumnAlignments((prev) => ({
7412
+ ...prev,
7413
+ [field]: align
7414
+ }));
7415
+ }, []);
7416
+ const [paginationModel, setPaginationModel] = useState22(() => {
7417
+ let initialSize = initialPageSize;
7418
+ if (!disableSaveSettings) {
7419
+ try {
7420
+ const local = localStorage.getItem(storageKey);
7421
+ if (local) {
7422
+ const parsed = JSON.parse(local);
7423
+ const merged = mergeTableSettings(parsed, columns, defaultSortModel);
7424
+ if (merged.pageSize) {
7425
+ initialSize = merged.pageSize;
7426
+ }
7427
+ }
7428
+ } catch (e) {
7429
+ console.error("Error reading localStorage for pageSize:", e);
7430
+ }
7431
+ }
7432
+ return { page: 0, pageSize: initialSize };
7433
+ });
7434
+ const [rowSelectionModel, setRowSelectionModel] = useState22({
7435
+ type: "include",
7436
+ ids: /* @__PURE__ */ new Set()
7437
+ });
7438
+ const [refreshIndex, setRefreshIndex] = useState22(0);
7439
+ const [isMobileSortOpen, setIsMobileSortOpen] = useState22(false);
7440
+ const initialColumnVisibilityModel = useMemo9(() => {
7441
+ const visibilityMap = {};
7442
+ columns.forEach((col) => {
7443
+ if (col.defaultHidden) {
7444
+ visibilityMap[col.field] = false;
7445
+ }
7446
+ });
7447
+ return visibilityMap;
7448
+ }, [columns]);
7449
+ const [columnVisibilityModel, setColumnVisibilityModel] = useState22(() => {
7450
+ if (disableSaveSettings) return initialColumnVisibilityModel;
7451
+ try {
7452
+ const local = localStorage.getItem(storageKey);
7453
+ if (local) {
7454
+ const parsed = JSON.parse(local);
7455
+ return mergeTableSettings(parsed, columns, defaultSortModel).visibility;
7456
+ }
7457
+ } catch (e) {
7458
+ console.error("Error reading localStorage:", e);
7459
+ }
7460
+ return initialColumnVisibilityModel;
7461
+ });
7462
+ const [sortModel, setSortModel] = useState22(() => {
7463
+ if (disableSaveSettings) return defaultSortModel;
7464
+ try {
7465
+ const local = localStorage.getItem(storageKey);
7466
+ if (local) {
7467
+ const parsed = JSON.parse(local);
7468
+ return mergeTableSettings(parsed, columns, defaultSortModel).sortModel;
7469
+ }
7470
+ } catch (e) {
7471
+ }
7472
+ return defaultSortModel;
7473
+ });
7474
+ const [columnAlignments, setColumnAlignments] = useState22(() => {
7475
+ if (disableSaveSettings) return {};
7476
+ try {
7477
+ const local = localStorage.getItem(storageKey);
7478
+ if (local) {
7479
+ const parsed = JSON.parse(local);
7480
+ return mergeTableSettings(parsed, columns, defaultSortModel).alignments;
7481
+ }
7482
+ } catch (e) {
7483
+ }
7484
+ return {};
7485
+ });
7486
+ const columnsRef = useRef9(columns);
7487
+ useEffect14(() => {
7488
+ columnsRef.current = columns;
7489
+ }, [columns]);
7490
+ const defaultSortModelRef = useRef9(defaultSortModel);
7491
+ useEffect14(() => {
7492
+ defaultSortModelRef.current = defaultSortModel;
7493
+ }, [defaultSortModel]);
7494
+ useEffect14(() => {
7495
+ if (disableSaveSettings) {
7496
+ setIsSettingsLoaded(true);
7497
+ return;
7498
+ }
7499
+ let isMounted = true;
7500
+ async function loadServerSettings() {
7501
+ try {
7502
+ const { data: { user } } = await supabase.auth.getUser();
7503
+ if (!user) {
7504
+ if (isMounted) setIsSettingsLoaded(true);
7505
+ return;
7506
+ }
7507
+ const { data, error } = await supabase.from("user_table_settings").select("settings").eq("table_id", id).maybeSingle();
7508
+ if (error || !data?.settings) {
7509
+ if (isMounted) setIsSettingsLoaded(true);
7510
+ return;
7511
+ }
7512
+ const serverSettings = data.settings;
7513
+ const merged = mergeTableSettings(
7514
+ serverSettings,
7515
+ columnsRef.current,
7516
+ defaultSortModelRef.current
7517
+ );
7518
+ if (isMounted) {
7519
+ if (merged.visibility) {
7520
+ setColumnVisibilityModel(
7521
+ (prev) => JSON.stringify(prev) !== JSON.stringify(merged.visibility) ? merged.visibility : prev
7522
+ );
7523
+ }
7524
+ if (merged.sortModel) {
7525
+ setSortModel(
7526
+ (prev) => JSON.stringify(prev) !== JSON.stringify(merged.sortModel) ? merged.sortModel : prev
7527
+ );
7528
+ }
7529
+ if (merged.alignments) {
7530
+ setColumnAlignments(
7531
+ (prev) => JSON.stringify(prev) !== JSON.stringify(merged.alignments) ? merged.alignments : prev
7532
+ );
7533
+ }
7534
+ if (merged.columnOrder?.length) {
7535
+ setColumnOrder(
7536
+ (prev) => JSON.stringify(prev) !== JSON.stringify(merged.columnOrder) ? merged.columnOrder : prev
7537
+ );
7538
+ }
7539
+ if (merged.columnWidths) {
7540
+ setColumnWidths(
7541
+ (prev) => JSON.stringify(prev) !== JSON.stringify(merged.columnWidths) ? merged.columnWidths : prev
7542
+ );
7543
+ }
7544
+ if (merged.pageSize) {
7545
+ const newPageSize = merged.pageSize;
7546
+ setPaginationModel(
7547
+ (prev) => prev.pageSize !== newPageSize ? { ...prev, pageSize: newPageSize } : prev
7548
+ );
7549
+ }
7550
+ localStorage.setItem(storageKey, JSON.stringify({
7551
+ version: schemaVersion,
7552
+ columnVisibility: merged.visibility,
7553
+ sortModel: merged.sortModel,
7554
+ columnAlignments: merged.alignments,
7555
+ pageSize: merged.pageSize || paginationModel.pageSize
7556
+ }));
7557
+ }
7558
+ } catch (err) {
7559
+ console.error("Failed to sync settings from server:", err);
7560
+ } finally {
7561
+ if (isMounted) {
7562
+ setIsSettingsLoaded(true);
7563
+ }
7564
+ }
7565
+ }
7566
+ loadServerSettings();
7567
+ return () => {
7568
+ isMounted = false;
7569
+ };
7570
+ }, [id, schemaVersion, disableSaveSettings, storageKey]);
7571
+ const serializedSettings = useMemo9(() => JSON.stringify({
7572
+ version: schemaVersion,
7573
+ columnVisibility: columnVisibilityModel,
7574
+ sortModel,
7575
+ columnAlignments,
7576
+ columnWidths,
7577
+ columnOrder,
7578
+ pageSize: paginationModel.pageSize
7579
+ }), [schemaVersion, columnVisibilityModel, sortModel, columnAlignments, columnWidths, columnOrder, paginationModel.pageSize]);
7580
+ const [debouncedSerializedSettings] = Hooks.useDebounce(serializedSettings, 1e3);
7581
+ useEffect14(() => {
7582
+ if (!disableSaveSettings) {
7583
+ localStorage.setItem(storageKey, serializedSettings);
7584
+ }
7585
+ }, [serializedSettings, storageKey, disableSaveSettings]);
7586
+ useEffect14(() => {
7587
+ if (disableSaveSettings) return;
7588
+ if (isInitialRender.current) {
7589
+ isInitialRender.current = false;
7590
+ return;
7591
+ }
7592
+ async function saveToServer() {
7593
+ try {
7594
+ const { data: { user } } = await supabase.auth.getUser();
7595
+ if (!user) return;
7596
+ const settingsObj = JSON.parse(debouncedSerializedSettings);
7597
+ await supabase.from("user_table_settings").upsert({
7598
+ user_id: user.id,
7599
+ table_id: id,
7600
+ settings: settingsObj
7601
+ }, { onConflict: "user_id,table_id" });
7602
+ } catch (err) {
7603
+ console.error("Failed to save table settings to server:", err);
7604
+ }
7605
+ }
7606
+ saveToServer();
7607
+ }, [debouncedSerializedSettings, id, disableSaveSettings]);
7608
+ const refresh = useCallback11(() => {
7609
+ setPaginationModel((prev) => ({
7610
+ ...prev,
7611
+ page: 0
7612
+ }));
7613
+ setRefreshIndex((prev) => prev + 1);
7614
+ }, []);
7615
+ const onLoadingChangeRef = useRef9(onLoadingChange);
7616
+ useEffect14(() => {
7617
+ onLoadingChangeRef.current = onLoadingChange;
7618
+ }, [onLoadingChange]);
7619
+ const fetchDataRef = useRef9(fetchData);
7620
+ useEffect14(() => {
7621
+ fetchDataRef.current = fetchData;
7622
+ }, [fetchData]);
7623
+ useEffect14(() => {
7624
+ if (!isSettingsLoaded) return;
7625
+ let isCancelled = false;
7626
+ const runFetch = async () => {
7627
+ setLoading(true);
7628
+ queueMicrotask(() => {
7629
+ onLoadingChangeRef.current?.(true);
7630
+ });
7631
+ try {
7632
+ const params = {
7633
+ page: paginationModel.page,
7634
+ pageSize: paginationModel.pageSize,
7635
+ sortModel
7636
+ };
7637
+ const response = await fetchDataRef.current(params);
7638
+ if (!isCancelled) {
7639
+ setRows(response.data);
7640
+ setTotalRows(response.totalRows);
7641
+ }
7642
+ } catch (error) {
7643
+ console.error("Failed to load table data:", error);
7644
+ } finally {
7645
+ if (!isCancelled) {
7646
+ setLoading(false);
7647
+ queueMicrotask(() => {
7648
+ onLoadingChangeRef.current?.(false);
7649
+ });
7650
+ }
7651
+ }
7652
+ };
7653
+ runFetch();
7654
+ return () => {
7655
+ isCancelled = true;
7656
+ };
7657
+ }, [paginationModel, sortModel, refreshIndex, isSettingsLoaded]);
7658
+ const handleRefresh = useCallback11(() => {
7659
+ setRowSelectionModel({
7660
+ type: "include",
7661
+ ids: /* @__PURE__ */ new Set()
7662
+ });
7663
+ apiRef.current?.setRowSelectionModel({
7664
+ type: "include",
7665
+ ids: /* @__PURE__ */ new Set()
7666
+ });
7667
+ setPaginationModel((prev) => ({
7668
+ ...prev,
7669
+ page: 0
7670
+ }));
7671
+ refresh();
7672
+ if (onRefresh) onRefresh();
7673
+ }, [refresh, onRefresh, apiRef]);
7674
+ const handleSelectRowOnMobile = (rowId) => {
7675
+ const getSelected = () => {
7676
+ const newIds = new Set(rowSelectionModel.ids);
7677
+ if (newIds.has(rowId)) {
7678
+ newIds.delete(rowId);
7679
+ } else {
7680
+ newIds.add(rowId);
7681
+ }
7682
+ return {
7683
+ ids: newIds
7684
+ };
7685
+ };
7686
+ const ids = getSelected().ids;
7687
+ apiRef.current?.setRowSelectionModel({ type: "include", ids });
7688
+ };
7689
+ const handleLongTouchStart = (rowId) => {
7690
+ timerRef.current = setTimeout(() => {
7691
+ handleSelectRowOnMobile(rowId);
7692
+ if (window.navigator.vibrate) window.navigator.vibrate(50);
7693
+ }, LONG_PRESS_THRESHOLD);
7694
+ };
7695
+ const extractStringFromReactNode = (node) => {
7696
+ if (typeof node === "string") return node;
7697
+ if (typeof node === "number") return String(node);
7698
+ if (isValidElement(node)) {
7699
+ const children = node.props.children;
7700
+ if (typeof children === "string") return children;
7701
+ if (Array.isArray(children)) {
7702
+ return children.map(extractStringFromReactNode).join("");
7703
+ }
7704
+ }
7705
+ return "";
7706
+ };
7707
+ const gridColumns = useMemo9(() => {
7708
+ const formattedCols = columns.map((col) => {
7709
+ const stringHeader = extractStringFromReactNode(col.headerName);
7710
+ const currentAlign = columnAlignments[col.field] || col.align || "left";
7711
+ const currentHeaderAlign = col.headerAlign || currentAlign;
7712
+ const currentWidth = columnWidths[col.field] ?? col.width;
7713
+ const colDef = {
7714
+ field: col.field,
7715
+ headerName: t(stringHeader) || col.field,
7716
+ align: currentAlign,
7717
+ headerAlign: currentHeaderAlign,
7718
+ width: currentWidth,
7719
+ flex: currentWidth !== void 0 ? void 0 : col.flex ?? 1,
7720
+ sortable: col.sortable ?? true,
7721
+ filterable: col.filterable ?? true,
7722
+ resizable: col.resizable,
7723
+ // 👈 Пробрасываем resizable
7724
+ disableReorder: col.disableReorder,
7725
+ // 👈 Пробрасываем reorderable
7726
+ hideable: col.hideable,
7727
+ // 👈 Пробрасываем hideable
7728
+ disableExport: col.exportable === false,
7729
+ // 👈 Передаем флаг запрета экспорта в MUI DataGrid
7730
+ valueGetter: col.valueGetter,
7731
+ sortComparator: col.sortComparator,
7732
+ renderCell: col.renderField ? (params) => col.renderField(params.row, params.value) : void 0
7733
+ };
7734
+ if (col.renderHeader) {
7735
+ colDef.renderHeader = col.renderHeader;
7736
+ } else if (isValidElement(col.headerName)) {
7737
+ colDef.renderHeader = () => col.headerName;
7738
+ }
7739
+ return colDef;
7740
+ });
7741
+ if (rowActions) {
7742
+ formattedCols.push({
7743
+ field: "__actions__",
7744
+ headerName: t("Actions"),
7745
+ renderHeader: () => /* @__PURE__ */ jsx29(Typography15, { variant: "subtitle2", sx: { fontWeight: 500, width: "100%", textAlign: "center" }, children: /* @__PURE__ */ jsx29(TranslateText, { children: "Actions" }) }),
7746
+ width: 80,
7747
+ align: "center",
7748
+ headerAlign: "center",
7749
+ sortable: false,
7750
+ disableReorder: true,
7751
+ // 👈 Запрет перетаскивания колонки
7752
+ resizable: false,
7753
+ // Запрет изменение размера
7754
+ hideable: false,
7755
+ // Запрет скрытия
7756
+ filterable: false,
7757
+ disableExport: true,
7758
+ renderCell: (params) => /* @__PURE__ */ jsx29(ActionsCell, { row: params.row, rowActions })
7759
+ });
7760
+ }
7761
+ if (columnOrder && columnOrder.length > 0) {
7762
+ const orderMap = new Map(columnOrder.map((field, idx) => [field, idx]));
7763
+ formattedCols.sort((a, b) => {
7764
+ const indexA = orderMap.has(a.field) ? orderMap.get(a.field) : Infinity;
7765
+ const indexB = orderMap.has(b.field) ? orderMap.get(b.field) : Infinity;
7766
+ return indexA - indexB;
7767
+ });
7768
+ }
7769
+ return formattedCols;
7770
+ }, [columns, rowActions, columnAlignments, columnWidths, t]);
7771
+ const selectedRows = useMemo9(() => {
7772
+ if (!rowSelectionModel?.ids) return [];
7773
+ return rows.filter((r2) => rowSelectionModel.ids.has(r2.id));
7774
+ }, [rows, rowSelectionModel]);
7775
+ const handleSelectAll = useCallback11(() => {
7776
+ const allRowIds = new Set(rows.map((row) => row.id));
7777
+ const newSelection = {
7778
+ type: "include",
7779
+ ids: allRowIds
7780
+ };
7781
+ setRowSelectionModel(newSelection);
7782
+ apiRef.current?.setRowSelectionModel(newSelection);
7783
+ if (onAllSelected) onAllSelected(true);
7784
+ }, [rows, apiRef]);
7785
+ const handleClearSelection = useCallback11(() => {
7786
+ const emptySelection = {
7787
+ type: "include",
7788
+ ids: /* @__PURE__ */ new Set()
7789
+ };
7790
+ setRowSelectionModel(emptySelection);
7791
+ apiRef.current?.setRowSelectionModel(emptySelection);
7792
+ if (onAllSelected) onAllSelected(false);
7793
+ }, [apiRef]);
7794
+ const handleRowSelectionModelChange = useCallback11((newSelectionModel) => {
7795
+ setRowSelectionModel(newSelectionModel);
7796
+ if (onSelectingChange) {
7797
+ onSelectingChange(getSelectedRowIds(newSelectionModel));
7798
+ }
7799
+ }, [onSelectingChange]);
7800
+ const pinnedColumns = useMemo9(() => {
7801
+ const leftPinned = columns.filter((col) => col.pinned === "left").map((col) => col.field);
7802
+ const rightPinned = columns.filter((col) => col.pinned === "right").map((col) => col.field);
7803
+ if (rowActions && !rightPinned.includes("__actions__")) {
7804
+ rightPinned.push("__actions__");
7805
+ }
7806
+ return {
7807
+ left: leftPinned,
7808
+ right: rightPinned
7809
+ };
7810
+ }, [columns, rowActions]);
7811
+ const handleResetToDefaultSettings = useCallback11(async () => {
7812
+ if (!disableSaveSettings) {
7813
+ localStorage.removeItem(storageKey);
7814
+ }
7815
+ setColumnVisibilityModel(initialColumnVisibilityModel);
7816
+ setSortModel(defaultSortModel);
7817
+ setColumnAlignments({});
7818
+ setColumnWidths({});
7819
+ setColumnOrder([]);
7820
+ setPaginationModel((prev) => ({
7821
+ ...prev,
7822
+ pageSize: initialPageSize
7823
+ }));
7824
+ if (!disableSaveSettings) {
7825
+ try {
7826
+ const { data: { user } } = await supabase.auth.getUser();
7827
+ if (user) {
7828
+ await supabase.from("user_table_settings").delete().eq("user_id", user.id).eq("table_id", id);
7829
+ }
7830
+ } catch (err) {
7831
+ console.error("Failed to delete settings from server:", err);
7832
+ }
7833
+ }
7834
+ refresh();
7835
+ }, [
7836
+ disableSaveSettings,
7837
+ storageKey,
7838
+ initialColumnVisibilityModel,
7839
+ defaultSortModel,
7840
+ initialPageSize,
7841
+ id,
7842
+ refresh
7843
+ ]);
7844
+ const handleColumnMenu = useCallback11(
7845
+ (props2) => TableCustomColumnMenu(props2, handleSetColumnAlign, handleResetToDefaultSettings),
7846
+ [handleSetColumnAlign, handleResetToDefaultSettings]
7847
+ );
7848
+ const handleSortModelChange = useCallback11((newModel) => {
7849
+ Promise.resolve().then(() => {
7850
+ setSortModel(newModel);
7851
+ });
7852
+ }, []);
7853
+ function getSelectedRowIds(selectionModel) {
7854
+ if (!selectionModel) return [];
7855
+ if (Array.isArray(selectionModel)) {
7856
+ return selectionModel.map(String);
7857
+ }
7858
+ if (typeof selectionModel === "object" && "ids" in selectionModel) {
7859
+ const rawIds = selectionModel.ids;
7860
+ if (rawIds instanceof Set) {
7861
+ return Array.from(rawIds).map(String);
7862
+ }
7863
+ if (Array.isArray(rawIds)) {
7864
+ return rawIds.map(String);
7865
+ }
7866
+ if (rawIds instanceof Map) {
7867
+ return Array.from(rawIds.keys()).map(String);
7868
+ }
7869
+ if (rawIds && typeof rawIds[Symbol.iterator] === "function") {
7870
+ return Array.from(rawIds).map(String);
7871
+ }
7872
+ }
7873
+ return [];
7874
+ }
7875
+ const exportToExcel = useCallback11(
7876
+ (customOptions) => {
7877
+ if (!apiRef.current || !apiRef.current.exportDataAsExcel) {
7878
+ console.warn("DataGrid apiRef is not fully initialized yet");
7879
+ return;
7880
+ }
7881
+ const defaultExcelOptions = options?.excelOptions;
7882
+ const shouldExportAllColumns = customOptions?.allColumns ?? defaultExcelOptions?.allColumns ?? true;
7883
+ const exportableFields = gridColumns.filter((col) => col.field !== "__actions__").filter((col) => col.disableExport === false).map((col) => col.field);
7884
+ apiRef.current.exportDataAsExcel({
7885
+ fileName: customOptions?.fileName || defaultExcelOptions?.fileName || "excel-export",
7886
+ allColumns: shouldExportAllColumns,
7887
+ includeHeaders: customOptions?.includeHeaders ?? defaultExcelOptions?.includeHeaders ?? true,
7888
+ fields: exportableFields
7889
+ // 👈 Передаем полный список полей
7890
+ });
7891
+ },
7892
+ [apiRef, options?.excelOptions, gridColumns]
7893
+ );
7894
+ useImperativeHandle(ref, () => ({
7895
+ refresh,
7896
+ handleSelectAll,
7897
+ handleClearSelection,
7898
+ resetToDefaultSettings: handleResetToDefaultSettings,
7899
+ selectedIds: getSelectedRowIds(rowSelectionModel),
7900
+ exportToExcel,
7901
+ loading
7902
+ }));
7903
+ if (displayState.isMobile && renderMobileCard) {
7904
+ return /* @__PURE__ */ jsxs21(Stack4, { spacing: 2, children: [
7905
+ /* @__PURE__ */ jsxs21(Paper3, { sx: { p: 1.5, display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
7906
+ /* @__PURE__ */ jsxs21(Typography15, { variant: "subtitle2", children: [
7907
+ /* @__PURE__ */ jsx29(TranslateText, { children: "Total" }),
7908
+ ": ",
7909
+ totalRows
7910
+ ] }),
7911
+ /* @__PURE__ */ jsxs21(Box16, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: [
7912
+ !options?.disableSorting && !options?.hideSortDialog && /* @__PURE__ */ jsx29(
7913
+ IconButton13,
7914
+ {
7915
+ onClick: () => setIsMobileSortOpen(true),
7916
+ color: sortModel.length > 0 ? "primary" : "default",
7917
+ size: "small",
7918
+ children: /* @__PURE__ */ jsx29(SortByAlphaIcon, { fontSize: "small" })
7919
+ }
7920
+ ),
7921
+ filters && filters.length > 0 && /* @__PURE__ */ jsx29(
7922
+ IconButton13,
7923
+ {
7924
+ onClick: () => setShowMobileFilters((prev) => !prev),
7925
+ color: showMobileFilters ? "primary" : "default",
7926
+ size: "small",
7927
+ children: /* @__PURE__ */ jsx29(FilterListIcon, { fontSize: "small" })
7928
+ }
7929
+ ),
7930
+ /* @__PURE__ */ jsx29(IconButton13, { onClick: handleRefresh, color: "primary", size: "small", children: /* @__PURE__ */ jsx29(RefreshIcon2, { fontSize: "small" }) })
7931
+ ] })
7932
+ ] }),
7933
+ filters && filters.length > 0 && /* @__PURE__ */ jsx29(Collapse2, { in: showMobileFilters, unmountOnExit: true, children: /* @__PURE__ */ jsx29(Box16, { sx: { mb: 1 }, children: /* @__PURE__ */ jsx29(TableFilterContainer, { namespace, filters }) }) }),
7934
+ loading ? /* @__PURE__ */ jsxs21(Typography15, { sx: { p: 2, textAlign: "center" }, children: [
7935
+ /* @__PURE__ */ jsx29(TranslateText, { children: "Loading" }),
7936
+ "..."
7937
+ ] }) : rows.map((row) => /* @__PURE__ */ jsxs21(Paper3, { variant: "outlined", sx: { p: 2, position: "relative" }, children: [
7938
+ renderMobileCard(row),
7939
+ rowActions && /* @__PURE__ */ jsx29(Box16, { sx: { position: "absolute", top: 8, right: 8 }, children: /* @__PURE__ */ jsx29(ActionsCell, { row, rowActions }) })
7940
+ ] }, row.id)),
7941
+ !loading && totalRows > 0 && /* @__PURE__ */ jsx29(Paper3, { variant: "outlined", sx: { p: 1, display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsx29(
7942
+ TablePaginationComponent,
7943
+ {
7944
+ count: totalRows,
7945
+ page: paginationModel.page,
7946
+ rowsPerPage: paginationModel.pageSize,
7947
+ rowsPerPageOptions: pageSizeOptions,
7948
+ onPageChange: (_, newPage) => {
7949
+ setPaginationModel((prev) => ({ ...prev, page: newPage }));
7950
+ },
7951
+ onRowsPerPageChange: (event) => {
7952
+ const newSize = parseInt(event.target.value, 10);
7953
+ setPaginationModel({ page: 0, pageSize: newSize });
7954
+ }
7955
+ }
7956
+ ) }),
7957
+ !options?.disableSorting && !options?.hideSortDialog && /* @__PURE__ */ jsx29(
7958
+ TableCoreComponentOverlays.SortDialog,
7959
+ {
7960
+ open: isMobileSortOpen,
7961
+ onClose: () => setIsMobileSortOpen(false),
7962
+ columns: gridColumns,
7963
+ defaultSortModel,
7964
+ sortModel,
7965
+ onSortModelChange: (newModel) => {
7966
+ handleSortModelChange(newModel);
7967
+ }
7968
+ }
7969
+ ),
7970
+ dialogs
7971
+ ] });
7972
+ }
7973
+ return /* @__PURE__ */ jsxs21(Box16, { sx: { height, width: "100%" }, children: [
7974
+ filters && filters.length > 0 && /* @__PURE__ */ jsx29(TableFilterContainer, { namespace, filters }),
7975
+ /* @__PURE__ */ jsx29(
7976
+ DataGridPremium,
7977
+ {
7978
+ apiRef,
7979
+ rows,
7980
+ columns: gridColumns,
7981
+ columnVisibilityModel,
7982
+ onColumnVisibilityModelChange: (newModel) => setColumnVisibilityModel(newModel),
7983
+ rowCount: totalRows,
7984
+ loading,
7985
+ pinnedColumns,
7986
+ getRowId,
7987
+ disableColumnFilter: true,
7988
+ disableColumnReorder: options?.disableManageColumns,
7989
+ disableColumnResize: options?.disableManageColumns,
7990
+ disableColumnSelector: options?.disableManageColumns,
7991
+ showToolbar: !options?.hideToolbar,
7992
+ pagination: true,
7993
+ paginationMode: "server",
7994
+ paginationModel,
7995
+ onPaginationModelChange: setPaginationModel,
7996
+ pageSizeOptions,
7997
+ disableColumnSorting: options?.disableSorting,
7998
+ sortingMode: "server",
7999
+ sortModel,
8000
+ onSortModelChange: handleSortModelChange,
8001
+ checkboxSelection: options?.checkboxSelection && !options?.disableSelecting,
8002
+ checkboxSelectionVisibleOnly: true,
8003
+ rowSelectionModel,
8004
+ onRowSelectionModelChange: handleRowSelectionModelChange,
8005
+ disableRowSelectionOnClick: true,
8006
+ onColumnWidthChange: (params) => {
8007
+ setColumnWidths((prev) => ({
8008
+ ...prev,
8009
+ [params.colDef.field]: params.width
8010
+ }));
8011
+ },
8012
+ onColumnOrderChange: () => {
8013
+ const allCols = apiRef.current?.getAllColumns();
8014
+ if (allCols) {
8015
+ setColumnOrder(allCols.map((col) => col.field));
8016
+ }
8017
+ },
8018
+ slots: {
8019
+ pagination: TableCustomPagination,
8020
+ columnMenu: handleColumnMenu,
8021
+ noRowsOverlay: CustomNoRowsOverlay,
8022
+ toolbar: TableCustomToolbar
8023
+ },
8024
+ slotProps: {
8025
+ noRowsOverlay: {
8026
+ namespace,
8027
+ noRowsText: options?.noRowsText
8028
+ },
8029
+ row: {
8030
+ onTouchStart: (e) => {
8031
+ const id2 = e.currentTarget.getAttribute("data-id");
8032
+ if (!id2) return;
8033
+ const rowId = isNaN(Number(id2)) ? id2 : Number(id2);
8034
+ timerRef.current = setTimeout(() => {
8035
+ handleLongTouchStart(rowId);
8036
+ }, 500);
8037
+ },
8038
+ onTouchEnd: () => clearTimeout(timerRef.current),
8039
+ onTouchMove: () => clearTimeout(timerRef.current)
8040
+ },
8041
+ loadingOverlay: {
8042
+ variant: "linear-progress",
8043
+ noRowsVariant: "skeleton"
8044
+ },
8045
+ toolbar: {
8046
+ apiRef,
8047
+ options,
8048
+ columns: gridColumns,
8049
+ columnVisibilityModel,
8050
+ defaultSortModel,
8051
+ sortModel,
8052
+ setSortModel,
8053
+ excelOptions: {
8054
+ disableToolbarButton: options?.excelOptions?.disableExport || false,
8055
+ fileName: options?.excelOptions?.fileName || "excel-export",
8056
+ allColumns: options?.excelOptions?.allColumns || false,
8057
+ includeHeaders: options?.excelOptions?.includeHeaders || true
8058
+ },
8059
+ handleRefresh,
8060
+ isLoading: loading,
8061
+ handleSelectAll,
8062
+ handleClearSelection,
8063
+ rows
8064
+ }
8065
+ },
8066
+ rowHeight,
8067
+ sx: {
8068
+ "& .MuiDataGrid-cell": {
8069
+ display: "flex",
8070
+ alignItems: "center"
8071
+ },
8072
+ "& .MuiDataGrid-columnHeader": {
8073
+ display: "flex",
8074
+ alignItems: "center"
8075
+ },
8076
+ "& .MuiDataGrid-columnHeader--pinnedRight, & .MuiDataGrid-cell--pinnedRight": {
8077
+ backgroundColor: "background.paper"
8078
+ },
8079
+ borderRadius: 1
8080
+ },
8081
+ localeText: {
8082
+ // Управление колонками и меню
8083
+ columnMenuHideColumn: t("Hide column", { ns: "table_component" }),
8084
+ columnMenuManageColumns: t("Manage columns", { ns: "table_component" }),
8085
+ columnMenuShowColumns: t("Show columns", { ns: "table_component" }),
8086
+ columnMenuUnsort: t("Cancel sorting", { ns: "table_component" }),
8087
+ columnMenuSortAsc: t("Sort by ascending", { ns: "table_component" }),
8088
+ columnMenuSortDesc: t("Sort by descending", { ns: "table_component" }),
8089
+ columnHeaderSortIconLabel: t("Sort", { ns: "table_component" }),
8090
+ columnMenuFilter: t("Filter", { ns: "table_component" }),
8091
+ // Тексты панели управления колонками (Manage columns)
8092
+ columnsManagementSearchTitle: t("Search", { ns: "table_component" }),
8093
+ columnsManagementShowHideAllText: t("Show/Hide All", { ns: "table_component" }),
8094
+ columnsManagementReset: t("Reset", { ns: "table_component" }),
8095
+ // Экспорт
8096
+ toolbarExportExcel: t("Export to Excel", { ns: "table_component" }),
8097
+ footerRowSelected: (formattedCount) => {
8098
+ return t("Selected", { ns: "table_component" }) + ": " + formattedCount.toString();
8099
+ }
8100
+ }
8101
+ }
8102
+ ),
8103
+ renderBatchActions && /* @__PURE__ */ jsx29(
8104
+ TableBatchActionBar,
8105
+ {
8106
+ selectedRows,
8107
+ selectedIds: rowSelectionModel,
8108
+ onClearSelection: handleClearSelection,
8109
+ renderBatchActions
8110
+ }
8111
+ ),
8112
+ dialogs
8113
+ ] });
8114
+ }
8115
+ var TableComponent = forwardRef4(TableComponentInner);
8116
+
8117
+ // src/services/index.ts
8118
+ var Services = {
8119
+ SessionService: {
8120
+ fetchCompanySessions,
8121
+ trackUserSession,
8122
+ trackUserSessionByRoute,
8123
+ fetchUserSessions,
8124
+ isCurrentSessionValid,
8125
+ groupSessionsByUser,
8126
+ getUserLastSeenAt,
8127
+ getUsersLastSeenMap
8128
+ }
8129
+ };
8130
+
3539
8131
  // src/utils/session.events.ts
3540
8132
  var channel = typeof window !== "undefined" ? new BroadcastChannel("session_activity") : null;
3541
8133
  var notifySessionChange = () => {
@@ -3591,6 +8183,7 @@ export {
3591
8183
  Services,
3592
8184
  SupabaseProvider,
3593
8185
  SwitchComponent,
8186
+ TableComponent,
3594
8187
  TablePaginationComponent,
3595
8188
  TextFieldComponent,
3596
8189
  ThemeProvider,
@@ -3622,3 +8215,41 @@ export {
3622
8215
  useTranslationNamespace,
3623
8216
  useUserSettings
3624
8217
  };
8218
+ /*! Bundled license information:
8219
+
8220
+ react-is/cjs/react-is.production.min.js:
8221
+ (** @license React v16.13.1
8222
+ * react-is.production.min.js
8223
+ *
8224
+ * Copyright (c) Facebook, Inc. and its affiliates.
8225
+ *
8226
+ * This source code is licensed under the MIT license found in the
8227
+ * LICENSE file in the root directory of this source tree.
8228
+ *)
8229
+
8230
+ react-is/cjs/react-is.development.js:
8231
+ (** @license React v16.13.1
8232
+ * react-is.development.js
8233
+ *
8234
+ * Copyright (c) Facebook, Inc. and its affiliates.
8235
+ *
8236
+ * This source code is licensed under the MIT license found in the
8237
+ * LICENSE file in the root directory of this source tree.
8238
+ *)
8239
+
8240
+ object-assign/index.js:
8241
+ (*
8242
+ object-assign
8243
+ (c) Sindre Sorhus
8244
+ @license MIT
8245
+ *)
8246
+
8247
+ @mui/x-data-grid/index.mjs:
8248
+ (**
8249
+ * @mui/x-data-grid v9.15.0
8250
+ *
8251
+ * @license MIT
8252
+ * This source code is licensed under the MIT license found in the
8253
+ * LICENSE file in the root directory of this source tree.
8254
+ *)
8255
+ */